Page 2 of 2
Re: What address does the new scroll screen have to describe please.
Posted: Wed Mar 13, 2024 8:57 pm
by funkheld
Thanks for the help.
I'm looking for the new address from the screen that scrolls in from the right (red rectangle).
I can't find the new address in the manual.
Thanks
greeting
Re: What address does the new scroll screen have to describe please.
Posted: Wed Mar 13, 2024 9:48 pm
by TomXP411
There is no "new address". Screen lines are 256 bytes wide and wrap to the next page.
If you're getting garbage over there from messing with the scroll registers, that is a glitch because you're out of bounds.
Re: What address does the new scroll screen have to describe please.
Posted: Wed Mar 13, 2024 10:10 pm
by hstubbs3
Is just garbage because nothing sets it, the screen is only 80 chars wide...
Funkheld, maybe this will make it make sense ??
can copy/paste this into the emulator in the browser even..
POKE $9F37,64:VPOKE 1,$B090,$44:VPOKE 1,$B092,$44:VPOKE 1,$B094,$44
VPOKE 1,$B096,$44:VPOKE 1,$B098,$44:VPOKE 1,$B09A,$44:VPOKE 1,$B09C,$44
VPOKE 1,$B09E,$44:VPOKE 1,$B0A0,6:VPOKE 1,$B0A1,$10:VPOKE 1,$B0A2,21
VPOKE 1,$B0A3,$10:VPOKE 1,$B0A4,14:VPOKE 1,$B0A5,$10:VPOKE 1,$B0A6,11
VPOKE 1,$B0A7,$10:VPOKE 1,$B0A8,8:VPOKE 1,$B0A9,$10:VPOKE 1,$B0AA,5
VPOKE 1,$B0AB,$10:VPOKE 1,$B0AC,12:VPOKE 1,$B0AD,$10:VPOKE 1,$B0AE,4
VPOKE 1,$B0AF,$10
cheers
Re: What address does the new scroll screen have to describe please.
Posted: Wed Mar 13, 2024 10:49 pm
by funkheld
hello thanks , is ok.
thanks for help.
Scrolling now works up to screen.
is $9F37 and $9F38
-------------------------------
for x in 0 to 255 step 2 {
cx16.vpoke(1,$b000+x,1) ; char
cx16.vpoke(1,$b000+x-1,1*16+2) ; color
}
-------------------------------
greeting
Re: What address does the new scroll screen have to describe please.
Posted: Thu Mar 14, 2024 4:20 pm
by hstubbs3
Funkheld
Maybe should have mentioned WHY I put so many VPOKE on each line -
if the screen scrolls, BASIC will update affected lines in the buffer... so altering the lines in the map data outside what it considers the screen should be 100% OK ..
altering characters "to the right" should be 100% OK - for 80 col mode, Its actually 128 characters wide table, so there's 48 characters "to the right"... but if you scroll the table so the normal screen GOES right ( by setting $9F38 to make the scroll word negative overall ), then the the end of the line wraps to in front of it, on the same line.. .. it makes sense if you try to put different info on each line and scroll back and forth...
If you update Layer1 config register to use wider table ->
$9F34 L1_CONFIG Map Height Map Width T256C Bitmap Mode Color Depth
'Map Width', 'Map Height' specify the dimensions of the tile map:
Value Map width / height
0 32 tiles
1 64 tiles
2 128 tiles
3 256 tiles
or specify the tile width to be 16 rather than 8 (you would have to create your own tileset to display characters though.. ) ->
$9F36 L1_TILEBASE Tile Base Address (16:11) Tile Height Tile Width
'Tile Width', 'Tile Height' specify the dimensions of a single tile:
Value Tile width / height
0 8 pixels
1 16 pixels
you could create in VRAM like a level map for Super Mario bros or something with up to 16*256=4,906 pixels worth of tiles in X or Y..
but, one would have to recall that a 16x16 1bit tile is 32 bytes -> 256 such tiles would eat 8K of VRAM ... Actually, I would probably go for at least 2bit tiles, use 16K to 32K of the VRAM to have 256-512 different 16x16 tiles to make a level with... but that really depends how you envision your project as a whole..
And tile map 256 tiles wide would require 512B _per row_ - meaning a 256x64 tile map ( 4096x1024 pixels using 16x16 tile size) would use up 32K of the VRAM
Also ... You wouldn't do this from the prompt... but within your program so that you weren't fighting the kernal scrolling / overwriting code !
Have a happy.
Re: What address does the new scroll screen have to describe please.
Posted: Thu Mar 14, 2024 4:38 pm
by funkheld
I don't play with Basic but with Prog8
please load this scroll3.prg.
With the r/t keys you can scroll the screen infinitely right and left. As a demo, I just wrote the char "A" in the first row. You can completely delete the area and insert an image from chars into the new screen area.
this prog8 is super fast.
You can also copy data from a RAM-bank to the VRAM.
the scroll3.prg only has 300 bytes.
I like to play things like this to see how the x16 works.
thanks
greeting
Code: Select all
%import textio
%zeropage basicsafe
%option no_sysinit
%import syslib
%import math
main {
uword x
ubyte y
ubyte z
ubyte u
uword wert
sub start() {
for x in 0 to 255 step 2 {
cx16.vpoke(1,$b000+x,1)
cx16.vpoke(1,$b000+x-1,1*16+2)
}
waitkey:
sys.waitvsync()
ubyte key=cbm.GETIN()
keypress(key)
goto waitkey
}
sub keypress(ubyte key) {
when key {
'r' -> sl()
't' -> sr()
}
}
sub sr() {
z=z-1
if z==0 {
u=u-1
poke($9F38,u)
z=255
}
poke($9F37,z)
}
sub sl() {
z=z+1
if z==0 {
u=u+1
poke($9F38,u)
}
poke($9F37,z)
}
}