add fds insert/select recording

This commit is contained in:
zeromus 2009-08-03 22:24:59 +00:00
parent 4c2fe989c8
commit 9813608af3
3 changed files with 20 additions and 0 deletions

View File

@ -35,6 +35,7 @@
#include "cart.h" #include "cart.h"
#include "netplay.h" #include "netplay.h"
#include "driver.h" #include "driver.h"
#include "movie.h"
// TODO: Add code to put a delay in between the time a disk is inserted // TODO: Add code to put a delay in between the time a disk is inserted
// and the when it can be successfully read/written to. This should // and the when it can be successfully read/written to. This should
@ -147,6 +148,7 @@ static void FDSInit(void)
void FCEU_FDSInsert(void) void FCEU_FDSInsert(void)
{ {
FCEUMOV_AddCommand(FCEUNPCMD_FDSINSERT);
if(TotalSides==0) if(TotalSides==0)
{ {
FCEU_DispMessage("Not FDS; can't eject disk."); FCEU_DispMessage("Not FDS; can't eject disk.");
@ -171,6 +173,7 @@ InDisk=255;
*/ */
void FCEU_FDSSelect(void) void FCEU_FDSSelect(void)
{ {
FCEUMOV_AddCommand(FCEUNPCMD_FDSSELECT);
if(TotalSides==0) if(TotalSides==0)
{ {
FCEU_DispMessage("Not FDS; can't select disk."); FCEU_DispMessage("Not FDS; can't select disk.");

View File

@ -14,11 +14,13 @@
#include "palette.h" #include "palette.h"
#include "input.h" #include "input.h"
#include "fceu.h" #include "fceu.h"
#include "netplay.h"
#include "driver.h" #include "driver.h"
#include "state.h" #include "state.h"
#include "file.h" #include "file.h"
#include "video.h" #include "video.h"
#include "movie.h" #include "movie.h"
#include "fds.h"
#ifdef _S9XLUA_H #ifdef _S9XLUA_H
#include "fceulua.h" #include "fceulua.h"
#endif #endif
@ -918,6 +920,12 @@ void FCEUMOV_AddInputState()
if(mr->command_reset()) if(mr->command_reset())
ResetNES(); ResetNES();
if(mr->command_fds_insert())
FCEU_FDSInsert();
if(mr->command_fds_select())
FCEU_FDSSelect();
joyports[0].load(mr); joyports[0].load(mr);
joyports[1].load(mr); joyports[1].load(mr);
} }
@ -969,6 +977,11 @@ void FCEUMOV_AddCommand(int cmd)
//NOTE: EMOVIECMD matches FCEUNPCMD_RESET and FCEUNPCMD_POWER //NOTE: EMOVIECMD matches FCEUNPCMD_RESET and FCEUNPCMD_POWER
//we are lucky (well, I planned it that way) //we are lucky (well, I planned it that way)
switch(cmd) {
case FCEUNPCMD_FDSINSERT: cmd = MOVIECMD_FDS_INSERT; break;
case FCEUNPCMD_FDSSELECT: cmd = MOVIECMD_FDS_SELECT; break;
}
_currCommand |= cmd; _currCommand |= cmd;
} }

View File

@ -64,6 +64,8 @@ enum EMOVIECMD
{ {
MOVIECMD_RESET = 1, MOVIECMD_RESET = 1,
MOVIECMD_POWER = 2, MOVIECMD_POWER = 2,
MOVIECMD_FDS_INSERT = 4,
MOVIECMD_FDS_SELECT = 8
}; };
EMOVIEMODE FCEUMOV_Mode(); EMOVIEMODE FCEUMOV_Mode();
@ -103,6 +105,8 @@ public:
uint8 commands; uint8 commands;
bool command_reset() { return (commands&MOVIECMD_RESET)!=0; } bool command_reset() { return (commands&MOVIECMD_RESET)!=0; }
bool command_power() { return (commands&MOVIECMD_POWER)!=0; } bool command_power() { return (commands&MOVIECMD_POWER)!=0; }
bool command_fds_insert() { return (commands&MOVIECMD_FDS_INSERT)!=0; }
bool command_fds_select() { return (commands&MOVIECMD_FDS_SELECT)!=0; }
void toggleBit(int joy, int bit) void toggleBit(int joy, int bit)
{ {