src/mess/drivers/pc6001.c
| r8739 | r8740 | |
| 22 | 22 | - The Outlaw (AX-10): is now broken due of the joycode stuff |
| 23 | 23 | - Portpia: hangs after a bunch of text screens |
| 24 | 24 | - Galaxy Mission Part I / II: can't start a play |
| 25 | | - Renritsuhoteishiki (MK2): has a slight bug with the kanji at the top, |
| 26 | | probably wrong kanji ROM hook-up |
| 27 | 25 | - Yakyukyo (MK2): waits for an irq, check which one; |
| 28 | 26 | - Forts 2 (MK2): ASCII gfxs are missing; |
| 29 | 27 | - Hydlide (MK2): crashes due of a load error; |
| 30 | 28 | - American Truck (MK2): Screen is offset at the loading screen |
| 31 | | - American Truck (MK2): joystick / keyboard question gfxs aren't right, apparently banking doesn't catch the needed change. |
| 29 | - Castle Excellent (MK2): copyright text drawing is quite bogus. |
| 32 | 30 | |
| 33 | 31 | ======================================================================================================================================================== |
| 34 | 32 | |
| r8739 | r8740 | |
| 129 | 127 | static UINT32 cas_offset; |
| 130 | 128 | static UINT32 cas_maxsize; |
| 131 | 129 | /* PC6001mk2 specific */ |
| 132 | | static UINT8 ex_vram_bank, bgcol_bank,exgfx_text_mode,exgfx_bitmap_mode,exgfx_2bpp_mode,bank_w,bank_opt; |
| 133 | | static UINT8 bank_r0,bank_r1; |
| 130 | static UINT8 ex_vram_bank, bgcol_bank,exgfx_text_mode,exgfx_bitmap_mode,exgfx_2bpp_mode; |
| 131 | static UINT8 bank_r0,bank_r1,gfx_bank_on,bank_w,bank_opt; |
| 134 | 132 | |
| 135 | 133 | //#define CAS_LENGTH 0x1655 |
| 136 | 134 | |
| r8739 | r8740 | |
| 788 | 786 | static WRITE8_HANDLER( pc6001m2_bank_r0_w ) |
| 789 | 787 | { |
| 790 | 788 | UINT8 *ROM = memory_region(space->machine, "maincpu"); |
| 789 | UINT8 *gfx_data = memory_region(space->machine, "gfx1"); |
| 791 | 790 | |
| 792 | 791 | // bankaddress = 0x10000 + (0x4000 * ((data & 0x40)>>6)); |
| 793 | 792 | // memory_set_bankptr(space->machine, 1, &ROM[bankaddress]); |
| r8739 | r8740 | |
| 798 | 797 | memory_set_bankptr(space->machine, "bank1", &ROM[banksw_table_r0[(data & 0xf)+(bank_opt*0x10)][0]]); |
| 799 | 798 | memory_set_bankptr(space->machine, "bank2", &ROM[banksw_table_r0[(data & 0xf)+(bank_opt*0x10)][1]]); |
| 800 | 799 | memory_set_bankptr(space->machine, "bank3", &ROM[banksw_table_r0[((data & 0xf0)>>4)+(bank_opt*0x10)][2]]); |
| 801 | | memory_set_bankptr(space->machine, "bank4", &ROM[banksw_table_r0[((data & 0xf0)>>4)+(bank_opt*0x10)][3]]); |
| 800 | if(!gfx_bank_on) |
| 801 | memory_set_bankptr(space->machine, "bank4", &ROM[banksw_table_r0[((bank_r0 & 0xf0)>>4)+(bank_opt*0x10)][3]]); |
| 802 | else |
| 803 | memory_set_bankptr(space->machine, "bank4", &gfx_data[0x2000]); //FIXME: check this (CGROM 1/2?) |
| 802 | 804 | } |
| 803 | 805 | |
| 804 | 806 | static WRITE8_HANDLER( pc6001m2_bank_r1_w ) |
| r8739 | r8740 | |
| 825 | 827 | static WRITE8_HANDLER( pc6001m2_opt_bank_w ) |
| 826 | 828 | { |
| 827 | 829 | UINT8 *ROM = memory_region(space->machine, "maincpu"); |
| 830 | UINT8 *gfx_data = memory_region(space->machine, "gfx1"); |
| 828 | 831 | |
| 829 | 832 | /* |
| 830 | 833 | 0 - TVROM / VOICE ROM |
| r8739 | r8740 | |
| 837 | 840 | memory_set_bankptr(space->machine, "bank1", &ROM[banksw_table_r0[(bank_r0 & 0xf)+(bank_opt*0x10)][0]]); |
| 838 | 841 | memory_set_bankptr(space->machine, "bank2", &ROM[banksw_table_r0[(bank_r0 & 0xf)+(bank_opt*0x10)][1]]); |
| 839 | 842 | memory_set_bankptr(space->machine, "bank3", &ROM[banksw_table_r0[((bank_r0 & 0xf0)>>4)+(bank_opt*0x10)][2]]); |
| 843 | if(!gfx_bank_on) |
| 844 | memory_set_bankptr(space->machine, "bank4", &ROM[banksw_table_r0[((bank_r0 & 0xf0)>>4)+(bank_opt*0x10)][3]]); |
| 845 | else |
| 846 | memory_set_bankptr(space->machine, "bank4", &gfx_data[0x2000]); //FIXME: check this (CGROM 1/2?) |
| 840 | 847 | memory_set_bankptr(space->machine, "bank4", &ROM[banksw_table_r0[((bank_r0 & 0xf0)>>4)+(bank_opt*0x10)][3]]); |
| 841 | 848 | memory_set_bankptr(space->machine, "bank5", &ROM[banksw_table_r1[(bank_r1 & 0xf)+(bank_opt*0x10)][0]]); |
| 842 | 849 | memory_set_bankptr(space->machine, "bank6", &ROM[banksw_table_r1[(bank_r1 & 0xf)+(bank_opt*0x10)][1]]); |
| r8739 | r8740 | |
| 880 | 887 | //printf("%02x\n",data); |
| 881 | 888 | |
| 882 | 889 | if((data & 0x0f) == 0x05) |
| 883 | | memory_set_bankptr(device->machine, "bank4", &ROM[banksw_table_r0[(bank_r0 & 0xf0)>>4][3]]); |
| 890 | { |
| 891 | gfx_bank_on = 0; |
| 892 | memory_set_bankptr(device->machine, "bank4", &ROM[banksw_table_r0[((bank_r0 & 0xf0)>>4)+(bank_opt*0x10)][3]]); |
| 893 | } |
| 884 | 894 | if((data & 0x0f) == 0x04) |
| 885 | | memory_set_bankptr(device->machine, "bank4", &gfx_data[0x2000]); //FIXME: check this (CGROM 2) |
| 895 | { |
| 896 | gfx_bank_on = 1; |
| 897 | memory_set_bankptr(device->machine, "bank4", &gfx_data[0x2000]); //FIXME: check this (CGROM 1/2?) |
| 898 | } |
| 886 | 899 | } |
| 887 | 900 | } |
| 888 | 901 | i8255a_w(device,offset,data); |
| r8739 | r8740 | |
| 986 | 999 | } |
| 987 | 1000 | |
| 988 | 1001 | /* this is a voice status flag, used by Chrith no Ainotabidachi (FIXME: identify and hook-up this voice synth chip) */ |
| 989 | | static READ8_HANDLER( unk_r ) |
| 1002 | static READ8_HANDLER( voice_status_r ) |
| 990 | 1003 | { |
| 991 | | return 0x7f; |
| 1004 | //x--- ---- status (1) not ready |
| 1005 | //-x-- ---- writes some presumably wrong data |
| 1006 | //---x ---- enables voice ROM, gives small time to fire an irq there |
| 1007 | return 0x00; |
| 992 | 1008 | } |
| 993 | 1009 | |
| 994 | 1010 | static ADDRESS_MAP_START(pc6001m2_map, ADDRESS_SPACE_PROGRAM, 8) |
| r8739 | r8740 | |
| 1016 | 1032 | AM_RANGE(0xc0, 0xc0) AM_WRITE(pc6001m2_col_bank_w) |
| 1017 | 1033 | AM_RANGE(0xc1, 0xc1) AM_WRITE(pc6001m2_vram_bank_w) |
| 1018 | 1034 | AM_RANGE(0xc2, 0xc2) AM_WRITE(pc6001m2_opt_bank_w) |
| 1019 | | AM_RANGE(0xe0, 0xe0) AM_READ(unk_r) |
| 1035 | /* 0xe0 / 0xe3 is clearly voice synth related */ |
| 1036 | AM_RANGE(0xe0, 0xe0) AM_READ(voice_status_r) //AM_WRITE(adpcm_w) |
| 1037 | |
| 1020 | 1038 | AM_RANGE(0xf0, 0xf0) AM_WRITE(pc6001m2_bank_r0_w) |
| 1021 | 1039 | AM_RANGE(0xf1, 0xf1) AM_WRITE(pc6001m2_bank_r1_w) |
| 1022 | 1040 | AM_RANGE(0xf2, 0xf2) AM_WRITE(pc6001m2_bank_w0_w) |
| 1041 | AM_RANGE(0xf3, 0xf3) AM_WRITENOP // Chrith writes there on the intro screens, 0xc2 then 0xc7 |
| 1023 | 1042 | ADDRESS_MAP_END |
| 1024 | 1043 | |
| 1025 | 1044 | /* Input ports */ |
| r8739 | r8740 | |
| 1431 | 1450 | memory_set_bankptr(machine, "bank8", &ROM[WRAM(7)]); |
| 1432 | 1451 | bank_opt = 0x02; //tv rom |
| 1433 | 1452 | bank_w = 0x55; //write to work ram |
| 1453 | gfx_bank_on = 0; |
| 1434 | 1454 | } |
| 1435 | 1455 | } |
| 1436 | 1456 | |
| r8739 | r8740 | |
| 1615 | 1635 | MDRV_CPU_IO_MAP(pc6001m2_io) |
| 1616 | 1636 | |
| 1617 | 1637 | MDRV_GFXDECODE(pc6001m2) |
| 1638 | |
| 1618 | 1639 | MACHINE_DRIVER_END |
| 1619 | 1640 | |
| 1620 | 1641 | static MACHINE_DRIVER_START( pc6001sr ) |
| 1621 | | MDRV_IMPORT_FROM(pc6001) |
| 1642 | MDRV_IMPORT_FROM(pc6001m2) |
| 1622 | 1643 | |
| 1623 | | MDRV_VIDEO_UPDATE(pc6001m2) |
| 1624 | | |
| 1625 | 1644 | /* basic machine hardware */ |
| 1626 | 1645 | MDRV_CPU_REPLACE("maincpu", Z80, XTAL_3_579545MHz) |
| 1627 | | MDRV_CPU_PROGRAM_MAP(pc6001m2_map) |
| 1628 | 1646 | MACHINE_DRIVER_END |
| 1629 | 1647 | |
| 1630 | 1648 | /* ROM definition */ |