Gigatron Emulator for Mac OS X (first test version)

Using, learning, programming and modding the Gigatron and anything related.
Forum rules
Be nice. No drama.
Post Reply
mcbrown
Posts: 6
Joined: 12 Nov 2018, 11:41

Gigatron Emulator for Mac OS X (first test version)

Post by mcbrown »

Hi Gigatron Community,

in order to get to know Gigatron better, I decided to try writing my own emulator for Mac OS X in Objective C using Apple's Cocoa Framework. Thanks to kervinck, it is now available in https://github.com/kervinck/gigatron-ro ... tron%20Mac

It's an early test version and certainly contains quite a lot of bugs. Still, it helped me with understanding GT1 files, the Gigatron Assembler (thanks a lot for it, at67! It's working great and more accessible to me than the GCL language) and the way Gigatron works in general.

The following features are already included and (more or less) working:
  • VGA output
  • Sound output
  • Simulated controller, but there are still some bugs with sticking keys. Use the Mac cursor keys for left, right, up, down and the [right CMD] and [right ALT] key for button "A" and "B". Use the [left CMD] and [left ALT] key for "Select" and "Start".
  • Switch between 32kB and 64kB
  • Quick persisting of the current state and restore anytime ("Write State" and "Restore State")
  • Basic debugging with CPU stepping, vCPU stepping, RAM watches, very basic disassembly of code in ROM and RAM
  • Loading of GT1 files directly into RAM
  • Watching of GT1 files so that they are reloaded automatically if they change on disk
  • "RAM gadget" with a 256x256 pixel matrix with each pixel representing one byte of gigatron RAM. The value of each byte is represented in different colors.
The code is released under the BSD 2-clause licence.

As I wrote, there are quite some bugs, e.g. with debugging, disassembly and others. If you want to use the emulator, encounter some really annoying issues and are not able to fix them, please let me know and I'll look into them.

Best regards,
Tobias

P.S.: Marcel and Walter, thank you so much for the amazing Gigatron project. I've enjoyed every second of learning how this thing works, of soldering mine together and now I'm looking forward to writing my own gigatron programs using my own emulator. It's really amazing what you can achieve with so little hardware!

Here's a screenshot of the current version of Gigatron Mac:
Gigatron Mac.png
Gigatron Mac.png (490.77 KiB) Viewed 3528 times
User avatar
marcelk
Posts: 488
Joined: 13 May 2018, 08:26

Re: Gigatron Emulator for Mac OS X (first test version)

Post by marcelk »

Thanks for sharing the source and the ready-to-go app itself. I just pulled both into the main repo. After upgrading to Mojave I managed to run it. It is very cool work, thanks so much. I like the RAM-as-graphics viewer. Especially with Racer, where it reveals how little goes on under the hood :-)
kris92
Posts: 1
Joined: 21 Aug 2019, 15:35

Re: Gigatron Emulator for Mac OS X (first test version)

Post by kris92 »

Just found your app in the GitHub repo. Thanks a lot !
This is a great addition for testing ROM updates very quickly !
petersieg
Posts: 110
Joined: 28 Jun 2023, 09:06

Re: Gigatron Emulator for Mac OS X (first test version)

Post by petersieg »

Hi.

I just did a minimal update to this nice Gigatron Mac Emulator.
I just replaced ROMv3 with ROMv5a, changed the url of the creator to the new one (ix.640k.de) und compiled it to work down to 10.11 of Mac OSX.
I have done this under Mac OSX 10.13 with xcode 10.1. I tested it under 10.11,10.13 and Ventura 13.4.
Someone else tested it to run under Apple M1 OSX 14. After allowing to start, without been able to check, it runs.
Code signing with xcode is not understood by me. I just did adhoc signing/locally, because that I found by googling one should do.
My knowledge of xcode and Objective-C is close to zero!
So do not expect that I am able to fix any bugs whatsoever.
But as long as I have the xcode environment installed (app. 12GB and 300.000 files!!), I can try to update, when a fix is send to me.
I also had a small mail conversation with Tobias, just to make sure, he is ok with the small changes.
Whether the above github repo is updated or not has to be decided by the repo owner.
I just attach the complete dev zip including source, change log, all project files, license and new dmg file to this post.
With this, one should be able to compile it with xcode installed.

Happy new 2024.
Peter
Attachments
Gigatron Mac.zip
(3.9 MiB) Downloaded 98 times
petersieg
Posts: 110
Joined: 28 Jun 2023, 09:06

Re: Gigatron Emulator for Mac OS X (first test version)

Post by petersieg »

There seems to be an error at loading some gt1 files:
This was/is the problem:

Code: Select all

Writing 39 bytes starting at address 0x0200
gt1Bytes Pos: 42
Writing 0 bytes starting at address 0x0500
This hould be loading 256 bytes at 0x500!

This is maybe a quick fix?:

Code: Select all

#define posInc      if (++pos >= gt1Length) { break; }
    
    unsigned int pos = 0;
    int loaded = 0;
    while(1) {
		fprintf(stderr, "gt1Bytes Pos: %d\n", pos);
        int hiAddress = gt1Bytes[pos];
        posInc
        int loAddress = gt1Bytes[pos];
        posInc
        int segmentSize = gt1Bytes[pos] & 255;
        if (segmentSize == 0) segmentSize = 256; // <--= fix
        posInc
best, Peter
petersieg
Posts: 110
Joined: 28 Jun 2023, 09:06

Re: Gigatron Emulator for Mac OS X (first test version)

Post by petersieg »

So here is the fixed (just gt1 load issue - see above) Gigatron Mac package incl source und project files
Now arecibo64.gt1 is sucessfully loaded and started. With the older version, screen is corrupted and emu loop hangs.

best, Peter

Now also available here: https://github.com/petersieg/gigatron_mac
Attachments
Gigatron Mac.zip
(3.9 MiB) Downloaded 76 times
Post Reply