Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stick/Nut Upgrade Model Improvements #2313

Open
wants to merge 3 commits into
base: Dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
993 changes: 498 additions & 495 deletions ASM/build/asm_symbols.txt

Large diffs are not rendered by default.

Binary file modified ASM/build/bundle.o
Binary file not shown.
966 changes: 487 additions & 479 deletions ASM/build/c_symbols.txt

Large diffs are not rendered by default.

41 changes: 37 additions & 4 deletions ASM/c/item_draw_functions.c
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ void draw_gi_blue_fire_candle(z64_game_t* game, uint32_t draw_id) {
1, game->common.state_frames * 1, -(game->common.state_frames * 8), 16, 32));
duplicate_sys_matrix();
translate_sys_matrix(-8.0f, -2.0f, 0.0f, 1);
update_sys_matrix(game->mf_11DA0);
update_sys_matrix(game->billboard_mtx);
gSPMatrix(gfx->poly_xlu.p++, append_sys_matrix(gfx), G_MTX_MODELVIEW | G_MTX_LOAD | G_MTX_NOPUSH);
gSPDisplayList(gfx->poly_xlu.p++, item_draw_table[draw_id].args[1].dlist);
pop_sys_matrix();
Expand All @@ -384,7 +384,7 @@ void draw_gi_fairy_lantern(z64_game_t* game, uint32_t draw_id) {
0, 0, 0, 32, 32,
1, game->common.state_frames, -(game->common.state_frames * 6), 32, 32));
duplicate_sys_matrix();
update_sys_matrix(game->mf_11DA0);
update_sys_matrix(game->billboard_mtx);
gSPMatrix(gfx->poly_xlu.p++, append_sys_matrix(gfx), G_MTX_MODELVIEW | G_MTX_LOAD | G_MTX_NOPUSH);
gSPDisplayList(gfx->poly_xlu.p++, item_draw_table[draw_id].args[2].dlist);
pop_sys_matrix();
Expand All @@ -399,7 +399,7 @@ void draw_gi_fairy(z64_game_t* game, uint32_t draw_id) {
0, 0, 0, 32, 32,
1, game->common.state_frames, -(game->common.state_frames * 6), 32, 32));
duplicate_sys_matrix();
update_sys_matrix(game->mf_11DA0);
update_sys_matrix(game->billboard_mtx);
gSPMatrix(gfx->poly_xlu.p++, append_sys_matrix(gfx), G_MTX_MODELVIEW | G_MTX_LOAD | G_MTX_NOPUSH);
// Not sure how much of this is required but these are called from the bottle DL. Not including them causes it to draw weird
gDPSetRenderMode(gfx->poly_xlu.p++, G_RM_PASS, G_RM_AA_ZB_XLU_SURF2);
Expand All @@ -426,7 +426,7 @@ void draw_gi_poe_bottles(z64_game_t* game, uint32_t draw_id) {
0, 0, 0, 16, 32,
1, game->common.state_frames * 1, -(game->common.state_frames * 6), 16, 32));
duplicate_sys_matrix();
update_sys_matrix(game->mf_11DA0);
update_sys_matrix(game->billboard_mtx);
gSPMatrix(gfx->poly_xlu.p++, append_sys_matrix(gfx), G_MTX_MODELVIEW | G_MTX_LOAD | G_MTX_NOPUSH);
gSPDisplayList(gfx->poly_xlu.p++, item_draw_table[draw_id].args[3].dlist);
gSPDisplayList(gfx->poly_xlu.p++, item_draw_table[draw_id].args[2].dlist);
Expand Down Expand Up @@ -750,3 +750,36 @@ void draw_gi_magic_meter(z64_game_t* game, uint32_t draw_id) {
gSPDisplayList(gfx->poly_opa.p++, item_draw_table[draw_id].args[2].dlist);

}
void draw_gi_flame(z64_game_t *game, colorRGBA8_t prim, colorRGBA8_t env) {
z64_gfx_t *gfx = game->common.gfx;
static const uint32_t kFlameDlist = 0x52a10;

update_sys_matrix(game->billboard_mtx);
translate_sys_matrix(0, -35.0f, -10.0f, 1);
scale_sys_matrix(.0125,.0075,.01, 1);
gSPMatrix(gfx->poly_xlu.p++, append_sys_matrix(gfx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);

int16_t redGreen = 20;

append_setup_dl_25_to_xlu(gfx);
gDPSetEnvColor(gfx->poly_xlu.p++, env.r, env.g, env.b, 0);
gDPSetPrimColor(gfx->poly_xlu.p++, 0x0, 0x80, prim.r, prim.g, prim.b, 255);

gSPSegment(gfx->poly_xlu.p++, 0x08,
gen_double_tile(gfx, G_TX_RENDERTILE, 0, 0, 0x20, 0x40, 1, 0,
(-game->gameplay_frames & 0x7F) << 2, 0x20, 0x80));

gSPDisplayList(gfx->poly_xlu.p++, 0x04000000 | kFlameDlist);
}

void draw_gi_opa_with_flame(z64_game_t* game, uint32_t draw_id) {

draw_gi_various_opa0(game, draw_id);
draw_gi_flame(game, item_draw_table[draw_id].args[1].color, item_draw_table[draw_id].args[2].color);
}

void draw_gi_deku_nut_with_flame(z64_game_t* game, uint32_t draw_id) {

draw_gi_deku_nut(game, draw_id);
draw_gi_flame(game, item_draw_table[draw_id].args[1].color, item_draw_table[draw_id].args[2].color);
}
3 changes: 3 additions & 0 deletions ASM/c/item_draw_functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,8 @@ void draw_gi_nothing(z64_game_t* game, uint32_t draw_id);
void draw_gi_medallions(z64_game_t* game, uint32_t draw_id);
void draw_gi_stones(z64_game_t* game, uint32_t draw_id);
void draw_gi_magic_meter(z64_game_t* game, uint32_t draw_id);
void draw_gi_flame(z64_game_t* game, colorRGBA8_t prim, colorRGBA8_t env);
void draw_gi_opa_with_flame(z64_game_t* game, uint32_t draw_id);
void draw_gi_deku_nut_with_flame(z64_game_t* game, uint32_t draw_id);

#endif
8 changes: 5 additions & 3 deletions ASM/c/item_draw_table.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ item_draw_table_entry_t item_draw_table[] = {
[0x1A] = { draw_gi_various_opa0, { 0x060004D0 } }, // Deku Stick
[0x1B] = { draw_gi_various_opa0, { 0x060003C0 } }, // Map
[0x1C] = { draw_gi_various_opa0, { 0x06000A50 } }, // Deku Shield
[0x1D] = { draw_gi_various_opa0, { 0x06000580 } }, // Small Magic Jar
[0x1E] = { draw_gi_various_opa0, { 0x06000EE0 } }, // Large Magic Jar
[0x1D] = { draw_gi_various_opa0, { 0x06000580, 0xe0d4ffFF, 0xd4ffe2FF } }, // Small Magic Jar
[0x1E] = { draw_gi_various_opa0, { 0x06000EE0, 0xe0d4ffFF, 0xd4ffe2FF } }, // Large Magic Jar
[0x1F] = { draw_gi_various_opa0, { 0x060009A0 } }, // Bomb
[0x20] = { draw_gi_various_opa0, { 0x06000B70 } }, // Stone of Agony
[0x21] = { draw_gi_wallets, { 0x06001850, 0x06001750, 0x06001790, 0x060019A0, 0x060017B0, 0x06001A28, 0x060017D0, 0x06001AD8 } }, // Adult's Wallet
Expand Down Expand Up @@ -175,7 +175,9 @@ item_draw_table_entry_t item_draw_table[] = {
[0x9D] = { draw_gi_fairy, { 0x06000EF0 } }, // Fairy (not in a bottle but uses the fairy from the bottle)
[0x9E] = { draw_gi_nothing, {} },
[0x9F] = { draw_gi_magic_meter, { 0x06000A80, 0x06000F80, 0x060014C0, 0x00CE00FF, 0xFFFFFFFF, 0x000000FF } }, // Magic Meter , 0x000000FF -- 0x06000F70, 0x00CE00FF, --, 0x06009C0, 0x06001030, 0x00CE00FF, 0xFFFFFFFF
};
[0xA0] = { draw_gi_opa_with_flame, { 0x060004D0, 0xC0C0C0FF, 0xC0C0C0FF } }, // Deku Stick Upgrade w/ Smoke Effect
[0xA1] = { draw_gi_deku_nut_with_flame, { 0x06000E90, 0xC0C0C0FF, 0xC0C0C0FF } }, // Deku Nut Upgrade w/ Smoke Effect
};

void base_draw_gi_model(z64_game_t* game, uint32_t draw_id) {
item_draw_table[draw_id].draw_func(game, draw_id);
Expand Down
12 changes: 6 additions & 6 deletions ASM/c/item_table.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,10 @@ item_row_t item_table[GI_RANDO_MAX] = {
[GI_RUPEE_RED_LOSE] = ITEM_ROW(0x4D, BROWN_CHEST, 0x86, -1, 0x00F6, 0x017F, 0x6F, no_upgrade, no_effect, -1, -1, NULL), // Red Rupee (Chest Game)
[GI_RUPEE_PURPLE_LOSE] = ITEM_ROW(0x4D, BROWN_CHEST, 0x87, -1, 0x00F7, 0x017F, 0x71, no_upgrade, no_effect, -1, -1, NULL), // Purple Rupee (Chest Game)
[GI_HEART_PIECE_WIN] = ITEM_ROW(0x53, HEART_CHEST_SMALL, 0x7A, -1, 0x00FA, 0x00BD, 0x14, health_upgrade_cap, full_heal, -1, -1, NULL), // Piece of Heart (Chest Game)
[GI_DEKU_STICK_UPGRADE_20] = ITEM_ROW(0x53, BROWN_CHEST, 0x98, -1, 0x0090, 0x00C7, 0x1B, no_upgrade, no_effect, -1, -1, NULL), // Deku Stick Upgrade (20)
[GI_DEKU_STICK_UPGRADE_30] = ITEM_ROW(0x53, BROWN_CHEST, 0x99, -1, 0x0091, 0x00C7, 0x1B, no_upgrade, no_effect, -1, -1, NULL), // Deku Stick Upgrade (30)
[GI_DEKU_NUT_UPGRADE_30] = ITEM_ROW(0x53, BROWN_CHEST, 0x9A, -1, 0x00A7, 0x00BB, 0x12, no_upgrade, no_effect, -1, -1, NULL), // Deku Nut Upgrade (30)
[GI_DEKU_NUT_UPGRADE_40] = ITEM_ROW(0x53, BROWN_CHEST, 0x9B, -1, 0x00A8, 0x00BB, 0x12, no_upgrade, no_effect, -1, -1, NULL), // Deku Nut Upgrade (40)
[GI_DEKU_STICK_UPGRADE_20] = ITEM_ROW(0x53, BROWN_CHEST, 0x98, -1, 0x0090, 0x00C7, 0xA1, no_upgrade, no_effect, -1, -1, NULL), // Deku Stick Upgrade (20)
[GI_DEKU_STICK_UPGRADE_30] = ITEM_ROW(0x53, BROWN_CHEST, 0x99, -1, 0x0091, 0x00C7, 0xA1, no_upgrade, no_effect, -1, -1, NULL), // Deku Stick Upgrade (30)
[GI_DEKU_NUT_UPGRADE_30] = ITEM_ROW(0x53, BROWN_CHEST, 0x9A, -1, 0x00A7, 0x00BB, 0xA2, no_upgrade, no_effect, -1, -1, NULL), // Deku Nut Upgrade (30)
[GI_DEKU_NUT_UPGRADE_40] = ITEM_ROW(0x53, BROWN_CHEST, 0x9B, -1, 0x00A8, 0x00BB, 0xA2, no_upgrade, no_effect, -1, -1, NULL), // Deku Nut Upgrade (40)
[GI_BULLET_BAG_50] = ITEM_ROW(0x53, GILDED_CHEST, 0x49, -1, 0x006C, 0x017B, 0x73, no_upgrade, no_effect, -1, -1, NULL), // Bullet Bag (50)
[GI_ICE_TRAP] = ITEM_ROW(0x53, GILDED_CHEST, 0x41, -1, 0x9002, 0x0000, 0x00, no_upgrade, ice_trap_effect, -1, -1, NULL), // Ice Trap

Expand All @@ -167,8 +167,8 @@ item_row_t item_table[GI_RANDO_MAX] = {
[GI_PROGRESSIVE_SLINGSHOT] = ITEM_ROW( -1, GILDED_CHEST, -1, -1, -1, 0x00E7, 0x33, slingshot_upgrade, no_effect, -1, -1, NULL), // Progressive Slingshot
[GI_PROGRESSIVE_WALLET] = ITEM_ROW( -1, GILDED_CHEST, -1, -1, -1, 0x00D1, 0x22, wallet_upgrade, no_effect, -1, -1, NULL), // Progressive Wallet
[GI_PROGRESSIVE_SCALE] = ITEM_ROW( -1, GILDED_CHEST, -1, -1, -1, 0x00DB, 0x2A, scale_upgrade, no_effect, -1, -1, NULL), // Progressive Scale
[GI_PROGRESSIVE_NUT_CAPACITY] = ITEM_ROW( -1, BROWN_CHEST, -1, -1, -1, 0x00BB, 0x12, nut_upgrade, no_effect, -1, -1, NULL), // Progressive Nut Capacity
[GI_PROGRESSIVE_STICK_CAPACITY] = ITEM_ROW( -1, BROWN_CHEST, -1, -1, -1, 0x00C7, 0x1B, stick_upgrade, no_effect, -1, -1, NULL), // Progressive Stick Capacity
[GI_PROGRESSIVE_NUT_CAPACITY] = ITEM_ROW( -1, BROWN_CHEST, -1, -1, -1, 0x00BB, 0xA2, nut_upgrade, no_effect, -1, -1, NULL), // Progressive Nut Capacity
[GI_PROGRESSIVE_STICK_CAPACITY] = ITEM_ROW( -1, BROWN_CHEST, -1, -1, -1, 0x00C7, 0xA1, stick_upgrade, no_effect, -1, -1, NULL), // Progressive Stick Capacity
[GI_PROGRESSIVE_BOMBCHUS] = ITEM_ROW( -1, GILDED_CHEST, -1, -1, -1, 0x00D9, 0x28, bombchu_upgrade, no_effect, -1, -1, NULL), // Progressive Bombchus
[GI_PROGRESSIVE_MAGIC_METER] = ITEM_ROW( -1, GILDED_CHEST, -1, -1, -1, 0x00CD, 0x1E, magic_upgrade, no_effect, -1, -1, NULL), // Progressive Magic Meter
[GI_PROGRESSIVE_OCARINA] = ITEM_ROW( -1, GILDED_CHEST, -1, -1, -1, 0x010E, 0x46, ocarina_upgrade, no_effect, -1, -1, NULL), // Progressive Ocarina
Expand Down
2 changes: 1 addition & 1 deletion ASM/c/z64.h
Original file line number Diff line number Diff line change
Expand Up @@ -1447,7 +1447,7 @@ typedef struct {
char unk_16_[0x000B]; /* 0x11CBD */
void *room_ptr; /* 0x11CC8 */
char unk_17_[0x00D4]; /* 0x11CCC */
float mf_11DA0[4][4]; /* 0x11DA0 */
float billboard_mtx[4][4]; /* 0x11DA0 */
char unk_18_[0x0004]; /* 0x11DE0 */
uint32_t gameplay_frames; /* 0x11DE4 */
uint8_t link_age; /* 0x11DE8 */
Expand Down
Loading