@@ -206,8 +206,13 @@ void draw_world_info(z64_disp_buf_t* db) {
206206
207207 if (!mixed ) {
208208
209- if (z64_ctxt .input [0 ].pad_pressed .dl ) {
209+ if (z64_ctxt .input [0 ].pad_pressed .dl && show_dungeons ) {
210210 world_display = world_display ? false : true;
211+ boss_display = false;
212+ }
213+ if (z64_ctxt .input [0 ].pad_pressed .dr && show_bosses ) {
214+ boss_display = boss_display ? false : true;
215+ world_display = false;
211216 }
212217
213218 if (world_display ) {
@@ -271,11 +276,11 @@ void draw_world_info(z64_disp_buf_t* db) {
271276 // Draw the list of dungeons entrances.
272277 uint16_t top = start_top ;
273278 for (uint8_t i = 0 ; i < rows ; i ++ ) {
274- gDPPipeSync (db -> p ++ );
275279 // Skip Hideout for this menu.
276280 if (i == 10 ) {
277281 continue ;
278282 }
283+ gDPPipeSync (db -> p ++ );
279284 dungeon_entry_t dungeon = dungeons [i ];
280285 top += font_height + padding ;
281286 text_print_size (db , dungeon .name , left , top , font_width , font_height );
@@ -284,32 +289,86 @@ void draw_world_info(z64_disp_buf_t* db) {
284289 // Draw the list of dungeons interiors.
285290 if (show_dungeons ) {
286291 for (uint8_t i = 0 ; i < rows - 1 ; i ++ ) {
287- gDPPipeSync (db -> p ++ );
288- if (CFG_DUNGEON_BOSS_INFO [i + 2 ] < 10 && !z64_file .dungeon_items [CFG_DUNGEON_BOSS_INFO [i + 2 ]].map ) {
289- continue ;
290- }
291292 uint16_t top = start_top + ((font_height + padding ) * (i + 1 )) + 1 ;
292- text_print_size (db , CFG_DUNGEON_ENTRANCES [i ], left_dungeon , top , font_width , font_height );
293-
294- // If boss ER is also on, display the boss on the same line as the actual dungeon.
295- if (show_bosses ) {
293+ if (CFG_DUNGEON_BOSS_INFO [i + 2 ] > 10 || z64_file .dungeon_items [CFG_DUNGEON_BOSS_INFO [i + 2 ]].map ) {
296294 gDPPipeSync (db -> p ++ );
297- uint16_t top = start_top + ((font_height + padding ) * (i + 1 ));
298- text_print_size (db , CFG_BOSSES [i ], left_boss , top , font_width , font_height );
295+ text_print_size (db , CFG_DUNGEON_ENTRANCES [i ], left_dungeon , top , font_width , font_height );
296+ // If boss ER is also on, display the boss on the same line as the actual dungeon.
297+ if (show_bosses ) {
298+ if (CFG_DUNGEON_BOSS_INFO [i + 2 ] > 10 || z64_file .dungeon_items [CFG_DUNGEON_BOSS_INFO [i + 2 ]].compass ) {
299+ gDPPipeSync (db -> p ++ );
300+ text_print_size (db , CFG_BOSSES [i ], left_boss , top , font_width , font_height );
301+ }
302+ }
299303 }
300304 }
301305 }
302- else {
303- if (show_bosses ) {
304- for (uint8_t i = 0 ; i < rows - 1 ; i ++ ) {
305- gDPPipeSync (db -> p ++ );
306- if (CFG_DUNGEON_BOSS_INFO [i + 2 ] < 10 && !z64_file .dungeon_items [CFG_DUNGEON_BOSS_INFO [i + 2 ]].map ) {
307- continue ;
308- }
309- uint16_t top = start_top + ((font_height + padding ) * (i + 1 ));
310- text_print_size (db , CFG_BOSSES [i ], left_boss , top , font_width , font_height );
311- }
306+ }
307+ if (boss_display ) {
308+ show_dungeon_info = 1 ;
309+
310+ // Set up dimensions
311+ int font_width = 6 ;
312+ int font_height = 11 ;
313+ int padding = 1 ;
314+ int rows = 10 ;
315+ int bg_width = 10 * 2 * font_width ;
316+ int bg_height = (rows * font_height ) + ((rows + 1 ) * padding );
317+ int bg_left = (Z64_SCREEN_WIDTH - bg_width ) / 2 ;
318+ int bg_top = (Z64_SCREEN_HEIGHT - bg_height ) / 2 ;
319+
320+ int start_top = bg_top + padding + 1 ;
321+ uint16_t left = bg_left + padding ;
322+ uint16_t left_area = left + 60 ;
323+
324+ // Draw background
325+ gDPSetCombineMode (db -> p ++ , G_CC_PRIMITIVE , G_CC_PRIMITIVE );
326+ for (int i = 0 ; i < rows ; i ++ ) {
327+ uint16_t line_top = bg_top + i * (font_height + padding ) + padding ;
328+ gDPPipeSync (db -> p ++ );
329+ if (i % 2 ) {
330+ gDPSetPrimColor (db -> p ++ , 0 , 0 , 0x00 , 0x00 , 0x00 , 0xD0 );
331+ }
332+ else {
333+ gDPSetPrimColor (db -> p ++ , 0 , 0 , 0x00 , 0x00 , 0x00 , 0xDA );
334+ }
335+ gSPTextureRectangle (db -> p ++ ,
336+ bg_left <<2 , line_top <<2 ,
337+ (bg_left + bg_width )<<2 , (line_top + font_height + padding )<<2 ,
338+ 0 ,
339+ 0 , 0 ,
340+ 1 <<10 , 1 <<10 );
341+ }
342+
343+ gDPPipeSync (db -> p ++ );
344+ gDPSetCombineMode (db -> p ++ , G_CC_MODULATEIA_PRIM , G_CC_MODULATEIA_PRIM );
345+ gDPSetPrimColor (db -> p ++ , 0 , 0 , 120 , 255 , 100 , 0xFF );
346+
347+ // Draw the legend at the top.
348+ text_print_size (db , "Dungeon" , left , start_top , font_width , font_height );
349+ text_print_size (db , "Boss" , left_area , start_top , font_width , font_height );
350+ gDPSetPrimColor (db -> p ++ , 0 , 0 , 0xFF , 0xFF , 0xFF , 0xFF );
351+ // Draw the list of dungeons entrances.
352+ uint16_t top = start_top ;
353+ for (uint8_t i = 0 ; i < 13 ; i ++ ) {
354+ // Skip BotW/Ice/Hideout/GTG.
355+ if (i > 7 && i < 12 ) {
356+ continue ;
357+ }
358+ gDPPipeSync (db -> p ++ );
359+ dungeon_entry_t dungeon = dungeons [i ];
360+ top += font_height + padding ;
361+ text_print_size (db , dungeon .name , left , top , font_width , font_height );
362+ }
363+ // List of bosses, located in CFG_BOSSES after the first list of 12 for the dpad left menu.
364+ for (uint8_t i = 0 ; i < rows - 1 ; i ++ ) {
365+ boss_entry_t boss = bosses [i ];
366+ if (boss .has_map && !z64_file .dungeon_items [boss .index ].compass ) {
367+ continue ;
312368 }
369+ gDPPipeSync (db -> p ++ );
370+ uint16_t top = start_top + ((font_height + padding ) * (i + 1 ));
371+ text_print_size (db , CFG_BOSSES [12 + i ], left_area , top , font_width , font_height );
313372 }
314373 }
315374 }
@@ -447,7 +506,7 @@ void draw_world_info(z64_disp_buf_t* db) {
447506 for (uint8_t i = 0 ; i < rows - 1 ; i ++ ) {
448507 gDPPipeSync (db -> p ++ );
449508 boss_entry_t boss = bosses [i ];
450- if (boss .has_map && !z64_file .dungeon_items [boss .index ].map ) {
509+ if (boss .has_map && !z64_file .dungeon_items [boss .index ].compass ) {
451510 continue ;
452511 }
453512 uint16_t top = start_top + ((font_height + padding ) * (i + 1 ));
0 commit comments