From 80858801300a2f48ad250721a79ebc7b1b0aba92 Mon Sep 17 00:00:00 2001 From: Nebuleon Fumika Date: Thu, 20 Dec 2012 18:10:38 -0500 Subject: Remove the SNES Open Bus behaviour by default. Also simplify translation again. SNES Open Bus is a quirk of the memory subsystem that allow reads of invalid addresses to return the last byte read from memory. However, it is seldom needed by a game, and it costs 1 to 3 MIPS instructions per SNES instruction to emulate. If you need SNES Open Bus, you can remove -DNO_OPEN_BUS from the Makefile. --- source/sa1.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'source/sa1.cpp') diff --git a/source/sa1.cpp b/source/sa1.cpp index 39b08bb..eb10d33 100644 --- a/source/sa1.cpp +++ b/source/sa1.cpp @@ -228,14 +228,23 @@ uint8 S9xSA1GetByte (uint32 address) #ifdef DEBUGGER // printf ("R(B) %06x\n", address); #endif +#ifndef NO_OPEN_BUS return OpenBus; +#else + return 0; // Arbitrarily chosen value [Neb] +#endif } } uint16 S9xSA1GetWord (uint32 address) { +#ifndef NO_OPEN_BUS OpenBus = S9xSA1GetByte (address); return (OpenBus | (S9xSA1GetByte (address + 1) << 8)); +#else + uint8 Split = S9xSA1GetByte (address); + return (Split | (S9xSA1GetByte (address + 1) << 8)); +#endif } void S9xSA1SetByte (uint8 byte, uint32 address) -- cgit v1.2.3