Skip to content

Commit

Permalink
Merge branch 'Dev' into dev-fenhl
Browse files Browse the repository at this point in the history
# Conflicts:
#	ASM/build/asm_symbols.txt
#	ASM/build/bundle.o
#	ASM/build/c_symbols.txt
#	ASM/c/debug.c
#	data/generated/rom_patch.txt
#	data/generated/symbols.json
  • Loading branch information
fenhl committed Jul 21, 2024
2 parents 7154304 + 483394f commit 326e6d7
Show file tree
Hide file tree
Showing 23 changed files with 33,096 additions and 33,099 deletions.
1,334 changes: 673 additions & 661 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,318 changes: 663 additions & 655 deletions ASM/build/c_symbols.txt

Large diffs are not rendered by default.

62 changes: 19 additions & 43 deletions ASM/c/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,7 @@ void draw_debug_float(int whichNumber, float numberToShow) {
debugNumbersFloat[whichNumber] = numberToShow;
}

void debug_utilities(z64_disp_buf_t *db)
{

if (!DEBUG_MODE) {
return;
}

void debug_utilities(z64_disp_buf_t* db) {
// Press L to levitate
// Shoutouts to glankk
if (z64_game.common.input[0].raw.pad.l) {
Expand Down Expand Up @@ -335,16 +329,14 @@ void draw_debug_menu(z64_disp_buf_t *db) {
menu_category_t *d = &(menu_categories[i]);
int top = start_top + ((icon_size + padding) * i) + 1;
if (i != current_menu_indexes.main_index) {
text_print_size(d->name, left, top, font_width);
text_print_size(db, d->name, left, top, font_width, font_height);
}
}
text_flush_size(db, font_width, font_height, 0, 0);

gDPSetPrimColor(db->p++, 0, 0, 0xE0, 0xE0, 0x10 , 0xFF);
menu_category_t *d = &(menu_categories[current_menu_indexes.main_index]);
int top = start_top + ((icon_size + padding) * current_menu_indexes.main_index) + 1;
text_print_size(d->name, left, top, font_width);
text_flush_size(db, font_width, font_height, 0, 0);
text_print_size(db, d->name, left, top, font_width, font_height);
} else {
switch (current_menu_indexes.main_index) {
case 0: // Dungeons
Expand All @@ -353,16 +345,14 @@ void draw_debug_menu(z64_disp_buf_t *db) {
warp_t *d = &(dungeon_warps[i]);
int top = start_top + ((icon_size + padding) * i) + 1;
if (i != current_menu_indexes.dungeon_index) {
text_print_size(d->name, left, top, font_width);
text_print_size(db, d->name, left, top, font_width, font_height);
}
}
text_flush_size(db, font_width, font_height, 0, 0);

gDPSetPrimColor(db->p++, 0, 0, 0xE0, 0xE0, 0x10, 0xFF);
warp_t *d = &(dungeon_warps[current_menu_indexes.dungeon_index]);
int top = start_top + ((icon_size + padding) * current_menu_indexes.dungeon_index) + 1;
text_print_size(d->name, left, top, font_width);
text_flush_size(db, font_width, font_height, 0, 0);
text_print_size(db, d->name, left, top, font_width, font_height);
break;

case 1: // Overworld
Expand All @@ -372,30 +362,26 @@ void draw_debug_menu(z64_disp_buf_t *db) {
warp_t *d = &(overworld_warps[i]);
int top = start_top + ((icon_size + padding) * i) + 1;
if (i != current_menu_indexes.overworld_index) {
text_print_size(d->name, left, top, font_width);
text_print_size(db, d->name, left, top, font_width, font_height);
}
}
text_flush_size(db, font_width, font_height, 0, 0);
gDPSetPrimColor(db->p++, 0, 0, 0xE0, 0xE0, 0x10, 0xFF);
d = &(overworld_warps[current_menu_indexes.overworld_index]);
top = start_top + ((icon_size + padding) * current_menu_indexes.overworld_index) + 1;
text_print_size(d->name, left, top, font_width);
text_flush_size(db, font_width, font_height, 0, 0);
text_print_size(db, d->name, left, top, font_width, font_height);
} else {
for (int i = 0; i < 9; i++) {
warp_t *d = &(overworld_warps[i + 10]);
int top = start_top + ((icon_size + padding) * i) + 1;
if (i + 10 != current_menu_indexes.overworld_index) {
text_print_size(d->name, left, top, font_width);
text_print_size(db, d->name, left, top, font_width, font_height);
}
}
text_flush_size(db, font_width, font_height, 0, 0);

gDPSetPrimColor(db->p++, 0, 0, 0xE0, 0xE0, 0x10, 0xFF);
d = &(overworld_warps[current_menu_indexes.overworld_index]);
top = start_top + ((icon_size + padding) * (current_menu_indexes.overworld_index - 10)) + 1;
text_print_size(d->name, left, top, font_width);
text_flush_size(db, font_width, font_height, 0, 0);
text_print_size(db, d->name, left, top, font_width, font_height);
}
break;
case 2: // Bosses
Expand All @@ -404,16 +390,14 @@ void draw_debug_menu(z64_disp_buf_t *db) {
warp_t *d = &(bosses_warps[i]);
int top = start_top + ((icon_size + padding) * i) + 1;
if (i != current_menu_indexes.boss_index) {
text_print_size(d->name, left, top, font_width);
text_print_size(db, d->name, left, top, font_width, font_height);
}
}
text_flush_size(db, font_width, font_height, 0, 0);

gDPSetPrimColor(db->p++, 0, 0, 0xE0, 0xE0, 0x10, 0xFF);
d = &(bosses_warps[current_menu_indexes.boss_index]);
top = start_top + ((icon_size + padding) * current_menu_indexes.boss_index) + 1;
text_print_size(d->name, left, top, font_width);
text_flush_size(db, font_width, font_height, 0, 0);
text_print_size(db, d->name, left, top, font_width, font_height);
break;
case 3: // Items
gDPSetPrimColor(db->p++, 0, 0, 0xFF, 0xFF, 0xFF, 0xFF);
Expand All @@ -422,48 +406,42 @@ void draw_debug_menu(z64_disp_buf_t *db) {
item_t *dd = &(items_debug[i]);
int top = start_top + ((icon_size + padding) * i) + 1;
if (i != current_menu_indexes.item_index) {
text_print_size(dd->name, left, top, font_width);
text_print_size(db, dd->name, left, top, font_width, font_height);
}
}
text_flush_size(db, font_width, font_height, 0, 0);

gDPSetPrimColor(db->p++, 0, 0, 0xE0, 0xE0, 0x10, 0xFF);
item_t *dd = &(items_debug[current_menu_indexes.item_index]);
top = start_top + ((icon_size + padding) * current_menu_indexes.item_index) + 1;
text_print_size(dd->name, left, top, font_width);
text_flush_size(db, font_width, font_height, 0, 0);
text_print_size(db, dd->name, left, top, font_width, font_height);
}
if (current_menu_indexes.item_index > 9 && current_menu_indexes.item_index < 20) {
for (int i = 0; i < 10; i++) {
item_t *dd = &(items_debug[i + 10]);
int top = start_top + ((icon_size + padding) * i) + 1;
if (i + 10 != current_menu_indexes.item_index) {
text_print_size(dd->name, left, top, font_width);
text_print_size(db, dd->name, left, top, font_width, font_height);
}
}
text_flush_size(db, font_width, font_height, 0, 0);

gDPSetPrimColor(db->p++, 0, 0, 0xE0, 0xE0, 0x10 , 0xFF);
item_t *dd = &(items_debug[current_menu_indexes.item_index]);
top = start_top + ((icon_size + padding) * (current_menu_indexes.item_index - 10)) + 1;
text_print_size(dd->name, left, top, font_width);
text_flush_size(db, font_width, font_height, 0, 0);
text_print_size(db, dd->name, left, top, font_width, font_height);
}
if (current_menu_indexes.item_index > 19 && current_menu_indexes.item_index < 28) {
for (int i = 0; i < 9; i++) {
item_t *dd = &(items_debug[i + 20]);
int top = start_top + ((icon_size + padding) * i) + 1;
if (i + 20 != current_menu_indexes.item_index) {
text_print_size(dd->name, left, top, font_width);
text_print_size(db, dd->name, left, top, font_width, font_height);
}
}
text_flush_size(db, font_width, font_height, 0, 0);

gDPSetPrimColor(db->p++, 0, 0, 0xE0, 0xE0, 0x10 , 0xFF);
item_t *dd = &(items_debug[current_menu_indexes.item_index]);
top = start_top + ((icon_size + padding) * (current_menu_indexes.item_index - 20)) + 1;
text_print_size(dd->name, left, top, font_width);
text_flush_size(db, font_width, font_height, 0, 0);
text_print_size(db, dd->name, left, top, font_width, font_height);
}
break;
default:
Expand Down Expand Up @@ -498,8 +476,7 @@ int draw_int_helper(z64_disp_buf_t *db, int32_t number, int16_t left, int16_t to
// Set the color
gDPSetPrimColor(db->p++, 0, 0, color.r, color.g, color.b, color.a);
if (isNegative) {
text_print_size("-", left - rupee_digit_sprite.tile_w, top, 8);
text_flush_size(db, 8, 16, 0, 0);
text_print_size(db, "-", left - rupee_digit_sprite.tile_w, top, 8, 16);
}
// Draw each digit
for (uint8_t c = j; c > 0; c--) {
Expand Down Expand Up @@ -566,8 +543,7 @@ void draw_debug_numbers(z64_disp_buf_t *db) {

colorRGBA8_t color = { debug_text_color.r, debug_text_color.g, debug_text_color.b, 0xFF};
int numberDigit = draw_int_helper(db, entireValue, debug_text_x_placement, height + offsetY, color);
text_print_size(".", debug_text_x_placement + numberDigit * rupee_digit_sprite.tile_w, height + offsetY, rupee_digit_sprite.tile_w);
text_flush_size(db, rupee_digit_sprite.tile_w, rupee_digit_sprite.tile_h, 0, 0);
text_print_size(db, ".", debug_text_x_placement + numberDigit * rupee_digit_sprite.tile_w, height + offsetY, rupee_digit_sprite.tile_w, rupee_digit_sprite.tile_h);
draw_int_helper(db, decimalValue, debug_text_x_placement + numberDigit * rupee_digit_sprite.tile_w + font_sprite.tile_w,
height + offsetY, color);
}
Expand Down
38 changes: 17 additions & 21 deletions ASM/c/dungeon_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -301,9 +301,8 @@ void draw_dungeon_info(z64_disp_buf_t* db) {
for (int i = 0; i < rows; i++) {
dungeon_entry_t* d = &(dungeons[i]);
int top = start_top + ((icon_size + padding) * i) + 1;
text_print_size(d->name, left, top, font_width);
text_print_size(db, d->name, left, top, font_width, font_height);
}
text_flush_size(db, font_width, font_height, 0, 0);

left += ((SHUFFLE_CHEST_GAME == 1 ? 11 : 8) * font_width) + padding;

Expand All @@ -329,9 +328,8 @@ void draw_dungeon_info(z64_disp_buf_t* db) {
if (current_keys > 0) count[0] = current_keys + '0';
if (total_keys > 0) count[2] = total_keys + '0';
int top = start_top + ((icon_size + padding) * i) + 1;
text_print_size(count, left, top, font_width);
text_print_size(db, count, left, top, font_width, font_height);
}
text_flush_size(db, font_width, font_height, 0, 0);

left += (4 * font_width) + padding;

Expand Down Expand Up @@ -429,12 +427,11 @@ void draw_dungeon_info(z64_disp_buf_t* db) {
}
char* str = CFG_DUNGEON_IS_MQ[d->index] ? "MQ" : "Normal";
int top = start_top + ((icon_size + padding) * i) + 1;
text_print_size(str, left, top, font_width);
text_print_size(db, str, left, top, font_width, font_height);
}

left += (6 * font_width) + padding;
}
text_flush_size(db, font_width, font_height, 0, 0);

if (CFG_DUNGEON_INFO_SILVER_RUPEES) {
// Draw silver rupee icons
Expand Down Expand Up @@ -529,27 +526,27 @@ void draw_dungeon_info(z64_disp_buf_t* db) {

if (everdrive_detection_state == ED64_DETECTION_PRESENT) {
char top_text[16] = "EverDrive found";
text_print(top_text, left, top);
text_print(db, top_text, left, top);
top += icon_size + padding;
switch (everdrive_protocol_state) {
case EVERDRIVE_PROTOCOL_STATE_INIT: {
char state_text[12] = "state: init";
text_print(state_text, left, top);
text_print(db, state_text, left, top);
break;
}
case EVERDRIVE_PROTOCOL_STATE_HANDSHAKE: {
char state_text[17] = "state: handshake";
text_print(state_text, left, top);
text_print(db, state_text, left, top);
break;
}
case EVERDRIVE_PROTOCOL_STATE_MW: {
char state_text[18] = "state: multiworld";
text_print(state_text, left, top);
text_print(db, state_text, left, top);
break;
}
default: {
char state_text[11] = "state: ???";
text_print(state_text, left, top);
text_print(db, state_text, left, top);
break;
}
}
Expand All @@ -569,7 +566,7 @@ void draw_dungeon_info(z64_disp_buf_t* db) {
buf_line_1[3 * i + 1] = '0' + lo;
}
}
text_print(buf_line_1, left, top);
text_print(db, buf_line_1, left, top);
top += icon_size + padding;
char buf_line_2[24] = "OO OO OO OO OO OO OO OO";
for (int i = 8; i < 16; i++) {
Expand All @@ -586,10 +583,10 @@ void draw_dungeon_info(z64_disp_buf_t* db) {
buf_line_2[3 * i + 1] = '0' + lo;
}
}
text_print(buf_line_2, left, top);
text_print(db, buf_line_2, left, top);
} else {
char bottom_text[20] = "EverDrive not found";
text_print(bottom_text, left, top);
text_print(db, bottom_text, left, top);
}
} else if (pad_held.dd) {
show_dungeon_info = 1;
Expand Down Expand Up @@ -693,7 +690,7 @@ void draw_dungeon_info(z64_disp_buf_t* db) {
world_text[3] = world % 10 + '0';
}
int top = start_top + ((icon_size + padding) * i) + 1;
text_print(world_text, left, top);
text_print(db, world_text, left, top);
}
left += 5 * font_sprite.tile_w;
}
Expand Down Expand Up @@ -727,7 +724,7 @@ void draw_dungeon_info(z64_disp_buf_t* db) {
continue;
}
int top = start_top + ((icon_size + padding) * i) + 1;
text_print(CFG_DUNGEON_REWARD_AREAS[i], left, top);
text_print(db, CFG_DUNGEON_REWARD_AREAS[i], left, top);
}
}

