bugzmanov / nes_ebook

A mini book on writing NES emulator using rust lang
https://bugzmanov.github.io/nes_ebook/index.html
385 stars 68 forks source link

Add note on stack pointer override in Chapter 4 #34

Open achester88 opened 5 months ago

achester88 commented 5 months ago

After the switch to using the cpu VRAM the stack pointer retrieval from 0xFFFC no longer works. This is fixed in chapter 4 in main.rs by setting the stack pointer to 0x0600 between reset and run sections. link

When I ran into the issue I thought I had made a mistake with the bus addressing and debugged for quite some time before realizing that the read and write were just ignored and the stack pointer manually set.

This definitely feels like something that should be mentioned in the book.