Skip to content

Commit

Permalink
Merge 'Cross out pre-completed dungeons in dungeon info menu' (#2244)
Browse files Browse the repository at this point in the history
  • Loading branch information
fenhl committed Sep 4, 2024
2 parents 87019a9 + cfe0c37 commit a93636d
Show file tree
Hide file tree
Showing 10 changed files with 38,795 additions and 38,519 deletions.
2,802 changes: 1,402 additions & 1,400 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,237 changes: 619 additions & 618 deletions ASM/build/c_symbols.txt

Large diffs are not rendered by default.

47 changes: 41 additions & 6 deletions ASM/c/dungeon_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ extern uint8_t CFG_DUNGEON_REWARD_WORLDS[9];

extern uint8_t CFG_DUNGEON_INFO_SILVER_RUPEES;

extern int8_t CFG_DUNGEON_PRECOMPLETED[14];

extern extended_savecontext_static_t extended_savectx;
extern silver_rupee_data_t silver_rupee_vars[0x16][2];

Expand Down Expand Up @@ -217,7 +219,7 @@ void draw_dungeon_info(z64_disp_buf_t* db) {
int bg_left = (Z64_SCREEN_WIDTH - bg_width) / 2;
int bg_top = (Z64_SCREEN_HEIGHT - bg_height) / 2;

int left = bg_left + padding;
uint16_t left = bg_left + padding;
int start_top = bg_top + padding;

// Draw background
Expand Down Expand Up @@ -293,12 +295,29 @@ void draw_dungeon_info(z64_disp_buf_t* db) {

left += icon_size + padding;

// Draw dungeon names

// Draw the list of dungeons.
// Pre completed dungeons are grayed and crossed out.
for (int i = 0; i < rows; i++) {
gDPPipeSync(db->p++);
dungeon_entry_t* d = &(dungeons[i]);
bool empty = CFG_DUNGEON_PRECOMPLETED[d->index];
int top = start_top + ((icon_size + padding) * i) + 1;
text_print_size(db, d->name, left, top, font_width, font_height);
if (empty) {
gDPSetPrimColor(db->p++, 0, 0, 0xFF, 0xFF, 0xFF, 0x7F);
uint16_t sizeRectangle = text_print_size(db, d->name, left, top, font_width, font_height) - left;
gDPSetPrimColor(db->p++, 0, 0, 0xFF, 0xFF, 0xFF, 0xBF);
gDPSetCombineMode(db->p++, G_CC_PRIMITIVE, G_CC_PRIMITIVE);
gSPTextureRectangle(db->p++,
left * 4, (top + 5) * 4,
(left + sizeRectangle) * 4, ((top + 5) + 1) * 4,
0,
0, 0,
1024, 1024);
gDPSetCombineMode(db->p++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM);
} else {
gDPSetPrimColor(db->p++, 0, 0, 0xFF, 0xFF, 0xFF, 0xFF);
text_print_size(db, d->name, left, top, font_width, font_height);
}
}

left += ((SHUFFLE_CHEST_GAME == 1 ? 11 : 8) * font_width) + padding;
Expand Down Expand Up @@ -829,20 +848,36 @@ void draw_dungeon_info(z64_disp_buf_t* db) {
int start_top = bg_top + padding;

draw_background(db, bg_left, bg_top, bg_width, bg_height);
gDPSetPrimColor(db->p++, 0, 0, 0xFF, 0xFF, 0xFF, 0xFF);

// Draw dungeon names

for (int i = 0; i < 12; i++) {
dungeon_entry_t* d = &(dungeons[i + (i > 9 ? 1 : 0)]); // skip Hideout
bool empty = CFG_DUNGEON_PRECOMPLETED[d->index];
int top = start_top + ((icon_size + padding) * i) + 1;
text_print(db, d->name, left, top);
if (empty) {
gDPSetPrimColor(db->p++, 0, 0, 0xFF, 0xFF, 0xFF, 0x7F);
uint16_t sizeRectangle = text_print(db, d->name, left, top) - left;
gDPSetPrimColor(db->p++, 0, 0, 0xFF, 0xFF, 0xFF, 0xBF);
gDPSetCombineMode(db->p++, G_CC_PRIMITIVE, G_CC_PRIMITIVE);
gSPTextureRectangle(db->p++,
left * 4, (top + 6) * 4,
(left + sizeRectangle) * 4, (top + 6 + 2) * 4,
0,
0, 0,
1024, 1024);
gDPSetCombineMode(db->p++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM);
} else {
gDPSetPrimColor(db->p++, 0, 0, 0xFF, 0xFF, 0xFF, 0xFF);
text_print(db, d->name, left, top);
}
}

left += (8 * font_sprite.tile_w) + padding;

// Draw maps and compasses

gDPSetPrimColor(db->p++, 0, 0, 0xFF, 0xFF, 0xFF, 0xFF);
if (show_map_compass) {
// Draw maps

Expand Down
3 changes: 3 additions & 0 deletions ASM/src/config.asm
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,9 @@ PASSWORD:
.endarea
REWARDS_AS_ITEMS:
.byte 0x00
.area 14, 0x00
CFG_DUNGEON_PRECOMPLETED:
.endarea
.align 4

; These configuration values are given fixed addresses to aid auto-trackers.
Expand Down
2 changes: 2 additions & 0 deletions Patches.py
Original file line number Diff line number Diff line change
Expand Up @@ -2790,6 +2790,7 @@ def configure_dungeon_info(rom: Rom, world: World) -> None:
dungeon_rewards[codes.index(area.dungeon_name)] = boss_reward_index(location.item)

dungeon_is_mq = [1 if world.dungeon_mq.get(c) else 0 for c in codes]
dungeon_precompleted = [1 if world.empty_dungeons[c].empty else 0 for c in codes]

rom.write_int32(rom.sym('CFG_DUNGEON_INFO_ENABLE'), 2)
rom.write_int32(rom.sym('CFG_DUNGEON_INFO_MQ_ENABLE'), int(mq_enable))
Expand All @@ -2803,6 +2804,7 @@ def configure_dungeon_info(rom: Rom, world: World) -> None:
rom.write_bytes(rom.sym('CFG_DUNGEON_REWARD_AREAS'), dungeon_reward_areas)
rom.write_byte(rom.sym('CFG_DUNGEON_INFO_REWARD_WORLDS_ENABLE'), int(world.settings.world_count > 1 and world.settings.shuffle_dungeon_rewards in ('regional', 'overworld', 'any_dungeon', 'anywhere')))
rom.write_bytes(rom.sym('CFG_DUNGEON_REWARD_WORLDS'), dungeon_reward_worlds)
rom.write_bytes(rom.sym('CFG_DUNGEON_PRECOMPLETED'), dungeon_precompleted)


# Overwrite an actor in rom w/ the actor data from LocationList
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ issue. You should always Hard Reset to avoid this issue entirely.
* Fairy pots are now included in `Shuffle Pots`.
* A message is shown the first time a seed with No Logic is generated, to warn the user that the seed may be unbeatable.
* New hint distribution field `excluded_goal_categories` to disable specific goal categories.
* Pre-completed dungeons are crossed out in the dungeon overview menus (A or D-left on the inventory screen).

#### Bug Fixes
* Goal hints can now hint items required to defeat Ganon even if they're not required for the rainbow bridge, Ganon's boss key, or the trials. These items will be hinted as being on the "path of the hero".
Expand Down
Loading

0 comments on commit a93636d

Please sign in to comment.