GLOBALCODE_INIT: ;rocs feather STZ $0406 ;initialize the flag RTL GLOBALCODE_MAIN: incsrc ./Codes/test.asm LDA $F2 AND #$80 BEQ Nopers LDA #$21 STA $012E ;play sfx ;LDA #$0B ;STA $2080 Nopers: ;7E09B8 - link's sprite left piece shadow xpos ;7E0022 - link's sprite right piece shadow xpos ;7e099C - link's sprite body ;7e0998 - link's sprite head ;7e0020 - link's true y position ;00E8 - camera y position ; ;Bottle Code ;$FA = Button-checking for more than 1 frame. ;Button L - 20 ;Button R - 10 ;Button X - 40 ;Button A - 80 ;;;;DIVING ;LDA #$01 ;STZ $032A ;- swim flag ;034F - swim flag? ;F800, 0B - splash flag LDA $0202 ;we'll check if bottles are the... CMP #$10 ;...currently selected item. if it's... BNE NotBottles ;... not a bottle, then skip this whole routine. LDA $FA ;check if we are holding AND #$20 ; Button L BEQ OrRestoreIt ;Ignore if it isn't pressed. LDA #$0B ;current item equipped STA $030C ;free ram JMP DontDisablePlox OrRestoreIt: LDA #$00 CMP $030C BEQ NotBottles LDA $030C STA $0303 STZ $030C JMP NotBottles DontDisablePlox: LDA #$07 STA $0303 ;change to bug net ;LDA $F4 ;check if we are pressing ;AND #$40 ; Button Y ;BEQ NotBottles ;Ignore if it isn't pressed. ;7E0050 ;7E0300 ;LDA $F34F ;CMP #$01 ;BNE IsNotBottle1 ;LDA #$0E ;STA $0202 ;LDA #$01 ;STA $300 ;IsNotBottle1: ;LDA $F34F ;CMP #$02 ;BNE IsNotBottle2 ;IsNotBottle2: ;LDA $F34F ;CMP #$03 ;BNE IsNotBottle3 ;IsNotBottle3: ;LDA $F34F ;CMP #$04 ;BNE NotBottles NotBottles: ;Roc's feather ;Freeram slots used ;$0406 - Currently using roc's cape ; BCS is equal or greater ; BCC is less than ;LSR #$FF ; LDA $0405 ; CMP #$02 ; BEQ Two ; ; LDA #$02 ; STA $0405 ; JMP Done ; ; Two: ; LDA #$06 ; STA $0405 ; Done: LDA #$0E CMP $0202 BEQ BugNetTest1 RTL BugNetTest1: LDA #$0B CMP $030C BNE BugNetTest2 RTL BugNetTest2: LDA $11 CMP #$01 BCS ArePausing ;check if pausing LDA $0406 CMP #$00 BEQ ArePausing DEC $0406 LinkGoDown: ArePausing: STZ $037A STZ $030C LDA $0406 ;Check if this timer is.... CMP #$02 ;less than 2. BCC SkipRocAnimation ;If it is, ignore this whole routine. LDA $0405 STA $037A LDA $0202 ;we'll check if bugcatching net is the... CMP #$0E ;...currently selected item. if it's... BNE DontDoItNiggaaaa ;... not the net, then skip this whole routine. STZ $0303 DontDoItNiggaaaa: STZ $0372 STZ $5E SkipRocAnimation: LDA $11 CMP #$01 BCS NoJumpAnime ;check if pausing LDA $1A LSR A LSR A LSR A AND #$01 CLC ADC #$01 STA $0405 NoJumpAnime: BNE NoLagHereYoRocFeather NoLagHereYoRocFeather: LDA #$02 CMP $5D BNE DontBreakTheGameNigga JMP IgnoreRocsCape DontBreakTheGameNigga: LDA $5D CMP #$01 BEQ FixTheFalling LDX #$00 .Loop LDA $5D CMP RocFeatherBlackListConditions,x BEQ StoreZero INX CPX #$06 BCC .Loop RTL StoreZero: STZ $5D FixTheFalling: ResetRocValues: LDA $11 CMP #$00 BNE FeatherCheck3 ;check if pausing LDA $6C CMP #$00 BNE FeatherCheck2 ;check if not in doorway LDA $5B ;\ CMP #$02 ;| BCS FeatherCheck4 ;/check if you are falling ;0351 (2 if grass, 1 if water) LDA $0202 ;we'll check if bugcatching net is the... CMP #$0E ;...currently selected item. if it's... BNE NotBugNet ;... not the net, then skip this whole routine. STZ $0303 ;prevent item useage so we can hijack the routine LDA $0406 CMP #$01 BCS NoJumpForYou LDA $F4 ;check if we are pressing AND #$40 ; Button Y BEQ NotBugNet ;Ignore if it isn't pressed. LDA #$0B CMP $0354 BCC NoJumpForYou ;prevent A button interactions LDA #$2D STA $0406 ;Store timer value to the Roc Feather Timer LDA #$13 ;play jump sfx STA $012F ;STX $F35A FeatherCheck1: FeatherCheck2: NoJumpForYou: NotBugNet: STZ $55 ;turn off the cape STZ $B0 ;reset ladder priveledges LDA $0406 ;Check if this timer is.... CMP #$02 ;less than 2. BCC IgnoreRocsCape ;If it is, ignore this whole routine. STZ $5D ;preserve "link is on ground" state STZ $5E ;preserve speed at $00 STZ $036C;prevent A button interactions LDA #$13 ;\ STA $0375 ;/freeze ledge timer to #$13 STA $0430;prevent floor-button pressing while in-air LDA #$17 STA $5D ;prevent pots/slashing LDA #$01 STA $B0 ;Prevent ladder climbing STZ $F35A ;disable shield ;LDA #$16 ;CMP $0406 ;BCC DownRoc ;LDA $0020 ;CLC ;ADC #$01 ;STA $0020 ;JMP UpRoc ;DownRoc: ;LDA #$16 ;CMP $0406 ;BCS UpRoc ;LDA $0020 ;SEC ;SBC #$01 ;STA $0020 ;UpRoc: STZ $57 ;STA $55 ;/enable invincible/invisible flag STA $037B ;enable ignoring all enemies STZ $0351 STZ $0355 STZ $0356 STZ $0357 RTL FeatherCheck4: STZ $0406 FeatherCheck3: FeatherLandingFlag: RTL IgnoreRocsCape: LDA $0406 ;Check if this timer is.... CMP #$01 ;not equal to 1 BNE FeatherLandingFlag ;if it isn't equal, then branch LDA $5B ;check if player CMP #$02 ;is on the ground BCS FeatherLandingFlag ;if not, ignore LDA #$21 STA $012E ;play sfx STZ $0430 ;allow floor switch pressing again STZ $5D STZ $0406 STZ $037A ;undraw link STZ $037B ;LDX $F35A ;STA $F35A RTL ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; RocFeatherBlackListConditions: db $00,$10,$17