My OLD/NEW boot front end

Anything QL Software or Programming Related.
User avatar
polka
Trump Card
Posts: 196
Joined: Mon Mar 07, 2011 11:43 am

My OLD/NEW boot front end

Post by polka »

Projecting to port my Conway's LIFE to SuperForth, I had first to reinstall SuperForth and to reconfigure it for my Qemulator, which led me first to rewrite the boot program of the WIN disk that I declare as MDV1 (or FLP1). In this version of function key driven menus, the main menu gives access to 4 submenus or escape to SuperBasic Command line :
F1 to submenu for various utilities
F2 to submenu for Psion suite
F3 to submenu for PD Prolog, ComputerOne Forth and DigitalPrecision SuperForth
F4 to submenu for C68 programming
F5 for escape to SuperBasic Command line

The "various utilities" submenu at this time gives only access to Qjump QRAM utilities, but I intend to add unzip, kermit, etc. The F1 key is dedicated to return to main menu.
Snapshot of Qjump QRAM
Snapshot of Qjump QRAM
The "Psion Suite" submenu gives access to QUILL, ABACUS, ARCHIVE and EASEL. The F2 key is dedicated to return to main menu.

The "Prolog and Forth" submenu gives access to QED for plain text editing and to one PD Edimburgh Prolog engine and my two Forth self compilers. The F3 key is dedicated to return to main menu.

The "C68 programming" submenu gives access to QED for plain text editing and to compiler, linker and make. The F4 key is dedicated to return to main menu.

To be noted : all submenus go back to main menu through the same key as was used to access them, but this is not mandatory, it was so configured by my menu map instructions. Also, in the three latter submenus, the F1 key gives access to a text editing program, either QUILL or QED.

I Splitted this boot program in two parts to clarify :

First, the menu navigation itself

Code: Select all

==================================
My new boot file, to access C68 
and other programming tools
on a WIN hard disk with Qemulator
==================================

REM   BOOT install commands
      dev$='flp1_'

REM   Loading of Superbasic extensions : TK2_EXT, etc.
      a = RESPR(14638) : LBYTES dev$ & 'ptr_gen',a : CALL a 
      a = RESPR(10126) : LBYTES dev$ & 'wman'   ,a : CALL a 
      a = RESPR(5036)  : LBYTES dev$ & 'ramprt' ,a : CALL a 
      a = RESPR(9328)  : LBYTES dev$ & 'qptr'   ,a : CALL a
 
      PROG_USE dev$

      WINDOW#0,388,42,110,4:PAPER#0,0:INK#0,7:BORDER#0,1,7
      WINDOW#1,88,216,20,4:PAPER#1,208:INK#1,7:BORDER#1,1,7
      WINDOW#2,388,172,110,48:PAPER#2,0:INK#2,4:BORDER#2,1,7
      OPEN#3,scr_512x34a0x222:PAPER#3,0:INK#3,4:border#3,1,0

REM   A little procedure convert a notepad .txt to suit QED etc.

