at67 emulator

Using, learning, programming and modding the Gigatron and anything related.
Forum rules
Be nice. No drama.
at67
Posts: 150
Joined: 14 May 2018, 08:29

Re: at67 emulator

Post by at67 » 05 Feb 2020, 15:12

dwesti wrote:
05 Feb 2020, 15:01
Do you plan to add breakpoints for debugger ?
There are already breakpoints for both VCPU and Native.

Press CTRL-F6 -> Press CTRL-D

Click on any instruction, (the red X clears all breakpoints, CTRL-M switches between VCPU and Native once you have pressed CTRL-D).

You can also add breakpoints to your VCPU ASM code with _breakpoint_, just use it as if it was a label next to the instruction you want to break on.

When you load that source file into the emulator, the Debugger will automatically start in breakpoint mode.

CTRL-F7 runs to next breakpoint, CTRL-F8 single steps, CTRL-F9 runs until watch variables changes, it's all in the help screen.

There are a few quirks, it's a work in progress, i.e. it can be hard to break on code waiting on input, debugger can timeout, but right now it mostly works.

frabuk
Posts: 9
Joined: 06 Mar 2020, 21:16

Re: at67 emulator

Post by frabuk » 12 Apr 2020, 22:05

Hi,

first of all thank you! Great software.

I compiled your emulator under linux. However I was not able to start the Terminal in order to talk to the serial port. I’m getting cannot open /dev/ttyS3 error and the emulator turns black. I want to toy around with serial I/O in the emulator. Is this possible? Or is the terminal mode only used to connect real hardware?

Thanks again!

Christoph

at67
Posts: 150
Joined: 14 May 2018, 08:29

Re: at67 emulator

Post by at67 » 13 Apr 2020, 03:19

frabuk wrote:
12 Apr 2020, 22:05
first of all thank you! Great software.
:)
frabuk wrote:
12 Apr 2020, 22:05
I compiled your emulator under linux. However I was not able to start the Terminal in order to talk to the serial port. I’m getting cannot open /dev/ttyS3 error and the emulator turns black. I want to toy around with serial I/O in the emulator. Is this possible? Or is the terminal mode only used to connect real hardware?
Terminal mode is purely for talking to real Gigatron hardware through a USB to Serial interface, (one of the many Arduino solutions posted in the forums and in GitHub), the black screen is being caused by a timeout. I have never actually tested the Terminal mode under Linux with real hardware as I run Linux through a VM and could never get it's serial ports to work, in theory it should work as long as the name of your serial device is correct and you have correctly setup and configured one of the Arduino PC to Gigatron interfaces.

If you mean experimenting with the Gigatron's Vertical Blank software serial communications, what is it you are actually trying to do? If you are running the correct ROM version, the emulator should be presenting the correct data stream as real hardware would.

frabuk
Posts: 9
Joined: 06 Mar 2020, 21:16

Re: at67 emulator

Post by frabuk » 13 Apr 2020, 12:28

If you mean experimenting with the Gigatron's Vertical Blank software serial communications, what is it you are actually trying to do? If you are running the correct ROM version, the emulator should be presenting the correct data stream as real hardware would.
I succesfully loaded Micorchess on my hardware gigatron and i thought if i could write the Microchess output also to serial out i could parse that on the arduino. And maybe have two instances of Micorochess playing each other until they becom sentient ;-) Or have the gigatron play another chess software via Internet Relay Chat. Something in that vein ...

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

Re: at67 emulator

Post by marcelk » 13 Apr 2020, 13:03

The wrapper around Microchess draws the text on the video display. Although Microchess itself is 6502 code, the screen drawing is done by a vCPU function _PrintChar. It shouldn't be too hard to extend this code with a call to SYS_SendSerial1_v3_80 and send that byte out.

On the Arduino, you make sure you're in terminal mode ('T' command). In thise mode it catches these bytes and sends them back over USB to your computer. (Instead of writing them into the Arduino's EPROM, which is what happens outside terminal mode).

Microchess is primitive. Special moves such as castling, promotion and en-passant aren't supported. Instead you quit the program and edit the board. In our case you end up in a wozmon when you quit. After editing you jump back into the program. That is how it was done on the KIM-1, except that we use wozmon instead of the KIM monitor. The Microchess manual is on Peter Jenning's site: http://www.benlo.com/microchess/Kim-1Microchess.html . Wozmon manuals are everywhere on the Internet. I like this one: https://www.sbprojects.net/projects/apple1/wozmon.php

walter
Site Admin
Posts: 55
Joined: 13 May 2018, 08:00

Re: at67 emulator

Post by walter » 07 Jun 2020, 13:49

We have an emulator from Phil Thomas online at https://gigatron.io/emu/. It runs ROMv4 that is shipped with the kit.

I have now also put online:

- ROMv1 at https://gigatron.io/emu-v1/
- Latest development ROM at https://gigatron.io/emu-dev/
- 12.5MHz Gigatron with special ROMv3y at https://gigatron.io/emu-12.5/

at67
Posts: 150
Joined: 14 May 2018, 08:29

Re: at67 emulator

Post by at67 » 28 Jun 2020, 07:50

delpozzo wrote:
26 Jun 2020, 17:13
That is really cool at67, I didn't know your emulator could do that! I just tried it and it works if I enter the loader manually on my Gigatron first. However, if it is at the main menu it navigates to WozMon (instead of Loader) and attempts the upload there. Was just wondering if there is something I am missing in my configuration?
There's a number of strange things going on:

1) Upon opening the com port to the current BabelFish residing in the main repo, the Gigatron's cursor moves to the right on the main menu. This happens with my software and all other software I have used to open the COM port, (i.e. terminal applications). It doesn't happen with Norgate's version of BabelFish, (which is specific to his Pluggy Reloaded hardware).

2) We have seen this strange cursor behaviour before, specifically on Arduino Nano's, it was addressed and solved by Marcel here:
viewtopic.php?f=4&t=165
https://github.com/kervinck/gigatron-rom/issues/122
https://github.com/kervinck/gigatron-ro ... b40dd68741

3) My software was not working correctly with older Arduino configurations, (I use Norgate's Pluggy Reloaded and it worked fine with that), and was not resetting the Gigatron hardware correctly, (which would have negated the wandering cursor).

4) My software was also opening and closing the COM port for every comms access, (it felt like a good idea at the time, i.e. non exclusive mode), but the version of BabelFish in the main repo sends a large version string every time the com port is opened; this caused some major havoc as you can imagine.

I've solved the problem for now by fixing the reset issue in my software, changing the open/close COM port to a global scope and adding an "Enable" option in 'loader_config.ini" as well as better overall comms error handling, (watch the terminal/console for errors).

This should solve your problems of not having gt1 files upload correctly, although the wandering cursor issue still persists, (the forced reset the software performs negates it and thus shouldn't impede you uploading to hardware anymore).

BabelFish is not my area of expertise, maybe others, (Norgate?), would have an idea/suggestions/solutions.

P.S. The main repo now has version 1.0.1B of my software and includes these fixes.

Post Reply