src/mess/drivers/sg1000.c
| r8190 | r8191 | |
| 53 | 53 | |
| 54 | 54 | TODO: |
| 55 | 55 | |
| 56 | | - OMV keyboard |
| 57 | 56 | - SC-3000 return instruction referenced by R when reading ports 60-7f,e0-ff |
| 58 | | - connect the PSG /READY signal |
| 57 | - connect PSG /READY signal to Z80 WAIT |
| 59 | 58 | - accurate video timing |
| 60 | 59 | - SP-400 serial printer |
| 61 | 60 | - SH-400 racing controller |
| r8190 | r8191 | |
| 67 | 66 | #include "cpu/z80/z80.h" |
| 68 | 67 | #include "includes/sg1000.h" |
| 69 | 68 | #include "devices/flopdrv.h" |
| 70 | | #include "formats/basicdsk.h" |
| 71 | 69 | #include "devices/cartslot.h" |
| 72 | 70 | #include "devices/cassette.h" |
| 71 | #include "devices/messram.h" |
| 73 | 72 | #include "devices/printer.h" |
| 73 | #include "formats/basicdsk.h" |
| 74 | 74 | #include "machine/ctronics.h" |
| 75 | #include "machine/i8255a.h" |
| 76 | #include "machine/msm8251.h" |
| 75 | 77 | #include "machine/serial.h" |
| 76 | | #include "machine/msm8251.h" |
| 77 | | #include "machine/i8255a.h" |
| 78 | 78 | #include "machine/upd765.h" |
| 79 | 79 | #include "sound/sn76496.h" |
| 80 | 80 | #include "video/tms9928a.h" |
| 81 | | #include "devices/messram.h" |
| 82 | 81 | #include "crsshair.h" |
| 83 | 82 | |
| 84 | | /* Terebi Oekaki (TV Draw) */ |
| 83 | /*************************************************************************** |
| 84 | READ/WRITE HANDLERS |
| 85 | ***************************************************************************/ |
| 85 | 86 | |
| 86 | 87 | /* |
| 87 | 88 | |
| 89 | Terebi Oekaki (TV Draw) |
| 90 | |
| 88 | 91 | Address Access Bits |
| 89 | 92 | 7 6 5 4 3 2 1 0 |
| 90 | 93 | $6000 W - - - - - - - AXIS |
| r8190 | r8191 | |
| 98 | 101 | |
| 99 | 102 | */ |
| 100 | 103 | |
| 104 | /*------------------------------------------------- |
| 105 | tvdraw_axis_w - TV Draw axis select |
| 106 | -------------------------------------------------*/ |
| 107 | |
| 101 | 108 | static WRITE8_HANDLER( tvdraw_axis_w ) |
| 102 | 109 | { |
| 103 | 110 | sg1000_state *state = (sg1000_state *)space->machine->driver_data; |
| r8190 | r8191 | |
| 115 | 122 | } |
| 116 | 123 | } |
| 117 | 124 | |
| 125 | /*------------------------------------------------- |
| 126 | tvdraw_status_r - TV Draw status read |
| 127 | -------------------------------------------------*/ |
| 128 | |
| 118 | 129 | static READ8_HANDLER( tvdraw_status_r ) |
| 119 | 130 | { |
| 120 | 131 | return input_port_read(space->machine, "TVDRAW_PEN"); |
| 121 | 132 | } |
| 122 | 133 | |
| 134 | /*------------------------------------------------- |
| 135 | tvdraw_data_r - TV Draw data read |
| 136 | -------------------------------------------------*/ |
| 137 | |
| 123 | 138 | static READ8_HANDLER( tvdraw_data_r ) |
| 124 | 139 | { |
| 125 | 140 | sg1000_state *state = (sg1000_state *)space->machine->driver_data; |
| r8190 | r8191 | |
| 127 | 142 | return state->tvdraw_data; |
| 128 | 143 | } |
| 129 | 144 | |
| 145 | /*------------------------------------------------- |
| 146 | sg1000_joysel_r - |
| 147 | -------------------------------------------------*/ |
| 148 | |
| 130 | 149 | static READ8_HANDLER( sg1000_joysel_r ) |
| 131 | 150 | { |
| 132 | 151 | return 0x80; |
| 133 | 152 | } |
| 134 | 153 | |
| 135 | | /* Memory Maps */ |
| 154 | /*************************************************************************** |
| 155 | MEMORY MAPS |
| 156 | ***************************************************************************/ |
| 136 | 157 | |
| 137 | | // SG-1000 |
| 158 | /*------------------------------------------------- |
| 159 | ADDRESS_MAP( sg1000_map ) |
| 160 | -------------------------------------------------*/ |
| 138 | 161 | |
| 139 | 162 | static ADDRESS_MAP_START( sg1000_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 140 | 163 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| r8190 | r8191 | |
| 142 | 165 | AM_RANGE(0xc000, 0xffff) AM_RAMBANK("bank2") |
| 143 | 166 | ADDRESS_MAP_END |
| 144 | 167 | |
| 168 | /*------------------------------------------------- |
| 169 | ADDRESS_MAP( sg1000_io_map ) |
| 170 | -------------------------------------------------*/ |
| 171 | |
| 145 | 172 | static ADDRESS_MAP_START( sg1000_io_map, ADDRESS_SPACE_IO, 8 ) |
| 146 | 173 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 147 | | AM_RANGE(0x7f, 0x7f) AM_DEVWRITE(SN76489A_TAG, sn76496_w) |
| 148 | | AM_RANGE(0xbe, 0xbe) AM_READWRITE(TMS9928A_vram_r, TMS9928A_vram_w) |
| 149 | | AM_RANGE(0xbf, 0xbf) AM_READWRITE(TMS9928A_register_r, TMS9928A_register_w) |
| 174 | AM_RANGE(0x40, 0x40) AM_MIRROR(0x3f) AM_DEVWRITE(SN76489A_TAG, sn76496_w) |
| 175 | AM_RANGE(0x80, 0x80) AM_MIRROR(0x3e) AM_READWRITE(TMS9928A_vram_r, TMS9928A_vram_w) |
| 176 | AM_RANGE(0x81, 0x81) AM_MIRROR(0x3e) AM_READWRITE(TMS9928A_register_r, TMS9928A_register_w) |
| 150 | 177 | AM_RANGE(0xdc, 0xdc) AM_READ_PORT("PA7") |
| 151 | 178 | AM_RANGE(0xdd, 0xdd) AM_READ_PORT("PB7") |
| 152 | 179 | AM_RANGE(0xde, 0xde) AM_READ(sg1000_joysel_r) AM_WRITENOP |
| 153 | 180 | AM_RANGE(0xdf, 0xdf) AM_NOP |
| 154 | 181 | ADDRESS_MAP_END |
| 155 | 182 | |
| 156 | | // SC-3000 |
| 183 | /*------------------------------------------------- |
| 184 | ADDRESS_MAP( omv_map ) |
| 185 | -------------------------------------------------*/ |
| 157 | 186 | |
| 187 | static ADDRESS_MAP_START( omv_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 188 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 189 | AM_RANGE(0x8000, 0xbfff) AM_RAMBANK("bank1") |
| 190 | AM_RANGE(0xc000, 0xc7ff) AM_MIRROR(0x3800) AM_RAM |
| 191 | ADDRESS_MAP_END |
| 192 | |
| 193 | /*------------------------------------------------- |
| 194 | ADDRESS_MAP( omv_io_map ) |
| 195 | -------------------------------------------------*/ |
| 196 | |
| 197 | static ADDRESS_MAP_START( omv_io_map, ADDRESS_SPACE_IO, 8 ) |
| 198 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 199 | AM_RANGE(0x40, 0x40) AM_MIRROR(0x3f) AM_DEVWRITE(SN76489A_TAG, sn76496_w) |
| 200 | AM_RANGE(0x80, 0x80) AM_MIRROR(0x3e) AM_READWRITE(TMS9928A_vram_r, TMS9928A_vram_w) |
| 201 | AM_RANGE(0x81, 0x81) AM_MIRROR(0x3e) AM_READWRITE(TMS9928A_register_r, TMS9928A_register_w) |
| 202 | AM_RANGE(0xc0, 0xc0) AM_MIRROR(0x38) AM_READ_PORT("C0") |
| 203 | AM_RANGE(0xc1, 0xc1) AM_MIRROR(0x38) AM_READ_PORT("C1") |
| 204 | AM_RANGE(0xc2, 0xc2) AM_MIRROR(0x38) AM_READ_PORT("C2") |
| 205 | AM_RANGE(0xc3, 0xc3) AM_MIRROR(0x38) AM_READ_PORT("C3") |
| 206 | AM_RANGE(0xc4, 0xc4) AM_MIRROR(0x3a) AM_READ_PORT("C4") |
| 207 | AM_RANGE(0xc5, 0xc5) AM_MIRROR(0x3a) AM_READ_PORT("C5") |
| 208 | ADDRESS_MAP_END |
| 209 | |
| 210 | /*------------------------------------------------- |
| 211 | ADDRESS_MAP( sc3000_map ) |
| 212 | -------------------------------------------------*/ |
| 213 | |
| 158 | 214 | static ADDRESS_MAP_START( sc3000_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 159 | 215 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 160 | 216 | AM_RANGE(0x8000, 0xbfff) AM_RAMBANK("bank1") |
| 161 | 217 | AM_RANGE(0xc000, 0xffff) AM_RAMBANK("bank2") |
| 162 | 218 | ADDRESS_MAP_END |
| 163 | 219 | |
| 220 | /*------------------------------------------------- |
| 221 | ADDRESS_MAP( sc3000_io_map ) |
| 222 | -------------------------------------------------*/ |
| 223 | |
| 164 | 224 | static ADDRESS_MAP_START( sc3000_io_map, ADDRESS_SPACE_IO, 8 ) |
| 165 | 225 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 166 | 226 | AM_RANGE(0x7f, 0x7f) AM_DEVWRITE(SN76489A_TAG, sn76496_w) |
| r8190 | r8191 | |
| 180 | 240 | ADDRESS_MAP_END |
| 181 | 241 | */ |
| 182 | 242 | |
| 183 | | // SF-7000 |
| 243 | /*------------------------------------------------- |
| 244 | ADDRESS_MAP( sf7000_map ) |
| 245 | -------------------------------------------------*/ |
| 184 | 246 | |
| 185 | 247 | static ADDRESS_MAP_START( sf7000_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 186 | 248 | AM_RANGE(0x0000, 0x3fff) AM_READ_BANK("bank1") AM_WRITE_BANK("bank2") |
| 187 | 249 | AM_RANGE(0x4000, 0xffff) AM_RAM |
| 188 | 250 | ADDRESS_MAP_END |
| 189 | 251 | |
| 252 | /*------------------------------------------------- |
| 253 | ADDRESS_MAP( sf7000_io_map ) |
| 254 | -------------------------------------------------*/ |
| 255 | |
| 190 | 256 | static ADDRESS_MAP_START( sf7000_io_map, ADDRESS_SPACE_IO, 8 ) |
| 191 | 257 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 192 | 258 | AM_RANGE(0x7f, 0x7f) AM_DEVWRITE(SN76489A_TAG, sn76496_w) |
| r8190 | r8191 | |
| 200 | 266 | AM_RANGE(0xe9, 0xe9) AM_DEVREADWRITE(UPD8251_TAG, msm8251_status_r, msm8251_control_w) |
| 201 | 267 | ADDRESS_MAP_END |
| 202 | 268 | |
| 203 | | /* Input Ports */ |
| 269 | /*************************************************************************** |
| 270 | INPUT PORTS |
| 271 | ***************************************************************************/ |
| 204 | 272 | |
| 273 | /*------------------------------------------------- |
| 274 | INPUT_CHANGED( trigger_nmi ) |
| 275 | -------------------------------------------------*/ |
| 276 | |
| 205 | 277 | static INPUT_CHANGED( trigger_nmi ) |
| 206 | 278 | { |
| 207 | 279 | cputag_set_input_line(field->port->machine, Z80_TAG, INPUT_LINE_NMI, (input_port_read(field->port->machine, "NMI") ? CLEAR_LINE : ASSERT_LINE)); |
| 208 | 280 | } |
| 209 | 281 | |
| 282 | /*------------------------------------------------- |
| 283 | INPUT_PORTS( tvdraw ) |
| 284 | -------------------------------------------------*/ |
| 285 | |
| 210 | 286 | static INPUT_PORTS_START( tvdraw ) |
| 211 | 287 | PORT_START("TVDRAW_X") |
| 212 | 288 | PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_X ) PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_SENSITIVITY(50) PORT_KEYDELTA(10) PORT_PLAYER(1) |
| r8190 | r8191 | |
| 218 | 294 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Pen") |
| 219 | 295 | INPUT_PORTS_END |
| 220 | 296 | |
| 297 | /*------------------------------------------------- |
| 298 | INPUT_PORTS( sg1000 ) |
| 299 | -------------------------------------------------*/ |
| 300 | |
| 221 | 301 | static INPUT_PORTS_START( sg1000 ) |
| 222 | 302 | PORT_START("PA7") |
| 223 | 303 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) |
| r8190 | r8191 | |
| 242 | 322 | PORT_INCLUDE( tvdraw ) |
| 243 | 323 | INPUT_PORTS_END |
| 244 | 324 | |
| 325 | /*------------------------------------------------- |
| 326 | INPUT_PORTS( omv ) |
| 327 | -------------------------------------------------*/ |
| 328 | |
| 329 | static INPUT_PORTS_START( omv ) |
| 330 | PORT_START("C0") |
| 331 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_1) PORT_CHAR('1') |
| 332 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_2) PORT_CHAR('2') |
| 333 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_3) PORT_CHAR('3') |
| 334 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_4) PORT_CHAR('4') |
| 335 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_5) PORT_CHAR('5') |
| 336 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_6) PORT_CHAR('6') |
| 337 | PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 338 | |
| 339 | PORT_START("C1") |
| 340 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_7) PORT_CHAR('7') |
| 341 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_8) PORT_CHAR('8') |
| 342 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("9 #") PORT_CODE(KEYCODE_9) PORT_CHAR('9') |
| 343 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_NAME("0 *") PORT_CODE(KEYCODE_0) PORT_CHAR('0') |
| 344 | PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 345 | |
| 346 | PORT_START("C2") |
| 347 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_A) PORT_CHAR('A') |
| 348 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_B) PORT_CHAR('B') |
| 349 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_C) PORT_CHAR('C') |
| 350 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_D) PORT_CHAR('D') |
| 351 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_E) PORT_CHAR('E') |
| 352 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_F) PORT_CHAR('F') |
| 353 | PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 354 | |
| 355 | PORT_START("C3") |
| 356 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_G) PORT_CHAR('G') |
| 357 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_H) PORT_CHAR('H') |
| 358 | PORT_BIT( 0xfc, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 359 | |
| 360 | PORT_START("C4") |
| 361 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) |
| 362 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) |
| 363 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) |
| 364 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) |
| 365 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("S-1") |
| 366 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("S-2") |
| 367 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2) |
| 368 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) |
| 369 | |
| 370 | PORT_START("C5") |
| 371 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) |
| 372 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) |
| 373 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) |
| 374 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) |
| 375 | PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 376 | |
| 377 | PORT_INCLUDE( tvdraw ) |
| 378 | INPUT_PORTS_END |
| 379 | |
| 380 | /*------------------------------------------------- |
| 381 | INPUT_PORTS( sk1100 ) |
| 382 | -------------------------------------------------*/ |
| 383 | |
| 245 | 384 | static INPUT_PORTS_START( sk1100 ) |
| 246 | 385 | PORT_START("PA0") |
| 247 | 386 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!') |
| r8190 | r8191 | |
| 364 | 503 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("RESET") PORT_CODE(KEYCODE_F10) PORT_CHANGED(trigger_nmi, 0) |
| 365 | 504 | INPUT_PORTS_END |
| 366 | 505 | |
| 506 | /*------------------------------------------------- |
| 507 | INPUT_PORTS( sc3000 ) |
| 508 | -------------------------------------------------*/ |
| 509 | |
| 367 | 510 | static INPUT_PORTS_START( sc3000 ) |
| 368 | 511 | PORT_INCLUDE( sk1100 ) |
| 369 | 512 | PORT_INCLUDE( tvdraw ) |
| 370 | 513 | INPUT_PORTS_END |
| 371 | 514 | |
| 515 | /*------------------------------------------------- |
| 516 | INPUT_PORTS( sf7000 ) |
| 517 | -------------------------------------------------*/ |
| 518 | |
| 372 | 519 | static INPUT_PORTS_START( sf7000 ) |
| 373 | 520 | PORT_INCLUDE( sk1100 ) |
| 374 | 521 | |
| r8190 | r8191 | |
| 382 | 529 | PORT_CONFSETTING( 0x05, "300 baud" ) |
| 383 | 530 | INPUT_PORTS_END |
| 384 | 531 | |
| 385 | | static INPUT_PORTS_START( omv ) |
| 386 | | PORT_START("PA7") |
| 387 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) |
| 388 | | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) |
| 389 | | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) |
| 390 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) |
| 391 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) |
| 392 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 ) |
| 393 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2) |
| 394 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) |
| 532 | /*************************************************************************** |
| 533 | DEVICE CONFIGURATION |
| 534 | ***************************************************************************/ |
| 395 | 535 | |
| 396 | | PORT_START("PB7") |
| 397 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) |
| 398 | | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) |
| 399 | | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) |
| 400 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) |
| 401 | | PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 402 | | /* |
| 403 | | PORT_BIT( 0x, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0) PORT_CHAR('0') |
| 404 | | PORT_BIT( 0x, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1) PORT_CHAR('1') |
| 405 | | PORT_BIT( 0x, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2) PORT_CHAR('2') |
| 406 | | PORT_BIT( 0x, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3) PORT_CHAR('3') |
| 407 | | PORT_BIT( 0x, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4) PORT_CHAR('4') |
| 408 | | PORT_BIT( 0x, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5) PORT_CHAR('5') |
| 409 | | PORT_BIT( 0x, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6) PORT_CHAR('6') |
| 410 | | PORT_BIT( 0x, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7) PORT_CHAR('7') |
| 411 | | PORT_BIT( 0x, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8) PORT_CHAR('8') |
| 412 | | PORT_BIT( 0x, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9) PORT_CHAR('9') |
| 536 | /*------------------------------------------------- |
| 537 | TMS9928a_interface tms9928a_interface |
| 538 | -------------------------------------------------*/ |
| 413 | 539 | |
| 414 | | PORT_BIT( 0x, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_A) PORT_CHAR('A') |
| 415 | | PORT_BIT( 0x, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_B) PORT_CHAR('B') |
| 416 | | PORT_BIT( 0x, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_C) PORT_CHAR('C') |
| 417 | | PORT_BIT( 0x, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_D) PORT_CHAR('D') |
| 418 | | PORT_BIT( 0x, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_E) PORT_CHAR('E') |
| 419 | | PORT_BIT( 0x, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F) PORT_CHAR('F') |
| 420 | | PORT_BIT( 0x, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_G) PORT_CHAR('G') |
| 421 | | PORT_BIT( 0x, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_H) PORT_CHAR('H') |
| 422 | | |
| 423 | | PORT_BIT( 0x, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("S-1") PORT_CODE(KEYCODE_LCONTROL) PORT_CHAR(UCHAR_MAMEKEY(LCONTROL)) |
| 424 | | PORT_BIT( 0x, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("S-1") PORT_CODE(KEYCODE_RCONTROL) PORT_CHAR(UCHAR_MAMEKEY(RCONTROL)) |
| 425 | | */ |
| 426 | | PORT_START("NMI") |
| 427 | | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START ) PORT_NAME("PAUSE") PORT_CODE(KEYCODE_P) PORT_CHANGED(trigger_nmi, 0) |
| 428 | | |
| 429 | | PORT_INCLUDE( tvdraw ) |
| 430 | | INPUT_PORTS_END |
| 431 | | |
| 432 | | /* Machine Interfaces */ |
| 433 | | |
| 434 | | // SG-1000 |
| 435 | | |
| 436 | 540 | static INTERRUPT_GEN( sg1000_int ) |
| 437 | 541 | { |
| 438 | 542 | TMS9928A_interrupt(device->machine); |
| r8190 | r8191 | |
| 451 | 555 | sg1000_vdp_interrupt |
| 452 | 556 | }; |
| 453 | 557 | |
| 454 | | static TIMER_CALLBACK( lightgun_tick ) |
| 455 | | { |
| 456 | | UINT8 *rom = memory_region(machine, Z80_TAG); |
| 558 | /*------------------------------------------------- |
| 559 | I8255A_INTERFACE( sc3000_ppi_intf ) |
| 560 | -------------------------------------------------*/ |
| 457 | 561 | |
| 458 | | if (IS_CARTRIDGE_TV_DRAW(rom)) |
| 459 | | { |
| 460 | | /* enable crosshair for TV Draw */ |
| 461 | | crosshair_set_screen(machine, 0, CROSSHAIR_SCREEN_ALL); |
| 462 | | } |
| 463 | | else |
| 464 | | { |
| 465 | | /* disable crosshair for other cartridges */ |
| 466 | | crosshair_set_screen(machine, 0, CROSSHAIR_SCREEN_NONE); |
| 467 | | } |
| 468 | | } |
| 469 | | |
| 470 | | static MACHINE_START( sg1000 ) |
| 562 | static READ8_DEVICE_HANDLER( sc3000_ppi_pa_r ) |
| 471 | 563 | { |
| 472 | | sg1000_state *state = (sg1000_state *)machine->driver_data; |
| 473 | | |
| 474 | | /* configure VDP */ |
| 475 | | TMS9928A_configure(&tms9928a_interface); |
| 476 | | |
| 477 | | /* toggle light gun crosshair */ |
| 478 | | timer_set(machine, attotime_zero, NULL, 0, lightgun_tick); |
| 479 | | |
| 480 | | /* register for state saving */ |
| 481 | | state_save_register_global(machine, state->tvdraw_data); |
| 482 | | } |
| 483 | | |
| 484 | | // SC-3000 |
| 485 | | |
| 486 | | static READ8_DEVICE_HANDLER( sc3000_ppi8255_a_r ) |
| 487 | | { |
| 488 | 564 | /* |
| 489 | 565 | Signal Description |
| 490 | 566 | |
| r8190 | r8191 | |
| 505 | 581 | return input_port_read(device->machine, keynames[state->keylatch]); |
| 506 | 582 | } |
| 507 | 583 | |
| 508 | | static READ8_DEVICE_HANDLER( sc3000_ppi8255_b_r ) |
| 584 | static READ8_DEVICE_HANDLER( sc3000_ppi_pb_r ) |
| 509 | 585 | { |
| 510 | 586 | /* |
| 511 | 587 | Signal Description |
| r8190 | r8191 | |
| 539 | 615 | return data; |
| 540 | 616 | } |
| 541 | 617 | |
| 542 | | static WRITE8_DEVICE_HANDLER( sc3000_ppi8255_c_w ) |
| 618 | static WRITE8_DEVICE_HANDLER( sc3000_ppi_pc_w ) |
| 543 | 619 | { |
| 544 | 620 | /* |
| 545 | 621 | Signal Description |
| r8190 | r8191 | |
| 562 | 638 | /* cassette */ |
| 563 | 639 | cassette_output(state->cassette, BIT(data, 4) ? +1.0 : -1.0); |
| 564 | 640 | |
| 565 | | /* printer */ |
| 641 | /* TODO printer */ |
| 566 | 642 | } |
| 567 | 643 | |
| 568 | | static I8255A_INTERFACE( sc3000_ppi8255_intf ) |
| 644 | static I8255A_INTERFACE( sc3000_ppi_intf ) |
| 569 | 645 | { |
| 570 | | DEVCB_HANDLER(sc3000_ppi8255_a_r), // Port A read |
| 571 | | DEVCB_HANDLER(sc3000_ppi8255_b_r), // Port B read |
| 572 | | DEVCB_NULL, // Port C read |
| 573 | | DEVCB_NULL, // Port A write |
| 574 | | DEVCB_NULL, // Port B write |
| 575 | | DEVCB_HANDLER(sc3000_ppi8255_c_w), // Port C write |
| 646 | DEVCB_HANDLER(sc3000_ppi_pa_r), // Port A read |
| 647 | DEVCB_HANDLER(sc3000_ppi_pb_r), // Port B read |
| 648 | DEVCB_NULL, // Port C read |
| 649 | DEVCB_NULL, // Port A write |
| 650 | DEVCB_NULL, // Port B write |
| 651 | DEVCB_HANDLER(sc3000_ppi_pc_w), // Port C write |
| 576 | 652 | }; |
| 577 | 653 | |
| 578 | | static MACHINE_START( sc3000 ) |
| 654 | /*------------------------------------------------- |
| 655 | cassette_config sc3000_cassette_config |
| 656 | -------------------------------------------------*/ |
| 657 | |
| 658 | static const cassette_config sc3000_cassette_config = |
| 579 | 659 | { |
| 580 | | sg1000_state *state = (sg1000_state *)machine->driver_data; |
| 660 | cassette_default_formats, |
| 661 | NULL, |
| 662 | (cassette_state)(CASSETTE_STOPPED | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_ENABLED) |
| 663 | }; |
| 581 | 664 | |
| 582 | | /* find devices */ |
| 583 | | state->cassette = devtag_get_device(machine, CASSETTE_TAG); |
| 665 | /*------------------------------------------------- |
| 666 | I8255A_INTERFACE( sf7000_ppi_intf ) |
| 667 | -------------------------------------------------*/ |
| 584 | 668 | |
| 585 | | /* configure VDP */ |
| 586 | | TMS9928A_configure(&tms9928a_interface); |
| 587 | | |
| 588 | | /* toggle light gun crosshair */ |
| 589 | | timer_set(machine, attotime_zero, NULL, 0, lightgun_tick); |
| 590 | | |
| 591 | | /* register for state saving */ |
| 592 | | state_save_register_global(machine, state->tvdraw_data); |
| 593 | | state_save_register_global(machine, state->keylatch); |
| 594 | | } |
| 595 | | |
| 596 | | // SF-7000 |
| 597 | | |
| 598 | | static READ8_DEVICE_HANDLER( sf7000_ppi8255_a_r ) |
| 669 | static READ8_DEVICE_HANDLER( sf7000_ppi_pa_r ) |
| 599 | 670 | { |
| 600 | 671 | /* |
| 601 | 672 | Signal Description |
| r8190 | r8191 | |
| 620 | 691 | return result; |
| 621 | 692 | } |
| 622 | 693 | |
| 623 | | static WRITE8_DEVICE_HANDLER( sf7000_ppi8255_c_w ) |
| 694 | static WRITE8_DEVICE_HANDLER( sf7000_ppi_pc_w ) |
| 624 | 695 | { |
| 625 | 696 | /* |
| 626 | 697 | Signal Description |
| r8190 | r8191 | |
| 657 | 728 | centronics_strobe_w(state->centronics, BIT(data, 7)); |
| 658 | 729 | } |
| 659 | 730 | |
| 660 | | static I8255A_INTERFACE( sf7000_8255_0_intf ) |
| 731 | static I8255A_INTERFACE( sf7000_ppi_intf ) |
| 661 | 732 | { |
| 662 | | DEVCB_HANDLER(sc3000_ppi8255_a_r), // Port A read |
| 663 | | DEVCB_HANDLER(sc3000_ppi8255_b_r), // Port B read |
| 664 | | DEVCB_NULL, // Port C read |
| 665 | | DEVCB_NULL, // Port A write |
| 666 | | DEVCB_NULL, // Port B write |
| 667 | | DEVCB_HANDLER(sc3000_ppi8255_c_w) // Port C write |
| 668 | | }; |
| 669 | | |
| 670 | | static I8255A_INTERFACE( sf7000_8255_1_intf ) |
| 671 | | { |
| 672 | | DEVCB_HANDLER(sf7000_ppi8255_a_r), // Port A read |
| 673 | | DEVCB_NULL, // Port B read |
| 674 | | DEVCB_NULL, // Port C read |
| 675 | | DEVCB_NULL, // Port A write |
| 733 | DEVCB_HANDLER(sf7000_ppi_pa_r), // Port A read |
| 734 | DEVCB_NULL, // Port B read |
| 735 | DEVCB_NULL, // Port C read |
| 736 | DEVCB_NULL, // Port A write |
| 676 | 737 | DEVCB_DEVICE_HANDLER(CENTRONICS_TAG, centronics_data_w), // Port B write |
| 677 | | DEVCB_HANDLER(sf7000_ppi8255_c_w) // Port C write |
| 738 | DEVCB_HANDLER(sf7000_ppi_pc_w) // Port C write |
| 678 | 739 | }; |
| 679 | 740 | |
| 741 | /*------------------------------------------------- |
| 742 | upd765_interface sf7000_upd765_interface |
| 743 | -------------------------------------------------*/ |
| 744 | |
| 680 | 745 | static WRITE_LINE_DEVICE_HANDLER( sf7000_fdc_interrupt ) |
| 681 | 746 | { |
| 682 | 747 | sg1000_state *driver_state = (sg1000_state *)device->machine->driver_data; |
| r8190 | r8191 | |
| 684 | 749 | driver_state->fdc_irq = state; |
| 685 | 750 | } |
| 686 | 751 | |
| 687 | | static void sf7000_fdc_index_callback(running_device *controller, running_device *img, int state) |
| 688 | | { |
| 689 | | sg1000_state *driver_state = (sg1000_state *)img->machine->driver_data; |
| 690 | | |
| 691 | | driver_state->fdc_index = state; |
| 692 | | } |
| 693 | | |
| 694 | 752 | static const struct upd765_interface sf7000_upd765_interface = |
| 695 | 753 | { |
| 696 | 754 | DEVCB_LINE(sf7000_fdc_interrupt), |
| r8190 | r8191 | |
| 700 | 758 | { FLOPPY_0, NULL, NULL, NULL } |
| 701 | 759 | }; |
| 702 | 760 | |
| 761 | /*------------------------------------------------- |
| 762 | FLOPPY_OPTIONS( sf7000 ) |
| 763 | -------------------------------------------------*/ |
| 703 | 764 | |
| 704 | | static MACHINE_START( sf7000 ) |
| 705 | | { |
| 706 | | sg1000_state *state = (sg1000_state *)machine->driver_data; |
| 765 | static FLOPPY_OPTIONS_START( sf7000 ) |
| 766 | FLOPPY_OPTION(sf7000, "sf7", "SF7 disk image", basicdsk_identify_default, basicdsk_construct_default, |
| 767 | HEADS([1]) |
| 768 | TRACKS([40]) |
| 769 | SECTORS([16]) |
| 770 | SECTOR_LENGTH([256]) |
| 771 | FIRST_SECTOR_ID([1])) |
| 772 | FLOPPY_OPTIONS_END |
| 707 | 773 | |
| 708 | | /* find devices */ |
| 709 | | state->upd765 = devtag_get_device(machine, UPD765_TAG); |
| 710 | | state->cassette = devtag_get_device(machine, CASSETTE_TAG); |
| 711 | | state->centronics = devtag_get_device(machine, CENTRONICS_TAG); |
| 774 | /*------------------------------------------------- |
| 775 | floppy_config sf7000_floppy_config |
| 776 | -------------------------------------------------*/ |
| 712 | 777 | |
| 713 | | /* configure VDP */ |
| 714 | | TMS9928A_configure(&tms9928a_interface); |
| 778 | static const floppy_config sf7000_floppy_config = |
| 779 | { |
| 780 | DEVCB_NULL, |
| 781 | DEVCB_NULL, |
| 782 | DEVCB_NULL, |
| 783 | DEVCB_NULL, |
| 784 | DEVCB_NULL, |
| 785 | FLOPPY_DRIVE_DS_80, |
| 786 | FLOPPY_OPTIONS_NAME(sf7000), |
| 787 | DO_NOT_KEEP_GEOMETRY |
| 788 | }; |
| 715 | 789 | |
| 716 | | /* configure FDC */ |
| 717 | | floppy_drive_set_index_pulse_callback(floppy_get_device(machine, 0), sf7000_fdc_index_callback); |
| 790 | /*************************************************************************** |
| 791 | CARTRIDGE LOADING |
| 792 | ***************************************************************************/ |
| 718 | 793 | |
| 719 | | /* configure memory banking */ |
| 720 | | memory_configure_bank(machine, "bank1", 0, 1, memory_region(machine, Z80_TAG), 0); |
| 721 | | memory_configure_bank(machine, "bank1", 1, 1, messram_get_ptr(devtag_get_device(machine, "messram")), 0); |
| 722 | | memory_configure_bank(machine, "bank2", 0, 1, messram_get_ptr(devtag_get_device(machine, "messram")), 0); |
| 794 | /*------------------------------------------------- |
| 795 | sg1000_map_cartridge_memory - |
| 796 | -------------------------------------------------*/ |
| 723 | 797 | |
| 724 | | /* register for state saving */ |
| 725 | | state_save_register_global(machine, state->keylatch); |
| 726 | | state_save_register_global(machine, state->fdc_irq); |
| 727 | | state_save_register_global(machine, state->fdc_index); |
| 728 | | } |
| 729 | | |
| 730 | | static MACHINE_RESET( sf7000 ) |
| 731 | | { |
| 732 | | memory_set_bank(machine, "bank1", 0); |
| 733 | | memory_set_bank(machine, "bank2", 0); |
| 734 | | } |
| 735 | | |
| 736 | 798 | static void sg1000_map_cartridge_memory(running_machine *machine, UINT8 *ptr, int size) |
| 737 | 799 | { |
| 738 | 800 | const address_space *program = cputag_get_address_space(machine, Z80_TAG, ADDRESS_SPACE_PROGRAM); |
| r8190 | r8191 | |
| 769 | 831 | } |
| 770 | 832 | } |
| 771 | 833 | |
| 834 | /*------------------------------------------------- |
| 835 | DEVICE_IMAGE_LOAD( sg1000_cart ) |
| 836 | -------------------------------------------------*/ |
| 837 | |
| 772 | 838 | static DEVICE_IMAGE_LOAD( sg1000_cart ) |
| 773 | 839 | { |
| 774 | 840 | const address_space *program = cputag_get_address_space(image->machine, Z80_TAG, ADDRESS_SPACE_PROGRAM); |
| r8190 | r8191 | |
| 796 | 862 | return INIT_PASS; |
| 797 | 863 | } |
| 798 | 864 | |
| 865 | /*------------------------------------------------- |
| 866 | DEVICE_IMAGE_LOAD( omv_cart ) |
| 867 | -------------------------------------------------*/ |
| 868 | |
| 869 | static DEVICE_IMAGE_LOAD( omv_cart ) |
| 870 | { |
| 871 | UINT32 size; |
| 872 | UINT8 *ptr = memory_region(image->machine, Z80_TAG); |
| 873 | |
| 874 | if (image_software_entry(image) == NULL) |
| 875 | { |
| 876 | size = image_length(image); |
| 877 | if (image_fread(image, ptr, size) != size) |
| 878 | return INIT_FAIL; |
| 879 | } |
| 880 | else |
| 881 | { |
| 882 | size = image_get_software_region_length(image, "rom"); |
| 883 | memcpy(ptr, image_get_software_region(image, "rom"), size); |
| 884 | } |
| 885 | |
| 886 | /* cartridge ROM banking */ |
| 887 | sg1000_map_cartridge_memory(image->machine, ptr, size); |
| 888 | |
| 889 | return INIT_PASS; |
| 890 | } |
| 891 | |
| 892 | /*------------------------------------------------- |
| 893 | sc3000_map_cartridge_memory - |
| 894 | -------------------------------------------------*/ |
| 895 | |
| 799 | 896 | static void sc3000_map_cartridge_memory(running_machine *machine, UINT8 *ptr, int size) |
| 800 | 897 | { |
| 801 | 898 | const address_space *program = cputag_get_address_space(machine, Z80_TAG, ADDRESS_SPACE_PROGRAM); |
| r8190 | r8191 | |
| 820 | 917 | } |
| 821 | 918 | } |
| 822 | 919 | |
| 920 | /*------------------------------------------------- |
| 921 | DEVICE_IMAGE_LOAD( sc3000_cart ) |
| 922 | -------------------------------------------------*/ |
| 923 | |
| 823 | 924 | static DEVICE_IMAGE_LOAD( sc3000_cart ) |
| 824 | 925 | { |
| 825 | 926 | UINT32 size; |
| r8190 | r8191 | |
| 843 | 944 | return INIT_PASS; |
| 844 | 945 | } |
| 845 | 946 | |
| 846 | | /* Machine Drivers */ |
| 947 | /*************************************************************************** |
| 948 | MACHINE INITIALIZATION |
| 949 | ***************************************************************************/ |
| 847 | 950 | |
| 951 | /*------------------------------------------------- |
| 952 | TIMER_CALLBACK( lightgun_tick ) |
| 953 | -------------------------------------------------*/ |
| 954 | |
| 955 | static TIMER_CALLBACK( lightgun_tick ) |
| 956 | { |
| 957 | UINT8 *rom = memory_region(machine, Z80_TAG); |
| 958 | |
| 959 | if (IS_CARTRIDGE_TV_DRAW(rom)) |
| 960 | { |
| 961 | /* enable crosshair for TV Draw */ |
| 962 | crosshair_set_screen(machine, 0, CROSSHAIR_SCREEN_ALL); |
| 963 | } |
| 964 | else |
| 965 | { |
| 966 | /* disable crosshair for other cartridges */ |
| 967 | crosshair_set_screen(machine, 0, CROSSHAIR_SCREEN_NONE); |
| 968 | } |
| 969 | } |
| 970 | |
| 971 | /*------------------------------------------------- |
| 972 | MACHINE_START( sg1000 ) |
| 973 | -------------------------------------------------*/ |
| 974 | |
| 975 | static MACHINE_START( sg1000 ) |
| 976 | { |
| 977 | sg1000_state *state = (sg1000_state *)machine->driver_data; |
| 978 | |
| 979 | /* configure VDP */ |
| 980 | TMS9928A_configure(&tms9928a_interface); |
| 981 | |
| 982 | /* toggle light gun crosshair */ |
| 983 | timer_set(machine, attotime_zero, NULL, 0, lightgun_tick); |
| 984 | |
| 985 | /* register for state saving */ |
| 986 | state_save_register_global(machine, state->tvdraw_data); |
| 987 | } |
| 988 | |
| 989 | /*------------------------------------------------- |
| 990 | MACHINE_START( sc3000 ) |
| 991 | -------------------------------------------------*/ |
| 992 | |
| 993 | static MACHINE_START( sc3000 ) |
| 994 | { |
| 995 | sg1000_state *state = (sg1000_state *)machine->driver_data; |
| 996 | |
| 997 | /* find devices */ |
| 998 | state->cassette = devtag_get_device(machine, CASSETTE_TAG); |
| 999 | |
| 1000 | /* configure VDP */ |
| 1001 | TMS9928A_configure(&tms9928a_interface); |
| 1002 | |
| 1003 | /* toggle light gun crosshair */ |
| 1004 | timer_set(machine, attotime_zero, NULL, 0, lightgun_tick); |
| 1005 | |
| 1006 | /* register for state saving */ |
| 1007 | state_save_register_global(machine, state->tvdraw_data); |
| 1008 | state_save_register_global(machine, state->keylatch); |
| 1009 | } |
| 1010 | |
| 1011 | /*------------------------------------------------- |
| 1012 | sf7000_fdc_index_callback - |
| 1013 | -------------------------------------------------*/ |
| 1014 | |
| 1015 | static void sf7000_fdc_index_callback(running_device *controller, running_device *img, int state) |
| 1016 | { |
| 1017 | sg1000_state *driver_state = (sg1000_state *)img->machine->driver_data; |
| 1018 | |
| 1019 | driver_state->fdc_index = state; |
| 1020 | } |
| 1021 | |
| 1022 | /*------------------------------------------------- |
| 1023 | MACHINE_START( sf7000 ) |
| 1024 | -------------------------------------------------*/ |
| 1025 | |
| 1026 | static MACHINE_START( sf7000 ) |
| 1027 | { |
| 1028 | sg1000_state *state = (sg1000_state *)machine->driver_data; |
| 1029 | |
| 1030 | /* find devices */ |
| 1031 | state->upd765 = devtag_get_device(machine, UPD765_TAG); |
| 1032 | state->cassette = devtag_get_device(machine, CASSETTE_TAG); |
| 1033 | state->centronics = devtag_get_device(machine, CENTRONICS_TAG); |
| 1034 | |
| 1035 | /* configure VDP */ |
| 1036 | TMS9928A_configure(&tms9928a_interface); |
| 1037 | |
| 1038 | /* configure FDC */ |
| 1039 | floppy_drive_set_index_pulse_callback(floppy_get_device(machine, 0), sf7000_fdc_index_callback); |
| 1040 | |
| 1041 | /* configure memory banking */ |
| 1042 | memory_configure_bank(machine, "bank1", 0, 1, memory_region(machine, Z80_TAG), 0); |
| 1043 | memory_configure_bank(machine, "bank1", 1, 1, messram_get_ptr(devtag_get_device(machine, "messram")), 0); |
| 1044 | memory_configure_bank(machine, "bank2", 0, 1, messram_get_ptr(devtag_get_device(machine, "messram")), 0); |
| 1045 | |
| 1046 | /* register for state saving */ |
| 1047 | state_save_register_global(machine, state->keylatch); |
| 1048 | state_save_register_global(machine, state->fdc_irq); |
| 1049 | state_save_register_global(machine, state->fdc_index); |
| 1050 | } |
| 1051 | |
| 1052 | /*------------------------------------------------- |
| 1053 | MACHINE_RESET( sf7000 ) |
| 1054 | -------------------------------------------------*/ |
| 1055 | |
| 1056 | static MACHINE_RESET( sf7000 ) |
| 1057 | { |
| 1058 | memory_set_bank(machine, "bank1", 0); |
| 1059 | memory_set_bank(machine, "bank2", 0); |
| 1060 | } |
| 1061 | |
| 1062 | /*************************************************************************** |
| 1063 | MACHINE DRIVERS |
| 1064 | ***************************************************************************/ |
| 1065 | |
| 1066 | /*------------------------------------------------- |
| 1067 | MACHINE_DRIVER_START( sg1000 ) |
| 1068 | -------------------------------------------------*/ |
| 1069 | |
| 848 | 1070 | static MACHINE_DRIVER_START( sg1000 ) |
| 849 | 1071 | MDRV_DRIVER_DATA(sg1000_state) |
| 850 | 1072 | |
| r8190 | r8191 | |
| 882 | 1104 | MDRV_RAM_DEFAULT_SIZE("1K") |
| 883 | 1105 | MACHINE_DRIVER_END |
| 884 | 1106 | |
| 1107 | /*------------------------------------------------- |
| 1108 | MACHINE_DRIVER_START( omv ) |
| 1109 | -------------------------------------------------*/ |
| 1110 | |
| 885 | 1111 | static MACHINE_DRIVER_START( omv ) |
| 886 | 1112 | MDRV_IMPORT_FROM(sg1000) |
| 887 | 1113 | |
| 1114 | MDRV_CPU_MODIFY(Z80_TAG) |
| 1115 | MDRV_CPU_PROGRAM_MAP(omv_map) |
| 1116 | MDRV_CPU_IO_MAP(omv_io_map) |
| 1117 | |
| 888 | 1118 | MDRV_CARTSLOT_MODIFY("cart") |
| 889 | 1119 | MDRV_CARTSLOT_EXTENSION_LIST("sg,bin") |
| 890 | 1120 | MDRV_CARTSLOT_NOT_MANDATORY |
| 891 | | MDRV_CARTSLOT_LOAD(sg1000_cart) |
| 1121 | MDRV_CARTSLOT_LOAD(omv_cart) |
| 1122 | |
| 1123 | MDRV_RAM_MODIFY("messram") |
| 1124 | MDRV_RAM_DEFAULT_SIZE("2K") |
| 892 | 1125 | MACHINE_DRIVER_END |
| 893 | 1126 | |
| 894 | | static const cassette_config sc3000_cassette_config = |
| 895 | | { |
| 896 | | cassette_default_formats, |
| 897 | | NULL, |
| 898 | | (cassette_state)(CASSETTE_STOPPED | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_ENABLED) |
| 899 | | }; |
| 1127 | /*------------------------------------------------- |
| 1128 | MACHINE_DRIVER_START( sc3000 ) |
| 1129 | -------------------------------------------------*/ |
| 900 | 1130 | |
| 901 | 1131 | static MACHINE_DRIVER_START( sc3000 ) |
| 902 | 1132 | MDRV_DRIVER_DATA(sg1000_state) |
| r8190 | r8191 | |
| 921 | 1151 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) |
| 922 | 1152 | |
| 923 | 1153 | /* devices */ |
| 924 | | MDRV_I8255A_ADD(UPD9255_TAG, sc3000_ppi8255_intf) |
| 1154 | MDRV_I8255A_ADD(UPD9255_TAG, sc3000_ppi_intf) |
| 925 | 1155 | // MDRV_PRINTER_ADD("sp400") /* serial printer */ |
| 926 | 1156 | MDRV_CASSETTE_ADD(CASSETTE_TAG, sc3000_cassette_config) |
| 927 | 1157 | |
| r8190 | r8191 | |
| 940 | 1170 | MDRV_RAM_DEFAULT_SIZE("2K") |
| 941 | 1171 | MACHINE_DRIVER_END |
| 942 | 1172 | |
| 943 | | static FLOPPY_OPTIONS_START( sf7000 ) |
| 944 | | FLOPPY_OPTION(sf7000, "sf7", "SF7 disk image", basicdsk_identify_default, basicdsk_construct_default, |
| 945 | | HEADS([1]) |
| 946 | | TRACKS([40]) |
| 947 | | SECTORS([16]) |
| 948 | | SECTOR_LENGTH([256]) |
| 949 | | FIRST_SECTOR_ID([1])) |
| 950 | | FLOPPY_OPTIONS_END |
| 1173 | /*------------------------------------------------- |
| 1174 | MACHINE_DRIVER_START( sf7000 ) |
| 1175 | -------------------------------------------------*/ |
| 951 | 1176 | |
| 952 | | static const floppy_config sf7000_floppy_config = |
| 953 | | { |
| 954 | | DEVCB_NULL, |
| 955 | | DEVCB_NULL, |
| 956 | | DEVCB_NULL, |
| 957 | | DEVCB_NULL, |
| 958 | | DEVCB_NULL, |
| 959 | | FLOPPY_DRIVE_DS_80, |
| 960 | | FLOPPY_OPTIONS_NAME(sf7000), |
| 961 | | DO_NOT_KEEP_GEOMETRY |
| 962 | | }; |
| 963 | | |
| 964 | 1177 | static MACHINE_DRIVER_START( sf7000 ) |
| 965 | 1178 | MDRV_DRIVER_DATA(sg1000_state) |
| 966 | 1179 | |
| r8190 | r8191 | |
| 985 | 1198 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) |
| 986 | 1199 | |
| 987 | 1200 | /* devices */ |
| 988 | | MDRV_I8255A_ADD(UPD9255_0_TAG, sf7000_8255_0_intf) |
| 989 | | MDRV_I8255A_ADD(UPD9255_1_TAG, sf7000_8255_1_intf) |
| 1201 | MDRV_I8255A_ADD(UPD9255_0_TAG, sc3000_ppi_intf) |
| 1202 | MDRV_I8255A_ADD(UPD9255_1_TAG, sf7000_ppi_intf) |
| 990 | 1203 | MDRV_MSM8251_ADD(UPD8251_TAG, default_msm8251_interface) |
| 991 | 1204 | MDRV_UPD765A_ADD(UPD765_TAG, sf7000_upd765_interface) |
| 992 | 1205 | MDRV_FLOPPY_DRIVE_ADD(FLOPPY_0, sf7000_floppy_config) |
| r8190 | r8191 | |
| 999 | 1212 | MDRV_RAM_DEFAULT_SIZE("64K") |
| 1000 | 1213 | MACHINE_DRIVER_END |
| 1001 | 1214 | |
| 1002 | | /* ROMs */ |
| 1215 | /*************************************************************************** |
| 1216 | ROMS |
| 1217 | ***************************************************************************/ |
| 1003 | 1218 | |
| 1004 | 1219 | ROM_START( sg1000 ) |
| 1005 | 1220 | ROM_REGION( 0x10000, Z80_TAG, ROMREGION_ERASE00 ) |
| 1006 | 1221 | ROM_END |
| 1007 | 1222 | |
| 1008 | | ROM_START( sg1000m2 ) |
| 1009 | | ROM_REGION( 0x10000, Z80_TAG, ROMREGION_ERASE00 ) |
| 1010 | | ROM_END |
| 1223 | #define rom_sg1000m2 rom_sg1000 |
| 1011 | 1224 | |
| 1225 | #define rom_sc3000 rom_sg1000 |
| 1226 | |
| 1227 | #define rom_sc3000h rom_sg1000 |
| 1228 | |
| 1012 | 1229 | ROM_START( omv1000 ) |
| 1013 | 1230 | ROM_REGION( 0x10000, Z80_TAG, ROMREGION_ERASE00 ) |
| 1014 | 1231 | ROM_LOAD( "omvbios.bin", 0x0000, 0x4000, CRC(c5a67b95) SHA1(6d7c64dd60dee4a33061d3d3a7c2ed190d895cdb) ) |
| 1015 | 1232 | ROM_END |
| 1016 | 1233 | |
| 1017 | | ROM_START( omv2000 ) |
| 1018 | | ROM_REGION( 0x10000, Z80_TAG, ROMREGION_ERASE00 ) |
| 1019 | | ROM_LOAD( "omvbios.bin", 0x0000, 0x4000, CRC(c5a67b95) SHA1(6d7c64dd60dee4a33061d3d3a7c2ed190d895cdb) ) |
| 1020 | | ROM_END |
| 1234 | #define rom_omv2000 rom_omv1000 |
| 1021 | 1235 | |
| 1022 | | ROM_START( sc3000 ) |
| 1023 | | ROM_REGION( 0x10000, Z80_TAG, ROMREGION_ERASE00 ) |
| 1024 | | ROM_END |
| 1025 | | |
| 1026 | | ROM_START( sc3000h ) |
| 1027 | | ROM_REGION( 0x10000, Z80_TAG, ROMREGION_ERASE00 ) |
| 1028 | | ROM_END |
| 1029 | | |
| 1030 | 1236 | ROM_START( sf7000 ) |
| 1031 | 1237 | ROM_REGION( 0x10000, Z80_TAG, 0 ) |
| 1032 | 1238 | ROM_LOAD( "ipl.rom", 0x0000, 0x2000, CRC(d76810b8) SHA1(77339a6db2593aadc638bed77b8e9bed5d9d87e3) ) |
| 1033 | 1239 | ROM_END |
| 1034 | 1240 | |
| 1035 | | /* System Drivers */ |
| 1241 | /*************************************************************************** |
| 1242 | SYSTEM DRIVERS |
| 1243 | ***************************************************************************/ |
| 1036 | 1244 | |
| 1037 | 1245 | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME FLAGS */ |
| 1038 | 1246 | CONS( 1983, sg1000, 0, 0, sg1000, sg1000, 0, "Sega", "SG-1000", GAME_SUPPORTS_SAVE ) |
| r8190 | r8191 | |
| 1040 | 1248 | COMP( 1983, sc3000, 0, sg1000, sc3000, sc3000, 0, "Sega", "SC-3000", GAME_SUPPORTS_SAVE ) |
| 1041 | 1249 | COMP( 1983, sc3000h, sc3000, 0, sc3000, sc3000, 0, "Sega", "SC-3000H", GAME_SUPPORTS_SAVE ) |
| 1042 | 1250 | COMP( 1983, sf7000, sc3000, 0, sf7000, sf7000, 0, "Sega", "SC-3000/Super Control Station SF-7000", GAME_SUPPORTS_SAVE ) |
| 1043 | | CONS( 1984, omv1000, sg1000, 0, omv, omv, 0, "Tsukuda Original", "Othello Multivision FG-1000", GAME_NOT_WORKING ) |
| 1044 | | CONS( 1984, omv2000, sg1000, 0, omv, omv, 0, "Tsukuda Original", "Othello Multivision FG-2000", GAME_NOT_WORKING ) |
| 1251 | CONS( 1984, omv1000, sg1000, 0, omv, omv, 0, "Tsukuda Original", "Othello Multivision FG-1000", GAME_SUPPORTS_SAVE ) |
| 1252 | CONS( 1984, omv2000, sg1000, 0, omv, omv, 0, "Tsukuda Original", "Othello Multivision FG-2000", GAME_SUPPORTS_SAVE ) |