LINE-command (DRAW on ZX Spectrum)
LINE-command (DRAW on ZX Spectrum)
Here is a routine to draw a line in ZX81 BASIC.
Syntax:
PRINT USR 16516,y1,x1,y2,x2
The routine will scan the given coordinates and then draw a line between the 2 points
You can enter fixed values but also variables as the demo shows.
Out of screen will give an error
The routine is in the REM line but hidden.
The demo is line 1 and more.
To use the routine save your code with the LINE0
Syntax:
PRINT USR 16516,y1,x1,y2,x2
The routine will scan the given coordinates and then draw a line between the 2 points
You can enter fixed values but also variables as the demo shows.
Out of screen will give an error
The routine is in the REM line but hidden.
The demo is line 1 and more.
To use the routine save your code with the LINE0
Re: LINE-command (DRAW on ZX Spectrum)
very cool. cheers. if you have time... maybe a feature to undraw a line also might be cool if you are working with a black background might be affective too 

Re: LINE-command (DRAW on ZX Spectrum)
@dr beep Much thanks 

Re: LINE-command (DRAW on ZX Spectrum)
New version with option to UNPLOT a line too.
See that the direction can be set too.
The seperator can be anything , and a ; will both to the job.
See that the direction can be set too.
The seperator can be anything , and a ; will both to the job.
Re: LINE-command (DRAW on ZX Spectrum)
Cool !
Many thanks Johan.
I don't know if it's usable in a graphic adventure game...
Many thanks Johan.
I don't know if it's usable in a graphic adventure game...
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
Re: LINE-command (DRAW on ZX Spectrum)
I think so. I might try and use it in a future game.. and will be sure to have him in the rolling credits 

Re: LINE-command (DRAW on ZX Spectrum)
Hi Johan
I tested on EO and found, that UNPLOT does nothing when using the ZX81x2 (Big Bang) rom.
Futhermore I would prefer a string instead the fixed letters P and U. Then a BASIC variable could be used (holding "P" or "U") instead of making a selfmodifying program to change the behaviour at runtime ..
Siggi
I tested on EO and found, that UNPLOT does nothing when using the ZX81x2 (Big Bang) rom.
Futhermore I would prefer a string instead the fixed letters P and U. Then a BASIC variable could be used (holding "P" or "U") instead of making a selfmodifying program to change the behaviour at runtime ..
Siggi
My ZX81 web-server: online since 2007, running since dec. 2020 using ZeddyNet hardware
http://zx81.ddns.net/ZxTeaM
http://zx81.ddns.net/ZxTeaM
Re: LINE-command (DRAW on ZX Spectrum)
Siggi,siggi wrote: ↑Wed Jun 12, 2024 11:40 am Hi Johan
I tested on EO and found, that UNPLOT does nothing when using the ZX81x2 (Big Bang) rom.
Futhermore I would prefer a string instead the fixed letters P and U. Then a BASIC variable could be used (holding "P" or "U") instead of making a selfmodifying program to change the behaviour at runtime ..
Siggi
you can use variable U and P. The program scans for the letter, not the variable That is done in the other parameters.
As for UNPLOT, I set a systemvariable to make this work.
See the ROM-UNPLOT routine. For PLOT it is set to <128 and 0 for UNPLOT.
Re: LINE-command (DRAW on ZX Spectrum)
Now altered for BIG BANG ROM