at67 emulator

Using, learning, programming and modding the Gigatron and anything related.
Forum rules
Be nice. No drama.
at67
Posts: 185
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: 185
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: 75
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: 185
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.

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

Re: at67 emulator

Post by at67 » 04 Jul 2020, 03:24

I've added some screenshots of features I've added to the Emulator over the past few months that I never really talked about; they can make your development with the Gigatron significantly simpler if used properly.

CTRL-H toggles the help screen.

Terminal, (CTRL-T toggles):
- Allows you to control and communicate with a Gigatron over an Arduino interface using BabelFish's inbuilt commands.
- Can directly input text and commands to TinyBASIC.
- Can save and load programs to TinyBASIC.
- Can Copy/Paste text to the clipboard.
- Has a command line history and scrolling abilities.
- Right click brings up a menu.
Terminal.JPG
Terminal.JPG (265.99 KiB) Viewed 523 times

Debugger, (CTRL-F6 toggles):
- Allows you to halt on breakpoint, single step both vCPU and Native code and also halt on watch variable.
- Breakpoints can be toggled by switching to disassembler mode, (CTRl-D), and then clicking on instructions, (pink asterisks).
- Breakpoints can also be set using the _breakpoint_ command within vCPU assembly code when using my assembler.
- Clear all breakpoints using the red x.
- CTRL-F7 runs to next breakpoint, (this can cause a debugger timeout if breakpoint is waiting on some type of input, I still need to fix this).
- CTRL-F8 steps PC, in both vCPU and Native modes, i.e. you can single step vCPU and then burrow into the actual vCPU instruction and single step the Native code that interprets that vCPU instruction, (switch between vCPU and Native using CTRL-M).
- Ctrl-F9, runs until watch variable changes, by default it is is set to 0x000E, (frameCount), so debugger will halt every frame, (1/60th of a second); great for single stepping your program visually at the macro level.
- You can set the watch variable by clicking it in the emulator to the address of any variable/memory location that you like.
- The watch variable can also be set using the _singleStepWatch_ command within vCPU assembly code when using my assembler.
Debugger.JPG
Debugger.JPG (446.85 KiB) Viewed 523 times
Dissassembler_vCPU.JPG
Dissassembler_vCPU.JPG (419.72 KiB) Viewed 523 times
Dissassembler_Native.JPG
Dissassembler_Native.JPG (485.55 KiB) Viewed 523 times

Audio Editor, (CTRL-A toggles):
- Allows you to edit the inbuilt Gigatron hardware waveforms for audio channels 1 to 4 and a user sample for loading in your own programs.
- Extremely useful for generating authentic sound effects for old school programmatically generated sound effects used in arcade machines.
- Not useful for sampled sound as the waveforms are each limited to 64 samples.
- Left click in the waveform window changes a sample, right click in the waveform window resets the sample.
- You can load/save a user sample that does not modify the inbuilt samples, this can then be loaded into appropriate Gigatron channels as needed when your code loads on the Gigatron, (see Pucmon.gbas for an example).
- You can modify or reset the inbuilt Gigatron waveforms and test sound effects with your code, (any code), without having to save or load.
- Right click outside of the waveform editor brings up a menu.
Audio_Editor.JPG
Audio_Editor.JPG (108.44 KiB) Viewed 523 times

delpozzo
Posts: 21
Joined: 03 Jun 2020, 18:47

Re: at67 emulator

Post by delpozzo » 06 Jul 2020, 19:10

I've added some screenshots of features I've added to the Emulator over the past few months that I never really talked about; they can make your development with the Gigatron significantly simpler if used properly.
This is great stuff at67, I am continuously surprised by all the features in this emulator! It really is a remarkable piece of software, thank you for all the hard work and to the rest of the community for a good read with this thread.

Yilers
Posts: 1
Joined: 08 Jul 2020, 23:08

Re: at67 emulator

Post by Yilers » 08 Jul 2020, 23:13

These codes are perfect.
Panadero de oficio y jardinero de vocación, no necesito que me digan las cosas dos veces, amante de las plantas de climas hostiles. Creador de la página Seoplanner.

Post Reply