Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; NOTES: This routine is loaded in VBlank, and all of the image data
- ; is uncompressed. $FFFFFB20 is the palette buffer.
- dma68kToVDP macro source,dest,length,type
- lea ($C00004).l,a5
- move.l #(($9400|((((length)>>1)&$FF00)>>8))<<16)|($9300|(((length)>>1)&$FF)),(a5)
- move.l #(($9600|((((source)>>1)&$FF00)>>8))<<16)|($9500|(((source)>>1)&$FF)),(a5)
- move.w #$9700|(((((source)>>1)&$FF0000)>>16)&$7F),(a5)
- move.w #((dest)&$3FFF)|((type&1)<<15)|$4000,(a5)
- move.w #$80|(((dest)&$C000)>>14)|((type&2)<<3),($FFFFF640).w
- move.w ($FFFFF640).w,(a5)
- endm
- ; values for the type argument
- VRAM = $0
- CRAM = $1
- VSRAM = $2
- Animation_Title:
- ;Subrutina para mostrar una imagen en Plano A, usando la segunda línea de paleta.
- ;D0 dato cargado de las definiciones / Temporal
- ;D1 dato cargado de las definiciones / Temporal
- ;D2 Registro temporal
- ;A0 address de definiciones de frame
- ;A1 dato cargado de las definiciones
- ;A2 address temporal
- ;$FFFF7E00 Numero de frame
- ;$FFFF7E02 Timming
- moveq #0,d0
- moveq #0,d1
- moveq #0,d2
- moveq #0,d3
- moveq #0,d4
- moveq #0,d5
- moveq #0,d6
- ; Detectar address del frame a mostrar
- tst.w ($FFFF7E02).l
- beq @_cn
- sub.w #1,($FFFF7E02).l
- rts
- @_cn: lea (@Anim_Table).l,a0
- move.w ($FFFF7E00).l,d0
- lsl.w #2,d0
- adda.w d0,a0
- movea.l (a0),a0
- ; Cargar frames a esperar y cual sigue
- move.b (a0)+,d0
- move.w d0,($FFFF7E02).l
- move.b (a0)+,d0
- move.w d0,($FFFF7E00).l
- ; Cargar Arte
- move.l (a0)+,($C00004).l
- movea.l (a0)+,a1
- move.l (a0)+,d0
- lsr.w #1,d0
- lea ($FF0000).l,a2
- @_l1: ;move.w (a1)+,($C00000).l
- move.w (a1)+,(a2)+
- dbf d0,@_l1
- dma68kToVDP $FFFF0000,$0C00,$3000,VRAM
- ; Cargar Mapas
- lea ($FF0000).l,a2
- movea.l (a0)+,a1
- move.l (a0)+,d0
- move.l (a0)+,d2
- @_l3: move.w (a1)+,d1
- add.w d2,d1
- move.w d1,(a2)+
- dbf d0, @_l3
- lea ($FF0000).l,a1
- move.l #$40000003,d0
- moveq #(((320)/8)-1),d1
- moveq #(((240)/8)-1),d2
- jsr ShowVDPGraphics2
- ; Cargar Paleta
- movea.l (a0)+,a1
- move.l (a0)+,d0
- lea ($FFFFFB20).l,a2
- @_l2: move.b (a1)+,(a2)+
- dbf d0,@_l2
- rts
- ; ^ Crear script de animación, que funcione con DMA
- ; Vamos que se pueden poner los tres frames en VRAM.
- @Anim_Table:
- dc.l @Frame1
- dc.l @Frame2
- @Frame1: dc.b $7,1 ;Frames a esperar, y cual sigue
- dc.l $4C000000, Art_MadTTL_1, (Art_MadTTL_1_End-Art_MadTTL_1) ;Ubicación y tamaño del arte
- dc.l Map_MadTTL_1, (Map_MadTTL_1_End-Map_MadTTL_1), $2060 ;Ubicación en VRAM (/$20) de arte y tamaño de maps
- dc.l Pal_MadTTL_1, 31 ;Ubicación en ROM y tamaño de paleta
- @Frame2: dc.b $7,0 ;Frames a esperar, y cual sigue
- dc.l $4C000000, Art_MadTTL_2, (Art_MadTTL_2_End-Art_MadTTL_2) ;Ubicación y tamaño del arte
- dc.l Map_MadTTL_2, (Map_MadTTL_2_End-Map_MadTTL_2), $2060 ;Ubicación en VRAM (/$20) de arte y tamaño de maps
- dc.l Pal_MadTTL_2, 31 ;Ubicación en ROM y tamaño de paleta
- ShowVDPGraphics2:
- lea ($FF0960).l,a6
- lea (a6),a5
- ; move.l #$800000,d4
- move.l #$80,d4
- loc_142C_2:
- ; move.l d0,4(a6)
- move.w d1,d3
- loc_1432_2:
- move.w (a1)+,(a6)+
- dbf d3,loc_1432_2
- ; add.l d4,d0
- adda.l d4,a5
- lea (a5),a6
- dbf d2,loc_142C_2
- dma68kToVDP $FFFF0960,$C000,$1000,VRAM
- rts
Add Comment
Please, Sign In to add comment