Skip to content

Commit 54a843a

Browse files
committed
Match DLL 30, clean up DLL 29, 30
1 parent dfba272 commit 54a843a

19 files changed

+287
-231
lines changed

export_symbol_addrs.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ func_80014C60 = 0x8000012D;
302302
osBbCardChange = 0x8000012E;
303303
func_80014BBC = 0x8000012F;
304304
func_800142F0 = 0x80000130;
305-
gDLL_30_tasktext = 0x80000131;
305+
gDLL_30_task = 0x80000131;
306306
func_80010158 = 0x80000132;
307307
func_800382AC = 0x80000133;
308308
func_80014B6C = 0x80000134;

include/dll.h

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#define _DLL_H
33

44
#include "dlls/engine/29_gplay.h"
5-
#include "dlls/engine/30_tasktext.h"
5+
#include "dlls/engine/30_task.h"
66
#include "dlls/engine/31_flash.h"
77

88
#include "dll_def.h"
@@ -42,6 +42,7 @@ enum DLL_ID {
4242
DLL_WATERFX = 24,
4343
DLL_CURVES = 26,
4444
DLL_GPLAY = 29,
45+
DLL_TASK = 30,
4546
DLL_FLASH = 31,
4647
DLL_MINIMAP = 59,
4748
DLL_LINK = 74,
@@ -54,7 +55,7 @@ enum DLL_ID {
5455
// their global variable instead of from loading the DLL.
5556

5657
extern DLLInst_29_gplay *gDLL_29_gplay;
57-
extern DLLInst_30_tasktext *gDLL_30_tasktext;
58+
extern DLLInst_30_task *gDLL_30_task;
5859
extern DLLInst_31_flash *gDLL_31_flash;
5960
extern DLLInst_Unknown
6061
*gDLL_28,

include/dlls/engine/30_task.h

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#ifndef _DLLS_30_H
2+
#define _DLLS_30_H
3+
4+
#include <PR/ultratypes.h>
5+
#include "dll_def.h"
6+
7+
DLL_INTERFACE_BEGIN(30_task)
8+
void (*load_recently_completed)();
9+
void (*mark_task_completed)(u8 task);
10+
u8 (*get_num_recently_completed)();
11+
void (*func_390)(u8 param1);
12+
void (*func_3F8)();
13+
s16 (*get_completion_percentage)();
14+
DLL_INTERFACE_END()
15+
16+
#endif //_DLLS_30_H

include/dlls/engine/30_tasktext.h

-16
This file was deleted.

include/functions.h

+3-2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ void update_PlayerPosBuffer(void);
1919
TActor * get_player(void);
2020

2121
s32 read_file_region(u32 id, void *dst, u32 offset, s32 size);
22+
void queue_load_file_region_to_ptr(void **dest, s32 fileId, s32 offset, s32 length);
2223

2324
void dl_get_debug_info2(Gfx*, u32*, char**, u32*, s32*, u32*, char**, u32*, s32*);
2425
void dl_segment(Gfx **gdl, u32 segment, void *base);
@@ -48,8 +49,8 @@ s32 func_80023D30(TActor*,s32,f32,s32);
4849
s32 func_80024108(TActor*,f32,f32,s32);
4950
s32 func_80025F40(TActor*,s32,s32,s32);
5051

51-
s32 get_gplay_bitstring(s32 entry);
52-
void set_gplay_bitstring(s32 entry, s32 value);
52+
u32 get_gplay_bitstring(s32 entry);
53+
void set_gplay_bitstring(s32 entry, u32 value);
5354

5455
void draw_actor(TActor*,s32,s32,s32,s32,float);
5556

include/game/gamebits.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ typedef struct {
55
// Start bit index
66
u16 start;
77
// bits 0-4: length in bits (minus 1)
8-
// bit 5: flag
8+
// bit 5: has task
99
// bits 6-7: which bitstring
1010
u8 field_0x2;
11-
u8 field_0x3;
11+
u8 task;
1212
} BitTableEntry;
1313

1414
extern BitTableEntry *gFile_BITTABLE;

src/dlls/dlls.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# engine
22
16 = engine/16
33
29 = engine/29_gplay
4-
30 = engine/30_tasktext
4+
30 = engine/30_task
55
31 = engine/31_flash
66
82 = engine/82
77
83 = engine/83

src/dlls/engine/29_gplay/gplay.c

+25-24
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#include "game/actor/actor.h"
44
#include "sys/dll.h"
55
#include "sys/math.h"
6+
#include "sys/fs.h"
67
#include "variables.h"
78
#include "functions.h"
89
#include "dll.h"
@@ -66,7 +67,7 @@ static void gplay_func_1314();
6667
void gplay_func_139C(s32 param1, s32 param2);
6768
void gplay_func_15B8(s32 param1);
6869

69-
/*export*/ void gplay_ctor(DLLFile *self) {
70+
void gplay_ctor(DLLFile *self) {
7071
bss_0 = (FlashStruct*)malloc(sizeof(FlashStruct), 0xFFFF00FF, NULL);
7172
gplay_func_1314();
7273
bss_4 = NULL;
@@ -75,7 +76,7 @@ void gplay_func_15B8(s32 param1);
7576
bss_1A50[0] = -1;
7677
}
7778

78-
/*export*/ void gplay_dtor(DLLFile *self) {
79+
void gplay_dtor(DLLFile *self) {
7980
free(bss_0);
8081
if (bss_4 != NULL) {
8182
free(bss_4);
@@ -188,10 +189,10 @@ s32 gplay_func_3E4(s8 param1, u8 param2) {
188189
if (param1 < 4) {
189190
bss_183C = param1;
190191

191-
flashPtr = (FlashStruct*)malloc(0x1800, 0xFFFF00FF, NULL);
192+
flashPtr = (FlashStruct*)malloc(sizeof(FlashStruct), 0xFFFF00FF, NULL);
192193

193-
var1 = gDLL_31_flash->exports->load_game(bss_0, param1, 0x1800, 1);
194-
var2 = gDLL_31_flash->exports->load_game(flashPtr, param1 + 4, 0x1800, 1);
194+
var1 = gDLL_31_flash->exports->load_game(bss_0, param1, sizeof(FlashStruct), 1);
195+
var2 = gDLL_31_flash->exports->load_game(flashPtr, param1 + 4, sizeof(FlashStruct), 1);
195196

196197
if (var1 == 0) {
197198
if (var2 == 0) {
@@ -216,9 +217,9 @@ s32 gplay_func_3E4(s8 param1, u8 param2) {
216217
} else {
217218
queue_load_file_region_to_ptr(
218219
bss_0,
219-
0x3d,
220-
param1 * 0x1800 - 0x6000,
221-
0x1800);
220+
SAVEGAME_BIN,
221+
param1 * sizeof(FlashStruct) - 0x6000,
222+
sizeof(FlashStruct));
222223
ret = 1;
223224
}
224225
} else {
@@ -245,16 +246,16 @@ void gplay_func_6AC() {
245246
if (bss_183C != -1) {
246247
bss_10.unk0.unk0.unk0.unk0x2f8 += 1;
247248

248-
bcopy(&bss_10, bss_0, 0x13d4);
249+
bcopy(&bss_10.unk0.unk0.unk0, &bss_0->gplay.unk0.unk0, sizeof(GplayStruct8));
249250

250251
gDLL_31_flash->exports->save_game(
251252
bss_0,
252253
bss_183C + (bss_0->gplay.unk0.unk0.unk0x2f8 % 2) * 4,
253-
0x1800,
254+
sizeof(FlashStruct),
254255
1);
255256

256257
if (bss_4 != NULL) {
257-
bcopy(&bss_10.unk0.unk0, &bss_4->unk0, 0x15d4);
258+
bcopy(&bss_10.unk0.unk0, &bss_4->unk0, sizeof(GplayStruct9));
258259
}
259260
}
260261
}
@@ -266,10 +267,10 @@ u32 gplay_func_79C() {
266267
var = 1;
267268

268269
ret = gDLL_31_flash->exports->load_game(
269-
bss_8, 3, 0x80, 0);
270+
bss_8, 3, sizeof(GplayStruct4), 0);
270271

271272
if (ret == 0) {
272-
bzero(bss_8, 0x80);
273+
bzero(bss_8, sizeof(GplayStruct4));
273274
var = 0;
274275
bss_8->unk0x8 = 0x7f;
275276
bss_8->unk0x9 = 0x7f;
@@ -296,7 +297,7 @@ u32 gplay_func_79C() {
296297

297298
void gplay_func_8D8() {
298299
gDLL_31_flash->exports->save_game(
299-
bss_8, 3, 0x80, 0);
300+
bss_8, 3, sizeof(GplayStruct4), 0);
300301
}
301302

302303
GplayStruct4 *gplay_func_930() {
@@ -309,7 +310,7 @@ void gplay_func_94C(s32 param1) {
309310

310311
void gplay_func_958(Vec3f *param1, s16 param2, s32 param3, s32 param4) {
311312
if ((param3 & 1) != 0) {
312-
bcopy(&bss_10.unk0, bss_0, 0x15d4);
313+
bcopy(&bss_10.unk0.unk0, &bss_0->gplay.unk0, sizeof(GplayStruct9));
313314
} else {
314315
if (func_8001EBE0() != 0) {
315316
bss_10.unk0.unk0x16F4[bss_10.unk0.unk0.unk0.character].unk0x10 |= 1;
@@ -320,31 +321,31 @@ void gplay_func_958(Vec3f *param1, s16 param2, s32 param3, s32 param4) {
320321
bss_10.unk0.unk0x16d4[bss_10.unk0.unk0.unk0.character].vec.x = param1->x;
321322
bss_10.unk0.unk0x16d4[bss_10.unk0.unk0.unk0.character].vec.y = param1->y;
322323
bss_10.unk0.unk0x16d4[bss_10.unk0.unk0.unk0.character].vec.z = param1->z;
323-
bss_10.unk0.unk0x16d4[bss_10.unk0.unk0.unk0.character].unk0xC = (u8)(param2 >> 8);
324+
bss_10.unk0.unk0x16d4[bss_10.unk0.unk0.unk0.character].unk0xC = param2 >> 8;
324325
bss_10.unk0.unk0x16d4[bss_10.unk0.unk0.unk0.character].unk0xD = param4;
325326

326-
bcopy(&bss_10, bss_0, 0x17ac);
327+
bcopy(&bss_10.unk0, &bss_0->gplay, sizeof(GplayStruct3));
327328
}
328329

329330
if (bss_4 != NULL) {
330-
bcopy(&bss_10.unk0.unk0, &bss_4->unk0, 0x15d4);
331+
bcopy(&bss_10.unk0.unk0, &bss_4->unk0, sizeof(GplayStruct9));
331332
}
332333
}
333334

334335
void gplay_func_AE0() {
335-
bcopy(bss_0, &bss_10, 0x17ac);
336+
bcopy(&bss_0->gplay, &bss_10.unk0, sizeof(GplayStruct3));
336337
gplay_func_D94();
337338
}
338339

339340
void gplay_func_B3C(Vec3f *param1, s16 param2, s32 param3) {
340341
if (bss_4 == NULL) {
341-
bss_4 = (GplayStruct3*)malloc(0x17ac, 0xFFFF00FF, NULL);
342+
bss_4 = (GplayStruct3*)malloc(sizeof(GplayStruct3), 0xFFFF00FF, NULL);
342343
if (bss_4 == NULL) {
343344
return;
344345
}
345346
}
346347

347-
bcopy(&bss_10.unk0, bss_4, 0x17ac);
348+
bcopy(&bss_10.unk0, bss_4, sizeof(GplayStruct3));
348349

349350
if (func_8001EBE0() != 0) {
350351
bss_4->unk0x16F4[bss_4->unk0.unk0.character].unk0x10 |= 1;
@@ -361,7 +362,7 @@ void gplay_func_B3C(Vec3f *param1, s16 param2, s32 param3) {
361362

362363
void gplay_func_CBC() {
363364
if (bss_4 != NULL) {
364-
bcopy(bss_4, &bss_10, 0x17ac);
365+
bcopy(bss_4, &bss_10.unk0, sizeof(GplayStruct3));
365366
gplay_func_D94();
366367
}
367368
}
@@ -526,8 +527,8 @@ u32 gplay_func_1270() {
526527

527528
static void gplay_func_1314() {
528529
bss_183C = -1;
529-
bzero(&bss_10, 0x182c);
530-
bzero(bss_0, 0x1800);
530+
bzero(&bss_10, sizeof(GplayStruct7));
531+
bzero(bss_0, sizeof(FlashStruct));
531532
}
532533

533534
void gplay_func_1378(s32 param1, s32 param2) {
File renamed without changes.

src/dlls/engine/30_task/exports.s

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
.option pic2
2+
.section ".exports"
3+
.global _exports
4+
_exports:
5+
6+
# ctor/dtor
7+
.dword task_ctor
8+
.dword task_dtor
9+
10+
# export table
11+
.dword task_load_recently_completed
12+
.dword task_mark_task_completed
13+
.dword task_get_num_recently_completed
14+
.dword task_func_390
15+
.dword task_func_3F8
16+
.dword task_get_completion_percentage

src/dlls/engine/30_task/syms.txt

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# functions
2+
task_ctor = 0x0;
3+
task_dtor = 0xC;
4+
task_load_recently_completed = 0x18;
5+
task_mark_task_completed = 0xDC;
6+
task_get_num_recently_completed = 0x368;
7+
task_func_390 = 0x390;
8+
task_func_3F8 = 0x3F8;
9+
task_get_completion_percentage = 0x454;

0 commit comments

Comments
 (0)