mirror of
https://github.com/zeldaret/tww.git
synced 2026-09-08 19:32:27 -04:00
JKRStdHeap, JKRArchive match
This commit is contained in:
@@ -168,21 +168,22 @@ void* JKRArchive::getResource(u32 type, const char* path) {
|
||||
|
||||
/* 802B8528-802B85F0 .text readTypeResource__10JKRArchiveFPvUlUlPCcP10JKRArchive */
|
||||
// missing instructions
|
||||
void JKRArchive::readTypeResource(void* buffer, u32 bufferSize, u32 type, const char* path, JKRArchive* archive) {
|
||||
/* Nonmatching */
|
||||
u32 JKRArchive::readTypeResource(void* buffer, u32 bufferSize, u32 type, const char* path, JKRArchive* archive) {
|
||||
u32 ret = 0;
|
||||
|
||||
if (archive) {
|
||||
archive->readResource(buffer, bufferSize, type, path);
|
||||
return;
|
||||
}
|
||||
JSUListIterator<JKRFileLoader> iterator;
|
||||
for (iterator = sVolumeList.getFirst(); iterator != sVolumeList.getEnd(); iterator++) {
|
||||
if (iterator->getVolumeType() == 'RARC') {
|
||||
u32 result = iterator->readResource(buffer, bufferSize, type, path);
|
||||
if (result != 0) {
|
||||
return;
|
||||
ret = archive->readResource(buffer, bufferSize, type, path);
|
||||
} else {
|
||||
for (JSUListIterator<JKRFileLoader> it = sVolumeList.getFirst(); it != sVolumeList.getEnd(); it++) {
|
||||
if (it->getVolumeType() == 'RARC') {
|
||||
ret = it->readResource(buffer, bufferSize, type, path);
|
||||
if (ret != 0)
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* 802B85F0-802B86DC .text readResource__10JKRArchiveFPvUlUlPCc */
|
||||
|
||||
@@ -24,10 +24,10 @@ JKRStdHeap* JKRStdHeap::create(u32 size, JKRHeap* parent, bool errorFlag) {
|
||||
}
|
||||
u8* memory = (u8*)JKRAllocFromHeap(parent, alignedSize, 0x20);
|
||||
u32 stdHeapSize = ALIGN_NEXT(sizeof(JKRStdHeap), 0x20);
|
||||
u8* dataPtr = (memory + stdHeapSize);
|
||||
if (!memory) {
|
||||
return NULL;
|
||||
}
|
||||
u8* dataPtr = (memory + stdHeapSize);
|
||||
JKRStdHeap* newHeap = new(memory) JKRStdHeap(dataPtr, alignedSize - stdHeapSize, parent, errorFlag);
|
||||
return newHeap;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user