Saturday, 20 January 2018

More of Win Drives and QPAC2 FILES thing and .jpgs


The previous post outlined how the Q60 here at QL Heaven could have its hard drive configuration modified at boot time using a caddy system to swap the drives. The next question to consider is how the system and programs running within it can know which combination of drives had been configured at boot. The answer is the Environment Variables extension. This is LRESPRed in the boot file just before the selected drive configuration is mounted by the boot. As the drives are mounted the environment variable HDTYPE is set to a value that can be checked in a program to findout which Win drives were mounted without having to test each drive individually and trap errors. Below is a little SBASIC snippet of code that pops up a files window for each drive mounted of whichever type. Set up a little icon in launchpad, click on that and there are files windows for all drives. Handy if you cannot exactly remember which drive had that subdirectory you were looking for. 


1000  EXEP 'Files';'\DWin1_ \C1,2 \O',"Win1_"
1010  EXEP 'Files';'\DWin2_ \C1,2 \O',"Win2_"
1020  EXEP 'Files';'\DWin3_ \C1,2 \O',"Win3_"
1030  EXEP 'Files';'\DWin4_ \C1,2 \O',"Win4_"
1040  IF (GETENV$("HDTYPE")="ALLWINS")
1050    EXEP 'Files';'\DWin5_ \C3,2 \O',"Win5_"
1060    EXEP 'Files';'\DWin6_ \C3,2 \O',"Win6_"
1070    EXEP 'Files';'\DWin7_ \C3,2 \O',"Win7_"
1080    EXEP 'Files';'\DWin8_ \C3,2 \O',"Win8_"
1090  END IF
1100  IF (GETENV$("HDTYPE")="FAT32")
1110      EXEP 'Files';'\DWin5_ \C3,2 \O',"Win5_"
1120  END IF

The program in action below. There are two screen scrapes below. Both .jpg files created on the Q60. The difference between them is the size of the file - approximately 50k for an identical image. The larger file was created using QTImage while the smaller file was created using cjpeg a small very old utility obtained on a floppy disk from PD library some time in the 1990s.

Finally rereading the QPAC2 documentation revealed that the files thing can filter files as well as sorting them. Selecting the F2 source menu, inputting a source drive such as Win2_and adding an extension, Win2__bas will list only all the files with that extension in the given directory. Sometimes useful for searching out that file hidden in plain sight. 


Sunday, 14 January 2018

Boot Menu for Q60 with Multiple Hard Drive Formats

With the latest version of smsq/e the Q60 can handle QXL.win files on FAT32 formatted media and QUBide formatted disks and media as well as its native QWA hard disk format.  There are also the options of booting the Q60 in to mode 4 smsq/e or the QDOS classic or Linux. In addition there may be specific configurations of the OS for some jobs. A boot options menu is a define necessity. Below are screen scrapes of QL Heaven's current boot menu showing 3 of the options in operation.

The Q60 for those who do not know comes with an ancient ROMMed version of smsq/e. This is 2.97 if my recollection is correct. The GD2 drivers are not present in this version, so mode 4 and possibly mode 8 colours are only possible. It's not a terribly good version of smsq/e now. Its function is to load a boot file that loads a newer version of  smsq/e. That is obvious but with the multiple options for launching the Q60 into action and the at least 4 different incompatible hard disk formats that could be  attached to the system there is a problem especially if a CD/DVD is also to be attached. The Q60 has 2 ISA slots which can supply IDE connections giving 4 possible maximum IDE devices. The tower the q60 board exists within has 2 internal 3.5 inch drive bays and 3 external 5&1/4 inch bays.
Mounting hard disks internally caused problems for smsq/e if the appropriate drivers are not loaded.

The answer is a boot menu and a caddy system for the hard disks to mount them in the external 5&1/4 inch bays. As a result the Q60 has a default timeout  boot with 4 QWA partitions on the primary hard disk. A second QWA disk with additional partitions can be mounted if that boot option is chosen or a QUBIDE formatted disk instead or a FAT 32 disk with 4 QXL.win files acting as 4 additional partitions.

As an alternative the primary hard disk in it's caddy can be swapped out and replaced if the Q60 is to be booted in to LINUX or QDOS classic.

The trick for this system is to communicate from the boot menu to the reloaded boot file once the new version of smq/e has been loaded as neither boot file or smsq/e has any means of remembering which option had been selected so that the correct drivers are loaded for the current hard drive configuration. How that is done is quite simple and inelegant but functional, the boot file writes a note to itself on the primary hard disk. When it is reloaded it looks for the note that tells it which hard disk configuration has been selected, reads it loads the correct driver and deletes the note.
 

 



Sunday, 31 December 2017

Abandonware Revisited

Back in 2009 this blog posted a rant about abandonware for the QL. This is one of the most frequently viewed posts indicating a general interest in the subject. The good news about abandonware is that the situation has improved dramatically since 2009. This last year saw the release of even more formerly commercial programs as freeware including Qmenu, QLiberator, QDock, QTImage, QPTR, QBase, SuQcess, QLAWK, DISA as far as QLHeaven is aware. There are probably more including 292 games.

The QL scene has been particularly buoyant with the release of a new hardware QL, the Q68, and updates to SMSQ/E, SMSQumlator, and uQLx. The release of a new Qubide driver with also runs on the Q60, and a revamp of the ubiquitous Toolkit2. New software has also been forthcoming including QLWarz, QXLwinreader, sbtohtml, Hexa-puzzle, plus updates to other programmes including Photon, MediaManager, Quill, PCB Design, QcdEze and more.

All the above information has been gleaned from a quick run through of Dilwyn Jones site updates for 2017 of which there have been 72 update entries often with multiple updates.

It is amazing that a 1980s computer and it's OS that had a commercial life of 3-4 years is still evolving.

Felice Anno Nuove

Bonne annee

Happy New Year
 

Friday, 22 December 2017

Great QDOS/SMSQ/E Download Sites

In the QL Forum there has been talk of new black box noobs to the QL world. So if any read this blog,  here are the best, in the opinion of QL Heaven, download sites for free QL software, listed with the name of the site owner. Click on the link.

1. Dilwyn Jones

2. Thiery Godefroy

3. Wolfgang Lenerz
     smsq/e
     personal software
     smsqmulator

4. Bob Spelten

5. George Gwilt

6. London QL + Quanta Group

7. Daniel Terina

8. Marcel Kilgus


And then there are some that are group efforts : Black Phoenix
                                                                             The Repository

Finally the on line SBASIC/SuperBasic manual

Sunday, 17 December 2017

SMSQ/E 3.32 AND FAT32 QXL.win DEVICE

This new facility is an excellent addition for Qx0 users. Back up of Qx0 hard disks and transfer of their contents to other QL systems has been problematic up to now. QPC2 uses the QXL.win file as hard disk, Supergold card QLs  would use the QUBide hard disk interface, while the disk structure of the Qx0 hard disk was based on the Atari hard disk conventions. Three incompatible systems. Here at QL Heaven the Q60 hard disk was originally backed up to compact flash cards via a CF reader, and then in addition it was copied to external hard disks via a caddy system. Both of the hard disk IDE slots on the primary ISA card are attached to caddies to allow swapping of IDE disks, not hot swapping however. Latterly the contents of the Q60 hard disk were exported to a QPC2 QXLwin file via the serial port to a USBwiz device. This was a magical system but never entirely stable or compatible with all file handling programs so the transfer was somewhat hard work.



Now there is the FAT32 QXL.win device. This is at an early stage of development but works just fine. QLHeaven can report the trouble free transfer of the entire contents of the Q60 hard disk to a QXL.win file masquerading as Win5_. A FAT 32 CFcard was used simply because one and a CF card reader were to hand. Below is the card reader sitting inside the caddy.


Below is a view of the caddies on the Q60. Find SMSQ/E 3.32 here


Sunday, 10 December 2017

Digital C

Digital C is a version of small C that was sold by Digital Precision up to and including the closing sale of the QL Collection back in the early to mid 1990s if memory serves QL Heaven correctly.
The collection comprised 10 disks containing zipped copies of a digital precision programs and their manuals. Digital C is now freeware and can be downloaded from Dilwyn Jones site. The sources are also available.

Digital C was QLHeaven's easy introduction to C programming. Digital C although complex was easier for the tyro to get in to that the more powerful C68 package. QL Heaven is a 14 day C programmer. A book was bought titled teach yourself C programming in 21 days. QLHeaven got to day 14, skipped the rest and got down to programming.

Some screen savers and a program to display some graphic file formats were the results. Yesterday checking through the QL sites bookmarked in QLHeaven's browser to remove those that had been taken down, a post on Tim Swenson's site caught the eye. A smsqe-zine  from earlier this year where Tim Swenson had been playing around with Digital C and found that Digital C could only use the standard QL colours. This is not actually the case as Digital C contains functions to access QL Traps including trap#3. So here is a Digital C program running on a Q60 with grey and brown for its paper, ink and border colours. Why these colours were chosen is now beyond the ken of QLHeaven. Anyway here are some pics.





Thursday, 30 November 2017

SMSQ/E modules again

Here below is a further development of the SBASIC program written by Tony Tebby to explain the modular structure of smsqe. This time the program not only lists the modules in a version of smsq/e it also allows the extraction of a given module and/or its header element. Why - simply to see how it works.