Expand Down Expand Up @@ -763,7 +760,7 @@ void draw_dungeon_info(z64_disp_buf_t* db) {
for (int i = 0; i < rows; i++) {
dungeon_entry_t* d = &(dungeons[d_right_dungeon_idx(i)]); // skip Deku/DC/Jabu/Ice dynamically
int top = start_top + ((icon_size + padding) * i) + 1;
text_print(d->name, left, top);
text_print(db, d->name, left, top);
}

left += ((SHUFFLE_CHEST_GAME == 1 ? 11 : 8) * font_sprite.tile_w) + padding;
Expand All @@ -790,7 +787,7 @@ void draw_dungeon_info(z64_disp_buf_t* db) {
if (current_keys > 0) count[0] = current_keys + '0';
if (total_keys > 0) count[2] = total_keys + '0';
int top = start_top + ((icon_size + padding) * i) + 1;
text_print(count, left, top);
text_print(db, count, left, top);
}

left += (4 * font_sprite.tile_w) + padding;
Expand Down Expand Up @@ -927,7 +924,7 @@ void draw_dungeon_info(z64_disp_buf_t* db) {
for (int i = 0; i < 12; i++) {
dungeon_entry_t* d = &(dungeons[i + (i > 9 ? 1 : 0)]); // skip Hideout
int top = start_top + ((icon_size + padding) * i) + 1;
text_print(d->name, left, top);
text_print(db, d->name, left, top);
}

left += (8 * font_sprite.tile_w) + padding;
Expand Down Expand Up @@ -994,15 +991,14 @@ void draw_dungeon_info(z64_disp_buf_t* db) {
}
char* str = CFG_DUNGEON_IS_MQ[d->index] ? "MQ" : "Normal";
int top = start_top + ((icon_size + padding) * i) + 1;
text_print(str, left, top);
text_print(db, str, left, top);
}

left += icon_size + padding;
}
}

// Finish
text_flush(db);
}

int dungeon_info_is_drawn() {
Expand Down
3 changes: 1 addition & 2 deletions ASM/c/file_icons.c
Original file line number Diff line number Diff line change
Expand Up @@ -654,8 +654,7 @@ static void draw_triforce_count_fileselect(z64_disp_buf_t* db, const uint8_t* di
}

gDPSetPrimColor(db->p++, 0, 0, 0xFF, 0xFF, 0xFF, bright_alpha);
text_print_size("/", get_left(dataCurrent->pos) + 4, top, 8);
text_flush_size(db, 8, 8, 0, 0);
text_print_size(db, "/", get_left(dataCurrent->pos) + 4, top, 8, 8);

sprite_load(db, &item_digit_sprite, 0, 10);
// Triforce goal number is always in yellow.
Expand Down
Loading

0 comments on commit 326e6d7

Please sign in to comment.