mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
@@ -151,10 +151,16 @@ static bool readMBCSlice(char const **name, char const *expected)
|
|||||||
|
|
||||||
static enum MbcType parseMBC(char const *name)
|
static enum MbcType parseMBC(char const *name)
|
||||||
{
|
{
|
||||||
if (name[0] >= '0' && name[0] <= '9') {
|
if ((name[0] >= '0' && name[0] <= '9') || name[0] == '$') {
|
||||||
|
int base = 0;
|
||||||
|
|
||||||
|
if (name[0] == '$') {
|
||||||
|
name++;
|
||||||
|
base = 16;
|
||||||
|
}
|
||||||
// Parse number, and return it as-is (unless it's too large)
|
// Parse number, and return it as-is (unless it's too large)
|
||||||
char *endptr;
|
char *endptr;
|
||||||
unsigned long mbc = strtoul(name, &endptr, 0);
|
unsigned long mbc = strtoul(name, &endptr, base);
|
||||||
|
|
||||||
if (*endptr)
|
if (*endptr)
|
||||||
return MBC_BAD;
|
return MBC_BAD;
|
||||||
|
|||||||
BIN
test/fix/dollar-hex.bin
Normal file
BIN
test/fix/dollar-hex.bin
Normal file
Binary file not shown.
1
test/fix/dollar-hex.err
Normal file
1
test/fix/dollar-hex.err
Normal file
@@ -0,0 +1 @@
|
|||||||
|
warning: Overwrote a non-zero byte in the cartridge type
|
||||||
1
test/fix/dollar-hex.flags
Normal file
1
test/fix/dollar-hex.flags
Normal file
@@ -0,0 +1 @@
|
|||||||
|
-m '$2a'
|
||||||
BIN
test/fix/dollar-hex.gb
Normal file
BIN
test/fix/dollar-hex.gb
Normal file
Binary file not shown.
Reference in New Issue
Block a user