SofaRun 3.0 & SofaROM 2.0 released

SofaRun 3.0 & SofaROM 2.0 released

by Louthrax on 20-04-2017, 05:21
Topic: Software
Tags: sofarom, SofaRun
Languages:

SofaRun is an MSX tool designed to run a wide range of media images like cassette, disk and ROM cartridge. A new version of SofaRun is out, featuring many improvements. SofaRom has also been updated.

The tool SofaRun, a game loader for the lazy player, has been updated to version 3.0. With SofaRun as your game-boot program, various settings can be set and stored for each individual game. It features a joystick controlled file browser, ZIP files support, options to map JoyMega buttons to keyboard and "soft reset". The most important feature update is the use of a single application, SofaROM, to load ROM images for all devices.

SofaROM, the other updated piece of software, is an MSX tool designed to launch MSX ROM images. Where SofaROM 1.0 was only able to launch MegaROMs on memory mapper, SofaRom 2.0 version is now supporting "small ROMs" and the following devices:

  • Memory mapper
  • turboR mapper
  • SD Snatcher
  • Snatcher
  • MegaRAM
  • ESE SCC
  • MegaFlashROM SCC
  • GR8NET
  • MegaFlashROM SCC+ SD
  • Multi-MSXRAM
  • MegaFlashROM SCC+

SofaROM will pick the best suitable ROM device depending on the ROM type and settings chosen. You can specify a "preferred device" with the /Dx option, but if this one is not found or suitable, another device might be selected instead.

SofaROM has been coded using a "driver-oriented" approach, the interesting thing is that all future improvements in the features or patching methods will benefit to all supported devices.

Other points worth to mention:

  • The stack size of SofaUnzip has been increased, preventing crashes when unzipping files between partitions in Nextor.
  • The [Ret] key can now be used to validate choices in SofaRun, SofaROM and SofaRunIt.
  • The memory requirements to launch ROMs have been reduced (launching a "small" ROM or a MegaROM to a external device does not require any extra memory).

Everything is available in the SofaRun package or as individual tools and can be downloaded from Louthrax's MSX game room. Be sure to check the "Usage" sections of the left to have more details.

Comments (29)

By Victor

Champion (272)

Victor's picture

26-04-2017, 16:01

Great work!!!

By hamlet

Paladin (773)

hamlet's picture

26-04-2017, 19:19

Yes it is! Thank you Louthrax!

By -Neo-

Champion (301)

-Neo-'s picture

26-04-2017, 20:05

Running it to full satisfaction here. As always a great job!

By Pippo

Master (191)

Pippo's picture

26-04-2017, 20:20

Excellent work, as usual! Smile

By KdL

Paladin (945)

KdL's picture

26-04-2017, 20:38

Today I'm very lazy... thank you! Wink

By Louthrax

Paragon (1457)

Louthrax's picture

26-04-2017, 21:35

Thanks guys Smile

Kdl, I've heard that SofaROM does not recognize the OCM internal ESE-SCC-like mapper (and launches games using the normal Memory mapper). Let me know if you can confirm that, I'd also be interested by documentation/links about that special mapper (I do not own an OCM).

By Colemu

Champion (481)

Colemu's picture

27-04-2017, 12:38

I only discovered the wonders of Sofarun about a month ago,
Now I don't know how I lived without it!

Great work Louthrax, from a very grateful user! Big smile

By KdL

Paladin (945)

KdL's picture

27-04-2017, 13:16

Louthrax wrote:

Thanks guys Smile

Kdl, I've heard that SofaROM does not recognize the OCM internal ESE-SCC-like mapper (and launches games using the normal Memory mapper). Let me know if you can confirm that, I'd also be interested by documentation/links about that special mapper (I do not own an OCM).

Ok, I will let you know...

By KdL

Paladin (945)

KdL's picture

27-04-2017, 14:22

It seems ok...

By iamweasel2

Champion (454)

iamweasel2's picture

27-04-2017, 15:43

Great news ! I'll check it out for sure this weekend. Does it support running Pointless Fighting with a 2 megabytes Megaram?

I'm curious, what exactly the A.I code from Nyyrikki does in SofaRom?

Thanks for this great update. Smile

By Fabio Belavenuto

Supporter (13)

Fabio Belavenuto's picture

27-04-2017, 15:48

(translated from portuguese by sd_snatcher user, thanks!)

