changeset 39:3e36553d0cbf

got some speedruns to work!
author Robert McIntyre <rlm@mit.edu>
date Mon, 05 Mar 2012 16:37:38 -0600
parents b374503a5b31
children dba83a5d0835
files src/common/movie.cpp src/gb/GB.cpp src/sdl/SDL.cpp
diffstat 3 files changed, 32 insertions(+), 29 deletions(-) [+]
line wrap: on
line diff
     1.1 --- a/src/common/movie.cpp	Mon Mar 05 15:06:22 2012 -0600
     1.2 +++ b/src/common/movie.cpp	Mon Mar 05 16:37:38 2012 -0600
     1.3 @@ -928,7 +928,7 @@
     1.4      change_state(MOVIE_STATE_NONE);  // stop current movie when we're able to open the other one
     1.5  
     1.6    // clear out the current movie
     1.7 -  printf("RLM: movie init\n");
     1.8 +  //printf("RLM: movie init\n");
     1.9  
    1.10    VBAMovieInit();
    1.11  
    1.12 @@ -949,16 +949,16 @@
    1.13    // set ROM and BIOS checksums and stuff
    1.14    VBAMovieGetRomInfo(Movie, Movie.header.romTitle, Movie.header.romGameCode, Movie.header.romOrBiosChecksum, Movie.header.romCRC);
    1.15  	
    1.16 -  printf("RLM: Writing movie header\n");
    1.17 +  //printf("RLM: Writing movie header\n");
    1.18    // write the header to file
    1.19    write_movie_header(file, Movie);
    1.20  
    1.21 -  printf("RLM: setting metadata\n");
    1.22 +  //printf("RLM: setting metadata\n");
    1.23  
    1.24    // copy over the metadata / author info
    1.25    VBAMovieSetMetadata("________________Robert  McIntyre______________________________________________________________________________________________________________________________________________________________________________________________________________________");
    1.26  	
    1.27 -  printf("RLM: writing metadata\n");
    1.28 +  //printf("RLM: writing metadata\n");
    1.29  
    1.30    // write the metadata / author info to file
    1.31  
    1.32 @@ -1169,7 +1169,7 @@
    1.33  void VBAMovieUpdateState()
    1.34  {
    1.35    ++Movie.currentFrame;
    1.36 -  printf("RLM: inside updateState\n");
    1.37 +  //printf("RLM: inside updateState\n");
    1.38    if (Movie.state == MOVIE_STATE_PLAY)
    1.39      {
    1.40        Movie.inputBufferPtr += Movie.bytesPerFrame;
    1.41 @@ -1181,14 +1181,14 @@
    1.42      }
    1.43    else if (Movie.state == MOVIE_STATE_RECORD)
    1.44      {
    1.45 -      printf("RLM: Movie_STATE_RECORD\n");
    1.46 +      //printf("RLM: Movie_STATE_RECORD\n");
    1.47        VBAMovieWrite(0,true);
    1.48        // use first fseek?
    1.49        //TODO: THis is the problem.
    1.50        if (Movie.inputBuffer){
    1.51  	fwrite(Movie.inputBufferPtr, 1, Movie.bytesPerFrame, Movie.file);
    1.52        }
    1.53 -      printf("RLM: write successful.\n");
    1.54 +      //printf("RLM: write successful.\n");
    1.55        Movie.header.length_frames = Movie.currentFrame;
    1.56        Movie.inputBufferPtr	 += Movie.bytesPerFrame;
    1.57        Movie.RecordedThisSession = true;
    1.58 @@ -1216,9 +1216,12 @@
    1.59      {
    1.60        currentButtons[i] = 0;        // pretend the controller is disconnected
    1.61      }
    1.62 -
    1.63 -  if ((currentButtons[i] & BUTTON_MASK_NEW_RESET) != 0)
    1.64 +  
    1.65 +  printf("RLM: button %d\n",currentButtons[i]);
    1.66 +  if ((currentButtons[i] & BUTTON_MASK_NEW_RESET) != 0){
    1.67 +    printf("RLM: reset signaled\n");
    1.68      resetSignaled = true;
    1.69 +  }
    1.70  }
    1.71  
    1.72  void VBAMovieWrite(int i, bool /*sensor*/)
    1.73 @@ -1235,7 +1238,7 @@
    1.74      {
    1.75        // get the current controller data
    1.76        uint16 buttonData = currentButtons[i];
    1.77 -      printf("RLM: currentButtons %i\n", currentButtons[0]);
    1.78 +      //printf("RLM: currentButtons %i\n", currentButtons[0]);
    1.79  
    1.80        // mask away the irrelevent bits
    1.81        buttonData &= BUTTON_REGULAR_MASK | BUTTON_MOTION_MASK;
    1.82 @@ -1669,7 +1672,7 @@
    1.83  
    1.84        fflush(Movie.file);
    1.85      }
    1.86 -  printf("RLM: setMetadata called\n");
    1.87 +  //printf("RLM: setMetadata called\n");
    1.88  
    1.89  }
    1.90  
     2.1 --- a/src/gb/GB.cpp	Mon Mar 05 15:06:22 2012 -0600
     2.2 +++ b/src/gb/GB.cpp	Mon Mar 05 16:37:38 2012 -0600
     2.3 @@ -3153,7 +3153,7 @@
     2.4  
     2.5  void gbEmulate(int ticksToStop)
     2.6  {
     2.7 -  printf("RLM: Inside the GB!\n");
     2.8 +  //printf("RLM: Inside the GB!\n");
     2.9    gbRegister tempRegister;
    2.10    u8		   tempValue;
    2.11    s8		   offset;
    2.12 @@ -3164,12 +3164,12 @@
    2.13    register int opcode = 0;
    2.14  
    2.15    u32 newmask = 0;
    2.16 -  printf("RLM: newframe = %d\n", newFrame);
    2.17 +  //printf("RLM: newframe = %d\n", newFrame);
    2.18    if (newFrame)
    2.19      {
    2.20        extern void VBAOnExitingFrameBoundary();
    2.21        VBAOnExitingFrameBoundary();
    2.22 -      printf("RLM: exiting frame boundary?\n");
    2.23 +      //printf("RLM: exiting frame boundary?\n");
    2.24        // update joystick information
    2.25        systemReadJoypads();
    2.26  
    2.27 @@ -3212,9 +3212,9 @@
    2.28        speedup	   = (extButtons & 1) != 0;
    2.29  
    2.30        VBAMovieResetIfRequested();
    2.31 -      printf("RLM: before Lua functions\n");
    2.32 +      //printf("RLM: before Lua functions\n");
    2.33        //CallRegisteredLuaFunctions(LUACALL_BEFOREEMULATION);
    2.34 -      printf("RLM: after Lua functions\n");
    2.35 +      //printf("RLM: after Lua functions\n");
    2.36        newFrame = false;
    2.37      }
    2.38  
     3.1 --- a/src/sdl/SDL.cpp	Mon Mar 05 15:06:22 2012 -0600
     3.2 +++ b/src/sdl/SDL.cpp	Mon Mar 05 16:37:38 2012 -0600
     3.3 @@ -1966,8 +1966,8 @@
     3.4  
     3.5  void file_run()
     3.6  {
     3.7 -  printf("RLM: file_run\n");
     3.8 -    utilGetBaseName(szFile, filename);
     3.9 +  //printf("RLM: file_run\n");
    3.10 +  utilGetBaseName(szFile, filename);
    3.11      char *p = strrchr(filename, '.');
    3.12  
    3.13      if(p)
    3.14 @@ -1990,7 +1990,7 @@
    3.15        failed = !gbLoadRom(szFile);
    3.16        if(!failed) {
    3.17          systemCartridgeType = 1;
    3.18 -        printf("RLM: choosing GBSystem\n");
    3.19 +        //printf("RLM: choosing GBSystem\n");
    3.20  	theEmulator = GBSystem;
    3.21          if(sdlAutoIPS) {
    3.22            int size = gbRomSize;
    3.23 @@ -2273,8 +2273,8 @@
    3.24      }
    3.25    }
    3.26  
    3.27 -  printf("RLM: derpy loves you!\n");
    3.28 -  printf("RLM: useMovie: %d (1 is record)\n", useMovie);
    3.29 +  //printf("RLM: derpy loves you!\n");
    3.30 +  //printf("RLM: useMovie: %d (1 is record)\n", useMovie);
    3.31    if(sdlPrintUsage) {
    3.32      usage(argv[0]);
    3.33      exit(-1);
    3.34 @@ -2321,7 +2321,7 @@
    3.35    {
    3.36        szFile = argv[optind];
    3.37        file_run();
    3.38 -      printf("RLM: file_run() done\n");
    3.39 +      //printf("RLM: file_run() done\n");
    3.40    }
    3.41     else 
    3.42    {
    3.43 @@ -2620,7 +2620,7 @@
    3.44      soundInit();
    3.45  
    3.46    autoFrameSkipLastTime = throttleLastTime = systemGetClock();
    3.47 -  printf("RLM: and now for the movie part!\n");
    3.48 +  //printf("RLM: and now for the movie part!\n");
    3.49  
    3.50    switch(useMovie)
    3.51    {
    3.52 @@ -2641,7 +2641,7 @@
    3.53      	sdlReadBattery();
    3.54    	  break;
    3.55    }
    3.56 -  printf("RLM: still alive after movie switch\n");
    3.57 +  //printf("RLM: still alive after movie switch\n");
    3.58    SDL_WM_SetCaption("VisualBoyAdvance", NULL);
    3.59    
    3.60    char *moviefile = getenv("AUTODEMO");
    3.61 @@ -2657,9 +2657,9 @@
    3.62        if(debugger && theEmulator.emuHasDebugger)
    3.63          dbgMain();
    3.64        else {
    3.65 -	printf("RLM: emulator main\n");
    3.66 +	//printf("RLM: emulator main\n");
    3.67  	theEmulator.emuMain(theEmulator.emuCount);
    3.68 -	printf("RLM: emulator main called\n");
    3.69 +	//printf("RLM: emulator main called\n");
    3.70          if(rewindSaveNeeded && rewindMemory && theEmulator.emuWriteMemState) {
    3.71            rewindCount++;
    3.72            if(rewindCount > 8)
    3.73 @@ -3614,7 +3614,7 @@
    3.74  
    3.75  void VBAOnEnteringFrameBoundary()
    3.76  {
    3.77 -  printf("RLM: Entering Frame Boundary\n");
    3.78 +  //printf("RLM: Entering Frame Boundary\n");
    3.79    CallRegisteredLuaFunctions(LUACALL_AFTEREMULATION);
    3.80  
    3.81    if (VBALuaRunning())
    3.82 @@ -3622,9 +3622,9 @@
    3.83  	  VBALuaFrameBoundary();
    3.84    	}
    3.85  
    3.86 -  printf("RLM: Movie state update pending\n");
    3.87 +  //printf("RLM: Movie state update pending\n");
    3.88    VBAMovieUpdateState();
    3.89 -  printf("RLM: Movie state updated\n");
    3.90 +  //printf("RLM: Movie state updated\n");
    3.91  }
    3.92  
    3.93  void VBAOnExitingFrameBoundary()