SofaROM development thread (beta version included!)

Page 1/5
| 2 | 3 | 4 | 5

Par Louthrax

Prophet (2419)

Portrait de Louthrax

13-02-2017, 18:42

Hi all,

You'll find the first beta release of SofaROM here. That tool is designed to launch ROM images with no flash device, using only normal MSX-DOS 2 RAM. There were already existing tools for that, like LoadROM from Trunks & Victor, but I was interested in making my own version. The idea is also to share some logic (like mapper-identification, clever patching, etc...), in the same tool that could be used for several flash devices.

Some details:

  • No (or hardly noticeable) in-game slowdowns, except when loading pages from disk.
  • Max ROM size is 512KB. Handling bigger ROMs would slow down the games, but maybe this could be an option for future versions.
  • Handles ASCII8, ASCII16, Konami and Konami SCC ROMs.
  • Support for external SCC (using /S option).
  • Memory mappers with no read-back capabilities are supported.
  • Recommended memory: 256KB for "disk-based" MSX-DOS2, 512KB for Nextor (also works with 256KB but with lots of disk-accesses in most of the games).

Here's the usage:

Usage: SROM [options] rom_image

[options] can be one or more of:
  /Sxy:  Select SCC slot
    x: Main slot (0-3)
    y: Subslot (0-3)
  /Rx: Set mapper type
    0: Auto (default)
    1: Konami
    2: Konami SCC
    3: ASCII 8
    4: ASCII 16
  /V : Verbose mode

rom_image is a ROM image file.

The download link above also contains a modified version of SofaRun that allows you to select the flash device to use in SR.INI:

# Force flash device
# 0: AUTO (default)
# 1: NONE (use SofaROM)
# 2: KONAMI_SOUND_CARTRIDGE
# 3: ESE_SCC
# 4: MFR
# 5: MFR_SD
# 6: MEGARAM
FLASHDEVICE=1

You can specify the SCC slot to use in SofaRun's "ROM sound settings / SCC slot" setting. This will be passed to SofaROM when the ROM is launched.

!login ou Inscrivez-vous pour poster

Par Louthrax

Prophet (2419)

Portrait de Louthrax

13-02-2017, 19:02

So Nyyrikki
:), I just sent you a PM.

I've found the first case of "wrong patching" in Parodius:

Obviously it does not look like code, and results in this garbaged intro screen:

Par Louthrax

Prophet (2419)

Portrait de Louthrax

13-02-2017, 19:13

So this thread is a development thread. There are still lots of things to improve on SofaROM, even if it's already launching a good bunch of games.

Open subjects are:

  • Handling games that are using line-interrupts (Aleste, Zanac, Xevious). If an interruption happens when line interrupt is enabled on the VDP, the game is stuck (re-entering the interruption routine immediately after exiting it). And I can't totally disable interrupts when loading from disk (yeah, I know, a solution is to load all pages from ROM first so no more disk accesses, but that's kind of cheap!).
  • Metal Gear 2. Demo works but starting game usually crash depending on your RAM/Nextor/SCC slots configuration. Maybe this one is using more than 16KB RAM and erases the "emulated" ROM in RAM.
  • Copy-protected games. Some games like Strategic Mars are poking themselves to check if they are in ROM.
  • Exotic page-switching code sequences. For now SofaROM only identifies and patches sequences in the form 32 00 40, 32 00 60... for Konami, 32 00 50, 32 00 70... for Konami SCC, etc... I'm pretty sure other sequences using register HL are used in some games, I'll need to identify them too.
  • Probably lots of other things...

Any help is welcome (wondering if ROM-crack-god Martos would read that Smile).

Par Victor

Champion (509)

Portrait de Victor

13-02-2017, 20:11

Good job!!

If you need some help.. You know my e-mail.

Par syn

Prophet (2097)

Portrait de syn

13-02-2017, 23:37

Looks nice! I'll definitely give this a try! Big smile I do have playsoniq but sometimes I dont want to connect that big cartridge Big smile

Does it work better than loadrom? I haven't tried loadrom myself so i dont know how good that one was in the first place.

Par Louthrax

Prophet (2419)

Portrait de Louthrax

13-02-2017, 23:45

Hi Syn,

I have not made side-by-side comparisons of LoadROM and SofaROM, but IIRC LoadROM had more slowdowns in games (probably because it supports ROMs > 512Kb).

Anyway, any feedback is appreciated on SofaROM, this is still an early beta-version!

Par Louthrax

Prophet (2419)

Portrait de Louthrax

13-02-2017, 23:53

Thinking about ROM-cracking and related stuff, does anybody knows if Martos is still interested or active on the MSX scene? The cracks he released at the time were awesome, I'm still wondering how he managed to do that without any emulator at the time Smile I'm mentionning that because the automated-process in SofaROM does not give as good results (in terms of memory requirements) as the Martos cracks. IIRC, he was using video-RAM to store ROM-data for MSX1 games (and the un-needed 8KB page combinations were super-optimized).

Par mfeingol

Champion (293)

Portrait de mfeingol

14-02-2017, 00:39

I gave sofarom a spin this morning in openmsx. Oddly, it only seemed to run at normal speed when I unthrottled to 360fps or whatever the max speed is on my CPU. At normal 60fps, ROM execution and gameplay was incredibly slow.

My test configuration: Maze of Galious and Nemesis roms with an emulated ST and an emulated MFR-SCC+SD, which has 512kB of onboard RAM. So I don't think RAM size was the problem.

I haven't had the chance to try it on physical hardware yet.

Par sd_snatcher

Prophet (3517)

Portrait de sd_snatcher

14-02-2017, 01:09

@Louthrax

Tip: Metal Gear2 had some sneaky copy protection writes to defeat the MegaRAM. This is why it needed XPS patches to run with ExecROM. In SofaROM, probably those writes are corrupting the game on RAM.

You can check the XPS patches in this page to see where they modified the game.

BTW, great work! the potential of SofaROM is immense! Given that it searches for the page flipping code, you can code it to be modular and use drivers for each kind of mapping device. Only the appropriate driver would be loaded to handle the page flip calls.

- The current DOS2 RAM device
- Brazilian MegaRAM
- Turbo-R built-in MegaEverything on slot3-3.
- Konami SCC+ cartridge
- etc

Par Grauw

Ascended (10605)

Portrait de Grauw

14-02-2017, 01:00

Awesome project Louthrax, very technically challenging to pull this kind of thing off!

Par sd_snatcher

Prophet (3517)

Portrait de sd_snatcher

14-02-2017, 01:23

Louthrax wrote:

[*]Handling games that are using line-interrupts (Aleste, Zanac, Xevious). If an interruption happens when line interrupt is enabled on the VDP, the game is stuck (re-entering the interruption routine immediately after exiting it). And I can't totally disable interrupts when loading from disk (yeah, I know, a solution is to load all pages from ROM first so no more disk accesses, but that's kind of cheap!).

Yes, you can disable line the interrupts. Smile

Aleste and Zanac-Ex do their homework and update RG0SAV accordingly. Then all you need to do is disable the line interrupts in VDP R#0 for the disk I/O, and after that restore the VDP R#0 from RG0SAV right before returning the CPU to the game.

Yet another example where coding according to the guidelines gives a huge advantage. Wink

Page 1/5
| 2 | 3 | 4 | 5