Compare commits

..

No commits in common. "a0d516803b9f0851f3f8c80742eab28609b7b5de" and "a4ae84124a788d453c762d256287dc45d540083c" have entirely different histories.

28 changed files with 423 additions and 419 deletions

View File

@ -16,13 +16,13 @@ SECTIONS
*(.text) *(.text)
} > p1ram } > p1ram
.data ALIGN(4) : .data ALIGN(4) : SUBALIGN(4)
{ {
*(.data) *(.data)
*(.data.*) *(.data.*)
} > p1ram } > p1ram
.rodata ALIGN(4) : .rodata ALIGN(4) : SUBALIGN(4)
{ {
*(.rodata) *(.rodata)
*(.rodata.*) *(.rodata.*)

View File

@ -312,7 +312,7 @@ void main()
core_flip(frame_ix); core_flip(frame_ix);
while (spg_status::vsync(holly.SPG_STATUS)); while (spg_status::vsync(holly.SPG_STATUS));
frame_ix = (frame_ix + 1) & 1; frame_ix = (frame_ix + 1) & 1;;
theta += (2.f * pi) / 720.f; theta += (2.f * pi) / 720.f;
} }
} }

View File

@ -288,6 +288,6 @@ void main()
core_flip(frame_ix); core_flip(frame_ix);
while (spg_status::vsync(holly.SPG_STATUS)); while (spg_status::vsync(holly.SPG_STATUS));
frame_ix = (frame_ix + 1) & 1; frame_ix = (frame_ix + 1) & 1;;
} }
} }

View File

@ -329,6 +329,6 @@ void main()
core_flip(frame_ix); core_flip(frame_ix);
while (spg_status::vsync(holly.SPG_STATUS)); while (spg_status::vsync(holly.SPG_STATUS));
frame_ix = (frame_ix + 1) & 1; frame_ix = (frame_ix + 1) & 1;;
} }
} }

View File

@ -206,6 +206,6 @@ void main()
while (spg_status::vsync(holly.SPG_STATUS)); while (spg_status::vsync(holly.SPG_STATUS));
theta += half_degree; theta += half_degree;
frame_ix = (frame_ix + 1) & 1; frame_ix = (frame_ix + 1) & 1;;
} }
} }

View File

@ -229,7 +229,7 @@ void main()
core_flip(frame_ix); core_flip(frame_ix);
while (spg_status::vsync(holly.SPG_STATUS)); while (spg_status::vsync(holly.SPG_STATUS));
frame_ix = (frame_ix + 1) & 1; frame_ix = (frame_ix + 1) & 1;;
if (frame_ix == 10 && dumped == false) { if (frame_ix == 10 && dumped == false) {
dump(); dump();

View File

@ -293,6 +293,6 @@ void main()
core_flip(frame_ix); core_flip(frame_ix);
while (spg_status::vsync(holly.SPG_STATUS)); while (spg_status::vsync(holly.SPG_STATUS));
frame_ix = (frame_ix + 1) & 1; frame_ix++;
} }
} }

View File

@ -188,6 +188,11 @@ void init_texture_memory(const struct opb_size& opb_size)
background_parameter(0xff0000ff); background_parameter(0xff0000ff);
} }
constexpr inline uint32_t b(uint32_t v, uint32_t n)
{
return ((v >> n) & 1) << (4 * n);
}
void inflate_font(const uint32_t * src, void inflate_font(const uint32_t * src,
const uint32_t stride, const uint32_t stride,
const uint32_t curve_end_ix) const uint32_t curve_end_ix)
@ -213,7 +218,6 @@ void main()
serial::integer<uint32_t>(font->first_char_code); serial::integer<uint32_t>(font->first_char_code);
serial::integer<uint32_t>(font->glyph_count); serial::integer<uint32_t>(font->glyph_count);
serial::integer<uint32_t>(font->glyph_height); serial::integer<uint32_t>(font->glyph_height);
serial::integer<uint32_t>(font->texture_stride);
serial::integer<uint32_t>(font->texture_width); serial::integer<uint32_t>(font->texture_width);
serial::integer<uint32_t>(font->texture_height); serial::integer<uint32_t>(font->texture_height);
serial::character('\n'); serial::character('\n');
@ -295,6 +299,6 @@ void main()
core_flip(frame_ix); core_flip(frame_ix);
while (spg_status::vsync(holly.SPG_STATUS)); while (spg_status::vsync(holly.SPG_STATUS));
frame_ix = (frame_ix + 1) & 1; frame_ix++;
} }
} }

View File

@ -322,6 +322,6 @@ void main()
constexpr float half_degree = 0.01745329f / 2; constexpr float half_degree = 0.01745329f / 2;
theta += half_degree; theta += half_degree;
frame_ix = (frame_ix + 1) & 1; frame_ix = (frame_ix + 1) & 1;;
} }
} }

View File

@ -301,6 +301,6 @@ void main()
while (spg_status::vsync(holly.SPG_STATUS)); while (spg_status::vsync(holly.SPG_STATUS));
theta += half_degree; theta += half_degree;
frame_ix = (frame_ix + 1) & 1; frame_ix = (frame_ix + 1) & 1;;
} }
} }

View File

@ -212,6 +212,6 @@ void main()
while (spg_status::vsync(holly.SPG_STATUS)); while (spg_status::vsync(holly.SPG_STATUS));
theta += half_degree; theta += half_degree;
frame_ix = (frame_ix + 1) & 1; frame_ix = (frame_ix + 1) & 1;;
} }
} }

View File

@ -286,6 +286,6 @@ void main()
while (spg_status::vsync(holly.SPG_STATUS)); while (spg_status::vsync(holly.SPG_STATUS));
theta += half_degree; theta += half_degree;
frame_ix = (frame_ix + 1) & 1; frame_ix = (frame_ix + 1) & 1;;
} }
} }

View File

@ -182,6 +182,6 @@ void main()
while (spg_status::vsync(holly.SPG_STATUS)); while (spg_status::vsync(holly.SPG_STATUS));
theta += half_degree; theta += half_degree;
frame_ix = (frame_ix + 1) & 1; frame_ix = (frame_ix + 1) & 1;;
} }
} }

View File

@ -229,6 +229,6 @@ void main()
core_flip(frame_ix); core_flip(frame_ix);
while (spg_status::vsync(holly.SPG_STATUS)); while (spg_status::vsync(holly.SPG_STATUS));
frame_ix = (frame_ix + 1) & 1; frame_ix = (frame_ix + 1) & 1;;
} }
} }

View File

@ -263,6 +263,6 @@ void main()
constexpr float half_degree = 0.01745329f / 2; constexpr float half_degree = 0.01745329f / 2;
theta += half_degree; theta += half_degree;
frame_ix = (frame_ix + 1) & 1; frame_ix = (frame_ix + 1) & 1;;
} }
} }

View File

@ -446,6 +446,6 @@ void main()
core_flip(frame_ix); core_flip(frame_ix);
while (spg_status::vsync(holly.SPG_STATUS)); while (spg_status::vsync(holly.SPG_STATUS));
frame_ix = (frame_ix + 1) & 1; frame_ix = (frame_ix + 1) & 1;;
} }
} }

View File

@ -232,7 +232,7 @@ void main()
core_flip(frame_ix); core_flip(frame_ix);
while (spg_status::vsync(holly.SPG_STATUS)); while (spg_status::vsync(holly.SPG_STATUS));
frame_ix = (frame_ix + 1) & 1; frame_ix = (frame_ix + 1) & 1;;
theta += half_degree; theta += half_degree;
} }
} }

View File

@ -134,6 +134,6 @@ void main()
core_flip(frame_ix); core_flip(frame_ix);
while (spg_status::vsync(holly.SPG_STATUS)); while (spg_status::vsync(holly.SPG_STATUS));
frame_ix = (frame_ix + 1) & 1; frame_ix = (frame_ix + 1) & 1;;
} }
} }

