Skip to content

Commit

Permalink
func_8006F500 OK
Browse files Browse the repository at this point in the history
  • Loading branch information
hensldm committed Jul 19, 2024
1 parent 400dbb7 commit d7da401
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
2 changes: 2 additions & 0 deletions include/global.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ extern MallocRecord mallocRecord;
extern UNK_TYPE D_800DA83C;
extern UNK_TYPE D_8010DF40;

extern UNK_TYPE D_80108620;

typedef struct Y511F0UnkStruct {
/* 0x0 */ uintptr_t unk0;
/* 0x4 */ s16 unk4;
Expand Down
21 changes: 20 additions & 1 deletion src/main/O2/70100.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,23 @@
#include "global.h"

#define WAIT_ON_IOBUSY_ALT(stat) \
do { \
stat = IO_READ(PI_STATUS_REG); \
} while (stat & (PI_STATUS_IO_BUSY | PI_STATUS_DMA_BUSY))

#pragma GLOBAL_ASM("asm/us/nonmatchings/main/O2/70100/func_8006F500.s")
#define ADDRESS_1 (PI_DOM1_ADDR2 + 0x458) // 0x10000458
#define ADDRESS_2 (PI_DOM1_ADDR2 + 0x45C) // 0x1000045C

void func_8006F500(void) {
register u32 stat;
u16 addr1Val;
u16 addr2Val;

WAIT_ON_IOBUSY_ALT(stat);
addr1Val = IO_READ(ADDRESS_1);

WAIT_ON_IOBUSY_ALT(stat);
addr2Val = IO_READ(ADDRESS_2);

D_80108620 = (addr1Val << 16) | addr2Val;
}

0 comments on commit d7da401

Please sign in to comment.