modifying funcs to match from tpdebug

This commit is contained in:
roeming 2024-08-02 14:13:41 -04:00
parent 7027935a5b
commit a79259bc48
2 changed files with 5 additions and 7 deletions

View File

@ -40,8 +40,7 @@ struct TParse_TBlock : public TParseData_aligned<4> {
const void* getNext() const
{
u32 size = getSize();
return ((u8*)getRaw() + size);
return getSize() + ((u8*)getRaw());
}
const void* getBlockEnd() const { return (u8*)getRaw() + sizeof(TBlock); }
@ -57,8 +56,7 @@ struct TParse_TBlock : public TParseData_aligned<4> {
const void* getContent() const
{
u32 size = align_roundUp(getIDSize(), 4);
return (const void*)((int)getBlockEnd() + size);
return align_roundUp(getIDSize(), 4) + (const u8*)getBlockEnd();
}
// _00-_04 = TParseData_aligned

View File

@ -11,14 +11,14 @@ namespace data {
*/
void TParse_TParagraph::getData(TParse_TParagraph::TData* data) const
{
u16* parse = (u16*)JGadget::binary::parseVariableUInt_16_32_following(mRaw, (u32*)data, (u32*)&data->mType, 0);
u32 t = (u32)data->mSize;
const u8* parse = (const u8*)JGadget::binary::parseVariableUInt_16_32_following(mRaw, (u32*)data, (u32*)&data->mType, 0);
u32 t = data->mSize;
if (!t) {
data->mContent = nullptr;
data->mNext = parse;
} else {
data->mContent = parse;
data->mNext = parse + ((t + 3) >> 1 & ~1);
data->mNext = parse + align_roundUp(t, 4);
}
}