remove more unportable ASM, obsoleting C_CORE define
[rofl0r-VisualBoyAdvance.git] / src / Util.h
blobf881fa7441bc9bf0b661c72f392e00856fab03bc
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
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.
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.
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.
20 #ifndef VBA_UTIL_H
21 #define VBA_UTIL_H
22 typedef enum IMAGE_TYPE {
23 IMAGE_UNKNOWN = -1,
24 IMAGE_GBA = 0,
25 IMAGE_GB = 1
26 } IMAGE_TYPE;
28 // save game
30 typedef struct {
31 void *address;
32 int size;
33 } variable_desc;
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 *);
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 extern void utilUpdateSystemColorMaps();
65 #endif