Ways of scrolling and question for character memory

Basic and Machine Language

Moderator: Moderators

Post Reply
derekwinters
Vic 20 Newbie
Posts: 10
Joined: Fri Apr 09, 2021 4:35 am

Ways of scrolling and question for character memory

Post by derekwinters »

Hello all,

I was looking at the scrolling in the exccelent example here : -

https://www.youtube.com/watch?v=CgCHzrjT3uE

I don't know if this is too open a question for the forum, but is the scrolling achieved using tricks with $9001 / rasters, or is it using a 512 character map from $1000 and writing the game data (background / sprites) into the character map memory each IRQ/loop?

If the latter (512 character map), how does that "mode" work as I have tried putting the character map (for Vic 20 16k done with CBM PRG Studio) at $1000 as I read in "Mapping the Vic" but then two things occured to me : -

1) Where would the screen memory go (or two screens if double buffering) if all $1000 to $1fff is occupied by character map data

2) How do you specify in the screen memory the char values $100 to $1ff

Advance apologies if the above seems a silly question, I am trying to learn / work out how it works, so forgive me if i've got completely the wrong idea from the outset.

I noticed in the above link ( and also in the same persons game https://www.youtube.com/watch?v=gEzOomjmzU4 ) they appear to be hi-res / no colours (?)

Thank you in advance also if anyone can help out at all.

D
User avatar
Mike
Herr VC
Posts: 4841
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Re: Ways of scrolling and question for character memory

Post by Mike »

Hi, Derek,
derekwinters wrote:[...] is the scrolling achieved using tricks with $9001 / rasters
This. (Presumably) in addition with special values in $9000 to access odd raster positions - the YPOS register alone would only let you position the screen window on even raster positions.
1) Where would the screen memory go (or two screens if double buffering) if all $1000 to $1fff is occupied by character map data
Text screen and (alterable) character data have to reside in the internal RAM, $0000..$03FF or $1000..$1FFF. Take your pick. No one forces you to use a full character set. In some cases, text and character RAM overlap and character definitions 'lost' due to that are accepted.
2) How do you specify in the screen memory the char values $100 to $1ff
More likely you'd change the value of the character base in the register $9005 to access a 'second' character set. If you actually referred to double-height characters - there, one char already has 16 bytes of character definition, so one full character set spans 4 KB.
I noticed in the above link (and also in the same persons game [...]) they appear to be hi-res / no colours(?)
It's not quite clear to me what you mean with "they" here. However, SSSA / C&O use high-res / multi-colour, respectively, in their main playfield window and neither of the two scroll the colour RAM along.

Greetings,

Michael
aeb
Vic 20 Amateur
Posts: 68
Joined: Sat Jun 19, 2004 2:06 pm

Re: Ways of scrolling and question for character memory

Post by aeb »

Mike wrote: Fri Apr 09, 2021 9:11 am
derekwinters wrote:[...] is the scrolling achieved using tricks with $9001 / rasters
This. (Presumably) in addition with special values in $9000 to access odd raster positions - the YPOS register alone would only let you position the screen window on even raster positions.
This is how I scrolled to odd raster positions in my 2004 Minigame Competition 1K entry Vuokatti. No $9000 needed, just some waits and timing :)

Code: Select all

;-----  set screen y-position at one pixel accuracy (a = $00-$0f)

smooth:
        clc
        adc     #$02                    ; screen y-position $02-$11

        lsr
        tay
        bcs     _o1e
        jsr     _o1e
        dec     $9001
        rts
_o1e
        sty     $9001
        dey
_wsx
        cpy     $9004
        bne     _wsx

        ldy     #$0b                    ; delay for vice compatibility
_wstt
        dey
        bne     _wstt
        rts
IIRC the extra delay "for vice compatibility" was required by VICE xvic emulator back in 2004. VICE is probably much more accurate now. Also, Vuokatti was PAL only due to large screen size and because I only had a PAL VIC. Timing on NTSC machines may be different.

1K Vuokatti download with source:
https://www.dropbox.com/sh/4wxd067ed1fc ... AQD-a?dl=0
derekwinters
Vic 20 Newbie
Posts: 10
Joined: Fri Apr 09, 2021 4:35 am

Re: Ways of scrolling and question for character memory

Post by derekwinters »

Hi,

Thanks to all for your responses - appreciated.

Regarding the ski game, thanks for that, I will have a look at the suggestd source.

D
User avatar
huffelduff
Vic 20 Hobbyist
Posts: 118
Joined: Sat Sep 05, 2020 9:14 am

Re: Ways of scrolling and question for character memory

Post by huffelduff »

Hi aeb,

I was wondering who wrote that game.
That is some real voodoo coding there.
I'm going to study it very carefully.

Thank you.
Post Reply