12
FILE *FCEUD_UTF8fopen(const char *fn, const char *mode);
13
inline FILE *FCEUD_UTF8fopen(const std::string &n, const char *mode) { return FCEUD_UTF8fopen(n.c_str(),mode); }
14
std::fstream* FCEUD_UTF8_fstream(const char *n, const char *m);
15
inline std::fstream* FCEUD_UTF8_fstream(const std::string &n, const char *m) { return FCEUD_UTF8_fstream(n.c_str(),m); }
16
FCEUFILE* FCEUD_OpenArchiveIndex(ArchiveScanRecord& asr, std::string& fname, int innerIndex);
17
FCEUFILE* FCEUD_OpenArchive(ArchiveScanRecord& asr, std::string& fname, std::string* innerFilename);
18
ArchiveScanRecord FCEUD_ScanArchive(std::string fname);
21
const char *FCEUD_GetCompilerString();
23
//This makes me feel dirty for some reason.
24
void FCEU_printf(char *format, ...);
25
#define FCEUI_printf FCEU_printf
28
void FCEUD_SetPalette(uint8 index, uint8 r, uint8 g, uint8 b);
29
void FCEUD_GetPalette(uint8 i,uint8 *r, uint8 *g, uint8 *b);
31
//Displays an error. Can block or not.
32
void FCEUD_PrintError(const char *s);
33
void FCEUD_Message(const char *s);
37
//Call only when a game is loaded.
38
int FCEUI_NetplayStart(int nlocal, int divisor);
40
// Call when network play needs to stop.
41
void FCEUI_NetplayStop(void);
43
//Note: YOU MUST NOT CALL ANY FCEUI_* FUNCTIONS WHILE IN FCEUD_SendData() or FCEUD_RecvData().
45
//Return 0 on failure, 1 on success.
46
int FCEUD_SendData(void *data, uint32 len);
47
int FCEUD_RecvData(void *data, uint32 len);
49
//Display text received over the network.
50
void FCEUD_NetplayText(uint8 *text);
52
//Encode and send text over the network.
53
void FCEUI_NetplayText(uint8 *text);
55
//Called when a fatal error occurred and network play can't continue. This function
56
//should call FCEUI_NetplayStop() after it has deinitialized the network on the driver
58
void FCEUD_NetworkClose(void);
60
bool FCEUI_BeginWaveRecord(const char *fn);
61
int FCEUI_EndWaveRecord(void);
63
void FCEUI_ResetNES(void);
64
void FCEUI_PowerNES(void);
66
void FCEUI_NTSCSELHUE(void);
67
void FCEUI_NTSCSELTINT(void);
68
void FCEUI_NTSCDEC(void);
69
void FCEUI_NTSCINC(void);
70
void FCEUI_GetNTSCTH(int *tint, int *hue);
71
void FCEUI_SetNTSCTH(int n, int tint, int hue);
73
void FCEUI_SetInput(int port, ESI type, void *ptr, int attrib);
74
void FCEUI_SetInputFC(ESIFC type, void *ptr, int attrib);
76
//tells the emulator whether a fourscore is attached
77
void FCEUI_SetInputFourscore(bool attachFourscore);
78
//tells whether a fourscore is attached
79
bool FCEUI_GetInputFourscore();
81
void FCEUI_UseInputPreset(int preset);
84
//New interface functions
86
//0 to order screen snapshots numerically(0.png), 1 to order them file base-numerically(smb3-0.png).
87
//this variable isn't used at all, snap is always name-based
88
//void FCEUI_SetSnapName(bool a);
90
//0 to keep 8-sprites limitation, 1 to remove it
91
void FCEUI_DisableSpriteLimitation(int a);
93
void FCEUI_SetRenderPlanes(bool sprites, bool bg);
94
void FCEUI_GetRenderPlanes(bool& sprites, bool& bg);
96
//name=path and file to load. returns null if it failed
97
FCEUGI *FCEUI_LoadGame(const char *name, int OverwriteVidMode);
99
//same as FCEUI_LoadGame, except that it can load from a tempfile.
100
//name is the logical path to open; archiveFilename is the archive which contains name
101
FCEUGI *FCEUI_LoadGameVirtual(const char *name, int OverwriteVidMode);
103
//general purpose emulator initialization. returns true if successful
104
bool FCEUI_Initialize();
107
void FCEUI_Emulate(uint8 **, int32 **, int32 *, int);
109
//Closes currently loaded game
110
void FCEUI_CloseGame(void);
112
//Deallocates all allocated memory. Call after FCEUI_Emulate() returns.
113
void FCEUI_Kill(void);
115
//Enable/Disable game genie. a=true->enabled
116
void FCEUI_SetGameGenie(bool a);
118
//Set video system a=0 NTSC, a=1 PAL
119
void FCEUI_SetVidSystem(int a);
121
//Convenience function; returns currently emulated video system(0=NTSC, 1=PAL).
122
int FCEUI_GetCurrentVidSystem(int *slstart, int *slend);
125
/* Should be called from FCEUD_BlitScreen(). Specifies how many frames
126
to skip until FCEUD_BlitScreen() is called. FCEUD_BlitScreenDummy()
127
will be called instead of FCEUD_BlitScreen() when when a frame is skipped.
129
void FCEUI_FrameSkip(int x);
132
//First and last scanlines to render, for ntsc and pal emulation.
133
void FCEUI_SetRenderedLines(int ntscf, int ntscl, int palf, int pall);
135
//Sets the base directory(save states, snapshots, etc. are saved in directories below this directory.
136
void FCEUI_SetBaseDirectory(std::string const & dir);
138
//Tells FCE Ultra to copy the palette data pointed to by pal and use it.
139
//Data pointed to by pal needs to be 64*3 bytes in length.
140
void FCEUI_SetPaletteArray(uint8 *pal);
142
//Sets up sound code to render sound at the specified rate, in samples
143
//per second. Only sample rates of 44100, 48000, and 96000 are currently supported.
144
//If "Rate" equals 0, sound is disabled.
145
void FCEUI_Sound(int Rate);
146
void FCEUI_SetSoundVolume(uint32 volume);
147
void FCEUI_SetTriangleVolume(uint32 volume);
148
void FCEUI_SetSquare1Volume(uint32 volume);
149
void FCEUI_SetSquare2Volume(uint32 volume);
150
void FCEUI_SetNoiseVolume(uint32 volume);
151
void FCEUI_SetPCMVolume(uint32 volume);
153
void FCEUI_SetSoundQuality(int quality);
155
void FCEUD_SoundToggle(void);
156
void FCEUD_SoundVolumeAdjust(int);
158
int FCEUI_SelectState(int, int);
159
extern void FCEUI_SelectStateNext(int);
161
//"fname" overrides the default save state filename code if non-NULL.
162
void FCEUI_SaveState(const char *fname);
163
void FCEUI_LoadState(const char *fname);
165
void FCEUD_SaveStateAs(void);
166
void FCEUD_LoadStateFrom(void);
168
//at the minimum, you should call FCEUI_SetInput, FCEUI_SetInputFC, and FCEUI_SetInputFourscore
169
//you may also need to maintain your own internal state
170
void FCEUD_SetInput(bool fourscore, ESI port0, ESI port1, ESIFC fcexp);
173
void FCEUD_MovieRecordTo(void);
174
void FCEUD_MovieReplayFrom(void);
175
void FCEUD_LuaRunFrom(void);
177
int32 FCEUI_GetDesiredFPS(void);
178
void FCEUI_SaveSnapshot(void);
179
void FCEU_DispMessage(char *format, ...);
180
#define FCEUI_DispMessage FCEU_DispMessage
182
int FCEUI_DecodePAR(const char *code, int *a, int *v, int *c, int *type);
183
int FCEUI_DecodeGG(const char *str, int *a, int *v, int *c);
184
int FCEUI_AddCheat(const char *name, uint32 addr, uint8 val, int compare, int type);
185
int FCEUI_DelCheat(uint32 which);
186
int FCEUI_ToggleCheat(uint32 which);
188
int32 FCEUI_CheatSearchGetCount(void);
189
void FCEUI_CheatSearchGetRange(uint32 first, uint32 last, int (*callb)(uint32 a, uint8 last, uint8 current));
190
void FCEUI_CheatSearchGet(int (*callb)(uint32 a, uint8 last, uint8 current, void *data), void *data);
191
void FCEUI_CheatSearchBegin(void);
192
void FCEUI_CheatSearchEnd(int type, uint8 v1, uint8 v2);
193
void FCEUI_ListCheats(int (*callb)(char *name, uint32 a, uint8 v, int compare, int s, int type, void *data), void *data);
195
int FCEUI_GetCheat(uint32 which, char **name, uint32 *a, uint8 *v, int *compare, int *s, int *type);
196
int FCEUI_SetCheat(uint32 which, const char *name, int32 a, int32 v, int compare,int s, int type);
198
void FCEUI_CheatSearchShowExcluded(void);
199
void FCEUI_CheatSearchSetCurrentAsOriginal(void);
202
#define FCEUIOD_ROMS 0 //Roms
203
#define FCEUIOD_NV 1 //NV = nonvolatile. save data.
204
#define FCEUIOD_STATES 2 //savestates
205
#define FCEUIOD_FDSROM 3 //disksys.rom
206
#define FCEUIOD_SNAPS 4 //screenshots
207
#define FCEUIOD_CHEATS 5 //cheats
208
#define FCEUIOD_MOVIES 6 //.fm2 files
209
#define FCEUIOD_MEMW 7 //memory watch fiels
210
#define FCEUIOD_BBOT 8 //basicbot, obsolete
211
#define FCEUIOD_MACRO 9 //macro files - tasedit, currently not implemented
212
#define FCEUIOD_INPUT 10 //input presets
213
#define FCEUIOD_LUA 11 //lua scripts
214
#define FCEUIOD_AVI 12 //default file for avi output
215
#define FCEUIOD__COUNT 13 //base directory override?
217
void FCEUI_SetDirOverride(int which, char *n);
219
void FCEUI_MemDump(uint16 a, int32 len, void (*callb)(uint16 a, uint8 v));
220
uint8 FCEUI_MemSafePeek(uint16 A);
221
void FCEUI_MemPoke(uint16 a, uint8 v, int hl);
222
void FCEUI_NMI(void);
223
void FCEUI_IRQ(void);
224
uint16 FCEUI_Disassemble(void *XA, uint16 a, char *stringo);
225
void FCEUI_GetIVectors(uint16 *reset, uint16 *irq, uint16 *nmi);
227
uint32 FCEUI_CRC32(uint32 crc, uint8 *buf, uint32 len);
229
void FCEUI_ToggleTileView(void);
230
void FCEUI_SetLowPass(int q);
232
void FCEUI_NSFSetVis(int mode);
233
int FCEUI_NSFChange(int amount);
234
int FCEUI_NSFGetInfo(uint8 *name, uint8 *artist, uint8 *copyright, int maxlen);
236
void FCEUI_VSUniToggleDIPView(void);
237
void FCEUI_VSUniToggleDIP(int w);
238
uint8 FCEUI_VSUniGetDIPs(void);
239
void FCEUI_VSUniSetDIP(int w, int state);
240
void FCEUI_VSUniCoin(void);
242
void FCEUI_FDSInsert(void); //mbg merge 7/17/06 changed to void fn(void) to make it an EMUCMDFN
243
//int FCEUI_FDSEject(void);
244
void FCEUI_FDSSelect(void);
246
int FCEUI_DatachSet(const uint8 *rcode);
248
///returns a flag indicating whether emulation is paused
249
int FCEUI_EmulationPaused();
250
///returns a flag indicating whether a one frame step has been requested
251
int FCEUI_EmulationFrameStepped();
252
///clears the framestepped flag. use it after youve stepped your one frame
253
void FCEUI_ClearEmulationFrameStepped();
254
///sets the EmulationPaused flags
255
void FCEUI_SetEmulationPaused(int val);
256
///toggles the paused bit (bit0) for EmulationPaused. caused FCEUD_DebugUpdate() to fire if the emulation pauses
257
void FCEUI_ToggleEmulationPause();
259
//indicates whether input aids should be drawn (such as crosshairs, etc; usually in fullscreen mode)
260
bool FCEUD_ShouldDrawInputAids();
262
///called when the emulator closes a game
263
void FCEUD_OnCloseGame(void);
265
void FCEUI_FrameAdvance(void);
266
void FCEUI_FrameAdvanceEnd(void);
269
int FCEUI_AviBegin(const char* fname);
270
void FCEUI_AviEnd(void);
271
void FCEUI_AviVideoUpdate(const unsigned char* buffer);
272
void FCEUI_AviSoundUpdate(void* soundData, int soundLen);
273
bool FCEUI_AviIsRecording();
275
void FCEUD_AviRecordTo(void);
276
void FCEUD_AviStop(void);
278
///A callback that the emu core uses to poll the state of a given emulator command key
279
typedef int TestCommandState(int cmd);
280
///Signals the emu core to poll for emulator commands and take actions
281
void FCEUI_HandleEmuCommands(TestCommandState* testfn);
293
void FCEUD_SetEmulationSpeed(int cmd);
294
void FCEUD_TurboOn(void);
295
void FCEUD_TurboOff(void);
296
void FCEUD_TurboToggle(void);
298
int FCEUD_ShowStatusIcon(void);
299
void FCEUD_ToggleStatusIcon(void);
300
void FCEUD_HideMenuToggle(void);
302
///signals the driver to perform a file open GUI operation
303
void FCEUD_CmdOpen(void);
305
//new merge-era driver routines here:
307
///signals that the cpu core hit a breakpoint. this function should not return until the core is ready for the next cycle
308
void FCEUD_DebugBreakpoint();
310
///the driver should log the current instruction, if it wants (we should move the code in the win driver that does this to the shared area)
311
void FCEUD_TraceInstruction();
313
///the driver might should update its NTView (only used if debugging support is compiled in)
314
void FCEUD_UpdateNTView(int scanline, bool drawall);
316
///the driver might should update its PPUView (only used if debugging support is compiled in)
317
void FCEUD_UpdatePPUView(int scanline, int drawall);
319
///I am dissatisfied with this method of getting an option from the driver to the core. but that is what we're using for now
320
bool FCEUD_PauseAfterPlayback();
322
///called when fceu changes something in the video system you might be interested in
323
void FCEUD_VideoChanged();
327
FCEUI_STOPAVI, FCEUI_QUICKSAVE, FCEUI_QUICKLOAD, FCEUI_SAVESTATE, FCEUI_LOADSTATE,
328
FCEUI_NEXTSAVESTATE,FCEUI_PREVIOUSSAVESTATE,FCEUI_VIEWSLOTS,
329
FCEUI_STOPMOVIE, FCEUI_RECORDMOVIE, FCEUI_PLAYMOVIE,
330
FCEUI_OPENGAME, FCEUI_CLOSEGAME,
332
FCEUI_RESET, FCEUI_POWER,FCEUI_PLAYFROMBEGINNING
335
//checks whether an EFCEUI is valid right now
336
bool FCEU_IsValidUI(EFCEUI ui);
341
FILE *FCEUI_UTF8fopen_C(const char *n, const char *m);