GB, GBA: Prevent loading null ROMs

This commit is contained in:
Jeffrey Pfau 2016-10-21 19:09:16 -07:00
parent a30599e239
commit d9764e8cea
3 changed files with 7 additions and 0 deletions

View File

@ -24,6 +24,7 @@ Misc:
- VFS: Call msync when syncing mapped data
- GBA Video, GB Video: Colors are now fully scaled
- PSP2: Improved controller rumble
- GB, GBA: Prevent loading null ROMs
0.5.1: (2016-10-05)
Bugfixes:

View File

@ -81,6 +81,9 @@ static void GBInit(void* cpu, struct mCPUComponent* component) {
}
bool GBLoadROM(struct GB* gb, struct VFile* vf) {
if (!vf) {
return false;
}
GBUnloadROM(gb);
gb->romVf = vf;
gb->pristineRomSize = vf->size(vf);

View File

@ -490,6 +490,9 @@ bool GBALoadMB(struct GBA* gba, struct VFile* vf) {
}
bool GBALoadROM(struct GBA* gba, struct VFile* vf) {
if (!vf) {
return false;
}
GBAUnloadROM(gba);
gba->romVf = vf;
gba->pristineRomSize = vf->size(vf);