diff --git a/src/core/core.c b/src/core/core.c index 5c266e25f..43cd1f24d 100644 --- a/src/core/core.c +++ b/src/core/core.c @@ -28,14 +28,14 @@ static struct mCoreFilter { struct mCore* (*open)(void); enum mPlatform platform; } _filters[] = { +#ifdef M_CORE_DS + { DSIsROM, DSCoreCreate, PLATFORM_DS }, +#endif #ifdef M_CORE_GBA { GBAIsROM, GBACoreCreate, PLATFORM_GBA }, #endif #ifdef M_CORE_GB { GBIsROM, GBCoreCreate, PLATFORM_GB }, -#endif -#ifdef M_CORE_DS - { DSIsROM, DSCoreCreate, PLATFORM_DS }, #endif { 0, 0, PLATFORM_NONE } }; diff --git a/src/ds/ds.c b/src/ds/ds.c index 867b4cfd0..188a07d8d 100644 --- a/src/ds/ds.c +++ b/src/ds/ds.c @@ -25,6 +25,7 @@ const uint32_t DS_COMPONENT_MAGIC = 0x1FF61FE; static const size_t DS_ROM_MAGIC_OFFSET = 0x15C; static const uint8_t DS_ROM_MAGIC[] = { 0x56, 0xCF }; +static const uint8_t DS_ROM_MAGIC_2[] = { 0x1A, 0x9E }; enum { DS7_SP_BASE = 0x380FD80, @@ -352,7 +353,7 @@ bool DSIsROM(struct VFile* vf) { if (vf->read(vf, &signature, sizeof(signature)) != sizeof(signature)) { return false; } - return memcmp(signature, DS_ROM_MAGIC, sizeof(signature)) == 0; + return memcmp(signature, DS_ROM_MAGIC, sizeof(signature)) == 0 || memcmp(signature, DS_ROM_MAGIC_2, sizeof(signature)) == 0; } bool DSLoadBIOS(struct DS* ds, struct VFile* vf) {