Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- header
- lorom
- !RATS = End-Start ;Define the RATS tag
- org $258000 ;Point this to some freespace, if you don't want the Blank Screen of Death™.
- Start: ;Start of the RATS tag
- DEC $0DBE ;Prevent Mario from getting a 1-UP after 100 coins are collected.
- JMP CoinChecker
- CoinChecker:
- LDA $DBF ;Load Mario's coins in the Accumulator.
- CMP #$64 ;Check if the value in A is 100
- BEQ GivePowerup ;If so, then jump to GivePowerup
- GivePowerup:
- LDA $19 ;Load Mario's powerup in A.
- CMP #$00 ;If Mario has nothing, then...
- BEQ Mushroom ;Jump to Mushroom
- CMP #$01 ;If Mario has a Mushroom, then...
- BEQ Flower ;Jump to Flower
- CMP #$03 ;If Mario has a Flower, then...
- BEQ Cape ;Jump to Cape
- CMP #$02 ;If Mario has a cape, then...
- BEQ Star ;Jump to Star
- JMP CoinChecker
- Mushroom:
- LDA #$01 ;Load 01 into A
- STA $19 ;Load 01 into RAM Address 19
- LDA $0DBF ;|
- SEC ; \ Decrease Mario's coins by 100
- SBC #$64 ; / Taken from all.log
- STA $0DBF ;|
- JMP CoinChecker
- Flower:
- LDA #$03 ;Load 03 into A
- STA $19 ;Load 03 into RAM Address 19
- LDA $0DBF ;|
- SEC ; \ Decrease Mario's coins by 100
- SBC #$64 ; / Taken from all.log
- STA $0DBF ;|
- JMP CoinChecker
- Cape:
- LDA #$02 ;Load 02 into A
- STA $19 ;Load 02 into RAM Address 19
- LDA $0DBF ;|
- SEC ; \ Decrease Mario's coins by 100
- SBC #$64 ; / Taken from all.log
- STA $0DBF ;|
- JMP CoinChecker
- Star:
- LDA #$F ;Load 15 into A
- STA $1490 ;Load 15 into RAM Address 1490
- LDA $0DBF ;|
- SEC ; \ Decrease Mario's coins by 100
- SBC #$64 ; / Taken from all.log
- STA $0DBF ;|
- JMP CoinChecker
- End: ;End of RATS tag
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement