Jump to content

Kevin Holditch

Members
  • Posts

    5
  • Joined

  • Last visited

Kevin Holditch's Achievements

Combat Commando

Combat Commando (1/9)

0

Reputation

  1. Thanks a lot for this. With a bit of jiggery pokery I've managed to port the code (more or less) and get it to work (only 2 digits at the moment but positioning is correct). I'm still not 100% sure how a bit of this code works though. I understand mapping the digits in memory. What I think it's doing is setting each sprite to have 3 copies on the screen and then quickly changing the contents of the register in before each copy can be drawn, hence the reason you get 3 different instances of each sprite and hence 6 digits on the screen. Is that more or less right?
  2. I can find loads of examples of how to calculate the score but none on displaying the 6 digits, unless I'm missing something? Can you provide me with a link please?
  3. I am having trouble trying to display a score in my Atari game. After quite a few evenings of hard toil I've managed to work out the code to read the digits from my memory map and load them into variables ready to be drawn in the game loop. My aim is to draw the score at the top of the screen using the sprite registers. My code is as follows: ldy #8 TopBar sta WSYNC lda (digtwo),y sta GRP0 lda (digone),y sta HMOVE sta GRP1 dey bne TopBar The above code works as far as the digits are drawn to the screen correctly however the digits are widely spaced and I want to put them close together in the centre. Then if it's not asking too much display my other digits too. Can anyone help me with how to position the digits correctly? Thanks in advance
  4. The usual way to do this is to keep your score in Binary Coded Decimal format, or BCD for short. The 6507/6502 has a native BCD mode that you just need to turn on (SED) when adding or subtracting from the score, and turn off (CLD) when you're done. When it's enabled, for example, if a score byte is $09 and you add 1 it will become $10 instead of $0A. Using BCD, extracting the lower digit is just a matter of an "AND #$0f" and extracting the higher digit is just a matter of 4 "LSR"s. Rinse and repeat for any other score digits you may have. Thanks very much for such a quick response. I can see how it would be quite easy (in Atari 2600 terms where nothing is that easy) to do it now. Thanks again.
  5. I was wondering if someone could help me. I've started to write my own Atari 2600 game and I'm starting out by working out an algorithm to display the score. So far I've mapped all of the numbers from 0-9 out in consecutive memory using 8 bytes for each number. To display the any number from 0-9 I simply multiply the number by 8 (by bit shifting left 3 times) and then I know where in memory to start drawing the number from. I then loop round for 8 lines loading each line of memory into the background register to draw the number. This all works great but the problem comes when I want to draw a 2,3 or even 4 digit number. I am having trouble working out how to extract the tens, hundreds, thousands from the number. I need to be able to do this so I can draw each digit using the routine described above. Thanks in advance for any help.
×
×
  • Create New...