Previous 15994 Revisions Next

r5346 Tuesday 4th August, 2009 at 06:34:55 UTC by Jonathan Gevaryahu
SNES (MESS-specific): Preliminary open bus emulation for allowing Shien's Revenge / Shien the Blade Chaser to boot [Angelo Salese]
[src/mame/audio]snes.c
[src/mame/machine]snes.c

src/mame/audio/snes.c
r5345r5346
12411241{
12421242   switch( offset )   /* Offset is from 0x00f0 */
12431243   {
1244      case 0x1:
1245         return 0; //Super Kick Boxing reads port 1 and wants it to be zero.
12441246      case 0x2:      /* Register address */
12451247         return spc_ram[0xf2];
12461248      case 0x3:      /* Register data */
r5345r5346
12621264         UINT8 value = spc_ram[0xf0 + offset] & 0xf;
12631265         spc_ram[0xf0 + offset] = 0;
12641266         return value;
1267      }
12651268   }
1266   }
1269
12671270   return 0xff;
12681271}
12691272
src/mame/machine/snes.c
r5345r5346
280280
281281*************************************/
282282
283static READ8_HANDLER( snes_open_bus_r )
284{
285   static UINT8 recurse = 0;
286   UINT16 result;
287
288   /* prevent recursion */
289   if (recurse)
290      return 0xff;
291
292   recurse = 1;
293   result = memory_read_byte_8le(space, cpu_get_pc(space->cpu)+2); //TODO: must be the LAST opcode that's fetched on the bus
294   recurse = 0;
295   return result;
296}
297
283298/*
284299 * DR   - Double read : address is read twice to return a 16bit value.
285300 * low  - This is the low byte of a 16 or 24 bit value
r5345r5346
299314   /* offset is from 0x000000 */
300315   switch( offset )
301316   {
302      /* hacks for SimCity 2000 to boot - I presume openbus emulation will fix */
317      /* hacks for SimCity 2000 (J) to boot - I presume openbus emulation will fix */
303318      case 0x221a:
304319      case 0x231c:
305320      case 0x241e:
r5345r5346
312327      case 0x2016:
313328         return 2;
314329
330      /* Shien The Blade Chaser / Shien's Revenge reads here instead */
331      case NMITIMEN:
332         return snes_open_bus_r(space,0);
315333      case OAMADDL:
316334      case OAMADDH:
317335      case VMADDL:

Previous 15994 Revisions Next


© 1998-2018 The MESS Team