SNES (MESS-specific): Preliminary open bus emulation for allowing Shien's Revenge / Shien the Blade Chaser to boot

This commit is contained in:
Angelo Salese 2009-08-03 21:48:28 +00:00
parent 23612784b3
commit 3a4ef6d6c9
2 changed files with 22 additions and 2 deletions

View File

@ -1241,6 +1241,8 @@ READ8_HANDLER( spc_io_r )
{ {
switch( offset ) /* Offset is from 0x00f0 */ switch( offset ) /* Offset is from 0x00f0 */
{ {
case 0x1:
return 0; //Super Kick Boxing reads port 1 and wants it to be zero.
case 0x2: /* Register address */ case 0x2: /* Register address */
return spc_ram[0xf2]; return spc_ram[0xf2];
case 0x3: /* Register data */ case 0x3: /* Register data */
@ -1265,7 +1267,7 @@ READ8_HANDLER( spc_io_r )
} }
} }
return 0; //Super Kick Boxing reads port 1 and wants it to be zero. return 0xff;
} }
WRITE8_HANDLER( spc_io_w ) WRITE8_HANDLER( spc_io_w )

View File

@ -280,6 +280,21 @@ static TIMER_CALLBACK( snes_hblank_tick )
*************************************/ *************************************/
static READ8_HANDLER( snes_open_bus_r )
{
static UINT8 recurse = 0;
UINT16 result;
/* prevent recursion */
if (recurse)
return 0xff;
recurse = 1;
result = memory_read_byte_8le(space, cpu_get_pc(space->cpu)+2); //TODO: must be the LAST opcode that's fetched on the bus
recurse = 0;
return result;
}
/* /*
* DR - Double read : address is read twice to return a 16bit value. * DR - Double read : address is read twice to return a 16bit value.
* low - This is the low byte of a 16 or 24 bit value * low - This is the low byte of a 16 or 24 bit value
@ -299,7 +314,7 @@ READ8_HANDLER( snes_r_io )
/* offset is from 0x000000 */ /* offset is from 0x000000 */
switch( offset ) switch( offset )
{ {
/* hacks for SimCity 2000 to boot - I presume openbus emulation will fix */ /* hacks for SimCity 2000 (J) to boot - I presume openbus emulation will fix */
case 0x221a: case 0x221a:
case 0x231c: case 0x231c:
case 0x241e: case 0x241e:
@ -312,6 +327,9 @@ READ8_HANDLER( snes_r_io )
case 0x2016: case 0x2016:
return 2; return 2;
/* Shien The Blade Chaser / Shien's Revenge reads here instead */
case NMITIMEN:
return snes_open_bus_r(space,0);
case OAMADDL: case OAMADDL:
case OAMADDH: case OAMADDH:
case VMADDL: case VMADDL: