fceux icon indicating copy to clipboard operation
fceux copied to clipboard

MMC5 Issues

Open negativeExponent opened this issue 2 years ago • 4 comments

a program name only Cat.nes has wrong graphics displayed: 1687868538_2023_06_27_20:22:18

it should look like this: 1687868677_2023_06_27_20:24:37

romfile: Cat.nes.zip

another game called TMNT-Cowabanga Edition(and variants) freezes on a blank screen after the initial trademark screen. mednefen seems to work this rom. comparing mmc5 mapper code looks almost the same so issue is probably somewhere else.

negativeExponent avatar Jun 27 '23 12:06 negativeExponent

with regards to issue with a variant of TMNT halting after the initial credits screen. it appears the WRAM in mappers are being initialized with FCEU_gmalloc() which its initial ram state is dependendent on the the value to be used from "RAM Init" option. if RAM init is initiatilzed other that non zero, then new battery saves will interpret this as data and cause problems, especially on some carts who do not initialize thier own battery rams.

I suggest to init WRAM (and/or any nvram) to zero with FCEU_gmalloc or in another wrapper that sets state to zero.

@zeromus @mjbudd77 and others

negativeExponent avatar Jan 01 '24 08:01 negativeExponent

change the ram init option? there's no perfect answer about this, that's why we have the option

zeromus avatar Jan 01 '24 08:01 zeromus

i understand the logic and its fine, although will be confusing in some cases where a game expects certain wram areas to be zero value and its not. Comparing in some more modern emus, there is a condition though that only the non-volatile areas for wram/chrram are passed through some custom initializations. in fceux's case, at least mapper n163-based, and MMC5 wram (and internal ram in n163) is checked for battery bit enable and is only randomized if needed if battery is false during PowerNES().

negativeExponent avatar Jan 04 '24 06:01 negativeExponent

are you saying changing the ram init option won't work? I can't believe any other emulators "solve" this by any means other than using a different default ram init option

zeromus avatar Jan 04 '24 06:01 zeromus

"Cats" issue is cause by incorrect nametable mirroring initial value... - https://github.com/TASEmulators/fceux/commit/4441f3cbdff2fabd397c2634a03a2d0b0d417931

"TMNT" was a wram init value when ram init is set other than 0.

both issue fixed in latest commits:

negativeExponent avatar Feb 26 '25 13:02 negativeExponent

Is it safe to simply change it from one thing to another? Different games will be depending on different values. At least put a comment there stating why that particular value is needed (for which game and which problem/bug). Better still would be using whatever controllable ram init options fceux already has prepared for situations like these.

zeromus avatar Feb 26 '25 22:02 zeromus

in general, wram that has battery flag enabled (like TMNT) should be initialize with zero. wram can be randomized based on ram init setting only when cart has no battery save.

negativeExponent avatar Feb 27 '25 00:02 negativeExponent