Refresh 2

This commit is contained in:
n64 committed 2019-10-05 15:08:05 -04:00
1 parent 1ef98ec785
commit 52e605f075
316 files changed
+16344 -16365

No files matched your search

+1 -1
View File
@@ -276,7 +276,7 @@ static void _Genld(printf_struct *px, u8 code, u8 *p, s16 nsig, s16 xexp) {
}
*p++ = xexp / 10 + '0', xexp %= 10;
*p++ = xexp + '0';
px->part3_len = (u32) p - (u32) &px->buff[px->part2_len];
px->part3_len = p - (u8 *) &px->buff[px->part2_len];
}
if ((px->flags & (FLAGS_ZERO | FLAGS_MINUS)) == FLAGS_ZERO) { /* pad with leading zeros */
int n =
+1 -1
View File
@@ -205,7 +205,7 @@ static void _Putfld(printf_struct *a0, va_list *args, u8 type, u8 *buff) {
break;
case 'p':
a0->value.s64 = (long) va_arg(*args, void *); // void*
a0->value.s64 = (intptr_t) va_arg(*args, void *);
a0->buff = (char *) &buff[a0->part1_len];
_Litob(a0, 'x');
break;
+1 -1
View File
@@ -4,6 +4,6 @@ s32 __osSiRawReadIo(void *a0, u32 *a1) {
if (__osSiDeviceBusy()) {
return -1;
}
*a1 = HW_REG((u32) a0, u32);
*a1 = HW_REG((uintptr_t) a0, u32);
return 0;
}
+1 -1
View File
@@ -4,6 +4,6 @@ s32 __osSiRawWriteIo(void *a0, u32 a1) {
if (__osSiDeviceBusy()) {
return -1;
}
HW_REG((u32) a0, u32) = a1;
HW_REG((uintptr_t) a0, u32) = a1;
return 0;
}
+2 -2
View File
@@ -1,12 +1,12 @@
#include "libultra_internal.h"
#include "libaudio_internal.h"
#define PATCH(SRC, BASE, TYPE) SRC = (TYPE)((u32) SRC + (u32) BASE)
#define PATCH(SRC, BASE, TYPE) SRC = (TYPE)((uintptr_t) SRC + (uintptr_t) BASE)
void alSeqFileNew(ALSeqFile *f, u8 *base) {
int i;
for (i = 0; i < f->seqCount; i++) {
f->seqArray[i].offset = (u32)(f->seqArray[i].offset) + base;
PATCH(f->seqArray[i].offset, base, u8 *);
}
}
+1 -1
View File
@@ -1,7 +1,7 @@
#ifndef _HARDWARE_H_
#define _HARDWARE_H_
#define HW_REG(reg, type) *(volatile type *)(reg | 0xa0000000)
#define HW_REG(reg, type) *(volatile type *)(uintptr_t)(reg | 0xa0000000)
#define AI_DRAM_ADDR_REG 0x04500000
#define AI_LEN_REG 0x04500004
+1 -1
View File
@@ -73,7 +73,7 @@ void process_command_memory() {
u32 sp18;
sp1c = string_to_u32(&D_80365E40[1]);
sp18 = string_to_u32(&D_80365E40[5]);
send((u8 *) sp1c, sp18);
send((u8 *) (uintptr_t) sp1c, sp18);
}
void process_command_register() {
send((u8 *) &gInterruptedThread.context, sizeof(__OSThreadContext));
+1 -1
View File
@@ -24,7 +24,7 @@ s32 osAiSetNextBuffer(void *buff, u32 len) {
sp1c -= 0x2000;
}
if ((((u32) buff + len) & 0x3fff) == 0x2000) {
if ((((uintptr_t) buff + len) & 0x3fff) == 0x2000) {
D_80334820 = 1;
} else {
D_80334820 = 0;
+1 -2
View File
@@ -12,8 +12,7 @@ s32 osPiRawStartDma(s32 dir, u32 cart_addr, void *dram_addr, size_t size) {
HW_REG(PI_DRAM_ADDR_REG, void *) = (void *) osVirtualToPhysical(dram_addr);
HW_REG(PI_CART_ADDR_REG, void *) =
(void *) ((osRomBase /*(*(u32 *)80000308)*/ | cart_addr) & 0x1fffffff);
HW_REG(PI_CART_ADDR_REG, void *) = (void *) (((uintptr_t) osRomBase | cart_addr) & 0x1fffffff);
switch (dir) {
case 0:
+1 -1
View File
@@ -2,7 +2,7 @@
extern OSMgrArgs piMgrArgs;
s32 osPiStartDma(OSIoMesg *mb, s32 priority, s32 direction, u32 devAddr, void *vAddr, u32 nbytes,
s32 osPiStartDma(OSIoMesg *mb, s32 priority, s32 direction, uintptr_t devAddr, void *vAddr, size_t nbytes,
OSMesgQueue *mq) {
register s32 result;
register OSMesgQueue *cmdQueue;
+2 -2
View File
@@ -3,7 +3,7 @@ extern OSThread *D_803348A0;
extern OSThread *D_80334898;
void osStartThread(OSThread *thread) {
register u32 int_disabled;
register u32 state;
register uintptr_t state;
int_disabled = __osDisableInt();
state = thread->state;
@@ -22,7 +22,7 @@ void osStartThread(OSThread *thread) {
} else {
thread->state = OS_STATE_WAITING;
__osEnqueueThread(thread->queue, thread);
state = (u32) __osPopThread(thread->queue);
state = (uintptr_t) __osPopThread(thread->queue);
__osEnqueueThread(&D_80334898, (OSThread *) state);
}
}
+5 -7
View File
@@ -1,12 +1,10 @@
#include "libultra_internal.h"
u32 osVirtualToPhysical(void *addr) {
if ((u32) addr >= 0x80000000 && (u32) addr < 0xa0000000) {
return ((u32) addr & 0x1fffffff);
}
else if ((u32) addr >= 0xa0000000 && (u32) addr < 0xc0000000) {
return ((u32) addr & 0x1fffffff);
uintptr_t osVirtualToPhysical(void *addr) {
if ((uintptr_t) addr >= 0x80000000 && (uintptr_t) addr < 0xa0000000) {
return ((uintptr_t) addr & 0x1fffffff);
} else if ((uintptr_t) addr >= 0xa0000000 && (uintptr_t) addr < 0xc0000000) {
return ((uintptr_t) addr & 0x1fffffff);
} else {
return __osProbeTLB(addr);
}