MACE: an New Classic Mac emulator project

About Mini vMac and all other 68k emulators, including SoftMac, Executor, and MESS.

Moderators: Cat_7, Ronald P. Regensburg

krum110487
Space Cadet
Posts: 7
Joined: Fri Jan 28, 2011 4:31 am
Location: United States

Re: MACE: an New Classic Mac emulator project

Post by krum110487 »

Love this project, I might bring 90% of your traffic, because I check the blog multiple times daily, I can't help it...)

Do you think this project would ever dip it's toe into the Mac Classic Power PC emulation? Not that I want to rush you or anything, I am just curious about how much effort do you think plugging that into your code would be. Obviously writing the emulation of the PowerPC processor is a ton of work... but I am not even aware if that is possible or if it is a complete re-write of the project, it would be great to eventually have something like this for PPC as well!

Thanks for the hard work!
User avatar
Pukka
Student Driver
Posts: 22
Joined: Mon Feb 25, 2019 9:15 pm
Location: Helsinki / Finland

Re: MACE: an New Classic Mac emulator project

Post by Pukka »

PowerPC support, yes it has been planned randomly and I guess I'll be looking at it more seriously after finishing the remaining 68k features (trace support and some trap instruction related details) and static disassembler.
Based on the performance results with directly interpreted 68k instructions, we probably would design the PowerPC emulation to support JIT already in the beginning.
The system emulation side should be quite directly compatible with PowerPC as is so wouldn't be rewrite but there are sure more software features to be supported by more advanced programs.

Sorry to not able to provide updates multiple times / day, but thanks for your input! :)
User avatar
gingerbeardman
Tinkerer
Posts: 88
Joined: Mon Aug 06, 2018 2:58 pm
Location: UK
Contact:

Re: MACE: an New Classic Mac emulator project

Post by gingerbeardman »

I don't know if you've solved it by now, but the solution to Universal builds on M1 is here: https://developer.apple.com/forums/thread/673323

Super interesting project! I need to catch up on the dev blog. Keep up the good work!
• BasiliskII on iPad Pro 12.9": Macintosh IIci 32MB + System 7.5.5 + Deneba artWORKS & UltraPaint
User avatar
adespoton
Forum All-Star
Posts: 4208
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: MACE: an New Classic Mac emulator project

Post by adespoton »

I have to admit, my holy grail here is to eventually have a system where there's a file handler registered with macOS that 1: identifies the type of classic app (24-bit or 32-bit 68k, FAT, PPC), and then based on what it finds, instead of saying it can't run on this Mac, launches it inside a helper container, MACE style. It would probably also need a lookup table, to map all the known variations that require specific settings / MACE wrappers currently.

If this could be done in an "open spec" kind of way, people could write their own plug-ins for various hardware specs (eventually dropping in a handler for a PPC750 Mac with an ATi Rage GPU, for example, way down the road).

The end result would be something where anyone could add their own architecture, and macOS would then just be able to "run" most apps "seamlessly". If combined with containerization, you could even have the OS prompt for which existing configuration you want to run the application with on double-click.

Of course, one impediment to this is that MACE currently runs Apple Double files instead of named fork files, but that's a pretty small impediment, as you can easily present named forks as AD files with a bit of scripting.

Anyway, just one of my long-range dreams... using the macOS Frameworks system the way it was designed to be used, but rarely used outside of Apple.
DracheMitch
Space Cadet
Posts: 1
Joined: Wed Apr 07, 2021 2:55 pm

Re: MACE: an New Classic Mac emulator project

Post by DracheMitch »

adespoton wrote: Mon Feb 22, 2021 7:44 pm The end result would be something where anyone could add their own architecture, and macOS would then just be able to "run" most apps "seamlessly". If combined with containerization, you could even have the OS prompt for which existing configuration you want to run the application with on double-click.
The issue is resources. Running an application for an operating system typically means loading a huge chunk of the OS. Witness Classic Environment on early OS X (or Java for that matter). Even though Apple created shims for networking and device management, along with a lot of hardware abstraction, it still used a lot of RAM and CPU. That’s the reason IBM agave up on their, basically, hypervisor OS that was Taligent, and cross-platform environments like OpenDoc.

Furthermore, developers are barely interested in cross-platform development (ask Windows Phone users). It takes too many man-hours for testing and support, which is why many developers will open the source for someone else to support other platforms.

