Skip to content

Commit

Permalink
Merge 'Replace Magic Meter Items' (#2081)
Browse files Browse the repository at this point in the history
  • Loading branch information
fenhl committed Sep 30, 2024
2 parents ba82e6b + 9517fde commit 0b80b50
Show file tree
Hide file tree
Showing 14 changed files with 39,016 additions and 38,782 deletions.
2,901 changes: 1,451 additions & 1,450 deletions ASM/build/asm_symbols.txt

Large diffs are not rendered by default.

Binary file modified ASM/build/bundle.o
Binary file not shown.
958 changes: 480 additions & 478 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 @@ -714,3 +714,39 @@ void draw_gi_stones(z64_game_t* game, uint32_t draw_id) {
gDPSetEnvColor(gfx->poly_opa.p++, 0x96, 0x78, 0x00, 0xFF);
gSPDisplayList(gfx->poly_opa.p++, item_draw_table[draw_id].args[1].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 @@ -50,5 +51,6 @@ void draw_gi_fairy(z64_game_t* game, uint32_t draw_id);
void draw_gi_nothing(z64_game_t* game, uint32_t draw_id);
void draw_gi_medallions(z64_game_t* game, uint32_t draw_id);
void draw_gi_stones(z64_game_t* game, uint32_t draw_id);
void draw_gi_magic_meter(z64_game_t* game, uint32_t draw_id);

#endif
3 changes: 2 additions & 1 deletion ASM/c/item_draw_table.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,8 @@ item_draw_table_entry_t item_draw_table[] = {
[0x9C] = { draw_gi_stones, { 0x06000b00, 0x060012f0, 0x32ffffff, 0x320096ff } }, // Zora Sapphire
[0x9D] = { draw_gi_fairy, { 0x06000EF0 } }, // Fairy (not in a bottle but uses the fairy from the bottle)
[0x9E] = { draw_gi_nothing, {} },
};
[0x9F] = { 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) {
item_draw_table[draw_id].draw_func(game, 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 @@ -218,8 +218,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, 0x01B4, 0xA0, no_upgrade, give_magic, -1, -1, NULL), // Magic Meter
[0x00BA] = ITEM_ROW(0x53, GILDED_CHEST, 0x41, -1, 0x00E8, 0x01B4, 0xA0, no_upgrade, give_double_magic, -1, -1, NULL), // Double Magic

[0x00BB] = ITEM_ROW(0x53, GILDED_CHEST, 0x41, -1, 0x9091, 0x0196, 0x78, no_upgrade, give_quest_item, 6, -1, NULL), // Minuet of Forest
[0x00BC] = ITEM_ROW(0x53, GILDED_CHEST, 0x41, -1, 0x9092, 0x0196, 0x79, no_upgrade, give_quest_item, 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 @@ -148,7 +148,7 @@ INITIAL_SAVE_DATA:
EXTENDED_INITIAL_SAVE_DATA:
.endarea

.area 0x108, 0 ; size must be at least 8 * ((max object_id parameter Patches.add_to_extended_object_table is called with) - 0x192)
.area 0x110, 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 @@ -90,6 +90,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'), 0x1B4), # Magic Meter
)

if world.settings.key_appearance_match_dungeon:
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ issue. You should always Hard Reset to avoid this issue entirely.

* New options `Custom (count)` and `Custom (%)` for the `Ice Traps` setting.
* Now supports custom music written for the Majora's Mask Randomizer.
* New Magic Meter item model to allow magic drops to be shuffled in the future.

### 8.2

Expand Down
Loading

0 comments on commit 0b80b50

Please sign in to comment.