ThomasSpeedrunner

stuff

Aug 29th, 2014
5,355
0
Never
2
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. sub_E244:
  2.     add.w   (a3),d5
  3.     add.w   4(a3),d4
  4.     move.w  d4,d3
  5.     add.w   d3,d3
  6.     andi.w  #$F00,d3
  7.     lsr.w   #3,d5
  8.     move.w  d5,d0
  9.     lsr.w   #4,d0
  10.     andi.w  #$7F,d0
  11.     add.w   d3,d0
  12.     moveq   #0,d3
  13.     bsr.s   LocateBlock
  14.     move.l  #BM128_FDZ,d6
  15.     tst.b   (Current_Zone).w
  16.     beq.w   sub_E244_continue
  17.     move.l  #BM128_CFZ,d6
  18.     cmpi.b  #$0D,(Current_Zone).w
  19.     beq.w   sub_E244_continue
  20.     move.l  #BM128_ALZ,d6
  21.  
  22. sub_E244_continue:
  23.     add.l   d6,d3
  24.     movea.l d3,a0
  25.     move.w  (a0),d3
  26.     andi.w  #$3FF,d3
  27.     lsl.w   #3,d3
  28.     adda.w  d3,a1
  29.     rts                     ; Return to whatever code was running before this routine was run.
  30. ; ---------------------------------------------------------------------------
  31.  
  32. LocateBlock:
  33.     move.b  (a4,d0.w),d3    ; load chunk ID in d3
  34.     beq.s   LocateBlock_EmptyChunk
  35.     lsl.w   #7,d3
  36.     andi.w  #$70,d4
  37.     andi.w  #$E,d5
  38.     add.w   d4,d3
  39.     add.w   d5,d3
  40.     rts                     ; Return to whatever code was running before this routine was run.
  41. ; ---------------------------------------------------------------------------
  42.  
  43. LocateBlock_EmptyChunk:
  44.     addq.w  #4,sp                   ; pop a stack frame to leave a1 pointing at the first tile
  45.     rts                     ; Return to whatever code was running before this routine was run.
  46. ; End of function sub_E09E
Advertisement