mirror of
https://github.com/izzy2lost/Diddy-Kong-Racing.git
synced 2026-06-19 01:16:26 -07:00
Decompiled __osPackEepReadData
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user