32500 DEFine PROCedure TXT4QL(N$)
32501    OPEN_IN #5,N$ & ".txt"
32502    OPEN_NEW #4,N$
32503    REPeat READ_LINE
32504       INPUT #5,L$
32505       L=LEN(L$)
32506       IF CODE(L$(L))=13 THEN
32507          PRINT #4,L$(1 TO L-1)
32508       ELSE
32509          PRINT #4,L$
32510       END IF
32511       IF EOF(#5) THEN EXIT READ_LINE
32512    END REPeat READ_LINE
32513    CLOSE #5
32514    CLOSE #4
32515 END DEFine TXT4QL

REM   The four submenus

32600 DATA  80,7,'  M A I N  ','  M E N U  '
32601 DATA   0,7,'           ','           '
32602 DATA   0,7,'           ','           '
32603 DATA   0,7,'           ','           '
32604 DATA   2,7,'   Qjump   ','   Q/RAM   ',32605
32605 om=32741 : bye : REM back to main menu
32606 bye
32607 bye
32608 bye
32609 EXEC dev$ & 'QRAM' : bye

32610 DATA   2,7,'   PSION   ','   QUILL   '
32611 DATA  80,7,'  M A I N  ','  M E N U  '
32612 DATA   2,7,'   PSION   ','  ABACUS   '
32613 DATA   2,7,'   PSION   ','  ARCHIVE  '
32614 DATA   2,7,'   PSION   ','   EASEL   ',32615
32615 EXEC dev$ & 'quill'      : bye
32616 om=32741 : bye : REM back to main menu
32617 EXEC dev$ & 'abacus'     : bye
32618 EXEC dev$ & 'archive'    : bye
32619 EXEC dev$ & 'easel'      : bye

32620 DATA   2,7,'QED Editeur',' de textes '
32621 DATA   2,7,'  PROLOG   ',' Edimburgh '
32622 DATA  80,7,' M A I N   ','  M E N U  '
32623 DATA   2,7,'   FORTH   ','ComputerOne'
32624 DATA   2,7,'   FORTH   ','DigitalPrec',32625
32625 EXEC dev$ &'qed':bye
32626 EXEC dev$ &'prolog':bye
32627 om=32741 : bye : REM back to main menu
32628 EXEC dev$ &'forth':bye
32629 EXEC dev$ &'forth83_job':bye

32630 DATA   2,7,' C68K      ','      EDIT '
32631 DATA   2,7,' C68K      ','   COMPILE '
32632 DATA   2,7,' C68K      ','      LINK '
32633 DATA  80,7,'  M A I N  ','  M E N U  '
32634 DATA   2,7,' C68K      ','      MAKE ',32635
32635 EXEC_W QED:C68:bye
32636 CLS#0:PRINT#0,"Compiling...";:PRINT#0,CCC$(0):C68:bye
32637 CLS#0:PRINT#0,"Linking...";:PRINT#0,CCC$(1):C68:bye
32638 om=32741 : CLS#2 : bye : REM back to main menu
32639 QF:EXEC_W MAKE,#2,#2,#2;p$ & " -t " & Q$:C68:bye

REM   The main menu calling four submenus or escaping to SuperBasic

32741 DATA   208,7,'  Various  ',' Utilities '
32742 DATA   208,7,'   PSION   ','   SUITE   '
32743 DATA   208,7,'Programming','   Tools   '
32744 DATA   208,7,'    C68    ','Development'
32745 DATA    80,7,'   SUPER   ','   BASIC   ',32746
32746 om=32600 : PAPER#2,0:INK#2,4:CLS#2 : bye
32747 om=32610 : PAPER#2,0:INK#2,4:CLS#2 : bye
32748 om=32620 : PAPER#2,0:INK#2,4:CLS#2 : bye
32749 om=32630 : PAPER#2,0:INK#2,4:CLS#2 : C68 : bye
32750 CLS:CLS#0:PRINT#0,'Say BYE to quit SUPER BASIC':STOP

32751 DEFine PROCedure C68
32752 PAPER#2,0:INK#2,4:CLS#2:VIEW#2,dev$ &'C68'
32753 END DEFine C68

REM   The menu navigation procedure "bye"

32754 DEFine PROCedure bye
32755 RESTORE om:CLS:CLS#0
32756 PAPER#3,0:INK#3,4:csize#3,0,0:cls#3:AT#3,0,7
32757 PRINT#3,' F1',,'F2',,'F3',,'F4',,'F5'
32758 FOR i = 5 TO 69 STEP 16
32759 READ p,q,p$,Q$
32760 PAPER#3,p:INK#3,q
32761 AT#3,1,i:PRINT#3,p$
32762 AT#3,2,i:PRINT#3,Q$
32763 END FOR i
32764 p = CODE(INKEY$(-1))/4
32765 IF p<58 OR p>62:GO TO 32764
32766 PAPER#3,0:READ q:GO TO p+q-58

MODE 4 : CSIZE#3,2,1:CLS#3
PRINT#3,"   POLKA's SuperBasic Setup'n Run !"

om=32741 : PAUSE 250:PAPER#2,0:INK#2,4:CLS#2:initform : bye
and some snapshots of the resulting display
Snapshot of main and sumenus
Snapshot of main and sumenus
Second, the specific part implementing the C68 front-end

Code: Select all

============================================
C68 Introducing text file : MDV1_C68
============================================

When using COMPILE (F2) or LINK (F3), a setup form will replace
this HELP screen. Some  of the options will be set or disabled,
depending on what this program assumes when booting and on what
you have already done since that time. The field you would most
likely modify will be highlighted: that is the filename.

Remember that you can step through the fields using the ¾ and ¿
keys. ENTER key starts compiling or linking, ESC key exits.

The SPACE BAR has different functions depending on the fields:
- sometimes it will let you step through different options.
- sometimes it will let you activate or inhibit an option.
- sometimes it will erase a field, and let you input something.

All this was meant to be intuitive. Feel free to experiment !!!

==============================================
Part of boot file MDV1_BOOT for C68 front-end
==============================================

32640 DEFine PROCedure QF: INPUT#0,"Which file ? ";P$:INPUT#0,"What goals ? ";Q$:IF p$<>"":p$="-f "&p$
32641 END DEFine
32642 DEFine PROCedure RU(PR$,PA$):Cls#2:EXEC_W dat$&PR$,#2,#2,#2;PA$:END DEFine
32643 DEFine PROCedure XX:nnn=LEN(r$(1)):RU r$(1,4 TO nnn-2),"":END DEFine

32644 DATA 18,4,0,2,0,2,2,0,7,7,12
32645 DATA 12,2,"3K"," -=3072",5,18,2
32646 DATA 12,2,"5K"," -=5120",5,18,3
32647 DATA 12,2,"7K"," -=7168",5,18,4
32648 DATA 12,2,"9K"," -=9216",5,18,1
32649 DATA 24,2,"VERBOSE"," -v",7,1,6
32650 DATA 24,2,"LACONIC","",7,1,5
32651 DATA 41,2,"ANSI"," -unproto",9,5,8
32652 DATA 41,2,"K&R ","",9,5,7
32653 DATA 53,2,"16 bits"," -Qshort",13,7,10
32654 DATA 53,2,"32 bits","",13,7,9
32655 DATA 30,7,"","   flp2_mydir_",12,14,4
32656 DATA 30,8,"","   myprog_c",15,11,1
32657 DATA 30,4,""," -Iflp2_",14,9,2
32658 DATA 30,5,""," -Lflp2_",11,13,3
32659 DATA 10,12,"Floating point & Maths         flp1_LIB_LIBM_a"," -lm",16,12,15
32660 DATA 10,13,"Dynamic allocations       flp1_LIB_LIBMALLOC_a"," -lmalloc",17,15,16
32661 DATA 10,14,"debug support              flp1_LIB_LIBDEBUG_a"," -ldebug",18,16,17
32662 DATA 10,15,"Semaphores and tasking       flp1_LIB_LIBSEM_a"," -lsem",1,17,18
32663 DATA 0,1,0,0,1,0,0,1,0,1,1,1,1,1,0,0,0,0,11
32664 DATA 1,1,0,4,"COMPILE AND LINK OPTIONS :"
32665 DATA 4,2,0,4,"Stack :      Mode :           Norm :       Int :"
32666 DATA 0,3,0,7,"----------------------------------------------------------------"
32667 DATA 7,4,0,4,"My Include Directory :"
32668 DATA 7,5,0,4,"My Library Directory :"
32669 DATA 0,6,0,7,"----------------------------------------------------------------"
32670 DATA 7,7,0,4,"My Project Directory :"
32671 DATA 7,8,0,4,"My Current File Name :"
32672 DATA 0,9,0,7,"----------------------------------------------------------------"
32673 DATA 1,10,0,4,"Standard Libraries to scan :"
32674 DATA 10,11,0,7,"Standard C LIBRARY             flp1_LIB_LIBC_a"

32675 DEFine PROCedure INITFORM
32676 o=32644:RESTORE o:READ m:DIM f(m):READ n:DIM r$(n,32)
32677 DIM CC(7):FOR i=0 TO 7:READ CC(i):NEXT i:READ cp
32678 RESTORE o+m+1:FOR i=1 TO m:READ f(i):NEXT i:READ MMM
32679 FOR i=1 TO m:READFLD(o+i):IF m$="":r$(jt)=n$
32680 END DEFine 

32681 DEFine PROCedure EDITFORM
32682 o=32644:CLS#2:RESTORE o+m+2
32683 FOR i=1 TO MMM:READ x,y,jp,jt,m$:PAPER#2,jp:INK#2,jt:AT#2,y,x:PRINT#2,m$
32684 c=cp:READFLD(c+o)
32685 c=NEXTFLD(c):IF c<>cp:GO TO 32685
32686 REPeat ScanKeyb
32687 a=CODE(INKEY$(-1))
32688 SELect ON a
32689 ON a=208:c=PREVFLD(c)
32690 ON a=216:c=NEXTFLD(c)
32691 ON a=32:c=TOGGLE(c)
32692 ON a=10:DISPFLD c,0:EXIT ScanKeyb
32693 ON a=27:C68:bye
32694 END SELect 
32695 END REPeat ScanKeyb
32696 FOR i=1 TO m
32697 READFLD(o+i):IF m$="":n$=r$(jt)
32698 IF ((m$<>"") OR ((jt>1) AND (jt<n))) AND (f(i)=1):p$=p$&n$
32699 END FOR i
32700 dat$=r$(n,4 TO LEN(r$(n)))
32701 END DEFine 

32702 DEFine FuNction CCC$(opt)
32703 p$=" -tmpflp2_":EDITFORM:INK#2,4:CLS#2:nnn="_c"INSTR r$(1)
32704 IF nnn=0:nnn=len(r$(1))+1:r$(1)=r$(1)&"_c"
32705 IF opt=0:p$="-c "& dat$ & r$(1,4 TO nnn+1)&" "&p$
32706 IF opt=1:p$="-o"&dat$&r$(1,4 TO nnn-1)&" "&dat$&"*_o "&p$
32707 EXEC_W CC,#2,#2,#2;p$
32708 PRINT#0," Done... Hit any key !";:return inkey$(-1)
32709 END DEFine 

32710 DEFine FuNction TOGGLE(i)
32711 IF m$="" THEN 
32712 EDITFLD(jt)
32713 ELSE 
32714 IF jt=i :f(i)=1-f(i)
32715 IF jt<>i:f(i)=0:i=jt:f(i)=1:READFLD(i+o)
32716 END IF 
32717 DISPFLD i,1:RETurn i
32718 END DEFine 

32719 DEFine FuNction PREVFLD(i)
32720 DISPFLD i,0:i=jp:i=FINDFLD(i):DISPFLD i,1:RETurn i
32721 END DEFine 

32722 DEFine FuNction NEXTFLD(i)
32723 DISPFLD i,0:i=jn:i=FINDFLD(i):DISPFLD i,1:RETurn i
32724 END DEFine 

32725 DEFine PROCedure DISPFLD(i,s)
32726 PAPER#2,CC(2*f(i)+s):INK#2,CC(4+2*f(i)+s)
32727 AT#2,y,x:PRINT#2,m$;:IF m$="":PRINT#2,r$(jt,4 TO)
32728 END DEFine 

32729 DEFine PROCedure EDITFLD(ii)
32730 PAPER#2,CC(2*f(i)):INK#2,CC(4+2*f(i))
32731 AT#2,y,x:PRINT#2,FILL$(" ",29)
32732 AT#2,y,x:INPUT#2,O$:r$(ii)=r$(ii,1 TO 3)&O$
32733 END DEFine 

32734 DEFine PROCedure READFLD(l)
32735 RESTORE l:READ x:READ y:READ m$:READ n$:READ jn:READ jp:READ jt
32736 END DEFine 

32737 DEFine FuNction FINDFLD(i)
32738 READFLD(i+o):IF (jt<>i)AND(f(i)=0):i=jt:GO TO 32738
32739 RETurn i
32740 END DEFine 

This front end, when selecting Compile and Link displays this same configuration form shown in the lower pert of the picture. Whereas the Make option only asks for a make file and goals. The upper part of the picture shows this dialog, together with an introductive information screen (displayed always when there is nothing else to show).
Snapshot of C68 front end
Snapshot of C68 front end
Bye, Paul
Last edited by polka on Tue Oct 25, 2011 10:40 am, edited 1 time in total.


May the FORTH be with you !
POLKa
User avatar
vanpeebles
Commissario Pebbli
Posts: 2821
Joined: Sat Nov 20, 2010 7:13 pm
Location: North East UK

Re: My OLD/NEW boot front end

Post by vanpeebles »

That looks excellent, very impressive. Superb work as usual! :ugeek:


User avatar
polka
Trump Card
Posts: 196
Joined: Mon Mar 07, 2011 11:43 am

Re: My OLD/NEW boot front end

Post by polka »

This night, I won the battle against unzip541xq.bin, in a rather curious way ???

When I tried to run it with :

LRESPR "FLP1_unzip541xq.bin", it loaded and started OK, but never accepted my answers to its first question "what temp dir ?", always telling "not found". And a second try of LRESPR always answered "out of memory". So between trials, I had to restart Qemulator.

Thus once, I decided in order to avoid restarting each time, to use instead of LRESPR :

a = RESPR(250000)
LBYTES "FLP1_unzip541xq.bin",a
CALL a

So that I may only repeat CALL... but :

this worked at once, accepting for temp a FLP3_ linked to a windows "temp" directory and for destination a FLP4_ linked to a windows "dest" directory, then with :

LRUN FLP3_SFX_BAS

unzipped correctly everything (just failing to self-erase, with message "in use" - indeed !).

My config was the following :
Qemulator 2.3.2 (registered 2004)
Qdos version 1.10 (JS ROM)
plus Toolkit 2.12 (1985)
640k ram original QL speed

???

Bye Paul


May the FORTH be with you !
POLKa
User avatar
vanpeebles
Commissario Pebbli
Posts: 2821
Joined: Sat Nov 20, 2010 7:13 pm
Location: North East UK

Re: My OLD/NEW boot front end

Post by vanpeebles »

That self extracting zip is a complete nightmare, as a new user it left me completely puzzled and baffled. Everyone I know has had battles with it. Once I got a working unzipped zip I made 4 or 5 copies of the floppy disc just incase!


User avatar
Mr_Navigator
QL Fanatic
Posts: 782
Joined: Mon Dec 13, 2010 11:17 pm
Location: UK, Essex
Contact:

Re: My OLD/NEW boot front end

Post by Mr_Navigator »

lol, what to do when in doubt or frustrated by the method :)
I made 4 or 5 copies of the floppy disc just incase
If only I had a tracker for tracking all the multiple copies I have made of files just in case.

