That is the only difference, SDCARD.ROM contains the actual vCPU loading code and a menu entry to access it. Whereas the older ROM's have to bootstrap the vCPU loader through Pluggy's CTRL + F1 mechanism.
sendFile.py is really simple to use and works on any of the compatible Arduino solutions, (not just Pluggy Reloaded), here's Marcel's comments lifted straight out of sendFile.pygfernval wrote: ↑05 May 2022, 00:23 - how to use the file https://github.com/kervinck/gigatron-ro ... endFile.py in a real Gigatron to transfer files between the
Gigatron and a PC? Using the pluggy reloaded board and connecting an USB cable to the Arduino Sparkfun Pro micro and the USB port of a PC?
(this creates a virtual serial port in the PC)
Code: Select all
# Examples:
#
# Utils/sendFile.py Apps/Overworld/Overworld.gt1 # Reset and starts Loader
# Utils/sendFile.py BASIC/FastLines.gtb # Also loads BASIC
# Utils/sendFile.py foo.bas # Only send text lines
# Utils/sendFile.py < foo.txt # Same...
#
# Notes:
#
# - Needs Python 3.x: Python 2.7 isn't supported any longer
# - Systems: macOS, Linux and Windows
# - Devices: Arduino Uno/Micro/Nano, SparkFun Pro Micro
# - Arduino (-compatible) must run BabelFish.ino
'R' = Sends the Reset command, BabelFish resets the Gigatron HW, (by simulating a start button press for ~2 seconds).
'L' = Sends the Loader command, BabelFish moves the cursor down 10 vertical menu positions and then presses button A, (all simulated presses).
'U' = Sends the Transfer command, BableFish now enters a state machine or protocol for receiving data from the PC and then massaging the data into the Gigatron's internal Loader format, (all through the same controller input port that the buttons were simulated on).
After each command, sendFile.py waits for either a '?' or '!' response, '?' means success and '!' means error.
Given the above you can easily write your own sendFile.py from any language that has COM/Serial port access, (which is what I did for gtemuAT67, it can also control and download to real gigatron hardware through it's UI). Here's the basics of how I do it: (I use a multi-OS 3rd party header API for COM access and SDL2 for timer/timeout support)
Code: Select all
int uploadToGiga(void)
{
if(!checkComPort()) return -1;
std::string line;
if(!sendCommandToGiga('R', line, true)) return -1;
if(!sendCommandToGiga('L', line, true)) return -1;
if(!sendCommandToGiga('U', line, true)) return -1;
int index = 0;
while(std::isdigit((unsigned char)line[0]))
{
int n = strtol(line.c_str(), nullptr, 10);
comWrite(_currentComPort, &_gt1Buffer[index], n);
index += n;
if(!waitForPromptGiga(line)) return -1;
}
return 0;
}
bool sendCommandToGiga(char cmd, std::string& line, bool wait)
{
if(!checkComPort()) return false;
char command[2] = {cmd, '\n'};
comWrite(_currentComPort, command, 2);
// Wait for ready prompt
if(wait)
{
if(!waitForPromptGiga(line)) return false;
}
return true;
}
bool waitForPromptGiga(std::string& line)
{
if(!checkComPort()) return false;
do
{
if(!readLineGiga(line)) return false;
if(size_t e = line.find('!') != std::string::npos) return false;
}
}
while(line.find("?") == std::string::npos);
return true;
}
bool readLineGiga(std::string& line)
{
if(!checkComPort()) return false;
line.clear();
char buffer = 0;
uint64_t prevFrameCounter = SDL_GetPerformanceCounter();
while(buffer != '\n')
{
if(comRead(_currentComPort, &buffer, 1))
{
if((buffer >= 32 && buffer <= 126) || buffer == '\n') line.push_back(buffer);
}
double frameTime = double(SDL_GetPerformanceCounter() - prevFrameCounter) / double(SDL_GetPerformanceFrequency());
if(frameTime > _configTimeOut) return false;
}
// Replace '\n'
line.back() = 0;
return true;
}
SDCARD functionality is great, especially for standalone operations, but when I am writing code and need to test it on real HW, nothing beats the BabelFish direct link. One click and a few seconds later I can see it running, (or not), on a real Gigatron.