Closed kion-dgl closed 6 days ago
After the forbidden islands
Textures are complete. Thanks to Xinus22 for these.
So it looks like we have about 22 textures to replace. I think the place it make most sense is to start with tests. The first tests that we need to write are finding the offsets to the files that we want to replace. And then the second test is going to involve looking at the palettes in terms of what colors the game expects to be there to see if we need to, or should apply the same palette across all of the faces. Or at least have as many colors as we can have a consistent index.
const CUT_SCENES = [
{
name: "cut-ST1CT.BIN",
offset: 0x02d000,
compressed: true
},
{
name: "cut-ST1FT.BIN",
offset: 0x053000,
compressed: true
},
{
name: "cut-ST03T.BIN",
offset: 0x046000,
compressed: true
},
{
name: "cut-ST3A02.BIN",
offset: 0x03d800,
compressed: false
},
{
name: "cut-ST4B01.BIN",
offset: 0x023000,
compressed: false
},
{
name: "cut-ST4B01.BIN",
offset: 0x027800,
compressed: false
},
{
name: "cut-ST4BT.BIN",
offset: 0x03e800,
compressed: true
},
{
name: "cut-ST4CT.BIN",
offset: 0x047800,
compressed: true
},
{
name: "cut-ST5C01.BIN",
offset: 0x014800,
compressed: false
},
{
name: "cut-ST15T.BIN",
offset: 0x03a800,
compressed: true
},
{
name: "cut-ST17T.BIN",
offset: 0x052000,
compressed: true
},
{
name: "cut-ST1700.BIN",
offset: 0x011000,
compressed: false
},
{
name: "cut-ST1701.BIN",
offset: 0x00e800,
compressed: false
},
{
name: "cut-ST1702.BIN",
offset: 0x00b000,
compressed: false
},
{
name: "cut-ST25T.BIN",
offset: 0x049000,
compressed: true
},
{
name: "cut-ST27T.BIN",
offset: 0x067000,
compressed: true
},
{
name: "cut-ST28T.BIN",
offset: 0x06d000,
compressed: true
},
{
name: "cut-ST30T.BIN",
offset: 0x04a000,
compressed: true
},
{
name: "cut-ST3001T.BIN",
offset: 0x04a000,
compressed: true
},
{
name: "cut-ST39T.BIN",
offset: 0x01e000,
compressed: true
},
{
name: "cut-ST46T.BIN",
offset: 0x032000,
compressed: true
},
{
name: "cut-ST52T.BIN",
offset: 0x030000,
compressed: true
},
{
name: "cut-ST0305.BIN",
offset: 0x041000,
compressed: false
},
{
name: "cut-ST1802T.BIN",
offset: 0x052800,
compressed: true
},
{
name: "cut-ST1803.BIN",
offset: 0x018000,
compressed: false
},
{
name: "cut-ST2501.BIN",
offset: 0x00a000,
compressed: false
}
]
Now that we've managed to track down all of the offsets for the cutscene faces, the next step is to update EncodeTexture.ts
to encode all of the images and replace them.
ST3A02.BIN
hack we previously didEncodeRom.ts
.Right now I'm going through and implementing replacing the textures for each one of the cut scenes. There is a small chance that things work out, but also things could go pretty badly.
I think we're going to be paranoid and make sure we go through each one of the textures to make sure they look correct in the file and then go from there.
In terms of uncompressed textures, it's a pretty simple search and replace. In the case of compressed textures we need to try and make sure we're getting the right length.
Well.... nuts. It looks like we have a problem.
I finally managed to go through and get all of the textures to compress to the the right length. But it looks like things aren't quite working correctly.
I think the follow up is to write tests so that we can run the script to export the textures, which we can then test to render the textures and see if we get the image we expect.
Right now on a first pass of this, it looks like we have an empty texture so we'll need to look into the file to see what's wrong.
I got textures working and then i broke something. Seems to be working as of a77a821. So I'll need to compare what's different from the current branch and compare.
I'm not exactly sure what the problem is, but it looks like it has something to do with ST3A02.BIN
. This file effectively has three textures that need to be replaced.
The body is at offset 0x2c800
(not compressed)
Cut Scene face is at 0x3d800
(not compressed)
Gameplay face is at 0x35000
To trace through it, the game goes (start new game)
so the weirdness is scene 3A2 has three textures, it has the gameplay face and body that the game patches in after the cut scene and it has megaman's face that it uses for about a second if i don't change megaman's face in 3A2, the intro scene looks fine, but megaman is glitched out for two seconds when the flutter touches down but if i update megaman's face in scene 3a2, the whole intro cutscene is glitched and i've been trying to debug things by setting them red to see what triggers it, and i can't seem to find it
right now my best guess is one of the faces is a texture where the palette isn't included directly and that's why the reference is getting mixed up or something.
Looking at the framebuffer, it looks like the cut scene and the default face are getting loaded in.
Merged. This can be closed.
I had planned for this in version 0.4 Testing confirmed that the face looks terrible during cutscenes.