gtBASIC

Using, learning, programming and modding the Gigatron and anything related.
Forum rules
Be nice. No drama.
at67
Posts: 501
Joined: 14 May 2018, 08:29

Re: gtBASIC

Post by at67 »

All good, glad you got it running!
NewTechPhobic
Posts: 7
Joined: 11 May 2022, 15:33
Location: UK

Re: gtBASIC can't get it going

Post by NewTechPhobic »

The emulator works fine opening/tranferring/emulating/running programs, I can't seem to find a way to access gtbasic. The tools file is in the gtemuat67 folder all tools are present but they do not show up on the emulator browser (I assume because they are not gbasic or gasm files). The emulator opens a command prompt window at startup but it appears to be read only. I tried calling gtbasic.exe directly at the command prompt (emulator closed) but nothing happened.
I'm not sure if the the various ctrl+(char/Fn) all work or if I'm just in the wrong mode for some of them.
Most people manage to get the emulator and tools going so I guess the problem has to be either my general lack of experience or this B awfull PC of mine that seems to break every bit of software I have, Windows now seems to consider any none microsoft product is a virus!.
at67
Posts: 501
Joined: 14 May 2018, 08:29

Re: gtBASIC

Post by at67 »

Create a file with a .gbas extension and some gtBASIC commands in your favourite editor, browse to it in the emulator using the file browser, (CTRL+B), (CTRL+H is help). Then just left click on the .gbas file.

gtBASIC is built into the emulator, so that clicking on a .gbas file while automatically fire it up, your code will be compiled and any error messages will appear in the emulator's console.

If the code compiles successfully it will automatically launch in the emulator as well. Right click does the exact same thing, but will send the result to real hardware instead of the emulator.
NewTechPhobic
Posts: 7
Joined: 11 May 2022, 15:33
Location: UK

Re: gtBASIC (some progress but...)

Post by NewTechPhobic »

I renamed the gigatron demo (gigatron.gbas) to Test .gbas just to avoid confusion. The emulator and all of it's components are in the root directory of my C drive
C:/gtemuAT67_v1.9R/tools/Test.gbas

I used ctrl+B to find Test.gbas with the emulator left clicked it and got the message below.


***********************************************************
* Compiling file 'C:/gtemuAT67_v1.9R/Test.gbas'
***********************************************************
Compiler ::initialiseMacros() : failed to open file 'C/gtemuAT67_v1.9R/tools//macros.i



The program as it came from GitHub had a header with the following defaults
_runtimePath_ "../runtime"
_codeRomType_ ROMv1

I'm guessing the first line is where I screwed up I assume this line is to tell the emulator where to go and what to do.
The second line I'm guessing only needs the rom version changing to match the hardware gigatrons rom and in the emulator.
The problem is I really do not understand the first line and how it should go together.
Do the configs for the loader need to be changed the comm port and its settings are OK , I was usure about the path for the GCL files.
Then again am I barking up the wrong tree?
at67
Posts: 501
Joined: 14 May 2018, 08:29

Re: gtBASIC (some progress but...)

Post by at67 »

NewTechPhobic wrote: 16 Jul 2022, 18:03 I renamed the gigatron demo (gigatron.gbas) to Test .gbas just to avoid confusion. The emulator and all of it's components are in the root directory of my C drive
C:/gtemuAT67_v1.9R/tools/Test.gbas
Ok, if it was me setting this up, I would have a directory structure more like this:

Code: Select all

C:/
|
+---gtemuAT67_v1.9R (folder)
|     |
|     +---gtemuAT67.exe (file)
|     +---    .
|     +---    .
|     +---    .
|     +---SDL2.dll (file)
|     |
|     |
|     +---tools (folder)
|     |     | 
|     |     +---gt1torom.exe (file)
|     |     +---    .
|     |     +---    .
|     |     +---    .
|     |     +---gtsplitrom.exe (file)
|     |
|     |
|     +---gbas (folder)
|           |
|           Test.gbas (your file)
|           |
|           +---apps (folder)
|           +---    .
|           +---    .
|           +---    .
|           +---tinybasic (folder)
|           +---README.md (file)
I've added all the gtBASIC examples and runtime to a gbas.zip DropBox link here:
https://www.dropbox.com/s/8nizl4anddihq7c/gbas.zip?dl=0

If you grab that zip file and uncompress it to your C:/gtemuAT67_v1.9R folder, then you should more or less have the directory structure I posted above, with a simple and clean structure for all the gtBASIC examples.

If you then move your Test.gbas from tools into the new gbas folder, then you will match what I have above.
NewTechPhobic wrote: 16 Jul 2022, 18:03 Compiler ::initialiseMacros() : failed to open file 'C/gtemuAT67_v1.9R/tools//macros.i
This means gtBASIC could not find that file in it's expected place, i.e. "../runtime" which in your case would translate to:

Code: Select all

C:/gtemuAT67_v1.9R/runtime/macros.i
But if you do the following:
1) setup the folder structure I posted above.
2) download the "gbas.zip" file from the new DropBox link I posted.
3) copy the "gbas" folder from "gbas.zip" to C:/gtemuAT67_v1.9R.
4) copy your "Test.gbas" file to the "C:/gtemuAT67_v1.9R/gbas" folder.
5) change the first line of "Test.gbas" from "../runtime" to "runtime".

Then the first line of "Test.gbas" will translate to:

Code: Select all

C:/gtemuAT67_v1.9R/gbas/runtime/macros.i
and gtBASIC will find the necessary runtime files it needs to compile your .gt1 file.
NewTechPhobic wrote: 16 Jul 2022, 18:03 The program as it came from GitHub had a header with the following defaults
_runtimePath_ "../runtime"
_codeRomType_ ROMv1
I'm guessing the first line is where I screwed up I assume this line is to tell the emulator where to go and what to do.
Yes, but also the runtime files are probably missing, I was a little vague in previous descriptions when I said you needed to clone/download the main gigatron repo; which is why I added the new DropBox link above for gbas.zip which contains all the gtBASIC examples and runtime.
NewTechPhobic wrote: 16 Jul 2022, 18:03 The second line I'm guessing only needs the rom version changing to match the hardware gigatrons rom and in the emulator.
Kind of, it specifies the target ROM you want to produce code for, so if you want your code to run on all possible versions of gigatrom ROM's, then you would use ROMv1, this will produce the most compatible code, but also the slowest and most inefficient code, (I don't think any active users use ROMv1 anymore). But if you specify a higher ROM, such as ROMv5a, (which most active users have upgraded to), gtBASIC will produce fast and efficient, (smaller size), code.

The emulator doesn't care, it understands all ROM's, so when testing with the emulator you can set this field to any valid ROM. Obviously on the other hand your real hardware does care, as it will only run code on ROM's upto the ROM installed on it.
NewTechPhobic wrote: 16 Jul 2022, 18:03 The problem is I really do not understand the first line and how it should go together.
For best compatibility with everyone and everything, always set it to ROMv1.
For best compatibility with most active users and a nice efficiency/speed boost, set it to ROMv5a.
NewTechPhobic wrote: 16 Jul 2022, 18:03 Do the configs for the loader need to be changed the comm port and its settings are OK , I was usure about the path for the GCL files.
You don't need to modify any of the config files if you are able to download .gt1 files to real hardware, i.e. the way you have them now sounds fine.

The path for GCL files is a different topic and I wouldn't worry about it for now, unless you want to be able to compile .gcl files, (GCL is another more low level language that you can generate .gt1 code in).
Post Reply