;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;Kirby Style Jumping ;; ;;By: Chdata/Fakescaper ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; !Freespace = $968000 ;This is freespace !DecToZero = $7FFFEF ;This is freeram !FloatFlag = $7FFDFF ;This is freeram macro Patch(Hijack,JMLSL,Freespace,Startcode,Endcode) header : lorom org org db "STAR" dw --$01 dw --$01^$FFFF endmacro macro BNK(Protect) PHB : PHK : PLB : JSR : PLB endmacro %Patch($A21B,JSL,!Freespace,Start,End) Start: %BNK(Kirby) LDA $16 AND #$10 RTL Xspeeds: db $F4,$0C PopBubble: LDA #$21 ;*Stop jumping after pressing L routine STA $1DFC ;Yoshi tongue SFX LDA #$20 ; STA !DecToZero ;Decrements every frame and is used as a timer StopFloat: LDA #$00 ; STA !FloatFlag ;Kirby Float Flag. If zero you're not floating and if nonzero you're floating RTS ; Kirby: LDA !DecToZero ; BEQ Zero ; SEC : SBC #$01 ; STA !DecToZero ; Zero: ;REP #$20 ;*Stop Kirby Jump if you're right under the status bar routine ;LDA $96 ; ;CMP #$00F0 ; ;BCS Above ; ;LDA #$00F0 ; ;STA $96 ;Mario's Ypos (level) Above: ;SEP #$20 ; LDA $72 ;Mario image in air BEQ StopFloat ;branch if on ground LDA $140D ;Spin Jump flag ;Also see: Ending level ORA $71 ;Mario Action trigger (00=normal) ORA $73 ;Mario is ducking flag ORA $74 ;Mario is climbing flag ORA $75 ;Mario is in water flag ORA $13D4 ;Pause Flag ;ORA $14AF ;ON/OFF Flag - if you uncomment this, you can only Kirby jump if the ON/OFF switch is ON ORA $1470 ;Carrying something flag ORA $187A ;Riding yoshi flag ORA $149F ;Mario is cape flying flag ORA $14A5 ;The other Mario is cape flying flag BNE StopFloat ;If any of these are non-zero, branch. LDA !FloatFlag ;This is set to zero when you "pop" BNE What ;So when that happens this will not branch LDA $7D ;Mario Yspeed BMI Nruter ;Branch if 00-7F (going downwards) What: LDA $4219 ;Joypad 1Data (High Byte) AND #$80 ; BEQ Boing ; LDA $16 ; AND #$80 ;B and A (jump button) BEQ Boing ;If not jumping LDA !DecToZero ; BNE Boing ; LDA #$D0 ; STA $7D ;Yspeed - full speed jump LDA #$0E ; STA $1DF9 ;swimming sfx LDA #$0C ; STA !DecToZero ; LDA #$01 ; STA !FloatFlag ; Boing: LDA !FloatFlag ; BEQ Nruter ; STZ $13E4 ;Mario Dash Timer. This makes you instantly stop running LDA $18 ; AND #$10 ;L button BNE PopBubble ;Go to end Kirby jumping routine LDY #$42 ;$13E0 = Inflated by a P-Balloon (small Mario) #$43 is big Mario LDA $19 ;If small mario branch BEQ Bubble ; INY ;If your big Mario LDY #$43 Bubble: STY $13E0 ;Mario's image LDY #$00 ; LDA $7B ;Mario's xspeed BMI RightWay ;If 00-7F (right -->) INY ;If going left, Y = #$01 RightWay: LDA $7B ; CLC ; ADC #$10 ; CMP #$20 ; BCC Whatever ;Branch if less than 20 LDA Xspeeds,y ;db $F4,$0C STA $7B ; Whatever: LDA $7D ;If yspeed BMI Nruter ;is going upwards, return LDA #$0B ; STA $7D ; Nruter: RTS ; End: print "I'm psychic, I knew that you would patch this." print "-Chdata-"