Hi there @csilverman @root42 👋
In brief, the approach is:
1. Load the code and resources from the original module
2. Execute the original 68k module code using https://github.com/kstenerud/Musashi (Thank you kstenerud!)
3. Add handling for unhandled traps to draw to a Metal view, reimplementing the behaviors of QuickDraw one at a time (setting pixels, drawing rects, sprites, etc)
Huge thanks to the M.A.C.E project for demonstrating this approach might be viable.
@halcyon @csilverman @root42 Impressed, grateful, etc!!
The ultimate test case: Star Trek screensavers
@whophd @halcyon @csilverman @root42
I found this in my house last week.
@gparker Some (ok many) of the TNG modules had a whiff of shark-jumping to them, but I'm still proud of working on it. Granted, I wasn't responsible for design, I was responsible for getting the art to fit on (IIRC) two floppies. And writing many of the trivia module's incorrect answers.
@eedly @gparker @jcdvore @halcyon @csilverman @root42 yeah I never got to try the TNG ones, but it was the TOS ones that live in my brain because our high school computing studies teacher had the “Mission Control” one running whenever he spoke long enough to forget to prevent it starting
“Scotty … give me that POWER!”
Its ultimate goal (I felt) was to be a low-CPU simulation of a TV episode generator.
@whophd The coolest part of the TNG screensaver is that it used digital assets from the actual show. Many of the LCARS displays on the show were computer monitors stuck behind smoked glass, running Macromind Director animations. When we did the screen saver, Paramount provided us with a ton of Mike Okuda's Director files, and even a few 3D models. Anything in the screen saver that had LCARS displays in it were processed from those original animations.
@halcyon @root42 That's fascinating. Hadn't occurred to me that you could trace the operation of a classic Mac OS app by watching what illegal instructions it calls, but based on my admittedly slim understanding of how the APIs behind 68K Mac OS worked, it makes a lot of sense. Thank you.
Very much looking forward to seeing this in the world. I've been missing After Dark for nearly 20 years at this point.
@csilverman @halcyon @root42 This was the strategy used to get existing apps to work for the public demos of Copland DR0. Bug fixing the OS one broken API call at a time or having Gestalt lie to the app about what was available. “Edition Manager? What’s that?”
I’ve forgotten the full list of apps I got working, but I remember specifically doing Photoshop and Marathon, the latter resulting in one of the worst KON & BAL’s Puzzle Pages ever published.
@halcyon @csilverman @root42 Nice. I have a similar strategy running as an unpublished side project that I have poked at occasionally for many years. (No Metal, it's OpenGL, that's how old it is!)
Be warned that you'll need increasing amounts of classic Mac OS re-implementation as you add more modules.
You may find the open-sourced code of ARDI Executor useful as a reference for what one reverse-engineer determined that Mac OS did: https://github.com/ctm/executor
@halcyon @csilverman @root42 iirc AD 3.0 also introduced their full-blown custom dynamic shared library linker/loader. I made a little progress deciphering it before giving up and just running the After Dark INIT inside the simulated system. After Dark 2.0 and More After Dark are definitely the sweet spot, more fun and more results for less effort.
Oh hey, here's a screenshot from 2017. I never polished the interface as well as yours…
@gparker @csilverman @root42 Wow, you went down this road long before me! I’m also at the point of trying to decipher the 3.0 library behavior. Not a lot of progress yet. I agree, the 2.0 and MAD modules have had the best effort/reward ratio.
Still, hoping I can somehow get over the 3.0 module blocker. So many great modules would be unlocked.
@gparker @halcyon @root42 you probably already know this, but speaking of source code, System 7.1 leaked a while back: https://github.com/elliotnunn/supermario/tree/9dd3c4bef84df2ea30f5ec2c5e97b043e8267b3f
Might be useful as far as seeing how the underlying Toolbox stuff actually worked. They did a thorough job of commenting it.
@halcyon This is amazing. I'm curious, how hard was it to reverse-engineer these? I dimly remember that the After Dark manual included technical docs on writing screensavers—an unusually thorough inclusion that I didn't appreciate until years later—but generally, nuts-and-bolts info about the internals of After Dark seems pretty hard to find these days.
Any plans to release it at some point?
Oh my. Does it have an embedded M68k emulator or did After Dark have some sort of VM (there was a Windows screensaver package that ran screensavers on SCI, Sierra’s adventure game VM).
Oh, wow. I'm pretty sure I still have the After Dark CD, and the second After Dark CD, from all those decades ago.
I could have flying toasters again...