The first image below shows how a module is selected, then when selected the second image shows the extraction menu.

The bottom window in the image shows how the screen shots were captured as gifs using a program called engif. This is an amazing little program. It only understands mode 4 and mode 8 colours but it can cope with display sizes more that 512x256. It comes in a package with ungif which can show a gif on a mode4 or mode 8 QL display.

Finally below is the listing.





1000 REMark - scan bootloader file
1010 DIM version$(4): version$(0)=4 :
1020 OPEN #0,CON_512x420a20x16: CLS#0: BORDER#0,1,4
1030 height = 52 : DIM d$(height,84) : pg=1
1040 INPUT#0,'SMSQ file>';f$ : IF f$="":QUIT
1050 OPEN_IN #3,f$
1060 fln = FLEN(#3) : PRINT#0,CHR$(10)&HEX$(fln,32)&" length of file"&CHR$(10)
1070 LGET #3\fln-$18+$4,mod_ptr : REMark - get length of host module
1080 PRINT#0,HEX$(mod_ptr,32)&" length of host module"&CHR$(10)
1090 LGET #3\fln-$18+$14,bln    : REMark - length of bootloader file
1100 PRINT#0,HEX$(bln,32)&" length of bootloader file"&CHR$(10)
1110 IF bln: mod_ptr = mod_ptr + fln - bln
1120 FOR i=1 TO 9999
1130   LGET #3\(mod_ptr),mbase,mlength
1140   IF NOT mbase: modules=i-1:EXIT              : REMark - end of file
1150   IF NOT i MOD height: Inc : pg=pg+1 : INPUT a$;  : REMark - pause at screen full
1160   WGET#3\(mod_ptr+$16),name_rel: REMark - relative pointer to name
1170   GET#3\(mod_ptr+$16+name_rel),name$  : REMark - fetch module name
1180   IF LEN (name$)&&1: BGET#3,a : REMark - odd length name is padded
1190   BGET #3,version$(1 TO 4)    : REMark - get version, if any
1200   PRINT#0,HEX$(mod_ptr,32) !!!! HEX$(mbase,24) !! HEX$(mlength,24) !! version$ ! name$
1210   d$(i)=HEX$(mod_ptr,32)&"    "&HEX$(mbase,24)&"  "&HEX$(mlength,24)&"  "&version$&" "&name$
1220   mod_ptr = mod_ptr + mbase + mlength
1230 END FOR i
1240 CLOSE #3 : PRINT#0,CHR$(10)&HEX$(mod_ptr,32)&" end of file"
1250 PRINT#0,\"Save data as text file (S/s), Extract a module (X/x), Header Info (I/i)"
1256 PRINT#0,\"                   or ESC to Quit program"
1260 REPeat Main
1264   in=INKEY$(#0,-1) INSTR 'SsQqxXIi'&CHR$(27): REMark wait to close program
1270   SELect ON in
1280     =1,2
1284            OPEN#1,"con_":OUTLN#1,320,210,96,130 : BORDER#1,1,4 : CLS#1
1286            AT#1,1,1:INPUT#1,'save file name>';sf$ : IF sf$="":QUIT
1288            WREST#1
1290     =5,6 : SelectModule
1300     =7,8 : SelectModule
1310     =9   : QUIT
1320   END SELect
1324   IF sf$<>""
1330     OPEN_NEW#3,sf$ : PRINT#3,f$\\HEX$(fln,32)&" length of file"&CHR$(10)
1340     FOR i=1 TO height : IF d$(i)<>"": PRINT#3,d$(i) : END FOR i
1350     PRINT#3,\\HEX$(mod_ptr,32)&" end of file"
1360     CLOSE#3 :sf$=""
1366   END IF
1378 END REPeat main
1370 :
1380 DEFine PROCedure Inc
1390   LOCal z$(height*pg),j
1400   FOR j=1 TO height*pg : z$(j)=d$(j)
1410   DIM d$(height*pg)
1420   FOR j=1 TO height*pg :d$(j)=z$(j)
1430 END DEFine
1440 :
1450 DEFine PROCedure SelectModule
1460 wndoline=8 : txtline=1 : up=208 : dn=216
1470 REPeat choose
1480   key=CODE(INKEY$(#0))
1490   SELect ON key
1500     = 27 : EXIT choose
1510     = up
1520       AT#0,wndoline,0 : INK#0,4:PRINT#0,d$(txtline)
1530       wndoline=wndoline-1 : IF wndoline<8 : wndoline=modules+7
1540       txtline=txtline-1 : IF txtline<1 : txtline=modules
1550     = dn
1560       AT#0,wndoline,0 : INK#0,4:PRINT#0,d$(txtline)
1570       wndoline=wndoline+1 : IF wndoline>modules+7 : wndoline=8
1580       txtline=txtline+1 : IF txtline>modules : txtline=1
1590     =10,32
1600       SELect ON in
1610         = 5,6 : DoExtraction
1620         = 7,8 : ShowHeaderInfo
1630       END SELect
1634       AT#0,wndoline,0 : INK#0,4:PRINT#0,d$(txtline)
1636       RETurn
1640   END SELect
1650   AT#0,wndoline,0 : INK#0,7: PRINT#0,d$(txtline)
1660 END REPeat choose
1670 END DEFine eXtractModule
1680 :
1690 DEFine PROCedure DoExtraction
1700 ptr=HEX(d$(txtline,1 TO 8)):hdr=HEX(d$(txtline,13 TO 18)):sze=HEX(d$(txtline,21 TO 26))
1710 strngmax=32000 : Xmod$=GetName
1720 OPEN#1,"con_":OUTLN#1,320,210,96,130 : BORDER#1,1,4 : CLS#1
1730 AT#1,1,2: INK#1,7: PRINT#1,"Module:- ";Xmod$
1740 AT#1,3,5: PRINT#1,"a: Extract header and module"
1750 AT#1,5,5: PRINT#1,"h: Extract header only"
1760 AT#1,7,5: PRINT#1,"m: Extract module only"
1770 AT#1,9,5: PRINT#1,"Q: Back to list without extraction"
1780 ky=INKEY$(#1,-1) INSTR 'AaHhMmQq'&CHR$(27)
1790   SELect ON ky
1800     =1,2 : all=hdr+sze
1810     =3,4 : all=hdr
1820     =5,6 : all=sze : ptr=ptr+hdr : REMark move pointer to module
1830   END SELect
1840   IF ky>0 AND ky <7 :AT#1,12,2 : INPUT#1,'save file name>';mf$ : IF mf$="": WREST#1 : RETurn
1850 WREST#1
1854 IF ky < 7
1858   OPEN_IN#3,f$ : OPEN_OVER#4,mf$
1860   IF all <= strngmax
1870     DIM mod$(all) : BGET#3\ptr,mod$(1 TO all) : PRINT#4,mod$(1 TO all);
1880   ELSE
1890     DIM mod$(strngmax)
1900       REPeat getbits
1910        BGET#3\ptr,mod$(1 TO strngmax) : PRINT#4,mod$(1 TO strngmax); : IF all=0 : EXIT getbits
1920        all=all-strngmax : IF all <strngmax : strngmax=all :all=0
1930      END REPeat
1940   END IF
1950   CLOSE#3 : CLOSE#4
1956 END IF
1960 END DEFine DoExtraction
1970 :
1980 DEFine FuNction GetName
1990 LOCal first,last,j,t$,md$
2000 m$=d$(txtline,29 TO ) : j=1
2010 REPeat first
2020   IF m$(j)<>" " : m$=m$(j TO) : EXIT first
2030   j=j+1
2040 END REPeat first
2050 j=LEN(m$)
2060 REPeat last
2070   IF m$(j)<>" " : m$=m$(1 TO j) : EXIT last
2080   j=j-1
2090 END REPeat last
2100 RETurn m$
2110 END DEFine GetName
2120 :
2130 DEFine PROCedure ShowHeaderInfo
2140 Xmod$=GetName : DIM mod$(24)
2150 ptr=HEX(d$(txtline,1 TO 8))
2160 OPEN_IN#3,f$ : rem BGET#3\ptr,mod$(1 to 24)
2162 LGET#3\ptr,hl,ml,rl,ck,sl
2166 BGET#3\(ptr),lvl : WGET#3\(ptr+2),nme
2170 OPEN#1,"con_":OUTLN#1,320,210,96,130 : BORDER#1,1,4 : CLS#1
2180 AT#1,1,2: INK#1,7: PRINT#1,"Header Info:- ";Xmod$
2190 AT#1,3,5: PRINT#1,"Header Length",HEX$(hl,32),hl
2200 AT#1,5,5: PRINT#1,"Module Length",HEX$(ml,32),ml
2210 AT#1,7,5: PRINT#1,"Relocate Length",HEX$(rl,32),rl
2220 AT#1,9,5: PRINT#1,"Checksum     ",HEX$(ck,32),ck
2230 AT#1,11,5: PRINT#1,"Select Code Offset",HEX$(sl,32),sl
2240 AT#1,13,5: PRINT#1,"Module Level",HEX$(lvl,8),,lvl
2250 AT#1,15,5: PRINT#1,"Offset to Name",HEX$(nme,16),,nme
2256 AT#1,19,5: PRINT#1,,"To return ESC or eXit"
2260 rt=INKEY$(#1,-1) INSTR "xX"&CHR$(27)
2270 WREST#1
2280 END DEFine