(评论)
(comments)

原始链接: https://news.ycombinator.com/item?id=43888007

在Hacker News上,MartyPC——一款在网页浏览器中运行的、精确到周期的IBM PC模拟器——引起了极大的关注。该模拟器由GloriousCow开发,允许用户以60fps的速度运行诸如Area 5150之类的演示,甚至在移动设备上也能流畅运行。用户对其近乎完美的模拟能力印象深刻,包括查看组件状态、反汇编CPU指令、编辑寄存器和使用内存可视化工具。 讨论强调了该模拟器能够复制取决于制造商和温度等因素的硬件故障,这展示了其精确性。一位评论者指出,温度差异会影响晶体管的行为并导致不同的结果。用户还回忆起演示场景以及在早期PC的硬件限制下取得的技术成就。一些人讲述了早期PC时代RAM限制和扩展板的经历。原作者因分享其工作并鼓励他人在其学习成果的基础上继续努力而受到赞扬。


原文
Hacker News new | past | comments | ask | show | jobs | submit login
A cycle-accurate IBM PC emulator in your web browser (martypc.net)
149 points by GloriousCow 1 day ago | hide | past | favorite | 24 comments










MartyPC brings cycle-accurate IBM PC emulation to your web browser.

Run Area 5150 at 60fps on your phone!

Almost every feature from the desktop version is present if practical:

- View the realtime state of nearly every component of the system. - View live disassembly of CPU instructions. - Edit registers and memory. - Slow down or speed up the system. - Peek on how games draw their graphics with the Memory Visualizer.



I've been using MartyPC for a few years and except for emulating glitches in hardware which depend on the manufacturer, date of manufacture or even temperature, it is getting harder to find cycle accurate tricks that MartyPC can't emulate perfectly (believe me, we've been trying).

The whole thing is a marvel of software engineering!

What is remarkable is that the author (GloriousCow) doesn't complain that people are ripping off his code and ideas, but that more people haven't used his learnings to create other cycle accurate emulators for the PC.



Temperature? Really? How does that work?


If you program a register at a moment and in a way that causes two signals to "collide", the result effectively depends on transistor behavior. That in turn can be temperature dependent.

For an example on the PC see https://int10h.org/blog/2023/03/cga-6845-crtc-phantom-vsync-...



Thanks. Transistor level race conditions will keep me up at night.


Amazing link. Thanks for sharing.

Where can I find more writeups like this?



This appeared on the fp the same day i spent 15 hours trying to get various old/weird OSes installed. Xerox Star (viewpoint), os/2 warp 4, serenityos, debian 9, and where is freebsd 2.2 disc 2, might i ask?

commenting for posterity, and to say the web emulator is very slick, i have some dos diskettes to try out.



Pretty incredible!

I’m on mobile right now so I can only comment on the demo that runs automatically, which I understand isn’t the _point_. :)

More about the demo: https://www.vogons.org/viewtopic.php?t=89435

(For those unfamiliar with “demo” in this context, see https://en.m.wikipedia.org/wiki/Demoscene)

I look forward to checking out the features you mention on a proper computer.



I loved it when the Doom floating head demon guy came up. Right when y'all were about to ask "...but can it run Doom?"


Thanks for pointing people to Area 5150. Context for others: This, and its predecessor 8088 MPH, uses every single trick in the book and many not written down anywhere to squeeze that kind of performance out of a real 1981 IBM PC 5150 with IBM CGA card. Thus they only run correctly on that specific hardware, not a clone computer or card. "Regular" software emulators also have a tough time. Showing off MartyPC with Area 5150 is thus two technical feats combined into one.


Wow that's amazing. I sometimes play NES emulated games, which are (due to hardware limitations) using some tricks while displaying larger mobs, to show a few sprites instead of one (and using monitor synch to quickly switch the sprites in between switching to another scanline). This however renders as blinking in my emulator.

I can only imagine that this demo was doing similar tricks to "push the limits" on CGA.

Also, I remember my i386-33SX playing full 4 channel music on the PC Speaker in the game "Pinball Fantasies". This was state-of-the-art (also not working properly on DOSBox emulator nowadays)



Can you imagine sending an Area 5150 disk back in time to 1981?


You’d be fussing around trying to find enough RAM expansion cards to get your system to 640K (including hot patching the BIOS since it had a bug that it could only get to 544K).


640 KB in 1981 was more expensive than 640 GB today.


One of my neighbours in Sydney sold a board he made in his garage, that gave you an extra ten slots, which I filled with way too much RAM. Sort of like a homebrewed 5161, before the 5161 existed.


That's kind of neat. Did he just extend the bus in a "raw" fashion or put buffers on it? (The downside of the 5161 was any memory device in the 5161 had an extra wait state thanks to the speed of the buffers, which were necessary to deal with the capacitance on the cable to the expansion unit.)


They were buffered, from my poor memory. So was slower when you exceeded mainboard memory, but you could load entire tapes into memory, which let you do things no one else could. Faster processing than disk/tape access.


Ought to be enough for anyone.


That was only the first 64k motherboard. ( Five slots only ). Fixed with the PC that came out less than two years later. My brothers machine only had 384k, and it was more than enough. Only three years after, I built 10Mhz XT w/ a V20 640k running Xenix.


If I had seen this back in the day, I might have given up on programming out of sheer awe!


I miss Notacon and Jason Scott's Demoscene parties.


Some of my best hacker/nerd friends I met at notacon. It had a vibe that no other con I’ve been to has had.


That demo was pretty mesmerizing!


truly epic!






Consider applying for YC's Summer 2025 batch! Applications are open till May 13


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact



Search:
联系我们 contact @ memedata.com