Programming without vCPU

Using, learning, programming and modding the Gigatron and anything related.
Forum rules
Be nice. No drama.
Post Reply
Maniccyberdog
Posts: 14
Joined: 11 Nov 2018, 13:18

Programming without vCPU

Post by Maniccyberdog »

Hi all,
Just got my kit! I would like to program without using the vCPU, just using the basic instruction set. Is this possible via the loader? Would I need to reprogram the ROM? I have one of these http://wiki.seeedstudio.com/LinkIt_Smar ... #resources Thinking that it may work as a one-stop-shop for all tools, as it has an Arduino and will run python. Any ideas from the community on how to use it welcome!

Andy
User avatar
marcelk
Posts: 488
Joined: 13 May 2018, 08:26

Re: Programming without vCPU

Post by marcelk »

Hello, welcome to the club! In summary:
  • Native 8-bit code runs from the EPROM indeed. So it needs to be erased with UV light first, and then reprogrammed in a chip programmer. If you want something more interactive, you might replace that IC with a ROM emulator of some kind. At67 has built a ROM switcher for this own experiments. Personally I do all my code testing at this level first in one of the Gigatron emulators.
  • 16-bit vCPU code runs from RAM. Such code can be loaded into memory through the Loader application, toggled in with a keyboard, or loaded from an image already stored in the EPROM. The last is how all of the built-in applications work: the EPROM acts for the most part as a ROM disk for vCPU applications.
We have a section on this in the FAQ as well ("Can I program it in assembly?").
Maniccyberdog
Posts: 14
Joined: 11 Nov 2018, 13:18

Re: Programming without vCPU

Post by Maniccyberdog »

Thanks, may try looking at vCPU first. Does anyone have a complied version of the emulator? Tried this afternoon, with VS17 got loads of errors do do with SDL linker refs. :(

I’m still trying to get my head around ‘stuff’. I would like to code in 16bit asm, and load this to RAM for execution. I had a look at github, and can see lots of tools but not sure where to start?
User avatar
marcelk
Posts: 488
Joined: 13 May 2018, 08:26

Re: Programming without vCPU

Post by marcelk »

Maniccyberdog wrote: 13 Nov 2018, 19:03 I’m still trying to get my head around ‘stuff’. I would like to code in 16bit asm, and load this to RAM for execution. I had a look at github, and can see lots of tools but not sure where to start?
I'm helpless on Windows, so I can only provide general guidance here now. Basically, there are 2 steps to guide yourself through:

1. Build a GT1 file. GT1 is a very simple object file format for vCPU programs.

2. Transfer a GT1 file into Gigatron RAM to run it

These two steps can be mastered independently, because there are plenty of pre-compiled GT1 files in the archive already. GT1 files are supported by most of the emulators: at67's tools supports it, and also the online javascript emulator on our site supports it. And the Arduino code supports it.

About 1: Build a GT1 file

1a. From GCL: Personally I didn't use any assembler for my applications, I've used our own GCL notation instead. That's a bit more Linux/OSX and command-line oriented. If going down this road (or rabbit hole...), study my Makefile, Apps/Blinky.gcl and compilegcl.py to transform a GCL into a GT1. It uses Python 2.7, not Python 3. The GCL notation is documented in Docs/GCL-language.txt. The same document also describes the vCPU instruction set if you scroll down a bit.

1b. From VASM: The more Windows-leaning hackers seem to have used at67's assembler and tooling, providing a more traditional environment. You would have a VASM file and transform it into a GT1. Bricks, Tetronis and Frogstroll were written with this. But I never got any of this tooling to run in OSX, and I haven't tried it on Linux, although many others have done so. It should all work on Linux/Windows, but some more setup instructions would definitely help. Here we really depend on any of the current users, or at67...

[Note: GCL doesn't exist because we think it's in any way "better" than assembly. It primarily exists because it was much quicker to get the first Gigatron apps working almost one year ago: the notation is very simple to process for the compiler, especially the early revisions. It saved a lot of time until at67's full assembler arrived on the scene a couple of months later.]

About 2: Transfer a GT1 file into Gigatron

To connect my laptop to a Gigatron, I use either an Arduino Uno or an Arduino Micro, depending on my mood. These are inexpensive microcontroller boards used to teach kids about programming. The Arduino Nano should also work, but I was unlucky with the very cheap Arduino Nano clones (something about USB support is broken in the clones). The key element here is the Arduino sketch (=Arduino program) in our GitHub archive: Utils/BabelFish/BabelFish.ino is a multifunctional tool to interact with the Gigatron over the game controller port, much like a Swiss army knife. In fact, even the Pluggy McPlugface PS/2 keyboard adapter runs BabelFish. [BTW: Xbx/xxxbxxx has been successful in hooking up a Raspberry Pi to the Gigatron instead of an Arduino compatible device.]

2a. Using PROGMEM: With BabelFish there are two ways to get a GT1 into the Gigatron, both explained in its help menu and in the top of the BabelFish.ino file: PROGMEM or file transfer. PROGMEM means that the GT1 image is embedded as part of the Arduino sketch, and thus put into the Arduino using the Arduino IDE. (Pluggy McPlugface uses this for TinyBASIC...). From there the Arduino can transfer it into the Gigatron with a single command.

2b. Using sendFile.py: For the second method, file transfer, you don't need to reprogram the Arduino each time you have a new GT1 file. Instead you use the Utils/sendFile.py Python program on your PC/laptop to transmit the GT1 file directly over USB, through the Arduino, into the Gigatron. The important thing to know about it here is that sendFile.py is also a Python 2.7 thing, not Python 3.

Hope that helps kickstart your quest?

[ Once a GT1 file is finished developing, we can go to a next level and freeze it into a ROM image and put it in the Gigatron menu. But that is again another phase. ]
Maniccyberdog
Posts: 14
Joined: 11 Nov 2018, 13:18

Re: Programming without vCPU

Post by Maniccyberdog »

Thanks, I now understand - I’m off down the rabbit hole :D
I’ll contact at67 for help building the emulator
Post Reply