;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; LevelASM Sprite ;; ;; "The Swiss Army Knife Of Level Effect Generators" ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; LevelASM Sprite is a sprite that will generate different level effects ;; ;; depending on the sprite's x position along the top of the screen (coordinates 0,0 - 15,0) ;; ;; as well as whether the extra info is set for 2 (above) or 3 (coordinates 0,1 - 15,1). ;; ;; The benefit of this is that one can have 32 simple LevelASM-style sprites in one, ;; ;; thus not wasting valuable sprite slots while using Sprite Tool. ;; ;; This sprite was inspired by and built largely from code written by Sonikku. ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Credits: Sonikku, Iceguy, Atma, edit1754, HuFlungDu, Jimmy52905, ;; ;; Kaijyuu, Koyuki, Magus, Mattrizzle, Maxx, Nanashi-SW, Roy ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Sprite Init and Main JSR ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; dcb "INIT" LDA $E4,x ; Load X position.. LSR ; .. LSR ; .. LSR ; .. LSR ; .. STA $C2,x ; For every 16 pixels, it loads a different effect RTL ; Return. dcb "MAIN" ; PHB ; PHK ; PLB ; JSR SpriteCodeStart ; Run sprite code. PLB ; RTL ; ;;;;;;;;;;;;;;;;;; ;; Main Routine ;; ;;;;;;;;;;;;;;;;;; Timer: dcb $30,$20,$00,$00 ;; Timer for certain stuff based on current intro, values with zero aren't used. Null: STZ $14C8,x ; Kill Sprite.. Return: RTS ; Return. SpriteCodeStart: LDA $9D ; If sprites are locked.. BNE Return ; Return. LDA $1540,x ; If timer isn't zero.. BNE Notimer ; Skip some of this code.. LDY $C2,x ; Index by X position. LDA Timer,y ; Load timer time. STA $1540,x ; Store it. Notimer: LDA $7FAB10,x ; If Extra bit.. AND #$04 ; ..Is set.. BNE List2 ; Load list 2 LDA $C2,x ; If not, load list 1. JSL $0086DF ; Execute Pointer dcw ClassicScroll&$FFFF ; SMB1/SMB2J-Style Scrolling dcw LockHorzScroll&$FFFF ; Lock Horizontal Scrolling dcw SMB2VertLevel&$FFFF ; SMB2-Style Vertical Level dcw VertAutoScroll&$FFFF ; Vertical Auto-Scroll dcw CeilingGen&$FFFF ; Off-Screen Ceiling Generator dcw LightningGen&$FFFF ; Thunder And Lightning Generator dcw Earthquake&$FFFF ; Earthquake Generator dcw TransLayer3&$FFFF ; Transparent Layer 3 Generator dcw Layer3TideFix&$FFFF ; Layer 3 Tide Vertical-Scrolling Fix dcw FloatLayer1&$FFFF ; Layer 1 Floating Effect dcw Null&$FFFF ; null dcw Null&$FFFF ; null dcw WindUp&$FFFF ; Wind Generator (Up) dcw WindDown&$FFFF ; Wind Generator (Down) dcw WindRight&$FFFF ; Wind Generator (Right) dcw FlyingYoshi&$FFFF ; Flying Yoshi Generator List2: LDA $C2,x ; Load list 2. JSL $0086DF ; Execute Pointer dcw ClearSpriteBlueP&$FFFF ; Trigger Blue P-Switch When All Sprites Cleared dcw ClearSpriteSilverP&$FFFF ; Trigger Silver P-Switch When All Sprites Cleared dcw ClearSpriteONOFF&$FFFF ; Turn Switch ON/OFF When All Sprites Cleared dcw ClearSpriteWarp&$FFFF ; Teleport When All Sprites Cleared dcw LevelEnder&$FFFF ; Level Ender (With Goal Fanfare) dcw LevelEnderBoss&$FFFF ; Level Ender (With Boss Victory Fanfare) dcw LevelEnderSecret&$FFFF ; Level Ender (Secret Exit With Goal Fanfare) dcw LevelEnderSecretBoss&$FFFF ; Level Ender (Secret Exit With Boss Victory Fanfare) dcw Null&$FFFF ; null dcw Null&$FFFF ; null dcw Null&$FFFF ; null dcw Null&$FFFF ; null dcw Null&$FFFF ; null dcw Null&$FFFF ; null dcw Null&$FFFF ; null dcw CutsceneTool&$FFFF ; Cutscene Tool ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; SMB1/SMB2J-Style Scrolling ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ClassicScroll: LDA $007B CMP #$7E BCS ScrollEvent LDA $007E CMP #$69 BCC ScrollEvent LDA #$01 STA $1411 RTS ScrollEvent: LDA #$00 STA $1411 RTS ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Lock Horizontal Scrolling ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; LockHorzScroll: STZ $1411 RTS ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; SMB2-Style Vertical Level ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; SMB2VertLevel: STZ $1411 CHECK_LEFT: LDA $94 CMP #$0A BCS CHECK_RIGHT LDA #$E7 STA $94 CHECK_RIGHT: CMP #$E8 BCC VRETURN LDA #$0B STA $94 VRETURN: JSR SPRITE_LOOP RTS SPRITE_LOOP: PHX LDX #$00 LOOP_START: LDA $E4,x CMP #$08 BCS SPRITE_RIGHT LDA #$F7 STA $E4,x BRA VRETURN2 SPRITE_RIGHT: CMP #$F8 BCC VRETURN2 LDA #$09 STA $E4,x VRETURN2: INX CPX #$13 BCC LOOP_START PLX RTS ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Vertical Auto-Scroll ;; ;; WARNING: Do NOT place this generator in the same screen as the main entrance. ;; ;; Place it at least one screen higher instead, or else a strange glitch will occur. ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; VertAutoScroll: LDA $71 ;\ CMP #$09 ; | BEQ ReturnV ; |If Mario is dying... ; | CMP #$06 ; | BEQ ReturnV ; | ; | CMP #$05 ; | BEQ ReturnV ; |Or changing to another level... ; | CMP #$01 ; |Or getting hurt... BEQ ReturnV ;/ Go to "Return". LDA $13 ;\ LSR A ; | BCC ReturnV ;/ Only run code every other frame. STZ $1412 ;Disable Vertical Scroll so that the code can run properly. LDA $1464 ;\ ORA $1465 ; |If the screen position is at the top of the level... BEQ ReturnV ;/ Go to "Return". REP #$20 ;16-bit (accumulator). DEC $1464 ;Make the screen scroll upwards automatically. SEP #$20 ;8-bit (accumulator). ReturnV: RTS ;Return from Subroutine. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Off-Screen Ceiling Generator ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; CeilingGen: LDA $97 ; mario y (high (next frame)) BPL CEILING_RETURN ; if not negative, return LDY #$00 ; load 0 in to Y LDA $19 ; powerup BEQ CEILING_2 ; if small, check for ceiling height as small mario LDA $73 ; same if ducking BNE CEILING_2 ; LDY #$01 ; otherwise check as big CEILING_2: LDA CEILING_TABLE,y ; if not yet above ceiling threshold... CMP $96 ; mario y (low) BCC CEILING_RETURN ; return INC A ; STA $96 ; place mario on top of screen LDA $7D ; EOR #$FF ; Flip mario y speed INC A ; CMP #$10 ; cap downward speed at 10 BCC CEILING_1 ; LDA #$10 CEILING_1: STA $7D ; set speed LDA #$01 ; play "hit head" sound effect STA $1DF9 ; CEILING_RETURN: RTS ; return CEILING_TABLE: db $E8,$F0 ; how high above the screen mario can go for small and big mario ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Thunder And Lightning Generator ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; DATA_04F6F8: dcb $20,$58,$43,$CF,$18,$34,$A2,$5E DATA_04F700: dcb $07,$05,$06,$07,$04,$06,$07,$05 ADDR_04F708: dcb $A9 LightningGen: PHX LDX.W $0681 LDA.B #$10 STA.W $0682,X STZ.W $0683,X STZ.W $0684,X STZ.W $0685,X TXY LDX.W $1FFB BNE ADDR_03E01B LDA.W $190D BEQ ADDR_03DFF0 REP #$20 ; Accum (16 bit) LDA.W $0701 BRA ADDR_03E031 ADDR_03DFF0: LDA $14 ; Accum (8 bit) LSR BCC ADDR_03E036 DEC $1FFC BNE ADDR_03E036 TAX LDA ADDR_04F708,X AND #$07 TAX LDA DATA_04F6F8,X STA $1FFC LDA DATA_04F700,X STA $1FFB TAX LDA #$08 STA $1FFD LDA #$18 STA $1DFC ; / Play sound effect ADDR_03E01B: DEC $1FFD BPL ADDR_03E028 DEC $1FFB LDA #$04 STA $1FFD ADDR_03E028: TXA ASL TAX REP #$20 ; Accum (16 bit) LDA.L $00B5DE,X ADDR_03E031: STA $0684,Y SEP #$20 ; Accum (8 bit) ADDR_03E036: LDX $1429 LDA #$00 TAX LDA #$0E STA $00 ADDR_03E042: LDA $0705,X STA $0686,Y INX INY DEC $00 BNE ADDR_03E042 TYX STZ $0686,X INX INX INX INX STX $0681 PLX RTS ; Return ;;;;;;;;;;;;;;;; ;; Earthquake ;; ;;;;;;;;;;;;;;;; Earthquake: LDA $1626,x BNE QuakeSkip LDA #$FF STA $1887 LDA #$01 STA $1626,x QuakeSkip: LDA $1887 CMP #$30 BNE QuakeSound LDA #$FF STA $1887 QuakeSound: LDA $13 ;\ AND #$3F ; | BNE QuakeReturn ; | Uncomment to remove Sfx. LDA #$0A ;sound effect STA $1DFC ;sound bank QuakeReturn: RTS ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Transparent Layer 3 Generator ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; TransLayer3: LDA $40 ;\ ORA #$04 ; |Set the layer 3 bit of CGADDSUB STA $40 ;/ LDA #$13 ;\ STA $212d ;/add some layer to the subscreen RTS ;Return ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Layer 3 Tide Vertical-Scrolling Fix ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Layer3TideFix: PHP REP #%00110100 LDA $1C ; \ CMP.w #$0080 ; | compare screen Y position BCS VARH ; | with $C0 - desired Y BCC ZERO ; / VARH: LDA $1C ; \ SBC.w #$0080 ; | set layer 3 Y STA $24 ; | to $C0 - desired height PLP ; | if screen Y > or = the value RTS ; / ZERO: LDA.w #$0000 ; \ STA $24 ; | set layer 3 Y to zero PLP ; | if screen Y < the value RTS ; / ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Layer 1 Floating Effect ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;; FloatLayer1: LDA $9D BNE FloatReturn LDA $1426 BNE FloatReturn LDA $14 LSR A AND #$1F TAY LDA $1464 CLC ADC YSPEED,y STA $1464 FloatReturn: RTS YSPEED: dcb $00,$00,$00,$00,$01,$00,$00,$00,$00,$00 dcb $00,$00,$00,$00,$01,$00,$00,$00,$00,$00,$00 dcb $00,$00,$00,$FF,$00,$00,$00,$00,$00,$FF,$00 ;;;;;;;;;;;;;;;;;;;;;;;;; ;; Wind Generator (Up) ;; ;;;;;;;;;;;;;;;;;;;;;;;;; WindUp: LDA $7D BPL SlowUp RTS SlowUp: LDA $7D SEC SBC #$04 STA $7D RTL ;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Wind Generator (Down) ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;; WindDown: LDA $7D BPL SlowDown RTS SlowDown: LDA $7D CLC ADC #$04 STA $7D RTL ;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Wind Generator (Right) ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;; WindRight: LDA $7B CMP #$C5 BEQ SlowRight DEC $7B RTS SlowRight: INC $7B RTL ;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Flying Yoshi Generator ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;; FlyingYoshi: LDA #$02 STA $141E LDA #$00 ;\ CMP $187A ;|Check if riding yoshi BEQ ReturnY ;/ LDA #$02 ;\Give yoshi wings STA $1410 ;/ LDA $77 ;\ AND #$04 ;|Doesn't work if not in air BNE ReturnY ;/ LDA #$80 ;\ CMP $007D ;| BCC B ;|Check if your going down LDA #$24 ;| CMP $007D ;| BCS B ;/ LDA #$24 ;\ if so, lower speed STA $007D ;/ B: LDA $16 ;\ AND #$80 ;|check if B is pressed BEQ ReturnY ;/ LDA #$BF ;\ If so, fly STA $007D ;/ ReturnY: RTS ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Trigger Blue P-Switch When All Sprites Cleared ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ClearSpriteBlueP: LDY #$0B ; load times to loop.. BluePLoop: CPY $00 ; if its not in Y.. BEQ BluePCheck ; don't count it. (all this does is make it not check itself) LDA $190F,y ; if sprites don't turn into silver coins.. AND #$40 ; with a silver pow.. BNE BluePCheck ; don't check it. LDA $14C8,y ; if its not dead.. BNE BluePReturn ; return. BluePCheck: DEY ; decrease Y.. BPL BluePLoop ; and if all sprites aren't dead, loop. STZ $14C8,x ; drown level.asm in blue P LDA #$B0 ; Load P-Switch Timer .. STA $14AD ; Duration into $14AD. LDA #$0E ; \ set P-switch music STA $1DFB ; / RTS BluePReturn: RTS ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Trigger Blue-P-Switch When All Sprites Cleared ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ClearSpriteSilverP: LDY #$0B ; load times to loop.. SilverPLoop: CPY $00 ; if its not in Y.. BEQ SilverPCheck ; don't count it. (all this does is make it not check itself) LDA $190F,y ; if sprites don't turn into silver coins.. AND #$40 ; with a silver pow.. BNE SilverPCheck ; don't check it. LDA $14C8,y ; if its not dead.. BNE SilverPReturn ; return. SilverPCheck: DEY ; decrease Y.. BPL SilverPLoop ; and if all sprites aren't dead, loop. STZ $14C8,x ; level.asm is shot... LDA #$B0 ; Load P-Switch Timer .. STA $14AE ; Duration into $14AE. LDA #$0E ; \ set P-switch music STA $1DFB ; / RTS SilverPReturn: RTS ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Turn Switch ON/OFF When All Sprites Cleared ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ClearSpriteONOFF: LDY #$0B ; load times to loop.. OFFLoop: CPY $00 ; if its not in Y.. BEQ OFFCheck ; don't count it. (all this does is make it not check itself) LDA $190F,y ; if sprites don't turn into silver coins.. AND #$40 ; with a silver pow.. BNE OFFCheck ; don't check it. LDA $14C8,y ; if its not dead.. BNE OFFReturn ; return. OFFCheck: DEY ; decrease Y.. BPL OFFLoop ; and if all sprites aren't dead, loop. STZ $14C8,x ; nullify level.asm and send it to nillspace LDA $14AF ; check ON/OFF EOR #$01 ; is it either 0 or 1? STA $14AF ; stack it LDA #$1C ; switch sound STA $1DFC ; sound bank OFFReturn: RTS ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Teleport When All Sprites Cleared ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ClearSpriteWarp: LDA #$00 STA $14AF LDA $1493 BNE ReturnC1 STX $00 LDY #$0B ClearLoop1: CPY $00 BEQ ClearCheck1 LDA $14C8,y BNE ReturnC1 ClearCheck1: DEY BPL ClearLoop1 LDA #$29 STA $1DFC SEP #$30 LDA #$06 STA $71 STZ $89 STZ $88 ReturnC1: RTS ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Level Ender (With Goal Fanfare) ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; LevelEnder: LDY #$0B ; load times to loop.. EndLoop1: CPY $00 ; if its not in Y.. BEQ EndCheck1 ; don't count it. (all this does is make it not check itself) LDA $190F,y ; if sprites don't turn into silver coins.. AND #$40 ; with a silver pow.. BNE EndCheck1 ; don't check it. LDA $14C8,y ; if its not dead.. BNE EndReturn1 ; return. EndCheck1: DEY ; decrease Y.. BPL EndLoop1 ; and if all sprites aren't dead, loop. STZ $14C8,x ; murder level.asm LDA #$FF STA $1493 DEC $13C6 LDA #$0C ; end level music STA $1DFB ; store sound and exit level. RTS EndReturn1: RTS ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Level Ender (With Boss Victory Fanfare) ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; LevelEnderBoss: LDY #$0B ; load times to loop.. EndLoop2: CPY $00 ; if its not in Y.. BEQ EndCheck2 ; don't count it. (all this does is make it not check itself) LDA $190F,y ; if sprites don't turn into silver coins.. AND #$40 ; with a silver pow.. BNE EndCheck2 ; don't check it. LDA $14C8,y ; if its not dead.. BNE EndReturn2 ; return. EndCheck2: DEY ; decrease Y.. BPL EndLoop2 ; and if all sprites aren't dead, loop. STZ $14C8,x ; assassinate level.asm LDA #$FF STA $1493 DEC $13C6 LDA #$0B ; end level music STA $1DFB ; store sound and exit level. RTS EndReturn2: RTS ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Level Ender (Secret Exit With Goal Fanfare) ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; LevelEnderSecret: LDY #$0B ; load times to loop.. EndLoop3: CPY $00 ; if its not in Y.. BEQ EndCheck3 ; don't count it. (all this does is make it not check itself) LDA $190F,y ; if sprites don't turn into silver coins.. AND #$40 ; with a silver pow.. BNE EndCheck3 ; don't check it. LDA $14C8,y ; if its not dead.. BNE EndReturn3 ; return. EndCheck3: DEY ; decrease Y.. BPL EndLoop3 ; and if all sprites aren't dead, loop. STZ $14C8,x ; slay level.asm LDA #$01 STA $141C LDA #$FF STA $1493 ;LDA #$FF ; uncomment to allow walking ;STA $1493 ; uncomment to allow walking DEC $13C6 LDA #$0C ; end level music STA $1DFB ; store sound and exit level. RTS EndReturn3: RTS ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Level Ender (Secret Exit With Boss Victory Fanfare) ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; LevelEnderSecretBoss: LDY #$0B ; load times to loop.. EndLoop4: CPY $00 ; if its not in Y.. BEQ EndCheck4 ; don't count it. (all this does is make it not check itself) LDA $190F,y ; if sprites don't turn into silver coins.. AND #$40 ; with a silver pow.. BNE EndCheck4 ; don't check it. LDA $14C8,y ; if its not dead.. BNE EndReturn4 ; return. EndCheck4: DEY ; decrease Y.. BPL EndLoop4 ; and if all sprites aren't dead, loop. STZ $14C8,x ; stab level.asm LDA #$01 STA $141C LDA #$FF STA $1493 ;LDA #$FF ; uncomment to allow walking ;STA $1493 ; uncomment to allow walking DEC $13C6 LDA #$0B ; end level music STA $1DFB ; store sound and exit level. RTS EndReturn4: RTS ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Cutscene Tool ;; ;; Stops Mario from moving and makes him invisible. Pressing a button teleports the player. ;; ;; It also disables the timer, reserved item, and score. ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; CutsceneTool: LDA #$FF ;Stun Mario (To keep Mario from moving) STA $18BD ; LDA #$01 ;Disable Mario from being touched by enemies. STA $13F9 ; LDA #$3C ;Show Ducking pose (To make Mario 1 tile.) STA $13E0 ; LDA #$02 ;Hide Mario's Lower Half. STA $78 ; STZ $0DC2 ;Disable Reserved item. STZ $0F31 ;Disable Timer. STZ $0F34 ;Disable Score (Mario) STZ $0F37 ;Disable Score (Luigi) LDA #$80 ;Button to press (B or A). CMP $16 ;Is Mario pressing B or A? BEQ Teleport ;If he is, go to Teleport. RTL ;If not, return. Teleport: LDA #$06 ;Teleport Mario. STA $71 ; LDA #$00 ;Play sound on teleport (Change to 00 to stop sounds from playing). STA $1DFC ; RTL ;End