NES code reading help

Just for general practice trying to read aome NES code but found out that it's pretty difficult. Any advices on how to understand it better? I know most of the basic stuff about the programming itself, but reading (and writing it) is hard. Is there somewhere a list of memory addresses that are always same between games (controller inputs and stuff)?

Comments

  • When you write code, don't use actual addresses of the hardware registers. Use aliases instead, like PPUCTRL=$2000 (PPUCTRL equ $2000 is some assemblers), then 'sta PPUCTRL' rather than 'sta $2000'.
  • As I found out, you can't really just jump in and try to read it. You must know the addressing as you stated. I learned all of the addressing from the Nerdy Nights tutorials. Bunnyboy does a nice job of laying it all out. I know it seems silly to go through the tutorials just to learn to read the code when you don't plan on writing a game, but if you don't, its very tough.



    MRN has posted another great resource above that I use ALL of the time. Again, they do a great job of laying out all of the addressing.



    One tip I will give you that it took a long time for me to understand is that the PPU and the CPU each have their own address. It can appear that you are writing 2 seperate things to address $2000, but really you are writing to address $2000 of the CPU in one part and the address of $2000 of the PPU in another part. Writing to address $2000 on the PPU does not affect address $2000 of the CPU and vice versa, they are their own seperate monsters. If you go into the code understanding this, it makes it much less confusing.



    Best of luck.
Sign In or Register to comment.