1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-15 12:24:39 +00:00

Match/Improve a bunch of non matchings (#342)

This commit is contained in:
Roman971 2020-08-23 23:50:30 +02:00 committed by GitHub
parent 281aaa0cb6
commit 49609dd78b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
37 changed files with 137 additions and 2673 deletions

View file

@ -161,15 +161,13 @@ s32 __osCheckPackId(OSPfs* pfs, __OSPackId* temp) {
return 0;
}
#ifdef NON_MATCHING
// regalloc differences, probably the same issue as osPfsInitPak
s32 __osGetId(OSPfs* pfs) {
u16 sum, isum;
u16 sum;
u16 isum;
u8 temp[BLOCKSIZE];
__OSPackId* id;
__OSPackId newid;
s32 ret;
__OSPackId* id;
if (pfs->activebank != 0) {
if ((ret = __osPfsSelectBank(pfs, 0)) != 0) {
@ -180,6 +178,7 @@ s32 __osGetId(OSPfs* pfs) {
if ((ret = __osContRamRead(pfs->queue, pfs->channel, PFS_ID_0AREA, temp)) != 0) {
return ret;
}
__osIdCheckSum((u16*)temp, &sum, &isum);
id = (__OSPackId*)temp;
if ((id->checksum != sum) || (id->invertedChecksum != isum)) {
@ -207,6 +206,8 @@ s32 __osGetId(OSPfs* pfs) {
bcopy(id, pfs->id, BLOCKSIZE);
if (0) {}
pfs->version = id->version;
pfs->banks = id->banks;
@ -215,15 +216,13 @@ s32 __osGetId(OSPfs* pfs) {
pfs->inode_table = 1 * PFS_ONE_PAGE;
pfs->minode_table = (1 + pfs->banks) * PFS_ONE_PAGE;
pfs->dir_table = pfs->minode_table + (pfs->banks * PFS_ONE_PAGE);
if ((ret = __osContRamRead(pfs->queue, pfs->channel, PFS_LABEL_AREA, pfs->label)) != 0) {
return ret;
}
return 0;
}
#else
#pragma GLOBAL_ASM("asm/non_matchings/code/contpfs/__osGetId.s")
#endif
s32 __osCheckId(OSPfs* pfs) {
u8 temp[BLOCKSIZE];

View file

@ -1,10 +1,8 @@
#include <ultra64.h>
#include <global.h>
#ifdef NON_MATCHING
// regalloc differences, probably the same issue as __osGetId
s32 osPfsInitPak(OSMesgQueue* queue, OSPfs* pfs, s32 channel) {
s32 ret = 0;
s32 ret;
u16 sum;
u16 isum;
u8 temp[BLOCKSIZE];
@ -36,6 +34,7 @@ s32 osPfsInitPak(OSMesgQueue* queue, OSPfs* pfs, s32 channel) {
if ((ret = __osContRamRead(pfs->queue, pfs->channel, PFS_ID_0AREA, temp)) != 0) {
return (ret);
}
__osIdCheckSum((u16*)temp, &sum, &isum);
id = (__OSPackId*)temp;
if ((id->checksum != sum) || (id->invertedChecksum != isum)) {
@ -61,7 +60,9 @@ s32 osPfsInitPak(OSMesgQueue* queue, OSPfs* pfs, s32 channel) {
bcopy(id, pfs->id, BLOCKSIZE);
pfs->version = (s32)id->version;
if (0) {}
pfs->version = id->version;
pfs->banks = id->banks;
pfs->inodeStartPage = 1 + DEF_DIR_PAGES + (2 * pfs->banks);
pfs->dir_size = DEF_DIR_PAGES * PFS_ONE_PAGE;
@ -69,17 +70,15 @@ s32 osPfsInitPak(OSMesgQueue* queue, OSPfs* pfs, s32 channel) {
pfs->minode_table = (1 + pfs->banks) * PFS_ONE_PAGE;
pfs->dir_table = pfs->minode_table + (pfs->banks * PFS_ONE_PAGE);
if ((ret = __osContRamRead(pfs->queue, pfs->channel, PFS_LABEL_AREA, (u8*)pfs->label)) != 0) {
if ((ret = __osContRamRead(pfs->queue, pfs->channel, PFS_LABEL_AREA, pfs->label)) != 0) {
return ret;
}
ret = osPfsChecker(pfs);
pfs->status |= PFS_INITIALIZED;
return ret;
}
#else
#pragma GLOBAL_ASM("asm/non_matchings/code/pfsinitpak/osPfsInitPak.s")
#endif
s32 __osPfsCheckRamArea(OSPfs* pfs) {
s32 i = 0;