Previous 199869 Revisions Next

r24581 Tuesday 30th July, 2013 at 16:19:47 UTC by David Haywood
make pocket gal deluxe use the new 104 code, it has a different scramble on the address lines just to make things annoying even if the checks are trivial.
[src/mame/drivers]pktgaldx.c
[src/mame/includes]pktgaldx.h
[src/mame/machine]deco104.c deco104.h

trunk/src/mame/machine/deco104.c
r24580r24581
10861086
10871087
10881088
1089
1090/**********************************************************************************/
1091
1092
1093/**********************************************************************************/
1094
1095
1096/**********************************************************************************/
1097
1098static UINT16 deco16_prot_ram[0x800];
1099
1100READ16_HANDLER( deco16_104_pktgaldx_prot_r )
1101{
1102   const UINT16* prot_ram=deco16_prot_ram;
1103   switch (offset * 2)
1104   {
1105   case 0x5b2: return space.machine().root_device().ioport("SYSTEM")->read();
1106   case 0x44c: return space.machine().root_device().ioport("DSW")->read();
1107   case 0x042: return space.machine().root_device().ioport("INPUTS")->read();
1108
1109   case 0x510: return DECO_PORT(0);
1110   case 0x51a: return DECO_PORT(2);
1111   }
1112
1113   logerror("Protection PC %06x: warning - read unmapped memory address %04x\n", space.device().safe_pc(), offset<<1);
1114
1115   return 0;
1116}
1117
1118WRITE16_HANDLER( deco16_104_pktgaldx_prot_w )
1119{
1120   COMBINE_DATA(&deco16_prot_ram[offset]);
1121//  logerror("Protection PC %06x: warning - write unmapped memory address %04x %04x\n",space.device().safe_pc(),offset<<1,data);
1122
1123}
1124
1125/**********************************************************************************/
1126
1127
trunk/src/mame/machine/deco104.h
r24580r24581
3939
4040
4141
42
43
44// legacy, has a weird scramble, need to update
45DECLARE_READ16_HANDLER( deco16_104_pktgaldx_prot_r );
46DECLARE_WRITE16_HANDLER( deco16_104_pktgaldx_prot_w );
47
48
4942#endif
trunk/src/mame/includes/pktgaldx.h
r24580r24581
5151   UINT32 screen_update_pktgaldx(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
5252   UINT32 screen_update_pktgaldb(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
5353
54   READ16_MEMBER( pktgaldx_protection_region_0_104_r );
55   WRITE16_MEMBER( pktgaldx_protection_region_0_104_w );
54   READ16_MEMBER( pktgaldx_protection_region_f_104_r );
55   WRITE16_MEMBER( pktgaldx_protection_region_f_104_w );
5656};
trunk/src/mame/drivers/pktgaldx.c
r24580r24581
6767
6868/**********************************************************************************/
6969
70READ16_MEMBER( pktgaldx_state::pktgaldx_protection_region_f_104_r )
71{
72   int real_address = 0 + (offset *2);
73   UINT8 cs = 0;
74   UINT16 data = m_deco104->read_data( real_address&0x7fff, mem_mask, cs );
75   return data;
76}
77
78WRITE16_MEMBER( pktgaldx_state::pktgaldx_protection_region_f_104_w )
79{
80   int real_address = 0 + (offset *2);
81   UINT8 cs = 0;
82   m_deco104->write_data( space, real_address&0x7fff, data, mem_mask, cs );
83}
84
85
7086static ADDRESS_MAP_START( pktgaldx_map, AS_PROGRAM, 16, pktgaldx_state )
7187   AM_RANGE(0x000000, 0x07ffff) AM_ROM
7288
r24580r24581
85101
86102   AM_RANGE(0x161800, 0x16180f) AM_DEVWRITE("tilegen1", deco16ic_device, pf_control_w)
87103   AM_RANGE(0x164800, 0x164801) AM_WRITE(pktgaldx_oki_bank_w)
88   AM_RANGE(0x167800, 0x167fff) AM_READWRITE_LEGACY(deco16_104_pktgaldx_prot_r,deco16_104_pktgaldx_prot_w) AM_SHARE("prot16ram")
104
105//   AM_RANGE(0x166000, 0x1667ff) AM_READWRITE(pktgaldx_protection_region_c_104_r,pktgaldx_protection_region_c_104_w) /* Protection device - chip select / config bank for it.. */
106   AM_RANGE(0x167800, 0x167fff) AM_READWRITE(pktgaldx_protection_region_f_104_r,pktgaldx_protection_region_f_104_w) AM_SHARE("prot16ram") /* Protection device */
107
89108   AM_RANGE(0x170000, 0x17ffff) AM_RAM
90109ADDRESS_MAP_END
91110
r24580r24581
334353   decospr_device::set_gfx_region(*device, 2);
335354
336355   MCFG_DECO104_ADD("ioprot104")
356   MCFG_DECO146_SET_INTERFACE_SCRAMBLE(8,9,  4,5,6,7    ,1,0,3,2) // hopefully this is correct, nothing else uses this arrangement!
337357
338358   /* sound hardware */
339359   MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")

Previous 199869 Revisions Next


© 1997-2024 The MAME Team