Hacker News new | past | comments | ask | show | jobs | submit login
Advanced Mac Substitute: API-level reimplementation of classic Mac OS (v68k.org)
271 points by fanf2 55 days ago | hide | past | web | favorite | 64 comments



Hi, I'm the author of Advanced Mac Substitute. Proof: <https://github.com/jjuran>, <https://twitter.com/joshuajuran/status/1087557797200433153>

It's nice to see such interest in my humble project. :-)


Aren't you fearing of infringing Apple's IP since you have reimplemented their API, or you haven't reverse engineered their API (incl. private & internal) so it is actually a clean room design?


I would be very afraid if Apple had been acquired by Sun in the 1990s, for what should be obvious reasons.

But Apple has demonstrated zero interest even in going after ROM bootlegging — I don't expect them to build a case against API reimplementation.



Man, that brings back memories, my first Mac was a IIsi running on a b/w monitor. Thanks for your efforts, you are doing really cool projects.


any plans to remove the carbon dependencies?


Short answer: Yes.

Long answer: Advanced Mac Substitute is factored into back end (the emulator itself) and front end (graphics and user input terminal). Writing a new front end from scratch is actually not that much work, and the OS X front end is due for a full rewrite anyway.

This would be an excellent opportunity to contribute that doesn't require any 68K or classic Mac knowledge.


I'd like to, but I'm missing Obj-C/Cocoa knowledge too. ;-)

But I dropped a link with a friend of mine who is super into classic mac, and mac in general.


The secret is to bang the rocks together. ;-)

In the meantime, you could run the Linux framebuffer front end, which, strictly speaking, doesn't have Carbon dependencies. :-D


I dont have a machine that I can run Linux Framebuffer on, I'd be better of building it on my G4, to asking a friend to compile it for me, so I can run it under mojave


In that case, 10.4 and 10.5 are options. There's also a front end that works in classic Mac OS, which a G4 is fast enough to run usably. It's not in the HOWTO yet, but I can add it.


Reminds me of ARDI Executor, which felt incredible in its day.

https://en.m.wikipedia.org/wiki/Executor_(software)


