Previous 199869 Revisions Next

r18346 Monday 8th October, 2012 at 06:25:43 UTC by Miodrag Milanović
Emulated Lord of Gun's protection rather than patching it out [iq_132]
[src/mame/drivers]lordgun.c
[src/mame/includes]lordgun.h

trunk/src/mame/drivers/lordgun.c
r18345r18346
7171
7272      rom[i] = x;
7373   }
74
75   // Protection
76
77   rom[0x14832/2]   =   0x6000;      // 014832: 6700 0006  beq     $1483a (protection)
78   rom[0x1587e/2]   =   0x6010;      // 01587E: 6710       beq     $15890 (rom check)
7974}
8075
8176
r18345r18346
134129
135130***************************************************************************/
136131
132
133WRITE16_MEMBER(lordgun_state::lordgun_protection_w)
134{
135   switch (offset & 0x60)
136   {
137      // The data written to offsets 0 - 1f is offset * 2
138      // Use this write to increment the counter.
139      case 0x00:
140         m_lordgun_protection_data++;
141      return;
142
143      case 0x20: // unused?
144      case 0x40: // protection results are read back from 40-5f.
145      return;
146
147      case 0x60: // reset / init
148         m_lordgun_protection_data = 0;
149      return;
150   }
151}
152
153READ16_MEMBER(lordgun_state::lordgun_protection_r)
154{
155   // Other offset ranges are not used?
156   if ((offset & 0x60) == 0x40)
157   {
158      // Check to see if counter meets various conditions.
159      // The results may not be 0010, but this is the only bit
160      // that is checked by the 68k.
161      if ((m_lordgun_protection_data & 0x11) == 0x01)
162         return 0x0010;
163
164      if ((m_lordgun_protection_data & 0x06) == 0x02)
165         return 0x0010;
166
167      if ((m_lordgun_protection_data & 0x09) == 0x08)
168         return 0x0010;
169
170      return 0;
171   }
172
173   return 0;
174}
175
137176WRITE8_MEMBER(lordgun_state::fake_w)
138177{
139178}
r18345r18346
286325   AM_RANGE(0x504000, 0x504001) AM_WRITE(lordgun_soundlatch_w)
287326   AM_RANGE(0x506000, 0x506007) AM_DEVREADWRITE8("ppi8255_0", i8255_device, read, write, 0x00ff)
288327   AM_RANGE(0x508000, 0x508007) AM_DEVREADWRITE8("ppi8255_1", i8255_device, read, write, 0x00ff)
289   AM_RANGE(0x50a900, 0x50a9ff) AM_RAM   // protection
328   AM_RANGE(0x50a900, 0x50a9ff) AM_READWRITE(lordgun_protection_r, lordgun_protection_w)
290329ADDRESS_MAP_END
291330
292331
r18345r18346
10391078
10401079***************************************************************************/
10411080
1042GAME( 1994, lordgun,   0,        lordgun,  lordgun, lordgun_state,  lordgun,   ROT0, "IGS", "Lord of Gun (USA)",       GAME_UNEMULATED_PROTECTION | GAME_IMPERFECT_GRAPHICS )
1081GAME( 1994, lordgun,   0,        lordgun,  lordgun, lordgun_state,  lordgun,   ROT0, "IGS", "Lord of Gun (USA)",       GAME_IMPERFECT_GRAPHICS )
10431082GAME( 1994, aliencha,  0,        aliencha, aliencha, lordgun_state, aliencha,  ROT0, "IGS", "Alien Challenge (World)", GAME_UNEMULATED_PROTECTION )
10441083GAME( 1994, alienchac, aliencha, aliencha, aliencha, lordgun_state, alienchac, ROT0, "IGS", "Alien Challenge (China)", GAME_UNEMULATED_PROTECTION )
trunk/src/mame/includes/lordgun.h
r18345r18346
3737   tilemap_t *m_tilemap[4];
3838   bitmap_ind16 *m_bitmaps[5];
3939
40   UINT16 m_lordgun_protection_data;
41   DECLARE_WRITE16_MEMBER(lordgun_protection_w);
42   DECLARE_READ16_MEMBER(lordgun_protection_r);
43
4044   DECLARE_WRITE16_MEMBER(lordgun_priority_w);
4145   DECLARE_READ16_MEMBER(lordgun_gun_0_x_r);
4246   DECLARE_READ16_MEMBER(lordgun_gun_0_y_r);

Previous 199869 Revisions Next


© 1997-2024 The MAME Team