Draft:Commander X16

Commander X16 is an 8-bit home computer. Initially designed by David Murray as his dream computer, it is developed with a team of 5 people as a complete computer kit with motherboard, case and software. It gained wider attention via David's YouTube channel The 8-Bit Guy, attracting developers and retrocomputing enthusiasts.

History
On April 11, 2018, David wrote an article titled "What is my dream computer?" on his blog. He mentioned specifications of his 8-bit dream computer as capable of running Commodore BASIC and consisted of off-the-shelf components, an 6502 or compatible CPU, 128K or 256K of static RAM, VGA or HDMI video and without FPGA or microcontrollers.

Nearly a year later, he started a video series on his YouTube channel about building his dream computer. As the series went on, many people from the community made suggestions regarding hardware and software aspects of the dream computer that shaped the development of the project. Several notable people in the retrocomputing community such as Christian Simpson of Retro Recipes and Kevin Williams of TexElec got directly involved in the design process along with David.

Design process
Most of the parts of the computer were intended to be parts that are already in production. For CPU, David decided to use W65C02 chip designed and produced by Western Design Center that has backward compatibility with the original 6052. For memory, Commander X16 uses several 512K RAM chips and an SD card slot for storage medium that can enable relatively large storage for the system's relative tiny file sizes. For video card, the team settled down to designing an FPGA based daughterboard that they dubbed "VERA card" which also works as a sound card with 2 channels. YM2151 sound chip was chosen to provide a third sound channel and its retirement from production by Yamaha created supply issues for the team. As a result, some X16 units have YM2164 chip that has ~99% compatibility with the former. Several FPGA implementations are made by the community to substitute YM2151 as well.

To ensure BASIC 2.0 compatibility with Commodore microcomputers and retain 80s "boot to BASIC" philosophy, David wanted to make an operating system based on Microsoft BASIC and KERNAL previously owned by Commodore and now by Cloanto along with other Commodore ROM files. Cloanto initially didn't reply to the requests for licensing KERNAL and BASIC, but then agreed to allow their shipment in X16's ROMs as proprietary files only for use as kernel of X16's operating system in exchange of a fee. Alternatively, its made possible to use an open source KERNAL re-implementation by Mega65 team instead of the original one provided by Cloanto.

Debut
Commander X16 Gen 1 debuted on October 12, 2022, with the announcement of the first 100 PCBs being arrived from production. The initial price of the first 100 development boards in the Kickstarter campaign was set to be $500, with the first 10 given for free to selected developers and people that took part in the project. In one of his update videos in 2023, David told the audience that there will be 3 generations of X16 and the price will decrease with time to under $100 by the release of Gen 3.

After the first 100 boards, pre-orders for Gen 1 were started on October 1, 2023 and the price was dropped to $349.99.

Hardware
Commander X16 is an 8-bit hardware with an FPGA-based video and sound chip. Physically, the system is a MicroATX motherboard with DIP socketed chips. Its made mostly of off-the-shelf parts with the exception of old stock YM2151.

Processors
X16 is powered by the WDC 65C02 running at a clock speed of 8 MHz, an enhanced version of the 6502. The Commander X16 can be upgraded with a WDC 65C816 CPU. There is also a battery-backed MCP7940N real-time-clock chip that provides a real-time clock/calendar, two alarms and 64 bytes of RAM. It is accessible through the I2C bus.

Memory
X16 includes 32 KB of ROM, housing its OS, and 512 KB of RAM expandable to 2 MB, which is significantly more than what was available in vintage 8-bit computers. Additionally, X16 has SD cart support which offers relatively infinite storage for generically small sized software made for the system.

Graphics
Video output is managed by the VERA (Versatile Embedded Retro Adapter) card, designed specifically for the Commander X16. VERA supports resolutions up to 640x480 with 256 colors out of a palette of 4096. It includes hardware support for 128 sprites, 2 tile maps, and smooth scrolling.

Sound
An on-board Yamaha YM2151 sound chip (or YM2164 depending on the board) provides 8 channel FM Synthesis based sound generation. Additionally, the VERA module has a simpler 16 channel PSG with SID-like capabilities and PCM playback.

Software
Commander X16 has its own partially open source OS officially based on proprietary BASIC and KERNAL, with option of replacing KERNAL with open alternative of Mega65. The Commander X16 can be emulated on a wide variety of systems including Windows, MacOS and Linux distros or via web.

BASIC
Commander X16's BASIC 2.0 is largely compatible with those in VIC-20 and C64 with several new commands. Many routines and hardware addresses are different, breaking compatibility with programs using PEEK, POKE, WAIT, and SYS commands.

BASIC has new support for graphics, I/O, memory, hex and binary literals, and more. Refer to the system documentation for details. Reportedly, X16 is "as compatible as possible" with BASIC tokenization through V10. Keywords added to X16 BASIC that also exist in other versions of BASIC match the token, and new keywords are encoded in the ranges  and.

KERNAL
The X16 contains an augmented C64 KERNAL. It supports the X16's video modes, peripherals, timekeeping and simple memory management.

For applications to remain compatible between different versions of the ROM, they can rely upon the KERNAL API. The KERNAL fully supports the C64 KERNAL API. In addition, the X16 supports a subset of the C128 API.

Binary
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
There is a machine language monitor in ROM, based upon that of the Final Cartridge III, and using the same commands.

Community applications
X16 has a community mostly from retrocomputing circles that develops various new apps and remakes of the old ones for the system. Some notable software on the system include remakes of popular retro games like Super Mario, Arkanoid, Space Invaders and Mega Man 1, demakes of newer games like Minecraft named 8-Bit Blocks and utility software such as a Chinese word processor named Living Type. David himself developed Planet X16, a remake of his indie game Planet X3, another remake of one of his games called Attack of the PETSCII Robots and a remake of an MS-DOS game called Xixit.