Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; Polling to see if a player receives a 1-up. This method is limited to how many 1-ups a player
- ; can get in the game. In this scenario, after getting a 1-up at 1 million points, the player
- ; will receive no more extra men.
- one_up_lo:
- .byte <score_ten_thousands, <score_ten_thousands, <score_hun_thousands, <score_ten_thousands
- .byte <score_hun_thousands, <score_ten_thousands, <score_hun_thousands, <score_ten_thousands
- .byte <score_hun_thousands, <score_ten_thousands, <score_hun_thousands, <score_ten_thousands
- .byte <score_hun_thousands, <score_ten_thousands, <score_hun_thousands, <score_ten_thousands
- .byte <score_hun_thousands, <score_ten_thousands, <score_hun_thousands, <score_ten_thousands
- .byte <score_millions
- one_up_hi:
- .byte >score_ten_thousands, >score_ten_thousands, >score_hun_thousands, >score_ten_thousands
- .byte >score_hun_thousands, >score_ten_thousands, >score_hun_thousands, >score_ten_thousands
- .byte >score_hun_thousands, >score_ten_thousands, >score_hun_thousands, >score_ten_thousands
- .byte >score_hun_thousands, >score_ten_thousands, >score_hun_thousands, >score_ten_thousands
- .byte >score_hun_thousands, >score_ten_thousands, >score_hun_thousands, >score_ten_thousands
- .byte >score_millions
- one_up_num:
- .byte $02,$05,$01,$05
- .byte $02,$05,$03,$05
- .byte $04,$05,$05,$05
- .byte $06,$05,$07,$05
- .byte $08,$05,$09,$05
- .byte $01
- test_one_up:
- ldx one_up_test ; Load X with variable that keeps track of the offset
- cpx #21 ; for the scoring tables. If it gets to 21, the player
- bcc :+ ; has maxed out the ability to gain one-ups, and
- rts ; the routine just returns.
- : lda one_up_lo, x ; Get the address for the part of the score that needs
- sta temp_16bit_2+0 ; to be checked...
- lda one_up_hi, x ;
- sta temp_16bit_2+1 ;
- ldy #$00 ;
- lda (temp_16bit_2), y ; ... and compare it to the number in the one_up_num
- cmp one_up_num, x ; table.
- bne return_oneup ; If the number doesn't match, do nothing but return
- inc one_up_test ; to the game, but if they match, increment the player's
- inc lives ; lives by 1, increment the offset to check for the
- ldx #$0b ; next one-up, and run the sound effect. After all this
- jmp return_sfx_routine ; is done, return to the game.
- return_oneup: ;
- rts ;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement