Skip to content
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
953 changes: 477 additions & 476 deletions ASM/build/asm_symbols.txt

Large diffs are not rendered by default.

Binary file modified ASM/build/bundle.o
Binary file not shown.
905 changes: 454 additions & 451 deletions ASM/build/c_symbols.txt

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions ASM/c/get_items.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ void item_overrides_init();
void handle_pending_items();
void push_delayed_item(uint8_t flag);
void pop_pending_item();
void push_outgoing_override(override_t* override);
enum override_type {
OVR_BASE_ITEM = 0,
OVR_CHEST = 1,
Expand Down
3 changes: 2 additions & 1 deletion ASM/c/item_table.h
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,8 @@ typedef enum GetItemID {
/* 0x00B9 */ GI_MAGIC_METER, // Magic Meter
/* 0x00BA */ GI_DOUBLE_MAGIC, // Double Magic

/* 0x00BB */ GI_MINUET_OF_FOREST, // Minuet of Forest
/* 0x00BB */ GI_SONG_MIN,
/* 0x00BB */ GI_MINUET_OF_FOREST = GI_SONG_MIN, // Minuet of Forest
/* 0x00BC */ GI_BOLERO_OF_FIRE, // Bolero of Fire
/* 0x00BD */ GI_SERENADE_OF_WATER, // Serenade of Water
/* 0x00BE */ GI_REQUIEM_OF_SPIRIT, // Requiem of Spirit
Expand Down
1 change: 1 addition & 0 deletions ASM/c/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ void after_game_state_update() {
}
close_rando_display_buffer();
give_sage_gifts();
mw_send_own_songs();
}

void before_skybox_init(z64_game_t* game, int16_t skyboxId) {
Expand Down
23 changes: 23 additions & 0 deletions ASM/c/songs.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#include "get_items.h"
#include "item_table.h"
#include "z64.h"

extern uint8_t MW_SEND_OWN_ITEMS;
extern uint8_t SONGS_AS_ITEMS;

void mw_send_own_songs() {
if (MW_SEND_OWN_ITEMS && !SONGS_AS_ITEMS) {
for (int i = 0; i < 12; i++) {
if (z64_file.scene_flags[0x4A].unk_00_ & 1 << i) continue;
override_key_t override_key = { .scene = 0xFF, .type = OVR_DELAYED, .flag = 0x20 + i };
override_t override = lookup_override_by_key(override_key);
item_row_t* item_row = get_item_row(override.value.base.item_id);
int16_t quest_bit = item_row->effect_arg1;
override.value.base.item_id - GI_SONG_MIN;
if (z64_file.quest_items & 1 << quest_bit) {
push_outgoing_override(&override);
z64_file.scene_flags[0x4A].unk_00_ |= 1 << i;
}
}
}
}
4 changes: 2 additions & 2 deletions ASM/src/cutscenes.asm
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ override_epona_song:
sw ra, 0x18 (sp)

lui at, 0x8012
addiu at, at, 0xA5D0 ; v1 = 0x8012A5D0 # save context (sav)
addiu at, at, 0xA5D0 ; at = 0x8011A5D0 # save context (sav)
lb t0, 0x0EDE (at) ; check learned song from malon flag
ori t0, t0, 0x01 ; t9 = "Invited to Sing With Child Malon"
sb t0, 0x0EDE (at)
Expand All @@ -125,7 +125,7 @@ override_suns_song:
sw ra, 0x14 (sp)

lui at, 0x8012
addiu at, at, 0xA5D0 ; v1 = 0x8012A5D0 # save context (sav)
addiu at, at, 0xA5D0 ; at = 0x8011A5D0 # save context (sav)
lb t0, 0x0EDE (at) ; learned song from sun's song
ori t0, t0, 0x04
sb t0, 0x0EDE (at)
Expand Down
2 changes: 1 addition & 1 deletion ASM/src/malon.asm
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ return_from_the_other_function:

.orga 0xD7E890
nop ;bne t1,at,@@not_hyrule ; if scene is not Hyrule Castle
addiu v0,v0,0xa5d0 ; v0 = 0x8012a5d0 # save context
addiu v0,v0,0xa5d0 ; v0 = 0x8011a5d0 # save context
lhu t2,0x0ed6(v0) ; this byte holds the two flags below
andi t3,t2,0x10 ; t3 = "Talon has fled castle"
b @@safe ; skip code that may have reallocations
Expand Down
4 changes: 3 additions & 1 deletion Notes/extra-save-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ The unused field (offset 0x10) of the permanent scene flags (save context + 0xd4
* 0x48 Dampe's Grave and Windmill
* Pending ice traps: Scene 0x49
* 0x49 Fishing Pond
* Song locations reported for `MW_SEND_OWN_ITEMS`: Scene 0x4A
* 0x4A Castle Courtyard
* Expensive Merchants (Granny's Potion Shop only): Scene 0x4E
* 0x4E Granny's Potion Shop
* Unlocked ocarina notes: Scene 0x50
Expand All @@ -79,7 +81,7 @@ With `shuffle_cows`, the flags representing which cows have been talked to are s
* LLR Stables Right Cow: scene 0x36, bit 0200_0000
* LLR Stables Left Cow: scene 0x36, bit 0100_0000
* Kak Impas House Cow: scene 0x37, bit 0100_0000
* HF Cow Grotto Cow: scene 0x37, bit 0200_0000
* HF Cow Grotto Cow: scene 0x3e, bit 0200_0000
* DMT Cow Grotto Cow: scene 0x3e, bit 0100_0000
* LLR Tower Left Cow: scene 0x4c, bit 0200_0000
* LLR Tower Right Cow: scene 0x4c, bit 0100_0000
Expand Down
2 changes: 1 addition & 1 deletion data/generated/patch_symbols.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading