Skip to content

Commit e125af7

Browse files
authored
Codeshare no2 func_us_801B4DA4 (Xeeynamo#2767)
All credit goes to @TomoshibiAkira
1 parent 6c4445d commit e125af7

File tree

8 files changed

+47
-180
lines changed

8 files changed

+47
-180
lines changed

config/splat.pspeu.stno2.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ segments:
7171
- [0x1FF58, c, no2/33D8C]
7272
- [0x20770, c, no2/e_sealed_door]
7373
- [0x21C20, c, no2/e_background_house]
74-
- [0x22BC8, c, no2_psp/22BC8]
74+
- [0x22BC8, c, no2/34DA4]
7575
- [0x23228, c, no2/e_room_bg]
7676
- [0x23308, c, no2/36E34]
7777
- [0x23998, c, no2/e_lock_camera]
@@ -109,7 +109,7 @@ segments:
109109
- [0x55790, .data, no2/e_sealed_door]
110110
- [0x55800, .data, no2/e_background_house]
111111
- [0x55990, .data, no2/d_prize_drops]
112-
- [0x559A8, data]
112+
- [0x559A8, .data, no2/34DA4]
113113
- [0x559B0, .data, no2/background_block_init]
114114
- [0x559D0, .data, no2/36E34]
115115
- [0x55A48, .data, no2/e_lock_camera]

config/splat.us.stno2.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ segments:
106106
- [0x33D8C, c, 33D8C]
107107
- [0x34388, c, e_background_house]
108108
- [0x34DA4, c, 34DA4]
109+
- [0x352B4, c, 352B4]
109110
- [0x359C4, c, e_secrets]
110111
- [0x36E34, c, 36E34]
111112
- [0x372E8, c, 372E8]

config/symbols.pspeu.stno2.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ NO2_gfxBanks = 0x092664C8;
8080
NO2_EntityUpdates = 0x09266510;
8181
g_EInitObtainable = 0x09266628;
8282
g_EInitParticle = 0x09266638;
83+
D_us_80180844 = 0x09266648;
8384
g_EInitInteractable = 0x09266658;
8485
g_EInitUnkId13 = 0x09266668;
8586
g_EInitLockCamera = 0x09266678;

src/st/no2/34DA4.c

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,16 @@
11
// SPDX-License-Identifier: AGPL-3.0-or-later
22
#include "no2.h"
33

4-
// already in e_init.c
5-
extern EInit D_us_80180844[];
6-
// st/no2/data/34DA4.rodata.s
7-
extern RECT D_us_801B2E20;
8-
94
void func_us_801B4DA4(Entity* self) {
105
DRAWENV draw;
11-
RECT rect;
126
DR_ENV* dr_env;
137
Primitive* prim;
148
s32 i;
159
s32 primIndex;
1610
u8 flag;
1711

18-
rect = D_us_801B2E20;
12+
RECT rect = {.x = 0, .y = 256, .w = 80, .h = 192};
13+
1914
switch (self->step) {
2015
case 0:
2116
InitializeEntity(D_us_80180844);
@@ -74,7 +69,11 @@ void func_us_801B4DA4(Entity* self) {
7469
prim = self->ext.prim;
7570
for (i = 2; i >= 0; i--) {
7671
prim->type = PRIM_GT4;
72+
#ifdef VERSION_PSP
73+
prim->tpage = 0x1110;
74+
#else
7775
prim->tpage = 0x110;
76+
#endif
7877
prim->u0 = prim->u2 = 0;
7978
prim->u1 = prim->u3 = prim->u0 + 0x28;
8079
prim->v0 = prim->v1 = 0;
@@ -96,7 +95,11 @@ void func_us_801B4DA4(Entity* self) {
9695
prim = prim->next;
9796
}
9897
prim->type = PRIM_GT4;
98+
#ifdef VERSION_PSP
99+
prim->tpage = 0x101A;
100+
#else
99101
prim->tpage = 0x1A;
102+
#endif
100103
prim->clut = 0x15F;
101104
prim->u0 = prim->u2 = 0x10;
102105
prim->u1 = prim->u3 = 0x20;
@@ -116,7 +119,11 @@ void func_us_801B4DA4(Entity* self) {
116119
prim->drawMode = DRAW_UNK_40 | DRAW_TPAGE | DRAW_COLORS | DRAW_TRANSP;
117120
prim = prim->next;
118121
prim->type = PRIM_GT4;
119-
prim->tpage = (flag) ? 0x104 : 0x100;
122+
#ifdef VERSION_PSP
123+
prim->tpage = 0x104;
124+
#else
125+
prim->tpage = flag ? 0x104 : 0x100;
126+
#endif
120127
prim->u0 = prim->u2 = 0x8B;
121128
prim->u1 = prim->u3 = 0xB3;
122129
prim->v0 = prim->v1 = 0x37;
@@ -129,7 +136,11 @@ void func_us_801B4DA4(Entity* self) {
129136
prim->drawMode = DRAW_DEFAULT;
130137
prim = prim->next;
131138
prim->type = PRIM_GT4;
139+
#ifdef VERSION_PSP
140+
prim->tpage = 0x1110;
141+
#else
132142
prim->tpage = 0x110;
143+
#endif
133144
prim->u0 = prim->u2 = 4;
134145
prim->u1 = prim->u3 = 0x4C;
135146
prim->v0 = prim->v1 = 0x44;
@@ -138,9 +149,15 @@ void func_us_801B4DA4(Entity* self) {
138149
prim->x1 = prim->x3 = 0xC3;
139150
prim->y0 = prim->y1 = 0x27;
140151
prim->y2 = prim->y3 = 0x6F;
152+
#ifdef VERSION_PSP
153+
prim->r0 = 0x20;
154+
prim->g0 = 0x10;
155+
prim->b0 = 0x20;
156+
#else
141157
prim->r0 = 0x10;
142158
prim->g0 = 0x8;
143159
prim->b0 = 0x10;
160+
#endif
144161
LOW(prim->r1) = LOW(prim->r0);
145162
LOW(prim->r2) = LOW(prim->r0);
146163
LOW(prim->r3) = LOW(prim->r0);
@@ -150,17 +167,3 @@ void func_us_801B4DA4(Entity* self) {
150167
return;
151168
}
152169
}
153-
154-
INCLUDE_ASM("st/no2/nonmatchings/34DA4", func_us_801B52B4);
155-
156-
INCLUDE_ASM("st/no2/nonmatchings/34DA4", func_us_801B5368);
157-
158-
INCLUDE_ASM("st/no2/nonmatchings/34DA4", func_us_801B5578);
159-
160-
INCLUDE_ASM("st/no2/nonmatchings/34DA4", func_us_801B56A4);
161-
162-
INCLUDE_ASM("st/no2/nonmatchings/34DA4", func_us_801B5750);
163-
164-
INCLUDE_ASM("st/no2/nonmatchings/34DA4", func_us_801B5948);
165-
166-
INCLUDE_RODATA("st/no2/nonmatchings/34DA4", D_us_801B2E20);

src/st/no2/352B4.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// SPDX-License-Identifier: AGPL-3.0-or-later
2+
#include "no2.h"
3+
4+
INCLUDE_ASM("st/no2/nonmatchings/352B4", func_us_801B52B4);
5+
6+
INCLUDE_ASM("st/no2/nonmatchings/352B4", func_us_801B5368);
7+
8+
INCLUDE_ASM("st/no2/nonmatchings/352B4", func_us_801B5578);
9+
10+
INCLUDE_ASM("st/no2/nonmatchings/352B4", func_us_801B56A4);
11+
12+
INCLUDE_ASM("st/no2/nonmatchings/352B4", func_us_801B5750);
13+
14+
INCLUDE_ASM("st/no2/nonmatchings/352B4", func_us_801B5948);

src/st/no2/no2.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ extern Primitive* FindFirstUnkPrim2(Primitive* prim, u8 index);
100100
extern EInit g_EInitBreakable;
101101
extern EInit g_EInitObtainable;
102102
extern EInit g_EInitParticle;
103-
// extern EInit D_us_80180844;
103+
extern EInit D_us_80180844;
104104
extern EInit g_EInitInteractable;
105105
extern EInit g_EInitUnkId13;
106106
extern EInit g_EInitLockCamera;

src/st/no2_psp/22BC8.c

Lines changed: 0 additions & 152 deletions
This file was deleted.

src/st/no2_psp/e_init.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ void func_us_801B41A4(Entity* self);
3131
void func_us_801B4210(Entity* self);
3232
void Entity3DBackgroundHouse(Entity* self);
3333
void Entity3DHouseSpawner(Entity* self);
34-
void func_pspeu_0925A248(Entity* self);
34+
void func_us_801B4DA4(Entity* self);
3535
void func_pspeu_0925C0F8(Entity* self);
3636
void func_pspeu_0925BBA8(Entity* self);
3737
void func_pspeu_0925BAD0(Entity* self);
@@ -98,7 +98,7 @@ PfnEntityUpdate OVL_EXPORT(EntityUpdates)[] = {
9898
func_us_801B4210,
9999
Entity3DBackgroundHouse,
100100
Entity3DHouseSpawner,
101-
func_pspeu_0925A248,
101+
func_us_801B4DA4,
102102
func_pspeu_0925C0F8,
103103
func_pspeu_0925BBA8,
104104
func_pspeu_0925BAD0,
@@ -137,7 +137,7 @@ PfnEntityUpdate OVL_EXPORT(EntityUpdates)[] = {
137137
EInit g_EInitBreakable = {ANIMSET_DRA(0x03), 0x00, 0x00, PAL_NONE, 0x000};
138138
EInit g_EInitObtainable = {ANIMSET_DRA(0x03), 0x00, 0x00, PAL_NONE, 0x001};
139139
EInit g_EInitParticle = {ANIMSET_DRA(0x03), 0x00, 0x00, PAL_NONE, 0x002};
140-
EInit D_pspeu_09266648 = {ANIMSET_DRA(0x00), 0x00, 0x00, PAL_NONE, 0x004};
140+
EInit D_us_80180844 = {ANIMSET_DRA(0x00), 0x00, 0x00, PAL_NONE, 0x004};
141141
EInit g_EInitInteractable = {ANIMSET_DRA(0x00), 0x00, 0x00, PAL_NONE, 0x005};
142142
EInit g_EInitUnkId13 = {ANIMSET_DRA(0x00), 0x00, 0x00, PAL_NONE, 0x002};
143143
EInit g_EInitLockCamera = {ANIMSET_DRA(0x00), 0x00, 0x00, PAL_NONE, 0x001};

0 commit comments

Comments
 (0)