GB, GBA: Make file type checking functions public API
Vicki Pfau vi@endrift.com
Sun, 30 Jun 2019 11:33:47 -0700
5 files changed,
12 insertions(+),
8 deletions(-)
M
include/mgba/gb/interface.h
→
include/mgba/gb/interface.h
@@ -47,6 +47,11 @@ void (*writeSB)(struct GBSIODriver* driver, uint8_t value);
uint8_t (*writeSC)(struct GBSIODriver* driver, uint8_t value); }; +struct VFile; + +bool GBIsROM(struct VFile* vf); +bool GBIsBIOS(struct VFile* vf); + enum GBModel GBNameToModel(const char*); const char* GBModelToName(enum GBModel);
M
include/mgba/gba/interface.h
→
include/mgba/gba/interface.h
@@ -38,6 +38,7 @@ struct GBA;
struct GBAAudio; struct GBASIO; struct GBAVideoRenderer; +struct VFile; extern MGBA_EXPORT const int GBA_LUX_LEVELS[10];@@ -45,6 +46,10 @@ enum {
mPERIPH_GBA_LUMINANCE = 0x1000, mPERIPH_GBA_BATTLECHIP_GATE, }; + +bool GBAIsROM(struct VFile* vf); +bool GBAIsMB(struct VFile* vf); +bool GBAIsBIOS(struct VFile* vf); struct GBALuminanceSource { void (*sample)(struct GBALuminanceSource*);
M
include/mgba/internal/gb/gb.h
→
include/mgba/internal/gb/gb.h
@@ -163,7 +163,6 @@ bool GBLoadSave(struct GB* gb, struct VFile* vf);
void GBUnloadROM(struct GB* gb); void GBSynthesizeROM(struct VFile* vf); -bool GBIsBIOS(struct VFile* vf); void GBLoadBIOS(struct GB* gb, struct VFile* vf); void GBSramClean(struct GB* gb, uint32_t frameCount);@@ -174,7 +173,6 @@
struct Patch; void GBApplyPatch(struct GB* gb, struct Patch* patch); -bool GBIsROM(struct VFile* vf); void GBGetGameTitle(const struct GB* gba, char* out); void GBGetGameCode(const struct GB* gba, char* out);
M
include/mgba/internal/gba/gba.h
→
include/mgba/internal/gba/gba.h
@@ -169,9 +169,6 @@
bool GBALoadMB(struct GBA* gba, struct VFile* vf); bool GBALoadNull(struct GBA* gba); -bool GBAIsROM(struct VFile* vf); -bool GBAIsMB(struct VFile* vf); -bool GBAIsBIOS(struct VFile* vf); void GBAGetGameCode(const struct GBA* gba, char* out); void GBAGetGameTitle(const struct GBA* gba, char* out);
M
src/core/core.c
→
src/core/core.c
@@ -17,12 +17,11 @@ #endif
#ifdef M_CORE_GB #include <mgba/gb/core.h> -// TODO: Fix layering violation -#include <mgba/internal/gb/gb.h> +#include <mgba/gb/interface.h> #endif #ifdef M_CORE_GBA #include <mgba/gba/core.h> -#include <mgba/internal/gba/gba.h> +#include <mgba/gba/interface.h> #endif #ifndef MINIMAL_CORE #include <mgba/feature/video-logger.h>