Coder Social home page Coder Social logo

jsyk / x65 Goto Github PK

View Code? Open in Web Editor NEW
25.0 5.0 1.0 205.94 MB

The 65c02 and 65c816s-based modern retro computer

License: MIT License

Makefile 0.47% Verilog 12.81% HTML 75.57% C 3.85% Python 2.86% Assembly 4.16% BASIC 0.01% C++ 0.26% Pawn 0.02%

x65's Introduction

X65

The X65 is an ultimate computer for everyone interested in the venerable 65-series of 8-bit and 16-bit CPUs, i.e. the 6502 and 65816. Specifically, it is built with the W65C02S or W65C816S CPU chips from Western Design Centre. The 16-bit 65816 (W65C816S) CPU variant is the default and preferred CPU, as all screen-shots shown below were done on the 16-bit system. The 65816 CPU powered the Super Nintendo Entertainment System (SNES) and the Apple IIGS. The older 8-bit 6502 CPU was the heart of NES, Apple I and II, many Ataris, Commodore 64, and many many more.

The design of X65 is fully open-source and open-hardware, and we also prefer to use just the open-source development tools whenever possible. The X65 computer hardware is designed with modern electronics parts, but with a little bit of retro feel. The computer is backward compatible with the 8-bit Commander X16 -- i.e. it can run their ROM, but since that ROM is copyrighted and non-free, this is a no-go in the long run. The goal is to build a fully open 8/16-bit system with good architecture and retro-gaming performance.

Compared with modern powerful platforms like x86, ARM or RISC-V, the small 65-series 8-bit or 16-bit system has the advantage that one person, a software programmer or electronics designer, can fully comprehend the whole system with all details. There are not many abstraction layers hidden in supporting libraries or big frameworks. (In fact, there are none. It is just bare metal.)

Interfaces: VGA 640x480 out, Stereo sound out (FM and PSG), PS/2 keyboard and mouse, SNES controller 2x ports, Ethernet LAN 10/100Mpbs with RJ45, SDHC card slot, power-in 5V USB-C port, In-Circuit Debugger (ICD) over the USB-C with PC host software in Python and supporting JTAG-like functions for the 65xx platform (CPU step, trace, memory dump & poke).

Project web pages: http://www.x65.eu -> currently links to http://www.jsykora.info

3D-render of the Single-Board Computer version:

Version SBC

