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