Even now I make copies of any files I create stemming all the way back to an incident around an article I wrote for QL USER/QL WORLD way back in '84

Most things nowadays seem to be robust but it only takes one person's tale to strike fear in to 'backup like you have never backed up before' backup.


-----------------------------------------------------------------------------------
QLick here for the Back 2 the QL Blog http://backtotheql.blogspot.co.uk/
User avatar
polka
Trump Card
Posts: 196
Joined: Mon Mar 07, 2011 11:43 am

Re: My OLD/NEW boot front end

Post by polka »

On "backing" backups :

Once upon a time (when backups were made on mag. tapes), in a french medium size company :

Each time a periodic backup was made, an employee was sent (with his car) to store it in a distant vault, so that the data were safe even in case of extreme accidents (fire) at the company site. And one day, they had a (minor) computer incident, that needed to restore the latest backup ; but it could not be read ; then they tried with the backup before, it did not work either... and so on, all the backups stored since a reasonable time were unreadable !!! Although they were - indeed - thoroughly checked before their storage.

They finally found out why :

This man had a Saab, a northern luxury car with heating seats, and he put the mag. tape reel on the seat beside him on his journey to the vault : the backup always arrived in the vault "baked".

Bye Paul


May the FORTH be with you !
POLKa
User avatar
vanpeebles
Commissario Pebbli
Posts: 2821
Joined: Sat Nov 20, 2010 7:13 pm
Location: North East UK

