Jump to content

Photo

Second Score Minikernel (works now)


18 replies to this topic

#1 Karl G OFFLINE  

Karl G

    Dragonstomper

  • 603 posts

Posted Tue Nov 27, 2018 1:03 PM

While perhaps not as fun as second breakfast, there has been a request for a minikernel that can display a second 6-digit score.  The top score is set in the usual way with the special score variable, but the second is set manually with the "ssc1", "ssc2" and "ssc3" variables.  The user needs to dim the variables "secondscore" and "secondscorecolor" in the BASIC code.

 

As stated above, this isn't working yet, but I thought I'd share my preliminary work in case anyone had any ideas as to the issue.  Details in the next post.

 

Second Score v0.1:

 

Attached File  secondscore.asm   3.62KB   9 downloads

Attached File  secondscore.bas   971bytes   9 downloads

 



#2 Karl G OFFLINE  

Karl G

    Dragonstomper

  • Topic Starter
  • 603 posts

Posted Tue Nov 27, 2018 1:08 PM

The second set of digits does not display the expected values of "789012".  Presumably there's a mistake with my pointer setup that I missed.

 

Since minikernels are called before the score, and the score pointers are already set by then, I let the minikernel score digits display the normal score.  Once this is done, I set the pointers for each digit using the variables defined for the second score.  I adapted some code from the titlescreen kernel for this purpose.

 

I'm sure I made some kind of simple error that I'm missing, but I can't find it now.  If someone else wants to take a look, then that would be cool - otherwise I'll look at it again another time to see what I'm missing here.



#3 Karl G OFFLINE  

Karl G

    Dragonstomper

  • Topic Starter
  • 603 posts

Posted Tue Nov 27, 2018 1:18 PM

To be clear, both scores display, but the wrong digits display on the bottom one:

 

Screen Shot 2018-11-27 at 2.17.15 PM.png



#4 Gemintronic OFFLINE  

Gemintronic

    Jason S. - Lead Developer & CEO

  • 9,253 posts

Posted Tue Nov 27, 2018 2:38 PM

It seems like some variables/pointers are not unique between score kernels.

 

   score = 111111
   secondscore = $44
   secondscore2 = $22
   secondscore3 = $33
 
Results in a score display of:
 
111111
411231
 
You probably know this.  I was just explaining my own discovery :)
 
I tried changing secondscore2 and secondscore3 to variables e and f with same results.
 
I tried renaming scorepointers to sscorepointers and that cause the duplicated digits to be garbled.


#5 Karl G OFFLINE  

Karl G

    Dragonstomper

  • Topic Starter
  • 603 posts

Posted Tue Nov 27, 2018 3:06 PM

I confirmed that the variables themselves contain the correct values, so presumably I setup the pointers incorrectly. No doubt it will jump out at me when I look at it again with a clear head.

#6 Gemintronic OFFLINE  

Gemintronic

    Jason S. - Lead Developer & CEO

  • 9,253 posts

Posted Tue Nov 27, 2018 3:10 PM

I confirmed that the variables themselves contain the correct values, so presumably I setup the pointers incorrectly. No doubt it will jump out at me when I look at it again with a clear head.

 

Thank you for your interest in this.  For me editing assembly files without proper knowledge of assembly itself.. well, gives me more practical exposure (and eventually understanding).  Your sweet mini kernels are the perfect incentive :)



#7 Karl G OFFLINE  

Karl G

    Dragonstomper

  • Topic Starter
  • 603 posts

Posted Wed Nov 28, 2018 8:59 AM

After sleeping on it, I was able to fix the problem.  I was making the unwarranted assumption that the titescreen kernel set the score pointers in the same way that bB does.  I replaced that code with the bB code that sets the pointers, and it is working now.

 

Note that this is pretty big for a minikernel since it duplicates the entire bB 6-digit score routine, but I can't really avoid that without also modifying the standard kernel.

 

As with any minikernel, this needs to go in the last bank of a multibank project.



#8 Coolcrab OFFLINE  

Coolcrab

    Moonsweeper

  • 400 posts
  • Location:Stockholm

Posted Wed Nov 28, 2018 9:35 AM

Awesome! Also you should edit the main thread as it says that its not working. 



#9 Karl G OFFLINE  

Karl G

    Dragonstomper

  • Topic Starter
  • 603 posts

Posted Wed Nov 28, 2018 9:56 AM

