Gigatron ASIC and the Gametron Handheld

General project related announcements and discussions. Events, other retro systems, the forum itself...
at67
Site Admin
Posts: 652
Joined: 14 May 2018, 08:29

Re: Gigatron ASIC?!?

Post by at67 »

Here's a rough guide on building your own bespoke ROM:


Menu:
- The menu applications are referenced in MainMenu_vx.gcl, you need to edit this file appropriately based on how many menu applications you intend to have and what they are called.
- Search for \Loader in this file and you will see all the menu entries, if you are not changing the number of menu entries, then the task is simpler; just change the names appropriately.
- If the number of menu entries is different, then you have more work to do: you must edit the menu and cursor handling code in this file to accommodate your menu. e.g. for that first ROM I built for you, I had to comment out the ButtonLeft and ButtonRight handlers and also change the boundary checks of the Item/MenuItem variable, (it's named differently among the different versions of MainMenu_vx.gcl).
- Removed the Easter Egg at the top of the file for more space savings.
- Removed the Tetronis/Bricks workarounds and the TicTacToe launcher at the bottom of the file.

Original code:

Code: Select all

{ Operate menu }
[def
  push
  0 Item=
  [do
    \frameCount, Color= PrintArrow!

    { Handle each stroke of Up/Down and A controller buttons }

    {buttonRight}
    \buttonState, 254^ [if=0
       WipeOutArrow!
       Item 4- [if<=0 10+ Item=]
       \buttonState, 1| \buttonState.]

    {buttonLeft}
    \buttonState, 253^ [if=0
       WipeOutArrow!
       Item 6- [if>=0 Item=]
       \buttonState, 2| \buttonState.]

    {buttonDown}
    \buttonState, 251^ [if=0
       WipeOutArrow!
       Item 5- [if<>0 5- if<>0 <Item++]
       \buttonState, 4| \buttonState.]

    {buttonUp}
    \buttonState, 247^ [if=0
       WipeOutArrow!
       Item [if<>0 6- if<>0 Item 1- Item=]
       \buttonState, 8| \buttonState.]

    {buttonA, or any ASCII key from keyboard, 'A' included...}
    \buttonState, 128& if<>0loop

    42 {Gray} Color= PrintArrow!

    { Map menu item to program }
    Item [if=0 \Snake      else
    1-   [if=0 \Racer      else
    1-   [if=0 \Mandelbrot else
    1-   [if=0 \Pictures   else
    1-   [if=0 \Credits    else
    1-   [if=0 \Loader     else
    1-   [if=0 \Tetronis   else
    1-   [if=0 \Bricks     else
    2-   [if<=0 \TinyBASIC else {TicTacToe and stand-alone BASIC}
    1-   [if=0 \WozMon     else loop]]]]]]]]]]
    Program=
  ]
  pop ret
] SelectMenu=

{-----------------------------------------------------------------------+
|}>_vLR++ ret{          RAM page 4                                      |
+-----------------------------------------------------------------------}
*=$0400

{Newline}
[def
  >Pos, 8+ >Pos.
  2 <Pos.
  ret
] Newline=

[def
  #9 `Snake #9 ``` #9 `Tetronis  #10
  #9 `Racer #9 ``` #9 `Bricks    #10
  #9 `Mandelbrot   #9 `TicTacToe #10
  #9 `Pictures ``` #9 `BASIC     #10
  #9 `Credits #9   #9 `WozMon    #10
  #9 `Loader                     #10 #0
] MainMenu=
Modified code:

Code: Select all

{ Operate menu }
[def
  push
  0 Item=
  [do
    \frameCount, Color= PrintArrow!

    { Handle each stroke of Up/Down and A controller buttons }

    {buttonDown}
    \buttonState, 251^ [if=0
       WipeOutArrow!
       Item 1- [if<>0 1- if<>0 <Item++]
       \buttonState, 4| \buttonState.]

    {buttonUp}
    \buttonState, 247^ [if=0
       WipeOutArrow!
       Item [if<>0 2- if<>0 Item 1- Item=]
       \buttonState, 8| \buttonState.]

    {buttonA, or any ASCII key from keyboard, 'A' included...}
    \buttonState, 128& if<>0loop

    42 {Gray} Color= PrintArrow!

    { Map menu item to program }
    Item [if=0 \Loader     else
    1-   [if<=0 \TinyBASIC
    ]]
    Program=
  ]
  pop ret
] SelectMenu=

{-----------------------------------------------------------------------+
|}>_vLR++ ret{          RAM page 4                                      |
+-----------------------------------------------------------------------}
*=$0400

{Newline}
[def
  >Pos, 8+ >Pos.
  2 <Pos.
  ret
] Newline=

[def
  #9 `Loader    #10
  #9 `BASIC     #10 #0
] MainMenu=

ROM name:
- The name of the ROM is hard-coded in Core/Reset_vx.gcl, search for ``TTL`microcomputer` and change it appropriately, (it is a very good idea to change this if making a bespoke ROM, (I would say mandatory), so as not to cause later confusion.


MakeFile:
- Modify the MakeFile to include your new menu entries or reflect your deleted menu entries, e.g. I added this to the MakeFile.

Code: Select all

# ROM v4 BMWTCU
ROMv4_bmwtcu.rom: Core/* Apps/*/* MakeFile interface.json
	python3 Core/ROMv4_bmwtcu.asm.py\
		Apps/Loader/SYS_Loader_v3.py\
		Loader=Apps/Loader/Loader_v3.gcl\
		TinyBASIC=Apps/TinyBASIC/TinyBASIC_v3.gcl\
		Main=Apps/MainMenu/MainMenu_v4_bmwtcu.gcl\
		Reset=Core/Reset_v4_bmwtcu.gcl

burnv4_bmwtcu: ROMv4_bmwtcu.rom
	minipro -p 'AT27C1024 @DIP40' -w "$<" -y -s
- The absolute minimum files required for a ROM are, (change version numbers appropriately), your version had TinyBASIC as an addition:

Code: Select all

Core/ROMv4_bmwtcu.asm.py
Apps/Loader/SYS_Loader_v3.py
Loader=Apps/Loader/Loader_v3.gcl
Main=Apps/MainMenu/MainMenu_v4_bmwtcu.gcl
Reset=Core/Reset_v4_bmwtcu.gcl
- You'll notice that all the files I changed for your bespoke ROM I copied and renamed, thus the original files were left intact. In fact I went so far as to copy the entire gigatron-rom directory into a fresh playground, so that I could build your ROM without worrying about affecting the original code-base.
- I then built it with make -f MakeFile ROMv4_bmwtcu.rom, the -f MakeFile is not strictly needed, but if you change the MakeFile's name then it will come in handy.
Last edited by at67 on 23 Jan 2021, 04:55, edited 1 time in total.
at67
Site Admin
Posts: 652
Joined: 14 May 2018, 08:29

Re: Gigatron ASIC?!?

Post by at67 »

bmwtcu wrote: 22 Jan 2021, 18:39 PS - This video motivated me to build up my Pluggy Reloaded and I also finally got around to trying the bmwtcu image you created. When I use sendFile.py, the Gigatron resets and navigates down to TinyBASIC and enters it instead of loading the target gt1 file. I assume this is the result of hard-coded button presses assuming the full menu, and one way of working around it would be to remove TinyBASIC and only have the Loader option, or swap the Loader and TinyBASIC menu entry locations. I think that the problem would also go away with a custom SDCard Browser only ROM. Yes?

Video here - https://www.youtube.com/watch?v=jwMd72aVIws
Yeah you are right on all fronts, you could also modify BabelFish to not send the button down presses, so that for your bespoke ROM it would just send the button A press. You can make these modifications to doLoader() in BabelFish.ino: (comment out the buttonDown for loop as I did here)

Code: Select all

void doLoader()
{
    // Navigate menu. 'Loader' is at the bottom
#if hasSerial
    Serial.println(F(":Starting Loader from menu"));
    Serial.flush();
#endif

//*******************************************************************************************************
//************************** COMMENTED OUT **************************************************************
//*******************************************************************************************************
#if 0
    for(byte i = 0; i < 10; i++)
    {
        sendController(~buttonDown, 2);
        delay(50);
    }
#endif
//*******************************************************************************************************
//*******************************************************************************************************
//*******************************************************************************************************

    // Start 'Loader' application on Gigatron
    sendController(~buttonA & 255, 2);

    // Wait for Loader to be running
    delay(1000);
}

P.S. I assume Marcel made the loop larger than it needed to be, (10 instead of 5), for future proofing against a smaller font menu or menu with more than 5 rows and that he always intended to have Loader at the bottom of the main menu. With hindsight it seems more logical and efficient to have Loader as the very first menu entry, so that after a reset your menu is always in a guaranteed state and you can just send a button A down event.
walter
Site Admin
Posts: 164
Joined: 13 May 2018, 08:00

Re: Gigatron ASIC?!?

Post by walter »

Awesome work!
bmwtcu
Posts: 149
Joined: 01 Nov 2018, 12:02

Re: Gigatron ASIC and the Gametron Handheld

Post by bmwtcu »

Please see updates to OP and check out this YouTube video.
https://www.youtube.com/watch?v=8e-uxF432BU

I'm on a quest for more native 640x480 display options for the Gametron. The one I'm using now is consuming ~650mA@5V just for the backlight! I'm thinking a 3.5" display would be a good size. If anyone has any suggestions, please send them my way!
at67
Site Admin
Posts: 652
Joined: 14 May 2018, 08:29

Re: Gigatron ASIC and the Gametron Handheld

Post by at67 »

Congratulations on your progress and success, when does the Kickstarter/GoFundMe start and where do I sign up?
bmwtcu
Posts: 149
Joined: 01 Nov 2018, 12:02

Re: Gigatron ASIC and the Gametron Handheld

Post by bmwtcu »

at67 wrote: 15 Feb 2021, 21:20 Congratulations on your progress and success, when does the Kickstarter/GoFundMe start and where do I sign up?
Thanks! If I ever get to that point, you will be the first to know! Probably because it'll be running software you wrote:P
bmwtcu
Posts: 149
Joined: 01 Nov 2018, 12:02

Re: Gigatron ASIC and the Gametron Handheld

Post by bmwtcu »

WhatsApp Image 2021-04-12 at 9.49.50 AM.jpeg
WhatsApp Image 2021-04-12 at 9.49.50 AM.jpeg (177.49 KiB) Viewed 15007 times
Current state of the FPGA breakout board bringup.
The video on the display is rotated 90 degrees and I'm currently hunting down the datasheet. If anyone has a Panelook account and can help me download it, it's the Epson 2.8'' L4S00242P00 (https://www.panelook.com/L4S00242P00_Ep ... 2374.html​)

New FPGA breakout board based on Gowin GW1N-9 FPGA and MZDPI 2.8" 640x480 LCD.
https://www.gowinsemi.com/en/product/detail/2/
http://raspberrypiwiki.com/index.php/2. ... or_Pi_zero

Currently measures under 150mA@5V just for video/audio/blinkenlights. The VGA clock is derived from an on-chip 25MHz oscillator. I'll be checking if the display gets fuzzy/jittery with temperature variation before deciding I don't need an external clock oscillator. Next step is to add Arduino Pro Micro/SDCard/Famicom controller/Audio PA.
bmwtcu
Posts: 149
Joined: 01 Nov 2018, 12:02

Re: Gigatron ASIC and the Gametron Handheld

Post by bmwtcu »

https://www.youtube.com/watch?v=RetNF7o3XzA
Quick YouTube video showing setup.
at67
Site Admin
Posts: 652
Joined: 14 May 2018, 08:29

Re: Gigatron ASIC and the Gametron Handheld

Post by at67 »

Awesome stuff!
bmwtcu
Posts: 149
Joined: 01 Nov 2018, 12:02

Re: Gigatron ASIC and the Gametron Handheld

Post by bmwtcu »

https://www.youtube.com/watch?v=KqS9qv3 ... jt&index=8

Minor detour last Aug/Sept just because I had all the pieces of the puzzle and it combines my love of arcade games with FPGA Gigatron. See other FPGA arcade work I've done at https://github.com/bzboi/pano_man
Post Reply