Previous Thread
Next Thread
Print Thread
Page 2 of 2 1 2
Joined: Mar 2013
Posts: 25
D
Member
Offline
Member
D
Joined: Mar 2013
Posts: 25
Originally Posted by R. Belmont
oss.c is specific to Linux. You can't build it at all on a Mac.

Ok, thank you.

Apologies if this question is stupid... If SDL is used (on a Mac) won't it talk directly to the sound hardware via Core Audio, so the SDL routines on their own should be sufficient? The point I'm trying to make is: can I just take the oss.cpp file and remove most of the code apart from the SDL-specific routines and that should get me fairly close to a working solution?

Joined: Mar 2001
Posts: 17,178
Likes: 211
R
Very Senior Member
Online Content
Very Senior Member
R
Joined: Mar 2001
Posts: 17,178
Likes: 211
In theory, but the SDL routines there almost certainly aren't for SDL 2.x as far as I remember (I'm not sure 2.x *existed* at that time) so they won't build against current SDL 2.30 (or the 3.0 preview).

Basically what I'm saying is that the source drop you found is self-service. That was true in 2010 when I still remembered any of it, but it's way more true 14 years later.

Joined: Mar 2013
Posts: 25
D
Member
Offline
Member
D
Joined: Mar 2013
Posts: 25
Ok, understood and thank you again for your help - I appreciate you are busy with new projects and M1 was a very long time ago. I did think SDL 2 would be too recent, and using SDL 1 probably won't work on the later OSs so I will have to rewrite the SDL routines.

If I make any meaningful progress I will post here again. If any Mac users are interested in working on this please PM me.

Joined: Mar 2013
Posts: 25
D
Member
Offline
Member
D
Joined: Mar 2013
Posts: 25
Update: I've managed to get the command line version built and working, sort of:

[Linked Image from i.imgur.com]

I've tested with Hot Chase, Cyberbots, Aggressors of Dark Kombat and Godzilla (pinball machine) so far and only the first songs as the key commands don't appear to be working, but I definitely hear some sound! I had to comment-out some code in roms.c that was causing an illegal hardware instruction error, and also remove the reference to the lasound library in the make file before it would build. I only have SDL 2 on my machine but this doesn't seem to be an issue. Using pulseaudio didn't work even though I have the library installed, so I'll stick with SDL for the moment.

Batman - Revenge of the Joker (Genesis game) gives me a segmentation fault. The fm2612.c file does not appear to be being included in the build, so I'll ignore these games for the moment as I presume it's related to this file.

Last edited by Dodg; 07/22/24 03:48 PM.
Joined: Mar 2013
Posts: 25
D
Member
Offline
Member
D
Joined: Mar 2013
Posts: 25
I've identified the cause of the segfaulting on the Genesis games, which is due to the YM2151 driver code when run on a 64-bit system (I think). This also affects Atari System 1 boards and various other games. It appears that the key code (KC) channel/register needs to be initialized when the chip is started/reset - I found this out by looking at the MAME 0.100 source code.

In the M1 code, open sound/ym2151.c and find the YM2151ResetChip function, then where you have this line

chip->oper[i].volume = MAX_ATT_INDEX;

immediately after it add

chip->oper[i].kc_i = 768; /* min kc_i value */

Hope that helps someone. I do not claim to understand anything about the YM2151 chip, I just copied-and-pasted the code.

Page 2 of 2 1 2

Moderated by  R. Belmont 

Link Copied to Clipboard
Who's Online Now
3 members (Dorando, AJR, Golden Child), 47 guests, and 3 robots.
Key: Admin, Global Mod, Mod
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Forum Statistics
Forums9
Topics9,305
Posts121,668
Members5,069
Most Online1,283
Dec 21st, 2022
Our Sponsor
These forums are sponsored by Superior Solitaire, an ad-free card game collection for macOS and iOS. Download it today!

Superior Solitaire
Forum hosted by www.retrogamesformac.com