Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- !Coinsneeded = $05 ; Number of coins necessary to collect.
- !Count = $191F ; RAM address for tracking how many you've collected.
- !AllGot = $1F2F ; 12-byte table for tracking levels you've collected all coins in.
- print "A coin that gives Mario a power-up or 1-up when he collects ", dec(!Coinsneeded), "."
- db $42
- JMP Mario : JMP Mario : JMP Mario : JMP Return : JMP Return : JMP Return : JMP Return
- JMP Mario : JMP Mario : JMP Mario
- Mario:
- JSR SetItemMemory
- LDY #$00 ;act like tile 2C (So mario collects it like a coin)
- LDA #$2C
- STA $1693
- INC !Count
- LDA !Count
- CMP #!Coinsneeded
- BEQ AllCollected
- Return:
- RTL
- AllCollected:
- PHY
- LDA.w $13BF ;\
- LSR ;|
- LSR ;|
- LSR ;|
- TAY ;|
- LDA.w $13BF ;| Set all collected bit
- AND.b #$07 ;|
- TAX ;|
- LDA.l $05B35B,X ;|
- TYX ;|
- ORA !AllGot,X ;|
- STA !AllGot,X ;/
- PLY
- STZ !Count
- LDA $19
- CMP #$00
- BEQ Smallmario
- CMP #$01
- BEQ SuperMario
- PHY
- JSL $00F388 ; give 1up
- PLY
- RTL
- Smallmario: ; make big
- LDA #$3E
- STA $1DFC
- LDA #$02
- STA $71
- LDA #$2F
- STA $1496
- STA $9D
- LDA #$0A
- STA $1DF9
- RTL
- SuperMario: ; make fire
- LDA #$3E
- STA $1DFC
- LDA #$20
- STA $149B
- STA $9D
- LDA #$04
- STA $71
- LDA #$03
- STA $19
- LDA #$0A
- STA $1DF9
- RTL
- SetItemMemory:
- REP #$30
- LDA $9A
- AND.w #$FF00
- LSR
- LSR
- LSR
- LSR
- LSR
- LSR
- STA $04
- LDA $9A
- AND.w #$0080
- LSR
- LSR
- LSR
- LSR
- LSR
- LSR
- LSR
- ORA $04
- STA $04
- LDA $98
- AND.w #$0100
- BEQ CODE_00C03A
- LDA $04
- ORA.w #$0002
- STA $04
- CODE_00C03A:
- LDA.w $13BE
- AND.w #$000F
- ASL
- TAX
- LDA.l $00BFFF,X
- CLC
- ADC $04
- STA $04
- TAY
- LDA $9A
- AND.w #$0070
- LSR
- LSR
- LSR
- LSR
- TAX
- SEP #$20
- LDA.w $19F8,Y
- ORA.l $00C005,X
- STA.w $19F8,Y
- SEP #$10
- RTS
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement