mirror of
https://github.com/holub/mame
synced 2025-04-22 16:31:49 +03:00
Merge pull request #161 from fulivi/mds2_dev
Improvments to imds2 driver (fulivi)
This commit is contained in:
commit
4b65eb4a94
@ -152,11 +152,6 @@ READ8_MEMBER( pic8259_device::read )
|
||||
if ( m_ocw3 & 0x04 )
|
||||
{
|
||||
/* Polling mode */
|
||||
if ( m_isr & ~m_imr )
|
||||
{
|
||||
acknowledge();
|
||||
}
|
||||
|
||||
if ( m_irr & ~m_imr )
|
||||
{
|
||||
/* check the various IRQs */
|
||||
@ -168,6 +163,7 @@ READ8_MEMBER( pic8259_device::read )
|
||||
break;
|
||||
}
|
||||
}
|
||||
acknowledge();
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -309,13 +309,14 @@ void i8275_device::device_timer(emu_timer &timer, device_timer_id id, int param,
|
||||
m_vsp = (m_stored_attr & FAC_B) ? 1 : 0;
|
||||
m_gpa = (m_stored_attr & FAC_GG) >> 2;
|
||||
m_rvv = (m_stored_attr & FAC_R) ? 1 : 0;
|
||||
m_lten = (m_stored_attr & FAC_U) ? 1 : 0;
|
||||
m_lten = ((m_stored_attr & FAC_U) != 0) && (lc == UNDERLINE) ? 1 : 0;
|
||||
|
||||
for (int sx = 0; sx < CHARACTERS_PER_ROW; sx++)
|
||||
{
|
||||
int m_lineattr = 0;
|
||||
int lten = 0;
|
||||
int vsp = 0;
|
||||
int rvv = 0;
|
||||
|
||||
UINT8 data = m_buffer[!m_buffer_dma][sx];
|
||||
|
||||
@ -328,7 +329,7 @@ void i8275_device::device_timer(emu_timer &timer, device_timer_id id, int param,
|
||||
m_vsp = (data & FAC_B) ? 1 : 0;
|
||||
m_gpa = (data & FAC_GG) >> 2;
|
||||
m_rvv = (data & FAC_R) ? 1 : 0;
|
||||
m_lten = (data & FAC_U) ? 1 : 0;
|
||||
m_lten = ((data & FAC_U) != 0) && (lc == UNDERLINE) ? 1 : 0;
|
||||
if ((SCANLINES_PER_ROW - lc)==1)
|
||||
m_stored_attr = data;
|
||||
|
||||
@ -412,7 +413,7 @@ void i8275_device::device_timer(emu_timer &timer, device_timer_id id, int param,
|
||||
}
|
||||
else
|
||||
{
|
||||
lten = vis;
|
||||
rvv = vis;
|
||||
}
|
||||
}
|
||||
|
||||
@ -429,7 +430,7 @@ void i8275_device::device_timer(emu_timer &timer, device_timer_id id, int param,
|
||||
(data & 0x7f), // char code to be displayed
|
||||
m_lineattr, // line attribute code
|
||||
lten | m_lten, // light enable signal
|
||||
m_rvv, // reverse video signal
|
||||
rvv ^ m_rvv, // reverse video signal
|
||||
vsp, // video suppression
|
||||
m_gpa, // general purpose attribute code
|
||||
m_hlgt // highlight
|
||||
|
@ -135,6 +135,91 @@ static floperr_t imd_read_indexed_sector(floppy_image_legacy *floppy, int head,
|
||||
return internal_imd_read_sector(floppy, head, track, sector, TRUE, buffer, buflen);
|
||||
}
|
||||
|
||||
static floperr_t imd_expand_file(floppy_image_legacy *floppy , UINT64 offset , size_t amount)
|
||||
{
|
||||
if (amount == 0) {
|
||||
return FLOPPY_ERROR_SUCCESS;
|
||||
}
|
||||
|
||||
UINT64 file_size = floppy_image_size(floppy);
|
||||
|
||||
if (offset > file_size) {
|
||||
return FLOPPY_ERROR_INTERNAL;
|
||||
}
|
||||
|
||||
UINT64 size_after_off = file_size - offset;
|
||||
|
||||
if (size_after_off == 0) {
|
||||
return FLOPPY_ERROR_SUCCESS;
|
||||
}
|
||||
|
||||
UINT8 *buffer = global_alloc_array(UINT8 , size_after_off);
|
||||
|
||||
// Read the part of file after offset
|
||||
floppy_image_read(floppy , buffer , offset , size_after_off);
|
||||
|
||||
// Add zeroes
|
||||
floppy_image_write_filler(floppy , 0 , offset , amount);
|
||||
|
||||
// Write back the part of file after offset
|
||||
floppy_image_write(floppy, buffer, offset + amount, size_after_off);
|
||||
|
||||
global_free_array(buffer);
|
||||
|
||||
// Update track offsets
|
||||
struct imddsk_tag *tag = get_tag(floppy);
|
||||
for (int track = 0; track < tag->tracks; track++) {
|
||||
for (int head = 0; head < tag->heads; head++) {
|
||||
UINT64 *track_off = &(tag->track_offsets[ (track << 1) + head ]);
|
||||
if (*track_off >= offset) {
|
||||
*track_off += amount;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return FLOPPY_ERROR_SUCCESS;
|
||||
}
|
||||
|
||||
static floperr_t imd_write_indexed_sector(floppy_image_legacy *floppy, int head, int track, int sector_index, const void *buffer, size_t buflen, int ddam)
|
||||
{
|
||||
UINT64 offset;
|
||||
floperr_t err;
|
||||
UINT8 header[1];
|
||||
|
||||
// take sector offset
|
||||
err = get_offset(floppy, head, track, sector_index, TRUE, &offset);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
floppy_image_read(floppy, header, offset, 1);
|
||||
|
||||
switch (header[ 0 ]) {
|
||||
case 0:
|
||||
return FLOPPY_ERROR_SEEKERROR;
|
||||
|
||||
default:
|
||||
// Expand image file (from 1 byte to a whole sector)
|
||||
err = imd_expand_file(floppy , offset , buflen - 1);
|
||||
if (err) {
|
||||
return err;
|
||||
}
|
||||
// Fall through!
|
||||
|
||||
case 1:
|
||||
case 3:
|
||||
case 5:
|
||||
case 7:
|
||||
// Turn every kind of sector into type 1 (normal data)
|
||||
header[ 0 ] = 1;
|
||||
floppy_image_write(floppy, header, offset, 1);
|
||||
// Write sector
|
||||
floppy_image_write(floppy, buffer, offset + 1, buflen);
|
||||
break;
|
||||
}
|
||||
|
||||
return FLOPPY_ERROR_SUCCESS;
|
||||
}
|
||||
|
||||
static floperr_t imd_get_sector_length(floppy_image_legacy *floppy, int head, int track, int sector, UINT32 *sector_length)
|
||||
{
|
||||
floperr_t err;
|
||||
@ -266,6 +351,7 @@ FLOPPY_CONSTRUCT( imd_dsk_construct )
|
||||
callbacks = floppy_callbacks(floppy);
|
||||
callbacks->read_sector = imd_read_sector;
|
||||
callbacks->read_indexed_sector = imd_read_indexed_sector;
|
||||
callbacks->write_indexed_sector = imd_write_indexed_sector;
|
||||
callbacks->get_sector_length = imd_get_sector_length;
|
||||
callbacks->get_heads_per_disk = imd_get_heads_per_disk;
|
||||
callbacks->get_tracks_per_disk = imd_get_tracks_per_disk;
|
||||
@ -380,10 +466,10 @@ bool imd_format::load(io_generic *io, UINT32 form_factor, floppy_image *image)
|
||||
|
||||
for(int i=0; i<sector_count; i++) {
|
||||
UINT8 stype = img[pos++];
|
||||
sects[i].track = tnum ? tnum[i] : track;
|
||||
sects[i].head = hnum ? hnum[i] : head;
|
||||
sects[i].sector = snum[i];
|
||||
sects[i].size = ssize;
|
||||
sects[i].track = tnum ? tnum[i] : track;
|
||||
sects[i].head = hnum ? hnum[i] : head;
|
||||
sects[i].sector = snum[i];
|
||||
sects[i].size = ssize;
|
||||
sects[i].actual_size = actual_size;
|
||||
|
||||
if(stype == 0 || stype > 8) {
|
||||
|
@ -35,7 +35,7 @@
|
||||
//
|
||||
// This board acts as a controller for all I/O of the system.
|
||||
// It is structured as if it were 2 boards in one:
|
||||
// One part (around 8080) controls Keyboard, CRT & floppy, the other part (around PIO 8741) controls all parallel I/Os
|
||||
// One part (around 8080) controls Keyboard, CRT & floppy, the other part (around PIO 8041A) controls all parallel I/Os
|
||||
// (Line printer, Paper tape puncher, Paper tape reader, I/O to PROM programmer).
|
||||
// Both parts are interfaced to IPC through a bidirectional 8-bit bus.
|
||||
// IOC is composed of these parts:
|
||||
@ -51,7 +51,7 @@
|
||||
// A20 8275 CRT controller
|
||||
// A19 2708 Character generator ROM
|
||||
// LS1 3.3 kHz beeper
|
||||
//*A72 8741-4 CPU @ 6 MHz (PIO: parallel I/O)
|
||||
// A72 8041A CPU @ 6 MHz (PIO: parallel I/O)
|
||||
//
|
||||
// **********
|
||||
// Keyboard controller
|
||||
@ -62,10 +62,13 @@
|
||||
//
|
||||
// ICs that are not emulated yet are marked with "*"
|
||||
//
|
||||
// NOTE:
|
||||
// Firmware running on PIO is NOT original because a dump is not available at the moment.
|
||||
// Emulator runs a version of PIO firmware that was specifically developped by me to implement
|
||||
// line printer output.
|
||||
//
|
||||
// TODO:
|
||||
// - Improve keyboard mapping
|
||||
// - Emulate PIO. No known dumps of its ROM are available, though.
|
||||
// - Emulate line printer output on PIO
|
||||
// - Find a dump of the original PIO firmware
|
||||
// - Emulate serial channels on IPC
|
||||
// - Emulate PIT on IPC
|
||||
// - Adjust speed of processors. Wait states are not accounted for yet.
|
||||
@ -87,8 +90,6 @@
|
||||
// should be mounted and the system reset. After a few seconds the ISIS-II
|
||||
// prompt should appear. A command that could be tried is "DIR" that lists
|
||||
// the content of floppy disk.
|
||||
// Please note that the message "FAILURE -- PIO NOT RESPONDING" is normal
|
||||
// as the support for PIO isn't implemented yet
|
||||
|
||||
#include "includes/imds2.h"
|
||||
|
||||
@ -101,6 +102,9 @@
|
||||
// FDC oscillator of IOC board: 8 MHz
|
||||
#define IOC_XTAL_Y1 XTAL_8MHz
|
||||
|
||||
// PIO oscillator: 6 MHz
|
||||
#define IOC_XTAL_Y3 XTAL_6MHz
|
||||
|
||||
// Frequency of beeper
|
||||
#define IOC_BEEP_FREQ 3300
|
||||
|
||||
@ -112,12 +116,13 @@ static ADDRESS_MAP_START(ipc_io_map , AS_IO , 8 , imds2_state)
|
||||
ADDRESS_MAP_UNMAP_LOW
|
||||
AM_RANGE(0xc0 , 0xc0) AM_READWRITE(imds2_ipc_dbbout_r , imds2_ipc_dbbin_data_w)
|
||||
AM_RANGE(0xc1 , 0xc1) AM_READWRITE(imds2_ipc_status_r , imds2_ipc_dbbin_cmd_w)
|
||||
AM_RANGE(0xf8 , 0xf9) AM_DEVREADWRITE("iocpio" , i8041_device , upi41_master_r , upi41_master_w)
|
||||
AM_RANGE(0xfa , 0xfb) AM_READWRITE(imds2_ipclocpic_r , imds2_ipclocpic_w)
|
||||
AM_RANGE(0xfc , 0xfd) AM_READWRITE(imds2_ipcsyspic_r , imds2_ipcsyspic_w)
|
||||
AM_RANGE(0xff , 0xff) AM_WRITE(imds2_ipc_control_w)
|
||||
ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START(ioc_mem_map , AS_PROGRAM , 8 , imds2_state)
|
||||
static ADDRESS_MAP_START(ioc_mem_map , AS_PROGRAM , 8 , imds2_state)
|
||||
ADDRESS_MAP_UNMAP_HIGH
|
||||
AM_RANGE(0x0000 , 0x1fff) AM_ROM
|
||||
AM_RANGE(0x4000 , 0x5fff) AM_RAM
|
||||
@ -143,6 +148,11 @@ static ADDRESS_MAP_START(ioc_io_map , AS_IO , 8 , imds2_state)
|
||||
AM_RANGE(0xf0 , 0xf8) AM_DEVREADWRITE("iocdma" , i8257_device , read , write)
|
||||
ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START(pio_io_map , AS_IO , 8 , imds2_state)
|
||||
AM_RANGE(MCS48_PORT_P1 , MCS48_PORT_P1) AM_READWRITE(imds2_pio_port_p1_r , imds2_pio_port_p1_w)
|
||||
AM_RANGE(MCS48_PORT_P2 , MCS48_PORT_P2) AM_READWRITE(imds2_pio_port_p2_r , imds2_pio_port_p2_w)
|
||||
ADDRESS_MAP_END
|
||||
|
||||
static ADDRESS_MAP_START(kb_io_map , AS_IO , 8 , imds2_state)
|
||||
AM_RANGE(MCS48_PORT_P1 , MCS48_PORT_P1) AM_WRITE(imds2_kb_port_p1_w)
|
||||
AM_RANGE(MCS48_PORT_P2 , MCS48_PORT_P2) AM_READ(imds2_kb_port_p2_r)
|
||||
@ -161,10 +171,12 @@ imds2_state::imds2_state(const machine_config &mconfig, device_type type, const
|
||||
m_iocbeep(*this , "iocbeep"),
|
||||
m_ioctimer(*this , "ioctimer"),
|
||||
m_iocfdc(*this , "iocfdc"),
|
||||
m_iocpio(*this , "iocpio"),
|
||||
m_kbcpu(*this , "kbcpu"),
|
||||
m_palette(*this , "palette"),
|
||||
m_gfxdecode(*this, "gfxdecode"),
|
||||
m_floppy0(*this , FLOPPY_0),
|
||||
m_centronics(*this , "centronics"),
|
||||
m_io_key0(*this , "KEY0"),
|
||||
m_io_key1(*this , "KEY1"),
|
||||
m_io_key2(*this , "KEY2"),
|
||||
@ -173,7 +185,8 @@ imds2_state::imds2_state(const machine_config &mconfig, device_type type, const
|
||||
m_io_key5(*this , "KEY5"),
|
||||
m_io_key6(*this , "KEY6"),
|
||||
m_io_key7(*this , "KEY7"),
|
||||
m_ioc_options(*this , "IOC_OPTS")
|
||||
m_ioc_options(*this , "IOC_OPTS"),
|
||||
m_device_status_byte(0xff)
|
||||
{
|
||||
}
|
||||
|
||||
@ -370,7 +383,7 @@ WRITE8_MEMBER(imds2_state::imds2_ioc_reset_f1_w)
|
||||
|
||||
READ8_MEMBER(imds2_state::imds2_ioc_status_r)
|
||||
{
|
||||
return (~m_ipc_ioc_status & 0x0f) | 0xf0;
|
||||
return ~m_ipc_ioc_status;
|
||||
}
|
||||
|
||||
READ8_MEMBER(imds2_state::imds2_ioc_dbbin_r)
|
||||
@ -428,6 +441,64 @@ WRITE8_MEMBER(imds2_state::imds2_ioc_mem_w)
|
||||
return prog_space.write_byte(offset , data);
|
||||
}
|
||||
|
||||
READ8_MEMBER(imds2_state::imds2_pio_port_p1_r)
|
||||
{
|
||||
// If STATUS ENABLE/ == 0 return inverted device status byte, else return 0xff
|
||||
// STATUS ENABLE/ == 0 when P23-P20 == 12 & P24 == 0 & P25 = 1 & P26 = 1
|
||||
if ((m_pio_port2 & 0x7f) == 0x6c) {
|
||||
return ~m_device_status_byte;
|
||||
} else {
|
||||
return 0xff;
|
||||
}
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(imds2_state::imds2_pio_port_p1_w)
|
||||
{
|
||||
m_pio_port1 = data;
|
||||
imds2_update_printer();
|
||||
}
|
||||
|
||||
READ8_MEMBER(imds2_state::imds2_pio_port_p2_r)
|
||||
{
|
||||
return m_pio_port2;
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(imds2_state::imds2_pio_port_p2_w)
|
||||
{
|
||||
m_pio_port2 = data;
|
||||
imds2_update_printer();
|
||||
// Send INTR to IPC
|
||||
m_ipclocpic->ir5_w(BIT(data , 7));
|
||||
}
|
||||
|
||||
WRITE_LINE_MEMBER(imds2_state::imds2_pio_lpt_ack_w)
|
||||
{
|
||||
if (state) {
|
||||
m_device_status_byte |= 0x20;
|
||||
} else {
|
||||
m_device_status_byte &= ~0x20;
|
||||
}
|
||||
}
|
||||
|
||||
WRITE_LINE_MEMBER(imds2_state::imds2_pio_lpt_busy_w)
|
||||
{
|
||||
// Busy is active high in centronics_device whereas it's active low in MDS
|
||||
if (!state) {
|
||||
m_device_status_byte |= 0x10;
|
||||
} else {
|
||||
m_device_status_byte &= ~0x10;
|
||||
}
|
||||
}
|
||||
|
||||
WRITE_LINE_MEMBER(imds2_state::imds2_pio_lpt_select_w)
|
||||
{
|
||||
if (state) {
|
||||
m_device_status_byte |= 0x40;
|
||||
} else {
|
||||
m_device_status_byte &= ~0x40;
|
||||
}
|
||||
}
|
||||
|
||||
I8275_DRAW_CHARACTER_MEMBER(imds2_state::crtc_display_pixels)
|
||||
{
|
||||
unsigned i;
|
||||
@ -538,18 +609,40 @@ void imds2_state::imds2_update_beeper(void)
|
||||
m_iocbeep->set_state(m_beeper_timer == 0 && BIT(m_miscout , 0) == 0);
|
||||
}
|
||||
|
||||
void imds2_state::imds2_update_printer(void)
|
||||
{
|
||||
// Data to printer is ~P1 when STATUS ENABLE/==1, else 0xff (assuming pull-ups on printer)
|
||||
UINT8 printer_data;
|
||||
if ((m_pio_port2 & 0x7f) == 0x6c) {
|
||||
printer_data = 0xff;
|
||||
} else {
|
||||
printer_data = ~m_pio_port1;
|
||||
}
|
||||
m_centronics->write_data0(BIT(printer_data , 0));
|
||||
m_centronics->write_data1(BIT(printer_data , 1));
|
||||
m_centronics->write_data2(BIT(printer_data , 2));
|
||||
m_centronics->write_data3(BIT(printer_data , 3));
|
||||
m_centronics->write_data4(BIT(printer_data , 4));
|
||||
m_centronics->write_data5(BIT(printer_data , 5));
|
||||
m_centronics->write_data6(BIT(printer_data , 6));
|
||||
m_centronics->write_data7(BIT(printer_data , 7));
|
||||
|
||||
// LPT DATA STROBE/ == 0 when P23-P20 == 9 & P24 == 0
|
||||
m_centronics->write_strobe((m_pio_port2 & 0x1f) != 0x09);
|
||||
}
|
||||
|
||||
static INPUT_PORTS_START(imds2)
|
||||
// See [1], pg 56 for key matrix layout
|
||||
// See [1], pg 57 for keyboard layout
|
||||
PORT_START("KEY0")
|
||||
PORT_BIT(0x01 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_TAB) PORT_CHAR('\t') // OK
|
||||
PORT_BIT(0x02 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR('@') PORT_CHAR('`')
|
||||
PORT_BIT(0x02 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_COLON) PORT_CHAR('@') PORT_CHAR('`') // OK
|
||||
PORT_BIT(0x04 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR('<') // OK
|
||||
PORT_BIT(0x08 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13) // OK
|
||||
PORT_BIT(0x10 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ')
|
||||
PORT_BIT(0x20 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_QUOTE) PORT_CHAR(':') PORT_CHAR('*') // '
|
||||
PORT_BIT(0x40 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR('>') // .
|
||||
PORT_BIT(0x80 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_SLASH) PORT_CHAR('/') PORT_CHAR('?')
|
||||
PORT_BIT(0x10 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ') // OK
|
||||
PORT_BIT(0x20 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_BACKSLASH) PORT_CHAR(':') PORT_CHAR('*') // OK
|
||||
PORT_BIT(0x40 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR('>') // OK
|
||||
PORT_BIT(0x80 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_SLASH) PORT_CHAR('/') PORT_CHAR('?') // OK
|
||||
|
||||
PORT_START("KEY1")
|
||||
PORT_BIT(0x01 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_Z) PORT_CHAR('z') PORT_CHAR('Z') // OK
|
||||
@ -563,13 +656,13 @@ static INPUT_PORTS_START(imds2)
|
||||
|
||||
PORT_START("KEY2")
|
||||
PORT_BIT(0x01 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_0) PORT_CHAR('0') PORT_CHAR('~') // OK
|
||||
PORT_BIT(0x02 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR('[') PORT_CHAR('{')
|
||||
PORT_BIT(0x02 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR('[') PORT_CHAR('{') // OK
|
||||
PORT_BIT(0x04 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_O) PORT_CHAR('o') PORT_CHAR('O') // OK
|
||||
PORT_BIT(0x08 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_L) PORT_CHAR('l') PORT_CHAR('L') // OK
|
||||
PORT_BIT(0x10 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR(')') // OK
|
||||
PORT_BIT(0x20 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') PORT_CHAR('=') // OK
|
||||
PORT_BIT(0x40 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_P) PORT_CHAR('p') PORT_CHAR('P') // OK
|
||||
PORT_BIT(0x80 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_COLON) PORT_CHAR(';') PORT_CHAR('+')
|
||||
PORT_BIT(0x80 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_QUOTE) PORT_CHAR(';') PORT_CHAR('+') // OK
|
||||
|
||||
PORT_START("KEY3")
|
||||
PORT_BIT(0x01 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_S) PORT_CHAR('s') PORT_CHAR('S') // OK
|
||||
@ -604,17 +697,17 @@ static INPUT_PORTS_START(imds2)
|
||||
PORT_START("KEY6")
|
||||
PORT_BIT(0x01 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_BACKSPACE) PORT_CHAR(8) // BS
|
||||
PORT_BIT(0x02 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_HOME) PORT_CHAR(UCHAR_MAMEKEY(HOME)) // OK
|
||||
PORT_BIT(0x04 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_BACKSLASH) PORT_CHAR('\\') PORT_CHAR('|') // OK
|
||||
PORT_BIT(0x04 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_TILDE) PORT_CHAR('\\') PORT_CHAR('|') // OK
|
||||
PORT_BIT(0x08 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_RIGHT) PORT_CHAR(UCHAR_MAMEKEY(RIGHT)) // OK
|
||||
PORT_BIT(0x10 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_LCONTROL) PORT_CHAR(UCHAR_SHIFT_2) // OK
|
||||
PORT_BIT(0x20 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_LEFT) PORT_CHAR(UCHAR_MAMEKEY(LEFT)) // OK
|
||||
PORT_BIT(0x40 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHAR(']') PORT_CHAR('}')
|
||||
PORT_BIT(0x40 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHAR(']') PORT_CHAR('}') // OK
|
||||
PORT_BIT(0x80 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_UP) PORT_CHAR(UCHAR_MAMEKEY(UP)) // OK
|
||||
|
||||
PORT_START("KEY7")
|
||||
PORT_BIT(0x01 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_ESC) PORT_CHAR(UCHAR_MAMEKEY(ESC)) // OK
|
||||
PORT_BIT(0x02 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_DOWN) PORT_CHAR(UCHAR_MAMEKEY(DOWN)) // OK
|
||||
PORT_BIT(0x04 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_MINUS) PORT_CHAR('_') PORT_CHAR('^')
|
||||
PORT_BIT(0x04 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_EQUALS) PORT_CHAR('_') PORT_CHAR('^') // OK
|
||||
PORT_BIT(0x08 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_LSHIFT) PORT_CHAR(UCHAR_SHIFT_1) // OK
|
||||
PORT_BIT(0x10 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_LALT) PORT_CHAR(UCHAR_MAMEKEY(LALT)) // OK
|
||||
PORT_BIT(0x20 , IP_ACTIVE_LOW , IPT_KEYBOARD) PORT_CODE(KEYCODE_CAPSLOCK) PORT_TOGGLE PORT_CHAR(UCHAR_MAMEKEY(CAPSLOCK))
|
||||
@ -727,9 +820,18 @@ static MACHINE_CONFIG_START(imds2 , imds2_state)
|
||||
|
||||
MCFG_LEGACY_FLOPPY_DRIVE_ADD(FLOPPY_0, imds2_floppy_interface)
|
||||
|
||||
MCFG_CPU_ADD("iocpio" , I8041 , IOC_XTAL_Y3)
|
||||
MCFG_CPU_IO_MAP(pio_io_map)
|
||||
MCFG_QUANTUM_TIME(attotime::from_hz(100))
|
||||
|
||||
MCFG_CPU_ADD("kbcpu", I8741, XTAL_3_579545MHz) /* 3.579545 MHz */
|
||||
MCFG_CPU_IO_MAP(kb_io_map)
|
||||
MCFG_QUANTUM_TIME(attotime::from_hz(100))
|
||||
|
||||
MCFG_CENTRONICS_ADD("centronics", centronics_devices, "printer")
|
||||
MCFG_CENTRONICS_ACK_HANDLER(WRITELINE(imds2_state , imds2_pio_lpt_ack_w))
|
||||
MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(imds2_state , imds2_pio_lpt_busy_w))
|
||||
MCFG_CENTRONICS_PERROR_HANDLER(WRITELINE(imds2_state , imds2_pio_lpt_select_w))
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
ROM_START(imds2)
|
||||
@ -743,6 +845,13 @@ ROM_START(imds2)
|
||||
ROM_LOAD("ioc_a51.bin" , 0x0800 , 0x0800 , CRC(6aa2f86c) SHA1(d3a5314d86e3366545b4c97b29e323dfab383d5f))
|
||||
ROM_LOAD("ioc_a52.bin" , 0x1000 , 0x0800 , CRC(b88a38d5) SHA1(934716a1daec852f4d1f846510f42408df0c9584))
|
||||
ROM_LOAD("ioc_a53.bin" , 0x1800 , 0x0800 , CRC(c8df4bb9) SHA1(2dfb921e94ae7033a7182457b2f00657674d1b77))
|
||||
|
||||
// ROM definition of PIO controller (8041A)
|
||||
// For the time being a specially developped PIO firmware is used until a dump of the original PIO is
|
||||
// available.
|
||||
ROM_REGION(0x400 , "iocpio" , 0)
|
||||
ROM_LOAD("pio_a72.bin" , 0 , 0x400 , BAD_DUMP CRC(8c8e740b))
|
||||
|
||||
// ROM definition of keyboard controller (8741)
|
||||
ROM_REGION(0x400 , "kbcpu" , 0)
|
||||
ROM_LOAD("kbd511.bin" , 0 , 0x400 , CRC(ba7c4303) SHA1(19899af732d0ae1247bfc79979b1ee5f339ee5cf))
|
||||
|
@ -15,6 +15,7 @@
|
||||
#include "machine/pic8259.h"
|
||||
#include "machine/i8271.h"
|
||||
#include "imagedev/flopdrv.h"
|
||||
#include "bus/centronics/ctronics.h"
|
||||
|
||||
class imds2_state : public driver_device
|
||||
{
|
||||
@ -53,6 +54,13 @@ class imds2_state : public driver_device
|
||||
|
||||
DECLARE_READ8_MEMBER(imds2_ioc_mem_r);
|
||||
DECLARE_WRITE8_MEMBER(imds2_ioc_mem_w);
|
||||
DECLARE_READ8_MEMBER(imds2_pio_port_p1_r);
|
||||
DECLARE_WRITE8_MEMBER(imds2_pio_port_p1_w);
|
||||
DECLARE_READ8_MEMBER(imds2_pio_port_p2_r);
|
||||
DECLARE_WRITE8_MEMBER(imds2_pio_port_p2_w);
|
||||
DECLARE_WRITE_LINE_MEMBER(imds2_pio_lpt_ack_w);
|
||||
DECLARE_WRITE_LINE_MEMBER(imds2_pio_lpt_busy_w);
|
||||
DECLARE_WRITE_LINE_MEMBER(imds2_pio_lpt_select_w);
|
||||
|
||||
I8275_DRAW_CHARACTER_MEMBER(crtc_display_pixels);
|
||||
|
||||
@ -71,10 +79,12 @@ class imds2_state : public driver_device
|
||||
required_device<beep_device> m_iocbeep;
|
||||
required_device<pit8253_device> m_ioctimer;
|
||||
required_device<i8271_device> m_iocfdc;
|
||||
required_device<i8041_device> m_iocpio;
|
||||
required_device<i8741_device> m_kbcpu;
|
||||
required_device<palette_device> m_palette;
|
||||
required_device<gfxdecode_device> m_gfxdecode;
|
||||
required_device<legacy_floppy_image_device> m_floppy0;
|
||||
required_device<centronics_device> m_centronics;
|
||||
required_ioport m_io_key0;
|
||||
required_ioport m_io_key1;
|
||||
required_ioport m_io_key2;
|
||||
@ -90,6 +100,7 @@ class imds2_state : public driver_device
|
||||
bool imds2_in_ipc_rom(offs_t offset) const;
|
||||
|
||||
void imds2_update_beeper(void);
|
||||
void imds2_update_printer(void);
|
||||
|
||||
// IPC control port
|
||||
UINT8 m_ipc_control;
|
||||
@ -117,6 +128,15 @@ class imds2_state : public driver_device
|
||||
|
||||
// IPC/IOC status
|
||||
UINT8 m_ipc_ioc_status;
|
||||
|
||||
// PIO port 1
|
||||
UINT8 m_pio_port1;
|
||||
|
||||
// PIO port 2
|
||||
UINT8 m_pio_port2;
|
||||
|
||||
// PIO device status byte
|
||||
UINT8 m_device_status_byte;
|
||||
};
|
||||
|
||||
#endif /* _IMDS2_H_ */
|
||||
|
Loading…
Reference in New Issue
Block a user