Skip to content

Commit

Permalink
Merge pull request #1 from mracsys/optional-key-models
Browse files Browse the repository at this point in the history
make custom key models a setting
  • Loading branch information
Maplesstar authored May 31, 2023
2 parents 9c20d35 + 2cc1c5f commit 90ec367
Show file tree
Hide file tree
Showing 15 changed files with 11,178 additions and 10,988 deletions.
707 changes: 355 additions & 352 deletions ASM/build/asm_symbols.txt

Large diffs are not rendered by default.

Binary file modified ASM/build/bundle.o
Binary file not shown.
298 changes: 150 additions & 148 deletions ASM/build/c_symbols.txt

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions ASM/c/item_draw_functions.c
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,7 @@ void draw_gi_shrink_keys(z64_game_t *game, uint32_t draw_id) {

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

colorRGBA8_t prim_color = item_draw_table[draw_id].args[2].color;
colorRGBA8_t env_color = item_draw_table[draw_id].args[3].color;

Expand Down
2 changes: 2 additions & 0 deletions ASM/c/item_draw_functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

#include "z64.h"

extern uint8_t CUSTOM_KEY_MODELS;

void draw_gi_bombchu_and_masks(z64_game_t *game, uint32_t draw_id);
void draw_gi_eggs_and_medallions(z64_game_t *game, uint32_t draw_id);
void draw_gi_sold_out(z64_game_t *game, uint32_t draw_id);
Expand Down
3 changes: 2 additions & 1 deletion ASM/c/item_draw_table.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ item_draw_table_entry_t item_draw_table[] = {
[0x06] = { draw_gi_song_notes, { 0x06000AE0, 0xC832FFFF, 0 } }, // Music Note (Purple)
[0x07] = { draw_gi_song_notes, { 0x06000AE0, 0xC8FF00FF, 0 } }, // Music Note (Yellow)
[0x08] = { draw_gi_recovery_heart, { 0x060000E0 } }, // Recovery Heart
[0x09] = { draw_gi_boss_keys, { 0x06000CA0, 0x06000F08, 0x6E7467FF, 0x262724FF, 0xFFFFFFFF, 0x8C7800FF } }, // Boss Key
[0x09] = { draw_gi_boss_keys, { 0x06000CA0, 0x06000F08, 0xFFAAFFFF, 0xFF0064FF, 0xFFFFFFFF, 0x8C7800FF, 0x6E7467FF, 0x262724FF } }, // Boss Key
[0x0A] = { draw_gi_compass, { 0x06000960, 0x06000C50 } }, // Compass
[0x0B] = { draw_gi_eggs_and_medallions, { 0x06000CB0, 0x06000E18 } }, // Forest Medallion
[0x0C] = { draw_gi_eggs_and_medallions, { 0x06001AF0, 0x06000E18 } }, // Fire Medallion
Expand Down Expand Up @@ -156,6 +156,7 @@ item_draw_table_entry_t item_draw_table[] = {
[0x8A] = { draw_gi_boss_altered, { 0x060008F0, 0x06001790, 0x4C9DEEFF, 0x077AEEFF, 0xFFFFFFFF, 0x8C7800FF } }, // Boss Key (Water)
[0x8B] = { draw_gi_boss_altflip, { 0x06000E30, 0x060016D0, 0xFACD8FFF, 0xF5B433FF, 0xFFFFFFFF, 0x8C7800FF } }, // Boss Key (Spirit)
[0x8C] = { draw_gi_boss_altered, { 0x06000490, 0x06001350, 0x9454ebFF, 0x7A18DDFF, 0xFFFFFFFF, 0x8C7800FF } }, // Boss Key (Shadow)
[0x8D] = { draw_gi_boss_keys, { 0x06000CA0, 0x06000F08, 0x6E7467FF, 0x262724FF, 0xFFFFFFFF, 0x8C7800FF } }, // Boss Key (Ganon)
};

void base_draw_gi_model(z64_game_t *game, uint32_t draw_id) {
Expand Down
54 changes: 36 additions & 18 deletions ASM/c/item_table.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ item_row_t item_table[] = {
[0x006E] = ITEM_ROW(0x53, GILDED_CHEST, 0x1C, -1, 0x005D, 0x0173, 0x67, no_upgrade, no_effect, -1, -1), // Blue Fire (Refill)
[0x006F] = ITEM_ROW(0x53, GILDED_CHEST, 0x20, -1, 0x0097, 0x0176, 0x6A, no_upgrade, no_effect, -1, -1), // Poe (Refill)
[0x0070] = ITEM_ROW(0x53, GILDED_CHEST, 0x1E, -1, 0x00F9, 0x0176, 0x70, no_upgrade, no_effect, -1, -1), // Big Poe (Refill)
[0x0071] = ITEM_ROW(0x53, SILVER_CHEST, 0x41, -1, 0x913E, 0x01A1, 0x88, no_upgrade, give_small_key, TCG_ID, -1), // Small Key (Chest Game)
[0x0071] = ITEM_ROW(0x53, SILVER_CHEST, 0x41, -1, 0x913E, 0x00AA, 0x02, upgrade_key_model, give_small_key, TCG_ID, -1), // Small Key (Chest Game)
[0x0072] = ITEM_ROW(0x4D, BROWN_CHEST, 0x84, -1, 0x00F4, 0x017F, 0x6D, no_upgrade, no_effect, -1, -1), // Green Rupee (Chest Game)
[0x0073] = ITEM_ROW(0x4D, BROWN_CHEST, 0x85, -1, 0x00F5, 0x017F, 0x6E, no_upgrade, no_effect, -1, -1), // Blue Rupee (Chest Game)
[0x0074] = ITEM_ROW(0x4D, BROWN_CHEST, 0x86, -1, 0x00F6, 0x017F, 0x6F, no_upgrade, no_effect, -1, -1), // Red Rupee (Chest Game)
Expand Down Expand Up @@ -176,12 +176,12 @@ item_row_t item_table[] = {
[0x0093] = ITEM_ROW(0x53, GILDED_CHEST, 0x41, -1, 0x00F9, 0x0176, 0x70, no_upgrade, give_bottle, 0x1E, -1), // Bottle with Big Poe
[0x0094] = ITEM_ROW(0x53, GILDED_CHEST, 0x41, -1, 0x0097, 0x0176, 0x6A, no_upgrade, give_bottle, 0x20, -1), // Bottle with Poe

[0x0095] = ITEM_ROW(0x53, GOLD_CHEST, 0x41, -1, 0x0006, 0x01A2, 0x89, no_upgrade, give_dungeon_item, 0x01, FOREST_ID ), // Forest Temple Boss Key
[0x0096] = ITEM_ROW(0x53, GOLD_CHEST, 0x41, -1, 0x001C, 0x01A3, 0x8A, no_upgrade, give_dungeon_item, 0x01, FIRE_ID ), // Fire Temple Boss Key
[0x0097] = ITEM_ROW(0x53, GOLD_CHEST, 0x41, -1, 0x001D, 0x01A4, 0x8B, no_upgrade, give_dungeon_item, 0x01, WATER_ID ), // Water Temple Boss Key
[0x0098] = ITEM_ROW(0x53, GOLD_CHEST, 0x41, -1, 0x001E, 0x01A5, 0x8C, no_upgrade, give_dungeon_item, 0x01, SPIRIT_ID ), // Spirit Temple Boss Key
[0x0099] = ITEM_ROW(0x53, GOLD_CHEST, 0x41, -1, 0x002A, 0x01A6, 0x8D, no_upgrade, give_dungeon_item, 0x01, SHADOW_ID ), // Shadow Temple Boss Key
[0x009A] = ITEM_ROW(0x53, GOLD_CHEST, 0x41, -1, 0x0061, 0x00B9, 0x0A, no_upgrade, give_dungeon_item, 0x01, TOWER_ID ), // Ganon's Castle Boss Key
[0x0095] = ITEM_ROW(0x53, GOLD_CHEST, 0x41, -1, 0x0006, 0x00B9, 0x0A, upgrade_key_model, give_dungeon_item, 0x01, FOREST_ID ), // Forest Temple Boss Key
[0x0096] = ITEM_ROW(0x53, GOLD_CHEST, 0x41, -1, 0x001C, 0x00B9, 0x0A, upgrade_key_model, give_dungeon_item, 0x01, FIRE_ID ), // Fire Temple Boss Key
[0x0097] = ITEM_ROW(0x53, GOLD_CHEST, 0x41, -1, 0x001D, 0x00B9, 0x0A, upgrade_key_model, give_dungeon_item, 0x01, WATER_ID ), // Water Temple Boss Key
[0x0098] = ITEM_ROW(0x53, GOLD_CHEST, 0x41, -1, 0x001E, 0x00B9, 0x0A, upgrade_key_model, give_dungeon_item, 0x01, SPIRIT_ID ), // Spirit Temple Boss Key
[0x0099] = ITEM_ROW(0x53, GOLD_CHEST, 0x41, -1, 0x002A, 0x00B9, 0x0A, upgrade_key_model, give_dungeon_item, 0x01, SHADOW_ID ), // Shadow Temple Boss Key
[0x009A] = ITEM_ROW(0x53, GOLD_CHEST, 0x41, -1, 0x0061, 0x00B9, 0x0A, upgrade_key_model, give_dungeon_item, 0x01, TOWER_ID ), // Ganon's Castle Boss Key

[0x009B] = ITEM_ROW(0x53, BROWN_CHEST, 0x41, -1, 0x0062, 0x00B8, 0x0B, no_upgrade, give_dungeon_item, 0x02, DEKU_ID ), // Deku Tree Compass
[0x009C] = ITEM_ROW(0x53, BROWN_CHEST, 0x41, -1, 0x0063, 0x00B8, 0x0B, no_upgrade, give_dungeon_item, 0x02, DODONGO_ID), // Dodongo's Cavern Compass
Expand All @@ -205,15 +205,15 @@ item_row_t item_table[] = {
[0x00AD] = ITEM_ROW(0x53, BROWN_CHEST, 0x41, -1, 0x00A5, 0x00C8, 0x1C, no_upgrade, give_dungeon_item, 0x04, BOTW_ID ), // Bottom of the Well Map
[0x00AE] = ITEM_ROW(0x53, BROWN_CHEST, 0x41, -1, 0x0092, 0x00C8, 0x1C, no_upgrade, give_dungeon_item, 0x04, ICE_ID ), // Ice Cavern Map

[0x00AF] = ITEM_ROW(0x53, SILVER_CHEST, 0x41, -1, 0x9101, 0x0198, 0x7F, no_upgrade, give_small_key, FOREST_ID, -1), // Forest Temple Small Key
[0x00B0] = ITEM_ROW(0x53, SILVER_CHEST, 0x41, -1, 0x9108, 0x0199, 0x80, no_upgrade, give_small_key, FIRE_ID, -1), // Fire Temple Small Key
[0x00B1] = ITEM_ROW(0x53, SILVER_CHEST, 0x41, -1, 0x9111, 0x019A, 0x81, no_upgrade, give_small_key, WATER_ID, -1), // Water Temple Small Key
[0x00B2] = ITEM_ROW(0x53, SILVER_CHEST, 0x41, -1, 0x9118, 0x019B, 0x82, no_upgrade, give_small_key, SPIRIT_ID, -1), // Spirit Temple Small Key
[0x00B3] = ITEM_ROW(0x53, SILVER_CHEST, 0x41, -1, 0x9120, 0x019C, 0x83, no_upgrade, give_small_key, SHADOW_ID, -1), // Shadow Temple Small Key
[0x00B4] = ITEM_ROW(0x53, SILVER_CHEST, 0x41, -1, 0x9127, 0x019D, 0x84, no_upgrade, give_small_key, BOTW_ID, -1), // Bottom of the Well Small Key
[0x00B5] = ITEM_ROW(0x53, SILVER_CHEST, 0x41, -1, 0x912B, 0x019E, 0x85, no_upgrade, give_small_key, GTG_ID, -1), // Gerudo Training Small Key
[0x00B6] = ITEM_ROW(0x53, SILVER_CHEST, 0x41, -1, 0x9135, 0x019F, 0x86, no_upgrade, give_small_key, FORT_ID, -1), // Thieves' Hideout Small Key
[0x00B7] = ITEM_ROW(0x53, SILVER_CHEST, 0x41, -1, 0x913A, 0x01A0, 0x87, no_upgrade, give_small_key, CASTLE_ID, -1), // Ganon's Castle Small Key
[0x00AF] = ITEM_ROW(0x53, SILVER_CHEST, 0x41, -1, 0x9101, 0x00AA, 0x02, upgrade_key_model, give_small_key, FOREST_ID, -1), // Forest Temple Small Key
[0x00B0] = ITEM_ROW(0x53, SILVER_CHEST, 0x41, -1, 0x9108, 0x00AA, 0x02, upgrade_key_model, give_small_key, FIRE_ID, -1), // Fire Temple Small Key
[0x00B1] = ITEM_ROW(0x53, SILVER_CHEST, 0x41, -1, 0x9111, 0x00AA, 0x02, upgrade_key_model, give_small_key, WATER_ID, -1), // Water Temple Small Key
[0x00B2] = ITEM_ROW(0x53, SILVER_CHEST, 0x41, -1, 0x9118, 0x00AA, 0x02, upgrade_key_model, give_small_key, SPIRIT_ID, -1), // Spirit Temple Small Key
[0x00B3] = ITEM_ROW(0x53, SILVER_CHEST, 0x41, -1, 0x9120, 0x00AA, 0x02, upgrade_key_model, give_small_key, SHADOW_ID, -1), // Shadow Temple Small Key
[0x00B4] = ITEM_ROW(0x53, SILVER_CHEST, 0x41, -1, 0x9127, 0x00AA, 0x02, upgrade_key_model, give_small_key, BOTW_ID, -1), // Bottom of the Well Small Key
[0x00B5] = ITEM_ROW(0x53, SILVER_CHEST, 0x41, -1, 0x912B, 0x00AA, 0x02, upgrade_key_model, give_small_key, GTG_ID, -1), // Gerudo Training Small Key
[0x00B6] = ITEM_ROW(0x53, SILVER_CHEST, 0x41, -1, 0x9135, 0x00AA, 0x02, upgrade_key_model, give_small_key, FORT_ID, -1), // Gerudo Fortress Small Key
[0x00B7] = ITEM_ROW(0x53, SILVER_CHEST, 0x41, -1, 0x913A, 0x00AA, 0x02, upgrade_key_model, give_small_key, CASTLE_ID, -1), // Ganon's Castle Small Key

[0x00B8] = ITEM_ROW(0x53, GILDED_CHEST, 0x41, -1, 0x00E9, 0x0194, 0x13, no_upgrade, give_defense, -1, -1), // Double Defense
[0x00B9] = ITEM_ROW(0x53, GILDED_CHEST, 0x41, -1, 0x00E4, 0x00CD, 0x1E, no_upgrade, give_magic, -1, -1), // Magic Meter
Expand Down Expand Up @@ -252,7 +252,25 @@ item_row_t item_table[] = {
[0x00D5] = ITEM_ROW(0x53, GILDED_CHEST, 0x41, -1, 0x9019, 0x0197, 0x7E, no_upgrade, give_bombchus, 10, -1), // Bombchu Bag (10)
[0x00D6] = ITEM_ROW(0x53, GILDED_CHEST, 0x41, -1, 0x9019, 0x0197, 0x7E, no_upgrade, give_bombchus, 5, -1), // Bombchu Bag (5)

[0x00D7] = ITEM_ROW(0x53, SILVER_CHEST, 0x41, -1, 0x901E, 0x0195, 0x77, no_upgrade, give_small_key_ring, TCG_ID, -1), // Treasure Chest Game Small Key Ring
[0x00D7] = ITEM_ROW(0x53, SILVER_CHEST, 0x41, -1, 0x9200, 0x0195, 0x77, no_upgrade, give_small_key_ring, TCG_ID, -1), // Treasure Chest Game Small Key Ring

// Custom Key Models
[0x0109] = ITEM_ROW(0x53, GOLD_CHEST, 0x41, -1, 0x0006, 0x01A2, 0x89, no_upgrade, give_dungeon_item, 0x01, FOREST_ID ), // Forest Temple Boss Key
[0x010A] = ITEM_ROW(0x53, GOLD_CHEST, 0x41, -1, 0x001C, 0x01A3, 0x8A, no_upgrade, give_dungeon_item, 0x01, FIRE_ID ), // Fire Temple Boss Key
[0x010B] = ITEM_ROW(0x53, GOLD_CHEST, 0x41, -1, 0x001D, 0x01A4, 0x8B, no_upgrade, give_dungeon_item, 0x01, WATER_ID ), // Water Temple Boss Key
[0x010C] = ITEM_ROW(0x53, GOLD_CHEST, 0x41, -1, 0x001E, 0x01A5, 0x8C, no_upgrade, give_dungeon_item, 0x01, SPIRIT_ID ), // Spirit Temple Boss Key
[0x010D] = ITEM_ROW(0x53, GOLD_CHEST, 0x41, -1, 0x002A, 0x01A6, 0x8D, no_upgrade, give_dungeon_item, 0x01, SHADOW_ID ), // Shadow Temple Boss Key
[0x010E] = ITEM_ROW(0x53, GOLD_CHEST, 0x41, -1, 0x0061, 0x00B9, 0x8E, no_upgrade, give_dungeon_item, 0x01, TOWER_ID ), // Ganon's Castle Boss Key
[0x010F] = ITEM_ROW(0x53, SILVER_CHEST, 0x41, -1, 0x9101, 0x0198, 0x7F, no_upgrade, give_small_key, FOREST_ID, -1), // Forest Temple Small Key
[0x0110] = ITEM_ROW(0x53, SILVER_CHEST, 0x41, -1, 0x9108, 0x0199, 0x80, no_upgrade, give_small_key, FIRE_ID, -1), // Fire Temple Small Key
[0x0111] = ITEM_ROW(0x53, SILVER_CHEST, 0x41, -1, 0x9111, 0x019A, 0x81, no_upgrade, give_small_key, WATER_ID, -1), // Water Temple Small Key
[0x0112] = ITEM_ROW(0x53, SILVER_CHEST, 0x41, -1, 0x9118, 0x019B, 0x82, no_upgrade, give_small_key, SPIRIT_ID, -1), // Spirit Temple Small Key
[0x0113] = ITEM_ROW(0x53, SILVER_CHEST, 0x41, -1, 0x9120, 0x019C, 0x83, no_upgrade, give_small_key, SHADOW_ID, -1), // Shadow Temple Small Key
[0x0114] = ITEM_ROW(0x53, SILVER_CHEST, 0x41, -1, 0x9127, 0x019D, 0x84, no_upgrade, give_small_key, BOTW_ID, -1), // Bottom of the Well Small Key
[0x0115] = ITEM_ROW(0x53, SILVER_CHEST, 0x41, -1, 0x912B, 0x019E, 0x85, no_upgrade, give_small_key, GTG_ID, -1), // Gerudo Training Small Key
[0x0116] = ITEM_ROW(0x53, SILVER_CHEST, 0x41, -1, 0x9135, 0x019F, 0x86, no_upgrade, give_small_key, FORT_ID, -1), // Thieves' Hideout Small Key
[0x0117] = ITEM_ROW(0x53, SILVER_CHEST, 0x41, -1, 0x913A, 0x01A0, 0x87, no_upgrade, give_small_key, CASTLE_ID, -1), // Ganon's Castle Small Key
[0x0118] = ITEM_ROW(0x53, SILVER_CHEST, 0x41, -1, 0x913E, 0x01A1, 0x88, no_upgrade, give_small_key, TCG_ID, -1), // Small Key (Chest Game)
};

item_row_t *get_item_row(uint16_t item_id) {
Expand All @@ -268,7 +286,7 @@ item_row_t *get_item_row(uint16_t item_id) {

uint16_t resolve_item_text_id(uint16_t item_id, bool is_outgoing) {
item_row_t *item_row = get_item_row(item_id);
if (((item_id >= 0xAF && item_id < 0xB8) || (SHUFFLE_CHEST_GAME && item_id == 0x71)) && !is_outgoing) {
if ((item_id >= 0xAF && item_id < 0xB8) || (item_id >= 0x10F && item_id < 0x118) || (SHUFFLE_CHEST_GAME && (item_id == 0x71 || item_id == 0x118)) && !is_outgoing) {
return item_row->text_id + (z64_file.scene_flags[item_row->effect_arg1].unk_00_ >> 0x10); // Dynamically select the text box based on key count
}
// Change message for key rings when they include boss keys
Expand Down
17 changes: 17 additions & 0 deletions ASM/c/item_upgrades.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,3 +149,20 @@ uint16_t bombchus_to_bag(z64_file_t *save, uint16_t item_id) {
return item_id;
}
}

uint16_t upgrade_key_model(z64_file_t *save, uint16_t item_id) {
if (CUSTOM_KEY_MODELS) {
if (item_id == 0x0071) {
// Treasure Chest Game Key
return 0x0118;
} else if (item_id < 0x00AF) {
// Boss Keys
return item_id + 0x74;
} else {
// Small Keys
return item_id + 0x60;
}
} else {
return item_id;
}
}
4 changes: 3 additions & 1 deletion ASM/c/item_upgrades.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

#include "z64.h"

extern uint8_t CUSTOM_KEY_MODELS;

uint16_t no_upgrade(z64_file_t *save, uint16_t item_id);
uint16_t hookshot_upgrade(z64_file_t *save, uint16_t item_id);
uint16_t strength_upgrade(z64_file_t *save, uint16_t item_id);
Expand All @@ -22,6 +24,6 @@ uint16_t seeds_to_rupee(z64_file_t *save, uint16_t item_id);
uint16_t letter_to_bottle(z64_file_t *save, uint16_t item_id);
uint16_t health_upgrade_cap(z64_file_t *save, uint16_t item_id);
uint16_t bombchus_to_bag(z64_file_t *save, uint16_t item_id);
uint16_t bowling_3rd_reward(z64_file_t *save, uint16_t item_id);
uint16_t upgrade_key_model(z64_file_t *save, uint16_t item_id);

#endif
2 changes: 2 additions & 0 deletions ASM/src/config.asm
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@ POTCRATE_TEXTURES_MATCH_CONTENTS:
.byte 0x00
KEYRING_BOSSKEY_CONDITION:
.byte 0x00
CUSTOM_KEY_MODELS:
.byte 0x00
.align 4

; These configuration values are given fixed addresses to aid auto-trackers.
Expand Down
35 changes: 20 additions & 15 deletions Patches.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,23 +54,28 @@ def patch_rom(spoiler:Spoiler, world:World, rom:Rom):
('object_gi_keyring', data_path('items/KeyRing.zobj'), 0x195), # Key Rings
('object_gi_warpsong', data_path('items/Note.zobj'), 0x196), # Inverted Music Note
('object_gi_chubag', data_path('items/ChuBag.zobj'), 0x197), # Bombchu Bag
('object_gi_skeyforest', data_path('items/SmallForest.zobj'), 0x198), # Small Key (Forest)
('object_gi_skeyfire', data_path('items/SmallFire.zobj'), 0x199), # Small Key (Fire)
('object_gi_skeywater', data_path('items/SmallWater.zobj'), 0x19A), # Small Key (Water)
('object_gi_skeyspirit', data_path('items/SmallSpirit.zobj'), 0x19B), # Small Key (Spirit)
('object_gi_skeyshadow', data_path('items/SmallShadow.zobj'), 0x19C), # Small Key (Shadow)
('object_gi_skeywell', data_path('items/SmallWell.zobj'), 0x19D), # Small Key (Well)
('object_gi_skeygtg', data_path('items/SmallGTG.zobj'), 0x19E), # Small Key (GTG)
('object_gi_skeythieves', data_path('items/SmallThieves.zobj'), 0x19F), # Small Key (Thieves)
('object_gi_skeyganon', data_path('items/SmallGanon.zobj'), 0x1A0), # Small Key (Ganon)
('object_gi_skeyTCG', data_path('items/SmallTCG.zobj'), 0x1A1), # Small Key (Chest Game)
('object_gi_bkforest', data_path('items/BossForest.zobj'), 0x1A2), # Boss Key (Forest)
('object_gi_bkfire', data_path('items/BossFire.zobj'), 0x1A3), # Boss Key (Fire)
('object_gi_bkwater', data_path('items/BossWater.zobj'), 0x1A4), # Boss Key (Water)
('object_gi_bkspirit', data_path('items/BossSpirit.zobj'), 0x1A5), # Boss Key (Spirit)
('object_gi_bkshadow', data_path('items/BossShadow.zobj'), 0x1A6), # Boss Key (Shadow)
]

if world.settings.key_appearance_match_dungeon:
rom.write_byte(rom.sym('CUSTOM_KEY_MODELS'), 0x01)
zobj_imports.extend([
('object_gi_skeyforest', data_path('items/SmallForest.zobj'), 0x198), # Small Key (Forest)
('object_gi_skeyfire', data_path('items/SmallFire.zobj'), 0x199), # Small Key (Fire)
('object_gi_skeywater', data_path('items/SmallWater.zobj'), 0x19A), # Small Key (Water)
('object_gi_skeyspirit', data_path('items/SmallSpirit.zobj'), 0x19B), # Small Key (Spirit)
('object_gi_skeyshadow', data_path('items/SmallShadow.zobj'), 0x19C), # Small Key (Shadow)
('object_gi_skeywell', data_path('items/SmallWell.zobj'), 0x19D), # Small Key (Well)
('object_gi_skeygtg', data_path('items/SmallGTG.zobj'), 0x19E), # Small Key (GTG)
('object_gi_skeythieves', data_path('items/SmallThieves.zobj'), 0x19F), # Small Key (Thieves)
('object_gi_skeyganon', data_path('items/SmallGanon.zobj'), 0x1A0), # Small Key (Ganon)
('object_gi_skeyTCG', data_path('items/SmallTCG.zobj'), 0x1A1), # Small Key (Chest Game)
('object_gi_bkforest', data_path('items/BossForest.zobj'), 0x1A2), # Boss Key (Forest)
('object_gi_bkfire', data_path('items/BossFire.zobj'), 0x1A3), # Boss Key (Fire)
('object_gi_bkwater', data_path('items/BossWater.zobj'), 0x1A4), # Boss Key (Water)
('object_gi_bkspirit', data_path('items/BossSpirit.zobj'), 0x1A5), # Boss Key (Spirit)
('object_gi_bkshadow', data_path('items/BossShadow.zobj'), 0x1A6), # Boss Key (Shadow)
])

extended_objects_start = start_address = rom.free_space()
for (name, zobj_path, object_id) in zobj_imports:
with open(zobj_path, 'rb') as stream:
Expand Down
9 changes: 9 additions & 0 deletions SettingsList.py
Original file line number Diff line number Diff line change
Expand Up @@ -4839,6 +4839,15 @@ def __init__(self, name, gui_text, min, max, default, step=1,
''',
shared = True,
),
Checkbutton(
name = 'key_appearance_match_dungeon',
gui_text = 'Key Appearance Matches Dungeon',
gui_tooltip = '''\
Small keys, key rings, and boss keys
will use custom models to match their dungeon.
''',
shared = True,
),
Checkbutton(
name = 'clearer_hints',
gui_text = 'Clearer Hints',
Expand Down
Loading

0 comments on commit 90ec367

Please sign in to comment.