Re: My OLD/NEW boot front end

Post by vanpeebles »

Hehehe that's a good story, I reckon the super gold card would do a good job of baking backups.


User avatar
dilwyn
Mr QL
Posts: 2761
Joined: Wed Dec 01, 2010 10:39 pm

Re: My OLD/NEW boot front end

Post by dilwyn »

vanpeebles wrote:That self extracting zip is a complete nightmare, as a new user it left me completely puzzled and baffled. Everyone I know has had battles with it. Once I got a working unzipped zip I made 4 or 5 copies of the floppy disc just incase!
Someone said on here (or possibly on ql-users mailing list) that the self-extract unzip had problems running on systems which had the level 2 filing systems (i.e. supported the MAKE_DIR command to create directories on QL disks).

I recently created for my own use a program which turned a QL executable into a S*BASIC program as DATA statements plus enough lines of BASIC to recreate the original program. It proved useful for situations where a QL executable needed to be passed through Windows/DOS/etc and would normally have lost the executable file header in the process. S*BASIC programs survive going through the "other operating system" scenario, so once they end up in the target system they can be run OK, and my system basically rebuilt the program from DATA statements and used SEXEC to save a working copy of the executable. It would be of most use for getting a copy of Unzip into the tagregt emulator system etc without having to fight with the self-extract. The catch 22 of how do you transfer a copy of unzip without already having a copy of unzip to unzip the unzip program... :x

