Commander X16

From C64-Wiki
Jump to navigationJump to search
Stub This article is very short and not very detailed. Please help to improve it.
Commander X16
Type: Home Computer
Producer: http://www.CommanderX16.com
Price: $200–$300 USD
Released: 2020
Discontinued:
Processor: WDC 6502 at 8-MHz
Memory: 512K ROM + 40K program RAM + 512K banked RAM (expandable to 2MB)
OS: BASIC 2.0, enhanced.
Info:

The Commander X16 (colloquially known as the X-16) is a modern 8-bit computer currently in active development. It is intended to be a hobby computer built from modern off-the-shelf parts, with KERNAL compatibility with the Commodore family of computers. It is the brainchild of David "the 8 Bit Guy" Murray, who wanted an accessible and affordable 8-bit hobbyist platform. In his own words:

I wanted a computer that was similar to the Commodore 64, but made from all off the shelf components.

It is intended not only as an educational tool, but also to solve retro-computing problems of today; namely, ever-increasing costs, auction site price gouging/sniping, and unreliability of 30-year old hardware. The X16 is made entirely with off-the-shelf modern parts, ensuring availability without reliability issues. It has a real 8-bit CPU rather than using emulation or an FPGA recreation of a processor. It is intended to be inexpensive enough to promote a critical mass of users, to create its own software ecosystem, yet be simple enough that a single person can understand the entire system.[1]

Origin[edit]

In 2019, the popular YouTube program The 8-Bit Guy posted two videos entitled "Building My Dream Computer", where he discussed hardware considerations in building a modern 8-bit computer. By the end of the second video, he had settled on a 6502-derived CPU, the Commodore KERNAL, and an architecture based loosely on the VIC-20. He discussed requirements for sound and proposed potential sound chips.[2][3]

While the last Commodore 8-bit computers had BASIC 7.0, the X16 defaults to version 2.0, but grew the feature sets of both BASIC and the KERNAL. [4]

Applications[edit]

The X16 is expected to ship with an augmented Commodore KERNAL, BASIC (with a DOS wedge, among other things), a machine language monitor, an assembly language editor, and more.[5][6]

Technical specifications[edit]

The memory model is inspired by the VIC-20 with 40k of "low RAM". 1 KB of this used by the system for I/O. The 512K ROM is split into 32 banks of 16K each; Bank 0 holds the Commodore KERNAL and BASIC. The X16 also ships with 512K "high" static RAM, which is split into banks of 8K. High RAM is expandable up to 2MiB. Bank 0 is a scratch space for the operating system.

Physically the system is a Micro ATX motherboard with all-DIP socketed chips.

Ports and sockets[edit]

The X16 has four expansion slots with access to the CPU databus. Device #1 is an SD card, instead of the Commodore Datasette. Like the C64 and the VIC-20, the system contains an IEC compatible disk drive port. It also has two exposed SNES game controller connectors, with two internal pin headers that can support two more connectors. It accepts a PS/2 keyboard and mouse.[7]

Graphics[edit]

The graphics capabilities of the X16 are provided by the single FGPA, code named "VERA". VERA has 128 KB of its own RAM, and directly outputs a VGA signal. It has multiple output formats, at a fixed resolution of 640x480@60HZ. It supports two layers with various tile and bitmap modes, and up to 128 sprites. Its color palette is 256 colors, using a total range of 4096 colors.[8]

The Vera chip supports per-tile h-flip, v-flip, 4-bit palette offset, 10 bit tile index. All these modes support smooth scrolling.

Sound[edit]

Audio is not finalized; there are three separate sound generators being considered. For basic sound, the VERA chip itself has a programmable sound generator based loosely on the SID; the SAA1099 is also being looked at. For MIDI-like sound, the Yamaha YM2151 is being considered.[9] As of Jan 2021, the SAA1099 has been deleted and will not be used going forward.

Memory Map[edit]

The memory map is inspired by the VIC-20, which had a no-fuss division of RAM, I/O addresses, and ROM. The Commander X16 builds on this concept by creating an 8K window of banked RAM, and the top 16K of memory for banked ROM:

memory map-02.png

Banking logic allows up to 2MB of high RAM for data, machine language, etc, and 128K for ROM. Commander X16 Memory Map

Memory map
Address Size [in KB] Description
0x0000 - Bank control bytes
0x0002 - 16 bit ABI registers
0x0022 - User zero page
0x080 - KERNAL and BASIC zero page variables
0x0100 - Accumulator stack
0x0200 1.5 User RAM
0x0800 38 BASIC program/variable RAM
0x9F00 0.25 I/O registers
0xA000 8 RAM Bank window
0xC000 16 ROM Bank window

The "ABI Registers" are virtual 16 bit registers r0 through r15, which are located in zero page locations $02 through $21: r0 = r0L = $02, r0H = $03, r1 = r1L = $04 etc. (The registers start at $02 instead of $00 to allow compatibility with 65xx systems that have a processor port at $00/$01.)

ROM banks will include things such as:

   - KERNAL
   - Monitor
   - Character sets
   - Keyboard layout
   - CBDOS for SD cards
   - GEOS KERNAL
   - BASIC
   - Assembler/Monitor
   - And room for more.

To switch the current RAM bank, just do this:

POKE $9F61, B

...where B is the bank number, from 0 to 255. Note that Bank 0 is used by the KERNAL for variables and buffers, so user RAM begins at Bank 1.

Emulator[edit]

An official emulator is being co-developed right along side the hardware. The emulator is supported for Windows, Mac, and Linux.[10]

Unofficial emulators are being developed for iPad[11] and Android[12], derived from the source of the official emulator.

Software Compatibility[edit]

BASIC[edit]

Commander X16 BASIC v2 is largely compatible with VIC-20 and C64 BASIC V2, with several new commands. Many routines and hardware addresses are different, breaking compatibility with programs using PEEK, POKE, WAIT, and SYS commands.[13]

New statements include:

  • CHAR — graphics mode drawing of text
  • COLOR — set text mode colors
  • DOS — interact with drives
  • FRAME — graphics mode box drawing
  • GEOS — switch to GEOS
  • JOY — returns gamepad state
  • LINE — graphics mode line drawing
  • MON — enter monitor
  • MOUSE, MB, MX, MY — mouse functions
  • OLD — restore program after new or reset
  • PSET — set pixel
  • RECT — graphics mode filled box drawing
  • RESET — software reset of system
  • SCREEN — set screen mode; multiple text
  • VPEEK, VPOKE — VERA memory access.

Binary[edit]

Most binary programs will rely upon specific addressing, and will thus need to be reassembled or recompiled with corrected addresses. Further, the differences in VERA from the Commodore graphics will require different handling as well, generally rendering binary files incompatible.

Assembler[edit]

There is a machine language monitor in ROM, based upon that of the Final Cartridge III, and using the same commands. [14]

Cross-Compiler Support[edit]

The Commander X16 is a supported target in the cc65 cross-compiler.[15]

Legality of the modified KERNAL and BASIC[edit]

The software of the computer is based on leaked Commodore 64 KERNAL and BASIC source code.[16] David requested permission from the current owners of the software (Cloanto) but didn't get a reply.However, "Peri Fractic" was able to get permission from Cloanto to use the BASIC and KERNAL ROMs.Template:Citation needed [17]

The Commander X16 emulator project also has the beginnings of open-source ROMs, based loosely on the Mega 65's open ROMs[18] which are open sourced under the LGPL v3 license.[19]. However, with Cloanto's assent, their development has been given a low priority.

Michael Steil has also added new KERNAL routines, based loosely on routines present in the C128 and other systems, for dealing with sprites, date/time, joysticks, mouse, graphics mode, and memory handling.

References[edit]

  1. [1] Commander X16 FAQ
  2. [2] My Dream Computer - Part 1
  3. [3] My Dream Computer - Part 2
  4. [4] Commander X16 Programmer's Reference
  5. [5] Commander X16 FAQ
  6. [6] My Dream Computer - Part 2
  7. [7] Commander X16 FAQ
  8. [8] Commander X16 FAQ
  9. [9] Commander X16 FAQ
  10. [10] GitHub X-16 emulator
  11. [11] Cx16 Facebook Group announcement
  12. [12] APKPure.com Commander X16 Emulator
  13. [13] Cx16 Programmer's Reference Guide - Compatibility
  14. [14] Cx16 Programmer's Reference - Machine Language Monitor
  15. [15] GitHub cc65 — Cx16 page
  16. [16] GitHub: "BASIC and KERNAL are derived from the Commodore 64 versions. GEOS is derived from the C64/C128 version."
  17. [17] Youtube.com: 8Bit Guy — Building my Dream Computer, Part 1.
  18. [18] GitHub: Commander X16 r37 release.
  19. [19] GitHub: MEGA65 Open ROM Repository.

Links[edit]