Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace Magic Meter Items #2081

Merged
merged 5 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,571 changes: 1,286 additions & 1,285 deletions ASM/build/asm_symbols.txt

Large diffs are not rendered by default.

Binary file modified ASM/build/bundle.o
Binary file not shown.
382 changes: 192 additions & 190 deletions ASM/build/c_symbols.txt

Large diffs are not rendered by default.

36 changes: 36 additions & 0 deletions ASM/c/item_draw_functions.c
Original file line number Diff line number Diff line change
Expand Up @@ -608,3 +608,39 @@ void draw_gi_c_button_horizontal(z64_game_t *game, uint32_t draw_id) {
gDPSetPrimColor(gfx->poly_opa.p++, 0, 0x80, prim_color.r, prim_color.g, prim_color.b, prim_color.a);
gSPDisplayList(gfx->poly_opa.p++, item_draw_table[draw_id].args[0].dlist);
}

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

// InnerOutline
colorRGBA8_t prim_outline = item_draw_table[draw_id].args[5].color;
// Container
colorRGBA8_t prim_container = item_draw_table[draw_id].args[4].color;
colorRGBA8_t env_color = item_draw_table[draw_id].args[4].color;
// Magic
colorRGBA8_t prim_color = item_draw_table[draw_id].args[3].color;
if (CFG_CORRECT_MODEL_COLORS) {
prim_color.r = CFG_MAGIC_COLOR .r;
prim_color.g = CFG_MAGIC_COLOR .g;
prim_color.b = CFG_MAGIC_COLOR .b;
}

// Magic
append_setup_dl_25_to_opa(gfx);
gSPMatrix(gfx->poly_opa.p++, append_sys_matrix(gfx), G_MTX_MODELVIEW | G_MTX_LOAD | G_MTX_NOPUSH);
gDPSetPrimColor(gfx->poly_opa.p++, 0, 0x80, prim_color.r, prim_color.g, prim_color.b, prim_color.a);
gDPSetEnvColor(gfx->poly_xlu.p++, env_color.r, env_color.g, env_color.b, env_color.a);
gSPDisplayList(gfx->poly_opa.p++, item_draw_table[draw_id].args[1].dlist);
// Container
append_setup_dl_25_to_xlu(gfx);
gSPMatrix(gfx->poly_xlu.p++, append_sys_matrix(gfx), G_MTX_MODELVIEW | G_MTX_LOAD | G_MTX_NOPUSH);
gDPSetPrimColor(gfx->poly_xlu.p++, 0, 0x80, prim_container.r, prim_container.g, prim_container.b, prim_container.a);
gDPSetEnvColor(gfx->poly_xlu.p++, env_color.r, env_color.g, env_color.b, env_color.a);
gSPDisplayList(gfx->poly_xlu.p++, item_draw_table[draw_id].args[0].dlist);
// InnerOutline
append_setup_dl_25_to_opa(gfx);
gSPMatrix(gfx->poly_opa.p++, append_sys_matrix(gfx), G_MTX_MODELVIEW | G_MTX_LOAD | G_MTX_NOPUSH);
gDPSetPrimColor(gfx->poly_opa.p++, 0, 0x80, prim_outline.r, prim_outline.g, prim_outline.b, prim_outline.a);
gSPDisplayList(gfx->poly_opa.p++, item_draw_table[draw_id].args[2].dlist);

}
2 changes: 2 additions & 0 deletions ASM/c/item_draw_functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ extern uint8_t CUSTOM_KEY_MODELS;
extern uint8_t CFG_CORRECT_MODEL_COLORS;
extern colorRGB16_t CFG_A_BUTTON_COLOR;
extern colorRGB16_t CFG_C_BUTTON_COLOR;
extern colorRGB16_t CFG_MAGIC_COLOR;

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);
Expand Down Expand Up @@ -46,6 +47,7 @@ void draw_gi_silver_rupee_pouch(z64_game_t *game, uint32_t draw_id);
void draw_gi_a_button(z64_game_t *game, uint32_t draw_id);
void draw_gi_c_button_vertical(z64_game_t *game, uint32_t draw_id);
void draw_gi_c_button_horizontal(z64_game_t *game, uint32_t draw_id);
void draw_gi_magic_meter(z64_game_t *game, uint32_t draw_id);


#endif
1 change: 1 addition & 0 deletions ASM/c/item_draw_table.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ item_draw_table_entry_t item_draw_table[] = {
[0x91] = { draw_gi_c_button_vertical, { 0x06000960, 0xFFA000FF, 1 } }, // Cdown button
[0x92] = { draw_gi_c_button_horizontal, { 0x06000E10, 0xFFA000FF, 1 } }, // Cleft button
[0x93] = { draw_gi_c_button_horizontal, { 0x06000E10, 0xFFA000FF, 0 } }, // Cright button
[0x94] = { draw_gi_magic_meter, { 0x06000A80, 0x06000F80, 0x060014C0, 0x00CE00FF, 0xFFFFFFFF, 0x000000FF } }, // Magic Meter , 0x000000FF -- 0x06000F70, 0x00CE00FF, --, 0x06009C0, 0x06001030, 0x00CE00FF, 0xFFFFFFFF
};

void base_draw_gi_model(z64_game_t *game, uint32_t draw_id) {
Expand Down
4 changes: 2 additions & 2 deletions ASM/c/item_table.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,8 @@ item_row_t item_table[] = {
[0x00B7] = ITEM_ROW(0x53, SILVER_CHEST, 0x41, -1, 0x00A1, 0x00AA, 0x02, upgrade_key_model, give_small_key, CASTLE_ID, -1, resolve_text_small_keys), // Ganon's Castle Small Key

[0x00B8] = ITEM_ROW(0x53, GILDED_CHEST, 0x41, -1, 0x00E9, 0x0194, 0x13, no_upgrade, give_defense, -1, -1, NULL), // Double Defense
[0x00B9] = ITEM_ROW(0x53, GILDED_CHEST, 0x41, -1, 0x00E4, 0x00CD, 0x1E, no_upgrade, give_magic, -1, -1, NULL), // Magic Meter
[0x00BA] = ITEM_ROW(0x53, GILDED_CHEST, 0x41, -1, 0x00E8, 0x00CD, 0x1F, no_upgrade, give_double_magic, -1, -1, NULL), // Double Magic
[0x00B9] = ITEM_ROW(0x53, GILDED_CHEST, 0x41, -1, 0x00E4, 0x01AB, 0x95, no_upgrade, give_magic, -1, -1, NULL), // Magic Meter
[0x00BA] = ITEM_ROW(0x53, GILDED_CHEST, 0x41, -1, 0x00E8, 0x01AB, 0x95, no_upgrade, give_double_magic, -1, -1, NULL), // Double Magic

[0x00BB] = ITEM_ROW(0x53, GILDED_CHEST, 0x41, -1, 0x0073, 0x0196, 0x78, no_upgrade, give_song, 6, -1, NULL), // Minuet of Forest
[0x00BC] = ITEM_ROW(0x53, GILDED_CHEST, 0x41, -1, 0x0074, 0x0196, 0x79, no_upgrade, give_song, 7, -1, NULL), // Bolero of Fire
Expand Down
2 changes: 1 addition & 1 deletion ASM/src/config.asm
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ INITIAL_SAVE_DATA:
EXTENDED_INITIAL_SAVE_DATA:
.endarea

.area 0xC0, 0 ; size must be at least 8 * ((max object_id parameter Patches.add_to_extended_object_table is called with) - 0x192)
.area 0xD0, 0 ; size must be at least 8 * ((max object_id parameter Patches.add_to_extended_object_table is called with) - 0x192)
EXTENDED_OBJECT_TABLE:
.endarea

Expand Down
1 change: 1 addition & 0 deletions Patches.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ def patch_rom(spoiler: Spoiler, world: World, rom: Rom) -> Rom:
('object_gi_abutton', data_path('items/A_Button.zobj'), 0x1A8), # A button
('object_gi_cbutton', data_path('items/C_Button_Horizontal.zobj'), 0x1A9), # C button Horizontal
('object_gi_cbutton', data_path('items/C_Button_Vertical.zobj'), 0x1AA), # C button Vertical
('object_gi_magic_meter', data_path('items/MagicMeter.zobj'), 0x1AB), # Magic Meter
]

if world.settings.key_appearance_match_dungeon:
Expand Down
Loading