From c007afe6fd51827fade7aa15a0a798be8bd97839 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 28 Dec 2018 00:32:13 +0100 Subject: Start significantly refactoring this codebase so we can get it to work with MSVC --- libretro/libretro.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'libretro') diff --git a/libretro/libretro.c b/libretro/libretro.c index 2fb8df5..f838ad6 100644 --- a/libretro/libretro.c +++ b/libretro/libretro.c @@ -261,6 +261,8 @@ void retro_get_system_av_info(struct retro_system_av_info *info) static void snes_init (void) { + const int safety = 128; + memset(&Settings, 0, sizeof(Settings)); Settings.JoystickEnabled = FALSE; Settings.SoundPlaybackRate = samplerate; @@ -317,7 +319,6 @@ static void snes_init (void) GFX.Pitch = use_overscan ? 1024 : 2048; - const int safety = 128; // hack to make sure GFX.Delta is always (2048 * 512 * 2) >> 1, needed for tile16_t.h #ifdef _3DS GFX.Screen_buffer = (uint8 *) linearMemAlign(2048 * 512 * 2 * 2 + safety, 0x80); @@ -519,6 +520,8 @@ void retro_cheat_reset(void) void retro_cheat_set(unsigned index, bool enable, const char* in_code) { + uint32 address; + uint8 byte; // clean input char clean_code[strlen(in_code)]; int j =0; @@ -546,8 +549,6 @@ void retro_cheat_set(unsigned index, bool enable, const char* in_code) } } clean_code[j]=0; - uint32 address; - uint8 byte; if ( S9xProActionReplayToRaw(clean_code, &address, &byte) == NULL) S9xAddCheat(true, true, address, byte); @@ -662,14 +663,10 @@ bool8 S9xReadMousePosition (int which1_0_to_1, int* x, int* y, uint32* buttons) bool8 S9xReadSuperScopePosition (int* x, int* y, uint32* buttons) { return FALSE; } bool JustifierOffscreen() { return false; } -START_EXTERN_C - void S9xToggleSoundChannel (int channel) {} const char *S9xStringInput(const char *message) { return NULL; } -END_EXTERN_C - //void Write16(uint16 v, uint8*& ptr) {} //uint16 Read16(const uint8*& ptr) { return 0; } -- cgit v1.2.3