18,700
edits
(more explaining) |
(more explaining; if anyone can explain why the data table address is off by 8 bytes, I'd appreciate it) |
||
Line 66: | Line 66: | ||
This descriptor tells us that a resource of type SUBT (a subtitle file for Oni; there are only two in the game) has data that can be found 0x2230C8 bytes into the data table, which we learned from the file header starts at 0x03BCA0. Its name can be found 0xCB01 bytes into the name table that starts, according to the file header, at 0x28F240. The data is 0x09C0, or 2,496 bytes. | This descriptor tells us that a resource of type SUBT (a subtitle file for Oni; there are only two in the game) has data that can be found 0x2230C8 bytes into the data table, which we learned from the file header starts at 0x03BCA0. Its name can be found 0xCB01 bytes into the name table that starts, according to the file header, at 0x28F240. The data is 0x09C0, or 2,496 bytes. | ||
If you want to see the name of this resource, let's look at address 0xCB01 + 0x28F240 = 0x29BD41. There we find the string "SUBTsubtitles". | If you want to see the name of this resource, let's look at address 0xCB01 + 0x28F240 = 0x29BD41. There we find the string "SUBTsubtitles". The actual subtitle data should be found at the address 0x2230C8 + 0x03BCA0 = 0x25ED68. Let's go there now.... | ||
====Instance data==== | |||
For some reason, the addresses we calculate from the descriptor data offsets are all off by eight bytes, so we need to subtract 8 from 0x25ED68 and go to 0x25ED60. Compare what you see here to the documentation for the [[SUBT]] type. Below is the data you should actually see for the English Oni SUBT file at this address: | |||
{{Table}} | |||
{{OBDth}} | |||
{{OBDtr| 0x00 | res_id |FF0000| 01 F4 12 00 | 4852 | 04852-subtitles.SUBT }} | |||
{{OBDtr| 0x04 | lev_id |FFFF00| 01 00 00 00 | 0 | level 0 }} | |||
{{OBDtr| 0x08 | char[16] |00FF00| AD DE | dead | unused }} | |||
{{OBDtr| 0x18 | offset |00FFFF| 80 44 44 01 | 0x01444480 | at this position starts the part in the raw file }} | |||
{{OBDtr| 0x1C | int32 |FF00FF| 61 02 00 00 | 609 | array size }} | |||
|} | |||
The second and third bytes of the first word are the '''resource ID'''. | |||
The second and third bytes of the second word are the '''level number''' where this resource is found. | |||
After a '''buffer''' of 16 unused bytes, we find the address of the actual data, but it's the position in the level's raw file. Open level0_Final.raw and jump to address 0x01444480, and you should see "01_01_01 Griffin: Give me another reading.", and the rest of some very familiar dialogue continuing from there. | |||
The '''array size''' of 609 tells us that there are 609 subtitled lines of dialogue to be found in the raw file. | |||
===Name descriptors=== | ===Name descriptors=== |