Advertisement
VladislavSavvateev

PON3

Jul 26th, 2015
397
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Player:          
  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                    ; fade out
  6.         move    #$2700,sr                       ; disable interrupts
  7.  
  8. Player_SetupVDP:
  9.         lea     ($C00004).l,a6                  ; setup teh VDP
  10.         move.w  #$8004,(a6)                     ; mode register 1 setting
  11.         move.w  #$8230,(a6)                     ; map Plane A setting
  12.         move.w  #$8407,(a6)                     ; map Plane B setting
  13.         move.w  #$9001,(a6)                     ; plane size setting
  14.         move.w  #$9200,(a6)                     ; window vertical position
  15.         move.w  #$8B00,(a6)                     ; mode register 3 setting
  16.         move.w  #$8720,(a6)                     ; backdrop color setting
  17.         clr.b   ($FFFFF64E).w                   ; clear $FFFFF64E
  18.         jsr     ClearScreen                     ; clear the actual screen
  19.         lea     ($FFFFD000).w,a1                ; clear $FFD000-$FFD7FF
  20.         moveq   #0,d0                           ; d0 = 0
  21.         move.w  #$7FF,d1                        ; set repeat times to $7FF or d1 = $07FF
  22.  
  23. Player_ClrObjRam:
  24.         move.l  d0,(a1)+                        ; fill 4 bytes in object RAM with 0
  25.         dbf     d1,Player_ClrObjRam         ; repeat d1 = $7FF times
  26.            
  27. Player_Art:
  28.         lea $C00000,a6
  29.  
  30.         vram    0,4(a6)
  31.         moveq   #0,d0
  32.         rept 8
  33.         move.l  d0,(a6)
  34.         endr
  35.  
  36.         vram    $20,4(a6)
  37.         lea     (Art_Player).l,a0           ; load location of art of Player
  38.         jsr     NemDec                          ; decompress Nemesis art
  39.        
  40. Player_Mappings:
  41.         lea     ($FF0000).l,a1                  ; load location of screen mappings
  42.         lea     (Map_Player).l,a0           ; load location of art mappings
  43.         move.w  #1,d0                           ; d0 = 0
  44.         jsr     EniDec                          ; decompress Enigma mappings
  45.                    
  46. Player_ShowOnVDP:
  47.         lea     ($FF0000).l,a1                  ; load location of screen mappings
  48.         vram    $E000,d0                        ; load location of decompress art
  49.         moveq   #$3F,d1                         ; set cols
  50.         moveq   #$1F,d2                         ; set rows
  51.         jsr     ShowVDPGraphics                 ; call the displaying subroutine
  52.        
  53. Player_LoadForeground:
  54.         vram    $900,($C00004).l
  55.         lea     (Art_MTME).l,a0
  56.         jsr     NemDec
  57.        
  58.         lea     ($FF0000).l,a1
  59.         lea     (Map_MTME).l,a0
  60.         move.w  #$48,d0
  61.         jsr     EniDec
  62.        
  63.         vram    $C318,d0
  64.         moveq   #$F,d1
  65.         moveq   #$F,d2
  66.         jsr     ShowVDPGraphics
  67.  
  68. Player_Palette:
  69.         lea     (Pal_Player).l,a1               ; load location palette of art
  70.         lea     ($FFFFFB80).w,a2                ; load palette RAM
  71.         moveq   #7,d0                           ; set repeat time to $1F or d0 = $1F
  72. @loop:  move.l  (a1)+,(a2)+                     ; move 4 bytes of palette to palette RAM
  73.         dbf     d0,@loop                        ; repeat $1F times
  74.  
  75.         move.w  #$FDF0,($FFFFCC00).w
  76.         move.b  #$20,($FFFFFFF2).w
  77.         jsr     ProcessDMAQueue
  78.         jsr     QueueDMATransfer
  79.              
  80. Player_LoadObj:
  81.         jsr     Pal_FadeTo                      ; fade to
  82.        
  83.         moveq   #$FFFFFFAD,d0
  84.         jsr     PlaySample
  85.        
  86. ; ---------------------------------------------------------------------------------------------------------------------
  87.  
  88. Player_Loop:
  89.         move.b  #2,($FFFFF62A).w                ; set VBlank routine to #2
  90.         jsr     DelayProgram                    ; wait for execute VBlank routine
  91.         subq.w  #1,($FFFFF618).w
  92.         addq.w  #1,($FFFFCC02).w
  93.        
  94.         tst.b   ($FFFFFFF2).w
  95.         beq.s   @cont
  96.         moveq   #0,d0
  97.         move.b  ($FFFFFFF2).w,d0
  98.         add.w   d0,($FFFFCC00).w
  99.         subq.b  #1,($FFFFFFF2).w
  100.        
  101. @cont   jsr     ObjectsLoad                     ; run objects load program
  102.         jsr     BuildSprites                    ; run build sprites program
  103.         jmp     Player_Loop
  104.        
  105. Player_Next:
  106.         move.b  #4,($FFFFF600).W
  107.         rts                                     ; return to subroutine
  108. ; ===========================================================================
  109.  
  110.  
  111. Pal_Player:     incbin  '#Player\Player.pal'
  112.             even
  113. Art_Player:     incbin  '#Player\Player.artnem'
  114.             even
  115. Map_Player:     incbin  '#Player\Player.mapeni'
  116.             even
  117. Map_MTME:       incbin  '#Player\MTME.mapeni'
  118.             even
  119. Art_MTME:       incbin  '#Player\MTME.artnem'
  120.             even
  121. ; Art_Foreground:       incbin  '#Player\Foreground.artnem'
  122.             ; even
  123. ; Map_Foreground:       incbin  '#Player\Foreground.mapeni'
  124.             ; even
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement