* Super NES and Super Nintendo Entertainment System are trademarks of
* Nintendo Co., Limited and its subsidiary companies.
*/
+
#include "snes9x.h"
+
+#ifdef USE_SA1
+
#include "ppu.h"
#include "cpuexec.h"
SA1.PC = NULL;
SA1.PCBase = NULL;
S9xSA1SetPCBase (SA1Registers.PC);
- //SA1.S9xOpcodes = S9xSA1OpcodesM1X1; // unused
+#if !CONF_BUILD_ASM_SA1
+ SA1.S9xOpcodes = S9xSA1OpcodesM1X1;
S9xSA1UnpackStatus();
- //S9xSA1FixCycles (); // unused
+ S9xSA1FixCycles ();
+#endif
+
SA1.Executing = TRUE;
SA1.BWRAM = Memory.SRAM;
Memory.FillRAM [0x2225] = 0;
SA1.ShiftedDB = (uint32) SA1Registers.DB << 16;
S9xSA1SetPCBase (SA1.ShiftedPB + SA1Registers.PC);
+#if !CONF_BUILD_ASM_SA1
S9xSA1UnpackStatus ();
- //S9xSA1FixCycles (); // unused
+ S9xSA1FixCycles ();
+#endif
SA1.VirtualBitmapFormat = (Memory.FillRAM [0x223f] & 0x80) ? 2 : 4;
Memory.BWRAM = Memory.SRAM + (Memory.FillRAM [0x2224] & 7) * 0x2000;
S9xSA1SetBWRAMMemMap (Memory.FillRAM [0x2225]);
if (GetAddress >= (uint8 *) CMemory::MAP_LAST)
return (*(GetAddress + (address & 0xffff)));
- switch ((int) GetAddress)
+ switch ((CMemory::Types)(intptr_t) GetAddress)
{
case CMemory::MAP_PPU:
return (S9xGetSA1 (address & 0xffff));
void S9xSA1SetByte (uint8 byte, uint32 address)
{
- uint8 *Setaddress = SA1.WriteMap [(address >> MEMMAP_SHIFT) & MEMMAP_MASK];
+ uint8 *SetAddress = SA1.WriteMap [(address >> MEMMAP_SHIFT) & MEMMAP_MASK];
- if (Setaddress >= (uint8 *) CMemory::MAP_LAST)
+ if (SetAddress >= (uint8 *) CMemory::MAP_LAST)
{
- *(Setaddress + (address & 0xffff)) = byte;
+ *(SetAddress + (address & 0xffff)) = byte;
return;
}
- switch ((int) Setaddress)
+ switch ((CMemory::Types)(intptr_t) SetAddress)
{
case CMemory::MAP_PPU:
S9xSetSA1 (byte, address & 0xffff);
return;
}
- switch ((int) GetAddress)
+ switch ((CMemory::Types)(intptr_t) GetAddress)
{
case CMemory::MAP_PPU:
SA1.PCBase = Memory.FillRAM - 0x2000;
Memory.FillRAM [0x225b] = (uint8) (addr >> 16);
}
}
+
+#endif
+