RSSAmplifier

Blog

Adventures in PC Emulation

martypc.blogspot.comRSS feed ↗25 posts

Latest posts

Executable Emoji

Warning: This page contains hundreds of emoji. If you're using a screen reader, be sure it doesn't read them all out loud. A whole bunch of emoji. What could they mean? This particular post comes out of left field a bit. I was playing around with a web application I had made - an online disassembler for the x86 - when I noticed that emoji were being encoded into the url. I pasted a goat emoji, 🐐…

60fps Video on a CGA? - The GlyphBlaster

GlyphBlaster The GlyphBlaster in action - is that a cat in text mode?? There's a certain genre of retro-hardware hack that everyone recognizes is technically cheating, but has a certain audaciousness to it that merits respect regardless. I hope that this one falls into that category! A few years ago, I was impressed by TheRasteri's PiPU project - basically, a Raspberry Pi-powered mapper for the…

Exploring 16-bit Bus Access on the PC/AT

Entering the 16-bit Era I've been adding support for the 8086 CPU to MartyPC, and looking ahead to eventual support for the 286 . The biggest fundamental change coming from the 8088 is that the data bus width on these CPUs expands from 8 bits to 16. This ends up being a bit more complicated than I originally anticipated, but I've come to learn some interesting things about how Intel implemented…

Emulator Debugging: Area 5150's Lake Effect

My last few articles on bus sniffing the IBM 5150 have been building up to this one. We're going to leverage our bus sniffer and sniffer decoder to finally debug Area5150's "Lake" effect. "But wait -", you might be asking: "- doesn't MartyPC run Area5150 already?" Yes, it does, but I have a dirty little secret I need to confess to the world. Despite all the accolades MartyPC has received about…

PC Floppy Copy Protection: EliaShim CodeSafe

This is part 6 of a series of articles investigating various floppy copy-protection schemes seen on the IBM PC platform. You may wish to read the previous entries in this series: Part 1, covering Formaster Copy-Lock Part 2, covering Softguard Superlok Part 3, covering Electronic Arts Interlock Part 4, covering Vault Prolok Part 5, covering XEMAG Xelok EliaShim Microcomputers was a computer…

PC Floppy Copy Protection: XEMAG Xelok

This is part 5 of a series of articles investigating various floppy copy-protection schemes seen on the IBM PC platform. You may wish to read the previous entries in this series: Part 1, covering Formaster Copy-Lock Part 2, covering Softguard Superlok Part 3, covering Electronic Arts Interlock Part 4, covering Vault Prolok XEMAG was a commercial disk duplicator that provided services to companies…

PC Floppy Copy Protection: An Interview With Robert McQuaid

This post goes hand-in-hand with my article on Vault Corporation's Prolok copy-protection technology . Perhaps the most important historical legacy of Vault Corporation results from the lawsuit they initiated against Quaid Software, makers of the backup software CopyWrite. CopyWrite was capable of duplicating Prolok-protected diskettes with the help of a bundled utility called RAMKEY. Vault sued…

PC Floppy Copy Protection: Vault Prolok

This is Part 4 of a series on PC floppy copy protection methods. You can read the previous parts here: Part 1, covering Formaster Copy-Lock Part 2, covering Softguard Superlok Part 3, covering EA Interlock Vault Corporation Vault was conceived in 1979 and incorporated in 1983. There's not much information about the early days of the company, but 1983 was a busy year for them. The trademark filing…

PC Floppy Copy Protection: Electronic Arts Interlock

This is Part 3 of a series on PC floppy copy protection methods. Again, I need to thank NewRisingSun and OBattler for their invaluable contributions. You can read the previous installments here: Part 1, covering Formaster Copy-Lock Part 2, covering Softguard Superlok Before Electronic Arts (EA) was the publishing juggernaut that it is today, it was just one of dozens of software publishers putting…

PC Floppy Copy Protection: Softguard Superlok

This is part 2 of a series on PC floppy copy protection methods. You can read Part 1, covering Formaster Copy-Lock here . Softguard Systems was founded by Joseph Diodati, Paul Sachse and Ken Williams in 1983 ¹ . The company went public in 1984, and by 1985 was one of the industry leaders in copy protection technology, although they produced a few other unrelated products as well. Advertisements…

PC Floppy Copy Protection: Formaster Copy-Lock

Preface This is Part 1 of a series of articles investigating various PC floppy protections, as I get them working in MartyPC . It assumes you have a familiarity with the structure of a PC floppy disk and the basic operation of a PC floppy drive. Thanks Thanks to NewRisingSun on VOGONS for his vast knowledge of copy-protection schemes and history, and to OBattler for his extensive knowledge of PC…

Exploring the NEC V20 CPU

A V20 CPU, courtesy of Konstantin Lanzet ( CC ) The NEC V20 was a 16-bit CPU released in 1984. It is pin-compatible with the Intel 8088 , and clones the 8088's instruction set. It also includes newer instructions that had been introduced two years prior by the Intel 80186 and 80286 , but does not include the latter's protected-mode features. Besides the 186 instruction set, NEC also added new…

