diff --git a/src/drivers/win/main.cpp b/src/drivers/win/main.cpp index 35b08843..bd391c6b 100644 --- a/src/drivers/win/main.cpp +++ b/src/drivers/win/main.cpp @@ -561,8 +561,6 @@ int main(int argc,char *argv[]) ApplyDefaultCommandMapping(); - srand(GetTickCount()); // rand() is used for some GUI sillyness. - fceu_hInstance = GetModuleHandle(0); // Get the base directory diff --git a/src/fceu.cpp b/src/fceu.cpp index 99ab9a67..881f30af 100644 --- a/src/fceu.cpp +++ b/src/fceu.cpp @@ -19,34 +19,35 @@ */ #include -#include -#include -#include -#include -#include "types.h" -#include "x6502.h" -#include "fceu.h" -#include "ppu.h" -#include "sound.h" -#include "netplay.h" -#include "file.h" -#include "utils/endian.h" -#include "utils/memory.h" -#include "utils/crc32.h" +#include +#include +#include +#include +#include +#include "types.h" +#include "x6502.h" +#include "fceu.h" +#include "ppu.h" +#include "sound.h" +#include "netplay.h" +#include "file.h" +#include "utils/endian.h" +#include "utils/memory.h" +#include "utils/crc32.h" -#include "cart.h" -#include "nsf.h" -#include "fds.h" -#include "ines.h" -#include "unif.h" -#include "cheat.h" -#include "palette.h" -#include "state.h" -#include "movie.h" -#include "video.h" -#include "input.h" -#include "file.h" -#include "vsuni.h" +#include "cart.h" +#include "nsf.h" +#include "fds.h" +#include "ines.h" +#include "unif.h" +#include "cheat.h" +#include "palette.h" +#include "state.h" +#include "movie.h" +#include "video.h" +#include "input.h" +#include "file.h" +#include "vsuni.h" //TODO - we really need some kind of global platform-specific options api #ifdef WIN32 @@ -396,6 +397,8 @@ FCEUGI *FCEUI_LoadGame(const char *name, int OverwriteVidMode) **/ int FCEUI_Initialize(void) { + srand(time(0)); + if(!FCEU_InitVirtualVideo()) { return 0; diff --git a/src/movie.cpp b/src/movie.cpp index 0dac22b2..e1e788ac 100644 --- a/src/movie.cpp +++ b/src/movie.cpp @@ -738,9 +738,15 @@ int FCEUMOV_ReadState(FILE* st, uint32 size) LoadFM2(currMovieData, tmp); fclose(tmp); - //todo - switch to recording - - movieMode = MOVIEMODE_PLAY; + //complex TAS logic for when a savestate is loaded: + //if we are playing: + // then, the movie we are playing must match the one stored in the savestate. + //if we are recording: + // then, the movie we are playing must match the one stored in the savestate. + //if we are doing neither: + // then, we must discard this movie + + //movieMode = MOVIEMODE_PLAY; load_successful = true; //// if this savestate was made while replaying,