try fixing zapper movies again
This commit is contained in:
parent
c8e3eef74d
commit
105a3e2516
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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('|');
|
||||
}
|
||||
|
|
|
@ -50,6 +50,7 @@ public:
|
|||
|
||||
struct {
|
||||
uint8 x,y,b,bogo;
|
||||
uint64 zaphit;
|
||||
} zappers[2];
|
||||
|
||||
//misc commands like reset, etc.
|
||||
|
|
Loading…
Reference in New Issue