Decompiled __osPackEepReadData

This commit is contained in:
Ryan Myers
2021-09-22 10:03:09 -04:00
parent b3cb942046
commit 063c3761ae
2 changed files with 33 additions and 1 deletions
+1
View File
@@ -272,6 +272,7 @@ $(BUILD_DIR)/lib/src/osEepromWrite.o: OPT_FLAGS := -O1
$(BUILD_DIR)/lib/src/osEepromRead.o: OPT_FLAGS := -O1
$(BUILD_DIR)/lib/src/osSetTimer.o: OPT_FLAGS := -O1
$(BUILD_DIR)/lib/src/osVirtualToPhysical.o: OPT_FLAGS := -O1
$(BUILD_DIR)/lib/src/unknown_0CF070.o: OPT_FLAGS := -O1
$(BUILD_DIR)/lib/%.o: MIPSISET := -mips2
$(BUILD_DIR)/lib/src/mips1/%.o: MIPSISET := -mips1
+32 -1
View File
@@ -3,5 +3,36 @@
#include "types.h"
#include "macros.h"
#include "libultra_internal.h"
#include "PR/rcp.h"
#include "controller.h"
#include "siint.h"
GLOBAL_ASM("lib/asm/non_matchings/unknown_0CF070/__osPackEepReadData.s")
extern OSPifRam __osEepPifRam;
s32 __osPackEepReadData(u8 address) {
u8 *ptr;
__OSContEepromFormat eepromformat;
s32 i;
ptr = (u8 *)&__osEepPifRam.ramarray;
//@bug: i <= here, but in libreultra its i <
for (i = 0; i <= ARRLEN(__osEepPifRam.ramarray); i++) {
__osEepPifRam.ramarray[i] = CONT_CMD_NOP;
}
__osEepPifRam.pifstatus = CONT_CMD_EXE;
eepromformat.txsize = CONT_CMD_READ_EEPROM_TX;
eepromformat.rxsize = CONT_CMD_READ_EEPROM_RX;
eepromformat.cmd = CONT_CMD_READ_EEPROM;
eepromformat.address = address;
for (i = 0; i < ARRLEN(eepromformat.data); i++) {
eepromformat.data[i] = 0;
}
//skip the first 4 bytes
for (i = 0; i < 4; i++) {
*ptr++ = 0;
}
*(__OSContEepromFormat *)ptr = eepromformat;
ptr += sizeof(__OSContEepromFormat);
ptr[0] = CONT_CMD_END;
}