From f518934e3b664d0cf9535a391d6572300958d3bf Mon Sep 17 00:00:00 2001 From: aliaspider Date: Tue, 28 Oct 2014 22:45:14 +0100 Subject: cleanups (cont.) --- Makefile | 3 +- libretro.cpp | 63 +----------- source/getset.h | 15 --- source/gfx.cpp | 16 --- source/globals.cpp | 11 -- source/netplay.h | 285 ---------------------------------------------------- source/ppu.cpp | 272 ++----------------------------------------------- source/sa1.cpp | 4 +- source/sfc.mk | 83 --------------- source/snaporig.cpp | 11 +- source/snapshot.cpp | 7 -- source/snes9x.h | 31 +----- source/soundux.cpp | 49 --------- source/soundux.h | 14 +-- source/spc7110.cpp | 3 - 15 files changed, 20 insertions(+), 847 deletions(-) delete mode 100644 source/netplay.h delete mode 100644 source/sfc.mk diff --git a/Makefile b/Makefile index b6ecbe6..43af188 100644 --- a/Makefile +++ b/Makefile @@ -77,8 +77,7 @@ OBJECTS = $(C_OBJECTS) $(CPP_OBJECTS) DEFS += -DSPC700_C -DEXECUTE_SUPERFX_PER_LINE -DSDD1_DECOMP \ -DVAR_CYCLES -DCPU_SHUTDOWN -DSPC700_SHUTDOWN \ -DNO_INLINE_SET_GET -DNOASM -DHAVE_MKSTEMP '-DACCEPT_SIZE_T=size_t' \ - -DFOREVER_16_BIT_SOUND -DFOREVER_STEREO \ - -DFOREVER_FORWARD_STEREO -DNO_VOLATILE_SOUND + -DFOREVER_16_BIT_SOUND -DFOREVER_STEREO ifeq ($(DEBUG), 1) OPTIMIZE := -O0 -g diff --git a/libretro.cpp b/libretro.cpp index 341ce38..0b70312 100644 --- a/libretro.cpp +++ b/libretro.cpp @@ -176,11 +176,6 @@ void S9xExit () // Memory.Deinit (); // S9xDeinitAPU (); -//#ifdef _NETPLAY_SUPPORT -// if (Settings.NetPlay) -// S9xNetPlayDisconnect (); -//#endif - // exit(0); } @@ -402,9 +397,6 @@ void init_sfc_setting(void) #endif Settings.SoundPlaybackRate = 44100; // -> ds2sound.h for defs -#ifndef FOREVER_STEREO - Settings.Stereo = TRUE; -#endif Settings.SoundBufferSize = 512; Settings.CyclesPercentage = 100; Settings.DisableSoundEcho = FALSE; @@ -424,25 +416,10 @@ void init_sfc_setting(void) Settings.ControllerOption = SNES_JOYPAD; Settings.Transparency = TRUE; -#ifndef FOREVER_16_BIT - Settings.SixteenBit = TRUE; -#endif -#ifndef FOREVER_16_BIT_SOUND - Settings.SixteenBitSound = TRUE; -#endif - Settings.SupportHiRes = FALSE; Settings.ThreadSound = FALSE; - Settings.SoundSync = TRUE; - Settings.AutoSaveDelay = 0; -#ifdef _NETPLAY_SUPPORT - Settings.NetPlay = FALSE; - Settings.ServerName [0] = 0; - Settings.Port = NP_DEFAULT_PORT; -#endif + Settings.SoundSync = TRUE; Settings.ApplyCheats = TRUE; - Settings.TurboMode = FALSE; - Settings.TurboSkipFrames = 10; Settings.StretchScreenshots = 1; Settings.HBlankStart = (256 * Settings.H_Max) / SNES_HCOUNTER_MAX; @@ -497,40 +474,6 @@ int load_gamepak(const char* file) // mdelay(50); // Delete this delay S9xLoadCheatFile (S9xGetFilename (".chb")); // cheat binary file, as opposed to text -#ifdef _NETPLAY_SUPPORT - if (strlen (Settings.ServerName) == 0) - { - char *server = getenv ("S9XSERVER"); - if (server) - { - strncpy (Settings.ServerName, server, 127); - Settings.ServerName [127] = 0; - } - } - char *port = getenv ("S9XPORT"); - if (Settings.Port >= 0 && port) - Settings.Port = atoi (port); - else if (Settings.Port < 0) - Settings.Port = -Settings.Port; - - if (Settings.NetPlay) - { - int player; - - if (!S9xNetPlayConnectToServer (Settings.ServerName, Settings.Port, - Memory.ROMName, player)) - { - fprintf (stderr, "Failed to connected to Snes9x netplay" - " server \"%s\" on port %d.\n", - Settings.ServerName, Settings.Port); - S9xExit (); - } - fprintf (stderr, "Connected to \"%s\" on port %d as" - " player #%d playing \"%s\"\n", - Settings.ServerName, Settings.Port, player, Memory.ROMName); - } - -#endif /* if (snapshot_filename) { @@ -572,11 +515,7 @@ void retro_init (void) OutOfMemory (); S9xInitSound (Settings.SoundPlaybackRate, -#ifndef FOREVER_STEREO - Settings.Stereo, -#else TRUE, -#endif Settings.SoundBufferSize); #ifdef GFX_MULTI_FORMAT // S9xSetRenderPixelFormat (RGB565); diff --git a/source/getset.h b/source/getset.h index 71f54c7..189991b 100644 --- a/source/getset.h +++ b/source/getset.h @@ -412,9 +412,6 @@ void S9xSetByte (uint8 Byte, uint32 Address) MessageBox(GUI.hWnd, address, TEXT("SetByte"), MB_OK); #endif -#ifdef DEBUGGER - printf ("W(B) %06x\n", Address); -#endif return; } } @@ -525,9 +522,6 @@ void S9xSetWord (uint16 Word, uint32 Address) return; case CMemory::MAP_DEBUG: -#ifdef DEBUGGER - printf ("W(W) %06x\n", Address); -#endif case CMemory::MAP_SPC7110_DRAM: #ifdef SPC7110_DEBUG @@ -570,9 +564,6 @@ void S9xSetWord (uint16 Word, uint32 Address) MessageBox(GUI.hWnd, address, TEXT("SetWord"), MB_OK); #endif -#ifdef DEBUGGER - printf ("W(W) %06x\n", Address); -#endif return; } } @@ -624,9 +615,6 @@ uint8 *GetBasePointer (uint32 Address) case CMemory::MAP_SETA_DSP: return Memory.SRAM; case CMemory::MAP_DEBUG: -#ifdef DEBUGGER - printf ("GBP %06x\n", Address); -#endif default: case CMemory::MAP_NONE: @@ -636,9 +624,6 @@ uint8 *GetBasePointer (uint32 Address) MessageBox(GUI.hWnd, fsd, TEXT("Rogue DMA"), MB_OK); #endif -#ifdef DEBUGGER - printf ("GBP %06x\n", Address); -#endif return (0); } } diff --git a/source/gfx.cpp b/source/gfx.cpp index e9e2e7f..0936430 100644 --- a/source/gfx.cpp +++ b/source/gfx.cpp @@ -839,22 +839,6 @@ void S9xEndScreenRefresh () } S9xApplyCheats (); -#ifdef DEBUGGER - if (CPU.Flags & FRAME_ADVANCE_FLAG) - { - if (ICPU.FrameAdvanceCount) - { - ICPU.FrameAdvanceCount--; - IPPU.RenderThisFrame = TRUE; - IPPU.FrameSkip = 0; - } - else - { - CPU.Flags &= ~FRAME_ADVANCE_FLAG; - CPU.Flags |= DEBUG_MODE_FLAG; - } - } -#endif if (CPU.SRAMModified) { diff --git a/source/globals.cpp b/source/globals.cpp index 8ff0c6b..d4476af 100644 --- a/source/globals.cpp +++ b/source/globals.cpp @@ -100,7 +100,6 @@ #include "soundux.h" #include "cheats.h" #include "sa1.h" -#include "netplay.h" #include "spc7110.h" START_EXTERN_C @@ -215,14 +214,7 @@ uint32 current_graphic_format = RGB565; struct SCheatData Cheat; -// Define NO_VOLATILE_SOUND if you're always reading or writing sound from one -// thread or one co-routine. If you're using interrupts or a thread, sound must -// be volatile. -#ifndef NO_VOLATILE_SOUND -volatile SoundStatus so; -#else SoundStatus so; -#endif int Echo [24000]; int DummyEchoBuffer [SOUND_BUFFER_SIZE]; @@ -341,9 +333,6 @@ uint8 APUROM [64] = 0xF4,0xC4,0xF4,0xDD,0x5D,0xD0,0xDB,0x1F,0x00,0x00,0xC0,0xFF }; -#ifdef NETPLAY_SUPPORT -struct SNetPlay NetPlay; -#endif // Raw SPC700 instruction cycle lengths uint16 S9xAPUCycleLengths [256] = diff --git a/source/netplay.h b/source/netplay.h deleted file mode 100644 index fe7c66a..0000000 --- a/source/netplay.h +++ /dev/null @@ -1,285 +0,0 @@ -/******************************************************************************* - Snes9x - Portable Super Nintendo Entertainment System (TM) emulator. - - (c) Copyright 1996 - 2002 Gary Henderson (gary.henderson@ntlworld.com) and - Jerremy Koot (jkoot@snes9x.com) - - (c) Copyright 2001 - 2004 John Weidman (jweidman@slip.net) - - (c) Copyright 2002 - 2004 Brad Jorsch (anomie@users.sourceforge.net), - funkyass (funkyass@spam.shaw.ca), - Joel Yliluoma (http://iki.fi/bisqwit/) - Kris Bleakley (codeviolation@hotmail.com), - Matthew Kendora, - Nach (n-a-c-h@users.sourceforge.net), - Peter Bortas (peter@bortas.org) and - zones (kasumitokoduck@yahoo.com) - - C4 x86 assembler and some C emulation code - (c) Copyright 2000 - 2003 zsKnight (zsknight@zsnes.com), - _Demo_ (_demo_@zsnes.com), and Nach - - C4 C++ code - (c) Copyright 2003 Brad Jorsch - - DSP-1 emulator code - (c) Copyright 1998 - 2004 Ivar (ivar@snes9x.com), _Demo_, Gary Henderson, - John Weidman, neviksti (neviksti@hotmail.com), - Kris Bleakley, Andreas Naive - - DSP-2 emulator code - (c) Copyright 2003 Kris Bleakley, John Weidman, neviksti, Matthew Kendora, and - Lord Nightmare (lord_nightmare@users.sourceforge.net - - OBC1 emulator code - (c) Copyright 2001 - 2004 zsKnight, pagefault (pagefault@zsnes.com) and - Kris Bleakley - Ported from x86 assembler to C by sanmaiwashi - - SPC7110 and RTC C++ emulator code - (c) Copyright 2002 Matthew Kendora with research by - zsKnight, John Weidman, and Dark Force - - S-DD1 C emulator code - (c) Copyright 2003 Brad Jorsch with research by - Andreas Naive and John Weidman - - S-RTC C emulator code - (c) Copyright 2001 John Weidman - - ST010 C++ emulator code - (c) Copyright 2003 Feather, Kris Bleakley, John Weidman and Matthew Kendora - - Super FX x86 assembler emulator code - (c) Copyright 1998 - 2003 zsKnight, _Demo_, and pagefault - - Super FX C emulator code - (c) Copyright 1997 - 1999 Ivar, Gary Henderson and John Weidman - - - SH assembler code partly based on x86 assembler code - (c) Copyright 2002 - 2004 Marcus Comstedt (marcus@mc.pp.se) - - - Specific ports contains the works of other authors. See headers in - individual files. - - Snes9x homepage: http://www.snes9x.com - - Permission to use, copy, modify and distribute Snes9x in both binary and - source form, for non-commercial purposes, is hereby granted without fee, - providing that this license information and copyright notice appear with - all copies and any derived work. - - This software is provided 'as-is', without any express or implied - warranty. In no event shall the authors be held liable for any damages - arising from the use of this software. - - Snes9x is freeware for PERSONAL USE only. Commercial users should - seek permission of the copyright holders first. Commercial use includes - charging money for Snes9x or software derived from Snes9x. - - The copyright holders request that bug fixes and improvements to the code - should be forwarded to them so everyone can benefit from the modifications - in future versions. - - Super NES and Super Nintendo Entertainment System are trademarks of - Nintendo Co., Limited and its subsidiary companies. -*******************************************************************************/ - -#ifndef _NETPLAY_H_ -#define _NETPLAY_H_ - -/* - * Client to server joypad update - * - * magic 1 - * sequence_no 1 - * opcode 1 - * joypad data 4 - * - * Server to client joypad update - * magic 1 - * sequence_no 1 - * opcode 1 + num joypads (top 3 bits) - * joypad data 4 * n - */ - -//#define NP_DEBUG 1 - -#define NP_VERSION 10 -#define NP_JOYPAD_HIST_SIZE 120 -#define NP_DEFAULT_PORT 6096 - -#define NP_MAX_CLIENTS 5 - -#define NP_SERV_MAGIC 'S' -#define NP_CLNT_MAGIC 'C' - -#define NP_CLNT_HELLO 0 -#define NP_CLNT_JOYPAD 1 -#define NP_CLNT_RESET 2 -#define NP_CLNT_PAUSE 3 -#define NP_CLNT_LOAD_ROM 4 -#define NP_CLNT_ROM_IMAGE 5 -#define NP_CLNT_FREEZE_FILE 6 -#define NP_CLNT_SRAM_DATA 7 -#define NP_CLNT_READY 8 -#define NP_CLNT_LOADED_ROM 9 -#define NP_CLNT_RECEIVED_ROM_IMAGE 10 -#define NP_CLNT_WAITING_FOR_ROM_IMAGE 11 - -#define NP_SERV_HELLO 0 -#define NP_SERV_JOYPAD 1 -#define NP_SERV_RESET 2 -#define NP_SERV_PAUSE 3 -#define NP_SERV_LOAD_ROM 4 -#define NP_SERV_ROM_IMAGE 5 -#define NP_SERV_FREEZE_FILE 6 -#define NP_SERV_SRAM_DATA 7 -#define NP_SERV_READY 8 - -struct SNPClient -{ - volatile uint8 SendSequenceNum; - volatile uint8 ReceiveSequenceNum; - volatile bool8 Connected; - volatile bool8 SaidHello; - volatile bool8 Paused; - volatile bool8 Ready; - int Socket; - char *ROMName; - char *HostName; - char *Who; -}; - -enum { - NP_SERVER_SEND_ROM_IMAGE, - NP_SERVER_SYNC_ALL, - NP_SERVER_SYNC_CLIENT, - NP_SERVER_SEND_FREEZE_FILE_ALL, - NP_SERVER_SEND_ROM_LOAD_REQUEST_ALL, - NP_SERVER_RESET_ALL, - NP_SERVER_SEND_SRAM_ALL, - NP_SERVER_SEND_SRAM -}; - -#define NP_MAX_TASKS 20 - -struct NPServerTask -{ - uint32 Task; - void *Data; -}; - -struct SNPServer -{ - struct SNPClient Clients [NP_MAX_CLIENTS]; - int NumClients; - volatile struct NPServerTask TaskQueue [NP_MAX_TASKS]; - volatile uint32 TaskHead; - volatile uint32 TaskTail; - int Socket; - uint32 FrameTime; - uint32 FrameCount; - char ROMName [30]; - uint32 Joypads [5]; - bool8 ClientPaused; - uint32 Paused; - bool8 SendROMImageOnConnect; - bool8 SyncByReset; -}; - -#define NP_MAX_ACTION_LEN 200 - -struct SNetPlay -{ - volatile uint8 MySequenceNum; - volatile uint8 ServerSequenceNum; - volatile bool8 Connected; - volatile bool8 Abort; - volatile uint8 Player; - volatile bool8 ClientsReady [NP_MAX_CLIENTS]; - volatile bool8 ClientsPaused [NP_MAX_CLIENTS]; - volatile bool8 Paused; - volatile bool8 PendingWait4Sync; - volatile uint8 PercentageComplete; - volatile bool8 Waiting4EmulationThread; - volatile bool8 Answer; -#ifdef __WIN32__ - HANDLE ReplyEvent; -#endif - volatile int Socket; - char *ServerHostName; - char *ROMName; - int Port; - volatile uint32 JoypadWriteInd; - volatile uint32 JoypadReadInd; - uint32 Joypads [NP_JOYPAD_HIST_SIZE][NP_MAX_CLIENTS]; - uint32 Frame [NP_JOYPAD_HIST_SIZE]; - uint32 FrameCount; - uint32 MaxFrameSkip; - uint32 MaxBehindFrameCount; - char ActionMsg [NP_MAX_ACTION_LEN]; - char ErrorMsg [NP_MAX_ACTION_LEN]; - char WarningMsg [NP_MAX_ACTION_LEN]; -}; - -extern "C" struct SNetPlay NetPlay; - -// -// NETPLAY_CLIENT_HELLO message format: -// header -// frame_time (4) -// ROMName (variable) - -#define WRITE_LONG(p, v) { \ -*((p) + 0) = (uint8) ((v) >> 24); \ -*((p) + 1) = (uint8) ((v) >> 16); \ -*((p) + 2) = (uint8) ((v) >> 8); \ -*((p) + 3) = (uint8) ((v) >> 0); \ -} - -#define READ_LONG(p) \ -((((uint8) *((p) + 0)) << 24) | \ - (((uint8) *((p) + 1)) << 16) | \ - (((uint8) *((p) + 2)) << 8) | \ - (((uint8) *((p) + 3)) << 0)) - -bool8 S9xNPConnectToServer (const char *server_name, int port, - const char *rom_name); -bool8 S9xNPWaitForHeartBeat (); -uint32 S9xNPGetJoypad (int which1); -bool8 S9xNPSendJoypadUpdate (uint32 joypad); -void S9xNPDisconnect (); -bool8 S9xNPInitialise (); -bool8 S9xNPSendData (int fd, const uint8 *data, int len); -bool8 S9xNPGetData (int fd, uint8 *data, int len); - -void S9xNPSyncClients (); -void S9xNPStepJoypadHistory (); - -void S9xNPResetJoypadReadPos (); -bool8 S9xNPSendReady (uint8 op = NP_CLNT_READY); -bool8 S9xNPSendPause (bool8 pause); -void S9xNPReset (); -void S9xNPSetAction (const char *action, bool8 force = FALSE); -void S9xNPSetError (const char *error); -void S9xNPSetWarning (const char *warning); -void S9xNPDiscardHeartbeats (); -void S9xNPServerQueueSendingFreezeFile (const char *filename); -void S9xNPServerQueueSyncAll (); -void S9xNPServerQueueSendingROMImage (); -void S9xNPServerQueueSendingLoadROMRequest (const char *filename); - -void S9xNPServerAddTask (uint32 task, void *data); - -bool8 S9xNPStartServer (int port); -void S9xNPStopServer (); -#ifdef __WIN32__ -#define S9xGetMilliTime timeGetTime -#else -uint32 S9xGetMilliTime (); -#endif -#endif - diff --git a/source/ppu.cpp b/source/ppu.cpp index 3efc28a..f5d793f 100644 --- a/source/ppu.cpp +++ b/source/ppu.cpp @@ -97,7 +97,6 @@ #include "gfx.h" #include "display.h" #include "sa1.h" -#include "netplay.h" #include "sdd1.h" #include "srtc.h" #include "spc7110.h" @@ -120,10 +119,6 @@ void S9xLatchCounters (bool force) { if(!force && !(Memory.FillRAM[0x4213] & 0x80)) return; - // Latch h and v counters, like the gun -#ifdef DEBUGGER - missing.h_v_latch = 1; -#endif #if 0 # ifdef CPU_SHUTDOWN CPU.WaitAddress = CPU.PCAtOpcodeStart; @@ -145,9 +140,6 @@ void S9xUpdateHTimer () { if (PPU.HTimerEnabled) { -#ifdef DEBUGGER - missing.hirq_pos = PPU.IRQHBeamPos; -#endif PPU.HTimerPosition = PPU.IRQHBeamPos * Settings.H_Max / SNES_HCOUNTER_MAX; if (PPU.HTimerPosition == Settings.H_Max || PPU.HTimerPosition == Settings.HBlankStart) @@ -202,22 +194,15 @@ void S9xUpdateHTimer () void S9xFixColourBrightness () { - IPPU.XB = mul_brightness [PPU.Brightness]; -#ifndef FOREVER_16_BIT - if (Settings.SixteenBit) - { -#endif - for (int i = 0; i < 256; i++) - { - IPPU.Red [i] = IPPU.XB [PPU.CGDATA [i] & 0x1f]; - IPPU.Green [i] = IPPU.XB [(PPU.CGDATA [i] >> 5) & 0x1f]; - IPPU.Blue [i] = IPPU.XB [(PPU.CGDATA [i] >> 10) & 0x1f]; - IPPU.ScreenColors [i] = BUILD_PIXEL (IPPU.Red [i], IPPU.Green [i], - IPPU.Blue [i]); - } -#ifndef FOREVER_16_BIT - } -#endif + IPPU.XB = mul_brightness [PPU.Brightness]; + for (int i = 0; i < 256; i++) + { + IPPU.Red [i] = IPPU.XB [PPU.CGDATA [i] & 0x1f]; + IPPU.Green [i] = IPPU.XB [(PPU.CGDATA [i] >> 5) & 0x1f]; + IPPU.Blue [i] = IPPU.XB [(PPU.CGDATA [i] >> 10) & 0x1f]; + IPPU.ScreenColors [i] = BUILD_PIXEL (IPPU.Red [i], IPPU.Green [i], + IPPU.Blue [i]); + } } /******************************************************************************/ @@ -275,9 +260,6 @@ void S9xSetPPU (uint8 Byte, uint16 Address) { PPU.FirstSprite = (PPU.OAMAddr&0xFE) >> 1; IPPU.OBJChanged = TRUE; -#ifdef DEBUGGER - missing.sprite_priority_rotation = 1; -#endif } break; @@ -293,18 +275,12 @@ void S9xSetPPU (uint8 Byte, uint16 Address) { PPU.FirstSprite = (PPU.OAMAddr&0xFE) >> 1; IPPU.OBJChanged = TRUE; -#ifdef DEBUGGER - missing.sprite_priority_rotation = 1; -#endif } } else { if (PPU.FirstSprite != 0) { PPU.FirstSprite = 0; IPPU.OBJChanged = TRUE; -#ifdef DEBUGGER - missing.sprite_priority_rotation = 1; -#endif } } PPU.OAMFlip = 0; @@ -330,9 +306,6 @@ 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); -#ifdef DEBUGGER - missing.modes[PPU.BGMode] = 1; -#endif if(PPU.BGMode==5||PPU.BGMode==6) IPPU.Interlace = Memory.FillRAM[0x2133]&1; } @@ -343,10 +316,6 @@ void S9xSetPPU (uint8 Byte, uint16 Address) if (Byte != Memory.FillRAM [0x2106]) { FLUSH_REDRAW (); -#ifdef DEBUGGER - if ((Byte & 0xf0) && (Byte & 0x0f)) - missing.mosaic = 1; -#endif PPU.Mosaic = (Byte >> 4) + 1; PPU.BGMosaic [0] = (Byte & 1) && PPU.Mosaic > 1; PPU.BGMosaic [1] = (Byte & 2) && PPU.Mosaic > 1; @@ -455,17 +424,10 @@ void S9xSetPPU (uint8 Byte, uint16 Address) PPU.VMA.Increment = 128; break; } -#ifdef DEBUGGER - if ((Byte & 3) != 0) - missing.vram_inc = Byte & 3; -#endif if (Byte & 0x0c) { static uint16 IncCount [4] = { 0, 32, 64, 128 }; static uint16 Shift [4] = { 0, 5, 6, 7 }; -#ifdef DEBUGGER - missing.vram_full_graphic_inc = (Byte & 0x0c) >> 2; -#endif // PPU.VMA.Increment = 1; uint8 i = (Byte & 0x0c) >> 2; PPU.VMA.FullGraphicCount = IncCount [i]; @@ -596,16 +558,6 @@ void S9xSetPPU (uint8 Byte, uint16 Address) PPU.ClipWindow2Inside [0] = !(Byte & 0x04); PPU.ClipWindow2Inside [1] = !(Byte & 0x40); PPU.RecomputeClipWindows = TRUE; -#ifdef DEBUGGER - if (Byte & 0x80) - missing.window2[1] = 1; - if (Byte & 0x20) - missing.window1[1] = 1; - if (Byte & 0x08) - missing.window2[0] = 1; - if (Byte & 0x02) - missing.window1[0] = 1; -#endif } break; case 0x2124: @@ -622,16 +574,6 @@ void S9xSetPPU (uint8 Byte, uint16 Address) PPU.ClipWindow2Inside [2] = !(Byte & 0x04); PPU.ClipWindow2Inside [3] = !(Byte & 0x40); PPU.RecomputeClipWindows = TRUE; -#ifdef DEBUGGER - if (Byte & 0x80) - missing.window2[3] = 1; - if (Byte & 0x20) - missing.window1[3] = 1; - if (Byte & 0x08) - missing.window2[2] = 1; - if (Byte & 0x02) - missing.window1[2] = 1; -#endif } break; case 0x2125: @@ -648,16 +590,6 @@ void S9xSetPPU (uint8 Byte, uint16 Address) PPU.ClipWindow2Inside [4] = !(Byte & 0x04); PPU.ClipWindow2Inside [5] = !(Byte & 0x40); PPU.RecomputeClipWindows = TRUE; -#ifdef DEBUGGER - if (Byte & 0x80) - missing.window2[5] = 1; - if (Byte & 0x20) - missing.window1[5] = 1; - if (Byte & 0x08) - missing.window2[4] = 1; - if (Byte & 0x02) - missing.window1[4] = 1; -#endif } break; case 0x2126: @@ -733,10 +665,6 @@ void S9xSetPPU (uint8 Byte, uint16 Address) if (Byte != Memory.FillRAM [0x212d]) { FLUSH_REDRAW (); -#ifdef DEBUGGER - if (Byte & 0x1f) - missing.subscreen = 1; -#endif PPU.RecomputeClipWindows = TRUE; Memory.FillRAM [Address] = Byte; return; @@ -758,10 +686,6 @@ void S9xSetPPU (uint8 Byte, uint16 Address) { FLUSH_REDRAW (); PPU.RecomputeClipWindows = TRUE; -#ifdef DEBUGGER - if ((Byte & 1) && (PPU.BGMode == 3 || PPU.BGMode == 4 || PPU.BGMode == 7)) - missing.direct = 1; -#endif } break; case 0x2131: @@ -770,24 +694,6 @@ void S9xSetPPU (uint8 Byte, uint16 Address) { FLUSH_REDRAW (); // Backgrounds 1 - 4, objects and backdrop colour add/sub enable -#ifdef DEBUGGER - if (Byte & 0x80) - { - // Subtract - if (Memory.FillRAM[0x2130] & 0x02) - missing.subscreen_sub = 1; - else - missing.fixed_colour_sub = 1; - } - else - { - // Addition - if (Memory.FillRAM[0x2130] & 0x02) - missing.subscreen_add = 1; - else - missing.fixed_colour_add = 1; - } -#endif Memory.FillRAM[0x2131] = Byte; } break; @@ -808,12 +714,6 @@ void S9xSetPPU (uint8 Byte, uint16 Address) // Screen settings if (Byte != Memory.FillRAM [0x2133]) { -#ifdef DEBUGGER - if (Byte & 0x40) - missing.mode7_bgmode = 1; - if (Byte & 0x08) - missing.pseudo_512 = 1; -#endif if (Byte & 0x04) { PPU.ScreenHeight = SNES_HEIGHT_EXTENDED; @@ -821,19 +721,9 @@ void S9xSetPPU (uint8 Byte, uint16 Address) IPPU.RenderedScreenHeight = PPU.ScreenHeight << 1; else IPPU.RenderedScreenHeight = PPU.ScreenHeight; -#ifdef DEBUGGER - missing.lines_239 = 1; -#endif } else PPU.ScreenHeight = SNES_HEIGHT; -#ifdef DEBUGGER - if (Byte & 0x02) - missing.sprite_double_height = 1; - - if (Byte & 1) - missing.interlace = 1; -#endif //if((Byte & 1)&&(PPU.BGMode==5||PPU.BGMode==6)) //IPPU.Interlace=1; if((Memory.FillRAM [0x2133] ^ Byte)&3) @@ -939,19 +829,7 @@ void S9xSetPPU (uint8 Byte, uint16 Address) if (Address == 0x2801 && Settings.SRTC) S9xSetSRTC (Byte, Address); else - if (Address < 0x3000 || Address >= 0x3300) - { -#ifdef DEBUGGER - missing.unknownppu_write = Address; - if (Settings.TraceUnknownRegisters) - { - sprintf (String, "Unknown register write: $%02X->$%04X\n", - Byte, Address); - S9xMessage (S9X_TRACE, S9X_PPU_TRACE, String); - } -#endif - } - else + if (Address >= 0x3000 && Address < 0x3300) { if (!Settings.SuperFX) { @@ -1040,9 +918,6 @@ uint8 S9xGetPPU (uint16 Address) case 0x2101: case 0x2102: case 0x2103: - #ifdef DEBUGGER - missing.oam_address_read = 1; - #endif return OpenBus; case 0x2104: @@ -1090,25 +965,15 @@ uint8 S9xGetPPU (uint16 Address) case 0x2111: case 0x2112: case 0x2113: -#ifdef DEBUGGER - missing.bg_offset_read = 1; -#endif return OpenBus; case 0x2114: -#ifdef DEBUGGER - missing.bg_offset_read = 1; -#endif - case 0x211b: case 0x211c: case 0x211d: case 0x211e: case 0x211f: case 0x2120: -#ifdef DEBUGGER - missing.matrix_read = 1; -#endif return OpenBus; @@ -1125,9 +990,6 @@ uint8 S9xGetPPU (uint16 Address) Memory.FillRAM[0x2136] = (uint8)(r >> 16); PPU.Need16x8Mulitply = FALSE; } -#ifdef DEBUGGER - missing.matrix_multiply = 1; -#endif return (PPU.OpenBus1 = Memory.FillRAM[Address]); case 0x2137: S9xLatchCounters(0); @@ -1148,9 +1010,6 @@ uint8 S9xGetPPU (uint16 Address) { PPU.FirstSprite = (PPU.OAMAddr&0xFE) >> 1; IPPU.OBJChanged = TRUE; -#ifdef DEBUGGER - missing.sprite_priority_rotation = 1; -#endif } } } else { @@ -1166,23 +1025,14 @@ uint8 S9xGetPPU (uint16 Address) { PPU.FirstSprite = (PPU.OAMAddr&0xFE) >> 1; IPPU.OBJChanged = TRUE; -#ifdef DEBUGGER - missing.sprite_priority_rotation = 1; -#endif } } } PPU.OAMFlip ^= 1; -#ifdef DEBUGGER - missing.oam_read = 1; -#endif return (PPU.OpenBus1 = byte); case 0x2139: // Read vram low byte -#ifdef DEBUGGER - missing.vram_read = 1; -#endif #ifdef CORRECT_VRAM_READS byte = IPPU.VRAMReadBuffer & 0xff; if (!PPU.VMA.High) @@ -1225,9 +1075,6 @@ uint8 S9xGetPPU (uint16 Address) break; case 0x213A: // Read vram high byte -#ifdef DEBUGGER - missing.vram_read = 1; -#endif #ifdef CORRECT_VRAM_READS byte = (IPPU.VRAMReadBuffer>>8) & 0xff; if (PPU.VMA.High) @@ -1270,9 +1117,6 @@ uint8 S9xGetPPU (uint16 Address) case 0x213B: // Read palette data -#ifdef DEBUGGER - missing.cgram_read = 1; -#endif if (PPU.CGFLIPRead) byte = PPU.CGDATA [PPU.CGADD++] >> 8; else @@ -1283,9 +1127,6 @@ uint8 S9xGetPPU (uint16 Address) case 0x213C: // Horizontal counter value 0-339 -#ifdef DEBUGGER - missing.h_counter_read = 1; -#endif if (PPU.HBeamFlip) byte = (PPU.OpenBus2 & 0xfe) | ((PPU.HBeamPosLatched >> 8) & 0x01); @@ -1298,9 +1139,6 @@ uint8 S9xGetPPU (uint16 Address) case 0x213D: // Vertical counter value 0-262 -#ifdef DEBUGGER - missing.v_counter_read = 1; -#endif if (PPU.VBeamFlip) byte = (PPU.OpenBus2 & 0xfe) | ((PPU.VBeamPosLatched >> 8) & 0x01); @@ -1395,9 +1233,6 @@ uint8 S9xGetPPU (uint16 Address) case 0x2180: // Read WRAM -#ifdef DEBUGGER - missing.wram_read = 1; -#endif byte = Memory.RAM [PPU.WRAM++]; PPU.WRAM &= 0x1FFFF; break; @@ -1435,14 +1270,6 @@ uint8 S9xGetPPU (uint16 Address) /*FALL*/ default: -#ifdef DEBUGGER - missing.unknownppu_read = Address; - if (Settings.TraceUnknownRegisters) - { - sprintf (String, "Unknown register read: $%04X\n", Address); - S9xMessage (S9X_TRACE, S9X_PPU_TRACE, String); - } -#endif return OpenBus; } } @@ -1511,15 +1338,6 @@ void S9xSetCPU (uint8 byte, uint16 Address) case 0x4017: break; default: -#ifdef DEBUGGER - missing.unknowncpu_write = Address; - if (Settings.TraceUnknownRegisters) - { - sprintf (String, "Unknown register register write: $%02X->$%04X\n", - byte, Address); - S9xMessage (S9X_TRACE, S9X_PPU_TRACE, String); - } -#endif break; } } @@ -1533,10 +1351,6 @@ void S9xSetCPU (uint8 byte, uint16 Address) //if(!SNESGameFixes.umiharakawaseFix && PPU.IRQVBeamPos==262) fprintf(stderr, "PPU.IRQVBeamPos = %d, CPU.V_Counter = %d\n", PPU.IRQVBeamPos, CPU.V_Counter); if (!PPU.VTimerEnabled) { -#ifdef DEBUGGER - missing.virq = 1; - missing.virq_pos = PPU.IRQVBeamPos; -#endif PPU.VTimerEnabled = TRUE; if (PPU.HTimerEnabled) S9xUpdateHTimer (); @@ -1556,10 +1370,6 @@ void S9xSetCPU (uint8 byte, uint16 Address) { if (!PPU.HTimerEnabled) { -#ifdef DEBUGGER - missing.hirq = 1; - missing.hirq_pos = PPU.IRQHBeamPos; -#endif PPU.HTimerEnabled = TRUE; S9xUpdateHTimer (); } @@ -1659,9 +1469,6 @@ void S9xSetCPU (uint8 byte, uint16 Address) case 0x4209: d = PPU.IRQVBeamPos; PPU.IRQVBeamPos = (PPU.IRQVBeamPos & 0xFF00) | byte; -#ifdef DEBUGGER - missing.virq_pos = PPU.IRQVBeamPos; -#endif if (PPU.VTimerEnabled && PPU.IRQVBeamPos != d) { if (PPU.HTimerEnabled) @@ -1677,9 +1484,6 @@ void S9xSetCPU (uint8 byte, uint16 Address) case 0x420A: d = PPU.IRQVBeamPos; PPU.IRQVBeamPos = (PPU.IRQVBeamPos & 0xFF) | ((byte & 1) << 8); -#ifdef DEBUGGER - missing.virq_pos = PPU.IRQVBeamPos; -#endif if (PPU.VTimerEnabled && PPU.IRQVBeamPos != d) { if (PPU.HTimerEnabled) @@ -1693,10 +1497,6 @@ void S9xSetCPU (uint8 byte, uint16 Address) break; case 0x420B: -#ifdef DEBUGGER - missing.dma_this_frame = byte; - missing.dma_channels = byte; -#endif if ((byte & 0x01) != 0) S9xDoDMA (0); if ((byte & 0x02) != 0) @@ -1715,10 +1515,6 @@ void S9xSetCPU (uint8 byte, uint16 Address) S9xDoDMA (7); break; case 0x420C: -#ifdef DEBUGGER - missing.hdma_this_frame |= byte; - missing.hdma_channels |= byte; -#endif if (Settings.DisableHDMA) byte = 0; Memory.FillRAM[0x420c] = byte; @@ -1732,9 +1528,6 @@ void S9xSetCPU (uint8 byte, uint16 Address) if (byte & 1) { CPU.FastROMSpeed = ONE_CYCLE; -#ifdef DEBUGGER - missing.fast_rom = 1; -#endif } else CPU.FastROMSpeed = SLOW_ONE_CYCLE; @@ -1950,7 +1743,7 @@ void S9xSetCPU (uint8 byte, uint16 Address) case 0x437B: // Unknown, but they seem to be RAM-ish -#ifdef DEBUGGER +#if 0 fprintf(stderr, "Write %02x to %04x!\n", byte, Address); #endif break; @@ -2022,15 +1815,6 @@ void S9xSetCPU (uint8 byte, uint16 Address) } default: -#ifdef DEBUGGER - missing.unknowncpu_write = Address; - if (Settings.TraceUnknownRegisters) - { - sprintf (String, "Unknown register write: $%02X->$%04X\n", - byte, Address); - S9xMessage (S9X_TRACE, S9X_PPU_TRACE, String); - } -#endif break; } Memory.FillRAM [Address] = byte; @@ -2122,14 +1906,6 @@ uint8 S9xGetCPU (uint16 Address) return ((IPPU.Joypads[ind] >> (PPU.Joypad2ButtonReadPos++ ^ 15)) & 1); } default: -#ifdef DEBUGGER - missing.unknowncpu_read = Address; - if (Settings.TraceUnknownRegisters) - { - sprintf (String, "Unknown register read: $%04X\n", Address); - S9xMessage (S9X_TRACE, S9X_PPU_TRACE, String); - } -#endif return OpenBus; } // return (Memory.FillRAM [Address]); @@ -2341,16 +2117,6 @@ uint8 S9xGetCPU (uint16 Address) return (Memory.FillRAM[Address]); default: -#ifdef DEBUGGER - missing.unknowncpu_read = Address; - if (Settings.TraceUnknownRegisters) - { - sprintf (String, "Unknown register read: $%04X\n", Address); - S9xMessage (S9X_TRACE, S9X_PPU_TRACE, String); - } - -#endif - if(Address>= 0x4800&&Settings.SPC7110) return S9xGetSPC7110(Address); @@ -3234,14 +3000,6 @@ void REGISTER_2118 (uint8 Byte) IPPU.TileCached [TILE_8BIT][address >> 6] = FALSE; if (!PPU.VMA.High) { -#ifdef DEBUGGER - if (Settings.TraceVRAM && !CPU.InDMA) - { - printf ("VRAM write byte: $%04X (%d,%d)\n", PPU.VMA.Address, - Memory.FillRAM[0x2115] & 3, - (Memory.FillRAM [0x2115] & 0x0c) >> 2); - } -#endif PPU.VMA.Address += PPU.VMA.Increment; } // Memory.FillRAM [0x2118] = Byte; @@ -3295,14 +3053,6 @@ void REGISTER_2119 (uint8 Byte) IPPU.TileCached [TILE_8BIT][address >> 6] = FALSE; if (PPU.VMA.High) { -#ifdef DEBUGGER - if (Settings.TraceVRAM && !CPU.InDMA) - { - printf ("VRAM write word: $%04X (%d,%d)\n", PPU.VMA.Address, - Memory.FillRAM[0x2115] & 3, - (Memory.FillRAM [0x2115] & 0x0c) >> 2); - } -#endif PPU.VMA.Address += PPU.VMA.Increment; } // Memory.FillRAM [0x2119] = Byte; diff --git a/source/sa1.cpp b/source/sa1.cpp index 474f731..36a9ff6 100644 --- a/source/sa1.cpp +++ b/source/sa1.cpp @@ -543,8 +543,8 @@ void S9xSetSA1 (uint8 byte, uint32 address) if (((byte ^ Memory.FillRAM [0x220a]) & 0x10) && (Memory.FillRAM [0x2301] & byte & 0x10)) { -#ifdef DEBUGGER - printf ("###SA1 NMI\n"); +#if 0 + printf ("###SA1 NMI\n"); #endif } break; diff --git a/source/sfc.mk b/source/sfc.mk deleted file mode 100644 index dccdd3b..0000000 --- a/source/sfc.mk +++ /dev/null @@ -1,83 +0,0 @@ -# sfc.mk - -SRC += $(SFCDIR)/c4.cpp \ - $(SFCDIR)/c4emu.cpp \ - $(SFCDIR)/cheats.cpp \ - $(SFCDIR)/cheats2.cpp \ - $(SFCDIR)/clip.cpp \ - $(SFCDIR)/cpu.cpp \ - $(SFCDIR)/cpuexec.cpp \ - $(SFCDIR)/cpuops.cpp \ - $(SFCDIR)/data.cpp \ - $(SFCDIR)/dma.cpp \ - $(SFCDIR)/dsp1.cpp \ - $(SFCDIR)/fxdbg.cpp \ - $(SFCDIR)/fxemu.cpp \ - $(SFCDIR)/fxinst.cpp \ - $(SFCDIR)/gfx.cpp \ - $(SFCDIR)/globals.cpp \ - $(SFCDIR)/memmap.cpp \ - $(SFCDIR)/ppu.cpp \ - $(SFCDIR)/sa1.cpp \ - $(SFCDIR)/sa1cpu.cpp \ - $(SFCDIR)/sdd1.cpp \ - $(SFCDIR)/sdd1emu.cpp \ - $(SFCDIR)/snapshot.cpp \ - $(SFCDIR)/snes9x.cpp \ - $(SFCDIR)/srtc.cpp \ - $(SFCDIR)/tile.cpp \ - $(SFCDIR)/apu.cpp \ - $(SFCDIR)/spc700.cpp \ - $(SFCDIR)/soundux.cpp \ - $(SFCDIR)/apudebug.cpp \ - $(SFCDIR)/debug.cpp \ - $(SFCDIR)/snaporig.cpp \ - $(SFCDIR)/movie.cpp \ - $(SFCDIR)/screenshot.cpp \ - $(SFCDIR)/spc7110.cpp \ - $(SFCDIR)/obc1.cpp \ - $(SFCDIR)/seta.cpp \ - $(SFCDIR)/seta010.cpp \ - $(SFCDIR)/seta011.cpp \ - $(SFCDIR)/seta018.cpp \ - $(SFCDIR)/loadzip.cpp \ - $(SFCDIR)/nds/charsets.c \ - $(SFCDIR)/nds/entry.cpp \ - $(SFCDIR)/nds/displaymodes.cpp\ - $(SFCDIR)/nds/bitmap.c \ - $(SFCDIR)/nds/bdf_font.c \ - $(SFCDIR)/nds/draw.c \ - $(SFCDIR)/nds/gui.c \ - $(SFCDIR)/nds/ds2_main.c \ - $(SFCDIR)/nds/gcheat.c \ - $(SFCDIR)/nds/cheats3.cpp \ - $(SFCDIR)/unzip/explode.c \ - $(SFCDIR)/unzip/unreduce.c \ - $(SFCDIR)/unzip/unshrink.c \ - $(SFCDIR)/unzip/unzip.c \ - - - -CFLAGS += -I$(SFCDIR) -I$(SFCDIR)/nds -I$(SFCDIR)/unzip\ - -DSPC700_C \ - -DEXECUTE_SUPERFX_PER_LINE \ - -DSDD1_DECOMP \ - -DVAR_CYCLES \ - -DCPU_SHUTDOWN \ - -DSPC700_SHUTDOWN \ - -DNO_INLINE_SET_GET \ - -DNOASM -DHAVE_MKSTEMP \ - '-DACCEPT_SIZE_T=size_t' \ - -DUNZIP_SUPPORT \ - -VPATH += $(SFCDIR) $(SFCDIR)/nds $(SFCDIR)/unzip - - - -# $(NETPLAYDEFINES) \ -# $(UNZIPDEFINES) \ - - - - - diff --git a/source/snaporig.cpp b/source/snaporig.cpp index 62674f2..69ff33e 100644 --- a/source/snaporig.cpp +++ b/source/snaporig.cpp @@ -388,17 +388,12 @@ static int ReadOrigSnapshot (STREAM snap) sizeof (SOrigSoundData), snap)) != SUCCESS) return (result); -#ifndef FOREVER_FORWARD_STEREO - SoundData.master_volume_left = OrigSoundData.master_volume_left; - SoundData.master_volume_right = OrigSoundData.master_volume_right; - SoundData.echo_volume_left = OrigSoundData.echo_volume_left; - SoundData.echo_volume_right = OrigSoundData.echo_volume_right; -#else + SoundData.master_volume [0] = OrigSoundData.master_volume_left; SoundData.master_volume [1] = OrigSoundData.master_volume_right; SoundData.echo_volume [0] = OrigSoundData.echo_volume_left; - SoundData.echo_volume [1] = OrigSoundData.echo_volume_right; -#endif + SoundData.echo_volume [1] = OrigSoundData.echo_volume_right; + SoundData.echo_enable = OrigSoundData.echo_enable; SoundData.echo_feedback = OrigSoundData.echo_feedback; SoundData.echo_ptr = OrigSoundData.echo_ptr; diff --git a/source/snapshot.cpp b/source/snapshot.cpp index b4be39c..ac4abe4 100644 --- a/source/snapshot.cpp +++ b/source/snapshot.cpp @@ -376,17 +376,10 @@ static FreezeData SnapAPURegisters [] = { #define OFFSET(f) Offset(f,SSoundData *) static FreezeData SnapSoundData [] = { -#ifndef FOREVER_FORWARD_STEREO - {OFFSET (master_volume_left), 2, INT_V}, - {OFFSET (master_volume_right), 2, INT_V}, - {OFFSET (echo_volume_left), 2, INT_V}, - {OFFSET (echo_volume_right), 2, INT_V}, -#else {OFFSET (master_volume [0]), 2, INT_V}, {OFFSET (master_volume [1]), 2, INT_V}, {OFFSET (echo_volume [0]), 2, INT_V}, {OFFSET (echo_volume [1]), 2, INT_V}, -#endif {OFFSET (echo_enable), 4, INT_V}, {OFFSET (echo_feedback), 4, INT_V}, {OFFSET (echo_ptr), 4, INT_V}, diff --git a/source/snes9x.h b/source/snes9x.h index 40b33b9..72780cf 100644 --- a/source/snes9x.h +++ b/source/snes9x.h @@ -327,15 +327,6 @@ struct SSettings{ /* Sound options */ uint32 SoundPlaybackRate; bool8 TraceSoundDSP; -#ifndef FOREVER_STEREO - bool8 Stereo; -#endif -#ifndef FOREVER_FORWARD_STEREO - bool8 ReverseStereo; -#endif -#ifndef FOREVER_16_BIT_SOUND - bool8 SixteenBitSound; -#endif bool8 EightBitConsoleSound; // due to caching, this needs S9xSetEightBitConsoleSound() int SoundBufferSize; int SoundMixInterval; @@ -368,18 +359,8 @@ struct SSettings{ bool8 DisableRangeTimeOver; /* XXX: unused */ /* Others */ - bool8 NetPlay; - bool8 NetPlayServer; - char ServerName [128]; - int Port; - bool8 GlideEnable; - bool8 OpenGLEnable; - int32 AutoSaveDelay; /* Time in seconds before S-RAM auto-saved if modified. */ bool8 ApplyCheats; - bool8 TurboMode; - uint32 TurboSkipFrames; - uint32 AutoMaxSkipFrames; - + /* Fixes for individual games */ bool8 StarfoxHack; bool8 WinterGold; @@ -425,16 +406,6 @@ void S9xMessage (int type, int number, const char *message); void S9xLoadSDD1Data (); END_EXTERN_C -enum { - PAUSE_NETPLAY_CONNECT = (1 << 0), - PAUSE_TOGGLE_FULL_SCREEN = (1 << 1), - PAUSE_EXIT = (1 << 2), - PAUSE_MENU = (1 << 3), - PAUSE_INACTIVE_WINDOW = (1 << 4), - PAUSE_WINDOW_ICONISED = (1 << 5), - PAUSE_RESTORE_GUI = (1 << 6), - PAUSE_FREEZE_FILE = (1 << 7) -}; void S9xSetPause (uint32 mask); void S9xClearPause (uint32 mask); diff --git a/source/soundux.cpp b/source/soundux.cpp index 6998166..49c8fbf 100644 --- a/source/soundux.cpp +++ b/source/soundux.cpp @@ -276,45 +276,19 @@ void S9xSetMasterVolume (short volume_left, short volume_right) { if (Settings.DisableMasterVolume || SNESGameFixes.EchoOnlyOutput) { -#ifndef FOREVER_FORWARD_STEREO - SoundData.master_volume_left = 127; - SoundData.master_volume_right = 127; -#endif SoundData.master_volume [0] = SoundData.master_volume [1] = 127; } else { -#ifndef FOREVER_STEREO - if (!so.stereo) - volume_left = (ABS (volume_right) + ABS (volume_left)) / 2; -#endif -#ifndef FOREVER_FORWARD_STEREO - SoundData.master_volume_left = volume_left; - SoundData.master_volume_right = volume_right; - SoundData.master_volume [Settings.ReverseStereo] = volume_left; - SoundData.master_volume [1 ^ Settings.ReverseStereo] = volume_right; -#else SoundData.master_volume [0] = volume_left; SoundData.master_volume [1] = volume_right; -#endif } } void S9xSetEchoVolume (short volume_left, short volume_right) { -#ifndef FOREVER_STEREO - if (!so.stereo) - volume_left = (ABS (volume_right) + ABS (volume_left)) / 2; -#endif -#ifndef FOREVER_FORWARD_STEREO - SoundData.echo_volume_left = volume_left; - SoundData.echo_volume_right = volume_right; - SoundData.echo_volume [Settings.ReverseStereo] = volume_left; - SoundData.echo_volume [1 ^ Settings.ReverseStereo] = volume_right; -#else SoundData.echo_volume [0] = volume_left; SoundData.echo_volume [1] = volume_right; -#endif } void S9xSetEchoEnable (uint8 byte) @@ -406,12 +380,6 @@ void S9xFixSoundAfterSnapshotLoad () SoundData.channels [i].previous [0] = (int32) SoundData.channels [i].previous16 [0]; SoundData.channels [i].previous [1] = (int32) SoundData.channels [i].previous16 [1]; } -#ifndef FOREVER_FORWARD_STEREO - SoundData.master_volume [Settings.ReverseStereo] = SoundData.master_volume_left; - SoundData.master_volume [1 ^ Settings.ReverseStereo] = SoundData.master_volume_right; - SoundData.echo_volume [Settings.ReverseStereo] = SoundData.echo_volume_left; - SoundData.echo_volume [1 ^ Settings.ReverseStereo] = SoundData.echo_volume_right; -#endif IAPU.Scanline = 0; } @@ -1375,17 +1343,10 @@ static inline void MixStereo (int sample_count) if (pitch_mod & (1 << (J + 1))) wave [I / 2] = ch->sample * ch->envx; -#ifndef FOREVER_FORWARD_STEREO - MixBuffer [I ^ Settings.ReverseStereo] += VL; - MixBuffer [I + (1 ^ Settings.ReverseStereo)] += VR; - ch->echo_buf_ptr [I ^ Settings.ReverseStereo] += VL; - ch->echo_buf_ptr [I + (1 ^ Settings.ReverseStereo)] += VR; -#else MixBuffer [I ] += VL; MixBuffer [I + 1] += VR; ch->echo_buf_ptr [I ] += VL; ch->echo_buf_ptr [I + 1] += VR; -#endif } stereo_exit: ; } @@ -2074,12 +2035,6 @@ void S9xResetSound (bool8 full) if (full) { -#ifndef FOREVER_FORWARD_STEREO - SoundData.master_volume_left = 0; - SoundData.master_volume_right = 0; - SoundData.echo_volume_left = 0; - SoundData.echo_volume_right = 0; -#endif SoundData.echo_enable = 0; SoundData.echo_write_enabled = 0; SoundData.echo_channel_enable = 0; @@ -2094,10 +2049,6 @@ void S9xResetSound (bool8 full) SoundData.noise_hertz = 0; } -#ifndef FOREVER_FORWARD_STEREO - SoundData.master_volume_left = 127; - SoundData.master_volume_right = 127; -#endif SoundData.master_volume [0] = SoundData.master_volume [1] = 127; if (so.playback_rate) so.err_rate = (uint32) (FIXED_POINT * SNES_SCANLINE_TIME / (1.0 / so.playback_rate)); diff --git a/source/soundux.h b/source/soundux.h index 7855d6c..fb765c6 100644 --- a/source/soundux.h +++ b/source/soundux.h @@ -144,14 +144,8 @@ typedef struct { uint32 err_rate; } SoundStatus; -// Define NO_VOLATILE_SOUND if you're always reading or writing sound from one -// thread or one co-routine. If you're using interrupts or a thread, sound must -// be volatile. -#ifndef NO_VOLATILE_SOUND -EXTERN_C volatile SoundStatus so; -#else EXTERN_C SoundStatus so; -#endif + typedef struct { int state; @@ -196,12 +190,6 @@ typedef struct { typedef struct { -#ifndef FOREVER_FORWARD_STEREO - short master_volume_left; /* range is -128 .. 127 */ - short master_volume_right; /* range is -128 .. 127 */ - short echo_volume_left; /* range is -128 .. 127 */ - short echo_volume_right; /* range is -128 .. 127 */ -#endif int echo_enable; int echo_feedback; /* range is -128 .. 127 */ int echo_ptr; diff --git a/source/spc7110.cpp b/source/spc7110.cpp index 970b214..8169989 100644 --- a/source/spc7110.cpp +++ b/source/spc7110.cpp @@ -220,9 +220,6 @@ void S9xSpc7110Init() (*LoadUp7110)(osd_GetPackDir()); - if(Settings.SPC7110RTC) - Settings.TurboMode=false; - s7r.bank50Internal=0; memset(s7r.bank50,0x00,DECOMP_BUFFER_SIZE); } -- cgit v1.2.3