From e9394ceb8833d7ac024cb714349c284038482ef4 Mon Sep 17 00:00:00 2001 From: zeromus Date: Tue, 18 Aug 2015 16:37:34 -0500 Subject: [PATCH] change unif vram inference logic --- BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.cs index 68fa02251e..39c6975c0b 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/NES.cs @@ -589,9 +589,13 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES LoadWriteLine("Using information from UNIF header"); choice = unif.CartInfo; //ok, i have this Q-Boy rom with no VROM and no VRAM. - //looks like FCEUX policy is to allocate 8KB of chr ram no matter what UNLESS certain flags are set. - //we'll let individual boards override that and set 8KB here - choice.vram_size = 8; + //we also certainly have games with VROM and no VRAM. + //looks like FCEUX policy is to allocate 8KB of chr ram no matter what UNLESS certain flags are set. but what's the justification for this? please leave a note if you go debugging in it again. + //well, we know we can't have much of a NES game if there's no VROM unless there's VRAM instead. + //so if the VRAM isn't set, choose 8 for it. + //TODO - unif loading code may need to use VROR flag to transform chr_size=8 to vram_size=8 (need example) + if (choice.chr_size == 0 && choice.vram_size == 0) + choice.vram_size = 8; //(do we need to suppress this in case theres a CHR rom? probably not. nes board base will use ram if no rom is available) origin = EDetectionOrigin.UNIF; }