Thank you for the compliment. I wrote the beginning of it (B&W graphics (QuickDraw), filesystem, port to Sun3/60, port to NeXT), although people smarter than I did some of the heavy lifting (port to DOS, port to Windows, color graphics (QuickDraw), synthetic CPU.


What an amazing project! It seems almost like a path to madness, trying to reverse engineer the platform, but there were applications even very early on that were mac only that were desirable on PCs.


I tried to resell it at my PC Shop but could not get any buyers. 68K Macs sold for $100 on eBay like the Mac SE.


I was just going to mention this as well. It seemed like magic back in the day.


Executor was released under an open source license in 2008. I wonder if any of its code was used in Advanced Mac Substitute.


Executor used some fiendishly clever tricks to achieve performance on 1990s hardware at the expense of portability (e.g. the possibility of 64-bit support). Advanced Mac Substitute has different priorities and doesn't use any code from Executor.

However, ROMLib looks like a good source of unofficial system documentation, which I expect I'll be consulting in the future as I work on parts where Apple's docs become less detailed.


It’s so good to see more movement in the realm of classic Mac compatibility! Mac OS emulation/simulation has received astonishingly little attention given the immense body of software that exists for the platform.

That said, while this is a great start, what would really excite me is something along the same lines with PPC support, OS 9.x API simulation, and ideally proper FPU and GPU support. SheepShaver and QEMU are too incomplete and hacky to run the majority of apps that interest me.


Have you tried QEMU in the last 3 months? They've really ironed out a lot of things, and you can now run Mac OS 9.2.2 with sound and networking. I run it to play a few old games and open old ClarisWorks documents.


It seems likely that a WINE-style reimplementation will always be more incomplete and hacky than an emulator.


Thanks! It would be a real shame if the rich culture that sustained the Mac for fifteen years got lost.

My plan for Advanced Mac Substitute is roughly to start at 1984 and move forward, with a focus on getting individual applications running. What you're seeking isn't out of scope in the long run, but it is off the horizon for now.

I have a build of SheepShaver I made years ago that's pretty stable, which I rely on for developing AMS' 68K components.


Emulators are always cool. I've been a Mac guy since Day 1. I had a 128k Mac and a Lisa. The Lisa was required for development, which I did in assembly and Pascal. This is great to see.

Emulators seem usually to have a target app, or a few of them, that are no longer available and are wanted, hence the impetus for the emulator. Game console apps, of course, are motivated by this in spades, as many good games are abandoned, and there's always a nostalgia factor.

I haven't seen such a clear such target app or set of apps mentioned for this project yet. Is this just a nostalgia thing, or is there something this is letting people run that can't be had otherwise? If so, I'm curious what the top contenders are. Are there people dying to actually use Hypercard?


HyperCard


Lovers of the 1-bit "dither-punk" aesthetic must give "Obra Dinn" a play. Lucas Pope's dev diary on TIG forums is an epic, legendary document describing the painstaking process of recreating the mood of classic MacOS gameplay ;)

http://dukope.com/


Not to mention that the game itself is a masterpiece.


That's great! Its use of a 680x0 emulator with a re-implementation of the Mac OS API reminds me a bit of how DOSBox emulates an x86 but provides a host re-implementation of BIOS and DOS APIs.

Is the name a reference to "advanced tea substitute" from the 1984 Hitchhiker's Guide to the Galaxy computer game?


More so the novel, but yes — it's a reference to Hitchhiker's Guide to the Galaxy, and to Douglas Adams' fondness for the Macintosh.


Looks like work on this began at the latest in 2014, with regular work up to the present. I'm not sure how it fits in with the author's other projects but it seems like there's a lot of integration.

https://github.com/jjuran/metamage_1/commits/master/v68k


Initial work on v68k itself began in 2011. Early on I added a limited system call bridge so it could run command-line tools that produced diagnostics on stdout. I reused the same infrastructure that built 68K tools (as code resources) for MacRelix.

I was able to just skip over the trap calls in the Metrowerks runtime code for very the simplest programs, but in 2012 I added a real trap dispatcher and NewPtr/DisposePtr to implement malloc(). Virtual screen hardware and basic rectangle drawing appeared in 2013. But yeah, 2014 is when things started to get interesting.

Virtually all of my major projects are involved somehow: the Mac frontends are MacRelix. Freemount is used to serve files over a socket pair (since emulated code can't access the native file system). And the launch script is V code.


I thought this was a nice idea from the same author:

FORGE: A File-Oriented Reflective Graphical Environment

https://www.fornaxis.org/forge/


That is neat but it's so similar to how Plan 9 did it that I can't understand why he doesn't have an acknowledgment on the page.


He does acknowledge it, but it is in the screencast. The screencast is worth watching. It isn’t too long and is well done.


Maybe he didn't know. Guy is obviously a classic mac groupie, not a bell labs one.


Can you run hypercard? :-)


Yes, but not in Advanced Mac Substitute. :-P


The front end requires 32-bit support and definitely doesn’t build on 10.14.

Well... poop. That's what I get for staying up to date.

I've wanted to run Mac OS 8 on my current Macs for a while now, but the current batch of emulators have been far too complicated for my casual uses. This will hopefully be the key, once it's brought up to 64 bits.


You may wish to try out SheepSaver if you haven't already. There are some tutorials that make the process relatively simple, booting to Finder in a few minutes.


You may wish to try out SheepSaver if you haven't already

I have. I lost half a day trying to make it work and gave up. This was while ago. Maybe it's better now.


There are some really great self contained pre-built SheepShaver OS9 appliances. I don't suggest building your own unless you need to.

Columbia University offers this one: http://www.columbia.edu/~em36/macos9osx.html

Direct download: http://www.columbia.edu/~em36/Mac%20OS%209.zip

You can have an OS9 VM up and running in minutes.

These support networking: https://www.macintoshrepository.org/7751-sheepshaver-ppc-emu... https://www.macintoshrepository.org/15339-sheepshaver-packag...


I'll try the Columbia one. Macintosh Repository doesn't allow those files to be downloaded without signing up for an account, and I'm not all that interested in signing up for yet another account unless I know it's worth it.


You have to upgrade the libraries and recompile it. A friend did it for me for Windows 10. It runs MacOS 8 but the web browser is out of date. I think there is a pay one named iCab that works.


Even better, the latest QEMU can now run Mac OS 9.2.2 with sound, networking, and excellent speed.


On 10.13, tried to build, bit by: 'CarbonSound/CarbonSound.h' file not found

Appears, from a quick Google search, to be a common deprecated-SDK issue.


Can you send me or post the build errors? As a guess, you could try commenting out includes of <Sound.h> and calls to SysBeep().


I'll try again when I get home this evening.


Have you tried qemu? It works great if you're okay with Mac OS 9 instead of 8.


I was able to build it fine on 10.14.2 ‍️


That was unexpected, but great news. Did it run?


The emulation that will impress me is one that supports printing emulation (to PDF, or other printer) as well as disk-file network emulation. Ive got some programs that I'd like to run but without printing support for network connectivity they aren't usable.


File sharing is something that's actually handled fairly well by SheepShaver; it provides a "Unix" "disk" that shows up on your desktop and makes working with files from the host machine pretty easy.

Network connectivity can work (occasionally with some fiddling), but it's not too useful these days. On the web browsing end of things, no one's really made browsers for classic Mac OS in years, and browsers from the classic era (like IE 5 for Mac) aren't modern enough to even connect to many sites, and, when they can connect, aren't standards-compliant enough to render them. And if you're looking to use network services built into applications, most of those were shut down years ago.

(Can't say anything about printing support, though-- never tried that.)


There was a version of Adobe PDFWriter for MacOS 9, you could just install that into the emulated OS.


Why does when I scroll my eye perceives the background pattern as flashing different colors like purple (?)

Is this a perceived effect, or something generated by my monitor framerate/refresh, or intentional?

How is this possible, if/when the pattern is purely grey when standing still/static?


Was wondering the same thing and just used a screen recorder to try and find out. Still can't answer why it happens, but in the recorder, if I flip from one frame to the next, the flash happens and it's impossible to freeze frame "mid-flash."

This means its either an optical illusion or something with the monitor refresh rate. My money is on the monitor.


I think it’s a Moire effect from the patterned background being resized and no longer 1:1 with actual device pixels. Changing zoom level and then scrolling on my iPad changes the appearance of the flashing.


How is this possible, if/when the pattern is purely grey when standing still/static?

I don't know if that's what you're seeing but there is a well-known, poorly-understood effect just like it.

https://en.wikipedia.org/wiki/Benham%27s_top


Perhaps record video (with phone), see what happens in the playback. Or look at the screen pixels with a loupeor magnifying glass. Human visual system is kinda weird so could be either.


Looking at my monitor pixels with a good loupe, the gray is made of red+green pixels in a Bayer pattern. So the scrolling is making a purple effect, probably in our aforementioned weird human visual system.

update: Bayer pattern is wrong term. The MacOS background is a red+green checkerboard. The HN background is a vertical stripe of red+green.


There was an application for the early B&W Macs that used motion to try to create the perception of colour. It didn't really work for me but is probably the same effect.


My guess: scrolling a checkerbox pattern requires turning on and off the rgb components of the pixels at a high speed. The blue components are the slowest so they linger for longer.


The part of an LCD that turns on and off is separate from the layer that imparts color to the subpixels. If the blue subpixels have a slower response time than adjacent subpixels, then there's something quite odd about the display's design.


Nice. It reminds me a bit of GEOS Warp http://www.floodgap.com/retrobits/archive/geoswarp/


Semi-related to this is Darwin/MacOS emulation layer: Darling.

https://github.com/darlinghq/darling


Cool!




Applications are open for YC Summer 2019

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

Search: