reset/power recording and playback support.
This commit is contained in:
parent
b39baa43ee
commit
6f4928726e
|
@ -944,6 +944,7 @@ bool FCEU_IsValidUI(EFCEUI ui)
|
|||
|
||||
case FCEUI_POWER:
|
||||
if(!GameInfo) return false;
|
||||
if(FCEUMOV_Mode(MOVIEMODE_RECORD)) return true;
|
||||
if(!FCEUMOV_Mode(MOVIEMODE_INACTIVE)) return false;
|
||||
break;
|
||||
|
||||
|
@ -995,7 +996,7 @@ class NROM : FCEUXCart {
|
|||
public:
|
||||
virtual void Power() {
|
||||
SetReadHandler(0x8000,0xFFFF,CartBR);
|
||||
setprg16(0x8000,0);
|
||||
setprg16(0x8000,0);
|
||||
setprg16(0xC000,~0);
|
||||
setchr8(0);
|
||||
|
||||
|
|
|
@ -831,6 +831,8 @@ void FCEUI_SaveMovie(const char *fname, EMOVIE_FLAG flags, std::wstring author)
|
|||
FCEU_DispMessage("Movie recording started.");
|
||||
}
|
||||
|
||||
static int _currCommand = 0;
|
||||
|
||||
//the main interaction point between the emulator and the movie system.
|
||||
//either dumps the current joystick state or loads one state from the movie
|
||||
void FCEUMOV_AddInputState()
|
||||
|
@ -870,7 +872,10 @@ void FCEUMOV_AddInputState()
|
|||
{
|
||||
MovieRecord* mr = &currMovieData.records[currFrameCounter];
|
||||
|
||||
//reset if necessary
|
||||
//reset and power cycle if necessary
|
||||
if(mr->command_power())
|
||||
PowerNES();
|
||||
|
||||
if(mr->command_reset())
|
||||
ResetNES();
|
||||
|
||||
|
@ -901,7 +906,8 @@ void FCEUMOV_AddInputState()
|
|||
|
||||
joyports[0].log(&mr);
|
||||
joyports[1].log(&mr);
|
||||
mr.commands = 0;
|
||||
mr.commands = _currCommand;
|
||||
_currCommand = 0;
|
||||
|
||||
mr.dump(&currMovieData, osRecordingMovie,currMovieData.records.size());
|
||||
currMovieData.records.push_back(mr);
|
||||
|
@ -920,11 +926,11 @@ void FCEUMOV_AddCommand(int cmd)
|
|||
// do nothing if not recording a movie
|
||||
if(movieMode != MOVIEMODE_RECORD)
|
||||
return;
|
||||
|
||||
//printf("%d\n",cmd);
|
||||
|
||||
//MBG TODO BIG TODO TODO TODO
|
||||
//DoEncode((cmd>>3)&0x3,cmd&0x7,1);
|
||||
//NOTE: EMOVIECMD matches FCEUNPCMD_RESET and FCEUNPCMD_POWER
|
||||
//we are lucky (well, I planned it that way)
|
||||
|
||||
_currCommand |= cmd;
|
||||
}
|
||||
|
||||
void FCEU_DrawMovies(uint8 *XBuf)
|
||||
|
|
|
@ -61,6 +61,7 @@ enum EMOVIEMODE
|
|||
enum EMOVIECMD
|
||||
{
|
||||
MOVIECMD_RESET = 1,
|
||||
MOVIECMD_POWER = 2,
|
||||
};
|
||||
|
||||
EMOVIEMODE FCEUMOV_Mode();
|
||||
|
@ -97,6 +98,7 @@ public:
|
|||
//the disk format will support up to 64bit if necessary
|
||||
uint8 commands;
|
||||
bool command_reset() { return (commands&MOVIECMD_RESET)!=0; }
|
||||
bool command_power() { return (commands&MOVIECMD_POWER)!=0; }
|
||||
|
||||
void toggleBit(int joy, int bit)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue