You've already forked ultrasm64-2
mirror of
https://github.com/HackerN64/ultrasm64-2.git
synced 2026-01-21 10:38:08 -08:00
Refresh 2
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -8,13 +8,6 @@ glabel rspF3DBootStart
|
||||
.incbin "lib/PR/boot/F3D_boot.bin"
|
||||
glabel rspF3DBootEnd
|
||||
|
||||
/*
|
||||
* Both of these ucode bins are 0x1000/0x800 respectively as defined in their
|
||||
* ucode initializations, but there's extra data afterwards. However, it's not the
|
||||
* RSP data as that is pointed to below in the rodata section. TODO: What are these
|
||||
* extra bins?
|
||||
*/
|
||||
|
||||
.balign 16
|
||||
.ifndef F3DEX_GBI_SHARED
|
||||
glabel rspF3DStart /* Use regular Fast3D bins (default) */
|
||||
@@ -22,7 +15,6 @@ glabel rspF3DStart /* Use regular Fast3D bins (default) */
|
||||
.incbin "lib/PR/f3d/new/F3D.bin" /* OS 2.0H (J2 and IQ) */
|
||||
.else
|
||||
.incbin "lib/PR/f3d/old/F3D.bin" /* OS 2.0D (US and JP) */
|
||||
.incbin "lib/PR/f3d/old/F3D_unk.bin"
|
||||
.endif
|
||||
glabel rspF3DEnd
|
||||
|
||||
@@ -43,7 +35,6 @@ glabel rspF3DEnd
|
||||
.balign 16
|
||||
glabel rspAspMainStart
|
||||
.incbin "lib/PR/audio/aspMain.bin"
|
||||
.incbin "lib/PR/audio/aspMain_unk.bin"
|
||||
glabel rspAspMainEnd
|
||||
|
||||
/*
|
||||
|
||||
@@ -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 =
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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,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
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user