Overview
One core for the whole XT family
The PC/XT, the Tandy 1000 and the PCjr were separate MiSTer cores, each with its own copy of the CPU, chipset and video. Here they are one design: the hardware they share is written once, and what makes each machine different is switched in at reset. The RTL implements the machines themselves; MiSTer supplies storage, physical video and audio, controls and the menu.
IBM PC/XT
8088 or 8086 at 4.77, 7.16 or 9.54 MHz, or unthrottled. CGA and HGC/MDA together, or an IBM EGA card. EMS, UMBs, XTIDE, AdLib, C/MS and Sound Blaster Pro.
Tandy 1000
CGA with the Tandy 16-colour modes, its video memory taken from system RAM. SN76489 sound, the Tandy keyboard and the Tandy BIOS in its own slot.
IBM PCjr
The video gate array, the infrared keyboard, two cartridge slots, a diskette adapter driven by programmed I/O, 128–640 KiB of RAM and the tape sound line.
The machine decides which parts of the shared hardware exist. A Tandy 1000 has only its CGA, with no HGC or EGA. A PCjr has no expansion slots, no turbo, no hard disk and no second drive. The OSD hides what does not apply. The core also forces those options off, so a saved setting or a runtime-control port cannot bring them back.
Machine selection
What each machine is made of
Machine (System & BIOS) picks the IBM PCXT, the Tandy 1000 or the IBM PCjr. On a PC/XT, PCXT Video picks the CGA/HGC pair or the EGA card. Both are sampled while the machine is held in reset, together with the PCjr RAM size, the CPU type and the first video.
| Part | IBM PC/XT | Tandy 1000 | IBM PCjr |
|---|---|---|---|
| CPU | 8088 or 8086; 4.77, 7.16, 9.54 MHz or Max | 8088 or 8086; 4.77, 7.16, 9.54 MHz or Max | 8088 at 4.77 MHz |
| Video | CGA + HGC/MDA, or EGA (5151, 5153, 5154 monitors) | CGA with the Tandy modes | CGA with the PCjr video gate array |
| Video memory | On the card | A 128 KiB block of system RAM, chosen with port A0h, paged with 3DFh | System RAM, paged with 3DFh |
| Keyboard | XT keyboard on port 60h | Tandy keyboard codes | Infrared frames on the NMI, read through port A0h |
| Sound | Speaker, AdLib, C/MS or Sound Blaster Pro, optional SN76489 | Speaker and SN76489 | Speaker, SN76489 and the tape line |
| Storage | Floppy A/B, two IDE images, second SD, XTIDE | Floppy A/B, two IDE images, second SD, XTIDE | One floppy drive, controller by programmed I/O at F0h |
| BIOS slot | PCXT BIOS; EGA BIOS with the EGA card | Tandy BIOS | PCjr BIOS and two .jrc cartridges |
Applied at reset
Changing the machine rebuilds the address map, the video path, the keyboard and the interrupt wiring, so these settings are latched only at reset. Until Reset & apply settings is chosen, the OSD shows that a change is pending. Options that are safe to change at run time, such as Fake 286 FLAGS or the audio levels, take effect at once.
On a PCjr, the core swaps COM1 and COM2. It also drives timer channel 1 from channel 0 when the BIOS asks for it, and makes the BIOS do a cold start after every reset: the SDRAM keeps the warm-start flag, so the core hides it until the BIOS writes it again.
MGL profiles
A MiSTer MGL file starts the core under a name of its own, and each name has its own config/<name>.CFG. With same_dir="1", every profile keeps using games/PCXT. So the same RBF can appear in the menu as PCXT, PCXT-Tandy, PCXT-PCjr and PCXT-EGA, each with its machine, BIOS and disks.
This is a feature of MiSTer's Main and needs no build of its own. The build profiles in section 08 are something else: separate RBFs with only part of the hardware.
Logical design
Core architecture
The CPU and the chipset form the XT bus. Memory, ROMs and most video memory sit in one SDRAM behind an arbiter. The video cards run in their own clock domains, and the MiSTer top level joins everything to the HPS, the OSD, DDRAM and the physical outputs.
Clock domains
The chipset and the CPU run from a 50 MHz clock, and the CPU speeds are counted against it. A second PLL takes that clock as its reference, so the video keeps a fixed phase with the CPU; cycle-locked effects depend on that. It produces:
28.636 MHz: the CGA family, twice the 14.31818 MHz XT crystal.57.272 MHz: the video mixer, the EGA front end and the shared 350-line framebuffer.114.545 MHz: the SDRAM controller and the HGC/MDA front end.
Video I/O writes are stretched and acknowledged in the video clock, so short Max-speed bus cycles never lose a CRTC or mode-register write.
One memory system
The SDRAM holds the 1 MiB image of the CPU address space, a ROM bank with every BIOS slot and both cartridges, the video memory of the EGA, CGA and HGC/MDA cards, and the 2 MiB of EMS. Four clients share it: video fetch, the CPU bus, the ROM loader and a spare port.
Video requests carry a deadline and go first when it is close. Refreshes are owed every 7.8 µs, and up to eight can be postponed while the memory is busy. The CPU therefore finds at most one operation in front of it. In 8086 mode, word accesses take a private 16-bit path beside the 8-bit XT bus.
Everything software can see stays in the chipset and the video cards. Converting a picture for the physical output happens after the native raster and never feeds back into CRTC state, video memory or DOS-visible timing.
Colour video
The CGA family: CGA, Tandy 1000 and PCjr
The three machines use one CGA path: a 6845-style CRTC (the UM6845R type), the sequencer, attribute decoding, RGBI output and a composite decoder. The Tandy 1000 and the PCjr add their own registers and modes to it, and fetch their video memory from system RAM instead of from the card.
IBM CGA
- 16 KiB of video memory at B8000h, mirrored to BFFFFh.
- Text modes, and 320×200 and 640×200 graphics.
- RGBI output with a selectable monochrome tint: green, amber, B&W and others.
- Simulated NTSC composite colour, decoded from the RGBI transitions and the colour burst phase.
- Visible border, and the 3DAh status with display enable and vertical retrace.
Tandy 1000 and PCjr
- 160×200 and 320×200 in 16 colours, and 640×200 in 4 colours.
- Tandy: the 3DEh palette and border registers, and port A0h picks the 128 KiB block of RAM that holds the picture.
- PCjr: the gate array's 16 mode and palette registers, written through 3DAh, with its own status bits and a vertical-retrace interrupt.
- The 3DFh page register sets the CPU and CRT pages, 16 or 32 KiB.
- The picture is CPU RAM: there is no copy of it on a card.
CRTC frame stacking
Some programs make the 6845 start a new frame on every scanline. They program a tiny frame (R4 at 0 or 1, R9 at 0) and rewrite R0–R2 in the middle of each line, so every line gets its own start address. The water reflection in the end credits of Area 5150 is one example. Each of those writes must land within a few characters of its slot. Native runs the trick on the CRTC as it is, which needs CGA-exact CPU timing that the core does not reach.
Rebuilt keeps the registers as they are written. It records the start addresses in the order they are written and shows them on a stable 80-column raster of its own, so the picture depends on the order of the writes, not on their timing. It only takes over while R0 is rewritten on every line. A bench replays a real 5150 bus capture of that effect, with and without timing errors.
The graphical boot splash
The splash is a 320×200, 16-colour RGBI picture, stored two pixels per byte in splash_rom.v, with one read port for each renderer. On the CGA family, cga_splash_renderer.v holds each pixel for four 28.636 MHz clocks of the native aperture and sends it through the normal CGA output. Composite mode therefore sees the real colour transitions and carrier phase. With the EGA card, the EGA renderer draws it. The picture fades in and out, and Splash time shows it for 5, 10 or 15 seconds, or not at all. With HGC/MDA as the first video, the CGA draws the splash and the HGC/MDA output returns afterwards.
Monochrome and enhanced video
HGC/MDA and the EGA card
On a PC/XT, the CGA can work beside a Hercules-compatible monochrome card, or both give way to an IBM EGA. Their 350-line modes are not a 15 kHz picture, so a shared framebuffer can convert them for a television without changing the card that DOS sees.
HGC/MDA
- Pages at B0000h and B8000h, selected by the card.
- 720-dot, 350-line source timing.
- Monochrome text with normal and bright intensity.
- Hercules 720×348 graphics.
- Live beside CGA: PCXT 1st Video tells the BIOS which card is first, and F11 swaps the MiSTer output between the two.
EGA, strictly
- An IBM EGA: modes 0–7, 0Dh, 0Eh, 0Fh and 10h.
- 64-colour attribute palette, pel panning and line compare.
- 5151, 5153 and 5154 monitors, with the switch sense the BIOS reads.
- 256 KiB of video memory in SDRAM. The display side is retimed so that the picture matches a BRAM card dot for dot, and a bench checks this.
- The IBM EGA BIOS at C0000h, from its own OSD slot. There are no VGA modes.
350-line modes on a 15 kHz television
The converter, in vendor/pc_common (ega_fb_capture, ega_fb_readout, ega_ddr_arbiter), captures one complete frame in DDRAM and reads it out on a 910-dot raster of about 15.734 kHz. A frame is published only when it is complete and has the right geometry, and it is never replaced halfway through its two fields. 480i keeps every source line across two interlaced fields. 240p is progressive and steady, at the cost of vertical detail. The CGA family never enters this path.
Output controls
| OSD option | Effect | Use case |
|---|---|---|
350-line CRT: Native | Leaves the card's raster untouched. | Multisync display, scaler or compatible CRT. |
480i 15 kHz | Shows all source lines over two fields. | 15 kHz television with interlace. |
240p 15 kHz | Progressive output with less vertical detail. | 15 kHz television, steady picture. |
CRT H/V offset | Moves the converted raster. | Centring and overscan on a tube. |
Monitor | 5154/ECD, 5153/CGA or 5151/MDA for the EGA card. | The display the EGA BIOS should drive. |
System capabilities
The machine around the video
The options below are those of the default mister_pcxt_full build, the one published in releases/. Each is available on the machines that had it.
Processor and timing
- 8088 mode with a four-byte prefetch queue.
- 8086 mode with a six-byte queue and a private 16-bit SDRAM path.
- Cycle-counted 4.77, 7.16 and 9.54 MHz settings.
- Max, an unthrottled profile for throughput.
- Fake 286 FLAGS, for software that probes the reserved FLAGS bits.
Memory and storage
- 640 KiB of conventional memory; 128–640 KiB on the PCjr.
- Lo-tech EMS up to 2 MiB, with its frame at D000h.
- UMBs at A0000h (with the CGA/HGC card) and in the upper memory that no ROM or EMS frame takes.
- Floppy A/B, two IDE images and the second SD; XTIDE at EC000h.
- A real-time clock for DOS.
Audio
- AdLib OPL2 (JTOPL) at 388h, or also at the Sound Blaster FM address 228h.
- C/MS (SAA1099) or a Sound Blaster Pro at 220h, one at a time, because they collide on 226h/227h. The DSP reports version 3.00 (Pro 1) and uses IRQ 5 or 7.
- SN76489 (JT89) on the Tandy 1000 and the PCjr, optional on the PC/XT.
- PC speaker, PCjr tape sound, and MIDI through an MPU-401 UART or MT32-pi.
Input and expansion
- PS/2 keyboard, sent as XT codes, Tandy codes or PCjr infrared frames.
- Serial mouse on COM1, with a DOS driver such as CTMOUSE.
- Two analog or digital joysticks, optionally synchronised to the CPU speed.
- MPU-401 at 330h–331h, and USER I/O as MIDI or COM2.
- Runtime-control ports at 8980h–898Fh (XTEGACTL), so a DOS launcher can set speed, sound and input without the OSD.
Address space
The 1 MiB memory map
The CPU sees a 20-bit address space. The same regions mean different things on each machine, and the selected PC/XT video card, the EMS and the UMBs change what answers in upper memory.
The map is an address-space view. It does not mean that every block is available to DOS as a UMB at the same time: the selected video card owns its aperture, EMS takes its 16 KiB banks, and XTIDE takes the EC00h window when it is loaded.
| Address range | IBM PC/XT | Tandy 1000 | IBM PCjr |
|---|---|---|---|
00000h–9FFFFh | 640 KiB of RAM | 640 KiB of RAM; port A0h picks the 128 KiB block that holds the picture | 128–640 KiB of RAM, picture included |
A0000h–AFFFFh | A000 UMB (CGA/HGC), or EGA memory | A000 UMB | — |
B0000h–B7FFFh | HGC/MDA page 0, or EGA (monochrome map) | — | — |
B8000h–BFFFFh | CGA, or HGC/MDA page 1, or EGA | Window onto the video block, 16 or 32 KiB paged with 3DFh | Window onto RAM, paged with 3DFh |
C0000h–C3FFFh | EGA BIOS with the EGA card; RAM with CGA/HGC | RAM | Cartridges |
C4000h–CFFFFh | RAM (with the EGA card, the C400 UMB option) | RAM | Cartridges |
D0000h–DFFFFh | Lo-tech EMS frame, four 16 KiB banks, I/O at 260h–263h | Lo-tech EMS frame | Cartridges |
E0000h–EBFFFh | RAM | RAM | Cartridges |
EC000h–EFFFFh | XTIDE option ROM (EC00 slot) | XTIDE option ROM | Cartridges |
F0000h–FFFFFh | PCXT BIOS | Tandy BIOS | PCjr BIOS |
Effective configuration
OSD and build profiles
The OSD holds the choices a user makes at run time. The build profile (profiles/*.tcl, sourced by config.tcl) decides which hardware an RBF contains.
Build profiles
mister_pcxt_full is the default and the RBF published in releases/. It contains all three machines, CGA, HGC/MDA and EGA, OPL2, C/MS, the Sound Blaster Pro, EMS, the UMBs and MIDI. The other profiles build one machine or one video family, to free FPGA resources or to keep the menu of the earlier separate cores. scripts/build_profiles.sh compiles every profile and reports ALM, M10K and the timing slack of the four corners.
| OSD group | Main options |
|---|---|
| Main page | Floppy A/B, write protection, IDE images, second SD and CPU speed. |
| System & BIOS | Machine, PCXT Video, CGA/HGC enable, first video, splash time, CPU type, Fake 286 FLAGS, the BIOS of each machine, EGA BIOS, EC00 ROM, PCjr cartridges and RAM, BIOS write protection. |
| Audio & Video | Audio 220h (C/MS or Sound Blaster), OPL2, Tandy sound, tape sound, speaker, audio boost, stereo mix, CRT offsets, sync widths, scaler effect, aspect ratio, border, CRTC frame stacking, composite, display tint and 350-line CRT. |
| Hardware | EGA monitor, EMS, UMBs, joysticks, joystick swap and sync, Sound Blaster IRQ, MPU-401 and USER I/O. |
| MT32-pi | Use, mode, ROM, SoundFont and hanging-notes reset, shown when an MT32-pi is detected. |
DOS environment
The supplied hdd/CONFIG.SYS is written for an EMS frame at C000h (mister_pcxt_cga). With the default build, move the LTEMM frame and the USE!UMBS range to D000h.
FILES=40
BUFFERS = 30
DOS = HIGH, UMB
DEVICE=C:\UTIL\USE!UMBS.SYS D000-EC00
DEVICE=C:\UTIL\DOSMAX\DOSMAX.EXE /R+ /N+ /P-
DEVICEHIGH=C:\UTIL\LTEMM.EXE /p:C000 /x /n
SHELL=C:\UTIL\DOSMAX\SHELLMAX.COM C:\COMMAND.COM C:\ /E:256 /PGetting started
BIOS, splash and startup
Recommended path
- Copy
games/PCXTto the MiSTer SD card. - Select Computers / PCXT and open the OSD with Win + F12.
- Choose the Machine. For a PC/XT, also choose the video card, the CPU type and the speed.
- Mount a floppy or hard-disk image.
- Load the BIOS of that machine under System & BIOS. The BIOS Builder prepares every image.
- Use Reset & apply settings.
ROM roles
- The PCXT, Tandy and PCjr BIOS slots each fill F0000h–FFFFFh when their machine is chosen.
- The EGA card needs an IBM EGA BIOS, at C0000h.
- EC00 takes an XTIDE option ROM of up to 16 KiB. Some system BIOS images already carry XTIDE.
- The PCjr takes two
.jrccartridges. Loading one restarts the machine, so the BIOS finds it. - The CGA, Tandy, PCjr and HGC/MDA video need no ROM of their own.
If the BIOS of the chosen machine, or the EGA BIOS, is absent, the core keeps the splash on screen and holds the machine in reset. The OSD names the missing slot. The CPU never runs from an empty F0000h, and the menu stays usable from whichever display is connected.
F12 behaviour
F12 pauses the splash countdown and shows the JTFrame credits while the machine stays held; pressing it again resumes the splash. After startup, the same key pauses the machine and shows the credits. Win + F12 opens the MiSTer OSD.
Verification and boundaries
What is checked and what remains deliberate
Every RTL directory has a TESTBENCH/ folder of focused benches, run locally with Icarus or Verilator. They check the contracts that are easiest to break: Max-speed bus cycles, clock crossings, the machine-specific glue and the video timing.
| Area | Benches | What they hold down |
|---|---|---|
rtl/8088 | 7 | Prefetch queues, 8086 timing and speeds, CPU type latch, Fake 286 FLAGS. |
rtl/KFPC-XT | 20 | Bus arbitration, wait states, refresh collisions, EMS protection, BIOS hold and pending-reset notices, PCjr infrared keyboard and cold boot, XTEGACTL. |
rtl/mem | 12 | Memory maps, the SDRAM arbiter and controller, the ROM loader, video fetch and an end-to-end CPU path. |
rtl/video | 16 | CGA pixel and CRTC latency, composite timing, the PCjr gate array, frame stacking, splash and credits. |
rtl/sound | 8 | Sound Blaster DMA, playback, mixer, stereo and the FM path. |
rtl/common | 2 | The PCjr programmed-I/O diskette against the standard controller. |
vendor/pc_common | 20 | The EGA CRTC, cursor, panning, monitors, switch sense, the SDRAM-against-BRAM equivalence, and the 350-line capture and readout. |
Known boundaries
- Max is an unthrottled throughput profile, not historical hardware.
- CRTC tricks timed to the exact CGA cycle need
Rebuilt, notNative. - 240p trades vertical detail for a steady television picture.
- Native HGC/MDA and EGA 350-line output need a display or scaler that accepts it.
- BIOS and disk-image compatibility vary with the firmware and the media geometry.
The important boundary is explicit
Emulated features stay software-visible in the chipset or in a video card. What adapts the core to MiSTer, such as the 15 kHz conversion, the output mixer and the scaler, sits after the native raster. Choosing a different output never changes what a program measures.
Project direction
What this core does and does not claim
Explicit goals
- Recreate the IBM PC/XT, the Tandy 1000 and the IBM PCjr as usable machines on MiSTer.
- Share one CPU, chipset and memory system, so a fix reaches every machine.
- Keep each video card understandable and testable on its own.
- Make CGA composite useful on CRT and LCD, and 350-line modes usable on 15 kHz televisions.
- Keep the BIOS, OSD, splash and credits recoverable from the selected output.
Outside the current goal
- VGA, SVGA or VBE: the EGA card is strictly an EGA.
- AT-class machines and the 80286.
- Every model and peripheral of the period.
- Guaranteeing every BIOS, demo, disk image or CRT timing combination.
- Claiming that Max has the timing of a 4.77 MHz motherboard.
Source layout
PCXT.sv | MiSTer top level: OSD, clocks, reset, machine selection, storage, video selection and output. |
profiles/ | Build profiles: mister_pcxt_full and the smaller ones. |
rtl/8088/ | MCL86 CPU (BIU, EU, microcode) with the 8088/8086 selection. |
rtl/KFPC-XT/ | Chipset, CPU-facing bus, peripherals, Tandy and PCjr glue. |
rtl/mem/ | SDRAM arbiter, memory maps, ROM loader and video fetch engines. |
rtl/video/ | CGA with the Tandy and PCjr video, composite, HGC/MDA, scandoubler and splash. |
vendor/pc_common/ | The EGA card, its SDRAM front end and the 350-line 15 kHz framebuffer, pinned. |
rtl/sound/ | JTOPL, JT89, SAA1099 and the Sound Blaster Pro. |
rtl/common/ | Shared support: floppy, IDE, credits, joysticks and memories. |
SW/ROMs/ | Open BIOS and XTIDE images and the BIOS Builder. |
docs/ | Implementation notes, the documentation index and this report. |
Open project
Credits and licence
MiSTer integration and continuing project development by Aitor Gómez García (spark2k06), built on important contributions from the FPGA recreation and classic PC preservation communities.
The 8088/8086 CPU comes from MCL86 by Ted Fried (MicroCoreLabs). The PC/XT chipset comes from KFPC-XT, and the PCjr work from KFPC-PCjr, both by kitune-san. The original CGA and Hercules-compatible video includes the Graphics Gremlin project by Eric Schlaepfer (TubeTime). The OPL2 and the SN76489 are JTOPL and JT89 by José Tejada. The Sound Blaster, IDE, floppy and RTC are based on ao486, and the UM6845R CRTC, the SAA1099 and the MiSTer framework come from the MiSTer developers. The mouse, joystick, UART and MIDI components keep their upstream credits. The boot splash art is by Mills, and the COM2 fixes are by manfredi90. The complete in-core list is in credits/msg.
Source code and the full README: github.com/aitorgomez-net/PCXT_MiSTer.
BoogerMann is explicitly acknowledged for contributions to the PCXT MiSTer development and for collaboration around the project; the name is also kept in the in-core credits/msg list.
Technical contribution associated with BoogerMann: the integration of the newer SystemVerilog MCL86 organisation, with separate BIU/EU, microcode and 8088-wrapper sources. It also carries the instruction-boundary INTR sampling fix (intr_delay), so maskable interrupts are recognised deterministically across microcode timing and CPU speed profiles.
The repository is distributed under the GNU General Public License. Redistribution and modification must comply with that licence and with the terms of the integrated components.