src/mess/drivers/x1twin.c
| r0 | r13657 | |
| 1 | /************************************************************************************************ |
| 2 | |
| 3 | Sharp X1Twin = Sharp X1 + NEC PC Engine All-in-One |
| 4 | |
| 5 | Both systems doesn't interact at all, according to info on the net they just shares the |
| 6 | same "house". It doesn't even do super-imposing, not even with the in-built X1 feature apparently |
| 7 | |
| 8 | TODO: |
| 9 | - Find 100% trusted info about it. |
| 10 | - inherit pce_state into x1twin_state |
| 11 | - Needs video mods |
| 12 | |
| 13 | ************************************************************************************************/ |
| 14 | |
| 15 | #include "emu.h" |
| 16 | #include "includes/x1.h" |
| 17 | #include "cpu/z80/z80.h" |
| 18 | #include "cpu/z80/z80daisy.h" |
| 19 | #include "machine/z80ctc.h" |
| 20 | //#include "machine/z80sio.h" |
| 21 | #include "machine/z80dart.h" |
| 22 | #include "machine/i8255.h" |
| 23 | #include "machine/z80dma.h" |
| 24 | #include "sound/ay8910.h" |
| 25 | #include "video/mc6845.h" |
| 26 | #include "sound/2151intf.h" |
| 27 | #include "sound/wave.h" |
| 28 | #include "machine/wd17xx.h" |
| 29 | #include "imagedev/cassette.h" |
| 30 | #include "imagedev/flopdrv.h" |
| 31 | #include "formats/basicdsk.h" |
| 32 | #include "formats/x1_tap.h" |
| 33 | #include "imagedev/cartslot.h" |
| 34 | |
| 35 | #include "includes/pce.h" |
| 36 | #include "video/vdc.h" |
| 37 | #include "cpu/h6280/h6280.h" |
| 38 | #include "sound/c6280.h" |
| 39 | #include "machine/pcecommn.h" |
| 40 | |
| 41 | #include "rendlay.h" |
| 42 | |
| 43 | class x1twin_state : public x1_state |
| 44 | { |
| 45 | public: |
| 46 | x1twin_state(const machine_config &mconfig, device_type type, const char *tag) |
| 47 | : x1_state(mconfig, type, tag) |
| 48 | { } |
| 49 | }; |
| 50 | |
| 51 | |
| 52 | #define X1_MAIN_CLOCK XTAL_16MHz |
| 53 | #define VDP_CLOCK XTAL_42_9545MHz |
| 54 | #define MCU_CLOCK XTAL_6MHz |
| 55 | |
| 56 | static SCREEN_UPDATE( x1twin ) |
| 57 | { |
| 58 | device_t *left_screen = screen->machine().device("x1_screen"); |
| 59 | //device_t *right_screen = screen->machine().device("pce_screen"); |
| 60 | |
| 61 | if (screen==left_screen) |
| 62 | SCREEN_UPDATE_CALL( x1 ); |
| 63 | |
| 64 | return 0; |
| 65 | } |
| 66 | |
| 67 | static ADDRESS_MAP_START( x1_mem, AS_PROGRAM, 8 ) |
| 68 | ADDRESS_MAP_UNMAP_HIGH |
| 69 | AM_RANGE(0x0000, 0xffff) AM_READWRITE(x1_mem_r,x1_mem_w) |
| 70 | ADDRESS_MAP_END |
| 71 | |
| 72 | static ADDRESS_MAP_START( x1_io , AS_IO, 8 ) |
| 73 | ADDRESS_MAP_UNMAP_HIGH |
| 74 | AM_RANGE(0x0000, 0xffff) AM_READWRITE(x1_io_r, x1_io_w) |
| 75 | ADDRESS_MAP_END |
| 76 | |
| 77 | #if 0 |
| 78 | static ADDRESS_MAP_START( pce_mem , AS_PROGRAM, 8) |
| 79 | AM_RANGE( 0x000000, 0x09FFFF) AM_ROM |
| 80 | AM_RANGE( 0x1F0000, 0x1F1FFF) AM_RAM AM_MIRROR(0x6000) AM_BASE( &pce_user_ram ) |
| 81 | AM_RANGE( 0x1FE000, 0x1FE3FF) AM_READWRITE( vdc_0_r, vdc_0_w ) |
| 82 | AM_RANGE( 0x1FE400, 0x1FE7FF) AM_READWRITE( vce_r, vce_w ) |
| 83 | AM_RANGE( 0x1FE800, 0x1FEBFF) AM_DEVREADWRITE( "c6280", c6280_r, c6280_w ) |
| 84 | AM_RANGE( 0x1FEC00, 0x1FEFFF) AM_READWRITE( h6280_timer_r, h6280_timer_w ) |
| 85 | AM_RANGE( 0x1FF000, 0x1FF3FF) AM_READWRITE( pce_joystick_r, pce_joystick_w ) |
| 86 | AM_RANGE( 0x1FF400, 0x1FF7FF) AM_READWRITE( h6280_irq_status_r, h6280_irq_status_w ) |
| 87 | ADDRESS_MAP_END |
| 88 | |
| 89 | static ADDRESS_MAP_START( pce_io , AS_IO, 8) |
| 90 | AM_RANGE( 0x00, 0x03) AM_READWRITE( vdc_0_r, vdc_0_w ) |
| 91 | ADDRESS_MAP_END |
| 92 | #endif |
| 93 | |
| 94 | static const wd17xx_interface x1_mb8877a_interface = |
| 95 | { |
| 96 | DEVCB_NULL, |
| 97 | DEVCB_NULL, |
| 98 | DEVCB_NULL, |
| 99 | {FLOPPY_0, FLOPPY_1, FLOPPY_2, FLOPPY_3} |
| 100 | }; |
| 101 | |
| 102 | static I8255A_INTERFACE( ppi8255_intf ) |
| 103 | { |
| 104 | DEVCB_HANDLER(x1_porta_r), /* Port A read */ |
| 105 | DEVCB_HANDLER(x1_porta_w), /* Port A write */ |
| 106 | DEVCB_HANDLER(x1_portb_r), /* Port B read */ |
| 107 | DEVCB_HANDLER(x1_portb_w), /* Port B write */ |
| 108 | DEVCB_HANDLER(x1_portc_r), /* Port C read */ |
| 109 | DEVCB_HANDLER(x1_portc_w) /* Port C write */ |
| 110 | }; |
| 111 | |
| 112 | static const mc6845_interface mc6845_intf = |
| 113 | { |
| 114 | "x1_screen", /* screen we are acting on */ |
| 115 | 8, /* number of pixels per video memory address */ |
| 116 | NULL, /* before pixel update callback */ |
| 117 | NULL, /* row update callback */ |
| 118 | NULL, /* after pixel update callback */ |
| 119 | DEVCB_NULL, /* callback for display state changes */ |
| 120 | DEVCB_NULL, /* callback for cursor state changes */ |
| 121 | DEVCB_NULL, /* HSYNC callback */ |
| 122 | DEVCB_NULL, /* VSYNC callback */ |
| 123 | NULL /* update address callback */ |
| 124 | }; |
| 125 | |
| 126 | /************************************* |
| 127 | * |
| 128 | * Inputs |
| 129 | * |
| 130 | *************************************/ |
| 131 | |
| 132 | static INPUT_CHANGED( ipl_reset ) |
| 133 | { |
| 134 | //address_space *space = field.machine().device("x1_cpu")->memory().space(AS_PROGRAM); |
| 135 | x1twin_state *state = field.machine().driver_data<x1twin_state>(); |
| 136 | |
| 137 | device_set_input_line(state->m_x1_cpu, INPUT_LINE_RESET, newval ? CLEAR_LINE : ASSERT_LINE); |
| 138 | |
| 139 | state->m_ram_bank = 0x00; |
| 140 | if(state->m_is_turbo) { state->m_ex_bank = 0x10; } |
| 141 | //anything else? |
| 142 | } |
| 143 | |
| 144 | /* Apparently most games doesn't support this (not even the Konami ones!), one that does is...177 :o */ |
| 145 | static INPUT_CHANGED( nmi_reset ) |
| 146 | { |
| 147 | x1twin_state *state = field.machine().driver_data<x1twin_state>(); |
| 148 | |
| 149 | device_set_input_line(state->m_x1_cpu, INPUT_LINE_NMI, newval ? CLEAR_LINE : ASSERT_LINE); |
| 150 | } |
| 151 | |
| 152 | INPUT_PORTS_START( x1twin ) |
| 153 | PORT_START("FP_SYS") //front panel buttons, hard-wired with the soft reset/NMI lines |
| 154 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CHANGED(ipl_reset,0) PORT_NAME("IPL reset") |
| 155 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CHANGED(nmi_reset,0) PORT_NAME("NMI reset") |
| 156 | |
| 157 | PORT_START("SOUND_SW") //FIXME: this is X1Turbo specific |
| 158 | PORT_DIPNAME( 0x80, 0x80, "OPM Sound Setting?" ) |
| 159 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) |
| 160 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 161 | |
| 162 | PORT_START("IOSYS") //TODO: implement front-panel DIP-SW here |
| 163 | PORT_DIPNAME( 0x01, 0x01, "IOSYS" ) |
| 164 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) |
| 165 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 166 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) |
| 167 | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) |
| 168 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 169 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) |
| 170 | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) |
| 171 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 172 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) |
| 173 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) |
| 174 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 175 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) |
| 176 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) |
| 177 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 178 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) |
| 179 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) |
| 180 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 181 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) |
| 182 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) |
| 183 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 184 | PORT_DIPNAME( 0x80, 0x80, "Sound Setting?" ) |
| 185 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) |
| 186 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 187 | |
| 188 | PORT_START("P1") |
| 189 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY |
| 190 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY |
| 191 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY |
| 192 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY |
| 193 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 194 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) |
| 195 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) |
| 196 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 197 | |
| 198 | PORT_START("P2") |
| 199 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) |
| 200 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) |
| 201 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) |
| 202 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) |
| 203 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 204 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) |
| 205 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) |
| 206 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 207 | |
| 208 | PORT_START("key1") //0x00-0x1f |
| 209 | PORT_BIT(0x00000001,IP_ACTIVE_HIGH,IPT_UNUSED) //0x00 null |
| 210 | PORT_BIT(0x00000002,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("0-2") /*PORT_CODE(KEYCODE_1) PORT_CHAR('1')*/ |
| 211 | PORT_BIT(0x00000004,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("0-3") /*PORT_CODE(KEYCODE_2) PORT_CHAR('2')*/ |
| 212 | PORT_BIT(0x00000008,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("0-4") /*PORT_CODE(KEYCODE_3) PORT_CHAR('3')*/ |
| 213 | PORT_BIT(0x00000010,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("0-5") /*PORT_CODE(KEYCODE_4) PORT_CHAR('4')*/ |
| 214 | PORT_BIT(0x00000020,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("0-6") /*PORT_CODE(KEYCODE_5) PORT_CHAR('5')*/ |
| 215 | PORT_BIT(0x00000040,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("0-7") /*PORT_CODE(KEYCODE_6) PORT_CHAR('6')*/ |
| 216 | PORT_BIT(0x00000080,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("0-8") /*PORT_CODE(KEYCODE_7) PORT_CHAR('7')*/ |
| 217 | PORT_BIT(0x00000100,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Backspace") PORT_CODE(KEYCODE_BACKSPACE) PORT_CHAR(8) |
| 218 | PORT_BIT(0x00000200,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Tab") PORT_CODE(KEYCODE_TAB) PORT_CHAR(9) |
| 219 | PORT_BIT(0x00000400,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("1-3") /*PORT_CODE(KEYCODE_2) PORT_CHAR('2')*/ |
| 220 | PORT_BIT(0x00000800,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("1-4") /*PORT_CODE(KEYCODE_3) PORT_CHAR('3')*/ |
| 221 | PORT_BIT(0x00001000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("1-5") /*PORT_CODE(KEYCODE_4) PORT_CHAR('4')*/ |
| 222 | PORT_BIT(0x00002000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("RETURN") PORT_CODE(KEYCODE_ENTER) PORT_CHAR(27) |
| 223 | PORT_BIT(0x00004000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("1-7") /*PORT_CODE(KEYCODE_4) PORT_CHAR('4')*/ |
| 224 | PORT_BIT(0x00008000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("1-8") /*PORT_CODE(KEYCODE_4) PORT_CHAR('4')*/ |
| 225 | PORT_BIT(0x00010000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("2-1") /*PORT_CODE(KEYCODE_1) PORT_CHAR('1')*/ |
| 226 | PORT_BIT(0x00020000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("2-2") /*PORT_CODE(KEYCODE_1) PORT_CHAR('1')*/ |
| 227 | PORT_BIT(0x00040000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("2-3") /*PORT_CODE(KEYCODE_2) PORT_CHAR('2')*/ |
| 228 | PORT_BIT(0x00080000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("2-4") /*PORT_CODE(KEYCODE_3) PORT_CHAR('3')*/ |
| 229 | PORT_BIT(0x00100000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("2-5") /*PORT_CODE(KEYCODE_4) PORT_CHAR('4')*/ |
| 230 | PORT_BIT(0x00200000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("2-6") /*PORT_CODE(KEYCODE_5) PORT_CHAR('5')*/ |
| 231 | PORT_BIT(0x00400000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("2-7") /*PORT_CODE(KEYCODE_4) PORT_CHAR('4')*/ |
| 232 | PORT_BIT(0x00800000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("2-8") /*PORT_CODE(KEYCODE_5) PORT_CHAR('5')*/ |
| 233 | PORT_BIT(0x01000000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("3-1") /*PORT_CODE(KEYCODE_1) PORT_CHAR('1')*/ |
| 234 | PORT_BIT(0x02000000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("3-2") /*PORT_CODE(KEYCODE_1) PORT_CHAR('1')*/ |
| 235 | PORT_BIT(0x04000000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("3-3") /*PORT_CODE(KEYCODE_2) PORT_CHAR('2')*/ |
| 236 | PORT_BIT(0x08000000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("ESC") PORT_CODE(KEYCODE_ESC) PORT_CHAR(27) |
| 237 | PORT_BIT(0x10000000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Right") PORT_CODE(KEYCODE_RIGHT) |
| 238 | PORT_BIT(0x20000000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Left") PORT_CODE(KEYCODE_LEFT) |
| 239 | PORT_BIT(0x40000000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Up") PORT_CODE(KEYCODE_UP) |
| 240 | PORT_BIT(0x80000000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Down") PORT_CODE(KEYCODE_DOWN) |
| 241 | |
| 242 | PORT_START("key2") //0x20-0x3f |
| 243 | PORT_BIT(0x00000001,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Space") PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ') |
| 244 | PORT_BIT(0x00000002,IP_ACTIVE_HIGH,IPT_UNUSED) //0x21 ! |
| 245 | PORT_BIT(0x00000004,IP_ACTIVE_HIGH,IPT_UNUSED) //0x22 " |
| 246 | PORT_BIT(0x00000008,IP_ACTIVE_HIGH,IPT_UNUSED) //0x23 # |
| 247 | PORT_BIT(0x00000010,IP_ACTIVE_HIGH,IPT_UNUSED) //0x24 $ |
| 248 | PORT_BIT(0x00000020,IP_ACTIVE_HIGH,IPT_UNUSED) //0x25 % |
| 249 | PORT_BIT(0x00000040,IP_ACTIVE_HIGH,IPT_UNUSED) //0x26 & |
| 250 | PORT_BIT(0x00000080,IP_ACTIVE_HIGH,IPT_UNUSED) //0x27 ' |
| 251 | PORT_BIT(0x00000100,IP_ACTIVE_HIGH,IPT_UNUSED) //0x28 ( |
| 252 | PORT_BIT(0x00000200,IP_ACTIVE_HIGH,IPT_UNUSED) //0x29 ) |
| 253 | PORT_BIT(0x00000400,IP_ACTIVE_HIGH,IPT_UNUSED) //0x2a * |
| 254 | PORT_BIT(0x00000800,IP_ACTIVE_HIGH,IPT_UNUSED) //0x2b + |
| 255 | PORT_BIT(0x00001000,IP_ACTIVE_HIGH,IPT_UNUSED) //0x2c , |
| 256 | PORT_BIT(0x00002000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("-") PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') |
| 257 | PORT_BIT(0x00004000,IP_ACTIVE_HIGH,IPT_UNUSED) //0x2e . |
| 258 | PORT_BIT(0x00008000,IP_ACTIVE_HIGH,IPT_UNUSED) //0x2f / |
| 259 | |
| 260 | PORT_BIT(0x00010000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("0") PORT_CODE(KEYCODE_0) PORT_CHAR('0') |
| 261 | PORT_BIT(0x00020000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("1") PORT_CODE(KEYCODE_1) PORT_CHAR('1') |
| 262 | PORT_BIT(0x00040000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("2") PORT_CODE(KEYCODE_2) PORT_CHAR('2') |
| 263 | PORT_BIT(0x00080000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("3") PORT_CODE(KEYCODE_3) PORT_CHAR('3') |
| 264 | PORT_BIT(0x00100000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("4") PORT_CODE(KEYCODE_4) PORT_CHAR('4') |
| 265 | PORT_BIT(0x00200000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("5") PORT_CODE(KEYCODE_5) PORT_CHAR('5') |
| 266 | PORT_BIT(0x00400000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("6") PORT_CODE(KEYCODE_6) PORT_CHAR('6') |
| 267 | PORT_BIT(0x00800000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("7") PORT_CODE(KEYCODE_7) PORT_CHAR('7') |
| 268 | PORT_BIT(0x01000000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("8") PORT_CODE(KEYCODE_8) PORT_CHAR('8') |
| 269 | PORT_BIT(0x02000000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("9") PORT_CODE(KEYCODE_9) PORT_CHAR('9') |
| 270 | PORT_BIT(0x04000000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME(":") PORT_CODE(KEYCODE_QUOTE) PORT_CHAR(':') |
| 271 | PORT_BIT(0x08000000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME(";") PORT_CODE(KEYCODE_COLON) PORT_CHAR(';') |
| 272 | PORT_BIT(0x10000000,IP_ACTIVE_HIGH,IPT_UNUSED) //0x3c < |
| 273 | PORT_BIT(0x20000000,IP_ACTIVE_HIGH,IPT_UNUSED) //0x3d = |
| 274 | PORT_BIT(0x40000000,IP_ACTIVE_HIGH,IPT_UNUSED) //0x3e > |
| 275 | PORT_BIT(0x80000000,IP_ACTIVE_HIGH,IPT_UNUSED) //0x3f ? |
| 276 | |
| 277 | PORT_START("key3") //0x40-0x5f |
| 278 | PORT_BIT(0x00000001,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("@") PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR('@') |
| 279 | PORT_BIT(0x00000002,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("A") PORT_CODE(KEYCODE_A) PORT_CHAR('A') |
| 280 | PORT_BIT(0x00000004,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("B") PORT_CODE(KEYCODE_B) PORT_CHAR('B') |
| 281 | PORT_BIT(0x00000008,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("C") PORT_CODE(KEYCODE_C) PORT_CHAR('C') |
| 282 | PORT_BIT(0x00000010,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("D") PORT_CODE(KEYCODE_D) PORT_CHAR('D') |
| 283 | PORT_BIT(0x00000020,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("E") PORT_CODE(KEYCODE_E) PORT_CHAR('E') |
| 284 | PORT_BIT(0x00000040,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("F") PORT_CODE(KEYCODE_F) PORT_CHAR('F') |
| 285 | PORT_BIT(0x00000080,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("G") PORT_CODE(KEYCODE_G) PORT_CHAR('G') |
| 286 | PORT_BIT(0x00000100,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("H") PORT_CODE(KEYCODE_H) PORT_CHAR('H') |
| 287 | PORT_BIT(0x00000200,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("I") PORT_CODE(KEYCODE_I) PORT_CHAR('I') |
| 288 | PORT_BIT(0x00000400,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("J") PORT_CODE(KEYCODE_J) PORT_CHAR('J') |
| 289 | PORT_BIT(0x00000800,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("K") PORT_CODE(KEYCODE_K) PORT_CHAR('K') |
| 290 | PORT_BIT(0x00001000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("L") PORT_CODE(KEYCODE_L) PORT_CHAR('L') |
| 291 | PORT_BIT(0x00002000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("M") PORT_CODE(KEYCODE_M) PORT_CHAR('M') |
| 292 | PORT_BIT(0x00004000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("N") PORT_CODE(KEYCODE_N) PORT_CHAR('N') |
| 293 | PORT_BIT(0x00008000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("O") PORT_CODE(KEYCODE_O) PORT_CHAR('O') |
| 294 | PORT_BIT(0x00010000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("P") PORT_CODE(KEYCODE_P) PORT_CHAR('P') |
| 295 | PORT_BIT(0x00020000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Q") PORT_CODE(KEYCODE_Q) PORT_CHAR('Q') |
| 296 | PORT_BIT(0x00040000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("R") PORT_CODE(KEYCODE_R) PORT_CHAR('R') |
| 297 | PORT_BIT(0x00080000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("S") PORT_CODE(KEYCODE_S) PORT_CHAR('S') |
| 298 | PORT_BIT(0x00100000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("T") PORT_CODE(KEYCODE_T) PORT_CHAR('T') |
| 299 | PORT_BIT(0x00200000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("U") PORT_CODE(KEYCODE_U) PORT_CHAR('U') |
| 300 | PORT_BIT(0x00400000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("V") PORT_CODE(KEYCODE_V) PORT_CHAR('V') |
| 301 | PORT_BIT(0x00800000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("W") PORT_CODE(KEYCODE_W) PORT_CHAR('W') |
| 302 | PORT_BIT(0x01000000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("X") PORT_CODE(KEYCODE_X) PORT_CHAR('X') |
| 303 | PORT_BIT(0x02000000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Y") PORT_CODE(KEYCODE_Y) PORT_CHAR('Y') |
| 304 | PORT_BIT(0x04000000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Z") PORT_CODE(KEYCODE_Z) PORT_CHAR('Z') |
| 305 | PORT_BIT(0x08000000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("[") PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHAR('[') |
| 306 | PORT_BIT(0x10000000,IP_ACTIVE_HIGH,IPT_UNUSED) |
| 307 | PORT_BIT(0x20000000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("]") PORT_CODE(KEYCODE_BACKSLASH) PORT_CHAR(']') |
| 308 | PORT_BIT(0x40000000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("^") PORT_CODE(KEYCODE_EQUALS) PORT_CHAR('^') |
| 309 | PORT_BIT(0x80000000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("_") |
| 310 | |
| 311 | PORT_START("f_keys") |
| 312 | PORT_BIT(0x00000001,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("F1") PORT_CODE(KEYCODE_F1) |
| 313 | PORT_BIT(0x00000002,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("F2") PORT_CODE(KEYCODE_F2) |
| 314 | PORT_BIT(0x00000004,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("F3") PORT_CODE(KEYCODE_F3) |
| 315 | PORT_BIT(0x00000008,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("F4") PORT_CODE(KEYCODE_F4) |
| 316 | PORT_BIT(0x00000010,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("F5") PORT_CODE(KEYCODE_F5) |
| 317 | |
| 318 | PORT_START("tenkey") |
| 319 | PORT_BIT(0x00000001,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Tenkey 0") PORT_CODE(KEYCODE_0_PAD) |
| 320 | PORT_BIT(0x00000002,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Tenkey 1") PORT_CODE(KEYCODE_1_PAD) |
| 321 | PORT_BIT(0x00000004,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Tenkey 2") PORT_CODE(KEYCODE_2_PAD) |
| 322 | PORT_BIT(0x00000008,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Tenkey 3") PORT_CODE(KEYCODE_3_PAD) |
| 323 | PORT_BIT(0x00000010,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Tenkey 4") PORT_CODE(KEYCODE_4_PAD) |
| 324 | PORT_BIT(0x00000020,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Tenkey 5") PORT_CODE(KEYCODE_5_PAD) |
| 325 | PORT_BIT(0x00000040,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Tenkey 6") PORT_CODE(KEYCODE_6_PAD) |
| 326 | PORT_BIT(0x00000080,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Tenkey 7") PORT_CODE(KEYCODE_7_PAD) |
| 327 | PORT_BIT(0x00000100,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Tenkey 8") PORT_CODE(KEYCODE_8_PAD) |
| 328 | PORT_BIT(0x00000200,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Tenkey 9") PORT_CODE(KEYCODE_9_PAD) |
| 329 | PORT_BIT(0x00000400,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Tenkey -") PORT_CODE(KEYCODE_MINUS_PAD) |
| 330 | PORT_BIT(0x00000800,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Tenkey +") PORT_CODE(KEYCODE_PLUS_PAD) |
| 331 | PORT_BIT(0x00001000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Tenkey *") PORT_CODE(KEYCODE_ASTERISK) |
| 332 | // TODO: add other numpad keys |
| 333 | |
| 334 | PORT_START("key_modifiers") |
| 335 | PORT_BIT(0x00000001,IP_ACTIVE_LOW,IPT_KEYBOARD) PORT_NAME("CTRL") PORT_CODE(KEYCODE_LCONTROL) |
| 336 | PORT_BIT(0x00000002,IP_ACTIVE_LOW,IPT_KEYBOARD) PORT_NAME("SHIFT") PORT_CODE(KEYCODE_LSHIFT) |
| 337 | PORT_BIT(0x00000004,IP_ACTIVE_LOW,IPT_KEYBOARD) PORT_NAME("KANA") PORT_CODE(KEYCODE_RCONTROL) |
| 338 | PORT_BIT(0x00000008,IP_ACTIVE_LOW,IPT_KEYBOARD) PORT_NAME("CAPS") PORT_CODE(KEYCODE_CAPSLOCK) PORT_TOGGLE |
| 339 | PORT_BIT(0x00000010,IP_ACTIVE_LOW,IPT_KEYBOARD) PORT_NAME("GRPH") PORT_CODE(KEYCODE_LALT) |
| 340 | |
| 341 | #if 0 |
| 342 | PORT_BIT(0x00020000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME(",") PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') |
| 343 | PORT_BIT(0x00040000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME(".") PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') |
| 344 | PORT_BIT(0x00080000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("/") PORT_CODE(KEYCODE_SLASH) PORT_CHAR('/') |
| 345 | PORT_BIT(0x00400000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Tenkey *") PORT_CODE(KEYCODE_ASTERISK) |
| 346 | PORT_BIT(0x00800000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Tenkey /") PORT_CODE(KEYCODE_SLASH_PAD) |
| 347 | PORT_BIT(0x01000000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Tenkey +") PORT_CODE(KEYCODE_PLUS_PAD) |
| 348 | PORT_BIT(0x02000000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Tenkey -") PORT_CODE(KEYCODE_MINUS_PAD) |
| 349 | PORT_BIT(0x04000000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Tenkey 7") PORT_CODE(KEYCODE_7_PAD) |
| 350 | PORT_BIT(0x08000000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Tenkey 8") PORT_CODE(KEYCODE_8_PAD) |
| 351 | PORT_BIT(0x10000000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Tenkey 9") PORT_CODE(KEYCODE_9_PAD) |
| 352 | PORT_BIT(0x20000000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Tenkey =") |
| 353 | PORT_BIT(0x40000000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Tenkey 4") PORT_CODE(KEYCODE_4_PAD) |
| 354 | PORT_BIT(0x80000000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Tenkey 5") PORT_CODE(KEYCODE_5_PAD) |
| 355 | PORT_BIT(0x10000000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("\xEF\xBF\xA5") |
| 356 | |
| 357 | PORT_START("key3") |
| 358 | PORT_BIT(0x00000001,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Tenkey 6") PORT_CODE(KEYCODE_6_PAD) |
| 359 | PORT_BIT(0x00000002,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Tenkey ,") |
| 360 | PORT_BIT(0x00000004,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Tenkey 1") PORT_CODE(KEYCODE_1_PAD) |
| 361 | PORT_BIT(0x00000008,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Tenkey 2") PORT_CODE(KEYCODE_2_PAD) |
| 362 | PORT_BIT(0x00000010,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Tenkey 3") PORT_CODE(KEYCODE_3_PAD) |
| 363 | PORT_BIT(0x00000020,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Tenkey Enter") PORT_CODE(KEYCODE_ENTER_PAD) |
| 364 | PORT_BIT(0x00000040,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Tenkey 0") PORT_CODE(KEYCODE_0_PAD) |
| 365 | PORT_BIT(0x00000080,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Tenkey .") PORT_CODE(KEYCODE_DEL_PAD) |
| 366 | PORT_BIT(0x00000100,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("INS") PORT_CODE(KEYCODE_INSERT) |
| 367 | PORT_BIT(0x00000200,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("EL") PORT_CODE(KEYCODE_PGUP) |
| 368 | PORT_BIT(0x00000400,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("CLS") PORT_CODE(KEYCODE_PGDN) |
| 369 | PORT_BIT(0x00000800,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("DEL") PORT_CODE(KEYCODE_DEL) |
| 370 | PORT_BIT(0x00001000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("DUP") PORT_CODE(KEYCODE_END) |
| 371 | PORT_BIT(0x00002000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Up") PORT_CODE(KEYCODE_UP) |
| 372 | PORT_BIT(0x00004000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("HOME") PORT_CODE(KEYCODE_HOME) |
| 373 | PORT_BIT(0x00008000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Left") PORT_CODE(KEYCODE_LEFT) |
| 374 | PORT_BIT(0x00010000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Down") PORT_CODE(KEYCODE_DOWN) |
| 375 | PORT_BIT(0x00020000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("Right") PORT_CODE(KEYCODE_RIGHT) |
| 376 | PORT_BIT(0x00040000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("BREAK") PORT_CODE(KEYCODE_ESC) |
| 377 | PORT_BIT(0x01000000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("PF6") PORT_CODE(KEYCODE_F6) |
| 378 | PORT_BIT(0x02000000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("PF7") PORT_CODE(KEYCODE_F7) |
| 379 | PORT_BIT(0x04000000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("PF8") PORT_CODE(KEYCODE_F8) |
| 380 | PORT_BIT(0x08000000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("PF9") PORT_CODE(KEYCODE_F9) |
| 381 | PORT_BIT(0x10000000,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("PF10") PORT_CODE(KEYCODE_F10) |
| 382 | |
| 383 | #endif |
| 384 | INPUT_PORTS_END |
| 385 | |
| 386 | |
| 387 | /************************************* |
| 388 | * |
| 389 | * GFX decoding |
| 390 | * |
| 391 | *************************************/ |
| 392 | |
| 393 | static const gfx_layout x1_chars_8x8 = |
| 394 | { |
| 395 | 8,8, |
| 396 | RGN_FRAC(1,1), |
| 397 | 1, |
| 398 | { 0 }, |
| 399 | { 0, 1, 2, 3, 4, 5, 6, 7 }, |
| 400 | { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 }, |
| 401 | 8*8 |
| 402 | }; |
| 403 | |
| 404 | static const gfx_layout x1_chars_8x16 = |
| 405 | { |
| 406 | 8,16, |
| 407 | RGN_FRAC(1,1), |
| 408 | 1, |
| 409 | { 0 }, |
| 410 | { 0, 1, 2, 3, 4, 5, 6, 7 }, |
| 411 | { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,8*8,9*8,10*8,11*8,12*8,13*8,14*8,15*8 }, |
| 412 | 8*16 |
| 413 | }; |
| 414 | |
| 415 | static const gfx_layout x1_pcg_8x8 = |
| 416 | { |
| 417 | 8,8, |
| 418 | RGN_FRAC(1,3), |
| 419 | 3, |
| 420 | { RGN_FRAC(2,3),RGN_FRAC(1,3),RGN_FRAC(0,3) }, |
| 421 | { 0, 1, 2, 3, 4, 5, 6, 7 }, |
| 422 | { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 }, |
| 423 | 8*8 |
| 424 | }; |
| 425 | |
| 426 | static const gfx_layout x1_chars_16x16 = |
| 427 | { |
| 428 | 8,16, |
| 429 | RGN_FRAC(1,1), |
| 430 | 1, |
| 431 | { 0 }, |
| 432 | { 0, 1, 2, 3, 4, 5, 6, 7 }, |
| 433 | { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8,8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8 }, |
| 434 | 8*16 |
| 435 | }; |
| 436 | |
| 437 | /* decoded for debugging purpose, this will be nuked in the end... */ |
| 438 | static GFXDECODE_START( x1 ) |
| 439 | GFXDECODE_ENTRY( "cgrom", 0x00000, x1_chars_8x8, 0, 1 ) |
| 440 | GFXDECODE_ENTRY( "pcg", 0x00000, x1_pcg_8x8, 0, 1 ) |
| 441 | GFXDECODE_ENTRY( "font", 0x00000, x1_chars_8x16, 0, 1 ) |
| 442 | GFXDECODE_ENTRY( "kanji", 0x00000, x1_chars_16x16, 0, 1 ) |
| 443 | GFXDECODE_END |
| 444 | |
| 445 | static Z80CTC_INTERFACE( ctc_intf ) |
| 446 | { |
| 447 | 0, // timer disables |
| 448 | DEVCB_CPU_INPUT_LINE("x1_cpu", INPUT_LINE_IRQ0), // interrupt handler |
| 449 | DEVCB_LINE(z80ctc_trg3_w), // ZC/TO0 callback |
| 450 | DEVCB_LINE(z80ctc_trg1_w), // ZC/TO1 callback |
| 451 | DEVCB_LINE(z80ctc_trg2_w), // ZC/TO2 callback |
| 452 | }; |
| 453 | |
| 454 | #if 0 |
| 455 | static const z80sio_interface sio_intf = |
| 456 | { |
| 457 | 0, /* interrupt handler */ |
| 458 | 0, /* DTR changed handler */ |
| 459 | 0, /* RTS changed handler */ |
| 460 | 0, /* BREAK changed handler */ |
| 461 | 0, /* transmit handler */ |
| 462 | 0 /* receive handler */ |
| 463 | }; |
| 464 | #endif |
| 465 | |
| 466 | |
| 467 | static Z80DART_INTERFACE( sio_intf ) |
| 468 | { |
| 469 | 0, 0, 0, 0, |
| 470 | |
| 471 | DEVCB_NULL, |
| 472 | DEVCB_NULL, |
| 473 | DEVCB_NULL, |
| 474 | DEVCB_NULL, |
| 475 | DEVCB_NULL, |
| 476 | DEVCB_NULL, |
| 477 | |
| 478 | DEVCB_NULL, |
| 479 | DEVCB_NULL, |
| 480 | DEVCB_NULL, |
| 481 | DEVCB_NULL, |
| 482 | DEVCB_NULL, |
| 483 | DEVCB_NULL, |
| 484 | |
| 485 | DEVCB_CPU_INPUT_LINE("x1_cpu", INPUT_LINE_IRQ0) |
| 486 | }; |
| 487 | |
| 488 | |
| 489 | static const z80_daisy_config x1_daisy[] = |
| 490 | { |
| 491 | { "x1kb" }, |
| 492 | { "ctc" }, |
| 493 | { NULL } |
| 494 | }; |
| 495 | |
| 496 | static const ay8910_interface ay8910_config = |
| 497 | { |
| 498 | AY8910_LEGACY_OUTPUT, |
| 499 | AY8910_DEFAULT_LOADS, |
| 500 | DEVCB_INPUT_PORT("P1"), |
| 501 | DEVCB_INPUT_PORT("P2"), |
| 502 | DEVCB_NULL, |
| 503 | DEVCB_NULL |
| 504 | }; |
| 505 | |
| 506 | static const cassette_interface x1_cassette_interface = |
| 507 | { |
| 508 | x1_cassette_formats, |
| 509 | NULL, |
| 510 | (cassette_state)(CASSETTE_STOPPED | CASSETTE_MOTOR_DISABLED | CASSETTE_SPEAKER_ENABLED), |
| 511 | "x1_cass", |
| 512 | NULL |
| 513 | }; |
| 514 | |
| 515 | static LEGACY_FLOPPY_OPTIONS_START( x1 ) |
| 516 | LEGACY_FLOPPY_OPTION( img2d, "2d", "2D disk image", basicdsk_identify_default, basicdsk_construct_default, NULL, |
| 517 | HEADS([2]) |
| 518 | TRACKS([40]) |
| 519 | SECTORS([16]) |
| 520 | SECTOR_LENGTH([256]) |
| 521 | FIRST_SECTOR_ID([1])) |
| 522 | LEGACY_FLOPPY_OPTIONS_END |
| 523 | |
| 524 | static const floppy_interface x1_floppy_interface = |
| 525 | { |
| 526 | DEVCB_NULL, |
| 527 | DEVCB_NULL, |
| 528 | DEVCB_NULL, |
| 529 | DEVCB_NULL, |
| 530 | DEVCB_NULL, |
| 531 | FLOPPY_STANDARD_5_25_DSDD_40, |
| 532 | LEGACY_FLOPPY_OPTIONS_NAME(x1), |
| 533 | "floppy_5_25", |
| 534 | NULL |
| 535 | }; |
| 536 | |
| 537 | |
| 538 | #if 0 |
| 539 | static const c6280_interface c6280_config = |
| 540 | { |
| 541 | "pce_cpu" |
| 542 | }; |
| 543 | #endif |
| 544 | |
| 545 | static MACHINE_CONFIG_START( x1twin, x1twin_state ) |
| 546 | /* basic machine hardware */ |
| 547 | MCFG_CPU_ADD("x1_cpu", Z80, X1_MAIN_CLOCK/4) |
| 548 | MCFG_CPU_PROGRAM_MAP(x1_mem) |
| 549 | MCFG_CPU_IO_MAP(x1_io) |
| 550 | MCFG_CPU_CONFIG(x1_daisy) |
| 551 | |
| 552 | MCFG_Z80CTC_ADD( "ctc", MAIN_CLOCK/4 , ctc_intf ) |
| 553 | |
| 554 | MCFG_DEVICE_ADD("x1kb", X1_KEYBOARD, 0) |
| 555 | |
| 556 | MCFG_I8255A_ADD( "ppi8255_0", ppi8255_intf ) |
| 557 | |
| 558 | MCFG_MACHINE_START(x1) |
| 559 | MCFG_MACHINE_RESET(x1) |
| 560 | |
| 561 | MCFG_CPU_ADD("pce_cpu", H6280, PCE_MAIN_CLOCK/3) |
| 562 | MCFG_CPU_PROGRAM_MAP(pce_mem) |
| 563 | MCFG_CPU_IO_MAP(pce_io) |
| 564 | MCFG_TIMER_ADD_SCANLINE("scantimer", pce_interrupt, "pce_screen", 0, 1) |
| 565 | |
| 566 | MCFG_DEFAULT_LAYOUT(layout_dualhsxs) |
| 567 | /* video hardware */ |
| 568 | MCFG_SCREEN_ADD("x1_screen", RASTER) |
| 569 | MCFG_SCREEN_REFRESH_RATE(60) |
| 570 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */ |
| 571 | MCFG_SCREEN_FORMAT(BITMAP_FORMAT_RGB32) |
| 572 | MCFG_SCREEN_SIZE(640, 480) |
| 573 | MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1) |
| 574 | MCFG_SCREEN_UPDATE(x1twin) |
| 575 | |
| 576 | MCFG_SCREEN_ADD("pce_screen", RASTER) |
| 577 | MCFG_SCREEN_REFRESH_RATE(60) |
| 578 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */ |
| 579 | MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| 580 | MCFG_SCREEN_RAW_PARAMS(PCE_MAIN_CLOCK/2, VDC_WPF, 70, 70 + 512 + 32, VDC_LPF, 14, 14+242) |
| 581 | |
| 582 | MCFG_MC6845_ADD("crtc", H46505, (VDP_CLOCK/48), mc6845_intf) //unknown divider |
| 583 | MCFG_PALETTE_LENGTH(0x10+0x1000) |
| 584 | MCFG_PALETTE_INIT(x1) |
| 585 | |
| 586 | MCFG_GFXDECODE(x1) |
| 587 | |
| 588 | MCFG_VIDEO_START(x1) |
| 589 | |
| 590 | MCFG_MB8877_ADD("fdc",x1_mb8877a_interface) |
| 591 | |
| 592 | MCFG_CARTSLOT_ADD("cart") |
| 593 | MCFG_CARTSLOT_EXTENSION_LIST("rom") |
| 594 | MCFG_CARTSLOT_NOT_MANDATORY |
| 595 | |
| 596 | MCFG_SPEAKER_ADD("x1_l",-0.2, 0.0, 1.0) |
| 597 | MCFG_SPEAKER_ADD("x1_r",0.2, 0.0, 1.0) |
| 598 | MCFG_SPEAKER_ADD("pce_l",-0.2, 0.0, 1.0) |
| 599 | MCFG_SPEAKER_ADD("pce_r",-0.2, 0.0, 1.0) |
| 600 | |
| 601 | // MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |
| 602 | |
| 603 | /* TODO:is the AY mono or stereo? Also volume balance isn't right. */ |
| 604 | MCFG_SOUND_ADD("ay", AY8910, MAIN_CLOCK/8) |
| 605 | MCFG_SOUND_CONFIG(ay8910_config) |
| 606 | MCFG_SOUND_ROUTE(0, "x1_l", 0.25) |
| 607 | MCFG_SOUND_ROUTE(0, "x1_r", 0.25) |
| 608 | MCFG_SOUND_ROUTE(1, "x1_l", 0.5) |
| 609 | MCFG_SOUND_ROUTE(2, "x1_r", 0.5) |
| 610 | MCFG_SOUND_WAVE_ADD(WAVE_TAG, CASSETTE_TAG) |
| 611 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "x1_l", 0.25) |
| 612 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "x1_r", 0.10) |
| 613 | |
| 614 | MCFG_CASSETTE_ADD(CASSETTE_TAG,x1_cassette_interface) |
| 615 | MCFG_SOFTWARE_LIST_ADD("cass_list","x1_cass") |
| 616 | |
| 617 | MCFG_LEGACY_FLOPPY_4_DRIVES_ADD(x1_floppy_interface) |
| 618 | MCFG_SOFTWARE_LIST_ADD("flop_list","x1_flop") |
| 619 | |
| 620 | MCFG_SOUND_ADD("c6280", C6280, PCE_MAIN_CLOCK/6) |
| 621 | // MCFG_SOUND_CONFIG(c6280_config) |
| 622 | MCFG_SOUND_ROUTE(0, "pce_l", 0.5) |
| 623 | MCFG_SOUND_ROUTE(1, "pce_r", 0.5) |
| 624 | |
| 625 | MCFG_TIMER_ADD_PERIODIC("keyboard_timer", x1_keyboard_callback, attotime::from_hz(250)) |
| 626 | MCFG_TIMER_ADD_PERIODIC("cmt_wind_timer", x1_cmt_wind_timer, attotime::from_hz(16)) |
| 627 | MACHINE_CONFIG_END |
| 628 | |
| 629 | ROM_START( x1twin ) |
| 630 | ROM_REGION( 0x10000, "x1_cpu", ROMREGION_ERASEFF ) |
| 631 | |
| 632 | ROM_REGION( 0x8000, "ipl", ROMREGION_ERASEFF ) |
| 633 | ROM_LOAD( "ipl.rom", 0x0000, 0x1000, CRC(e70011d3) SHA1(d3395e9aeb5b8bbba7654dd471bcd8af228ee69a) ) |
| 634 | |
| 635 | ROM_REGION( 0x10000, "wram", ROMREGION_ERASE00 ) |
| 636 | |
| 637 | ROM_REGION(0x1000, "mcu", ROMREGION_ERASEFF) //MCU for the Keyboard, "sub cpu" |
| 638 | ROM_LOAD( "80c48", 0x0000, 0x1000, NO_DUMP ) |
| 639 | |
| 640 | ROM_REGION( 0x1000000, "emm", ROMREGION_ERASEFF ) |
| 641 | |
| 642 | ROM_REGION(0x1800, "pcg", ROMREGION_ERASEFF) |
| 643 | |
| 644 | ROM_REGION(0x1000, "font", 0) //TODO: this contains 8x16 charset only, maybe it's possible that it derivates a 8x8 charset by skipping gfx lines? |
| 645 | ROM_LOAD( "ank16.rom", 0x0000, 0x1000, CRC(8f9fb213) SHA1(4f06d20c997a79ee6af954b69498147789bf1847) ) |
| 646 | |
| 647 | ROM_REGION(0x1800, "cgrom", 0) |
| 648 | ROM_LOAD("ank8.rom", 0x00000, 0x00800, CRC(e3995a57) SHA1(1c1a0d8c9f4c446ccd7470516b215ddca5052fb2) ) |
| 649 | ROM_COPY("font", 0x00000, 0x00800, 0x1000 ) |
| 650 | |
| 651 | ROM_REGION(0x20000, "kanji", ROMREGION_ERASEFF) |
| 652 | |
| 653 | ROM_REGION(0x20000, "raw_kanji", ROMREGION_ERASEFF) // these comes from x1 turbo |
| 654 | ROM_LOAD("kanji4.rom", 0x00000, 0x8000, BAD_DUMP CRC(3e39de89) SHA1(d3fd24892bb1948c4697dedf5ff065ff3eaf7562) ) |
| 655 | ROM_LOAD("kanji2.rom", 0x08000, 0x8000, BAD_DUMP CRC(e710628a) SHA1(103bbe459dc8da27a9400aa45b385255c18fcc75) ) |
| 656 | ROM_LOAD("kanji3.rom", 0x10000, 0x8000, BAD_DUMP CRC(8cae13ae) SHA1(273f3329c70b332f6a49a3a95e906bbfe3e9f0a1) ) |
| 657 | ROM_LOAD("kanji1.rom", 0x18000, 0x8000, BAD_DUMP CRC(5874f70b) SHA1(dad7ada1b70c45f1e9db11db273ef7b385ef4f17) ) |
| 658 | |
| 659 | ROM_REGION( 0x1000000, "cart_img", ROMREGION_ERASE00 ) |
| 660 | ROM_CART_LOAD("cart", 0x0000, 0xffffff, ROM_OPTIONAL | ROM_NOMIRROR) |
| 661 | ROM_END |
| 662 | |
| 663 | COMP( 1986, x1twin, x1, 0, x1twin, x1twin, x1_kanji,"Sharp", "X1 Twin (CZ-830C)", GAME_NOT_WORKING ) |