;a block that changes mario direction from down to left or right to up. db $42 JMP pass : JMP pass : JMP pass : JMP pass : JMP pass : JMP return : JMP pass : JMP pass : JMP main : JMP pass !freeram_timer = $0D9C ;free ram address for timer to interact door again !freeram_direction = $0DA1 ;>free ram for door mode diraction main: LDA !freeram_direction ;\if player is normal BEQ return ;/then done LDY #$00 ;\otherwise make this block behave 25 LDA #$25 ;| STA $1693 ;/ LDA !freeram_direction CMP #$03 ;\if going down... BEQ from_down_to_left ;/then call the "left" code CMP #$02 ;\otherwise if going right.. BEQ from_right_to_up ;/then call the "up" code BRA return ;>neiter of these, return from_down_to_left: JSL centerUpLeftRight JSL centering_down LDA #$04 STA !freeram_direction RTL from_right_to_up: JSL centerUpLeftRight LDA #$01 STA !freeram_direction return: RTL centerUpLeftRight: LDA $93 ;\ BEQ left ;| LDA $94 ;| AND #$F0 ;| CLC : ADC #$10 ;|center mario horizontally STA $94 ;| LDA $95 ;| ADC #$00 ;| STA $95 ;| BRA donecenter ;| left: ;| LDA $94 ;| AND #$F0 ;| STA $94 ;/ donecenter: STZ $7B ;\so mario doesn't exit in mid air STZ $7D ;/ RTL centering_down: LDA $90 ;\ BEQ end_vert ;|center mario vertically LDA $96 ;| AND #$F0 ;| CLC : ADC #$10 ;| STA $96 ;| LDA $97 ;| ADC #$00 ;| STA $97 ;/ end_vert: RTL pass: LDA !freeram_direction ;\if player is normal BEQ return ;/then done LDY #$00 ;\otherwise make this block behave 25 LDA #$25 ;| STA $1693 ;/ RTL