View File

@ -251,7 +251,7 @@ void main()
core_flip(frame_ix); core_flip(frame_ix);
while (spg_status::vsync(holly.SPG_STATUS)); while (spg_status::vsync(holly.SPG_STATUS));
frame_ix = (frame_ix + 1) & 1; frame_ix = (frame_ix + 1) & 1;;
if (frame_ix > 10) if (frame_ix > 10)
break; break;

View File

@ -202,6 +202,6 @@ void main()
while (spg_status::vsync(holly.SPG_STATUS)); while (spg_status::vsync(holly.SPG_STATUS));
theta += half_degree; theta += half_degree;
frame_ix = (frame_ix + 1) & 1; frame_ix = (frame_ix + 1) & 1;;
} }
} }

View File

@ -175,6 +175,6 @@ void main()
constexpr float half_degree = 0.01745329f / 2.f; constexpr float half_degree = 0.01745329f / 2.f;
theta += half_degree; theta += half_degree;
frame_ix = (frame_ix + 1) & 1; frame_ix = (frame_ix + 1) & 1;;
} }
} }

View File

@ -212,7 +212,7 @@ void main()
core_flip(frame_ix); core_flip(frame_ix);
while (spg_status::vsync(holly.SPG_STATUS)); while (spg_status::vsync(holly.SPG_STATUS));
frame_ix = (frame_ix + 1) & 1; frame_ix = (frame_ix + 1) & 1;;
delta += pi * 2 / 360; delta += pi * 2 / 360;
} }
} }

View File

@ -312,6 +312,6 @@ void main()
while (spg_status::vsync(holly.SPG_STATUS)); while (spg_status::vsync(holly.SPG_STATUS));
theta += half_degree; theta += half_degree;
frame_ix = (frame_ix + 1) & 1; frame_ix = (frame_ix + 1) & 1;;
} }
} }

View File

