Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -:
- 0E:87AE: 60 RTS ----------------------
- snap_to_ladder:
- ; Return if neither up nor down are pressed
- 0E:87AF: A5 23 LDA p1_buttons_held
- 0E:87B1: 29 30 AND #$30
- 0E:87B3: F0 F9 BEQ -
- ; Certain flag/button combos mean we can return early.
- ; Not quite sure what they mean yet.
- ; $11 = pressing up and atop ladder.
- ; But if you're also pressing down...
- 0E:87B5: 05 35 ORA ladder_flags
- 0E:87B7: C9 11 CMP #$11
- 0E:87B9: F0 F3 BEQ -
- 0E:87BB: C9 2E CMP #$2E
- 0E:87BD: F0 EF BEQ -
- ; Set x pixel to middle of the nearest tile.
- ; That is, round down, then add 8.
- 0E:87BF: AD 60 04 LDA x_pixel[0]
- 0E:87C2: 85 2E STA temp_x
- 0E:87C4: 29 F0 AND #$F0
- 0E:87C6: 09 08 ORA #$08
- 0E:87C8: 38 SEC
- 0E:87C9: 8D 60 04 STA x_pixel[0]
- ; Check which way the ladder snapped Mega Man
- 0E:87CC: E5 2E SBC temp_x
- 0E:87CE: 90 08 BCC +
- 0E:87D0: 85 00 STA $00
- 0E:87D2: 20 F5 8D JSR ladder_scroll_adjustment_right
- 0E:87D5: 4C E2 87 JMP ++
- +:
- ; Manual twos complement
- 0E:87D8: 49 FF EOR #$FF
- 0E:87DA: 18 CLC
- 0E:87DB: 69 01 ADC #$01
- 0E:87DD: 85 00 STA $00
- 0E:87DF: 20 65 8E JSR ladder_scroll_adjustment_left
- ++:
- ; Make Mega Man face the opposide direction.
- ; It's a feature!!
- ; Where does the ladder fidget or B holding glitch live?
- 0E:87E2: AD 20 04 LDA sprite_flags[0]
- 0E:87E5: 49 40 EOR #$40
- 0E:87E7: 8D 20 04 STA sprite_flags[0]
- 0E:87EA: 20 A5 D3 JSR update_anim_index?
- ; Ditch a return address and do ladder physics
- 0E:87ED: 68 PLA
- 0E:87EE: 68 PLA
- 0E:87EF: 4C BC 86 JMP ladder_physics
Add Comment
Please, Sign In to add comment