If I get time to finish debugging it, I'll see if I can put a copy on my website soon.

Dilwyn


User avatar
dilwyn
Mr QL
Posts: 2761
Joined: Wed Dec 01, 2010 10:39 pm

Re: My OLD/NEW boot front end

Post by dilwyn »

vanpeebles wrote:That looks excellent, very impressive. Superb work as usual! :ugeek:
Interesting to see QRAM still being used! It's many years since I last used it - I have been using QPAC2 instead for many years now.

Dilwyn


User avatar
polka
Trump Card
Posts: 196
Joined: Mon Mar 07, 2011 11:43 am

Re: My OLD/NEW boot front end

Post by polka »

News, WARNING and questions...

News :

More and again involved with programming my first serious personal computer (the QL), I renewed (after a long time) my subscription to QLtoday, got with my first issue "the" DVD, browsed through it and decided to buy QPC2 to complement my "real" QL and Daniele's Qemulator.

Actually, QPC was my first "emulator", running on a PC with a 800x600 SVGA display, but the PC died and my master SMSQ/E floppy was damaged. Thus, to try something else, I bought a license for Qemulator. I liked both, but they are essentially different : Qemulator is a true emulation of QL+Qdos, whereas QPC is a new machine, said to be 99.9% compatible with QL software.

Qemulator(2.32 which I have) provides only the 512x256/4colors and 256x256/8colors display, but toggling F12, you may get this on the whole screen with approximately the same aspect ratio than a real QL.