@ -54,7 +54,7 @@ void ta_polygon_converter_cont(uint32_t ol_base_offset,
(void)_dummy_read; (void)_dummy_read;
} }
void ta_polygon_converter_transfer(volatile uint32_t const * const buf, uint32_t size) void ta_polygon_converter_transfer(volatile uint32_t * buf, uint32_t size)
{ {
/* wait for previous transfer to complete (if any) */ /* wait for previous transfer to complete (if any) */
//while ((system.C2DST & C2DST__STATUS) != 0); /* 1 == transfer is in progress */ //while ((system.C2DST & C2DST__STATUS) != 0); /* 1 == transfer is in progress */

View File

@ -8,7 +8,7 @@ void ta_polygon_converter_init(uint32_t opb_total_size, // for one tile, for all
uint32_t tile_height); // in tile units (e.g: (480 / 32)) uint32_t tile_height); // in tile units (e.g: (480 / 32))
void ta_polygon_converter_cont(uint32_t ol_base_offset, void ta_polygon_converter_cont(uint32_t ol_base_offset,
uint32_t ta_alloc); uint32_t ta_alloc);
void ta_polygon_converter_transfer(volatile uint32_t const * const buf, uint32_t size); void ta_polygon_converter_transfer(volatile uint32_t * buf, uint32_t size);
void ta_wait_opaque_list(); void ta_wait_opaque_list();
void ta_wait_opaque_modifier_volume_list(); void ta_wait_opaque_modifier_volume_list();
void ta_wait_translucent_list(); void ta_wait_translucent_list();

View File

@ -14,7 +14,7 @@ namespace ta_global_parameter {
uint32_t _res5; uint32_t _res5;
uint32_t _res6; uint32_t _res6;
constexpr end_of_list(const uint32_t parameter_control_word end_of_list(const uint32_t parameter_control_word
) )
: parameter_control_word(parameter_control_word) : parameter_control_word(parameter_control_word)
, _res0(0) , _res0(0)
@ -51,7 +51,7 @@ namespace ta_global_parameter {
uint32_t user_clip_x_max; uint32_t user_clip_x_max;
uint32_t user_clip_y_max; uint32_t user_clip_y_max;
constexpr user_tile_clip(const uint32_t parameter_control_word, user_tile_clip(const uint32_t parameter_control_word,
const uint32_t user_clip_x_min, const uint32_t user_clip_x_min,
const uint32_t user_clip_y_min, const uint32_t user_clip_y_min,
const uint32_t user_clip_x_max, const uint32_t user_clip_x_max,
@ -92,7 +92,7 @@ namespace ta_global_parameter {
uint32_t bounding_box_x_max; uint32_t bounding_box_x_max;
uint32_t bounding_box_y_max; uint32_t bounding_box_y_max;
constexpr object_list_set(const uint32_t parameter_control_word, object_list_set(const uint32_t parameter_control_word,
const uint32_t object_pointer, const uint32_t object_pointer,
const uint32_t bounding_box_x_min, const uint32_t bounding_box_x_min,
const uint32_t bounding_box_y_min, const uint32_t bounding_box_y_min,
@ -134,7 +134,7 @@ namespace ta_global_parameter {
uint32_t data_size_for_sort_dma; uint32_t data_size_for_sort_dma;
uint32_t next_address_for_sort_dma; uint32_t next_address_for_sort_dma;
constexpr polygon_type_0(const uint32_t parameter_control_word, polygon_type_0(const uint32_t parameter_control_word,
const uint32_t isp_tsp_instruction_word, const uint32_t isp_tsp_instruction_word,
const uint32_t tsp_instruction_word, const uint32_t tsp_instruction_word,
const uint32_t texture_control_word, const uint32_t texture_control_word,
@ -176,7 +176,7 @@ namespace ta_global_parameter {
float face_color_g; float face_color_g;
float face_color_b; float face_color_b;
constexpr polygon_type_1(const uint32_t parameter_control_word, polygon_type_1(const uint32_t parameter_control_word,
const uint32_t isp_tsp_instruction_word, const uint32_t isp_tsp_instruction_word,
const uint32_t tsp_instruction_word, const uint32_t tsp_instruction_word,
const uint32_t texture_control_word, const uint32_t texture_control_word,
@ -228,7 +228,7 @@ namespace ta_global_parameter {
float face_offset_color_g; float face_offset_color_g;
float face_offset_color_b; float face_offset_color_b;
constexpr polygon_type_2(const uint32_t parameter_control_word, polygon_type_2(const uint32_t parameter_control_word,
const uint32_t isp_tsp_instruction_word, const uint32_t isp_tsp_instruction_word,
const uint32_t tsp_instruction_word, const uint32_t tsp_instruction_word,
const uint32_t texture_control_word, const uint32_t texture_control_word,
@ -294,7 +294,7 @@ namespace ta_global_parameter {
uint32_t data_size_for_sort_dma; uint32_t data_size_for_sort_dma;
uint32_t next_address_for_sort_dma; uint32_t next_address_for_sort_dma;
constexpr polygon_type_3(const uint32_t parameter_control_word, polygon_type_3(const uint32_t parameter_control_word,
const uint32_t isp_tsp_instruction_word, const uint32_t isp_tsp_instruction_word,
const uint32_t tsp_instruction_word_0, const uint32_t tsp_instruction_word_0,
const uint32_t texture_control_word_0, const uint32_t texture_control_word_0,
@ -346,7 +346,7 @@ namespace ta_global_parameter {
float face_color_g_1; float face_color_g_1;
float face_color_b_1; float face_color_b_1;
constexpr polygon_type_4(const uint32_t parameter_control_word, polygon_type_4(const uint32_t parameter_control_word,
const uint32_t isp_tsp_instruction_word, const uint32_t isp_tsp_instruction_word,
const uint32_t tsp_instruction_word_0, const uint32_t tsp_instruction_word_0,
const uint32_t texture_control_word_0, const uint32_t texture_control_word_0,
@ -414,7 +414,7 @@ namespace ta_global_parameter {
uint32_t data_size_for_sort_dma; uint32_t data_size_for_sort_dma;
uint32_t next_address_for_sort_dma; uint32_t next_address_for_sort_dma;
constexpr sprite(const uint32_t parameter_control_word, sprite(const uint32_t parameter_control_word,
const uint32_t isp_tsp_instruction_word, const uint32_t isp_tsp_instruction_word,
const uint32_t tsp_instruction_word, const uint32_t tsp_instruction_word,
const uint32_t texture_control_word, const uint32_t texture_control_word,
@ -458,7 +458,7 @@ namespace ta_global_parameter {
uint32_t _res4; uint32_t _res4;
uint32_t _res5; uint32_t _res5;
constexpr modifier_volume(const uint32_t parameter_control_word, modifier_volume(const uint32_t parameter_control_word,
const uint32_t isp_tsp_instruction_word const uint32_t isp_tsp_instruction_word
) )
: parameter_control_word(parameter_control_word) : parameter_control_word(parameter_control_word)

View File

@ -14,7 +14,7 @@ namespace ta_vertex_parameter {
uint32_t base_color; uint32_t base_color;
uint32_t _res2; uint32_t _res2;
constexpr polygon_type_0(const uint32_t parameter_control_word, polygon_type_0(const uint32_t parameter_control_word,
const float x, const float x,
const float y, const float y,
const float z, const float z,
@ -55,7 +55,7 @@ namespace ta_vertex_parameter {
float base_color_g; float base_color_g;
float base_color_b; float base_color_b;
constexpr polygon_type_1(const uint32_t parameter_control_word, polygon_type_1(const uint32_t parameter_control_word,
const float x, const float x,
const float y, const float y,
const float z, const float z,
@ -99,7 +99,7 @@ namespace ta_vertex_parameter {
float base_intensity; float base_intensity;
uint32_t _res2; uint32_t _res2;
constexpr polygon_type_2(const uint32_t parameter_control_word, polygon_type_2(const uint32_t parameter_control_word,
const float x, const float x,
const float y, const float y,
const float z, const float z,
@ -140,7 +140,7 @@ namespace ta_vertex_parameter {
uint32_t base_color; uint32_t base_color;
uint32_t offset_color; uint32_t offset_color;
constexpr polygon_type_3(const uint32_t parameter_control_word, polygon_type_3(const uint32_t parameter_control_word,
const float x, const float x,
const float y, const float y,
const float z, const float z,
@ -184,7 +184,7 @@ namespace ta_vertex_parameter {
uint32_t base_color; uint32_t base_color;
uint32_t offset_color; uint32_t offset_color;
constexpr polygon_type_4(const uint32_t parameter_control_word, polygon_type_4(const uint32_t parameter_control_word,
const float x, const float x,
const float y, const float y,
const float z, const float z,
@ -235,7 +235,7 @@ namespace ta_vertex_parameter {
float offset_color_g; float offset_color_g;
float offset_color_b; float offset_color_b;
constexpr polygon_type_5(const uint32_t parameter_control_word, polygon_type_5(const uint32_t parameter_control_word,
const float x, const float x,
const float y, const float y,
const float z, const float z,
@ -309,7 +309,7 @@ namespace ta_vertex_parameter {
float offset_color_g; float offset_color_g;
float offset_color_b; float offset_color_b;
constexpr polygon_type_6(const uint32_t parameter_control_word, polygon_type_6(const uint32_t parameter_control_word,
const float x, const float x,
const float y, const float y,
const float z, const float z,
@ -374,7 +374,7 @@ namespace ta_vertex_parameter {
float base_intensity; float base_intensity;
float offset_intensity; float offset_intensity;
constexpr polygon_type_7(const uint32_t parameter_control_word, polygon_type_7(const uint32_t parameter_control_word,
const float x, const float x,
const float y, const float y,
const float z, const float z,
@ -418,7 +418,7 @@ namespace ta_vertex_parameter {
float base_intensity; float base_intensity;
float offset_intensity; float offset_intensity;
constexpr polygon_type_8(const uint32_t parameter_control_word, polygon_type_8(const uint32_t parameter_control_word,
const float x, const float x,
const float y, const float y,
const float z, const float z,
@ -461,7 +461,7 @@ namespace ta_vertex_parameter {
uint32_t _res0; uint32_t _res0;
uint32_t _res1; uint32_t _res1;
constexpr polygon_type_9(const uint32_t parameter_control_word, polygon_type_9(const uint32_t parameter_control_word,
const float x, const float x,
const float y, const float y,
const float z, const float z,
@ -503,7 +503,7 @@ namespace ta_vertex_parameter {
uint32_t _res0; uint32_t _res0;
uint32_t _res1; uint32_t _res1;
constexpr polygon_type_10(const uint32_t parameter_control_word, polygon_type_10(const uint32_t parameter_control_word,
const float x, const float x,
const float y, const float y,
const float z, const float z,
@ -553,7 +553,7 @@ namespace ta_vertex_parameter {
uint32_t _res2; uint32_t _res2;
uint32_t _res3; uint32_t _res3;
constexpr polygon_type_11(const uint32_t parameter_control_word, polygon_type_11(const uint32_t parameter_control_word,
const float x, const float x,
const float y, const float y,
const float z, const float z,
@ -625,7 +625,7 @@ namespace ta_vertex_parameter {
uint32_t _res4; uint32_t _res4;
uint32_t _res5; uint32_t _res5;
constexpr polygon_type_12(const uint32_t parameter_control_word, polygon_type_12(const uint32_t parameter_control_word,
const float x, const float x,
const float y, const float y,
const float z, const float z,
@ -695,7 +695,7 @@ namespace ta_vertex_parameter {
uint32_t _res2; uint32_t _res2;
uint32_t _res3; uint32_t _res3;
constexpr polygon_type_13(const uint32_t parameter_control_word, polygon_type_13(const uint32_t parameter_control_word,
const float x, const float x,
const float y, const float y,
const float z, const float z,
@ -767,7 +767,7 @@ namespace ta_vertex_parameter {
uint32_t _res4; uint32_t _res4;
uint32_t _res5; uint32_t _res5;
constexpr polygon_type_14(const uint32_t parameter_control_word, polygon_type_14(const uint32_t parameter_control_word,
const float x, const float x,
const float y, const float y,
const float z, const float z,
@ -837,7 +837,7 @@ namespace ta_vertex_parameter {
uint32_t _res2; uint32_t _res2;
uint32_t _res3; uint32_t _res3;
constexpr sprite_type_0(const uint32_t parameter_control_word, sprite_type_0(const uint32_t parameter_control_word,
const float a_x, const float a_x,
const float a_y, const float a_y,
const float a_z, const float a_z,
@ -909,7 +909,7 @@ namespace ta_vertex_parameter {
uint32_t b_u_b_v; uint32_t b_u_b_v;
uint32_t c_u_c_v; uint32_t c_u_c_v;
constexpr sprite_type_1(const uint32_t parameter_control_word, sprite_type_1(const uint32_t parameter_control_word,
const float a_x, const float a_x,
const float a_y, const float a_y,
const float a_z, const float a_z,
@ -984,7 +984,7 @@ namespace ta_vertex_parameter {
uint32_t _res4; uint32_t _res4;
uint32_t _res5; uint32_t _res5;
constexpr modifier_volume(const uint32_t parameter_control_word, modifier_volume(const uint32_t parameter_control_word,
const float a_x, const float a_x,
const float a_y, const float a_y,
const float a_z, const float a_z,

View File

@ -94,7 +94,7 @@ def parse(rows, expected_offset, expected_sizes):
return declarations return declarations
def render_initializer(declaration, get_type): def render_initializer(declaration, get_type):
initializer = f"constexpr {declaration.name}(" initializer = f"{declaration.name}("
padding = " " * len(initializer) padding = " " * len(initializer)
def start(i): def start(i):
if i == 0: if i == 0: