all repos — mgba @ a760c7bb4a85c8abea17ff9db466e96ebe20a8de

mGBA Game Boy Advance Emulator

Core: Add prefix to platform enum names
Vicki Pfau vi@endrift.com
Sat, 26 Dec 2020 18:53:19 -0800
commit

a760c7bb4a85c8abea17ff9db466e96ebe20a8de

parent

18403682f7824b7fa76fac4ada63386c5e0e34dc

M include/mgba/core/core.hinclude/mgba/core/core.h

@@ -23,17 +23,13 @@ #include <mgba/debugger/debugger.h>

#endif enum mPlatform { - PLATFORM_NONE = -1, -#ifdef M_CORE_GBA - PLATFORM_GBA = 0, -#endif -#ifdef M_CORE_GB - PLATFORM_GB = 1, -#endif + mPLATFORM_NONE = -1, + mPLATFORM_GBA = 0, + mPLATFORM_GB = 1, }; enum mCoreChecksumType { - CHECKSUM_CRC32, + mCHECKSUM_CRC32, }; struct mCoreConfig;
M src/core/core.csrc/core/core.c

@@ -33,12 +33,12 @@ struct mCore* (*open)(void);

enum mPlatform platform; } _filters[] = { #ifdef M_CORE_GBA - { GBAIsROM, GBACoreCreate, PLATFORM_GBA }, + { GBAIsROM, GBACoreCreate, mPLATFORM_GBA }, #endif #ifdef M_CORE_GB - { GBIsROM, GBCoreCreate, PLATFORM_GB }, + { GBIsROM, GBCoreCreate, mPLATFORM_GB }, #endif - { 0, 0, PLATFORM_NONE } + { 0, 0, mPLATFORM_NONE } }; struct mCore* mCoreFindVF(struct VFile* vf) {

@@ -62,7 +62,7 @@ }

enum mPlatform mCoreIsCompatible(struct VFile* vf) { if (!vf) { - return PLATFORM_NONE; + return mPLATFORM_NONE; } const struct mCoreFilter* filter; for (filter = &_filters[0]; filter->filter; ++filter) {

@@ -70,7 +70,7 @@ if (filter->filter(vf)) {

return filter->platform; } } - return PLATFORM_NONE; + return mPLATFORM_NONE; } #if !defined(MINIMAL_CORE) || MINIMAL_CORE < 2
M src/core/library.csrc/core/library.c

@@ -85,7 +85,7 @@ sqlite3_bind_int(statement, useIndex, 1);

