1
0
mirror of https://frontier.innolan.net/github/AmigaExamples.git synced 2025-11-22 08:45:43 +00:00

Double buffered scroll

This commit is contained in:
alpine9000
2016-04-02 08:49:47 +11:00
parent 5f19738975
commit 7a8613c6d6
3 changed files with 39 additions and 11 deletions

View File

@ -6,7 +6,7 @@ USERSTACK_ADDRESS=7fffc
BASE_ADDRESS=4000
# note: this must be high enough not to conflict with MFMbufE
NUM_COLORS=16
NUM_COLORS=2
BOOTBLOCK_ASM=alpine_bootblock.s
OBJS=out/init.o out/utils.o out/image.o out/blitchar.o out/cpu.o out/blit.o

View File

@ -55,15 +55,17 @@ BlitFillColor:
BlitScroll:
;; kills a0,d1,d2
;; a0 - bitplane
;; kills a0,a1,d1,d2
;; a0 - dest
;; a1 - source
;; d1 - height
;; d2 - ypos
;; movem.l d2-d5/a0,-(sp)
movem.l d1-d2/a0-a1,-(sp)
add.l d1,d2 ;point to end of data for descending mode
mulu.w #BITPLANE_WIDTH_BYTES*SCREEN_BIT_DEPTH,d2
add.l d2,a0
add.l d2,a1
WaitBlitter
@ -73,8 +75,8 @@ BlitScroll:
move.w #0,BLTBMOD(a6)
move.w #0,BLTCMOD(a6)
move.w #0,BLTDMOD(a6)
move.l a0,BLTBPTH(a6)
move.l a0,BLTCPTH(a6)
move.l a1,BLTBPTH(a6)
move.l a1,BLTCPTH(a6)
move.l a0,BLTDPTH(a6)
move.w #$0000,BLTAFWM(a6)
move.w #$ffff,BLTALWM(a6)
@ -84,6 +86,6 @@ BlitScroll:
ori.w #BITPLANE_WIDTH_WORDS,d1
move.w d1,BLTSIZE(a6)
;; movem.l (sp)+,d2-d5/a0
movem.l (sp)+,d1-d2/a0-a1
rts

View File

@ -5,7 +5,7 @@
xdef offscreen
xdef copperListBplPtr
Y_POS equ 100
Y_POS equ 8
byteMap:
dc.l Entry
@ -33,6 +33,12 @@ Entry:
move.w #SCREEN_HEIGHT,d1
move.w #0,d2 ; ypos
jsr BlitFillColor
move.l offscreen,a0
move.l #BACKGROUND_COLOR,d0
move.w #SCREEN_HEIGHT,d1
move.w #0,d2 ; ypos
jsr BlitFillColor
WaitBlitter
jsr Init ; enable the playfield
@ -40,7 +46,8 @@ Entry:
lea text,a3
MainLoop:
jsr WaitVerticalBlank
jsr InstallPalette
cmp.l #8,shiftcounter
bne .shift
@ -55,16 +62,35 @@ MainLoop:
move.l #BITPLANE_WIDTH-16,d0 ; xpos
move.l #Y_POS,d1 ; ypos
move.l onscreen,a0
move.l #Y_POS,d1 ; ypos
move.l #27-1,d3
.loopBlitChar8:
jsr BlitChar8
add.l #FONT_HEIGHT+1,d1
dbra d3,.loopBlitChar8
move.l #0,shiftcounter
.shift:
move.l onscreen,a0
move.l offscreen,a0 ; dest
move.l onscreen,a1 ; src
move.l #FONT_HEIGHT,d1
move.l #Y_POS,d2
move.l #27-1,d0
.blitScrollLoop:
jsr BlitScroll
add.l #FONT_HEIGHT+1,d2
dbra d0,.blitScrollLoop
add.l #1,shiftcounter
;; jsr GreyPalette
;; jsr GreyPalette
move.w #$500,COLOR00(a6)
jsr SwitchBuffers
bra MainLoop