2011-02-19 21:33:53 +00:00
|
|
|
#ifndef SYSTEM_H
|
|
|
|
#define SYSTEM_H
|
|
|
|
#include "common/Types.h"
|
2015-04-14 10:39:21 +00:00
|
|
|
#ifndef __LIBRETRO__
|
2011-02-19 21:33:53 +00:00
|
|
|
#include <zlib.h>
|
2015-04-14 10:39:21 +00:00
|
|
|
#endif
|
2011-02-19 21:33:53 +00:00
|
|
|
|
2015-04-15 13:13:07 +00:00
|
|
|
#define winlog log
|
|
|
|
|
2011-02-19 21:33:53 +00:00
|
|
|
class SoundDriver;
|
|
|
|
|
|
|
|
struct EmulatedSystem {
|
2013-09-21 13:57:40 +00:00
|
|
|
// main emulation function
|
|
|
|
void (*emuMain)(int);
|
|
|
|
// reset emulator
|
|
|
|
void (*emuReset)();
|
|
|
|
// clean up memory
|
|
|
|
void (*emuCleanUp)();
|
|
|
|
// load battery file
|
|
|
|
bool (*emuReadBattery)(const char *);
|
|
|
|
// write battery file
|
|
|
|
bool (*emuWriteBattery)(const char *);
|
|
|
|
#ifdef __LIBRETRO__
|
|
|
|
// load state
|
|
|
|
bool (*emuReadState)(const u8*, unsigned);
|
|
|
|
// load state
|
|
|
|
unsigned (*emuWriteState)(u8*, unsigned);
|
|
|
|
#else
|
|
|
|
// load state
|
|
|
|
bool (*emuReadState)(const char *);
|
|
|
|
// save state
|
|
|
|
bool (*emuWriteState)(const char *);
|
|
|
|
#endif
|
|
|
|
// load memory state (rewind)
|
|
|
|
bool (*emuReadMemState)(char *, int);
|
|
|
|
// write memory state (rewind)
|
|
|
|
bool (*emuWriteMemState)(char *, int);
|
|
|
|
// write PNG file
|
|
|
|
bool (*emuWritePNG)(const char *);
|
|
|
|
// write BMP file
|
|
|
|
bool (*emuWriteBMP)(const char *);
|
|
|
|
// emulator update CPSR (ARM only)
|
|
|
|
void (*emuUpdateCPSR)();
|
|
|
|
// emulator has debugger
|
|
|
|
bool emuHasDebugger;
|
|
|
|
// clock ticks to emulate
|
|
|
|
int emuCount;
|
2011-02-19 21:33:53 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
extern void log(const char *,...);
|
|
|
|
extern bool systemPauseOnFrame();
|
2011-05-24 07:39:29 +00:00
|
|
|
extern void systemGbPrint(u8 *,int,int,int,int,int);
|
2011-02-19 21:33:53 +00:00
|
|
|
extern void systemScreenCapture(int);
|
|
|
|
extern void systemDrawScreen();
|
|
|
|
// updates the joystick data
|
|
|
|
extern bool systemReadJoypads();
|
|
|
|
// return information about the given joystick, -1 for default joystick
|
|
|
|
extern u32 systemReadJoypad(int);
|
|
|
|
extern u32 systemGetClock();
|
|
|
|
extern void systemMessage(int, const char *, ...);
|
|
|
|
extern void systemSetTitle(const char *);
|
|
|
|
extern SoundDriver * systemSoundInit();
|
|
|
|
extern void systemOnWriteDataToSoundBuffer(const u16 * finalWave, int length);
|
|
|
|
extern void systemOnSoundShutdown();
|
|
|
|
extern void systemScreenMessage(const char *);
|
|
|
|
extern void systemUpdateMotionSensor();
|
2013-09-21 13:57:40 +00:00
|
|
|
extern int systemGetSensorX();
|
|
|
|
extern int systemGetSensorY();
|
2015-03-26 09:08:30 +00:00
|
|
|
extern int systemGetSensorZ();
|
|
|
|
extern u8 systemGetSensorDarkness();
|
|
|
|
extern void systemCartridgeRumble(bool);
|
|
|
|
extern void systemPossibleCartridgeRumble(bool);
|
|
|
|
extern void updateRumbleFrame();
|
2011-02-19 21:33:53 +00:00
|
|
|
extern bool systemCanChangeSoundQuality();
|
|
|
|
extern void systemShowSpeed(int);
|
|
|
|
extern void system10Frames(int);
|
|
|
|
extern void systemFrame();
|
|
|
|
extern void systemGbBorderOn();
|
|
|
|
extern void Sm60FPS_Init();
|
|
|
|
extern bool Sm60FPS_CanSkipFrame();
|
|
|
|
extern void Sm60FPS_Sleep();
|
|
|
|
extern void DbgMsg(const char *msg, ...);
|
|
|
|
extern void (*dbgOutput)(const char *s, u32 addr);
|
|
|
|
extern void (*dbgSignal)(int sig,int number);
|
|
|
|
extern u16 systemColorMap16[0x10000];
|
|
|
|
extern u32 systemColorMap32[0x10000];
|
|
|
|
extern u16 systemGbPalette[24];
|
|
|
|
extern int systemRedShift;
|
|
|
|
extern int systemGreenShift;
|
|
|
|
extern int systemBlueShift;
|
|
|
|
extern int systemColorDepth;
|
|
|
|
extern int systemVerbose;
|
|
|
|
extern int systemFrameSkip;
|
|
|
|
extern int systemSaveUpdateCounter;
|
|
|
|
extern int systemSpeed;
|
|
|
|
#define SYSTEM_SAVE_UPDATED 30
|
|
|
|
#define SYSTEM_SAVE_NOT_UPDATED 0
|
2013-09-21 13:57:40 +00:00
|
|
|
#endif // SYSTEM_H
|