Gigatron

User avatar
pgimeno
Top Contributor
Posts: 669
Joined: Thu Jun 11, 2020 9:44 am
Has thanked: 246 times
Been thanked: 208 times

Gigatron

Unread post by pgimeno »

The Gigatron is a new 8-bit computer without a CPU chip - instead the CPU is implemented via multiple TTL logic chips. The component list indicates a total of 39 chips, including the necessary ones for VGA output, basic sound and NES controller input. There's a separate adapter for a PS/2 keyboard. The clock is 6.25 MHz.

Resolution is 160x120, one byte per pixel, hence video RAM takes 19200 bytes. Pixels are 2 bits per colour for a total of 64 colours; the top 2 bits of each video RAM byte are not used for video output. Total RAM is 32K, leaving 13568 bytes for the rest. BASIC uses about 4K of these, leaving 9K for user programs.

https://gigatron.io/

Most of the work is done by the software. There is an emulator of the TTL circuitry in C (no video output, just the raw signals) which takes two pages (126 lines) of code. The ROM source is here:

https://github.com/kervinck/gigatron-rom

A JavaScript emulator is also available:

https://gigatron.io/emu/

How cool would it be to have a core for that?
dshadoff
Core Developer
Posts: 534
Joined: Sun May 24, 2020 9:30 pm
Has thanked: 19 times
Been thanked: 141 times

Re: Gigatron

Unread post by dshadoff »

It looks simple enough that it could be a starter project for somebody starting in HDL.
JaguarLV
Core Developer
Posts: 28
Joined: Mon May 25, 2020 12:39 am
Been thanked: 22 times

Re: Gigatron

Unread post by JaguarLV »

Looks like someone already made a core for the DE10-Nano. It does not look like it is finished. Maybe someone can add the MiSTer framework and make it complete.

https://github.com/menloparkinnovation/menlo_gigatron
User avatar
pgimeno
Top Contributor
Posts: 669
Joined: Thu Jun 11, 2020 9:44 am
Has thanked: 246 times
Been thanked: 208 times

Re: Gigatron

Unread post by pgimeno »

Oh cool! It doesn't look like it's unfinished to me, but it's definitely not made for MiSTer. The joystick is supposed to be connected to the I/O pins, so it definitely needs some work to be ported to MiSTer, at least to be able to use the USB joysticks.
sajattack
Core Developer
Posts: 35
Joined: Sun May 24, 2020 6:50 pm
Location: BC, Canada
Has thanked: 3 times
Been thanked: 17 times
Contact:

Re: Gigatron

Unread post by sajattack »

I'm working on porting this here: https://github.com/sajattack/Gigatron_MiSTer
sajattack
Core Developer
Posts: 35
Joined: Sun May 24, 2020 6:50 pm
Location: BC, Canada
Has thanked: 3 times
Been thanked: 17 times
Contact:

Re: Gigatron

Unread post by sajattack »

tOuwByP.jpg
tOuwByP.jpg (4.24 MiB) Viewed 5136 times

Made a bit of progress on video output with Alan's help. Still need to fix the timings/aspect ratio/etc a bit, then ROM loading and controls.
User avatar
pgimeno
Top Contributor
Posts: 669
Joined: Thu Jun 11, 2020 9:44 am
Has thanked: 246 times
Been thanked: 208 times

Re: Gigatron

Unread post by pgimeno »

Great! I'm eager to see it working!
sajattack
Core Developer
Posts: 35
Joined: Sun May 24, 2020 6:50 pm
Location: BC, Canada
Has thanked: 3 times
Been thanked: 17 times
Contact:

Re: Gigatron

Unread post by sajattack »

Solved the cut off video problem. Screencap from the core:

VBf16TE.png
VBf16TE.png (5.28 KiB) Viewed 7634 times
User avatar
Alkadian
Top Contributor
Posts: 721
Joined: Thu May 28, 2020 9:55 am
Has thanked: 289 times
Been thanked: 116 times

Re: Gigatron

Unread post by Alkadian »

sajattack wrote: Fri Mar 05, 2021 7:38 am Solved the cut off video problem. Screencap from the core:
Great news, looking forward to it :D
sajattack
Core Developer
Posts: 35
Joined: Sun May 24, 2020 6:50 pm
Location: BC, Canada
Has thanked: 3 times
Been thanked: 17 times
Contact:

Re: Gigatron

Unread post by sajattack »

Got controller input working today. Next up is keyboard and rom loading, then just a few finishing touches.
Mokona78
Posts: 1
Joined: Tue Nov 17, 2020 2:36 pm