sqlite3_bind_text(statement, index, constraints->internalCode, -1, SQLITE_TRANSIENT); } - if (constraints->platform != PLATFORM_NONE) { + if (constraints->platform != mPLATFORM_NONE) { useIndex = sqlite3_bind_parameter_index(statement, ":usePlatform"); index = sqlite3_bind_parameter_index(statement, ":platform"); sqlite3_bind_int(statement, useIndex, 1);

@@ -274,7 +274,7 @@ core->loadROM(core, vf);

core->getGameTitle(core, entry.internalTitle); core->getGameCode(core, entry.internalCode); - core->checksum(core, &entry.crc32, CHECKSUM_CRC32); + core->checksum(core, &entry.crc32, mCHECKSUM_CRC32); entry.platform = core->platform(core); entry.title = NULL; entry.base = base;
M src/feature/gui/gui-runner.csrc/feature/gui/gui-runner.c

@@ -413,7 +413,7 @@ mLOG(GUI_RUNNER, WARN, "Failed to find core for %s!", path);

GUIShowMessageBox(&runner->params, GUI_MESSAGE_BOX_OK, 240, "Load failed!"); return; } - if (runner->core->platform(runner->core) == PLATFORM_GBA) { + if (runner->core->platform(runner->core) == mPLATFORM_GBA) { runner->core->setPeripheral(runner->core, mPERIPH_GBA_LUMINANCE, &runner->luminanceSource.d); } mLOG(GUI_RUNNER, DEBUG, "Loading config...");
M src/feature/video-logger.csrc/feature/video-logger.c

@@ -30,12 +30,12 @@ enum mPlatform platform;

struct mCore* (*open)(void); } _descriptors[] = { #ifdef M_CORE_GBA - { PLATFORM_GBA, GBAVideoLogPlayerCreate }, + { mPLATFORM_GBA, GBAVideoLogPlayerCreate }, #endif #ifdef M_CORE_GB - { PLATFORM_GB, GBVideoLogPlayerCreate }, + { mPLATFORM_GB, GBVideoLogPlayerCreate }, #endif - { PLATFORM_NONE, 0 } + { mPLATFORM_NONE, 0 } }; enum mVLBlockType {

@@ -1060,12 +1060,12 @@ enum mPlatform platform;

LOAD_32LE(platform, 0, &header.platform); const struct mVLDescriptor* descriptor; - for (descriptor = &_descriptors[0]; descriptor->platform != PLATFORM_NONE; ++descriptor) { + for (descriptor = &_descriptors[0]; descriptor->platform != mPLATFORM_NONE; ++descriptor) { if (platform == descriptor->platform) { break; } } - if (descriptor->platform == PLATFORM_NONE) { + if (descriptor->platform == mPLATFORM_NONE) { return NULL; } return descriptor;

@@ -1076,7 +1076,7 @@ const struct mVLDescriptor* descriptor = _mVideoLogDescriptor(vf);

if (descriptor) { return descriptor->platform; } - return PLATFORM_NONE; + return mPLATFORM_NONE; } struct mCore* mVideoLogCoreFind(struct VFile* vf) {
M src/gb/core.csrc/gb/core.c

@@ -149,7 +149,7 @@ }

static enum mPlatform _GBCorePlatform(const struct mCore* core) { UNUSED(core); - return PLATFORM_GB; + return mPLATFORM_GB; } static bool _GBCoreSupportsFeature(const struct mCore* core, enum mCoreFeature feature) {

@@ -420,7 +420,7 @@

static void _GBCoreChecksum(const struct mCore* core, void* data, enum mCoreChecksumType type) { struct GB* gb = (struct GB*) core->board; switch (type) { - case CHECKSUM_CRC32: + case mCHECKSUM_CRC32: memcpy(data, &gb->romCrc32, sizeof(gb->romCrc32)); break; }
M src/gb/test/core.csrc/gb/test/core.c

@@ -20,7 +20,7 @@

M_TEST_DEFINE(platform) { struct mCore* core = GBCoreCreate(); assert_non_null(core); - assert_int_equal(core->platform(core), PLATFORM_GB); + assert_int_equal(core->platform(core), mPLATFORM_GB); assert_true(core->init(core)); core->deinit(core); }

@@ -52,7 +52,7 @@ GBSynthesizeROM(vf);

assert_true(GBIsROM(vf)); struct mCore* core = mCoreFindVF(vf); assert_non_null(core); - assert_int_equal(core->platform(core), PLATFORM_GB); + assert_int_equal(core->platform(core), mPLATFORM_GB); vf->close(vf); assert_true(core->init(core));
M src/gba/core.csrc/gba/core.c

@@ -241,7 +241,7 @@ }

static enum mPlatform _GBACorePlatform(const struct mCore* core) { UNUSED(core); - return PLATFORM_GBA; + return mPLATFORM_GBA; } static bool _GBACoreSupportsFeature(const struct mCore* core, enum mCoreFeature feature) {

@@ -549,7 +549,7 @@

static void _GBACoreChecksum(const struct mCore* core, void* data, enum mCoreChecksumType type) { struct GBA* gba = (struct GBA*) core->board; switch (type) { - case CHECKSUM_CRC32: + case mCHECKSUM_CRC32: memcpy(data, &gba->romCrc32, sizeof(gba->romCrc32)); break; }
M src/gba/test/core.csrc/gba/test/core.c

@@ -18,7 +18,7 @@

M_TEST_DEFINE(platform) { struct mCore* core = GBACoreCreate(); assert_non_null(core); - assert_true(core->platform(core) == PLATFORM_GBA); + assert_true(core->platform(core) == mPLATFORM_GBA); assert_true(core->init(core)); core->deinit(core); }
M src/platform/3ds/main.csrc/platform/3ds/main.c

@@ -328,7 +328,7 @@ static void _gameLoaded(struct mGUIRunner* runner) {

switch (runner->core->platform(runner->core)) { #ifdef M_CORE_GBA // TODO: Move these to callbacks - case PLATFORM_GBA: + case mPLATFORM_GBA: if (((struct GBA*) runner->core->board)->memory.hw.devices & HW_TILT) { HIDUSER_EnableAccelerometer(); }

@@ -338,7 +338,7 @@ }

break; #endif #ifdef M_CORE_GB - case PLATFORM_GB: + case mPLATFORM_GB: if (((struct GB*) runner->core->board)->memory.mbcType == GB_MBC7) { HIDUSER_EnableAccelerometer(); }

@@ -412,7 +412,7 @@

switch (runner->core->platform(runner->core)) { #ifdef M_CORE_GBA // TODO: Move these to callbacks - case PLATFORM_GBA: + case mPLATFORM_GBA: if (((struct GBA*) runner->core->board)->memory.hw.devices & HW_TILT) { HIDUSER_DisableAccelerometer(); }

@@ -422,7 +422,7 @@ }

break; #endif #ifdef M_CORE_GB - case PLATFORM_GB: + case mPLATFORM_GB: if (((struct GB*) runner->core->board)->memory.mbcType == GB_MBC7) { HIDUSER_DisableAccelerometer(); }
M src/platform/libretro/libretro.csrc/platform/libretro/libretro.c

@@ -257,7 +257,7 @@ core->desiredVideoDimensions(core, &width, &height);

info->geometry.base_width = width; info->geometry.base_height = height; #ifdef M_CORE_GB - if (core->platform(core) == PLATFORM_GB) { + if (core->platform(core) == mPLATFORM_GB) { info->geometry.max_width = 256; info->geometry.max_height = 224; } else

@@ -453,7 +453,7 @@ }

static void _setupMaps(struct mCore* core) { #ifdef M_CORE_GBA - if (core->platform(core) == PLATFORM_GBA) { + if (core->platform(core) == mPLATFORM_GBA) { struct GBA* gba = core->board; struct retro_memory_descriptor descs[11]; struct retro_memory_map mmaps;

@@ -534,7 +534,7 @@ environCallback(RETRO_ENVIRONMENT_SET_SUPPORT_ACHIEVEMENTS, &yes);

} #endif #ifdef M_CORE_GB - if (core->platform(core) == PLATFORM_GB) { + if (core->platform(core) == mPLATFORM_GB) { struct GB* gb = core->board; struct retro_memory_descriptor descs[11]; struct retro_memory_map mmaps;

@@ -689,7 +689,7 @@ char biosPath[PATH_MAX];

environCallback(RETRO_ENVIRONMENT_GET_SYSTEM_DIRECTORY, &sysDir); #ifdef M_CORE_GBA - if (core->platform(core) == PLATFORM_GBA) { + if (core->platform(core) == mPLATFORM_GBA) { core->setPeripheral(core, mPERIPH_GBA_LUMINANCE, &lux); biosName = "gba_bios.bin";

@@ -697,7 +697,7 @@ }

#endif #ifdef M_CORE_GB - if (core->platform(core) == PLATFORM_GB) { + if (core->platform(core) == mPLATFORM_GB) { memset(&cam, 0, sizeof(cam)); cam.height = GBCAM_HEIGHT; cam.width = GBCAM_WIDTH;

@@ -814,7 +814,7 @@ mCheatAddSet(device, cheatSet);

} // Convert the super wonky unportable libretro format to something normal #ifdef M_CORE_GBA - if (core->platform(core) == PLATFORM_GBA) { + if (core->platform(core) == mPLATFORM_GBA) { char realCode[] = "XXXXXXXX XXXXXXXX"; size_t len = strlen(code) + 1; // Include null terminator size_t i, pos;

@@ -835,7 +835,7 @@ }

} #endif #ifdef M_CORE_GB - if (core->platform(core) == PLATFORM_GB) { + if (core->platform(core) == mPLATFORM_GB) { char realCode[] = "XXX-XXX-XXX"; size_t len = strlen(code) + 1; // Include null terminator size_t i, pos;

@@ -881,7 +881,7 @@ return savedata;

case RETRO_MEMORY_RTC: switch (core->platform(core)) { #ifdef M_CORE_GB - case PLATFORM_GB: + case mPLATFORM_GB: switch (((struct GB*) core->board)->memory.mbcType) { case GB_MBC3_RTC: return &((uint8_t*) savedata)[((struct GB*) core->board)->sramSize];

@@ -903,7 +903,7 @@ switch (id) {

case RETRO_MEMORY_SAVE_RAM: switch (core->platform(core)) { #ifdef M_CORE_GBA - case PLATFORM_GBA: + case mPLATFORM_GBA: switch (((struct GBA*) core->board)->memory.savedata.type) { case SAVEDATA_AUTODETECT: return SIZE_CART_FLASH1M;

@@ -912,7 +912,7 @@ return GBASavedataSize(&((struct GBA*) core->board)->memory.savedata);

} #endif #ifdef M_CORE_GB - case PLATFORM_GB: + case mPLATFORM_GB: return ((struct GB*) core->board)->sramSize; #endif default:

@@ -922,7 +922,7 @@ break;

case RETRO_MEMORY_RTC: switch (core->platform(core)) { #ifdef M_CORE_GB - case PLATFORM_GB: + case mPLATFORM_GB: switch (((struct GB*) core->board)->memory.mbcType) { case GB_MBC3_RTC: return sizeof(struct GBMBCRTCSaveBuffer);
M src/platform/psp2/psp2-context.csrc/platform/psp2/psp2-context.c

@@ -383,14 +383,14 @@ blip_set_rates(runner->core->getAudioChannel(runner->core, 1), runner->core->frequency(runner->core), 48000 * ratio);

switch (runner->core->platform(runner->core)) { #ifdef M_CORE_GBA - case PLATFORM_GBA: + case mPLATFORM_GBA: if (((struct GBA*) runner->core->board)->memory.hw.devices & (HW_TILT | HW_GYRO)) { sceMotionStartSampling(); } break; #endif #ifdef M_CORE_GB - case PLATFORM_GB: + case mPLATFORM_GB: if (((struct GB*) runner->core->board)->memory.mbcType == GB_MBC7) { sceMotionStartSampling(); }

@@ -430,14 +430,14 @@

void mPSP2UnloadROM(struct mGUIRunner* runner) { switch (runner->core->platform(runner->core)) { #ifdef M_CORE_GBA - case PLATFORM_GBA: + case mPLATFORM_GBA: if (((struct GBA*) runner->core->board)->memory.hw.devices & (HW_TILT | HW_GYRO)) { sceMotionStopSampling(); } break; #endif #ifdef M_CORE_GB - case PLATFORM_GB: + case mPLATFORM_GB: if (((struct GB*) runner->core->board)->memory.mbcType == GB_MBC7) { sceMotionStopSampling(); }

@@ -588,12 +588,12 @@ void mPSP2Swap(struct mGUIRunner* runner) {

bool frameAvailable = true; switch (runner->core->platform(runner->core)) { #ifdef M_CORE_GBA - case PLATFORM_GBA: + case mPLATFORM_GBA: frameAvailable = ((struct GBA*) runner->core->board)->video.frameskipCounter <= 0; break; #endif #ifdef M_CORE_GB - case PLATFORM_GB: + case mPLATFORM_GB: frameAvailable = ((struct GB*) runner->core->board)->video.frameskipCounter <= 0; break; #endif
M src/platform/python/mgba/core.pysrc/platform/python/mgba/core.py

@@ -117,11 +117,11 @@ callback()

class Core(object): - if hasattr(lib, 'PLATFORM_GBA'): - PLATFORM_GBA = lib.PLATFORM_GBA + if hasattr(lib, 'mPLATFORM_GBA'): + PLATFORM_GBA = lib.mPLATFORM_GBA - if hasattr(lib, 'PLATFORM_GB'): - PLATFORM_GB = lib.PLATFORM_GB + if hasattr(lib, 'mPLATFORM_GB'): + PLATFORM_GB = lib.mPLATFORM_GB def __init__(self, native): self._core = native
M src/platform/qt/AssetTile.cppsrc/platform/qt/AssetTile.cpp

@@ -49,14 +49,14 @@ void AssetTile::setController(std::shared_ptr<CoreController> controller) {

m_cacheSet = controller->graphicCaches(); switch (controller->platform()) { #ifdef M_CORE_GBA - case PLATFORM_GBA: + case mPLATFORM_GBA: m_addressWidth = 8; m_addressBase = BASE_VRAM; m_boundaryBase = BASE_VRAM | 0x10000; break; #endif #ifdef M_CORE_GB - case PLATFORM_GB: + case mPLATFORM_GB: m_addressWidth = 4; m_addressBase = GB_BASE_VRAM; m_boundaryBase = GB_BASE_VRAM;
M src/platform/qt/AssetView.cppsrc/platform/qt/AssetView.cpp

@@ -43,12 +43,12 @@

void AssetView::updateTiles(bool force) { switch (m_controller->platform()) { #ifdef M_CORE_GBA - case PLATFORM_GBA: + case mPLATFORM_GBA: updateTilesGBA(force); break; #endif #ifdef M_CORE_GB - case PLATFORM_GB: + case mPLATFORM_GB: updateTilesGB(force); break; #endif

@@ -156,11 +156,11 @@

bool AssetView::lookupObj(int id, struct ObjInfo* info) { switch (m_controller->platform()) { #ifdef M_CORE_GBA - case PLATFORM_GBA: + case mPLATFORM_GBA: return lookupObjGBA(id, info); #endif #ifdef M_CORE_GB - case PLATFORM_GB: + case mPLATFORM_GB: return lookupObjGB(id, info); #endif default:
M src/platform/qt/CheatsView.cppsrc/platform/qt/CheatsView.cpp

@@ -41,7 +41,7 @@

QPushButton* add; switch (controller->platform()) { #ifdef M_CORE_GBA - case PLATFORM_GBA: + case mPLATFORM_GBA: connect(m_ui.add, &QPushButton::clicked, [this]() { enterCheat(GBA_CHEAT_AUTODETECT); });

@@ -66,7 +66,7 @@ });

break; #endif #ifdef M_CORE_GB - case PLATFORM_GB: + case mPLATFORM_GB: connect(m_ui.add, &QPushButton::clicked, [this]() { enterCheat(GB_CHEAT_AUTODETECT); });
M src/platform/qt/CoreController.cppsrc/platform/qt/CoreController.cpp

@@ -51,7 +51,7 @@ CoreController* controller = static_cast<CoreController*>(context->userData);

switch (context->core->platform(context->core)) { #ifdef M_CORE_GBA - case PLATFORM_GBA: + case mPLATFORM_GBA: context->core->setPeripheral(context->core, mPERIPH_GBA_LUMINANCE, controller->m_inputController->luminance()); break; #endif

@@ -332,7 +332,7 @@ }

Interrupter interrupter(this); switch (platform()) { #ifdef M_CORE_GBA - case PLATFORM_GBA: { + case mPLATFORM_GBA: { GBA* gba = static_cast<GBA*>(m_threadContext.core->board); m_cacheSet = std::make_unique<mCacheSet>(); GBAVideoCacheInit(m_cacheSet.get());

@@ -341,7 +341,7 @@ break;

} #endif #ifdef M_CORE_GB - case PLATFORM_GB: { + case mPLATFORM_GB: { GB* gb = static_cast<GB*>(m_threadContext.core->board); m_cacheSet = std::make_unique<mCacheSet>(); GBVideoCacheInit(m_cacheSet.get());

@@ -704,16 +704,16 @@ Interrupter interrupter(this);

switch (platform()) { #ifdef M_CORE_GBA - case PLATFORM_GBA: + case mPLATFORM_GBA: GBAYankROM(static_cast<GBA*>(m_threadContext.core->board)); break; #endif #ifdef M_CORE_GB - case PLATFORM_GB: + case mPLATFORM_GB: GBYankROM(static_cast<GB*>(m_threadContext.core->board)); break; #endif - case PLATFORM_NONE: + case mPLATFORM_NONE: LOG(QT, ERROR) << tr("Can't yank pack in unexpected platform!"); break; }

@@ -786,7 +786,7 @@

void CoreController::importSharkport(const QString& path) { #ifdef M_CORE_GBA - if (platform() != PLATFORM_GBA) { + if (platform() != mPLATFORM_GBA) { return; } VFile* vf = VFileDevice::open(path, O_RDONLY);

@@ -802,7 +802,7 @@ }

void CoreController::exportSharkport(const QString& path) { #ifdef M_CORE_GBA - if (platform() != PLATFORM_GBA) { + if (platform() != mPLATFORM_GBA) { return; } VFile* vf = VFileDevice::open(path, O_WRONLY | O_CREAT | O_TRUNC);

@@ -818,7 +818,7 @@ }

#ifdef M_CORE_GB void CoreController::attachPrinter() { - if (platform() != PLATFORM_GB) { + if (platform() != mPLATFORM_GB) { return; } GB* gb = static_cast<GB*>(m_threadContext.core->board);

@@ -850,7 +850,7 @@ GBSIOSetDriver(&gb->sio, &m_printer.d.d);

} void CoreController::detachPrinter() { - if (platform() != PLATFORM_GB) { + if (platform() != mPLATFORM_GB) { return; } Interrupter interrupter(this);

@@ -860,7 +860,7 @@ GBSIOSetDriver(&gb->sio, nullptr);

} void CoreController::endPrint() { - if (platform() != PLATFORM_GB) { + if (platform() != mPLATFORM_GB) { return; } Interrupter interrupter(this);

@@ -870,7 +870,7 @@ #endif

#ifdef M_CORE_GBA void CoreController::attachBattleChipGate() { - if (platform() != PLATFORM_GBA) { + if (platform() != mPLATFORM_GBA) { return; } Interrupter interrupter(this);

@@ -880,7 +880,7 @@ m_threadContext.core->setPeripheral(m_threadContext.core, mPERIPH_GBA_BATTLECHIP_GATE, &m_battlechip);

} void CoreController::detachBattleChipGate() { - if (platform() != PLATFORM_GBA) { + if (platform() != mPLATFORM_GBA) { return; } Interrupter interrupter(this);

@@ -888,7 +888,7 @@ m_threadContext.core->setPeripheral(m_threadContext.core, mPERIPH_GBA_BATTLECHIP_GATE, nullptr);

} void CoreController::setBattleChipId(uint16_t id) { - if (platform() != PLATFORM_GBA) { + if (platform() != mPLATFORM_GBA) { return; } Interrupter interrupter(this);

@@ -896,7 +896,7 @@ m_battlechip.chipId = id;

} void CoreController::setBattleChipFlavor(int flavor) { - if (platform() != PLATFORM_GBA) { + if (platform() != mPLATFORM_GBA) { return; } Interrupter interrupter(this);
M src/platform/qt/CoreManager.cppsrc/platform/qt/CoreManager.cpp

@@ -114,7 +114,7 @@ VFile* vf = nullptr;

VDir* archive = VDirOpenArchive(path.toUtf8().constData()); if (archive) { VFile* vfOriginal = VDirFindFirst(archive, [](VFile* vf) { - return mCoreIsCompatible(vf) != PLATFORM_NONE; + return mCoreIsCompatible(vf) != mPLATFORM_NONE; }); ssize_t size; if (vfOriginal && (size = vfOriginal->size(vfOriginal)) > 0) {

@@ -188,7 +188,7 @@

mCore* core = nullptr; switch (platform) { #ifdef M_CORE_GBA - case PLATFORM_GBA: + case mPLATFORM_GBA: core = GBACoreCreate(); break; #endif
M src/platform/qt/DiscordCoordinator.cppsrc/platform/qt/DiscordCoordinator.cpp

@@ -71,7 +71,7 @@ #ifdef USE_SQLITE3

const NoIntroDB* db = GBAApp::app()->gameDB(); NoIntroGame game{}; uint32_t crc32 = 0; - core->checksum(core, &crc32, CHECKSUM_CRC32); + core->checksum(core, &crc32, mCHECKSUM_CRC32); if (db && crc32 && NoIntroDBLookupGameByCRC(db, crc32, &game)) { s_title = QLatin1String(game.name);

@@ -91,4 +91,4 @@ }

} -}+}
M src/platform/qt/FrameView.cppsrc/platform/qt/FrameView.cpp

@@ -432,16 +432,16 @@ mVideoLogger* logger = m_vl->videoLogger;

mVideoLoggerInjectionPoint(logger, LOGGER_INJECTION_FIRST_SCANLINE); switch (m_controller->platform()) { #ifdef M_CORE_GBA - case PLATFORM_GBA: + case mPLATFORM_GBA: injectGBA(); break; #endif #ifdef M_CORE_GB - case PLATFORM_GB: + case mPLATFORM_GB: injectGB(); break; #endif - case PLATFORM_NONE: + case mPLATFORM_NONE: break; } if (m_ui.disableScanline->checkState() == Qt::Checked) {

@@ -544,7 +544,7 @@ m_vl->loadROM(m_vl, m_currentFrame);

m_currentFrame = nullptr; mCoreInitConfig(m_vl, nullptr); #ifdef M_CORE_GB - if (m_controller->platform() == PLATFORM_GB) { + if (m_controller->platform() == mPLATFORM_GB) { mCoreConfigSetIntValue(&m_vl->config, "sgb.borders", static_cast<GB*>(m_controller->thread()->core->board)->video.sgbBorders); m_vl->reloadConfigOption(m_vl, "sgb.borders", nullptr); }
M src/platform/qt/GBAOverride.cppsrc/platform/qt/GBAOverride.cpp

@@ -10,14 +10,14 @@

using namespace QGBA; void GBAOverride::apply(struct mCore* core) { - if (core->platform(core) != PLATFORM_GBA) { + if (core->platform(core) != mPLATFORM_GBA) { return; } GBAOverrideApply(static_cast<GBA*>(core->board), &override); } void GBAOverride::identify(const struct mCore* core) { - if (core->platform(core) != PLATFORM_GBA) { + if (core->platform(core) != mPLATFORM_GBA) { return; } char gameId[8];
M src/platform/qt/GBOverride.cppsrc/platform/qt/GBOverride.cpp

@@ -12,14 +12,14 @@

using namespace QGBA; void GBOverride::apply(struct mCore* core) { - if (core->platform(core) != PLATFORM_GB) { + if (core->platform(core) != mPLATFORM_GB) { return; } GBOverrideApply(static_cast<GB*>(core->board), &override); } void GBOverride::identify(const struct mCore* core) { - if (core->platform(core) != PLATFORM_GB) { + if (core->platform(core) != mPLATFORM_GB) { return; } GB* gb = static_cast<GB*>(core->board);
M src/platform/qt/IOViewer.cppsrc/platform/qt/IOViewer.cpp

@@ -1025,7 +1025,7 @@ // 0x04000208: IME

regGBA.append({ { tr("Enable IRQs"), 0 }, }); - s_registers[PLATFORM_GBA] = regGBA; + s_registers[mPLATFORM_GBA] = regGBA; #endif #ifdef M_CORE_GB QList<IOViewer::RegisterDescription> regGB;

@@ -1555,7 +1555,7 @@ { tr("Timer"), 2 },

{ tr("Serial"), 3 }, { tr("Joypad"), 4 }, }); - s_registers[PLATFORM_GB] = regGB; + s_registers[mPLATFORM_GB] = regGB; #endif return s_registers[platform]; }

@@ -1569,7 +1569,7 @@ const char* const* regs;

unsigned maxRegs; switch (controller->platform()) { #ifdef M_CORE_GB - case PLATFORM_GB: + case mPLATFORM_GB: regs = GBIORegisterNames; maxRegs = GB_REG_MAX; m_base = GB_BASE_IO;

@@ -1577,7 +1577,7 @@ m_width = 0;

break; #endif #ifdef M_CORE_GBA - case PLATFORM_GBA: + case mPLATFORM_GBA: regs = GBAIORegisterNames; maxRegs = REG_MAX >> 1; m_base = BASE_IO;
M src/platform/qt/MapView.cppsrc/platform/qt/MapView.cpp

@@ -40,7 +40,7 @@ m_ui.tile->setController(controller);

switch (m_controller->platform()) { #ifdef M_CORE_GBA - case PLATFORM_GBA: + case mPLATFORM_GBA: m_boundary = 2048; m_addressBase = BASE_VRAM; m_addressWidth = 8;

@@ -53,7 +53,7 @@ m_ui.bgInfo->addCustomProperty("transform", tr("Xform"));

break; #endif #ifdef M_CORE_GB - case PLATFORM_GB: + case mPLATFORM_GB: m_boundary = 1024; m_addressBase = GB_BASE_VRAM; m_addressWidth = 4;

@@ -167,7 +167,7 @@ int frame = 0;

QString offset(tr("N/A")); QString transform(tr("N/A")); #ifdef M_CORE_GBA - if (m_controller->platform() == PLATFORM_GBA) { + if (m_controller->platform() == mPLATFORM_GBA) { uint16_t* io = static_cast<GBA*>(m_controller->thread()->core->board)->memory.io; int mode = GBARegisterDISPCNTGetMode(io[REG_DISPCNT >> 1]); if (m_map == 2 && mode > 2) {

@@ -201,7 +201,7 @@ }

} #endif #ifdef M_CORE_GB - if (m_controller->platform() == PLATFORM_GB) { + if (m_controller->platform() == mPLATFORM_GB) { uint8_t* io = static_cast<GB*>(m_controller->thread()->core->board)->memory.io; int x = io[m_map == 0 ? 0x42 : 0x4A]; int y = io[m_map == 0 ? 0x43 : 0x4B];
M src/platform/qt/MultiplayerController.cppsrc/platform/qt/MultiplayerController.cpp

@@ -76,7 +76,7 @@ if (!id) {

for (int i = 1; i < controller->m_players.count(); ++i) { Player* player = &controller->m_players[i]; #ifdef M_CORE_GBA - if (player->controller->platform() == PLATFORM_GBA && player->gbaNode->d.p->mode != controller->m_players[0].gbaNode->d.p->mode) { + if (player->controller->platform() == mPLATFORM_GBA && player->gbaNode->d.p->mode != controller->m_players[0].gbaNode->d.p->mode) { player->controller->setSync(true); continue; }

@@ -86,12 +86,12 @@ player->cyclesPosted += cycles;

if (player->awake < 1) { switch (player->controller->platform()) { #ifdef M_CORE_GBA - case PLATFORM_GBA: + case mPLATFORM_GBA: player->gbaNode->nextEvent += player->cyclesPosted; break; #endif #ifdef M_CORE_GB - case PLATFORM_GB: + case mPLATFORM_GB: player->gbNode->nextEvent += player->cyclesPosted; break; #endif

@@ -144,12 +144,12 @@ Player* player = &controller->m_players[i];

player->controller->setSync(true); switch (player->controller->platform()) { #ifdef M_CORE_GBA - case PLATFORM_GBA: + case mPLATFORM_GBA: player->cyclesPosted += reinterpret_cast<GBASIOLockstep*>(lockstep)->players[0]->eventDiff; break; #endif #ifdef M_CORE_GB - case PLATFORM_GB: + case mPLATFORM_GB: player->cyclesPosted += reinterpret_cast<GBSIOLockstep*>(lockstep)->players[0]->eventDiff; break; #endif

@@ -159,12 +159,12 @@ }

if (player->awake < 1) { switch (player->controller->platform()) { #ifdef M_CORE_GBA - case PLATFORM_GBA: + case mPLATFORM_GBA: player->gbaNode->nextEvent += player->cyclesPosted; break; #endif #ifdef M_CORE_GB - case PLATFORM_GB: + case mPLATFORM_GB: player->gbNode->nextEvent += player->cyclesPosted; break; #endif

@@ -191,12 +191,12 @@

if (m_lockstep.attached == 0) { switch (controller->platform()) { #ifdef M_CORE_GBA - case PLATFORM_GBA: + case mPLATFORM_GBA: GBASIOLockstepInit(&m_gbaLockstep); break; #endif #ifdef M_CORE_GB - case PLATFORM_GB: + case mPLATFORM_GB: GBSIOLockstepInit(&m_gbLockstep); break; #endif

@@ -212,7 +212,7 @@ }

switch (controller->platform()) { #ifdef M_CORE_GBA - case PLATFORM_GBA: { + case mPLATFORM_GBA: { GBA* gba = static_cast<GBA*>(thread->core->board); GBASIOLockstepNode* node = new GBASIOLockstepNode;

@@ -228,7 +228,7 @@ return true;

} #endif #ifdef M_CORE_GB - case PLATFORM_GB: { + case mPLATFORM_GB: { GB* gb = static_cast<GB*>(thread->core->board); GBSIOLockstepNode* node = new GBSIOLockstepNode;

@@ -264,7 +264,7 @@ interrupters.append(m_players[i].controller);

} switch (controller->platform()) { #ifdef M_CORE_GBA - case PLATFORM_GBA: { + case mPLATFORM_GBA: { GBA* gba = static_cast<GBA*>(thread->core->board); GBASIOLockstepNode* node = reinterpret_cast<GBASIOLockstepNode*>(gba->sio.drivers.multiplayer); GBASIOSetDriver(&gba->sio, nullptr, SIO_MULTI);

@@ -277,7 +277,7 @@ break;

} #endif #ifdef M_CORE_GB - case PLATFORM_GB: { + case mPLATFORM_GB: { GB* gb = static_cast<GB*>(thread->core->board); GBSIOLockstepNode* node = reinterpret_cast<GBSIOLockstepNode*>(gb->sio.driver); GBSIOSetDriver(&gb->sio, nullptr);
M src/platform/qt/OverrideView.cppsrc/platform/qt/OverrideView.cpp

@@ -213,7 +213,7 @@ m_recheck.start();

switch (thread->core->platform(thread->core)) { #ifdef M_CORE_GBA - case PLATFORM_GBA: { + case mPLATFORM_GBA: { m_ui.tabWidget->setCurrentWidget(m_ui.tabGBA); GBA* gba = static_cast<GBA*>(thread->core->board); m_ui.savetype->setCurrentIndex(gba->memory.savedata.type + 1);

@@ -234,7 +234,7 @@ break;

} #endif #ifdef M_CORE_GB - case PLATFORM_GB: { + case mPLATFORM_GB: { m_ui.tabWidget->setCurrentWidget(m_ui.tabGB); GB* gb = static_cast<GB*>(thread->core->board); int index = m_ui.mbc->findData(gb->memory.mbcType);

@@ -252,7 +252,7 @@ }

break; } #endif - case PLATFORM_NONE: + case mPLATFORM_NONE: break; }
M src/platform/qt/PaletteView.cppsrc/platform/qt/PaletteView.cpp

@@ -35,7 +35,7 @@ m_ui.bgGrid->setDimensions(QSize(16, 16));

m_ui.objGrid->setDimensions(QSize(16, 16)); int count = 256; #ifdef M_CORE_GB - if (controller->platform() == PLATFORM_GB) { + if (controller->platform() == mPLATFORM_GB) { m_ui.bgGrid->setDimensions(QSize(4, 8)); m_ui.objGrid->setDimensions(QSize(4, 8)); m_ui.bgGrid->setSize(24);

@@ -72,13 +72,13 @@ const uint16_t* palette;

size_t count; switch (m_controller->platform()) { #ifdef M_CORE_GBA - case PLATFORM_GBA: + case mPLATFORM_GBA: palette = static_cast<GBA*>(m_controller->thread()->core->board)->video.palette; count = 256; break; #endif #ifdef M_CORE_GB - case PLATFORM_GB: + case mPLATFORM_GB: palette = static_cast<GB*>(m_controller->thread()->core->board)->video.palette; count = 32; break;

@@ -98,12 +98,12 @@ void PaletteView::selectIndex(int index) {

const uint16_t* palette; switch (m_controller->platform()) { #ifdef M_CORE_GBA - case PLATFORM_GBA: + case mPLATFORM_GBA: palette = static_cast<GBA*>(m_controller->thread()->core->board)->video.palette; break; #endif #ifdef M_CORE_GB - case PLATFORM_GB: + case mPLATFORM_GB: palette = static_cast<GB*>(m_controller->thread()->core->board)->video.palette; break; #endif
M src/platform/qt/ROMInfo.cppsrc/platform/qt/ROMInfo.cpp

@@ -44,18 +44,18 @@ } else {

m_ui.id->setText(tr("(unknown)")); } - core->checksum(core, &crc32, CHECKSUM_CRC32); + core->checksum(core, &crc32, mCHECKSUM_CRC32); switch (controller->thread()->core->platform(controller->thread()->core)) { #ifdef M_CORE_GBA - case PLATFORM_GBA: { + case mPLATFORM_GBA: { GBA* gba = static_cast<GBA*>(core->board); m_ui.size->setText(QString::number(gba->pristineRomSize) + tr(" bytes")); break; } #endif #ifdef M_CORE_GB - case PLATFORM_GB: { + case mPLATFORM_GB: { GB* gb = static_cast<GB*>(core->board); m_ui.size->setText(QString::number(gb->pristineRomSize) + tr(" bytes")); break;
M src/platform/qt/RegisterView.cppsrc/platform/qt/RegisterView.cpp

@@ -29,7 +29,7 @@ setLayout(layout);

switch (controller->platform()) { #ifdef M_CORE_GBA - case PLATFORM_GBA: + case mPLATFORM_GBA: addRegisters({ "r0", "r1",

@@ -52,7 +52,7 @@ });

break; #endif #ifdef M_CORE_GB - case PLATFORM_GB: + case mPLATFORM_GB: addRegisters({ "a", "f",

@@ -88,12 +88,12 @@

void RegisterView::updateRegisters() { switch (m_controller->platform()) { #ifdef M_CORE_GBA - case PLATFORM_GBA: + case mPLATFORM_GBA: updateRegistersARM(); break; #endif #ifdef M_CORE_GB - case PLATFORM_GB: + case mPLATFORM_GB: updateRegistersSM83(); break; #endif
M src/platform/qt/ReportView.cppsrc/platform/qt/ReportView.cpp

@@ -350,7 +350,7 @@ report << QString("Invalid game code");

} uint32_t crc32 = 0; - core->checksum(core, &crc32, CHECKSUM_CRC32); + core->checksum(core, &crc32, mCHECKSUM_CRC32); report << QString("CRC32: %1").arg(crc32, 8, 16, QChar('0')); #ifdef USE_SQLITE3
M src/platform/qt/SettingsView.cppsrc/platform/qt/SettingsView.cpp

@@ -554,7 +554,7 @@

m_controller->write(); emit pathsChanged(); - emit biosLoaded(PLATFORM_GBA, m_ui.gbaBios->text()); + emit biosLoaded(mPLATFORM_GBA, m_ui.gbaBios->text()); } void SettingsView::reloadConfig() {
M src/platform/qt/TileView.cppsrc/platform/qt/TileView.cpp

@@ -33,12 +33,12 @@ connect(m_ui.paletteId, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), this, &TileView::updatePalette);

switch (m_controller->platform()) { #ifdef M_CORE_GBA - case PLATFORM_GBA: + case mPLATFORM_GBA: m_ui.tile->setBoundary(2048, 0, 2); break; #endif #ifdef M_CORE_GB - case PLATFORM_GB: + case mPLATFORM_GB: m_ui.palette256->setEnabled(false); m_ui.tile->setBoundary(1024, 0, 0); break;

@@ -53,12 +53,12 @@ m_ui.paletteId->setValue(0);

} switch (m_controller->platform()) { #ifdef M_CORE_GBA - case PLATFORM_GBA: + case mPLATFORM_GBA: m_ui.tile->setBoundary(2048 >> selected, selected, selected + 2); break; #endif #ifdef M_CORE_GB - case PLATFORM_GB: + case mPLATFORM_GB: return; #endif default:
M src/platform/qt/Window.cppsrc/platform/qt/Window.cpp

@@ -1027,7 +1027,7 @@ const NoIntroDB* db = GBAApp::app()->gameDB();

NoIntroGame game{}; uint32_t crc32 = 0; mCore* core = m_controller->thread()->core; - core->checksum(m_controller->thread()->core, &crc32, CHECKSUM_CRC32); + core->checksum(m_controller->thread()->core, &crc32, mCHECKSUM_CRC32); QString filePath = windowFilePath(); if (m_config->getOption("showFilename").toInt() && !filePath.isNull()) {

@@ -1124,14 +1124,14 @@ m_actions.addAction(tr("Load &patch..."), "loadPatch", this, &Window::selectPatch, "file");

#ifdef M_CORE_GBA m_actions.addAction(tr("Boot BIOS"), "bootBIOS", [this]() { - setController(m_manager->loadBIOS(PLATFORM_GBA, m_config->getOption("gba.bios")), QString()); + setController(m_manager->loadBIOS(mPLATFORM_GBA, m_config->getOption("gba.bios")), QString()); }, "file"); #endif addGameAction(tr("Replace ROM..."), "replaceROM", this, &Window::replaceROM, "file"); #ifdef M_CORE_GBA Action* scanCard = addGameAction(tr("Scan e-Reader dotcodes..."), "scanCard", this, &Window::scanCard, "file"); - m_platformActions.insert(PLATFORM_GBA, scanCard); + m_platformActions.insert(mPLATFORM_GBA, scanCard); #endif addGameAction(tr("ROM &info..."), "romInfo", openControllerTView<ROMInfo>(), "file");

@@ -1205,10 +1205,10 @@

#ifdef M_CORE_GBA m_actions.addSeparator("file"); Action* importShark = addGameAction(tr("Import GameShark Save..."), "importShark", this, &Window::importSharkport, "file"); - m_platformActions.insert(PLATFORM_GBA, importShark); + m_platformActions.insert(mPLATFORM_GBA, importShark); Action* exportShark = addGameAction(tr("Export GameShark Save..."), "exportShark", this, &Window::exportSharkport, "file"); - m_platformActions.insert(PLATFORM_GBA, exportShark); + m_platformActions.insert(mPLATFORM_GBA, exportShark); #endif m_actions.addSeparator("file");

@@ -1326,12 +1326,12 @@ PrinterView* view = new PrinterView(m_controller);

openView(view); m_controller->attachPrinter(); }, "emu"); - m_platformActions.insert(PLATFORM_GB, gbPrint); + m_platformActions.insert(mPLATFORM_GB, gbPrint); #endif #ifdef M_CORE_GBA Action* bcGate = addGameAction(tr("BattleChip Gate..."), "bcGate", openControllerTView<BattleChipView>(this), "emu"); - m_platformActions.insert(PLATFORM_GBA, bcGate); + m_platformActions.insert(mPLATFORM_GBA, bcGate); #endif m_actions.addMenu(tr("Audio/&Video"), "av");

@@ -1503,7 +1503,7 @@ m_actions.addSeparator("tools");

m_actions.addAction(tr("Open debugger console..."), "debuggerWindow", this, &Window::consoleOpen, "tools"); #ifdef USE_GDB_STUB Action* gdbWindow = addGameAction(tr("Start &GDB server..."), "gdbWindow", this, &Window::gdbOpen, "tools"); - m_platformActions.insert(PLATFORM_GBA, gdbWindow); + m_platformActions.insert(mPLATFORM_GBA, gdbWindow); #endif #endif m_actions.addSeparator("tools");
M src/platform/qt/utils.cppsrc/platform/qt/utils.cpp

@@ -25,11 +25,11 @@ }

QString nicePlatformFormat(mPlatform platform) { switch (platform) { #ifdef M_CORE_GBA - case PLATFORM_GBA: + case mPLATFORM_GBA: return QObject::tr("GBA"); #endif #ifdef M_CORE_GB - case PLATFORM_GB: + case mPLATFORM_GB: return QObject::tr("GB"); #endif default:
M src/platform/switch/main.csrc/platform/switch/main.c

@@ -273,7 +273,7 @@ runner->core->setPeripheral(runner->core, mPERIPH_RUMBLE, &rumble.d);

runner->core->setPeripheral(runner->core, mPERIPH_ROTATION, &rotation); runner->core->setAVStream(runner->core, &stream); - if (runner->core->platform(runner->core) == PLATFORM_GBA && useLightSensor) { + if (runner->core->platform(runner->core) == mPLATFORM_GBA && useLightSensor) { runner->core->setPeripheral(runner->core, mPERIPH_GBA_LUMINANCE, &lightSensor.d); }

@@ -310,7 +310,7 @@ if (mCoreConfigGetIntValue(&runner->config, "useLightSensor", &fakeBool)) {

if (useLightSensor != fakeBool) { useLightSensor = fakeBool; - if (runner->core->platform(runner->core) == PLATFORM_GBA) { + if (runner->core->platform(runner->core) == mPLATFORM_GBA) { if (useLightSensor) { runner->core->setPeripheral(runner->core, mPERIPH_GBA_LUMINANCE, &lightSensor.d); } else {
M src/platform/test/cinema-main.csrc/platform/test/cinema-main.c

@@ -333,7 +333,7 @@ } else if (entry->type(entry) == VFS_FILE && strncmp(entry->name(entry), "test.", 5) == 0) {

CIerr(3, "Found potential test %s\n", subpath); struct VFile* vf = dir->openFile(dir, entry->name(entry), O_RDONLY); if (vf) { - if (mCoreIsCompatible(vf) != PLATFORM_NONE || mVideoLogIsCompatible(vf) != PLATFORM_NONE) { + if (mCoreIsCompatible(vf) != mPLATFORM_NONE || mVideoLogIsCompatible(vf) != mPLATFORM_NONE) { struct CInemaTest* test = CInemaTestListAppend(tests); if (!CInemaTestInit(test, path, entry->name(entry))) { CIerr(3, "Failed to create test\n");
M src/platform/test/fuzz-main.csrc/platform/test/fuzz-main.c

@@ -84,7 +84,7 @@ core->setVideoBuffer(core, outputBuffer, 256);

} #ifdef M_CORE_GBA - if (core->platform(core) == PLATFORM_GBA) { + if (core->platform(core) == mPLATFORM_GBA) { ((struct GBA*) core->board)->hardCrash = false; } #endif