Page 28 of 28

Re: Knoware.no

Posted: Wed May 28, 2025 10:27 pm
by Popopo
pjw wrote: Tue May 27, 2025 10:33 am Im sorry my manuals are so obtuse! I will try harder to make them clearer.
...
Hi!
Thank you very much for such detailed answer :)
Your manual is not obtuse, it is my mind some days :) ... and lack of experience :)

Again, thank you :)

Re: Knoware.no

Posted: Wed May 28, 2025 10:30 pm
by Popopo
Derek_Stewart wrote: Wed May 28, 2025 7:32 am When there is no microdrive cartridge in the the drive, there should be a system error generated: ERR_NF (-7) file or device not found. See QDOS Technical Manual Chapter 18.1 Page 158 and SMSQ/E calls the error code: err.fdnf (-7) file or device not found, see SMSQDOS Reference Manual section 18.1

The error can be caught using a WHEN ERRor clause, see QL User manual or online Superbasic manual for details and Toolkit 2 and Qliberator manuals for updates.

Note pre-JS Roms the WHEN ERRor did not work, so, JS, Minerva, SMSQ/E are the only versions that will work.
Hi Derek,
Really? wauuuu, I want to try it out this weekend.
I was looking for it and even I opened a thread about it with lot of activity but the answer was about to trap or to use C.
So it is new for me. I will check it out.

Thank you :)

Re: Knoware.no

Posted: Wed May 28, 2025 11:11 pm
by Derek_Stewart
Hi,

Toolkit 2 introduced some extensions to the Error reporting. Instead of using the minus error numbers, which all forget. there are ERR_xxx for each error condition, for example:

Error: File not found = -7

or Toolkit 2 gives a function called: ERR_NF

the current error code is returned in the function: ERNUM

So using Per's extension

PRINT ERRM$(ERNUM)

should give the description of the error code.

Puttin the When Error clause that the start of the programme will error trap the finding of files:

WHEN_ERRor
IF ERNUM=ERR_NF : PRINT "No file or device found"
END_WHEN

Re: Knoware.no

Posted: Thu May 29, 2025 12:47 am
by ql_freak
 
Just "played" with Per's PlotLine, nice. I always wanted "graphics" for the pixel coordinate system.

Wish: Someone should port it to assembler.

Here my (as an owner of "The C Programming Language") "hello world" example:
 
pjwPlotLine01.png
pjwPlotLine01.png (10.72 KiB) Viewed 225 times

Re: Knoware.no

Posted: Thu May 29, 2025 7:47 am
by tofro
ql_freak wrote: Thu May 29, 2025 12:47 am Wish: Someone should port it to assembler.
Have a look at DIY Toolkit's graphics functions. They provide pixel coordinate plot and draw functions in assembly language.

Re: Knoware.no

Posted: Thu May 29, 2025 3:28 pm
by pjw
tofro wrote: Thu May 29, 2025 7:47 am
ql_freak wrote: Thu May 29, 2025 12:47 am Wish: Someone should port it to assembler.
Have a look at DIY Toolkit's graphics functions. They provide pixel coordinate plot and draw functions in assembly language.
I had intended to convert the plotline algorithm to assembler, but then I got stuck on the high colour modes and the whole project became too complicated for what was intended as a leisurely walk in the park.

Even simplifying to use the internal block drawing routines rather than plotting coloured pixels of my own didnt yield to my repeated attempts. All I ever got were black lines.

So while figuring out how to get the block routines to produce the desired colour is still somewhere on my ToDo list, plotline, with the shapes I had planned to go with it (rectangles, triangles, circles, etc) are off the menu.

I wasnt aware of the DIY version before, but on checking it out now it seems it is rather out of date. It may work fine on QL-like machines (512x256, modes 0 and 4, and Thor mode 12) but no high colour. A later update seems to be able to work with larger screens, but due to some design decisions, Im not sure these routines will work with very large screens.

No doubt they could be updated by some knowledgable and dedicated enthusiast. But personally, I wouldnt have used two step instructions to draw a line, and therefore the need to "remember" values between calls. It might be a lot simpler and better to start afresh..