Jump to content

Gustavo Pezzi

Members
  • Posts

    3
  • Joined

  • Last visited

Everything posted by Gustavo Pezzi

  1. Hello there. Thanks for the mention!
  2. Hi Shinji. Regarding items 2, 3, 4, 7, and 8. 2) With the 6502 processor, our values either are interpreted from 0 to 255 (unsigned), or -128 to 127 (signed). That's what we can store and represent with one register. But there are ways of representing larger numbers by grouping bytes together. You'll see many implementations use 2 bytes (a word) to split the number into HI-byte and LO-byte. By correctly using the carry flag and carrying the addition or borrowing the subtraction we can even perform ADC and SBC with these 16-bit numbers. So you can interpret the HI and LO bytes as a 16-bit number, allowing you to have a bigger range of values for your game. This is very common in NES programming, where the screen resolution, nametables, and tile numbers often are bigger than 255. 3) There is a great forum post on horizontal positioning and how it relates to clock counts: https://forums.atariage.com/topic/308513-a-working-horizontal-positioning-routine/. I think it's worth going over and checking the routines that the forum users posted and recommend using. 4) You can definitely randomize initial object positions using a simple LFSR routine. I use it all the time for random enemy start positions. 5) Briefly, I like to reserve a byte in memory and store it as PrevButtons. If the current button press state that I just read is equal to the PrevButtons, I bypass the processing. 7) For RAM, I usually can visually see it in Stella (from $80 to $FF) what's not being used. And if you're talking about ROM size, your .bin cart file size can tell you how far you are from 4K (or whatever cart size you are working with). One example of how the stack can be important is when we need to create a backup of important values that you might need again later. For example, the 6502 has only 3 registers, so if you know you'll need the current value of X later, but you need X again to perform some other computation, you can push the value of X to the stack (saving it for later), then you are free to use X for anything else you need, and once you're done you can pull the old value of X from the stack. I do this all the time in some subroutines, where I save the value of a register that I need into the stack, then I can use that register inside the subroutine as I want, and before I leave the subroutine I can simply restore the old value of the register by pulling it from the stack. I was almost sure we covered some examples of this in our course. Sorry for the lack of code in my items. I just had a baby and it's hard to find time to properly address all these details. Hopefully the good people of the forum will be able to assist with more detailed answers.
  3. Such great news! I'm so happy to hear about you finally finishing your Atari 2600 book. I can't wait to start reading it. 🙂
×
×
  • Create New...