Versione con un po' di movimento, shiftando i bit si ottiene lo scrolling.
;------------------------------------------------------------
; Write texts into Sprites, flash and scroll added
; iAN CooG/HokutoForce
;------------------------------------------------------------
*= $801
byte 0
debug = 0
zp2 = $02 ;16bit multiplication hi byte
app = $03 ;sprite counter
cnt = $05 ;text counter
sprptr= $07f8
SPR0X = $d000
SPR0Y = $d001
SPRact = $d015
SPR1col = $D027
;------------------------------------------------------------
*= $801
word eop
word 7102
byte $9e,"2061",0
eop
word 0
;------------------------------------------------------------
start
ldx #$ff
ldy #[sprite1/$40]
setsprptr
tya
sta [sprptr-[sprite1/$40]],y
txa
sta [SPR1col-[sprite1/$40]],y
iny
cpy #[[sprite1/$40]+8]
bne setsprptr
;all sprites active
;lda #%11111111
;sta SPRact
;ldx #0
stx SPRact
inx
txa
fillspr
sta sprite1,x
sta sprite1+$100,x
inx
bne fillspr
;now place them all in a row
lda #$40
sta app
;ldx #$00
stx zp2
placespr
lda #$64
sta SPR0Y,x
lda app
sta SPR0X,x
clc
adc #$18
sta app
inx
inx
cpx #$10
bne placespr
;chargen active at $D000-$DFFF
sei
lda #$33
sta $01
lda #0
sta cnt
sta app
firstbyte = [sprite1+[[21-8]/2*3]]
;lda #<sprite1; already 0
lda #<firstbyte;centerd
sta destinl
;lda #>sprite1
lda #>firstbyte;centerd
sta destinh
lp1
lda #0
sta zp2
;get a char to "print"
ldy cnt
lda texts,y
; multiply A * 8 to get charset pointer
; @=$D800, a=$D808, A=$DA08 etc
asl
rol zp2
asl
rol zp2
asl
rol zp2
sta sourcel
lda zp2
clc ; now add charset base address
adc #>$d800 ; lower/upper charset in chargen
sta sourceh
ldy #0
ldx #0
trch
sourcel = * +1
sourceh = * +2
lda $ffff,y;
destinl = * +1
destinh = * +2
sta $ffff,x;
inx ;next row of the sprite
inx
inx
iny ;next row of the char
cpy #8
bne trch
.if debug == 1
jsr w8sp
.endif
inc destinl
inc app
lda app
cmp #3
bne noincdestpr
lda #0
sta app
lda destinl
clc
adc #$3d;$40-3
sta destinl
bcc noincdestpr
inc destinh
noincdestpr
inc cnt
lda cnt
cmp #[endtexts-texts]
bne lp1
lda #$37
sta $01
cli
col3
ldy #0
col2
ldx #$02
col4
bit $d011
bpl *-3
bit $d011
bmi *-3
dex
bne col4
lda coltable,y
;ldx #0
col1
sta SPR1col,x
inx
cpx #8
bne col1
jsr shiftsprites
iny
cpy #[endcol-coltable]
bne col2
ldx $dc01
inx
beq col3
rts
;------------------------------------------------------------
texts scrl "iAN CooG/HokutoForce'06 "
endtexts
coltable byte $0f,$0c,$0b,$00,$0b,$0c,$0f,$01
endcol
;------------------------------------------------------------
*= $0900
sprite1
;------------------------------------------------------------
*= sprite1 +$200
;------------------------------------------------------------
.if debug == 1
w8sp
jsr w8sp2
bne w8sp
w8sp1
jsr w8sp2
beq w8sp1
lda #0
sta $c6
w8sp2
ldx $01
stx xx+1
ldx #$37
stx $01
lda $dc00
and $dc01
and #$10
php
xx ldx #$00
stx $01
plp
rts
.endif
shiftsprites
; sta reta+1
; stx retx+1
; sty rety+1
M SET 0
REPEAT 8
lda firstbyte+[$40*7]+2 +[3*M]
sta $06
clc
rol
rol firstbyte+[$40*7]+1 +[3*M]
rol firstbyte+[$40*7]+0 +[3*M]
rol firstbyte+[$40*6]+2 +[3*M]
rol firstbyte+[$40*6]+1 +[3*M]
rol firstbyte+[$40*6]+0 +[3*M]
rol firstbyte+[$40*5]+2 +[3*M]
rol firstbyte+[$40*5]+1 +[3*M]
rol firstbyte+[$40*5]+0 +[3*M]
rol firstbyte+[$40*4]+2 +[3*M]
rol firstbyte+[$40*4]+1 +[3*M]
rol firstbyte+[$40*4]+0 +[3*M]
rol firstbyte+[$40*3]+2 +[3*M]
rol firstbyte+[$40*3]+1 +[3*M]
rol firstbyte+[$40*3]+0 +[3*M]
rol firstbyte+[$40*2]+2 +[3*M]
rol firstbyte+[$40*2]+1 +[3*M]
rol firstbyte+[$40*2]+0 +[3*M]
rol firstbyte+[$40*1]+2 +[3*M]
rol firstbyte+[$40*1]+1 +[3*M]
rol firstbyte+[$40*1]+0 +[3*M]
rol firstbyte+[$40*0]+2 +[3*M]
rol firstbyte+[$40*0]+1 +[3*M]
rol firstbyte+[$40*0]+0 +[3*M]
rol $06
lda $06
sta firstbyte+[$40*7]+2 +[3*M]
M SET M+1
repend
.if debug == 1
jsr w8sp
.endif
;reta lda #00
;retx ldx #00
;rety ldy #00
rts