Merge pull request #1863 from KieronJ/sndtest

Match FogShadeChanl for s12c
This commit is contained in:
Kieron 2024-02-06 00:07:33 +00:00 committed by GitHub
commit fceec54aba
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 98 additions and 261 deletions

View File

@ -1,260 +0,0 @@
opt c+, at+, e+, n-
section overlay.text
xdef FogShadeChanl_800D6A04
FogShadeChanl_800D6A04:
dw 0x27BDFF90 ; 800D6A04
dw 0xAFB70064 ; 800D6A08
dw 0x00A0B821 ; 800D6A0C
dw 0x00003821 ; 800D6A10
dw 0x00E04821 ; 800D6A14
dw 0x00E05021 ; 800D6A18
dw 0xAFBF006C ; 800D6A1C
dw 0xAFBE0068 ; 800D6A20
dw 0xAFB60060 ; 800D6A24
dw 0xAFB5005C ; 800D6A28
dw 0xAFB40058 ; 800D6A2C
dw 0xAFB30054 ; 800D6A30
dw 0xAFB20050 ; 800D6A34
dw 0xAFB1004C ; 800D6A38
dw 0xAFB00048 ; 800D6A3C
dw 0x48C7A800 ; 800D6A40
dw 0x48C9B000 ; 800D6A44
dw 0x48CAB800 ; 800D6A48
dw 0x84960056 ; 800D6A4C
dw 0x8C9E0058 ; 800D6A50
dw 0x1AC000DE ; 800D6A54
dw 0x27AB0010 ; 800D6A58
dw 0xAFAB0040 ; 800D6A5C
dw 0x8FD30000 ; 800D6A60
dw 0x00000000 ; 800D6A64
dw 0x86620032 ; 800D6A68
dw 0x00000000 ; 800D6A6C
dw 0x104000D2 ; 800D6A70
dw 0x27DE0004 ; 800D6A74
dw 0x8E630028 ; 800D6A78
dw 0x00000000 ; 800D6A7C
dw 0x30620008 ; 800D6A80
dw 0x104000A1 ; 800D6A84
dw 0x30620002 ; 800D6A88
dw 0x8E620084 ; 800D6A8C
dw 0x00000000 ; 800D6A90
dw 0x04410003 ; 800D6A94
dw 0x00028203 ; 800D6A98
dw 0x244200FF ; 800D6A9C
dw 0x00028203 ; 800D6AA0
dw 0x3C02800E ; 800D6AA4
dw 0x8C43AA4C ; 800D6AA8
dw 0x00101040 ; 800D6AAC
dw 0x8E670034 ; 800D6AB0
dw 0x00431021 ; 800D6AB4
dw 0x84430000 ; 800D6AB8
dw 0x24021000 ; 800D6ABC
dw 0x00438023 ; 800D6AC0
dw 0x8CEC0000 ; 800D6AC4
dw 0x8CED0004 ; 800D6AC8
dw 0x48CC0000 ; 800D6ACC
dw 0x48CD0800 ; 800D6AD0
dw 0x8CEC0008 ; 800D6AD4
dw 0x8CED000C ; 800D6AD8
dw 0x8CEE0010 ; 800D6ADC
dw 0x48CC1000 ; 800D6AE0
dw 0x48CD1800 ; 800D6AE4
dw 0x48CE2000 ; 800D6AE8
dw 0x8FA40040 ; 800D6AEC
dw 0xAFB00038 ; 800D6AF0
dw 0xAFB00034 ; 800D6AF4
dw 0xAFB00030 ; 800D6AF8
dw 0x8E620034 ; 800D6AFC
dw 0x00000000 ; 800D6B00
dw 0x8C490020 ; 800D6B04
dw 0x8C4A0024 ; 800D6B08
dw 0x8C4B0028 ; 800D6B0C
dw 0x8C47002C ; 800D6B10
dw 0xAFA90010 ; 800D6B14
dw 0xAFAA0014 ; 800D6B18
dw 0xAFAB0018 ; 800D6B1C
dw 0xAFA7001C ; 800D6B20
dw 0x8C490030 ; 800D6B24
dw 0x8C4A0034 ; 800D6B28
dw 0x8C4B0038 ; 800D6B2C
dw 0x8C47003C ; 800D6B30
dw 0xAFA90020 ; 800D6B34
dw 0xAFAA0024 ; 800D6B38
dw 0xAFAB0028 ; 800D6B3C
dw 0xAFA7002C ; 800D6B40
dw 0x0C024C36 ; 800D6B44
dw 0x27A50030 ; 800D6B48
dw 0x8FA90040 ; 800D6B4C
dw 0x00000000 ; 800D6B50
dw 0x8D2C0000 ; 800D6B54
dw 0x8D2D0004 ; 800D6B58
dw 0x48CC8000 ; 800D6B5C
dw 0x48CD8800 ; 800D6B60
dw 0x8D2C0008 ; 800D6B64
dw 0x8D2D000C ; 800D6B68
dw 0x8D2E0010 ; 800D6B6C
dw 0x48CC9000 ; 800D6B70
dw 0x48CD9800 ; 800D6B74
dw 0x48CEA000 ; 800D6B78
dw 0x8E620028 ; 800D6B7C
dw 0x00000000 ; 800D6B80
dw 0x30420100 ; 800D6B84
dw 0x10400021 ; 800D6B88
dw 0x3C07800B ; 800D6B8C
dw 0x8E630034 ; 800D6B90
dw 0x00000000 ; 800D6B94
dw 0x8C620014 ; 800D6B98
dw 0x00000000 ; 800D6B9C
dw 0x00500018 ; 800D6BA0
dw 0x00002012 ; 800D6BA4
dw 0x04810002 ; 800D6BA8
dw 0x24630014 ; 800D6BAC
dw 0x24840FFF ; 800D6BB0
dw 0x8C620004 ; 800D6BB4
dw 0x00000000 ; 800D6BB8
dw 0x00500018 ; 800D6BBC
dw 0x00002812 ; 800D6BC0
dw 0x04A10002 ; 800D6BC4
dw 0x00042303 ; 800D6BC8
dw 0x24A50FFF ; 800D6BCC
dw 0x8C620008 ; 800D6BD0
dw 0x00000000 ; 800D6BD4
dw 0x00500018 ; 800D6BD8
dw 0x00001012 ; 800D6BDC
dw 0x04410002 ; 800D6BE0
dw 0x00051B03 ; 800D6BE4
dw 0x24420FFF ; 800D6BE8
dw 0x00021303 ; 800D6BEC
dw 0x00046100 ; 800D6BF0
dw 0x00036900 ; 800D6BF4
dw 0x00027100 ; 800D6BF8
dw 0x48CC6800 ; 800D6BFC
dw 0x48CD7000 ; 800D6C00
dw 0x48CE7800 ; 800D6C04
dw 0x08035B20 ; 800D6C08
dw 0x00000000 ; 800D6C0C
dw 0x84E2B38C ; 800D6C10
dw 0x00000000 ; 800D6C14
dw 0x00500018 ; 800D6C18
dw 0x00001812 ; 800D6C1C
dw 0x04610002 ; 800D6C20
dw 0x24E6B38C ; 800D6C24
dw 0x24630FFF ; 800D6C28
dw 0x84C20002 ; 800D6C2C
dw 0x00000000 ; 800D6C30
dw 0x00500018 ; 800D6C34
dw 0x00002012 ; 800D6C38
dw 0x04810002 ; 800D6C3C
dw 0x00032B03 ; 800D6C40
dw 0x24840FFF ; 800D6C44
dw 0x84C20004 ; 800D6C48
dw 0x00000000 ; 800D6C4C
dw 0x00500018 ; 800D6C50
dw 0x00001012 ; 800D6C54
dw 0x04410002 ; 800D6C58
dw 0x00041B03 ; 800D6C5C
dw 0x24420FFF ; 800D6C60
dw 0x00021303 ; 800D6C64
dw 0x00056100 ; 800D6C68
dw 0x00036900 ; 800D6C6C
dw 0x00027100 ; 800D6C70
dw 0x48CC6800 ; 800D6C74
dw 0x48CD7000 ; 800D6C78
dw 0x48CE7800 ; 800D6C7C
dw 0x8672002E ; 800D6C80
dw 0x00000000 ; 800D6C84
dw 0x1A40000F ; 800D6C88
dw 0x26710048 ; 800D6C8C
dw 0x8622004C ; 800D6C90
dw 0x00000000 ; 800D6C94
dw 0x10400008 ; 800D6C98
dw 0x02202021 ; 800D6C9C
dw 0x0C036486 ; 800D6CA0
dw 0x3C051F80 ; 800D6CA4
dw 0x0C0364C2 ; 800D6CA8
dw 0x3C041F80 ; 800D6CAC
dw 0x02202021 ; 800D6CB0
dw 0x0C035A56 ; 800D6CB4
dw 0x02E02821 ; 800D6CB8
dw 0x2652FFFF ; 800D6CBC
dw 0x1E40FFF3 ; 800D6CC0
dw 0x2631005C ; 800D6CC4
dw 0x3C07800B ; 800D6CC8
dw 0x24E7B38C ; 800D6CCC
dw 0x94E90000 ; 800D6CD0
dw 0x3C07800B ; 800D6CD4
dw 0x24E7B38C ; 800D6CD8
dw 0x94EA0002 ; 800D6CDC
dw 0x3C07800B ; 800D6CE0
dw 0x24E7B38C ; 800D6CE4
dw 0x94E70004 ; 800D6CE8
dw 0x00096100 ; 800D6CEC
dw 0x000A6900 ; 800D6CF0
dw 0x00077100 ; 800D6CF4
dw 0x48CC6800 ; 800D6CF8
dw 0x48CD7000 ; 800D6CFC
dw 0x48CE7800 ; 800D6D00
dw 0x08035B6F ; 800D6D04
dw 0x00000000 ; 800D6D08
dw 0x1040002B ; 800D6D0C
dw 0x26E20001 ; 800D6D10
dw 0x26710048 ; 800D6D14
dw 0x8672002E ; 800D6D18
dw 0x00000000 ; 800D6D1C
dw 0x1A400026 ; 800D6D20
dw 0x0002A0C0 ; 800D6D24
dw 0x0014A827 ; 800D6D28
dw 0x26700094 ; 800D6D2C
dw 0x86030000 ; 800D6D30
dw 0x96020000 ; 800D6D34
dw 0x10600019 ; 800D6D38
dw 0x30420004 ; 800D6D3C
dw 0x14400009 ; 800D6D40
dw 0x3C091F80 ; 800D6D44
dw 0x00741024 ; 800D6D48
dw 0x14400014 ; 800D6D4C
dw 0x02202021 ; 800D6D50
dw 0x0C006A6E ; 800D6D54
dw 0x02E02821 ; 800D6D58
dw 0x96020000 ; 800D6D5C
dw 0x08035B67 ; 800D6D60
dw 0x00541025 ; 800D6D64
dw 0x352903FC ; 800D6D68
dw 0x01204021 ; 800D6D6C
dw 0xAD1D0000 ; 800D6D70
dw 0x2508FFFC ; 800D6D74
dw 0x0100E821 ; 800D6D78
dw 0x02202021 ; 800D6D7C
dw 0x0C035962 ; 800D6D80
dw 0x02E02821 ; 800D6D84
dw 0x27BD0004 ; 800D6D88
dw 0x8FBD0000 ; 800D6D8C
dw 0x96020000 ; 800D6D90
dw 0x00000000 ; 800D6D94
dw 0x00551024 ; 800D6D98
dw 0xA6020000 ; 800D6D9C
dw 0x2631005C ; 800D6DA0
dw 0x96020000 ; 800D6DA4
dw 0x2652FFFF ; 800D6DA8
dw 0x3042FFFB ; 800D6DAC
dw 0xA6020000 ; 800D6DB0
dw 0x1E40FFDE ; 800D6DB4
dw 0x2610005C ; 800D6DB8
dw 0x96620032 ; 800D6DBC
dw 0x26D6FFFF ; 800D6DC0
dw 0x30420003 ; 800D6DC4
dw 0x1EC0FF25 ; 800D6DC8
dw 0xA6620032 ; 800D6DCC
dw 0x8FBF006C ; 800D6DD0
dw 0x8FBE0068 ; 800D6DD4
dw 0x8FB70064 ; 800D6DD8
dw 0x8FB60060 ; 800D6DDC
dw 0x8FB5005C ; 800D6DE0
dw 0x8FB40058 ; 800D6DE4
dw 0x8FB30054 ; 800D6DE8
dw 0x8FB20050 ; 800D6DEC
dw 0x8FB1004C ; 800D6DF0
dw 0x8FB00048 ; 800D6DF4
dw 0x03E00008 ; 800D6DF8
dw 0x27BD0070 ; 800D6DFC

