Skip to content

Commit 952efd5

Browse files
committed
Bronze scale
Rob and Kirox's Extended Save Context Adventure Move item ID to 0x130 Merge Dev Update to main dev and address reviews Add GV child entrance when getting thrown by guards Fix presets Improve debug menu Bronze scale Rob and Kirox's Extended Save Context Adventure Move item ID to 0x130 Merge Dev Update to main dev and address reviews Fix presets add advanced logic and review botw mq fixes fix vanilla botw deku tree fixes jabu fixes and ice typo Remove debug/z64 unrelated changes and add new special respawns Add third scale to starting items Rebase squash and add hyrule field respawn
1 parent 02188d9 commit 952efd5

59 files changed

Lines changed: 29677 additions & 28908 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

ASM/build/asm_symbols.txt

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

ASM/build/bundle.o

2.79 KB
Binary file not shown.

ASM/build/c_symbols.txt

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

ASM/c/file_icons.c

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include "hud_colors.h"
55
#include "triforce.h"
66
#include "ocarina_buttons.h"
7+
#include "save.h"
78

89
#define ICON_SIZE 0x0C
910
#define MUSIC_WIDTH 0x06
@@ -172,6 +173,7 @@ static const variable_tile_data_t variable_tile_positions[NUM_VARIABLE] = {
172173
{0, {0x4E, 0x2A}}, // Strength
173174
{0, {0x5A, 0x2A}}, // Scale
174175
};
176+
static bool bronze_scale_marker = false;
175177

