I did not even tackle the high-level commands from the trse.
a simple push program with the keys is 603 bytes in asm-code.
buttons: W / S / A / D for controlling and R / F for changing the color of the charsprite.
start : sys8192
I like to program with trse and VIV20.
you get to know the vic20 correctly with clear commands.
greeting
Code: Select all
program schiebechar;
var
charset : array[16] of byte = ( 24,24,60,126,255,24,36,66,255,129,129,129,129,129,129,255 );
a,b,f,x,y,p : byte;
zpcharz: pointer;
zpscr: pointer;
zpcol: pointer;
procedure pause();
begin
for a:=0 to 50 do
begin
wait(100);
end;
end;
begin
ClearScreen(white, screen_col_loc);
zpcharz:=5120;
zpscr:=4096;
zpcol:=37888;
poke(^37139,0,0);
poke(^37154,0,127);
poke(^36869,0,205);
poke(^36867,0,151);
zpcharz:=5120;
for b:=0 to 16 do
begin
zpcharz[b]:=charset[b];
end;
x:=11;
y:=5;
p:=y*22+x;
f:=5;
zpscr[p]:=0;
zpcol[p]:=f;
while (true) do
begin
waitforraster(0);
if peek(^197,0)= 18 then
begin
pause();
x:=x+1;
if (x>21) then x:=21;
p:=y*22+x;
zpscr[p]:=0;
zpcol[p]:=f;
zpscr[p-1]:=128;
end;
if peek(^197,0)= 17 then
begin
pause();
x:=x-1;
if (x=255) then x:=0;
p:=y*22+x;
zpscr[p]:=0;
zpcol[p]:=f;
zpscr[p+1]:=128;
end;
if peek(^197,0)= 41 then
begin
pause();
y:=y+1;
if (y>10) then y:=10;
p:=y*22+x;
zpscr[p]:=0;
zpcol[p]:=f;
zpscr[p-22]:=128;
end;
if peek(^197,0)= 9 then
begin
pause();
y:=y-1;
if (y=255) then y:=0;
p:=y*22+x;
zpscr[p]:=0;
zpcol[p]:=f;
zpscr[p+22]:=128;
end;
if peek(^197,0)= 10 then
begin
pause();
f:=f+1;
if (f>7) then f:=7;
zpcol[p]:=f;
end;
if peek(^197,0)= 42 then
begin
pause();
f:=f-1;
if (f=255) then f:=0;
zpcol[p]:=f;
end;
end;
end.