add reset/poweron/etc column to movie format

This commit is contained in:
zeromus 2008-06-12 05:07:30 +00:00
parent a1773fc087
commit 043aabf009
2 changed files with 23 additions and 0 deletions

View File

@ -128,6 +128,10 @@ void MovieRecord::parse(MovieData* md, std::istream* is)
{
//by the time we get in here, the initial pipe has already been extracted
//extract the commands
*is >> commands;
is->get(); //eat the pipe
//a special case: if fourscore is enabled, parse four gamepads
if(md->fourscore)
{
@ -168,6 +172,9 @@ void MovieRecord::dump(MovieData* md, std::ostream* os, int index)
//fputc('|',fp);
//fprintf(fp,"%08d",index);
//dump the misc commands
*os << setw(1) << commands << '|';
//a special case: if fourscore is enabled, dump four gamepads
if(md->fourscore)
{
@ -669,6 +676,11 @@ void FCEUMOV_AddInputState()
else
{
MovieRecord* mr = &currMovieData.records[currFrameCounter];
//reset if necessary
if(mr->command_reset())
ResetNES();
joyports[0].load(mr);
joyports[1].load(mr);
}

View File

@ -20,6 +20,11 @@ enum EMOVIEMODE
MOVIEMODE_TASEDIT = 8
};
enum EMOVIECMD
{
MOVIECMD_RESET = 1,
};
EMOVIEMODE FCEUMOV_Mode();
bool FCEUMOV_Mode(EMOVIEMODE modemask);
bool FCEUMOV_Mode(int modemask);
@ -46,6 +51,12 @@ public:
uint8 x,y,b;
} zappers[2];
//misc commands like reset, etc.
//small now to save space; we might need to support more commands later.
//the disk format will support up to 64bit if necessary
uint8 commands;
bool command_reset() { return (commands&MOVIECMD_RESET)!=0; }
void toggleBit(int joy, int bit)
{
joysticks[joy] ^= mask(bit);