Implemented frame counter and TAS GC recording. What's left: A lot of GUI, actually playing the TASes, and begin recording from savestate.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4025 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
XTra.KrazzY
2009-08-20 23:31:48 +00:00
parent 92d4c55e14
commit 7ed4b06e48
3 changed files with 198 additions and 5 deletions

View File

@ -25,21 +25,72 @@
namespace Frame {
enum PlayMode {
MODE_NONE = 0,
MODE_RECORDING,
MODE_PLAYING
};
// Gamecube Controller State
typedef struct {
bool Start, A, B, X, Y, Z; // Binary buttons, 6 bits
bool DPadUp, DPadDown, DPadLeft, DPadRight; // Binary D-Pad buttons, 4 bits
u8 L, R; // Triggers, 16 bits
u8 AnalogStickX, AnalogStickY; // Main Stick, 16 bits
u8 CStickX, CStickY; // Sub-Stick, 16 bits
bool reserved1, reserved2; // Reserved bits, 2 bits
} ControllerState; // Total: 58 + 2 = 60 bits per frame
typedef struct {
bool bWii; // Wii game
u8 gameID[6]; // The Game ID
u8 numControllers; // The number of connected controllers (1-4)
bool bFromSaveState; // false indicates that the recording started from bootup, true for savestate
u64 frameCount; // Number of frames in the 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
u8 author[32]; // Author's name (encoded in UTF-8)
u8 videoPlugin[16]; // UTF-8 representation of the video plugin
u8 audioPlugin[16]; // UTF-8 representation of the audio plugin
u8 padPlugin[16]; // UTF-8 representation of the input plugin
bool padding[102]; // Padding to align the header to 1024 bits
u8 reserved[128]; // Increasing size from 128 bytes to 256 bytes, just because we can
} DTMHeader;
void FrameUpdate();
bool IsAutoFiring();
bool IsRecordingInput();
bool IsPlayingInput();
void SetAutoHold(bool bEnabled, u32 keyToHold = 0);
void SetAutoFire(bool bEnabled, u32 keyOne = 0, u32 keyTwo = 0);
void SetFrameStepping(bool bEnabled);
void ModifyController(SPADStatus *PadStatus);
void SetFrameSkipping(unsigned int framesToSkip);
int FrameSkippingFactor();
void FrameSkipping();
void ModifyController(SPADStatus *PadStatus, int controllerID);
void BeginRecordingInput(const char *filename);
void RecordInput(SPADStatus *PadStatus, int controllerID);
void EndRecordingInput();
void PlayInput(const char *filename);
void PlayController(SPADStatus *PadStatus, int controllerID);
};
#endif // __FRAME_H