2008-10-27 18:23:21 +00:00
|
|
|
#ifndef GB_H
|
|
|
|
#define GB_H
|
2008-03-05 00:35:39 +00:00
|
|
|
|
2016-07-29 07:45:38 +00:00
|
|
|
const int GB_C_FLAG = 0x10;
|
|
|
|
const int GB_H_FLAG = 0x20;
|
|
|
|
const int GB_N_FLAG = 0x40;
|
|
|
|
const int GB_Z_FLAG = 0x80;
|
2008-03-05 00:35:39 +00:00
|
|
|
|
|
|
|
typedef union {
|
2016-07-09 13:53:13 +00:00
|
|
|
struct {
|
2008-03-05 00:35:39 +00:00
|
|
|
#ifdef WORDS_BIGENDIAN
|
2016-07-09 13:53:13 +00:00
|
|
|
uint8_t B1, B0;
|
2008-03-05 00:35:39 +00:00
|
|
|
#else
|
2016-07-09 13:53:13 +00:00
|
|
|
uint8_t B0, B1;
|
2008-03-05 00:35:39 +00:00
|
|
|
#endif
|
2016-07-09 13:53:13 +00:00
|
|
|
} B;
|
|
|
|
uint16_t W;
|
2008-03-05 00:35:39 +00:00
|
|
|
} gbRegister;
|
|
|
|
|
2011-05-25 11:55:46 +00:00
|
|
|
extern gbRegister AF, BC, DE, HL, SP, PC;
|
2016-07-09 13:24:19 +00:00
|
|
|
extern uint16_t IFF;
|
2016-07-29 09:07:11 +00:00
|
|
|
int gbDis(char*, uint16_t);
|
2011-05-25 11:55:46 +00:00
|
|
|
|
2016-07-09 13:53:13 +00:00
|
|
|
bool gbLoadRom(const char*);
|
2011-05-25 11:55:46 +00:00
|
|
|
bool gbUpdateSizes();
|
2008-09-04 12:28:31 +00:00
|
|
|
void gbEmulate(int);
|
2016-07-09 13:24:19 +00:00
|
|
|
void gbWriteMemory(register uint16_t, register uint8_t);
|
2008-09-04 12:28:31 +00:00
|
|
|
void gbDrawLine();
|
2016-07-09 13:53:13 +00:00
|
|
|
bool gbIsGameboyRom(const char*);
|
2008-09-04 12:28:31 +00:00
|
|
|
void gbGetHardwareType();
|
|
|
|
void gbReset();
|
|
|
|
void gbCleanUp();
|
2016-07-09 13:53:13 +00:00
|
|
|
void gbCPUInit(const char*, bool);
|
|
|
|
bool gbWriteBatteryFile(const char*);
|
|
|
|
bool gbWriteBatteryFile(const char*, bool);
|
|
|
|
bool gbReadBatteryFile(const char*);
|
|
|
|
bool gbWriteSaveState(const char*);
|
|
|
|
bool gbWriteMemSaveState(char*, int, long&);
|
|
|
|
bool gbReadSaveState(const char*);
|
|
|
|
bool gbReadMemSaveState(char*, int);
|
2008-09-04 12:28:31 +00:00
|
|
|
void gbSgbRenderBorder();
|
2016-07-09 13:53:13 +00:00
|
|
|
bool gbWritePNGFile(const char*);
|
|
|
|
bool gbWriteBMPFile(const char*);
|
|
|
|
bool gbReadGSASnapshot(const char*);
|
2008-03-05 00:35:39 +00:00
|
|
|
|
2009-01-23 13:41:24 +00:00
|
|
|
extern int gbHardware;
|
|
|
|
|
2008-03-05 00:35:39 +00:00
|
|
|
extern struct EmulatedSystem GBSystem;
|
|
|
|
|
2008-10-27 18:23:21 +00:00
|
|
|
#endif // GB_H
|