home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 July / CMCD0704.ISO / Software / Freeware / Utilitare / VisualBoyAdvance-1.7.2 / src / System.h < prev    next >
Encoding:
C/C++ Source or Header  |  2004-05-13  |  3.5 KB  |  126 lines

  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_SYSTEM_H
  21. #define VBA_SYSTEM_H
  22.  
  23. #include "unzip.h"
  24.  
  25. #ifndef NULL
  26. #define NULL 0
  27. #endif
  28.  
  29. typedef unsigned char u8;
  30. typedef unsigned short u16;
  31. typedef unsigned int u32;
  32.  
  33. #ifdef _MSC_VER
  34. typedef unsigned __int64 u64;
  35. #else
  36. typedef unsigned long long u64;
  37. #endif
  38.  
  39. typedef signed char s8;
  40. typedef signed short s16;
  41. typedef signed int s32;
  42.  
  43. #ifdef _MSC_VER
  44. typedef signed __int64 s64;
  45. #else
  46. typedef signed long long s64;
  47. #endif
  48.  
  49. struct EmulatedSystem {
  50.   // main emulation function
  51.   void (*emuMain)(int);
  52.   // reset emulator
  53.   void (*emuReset)();
  54.   // clean up memory
  55.   void (*emuCleanUp)();
  56.   // load battery file
  57.   bool (*emuReadBattery)(const char *);
  58.   // write battery file
  59.   bool (*emuWriteBattery)(const char *);
  60.   // load state
  61.   bool (*emuReadState)(const char *);  
  62.   // save state
  63.   bool (*emuWriteState)(const char *);
  64.   // load memory state (rewind)
  65.   bool (*emuReadMemState)(char *, int);
  66.   // write memory state (rewind)
  67.   bool (*emuWriteMemState)(char *, int);
  68.   // write PNG file
  69.   bool (*emuWritePNG)(const char *);
  70.   // write BMP file
  71.   bool (*emuWriteBMP)(const char *);
  72.   // emulator update CPSR (ARM only)
  73.   void (*emuUpdateCPSR)();
  74.   // emulator has debugger
  75.   bool emuHasDebugger;
  76.   // clock ticks to emulate
  77.   int emuCount;
  78. };
  79.  
  80. extern void log(const char *,...);
  81.  
  82. extern bool systemPauseOnFrame();
  83. extern void systemGbPrint(u8 *,int,int,int,int);
  84. extern void systemScreenCapture(int);
  85. extern void systemDrawScreen();
  86. // updates the joystick data
  87. extern bool systemReadJoypads();
  88. // return information about the given joystick, -1 for default joystick
  89. extern u32 systemReadJoypad(int);
  90. extern u32 systemGetClock();
  91. extern void systemMessage(int, const char *, ...);
  92. extern void systemSetTitle(const char *);
  93. extern void systemWriteDataToSoundBuffer();
  94. extern void systemSoundShutdown();
  95. extern void systemSoundPause();
  96. extern void systemSoundResume();
  97. extern void systemSoundReset();
  98. extern bool systemSoundInit();
  99. extern void systemScreenMessage(const char *);
  100. extern void systemUpdateMotionSensor();
  101. extern int  systemGetSensorX();
  102. extern int  systemGetSensorY();
  103. extern bool systemCanChangeSoundQuality();
  104. extern void systemShowSpeed(int);
  105. extern void system10Frames(int);
  106. extern void systemFrame();
  107. extern void systemGbBorderOn();
  108.  
  109. extern bool systemSoundOn;
  110. extern u16 systemColorMap16[0x10000];
  111. extern u32 systemColorMap32[0x10000];
  112. extern u16 systemGbPalette[24];
  113. extern int systemRedShift;
  114. extern int systemGreenShift;
  115. extern int systemBlueShift;
  116. extern int systemColorDepth;
  117. extern int systemDebug;
  118. extern int systemVerbose;
  119. extern int systemFrameSkip;
  120. extern int systemSaveUpdateCounter;
  121.  
  122. #define SYSTEM_SAVE_UPDATED 30
  123. #define SYSTEM_SAVE_NOT_UPDATED 0
  124.  
  125. #endif //VBA_SYSTEM_H
  126.