From 09cce3627bfbe45ab3234ddae06105d5e4cf29c7 Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Sun, 30 Jun 2019 11:33:47 -0700 Subject: [PATCH] GB, GBA: Make file type checking functions public API --- include/mgba/gb/interface.h | 5 +++++ include/mgba/gba/interface.h | 5 +++++ include/mgba/internal/gb/gb.h | 2 -- include/mgba/internal/gba/gba.h | 3 --- src/core/core.c | 5 ++--- 5 files changed, 12 insertions(+), 8 deletions(-) diff --git a/include/mgba/gb/interface.h b/include/mgba/gb/interface.h index 809c0ca36..300846c6a 100644 --- a/include/mgba/gb/interface.h +++ b/include/mgba/gb/interface.h @@ -47,6 +47,11 @@ struct GBSIODriver { 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); diff --git a/include/mgba/gba/interface.h b/include/mgba/gba/interface.h index 33c7a8e88..8c725e161 100644 --- a/include/mgba/gba/interface.h +++ b/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]; @@ -46,6 +47,10 @@ enum { 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*); diff --git a/include/mgba/internal/gb/gb.h b/include/mgba/internal/gb/gb.h index 7d007296a..22abf2080 100644 --- a/include/mgba/internal/gb/gb.h +++ b/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 @@ void GBSavedataUnmask(struct GB* gb); 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); diff --git a/include/mgba/internal/gba/gba.h b/include/mgba/internal/gba/gba.h index f1b3fa2f5..fffd46936 100644 --- a/include/mgba/internal/gba/gba.h +++ b/include/mgba/internal/gba/gba.h @@ -169,9 +169,6 @@ void GBAApplyPatch(struct GBA* gba, struct Patch* patch); 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); diff --git a/src/core/core.c b/src/core/core.c index af3ff68a8..80de0e6bb 100644 --- a/src/core/core.c +++ b/src/core/core.c @@ -17,12 +17,11 @@ #ifdef M_CORE_GB #include -// TODO: Fix layering violation -#include +#include #endif #ifdef M_CORE_GBA #include -#include +#include #endif #ifndef MINIMAL_CORE #include