Re: Gigatron

Unread post by Mokona78 »

Nice work !
User avatar
Alkadian
Top Contributor
Posts: 721
Joined: Thu May 28, 2020 9:55 am
Has thanked: 289 times
Been thanked: 116 times

Re: Gigatron

Unread post by Alkadian »

sajattack wrote: Mon Mar 08, 2021 4:40 am Got controller input working today. Next up is keyboard and rom loading, then just a few finishing touches.
Thats sounds exciting, many thanks!
sajattack
Core Developer
Posts: 35
Joined: Sun May 24, 2020 6:50 pm
Location: BC, Canada
Has thanked: 3 times
Been thanked: 17 times
Contact:

Re: Gigatron

Unread post by sajattack »

Got most of (not extended keys) the keyboard working today. Don't have a lot of time to work on this these days but I'm still getting a little bit done here and there.
User avatar
Alkadian
Top Contributor
Posts: 721
Joined: Thu May 28, 2020 9:55 am
Has thanked: 289 times
Been thanked: 116 times

Re: Gigatron

Unread post by Alkadian »

sajattack wrote: Mon May 24, 2021 2:56 am Got most of (not extended keys) the keyboard working today. Don't have a lot of time to work on this these days but I'm still getting a little bit done here and there.
Excellent news, thanks!!!
User avatar
pgimeno
Top Contributor
Posts: 669
Joined: Thu Jun 11, 2020 9:44 am
Has thanked: 246 times
Been thanked: 208 times

Re: Gigatron

Unread post by pgimeno »

sajattack wrote: Mon May 24, 2021 2:56 am Got most of (not extended keys) the keyboard working today. Don't have a lot of time to work on this these days but I'm still getting a little bit done here and there.
Great! Is this the intended conversion?
https://github.com/kervinck/gigatron-ro ... 2.ino#L133

Do you need help?
sajattack
Core Developer
Posts: 35
Joined: Sun May 24, 2020 6:50 pm
Location: BC, Canada
Has thanked: 3 times
Been thanked: 17 times
Contact:

Re: Gigatron

Unread post by sajattack »

I just need time and motivation 😅. Do you guys want a "beta" core? The games built into the ROM are playable and I'd like to give something for your continued interest and support.
User avatar
Alkadian
Top Contributor
Posts: 721
Joined: Thu May 28, 2020 9:55 am
Has thanked: 289 times
Been thanked: 116 times

Re: Gigatron

Unread post by Alkadian »

sajattack wrote: Mon May 24, 2021 7:34 pm I just need time and motivation 😅. Do you guys want a "beta" core? The games built into the ROM are playable and I'd like to give something for your continued interest and support.
Please do take your time! Your hard work is really much appreciated, really is. I would love to test a beta version if/when that becomes available. Thanks again and keep up the great job :mrgreen:
sajattack
Core Developer
Posts: 35
Joined: Sun May 24, 2020 6:50 pm
Location: BC, Canada
Has thanked: 3 times
Been thanked: 17 times
Contact:

Re: Gigatron

Unread post by sajattack »

Enjoy folks https://github.com/sajattack/Gigatron_M ... 210523.rbf

Known issues:
- keys like shift, ctrl, alt, arrow keys on the keyboard don't work
- video is slightly offset to the right
- no external rom loading (most things are baked into the internal rom anyways)
User avatar
Alkadian
Top Contributor
Posts: 721
Joined: Thu May 28, 2020 9:55 am
Has thanked: 289 times
Been thanked: 116 times

Re: Gigatron

Unread post by Alkadian »

sajattack wrote: Mon May 24, 2021 8:24 pm Enjoy folks https://github.com/sajattack/Gigatron_M ... 210523.rbf

Known issues:
- keys like shift, ctrl, alt, arrow keys on the keyboard don't work
- video is slightly offset to the right
- no external rom loading (most things are baked into the internal rom anyways)
Awesome, thanks! I have just tried it and the system booted up correctly. Even with the video offset (to the left in my case) I have enjoyed a quick play to snake :D
User avatar
pgimeno
Top Contributor
Posts: 669
Joined: Thu Jun 11, 2020 9:44 am
Has thanked: 246 times
Been thanked: 208 times

Re: Gigatron

Unread post by pgimeno »

Ohh so great to have a beta core to put my hands on! Thank you!

I'm finding a couple problems. Both are readily noticeable with the Mandelbrot program.

