1 // -*- C++ -*- 2 // VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator. 3 // Copyright (C) 1999-2003 Forgotten 4 // Copyright (C) 2004 Forgotten and the VBA development team 5 6 // This program is free software; you can redistribute it and/or modify 7 // it under the terms of the GNU General Public License as published by 8 // the Free Software Foundation; either version 2, or(at your option) 9 // any later version. 10 // 11 // This program is distributed in the hope that it will be useful, 12 // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 // GNU General Public License for more details. 15 // 16 // You should have received a copy of the GNU General Public License 17 // along with this program; if not, write to the Free Software Foundation, 18 // Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 19 20 #ifndef VBA_GB_GB_H 21 #define VBA_GB_GB_H 22 23 #define C_FLAG 0x10 24 #define H_FLAG 0x20 25 #define N_FLAG 0x40 26 #define Z_FLAG 0x80 27 28 typedef union { 29 struct { 30 #ifdef WORDS_BIGENDIAN 31 u8 B1, B0; 32 #else 33 u8 B0,B1; 34 #endif 35 } B; 36 u16 W; 37 } gbRegister; 38 39 extern bool gbLoadRom(const char *); 40 extern void gbEmulate(int); 41 extern bool gbIsGameboyRom(const char *); 42 extern void gbSoundReset(); 43 extern void gbSoundSetQuality(int); 44 extern void gbReset(); 45 extern void gbCleanUp(); 46 extern bool gbWriteBatteryFile(const char *); 47 extern bool gbWriteBatteryFile(const char *, bool); 48 extern bool gbReadBatteryFile(const char *); 49 extern bool gbWriteSaveState(const char *); 50 extern bool gbWriteMemSaveState(char *, int); 51 extern bool gbReadSaveState(const char *); 52 extern bool gbReadMemSaveState(char *, int); 53 extern void gbSgbRenderBorder(); 54 extern bool gbWritePNGFile(const char *); 55 extern bool gbWriteBMPFile(const char *); 56 extern bool gbReadGSASnapshot(const char *); 57 58 extern struct EmulatedSystem GBSystem; 59 60 #endif 61