More nes junk support

This commit is contained in:
adelikat 2016-10-15 08:49:18 -05:00
parent a409f1fb62
commit 2be736d99d
2 changed files with 11 additions and 1 deletions

View File

@ -105,6 +105,8 @@ sha1:83264E3F8807998D09E9FBA19B13BBEA7C888D88 O Bakushou!! Jinsei Gekijou 3 (J)
sha1:E79FC613112CC5AB0FC8B1150E182670FB042F4A G Contra Fighter (Unl) NES board=MAPPER238
sha1:2C512DE4079AF45D7B9218E40BB68E308ABE288C B Magic Johnson's Fast Break (U) NES board=MAPPER001;PRG=64;CHR=128
sha1:D2BE67170DDED1E1108EED2D4D8CA9D9CEE9F9E2 G Super Mario Bros 2 (Lost LEvels) (Unl) NES board=MAPPER040;WRAM=0;PAD_H=1;PAD_V=0
sha1:77D5D7A162B61DEFC6B66B6A39B8D51E124AC534 B Tagin' Dragon (Bunch) [b] NES board=COLORDREAMS-74*377;CHR=16;PRG=32;WRAM=0
sha1:2028940CF7C757A3A7931A741D5EC79C3554D38C O Wally Bear and the No Gang (AVE) [o] NES board=AVE-NINA-07;WRAM=0
;;;;;;;;;;;;;;;;;;;-----------------------------------------------------------------------
;;;;;;;;;;;;;;;;;;;-----------------------------------------------------------------------

View File

@ -87,7 +87,15 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
public override byte ReadPRG(int addr)
{
return ROM[addr + (prg << 15)];
// Xiao Ma Li (Ch) has 16k prg (mapped to both 0x8000 and 0xC000)
if (Cart.prg_size == 16)
{
return ROM[addr & 0x3FFF];
}
else
{
return ROM[addr + ((prg & prg_mask) << 15)];
}
}
public override byte ReadPPU(int addr)