diff --git a/include/functions.h b/include/functions.h index f05849d92..a2a42e6d3 100644 --- a/include/functions.h +++ b/include/functions.h @@ -468,7 +468,7 @@ float __ull_to_f(unsigned long long l); s32 osVoiceCheckWord(u8* word); s32 osVoiceControlGain(OSVoiceHandle* hd, s32 analog, s32 digital); s32 osVoiceStartReadData(OSVoiceHandle* hd); -void* osViGetCurrentFramebuffer(void); +u32* osViGetCurrentFramebuffer(void); s32 __osSpSetPc(void* pc); s32 __osVoiceContWrite4(OSMesgQueue* hd, s32 arg1, s32 arg2, OSVoiceData* voiceData); void __osGetHWIntrRoutine(s32 idx, OSMesgQueue** outQueue, OSMesg* outMsg); diff --git a/include/viint.h b/include/viint.h index e850c895a..fadd5d781 100644 --- a/include/viint.h +++ b/include/viint.h @@ -16,13 +16,13 @@ typedef struct { /* 0x0 */ u16 state; /* 0x2 */ u16 retraceCount; - /* 0x4 */ void* framep; + /* 0x4 */ void* buffer; /* 0x8 */ OSViMode* modep; /* 0xC */ u32 control; /* 0x10 */ OSMesgQueue* msgq; /* 0x14 */ OSMesg msg; /* 0x18 */ __OSViScale x; /* 0x24 */ __OSViScale y; -} __OSViContext; +} __OSViContext; // size = 0x30 #endif diff --git a/src/libultra/io/vigetcurrframebuf.c b/src/libultra/io/vigetcurrframebuf.c index 83feda93d..bace58ded 100644 --- a/src/libultra/io/vigetcurrframebuf.c +++ b/src/libultra/io/vigetcurrframebuf.c @@ -1,3 +1,10 @@ #include "global.h" -#pragma GLOBAL_ASM("asm/non_matchings/boot/vigetcurrframebuf/osViGetCurrentFramebuffer.s") +u32* osViGetCurrentFramebuffer(void) { + register u32 prevInt = __osDisableInt(); + u32* curBuf = __osViCurr->buffer; + + __osRestoreInt(prevInt); + + return curBuf; +}