Mortal Kombat II Restored

Mortal Kombat II Restored 2.1

My RAM code works with both the Saroo and Action Replay Pro. Test using CD-R and see if its the Saroo micro controller controlling the CD side is the issue. Fixed in 0.9 Firmware for Saroo or meant to be fixed.

As I stated above your test isn't good enough and isn't replicating actual game conditions. These same problems will happen in retail games if you disable the patching Saroo does behind the scenes:



The issue isn't a firmware issue either as Firmware 0.9 didn't touch anything with the RAM cart logic last I checked.
 
The RAM test uses all the methods Sega's documents state the RAM should support to be accessed. Checks that the data is uncorrupted. You are posting video's before 0.9 firmware was released.
 
The RAM test uses all the methods Sega's documents state the RAM should support to be accessed. Checks that the data is uncorrupted. You are posting video's before 0.9 firmware was released.
If firmware 0.9 fixed it then why does it still apply patches to all the RAM cart games to change the A-BUS settings?


If you're so confident that 0.9 fixed it then why don't you try this? Change the Product ID in the disc image for a game like Vampire Savior to a value that's not in the patch list in the source code I just linked you. Boot it up and see it it works correctly or not.

The reality here is that your test isn't good enough. Games will access the RAM cart and copy data to and from it mulitple times per frame as data is DMA'd to VRAM or read by the CPU. My Cinepak Test is a much better test for this as it's constantly decoding a video from the RAM cart. The image and code is available in the ticket I linked, why don't you try it out?
 
Testing the source code from your last video that had an issue on the latest saroo firmware v0.9 and not 0.8.

I read through it without building or running it. The cartridge code works in the common case but has several real problems; the rest of the file is Sega's Cinepak sample with one clear bug.

Cartridge code (​

  1. Registers are written before the ID is checked (lines 179–188). The enable write to 0x257EFFFE and the ASR0/AREF writes happen even with no cart or a non-RAM cart. This is the opposite of what your hardware needed: the Saroo works with no register writes, and the comments in your DOOM code say those writes break it. Read the ID first, and only write if a RAM cart is there and doesn't answer.
  2. No check that the RAM actually works (lines 233–269). _detect never verifies that a written value reads back. If bank 0 doesn't hold data, the mirror test just "finds no mirror" and the cart is reported as a good 4MB cart. That is exactly how your Action Replay failed before setup: 0xFFFF came back.
  3. Only IDs 0x5A and 0x5C are accepted (line 227). Your DOOM code also treats 0x1A and 0xDA as 1MB carts; those are rejected here.
  4. The "restore" on failure may write garbage (lines 183–195). It reads ASR0/AREF and writes them back if detection fails. I'm not certain those SCU registers read back reliably on hardware; if they don't, the restore writes garbage.

Loading the movie into the cart​

  1. No size check (line 982). PARTY.CPK is loaded straight to 0x22400000 with no limit, so a file over 4MB writes past the end of the cart.
  2. No error handling in cd_load_nosize (lines 272–280). GFS_NameToId and GFS_Open results aren't checked, so a missing file passes a NULL handle to GFS_GetFileInfo and GFS_Fread. The GFS_Fread return value is ignored too, so a short read plays a truncated movie.
  3. Transfer mode is never set. The SCU manual forbids SCU-DMA writes to the A-Bus (your saturn_dsp.h quotes it). If the GFS default transfer mode is SCU DMA, the load into the cart breaks that rule; I don't remember the default, so call GFS_SetTmode(gfs, GFS_TMODE_CPU) explicitly.
  4. createMemMovie result isn't checked (line 990). If it returns NULL, movie_x/movie_y are unset and CPK_Start(NULL) is called.

Rest of the program​

  1. Wrong size in sndInit (line 742). sizeof(bootsndsize) is 4, the size of the variable, not the 66-byte map. It should be sizeof(bootsnd) or just bootsndsize.
  2. SCU DMA from Low Work RAM (lines 968–977). The background images are loaded to 0x00200000 and then copied with DMA_ScuMemCopy. As far as I know, SCU DMA can't reach Low Work RAM on real hardware (only A-Bus, B-Bus and High Work RAM), though emulators allow it. If the loading screen shows on your console, I'm wrong on this one.
  3. Minor:
    • The sector count (filesize >> 11) + 1 is one too many for exact multiples of 2048 (harmless, the byte limit stops it).
    • The _id assignments at lines 225, 254 and 263 are redundant.
    • gfs, PadData1, dir_tbl2 and the error callbacks are unused.
    • A 1MB cart gets the "no cart" screen.
    • The movie is read through the uncached address, which is slower than 0x02400000 would be.
As a cart test it is weak: it only proves the ID byte and that bank 0 isn't mirrored, then trusts 4MB of RAM. The RAMCART-Test project covers what this one skips.
 
Back
Top