crazy scrolling

This commit is contained in:
alpine9000
2016-04-02 15:29:40 +11:00
parent 9be405ce73
commit 9cc2cc73c0
2 changed files with 181 additions and 99 deletions
+17 -3
View File
@@ -55,13 +55,14 @@ BlitFillColor:
BlitScroll: BlitScroll:
;; kills a0,a1,d1,d2 ;; kills a0,a1,d0,d1,d2
;; a0 - dest ;; a0 - dest
;; a1 - source ;; a1 - source
;; d0 - shift pixels
;; d1 - height ;; d1 - height
;; d2 - ypos ;; d2 - ypos
movem.l d1-d2/a0-a1,-(sp) movem.l d0-d2/a0-a1,-(sp)
add.l d1,d2 ;point to end of data for descending mode add.l d1,d2 ;point to end of data for descending mode
mulu.w #BITPLANE_WIDTH_BYTES*SCREEN_BIT_DEPTH,d2 mulu.w #BITPLANE_WIDTH_BYTES*SCREEN_BIT_DEPTH,d2
add.l d2,a0 add.l d2,a0
@@ -69,8 +70,21 @@ BlitScroll:
WaitBlitter WaitBlitter
if 0
move.w #$1002,BLTCON1(a6) move.w #$1002,BLTCON1(a6)
move.w #$1000|BLIT_SRCB|BLIT_SRCC|BLIT_DEST|$ca,BLTCON0(a6) move.w #$1000|BLIT_SRCB|BLIT_SRCC|BLIT_DEST|$ca,BLTCON0(a6)
else
lsl.w #6,d0
lsl.w #6,d0
move.w #$2,d3
or.w d0,d3
move.w d3,BLTCON1(a6)
move.w #BLIT_SRCB|BLIT_SRCC|BLIT_DEST|$ca,d3
or.w d0,d3
move.w d3,BLTCON0(a6)
endif
move.w #$ffff,BLTADAT(a6); preload source mask so only BLTA?WM mask is used move.w #$ffff,BLTADAT(a6); preload source mask so only BLTA?WM mask is used
move.w #0,BLTBMOD(a6) move.w #0,BLTBMOD(a6)
move.w #0,BLTCMOD(a6) move.w #0,BLTCMOD(a6)
@@ -86,6 +100,6 @@ BlitScroll:
ori.w #BITPLANE_WIDTH_WORDS,d1 ori.w #BITPLANE_WIDTH_WORDS,d1
move.w d1,BLTSIZE(a6) move.w d1,BLTSIZE(a6)
movem.l (sp)+,d1-d2/a0-a1 movem.l (sp)+,d0-d2/a0-a1
rts rts
+164 -96
View File
@@ -48,50 +48,58 @@ MainLoop:
jsr WaitVerticalBlank jsr WaitVerticalBlank
jsr InstallPalette jsr InstallPalette
cmp.l #8,shiftcounter
bne .shift
.drawtext:
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 #NUM_LINES-1,d3
.loopBlitChar8:
move.l d3,d4
bsr GetNextChar
jsr BlitChar8
add.l #FONT_HEIGHT+1,d1
dbra d3,.loopBlitChar8
move.l #0,shiftcounter
.shift:
move.l offscreen,a0 ; dest
move.l onscreen,a1 ; src
move.l #FONT_HEIGHT,d1
move.l #Y_POS,d2
move.l #NUM_LINES-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) ;; move.w #$500,COLOR00(a6)
jsr SwitchBuffers jsr SwitchBuffers
move.l #NUM_LINES-1,d3
.loop:
bsr UpdateLine
dbra d3,.loop
bra MainLoop bra MainLoop
UpdateLine:
;; d3 - line number
movem.l d0-a6,-(sp)
lea.l textlut,a2
move.l d3,d4
mulu.w #16,d4
add.l d4,a2 ; index into LUT
cmp.l #8,8(a2)
bne .shift
.drawtext:
move.l #BITPLANE_WIDTH-16,d0 ; xpos
move.l onscreen,a0
move.l #FONT_HEIGHT+1,d1 ; ypos
move.l d3,d4
mulu.w d3,d1
bsr GetNextChar
jsr BlitChar8
move.l #0,8(a2)
.shift:
move.l offscreen,a0 ; dest
move.l onscreen,a1 ; src
move.l #FONT_HEIGHT,d1 ; height
move.l #FONT_HEIGHT+1,d2 ; ypos
mulu.w d3,d2
Test:
;; move.l #1,d0
move.l 12(a2),d0
jsr BlitScroll
;; add.l #1,8(a2)
add.l d0,8(a2)
movem.l (sp)+,d0-a6
rts
charbuffer: charbuffer:
dc.b 0 dc.b 0
dc.b 0 dc.b 0
@@ -100,67 +108,127 @@ shiftcounter:
dc.l 8 dc.l 8
textlut: textlut:
dc.l text1+1 dc.l text1
dc.l text2+2 dc.l text2
dc.l text3+3 dc.l 8
dc.l text4+4 dc.l 1
dc.l text5+5 dc.l text3
dc.l text4+6 dc.l text4
dc.l text3+7 dc.l 8
dc.l text2+8 dc.l 2
dc.l text1+9 dc.l text5
dc.l text2+10 dc.l text4
dc.l text3+11 dc.l 8
dc.l text4+12 dc.l 4
dc.l text1+13 dc.l text3
dc.l text3+14 dc.l text2
dc.l text5+15 dc.l 8
dc.l text1+16 dc.l 8
dc.l text1+17 dc.l text1
dc.l text2+16 dc.l text2
dc.l text3+15 dc.l 8
dc.l text1+14 dc.l 4
dc.l text5+12 dc.l text3
dc.l text5+11 dc.l text4
dc.l text4+10 dc.l 8
dc.l text4+9 dc.l 2
dc.l text2+8 dc.l text1
dc.l text4+7 dc.l text3
dc.l text1+6 dc.l 8
dc.l text2+5 dc.l 1
dc.l text4+4 dc.l text5
dc.l text5+3 dc.l text1
dc.l text2+2 dc.l 8
dc.l text3+1 dc.l 2
dc.l text1+2 dc.l text1
dc.l text3+3 dc.l text2
dc.l text3+4 dc.l 8
dc.l text4+5 dc.l 4
dc.l text5+6 dc.l text3
dc.l text2+7 dc.l text1
dc.l text3+8 dc.l 8
dc.l text3+9 dc.l 8
dc.l text1+10 dc.l text5
dc.l text4+11 dc.l text5
dc.l text4+12 dc.l 8
dc.l text3+13 dc.l 4
dc.l text2+14 dc.l text4
dc.l text3+15 dc.l text4
dc.l text4+16 dc.l 8
dc.l text5+15 dc.l 2
dc.l text1+14 dc.l text2
dc.l text2+13 dc.l text4
dc.l text3+12 dc.l 8
dc.l text4+11 dc.l 1
dc.l text3+10 dc.l text1
dc.l text2+9 dc.l text2
dc.l text1+8 dc.l 8
dc.l text2+7 dc.l 2
dc.l text3+6 dc.l text4
dc.l text4+5 dc.l text5
dc.l text4+4 dc.l 8
dc.l text5+3 dc.l 4
dc.l text2
dc.l text3
dc.l 8
dc.l 8
dc.l text1
dc.l text3
dc.l 8
dc.l 4
dc.l text3
dc.l text4
dc.l 8
dc.l 2
dc.l text5
dc.l text2
dc.l 8
dc.l 1
dc.l text3
dc.l text3
dc.l 8
dc.l 2
dc.l text1
dc.l text4
dc.l 8
dc.l 4
dc.l text4
dc.l text3
dc.l 8
dc.l 8
dc.l text2
dc.l text3
dc.l 8
dc.l 4
dc.l text4
dc.l text5
dc.l 8
dc.l 2
dc.l text1
dc.l text2
dc.l 8
dc.l 1
dc.l text3
dc.l text4
dc.l 8
dc.l 2
dc.l text3
dc.l text2
dc.l 8
dc.l 4
dc.l text1
dc.l text2
dc.l 8
dc.l 8
dc.l text3
dc.l text4
dc.l 8
dc.l 4
dc.l text4
dc.l text5
dc.l 8
dc.l 2
text1: text1:
dc.b "In this chapter, you will learn how to use the Amiga's graphics coprocessor (or Copper) and its simple instruction set to organize mid-screen register value modifications and pointer register set-up during the vertical blanking interval. The chapter shows how to organize Copperinstructions into Copper lists, how to use Copper lists in interlacedmode, and how to use the Copper with the blitter. The Copper is discussed in this chapter in a general fashion. The chapters that deal withplayfields, sprites, audio, and the blitter contain more specificsuggestions for using the Copper." dc.b "In this chapter, you will learn how to use the Amiga's graphics coprocessor (or Copper) and its simple instruction set to organize mid-screen register value modifications and pointer register set-up during the vertical blanking interval. The chapter shows how to organize Copperinstructions into Copper lists, how to use Copper lists in interlacedmode, and how to use the Copper with the blitter. The Copper is discussed in this chapter in a general fashion. The chapters that deal withplayfields, sprites, audio, and the blitter contain more specificsuggestions for using the Copper."
@@ -185,7 +253,7 @@ endText:
GetNextChar: GetNextChar:
movem.l a2-a3,-(sp) movem.l a2-a3,-(sp)
lea.l textlut,a2 lea.l textlut,a2
mulu.w #8,d4 ; mulu.w #16,d4 ;
add.l d4,a2 ; index into LUT add.l d4,a2 ; index into LUT
move.l (a2),a3 ; address of next char move.l (a2),a3 ; address of next char
cmp.b #0,(a3) cmp.b #0,(a3)