|
Post by Pyrofer on Apr 11, 2016 19:12:57 GMT
It's possible to stop the flicker. You need a decent interrupt loop setup linked to vblank to time when to do the reset of the smooth scroll register. I have a whole screen of colour bitmap scrolling down the screen and depending on when I start the scrolling I get none, some or all flicker. When there is none it looks lovely. I need to experiment with exactly what the timing needs to be in relation to vblank so I can consistently get no flicker.
I think I am confident it's possible though. BTW, whole screen scrolling in colour bitmap.
|
|
|
Post by hydrophilic on Apr 14, 2016 8:23:05 GMT
Cool... weather text or bitmap, if you can publish results of WHEN to update scroll-register to avoid flicker, the entire C128 community will thank you (at least me).
In other words, I agree the problem is when... EXACTLY... you need to update the register(s)...
I also agree it will (probably) be a PITA because there is no hardware interrupt, or even a simple raster register... you will have to laboriously track the V-Blank bit (simple, but time consuming), or else sync a CIA timer with the VDC (more work to setup, but less CPU resources). I think most of know that Risen From Oblivion uses CIA sync'd to VDC (so a good place to start)...
|
|
|
Post by remark on Apr 17, 2016 17:59:20 GMT
I played with the colorscroll v2.5 program a little. The 'flicker' only occurs if you put the text in line 1 of the screen, in lines 2-25 the scroll is smooth as expected. My guess is there is too little time between vsync and display of the first line, to both copy the screen data and color data. (16k PAL VDC)
EDIT: hm, if you display 2 lines of text, the first line is flickering, the second is not. So probably a 'hardware' bug of the VDC?
|
|
|
Post by Pyrofer on Apr 19, 2016 10:33:06 GMT
Tokra has proven that we are indeed all idiots in some way. His smooth scrolling test demo indeed works flawlessly in VICE (Not tried on real hardware yet).
I am going to have to go through his code and mine line by line working out where the differences come. I really wan't to find the reason that mine flickers as honestly, I can't see it.
I assume that this scrolling text demo flickers for the exact same reason as my vertical scroller does so when we lock down the reason everybody who wants to play with the VDC can benefit from it.
|
|
|
Post by remark on Apr 11, 2017 19:12:18 GMT
Sorry to stir this thread up, but I think have a solution against the flickering. You need to start the copy when smooth=1 instead of 0. VDCADR = $d600 VDCDAT = $D601 TxtPtr = $a9 ClrPtr = $96 smooth = $ab color = $a8
defm poke lda #/2 sta /1 endm
defm WaitVDC bit $d600 bpl *-3 endm
*=$1c01 Byte $11,$1c,$de,$07,$de,$9c,$3a byte $fe,$25,$3a,$9e,$37,$31,$38,$37 bytes $00*3 ;2014 graphicclr:fast:sys7187 in basic Start Poke smooth, $07 poke color, $08 ldx #$18 jsr VdcPeekReg ora #$80 ;set copy bit sta VDCDAT jsr zp0 ;set up pointers
MainLoop lda #$20 ;bit 5 we checking bit vdcadr ;wait for vblank beq *-3
sei ;don't want to be interupted jsr scroll ldx #$19 jsr VDCPEEKREG and #%11110000 ora smooth sta vdcdat ;scroll left cli ;done so release interupts lda #$20
bit vdcadr bne *-3 ;wait for the start of the frame jmp MAINLOOP scroll lda smooth sec sbc #$01 ;use 1 only (need different loop to slow down) ; bcc MoveText cmp #1 beq MoveText cmp #0 bne scend lda #7 scend sta smooth rts
;MoveText lda #$07 ; sta smooth MoveText ldy #$00 lda (txtptr),y cmp #$ff bne @nopeff jsr zp0 lda (txtptr),y @nopeff cmp #$fe bne @nopefe lda (clrptr),y sta color jsr incclrptr jsr inctxtptr lda (txtptr),y @nopefe jsr inctxtptr pha ldy #$20 ;reg pair lda #$00 ;high byte ldx #$01 ;low byte jsr vdcwordreg ldy #$12 lda #$00 ldx #$00 jsr vdcwordreg ldx #$1e lda #$4f ;copy 79 bytes jsr VdcPokeReg pla ldx #$1f jsr VDCPOKEREG ldy #$20 ;color source lda #$08 ldx #$01 jsr vdcwordreg ldy #$12 ;color destination lda #$08 ldx #$00 jsr vdcwordreg ldx #$1e ;copy 79 bytes lda #$4f jsr vdcpokereg ldx #$1f lda color jsr vdcpokereg rts
zp0 lda #<ScrollText sta TxtPtr lda #>Scrolltext sta TxtPtr+1 lda #<Colordata sta CLRPTR lda #>ColorData sta CLRPTR+1 rts
VdcPokeReg stx vdcadr waitvdc sta vdcdat rts
VdcPeekREG stx vdcadr ;.x reg and value returned in .a waitvdc lda vdcdat rts
VDCWordreg sty vdcadr ;a/x is high/low value y is high byte of reg pair waitvdc sta vdcdat iny sty vdcadr stx vdcdat rts
IncTxtPtr inc TXTPTR bne @end inc TXTPTR+1 @end rts
IncClrPtr inc clrptr bne @end inc clrptr+1 @end rts
ScrollText byte $fe text 'this is a test of ' byte $fe text 'the ' byte $fe text 'scrolling demo... ' byte $fe text 'flash ' byte $fe text 'underline ' byte $fe text 'reverse ' byte $fe text 'charSET ' byte $ff
ColorData byte $0f,$0d,$0c,$1c,$2c,$4a,$86 I changed and added some lines in the scroll and movetext subroutines. This will get rid of the flickering in the first line. colscroll25a.prg (351 B)
|
|
|
Post by tokra on Apr 24, 2017 16:21:48 GMT
Very nice! So by combining both horizontal and vertical scrolling you could easily move around the screen in all directions, which might come in handy for some games.
|
|
|
Post by Pyrofer on Apr 24, 2017 16:50:31 GMT
I did actually get vertical smooth scrolling working. I still haven't managed to do the same with Horizontal however. I might get back into trying to make a game with scrolling colour bitmap mode
|
|