From 552ee3b894870fc68ac8a47e385b125e9aa450ff Mon Sep 17 00:00:00 2001 From: Rob McMullen Date: Sat, 22 Jul 2017 08:46:09 -0700 Subject: [PATCH] Added lives remaining display; reduced score display to 5 digits & lowered scoring values to more like a 1980 game --- actors.s | 5 +++-- background.s | 50 ++++++++++++++++++++++++++++++++++++++++++++++--- fatfont128.dat | Bin 1024 -> 1024 bytes maze.s | 2 +- 4 files changed, 51 insertions(+), 6 deletions(-) diff --git a/actors.s b/actors.s index d6228ff..c73018e 100644 --- a/actors.s +++ b/actors.s @@ -3,6 +3,7 @@ level_speed_l .byte 255, 200, 210, 220, 230, 240 ;# increment of fractional pixe level_speed_h .byte 2, 2, 2, 2, 2, 2 ;level_speed_h .byte 0, 0, 0, 0, 0, 0 player_score_row .byte 2, 7, 12, 17 +player_lives_row .byte 3, 8, 13, 18 player_score_l .byte 0, 0, 0, 0 player_score_m .byte 0, 0, 0, 0 player_score_h .byte 0, 0, 0, 0 @@ -112,8 +113,8 @@ GAME_OVER = 255 ; ;# Scores ; -DOT_SCORE = $05 -box_score .byte 0, $40, $80, $120, $160, $200, $240 +DOT_SCORE = $01 +box_score .byte 0, $20, $40, $60, $80, $100, $120 add_score nop sed diff --git a/background.s b/background.s index a4237ae..4201861 100644 --- a/background.s +++ b/background.s @@ -200,9 +200,11 @@ init_panel nop bne ?3 ?4 ldx #0 - jsr update_score + jsr print_score + jsr print_lives inx - jsr update_score + jsr print_score + jsr print_lives rts player1_text .byte "PLAYER1", 0 @@ -221,6 +223,39 @@ player2_text .byte "PLAYER2", 0 ; c = " " ; pad.addch(row, col, ord(c)) ; i += 1 +update_lives nop + lda #MAZE_SCORE_COL + sta c + lda player_lives_row,x + sta r + lda #6 + sta size + jsr damage_string + +print_lives nop + ldy player_lives_row,x + jsr mazerow + lda player_lives,x + cmp #6 + bcc ?ok + lda #6 +?ok sta scratch_col + lda #40 + sec + sbc scratch_col + sta scratch_col + ldy #MAZE_SCORE_COL +?loop cpy scratch_col + bcc ?blank + lda #'*' + bne ?show +?blank lda #0 +?show sta (mazeaddr),y + iny + cpy #40 + bcc ?loop + rts + print_hex pha stx param_x @@ -241,6 +276,15 @@ print_hex pha ldx param_x rts +print_low_nibble stx param_x + and #$0f + tax + lda hexdigit,x + sta (mazeaddr),y + iny + ldx param_x + rts + ; def update_score(): update_score nop @@ -257,7 +301,7 @@ print_score nop jsr mazerow ldy #MAZE_SCORE_COL lda player_score_h,x - jsr print_hex + jsr print_low_nibble lda player_score_m,x jsr print_hex lda player_score_l,x diff --git a/fatfont128.dat b/fatfont128.dat index e70c49206cf83041ba585e25bcc9f84cd969ed66..c90aaf3f0a0d611e7cb82ae8d6e4efc23fd4701a 100644 GIT binary patch delta 20 ccmZqRXyDioz{ozMZ~y%H`{!*AXI#ky08*<6PXGV_ delta 20 ccmZqRXyDioz{uXQYR