I would like to help with this topic, as I have some related projects that use VHDL code from the OCM.

This interface has 3 types of "megaRAMs" internally: the SCC-I, the ASCII8 and ASCII16.

In fact, it's implemented as two interfaces: one connected to the slot-1, and another connected to the slot-2. The slot-1 allows the selection of either the external connector or the SCC-I, while for the slot-2 it's possible to select between the external connector or one of the three types of MegaROM controller.

The Switched I/O ports are used to configure the slots and megaROM types. You need to write D4h to the port 40h, and then write to the port 41h one of the following values:

0x0D => Set External Slot-1 + External Slot-2;
0x0E => Set Internal SCC-I Slot-1 + External Slot-2;
0x0F => Set External Slot-1 + Internal SCC-I Slot-2;
0x10 => Set Internal SCC-I Slot-1 + Internal SCC-I Slot-2;
0x11 => Set External Slot-1 + Internal ASCII-8K Slot-2;
0x12 => Set Internal SCC-I Slot-1 + Internal ASCII-8K Slot-2;
0x13 => Set External Slot-1 + Internal ASCII-16K Slot-2;
0x14 => Set Internal SCC-I Slot-1 + Internal ASCII-16K Slot-2;

When the SCC-I is selected as the MegaROM controller in one slot, it behaves like the SD-Snatcher and ESE-SCC cartridges:

Frames:
1.0 => 0x4000-5FFF;
1.1 => 0x6000-7FFF;
2.0 => 0x8000-9FFF;
2.1 => 0xA000-BFFF;

The bank switching is done in the addresses below, only if the bits 6 and 4 of the register-1 (detailed below) are set to zero and the bit 4 of the register-2 is zero.

Writes to 0x5000~0x57FF => Select the page on frame-1.0
Writes to 0x7000~0x77FF => Select the page on frame-1.1
Writes to 0x9000~0x97FF => Select the page on frame-2.0
Writes to 0xN000~0xB7FF => Select the page on frame-2.1

To select the waveRAM, set the page-63 on the frame-2.0 and access it on the area 0x9800 to 0x9FFF

There are two extra registers:

register-1: Address 0x7FFE~0x7FFF (configuration register)
register-2: Address 0xBFFE~0xBFFF (SCC+ mode register)

The register-1 is accessible if the bits 4~5 of the register-2 are set to "00", and the register-2 is only accessible if the bits 4 and 6 of the register-1 are set to "0".

Register-1: (ESE-SCC configuration register)
bit7: not used
bit6: RAM A19 (see bellow)
bit5: not used
bit4: 1=allows RAM writes on frame-1. 0=blocks RAM writes on frame-1.
bit3: not used
bit2: not used
bit1: not used
bit0: not used

Register-2: (SCC+ mode register. Only some bits are implemented)
bit7: not used
bit6: not used
bit5: Sound Mode (0=SCC, 1=SCC+)
bit4: When set to 1, allows writes to the RAM (like the SD-Snatcher SCC+)
bit3: not used
bit2: not used
bit1: not used
bit0: not used

On reads and writes on the RAM, its A19 address is set to 0 for the frame-1.1, and to the register-1 bit6 on the other frames. That limits the effective available memory for ROMs to 512KB. It's possible to have a total of 1MB of ROM, but the frame-1.1 will always be limited to the lower 512KB.

Additional information can be found in the following links:
http://bifi.msxnet.org/msxnet/tech/scc
http://bifi.msxnet.org/msxnet/tech/soundcartridge

The ASCII8 and ASCII16 mappers are almost identical to their original implementation. There's one extra bit on the paging registers: if the bit7 is set to "1" for the following frames, it allows the RAM to be written:

ASCII8: frames 0, 2 and 3
ASCII16: frame 1

To load a ROM, select the mapper type, select the desired page with the bit7 set for the frame-1 on ASCII16, or for the frames 0, 2 and 3 for ASCII8. Then copy the data to those frames normally. After the data is loaded, just initialize all the page registers with the bit7 set to zero.

By Louthrax

Paragon (1457)

Louthrax's picture

27-04-2017, 18:31

iamweasel2 wrote:

Great news ! I'll check it out for sure this weekend. Does it support running Pointless Fighting with a 2 megabytes Megaram?

I'm curious, what exactly the A.I code from Nyyrikki does in SofaRom?

Thanks for this great update. Smile

Pointless Fighting works with ESE-SCC 2MB (test here), so there's a good chance it will work with MegaRAM.

Pointless Fighting starts on MFRSCC+SD but crashes when starting fight. I have an IPS patch for that, but I'm trying to implement a "generic" solution that would work for >1MB ROMs on MFRSCC+SD. The ROM pages in MFRSCC+SD above 1MB are not contiguous, so a patch is required in the ROM, I think that this could be done in an automated way (OPFXSD is applying a specific patch for each game).

Nyyrikki's code is called eveytime SofaROM patches something in a ROM. It checks if the bytes to patch are really code or data (patching is not applied in this case). That's used in lots of situation (patching "page switches", but also JoyMega, PSG2SCC and external SCC features).

By Louthrax

Paragon (1457)

Louthrax's picture

27-04-2017, 18:23

Fabio Belavenuto wrote:

(translated from portuguese by sd_snatcher user, thanks!)
I would like to help with this topic, as I have some related projects that use VHDL code from the OCM.
This interface has 3 types of "megaRAMs" internally: the SCC-I, the ASCII8 and ASCII16.

Thanks Fabio! I'll try to see if I could have these working in SofaROM. I'll need someone to make tests for me (I do not own a OCM, so that will be some "blind-coding" Smile).

By Louthrax

Paragon (1457)

Louthrax's picture

27-04-2017, 18:25

KdL wrote:

It seems ok...

Thanks for testing KdL. What happens if you do not enter the SLOTMODE commands (does SofaROM work without that)? I guess you can always put them in AUTOEXEC.BAT, waiting for SofaROM to detect these mappers and select them nicely.

By Grauw

Enlighted (5703)

Grauw's picture

27-04-2017, 20:45

Louthrax btw, in addition to Fabio’s information, there’s a complete overview pdf of all the I/O settings of the OCM in KdL’s firmware package if you’re interested.

I imagine SLOTMODE controls the settings Fabio mentioned. I haven’t used it myself, normally I use the DIP switches… seems handier to use that command line tool actually Big smile.

By Sylvester

Champion (330)

Sylvester's picture

27-04-2017, 21:47

I just noticed that my SD Snatcher SCC isn't detected by sofarun when it's in slot 2-1 of my Slot Expander.Vgmplay seems to have the same issue. Both programs only work when my SCC is in slot 1 of my TR ST.

Is this a know issue? or a limitation of the SD SCC that you can only use it in slot 1 or 2?

By Louthrax

Paragon (1457)

Louthrax's picture

28-04-2017, 02:14

Sylvester wrote:

I just noticed that my SD Snatcher SCC isn't detected by sofarun when it's in slot 2-1 of my Slot Expander.Vgmplay seems to have the same issue. Both programs only work when my SCC is in slot 1 of my TR ST.

Is this a know issue? or a limitation of the SD SCC that you can only use it in slot 1 or 2?

That's a super-weird case: I tried with the same configuration here (I'm the lucky owner of an SD Snatcher cartridge), and I indeed got the same "SCC not found" error (I tried to use SD Snatcher as "External SCC" in this case). I then "flashed" the SD Snatcher cartridge with a game (the Konami Game Collection version of Knightmare, that you can create with the KGC2ROMS tools). This was working perfectly, including SCC+ sounds.

After that, I reseted my MSX and made the first test again... and SD Snatcher was the recognized. And no way to reproduce the problem after that!

It seems like flashing the SD Snatcher cartridge restore it in a state that's compatible with the slot-expander... Could you try the same as I did (I can send you the Knightmare SCC+ ROM if you want), and let me know if that changes something ?

By Louthrax

Paragon (1457)

Louthrax's picture

28-04-2017, 02:31

I just fixed some issues in SofaROM:

  • The MFRSCC+SD driver was wrongly configured to support BASIC ROMs. This has been removed (BASIC ROMs are launched using Memory mapper).
  • When "External SCC was" set in the same main-slot as the disk ROM, sound was disabled in Memory mapper mode. That's fixed too.

I did not change the version numbers, just re-download the SofaRun package or SofaROM.

By KdL

Paladin (945)

KdL's picture

28-04-2017, 07:38

Louthrax wrote:
KdL wrote:

It seems ok...

Thanks for testing KdL. What happens if you do not enter the SLOTMODE commands (does SofaROM work without that)? I guess you can always put them in AUTOEXEC.BAT, waiting for SofaROM to detect these mappers and select them nicely.

SLOTMODE is a temporary mode to change the DIP-SWs.
You can grab the 'Switched I/O Ports' references from the last OCM-PLD Pack.
If you do not choose the properly mode the SofaROM do not works.
Only my firmware can do it... the original 1chipMSX uses the DIP-SW only.
The OCM-EXTRA Pack has the source code of SLOTMODE command inside.

By Louthrax

Paragon (1457)

Louthrax's picture

28-04-2017, 18:18

Thanks KdL. I'm tempted to assume in SofaROM that your firmware is installed, considering the OCM/Zemmix/etc... as a single ROM device, and selecting the good "slotmode" according to the ROM. That would simplify things I guess (the other approach is to add the OCM mappers as individual ROM devices that will be detected depending on the DIP switches... not so handy...).

What do you guys think? Can all OCM/Zemmix be updated with KdL firmware, or any reason not to do that? (or any interest to go for the "individual ROM devices" approach ?).

By Grauw

Enlighted (5703)

Grauw's picture

28-04-2017, 18:33

You can detect the presence of KdL firmware easily (out (40H),D4H; if in (40H) == ~D4H), also a version number can be read though I don’t know from the top of my head… If not detected, just rely on ESE-SCC support and let the user set the DIP switches correctly.

By Louthrax

Paragon (1457)

Louthrax's picture

01-05-2017, 20:18

Thanks Grauw, that approach looks good.

By Louthrax

Paragon (1457)

Louthrax's picture

06-05-2017, 02:32

I just promoted those small fixes:

  • Selected directory is now preserved when you go to the parent directory ("..") in the file browser.
  • 1x is now the default flash speed for MFRSCC+ non-SD.
  • Due to popular demand, .BAS file extension has been added to the SR.INI file (I was using .LDR for my personnal game setup to differentiate from .BAS files and know which file is the "official launcher", but that's not so handy for everybody).

I did not change the version number, just re-download from the same location.

By Erwin Brasil

Supporter (3)

Erwin Brasil's picture

25-05-2017, 09:37

To be complete, only the save state feature is missing in this program.

By mboixo

Rookie (27)

mboixo's picture

25-05-2017, 13:46

Link in page no work.

By Bastiaan

Champion (326)

Bastiaan's picture

01-06-2017, 12:40

Are these new programs compatible with Carnivore2 cartridge?

https://www.msx.org/forum/msx-talk/hardware/fddide-controlle...

By Louthrax

Paragon (1457)

Louthrax's picture

02-06-2017, 09:55

Erwin Brasil wrote:

To be complete, only the save state feature is missing in this program.

Yeah, I had that request several times Smile The Game Master (1 & 2) option already allows you to do that for most Konami cartridges games. That should be doable for DSK and other ROM games (on disk access, or keyboard access if that's done in a standard way) , the only thing is to "guess" the state of the VDP correctly (maybe that could be done through options).

By Louthrax

Paragon (1457)

Louthrax's picture

14-06-2017, 15:28

SofaROM 2.1 is out and available from my website, with the following changes:

  • Support for the new GR8Net "composite mappers" recently added by Eugeny. These new mappers allow using the Game Master (1 & 2) option, and also saving/loading on disk with games allowing that (King's Valley 2, Metal Gear 2...).
  • Better detection of ESE SRAM cartridges. Some ESE SRAM models where temporary disabled by the Snatcher and SDSnatcher cartridges detection routine (which were usually performed first). That's fixed.

Please note that the GR8Net ID switches must be set to their default positions for SofaROM to detect it (those are the small switches under the cartridge near the connector).

SofaRun itself has not changed (no new options were introduced), but the SofaRun package also contains the new v2.1 SofaROM.

By ~mk~

Master (185)

~mk~'s picture

17-06-2017, 02:46

Louthrax wrote:
Erwin Brasil wrote:

To be complete, only the save state feature is missing in this program.

Yeah, I had that request several times Smile The Game Master (1 & 2) option already allows you to do that for most Konami cartridges games. That should be doable for DSK and other ROM games (on disk access, or keyboard access if that's done in a standard way) , the only thing is to "guess" the state of the VDP correctly (maybe that could be done through options).

Louthrax, maybe you can get in touch with the author of Game Runner or just see how it is implemented. I would love to be able to use save states on my real msx, but unfortunately I am limited to MSX-DOS 1.0 :(

My MSX profile