NHacker Next
login
▲MartyPC, cycle accurate IBM PC/XT emulatorvogons.org
144 points by nbaksalyar 774 days ago | 17 comments
Loading comments...
mmastrac 774 days ago [-]
I was curious about this...

"8253 PIT - Recently rewritten after microcontroller-based research. At least one previously undocumented feature discovered. Accurate enough for PCM audio."

... and it turns out that it's this ...

https://github.com/dbalsom/martypc/blob/main/core/src/device...

                        // If the counting element was reloaded between load of LSB and MSB, it is an incomplete load.
                        // Reload the counting element again when we get the MSB.
                        // Note: This is completely undocumented behavior
qingcharles 773 days ago [-]
Undocumented "feature" :)
viler 774 days ago [-]
The author has done a superb job here. Not only does it have a cycle-exact Intel 8088 implementation (matched with disassembled microcode timings and hardware-verified) - it does the same for the CGA, where the dot clock is 3 times the CPU clock frequency... and it correctly represents the monitor's output, overscan included, which most other PC emulators have never bothered to do.

And those debugging tools are something else, too!

sedatk 774 days ago [-]
So, this should run 8088MPH demo without issues? (Nevermind, there is a link to it on the page :))
viler 773 days ago [-]
Yes, and Area 5150 too :)
wkat4242 774 days ago [-]
It was even more impressive when I read that he only started work on this less than a year ago. Wow.
autoexec 774 days ago [-]
My first computer was a hand me down IBM XT. No hard drive, but two 5.25 floppy drives. I never tried running The Secret of Monkey Island on it, but it did run games like Night Mission Pinball. Paratrooper. and JBIRD.
dirkderkdurk 773 days ago [-]
This is so neat! I'll have to incorporate it into my Unreal Engine x86 emulator plugin menagerie!

https://youtu.be/yVO2VDPnI0Y (the first 1.5 minutes are fine to watch, the rest is of dubious worth)

mrlonglong 773 days ago [-]
There seems to be an issue with keys such as !"£$%%^&*():{} with this emulator, I can't even type in D: to change drive as the colon does not get sent. It might be that I am on an UK keyboard? Otherwise, it works very well, if a bit slowly.
mrlonglong 771 days ago [-]
As a follow-up to myself. This bug is now fixed in git branch tag version_0_1_3.
qingcharles 773 days ago [-]
This is a fantastic piece of work.

Are there any cycle-accurate like this for 8-bit consoles?

r3jjs 773 days ago [-]
By definition, all Atari 2600/VCS emulators are cycle accurate.

That machine required very precise timing of the CPU to drive the video output.

There are a number of other cycle-accurate emulators, including some you woudln't expect, like a cycle-accurate emulator for the C64 floppy disk (needed for anti-piracy and some high-end demos that use the floppy like a co-processor).

tadfisher 773 days ago [-]
For the uninitiated, the Commodore 1541 (and later 1570) are external floppy drives that contain their own 6502 CPU and work RAM. In fact, you could daisy-chain two of them with a C64, tell one to copy a whole disk from the other, and disconnect the C64; the drives would continue to work as they do not rely on the C64 at all.
thristian 773 days ago [-]
The "C64" demo "Freespin" wires the drive's data cable directly into the monitor's data cable to play a demo (including audio!) without an actual C64 involved at all:

https://www.youtube.com/watch?v=zprSxCMlECA

shon 773 days ago [-]
That’s bananas. Thanks for the link!
takantri 773 days ago [-]
I know the NES has many cycle-accurate emulators[0].

[0] - https://emulation.gametechwiki.com/index.php/Nintendo_Entert...

mmastrac 773 days ago [-]
Quite a few. At least one for each of the major consoles.