mirror of https://github.com/zeldaret/tp.git
JGadget binary OK (#1944)
This commit is contained in:
parent
8873f7d359
commit
9b4c375741
|
|
@ -50,6 +50,14 @@ struct TParse_header_block {
|
|||
bool parse(const void* ppData_inout, u32 a2) {
|
||||
return parse_next(&ppData_inout, a2);
|
||||
}
|
||||
|
||||
bool checkNext(const void** ptrLocation, u32* headerEnd, u32 idx) {
|
||||
bool checkNext = false;
|
||||
if (parseHeader_next(ptrLocation, headerEnd, idx)) {
|
||||
checkNext = true;
|
||||
}
|
||||
return checkNext;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
|
|
|
|||
|
|
@ -6,59 +6,68 @@
|
|||
#include "JSystem/JGadget/binary.h"
|
||||
#include "dolphin/types.h"
|
||||
|
||||
//
|
||||
// Forward References:
|
||||
//
|
||||
|
||||
extern "C" void
|
||||
parseVariableUInt_16_32_following__Q27JGadget6binaryFPCvPUlPUlPQ37JGadget6binary5TEBit();
|
||||
extern "C" void __dt__Q37JGadget6binary19TParse_header_blockFv();
|
||||
extern "C" void parse_next__Q37JGadget6binary19TParse_header_blockFPPCvUl();
|
||||
|
||||
//
|
||||
// External References:
|
||||
//
|
||||
|
||||
extern "C" void __dl__FPv();
|
||||
extern "C" void _savegpr_26();
|
||||
extern "C" void _restgpr_26();
|
||||
extern "C" extern void* __vt__Q37JGadget6binary19TParse_header_block[5];
|
||||
|
||||
//
|
||||
// Declarations:
|
||||
//
|
||||
|
||||
/* 802DC864-802DC8C8 2D71A4 0064+00 0/0 2/2 0/0 .text
|
||||
* parseVariableUInt_16_32_following__Q27JGadget6binaryFPCvPUlPUlPQ37JGadget6binary5TEBit */
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm const void*
|
||||
JGadget::binary::parseVariableUInt_16_32_following(void const* param_0, u32* param_1, u32* param_2,
|
||||
const void*
|
||||
JGadget::binary::parseVariableUInt_16_32_following(void const* buffer, u32* param_1, u32* param_2,
|
||||
JGadget::binary::TEBit* param_3) {
|
||||
nofralloc
|
||||
#include "asm/JSystem/JGadget/binary/parseVariableUInt_16_32_following__Q27JGadget6binaryFPCvPUlPUlPQ37JGadget6binary5TEBit.s"
|
||||
JGadget::binary::TEBit temp;
|
||||
if (param_3 == NULL) {
|
||||
param_3 = &temp;
|
||||
}
|
||||
u32 uVar1 = *(u16*)buffer;
|
||||
const void* rv;
|
||||
if ((uVar1 & 0x8000) == 0) {
|
||||
param_3->value = 0x10;
|
||||
*param_1 = uVar1;
|
||||
*param_2 = *(u16*)((u8*)buffer + 2);
|
||||
rv = (u8*)buffer + 4;
|
||||
} else {
|
||||
param_3->value = 0x20;
|
||||
uVar1 <<= 16;
|
||||
uVar1 &= 0x7fff0000;
|
||||
uVar1 |= *(u16*)((u8*)buffer + 2);
|
||||
*param_1 = uVar1;
|
||||
*param_2 = *(u32*)((u8*)buffer + 4);
|
||||
rv = (u8*)buffer + 8;
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
#pragma pop
|
||||
|
||||
|
||||
/* 802DC8C8-802DC910 2D7208 0048+00 0/0 4/4 0/0 .text
|
||||
* __dt__Q37JGadget6binary19TParse_header_blockFv */
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm JGadget::binary::TParse_header_block::~TParse_header_block() {
|
||||
nofralloc
|
||||
#include "asm/JSystem/JGadget/binary/__dt__Q37JGadget6binary19TParse_header_blockFv.s"
|
||||
JGadget::binary::TParse_header_block::~TParse_header_block() {
|
||||
}
|
||||
#pragma pop
|
||||
|
||||
/* 802DC910-802DCA1C 2D7250 010C+00 0/0 9/9 0/0 .text
|
||||
* parse_next__Q37JGadget6binary19TParse_header_blockFPPCvUl */
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm bool JGadget::binary::TParse_header_block::parse_next(void const** param_0, u32 param_1) {
|
||||
nofralloc
|
||||
#include "asm/JSystem/JGadget/binary/parse_next__Q37JGadget6binary19TParse_header_blockFPPCvUl.s"
|
||||
bool JGadget::binary::TParse_header_block::parse_next(void const** ptrLocation, u32 idx) {
|
||||
u32 headerEnd, blockEnd;
|
||||
|
||||
if ((ptrLocation == NULL) || (*ptrLocation == NULL)) {
|
||||
return false;
|
||||
}
|
||||
bool check, checkLastBlock;
|
||||
checkLastBlock = check = false;
|
||||
|
||||
check = checkNext(ptrLocation, &headerEnd, idx);
|
||||
|
||||
checkLastBlock = check;
|
||||
if (!(idx & 1) && (check == false)) {
|
||||
return check;
|
||||
}
|
||||
|
||||
while (headerEnd > 0) {
|
||||
check = false;
|
||||
if (parseBlock_next(ptrLocation, &blockEnd, idx) && checkLastBlock) {
|
||||
check = true;
|
||||
}
|
||||
checkLastBlock = check;
|
||||
if (((idx & 2) == 0) && (check == false)) {
|
||||
return check;
|
||||
}
|
||||
headerEnd--;
|
||||
}
|
||||
return checkLastBlock;
|
||||
}
|
||||
#pragma pop
|
||||
|
|
|
|||
Loading…
Reference in New Issue