I remember that QPC provided for the two display modes of the QL, resolutions up to the hardware capacity (meaning 800x600/4colors and 400x600/8colors). Now I see that QPC2 has a lot more display options and I have to hack/learn all over again...

WARNING :

I tried to put both emulators on the same USB mem-plug (in the spirit of Dilwyn's QOS : QL on a stick), and have them share the same primary "qxl.win", thus hopingly using the same "boot" file (shown some posts above). But for some reasons that I still have to analyse, this SuperBasic program - working all right on real QLs and with Qemulator - does not with QPC2 !!! Although I tried to differentiate initialisations by checking if VER$ would return "HBA" (meaning QPC2) or not (meaning Qemulator).

So, provisorily I wrote this simple boot :

100 IF VER$="HBA" THEN
110 PRINT#0,"BOOTING QPC-SMSQ/E -> from file FLP1_BOOT_Qpc"
120 ELSE
130 LRUN FLP1_BOOT_Qem
140 END IF


which LRUNs all right the old BOOT renamed BOOT_Qem on Qemulator, and for the moment does nothing but print a message on QPC2. But I will code/check progressively a new/suitable BOOT_Qpc (maybe even a better one - using the novelties of SMSQ/E ?)

Questions :

As I want to program for QPC2-SMSQ/E, not only in SBasic (replacing SuperBasic), but also with assembler (either plain... or within other programming tools like C, Forth, etc.), does the claim of 99.9% compatibility with Qdos software mean that my documentation (QL advanced user guide - Adrian Dickens and QDOS/QPTR reference guide - Jochen Merz & al.) of Qdos traps, etc. might be still valid with SMSQ/E ?

Do you know ways of complementing this documentation with QPC2-SMSQ/E specifics : also display mapping (and workings) of all the new display modes ?


BYE Paul


May the FORTH be with you !
POLKa
Post Reply