fixed the option to disable the aiming crosshair, fixed support for

128kb backup files (thanks Tanooki16!)
This commit is contained in:
Daryl Borth 2021-09-02 10:04:28 -06:00
parent 5bff07b305
commit 8aa8e4ce74
2 changed files with 25 additions and 5 deletions

View File

@ -24,6 +24,10 @@
#include "netplay.h" #include "netplay.h"
#endif #endif
#ifdef GEKKO
#include "snes9xgx.h"
#endif
using namespace std; using namespace std;
#define NONE (-2) #define NONE (-2)
@ -3202,6 +3206,9 @@ void S9xControlEOF (void)
DoGunLatch(superscope.x, superscope.y); DoGunLatch(superscope.x, superscope.y);
c = &superscope.crosshair; c = &superscope.crosshair;
#ifdef GEKKO
if(GCSettings.crosshair)
#endif
if (IPPU.RenderThisFrame) if (IPPU.RenderThisFrame)
S9xDrawCrosshair(S9xGetCrosshair(c->img), c->fg, c->bg, superscope.x, superscope.y); S9xDrawCrosshair(S9xGetCrosshair(c->img), c->fg, c->bg, superscope.x, superscope.y);
} }
@ -3212,6 +3219,9 @@ void S9xControlEOF (void)
if (n == 1 && !justifier.offscreen[1]) if (n == 1 && !justifier.offscreen[1])
{ {
c = &justifier.crosshair[1]; c = &justifier.crosshair[1];
#ifdef GEKKO
if(GCSettings.crosshair)
#endif
if (IPPU.RenderThisFrame) if (IPPU.RenderThisFrame)
S9xDrawCrosshair(S9xGetCrosshair(c->img), c->fg, c->bg, justifier.x[1], justifier.y[1]); S9xDrawCrosshair(S9xGetCrosshair(c->img), c->fg, c->bg, justifier.x[1], justifier.y[1]);
} }
@ -3231,6 +3241,9 @@ void S9xControlEOF (void)
if (!justifier.offscreen[0]) if (!justifier.offscreen[0])
{ {
c = &justifier.crosshair[0]; c = &justifier.crosshair[0];
#ifdef GEKKO
if(GCSettings.crosshair)
#endif
if (IPPU.RenderThisFrame) if (IPPU.RenderThisFrame)
S9xDrawCrosshair(S9xGetCrosshair(c->img), c->fg, c->bg, justifier.x[0], justifier.y[0]); S9xDrawCrosshair(S9xGetCrosshair(c->img), c->fg, c->bg, justifier.x[0], justifier.y[0]);
} }

View File

@ -24,6 +24,9 @@
#include "snes9x/memmap.h" #include "snes9x/memmap.h"
#include "snes9x/srtc.h" #include "snes9x/srtc.h"
bool HiROM;
bool LoROM;
/**************************************************************************** /****************************************************************************
* Load SRAM * Load SRAM
***************************************************************************/ ***************************************************************************/
@ -41,12 +44,14 @@ LoadSRAM (char * filepath, bool silent)
int size = Memory.SRAMSize ? (1 << (Memory.SRAMSize + 3)) * 128 : 0; int size = Memory.SRAMSize ? (1 << (Memory.SRAMSize + 3)) * 128 : 0;
if (size > 0x20000) if (LoROM)
size = 0x20000; size = size < 0x70000 ? size : 0x70000;
else if (HiROM)
size = size < 0x40000 ? size : 0x40000;
if (size) if (size)
{ {
len = LoadFile((char *)Memory.SRAM, filepath, 0, 0x20000, silent); len = LoadFile((char *)Memory.SRAM, filepath, 0, size, silent);
if (len > 0) if (len > 0)
{ {
@ -120,8 +125,10 @@ SaveSRAM (char * filepath, bool silent)
// determine SRAM size // determine SRAM size
int size = Memory.SRAMSize ? (1 << (Memory.SRAMSize + 3)) * 128 : 0; int size = Memory.SRAMSize ? (1 << (Memory.SRAMSize + 3)) * 128 : 0;
if (size > 0x20000) if (LoROM)
size = 0x20000; size = size < 0x70000 ? size : 0x70000;
else if (HiROM)
size = size < 0x40000 ? size : 0x40000;
if (size > 0) if (size > 0)
{ {