Skip to content

Commit

Permalink
more db
Browse files Browse the repository at this point in the history
  • Loading branch information
BR- committed Jan 27, 2024
1 parent fcc860d commit 3a4b3cb
Show file tree
Hide file tree
Showing 5 changed files with 152 additions and 36 deletions.
40 changes: 20 additions & 20 deletions config/GALE01/symbols.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17721,35 +17721,35 @@ un_80301E08 = .text:0x80301E08; // type:function size:0x3C scope:global
un_80301E44 = .text:0x80301E44; // type:function size:0x34 scope:global
un_80301E78 = .text:0x80301E78; // type:function size:0x13C scope:global
DevText_GetGObj = .text:0x80301FB4; // type:function size:0x8 scope:global
un_80301FBC = .text:0x80301FBC; // type:function size:0x13C scope:global
DevText_InitPool = .text:0x80301FBC; // type:function size:0x13C scope:global
fn_803020F8 = .text:0x803020F8; // type:function size:0x4
un_803020FC = .text:0x803020FC; // type:function size:0x68 scope:global
un_80302164 = .text:0x80302164; // type:function size:0x158 scope:global
un_803022BC = .text:0x803022BC; // type:function size:0x34C scope:global
fn_80302608 = .text:0x80302608; // type:function size:0x54
un_8030265C = .text:0x8030265C; // type:function size:0xAC scope:global
un_80302708 = .text:0x80302708; // type:function size:0x98 scope:global
un_803027A0 = .text:0x803027A0; // type:function size:0x70 scope:global
DevText_Remove = .text:0x803020FC; // type:function size:0x68 scope:global
DevText_SetupCObj = .text:0x80302164; // type:function size:0x158 scope:global
DevText_Draw = .text:0x803022BC; // type:function size:0x34C scope:global
DevText_DrawAll = .text:0x80302608; // type:function size:0x54
DevText_CreateCObj = .text:0x8030265C; // type:function size:0xAC scope:global
DevText_Setup = .text:0x80302708; // type:function size:0x98 scope:global
DevText_AddToList = .text:0x803027A0; // type:function size:0x70 scope:global
DevText_Show = .text:0x80302810; // type:function size:0x24 scope:global
DevText_Create = .text:0x80302834; // type:function size:0x180 scope:global
un_803029B4 = .text:0x803029B4; // type:function size:0x88 scope:global
un_80302A3C = .text:0x80302A3C; // type:function size:0x4C scope:global
un_80302A88 = .text:0x80302A88; // type:function size:0x28 scope:global
DevText_EraseFirstLine = .text:0x803029B4; // type:function size:0x88 scope:global
DevText_SetCursorXY = .text:0x80302A3C; // type:function size:0x4C scope:global
DevText_SetCursorX = .text:0x80302A88; // type:function size:0x28 scope:global
DevText_HideCursor = .text:0x80302AB0; // type:function size:0x10 scope:global
un_80302AC0 = .text:0x80302AC0; // type:function size:0x10 scope:global
un_80302AD0 = .text:0x80302AD0; // type:function size:0x10 scope:global
un_80302AE0 = .text:0x80302AE0; // type:function size:0x10 scope:global
un_80302AF0 = .text:0x80302AF0; // type:function size:0x10 scope:global
un_80302B00 = .text:0x80302B00; // type:function size:0x10 scope:global
DevText_ShowBackground = .text:0x80302AD0; // type:function size:0x10 scope:global
DevText_HideBackground = .text:0x80302AE0; // type:function size:0x10 scope:global
DevText_ShowText = .text:0x80302AF0; // type:function size:0x10 scope:global
DevText_HideText = .text:0x80302B00; // type:function size:0x10 scope:global
DevText_SetScale = .text:0x80302B10; // type:function size:0xC scope:global
un_80302B1C = .text:0x80302B1C; // type:function size:0x2C scope:global
un_80302B48 = .text:0x80302B48; // type:function size:0x1C scope:global
DevText_SetXY = .text:0x80302B1C; // type:function size:0x2C scope:global
DevText_StoreColorIndex = .text:0x80302B48; // type:function size:0x1C scope:global
DevText_SetTextColor = .text:0x80302B64; // type:function size:0x2C scope:global
DevText_SetBGColor = .text:0x80302B90; // type:function size:0x20 scope:global
un_80302BB0 = .text:0x80302BB0; // type:function size:0x34 scope:global
un_80302BE4 = .text:0x80302BE4; // type:function size:0x128 scope:global
DevText_Erase = .text:0x80302BB0; // type:function size:0x34 scope:global
DevText_Print = .text:0x80302BE4; // type:function size:0x128 scope:global
un_80302D0C = .text:0x80302D0C; // type:function size:0x40 scope:global
un_80302D4C = .text:0x80302D4C; // type:function size:0xA4 scope:global
DevText_Printf = .text:0x80302D4C; // type:function size:0xA4 scope:global
un_80302DF0 = .text:0x80302DF0; // type:function size:0x8 scope:global
un_80302DF8 = .text:0x80302DF8; // type:function size:0x8 scope:global
un_80302E00 = .text:0x80302E00; // type:function size:0xA4 scope:global
Expand Down
113 changes: 113 additions & 0 deletions src/melee/db/db_2253.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
#include "dolphin/os/OSContext.h"
#include "dolphin/pad/pad.h"
#include "dolphin/vi/vi.h"
#include "ef/efsync.h"
#include "ft/ftlib.h"
#include "it/it_266F.h"
#include "it/item.h"
#include "lb/lbarchive.h"
#include "sysdolphin/baselib/gobj.h"
Expand Down Expand Up @@ -490,6 +492,7 @@ void db_80225E6C(Fighter_GObj* owner)

void db_80225F20(int player)
{
int y[2000]; // suppress inlines of this too lol
db_8022558C_suppress_inline(player);
db_802255BC_suppress_inline(player);
db_8022558C_suppress_inline(player);
Expand All @@ -500,6 +503,116 @@ void db_80225F20(int player)
db_802255BC_suppress_inline(player);
}

void db_802260D4(int player)
{
int sp18;
int sp14;
int sp10;
int spC;
HSD_GObj* temp_r30;

temp_r30 = DevText_GetGObj();
if (db_8049FAA0.x0 == 2) {
DevText_ShowBackground(db_804D6B38);
DevText_ShowText(db_804D6B38);
} else {
db_804D6B38 = DevText_Create(8, 0x14, 0x14, 0x28, 1, db_8049FA50);
if (db_804D6B38 != NULL) {
sp18 = db_804DBCF0;
sp14 = db_804DBCF4;
DevText_Show(temp_r30, db_804D6B38, db_804DBCF0);
DevText_HideCursor(db_804D6B38);
sp10 = sp18;
DevText_SetBGColor(db_804D6B38, &sp10);
spC = sp14;
DevText_SetTextColor(db_804D6B38, &spC);
DevText_SetScale(db_804D6B38, db_804DBCF8, db_804DBCFC);
}
}
db_8049FAA0.x0 = 1;
}

void db_802261BC(int player)
{
char* item;
db_8049FAA0.x18 = db_8049FAA0.x10;
db_8049FAA0.x1C = db_8049FAA0.x14;
db_80225F20(player);
if (db_8049FAA0.x18 != db_8049FAA0.x10 ||
db_8049FAA0.x1C != db_8049FAA0.x14)
{
db_8049FAA0.xC = player;
db_8049FAA0.x4 = 0x78;
if (db_8049FAA0.x0 != 1) {
db_802260D4(player);
}
DevText_Erase(db_804D6B38);
DevText_SetCursorXY(db_804D6B38, 0, 0);
if (db_8049FAA0.x10 < 0x23) {
item = db_803EA94C[db_8049FAA0.x10];
} else if (db_8049FAA0.x10 < 0x2F) {
item = db_803EAA50[db_8049FAA0.x10];
} else if (db_8049FAA0.x10 < 0xEA) {
// TODO: this is wrong. return when the data section is good
item = db_803EA94C[db_8049FAA0.x10];
} else {
while (1) {
}
}
DevText_Printf(db_804D6B38, "Item-> %s Pokemon-> %s", item,
db_803EAA50[db_8049FAA0.x14]);
}
}

void db_802262E0(int player)
{
int mask = HSD_PAD_DPADLEFT | HSD_PAD_DPADRIGHT | HSD_PAD_DPADUP |
HSD_PAD_Z | HSD_PAD_R | HSD_PAD_L | HSD_PAD_A | HSD_PAD_B |
HSD_PAD_X | HSD_PAD_Y | HSD_PAD_START;
SpawnItem spawnItem;
if ((db_8022558C_suppress_inline(player) & mask) != 0) {
return;
}
if ((db_802255A4_suppress_inline(player) & HSD_PAD_DPADDOWN) == 0) {
return;
}
spawnItem.kind = db_8049FAA0.x10;
if (Item_80266F3C() == 0 && spawnItem.kind < 0x23) {
return;
}
Player_LoadPlayerCoords(player, &spawnItem.prev_pos);
spawnItem.prev_pos.y += 60.0F;
spawnItem.prev_pos.z = 0.0F;
spawnItem.pos = spawnItem.prev_pos;
spawnItem.facing_dir = it_8026B684(&spawnItem.prev_pos);
spawnItem.x3C_damage = 0;
spawnItem.vel.x = spawnItem.vel.y = spawnItem.vel.z = 0.0F;
spawnItem.x0_parent_gobj = NULL;
spawnItem.x4_parent_gobj2 = spawnItem.x0_parent_gobj;
spawnItem.x44_flag.bits.b0 = 1;
spawnItem.x40 = 0;
if (spawnItem.kind < 0x23 && Item_804A0C64.x0 >= it_804D6D28->x0) {
OSReport("Item Max Over.\n");
return;
}
if (spawnItem.kind < 0x2F && Item_804A0C64.x2C >= it_804D6D28->x14) {
OSReport("couldn't get Item struct.(CZako)");
return;
}
if ((spawnItem.kind < 0xD0 || spawnItem.kind >= 0xEA ||
it_804A0F60[spawnItem.kind] != 0) &&
(spawnItem.kind != 0x22 || it_8026C704() == 0))
{
{
HSD_GObj* gobj = Item_80268B18(&spawnItem);
if (gobj != NULL) {
GET_ITEM(gobj)->xDAA_flag.u8 |= db_804D6B3C;
efSync_Spawn(0x420, gobj, &spawnItem.prev_pos);
}
}
}
}

void db_8022659C(void)
{
int sp14;
Expand Down
6 changes: 6 additions & 0 deletions src/melee/db/db_2253_external.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,11 @@ void DevText_HideCursor(DevText*);
void DevText_SetBGColor(DevText*, int*);
void DevText_SetTextColor(DevText*, int*);
void DevText_SetScale(DevText*, float, float);
void DevText_ShowBackground(DevText*);
void DevText_ShowText(DevText*);
void DevText_Erase(DevText*);
void DevText_Printf(DevText*, char*, ...);
void DevText_SetCursorXY(DevText*, int, int);
int it_8026C704(void);

#endif
27 changes: 12 additions & 15 deletions src/melee/db/db_2253_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ void db_80225D7C(void);
void db_80225DD8(Item_GObj* item, Fighter_GObj* owner);
void db_80225E6C(Fighter_GObj* gobj);
void db_80225F20(int);
void db_802260D4(void);
void db_802261BC(void);
void db_802262E0(void);
void db_802260D4(int);
void db_802261BC(int);
void db_802262E0(int);
void db_802264C4(int);
void db_8022659C(void);
void db_8022666C(void);
Expand Down Expand Up @@ -131,7 +131,7 @@ char* db_803EA94C[] = {
"M Ball ",
// clang-format on
};
char* db_string_803EAA50[] = {
char* db_803EAA50[] = {
"Random", "Tosakinto", "Chicorita", "Kabigon", "Kamex",
"Matadogas", "Lizardon", "Fire", "Thunder", "Freezer",
"Sonans", "Hassam", "Unknown", "Entei", "Raikou",
Expand Down Expand Up @@ -162,9 +162,6 @@ int db_803EABDC[0xD] = { 0 };
char db_string_803EAC10[0x78] =
"Item=%d Foods=%d Yaku=%d Sp_Item=%d Pokemon=%d PokeShot=%d CZako=%d "
"CZakoShot=%d Zako=%d ZakoShot=%d Shot=%d Etc=%d\n";
char db_string_803EAC88[0x18] = "Item-> %s Pokemon-> %s";
char db_string_803EACA0[0x10] = "Item Max Over.\n";
char db_string_803EACB0[0x28] = "couldn't get Item struct.(CZako)\n";
char db_string_803EACD8[0x18] = "A B C D E F G";
char db_string_803EACF0[0x20] = "\n%d %d %2d %d %2.2f %2.2f %2.2f";
char db_string_803EAD10[0x10] = "EYE %d,%d,%d";
Expand Down Expand Up @@ -200,13 +197,13 @@ struct {
} db_8049FA00[4];
char db_8049FA50[0x50];
struct {
int x0;
unsigned int x0;
int x4;
int x8;
int xC;
int x10;
ItemKind x10;
int x14;
int x18;
ItemKind x18;
int x1C;
UnkFlagStruct x20;
int x24;
Expand All @@ -229,7 +226,7 @@ void* db_804D6B24;
void* db_804D6B28;
void* db_804D6B2C;
unsigned short db_804D6B30;
int db_804D6B38;
DevText* db_804D6B38;
int db_804D6B3C;
int db_804D6B40;
int db_804D6B48;
Expand Down Expand Up @@ -257,10 +254,10 @@ int db_804D6BA0;
// sdata2
const int db_804DBCF0 = 1;
const int db_804DBCF4 = 1;
const int db_804DBCF8 = 1;
const int db_804DBCFC = 1;
const int db_804DBD00 = 1;
const int db_804DBD04 = 1;
const float db_804DBCF8 = 1;
const float db_804DBCFC = 1;
const float db_804DBD00 = 1;
const float db_804DBD04 = 1;
const int db_804DBD08 = 1;
const int db_804DBD0C = 1;
const int db_804DBD10 = 1;
Expand Down
2 changes: 1 addition & 1 deletion src/melee/it/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -770,7 +770,7 @@ struct x1C_struct {
};

struct HSD_ObjAllocUnk {
s32 x0;
u32 x0;
s32 x4;
s32 x8;
s32 xC;
Expand Down

0 comments on commit 3a4b3cb

Please sign in to comment.