diff --git a/src/gba/gba.c b/src/gba/gba.c index 2a756b9d8..e4d2793f4 100644 --- a/src/gba/gba.c +++ b/src/gba/gba.c @@ -626,6 +626,10 @@ void GBAGetGameCode(struct GBA* gba, char* out) { memcpy(out, &((struct GBACartridge*) gba->memory.rom)->id, 4); } +void GBAGetGameTitle(struct GBA* gba, char* out) { + memcpy(out, &((struct GBACartridge*) gba->memory.rom)->title, 12); +} + void GBAHitStub(struct ARMCore* cpu, uint32_t opcode) { struct GBA* gba = (struct GBA*) cpu->master; enum GBALogLevel level = GBA_LOG_FATAL; diff --git a/src/gba/gba.h b/src/gba/gba.h index 2e2e3d39b..281667974 100644 --- a/src/gba/gba.h +++ b/src/gba/gba.h @@ -151,6 +151,7 @@ void GBAApplyPatch(struct GBA* gba, struct Patch* patch); bool GBAIsROM(struct VFile* vf); void GBAGetGameCode(struct GBA* gba, char* out); +void GBAGetGameTitle(struct GBA* gba, char* out); __attribute__((format (printf, 3, 4))) void GBALog(struct GBA* gba, enum GBALogLevel level, const char* format, ...);