Tere must be something in Marcel's latest TK2, as he has changed the way of using default directories if the filename start with a real device.tofro wrote: Wed Aug 13, 2025 10:32 amThere actually is no easy way to check if something is a file/device name or not.
SlipKnot-like Browser for QL - Mimir
Re: SlipKnot-like Browser for QL - Mimir
7000 4E75
Re: SlipKnot-like Browser for QL - Mimir
See what QPAC2 "Files" does - It somehow seems to extract all valid directory devices from the system and displays them. It even supports network devices.RalfR wrote: Wed Aug 13, 2025 10:35 amTere must be something in Marcel's latest TK2, as he has changed the way of using default directories if the filename start with a real device.tofro wrote: Wed Aug 13, 2025 10:32 amThere actually is no easy way to check if something is a file/device name or not.
ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
Re: SlipKnot-like Browser for QL - Mimir
Yup, that's just a quick hack for now. Although if the browser doesn't recognize the specific device (i.e. currently only supporting defaults for ram, mdv, flp, and win) then it reverts to full paths and accepts whatever string you give to open files. So something like dsk1_index_htm would work just fine, it just wouldn't set the default directory withing the browser to dsk1.tofro wrote: Wed Aug 13, 2025 10:32 am You are certainly aware that
is not a very good test for a device name, especially not when considering default directories, the fact that QDOS device names don't need to be three characters long, that there are network file names, and that people can be (and have been, in the past) very creative with device names (at least 'dsk' and 'sdc' come to mind as examples). QPAC2 "Files" seems to have found a mechanism to extract the names of all directory device drivers in a system and displays them in the file selector - I do, however, have no idea what dirty trick it uses to achieve that....Code: Select all
if (name [4]=='_')
It could get tripped up if the device is more than three characters and one number since if it doesn't recognize a device it appends the default device to it, so you could have things like mdv1_dsk10_index_htm if say the dsk device had more than 9 devices. But instead of being exhaustive about trying to cover every conceivable thing, I think I'd add a quoted URL where it uses it as is and never appends a device (so I just need to parse it starting with " or ').
Making it fully robust is for later. Right now I just want to create a working prototype. The more interesting part will be to actually have it grab live web pages from the internet and display them locally, so the http/https suffixes are a bit more important to parse correctly.
Last edited by bwinkel67 on Wed Aug 13, 2025 12:35 pm, edited 2 times in total.
Re: SlipKnot-like Browser for QL - Mimir
I've not been following this thread too closely, so please excuse me if this is not really what was being discussed. Wrote this in a hurry just before going out.
This is a short BASIC program used in my Q-Trans, for example, which extracts the directory device names from the system. Don't remember if it detects network device names or not:
There are some routines in the BASIC and File Handling pages on my site which show how to slice up a filename into drive/directory/filename/extension, e.g. https://dilwyn.theqlforum.com/files/dirnames.zip and https://dilwyn.theqlforum.com/basic/direxists.zip
Obviously, directory handling depends on there being a level 2 filing system.
If you study the assembler source in https://dilwyn.theqlforum.com/tk/display2.zip it shows how to detect the presence of Level 2, etc.
If doing things from BASIC or compiled BASIC, you could use Norman's DJToolkit https://dilwyn.theqlforum.com/tk/djtk.zip
This is a short BASIC program used in my Q-Trans, for example, which extracts the directory device names from the system. Don't remember if it detects network device names or not:
Code: Select all
100 REMark Read directory devices lists
110 :
120 sv = 163840 : REMark QDOS default system variables address
130 REMark are we on Minerva or SBASIC?
140 v$ = VER$ : IF v$ = 'JSL1' OR v$ = 'HBA' THEN sv= VER$(-2)
150 :
160 REMark get pointer to the directory device driver linked list
170 ad_ptr = PEEK_L(sv+72)
180 :
190 ndevs% = 0 : REMark number of device names
200 longest% = 0 : REMark length of longest name
210 REPeat pass1
220 dnl_ptr = ad_ptr+36 : REMark device name length pointer
230 lon% = PEEK_W(dnl_ptr) : REMark length of name
240 IF lon% > longest% THEN longest% = lon%
250 ndevs% = ndevs%+1 : REMark count number of device names
260 ad_ptr = PEEK_L(ad_ptr) : REMark next linked list entry
270 IF ad_ptr = 0 THEN EXIT pass1 : REMark end of list
280 END REPeat pass1
290 :
300 REMark dimension array to hold device names
310 DIM devs$(ndevs%-1,longest%)
320 :
330 ad_ptr = PEEK_L(sv+72) : REMark restart list
340 ndevs% = 0
350 REPeat pass2
360 dnl_ptr = ad_ptr+36
370 lon = PEEK_W(dnl_ptr)
380 REMark add device driver name to list in devs$() array
390 FOR i = dnl_ptr+2 TO dnl_ptr+lon+1
400 devs$(ndevs%) = devs$(ndevs%) & CHR$(PEEK(i))
410 END FOR i
420 ndevs% = ndevs%+1
430 ad_ptr = PEEK_L(ad_ptr)
440 IF ad_ptr = 0 THEN EXIT pass2
450 END REPeat pass2
460 :
470 CLS : PRINT ndevs%;' devices:'\devs$! : REMark show it worked!
Obviously, directory handling depends on there being a level 2 filing system.
If you study the assembler source in https://dilwyn.theqlforum.com/tk/display2.zip it shows how to detect the presence of Level 2, etc.
If doing things from BASIC or compiled BASIC, you could use Norman's DJToolkit https://dilwyn.theqlforum.com/tk/djtk.zip
--
All things QL - https://dilwyn.theqlforum.com
All things QL - https://dilwyn.theqlforum.com
Re: SlipKnot-like Browser for QL - Mimir
Oh, that's pretty cool code. I could probably create something in C that follows this to do the same thing. It really depends on how big my final implementation is. I'd like to keep exec size small since I need room to cache incoming webpages for my browser to then parse.dilwyn wrote: Wed Aug 13, 2025 12:23 pm I've not been following this thread too closely, so please excuse me if this is not really what was being discussed. Wrote this in a hurry just before going out.
This is a short BASIC program used in my Q-Trans, for example, which extracts the directory device names from the system. Don't remember if it detects network device names or not:
There are some routines in the BASIC and File Handling pages on my site which show how to slice up a filename into drive/directory/filename/extension, e.g. https://dilwyn.theqlforum.com/files/dirnames.zip and https://dilwyn.theqlforum.com/basic/direxists.zipCode: Select all
100 REMark Read directory devices lists 110 : 120 sv = 163840 : REMark QDOS default system variables address 130 REMark are we on Minerva or SBASIC? 140 v$ = VER$ : IF v$ = 'JSL1' OR v$ = 'HBA' THEN sv= VER$(-2) 150 : 160 REMark get pointer to the directory device driver linked list 170 ad_ptr = PEEK_L(sv+72) 180 : 190 ndevs% = 0 : REMark number of device names 200 longest% = 0 : REMark length of longest name 210 REPeat pass1 220 dnl_ptr = ad_ptr+36 : REMark device name length pointer 230 lon% = PEEK_W(dnl_ptr) : REMark length of name 240 IF lon% > longest% THEN longest% = lon% 250 ndevs% = ndevs%+1 : REMark count number of device names 260 ad_ptr = PEEK_L(ad_ptr) : REMark next linked list entry 270 IF ad_ptr = 0 THEN EXIT pass1 : REMark end of list 280 END REPeat pass1 290 : 300 REMark dimension array to hold device names 310 DIM devs$(ndevs%-1,longest%) 320 : 330 ad_ptr = PEEK_L(sv+72) : REMark restart list 340 ndevs% = 0 350 REPeat pass2 360 dnl_ptr = ad_ptr+36 370 lon = PEEK_W(dnl_ptr) 380 REMark add device driver name to list in devs$() array 390 FOR i = dnl_ptr+2 TO dnl_ptr+lon+1 400 devs$(ndevs%) = devs$(ndevs%) & CHR$(PEEK(i)) 410 END FOR i 420 ndevs% = ndevs%+1 430 ad_ptr = PEEK_L(ad_ptr) 440 IF ad_ptr = 0 THEN EXIT pass2 450 END REPeat pass2 460 : 470 CLS : PRINT ndevs%;' devices:'\devs$! : REMark show it worked!
Obviously, directory handling depends on there being a level 2 filing system.
If you study the assembler source in https://dilwyn.theqlforum.com/tk/display2.zip it shows how to detect the presence of Level 2, etc.
If doing things from BASIC or compiled BASIC, you could use Norman's DJToolkit https://dilwyn.theqlforum.com/tk/djtk.zip
Re: SlipKnot-like Browser for QL - Mimir
is it concerning that I can disassemble this without looking it up?

Re: SlipKnot-like Browser for QL - Mimir
Do you also recognise HEX$(12648430,24) ? 

--
All things QL - https://dilwyn.theqlforum.com
All things QL - https://dilwyn.theqlforum.com
Re: SlipKnot-like Browser for QL - Mimir
No, had to try it

Reminds me of the 0xbaadf00d value sometimes used in old (32 bit!) projects for uninitialized pointers.