SofaSMS 0.9 released for beta testing

Page 1/2
| 2

Par Louthrax

Prophet (2293)

Portrait de Louthrax

12-04-2020, 02:58

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.

!login ou Inscrivez-vous pour poster

Par Louthrax

Prophet (2293)

Portrait de Louthrax

12-04-2020, 16:24

New version available here: SofaSMS 0.91

I've added another mapper patch scheme (to handle things like LD HL,0xFFFF - LD (HL),xx). This makes Alex Kid in Miracle World working.

I've also added Psychic World and Psycho Fox in the INI file:

[2069e6f5,"Alex Kidd in Miracle World (B) (V1.1) [p1][!].sms & Alex Kidd in Miracle World (UEB) (V1.1) [!].sms"]
	/ME3 /IPC000-1FFFF /FD0 /FE0
[7a1034a5,"Psychic World (EB) [!].sms"]
	/FD0 /FE0
[044cb80b,"Psycho Fox (UEB) [!].sms"]
	/FD0 /FE0
	/IP10000-1FFFF

Creation of an INI file entry can be really fast, some games are working with no force/ignore/patch instructions, like Psycho World (I just added /FD0 and /FE0 to skip FM detection and emulation in order to speed up load, as this game is not supporting the FM chip).

Pause button emulation does not seem to cause too much trouble so far, only a small line with GFX glitches on Power Strike 2 title screen. Maybe that could be avoided using joysticks with faster extra buttons access compared to JoyMega (like FM-Towns).

Par Sander

Ambassador (1855)

Portrait de Sander

13-04-2020, 00:41

Thanks Loutrax for this new Franky loader! Great that save game support is there and Nyyrikki's a.i. code. I remember Alexito uses different loaders depending on the size of the game, how is that handled in SofaSMS?

Par alexito

Hero (642)

Portrait de alexito

13-04-2020, 01:47

Thanks Louthrax, for this new SMS Launcher. I'm very glad to try it and play with this new tool. I let you know about my discoveries and maybe finally can I fix some more games for the community. Running Naked in a Field of Flowers

Par alexito

Hero (642)

Portrait de alexito

13-04-2020, 14:30

Quote:

I remember Alexito uses different loaders depending on the size of the game,

Well, with F4096P3.COM we fix that inconvenience just make sure have enough Main RAM for loading a FRANKY PATCHED game for example a 128KB FRANKY PATCHED game will require at least 256KB MSX Main RAM .

Par Louthrax

Prophet (2293)

Portrait de Louthrax

13-04-2020, 18:28

SofaSMS is for now just copying the SMS ROM into the main mapper (which has to be big enough, no checks are made for now).

Here's a small update on Alex Kid to fix crash when entering shop:

[2069e6f5,"Alex Kidd in Miracle World (B) (V1.1) [p1][!].sms & Alex Kidd in Miracle World (UEB) (V1.1) [!].sms"]
	/ME3 /FD0 /FE0
	/IPC000-1FFFF /IP7DCD

Par hamlet

Scribe (3260)

Portrait de hamlet

13-04-2020, 19:36

Thanks! Will be more fun to use the Playsoniq now! Great!

Par Louthrax

Prophet (2293)

Portrait de Louthrax

14-04-2020, 00:05

New entry for R-Type:

[54e3e4f0,"R-Type (JUEB) [!].sms"]
	/PR3=`AFD3FC3CD3FD3CD3FE0000000000`
	/FP54F
	/FP25FA
	/FP26FE
	/FP10BEF
	/FP10BF5
	/FP10BFA

This one was a bit trickier (different code sequences that the AI refuse to consider as code). Pause button and FM sounds seem to work fine.

By the way, I personnaly find the MSX version better (same for Psycho World) Tongue

Par alexito

Hero (642)

Portrait de alexito

14-04-2020, 21:29

My Testing using my Zemmix Neo BR, FRANKY (VDP 315-5246) and Joymega

https://youtu.be/y71RW5EwUjs

https://youtu.be/HE11CbFOEZg

Fantastic Job! Louthrax.

PS: if you are a Franky owner you can modify the original YSFM.SMS to force use the OPLL FM PAC just grab your favorite HEX editor and modify at the offset 0x7eea (e6) with 0x3e and update the SSMS.INI adding --> /FE2

Quote:

[f21f3f86,"Ys - The Vanished Omens (UEB) [p FM SSTranslations].sms"]
/ME3 /PB0 /FE2
/PR8C=`0000000000000000000000000000`

Par NYYRIKKI

Enlighted (5609)

Portrait de NYYRIKKI

14-04-2020, 22:12

Public congratulations from me too!

It's a bit pity that these games still need this "much" manual patching work... Not because it would be too difficult to fix rest of the stuff manually, but because not many players have the required skills to do it... We talked a bit about this with Louthrax already and one of the major reasons seems to be the static patching approach used that does not always give quite enough information for AI to make those needed vice decisions. (In SVI and Memotech MSX ROM loaders dynamic patching approach was used instead) I hope we can find more ways to improve this.

I'm anyway very impressed what Louthrax has done! Although this is still beta, this seems already very well thought and polished tool! It also makes me happy that there is yet another project using this AI to make our MSX life better.

Par NYYRIKKI

Enlighted (5609)

Portrait de NYYRIKKI

14-04-2020, 22:18

alexito wrote:

PS: if you are a Franky owner you can modify the original YSFM.SMS to force use the OPLL FM PAC just grab your favorite HEX editor and modify at the offset 0x7eea (e6) with 0x3e and update the SSMS.INI adding --> /FE2

Does this cause different result than adding /PR7EEA='3E' /FE2 ??

Page 1/2
| 2