alt.hn

8/23/2026 at 3:13:16 AM

MartyPC is a cross-platform emulator of early PCs written in Rust

https://martypc.net/

by boilerupnc

8/23/2026 at 3:56:06 PM

One of the amazing things about this project is that the author built physical harnesses for real early CPUs so that he could build test suites against the real hardware and ensure the emulation is 100% correct, down to every timing and quirk of the original hardware.

by tensor

8/23/2026 at 6:15:23 PM

Hi, thanks for checking out MartyPC. I'm the developer if there are any questions.

by GloriousCow

8/23/2026 at 7:42:02 PM

What's your favorite "What the FUCK were they smoking when they designed this?" moment?

by indrora

8/23/2026 at 9:29:17 PM

easy - the PCjr keyboard interface.

It is insane because IBM wanted a wireless keyboard. If you're not familiar with the PCjr keyboard, it has two IR transmitters (they are electrically the same, just having two gives you a better transmission path). The PCjr system has an IR receiver.

Now, a normal keyboard cable is a standard two-wire serial protocol with clock and data. Being wireless, you have no clock, so you have to synchronize clocks, or have clock recovery built into the protocol. The PCjr does the former, using the 8253 timer chip.

The keyboard has no way of knowing if the system has received a keystroke, so the system must receive every keystroke - they can't be stored in a fifo, they can't be resent if the CPU missed it.

This rules out the possibility of using system interrupts - so when you type a key on the CPU and the IR receiver gets the start bit - the NMI line is raised, the 8253 is programmed to time the clock bursts from the IR receiver, and the CPU reads out every bit of the scancode.

In software.

by GloriousCow

8/23/2026 at 9:43:21 PM

The PCjr also famously has no DMA, so things like floppy drive transfers are both extremely slow and somewhat unreliable - the IBM floppy controller is somewhat additionally weird is that they disable interrupts as well. The only way the PCjr knows what the controller is doing is by polling its status register, and there is enough ambiguity that it sets a 555 timer that will reset the FDC and start everything over if things time out.

The combination of these two decisions means its inadvisable to type while your floppy drive is transferring data

by GloriousCow

8/23/2026 at 8:06:39 PM

Many people are very angry that you used Rust. Did you expect this choice to cause such an uproar?

by AmazingEveryDay

8/23/2026 at 8:30:49 PM

Angry people gonna angry. Don't take criticism from people you wouldn't take advice from.

by JoshTriplett

8/23/2026 at 9:32:58 PM

People will generally get angry no matter what you do. People are also angry it is MIT licensed.

But honestly I wanted to learn the Rust programming language and I thought writing an emulator was a good a project to learn as any.

I have been working on a emulator in C++ in collaboration with a friend, it is also cycle-accurate. It is called XTCE-Blue.

by GloriousCow

8/23/2026 at 7:16:32 AM

Adlib support! At least someone else remembers it wasn't only Soundblaster.

by pjmlp

8/23/2026 at 10:05:55 AM

All my friends had Soundblasters; I had a self soldered Covox. Fun times.

by anonzzzies

8/23/2026 at 12:36:06 PM

Whaaat?? Do tell more!

by abrookewood

8/23/2026 at 12:41:40 PM

For not well off geeks you could just solder a bunch of resistors together and get vastly better sound than from the crappy PC speaker and there were games that supported it and I wrote some software for it (which unfortunately is gone I think). I had a lot of just having this on the pc in the house.

https://github.com/necroware/silly-sound-bastard

by anonzzzies

8/23/2026 at 9:33:52 PM

I am very close to emulating the Covox - I emulate the Disney Sound Source, which is just a Covox with a FIFO

by GloriousCow

8/23/2026 at 1:02:38 PM

[dead]

by sjsdaiuasgdia

8/23/2026 at 10:56:47 AM

But Soundblaster came with Adlib, so surely complete support for SB should mean Adlib support as well.. ?

by _flux

8/23/2026 at 12:30:10 PM

Yeah and eventually Adlib was gone.

From Wikipedia,

