
QSTAR 2
Re: QSTAR 2
Sadly, no time to quibble. I have to pack. Important boat to catch tomorrow - heading for Kiel.. 

Per
I love long walks, especially when they are taken by people who annoy me.
- Fred Allen
I love long walks, especially when they are taken by people who annoy me.
- Fred Allen
Re: QSTAR 2
I didn't catch this, but my little boot program mock-up that runs both versions of QStar on one microdrive actually didn't work without the ROM version of Toolkit 2 installed (I had done it in an emulator, though I thought I had tested it by configuring with 128K and no ROM add-ons...curious). I use its FTEST to check for file existence (value -7 if the file isn't there) but I guess I had both the ROM version and the soft-loaded version running and the ROM version must have taken precedence. According to online documentation, FTEST is supposed to return -7 if the file doesn't exist, but on the soft-loaded version that I use (2.12) it returns -16. Was that changed at some point in Toolkit 2's history?
Edit: I fixed the zip file form my earlier post (now checking if <> 0 instead of =-7).
Btw, from the post talking about adding a progress bar for loading BASIC (viewtopic.php?t=4826), it got me thinking that this could be a way to at least solve the problem of re-loading the soft-loaded version of Toolkit2 multiple times. I haven't tried it but in the below code I took out the line number at 35 so it loads Toolkit 2 initially but if you run the BASIC again (i.e. once you quit the game) it won't do another RESPR (you could even get rid of line numbers for 15 through 30 so it won't re-assign the arrays or ask for the device).
Edit: the first time I do a FTEST for a file that doesn't exist with Toolkit 2.12, it spins my MDV2 drive. Is that normal?
Edit: I fixed the zip file form my earlier post (now checking if <> 0 instead of =-7).
Btw, from the post talking about adding a progress bar for loading BASIC (viewtopic.php?t=4826), it got me thinking that this could be a way to at least solve the problem of re-loading the soft-loaded version of Toolkit2 multiple times. I haven't tried it but in the below code I took out the line number at 35 so it loads Toolkit 2 initially but if you run the BASIC again (i.e. once you quit the game) it won't do another RESPR (you could even get rid of line numbers for 15 through 30 so it won't re-assign the arrays or ask for the device).
Code: Select all
10 REMark Loader for QStar
15 DIM qr$(4,11):qr$(1)="QStar_exe":qr$(2)="best_dat":qr$(3)="levels_dat":qr$(4)="sprites_dat"
20 DIM q1$(4,12):q1$(1)="QStar1_exe":q1$(2)="best1_dat":q1$(3)="levels1_dat":q1$(4)="sprites1_dat"
25 DIM q2$(4,12):q2$(1)="QStar2_exe":q2$(2)="best2_dat":q2$(3)="levels2_dat":q2$(4)="sprites2_dat"
30 PRINT #0,"Device? ";:INPUT #0,dev$
m=RESPR(17396):LBYTES dev$&"tk2_bin",m:CALL m+1380
40 MODE 8:INK #1,2:PAPER #1,205:WINDOW #1,512,256,0,0:CSIZE #1,2,1:CLS #1
45 LBYTES dev$&"title_dat",131072
50 AT 4,4:PRINT "Two modes of play:"
55 AT 6,4:PRINT "F1 - Switch player (25 levels)"
60 AT 7,4:PRINT "F2 - Switch positions (10 levels)"
65 key=CODE(INKEY$(-1)):IF key=232 THEN GO TO 90:END IF :IF key=236 THEN GO TO 125:END IF :GO TO 65
70 :
75 REMark Message
80 AT 9,4:PRINT "Preparing game, please wait..."
85 RETurn
90 REMark Setup QStar1
95 GO SUB 75
100 IF FTEST(dev$&q2$(1))<>0 THEN GO SUB 150
105 IF FTEST(dev$&qr$(1))<>0 THEN GO SUB 110: END IF :GO TO 160
110 FOR i=1 TO 4: RENAME dev$&q1$(i) TO dev$&qr$(i):NEXT i: RETurn
115 FOR i=1 TO 4: RENAME dev$&qr$(i) TO dev$&q1$(i):NEXT i: RETurn
120 :
125 REMark Setup QStar2
130 GO SUB 75
135 IF FTEST(dev$&q1$(1))<>0 THEN GO SUB 115
140 IF FTEST(dev$&qr$(1))<>0 THEN GO SUB 145: END IF :GO TO 160
145 FOR i=1 TO 4: RENAME dev$&q2$(i) TO dev$&qr$(i):NEXT i: RETurn
150 FOR i=1 TO 4: RENAME dev$&qr$(i) TO dev$&q2$(i):NEXT i: RETurn
155 :
160 REMark Run QStar
165 EXEC_W dev$&qr$(1);dev$
Edit: the first time I do a FTEST for a file that doesn't exist with Toolkit 2.12, it spins my MDV2 drive. Is that normal?
Re: QSTAR 2
-7 NOT FOUND (QDOS & SMS)bwinkel67 wrote: Wed May 15, 2024 7:42 am I didn't catch this, but my little boot program mock-up that runs both versions of QStar on one microdrive actually didn't work without the ROM version of Toolkit 2 installed (I had done it in an emulator, though I thought I had tested it by configuring with 128K and no ROM add-ons...curious). I use its FTEST to check for file existence (value -7 if the file isn't there) but I guess I had both the ROM version and the soft-loaded version running and the ROM version must have taken precedence. According to online documentation, FTEST is supposed to return -7 if the file doesn't exist, but on the soft-loaded version that I use (2.12) it returns -16. Was that changed at some point in Toolkit 2's history?
Edit: I fixed the zip file form my earlier post (now checking if <> 0 instead of =-7).
This error message is generally issued by file-related commands (eg. LOAD) if either the supplied device name or file name do not exist.
-16 BAD OR CHANGED MEDIUM(QDOS) - MEDIUM CHECK FAILED(SMS)
This message occurs when you try to read or write to a medium and an error occurs when the computer tries to verify the data being read or written.
When trying to write to microdrives, it will also signify when a microdrive is read only, due to a bug in the QL’s hardware.
Re: QSTAR 2
Thank you Andrew. So this must be a vDrive thing then. I only ever get a -16 when running my little boot loader on my actual QL where it is trying to read off of vDrive. It works as expected but when FTEST looks for a file that doesn't exist it flags it as with the -16 not the -7. In any case, the <> 0 covers both cases.Andrew wrote: Wed May 15, 2024 12:24 pm -7 NOT FOUND (QDOS & SMS)
This error message is generally issued by file-related commands (eg. LOAD) if either the supplied device name or file name do not exist.
-16 BAD OR CHANGED MEDIUM(QDOS) - MEDIUM CHECK FAILED(SMS)
This message occurs when you try to read or write to a medium and an error occurs when the computer tries to verify the data being read or written.
When trying to write to microdrives, it will also signify when a microdrive is read only, due to a bug in the QL’s hardware.
Any idea why FTEST also spins mdv2_ after its first use when checking for the existence of a file on mdv3_ through mdv8_?
-
- Font of All Knowledge
- Posts: 4636
- Joined: Mon Dec 20, 2010 11:40 am
- Location: Sunny Runcorn, Cheshire, UK
Re: QSTAR 2
Hi,
The Toolkit 2 defaults usually to:
DATA_USE "MDV2_"
PROG_USE "MDV1_"
This can be checked with:
PRINT DATAD$
PRINT PROGD$
If there is no device entered on the command line, the Toolkit 2 default is used.
This might explain the activity on MDV2_
Just change the DATAD and PROGD definitions to something like:
DATA_USE "MDV1_"
PROG_USE "MDV1_"
Should maybe solve the problem.
The Toolkit 2 defaults usually to:
DATA_USE "MDV2_"
PROG_USE "MDV1_"
This can be checked with:
PRINT DATAD$
PRINT PROGD$
If there is no device entered on the command line, the Toolkit 2 default is used.
This might explain the activity on MDV2_
Just change the DATAD and PROGD definitions to something like:
DATA_USE "MDV1_"
PROG_USE "MDV1_"
Should maybe solve the problem.
Regards,
Derek
Derek
Re: QSTAR 2
If you note in the code, the FTEST specifically hit up an existing device (i.e. microdrive), since otherwise it would crash as it couldn't load Toolkit 2 from that same device. Only the file is missing, so default devices that Toolkit 2 sets is not the issue due to specified device not existing.Derek_Stewart wrote: Thu May 16, 2024 8:35 am If there is no device entered on the command line, the Toolkit 2 default is used.
Re: QSTAR 2
I posted a follow up video short where I show QStar 2 this week. It was recorded a few months ago when I was recovering from COVID :-/
https://www.youtube.com/watch?v=w4t-3neTDhE
https://www.youtube.com/watch?v=w4t-3neTDhE
Re: QSTAR 2
Thank you for such an explanation!Derek_Stewart wrote: Thu May 16, 2024 8:35 am Hi,
The Toolkit 2 defaults usually to:
DATA_USE "MDV2_"
PROG_USE "MDV1_"
This can be checked with:
PRINT DATAD$
PRINT PROGD$
If there is no device entered on the command line, the Toolkit 2 default is used.
This might explain the activity on MDV2_
Just change the DATAD and PROGD definitions to something like:
DATA_USE "MDV1_"
PROG_USE "MDV1_"
Should maybe solve the problem.
Some people were telling me some issues related with similar behavior and I didn't know why that happened.
Re: QSTAR 2
Andrew, I posted yet another follow up video to your games. This was on how I used SuperBASIC to create a single game out of the two versions of QSTAR. The focus was less on the games and more on how the QL's built-in language is good for scripting. But still, more people will hopefully get a chance to see your amazing game, and maybe try it on an emulator.
https://youtube.com/watch?v=9Ajfj-MbZMY
https://youtube.com/watch?v=9Ajfj-MbZMY
Re: QSTAR 2
I saw the video - I like the way you explain what you are doing there, it's very educative.bwinkel67 wrote: Thu Oct 17, 2024 7:55 pm Andrew, I posted yet another follow up video to your games. This was on how I used SuperBASIC to create a single game out of the two versions of QSTAR. The focus was less on the games and more on how the QL's built-in language is good for scripting. But still, more people will hopefully get a chance to see your amazing game, and maybe try it on an emulator.
I think that I have a much shorter way to create a single game, but that is not so good for explaining the QL Basic
