Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- MainGameLoop:
- move #$2700,sr ; disable interrupts
- lea ($C00004).l,a6 ; setup teh VDP
- move.w #$8004,(a6) ; mode register 1 setting
- move.w #$8174,(a6) ; enable DISPLAY
- move.w #$8230,(a6) ; map Plane A setting
- move.w #$8407,(a6) ; map Plane B setting
- move.w #$9001,(a6) ; plane size setting
- move.w #$9200,(a6) ; window vertical position
- move.w #$8B07,(a6) ; mode register 3 setting
- move.w #$8720,(a6) ; backdrop color setting
- jsr ClearScreen ; clear screen
- LoadNem Face_Art, $0 ; load comperoface art
- LoadPal Face_Pallet, $00, 16; load comperoface pallete
- LoadNem Sonic, $A40 ; load Sonic art
- LoadPal Sonic_Pallet, $20, 16; load Sonic Pallete
- move.b #1,$FFFFFFF0 ; set start link of mappings
- LoadSpriteMap Face_Mapping, 8; load all sprites mappings
- ; Load art
- ; LoadArt artoff vram_art paloff palshft palclr mapoff enidec_param vram_map cols rows
- ; load background stuff
- LoadArt Back_Art, $0D00, Back_Pallete, $C0, 16, Back_Map, (2<<13)+$68, $E000, $3F, $1B
- ; load foreground stuff
- LoadArt Fore_Art, $1180, Fore_Pallete, $F0, 16, Fore_Map, (3<<13)+$8C, $C000, $27, $1B
- add.w #218,$FFFFF806 ; correct X-positions of sprites
- add.w #218,$FFFFF80E ;
- add.w #218,$FFFFF816 ;
- add.w #218,$FFFFF81E ;
- add.w #258,$FFFFF836 ;
- add.w #258,$FFFFF83E ;
- move.b #1,$FFFFFFF4 ; set timer for drag sound (it's so silly, i'm fucking dude)
- move.b #1,$FFFFFFE0 ; set timer for change art (more silly!)
- @loop
- move.b #2,($FFFFF62A).w ; set VBlank routine
- jsr DelayProgram ; wait for VBlank
- jsr VC_ChangeArt ; change art
- jsr VC_Action ; actions!
- jsr VC_DragSound ; drag sound (i can't make something smarter than it)
- jsr VC_Deform ; FUCKING DEFORMATIONS!
- jmp @loop ; THIS IS LOOPS, MOTHERFUCKER!
- ; ===========================================================================
- VC_ChangeArt:
- tst.b $FFFFFFF5 ; action index is zero?
- bne.s @rts ; if not, branch
- subq.b #1,$FFFFFFE0 ; subtract #1 from timer
- beq.s @cont ; if timer is elapsed, branch
- rts ; gtfo!
- @cont
- move.b #10,$FFFFFFE0 ; update timer
- lea VC_ArtIndex,a0 ; load array of art offsets
- moveq #0,d0 ; clear d0
- move.b $FFFFFFE1,d0 ; move number of frame
- lsl.b #2,d0 ; d0*4
- adda.l d0,a0 ; get offset of art
- move.l (a0),a0 ; get real offset (yeah)
- vram $A40 ; set VDP for write
- move.w #136,d0 ; set repeat time
- @loop: move.l (a0)+,$C00000 ; move piece of art in VDP
- dbf d0,@loop ; repeat this!
- addq.b #1,$FFFFFFE1 ; add #1 to number of frame
- cmpi.b #4,$FFFFFFE1 ; it's last frame?
- bne.s @rts ; if not, branch
- move.b #0,$FFFFFFE1 ; clear number of frame
- @rts rts ; gtfo!
- VC_ArtIndex:
- dc.l VC_1Art ; $00
- dc.l VC_2Art ; $04
- dc.l VC_3Art ; $08
- dc.l VC_4Art ; $0C
- ; ===========================================================================
- VC_Deform:
- move.l #3,d0 ; set repeat time
- lea $FFFFCC02,a0 ; load scroll buffer
- @loop:
- move.l #31,d1 ; set repeat time
- @right:
- addq.w #1,(a0) ; shift one line to right for one pixel
- lea $4(a0),a0 ; load next line
- dbf d1,@right ; repeat this!
- move.l #31,d1 ; set repeat time
- @left:
- subq.w #1,(a0) ; shift one line to left for one pixel
- lea $4(a0),a0 ; load next line
- dbf d1,@left ; repeat this!
- dbf d0,@loop ; repeat this!
- rts ; gtfo!
- ; ===========================================================================
- VC_DragSound:
- tst.b $FFFFFFF5 ; action index is zero?
- bne.s @rts ; if not, branch
- subq.b #1,$FFFFFFF4 ; subtract #1 from timer
- beq.s @cont ; if timer is elapsed, branch
- @rts rts ; gtfo!
- @cont move.b #10,$FFFFFFF4 ; update timer
- move.b #$A7,d0 ; load drag sound
- jmp PlaySound ; play sound
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement