Skip to content

Commit dbd63eb

Browse files
committed
Bronze scale
1 parent f23114d commit dbd63eb

39 files changed

Lines changed: 34438 additions & 141 deletions

ASM/c/debug.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ void draw_debug_menu(z64_disp_buf_t *db) {
176176

177177
// Shoutouts to OoTMM
178178
z64_Play_SetupRespawnPoint(&z64_game, 1, 0xDFF);
179-
z64_file.void_flag = 2;
179+
z64_file.respawn_flag = 2;
180180

181181
z64_game.scene_load_flag = 0x14;
182182
z64_game.fadeout_transition = 0x02;

ASM/c/get_items.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ override_key_t get_override_search_key(z64_actor_t* actor, uint8_t scene, uint8_
124124
};
125125
} else if (scene == 0x3E && actor->actor_id == 0x011A) {
126126
return (override_key_t){
127-
.scene = z64_file.grotto_id,
127+
.scene = z64_file.respawn[RESPAWN_MODE_RETURN].data,
128128
.type = OVR_GROTTO_SCRUB,
129129
.flag = item_id,
130130
};

ASM/c/item_draw_functions.c

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,38 @@ void draw_gi_magic_spells(z64_game_t* game, uint32_t draw_id) {
281281
gSPDisplayList(gfx->poly_xlu.p++, item_draw_table[draw_id].args[1].dlist);
282282
gSPDisplayList(gfx->poly_xlu.p++, item_draw_table[draw_id].args[2].dlist);
283283
}
284+
static Gfx gGiBronzeScaleWaterColorDL[] = {
285+
gsDPPipeSync(),
286+
gsDPSetPrimColor(0, 0x60, 255, 255, 255, 255),
287+
gsDPSetEnvColor(255, 123, 0, 255),
288+
gsSPEndDisplayList(),
289+
};
290+
291+
static Gfx gGiBronzeScaleColorDL[] = {
292+
gsDPPipeSync(),
293+
gsDPSetPrimColor(0, 0x80, 255, 255, 255, 255),
294+
gsDPSetEnvColor(91, 51, 18, 255),
295+
gsSPEndDisplayList(),
296+
};
297+
298+
void draw_bronze_scale(z64_game_t* game, uint32_t draw_id) {
299+
300+
z64_gfx_t* gfx = game->common.gfx;
301+
302+
append_setup_dl_25_to_xlu(gfx);
303+
gSPSegment(gfx->poly_xlu.p++, 0x08,
304+
gen_double_tile(gfx,
305+
0, game->common.state_frames * 2, -(game->common.state_frames * 2), 64, 64,
306+
1, game->common.state_frames * 4, -(game->common.state_frames * 4), 32, 32));
307+
308+
309+
gSPMatrix(gfx->poly_xlu.p++, append_sys_matrix(gfx), G_MTX_MODELVIEW | G_MTX_LOAD | G_MTX_NOPUSH);
310+
311+
gSPDisplayList(gfx->poly_xlu.p++, (Gfx*)gGiBronzeScaleColorDL);
312+
gSPDisplayList(gfx->poly_xlu.p++, item_draw_table[draw_id].args[3].dlist);
313+
gSPDisplayList(gfx->poly_xlu.p++, (Gfx*)gGiBronzeScaleWaterColorDL);
314+
gSPDisplayList(gfx->poly_xlu.p++, item_draw_table[draw_id].args[0].dlist);
315+
}
284316

285317
void draw_gi_scales(z64_game_t* game, uint32_t draw_id) {
286318
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
@@ -46,6 +46,7 @@ void draw_gi_silver_rupee_pouch(z64_game_t* game, uint32_t draw_id);
4646
void draw_gi_a_button(z64_game_t* game, uint32_t draw_id);
4747
void draw_gi_c_button_vertical(z64_game_t* game, uint32_t draw_id);
4848
void draw_gi_c_button_horizontal(z64_game_t* game, uint32_t draw_id);
49+
void draw_bronze_scale(z64_game_t* game, uint32_t draw_id);
4950

5051

5152
#endif

ASM/c/item_draw_table.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ item_draw_table_entry_t item_draw_table[] = {
163163
[0x91] = { draw_gi_c_button_vertical, { 0x06000960, 0xFFA000FF, 1 } }, // Cdown button
164164
[0x92] = { draw_gi_c_button_horizontal, { 0x06000E10, 0xFFA000FF, 1 } }, // Cleft button
165165
[0x93] = { draw_gi_c_button_horizontal, { 0x06000E10, 0xFFA000FF, 0 } }, // Cright button
166+
[0x94] = { draw_bronze_scale, { 0x06000AA0, 0x06000A40, 0x06000A80, 0x06000CC8 } }, // Bronze scale
166167
};
167168

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

ASM/c/item_effects.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,3 +267,20 @@ void unlock_ocarina_note(z64_file_t* save, int16_t arg1, int16_t arg2) {
267267
break;
268268
}
269269
}
270+
271+
void give_progressive_scale(z64_file_t* save, int16_t arg1, int16_t arg2) {
272+
switch(arg1) {
273+
case 0: // Bronze scale
274+
extended_savectx.extended_scale[0] = 1;
275+
break;
276+
case 1:
277+
extended_savectx.extended_scale[0] = 2;
278+
save->diving_upgrade = 1;
279+
break;
280+
case 2:
281+
extended_savectx.extended_scale[0] = 3;
282+
save->diving_upgrade = 2;
283+
break;
284+
}
285+
286+
}

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
@@ -81,8 +81,8 @@ item_row_t item_table[] = {
8181
[0x0034] = ITEM_ROW(0x53, GILDED_CHEST, 0x4F, -1, 0x005A, 0x00BF, 0x1A, no_upgrade, no_effect, -1, -1, NULL), // Biggest Bomb Bag
8282
[0x0035] = ITEM_ROW(0x53, GILDED_CHEST, 0x51, -1, 0x005B, 0x012D, 0x49, no_upgrade, no_effect, -1, -1, NULL), // Silver Gauntlets
8383
[0x0036] = ITEM_ROW(0x53, GILDED_CHEST, 0x52, -1, 0x005C, 0x012D, 0x4A, no_upgrade, no_effect, -1, -1, NULL), // Golden Gauntlets
84-
[0x0037] = ITEM_ROW(0x53, GILDED_CHEST, 0x53, -1, 0x00CD, 0x00DB, 0x2A, no_upgrade, no_effect, -1, -1, NULL), // Silver Scale
85-
[0x0038] = ITEM_ROW(0x53, GILDED_CHEST, 0x54, -1, 0x00CE, 0x00DB, 0x2B, no_upgrade, no_effect, -1, -1, NULL), // Golden Scale
84+
[0x0037] = ITEM_ROW(0x53, GILDED_CHEST, 0x53, -1, 0x00CD, 0x00DB, 0x2A, no_upgrade, give_progressive_scale, 1, -1, NULL), // Silver Scale
85+
[0x0038] = ITEM_ROW(0x53, GILDED_CHEST, 0x54, -1, 0x00CE, 0x00DB, 0x2B, no_upgrade, give_progressive_scale, 2, -1, NULL), // Golden Scale
8686
[0x0039] = ITEM_ROW(0x53, GILDED_CHEST, 0x6F, -1, 0x0068, 0x00C8, 0x21, no_upgrade, no_effect, -1, -1, NULL), // Stone of Agony
8787
[0x003A] = ITEM_ROW(0x53, GILDED_CHEST, 0x70, -1, 0x007B, 0x00D7, 0x24, no_upgrade, no_effect, -1, -1, NULL), // Gerudo Membership Card
8888
[0x003B] = ITEM_ROW(0x53, GILDED_CHEST, 0x41, -1, 0x004A, 0x010E, 0x46, no_upgrade, give_fairy_ocarina, -1, -1, NULL), // Fairy Ocarina
@@ -327,6 +327,8 @@ item_row_t item_table[] = {
327327
[0x0116] = ITEM_ROW(0x53, SILVER_CHEST, 0x41, -1, 0x00A0, 0x01A0, 0x87, no_upgrade, give_small_key, FORT_ID, -1, resolve_text_small_keys), // Thieves' Hideout Small Key
328328
[0x0117] = ITEM_ROW(0x53, SILVER_CHEST, 0x41, -1, 0x00A1, 0x01A1, 0x88, no_upgrade, give_small_key, CASTLE_ID, -1, resolve_text_small_keys), // Ganon's Castle Small Key
329329
[0x0118] = ITEM_ROW(0x53, SILVER_CHEST, 0x41, -1, 0x00F3, 0x01A2, 0x89, no_upgrade, give_small_key, TCG_ID, -1, resolve_text_small_keys_cmg), // Small Key (Chest Game)
330+
331+
[0x0119] = ITEM_ROW(0x53, GILDED_CHEST, 0x41, -1, 0x90B4, 0x00DB, 0x95, no_upgrade, give_progressive_scale, 0, -1, NULL), // Bronze Scale
330332
};
331333

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

ASM/c/item_upgrades.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#include "item_upgrades.h"
22

33
#include "get_items.h"
4+
#include "save.h"
45
#include "z64.h"
56

67
extern uint32_t FREE_BOMBCHU_DROPS;
@@ -15,7 +16,7 @@ typedef struct {
1516
uint8_t magic : 2; // 0 = no magic, 1 = single magic, 2 = double magic
1617
uint8_t sticks : 2; // 0 = no sticks, 1 = 10, 2 = 20, 3 = 30
1718
uint8_t nuts : 2; // 0 = no nuts, 1 = 20, 2 = 30, 3 = 40
18-
uint8_t scale : 2; // 0 = no scale, 1 = silver scale, 2 = gold scale
19+
uint8_t scale : 3; // 0 = no scale, 1 = bronze_scale, 2 = silver scale, 3 = gold scale
1920
uint8_t wallet : 2; // 0 = 99, 1 = 200, 2 = 500, 3 = 999
2021
uint8_t slingshot : 2; // 0 = no slingshot, 1 = 30, 2 = 40, 3 = 50
2122
uint8_t bow : 2; // 0 = no bow, 1 = 30, 2 = 40, 3 = 50
@@ -82,8 +83,9 @@ uint16_t wallet_upgrade(z64_file_t* save, override_t override) {
8283
}
8384

8485
uint16_t scale_upgrade(z64_file_t* save, override_t override) {
85-
switch ((override.value.base.player == PLAYER_ID || !MW_PROGRESSIVE_ITEMS_ENABLE) ? save->diving_upgrade : MW_PROGRESSIVE_ITEMS_STATE[override.value.base.player].scale) {
86-
case 0: return 0x37; // Silver Scale
86+
switch ((override.value.base.player == PLAYER_ID || !MW_PROGRESSIVE_ITEMS_ENABLE) ? extended_savectx.extended_scale[0] : MW_PROGRESSIVE_ITEMS_STATE[override.value.base.player].scale) {
87+
case 0: return 0x119; // Bronze Scale
88+
case 1: return 0x37; // Silver Scale
8789
default: return 0x38; // Gold Scale
8890
}
8991
}

ASM/c/main.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include "debug.h"
2525
#include "inputviewer.h"
2626
#include "message.h"
27+
#include "swim.h"
2728

2829
void Gameplay_InitSkybox(z64_game_t* globalCtx, int16_t skyboxId);
2930

@@ -62,6 +63,7 @@ void after_game_state_update() {
6263
debug_utilities(&(z64_ctxt.gfx->overlay));
6364
}
6465
give_ganon_boss_key();
66+
manage_swim();
6567
}
6668

6769
void before_skybox_init(z64_game_t* game, int16_t skyboxId) {

0 commit comments

Comments
 (0)