src/mess/drivers/pc6001.c
| r5927 | r5928 | |
| 99 | 99 | static UINT8 irq_vector = 0x00; |
| 100 | 100 | static UINT8 cas_switch,sys_latch; |
| 101 | 101 | |
| 102 | | #define CAS_LENGTH 0x1655 |
| 102 | #define CAS_LENGTH 0x3d32 |
| 103 | 103 | |
| 104 | 104 | static VIDEO_START( pc6001 ) |
| 105 | 105 | { |
| r5927 | r5928 | |
| 215 | 215 | cas_switch = 1; |
| 216 | 216 | |
| 217 | 217 | sys_latch = data; |
| 218 | printf("%02x\n",data); |
| 218 | 219 | } |
| 219 | 220 | |
| 220 | 221 | #if 0 |
| r5927 | r5928 | |
| 302 | 303 | |
| 303 | 304 | /* Input ports */ |
| 304 | 305 | static INPUT_PORTS_START( pc6001 ) |
| 306 | /* TODO: these two are unchecked */ |
| 307 | PORT_START("P1") |
| 308 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY |
| 309 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY |
| 310 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY |
| 311 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY |
| 312 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 313 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) |
| 314 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) |
| 315 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 316 | |
| 317 | PORT_START("P2") |
| 318 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) |
| 319 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) |
| 320 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) |
| 321 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) |
| 322 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 323 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) |
| 324 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) |
| 325 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 326 | |
| 305 | 327 | PORT_START("key1") //0x00-0x1f |
| 306 | 328 | PORT_BIT(0x00000001,IP_ACTIVE_HIGH,IPT_UNUSED) //0x00 null |
| 307 | 329 | PORT_BIT(0x00000002,IP_ACTIVE_HIGH,IPT_UNUSED) //0x01 soh |
| r5927 | r5928 | |
| 474 | 496 | { |
| 475 | 497 | AY8910_LEGACY_OUTPUT, |
| 476 | 498 | AY8910_DEFAULT_LOADS, |
| 499 | DEVCB_INPUT_PORT("P1"), |
| 500 | DEVCB_INPUT_PORT("P2"), |
| 501 | DEVCB_NULL, |
| 477 | 502 | DEVCB_NULL |
| 478 | 503 | }; |
| 479 | 504 | |
| r5927 | r5928 | |
| 522 | 547 | } |
| 523 | 548 | } |
| 524 | 549 | |
| 550 | static TIMER_CALLBACK(audio_callback) |
| 551 | { |
| 552 | if(cas_switch == 0) |
| 553 | { |
| 554 | irq_vector = 0x06; |
| 555 | cputag_set_input_line(machine,"maincpu", 0, ASSERT_LINE); |
| 556 | } |
| 557 | } |
| 558 | |
| 525 | 559 | static TIMER_CALLBACK(keyboard_callback) |
| 526 | 560 | { |
| 527 | 561 | const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM); |
| r5927 | r5928 | |
| 550 | 584 | //pc6001_video_ram = pc6001_ram; |
| 551 | 585 | |
| 552 | 586 | cpu_set_irq_callback(cputag_get_cpu(machine, "maincpu"),pc6001_irq_callback); |
| 553 | | timer_pulse(machine, ATTOTIME_IN_HZ(240), NULL, 0, keyboard_callback); |
| 587 | /* TODO: accurate timing on these (especially for the first one) */ |
| 588 | timer_pulse(machine, ATTOTIME_IN_HZ(540), NULL, 0, audio_callback); |
| 589 | timer_pulse(machine, ATTOTIME_IN_HZ(250), NULL, 0, keyboard_callback); |
| 554 | 590 | timer_pulse(machine, ATTOTIME_IN_HZ(160), NULL, 0, cassette_callback); |
| 555 | 591 | cas_switch = 0; |
| 556 | 592 | } |
| r5927 | r5928 | |
| 578 | 614 | |
| 579 | 615 | static MACHINE_DRIVER_START( pc6001 ) |
| 580 | 616 | /* basic machine hardware */ |
| 581 | | MDRV_CPU_ADD("maincpu",Z80, 7987200 /2) |
| 617 | MDRV_CPU_ADD("maincpu",Z80, 7987200 / 4) |
| 582 | 618 | MDRV_CPU_PROGRAM_MAP(pc6001_mem) |
| 583 | 619 | MDRV_CPU_IO_MAP(pc6001_io) |
| 584 | 620 | MDRV_CPU_VBLANK_INT("screen", pc6001_interrupt) |
| r5927 | r5928 | |
| 628 | 664 | |
| 629 | 665 | ROM_REGION( 0x10000, "cas", ROMREGION_ERASEFF ) |
| 630 | 666 | /* Load here your tape for now (and change the cas length macro according to what MESS returns) */ |
| 631 | | // ROM_LOAD( "car.cas", 0x0000, CAS_LENGTH, CRC(1) SHA1(1) ) |
| 667 | // ROM_LOAD( "magnetic field.cas", 0x0000, CAS_LENGTH, CRC(1) SHA1(1) ) |
| 632 | 668 | ROM_END |
| 633 | 669 | |
| 634 | 670 | ROM_START( pc6001a ) |