diff src/common/movie.cpp @ 36:47a513ea3529

getting something now when recording movies
author Robert McIntyre <rlm@mit.edu>
date Mon, 05 Mar 2012 14:47:45 -0600
parents b82b18185103
children 3e36553d0cbf
line wrap: on
line diff
     1.1 --- a/src/common/movie.cpp	Mon Mar 05 14:26:45 2012 -0600
     1.2 +++ b/src/common/movie.cpp	Mon Mar 05 14:47:45 2012 -0600
     1.3 @@ -54,7 +54,7 @@
     1.4  #endif
     1.5  
     1.6  extern int emulating; // from system.cpp
     1.7 -extern u16 currentButtons[4];     // from System.cpp
     1.8 +extern u16 currentButtons[4];     // from SDL.cpp
     1.9  extern u16 lastKeys;
    1.10  
    1.11  SMovie Movie;
    1.12 @@ -63,7 +63,7 @@
    1.13  // probably bad idea to have so many global variables, but I hate to recompile almost everything after editing VBA.h
    1.14  bool autoConvertMovieWhenPlaying = false;
    1.15  
    1.16 -static u16 initialInputs[4] = { 0 };
    1.17 +static u16 initialInputs[4] = { 0, 0, 0, 0 };
    1.18  
    1.19  static bool resetSignaled	  = false;
    1.20  static bool resetSignaledLast = false;
    1.21 @@ -1182,6 +1182,7 @@
    1.22    else if (Movie.state == MOVIE_STATE_RECORD)
    1.23      {
    1.24        printf("RLM: Movie_STATE_RECORD\n");
    1.25 +      VBAMovieWrite(0,true);
    1.26        // use first fseek?
    1.27        //TODO: THis is the problem.
    1.28        if (Movie.inputBuffer){
    1.29 @@ -1230,10 +1231,11 @@
    1.30  
    1.31    reserve_buffer_space((uint32)((Movie.inputBufferPtr - Movie.inputBuffer) + Movie.bytesPerFrame));
    1.32  
    1.33 -  if (Movie.header.controllerFlags & MOVIE_CONTROLLER(i))
    1.34 +  if (Movie.header.controllerFlags)
    1.35      {
    1.36        // get the current controller data
    1.37        uint16 buttonData = currentButtons[i];
    1.38 +      printf("RLM: currentButtons %i\n", currentButtons[0]);
    1.39  
    1.40        // mask away the irrelevent bits
    1.41        buttonData &= BUTTON_REGULAR_MASK | BUTTON_MOTION_MASK;