View File

@ -1,3 +1,4 @@
#include "common.h"
#include "libdg/libdg.h"
#include "libgcl/libgcl.h"
@ -28,6 +29,7 @@ extern int DG_CurrentGroupID_800AB968;
extern unsigned int *ptr_800B1400[256];
extern short DG_ClipMin_800AB96C[2];
extern short DG_ClipMax_800AB970[2];
extern SVECTOR DG_Ambient_800AB38C;
extern unsigned long DG_PacketCode_800AB394[2];
void s12c_800D497C(int arg0, int arg1)
@ -1588,5 +1590,100 @@ void s12c_fadeio_800D6958( DG_OBJ* obj, int idx )
}
}
#pragma INCLUDE_ASM("asm/overlays/s12c/FogShadeChanl_800D6A04.s")
void FogShadeChanl_800D6A04(DG_CHNL *channel, int index)
{
MATRIX color;
VECTOR scale;
DG_OBJS **queue;
int n_objects;
DG_OBJS *objs;
int s;
DG_OBJ *obj;
int n_models;
int bound_index;
gte_ldfcdir(0, 0, 0);
queue = channel->mQueue;
for (n_objects = channel->mTotalObjectCount; n_objects > 0; n_objects--)
{
objs = *queue++;
if (objs->bound_mode != 0)
{
if (objs->flag & DG_FLAG_SHADE)
{
s = objs->objs[0].screen.t[2] / 256;
s = 4096 - s12c_800DAA4C[s];
gte_SetRotMatrix(objs->light);
scale.vx = scale.vy = scale.vz = s;
color = objs->light[1];
ScaleMatrix(&color, &scale);
gte_SetColorMatrix(&color);
if (objs->flag & DG_FLAG_AMBIENT)
{
VECTOR *ambient = (VECTOR *)objs->light[0].t;
int r = (ambient->vx * s) / 4096;
int g = (ambient->vy * s) / 4096;
int b = (ambient->vz * s) / 4096;
gte_SetBackColor(r, g, b);
}
else
{
SVECTOR *ambient = &DG_Ambient_800AB38C;
int r = (ambient->vx * s) / 4096;
int g = (ambient->vy * s) / 4096;
int b = (ambient->vz * s) / 4096;
gte_SetBackColor(r, g, b);
}
obj = objs->objs;
for (n_models = objs->n_models; n_models > 0; n_models--)
{
if (obj->bound_mode != 0)
{
MulRotMatrix0(&obj->world, (MATRIX *)0x1F800000);
SetLightMatrix((MATRIX *)0x1F800000);
s12c_fadeio_800D6958(obj, index);
}
obj++;
}
gte_SetBackColor(DG_Ambient_800AB38C.vx, DG_Ambient_800AB38C.vy, DG_Ambient_800AB38C.vz);
}
else if (objs->flag & DG_FLAG_PAINT)
{
bound_index = (index + 1) * 8;
obj = objs->objs;
for (n_models = objs->n_models; n_models > 0; n_models--)
{
if (obj->bound_mode != 0)
{
if (!(obj->bound_mode & 0x4))
{
if (!(obj->bound_mode & bound_index))
{
DG_WriteObjPacketRGB_8001A9B8(obj, index);
obj->bound_mode |= bound_index;
}
}
else
{
SetSpadStack(0x1F8003FC);
s12c_800D6588(obj, index);
ResetSpadStack();
obj->bound_mode &= ~bound_index;
}
}
obj->bound_mode &= ~0x4;
obj++;
}
}
}
objs->bound_mode &= 0x3;
}
}