Pluggy Reloaded

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

Re: Pluggy Reloaded

Post by at67 »

Jalecko wrote: 05 Sep 2020, 11:53 Ok so i figured out how that works but could it be possible to make a gt1 file that asks the promicro a list of all the available software
When you select it then the arduino could run a altered babelfish sketch that first resets the gigatron then opens the loader and then writes the requested software to ram.
*EDIT*
I had a re-think about this and the piggy back method probably would work, the SD card loader would still need to be stored in ROM, (just like any other vCPU menu application), and it could hand off control to the normal loading mechanism once it had communicated with Babelfish as to it's intentions.

The SD card loader needs to be in ROM so that you aren't forced to upload the SD card loader through Babelfish from a host PC each time you want to query the SD card from the Gigatron. i.e. For me the entire purpose of this is to detach the Gigatron from a host and have the Gigatron be able to query and access the SD card reader itself in a stand-alone fashion, (which is what I assume you were asking for in the first place).
*EDIT*

The Gigatron is now capable of sending data to the Arduino and having Babelfish act on it to send commands to Babelfish to list and/or load .gt1 files from SD card would be doable from vCPU code; but there are a number of non trivial issues that would need to be resolved first.

TLDR: It is possible, but it would require a re-write of the current loader and it's loading mechanism and therefore a ROM firmware update; there is no place in the default memory map that a new SD card loader could be hidden that current vCPU software doesn't overwrite. The only safe place to store and execute an SD loader is in the same video ram area that the current loader is using.

The current loading mechanism works in the following way:

1) The loader, (which is vCPU code that is run from the main menu), is loaded into video ram and executed; it uses variable space from 0x30 to 0x38 and stack space from 0xC0 to 0xFF, so no vCPU code may use static data in these address ranges, (currently only Tetronis and Bricks use static data in zero page that I am aware of, but they have been modified to avoid these address ranges https://github.com/kervinck/gigatron-rom/issues/41).

2) The loader also uses a buffer within video ram for receiving Arduino data, (you can visually see the data being loaded).

3) There are a number of programs that load data directly into video ram, (i.e. static data at load time), usually images and graphics data, e.g. Pucmon disables some scanlines and uses them for code.

4) Currently all vCPU software must avoid the areas used by loader's code/data/vars, (both zero page and video ram), otherwise the loader will be potentially overwritten mid load and cause mayhem and havoc.

5) There is no area of memory other than those that I have described that is safe from vCPU code/data, i.e. current applications can and do load into every nook and cranny of the memory map. So there is no memory available to hide, store or execute a new loader.

6) The only real solution is to modify the current loader and allow it to be able to send commands to Babelfish for SD card directory listings and .gt1 files. This would require a ROM firmware update as the vCPU code for loader lives in the firmware ROM, (it is copied to video RAM and executed when you choose the loader menu option).

Using a .gt1 file, (vCPU code), as you suggest as a piggy back loader mechanism on top of the current loader would work only when the application you were trying to load did not clash with the new loader. i.e. you have to store the new loader in memory somewhere and then execute it. The problem is that there is nowhere left in memory that is safe from loaded/loading vCPU code/data.
Jalecko
Posts: 11
Joined: 23 Aug 2020, 10:47

Re: Pluggy Reloaded

Post by Jalecko »

I was more thinking of an extra button connected to the arduino that would first reset the gigatron and then boot up the loader and then would enter into a custom command line application loaded from the arduino eeprom where you could type the name of an application and then execute it where the arduino would reset the gigatron again and open up the loader and then would execute the requested program

if its possible it could have the loader inside the command line program
at67
Site Admin
Posts: 647
Joined: 14 May 2018, 08:29

Re: Pluggy Reloaded

Post by at67 »

Jalecko wrote: 06 Sep 2020, 20:12 I was more thinking of an extra button connected to the arduino that would first reset the gigatron and then boot up the loader and then would enter into a custom command line application loaded from the arduino eeprom where you could type the name of an application and then execute it where the arduino would reset the gigatron again and open up the loader and then would execute the requested program

if its possible it could have the loader inside the command line program
You could do something like this, Babelfish allows the piggybacking of custom .gt1 payloads within the Arduino's EEPROM, (the regular Babelfish has a number of .gt1 files loaded in the EEPROM dependent on the Arduino type). Norgate's version of Babelfish disables all of the piggybacked .gt1 files except for Tiny BASIC, thus leaving 28672-26348 = 2324 bytes free for a .gt1 SD card lister/reader/loader.

My only suggestion would be to use a controller/keyboard button/key combo, (Babelfish can detect PS2 and controller combos), to initialise it rather than an extra button, this would allow existing Pluggy Reloaded users to take advantage of this utility.

P.S. I might have a go at whipping up a SD card lister/loader in gtBASIC, if you're not going to attempt this yourself?

P.P.S. This requires some modification of Babelfish dependent on how far you want to take this idea, i.e. you could fully implement it in Babelfish without the need for a .gt1 file by using Babelfish's Gigatron text routine that piggybacks onto loader to display the SD card's contents, etc. This would be slow though as each pixel of each character has to be sent across the controller port. (Run loader then hit CTRL-F1 to get an idea of what I mean).
Jalecko
Posts: 11
Joined: 23 Aug 2020, 10:47

Re: Pluggy Reloaded

Post by Jalecko »

my current idea would be where where you could load the sd loader program from arduino memory into loader with CTRL-f2 and then you would get a command line similar to BASIC where you would insert the name of the software.

I don't have much experience with programming for the gigatron yet nor do i know how to send a string of data containing a request to arduino to reboot into the loader and load in the requested software.

I do know this will require some changes to Babelfish to pick up those signals in the arduino sketch.
phxmark
Posts: 3
Joined: 14 Nov 2020, 18:39

Re: Pluggy Reloaded

Post by phxmark »

Are any of these boards available? I would like to purchase one. Thanks.
norgate
Posts: 50
Joined: 20 Oct 2019, 16:50

Re: Pluggy Reloaded

Post by norgate »

Yes, I still have a couple of boards available. Shipping outside of the EU can however still be very slow or expensive right now due to Covid. If you PM me your location I can give you further information. Price for the Kit is €25 + shipping.
phxmark
Posts: 3
Joined: 14 Nov 2020, 18:39

Re: Pluggy Reloaded

Post by phxmark »

Currently I cannot do any PM as I just joined the forum. I am in Glendale, Arizona, USA. Zipcode 85306.
norgate
Posts: 50
Joined: 20 Oct 2019, 16:50

Re: Pluggy Reloaded

Post by norgate »

Thanks phxmark, you should be able to receive my PM and respond via email.
zamp
Posts: 3
Joined: 01 Sep 2018, 01:37

Re: Pluggy Reloaded

Post by zamp »

If you have another, I'd like one too. And I also can't PM yet. I'm in in Geneva, NY (ZIP code 14456), USA.
--
Ron Pool
Finger Lakes, NY State, United States
norgate
Posts: 50
Joined: 20 Oct 2019, 16:50

Re: Pluggy Reloaded

Post by norgate »

Sent you a PM as well
Post Reply