Gopher2600 is an Atari 2600/VCS Emulator.

Overview

Gopher2600

Gopher2600 is an emulator for the Atari 2600 written in the Go language. The accuracy of the emulation is very high and the 6507, TIA and RIOT chips are well represented. The key features of the emulator:

The graphical debugger is still in development but the current features include:

  • CPU and Video stepping
  • Breakpoints, traps, watches on various CPU, TIA, RIOT targets
  • Interactive rewinding
  • Specialist windows for specific cartridge types (eg. supercharger tape)
  • Script recording and playback
  • Line terminal interface for harder to reach parts of the emulation
  • Regression Database

Screenshots

The following screenshots were taken in playmode with CRT effects enabled

pitfall he-man krull ladybug thrust panda chase man goes down legacy of the beast chiphead egypt genesis draconian zevious

Games shown: Pitfall; He-Man; Krull; Ladybug; Thrust; Panda Chase; Man Goes Down; Legacy of the Beast; Chiphead; Egypt 2600BC by Genesis Project; Draconian; Zevious.

Scope of the project

Gopher2600 was started as for fun and educational purposes, as way of learning more about the Atari 2600 and also about the Go programming language.

The original intent was to provide a tool for static analysis of a 6507 program. I soon realised that I would need to emulate more and more of the 2600 and not just the CPU. Eventually, I realised I would also need a way of see the video output from the TIA. At this point it became obvious that I was indeed writing a complete 2600 emulator.

Because of its origins, any flaws or limitations in the design should be borne in mind while the project is still in development. I am open to any suggestions on how to improve the project.

Performance

The development machine for Gopher2600 was an i3-3225 with 16GB of RAM. Host operating system throughout the development has been a GNU/Linux system.

In playmode I can get a sustained frame rate of 60fps. However, video output is not properly vsynced and the audio buffer is not handled very well, sometimes running out of bits, resulting in pops and stutters in the sound.

In debug mode, I can get around 35fps - good enough for development work.

To get a performance rating for your installation you can run the following:

> gopher2600 performance -display -fpscap=false

Which gives the maximum frame rate with the display.

Memory usage is around 40MB of system memory in playmode and around 120MB in debug mode. This can vary on the ROM used however. It shouldn't ever be a problem on modern hardware.

A statsview is also available. See the section below on the Statistics Viewer for details.

Compilation

The project has most recently been tested with Go v1.15. Earlier versions may work but v1.15 is recommended due to recent performance improvements.

