Jump to content
IGNORED

Making PLAYERSCORES Mini Kernel Taller


Recommended Posts

I'd like to use the PLAYERSCORES mini kernel for icons - kinda like the A [_] and B [_] inventory in Zelda.  So, the score font in that area needs to be taller to look good.

 

I've tried adding an extra " sta WSYNC" to the top of the minikernel loop and that almost works.  Somehow my change causes artifacts in the left hand score.
 

minikernelloop
 ;this draws two scores - uses up 8 lines
 sta WSYNC  ;wait till line starts (count cycles)

 sta WSYNC  ; extra WSYNC makes score taller

 

I've tried all sorts of changes but don't really know what I'm doing.  Any clues fellas?

 

playerscores.asm

 

bada029b_bas.thumb.png.39bbb4d7781d98f81a2685c247561da2.png

 

 

  • Like 1
Link to comment
Share on other sites

5 minutes ago, splendidnut said:

Where does the code end up in memory?  Does adding the extra code cause the code to have a branch instruction that crosses a page-boundary?

 

Don't know.  What might be a clue is that it looks like the left two digit score is being drawn over the right two digit score every other line.

Link to comment
Share on other sites

Without digging into the assembly (again) I'd say what you're seeing is expected. Each line of the kernel relies on precisely timed updates to change the player graphic values. If you put in 2 WSYNC hits at the top of the loop, you're instructing the 6502 to sleep for the rest of the remaining line (fine) and then go to sleep again for another whole line, skipping those precisely timed graphics changes. (not so fine)

  • Like 2
Link to comment
Share on other sites

I put together a demo batari BASIC project in case that helps.  From what I've read so far this is intended behavior.  At least that's pointing me in the right direction.  Thank you!

 

So, what would the proper way to stretch the font be?  Maybe tell it that each number is 16 lines instead of 8?  If so, I would need to point it to a new score font that is 16 lines tall? 

 

I feel like I'm not approaching it correctly.

 

bigplayerscores.asmbigpscore.bas

 

bigpscore_bas.thumb.png.317267c463dfad7f8274251191c8d5c5.png

Link to comment
Share on other sites

Easiest way to double the height would be to make it a 2-line kernel instead of a 1-line kernel by duplicating the code inside the draw loop (NOTE: untested):

 

minikernelloop
 ;this draws two scores - uses up 8 lines
 sta WSYNC  ;wait till line starts (count cycles)
 lda (temp0digit1),y ;5 (8) get the graphic
 ifconst onedigitscores
  sleep 3
 else
  sta GRP0 ;3 (11)
 endif
 ldx temp0color  ;3 (3) left player score color
 stx COLUP0 ;3 (14) goes in both digits
 lda (temp0digit2),y ;5 (19) get the graphic
 sta GRP1 ;3 (22)
 stx COLUP1 ;3 (25) 
 lda (temp1digit2),y ;5 (30) get graphic
 tax ;2 (32) store in X
 lda (temp1digit1),y ;5 (37) get the graphic
 ldy temp1color  ;3 (40) right player score color
 ldy temp1color  ;3 (43) need a 3 cycle delay...
 sty COLUP0 ;3 (45) player 0 color
 ifconst onedigitscores
  sleep 3
 else
  sta GRP0 ;3 (11)
 endif
 sty COLUP1 ;3 (48) player 1 color
 stx GRP1 ;3 (51) player 1 data
 

  ;----- draw same line again
 ldy temp7  ;3 --- reload the index (same as previous line)
 sta WSYNC  ;wait till line starts (count cycles)
 lda (temp0digit1),y ;5 (8) get the graphic
 ifconst onedigitscores
  sleep 3
 else
  sta GRP0 ;3 (11)
 endif
 ldx temp0color  ;3 (3) left player score color
 stx COLUP0 ;3 (14) goes in both digits
 lda (temp0digit2),y ;5 (19) get the graphic
 sta GRP1 ;3 (22)
 stx COLUP1 ;3 (25) 
 lda (temp1digit2),y ;5 (30) get graphic
 tax ;2 (32) store in X
 lda (temp1digit1),y ;5 (37) get the graphic
 ldy temp1color  ;3 (40) right player score color
 ldy temp1color  ;3 (43) need a 3 cycle delay...
 sty COLUP0 ;3 (45) player 0 color
 ifconst onedigitscores
  sleep 3
 else
  sta GRP0 ;3 (11)
 endif
 sty COLUP1 ;3 (48) player 1 color
 stx GRP1 ;3 (51) player 1 data

 dec temp7  ;2 (53)
 ldy temp7  ;3  (56)
 bpl minikernelloop ;2+ (58-59)  --- loop after drawing 2 lines

 

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

THANK YOU BOTH!!!!!   Great insight given the horrible clues I gave.  Appreciate the time and patience.

 

After:

bpl minikernelloop ;2+ (58-59)  --- loop after drawing 2 lines iny ;2 (60-61) make it 0

 

I added:

 ldy #$00
 sty COLUP0 ;3 (48) player 1 color
 sty COLUP1 ;3 (48) player 1 color

 

After

 ldy temp1color  ;3 (43) need a 3 cycle delay...

 

I added:

 sty COLUP0 ;3 (45) player 0 color
 sty COLUP1 ;3 (45) player 0 color

 

..and got it to work!

bpssplendrev.asm

 

bigpscore.bas_1.thumb.png.8c8f0eee22e909259de263c2923a64ab.png

 

 

  • Like 1
Link to comment
Share on other sites

3 hours ago, LatchKeyKid said:

Cool!  Do you have a dedicated thread for the project?

 

This was just to demonstrate proof of effort for those who helped me.  :)

 

Though, I ended up coding until 4am to get it this far.  Would be a shame to not use it.

  • Like 2
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...