1. The speed seems to depend on the number of scanlines selected (press the SELECT button in the controller to cycle them between 75%, 50%, 25% or 100%). At 100% it's the slowest, and I like 100% so that's a problem for me. I don't have a real machine to check, but I doubt the real machine behaves like this. (Edit: see next post)
2. From time to time, apparently at random, the screen flashes with what looks like garbage. Maybe a contention issue?

sajattack wrote: Mon May 24, 2021 7:34 pm I just need time and motivation 😅. Do you guys want a "beta" core? The games built into the ROM are playable and I'd like to give something for your continued interest and support.
I have the time, kind of, and lots of motivation. I'm still doing my first steps with Verilog but after my recent success I think I can at least help somewhat.
User avatar
pgimeno
Top Contributor
Posts: 669
Joined: Thu Jun 11, 2020 9:44 am
Has thanked: 246 times
Been thanked: 208 times

Re: Gigatron

Unread post by pgimeno »

pgimeno wrote: Tue May 25, 2021 1:03 am 1. The speed seems to depend on the number of scanlines selected (press the SELECT button in the controller to cycle them between 75%, 50%, 25% or 100%). At 100% it's the slowest, and I like 100% so that's a problem for me. I don't have a real machine to check, but I doubt the real machine behaves like this.
My bad, this seems to be happening in the emulator too, so I don't think that's actually a problem with the core.
User avatar
Moondandy
Top Contributor
Posts: 535
Joined: Mon May 25, 2020 2:14 am
Location: Edinburgh, Scotland
Has thanked: 32 times
Been thanked: 97 times

Re: Gigatron

Unread post by Moondandy »

Does this Gigatron have any relation to this or just a coincidence?

https://bigbookofamigahardware.com/bboa ... px?id=1070

Also, does this core have an RTC?
jca
Top Contributor
Posts: 1911
Joined: Wed May 27, 2020 1:59 pm
Has thanked: 145 times
Been thanked: 454 times

Re: Gigatron

Unread post by jca »

Nothing to do with it.
See:
https://gigatron.io/
RexRetro
Posts: 1
Joined: Tue May 25, 2021 2:57 pm
Been thanked: 1 time

Re: Gigatron

Unread post by RexRetro »

pgimeno wrote: Tue May 25, 2021 11:50 am
pgimeno wrote: Tue May 25, 2021 1:03 am 1. The speed seems to depend on the number of scanlines selected (press the SELECT button in the controller to cycle them between 75%, 50%, 25% or 100%). At 100% it's the slowest, and I like 100% so that's a problem for me. I don't have a real machine to check, but I doubt the real machine behaves like this.
My bad, this seems to be happening in the emulator too, so I don't think that's actually a problem with the core.
Hi.
There is nothing wrong with the core or the emulator. A real Gigatron (I have one) behaves exactly this way.

It can be explained by knowing how the Gigatron internally works: the "real" (8 bit) CPU is doing the VGA output in software. While this is done, it can't execute the 'virtual' (16 bit) CPU instructions (eg. of the user apps). So if you don't have scanlines, it can only run the vCPU user code while hsync and vsync. With more scanlines it has much more time to execute vCPU instructions, so it gets faster with more scanlines.

So if you want to do number crunching on the Gigatron, best thing is to turn of the graphics until you have a result to show ;-)
sajattack
Core Developer
Posts: 35
Joined: Sun May 24, 2020 6:50 pm
Location: BC, Canada
Has thanked: 3 times
Been thanked: 17 times
Contact:

Re: Gigatron

Unread post by sajattack »

pgimeno wrote: Tue May 25, 2021 1:03 am I have the time, kind of, and lots of motivation. I'm still doing my first steps with Verilog but after my recent success I think I can at least help somewhat.
I'm open to pull requests on the linked repo if you think you can get it working before I have time to get back to it myself.
User avatar
pgimeno
Top Contributor
Posts: 669
Joined: Thu Jun 11, 2020 9:44 am
Has thanked: 246 times
Been thanked: 208 times

Re: Gigatron

Unread post by pgimeno »

I've found how to reproduce the graphical issues. It seems more than just that, there's actual corruption going on. It can be seen by starting the Pictures demo. The first picture appears with every 4th pixel column displaced up:

20210530_181518-screen.png
20210530_181518-screen.png (16.5 KiB) Viewed 5537 times
The same problem happens in the second picture, but for me at least, before it finishes scrolling in, the whole screen gets corrupt, and from that point on, nothing seems to be working until the next reset.

On a different matter, I've managed to find a direct link for the download of Quartus 17.0.2 for Linux without requiring an Intel account, and with the help of a virtual machine with no internet connection, I feel safe enough. So, I am running Quartus myself now, yay! :lol:

