Hi all,
Here's a little Easter gift for you happy owners of Franky or Playsoniq devices: SofaSMS 0.9
SofaSMS is a tool designed to launch Sega Master System games on our MSX machines. It mainly focuses on Franky for now, but also supports several Playsoniq's specific options.
It offers the following features:
- Automatic patching of VDP, FM-PAC, PSG, mapper, and joystick ports for Franky.
- Use of NYYRIKKI Artificial Intelligence routines to distinguish between code and data.
- Possibility to add per-game patch instructions and patch sequences in an SSMS.INI file.
- Support of Pause button emulation for Sofa-compliancy ;)
- Save and load of on-cartridge RAM.
- Developper's options to make the creation of patches easier.
You'll find a SSMS.INI file in the provided ZIP file, which already contains working entries for 6 games:
[c5ee9e48,"Aleste (J) [!].sms"] /PR1E06=`0000` /FPD64 [e75db963,"Golvellius - Valley of Doom (UE) [!].sms"] /PR3=`00000000000000000000` /IP36B02 /IP2AE46 /IP263DA /IP36261 /IP35FFD /IP1A49A /FP659 /FP1CEEC [73185231,"Power Strike II (EB) [!].sms"] /FD0 /FE0 /FP11D2 /FPF83 /FP11C8 /FPC9F /FPCD9 /FPCE3 /FPCD2 /FP7C877-7CB9C [a1929e12,"Wonder Boy III - The Dragon's Trap (UEK) [!].sms"] /IP3424 [0c058bd2,"Ys - The Vanished Omens (UEB) [!].sms"] /ME3 /PB0 /FD0 /FE0 /PR8C=`0000000000000000000000000000` [f21f3f86,"Ys - The Vanished Omens (UEB) [p FM SSTranslations].sms"] /ME3 /PB0 /PR8C=`0000000000000000000000000000`
Some explanations: NYYRIKKI's AI does 98% of the patching job (redirecting the SMS ports to Franky's one), but it still needs help in some cases. This can be done using the /IP (ignore patch) and /FP (force patch) options that you can see above. Some areas in the ROM also need to be patched - Aleste for example does a OUT (0xFF),a (no idea what that does on a real SMS), and that needs to be zeroed (/PR`0000`).
For the Sega Pause button emulation, you'll need a JoyMega joystick (just press the Start button). I was always quite annoyed to go to the console on real SMS to access the inventory in Golvellius or Wonder Boy 3 (and the Pause button was just not existing on MSX). Note that the Pause button emulation is not compatible with he Playsoniq's mapper. This mapper emulation works great, but mirrors the RAM at C000-DFFF and E000-FFFF, so there's no room left for SofaSMS's emulation routine.
This version is very beta and unoptimized, but it should work OK for the games listed in the INI file.
The big part of the remaing work will now be to create patch entries for all games (there's often something to fix). The work of Alexito, that had already released lots of conversions could help. I hope SofaSMS could make things easier (there are different options available for developpers, allowing to display the AI applied or rejected patches, and also saving the patched result to a file).
Below is a list of all available options:
Usage: SSMS {rom_image} [options] {rom_image} is a Sega Master System ROM image file [options] can be specified on the command line, and also per-game in this INI file Each game is identified by the CRC32 of its first 16KB. Command line options have priority over the INI file ones. [options] can be one or more of: ("*" indicates default value): ******************** *** User options *** ******************** /AE{Audio emulation} 0: None 1: Use Playsoniq *2: Patch for Franky /FD{FM detection emulation} 0: None 1: Use Playsoniq *2: Patch /FE{FM emulation} 0: None 1: Use Playsoniq *2: Patch for FM-PAC /JE{Joystick emulation} 0: None 1: Use Playsoniq *2: Patch for Franky /ME{Mapper emulation} 0: None 1: Use Playsoniq *2: Patch for memory mapper using IOs (memory mapper readback required) 3: Patch for memory mapper using CALLs (required if no memory mapper readback and for games using SRAM, like Ys) /PB{Pause button emulation} 0: None 1: Use Playsoniq (not available yet) *2: Patch for Franky /PS{PSG to SCC} (Playsoniq only) *0: OFF 1: ON /SR{Save RAM} *0: OFF 1: ON This options saves the on-cartridge RAM into a .SAV file (based on the ROM file name) and exits. A typical usage is the following: - Launch your game by typing: "SSMS YS.SMS" - Play the game... - Reset your MSX - Type: "SSMS YS.SMS /SR1". An "YS.SAV" file will be created. - Next time you'll relaunch your game, this .SAV file will be automatically loaded. /TR{turboR mode} *0: Z80 1: R800 ROM 2: R800 DRAM /VE{Video emulation} 0: None 1: Use Playsoniq *2: Patch for Franky /VF{Video frequency} (Playsoniq only) 0: 50HZ *1: 60HZ /VM{Video mode} (Playsoniq only) 0: Composite *1: RGB /VS{Video standard} (Playsoniq only) 0: PAL *1: NTSC *************************** *** Developpers options *** *************************** /FP{Range in which to force patching} Parameter can be a single hexadecimal ROM offset value (e.g. /FP1ACF), or a range (e.g. /FP7C877-7CB9C). Code found here will always be patched, ignoring AI advice. /IP{Range in which to ignore patching} Parameter can be a single hexadecimal ROM offset value (e.g. /FP1ACF), or a range (e.g. /FP7C877-7CB9C). Code found here will never be patched, ignoring AI advice. /LL{Log level} *0: None 1: Log applied patches 2: Log rejected patches 3: Log all /PR{ROM patch} Parameter is composed of a hexadecimal ROM offset value, followed by "=" and by one or several sequences. Sequences can be hexadecimal numbers (quoted by "`") or ASCII strings (quoted by """). Here are some examples: /PR125='000000' : patch 3 0 bytes at offset 0x125 /PR3A7="Hi mum!" : patch one string at offset 0x3A7 /PR3A7="Hi mum!"'000000' : patch one string followed by 3 0 bytes. /SP{Save patched ROM} *0: Do not save patched ROM 1: Save patched ROM result in SSMS.ROM
Let me know if you find any issues (there are probably many), and do not hesitate if you have suggestions or ideas.
Known things to do are:
- Automatic detection of Playsoniq slot.
- Option to specify the slot to use (main RAM slot is always used for now). This would allow to launch games on turboR on external RAM. Some of them are playable in this configuration (internal RAM is too fast and always causes GFX mess).
- Check if the mapper is big enough to fit the SMS ROM.
- Support for cartridges with 32KB of on-board RAM.
- Identify games based on their full CRC32 (for now just the first 16KB are used for speed sake, which causes collisions for translated games for example).
- Improve speed for INI file parsing and patching.
I'll also very probably release a version of SofaRun supporting options for SofaSMS.