Skip to content

Commit f27753c

Browse files
committed
Add flame effect for stick/nut upgrades
1 parent 2d06302 commit f27753c

10 files changed

Lines changed: 16941 additions & 16707 deletions

File tree

ASM/build/asm_symbols.txt

Lines changed: 500 additions & 497 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ASM/build/bundle.o

1.24 KB
Binary file not shown.

ASM/build/c_symbols.txt

Lines changed: 490 additions & 482 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ASM/c/item_draw_functions.c

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ void draw_gi_blue_fire_candle(z64_game_t* game, uint32_t draw_id) {
363363
1, game->common.state_frames * 1, -(game->common.state_frames * 8), 16, 32));
364364
duplicate_sys_matrix();
365365
translate_sys_matrix(-8.0f, -2.0f, 0.0f, 1);
366-
update_sys_matrix(game->mf_11DA0);
366+
update_sys_matrix(game->billboard_mtx);
367367
gSPMatrix(gfx->poly_xlu.p++, append_sys_matrix(gfx), G_MTX_MODELVIEW | G_MTX_LOAD | G_MTX_NOPUSH);
368368
gSPDisplayList(gfx->poly_xlu.p++, item_draw_table[draw_id].args[1].dlist);
369369
pop_sys_matrix();
@@ -384,7 +384,7 @@ void draw_gi_fairy_lantern(z64_game_t* game, uint32_t draw_id) {
384384
0, 0, 0, 32, 32,
385385
1, game->common.state_frames, -(game->common.state_frames * 6), 32, 32));
386386
duplicate_sys_matrix();
387-
update_sys_matrix(game->mf_11DA0);
387+
update_sys_matrix(game->billboard_mtx);
388388
gSPMatrix(gfx->poly_xlu.p++, append_sys_matrix(gfx), G_MTX_MODELVIEW | G_MTX_LOAD | G_MTX_NOPUSH);
389389
gSPDisplayList(gfx->poly_xlu.p++, item_draw_table[draw_id].args[2].dlist);
390390
pop_sys_matrix();
@@ -399,7 +399,7 @@ void draw_gi_fairy(z64_game_t* game, uint32_t draw_id) {
399399
0, 0, 0, 32, 32,
400400
1, game->common.state_frames, -(game->common.state_frames * 6), 32, 32));
401401
duplicate_sys_matrix();
402-
update_sys_matrix(game->mf_11DA0);
402+
update_sys_matrix(game->billboard_mtx);
403403
gSPMatrix(gfx->poly_xlu.p++, append_sys_matrix(gfx), G_MTX_MODELVIEW | G_MTX_LOAD | G_MTX_NOPUSH);
404404
// Not sure how much of this is required but these are called from the bottle DL. Not including them causes it to draw weird
405405
gDPSetRenderMode(gfx->poly_xlu.p++, G_RM_PASS, G_RM_AA_ZB_XLU_SURF2);
@@ -426,7 +426,7 @@ void draw_gi_poe_bottles(z64_game_t* game, uint32_t draw_id) {
426426
0, 0, 0, 16, 32,
427427
1, game->common.state_frames * 1, -(game->common.state_frames * 6), 16, 32));
428428
duplicate_sys_matrix();
429-
update_sys_matrix(game->mf_11DA0);
429+
update_sys_matrix(game->billboard_mtx);
430430
gSPMatrix(gfx->poly_xlu.p++, append_sys_matrix(gfx), G_MTX_MODELVIEW | G_MTX_LOAD | G_MTX_NOPUSH);
431431
gSPDisplayList(gfx->poly_xlu.p++, item_draw_table[draw_id].args[3].dlist);
432432
gSPDisplayList(gfx->poly_xlu.p++, item_draw_table[draw_id].args[2].dlist);
@@ -744,3 +744,37 @@ void draw_gi_magic_meter(z64_game_t* game, uint32_t draw_id) {
744744
gDPSetEnvColor(gfx->poly_xlu.p++, env_color.r, env_color.g, env_color.b, env_color.a);
745745
gSPDisplayList(gfx->poly_xlu.p++, item_draw_table[draw_id].args[1].dlist);
746746
}
747+
void draw_gi_flame(z64_game_t *game, colorRGBA8_t prim, colorRGBA8_t env) {
748+
z64_gfx_t *gfx = game->common.gfx;
749+
static const uint32_t kFlameDlist = 0x52a10;
750+
751+
update_sys_matrix(game->billboard_mtx);
752+
translate_sys_matrix(0, -35.0f, -10.0f, 1);
753+
scale_sys_matrix(.0125,.0075,.01, 1);
754+
gSPMatrix(gfx->poly_xlu.p++, append_sys_matrix(gfx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
755+
756+
int16_t redGreen = 20;
757+
758+
append_setup_dl_25_to_xlu(gfx);
759+
gDPSetEnvColor(gfx->poly_xlu.p++, env.r, env.g, env.b, 0);
760+
gDPSetPrimColor(gfx->poly_xlu.p++, 0x0, 0x80, prim.r, prim.g, prim.b, 255);
761+
762+
gSPSegment(gfx->poly_xlu.p++, 0x08,
763+
gen_double_tile(gfx, G_TX_RENDERTILE, 0, 0, 0x20, 0x40, 1, 0,
764+
(-game->gameplay_frames & 0x7F) << 2, 0x20, 0x80));
765+
766+
gSPDisplayList(gfx->poly_xlu.p++, 0x04000000 | kFlameDlist);
767+
768+
}
769+
770+
void draw_gi_opa_with_flame(z64_game_t* game, uint32_t draw_id) {
771+
772+
draw_gi_various_opa0(game, draw_id);
773+
draw_gi_flame(game, item_draw_table[draw_id].args[1].color, item_draw_table[draw_id].args[2].color);
774+
}
775+
776+
void draw_gi_deku_nut_with_flame(z64_game_t* game, uint32_t draw_id) {
777+
778+
draw_gi_deku_nut(game, draw_id);
779+
draw_gi_flame(game, item_draw_table[draw_id].args[1].color, item_draw_table[draw_id].args[2].color);
780+
}

ASM/c/item_draw_functions.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,5 +52,8 @@ void draw_gi_nothing(z64_game_t* game, uint32_t draw_id);
5252
void draw_gi_medallions(z64_game_t* game, uint32_t draw_id);
5353
void draw_gi_stones(z64_game_t* game, uint32_t draw_id);
5454
void draw_gi_magic_meter(z64_game_t* game, uint32_t draw_id);
55+
void draw_gi_flame(z64_game_t *game, colorRGBA8_t prim, colorRGBA8_t env);
56+
void draw_gi_opa_with_flame(z64_game_t *game, uint32_t draw_id);
57+
void draw_gi_deku_nut_with_flame(z64_game_t* game, uint32_t draw_id);
5558

5659
#endif

ASM/c/item_draw_table.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ item_draw_table_entry_t item_draw_table[] = {
4242
[0x1A] = { draw_gi_various_opa0, { 0x060004D0 } }, // Deku Stick
4343
[0x1B] = { draw_gi_various_opa0, { 0x060003C0 } }, // Map
4444
[0x1C] = { draw_gi_various_opa0, { 0x06000A50 } }, // Deku Shield
45-
[0x1D] = { draw_gi_various_opa0, { 0x06000580 } }, // Small Magic Jar
46-
[0x1E] = { draw_gi_various_opa0, { 0x06000EE0 } }, // Large Magic Jar
45+
[0x1D] = { draw_gi_various_opa0, { 0x06000580, 0xe0d4ffFF, 0xd4ffe2FF } }, // Small Magic Jar
46+
[0x1E] = { draw_gi_various_opa0, { 0x06000EE0, 0xe0d4ffFF, 0xd4ffe2FF } }, // Large Magic Jar
4747
[0x1F] = { draw_gi_various_opa0, { 0x060009A0 } }, // Bomb
4848
[0x20] = { draw_gi_various_opa0, { 0x06000B70 } }, // Stone of Agony
4949
[0x21] = { draw_gi_wallets, { 0x06001850, 0x06001750, 0x06001790, 0x060019A0, 0x060017B0, 0x06001A28, 0x060017D0, 0x06001AD8 } }, // Adult's Wallet
@@ -175,7 +175,9 @@ item_draw_table_entry_t item_draw_table[] = {
175175
[0x9D] = { draw_gi_fairy, { 0x06000EF0 } }, // Fairy (not in a bottle but uses the fairy from the bottle)
176176
[0x9E] = { draw_gi_nothing, {} },
177177
[0x9F] = { draw_gi_magic_meter, { 0x06000000, 0x06000670, 0x00CE00FF, 0xFFFFFFFF, 0x000000FF } }, // Magic Meter
178-
};
178+
[0xA0] = { draw_gi_opa_with_flame, { 0x060004D0, 0xC0C0C0FF, 0xC0C0C0FF } }, // Deku Stick Upgrade w/ Smoke Effect
179+
[0xA1] = { draw_gi_deku_nut_with_flame, { 0x06000E90, 0xC0C0C0FF, 0xC0C0C0FF } }, // Deku Nut Upgrade w/ Smoke Effect
180+
};
179181

180182
void base_draw_gi_model(z64_game_t* game, uint32_t draw_id) {
181183
item_draw_table[draw_id].draw_func(game, draw_id);

ASM/c/item_table.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -149,10 +149,10 @@ item_row_t item_table[GI_RANDO_MAX] = {
149149
[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)
150150
[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)
151151
[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)
152-
[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)
153-
[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)
154-
[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)
155-
[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)
152+
[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)
153+
[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)
154+
[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)
155+
[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)
156156
[GI_BULLET_BAG_50] = ITEM_ROW(0x53, GILDED_CHEST, 0x49, -1, 0x006C, 0x017B, 0x73, no_upgrade, no_effect, -1, -1, NULL), // Bullet Bag (50)
157157
[GI_ICE_TRAP] = ITEM_ROW(0x53, GILDED_CHEST, 0x41, -1, 0x9002, 0x0000, 0x00, no_upgrade, ice_trap_effect, -1, -1, NULL), // Ice Trap
158158

@@ -167,8 +167,8 @@ item_row_t item_table[GI_RANDO_MAX] = {
167167
[GI_PROGRESSIVE_SLINGSHOT] = ITEM_ROW( -1, GILDED_CHEST, -1, -1, -1, 0x00E7, 0x33, slingshot_upgrade, no_effect, -1, -1, NULL), // Progressive Slingshot
168168
[GI_PROGRESSIVE_WALLET] = ITEM_ROW( -1, GILDED_CHEST, -1, -1, -1, 0x00D1, 0x22, wallet_upgrade, no_effect, -1, -1, NULL), // Progressive Wallet
169169
[GI_PROGRESSIVE_SCALE] = ITEM_ROW( -1, GILDED_CHEST, -1, -1, -1, 0x00DB, 0x2A, scale_upgrade, no_effect, -1, -1, NULL), // Progressive Scale
170-
[GI_PROGRESSIVE_NUT_CAPACITY] = ITEM_ROW( -1, BROWN_CHEST, -1, -1, -1, 0x00BB, 0x12, nut_upgrade, no_effect, -1, -1, NULL), // Progressive Nut Capacity
171-
[GI_PROGRESSIVE_STICK_CAPACITY] = ITEM_ROW( -1, BROWN_CHEST, -1, -1, -1, 0x00C7, 0x1B, stick_upgrade, no_effect, -1, -1, NULL), // Progressive Stick Capacity
170+
[GI_PROGRESSIVE_NUT_CAPACITY] = ITEM_ROW( -1, BROWN_CHEST, -1, -1, -1, 0x00BB, 0xA2, nut_upgrade, no_effect, -1, -1, NULL), // Progressive Nut Capacity
171+
[GI_PROGRESSIVE_STICK_CAPACITY] = ITEM_ROW( -1, BROWN_CHEST, -1, -1, -1, 0x00C7, 0xA1, stick_upgrade, no_effect, -1, -1, NULL), // Progressive Stick Capacity
172172
[GI_PROGRESSIVE_BOMBCHUS] = ITEM_ROW( -1, GILDED_CHEST, -1, -1, -1, 0x00D9, 0x28, bombchu_upgrade, no_effect, -1, -1, NULL), // Progressive Bombchus
173173
[GI_PROGRESSIVE_MAGIC_METER] = ITEM_ROW( -1, GILDED_CHEST, -1, -1, -1, 0x00CD, 0x1E, magic_upgrade, no_effect, -1, -1, NULL), // Progressive Magic Meter
174174
[GI_PROGRESSIVE_OCARINA] = ITEM_ROW( -1, GILDED_CHEST, -1, -1, -1, 0x010E, 0x46, ocarina_upgrade, no_effect, -1, -1, NULL), // Progressive Ocarina

ASM/c/z64.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1468,7 +1468,7 @@ typedef struct {
14681468
char unk_16_[0x000B]; /* 0x11CBD */
14691469
void *room_ptr; /* 0x11CC8 */
14701470
char unk_17_[0x00D4]; /* 0x11CCC */
1471-
float mf_11DA0[4][4]; /* 0x11DA0 */
1471+
float billboard_mtx[4][4]; /* 0x11DA0 */
14721472
char unk_18_[0x0004]; /* 0x11DE0 */
14731473
uint32_t gameplay_frames; /* 0x11DE4 */
14741474
uint8_t link_age; /* 0x11DE8 */

0 commit comments

Comments
 (0)