From 105a3e25163427294753801501b4a07f91585408 Mon Sep 17 00:00:00 2001 From: zeromus Date: Fri, 20 Jun 2008 00:50:01 +0000 Subject: [PATCH] try fixing zapper movies again --- src/fceu.cpp | 6 +++--- src/input/zapper.cpp | 4 +++- src/movie.cpp | 6 ++++-- src/movie.h | 1 + 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/fceu.cpp b/src/fceu.cpp index ab46bfba..2cac622b 100644 --- a/src/fceu.cpp +++ b/src/fceu.cpp @@ -52,8 +52,8 @@ //TODO - we really need some kind of global platform-specific options api #ifdef WIN32 #include "drivers/win/main.h" -#else -#include "drivers/sdl/sdl.h" +#else +#include "drivers/sdl/sdl.h" #endif static void CloseGame(void) @@ -94,7 +94,7 @@ static void CloseGame(void) GameInfo = 0; } } - + uint64 timestampbase; diff --git a/src/input/zapper.cpp b/src/input/zapper.cpp index 6fb79621..96095522 100644 --- a/src/input/zapper.cpp +++ b/src/input/zapper.cpp @@ -134,7 +134,7 @@ static void UpdateZapper(int w, void *data, int arg) uint32 *ptr=(uint32 *)data; if(ZD[w].bogo) - ZD[w].bogo--; + ZD[w].bogo--; if(ptr[2]&3 && (!(ZD[w].mzb&3))) ZD[w].bogo=5; @@ -149,6 +149,7 @@ static void LogZapper(int w, MovieRecord* mr) mr->zappers[w].y = ZD[w].mzy; mr->zappers[w].b = ZD[w].mzb; mr->zappers[w].bogo = ZD[w].bogo; + mr->zappers[w].zaphit = ZD[w].zaphit; } static void LoadZapper(int w, MovieRecord* mr) @@ -157,6 +158,7 @@ static void LoadZapper(int w, MovieRecord* mr) ZD[w].mzy = mr->zappers[w].y; ZD[w].mzb = mr->zappers[w].b; ZD[w].bogo = mr->zappers[w].bogo; + ZD[w].zaphit = mr->zappers[w].zaphit; } diff --git a/src/movie.cpp b/src/movie.cpp index 639bce07..101bcf57 100644 --- a/src/movie.cpp +++ b/src/movie.cpp @@ -164,12 +164,14 @@ void MovieRecord::parse(MovieData* md, std::istream* is) else if(md->ports[port] == SI_ZAPPER) { int x,y,b,bogo; - *is >> x >> y >> b >> bogo; + uint64 zaphit; + *is >> x >> y >> b >> bogo >> zaphit; //todo: test uintDecFromIstream zappers[port].x = x; zappers[port].y = y; zappers[port].b = b; zappers[port].bogo = bogo; + zappers[port].zaphit = zaphit; } is->get(); //eat the pipe @@ -209,7 +211,7 @@ void MovieRecord::dump(MovieData* md, std::ostream* os, int index) if(md->ports[port] == SI_GAMEPAD) dumpJoy(os, joysticks[port]); else if(md->ports[port] == SI_ZAPPER) - *os << setw(3) << setfill('0') << (int)zappers[port].x << ' ' << setw(3) << setfill('0') << (int)zappers[port].y << setw(1) << ' ' << (int)zappers[port].b << ' ' << (int)zappers[port].bogo; + *os << setw(3) << setfill('0') << (int)zappers[port].x << ' ' << setw(3) << setfill('0') << (int)zappers[port].y << setw(1) << ' ' << (int)zappers[port].b << ' ' << (int)zappers[port].bogo << ' ' << zappers[port].zaphit; } os->put('|'); } diff --git a/src/movie.h b/src/movie.h index b12c6261..56e34520 100644 --- a/src/movie.h +++ b/src/movie.h @@ -50,6 +50,7 @@ public: struct { uint8 x,y,b,bogo; + uint64 zaphit; } zappers[2]; //misc commands like reset, etc.