diff --git a/X16 Reference - 01 - Overview.md b/X16 Reference - 01 - Overview.md index 1a371ac..515cb38 100644 --- a/X16 Reference - 01 - Overview.md +++ b/X16 Reference - 01 - Overview.md @@ -1,44 +1,71 @@ # Chapter 1: Overview -The Commander X16 is a modern home computer in the philosophy of Commodore computers like the VIC-20 and the C64. +The Commander X16 is a modern 8-bit home computer in the philosophy of Commodore computers like the VIC-20 and the C64. It is designed to be simple and approachable—a system you can fully understand, program, and even modify. -**Features:** +Unlike emulators or FPGA recreations of vintage hardware, the X16 is a *new* design with no original Commodore chips. It uses modern, available components while preserving the programming experience and spirit of classic 8-bit computing. -* 8-bit 65C02S CPU at 8 MHz ([*](#future-65c816-support)) -* 512 KB banked RAM (upgradeable to 2 MB on the X16 Developer Edition) -* 512 KB ROM -* Expansion Cards (Gen 1) & Cartridges (Gen 1 and Gen 2) - * Up to 3.5MB of RAM/ROM - * 5 32-byte Memory-Mapped IO slots -* VERA video controller +## About This Guide + +This *Programmer's Reference Guide* is intended to be a comprehensive technical manual for software developers. For a gentler introduction to using the Commander X16, see the [Commander X16 User Guide](https://github.com/X16Community/x16-user-guide). + +## Features + +* **CPU:** 8 MHz 65C02S or 65C816 +* **RAM:** 512 KB banked RAM (upgradeable to 2 MB on the X16 Developer Edition) +* **ROM:** 512 KB containing KERNAL, BASIC, DOS, character sets, and more +* **Expansion:** Expansion Cards & Cartridges + * Four Expansion Slots + * Supports up to 3.5 MB of additional RAM/ROM +* **Video (VERA):** + * Powered by a Lattice ICE40UP5K FPGA + * 128k of dedicated Video RAM * Up to 640x480 resolution * 256 colors from a palette of 4096 - * 128 sprites - * VGA, NTSC and RGB output - * Powered by a Lattice ICE40UP5K FPGA -* Three sound sources - * Yamaha YM2151: 8 channels, 4-operator FM synthesis - * VERA PSG: 16 channels, 4 waveforms - * VERA PCM: Up to 48 kHz, 16 bit, stereo -* Connectivity: + * 128 sprites of up to 64x64 pixels + * Two layers (tile or bitmap) + * VGA, NTSC composite, S-Video, and RGB output + +* **Audio:** + * Yamaha YM2151 or YM2164 (FM synthesis): 8 channels, 4-operator, stereo, 162 instruments + * VERA PSG (waveform synthesis): 16 channels, 4 waveforms (pulse, sawtooth, triangle, noise), stereo + * VERA PCM (sample playback): Up to 48 kHz, 16-bit, stereo + * Audio upgrades available via onboard header or Expansion Cards. +* **Connectivity:** * PS/2 keyboard and mouse - * 4 NES/SNES controllers - * SD card - * Commodore Serial Bus ("IEC") - * Many Free GPIOs ("user port") + * Up to 4 NES/SNES controller ports + * SD card (FAT32) + * Commodore Serial Bus ("IEC") for disk drives and printers + * User port with 16 GPIOs for custom hardware projects + +## System Architecture + +The following block diagram shows how the major components of the Commander X16 are connected: + +![Commander X16 Block Diagram](images/cx16_block_diagram.png) + +The CPU communicates with RAM, ROM, and I/O devices through a shared address and data bus. The VERA handles all video output and also provides the PSG audio channels. The FM synthesizer operates independently for rich sound capabilities. The System VIA (Versatile Interface Adapter) chip handles input from controllers, the PS/2 ports, the IEC serial bus. A second (optional) VIA provides flexible user port GPIOs. + +## Commodore Compatibility + +The Commander X16 runs officially licensed Commodore BASIC V2 and a compatible KERNAL. This is not a clone or recreation—it is legitimate, licensed software that provides authentic compatibility with classic Commodore programs. + +The system was deliberately designed to maximize compatibility with existing Commodore software: -As a modern sibling of the line of Commodore home computers, the Commander X16 is reasonably compatible with computers of that line. +* BASIC program memory starts at $0801, the same as the C64 +* The KERNAL jump table at $FF81–$FFF3 provides the same entry points as the C64 +* Zero page and low memory usage follows Commodore conventions where possible +* Standard PETSCII character sets (uppercase/graphics and lowercase/uppercase) +* Commodore-style keyboard mapping with PETSCII control codes -* Pure BASIC programs are fully backwards compatible with the VIC-20 and the C64. -* POKEs for video and audio are not compatible with any Commodore computer. (There are no VIC or SID chips, for example.) -* Pure machine language programs ($FF81+ KERNAL API) are compatible with Commodore computers. +| Compatibility Level | Description | +|---------------------|-------------| +| **BASIC programs** | Fully backwards compatible with the VIC-20 and C64 (pure BASIC, no PEEKs/POKEs to hardware) | +| **KERNAL API** | Machine language programs using the standard KERNAL entry points ($FF81+) are compatible | +| **Hardware registers** | *Not compatible*—the X16 has no VIC, SID, or CIA chips. Programs that directly access C64 hardware will not work. | -## Future 65C816 Support +Pure BASIC programs and well-behaved machine language programs (those using only KERNAL calls) can often run on the X16 with little or no modification. The BASIC interpreter has been extended with many new commands for graphics, sound, and file handling, while retaining full compatibility with classic programs. -A future upgrade path for the X16 may involve the 65C816. It is almost fully -compatible with the 65C02 except for 4 instructions (`BBRx`, `BBSx`, `RMBx`, and `SMBx`). -It is advisable not to use these instructions when writing programs for the X16.
diff --git a/images/cx16_block_diagram.png b/images/cx16_block_diagram.png new file mode 100644 index 0000000..be99dd3 Binary files /dev/null and b/images/cx16_block_diagram.png differ diff --git a/images/cx16_block_diagram.svg b/images/cx16_block_diagram.svg new file mode 100644 index 0000000..08b5166 --- /dev/null +++ b/images/cx16_block_diagram.svg @@ -0,0 +1,2239 @@ + + + + + + + + + + + + + I + 2 + C BUS + + VERA MODULE + + + + + + + + + + + + + + + + + + + + + + + + + + SYSTEM + MANAGEMENT + CONTROLLER + ATtiny861 + - + 20P + + RTC/NVRAM + MCP7940N + 64 bytes NVRAM + + + PS/2 + MOUSE + + ATX + POWER + CONNECTOR + + PS/2 + KEYBOARD + + GAMEPAD + PORTS 1&2 + + IEC SERIAL + PORT + + CARTRIDGE / EXPANSION SLOTS (x4) + PA + 2 + - + 7 + PB + 3 + - + 7 + PA2,PB3 + + PB5 + - + 6 + + PA3,5 + + + I + 2 + C HEADER + + USER PORT + HEADER + + GAMEPAD + 3 & 4 HEADER + + RESET BUTTON + + POWER BUTTON + + NMI BUTTON + PA7 + + PB4 + + PA4 + + PB0,2 + + + CPU + W65C02S + OR + W65C816S + + SPI BUS + + REMOTE SD + HEADER + + PROGRAMMING + HEADER + + AUDIO MIXER + + AUDIO HEADER + + + + AUDIO JACK + 8 + - + BIT DATA BUS + + FM SYNTH + YM2151 + or + YM2164 + + SYSTEM VIA + W + 65C22S + + USER VIA + W + 65C22S + (OPTIONAL) + + LOW RAM + AS6C1008 + - + 55PCN + 128 + K + B + TOTAL + ( + 39.75K + B + AVAIL + ) + + SYSTEM ROM + SST39SF040 + 512 + K + B + TOTAL + 16K BANKS $00 + - + $1F + + PA2 + - + 7 + + PB3 + - + 7 + + CB1 + + + + + + PA0 + - + 1 + + PA6 + + + ACTIVITY LED + RAM BANK & SELECT LINES + ROM BANK & SELECT LINES + I/O + SELECT + LINES + + 16K BANKS + + $20 + - + $FF + + $A000 + - + $BFFF + + $0000 + - + $9EFF + + $C000 + - + $FFFF + + $42 + $6F + $50 + - + 57 + + (SOCKET 4) $C0 + - + $FF + + + (SOCKET 3) $80 + - + $BF + + + (SOCKET 2) $40 + - + $7F + + + HIGH RAM + A + S6C4008 + - + 55PCN + 512 + K + B + STANDARD + (MAX 2MB) + + + 8K BANKS $00 + - + $3F + + + COMP VIDEO + + S + - + VIDEO + + VGA VIDEO + + SD CARD SLOT + + VERA BOOT + FLASH + COMMANDER X16 BLOCK DIAGRAM + 16 + - + BIT ADDRESS BUS + + ADDRESS DECODE + AND RAM/ROM + BANKING + $9F00 + - + IO0.0 Sys VIA + + $9F10 + - + IO0.1 User VIA + + $9F20 + - + IO1 VERA + + $9F40 + - + IO2 FM Synth + + $9F60 + - + IO3 Exp Slot + + $9F80 + - + IO4 Exp Slot + + $9FA0 + - + IO5 Exp Slot + + $9FC0 + - + IO6 Exp Slot + + $9FE0 + - + IO7 Cartridge + + + + + + FPGA + iCE40UP5K + + VIDEO + RAM + 1 + 28K + + + VERA HEADER + + PSG + AUDIO + +