removing now unneeded dir from package
[drnoksnes] / movie.h
1 /*******************************************************************************
2   Snes9x - Portable Super Nintendo Entertainment System (TM) emulator.
3  
4   (c) Copyright 1996 - 2002 Gary Henderson (gary.henderson@ntlworld.com) and
5                             Jerremy Koot (jkoot@snes9x.com)
6
7   (c) Copyright 2001 - 2004 John Weidman (jweidman@slip.net)
8
9   (c) Copyright 2002 - 2004 Brad Jorsch (anomie@users.sourceforge.net),
10                             funkyass (funkyass@spam.shaw.ca),
11                             Joel Yliluoma (http://iki.fi/bisqwit/)
12                             Kris Bleakley (codeviolation@hotmail.com),
13                             Matthew Kendora,
14                             Nach (n-a-c-h@users.sourceforge.net),
15                             Peter Bortas (peter@bortas.org) and
16                             zones (kasumitokoduck@yahoo.com)
17
18   C4 x86 assembler and some C emulation code
19   (c) Copyright 2000 - 2003 zsKnight (zsknight@zsnes.com),
20                             _Demo_ (_demo_@zsnes.com), and Nach
21
22   C4 C++ code
23   (c) Copyright 2003 Brad Jorsch
24
25   DSP-1 emulator code
26   (c) Copyright 1998 - 2004 Ivar (ivar@snes9x.com), _Demo_, Gary Henderson,
27                             John Weidman, neviksti (neviksti@hotmail.com),
28                             Kris Bleakley, Andreas Naive
29
30   DSP-2 emulator code
31   (c) Copyright 2003 Kris Bleakley, John Weidman, neviksti, Matthew Kendora, and
32                      Lord Nightmare (lord_nightmare@users.sourceforge.net
33
34   OBC1 emulator code
35   (c) Copyright 2001 - 2004 zsKnight, pagefault (pagefault@zsnes.com) and
36                             Kris Bleakley
37   Ported from x86 assembler to C by sanmaiwashi
38
39   SPC7110 and RTC C++ emulator code
40   (c) Copyright 2002 Matthew Kendora with research by
41                      zsKnight, John Weidman, and Dark Force
42
43   S-DD1 C emulator code
44   (c) Copyright 2003 Brad Jorsch with research by
45                      Andreas Naive and John Weidman
46  
47   S-RTC C emulator code
48   (c) Copyright 2001 John Weidman
49   
50   ST010 C++ emulator code
51   (c) Copyright 2003 Feather, Kris Bleakley, John Weidman and Matthew Kendora
52
53   Super FX x86 assembler emulator code 
54   (c) Copyright 1998 - 2003 zsKnight, _Demo_, and pagefault 
55
56   Super FX C emulator code 
57   (c) Copyright 1997 - 1999 Ivar, Gary Henderson and John Weidman
58
59
60   SH assembler code partly based on x86 assembler code
61   (c) Copyright 2002 - 2004 Marcus Comstedt (marcus@mc.pp.se) 
62
63   Input recording/playback code
64   (c) Copyright 2004 blip
65  
66   Specific ports contains the works of other authors. See headers in
67   individual files.
68  
69   Snes9x homepage: http://www.snes9x.com
70  
71   Permission to use, copy, modify and distribute Snes9x in both binary and
72   source form, for non-commercial purposes, is hereby granted without fee,
73   providing that this license information and copyright notice appear with
74   all copies and any derived work.
75  
76   This software is provided 'as-is', without any express or implied
77   warranty. In no event shall the authors be held liable for any damages
78   arising from the use of this software.
79  
80   Snes9x is freeware for PERSONAL USE only. Commercial users should
81   seek permission of the copyright holders first. Commercial use includes
82   charging money for Snes9x or software derived from Snes9x.
83  
84   The copyright holders request that bug fixes and improvements to the code
85   should be forwarded to them so everyone can benefit from the modifications
86   in future versions.
87  
88   Super NES and Super Nintendo Entertainment System are trademarks of
89   Nintendo Co., Limited and its subsidiary companies.
90 *******************************************************************************/
91 #ifndef _MOVIE_H_
92 #define _MOVIE_H_
93
94 #include <stdio.h>
95 #include <time.h>
96 #include "snes9x.h"
97
98 #ifndef SUCCESS
99 #  define SUCCESS 1
100 #  define WRONG_FORMAT (-1)
101 #  define WRONG_VERSION (-2)
102 #  define FILE_NOT_FOUND (-3)
103 #endif
104
105 #define MOVIE_OPT_FROM_SNAPSHOT 0
106 #define MOVIE_OPT_FROM_RESET    (1<<0)
107 #define MOVIE_OPT_PAL           (1<<1)
108 #define MOVIE_MAX_METADATA              512
109
110 START_EXTERN_C
111 struct MovieInfo
112 {
113         time_t  TimeCreated;
114         uint32  LengthFrames;
115         uint32  RerecordCount;
116         wchar_t Metadata[MOVIE_MAX_METADATA];           // really should be wchar_t
117         uint8   Opts;
118         uint8   ControllersMask;
119         bool8   ReadOnly;
120 };
121
122 // methods used by the user-interface code
123 int S9xMovieOpen (const char* filename, bool8 read_only);
124 int S9xMovieCreate (const char* filename, uint8 controllers_mask, uint8 opts, const wchar_t* metadata, int metadata_length);
125 int S9xMovieGetInfo (const char* filename, struct MovieInfo* info);
126 void S9xMovieStop (bool8 suppress_message);
127 void S9xMovieToggleFrameDisplay ();
128
129 // methods used by the emulation
130 void S9xMovieInit ();
131 void S9xMovieUpdate ();
132 //bool8 S9xMovieRewind (uint32 at_frame);
133 void S9xMovieFreeze (uint8** buf, uint32* size);
134 bool8 S9xMovieUnfreeze (const uint8* buf, uint32 size);
135
136 // accessor functions
137 bool8 S9xMovieActive ();
138 // the following accessors return 0/false if !S9xMovieActive()
139 bool8 S9xMovieReadOnly ();
140 uint32 S9xMovieGetId ();
141 uint32 S9xMovieGetLength ();
142 uint32 S9xMovieGetFrameCounter ();
143
144 END_EXTERN_C
145
146 #endif