Interestingly, it uses the same routines for drawing the in-game backgrounds. This is the background you see when walking through the game as Willow.
Now this routine uses two variables to specify what background is loaded to be scrolled into the screen while Willow walks to the edge of the visible screen.
- Each variable seems to change independent of each other
- One variable changes if Willow walks out the top/bottom of the screen, I designate this as mapY.
- The other variable changes if Willow walks out left/right of the screen, I designate this as mapX.
- The variables don't seem to be a direct index, as useful values seem to be in the 1A-1F range.
The "coordinates" for the START screen is (1A,1E). I'm not sure where the password screen is stored yet. When switching to the password screen, no backgrounds are drawn (i.e. the code for drawing backgrounds is not called). Instead, the code merely switches the active nametable implying that the password screen is already drawn into memory.
So far I've determined that these values decode into a memory address where the code picks up another byte that decodes into another address, which is where the char which will be copied to the nametable is stored. I still haven't fully decoded the routine, but it's another step towards finalization.
I think it uses some form of compression in order to save space, as the routine seems to read from certain locations multiple times, instead of simple packed data. It is probably RLE, which would be ideal given the repetative nature of the backgrounds.
Meanwhile, I think I should focus on what can be done, which is implementing the load/save screens - sans backgrounds - and adding support for multiple saves.
I just feel so close to understanding how it works that I don't want to let it by.
No comments:
Post a Comment