diff options
Diffstat (limited to 'src/mess/drivers/compucolor.c')
-rw-r--r-- | src/mess/drivers/compucolor.c | 369 |
1 files changed, 174 insertions, 195 deletions
diff --git a/src/mess/drivers/compucolor.c b/src/mess/drivers/compucolor.c index de230a5fc0e..fc300876567 100644 --- a/src/mess/drivers/compucolor.c +++ b/src/mess/drivers/compucolor.c @@ -12,10 +12,11 @@ TODO: - - keyboard - - cursor - floppy - - option ROM + - video + - add-on ROM + - add-on RAM + - add-on unit */ @@ -26,7 +27,7 @@ #include "emu.h" #include "cpu/i8085/i8085.h" -#include "imagedev/floppy.h" +#include "machine/compclr_flp.h" #include "machine/ram.h" #include "machine/serial.h" #include "machine/tms5501.h" @@ -40,9 +41,9 @@ public: m_maincpu(*this, I8080_TAG), m_mioc(*this, TMS5501_TAG), m_vtac(*this, CRT5027_TAG), - m_floppy0(*this, TMS5501_TAG":0"), - m_floppy1(*this, TMS5501_TAG":1"), m_rs232(*this, RS232_TAG), + m_floppy0(*this, "cd0"), + m_floppy1(*this, "cd1"), m_char_rom(*this, "chargen"), m_video_ram(*this, "videoram"), m_y0(*this, "Y0"), @@ -67,9 +68,9 @@ public: required_device<cpu_device> m_maincpu; required_device<tms5501_device> m_mioc; required_device<crt5027_device> m_vtac; - required_device<floppy_connector> m_floppy0; - required_device<floppy_connector> m_floppy1; required_device<rs232_port_device> m_rs232; + required_device<compucolor_floppy_port_device> m_floppy0; + required_device<compucolor_floppy_port_device> m_floppy1; required_memory_region m_char_rom; required_shared_ptr<UINT8> m_video_ram; required_ioport m_y0; @@ -104,7 +105,6 @@ public: rgb_t m_palette[8]; UINT8 m_xo; - UINT8 m_xo_kbd; }; static ADDRESS_MAP_START( compucolor2_mem, AS_PROGRAM, 8, compucolor2_state ) @@ -114,187 +114,178 @@ static ADDRESS_MAP_START( compucolor2_mem, AS_PROGRAM, 8, compucolor2_state ) ADDRESS_MAP_END static ADDRESS_MAP_START( compucolor2_io, AS_IO, 8, compucolor2_state ) - //AM_RANGE(0x00, 0x0f) AM_MIRROR(0x10) AM_DEVICE(TMS5501_TAG, tms5501_device, io_map) + AM_RANGE(0x00, 0x0f) AM_MIRROR(0x10) AM_DEVICE(TMS5501_TAG, tms5501_device, io_map) AM_RANGE(0x60, 0x6f) AM_MIRROR(0x10) AM_DEVREADWRITE(CRT5027_TAG, crt5027_device, read, write) AM_RANGE(0x80, 0x9f) AM_MIRROR(0x60) AM_ROM AM_REGION("ua1", 0) ADDRESS_MAP_END static INPUT_PORTS_START( compucolor2 ) PORT_START("Y0") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0) PORT_CHAR('0') PORT_CHAR('=') - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SLASH) PORT_CHAR('/') PORT_CHAR('?') + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_O) PORT_CHAR('o') PORT_CHAR('O') + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("_ CRT") PORT_CHAR('_') + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("F15 PLOT ESC") + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("BL/A7 OFF") + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("BLINK ON") + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START("Y1") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR('>') + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_N) PORT_CHAR('n') PORT_CHAR('N') + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("^ USER") PORT_CHAR('^') + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("F14 CHAR RECT") + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("A7 ON") + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("BG ON") + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START("Y2") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') PORT_CHAR('=') + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("m M TERM MODE") PORT_CODE(KEYCODE_M) PORT_CHAR('m') PORT_CHAR('M') + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("] BLCK") PORT_CHAR(']') + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("F13 POINT X") + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("RETURN ENTER") PORT_CODE(KEYCODE_ENTER) PORT_CHAR('\r') + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("FG ON") + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad =") PORT_CODE(KEYCODE_ENTER_PAD) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START("Y3") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR('<') + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("l L LOCL") PORT_CODE(KEYCODE_L) PORT_CHAR('l') PORT_CHAR('L') + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("\\ 45 UP") PORT_CHAR('\\') + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("F12 POINT Y") + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("ERASE PAGE") + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(UTF8_UP) PORT_CODE(KEYCODE_UP) PORT_CHAR(UCHAR_MAMEKEY(UP)) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START("Y4") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COLON) PORT_CHAR(';') PORT_CHAR('+') + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("k K ROLL") PORT_CODE(KEYCODE_K) PORT_CHAR('k') PORT_CHAR('K') + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("[ VIS") PORT_CHAR('[') + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("F11 POINT INC") + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("ERASE LINE") + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_ESC) PORT_CHAR(UCHAR_MAMEKEY(ESC)) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad +") PORT_CODE(KEYCODE_PLUS_PAD) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START("Y5") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_QUOTE) PORT_CHAR(':') PORT_CHAR('*') + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_J) PORT_CHAR('j') PORT_CHAR('J') + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("z Z 45 DW") PORT_CODE(KEYCODE_Z) PORT_CHAR('z') PORT_CHAR('Z') + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("F10 X BAR XO") + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(UTF8_DOWN) PORT_CODE(KEYCODE_DOWN) PORT_CHAR(UCHAR_MAMEKEY(DOWN)) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(UTF8_LEFT) PORT_CODE(KEYCODE_LEFT) PORT_CODE(KEYCODE_BACKSPACE) PORT_CHAR(UCHAR_MAMEKEY(LEFT)) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Keypad X") PORT_CODE(KEYCODE_ASTERISK) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START("Y6") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR(')') + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_I) PORT_CHAR('i') PORT_CHAR('I') + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("y Y TEST") PORT_CODE(KEYCODE_Y) PORT_CHAR('y') PORT_CHAR('Y') + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("F9 X BAR Y") + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_TAB) PORT_CHAR(UCHAR_MAMEKEY(TAB)) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(UTF8_RIGHT) PORT_CODE(KEYCODE_RIGHT) PORT_CHAR(UCHAR_MAMEKEY(RIGHT)) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START("Y7") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) - - PORT_START("Y") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('(') + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("h H HALF") PORT_CODE(KEYCODE_H) PORT_CHAR('h') PORT_CHAR('H') + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("x X XMIT") PORT_CODE(KEYCODE_X) PORT_CHAR('x') PORT_CHAR('X') + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("F8 X BAR XM") + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("HOME") + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START("Y8") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('\'') + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("g G BELL") PORT_CODE(KEYCODE_G) PORT_CHAR('g') PORT_CHAR('G') + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("w W BASIC") PORT_CODE(KEYCODE_W) PORT_CHAR('w') PORT_CHAR('W') + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("F7 X BAR INC") + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("LIST") + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START("Y9") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHAR('&') + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F) PORT_CHAR('f') PORT_CHAR('F') + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("v V DEL LINE") PORT_CODE(KEYCODE_V) PORT_CHAR('v') PORT_CHAR('V') + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("F6 Y BAR YO") + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("POKE") + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START("Y10") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_CHAR('%') + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("e E BSC RST") PORT_CODE(KEYCODE_E) PORT_CHAR('e') PORT_CHAR('E') + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("u U INS LINE") PORT_CODE(KEYCODE_U) PORT_CHAR('u') PORT_CHAR('U') + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("F5 Y BAR X") + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("AUTO") + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("PRINT") + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START("Y11") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CHAR('$') + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("d D DISK FCS") PORT_CODE(KEYCODE_D) PORT_CHAR('d') PORT_CHAR('D') + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("t T TEXT EDIT") PORT_CODE(KEYCODE_T) PORT_CHAR('t') PORT_CHAR('T') + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("F4 Y BAR YM") + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("DELETE CHAR") + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("LOAD") + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START("Y12") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CHAR('#') + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("c C CURSOR X-Y") PORT_CODE(KEYCODE_C) PORT_CHAR('c') PORT_CHAR('C') + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("s S ASMB") PORT_CODE(KEYCODE_S) PORT_CHAR('s') PORT_CHAR('S') + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("F3 Y BAR INC") + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("INSERT LINE") + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("SAVE") + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START("Y13") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR('"') + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("b B PLOT") PORT_CODE(KEYCODE_B) PORT_CHAR('b') PORT_CHAR('B') + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("r R BAUD RATE") PORT_CODE(KEYCODE_R) PORT_CHAR('r') PORT_CHAR('R') + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("F2 VECT X1") + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("DELETE LINE") + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("PLOT") + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START("Y14") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!') + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("a A PROT BLND") PORT_CODE(KEYCODE_A) PORT_CHAR('a') PORT_CHAR('A') + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("q Q INS CHAR") PORT_CODE(KEYCODE_Q) PORT_CHAR('q') PORT_CHAR('Q') + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("F1 VECT Y1") + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("INSERT CHAR") + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("PUT") + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START("Y15") - PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0) PORT_CHAR('0') + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("@ NULL") PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR('@') + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("p P CPU OP SYS") PORT_CODE(KEYCODE_P) PORT_CHAR('p') PORT_CHAR('P') + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("F0 VECT INC") + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("BREAK ATTN") + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("OUT") + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("SPACE") PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ') + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START("Y128") - PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) // COMMAND, CONTROL - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) // SHIFT, SHIFT, COMMAND - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) // REPEAT + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("CPU RESET") + PORT_BIT( 0x0e, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("CTRL") PORT_CODE(KEYCODE_LCONTROL) PORT_CHAR(UCHAR_MAMEKEY(LCONTROL)) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("SHIFT") PORT_CODE(KEYCODE_LSHIFT) PORT_CODE(KEYCODE_RSHIFT) PORT_CHAR(UCHAR_SHIFT_1) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("REPEAT") PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("CAPS LOCK") PORT_CODE(KEYCODE_CAPSLOCK) PORT_CHAR(UCHAR_MAMEKEY(CAPSLOCK)) INPUT_PORTS_END @@ -338,14 +329,14 @@ UINT32 compucolor2_state::screen_update(screen_device &screen, bitmap_rgb32 &bit static struct tms9927_interface crtc_intf = { 8, // pixels per video memory address - NULL // "self-load data"? + NULL // self-load data }; READ8_MEMBER( compucolor2_state::xi_r ) { UINT8 data = 0xff; - switch (m_xo_kbd & 0x0f) + switch (m_xo & 0x0f) { case 0: data &= m_y0->read(); break; case 1: data &= m_y1->read(); break; @@ -365,9 +356,9 @@ READ8_MEMBER( compucolor2_state::xi_r ) case 15: data &= m_y15->read(); break; } - if (BIT(m_xo_kbd, 7)) + if (BIT(m_xo, 7)) { - data = m_y128->read() | (data & 0x0f); + data = (m_y128->read() & 0xf0) | (data & 0x0f); } return data; @@ -392,36 +383,23 @@ WRITE8_MEMBER( compucolor2_state::xo_w ) m_xo = data; - floppy_image_device *floppy = NULL; - switch ((m_xo >> 4) & 0x03) { - case 0: - // keyboard - m_xo_kbd = m_xo; - logerror("keyboard Y%u\n", m_xo_kbd&0x0f); - break; - case 1: - // floppy 0 - floppy = m_floppy0->get_device(); - logerror("internal floppy"); - break; + m_floppy0->select_w(0); + m_floppy0->rw_w(BIT(data, 3)); + m_floppy0->stepper_w(data & 0x07); - case 2: - // floppy 1 - floppy = m_floppy1->get_device(); - logerror("external floppy"); + m_floppy1->select_w(1); break; - } - if (floppy) - { - logerror(" stp %u rw %u\n", data&0x07,BIT(data,3)); - // TODO stepper + case 2: + m_floppy1->select_w(0); + m_floppy1->rw_w(BIT(data, 3)); + m_floppy1->stepper_w(data & 0x07); - // motor - floppy->mon_w(0); + m_floppy0->select_w(1); + break; } } @@ -434,23 +412,26 @@ WRITE_LINE_MEMBER( compucolor2_state::xmt_w ) break; case 1: - // TODO floppy 0 + m_floppy0->tx(state); break; case 2: - // TODO floppy 1 + m_floppy1->tx(state); break; } } IRQ_CALLBACK_MEMBER( compucolor2_state::int_ack ) { - return 0;// m_mioc->get_vector(); + return m_mioc->get_vector(); } void compucolor2_state::machine_start() { m_maincpu->set_irq_acknowledge_callback(device_irq_acknowledge_delegate(FUNC(compucolor2_state::int_ack), this)); + + // state saving + save_item(NAME(m_xo)); } void compucolor2_state::palette_init() @@ -461,10 +442,6 @@ void compucolor2_state::palette_init() } } -static SLOT_INTERFACE_START( compucolor2_floppies ) - SLOT_INTERFACE( "525sssd", FLOPPY_525_SSSD ) -SLOT_INTERFACE_END - static MACHINE_CONFIG_START( compucolor2, compucolor2_state ) // basic machine hardware MCFG_CPU_ADD(I8080_TAG, I8080, XTAL_17_9712MHz/9) @@ -480,18 +457,20 @@ static MACHINE_CONFIG_START( compucolor2, compucolor2_state ) MCFG_SCREEN_VISIBLE_AREA(0, 64*8-1, 0, 32*8-1) MCFG_DEVICE_ADD(CRT5027_TAG, CRT5027, XTAL_17_9712MHz/12) MCFG_DEVICE_CONFIG(crtc_intf) - //MCFG_TMS9927_VSYN_CALLBACK(DEVWRITELINE(TMS5501_TAG, tms5501_device, sens_w)) + MCFG_TMS9927_VSYN_CALLBACK(DEVWRITELINE(TMS5501_TAG, tms5501_device, sens_w)) // devices MCFG_DEVICE_ADD(TMS5501_TAG, TMS5501, XTAL_17_9712MHz/9) - //MCFG_TMS5501_IRQ_CALLBACK(INPUTLINE(I8080_TAG, I8085_INTR_LINE)) - //MCFG_TMS5501_XMT_CALLBACK(WRITELINE(compucolor2_state, xmt_w)) - //MCFG_TMS5501_XI_CALLBACK(READ8(compucolor2_state, xi_r)) - //MCFG_TMS5501_XO_CALLBACK(WRITE8(compucolor2_state, xo_w)) - MCFG_FLOPPY_DRIVE_ADD(TMS5501_TAG":0", compucolor2_floppies, "525sssd", floppy_image_device::default_floppy_formats) - MCFG_FLOPPY_DRIVE_ADD(TMS5501_TAG":1", compucolor2_floppies, NULL, floppy_image_device::default_floppy_formats) + MCFG_TMS5501_IRQ_CALLBACK(INPUTLINE(I8080_TAG, I8085_INTR_LINE)) + MCFG_TMS5501_XMT_CALLBACK(WRITELINE(compucolor2_state, xmt_w)) + MCFG_TMS5501_XI_CALLBACK(READ8(compucolor2_state, xi_r)) + MCFG_TMS5501_XO_CALLBACK(WRITE8(compucolor2_state, xo_w)) MCFG_RS232_PORT_ADD(RS232_TAG, default_rs232_devices, NULL) - //MCFG_SERIAL_OUT_RX_HANDLER(DEVWRITELINE(TMS5501_TAG, tms5501_device, rcv_w)) + MCFG_SERIAL_OUT_RX_HANDLER(DEVWRITELINE(TMS5501_TAG, tms5501_device, rcv_w)) + MCFG_COMPUCOLOR_FLOPPY_PORT_ADD("cd0", compucolor_floppy_port_devices, "floppy") + MCFG_SERIAL_OUT_RX_HANDLER(DEVWRITELINE(TMS5501_TAG, tms5501_device, rcv_w)) + MCFG_COMPUCOLOR_FLOPPY_PORT_ADD("cd1", compucolor_floppy_port_devices, NULL) + MCFG_SERIAL_OUT_RX_HANDLER(DEVWRITELINE(TMS5501_TAG, tms5501_device, rcv_w)) // internal ram MCFG_RAM_ADD(RAM_TAG) @@ -525,4 +504,4 @@ ROM_START( compclr2 ) ROM_LOAD( "82s129.ug5", 0x00, 0x20, NO_DUMP ) // Color PROM ROM_END -COMP( 1977, compclr2, 0, 0, compucolor2, compucolor2, driver_device, 0, "Intelligent Systems Corporation", "Compucolor II", GAME_IS_SKELETON | GAME_NOT_WORKING | GAME_NO_SOUND ) +COMP( 1977, compclr2, 0, 0, compucolor2, compucolor2, driver_device, 0, "Intelligent Systems Corporation", "Compucolor II", GAME_NOT_WORKING | GAME_NO_SOUND_HW ) |