home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 July / CMCD0704.ISO / Software / Freeware / Utilitare / VisualBoyAdvance-1.7.2 / src / Util.h < prev    next >
Encoding:
C/C++ Source or Header  |  2004-05-13  |  2.4 KB  |  65 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_UTIL_H
  21. #define VBA_UTIL_H
  22. enum IMAGE_TYPE {
  23.   IMAGE_UNKNOWN = -1,
  24.   IMAGE_GBA     = 0,
  25.   IMAGE_GB      = 1
  26. };
  27.  
  28. // save game
  29.  
  30. typedef struct {
  31.   void *address;
  32.   int size;
  33. } variable_desc;
  34.  
  35. extern bool utilWritePNGFile(const char *, int, int, u8 *);
  36. extern bool utilWriteBMPFile(const char *, int, int, u8 *);
  37. extern void utilApplyIPS(const char *ips, u8 **rom, int *size);
  38. extern void utilWriteBMP(char *, int, int, u8 *);
  39. extern bool utilIsGBAImage(const char *);
  40. extern bool utilIsGBImage(const char *);
  41. extern bool utilIsZipFile(const char *);
  42. extern bool utilIsGzipFile(const char *);
  43. extern bool utilIsRarFile(const char *);
  44. extern void utilGetBaseName(const char *, char *);
  45. extern IMAGE_TYPE utilFindType(const char *);
  46. extern u8 *utilLoad(const char *,
  47.                     bool (*)(const char*),
  48.                     u8 *,
  49.                     int &);
  50.  
  51. extern void utilPutDword(u8 *, u32);
  52. extern void utilPutWord(u8 *, u16);
  53. extern void utilWriteData(gzFile, variable_desc *);
  54. extern void utilReadData(gzFile, variable_desc *);
  55. extern int utilReadInt(gzFile);
  56. extern void utilWriteInt(gzFile, int);
  57. extern gzFile utilGzOpen(const char *file, const char *mode);
  58. extern gzFile utilMemGzOpen(char *memory, int available, char *mode);
  59. extern int utilGzWrite(gzFile file, const voidp buffer, unsigned int len);
  60. extern int utilGzRead(gzFile file, voidp buffer, unsigned int len);
  61. extern int utilGzClose(gzFile file);
  62. extern long utilGzMemTell(gzFile file);
  63. extern void utilGBAFindSave(const u8 *, const int);
  64. #endif
  65.