Forums

Sega Master System / Mark III / Game Gear
SG-1000 / SC-3000 / SF-7000 / OMV
Home - Forums - Games - Scans - Maps - Cheats - Credits
Music - Videos - Development - Hacks - Translations - Homebrew

View topic - M404 patched bios

Reply to topic
Author Message
  • Joined: 11 Jul 2009
  • Posts: 12
Reply with quote
M404 patched bios
Post Posted: Fri Aug 28, 2020 10:17 am
Last edited by scrappysphinx on Fri Aug 28, 2020 11:24 am; edited 1 time in total
Hi all, not sure if this is already out there but thought i'd share it.

Basically i liked the startup of the M404 bios and knew that if i added the copyright sega string at the correct offset using a hex editor it would boot game roms but of course this couldn't be used on real hardware as we can't edit retail carts.

I have zero knowledge on assembly (or any other language really) so I got my friend Andy to take a look at the bios and see if he could get it booting all games.

After a couple of hours he sent me this patched version. I have tested it with an emulator and it seems to work great. i have then burnt it to a 27c512 and used it in a pal master system 2 console and it boots every game i've thrown at it.

With his permission we thought we'd share it in case anyone else wants to give it a try.

There are 2 roms i haven't got it to boot but both of these have had ips patches applied.

The first is the Japanese Phantasy Star with the English translation patch from this forum, it starts the bios but then glitches before the game starts.

The second is the Sonic the Hedgehog FM by valleybell also from this forum. That one starts but hangs on the Master System logo.

Both Phantasy Star and Sonic play perfectly without the patches applied however.
bios.jpg (375.28 KB)
bios.jpg
bios1.jpg (288.85 KB)
bios1.jpg
bios2.jpg (317.64 KB)
bios2.jpg
m404_patched.zip (2.33 KB)
M404 bios patched to play any game

  View user's profile Send private message
  • Joined: 11 Jul 2009
  • Posts: 12
Reply with quote
Post Posted: Fri Aug 28, 2020 10:32 am
Forgot to mention, if anyone does try it and discovers an issue please let me know and i'll see if he'd be willing to have another look :)
  View user's profile Send private message
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 13347
  • Location: London
Reply with quote
Post Posted: Fri Aug 28, 2020 8:21 pm
I can help you produce that from my disassembly. Basically, it is missing a line of code to tell the game what slot it is running in, and games with FM will often kill themselves if it’s not set. You may also have noticed it glitched a bit as the game boots, because it doesn’t turn off the screen, also easy to fix.
  View user's profile Send private message Visit poster's website
  • Joined: 11 Jul 2009
  • Posts: 12
Reply with quote
Post Posted: Sat Aug 29, 2020 3:54 pm
Hi Maxim, I've asked my friend to have another look at it.

This one does blank the screen after the startup before the game loads so i haven't noticed any glitch however I went through the complete romset with kega and emulicious emulators and found a few games that either freeze on the master system logo after the scrolling sega or boot to a black screen.

I saw your post about patching it in discord and the identification of where it had booted from part and asked him about that. He said he'd take another look this weekend. I sent him the patched roms too so he could look at those at the same time.

Is the line to identify boot source present in the bios and needs enabling/putting in the correct place or is it a line that needs to be added?

If he sends me an updated version i'll be sure to upload it again.
  View user's profile Send private message
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 13347
  • Location: London
Reply with quote
Post Posted: Sat Aug 29, 2020 4:02 pm
My disassembly at https://github.com/maxim-zhao/smsbioses/tree/master/M404 assembles into an identical binary, and it’s then easy to add fixes, and change the boot order. Adding a check for data on the slots (like the Japanese BIOS) would work well, or for single slot use it can be made to always boot the game. Note that the colour cycling effect only shows when there is no game detected.
  View user's profile Send private message Visit poster's website
  • Joined: 11 Jul 2009
  • Posts: 12
Reply with quote
Post Posted: Sat Aug 29, 2020 4:14 pm
As i said in the first post i have no knowledge at all on assmebly so i won't pretend to understand. I've linked my friend to this thread and he said he'll take a look :)
  View user's profile Send private message
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 13347
  • Location: London
Reply with quote
Post Posted: Sat Aug 29, 2020 5:26 pm
- call the screen off function before booting
- write the memory control register value to $c000 before checking slots to fix compatibility with many games
- change the slot checking control table to select the slot you want to boot always, and remove the slot checks
- or add different slot checks, eg check for TMR SEGA at $7ff0 or check for some variation in the data, to keep the ability to boot cards
- maybe add a button press check to force it to stay in the BIOS if you want to see the colour cycling part
- maybe fix the bug that means the wobbly logo is actually the wrong colour :)

At this point I ought to just do it, it’s not that hard.
  View user's profile Send private message Visit poster's website
  • Joined: 27 Jun 2020
  • Posts: 65
Reply with quote
Post Posted: Fri Sep 11, 2020 2:55 am
Maxim wrote
- call the screen off function before booting
- write the memory control register value to $c000 before checking slots to fix compatibility with many games
- change the slot checking control table to select the slot you want to boot always, and remove the slot checks
- or add different slot checks, eg check for TMR SEGA at $7ff0 or check for some variation in the data, to keep the ability to boot cards
- maybe add a button press check to force it to stay in the BIOS if you want to see the colour cycling part
- maybe fix the bug that means the wobbly logo is actually the wrong colour :)

Looking forward to this !

At this point I ought to just do it, it’s not that hard.
  View user's profile Send private message
Reply to topic



Back to the top of this page

Back to SMS Power!