"Not long after its introduction, Creative Labs introduced its competing Sound Blaster card. The Sound Blaster was fully compatible with AdLib's hardware, and it also implemented two key features absent from the AdLib: a PCM audio channel and a game port. With additional features and better marketing, the Sound Blaster quickly overshadowed AdLib as the de facto standard in PC gaming audio. AdLib's slow response, the AdLib Gold, did not sell well enough to sustain the company."

by pjmlp

8/23/2026 at 6:02:25 PM

I haven't implemented the Soundblaster card yet, although it's quite high on my list of things to do.

by GloriousCow

8/23/2026 at 1:07:41 PM

besides the fact that it was written in rust, rust happens to be a really nice language to write emulators, you don't have to think much about threading and not much abut memory management, rust makes that easy => you can concentrate on your pixels. Moreover LLM grasp it very well so that you can get a bit more spare time for your emulator-side-project.

It was very long since I wrote any sort of C++ and using rust was pretty refreshing.

Second "besides": marty's PC may not have a lot of breadth in terms of supported hardware, but it gets the accuracy totally right. It's a very special kind of achievement.

(I'm not a rust fanboy :-) I just appreciate the language for writing my emulator)

by wiz21c

8/24/2026 at 1:08:49 AM

Can it integrate with a mobile keyboard if I opened it up on a phone? I'm eager to explore the directory contents quickly on the XT. :-)

by mancerayder

8/24/2026 at 3:10:30 AM

yes, swipe up to show a keyboard. this currently only supports the 5150/5160 completely as it is a Model F keyboard and the Tandy/Jr have some differences.

by GloriousCow

8/23/2026 at 5:59:14 AM

Ironically, and unfortunately, this doesn't actually emulate the FM Towns Marty (or even the regular FM Towns PC) like I assumed it would.

by ranger_danger

8/23/2026 at 9:35:26 PM

The name is a reference to the 8088 MPH scene demo, it was the first emulator to be able to run it.

by handbanana_

8/23/2026 at 6:51:22 AM

Doesn't seem to support non-QWERTY keboards :(

by rrr_oh_man

8/23/2026 at 6:03:48 PM

I've built out a full keyboard-remapping system, to support any keyboard layout. I need help building these files.

Are you using DVORAK? If you are willing to help, please open a Github issue with some info about your keyboard, and I'll build support for it.

by GloriousCow

8/23/2026 at 8:05:38 PM

Thanks! Done

by rrr_oh_man

8/23/2026 at 10:09:47 PM

How did DOS era software handle this anyways? I can't imagine it would be fun to be a dvorak typist in the DOS era.

by creatonez

8/23/2026 at 11:04:38 PM

DOS has the 'keyb' utility and 'keyboard.sys' to support different layouts, using various code pages.

If you have a CGA card, you're stuck with the code page of the ROM your card came with, which in most cases was code page 437, although a few variants were made.

EGA/VGA had software fonts so other code pages could be loaded.

by GloriousCow

8/23/2026 at 8:39:31 AM

But it's written in Rust! Who cares about non-qwerty!

/s

by teiferer

8/23/2026 at 5:17:49 AM

Mysteriously, backslash has been mapped to backspace for some reason.

by Dwedit

8/23/2026 at 12:31:40 PM

I don't think Backspace as a key was standard internationally until 1994. Apple still doesn't use it, just Delete.

by datakan

8/23/2026 at 2:03:17 PM

This is about early IBM PCs, not apple computers. And the non-working key is the Backslash key \ , not the backspace key.

by Dwedit

8/23/2026 at 6:05:53 PM

What keyboard layout are you using? I can't reproduce on a US layout.

by GloriousCow

8/23/2026 at 7:13:22 PM

Key is Scancode 0x2B, or as a VKEY code: VK_OEM_5 (0xDC)

Javascript says the key I pressed was keycode 220 (same number as 0xDC) or key "\".

I had Tandy 1000 as the selected machine. When I look at the onscreen keyboard, I don't see a backslash key underneath backspace, but I do see one next to left shift. For keyboards that have the alternate backslash there, it is listed as having a scancode of 0x56 and a VKEY code of VK_OEM_102 (0xE2). (I haven't actually checked information specific to the actual Tandy keyboard)

