This page is a mirror of Tepples' nesdev forum mirror (URL TBD).
Last updated on Oct-18-2019 Download

SMB Disassembly and RAM space - Malfunctioning code

SMB Disassembly and RAM space - Malfunctioning code
by on (#45904)
For no reason, When you move RAM definitions. Sprite and BG rendering code go to a malfunction state. That was the case in ''Doppleganger's SMB1 disassembly'' when you do move RAM Definitions (such as where EnemyXPosition is in a certain address and move it somewhere else in $6000 using WRAM)

The reason I am moving things around because the (Hudson's) Adventure Island 1 Music engine requires RAM to be reserved in $A0-$FF.

Can Someone know why?

by on (#45909)
it might be because certain opcodes only work on values in zero page so you can't move them out of zp...

by on (#45914)
frantik wrote:
it might be because certain opcodes only work on values in zero page so you can't move them out of zp...


The Opcodes are OK, But the RAM is not acting right somehow, Even when moving one of the value to another Zero Page RAM address

I made another clean copy of SMBDIS and moved EnemyXPosition to unused RAM address $B8 as an example, A Malfunction still happens

by on (#45919)
EnemyXPosition sounds like it'd be the name of an array, or a set of consecutive addresses holding related information. I remember tracing through Balloon Fight, and it had a whole load of 9-element arrays, one element for each active object.

by on (#45920)
Other potential problems are them being used with indexed or indirect addressing modes.
Re: SMB Disassembly and RAM space - Malfunctioning code
by on (#45927)
Hamtaro126 wrote:
For no reason, When you move RAM definitions. Sprite and BG rendering code go to a malfunction state. That was the case in ''Doppleganger's SMB1 disassembly'' when you do move RAM Definitions (such as where EnemyXPosition is in a certain address and move it somewhere else in $6000 using WRAM)

The reason I am moving things around because the (Hudson's) Adventure Island 1 Music engine requires RAM to be reserved in $A0-$FF.

Can Someone know why?


Perhaps you should edit the music engine instead of SMB? Perhaps it would be easier.

by on (#45945)
Isn't it possible that certain arrays must be in specific places because of the way the code accesses them? Some games might use absolute calculations to work on array elements, which means that moving the such arrays would break the logic.