Unverified Commit 70b14c77 authored by Libretro-Admin's avatar Libretro-Admin Committed by GitHub
Browse files

Merge pull request #169 from bearoso/libretro

Up to date core changes
parents d2aefd2f a0b9fe01
......@@ -767,7 +767,7 @@ static void to_var_from_buf (uint8 **buf, void *var, size_t size)
}
#undef IF_0_THEN_256
#define IF_0_THEN_256( n ) ((uint8_t) ((n) - 1) + 1)
#define IF_0_THEN_256( n ) ((uint8) ((n) - 1) + 1)
void S9xAPULoadBlarggState(uint8 *oldblock)
{
uint8 *ptr = oldblock;
......@@ -776,26 +776,26 @@ void S9xAPULoadBlarggState(uint8 *oldblock)
copier.copy(SNES::smp.apuram,0x10000); // RAM
uint8_t regs_in [0x10];
uint8_t regs [0x10];
uint16_t pc, spc_time, dsp_time;
uint8_t a,x,y,psw,sp;
uint8 regs_in [0x10];
uint8 regs [0x10];
uint16 pc, spc_time, dsp_time;
uint8 a,x,y,psw,sp;
copier.copy(regs,0x10); // REGS
copier.copy(regs_in,0x10); // REGS_IN
// CPU Regs
pc = copier.copy_int( 0, sizeof(uint16_t) );
a = copier.copy_int( 0, sizeof(uint8_t) );
x = copier.copy_int( 0, sizeof(uint8_t) );
y = copier.copy_int( 0, sizeof(uint8_t) );
psw = copier.copy_int( 0, sizeof(uint8_t) );
sp = copier.copy_int( 0, sizeof(uint8_t) );
pc = copier.copy_int( 0, sizeof(uint16) );
a = copier.copy_int( 0, sizeof(uint8) );
x = copier.copy_int( 0, sizeof(uint8) );
y = copier.copy_int( 0, sizeof(uint8) );
psw = copier.copy_int( 0, sizeof(uint8) );
sp = copier.copy_int( 0, sizeof(uint8) );
copier.extra();
// times
spc_time = copier.copy_int( 0, sizeof(uint16_t) );
dsp_time = copier.copy_int( 0, sizeof(uint16_t) );
spc_time = copier.copy_int( 0, sizeof(uint16) );
dsp_time = copier.copy_int( 0, sizeof(uint16) );
int cur_time = S9xAPUGetClock(CPU.Cycles);
......@@ -808,14 +808,14 @@ void S9xAPULoadBlarggState(uint8 *oldblock)
SNES::dsp.load_state(&ptr);
// Timers
uint16_t next_time[3];
uint8_t divider[3], counter[3];
uint16 next_time[3];
uint8 divider[3], counter[3];
for ( int i = 0; i < 3; i++ )
{
next_time[i] = copier.copy_int( 0, sizeof(uint16_t) );
divider[i] = copier.copy_int( 0, sizeof(uint8_t) );
counter[i] = copier.copy_int( 0, sizeof(uint8_t) );
copier.extra();
next_time[i] = copier.copy_int( 0, sizeof(uint16) );
divider[i] = copier.copy_int( 0, sizeof(uint8) );
counter[i] = copier.copy_int( 0, sizeof(uint8) );
copier.extra();
}
// construct timers out of available parts from blargg smp
SNES::smp.timer0.enable = regs[1] >> 0 & 1; // regs[1] = CONTROL
......
......@@ -302,6 +302,8 @@ static inline uint32 AbsoluteIndexedIndirectSlow (AccessMode a) // (a,X)
static inline uint32 AbsoluteIndexedIndirect (AccessMode a) // (a,X)
{
uint16 addr = Immediate16Slow(READ);
AddCycles(ONE_CYCLE);
addr += Registers.X.W;
// Address load wraps within the bank
......
......@@ -204,17 +204,9 @@
static inline void S9xReschedule (void);
#ifdef LAGFIX
bool8 finishedFrame = false;
#endif
void S9xMainLoop (void)
{
#ifdef LAGFIX
do
{
#endif
#define CHECK_FOR_IRQ_CHANGE() \
if (Timings.IRQFlagChanging) \
{ \
......@@ -241,7 +233,7 @@ void S9xMainLoop (void)
{
CPU.WaitingForInterrupt = FALSE;
Registers.PCw++;
CPU.Cycles += ONE_CYCLE;
CPU.Cycles += TWO_CYCLES + ONE_DOT_CYCLE / 2;
while (CPU.Cycles >= CPU.NextEvent)
S9xDoHEventProcessing();
}
......@@ -251,20 +243,6 @@ void S9xMainLoop (void)
}
}
if (CPU.IRQTransition)
{
if (CPU.WaitingForInterrupt)
{
CPU.WaitingForInterrupt = FALSE;
Registers.PCw++;
CPU.Cycles += ONE_CYCLE;
while (CPU.Cycles >= CPU.NextEvent)
S9xDoHEventProcessing();
}
CPU.IRQTransition = FALSE;
CPU.IRQLine = TRUE;
}
if (CPU.Cycles >= Timings.NextIRQTimer)
{
#ifdef DEBUGGER
......@@ -272,14 +250,26 @@ void S9xMainLoop (void)
#endif
S9xUpdateIRQPositions(false);
CPU.IRQTransition = TRUE;
CPU.IRQLine = TRUE;
}
if ((CPU.IRQLine || CPU.IRQExternal) && !CheckFlag(IRQ))
if (CPU.IRQLine || CPU.IRQExternal)
{
/* The flag pushed onto the stack is the new value */
CHECK_FOR_IRQ_CHANGE();
S9xOpcode_IRQ();
if (CPU.WaitingForInterrupt)
{
CPU.WaitingForInterrupt = FALSE;
Registers.PCw++;
CPU.Cycles += TWO_CYCLES + ONE_DOT_CYCLE / 2;
while (CPU.Cycles >= CPU.NextEvent)
S9xDoHEventProcessing();
}
if (!CheckFlag(IRQ))
{
/* The flag pushed onto the stack is the new value */
CHECK_FOR_IRQ_CHANGE();
S9xOpcode_IRQ();
}
}
/* Change IRQ flag for instructions that set it only on last cycle */
......@@ -348,36 +338,18 @@ void S9xMainLoop (void)
if (Settings.SA1)
S9xSA1MainLoop();
#ifdef LAGFIX
if (finishedFrame)
break;
#endif
}
#ifdef LAGFIX
if (!finishedFrame)
#endif
S9xPackStatus();
if (CPU.Flags & SCAN_KEYS_FLAG)
{
S9xPackStatus();
if (CPU.Flags & SCAN_KEYS_FLAG)
{
#ifdef DEBUGGER
if (!(CPU.Flags & FRAME_ADVANCE_FLAG))
#endif
S9xSyncSpeed();
CPU.Flags &= ~SCAN_KEYS_FLAG;
}
#ifdef DEBUGGER
if (!(CPU.Flags & FRAME_ADVANCE_FLAG))
#endif
S9xSyncSpeed();
CPU.Flags &= ~SCAN_KEYS_FLAG;
}
#ifdef LAGFIX
else
{
finishedFrame = false;
break;
}
}while(!finishedFrame);
#endif
}
static inline void S9xReschedule (void)
......@@ -433,8 +405,8 @@ void S9xDoHEventProcessing (void)
#ifdef DEBUGGER
if (Settings.TraceHCEvent)
S9xTraceFormattedMessage("--- HC event processing (%s) expected HC:%04d executed HC:%04d",
eventname[CPU.WhichEvent], CPU.NextEvent, CPU.Cycles);
S9xTraceFormattedMessage("--- HC event processing (%s) expected HC:%04d executed HC:%04d VC:%04d",
eventname[CPU.WhichEvent], CPU.NextEvent, CPU.Cycles, CPU.V_Counter);
#endif
switch (CPU.WhichEvent)
......@@ -529,9 +501,7 @@ void S9xDoHEventProcessing (void)
S9xEndScreenRefresh();
CPU.Flags |= SCAN_KEYS_FLAG;
#ifdef LAGFIX
finishedFrame = true;
#endif
PPU.HDMA = 0;
// Bits 7 and 6 of $4212 are computed when read in S9xGetPPU.
#ifdef DEBUGGER
......
......@@ -3488,6 +3488,7 @@ static void OpCB (void)
AddCycles(TWO_CYCLES);
#else
CPU.WaitingForInterrupt = TRUE;
Registers.PCw--;
AddCycles(ONE_CYCLE);
#endif
......
Snes9x 1.56.2
- Fixed IRQ corner case that caused Umihara Kawase's water
to cover the whole screen. (BearOso)
- Adjusted IRQ timing slightly. Fixes Dragon Ball Z - Super
Butouden 2. (BearOso)
- Clear WAI when IRQLine is active. Fixes Top Gear 3000. (BearOso)
- Fix reading the wrong tile data in mosaic drawing. Gets
rid of glitch at top of FF6 battle transitions. (BearOso)
- Break a specific opcode into cycles. Fixes Little Magic. (BearOso)
- Win32: Don't mix garbage into the last line with NTSC
filter. (OV2)
- Win32: Allow disabling scanlines in NTSC filter. (BearOso)
- GTK+: Added an undo load state option. (BearOso)
- GTK+: Fixed compilation on big-endian systems. (OV2)
- Win32, GTK+: Added integer scaling option. (BearOso)
- GTK+, Unix: Preserve current joypad state when rewinding. (BearOso)
Snes9x 1.56.1
- Automatic input rate now only works for close multiples (BearOso)
of 60Hz.
- Win32: Cheats are now shown in the correct order in the (BearOso)
list view.
- GTK+: Check for version greater than 3.22 when using GTK+ (BearOso)
3.
- GTK+: Don't resize code and description field in GTK+ 2. (BearOso)
Snes9x 1.56
- Increased the speed of SA1 emulation to match hardware (BearOso)
more closely.
- Fixed negative SA1 division (BearOso, Jonas Quinn)
- Changed the location where we poll input to potentially (Brunnis, BearOso)
reduce lag.
- Fixed the interlace fields being swapped after skipping (BearOso)
frames.
- More updates for BS-X support. (LuigiBlood)
- Updated xBRZ to version 1.6. (zenju, OV2)
- Added a DMA timing hack for rpgone's Koryu no Mimi (OV2)
translation.
- Updated HDMA to not update indirect addresses until after (BearOso)
transfers are completed.
- Improved cheats support. This stores cheats in a human- (BearOso, OV2)
readable and editable format as gamename.cht. Cheats are
converted from the old format on load. They can be added
in many different formats, but they will convert to the
simple address=condition?byte format.
Also, now included is mightymo's cheat database, and the
ability to match a game and automatically load cheats
from it.
- Don't reset a pending NMI on vblank end. Fixes Super (furrykef)
Punch-Out.
- Redo NMI timing. Fixes Secret of Evermore (PAL). (BearOso)
- Test for transparency before dithering on SuperFX. This (RedGuy(yyy))
fixes some graphical artifacts in Star Fox.
- Change some of the SDD1 guesswork mapping. Fixes a Tales (BearOso)
of Phantasia hack.
- Return PPU1 MDR for reads of $2137 instead of CPU MDR. (BearOso)
Fixes Mario's Time Machine graphical glitch.
- Memset less memory for sprite calculations. (Nebuleon)
- Don't spuriously update register 14 when running SuperFX. (BearOso)
Fixes graphical glitches in Doom.
- Added a SuperFX clock modifier variable. (BearOso)
- Write CPU MDR during some DMA and HDMA transfers. Fixes (BearOso)
Speedy Gonzales and Funaki Masakatsu Hybrid Wrestler.
- Calculate next IRQ time in advance instead of continously (BearOso, OV2)
checking for it.
- Added some IRQ timing quirks. Fixes at least Marko's (BearOso, OV2)
Magic Football.
- Fixed wrong tile selection in offset-per-tile mode. (BearOso)
- Advance the VRAM pointer even if VRAM writes at the time (kps501)
are invalid.
- Return 0x80 instead of 0xff in DSP1 simulation. Fixes (kps501)
Powerfest '94 Mario Kart.
- Initialize controllers on reset. Fixes Looney Tunes (kps501)
B-Ball multitap.
- Attached APU instruction tracer and made some additions (BearOso)
to debugging output.
- Fix line doubling in interlaced mode. (kps501)
- Added support for M.A.C.S. rifle peripheral. (kps501)
- Fixed a bug where the MSU1 channels were reversed. (qwertymodo)
- Win32: Added dynamic rate control support for XAudio2 (OV2)
- Win32: Added different volume level configuration for (OV2)
regular and turbo speed.
- Win32: Added option to disable EPX scaling for messages (OV2)
- Win32: Improve multi-rom loading. (OV2)
- Win32: Add libpng and zlib dependencies as submodules for (qwertymodo, OV2)
easier compiling from source.
- Win32: Fixed icon registration. (OV2)
- Win32: Better support for running while unfocused. (OV2)
- Win32: Changed icon. (BearOso)
- Win32: Report hidpi support. (BearOso)
- Win32: Added mute hotkey and hotkeys for saving/loading (OV2)
from file.
- Win32: Disabled hotplugging in favor of a menu option to (OV2)
reconfigure joysticks.
- Win32: Added a reduce input lag option. (BearOso)
- Win32: Added ability to use GLSLP shaders with OpenGL, (OV2)
including a dialog to tweak custom parameters.
- GTK+: Added dynamic rate control support for audio to (BearOso)
reduce buffer overflows and underflows.
- GTK+: Increased SDL requirement to version 2.0. This (BearOso)
improves joystick compatibility.
- GTK+: Improved GTK+ 3.0 support and made it the default. (BearOso)
- GTK+: Added ability to start from a snapshot on the (julien2512)
command line.
- GTK+: Added automatic input rate handling. (BearOso)
- GTK+: Use 16-bit 5-6-5 pixel format for better colors. (BearOso)
- GTK+: Now disables the compositor in fullscreen mode. (BearOso)
- GTK+: Changed icon. (BearOso)
- GTK+: Require libepoxy for OpenGL support. (BearOso)
- GTK+: Add full compatibility with GLSLP shaders, with a (BearOso)
parameters dialog to configure them.
- Unix: Add xinerama support and window position hints. (Francesco149)
Snes9x 1.55
- Added support for the MSU-1 coprocessor. (qwertymodo)
- Added support for MSU-1 distribution pack. (qwertymodo)
- Added support for BS-X Satellaview memory packs and data (LuigiBlood)
files.
- Improved BS-X memory mapping accuracy. (LuigiBlood)
- Fixed APU error causing issues with some games. (byuu, qwertymodo)
- Added option to ignore patch checksums. (qwertymodo)
- Fixed build warnings / undefined behavior. (bonimy)
- Correct pixel placement in hires. (BearOso, OV2)
- Fixed RAM mapping for Light Fantasy. (hex_usr, BearOso)
- Added Circuit USA APU timing hack. (BearOso)
- libretro: Merged some changes from downstream repository. (OV2)
- GTK+: Allow use of XDG config directory. (BearOso)
- GTK+: Add 10th save slot. (YamashitaRen)
- GTK+: Updated Spanish translation. (jristz)
- Win32: Switched to Studio 2017. (OV2)
- Win32: Fixed problems when minimized in d3d. (OV2)
- Win32: Split Patch/Rom directory. (OV2)
- Win32: Simplified compilation by removing or including
some dependencies (included CG headers, completely
removed FMOD and FMOD_EX, moved direct draw to compile
switch) and reworking solution/configurations. (bonimy, OV2)
- Win32: Fixed crash with movie dialog (OV2)
- Win32: Changed hotplugging (OV2)
Snes9x 1.54.1
- GTK+: Properly use --std=c++11 when compiling xBRZ. (BearOso)
- Win32: Save window position when toggling fullscreen. (OV2)
- Win32: Do not assign down-left binding to down-right. (OV2)
Snes9x 1.54
- Changed the S-SMP core module to one written by byuu. (byuu, BearOso)
This has the effect of increased accuracy, fewer
speed hacks, but also regresses a few speed-hack games.
- Improved IRQ emulation in several cases. (OV2)
- Added rewind support. (Themaister, OV2)
- Included libretro port. (OV2, libretro team)
- Added bps soft-patching support (OV2)
- Fixed MMC bank register bit 7, restored 64mbit ExLoRom
map (FuSoYa)
- GTK+, Windows: Added xBRZ filter (Zenju, OV2, nmagre)
- GTK+: Fixed several issues with GTK+3. (BearOso)
- GTK+: Added extra aspect ratio options. (BearOso)
- GTK+: Added option to mute sound when using turbo mode. (BearOso)
- GTK+: Fixed expose handling to reduce overdraw and (BearOso)
improve performance.
- GTK+: Updated and universalized Spanish translation. (jristz)
- Unix: Added Xv support and fixed several bugs. (greg-kennedy)
- Win32: Added CG meta shader support (OV2, Themaister)
- Win32: Added support to detect joypad changes (OV2)
- Win32: Fixed unicode command line parameters,
Fixed controller command line parameters (OV2)
- Win32: Added quit hotkey (OV2)
- Win32: Fixed custom rom dialog (OV2)
- Win32: Fixed various cheat dialog issues (gocha, OV2)
- Win32: Added hotkey for fast forward toggling (gocha)
- Win32: Added drag and drop support for movies (gocha)
- Win32: Fixed blargg filter for regular width hires (OV2)
- Win32: Fixed snapshot loading from unicode paths (OV2)
- Win32: Changed open-with file-association method, should
no longer change explorer icons for otherwise
unassociated extensions; removed legacy extensions (OV2)
Snes9x 1.53
- Rebuilt IRQ handling. (zones)
......
......@@ -367,12 +367,13 @@ void S9xStartScreenRefresh (void)
}
else
{
#ifdef USE_OPENGL
#ifdef USE_OPENGL
if (Settings.OpenGLEnable)
GFX.RealPPL = SNES_WIDTH;
else
#endif
#endif
GFX.RealPPL = GFX.Pitch >> 1;
IPPU.DoubleWidthPixels = FALSE;
IPPU.RenderedScreenWidth = SNES_WIDTH;
}
......@@ -680,7 +681,7 @@ void S9xUpdateScreen (void)
{
if (!IPPU.DoubleWidthPixels && (PPU.BGMode == 5 || PPU.BGMode == 6 || IPPU.PseudoHires))
{
#ifdef USE_OPENGL
#ifdef USE_OPENGL
if (Settings.OpenGLEnable && GFX.RealPPL == 256)
{
// Have to back out of the speed up hack where the low res.
......@@ -700,17 +701,15 @@ void S9xUpdateScreen (void)
GFX.PPL = GFX.RealPPL; // = GFX.Pitch >> 1 above
}
else
#endif
#endif
// Have to back out of the regular speed hack
for (register uint32 y = 0; y < GFX.StartY; y++)
{
// Have to back out of the regular speed hack
for (register uint32 y = 0; y < GFX.StartY; y++)
{
register uint16 *p = GFX.Screen + y * GFX.PPL + 255;
register uint16 *q = GFX.Screen + y * GFX.PPL + 510;
register uint16 *p = GFX.Screen + y * GFX.PPL + 255;
register uint16 *q = GFX.Screen + y * GFX.PPL + 510;
for (register int x = 255; x >= 0; x--, p--, q -= 2)
*q = *(q + 1) = *p;
}
for (register int x = 255; x >= 0; x--, p--, q -= 2)
*q = *(q + 1) = *p;
}
IPPU.DoubleWidthPixels = TRUE;
......@@ -1346,8 +1345,8 @@ static void DrawBackgroundMosaic (int bg, uint8 Zh, uint8 Zl)
for (uint32 Y = GFX.StartY - MosaicStart; Y <= GFX.EndY; Y += PPU.Mosaic)
{
uint32 Y2 = HiresInterlace ? Y * 2 : Y;
uint32 VOffset = LineData[Y].BG[bg].VOffset + (HiresInterlace ? 1 : 0);
uint32 HOffset = LineData[Y].BG[bg].HOffset;
uint32 VOffset = LineData[Y + MosaicStart].BG[bg].VOffset + (HiresInterlace ? 1 : 0);
uint32 HOffset = LineData[Y + MosaicStart].BG[bg].HOffset;
Lines = PPU.Mosaic - MosaicStart;
if (Y + MosaicStart + Lines > GFX.EndY)
......@@ -1754,8 +1753,8 @@ static void DrawBackgroundOffsetMosaic (int bg, uint8 Zh, uint8 Zl, int VOffOff)
for (uint32 Y = GFX.StartY - MosaicStart; Y <= GFX.EndY; Y += PPU.Mosaic)
{
uint32 Y2 = HiresInterlace ? Y * 2 : Y;
uint32 VOff = LineData[Y].BG[2].VOffset - 1;
uint32 HOff = LineData[Y].BG[2].HOffset;
uint32 VOff = LineData[Y + MosaicStart].BG[2].VOffset - 1;
uint32 HOff = LineData[Y + MosaicStart].BG[2].HOffset;
Lines = PPU.Mosaic - MosaicStart;
if (Y + MosaicStart + Lines > GFX.EndY)
......@@ -1784,7 +1783,7 @@ static void DrawBackgroundOffsetMosaic (int bg, uint8 Zh, uint8 Zl, int VOffOff)
uint32 Left = GFX.Clip[bg].Left[clip];
uint32 Right = GFX.Clip[bg].Right[clip];
uint32 Offset = Left * PixWidth + (Y + MosaicStart) * GFX.PPL;
uint32 HScroll = LineData[Y].BG[bg].HOffset;
uint32 HScroll = LineData[Y + MosaicStart].BG[bg].HOffset;
uint32 Width = Right - Left;
while (Left < Right)
......@@ -1794,7 +1793,7 @@ static void DrawBackgroundOffsetMosaic (int bg, uint8 Zh, uint8 Zl, int VOffOff)
if (Left < (8 - (HScroll & 7)))
{
// SNES cannot do OPT for leftmost tile column
VOffset = LineData[Y].BG[bg].VOffset;
VOffset = LineData[Y + MosaicStart].BG[bg].VOffset;
HOffset = HScroll;
}
else
......@@ -1835,7 +1834,7 @@ static void DrawBackgroundOffsetMosaic (int bg, uint8 Zh, uint8 Zl, int VOffOff)
if (VCellOffset & OffsetEnableMask)
VOffset = VCellOffset + 1;
else
VOffset = LineData[Y].BG[bg].VOffset;
VOffset = LineData[Y + MosaicStart].BG[bg].VOffset;
if (HCellOffset & OffsetEnableMask)
HOffset = (HCellOffset & ~7) | (HScroll & 7);
......
......@@ -484,7 +484,7 @@ void S9xSetPPU (uint8 Byte, uint16 Address)
case 0x2102: // OAMADDL
PPU.OAMAddr = ((Memory.FillRAM[0x2103] & 1) << 8) | Byte;
PPU.OAMFlip = 2;
PPU.OAMFlip = 0;
PPU.OAMReadFlip = 0;
PPU.SavedOAMAddr = PPU.OAMAddr;
if (PPU.OAMPriorityRotation && PPU.FirstSprite != (PPU.OAMAddr >> 1))
......@@ -545,7 +545,10 @@ void S9xSetPPU (uint8 Byte, uint16 Address)
PPU.BGMode = Byte & 7;
// BJ: BG3Priority only takes effect if BGMode == 1 and the bit is set
PPU.BG3Priority = ((Byte & 0x0f) == 0x09);
IPPU.Interlace = Memory.FillRAM[0x2133] & 1;
if (PPU.BGMode == 6 || PPU.BGMode == 5 || PPU.BGMode == 7)
IPPU.Interlace = Memory.FillRAM[0x2133] & 1;
else
IPPU.Interlace = 0;
#ifdef DEBUGGER
missing.modes[PPU.BGMode] = 1;
#endif
......@@ -1067,6 +1070,7 @@ void S9xSetPPU (uint8 Byte, uint16 Address)
FLUSH_REDRAW();
if ((Memory.FillRAM[0x2133] ^ Byte) & 2)
IPPU.OBJChanged = TRUE;
IPPU.Interlace = Byte & 1;
IPPU.InterlaceOBJ = Byte & 2;
}
......@@ -2101,4 +2105,5 @@ void S9xSoftResetPPU (void)
memset(&Memory.FillRAM[0x1000], 0, 0x1000);
Memory.FillRAM[0x4201] = Memory.FillRAM[0x4213] = 0xff;
Memory.FillRAM[0x2126] = Memory.FillRAM[0x2128] = 1;
}
......@@ -420,6 +420,12 @@ static inline void FLUSH_REDRAW (void)
static inline void REGISTER_2104 (uint8 Byte)
{
if (!(PPU.OAMFlip & 1))
{
PPU.OAMWriteRegister &= 0xff00;
PPU.OAMWriteRegister |= Byte;
}
if (PPU.OAMAddr & 0x100)
{
int addr = ((PPU.OAMAddr & 0x10f) << 1) + (PPU.OAMFlip & 1);
......@@ -441,33 +447,8 @@ static inline void REGISTER_2104 (uint8 Byte)
pObj->Size = Byte & 128;
}
PPU.OAMFlip ^= 1;
if (!(PPU.OAMFlip & 1))
{
++PPU.OAMAddr;
PPU.OAMAddr &= 0x1ff;
if (PPU.OAMPriorityRotation && PPU.FirstSprite != (PPU.OAMAddr >> 1))
{
PPU.FirstSprite = (PPU.OAMAddr & 0xfe) >> 1;
IPPU.OBJChanged = TRUE;
}
}
else
{
if (PPU.OAMPriorityRotation && (PPU.OAMAddr & 1))
IPPU.OBJChanged = TRUE;
}
}
else
if (!(PPU.OAMFlip & 1))
{
PPU.OAMWriteRegister &= 0xff00;
PPU.OAMWriteRegister |= Byte;
PPU.OAMFlip |= 1;
if (PPU.OAMPriorityRotation && (PPU.OAMAddr & 1))
IPPU.OBJChanged = TRUE;
}
else
else if (PPU.OAMFlip & 1)
{
PPU.OAMWriteRegister &= 0x00ff;
uint8 lowbyte = (uint8) (PPU.OAMWriteRegister);
......@@ -500,15 +481,24 @@ static inline void REGISTER_2104 (uint8 Byte)
PPU.OBJ[addr].VPos = highbyte;
}
}
}
PPU.OAMFlip &= ~1;
PPU.OAMFlip ^= 1;
if (!(PPU.OAMFlip & 1))
{
++PPU.OAMAddr;
PPU.OAMAddr &= 0x1ff;
if (PPU.OAMPriorityRotation && PPU.FirstSprite != (PPU.OAMAddr >> 1))
{
PPU.FirstSprite = (PPU.OAMAddr & 0xfe) >> 1;
IPPU.OBJChanged = TRUE;
}
}
else
{
if (PPU.OAMPriorityRotation && (PPU.OAMAddr & 1))
IPPU.OBJChanged = TRUE;
}
}
// This code is correct, however due to Snes9x's inaccurate timings, some games might be broken by this chage. :(
......
This diff is collapsed.
......@@ -498,7 +498,7 @@ void SPC7110Decomp::reset() {
}
SPC7110Decomp::SPC7110Decomp() {
decomp_buffer = new uint8_t[decomp_buffer_size];
decomp_buffer = new uint8[decomp_buffer_size];
reset();
//initialize reverse morton lookup tables
......
Markdown is supported
0% or .