by Dwedit

8/23/2026 at 9:35:51 PM

Yeah the OSD is only the Model F and the Tandy has some difference so the OSD keyboard may not work quite right with the Tandy.

I have to make all new pixel-art for a Tandy 1000 keyboard and PCjr keyboard. Fun

by GloriousCow

8/23/2026 at 10:31:29 PM

Not just the OSD keyboard, my real backslash key is also pressing backspace. You can't do your classic DOS commands like "cd\" without a working backspace key.

by Dwedit

8/24/2026 at 3:07:43 AM

I need to know what keyboard layout you're using. If it is not a standard US keyboard it will need a mapping

by GloriousCow

8/24/2026 at 5:23:04 AM

It's a US keyboard (happens to be a laptop). I've already named the scancodes and VK codes in the parent post. Browser is Firefox.

Backslash works fine if you have chosen to emulate the PC or PC XT. For PCJr, no keystroke appears at all (it does not act as backspace). For Tandy 1000, it acts as backspace. You get the same result whether you use the real backslash key or the backslash key from the on-screen keyboard.

by Dwedit

8/24/2026 at 5:42:42 AM

Thanks. This should be fixed for Tandy 1000 now. On PCjr there is no backslash key, you have to type a backspace using alt + /, so I will need to define a macro that does that for you.

The Tandy 1000 will need its own OSD since the tandy keyboard differs from the Model F in significant ways. You'll notice that if you type shift-backslash on the current model-F based OSD you'll get a 7 instead of the expected |. Because backslash is on numpad 7 on the Tandy.

Dealing with this stuff is tons of fun

by GloriousCow

8/23/2026 at 5:49:40 AM

Old terminals had this shenanigans going on too. Backspace was not backspace and so on

by unixhero

8/23/2026 at 10:19:27 AM

This comment is itself a meta comment but here we go I guess...How is it possible that half the comments in this thread are about the title itself? It’s not even a made-up title, it’s taken straight from the project’s README...I keep seeing people complaining almost aggressively that others are touting Rust as a useful tool (which, to me personally, it certainly is). Does someone have a financial stake in opposing Rust’s development, or what?

by throwaway5727

8/23/2026 at 6:12:04 PM

When I started writing MartyPC over four years ago, writing an emulator in Rust was still somewhat novel. The development of the 'egui' immediate-mode graphics framework made it possible to make one with an advanced interactive debugger.

By mentioning Rust people have been able to more easily find MartyPC as an example of how (or how not to) write an emulator in Rust.

Perhaps the tag as outlived its usefulness, especially if people find it pompous or something. I'm not trying to be Rust cultist, I swear.

by GloriousCow

8/23/2026 at 12:23:00 PM

I suppose it makes a change from complaining that the post was written by an LLM.

by tonyedgecombe

8/23/2026 at 1:15:29 PM

But if it's written in rust and with llm then they both implode and we get really insightful comments

by braiamp

8/23/2026 at 11:22:08 AM

[flagged]

by saiditmate

8/23/2026 at 11:59:13 AM

> non-human bots

I’m amused by the implication of human bots.

by taneq

8/23/2026 at 1:24:02 PM

No, it's being downvoted because (a) who cares and (b) you wrote a wall of text that makes you look like you have schizophrenia.

by dmd

8/23/2026 at 1:45:20 PM

>murderous ways

What?

by suddenlybananas

8/23/2026 at 11:40:27 AM

Rust's user community is toxic and unbearable. That's enough to explain the widespread resentment against it. Their fanboys are annoying. CommonLisp used to have a similar community problem.

by 13415

8/23/2026 at 10:29:27 PM

Yeah, I love Rust as a language but I engage with the community as little as possible. They are not pleasant to be around. Language is dope though, I really enjoy it.

by bigstrat2003

8/23/2026 at 2:34:43 PM

I write Rust code. I don’t mind it. But the truth is, I use very little of the language.

