Advertisement
TheRetroGuy

Monitors and Rings spawning problems fix S1 (Debug Mode)

Aug 15th, 2014
383
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Monitors spawning as broken Fix:
  2.  
  3. Obj26_Main:             ; XREF: Obj26_Index
  4.         addq.b  #2,$24(a0)
  5.         move.b  #$E,$16(a0)
  6.         move.b  #$E,$17(a0)
  7.         move.l  #Map_obj26,4(a0)
  8.         move.w  #$680,2(a0)
  9.         move.b  #4,1(a0)
  10.         move.b  #3,$18(a0)
  11.         move.b  #$F,$19(a0)
  12.         lea ($FFFFFC00).w,a2
  13.         moveq   #0,d0
  14.         move.b  $23(a0),d0
  15.         beq.s   Obj26_NotBroken
  16.         bclr    #7,2(a2,d0.w)
  17.         btst    #0,2(a2,d0.w)   ; has monitor been broken?
  18.         beq.s   Obj26_NotBroken ; if not, branch
  19.         move.b  #8,$24(a0)  ; run "Obj26_Display" routine
  20.         move.b  #$B,$1A(a0) ; use broken monitor frame
  21.         rts
  22.  
  23. Rings Fix:
  24.  
  25. Obj25_Main:             ; XREF: Obj25_Index
  26.         lea ($FFFFFC00).w,a2
  27.         moveq   #0,d0
  28.         move.b  $23(a0),d0
  29.         beq.w   Obj25_MakeRingsD
  30.         lea 2(a2,d0.w),a2
  31.         move.b  (a2),d4
  32.         move.b  $28(a0),d1
  33.         move.b  d1,d0
  34.         andi.w  #7,d1
  35.         cmpi.w  #7,d1
  36.         bne.s   loc_9B80
  37.         moveq   #6,d1
  38.  
  39. loc_9B80:
  40.         swap    d1
  41.         move.w  #0,d1
  42.         lsr.b   #4,d0
  43.         add.w   d0,d0
  44.         move.b  Obj25_PosData(pc,d0.w),d5 ; load ring spacing data
  45.         ext.w   d5
  46.         move.b  Obj25_PosData+1(pc,d0.w),d6
  47.         ext.w   d6
  48.         movea.l a0,a1
  49.         move.w  8(a0),d2
  50.         move.w  $C(a0),d3
  51.         lsr.b   #1,d4
  52.         bcs.w   loc_9C02
  53.         bclr    #7,(a2)
  54.         bra.w   loc_9BBA
  55. ; ===========================================================================
  56.  
  57. Obj25_MakeRingsD: ; Green Snake Fix
  58.           ; this routine makes the rings work, and not spawn million of them
  59.         addq.b  #2,$24(a0) ; add 2 to the routine counter
  60.         move.w  8(a0),$32(a0) ; move x-position to secondary x-position
  61.         move.l  #Map_obj25,4(a0) ; load mappings
  62.         move.w  #$27B2,2(a0) ; load right art
  63.         move.b  #4,1(a0) ; setup objects render flags
  64.         move.b  #2,$18(a0) ; setup priority
  65.         move.b  #$47,$20(a0) ; setup touch response
  66.         move.b  #8,$19(a0) ; setup how wide this object is
  67.         move.b #1,$26(a0) ; set as debug mode ring (This object does not use angles
  68.         bra.s Obj25_Animate ; branch away
  69.  
  70. Obj25_MakeRings:
  71.         swap    d1
  72.         lsr.b   #1,d4
  73.         bcs.s   loc_9C02
  74.         bclr    #7,(a2)
  75.         bsr.w   SingleObjLoad
  76.         bne.s   loc_9C0E
  77.  
  78. loc_9BBA:               ; XREF: Obj25_Main
  79.         move.b  #$25,0(a1)  ; load ring object
  80.         addq.b  #2,$24(a1)
  81.         move.w  d2,8(a1)    ; set x-axis position based on d2
  82.         move.w  8(a0),$32(a1)
  83.         move.w  d3,$C(a1)   ; set y-axis position based on d3
  84.         move.l  #Map_obj25,4(a1)
  85.         move.w  #$27B2,2(a1)
  86.         move.b  #4,1(a1)
  87.         move.b  #2,$18(a1)
  88.         move.b  #$47,$20(a1)
  89.         move.b  #8,$19(a1)
  90.         move.b  $23(a0),$23(a1)
  91.         move.b  d1,$34(a1)
  92.  
  93. loc_9C02:
  94.         addq.w  #1,d1
  95.         add.w   d5,d2       ; add ring spacing value to d2
  96.         add.w   d6,d3       ; add ring spacing value to d3
  97.         swap    d1
  98.         dbf d1,Obj25_MakeRings ; repeat for number of rings
  99.  
  100. loc_9C0E:
  101.         btst    #0,(a2)
  102.         bne.w   DeleteObject
  103.  
  104. Obj25_Animate:              ; XREF: Obj25_Index
  105.         move.b  ($FFFFFEC3).w,$1A(a0) ; set frame
  106.         bsr.w   DisplaySprite
  107.         move.w  $32(a0),d0
  108.         andi.w  #$FF80,d0
  109.         move.w  ($FFFFF700).w,d1
  110.         subi.w  #$80,d1
  111.         andi.w  #$FF80,d1
  112.         sub.w   d1,d0
  113.         cmpi.w  #$280,d0
  114.         bhi.s   Obj25_Delete
  115.         rts
  116. ; ===========================================================================
  117.  
  118. Obj25_Collect:              ; XREF: Obj25_Index
  119.         addq.b  #2,$24(a0)
  120.         move.b  #0,$20(a0)
  121.         move.b  #1,$18(a0)
  122.         bsr.w   CollectRing
  123.         lea ($FFFFFC00).w,a2
  124.         moveq   #0,d0
  125.         move.b  $23(a0),d0
  126.         beq.s   Obj25_Sparkle
  127.         move.b  $34(a0),d1
  128.         bset    d1,2(a2,d0.w)
  129.  
  130. Obj25_Sparkle:              ; XREF: Obj25_Index
  131.         lea (Ani_obj25).l,a1
  132.         bsr.w   AnimateSprite
  133.         bra.w   DisplaySprite
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement