cant run files using qubide

Helpful tips and guides, also new users can ask for help here.
gillvm
ROM Dongle
Posts: 8
Joined: Mon Aug 31, 2015 10:13 pm

cant run files using qubide

Post by gillvm »

Hi,
I have recently got a ql and decided to dabble with qubide with minerva, tk2 and an sd card adapter.

After a lot of hassle I managed to get this all working and figured out how to format and transfer files via the sd card using habi's image editing software.

So I can see files on the ql but I can seem to run them, (apart from psion chess which works fine) I usually get an error like bad line (or something similar). A program that I really want to run is Spooks (a pacman clone). I can see that this works on the ql emulator but when I run the same commands on the ql it doesnt work.

I am guessing this is a memory issue? Or I am not using the right command syntax

Can anyone help please, btw I am using the 'lrun' command.

Thnaks

Vincent


RWAP
RWAP Master
Posts: 2834
Joined: Sun Nov 28, 2010 4:51 pm
Location: Stone, United Kingdom
Contact:

Re: cant run files using qubide

Post by RWAP »

It sounds as though you need to alter the device name in LRUN - or is it possibly to do with how you got the software onto the SD card - did you unzip it on the QL or on a PC for example?


User avatar
tofro
Font of All Knowledge
Posts: 2685
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: cant run files using qubide

Post by tofro »

gillvm wrote: So I can see files on the ql but I can seem to run them, (apart from psion chess which works fine) I usually get an error like bad line (or something similar). A program that I really want to run is Spooks (a pacman clone). I can see that this works on the ql emulator but when I run the same commands on the ql it doesnt
Vincent,

can you please be a bit more specific on exactly what you typed and exactly what the response was - If we know a bit more on what type of (S*BASIC, i assume) commands you get what exact response - Otherwise, most attempts to help will just be speculation.

If your QL doesn't crash, it is most probably no memory issue.

Tobias


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
User avatar
dilwyn
Mr QL
Posts: 2753
Joined: Wed Dec 01, 2010 10:39 pm

Re: cant run files using qubide

Post by dilwyn »

gillvm wrote:Hi,
I have recently got a ql and decided to dabble with qubide with minerva, tk2 and an sd card adapter.
After a lot of hassle I managed to get this all working and figured out how to format and transfer files via the sd card using habi's image editing software.
So I can see files on the ql but I can seem to run them, (apart from psion chess which works fine) I usually get an error like bad line (or something similar). A program that I really want to run is Spooks (a pacman clone). I can see that this works on the ql emulator but when I run the same commands on the ql it doesnt work.
I am guessing this is a memory issue? Or I am not using the right command syntax
Can anyone help please, btw I am using the 'lrun' command.
Thnaks
Vincent
As ToFro said, things can get complex and 100% accuracy in the description of the problem is vital for correct diagnosis. Unfortunately, when it comes to QL, if you know enough to explain the problem with 100% accuracy, you generally know enough to solve the problem without third party help, that's my experienceof running Quanta Helpline anyhow.
When you get the error message 'Bad Line' after using a LRUN command, it generally means you are trying to run something which is not really a BASIC program after all. BASIC does some checking on loading a program, finds it's not a fully valid line and flags it up as a 'bad line'. Sometimes, you find the keyword 'MISTake' added to these lines if they are vaguely BASIC-like but not quite valid.
Briefly, there's more than one type of QL 'program' as far as you are concerned
1. BASIC programs, which are loaded or started with commands like LOAD or LRUN.
2. Machine code programs, called JOBS, which are started with commands such as EXEC or EXEC_W
3. Machine code routines (as opposed to programs) which may be loaded using a command such as LBYTES and started with a CALL command.
To make matters more complex, some programs are started by a BOOT command written in BASIC, these then chain in a program started with an EXEC or EXEC_W program.
To make matters even more complex, where emulators such as Q-emulator are concerned, the 'EXEC' or 'EXEC_W' programs are modified when stored on a non-QL format medium such as a Windows hard disk. The reasons are complex, but basically operating systems such as Windows don't understand the file headers of a QL program file and basically just lose or forget it (a prime example is when you unzip a zip file created on a QL, but unzipped in Windows using Windows itself, WinZip, 7-zip or similar programs), so the poor emulator or QL system on which these program files end up are trying to make sense of a program which to all intents have a part missing.
Emulators and some hard disk systems modify these files to integrate the part which goes missing into the body of the file. Normally, this is completely invisible to you the user and this modified file is created and decoded automatically depending on where the file is copied to - copy a file from a directory stored on a Windows hard disk to a QL format floppy disk on a PC and the modification is removed). Where this goes wrong is where such a modified file gets copied from somewhere where it's been stored in a modified format by an emulator, independently of the emulator, the 'modification' does not get undone so the poor QL ends up without a clue what's going on and all sorts of strange errors crop up.
Without a full understanding of how this works, it'll be hard for inexperienced users to work it out. One handy rule of thumb is that ONLY programs started with EXEC/EXEC_W commands get affected in this way, BASIC programs are not affected. So, if on trying to LRUN a program you get BAD LINE type error messages it means either the program is corrupted and damaged, or you are trying to LRUN something which is actually not a BASIC program.
For many older commercial programs, a quick way of checking for this is to look at a program called BOOT in the software concerned. You can either LOAD and LIST it, or COPY_N filename TO SCR to view it. Within the boot program, have a look to see if you can find EXEC or EXEC_W (or sometimes EX or EW equivalents on programs which require the Toolkit 2). This can give a clue as to whether the "program" you are trying to run needs to be started with EXEC (or equivalent) or LRUN.
Another way of checking is to look at the extension of a filename. Early programs often did not use extensions to the filename (e.g. QUILL). Most BASIC programs will have an extension such as _bas (e.g. MDV1_MYPROGRAM_BAS). These can almost always be started with an LRUN command. Programs which have filenames ending in _task, _bin, _obj and a few other extensions which imply 'machine code' will usually get started with EXEC-type commands.

The above is a bit of background which might be heavy going for an inexperienced QL user, but hopefully might give you a bit of a clue as to what's going on. As Tobias said, it is hard to know exactly what's going wrong without more information. Unfortunately, the endless permutations of modern QL systems mean that whereas back in 1984, this might have been a lot easier to diagnose, nowadays we are blessed with so many QL-compatible systems with consequently so many more combinations of things which can go wrong!


gillvm
ROM Dongle
Posts: 8
Joined: Mon Aug 31, 2015 10:13 pm

Re: cant run files using qubide

Post by gillvm »

dilwyn wrote:
gillvm wrote:Hi,
I have recently got a ql and decided to dabble with qubide with minerva, tk2 and an sd card adapter.
After a lot of hassle I managed to get this all working and figured out how to format and transfer files via the sd card using habi's image editing software.
So I can see files on the ql but I can seem to run them, (apart from psion chess which works fine) I usually get an error like bad line (or something similar). A program that I really want to run is Spooks (a pacman clone). I can see that this works on the ql emulator but when I run the same commands on the ql it doesnt work.
I am guessing this is a memory issue? Or I am not using the right command syntax
Can anyone help please, btw I am using the 'lrun' command.
Thnaks
Vincent
As ToFro said, things can get complex and 100% accuracy in the description of the problem is vital for correct diagnosis. Unfortunately, when it comes to QL, if you know enough to explain the problem with 100% accuracy, you generally know enough to solve the problem without third party help, that's my experienceof running Quanta Helpline anyhow.
When you get the error message 'Bad Line' after using a LRUN command, it generally means you are trying to run something which is not really a BASIC program after all. BASIC does some checking on loading a program, finds it's not a fully valid line and flags it up as a 'bad line'. Sometimes, you find the keyword 'MISTake' added to these lines if they are vaguely BASIC-like but not quite valid.
Briefly, there's more than one type of QL 'program' as far as you are concerned
1. BASIC programs, which are loaded or started with commands like LOAD or LRUN.
2. Machine code programs, called JOBS, which are started with commands such as EXEC or EXEC_W
3. Machine code routines (as opposed to programs) which may be loaded using a command such as LBYTES and started with a CALL command.
To make matters more complex, some programs are started by a BOOT command written in BASIC, these then chain in a program started with an EXEC or EXEC_W program.
To make matters even more complex, where emulators such as Q-emulator are concerned, the 'EXEC' or 'EXEC_W' programs are modified when stored on a non-QL format medium such as a Windows hard disk. The reasons are complex, but basically operating systems such as Windows don't understand the file headers of a QL program file and basically just lose or forget it (a prime example is when you unzip a zip file created on a QL, but unzipped in Windows using Windows itself, WinZip, 7-zip or similar programs), so the poor emulator or QL system on which these program files end up are trying to make sense of a program which to all intents have a part missing.
Emulators and some hard disk systems modify these files to integrate the part which goes missing into the body of the file. Normally, this is completely invisible to you the user and this modified file is created and decoded automatically depending on where the file is copied to - copy a file from a directory stored on a Windows hard disk to a QL format floppy disk on a PC and the modification is removed). Where this goes wrong is where such a modified file gets copied from somewhere where it's been stored in a modified format by an emulator, independently of the emulator, the 'modification' does not get undone so the poor QL ends up without a clue what's going on and all sorts of strange errors crop up.
Without a full understanding of how this works, it'll be hard for inexperienced users to work it out. One handy rule of thumb is that ONLY programs started with EXEC/EXEC_W commands get affected in this way, BASIC programs are not affected. So, if on trying to LRUN a program you get BAD LINE type error messages it means either the program is corrupted and damaged, or you are trying to LRUN something which is actually not a BASIC program.
For many older commercial programs, a quick way of checking for this is to look at a program called BOOT in the software concerned. You can either LOAD and LIST it, or COPY_N filename TO SCR to view it. Within the boot program, have a look to see if you can find EXEC or EXEC_W (or sometimes EX or EW equivalents on programs which require the Toolkit 2). This can give a clue as to whether the "program" you are trying to run needs to be started with EXEC (or equivalent) or LRUN.
Another way of checking is to look at the extension of a filename. Early programs often did not use extensions to the filename (e.g. QUILL). Most BASIC programs will have an extension such as _bas (e.g. MDV1_MYPROGRAM_BAS). These can almost always be started with an LRUN command. Programs which have filenames ending in _task, _bin, _obj and a few other extensions which imply 'machine code' will usually get started with EXEC-type commands.

The above is a bit of background which might be heavy going for an inexperienced QL user, but hopefully might give you a bit of a clue as to what's going on. As Tobias said, it is hard to know exactly what's going wrong without more information. Unfortunately, the endless permutations of modern QL systems mean that whereas back in 1984, this might have been a lot easier to diagnose, nowadays we are blessed with so many QL-compatible systems with consequently so many more combinations of things which can go wrong!
Hi all,
Wow didnt expect such a response so quickly to my issue!
Unfortunately I am still unable to get things working
I have tried unzipping via Habi's image editor and standard unzip programs but it doesnt seem to make a difference.
As requested here are the exact steps I am taking to load a program (in this case its spook):
1. Downloaded the file (http://terdina.net/ql/soft/Spook.zip) unzipped it and transferred it onto the sd card using the habi software.
2. On the ql: dir win1_spook
3. This lists out the following:
spook_boot
spook_cd
spook_cds
4. type : copy_n win1_spook_boot to scr
5. check through listing and there is no reference to exec, exec_w, ex, ew, etc
6. type : lrun win1_spook_boot
7. screen refreshes then get: At line 110;1 Out of memory
8. Loading the same files on qlemulator seems to work fine.

I am using Qubide 1.56 Qjump toolkit 2.20

Hope this helps, if you need anything else please let me know

Thanks in advance for all you continuing help

Vincent


User avatar
tofro
Font of All Knowledge
Posts: 2685
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: cant run files using qubide

Post by tofro »

Ah. That brings us closer.....

Can you do the following, please:
6. type : lrun win1_spook_boot
7. screen refreshes then get: At line 110;1 Out of memory
8. Enter "PRINT D" and come back with the result.

The program has been written for an unexpanded (with regards to mass storage, not memory) QL.
QubIDE (and, apparently, some of your extensions) need some storage in memory that is not taken into account in the RESPR command in line 110. If you come back with the result, we might be able to adjust the memory reserve command to your specific system.

For starters, (and, as a wild guess) you could try to change line 100 to

Code: Select all

100 D= PEEK_L(163868)
That would take all loaded extensions like TK2 (I assume you load that from disk) into account in the memory calculation.

Tobias


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
User avatar
tofro
Font of All Knowledge
Posts: 2685
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: cant run files using qubide

Post by tofro »

And another one - How do you start your QL? (I mean, F1,F2,F3,F4?). If you use anything but F1 or F2, the PEEKing in the BOOT program may go haywire with Minerva and would need some adaption......

Tobias


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
Derek_Stewart
Font of All Knowledge
Posts: 3932
Joined: Mon Dec 20, 2010 11:40 am
Location: Sunny Runcorn, Cheshire, UK

Re: cant run files using qubide

Post by Derek_Stewart »

Hi,

The programmer has has assumed the System Variables are static and located at 28000 Hex.

The value for D reading SV_RAMT and variable E is Ramtop - space for the programme, maybe...

So if Minerva is in ROM and the second screen is enabled by pressing F3/F4 on power up, the System variables and screen base address move. There is a Management Trap MT.INF to find the System Variables, the screen address is located in the Channel Definition block.

The problem for most BASIC programmers there is no built in functions to find new addresses, though VER$ does return the System Variable address.


Regards,

Derek
gillvm
ROM Dongle
Posts: 8
Joined: Mon Aug 31, 2015 10:13 pm

Re: cant run files using qubide

Post by gillvm »

tofro wrote:Ah. That brings us closer.....

Can you do the following, please:
6. type : lrun win1_spook_boot
7. screen refreshes then get: At line 110;1 Out of memory
8. Enter "PRINT D" and come back with the result.

The program has been written for an unexpanded (with regards to mass storage, not memory) QL.
QubIDE (and, apparently, some of your extensions) need some storage in memory that is not taken into account in the RESPR command in line 110. If you come back with the result, we might be able to adjust the memory reserve command to your specific system.

For starters, (and, as a wild guess) you could try to change line 100 to

Code: Select all

100 D= PEEK_L(163868)
That would take all loaded extensions like TK2 (I assume you load that from disk) into account in the memory calculation.

Tobias
Hi Tobias,
The value of print d is 786432.
I don't press any value when booting it just automatically chooses tv (which is I guess f2)
I will continued editing the boot file at line 100 as shown and see if I can get it to work.
Thanks Again
Vincent


jose_leandro
ROM Dongle
Posts: 47
Joined: Sat Jun 22, 2013 8:49 am

Re: cant run files using qubide

Post by jose_leandro »

Hi

I think you are not doing well the process to pass program to Qubide.

I say that because you said:
gillvm wrote: I have tried unzipping via Habi's image editor and standard unzip programs but it doesnt seem to make a difference.
You never can use PC winzip because it destroy the QL header and then it happens what you say, the QL doesn't recognize the files you pass it. With Habi's program you can also loss this headers if you do it right way.

Please, read the tutorials but basically it is:

- Download the zip or img file you want.
- Open it with Habi's program.
- Go to Options, and check that "Extract" and "QL" options are in use
- Extract files to PC

- Put your CF/SD/DOM device and open it with Habi's program
- Go to Options, and check that "Extract" is no it use and "none" is uin use.
- Import the files

Bye

José Leandro


Post Reply