Minor misc labelling (#246)

* Squashed commit of the following:

commit 3ab4716110
Author: Fazana <52551480+FazanaJ@users.noreply.github.com>
Date:   Mon May 23 23:11:46 2022 +0100

    Mostly misc labelling, but also weather too (#232)

    * bit more labelling

    * identify some weather stuff

    * Update sound_ids.h

    * yum

    * more random identification

    * last weather stuff for now

    * Update README.md

    * Update README.md

    * Fix non equivalent

* I found the 60fps button

* match func_80052B64

* match racer_attack_handler

* match func_80048C7C

* buncha function declaring

* e

* tweak

* match func_8004DE38

oh man oh man

* Small bit of labelling

* Merge remote-tracking branch 'upstream/master' into the-many-against-the-few

* Update README.md

* Fix monumentally poor bout of misinformation in the readme

we wouldn't want to mislead the readers, would we?

* github please

* Update README.md

* requested changes

kinda funny because I knew this struct existed, and knew it was used for this, but never made the connection lol

* Update objects.c

* match racer_enter_door

A nice easy one after the pure hellscape of the last few days :)

* names

* renames

* match func_8005250C

* heehee

* Update racer.c

* identify some misc asset calls

* identify some surface types

* match func_8005492C

* Delete func_8005492C.s

* match func_80052D7C

* move some enums

* label all existing misc asset calls

granted I know what almost none of them are lmao, buut will make things slightly easier in the long run

* Update README.md

* requested changes

pain

* Update README.md

* just a bit of labelling
This commit is contained in:
Fazana
2022-09-29 11:06:38 -04:00
committed by GitHub
parent e386db5483
commit f396463e95
15 changed files with 143 additions and 125 deletions
@@ -1,6 +1,6 @@
glabel audioNewThread
/* 003260 80002660 27BDFFB8 */ addiu $sp, $sp, -0x48
/* 003264 80002664 3C018011 */ lui $at, %hi(D_80115F90) # $at, 0x8011
/* 003264 80002664 3C018011 */ lui $at, %hi(gAudioSched) # $at, 0x8011
/* 003268 80002668 AFBF0034 */ sw $ra, 0x34($sp)
/* 00326C 8000266C AFB40030 */ sw $s4, 0x30($sp)
/* 003270 80002670 AFB3002C */ sw $s3, 0x2c($sp)
@@ -8,7 +8,7 @@ glabel audioNewThread
/* 003278 80002678 AFB10024 */ sw $s1, 0x24($sp)
/* 00327C 8000267C AFB00020 */ sw $s0, 0x20($sp)
/* 003280 80002680 AFA5004C */ sw $a1, 0x4c($sp)
/* 003284 80002684 AC265F90 */ sw $a2, %lo(D_80115F90)($at)
/* 003284 80002684 AC265F90 */ sw $a2, %lo(gAudioSched)($at)
/* 003288 80002688 8C8E0014 */ lw $t6, 0x14($a0)
/* 00328C 8000268C 3C018011 */ lui $at, %hi(D_80115F94) # $at, 0x8011
/* 003290 80002690 3C0F8000 */ lui $t7, %hi(__amDmaNew) # $t7, 0x8000
@@ -230,10 +230,10 @@ glabel audioNewThread
/* 0035C4 800029C4 24846198 */ addiu $a0, %lo(D_80116198) # addiu $a0, $a0, 0x6198
/* 0035C8 800029C8 0C032208 */ jal osCreateMesgQueue
/* 0035CC 800029CC 24060008 */ li $a2, 8
/* 0035D0 800029D0 3C048011 */ lui $a0, %hi(OSMesgQueue_80116160) # $a0, 0x8011
/* 0035D0 800029D0 3C048011 */ lui $a0, %hi(gAudioMesgQueue) # $a0, 0x8011
/* 0035D4 800029D4 3C058011 */ lui $a1, %hi(D_80116178) # $a1, 0x8011
/* 0035D8 800029D8 24A56178 */ addiu $a1, %lo(D_80116178) # addiu $a1, $a1, 0x6178
/* 0035DC 800029DC 24846160 */ addiu $a0, %lo(OSMesgQueue_80116160) # addiu $a0, $a0, 0x6160
/* 0035DC 800029DC 24846160 */ addiu $a0, %lo(gAudioMesgQueue) # addiu $a0, $a0, 0x6160
/* 0035E0 800029E0 0C032208 */ jal osCreateMesgQueue
/* 0035E4 800029E4 24060008 */ li $a2, 8
/* 0035E8 800029E8 3C048012 */ lui $a0, %hi(audDMAMessageQ) # $a0, 0x8012
@@ -110,8 +110,8 @@ glabel func_80002C00
/* 0039A8 80002DA8 AE000050 */ sw $zero, 0x50($s0)
/* 0039AC 80002DAC AE000054 */ sw $zero, 0x54($s0)
/* 0039B0 80002DB0 AE0C0074 */ sw $t4, 0x74($s0)
/* 0039B4 80002DB4 3C048011 */ lui $a0, %hi(D_80115F90) # $a0, 0x8011
/* 0039B8 80002DB8 8C845F90 */ lw $a0, %lo(D_80115F90)($a0)
/* 0039B4 80002DB4 3C048011 */ lui $a0, %hi(gAudioSched) # $a0, 0x8011
/* 0039B8 80002DB8 8C845F90 */ lw $a0, %lo(gAudioSched)($a0)
/* 0039BC 80002DBC 0C01E55D */ jal osScGetCmdQ
/* 0039C0 80002DC0 00000000 */ nop
/* 0039C4 80002DC4 00402025 */ move $a0, $v0
+2 -2
View File
@@ -22,8 +22,8 @@ glabel func_8007A98C
/* 07B5D8 8007A9D8 0C01EAE7 */ jal swap_framebuffers
/* 07B5DC 8007A9DC 00000000 */ nop
.L8007A9E0:
/* 07B5E0 8007A9E0 3C128012 */ lui $s2, %hi(D_801261A0) # $s2, 0x8012
/* 07B5E4 8007A9E4 265261A0 */ addiu $s2, %lo(D_801261A0) # addiu $s2, $s2, 0x61a0
/* 07B5E0 8007A9E0 3C128012 */ lui $s2, %hi(gVideoMesgQueue) # $s2, 0x8012
/* 07B5E4 8007A9E4 265261A0 */ addiu $s2, %lo(gVideoMesgQueue) # addiu $s2, $s2, 0x61a0
/* 07B5E8 8007A9E8 02402025 */ move $a0, $s2
/* 07B5EC 8007A9EC 00002825 */ move $a1, $zero
/* 07B5F0 8007A9F0 0C0322EC */ jal osRecvMesg
+7 -7
View File
@@ -2,7 +2,7 @@
#define _TYPES_H_
#ifndef NULL
#define NULL (void *)0
#define NULL 0
#endif
#define TRUE 1
@@ -10,12 +10,12 @@
typedef signed char s8;
typedef unsigned char u8;
typedef signed short int s16;
typedef unsigned short int u16;
typedef signed int s32;
typedef unsigned int u32;
typedef signed long long int s64;
typedef unsigned long long int u64;
typedef signed short s16;
typedef unsigned short u16;
typedef long s32;
typedef unsigned long u32;
typedef signed long long s64;
typedef unsigned long long u64;
typedef volatile u8 vu8;
typedef volatile u16 vu16;
+7 -2
View File
@@ -11,6 +11,11 @@
#define OS_SC_AUDIO_MSG 5
#define OS_SC_MAX_MESGS 8
#define OS_SC_ID_NONE 0
#define OS_SC_ID_AUDIO 1
#define OS_SC_ID_VIDEO 2
#define OS_SC_ID_PRENMI 3
/*
* OSScTask state
*/
@@ -65,7 +70,7 @@ typedef struct OSScTask_s {
} OSScTask;
typedef struct SCClient_s {
u8 unk0; /* Added by Rare? */
u8 id; /* Client ID, added by Rareware to single out individual scheduler clients*/
struct SCClient_s *next; /* next client in the list */
OSMesgQueue *msgQ; /* where to send the frame msg */
} OSScClient;
@@ -102,7 +107,7 @@ extern OSViMode osViModeTable[];
void __scYield(OSSched *sc);
void __scExec(OSSched *sc, OSScTask *sp, OSScTask *dp);
void osCreateScheduler(OSSched *sc, void *stack, OSPri priority, u8 mode, u8 numFields);
void osScAddClient(OSSched *sc, OSScClient *c, OSMesgQueue *msgQ, u8 arg3);
void osScAddClient(OSSched *sc, OSScClient *c, OSMesgQueue *msgQ, u8 id);
void osScRemoveClient(OSSched *sc, OSScClient *c);
OSMesgQueue *osScGetCmdQ(OSSched *sc);
OSMesgQueue *osScGetInterruptQ(OSSched *sc);
+4 -4
View File
@@ -104,14 +104,14 @@ void osCreateScheduler(OSSched *sc, void *stack, OSPri priority, u8 mode, u8 num
osStartThread(&sc->thread);
}
void osScAddClient(OSSched *sc, OSScClient *c, OSMesgQueue *msgQ, u8 arg3){
void osScAddClient(OSSched *sc, OSScClient *c, OSMesgQueue *msgQ, u8 id){
OSIntMask mask;
mask = osSetIntMask(OS_IM_NONE);
c->msgQ = msgQ;
c->next = sc->clientList;
c->unk0 = arg3;
c->id = id;
sc->clientList = c;
osSetIntMask(mask);
@@ -304,7 +304,7 @@ void __scHandleRetrace(OSSched *sc) {
}
for (client = sc->clientList; client != 0; client = client->next) {
if (client->unk0 == 1) {
if (client->id == OS_SC_ID_AUDIO) {
//Only run this on even calls to this function
if (gRetraceCounter64 % 2 == 0) {
osSendMesg(client->msgQ, sc, OS_MESG_NOBLOCK);
@@ -312,7 +312,7 @@ void __scHandleRetrace(OSSched *sc) {
func_80079760(sc);
}
}
} else if (client->unk0 == 2) {
} else if (client->id == OS_SC_ID_VIDEO) {
osSendMesg(client->msgQ, sc, OS_MESG_NOBLOCK);
}
}
+2 -2
View File
@@ -94,7 +94,7 @@ u32 D_80115F88;
/******************************/
void audio_init(OSSched *arg0) {
void audio_init(OSSched *sc) {
s32 iCnt;
ALSynConfig synth_config;
s32 *addrPtr;
@@ -152,7 +152,7 @@ void audio_init(OSSched *arg0) {
synth_config.fxType[1] = 2;
synth_config.outputRate = 0;
synth_config.heap = &gALHeap;
audioNewThread(&synth_config, 12, arg0);
audioNewThread(&synth_config, 12, sc);
gMusicPlayer = func_80002224(24, 120);
set_voice_limit(gMusicPlayer, 18);
gSndFxPlayer = func_80002224(16, 50);
+2
View File
@@ -16,6 +16,8 @@
#define SCREEN_WIDTH_FLOAT ((float)(SCREEN_WIDTH))
#define SCREEN_HEIGHT_FLOAT ((float)(SCREEN_HEIGHT))
#define SCREEN_WIDTH_FLOAT_HALF ((float)SCREEN_WIDTH / 2)
#define SCREEN_HEIGHT_FLOAT_HALF ((float)SCREEN_HEIGHT / 2)
#define CAMERA_ASPECT (SCREEN_WIDTH_FLOAT / SCREEN_HEIGHT_FLOAT)
#define CAMERA_FAR 15000.0f
+2 -2
View File
@@ -89,7 +89,7 @@ char gBuildString[40] = "Version 7.7 29/09/97 15.00 L.Schuneman";
s8 sAntiPiracyTriggered = 0;
s32 D_800DD378 = 1;
s32 D_800DD37C = 0;
s32 D_800DD380 = 0; // Currently unknown, might be a different type.
s32 D_800DD380 = 0;
s32 sControllerStatus = 0;
s32 D_800DD388 = 0; // Currently unknown, might be a different type.
s8 D_800DD38C = 0;
@@ -874,7 +874,7 @@ void init_game(void) {
func_80081218();
create_and_start_thread30();
osCreateMesgQueue(&gNMIMesgQueue, &gNMIMesgBuf, 1);
osScAddClient(&gMainSched, gNMISched, &gNMIMesgQueue, 3);
osScAddClient(&gMainSched, gNMISched, &gNMIMesgQueue, OS_SC_ID_PRENMI);
D_80123560[0] = 0;
D_80123504 = 0;
D_80123508 = 0;
+19 -19
View File
@@ -2341,42 +2341,42 @@ void menu_title_screen_init(void) {
void func_8008377C(s32 arg0, f32 arg1) {
u32 foo[2];
s32 var_a3;
f32 temp_f0;
s32 alpha;
f32 scale;
s32 i;
s32 var_s2;
s32 posY;
if (D_8012686C != 0) {
func_80067F2C(&sMenuCurrDisplayList, &sMenuCurrHudMat);
temp_f0 = (f32) D_8012686C * 0.03125f;
scale = (f32) D_8012686C * 0.03125f;
sMenuGuiOpacity = (D_8012686C * 8) - 1;
func_80068508(0);
if (temp_f0 != 1.0f) {
render_texture_rectangle_scaled(&sMenuCurrDisplayList, sGameTitleTileOffsets, 160.0f, 52.0f, temp_f0, temp_f0, -2U, 1);
if (scale != 1.0f) {
render_texture_rectangle_scaled(&sMenuCurrDisplayList, sGameTitleTileOffsets, SCREEN_WIDTH_FLOAT_HALF, 52.0f, scale, scale, 0xFFFFFFFE, 1);
} else {
render_textured_rectangle(&sMenuCurrDisplayList, sGameTitleTileOffsets, 160, 52, 255, 255, 255, 255);
render_textured_rectangle(&sMenuCurrDisplayList, sGameTitleTileOffsets, SCREEN_WIDTH_HALF, 52, 255, 255, 255, 255);
}
if (is_controller_missing() == 0) {
if (!is_controller_missing()) {
i = 0;
if (osTvType == OS_TV_TYPE_PAL) {
var_s2 = 0xDA;
if (osTvType == TV_TYPE_PAL) {
posY = SCREEN_HEIGHT - 22;
} else {
var_s2 = 0xC0;
posY = SCREEN_HEIGHT - 48;
}
set_text_font(0);
set_text_font(ASSET_FONTS_FUNFONT);
set_text_background_colour(0, 0, 0, 0);
while(gTitleMenuStrings[i] != NULL) {
if (i == gTitleScreenCurrentOption) {
var_a3 = (D_801263BC & 0x1F) * 0x10;
if (var_a3 >= 0x100) {
var_a3 = 0x1FF - var_a3;
alpha = (D_801263BC & 0x1F) * 16;
if (alpha > 255) {
alpha = 511 - alpha;
}
} else {
var_a3 = 0;
alpha = 0;
}
set_text_colour(255, 255, 255, var_a3, sMenuGuiOpacity);
draw_text(&sMenuCurrDisplayList, POS_CENTRED, var_s2, gTitleMenuStrings[i], ALIGN_MIDDLE_CENTER);
var_s2 += 0x10;
set_text_colour(255, 255, 255, alpha, sMenuGuiOpacity);
draw_text(&sMenuCurrDisplayList, POS_CENTRED, posY, gTitleMenuStrings[i], ALIGN_MIDDLE_CENTER);
posY += 16;
i++;
}
}
+6 -6
View File
@@ -9,12 +9,12 @@
// All of these are defined in unknown_003260_bss.c
// This was needed, since there is a bss reordering issue with D_80119BD0 and gAlSndPlayer
extern s32 D_80115F90;
extern s32 gAudioSched;
extern ALHeap *D_80115F94;
extern s32 D_80115F98[2];
extern s32 D_80115FA0[3];
extern OSThread audioThread;
extern OSMesgQueue OSMesgQueue_80116160;
extern OSMesgQueue gAudioMesgQueue;
extern OSMesg D_80116178[8];
extern OSMesgQueue D_80116198;
extern OSMesg D_801161B0[8];
@@ -89,7 +89,7 @@ void audioNewThread(ALSynConfig *c, OSPri p, OSSched *arg2) {
u32 tmp_size;
s32 tmp;
s32 i;
D_80115F90 = arg2;
gAudioSched = arg2;
D_80115F94 = c->heap;
c->dmaproc = &__amDmaNew;
c->outputRate = osAiSetFrequency(22050);
@@ -120,7 +120,7 @@ void audioNewThread(ALSynConfig *c, OSPri p, OSSched *arg2) {
alHeapDBAlloc(0, 0, c->heap, 1, 120);
osCreateMesgQueue(&D_80116198, &D_801161B0, 8);
osCreateMesgQueue(&OSMesgQueue_80116160, &D_80116178, 8);
osCreateMesgQueue(&gAudioMesgQueue, &D_80116178, 8);
osCreateMesgQueue(&audDMAMessageQ, &audDMAMessageBuf, 50);
osCreateThread(&audioThread, 4, &thread4_audio, NULL, &dmaState, p);
@@ -149,9 +149,9 @@ void thread4_audio(UNUSED void *arg) {
audioThreadRetraceMesg = NULL;
audioThreadUpdateMesg = NULL;
osScAddClient(D_80115F90, &audioStack, &OSMesgQueue_80116160, 1);
osScAddClient(gAudioSched, &audioStack, &gAudioMesgQueue, OS_SC_ID_AUDIO);
while (!audioThreadMarkExit) {
osRecvMesg(&OSMesgQueue_80116160, &audioThreadRetraceMesg, 1);
osRecvMesg(&gAudioMesgQueue, &audioThreadRetraceMesg, 1);
switch (*audioThreadRetraceMesg) {
case 1:
func_80002C00(D_80115F98[(((u32) audFrameCt % 3))+2], audioThreadUpdateMesg);
+2 -2
View File
@@ -4,12 +4,12 @@
#include "unknown_003260.h"
// This file is needed, since there is a bss reordering issue with D_80119BD0 and gAlSndPlayer
OSSched *D_80115F90;
OSSched *gAudioSched;
ALHeap *D_80115F94;
s32 D_80115F98[2];
s32 D_80115FA0[3];
OSThread audioThread;
OSMesgQueue OSMesgQueue_80116160;
OSMesgQueue gAudioMesgQueue;
OSMesg D_80116178[8];
OSMesgQueue D_80116198;
OSMesg D_801161B0[8];
+72 -61
View File
@@ -27,8 +27,8 @@ u32 D_800DE4C8 = 0;
s32 D_800DE4CC = 0;
unk800DE4D0 D_800DE4D0 = { NULL };
s32 D_800DE4D4 = 0;
s32 D_800DE4D8 = 0;
s32 gfxBufCounter = 0;
s32 gfxBufCounter2 = 0;
s32 D_800DE4DC = 0;
Gfx dRspInit[] = {
@@ -168,28 +168,32 @@ u8 D_80125F37;
s32 D_80125F38;
s32 D_80125F3C;
DKR_OSTask D_80125F40[2];
DKR_OSTask D_80126020[2];
DKR_OSTask gGfxTaskBuf[2];
DKR_OSTask gGfxTaskBuf2[2];
OSMesgQueue *osScInterruptQ;
/*******************************/
s32 setup_ostask_xbus(Gfx* arg0, Gfx* arg1, s32 arg2) {
/**
* Prepare the gfx task for the F3DDKR XBus microcode.
* Sends a message to the scheduler to start processing an RSP task once set up.
*/
s32 setup_ostask_xbus(Gfx* dlBegin, Gfx* dlEnd, UNUSED s32 recvMesg) {
DKR_OSTask *dkrtask;
D_800DE4DC = 1;
dkrtask = &D_80125F40[D_800DE4D4];
D_800DE4D4++;
if (D_800DE4D4 == 2) {
D_800DE4D4 = 0;
dkrtask = &gGfxTaskBuf[gfxBufCounter];
gfxBufCounter++;
if (gfxBufCounter == 2) {
gfxBufCounter = 0;
}
dkrtask->unk8 = 0x23;
dkrtask->unk50 = &D_80125ED8;
dkrtask->mesgQueue = &D_80125ED8;
dkrtask->unk58 = 0xFF0000FF;
dkrtask->unk5C = 0xFF0000FF;
dkrtask->task.data_ptr = arg0;
dkrtask->task.data_size = ((s32)arg1 - (s32)arg0) >> 3;
dkrtask->task.data_ptr = dlBegin;
dkrtask->task.data_size = ((s32) dlEnd - (s32) dlBegin) >> 3; // Shifted by 3, repsenting the size of the Gfx type.
dkrtask->task.type = 1;
dkrtask->task.flags = 2;
dkrtask->task.ucode_boot = rspF3DDKRBootStart;
@@ -206,7 +210,7 @@ s32 setup_ostask_xbus(Gfx* arg0, Gfx* arg1, s32 arg2) {
dkrtask->task.output_buff = NULL;
dkrtask->task.output_buff_size = NULL;
dkrtask->unk0 = 0;
dkrtask->unkC = (s32) gVideoCurrFramebuffer;
dkrtask->frameBuffer = (s32) gVideoCurrFramebuffer;
dkrtask->unk60 = 0xFF;
dkrtask->unk64 = 0xFF;
osWritebackDCacheAll();
@@ -214,18 +218,18 @@ s32 setup_ostask_xbus(Gfx* arg0, Gfx* arg1, s32 arg2) {
return 0;
}
void setup_ostask_xbus_2(Gfx* arg0, Gfx* arg1, s32 arg2) {
UNUSED void setup_ostask_xbus_2(Gfx* dlBegin, Gfx* dlEnd, s32 recvMesg) {
DKR_OSTask *dkrtask;
s32 *sp20;
s32 *mesgBuf;
sp20 = NULL;
dkrtask = &D_80126020[D_800DE4D8];
D_800DE4D8++;
if (D_800DE4D8 == 2) {
D_800DE4D8 = 0;
mesgBuf = NULL;
dkrtask = &gGfxTaskBuf2[gfxBufCounter2];
gfxBufCounter2++;
if (gfxBufCounter2 == 2) {
gfxBufCounter2 = 0;
}
dkrtask->task.data_ptr = arg0;
dkrtask->task.data_size = (s32) (((s32) (arg1 - arg0) << 3));
dkrtask->task.data_ptr = dlBegin;
dkrtask->task.data_size = (s32) (dlEnd - dlBegin) * sizeof(Gfx);
dkrtask->task.type = 1;
dkrtask->task.flags = 2;
dkrtask->task.ucode_boot = rspF3DDKRBootStart;
@@ -241,39 +245,45 @@ void setup_ostask_xbus_2(Gfx* arg0, Gfx* arg1, s32 arg2) {
dkrtask->task.output_buff_size = 0;
dkrtask->unk0 = 0;
dkrtask->unk8 = 3;
dkrtask->unk50 = &D_80125ED8;
dkrtask->mesgQueue = &D_80125ED8;
dkrtask->unk54 = D_800DE490;
dkrtask->unkC = (s32) gVideoCurrFramebuffer;
dkrtask->frameBuffer = (s32) gVideoCurrFramebuffer;
dkrtask->unk58 = 0xFF0000FF;
dkrtask->unk5C = 0xFF0000FF;
dkrtask->unk60 = 0xFF;
dkrtask->unk64 = 0xFF;
dkrtask->unk68 = 0;
if (arg2 != 0) {
dkrtask->unk50 = &D_80125EA0;
if (recvMesg) {
dkrtask->mesgQueue = &D_80125EA0;
}
osWritebackDCacheAll();
osSendMesg(osScInterruptQ, dkrtask, 1);
if (arg2 != 0) {
osRecvMesg(&D_80125EA0, &sp20, 1);
if (recvMesg) {
osRecvMesg(&D_80125EA0, &mesgBuf, 1);
}
}
void setup_ostask_fifo(Gfx* arg0, Gfx* arg1, s32 arg2) {
/**
*
* Prepare the gfx task for the F3DDKR FIFO microcode.
* Sends a message to the scheduler to start processing an RSP task once set up.
* Goes unused, and is broken.
*/
UNUSED void setup_ostask_fifo(Gfx* dlBegin, Gfx* dlEnd, s32 recvMesg) {
DKR_OSTask *dkrtask;
s32 *sp20;
s32 *mesgBuf;
sp20 = NULL;
dkrtask = &D_80126020[D_800DE4D8];
D_800DE4D8++;
if (D_800DE4D8 == 2) {
D_800DE4D8 = 0;
mesgBuf = NULL;
dkrtask = &gGfxTaskBuf2[gfxBufCounter2];
gfxBufCounter2++;
if (gfxBufCounter2 == 2) {
gfxBufCounter2 = 0;
}
dkrtask->task.data_ptr = arg0;
dkrtask->task.data_ptr = dlBegin;
dkrtask->task.ucode_boot = rspF3DDKRBootStart;
dkrtask->task.data_size = (s32) (((s32) (arg1 - arg0)) << 3);
dkrtask->task.data_size = (s32) (dlEnd - dlBegin) * sizeof(Gfx);
dkrtask->task.type = 1;
dkrtask->task.flags = 2;
dkrtask->task.ucode_boot_size = (s32) (rspF3DDKRDramStart - rspF3DDKRBootStart);
@@ -288,39 +298,40 @@ void setup_ostask_fifo(Gfx* arg0, Gfx* arg1, s32 arg2) {
dkrtask->task.yield_data_size = 0xA00;
dkrtask->unk0 = 0;
dkrtask->unk8 = 7;
dkrtask->unk50 = &D_80125ED8;
dkrtask->mesgQueue = &D_80125ED8;
dkrtask->unk54 = D_800DE490;
dkrtask->unkC = (s32) gVideoCurrFramebuffer;
dkrtask->frameBuffer = (s32) gVideoCurrFramebuffer;
dkrtask->unk58 = 0xFF0000FF;
dkrtask->unk5C = 0xFF0000FF;
dkrtask->unk60 = 0xFF;
dkrtask->unk64 = 0xFF;
dkrtask->unk68 = 0;
if (arg2 != 0) {
dkrtask->unk50 = &D_80125EA0;
if (recvMesg) {
dkrtask->mesgQueue = &D_80125EA0;
}
osWritebackDCacheAll();
osSendMesg(osScInterruptQ, dkrtask, 1);
if (arg2 != 0) {
osRecvMesg(&D_80125EA0, &sp20, 1);
if (recvMesg) {
osRecvMesg(&D_80125EA0, &mesgBuf, 1);
}
}
void setup_ostask_fifo_2(Gfx* arg0, Gfx* arg1, s32 arg2) {
UNUSED void setup_ostask_fifo_2(Gfx* dlBegin, Gfx* dlEnd, s32 recvMesg) {
DKR_OSTask *dkrtask;
s32 *sp20;
s32 *mesgBuf;
sp20 = NULL;
dkrtask = &D_80125F40[D_800DE4D4];
D_800DE4D4++;
if (D_800DE4D4 == 3) {
D_800DE4D4 = 0;
mesgBuf = NULL;
dkrtask = &gGfxTaskBuf[gfxBufCounter];
gfxBufCounter++;
// gfxBufCounter being 2 would mean an out of bounds access of gGfxTaskBuf
if (gfxBufCounter == 3) {
gfxBufCounter = 0;
}
dkrtask->task.data_size = (s32) (((s32) (arg1 - arg0)) << 3);
dkrtask->task.data_ptr = arg0;
dkrtask->task.data_size = (s32) (dlEnd - dlBegin) * sizeof(Gfx);
dkrtask->task.data_ptr = dlBegin;
dkrtask->task.type = 1;
dkrtask->task.flags = 2;
dkrtask->task.ucode_boot = rspF3DDKRBootStart;
@@ -336,34 +347,34 @@ void setup_ostask_fifo_2(Gfx* arg0, Gfx* arg1, s32 arg2) {
dkrtask->task.yield_data_size = 0xA00;
dkrtask->unk0 = 0;
dkrtask->unk8 = 7;
dkrtask->unk50 = &D_80125ED8;
dkrtask->mesgQueue = &D_80125ED8;
dkrtask->unk54 = D_800DE490;
dkrtask->unkC = (s32) gVideoCurrFramebuffer;
dkrtask->frameBuffer = (s32) gVideoCurrFramebuffer;
dkrtask->unk58 = 0xFF0000FF;
dkrtask->unk5C = 0xFF0000FF;
if (arg2 != 0) {
if (recvMesg) {
dkrtask->unk60 = 0xFF;
dkrtask->unk64 = 0xFF;
}
dkrtask->unk68 = 0;
osWritebackDCacheAll();
osSendMesg(osScInterruptQ, dkrtask, 1);
if (arg2 != 0) {
osRecvMesg(&D_80125ED8, &sp20, 1);
if (recvMesg) {
osRecvMesg(&D_80125ED8, &mesgBuf, 1);
}
}
s32 func_80077A54(void) {
s32 *sp1C = NULL;
OSMesg *mesg = NULL;
if (D_800DE4DC == 0) {
return 0;
}
osRecvMesg(&D_80125ED8, (OSMesg)&sp1C, OS_MESG_BLOCK);
osRecvMesg(&D_80125ED8, &mesg, OS_MESG_BLOCK);
D_800DE4DC = 0;
return sp1C[1];
return mesg[1];
}
void func_80077AAC(void *bufPtr, s32 bufSize, UNUSED s32 unused) {
UNUSED void func_80077AAC(void *bufPtr, s32 bufSize, UNUSED s32 unused) {
osWritebackDCacheAll();
while (osDpGetStatus() & DPC_CLR_CMD_CTR) {}
osDpSetNextBuffer(bufPtr, bufSize);
+4 -4
View File
@@ -19,9 +19,9 @@ typedef struct DKR_OSTask {
s32 unk0;
s32 unk4;
s32 unk8;
s32 unkC;
s32 frameBuffer;
OSTask_t task; // Size: 0x40 bytes
OSMesgQueue *unk50;
OSMesgQueue *mesgQueue;
s32 unk54;
s32 unk58;
s32 unk5C;
@@ -43,8 +43,8 @@ extern u32 D_800DE4C4;
extern u32 D_800DE4C8;
extern s32 D_800DE4CC;
extern s32 D_800DE4D4;
extern s32 D_800DE4D8;
extern s32 gfxBufCounter;
extern s32 gfxBufCounter2;
extern s32 D_800DE4DC;
// Defined in dkr.ld
+8 -8
View File
@@ -31,8 +31,8 @@ s32 gVideoRefreshRate;
f32 gVideoAspectRatio;
f32 gVideoHeightRatio;
s32 D_8012617C;
OSMesg D_80126180[8];
OSMesgQueue D_801261A0[8];
OSMesg gVideoMesgBuf[8];
OSMesgQueue gVideoMesgQueue[8];
OSViMode gTvViMode;
s32 gVideoFbWidths[2];
s32 gVideoFbHeights[2];
@@ -49,7 +49,7 @@ s32 D_801262E8[8];
u8 D_80126308;
u8 D_80126309;
s32 D_8012630C;
OSScClient D_80126310;
OSScClient gVideoSched;
/******************************/
@@ -87,8 +87,8 @@ void init_video(s32 videoModeIndex, OSSched *sc) {
init_framebuffer(1);
gVideoCurrFbIndex = 1;
swap_framebuffers();
osCreateMesgQueue((OSMesgQueue *)&D_801261A0, D_80126180, ARRAY_COUNT(D_80126180));
osScAddClient(sc, &D_80126310, (OSMesgQueue *)&D_801261A0, 2);
osCreateMesgQueue((OSMesgQueue *)&gVideoMesgQueue, gVideoMesgBuf, ARRAY_COUNT(gVideoMesgBuf));
osScAddClient(sc, &gVideoSched, (OSMesgQueue *)&gVideoMesgQueue, OS_SC_ID_VIDEO);
init_vi_settings();
D_801262D0 = 12;
osViBlack(TRUE);
@@ -272,7 +272,7 @@ s32 func_8007A98C(s32 arg0) {
if (arg0 != 8) {
swap_framebuffers();
}
while (osRecvMesg(&D_801261A0, NULL, OS_MESG_NOBLOCK) != -1) {
while (osRecvMesg(&gVideoMesgQueue, NULL, OS_MESG_NOBLOCK) != -1) {
tempUpdateRate += 1;
tempUpdateRate &= 0xFF;
}
@@ -292,12 +292,12 @@ s32 func_8007A98C(s32 arg0) {
}
}
while (tempUpdateRate < D_80126309) {
osRecvMesg(&D_801261A0, NULL, OS_MESG_BLOCK);
osRecvMesg(&gVideoMesgQueue, NULL, OS_MESG_BLOCK);
tempUpdateRate += 1;
tempUpdateRate &= 0xFF;
}
osViSwapBuffer(gVideoLastFramebuffer);
osRecvMesg(&D_801261A0, NULL, OS_MESG_BLOCK);
osRecvMesg(&gVideoMesgQueue, NULL, OS_MESG_BLOCK);
return tempUpdateRate;
}
#else