Advertisement
VladislavSavvateev

Untitled

Oct 12th, 2015
279
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. MainGameLoop:
  2.         move    #$2700,sr           ; disable interrupts
  3.         lea     ($C00004).l,a6      ; setup teh VDP
  4.         move.w  #$8004,(a6)         ; mode register 1 setting
  5.         move.w  #$8174,(a6)         ; enable DISPLAY
  6.         move.w  #$8230,(a6)         ; map Plane A setting
  7.         move.w  #$8407,(a6)         ; map Plane B setting
  8.         move.w  #$9001,(a6)         ; plane size setting
  9.         move.w  #$9200,(a6)         ; window vertical position
  10.         move.w  #$8B07,(a6)         ; mode register 3 setting
  11.         move.w  #$8720,(a6)         ; backdrop color setting
  12.        
  13.         jsr     ClearScreen         ; clear screen
  14.        
  15.         LoadNem Face_Art, $0        ; load comperoface art
  16.         LoadPal Face_Pallet, $00, 16; load comperoface pallete
  17.         LoadNem Sonic, $A40         ; load Sonic art
  18.         LoadPal Sonic_Pallet, $20, 16; load Sonic Pallete
  19.         move.b  #1,$FFFFFFF0        ; set start link of mappings
  20.         LoadSpriteMap   Face_Mapping, 8; load all sprites mappings
  21.        
  22. ; Load art
  23. ;   LoadArt artoff      vram_art    paloff      palshft palclr  mapoff      enidec_param    vram_map    cols    rows
  24.     ; load background stuff
  25.     LoadArt Back_Art,   $0D00,      Back_Pallete,   $C0,    16, Back_Map,   (2<<13)+$68,    $E000,      $3F,    $1B
  26.     ; load foreground stuff
  27.     LoadArt Fore_Art,   $1180,      Fore_Pallete,   $F0,    16, Fore_Map,   (3<<13)+$8C,    $C000,      $27,    $1B
  28.        
  29.         add.w   #218,$FFFFF806      ; correct X-positions of sprites
  30.         add.w   #218,$FFFFF80E      ;
  31.         add.w   #218,$FFFFF816      ;
  32.         add.w   #218,$FFFFF81E      ;
  33.         add.w   #258,$FFFFF836      ;
  34.         add.w   #258,$FFFFF83E      ;
  35.         move.b  #1,$FFFFFFF4        ; set timer for drag sound (it's so silly, i'm fucking dude)
  36.         move.b  #1,$FFFFFFE0        ; set timer for change art (more silly!)
  37.        
  38.        
  39. @loop
  40.         move.b  #2,($FFFFF62A).w    ; set VBlank routine
  41.         jsr     DelayProgram        ; wait for VBlank
  42.         jsr     VC_ChangeArt        ; change art
  43.         jsr     VC_Action           ; actions!
  44.         jsr     VC_DragSound        ; drag sound (i can't make something smarter than it)
  45.         jsr     VC_Deform           ; FUCKING DEFORMATIONS!
  46.         jmp     @loop               ; THIS IS LOOPS, MOTHERFUCKER!
  47.        
  48. ; ===========================================================================
  49. VC_ChangeArt:
  50.         tst.b   $FFFFFFF5           ; action index is zero?
  51.         bne.s   @rts                ; if not, branch
  52.         subq.b  #1,$FFFFFFE0        ; subtract #1 from timer
  53.         beq.s   @cont               ; if timer is elapsed, branch
  54.         rts                         ; gtfo!
  55. @cont
  56.         move.b  #10,$FFFFFFE0       ; update timer
  57.         lea     VC_ArtIndex,a0      ; load array of art offsets
  58.         moveq   #0,d0               ; clear d0
  59.         move.b  $FFFFFFE1,d0        ; move number of frame
  60.         lsl.b   #2,d0               ; d0*4
  61.         adda.l  d0,a0               ; get offset of art
  62.         move.l  (a0),a0             ; get real offset (yeah)
  63.         vram    $A40                ; set VDP for write
  64.         move.w  #136,d0             ; set repeat time
  65. @loop:  move.l  (a0)+,$C00000       ; move piece of art in VDP
  66.         dbf     d0,@loop            ; repeat this!
  67.         addq.b  #1,$FFFFFFE1        ; add #1 to number of frame
  68.         cmpi.b  #4,$FFFFFFE1        ; it's last frame?
  69.         bne.s   @rts                ; if not, branch
  70.         move.b  #0,$FFFFFFE1        ; clear number of frame
  71. @rts    rts                         ; gtfo!
  72.  
  73. VC_ArtIndex:
  74.         dc.l    VC_1Art             ; $00
  75.         dc.l    VC_2Art             ; $04
  76.         dc.l    VC_3Art             ; $08
  77.         dc.l    VC_4Art             ; $0C
  78. ; ===========================================================================
  79. VC_Deform:
  80.         move.l  #3,d0               ; set repeat time
  81.         lea     $FFFFCC02,a0        ; load scroll buffer
  82. @loop:
  83.         move.l  #31,d1              ; set repeat time
  84. @right:
  85.         addq.w  #1,(a0)             ; shift one line to right for one pixel
  86.         lea     $4(a0),a0           ; load next line
  87.         dbf     d1,@right           ; repeat this!
  88.         move.l  #31,d1              ; set repeat time
  89. @left:
  90.         subq.w  #1,(a0)             ; shift one line to left for one pixel
  91.         lea     $4(a0),a0           ; load next line
  92.         dbf     d1,@left            ; repeat this!
  93.         dbf     d0,@loop            ; repeat this!
  94.         rts                         ; gtfo!
  95. ; ===========================================================================
  96. VC_DragSound:
  97.         tst.b   $FFFFFFF5           ; action index is zero?
  98.         bne.s   @rts                ; if not, branch
  99.         subq.b  #1,$FFFFFFF4        ; subtract #1 from timer
  100.         beq.s   @cont               ; if timer is elapsed, branch
  101. @rts    rts                         ; gtfo!
  102.  
  103. @cont   move.b  #10,$FFFFFFF4       ; update timer
  104.         move.b  #$A7,d0             ; load drag sound
  105.         jmp     PlaySound           ; play sound
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement