src/mess/drivers/x1.c
| r5512 | r5513 | |
| 322 | 322 | { |
| 323 | 323 | UINT8 *ROM = memory_region(space->machine, "maincpu"); |
| 324 | 324 | |
| 325 | | if(data) |
| 326 | | memory_set_bankptr(space->machine, 1, &ROM[0x00000]); |
| 325 | memory_set_bankptr(space->machine, 1, &ROM[0x00000]); |
| 327 | 326 | } |
| 328 | 327 | |
| 329 | 328 | static WRITE8_HANDLER( rom_data_w ) |
| r5512 | r5513 | |
| 493 | 492 | { |
| 494 | 493 | io_bank_mode = 0; //any read disables the extended mode. |
| 495 | 494 | |
| 496 | | if (offset >= 0x0704 && offset <= 0x0707) { return z80ctc_r(devtag_get_device(space->machine, "ctc"), offset-0x0704); } |
| 495 | if(offset >= 0x0704 && offset <= 0x0707) { return z80ctc_r(devtag_get_device(space->machine, "ctc"), offset-0x0704); } |
| 497 | 496 | else if(offset == 0x0e03) { return x1_rom_r(space, 0); } |
| 498 | 497 | else if(offset >= 0x0ff8 && offset <= 0x0fff) { return x1_fdc_r(space, offset-0xff8); } |
| 499 | 498 | else if(offset >= 0x1900 && offset <= 0x19ff) { return sub_io_r(space, 0); } |
| r5512 | r5513 | |
| 508 | 507 | else if(offset >= 0x4000 && offset <= 0xffff) { return gfx_bitmap_ram[offset-0x4000]; } |
| 509 | 508 | else |
| 510 | 509 | { |
| 511 | | //... |
| 510 | logerror("(PC=%06x) Read i/o address %04x\n",cpu_get_pc(space->cpu),offset); |
| 512 | 511 | } |
| 513 | 512 | return 0xff; |
| 514 | 513 | } |
| 515 | 514 | |
| 516 | 515 | static WRITE8_HANDLER( x1_ex_gfxram_w ) |
| 517 | 516 | { |
| 518 | | if(data) |
| 519 | | fatalerror("Extended GFX RAM write %02x %04x",data,offset); |
| 517 | // if(data) |
| 518 | // fatalerror("Extended GFX RAM write %02x %04x",data,offset); |
| 520 | 519 | } |
| 521 | 520 | |
| 522 | 521 | static WRITE8_HANDLER( x1_io_w ) |
| r5512 | r5513 | |
| 550 | 549 | else if(offset >= 0x4000 && offset <= 0xffff) { gfx_bitmap_ram[offset-0x4000] = data; } |
| 551 | 550 | else |
| 552 | 551 | { |
| 553 | | //... |
| 552 | logerror("(PC=%06x) Write %02x at i/o address %04x\n",cpu_get_pc(space->cpu),data,offset); |
| 554 | 553 | } |
| 555 | 554 | } |
| 556 | 555 | |
| r5512 | r5513 | |
| 836 | 835 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) |
| 837 | 836 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 838 | 837 | |
| 839 | | /* TODO: check if the other inputs are actually used (including button 2)... */ |
| 840 | 838 | PORT_START("P1") |
| 841 | 839 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY |
| 842 | 840 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY |
| 843 | 841 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY |
| 844 | 842 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY |
| 845 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 ) |
| 843 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 846 | 844 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) |
| 847 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 845 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) |
| 848 | 846 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 849 | 847 | |
| 850 | 848 | PORT_START("P2") |
| r5512 | r5513 | |
| 852 | 850 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) |
| 853 | 851 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) |
| 854 | 852 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) |
| 855 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) |
| 853 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 856 | 854 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) |
| 857 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 855 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) |
| 858 | 856 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 859 | 857 | |
| 860 | 858 | PORT_START("key1") //0x00-0x1f |