Xeeynamo / sotn-decomp

Decompilation of Castlevania: Symphony of the Night (PSX+Saturn)
https://sotn.xee.dev/
GNU Affero General Public License v3.0
508 stars 55 forks source link

Data Import tt_002 #1896

Closed Onenutmcgee closed 2 days ago

Onenutmcgee commented 3 days ago

Importing the remaining data for tt_002 Importing sbss data Adjusting the data files

The data except for the servant_events data is all unique to the faerie. I suppose all the data could be put in 1 file, but I had it split up because ghost and bat shared a significant amount of data.

D_us_801724CC[] should actually be an array of Unkstruct_801724CC; however, that doesn't match because it's on a 2 byte barrier and the compiler wants to align it to 4 bytes. I tried #pragma pack and attributed((packed)) and a few other things with no avail. So that and the cast to Unkstruct_801724CC in func_us_80177F84 are just going to have to be wonky. This issue was figured out by @Xeeynamo

I didn't really do any refactoring beyond what I needed to in order to get the data in. I'll work on that next.

Onenutmcgee commented 3 days ago

I kind of wonder if we're missing something with the compile and/or options since the packing compiler directives don't actually seem to do anything.

Onenutmcgee commented 2 days ago

I’ll make this fix when I get a chance.

Onenutmcgee commented 2 days ago

I didn't quite grok what you were saying until I dug into it, but it makes sense now. The length of the struct being 0x1A because that was working in the code was wrong since gcc was aligning the struct. It just happened to match work because of a quirk of gcc was realigning the data.

The data makes significantly more sense now.

sozud commented 2 days ago

Xeeynamo's suggestion is applied so this should be good to go now