mirror of https://github.com/mgba-emu/mgba.git
GBA: Trim non-movie ROMs to 32 MiB if applicable
This commit is contained in:
parent
c0fa8256a2
commit
69a0372133
1
CHANGES
1
CHANGES
|
@ -118,6 +118,7 @@ Other fixes:
|
||||||
- Wii: Improve audio buffering (fixes mgba.io/i/1617)
|
- Wii: Improve audio buffering (fixes mgba.io/i/1617)
|
||||||
Misc:
|
Misc:
|
||||||
- GB Memory: Support manual SRAM editing (fixes mgba.io/i/1580)
|
- GB Memory: Support manual SRAM editing (fixes mgba.io/i/1580)
|
||||||
|
- GBA: Trim non-movie ROMs to 32 MiB if applicable
|
||||||
- GBA Audio: Redo channel 4 batching for GBA only
|
- GBA Audio: Redo channel 4 batching for GBA only
|
||||||
- GBA I/O: Stop logging several harmless invalid register reads
|
- GBA I/O: Stop logging several harmless invalid register reads
|
||||||
- Debugger: Separate aliases from main commands
|
- Debugger: Separate aliases from main commands
|
||||||
|
|
|
@ -238,9 +238,17 @@ void GBAReset(struct ARMCore* cpu) {
|
||||||
|
|
||||||
gba->debug = false;
|
gba->debug = false;
|
||||||
memset(gba->debugString, 0, sizeof(gba->debugString));
|
memset(gba->debugString, 0, sizeof(gba->debugString));
|
||||||
if (gba->pristineRomSize > SIZE_CART0) {
|
|
||||||
|
|
||||||
|
if (gba->romVf && gba->pristineRomSize > SIZE_CART0) {
|
||||||
|
char ident;
|
||||||
|
gba->romVf->seek(gba->romVf, 0xAC, SEEK_SET);
|
||||||
|
gba->romVf->read(gba->romVf, &ident, 1);
|
||||||
|
gba->romVf->seek(gba->romVf, 0, SEEK_SET);
|
||||||
|
if (ident == 'M') {
|
||||||
GBAMatrixReset(gba);
|
GBAMatrixReset(gba);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GBASkipBIOS(struct GBA* gba) {
|
void GBASkipBIOS(struct GBA* gba) {
|
||||||
|
@ -376,12 +384,21 @@ bool GBALoadROM(struct GBA* gba, struct VFile* vf) {
|
||||||
vf->seek(vf, 0, SEEK_SET);
|
vf->seek(vf, 0, SEEK_SET);
|
||||||
if (gba->pristineRomSize > SIZE_CART0) {
|
if (gba->pristineRomSize > SIZE_CART0) {
|
||||||
gba->isPristine = false;
|
gba->isPristine = false;
|
||||||
gba->memory.romSize = 0x01000000;
|
|
||||||
#ifdef FIXED_ROM_BUFFER
|
#ifdef FIXED_ROM_BUFFER
|
||||||
gba->memory.rom = romBuffer;
|
gba->memory.rom = romBuffer;
|
||||||
#else
|
#else
|
||||||
gba->memory.rom = anonymousMemoryMap(SIZE_CART0);
|
gba->memory.rom = anonymousMemoryMap(SIZE_CART0);
|
||||||
#endif
|
#endif
|
||||||
|
char ident;
|
||||||
|
vf->seek(vf, 0xAC, SEEK_SET);
|
||||||
|
vf->read(vf, &ident, 1);
|
||||||
|
vf->seek(vf, 0, SEEK_SET);
|
||||||
|
if (ident == 'M') {
|
||||||
|
gba->memory.romSize = 0x01000000;
|
||||||
|
} else {
|
||||||
|
gba->memory.romSize = SIZE_CART0;
|
||||||
|
vf->read(vf, gba->memory.rom, SIZE_CART0);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
gba->isPristine = true;
|
gba->isPristine = true;
|
||||||
gba->memory.rom = vf->map(vf, gba->pristineRomSize, MAP_READ);
|
gba->memory.rom = vf->map(vf, gba->pristineRomSize, MAP_READ);
|
||||||
|
|
Loading…
Reference in New Issue