Previous 15994 Revisions Next

r8740 Sunday 8th August, 2010 at 11:19:43 UTC by Angelo Salese
[PC-6001Mk2]: Fixed CG ROM bankswitch priority bug, fixes American Truck joystick/keyboard question gfxs
[src/mess/drivers]pc6001.c

src/mess/drivers/pc6001.c
r8739r8740
2222   - The Outlaw (AX-10): is now broken due of the joycode stuff
2323   - Portpia: hangs after a bunch of text screens
2424   - 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
2725   - Yakyukyo (MK2): waits for an irq, check which one;
2826   - Forts 2 (MK2): ASCII gfxs are missing;
2927   - Hydlide (MK2): crashes due of a load error;
3028   - 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.
3230
3331========================================================================================================================================================
3432
r8739r8740
129127static UINT32 cas_offset;
130128static UINT32 cas_maxsize;
131129/* PC6001mk2 specific */
132static UINT8 ex_vram_bank, bgcol_bank,exgfx_text_mode,exgfx_bitmap_mode,exgfx_2bpp_mode,bank_w,bank_opt;
133static UINT8 bank_r0,bank_r1;
130static UINT8 ex_vram_bank, bgcol_bank,exgfx_text_mode,exgfx_bitmap_mode,exgfx_2bpp_mode;
131static UINT8 bank_r0,bank_r1,gfx_bank_on,bank_w,bank_opt;
134132
135133//#define CAS_LENGTH 0x1655
136134
r8739r8740
788786static WRITE8_HANDLER( pc6001m2_bank_r0_w )
789787{
790788   UINT8 *ROM = memory_region(space->machine, "maincpu");
789   UINT8 *gfx_data = memory_region(space->machine, "gfx1");
791790
792791//  bankaddress = 0x10000 + (0x4000 * ((data & 0x40)>>6));
793792//  memory_set_bankptr(space->machine, 1, &ROM[bankaddress]);
r8739r8740
798797   memory_set_bankptr(space->machine, "bank1", &ROM[banksw_table_r0[(data & 0xf)+(bank_opt*0x10)][0]]);
799798   memory_set_bankptr(space->machine, "bank2", &ROM[banksw_table_r0[(data & 0xf)+(bank_opt*0x10)][1]]);
800799   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?)
802804}
803805
804806static WRITE8_HANDLER( pc6001m2_bank_r1_w )
r8739r8740
825827static WRITE8_HANDLER( pc6001m2_opt_bank_w )
826828{
827829   UINT8 *ROM = memory_region(space->machine, "maincpu");
830   UINT8 *gfx_data = memory_region(space->machine, "gfx1");
828831
829832   /*
830833   0 - TVROM / VOICE ROM
r8739r8740
837840   memory_set_bankptr(space->machine, "bank1", &ROM[banksw_table_r0[(bank_r0 & 0xf)+(bank_opt*0x10)][0]]);
838841   memory_set_bankptr(space->machine, "bank2", &ROM[banksw_table_r0[(bank_r0 & 0xf)+(bank_opt*0x10)][1]]);
839842   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?)
840847   memory_set_bankptr(space->machine, "bank4", &ROM[banksw_table_r0[((bank_r0 & 0xf0)>>4)+(bank_opt*0x10)][3]]);
841848   memory_set_bankptr(space->machine, "bank5", &ROM[banksw_table_r1[(bank_r1 & 0xf)+(bank_opt*0x10)][0]]);
842849   memory_set_bankptr(space->machine, "bank6", &ROM[banksw_table_r1[(bank_r1 & 0xf)+(bank_opt*0x10)][1]]);
r8739r8740
880887         //printf("%02x\n",data);
881888
882889         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         }
884894         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         }
886899      }
887900   }
888901   i8255a_w(device,offset,data);
r8739r8740
986999}
9871000
9881001/* this is a voice status flag, used by Chrith no Ainotabidachi (FIXME: identify and hook-up this voice synth chip) */
989static READ8_HANDLER( unk_r )
1002static READ8_HANDLER( voice_status_r )
9901003{
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;
9921008}
9931009
9941010static ADDRESS_MAP_START(pc6001m2_map, ADDRESS_SPACE_PROGRAM, 8)
r8739r8740
10161032   AM_RANGE(0xc0, 0xc0) AM_WRITE(pc6001m2_col_bank_w)
10171033   AM_RANGE(0xc1, 0xc1) AM_WRITE(pc6001m2_vram_bank_w)
10181034   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
10201038   AM_RANGE(0xf0, 0xf0) AM_WRITE(pc6001m2_bank_r0_w)
10211039   AM_RANGE(0xf1, 0xf1) AM_WRITE(pc6001m2_bank_r1_w)
10221040   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
10231042ADDRESS_MAP_END
10241043
10251044/* Input ports */
r8739r8740
14311450      memory_set_bankptr(machine, "bank8", &ROM[WRAM(7)]);
14321451      bank_opt = 0x02; //tv rom
14331452      bank_w = 0x55; //write to work ram
1453      gfx_bank_on = 0;
14341454   }
14351455}
14361456
r8739r8740
16151635   MDRV_CPU_IO_MAP(pc6001m2_io)
16161636
16171637   MDRV_GFXDECODE(pc6001m2)
1638
16181639MACHINE_DRIVER_END
16191640
16201641static MACHINE_DRIVER_START( pc6001sr )
1621   MDRV_IMPORT_FROM(pc6001)
1642   MDRV_IMPORT_FROM(pc6001m2)
16221643
1623   MDRV_VIDEO_UPDATE(pc6001m2)
1624
16251644   /* basic machine hardware */
16261645   MDRV_CPU_REPLACE("maincpu", Z80, XTAL_3_579545MHz)
1627   MDRV_CPU_PROGRAM_MAP(pc6001m2_map)
16281646MACHINE_DRIVER_END
16291647
16301648/* ROM definition */

Previous 15994 Revisions Next


© 1998-2018 The MESS Team