Problem getting Marathon working on MAME

Gothikon

Member
Thought i'd start a new thread rather than pollute the other one, if there's a better place let me know.

MAME is quickly becoming my preferred way of emulating classic Mac OS and thanks to @adespoton I now have file sharing working using ScuzEMU (although for bigger transfers I'd still recommend using another emulator like Basilisk II to open up and modify the disk image).

My current challenge is getting Marathon running (or Marathon 2 for that matter). Most other games and applications seem fine.

I'm using a drive image with OS 8 originally cloned from my Quadra 840AV which works fine in Basilisk II. I'm also using Ample as a front end.

When I try to launch Marathon version 1.2 the screen goes black then it quits with an "error of type 16" In my other thread @adespoton suggested this was to do with the FPU. However I was mostly using the Q800 as my default system, I've also tried switching between a Quadra 650 and a Centris 650 (I believe these are more or less the same machines with and without an FPU). All of them have the same error and Marathon doesn't require an FPU, I'm not sure it even uses one if you have one...

FWIW ChatGPT says

On Classic Mac OS (like System 7, Mac OS 8, and 9), an “Error of type 16” (also known as Error -16) corresponds to:

dsMemFullErr = -16: “Not enough room in heap zone.”

What it means:

This error indicates that the application or the system has run out of available memory—specifically in the heap, which is the part of memory used for dynamically allocated data."



Not sure how much value to place in this and the systems have all been configured with 32 or 64MB of RAM so available RAM shouldn't be the issue.

Anyone got any tips?

I'm going to try a fresh install of 7.5.x but I think I've tried that before and had the same issue...
 

cheesestraws

Well-known member
ChatGPT is literally just making stuff up here. dsMemFullErr is 25. You really can't trust it for stuff like this.

16 is something wrong with the emulated FPU.
 

Gothikon

Member
yeah, i wasn't convinced, but also couldn't find anything about error 16 anywhere else...

So the question now is, if it's a problem with the FPU emulation, why is a problem trying to emulate machines with and without FPUs in MAME?
 

Gothikon

Member
I just tried using System 7.5.5, in Quadra 650 and a Performa 575. Instead of an error type 16 the machine just locks up completely when launching Marathon 1.2

Here's the MAME config I'm using:

mame64 maclc575 -skip_gameinfo -mouse -nosamples -window -nomax -video bgfx -bgfx_backend opengl -ramsize 32M -scsi:0 harddisk -hard1 '/Applications/Emulators/Mac HD images/mac_classic_software.hda' -hard2 '/Applications/Emulators/Mac HD images/mac_boot_OS755_500MB.hda' -share_directory '/Applications/Emulators/Mac Shared'

The only things I'm really changing between runs are the image with the OS on it and the machine ID.
 

treellama

Well-known member
The only time Marathon 2 uses floating point arithmetic is at startup: it builds a set of trig lookup tables. But it will need a real or soft FPU (SANE? I’d have to look up what the original code does) just long enough to build them.
 

adespoton

Well-known member
You could probably use the SoftFPU system extension to work around the problem, or just use a different set of hardware in MAME (a Quadra 800 should be able to handle this, as should any configuration that explicitly has an FPU).

One thing to note: error codes can be either positive or negative, and they aren't the same thing. So Error 16 (FPU error) is not the same as Error -16 (I don't know what this error would be?)
 

Gothikon

Member
I’m not at home just now however:
I was using the Q800 as my default MAME setup for a while and I’m pretty sure it had exactly the same issue – I’ve never got Marathon 1 or 2 to run in MAME with any setup I’ve tried.
the error is type 16, not -16
I’ll get a screenshot when I’m back tomorrow, double check the Q800 setup and give SoftFPU a shot.
 

Arbee

Well-known member
MAME 68040 machines currently all have a "full" '040 because disabling the FPU gives me a sad Mac. I solved that relatively recently for '030 machines (most of those now have a configuration option for FPU or not) but how Apple detects an LC040 vs. a full one has eluded me. If anyone has any ideas about that I'm all ears, otherwise I'll keep digging.

Also, it's worth noting that the 68040 cycle times in MAME are basically the same as an '030 right now, so a 33 MHz '030 (e.g. LC III+) will give the same performance as an '040 if Marathon isn't processor ID locked. (Or if you run MAME with -cheat it'll enable being able to overclock the emulated CPU).
 

Gothikon

Member
I just tried Software FPU and unsurprisingly based on @Arbee 's comments I wasn't able to activate it on a a Centris 650.

I also tried a IIvx with System 7.5.5. When I launch marathon I get an error dialog with a bomb icon but no text that's, the dialog is flickering. My guess is the error dialog is being triggered repeatedly. I can click the button and it I think the topmost error dialog goes away but there's a stack of 100s sitting behind it. I clicked the button about 50 times before I gave up so whatever the error is it's not locking up the machine completely, but it effectively makes it unusable.

@Arbee where's the best place to report issues with MAME? EDIT: Nevermind, it looks like, thankfully, the GitHub issue tracker is being used.

EDIT: All of this was with Ample / MAME 0.275 i've just noticed there's an update to 0.276 so I'll repeat some of the tests. Very little in the way of Apple related change (https://www.mamedev.org/releases/whatsnew_0276.txt). No change.
 
Last edited:

Arbee

Well-known member
Yeah, 0.276 has no Mac related changes. 0.277 will fix the built-in SONIC Ethernet on the Quadras (the chip's manual kind of glides over some details that both Mac OS and the Sony NeWS workstations that run in MAME were having problems with) and there may be some other fixes, we'll see what shakes out.
 
Top