OBD talk:Oni2AS

From OniGalore
Revision as of 17:11, 4 May 2022 by Iritscen (talk | contribs) (+cat)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Using this page to write up instructions for a straightforward patch allowing one to specify alternative/additional layouts in Settings/rb.gamedata

The file table entries for Settings/rb.gamedata and fonts/rbstrings.xls look like this:

Offset Type Raw Hex Value Description
File table, 8881st entry
0x23300 offset 26 BC 04 00 0x4BC26 offset to file name, from start of file name block, in bytes
  • in this case it points to 0x800+0x41800+0x4BC26=0x8DC26
  • the string at that address is fonts/rbstrings.xls (null-terminated)
0x23304 offset 00 88 7C 02 0x27C8800 absolute offset to file data, from start of DAT file, in bytes
0x23308 int32 00 52 00 00 20992 uncompressed file size, in bytes
0x2330C int32 12 15 00 00 5394 compressed file size, in bytes
File table, 16456th entry
0x40C70 offset 98 10 0A 00 0xA1098 offset to file name, from start of file name block, in bytes
  • in this case it points to 0x800+0x41800+0xA1098=0xE3098
  • the string at that address is Settings/rb.gamedata (null-terminated)
0x40C74 offset 00 50 0E 00 0xE5000 absolute offset to file data, from start of DAT file, in bytes
0x40C78 int32 C7 02 00 00 711 uncompressed file size, in bytes
0x40C7C int32 29 01 00 00 297 compressed file size, in bytes


RB.DAT patch
Adding all layouts to Settings/rb.gamedata could be as simple as making the following value changes to RB.DAT (after making a backup)
Address Old value New value
0x23304 00 88 7C 02 22 D3 1D 02
0x23308 00 52 00 00 00 00 00 00
0x2330C 12 15 00 00 00 00 00 00
0x40C74 00 50 0E 00 00 88 7C 02
0x40C78 C7 02 00 00 70 12 00 00
0x40C7C 29 01 00 00 70 12 00 00

and replacing 4720 bytes of RB.DAT starting at 0x27C8800 with the byte-for-byte contents of THIS file.

ISO patch
To avoid the trouble of making a PS2-compatible ISO, one can instead make the following changes directly to oni2dev_ps2.iso or whatever it's called (after making a backup)
Address Old value New value
0x37A304 00 88 7C 02 22 D3 1D 02
0x37A308 00 52 00 00 00 00 00 00
0x37A30C 12 15 00 00 00 00 00 00
0x397C74 00 50 0E 00 00 88 7C 02
0x397C78 C7 02 00 00 70 12 00 00
0x397C7C 29 01 00 00 70 12 00 00

and replace 4720 bytes of the same oni2dev_ps2.iso starting at 0x2B1F800 with the byte-for-byte contents of THIS file.

Indeed, the RB.DAT file is stored as-is in the ISO, with a 0x357000 offset.


UNFORTUNATELY...
The game can only load 63 layouts at once without complaining. So one needs to provide a smaller Settings/rb.gamedata file, or at least one that announces fewer layouts in the first line. Like THIS ONE (first 63 layouts) or THIS OTHER ONE (last 32).
Alternative idea if you don't want to overwrite the Excel file
As it happens, Settings/rb.gamedata is the file whose data, at 0xE5000, is the one that comes first, and between it and the preceding string data there are 1866 bytes of unneeded space. Together with the 297 bytes of the file itself, that allows for 2153 bytes of plain text, which is enough to list a lot of the layouts, if not all of them.