aboutsummaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorDwedit2018-03-30 22:35:35 -0500
committerDwedit2018-03-30 22:35:35 -0500
commitf453201fa149d3e2a85f0b466b1c67c6c90d54e0 (patch)
treed1c97fb8954fc210e09f35cbb2738720ea47aa1f /source
parent8ca47fd3e698aa0ccc63bb62784818d243cf3643 (diff)
downloadsnes9x2005-f453201fa149d3e2a85f0b466b1c67c6c90d54e0.tar.gz
snes9x2005-f453201fa149d3e2a85f0b466b1c67c6c90d54e0.tar.bz2
snes9x2005-f453201fa149d3e2a85f0b466b1c67c6c90d54e0.zip
Add support for Audio/Video Disable flags
Add support for Hard Disable Audio Fix frame discarding causing infinite loops Fix MSVC building
Diffstat (limited to 'source')
-rw-r--r--source/apu_blargg.c8
-rw-r--r--source/gfx.c4
-rw-r--r--source/memmap.c5
-rw-r--r--source/snes9x.h1
4 files changed, 15 insertions, 3 deletions
diff --git a/source/apu_blargg.c b/source/apu_blargg.c
index 49f5491..2976580 100644
--- a/source/apu_blargg.c
+++ b/source/apu_blargg.c
@@ -761,7 +761,8 @@ V(V9_V6_V3,2) -> V(V9,2) V(V6,3) V(V3,4) */
static void dsp_run( int32_t clocks_remain )
{
int32_t phase;
-
+ if (Settings.HardDisableAudio)
+ return;
phase = dsp_m.phase;
dsp_m.phase = (phase + clocks_remain) & 31;
@@ -3259,6 +3260,11 @@ static int8_t const reg_times_ [256] =
29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
};
+void S9xSetSoundMute(bool mute)
+{
+ Settings.Mute = mute;
+}
+
bool S9xInitAPU()
{
int32_t i;
diff --git a/source/gfx.c b/source/gfx.c
index 1b9928d..a43ef35 100644
--- a/source/gfx.c
+++ b/source/gfx.c
@@ -478,10 +478,10 @@ void S9xEndScreenRefresh(void)
GFX.Pitch = GFX.Pitch2 = GFX.RealPitch;
GFX.PPL = GFX.PPLx2 >> 1;
+ }
#ifdef LAGFIX
- finishedFrame = true;
+ finishedFrame = true;
#endif
- }
S9xApplyCheats();
diff --git a/source/memmap.c b/source/memmap.c
index d5c29b1..4f76fc8 100644
--- a/source/memmap.c
+++ b/source/memmap.c
@@ -24,6 +24,11 @@
#include <malloc.h>
#endif
+#ifdef _MSC_VER
+/* Necessary to build on MSVC */
+#define strnicmp _strnicmp
+#endif
+
#define MAP_HIROM_SRAM_OR_NONE (Memory.SRAMSize == 0 ? (uint8_t*) MAP_NONE : (uint8_t*) MAP_HIROM_SRAM)
#define MAP_LOROM_SRAM_OR_NONE (Memory.SRAMSize == 0 ? (uint8_t*) MAP_NONE : (uint8_t*) MAP_LOROM_SRAM)
#define MAP_RONLY_SRAM_OR_NONE (Memory.SRAMSize == 0 ? (uint8_t*) MAP_NONE : (uint8_t*) MAP_RONLY_SRAM)
diff --git a/source/snes9x.h b/source/snes9x.h
index 11dc1ff..ad410e1 100644
--- a/source/snes9x.h
+++ b/source/snes9x.h
@@ -214,6 +214,7 @@ typedef struct
bool Justifier;
bool SecondJustifier;
int8_t SETA;
+ bool HardDisableAudio;
} SSettings;
extern SSettings Settings;