From dbd3fdba88e3c8c7d1499e1b4988b2969b0650f5 Mon Sep 17 00:00:00 2001 From: Zack Buhman Date: Fri, 4 Jul 2025 11:46:21 -0500 Subject: [PATCH] use translucent rendering for everything --- src/graphics.cpp | 33 ++++------------------------ src/main.cpp | 7 ++---- src/scene/emulator/scene.cpp | 10 ++++----- src/scene/logo/scene.cpp | 12 +++++----- src/scene/options/scene.cpp | 8 +++---- src/scene/tracker/channel_status.cpp | 6 ++--- src/scene/tracker/cover.cpp | 2 +- src/scene/tracker/metadata.cpp | 2 +- src/scene/tracker/notes.cpp | 2 +- src/scene/tracker/scene.cpp | 20 ++--------------- src/scene/tracker/tracklist.cpp | 2 +- src/ta_multiwriter.hpp | 1 - src/widget/button.cpp | 2 +- 13 files changed, 31 insertions(+), 76 deletions(-) diff --git a/src/graphics.cpp b/src/graphics.cpp index 5c3c0e6..37846db 100644 --- a/src/graphics.cpp +++ b/src/graphics.cpp @@ -62,16 +62,6 @@ void graphics_interrupt(uint32_t istnrm) core_in_use = 0; } - if (istnrm & istnrm::end_of_transferring_translucent_list) { - system.ISTNRM = istnrm::end_of_transferring_translucent_list; - - assert(pt_buf != nullptr); - assert(pt_offset > 0); - - ta_polygon_converter_writeback(pt_buf, pt_offset); - ta_polygon_converter_transfer(pt_buf, pt_offset); - } - if (istnrm & istnrm::end_of_transferring_punch_through_list) { system.ISTNRM = istnrm::end_of_transferring_punch_through_list; @@ -82,8 +72,8 @@ void graphics_interrupt(uint32_t istnrm) ta_polygon_converter_transfer(op_buf, op_offset); } - if (istnrm & istnrm::end_of_transferring_opaque_list) { - system.ISTNRM = istnrm::end_of_transferring_opaque_list; + if (istnrm & istnrm::end_of_transferring_translucent_list) { + system.ISTNRM = istnrm::end_of_transferring_translucent_list; core_in_use = 1; core_start_render2(texture_memory_alloc.region_array.start, @@ -173,7 +163,7 @@ void graphics_scene_init(const opb_size * opb_size) void graphics_cursor(ta_multiwriter& multi) { global_polygon_untextured(multi.op, - para_control::list_type::opaque, + para_control::list_type::translucent, tsp_instruction_word::dst_alpha_instr::zero); for (int i = 0; i < 4; i++) { @@ -194,7 +184,6 @@ void graphics_event(ta_multiwriter& multi) { multi.op.offset = 0; multi.pt.offset = 0; - multi.tl.offset = 0; if (scene::current_scene == &scene::scenes[scene::id::tracker] || scene::current_scene == &scene::scenes[scene::id::options]) { graphics_cursor(multi); @@ -224,21 +213,7 @@ void graphics_event(ta_multiwriter& multi) ta_global_parameter::end_of_list(para_control::para_type::end_of_list); } - if (multi.tl.offset != 0) { - multi.tl.append() = - ta_global_parameter::end_of_list(para_control::para_type::end_of_list); - } - - if (multi.tl.offset != 0) { - pt_buf = multi.pt.buf; - pt_offset = multi.pt.offset; - - op_buf = multi.op.buf; - op_offset = multi.op.offset; - - ta_polygon_converter_writeback(multi.tl.buf, multi.tl.offset); - ta_polygon_converter_transfer(multi.tl.buf, multi.tl.offset); - } else if (multi.pt.offset != 0) { + if (multi.pt.offset != 0) { op_buf = multi.op.buf; op_offset = multi.op.offset; diff --git a/src/main.cpp b/src/main.cpp index d2c7dde..5ef4f2d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -125,17 +125,14 @@ void main() system.IML6NRM = istnrm::end_of_render_tsp | istnrm::v_blank_in | istnrm::end_of_transferring_translucent_list - | istnrm::end_of_transferring_punch_through_list - | istnrm::end_of_transferring_opaque_list; + | istnrm::end_of_transferring_punch_through_list; system.IML4EXT = istext::aica; static uint8_t op_buf[1024 * 1024] __attribute__((aligned(32))); static uint8_t pt_buf[1024 * 1024] __attribute__((aligned(32))); - static uint8_t tl_buf[1024 * 1024 / 2] __attribute__((aligned(32))); ta_multiwriter multi(ta_parameter_writer(op_buf, (sizeof (op_buf))), - ta_parameter_writer(pt_buf, (sizeof (pt_buf))), - ta_parameter_writer(tl_buf, (sizeof (tl_buf)))); + ta_parameter_writer(pt_buf, (sizeof (pt_buf)))); static uint8_t send_buf[1024] __attribute__((aligned(32))); static uint8_t recv_buf[1024] __attribute__((aligned(32))); diff --git a/src/scene/emulator/scene.cpp b/src/scene/emulator/scene.cpp index 0b6a0a6..4673e91 100644 --- a/src/scene/emulator/scene.cpp +++ b/src/scene/emulator/scene.cpp @@ -15,13 +15,13 @@ namespace scene::emulator { const struct scene::scene scene = { .ta_alloc = ta_alloc_ctrl::pt_opb::_32x4byte | ta_alloc_ctrl::tm_opb::no_list - | ta_alloc_ctrl::t_opb::no_list + | ta_alloc_ctrl::t_opb::_32x4byte | ta_alloc_ctrl::om_opb::no_list - | ta_alloc_ctrl::o_opb::_32x4byte, + | ta_alloc_ctrl::o_opb::no_list, .opb_size = { - .opaque = 32 * 4, + .opaque = 0, .opaque_modifier = 0, - .translucent = 0, + .translucent = 32 * 4, .translucent_modifier = 0, .punch_through = 32 * 4 }, @@ -90,7 +90,7 @@ namespace scene::emulator { draw_paragraph(multi.pt, color); global_polygon_untextured(multi.op, - para_control::list_type::opaque, + para_control::list_type::translucent, tsp_instruction_word::dst_alpha_instr::zero); quad_type_0(multi.op, diff --git a/src/scene/logo/scene.cpp b/src/scene/logo/scene.cpp index 620f831..fc3c10c 100644 --- a/src/scene/logo/scene.cpp +++ b/src/scene/logo/scene.cpp @@ -59,14 +59,14 @@ static void render_mesh(ta_parameter_writer& writer, const mesh& mesh, const mat { if (wireframe) { global_polygon_untextured(writer, - para_control::list_type::opaque, + para_control::list_type::translucent, tsp_instruction_word::dst_alpha_instr::zero); } else { uint32_t texture_size = tsp_instruction_word::texture_u_size::from_int(8) | tsp_instruction_word::texture_v_size::from_int(8); global_polygon_intensity(writer, - para_control::list_type::opaque, + para_control::list_type::translucent, texture::offset::logo, texture_size, texture_control_word::pixel_format::_565); @@ -136,13 +136,13 @@ namespace scene::logo { const struct scene::scene scene = { .ta_alloc = ta_alloc_ctrl::pt_opb::no_list | ta_alloc_ctrl::tm_opb::no_list - | ta_alloc_ctrl::t_opb::no_list + | ta_alloc_ctrl::t_opb::_32x4byte | ta_alloc_ctrl::om_opb::no_list - | ta_alloc_ctrl::o_opb::_32x4byte, + | ta_alloc_ctrl::o_opb::no_list, .opb_size = { - .opaque = 32 * 4, + .opaque = 0, .opaque_modifier = 0, - .translucent = 0, + .translucent = 32 * 4, .translucent_modifier = 0, .punch_through = 0 }, diff --git a/src/scene/options/scene.cpp b/src/scene/options/scene.cpp index 1d83313..31507b2 100644 --- a/src/scene/options/scene.cpp +++ b/src/scene/options/scene.cpp @@ -221,9 +221,9 @@ namespace scene::options { | ta_alloc_ctrl::tm_opb::no_list | ta_alloc_ctrl::t_opb::_32x4byte | ta_alloc_ctrl::om_opb::no_list - | ta_alloc_ctrl::o_opb::_32x4byte, + | ta_alloc_ctrl::o_opb::no_list, .opb_size = { - .opaque = 32 * 4, + .opaque = 0, .opaque_modifier = 0, .translucent = 32 * 4, .translucent_modifier = 0, @@ -300,8 +300,8 @@ namespace scene::options { { update(); top.draw(multi); - draw_corners(multi.tl); - draw_shroud(multi.tl); + draw_corners(multi.op); + draw_shroud(multi.op); } void interrupt() diff --git a/src/scene/tracker/channel_status.cpp b/src/scene/tracker/channel_status.cpp index 3891ee3..3023abd 100644 --- a/src/scene/tracker/channel_status.cpp +++ b/src/scene/tracker/channel_status.cpp @@ -49,7 +49,7 @@ void draw(ta_multiwriter& multi, int x, int y) int xi = x + offset - 2; global_polygon_untextured(multi.op, - para_control::list_type::opaque, + para_control::list_type::translucent, tsp_instruction_word::dst_alpha_instr::zero); transfer_horizontal_border(multi.op, xi, y, width_per_col * channels_per_row); @@ -57,7 +57,7 @@ void draw(ta_multiwriter& multi, int x, int y) for (int col = 0; col < channels_per_row; col++) { global_polygon_untextured(multi.op, - para_control::list_type::opaque, + para_control::list_type::translucent, tsp_instruction_word::dst_alpha_instr::zero); transfer_vertical_border(multi.op, xi, y, height_per_row); @@ -85,7 +85,7 @@ void draw(ta_multiwriter& multi, int x, int y) } global_polygon_untextured(multi.op, - para_control::list_type::opaque, + para_control::list_type::translucent, tsp_instruction_word::dst_alpha_instr::zero); transfer_vertical_border(multi.op, xi, y, height_per_row); diff --git a/src/scene/tracker/cover.cpp b/src/scene/tracker/cover.cpp index 9191c77..4f02bda 100644 --- a/src/scene/tracker/cover.cpp +++ b/src/scene/tracker/cover.cpp @@ -41,7 +41,7 @@ namespace scene::tracker::cover { | tsp_instruction_word::dst_alpha_instr::zero; global_polygon_textured(multi.op, - para_control::list_type::opaque, + para_control::list_type::translucent, texture::offset::cover1, texture_size, texture_control_word::pixel_format::_565); diff --git a/src/scene/tracker/metadata.cpp b/src/scene/tracker/metadata.cpp index 7fedad0..3d35177 100644 --- a/src/scene/tracker/metadata.cpp +++ b/src/scene/tracker/metadata.cpp @@ -156,7 +156,7 @@ namespace scene::tracker::metadata { draw_values(multi.pt, x_values + 3, y + 3); global_polygon_untextured(multi.op, - para_control::list_type::opaque, + para_control::list_type::translucent, tsp_instruction_word::dst_alpha_instr::zero); draw_border(multi.op, x_values, y); diff --git a/src/scene/tracker/notes.cpp b/src/scene/tracker/notes.cpp index 1caa70c..db291db 100644 --- a/src/scene/tracker/notes.cpp +++ b/src/scene/tracker/notes.cpp @@ -342,7 +342,7 @@ void draw(ta_multiwriter& multi, float x, float y) draw_lines(multi.pt, x, y); global_polygon_untextured(multi.op, - para_control::list_type::opaque, + para_control::list_type::translucent, tsp_instruction_word::dst_alpha_instr::zero); draw_borders(multi.op, x, y); diff --git a/src/scene/tracker/scene.cpp b/src/scene/tracker/scene.cpp index cd454c8..045c03b 100644 --- a/src/scene/tracker/scene.cpp +++ b/src/scene/tracker/scene.cpp @@ -156,9 +156,9 @@ namespace scene::tracker { | ta_alloc_ctrl::tm_opb::no_list | ta_alloc_ctrl::t_opb::_32x4byte | ta_alloc_ctrl::om_opb::no_list - | ta_alloc_ctrl::o_opb::_32x4byte, + | ta_alloc_ctrl::o_opb::no_list, .opb_size = { - .opaque = 32 * 4, + .opaque = 0, .opaque_modifier = 0, .translucent = 32 * 4, .translucent_modifier = 0, @@ -261,20 +261,6 @@ namespace scene::tracker { } } - void draw_dummy_tl(ta_parameter_writer& writer) - { - global_polygon_untextured(writer, - para_control::list_type::translucent, - tsp_instruction_word::dst_alpha_instr::zero); - - quad_type_0(writer, - {0, 0, 0.1}, - {0, 0, 0.1}, - {0, 0, 0.1}, - {0, 0, 0.1}, - 0x0); - } - void transfer(ta_multiwriter& multi) { update_start(); @@ -292,8 +278,6 @@ namespace scene::tracker { if (options) { ::scene::options::transfer(multi); } else { - draw_dummy_tl(multi.tl); - update(); } } diff --git a/src/scene/tracker/tracklist.cpp b/src/scene/tracker/tracklist.cpp index f6fcddd..bb4d5aa 100644 --- a/src/scene/tracker/tracklist.cpp +++ b/src/scene/tracker/tracklist.cpp @@ -99,7 +99,7 @@ namespace scene::tracker::tracklist { draw_middle_line(multi.op, x, y + 3); global_polygon_untextured(multi.op, - para_control::list_type::opaque, + para_control::list_type::translucent, tsp_instruction_word::dst_alpha_instr::zero); float yi = y + glyph::vert_advance + 3; diff --git a/src/ta_multiwriter.hpp b/src/ta_multiwriter.hpp index 71aa722..ed71542 100644 --- a/src/ta_multiwriter.hpp +++ b/src/ta_multiwriter.hpp @@ -5,5 +5,4 @@ struct ta_multiwriter { ta_parameter_writer op; ta_parameter_writer pt; - ta_parameter_writer tl; }; diff --git a/src/widget/button.cpp b/src/widget/button.cpp index 34af26a..87d9922 100644 --- a/src/widget/button.cpp +++ b/src/widget/button.cpp @@ -94,7 +94,7 @@ namespace widget { void button::draw(ta_multiwriter& multi) { global_polygon_untextured(multi.op, - para_control::list_type::opaque, + para_control::list_type::translucent, tsp_instruction_word::dst_alpha_instr::zero); draw_shadow(multi.op);