I've been thinking about emulators lately. Most of the machines that have a microprocessor or microcontroller operate similarly. I've been working out whether it would be feasible to write an emulator creator, with which you could describe components of the emulator, including all of the various hardware contained within it.
In basic terms, a CPU is really quite simple to describe. Take an instruction and do something with it. Most of them are linear, and even those CPUs that provide separate pipelines could probably be described.
This thought process came about because, as a former musician, I own a pile of synthesizers. One of them I own, A Roland W-30 music workstation, is basically a self-contained computer. It has an Intel 8098 (a variant of the Intel 8096) microcontroller on the system board. It also has a SCSI interface, floppy disk drive, and an LCD display. The workstation, which started production in 1989, went end of life by 1992 or so, and Roland discontinued building new operating system releases for it by 1994. Unfortunately there are features I've always wanted to have in the W-30, but never got around to doing anything about.
Another owner of a W-30 plucked out the EEPROMs from his W-30 and ripped all of the BIOS-level routines from them. I spent a month or two reverse engineering the entire operating system of the box to understand it, hoping I might be able to add the features I was looking for on it. After a while it became apparent that I'd probably have to write an emulator for it. That's when I stopped because I didn't have time to work on it.
This past week I started writing an emulator for it. It's not hard, it's just very time consuming. I've got many of the opcodes working and I have a plan of attack for building the emulators for the other components in the box. But while I've been looking at it, I've realized I could probably build a much more generalized emulator builder.
Anyway, I wonder if someone has already come up with something like this. If anyone knows of something like this, please post.