Skip to content

Commit eb1f70d

Browse files
committed
Rework for mixed pools + map gives boss info
1 parent f6fe58b commit eb1f70d

11 files changed

Lines changed: 40757 additions & 26574 deletions

File tree

ASM/c/dungeon_info.c

Lines changed: 33 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -29,40 +29,6 @@ dungeon_entry_t dungeons[] = {
2929
{ 16, 1, 0, 0, 0, 0x00, "Chest Game",{-1, -1, -1, -1}, {-1, -1, -1, -1 }},
3030
};
3131

32-
dungeon_entrance_t dungeon_entrances[] = {
33-
{ 0, 1, "Deku"},
34-
{ 1, 1, "Dodongo"},
35-
{ 2, 1, "Jabu"},
36-
37-
{ 3, 1, "Forest"},
38-
{ 4, 1, "Fire"},
39-
{ 5, 1, "Water"},
40-
{ 7, 1, "Shadow"},
41-
{ 6, 1, "Spirit"},
42-
43-
{ 8, 1, "BotW"},
44-
{ 9, 1, "Ice"},
45-
{ 11, 0, "GTG"},
46-
{ 13, 0, "Ganon"}
47-
};
48-
49-
boss_entry_t bosses[] = {
50-
{ 0, 1, "Gohma"},
51-
{ 1, 1, "KD"},
52-
{ 2, 1, "Bari"},
53-
54-
{ 3, 1, "PG"},
55-
{ 4, 1, "Volv"},
56-
{ 5, 1, "Morpha"},
57-
{ 7, 1, "Bongo"},
58-
{ 6, 1, "Twin"},
59-
60-
{ 8, 1, "-"},
61-
{ 9, 1, "-"},
62-
{ 11, 0, "-"},
63-
{ 13, 0, "Ganon"}
64-
};
65-
6632
typedef struct {
6733
uint8_t idx;
6834
uint8_t r;
@@ -100,8 +66,9 @@ extern uint8_t CFG_DUNGEON_REWARD_WORLDS[9];
10066
extern uint8_t CFG_DUNGEON_INFO_SILVER_RUPEES;
10167

10268
extern int8_t CFG_DUNGEON_PRECOMPLETED[14];
103-
extern uint8_t CFG_DUNGEON_ENTRANCES[12];
104-
extern uint8_t CFG_BOSSES[12];
69+
extern char CFG_DUNGEON_BOSS_INFO[14];
70+
extern char CFG_DUNGEON_ENTRANCES[12][0x9];
71+
extern char CFG_BOSSES[12][0x9];
10572

10673
extern extended_savecontext_static_t extended_savectx;
10774
extern silver_rupee_data_t silver_rupee_vars[0x16][2];
@@ -207,19 +174,17 @@ void draw_boss_key(z64_game_t* globalCtx, z64_disp_buf_t* db) {
207174
}
208175

209176
void draw_world_info(z64_disp_buf_t* db) {
210-
show_dungeon_info = 0;
211-
pad_t pad_held = z64_ctxt.input[0].raw.pad;
212177
if (!CAN_DRAW_WORLD_INFO) {
213178
return;
214179
}
215-
// Since no dungeon can be duped, this means the setting is not enabled.
216-
bool show_dungeons = CFG_DUNGEON_ENTRANCES[0] != CFG_DUNGEON_ENTRANCES[1];
217-
// Same for bosses.
218-
bool show_bosses = CFG_BOSSES[0] != CFG_BOSSES[1];
180+
show_dungeon_info = 0;
181+
bool show_dungeons = CFG_DUNGEON_BOSS_INFO[0] > 0;
182+
bool show_bosses = CFG_DUNGEON_BOSS_INFO[1] > 0;
219183
// If neither setting is on, don't display this menu at all.
220184
if (!show_dungeons && !show_bosses) {
221185
return;
222186
}
187+
bool mixed = CFG_DUNGEON_BOSS_INFO[0] > 1 || CFG_DUNGEON_BOSS_INFO[0] > 1;
223188

224189
if (z64_ctxt.input[0].pad_pressed.a) {
225190
world_display = world_display ? false : true;
@@ -240,22 +205,22 @@ void draw_world_info(z64_disp_buf_t* db) {
240205
int padding = 1;
241206
int rows = 13;
242207
int boss_width = show_bosses ?
243-
((10 * font_width) + padding) :
208+
((8 * font_width) + padding) :
244209
0;
245210
int bg_width = show_dungeons ?
246-
13 * 2 * font_width + boss_width :
247-
13 * font_width + boss_width;
211+
10 * 2 * font_width + boss_width :
212+
10 * font_width + boss_width;
248213
int bg_height = (rows * font_height) + ((rows + 1) * padding);
249214
int bg_left = (Z64_SCREEN_WIDTH - bg_width) / 2;
250215
int bg_top = (Z64_SCREEN_HEIGHT - bg_height) / 2;
251216

252-
int start_top = bg_top + padding;
217+
int start_top = bg_top + padding + 1;
253218
uint16_t left = bg_left + padding;
254219
uint16_t left_dungeon = 0;
255220
if (show_dungeons) {
256-
left_dungeon = left + 80;
221+
left_dungeon = left + 60;
257222
}
258-
uint16_t left_boss = show_dungeons ? left + 2*80 : left + 80;
223+
uint16_t left_boss = show_dungeons ? left + 2*60 : left + 60;
259224

260225
// Draw background
261226
gDPSetCombineMode(db->p++, G_CC_PRIMITIVE, G_CC_PRIMITIVE);
@@ -290,43 +255,45 @@ void draw_world_info(z64_disp_buf_t* db) {
290255
}
291256
gDPSetPrimColor(db->p++, 0, 0, 0xFF, 0xFF, 0xFF, 0xFF);
292257
// Draw the list of dungeons entrances.
293-
for (int i = 0; i < rows - 1; i++) {
258+
uint16_t top = start_top;
259+
for (uint8_t i = 0; i < rows; i++) {
294260
gDPPipeSync(db->p++);
295-
dungeon_entrance_t* d = &(dungeon_entrances[i]);
296-
int top = start_top + ((font_height + padding) * (i + 1)) + 1;
297-
text_print_size(db, d->name, left, top, font_width, font_height);
261+
// Skip Hideout for this menu.
262+
if (i == 10) {
263+
continue;
264+
}
265+
dungeon_entry_t dungeon = dungeons[i];
266+
top += font_height + padding;
267+
text_print_size(db, dungeon.name, left, top, font_width, font_height);
298268
}
299269

300270
// Draw the list of dungeons interiors.
301271
if (show_dungeons) {
302-
for (int i = 0; i < rows - 1; i++) {
272+
for (uint8_t i = 0; i < rows - 1; i++) {
303273
gDPPipeSync(db->p++);
304-
dungeon_entrance_t* d = &(dungeon_entrances[CFG_DUNGEON_ENTRANCES[i]]);
305-
if (d->has_map && !z64_file.dungeon_items[d->index].map) {
274+
if (CFG_DUNGEON_BOSS_INFO[i + 2] < 10 && !z64_file.dungeon_items[CFG_DUNGEON_BOSS_INFO[i + 2]].map) {
306275
continue;
307276
}
308-
int top = start_top + ((font_height + padding) * (i + 1)) + 1;
309-
text_print_size(db, d->name, left_dungeon, top, font_width, font_height);
277+
uint16_t top = start_top + ((font_height + padding) * (i + 1)) + 1;
278+
text_print_size(db, CFG_DUNGEON_ENTRANCES[i], left_dungeon, top, font_width, font_height);
310279

311280
// If boss ER is also on, display the boss on the same line as the actual dungeon.
312281
if (show_bosses) {
313282
gDPPipeSync(db->p++);
314-
boss_entry_t* boss = &(bosses[CFG_BOSSES[CFG_DUNGEON_ENTRANCES[i]]]);
315-
int top = start_top + ((font_height + padding) * (i + 1)) + 1;
316-
text_print_size(db, boss->name, left_boss, top, font_width, font_height);
317-
}
283+
uint16_t top = start_top + ((font_height + padding) * (i + 1));
284+
text_print_size(db, CFG_BOSSES[i], left_boss, top, font_width, font_height);
285+
}
318286
}
319287
}
320288
else {
321289
if (show_bosses) {
322-
for (int i = 0; i < rows - 1; i++) {
290+
for (uint8_t i = 0; i < rows - 1; i++) {
323291
gDPPipeSync(db->p++);
324-
boss_entry_t* boss = &(bosses[CFG_BOSSES[i]]);
325-
if (boss->has_map && !z64_file.dungeon_items[boss->index].map) {
292+
if (CFG_DUNGEON_BOSS_INFO[i + 2] < 10 && !z64_file.dungeon_items[CFG_DUNGEON_BOSS_INFO[i + 2]].map) {
326293
continue;
327294
}
328-
int top = start_top + ((font_height + padding) * (i + 1)) + 1;
329-
text_print_size(db, boss->name, left_boss, top, font_width, font_height);
295+
uint16_t top = start_top + ((font_height + padding) * (i + 1));
296+
text_print_size(db, CFG_BOSSES[i], left_boss, top, font_width, font_height);
330297
}
331298
}
332299
}

ASM/c/dungeon_info.h

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,8 @@ typedef struct {
1818
uint8_t silver_rupee_puzzles_mq[4];
1919
} dungeon_entry_t;
2020

21-
typedef struct {
22-
uint8_t index;
23-
uint8_t has_map;
24-
char name[10];
25-
} dungeon_entrance_t;
26-
27-
typedef struct {
28-
uint8_t index;
29-
uint8_t has_map;
30-
char name[10];
31-
} boss_entry_t;
32-
3321
extern int dungeon_count;
3422
extern dungeon_entry_t dungeons[14];
35-
extern dungeon_entrance_t dungeon_entrances[12];
36-
extern boss_entry_t bosses[12];
3723

3824
void draw_dungeon_info(z64_disp_buf_t* db);
3925
void draw_world_info(z64_disp_buf_t* db);

ASM/c/gfx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ extern uint8_t FONT_RESOURCE[];
88
extern uint8_t DPAD_RESOURCE[];
99
extern uint8_t TRIFORCE_SPRITE_RESOURCE[];
1010

11-
#define RANDO_OVERLAY_DB_SIZE 0xA00 // Size of overlay display buffer, in GFX commands which are 8 bytes
11+
#define RANDO_OVERLAY_DB_SIZE 0x1000 // Size of overlay display buffer, in GFX commands which are 8 bytes
1212

1313
z64_disp_buf_t rando_overlay_db __attribute__ ((aligned (16)));
1414
#if DEBUG_MODE

ASM/src/config.asm

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,10 +333,16 @@ CFG_ADULT_TRADE_SHUFFLE:
333333
CFG_CHILD_TRADE_SHUFFLE:
334334
.byte 0x00
335335

336-
.area 0xC, 0x00
336+
.area 14, 0x00
337+
CFG_DUNGEON_BOSS_INFO:
338+
.endarea
339+
; First two bytes determine if dungeons and bosses are shuffled or mixed (0 : not shuffled, 1 : shuffled in their pool, 2 : mixed)
340+
; Next 12 bytes say if the dungeon in the i-th entrance has a map
341+
342+
.area 12 * 0x9, 0x00
337343
CFG_DUNGEON_ENTRANCES:
338344
.endarea
339-
.area 0xC, 0x00
345+
.area 12 * 0x9, 0x00
340346
CFG_BOSSES:
341347
.endarea
342348

Hints.py

Lines changed: 43 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -377,46 +377,46 @@ class HintAreaNotFound(RuntimeError):
377377

378378

379379
class HintArea(Enum):
380-
# internal name prepositions display name short name color internal dungeon name
380+
# internal name prepositions display name short name color internal dungeon name shorter name
381381
# vague clear
382-
ROOT = 'in', 'in', "Link's pocket", 'Free', 'White', None
383-
HYRULE_FIELD = 'in', 'in', 'Hyrule Field', 'Hyrule Field', 'Light Blue', None
384-
LON_LON_RANCH = 'at', 'at', 'Lon Lon Ranch', 'Lon Lon Ranch', 'Light Blue', None
385-
MARKET = 'in', 'in', 'the Market', 'Market', 'Light Blue', None
386-
TEMPLE_OF_TIME = 'inside', 'inside', 'the Temple of Time', 'Temple of Time', 'Light Blue', None
387-
CASTLE_GROUNDS = 'on', 'on', 'the Castle Grounds', None, 'Light Blue', None # required for warp songs
388-
HYRULE_CASTLE = 'at', 'at', 'Hyrule Castle', 'Hyrule Castle', 'Light Blue', None
389-
OUTSIDE_GANONS_CASTLE = None, None, "outside Ganon's Castle", "Outside Ganon's Castle", 'Light Blue', None
390-
INSIDE_GANONS_CASTLE = 'inside', None, "inside Ganon's Castle", "Inside Ganon's Castle", 'Light Blue', 'Ganons Castle'
391-
GANONDORFS_CHAMBER = 'in', 'in', "Ganondorf's Chamber", "Ganondorf's Chamber", 'Light Blue', None
392-
KOKIRI_FOREST = 'in', 'in', 'Kokiri Forest', "Kokiri Forest", 'Green', None
393-
DEKU_TREE = 'inside', 'inside', 'the Deku Tree', "Deku Tree", 'Green', 'Deku Tree'
394-
LOST_WOODS = 'in', 'in', 'the Lost Woods', "Lost Woods", 'Green', None
395-
SACRED_FOREST_MEADOW = 'at', 'at', 'the Sacred Forest Meadow', "Sacred Forest Meadow", 'Green', None
396-
FOREST_TEMPLE = 'in', 'in', 'the Forest Temple', "Forest Temple", 'Green', 'Forest Temple'
397-
DEATH_MOUNTAIN_TRAIL = 'on', 'on', 'the Death Mountain Trail', "Death Mountain Trail", 'Red', None
398-
DODONGOS_CAVERN = 'within', 'in', "Dodongo's Cavern", "Dodongo's Cavern", 'Red', 'Dodongos Cavern'
399-
GORON_CITY = 'in', 'in', 'Goron City', "Goron City", 'Red', None
400-
DEATH_MOUNTAIN_CRATER = 'in', 'in', 'the Death Mountain Crater', "Death Mountain Crater", 'Red', None
401-
FIRE_TEMPLE = 'on', 'in', 'the Fire Temple', "Fire Temple", 'Red', 'Fire Temple'
402-
ZORA_RIVER = 'at', 'at', "Zora's River", "Zora's River", 'Blue', None
403-
ZORAS_DOMAIN = 'at', 'at', "Zora's Domain", "Zora's Domain", 'Blue', None
404-
ZORAS_FOUNTAIN = 'at', 'at', "Zora's Fountain", "Zora's Fountain", 'Blue', None
405-
JABU_JABUS_BELLY = 'in', 'inside', "Jabu Jabu's Belly", "Jabu Jabu's Belly", 'Blue', 'Jabu Jabus Belly'
406-
ICE_CAVERN = 'inside', 'in' , 'the Ice Cavern', "Ice Cavern", 'Blue', 'Ice Cavern'
407-
LAKE_HYLIA = 'at', 'at', 'Lake Hylia', "Lake Hylia", 'Blue', None
408-
WATER_TEMPLE = 'under', 'in', 'the Water Temple', "Water Temple", 'Blue', 'Water Temple'
409-
KAKARIKO_VILLAGE = 'in', 'in', 'Kakariko Village', "Kakariko Village", 'Pink', None
410-
BOTTOM_OF_THE_WELL = 'within', 'at', 'the Bottom of the Well', "Bottom of the Well", 'Pink', 'Bottom of the Well'
411-
GRAVEYARD = 'in', 'in', 'the Graveyard', "Graveyard", 'Pink', None
412-
SHADOW_TEMPLE = 'within', 'in', 'the Shadow Temple', "Shadow Temple", 'Pink', 'Shadow Temple'
413-
GERUDO_VALLEY = 'at', 'at', 'Gerudo Valley', "Gerudo Valley", 'Yellow', None
414-
GERUDO_FORTRESS = 'at', 'at', "Gerudo's Fortress", "Gerudo's Fortress", 'Yellow', None
415-
THIEVES_HIDEOUT = 'in', 'in', "the Thieves' Hideout", "Thieves' Hideout", 'Yellow', None
416-
GERUDO_TRAINING_GROUND = 'within', 'on', 'the Gerudo Training Ground', "Gerudo Training Ground", 'Yellow', 'Gerudo Training Ground'
417-
HAUNTED_WASTELAND = 'in', 'in', 'the Haunted Wasteland', "Haunted Wasteland", 'Yellow', None
418-
DESERT_COLOSSUS = 'at', 'at', 'the Desert Colossus', "Desert Colossus", 'Yellow', None
419-
SPIRIT_TEMPLE = 'inside', 'in', 'the Spirit Temple', "Spirit Temple", 'Yellow', 'Spirit Temple'
382+
ROOT = 'in', 'in', "Link's pocket", 'Free', 'White', None, None
383+
HYRULE_FIELD = 'in', 'in', 'Hyrule Field', 'Hyrule Field', 'Light Blue', None, None
384+
LON_LON_RANCH = 'at', 'at', 'Lon Lon Ranch', 'Lon Lon Ranch', 'Light Blue', None, None
385+
MARKET = 'in', 'in', 'the Market', 'Market', 'Light Blue', None, None
386+
TEMPLE_OF_TIME = 'inside', 'inside', 'the Temple of Time', 'Temple of Time', 'Light Blue', None, None
387+
CASTLE_GROUNDS = 'on', 'on', 'the Castle Grounds', None, 'Light Blue', None, None # required for warp songs,
388+
HYRULE_CASTLE = 'at', 'at', 'Hyrule Castle', 'Hyrule Castle', 'Light Blue', None, None
389+
OUTSIDE_GANONS_CASTLE = None, None, "outside Ganon's Castle", "Outside Ganon's Castle", 'Light Blue', None, None
390+
INSIDE_GANONS_CASTLE = 'inside', None, "inside Ganon's Castle", "Inside Ganon's Castle", 'Light Blue', 'Ganons Castle', 'Ganon'
391+
GANONDORFS_CHAMBER = 'in', 'in', "Ganondorf's Chamber", "Ganondorf's Chamber", 'Light Blue', None, None
392+
KOKIRI_FOREST = 'in', 'in', 'Kokiri Forest', "Kokiri Forest", 'Green', None, None
393+
DEKU_TREE = 'inside', 'inside', 'the Deku Tree', "Deku Tree", 'Green', 'Deku Tree', 'Deku'
394+
LOST_WOODS = 'in', 'in', 'the Lost Woods', "Lost Woods", 'Green', None, None
395+
SACRED_FOREST_MEADOW = 'at', 'at', 'the Sacred Forest Meadow', "Sacred Forest Meadow", 'Green', None, None
396+
FOREST_TEMPLE = 'in', 'in', 'the Forest Temple', "Forest Temple", 'Green', 'Forest Temple', 'Forest'
397+
DEATH_MOUNTAIN_TRAIL = 'on', 'on', 'the Death Mountain Trail', "Death Mountain Trail", 'Red', None, None
398+
DODONGOS_CAVERN = 'within', 'in', "Dodongo's Cavern", "Dodongo's Cavern", 'Red', 'Dodongos Cavern', 'DC'
399+
GORON_CITY = 'in', 'in', 'Goron City', "Goron City", 'Red', None, None
400+
DEATH_MOUNTAIN_CRATER = 'in', 'in', 'the Death Mountain Crater', "Death Mountain Crater", 'Red', None, None
401+
FIRE_TEMPLE = 'on', 'in', 'the Fire Temple', "Fire Temple", 'Red', 'Fire Temple', 'Fire'
402+
ZORA_RIVER = 'at', 'at', "Zora's River", "Zora's River", 'Blue', None, None
403+
ZORAS_DOMAIN = 'at', 'at', "Zora's Domain", "Zora's Domain", 'Blue', None, None
404+
ZORAS_FOUNTAIN = 'at', 'at', "Zora's Fountain", "Zora's Fountain", 'Blue', None, None
405+
JABU_JABUS_BELLY = 'in', 'inside', "Jabu Jabu's Belly", "Jabu Jabu's Belly", 'Blue', 'Jabu Jabus Belly', 'Jabu'
406+
ICE_CAVERN = 'inside', 'in' , 'the Ice Cavern', "Ice Cavern", 'Blue', 'Ice Cavern', 'Ice'
407+
LAKE_HYLIA = 'at', 'at', 'Lake Hylia', "Lake Hylia", 'Blue', None, None
408+
WATER_TEMPLE = 'under', 'in', 'the Water Temple', "Water Temple", 'Blue', 'Water Temple', 'Water'
409+
KAKARIKO_VILLAGE = 'in', 'in', 'Kakariko Village', "Kakariko Village", 'Pink', None, None
410+
BOTTOM_OF_THE_WELL = 'within', 'at', 'the Bottom of the Well', "Bottom of the Well", 'Pink', 'Bottom of the Well', 'BotW'
411+
GRAVEYARD = 'in', 'in', 'the Graveyard', "Graveyard", 'Pink', None, None
412+
SHADOW_TEMPLE = 'within', 'in', 'the Shadow Temple', "Shadow Temple", 'Pink', 'Shadow Temple', 'Shadow'
413+
GERUDO_VALLEY = 'at', 'at', 'Gerudo Valley', "Gerudo Valley", 'Yellow', None, None
414+
GERUDO_FORTRESS = 'at', 'at', "Gerudo's Fortress", "Gerudo's Fortress", 'Yellow', None, None
415+
THIEVES_HIDEOUT = 'in', 'in', "the Thieves' Hideout", "Thieves' Hideout", 'Yellow', None, None
416+
GERUDO_TRAINING_GROUND = 'within', 'on', 'the Gerudo Training Ground', "Gerudo Training Ground", 'Yellow', 'Gerudo Training Ground', 'GTG'
417+
HAUNTED_WASTELAND = 'in', 'in', 'the Haunted Wasteland', "Haunted Wasteland", 'Yellow', None, None
418+
DESERT_COLOSSUS = 'at', 'at', 'the Desert Colossus', "Desert Colossus", 'Yellow', None, None
419+
SPIRIT_TEMPLE = 'inside', 'in', 'the Spirit Temple', "Spirit Temple", 'Yellow', 'Spirit Temple', 'Spirit'
420420

421421
# Performs a breadth first search to find the closest hint area from a given spot (region, location, or entrance).
422422
# May fail to find a hint if the given spot is only accessible from the root and not from any other region with a hint area
@@ -497,6 +497,10 @@ def color(self) -> str:
497497
def dungeon_name(self) -> Optional[str]:
498498
return self.value[5]
499499

500+
@property
501+
def shorter_name(self) -> Optional[str]:
502+
return self.value[6]
503+
500504
@property
501505
def is_dungeon(self) -> bool:
502506
return self.dungeon_name is not None

0 commit comments

Comments
 (0)