News:

11 March 2016 - Forum Rules

Main Menu

Uncensoring Mortal Kombat 1 (SNES)?

Started by ShadowOne333, February 26, 2019, 02:24:38 PM

Previous topic - Next topic

darkmoon2321

#20
Graphics compression for the sprites appears to be very simple.  All they are basically doing is compressing those bytes of tile data that are 00.  A good number of the sprite tiles in the ROM are not compressed at all.  For those that are, there is a 4 byte header with decompression control information.  Each nybble in that header controls a single segment of 4 bytes of tile data.  The control operations for each type of nybble are as follows:

0:0,0,0,0
1:0,0,0,copy
2:0,0,copy,0
3:0,0,copy,copy
4:0,copy,0,0
5:0,copy,0,copy
6:0,copy,copy,0
7:0,copy,copy,copy
8:copy,0,0,0
9:copy,0,0,copy
A:copy,0,copy,0
B:copy,0,copy,copy
C:copy,copy,0,0
D:copy,copy,0,copy
E:copy,copy,copy,0
F:copy,copy,copy,copy

A zero indicates that the next byte of tile data is zero, and "copy" copies a byte of ROM data into the tile instead.  Actual tile data starts immediately after the 4 byte header.  So making a decompression/compression algorithm for these tiles is pretty straightforward.  The other part is then locating all the actual pointers to compressed tile data, and then editing those pointers from within a character's animation frames themselves.

April 14, 2019, 11:13:38 AM - (Auto Merged - Double Posts are not allowed before 7 days.)

I can see why this game hasn't had much hacking attention before.  It's not that the compression routine for sprites itself is difficult, but rather the structure of the data and the pointers.  This game basically REQUIRES you to use a tool to make edits, as doing it by hand is incredibly impractical.  For each character, all of their compressed tiles are stored together, and MUST be ordered by their compressed size.  Rather than having a list of pointers to each tile, pointers are automatically generated based on these compressed sizes and a table in ROM that lists how many tiles of each size there are.  So if you change the size of a single tile:
1. The compressed tile list needs to be re-ordered
2. The table holding the # of compressed tiles of each size needs to be updated
3. EVERY animation frame for that character needs to be rewritten.

Vanya

Can the rom be expanded to allow for the use of uncompressed graphics?

darkmoon2321

Quote from: Vanya on April 16, 2019, 02:08:21 AM
Can the rom be expanded to allow for the use of uncompressed graphics?

It can, but since doing so would still require updating every animation frame, I'd still rather just make a tool for it.  I'm working on it now, I've already made some progress loading in the tile data.  Hopefully I'll at least have it functioning as a sprite viewer in a couple days, then I can work on editing/saving.

ShadowOne333

Oh that sounds great!
Can't wait to see what you come up with :)
The frame thing does sound painful, but it's quite interesting that they did it that way.

RealGaea

Another thing has to be fixed. The music adresses.

Every stage has its correct music except two stages.

Goro's Lair, regular cycle (has Palace Gates instead of Warrior Shrine)
The Pit Bottom, Reptile Battle (has also Palace Gates instead of The Throne)
Tried to do it myself, almost went nuts in doing so.

I would add a layer of Blood/Recolored sweat in opponent's chest during Cage's censored Fatality.

Remove the "Finishing Bonus" and replace it with "Fatality".

Ah, if possible make the patch for all three Regions.

darkmoon2321

Ok, took longer than a few days, but finally got it viewing (at least some) sprites correctly:



Debugging is taking a lot longer than the code itself, and it's still really buggy.  Most of the buttons are just placeholders at the moment, so I'll work on filling those out too.  I uploaded the code for the project here:

https://github.com/darkmoon2321/mk-character-edit

Vanya


Sh4dy

I really would enjoy to see a MK1 uncut for the snes version ;D

MathUser2929

Yeah, it'd be nice to see a uncensored version myself.

ShadowOne333

Quote from: darkmoon2321 on April 27, 2019, 05:05:30 PM
Ok, took longer than a few days, but finally got it viewing (at least some) sprites correctly:



Debugging is taking a lot longer than the code itself, and it's still really buggy.  Most of the buttons are just placeholders at the moment, so I'll work on filling those out too.  I uploaded the code for the project here:

https://github.com/darkmoon2321/mk-character-edit
Why didn't I see this before?!
This is amazing!
So you managed to find the offsets and the way the sprites are compressed?
Did you by any chance find duplicates of the sprites? If so, those could be the censored ones.