I visit the Discord, and I see all the crazy overcomplicated shit these people are writing.

If I had to try and make heads or tails of some of that shit I’d go crazy.

I actually think some of it is actual trolling by Rust itself.

And yes, the people are toxic. It’s like they really believe C and C++ and everyone else did literally everything wrong. And some of their justifications are seriously weak sauce.

And remember, I like Rust. At least the parts I use. But it’s easily going to eclipse C++ in complexity if it continues the way it has been operating.

by caspper69

8/23/2026 at 9:28:55 PM

Yup, definitely the Rust users who are toxic. Totally not the people going into every thread about Rust to tell everyone about how toxic Rust users are. Nope.

by Measter

8/24/2026 at 6:08:03 PM

> Totally not the people going into every thread about Rust to tell everyone about how...

That's the kind of straw man I was talking about. Aggressive downvoting and being butthurt about the slightest criticism; that's not normal in other communities at all.

by 13415

8/24/2026 at 10:47:48 PM

But it is true, you see way more comments complaining about "the toxic Rust community" than said toxic community itself. At some point it just becomes annoying and tiring...

by pezezin

8/23/2026 at 6:38:21 AM

probably in the minority but i want the screeching and grumbling hard disk sounds

by JMiao

8/23/2026 at 8:38:33 AM

IBMulator has HDD sounds: https://www.ibmulator.org/

by hggh

8/23/2026 at 9:53:57 PM

great emulator and nice guy too. maybe i should ask him if i can use his HDD sounds

by GloriousCow

8/23/2026 at 9:50:52 PM

they're planned at some point. I need to write a utility or custom controller rig with a pico that can step the head on an MFM drive in patterns i can record, then model stepping to cylinder in the hard disk controller.

by GloriousCow

8/23/2026 at 11:22:00 PM

Now that’s attention to detail!

by bananaboy

8/24/2026 at 1:35:22 AM

truly glorious

by JMiao

8/23/2026 at 6:33:23 AM

Almost usable on an iPhone.

by chvid

8/23/2026 at 6:16:49 PM

What would you say is missing or not working well?

by GloriousCow

8/23/2026 at 5:01:57 PM

I used to have a phone like that.

by kuschkufan

8/23/2026 at 8:38:55 AM

What does the "written in Rust" contribute to the title, exactly?

by teiferer

8/23/2026 at 1:18:19 PM

I assume it's called MartyPC because it Marty McFlies?

by benj111

8/23/2026 at 9:37:32 PM

It is indeed a Marty McFly reference. The original demo I was trying to run was called 8088 MPH and is full of Back to the Future references.

I was trying to Run Back To The Future, so I figured I'd call my emulator either Marty or McFly.

Unfortunately I found out about the FM Towns later, so I renamed it from Marty to MartyPC so you could google "MartyPC Emulator" properly.

by GloriousCow

8/24/2026 at 4:40:05 PM

Well you can have the tagline for free.

by benj111

8/23/2026 at 6:31:08 AM

Yet another avenue to play EGATREK in a browser. For that, its work it.

by BobMcBob

8/23/2026 at 6:32:01 AM

What's great about Egatrek?

by unixhero

8/23/2026 at 7:49:03 AM

Oh, holy crap. I haven't thought about EGATREK in at least 30 years. I'm going to go dig it up right now. Thanks for causing me to recall that memory!

by EvanAnderson

8/23/2026 at 10:39:05 AM

nice

by gaoheyang

8/23/2026 at 2:44:50 PM

[dead]

by hncsiocp9x

8/23/2026 at 7:19:05 AM

[flagged]

by azwaterdamagere

8/23/2026 at 5:22:10 AM

Why never seeing a title “written by C” or Java or js

by szundi

8/23/2026 at 12:37:37 PM

I believe a true engineer should love problems not only languages. But it seems like majority of Rust devs only love the language and try to convert all the problems into Rust problems.

If you have problems in C/C++? Write Rust.

If you have problems in Python? Use Rust.

If you have an issue with your product? Rewrite it in Rust.

Is your company in pinch? Launch a new product in Rust.

