Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Vertical split-screen scrolling query

671 views
Skip to first unread message

Marc Walters

unread,
May 24, 1999, 3:00:00 AM5/24/99
to
I thought I'd better clarify my earlier post concerning methods to
cover the screen glitch when vertically scrolling a section of the
screen and hold the other stationary, ie adjusting the Y-FINE
register bits at $d011 for less than 25 character rows.
Many games use a similar technique so that a control or score
panel can be displayed.

I'd like to know what the best way to get rid of the glitching is,
and if my method of coding the actual effect is (more or less)
the right way to do it.

There are 3 ways of covering the glitch, which occurs in the
one-char (8 raster lines) high band that divides the scrolling
and non-scrolling sections and shows as a copy of the highest
stationary char row in the dividing band. A previous reply said
this was only when Y-FINE > original Y-FINE of the split ??? But
I'd like to keep the stationary section with a value of 3 (normal)
so the maximum number of lines are kept for display purposes.
1) Use a blank charset
2) Set Extended Colour and Bitmap modes (results in black band)
3) Overlay a line of solid 8pixel-high sprites

Shown here is the sourcecode for the routine. There's some rubbish
to wade through (experimentation) but the core routine has comments.
And I typed it by eye into vi from a C64 display, so there might
be a few typos.

Use spacebar to exit, Joy#2 fire to scroll.
And Cam, it's only a binary if someone strips the text and DLs it
to a C64. :-)

Marc
mwal...@bombadil.apana.org.au

;PAL-Assembler format sourcecode
;split screen verticle scroll
; timing is for PAL C64s, not NTSC

RIV0=46
RIV1=49+(12*8)
BD=$D020
SCR=1024

start =*
lda $d011
and #247
sta $d011
jsr RINIT
:
lda #0
MRL beq MRL ; loop to give max 2-char jitter
cli
brk
:
YP ldy #13 ;timing pause
YPL dey
bpl YPL
rts
:
YP1 ldy #7 ;timing pause
YP1L dey
bpl YP1L
rts
:
RINIT sei ; setup raster interrupt
lda #1
sta $d01a
sta $d019
lda $d011
and #$7f
sta $d011
ldx #<RI0 ; new IRQ vector
ldy #>RI0
lda #RIV0
JSR RIVSET0
lda #$7f ; CIA
sta $dc0d
lda $dc0d
cli
rts
:
RIVSET0 stx $0314 ; set IRQ values
sty $0315
sta $d012
rts
:
RIEXIT lda #1 ; exit IRQ
sta $d019
cli
jmp $ea81
:
RESR1 lda #RIV1
sec
sbc $fc
sta $fd
rts
:
RI0 sei
ldx #<RI1
ldy #>RI1
jsr RESR1
lda #RIV1-5
jsr RIVSET0
lda $d011
and #248
ora $fc
sta $d011
lda $dc01 ; check keyboard
cmp #$ef ; spacebar?
bne RX0 ; branch if no
lda #$ea ; else clear the NOPs for clean exit
sta MRL
lda #$ea
sta MRL+1
:
RX0 jmp RIEXIT
:
RI1 sei
ldx #<RI0
ldy #>RI0
lda #RIV0
jsr RIVSET0
lda $d011
and #248
ora #7
ldx #RIV1-3 ; force default Y-FINE
ldy #30 ; to see the glitch change the 30 to a 21
RLL cpx $d012
bne RLL
sty 53272 ;set "blank" charset for the 8-pixel split-band
inx
inx
inx
RL cpx $d012
bne RL
jsr YP
sta $d011
ldx #RIV1+5
RL0 cpx $d012
bne RL0
jsr YP1
lda #21
sta $d018 ;normal charset
jsr INCER
jmp RIEXIT
:
JOYER lda $dc00 ; JOY#2, FIRE to scroll
and #16 ; fire?
bne JRET ; branch if no
dec $fc
lda $fc
and #7
sta $fc
cmp #7
bne JRET
jsr SHUP ; hardscroll char data
:
JRET rts
:
TIM .byt 0
:
INCER dec TIM
bpl INCRET
LDA #0
sta TIM
jmp JOYER
:
INCRET rts
:
COL ldx #0 ; set charset and put up some screen data to scroll
CL lda #0
sta $3a00,x:sta $3b00,x:sta $3c00,x:sta $3d00,x:sta $3e00,x:sta $3f00,x
txa
sta $0400,x
dex
bne CL
stx $3fff
rts
:
SHUP inc BD ; hardscroll screen data and show processor load
ldx #39
SHUPL lda SCR,x:pha:lda SCR+40,x;sta SCR,x:lda SCR+80,x:sta SCR+40,x
lda SCR+120,x:STA SCR+80,x:LDA SCR+160,x:sta SCR+120,x
lda SCR+200,x:STA SCR+160,x
pla
sta SCR+200,x
dex
bpl SHUPL
dec BD
rts

0 new messages