Skip to content

Commit

Permalink
Matched even more
Browse files Browse the repository at this point in the history
  • Loading branch information
KiritoDv committed Feb 13, 2024
1 parent 4fe23a9 commit d1aac61
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 8 deletions.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -290,12 +290,14 @@ build/src/libultra/io/aisetfreq.o: OPTFLAGS := -O1 -g0
build/src/libultra/io/sp.o: OPTFLAGS := -O1 -g0
build/src/libultra/io/sirawdma.o: OPTFLAGS := -O1 -g0
build/src/libultra/io/sirawread.o: OPTFLAGS := -O1 -g0
build/src/libultra/io/sirawwrite.o: OPTFLAGS := -O1 -g0
build/src/libultra/io/sprawdma.o: OPTFLAGS := -O1 -g0
build/src/libultra/io/spgetstat.o: OPTFLAGS := -O1 -g0
build/src/libultra/io/sptaskyielded.o: OPTFLAGS := -O1 -g0
build/src/libultra/io/sptaskyield.o: OPTFLAGS := -O1 -g0
build/src/libultra/io/sptask.o: OPTFLAGS := -O1 -g0
build/src/libultra/io/spsetstat.o: OPTFLAGS := -O1 -g0
build/src/libultra/io/pirawread.o: OPTFLAGS := -O1 -g0
build/src/libultra/io/viblack.o: OPTFLAGS := -O1 -g0
build/src/libultra/io/vigetcurrcontext.o: OPTFLAGS := -O1 -g0
build/src/libultra/os/virtualtophysical.o: OPTFLAGS := -O1 -g0
Expand All @@ -309,6 +311,7 @@ build/src/libultra/io/viswapcontext.o: OPTFLAGS := -O1 -g0
build/src/libultra/libc/ldiv.o: OPTFLAGS := -O2 -g0
build/src/libultra/libc/string.o: OPTFLAGS := -O2 -g0
build/src/libultra/libc/xlitob.o: OPTFLAGS := -O2 -g0
build/src/libultra/libc/xldtob.o: OPTFLAGS := -O2 -g0
build/src/libultra/libc/ll.o: OPTFLAGS := -O1 -g0
build/src/libultra/libc/ll.o: MIPS_VERSION := -mips3 -32

Expand Down
8 changes: 4 additions & 4 deletions src/libultra/gu/mtxutil.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ void guMtxF2L(float mf[4][4], Mtx* m) {
*(ai++) = (e1 & 0xffff0000) | ((e2 >> 16) & 0xffff);
*(af++) = ((e1 << 16) & 0xffff0000) | (e2 & 0xffff);
}
}
}
}

// This function seems to use the SM64 version of the guMtxF2L function
Expand Down Expand Up @@ -66,9 +66,9 @@ void guMtxIdentF(float mf[4][4]) {
mf[i][j] = 1.0;
} else {
mf[i][j] = 0.0;
}
}
}
}
}
}
}

void guMtxIdent(Mtx* m) {
Expand Down
30 changes: 28 additions & 2 deletions src/libultra/io/pirawread.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,29 @@
#include "global.h"
#include "PR/assert.h"
#include "PR/ultraerror.h"
#include "piint.h"

#pragma GLOBAL_ASM("asm/us/nonmatchings/libultra/io/pirawread/osPiRawReadIo.s")
// Adjust line numbers to match assert
#if BUILD_VERSION < VERSION_J
#line 46
#endif

// TODO: this comes from a header
#ident "$Revision: 1.17 $"

s32 __osPiRawReadIo(u32 devAddr, u32* data) {
register u32 stat;

#ifdef _DEBUG
if (devAddr & 0x3) {
__osError(ERR_OSPIRAWREADIO, 1, devAddr);
return -1;
}
#endif

assert(data != NULL);

WAIT_ON_IOBUSY(stat);
*data = IO_READ((u32) osRomBase | devAddr);

return 0;
}
23 changes: 21 additions & 2 deletions src/libultra/io/sirawwrite.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
#include "common.h"
#include "PR/os_internal.h"
#include "PR/assert.h"
#include "siint.h"

#pragma GLOBAL_ASM("asm/us/nonmatchings/libultra/io/sirawwrite/__osSiRawWriteIo.s")
// Adjust line numbers to match assert
#if BUILD_VERSION < VERSION_J
#line 46
#endif

// TODO: this comes from a header
#ident "$Revision: 1.17 $"

s32 __osSiRawWriteIo(u32 devAddr, u32 data) {
assert((devAddr & 0x3) == 0);

if (__osSiDeviceBusy()) {
return -1;
}

IO_WRITE(devAddr, data);
return 0;
}

0 comments on commit d1aac61

Please sign in to comment.