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

17 hours ago (martypc.net)

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.

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

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

    • 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."

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

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)

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

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

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

    • 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)

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

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

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?

  • 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.

  • [flagged]

    • 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.

    • 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.

      1 reply →

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

  • 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.

  • Because their following is not cult-based.

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

  • 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

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

    • 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. :)

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

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

  • 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.

  • "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. :)