176178
typedef struct {
177179
colorRGB8_t color;
@@ -380,8 +382,9 @@ static void populate_child_trade(const z64_file_t* file, variable_tile_t* tile);
380382
static void populate_adult_trade(const z64_file_t* file, variable_tile_t* tile);
381383
static void populate_magic(const z64_file_t* file, variable_tile_t* tile);
382384
static void populate_upgrade_equip(const z64_file_t* file, variable_tile_t* tile, uint8_t value, uint8_t max, uint8_t base_tile);
385+
static void populate_upgrade_scale(const z64_file_t* file, variable_tile_t* tile, uint8_t value, uint8_t base_tile);
383386

384-
static void populate_variable(const z64_file_t* file, variable_tile_info_t* info) {
387+
void populate_variable(const z64_file_t* file, variable_tile_info_t* info) {
385388
variable_tile_t* tile = info->tiles;
386389

387390
populate_upgrade_item( file, tile++, Z64_SLOT_OCARINA, Z64_ITEM_FAIRY_OCARINA);
@@ -390,7 +393,8 @@ static void populate_variable(const z64_file_t* file, variable_tile_info_t* info
390393
populate_adult_trade( file, tile++);
391394
populate_magic( file, tile++);
392395
populate_upgrade_equip(file, tile++, file->strength_upgrade, 3, Z64_ITEM_GORONS_BRACELET);
393-
populate_upgrade_equip(file, tile++, file->diving_upgrade, 2, Z64_ITEM_SILVER_SCALE);
396+
extended_savecontext_static_t* extended = &(((extended_sram_file_t*)file)->additional_save_data.extended);
397+
populate_upgrade_scale(file, tile++, extended->extended_scale, Z64_ITEM_SILVER_SCALE);
394398
}
395399

396400

@@ -519,6 +523,11 @@ static void draw_variable(z64_disp_buf_t* db, const variable_tile_info_t* info,
519523
color = WHITE;
520524
color.a = color_product(color.a, alpha);
521525
}
526+
if (bronze_scale_marker) {
527+
sprite_load(db, &item_digit_sprite, 0, 1);
528+
sprite_draw(db, &item_digit_sprite, 0, get_left(variable_tile_positions[NUM_VARIABLE - 1].pos) + 4,
529+
get_top(variable_tile_positions[NUM_VARIABLE - 1].pos) + 3, 6, 6);
530+
}
522531
}
523532

524533

@@ -934,3 +943,22 @@ static void populate_upgrade_equip(const z64_file_t* file, variable_tile_t* tile
934943
tile->tile_index = base_tile + (value - 1);
935944
}
936945
}
946+
947+
static void populate_upgrade_scale(const z64_file_t* file, variable_tile_t* tile, uint8_t value, uint8_t base_tile) {
948+
tile->tile_index = base_tile;
949+
bronze_scale_marker = false;
950+
if (value == 0) {
951+
bronze_scale_marker = true;
952+
tile->enabled = 0;
953+
}
954+
if (value == 1) {
955+
tile->enabled = 0;
956+
}
957+
if (value == 2) {
958+
tile->enabled = 1;
959+
}
960+
if (value == 3) {
961+
tile->enabled = 1;
962+
tile->tile_index++;
963+
}
964+
}

ASM/c/item_draw_functions.c

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,38 @@ void draw_gi_magic_spells(z64_game_t* game, uint32_t draw_id) {
292292
gSPDisplayList(gfx->poly_xlu.p++, item_draw_table[draw_id].args[1].dlist);
293293
gSPDisplayList(gfx->poly_xlu.p++, item_draw_table[draw_id].args[2].dlist);
294294
}
295+
static Gfx gGiBronzeScaleWaterColorDL[] = {
296+
gsDPPipeSync(),
297+
gsDPSetPrimColor(0, 0x60, 255, 255, 255, 255),
298+
gsDPSetEnvColor(255, 123, 0, 255),
299+
gsSPEndDisplayList(),
300+
};
301+
302+
static Gfx gGiBronzeScaleColorDL[] = {
303+
gsDPPipeSync(),
304+
gsDPSetPrimColor(0, 0x80, 255, 255, 255, 255),
305+
gsDPSetEnvColor(91, 51, 18, 255),
306+
gsSPEndDisplayList(),
307+
};
308+
309+
void draw_bronze_scale(z64_game_t* game, uint32_t draw_id) {
310+
311+
z64_gfx_t* gfx = game->common.gfx;
312+
313+
append_setup_dl_25_to_xlu(gfx);
314+
gSPSegment(gfx->poly_xlu.p++, 0x08,
315+
gen_double_tile(gfx,
316+
0, game->common.state_frames * 2, -(game->common.state_frames * 2), 64, 64,
317+
1, game->common.state_frames * 4, -(game->common.state_frames * 4), 32, 32));
318+
319+
320+
gSPMatrix(gfx->poly_xlu.p++, append_sys_matrix(gfx), G_MTX_MODELVIEW | G_MTX_LOAD | G_MTX_NOPUSH);
321+
322+
gSPDisplayList(gfx->poly_xlu.p++, (Gfx*)gGiBronzeScaleColorDL);
323+
gSPDisplayList(gfx->poly_xlu.p++, item_draw_table[draw_id].args[3].dlist);
324+
gSPDisplayList(gfx->poly_xlu.p++, (Gfx*)gGiBronzeScaleWaterColorDL);
325+
gSPDisplayList(gfx->poly_xlu.p++, item_draw_table[draw_id].args[0].dlist);
326+
}
295327

296328
void draw_gi_scales(z64_game_t* game, uint32_t draw_id) {
297329
z64_gfx_t* gfx = game->common.gfx;

ASM/c/item_draw_functions.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,5 +56,6 @@ void draw_gi_flame(z64_disp_buf_t* dl, z64_game_t *game, colorRGBA8_t prim, colo
5656
void draw_gi_xlu_with_flame(z64_game_t *game, uint32_t draw_id);
5757
void draw_gi_deku_nut_with_flame(z64_game_t* game, uint32_t draw_id);
5858
void draw_ice_trap(z64_game_t* game, uint32_t draw_id);
59+
void draw_bronze_scale(z64_game_t* game, uint32_t draw_id);
5960

6061
#endif

ASM/c/item_draw_table.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ item_draw_table_entry_t item_draw_table[] = {
179179
[0xA1] = { draw_gi_deku_nut_with_flame, { 0x06000E90, 0xC0C0C0FF, 0xC0C0C0FF } }, // Deku Nut Upgrade w/ Smoke Effect
180180
[0xA2] = { draw_gi_magic_meter, { 0x06000000, 0x06000CC0, 0x06000F08, 0x060014E8, 0x286428FF, 0x000000FF } }, // Magic Meter Scroll 2
181181
[0xA3] = { draw_ice_trap, { 0x04034380 } }, // Ice trap
182+
[0xA4] = { draw_bronze_scale, { 0x06000AA0, 0x06000A40, 0x06000A80, 0x06000CC8 } }, // Bronze scale
182183
};
183184

184185
void base_draw_gi_model(z64_game_t* game, uint32_t draw_id) {

ASM/c/item_effects.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,3 +283,19 @@ void unlock_ocarina_note(z64_file_t* save, int16_t arg1, int16_t arg2) {
283283
break;
284284
}
285285
}
286+
287+
void give_progressive_scale(z64_file_t* save, int16_t arg1, int16_t arg2) {
288+
switch(arg1) {
289+
case 0: // Bronze scale
290+
extended_savectx.extended_scale = 1;
291+
break;
292+
case 1: // Silver scale
293+
extended_savectx.extended_scale = 2;
294+
save->diving_upgrade = 1;
295+
break;
296+
case 2: // Gold scale
297+
extended_savectx.extended_scale = 3;
298+
save->diving_upgrade = 2;
299+
break;
300+
}
301+
}

ASM/c/item_effects.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ void give_bombchus(z64_file_t* save, int16_t arg1, int16_t arg2);
3131
void trade_quest_upgrade(z64_file_t* save, int16_t item_id, int16_t arg2);
3232
extern uint8_t KEYRING_BOSSKEY_CONDITION;
3333
void unlock_ocarina_note(z64_file_t* save, int16_t arg1, int16_t arg2);
34+
void give_progressive_scale(z64_file_t* save, int16_t arg1, int16_t arg2);
3435

3536
typedef enum dungeon {
3637
DEKU_ID = 0,

ASM/c/item_table.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ item_row_t item_table[GI_RANDO_MAX] = {
8484
[GI_BOMB_BAG_40] = ITEM_ROW(0x53, GILDED_CHEST, 0x4F, -1, 0x005A, 0x00BF, 0x1A, no_upgrade, no_effect, -1, -1, NULL), // Biggest Bomb Bag
8585
[GI_SILVER_GAUNTLETS] = ITEM_ROW(0x53, GILDED_CHEST, 0x51, -1, 0x005B, 0x012D, 0x49, no_upgrade, no_effect, -1, -1, NULL), // Silver Gauntlets
8686
[GI_GOLD_GAUNTLETS] = ITEM_ROW(0x53, GILDED_CHEST, 0x52, -1, 0x005C, 0x012D, 0x4A, no_upgrade, no_effect, -1, -1, NULL), // Golden Gauntlets
87-
[GI_SCALE_SILVER] = ITEM_ROW(0x53, GILDED_CHEST, 0x53, -1, 0x00CD, 0x00DB, 0x2A, no_upgrade, no_effect, -1, -1, NULL), // Silver Scale
88-
[GI_SCALE_GOLDEN] = ITEM_ROW(0x53, GILDED_CHEST, 0x54, -1, 0x00CE, 0x00DB, 0x2B, no_upgrade, no_effect, -1, -1, NULL), // Golden Scale
87+
[GI_SCALE_SILVER] = ITEM_ROW(0x53, GILDED_CHEST, 0x53, -1, 0x00CD, 0x00DB, 0x2A, no_upgrade, give_progressive_scale, 1, -1, NULL), // Silver Scale
88+
[GI_SCALE_GOLDEN] = ITEM_ROW(0x53, GILDED_CHEST, 0x54, -1, 0x00CE, 0x00DB, 0x2B, no_upgrade, give_progressive_scale, 2, -1, NULL), // Golden Scale
8989
[GI_STONE_OF_AGONY] = ITEM_ROW(0x53, GILDED_CHEST, 0x6F, -1, 0x0068, 0x00C8, 0x21, no_upgrade, no_effect, -1, -1, NULL), // Stone of Agony
9090
[GI_GERUDOS_CARD] = ITEM_ROW(0x53, GILDED_CHEST, 0x70, -1, 0x007B, 0x00D7, 0x24, no_upgrade, no_effect, -1, -1, NULL), // Gerudo Membership Card
9191

@@ -347,6 +347,8 @@ item_row_t item_table[GI_RANDO_MAX] = {
347347
[GI_WATER_MEDALLION] = ITEM_ROW(0x53, GILDED_CHEST, 0x41, -1, 0x003D, 0x01B1, 0x98, no_upgrade, give_quest_item, 2, -1, NULL), // Water Medallion
348348
[GI_SHADOW_MEDALLION] = ITEM_ROW(0x53, GILDED_CHEST, 0x41, -1, 0x0041, 0x01B2, 0x99, no_upgrade, give_quest_item, 4, -1, NULL), // Shadow Medallion
349349
[GI_SPIRIT_MEDALLION] = ITEM_ROW(0x53, GILDED_CHEST, 0x41, -1, 0x003F, 0x01B3, 0x9A, no_upgrade, give_quest_item, 3, -1, NULL), // Spirit Medallion
350+
351+
[GI_SCALE_BRONZE] = ITEM_ROW(0x53, GILDED_CHEST, 0x54, -1, 0x90B6, 0x00DB, 0xA5, no_upgrade, give_progressive_scale, 0, -1, NULL), // Golden Scale
350352
};
351353

352354
/* Determine which message to display based on the number of silver rupees collected.

0 commit comments

Comments
 (0)