You can scroll the screen the textmode : 128 bytes right and left and 60 bytes up and down.
1 ascii has 2 bytes
Here you can scroll infinitely to the right and left.
U will not be minus because U is a byte in prog8 .
the program with prog8 works.
That's why my question was with byte, which changes the value at 255.
greeting
Code: Select all
%import graphics
%import math
%import textio
%import palette
%import syslib
%import diskio
main {
ubyte background_color
ubyte radius
ubyte color
ubyte z
ubyte u
ubyte x
ubyte y
sub start() {
cx16.screen_mode(128, false)
graphics.enable_bitmap_mode()
void diskio.vload_raw("funkpal.pal", 1, $fa00 )
void diskio.vload_raw("test.raw", 0, 0)
draw_circles()
txt.plot(6,10)
txt.print("schiebe screen")
z=40
poke($9F37,z)
waitkey:
sys.waitvsync()
ubyte key=cbm.GETIN()
keypress(key)
goto waitkey
}
sub keypress(ubyte key) {
when key {
'r' -> sl()
't' -> sr()
}
}
sub draw_circles() {
x=100
y=100
radius=30
color = 7
graphics.colors(color, 0)
graphics.disc(x, y , radius)
x=200
y=100
radius=30
color = 189
graphics.colors(color, 0)
graphics.disc(x, y , radius)
}
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)
}
}