Advertisement
VladislavSavvateev

Twilightlicious

Sep 10th, 2015
298
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Twilight:          
  2.         move.b  #$E4,d0             ; move 'stop music' sound index
  3.         jsr     PlaySound_Special   ; call the playing subroutine
  4.         jsr     ClearPLC            ; clear the PLC
  5.         jsr     Pal_FadeFrom
  6.         move    #$2700,sr           ; disable interrupts
  7.  
  8. Twilight_SetupVDP:
  9.         lea     ($C00004).l,a6      ; setup teh VDP
  10.         move.w  #$8004,(a6)         ; mode register 1 setting
  11.         ; move.w    #$8170,(a6)
  12.         move.w  #$8230,(a6)         ; map Plane A setting
  13.         move.w  #$8407,(a6)         ; map Plane B setting
  14.         move.w  #$9001,(a6)         ; plane size setting
  15.         move.w  #$9200,(a6)         ; window vertical position
  16.         move.w  #$8B03,(a6)         ; mode register 3 setting
  17.         move.w  #$8720,(a6)         ; backdrop color setting
  18.         clr.b   ($FFFFF64E).w       ; clear $FFFFF64E
  19.         jsr     ClearScreen         ; clear the actual screen
  20.         lea     ($FFFFD000).w,a1    ; clear $FFD000-$FFD7FF
  21.         moveq   #0,d0               ; d0 = 0
  22.         move.w  #$7FF,d1            ; set repeat times to $7FF or d1 = $07FF
  23.  
  24. Twilight_ClrObjRam:
  25.         move.l  d0,(a1)+            ; fill 4 bytes in object RAM with 0
  26.         dbf     d1,Twilight_ClrObjRam   ; repeat d1 = $7FF times
  27.            
  28. Twilight_Art:
  29.         vram    $0020               ; VRAM $0020
  30.         lea     (Twilight_1Art).l,a0 ; load location of art of Twilight
  31.         jsr     NemDec              ; decompress Nemesis art
  32.                
  33. Twilight_Mappings:
  34.         lea     ($FF0000).l,a1      ; load location of screen mappings
  35.         lea     (Twilight_BMap).l,a0    ; load location of art mappings
  36.         move.w  #0,d0               ; d0 = 0
  37.         jsr     EniDec              ; decompress Enigma mappings
  38.                
  39. Twilight_ShowOnVDP:
  40.         lea     ($FF0000).l,a1      ; load location of screen mappings
  41.         vram    $E000,d0            ; load location of decompress art
  42.         moveq   #$7,d1              ; set cols
  43.         moveq   #$7,d2              ; set rows
  44.         jsr     ShowVDPGraphics     ; call the displaying subroutine
  45.        
  46.  
  47. Twilight_Palette:
  48.         lea     (Twilight_1Pal).l,a1    ; load location palette of art
  49.         lea     ($FFFFFB80).w,a2    ; load palette RAM
  50.         moveq   #7,d0               ; set repeat time to $1F or d0 = $1F
  51. @loop:  move.l  (a1)+,(a2)+         ; move 4 bytes of palette to palette RAM
  52.         dbf     d0,@loop            ; repeat $1F times
  53.  
  54.         moveq   #$FFFFFFAD,d0
  55.         jsr     PlaySample
  56.        
  57.         move.b  #3,$FFFFFFF2
  58.        
  59.         jsr     Pal_FadeTo
  60.        
  61. ; ---------------------------------------------------------------------------------------------------------------------
  62.  
  63. Twilight_Loop:
  64.         move.b  #2,($FFFFF62A).w
  65.         jsr     DelayProgram
  66.         jsr     ObjectsLoad         ; run objects load program
  67.         jsr     BuildSprites        ; run build sprites program
  68.         jsr     Twilight_ChangeArt
  69.         cmp.b   #6,$FFFFFFF5
  70.         blt.s   Twilight_Loop
  71.        
  72. Twilight_Next:
  73.         lea     $FFFFFFF0,a0
  74.         clr.l   (a0)+
  75.         clr.l   (a0)+
  76.         movea.l #0,a0
  77.         rts
  78.        
  79. Twilight_ChangeArt:
  80.         subq.b  #1,$FFFFFFF2
  81.         beq.s   @cont
  82.         rts
  83. @cont
  84.         move.b  #3,$FFFFFFF2
  85.         lea     Twilight_PalIndex,a0
  86.         move.b  $FFFFFFF3,d0
  87.         lsl.b   #2,d0
  88.         adda.l  d0,a0
  89.         move.l  (a0),a0
  90.         lea     $FFFFFB00,a1
  91.         move.l  (a0)+,(a1)+
  92.         move.l  (a0)+,(a1)+
  93.         move.l  (a0)+,(a1)+
  94.         move.l  (a0)+,(a1)+
  95.         move.l  (a0)+,(a1)+
  96.         move.l  (a0)+,(a1)+
  97.         move.l  (a0)+,(a1)+
  98.         move.l  (a0)+,(a1)+
  99.         lea     Twilight_ArtIndex,a0
  100.         moveq   #0,d0
  101.         move.b  $FFFFFFF3,d0
  102.         lsl.b   #2,d0
  103.         adda.l  d0,a0
  104.         move.l  (a0),a0
  105.         vram    $0020
  106.         jsr     NemDec
  107.         addq.b  #1,$FFFFFFF3
  108.         cmpi.b  #8,$FFFFFFF3
  109.         bne.s   @rts
  110.         move.b  #0,$FFFFFFF3
  111. @rts    rts
  112.  
  113. Twilight_ArtIndex:
  114.         dc.l    Twilight_1Art
  115.         dc.l    Twilight_2Art
  116.         dc.l    Twilight_3Art
  117.         dc.l    Twilight_4Art
  118.         dc.l    Twilight_5Art
  119.         dc.l    Twilight_6Art
  120.         dc.l    Twilight_7Art
  121.         dc.l    Twilight_8Art
  122.        
  123. Twilight_PalIndex:
  124.         dc.l    Twilight_1Pal
  125.         dc.l    Twilight_2Pal
  126.         dc.l    Twilight_3Pal
  127.         dc.l    Twilight_4Pal
  128.         dc.l    Twilight_5Pal
  129.         dc.l    Twilight_6Pal
  130.         dc.l    Twilight_7Pal
  131.         dc.l    Twilight_8Pal
  132.  
  133. Twilight_1Art:
  134.         incbin  #Twilightlicious\1.artnem
  135.         even
  136. Twilight_2Art:
  137.         incbin  #Twilightlicious\2.artnem
  138.         even
  139. Twilight_3Art:
  140.         incbin  #Twilightlicious\3.artnem
  141.         even
  142. Twilight_4Art:
  143.         incbin  #Twilightlicious\4.artnem
  144.         even
  145. Twilight_5Art:
  146.         incbin  #Twilightlicious\5.artnem
  147.         even
  148. Twilight_6Art:
  149.         incbin  #Twilightlicious\6.artnem
  150.         even
  151. Twilight_7Art:
  152.         incbin  #Twilightlicious\7.artnem
  153.         even
  154. Twilight_8Art:
  155.         incbin  #Twilightlicious\8.artnem
  156.         even
  157. Twilight_BMap:
  158.         incbin  #Twilightlicious\Background.mapeni
  159.         even
  160. Twilight_1Pal:
  161.         incbin  #Twilightlicious\1.pal
  162.         even
  163. Twilight_2Pal:
  164.         incbin  #Twilightlicious\2.pal
  165.         even
  166. Twilight_3Pal:
  167.         incbin  #Twilightlicious\3.pal
  168.         even
  169. Twilight_4Pal:
  170.         incbin  #Twilightlicious\4.pal
  171.         even
  172. Twilight_5Pal:
  173.         incbin  #Twilightlicious\5.pal
  174.         even
  175. Twilight_6Pal:
  176.         incbin  #Twilightlicious\6.pal
  177.         even
  178. Twilight_7Pal:
  179.         incbin  #Twilightlicious\7.pal
  180.         even
  181. Twilight_8Pal:
  182.         incbin  #Twilightlicious\8.pal
  183.         even
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement