mirror of
https://github.com/ACreTeam/ac-decomp
synced 2026-05-23 06:34:18 -04:00
eepy disease x3 (match sleep & sprintf)
This commit is contained in:
@@ -30,6 +30,8 @@ libc64/qrand.c:
|
||||
.sdata: [0x80217de8, 0x80217df0]
|
||||
.sbss: [0x80218640, 0x80218648]
|
||||
.sdata2: [0x80219130, 0x80219138]
|
||||
#libc64/sprintf.c:
|
||||
# .text: [0x8005ce18, 0x8005cf08]
|
||||
#libc64/malloc.c:
|
||||
# .text: [0x8005cf08, 0x8005d01c]
|
||||
# .bss: [0x80206F30, 0x80206F60]
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "types.h"
|
||||
#include "dolphin/os.h"
|
||||
#include "dolphin/BASE/ppcarch.h"
|
||||
#include "init.h"
|
||||
#include "dolphin/os/__ppc_eabi_init.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
#include "sleep.h"
|
||||
#include "dolphin/os/OSAlarm.h"
|
||||
#include "dolphin/os/OSTimer.h"
|
||||
#include "dolphin/os/OSThread.h"
|
||||
|
||||
void csleep(OSTime c){
|
||||
OSMessage msg;
|
||||
OSMessageQueue mq;
|
||||
OSTimer timer;
|
||||
|
||||
osCreateMesgQueue(&mq, &msg, 1);
|
||||
osSetTimer(&timer, c, 0, &mq, NULL);
|
||||
osRecvMesg(&mq, NULL, 1);
|
||||
}
|
||||
|
||||
void msleep(u32 ms){
|
||||
csleep((OS_MSEC_TO_TICKS((OSTime)ms)));
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
#include "libultra/xprintf.h"
|
||||
#include "_mem.h"
|
||||
|
||||
static void* proutPrintf(void* dst, const char* fmt, size_t size) {
|
||||
return (void*)((u8*)memcpy(dst, fmt, size) + size);
|
||||
}
|
||||
|
||||
s32 sprintf(char* dst, const char* fmt, ...) {
|
||||
s32 ret;
|
||||
va_list args;
|
||||
va_start(args, fmt);
|
||||
|
||||
ret = _Printf(&proutPrintf, dst, fmt, args);
|
||||
if (ret >= 0) {
|
||||
dst[ret] = '\0';
|
||||
}
|
||||
|
||||
va_end(args);
|
||||
|
||||
return ret;
|
||||
}
|
||||
+1
-1
Submodule tools/ppcdis updated: 83260829c5...eca3f3015a
Reference in New Issue
Block a user