Page 1 of 1
madpascal is making nice progress...
Posted: Sat Mar 30, 2024 3:04 pm
by funkheld
Hi good afternoon.
https://github.com/MADRAFi/Mad-Pascal/tree/x16
Madpascal for the x16 is only at the beginning of development.
A few x16 system commands still need to be implemented here.
could be a good intermediate level for basic and C.
I made a demo for the x16 with right-left scrolling.
layer0 with image and layer1 with text.
greeting
Code: Select all
uses x16_vera, x16, crt;
var
i: byte;
d: word;
stop: Boolean;
z: byte;
u: byte;
procedure rechts;
begin
z:=z-1;
if z=255 then begin
u:=u-1;
Poke($9F38,u);
end;
Poke($9F37,z);
end;
procedure links;
begin
z:=z+1;
if z=0 then begin
u:=u+1;
Poke($9F38,u);
end;
Poke($9F37,z);
end;
Procedure KeyScan;
var c2: char;
begin
If KeyPressed then
begin
C2 := UpCase(ReadKey);
case C2 of
'Q': begin links; end;
'E': begin rechts; end;
end;
stop := (C2 = X16_KEY_ESC);
end
end;
begin
veraInit;
veraDirectLoadPalette('FUNKPAL.PAL');
veraDirectLoadImage('test.raw');
gotoxy(10,11);
writeln('TEXT IM SCREEN 80');
Repeat
KeyScan;
Until stop;
end.
Re: madpascal
Posted: Sat Mar 30, 2024 3:09 pm
by ahenry3068
funkheld wrote: ↑Sat Mar 30, 2024 3:04 pm
Code: Select all
uses x16_vera, x16, crt;
var
i: byte;
d: word;
stop: Boolean;
z: byte;
u: byte;
procedure rechts;
begin
z:=z-1;
if z=255 then begin
u:=u-1;
Poke($9F38,u);
end;
Poke($9F37,z);
end;
procedure links;
begin
z:=z+1;
if z=0 then begin
u:=u+1;
Poke($9F38,u);
end;
Poke($9F37,z);
end;
Procedure KeyScan;
var c2: char;
begin
If KeyPressed then
begin
C2 := UpCase(ReadKey);
case C2 of
'Q': begin links; end;
'E': begin rechts; end;
end;
stop := (C2 = X16_KEY_ESC);
end
end;
begin
veraInit;
veraDirectLoadPalette('FUNKPAL.PAL');
veraDirectLoadImage('test.raw');
gotoxy(10,11);
writeln('TEXT IM SCREEN 80');
Repeat
KeyScan;
Until stop;
end.
You should attach "FUNKPAL.PAL" and the Test Image on this post. You'll have to put them in a ZIP file.
Re: madpascal is making nice progress...
Posted: Sat Mar 30, 2024 4:49 pm
by funkheld
To test, I copied char "B" 16384x into layer1.
The picture can be seen in the background layer0.
to watch the scrolling.
moves without flickering.
scroll up/down/left/right
taste : q/w/e/s
I like the madpascal.
I'm impressed at how quickly you can create a program like this
has finished. especially since I'm a beginner.
Code: Select all
uses x16_vera, x16, crt;
var
i: byte;
d: word;
stop: Boolean;
z: byte;
zz: byte;
u: byte;
uu: byte;
procedure ascii ;
begin
For d := 1 to 16384 do begin
VPoke(1,$b000+d+1,2);
VPoke(1,$b000+d,0*16+2)
end;
end;
procedure oben;
begin
zz:=zz-1;
if zz=255 then begin
uu:=uu-1;
Poke($9F3a,uu);
end;
Poke($9F39,zz)
end;
procedure unten;
begin
zz:=zz+1;
if zz=255 then begin
uu:=uu+1;
Poke($9F3a,uu);
end;
Poke($9F39,zz)
end;
procedure rechts;
begin
z:=z-1;
if z=255 then begin
u:=u-1;
Poke($9F38,u);
end;
Poke($9F37,z);
end;
procedure links;
begin
z:=z+1;
if z=0 then begin
u:=u+1;
Poke($9F38,u);
end;
Poke($9F37,z);
end;
Procedure KeyScan;
var c2: char;
begin
If KeyPressed then
begin
C2 := UpCase(ReadKey);
case C2 of
'Q': begin links; end;
'E': begin rechts; end;
'S': begin oben; end;
'W': begin unten; end;
end;
stop := (C2 = X16_KEY_ESC);
end
end;
begin
veraInit;
veraDirectLoadPalette('FUNKPAL.PAL');
veraDirectLoadImage('test.raw');
ascii;
Repeat
KeyScan;
Until stop;
end.
Re: madpascal is making nice progress...
Posted: Sun Mar 31, 2024 4:18 am
by mortarm
Why is there no B in the upper left corner?
Re: madpascal is making nice progress...
Posted: Sun Mar 31, 2024 7:23 am
by funkheld
to test.
because I wanted to see when the starting point came while scrolling right/left/up/down.
have you tested it yet?
greeting
Re: madpascal is making nice progress...
Posted: Sun Mar 31, 2024 7:31 am
by funkheld
madrafi is still looking for help because he doesn't really know the x16 system and help for asm.
Unfortunately, I'm only a beginner at 75 years old.
Thanks.
greeting
----------------------------------------------------
Post by MADRAFi » Wed Feb 28, 2024 8:58 pm
Hi,
I am working on adding target for x16. However I am not asm coder so it is progressing slowly. I also do not know x16 architecture either.
Any help is appreciated.
Mad-Pascal fork until it is merged is located here:
https://github.com/MADRAFi/Mad-Pascal/tree/x16
viewtopic.php?t=7205
------------------------------------------
Re: madpascal is making nice progress...
Posted: Mon Apr 01, 2024 9:11 pm
by Martin Schmalenbach
Very cool!
If I’m not mistaken this project is for a pascal compiler designed to run on a modern computer, but producing 6502 machine code. Have I got that right?
It’s interesting to see that a number of Pascal-like compilers are being developed for the X16. I’m currently porting the original Tiny Pascal compiler that was first published over 3 consecutive editions of BYTE magazine from Sep - November 1978. That was written in North Star Basic, somewhat different from the basic on a C64 or X16!
It generates pcode which runs inside a virtual machine. Currently the virtual machine is also written in Basic, a port of the one published as part of the BYTE series and written in Tiny Pascal. When I have the whole thing much more stable I’ll rewrite the virtual machine in 6502 machine language before moving on to have the compiler generate 6502 machine code itself.
My port is designed to run on the X16 itself, not a modern computer.
Re: madpascal is making nice progress...
Posted: Tue Apr 02, 2024 7:06 pm
by mortarm
Buuut the X16 is a modern computer. It just came out in '22 or '23.
Re: madpascal is making nice progress...
Posted: Tue Apr 02, 2024 9:02 pm
by funkheld
Martin says that his Pascal runs and is programmed on the x16.
The madpascal runs on the PC and generates the code (prg) 6502 for the x16.
madpascal does it like cc65 or prog8.
hello martin, I'm looking forward to your tiny pascal for the x16.
greeting