src/gba/gba.h (view raw)
1#ifndef GBA_H
2#define GBA_H
3
4#include "arm.h"
5
6#include "gba-memory.h"
7
8enum GBAError {
9 GBA_NO_ERROR = 0,
10 GBA_OUT_OF_MEMORY = -1
11};
12
13enum GBALogLevel {
14 GBA_LOG_STUB
15};
16
17struct GBABoard {
18 struct ARMBoard d;
19 struct GBA* p;
20};
21
22struct GBA {
23 struct ARMCore cpu;
24 struct GBABoard board;
25 struct GBAMemory memory;
26
27 struct ARMDebugger* debugger;
28
29 enum GBAError errno;
30 const char* errstr;
31};
32
33void GBAInit(struct GBA* gba);
34void GBADeinit(struct GBA* gba);
35
36void GBAMemoryInit(struct GBAMemory* memory);
37void GBAMemoryDeinit(struct GBAMemory* memory);
38
39void GBABoardInit(struct GBABoard* board);
40void GBABoardReset(struct ARMBoard* board);
41
42void GBAAttachDebugger(struct GBA* gba, struct ARMDebugger* debugger);
43
44void GBALoadROM(struct GBA* gba, int fd);
45
46void GBALog(int level, const char* format, ...);
47
48#endif