aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoraliaspider2014-10-28 08:51:20 +0100
committeraliaspider2014-10-28 08:51:20 +0100
commita9c9cc3e30e50e8d90e355aa7ea84ae846e0c9bc (patch)
treecef73a9ec18ff128889643727b27b12c096e224e
parent7c00d00bcec7faf25ecd91c34decab4698ad478c (diff)
downloadsnesemu-a9c9cc3e30e50e8d90e355aa7ea84ae846e0c9bc.tar.gz
snesemu-a9c9cc3e30e50e8d90e355aa7ea84ae846e0c9bc.tar.bz2
snesemu-a9c9cc3e30e50e8d90e355aa7ea84ae846e0c9bc.zip
del some more
-rw-r--r--Makefile2
-rw-r--r--source/cpu.cpp1
-rw-r--r--source/cpuexec.cpp1
-rw-r--r--source/cpuops.cpp1
-rw-r--r--source/debug.h113
-rw-r--r--source/globals.cpp1
-rw-r--r--source/language.h328
-rw-r--r--source/movie.cpp779
-rw-r--r--source/movie.h146
-rw-r--r--source/ppu.cpp1
-rw-r--r--source/snapshot.cpp39
-rw-r--r--source/snes9x.h2
12 files changed, 1 insertions, 1413 deletions
diff --git a/Makefile b/Makefile
index d5989a6..b6ecbe6 100644
--- a/Makefile
+++ b/Makefile
@@ -55,7 +55,7 @@ CPP_SOURCES = source/apu.cpp source/c4.cpp \
source/dma.cpp source/dsp1.cpp \
source/fxdbg.cpp source/fxemu.cpp source/fxinst.cpp \
source/gfx.cpp source/globals.cpp source/loadzip.cpp \
- source/memmap.cpp source/movie.cpp \
+ source/memmap.cpp \
source/obc1.cpp source/ppu.cpp \
source/sa1.cpp source/sa1cpu.cpp source/screenshot.cpp \
source/sdd1.cpp source/sdd1emu.cpp \
diff --git a/source/cpu.cpp b/source/cpu.cpp
index d6e8f53..2f9b4ae 100644
--- a/source/cpu.cpp
+++ b/source/cpu.cpp
@@ -92,7 +92,6 @@
#include "ppu.h"
#include "dsp1.h"
#include "cpuexec.h"
-#include "debug.h"
#include "apu.h"
#include "dma.h"
#include "sa1.h"
diff --git a/source/cpuexec.cpp b/source/cpuexec.cpp
index d8c2b31..02c4edd 100644
--- a/source/cpuexec.cpp
+++ b/source/cpuexec.cpp
@@ -95,7 +95,6 @@
#include "cpuops.h"
#include "ppu.h"
#include "cpuexec.h"
-#include "debug.h"
#include "snapshot.h"
#include "gfx.h"
#include "missing.h"
diff --git a/source/cpuops.cpp b/source/cpuops.cpp
index eb698eb..9dc7f0c 100644
--- a/source/cpuops.cpp
+++ b/source/cpuops.cpp
@@ -94,7 +94,6 @@
#include "snes9x.h"
#include "memmap.h"
-#include "debug.h"
#include "missing.h"
#include "apu.h"
#include "sa1.h"
diff --git a/source/debug.h b/source/debug.h
deleted file mode 100644
index cdc1541..0000000
--- a/source/debug.h
+++ /dev/null
@@ -1,113 +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 _DEBUG_H_
-#define _DEBUG_H_
-
-START_EXTERN_C
-void S9xDoDebug ();
-void S9xTrace ();
-void S9xSA1Trace ();
-void S9xTraceMessage (const char *);
-
-// Structures
-struct SBreakPoint{
- bool8 Enabled;
- uint8 Bank;
- uint16 Address;
-};
-
-uint8 S9xOPrint( char *Line, uint8 Bank, uint16 Address);
-uint8 S9xSA1OPrint( char *Line, uint8 Bank, uint16 Address);
-
-extern struct SBreakPoint S9xBreakpoint[ 6];
-extern char *S9xMnemonics[256];
-END_EXTERN_C
-#endif
-
diff --git a/source/globals.cpp b/source/globals.cpp
index d24816b..8ff0c6b 100644
--- a/source/globals.cpp
+++ b/source/globals.cpp
@@ -93,7 +93,6 @@
#include "dsp1.h"
#include "missing.h"
#include "cpuexec.h"
-#include "debug.h"
#include "apu.h"
#include "dma.h"
#include "fxemu.h"
diff --git a/source/language.h b/source/language.h
deleted file mode 100644
index abcdcaf..0000000
--- a/source/language.h
+++ /dev/null
@@ -1,328 +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.
-*******************************************************************************/
-
-/* This is where all the GUI text strings will eventually end up */
-
-#define WINDOW_TITLE "Snes9X v%s for Windows"
-
-#define MY_REG_KEY "Software\\Emulators\\Snes9X"
-
-#define REG_KEY_VER "1.31"
-
-#define DISCLAIMER_TEXT "Snes9X v%s for Windows.\r\n" \
- "(c) Copyright 1996 - 2002 Gary Henderson and Jerremy Koot.\r\n" \
- "(c) Copyright 2001- 2004 John Weidman.\r\n" \
- "(c) Copyright 2002 - 2004 blip, Brad Jorsch, funkyass, Joel Yliluoma, Kris Bleakley, Matthew Kendora, Nach, Peter Bortas, zones.\r\n\r\n" \
- "Snes9X is a Super Nintendo Entertainment System\r\n" \
- "emulator that allows you to play most games designed\r\n" \
- "for the SNES on your PC.\r\n\r\n" \
- "Please visit http://www.snes9x.com for\r\n" \
- "up-to-the-minute information and help on Snes9X.\r\n\r\n" \
- "Nintendo is a trade mark."
-
-
-#define APP_NAME "Snes9x"
-// possible global strings
-#define SNES9X_INFO "Snes9x: Information"
-#define SNES9X_WARN "Snes9x: WARNING!"
-#define SNES9X_DXS "Snes9X: DirectSound"
-#define SNES9X_SNDQ "Snes9X: Sound CPU Question"
-#define SNES9X_NP_ERROR "Snes9X: NetPlay Error"
-#define BUTTON_OK "&OK"
-#define BUTTON_CANCEL "&Cancel"
-
-// Gamepad Dialog Strings
-#define INPUTCONFIG_TITLE "Input Configuration"
-#define INPUTCONFIG_JPTOGGLE "Disabled"
-#define INPUTCONFIG_DIAGTOGGLE "Toggle Diagonals"
-//#define INPUTCONFIG_OK "&OK"
-//#define INPUTCONFIG_CANCEL "&Cancel"
-#define INPUTCONFIG_JPCOMBO "Joypad #%d"
-#define INPUTCONFIG_LABEL_UP "Up"
-#define INPUTCONFIG_LABEL_DOWN "Down"
-#define INPUTCONFIG_LABEL_LEFT "Left"
-#define INPUTCONFIG_LABEL_RIGHT "Right"
-#define INPUTCONFIG_LABEL_A "A"
-#define INPUTCONFIG_LABEL_B "B"
-#define INPUTCONFIG_LABEL_X "X"
-#define INPUTCONFIG_LABEL_Y "Y"
-#define INPUTCONFIG_LABEL_L "L"
-#define INPUTCONFIG_LABEL_R "R"
-#define INPUTCONFIG_LABEL_START "Start"
-#define INPUTCONFIG_LABEL_SELECT "Select"
-#define INPUTCONFIG_LABEL_UPLEFT "Up Left"
-#define INPUTCONFIG_LABEL_UPRIGHT "Up Right"
-#define INPUTCONFIG_LABEL_DOWNRIGHT "Down Right"
-#define INPUTCONFIG_LABEL_DOWNLEFT "Down Left"
-#define INPUTCONFIG_LABEL_BLUE "Blue means the current key/button is already mapped"
-
-//gaming buttons and axises
-#define GAMEDEVICE_JOYNUMPREFIX "(J%d)"
-#define GAMEDEVICE_JOYBUTPREFIX "#[%d]"
-#define GAMEDEVICE_XNEG "Left"
-#define GAMEDEVICE_XPOS "Right"
-#define GAMEDEVICE_YPOS "Up"
-#define GAMEDEVICE_YNEG "Down"
-#define GAMEDEVICE_POVLEFT "POV Left"
-#define GAMEDEVICE_POVRIGHT "POV Right"
-#define GAMEDEVICE_POVUP "POV Up"
-#define GAMEDEVICE_POVDOWN "POV Down"
-#define GAMEDEVICE_POVDNLEFT "POV Dn Left"
-#define GAMEDEVICE_POVDNRIGHT "POV Dn Right"
-#define GAMEDEVICE_POVUPLEFT "POV Up Left"
-#define GAMEDEVICE_POVUPRIGHT "POV Up Right"
-#define GAMEDEVICE_ZPOS "Z Up"
-#define GAMEDEVICE_ZNEG "Z Down"
-#define GAMEDEVICE_RPOS "R Up"
-#define GAMEDEVICE_RNEG "R Down"
-#define GAMEDEVICE_UPOS "U Up"
-#define GAMEDEVICE_UNEG "U Down"
-#define GAMEDEVICE_VPOS "V Up"
-#define GAMEDEVICE_VNEG "V Down"
-#define GAMEDEVICE_BUTTON "Button %d"
-
-//gaming general
-#define GAMEDEVICE_DISABLED "Disabled"
-
-//gaming keys
-#define GAMEDEVICE_KEY "#%d"
-#define GAMEDEVICE_NUMPADPREFIX "Numpad-%c"
-#define GAMEDEVICE_VK_TAB "Tab"
-#define GAMEDEVICE_VK_BACK "Backspace"
-#define GAMEDEVICE_VK_CLEAR "Delete"
-#define GAMEDEVICE_VK_RETURN "Enter"
-#define GAMEDEVICE_VK_LSHIFT "LShift"
-#define GAMEDEVICE_VK_RSHIFT "RShift"
-#define GAMEDEVICE_VK_LCONTROL "LCTRL"
-#define GAMEDEVICE_VK_RCONTROL "RCTRL"
-#define GAMEDEVICE_VK_LMENU "LAlt"
-#define GAMEDEVICE_VK_RMENU "RAlt"
-#define GAMEDEVICE_VK_PAUSE "Pause"
-#define GAMEDEVICE_VK_CAPITAL "Capslock"
-#define GAMEDEVICE_VK_ESCAPE "Disabled"
-#define GAMEDEVICE_VK_SPACE "Space"
-#define GAMEDEVICE_VK_PRIOR "PgUp"
-#define GAMEDEVICE_VK_NEXT "PgDn"
-#define GAMEDEVICE_VK_HOME "Home"
-#define GAMEDEVICE_VK_END "End"
-#define GAMEDEVICE_VK_LEFT "Left"
-#define GAMEDEVICE_VK_RIGHT "Right"
-#define GAMEDEVICE_VK_UP "Up"
-#define GAMEDEVICE_VK_DOWN "Down"
-#define GAMEDEVICE_VK_SELECT "Select"
-#define GAMEDEVICE_VK_PRINT "Print"
-#define GAMEDEVICE_VK_EXECUTE "Execute"
-#define GAMEDEVICE_VK_SNAPSHOT "SnapShot"
-#define GAMEDEVICE_VK_INSERT "Insert"
-#define GAMEDEVICE_VK_DELETE "Delete"
-#define GAMEDEVICE_VK_HELP "Help"
-#define GAMEDEVICE_VK_LWIN "LWinKey"
-#define GAMEDEVICE_VK_RWIN "RWinKey"
-#define GAMEDEVICE_VK_APPS "AppKey"
-#define GAMEDEVICE_VK_MULTIPLY "Numpad *"
-#define GAMEDEVICE_VK_ADD "Numpad +"
-#define GAMEDEVICE_VK_SEPARATOR "\\"
-#define GAMEDEVICE_VK_OEM_1 "Semi-Colon"
-#define GAMEDEVICE_VK_OEM_7 "Apostrophe"
-#define GAMEDEVICE_VK_OEM_COMMA "Comma"
-#define GAMEDEVICE_VK_OEM_PERIOD "Period"
-#define GAMEDEVICE_VK_SUBTRACT "Numpad -"
-#define GAMEDEVICE_VK_DECIMAL "Numpad ."
-#define GAMEDEVICE_VK_DIVIDE "Numpad /"
-#define GAMEDEVICE_VK_NUMLOCK "Num-lock"
-#define GAMEDEVICE_VK_SCROLL "Scroll-lock"
-
-//evil things I found in WinProc
-
-#define WINPROC_TURBOMODE_ON "Turbo Mode Activated"
-#define WINPROC_TURBOMODE_OFF "Turbo Mode Deactivated"
-#define WINPROC_TURBOMODE_TEXT "Turbo Mode"
-#define WINPROC_HDMA_TEXT "HDMA emulation"
-#define WINPROC_BG1 "BG#1" //Background Layers
-#define WINPROC_BG2 "BG#2"
-#define WINPROC_BG3 "BG#3"
-#define WINPROC_BG4 "BG#4"
-#define WINPROC_SPRITES "Sprites"
-#define WINPROC_PADSWAP "Joypad swapping"
-#define WINPROC_CONTROLERS0 "Multiplayer 5 on #0"
-#define WINPROC_CONTROLERS1 "Joypad on #0"
-#define WINPROC_CONTROLERS2 "Mouse on #1"
-#define WINPROC_CONTROLERS3 "Mouse on #0"
-#define WINPROC_CONTROLERS4 "Superscope on #1"
-#define WINPROC_CONTROLERS5 "Justifier 1 on #1"
-#define WINPROC_CONTROLERS6 "Justifier 2 on #1"
-#define WINPROC_BGHACK "Background layering hack"
-#define WINPROC_MODE7INTER "Mode 7 Interpolation"
-#define WINPROC_TRANSPARENCY "Transparency effects"
-#define WINPROC_CLIPWIN "Graphic clip windows"
-#define WINPROC_PAUSE "Pause"
-#define WINPROC_EMUFRAMETIME "Emulated frame time: %dms"
-#define WINPROC_AUTOSKIP "Auto Frame Skip"
-#define WINPROC_FRAMESKIP "Frame skip: %d"
-#define WINPROC_TURBO_R_ON "Turbo R Activated"
-#define WINPROC_TURBO_R_OFF "Turbo R Deactivated"
-#define WINPROC_TURBO_L_ON "Turbo L Activated"
-#define WINPROC_TURBO_L_OFF "Turbo L Deactivated"
-#define WINPROC_TURBO_X_ON "Turbo X Activated"
-#define WINPROC_TURBO_X_OFF "Turbo X Deactivated"
-#define WINPROC_TURBO_Y_ON "Turbo Y Activated"
-#define WINPROC_TURBO_Y_OFF "Turbo Y Deactivated"
-#define WINPROC_TURBO_A_ON "Turbo A Activated"
-#define WINPROC_TURBO_A_OFF "Turbo A Deactivated"
-#define WINPROC_TURBO_B_ON "Turbo B Activated"
-#define WINPROC_TURBO_B_OFF "Turbo B Deactivated"
-#define WINPROC_TURBO_SEL_ON "Turbo Select Activated"
-#define WINPROC_TURBO_SEL_OFF "Turbo Select Deactivated"
-#define WINPROC_TURBO_START_ON "Turbo Start Activated"
-#define WINPROC_TURBO_START_OFF "Turbo Start Deactivated"
-#define WINPROC_FILTER_RESTART "You will need to restart Snes9x before the output image\nprocessing option change will take effect."
-#define WINPROC_DISCONNECT "Disconnect from the NetPlay server first."
-#define WINPROC_NET_RESTART "Your game will be reset after the ROM has been sent due to\nyour 'Sync Using Reset Game' setting.\n\n"
-#define WINPROC_INTERPOLATED_SND "Interpolated sound"
-#define WINPROC_SYNC_SND "Sync sound"
-#define WINPROC_SND_OFF "Disabling the sound CPU emulation will help to improve\nemulation speed but you will not hear any sound effects\nor music. If you later want to re-enable the sound CPU\nemulation you will need to reset your game before it will\ntake effect.\n\nAre you sure this is what you want?"
-#define WINPROC_SND_RESTART "You will need to reset your game or load another one\nbefore enabling the sound CPU will take effect."
-
-//Emulator Settings
-
-#define EMUSET_TITLE "Emulation Settings"
-#define EMUSET_LABEL_FREEZE "Freeze Folder Directory"
-#define EMUSET_BROWSE "&Browse..."
-#define EMUSET_LABEL_ASRAM "Auto-Save S-RAM"
-#define EMUSET_LABEL_ASRAM_TEXT "seconds after last change (0 disables auto-save)"
-#define EMUSET_LABEL_SMAX "Skip at most"
-#define EMUSET_LABEL_SMAX_TEXT "frames in auto-frame rate mode"
-#define EMUSET_LABEL_STURBO "Skip Rendering"
-#define EMUSET_LABEL_STURBO_TEXT "frames in Turbo mode"
-#define EMUSET_TOGGLE_TURBO "Tab Toggles Turbo"
-
-//Netplay Options
-
-#define NPOPT_TITLE "Netplay Options"
-#define NPOPT_LABEL_PORTNUM "Socket Port Number"
-#define NPOPT_LABEL_PAUSEINTERVAL "Ask Server to Pause when"
-#define NPOPT_LABEL_PAUSEINTERVAL_TEXT "frames behind"
-#define NPOPT_LABEL_MAXSKIP "Maximum Frame Rate Skip"
-#define NPOPT_SYNCBYRESET "Sync By Reset"
-#define NPOPT_SENDROM "Send ROM Image to Client on Connect"
-#define NPOPT_ACTASSERVER "Act As Server"
-#define NPOPT_PORTNUMBLOCK "Port Settings"
-#define NPOPT_CLIENTSETTINGSBLOCK "Client Settings"
-#define NPOPT_SERVERSETTINGSBLOCK "Server Settings"
-
-//Netplay Connect
-
-
-#define NPCON_TITLE "Connect to Server"
-#define NPCON_LABEL_SERVERADDY "Server Address"
-#define NPCON_LABEL_PORTNUM "Port Number"
-#define NPCON_CLEARHISTORY "Clear History"
-
-
-//Movie Messages
-
-#define MOVIE_INFO_REPLAY "Movie replay"
-#define MOVIE_INFO_RECORD "Movie record"
-#define MOVIE_INFO_RERECORD "Movie re-record"
-#define MOVIE_INFO_REWIND "Movie rewind"
-#define MOVIE_INFO_STOP "Movie stop"
-#define MOVIE_INFO_END "Movie end"
-#define MOVIE_INFO_RECORDING_ENABLED "Recording enabled"
-#define MOVIE_INFO_RECORDING_DISABLED "Recording disabled"
-#define MOVIE_ERR_SNAPSHOT_WRONG_MOVIE "Snapshot not from this movie"
-#define MOVIE_ERR_SNAPSHOT_NOT_MOVIE "Not a movie snapshot"
-#define MOVIE_ERR_COULD_NOT_OPEN "Could not open movie file."
-#define MOVIE_ERR_NOT_FOUND "File not found."
-#define MOVIE_ERR_WRONG_FORMAT "File is wrong format."
-#define MOVIE_ERR_WRONG_VERSION "File is wrong version."
-
-
-// AVI Messages
-
-#define AVI_CONFIGURATION_CHANGED "AVI recording stopped (configuration settings changed)."
diff --git a/source/movie.cpp b/source/movie.cpp
deleted file mode 100644
index 3ae0934..0000000
--- a/source/movie.cpp
+++ /dev/null
@@ -1,779 +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)
-
- Input recording/playback code
- (c) Copyright 2004 blip
-
- 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.
-*******************************************************************************/
-#include <string.h>
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#endif
-#include <ctype.h>
-#include <stdlib.h>
-
-#if defined(__unix) || defined(__linux) || defined(__sun) || defined(__DJGPP) || defined (PSP)
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#endif
-#include <time.h>
-
-#ifdef __WIN32__
-#include <io.h>
-#ifndef W_OK
-#define W_OK 2
-#endif
-#endif
-
-#include "movie.h"
-#include "snes9x.h"
-#include "cpuexec.h"
-#include "snapshot.h"
-
-#define SMV_MAGIC 0x1a564d53 // SMV0x1a
-#define SMV_VERSION 1
-#define SMV_HEADER_SIZE 32
-#define CONTROLLER_DATA_SIZE 2
-#define BUFFER_GROWTH_SIZE 4096
-
-enum MovieState
-{
- MOVIE_STATE_NONE=0,
- MOVIE_STATE_PLAY,
- MOVIE_STATE_RECORD
-};
-
-static struct SMovie
-{
- enum MovieState State;
- char Filename [_MAX_PATH];
- FILE* File;
- uint32 SaveStateOffset;
- uint32 ControllerDataOffset;
- uint32 MovieId;
- uint32 CurrentFrame;
- uint32 MaxFrame;
- uint32 RerecordCount;
- uint8 ControllersMask;
- uint8 Opts;
- bool8 ReadOnly;
- uint32 BytesPerFrame;
- uint8* InputBuffer;
- uint32 InputBufferSize;
- uint8* InputBufferPtr;
- bool8 FrameDisplay;
- char FrameDisplayString[256];
-} Movie;
-
-/*
- For illustration:
-struct MovieFileHeader
-{
- uint32 magic; // SMV0x1a
- uint32 version;
- uint32 uid; // used to match savestates to a particular movie
- uint32 rerecord_count;
- uint32 length_frames;
- uint8 flags[4];
- uint32 offset_to_savestate; // smvs have an embedded savestate
- uint32 offset_to_controller_data;
- // after the header comes extra metadata
- // sizeof(metadata) = offset_to_savestate - sizeof(MovieFileHeader)
-};
-*/
-
-static int bytes_per_frame()
-{
- int i;
- int num_controllers;
-
- num_controllers=0;
- for(i=0; i<5; ++i)
- {
- if(Movie.ControllersMask & (1<<i))
- {
- ++num_controllers;
- }
- }
-
- return CONTROLLER_DATA_SIZE*num_controllers;
-}
-
-static inline uint32 Read32(const uint8*& ptr)
-{
- uint32 v=(ptr[0] | (ptr[1]<<8) | (ptr[2]<<16) | (ptr[3]<<24));
- ptr += 4;
- return v;
-}
-
-static inline uint16 Read16(const uint8*& ptr) /* const version */
-{
- uint16 v=(ptr[0] | (ptr[1]<<8));
- ptr += 2;
- return v;
-}
-
-static inline uint16 Read16(uint8*& ptr) /* non-const version */
-{
- uint16 v=(ptr[0] | (ptr[1]<<8));
- ptr += 2;
- return v;
-}
-
-static void Write32(uint32 v, uint8*& ptr)
-{
- ptr[0]=(uint8)(v&0xff);
- ptr[1]=(uint8)((v>>8)&0xff);
- ptr[2]=(uint8)((v>>16)&0xff);
- ptr[3]=(uint8)((v>>24)&0xff);
- ptr += 4;
-}
-
-static void Write16(uint16 v, uint8*& ptr)
-{
- ptr[0]=(uint8)(v&0xff);
- ptr[1]=(uint8)((v>>8)&0xff);
- ptr += 2;
-}
-
-static int read_movie_header(FILE* fd, SMovie* movie)
-{
- uint8 header[SMV_HEADER_SIZE];
- if(fread(header, 1, SMV_HEADER_SIZE, fd) != SMV_HEADER_SIZE)
- return WRONG_FORMAT;
-
- const uint8* ptr=header;
- uint32 magic=Read32(ptr);
- if(magic!=SMV_MAGIC)
- return WRONG_FORMAT;
-
- uint32 version=Read32(ptr);
- if(version!=SMV_VERSION)
- return WRONG_VERSION;
-
- movie->MovieId=Read32(ptr);
- movie->RerecordCount=Read32(ptr);
- movie->MaxFrame=Read32(ptr);
-
- movie->ControllersMask=*ptr++;
- movie->Opts=*ptr++;
- ptr += 2;
-
- movie->SaveStateOffset=Read32(ptr);
- movie->ControllerDataOffset=Read32(ptr);
-
- return SUCCESS;
-}
-
-static void write_movie_header(FILE* fd, const SMovie* movie)
-{
- uint8 header[SMV_HEADER_SIZE];
- uint8* ptr=header;
-
- Write32(SMV_MAGIC, ptr);
- Write32(SMV_VERSION, ptr);
- Write32(movie->MovieId, ptr);
- Write32(movie->RerecordCount, ptr);
- Write32(movie->MaxFrame, ptr);
-
- *ptr++=movie->ControllersMask;
- *ptr++=movie->Opts;
- *ptr++=0;
- *ptr++=0;
-
- Write32(movie->SaveStateOffset, ptr);
- Write32(movie->ControllerDataOffset, ptr);
-
- fwrite(header, 1, SMV_HEADER_SIZE, fd);
-}
-
-static void flush_movie()
-{
- fseek(Movie.File, 0, SEEK_SET);
- write_movie_header(Movie.File, &Movie);
- fseek(Movie.File, Movie.ControllerDataOffset, SEEK_SET);
- fwrite(Movie.InputBuffer, 1, Movie.BytesPerFrame*(Movie.MaxFrame+1), Movie.File);
-}
-
-static void change_state(MovieState new_state)
-{
- if(new_state==Movie.State)
- return;
-
- if(Movie.State==MOVIE_STATE_RECORD)
- {
- flush_movie();
- }
-
- Movie.State=new_state;
-
- if(new_state==MOVIE_STATE_NONE)
- {
- fclose(Movie.File);
- Movie.File=NULL;
- // FIXME: truncate movie to MaxFrame length
- /* truncate() could be used, if it's certain
- * that the savestate block is never after
- * the controller data block. It is not guaranteed
- * by the format.
- */
- }
-}
-
-static void reserve_buffer_space(uint32 space_needed)
-{
- if(space_needed > Movie.InputBufferSize)
- {
- uint32 ptr_offset = Movie.InputBufferPtr - Movie.InputBuffer;
- uint32 alloc_chunks = space_needed / BUFFER_GROWTH_SIZE;
- Movie.InputBufferSize = BUFFER_GROWTH_SIZE * (alloc_chunks+1);
- Movie.InputBuffer = (uint8*)realloc(Movie.InputBuffer, Movie.InputBufferSize);
- Movie.InputBufferPtr = Movie.InputBuffer + ptr_offset;
- }
-}
-
-static void read_frame_controller_data()
-{
- int i;
- for(i=0; i<5; ++i)
- {
- if(Movie.ControllersMask & (1<<i))
- {
- IPPU.Joypads[i]=(uint32)(Read16(Movie.InputBufferPtr)) | 0x80000000L;
- }
- else
- {
- IPPU.Joypads[i]=0; // pretend the controller is disconnected
- }
- }
-}
-
-static void write_frame_controller_data()
-{
- reserve_buffer_space((uint32)((Movie.InputBufferPtr+Movie.BytesPerFrame)-Movie.InputBuffer));
-
- int i;
- for(i=0; i<5; ++i)
- {
- if(Movie.ControllersMask & (1<<i))
- {
- Write16((uint16)(IPPU.Joypads[i] & 0xffff), Movie.InputBufferPtr);
- }
- else
- {
- IPPU.Joypads[i]=0; // pretend the controller is disconnected
- }
- }
-}
-
-void S9xMovieInit ()
-{
- memset(&Movie, 0, sizeof(Movie));
- Movie.State = MOVIE_STATE_NONE;
-}
-
-int S9xMovieOpen (const char* filename, bool8 read_only)
-{
- return FILE_NOT_FOUND;
-#if 0
- FILE* fd;
- STREAM stream;
- int result;
- int fn;
-
- if(!(fd=fopen(filename, read_only ? "rb" : "rb+")))
- return FILE_NOT_FOUND;
-
- // stop current movie before opening
- change_state(MOVIE_STATE_NONE);
-
- // read header
- if((result=read_movie_header(fd, &Movie))!=SUCCESS)
- {
- fclose(fd);
- return result;
- }
-
- fn=dup(fileno(fd));
- fclose(fd);
-
- // apparently this lseek is necessary
- lseek(fn, Movie.SaveStateOffset, SEEK_SET);
- if(!(stream=REOPEN_STREAM(fn, "rb")))
- return FILE_NOT_FOUND;
-
- if(Movie.Opts & MOVIE_OPT_FROM_RESET)
- {
- S9xReset();
- // save only SRAM for a from-reset snapshot
- result=(READ_STREAM(SRAM, 0x20000, stream) == 0x20000) ? SUCCESS : WRONG_FORMAT;
- }
- else
- {
- result=S9xUnfreezeFromStream(stream);
- }
- CLOSE_STREAM(stream);
-
- if(result!=SUCCESS)
- {
- return result;
- }
-
- if(!(fd=fopen(filename, read_only ? "rb" : "rb+")))
- return FILE_NOT_FOUND;
-
- if(fseek(fd, Movie.ControllerDataOffset, SEEK_SET))
- return WRONG_FORMAT;
-
- // read controller data
- Movie.File=fd;
- Movie.BytesPerFrame=bytes_per_frame();
- Movie.InputBufferPtr=Movie.InputBuffer;
- uint32 to_read=Movie.BytesPerFrame * (Movie.MaxFrame+1);
- reserve_buffer_space(to_read);
- fread(Movie.InputBufferPtr, 1, to_read, fd);
-
- // read "baseline" controller data
- read_frame_controller_data();
-
- strncpy(Movie.Filename, filename, _MAX_PATH);
- Movie.Filename[_MAX_PATH-1]='\0';
- Movie.CurrentFrame=0;
- Movie.ReadOnly=read_only;
- change_state(MOVIE_STATE_PLAY);
-
- S9xMessage(S9X_INFO, S9X_MOVIE_INFO, MOVIE_INFO_REPLAY);
- return SUCCESS;
-#endif
-}
-
-int S9xMovieCreate (const char* filename, uint8 controllers_mask, uint8 opts, const wchar_t* metadata, int metadata_length)
-{
- return FILE_NOT_FOUND;
-#if 0
- FILE* fd;
- STREAM stream;
- int fn;
-
- if(controllers_mask==0)
- return WRONG_FORMAT;
-
- if(!(fd=fopen(filename, "wb")))
- return FILE_NOT_FOUND;
-
- // stop current movie before opening
- change_state(MOVIE_STATE_NONE);
-
- if(metadata_length>MOVIE_MAX_METADATA)
- {
- metadata_length=MOVIE_MAX_METADATA;
- }
-
- Movie.MovieId=(uint32)time(NULL);
- Movie.RerecordCount=0;
- Movie.MaxFrame=0;
- Movie.SaveStateOffset=SMV_HEADER_SIZE+(sizeof(uint16)*metadata_length);
- Movie.ControllerDataOffset=0;
- Movie.ControllersMask=controllers_mask;
- Movie.Opts=opts;
- if(Settings.PAL)
- {
- Movie.Opts |= MOVIE_OPT_PAL;
- }
- else
- {
- Movie.Opts &= ~MOVIE_OPT_PAL;
- }
-
- write_movie_header(fd, &Movie);
-
- // convert wchar_t metadata string/array to a uint16 array
- if(metadata_length>0)
- {
- uint8 meta_buf[MOVIE_MAX_METADATA * sizeof(uint16)];
- int i;
-
- for(i=0; i<metadata_length; ++i)
- {
- uint16 c=(uint16)metadata[i];
- meta_buf[i+i] =(uint8)(c&0xff);
- meta_buf[i+i+1]=(uint8)((c>>8)&0xff);
- }
-
- fwrite(meta_buf, sizeof(uint16), metadata_length, fd);
- }
-
- // write snapshot
- fn=dup(fileno(fd));
- fclose(fd);
-
- // lseek(fn, Movie.SaveStateOffset, SEEK_SET);
- if(!(stream=REOPEN_STREAM(fn, "ab")))
- return FILE_NOT_FOUND;
-
- if(opts & MOVIE_OPT_FROM_RESET)
- {
- S9xReset();
- // save only SRAM for a from-reset snapshot
- WRITE_STREAM(SRAM, 0x20000, stream);
- }
- else
- {
- S9xFreezeToStream(stream);
- }
- CLOSE_STREAM(stream);
-
- if(!(fd=fopen(filename, "rb+")))
- return FILE_NOT_FOUND;
-
- fseek(fd, 0, SEEK_END);
- Movie.ControllerDataOffset=(uint32)ftell(fd);
-
- // write "baseline" controller data
- Movie.File=fd;
- Movie.BytesPerFrame=bytes_per_frame();
- Movie.InputBufferPtr=Movie.InputBuffer;
- write_frame_controller_data();
-
- strncpy(Movie.Filename, filename, _MAX_PATH);
- Movie.Filename[_MAX_PATH-1]='\0';
- Movie.CurrentFrame=0;
- Movie.ReadOnly=false;
- change_state(MOVIE_STATE_RECORD);
-
- S9xMessage(S9X_INFO, S9X_MOVIE_INFO, MOVIE_INFO_RECORD);
- return SUCCESS;
-#endif
-}
-
-void S9xMovieUpdate ()
-{
- switch(Movie.State)
- {
- case MOVIE_STATE_PLAY:
- if(Movie.CurrentFrame>=Movie.MaxFrame)
- {
- change_state(MOVIE_STATE_NONE);
- S9xMessage(S9X_INFO, S9X_MOVIE_INFO, MOVIE_INFO_END);
- return;
- }
- else
- {
- if(Movie.FrameDisplay)
- {
- sprintf(Movie.FrameDisplayString, "Playing frame: %d", Movie.CurrentFrame);
- S9xMessage (S9X_INFO, S9X_MOVIE_INFO, Movie.FrameDisplayString);
- }
- read_frame_controller_data();
- ++Movie.CurrentFrame;
- }
- break;
-
- case MOVIE_STATE_RECORD:
- {
- if(Movie.FrameDisplay)
- {
- sprintf(Movie.FrameDisplayString, "Recording frame: %d", Movie.CurrentFrame);
- S9xMessage (S9X_INFO, S9X_MOVIE_INFO, Movie.FrameDisplayString);
- }
- write_frame_controller_data();
- ++Movie.CurrentFrame;
- Movie.MaxFrame=Movie.CurrentFrame;
- fwrite((Movie.InputBufferPtr - Movie.BytesPerFrame), 1, Movie.BytesPerFrame, Movie.File);
- }
- break;
-
- default:
- break;
- }
-}
-
-void S9xMovieStop (bool8 suppress_message)
-{
- if(Movie.State!=MOVIE_STATE_NONE)
- {
- change_state(MOVIE_STATE_NONE);
-
- if(!suppress_message)
- S9xMessage(S9X_INFO, S9X_MOVIE_INFO, MOVIE_INFO_STOP);
- }
-}
-
-int S9xMovieGetInfo (const char* filename, struct MovieInfo* info)
-{
- FILE* fd;
- int result;
- SMovie local_movie;
- int metadata_length;
-
- memset(info, 0, sizeof(*info));
- if(!(fd=fopen(filename, "rb")))
- return FILE_NOT_FOUND;
-
- if((result=(read_movie_header(fd, &local_movie)))!=SUCCESS)
- return result;
-
- info->TimeCreated=(time_t)local_movie.MovieId;
- info->LengthFrames=local_movie.MaxFrame;
- info->RerecordCount=local_movie.RerecordCount;
- info->Opts=local_movie.Opts;
- info->ControllersMask=local_movie.ControllersMask;
-
- if(local_movie.SaveStateOffset > SMV_HEADER_SIZE)
- {
- uint8 meta_buf[MOVIE_MAX_METADATA * sizeof(uint16)];
- int i;
-
- metadata_length=((int)local_movie.SaveStateOffset-SMV_HEADER_SIZE)/sizeof(uint16);
- metadata_length=(metadata_length>=MOVIE_MAX_METADATA) ? MOVIE_MAX_METADATA-1 : metadata_length;
- metadata_length=(int)fread(meta_buf, sizeof(uint16), metadata_length, fd);
-
- for(i=0; i<metadata_length; ++i)
- {
- uint16 c=meta_buf[i+i] | (meta_buf[i+i+1] << 8);
- info->Metadata[i]=(wchar_t)c;
- }
- info->Metadata[i]='\0';
- }
- else
- {
- info->Metadata[0]='\0';
- }
-
- fclose(fd);
-
- if(access(filename, W_OK))
- info->ReadOnly=true;
-
- return SUCCESS;
-}
-
-bool8 S9xMovieActive ()
-{
- return (Movie.State!=MOVIE_STATE_NONE);
-}
-
-bool8 S9xMovieReadOnly ()
-{
- if(!S9xMovieActive())
- return false;
-
- return Movie.ReadOnly;
-}
-
-uint32 S9xMovieGetId ()
-{
- if(!S9xMovieActive())
- return 0;
-
- return Movie.MovieId;
-}
-
-uint32 S9xMovieGetLength ()
-{
- if(!S9xMovieActive())
- return 0;
-
- return Movie.MaxFrame;
-}
-
-uint32 S9xMovieGetFrameCounter ()
-{
- if(!S9xMovieActive())
- return 0;
-
- return Movie.CurrentFrame;
-}
-
-void S9xMovieToggleFrameDisplay ()
-{
- Movie.FrameDisplay = !Movie.FrameDisplay;
- if(!Movie.FrameDisplay)
- {
- GFX.InfoStringTimeout = 1;
- }
-}
-
-void S9xMovieFreeze (uint8** buf, uint32* size)
-{
- // sanity check
- if(!S9xMovieActive())
- {
- return;
- }
-
- *buf = NULL;
- *size = 0;
-
- // compute size needed for the buffer
- uint32 size_needed = 4*3; // room for MovieId, CurrentFrame, and MaxFrame
- size_needed += (uint32)(Movie.BytesPerFrame * (Movie.MaxFrame+1));
- *buf=new uint8[size_needed];
- *size=size_needed;
-
- uint8* ptr = *buf;
- if(!ptr)
- {
- return;
- }
-
- Write32(Movie.MovieId, ptr);
- Write32(Movie.CurrentFrame, ptr);
- Write32(Movie.MaxFrame, ptr);
-
- memcpy(ptr, Movie.InputBuffer, Movie.BytesPerFrame * (Movie.MaxFrame+1));
-}
-
-bool8 S9xMovieUnfreeze (const uint8* buf, uint32 size)
-{
- // sanity check
- if(!S9xMovieActive())
- {
- return false;
- }
-
- const uint8* ptr = buf;
- if(size < 4*3)
- {
- return false;
- }
-
- uint32 movie_id = Read32(ptr);
- uint32 current_frame = Read32(ptr);
- uint32 max_frame = Read32(ptr);
- uint32 space_needed = (Movie.BytesPerFrame * (max_frame+1));
-
- if(movie_id != Movie.MovieId ||
- current_frame > max_frame ||
- space_needed > size)
- {
- return false;
- }
-
- if(!Movie.ReadOnly)
- {
- // here, we are going to take the input data from the savestate
- // and make it the input data for the current movie, then continue
- // writing new input data at the currentframe pointer
- change_state(MOVIE_STATE_RECORD);
- S9xMessage(S9X_INFO, S9X_MOVIE_INFO, MOVIE_INFO_RERECORD);
-
- Movie.CurrentFrame = current_frame;
- Movie.MaxFrame = max_frame;
- ++Movie.RerecordCount;
-
- reserve_buffer_space(space_needed);
- memcpy(Movie.InputBuffer, ptr, space_needed);
- flush_movie();
- fseek(Movie.File, Movie.ControllerDataOffset+(Movie.BytesPerFrame * (Movie.CurrentFrame+1)), SEEK_SET);
- }
- else
- {
- // here, we are going to keep the input data from the movie file
- // and simply rewind to the currentframe pointer
- // this will cause a desync if the savestate is not in sync
- // with the on-disk recording data, but it's easily solved
- // by loading another savestate or playing the movie from the beginning
-
- // and older savestate might have a currentframe pointer past
- // the end of the input data, so check for that here
- if(current_frame > Movie.MaxFrame)
- {
- return false;
- }
-
- change_state(MOVIE_STATE_PLAY);
- S9xMessage(S9X_INFO, S9X_MOVIE_INFO, MOVIE_INFO_REWIND);
-
- Movie.CurrentFrame = current_frame;
- }
-
- Movie.InputBufferPtr = Movie.InputBuffer + (Movie.BytesPerFrame * Movie.CurrentFrame);
- read_frame_controller_data();
-
- return true;
-}
diff --git a/source/movie.h b/source/movie.h
deleted file mode 100644
index cf97442..0000000
--- a/source/movie.h
+++ /dev/null
@@ -1,146 +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)
-
- Input recording/playback code
- (c) Copyright 2004 blip
-
- 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 _MOVIE_H_
-#define _MOVIE_H_
-
-#include <stdio.h>
-#include <time.h>
-#include "snes9x.h"
-
-#ifndef SUCCESS
-# define SUCCESS 1
-# define WRONG_FORMAT (-1)
-# define WRONG_VERSION (-2)
-# define FILE_NOT_FOUND (-3)
-#endif
-
-#define MOVIE_OPT_FROM_SNAPSHOT 0
-#define MOVIE_OPT_FROM_RESET (1<<0)
-#define MOVIE_OPT_PAL (1<<1)
-#define MOVIE_MAX_METADATA 512
-
-START_EXTERN_C
-struct MovieInfo
-{
- time_t TimeCreated;
- uint32 LengthFrames;
- uint32 RerecordCount;
- wchar_t Metadata[MOVIE_MAX_METADATA]; // really should be wchar_t
- uint8 Opts;
- uint8 ControllersMask;
- bool8 ReadOnly;
-};
-
-// methods used by the user-interface code
-int S9xMovieOpen (const char* filename, bool8 read_only);
-int S9xMovieCreate (const char* filename, uint8 controllers_mask, uint8 opts, const wchar_t* metadata, int metadata_length);
-int S9xMovieGetInfo (const char* filename, struct MovieInfo* info);
-void S9xMovieStop (bool8 suppress_message);
-void S9xMovieToggleFrameDisplay ();
-
-// methods used by the emulation
-void S9xMovieInit ();
-void S9xMovieUpdate ();
-//bool8 S9xMovieRewind (uint32 at_frame);
-void S9xMovieFreeze (uint8** buf, uint32* size);
-bool8 S9xMovieUnfreeze (const uint8* buf, uint32 size);
-
-// accessor functions
-bool8 S9xMovieActive ();
-// the following accessors return 0/false if !S9xMovieActive()
-bool8 S9xMovieReadOnly ();
-uint32 S9xMovieGetId ();
-uint32 S9xMovieGetLength ();
-uint32 S9xMovieGetFrameCounter ();
-
-END_EXTERN_C
-
-#endif
diff --git a/source/ppu.cpp b/source/ppu.cpp
index 179838d..3efc28a 100644
--- a/source/ppu.cpp
+++ b/source/ppu.cpp
@@ -101,7 +101,6 @@
#include "sdd1.h"
#include "srtc.h"
#include "spc7110.h"
-#include "movie.h"
#ifndef ZSNES_FX
#include "fxemu.h"
diff --git a/source/snapshot.cpp b/source/snapshot.cpp
index a0575e7..b4be39c 100644
--- a/source/snapshot.cpp
+++ b/source/snapshot.cpp
@@ -113,7 +113,6 @@
#include "srtc.h"
#include "sdd1.h"
#include "spc7110.h"
-#include "movie.h"
extern uint8 *SRAM;
@@ -700,22 +699,6 @@ void S9xFreezeToStream (STREAM stream)
FreezeStruct (stream, "RTC", &rtc_f9, SnapS7RTC, COUNT (SnapS7RTC));
}
- if (S9xMovieActive ())
- {
- uint8* movie_freeze_buf;
- uint32 movie_freeze_size;
-
- S9xMovieFreeze(&movie_freeze_buf, &movie_freeze_size);
- if(movie_freeze_buf)
- {
- struct SnapshotMovieInfo mi;
- mi.MovieInputDataSize = movie_freeze_size;
- FreezeStruct (stream, "MOV", &mi, SnapMovie, COUNT (SnapMovie));
- FreezeBlock (stream, "MID", movie_freeze_buf, movie_freeze_size);
- delete [] movie_freeze_buf;
- }
- }
-
S9xSetSoundMute (FALSE);
#ifdef ZSNES_FX
if (Settings.SuperFX)
@@ -811,28 +794,6 @@ int S9xUnfreezeFromStream (STREAM stream)
break;
}
- if (S9xMovieActive ())
- {
- SnapshotMovieInfo mi;
- if ((result = UnfreezeStruct (stream, "MOV", &mi, SnapMovie, COUNT(SnapMovie))) != SUCCESS)
- {
- result = NOT_A_MOVIE_SNAPSHOT;
- break;
- }
-
- if ((result = UnfreezeBlockCopy (stream, "MID", &local_movie_data, mi.MovieInputDataSize)) != SUCCESS)
- {
- result = NOT_A_MOVIE_SNAPSHOT;
- break;
- }
-
- if (!S9xMovieUnfreeze(local_movie_data, mi.MovieInputDataSize))
- {
- result = WRONG_MOVIE_SNAPSHOT;
- break;
- }
- }
-
result=SUCCESS;
} while(false);
diff --git a/source/snes9x.h b/source/snes9x.h
index 443f518..40b33b9 100644
--- a/source/snes9x.h
+++ b/source/snes9x.h
@@ -111,8 +111,6 @@ extern int cprintf(const char *fmt, ...);
#include "..\zlib\zlib.h"
#endif
-#include "language.h"
-
#include "port.h"
#include "65c816.h"
#include "messages.h"