Skip to content

vossstef/A2600Nano

Repository files navigation

A2600Nano

The A2600Nano is a port of the MiSTer FPGA core of the Atari 2600 VCS to the Tang Nano 20k (Gowin GW2AR) with enhancements from the A7800 core such as cartridge type autodetect and the video stabilizer.

This is based on the C64Nano project and also relies on a M0S Dock µC being connected to the Tang Nano 20K. Alternately you can use a Raspberry Pi Pico or esp32-s2/s3 and use the FPGA companion firmware.

Original A2600 core by Retromaster
All HID, SDcard and µC firmware by Till Harbaum

Features:

Planned features:

  • ROM mapper control override via file extension
  • Mouse as paddle support

Important

PROJECT IS STILL WORK IN PROGRESS!


image


HID interfaces aligned in pinmap and control to match FPGA-Companion.
Basically a µC M0S/BL616 / Raspberry Pi Pico RP2040 / ESP32-S2/S3 acts as USB host for USB devices and as an OSD controller using a SPI communication protocol.

Installation

The installation of A2600Nano on the Tang Nano 20k board can be done using a Linux PC or a Windows PC Instruction.

Cartridge ROM Loader

ROM can be loaded via OSD file selection.

Supported mappers

  • Auto detected (00 F8 F6 FE E0 3F F4 P2 FA CV 2K UA E7 F0 32)

LED 2 to 4 are activated as hint in case an unsupported game (mapper) detected

single Button Joystick

  • Button Trigger

four Button Joystick or Gamepad

  • Gamepad Button Trigger A (DS2 circle) Trigger

  • Gamepad Button Trigger B (DS2 cross) Paddle Trigger and enable

  • Gamepad Button Trigger X (DS2 triangle) Paddle 2nd Trigger and enable

  • Gamepad Button Trigger Y (DS2 square) revert Paddle mode to Joystick mode

  • Gamepad Button START as core function START

  • Gamepad Button SELECT as core function SELECT

Paddle

  • DualShock 2 or USB Gamepad.

Core switches to paddle mode if paddle Trigger B or Trigger X is pressed.
Can be reverted by pressing Gamepad Button Trigger Y.

Keyboard

  • Key F11 as core function START
  • Key PAGE UP as core function SELECT

Push Button utilization

  • S2 keep pressed during power-up to prevent FPGA bitstream load from FLASH.

  • S1 reserved

OSD

invoke by F12 keypress

  • Reset
  • Cold Reset
  • Audio Volume + / -
  • Scanlines effect %
  • Region switch Auto/NTSC/PAL
  • HID device selection for Joystick Port
  • Loader file selection
  • Difficulty A, B Core switch
  • Black & White Core video switch
  • Joystick port swap
  • Invert Paddle
  • De-comb
  • SuperChip Auto/off/on

Gamecontrol support

controller

legacy single D9 Digital Joystick. OSD: Retro D9
or
USB Joystick(s) or Gamepad(s). OSD: USB #1 Joy or USB #2 Joy
or
Gamepad Stick as Joystick. OSD: DualShock2
left stick for Move and square triangle cross circle Buttons for Trigger:

Buttons - -
square
Trigger 1
Up cross
Trigger 2
Left - Right
triangle
Trigger 4
Down circle
Trigger 3

or Keyboard Numpad. OSD: Numpad

0
Trigger
8
Up
4
Left
- 6
Right
- 2
Down
-

or Mouse. OSD: Mouse
not supported yet

or Dualshock2 Gamepad left stick as Paddle. OSD: DualShock2
cross / triangle Trigger
You have first to set the DS2 Sticks into analog mode by pressing the DS2 ANALOG button.
Mode indicated by red light indicator.
Configure DIGITAL mode (press ANALOG button again) when using the Joystick mode again.

LED UI

LED function TN20K TP20K TP25K TM138K TN9k
0 Cartridge selected x - - - -
1 reserved x - - - -
2 Game unsupported x - - - -
3 Game unsupported x - - - -
4 Game unsupported x - - - -
5 Game unsupported x - - - -

LED 2 to 4 are activated as hint in case an unsupported game (mapper) detected

Multicolor RGB LED

  • green      all fine and ready to go
  • red          something wrong with SDcard / default boot image
  • blue        µC firmware detected valid FPGA core
  • white      -

Powering

Prototype circuit with Keyboard can be powered by Tang USB-C connector from PC or a Power Supply Adapter.

Synthesis

Source code can be synthesized, fitted and programmed with GOWIN IDE Windows or Linux.
Alternatively use the command line build script gw_sh.exe build_tn20k.tcl

HW circuit considerations

Pinmap TN20k Interfaces
Sipeed M0S Dock, digital Joystick D9 and DualShock Gamepad connection.
wiring

Pinmap D-SUB 9 Joystick Interface

  • Joystick interface is 3.3V tolerant. Joystick 5V supply pin has to be left floating !
    pinmap
Joystick pin IO Tang Nano pin FPGA pin Joystick Function
1 2 J6 10 25 UP
2 1 J6 9 28 DOWN
3 4 J6 12 29 LEFT
4 3 J5 11 26 RIGHT
5 - - - POT Y
6 0 J5 8 27 TRIGGER
7 - n.c n.c 5V
8 - J5 20 - GND
9 - - - POT X

Pinmap Dualshock 2 Controller Interface
image

DS pin Tang Nano pin FPGA pin DS Function
1 J5 18 71 MISO JOYDAT
2 J5 19 53 MOSI JOYCMD
3 n.c. - 7V5
4 J5 15 - GND
5 J5 16 - 3V3
6 J5 17 72 CS JOYATN
7 J5 20 52 MCLK JOYCLK
8 n.c. - JOYIRQ
9 n.c. - JOYACK

Getting started

In order to use this Design the following things are needed:

Sipeed M0S Dock or Raspberry Pi Pico RP2040 or ESP32-S2/S3
Sipeed Tang Nano 20k
microSD or microSDHC card FAT/exFAT formatted
TFT Monitor with HDMI Input and Speaker

HID and Gamecontrol Hardware option TN20k alternative option Primer 25K Mega 138K Primer 20K
USB Keyboard USB-C to USB-A adapter 4 port mini USB hub x x x
USB Joystick(s) 4 port mini USB hub - x x x
USB Mouse 4 port mini USB hub - x x x
USB Gamepad 4 port mini USB hub HS8836A - x x x
Commodore/Atari compatible retro D9 Joystick MiSTeryNano shield D-SUB 9 M connector, breadboard to wire everything up, some jumper wires - - -
Dualshock 2 Controller Gamepad Gamepad Adapter Board (Sipeed Joystick to DIP) breadboard to wire everything up and some jumper wires - x x