Geekboy

Untitled

Apr 10th, 2013
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. LutHandlerStart:
  2. ;The Flow
  3. ;first Decrement timer
  4. ;Check for z or c
  5. ;If Count = 2 move to next
  6. ;if Count = 1 move to follow player
  7. ;If count = HCF
  8. ;Else increment based on LUT parameters
  9. ;assume nothing is loaded as we may jump back here. later. can be removed if needed tho
  10.   ld hl,-3
  11.   add hl,sp
  12.   ld a,(hl)  ; ld a with flags
  13.   ld b,a     ; save in b
  14.   and %11111100
  15.   rrca \ rrca       ;div4  / move count to front of byte
  16.   ld e,a            ; save Count
  17.   dec a             ; shift dec
  18.   add a,a \ add a,a ; shift back
  19.   or b              ; merge back
  20.   ld (hl),a         ; save back into flagsk with new values
  21.   ld a,e            ; Restore count
  22.   cp 2              ; check values
  23.   jp c,FollowP      ; if 1 move to followP
  24.   jr z,IncLut       ; if 2 move to next position on lut
Advertisement
Add Comment
Please, Sign In to add comment