Previous 199869 Revisions Next

r32393 Friday 26th September, 2014 at 02:26:12 UTC by R. Belmont
Gundam Wing: Endless Duel updates: [Peter Ferrie]
* added additional shared memory block
* added protection handlers
* corrected reset vector
* worked around bad startup

Game now boots but doesn't coin up.
[src/mame/drivers]snesb.c

trunk/src/mame/drivers/snesb.c
r32392r32393
155155
156156   INT8 *m_shared_ram;
157157   UINT8 m_cnt;
158   INT8 *m_shared_ram2;
158159   DECLARE_READ8_MEMBER(sharedram_r);
159160   DECLARE_WRITE8_MEMBER(sharedram_w);
160161   DECLARE_READ8_MEMBER(sb2b_75bd37_r);
161162   DECLARE_READ8_MEMBER(sb2b_6a6xxx_r);
162163   DECLARE_READ8_MEMBER(sb2b_7xxx_r);
164   DECLARE_READ8_MEMBER(endless_580xxx_r);
165   DECLARE_READ8_MEMBER(endless_624b7f_r);
166   DECLARE_READ8_MEMBER(endless_800b_r);
167   DECLARE_READ8_MEMBER(sharedram2_r);
168   DECLARE_WRITE8_MEMBER(sharedram2_w);
163169   DECLARE_READ8_MEMBER(snesb_dsw1_r);
164170   DECLARE_READ8_MEMBER(snesb_dsw2_r);
165171   DECLARE_READ8_MEMBER(snesb_coin_r);
r32392r32393
217223}
218224
219225
226/* Endless Duel */
227READ8_MEMBER(snesb_state::endless_580xxx_r)
228{
229   /* protection checks */
230   switch(offset)
231   {
232      case 0x2bc: return 0xb4;
233      case 0x36a: return 0x8a;
234      case 0x7c1: return 0xd9;
235      case 0x956: return 0xa5;
236      case 0xe83: return 0x6b;
237   }
238
239   logerror("Unknown protection read read %x @ %x\n",offset, space.device().safe_pc());
240
241   return 0;
242}
243
244READ8_MEMBER(snesb_state::endless_624b7f_r)
245{
246   /* protection check */
247   return ++m_cnt;
248}
249
250READ8_MEMBER(snesb_state::endless_800b_r)
251{
252   if (!offset)
253   {
254      return 0x50;
255   }
256
257   return 0xe8;
258}
259
260READ8_MEMBER(snesb_state::sharedram2_r)
261{
262   return m_shared_ram2[offset];
263}
264
265WRITE8_MEMBER(snesb_state::sharedram2_w)
266{
267   m_shared_ram2[offset]=data;
268}
269
220270/* Generic read handlers for Dip Switches and coins inputs */
221271READ8_MEMBER(snesb_state::snesb_dsw1_r)
222272{
r32392r32393
892942      }
893943   }
894944
945   /*  boot vector */
946   dst[0x7ffc] = 0x00;
947   dst[0x7ffd] = 0x80;
948
949   /* protection checks */
950   m_maincpu->space(AS_PROGRAM).install_read_handler(0x580000, 0x580fff, read8_delegate(FUNC(snesb_state::endless_580xxx_r),this));
951   m_maincpu->space(AS_PROGRAM).install_read_handler(0x624b7f, 0x624b7f, read8_delegate(FUNC(snesb_state::endless_624b7f_r),this));
952
953   /* work around missing content */
954   m_maincpu->space(AS_PROGRAM).install_read_handler(0x800b, 0x800c, read8_delegate(FUNC(snesb_state::endless_800b_r),this));
955
956   m_shared_ram = auto_alloc_array(machine(), INT8, 0x22);
957   m_shared_ram2 = auto_alloc_array(machine(), INT8, 0x22);
958   m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x781000, 0x781021, read8_delegate(FUNC(snesb_state::sharedram_r),this), write8_delegate(FUNC(snesb_state::sharedram_w),this));
959   m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0x781200, 0x781221, read8_delegate(FUNC(snesb_state::sharedram2_r),this), write8_delegate(FUNC(snesb_state::sharedram2_w),this));
960
895961   DRIVER_INIT_CALL(snes);
896962}
897963

Previous 199869 Revisions Next


© 1997-2024 The MAME Team