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
1,486 changes: 743 additions & 743 deletions ASM/build/asm_symbols.txt

Large diffs are not rendered by default.

Binary file modified ASM/build/bundle.o
Binary file not shown.
1,448 changes: 726 additions & 722 deletions ASM/build/c_symbols.txt

Large diffs are not rendered by default.

24 changes: 6 additions & 18 deletions ASM/c/actor.c
Original file line number Diff line number Diff line change
Expand Up @@ -244,27 +244,15 @@ z64_actor_t* Player_SpawnEntry_Hack(void* actorCtx, ActorEntry* playerEntry, z64
extern z64_actor_t* Actor_Spawn_Continue(void* actorCtx, z64_game_t* globalCtx, int16_t actorId, float posX, float posY, float posZ, int16_t rotX, int16_t rotY, int16_t rotZ, int16_t params);

z64_actor_t* Actor_Spawn_Hook(void* actorCtx, z64_game_t* globalCtx, int16_t actorId, float posX, float posY, float posZ, int16_t rotX, int16_t rotY, int16_t rotZ, int16_t params) {
bool continue_spawn = true;

ActorEntry entry;
entry.id = actorId;
entry.params = params;
entry.pos.x = (int16_t)posX;
entry.pos.y = (int16_t)posY;
entry.pos.z = (int16_t)posZ;
entry.rot.x = rotX;
entry.rot.y = rotY;
entry.rot.z = rotZ;

if (continue_spawn) {
z64_actor_t* spawned = Actor_Spawn_Continue(actorCtx, globalCtx, actorId, posX, posY, posZ, rotX, rotY, rotZ, params);
if (spawned) {
if (spawn_actor_with_flag) {
Actor_StoreFlag(spawned, globalCtx, *spawn_actor_with_flag);
Actor_StoreChestType(spawned, globalCtx);
}
z64_actor_t* spawned = Actor_Spawn_Continue(actorCtx, globalCtx, actorId, posX, posY, posZ, rotX, rotY, rotZ, params);
if (spawned) {
if (spawn_actor_with_flag) {
Actor_StoreFlag(spawned, globalCtx, *spawn_actor_with_flag);
Actor_StoreChestType(spawned, globalCtx);
}
return spawned;
}

return NULL;
}
4 changes: 4 additions & 0 deletions ASM/c/bombchu_bowling.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@ int16_t select_bombchu_bowling_prize(int16_t prizeSelect) {
// currently functionally redundant when the flag is set.
prizeTemp = EXITEM_PURPLE_RUPEE_BOWLING;
break;
default: // Shouldn't get here
prizeTemp = EXITEM_PURPLE_RUPEE_BOWLING;
break;
}

} else {
// maintain renewable bombchus/bombs if extra shuffle is disabled
if (!EXTRA_BOWLING_SHUFFLE) {
Expand Down
9 changes: 7 additions & 2 deletions ASM/c/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,11 @@ bool get_flag(uint8_t flagtype, uint8_t flag) {
return Flags_GetTempClear(&z64_game, flag);
case 5:
return Flags_GetCollectible(&z64_game, flag);
default:
char error_msg[256];
sprintf(error_msg, "%s line %d", __FILE__, __LINE__);
Fault_AddHungupAndCrashImpl("get_flag: flagtype not valid", error_msg);
return false;
}
}

Expand Down Expand Up @@ -703,7 +708,7 @@ void draw_debug_menu(z64_disp_buf_t* db) {
break;
case 8: // Overlay
if (current_menu_indexes.sub_menu_index == 1) {
uint8_t nbOverlays, currentOverlayTabIndex = 0;
uint8_t nbOverlays = 0, currentOverlayTabIndex = 0;
for (int overlay_id = 0; overlay_id < 0x0192; overlay_id++) {
ActorOverlay overlay = gActorOverlayTable[overlay_id];
if (overlay.loadedRamAddr) {
Expand Down Expand Up @@ -1028,7 +1033,7 @@ void draw_debug_menu(z64_disp_buf_t* db) {
if (current_menu_indexes.sub_menu_index == 1) {
uint8_t currentOverlayTab = current_menu_indexes.overlay_index / 12;
// Display overlay list in 12 by 12 pages.
uint8_t nbOverlays, currentOverlayTabIndex = 0;
uint8_t nbOverlays = 0, currentOverlayTabIndex = 0;
for (int overlay_id = 0; overlay_id < 0x0192; overlay_id++) {
ActorOverlay overlay = gActorOverlayTable[overlay_id];
if (overlay.loadedRamAddr) {
Expand Down
2 changes: 2 additions & 0 deletions ASM/c/door_of_time.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ int32_t DemoKankyo_CutsceneFlags_Get_Hook(void* play, int16_t flag) {
case 2: // oot_sot
case 4: // stones_sot
case 5: // stones_oot_sot
default: // Shouldn't happen
return has_items_for_door_of_time() && CutsceneFlags_Get(play, flag);
}
}
Expand All @@ -27,6 +28,7 @@ bool has_items_for_door_of_time() {
case 4: // stones_sot
return (z64_file.quest_items & 0x1C0000) == 0x1C0000;
case 5: // stones_oot_sot
default: // Shouldn't happen
return (z64_file.quest_items & 0x1C0000) == 0x1C0000 && z64_file.items[Z64_SLOT_OCARINA] == 0x08;
}
}
11 changes: 6 additions & 5 deletions ASM/c/file_message.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@ extern uint8_t PLANDOMIZER_USED;
#define TEXT_WIDTH 8
#define TEXT_HEIGHT 9

static int string_length(const char* txt) {
const char* pos = txt;
while (*pos) ++pos;
return pos - txt;
}
// Currently unused
// static int string_length(const char* txt) {
// const char* pos = txt;
// while (*pos) ++pos;
// return pos - txt;
// }

static uint8_t get_alpha(const z64_menudata_t* menu_data) {
uint8_t alt_tr = (uint8_t)menu_data->alt_transition;
Expand Down
22 changes: 14 additions & 8 deletions ASM/c/get_items.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ override_key_t get_override_search_key_by_newflag(xflag_t* flag) {
.flag = flag->all,
};
return resolve_alternative_override(key);
} else {
// Should not get here
return (override_key_t){ 0 };
}
}

Expand Down Expand Up @@ -157,6 +160,8 @@ override_key_t get_override_search_key(z64_actor_t *actor, uint8_t scene, uint8_
.flag = item_id,
};
}
// Should not get here
return (override_key_t){ 0 };
}

override_t lookup_override_by_key(override_key_t key) {
Expand Down Expand Up @@ -451,14 +456,12 @@ void handle_pending_items() {
void get_item(z64_actor_t* from_actor, z64_link_t* link, int8_t incoming_item_id) {
override_t override = { 0 };
int incoming_negative = incoming_item_id < 0;
int8_t item_id = 0;
item_row_t* row;
int8_t item_id = ABS(incoming_item_id);
item_row_t* row = get_item_row(item_id);

if (from_actor && incoming_item_id != 0) {
item_id = incoming_negative ? -incoming_item_id : incoming_item_id;
// Set trade items as traded, but keep in inventory. The incoming item
// ID will be the next sequential trade item, so use that as a reference.
row = get_item_row(item_id);
if (row) {
int16_t action_id = row->action_id;
// Set adult trade item "traded" flags to prevent duping.
Expand Down Expand Up @@ -753,6 +756,7 @@ void Room_Change_Actor_Kill_Hack(z64_actor_t *actor) {

// Hack in EnItem00_Init where it checks whether or not to kill the actor based on the collectible flag.
// We use this point to determine if this is an overriden collectible and store that information in the actor.
// return 1 if actor is killed, else 0
bool Item00_KillActorIfFlagIsSet(z64_actor_t* actor) {
EnItem00* this = (EnItem00*)actor;
this->is_silver_rupee = false;
Expand Down Expand Up @@ -796,6 +800,8 @@ bool Item00_KillActorIfFlagIsSet(z64_actor_t* actor) {
z64_ActorKill(actor);
return 1;
}

return 0;
}

// Check ammo counts for bombs/chus and drop correspondingly.
Expand Down Expand Up @@ -993,14 +999,14 @@ uint8_t item_give_collectible(uint8_t item, z64_link_t* link, z64_actor_t* from_

void get_skulltula_token(z64_actor_t* token_actor) {
override_t override = lookup_override(token_actor, 0, 0);
uint16_t item_id;
//uint16_t item_id;
uint8_t player;
if (override.key.all == 0) {
// Give a skulltula token if there is no override
item_id = GI_SKULL_TOKEN;
// Give a skulltula token if there is no override // item_id currently not used
//item_id = GI_SKULL_TOKEN;
player = PLAYER_ID;
} else {
item_id = override.value.base.item_id;
//item_id = override.value.base.item_id;
player = override.value.base.player;
}

Expand Down
1 change: 1 addition & 0 deletions ASM/c/item_upgrades.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ uint16_t bombchus_to_bag(z64_file_t* save, override_t override) {
case GI_BOMBCHUS_10: return GI_BOMBCHU_BAG_10; // 10 pack
case GI_BOMBCHUS_5: return GI_BOMBCHU_BAG_5; // 5 pack
case GI_BOMBCHUS_20: return GI_BOMBCHU_BAG_20; // 20 pack
default: return GI_BOMBCHU_BAG_5; // Should not happen
}
} else {
// Subsequent chu packs stay as chu packs
Expand Down
3 changes: 1 addition & 2 deletions ASM/c/kaleido_item.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ void KaleidoScope_DrawItemSelect(z64_game_t* play) {
uint16_t i;
uint16_t j;
uint16_t cursor_item;
uint16_t cursor_slot;
uint16_t cursor_slot = pause_ctxt->cursor_slot[PAUSE_ITEM];
uint16_t index;
int16_t cursor_point;
int16_t cursor_x;
Expand All @@ -32,7 +32,6 @@ void KaleidoScope_DrawItemSelect(z64_game_t* play) {
old_cursor_point = pause_ctxt->cursor_point[PAUSE_ITEM];

cursor_item = pause_ctxt->cursor_item[PAUSE_ITEM];
cursor_slot = pause_ctxt->cursor_slot[PAUSE_ITEM];

if (pause_ctxt->cursor_special_pos == 0) {
pause_ctxt->cursor_color_set = 4;
Expand Down
2 changes: 1 addition & 1 deletion ASM/c/text.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ int text_print(z64_disp_buf_t* db, const char* s, int left, int top) {
}

int draw_int(z64_disp_buf_t* db, int32_t number, int16_t left, int16_t top, colorRGBA8_t color) {
draw_int_size(db, number, left, top, color, 8, 16);
return draw_int_size(db, number, left, top, color, 8, 16);
}

// Helper function for drawing numbers to the HUD.
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