Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .func CoinGet_func
- CoinGet_func:
- // Store for return
- .local _x, _y
- stx $.x
- sty $.y
- // Initialize other variables
- .local _bit, _goal, _index
- lda #1
- sta $.bit
- stx $.goal
- stz $.index
- CoinGet_func_loop:
- // Load custom index
- ldx $.index
- // Only 16 indices, 2 bytes each
- cpx #0x0020
- bcs $+CoinGet_func_loop_end
- lda $=CoinIndexes,x
- cmp $.goal
- bne $+CoinGet_func_loop_skip_equal
- // 16 bit set of flags
- lda $=LevelCode
- asl a
- tax
- lda $=CollectedFlag,x
- ora $.bit
- sta $=CollectedFlag,x
- bra $+CoinGet_func_loop_end
- CoinGet_func_loop_skip_equal:
- // Increment
- inc $.index
- inc $.index
- asl $.bit
- bra $-CoinGet_func_loop
- CoinGet_func_loop_end:
- CoinGet_func_return:
- // Fix our registers
- ldx $.x
- ldy $.y
- return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement