|
ForumsSega Master System / Mark III / Game GearSG-1000 / SC-3000 / SF-7000 / OMV |
Home - Forums - Games - Scans - Maps - Cheats - Credits Music - Videos - Development - Hacks - Translations - Homebrew |
Author | Message |
---|---|
|
Disable SMS FM sound
Posted: Wed Sep 27, 2017 3:18 pm
|
2 questions about the Sega Master System FM sound.
1 - I have the Japanese Master System (with the FM unit built-in to the console), and I would like to know if its possible to disable the FM. I mean something simple, like turn on the console with 1+2+up or something like that. I like the FM sound, but some games I prefer the PSG sound. 2 - I will get a Master Everdrive, (I have a adapter to play sms games). So is it possible to patch roms to disable the FM sound? I know that there is something like a flag in the header of each game that will check if the system have the FM unit. So I was thinking to edit this flag to always says that there is no support.... so, I could copy 2 folders in the SD card.. one with FM, other without FM sound. I tried to contact ValleyBell to ask him, but without success. |
|
|
Posted: Wed Sep 27, 2017 3:21 pm Last edited by Maxim on Wed Sep 27, 2017 4:53 pm; edited 1 time in total |
1. No
2. Yes, but I think there isn't a handy set of patches for you to use. Maybe we can build them in this thread. The method is to find the FM detection code and force it to say no. |
|
|
Posted: Wed Sep 27, 2017 4:45 pm |
Thanks for the information. Do you know if the FM detection code is different in each game? If the answer is no, we can create a universal patcher. Thats why I tried to contact ValleyBell.. at least in his sonic hack, he could find this code and put "yes". |
|
|
Posted: Wed Sep 27, 2017 4:55 pm |
No, but there will be common patterns, so it will not take long for an experienced person to do for each game. I believe there are a bunch of patches on the Everdrive forums to force FM mode on modded export systems; this is similar. | |
|
Posted: Fri Sep 29, 2017 9:24 am |
I took the FM detection code from Phantasy Star, which is on the wiki and modified it slightly for Sonic 1 FM.
You can probably detect the code safely if you search for the bytes that are generated from the ASM code of the first loop. -: ld a,b
[...] +: djnz - The code that follows handles the result of the test: ld a,c
cp 7 ; Check test was passed 7 times out of 7 jr z,+ ; <-- jumps of test is successfull xor a ; If not, result is 0 <-- test fail, disable FM +: and 1 ; If so, result is 1 You can disable FM by replacing the jump instruction ("jr", bytes $18 xx) with two NOPs ($00 $00). It should be fairly easy to write a small tool that searches for the byte patterns and replaces the one instruction. Figuring out the byte patterns themselves should be easy if you throw the FM detection routine into a Z80 assembler and print a listing file that lists instructions + the resulting byte codes. And it probably works for all games that use the SMPS sound driver. Well, I don't visit SMSPower often enough to reply within 12 hours. |
|
|
Posted: Fri Sep 29, 2017 2:31 pm |
Thanks alot Maxim and ValleyBell for all information.
I will try this weekend. I had basic ASM at college, but it isn't a language that I normally use. I did some test using the tutorial here for SMS roms and looks like isn't that hard. Is SMS Examine the best dissembler?
I did not say it as a complain. SMSPower was the only place that I could find a way to contact you, once Sonic Retro never validated my account. You don't have any obligation to answer me. Thanks again =) |
|
|
Posted: Fri Sep 29, 2017 3:52 pm |
I'd debug in Meka, with an IO port breakpoint, then hot patch to test. You can probably do the same in Emulicious, which can also emit a disassembly like SMS Examine but better.
It'd always better to ask this kind of question in public anyway, you get more answerers, less pressure on the individual and it remains for others to find in the future. |
|
|
Posted: Tue Oct 03, 2017 11:22 am |
Hello again
So far, I could: 1- Debug the code and find where and what should I change. Just changed a value to 0 at it worked on Meka. 2 - Disassembler the rom (using SMS Examine and/or Emulicious). 3 - I know where and how to change the code. BUT, I am having problems to compile the code. I can't even compile the code unchanged from SMS Examine and/or Emulicious. For example, I am using Kenseiden, and I got these erros: Just for test, I changed some values to skip these errors, and I could compile a "working" sms file. Working means: The game could be load, but bugged. Did I miss something? Should I be able to compile a unchanged code? |
|
|
Posted: Tue Oct 03, 2017 11:48 am |
Better to avoid recompiling and instead binary patch. Overwrite the start of the detection function with the "return no" code, it will avoid affecting the rest of the ROM. Recompiling with modified code is actually incredibly hard. | |
|
Posted: Tue Oct 03, 2017 12:36 pm |
Yes but there was a bug in Emulicious about naming the binaries. An update fixing this issue has just been launched.
In Emulicious, you can save the changes you've made in the Memory Editor directly either as a patched ROM or an IPS patch. |
|
|
Posted: Tue Oct 03, 2017 4:26 pm |
Success!
I could create a IPS using Emulicious and it worket! Now I can create a noFM romset to put in my Everdrive. Thanks again for all information! |
|
|
Posted: Sun Sep 20, 2020 3:00 am |
I've found another way which basically involves disabling the writes to port $f2. If we search for the byte pattern "D3 F2", which is [out ($f2),a] and replace it with NOPs we also get the same result. There are usually 2 write operations to this port on each game that i've checked and they are close by in the ROM. |
|
|
Posted: Sun Jan 28, 2024 3:21 am |
Over three years later and this is exactly the information I needed in order to create a "No FM" romset that would launch on a Japanese SMS without the FM, and to fix Walter Payton (and American Football) as well as Wanted so that they would function on the machine. Much appreciated! |
|
|
Posted: Thu Apr 25, 2024 8:58 am |
I would be very interested in that set.
Would be great to get the non working games to work on my Japanese SMS |
|
|
Posted: Wed May 29, 2024 2:58 am |
Wanted to bump this again as I was experimenting with disabling the FM audio on my Japanese SMS on the hardware level. So far I haven't found anything that worked. I tried either disconnecting and/or grounding the YM2413 CS (chip select) and FM enable lines on the I/O chip, and while this did indeed disable the YM2413, it didn't enable PSG audio on FM-compatible games so they were silent.
I think the easiest fix would be to do as Rene suggested, as I don't believe there's an easy way to properly disable FM without doing some significant surgery on the console. |
|
|
Posted: Wed May 29, 2024 8:08 pm |
Games that use FM detect it by checking if there's a bit of state at I/O port $F2; you should be able to disable whatever three-state-able latch it's using to drive the latched state.
In the FM Sound Unit, the latches (both halves of a 74'74) can be read back using the 4066. I haven't found a schematic of the Japanese SMS to be able to advise what to do there instead. |
|
|
Posted: Wed May 29, 2024 9:57 pm |
Esrael created a reverse-engineered schematic, it seems to be fairly accurate from what I've seen. The logic chips from the FM Sound Unit seem to be integrated into the I/O chip, and then the control signals go off to the 4066. |
|