I'm running into an issue though. I've tried to add keyboard language support, by doing this:

Code: Select all

diff --git a/Gigatron.sv b/Gigatron.sv
index 0c5cdc7..e93381e 100644
--- a/Gigatron.sv
+++ b/Gigatron.sv
@@ -188,6 +188,8 @@ localparam CONF_STR = {
 	"R0,Reset and close OSD;",
 	"J1,A,B,Select,Start;",
 	"jn,A,B,Select,Start;",
+	"-;",
+	"O24,Keyboard language,US,UK,DE,FR,IT,ES;",
 	"V,v",`BUILD_DATE 
 };
 
And the setting does appear in the main menu, yet it can't be changed: it's stuck at US when pressing Return on the setting. Any idea how to get it to change?
sajattack
Core Developer
Posts: 35
Joined: Sun May 24, 2020 6:50 pm
Location: BC, Canada
Has thanked: 3 times
Been thanked: 17 times
Contact:

Re: Gigatron

Unread post by sajattack »

Interesting find. I wonder why it is only on the "Pictures" option though. For your menu option, did you try left and right to switch it?
User avatar
pgimeno
Top Contributor
Posts: 669
Joined: Thu Jun 11, 2020 9:44 am
Has thanked: 246 times
Been thanked: 208 times

Re: Gigatron

Unread post by pgimeno »

sajattack wrote: Mon May 31, 2021 3:04 pm Interesting find. I wonder why it is only on the "Pictures" option though.
It doesn't look like the same issue of screen noise flashes that I was having, which is completely random. This one seems to be 100% reproducible and seems to fail always at the same point, which suggests some bug in the implementation of the CPU. It also appears to make the CPU freeze, while the other one doesn't: it continues normally after the flash.

sajattack wrote: Mon May 31, 2021 3:04 pm For your menu option, did you try left and right to switch it?
Yes but it doesn't change the option, it changes the menu screen. The Aspect Ratio option a few lines above that one works fine when pressing Return. I'm puzzled.
User avatar
pgimeno
Top Contributor
Posts: 669
Joined: Thu Jun 11, 2020 9:44 am
Has thanked: 246 times
Been thanked: 208 times

Re: Gigatron

Unread post by pgimeno »

pgimeno wrote: Tue Jun 01, 2021 1:44 am Yes but it doesn't change the option, it changes the menu screen. The Aspect Ratio option a few lines above that one works fine when pressing Return. I'm puzzled.
Solved! I just had to place it *before* the joystick entries.
User avatar
pgimeno
Top Contributor
Posts: 669
Joined: Thu Jun 11, 2020 9:44 am
Has thanked: 246 times
Been thanked: 208 times

Re: Gigatron

Unread post by pgimeno »

sajattack wrote: Wed May 26, 2021 5:04 am I'm open to pull requests on the linked repo if you think you can get it working before I have time to get back to it myself.
Unfortunately I can't send pull requests because I'm not on GitHub.

Attached is the full patch that can be merged with 'git am'. I've also included the compiled result.

Sorry it took this long, I've been learning some Verilog along the way.

With this update:
- Arrows work as a substitute of joystick. Button A is End and Del, Button B is Home and Ins, Start is PgUp, Select is PgDn. Following PS2.ino in which it's based, Ctrl+Alt+Del also works as Start. Holding Start for a few seconds resets the machine.
- Ctrl AltL AltR can be used to reset like in other cores, and same goes for the User button.
- Caps Lock, and the corresponding LED, works. On Reset, the Caps Lock state is reset.
- Ctrl keys are implemented to generate characters 0-31 (although 0 probably does nothing).
- Multilanguage support works like in the original Gigatron.

I've left the strategy for clearing the key intact (i.e. it's done on key release), but I've noticed that PS2.ino keeps the key active for just a few scanlines, which would allow for keyboard auto-repeat. That's a possible future improvement, when I understand enough to implement that.

Is it possible to use a different boot.rom by placing it in games/Gigatron? I'd like to try with MS BASIC which probably supports INKEY$, to check if the codes that don't generate anything in Tiny BASIC (like TAB and other control keys) work. Edit: Never mind, tried in the emulator and it has no INKEY$. Still, it would be nice to be able to switch roms via boot.rom, and even better if that could be done on the fly via a menu option.
Attachments
Gigatron-source-patch.zip
(4.09 KiB) Downloaded 173 times
Gigatron-new-kb-rbf.zip
(1.06 MiB) Downloaded 177 times
Post Reply