Fix reading banner from homebrew ROMs
Some homebrew ROMs do not have a banner, and use a null value to indicate this. Do not attempt to read the banner when this is the case.
This commit is contained in:
parent
9d56055afb
commit
c3bd1d2e83
|
@ -1602,7 +1602,15 @@ bool LoadROM(const u8* romdata, u32 romlen)
|
|||
memcpy(CartROM, romdata, romlen);
|
||||
|
||||
memcpy(&Header, CartROM, sizeof(Header));
|
||||
|
||||
if (!Header.BannerOffset)
|
||||
{
|
||||
memset(&Banner, 0, sizeof(Banner));
|
||||
}
|
||||
else
|
||||
{
|
||||
memcpy(&Banner, CartROM + Header.BannerOffset, sizeof(Banner));
|
||||
}
|
||||
|
||||
printf("Game code: %.4s\n", Header.GameCode);
|
||||
|
||||
|
|
Loading…
Reference in New Issue