GB, GBA: Move more override-adjacent stuff to public API

This commit is contained in:
Vicki Pfau 2024-03-25 01:47:32 -07:00
parent 318c5d7435
commit a430f58c15
9 changed files with 33 additions and 33 deletions

View File

@ -82,6 +82,12 @@ struct GBCartridgeOverride {
uint32_t gbColors[12]; uint32_t gbColors[12];
}; };
struct GBColorPreset {
const char* name;
uint32_t colors[12];
};
struct Configuration;
struct VFile; struct VFile;
bool GBIsROM(struct VFile* vf); bool GBIsROM(struct VFile* vf);
@ -93,6 +99,12 @@ const char* GBModelToName(enum GBModel);
int GBValidModels(const uint8_t* bank0); int GBValidModels(const uint8_t* bank0);
bool GBOverrideFind(const struct Configuration*, struct GBCartridgeOverride* override);
bool GBOverrideColorFind(struct GBCartridgeOverride* override, enum GBColorLookup);
void GBOverrideSave(struct Configuration*, const struct GBCartridgeOverride* override);
size_t GBColorPresetList(const struct GBColorPreset** presets);
CXX_GUARD_END CXX_GUARD_END
#endif #endif

View File

@ -71,7 +71,7 @@ enum GBAHardwareDevice {
HW_EREADER = 128 HW_EREADER = 128
}; };
struct GBA; struct Configuration;
struct GBAAudio; struct GBAAudio;
struct GBASIO; struct GBASIO;
struct GBAVideoRenderer; struct GBAVideoRenderer;
@ -84,9 +84,13 @@ enum {
mPERIPH_GBA_BATTLECHIP_GATE, mPERIPH_GBA_BATTLECHIP_GATE,
}; };
bool GBAIsROM(struct VFile* vf); struct GBACartridgeOverride {
bool GBAIsMB(struct VFile* vf); char id[4];
bool GBAIsBIOS(struct VFile* vf); enum GBASavedataType savetype;
int hardware;
uint32_t idleLoop;
bool vbaBugCompat;
};
struct GBALuminanceSource { struct GBALuminanceSource {
void (*sample)(struct GBALuminanceSource*); void (*sample)(struct GBALuminanceSource*);
@ -94,6 +98,13 @@ struct GBALuminanceSource {
uint8_t (*readLuminance)(struct GBALuminanceSource*); uint8_t (*readLuminance)(struct GBALuminanceSource*);
}; };
bool GBAIsROM(struct VFile* vf);
bool GBAIsMB(struct VFile* vf);
bool GBAIsBIOS(struct VFile* vf);
bool GBAOverrideFind(const struct Configuration*, struct GBACartridgeOverride* override);
void GBAOverrideSave(struct Configuration*, const struct GBACartridgeOverride* override);
struct GBASIODriver { struct GBASIODriver {
struct GBASIO* p; struct GBASIO* p;
@ -104,14 +115,6 @@ struct GBASIODriver {
uint16_t (*writeRegister)(struct GBASIODriver* driver, uint32_t address, uint16_t value); uint16_t (*writeRegister)(struct GBASIODriver* driver, uint32_t address, uint16_t value);
}; };
struct GBACartridgeOverride {
char id[4];
enum GBASavedataType savetype;
int hardware;
uint32_t idleLoop;
bool vbaBugCompat;
};
void GBASIOJOYCreate(struct GBASIODriver* sio); void GBASIOJOYCreate(struct GBASIODriver* sio);
enum GBASIOBattleChipGateFlavor { enum GBASIOBattleChipGateFlavor {
@ -132,6 +135,7 @@ struct GBASIOBattlechipGate {
void GBASIOBattlechipGateCreate(struct GBASIOBattlechipGate*); void GBASIOBattlechipGateCreate(struct GBASIOBattlechipGate*);
struct GBA;
void GBACartEReaderQueueCard(struct GBA* gba, const void* data, size_t size); void GBACartEReaderQueueCard(struct GBA* gba, const void* data, size_t size);
struct EReaderScan; struct EReaderScan;

View File

@ -12,18 +12,6 @@ CXX_GUARD_START
#include <mgba/gb/interface.h> #include <mgba/gb/interface.h>
struct GBColorPreset {
const char* name;
uint32_t colors[12];
};
struct Configuration;
bool GBOverrideFind(const struct Configuration*, struct GBCartridgeOverride* override);
bool GBOverrideColorFind(struct GBCartridgeOverride* override, enum GBColorLookup);
void GBOverrideSave(struct Configuration*, const struct GBCartridgeOverride* override);
size_t GBColorPresetList(const struct GBColorPreset** presets);
struct GB; struct GB;
void GBOverrideApply(struct GB*, const struct GBCartridgeOverride*); void GBOverrideApply(struct GB*, const struct GBCartridgeOverride*);
void GBOverrideApplyDefaults(struct GB*); void GBOverrideApplyDefaults(struct GB*);

View File

@ -12,10 +12,6 @@ CXX_GUARD_START
#include <mgba/gba/interface.h> #include <mgba/gba/interface.h>
struct Configuration;
bool GBAOverrideFind(const struct Configuration*, struct GBACartridgeOverride* override);
void GBAOverrideSave(struct Configuration*, const struct GBACartridgeOverride* override);
struct GBA; struct GBA;
void GBAOverrideApply(struct GBA*, const struct GBACartridgeOverride*); void GBAOverrideApply(struct GBA*, const struct GBACartridgeOverride*);
void GBAOverrideApplyDefaults(struct GBA*, const struct Configuration*); void GBAOverrideApplyDefaults(struct GBA*, const struct Configuration*);

View File

@ -12,7 +12,7 @@
#include <mgba/internal/gba/gba.h> #include <mgba/internal/gba/gba.h>
#ifdef M_CORE_GB #ifdef M_CORE_GB
#include <mgba/internal/gb/gb.h> #include <mgba/internal/gb/gb.h>
#include <mgba/internal/gb/overrides.h> #include <mgba/gb/interface.h>
#endif #endif
#include <mgba-util/gui/file-select.h> #include <mgba-util/gui/file-select.h>
#include <mgba-util/gui/menu.h> #include <mgba-util/gui/menu.h>

View File

@ -13,7 +13,7 @@
#include <mgba/feature/commandline.h> #include <mgba/feature/commandline.h>
#ifdef M_CORE_GB #ifdef M_CORE_GB
#include <mgba/internal/gb/overrides.h> #include <mgba/gb/interface.h>
#endif #endif
static const mOption s_frontendOptions[] = { static const mOption s_frontendOptions[] = {

View File

@ -7,7 +7,7 @@
#include "Override.h" #include "Override.h"
#include <mgba/internal/gba/overrides.h> #include <mgba/gba/interface.h>
namespace QGBA { namespace QGBA {

View File

@ -7,7 +7,7 @@
#include "Override.h" #include "Override.h"
#include <mgba/internal/gb/overrides.h> #include <mgba/gb/interface.h>
namespace QGBA { namespace QGBA {

View File

@ -18,7 +18,7 @@
#ifdef M_CORE_GB #ifdef M_CORE_GB
#include "GameBoy.h" #include "GameBoy.h"
#include <mgba/internal/gb/overrides.h> #include <mgba/gb/interface.h>
#endif #endif
#include <mgba/core/serialize.h> #include <mgba/core/serialize.h>