many movie fixes (mainly for readonly mode), and some wii input display support

This commit is contained in:
nitsuja
2011-12-14 04:03:05 -08:00
parent f3325036be
commit 9470f9545f
6 changed files with 345 additions and 159 deletions

View File

@ -24,6 +24,8 @@
#include <string>
#include "ChunkFile.h"
// Per-(video )Movie actions
namespace Movie {
@ -62,7 +64,10 @@ extern ControllerState *g_padStates;
extern char g_playingFile[256];
extern std::string g_recordFile;
extern u64 g_frameCounter, g_lagCounter, g_InputCounter;
extern u64 g_currentByte, g_totalBytes;
extern u64 g_currentFrame, g_totalFrames;
extern u64 g_currentLagCount, g_totalLagCount;
extern u64 g_currentInputCount, g_totalInputCount;
extern u32 g_rerecords;
@ -77,7 +82,7 @@ struct DTMHeader {
bool bFromSaveState; // false indicates that the recording started from bootup, true for savestate
u64 frameCount; // Number of frames in the recording
u64 InputCount; // Number of input frames in recording
u64 inputCount; // Number of input frames in recording
u64 lagCount; // Number of lag frames in the recording
u64 uniqueID; // A Unique ID comprised of: md5(time + Game ID)
u32 numRerecords; // Number of rerecords/'cuts' of this TAS
@ -87,9 +92,10 @@ struct DTMHeader {
u8 audioEmulator[16]; // UTF-8 representation of the audio emulator
u8 padBackend[16]; // UTF-8 representation of the input backend
// only used in read-only savestates
u64 frameStart; // Offset to resume playback on
u64 totalFrameCount; // Total frames, same as normal dtm's frameCount
// hack, data that was only used for savestates and would more properly be stored in the savestate itself
// the hack has been removed, but these remain defined and reserved here for legacy support purposes
u64 deprecated_frameStart; // NOT USED ANYMORE (use g_currentFrame)
u64 deprecated_totalFrameCount; // NOT USED ANYMORE (use g_totalFrames or header.frameCount)
u8 reserved[111]; // Make heading 256 bytes, just because we can
};
@ -103,6 +109,7 @@ void SetPolledDevice();
bool IsAutoFiring();
bool IsRecordingInput();
bool IsRecordingInputFromSaveState();
bool IsJustStartingRecordingInputFromSaveState();
bool IsPlayingInput();
bool IsReadOnly();
@ -120,14 +127,15 @@ void FrameSkipping();
bool BeginRecordingInput(int controllers);
void RecordInput(SPADStatus *PadStatus, int controllerID);
void RecordWiimote(int wiimote, u8* data, s8 size);
void RecordWiimote(int wiimote, u8* data, s8 size, u8* const coreData, u8* const accelData, u8* const irData);
bool PlayInput(const char *filename);
void LoadInput(const char *filename);
void PlayController(SPADStatus *PadStatus, int controllerID);
bool PlayWiimote(int wiimote, u8* data, s8 &size);
bool PlayWiimote(int wiimote, u8* data, s8 &size, u8* const coreData, u8* const accelData, u8* const irData);
void EndPlayInput(bool cont);
void SaveRecording(const char *filename);
void DoState(PointerWrap &p, bool doNot=false);
std::string GetInputDisplay();