The project uses the Go module system and dependencies will be resolved automatically. Do note however, that you will also require the SDL development kit installed on the system. For users of UNIX like systems, installation from your package manager is the easiest option (for MacOS use the homebrew package manager https://formulae.brew.sh/formula/sdl2)

Compile with GNU Make

> make release

During development, programmers may find it more useful to use the go command directly

> go run gopher2600.go

Minimum requirements

Gopher2600 makes use of SDL2. The SDL2 go binding used by the project requires a minimum SDL2 version of 2.0.10.

Platforms

Gopher2600 is known to run on several platforms. It is known to work best however on Linux based systems, on which it is being developed.

Cross-Compilation

Native compilation of a Windows executable has not yet been tried. But cross-compilation does work via the Makefile:

> make cross_windows

Or for a statically linked binary:

> make cross_windows_static

This has been tested on a Linux system with mingw installed.

Basic usage

Once compiled run the executable with the help flag:

> gopher2600 -help

This will list the available sub-modes. Use the -help flag to get information about a sub-mode. For example:

> gopher2600 debug -help

To run a cartridge, you don't need to specify a sub-mode. For example:

> gopher2600 roms/Pitfall.bin

Although if want to pass flags to the run mode you'll need to specify it.

> gopher2600 run -help

Hand Controllers

Joystick, paddle and keypad inputs are supported. Currently, only joysticks and paddles for the left player are available but keypad input is available for both players.

Gamepad

For conveniece the joystick and paddle can be controlled through a gamepad. For the joystick, use the left thumbstick or the DPad. Any of the face buttons will act as the joystick's fire button.

To control the paddle use the left and right analogue triggers. Note that you will need to 'waggle' the triggers a couple of times for the emulator to detect that you want to switch to the paddle.

The console's reset switch can be triggered with the gamepad's start button.

Without A Gamepad

As an alternative to the gamepad, the joystick can be controlled with the cursor keys of the keyboard. The spacebar will act as the joystick's fire button.

The paddle can be accessed with the computer's mouse. First, capture the mouse by right-clicking the emulator's window and then waggle the mouse a few times to tell the emulator that you want to switch to the paddle. The left mouse button is the paddle's fire button.

Once captured, press the right mouse button to release the mouse and return mouse control to your desktop,

Keypad

Keypads for both player 0 and player 1 are supported.

p0 p1
1 2 3 4 5 6
q w e r t y
a s d f g h
z x c v b n

Panel

The VCS panel is controlled through the function keys of the keyboard.

  • F1 Panel Select
  • F2 Panel Reset
  • F3 Colour Toggle
  • F4 Player 0 Pro Toggle
  • F5 Player 0 Pro Toggle

In playmode, the additional keys are available:

  • F9 Show TIA Revisions window
  • F10 Show CRT Preferences window
  • F11 Toggle Fullscreen
  • F12 Show FPS Indicator

In the debugger, the additional keys are available:

  • ESC toggle mouse capture for debugging TV screen
  • ` (backtick) start/stop emulation

Debugger

To run the debugger use the DEBUG submode

> gopher2600 debug roms/Pitfall.bin

gopher2600 debugging GUI

Because the debugger is still in development, full documentation is not yet available. But briefly, the features we can see in this screeshot are:

The menu-bar across the top of the screen shows the Debugger, VCS and in this instance a Cartridge menu

  • From Debugger menu you can open the preferences windows the terminal and others.
  • The VCS menu contains options to open windows that relate to the VCS itself.
    • Many of them are already open but other, less frequently required windows are also available
  • The Cartridge menu appears when the loaded cartridge type has additional features. For example:
    • Cartridge memory and or registers
    • In this case, this is the menu for the Supercharger format.
  • At the very right of the menu bar we can see the file path for the loaded cartridge

Below the menu-bar are the debugging windows. In this screenshot we can see:

  • The TV Screen. This shows the television output from the VCS.
    • The screen is 'interactive' and will show information about the pixel underneath the cursor
    • Clicking the screen will move the VCS emulation to the point where the VCS is outputting that pixel. This is part of the rewind system.
    • Also available are a variety of overlays. Click the overlay button (labelled no overlay in the screenshot and select which overlay you want.
  • The Audio window shows the waveform of the recent sound output.
  • The Control window allow you to Run/Halt, Step and also rewind through the emulation.
    • The toggle to right of the Step button will put the emulation into video-cycle mode. This will allow you to step by a single color-clock at a time, rather than a single CPU instruction.
    • The < buttons will step back by eith a CPU instruction, a scanline or an entire frame. Stepping back by video-cycle is not currently supported.
  • The Timer window shows the current state of the RIOT Timer.
  • The CPU window shows the current state of the 6507.
  • The Disassembly window shows the disassembled ROM.
    • If a 'DASM' generated symbol file is available then that will be used.
    • If a symbols file isn't available then the standard symbols will be used. This includes symbols for special cartridge areas that might exists. For example, a hotspot address for switching banks will be indicated with BANK1, BANK2, etc. instead of the address.
    • Add or remove a PC Breakpoint by clicking on the address.
  • The RAM window shows the contents of the VCS RAM. Cartidge RAM if available will be show in the Cartridge RAM window. Not shown but available through the cartridge menu when appropriate.
    • The highlighted bytes indicate those bytes that have changed since the emulation last halted.
  • The TIA window details the six graphical parts of the VCS's graphics chip.
    • The state of the TIA can be changed manually but note that the changes will not be retained when the emulation next updates that part of the TIA.

Note that much of the information presented in the windows is editable. For example, the contents of the CPU's PC register can be edited via the window. As in all areas of this project, the user is encouraged to experiment.

A (old) video of the debugger in action can be found here.

Debugger Terminal

As an alternative to GUI interaction the debugger can also be controlled through a terminal. This is available through the terminal window. The rest of this section describes the operation of the terminal in detail.

Help is available with the HELP command. Help on a specific topic is available by specifying a keyword. The list below shows the currently defined keywords. The rest of the section will give a brief run down of debugger features.

[ $f000 SEI ] >> help
         AUDIO          BALL         BREAK     CARTRIDGE         CLEAR
    CONTROLLER           CPU   DISASSEMBLY       DISPLAY          DROP
          GREP          HALT          HELP        INSERT      KEYBOARD
          LAST          LINT          LIST           LOG        MEMMAP
      MEMUSAGE       MISSILE        ONHALT        ONSTEP       ONTRACE
         PANEL         PATCH          PEEK        PLAYER     PLAYFIELD
       PLUSROM          POKE         PREFS       QUANTUM          QUIT
           RAM         RESET        REWIND          RIOT           RUN
        SCRIPT          STEP         STICK        SYMBOL           TIA
         TRACE          TRAP            TV         WATCH

The debugger allows tab-completion in most situations. For example, pressing W followed by the Tab key on your keyboard, will autocomplete the WATCH command. This works for command arguments too. It does not currently work for filenames, or symbols. Given a choice of completions, the Tab key will cycle through the available options.

Addresses can be specified by decimal or hexadecimal. Hexadecimal addresses can be written 0x80 or $80. The debugger will echo addresses in the first format. Addresses can also be specified by symbol if one is available. The debugger understands the canonical symbol names used in VCS development. For example, WATCH NUSIZ0 will halt execution whenever address 0x04 (or any of its mirrors) is written to.

Watches are one of the three facilities that will halt execution of the emulator. The other two are TRAP and BREAK. Both of these commands will halt execution when a "target" changes or meets some condition. An example of a target is the Programmer Counter or the Scanline value. See HELP BREAK and HELP TRAP for more information.

Whenever the emulation does halt, the ONHALT command will run. For example, a previous call to ONHALT CPU will cause the CPU command to run whenever the emulation stops. Similarly, the ONSTEP command applies whenever the emulation is stepped forward. By default, the LAST command is run on every step.

The debugger can step forward either, one CPU instruction at a time, or by one video cycle at a time. We can change this mode with the QUANTUM command. We can also conveniently use the STEP command, for example STEP CLOCK, performing the quantum change and stepping forward in one go. The STEP command can also be to step forward one scanline or one frame. It can also be used to STEP backwards, although in some cases the REWIND command might be more convenient.

Scripts can be recorded and played back with the SCRIPT command. All commands are available when in script recording mode, except RUN and further SCRIPT RECORD command. Playing back a script while recording a new script is possible.

Rewinding

Gopher2600 allows emulation state to be rewound to an earlier frame, scanline or colour-clock. Rewinding by frame is best done through the Control window of the debugger.

control window

The slider can be scrolled to any frame between the two limits indicated. Alternatively, a single frame can be stepped back and forward using the arrow buttons.

Rewinding to a scanline/colour-clock is done by clicking the left mouse button on the debug screen, at the position required. This will change the state of the emulation accordingly. This can be done with any frame in the rewind history without damaging the rewind history.

The rewind history will be cropped and continue from the current point whenever the emulation is run or stepped.

The number of rewind states stored can be set via the preferences window (or through the terminal). In addition the snapshot frequency can also be altered. The frequency defines how many frames must pass before another snapshot is taken. This affects the number of frames that can be stored. For example, if number of states is 100 and frequency is 1 then one-hundred frames can be stored in the rewind history. On the other hand, if the number of states is 100 and frequency is 5 then five-hundred frames can be stored.

The rewind frequency does not affect the granularity of the rewind history. This means that you can rewind to any frame in the rewind history even if no no explicit snapshot has been taken.

The downside of large frequencies is that input events (from a joystick for example) may be lost if they occurred between snapshots. Future versions of Gopher2600 will correct this.

Rewind is also not currently available in playmode. Again, future version of Gopher2600 will allow this.

Video quantum is also not fully supported. While the rewind system will work when in video-stepping mode you can not currently interactively alter the screen position to the level of an individual colour-clock. Left-clicking on the screen, as described above, will 'quantise' to the next CPU instruction. Future versions of Gopher2600 will correct this.

TIA Revisions

Gopher2600 supports common revisions in the TIA chip. The configuration window is accessible through the debugger and through the playmode. In the latter case by pressing F9.

A summary of the known TIA revisions / bugs can be found at on Atari Compendium. Not all revisions / bugs are supported by Gopher2600 but the common ones are.

CRT Effects

Gopher2600 offers basic emulation of a CRT television. This is by no means complete and is an area of active development.

By default playmode enables CRT effects. You can turn them off with a commandline switch:

> gopher2600 -crt=false roms/Pitfall.bin

Individual CRT effects can be turned on and off. From the debugger select the CRT Preferences entry in the Debugger menu. The following window will be shown:

crt preferences window

The preview window give an impression of the effect the CRT preferences on the current ROM. You can move the preview image by dragging it with the mouse.

From playmode, the preferences window can by opened by pressing F10. An example of the screen shot is given below.

crt playmode preferences window

Configuration Directory

Gopher2600 will look for certain files in a configuration directory. The location of this directory depends on whether the executable is a release executable (built with "make release") or a development executable (made with "make build"). For development executables the configuration directory is named .gopher2600 and is located in the current working directory.

For release executables, the directory is placed in the user's configuration directory, the location of which is dependent on the host OS. On modern Linux systems, the location is .config/gopher2600.

For MacOS the directory for release executables is ~/Library/Application Support/gopher2600

For Windows, a gopher2600 will be placed somewhere in the user's %AppData% folder, either in the Local or Roaming sub-folder.

In all instances, the directory, sub-directory and files will be created automatically as required.

Supercharger ROMs

Gopher2600 can load supercharger tapes from MP3 and WAV file, in addition to supercharger BIN files.

Multiload "tapes" are supported although care should be taken in how multiload files are created.

In the case of BIN files a straight concatenation of individual files should work, resulting in a file that is a multiple of 8448 bytes.

For MP3 and WAV files however, the waveform should be concatenated, not the individual MP3/WAV files themselves. A command line tool like SoX can be used for this, or a graphical program like Audacity if you prefer.

Of course, in all cases, the individual parts must be part of a multiload set for this to work.

Supercharger BIOS

Supercharger eulation relies on the presence of the real Supercharger BIOSt. The file must be named one of the following:

  • Supercharger BIOS.bin
  • Supercharger.BIOS.bin
  • Supercharger_BIOS.bin

The file can be placed in the current working directory or in the same directory as the Supercharger file being loaded. Alternatively, it can be placed in the emulator's configuration directory.

SaveKey

Gopher2600 has basic support for the SaveKey peripheral. This will be expanded on in the future.

For now, the presence of the peripheral must be specified with the -savekey arugment. This is only available in play and debug mode. The simplest invocation to load a ROM with the SaveKey peripheral:

> gopher2600 -savekey roms/mgd.bin

Note that the SaveKey will always be inserted in the second player port.

Data saved to the SaveKey will be saved in the configuration directory to the binary file named simply, savekey.

PlusROM

The Atari2600 Pluscart is a third-party peripheral that gives the Atari2600 internet connectivity. Gopher2600 will automatically determine when a PlusROM enabled ROM is loaded.

The very first time you load a PlusROM cartridge you will be asked for a username. This username along with the automatically generated ID, will be used to identify you on the PlusROM server (different ROMs can have different servers.)

plusrom cartridges ask for a username

You can change your username through the debugger, either through the PlusROM preferences window or through the terminal with the PLUSROM command.

PlusROM cartridges are rewindable but cannot be rewound backwards past a network event 'boundary'. This to prevent the resending of already sent network data.

ARM7TDMI Emulation

Gopher2600 emulates the ARM7TDMI CPU that is found in the Harmony cartridge. The presence of this CPU allows for highly flexible coprocessing.

Although the Harmony itself executes in both ARM and Thumb modes, Gopher2600 currently only emulates Thumb mode. It has been decided that ARM mode emulation is not required - better to reimplement the ARM driver in the emulator's host language (Go) - but it may be added in the future.

Debugging support for the ARM7TDMI is rudimentary. A last execution window is available. This shows the disassembly of the most recent execution of the ARM program. The window is available via the ARM7TDMI menu which will appear in the menubar if the coprocessor is present.

ARM7 last execution
window

Note the Goto button. This is a rewind shortcut that takes the emulation to the point where the ARM program last executed.

Estimation of ARM Execution Time

In the real Harmony hardware the ARM program runs whenever the CALLFN register is written to. While it is running the 6507 program is stalled until the ARM program finishes. This means that ARM programs that run for too long can interfere with the normal operation of the console.

Gopher2600 tries to emulate the real behaviour of the hardware, the benefits of this being seen in the debugger. The image below shows the ARM7TDMI overlay. The period when the ARM is active is highlighted with purple pixels.

ARM7 execution duration overlay

While the operation of all ARM using cartridges is accuration (ie. DPC+ and CDF/CDFJ cartridges) the length of time for which the ARM program runs is difficult to estimate. The time indicated in the debugging overlay therefore is only an estimate and there is no substitute for testing ROMs on real hardware. None-the-less the overlay provides an indication of programs that might be problematic.

This area of the project is an ongoing area of improvement and future versions aim to make this measurement 100% accurate.

Movie Cart

Movie Cart is a new cartridge type specifically aimed at playing full length movies on the Atari VCS. The reference code and circuit board information can be found on Github: https://github.com/lodefmode/moviecart.

Gopher2600 allows Movie Cart files to be played just like any other ROM. Files must have the '.mvc' file extension and can only be streamed from the a local filing system. Streaming over HTTP will be supported in the future.

Recording Gameplay

Gopher2600 can record all user input and playback for future viewing. This is a very efficient way of recording gameplay and results in far smaller files than a video recording. It also has other uses, not least for the recording of complex tests for the regression database.

To record a gameplay session, use the record flag. Note that we have to specify the run mode for the flag to be recognised:

> gopher2600 run -record roms/Pitfall.bin

This will result in a recording file in your current working directory, with a name something like:

> recording_Pitfall_20200201_093658

To playback a recording, simply specify the recording file instead of a ROM file:

> gopher2600 recording_Pitfall_20200201_093658

Regression Database

Adding

To help with the development process a regression testing system was added. This will prove useful during further development. To quickly add a ROM to the database:

> gopher2600 regress add roms/Pitfall.bin

By default, this adds a "video digest" of the first 10 frames of the named ROM. We can alter the number of frames, and also other parameters with regress add mode flags. For example, to run for 100 frames instead of 10:

> gopher2600 regress add -frames 100 roms/Pitfall.bin

The database also supports the adding of playback files. When the test is run, the playback file is run as normal and success measured. To add a playback to the test data, simply specify the playback file instead of a rom:

> gopher2600 regress add recording_Pitfall_20200201_093658

Consult the output of gopher2600 regress add -help for other options.

Listing

To listing all previously add tests use the "list" sub-mode:

> gopher2600 regress list
> 000 [video] player_switching [AUTO] frames=10  [NUSIZ]
> 001 [video] NUSIZTest [AUTO] frames=10  [NUSIZ]
> 002 [video] testSize2Copies_A [AUTO] frames=10  [NUSIZ]
> 003 [video] testSize2Copies_B [AUTO] frames=10  [NUSIZ]
> 004 [video] player8 [AUTO] frames=10  [NUSIZ]
> 005 [video] player16 [AUTO] frames=10  [NUSIZ]
> 006 [video] player32 [AUTO] frames=10  [NUSIZ]
> 007 [video] barber [AUTO] frames=10  [NUSIZ]
> 008 [video] test1.bas [AUTO] frames=10  [TIMER]
> 009 [video] test2.bas [AUTO] frames=10  [TIMER]
> 010 [video] test3.bas [AUTO] frames=10  [TIMER]
> 011 [video] test4.bas [AUTO] frames=10  [TIMER]
> Total: 12

Running

To run all tests, use the run sub-mode:

> gopher2600 regress run

To run specific tests, list the test numbers (as seen in the list command result) on the command line. For example:

> gopher2600 regress run 1 3 5

An interrupt signal (ctrl-c) will skip the current test. Two interrupt signals within a quarter of a second will stop the regression run completely.

Deleting

Delete tests with the delete sub-mode. For example:

> gopher2600 regress delete 3

ROM Setup

The setup system is currently available only to those willing to edit the "database" system by hand. The database is called setupDB and is located in the project's configuration directory. The format of the database is described in the setup package. Here is the direct link to the source level documentation: https://godoc.org/github.com/JetSetIlly/Gopher2600/setup

This area of the emulation will be expanded upon in the future.

Supported Cartridge Formats

Gopher2600 currently supports the following formats:

  • Atari 2k/4k/16/32k
  • all of the above with the superchip
  • CBS (FA)
  • Tigervision (3F)
  • Parker Bros (E0)
  • M-Network (E7)
  • DPC
  • Superbank

In also supports the Supercharger format in both the .bin format and is also able to load from an MP3 recording of the supercharger tape.

Modern formats supported:

  • 3E
  • 3E+
  • DF
  • DPC+
  • CDF (including CDFJ)

The last two formats often make use of the ARM7TDMI coprocessor as found in the Harmony cartridge and are fully supported by Gopher2600.

Missing Formats:

  • X07. This was only ever used as far as I know, with Stella's Stocking which has never been released (ROM dumped).

Statistics Viewer

Playmode and debug mode can both be launched with a statistics viewer available locally on your machine localhost:12600/debug/statsview.

> gopher2600 -statsview <rom>

> gopher2600 debug -statsview <rom>

The screen below shows an example of the featured statistics. In this instance, this is the debugger running a 4k Atari cartridge (specifically, Pitfall).

stats server example charts (for the debugger)

For people who really want to dig deep into the running program, localhost:12600/debug/pprof/ gives more raw, but still useful information.

Note that this feature requires you run a suitably compiled executable. The easiest way to do this is to use the Makefile.

> make release_statsview

Gopher2600 Tools

See the https://github.com/JetSetIlly/Gopher2600-Utils/ repository for examples of tools that use Gopher2600.

Resources used

The Stella project (https://stella-emu.github.io/) was used as a reference for video output. In the absence of VCS hardware (which I don't have) Stella was the only option I had for checking video accuracy.

No reference to the Stella source was made at all except for the following:

  • During the development of the CDF cartridge formats. These recent formats don't seem to be documented anywhere accept in the Stella source.

  • The audio sub-system to convince myself that I was going about the problem correctly. Primarily however, Gopher2600's audio implementation references Ron Fries' original TIASound.c file.

  • ParkerBros fingerprint taken from Stella. I can't remember why I did this but a comment in the fingerprint.go file says I did.

Many notes and clues from the AtariAge message boards. Most significantly the following threads proved very useful indeed:

  • "Cosmic Ark Star Field Revisited"
  • "Properly model NUSIZ during player decode and draw"
  • "Requesting help in improving TIA emulation in Stella"
  • "3F Bankswitching"

And from and old mailing list:

These mailing lists and forums have supplied me with many useful test ROMs. I will package these up and distribute them sometime in the future (assuming I can get the required permissions).

Extensive references have been made to Andrew Towers' "Atari 2600 TIA Hardware Notes v1.0"

Cartridge format information was found in Kevin Horton's "Cart Information v6.0" file (sometimes named bankswitch_sizes.txt)

The "Stella Programmer's Guide" by Steve Wright is of course a key document, used frequently throughout development.

The 6507 information was taken from Leventhal's "6502 Assembly Language Programming" and the text file "64doc.txt" v1.0, by John West and Marko Makela.

US Patent Number 4,644,495 was referenced for the implementation of the DPC cartridge format (the format used in Pitfall 2)

DPC+ format implemented according to notes provided by Spiceware https://atariage.com/forums/topic/163495-harmony-dpc-programming and https://atariage.com/forums/blogs/entry/11811-dpcarm-part-6-dpc-cartridge-layout/

DPC+ARM information on Spiceware's blog https://atariage.com/forums/blogs/entry/11712-dpc-arm-development/?tab=comments#comment-27116

The "Mostly Inclusive Atari 2600 Mapper / Selected Hardware Document" (dated 03/04/12) by Kevin Horton

Supercharger information from the Kevin Horton document above and also the sctech.txt document

Reference for the ARM7TDMI thumb instruction set, as used by the Harmony cartridge formats:

https://edu.heibai.org/ARM%E8%B5%84%E6%96%99/ARM7-TDMI-manual-pt3.pdf

Further information from the ARM Architecture Reference Manual:

http://www.ecs.csun.edu/~smirzaei/docs/ece425/arm7tdmi_instruction_set_reference.pdf

https://www.cs.miami.edu/home/burt/learning/Csc521.141/Documents/arm_arm.pdf

Further Help

In addition to this readme, more information can be found with the command line -help system. Many modes and sub-modes will accept operational flags. Specifying the -help flag will print a brief summary of available options.

Help on debugger commands is available with the HELP command at the debugger command line.

More information is available in the Go source files and can be viewed with the Go documentation system. With godoc installed:

> GOMOD=$(pwd) godoc -http=localhost:1234 -index >/dev/null &

Alternatively, the most current version of the docs available on github can be viewed at https://godoc.org/github.com/JetSetIlly/Gopher2600

Finally, development and maintenance documentation is beginning to be stored in its own Github repository: https://github.com/JetSetIlly/Gopher2600-Dev-Docs

Self Reflection

There are some design decisions that would perhaps be made differently if I had known where the program was going. For instance, because the project was a way of learning a new programming language I chose to implement my own "database" to store regression test information. A more natural choice would be to use SQlite but actually the current solution works quite well.

A couple of packages may well be useful in other projects. The prefs package is quite versatile. With a bit of work it could be generalised and put to use in other projects. I think though, this package is a natural candidate to be rewritten with type parameters. Not yet available in Go but scheduled for release in 2022.

I would also replace the commandline package. It works quite nicely but as you would expect from a home-baked solution there are limitations to the parser. It should be rewritten with flex & yacc.

Other Software / Libraries

The following projects are used in the Gopher2600 project:

Statsview provided by:

For testing instrumentation:

Some ideas for the fragment shader taken from:

Comments
  • Checkptr failure

    Checkptr failure

    As of version 1.14 of Go the race detector adds checkptr instrumention. This compilation option ensures that program's follow Go's unsafe.Pointer safety rules. https://golang.org/doc/go1.14#compiler

    Currently, Gopher2600 fails the checkptr test because of how fonts are setup for imgui-go. To wit, the following triggers the checkptr error:

    // Store our identifier rnd.imguiIO.Fonts().SetTextureID(imgui.TextureID(rnd.fontTexture))

    fontTexture has previously been generated and bound and has the value 0. imgui.TextureID casts that value to a uintptr and thus triggers the error (pointer value too low).

    It is possible to turn off checkptr with a build flag (the Makefile includes a race target that does this):

    go run -race -gcflags=all=-d=checkptr=0 gopher2600.go debug

    This is useful because it has allowed gopher2600 to be cleaned of race errors but the checkptr error remains.

    In a nutshell, I'm not sure how to fix it. As far as I can tell, the fontTexture value is not really a pointer but casting it to uintptr raises the suspicions of the checkPtrcode. I also cannot see how to alter imgui-go in such a way to avoid using uintptr.

    help wanted 
    opened by JetSetIlly 5
  • RIOT port B output functionality missing

    RIOT port B output functionality missing

    Setting RIOT port B as output doesn't seem to be implemented in Gopher2600.

    Despite what the "Stella Programmer Guide" says, Port B is fully configurable just like port A, and in fact the 3 unused bit can be used as extra storage if set as output.

    More info and a few test roms here: https://atariage.com/forums/topic/167173-what-does-the-game-select-switch-actually-do/

    The following roms are the one I posted here https://atariage.com/forums/topic/192031-stella-35-released/?do=findComment&comment=2435332 with just a minor change (writes to SWCHA/B now only happen when you actually change the value for those, while before they were written also when you changed SWACNT/SWBCNT) riot_port_test_v2.zip

    In the debugger it would be useful to see both the "Data Register" (in Stella indicated as "SWCHA(W)"/"SWCHB(W)" ) as well as the value that can be read from the port, as they can differ depending on how the "Data Direction Register" (SWACNT/SWBCNT) is set.

    opened by ale-79 4
  • cannot load an 3E+ cart

    cannot load an 3E+ cart

    Hey! Great emulator, and wonderful, clear code. (I poked into the mapper code to see if I could hunt down this bug.)

    Stella accepts these 3E+ cart demos I was working on, which run and display a rather ugly X/O pattern.

    The first game-9k.e3p loads in debug mode until you try to run it, but is then rejected in run mode probably due to its 9 KB size:

    * error in RUN mode: playmode: setup: cartridge: 3E: wrong number of bytes in the cartridge data
    

    The second game-8k.e3p is the same code. Just shrunk down to 8 KB (a normal power of 2). It loads in RUN mode, and then does nothing and seems to freeze the emulator entirely. But when in DEBUG mode it prints this and quits:

    * error in DEBUG mode: debugger: disassembly: bless: cartridge does not reset to an address in the cartridge area.
    

    I use banks-witching very aggressively, which may be why? I'm not sure Stella should accept it either, honestly... but it does run in Stella.

    Attached is a zip file with the two ROM images.

    game.zip

    opened by retrac0 4
  • Doesn't build on my machine - Xubuntu 18.04

    Doesn't build on my machine - Xubuntu 18.04

    1. Installed go V1.13.4 as detailed on Go website
    2. Grabbed the repo
    3. typed 'make release' as detailed in the README...

    Output:

    [email protected]:~/Applications/Gopher2600$ make release go build -gcflags '-c 3 -B -+ -wb=false' . gopher2600.go:24:2: cannot find package "gopher2600/cartridgeloader" in any of: /usr/local/go/src/gopher2600/cartridgeloader (from $GOROOT) /home/link/go/src/gopher2600/cartridgeloader (from $GOPATH) gopher2600.go:25:2: cannot find package "gopher2600/debugger" in any of: /usr/local/go/src/gopher2600/debugger (from $GOROOT) /home/link/go/src/gopher2600/debugger (from $GOPATH) gopher2600.go:26:2: cannot find package "gopher2600/debugger/terminal" in any of: /usr/local/go/src/gopher2600/debugger/terminal (from $GOROOT) /home/link/go/src/gopher2600/debugger/terminal (from $GOPATH) gopher2600.go:27:2: cannot find package "gopher2600/debugger/terminal/colorterm" in any of: /usr/local/go/src/gopher2600/debugger/terminal/colorterm (from $GOROOT) /home/link/go/src/gopher2600/debugger/terminal/colorterm (from $GOPATH) gopher2600.go:28:2: cannot find package "gopher2600/debugger/terminal/plainterm" in any of: /usr/local/go/src/gopher2600/debugger/terminal/plainterm (from $GOROOT) /home/link/go/src/gopher2600/debugger/terminal/plainterm (from $GOPATH) gopher2600.go:29:2: cannot find package "gopher2600/disassembly" in any of: /usr/local/go/src/gopher2600/disassembly (from $GOROOT) /home/link/go/src/gopher2600/disassembly (from $GOPATH) gopher2600.go:30:2: cannot find package "gopher2600/errors" in any of: /usr/local/go/src/gopher2600/errors (from $GOROOT) /home/link/go/src/gopher2600/errors (from $GOPATH) gopher2600.go:31:2: cannot find package "gopher2600/gui" in any of: /usr/local/go/src/gopher2600/gui (from $GOROOT) /home/link/go/src/gopher2600/gui (from $GOPATH) gopher2600.go:32:2: cannot find package "gopher2600/gui/sdldebug" in any of: /usr/local/go/src/gopher2600/gui/sdldebug (from $GOROOT) /home/link/go/src/gopher2600/gui/sdldebug (from $GOPATH) gopher2600.go:33:2: cannot find package "gopher2600/gui/sdlplay" in any of: /usr/local/go/src/gopher2600/gui/sdlplay (from $GOROOT) /home/link/go/src/gopher2600/gui/sdlplay (from $GOPATH) gopher2600.go:34:2: cannot find package "gopher2600/modalflag" in any of: /usr/local/go/src/gopher2600/modalflag (from $GOROOT) /home/link/go/src/gopher2600/modalflag (from $GOPATH) gopher2600.go:35:2: cannot find package "gopher2600/paths" in any of: /usr/local/go/src/gopher2600/paths (from $GOROOT) /home/link/go/src/gopher2600/paths (from $GOPATH) gopher2600.go:36:2: cannot find package "gopher2600/performance" in any of: /usr/local/go/src/gopher2600/performance (from $GOROOT) /home/link/go/src/gopher2600/performance (from $GOPATH) gopher2600.go:37:2: cannot find package "gopher2600/playmode" in any of: /usr/local/go/src/gopher2600/playmode (from $GOROOT) /home/link/go/src/gopher2600/playmode (from $GOPATH) gopher2600.go:38:2: cannot find package "gopher2600/recorder" in any of: /usr/local/go/src/gopher2600/recorder (from $GOROOT) /home/link/go/src/gopher2600/recorder (from $GOPATH) gopher2600.go:39:2: cannot find package "gopher2600/regression" in any of: /usr/local/go/src/gopher2600/regression (from $GOROOT) /home/link/go/src/gopher2600/regression (from $GOPATH) gopher2600.go:40:2: cannot find package "gopher2600/television" in any of: /usr/local/go/src/gopher2600/television (from $GOROOT) /home/link/go/src/gopher2600/television (from $GOPATH) gopher2600.go:41:2: cannot find package "gopher2600/wavwriter" in any of: /usr/local/go/src/gopher2600/wavwriter (from $GOROOT) /home/link/go/src/gopher2600/wavwriter (from $GOPATH) Makefile:16: recipe for target 'release' failed make: *** [release] Error 1 [email protected]:~/Applications/Gopher2600$

    opened by mslinklater 4
  • TIA

    TIA "undriven" pins

    Following today discussion on AA about the undriven TIA pins, I did check on Gopher2600 and found a couple of issues.

    Here is a test rom that I wrote a while ago (to show similar problems that were in Stella). tiadriven_test.zip

    The rom reads from addresses $00 to $0f, and displays the results on screen.

    The registers are read with the instruction

    lda $ff,x

    with x ranging from $01 to $10.

    In this case, the last value on the bus that will affect bits 0 - 5 is the value stored in ram address "$ff" (because the 6502 performs an extra fetch from the base address before adding the index, as described here). The test rom changes that value at address $ff every 30 frames alternating between $ff and $00.

    So with "random pins" off, bits 5 to 0 should alternate between "0" and "1" every half second. This is also the result that you (typically) get on real hardware.

    On Gopher instead those bits currently take their value from the register address.

    The second issue is with the input registers INPT0 to INPT5, where bit 6 must always read as "0", no matter how the "random pins" option is set.

    opened by ale-79 3
  • include domain name in module paths; local module paths may be reserved in the future

    include domain name in module paths; local module paths may be reserved in the future

    First of, really cool work @JetSetIlly! I tried running Gopher2600 on two games and it worked well :)

    screenshot_2020-03-21_23:10:38

    As I wanted to dive into the documentation of the project, I checked the GoDoc page. At the end of the page, I noticed these warnings:

    The go get command cannot install this package because of the following issues:
    
        Unrecognized import path "gopher2600/wavwriter" (gopher2600.go:42:2)
        Unrecognized import path "gopher2600/gui/sdldebug" (gopher2600.go:32:2)
        Unrecognized import path "gopher2600/gui/sdlimgui" (gopher2600.go:33:2)
        Unrecognized import path "gopher2600/disassembly" (gopher2600.go:29:2)
        Unrecognized import path "gopher2600/playmode" (gopher2600.go:38:2)
    

    If possible, I'd suggest updating the module path to github.com/jetsetilly/gopher2600, as this includes the domain name in the fully qualified import path. One reason this is important is that there is a proposal to reserve specific path prefixes for local (user-defined) modules (e.g. local/gopher2600); see golang/go#37641. Since the Gopher2600 project is hosted on a remote site, it makes sense to include the full domain name in the module path.

    Wish you all the best and happy coding.

    Cheers, Robin

    opened by mewmew 3
  • Seg fault trying to debug a ROM

    Seg fault trying to debug a ROM

    Console:

    `[email protected]:~/go/src/gopher2600$ ./gopher2600 debug ~/Code/retrotools/combat.bin

    • symbols error: no symbols file for /home/link/Code/retrotools/combat.bin
    • error running debugger initialisation script: script error: cannot open script file (open /home/link/.config/gopher2600/debuggerInit: no such file or directory) panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0x66fa97]

    goroutine 1 [running, locked to thread]: gopher2600/debugger/script.(*Rescribe).TermRead(0x0, 0xc00000ab00, 0xff, 0xff, 0xc00001a380, 0x12, 0x6, 0xc000062720, 0xc0000e1220, 0x203000, ...) /home/link/go/src/gopher2600/debugger/script/rescribe.go:90 +0x37 gopher2600/debugger.(*Debugger).inputLoop(0xc000001c80, 0x85e4a0, 0x0, 0x0, 0xc000495ad0, 0x1) /home/link/go/src/gopher2600/debugger/inputloop.go:170 +0xc83 gopher2600/debugger.(*Debugger).Start(0xc000001c80, 0xc0000184e0, 0x2a, 0x7ffd13125425, 0x25, 0x7d722c, 0x4, 0x0, 0x0, 0x0, ...) /home/link/go/src/gopher2600/debugger/debugger.go:223 +0x668 main.debug.func1(0x865760, 0xc0000835f0) /home/link/go/src/gopher2600/gopher2600.go:206 +0xf5 main.debug(0xc0000e2180, 0x0, 0x0) /home/link/go/src/gopher2600/gopher2600.go:223 +0x7f3 main.main() /home/link/go/src/gopher2600/gopher2600.go:76 +0x304 `

    opened by mslinklater 3
  • Apple Ventura VSYNC issues

    Apple Ventura VSYNC issues

    There appears to be VSYNC issues with Apple Ventura. This occurred with Monterey when it was first released, and has recently reappeared with Ventura.

    https://github.com/libsdl-org/SDL/issues/4918

    Pinning this issue until it is known to have been resolved.

    bug 
    opened by JetSetIlly 1
  • make table.go recognizable as generated

    make table.go recognizable as generated

    Generated go source code should contain a file matching the regex: ^// Code generated .* DO NOT EDIT.$ This allows tools to discern generated code. See: https://golang.org/s/generatedcode https://golang.org/pkg/cmd/go/internal/generate/

    opened by srlehn 1
  • gopher2600: use fully qualified import path as module path

    gopher2600: use fully qualified import path as module path

    Fixes #4.

    This change was generated automatically by running:

    $ find . -type f -name '*.go' | xargs -I '{}' sar -i '"gopher2600/' '"github.com/jetsetilly/gopher2600/' '{}'
    $ find . -type f -name '*.go' | xargs -I '{}' goimports -w '{}'
    

    Using goimports of x/tools to format imports and sar to search and replace (using regexp).

    opened by mewmew 1
  • Apple M2

    Apple M2

    Would anyone with access to a Mac with an M2 processor be able to help me debug an issue I'm having with Gopher2600?

    The emulator has worked well for several years on Linux, Windows and MacOS (Intel CPUs) but will immediately crash when compiled for MacOS with an M2.

    The problem I'm having is that I don't have M2 hardware immediately available:

    The error printed to stdout in the event of the crash is:

    "signal 16 received but handler not on signal stack fatal error: non-Go code set up signal handler without SA_ONSTACK flag"

    Looking at the go.mod file we can see there are a couple of packages that might be the cause of this and the documentation for the signal package explains why.

    https://pkg.go.dev/os/signal#hdr-Go_programs_that_use_cgo_or_SWIG

    Yes, this should be fixed but more importantly, there is some other error, probably in my Go code, that is causing the signal to be raised.

    The help I need therefore is:

    1. Figuring out which package is not setting up a signal handler correctly
    2. Finding the reason why the signal is being raised.
    bug help wanted 
    opened by JetSetIlly 1
Releases(v0.19.3)
  • v0.19.3(Oct 5, 2022)

    Changes from v0.19.2

    • implemented CommaVid cartridge mapper
    • no fingerprinting so -mapping CV command line required
    • or, change the file extension of the ROM file to .cv
    • RIOT timer
    • PA7 bit reset immediately on TIMINT access
    • previously the reset was delayed to when the timer expired
    • Debug Screen
    • element reflector works in HBLANK when debug colours are enabled
    • RAM window
    • RTS prediction no longer affects debugging information for the memory subsystem.
    • in particular this fixes the information presented in the 6507 Pinout window
    • GUI
    • window is raised and selected on mode switch
    Source code(tar.gz)
    Source code(zip)
    gopher2600_linux_amd64(10.68 MB)
    gopher2600_windows_amd64.exe(12.66 MB)
  • v0.19.2(Aug 28, 2022)

  • v0.19.1(Aug 25, 2022)

    Changes from v0.19.0

    • Makefile
    • Apple Macs with an ARM chip will no longer use freetype font rendering when built with the build or release targets
    • see issue https://github.com/JetSetIlly/Gopher2600/issues/19
    • Display
    • changed relationship between the frame rate limiter and monitor synchronisation. this may result in a performance improvement on some systems
    • uncapped FPS no longer uses input buffer. this resulted in choppy visuals
    • fixed visual bug seen when switching from playmode to the debugger when one or the other mode had a "maximised" window
    • TIA
    • missile sprites were not plumbed to player correctly after gameplay rewinding. this affected missiles that rely on RESMPx for positioning
    • Rewind
    • joystick and gamepad controllers resume from a neutral position after gameplay rewind
    • ARM Developer
    • statistics more carefully collated during rewinding to avoid spikes in the data
    • CRT effect
    • added rounded corners option

    As of this version I will no longer be compressing the linux/amd64 version with UPX

    Source code(tar.gz)
    Source code(zip)
    gopher2600_linux_amd64(10.67 MB)
    gopher2600_windows_amd64.exe(12.65 MB)
  • v0.19.0(May 30, 2022)

  • v0.18.0(May 21, 2022)

    Changes from v0.17.0

    • ARM Developer
    • debugging window added for global variable inspection
    • collision detection of ARM stack with program variables
    • static areas window improved
      • clearer indication of memory addresses
      • labeling of named variables in memory
    • performance window improved
      • raw ARM cycle values in addition to percentile values
      • kernel focus (VBLANK, Visible Screen, Overscan)
      • performance relative to frame
    • access of address 0x00 is treated as illegal (probably null dereference)
    • visualisation of CDF streams
    • VCS RAM and Cartridge RAM Window
    • indicates labeling of addresses (using ASM symbol file)
    • illustration of 6507 stack usage
    • Peripherals
    • choice of attached peripheral can be overriden on startup
    • TIA bug fixes
    • corrected missile reset to player position for double-width player
    • Savekey/Atarivox
    • EEPROM window (savekey data) works correctly for AtariVox
    • Debugger
    • BREAK NONEXE to halt execution on 6507 execution if PC address is not in the Cartridge or RAM areas
    • Debugger GUI
    • better window management in the debugger
    • window state (open/close) saved between sessions
    • Playmode GUI
    • non-integer scaling reintroduced - improved scaling method to avoid uneven scanlines
    • bugfix (Windows and MacOS)
      • window repainted during window resizing meaning better visual feedback for the user
    • audio can be muted (could already be muted in the debugger)
    • state of FPS overlay will carried over between sessions
    • "active" pause screen readded as an option (in the prefs window)
    Source code(tar.gz)
    Source code(zip)
    gopher2600_linux_amd64.zip(4.30 MB)
    gopher2600_windows_amd64.zip(5.07 MB)
  • v0.17.0(Apr 7, 2022)

    Changes from v0.16.0

    • ARM Developer
    • requirement for .obj and .map files replaced with DWARF data
    • performance and source windows improved
    • ARM
    • improved accuracy of T1TC timer
    • cycle counting corrected (by one color clock) on CALLFN exit
    • clock speed definable
    • AtariVox
    • added support for AtariVox
    • currently only supports Festival for voice synthesis
    • missing some AtariVox sounds and effects
    • 6507
    • all 256 opcodes implemented
    • SaveKey
    • removed (small) performance bottleneck
    • PlusROM
    • update network headers to emulate firmware >= v2.1.1
    • GUI
    • default Dear Imgui font replaced with JetBrainsMono
    • font size definable
    • Documentation
    • Usage documentation now in wiki https://github.com/JetSetIlly/Gopher2600-Docs/wiki
    Source code(tar.gz)
    Source code(zip)
    gopher2600_linux_amd64.zip(4.22 MB)
    gopher2600_windows_amd64.zip(5.00 MB)
  • v0.16.0(Jan 29, 2022)

    Changes from v0.15.0

    ARM

    • added support for obj and map files for ARM based ROM projects
      • requires that obj and map file to be created as part of the ROM file's compilation process
      • see https://github.com/JetSetIlly/Adventureland-2600 for example of a project setup for this
    • added source code, performance and illegal access window. for ROMs where obj and map files are available
    • fixed: crash was possible if cart was changed from ARM to non-ARM when coprocessor disasm window was open - a race condition with the "lazy data" system

    6507

    • zero-page indexed addressing causes phantom read correctly
      • this corrects the read values of the TIA registers (collision registers etc) when read with a zero-paged indexed instruction
      • other addressing modes already caused correct phantom reads

    RIOT

    • port B is now writable from the CPU

    Debugger GUI

    • ports window replaces chip registers window
    • timer window improved. fixed bug in ticks remaining display and added TIMINT field
    • disassembly window improvements
    • peripherals window replaces controllers window
    • 6507 Pinout window showing the state of the address and data bus on any given color clock

    Television

    • audio will always play regardless of frame stability
      • an extra condition testing for stability on startup meant that some ROMs never outputted sound if they never reached stability. this rarely matters but it affected the tunabit demo ROM in particular
    • added 'Sync On Power' CRT option
      • this will cause the screen to roll on startup

    RIOT/Peripherals

    • VBLANK latch bit applies only to INPT4 and INPT5
    • added support for Genesis controllers
    • automatic detection of controllers (using Stella fingerprints)

    Cartridge Formats

    • added support for EF (with or without superchip)
    • cartridges with superchip now respond correctly to phantom memory accesses (causing phantom writes in some cases)
    • tigervision (3F) now uses the correct method of switching banks
    • missing Supercharger BIOS handled gracefully

    Bots (WIP)

    • added rudimentrary support for bots capable of playing ROMs independently. still a WIP but example bots for spacejockey and video chess have been implemented

    ROM Comparisons (WIP)

    • two ROMs can now be run in parallel and the output compared and differences highlighted. very specialist use and probably not of much interest

    Removals

    • linter. existing version was unused and underdeveloped. will reimplement in the future
    Source code(tar.gz)
    Source code(zip)
    gopher2600_darwin_amd64(4.26 MB)
    gopher2600_linux_amd64(4.13 MB)
    gopher2600_windows_amd64.exe(11.33 MB)
  • v0.15.0(Nov 22, 2021)

    = Changes from v0.14.1 =

    switch between playmode and debugger - using the ` key (immediately below the escape key)

    ROM selector - shows emulated/animated thumbnail for all ROMs

    television - better screen roll - black level adjustment - RF interference effect

    audio - new sound engine based on the work of Chris Bremmer - more reliable buffering of audio. better tolerance of small frame drops - audio tracker and piano keys window (Tools menu in the debugger and F9 hotkey in playmode)

    debugger - timeline window - much faster rewind system. in particular, moving the emulation by clicking on debugging screen is a lot more fluid

    playmode - rewind in playmode - using mouse wheel or shift-arrow-keys - playmode will drop to debugger on breakpoint, trap or watch (condition previously set in debugger)

    temporarily removed - gameplay recording and playback - active pause screen

    Source code(tar.gz)
    Source code(zip)
    gopher2600_linux_amd64(3.58 MB)
    gopher2600_windows_amd64.exe(10.75 MB)
  • v0.14(Sep 16, 2021)

    = Changes from v0.13 =

    Performance - General performance improvements - Using the development platform as a reference, uncapped performance is approximately 10% higher

    Television - Fixed playfield smoothscrolling. VSYNC count not being reset correctly. (Bug introduced during a refactor between v0.12 and v0.13)

    Supercharger - Better WAV/MP3 decoding.

    Moviecart - Updated to new core.bin of parent project

    Playmode - Notification icons for cartridge event - Cassette icon for Supercharge audio files - Network icon for PlusROM network activity - Savekey inserted notification icon

    Audio - Stereo mixing with stereo separation option - More accurate volume mixing for mono signal

    Preferences - All preference options are in a single window - Categorised by tabs - Hotkey for the preferences window in playmode is F10

    Source code(tar.gz)
    Source code(zip)
    gopher2600_amd64_macos(10.40 MB)
    gopher2600_linux_amd64(3.54 MB)
    gopher2600_windows_amd64.exe(10.63 MB)
  • v0.13(Jul 25, 2021)

    = Changes from v0.12.1 =

    ARM7 - Counting of PC access no longer assumed to be in Flash or MAM. Can be in SRAM too - Counting of data access no longer assumed to be in SRAM - MAM estimation improved - ARM7 disassembly window shows cycle profile - "Immediate Mode" option added (mimicking Stella's mode of operation) - "Abort on Illegal Memory Access" option. Ends ARM program prematurely. Will log illegal access in all instances.

    ARM7 corrections - bug in LDMIA if base register was part of the load - format 15 CMP instruction did not set status flags correctly

    ARM7 model selectable - Models supported: LCP2000, STM32F407VGT6 - Memory map only. Other performance characteristics might be different - Work in progress: change through config file

    Debugger/Disassembler - Disassembly path detection improved - Corrected use of read symbols used in disassembly. Write symbols were used in error in some situations.

    MNetwork (E7) fingerprinting accuracy

    TV - CRT ghosting now only applied horizontally - settings for ghosting in CRT preferences - Frame size detection less aggressive - Screen roll sensitivity preference

    Multiple gamepads/sticks supported - All control player zero currently - Other players will be supported once a suitable mechanism for allocating controllers has been settled on

    TIA/RIOT corrections - playfield region now longer relatches if PF0/PF1/PF2 is updated - refined RESPx under HMOVE (TIA revision dependent) - RIOT timer boundaries

    Playmode is pausable

    Debugging screen break menu fixed

    Source code(tar.gz)
    Source code(zip)
    gopher2600_linux_amd64(3.68 MB)
    gopher2600_windows_amd64.exe(10.60 MB)
  • v0.12.1(Jun 18, 2021)

  • v0.12(Jun 17, 2021)

    = Changes from v0.11 =

    Performance improvements - With the Linux binary on my development machine - Typical 2600 ROM: about 9% improvement - ROM using the ARM coprocessor: about 20% improvement

    CRT improvements - CRT sharpness control - Scanline and ShadowMask coarseness controls - Bilinear filter. Improves emulation of brick effect in Zookeeper - Sizing of playmode screen is now limited to whole integers - This prevents color banding in some ROMs

    Television - Screen roll - PAL signal detection improved. Eliminated a false positive

    MovieCart updated to match reference implementation

    Input buffer lowered to five frames. User input should feel better

    Rewinding of PlusROM carts should now work in all instances

    Source code(tar.gz)
    Source code(zip)
    gopher2600_linux_amd64(3.51 MB)
    gopher2600_windows_amd64.exe(10.56 MB)
  • v0.11(Jun 5, 2021)

    = Changes from v0.10.3 =

    Better CRT shaders

    PAL60 TV specification

    CDFJ+ cartridge format

    Screenshots on F12 - Screenshot "mode" selectable with shift and ctrl keys - See README for explanation and for other hotkeys

    Better controller detection - Mouse, gamepad, etc. require "waking up" before activating

    Improved ARM timing - Cycle counting is more accurate - Additional ARM timing preferences - MAM activation options - Missing disassembly mnemonics added

    Windows - Path handling on Windows should be more robust

    Source code(tar.gz)
    Source code(zip)
    gopher2600_linux_amd64(3.54 MB)
    gopher2600_windows_amd64.exe(10.93 MB)
  • v0.10.3(Apr 25, 2021)

    = Changes from v0.10.2 =

    Moviecart format changed to better support new kernel. This update will cause new files to play correctly.

    Old Moviecart files will still play correctly but with wrong colouring in places.

    Referring to the Moviecart project itself for clarity: files in the "format1" directory will play correctly while files in "format0" will not.

    https://github.com/lodefmode/moviecart/tree/main/output/colorizer

    Source code(tar.gz)
    Source code(zip)
    gopher2600_linux_amd64(3.63 MB)
    gopher2600_windows_amd64.exe(10.74 MB)
  • v0.10.2(Apr 24, 2021)

  • v0.10.1(Apr 5, 2021)

  • v0.10(Apr 3, 2021)

    = Changes from v0.9.0 =

    Movie Cart support - Files must end in .mvc - File will be fingerprinted as it is streamed off disk and any errors sent to the log - Demo files in the Movie Cart repository https://github.com/lodefmode/moviecart

    Gamepad alterations - Left thumbstick now controls the joystick and not the paddle - Left/Right Triggers still control the paddle but will no longer auto-centre - Playmode will now notify (with an icon) when a controller type has been switched

    Bug Fixes - Better centering of program counter in Disasm window coord selection (ie. clicking on the debug screen) - Superbank switching fixed

    Windows Bug Fixes - File paths that include the drive letter will now be recognised. This will allow Gopher2600 to be used with Amiga Dev Studio on Windows

    Source code(tar.gz)
    Source code(zip)
    gopher2600_linux_amd64(3.47 MB)
    gopher2600_windows_amd64.exe(10.73 MB)
  • v0.9(Mar 13, 2021)

    = Changes from v0.8.2 =

    Support for common TIA revisions - window available in play mode and debug mode

    Hardware controller support - Tested with wired XBox controller - DPad controls joystick - Left thumb-stick and triggers control paddle - Start button is the conole's reset switch

    Reworked debugger UI - more information in toolbar - better disasm window - improved CPU, TV and Control windows - added RSYNC overlay

    Corrected TV implementation so that smooth Playfield scrolling works

    Cartridge mapping - Superbank support (128k and 256k) - Corrected false positives when fingerprinting for Mnetwork (E7)

    Supercharger improvements - Supercharger tape will stop when ROM stops reading for data - Correctly loads 8-bit WAV data - Improved fastload (.bin files) fingerprinting - Fastload (.bin files) supports multiloading

    Debugger - Mute audio - STEP command can now STEP back - SYMBOL, WATCH, DISASSEMBLY commands changed - small improvements to linter (still not ready for use)

    Playmode - Mouse capture with right mouse button (rather than double-click)

    Source code(tar.gz)
    Source code(zip)
  • v0.8.2(Feb 1, 2021)

    = Changes from v0.8.1 =

    ARM execution time estimation

    • debugging overlay to show period when ARM is executing and 6507 is "idle"

    Fixed bug introduced in v0.8.1 that sometimes caused the ARM emulation to crash

    • related to the optimisation done in the previous version.
    Source code(tar.gz)
    Source code(zip)
  • v0.8.1(Jan 24, 2021)

    = Changes from v0.8.0 =

    Performance improvements - significant speed increase for ARM emulation - particularly noticeble for large ARM programs - small TIA speed improvements

    Screen resizing improved

    MNetwork (E7) fingerprinting improved. Now catches more ROMs created in the modern era (ie. Congo Bongo Demo)

    Source code(tar.gz)
    Source code(zip)
  • v0.8.0(Jan 19, 2021)

    = Changes from v0.7.3 =

    ARM7TDMI support - extended DPC+ to support ARM7TDMI - added CDF format including CDFJ (but not CDFJ+)

    fixed bug in ball sprite vertical delay (visible in Galagon)

    improved performance of rewind system

    improved paddle performance - sensitivity corrected so deadzone is minimal for most ROMs - elminated jitter

    improved CRT effects - now includes a basic phosphor effect - improved chromatic aberration - removed gamma options

    mouse capture in debugger using ESC key - removed double-click on screen feature - UI button also available to capture

    start/stop emulation with ` (backtick) key (debugger only)

    additional playmode keys - toggle full screen (F11) - FPS indicator (F12) - CRT preferences window (F10)

    other improvements - rewind system is faster - less CPU overhead for idle debugger (only tested on Linux) - television frame resizing is more correct

    Source code(tar.gz)
    Source code(zip)
  • 0.7.3(Dec 9, 2020)

  • v0.7.2(Nov 28, 2020)

    = Changes from v0.7.1 =

    Better resizing of television frame - Games like Tapper or Spike's Peak look better

    Frame limiter interacts better with texture renderer - Fewer dropped frames meaning games that use flicker kernels look more accurate - Particularly effective for 60Hz monitors and NTSC

    Nicer visual feedback on the rewind slider

    Playmode: - Toggle fullscreen (F11) - Toggle fps indicator (F12)

    Statsview module bumped v0.3.1 - Fixes problem of missing charts on Windows

    Source code(tar.gz)
    Source code(zip)
  • v0.7.1(Nov 22, 2020)

    = Changes from v0.7 =

    Optional Statsview - Requires appropriate binary along with the argument to use

    Small performance improvements - Less internal copying of memory - Avoiding entering/exiting critical section too often

    Framerate correctly set for PAL specifications

    Regressions tests could fail if RandState/RandPins was set - Regressions always use default non-random values

    line terminal works

    Source code(tar.gz)
    Source code(zip)
  • v0.7(Nov 20, 2020)

    = Changes from v0.6 =

    Rewind system.

    More reliable static disassembly.

    Cartridge mappers now provide their own symbols. For example, bank switch hotspots will be named in the disassembly.

    Fixed Atari Superchip (broken sometime between v0.5 and v0.6). Unused area detection was also broken (this fixes Fatal Run, for example).

    mnetwork (E7) was using monitoring wrong hotspot addresses to switch in a 256byte RAM bank. This fixes Pitkat.

    Refined CRT effects: - shadow mask - better scanlines - gamma correction - noisy output

    CRT effects editable through GUI.

    Audio output increased.

    Improved frame limiter system.

    Fixed PlusROM first installation prompt not appearing in debug mode

    = Known issues =

    Non-GUI debugging interface not currently working.

    Random state causes some issues in some circumstances, activate with cautionary advice. Random pins works fine

    Source code(tar.gz)
    Source code(zip)
  • v0.6(Sep 22, 2020)

    = Changes from v0.5 =

    Implemented PlusROM emulation.

    Implemented 3e cartridge format (3e+ implementation already existed)

    Loading of cartridge files over HTTPS

    Fixed audio output. The emulation was correct but the SDL audio routines were buggy. Particularly noticeable in H.E.R.O

    Corrected how joystick axis and paddle fire react to SWACNT changes. eg. A deflected axis would not update the SWACHA bits when SWACNT was updated. Bug introduced in the reimplementation of the I/O subsystem. Particularly noticeable in He-Man

    Playback now processes all events for given TV state. This particularly affected playback of recorded setup events (from the setup sub-system). Bug introduced in the reimplementation of the I/O subsystem.

    Added log regression test mode. Renamed digest test to video test (removed audio test).


    Note that the Windows binary provided was cross compiled from Linux. It has been tested with Wine version 5.0.2 and on Windows 10 Pro, Version: 1909, Build: 18363.1082

    I don't use or support Windows and I recommend you compile your own binary. Go is easy to setup and a rewarding language to learn and to program in.

    Source code(tar.gz)
    Source code(zip)
  • v0.5(Sep 14, 2020)

    = Changes from v0.4 =

    DF (128k) bank switching

    Corrected how the reflection bit affects the playfield

    Reading a hotspot will now return the byte at that address for the following cartridge mappers: - Atari multi-bank - CBS - DF - Parker Bros. This fixes "Man Goes Down" (atari F6) which bank expects an instruction code to be returned on $fff9 access, rather than just zero.

    More flexible attachment of peripherals - better auto switching of controller types - support for savekey - more accurate setting of bits in RIOT ports

    Savekey debugger windows

    Regression Database - added optional recording of different machine states; in addition to the existing optional recording of TV state

    Log window

    Source code(tar.gz)
    Source code(zip)
  • v0.4(Aug 24, 2020)

    = Changes from v0.3.4 =

    Supercharger loading from MP3 and WAV files

    Supercharger BIOS file location more flexible

    Fixed keyboard detection

    Fixed race condition causing blocking in rare instances (inevitable when loading MP3/WAV files)

    Source code(tar.gz)
    Source code(zip)
  • v0.3.4(Aug 4, 2020)

    = Changes from v0.3.3 =

    Windows cross-compilation support

    Logging package

    (Note that the windows version must be run from the command line as per the instructions in the README. Future versions will allow ROM selection on startup.)

    Source code(tar.gz)
    Source code(zip)
Owner
Stephen Illingworth
Stephen Illingworth
A ZX Spectrum Emulator written in Go

GoSpeccy - An evolving ZX Spectrum 48k Emulator GoSpeccy is a free ZX Spectrum (Speccy for friends) emulator written in Go. Quick start Installing and

Andrea Fazzi 123 Aug 29, 2022
🕹️ A basic gameboy emulator with terminal "Cloud Gaming" support

Gameboy.Live ??️ Gameboy.Live is a Gameboy emulator written in go for learning purposes. You can simply play Gameboy games on your desktop: Or, "Cloud

AaronLiu 4.4k Nov 27, 2022
Mettaur is GBA emulator written in golang.

Mettaur Mettaur is GBA emulator written in golang. Warning: This emulator is WIP, so many ROMs don't work correctly now. Run Please download latest bi

Akatsuki 433 Nov 19, 2022
A GameBoy emulator written in Go

gogoboy A GameBoy emulator written in Go About this project This project is a proof of concept of building emulators with test driven development. I'v

Daniela Petruzalek 10 Aug 20, 2022
Magia is GBA emulator written in golang.

magia is GBA emulator written in golang.

Akatsuki 433 Nov 19, 2022
A chip-8 emulator built with Go

Introduction Chip-8 is an interpretted language designed to create programs/games on the 8bit systems like the COSMAC VIP and Telmac 1800. Chyp8 is an

Sriram J 5 Oct 3, 2021
Golang RISC-V emulator that can play DOOM

RISC-V Emulator A toy Golang RISC-V emulator that can play DOOM For now it uses smunaut bootloader and riscv_doom from the ICE40 project. But since th

Lucas Teske 44 Nov 17, 2022
A toy GameBoy Color emulator written in golang.

?? worldwide 日本語のドキュメントはこちら GameBoyColor emulator written in golang. This emulator can play a lot of ROMs work without problems and has many features.

Akatsuki 568 Nov 9, 2022
A Chip8 emulator written in Go

A Chip8 Emulator in Go chip8.go is a simple Chip8 emulator, compliant with the technical standard laid out in the Cowgod's Manual. Graphics and sound

Ambertide 36 Jun 6, 2022
Gones - An attempt to program a NES emulator

Gones - An attempt to program a NES emulator The following resources were used for the project: The great work on wiki.nesdev.org R650X and R651X Data

Tim Heß 3 Jan 10, 2022
CHIP-8 Emulator written in Go

dP oo 88 .d8888b. 88d888b. dP 88d888b. 88d888b. dP dP 88' `"" 88' `88 88 88' `88 88' `88 88 88 88. ... 88 88 88 88. .88

m0x 2 Nov 26, 2021
'mouseable' is keyboard-based mouse emulator for Windows.

Motivation Mouseable is intended to replace a mouse or trackpad. This program was inspired by Ultimate Hacking Keyboard Demo, Windows built-in functio

null 439 Nov 27, 2022
Sensor Emulator

Sensor Emulator This is a simple sensor emulator software implemented for IoT experiments. It emulates sensors sending data to an MQTT broker. Feature

null 0 Nov 28, 2021
NES emulator written in Go.

Summary This is an NES emulator written in Go. Screenshots Title Screens http://www.michaelfogleman.com/static/nes/ Dependencies github.com/go-gl/gl/v

Michael Fogleman 5.1k Nov 26, 2022
VMAGI - Write an performant emulator in 24 hours!

VMAGI Welcome! VMAGI is a small emulator/interpreter my friend Matthew and I challenged each other to build in 24 hours. This includes both the implem

Sandy 4 Nov 27, 2022
A simple CHIP-8 emulator written in Go

GoCHIP This is a simple CHIP-8 emulator written in Go. Check out this blogpost to learn more about CHIP-8 emulation: https://tobiasvl.github.io/blog/w

Indervir Singh 0 Jan 10, 2022
Chip-8 - A simple chip-8 emulator for golang

?? What the fuck is this A simple chip-8 emulator. Chip-8 is a simple, interpret

Arthur Ottoni 1 Aug 4, 2022
A CHIP-8 emulator written in Go

chip8 A CHIP-8 emulator written in Go. Usage Usage of chip8: -scaleFactor int Display scale factor (default 10) rom Path to ROM (m

Michael Kohl 4 May 25, 2022
Nintendo Entertainment System (NES) and Famicom emulator written in Go

go6502 Nintendo Entertainment System (NES) and Famicom emulator written in Go Dependencies go get -u github.com/go-gl/gl go get -u github.com/go-gl/gl

Sergio Nonide Miranda 2 Apr 25, 2022