Awesome! Also you should edit the main thread as it says that its not working. 

 

Actually, I had changed it to "works now".   ;)



#10 bjbest60 OFFLINE  

bjbest60

    Star Raider

  • 92 posts
  • Location:Space Cactus Canyon

Posted Wed Nov 28, 2018 11:17 AM

Awesome!  This looks great--can't wait to use it.  Thanks so much!



#11 Karl G OFFLINE  

Karl G

    Dragonstomper

  • Topic Starter
  • 603 posts

Posted Wed Nov 28, 2018 11:37 AM

You're welcome. Let me know how it works for you. I thought of a couple more things to note. First, you can't yet use a different font for each score, but I will look into that for a future version. Also, the pfscore bars should still work, but only the ones next to the bottom score will display, by design. It has only been lightly tested, so definitely report any bugs!

#12 Gemintronic OFFLINE  

Gemintronic

    Jason S. - Lead Developer & CEO

  • 9,253 posts

Posted Wed Nov 28, 2018 1:24 PM

Works for standard kernel.  Multi sprite didn't like "secondscore2 = aux2" so I changed it to use yet another variable.  Compiled but screen went blank.

 

I think using a different font would require editing the score_graphics.asm and adding a second scoretable label and data.  I don't fully understand how to allocate more space via the ORG and REORG statements in there, though.

 

Thank you again Karl G!



#13 Karl G OFFLINE  

Karl G

    Dragonstomper

  • Topic Starter
  • 603 posts

Posted Wed Nov 28, 2018 2:12 PM

I think it can be done just by offsetting the pointer by the appropriate amount to point at the new font. I don't expect it to be too difficult, but we shall see.

#14 bjbest60 OFFLINE  

bjbest60

    Star Raider

  • 92 posts
  • Location:Space Cactus Canyon

Posted Wed Nov 28, 2018 4:05 PM

I would love it if this could also work with the multisprite kernel.  Consider me a beggar and a chooser.  :)  Thanks again!



#15 Gemintronic OFFLINE  

Gemintronic

    Jason S. - Lead Developer & CEO

  • 9,253 posts

Posted Wed Nov 28, 2018 4:11 PM

I would love it if this could also work with the multisprite kernel.  Consider me a beggar and a chooser.  :)  Thanks again!

 

The multisprite kernel is a strange beast.  I posted a solution in the topic below.  You get two additional 2 digit scores and can use the pfscore bars.  It does use up more variables and I haven't tested on real hardware (yet).  Not my original work.

http://atariage.com/...-4#entry4155439



#16 Karl G OFFLINE  

Karl G

    Dragonstomper

  • Topic Starter
  • 603 posts

Posted Wed Nov 28, 2018 6:47 PM

Multi sprite didn't like "secondscore2 = aux2" so I changed it to use yet another variable.  Compiled but screen went blank.

 

I tried the multisprite kernel, and my results were the same as yours.  I did very briefly see a flash of both scores, but then it went blank, and it overcycles.  I have no idea what the issue is with that one, and no idea how to fix it, unfortunately.



#17 Karl G OFFLINE  

Karl G

    Dragonstomper

  • Topic Starter
  • 603 posts

Posted Thu Nov 29, 2018 8:43 AM

Looks like I was wrong about how simple it would be to use a separate font for the second score.  It will indeed require a second font table.  I'm not sure when I'll get around to this, but it should still be doable.



#18 Tony The 2600 ONLINE  

Tony The 2600

    Moonsweeper

  • 394 posts
  • 1.19 MHz
  • Location:Adelaide, Australia

Posted Fri Nov 30, 2018 2:28 AM

I would find this very useful with the DPC+ kernel also but assuming there would overcycle issues as with the multisprite.

 

On a side note im thinking it should be possible to hack the font using Bithacker on compiled ROM's haven't tried it though.

 

Nice project, very interesting.



#19 Lillapojkenpćön OFFLINE  

Lillapojkenpćön

    Chopper Commander

  • 126 posts

Posted Fri Nov 30, 2018 12:06 PM

While you're dabbling with scores and the difference between titlescreen and bB score code, would you mind either sharing here or send me some code I can replace the titlescreen score code with that works exactly like in bB? Atleast when you're using DPC+ option in titlescreen the score is one pixel further to the left then in bB, I've tried to adjust it but I'm not there yet.






0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users