Advertisement
vladikcomper

Sonic Winter Adventures - HUD Object

Feb 15th, 2014
482
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; ===========================================================================
  2. ; ---------------------------------------------------------------------------
  3. ; Object 21 - SCORE, TIME, RINGS
  4. ; ---------------------------------------------------------------------------
  5.  
  6. Obj21:                  ; XREF: Obj_Index
  7.         moveq   #0,d0
  8.         move.b  $24(a0),d0
  9.         move.w  Obj21_Index(pc,d0.w),d1
  10.         jmp Obj21_Index(pc,d1.w)
  11. ; ===========================================================================
  12. Obj21_Index:    dc.w Obj21_Main-Obj21_Index
  13.         dc.w Obj21_Show-Obj21_Index
  14.         dc.w Obj21_Hide-Obj21_Index
  15. ; ===========================================================================
  16.  
  17. Obj21_Main:             ; XREF: Obj21_Main
  18.         addq.b  #2,$24(a0)
  19.         move.w  #0,8(a0)    ; was $90
  20.         move.w  #$108,$A(a0)
  21.         move.l  #Map_obj21,4(a0)
  22.         move.w  #var_HUDVram/$20,2(a0)
  23.         move.b  #0,1(a0)
  24.         move.b  #0,$18(a0)
  25.  
  26. ; ===========================================================================
  27. Obj21_Show:
  28.             cmpi.w  #$90,8(a0)
  29.             bcc.s   Obj21_Flash
  30.             addq.w  #4,8(a0)
  31.             jmp DisplaySprite
  32.  
  33. Obj21_Flash:                ; XREF: Obj21_Main      
  34.         clr.b   $1A(a0)     ; make all counters yellow
  35.         tst.w   ($FFFFFE20).w   ; do you have any rings?
  36.         beq.s   @RingFlash  ; if not, branch
  37.         jmp DisplaySprite
  38.  
  39. @RingFlash  btst    #3,($FFFFFE05).w
  40.         bne.s   @Display
  41.         move.b  #1,$1A(a0)
  42.  
  43. @Display    jmp DisplaySprite
  44.  
  45. ; ===========================================================================
  46. Obj21_Hide:
  47.                 tst.w   8(a0)       ; has the HUD reached $0 by X-pos?
  48.                 beq @Delete     ; if yes, branch
  49.                 subi.w  #2,8(a0)
  50.         jmp DisplaySprite
  51. @Delete     jmp DeleteObject
  52.  
  53. ; ===========================================================================
  54. ; ---------------------------------------------------------------------------
  55. ; Sprite mappings - SCORE, TIME, RINGS
  56. ; ---------------------------------------------------------------------------
  57. Map_obj21:
  58.         dc.w @HUD_Normal-Map_obj21
  59.         dc.w @HUD_RingFlash-Map_obj21
  60. @HUD_Normal dc.b 4
  61.         dc.b $80, $F, $80, 0, 0     ; SCORE & TIME counters
  62.         dc.b $80, $F, $80, $10, $20 ; SCORE & TIME counters
  63.         dc.b $9F,  5, $A0, $FC-2, 0 ; Ring Icon
  64.         dc.b $A0,  9, $80, $20, $10 ; RING Counter
  65. @HUD_RingFlash  dc.b 4
  66.         dc.b $80, $F, $80, 0, 0     ; SCORE & TIME counters
  67.         dc.b $80, $F, $80, $10, $20 ; SCORE & TIME counters
  68.         dc.b $9F,  5, $80, $FC-2, 0 ; ring
  69.         dc.b $A0,  9, $80, $20, $10 ; RING Counter
  70.         even
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement