Register | Login
Views: 19364387
Main | Memberlist | Active users | ACS | Commons | Calendar | Online users
Ranks | FAQ | Color Chart | Photo album | IRC Chat
11-02-05 12:59 PM
1 user currently in Rom Hacking: hukka | 2 guests
Acmlm's Board - I2 Archive - Rom Hacking - Looking at Super Mario 64 compressed graphics | |
Add to favorites | "RSS" Feed | Next newer thread | Next older thread
User Post
Cellar Dweller

Flurry
!!!
Level: 27

Posts: 160/269
EXP: 107817
For next: 8342

Since: 03-15-04
From: Arkansas

Since last post: 16 days
Last activity: 34 min.
Posted on 10-17-04 10:06 AM Link | Quote
After learning that the compression used in SM64 had been cracked(http://www.emutalk.net/showthread.php?t=21072), I wrote my own decompression tool, but I ended up resorting to running a viewer under Wine to see the graphics. I would have liked to post screenshots of the graphics in the viewer, but I had trouble saving the screenshots.

Here is some of the stuff I found in the Japanese version(I had trouble finding the US ROM).


Compressed block at 0x1076d0:
font graphics
icons?
1bpp font (used when Mario is reading a sign)

Compressed block at 0x112b50:
textures used on Mario's body(M on cap, eyes)
sparkles

Compressed block at 0x128be0:
looks like the white balls that eyes shoot or the eyes themselves
a pair of crossed eyes
eggs?
textures used on the wind up things that flip Mario up in the air

Compressed block at 0x3fa310:
fence used in bob-omb battlefield
arrow sign
flower textures used for the flower patches
I beleve that this block also contains geometry data for bob-omb battlefield.


That was just a few of the things in a few of the compressed blocks of data. I intend to look at more.

To view the graphics I used Jovis's N64 Disassembler as a graphics viewer.

My brother's computer is much faster and has Windows. I may attempt to decompress, corrupt, and recompress some of the non graphics data to see what happens to the game.

BTW, does anyone know of a N64 emulator that has a decent debugger?
HyperLamer
<||bass> and this was the soloution i thought of that was guarinteed to piss off the greatest amount of people

Sesshomaru
Tamaranian

Level: 118

Posts: 1791/8210
EXP: 18171887
For next: 211027

Since: 03-15-04
From: Canada, w00t!
LOL FAD

Since last post: 2 hours
Last activity: 2 hours
Posted on 10-17-04 01:21 PM Link | Quote
You too? I did this a while ago, but I didn't really want to post the results until I'd actually found something useful. (Nor release the program until the colours actually worked. ) May as well, though:

The numbers in brackets after GFX are the colour depth and width.
108A40: Big Font (doesn't include unused chars; jumps from W-Y etc), various GFX (mostly 16/16)
114750: Various GFX (mostly 32/16)
12A7E0: More GFX, including BETA YOSHI EGGS! (32/16)
132C60: More GFX (32/16)
134D20: Still more GFX, including big weird balls (32/32)
13B910: More GFX (32/32)
13B910: More GFX (16/32)
145E90: More GFX (16/32)
1521D0: Guess what? (16/32)
160670: Still more (16/32)
165A50: Even more (including a red thing with a question mark ) (16/32)
166C60: Yes, More GFX! (Mostly textures) (16/32)
16D870: How many GFX are there in this game? (Peach's face?) (16/32)
180BB0: Still GFX (mostly textures) (32/32)
188440: Yeah, more GFX (none of which I recognize - fireballs?) (16/32)
1B9CC0: Just when you thought there couldn't be more GFX... (32/32)
1C4230: Did Nintendo just dump all their GFX into here or what? (Koopa shell pic ) (16/32)
1D8130: Why, more GFX of course! (Smiley faces O_o) (16/32)
1E51F0: Yes, we have more graphics, we have more graphics today (16/32)
1E7EE0: Graphics again, but I don't recognize them... (16/32)
1F2200: More unfamilliar GFX, Coins, ! boxes, Goombas etc (16/32)
201410: Did I mention GFX? (Power meters, trees, doors, stars from doors) (16/32)
26A3A0: ???
26F420: ???
2708C0: Super Mario 64/Game Over backgrounds (16/80)
2A65B0: Yes, more GFX (including Mario's head from the front, and outlined from the side) (16/64)
2AC6B0: Wow, more GFX! (clouds/water?) (16/32)
2B8F10: BGs? (16/32)
2C73D0: You'd never guess... More GFX! (16/32)
2D0040: GFX! (Lava?) (16/32)
2D64F0: MORE GFX! (Sky textures) (16/32)
2E7880: OMG! More GFX! (Parts of a picture?) (16/32)
2F14E0: Is this game just all graphics? (16/32)
2FB1B0: So many GFX, so little ROM (similar to 2E7880) (16/32)
301CD0: Even more GFX, which I don't recognize (16/32)
30CEC0: Would you believe more GFX? (16/32)
31E1D0: Still more GFX (textures) (16/32)
326E40: Textures from haunted house, same weird yellow ring as in Mario Kart (16/32)
32D070: More GFX (bars, wall, etc) (16/32)
334B30: Textures (16/64)
33D710: All sorts of beta-looking GFX/Textures (16/32)
341140: Imagine that! More GFX! (16/32)
347A50: Textures from level 6 (16/32)
34E760: More GFX (16/32)
351960: GFX I don't remember (smiley face) (16/32)
357350: Yes, more GFX! (16/32)
35ED10: GFX. Amazing, ain't it? (16/32)
365980: HOLY CRAP! MORE GFX! (16/64)
36F530: Return of the GFX! (Beta flower!) (16/32)
371C40: Huge GFX file, mostly garbage (16/32)
383950: Another huge, mostly garbage GFX file (16/32)
396340: Giant GFX file (all castle textures/GFX, including paintings, plus a lot of garbage) (16/64)
3D0DC0: How many more GFX can there be? (Level 6 textures, lots of garbage) (16/32)
3E76B0: STILL MORE GFX! (16/32)
3FC2B0: Is there any GFX not in this game? (16/32)
405FB0: Even more GFX! (16/32)
40ED70: Are there any non-GFX files in here? (16/32)
41A760: Well I'll be damned, more GFX! (16/32)
4246D0: Look ma, more GFX! (16/32)
437870: WTF, still more GFX! (16/32)
44ABC0: Yes, more GFX! (Fence, pic of Peach, Peach's signature) (16/64)
454E00: Holy cow, more GFX! (16/32)
45C600: MORE FUCKING GFX! (16/32)
4614D0: Amazing! More GFX! (16/32)
46B090: NOT GFX!!!!! (Can't tell just what it is, though...)
46C3A0: GFX! Bet you never saw that coming! (16/32)
4784A0: Would you believe it? More GFX! (16/32)
48D930: Surprise! More GFX! (Pic of Bowser's head in circle? ) (16/32)
496090: More GFX, of some sort... (16/32)
49E710: This must be the last of the GFX! (Ending pic) (16/80)
4AC570: SOMETHING OTHER THAN GFX!
4AF930: GFX! Why, what did you expect? (16/32)
4B80D0: You guessed right, GFX! (16/32)
4BEC30: Even more GFX (16/32)
4C2920: I think this is GFX... (16/32)
4C4320: So... Many... GFX... (16/32)
4CDBD0: Looks like more GFX
4CEC00: Weird GFX (16/32)
4D1910: Some GFX (16/32)

If you scan the game's RAM for 'MIO0' you'll notice that each level loads some compressed files, usually 2 but sometimes only one (such as the wing cap level). I found that levels 1 and 2 both load the same file, which indicates that level data is NOT compressed. Towards the end of the ROM is a FRICKIN HUGE data block, but when I corrupted a big chunk of it and played most levels, nothing seemed to change. I had the sound off, so it could be related to that, but it's a LOT of data. Must be like a meg or so.
BMF98567
BLACK HAS BUILT A SILLY DICE-MAZE!
GO!

Current list of BURNING FURY >8( recipients:
- Yiffy Kitten (x2)
- Xkeeper
Level: 53

Posts: 404/1261
EXP: 1094149
For next: 62970

Since: 03-15-04
From: Blobaria
Special Move: Rising Meatloaf Backhand Combo

Since last post: 21 hours
Last activity: 1 hour
Posted on 10-17-04 02:00 PM Link | Quote
Originally posted by HyperHacker
108A40: Big Font (doesn't include unused chars; jumps from W-Y etc), various GFX (mostly 16/16)
Interestingly enough, the Japanese version does have these characters; they're used in the hidden level select (they appear as corrupted dots in the US version). There also appears to be a small, unused green/yellow font loaded right after the big one in RAM, which I don't believe was used for anything (the ending, maybe? I haven't finished this game in ages). The GameShark Pro's VRAM viewer is a wonderful tool.
KawaiiImoto-e

Hammer Brother
Level: 49

Posts: 477/1068
EXP: 852917
For next: 30966

Since: 03-15-04
From: In my own little complicated dreamworld

Since last post: 16 days
Last activity: 4 days
Posted on 10-18-04 12:17 AM Link | Quote
Hmm.. Maybe the Game isn't even 8 Megabytes big, and there is also much chunk in there.

There is also a Programm floating arround, wich allows to extract all Audiosamples from the game (Including voices), doesn't need much space.
Just checked, the Green font is used in the Ending.
Cellar Dweller

Flurry
!!!
Level: 27

Posts: 161/269
EXP: 107817
For next: 8342

Since: 03-15-04
From: Arkansas

Since last post: 16 days
Last activity: 34 min.
Posted on 10-18-04 11:25 AM Link | Quote
Are you sure about there being no level data in compressed blocks? I did some corrupting(bitwise inversion) a few months ago of the SM64 ROM(Japanese) in 64KB chunks and the found a single byte at 0x400212(or 0x400213 in the correct byte order) that would crash the game upon the loading of bob-omb battlefield if changed from 0. Screwing around there, I was able to mess up parts of the bob-omb battlefield ground polygons(objects in the level still acted like the ground was still in the same place). I thought that was inside a compressed block. I'm not so sure now.

Finally, my standard lecture about sharing info. I beleve that it is best to post information early and often, not wait for it to be complete or exactly right. If someting is hard to understand, someone else may have another insight into it. In case there is a loss of interest or too much work for one person, someone else can continue without duplication of effort.
The Kins

Kodondo
Level: 38

Posts: 216/595
EXP: 354733
For next: 15714

Since: 03-15-04
From: Melbourne, VIC, Australia

Since last post: 2 days
Last activity: 9 hours
Posted on 10-18-04 05:30 PM Link | Quote
So, uh, graphic extraction + dumping program for us plebs?
Keitaro

Iron Knuckle
ウラシマ ケイタロウ
Level: 54

Posts: 773/1342
EXP: 1201569
For next: 32301

Since: 03-15-04
From: Hinata, Japan

Since last post: 2 days
Last activity: 2 days
Posted on 10-18-04 09:46 PM Link | Quote
Originally posted by KawaiiImoto-e
Hmm.. Maybe the Game isn't even 8 Megabytes big, and there is also much chunk in there.

There is also a Programm floating arround, wich allows to extract all Audiosamples from the game (Including voices), doesn't need much space.
Just checked, the Green font is used in the Ending.


I have such program, was showing HH the results some time back. Quite funny what happens with Peach's voice
HyperLamer
<||bass> and this was the soloution i thought of that was guarinteed to piss off the greatest amount of people

Sesshomaru
Tamaranian

Level: 118

Posts: 1807/8210
EXP: 18171887
For next: 211027

Since: 03-15-04
From: Canada, w00t!
LOL FAD

Since last post: 2 hours
Last activity: 2 hours
Posted on 10-19-04 04:08 AM Link | Quote
Originally posted by Cellar Dweller
I did some corrupting(bitwise inversion) a few months ago of the SM64 ROM(Japanese) in 64KB chunks and the found a single byte at 0x400212(or 0x400213 in the correct byte order) that would crash the game upon the loading of bob-omb battlefield if changed from 0. Screwing around there, I was able to mess up parts of the bob-omb battlefield ground polygons(objects in the level still acted like the ground was still in the same place). I thought that was inside a compressed block. I'm not so sure now.



Do me a favour? Go back there, copy 16 bytes or so, and paste them here. With any luck I can find them in the US version. That could be in a compressed file, most of them contain both graphics and some sort of other data. In the game's RAM only 2 files can be found copied from the ROM, but it's possible that there could have been more which it just overwrites after decompressing them.
Cellar Dweller

Flurry
!!!
Level: 27

Posts: 162/269
EXP: 107817
For next: 8342

Since: 03-15-04
From: Arkansas

Since last post: 16 days
Last activity: 34 min.
Posted on 10-19-04 10:54 AM Link | Quote
The compressed data block that starts at 0x3fa310 runs to(but not includes) 0x403abe for a total compressed size of 0x97ae. 0x400213 is within that range and part of the last section of the compressed block. Here is a line from a hex dump of the ROM(corrected byte order):
0400210: 28 28 28 00 13 00 04 00 10 57 5e e6 98 f8 7e f9  (((......W^...~.

I think that the area that I messed around with to change the polygons was within the next 256 bytes after 0x400213. I also remember changing the three 28s to make the level a little darker, but that might just have been in my head.

HyperLamer
<||bass> and this was the soloution i thought of that was guarinteed to piss off the greatest amount of people

Sesshomaru
Tamaranian

Level: 118

Posts: 1824/8210
EXP: 18171887
For next: 211027

Since: 03-15-04
From: Canada, w00t!
LOL FAD

Since last post: 2 hours
Last activity: 2 hours
Posted on 10-20-04 09:39 AM Link | Quote
W00t. Found at 4021B0 in the US version, and... *opens program*

Lesee, we have a 71,618-byte file at 3FC2B0, which means it reaches to 40DA72! Nice find! Now we know that the levels most likely are compressed. Now to extract the file, corrupt it and re-insert it.

Hmm... If this program hasn't totally screwed up, that's pretty damn good. Just by changing 3 bytes and re-compressing the file, it's now only 39,039 bytes!

File re-inserted. Game did not crash on starup, wow. Now for the moment of truth... Crash. CPU steady at 99.8% but nothing happens. I didn't think that re-compression was accurate.

So now let's just try corrupting some random stuff in the file, compressed, in the ROM itself. *saves a state just before Mario dives into the painting*

No changes that I can see. Let's corrupt more! ...This looks different. Across both bridges, at the edge of the level next to the ! box, it's not very steep... *Compares with real N64* Bah, today would have to be the day my brother actually takes an interest in N64. More corruption! Crashed again. Let's try 256 bytes ahead, like Cellar mentioned...
4022B0: 7F
4022B0: 00
4022B0: 00 00 00
I do believe a is in order.
Keitaro

Iron Knuckle
ウラシマ ケイタロウ
Level: 54

Posts: 800/1342
EXP: 1201569
For next: 32301

Since: 03-15-04
From: Hinata, Japan

Since last post: 2 days
Last activity: 2 days
Posted on 10-23-04 02:07 AM Link | Quote
holy good golly gosh...excelent job, HyperHacker that's amazing what you've done by just corrupting some bytes.
HyperLamer
<||bass> and this was the soloution i thought of that was guarinteed to piss off the greatest amount of people

Sesshomaru
Tamaranian

Level: 118

Posts: 1873/8210
EXP: 18171887
For next: 211027

Since: 03-15-04
From: Canada, w00t!
LOL FAD

Since last post: 2 hours
Last activity: 2 hours
Posted on 10-23-04 02:27 PM Link | Quote
A lot more could be done if someone could write a working MIO0 compression program. (I haven't tried yet, but if anyone else wants to...) I've got the format here:






MIO0 Binary Encoding Specification
Written by BGNG of Godspeed, 06/27/04
=====================================


Data Member Data Type Size
---------------------------------------------------

Identifier Str 4 Bytes
Destination Data Size UInt 4 Bytes
Compressed Data Offset UInt 4 Bytes
Uncompressed Data Offset UInt 4 Bytes
Data Map Prefixes Bits Unspecified
Compressed Data LDPairs Unspecified
Uncompressed Data Bytes Unspecified

*The Identifer is the 4-byte string "MIO0"

*UInts are stored as Big-Endian
*Offsets are base 0
*The bytes decoded tell your program when to stop
*LDPairs are 4/12-bit LZ77 length/distance pairs.



Notes:
======
LZ77 is a compression algorithm based on a series of headers,
compressed "pairs" and raw data. The headers are a series of
bits that, obviously, are either 1's or 0's corresponding to
the next piece of data being raw or compressed, respectively.

If it's 1, just pull the next byte of uncompressed data. If
it's 0, read the next two bytes of compressed data. These
bytes are a 16-bit pair of values, where these values are 4
bits then 12 bits.


The 12-bit value is a Distance value that tells the decoder
how many bytes backwards in the previously decoded data to
go from the end of the decoded data, minus 1. Add 1 to this
value when you decode it.

The 4-bit value is a Length value that tells how many bytes
to read from the Distance position which are to be copied
to the end of the output file, minus 3. Add 3 to this value
when you decode it.

Simply keep track of the current Header, Pair and Raw
offsets in the file you're decoding and you're good to go.
For encoding, it's simply a matter of checking an 18-byte
forward-read buffer with the previous 4096 bytes of the
file, looking for the longest match. If the length of the
match is greater than 2, then the data is compressed. Else,
it's included raw.



Sample File:
============

000000 4D494F300000002C 000000150000001F MIO0...,........
000010 FFAFFBFB40000200 0700130021002254 ....@.......!."T

000020 6865207261696E20 4D65207374617973 he rain Me stays
000030 206D6C79206F6E20 74706C2E mly on tpl.

Identifier: 4D494F30 ("MIO0")
Destination Data Size: 0000002C (44 bytes)
Compressed Data Offset: 00000015
Uncompressed Data Offset: 0000001F
Data Map Prefixes: FFAFFBFB40
(11111111 10101111 11111011 11111011 01000000)

Compressed Data: 0002 0007 0013 0021 0022
(3, 3; 3, 8; 3, 20; 3, 34; 3, 35)
Uncompressed Data:
The rain Me stays mly on tpl.

Output:
The rain in Maine stays mainly on the plain.
Add to favorites | "RSS" Feed | Next newer thread | Next older thread
Acmlm's Board - I2 Archive - Rom Hacking - Looking at Super Mario 64 compressed graphics | |


ABII


AcmlmBoard vl.ol (11-01-05)
© 2000-2005 Acmlm, Emuz, et al



Page rendered in 0.016 seconds.