News: 11 March 2016 - Forum Rules, Mobile Version
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia

Author Topic: Finding location of compressed data in Mario 64 Shindou Edition  (Read 1123 times)

SleepyFist

  • Hero Member
  • *****
  • Posts: 697
    • View Profile
Finding location of compressed data in Mario 64 Shindou Edition
« on: October 02, 2016, 09:13:33 am »
Anyway to find where compressed data is being extracted from as the game runs? I need to be able to somewhat accurately locate where text, graphics, and fonts are being stored in order to get this translation off the ground.
Sleepy's tune of the week: Budgie - Nude Disintegrating Parachutist Woman - https://youtu.be/N5V3Tizxm7A

SleepyFist

  • Hero Member
  • *****
  • Posts: 697
    • View Profile
Re: Finding location of compressed data in Mario 64 Shindou Edition
« Reply #1 on: October 09, 2016, 07:04:10 pm »
Bada-bump

Anybody know how many revisions of Mario 64 USA there are? IIRC Someone in an old thread I was reading implied that the final version of Mario 64 USA was very similar to the Shindou version, I was hoping to compare the two and maybe v1.0 to see if I could pick up any leads.

Anyway weekend ends tomorrow, I'll still be looking at it but its gonna have to share time with real life :P

EDIT:
found a rom map for E or USA(not sure maybe both?) http://www.smwcentral.net/?p=nmap&m=sm64rom
I guess this is incomplete? but it looks like there is no dedicated block for text so I guess it's being stored with level layout data maybe, perhaps the font is stored in the common textures block, I'll look at this tomorrow morning.
« Last Edit: October 09, 2016, 07:50:06 pm by SleepyFist »
Sleepy's tune of the week: Budgie - Nude Disintegrating Parachutist Woman - https://youtu.be/N5V3Tizxm7A

Asaki

  • RHDN Patreon Supporter!
  • Full Member
  • *****
  • Posts: 147
    • View Profile
Re: Finding location of compressed data in Mario 64 Shindou Edition
« Reply #2 on: October 11, 2016, 04:05:18 am »
Would it be easier to port the rumble feature over to the USA/EUR versions?

Just curious. I'm guessing it's still a lot of work to try to track everything down.

queueRAM

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Finding location of compressed data in Mario 64 Shindou Edition
« Reply #3 on: October 14, 2016, 01:46:38 pm »
Anyway to find where compressed data is being extracted from as the game runs? I need to be able to somewhat accurately locate where text, graphics, and fonts are being stored in order to get this translation off the ground.

I replied over on smwc, but in case you don't take a look over there, I'll quickly copy some of my respond here.

All SM64 ROMs are setup in a similar manner, so some of the SM64 hacking notes will be applicable for Shindou. There are some good notes on SM64 (U) text editing on the "SM64 Text Editing" wiki page. As you may know, the MIO0 blocks are compressed and will need to be decompressed before editing them.

All the font textures and strings are stored in the first MIO0 block (U:0x108A40, J:0x1076D0, E:0x0DE190, Shindou:0xE42F0). Each ROM has a different set, but generally follow the same order: large colorful HUD font (RGBA16), HUD icons (RGBA16), green credits font (RGBA16), dialog font (varies), dialog text (custom encoding), some other HUD graphics. See the first block on the SM64 Textures wiki page for the (U) textures.

For the (U) ROM, the dialog font starts at offset 0x5900 in this segment and is encoded as 16x8 IA4 (rotated 90 degrees). For the (J) and Shindou ROM, the dialog font starts at offset 0x7100 and is encoded as 8x16 1bpp. These two ROMs contain Japanese and uppercase Latin characters.

As far as the actual dialog text encoding, there are three different tables in the MIO0 block: dialog text (U:0xFFC8, Shindou:0xD550?), level names (U:0x10F68, Shindou:0xE45C?), act names (U:0x1192C). Let me know if you need help tracking down the offsets in the Shindou ROM. The entries of dialog table are stored as 16 bytes where the first 12 bytes are parameters, last 4 bytes are the dialog offset. The other two tables are just 4 byte entries pointing to the dialog. The actual dialog text is then encoded using the custom encoding documented on the wiki page. e.g. first level name entry at
0x10F68: 02 01 0D 14
dialog text is at offset
0x10D14: 9E 01 9E 0B 18 0B 9F 18 16 0B 9E 0B 0A 1D 1D 15 0E 0F 12 0E 15 0D FF
Translated: " 1 BOB-OMB BATTLEFIELD"

Note, the main menu also has its own textures. See MIO0 block from (U) 2A65B0 on the textures list for example.

Anybody know how many revisions of Mario 64 USA there are? IIRC Someone in an old thread I was reading implied that the final version of Mario 64 USA was very similar to the Shindou version, I was hoping to compare the two and maybe v1.0 to see if I could pick up any leads.

EDIT:
found a rom map for E or USA(not sure maybe both?) http://www.smwcentral.net/?p=nmap&m=sm64rom
I guess this is incomplete? but it looks like there is no dedicated block for text so I guess it's being stored with level layout data maybe, perhaps the font is stored in the common textures block, I'll look at this tomorrow morning.

As far as I've seen, there is only one version of (U) ROM. Looking at the Shindou Edition, its code segments look most closely like the (E) version as compiler optimizations were enabled, but its data segments (such as the MIO0 block containing font textures) most closely resemble the (J) version. I have some config files which give a more complete memory map of (J), (U), and (E) ROMs:
SM64 (J) Map
SM64 (U) Map
SM64 (E) Map (not as complete as others)

queueRAM

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Finding location of compressed data in Mario 64 Shindou Edition
« Reply #4 on: March 19, 2017, 12:26:28 pm »
If you're still interested in making a SM64 Shindou translation, I worked out a basic memory map and deconstructed segment 02 (font graphics and tables and dialog encoding) for both (J) and Shindou versions of the game. There are very little difference in the dialogs between the two, only updating some text to say "A & B" instead of just "A", as detailed on TCRF SM64 version differences article. The Japanese versions only contain upper case English characters, so you could either just use that for a translation or if you wanted to get more thorough, import the upper and lowercase characters from the (U) ROM over some of the Japanese characters and update the tables.

Asaki

  • RHDN Patreon Supporter!
  • Full Member
  • *****
  • Posts: 147
    • View Profile
Re: Finding location of compressed data in Mario 64 Shindou Edition
« Reply #5 on: December 30, 2017, 11:45:11 pm »
Would it be easier to port the rumble feature over to the USA/EUR versions?

I guess it might not be so simple.

I finally got an Everdrive 64, and was playing this a bit, and it seems like there might be a few other additions as well. I'll have to double-check to be certain, but it seemed like the framerate was a lot smoother, and they refined the chasecam a bit.