diff --git a/asm/non_matchings/video/memory_copy.s b/asm/non_matchings/video/memory_copy.s deleted file mode 100644 index 47845cff..00000000 --- a/asm/non_matchings/video/memory_copy.s +++ /dev/null @@ -1,35 +0,0 @@ -glabel memory_copy -/* 07B7FC 8007ABFC 18C00018 */ blez $a2, .L8007AC60 -/* 07B800 8007AC00 00001025 */ move $v0, $zero -/* 07B804 8007AC04 30C70003 */ andi $a3, $a2, 3 -/* 07B808 8007AC08 10E00009 */ beqz $a3, .L8007AC30 -/* 07B80C 8007AC0C 00E01825 */ move $v1, $a3 -.L8007AC10: -/* 07B810 8007AC10 908E0000 */ lbu $t6, ($a0) -/* 07B814 8007AC14 24420001 */ addiu $v0, $v0, 1 -/* 07B818 8007AC18 24A50001 */ addiu $a1, $a1, 1 -/* 07B81C 8007AC1C 24840001 */ addiu $a0, $a0, 1 -/* 07B820 8007AC20 1462FFFB */ bne $v1, $v0, .L8007AC10 -/* 07B824 8007AC24 A0AEFFFF */ sb $t6, -1($a1) -/* 07B828 8007AC28 1046000D */ beq $v0, $a2, .L8007AC60 -/* 07B82C 8007AC2C 00000000 */ nop -.L8007AC30: -/* 07B830 8007AC30 908F0000 */ lbu $t7, ($a0) -/* 07B834 8007AC34 24420004 */ addiu $v0, $v0, 4 -/* 07B838 8007AC38 A0AF0000 */ sb $t7, ($a1) -/* 07B83C 8007AC3C 90980001 */ lbu $t8, 1($a0) -/* 07B840 8007AC40 24A50004 */ addiu $a1, $a1, 4 -/* 07B844 8007AC44 A0B8FFFD */ sb $t8, -3($a1) -/* 07B848 8007AC48 90990002 */ lbu $t9, 2($a0) -/* 07B84C 8007AC4C 24840004 */ addiu $a0, $a0, 4 -/* 07B850 8007AC50 A0B9FFFE */ sb $t9, -2($a1) -/* 07B854 8007AC54 9088FFFF */ lbu $t0, -1($a0) -/* 07B858 8007AC58 1446FFF5 */ bne $v0, $a2, .L8007AC30 -/* 07B85C 8007AC5C A0A8FFFF */ sb $t0, -1($a1) -.L8007AC60: -/* 07B860 8007AC60 03E00008 */ jr $ra -/* 07B864 8007AC64 00000000 */ nop - -/* 07B868 8007AC68 00000000 */ nop -/* 07B86C 8007AC6C 00000000 */ nop - diff --git a/include/PR/os_message.h b/include/PR/os_message.h index 706306d7..6e07dfa4 100644 --- a/include/PR/os_message.h +++ b/include/PR/os_message.h @@ -55,6 +55,7 @@ typedef void * OSMesg; * Structure for message queue */ typedef struct OSMesgQueue_s { + //24 bytes? OSThread *mtqueue; /* Queue to store threads blocked on empty mailboxes (receive) */ OSThread *fullqueue; /* Queue to store threads blocked diff --git a/lib/src/mips1/al/alSynAllocFX.c b/lib/src/mips1/al/alSynAllocFX.c index ff42dc1a..2f4d1622 100644 --- a/lib/src/mips1/al/alSynAllocFX.c +++ b/lib/src/mips1/al/alSynAllocFX.c @@ -6,13 +6,19 @@ #include "audio_internal.h" #ifdef NON_MATCHING +void alFxNew(ALFx *r, ALSynConfig *c, ALHeap *hp); +s32 alFxParam(void *filter, s32 paramID, void *param); +s32 alMainBusParam(void *filter, s32 paramID, void *param); // This is very close to matching. -ALFxRef *alSynAllocFX(ALSynth *s, s16 bus, s32 *arg2) { - alFxNew(&s->auxBus[bus].fx[0], arg2, bus); - alFxParam(&s->auxBus[bus].fx[0], AL_FILTER_SET_SOURCE, &s->auxBus[bus]); - alMainBusParam(s->mainBus, AL_FILTER_ADD_SOURCE, &s->auxBus[bus].fx[0]); +ALFxRef *alSynAllocFX(ALSynth *s, s16 bus, ALSynConfig *c, ALHeap *hp) +{ + alFxNew(&s->auxBus[bus].fx[0], c, hp); + alFxParam(&s->auxBus[bus].fx[0], AL_FILTER_SET_SOURCE, + &s->auxBus[bus]); + alMainBusParam(s->mainBus, AL_FILTER_ADD_SOURCE,&s->auxBus[bus].fx[0]); + return (ALFxRef)(&s->auxBus[bus].fx[0]); } #else GLOBAL_ASM("lib/asm/non_matchings/alSynAllocFX/alSynAllocFX.s") -#endif \ No newline at end of file +#endif diff --git a/src/video.c b/src/video.c index 0048b7a3..52b1f958 100644 --- a/src/video.c +++ b/src/video.c @@ -31,8 +31,10 @@ s32 gVideoRefreshRate; f32 gVideoAspectRatio; f32 gVideoHeightRatio; s32 D_8012617C; -OSMesg D_80126180[8]; -OSMesgQueue D_801261A0[8]; +OSMesg D_80126180; +s32 D_80126188[6]; //Padding? +OSMesgQueue D_801261A0; +s32 D_801261B8[41]; //Padding? OSViMode gTvViMode; s32 gVideoFbWidths[2]; s32 gVideoFbHeights[2]; @@ -49,10 +51,9 @@ s32 D_801262E8[8]; u8 D_80126308; u8 D_80126309; s32 D_8012630C; -OSScClient *D_80126310; +OSScClient D_80126310; /******************************/ - void init_video(s32 videoModeIndex, OSSched *sc) { if (osTvType == TV_TYPE_PAL) { gVideoRefreshRate = REFRESH_50HZ; @@ -142,10 +143,10 @@ void init_vi_settings(void) { memory_copy((u8 *)tvViMode, (u8 *)&gTvViMode, sizeof(OSViMode)); if (osTvType == TV_TYPE_PAL) { //A simple osViExtendVStart to add an additional 24 scanlines? - gTvViMode.fldRegs[0].vStart -= (24 << 16); - gTvViMode.fldRegs[1].vStart -= (24 << 16); - gTvViMode.fldRegs[0].vStart += 24; - gTvViMode.fldRegs[1].vStart += 24; + gTvViMode.fldRegs[0].vStart -= (PAL_HEIGHT_DIFFERENCE << 16); + gTvViMode.fldRegs[1].vStart -= (PAL_HEIGHT_DIFFERENCE << 16); + gTvViMode.fldRegs[0].vStart += PAL_HEIGHT_DIFFERENCE; + gTvViMode.fldRegs[1].vStart += PAL_HEIGHT_DIFFERENCE; } osViSetMode(&gTvViMode); break; @@ -296,16 +297,10 @@ void swap_framebuffers(void) { gVideoCurrDepthBuffer = gVideoDepthBuffer; } -#ifdef NON_MATCHING -// regalloc issues -void memory_copy(u8 *src, u8 *dst, s32 numBytes) { +void memory_copy(u8 *src, u8 *dest, s32 len) { s32 i; - for(i = 0; i < numBytes; i++){ - dst[i] = src[i]; + + for(i = 0; i < len; i++) { + *dest++ = *src++; } } -#else -GLOBAL_ASM("asm/non_matchings/video/memory_copy.s") -#endif - - diff --git a/src/video.h b/src/video.h index d184cdbd..bf9a448a 100644 --- a/src/video.h +++ b/src/video.h @@ -63,7 +63,7 @@ s32 func_8007AB34(void); void swap_framebuffers(void); //Non Matching -void memory_copy(u8 *src, u8 *dst, s32 numBytes); +void memory_copy(u8 *src, u8 *dest, s32 len); s32 func_8007A98C(s32 arg0); #endif