mirror of
https://github.com/izzy2lost/Diddy-Kong-Racing.git
synced 2026-06-19 01:16:26 -07:00
Organise textures_sprites.c with macros (#392)
* Update object_functions.c * step 1 * stage 2 * stage 3 * Update particles.h * stage 3 * Update particles.h * Update particles.h * gave preliminary names to things that have obvious looking properties * rename camera strusct cars * last minute changes * rename draw commands * Add macros for render mode tables * rename * Make them grouped entries * fix some oopsies and name the draw tables * funny flag * name another flag * comment render modes * Update objects.c * water * Fix oopsie regarding viewports in tracks.c * rename unknown_B7B30.c surprised I hadn't done this earlier * Fill some gaps I should've filled in yonks ago * Try again with the assert rename I should've known there was already a file called that lol
This commit is contained in:
@@ -36,8 +36,8 @@ glabel func_8007BF34
|
||||
/* 07CBB4 8007BFB4 8CE30000 */ lw $v1, ($a3)
|
||||
/* 07CBB8 8007BFB8 00000000 */ nop
|
||||
.L8007BFBC:
|
||||
/* 07CBBC 8007BFBC 3C0F8012 */ lui $t7, %hi(D_80126378) # $t7, 0x8012
|
||||
/* 07CBC0 8007BFC0 8DEF6378 */ lw $t7, %lo(D_80126378)($t7)
|
||||
/* 07CBBC 8007BFBC 3C0F8012 */ lui $t7, %hi(gBlockedRenderFlags) # $t7, 0x8012
|
||||
/* 07CBC0 8007BFC0 8DEF6378 */ lw $t7, %lo(gBlockedRenderFlags)($t7)
|
||||
/* 07CBC4 8007BFC4 3C01F7FF */ lui $at, (0xF7FFFFFF >> 16) # lui $at, 0xf7ff
|
||||
/* 07CBC8 8007BFC8 3421FFFF */ ori $at, (0xF7FFFFFF & 0xFFFF) # ori $at, $at, 0xffff
|
||||
/* 07CBCC 8007BFCC 00A17024 */ and $t6, $a1, $at
|
||||
@@ -87,8 +87,8 @@ glabel func_8007BF34
|
||||
/* 07CC70 8007C070 31AE0001 */ andi $t6, $t5, 1
|
||||
/* 07CC74 8007C074 000E7900 */ sll $t7, $t6, 4
|
||||
/* 07CC78 8007C078 3C018000 */ lui $at, 0x8000
|
||||
/* 07CC7C 8007C07C 3C19800E */ lui $t9, %hi(D_800DE848) # $t9, 0x800e
|
||||
/* 07CC80 8007C080 2739E848 */ addiu $t9, %lo(D_800DE848) # addiu $t9, $t9, -0x17b8
|
||||
/* 07CC7C 8007C07C 3C19800E */ lui $t9, %hi(dRenderSettingsSpriteCld) # $t9, 0x800e
|
||||
/* 07CC80 8007C080 2739E848 */ addiu $t9, %lo(dRenderSettingsSpriteCld) # addiu $t9, $t9, -0x17b8
|
||||
/* 07CC84 8007C084 01E1C021 */ addu $t8, $t7, $at
|
||||
/* 07CC88 8007C088 3C0C0702 */ lui $t4, (0x07020010 >> 16) # lui $t4, 0x702
|
||||
/* 07CC8C 8007C08C 244B0008 */ addiu $t3, $v0, 8
|
||||
@@ -103,8 +103,8 @@ glabel func_8007BF34
|
||||
/* 07CCAC 8007C0AC 24ACFFF0 */ addiu $t4, $a1, -0x10
|
||||
/* 07CCB0 8007C0B0 000C6900 */ sll $t5, $t4, 4
|
||||
/* 07CCB4 8007C0B4 3C018000 */ lui $at, 0x8000
|
||||
/* 07CCB8 8007C0B8 3C0F800E */ lui $t7, %hi(D_800DE868) # $t7, 0x800e
|
||||
/* 07CCBC 8007C0BC 25EFE868 */ addiu $t7, %lo(D_800DE868) # addiu $t7, $t7, -0x1798
|
||||
/* 07CCB8 8007C0B8 3C0F800E */ lui $t7, %hi(dRenderSettingsSpriteXlu) # $t7, 0x800e
|
||||
/* 07CCBC 8007C0BC 25EFE868 */ addiu $t7, %lo(dRenderSettingsSpriteXlu) # addiu $t7, $t7, -0x1798
|
||||
/* 07CCC0 8007C0C0 01A17021 */ addu $t6, $t5, $at
|
||||
/* 07CCC4 8007C0C4 244A0008 */ addiu $t2, $v0, 8
|
||||
/* 07CCC8 8007C0C8 AC8A0000 */ sw $t2, ($a0)
|
||||
@@ -116,10 +116,10 @@ glabel func_8007BF34
|
||||
/* 07CCDC 8007C0DC 8C820000 */ lw $v0, ($a0)
|
||||
/* 07CCE0 8007C0E0 00055100 */ sll $t2, $a1, 4
|
||||
/* 07CCE4 8007C0E4 3C018000 */ lui $at, 0x8000
|
||||
/* 07CCE8 8007C0E8 3C0C800E */ lui $t4, %hi(D_800DE8E8) # $t4, 0x800e
|
||||
/* 07CCE8 8007C0E8 3C0C800E */ lui $t4, %hi(dRenderSettingsCommon) # $t4, 0x800e
|
||||
/* 07CCEC 8007C0EC 24590008 */ addiu $t9, $v0, 8
|
||||
/* 07CCF0 8007C0F0 AC990000 */ sw $t9, ($a0)
|
||||
/* 07CCF4 8007C0F4 258CE8E8 */ addiu $t4, %lo(D_800DE8E8) # addiu $t4, $t4, -0x1718
|
||||
/* 07CCF4 8007C0F4 258CE8E8 */ addiu $t4, %lo(dRenderSettingsCommon) # addiu $t4, $t4, -0x1718
|
||||
/* 07CCF8 8007C0F8 01415821 */ addu $t3, $t2, $at
|
||||
/* 07CCFC 8007C0FC 3C090702 */ lui $t1, (0x07020010 >> 16) # lui $t1, 0x702
|
||||
/* 07CD00 8007C100 35290010 */ ori $t1, (0x07020010 & 0xFFFF) # ori $t1, $t1, 0x10
|
||||
@@ -127,11 +127,11 @@ glabel func_8007BF34
|
||||
/* 07CD08 8007C108 AC4D0004 */ sw $t5, 4($v0)
|
||||
/* 07CD0C 8007C10C AC490000 */ sw $t1, ($v0)
|
||||
.L8007C110:
|
||||
/* 07CD10 8007C110 3C018012 */ lui $at, %hi(D_8012637C) # $at, 0x8012
|
||||
/* 07CD14 8007C114 AC20637C */ sw $zero, %lo(D_8012637C)($at)
|
||||
/* 07CD18 8007C118 3C018012 */ lui $at, %hi(D_80126380) # $at, 0x8012
|
||||
/* 07CD10 8007C110 3C018012 */ lui $at, %hi(gCurrentTextureHeader) # $at, 0x8012
|
||||
/* 07CD14 8007C114 AC20637C */ sw $zero, %lo(gCurrentTextureHeader)($at)
|
||||
/* 07CD18 8007C118 3C018012 */ lui $at, %hi(gUsingTexture) # $at, 0x8012
|
||||
/* 07CD1C 8007C11C 240E0001 */ li $t6, 1
|
||||
/* 07CD20 8007C120 A42E6380 */ sh $t6, %lo(D_80126380)($at)
|
||||
/* 07CD20 8007C120 A42E6380 */ sh $t6, %lo(gUsingTexture)($at)
|
||||
.L8007C124:
|
||||
/* 07CD24 8007C124 03E00008 */ jr $ra
|
||||
/* 07CD28 8007C128 00000000 */ nop
|
||||
|
||||
@@ -15,12 +15,12 @@ glabel func_80078190
|
||||
/* 078DC4 800781C4 8FA40040 */ lw $a0, 0x40($sp)
|
||||
/* 078DC8 800781C8 00024403 */ sra $t0, $v0, 0x10
|
||||
/* 078DCC 800781CC 8C830000 */ lw $v1, ($a0)
|
||||
/* 078DD0 800781D0 3C19800E */ lui $t9, %hi(D_800DE598) # $t9, 0x800e
|
||||
/* 078DD0 800781D0 3C19800E */ lui $t9, %hi(dRaceFinishBackgroundSettings) # $t9, 0x800e
|
||||
/* 078DD4 800781D4 246F0008 */ addiu $t7, $v1, 8
|
||||
/* 078DD8 800781D8 AC8F0000 */ sw $t7, ($a0)
|
||||
/* 078DDC 800781DC 3C0A800E */ lui $t2, %hi(D_800DE4C8) # $t2, 0x800e
|
||||
/* 078DE0 800781E0 310EFFFF */ andi $t6, $t0, 0xffff
|
||||
/* 078DE4 800781E4 2739E598 */ addiu $t9, %lo(D_800DE598) # addiu $t9, $t9, -0x1a68
|
||||
/* 078DE4 800781E4 2739E598 */ addiu $t9, %lo(dRaceFinishBackgroundSettings) # addiu $t9, $t9, -0x1a68
|
||||
/* 078DE8 800781E8 3C180600 */ lui $t8, 0x600
|
||||
/* 078DEC 800781EC 254AE4C8 */ addiu $t2, %lo(D_800DE4C8) # addiu $t2, $t2, -0x1b38
|
||||
/* 078DF0 800781F0 01C04025 */ move $t0, $t6
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@
|
||||
#include "types.h"
|
||||
#include "macros.h"
|
||||
#include "audio_internal.h"
|
||||
#include "unknown_B7B30.h"
|
||||
#include "audio_assert.h"
|
||||
|
||||
// TODO: these come from headers
|
||||
#ident "$Revision: 1.17 $"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/* The comment below is needed for this file to be picked up by generate_ld */
|
||||
/* RAM_POS: 0x800B6F30 */
|
||||
|
||||
#include "unknown_B7B30.h"
|
||||
#include "audio_assert.h"
|
||||
|
||||
UNUSED void func_800B6F30(UNUSED int arg0, UNUSED int arg1, UNUSED int arg2) {}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef _UNKNOWN_B7B30_H_
|
||||
#define _UNKNOWN_B7B30_H_
|
||||
#ifndef _AUDIO_ASSERT_H_
|
||||
#define _AUDIO_ASSERT_H_
|
||||
|
||||
#include "types.h"
|
||||
#include "libultra_internal.h"
|
||||
+6
-6
@@ -48,7 +48,7 @@ ScreenViewport gScreenViewports[4] = {
|
||||
|
||||
u32 gViewportWithBG = FALSE;
|
||||
|
||||
Vertex D_800DD138 = {
|
||||
Vertex gVehiclePartVertex = {
|
||||
0, 0, 0, 255, 255, 255, 255
|
||||
};
|
||||
|
||||
@@ -1008,7 +1008,7 @@ s32 render_sprite_billboard(Gfx **dlist, MatrixS **mtx, Vertex **vertexList, Obj
|
||||
s32 var_s2;
|
||||
|
||||
result = TRUE;
|
||||
if (flags & RENDER_ANTI_ALIASING) {
|
||||
if (flags & RENDER_VEHICLE_PART) {
|
||||
sp5C = D_80120D28[D_80120D20] - obj->segment.trans.x_position;
|
||||
sp58 = D_80120D40[D_80120D20] - obj->segment.trans.y_position;
|
||||
var_f20 = D_80120D58[D_80120D20] - obj->segment.trans.z_position;
|
||||
@@ -1052,8 +1052,8 @@ s32 render_sprite_billboard(Gfx **dlist, MatrixS **mtx, Vertex **vertexList, Obj
|
||||
f32_matrix_mult(D_80120D70[D_80120D1C], &D_80120F20, &D_80121060);
|
||||
f32_matrix_to_s16_matrix(&D_80121060, *mtx);
|
||||
D_80120D88[D_80120D1C] = *mtx;
|
||||
gSPMatrix((*dlist)++, OS_PHYSICAL_TO_K0((*mtx)++), 0x80);
|
||||
gSPVertexDKR((*dlist)++, OS_K0_TO_PHYSICAL(&D_800DD138), 1, 0);
|
||||
gSPMatrix((*dlist)++, OS_PHYSICAL_TO_K0((*mtx)++), G_MTX_DKR_INDEX_2);
|
||||
gSPVertexDKR((*dlist)++, OS_K0_TO_PHYSICAL(&gVehiclePartVertex), 1, 0);
|
||||
} else {
|
||||
v = *vertexList;
|
||||
v->x = obj->segment.trans.x_position;
|
||||
@@ -1075,13 +1075,13 @@ s32 render_sprite_billboard(Gfx **dlist, MatrixS **mtx, Vertex **vertexList, Obj
|
||||
f32_matrix_from_rotation_and_scale((f32 (*)[4]) D_80120D70[D_80120D1C], sp34, obj->segment.trans.scale, gVideoAspectRatio);
|
||||
f32_matrix_to_s16_matrix(D_80120D70[D_80120D1C], *mtx);
|
||||
D_80120D88[D_80120D1C] = *mtx;
|
||||
gSPMatrix((*dlist)++, OS_PHYSICAL_TO_K0((*mtx)++), 0x80);
|
||||
gSPMatrix((*dlist)++, OS_PHYSICAL_TO_K0((*mtx)++), G_MTX_DKR_INDEX_2);
|
||||
gDkrEnableBillboard((*dlist)++);
|
||||
}
|
||||
if (D_80120D0C == 0) {
|
||||
var_s2 = ((var_s2 & 0xFF) * arg4->unk0) >> 8;
|
||||
}
|
||||
flags &= ~RENDER_ANTI_ALIASING;
|
||||
flags &= ~RENDER_VEHICLE_PART;
|
||||
if (flags & RENDER_SEMI_TRANSPARENT) {
|
||||
flags |= RENDER_ANTI_ALIASING;
|
||||
}
|
||||
|
||||
+2
-2
@@ -2470,7 +2470,7 @@ void func_8008377C(UNUSED s32 updateRate, f32 arg1) {
|
||||
sMenuGuiOpacity = (gTitleRevealTimer * 8) - 1;
|
||||
func_80068508(0);
|
||||
if (scale != 1.0f) {
|
||||
render_texture_rectangle_scaled(&sMenuCurrDisplayList, sGameTitleTileOffsets, SCREEN_WIDTH_FLOAT_HALF, 52.0f, scale, scale, 0xFFFFFFFE, 1);
|
||||
render_texture_rectangle_scaled(&sMenuCurrDisplayList, sGameTitleTileOffsets, SCREEN_WIDTH_FLOAT_HALF, 52.0f, scale, scale, 0xFFFFFFFE, TEXRECT_POINT);
|
||||
} else {
|
||||
render_textured_rectangle(&sMenuCurrDisplayList, sGameTitleTileOffsets, SCREEN_WIDTH_HALF, 52, 255, 255, 255, 255);
|
||||
}
|
||||
@@ -8432,7 +8432,7 @@ void render_track_selection_viewport_border(ObjectModel *objMdl) {
|
||||
flags = RENDER_FOG_ACTIVE | RENDER_SEMI_TRANSPARENT | RENDER_ANTI_ALIASING;
|
||||
}
|
||||
for (i = 0; i < objMdl->numberOfBatches; i++) {
|
||||
if (!(objMdl->batches[i].flags & 0x100)) {
|
||||
if (!(objMdl->batches[i].flags & RENDER_Z_UPDATE)) {
|
||||
vertOffset = objMdl->batches[i].verticesOffset;
|
||||
triOffset = objMdl->batches[i].facesOffset;
|
||||
numVerts = objMdl->batches[i + 1].verticesOffset - vertOffset;
|
||||
|
||||
+3
-3
@@ -1362,19 +1362,19 @@ void func_80011AD0(Object *this) {
|
||||
if (this->properties.characterFlag.characterID >= 0) {
|
||||
obj64 = this->unk64;
|
||||
func_80011960(this, obj64->character_flag.vertices, 4, obj64->character_flag.triangles,
|
||||
2, obj64->character_flag.texture, 11, 0, 1.0f);
|
||||
2, obj64->character_flag.texture, RENDER_ANTI_ALIASING | RENDER_Z_COMPARE | RENDER_FOG_ACTIVE, 0, 1.0f);
|
||||
}
|
||||
break;
|
||||
case BHV_BUTTERFLY:
|
||||
obj64 = this->unk64;
|
||||
func_80011960(this, &obj64->butterfly.vertices[obj64->butterfly.unkFC * 6], 6, obj64->butterfly.triangles, 8, obj64->butterfly.texture, 10, 0, 1.0f);
|
||||
func_80011960(this, &obj64->butterfly.vertices[obj64->butterfly.unkFC * 6], 6, obj64->butterfly.triangles, 8, obj64->butterfly.texture, RENDER_Z_COMPARE | RENDER_FOG_ACTIVE, 0, 1.0f);
|
||||
break;
|
||||
|
||||
case BHV_FISH:
|
||||
obj64 = this->unk64;
|
||||
tmp_f0 = this->segment.level_entry->fish.unkC[1];
|
||||
tmp_f0 *= 0.01f;
|
||||
func_80011960(this, &obj64->fish.vertices[obj64->fish.unkFC * 6], 6, obj64->fish.triangles, 8, obj64->fish.texture, 26, 0, tmp_f0);
|
||||
func_80011960(this, &obj64->fish.vertices[obj64->fish.unkFC * 6], 6, obj64->fish.triangles, 8, obj64->fish.texture, RENDER_Z_COMPARE | RENDER_FOG_ACTIVE | RENDER_CUTOUT, 0, tmp_f0);
|
||||
break;
|
||||
|
||||
case BHV_BOOST:
|
||||
|
||||
+226
-825
File diff suppressed because it is too large
Load Diff
+71
-75
@@ -9,91 +9,87 @@
|
||||
#include "memory.h"
|
||||
#include "libultra_internal.h"
|
||||
|
||||
/**
|
||||
* First two entries are combine mode.
|
||||
* Third entry is othermode high word. (Most importantly, the cycle mode and texture filter settings)
|
||||
* Fourth and fifth entries are render modes.
|
||||
*/
|
||||
#define DRAW_TABLE_ENTRY(combine1, combine2, cycleMode, renderMode1, renderMode2) { \
|
||||
gsDPSetCombineLERP(combine1, combine2), \
|
||||
gsDPSetOtherMode(cycleMode, DKR_OML_COMMON | renderMode1 | renderMode2), \
|
||||
}
|
||||
|
||||
/**
|
||||
* Diddy Kong Racing sets up many of the rendermode tables with a certain pattern.
|
||||
* First two entries are combine mode.
|
||||
* Third entry is othermode high word. (Most importantly, the cycle mode and texture filter settings)
|
||||
* Fourth and fifth entries are render modes for no AA or ZB
|
||||
* Sixth and seventh entries are render modes for for AA, but no ZB
|
||||
* Eighth and ninth entries are render modes for for ZB, but no AA
|
||||
* Tenth and eleventh entries are render modes for for AA and ZB
|
||||
*/
|
||||
#define DRAW_TABLE_GROUP(combine1, combine2, cycleMode, renderMode1, renderMode2, renderMode1AA, rendermode2AA, renderMode1ZB, rendermode2ZB, renderMode1ZBAA, renderMode2ZBAA) \
|
||||
{gsDPSetCombineLERP(combine1, combine2), gsDPSetOtherMode(cycleMode, DKR_OML_COMMON | renderMode1 | renderMode2), }, \
|
||||
{gsDPSetCombineLERP(combine1, combine2), gsDPSetOtherMode(cycleMode, DKR_OML_COMMON | renderMode1AA | rendermode2AA), }, \
|
||||
{gsDPSetCombineLERP(combine1, combine2), gsDPSetOtherMode(cycleMode, DKR_OML_COMMON | renderMode1ZB | rendermode2ZB), }, \
|
||||
{gsDPSetCombineLERP(combine1, combine2), gsDPSetOtherMode(cycleMode, DKR_OML_COMMON | renderMode1ZBAA | renderMode2ZBAA), }
|
||||
|
||||
enum RenderFlags {
|
||||
RENDER_NONE,
|
||||
RENDER_ANTI_ALIASING = (1 << 0),
|
||||
RENDER_Z_COMPARE = (1 << 1),
|
||||
RENDER_SEMI_TRANSPARENT = (1 << 2),
|
||||
RENDER_FOG_ACTIVE = (1 << 3),
|
||||
RENDER_UNK_0000010 = (1 << 4),
|
||||
RENDER_COLOUR_INDEX = (1 << 5),
|
||||
RENDER_UNK_0000040 = (1 << 6),
|
||||
RENDER_UNK_0000080 = (1 << 7),
|
||||
RENDER_Z_UPDATE = (1 << 8),
|
||||
RENDER_UNK_0000200 = (1 << 9),
|
||||
RENDER_UNK_0000400 = (1 << 10),
|
||||
RENDER_DECAL = (1 << 11),
|
||||
RENDER_UNK_0001000 = (1 << 12),
|
||||
RENDER_UNK_0002000 = (1 << 13),
|
||||
RENDER_UNK_0004000 = (1 << 14),
|
||||
RENDER_UNK_0008000 = (1 << 15),
|
||||
RENDER_UNK_0010000 = (1 << 16),
|
||||
RENDER_UNK_0020000 = (1 << 17),
|
||||
RENDER_UNK_0040000 = (1 << 18),
|
||||
RENDER_UNK_0080000 = (1 << 19),
|
||||
RENDER_UNK_0100000 = (1 << 20),
|
||||
RENDER_UNK_0200000 = (1 << 21),
|
||||
RENDER_UNK_0400000 = (1 << 22),
|
||||
RENDER_UNK_0800000 = (1 << 23),
|
||||
RENDER_UNK_1000000 = (1 << 24),
|
||||
RENDER_UNK_2000000 = (1 << 25),
|
||||
RENDER_UNK_4000000 = (1 << 26),
|
||||
RENDER_UNK_8000000 = (1 << 27),
|
||||
RENDER_VEHICLE_PART = (1 << 0), // Shares a spot with RENDER_ANTI_ALIASING, since TEX_EDGE enforces anti aliasing unconditionally.
|
||||
RENDER_ANTI_ALIASING = (1 << 0), // Smooths the edges to improve visual quality.
|
||||
RENDER_Z_COMPARE = (1 << 1), // Compares depth values with existing geometry to prevent rendering errors.
|
||||
RENDER_SEMI_TRANSPARENT = (1 << 2), // Renders with translucency enabled, blending with existing geometry.
|
||||
RENDER_FOG_ACTIVE = (1 << 3), // Applies fog to the geometry.
|
||||
RENDER_CUTOUT = (1 << 4), // A surface with 1 bit alpha cut out for quick transparency.
|
||||
RENDER_COLOUR_INDEX = (1 << 5), // Enables palleted textures.
|
||||
RENDER_UNK_0000040 = (1 << 6),
|
||||
RENDER_UNK_0000080 = (1 << 7),
|
||||
RENDER_Z_UPDATE = (1 << 8), // Updates the depth buffer when rendering.
|
||||
RENDER_PRESERVE_COVERAGE = (1 << 9), // Coverage is used to help smooth the image. This won't write over existing coverage values.
|
||||
RENDER_UNK_0000400 = (1 << 10),
|
||||
RENDER_DECAL = (1 << 11), // Projects a surface on existing geometry, taking precedent to not zfight.
|
||||
RENDER_UNK_0001000 = (1 << 12),
|
||||
RENDER_UNK_0002000 = (1 << 13),
|
||||
RENDER_UNK_0004000 = (1 << 14),
|
||||
RENDER_UNK_0008000 = (1 << 15),
|
||||
RENDER_UNK_0010000 = (1 << 16),
|
||||
RENDER_UNK_0020000 = (1 << 17),
|
||||
RENDER_UNK_0040000 = (1 << 18),
|
||||
RENDER_UNK_0080000 = (1 << 19),
|
||||
RENDER_UNK_0100000 = (1 << 20),
|
||||
RENDER_UNK_0200000 = (1 << 21),
|
||||
RENDER_UNK_0400000 = (1 << 22),
|
||||
RENDER_UNK_0800000 = (1 << 23),
|
||||
RENDER_UNK_1000000 = (1 << 24),
|
||||
RENDER_UNK_2000000 = (1 << 25),
|
||||
RENDER_UNK_4000000 = (1 << 26),
|
||||
RENDER_VTX_ALPHA = (1 << 27), // Allows use of vertex alpha, disabling fog if necessary.
|
||||
};
|
||||
|
||||
typedef enum TransFlags {
|
||||
OBJ_FLAGS_UNK_0000,
|
||||
OBJ_FLAGS_UNK_0001 = (1 << 0),
|
||||
OBJ_FLAGS_UNK_0002 = (1 << 1),
|
||||
OBJ_FLAGS_UNK_0004 = (1 << 2),
|
||||
OBJ_FLAGS_UNK_0008 = (1 << 3),
|
||||
OBJ_FLAGS_UNK_0010 = (1 << 4),
|
||||
OBJ_FLAGS_UNK_0020 = (1 << 5),
|
||||
OBJ_FLAGS_UNK_0040 = (1 << 6),
|
||||
OBJ_FLAGS_UNK_0080 = (1 << 7),
|
||||
OBJ_FLAGS_UNK_0100 = (1 << 8),
|
||||
OBJ_FLAGS_INVIS_PLAYER1 = (1 << 9), // Player 1 cannot see this.
|
||||
OBJ_FLAGS_INVIS_PLAYER2 = (1 << 10), // Player 2 cannot see this.
|
||||
OBJ_FLAGS_UNK_0800 = (1 << 11),
|
||||
OBJ_FLAGS_SHADOW_ONLY = (1 << 12), // Still has a shadow, but the model is invisible.
|
||||
OBJ_FLAGS_UNK_2000 = (1 << 13),
|
||||
OBJ_FLAGS_INVISIBLE = (1 << 14), // Invisible, and hidden shadow too.
|
||||
OBJ_FLAGS_DEACTIVATED = (1 << 15), // Object is invisible and inactive.
|
||||
OBJ_FLAGS_NONE,
|
||||
OBJ_FLAGS_UNK_0001 = (1 << 0),
|
||||
OBJ_FLAGS_UNK_0002 = (1 << 1),
|
||||
OBJ_FLAGS_UNK_0004 = (1 << 2),
|
||||
OBJ_FLAGS_UNK_0008 = (1 << 3),
|
||||
OBJ_FLAGS_UNK_0010 = (1 << 4),
|
||||
OBJ_FLAGS_UNK_0020 = (1 << 5),
|
||||
OBJ_FLAGS_UNK_0040 = (1 << 6),
|
||||
OBJ_FLAGS_UNK_0080 = (1 << 7),
|
||||
OBJ_FLAGS_UNK_0100 = (1 << 8),
|
||||
OBJ_FLAGS_INVIS_PLAYER1 = (1 << 9), // Player 1 cannot see this.
|
||||
OBJ_FLAGS_INVIS_PLAYER2 = (1 << 10), // Player 2 cannot see this.
|
||||
OBJ_FLAGS_UNK_0800 = (1 << 11),
|
||||
OBJ_FLAGS_SHADOW_ONLY = (1 << 12), // Still has a shadow, but the model is invisible.
|
||||
OBJ_FLAGS_UNK_2000 = (1 << 13),
|
||||
OBJ_FLAGS_INVISIBLE = (1 << 14), // Invisible, and hidden shadow too.
|
||||
OBJ_FLAGS_DEACTIVATED = (1 << 15), // Object is invisible and inactive.
|
||||
} TransFlags;
|
||||
|
||||
#define TEX_TABLE_2D 0
|
||||
#define TEX_TABLE_3D 1
|
||||
|
||||
extern u32 gTexColourTag;
|
||||
extern s32 D_800DE7C4;
|
||||
|
||||
extern Gfx D_800DF1A8[32][2];
|
||||
extern Gfx *gSceneCurrDisplayList;
|
||||
extern s32 gAntiAliasing;
|
||||
extern u32 D_8011D384;
|
||||
extern LevelHeader *gCurrentLevelHeader2;
|
||||
extern s32 gCurrentRenderFlags;
|
||||
extern TextureHeader *D_8012637C;
|
||||
extern s16 gForceFlags;
|
||||
extern Gfx dTextureRectangleModes[];
|
||||
extern Gfx D_800DE848[2][2];
|
||||
extern Gfx D_800DE868[8][2];
|
||||
extern Gfx D_800DE8E8[64][2];
|
||||
extern s32 D_80126378;
|
||||
extern s16 D_80126380;
|
||||
extern Gfx D_800DE7C8[8][2];
|
||||
extern Gfx D_800DECE8[16][2];
|
||||
extern Gfx D_800DEDE8[16][2];
|
||||
extern Gfx D_800DEEE8[4][2];
|
||||
extern Gfx D_800DEF28[16][2];
|
||||
extern Gfx D_800DF028[8][2];
|
||||
extern Gfx D_800DF0A8[16][2];
|
||||
extern s16 D_80126384;
|
||||
extern Gfx D_800DF3A8[6];
|
||||
extern Gfx D_800DF3D8[7];
|
||||
extern Gfx D_800DF410[3][2];
|
||||
|
||||
|
||||
/* Size: 8 bytes */
|
||||
typedef struct unk8007F1E8_18 {
|
||||
s32 unk0;
|
||||
|
||||
+19
-16
@@ -349,7 +349,7 @@ void render_scene(Gfx **dList, MatrixS **mtx, Vertex **vtx, TriangleList **tris,
|
||||
for (j = gSceneCurrentPlayerID = 0; j < numViewports; gSceneCurrentPlayerID++, j = gSceneCurrentPlayerID) {
|
||||
if (gCurrentLevelHeader2 && !gCurrentLevelHeader2 && !gCurrentLevelHeader2) {} // Fakematch
|
||||
if (j == 0) {
|
||||
if (func_8000E184() && numViewports == VIEWPORTS_COUNT_2_PLAYERS) {
|
||||
if (func_8000E184() && numViewports == 1) {
|
||||
gSceneCurrentPlayerID = PLAYER_TWO;
|
||||
}
|
||||
}
|
||||
@@ -361,7 +361,8 @@ void render_scene(Gfx **dList, MatrixS **mtx, Vertex **vtx, TriangleList **tris,
|
||||
set_active_camera(gSceneCurrentPlayerID);
|
||||
func_80066CDC(&gSceneCurrDisplayList, &gSceneCurrMatrix);
|
||||
func_8002A31C();
|
||||
if (numViewports < VIEWPORTS_COUNT_3_PLAYERS) {
|
||||
// Show detailed skydome in single player.
|
||||
if (numViewports < 2) {
|
||||
func_80068408(&gSceneCurrDisplayList, &gSceneCurrMatrix);
|
||||
if (gCurrentLevelHeader2->skyDome == -1) {
|
||||
func_80028050();
|
||||
@@ -377,22 +378,24 @@ void render_scene(Gfx **dList, MatrixS **mtx, Vertex **vtx, TriangleList **tris,
|
||||
gDPPipeSync(gSceneCurrDisplayList++);
|
||||
initialise_player_viewport_vars(updateRate);
|
||||
set_weather_limits(-1, -512);
|
||||
if (gCurrentLevelHeader2->weatherEnable > 0 && numViewports < VIEWPORTS_COUNT_3_PLAYERS) {
|
||||
// Show weather effects in single player.
|
||||
if (gCurrentLevelHeader2->weatherEnable > 0 && numViewports < 2) {
|
||||
process_weather(&gSceneCurrDisplayList, &gSceneCurrMatrix, &gSceneCurrVertexList, &gSceneCurrTriList, tempUpdateRate);
|
||||
}
|
||||
func_800AD030(get_active_camera_segment());
|
||||
func_800ACA20(&gSceneCurrDisplayList, &gSceneCurrMatrix, &gSceneCurrVertexList, get_active_camera_segment());
|
||||
render_hud(&gSceneCurrDisplayList, &gSceneCurrMatrix, &gSceneCurrVertexList, get_racer_object_by_port(gSceneCurrentPlayerID), updateRate);
|
||||
}
|
||||
|
||||
if (numViewports == VIEWPORTS_COUNT_4_PLAYERS && get_current_level_race_type() != RACETYPE_CHALLENGE_EGGS && get_current_level_race_type() != RACETYPE_CHALLENGE_BATTLE && get_current_level_race_type() != RACETYPE_CHALLENGE_BANANAS) {
|
||||
// Show TT Cam toggle for the fourth viewport when playing 3 player.
|
||||
if (numViewports == 3 && get_current_level_race_type() != RACETYPE_CHALLENGE_EGGS &&
|
||||
get_current_level_race_type() != RACETYPE_CHALLENGE_BATTLE && get_current_level_race_type() != RACETYPE_CHALLENGE_BANANAS) {
|
||||
if (get_hud_setting() == 0) {
|
||||
if (flip) {
|
||||
gSPSetGeometryMode(gSceneCurrDisplayList++, G_CULL_FRONT);
|
||||
}
|
||||
apply_fog(PLAYER_FOUR);
|
||||
gDPPipeSync(gSceneCurrDisplayList++);
|
||||
set_active_camera(3);
|
||||
set_active_camera(PLAYER_FOUR);
|
||||
disable_cutscene_camera();
|
||||
func_800278E8(updateRate);
|
||||
func_80066CDC(&gSceneCurrDisplayList, &gSceneCurrMatrix);
|
||||
@@ -406,17 +409,17 @@ void render_scene(Gfx **dList, MatrixS **mtx, Vertex **vtx, TriangleList **tris,
|
||||
set_weather_limits(-1, -512);
|
||||
func_800AD030(get_active_camera_segment());
|
||||
func_800ACA20(&gSceneCurrDisplayList, &gSceneCurrMatrix, &gSceneCurrVertexList, get_active_camera_segment());
|
||||
set_text_font(0);
|
||||
set_text_font(FONT_COLOURFUL);
|
||||
if (osTvType == TV_TYPE_PAL) {
|
||||
posX = 166;
|
||||
posY = 138;
|
||||
posX = SCREEN_WIDTH_HALF + 6;
|
||||
posY = SCREEN_HEIGHT_HALF_PAL + 6;
|
||||
} else {
|
||||
posX = 170;
|
||||
posY = 125;
|
||||
posX = SCREEN_WIDTH_HALF + 10;
|
||||
posY = SCREEN_HEIGHT_HALF + 5;
|
||||
}
|
||||
draw_text(&gSceneCurrDisplayList, posX, posY, (char *)(&gViewport4Text), ALIGN_TOP_LEFT);
|
||||
draw_text(&gSceneCurrDisplayList, posX, posY, (char *)(&gViewport4Text), ALIGN_TOP_LEFT); // TT CAM
|
||||
} else {
|
||||
set_active_camera(3);
|
||||
set_active_camera(PLAYER_FOUR);
|
||||
func_800278E8(updateRate);
|
||||
}
|
||||
}
|
||||
@@ -1070,13 +1073,13 @@ void render_level_segment(s32 segmentId, s32 nonOpaque) {
|
||||
if (!(batchFlags & BATCH_FLAGS_DEPTH_WRITE) && !(batchFlags & BATCH_FLAGS_UNK00000800)) {
|
||||
batchFlags |= gAntiAliasing;
|
||||
}
|
||||
if ((!(textureFlags & RENDER_SEMI_TRANSPARENT) && !(batchFlags & BATCH_FLAGS_UNK00002000)) || batchFlags & BATCH_FLAGS_UNK00000800) {
|
||||
if ((!(textureFlags & RENDER_SEMI_TRANSPARENT) && !(batchFlags & BATCH_FLAGS_WATER)) || batchFlags & BATCH_FLAGS_UNK00000800) {
|
||||
renderBatch = TRUE;
|
||||
}
|
||||
if (nonOpaque) {
|
||||
renderBatch = (renderBatch + 1) & 1;
|
||||
}
|
||||
if (sp78 && batchFlags & BATCH_FLAGS_UNK00002000) {
|
||||
if (sp78 && batchFlags & BATCH_FLAGS_WATER) {
|
||||
renderBatch = FALSE;
|
||||
}
|
||||
if (!renderBatch) {
|
||||
@@ -1462,7 +1465,7 @@ s32 check_if_in_draw_range(Object *obj) {
|
||||
alpha = 255;
|
||||
viewDistance = obj->segment.header->drawDistance;
|
||||
if (obj->segment.header->drawDistance) {
|
||||
if (gScenePlayerViewports == VIEWPORTS_COUNT_4_PLAYERS) {
|
||||
if (gScenePlayerViewports == 3) {
|
||||
viewDistance *= 0.5;
|
||||
}
|
||||
|
||||
|
||||
@@ -24,8 +24,8 @@ enum TriangleBatchFlags {
|
||||
BATCH_FLAGS_UNK00000400 = (1 << 10),
|
||||
BATCH_FLAGS_UNK00000800 = (1 << 11),
|
||||
BATCH_FLAGS_UNK00001000 = (1 << 12),
|
||||
BATCH_FLAGS_UNK00002000 = (1 << 13),
|
||||
BATCH_FLAGS_FORCE_NO_SHADOWS = (1 << 14),
|
||||
BATCH_FLAGS_WATER = (1 << 13),
|
||||
BATCH_FLAGS_FORCE_NO_SHADOWS = (1 << 14),
|
||||
BATCH_FLAGS_ENVMAP = (1 << 15),
|
||||
BATCH_FLAGS_TEXTURE_ANIM = (1 << 16),
|
||||
BATCH_FLAGS_UNK00020000 = (1 << 17),
|
||||
|
||||
+36
-55
@@ -24,7 +24,7 @@ s32 sBackgroundFillColour = GPACK_RGBA5551(0, 0, 0, 1) | (GPACK_RGBA5551(0, 0, 0
|
||||
u32 D_800DE4C0 = 0x40;
|
||||
TextureHeader *D_800DE4C4 = 0;
|
||||
TextureHeader *D_800DE4C8 = 0;
|
||||
s32 gChecquerBGEnabled = 0;
|
||||
s32 gChequerBGEnabled = FALSE;
|
||||
|
||||
BackgroundFunction gBackgroundDrawFunc = { NULL };
|
||||
s32 gfxBufCounter = 0;
|
||||
@@ -59,7 +59,7 @@ Gfx dRdpInit[] = {
|
||||
gsSPEndDisplayList(),
|
||||
};
|
||||
|
||||
Gfx D_800DE598[] = {
|
||||
Gfx dRaceFinishBackgroundSettings[] = {
|
||||
gsDPPipeSync(),
|
||||
gsDPSetTextureLOD(G_TL_TILE),
|
||||
gsDPSetTextureLUT(G_TT_NONE),
|
||||
@@ -95,7 +95,7 @@ Gfx dTextureRectangleModes[] = {
|
||||
gsSPEndDisplayList(),
|
||||
};
|
||||
|
||||
Gfx D_800DE670[] = {
|
||||
Gfx dScaledRectangleBaseModes[] = {
|
||||
gsDPPipeSync(),
|
||||
gsDPSetTextureLOD(G_TL_TILE),
|
||||
gsDPSetTextureLUT(G_TT_NONE),
|
||||
@@ -106,41 +106,21 @@ Gfx D_800DE670[] = {
|
||||
};
|
||||
|
||||
Gfx dTextureRectangleScaledOpa[][2] = {
|
||||
{
|
||||
gsDPSetCombineMode(G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM),
|
||||
gsDPSetOtherMode(DKR_OMH_1CYC_BILERP_NOPERSP, DKR_OML_COMMON | G_RM_AA_OPA_SURF | G_RM_AA_OPA_SURF2),
|
||||
},
|
||||
{
|
||||
gsDPSetCombineMode(G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM),
|
||||
gsDPSetOtherMode(DKR_OMH_1CYC_BILERP_NOPERSP, DKR_OML_COMMON | G_RM_OPA_SURF | G_RM_OPA_SURF2),
|
||||
},
|
||||
{
|
||||
gsDPSetCombineMode(G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM),
|
||||
gsDPSetOtherMode(DKR_OMH_1CYC_POINT_NOPERSP, DKR_OML_COMMON | G_RM_AA_OPA_SURF | G_RM_AA_OPA_SURF2),
|
||||
},
|
||||
{
|
||||
gsDPSetCombineMode(G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM),
|
||||
gsDPSetOtherMode(DKR_OMH_1CYC_POINT_NOPERSP, DKR_OML_COMMON | G_RM_OPA_SURF | G_RM_OPA_SURF2),
|
||||
},
|
||||
// Bilinear Filtered texture
|
||||
DRAW_TABLE_ENTRY(G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM, DKR_OMH_1CYC_BILERP_NOPERSP, G_RM_AA_OPA_SURF, G_RM_AA_OPA_SURF2),
|
||||
DRAW_TABLE_ENTRY(G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM, DKR_OMH_1CYC_BILERP_NOPERSP, G_RM_OPA_SURF, G_RM_OPA_SURF2),
|
||||
// Point Sampled texture
|
||||
DRAW_TABLE_ENTRY(G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM, DKR_OMH_1CYC_POINT_NOPERSP, G_RM_AA_OPA_SURF, G_RM_AA_OPA_SURF2),
|
||||
DRAW_TABLE_ENTRY(G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM, DKR_OMH_1CYC_POINT_NOPERSP, G_RM_OPA_SURF, G_RM_OPA_SURF2)
|
||||
};
|
||||
|
||||
Gfx dTextureRectangleScaledXlu[][2] = {
|
||||
{
|
||||
gsDPSetCombineMode(G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM),
|
||||
gsDPSetOtherMode(DKR_OMH_1CYC_BILERP_NOPERSP, DKR_OML_COMMON | G_RM_AA_XLU_SURF | G_RM_AA_XLU_SURF2),
|
||||
},
|
||||
{
|
||||
gsDPSetCombineMode(G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM),
|
||||
gsDPSetOtherMode(DKR_OMH_1CYC_BILERP_NOPERSP, DKR_OML_COMMON | G_RM_XLU_SURF | G_RM_XLU_SURF2),
|
||||
},
|
||||
{
|
||||
gsDPSetCombineMode(G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM),
|
||||
gsDPSetOtherMode(DKR_OMH_1CYC_POINT_NOPERSP, DKR_OML_COMMON | G_RM_AA_XLU_SURF | G_RM_AA_XLU_SURF2),
|
||||
},
|
||||
{
|
||||
gsDPSetCombineMode(G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM),
|
||||
gsDPSetOtherMode(DKR_OMH_1CYC_POINT_NOPERSP, DKR_OML_COMMON | G_RM_XLU_SURF | G_RM_XLU_SURF2),
|
||||
},
|
||||
// Bilinear Filtered texture
|
||||
DRAW_TABLE_ENTRY(G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM, DKR_OMH_1CYC_BILERP_NOPERSP, G_RM_AA_XLU_SURF, G_RM_AA_XLU_SURF2),
|
||||
DRAW_TABLE_ENTRY(G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM, DKR_OMH_1CYC_BILERP_NOPERSP, G_RM_XLU_SURF, G_RM_XLU_SURF2),
|
||||
// Point Sampled texture
|
||||
DRAW_TABLE_ENTRY(G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM, DKR_OMH_1CYC_POINT_NOPERSP, G_RM_AA_XLU_SURF, G_RM_AA_XLU_SURF2),
|
||||
DRAW_TABLE_ENTRY(G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM, DKR_OMH_1CYC_POINT_NOPERSP, G_RM_XLU_SURF, G_RM_XLU_SURF2)
|
||||
};
|
||||
|
||||
/*******************************/
|
||||
@@ -196,14 +176,14 @@ s32 setup_ostask_xbus(Gfx* dlBegin, Gfx* dlEnd, UNUSED s32 recvMesg) {
|
||||
dkrtask->task.data_ptr = (u64 *) dlBegin;
|
||||
dkrtask->task.data_size = ((s32) dlEnd - (s32) dlBegin) >> 3; // Shifted by 3, repsenting the size of the Gfx type.
|
||||
dkrtask->task.type = M_GFXTASK;
|
||||
dkrtask->task.flags = 2;
|
||||
dkrtask->task.flags = OS_TASK_DP_WAIT;
|
||||
dkrtask->task.ucode_boot = (u64 *) rspF3DDKRBootStart;
|
||||
dkrtask->task.ucode_boot_size = (s32) (rspF3DDKRDramStart - rspF3DDKRBootStart);
|
||||
dkrtask->task.ucode = (u64 *) rspF3DDKRXbusStart;
|
||||
dkrtask->task.ucode_data = (u64 *) rspF3DDKRDataXbusStart;
|
||||
dkrtask->task.ucode_data_size = 0x800;
|
||||
dkrtask->task.ucode_data_size = SP_UCODE_DATA_SIZE;
|
||||
dkrtask->task.dram_stack = (u64 *) gDramStack;
|
||||
dkrtask->task.dram_stack_size = 0x400;
|
||||
dkrtask->task.dram_stack_size = SP_DRAM_STACK_SIZE8;
|
||||
dkrtask->task.output_buff = (u64 *) gGfxSPTaskYieldBuffer;
|
||||
dkrtask->task.output_buff_size = (u64 *) &D_80125EA0;
|
||||
dkrtask->task.yield_data_ptr = (u64 *) gGfxTaskYieldData;
|
||||
@@ -236,14 +216,14 @@ UNUSED void setup_ostask_xbus_2(Gfx* dlBegin, Gfx* dlEnd, s32 recvMesg) {
|
||||
dkrtask->task.data_ptr = (u64 *) dlBegin;
|
||||
dkrtask->task.data_size = (s32) (dlEnd - dlBegin) * sizeof(Gfx);
|
||||
dkrtask->task.type = M_GFXTASK;
|
||||
dkrtask->task.flags = 2;
|
||||
dkrtask->task.flags = OS_TASK_DP_WAIT;
|
||||
dkrtask->task.ucode_boot = (u64 *) rspF3DDKRBootStart;
|
||||
dkrtask->task.ucode_boot_size = (s32) (rspF3DDKRDramStart - rspF3DDKRBootStart);
|
||||
dkrtask->task.ucode = (u64 *) rspF3DDKRXbusStart;
|
||||
dkrtask->task.ucode_data = (u64 *) rspF3DDKRDataXbusStart;
|
||||
dkrtask->task.ucode_data_size = 0x800;
|
||||
dkrtask->task.ucode_data_size = SP_UCODE_DATA_SIZE;
|
||||
dkrtask->task.dram_stack = (u64 *) gDramStack;
|
||||
dkrtask->task.dram_stack_size = 0x400;
|
||||
dkrtask->task.dram_stack_size = SP_DRAM_STACK_SIZE8;
|
||||
dkrtask->task.yield_data_ptr = (u64 *) gGfxTaskYieldData;
|
||||
dkrtask->task.yield_data_size = sizeof(gGfxTaskYieldData);
|
||||
dkrtask->task.output_buff = NULL;
|
||||
@@ -290,13 +270,13 @@ UNUSED void setup_ostask_fifo(Gfx* dlBegin, Gfx* dlEnd, s32 recvMesg) {
|
||||
dkrtask->task.ucode_boot = (u64 *) rspF3DDKRBootStart;
|
||||
dkrtask->task.data_size = (s32) (dlEnd - dlBegin) * sizeof(Gfx);
|
||||
dkrtask->task.type = M_GFXTASK;
|
||||
dkrtask->task.flags = 2;
|
||||
dkrtask->task.flags = OS_TASK_DP_WAIT;
|
||||
dkrtask->task.ucode_boot_size = (s32) (rspF3DDKRDramStart - rspF3DDKRBootStart);
|
||||
dkrtask->task.ucode = (u64 *) rspF3DDKRFifoStart;
|
||||
dkrtask->task.ucode_data = (u64 *) rspF3DDKRDataFifoStart;
|
||||
dkrtask->task.ucode_data_size = 0x800;
|
||||
dkrtask->task.ucode_data_size = SP_UCODE_DATA_SIZE;
|
||||
dkrtask->task.dram_stack = (u64 *) gDramStack;
|
||||
dkrtask->task.dram_stack_size = 0x400;
|
||||
dkrtask->task.dram_stack_size = SP_DRAM_STACK_SIZE8;
|
||||
dkrtask->task.output_buff = (u64 *) gGfxSPTaskYieldBuffer;
|
||||
dkrtask->task.output_buff_size = (u64 *) (gGfxSPTaskYieldBuffer + YIELD_BUFFER_SIZE);
|
||||
dkrtask->task.yield_data_ptr = (u64 *) gGfxTaskYieldData;
|
||||
@@ -342,14 +322,14 @@ UNUSED void setup_ostask_fifo_2(Gfx* dlBegin, Gfx* dlEnd, s32 recvMesg) {
|
||||
dkrtask->task.data_size = (s32) (dlEnd - dlBegin) * sizeof(Gfx);
|
||||
dkrtask->task.data_ptr = (u64 *) dlBegin;
|
||||
dkrtask->task.type = M_GFXTASK;
|
||||
dkrtask->task.flags = 2;
|
||||
dkrtask->task.flags = OS_TASK_DP_WAIT;
|
||||
dkrtask->task.ucode_boot = (u64 *) rspF3DDKRBootStart;
|
||||
dkrtask->task.ucode_boot_size = (s32) (rspF3DDKRDramStart - rspF3DDKRBootStart);
|
||||
dkrtask->task.ucode = (u64 *) rspF3DDKRFifoStart;
|
||||
dkrtask->task.ucode_data = (u64 *) rspF3DDKRDataFifoStart;
|
||||
dkrtask->task.ucode_data_size = 0x800;
|
||||
dkrtask->task.ucode_data_size = SP_UCODE_DATA_SIZE;
|
||||
dkrtask->task.dram_stack = (u64 *) gDramStack;
|
||||
dkrtask->task.dram_stack_size = 0x400;
|
||||
dkrtask->task.dram_stack_size = SP_DRAM_STACK_SIZE8;
|
||||
dkrtask->task.output_buff = (u64 *) gGfxSPTaskYieldBuffer;
|
||||
dkrtask->task.output_buff_size = (u64 *) &D_80125EA0;
|
||||
dkrtask->task.yield_data_ptr = (u64 *) gGfxTaskYieldData;
|
||||
@@ -445,8 +425,8 @@ void render_background(Gfx **dList, Matrix *mtx, s32 drawBG) {
|
||||
gDPSetColorImage((*dList)++, G_IM_FMT_RGBA, G_IM_SIZ_16b, w, SEGMENT_COLOUR_BUFFER);
|
||||
if (drawBG) {
|
||||
if (check_viewport_background_flag(0)) {
|
||||
if (gChecquerBGEnabled) {
|
||||
render_chequer_background(dList);
|
||||
if (gChequerBGEnabled) {
|
||||
render_chequer_background(dList); // Unused
|
||||
} else if (D_800DE4C4) {
|
||||
func_80078190(dList);
|
||||
} else if (gBackgroundDrawFunc.ptr != NULL) {
|
||||
@@ -455,6 +435,7 @@ void render_background(Gfx **dList, Matrix *mtx, s32 drawBG) {
|
||||
gDPSetFillColor((*dList)++, sBackgroundFillColour);
|
||||
gDPFillRectangle((*dList)++, 0, 0, w - 1, h - 1);
|
||||
}
|
||||
// Used for secondary viewport backgrounds. This does not need to be 1 cycle, this could easily work with fillmode.
|
||||
if (copy_viewport_background_size_to_coords(0, &x1, &y1, &x2, &y2)) {
|
||||
gDPSetCycleType((*dList)++, G_CYC_1CYCLE);
|
||||
gDPSetPrimColor((*dList)++, 0, 0, sBackgroundPrimColourR, sBackgroundPrimColourG, sBackgroundPrimColourB, 255);
|
||||
@@ -463,8 +444,8 @@ void render_background(Gfx **dList, Matrix *mtx, s32 drawBG) {
|
||||
gDPFillRectangle((*dList)++, x1, y1, x2, y2);
|
||||
}
|
||||
} else {
|
||||
if (gChecquerBGEnabled) {
|
||||
render_chequer_background(dList);
|
||||
if (gChequerBGEnabled) {
|
||||
render_chequer_background(dList); // Unused
|
||||
} else if (D_800DE4C4) {
|
||||
func_80078190(dList);
|
||||
} else if (gBackgroundDrawFunc.ptr != NULL) {
|
||||
@@ -543,7 +524,7 @@ void func_80078190(Gfx **dlist) {
|
||||
widthAndHeight = get_video_width_and_height_as_s32();
|
||||
videoWidth = GET_VIDEO_WIDTH(widthAndHeight);
|
||||
videoHeight = GET_VIDEO_HEIGHT(widthAndHeight);
|
||||
gSPDisplayList((*dlist)++, D_800DE598);
|
||||
gSPDisplayList((*dlist)++, dRaceFinishBackgroundSettings);
|
||||
|
||||
if (D_800DE4C8 == NULL) {
|
||||
gDkrDmaDisplayList((*dlist)++, OS_PHYSICAL_TO_K0(D_800DE4C4->cmd), D_800DE4C4->numberOfCommands);
|
||||
@@ -640,14 +621,14 @@ UNUSED void set_chequer_background(s32 colourA, s32 colourB, s32 width, s32 heig
|
||||
gChequerBGColourA2 = colourB & 0xFF;
|
||||
gChequerBGWidth = width;
|
||||
gChequerBGHeight = height;
|
||||
gChecquerBGEnabled = TRUE;
|
||||
gChequerBGEnabled = TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Disables the chequer background.
|
||||
*/
|
||||
UNUSED void disable_chequer_background(void) {
|
||||
gChecquerBGEnabled = FALSE;
|
||||
gChequerBGEnabled = FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -767,7 +748,7 @@ void render_texture_rectangle_scaled(Gfx **dlist, DrawTexture *element, f32 xPos
|
||||
dmaDlist = dTextureRectangleScaledXlu[(u8)flags & 0xFF];
|
||||
}
|
||||
|
||||
gSPDisplayList((*dlist)++, D_800DE670);
|
||||
gSPDisplayList((*dlist)++, dScaledRectangleBaseModes);
|
||||
gDkrDmaDisplayList((*dlist)++, OS_PHYSICAL_TO_K0(dmaDlist), numberOfGfxCommands(dTextureRectangleScaledOpa[0]));
|
||||
gDPSetPrimColorRGBA((*dlist)++, colour);
|
||||
|
||||
|
||||
@@ -13,6 +13,11 @@
|
||||
#define SEGMENT_DEPTH_BUFFER 0x02000000
|
||||
#define SEGMENT_COLOUR_BUFFER 0x01000000
|
||||
|
||||
enum TextureRectangleFlags {
|
||||
TEXRECT_BILERP,
|
||||
TEXRECT_POINT
|
||||
};
|
||||
|
||||
typedef union {
|
||||
void (*function)(Gfx*, Matrix *);
|
||||
void *ptr;
|
||||
@@ -43,7 +48,7 @@ extern s32 sBackgroundFillColour;
|
||||
|
||||
extern TextureHeader *D_800DE4C4;
|
||||
extern TextureHeader *D_800DE4C8;
|
||||
extern s32 gChecquerBGEnabled;
|
||||
extern s32 gChequerBGEnabled;
|
||||
|
||||
extern s32 gfxBufCounter;
|
||||
extern s32 gfxBufCounter2;
|
||||
|
||||
Reference in New Issue
Block a user