If you burn your finger while you’re cooking? Write Rust.

If you have a mental problem? Read a Rust book.

You don’t have a girl friend? You have Rust next to you.

If you hate yourself? Writing Rust will solve your life problems.

by fukaiall

8/23/2026 at 7:06:46 PM

Because people love to propagandize

by ChickeNES

8/23/2026 at 5:36:55 AM

The main feature of apps written in Rust is that they are written in Rust.

by tenox7

8/23/2026 at 6:14:15 AM

I flag all these “written in Rust” posts.

by fortran77

8/23/2026 at 7:16:45 AM

its just ppl trying to be different from their boring parents. wish i had enough karma to flag them too but i keep getting downvoted into oblivion for making fun of written in rust posts

by globalnode

8/23/2026 at 9:40:23 PM

I am not the OP of this post, but they're just using my github description. when I first wrote it, Rust was a novel choice for an emulator, and it helped people find examples of emulators written in Rust.

believe it or not I didn't tailor it for the HN meta

by GloriousCow

8/23/2026 at 5:57:17 AM

"It's not a feature, it's a bug"

by dosisking

8/23/2026 at 8:41:31 AM

Because their following is not cult-based.

(To clarify: I like Rust. I use it every day. But this is going too far.)

by teiferer

8/23/2026 at 6:35:17 AM

Because they predate HN, and aren't hip languages any longer.

There was a time for CoffeeScript, PureScript, Elm, Ruby and whatever else you can think of.

Naturally Lisp has to have monthly entries.

/s

by pjmlp

8/23/2026 at 6:02:20 AM

Because nowadays "written in Rust" means "written by AI", as Java or C are not so sexy for LLMs /s

by imhoguy

8/23/2026 at 7:07:48 PM

Not really true, I've had LLMs write hundreds of thousands of lines of C just fine, including stripping out Rust deps out of projects I use. :)

by ChickeNES

8/23/2026 at 8:03:25 AM

[flagged]

by tonyhart7

8/23/2026 at 6:57:40 AM

the other week i wrote a program in python, and ive been thinking of upgrading my cpp knowledge from v11, wish me luck

by globalnode

8/23/2026 at 9:31:57 AM

   Written in Rust™

by rvz

8/23/2026 at 7:33:56 AM

Not specific to this project, but nowadays when I see "written in rust" I hear "written by Claude".

by Kudos

8/23/2026 at 6:07:14 PM

When I started this emulator four years ago, this was the first PC emulator written in Rust so it was novel.

I've heard the comments here loud and clear :) You all don't think Rust is novel anymore and I should lose that bit.

by GloriousCow

8/23/2026 at 8:39:10 AM

"cross-platform" and Rust, as advertised in the current title/link label, is incompatible for sure. Can't get that to run on my older OS X machine nor my Amiga. :)

by binaryturtle

8/23/2026 at 7:09:23 PM

Yup, I have private forks where I've had Claude/Codex rip out Rust for that reason.

by ChickeNES

8/24/2026 at 3:21:11 AM

feel free to fork MartyPC to build it for your Amiga

by GloriousCow

8/23/2026 at 7:11:38 AM

Early PCs weren’t written in Rust.

by hnlmorg

8/23/2026 at 7:15:39 AM

In C neither, despite urban myths.

by pjmlp

8/23/2026 at 8:20:46 AM

Is that something people believe? I can’t say that’s a myth I’ve ever heard.

by hnlmorg

8/23/2026 at 8:53:34 AM

Yep, before UNIX and C there were no systems programming languages, and after getting the clay tablets from UNIX and C, all civilisation was built upon them. /s

At least when you spend long time around some programming circles.

by pjmlp

8/23/2026 at 9:38:21 AM

computer, remove the extraneous slash es from the statement.

by avadodin

8/23/2026 at 9:41:54 AM

"I'm sorry, Dave, I'm afraid I can't do that"

by pjmlp

8/23/2026 at 8:27:40 AM

Early PCs were made of steel which can rust

by queenkjuul

8/23/2026 at 8:30:03 AM

Nicely done!

by hnlmorg