From 0cc0e4739bd75da20e94d28bdcdaa32cd1bfabf9 Mon Sep 17 00:00:00 2001 From: zeromus Date: Sat, 2 May 2009 17:57:06 +0000 Subject: [PATCH] fix compile errors in movie.cpp --- desmume/src/NDSSystem.cpp | 6 ++++-- desmume/src/NDSSystem.h | 3 ++- desmume/src/movie.cpp | 17 ++++++++--------- desmume/src/windows/main.cpp | 5 +++++ 4 files changed, 19 insertions(+), 12 deletions(-) diff --git a/desmume/src/NDSSystem.cpp b/desmume/src/NDSSystem.cpp index a9c5126a2..c3ed274a5 100644 --- a/desmume/src/NDSSystem.cpp +++ b/desmume/src/NDSSystem.cpp @@ -845,7 +845,10 @@ int NDS_LoadROM( const char *filename, int bmtype, u32 bmsize, return ret; } -void MovieSRAM(int bmtype, u32 bmsize) { +void MovieSRAM() +{ + int bmtype = MMU.bupmem.type; + u32 bmsize = MMU.bupmem.size; char buf[MAX_PATH]; @@ -859,7 +862,6 @@ void MovieSRAM(int bmtype, u32 bmsize) { mc_realloc(&MMU.bupmem, bmtype, bmsize); mc_load_file(&MMU.bupmem, buf); - } void NDS_FreeROM(void) diff --git a/desmume/src/NDSSystem.h b/desmume/src/NDSSystem.h index c4804a2b6..003c12d88 100644 --- a/desmume/src/NDSSystem.h +++ b/desmume/src/NDSSystem.h @@ -385,6 +385,7 @@ public: virtual BOOL WIFI_Host_InitSystem() { return FALSE; } virtual void WIFI_Host_ShutdownSystem() {} virtual BOOL AVI_IsRecording() { return FALSE; } + virtual void USR_InfoMessage(const char *message) { printf(message); } }; extern Driver* driver; @@ -392,7 +393,7 @@ extern std::string InputDisplayString; extern int LagFrameFlag; extern int lastLag, TotalLagFrames; -void MovieSRAM(int bmtype, u32 bmsize); +void MovieSRAM(); void ClearAutoHold(void); diff --git a/desmume/src/movie.cpp b/desmume/src/movie.cpp index 471301658..1461e9cc4 100644 --- a/desmume/src/movie.cpp +++ b/desmume/src/movie.cpp @@ -22,7 +22,6 @@ #include #include #include -#include "main.h" #include "utils/guid.h" #include "utils/xstring.h" #include "movie.h" @@ -355,7 +354,7 @@ static void closeRecordingMovie() /// Stop movie playback. static void StopPlayback() { - SetMessageToDisplay("Movie playback stopped."); + driver->USR_InfoMessage("Movie playback stopped."); movieMode = MOVIEMODE_INACTIVE; } @@ -363,7 +362,7 @@ static void StopPlayback() /// Stop movie recording static void StopRecording() { - SetMessageToDisplay("Movie recording stopped."); + driver->USR_InfoMessage("Movie recording stopped."); movieMode = MOVIEMODE_INACTIVE; closeRecordingMovie(); @@ -436,14 +435,14 @@ void FCEUI_LoadMovie(const char *fname, bool _read_only, bool tasedit, int _paus movieMode = MOVIEMODE_PLAY; currRerecordCount = currMovieData.rerecordCount; InitMovieTime(); - MovieSRAM(backupmemorytype, backupmemorysize); + MovieSRAM(); freshMovie = true; ClearAutoHold(); if(movie_readonly) - SetMessageToDisplay("Replay started Read-Only."); + driver->USR_InfoMessage("Replay started Read-Only."); else - SetMessageToDisplay("Replay started Read+Write."); + driver->USR_InfoMessage("Replay started Read+Write."); } static void openRecordingMovie(const char* fname) @@ -492,9 +491,9 @@ static void openRecordingMovie(const char* fname) movie_readonly = false; currRerecordCount = 0; InitMovieTime(); - MovieSRAM(backupmemorytype, backupmemorysize); - - SetMessageToDisplay("Movie recording started."); + MovieSRAM(); + + driver->USR_InfoMessage("Movie recording started."); } void NDS_setTouchFromMovie(void) { diff --git a/desmume/src/windows/main.cpp b/desmume/src/windows/main.cpp index 455b7abf9..5b6c73cb1 100644 --- a/desmume/src/windows/main.cpp +++ b/desmume/src/windows/main.cpp @@ -1527,6 +1527,11 @@ class WinDriver : public Driver { return ::AVI_IsRecording(); } + + virtual void USR_InfoMessage(const char *message) + { + SetMessageToDisplay(message); + } }; int WINAPI WinMain (HINSTANCE hThisInstance,