mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2025-06-28 09:59:41 -06:00
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:
@ -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);
|
||||
|
||||
|
Reference in New Issue
Block a user