mirror of
https://github.com/encounter/tp.git
synced 2026-07-11 06:18:46 -07:00
more various JSystem work (#2046)
* most of J3DAnmLoader done * J3D / JKernel / JUTConsole work * remove asm * fix build * dol 50%
This commit is contained in:
@@ -1,46 +1,27 @@
|
||||
//
|
||||
// Generated By: dol2asm
|
||||
// Translation Unit: JKRAram
|
||||
//
|
||||
|
||||
#include "JSystem/JKernel/JKRAram.h"
|
||||
#include "JSystem/JKernel/JKRAramPiece.h"
|
||||
#include "JSystem/JKernel/JKRAramStream.h"
|
||||
#include "JSystem/JKernel/JKRDecomp.h"
|
||||
#include "JSystem/JKernel/JKRExpHeap.h"
|
||||
#include "JSystem/JUtility/JUTException.h"
|
||||
#include "string.h"
|
||||
#include "dolphin/ar.h"
|
||||
#include "dolphin/os/OSCache.h"
|
||||
#include "dolphin/os/OSInterrupt.h"
|
||||
#include "global.h"
|
||||
|
||||
//
|
||||
// Forward References:
|
||||
//
|
||||
#include "string.h"
|
||||
|
||||
static u8* firstSrcData();
|
||||
static u8* nextSrcData(u8* param_0);
|
||||
static int JKRDecompressFromAramToMainRam(u32 src, void* dst, u32 srcLength, u32 dstLength, u32 offset,
|
||||
u32* resourceSize);
|
||||
int decompSZS_subroutine(u8 *src, u8 *dest);
|
||||
static int JKRDecompressFromAramToMainRam(u32 src, void* dst, u32 srcLength, u32 dstLength,
|
||||
u32 offset, u32* resourceSize);
|
||||
int decompSZS_subroutine(u8* src, u8* dest);
|
||||
|
||||
//
|
||||
// External References:
|
||||
//
|
||||
|
||||
|
||||
//
|
||||
// Declarations:
|
||||
//
|
||||
|
||||
/* ############################################################################################## */
|
||||
/* 804513C8-804513CC 0008C8 0004+00 3/3 9/9 0/0 .sbss sAramObject__7JKRAram */
|
||||
JKRAram* JKRAram::sAramObject;
|
||||
|
||||
/* 802D1FA4-802D2040 2CC8E4 009C+00 0/0 1/1 0/0 .text create__7JKRAramFUlUllll */
|
||||
JKRAram* JKRAram::create(u32 aram_audio_buffer_size, u32 aram_audio_graph_size,
|
||||
s32 stream_priority, s32 decomp_priority, s32 piece_priority) {
|
||||
JKRAram* JKRAram::create(u32 aram_audio_buffer_size, u32 aram_audio_graph_size, s32 stream_priority,
|
||||
s32 decomp_priority, s32 piece_priority) {
|
||||
if (!sAramObject) {
|
||||
sAramObject = new (JKRHeap::getSystemHeap(), 0)
|
||||
JKRAram(aram_audio_buffer_size, aram_audio_graph_size, piece_priority);
|
||||
@@ -144,11 +125,15 @@ void JKRAram::changeGroupIdIfNeed(u8* data, int groupId) {
|
||||
|
||||
/* 802D233C-802D25B4 2CCC7C 0278+00 0/0 3/3 0/0 .text
|
||||
* mainRamToAram__7JKRAramFPUcUlUl15JKRExpandSwitchUlP7JKRHeapiPUl */
|
||||
JKRAramBlock *JKRAram::mainRamToAram(u8 *buf, u32 bufSize, u32 alignedSize, JKRExpandSwitch expandSwitch, u32 fileSize, JKRHeap *heap, int id, u32 *pSize) {
|
||||
JKRAramBlock *block = NULL;
|
||||
JKRAramBlock* JKRAram::mainRamToAram(u8* buf, u32 bufSize, u32 alignedSize,
|
||||
JKRExpandSwitch expandSwitch, u32 fileSize, JKRHeap* heap,
|
||||
int id, u32* pSize) {
|
||||
JKRAramBlock* block = NULL;
|
||||
checkOkAddress(buf, bufSize, NULL, 0);
|
||||
if (expandSwitch == EXPAND_SWITCH_UNKNOWN1) {
|
||||
expandSwitch = (JKRCheckCompressed_noASR(buf) == COMPRESSION_NONE) ? EXPAND_SWITCH_UNKNOWN0 : EXPAND_SWITCH_UNKNOWN1;
|
||||
expandSwitch = (JKRCheckCompressed_noASR(buf) == COMPRESSION_NONE) ?
|
||||
EXPAND_SWITCH_UNKNOWN0 :
|
||||
EXPAND_SWITCH_UNKNOWN1;
|
||||
}
|
||||
if (expandSwitch == EXPAND_SWITCH_UNKNOWN1) {
|
||||
u32 expandSize = JKRDecompExpandSize(buf);
|
||||
@@ -156,7 +141,8 @@ JKRAramBlock *JKRAram::mainRamToAram(u8 *buf, u32 bufSize, u32 alignedSize, JKRE
|
||||
fileSize = ALIGN_NEXT(expandSize, 32);
|
||||
}
|
||||
if (bufSize == 0) {
|
||||
JKRAramBlock* allocatedBlock = (JKRAramBlock*)JKRAllocFromAram(fileSize, JKRAramHeap::HEAD);
|
||||
JKRAramBlock* allocatedBlock =
|
||||
(JKRAramBlock*)JKRAllocFromAram(fileSize, JKRAramHeap::HEAD);
|
||||
block = (JKRAramBlock*)allocatedBlock;
|
||||
if (allocatedBlock == NULL)
|
||||
return NULL;
|
||||
@@ -170,29 +156,27 @@ JKRAramBlock *JKRAram::mainRamToAram(u8 *buf, u32 bufSize, u32 alignedSize, JKRE
|
||||
if (alignedSize > fileSize)
|
||||
alignedSize = fileSize;
|
||||
|
||||
void *allocatedMem = JKRAllocFromHeap(heap, fileSize, -32);
|
||||
void* allocatedMem = JKRAllocFromHeap(heap, fileSize, -32);
|
||||
if (allocatedMem == NULL) {
|
||||
if (block != NULL) {
|
||||
JKRFreeToAram(block);
|
||||
}
|
||||
block = NULL;
|
||||
}
|
||||
else {
|
||||
JKRDecompress(buf, (u8 *)allocatedMem, fileSize, 0);
|
||||
} else {
|
||||
JKRDecompress(buf, (u8*)allocatedMem, fileSize, 0);
|
||||
JKRAramPcs(0, (u32)allocatedMem, bufSize, alignedSize, block);
|
||||
JKRFreeToHeap(heap, allocatedMem);
|
||||
block = block == NULL ? (JKRAramBlock *)-1 : block;
|
||||
block = block == NULL ? (JKRAramBlock*)-1 : block;
|
||||
if (pSize != NULL) {
|
||||
*pSize = alignedSize;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
if (fileSize != 0 && alignedSize > fileSize)
|
||||
alignedSize = fileSize;
|
||||
if (bufSize == 0) {
|
||||
|
||||
JKRAramBlock* allocatedBlock = (JKRAramBlock*)JKRAllocFromAram(alignedSize, JKRAramHeap::HEAD);
|
||||
JKRAramBlock* allocatedBlock =
|
||||
(JKRAramBlock*)JKRAllocFromAram(alignedSize, JKRAramHeap::HEAD);
|
||||
block = allocatedBlock;
|
||||
block->newGroupID(decideAramGroupId(id));
|
||||
if (block == NULL)
|
||||
@@ -202,7 +186,7 @@ JKRAramBlock *JKRAram::mainRamToAram(u8 *buf, u32 bufSize, u32 alignedSize, JKRE
|
||||
}
|
||||
|
||||
JKRAramPcs(0, (u32)buf, bufSize, alignedSize, block);
|
||||
block = block == NULL ? (JKRAramBlock *)-1 : block;
|
||||
block = block == NULL ? (JKRAramBlock*)-1 : block;
|
||||
if (pSize != NULL)
|
||||
*pSize = alignedSize;
|
||||
}
|
||||
@@ -211,7 +195,8 @@ JKRAramBlock *JKRAram::mainRamToAram(u8 *buf, u32 bufSize, u32 alignedSize, JKRE
|
||||
|
||||
/* 802D25B4-802D2830 2CCEF4 027C+00 0/0 6/6 0/0 .text
|
||||
* aramToMainRam__7JKRAramFUlPUcUl15JKRExpandSwitchUlP7JKRHeapiPUl */
|
||||
u8 *JKRAram::aramToMainRam(u32 address, u8 *buf, u32 p3, JKRExpandSwitch expandSwitch, u32 p5, JKRHeap *heap, int id, u32 *pSize) {
|
||||
u8* JKRAram::aramToMainRam(u32 address, u8* buf, u32 p3, JKRExpandSwitch expandSwitch, u32 p5,
|
||||
JKRHeap* heap, int id, u32* pSize) {
|
||||
JKRCompression compression = COMPRESSION_NONE;
|
||||
if (pSize != NULL)
|
||||
*pSize = 0;
|
||||
@@ -221,18 +206,19 @@ u8 *JKRAram::aramToMainRam(u32 address, u8 *buf, u32 p3, JKRExpandSwitch expandS
|
||||
u32 expandSize;
|
||||
if (expandSwitch == EXPAND_SWITCH_UNKNOWN1) {
|
||||
u8 buffer[64];
|
||||
u8 *bufPtr = (u8 *)ALIGN_NEXT((u32)buffer, 32);
|
||||
JKRAramPcs(1, address, (u32)bufPtr, sizeof(buffer) / 2, NULL); // probably change sizeof(buffer) / 2 to 32
|
||||
u8* bufPtr = (u8*)ALIGN_NEXT((u32)buffer, 32);
|
||||
JKRAramPcs(1, address, (u32)bufPtr, sizeof(buffer) / 2,
|
||||
NULL); // probably change sizeof(buffer) / 2 to 32
|
||||
compression = JKRCheckCompressed_noASR(bufPtr);
|
||||
expandSize = JKRDecompExpandSize(bufPtr);
|
||||
}
|
||||
|
||||
if (compression == COMPRESSION_YAZ0) { // SZS
|
||||
if (compression == COMPRESSION_YAZ0) { // SZS
|
||||
if (p5 != 0 && p5 < expandSize)
|
||||
expandSize = p5;
|
||||
|
||||
if (buf == NULL)
|
||||
buf = (u8 *)JKRAllocFromHeap(heap, expandSize, 32);
|
||||
buf = (u8*)JKRAllocFromHeap(heap, expandSize, 32);
|
||||
if (buf == NULL)
|
||||
return NULL;
|
||||
else {
|
||||
@@ -240,20 +226,18 @@ u8 *JKRAram::aramToMainRam(u32 address, u8 *buf, u32 p3, JKRExpandSwitch expandS
|
||||
JKRDecompressFromAramToMainRam(address, buf, p3, expandSize, 0, pSize);
|
||||
return buf;
|
||||
}
|
||||
}
|
||||
else if (compression == COMPRESSION_YAY0) { // SZP
|
||||
u8 *szpSpace = (u8 *)JKRAllocFromHeap(heap, p3, -32);
|
||||
} else if (compression == COMPRESSION_YAY0) { // SZP
|
||||
u8* szpSpace = (u8*)JKRAllocFromHeap(heap, p3, -32);
|
||||
if (szpSpace == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
JKRAramPcs(1, address, (u32)szpSpace, p3, NULL);
|
||||
if (p5 != 0 && p5 < expandSize)
|
||||
expandSize = p5;
|
||||
|
||||
u8* rv;
|
||||
if (buf == NULL) {
|
||||
rv = (u8 *)JKRAllocFromHeap(heap, expandSize, 32);
|
||||
rv = (u8*)JKRAllocFromHeap(heap, expandSize, 32);
|
||||
} else {
|
||||
rv = buf;
|
||||
}
|
||||
@@ -261,8 +245,7 @@ u8 *JKRAram::aramToMainRam(u32 address, u8 *buf, u32 p3, JKRExpandSwitch expandS
|
||||
if (rv == NULL) {
|
||||
i_JKRFree(szpSpace);
|
||||
return NULL;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
changeGroupIdIfNeed(rv, id);
|
||||
JKRDecompress(szpSpace, rv, expandSize, 0);
|
||||
JKRFreeToHeap(heap, szpSpace);
|
||||
@@ -272,14 +255,12 @@ u8 *JKRAram::aramToMainRam(u32 address, u8 *buf, u32 p3, JKRExpandSwitch expandS
|
||||
return rv;
|
||||
}
|
||||
}
|
||||
}
|
||||
else { // Not compressed or ASR
|
||||
} else { // Not compressed or ASR
|
||||
if (buf == NULL)
|
||||
buf = (u8 *)JKRAllocFromHeap(heap, p3, 32);
|
||||
buf = (u8*)JKRAllocFromHeap(heap, p3, 32);
|
||||
if (buf == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
changeGroupIdIfNeed(buf, id);
|
||||
JKRAramPcs(1, address, (u32)buf, p3, NULL);
|
||||
if (pSize != NULL) {
|
||||
@@ -346,8 +327,8 @@ static u32 tsArea;
|
||||
|
||||
/* 802D2830-802D29A0 2CD170 0170+00 1/1 0/0 0/0 .text
|
||||
* JKRDecompressFromAramToMainRam__FUlPvUlUlUlPUl */
|
||||
static int JKRDecompressFromAramToMainRam(u32 src, void* dst, u32 srcLength, u32 dstLength, u32 offset,
|
||||
u32* resourceSize) {
|
||||
static int JKRDecompressFromAramToMainRam(u32 src, void* dst, u32 srcLength, u32 dstLength,
|
||||
u32 offset, u32* resourceSize) {
|
||||
BOOL interrupts = OSDisableInterrupts();
|
||||
if (s_is_decompress_mutex_initialized == false) {
|
||||
OSInitMutex(&decompMutex);
|
||||
@@ -357,15 +338,14 @@ static int JKRDecompressFromAramToMainRam(u32 src, void* dst, u32 srcLength, u32
|
||||
OSLockMutex(&decompMutex);
|
||||
|
||||
u32 szsBufferSize = JKRAram::getSZSBufferSize();
|
||||
szpBuf = (u8 *)JKRAllocFromSysHeap(szsBufferSize, 32);
|
||||
szpBuf = (u8*)JKRAllocFromSysHeap(szsBufferSize, 32);
|
||||
|
||||
szpEnd = szpBuf + szsBufferSize;
|
||||
if (offset != 0) {
|
||||
refBuf = (u8 *)JKRAllocFromSysHeap(0x1120, 0);
|
||||
refBuf = (u8*)JKRAllocFromSysHeap(0x1120, 0);
|
||||
refEnd = refBuf + 0x1120;
|
||||
refCurrent = refBuf;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
refBuf = NULL;
|
||||
}
|
||||
srcAddress = src;
|
||||
@@ -377,7 +357,7 @@ static int JKRDecompressFromAramToMainRam(u32 src, void* dst, u32 srcLength, u32
|
||||
tsPtr = (resourceSize != 0) ? resourceSize : &tsArea;
|
||||
*tsPtr = 0;
|
||||
|
||||
decompSZS_subroutine(firstSrcData(), (u8 *)dst);
|
||||
decompSZS_subroutine(firstSrcData(), (u8*)dst);
|
||||
i_JKRFree(szpBuf);
|
||||
if (refBuf) {
|
||||
i_JKRFree(refBuf);
|
||||
@@ -390,8 +370,8 @@ static int JKRDecompressFromAramToMainRam(u32 src, void* dst, u32 srcLength, u32
|
||||
}
|
||||
|
||||
/* 802D29A0-802D2C40 2CD2E0 02A0+00 1/1 0/0 0/0 .text decompSZS_subroutine__FPUcPUc */
|
||||
int decompSZS_subroutine(u8 *src, u8 *dest) {
|
||||
u8 *endPtr;
|
||||
int decompSZS_subroutine(u8* src, u8* dest) {
|
||||
u8* endPtr;
|
||||
s32 validBitCount = 0;
|
||||
s32 currCodeByte = 0;
|
||||
u32 ts = 0;
|
||||
@@ -400,7 +380,7 @@ int decompSZS_subroutine(u8 *src, u8 *dest) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
SYaz0Header *header = (SYaz0Header *)src;
|
||||
SYaz0Header* header = (SYaz0Header*)src;
|
||||
endPtr = dest + (header->length - fileOffset);
|
||||
if (endPtr > dest + maxDest) {
|
||||
endPtr = dest + maxDest;
|
||||
@@ -422,8 +402,7 @@ int decompSZS_subroutine(u8 *src, u8 *dest) {
|
||||
*dest = *src;
|
||||
dest++;
|
||||
ts++;
|
||||
if (dest == endPtr)
|
||||
{
|
||||
if (dest == endPtr) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -432,8 +411,7 @@ int decompSZS_subroutine(u8 *src, u8 *dest) {
|
||||
refCurrent = refBuf;
|
||||
}
|
||||
src++;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
*dest = *src;
|
||||
dest++;
|
||||
src++;
|
||||
@@ -443,26 +421,23 @@ int decompSZS_subroutine(u8 *src, u8 *dest) {
|
||||
}
|
||||
}
|
||||
readCount++;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
u32 dist = ((src[0] & 0x0f) << 8) | src[1];
|
||||
s32 numBytes = src[0] >> 4;
|
||||
src += 2;
|
||||
u8 *copySource;
|
||||
u8* copySource;
|
||||
if (fileOffset != 0) {
|
||||
copySource = refCurrent - dist - 1;
|
||||
if (copySource < refBuf) {
|
||||
copySource += refEnd - refBuf;
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
copySource = dest - dist - 1;
|
||||
}
|
||||
if (numBytes == 0) {
|
||||
numBytes = *src + 0x12;
|
||||
src += 1;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
numBytes += 2;
|
||||
}
|
||||
if (fileOffset != 0) {
|
||||
@@ -486,8 +461,7 @@ int decompSZS_subroutine(u8 *src, u8 *dest) {
|
||||
readCount++;
|
||||
numBytes--;
|
||||
} while (numBytes != 0);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
do {
|
||||
*dest = *copySource;
|
||||
dest++;
|
||||
@@ -536,8 +510,8 @@ static u8* firstSrcData() {
|
||||
}
|
||||
|
||||
/* 802D2CE4-802D2DAC 2CD624 00C8+00 1/1 0/0 0/0 .text nextSrcData__FPUc */
|
||||
static u8 *nextSrcData(u8 *current) {
|
||||
u8 *dest;
|
||||
static u8* nextSrcData(u8* current) {
|
||||
u8* dest;
|
||||
u32 left = (u32)(szpEnd - current);
|
||||
if (IS_NOT_ALIGNED(left, 0x20))
|
||||
dest = szpBuf + 0x20 - (left & (0x20 - 1));
|
||||
|
||||
@@ -10,11 +10,11 @@
|
||||
#include "JSystem/JKernel/JKRDvdFile.h"
|
||||
#include "JSystem/JUtility/JUTAssert.h"
|
||||
#include "JSystem/JUtility/JUTException.h"
|
||||
#include "math.h"
|
||||
#include "string.h"
|
||||
#include "dol2asm.h"
|
||||
#include "dolphin/os/OSCache.h"
|
||||
#include "global.h"
|
||||
#include "math.h"
|
||||
#include "string.h"
|
||||
|
||||
//
|
||||
// Forward References:
|
||||
@@ -162,54 +162,52 @@ bool JKRAramArchive::open(s32 entryNum) {
|
||||
mStringTable = NULL;
|
||||
mBlock = NULL;
|
||||
|
||||
mDvdFile = new (JKRGetSystemHeap(), mMountDirection == MOUNT_DIRECTION_HEAD ? 4 : -4) JKRDvdFile(entryNum);
|
||||
if (mDvdFile == NULL)
|
||||
{
|
||||
mDvdFile = new (JKRGetSystemHeap(), mMountDirection == MOUNT_DIRECTION_HEAD ? 4 : -4)
|
||||
JKRDvdFile(entryNum);
|
||||
if (mDvdFile == NULL) {
|
||||
mMountMode = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
// NOTE: a different struct is used here for sure, unfortunately i can't get any hits on this address, so gonna leave it like this for now
|
||||
SArcHeader *mem = (SArcHeader *)JKRAllocFromSysHeap(32, -32);
|
||||
if (mem == NULL) {
|
||||
// NOTE: a different struct is used here for sure, unfortunately i can't get any hits on this
|
||||
// address, so gonna leave it like this for now
|
||||
SArcHeader* mem = (SArcHeader*)JKRAllocFromSysHeap(32, -32);
|
||||
if (mem == NULL) {
|
||||
mMountMode = 0;
|
||||
}
|
||||
else {
|
||||
JKRDvdToMainRam(entryNum, (u8 *)mem, EXPAND_SWITCH_UNKNOWN1, 32, NULL, JKRDvdRipper::ALLOC_DIRECTION_FORWARD, 0, &mCompression, NULL);
|
||||
} else {
|
||||
JKRDvdToMainRam(entryNum, (u8*)mem, EXPAND_SWITCH_UNKNOWN1, 32, NULL,
|
||||
JKRDvdRipper::ALLOC_DIRECTION_FORWARD, 0, &mCompression, NULL);
|
||||
DCInvalidateRange(mem, 32);
|
||||
int alignment = mMountDirection == MOUNT_DIRECTION_HEAD ? 32 : -32;
|
||||
u32 alignedSize = ALIGN_NEXT(mem->file_data_offset, 32);
|
||||
mArcInfoBlock = (SArcDataInfo *)JKRAllocFromHeap(mHeap, alignedSize, alignment);
|
||||
mArcInfoBlock = (SArcDataInfo*)JKRAllocFromHeap(mHeap, alignedSize, alignment);
|
||||
if (mArcInfoBlock == NULL) {
|
||||
mMountMode = 0;
|
||||
}
|
||||
else {
|
||||
JKRDvdToMainRam(entryNum, (u8 *)mArcInfoBlock, EXPAND_SWITCH_UNKNOWN1, alignedSize, NULL, JKRDvdRipper::ALLOC_DIRECTION_FORWARD, 32, NULL, NULL);
|
||||
} else {
|
||||
JKRDvdToMainRam(entryNum, (u8*)mArcInfoBlock, EXPAND_SWITCH_UNKNOWN1, alignedSize, NULL,
|
||||
JKRDvdRipper::ALLOC_DIRECTION_FORWARD, 32, NULL, NULL);
|
||||
DCInvalidateRange(mArcInfoBlock, alignedSize);
|
||||
|
||||
mNodes = (SDIDirEntry *)((u8 *)mArcInfoBlock + mArcInfoBlock->node_offset);
|
||||
mFiles = (SDIFileEntry *)((u8 *)mArcInfoBlock + mArcInfoBlock->file_entry_offset);
|
||||
mStringTable = (char *)((u8 *)mArcInfoBlock + mArcInfoBlock->string_table_offset);
|
||||
mNodes = (SDIDirEntry*)((u8*)mArcInfoBlock + mArcInfoBlock->node_offset);
|
||||
mFiles = (SDIFileEntry*)((u8*)mArcInfoBlock + mArcInfoBlock->file_entry_offset);
|
||||
mStringTable = (char*)((u8*)mArcInfoBlock + mArcInfoBlock->string_table_offset);
|
||||
mExpandedSize = NULL;
|
||||
|
||||
u8 compressedFiles = 0; // maybe a check for if the last file is compressed?
|
||||
u8 compressedFiles = 0; // maybe a check for if the last file is compressed?
|
||||
|
||||
SDIFileEntry *fileEntry = mFiles;
|
||||
for (int i = 0; i < mArcInfoBlock->num_file_entries; i++)
|
||||
{
|
||||
SDIFileEntry* fileEntry = mFiles;
|
||||
for (int i = 0; i < mArcInfoBlock->num_file_entries; i++) {
|
||||
u8 flag = fileEntry->type_flags_and_name_offset >> 24;
|
||||
if ((flag & 1))
|
||||
{
|
||||
if ((flag & 1)) {
|
||||
compressedFiles |= (flag & JKRARCHIVE_ATTR_COMPRESSION);
|
||||
}
|
||||
fileEntry++;
|
||||
}
|
||||
|
||||
if (compressedFiles != 0)
|
||||
{
|
||||
mExpandedSize = (s32 *)JKRAllocFromHeap(mHeap, mArcInfoBlock->num_file_entries << 2, abs(alignment));
|
||||
if (mExpandedSize == NULL)
|
||||
{
|
||||
if (compressedFiles != 0) {
|
||||
mExpandedSize = (s32*)JKRAllocFromHeap(mHeap, mArcInfoBlock->num_file_entries << 2,
|
||||
abs(alignment));
|
||||
if (mExpandedSize == NULL) {
|
||||
i_JKRFree(mArcInfoBlock);
|
||||
mMountMode = 0;
|
||||
goto cleanup;
|
||||
@@ -218,34 +216,32 @@ bool JKRAramArchive::open(s32 entryNum) {
|
||||
}
|
||||
|
||||
u32 aramSize = ALIGN_NEXT(mem->file_data_length, 32);
|
||||
mBlock = (JKRAramBlock*) JKRAllocFromAram(aramSize, mMountDirection == MOUNT_DIRECTION_HEAD ? JKRAramHeap::HEAD : JKRAramHeap::TAIL);
|
||||
if(mBlock == NULL) {
|
||||
mBlock = (JKRAramBlock*)JKRAllocFromAram(
|
||||
aramSize,
|
||||
mMountDirection == MOUNT_DIRECTION_HEAD ? JKRAramHeap::HEAD : JKRAramHeap::TAIL);
|
||||
if (mBlock == NULL) {
|
||||
if (mArcInfoBlock) {
|
||||
i_JKRFree(mArcInfoBlock);
|
||||
}
|
||||
if(mExpandedSize) {
|
||||
if (mExpandedSize) {
|
||||
i_JKRFree(mExpandedSize);
|
||||
}
|
||||
mMountMode = 0;
|
||||
} else {
|
||||
JKRDvdToAram(entryNum, mBlock->getAddress(), EXPAND_SWITCH_UNKNOWN1,
|
||||
mem->header_length + mem->file_data_offset, 0, NULL);
|
||||
}
|
||||
else {
|
||||
JKRDvdToAram(entryNum, mBlock->getAddress(), EXPAND_SWITCH_UNKNOWN1, mem->header_length + mem->file_data_offset, 0, NULL);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
cleanup:
|
||||
if (mem != NULL)
|
||||
{
|
||||
if (mem != NULL) {
|
||||
JKRFreeToSysHeap(mem);
|
||||
}
|
||||
if (mMountMode == 0)
|
||||
{
|
||||
if (mMountMode == 0) {
|
||||
#ifdef DEBUG
|
||||
OSReport(":::[%s: %d] Cannot alloc memory\n", __FILE__, 415);
|
||||
#endif
|
||||
if (mDvdFile != NULL)
|
||||
{
|
||||
if (mDvdFile != NULL) {
|
||||
delete mDvdFile;
|
||||
}
|
||||
return false;
|
||||
@@ -291,7 +287,6 @@ void* JKRAramArchive::fetchResource(SDIFileEntry* pEntry, u32* pOutSize) {
|
||||
|
||||
/* 802D76F4-802D77F8 2D2034 0104+00 1/0 0/0 0/0 .text
|
||||
* fetchResource__14JKRAramArchiveFPvUlPQ210JKRArchive12SDIFileEntryPUl */
|
||||
#ifdef NONMATCHING
|
||||
void* JKRAramArchive::fetchResource(void* buffer, u32 bufferSize, SDIFileEntry* pEntry,
|
||||
u32* resourceSize) {
|
||||
JUT_ASSERT(515, isMounted());
|
||||
@@ -299,10 +294,10 @@ void* JKRAramArchive::fetchResource(void* buffer, u32 bufferSize, SDIFileEntry*
|
||||
if (size > bufferSize) {
|
||||
size = bufferSize;
|
||||
}
|
||||
|
||||
JKRCompression compression = JKRConvertAttrToCompressionType(pEntry->getFlags());
|
||||
if (pEntry->data == NULL) {
|
||||
// can't get it to store the result in r28
|
||||
bufferSize &= ~(0x20 - 1);
|
||||
bufferSize = (s32)ALIGN_PREV(bufferSize, 0x20);
|
||||
size = JKRAramArchive::fetchResource_subroutine(pEntry->data_offset + mBlock->getAddress(),
|
||||
size, (u8*)buffer, bufferSize, compression);
|
||||
} else {
|
||||
@@ -317,22 +312,12 @@ void* JKRAramArchive::fetchResource(void* buffer, u32 bufferSize, SDIFileEntry*
|
||||
}
|
||||
JKRHeap::copyMemory(buffer, pEntry->data, size);
|
||||
}
|
||||
|
||||
if (resourceSize != NULL) {
|
||||
*resourceSize = size;
|
||||
}
|
||||
return buffer;
|
||||
}
|
||||
#else
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm void* JKRAramArchive::fetchResource(void* param_0, u32 param_1,
|
||||
JKRArchive::SDIFileEntry* param_2, u32* param_3) {
|
||||
nofralloc
|
||||
#include "asm/JSystem/JKernel/JKRAramArchive/fetchResource__14JKRAramArchiveFPvUlPQ210JKRArchive12SDIFileEntryPUl.s"
|
||||
}
|
||||
#pragma pop
|
||||
#endif
|
||||
|
||||
/* 802D77F8-802D781C 2D2138 0024+00 1/1 0/0 0/0 .text
|
||||
* getAramAddress_Entry__14JKRAramArchiveFPQ210JKRArchive12SDIFileEntry */
|
||||
@@ -354,7 +339,7 @@ u32 JKRAramArchive::getAramAddress(char const* name) {
|
||||
* fetchResource_subroutine__14JKRAramArchiveFUlUlPUcUli */
|
||||
u32 JKRAramArchive::fetchResource_subroutine(u32 srcAram, u32 srcLength, u8* dst, u32 dstLength,
|
||||
int compression) {
|
||||
JUT_ASSERT(628, ( srcAram & 0x1f ) == 0);
|
||||
JUT_ASSERT(628, (srcAram & 0x1f) == 0);
|
||||
u32 outLen;
|
||||
u32 srcSize = ALIGN_NEXT(srcLength, 0x20);
|
||||
u32 dstSize = ALIGN_PREV(dstLength, 0x20);
|
||||
@@ -364,13 +349,11 @@ u32 JKRAramArchive::fetchResource_subroutine(u32 srcAram, u32 srcLength, u8* dst
|
||||
if (srcSize > dstSize) {
|
||||
srcSize = dstSize;
|
||||
}
|
||||
JKRAramToMainRam(srcAram, dst, srcSize, EXPAND_SWITCH_UNKNOWN0, dstSize, NULL, -1,
|
||||
&outLen);
|
||||
JKRAramToMainRam(srcAram, dst, srcSize, EXPAND_SWITCH_UNKNOWN0, dstSize, NULL, -1, &outLen);
|
||||
return outLen;
|
||||
case COMPRESSION_YAY0:
|
||||
case COMPRESSION_YAZ0:
|
||||
JKRAramToMainRam(srcAram, dst, srcSize, EXPAND_SWITCH_UNKNOWN1, dstSize, NULL, -1,
|
||||
&outLen);
|
||||
JKRAramToMainRam(srcAram, dst, srcSize, EXPAND_SWITCH_UNKNOWN1, dstSize, NULL, -1, &outLen);
|
||||
return outLen;
|
||||
default:
|
||||
JUTException::panic(__FILE__, 655, "??? bad sequence\n");
|
||||
@@ -380,50 +363,39 @@ u32 JKRAramArchive::fetchResource_subroutine(u32 srcAram, u32 srcLength, u8* dst
|
||||
|
||||
/* 802D7914-802D7A64 2D2254 0150+00 1/1 1/1 0/0 .text
|
||||
* fetchResource_subroutine__14JKRAramArchiveFUlUlP7JKRHeapiPPUc */
|
||||
#ifdef NONMATCHING
|
||||
u32 JKRAramArchive::fetchResource_subroutine(u32 entryNum, u32 length, JKRHeap* pHeap,
|
||||
int compression, u8** out) {
|
||||
// r28 -> r29, r29 -> r30, r30 -> r31, r31 -> r28
|
||||
u32 readLen;
|
||||
u32 alignedLen = alignNext(length, 0x20);
|
||||
u32 alignedLen = ALIGN_NEXT(length, 0x20);
|
||||
|
||||
u8* buffer;
|
||||
switch (compression) {
|
||||
case COMPRESSION_NONE:
|
||||
buffer = static_cast<u8*>(JKRAllocFromHeap(pHeap, alignedLen, 0x20));
|
||||
JUT_ASSERT(677, buffer != 0);
|
||||
JKRAramToMainRam(entryNum, buffer, alignedLen, EXPAND_SWITCH_UNKNOWN0, alignedLen,
|
||||
NULL, -1, NULL);
|
||||
*out = buffer;
|
||||
return length;
|
||||
{
|
||||
buffer = (u8*)(JKRAllocFromHeap(pHeap, alignedLen, 0x20));
|
||||
JUT_ASSERT(677, buffer != 0);
|
||||
JKRAramToMainRam(entryNum, buffer, alignedLen, EXPAND_SWITCH_UNKNOWN0, alignedLen, NULL, -1, NULL);
|
||||
*out = buffer;
|
||||
return length;
|
||||
}
|
||||
case COMPRESSION_YAY0:
|
||||
case COMPRESSION_YAZ0:
|
||||
u8 tmpBuf[0x40];
|
||||
u8* buf = (u8*)ALIGN_PREV((s32)&tmpBuf[0x1F], sizeof(SArcHeader));
|
||||
JKRAramToMainRam(entryNum, buf, sizeof(SArcHeader), EXPAND_SWITCH_UNKNOWN0, 0, NULL, -1, NULL);
|
||||
length = alignNext(JKRDecompExpandSize(buf), sizeof(SArcHeader));
|
||||
buffer = static_cast<u8*>(JKRAllocFromHeap(pHeap, length, sizeof(SArcHeader)));
|
||||
JUT_ASSERT(703, buffer);
|
||||
|
||||
JKRAramToMainRam(entryNum, buffer, alignedLen, EXPAND_SWITCH_UNKNOWN1, length, pHeap,
|
||||
-1, &readLen);
|
||||
*out = buffer;
|
||||
return readLen;
|
||||
{
|
||||
u8 headerBuf[0x40];
|
||||
u8* alignHeader = (u8*)ALIGN_NEXT((s32)&headerBuf[0], sizeof(SArcHeader));
|
||||
JKRAramToMainRam(entryNum, alignHeader, sizeof(SArcHeader), EXPAND_SWITCH_UNKNOWN0, 0, NULL, -1, NULL);
|
||||
u32 decompressedLen = ALIGN_NEXT(JKRDecompExpandSize(alignHeader), sizeof(SArcHeader));
|
||||
buffer = (u8*)(JKRAllocFromHeap(pHeap, decompressedLen, sizeof(SArcHeader)));
|
||||
JUT_ASSERT(703, buffer);
|
||||
u32 readLen;
|
||||
JKRAramToMainRam(entryNum, buffer, alignedLen, EXPAND_SWITCH_UNKNOWN1, decompressedLen, pHeap, -1, &readLen);
|
||||
*out = buffer;
|
||||
return readLen;
|
||||
}
|
||||
default:
|
||||
JUTException::panic(__FILE__, 713, "??? bad sequence\n");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
#else
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm u32 JKRAramArchive::fetchResource_subroutine(u32 param_0, u32 param_1, JKRHeap* param_2,
|
||||
int param_3, u8** param_4) {
|
||||
nofralloc
|
||||
#include "asm/JSystem/JKernel/JKRAramArchive/fetchResource_subroutine__14JKRAramArchiveFUlUlP7JKRHeapiPPUc.s"
|
||||
}
|
||||
#pragma pop
|
||||
#endif
|
||||
|
||||
/* 802D7A64-802D7B90 2D23A4 012C+00 1/0 0/0 0/0 .text getExpandedResSize__14JKRAramArchiveCFPCv */
|
||||
u32 JKRAramArchive::getExpandedResSize(const void* ptr) const {
|
||||
@@ -447,8 +419,8 @@ u32 JKRAramArchive::getExpandedResSize(const void* ptr) const {
|
||||
|
||||
u8 tmpBuf[0x40];
|
||||
u8* buf = (u8*)ALIGN_PREV((s32)&tmpBuf[0x1F], 0x20);
|
||||
JKRAramToMainRam(entry->data_offset + mBlock->getAddress(), buf, 0x20,
|
||||
EXPAND_SWITCH_UNKNOWN0, 0, NULL, -1, NULL);
|
||||
JKRAramToMainRam(entry->data_offset + mBlock->getAddress(), buf, 0x20, EXPAND_SWITCH_UNKNOWN0,
|
||||
0, NULL, -1, NULL);
|
||||
expandSize = JKRDecompExpandSize(buf);
|
||||
// ??? casting away const?
|
||||
((JKRArchive*)this)->setExpandSize(entry, expandSize);
|
||||
|
||||
@@ -1,8 +1,3 @@
|
||||
//
|
||||
// Generated By: dol2asm
|
||||
// Translation Unit: JKRAramBlock
|
||||
//
|
||||
|
||||
#include "JSystem/JKernel/JKRAramBlock.h"
|
||||
#include "JSystem/JKernel/JKRAramHeap.h"
|
||||
#include "JSystem/JKernel/JKRHeap.h"
|
||||
|
||||
@@ -1,24 +1,7 @@
|
||||
//
|
||||
// Generated By: dol2asm
|
||||
// Translation Unit: JKRAramHeap
|
||||
//
|
||||
|
||||
#include "JSystem/JKernel/JKRAramHeap.h"
|
||||
#include "JSystem/JKernel/JKRHeap.h"
|
||||
#include "global.h"
|
||||
|
||||
//
|
||||
// Forward References:
|
||||
//
|
||||
|
||||
//
|
||||
// External References:
|
||||
//
|
||||
|
||||
//
|
||||
// Declarations:
|
||||
//
|
||||
|
||||
/* 8043430C-80434318 06102C 000C+00 8/8 0/0 0/0 .bss sAramList__11JKRAramHeap */
|
||||
JSUList<JKRAramBlock> JKRAramHeap::sAramList;
|
||||
|
||||
|
||||
@@ -1,8 +1,3 @@
|
||||
//
|
||||
// Generated By: dol2asm
|
||||
// Translation Unit: JKRAramPiece
|
||||
//
|
||||
|
||||
#include "JSystem/JKernel/JKRAramPiece.h"
|
||||
#include "JSystem/JKernel/JKRAram.h"
|
||||
#include "JSystem/JKernel/JKRDecomp.h"
|
||||
|
||||
@@ -1,8 +1,3 @@
|
||||
//
|
||||
// Generated By: dol2asm
|
||||
// Translation Unit: JKRAramStream
|
||||
//
|
||||
|
||||
#include "JSystem/JKernel/JKRAramStream.h"
|
||||
#include "JSystem/JKernel/JKRAramPiece.h"
|
||||
#include "JSystem/JSupport/JSUFileStream.h"
|
||||
|
||||
@@ -1,8 +1,3 @@
|
||||
//
|
||||
// Generated By: dol2asm
|
||||
// Translation Unit: JKRArchivePri
|
||||
//
|
||||
|
||||
#include "JSystem/JKernel/JKRArchive.h"
|
||||
#include "JSystem/JKernel/JKRHeap.h"
|
||||
#include "ctype.h"
|
||||
|
||||
@@ -1,8 +1,3 @@
|
||||
//
|
||||
// Generated By: dol2asm
|
||||
// Translation Unit: JKRArchivePub
|
||||
//
|
||||
|
||||
#include "JSystem/JKernel/JKRAramArchive.h"
|
||||
#include "JSystem/JKernel/JKRArchive.h"
|
||||
#include "JSystem/JKernel/JKRCompArchive.h"
|
||||
|
||||
@@ -1,8 +1,3 @@
|
||||
//
|
||||
// Generated By: dol2asm
|
||||
// Translation Unit: JKRAssertHeap
|
||||
//
|
||||
|
||||
#include "JSystem/JKernel/JKRAssertHeap.h"
|
||||
|
||||
/* 802D12C4-802D1300 2CBC04 003C+00 1/1 0/0 0/0 .text __ct__13JKRAssertHeapFPvUlP7JKRHeapb */
|
||||
|
||||
@@ -1,8 +1,3 @@
|
||||
//
|
||||
// Generated By: dol2asm
|
||||
// Translation Unit: JKRCompArchive
|
||||
//
|
||||
|
||||
#include "JSystem/JKernel/JKRCompArchive.h"
|
||||
#include "JSystem/JKernel/JKRAram.h"
|
||||
#include "JSystem/JKernel/JKRAramArchive.h"
|
||||
@@ -17,18 +12,6 @@
|
||||
#include "string.h"
|
||||
#include "dolphin/os/OSCache.h"
|
||||
|
||||
//
|
||||
// Forward References:
|
||||
//
|
||||
|
||||
//
|
||||
// External References:
|
||||
//
|
||||
|
||||
//
|
||||
// Declarations:
|
||||
//
|
||||
|
||||
/* 802D87D4-802D887C 2D3114 00A8+00 0/0 1/1 0/0 .text
|
||||
* __ct__14JKRCompArchiveFlQ210JKRArchive15EMountDirection */
|
||||
JKRCompArchive::JKRCompArchive(s32 entryNum, JKRArchive::EMountDirection eMountDirection)
|
||||
@@ -411,4 +394,3 @@ u32 JKRCompArchive::getExpandedResSize(const void *resource) const
|
||||
return expandSize;
|
||||
}
|
||||
|
||||
/* 8039D220-8039D220 029880 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */
|
||||
|
||||
@@ -1,15 +1,6 @@
|
||||
//
|
||||
// Generated By: dol2asm
|
||||
// Translation Unit: JKRDecomp
|
||||
//
|
||||
|
||||
#include "JSystem/JKernel/JKRDecomp.h"
|
||||
#include "JSystem/JKernel/JKRAramPiece.h"
|
||||
|
||||
//
|
||||
// Declarations:
|
||||
//
|
||||
|
||||
/* ############################################################################################## */
|
||||
/* 804514B0-804514B8 0009B0 0004+04 1/1 0/0 0/0 .sbss sDecompObject__9JKRDecomp */
|
||||
JKRDecomp* JKRDecomp::sDecompObject;
|
||||
|
||||
@@ -1,8 +1,3 @@
|
||||
//
|
||||
// Generated By: dol2asm
|
||||
// Translation Unit: JKRDisposer
|
||||
//
|
||||
|
||||
#include "JSystem/JKernel/JKRDisposer.h"
|
||||
#include "JSystem/JKernel/JKRHeap.h"
|
||||
|
||||
|
||||
@@ -1,42 +1,21 @@
|
||||
//
|
||||
// Generated By: dol2asm
|
||||
// Translation Unit: JKRDvdAramRipper
|
||||
//
|
||||
|
||||
#include "JSystem/JKernel/JKRDvdAramRipper.h"
|
||||
#include "JSystem/JKernel/JKRAram.h"
|
||||
#include "JSystem/JKernel/JKRAramPiece.h"
|
||||
#include "JSystem/JKernel/JKRAramStream.h"
|
||||
#include "JSystem/JKernel/JKRDecomp.h"
|
||||
#include "JSystem/JKernel/JKRDvdFile.h"
|
||||
#include "JSystem/JSupport/JSUFileStream.h"
|
||||
#include "dol2asm.h"
|
||||
#include "dolphin/os/OSCache.h"
|
||||
#include "dolphin/os/OSInterrupt.h"
|
||||
#include "dolphin/vi.h"
|
||||
#include "global.h"
|
||||
|
||||
//
|
||||
// Types:
|
||||
//
|
||||
|
||||
/* JSUList<JKRADCommand> */
|
||||
struct JSUList__template10 {
|
||||
/* 802DB62C */ void func_802DB62C(void* _this);
|
||||
};
|
||||
|
||||
struct JKRAramPiece {
|
||||
/* 802D3838 */ void orderSync(int, u32, u32, u32, JKRAramBlock*);
|
||||
};
|
||||
|
||||
//
|
||||
// Forward References:
|
||||
//
|
||||
#include "string.h"
|
||||
|
||||
static int JKRDecompressFromDVDToAram(JKRDvdFile*, u32, u32, u32, u32, u32, u32*);
|
||||
static int decompSZS_subroutine(u8*, u32);
|
||||
static u8* firstSrcData();
|
||||
static u8* nextSrcData(u8*);
|
||||
static int dmaBufferFlush(u32);
|
||||
static u32 dmaBufferFlush(u32);
|
||||
|
||||
extern "C" void __dt__18JSUFileInputStreamFv();
|
||||
extern "C" static int JKRDecompressFromDVDToAram__FP10JKRDvdFileUlUlUlUlUlPUl();
|
||||
@@ -53,7 +32,6 @@ extern "C" u32 sSZSBufferSize__16JKRDvdAramRipper;
|
||||
// External References:
|
||||
//
|
||||
|
||||
SECTION_INIT void memcpy();
|
||||
extern "C" void alloc__7JKRHeapFUli();
|
||||
extern "C" void free__7JKRHeapFPvP7JKRHeap();
|
||||
extern "C" void* __nw__FUlP7JKRHeapi();
|
||||
@@ -86,6 +64,7 @@ extern "C" extern void* __vt__20JSURandomInputStream[9];
|
||||
extern "C" extern void* __vt__18JSUFileInputStream[9 + 1 /* padding */];
|
||||
extern "C" u8 sSystemHeap__7JKRHeap[4];
|
||||
extern "C" u8 sAramObject__7JKRAram[4];
|
||||
extern "C" bool errorRetry__16JKRDvdAramRipper;
|
||||
|
||||
//
|
||||
// Declarations:
|
||||
@@ -93,8 +72,9 @@ extern "C" u8 sAramObject__7JKRAram[4];
|
||||
|
||||
/* 802DA874-802DA918 2D51B4 00A4+00 0/0 3/3 0/0 .text
|
||||
* loadToAram__16JKRDvdAramRipperFlUl15JKRExpandSwitchUlUlPUl */
|
||||
JKRAramBlock* JKRDvdAramRipper::loadToAram(s32 entryNumber, u32 address, JKRExpandSwitch expandSwitch,
|
||||
u32 param_3, u32 param_4, u32* param_5) {
|
||||
JKRAramBlock* JKRDvdAramRipper::loadToAram(s32 entryNumber, u32 address,
|
||||
JKRExpandSwitch expandSwitch, u32 param_3, u32 param_4,
|
||||
u32* param_5) {
|
||||
JKRDvdFile dvdFile;
|
||||
if (!dvdFile.open(entryNumber)) {
|
||||
return NULL;
|
||||
@@ -130,8 +110,9 @@ JKRAramBlock* JKRDvdAramRipper::loadToAram(JKRDvdFile* dvdFile, u32 address,
|
||||
/* 802DA9C0-802DAA74 2D5300 00B4+00 1/1 0/0 0/0 .text
|
||||
* loadToAram_Async__16JKRDvdAramRipperFP10JKRDvdFileUl15JKRExpandSwitchPFUl_vUlUlPUl */
|
||||
JKRADCommand* JKRDvdAramRipper::loadToAram_Async(JKRDvdFile* dvdFile, u32 address,
|
||||
JKRExpandSwitch expandSwitch, void (*callback)(u32),
|
||||
u32 param_4, u32 param_5, u32* param_6) {
|
||||
JKRExpandSwitch expandSwitch,
|
||||
void (*callback)(u32), u32 param_4, u32 param_5,
|
||||
u32* param_6) {
|
||||
JKRADCommand* command = new (JKRHeap::sSystemHeap, -4) JKRADCommand();
|
||||
command->mDvdFile = dvdFile;
|
||||
command->mAddress = address;
|
||||
@@ -150,19 +131,14 @@ JKRADCommand* JKRDvdAramRipper::loadToAram_Async(JKRDvdFile* dvdFile, u32 addres
|
||||
return command;
|
||||
}
|
||||
|
||||
/* ############################################################################################## */
|
||||
/* 804343A8-804343B4 0610C8 000C+00 1/1 0/0 0/0 .bss @301 */
|
||||
static u8 lit_301[12];
|
||||
|
||||
/* 804343B4-804343C0 0610D4 000C+00 3/3 0/0 0/0 .bss sDvdAramAsyncList__16JKRDvdAramRipper */
|
||||
u8 JKRDvdAramRipper::sDvdAramAsyncList[12];
|
||||
JSUList<JKRADCommand> JKRDvdAramRipper::sDvdAramAsyncList;
|
||||
|
||||
/* 804508D0-804508D4 000350 0004+00 3/3 0/0 0/0 .sdata None */
|
||||
SECTION_SDATA static u8 data_804508D0 = 0x01;
|
||||
bool JKRDvdAramRipper::errorRetry = true;
|
||||
|
||||
/* 802DAA74-802DADD8 2D53B4 0364+00 1/1 0/0 0/0 .text
|
||||
* callCommand_Async__16JKRDvdAramRipperFP12JKRADCommand */
|
||||
#ifdef NONMATCHING
|
||||
JKRADCommand* JKRDvdAramRipper::callCommand_Async(JKRADCommand* command) {
|
||||
s32 compression;
|
||||
s32 uncompressedSize;
|
||||
@@ -193,7 +169,7 @@ JKRADCommand* JKRDvdAramRipper::callCommand_Async(JKRADCommand* command) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (data_804508D0 == 0) {
|
||||
if (JKRDvdAramRipper::errorRetry == 0) {
|
||||
delete stream;
|
||||
return NULL;
|
||||
}
|
||||
@@ -201,8 +177,11 @@ JKRADCommand* JKRDvdAramRipper::callCommand_Async(JKRADCommand* command) {
|
||||
VIWaitForRetrace();
|
||||
}
|
||||
DCInvalidateRange(bufPtr, 0x20);
|
||||
|
||||
compression = JKRCheckCompressed_noASR(bufPtr);
|
||||
uncompressedSize = JKRDecompExpandSize(bufPtr);
|
||||
|
||||
u32 expandSize = JKRDecompExpandSize(bufPtr);
|
||||
uncompressedSize = expandSize;
|
||||
if (command->field_0x40 && uncompressedSize > command->field_0x40) {
|
||||
uncompressedSize = command->field_0x40;
|
||||
}
|
||||
@@ -269,16 +248,6 @@ JKRADCommand* JKRDvdAramRipper::callCommand_Async(JKRADCommand* command) {
|
||||
OSUnlockMutex(&dvdFile->mMutex2);
|
||||
return bVar1 == true ? command : NULL;
|
||||
}
|
||||
#else
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm JKRADCommand* JKRDvdAramRipper::callCommand_Async(JKRADCommand* command) {
|
||||
nofralloc
|
||||
#include "asm/JSystem/JKernel/JKRDvdAramRipper/callCommand_Async__16JKRDvdAramRipperFP12JKRADCommand.s"
|
||||
}
|
||||
#pragma pop
|
||||
#endif
|
||||
|
||||
/* 802DADD8-802DAE48 2D5718 0070+00 0/0 1/0 0/0 .text __dt__18JSUFileInputStreamFv */
|
||||
#pragma push
|
||||
@@ -293,8 +262,6 @@ extern "C" asm void __dt__18JSUFileInputStreamFv() {
|
||||
|
||||
/* 802DAE48-802DAF1C 2D5788 00D4+00 1/1 0/0 0/0 .text
|
||||
* syncAram__16JKRDvdAramRipperFP12JKRADCommandi */
|
||||
// should match when other functions using sDvdAramAsyncList are decompiled
|
||||
#ifdef NONMATCHING
|
||||
bool JKRDvdAramRipper::syncAram(JKRADCommand* command, int param_1) {
|
||||
JKRDvdFile* dvdFile = command->mDvdFile;
|
||||
OSLockMutex(&dvdFile->mMutex2);
|
||||
@@ -319,16 +286,6 @@ bool JKRDvdAramRipper::syncAram(JKRADCommand* command, int param_1) {
|
||||
OSUnlockMutex(&dvdFile->mMutex2);
|
||||
return true;
|
||||
}
|
||||
#else
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm bool JKRDvdAramRipper::syncAram(JKRADCommand* param_0, int param_1) {
|
||||
nofralloc
|
||||
#include "asm/JSystem/JKernel/JKRDvdAramRipper/syncAram__16JKRDvdAramRipperFP12JKRADCommandi.s"
|
||||
}
|
||||
#pragma pop
|
||||
#endif
|
||||
|
||||
/* 802DAF1C-802DAF5C 2D585C 0040+00 1/1 0/0 0/0 .text __ct__12JKRADCommandFv */
|
||||
JKRADCommand::JKRADCommand() : mLink(this) {
|
||||
@@ -349,7 +306,7 @@ static OSMutex decompMutex;
|
||||
|
||||
/* 804508D4-804508D8 000354 0004+00 1/1 1/1 0/0 .sdata sSZSBufferSize__16JKRDvdAramRipper
|
||||
*/
|
||||
SECTION_SDATA u32 JKRDvdAramRipper::sSZSBufferSize = 0x00000400;
|
||||
u32 JKRDvdAramRipper::sSZSBufferSize = 0x00000400;
|
||||
|
||||
/* 80451468-8045146C 000968 0004+00 3/3 0/0 0/0 .sbss szpBuf */
|
||||
static u8* szpBuf;
|
||||
@@ -382,7 +339,7 @@ static u32 srcOffset;
|
||||
static u32 transLeft;
|
||||
|
||||
/* 80451490-80451494 000990 0004+00 3/3 0/0 0/0 .sbss srcLimit */
|
||||
static int srcLimit;
|
||||
static u8* srcLimit;
|
||||
|
||||
/* 80451494-80451498 000994 0004+00 3/3 0/0 0/0 .sbss srcFile */
|
||||
static JKRDvdFile* srcFile;
|
||||
@@ -445,26 +402,157 @@ int JKRDecompressFromDVDToAram(JKRDvdFile* dvdFile, u32 param_1, u32 fileSize, u
|
||||
}
|
||||
|
||||
/* 802DB160-802DB3E8 2D5AA0 0288+00 1/1 0/0 0/0 .text decompSZS_subroutine__FPUcUl */
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
static asm int decompSZS_subroutine(u8* param_0, u32 param_1) {
|
||||
nofralloc
|
||||
#include "asm/JSystem/JKernel/JKRDvdAramRipper/decompSZS_subroutine__FPUcUl.s"
|
||||
static int decompSZS_subroutine(u8* src, u32 dest) {
|
||||
u32 endAddr;
|
||||
u8* copySource;
|
||||
s32 validBitCount;
|
||||
u32 currCodeByte;
|
||||
s32 numBytes;
|
||||
u32 var_r26;
|
||||
u32 startDest;
|
||||
|
||||
validBitCount = 0;
|
||||
currCodeByte = 0;
|
||||
var_r26 = 0;
|
||||
startDest = dest;
|
||||
|
||||
if (src[0] != 'Y' || src[1] != 'a' || src[2] != 'z' || src[3] != '0') {
|
||||
return -1;
|
||||
}
|
||||
|
||||
SYaz0Header* header = (SYaz0Header*)src;
|
||||
endAddr = dest + (header->length - fileOffset);
|
||||
if (endAddr > dest + maxDest) {
|
||||
endAddr = dest + maxDest;
|
||||
}
|
||||
|
||||
src += 0x10;
|
||||
do {
|
||||
if (validBitCount == 0) {
|
||||
if ((src > srcLimit) && transLeft) {
|
||||
src = nextSrcData(src);
|
||||
}
|
||||
currCodeByte = *src;
|
||||
validBitCount = 8;
|
||||
src++;
|
||||
}
|
||||
if (currCodeByte & 0x80) {
|
||||
if (readCount >= fileOffset) {
|
||||
*(dmaCurrent++) = *src;
|
||||
dest++;
|
||||
var_r26++;
|
||||
if (dmaCurrent == dmaEnd) {
|
||||
startDest += dmaBufferFlush(startDest);
|
||||
}
|
||||
if (dest == endAddr) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
*(refCurrent++) = *src;
|
||||
if (refCurrent == refEnd) {
|
||||
refCurrent = refBuf;
|
||||
}
|
||||
src++;
|
||||
readCount++;
|
||||
} else {
|
||||
u32 dist = ((src[0] & 0x0F) << 8) | src[1];
|
||||
numBytes = src[0] >> 4;
|
||||
src += 2;
|
||||
copySource = refCurrent - dist - 1;
|
||||
if (copySource < refBuf) {
|
||||
copySource += refEnd - refBuf;
|
||||
}
|
||||
if (numBytes == 0) {
|
||||
numBytes = *(src++);
|
||||
numBytes += 0x12;
|
||||
} else {
|
||||
numBytes += 2;
|
||||
}
|
||||
do {
|
||||
if (readCount >= fileOffset) {
|
||||
*(dmaCurrent++) = *copySource;
|
||||
dest++;
|
||||
var_r26++;
|
||||
if (dmaCurrent == dmaEnd) {
|
||||
startDest += dmaBufferFlush(startDest);
|
||||
}
|
||||
if (dest == endAddr) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
*(refCurrent++) = *copySource;
|
||||
if (refCurrent == refEnd) {
|
||||
refCurrent = refBuf;
|
||||
}
|
||||
copySource++;
|
||||
if (copySource == refEnd) {
|
||||
copySource = refBuf;
|
||||
}
|
||||
readCount++;
|
||||
numBytes--;
|
||||
} while (numBytes != 0);
|
||||
}
|
||||
currCodeByte <<= 1;
|
||||
validBitCount--;
|
||||
} while (dest < endAddr);
|
||||
|
||||
dmaBufferFlush(startDest);
|
||||
*tsPtr = var_r26;
|
||||
return 0;
|
||||
}
|
||||
#pragma pop
|
||||
|
||||
/* 802DB3E8-802DB49C 2D5D28 00B4+00 1/1 0/0 0/0 .text firstSrcData__Fv */
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
static asm u8* firstSrcData() {
|
||||
nofralloc
|
||||
#include "asm/JSystem/JKernel/JKRDvdAramRipper/firstSrcData__Fv.s"
|
||||
static u8* firstSrcData() {
|
||||
srcLimit = szpEnd - 0x19;
|
||||
u8* buffer = szpBuf;
|
||||
u32 bufSize = szpEnd - buffer;
|
||||
u32 length = transLeft < bufSize ? transLeft : bufSize;
|
||||
while (true) {
|
||||
int result = DVDReadPrio(&srcFile->mFileInfo, buffer, length, 0, 2);
|
||||
if (result >= 0) {
|
||||
break;
|
||||
}
|
||||
if (JKRDvdAramRipper::errorRetry == 0) {
|
||||
return NULL;
|
||||
}
|
||||
VIWaitForRetrace();
|
||||
}
|
||||
srcOffset += length;
|
||||
transLeft -= length;
|
||||
return buffer;
|
||||
}
|
||||
#pragma pop
|
||||
|
||||
/* 802DB49C-802DB580 2D5DDC 00E4+00 1/1 0/0 0/0 .text nextSrcData__FPUc */
|
||||
// regalloc
|
||||
#ifdef NONMATCHING
|
||||
static u8* nextSrcData(u8* src) {
|
||||
u8* dest;
|
||||
u32 size = szpEnd - src;
|
||||
dest = IS_NOT_ALIGNED(size, 0x20) ? szpBuf + 0x20 - (size & (0x20 - 1)) : szpBuf;
|
||||
memcpy(dest, src, size);
|
||||
u32 transSize = szpEnd - (dest + size);
|
||||
if (transSize > transLeft) {
|
||||
transSize = transLeft;
|
||||
}
|
||||
|
||||
while (true) {
|
||||
s32 result = DVDReadPrio(&srcFile->mFileInfo, dest + size, transSize, srcOffset, 2);
|
||||
if (result >= 0) {
|
||||
break;
|
||||
}
|
||||
if (JKRDvdAramRipper::errorRetry == 0) {
|
||||
return NULL;
|
||||
}
|
||||
VIWaitForRetrace();
|
||||
}
|
||||
srcOffset += transSize;
|
||||
transLeft -= transSize;
|
||||
if (transLeft == 0) {
|
||||
srcLimit = dest + size + transSize;
|
||||
}
|
||||
return dest;
|
||||
}
|
||||
#else
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
@@ -473,38 +561,15 @@ static asm u8* nextSrcData(u8* param_0) {
|
||||
#include "asm/JSystem/JKernel/JKRDvdAramRipper/nextSrcData__FPUc.s"
|
||||
}
|
||||
#pragma pop
|
||||
#endif
|
||||
|
||||
/* 802DB580-802DB5E8 2D5EC0 0068+00 1/1 0/0 0/0 .text dmaBufferFlush__FUl */
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
static asm int dmaBufferFlush(u32 param_0) {
|
||||
nofralloc
|
||||
#include "asm/JSystem/JKernel/JKRDvdAramRipper/dmaBufferFlush__FUl.s"
|
||||
static u32 dmaBufferFlush(u32 param_1) {
|
||||
if (dmaCurrent == dmaBuf) {
|
||||
return 0;
|
||||
}
|
||||
u32 size = ALIGN_NEXT(dmaCurrent - dmaBuf, 0x20);
|
||||
JKRAramPiece::orderSync(0, (u32)dmaBuf, param_1, size, NULL);
|
||||
dmaCurrent = dmaBuf;
|
||||
return size;
|
||||
}
|
||||
#pragma pop
|
||||
|
||||
/* 802DB5E8-802DB62C 2D5F28 0044+00 0/0 1/0 0/0 .text __sinit_JKRDvdAramRipper_cpp */
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm void __sinit_JKRDvdAramRipper_cpp(){nofralloc
|
||||
#include "asm/JSystem/JKernel/JKRDvdAramRipper/__sinit_JKRDvdAramRipper_cpp.s"
|
||||
}
|
||||
#pragma pop
|
||||
|
||||
#pragma push
|
||||
#pragma force_active on
|
||||
REGISTER_CTORS(0x802DB5E8, __sinit_JKRDvdAramRipper_cpp);
|
||||
#pragma pop
|
||||
|
||||
/* 802DB62C-802DB680 2D5F6C 0054+00 1/1 0/0 0/0 .text __dt__23JSUList<12JKRADCommand>Fv
|
||||
*/
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
extern "C" asm void func_802DB62C(void* _this) {
|
||||
nofralloc
|
||||
#include "asm/JSystem/JKernel/JKRDvdAramRipper/func_802DB62C.s"
|
||||
}
|
||||
#pragma pop
|
||||
|
||||
@@ -1,8 +1,3 @@
|
||||
//
|
||||
// Generated By: dol2asm
|
||||
// Translation Unit: JKRDvdArchive
|
||||
//
|
||||
|
||||
#include "JSystem/JKernel/JKRDvdArchive.h"
|
||||
#include "JSystem/JKernel/JKRDecomp.h"
|
||||
#include "JSystem/JKernel/JKRDvdFile.h"
|
||||
@@ -14,71 +9,6 @@
|
||||
#include "dolphin/os.h"
|
||||
#include "global.h"
|
||||
|
||||
//
|
||||
// Forward References:
|
||||
//
|
||||
|
||||
extern "C" void __ct__13JKRDvdArchiveFlQ210JKRArchive15EMountDirection();
|
||||
extern "C" void __dt__13JKRDvdArchiveFv();
|
||||
extern "C" void open__13JKRDvdArchiveFl();
|
||||
extern "C" void fetchResource__13JKRDvdArchiveFPQ210JKRArchive12SDIFileEntryPUl();
|
||||
extern "C" void fetchResource__13JKRDvdArchiveFPvUlPQ210JKRArchive12SDIFileEntryPUl();
|
||||
extern "C" void fetchResource_subroutine__13JKRDvdArchiveFlUlUlPUcUlii();
|
||||
extern "C" void fetchResource_subroutine__13JKRDvdArchiveFlUlUlP7JKRHeapiiPPUc();
|
||||
extern "C" void getExpandedResSize__13JKRDvdArchiveCFPCv();
|
||||
extern "C" extern char const* const JKRDvdArchive__stringBase0;
|
||||
|
||||
//
|
||||
// External References:
|
||||
//
|
||||
|
||||
extern "C" void alloc__7JKRHeapFUliP7JKRHeap();
|
||||
extern "C" void alloc__7JKRHeapFUli();
|
||||
extern "C" void free__7JKRHeapFPvP7JKRHeap();
|
||||
extern "C" void free__7JKRHeapFPv();
|
||||
extern "C" void copyMemory__7JKRHeapFPvPvUl();
|
||||
extern "C" void* __nw__FUlP7JKRHeapi();
|
||||
extern "C" void __dl__FPv();
|
||||
extern "C" void unmount__13JKRFileLoaderFv();
|
||||
extern "C" void becomeCurrent__10JKRArchiveFPCc();
|
||||
extern "C" void getResource__10JKRArchiveFPCc();
|
||||
extern "C" void getResource__10JKRArchiveFUlPCc();
|
||||
extern "C" void readResource__10JKRArchiveFPvUlUlPCc();
|
||||
extern "C" void readResource__10JKRArchiveFPvUlPCc();
|
||||
extern "C" void removeResourceAll__10JKRArchiveFv();
|
||||
extern "C" void removeResource__10JKRArchiveFPv();
|
||||
extern "C" void detachResource__10JKRArchiveFPv();
|
||||
extern "C" void getResSize__10JKRArchiveCFPCv();
|
||||
extern "C" void countFile__10JKRArchiveCFPCc();
|
||||
extern "C" void getFirstFile__10JKRArchiveCFPCc();
|
||||
extern "C" void __ct__10JKRArchiveFlQ210JKRArchive10EMountMode();
|
||||
extern "C" void __dt__10JKRArchiveFv();
|
||||
extern "C" void findPtrResource__10JKRArchiveCFPCv();
|
||||
extern "C" void setExpandSize__10JKRArchiveFPQ210JKRArchive12SDIFileEntryUl();
|
||||
extern "C" void getExpandSize__10JKRArchiveCFPQ210JKRArchive12SDIFileEntry();
|
||||
extern "C" void __ct__10JKRDvdFileFl();
|
||||
extern "C" void
|
||||
loadToMainRAM__12JKRDvdRipperFlPUc15JKRExpandSwitchUlP7JKRHeapQ212JKRDvdRipper15EAllocDirectionUlPiPUl();
|
||||
extern "C" void prepend__10JSUPtrListFP10JSUPtrLink();
|
||||
extern "C" void remove__10JSUPtrListFP10JSUPtrLink();
|
||||
extern "C" void panic_f__12JUTExceptionFPCciPCce();
|
||||
extern "C" void _savegpr_25();
|
||||
extern "C" void _savegpr_26();
|
||||
extern "C" void _savegpr_27();
|
||||
extern "C" void _savegpr_28();
|
||||
extern "C" void _savegpr_29();
|
||||
extern "C" void _restgpr_25();
|
||||
extern "C" void _restgpr_26();
|
||||
extern "C" void _restgpr_27();
|
||||
extern "C" void _restgpr_28();
|
||||
extern "C" void _restgpr_29();
|
||||
extern "C" u8 sVolumeList__13JKRFileLoader[12];
|
||||
extern "C" u8 sSystemHeap__7JKRHeap[4];
|
||||
|
||||
//
|
||||
// Declarations:
|
||||
//
|
||||
|
||||
/* 802D7BF0-802D7C98 2D2530 00A8+00 0/0 1/1 0/0 .text
|
||||
* __ct__13JKRDvdArchiveFlQ210JKRArchive15EMountDirection */
|
||||
JKRDvdArchive::JKRDvdArchive(s32 entryNum, JKRArchive::EMountDirection mountDirection)
|
||||
@@ -126,7 +56,7 @@ JKRDvdArchive::~JKRDvdArchive() {
|
||||
/* 802D7DB4-802D8050 2D26F4 029C+00 1/1 0/0 0/0 .text open__13JKRDvdArchiveFl */
|
||||
bool JKRDvdArchive::open(s32 entryNum) {
|
||||
mArcInfoBlock = NULL;
|
||||
field_0x64 = NULL;
|
||||
mDataOffset = 0;
|
||||
mNodes = NULL;
|
||||
mFiles = NULL;
|
||||
mStringTable = NULL;
|
||||
@@ -188,7 +118,7 @@ bool JKRDvdArchive::open(s32 entryNum) {
|
||||
memset(mExpandedSize, 0, sizeof(s32) * mArcInfoBlock->num_file_entries);
|
||||
}
|
||||
|
||||
field_0x64 = arcHeader->header_length + arcHeader->file_data_offset;
|
||||
mDataOffset = arcHeader->header_length + arcHeader->file_data_offset;
|
||||
|
||||
cleanup:
|
||||
if (arcHeader) {
|
||||
@@ -221,7 +151,7 @@ void* JKRDvdArchive::fetchResource(SDIFileEntry* fileEntry, u32* returnSize) {
|
||||
if (!fileEntry->data) {
|
||||
u8* resourcePtr;
|
||||
u32 resourceSize = fetchResource_subroutine(
|
||||
mEntryNum, this->field_0x64 + fileEntry->data_offset, fileEntry->data_size, mHeap,
|
||||
mEntryNum, mDataOffset + fileEntry->data_offset, fileEntry->data_size, mHeap,
|
||||
fileCompression, mCompression, &resourcePtr);
|
||||
*returnSize = resourceSize;
|
||||
if (resourceSize == 0) {
|
||||
@@ -246,26 +176,23 @@ void* JKRDvdArchive::fetchResource(SDIFileEntry* fileEntry, u32* returnSize) {
|
||||
|
||||
/* 802D8168-802D826C 2D2AA8 0104+00 1/0 0/0 0/0 .text
|
||||
* fetchResource__13JKRDvdArchiveFPvUlPQ210JKRArchive12SDIFileEntryPUl */
|
||||
// ALIGN_PREV(bufferSize, 0x20) is "inlined" in the function parameter.
|
||||
#ifdef NONMATCHING
|
||||
void* JKRDvdArchive::fetchResource(void* buffer, u32 bufferSize, SDIFileEntry* fileEntry,
|
||||
u32* returnSize) {
|
||||
JUT_ASSERT(504, isMounted());
|
||||
u32 otherSize;
|
||||
u32 expandSize;
|
||||
u32 size = fileEntry->data_size;
|
||||
u32 dstSize = bufferSize;
|
||||
JKRCompression fileCompression = JKRConvertAttrToCompressionType(fileEntry->getAttr());
|
||||
|
||||
if (!fileEntry->data) {
|
||||
dstSize = ALIGN_PREV(bufferSize, 0x20);
|
||||
size = fetchResource_subroutine(mEntryNum, field_0x64 + fileEntry->data_offset,
|
||||
fileEntry->data_size, (u8*)buffer, dstSize, fileCompression,
|
||||
bufferSize = (s32)ALIGN_PREV(bufferSize, 0x20);
|
||||
size = fetchResource_subroutine(mEntryNum, mDataOffset + fileEntry->data_offset,
|
||||
fileEntry->data_size, (u8*)buffer, bufferSize, fileCompression,
|
||||
mCompression);
|
||||
} else {
|
||||
if (fileCompression == COMPRESSION_YAZ0) {
|
||||
otherSize = getExpandSize(fileEntry);
|
||||
if (otherSize) {
|
||||
size = otherSize;
|
||||
expandSize = getExpandSize(fileEntry);
|
||||
if (expandSize) {
|
||||
size = expandSize;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -281,17 +208,6 @@ void* JKRDvdArchive::fetchResource(void* buffer, u32 bufferSize, SDIFileEntry* f
|
||||
}
|
||||
return buffer;
|
||||
}
|
||||
#else
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm void* JKRDvdArchive::fetchResource(void* param_0, u32 param_1,
|
||||
JKRArchive::SDIFileEntry* param_2, u32* param_3) {
|
||||
nofralloc
|
||||
#include "asm/JSystem/JKernel/JKRDvdArchive/fetchResource__13JKRDvdArchiveFPvUlPQ210JKRArchive12SDIFileEntryPUl.s"
|
||||
}
|
||||
#pragma pop
|
||||
#endif
|
||||
|
||||
/* 802D826C-802D8474 2D2BAC 0208+00 1/1 1/1 0/0 .text
|
||||
* fetchResource_subroutine__13JKRDvdArchiveFlUlUlPUcUlii */
|
||||
@@ -452,7 +368,7 @@ u32 JKRDvdArchive::getExpandedResSize(const void* resource) const {
|
||||
u8* arcHeader = (u8*)ALIGN_NEXT((u32)buffer, 0x20);
|
||||
JKRDvdToMainRam(mEntryNum, arcHeader, EXPAND_SWITCH_UNKNOWN2, sizeof(SArcHeader), NULL,
|
||||
JKRDvdRipper::ALLOC_DIRECTION_FORWARD,
|
||||
this->field_0x64 + fileEntry->data_offset, NULL, NULL);
|
||||
mDataOffset + fileEntry->data_offset, NULL, NULL);
|
||||
DCInvalidateRange(arcHeader, sizeof(SArcHeader));
|
||||
|
||||
resourceSize = JKRDecompExpandSize(arcHeader);
|
||||
|
||||
@@ -1,8 +1,3 @@
|
||||
//
|
||||
// Generated By: dol2asm
|
||||
// Translation Unit: JKRDvdFile
|
||||
//
|
||||
|
||||
#include "JSystem/JKernel/JKRDvdFile.h"
|
||||
#include "JSystem/JUtility/JUTAssert.h"
|
||||
#include "JSystem/JUtility/JUTException.h"
|
||||
|
||||
@@ -1,8 +1,3 @@
|
||||
//
|
||||
// Generated By: dol2asm
|
||||
// Translation Unit: JKRFile
|
||||
//
|
||||
|
||||
#include "JSystem/JKernel/JKRFile.h"
|
||||
#include "dolphin/vi.h"
|
||||
|
||||
|
||||
@@ -1,8 +1,3 @@
|
||||
//
|
||||
// Generated By: dol2asm
|
||||
// Translation Unit: JKRFileCache
|
||||
//
|
||||
|
||||
#include "JSystem/JKernel/JKRFileCache.h"
|
||||
#include "JSystem/JKernel/JKRDvdFile.h"
|
||||
#include "JSystem/JKernel/JKRFileFinder.h"
|
||||
|
||||
@@ -1,15 +1,6 @@
|
||||
//
|
||||
// Generated By: dol2asm
|
||||
// Translation Unit: JKRFileFinder
|
||||
//
|
||||
|
||||
#include "JSystem/JKernel/JKRFileFinder.h"
|
||||
#include "JSystem/JKernel/JKRArchive.h"
|
||||
|
||||
//
|
||||
// Declarations:
|
||||
//
|
||||
|
||||
/* 802D4638-802D46C4 2CEF78 008C+00 0/0 1/1 0/0 .text __ct__12JKRArcFinderFP10JKRArchivell */
|
||||
JKRArcFinder::JKRArcFinder(JKRArchive* archive, s32 startIndex, s32 numEntries) : JKRFileFinder() {
|
||||
mArchive = archive;
|
||||
|
||||
@@ -1,25 +1,8 @@
|
||||
//
|
||||
// Generated By: dol2asm
|
||||
// Translation Unit: JKRFileLoader
|
||||
//
|
||||
|
||||
#include "JSystem/JKernel/JKRFileLoader.h"
|
||||
#include "string.h"
|
||||
#include "ctype.h"
|
||||
#include "global.h"
|
||||
|
||||
//
|
||||
// Forward References:
|
||||
//
|
||||
|
||||
//
|
||||
// External References:
|
||||
//
|
||||
|
||||
//
|
||||
// Declarations:
|
||||
//
|
||||
|
||||
/* ############################################################################################## */
|
||||
/* 80451418-80451420 000918 0004+04 2/2 3/3 0/0 .sbss sCurrentVolume__13JKRFileLoader */
|
||||
JKRFileLoader* JKRFileLoader::sCurrentVolume;
|
||||
|
||||
@@ -8,10 +8,6 @@
|
||||
#include "JSystem/JUtility/JUTException.h"
|
||||
#include "dolphin/os.h"
|
||||
|
||||
//
|
||||
// Declarations:
|
||||
//
|
||||
|
||||
/* 80451370-80451374 000870 0004+00 3/3 44/44 0/0 .sbss sSystemHeap__7JKRHeap */
|
||||
JKRHeap* JKRHeap::sSystemHeap;
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user