re4_tweaks icon indicating copy to clipboard operation
re4_tweaks copied to clipboard

plXX.udas memory increase

Open emoose opened this issue 2 years ago • 3 comments

Got a request on residentevilmodding forum about increasing memory size for the plXX.udas files, which might be needed to let people use higher-poly models, apparently the other dll has something for increasing this, so should be possible for us to fix it too.

Haven't looked into it yet but hopefully it's just something related to the addrs setup by SystemMemInit, like ss_pzzl was, or maybe it's something polygon/Prim related again.

Asked them if they can send a plXX.udas that game doesn't work with atm, I'll edit this if I get hold of one.

E: seems ReadPlayerData does try to read into a PL00_ADDR ptr (name from VR symbols), which gets setup by SystemMemInit as somePool+0x2A8D000, seems that area only has 0x1E8000 bytes until it enters the next addr setup by SystemMemInit (DRTEMP_ADDR), so I'd guess this might be the problem with it (for reference, largest plXX.udas in vanilla game seems to be 0x1B9EA0)

E2: I think hooking the DvdReadN call inside ReadPlayerData might let us change the ptr & size of PL00_ADDR dynamically, looks like filename is passed over to DvdReadN, so we could check size of the file being read in first, then could probably overwrite PL00_ADDR ptr with a new malloc'd array.

There is another function Event::ExeBeginEvt that does something with PL00_ADDR though, either reading some tpl files into it, or maybe just reading some value from inside it instead, not sure, hopefully just the latter.

emoose avatar Dec 21 '21 22:12 emoose