Command SAVE in MSBASIC

Using, learning, programming and modding the Gigatron and anything related.
Forum rules
Be nice. No drama.
Post Reply
lb3361
Posts: 367
Joined: 17 Feb 2021, 23:07

Command SAVE in MSBASIC

Post by lb3361 »

I was playing with the native code that pulses the VGA sync to speak to Babelfish, looking for some good tests. Curiously the SAVE command in TinyBasic works, but the SAVE command MSBASIC just hangs. It turns out that this has nothing to do with my own experiments. This has been described in issue #205 https://github.com/kervinck/gigatron-rom/issues/205 for several years.

Anyway it seems that the problem is a typo in MSBASIC.gcl: the value of _SaveChar, line 1221 https://github.com/kervinck/gigatron-ro ... .gcl#L1221, should be $31fe, not $30fe, because the vCPU program counter does cross page boundaries. With this change, the command SAVE in MSBASIC no longer crashes.

I prepared a tentative patch for the dev.rom at https://github.com/lb3361/gigatron-rom/tree/pr-msbasic. The corresponding dev.rom, attached to this post, is otherwise identical to ROMv6. Here is how things go with the patch using a Pluggy connected keyboard.
  • Start MSBASIC from the main menu
  • Enter a small test program and use command SAVE and wait a dozen seconds or so.
    msbasic-save.png
    msbasic-save.png (11.84 KiB) Viewed 1831 times
  • Reset the Gigatron, start the Loader, and press CTRL+F1 to see what's on the Pluggy
  • Remember the CTRL+Fx key corresponding to the "--SAVED--" entry
  • Reset again the Gigatron, start MSBASIC, then press that CTRL+Fx key. The program should type itself...
I am going to convert the patch into a pull request. It would be nice if people could confirm that this works with other BabelFish setups such as the Pluggy Reloaded, etc.
Attachments
devrom-msbasic.zip
(440.48 KiB) Downloaded 119 times
walter
Site Admin
Posts: 161
Joined: 13 May 2018, 08:00

Re: Command SAVE in MSBASIC

Post by walter »

Nice find!
lb3361
Posts: 367
Joined: 17 Feb 2021, 23:07

Re: Command SAVE in MSBASIC

Post by lb3361 »

Alas, Hans61 reports some issues at LOAD time with his PluggyReloaded. When loading, Babelfish must be careful not to send the characters too fast otherwise MSBASIC cannot follow. This is a tricky balance. Or maybe this is something else.
lb3361
Posts: 367
Joined: 17 Feb 2021, 23:07

Re: Command SAVE in MSBASIC

Post by lb3361 »

This is now fixed. It turns out that the PluggyReloaded firmware attempts to start the Loader when one presses CTRL+Fn, sending a couple ButtonDown and a ButtonA. When loading a saved program, these codes are read by MSBASIC and cause syntax errors in cascade. Rather than fixing the firmware, I found more expedient to make MSBASIC ignore button codes in its edit line, just like TinyBASIC. Luckily the MSBASIC command GET A$ is still able to read button codes because it follows a different path.
Post Reply