Desktop setup with X65-SBC, PS/2 mouse and keyboard and a VGA monitor. Running `Planet X16' by David Murray with CX16 ROMs:

Desktop with SBC

General Project Features:

  • The CPU is W65C02 (8-bit) or the W65C816 (16-bit; default-preferred). The PCB supports both assembly options.
  • Backward software compatibility with the Commander X16 computer. Can run unmodified CX16 ROM for testing purposes (beware: the ROMs are copyrighted non-free code!).
  • Designed with components (chips) that are in production and available from normal electronics parts distributors in 2024, such as Mouser, Farnell, Digikey etc. We avoid obsolete parts.
  • Balanced modern/retro design built around the central 65xx CPU supported by semi-ASICs (FPGAs) for system control (NORA), video (VERA) and audio (AURA) generation. The FPGAs are the little ones from the iCE40 series, and coded in verilog. These are modern takes on the "old masters'" designs with ULA, VIA, SID etc. There is no hidden ARM or RISC-V doing heavy lifting in the background.
  • Free and open-source design. DIY and hobby-builders friendly. Low-cost to build even in small quantities by individual hackers.

Block Diagram

Block Diagram

Hardware Specification:

  • CPU: W65C02 or W65C816 in the QFP-44 package, running at 8MHz, supplied by 3.3V.
  • Memory: 2MB asynchronous SRAM, common for ROM and RAM.
  • System controller semi-ASIC, aka north-bridge, aka NORA: Lattice FPGA iCE40HX4K (TQFP-144) handles address decoding, glue logic, PS/2 interfaces, in-circuit debugger and more. "NORA" stands for NORth Adapter, has a similar function like the north bridge in a PC/X86 architecture. NORA takes care of the memory address map and hosts most of the IO registers.
  • Two ports for SNES-style controllers, handled by NORA.
  • Two PS/2 ports for keyboard and mouse, handled by NORA. (note: we reimplement CX16 arduino code in pure hardware logic in verilog.)
  • Colour video output through VGA connector, up to 640x480 pixels. Generated by VERA FPGA: the Video Embedded Retro Adapter, in Lattice FPGA iCE40UP5K. The same is used in Commander X16.
  • Stereo audio output through 3.5mm jack port. Sound comes from two sources: FM-synthesis (OPM) by YM2151 clone IKAOPM implemented in AURA FPGA (iCE40UP5K), and Programmable Sound Generator (PSG) available in VERA FPGA. These are digitally mixed in AURA and passed to a DAC. Besides the output jack connector, the sound can be also heard from a small on-board mono speaker.
  • SD-card slot supporting SDHC cards (handled by VERA FPGA).
  • LAN 10/100Mbps Ethernet port (RJ45) implemented by Wiznet W6100 chip, with hardware-integrated TCP/IP v4/v6 stack.
  • Real-time clock (RTC) chip with battery backup.
  • In-circuit debugger (ICD) integrated with NORA and accessible over the device USB-C port from a host PC running Linux or Windows. The ICD can write all permanent (SPI-Flash) memories in the system, even in a totally empty / bricked state. PC host software is written in Python and should be portable to other fruitful systems besides Linux and Windows. Together with NORA the ICD supports JTAG-like functions like memory poke/dump, CPU stop/step, instruction trace buffer, interrupt forcing/blocking etc.
  • Power input 5V from a standard USB Type-C device port. The X65 computer can be powered from a normal host-PC USB port (for development with ICD), or runs standalone from a common Mains/USB phone charger with just 5V output.
  • Single-board PCB 180x100mm, 4-layers.

Hardware Photos:

Overview photos (2024/02) - Single-Board version:

SBC Front view photo:

Front view photo

SBC Rear view photo:

Rear view photo

SBC Top view with labels:

Engineering testing samples, hand-assembled:

SBC topview with labels

Demo Software Screen Photos

Running Commander X16 ROM and BASIC program (compatibility testing only, not allowed in production use due to a proprietary license):

X16 Booted

BAD METAL demo from CX16:

BadMetal

CALLIOPE music player from CX16:

Calliope

Crazy Boulders, a CX16 game by Dušan Štrakl:

Crazy Boulders

Crazy Lander, a CX16 game by Dušan Štrakl:

Crazy Lander

Crazy Pong, a CX16 game by Dušan Štrakl:

Crazy Pong

Planet X16, a CX16 game by David Murray:

Planet X16

Planet X16

Integrated In-Circuit Debugger can live-trace the CPU from a Linux PC over the USB:

ICD CpuStep

Structure of the GIT repository:

  • `doc' --> documentation
  • `fpga-aura' --> verilog code for the AURA FPGA (Audio) with referenced IKAOPM sources.
  • `fpga-nora' --> verilog code for the NORA FPGA on the motherboard.
  • `fpga-vera' --> VERA FPGA bitstream (100% derived from https://github.com/fvdhoef/vera-module)
  • `pcb' --> hardware projects in Kicad:
    • `mobo-rev01' --> Motherboard rev01 - OBSOLETE
    • `vabo-rev01' --> Video/Audio board rev01 - OBSOLETE
    • `x65-sbc-revA1' --> Single-Board computer
  • `x65prog' --> linux software to program the on-board SPI flash memories from a host Linux PC via the USB link.
  • `x65pyhost' --> python scripts for accessing/debugging the X65 from a host PC via the USB link.

Schematics in PDF:

SBC Revision A1:

SBC Revision B1:

Software:

The X65 is software-backwards-compatible with the Commander X16. It means the X65 could run unmodified CX16 ROM and programs, excluding programs depending on some of the hardware features in CX16 that are not supported here: cartridges, Commodore IEC port. However, the CX16 ROM is a proprietary, non-open-source and non-free, piece of software created by Commodore and (somehow) licensed to the CX16 creators. The licensees do not wish that the ROM runs on any other HW than their own. Therefore, I could not recommend running that ROM on the X65 computer.

Presently I am not decided which operating system or runtime shell would be the best / easiest to port to X65. There some existing systems that could be ported here, for example:

Random Questions & Answers

Why was this project started?

This project started in March 2023 when I saw a prototype of Commander X16 in one of the youtube videos of the 8-bit guy, David Murray. I immediately wanted to play with it but at the time his project was not released to the public, the hardware could not be bought. So I decided to build one myself, based on public information available about the CX16. And at the same time I was not too pleased with the architecture and implementation of the CX16, not satisfied with many design choices they did. Consequently, my X65 tries to improve in many areas while being software-compatible.

What is the relation to Commander X16 and its authors?

I have no relation or contact to the authors of Commander X16. The public discussion forums for CX16 on discord and reddit have the policy that any discussion or mention of any clones of CX16 is forbidden. While I find this policy strange for a community project, I respect it. Therefore I do not tell the guys about the X65 project.

What is the license of X65 project? Which copyrighted material was used?

I used publicly available information on wikipedia and in the X16Community's public forums and repositories to reconstruct the CX16 architecture. I don't have access to the schematics of X16, and I don't own that computer and never seen it in person. My analysis of the CX16 architecture is available in the file cx16.md. The VERA FPGA by Frank van den Hoef, also here, was reused as-is and it is covered by the open-source MIT license. The AURA FPGA is based on IKAOPM, a YM2151 reconstruction in verilog, and it is covered by the BSD 2-Clause License. All my documents and designs in this repository are covered by the MIT license. The restricted CX16 ROMs are not part of this repository.

What are the advantages of X65-SBC over other retro-modern-computers?

The X65-SBC is a complete computer system with ports for a keyboard and a mouse, a high-resolution VGA output (128kB Video-RAM), and high-quality stereo audio capable of PCM, PSG (Programmable Sound Generator) and FM-synthesis sound generation. Compared with other 65xx-based computers, we support the 16-bit processor 65C816 which is capable of direct addressing of up to 16MB of RAM; the X65-SBC includes 2MB of fast SRAM by default. System controller is realized by NORA FPGA (lattice ice40hx4k) and potentially allows experimenting with additional features like virtual memory or mathematical coprocessors. The hardware supports direct programming of FPGA bitstreams via the USB-C port from a Linux PC; in a way the X65-SBC is a self-contained FPGA development platform. The design is fully open-source.

Where can I get the hardware?

As all relevant HW design data is available in this repository, anybody with appropriate electronics knowledge and a lab can build own copy of the X65-SBC hardware. The cost of electronics components is around 130 EUR, plus the cost of board assembly (which can be done DIY if necessary). Maybe in the future I can run a very small series build for interested programmers and "hackers". However, as these builds surely will not have the requisite FCC / UL / CE approvals (that costs addional money), the resulting devices could only be used in a lab for development purposes by knowledgable users. I am open to the possibility that some company decides to commercionalize X65-SBC as a sellable product and puts it on the market :-)

Is there an emulator for PC?

Presently an emulator is not developed yet. It could be done perhaps based on the CX16 emulator; the CPU emulation has to be extended to 65C816 and new features (registers) available in NORA and in W6100 (ethernet interface) need be implemented.

Contact

Jaroslav Sýkora

x65's People

Contributors

jsyk avatar

Stargazers

Radosław Kujawa avatar  avatar Maciej Witkowiak avatar Oliver Wrulich avatar Ulisses Medeiros avatar Tomasz Sterna avatar Grant Byers avatar Scott McClung avatar  avatar Luke Oldenburg avatar Robert Taylor Long V avatar Adam Klotblixt avatar  avatar  avatar John Quirk avatar Aaron Tomb avatar David avatar William Cleveland avatar Elijah Wright avatar Gnaghi avatar Sylvain Glaize avatar Brano P. avatar Irmen de Jong avatar Epsilon avatar  avatar

Watchers

 avatar  avatar Jimmy Dansbo avatar Brano P. avatar  avatar

Forkers

glbyers

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.