SUPERDIVORCE Posted January 19 Share Posted January 19 Hello there. Noob here. I'm currently working through a book called Programming Games for Atari 2600 by Oscar Toledo G., and I'm stuck trying to understand how this fine positioning subroutine example actually works. To be clear, it does work. When I assemble the code and run the bin in Stella, everything is functioning as it should. I'm just having trouble connecting the dots in my mind, as it's not exactly spelled out. The part that's not making sense to me is how the "LDA FINE_ADJUST-$F1,Y" interacts with the FINE_ADJUST table. For instance, in this demo, you're sent to the subroutine with #76 loaded into the A register as the desired X position. From my understanding, 76 is then divided by 15 via SBC until you're left with a remainder of 1. From there, it looks like 1 is loaded into the Y register, which is then used to increment FINE_ADJUST-$F1 by 1. If that's the case, how do we end up at .byte $F0, which moves us 1px to the right and into the desired fine position of 76? Apologies if I'm missing something completely obvious or interpreting the instructions incorrectly. I've taken a course on Udemy from Gustavo Pezzi that handled this operation in a different way, which clicked pretty easily. I believe Steven Hugg also presented the same approach in his book Making Games for the Atari 2600. However, I don't like encountering this other method and leaving it up in the air as magical lol. So if you can help to fill in the gaps I would greatly appreciate it! Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.