For emulation concerns, you would need someone to design an operating system (or Linux distro) specifically for running older software to meet the needs for running 68k Amiga, Atari, Mac, Sparc, etc. software, and most developers would rather do things for larger platforms like DOS x86 or cloning hardware like Vampire and Bolle’s SE/30 clone.
WizKid
Tinkerer
Posts: 72
Joined: Sun Jul 31, 2016 11:58 pm

Re: MACE: an New Classic Mac emulator project

Post by WizKid »

Any update?
User avatar
Pukka
Student Driver
Posts: 22
Joined: Mon Feb 25, 2019 9:15 pm
Location: Helsinki / Finland

Re: MACE: an New Classic Mac emulator project

Post by Pukka »

Sorry, it has been long break with updates. I was working randomly on the processor related tweaks/fixes/optimizations earlier this year, but got a bit lost on that.
The System team (Toni) has been focusing on the Sound Manager as it is the missing half of the proper experience of the higher end games.
Additionally some specific tweaks to make early Sierra games work as they should. You can read about the details in here
https://mace.software/2021/06/30/first- ... e-of-2021/
User avatar
adespoton
Forum All-Star
Posts: 4208
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: MACE: an New Classic Mac emulator project

Post by adespoton »

Thanks for providing this bit:
Originally the audio buffer with 22255 Hz sample rate was passed directly to SDL2, which caused some problems as some systems were not able to handle that format very well. Even though it worked on Mac Pro, for example on M1 Macs it caused the audio in other applications to start cracking and breaking up.
This appears to be the exact issue that other emulators are encountering -- M1 + SDL2 = audio cracking.

So for anyone fighting sound support on MVM/BII/SS/QEMU not reading your blog but reading here:
By allocating the SDL2 audio buffer in default native format (usually 44100hz), and upsampling the audio data in emulator, most of this problem was eliminated. However, in some cases, clicks are still present in the audio, mostly due to the way how original hardware handles square-wave and sampled sound as a mix of both unsigned and signed 8-bit samples (that is, square wave sound amplitude ranges from 0 to 255, while in same buffer, sampled sounds are in range -128 to 127, with different “silent” baseline level.
And for anyone working on 68k emulation, the entire blog entry is definitely worthwhile reading -- there are fixes in there for issues known to be present in Basilisk II, for example.

[edit] Pukka, I forgot: do you guys have reference binaries available for any of the recent updates? The last one I see on the website is the December 2020 build.
User avatar
Pukka
Student Driver
Posts: 22
Joined: Mon Feb 25, 2019 9:15 pm
Location: Helsinki / Finland

Re: MACE: an New Classic Mac emulator project

Post by Pukka »

adespoton wrote: Mon Jul 05, 2021 5:27 pm [edit] Pukka, I forgot: do you guys have reference binaries available for any of the recent updates? The last one I see on the website is the December 2020 build.
I'll ping Toni to rebuild something with the latest code if the things are stable enough. Will notify when that is available.
User avatar
Pukka
Student Driver
Posts: 22
Joined: Mon Feb 25, 2019 9:15 pm
Location: Helsinki / Finland

Re: MACE: an New Classic Mac emulator project

Post by Pukka »

The Mac binaries were updated now, I hope that works for you.
Let me know if you need something specific and we'll try to arrange it.
krum110487
Space Cadet
Posts: 7
Joined: Fri Jan 28, 2011 4:31 am
Location: United States

Re: MACE: an New Classic Mac emulator project

Post by krum110487 »

Hello, it's been a bit since I've seen an update, any chance this has a lot of changes in the pipeline?

Thanks for all the amazing work on this!!
User avatar
Pukka
Student Driver
Posts: 22
Joined: Mon Feb 25, 2019 9:15 pm
Location: Helsinki / Finland

Re: MACE: an New Classic Mac emulator project

Post by Pukka »

Hey, thanks for your message! During the autumn the progress has been a bit slow, but moving forward. Most of the recent changes have been figuring out bugs and fixing them both in the software emulation and the processor emulation.
During the recent month I have been getting familiar with the 68881 FPU emulation mostly out of curiosity, even if there are many more urgent things.
In my understanding in the software emulation side the next thing is to continue with the Sound Manager emulation and 32 bit memory addressing mode.
Additionally we have started planning forward development of the debugger and disassembler tools to be more useful.
krum110487
Space Cadet
Posts: 7
Joined: Fri Jan 28, 2011 4:31 am
Location: United States

Re: MACE: an New Classic Mac emulator project

Post by krum110487 »

Fantastic! Thank you for updating me. Keep up the amazing work!
Gannet
Student Driver
Posts: 11
Joined: Sun Jan 24, 2010 2:00 am

Re: MACE: an New Classic Mac emulator project

Post by Gannet »

Hi, just wanted to say thanks heaps for your work on this. I saw your latest blog about Sound Manager - looking forward to when sound is working in Escape Velocity :)
EV is a bit of a passion of mine. I've been working on a modern resource editor, ResForge, which includes some dedicated EV tools. PICT support is provided by the Graphite library, which I'm not the author of but have contributed extensively to. Would be interesting to compare notes on parsing.

Couple of questions:
1. Does MACE support Apple Silicon?
2. The Apple Double setup seems a little strange/tricky-to-setup to me. What made you go this route? As opposed to, e.g.
  • Native resource fork/finder info on Mac, with fallback to the standard Apple Double naming scheme (._) on other platforms, so it can work as-is with Mac created archives.
  • MacBinary.
User avatar
Toni_
Space Cadet
Posts: 3
Joined: Fri Sep 06, 2019 7:36 pm

Re: MACE: an New Classic Mac emulator project

Post by Toni_ »

Hi, thanks for your questions (replying on Pukka's behalf as he's busy at moment):

1. Yes, the emulator compiles to universal binary (the downloads should be already universal, but I can't remember if they already contain fix for the flag, which forced x86 mode on M1/M2 macs. If not, the next builds will contain fix for that). Thanks to Pukka's work on raspberry pi port a couple years ago, we had pretty good foundation for ARM compatibility, so enabling it required basically just some tweaking of build system settings

2. This question was asked a couple times before, and there is actually a blog post briefly summarizing the logic: https://mace.software/2018/11/11/first- ... e-manager/
Basically, the file system abstraction will allow us to support in future also native resources, but because of limited time we have used for now common approach that works across all systems from single codebase and archive format (even on OS X this is good idea, as .app bundles are not guaranteed to save native HFS resources when compressed/decompressed with different third-party tools - even app bundles in early OSX days would resources in data fork a .rsrc file). The AppleDouble format used follows the Apple's spec for AppleDouble from 1990 (archived at https://web.archive.org/web/20180311140 ... Double.pdf ) - the dot-underscore format used by later OSX versions is actually less preferable compared to the earlier 1990 spec, because many operating systems hide dot-files by default, so manually copying such files would have high risk of ADF header w/metadata & resource fork getting lost if omitting accidentally those hidden files. As for MacBinary, there were two issues with that format - first, as both forks are stored in single file, modifying data fork length would actually add need to move resource fork (appended after it in the file) back and forth, adding extra write operations with both extra wear on drive, and also adding extra risk for data corruption on a possibly interrupted write operation - but secondly, and more importantly, MacBinary only supports files, not directories, so storing directory metadata would be impossible. (Btw, we do have plans for making tools for easy conversion between native and container format, but that's still under development).

Your ResForge project sounds interesting! We have actually been using for a lot of manual work Rezilla on OSX, but sadly seems updates for that app have stopped, so we actually have to use old OSX version for the cases where we need to modify resources locally. So hearing somebody is working on modern resource editor is interesting! (luckily for our special use cases, we will be able to phase out partially dependency manual GUI tool near future, as soon as we get resource compiler as part of the build toolchain for building the System file).

Also great to hear you like Escape Velocity - also one of our favorite games :) Shame that Ambrosia software has gone down, so we can't anymore register their awesome games

Thanks,
-Toni
Gannet wrote: Sun Jun 19, 2022 6:33 am Hi, just wanted to say thanks heaps for your work on this. I saw your latest blog about Sound Manager - looking forward to when sound is working in Escape Velocity :)
EV is a bit of a passion of mine. I've been working on a modern resource editor, ResForge, which includes some dedicated EV tools. PICT support is provided by the Graphite library, which I'm not the author of but have contributed extensively to. Would be interesting to compare notes on parsing.

Couple of questions:
1. Does MACE support Apple Silicon?
2. The Apple Double setup seems a little strange/tricky-to-setup to me. What made you go this route? As opposed to, e.g.
  • Native resource fork/finder info on Mac, with fallback to the standard Apple Double naming scheme (._) on other platforms, so it can work as-is with Mac created archives.
  • MacBinary.
Machines: Plus,II,LCII,C650,PM6100,PowerCenterPro210,iMacG3,G4Cube,iMacC2D 17",MacMiniC2D,PB280c,PBG3,MBP15"/2009,MBP13"/2015,MacPro/2010
M.A.C.E. project (new "Classic"): https://mace.software
Gannet
Student Driver
Posts: 11
Joined: Sun Jan 24, 2010 2:00 am

Re: MACE: an New Classic Mac emulator project

Post by Gannet »

Thanks for the detailed reply! Good points about the file structure, I guess I didn't consider that the emulator also needs to write files, not just read them.
One of the key benefits for native resources would be the ability to edit the resource forks (via ResForge/Rezilla) without having to wrangle the formats back and forth.

Hope ResForge can be useful for you! Feel free to post issues/questions/feature requests on the GitHub project :smile:
User avatar
adespoton
Forum All-Star
Posts: 4208
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: MACE: an New Classic Mac emulator project

Post by adespoton »

I've got a feature request: support for the MACE-style Apple Double file format (for import and export) :)
Gannet
Student Driver
Posts: 11
Joined: Sun Jan 24, 2010 2:00 am

Re: MACE: an New Classic Mac emulator project

Post by Gannet »

Ha! Hypothetically, if ResForge were to support that format it would need to be added to the Graphite framework rather than ResForge itself.
User avatar
adespoton
Forum All-Star
Posts: 4208
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: MACE: an New Classic Mac emulator project

Post by adespoton »

Hey Toni and Pukka!
Toni_ wrote: Tue Jun 28, 2022 8:44 pmThe AppleDoubler tool will be available as soon as we sort out our binary distributions to work a bit better (until now, files have been hosted here on the WP blog, but due to a bunch of issues with executables, and the time-consuming progress of updating downloads page, we will look into more automated alternate solutions, to allow more frequent updates, and also more downloads to be available.)
Have you guys had a chance to sort this out? Possibly standing up a GitHub account where you can put your public stuff?
User avatar
Becatto
Inquisitive Elf
Posts: 25
Joined: Tue Oct 11, 2022 7:48 am

Re: MACE: an New Classic Mac emulator project

Post by Becatto »

how did you learn what part of the emulator should be coded first?
-------------------------------------------------------------------------------------------------------------------------
Is it just me or every time I comment on a post, it dies :???:
Tornevas
Inquisitive Elf
Posts: 34
Joined: Sat Aug 29, 2020 8:25 am

Re: MACE: an New Classic Mac emulator project

Post by Tornevas »

Are there plans to move onto color games with MACE?
bribri
Student Driver
Posts: 16
Joined: Tue Apr 04, 2023 4:20 am

Re: MACE: an New Classic Mac emulator project

Post by bribri »

Hello Pukka and Toni! Let me start by saying I think this is a really cool project. I first started out with macs when I was a young playing many of the classic games you have packaged with MACE, and it's great to see them so easily playable on a modern system.

I was wondering if you might be willing to consider a request of mine:

When I was a child, I taught myself programming by making little games in HyperCard, first on my family's Macintosh SE, and then later a Macintosh SE/30. As a way of trying to get back to my roots and reconnect with what made programming and game design so much fun for me, I've been making a new HyperCard game. It's a total anachronism since not only is it a monochrome classic mac game made in 2023, but it won't play at any reasonable speed on an actual monochrome classic mac (though it may work on a PowerMac G4 or G5! :razz:). Nonetheless it plays great in Mini vMac with the speed turned up to max. It's getting close to being finished, and I've been thinking about ways I could distribute it so that others can enjoy it. In researching ways of doing that, I found -- to my delight! -- your MACE project.

Here's a little preview movie of the game still in development: http://briankendall.net/level3.mp4

I know it's still in development and you haven't released the source code or methods for people to package up their own classic Map apps yet. But I was wondering if I might be able to use it to distribute (modern) macOS and Windows copies of this little game of mine when it's done? I intend to release it for free, and technically as open source since I'll also distribute the HyperCard stack itself. But since MACE requires no ROM file it would allow someone to just run the game immediately with no further setup.

If that's not something you're willing to do, that's fine and perfectly understandable, and not really a hindrance to releasing my game, since it runs well in Mini vMac, and I believe I can make my own wrapper for it using that, though it would (irritatingly) require the user to obtain their own Macintosh ROM file.

Thanks for your consideration. And I wish you the best with your endeavors developing MACE!
User avatar
adespoton
Forum All-Star
Posts: 4208
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: MACE: an New Classic Mac emulator project

Post by adespoton »

bribri wrote: Tue Apr 04, 2023 4:58 am Hello Pukka and Toni! Let me start by saying I think this is a really cool project. I first started out with macs when I was a young playing many of the classic games you have packaged with MACE, and it's great to see them so easily playable on a modern system.

I was wondering if you might be willing to consider a request of mine:

When I was a child, I taught myself programming by making little games in HyperCard, first on my family's Macintosh SE, and then later a Macintosh SE/30. As a way of trying to get back to my roots and reconnect with what made programming and game design so much fun for me, I've been making a new HyperCard game. It's a total anachronism since not only is it a monochrome classic mac game made in 2023, but it won't play at any reasonable speed on an actual monochrome classic mac (though it may work on a PowerMac G4 or G5! :razz:). Nonetheless it plays great in Mini vMac with the speed turned up to max. It's getting close to being finished, and I've been thinking about ways I could distribute it so that others can enjoy it. In researching ways of doing that, I found -- to my delight! -- your MACE project.

Here's a little preview movie of the game still in development: http://briankendall.net/level3.mp4

I know it's still in development and you haven't released the source code or methods for people to package up their own classic Map apps yet. But I was wondering if I might be able to use it to distribute (modern) macOS and Windows copies of this little game of mine when it's done? I intend to release it for free, and technically as open source since I'll also distribute the HyperCard stack itself. But since MACE requires no ROM file it would allow someone to just run the game immediately with no further setup.

If that's not something you're willing to do, that's fine and perfectly understandable, and not really a hindrance to releasing my game, since it runs well in Mini vMac, and I believe I can make my own wrapper for it using that, though it would (irritatingly) require the user to obtain their own Macintosh ROM file.

Thanks for your consideration. And I wish you the best with your endeavors developing MACE!
I won't speak for Pukka and Toni, but you've got one slight complication here: while using MACE means you don't need a ROM, you still need the Hypercard player application, which belongs to Apple. That said, they seemed to allow distribution of the player back in the day (I can't find the link to the license). And archive.org has an environment set up that will run stacks in a browser: https://archive.org/details/HyperCardBootSystem7 -- via System 7 with Hypercard installed, running in PCE/Macplus.

So technically, it should be possible to run a Hypercard stack in MACE, and I'd love to see the guys test Hypercard in this environment to see if there are any extra toolbox calls that need implementation :) The tricky bit then would be setting up the custom build of MACE to automatically open the Hypercard Player app in kiosk mode with your stack being the default file. That would be a bit different than what they've done so far, but definitely worthwhile IMO :)
bribri
Student Driver
Posts: 16
Joined: Tue Apr 04, 2023 4:20 am

Re: MACE: an New Classic Mac emulator project

Post by bribri »

adespoton wrote: Tue Apr 04, 2023 7:31 pm I won't speak for Pukka and Toni, but you've got one slight complication here: while using MACE means you don't need a ROM, you still need the Hypercard player application, which belongs to Apple. That said, they seemed to allow distribution of the player back in the day (I can't find the link to the license). And archive.org has an environment set up that will run stacks in a browser: https://archive.org/details/HyperCardBootSystem7 -- via System 7 with Hypercard installed, running in PCE/Macplus.

So technically, it should be possible to run a Hypercard stack in MACE, and I'd love to see the guys test Hypercard in this environment to see if there are any extra toolbox calls that need implementation :) The tricky bit then would be setting up the custom build of MACE to automatically open the Hypercard Player app in kiosk mode with your stack being the default file. That would be a bit different than what they've done so far, but definitely worthwhile IMO :)
Actually HyperCard has a feature where you can take a stack and combine it with the player, essentially making the stack into a standalone application. I'm pretty certain that these are allowed to be distributed, as it was the expected way to distribute standalone HyperCard stacks back in the 90s.

I figure that there may be some toolbox calls used by HyperCard that are not yet reimplemented in MACE. But maybe if I'm lucky it could work with a minimum of tinkering.
Gannet
Student Driver
Posts: 11
Joined: Sun Jan 24, 2010 2:00 am

Re: MACE: an New Classic Mac emulator project

Post by Gannet »

adespoton wrote: Wed Jun 29, 2022 9:05 pm I've got a feature request: support for the MACE-style Apple Double file format (for import and export) :)
ResForge v1.4 can now open and save AppleDouble files :)
https://github.com/andrews05/ResForge/releases
Post Reply