kion-dgl/Miku-Legends-2

Megaman's Model gets updating during opening cutscene

Closed this issue · 7 comments

After completing the firefighting section of the game, MegaMan's texture randomly gets updated during the cut scene. The scope of this issue is to try and track it down and find which texture is causing the issue.

image

I think what's going on here is the game uses a different texture in the framebuffer and re-loads Megaman's model texture. The issue is that rather than loading the PL00T.BIN file, the game probably has another copy of MegaMan's model somewhere, and that's what's being applied (i think).

The scope of this issue is to search through the achive files to see if there is a texture that matches Megaman's framebuffer texture coordinates.

image

Found three locations that overlap with megaman's body that could be the reason for the model texture not loading in correctly.

[
   {
      filename: "ST54T.BIN",
      ofs: 0x40800,
    },
    {
      filename: "ST57T.BIN",
      ofs: 0x2800,
    },
    {
      filename: "ST03T.BIN",
      ofs: 0x43000,
    },
]

Follow up:

  1. Render the textures in the test to make sure they're the Megaman texture
  2. Add breadcrumbs to the end of the texture after 0xffff to be able to search the data in the ROM to make sure it was replaced

Hopefully it doesn't get to the point where i need to dump the framebuffer, export the image and then search against the game data for that image.

I realized that I could have saved myself some pain by going rendering the textures for ST03, ST54 and ST57 to see if they're the Megaman texture I'm looking for.

ST03

st03

ST54

ST54T

ST57

ST57T

Notes

It looks like ST57 is a copy of the MegaMan body but editing that didn't update the whole ROM after the first cut scene. Which means that either i have the wrong file, or the ROM isn't actually being updated.

I think i'll take a two part approach, the first will be to try and replace the palette with different colors to debug which one is actually being read. And then the second will be to specifically make sure that texture is being updated when running the rom.

Checking

It looks like there are only four places in the ROM with Megaman's full palette. It seems like we can try replacing them with red, green, yellow, blue to try and track down which of the textures is messing things up.

Found at: 0x: 3b8398
Found at: 0x: 3c01c8
Found at: 0x: 5cdc198
Found at: 0x: 7311978
Count: 4

And I was finally able to track down the texture with red at 0x5cdc198. Which is weird since i'm replacing PL00T.BIN and PL00T2, and the only other file i found was ST57T. Which accounts for 3 of the 4. Next step will be to track down the file that's causing the problem.

image

Well nuts, after tracking it down to the ROM, it looks like the encoded red is in a palette file which means it's only half the problem. But at atleast it gives me a header to look for. I can search through the files for the palette with a header of 2.

image

After searching through all of the files for which uses the palette, it looks like it's in ST3A02.BIN at 0x2c830.

[ "ST57T.BIN", "ST3A02.BIN" ]

Fixed, this is when the game loads after the first cut scene.

image

One thing I realized is that I forgot to check if the face was being patched as well, and it's not.

image

I thought it might be possible, the game is loading a different set of expressions for the cutscene, but it looks like it's not.

0-face-st03a2

Fixed after the cut scene, but the cut scene itself is still bugged. It could be that the cut scene is loading a different texture. So we might come back to it in v0.4.

image