diff src/sdl/SDL.cpp @ 33:44974c3e093b

found source of problem for video recording
author Robert McIntyre <rlm@mit.edu>
date Mon, 05 Mar 2012 01:25:11 -0600
parents 48369c6aeaa0
children 3e36553d0cbf
line wrap: on
line diff
     1.1 --- a/src/sdl/SDL.cpp	Sun Mar 04 22:44:42 2012 -0600
     1.2 +++ b/src/sdl/SDL.cpp	Mon Mar 05 01:25:11 2012 -0600
     1.3 @@ -1966,6 +1966,7 @@
     1.4  
     1.5  void file_run()
     1.6  {
     1.7 +  printf("RLM: file_run\n");
     1.8      utilGetBaseName(szFile, filename);
     1.9      char *p = strrchr(filename, '.');
    1.10  
    1.11 @@ -1989,7 +1990,8 @@
    1.12        failed = !gbLoadRom(szFile);
    1.13        if(!failed) {
    1.14          systemCartridgeType = 1;
    1.15 -        theEmulator = GBSystem;
    1.16 +        printf("RLM: choosing GBSystem\n");
    1.17 +	theEmulator = GBSystem;
    1.18          if(sdlAutoIPS) {
    1.19            int size = gbRomSize;
    1.20            utilApplyIPS(ipsname, &gbRom, &size);
    1.21 @@ -2007,7 +2009,7 @@
    1.22          //        if(cpuEnhancedDetection && cpuSaveType == 0) {
    1.23          //          utilGBAFindSave(rom, size);
    1.24          //        }
    1.25 -
    1.26 +	
    1.27          sdlApplyPerImagePreferences();
    1.28          
    1.29          systemCartridgeType = 0;
    1.30 @@ -2183,7 +2185,7 @@
    1.31        
    1.32      case 'r':
    1.33        if(optarg == NULL) {
    1.34 -        fprintf(stderr, "ERROR: --recordMovie ('r') needs movie filename as option\n");
    1.35 +        fprintf(stderr, "ERROR: --recordmovie ('r') needs movie filename as option\n");
    1.36          exit(-1);
    1.37        }
    1.38          strcpy(movieFileName, optarg);
    1.39 @@ -2192,7 +2194,7 @@
    1.40      case 'p': // play without read-only (editable)
    1.41        fprintf (stderr, "-p got called!\n");
    1.42        if(optarg == NULL) {
    1.43 -        fprintf(stderr, "ERROR: --playMovie ('p') needs movie filename as option\n");
    1.44 +        fprintf(stderr, "ERROR: --playmovie ('p') needs movie filename as option\n");
    1.45          exit(-1);
    1.46        }
    1.47          strcpy(movieFileName, optarg);
    1.48 @@ -2201,7 +2203,7 @@
    1.49      case 'w': // play with read-only
    1.50       fprintf (stderr, "-w got called!\n"); 
    1.51        if(optarg == NULL) {
    1.52 -        fprintf(stderr, "ERROR: --watchMovie ('w') needs movie filename as option\n");
    1.53 +        fprintf(stderr, "ERROR: --watchmovie ('w') needs movie filename as option\n");
    1.54          exit(-1);
    1.55        }
    1.56          strcpy(movieFileName, optarg);
    1.57 @@ -2271,6 +2273,8 @@
    1.58      }
    1.59    }
    1.60  
    1.61 +  printf("RLM: derpy loves you!\n");
    1.62 +  printf("RLM: useMovie: %d (1 is record)\n", useMovie);
    1.63    if(sdlPrintUsage) {
    1.64      usage(argv[0]);
    1.65      exit(-1);
    1.66 @@ -2317,6 +2321,7 @@
    1.67    {
    1.68        szFile = argv[optind];
    1.69        file_run();
    1.70 +      printf("RLM: file_run() done\n");
    1.71    }
    1.72     else 
    1.73    {
    1.74 @@ -2336,7 +2341,7 @@
    1.75      
    1.76      //CPUInit(biosFileName, useBios);
    1.77      CPUInit();
    1.78 -    CPUReset();    
    1.79 +    CPUReset();
    1.80    }
    1.81    
    1.82    if(debuggerStub) 
    1.83 @@ -2615,6 +2620,7 @@
    1.84      soundInit();
    1.85  
    1.86    autoFrameSkipLastTime = throttleLastTime = systemGetClock();
    1.87 +  printf("RLM: and now for the movie part!\n");
    1.88  
    1.89    switch(useMovie)
    1.90    {
    1.91 @@ -2635,13 +2641,14 @@
    1.92      	sdlReadBattery();
    1.93    	  break;
    1.94    }
    1.95 +  printf("RLM: still alive after movie switch\n");
    1.96    SDL_WM_SetCaption("VisualBoyAdvance", NULL);
    1.97    
    1.98    char *moviefile = getenv("AUTODEMO");
    1.99 -//  fprintf (stderr, "Checking for AUTODEMO...\n");
   1.100 +  fprintf (stderr, "Checking for AUTODEMO...\n");
   1.101    if (moviefile)
   1.102    {
   1.103 -//    fprintf (stderr, "I got a filename OMG!\nCalling VBAMovieOpen...\n");
   1.104 +    fprintf (stderr, "I got a filename OMG!\nCalling VBAMovieOpen...\n");
   1.105      VBAMovieOpen(moviefile, true);
   1.106    }
   1.107  
   1.108 @@ -2650,7 +2657,9 @@
   1.109        if(debugger && theEmulator.emuHasDebugger)
   1.110          dbgMain();
   1.111        else {
   1.112 -        theEmulator.emuMain(theEmulator.emuCount);
   1.113 +	printf("RLM: emulator main\n");
   1.114 +	theEmulator.emuMain(theEmulator.emuCount);
   1.115 +	printf("RLM: emulator main called\n");
   1.116          if(rewindSaveNeeded && rewindMemory && theEmulator.emuWriteMemState) {
   1.117            rewindCount++;
   1.118            if(rewindCount > 8)
   1.119 @@ -3605,14 +3614,17 @@
   1.120  
   1.121  void VBAOnEnteringFrameBoundary()
   1.122  {
   1.123 -	CallRegisteredLuaFunctions(LUACALL_AFTEREMULATION);
   1.124 -
   1.125 -	if (VBALuaRunning())
   1.126 -	{
   1.127 -		VBALuaFrameBoundary();
   1.128 -	}
   1.129 -
   1.130 -	VBAMovieUpdateState();
   1.131 +  printf("RLM: Entering Frame Boundary\n");
   1.132 +  CallRegisteredLuaFunctions(LUACALL_AFTEREMULATION);
   1.133 +
   1.134 +  if (VBALuaRunning())
   1.135 +  	{
   1.136 +	  VBALuaFrameBoundary();
   1.137 +  	}
   1.138 +
   1.139 +  printf("RLM: Movie state update pending\n");
   1.140 +  VBAMovieUpdateState();
   1.141 +  printf("RLM: Movie state updated\n");
   1.142  }
   1.143  
   1.144  void VBAOnExitingFrameBoundary()