The Complete Bus Logic of the Intel 8088

In a previous article , I described a simple state machine to explain the prefetch behavior and miscellaneous observed bus delays of the Intel 8088. I now believe that the model I described there - although successful in modelling the 8088's behavior - was unnecessarily complex. There are in fact far fewer legitimate bus "delays", and they do not relate to internal state transitions. I have also…

Bus Sniffing the IBM 5150: Part 2: Writing a 8088 sigrok Decoder

In my last article , I dodged the issue of writing a custom decoder for the 5150's bus signals to use in DSView, instead just processing the exported CSV with the pandas Python library. This had the advantage of familiarity, but we're leaving some powerful tools on the table. Turning Excel into a logic analyzer display may be a cute trick, but it comes with a few limitations. Zooming out and…

Bus Sniffing the IBM 5150: Part 1

Writing a cycle-accurate emulator for a computer system is more than just understanding all the CPU instruction timings. A computer is a complete system with peripherals, interrupts, IO bus signals, and DMA. All this comes with an array of different timings and quirks. When software like Area 5150 is written that requires perfect cycle timing, it can be a challenge to provide the level of accuracy…

Hacking the Book8088 for Better Accuracy

The Book8088 is an interesting little machine. It is essentially a 1980's computer in a laptop form factor. With apologies to Sergey Kiselev , whom the manufacturers of the Book8088 did a little dirty , I couldn't resist ordering one myself to tinker with. The Book8088 is trying hard to basically be compatible with the original IBM PC, containing some of the same or equivalent chips. It's natural…

A Test Suite for the Intel 8088

In a previous article, I revealed one of the secrets to MartyPC 's accuracy, hardware validation . To summarize, it is a method of using a microcontroller to run an instruction on a real 8088 CPU at the same time as the emulator executes the same an instruction, and then comparing the resulting cycle states (and optionally registers) for consistency. Once again, credit goes to phix and his…

The 8088MPH CPU Test

Much has been written about the PC demo 8088MPH . If you haven't seen this demo yet, take a moment to watch it. If you're familiar at all with the IBM PC, you will immediately understand why this demo is so impressive. If not, consider that the IBM PC was a very limited, business oriented machine not designed for fancy graphics, and its optional CGA graphics adapter was best known for producing 4…

The 8088 Prefetch Algorithm

⚠ This post is now outdated. Although the logic described here will correctly model the externally observed behavior of the 8088, it has been replaced by a far simpler model of the 8088 bus logic described here . I am leaving this post up for reference, but the logic described here should not be used to develop an 8088 emulator. Preface Much of the terminology used in this post is my own. It may…

Emulator Debugging: Windows 3.0 and VGA

My emulator has incomplete implementations of the EGA/VGA cards. Since these cards share a lot of common functionality and register architecture, I developed them simultaneously. In some ways, the VGA is just an EGA card with a DAC, faster crystal, and color registers bolted onto it. So much so, that the VGA's classic 640x480 16 color-mode is nearly identical in function to the EGA's equivalent…

Emulator Debugging: PIANOMAN 3.0

Early in development I was looking for a utility to test my crude PC speaker emulation. I found a simple keyboard-piano program called PIANOMAN. I'm not sure where I found it - there are lot of archives of old DOS software out there, after all. The version I downloaded was PIANOMAN 3.01. PIANOMAN is credited to a Neil J. Rubenking, who apparently is an author and long standing writer for PC…

Emulator Debugging: Halt During Boot

My emulator has a bug. I've encountered and fixed countless bugs over the course of development, but this one has haunted me since I was first able to boot the IBM 5160 BIOS, and still isn't squashed. I thought it might be interesting to blog my process of finally squashing this bug once and for all - as I start to write this blog entry, I haven't yet. So we'll see if I am successful! The bug is…

Hardware Validating an Emulator

In the emulation world, there are a few different ways to determine if your emulator is accurate. The traditional way has been through the use of test ROMs: ROMs that either act as cartridges for cartridge-based console systems, or replacement system ROMs that execute from the system bootstrap. These ROMs will typically run a specified suite of tests and output pass/fail status either via the…

Exploring CGA Wait States

In order to accurately emulate cycle-counted demo effects such as the Kefrens bars effect in 8088MPH, or the end credits in Area 5150, there are essentially four prerequisites: Cycle-accurate 8088 CPU emulation including processor instruction queue emulation Cycle-accurate CGA CRTC emulation Accurate DMA emulation for DRAM refresh Accurate CGA wait state emulation Item #3 was covered in my last…

Exploring DMA on the IBM PC

DMA, or Direct Memory Access, is a scheme that allows peripherals access to system memory without the assistance of the CPU, which normally would require the use of 'mov' instructions to shuffle data around. With DMA, a hard disk controller can read and write to memory itself. However, the CPU and the DMA-requesting device must not attempt to use the memory bus at the same time. Some sort of…