[NDS] ARM7 Stack Corruption — PC springt in unmapped Adressraum (0xE1A01C00) #169
Labels
No labels
achievements
apu/audio
bug
build
cpu
enhancement
frontend
memory
ppu/gpu
tests
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
krugi20/retroverse#169
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Bug
ARM7 springt bei Schritt ~226521 (innerhalb Frame 0) in unmapped Adressraum.
Symptome
0xE1A01C00(sieht aus wie ein ARM-Opcode-Wert)r14/LR = 0xE1A01C01(Bit 0 gesetzt = Thumb-Mode)0x0380FB94(ARM7-WRAM)0x0000-NOPs (unmapped → read 0)Root Cause (Hypothese)
Ein STM/PUSH schreibt einen falschen Wert (
0xE1A01C01) auf den Stack.Dieser Wert ist ein ARM-Instruction-Opcode, nicht eine gültige Rücksprungadresse.
Mögliche Ursachen:
Debugging
200k ARM7-Steps solo:kein Drift ✅nds_run_framemit ARM9 gleichzeitig: Drift bei Schritt ~226521 🐛[0x0380FB94]läuft...Commits
5d4fa32— LDM/STM fix (ARM9 gefixt, ARM7 noch nicht)1e72687— BIOS HLE, IF-Clear fixFiles
src/core/cpu/arm7.c— wahrscheinlich BL/STMDB/BXsrc/systems/nds/nds.c— nds7_write/read PfadeRoot Cause gefunden & gefixt:
WRAMCNTwar auf0initialisiert statt3. Mit WRAMCNT=0 hat ARM7 kein Shared WRAM — Zugriffe auf0x037Fxxxxlandeten als Alias in ARM7 IWRAM (0x0380xxxx), direkt im aktiven Stack-Frame.Das Spiel kopiert Code nach
0x037FFB94→ mit WRAMCNT=0 überschreibt das den saved LR auf dem Stack mit0xE1A01C01→LDMIA SP!popt korruptes LR →BX LRcrasht.Fixes:
657a77f— WRAMCNT=3 (32KB Shared WRAM → ARM7), Banked SP für IRQ/SVC ModesVerifiziert: 2M+ ARM7 Steps über 4 Frames ohne Crash. ✅