TASEmulators / desmume

DeSmuME is a Nintendo DS emulator
http://desmume.org
GNU General Public License v2.0
2.9k stars 535 forks source link

some AR codes thrash the JIT and maybe the JIT breaks on SMC #69

Open zeromus opened 7 years ago

zeromus commented 7 years ago

http://forums.desmume.org/viewtopic.php?id=11013

MKDS (US) 02072720 E3A0045F 02039988 EAFF1D88 E2000FB0 00000030 E92D0600 E59F9018 E59FA018 E589A000 E2899E0C E59FA010 E589A008 E8BD0600 E12FFF1E 01FFAE98 E350045F C3A0E45F

This code causes the JIT to reset each frame, since it's fighting with the game. Ideally only the affected jit blocks would be reset, but I only know how to reset the entire JIT.

I TRIED to reset only the affected blocks, but it didnt work; so maybe all self-modifying code is actually broken? Or maybe I did it wrong.

noabody commented 7 years ago

Here's a couple that annihilate JIT.

0.9.11 could handle them but nothing recent. I said it corrupts DynaRec but don't know much about any of that kind of stuff. Best I can do is follow instructions and use Google.

; DeSmuME cheats file. VERSION 2.000
Name=FF3
Serial=NTR-AFFE-USA

; cheats list
AR 1 021D34A400000000,021D364400000000,021D37E400000000 ; 1 Hit Kill (corrupts DynaRec)
AR 1 021E55C000000000 ; No Random Battles (corrupts DynaRec)
zeromus commented 7 years ago

what does "corrupts DynaRec" and "annihilates JIT" mean? I'm not sure you're writing about the problem this issue is about.

noabody commented 7 years ago

If I have JIT enabled with that No Random Battle code then the game is unresponsive. Moving across the world map pauses for a couple of seconds then picks up and pauses again. I don't know what the terms mean just that JIT has to be off if that code is on otherwise the game is unplayable.

Doesn't happen in Retroarch, just desmume/src/frontend/posix.

Just In Time always sounded like Dynamic Recompilation to me anyway - like they're synonymous.

zeromus commented 7 years ago

ok, that does sound like the bug we're talking about here. Here's what you should have said: "Here's an example of thrashing the JIT: enable no random battle code then walk across the world map. Youll see the game bog down when the random battle is suppressed"