+Gemintronic Posted June 9 Share Posted June 9 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 1 Quote Link to comment Share on other sites More sharing options...
+splendidnut Posted June 9 Share Posted June 9 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? 1 Quote Link to comment Share on other sites More sharing options...
+Gemintronic Posted June 9 Author Share Posted June 9 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. Quote Link to comment Share on other sites More sharing options...
RevEng Posted June 9 Share Posted June 9 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) 2 Quote Link to comment Share on other sites More sharing options...
+Gemintronic Posted June 9 Author Share Posted June 9 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 Quote Link to comment Share on other sites More sharing options...
+splendidnut Posted June 9 Share Posted June 9 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 1 1 Quote Link to comment Share on other sites More sharing options...
+Gemintronic Posted June 9 Author Share Posted June 9 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 1 Quote Link to comment Share on other sites More sharing options...
+Karl G Posted June 10 Share Posted June 10 Excellent! Keep in mind though that displaying the score and a big minikernel like that takes away a lot of cycles from your game, though. 2 Quote Link to comment Share on other sites More sharing options...
+Gemintronic Posted June 10 Author Share Posted June 10 5 hours ago, Karl G said: Excellent! Keep in mind though that displaying the score and a big minikernel like that takes away a lot of cycles from your game, though. Who needs a score when you have swords? 4 Quote Link to comment Share on other sites More sharing options...
LatchKeyKid Posted June 17 Share Posted June 17 On 6/10/2023 at 3:32 AM, Gemintronic said: Who needs a score when you have swords? Cool! Do you have a dedicated thread for the project? Quote Link to comment Share on other sites More sharing options...
+Gemintronic Posted June 18 Author Share Posted June 18 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. 2 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.