# HG changeset patch # User Robert McIntyre # Date 1330987058 21600 # Node ID 3e36553d0cbf80d23db63764dd958d6683831455 # Parent b374503a5b3151357941475cb69b6e61c8066c63 got some speedruns to work! diff -r b374503a5b31 -r 3e36553d0cbf src/common/movie.cpp --- a/src/common/movie.cpp Mon Mar 05 15:06:22 2012 -0600 +++ b/src/common/movie.cpp Mon Mar 05 16:37:38 2012 -0600 @@ -928,7 +928,7 @@ change_state(MOVIE_STATE_NONE); // stop current movie when we're able to open the other one // clear out the current movie - printf("RLM: movie init\n"); + //printf("RLM: movie init\n"); VBAMovieInit(); @@ -949,16 +949,16 @@ // set ROM and BIOS checksums and stuff VBAMovieGetRomInfo(Movie, Movie.header.romTitle, Movie.header.romGameCode, Movie.header.romOrBiosChecksum, Movie.header.romCRC); - printf("RLM: Writing movie header\n"); + //printf("RLM: Writing movie header\n"); // write the header to file write_movie_header(file, Movie); - printf("RLM: setting metadata\n"); + //printf("RLM: setting metadata\n"); // copy over the metadata / author info VBAMovieSetMetadata("________________Robert McIntyre______________________________________________________________________________________________________________________________________________________________________________________________________________________"); - printf("RLM: writing metadata\n"); + //printf("RLM: writing metadata\n"); // write the metadata / author info to file @@ -1169,7 +1169,7 @@ void VBAMovieUpdateState() { ++Movie.currentFrame; - printf("RLM: inside updateState\n"); + //printf("RLM: inside updateState\n"); if (Movie.state == MOVIE_STATE_PLAY) { Movie.inputBufferPtr += Movie.bytesPerFrame; @@ -1181,14 +1181,14 @@ } else if (Movie.state == MOVIE_STATE_RECORD) { - printf("RLM: Movie_STATE_RECORD\n"); + //printf("RLM: Movie_STATE_RECORD\n"); VBAMovieWrite(0,true); // use first fseek? //TODO: THis is the problem. if (Movie.inputBuffer){ fwrite(Movie.inputBufferPtr, 1, Movie.bytesPerFrame, Movie.file); } - printf("RLM: write successful.\n"); + //printf("RLM: write successful.\n"); Movie.header.length_frames = Movie.currentFrame; Movie.inputBufferPtr += Movie.bytesPerFrame; Movie.RecordedThisSession = true; @@ -1216,9 +1216,12 @@ { currentButtons[i] = 0; // pretend the controller is disconnected } - - if ((currentButtons[i] & BUTTON_MASK_NEW_RESET) != 0) + + printf("RLM: button %d\n",currentButtons[i]); + if ((currentButtons[i] & BUTTON_MASK_NEW_RESET) != 0){ + printf("RLM: reset signaled\n"); resetSignaled = true; + } } void VBAMovieWrite(int i, bool /*sensor*/) @@ -1235,7 +1238,7 @@ { // get the current controller data uint16 buttonData = currentButtons[i]; - printf("RLM: currentButtons %i\n", currentButtons[0]); + //printf("RLM: currentButtons %i\n", currentButtons[0]); // mask away the irrelevent bits buttonData &= BUTTON_REGULAR_MASK | BUTTON_MOTION_MASK; @@ -1669,7 +1672,7 @@ fflush(Movie.file); } - printf("RLM: setMetadata called\n"); + //printf("RLM: setMetadata called\n"); } diff -r b374503a5b31 -r 3e36553d0cbf src/gb/GB.cpp --- a/src/gb/GB.cpp Mon Mar 05 15:06:22 2012 -0600 +++ b/src/gb/GB.cpp Mon Mar 05 16:37:38 2012 -0600 @@ -3153,7 +3153,7 @@ void gbEmulate(int ticksToStop) { - printf("RLM: Inside the GB!\n"); + //printf("RLM: Inside the GB!\n"); gbRegister tempRegister; u8 tempValue; s8 offset; @@ -3164,12 +3164,12 @@ register int opcode = 0; u32 newmask = 0; - printf("RLM: newframe = %d\n", newFrame); + //printf("RLM: newframe = %d\n", newFrame); if (newFrame) { extern void VBAOnExitingFrameBoundary(); VBAOnExitingFrameBoundary(); - printf("RLM: exiting frame boundary?\n"); + //printf("RLM: exiting frame boundary?\n"); // update joystick information systemReadJoypads(); @@ -3212,9 +3212,9 @@ speedup = (extButtons & 1) != 0; VBAMovieResetIfRequested(); - printf("RLM: before Lua functions\n"); + //printf("RLM: before Lua functions\n"); //CallRegisteredLuaFunctions(LUACALL_BEFOREEMULATION); - printf("RLM: after Lua functions\n"); + //printf("RLM: after Lua functions\n"); newFrame = false; } diff -r b374503a5b31 -r 3e36553d0cbf src/sdl/SDL.cpp --- a/src/sdl/SDL.cpp Mon Mar 05 15:06:22 2012 -0600 +++ b/src/sdl/SDL.cpp Mon Mar 05 16:37:38 2012 -0600 @@ -1966,8 +1966,8 @@ void file_run() { - printf("RLM: file_run\n"); - utilGetBaseName(szFile, filename); + //printf("RLM: file_run\n"); + utilGetBaseName(szFile, filename); char *p = strrchr(filename, '.'); if(p) @@ -1990,7 +1990,7 @@ failed = !gbLoadRom(szFile); if(!failed) { systemCartridgeType = 1; - printf("RLM: choosing GBSystem\n"); + //printf("RLM: choosing GBSystem\n"); theEmulator = GBSystem; if(sdlAutoIPS) { int size = gbRomSize; @@ -2273,8 +2273,8 @@ } } - printf("RLM: derpy loves you!\n"); - printf("RLM: useMovie: %d (1 is record)\n", useMovie); + //printf("RLM: derpy loves you!\n"); + //printf("RLM: useMovie: %d (1 is record)\n", useMovie); if(sdlPrintUsage) { usage(argv[0]); exit(-1); @@ -2321,7 +2321,7 @@ { szFile = argv[optind]; file_run(); - printf("RLM: file_run() done\n"); + //printf("RLM: file_run() done\n"); } else { @@ -2620,7 +2620,7 @@ soundInit(); autoFrameSkipLastTime = throttleLastTime = systemGetClock(); - printf("RLM: and now for the movie part!\n"); + //printf("RLM: and now for the movie part!\n"); switch(useMovie) { @@ -2641,7 +2641,7 @@ sdlReadBattery(); break; } - printf("RLM: still alive after movie switch\n"); + //printf("RLM: still alive after movie switch\n"); SDL_WM_SetCaption("VisualBoyAdvance", NULL); char *moviefile = getenv("AUTODEMO"); @@ -2657,9 +2657,9 @@ if(debugger && theEmulator.emuHasDebugger) dbgMain(); else { - printf("RLM: emulator main\n"); + //printf("RLM: emulator main\n"); theEmulator.emuMain(theEmulator.emuCount); - printf("RLM: emulator main called\n"); + //printf("RLM: emulator main called\n"); if(rewindSaveNeeded && rewindMemory && theEmulator.emuWriteMemState) { rewindCount++; if(rewindCount > 8) @@ -3614,7 +3614,7 @@ void VBAOnEnteringFrameBoundary() { - printf("RLM: Entering Frame Boundary\n"); + //printf("RLM: Entering Frame Boundary\n"); CallRegisteredLuaFunctions(LUACALL_AFTEREMULATION); if (VBALuaRunning()) @@ -3622,9 +3622,9 @@ VBALuaFrameBoundary(); } - printf("RLM: Movie state update pending\n"); + //printf("RLM: Movie state update pending\n"); VBAMovieUpdateState(); - printf("RLM: Movie state updated\n"); + //printf("RLM: Movie state updated\n"); } void VBAOnExitingFrameBoundary()