Skip to content

Commit

Permalink
Cleanup and hylian script
Browse files Browse the repository at this point in the history
  • Loading branch information
Maplesstar committed Dec 27, 2024
1 parent 8525e89 commit c233f3a
Show file tree
Hide file tree
Showing 11 changed files with 16,716 additions and 16,683 deletions.
990 changes: 495 additions & 495 deletions ASM/build/asm_symbols.txt

Large diffs are not rendered by default.

Binary file modified ASM/build/bundle.o
Binary file not shown.
966 changes: 483 additions & 483 deletions ASM/build/c_symbols.txt

Large diffs are not rendered by default.

36 changes: 16 additions & 20 deletions ASM/c/item_draw_functions.c
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ void draw_gi_blue_fire_candle(z64_game_t* game, uint32_t draw_id) {
1, game->common.state_frames * 1, -(game->common.state_frames * 8), 16, 32));
duplicate_sys_matrix();
translate_sys_matrix(-8.0f, -2.0f, 0.0f, 1);
update_sys_matrix(game->billboard_mtx);
update_sys_matrix(game->mf_11DA0);
gSPMatrix(gfx->poly_xlu.p++, append_sys_matrix(gfx), G_MTX_MODELVIEW | G_MTX_LOAD | G_MTX_NOPUSH);
gSPDisplayList(gfx->poly_xlu.p++, item_draw_table[draw_id].args[1].dlist);
pop_sys_matrix();
Expand All @@ -384,7 +384,7 @@ void draw_gi_fairy_lantern(z64_game_t* game, uint32_t draw_id) {
0, 0, 0, 32, 32,
1, game->common.state_frames, -(game->common.state_frames * 6), 32, 32));
duplicate_sys_matrix();
update_sys_matrix(game->billboard_mtx);
update_sys_matrix(game->mf_11DA0);
gSPMatrix(gfx->poly_xlu.p++, append_sys_matrix(gfx), G_MTX_MODELVIEW | G_MTX_LOAD | G_MTX_NOPUSH);
gSPDisplayList(gfx->poly_xlu.p++, item_draw_table[draw_id].args[2].dlist);
pop_sys_matrix();
Expand All @@ -399,7 +399,7 @@ void draw_gi_fairy(z64_game_t* game, uint32_t draw_id) {
0, 0, 0, 32, 32,
1, game->common.state_frames, -(game->common.state_frames * 6), 32, 32));
duplicate_sys_matrix();
update_sys_matrix(game->billboard_mtx);
update_sys_matrix(game->mf_11DA0);
gSPMatrix(gfx->poly_xlu.p++, append_sys_matrix(gfx), G_MTX_MODELVIEW | G_MTX_LOAD | G_MTX_NOPUSH);
// Not sure how much of this is required but these are called from the bottle DL. Not including them causes it to draw weird
gDPSetRenderMode(gfx->poly_xlu.p++, G_RM_PASS, G_RM_AA_ZB_XLU_SURF2);
Expand All @@ -426,7 +426,7 @@ void draw_gi_poe_bottles(z64_game_t* game, uint32_t draw_id) {
0, 0, 0, 16, 32,
1, game->common.state_frames * 1, -(game->common.state_frames * 6), 16, 32));
duplicate_sys_matrix();
update_sys_matrix(game->billboard_mtx);
update_sys_matrix(game->mf_11DA0);
gSPMatrix(gfx->poly_xlu.p++, append_sys_matrix(gfx), G_MTX_MODELVIEW | G_MTX_LOAD | G_MTX_NOPUSH);
gSPDisplayList(gfx->poly_xlu.p++, item_draw_table[draw_id].args[3].dlist);
gSPDisplayList(gfx->poly_xlu.p++, item_draw_table[draw_id].args[2].dlist);
Expand Down Expand Up @@ -715,19 +715,6 @@ void draw_gi_stones(z64_game_t* game, uint32_t draw_id) {
gSPDisplayList(gfx->poly_opa.p++, item_draw_table[draw_id].args[1].dlist);
}

/* void draw_sparkles(z64_game_t* game, colorRGBA8_t prim) {
z64_gfx_t *gfx = game->common.gfx;
static const uint32_t TestDlist = 0x37D20;
update_sys_matrix(game->billboard_mtx);
translate_sys_matrix(10.0f, 2.0f, 0, 1);
scale_sys_matrix(0.25f,0.25f,0.25f, 1);
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++, 0x0, 0x80, prim.r, prim.g, prim.b, 255);
gSPDisplayList(gfx->poly_xlu.p++, 0x04000000 | TestDlist);
} */

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

Expand All @@ -740,19 +727,28 @@ void draw_gi_magic_meter(z64_game_t* game, uint32_t draw_id) {
}
colorRGBA8_t env_color = item_draw_table[draw_id].args[4].color;

//Writing
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);
gSPDisplayList(gfx->poly_xlu.p++, item_draw_table[draw_id].args[4].dlist);
// Shine
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_color.r, prim_color.g, prim_color.b, 0x40);
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[2].dlist);
// Jar
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_color.r, prim_color.g, prim_color.b, prim_color.a);
gDPSetPrimColor(gfx->poly_xlu.p++, 0, 0x80, prim_color.r, prim_color.g, prim_color.b, 0x40);
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);
// Label
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);
gSPDisplayList(gfx->poly_xlu.p++, item_draw_table[draw_id].args[1].dlist);
gSPDisplayList(gfx->poly_xlu.p++, item_draw_table[draw_id].args[3].dlist);
// Parchment
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);
gSPDisplayList(gfx->poly_opa.p++, item_draw_table[draw_id].args[2].dlist);
gSPDisplayList(gfx->poly_opa.p++, item_draw_table[draw_id].args[3].dlist);
}
3 changes: 1 addition & 2 deletions ASM/c/item_draw_table.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,7 @@ 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, { 0x06000000, 0x06000670, 0x00CE00FF, 0xFFFFFFFF, 0x000000FF } }, // Magic Meter
[0x9F] = { draw_gi_magic_meter, { 0x06000000, 0x06000780, 0x06000950, 0x06000F30, 0xFFFFFF80, 0x000000FF } }, // Magic Meter Scroll
[0x9F] = { draw_gi_magic_meter, { 0x06000000, 0x060007B0, 0x06000FD8, 0x060009F8, 0x06001438, 0xFFFFFF80, 0x000000FF } }, // Magic Meter Scroll
};

void base_draw_gi_model(z64_game_t* game, uint32_t draw_id) {
Expand Down
2 changes: 1 addition & 1 deletion ASM/c/z64.h
Original file line number Diff line number Diff line change
Expand Up @@ -1468,7 +1468,7 @@ typedef struct {
char unk_16_[0x000B]; /* 0x11CBD */
void *room_ptr; /* 0x11CC8 */
char unk_17_[0x00D4]; /* 0x11CCC */
float billboard_mtx[4][4]; /* 0x11DA0 */
float mf_11DA0[4][4]; /* 0x11DA0 */
char unk_18_[0x0004]; /* 0x11DE0 */
uint32_t gameplay_frames; /* 0x11DE4 */
uint8_t link_age; /* 0x11DE8 */
Expand Down
1 change: 0 additions & 1 deletion Patches.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ 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
('object_gi_magic_meter', data_path('items/MagicScroll.zobj'), 0x1B4), # Magic Scroll
)

Expand Down
Loading

0 comments on commit c233f3a

Please sign in to comment.