salzmafia.com Posted August 2, 2013 Share Posted August 2, 2013 Hi, I've searched and searched, and I found a thread that had a couple different score kernels/modules to separate the score into two - 3 digit scores, but I need the opposite, I need 3 two digit scores. Right now, in my code the left two digits represent player one, the two in the middle are a timer, and the two on the right are player 2's score. If I can separate all three sets that would be awesome! I.E From 129912 to 12 99 12 something like that would be perfect! Any help would be appreciated! Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted August 2, 2013 Share Posted August 2, 2013 I know how to check the 3 separate parts, but I don't know how to make spaces between them: http://www.randomterrain.com/atari-2600-memories-batari-basic-commands.html#ex_score_digit_check Quote Link to comment Share on other sites More sharing options...
+SpiceWare Posted August 2, 2013 Share Posted August 2, 2013 The kernel would need minor adjustments, namely: set NUSIZ0 and NUSIZ1 to 6 instead of 3 hit RESP0 and RESP1 a little earlier in the scanline to shift the digits left adjust the timing of the updates to GRP0 and GRP1 I just took a look and the main issue would be which kernel are you using as they each have their own copy of the score display code. 1 Quote Link to comment Share on other sites More sharing options...
Cybearg Posted August 2, 2013 Share Posted August 2, 2013 Hi, I've searched and searched, and I found a thread that had a couple different score kernels/modules to separate the score into two - 3 digit scores Just for reference, would you mind linking to those mini-kernels you mentioned? Quote Link to comment Share on other sites More sharing options...
Omegamatrix Posted August 2, 2013 Share Posted August 2, 2013 Spreading the score digits is easy, and you don't need to use VDELPx anymore, as there is already enough time to update the digits. I made a small assembly demo. Yellow digits are drawn with P0, Green digits are P1. SixScoreSpread.zip 1 Quote Link to comment Share on other sites More sharing options...
Cybearg Posted August 2, 2013 Share Posted August 2, 2013 Is it a simple matter to display the score anywhere? That is, if we wanted the score at the top rather than the bottom? Great to hear it's simple, though it makes sense, really, since spreading them apart just means wasting some time between them getting drawn. Quote Link to comment Share on other sites More sharing options...
+SpiceWare Posted August 2, 2013 Share Posted August 2, 2013 Not simple - if the score's moved to the top then all the sprite prep your bB code does (color, size, reflection, position, etc) would get blown away by the routine that displays the score. 1 Quote Link to comment Share on other sites More sharing options...
salzmafia.com Posted August 4, 2013 Author Share Posted August 4, 2013 Just for reference, would you mind linking to those mini-kernels you mentioned? http://atariage.com/forums/topic/124520-a-few-new-score-kernels/ Quote Link to comment Share on other sites More sharing options...
salzmafia.com Posted August 4, 2013 Author Share Posted August 4, 2013 There has now been a change in direction, how about just hiding the two center digits? Quote Link to comment Share on other sites More sharing options...
Omegamatrix Posted August 4, 2013 Share Posted August 4, 2013 That should be even easier. You just have to modify score_graphics.asm to have a blank digit at the very end. Let me see... Quote Link to comment Share on other sites More sharing options...
Omegamatrix Posted August 4, 2013 Share Posted August 4, 2013 Okay, here you go. If you open score_graphics.asm, you will see all I did was made it drop down 8 bytes in the rom, say from $FF94 to $FF8C. Next I added in a blank digit right at the end, so now the graphics go 0-9 and then a blank digit appears. The tricky part was getting BB to blank a digit. It would not compile a blank digit with the score command, probably it gets garbled as it is expecting a value of 0-9 for each digit. In the end I fell back on what I know, so a little assembly. I only tested this with the multisprite, and it works... but depending on how you are adding values and stuff you might want to place zeros into the middle two digits before performing operations and then convert back to blanks afterwards. That theory is untested, and I'm just anticipating a problem before I've looked to see if it's there. score_graphics.zip Example for blanking the middle two digits (3 and 4), with the multisprite kernel: (score lies in $D1, $D2, and $D3 in ram) main score = 123456 asm lda #$AA ; blank digits three and four sta $D2 end Example for blanking the middle two digits (3 and 4), with the standard kernel: (score lies in $93, $94, and $95 in ram) main score = 123456 asm lda #$AA ; blank digits three and four sta $94 end Example for blanking the digit 5 only, with the standard kernel: main score = 123456 asm lda $95 and #$0F ; keep digit six ora #$A0 ; and blank digit five sta $95 end And finally what I was talking about with the zeros: main rem make score valid BCD again... asm lda #$00 ; zero digits three and four sta $94 end rem increment digits one and six score = score + 100001 rem score is updated, now screw with it by blanking middle digits asm lda #$AA ; blank digits three and four sta $94 end 1 Quote Link to comment Share on other sites More sharing options...
Omegamatrix Posted August 4, 2013 Share Posted August 4, 2013 I figured out how to use a more BB way to modify the digits. I dim'ed some variables and made some constants for the standard kernel. Note that you still need to use the modified score_graphics.asm file I made in the last post. dim scrDigit1and2 = $93 dim scrDigit3and4 = $94 dim scrDigit5and6 = $95 const ZERO_RIGHT_DIGIT = 0 const BLANK_RIGHT_DIGIT = $0A const KEEP_RIGHT_DIGIT = $0F const KEEP_LEFT_DIGIT = $F0 const ZERO_LEFT_DIGIT = 0 const BLANK_LEFT_DIGIT = $A0 const BLANK_BOTH_DIGITS = $AA Then inside the code I modified the score. For example, if I wanted to blank digit five only: scrDigit3and4 = BLANK_LEFT_DIGIT | (scrDigit3and4 & KEEP_RIGHT_DIGIT) However, if I want to do some math with score, then I have to first change digit 5 back to a zero: scrDigit3and4 = ZERO_LEFT_DIGIT | (scrDigit3and4 & KEEP_RIGHT_DIGIT) Blanking digits 5 and 6 together: scrDigit3and4 = BLANK_BOTH_DIGITS Zeroing digits 5 and 6 together: scrDigit3and4 = 0 1 Quote Link to comment Share on other sites More sharing options...
salzmafia.com Posted August 4, 2013 Author Share Posted August 4, 2013 I figured out how to use a more BB way to modify the digits. I dim'ed some variables and made some constants for the standard kernel. Note that you still need to use the modified score_graphics.asm file I made in the last post. This worked perfectly! Thanks! At first I kept having digit 4 flicker a 9, but then moved the code just before drawscreen and it solved it. Quote Link to comment Share on other sites More sharing options...
Omegamatrix Posted August 4, 2013 Share Posted August 4, 2013 I woke up this morning wondering why I did this: scrDigit3and4 = ZERO_LEFT_DIGIT | (scrDigit3and4 & KEEP_RIGHT_DIGIT) When you should be able to just do this, and save bytes: scrDigit3and4 = (scrDigit3and4 & KEEP_RIGHT_DIGIT) Alot of games have a routine which blanks preceding zeros for their score. Essentially it is just a loop that goes through each digit (starting with the highest value), and if it finds a zero it makes it a blank. At the first non-zero, or if the final digit is a zero, it breaks. This routine is done on the pointers to the digit graphics, after the digit graphic pointers have be found. Quote Link to comment Share on other sites More sharing options...
salzmafia.com Posted August 4, 2013 Author Share Posted August 4, 2013 This worked perfectly! Thanks! At first I kept having digit 4 flicker a 9, but then moved the code just before drawscreen and it solved it. I spoke to soon... once a digit (lets say 5 and 6) get between 10 - 15 the score graphics get scrambled then correct themselves at 16. What could I be doing wrong? Quote Link to comment Share on other sites More sharing options...
Omegamatrix Posted August 4, 2013 Share Posted August 4, 2013 I spoke to soon... once a digit (lets say 5 and 6) get between 10 - 15 the score graphics get scrambled then correct themselves at 16. What could I be doing wrong? You probably aren't setting the digits you made blank back to zero before operating on the score. BCD is valid from 0-9, so the blank value is scrambling the routine. Quote Link to comment Share on other sites More sharing options...
+SpiceWare Posted August 4, 2013 Share Posted August 4, 2013 There has now been a change in direction, how about just hiding the two center digits? Question - are you ALWAYS hiding the 2 center digits? If so then there's no reason to draw them, and thus no need to blank them out. To do this set NUSIZ0 and NUSIZ1 to 4. 1 Quote Link to comment Share on other sites More sharing options...
salzmafia.com Posted August 4, 2013 Author Share Posted August 4, 2013 You probably aren't setting the digits you made blank back to zero before operating on the score. BCD is valid from 0-9, so the blank value is scrambling the routine. Yeah, it was something like that.. Problem solved! Thanks again for everyone's help! Quote Link to comment Share on other sites More sharing options...
Omegamatrix Posted August 4, 2013 Share Posted August 4, 2013 Question - are you ALWAYS hiding the 2 center digits? If so then there's no reason to draw them, and thus no need to blank them out. To do this set NUSIZ0 and NUSIZ1 to 4. This is the best solution, and requires the least intrusion and bytes. You don't need to use the modified score_graphics.asm file, and you don't need to do anything special in the code. However, to keep the score centered (as is) use set NUSIZ0 and NUSIZ1 to 2 (two copies medium). Using 4 sets the values for NUSIZx to two copies wide, which would require more alterations in the kernel to center it. In the standard kernel change search for "NUSIZ0", and change this: LDA #$03 STA NUSIZ0 STA NUSIZ1 STA VDELP1 To this: LDA #$02 STA NUSIZ0 ; set to 2 copies medium STA NUSIZ1 STY VDELP1 ; Y=7, use delay Quote Link to comment Share on other sites More sharing options...
+SpiceWare Posted August 4, 2013 Share Posted August 4, 2013 Played some Time Warp for the HSC last night and noticed their 6 digit score routine doesn't use VDEL. Don't recall seeing any other games using this method. One benefit I can think of is you can use all 8 pixels when designing the font as there's no longer a need for a blank spacing pixel. Quote Link to comment Share on other sites More sharing options...
Omegamatrix Posted August 4, 2013 Share Posted August 4, 2013 Played some Time Warp for the HSC last night and noticed their 6 digit score routine doesn't use VDEL. Don't recall seeing any other games using this method. One benefit I can think of is you can use all 8 pixels when designing the font as there's no longer a need for a blank spacing pixel. Time Warp is one of my favorite games, and not just because it was also released by Zellers, lol. I never noticed the spread score myself. I don't remember a blank spacing pixel ever being needed for six byte score routines, and the 48 bit maps all seem to have no blank space pixel required. What routine do you need the blank spacing pixel for? Quote Link to comment Share on other sites More sharing options...
+SpiceWare Posted August 4, 2013 Share Posted August 4, 2013 What routine do you need the blank spacing pixel for? With a spacing pixel you get this: If you use all 8 pixels without a spacing pixel the digits run together: Quote Link to comment Share on other sites More sharing options...
Omegamatrix Posted August 4, 2013 Share Posted August 4, 2013 With a spacing pixel you get this: If you use all 8 pixels without a spacing pixel the digits run together: Ah, I gotcha now. Sorry for the confusion. At first I thought the implication was that a blanking pixel was needed or the graphics would be corrupted when the next copies graphics was loaded. Now I understand what you mean. Quote Link to comment Share on other sites More sharing options...
+atari2600land Posted August 10, 2013 Share Posted August 10, 2013 I know this is a semi-old topic, but did anyone mention the 2-digit player0score and player1score minikernel by Curtis Taylor? You can have 4 two-digit scores with it. http://www.randomterrain.com/atari-2600-memories-batari-basic-commands.html#playerscores_minikernel 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.