1 | /*****************************************************************************\ |
2 | Snes9x - Portable Super Nintendo Entertainment System (TM) emulator. |
3 | This file is licensed under the Snes9x License. |
4 | For further information, consult the LICENSE file in the root directory. |
5 | \*****************************************************************************/ |
6 | |
7 | #ifndef _MOVIE_H_ |
8 | #define _MOVIE_H_ |
9 | |
10 | #define MOVIE_OPT_FROM_SNAPSHOT 0 |
11 | #define MOVIE_OPT_FROM_RESET (1 << 0) |
12 | #define MOVIE_OPT_PAL (1 << 1) |
13 | #define MOVIE_OPT_NOSAVEDATA (1 << 2) |
14 | #define MOVIE_SYNC_DATA_EXISTS 0x01 |
15 | #define MOVIE_SYNC_OBSOLETE 0x02 |
16 | #define MOVIE_SYNC_VOLUMEENVX 0x08 |
17 | #define MOVIE_SYNC_FAKEMUTE 0x10 |
18 | #define MOVIE_SYNC_HASROMINFO 0x40 |
19 | #define MOVIE_SYNC_NOCPUSHUTDOWN 0x80 |
20 | #define MOVIE_MAX_METADATA 512 |
21 | |
22 | #define CONTROLLER_DATA_SIZE 2 |
23 | #define MOUSE_DATA_SIZE 5 |
24 | #define SCOPE_DATA_SIZE 6 |
25 | #define JUSTIFIER_DATA_SIZE 11 |
26 | |
27 | struct MovieInfo |
28 | { |
29 | time_t TimeCreated; |
30 | uint32 Version; |
31 | uint32 LengthFrames; |
32 | uint32 LengthSamples; |
33 | uint32 RerecordCount; |
34 | uint8 Opts; |
35 | uint8 ControllersMask; |
36 | uint8 SyncFlags; |
37 | bool8 ReadOnly; |
38 | uint8 PortType[2]; |
39 | wchar_t Metadata[MOVIE_MAX_METADATA]; |
40 | uint32 ROMCRC32; |
41 | char ROMName[23]; |
42 | }; |
43 | |
44 | // methods used by the user-interface code |
45 | int S9xMovieOpen (const char *, bool8); |
46 | int S9xMovieCreate (const char *, uint8, uint8, const wchar_t *, int); |
47 | int S9xMovieGetInfo (const char *, struct MovieInfo *); |
48 | void S9xMovieStop (bool8); |
49 | void S9xMovieToggleRecState (void); |
50 | void S9xMovieToggleFrameDisplay (void); |
51 | const char * S9xChooseMovieFilename (bool8); |
52 | |
53 | // methods used by the emulation |
54 | void S9xMovieInit (void); |
55 | void S9xMovieShutdown (void); |
56 | void S9xMovieUpdate (bool a = true); |
57 | void S9xMovieUpdateOnReset (void); |
58 | void S9xUpdateFrameCounter (int o = 0); |
59 | void S9xMovieFreeze (uint8 **, uint32 *); |
60 | int S9xMovieUnfreeze (uint8 *, uint32); |
61 | |
62 | // accessor functions |
63 | bool8 S9xMovieActive (void); |
64 | bool8 S9xMoviePlaying (void); |
65 | bool8 S9xMovieRecording (void); |
66 | bool8 S9xMovieReadOnly (void); |
67 | uint8 S9xMovieControllers (void); |
68 | uint32 S9xMovieGetId (void); |
69 | uint32 S9xMovieGetLength (void); |
70 | uint32 S9xMovieGetFrameCounter (void); |
71 | |
72 | uint16 MovieGetJoypad (int); |
73 | void MovieSetJoypad (int, uint16); |
74 | bool MovieGetMouse (int, uint8 d[MOUSE_DATA_SIZE]); |
75 | void MovieSetMouse (int, uint8 d[MOUSE_DATA_SIZE], bool); |
76 | bool MovieGetScope (int, uint8 d[SCOPE_DATA_SIZE]); |
77 | void MovieSetScope (int, uint8 d[SCOPE_DATA_SIZE]); |
78 | bool MovieGetJustifier (int, uint8 d[JUSTIFIER_DATA_SIZE]); |
79 | void MovieSetJustifier (int, uint8 d[JUSTIFIER_DATA_SIZE]); |
80 | |
81 | #endif |
82 | |