Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; *$3963B-$39784 JUMP LOCATION
- {
- ; MODE 4 SWIMMING
- LDA $4D : BEQ BRANCH_ALPHA ; checks some link handler
- LDA.b #$02 : STA $5D ; sets link to recoil mode, I don't think this instruction is in JP1.0
- STZ $25 ; something with attract mode
- JSR Player_ResetSwimCollision
- STZ $032A ; sets one of the fast swimming counters to 0
- STZ $034F ; sets a similar counter to 0
- LDA $50 : AND.b #$FE : STA $50 ; takes link's ability to change direction and masks it because why...?
- BRL BRANCH_$386B5 ; GO TO RECOIL MODE
- BRANCH_ALPHA: ; mostly sets shit to 0
- STZ $3A ; press status of B/Y
- STZ $3C ; length of b button press
- STZ $3D ; spin attack stuff
- STZ $79 ; spin attack charge counter
- STZ $0308 ; Link carrying stuff
- STZ $0309 ; ↓↓↓
- LDA $7EF356 : BNE .hasFlippers ; checks flippers in mirrored sram
- RTS
- .hasFlippers
- LDA $033C : ORA $033D : ORA $033E : ORA $033F : BNE BRANCH_GAMMA ; load link's swim acceleration and mash em all together, then jump if all of them are 0
- LDA $032B : CMP.b #$02 : BEQ BRANCH_DELTA ; subpixel stuff?
- LDA $032D : CMP.b #$02 : BEQ BRANCH_DELTA ; seems to just do animation
- JSR Player_ResetSwimCollision
- BRANCH_DELTA:
- LDA $2E : AND.b #$01 : STA $2E ; animation step junk
- INC $2D : LDA $2D : CMP.b #$10 : BCC BRANCH_EPSILON ; incrementing some counter then masking it, counts 0-7 in game
- STZ $2D ; set this counter to 0
- STZ $02CC ; zeros some flag/counter
- LDA $2E : AND.b #$01 : EOR.b #$01 : STA $2E ; more animation steps
- BRA BRANCH_EPSILON
- BRANCH_GAMMA:
- INC $2D ; incrementing this counter again
- LDA $2D : CMP.b #$08 : BCC BRANCH_EPSILON ; compare to 7, jump
- STZ $2D ; set to 0
- LDA $2E : INC A : AND.b #$03 : STA $2E : TAX ; animation junk
- LDA $9635, X : STA $02CC ; I think these are link's hands
- BRANCH_EPSILON: ; is this where the speed magic happens
- LDA $034F : BNE BRANCH_ZETA ; jump if faster swimming flag isn't set
- LDA $033C : ORA $033D : ORA $033E : ORA $033F : BEQ BRANCH_THETA ; mash all of link's accelerations together, jump if not 0
- LDA $F6 : AND.b #$80 : STA $00 ; load some face buttons + shoulders and compare for A button press, put that in $00
- LDA $F4 : ORA $00 : AND.b #$C0 : BEQ BRANCH_THETA ; load other buttons and mash with A being pressed, comparison looks for B or Y as new buttons, jumps when not 0
- STA $034F ; store this to the faster swimming flag
- LDA $25 : JSR Player_DoSfx2 ; i wonder what this does hmmmmmmmmmmmmmmmmmmmmmmmmmmmMMMMMMMMMMMMMMM
- LDA.b #$01 : STA $032A ; set the swimming counter thing to 1
- LDA.b #$07 : STA $02CB ; set this other swimming thing to 7
- JSR $98A8 ; $398A8 IN ROM
- BRANCH_ZETA: ; we swimmin slow
- DEC $02CB : BPL BRANCH_THETA ; counts down that one counter, jump to fast swim when we're >=0
- LDA.b #$07 : STA $02CB ;reset that counter to 7
- INC $032A : LDA $032A : CMP.b #$05 : BNE BRANCH_THETA ; when that counter loops, increment this one, go to fast swim when not 0
- STZ $032A ; set that counter to 0
- LDA $034F : AND.b #$3F ; take this anim? counter and mask it
- STA $034F ; then store it
- ; *$39715 LONG BRANCH LOCATION
- BRANCH_THETA:
- LDA $49 : AND.b #$0F : BNE BRANCH_IOTA ; some auto move crap
- LDA $F0 : AND.b #$0F : BNE BRANCH_IOTA ; looks like it's branching on directionals
- STZ $30 ; zero Y speed
- STZ $31 ; zero X speed
- JSR $9785 ; $39785 IN ROM
- LDA $034A : BEQ BRANCH_KAPPA ; branch when that one counter is 0
- LDA $0372 : BEQ BRANCH_LAMBDA ; bonk...?
- LDA $0340 ; when swimming, this seems to be a bitfield for dpad buttons
- BRA BRANCH_IOTA
- BRANCH_LAMBDA:
- LDA $033C : ORA $033D : ORA $033E : ORA $033F : BNE BRANCH_MU ; mash together acceleration again, branch if not 0
- STZ $48 ; prevents link from grabbing stuff
- JSL Player_ResetSwimState
- BRA BRANCH_MU
- BRANCH_KAPPA: ; both of these branch to the same place, but animation step is reset when link isn't in the swim state
- LDA $5D : CMP.b #$04 : BEQ BRANCH_MU
- STZ $2E ; animation step
- BRA BRANCH_MU
- BRANCH_IOTA: ; i think this is looking for dpad input then branching, or zeroing stuff if no input
- CMP $0340 : BEQ BRANCH_NU
- STZ $2A ; Y subpixel
- STZ $2B ; X subpixel
- STZ $6B ; slope collision
- STZ $48 ; grab things flag
- BRANCH_NU:
- STA $0340 ; puts dpad input apparently into this address
- JSR $97A6 ; $397A6 IN ROM
- JSR $97C7 ; $397C7 IN ROM
- JSR $9903 ; $39903 IN ROM
- BRANCH_MU:
- JSR $B64F ; $3B64F IN ROM
- JSL $07E245 ; $3E245 IN ROM
- JSR $B7C7 ; $3B7C7 IN ROM
- JSL $07E6A6 ; $3E6A6 IN ROM
- STZ $0302
- JSR $E8F0 ; $3E8F0 IN ROM
- RTS
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement