example: update several examples

This commit is contained in:
Zack Buhman 2024-01-03 21:50:07 +08:00
parent dcb9f36120
commit 1f6a29f379
26 changed files with 1610 additions and 1321 deletions

View File

@ -3,17 +3,19 @@
#include "align.hpp" #include "align.hpp"
#include "vga.hpp" #include "vga.hpp"
#include "holly.hpp" #include "holly/holly.hpp"
#include "holly/core.hpp" #include "holly/core.hpp"
#include "holly/core_bits.hpp" #include "holly/core_bits.hpp"
#include "holly/ta_fifo_polygon_converter.hpp" #include "holly/ta_fifo_polygon_converter.hpp"
#include "holly/ta_parameter.hpp" #include "holly/ta_parameter.hpp"
#include "holly/ta_global_parameter.hpp"
#include "holly/ta_vertex_parameter.hpp"
#include "holly/ta_bits.hpp" #include "holly/ta_bits.hpp"
#include "holly/isp_tsp.hpp"
#include "holly/region_array.hpp" #include "holly/region_array.hpp"
#include "holly/background.hpp" #include "holly/background.hpp"
#include "holly/texture_memory_alloc.hpp" #include "holly/texture_memory_alloc.hpp"
#include "memorymap.hpp" #include "memorymap.hpp"
#include "serial.hpp"
#include "geometry/cube.hpp" #include "geometry/cube.hpp"
#include "math/vec4.hpp" #include "math/vec4.hpp"
@ -59,10 +61,14 @@ void transform(ta_parameter_writer& parameter,
| tsp_instruction_word::dst_alpha_instr::zero | tsp_instruction_word::dst_alpha_instr::zero
| tsp_instruction_word::fog_control::no_fog; | tsp_instruction_word::fog_control::no_fog;
parameter.append<global_polygon_type_0>() = global_polygon_type_0(parameter_control_word, parameter.append<ta_global_parameter::polygon_type_0>() =
isp_tsp_instruction_word, ta_global_parameter::polygon_type_0(parameter_control_word,
tsp_instruction_word, isp_tsp_instruction_word,
0); tsp_instruction_word,
0, // texture_control_word
0, // data_size_for_sort_dma
0 // next_address_for_sort_dma
);
auto& face = cube::faces[face_ix]; auto& face = cube::faces[face_ix];
constexpr uint32_t strip_length = 3; constexpr uint32_t strip_length = 3;
@ -116,13 +122,14 @@ void transform(ta_parameter_writer& parameter,
y += 240.f; y += 240.f;
z = 1 / z; z = 1 / z;
parameter.append<vertex_polygon_type_1>() = parameter.append<ta_vertex_parameter::polygon_type_1>() =
vertex_polygon_type_1(x, y, z, ta_vertex_parameter::polygon_type_1(polygon_vertex_parameter_control_word(end_of_strip),
x, y, z,
color.w, // alpha color.w, // alpha
color.x, // r color.x, // r
color.y, // g color.y, // g
color.z, // b color.z // b
end_of_strip); );
} }
} }
@ -163,8 +170,6 @@ void main()
, .punch_through = 0 , .punch_through = 0
}; };
constexpr uint32_t tiles = (640 / 32) * (320 / 32);
holly.SOFTRESET = softreset::pipeline_soft_reset holly.SOFTRESET = softreset::pipeline_soft_reset
| softreset::ta_soft_reset; | softreset::ta_soft_reset;
holly.SOFTRESET = 0; holly.SOFTRESET = 0;
@ -182,8 +187,10 @@ void main()
}; };
while (1) { while (1) {
ta_polygon_converter_init(opb_size.total() * tiles, ta_alloc, ta_polygon_converter_init(opb_size.total(),
640, 480); ta_alloc,
640 / 32,
480 / 32);
//lights[0].x = cos(theta) * 10; //lights[0].x = cos(theta) * 10;
//lights[0].z = sin(theta) * 10; //lights[0].z = sin(theta) * 10;
@ -195,7 +202,7 @@ void main()
for (uint32_t i = 0; i < cube::num_faces; i++) { for (uint32_t i = 0; i < cube::num_faces; i++) {
transform(parameter, i, theta, lights); transform(parameter, i, theta, lights);
} }
parameter.append<global_end_of_list>() = global_end_of_list(); parameter.append<ta_global_parameter::end_of_list>() = ta_global_parameter::end_of_list(para_control::para_type::end_of_list);
ta_polygon_converter_transfer(ta_parameter_buf, parameter.offset); ta_polygon_converter_transfer(ta_parameter_buf, parameter.offset);
ta_wait_opaque_list(); ta_wait_opaque_list();
core_start_render(frame_ix, num_frames); core_start_render(frame_ix, num_frames);

View File

@ -40,7 +40,6 @@ FONT_BITMAP_OBJ = \
holly/region_array.o \ holly/region_array.o \
holly/background.o \ holly/background.o \
holly/ta_fifo_polygon_converter.o \ holly/ta_fifo_polygon_converter.o \
serial.o \
sperrypc.data.o sperrypc.data.o
example/font_bitmap.elf: LDSCRIPT = $(LIB)/alt.lds example/font_bitmap.elf: LDSCRIPT = $(LIB)/alt.lds
@ -53,7 +52,6 @@ FONT_OUTLINE_OBJ = \
holly/region_array.o \ holly/region_array.o \
holly/background.o \ holly/background.o \
holly/ta_fifo_polygon_converter.o \ holly/ta_fifo_polygon_converter.o \
serial.o \
dejavusansmono.data.o dejavusansmono.data.o
example/font_outline.elf: LDSCRIPT = $(LIB)/alt.lds example/font_outline.elf: LDSCRIPT = $(LIB)/alt.lds
@ -66,7 +64,6 @@ FONT_OUTLINE_PUNCH_THROUGH_OBJ = \
holly/region_array.o \ holly/region_array.o \
holly/background.o \ holly/background.o \
holly/ta_fifo_polygon_converter.o \ holly/ta_fifo_polygon_converter.o \
serial.o \
dejavusansmono_mono.data.o dejavusansmono_mono.data.o
example/font_outline_punch_through.elf: LDSCRIPT = $(LIB)/alt.lds example/font_outline_punch_through.elf: LDSCRIPT = $(LIB)/alt.lds
@ -185,7 +182,6 @@ MACAW_CUBE_RENDER_TO_TEXTURE_OBJ = \
holly/region_array.o \ holly/region_array.o \
holly/background.o \ holly/background.o \
holly/ta_fifo_polygon_converter.o \ holly/ta_fifo_polygon_converter.o \
serial.o \
macaw.data.o macaw.data.o
example/macaw_cube_render_to_texture.elf: LDSCRIPT = $(LIB)/alt.lds example/macaw_cube_render_to_texture.elf: LDSCRIPT = $(LIB)/alt.lds
@ -203,7 +199,7 @@ example/maple_device_request.elf: $(START_OBJ) $(MAPLE_DEVICE_REQUEST_OBJ)
MAPLE_CONTROLLER_OBJ = \ MAPLE_CONTROLLER_OBJ = \
example/maple_controller.o \ example/maple_controller.o \
vga.o \ vga.o \
serial.o \ sh7091/serial.o \
maple/maple.o maple/maple.o
example/maple_controller.elf: LDSCRIPT = $(LIB)/alt.lds example/maple_controller.elf: LDSCRIPT = $(LIB)/alt.lds
@ -237,7 +233,6 @@ MAPLE_ANALOG_OBJ = \
holly/region_array.o \ holly/region_array.o \
holly/background.o \ holly/background.o \
holly/ta_fifo_polygon_converter.o \ holly/ta_fifo_polygon_converter.o \
serial.o \
maple/maple.o maple/maple.o
example/maple_analog.elf: LDSCRIPT = $(LIB)/alt.lds example/maple_analog.elf: LDSCRIPT = $(LIB)/alt.lds

View File

@ -1,20 +1,22 @@
#include <cstdint> #include <cstdint>
#include "align.hpp" #include "align.hpp"
#include "vga.hpp" #include "vga.hpp"
#include "holly.hpp"
#include "holly/texture_memory_alloc.hpp"
#include "holly/holly.hpp"
#include "holly/core.hpp" #include "holly/core.hpp"
#include "holly/core_bits.hpp" #include "holly/core_bits.hpp"
#include "holly/ta_parameter.hpp"
#include "holly/ta_fifo_polygon_converter.hpp" #include "holly/ta_fifo_polygon_converter.hpp"
#include "holly/texture_memory_alloc.hpp" #include "holly/ta_parameter.hpp"
#include "holly/ta_global_parameter.hpp"
#include "holly/ta_vertex_parameter.hpp"
#include "holly/ta_bits.hpp"
#include "holly/isp_tsp.hpp"
#include "memorymap.hpp" #include "memorymap.hpp"
#include "holly/background.hpp" #include "holly/background.hpp"
#include "holly/region_array.hpp" #include "holly/region_array.hpp"
#include "holly/ta_bits.hpp"
#include "twiddle.hpp" #include "twiddle.hpp"
#include "serial.hpp"
#include "sperrypc.hpp" #include "sperrypc.hpp"
@ -92,25 +94,35 @@ constexpr uint32_t strip_length = (sizeof (strip_vertices)) / (sizeof (struct ve
uint32_t transform(uint32_t * ta_parameter_buf, const char * s, const uint32_t len) uint32_t transform(uint32_t * ta_parameter_buf, const char * s, const uint32_t len)
{ {
auto parameter = ta_parameter_writer(ta_parameter_buf); auto parameter = ta_parameter_writer(ta_parameter_buf);
uint32_t texture_address = (offsetof (struct texture_memory_alloc, texture));
for (uint32_t string_ix = 0; string_ix < len; string_ix++) { for (uint32_t string_ix = 0; string_ix < len; string_ix++) {
auto polygon = global_polygon_type_0(texture_address); const uint32_t parameter_control_word = para_control::para_type::polygon_or_modifier_volume
polygon.parameter_control_word = para_control::para_type::polygon_or_modifier_volume | para_control::list_type::opaque
| para_control::list_type::opaque | obj_control::col_type::packed_color
| obj_control::col_type::packed_color | obj_control::texture;
| obj_control::texture;
polygon.tsp_instruction_word = tsp_instruction_word::src_alpha_instr::one const uint32_t isp_tsp_instruction_word = isp_tsp_instruction_word::depth_compare_mode::greater
| tsp_instruction_word::dst_alpha_instr::zero | isp_tsp_instruction_word::culling_mode::no_culling;
| tsp_instruction_word::fog_control::no_fog
| tsp_instruction_word::texture_u_size::_8 // 8px
| tsp_instruction_word::texture_v_size::_8; // 8px
polygon.texture_control_word = texture_control_word::pixel_format::_4bpp_palette const uint32_t tsp_instruction_word = tsp_instruction_word::src_alpha_instr::one
| texture_control_word::scan_order::twiddled | tsp_instruction_word::dst_alpha_instr::zero
| texture_control_word::texture_address((texture_address + 8 * 8 * (s[string_ix] - ' ')) / 8); | tsp_instruction_word::fog_control::no_fog
parameter.append<global_polygon_type_0>() = polygon; | tsp_instruction_word::texture_u_size::from_int(8)
| tsp_instruction_word::texture_v_size::from_int(8);
const uint32_t texture_address = (offsetof (struct texture_memory_alloc, texture));
const uint32_t texture_control_word = texture_control_word::pixel_format::_4bpp_palette
| texture_control_word::scan_order::twiddled
| texture_control_word::texture_address((texture_address + 8 * 8 * (s[string_ix] - ' ')) / 8);
parameter.append<ta_global_parameter::polygon_type_0>() =
ta_global_parameter::polygon_type_0(parameter_control_word,
isp_tsp_instruction_word,
tsp_instruction_word,
texture_control_word,
0, // data_size_for_sort_dma
0 // next_address_for_sort_dma
);
for (uint32_t i = 0; i < strip_length; i++) { for (uint32_t i = 0; i < strip_length; i++) {
bool end_of_strip = i == strip_length - 1; bool end_of_strip = i == strip_length - 1;
@ -125,16 +137,18 @@ uint32_t transform(uint32_t * ta_parameter_buf, const char * s, const uint32_t l
y += 240.f; y += 240.f;
z = 1.f / (z + 10.f); z = 1.f / (z + 10.f);
parameter.append<vertex_polygon_type_3>() = parameter.append<ta_vertex_parameter::polygon_type_3>() =
vertex_polygon_type_3(x, y, z, ta_vertex_parameter::polygon_type_3(polygon_vertex_parameter_control_word(end_of_strip),
strip_vertices[i].u, x, y, z,
strip_vertices[i].v, strip_vertices[i].u,
0x00000000, // base_color strip_vertices[i].v,
end_of_strip); 0, // base_color
0 // offset_color
);
} }
} }
parameter.append<global_end_of_list>() = global_end_of_list(); parameter.append<ta_global_parameter::end_of_list>() = ta_global_parameter::end_of_list(para_control::para_type::end_of_list);
return parameter.offset; return parameter.offset;
} }
@ -236,8 +250,6 @@ void main()
, .punch_through = 0 , .punch_through = 0
}; };
constexpr uint32_t tiles = (640 / 32) * (320 / 32);
holly.SOFTRESET = softreset::pipeline_soft_reset holly.SOFTRESET = softreset::pipeline_soft_reset
| softreset::ta_soft_reset; | softreset::ta_soft_reset;
holly.SOFTRESET = 0; holly.SOFTRESET = 0;
@ -251,8 +263,10 @@ void main()
const char ana[18] = "A from ana i know"; const char ana[18] = "A from ana i know";
while (true) { while (true) {
ta_polygon_converter_init(opb_size.total() * tiles, ta_alloc, ta_polygon_converter_init(opb_size.total(),
640, 480); ta_alloc,
640 / 32,
480 / 32);
uint32_t ta_parameter_size = transform(ta_parameter_buf, ana, 17); uint32_t ta_parameter_size = transform(ta_parameter_buf, ana, 17);
ta_polygon_converter_transfer(ta_parameter_buf, ta_parameter_size); ta_polygon_converter_transfer(ta_parameter_buf, ta_parameter_size);
ta_wait_opaque_list(); ta_wait_opaque_list();

View File

@ -1,27 +1,27 @@
#include <cstdint> #include <cstdint>
#include "align.hpp" #include "align.hpp"
#include "vga.hpp" #include "vga.hpp"
#include "holly.hpp"
#include "holly/texture_memory_alloc.hpp"
#include "holly/holly.hpp"
#include "holly/core.hpp" #include "holly/core.hpp"
#include "holly/core_bits.hpp" #include "holly/core_bits.hpp"
#include "holly/ta_parameter.hpp"
#include "holly/ta_fifo_polygon_converter.hpp" #include "holly/ta_fifo_polygon_converter.hpp"
#include "holly/texture_memory_alloc.hpp" #include "holly/ta_parameter.hpp"
#include "holly/ta_global_parameter.hpp"
#include "holly/ta_vertex_parameter.hpp"
#include "holly/ta_bits.hpp"
#include "holly/isp_tsp.hpp"
#include "memorymap.hpp" #include "memorymap.hpp"
#include "holly/background.hpp" #include "holly/background.hpp"
#include "holly/region_array.hpp" #include "holly/region_array.hpp"
#include "holly/ta_bits.hpp"
#include "twiddle.hpp" #include "twiddle.hpp"
#include "serial.hpp"
#include "palette.hpp" #include "palette.hpp"
#include "font/font.hpp" #include "font/font.hpp"
#include "dejavusansmono.hpp" #include "dejavusansmono.hpp"
#include "sperrypc.hpp"
struct vertex { struct vertex {
float x; float x;
float y; float y;
@ -58,27 +58,35 @@ uint32_t transform(ta_parameter_writer& parameter,
continue; continue;
} }
auto polygon = global_polygon_type_0(texture_address); const uint32_t parameter_control_word = para_control::para_type::polygon_or_modifier_volume
polygon.parameter_control_word = para_control::para_type::polygon_or_modifier_volume | para_control::list_type::translucent
| para_control::list_type::translucent | obj_control::col_type::packed_color
| obj_control::col_type::packed_color | obj_control::texture;
| obj_control::texture;
polygon.tsp_instruction_word = tsp_instruction_word::src_alpha_instr::src_alpha const uint32_t isp_tsp_instruction_word = isp_tsp_instruction_word::depth_compare_mode::greater
| tsp_instruction_word::dst_alpha_instr::one | isp_tsp_instruction_word::culling_mode::no_culling;
| tsp_instruction_word::fog_control::no_fog
| tsp_instruction_word::use_alpha
| tsp_instruction_word::texture_u_size::from_int(texture_width)
| tsp_instruction_word::texture_v_size::from_int(texture_height);
polygon.texture_control_word = texture_control_word::pixel_format::_4bpp_palette const uint32_t tsp_instruction_word = tsp_instruction_word::src_alpha_instr::src_alpha
| texture_control_word::scan_order::twiddled | tsp_instruction_word::dst_alpha_instr::one
| texture_control_word::texture_address(texture_address / 8); | tsp_instruction_word::fog_control::no_fog
parameter.append<global_polygon_type_0>() = polygon; | tsp_instruction_word::use_alpha
| tsp_instruction_word::texture_u_size::from_int(texture_width)
| tsp_instruction_word::texture_v_size::from_int(texture_height);
const uint32_t texture_control_word = texture_control_word::pixel_format::_4bpp_palette
| texture_control_word::scan_order::twiddled
| texture_control_word::texture_address(texture_address / 8);
parameter.append<ta_global_parameter::polygon_type_0>() =
ta_global_parameter::polygon_type_0(parameter_control_word,
isp_tsp_instruction_word,
tsp_instruction_word,
texture_control_word,
0, // data_size_for_sort_dma
0 // next_address_for_sort_dma
);
for (uint32_t i = 0; i < strip_length; i++) { for (uint32_t i = 0; i < strip_length; i++) {
bool end_of_strip = i == strip_length - 1;
float x = strip_vertices[i].x; float x = strip_vertices[i].x;
float y = strip_vertices[i].y; float y = strip_vertices[i].y;
float z = strip_vertices[i].z; float z = strip_vertices[i].z;
@ -99,11 +107,14 @@ uint32_t transform(ta_parameter_writer& parameter,
u = u / static_cast<float>(texture_width); u = u / static_cast<float>(texture_width);
v = v / static_cast<float>(texture_height); v = v / static_cast<float>(texture_height);
parameter.append<vertex_polygon_type_3>() = bool end_of_strip = i == strip_length - 1;
vertex_polygon_type_3(x, y, z, parameter.append<ta_vertex_parameter::polygon_type_3>() =
u, v, ta_vertex_parameter::polygon_type_3(polygon_vertex_parameter_control_word(end_of_strip),
0x00000000, // base_color x, y, z,
end_of_strip); u, v,
0, // base_color
0 // offset_color
);
} }
advance += glyph.metrics.horiAdvance; advance += glyph.metrics.horiAdvance;
@ -117,26 +128,34 @@ uint32_t transform2(ta_parameter_writer& parameter,
{ {
uint32_t texture_address = (offsetof (struct texture_memory_alloc, texture)); uint32_t texture_address = (offsetof (struct texture_memory_alloc, texture));
auto polygon = global_polygon_type_0(texture_address); const uint32_t parameter_control_word = para_control::para_type::polygon_or_modifier_volume
polygon.parameter_control_word = para_control::para_type::polygon_or_modifier_volume | para_control::list_type::translucent
| para_control::list_type::translucent | obj_control::col_type::packed_color
| obj_control::col_type::packed_color | obj_control::texture;
| obj_control::texture;
polygon.tsp_instruction_word = tsp_instruction_word::src_alpha_instr::src_alpha const uint32_t isp_tsp_instruction_word = isp_tsp_instruction_word::depth_compare_mode::greater
| tsp_instruction_word::dst_alpha_instr::zero | isp_tsp_instruction_word::culling_mode::no_culling;
| tsp_instruction_word::fog_control::no_fog
| tsp_instruction_word::texture_u_size::from_int(texture_width)
| tsp_instruction_word::texture_v_size::from_int(texture_height);
polygon.texture_control_word = texture_control_word::pixel_format::_4bpp_palette const uint32_t tsp_instruction_word = tsp_instruction_word::src_alpha_instr::src_alpha
| texture_control_word::scan_order::twiddled | tsp_instruction_word::dst_alpha_instr::zero
| texture_control_word::texture_address(texture_address / 8); | tsp_instruction_word::fog_control::no_fog
parameter.append<global_polygon_type_0>() = polygon; | tsp_instruction_word::texture_u_size::from_int(texture_width)
| tsp_instruction_word::texture_v_size::from_int(texture_height);
const uint32_t texture_control_word = texture_control_word::pixel_format::_4bpp_palette
| texture_control_word::scan_order::twiddled
| texture_control_word::texture_address(texture_address / 8);
parameter.append<ta_global_parameter::polygon_type_0>() =
ta_global_parameter::polygon_type_0(parameter_control_word,
isp_tsp_instruction_word,
tsp_instruction_word,
texture_control_word,
0, // data_size_for_sort_dma
0 // next_address_for_sort_dma
);
for (uint32_t i = 0; i < strip_length; i++) { for (uint32_t i = 0; i < strip_length; i++) {
bool end_of_strip = i == strip_length - 1;
float x = strip_vertices[i].x; float x = strip_vertices[i].x;
float y = strip_vertices[i].y; float y = strip_vertices[i].y;
float z = strip_vertices[i].z; float z = strip_vertices[i].z;
@ -150,11 +169,14 @@ uint32_t transform2(ta_parameter_writer& parameter,
float u = strip_vertices[i].u; float u = strip_vertices[i].u;
float v = strip_vertices[i].v; float v = strip_vertices[i].v;
parameter.append<vertex_polygon_type_3>() = bool end_of_strip = i == strip_length - 1;
vertex_polygon_type_3(x, y, z, parameter.append<ta_vertex_parameter::polygon_type_3>() =
u, v, ta_vertex_parameter::polygon_type_3(polygon_vertex_parameter_control_word(end_of_strip),
0x00000000, // base_color x, y, z,
end_of_strip); u, v,
0, // base_color
0 // offset_color
);
} }
return parameter.offset; return parameter.offset;
@ -230,8 +252,6 @@ void main()
, .punch_through = 0 , .punch_through = 0
}; };
constexpr uint32_t tiles = (640 / 32) * (320 / 32);
holly.SOFTRESET = softreset::pipeline_soft_reset holly.SOFTRESET = softreset::pipeline_soft_reset
| softreset::ta_soft_reset; | softreset::ta_soft_reset;
holly.SOFTRESET = 0; holly.SOFTRESET = 0;
@ -246,8 +266,10 @@ void main()
const char cabal[27] = "where is this secret cabal"; const char cabal[27] = "where is this secret cabal";
while (true) { while (true) {
ta_polygon_converter_init(opb_size.total() * tiles, ta_alloc, ta_polygon_converter_init(opb_size.total(),
640, 480); ta_alloc,
640 / 32,
480 / 32);
auto parameter = ta_parameter_writer(ta_parameter_buf); auto parameter = ta_parameter_writer(ta_parameter_buf);
@ -268,7 +290,7 @@ void main()
cabal, 26, cabal, 26,
font->glyph_height * 1); font->glyph_height * 1);
parameter.append<global_end_of_list>() = global_end_of_list(); parameter.append<ta_global_parameter::end_of_list>() = ta_global_parameter::end_of_list(para_control::para_type::end_of_list);
ta_polygon_converter_transfer(ta_parameter_buf, parameter.offset); ta_polygon_converter_transfer(ta_parameter_buf, parameter.offset);
ta_wait_translucent_list(); ta_wait_translucent_list();

View File

@ -1,27 +1,27 @@
#include <cstdint> #include <cstdint>
#include "align.hpp" #include "align.hpp"
#include "vga.hpp" #include "vga.hpp"
#include "holly.hpp"
#include "holly/texture_memory_alloc.hpp"
#include "holly/holly.hpp"
#include "holly/core.hpp" #include "holly/core.hpp"
#include "holly/core_bits.hpp" #include "holly/core_bits.hpp"
#include "holly/ta_parameter.hpp"
#include "holly/ta_fifo_polygon_converter.hpp" #include "holly/ta_fifo_polygon_converter.hpp"
#include "holly/texture_memory_alloc.hpp" #include "holly/ta_parameter.hpp"
#include "holly/ta_global_parameter.hpp"
#include "holly/ta_vertex_parameter.hpp"
#include "holly/ta_bits.hpp"
#include "holly/isp_tsp.hpp"
#include "memorymap.hpp" #include "memorymap.hpp"
#include "holly/background.hpp" #include "holly/background.hpp"
#include "holly/region_array.hpp" #include "holly/region_array.hpp"
#include "holly/ta_bits.hpp"
#include "twiddle.hpp" #include "twiddle.hpp"
#include "serial.hpp"
#include "palette.hpp" #include "palette.hpp"
#include "font/font.hpp" #include "font/font.hpp"
#include "dejavusansmono_mono.hpp" #include "dejavusansmono_mono.hpp"
#include "sperrypc.hpp"
struct vertex { struct vertex {
float x; float x;
float y; float y;
@ -58,27 +58,34 @@ uint32_t transform(ta_parameter_writer& parameter,
continue; continue;
} }
auto polygon = global_polygon_type_0(texture_address); const uint32_t parameter_control_word = para_control::para_type::polygon_or_modifier_volume
polygon.parameter_control_word = para_control::para_type::polygon_or_modifier_volume | para_control::list_type::punch_through
| para_control::list_type::punch_through | obj_control::col_type::packed_color
| obj_control::col_type::packed_color | obj_control::texture;
| obj_control::texture;
polygon.tsp_instruction_word = tsp_instruction_word::src_alpha_instr::src_alpha const uint32_t isp_tsp_instruction_word = isp_tsp_instruction_word::depth_compare_mode::greater
| tsp_instruction_word::dst_alpha_instr::one | isp_tsp_instruction_word::culling_mode::no_culling;
| tsp_instruction_word::fog_control::no_fog
//| tsp_instruction_word::use_alpha
| tsp_instruction_word::texture_u_size::from_int(texture_width)
| tsp_instruction_word::texture_v_size::from_int(texture_height);
polygon.texture_control_word = texture_control_word::pixel_format::_4bpp_palette const uint32_t tsp_instruction_word = tsp_instruction_word::src_alpha_instr::src_alpha
| texture_control_word::scan_order::twiddled | tsp_instruction_word::dst_alpha_instr::zero
| texture_control_word::texture_address(texture_address / 8); | tsp_instruction_word::fog_control::no_fog
parameter.append<global_polygon_type_0>() = polygon; | tsp_instruction_word::texture_u_size::from_int(texture_width)
| tsp_instruction_word::texture_v_size::from_int(texture_height);
const uint32_t texture_control_word = texture_control_word::pixel_format::_4bpp_palette
| texture_control_word::scan_order::twiddled
| texture_control_word::texture_address(texture_address / 8);
parameter.append<ta_global_parameter::polygon_type_0>() =
ta_global_parameter::polygon_type_0(parameter_control_word,
isp_tsp_instruction_word,
tsp_instruction_word,
texture_control_word,
0, // data_size_for_sort_dma
0 // next_address_for_sort_dma
);
for (uint32_t i = 0; i < strip_length; i++) { for (uint32_t i = 0; i < strip_length; i++) {
bool end_of_strip = i == strip_length - 1;
float x = strip_vertices[i].x; float x = strip_vertices[i].x;
float y = strip_vertices[i].y; float y = strip_vertices[i].y;
float z = strip_vertices[i].z; float z = strip_vertices[i].z;
@ -99,11 +106,14 @@ uint32_t transform(ta_parameter_writer& parameter,
u = u / static_cast<float>(texture_width); u = u / static_cast<float>(texture_width);
v = v / static_cast<float>(texture_height); v = v / static_cast<float>(texture_height);
parameter.append<vertex_polygon_type_3>() = bool end_of_strip = i == strip_length - 1;
vertex_polygon_type_3(x, y, z, parameter.append<ta_vertex_parameter::polygon_type_3>() =
u, v, ta_vertex_parameter::polygon_type_3(polygon_vertex_parameter_control_word(end_of_strip),
0x00000000, // base_color x, y, z,
end_of_strip); u, v,
0, // base_color
0 // offset_color
);
} }
advance += glyph.metrics.horiAdvance; advance += glyph.metrics.horiAdvance;
@ -117,26 +127,34 @@ uint32_t transform2(ta_parameter_writer& parameter,
{ {
uint32_t texture_address = (offsetof (struct texture_memory_alloc, texture)); uint32_t texture_address = (offsetof (struct texture_memory_alloc, texture));
auto polygon = global_polygon_type_0(texture_address); const uint32_t parameter_control_word = para_control::para_type::polygon_or_modifier_volume
polygon.parameter_control_word = para_control::para_type::polygon_or_modifier_volume | para_control::list_type::opaque
| para_control::list_type::opaque | obj_control::col_type::packed_color
| obj_control::col_type::packed_color | obj_control::texture;
| obj_control::texture;
polygon.tsp_instruction_word = tsp_instruction_word::src_alpha_instr::src_alpha const uint32_t isp_tsp_instruction_word = isp_tsp_instruction_word::depth_compare_mode::greater
| tsp_instruction_word::dst_alpha_instr::zero | isp_tsp_instruction_word::culling_mode::no_culling;
| tsp_instruction_word::fog_control::no_fog
| tsp_instruction_word::texture_u_size::from_int(texture_width)
| tsp_instruction_word::texture_v_size::from_int(texture_height);
polygon.texture_control_word = texture_control_word::pixel_format::_4bpp_palette const uint32_t tsp_instruction_word = tsp_instruction_word::src_alpha_instr::src_alpha
| texture_control_word::scan_order::twiddled | tsp_instruction_word::dst_alpha_instr::zero
| texture_control_word::texture_address(texture_address / 8); | tsp_instruction_word::fog_control::no_fog
parameter.append<global_polygon_type_0>() = polygon; | tsp_instruction_word::texture_u_size::from_int(texture_width)
| tsp_instruction_word::texture_v_size::from_int(texture_height);
const uint32_t texture_control_word = texture_control_word::pixel_format::_4bpp_palette
| texture_control_word::scan_order::twiddled
| texture_control_word::texture_address(texture_address / 8);
parameter.append<ta_global_parameter::polygon_type_0>() =
ta_global_parameter::polygon_type_0(parameter_control_word,
isp_tsp_instruction_word,
tsp_instruction_word,
texture_control_word,
0, // data_size_for_sort_dma
0 // next_address_for_sort_dma
);
for (uint32_t i = 0; i < strip_length; i++) { for (uint32_t i = 0; i < strip_length; i++) {
bool end_of_strip = i == strip_length - 1;
float x = strip_vertices[i].x; float x = strip_vertices[i].x;
float y = strip_vertices[i].y; float y = strip_vertices[i].y;
float z = strip_vertices[i].z; float z = strip_vertices[i].z;
@ -150,11 +168,14 @@ uint32_t transform2(ta_parameter_writer& parameter,
float u = strip_vertices[i].u; float u = strip_vertices[i].u;
float v = strip_vertices[i].v; float v = strip_vertices[i].v;
parameter.append<vertex_polygon_type_3>() = bool end_of_strip = i == strip_length - 1;
vertex_polygon_type_3(x, y, z, parameter.append<ta_vertex_parameter::polygon_type_3>() =
u, v, ta_vertex_parameter::polygon_type_3(polygon_vertex_parameter_control_word(end_of_strip),
0x00000000, // base_color x, y, z,
end_of_strip); u, v,
0, // base_color
0 // offset_color
);
} }
return parameter.offset; return parameter.offset;
@ -234,8 +255,6 @@ void main()
, .punch_through = 16 * 4 , .punch_through = 16 * 4
}; };
constexpr uint32_t tiles = (640 / 32) * (320 / 32);
holly.SOFTRESET = softreset::pipeline_soft_reset holly.SOFTRESET = softreset::pipeline_soft_reset
| softreset::ta_soft_reset; | softreset::ta_soft_reset;
holly.SOFTRESET = 0; holly.SOFTRESET = 0;
@ -251,15 +270,17 @@ void main()
const char cabal[27] = "where is this secret cabal"; const char cabal[27] = "where is this secret cabal";
while (true) { while (true) {
ta_polygon_converter_init(opb_size.total() * tiles, ta_alloc, ta_polygon_converter_init(opb_size.total(),
640, 480); ta_alloc,
640 / 32,
480 / 32);
auto parameter = ta_parameter_writer(ta_parameter_buf); auto parameter = ta_parameter_writer(ta_parameter_buf);
transform2(parameter, transform2(parameter,
font->texture_width, font->texture_height); font->texture_width, font->texture_height);
parameter.append<global_end_of_list>() = global_end_of_list(); parameter.append<ta_global_parameter::end_of_list>() = ta_global_parameter::end_of_list(para_control::para_type::end_of_list);
transform(parameter, transform(parameter,
font->texture_width, font->texture_height, font->texture_width, font->texture_height,
@ -275,7 +296,7 @@ void main()
cabal, 26, cabal, 26,
font->glyph_height * 1); font->glyph_height * 1);
parameter.append<global_end_of_list>() = global_end_of_list(); parameter.append<ta_global_parameter::end_of_list>() = ta_global_parameter::end_of_list(para_control::para_type::end_of_list);
ta_polygon_converter_transfer(ta_parameter_buf, parameter.offset); ta_polygon_converter_transfer(ta_parameter_buf, parameter.offset);
ta_wait_punch_through_list(); ta_wait_punch_through_list();

View File

@ -1,19 +1,21 @@
#include <cstdint> #include <cstdint>
#include "align.hpp" #include "align.hpp"
#include "vga.hpp" #include "vga.hpp"
#include "holly.hpp"
#include "holly/holly.hpp"
#include "holly/core.hpp" #include "holly/core.hpp"
#include "holly/core_bits.hpp" #include "holly/core_bits.hpp"
#include "holly/ta_fifo_polygon_converter.hpp" #include "holly/ta_fifo_polygon_converter.hpp"
#include "holly/ta_parameter.hpp" #include "holly/ta_parameter.hpp"
#include "holly/ta_global_parameter.hpp"
#include "holly/ta_vertex_parameter.hpp"
#include "holly/isp_tsp.hpp"
#include "holly/ta_bits.hpp" #include "holly/ta_bits.hpp"
#include "holly/region_array.hpp" #include "holly/region_array.hpp"
#include "holly/background.hpp" #include "holly/background.hpp"
#include "holly/texture_memory_alloc.hpp" #include "holly/texture_memory_alloc.hpp"
#include "memorymap.hpp" #include "memorymap.hpp"
#include "serial.hpp"
#include "geometry/icosphere.hpp" #include "geometry/icosphere.hpp"
#include "geometry/suzanne.hpp" #include "geometry/suzanne.hpp"
@ -21,7 +23,7 @@
constexpr float half_degree = 0.01745329f / 2; constexpr float half_degree = 0.01745329f / 2;
#define MODEL suzanne #define MODEL icosphere
vec3 rotate(const vec3& vertex, vec3 rotate(const vec3& vertex,
const float theta) const float theta)
@ -61,16 +63,18 @@ void transform(ta_parameter_writer& parameter,
| tsp_instruction_word::dst_alpha_instr::zero | tsp_instruction_word::dst_alpha_instr::zero
| tsp_instruction_word::fog_control::no_fog; | tsp_instruction_word::fog_control::no_fog;
parameter.append<global_polygon_type_0>() = global_polygon_type_0(parameter_control_word, parameter.append<ta_global_parameter::polygon_type_0>() =
isp_tsp_instruction_word, ta_global_parameter::polygon_type_0(parameter_control_word,
tsp_instruction_word, isp_tsp_instruction_word,
0); tsp_instruction_word,
0, // texture_control_word
0, // data_size_for_sort_dma
0 // next_address_for_sort_dma
);
auto& face = MODEL::faces[face_ix]; auto& face = MODEL::faces[face_ix];
constexpr uint32_t strip_length = 3; constexpr uint32_t strip_length = 3;
for (uint32_t i = 0; i < strip_length; i++) { for (uint32_t i = 0; i < strip_length; i++) {
bool end_of_strip = i == strip_length - 1;
// world transform // world transform
uint32_t vertex_ix = face[i].vertex; uint32_t vertex_ix = face[i].vertex;
auto& vertex = MODEL::vertices[vertex_ix]; auto& vertex = MODEL::vertices[vertex_ix];
@ -130,13 +134,15 @@ void transform(ta_parameter_writer& parameter,
y += 240.f; y += 240.f;
z = 1 / z; z = 1 / z;
parameter.append<vertex_polygon_type_1>() = bool end_of_strip = i == strip_length - 1;
vertex_polygon_type_1(x, y, z, parameter.append<ta_vertex_parameter::polygon_type_1>() =
color.w, // alpha ta_vertex_parameter::polygon_type_1(polygon_vertex_parameter_control_word(end_of_strip),
color.x, // r x, y, z,
color.y, // g color.w, // alpha
color.z, // b color.x, // r
end_of_strip); color.y, // g
color.z // b
);
} }
} }
@ -156,10 +162,14 @@ void transform2(ta_parameter_writer& parameter,
| tsp_instruction_word::dst_alpha_instr::zero | tsp_instruction_word::dst_alpha_instr::zero
| tsp_instruction_word::fog_control::no_fog; | tsp_instruction_word::fog_control::no_fog;
parameter.append<global_polygon_type_0>() = global_polygon_type_0(parameter_control_word, parameter.append<ta_global_parameter::polygon_type_0>() =
isp_tsp_instruction_word, ta_global_parameter::polygon_type_0(parameter_control_word,
tsp_instruction_word, isp_tsp_instruction_word,
0); tsp_instruction_word,
0, // texture_control_word
0, // data_size_for_sort_dma
0 // next_address_for_sort_dma
);
constexpr vec3 triangle[] = { constexpr vec3 triangle[] = {
{ 0.f, -1.f, 0.f}, { 0.f, -1.f, 0.f},
@ -169,7 +179,6 @@ void transform2(ta_parameter_writer& parameter,
constexpr uint32_t strip_length = 3; constexpr uint32_t strip_length = 3;
for (uint32_t i = 0; i < strip_length; i++) { for (uint32_t i = 0; i < strip_length; i++) {
bool end_of_strip = i == strip_length - 1;
float x = triangle[i].x; float x = triangle[i].x;
float y = triangle[i].y; float y = triangle[i].y;
float z = triangle[i].z; float z = triangle[i].z;
@ -196,13 +205,15 @@ void transform2(ta_parameter_writer& parameter,
y += 240.f; y += 240.f;
z = 1 / z; z = 1 / z;
parameter.append<vertex_polygon_type_1>() = bool end_of_strip = i == strip_length - 1;
vertex_polygon_type_1(x, y, z, parameter.append<ta_vertex_parameter::polygon_type_1>() =
color.w, // alpha ta_vertex_parameter::polygon_type_1(polygon_vertex_parameter_control_word(end_of_strip),
color.x, // r x, y, z,
color.y, // g color.w, // alpha
color.z, // b color.x, // r
end_of_strip); color.y, // g
color.z // b
);
} }
} }
@ -285,7 +296,7 @@ void main()
transform2(parameter, lights[1], {0.f, 1.f, 0.f, 1.f}); transform2(parameter, lights[1], {0.f, 1.f, 0.f, 1.f});
transform2(parameter, lights[2], {0.f, 0.f, 1.f, 1.f}); transform2(parameter, lights[2], {0.f, 0.f, 1.f, 1.f});
parameter.append<global_end_of_list>() = global_end_of_list(); parameter.append<ta_global_parameter::end_of_list>() = ta_global_parameter::end_of_list(para_control::para_type::end_of_list);
ta_polygon_converter_transfer(ta_parameter_buf, parameter.offset); ta_polygon_converter_transfer(ta_parameter_buf, parameter.offset);
ta_wait_opaque_list(); ta_wait_opaque_list();
core_start_render(frame_ix, num_frames); core_start_render(frame_ix, num_frames);

View File

@ -4,12 +4,15 @@
#include "vga.hpp" #include "vga.hpp"
#include "holly/texture_memory_alloc.hpp" #include "holly/texture_memory_alloc.hpp"
#include "holly.hpp" #include "holly/holly.hpp"
#include "holly/core.hpp" #include "holly/core.hpp"
#include "holly/core_bits.hpp" #include "holly/core_bits.hpp"
#include "holly/ta_fifo_polygon_converter.hpp" #include "holly/ta_fifo_polygon_converter.hpp"
#include "holly/ta_parameter.hpp" #include "holly/ta_parameter.hpp"
#include "holly/ta_global_parameter.hpp"
#include "holly/ta_vertex_parameter.hpp"
#include "holly/ta_bits.hpp" #include "holly/ta_bits.hpp"
#include "holly/isp_tsp.hpp"
#include "holly/region_array.hpp" #include "holly/region_array.hpp"
#include "holly/background.hpp" #include "holly/background.hpp"
#include "memorymap.hpp" #include "memorymap.hpp"
@ -38,16 +41,39 @@ static float theta = 0;
constexpr float half_degree = 0.01745329f / 2.f; constexpr float half_degree = 0.01745329f / 2.f;
uint32_t transform(uint32_t * ta_parameter_buf, uint32_t transform(uint32_t * ta_parameter_buf,
const vertex * strip_vertices, const vertex * strip_vertices,
const uint32_t strip_length) const uint32_t strip_length)
{ {
auto parameter = ta_parameter_writer(ta_parameter_buf); auto parameter = ta_parameter_writer(ta_parameter_buf);
uint32_t texture_address = (offsetof (struct texture_memory_alloc, texture)); const uint32_t parameter_control_word = para_control::para_type::polygon_or_modifier_volume
parameter.append<global_polygon_type_0>() = global_polygon_type_0(texture_address); | para_control::list_type::opaque
| obj_control::col_type::packed_color
| obj_control::texture;
const uint32_t isp_tsp_instruction_word = isp_tsp_instruction_word::depth_compare_mode::greater
| isp_tsp_instruction_word::culling_mode::no_culling;
const uint32_t tsp_instruction_word = tsp_instruction_word::src_alpha_instr::one
| tsp_instruction_word::dst_alpha_instr::zero
| tsp_instruction_word::fog_control::no_fog
| tsp_instruction_word::texture_u_size::from_int(128)
| tsp_instruction_word::texture_v_size::from_int(128);
const uint32_t texture_address = (offsetof (struct texture_memory_alloc, texture));
const uint32_t texture_control_word = texture_control_word::pixel_format::_565
| texture_control_word::scan_order::non_twiddled
| texture_control_word::texture_address(texture_address / 8);
parameter.append<ta_global_parameter::polygon_type_0>() =
ta_global_parameter::polygon_type_0(parameter_control_word,
isp_tsp_instruction_word,
tsp_instruction_word,
texture_control_word,
0, // data_size_for_sort_dma
0 // next_address_for_sort_dma
);
for (uint32_t i = 0; i < strip_length; i++) { for (uint32_t i = 0; i < strip_length; i++) {
bool end_of_strip = i == strip_length - 1;
float x = strip_vertices[i].x; float x = strip_vertices[i].x;
float y = strip_vertices[i].y; float y = strip_vertices[i].y;
float z = strip_vertices[i].z; float z = strip_vertices[i].z;
@ -62,15 +88,18 @@ uint32_t transform(uint32_t * ta_parameter_buf,
y += 240.f; y += 240.f;
z = 1.f / (z + 10.f); z = 1.f / (z + 10.f);
parameter.append<vertex_polygon_type_3>() = bool end_of_strip = i == strip_length - 1;
vertex_polygon_type_3(x, y, z, parameter.append<ta_vertex_parameter::polygon_type_3>() =
strip_vertices[i].u, ta_vertex_parameter::polygon_type_3(polygon_vertex_parameter_control_word(end_of_strip),
strip_vertices[i].v, x, y, z,
strip_vertices[i].color, strip_vertices[i].u,
end_of_strip); strip_vertices[i].v,
strip_vertices[i].color,
0 // offset_color
);
} }
parameter.append<global_end_of_list>() = global_end_of_list(); parameter.append<ta_global_parameter::end_of_list>() = ta_global_parameter::end_of_list(para_control::para_type::end_of_list);
return parameter.offset; return parameter.offset;
} }
@ -79,14 +108,14 @@ void init_texture_memory(const struct opb_size& opb_size)
{ {
auto mem = reinterpret_cast<volatile texture_memory_alloc *>(texture_memory32); auto mem = reinterpret_cast<volatile texture_memory_alloc *>(texture_memory32);
background_parameter(mem->background); background_parameter(mem->background, 0xff00ff00);
region_array2(mem->region_array, region_array2(mem->region_array,
(offsetof (struct texture_memory_alloc, object_list)), (offsetof (struct texture_memory_alloc, object_list)),
640 / 32, // width 640 / 32, // width
480 / 32, // height 480 / 32, // height
opb_size opb_size
); );
} }
void copy_macaw_texture() void copy_macaw_texture()
@ -116,22 +145,20 @@ void main()
uint32_t * ta_parameter_buf = align_32byte(_ta_parameter_buf); uint32_t * ta_parameter_buf = align_32byte(_ta_parameter_buf);
constexpr uint32_t ta_alloc = ta_alloc_ctrl::pt_opb::no_list constexpr uint32_t ta_alloc = ta_alloc_ctrl::pt_opb::no_list
| ta_alloc_ctrl::tm_opb::no_list | ta_alloc_ctrl::tm_opb::no_list
| ta_alloc_ctrl::t_opb::no_list | ta_alloc_ctrl::t_opb::no_list
| ta_alloc_ctrl::om_opb::no_list | ta_alloc_ctrl::om_opb::no_list
| ta_alloc_ctrl::o_opb::_16x4byte; | ta_alloc_ctrl::o_opb::_16x4byte;
constexpr struct opb_size opb_size = { .opaque = 16 * 4 constexpr struct opb_size opb_size = { .opaque = 16 * 4
, .opaque_modifier = 0 , .opaque_modifier = 0
, .translucent = 0 , .translucent = 0
, .translucent_modifier = 0 , .translucent_modifier = 0
, .punch_through = 0 , .punch_through = 0
}; };
constexpr uint32_t tiles = (640 / 32) * (320 / 32);
holly.SOFTRESET = softreset::pipeline_soft_reset holly.SOFTRESET = softreset::pipeline_soft_reset
| softreset::ta_soft_reset; | softreset::ta_soft_reset;
holly.SOFTRESET = 0; holly.SOFTRESET = 0;
core_init(); core_init();
@ -141,7 +168,10 @@ void main()
constexpr uint32_t num_frames = 1; constexpr uint32_t num_frames = 1;
while (true) { while (true) {
ta_polygon_converter_init(opb_size.total() * tiles, ta_alloc); ta_polygon_converter_init(opb_size.total(),
ta_alloc,
640 / 32,
480 / 32);
uint32_t ta_parameter_size = transform(ta_parameter_buf, strip_vertices, strip_length); uint32_t ta_parameter_size = transform(ta_parameter_buf, strip_vertices, strip_length);
ta_polygon_converter_transfer(ta_parameter_buf, ta_parameter_size); ta_polygon_converter_transfer(ta_parameter_buf, ta_parameter_size);
ta_wait_opaque_list(); ta_wait_opaque_list();

View File

@ -1,21 +1,22 @@
#include <cstdint> #include <cstdint>
#include "align.hpp" #include "align.hpp"
#include "vga.hpp" #include "vga.hpp"
#include "holly.hpp"
#include "holly/texture_memory_alloc.hpp"
#include "holly/holly.hpp"
#include "holly/core.hpp" #include "holly/core.hpp"
#include "holly/core_bits.hpp" #include "holly/core_bits.hpp"
#include "holly/ta_fifo_polygon_converter.hpp" #include "holly/ta_fifo_polygon_converter.hpp"
#include "holly/ta_parameter.hpp" #include "holly/ta_parameter.hpp"
#include "holly/ta_global_parameter.hpp"
#include "holly/ta_vertex_parameter.hpp"
#include "holly/ta_bits.hpp" #include "holly/ta_bits.hpp"
#include "holly/isp_tsp.hpp"
#include "holly/region_array.hpp" #include "holly/region_array.hpp"
#include "holly/background.hpp" #include "holly/background.hpp"
#include "holly/texture_memory_alloc.hpp"
#include "memorymap.hpp" #include "memorymap.hpp"
#include "serial.hpp"
#include "macaw.hpp" #include "macaw.hpp"
struct vertex { struct vertex {
@ -63,12 +64,35 @@ void transform(ta_parameter_writer& parameter,
const vertex * strip_vertices, const vertex * strip_vertices,
const uint32_t strip_length) const uint32_t strip_length)
{ {
uint32_t texture_address = (offsetof (struct texture_memory_alloc, texture)); const uint32_t parameter_control_word = para_control::para_type::polygon_or_modifier_volume
parameter.append<global_polygon_type_0>() = global_polygon_type_0(); | para_control::list_type::opaque
| obj_control::col_type::packed_color
| obj_control::texture;
const uint32_t isp_tsp_instruction_word = isp_tsp_instruction_word::depth_compare_mode::greater
| isp_tsp_instruction_word::culling_mode::no_culling;
const uint32_t tsp_instruction_word = tsp_instruction_word::src_alpha_instr::one
| tsp_instruction_word::dst_alpha_instr::zero
| tsp_instruction_word::fog_control::no_fog
| tsp_instruction_word::texture_u_size::from_int(128)
| tsp_instruction_word::texture_v_size::from_int(128);
const uint32_t texture_address = (offsetof (struct texture_memory_alloc, texture));
const uint32_t texture_control_word = texture_control_word::pixel_format::_565
| texture_control_word::scan_order::non_twiddled
| texture_control_word::texture_address(texture_address / 8);
parameter.append<ta_global_parameter::polygon_type_0>() =
ta_global_parameter::polygon_type_0(parameter_control_word,
isp_tsp_instruction_word,
tsp_instruction_word,
texture_control_word,
0, // data_size_for_sort_dma
0 // next_address_for_sort_dma
);
for (uint32_t i = 0; i < strip_length; i++) { for (uint32_t i = 0; i < strip_length; i++) {
bool end_of_strip = i == strip_length - 1;
float x = strip_vertices[i].x; float x = strip_vertices[i].x;
float y = strip_vertices[i].y; float y = strip_vertices[i].y;
float z = strip_vertices[i].z; float z = strip_vertices[i].z;
@ -98,12 +122,15 @@ void transform(ta_parameter_writer& parameter,
z = 1 / z; z = 1 / z;
parameter.append<vertex_polygon_type_0>() = bool end_of_strip = i == strip_length - 1;
vertex_polygon_type_0(x, y, z, parameter.append<ta_vertex_parameter::polygon_type_3>() =
//strip_vertices[i].u, ta_vertex_parameter::polygon_type_3(polygon_vertex_parameter_control_word(end_of_strip),
//strip_vertices[i].v, x, y, z,
color, strip_vertices[i].u,
end_of_strip); strip_vertices[i].v,
0, // base_color
0 // offset_color
);
} }
} }
@ -160,8 +187,6 @@ void main()
, .punch_through = 0 , .punch_through = 0
}; };
constexpr uint32_t tiles = (640 / 32) * (320 / 32);
holly.SOFTRESET = softreset::pipeline_soft_reset holly.SOFTRESET = softreset::pipeline_soft_reset
| softreset::ta_soft_reset; | softreset::ta_soft_reset;
holly.SOFTRESET = 0; holly.SOFTRESET = 0;
@ -173,12 +198,16 @@ void main()
constexpr uint32_t num_frames = 1; constexpr uint32_t num_frames = 1;
while (1) { while (1) {
ta_polygon_converter_init(opb_size.total() * tiles, ta_alloc, 640, 480); ta_polygon_converter_init(opb_size.total(),
ta_alloc,
640 / 32,
480 / 32);
auto parameter = ta_parameter_writer(ta_parameter_buf); auto parameter = ta_parameter_writer(ta_parameter_buf);
for (uint32_t i = 0; i < num_faces; i++) { for (uint32_t i = 0; i < num_faces; i++) {
transform(parameter, cube_faces[i], 4); transform(parameter, cube_faces[i], 4);
} }
parameter.append<global_end_of_list>() = global_end_of_list(); parameter.append<ta_global_parameter::end_of_list>() = ta_global_parameter::end_of_list(para_control::para_type::end_of_list);
ta_polygon_converter_transfer(ta_parameter_buf, parameter.offset); ta_polygon_converter_transfer(ta_parameter_buf, parameter.offset);
ta_wait_opaque_list(); ta_wait_opaque_list();
core_start_render(frame_ix, num_frames); core_start_render(frame_ix, num_frames);

View File

@ -1,21 +1,22 @@
#include <cstdint> #include <cstdint>
#include "align.hpp" #include "align.hpp"
#include "vga.hpp" #include "vga.hpp"
#include "holly.hpp"
#include "holly/texture_memory_alloc.hpp"
#include "holly/holly.hpp"
#include "holly/core.hpp" #include "holly/core.hpp"
#include "holly/core_bits.hpp" #include "holly/core_bits.hpp"
#include "holly/ta_fifo_polygon_converter.hpp" #include "holly/ta_fifo_polygon_converter.hpp"
#include "holly/ta_parameter.hpp" #include "holly/ta_parameter.hpp"
#include "holly/ta_global_parameter.hpp"
#include "holly/ta_vertex_parameter.hpp"
#include "holly/ta_bits.hpp" #include "holly/ta_bits.hpp"
#include "holly/isp_tsp.hpp"
#include "holly/region_array.hpp" #include "holly/region_array.hpp"
#include "holly/background.hpp" #include "holly/background.hpp"
#include "holly/texture_memory_alloc.hpp"
#include "memorymap.hpp" #include "memorymap.hpp"
#include "serial.hpp"
#include "macaw.hpp" #include "macaw.hpp"
struct vertex { struct vertex {
@ -67,51 +68,71 @@ void transform(ta_parameter_writer& parameter,
const uint32_t texture_address, const uint32_t texture_address,
const uint32_t texture_width) const uint32_t texture_width)
{ {
auto polygon = global_polygon_type_0(texture_address); const uint32_t parameter_control_word = para_control::para_type::polygon_or_modifier_volume
| para_control::list_type::opaque
| obj_control::col_type::packed_color
| obj_control::texture;
const uint32_t isp_tsp_instruction_word = isp_tsp_instruction_word::depth_compare_mode::greater
| isp_tsp_instruction_word::culling_mode::no_culling;
const uint32_t texture_control_word = texture_control_word::pixel_format::_565
| texture_control_word::scan_order::non_twiddled
| texture_control_word::texture_address(texture_address / 8);
uint32_t tsp_instruction_word = 0;
switch (texture_width) { switch (texture_width) {
case 32: case 32:
polygon.tsp_instruction_word = tsp_instruction_word::src_alpha_instr::one tsp_instruction_word = tsp_instruction_word::src_alpha_instr::one
| tsp_instruction_word::dst_alpha_instr::zero | tsp_instruction_word::dst_alpha_instr::zero
| tsp_instruction_word::fog_control::no_fog | tsp_instruction_word::fog_control::no_fog
| tsp_instruction_word::texture_u_size::_32 | tsp_instruction_word::texture_u_size::from_int(32)
| tsp_instruction_word::texture_v_size::_32 | tsp_instruction_word::texture_v_size::from_int(32)
| tsp_instruction_word::use_alpha; | tsp_instruction_word::use_alpha;
break; break;
case 64: case 64:
polygon.tsp_instruction_word = tsp_instruction_word::src_alpha_instr::one tsp_instruction_word = tsp_instruction_word::src_alpha_instr::one
| tsp_instruction_word::dst_alpha_instr::zero | tsp_instruction_word::dst_alpha_instr::zero
| tsp_instruction_word::fog_control::no_fog | tsp_instruction_word::fog_control::no_fog
| tsp_instruction_word::texture_u_size::_64 | tsp_instruction_word::texture_u_size::from_int(64)
| tsp_instruction_word::texture_v_size::_64 | tsp_instruction_word::texture_v_size::from_int(64)
| tsp_instruction_word::use_alpha; | tsp_instruction_word::use_alpha;
break; break;
case 128: case 128:
polygon.tsp_instruction_word = tsp_instruction_word::src_alpha_instr::one tsp_instruction_word = tsp_instruction_word::src_alpha_instr::one
| tsp_instruction_word::dst_alpha_instr::zero | tsp_instruction_word::dst_alpha_instr::zero
| tsp_instruction_word::fog_control::no_fog | tsp_instruction_word::fog_control::no_fog
| tsp_instruction_word::texture_u_size::_128 | tsp_instruction_word::texture_u_size::from_int(128)
| tsp_instruction_word::texture_v_size::_128 | tsp_instruction_word::texture_v_size::from_int(128)
| tsp_instruction_word::use_alpha; | tsp_instruction_word::use_alpha;
break; break;
case 256: case 256:
polygon.tsp_instruction_word = tsp_instruction_word::src_alpha_instr::one tsp_instruction_word = tsp_instruction_word::src_alpha_instr::one
| tsp_instruction_word::dst_alpha_instr::zero | tsp_instruction_word::dst_alpha_instr::zero
| tsp_instruction_word::fog_control::no_fog | tsp_instruction_word::fog_control::no_fog
| tsp_instruction_word::texture_u_size::_256 | tsp_instruction_word::texture_u_size::from_int(256)
| tsp_instruction_word::texture_v_size::_256 | tsp_instruction_word::texture_v_size::from_int(256)
| tsp_instruction_word::use_alpha; | tsp_instruction_word::use_alpha;
break; break;
case 512: case 512:
polygon.tsp_instruction_word = tsp_instruction_word::src_alpha_instr::one tsp_instruction_word = tsp_instruction_word::src_alpha_instr::one
| tsp_instruction_word::dst_alpha_instr::zero | tsp_instruction_word::dst_alpha_instr::zero
| tsp_instruction_word::fog_control::no_fog | tsp_instruction_word::fog_control::no_fog
| tsp_instruction_word::texture_u_size::_512 | tsp_instruction_word::texture_u_size::from_int(512)
| tsp_instruction_word::texture_v_size::_512 | tsp_instruction_word::texture_v_size::from_int(512)
| tsp_instruction_word::use_alpha; | tsp_instruction_word::use_alpha;
break; break;
default: break; default: break;
} }
parameter.append<global_polygon_type_0>() = polygon;
parameter.append<ta_global_parameter::polygon_type_0>() =
ta_global_parameter::polygon_type_0(parameter_control_word,
isp_tsp_instruction_word,
tsp_instruction_word,
texture_control_word,
0, // data_size_for_sort_dma
0 // next_address_for_sort_dma
);
for (uint32_t i = 0; i < strip_length; i++) { for (uint32_t i = 0; i < strip_length; i++) {
bool end_of_strip = i == strip_length - 1; bool end_of_strip = i == strip_length - 1;
@ -144,12 +165,14 @@ void transform(ta_parameter_writer& parameter,
z = 1 / z; z = 1 / z;
parameter.append<vertex_polygon_type_3>() = parameter.append<ta_vertex_parameter::polygon_type_3>() =
vertex_polygon_type_3(x, y, z, ta_vertex_parameter::polygon_type_3(polygon_vertex_parameter_control_word(end_of_strip),
strip_vertices[i].u, x, y, z,
strip_vertices[i].v, strip_vertices[i].u,
color, strip_vertices[i].v,
end_of_strip); 0, // base_color
0 // offset_color
);
} }
} }
@ -186,9 +209,10 @@ void render(const uint32_t width, const uint32_t height,
const uint32_t texture_width, const uint32_t texture_width,
uint32_t * ta_parameter_buf) uint32_t * ta_parameter_buf)
{ {
const uint32_t tiles = (width / 32) * (height / 32); ta_polygon_converter_init(opb_size.total(),
ta_polygon_converter_init(opb_size.total() * tiles, ta_alloc, ta_alloc,
width, height); width / 32,
height / 32);
auto parameter = ta_parameter_writer(ta_parameter_buf); auto parameter = ta_parameter_writer(ta_parameter_buf);
for (uint32_t i = 0; i < num_faces; i++) { for (uint32_t i = 0; i < num_faces; i++) {
@ -197,7 +221,7 @@ void render(const uint32_t width, const uint32_t height,
texture_address, texture_address,
texture_width); texture_width);
} }
parameter.append<global_end_of_list>() = global_end_of_list(); parameter.append<ta_global_parameter::end_of_list>() = ta_global_parameter::end_of_list(para_control::para_type::end_of_list);
ta_polygon_converter_transfer(ta_parameter_buf, parameter.offset); ta_polygon_converter_transfer(ta_parameter_buf, parameter.offset);
ta_wait_opaque_list(); ta_wait_opaque_list();
} }

View File

@ -4,12 +4,15 @@
#include "vga.hpp" #include "vga.hpp"
#include "holly/texture_memory_alloc.hpp" #include "holly/texture_memory_alloc.hpp"
#include "holly.hpp" #include "holly/holly.hpp"
#include "holly/core.hpp" #include "holly/core.hpp"
#include "holly/core_bits.hpp" #include "holly/core_bits.hpp"
#include "holly/ta_fifo_polygon_converter.hpp" #include "holly/ta_fifo_polygon_converter.hpp"
#include "holly/ta_parameter.hpp" #include "holly/ta_parameter.hpp"
#include "holly/ta_global_parameter.hpp"
#include "holly/ta_vertex_parameter.hpp"
#include "holly/ta_bits.hpp" #include "holly/ta_bits.hpp"
#include "holly/isp_tsp.hpp"
#include "holly/region_array.hpp" #include "holly/region_array.hpp"
#include "holly/background.hpp" #include "holly/background.hpp"
#include "memorymap.hpp" #include "memorymap.hpp"
@ -43,16 +46,35 @@ uint32_t transform(uint32_t * ta_parameter_buf,
const uint32_t strip_length) const uint32_t strip_length)
{ {
auto parameter = ta_parameter_writer(ta_parameter_buf); auto parameter = ta_parameter_writer(ta_parameter_buf);
uint32_t texture_address = (offsetof (struct texture_memory_alloc, texture)); const uint32_t parameter_control_word = para_control::para_type::polygon_or_modifier_volume
auto polygon = global_polygon_type_0(texture_address); | para_control::list_type::opaque
polygon.texture_control_word = texture_control_word::pixel_format::_565 | obj_control::col_type::packed_color
| texture_control_word::scan_order::twiddled | obj_control::texture;
| texture_control_word::texture_address(texture_address / 8);
parameter.append<global_polygon_type_0>() = polygon; const uint32_t isp_tsp_instruction_word = isp_tsp_instruction_word::depth_compare_mode::greater
| isp_tsp_instruction_word::culling_mode::no_culling;
const uint32_t tsp_instruction_word = tsp_instruction_word::src_alpha_instr::one
| tsp_instruction_word::dst_alpha_instr::zero
| tsp_instruction_word::fog_control::no_fog
| tsp_instruction_word::texture_u_size::from_int(128)
| tsp_instruction_word::texture_v_size::from_int(128);
const uint32_t texture_address = (offsetof (struct texture_memory_alloc, texture));
const uint32_t texture_control_word = texture_control_word::pixel_format::_565
| texture_control_word::scan_order::twiddled
| texture_control_word::texture_address(texture_address / 8);
parameter.append<ta_global_parameter::polygon_type_0>() =
ta_global_parameter::polygon_type_0(parameter_control_word,
isp_tsp_instruction_word,
tsp_instruction_word,
texture_control_word,
0, // data_size_for_sort_dma
0 // next_address_for_sort_dma
);
for (uint32_t i = 0; i < strip_length; i++) { for (uint32_t i = 0; i < strip_length; i++) {
bool end_of_strip = i == strip_length - 1;
float x = strip_vertices[i].x; float x = strip_vertices[i].x;
float y = strip_vertices[i].y; float y = strip_vertices[i].y;
float z = strip_vertices[i].z; float z = strip_vertices[i].z;
@ -67,15 +89,18 @@ uint32_t transform(uint32_t * ta_parameter_buf,
y += 240.f; y += 240.f;
z = 1.f / (z + 10.f); z = 1.f / (z + 10.f);
parameter.append<vertex_polygon_type_3>() = bool end_of_strip = i == strip_length - 1;
vertex_polygon_type_3(x, y, z, parameter.append<ta_vertex_parameter::polygon_type_3>() =
strip_vertices[i].u, ta_vertex_parameter::polygon_type_3(polygon_vertex_parameter_control_word(end_of_strip),
strip_vertices[i].v, x, y, z,
strip_vertices[i].color, strip_vertices[i].u,
end_of_strip); strip_vertices[i].v,
strip_vertices[i].color,
0 // offset_color
);
} }
parameter.append<global_end_of_list>() = global_end_of_list(); parameter.append<ta_global_parameter::end_of_list>() = ta_global_parameter::end_of_list(para_control::para_type::end_of_list);
return parameter.offset; return parameter.offset;
} }
@ -84,7 +109,7 @@ void init_texture_memory(const struct opb_size& opb_size)
{ {
auto mem = reinterpret_cast<volatile texture_memory_alloc *>(texture_memory32); auto mem = reinterpret_cast<volatile texture_memory_alloc *>(texture_memory32);
background_parameter(mem->background); background_parameter(mem->background, 0xff00ff00);
region_array2(mem->region_array, region_array2(mem->region_array,
(offsetof (struct texture_memory_alloc, object_list)), (offsetof (struct texture_memory_alloc, object_list)),
@ -132,8 +157,6 @@ void main()
, .punch_through = 0 , .punch_through = 0
}; };
constexpr uint32_t tiles = (640 / 32) * (320 / 32);
holly.SOFTRESET = softreset::pipeline_soft_reset holly.SOFTRESET = softreset::pipeline_soft_reset
| softreset::ta_soft_reset; | softreset::ta_soft_reset;
holly.SOFTRESET = 0; holly.SOFTRESET = 0;
@ -145,7 +168,10 @@ void main()
constexpr uint32_t num_frames = 1; constexpr uint32_t num_frames = 1;
while (true) { while (true) {
ta_polygon_converter_init(opb_size.total() * tiles, ta_alloc); ta_polygon_converter_init(opb_size.total(),
ta_alloc,
640 / 32,
480 / 32);
uint32_t ta_parameter_size = transform(ta_parameter_buf, strip_vertices, strip_length); uint32_t ta_parameter_size = transform(ta_parameter_buf, strip_vertices, strip_length);
ta_polygon_converter_transfer(ta_parameter_buf, ta_parameter_size); ta_polygon_converter_transfer(ta_parameter_buf, ta_parameter_size);
ta_wait_opaque_list(); ta_wait_opaque_list();

View File

@ -4,17 +4,20 @@
#include "align.hpp" #include "align.hpp"
#include "vga.hpp" #include "vga.hpp"
#include "holly.hpp" #include "holly/holly.hpp"
#include "holly/core.hpp" #include "holly/core.hpp"
#include "holly/core_bits.hpp" #include "holly/core_bits.hpp"
#include "holly/ta_fifo_polygon_converter.hpp" #include "holly/ta_fifo_polygon_converter.hpp"
#include "holly/ta_parameter.hpp" #include "holly/ta_parameter.hpp"
#include "holly/ta_vertex_parameter.hpp"
#include "holly/ta_global_parameter.hpp"
#include "holly/ta_bits.hpp" #include "holly/ta_bits.hpp"
#include "holly/isp_tsp.hpp"
#include "holly/region_array.hpp" #include "holly/region_array.hpp"
#include "holly/background.hpp" #include "holly/background.hpp"
#include "holly/texture_memory_alloc.hpp" #include "holly/texture_memory_alloc.hpp"
#include "memorymap.hpp" #include "memorymap.hpp"
#include "serial.hpp" #include "sh7091/serial.hpp"
#include "geometry/border.hpp" #include "geometry/border.hpp"
#include "geometry/circle.hpp" #include "geometry/circle.hpp"
@ -57,15 +60,6 @@ void do_get_condition(uint32_t * command_buf,
return; return;
} }
/*
bool a = ft0::data_transfer::digital_button::a(data_fields.data.digital_button);
if (a == 0) {
serial::string("port ");
serial::integer<uint8_t>(port);
serial::string(" `a` press ");
serial::integer<uint8_t>(a);
}
*/
data[port].analog_axis_3 = data_fields.data.analog_axis_3; data[port].analog_axis_3 = data_fields.data.analog_axis_3;
data[port].analog_axis_4 = data_fields.data.analog_axis_4; data[port].analog_axis_4 = data_fields.data.analog_axis_4;
} }
@ -73,7 +67,7 @@ void do_get_condition(uint32_t * command_buf,
void transform(ta_parameter_writer& parameter, void transform(ta_parameter_writer& parameter,
const vec3 * vertices, const vec3 * vertices,
const face& face, const face_vn& face,
const vec4& color, const vec4& color,
const vec3& position, const vec3& position,
const float scale const float scale
@ -91,14 +85,17 @@ void transform(ta_parameter_writer& parameter,
| tsp_instruction_word::dst_alpha_instr::zero | tsp_instruction_word::dst_alpha_instr::zero
| tsp_instruction_word::fog_control::no_fog; | tsp_instruction_word::fog_control::no_fog;
parameter.append<global_polygon_type_0>() = global_polygon_type_0(parameter_control_word, parameter.append<ta_global_parameter::polygon_type_0>() =
isp_tsp_instruction_word, ta_global_parameter::polygon_type_0(parameter_control_word,
tsp_instruction_word, isp_tsp_instruction_word,
0); tsp_instruction_word,
0, // texture_control_word
0, // data_size_for_sort_dma
0 // next_address_for_sort_dma
);
constexpr uint32_t strip_length = 3; constexpr uint32_t strip_length = 3;
for (uint32_t i = 0; i < strip_length; i++) { for (uint32_t i = 0; i < strip_length; i++) {
bool end_of_strip = i == strip_length - 1;
// world transform // world transform
uint32_t vertex_ix = face[i].vertex; uint32_t vertex_ix = face[i].vertex;
@ -131,13 +128,16 @@ void transform(ta_parameter_writer& parameter,
y += 240.f; y += 240.f;
z = 1 / z; z = 1 / z;
parameter.append<vertex_polygon_type_1>() = bool end_of_strip = i == strip_length - 1;
vertex_polygon_type_1(x, y, z,
color.w, // alpha parameter.append<ta_vertex_parameter::polygon_type_1>() =
color.x, // r ta_vertex_parameter::polygon_type_1(polygon_vertex_parameter_control_word(end_of_strip),
color.y, // g x, y, z,
color.z, // b color.w, // alpha
end_of_strip); color.x, // r
color.y, // g
color.z // b
);
} }
} }
@ -223,7 +223,7 @@ void main()
); );
} }
parameter.append<global_end_of_list>() = global_end_of_list(); parameter.append<ta_global_parameter::end_of_list>() = ta_global_parameter::end_of_list(para_control::para_type::end_of_list);
ta_polygon_converter_transfer(ta_parameter_buf, parameter.offset); ta_polygon_converter_transfer(ta_parameter_buf, parameter.offset);
ta_wait_opaque_list(); ta_wait_opaque_list();
core_start_render(frame_ix, num_frames); core_start_render(frame_ix, num_frames);

View File

@ -4,10 +4,11 @@
#include "align.hpp" #include "align.hpp"
#include "maple/maple.hpp" #include "maple/maple.hpp"
#include "maple/maple_impl.hpp"
#include "maple/maple_bus_bits.hpp" #include "maple/maple_bus_bits.hpp"
#include "maple/maple_bus_commands.hpp" #include "maple/maple_bus_commands.hpp"
#include "maple/maple_bus_ft0.hpp" #include "maple/maple_bus_ft0.hpp"
#include "serial.hpp" #include "sh7091/serial.hpp"
uint32_t _command_buf[1024 / 4 + 32] = {0}; uint32_t _command_buf[1024 / 4 + 32] = {0};
uint32_t _receive_buf[1024 / 4 + 32] = {0}; uint32_t _receive_buf[1024 / 4 + 32] = {0};
@ -47,10 +48,11 @@ void do_get_condition(uint32_t port)
std::byteswap(function_type::controller)); std::byteswap(function_type::controller));
maple::dma_start(command_buf); maple::dma_start(command_buf);
using response_type = struct maple::command_response<data_transfer::data_fields<struct ft0::data_transfer::data_format>>; using response_type = data_transfer<ft0::data_transfer::data_format>;
auto response = reinterpret_cast<response_type *>(receive_buf); using command_response_type = struct maple::command_response<response_type::data_fields>;
auto response = reinterpret_cast<command_response_type *>(receive_buf);
auto& bus_data = response->bus_data; auto& bus_data = response->bus_data;
if (bus_data.command_code != data_transfer::command_code) { if (bus_data.command_code != response_type::command_code) {
return; return;
} }
auto& data_fields = bus_data.data_fields; auto& data_fields = bus_data.data_fields;
@ -69,20 +71,17 @@ void do_get_condition(uint32_t port)
void do_device_request() void do_device_request()
{ {
using response_type = struct maple::command_response<device_status::data_fields>; using command_type = device_request;
constexpr uint32_t response_size = align_32byte(sizeof (response_type)); using response_type = device_status;
maple::init_host_command_all_ports(command_buf, receive_buf, maple::init_host_command_all_ports<command_type, response_type>(command_buf, receive_buf);
device_request::command_code,
(sizeof (device_request::data_fields)), // command_data_size
(sizeof (device_status::data_fields))); // response_data_size
maple::dma_start(command_buf); maple::dma_start(command_buf);
using command_response_type = struct maple::command_response<response_type::data_fields>;
auto response = reinterpret_cast<command_response_type *>(receive_buf);
for (uint8_t port = 0; port < 4; port++) { for (uint8_t port = 0; port < 4; port++) {
auto response = reinterpret_cast<response_type *>(&receive_buf[response_size * port / 4]); auto& bus_data = response[port].bus_data;
auto& data_fields = response[port].bus_data.data_fields;
auto& bus_data = response->bus_data;
auto& data_fields = response->bus_data.data_fields;
if (bus_data.command_code != device_status::command_code) { if (bus_data.command_code != device_status::command_code) {
// the controller is disconnected // the controller is disconnected
} else { } else {

View File

@ -3,15 +3,18 @@
#include "align.hpp" #include "align.hpp"
#include "vga.hpp" #include "vga.hpp"
#include "holly/texture_memory_alloc.hpp" #include "holly/holly.hpp"
#include "holly.hpp"
#include "holly/core.hpp" #include "holly/core.hpp"
#include "holly/core_bits.hpp" #include "holly/core_bits.hpp"
#include "holly/ta_fifo_polygon_converter.hpp" #include "holly/ta_fifo_polygon_converter.hpp"
#include "holly/ta_parameter.hpp" #include "holly/ta_parameter.hpp"
#include "holly/ta_global_parameter.hpp"
#include "holly/ta_vertex_parameter.hpp"
#include "holly/isp_tsp.hpp"
#include "holly/ta_bits.hpp" #include "holly/ta_bits.hpp"
#include "holly/region_array.hpp" #include "holly/region_array.hpp"
#include "holly/background.hpp" #include "holly/background.hpp"
#include "holly/texture_memory_alloc.hpp"
#include "memorymap.hpp" #include "memorymap.hpp"
#include "macaw.hpp" #include "macaw.hpp"
@ -43,29 +46,60 @@ uint32_t transform(uint32_t * ta_parameter_buf,
bool translucent) bool translucent)
{ {
auto parameter = ta_parameter_writer(ta_parameter_buf); auto parameter = ta_parameter_writer(ta_parameter_buf);
uint32_t texture_address = (offsetof (struct texture_memory_alloc, texture));
if (translucent) { if (translucent) {
// translucent untextured // translucent untextured
auto polygon = global_polygon_type_0(); const uint32_t parameter_control_word = para_control::para_type::polygon_or_modifier_volume
polygon.parameter_control_word = para_control::para_type::polygon_or_modifier_volume | para_control::list_type::translucent
| para_control::list_type::translucent | obj_control::col_type::packed_color
| obj_control::col_type::packed_color | obj_control::gouraud;
| obj_control::gouraud;
polygon.tsp_instruction_word = tsp_instruction_word::src_alpha_instr::one const uint32_t isp_tsp_instruction_word = isp_tsp_instruction_word::depth_compare_mode::greater
| tsp_instruction_word::dst_alpha_instr::src_alpha | isp_tsp_instruction_word::culling_mode::no_culling;
| tsp_instruction_word::fog_control::no_fog
| tsp_instruction_word::use_alpha;
parameter.append<global_polygon_type_0>() = polygon; const uint32_t tsp_instruction_word = tsp_instruction_word::src_alpha_instr::one
| tsp_instruction_word::dst_alpha_instr::src_alpha
| tsp_instruction_word::fog_control::no_fog
| tsp_instruction_word::use_alpha;
parameter.append<ta_global_parameter::polygon_type_0>() =
ta_global_parameter::polygon_type_0(parameter_control_word,
isp_tsp_instruction_word,
tsp_instruction_word,
0, // texture_control_word
0, // data_size_for_sort_dma
0 // next_address_for_sort_dma
);
} else { } else {
// opaque textured const uint32_t parameter_control_word = para_control::para_type::polygon_or_modifier_volume
parameter.append<global_polygon_type_0>() = global_polygon_type_0(texture_address); | para_control::list_type::opaque
| obj_control::col_type::packed_color
| obj_control::texture;
const uint32_t isp_tsp_instruction_word = isp_tsp_instruction_word::depth_compare_mode::greater
| isp_tsp_instruction_word::culling_mode::no_culling;
const uint32_t tsp_instruction_word = tsp_instruction_word::src_alpha_instr::one
| tsp_instruction_word::dst_alpha_instr::zero
| tsp_instruction_word::fog_control::no_fog
| tsp_instruction_word::texture_u_size::from_int(128)
| tsp_instruction_word::texture_v_size::from_int(128);
const uint32_t texture_address = (offsetof (struct texture_memory_alloc, texture));
const uint32_t texture_control_word = texture_control_word::pixel_format::_565
| texture_control_word::scan_order::non_twiddled
| texture_control_word::texture_address(texture_address / 8);
parameter.append<ta_global_parameter::polygon_type_0>() =
ta_global_parameter::polygon_type_0(parameter_control_word,
isp_tsp_instruction_word,
tsp_instruction_word,
texture_control_word,
0, // data_size_for_sort_dma
0 // next_address_for_sort_dma
);
} }
for (uint32_t i = 0; i < strip_length; i++) { for (uint32_t i = 0; i < strip_length; i++) {
bool end_of_strip = i == strip_length - 1;
float x = strip_vertices[i].x; float x = strip_vertices[i].x;
float y = strip_vertices[i].y; float y = strip_vertices[i].y;
float z = strip_vertices[i].z; float z = strip_vertices[i].z;
@ -80,15 +114,18 @@ uint32_t transform(uint32_t * ta_parameter_buf,
y += 240.f; y += 240.f;
z = 1.f / (z + 10.f); z = 1.f / (z + 10.f);
parameter.append<vertex_polygon_type_3>() = bool end_of_strip = i == strip_length - 1;
vertex_polygon_type_3(x, y, z, parameter.append<ta_vertex_parameter::polygon_type_3>() =
strip_vertices[i].u, ta_vertex_parameter::polygon_type_3(polygon_vertex_parameter_control_word(end_of_strip),
strip_vertices[i].v, x, y, z,
strip_vertices[i].color, strip_vertices[i].u,
end_of_strip); strip_vertices[i].v,
strip_vertices[i].color,
0 // offset_color
);
} }
parameter.append<global_end_of_list>() = global_end_of_list(); parameter.append<ta_global_parameter::end_of_list>() = ta_global_parameter::end_of_list(para_control::para_type::end_of_list);
return parameter.offset; return parameter.offset;
} }
@ -97,7 +134,7 @@ void init_texture_memory(const struct opb_size& opb_size)
{ {
auto mem = reinterpret_cast<volatile texture_memory_alloc *>(texture_memory32); auto mem = reinterpret_cast<volatile texture_memory_alloc *>(texture_memory32);
background_parameter(mem->background); background_parameter(mem->background, 0xffffff00);
region_array2(mem->region_array, region_array2(mem->region_array,
(offsetof (struct texture_memory_alloc, object_list)), (offsetof (struct texture_memory_alloc, object_list)),
@ -142,8 +179,6 @@ void main()
, .punch_through = 0 , .punch_through = 0
}; };
constexpr uint32_t tiles = (640 / 32) * (320 / 32);
holly.SOFTRESET = softreset::pipeline_soft_reset holly.SOFTRESET = softreset::pipeline_soft_reset
| softreset::ta_soft_reset; | softreset::ta_soft_reset;
holly.SOFTRESET = 0; holly.SOFTRESET = 0;
@ -155,7 +190,10 @@ void main()
constexpr uint32_t num_frames = 1; constexpr uint32_t num_frames = 1;
while (true) { while (true) {
ta_polygon_converter_init(opb_size.total() * tiles, ta_alloc); ta_polygon_converter_init(opb_size.total(),
ta_alloc,
640 / 32,
480 / 32);
uint32_t ta_parameter_size = 0; uint32_t ta_parameter_size = 0;
ta_parameter_size += transform(&ta_parameter_buf[ta_parameter_size / 4], strip_vertices, strip_length, 0); ta_parameter_size += transform(&ta_parameter_buf[ta_parameter_size / 4], strip_vertices, strip_length, 0);
ta_parameter_size += transform(&ta_parameter_buf[ta_parameter_size / 4], strip_vertices, strip_length, 1); ta_parameter_size += transform(&ta_parameter_buf[ta_parameter_size / 4], strip_vertices, strip_length, 1);

View File

@ -1,19 +1,21 @@
#include <cstdint> #include <cstdint>
#include "align.hpp" #include "align.hpp"
#include "vga.hpp" #include "vga.hpp"
#include "holly.hpp"
#include "holly/holly.hpp"
#include "holly/core.hpp" #include "holly/core.hpp"
#include "holly/core_bits.hpp" #include "holly/core_bits.hpp"
#include "holly/ta_fifo_polygon_converter.hpp" #include "holly/ta_fifo_polygon_converter.hpp"
#include "holly/ta_parameter.hpp" #include "holly/ta_parameter.hpp"
#include "holly/ta_global_parameter.hpp"
#include "holly/ta_vertex_parameter.hpp"
#include "holly/isp_tsp.hpp"
#include "holly/ta_bits.hpp" #include "holly/ta_bits.hpp"
#include "holly/region_array.hpp" #include "holly/region_array.hpp"
#include "holly/background.hpp" #include "holly/background.hpp"
#include "holly/texture_memory_alloc.hpp" #include "holly/texture_memory_alloc.hpp"
#include "memorymap.hpp" #include "memorymap.hpp"
#include "serial.hpp"
#include "geometry/wiffle.hpp" #include "geometry/wiffle.hpp"
#include "math/vec4.hpp" #include "math/vec4.hpp"
@ -59,16 +61,19 @@ void transform(ta_parameter_writer& parameter,
| tsp_instruction_word::dst_alpha_instr::zero | tsp_instruction_word::dst_alpha_instr::zero
| tsp_instruction_word::fog_control::no_fog; | tsp_instruction_word::fog_control::no_fog;
parameter.append<global_polygon_type_0>() = global_polygon_type_0(parameter_control_word, parameter.append<ta_global_parameter::polygon_type_0>() =
isp_tsp_instruction_word, ta_global_parameter::polygon_type_0(parameter_control_word,
tsp_instruction_word, isp_tsp_instruction_word,
0); tsp_instruction_word,
0, // texture_control_word
0, // data_size_for_sort_dma
0 // next_address_for_sort_dma
);
auto& face = MODEL::faces[face_ix]; auto& face = MODEL::faces[face_ix];
constexpr uint32_t strip_length = 3; constexpr uint32_t strip_length = 3;
for (uint32_t i = 0; i < strip_length; i++) { for (uint32_t i = 0; i < strip_length; i++) {
bool end_of_strip = i == strip_length - 1;
// world transform // world transform
uint32_t vertex_ix = face[i].vertex; uint32_t vertex_ix = face[i].vertex;
auto& vertex = MODEL::vertices[vertex_ix]; auto& vertex = MODEL::vertices[vertex_ix];
@ -140,13 +145,15 @@ void transform(ta_parameter_writer& parameter,
y += 240.f; y += 240.f;
z = 1 / z; z = 1 / z;
parameter.append<vertex_polygon_type_1>() = bool end_of_strip = i == strip_length - 1;
vertex_polygon_type_1(x, y, z, parameter.append<ta_vertex_parameter::polygon_type_1>() =
color.w, // alpha ta_vertex_parameter::polygon_type_1(polygon_vertex_parameter_control_word(end_of_strip),
color.x, // r x, y, z,
color.y, // g color.w, // alpha
color.z, // b color.x, // r
end_of_strip); color.y, // g
color.z // b
);
} }
} }
@ -166,10 +173,14 @@ void transform2(ta_parameter_writer& parameter,
| tsp_instruction_word::dst_alpha_instr::zero | tsp_instruction_word::dst_alpha_instr::zero
| tsp_instruction_word::fog_control::no_fog; | tsp_instruction_word::fog_control::no_fog;
parameter.append<global_polygon_type_0>() = global_polygon_type_0(parameter_control_word, parameter.append<ta_global_parameter::polygon_type_0>() =
isp_tsp_instruction_word, ta_global_parameter::polygon_type_0(parameter_control_word,
tsp_instruction_word, isp_tsp_instruction_word,
0); tsp_instruction_word,
0, // texture_control_word
0, // data_size_for_sort_dma
0 // next_address_for_sort_dma
);
constexpr vec3 triangle[] = { constexpr vec3 triangle[] = {
{ 0.f, -1.f, 0.f}, { 0.f, -1.f, 0.f},
@ -179,7 +190,6 @@ void transform2(ta_parameter_writer& parameter,
constexpr uint32_t strip_length = 3; constexpr uint32_t strip_length = 3;
for (uint32_t i = 0; i < strip_length; i++) { for (uint32_t i = 0; i < strip_length; i++) {
bool end_of_strip = i == strip_length - 1;
float x = triangle[i].x; float x = triangle[i].x;
float y = triangle[i].y; float y = triangle[i].y;
float z = triangle[i].z; float z = triangle[i].z;
@ -206,13 +216,15 @@ void transform2(ta_parameter_writer& parameter,
y += 240.f; y += 240.f;
z = 1 / z; z = 1 / z;
parameter.append<vertex_polygon_type_1>() = bool end_of_strip = i == strip_length - 1;
vertex_polygon_type_1(x, y, z, parameter.append<ta_vertex_parameter::polygon_type_1>() =
color.w, // alpha ta_vertex_parameter::polygon_type_1(polygon_vertex_parameter_control_word(end_of_strip),
color.x, // r x, y, z,
color.y, // g color.w, // alpha
color.z, // b color.x, // r
end_of_strip); color.y, // g
color.z // b
);
} }
} }
@ -295,7 +307,7 @@ void main()
transform2(parameter, lights[1], {0.f, 1.f, 0.f, 1.f}); transform2(parameter, lights[1], {0.f, 1.f, 0.f, 1.f});
transform2(parameter, lights[2], {0.f, 0.f, 1.f, 1.f}); transform2(parameter, lights[2], {0.f, 0.f, 1.f, 1.f});
parameter.append<global_end_of_list>() = global_end_of_list(); parameter.append<ta_global_parameter::end_of_list>() = ta_global_parameter::end_of_list(para_control::para_type::end_of_list);
ta_polygon_converter_transfer(ta_parameter_buf, parameter.offset); ta_polygon_converter_transfer(ta_parameter_buf, parameter.offset);
ta_wait_opaque_list(); ta_wait_opaque_list();
core_start_render(frame_ix, num_frames); core_start_render(frame_ix, num_frames);

View File

@ -17,12 +17,12 @@ namespace border {
{ -0.950000f, 0.000000f, 0.950000f }, { -0.950000f, 0.000000f, 0.950000f },
{ -0.950000f, 0.000000f, -0.950000f }, { -0.950000f, 0.000000f, -0.950000f },
}; };
constexpr vec3 normals[] = { constexpr vec3 normals[] = {
{ -0.000000f, 1.000000f, -0.000000f }, { -0.000000f, 1.000000f, -0.000000f },
}; };
constexpr face faces[] = { constexpr face_vn faces[] = {
{{ 5, 0}, {11, 0}, { 7, 0}}, {{ 5, 0}, {11, 0}, { 7, 0}},
{{ 4, 0}, {10, 0}, { 9, 0}}, {{ 4, 0}, {10, 0}, { 9, 0}},
{{ 5, 0}, { 8, 0}, {11, 0}}, {{ 5, 0}, { 8, 0}, {11, 0}},
@ -36,7 +36,7 @@ namespace border {
{{11, 0}, { 8, 0}, { 2, 0}}, {{11, 0}, { 8, 0}, { 2, 0}},
{{ 1, 0}, { 3, 0}, { 6, 0}}, {{ 1, 0}, { 3, 0}, { 6, 0}},
}; };
constexpr uint32_t num_faces = (sizeof (faces)) / (sizeof (face)); constexpr uint32_t num_faces = (sizeof (faces)) / (sizeof (face_vn));
} }

View File

@ -37,12 +37,12 @@ namespace circle {
{ 0.382683f, 0.000000f, -0.923880f }, { 0.382683f, 0.000000f, -0.923880f },
{ 0.195090f, 0.000000f, -0.980785f }, { 0.195090f, 0.000000f, -0.980785f },
}; };
constexpr vec3 normals[] = { constexpr vec3 normals[] = {
{ -0.000000f, 1.000000f, -0.000000f }, { -0.000000f, 1.000000f, -0.000000f },
}; };
constexpr face faces[] = { constexpr face_vn faces[] = {
{{31, 0}, { 0, 0}, { 1, 0}}, {{31, 0}, { 0, 0}, { 1, 0}},
{{30, 0}, {31, 0}, { 1, 0}}, {{30, 0}, {31, 0}, { 1, 0}},
{{20, 0}, {13, 0}, {18, 0}}, {{20, 0}, {13, 0}, {18, 0}},
@ -74,7 +74,7 @@ namespace circle {
{{17, 0}, {14, 0}, {15, 0}}, {{17, 0}, {14, 0}, {15, 0}},
{{16, 0}, {17, 0}, {15, 0}}, {{16, 0}, {17, 0}, {15, 0}},
}; };
constexpr uint32_t num_faces = (sizeof (faces)) / (sizeof (face)); constexpr uint32_t num_faces = (sizeof (faces)) / (sizeof (face_vn));
} }

View File

@ -13,14 +13,14 @@ namespace cube {
{ 1.000000f, -1.000000f, -1.000000f }, { 1.000000f, -1.000000f, -1.000000f },
{ 1.000000f, 1.000000f, -1.000000f }, { 1.000000f, 1.000000f, -1.000000f },
}; };
constexpr vec2 texture[] = { constexpr vec2 texture[] = {
{ 1.000000f, 1.000000f }, { 1.000000f, 1.000000f },
{ 1.000000f, 0.000000f }, { 1.000000f, 0.000000f },
{ 0.000000f, 1.000000f }, { 0.000000f, 1.000000f },
{ 0.000000f, 0.000000f }, { 0.000000f, 0.000000f },
}; };
constexpr vec3 normals[] = { constexpr vec3 normals[] = {
{ -1.000000f, -0.000000f, -0.000000f }, { -1.000000f, -0.000000f, -0.000000f },
{ -0.000000f, -0.000000f, -1.000000f }, { -0.000000f, -0.000000f, -1.000000f },
@ -29,8 +29,8 @@ namespace cube {
{ -0.000000f, -1.000000f, -0.000000f }, { -0.000000f, -1.000000f, -0.000000f },
{ -0.000000f, 1.000000f, -0.000000f }, { -0.000000f, 1.000000f, -0.000000f },
}; };
constexpr face faces[] = { constexpr face_vtn faces[] = {
{{1, 0, 0}, {2, 0, 0}, {0, 1, 0}}, {{1, 0, 0}, {2, 0, 0}, {0, 1, 0}},
{{3, 1, 1}, {6, 2, 1}, {2, 3, 1}}, {{3, 1, 1}, {6, 2, 1}, {2, 3, 1}},
{{7, 0, 2}, {4, 3, 2}, {6, 1, 2}}, {{7, 0, 2}, {4, 3, 2}, {6, 1, 2}},
@ -44,7 +44,7 @@ namespace cube {
{{6, 2, 4}, {4, 3, 4}, {0, 1, 4}}, {{6, 2, 4}, {4, 3, 4}, {0, 1, 4}},
{{3, 1, 5}, {1, 0, 5}, {5, 2, 5}}, {{3, 1, 5}, {1, 0, 5}, {5, 2, 5}},
}; };
constexpr uint32_t num_faces = (sizeof (faces)) / (sizeof (face)); constexpr uint32_t num_faces = (sizeof (faces)) / (sizeof (face_vtn));
} }

View File

@ -47,7 +47,7 @@ namespace icosphere {
{ -0.425323f, 0.850654f, -0.309011f }, { -0.425323f, 0.850654f, -0.309011f },
{ 0.162456f, 0.850654f, -0.499995f }, { 0.162456f, 0.850654f, -0.499995f },
}; };
constexpr vec3 normals[] = { constexpr vec3 normals[] = {
{ 0.102400f, -0.943500f, 0.315100f }, { 0.102400f, -0.943500f, 0.315100f },
{ 0.700200f, -0.661700f, 0.268000f }, { 0.700200f, -0.661700f, 0.268000f },
@ -130,8 +130,8 @@ namespace icosphere {
{ 0.187600f, -0.794700f, 0.577300f }, { 0.187600f, -0.794700f, 0.577300f },
{ 0.471300f, -0.661700f, 0.583100f }, { 0.471300f, -0.661700f, 0.583100f },
}; };
constexpr face faces[] = { constexpr face_vn faces[] = {
{{ 0, 0}, {13, 0}, {12, 0}}, {{ 0, 0}, {13, 0}, {12, 0}},
{{ 1, 1}, {13, 1}, {15, 1}}, {{ 1, 1}, {13, 1}, {15, 1}},
{{ 0, 2}, {12, 2}, {17, 2}}, {{ 0, 2}, {12, 2}, {17, 2}},
@ -213,7 +213,7 @@ namespace icosphere {
{{12, 78}, {13, 78}, {14, 78}}, {{12, 78}, {13, 78}, {14, 78}},
{{13, 79}, { 1, 79}, {14, 79}}, {{13, 79}, { 1, 79}, {14, 79}},
}; };
constexpr uint32_t num_faces = (sizeof (faces)) / (sizeof (face)); constexpr uint32_t num_faces = (sizeof (faces)) / (sizeof (face_vn));
} }

View File

@ -512,7 +512,7 @@ namespace suzanne {
{ 0.859375f, -0.382813f, 0.382812f }, { 0.859375f, -0.382813f, 0.382812f },
{ -0.859375f, -0.382812f, 0.382813f }, { -0.859375f, -0.382812f, 0.382813f },
}; };
constexpr vec3 normals[] = { constexpr vec3 normals[] = {
{ 0.661700f, 0.202600f, -0.721900f }, { 0.661700f, 0.202600f, -0.721900f },
{ -0.661700f, 0.202600f, -0.721900f }, { -0.661700f, 0.202600f, -0.721900f },
@ -1456,108 +1456,108 @@ namespace suzanne {
{ -0.360400f, 0.828300f, 0.429000f }, { -0.360400f, 0.828300f, 0.429000f },
{ 0.360400f, 0.828300f, 0.429000f }, { 0.360400f, 0.828300f, 0.429000f },
}; };
constexpr face faces[] = { constexpr face_vn faces[] = {
{{46, 0}, { 2, 0}, {44, 0}}, {{ 46, 0}, { 2, 0}, { 44, 0}},
{{ 3, 1}, {47, 1}, {45, 1}}, {{ 3, 1}, { 47, 1}, { 45, 1}},
{{44, 2}, { 4, 2}, {42, 2}}, {{ 44, 2}, { 4, 2}, { 42, 2}},
{{ 5, 3}, {45, 3}, {43, 3}}, {{ 5, 3}, { 45, 3}, { 43, 3}},
{{ 2, 4}, { 6, 4}, { 4, 4}}, {{ 2, 4}, { 6, 4}, { 4, 4}},
{{ 7, 5}, { 3, 5}, { 5, 5}}, {{ 7, 5}, { 3, 5}, { 5, 5}},
{{ 0, 6}, { 8, 6}, { 2, 6}}, {{ 0, 6}, { 8, 6}, { 2, 6}},
{{ 9, 7}, { 1, 7}, { 3, 7}}, {{ 9, 7}, { 1, 7}, { 3, 7}},
{{10, 8}, {14, 8}, { 8, 8}}, {{ 10, 8}, { 14, 8}, { 8, 8}},
{{15, 9}, {11, 9}, { 9, 9}}, {{ 15, 9}, { 11, 9}, { 9, 9}},
{{ 8, 10}, {16, 10}, { 6, 10}}, {{ 8, 10}, { 16, 10}, { 6, 10}},
{{17, 11}, { 9, 11}, { 7, 11}}, {{ 17, 11}, { 9, 11}, { 7, 11}},
{{20, 12}, {16, 12}, {14, 12}}, {{ 20, 12}, { 16, 12}, { 14, 12}},
{{21, 13}, {17, 13}, {19, 13}}, {{ 21, 13}, { 17, 13}, { 19, 13}},
{{22, 14}, {14, 14}, {12, 14}}, {{ 22, 14}, { 14, 14}, { 12, 14}},
{{23, 15}, {15, 15}, {21, 15}}, {{ 23, 15}, { 15, 15}, { 21, 15}},
{{22, 16}, {26, 16}, {20, 16}}, {{ 22, 16}, { 26, 16}, { 20, 16}},
{{27, 17}, {23, 17}, {21, 17}}, {{ 27, 17}, { 23, 17}, { 21, 17}},
{{26, 18}, {18, 18}, {20, 18}}, {{ 26, 18}, { 18, 18}, { 20, 18}},
{{27, 19}, {19, 19}, {29, 19}}, {{ 27, 19}, { 19, 19}, { 29, 19}},
{{32, 20}, {28, 20}, {26, 20}}, {{ 32, 20}, { 28, 20}, { 26, 20}},
{{33, 21}, {29, 21}, {31, 21}}, {{ 33, 21}, { 29, 21}, { 31, 21}},
{{34, 22}, {26, 22}, {24, 22}}, {{ 34, 22}, { 26, 22}, { 24, 22}},
{{35, 23}, {27, 23}, {33, 23}}, {{ 35, 23}, { 27, 23}, { 33, 23}},
{{36, 24}, {32, 24}, {34, 24}}, {{ 36, 24}, { 32, 24}, { 34, 24}},
{{37, 25}, {33, 25}, {39, 25}}, {{ 37, 25}, { 33, 25}, { 39, 25}},
{{38, 26}, {30, 26}, {32, 26}}, {{ 38, 26}, { 30, 26}, { 32, 26}},
{{39, 27}, {31, 27}, {41, 27}}, {{ 39, 27}, { 31, 27}, { 41, 27}},
{{44, 28}, {40, 28}, {38, 28}}, {{ 44, 28}, { 40, 28}, { 38, 28}},
{{45, 29}, {41, 29}, {43, 29}}, {{ 45, 29}, { 41, 29}, { 43, 29}},
{{46, 30}, {38, 30}, {36, 30}}, {{ 46, 30}, { 38, 30}, { 36, 30}},
{{47, 31}, {39, 31}, {45, 31}}, {{ 47, 31}, { 39, 31}, { 45, 31}},
{{36, 32}, {48, 32}, {46, 32}}, {{ 36, 32}, { 48, 32}, { 46, 32}},
{{37, 33}, {49, 33}, {51, 33}}, {{ 37, 33}, { 49, 33}, { 51, 33}},
{{34, 34}, {50, 34}, {36, 34}}, {{ 34, 34}, { 50, 34}, { 36, 34}},
{{35, 35}, {51, 35}, {53, 35}}, {{ 35, 35}, { 51, 35}, { 53, 35}},
{{24, 36}, {52, 36}, {34, 36}}, {{ 24, 36}, { 52, 36}, { 34, 36}},
{{25, 37}, {53, 37}, {55, 37}}, {{ 25, 37}, { 53, 37}, { 55, 37}},
{{22, 38}, {54, 38}, {24, 38}}, {{ 22, 38}, { 54, 38}, { 24, 38}},
{{23, 39}, {55, 39}, {57, 39}}, {{ 23, 39}, { 55, 39}, { 57, 39}},
{{22, 40}, {58, 40}, {56, 40}}, {{ 22, 40}, { 58, 40}, { 56, 40}},
{{59, 41}, {23, 41}, {57, 41}}, {{ 59, 41}, { 23, 41}, { 57, 41}},
{{12, 42}, {62, 42}, {58, 42}}, {{ 12, 42}, { 62, 42}, { 58, 42}},
{{63, 43}, {13, 43}, {59, 43}}, {{ 63, 43}, { 13, 43}, { 59, 43}},
{{10, 44}, {64, 44}, {62, 44}}, {{ 10, 44}, { 64, 44}, { 62, 44}},
{{65, 45}, {11, 45}, {63, 45}}, {{ 65, 45}, { 11, 45}, { 63, 45}},
{{ 0, 46}, {48, 46}, {64, 46}}, {{ 0, 46}, { 48, 46}, { 64, 46}},
{{49, 47}, { 1, 47}, {65, 47}}, {{ 49, 47}, { 1, 47}, { 65, 47}},
{{60, 48}, {64, 48}, {48, 48}}, {{ 60, 48}, { 64, 48}, { 48, 48}},
{{49, 49}, {65, 49}, {61, 49}}, {{ 49, 49}, { 65, 49}, { 61, 49}},
{{62, 50}, {64, 50}, {60, 50}}, {{ 62, 50}, { 64, 50}, { 60, 50}},
{{61, 51}, {65, 51}, {63, 51}}, {{ 61, 51}, { 65, 51}, { 63, 51}},
{{60, 52}, {58, 52}, {62, 52}}, {{ 60, 52}, { 58, 52}, { 62, 52}},
{{63, 53}, {59, 53}, {61, 53}}, {{ 63, 53}, { 59, 53}, { 61, 53}},
{{60, 54}, {56, 54}, {58, 54}}, {{ 60, 54}, { 56, 54}, { 58, 54}},
{{59, 55}, {57, 55}, {61, 55}}, {{ 59, 55}, { 57, 55}, { 61, 55}},
{{60, 56}, {54, 56}, {56, 56}}, {{ 60, 56}, { 54, 56}, { 56, 56}},
{{57, 57}, {55, 57}, {61, 57}}, {{ 57, 57}, { 55, 57}, { 61, 57}},
{{60, 58}, {52, 58}, {54, 58}}, {{ 60, 58}, { 52, 58}, { 54, 58}},
{{55, 59}, {53, 59}, {61, 59}}, {{ 55, 59}, { 53, 59}, { 61, 59}},
{{60, 60}, {50, 60}, {52, 60}}, {{ 60, 60}, { 50, 60}, { 52, 60}},
{{53, 61}, {51, 61}, {61, 61}}, {{ 53, 61}, { 51, 61}, { 61, 61}},
{{60, 62}, {48, 62}, {50, 62}}, {{ 60, 62}, { 48, 62}, { 50, 62}},
{{51, 63}, {49, 63}, {61, 63}}, {{ 51, 63}, { 49, 63}, { 61, 63}},
{{173, 64}, {90, 64}, {88, 64}}, {{173, 64}, { 90, 64}, { 88, 64}},
{{174, 65}, {90, 65}, {175, 65}}, {{174, 65}, { 90, 65}, {175, 65}},
{{171, 66}, {88, 66}, {86, 66}}, {{171, 66}, { 88, 66}, { 86, 66}},
{{172, 67}, {89, 67}, {174, 67}}, {{172, 67}, { 89, 67}, {174, 67}},
{{84, 68}, {171, 68}, {86, 68}}, {{ 84, 68}, {171, 68}, { 86, 68}},
{{172, 69}, {85, 69}, {87, 69}}, {{172, 69}, { 85, 69}, { 87, 69}},
{{82, 70}, {169, 70}, {84, 70}}, {{ 82, 70}, {169, 70}, { 84, 70}},
{{170, 71}, {83, 71}, {85, 71}}, {{170, 71}, { 83, 71}, { 85, 71}},
{{80, 72}, {167, 72}, {82, 72}}, {{ 80, 72}, {167, 72}, { 82, 72}},
{{168, 73}, {81, 73}, {83, 73}}, {{168, 73}, { 81, 73}, { 83, 73}},
{{78, 74}, {145, 74}, {163, 74}}, {{ 78, 74}, {145, 74}, {163, 74}},
{{146, 75}, {79, 75}, {164, 75}}, {{146, 75}, { 79, 75}, {164, 75}},
{{93, 76}, {145, 76}, {91, 76}}, {{ 93, 76}, {145, 76}, { 91, 76}},
{{94, 77}, {146, 77}, {148, 77}}, {{ 94, 77}, {146, 77}, {148, 77}},
{{93, 78}, {149, 78}, {147, 78}}, {{ 93, 78}, {149, 78}, {147, 78}},
{{150, 79}, {94, 79}, {148, 79}}, {{150, 79}, { 94, 79}, {148, 79}},
{{97, 80}, {149, 80}, {95, 80}}, {{ 97, 80}, {149, 80}, { 95, 80}},
{{98, 81}, {150, 81}, {152, 81}}, {{ 98, 81}, {150, 81}, {152, 81}},
{{99, 82}, {151, 82}, {97, 82}}, {{ 99, 82}, {151, 82}, { 97, 82}},
{{100, 83}, {152, 83}, {154, 83}}, {{100, 83}, {152, 83}, {154, 83}},
{{101, 84}, {153, 84}, {99, 84}}, {{101, 84}, {153, 84}, { 99, 84}},
{{102, 85}, {154, 85}, {156, 85}}, {{102, 85}, {154, 85}, {156, 85}},
{{101, 86}, {157, 86}, {155, 86}}, {{101, 86}, {157, 86}, {155, 86}},
{{158, 87}, {102, 87}, {156, 87}}, {{158, 87}, {102, 87}, {156, 87}},
{{105, 88}, {157, 88}, {103, 88}}, {{105, 88}, {157, 88}, {103, 88}},
{{106, 89}, {158, 89}, {160, 89}}, {{106, 89}, {158, 89}, {160, 89}},
{{107, 90}, {159, 90}, {105, 90}}, {{107, 90}, {159, 90}, {105, 90}},
{{108, 91}, {160, 91}, {162, 91}}, {{108, 91}, {160, 91}, {162, 91}},
{{66, 92}, {161, 92}, {107, 92}}, {{ 66, 92}, {161, 92}, {107, 92}},
{{66, 93}, {162, 93}, {67, 93}}, {{ 66, 93}, {162, 93}, { 67, 93}},
{{127, 94}, {161, 94}, {109, 94}}, {{127, 94}, {161, 94}, {109, 94}},
{{128, 95}, {162, 95}, {160, 95}}, {{128, 95}, {162, 95}, {160, 95}},
{{127, 96}, {157, 96}, {159, 96}}, {{127, 96}, {157, 96}, {159, 96}},
{{158, 97}, {128, 97}, {160, 97}}, {{158, 97}, {128, 97}, {160, 97}},
{{155, 98}, {178, 98}, {125, 98}}, {{155, 98}, {178, 98}, {125, 98}},
{{156, 99}, {179, 99}, {158, 99}}, {{156, 99}, {179, 99}, {158, 99}},
{{153, 100}, {125, 100}, {123, 100}}, {{153, 100}, {125, 100}, {123, 100}},
{{154, 101}, {126, 101}, {156, 101}}, {{154, 101}, {126, 101}, {156, 101}},
{{151, 102}, {123, 102}, {121, 102}}, {{151, 102}, {123, 102}, {121, 102}},
@ -1573,7 +1573,7 @@ namespace suzanne {
{{113, 111}, {176, 111}, {163, 111}}, {{113, 111}, {176, 111}, {163, 111}},
{{176, 112}, {114, 112}, {164, 112}}, {{176, 112}, {114, 112}, {164, 112}},
{{161, 113}, {111, 113}, {109, 113}}, {{161, 113}, {111, 113}, {109, 113}},
{{162, 114}, {112, 114}, {67, 114}}, {{162, 114}, {112, 114}, { 67, 114}},
{{111, 115}, {177, 115}, {182, 115}}, {{111, 115}, {177, 115}, {182, 115}},
{{177, 116}, {112, 116}, {183, 116}}, {{177, 116}, {112, 116}, {183, 116}},
{{180, 117}, {177, 117}, {176, 117}}, {{180, 117}, {177, 117}, {176, 117}},
@ -1590,24 +1590,24 @@ namespace suzanne {
{{168, 128}, {131, 128}, {185, 128}}, {{168, 128}, {131, 128}, {185, 128}},
{{189, 129}, {186, 129}, {143, 129}}, {{189, 129}, {186, 129}, {143, 129}},
{{189, 130}, {187, 130}, {188, 130}}, {{189, 130}, {187, 130}, {188, 130}},
{{186, 131}, {68, 131}, {184, 131}}, {{186, 131}, { 68, 131}, {184, 131}},
{{187, 132}, {68, 132}, {188, 132}}, {{187, 132}, { 68, 132}, {188, 132}},
{{130, 133}, {68, 133}, {129, 133}}, {{130, 133}, { 68, 133}, {129, 133}},
{{131, 133}, {68, 133}, {185, 133}}, {{131, 133}, { 68, 133}, {185, 133}},
{{141, 134}, {190, 134}, {143, 134}}, {{141, 134}, {190, 134}, {143, 134}},
{{191, 135}, {142, 135}, {144, 135}}, {{191, 135}, {142, 135}, {144, 135}},
{{194, 136}, {141, 136}, {139, 136}}, {{194, 136}, {141, 136}, {139, 136}},
{{195, 137}, {142, 137}, {193, 137}}, {{195, 137}, {142, 137}, {193, 137}},
{{196, 138}, {139, 138}, {138, 138}}, {{196, 138}, {139, 138}, {138, 138}},
{{197, 139}, {140, 139}, {195, 139}}, {{197, 139}, {140, 139}, {195, 139}},
{{70, 140}, {138, 140}, {137, 140}}, {{ 70, 140}, {138, 140}, {137, 140}},
{{70, 141}, {138, 141}, {197, 141}}, {{ 70, 141}, {138, 141}, {197, 141}},
{{143, 142}, {69, 142}, {189, 142}}, {{143, 142}, { 69, 142}, {189, 142}},
{{144, 143}, {69, 143}, {191, 143}}, {{144, 143}, { 69, 143}, {191, 143}},
{{190, 144}, {207, 144}, {69, 144}}, {{190, 144}, {207, 144}, { 69, 144}},
{{191, 145}, {207, 145}, {206, 145}}, {{191, 145}, {207, 145}, {206, 145}},
{{70, 146}, {199, 146}, {196, 146}}, {{ 70, 146}, {199, 146}, {196, 146}},
{{200, 147}, {70, 147}, {197, 147}}, {{200, 147}, { 70, 147}, {197, 147}},
{{196, 148}, {201, 148}, {194, 148}}, {{196, 148}, {201, 148}, {194, 148}},
{{202, 149}, {197, 149}, {195, 149}}, {{202, 149}, {197, 149}, {195, 149}},
{{201, 150}, {192, 150}, {194, 150}}, {{201, 150}, {192, 150}, {194, 150}},
@ -1626,14 +1626,14 @@ namespace suzanne {
{{144, 163}, {211, 163}, {213, 163}}, {{144, 163}, {211, 163}, {213, 163}},
{{186, 164}, {212, 164}, {143, 164}}, {{186, 164}, {212, 164}, {143, 164}},
{{187, 165}, {213, 165}, {166, 165}}, {{187, 165}, {213, 165}, {166, 165}},
{{208, 166}, {165, 166}, {80, 166}}, {{208, 166}, {165, 166}, { 80, 166}},
{{209, 167}, {166, 167}, {213, 167}}, {{209, 167}, {166, 167}, {213, 167}},
{{214, 168}, {212, 168}, {208, 168}}, {{214, 168}, {212, 168}, {208, 168}},
{{215, 169}, {213, 169}, {211, 169}}, {{215, 169}, {213, 169}, {211, 169}},
{{78, 170}, {210, 170}, {214, 170}}, {{ 78, 170}, {210, 170}, {214, 170}},
{{211, 171}, {79, 171}, {215, 171}}, {{211, 171}, { 79, 171}, {215, 171}},
{{129, 172}, {221, 172}, {130, 172}}, {{129, 172}, {221, 172}, {130, 172}},
{{129, 173}, {222, 173}, {71, 173}}, {{129, 173}, {222, 173}, { 71, 173}},
{{132, 174}, {221, 174}, {219, 174}}, {{132, 174}, {221, 174}, {219, 174}},
{{222, 175}, {133, 175}, {220, 175}}, {{222, 175}, {133, 175}, {220, 175}},
{{134, 176}, {219, 176}, {217, 176}}, {{134, 176}, {219, 176}, {217, 176}},
@ -1646,8 +1646,8 @@ namespace suzanne {
{{227, 181}, {218, 181}, {229, 181}}, {{227, 181}, {218, 181}, {229, 181}},
{{219, 140}, {224, 140}, {226, 140}}, {{219, 140}, {224, 140}, {226, 140}},
{{225, 182}, {220, 182}, {227, 182}}, {{225, 182}, {220, 182}, {227, 182}},
{{71, 183}, {224, 183}, {221, 183}}, {{ 71, 183}, {224, 183}, {221, 183}},
{{71, 184}, {225, 184}, {223, 184}}, {{ 71, 184}, {225, 184}, {223, 184}},
{{223, 185}, {228, 185}, {224, 185}}, {{223, 185}, {228, 185}, {224, 185}},
{{229, 186}, {223, 186}, {225, 186}}, {{229, 186}, {223, 186}, {225, 186}},
{{224, 187}, {228, 187}, {226, 187}}, {{224, 187}, {228, 187}, {226, 187}},
@ -1704,74 +1704,74 @@ namespace suzanne {
{{282, 238}, {254, 238}, {260, 238}}, {{282, 238}, {254, 238}, {260, 238}},
{{231, 239}, {279, 239}, {281, 239}}, {{231, 239}, {279, 239}, {281, 239}},
{{280, 240}, {232, 240}, {282, 240}}, {{280, 240}, {232, 240}, {282, 240}},
{{66, 241}, {283, 241}, {72, 241}}, {{ 66, 241}, {283, 241}, { 72, 241}},
{{284, 242}, {66, 242}, {72, 242}}, {{284, 242}, { 66, 242}, { 72, 242}},
{{107, 243}, {285, 243}, {283, 243}}, {{107, 243}, {285, 243}, {283, 243}},
{{286, 244}, {108, 244}, {284, 244}}, {{286, 244}, {108, 244}, {284, 244}},
{{103, 245}, {285, 245}, {105, 245}}, {{103, 245}, {285, 245}, {105, 245}},
{{104, 246}, {286, 246}, {288, 246}}, {{104, 246}, {286, 246}, {288, 246}},
{{101, 247}, {287, 247}, {103, 247}}, {{101, 247}, {287, 247}, {103, 247}},
{{102, 248}, {288, 248}, {290, 248}}, {{102, 248}, {288, 248}, {290, 248}},
{{99, 249}, {289, 249}, {101, 249}}, {{ 99, 249}, {289, 249}, {101, 249}},
{{100, 250}, {290, 250}, {292, 250}}, {{100, 250}, {290, 250}, {292, 250}},
{{99, 251}, {293, 251}, {291, 251}}, {{ 99, 251}, {293, 251}, {291, 251}},
{{294, 252}, {100, 252}, {292, 252}}, {{294, 252}, {100, 252}, {292, 252}},
{{95, 253}, {293, 253}, {97, 253}}, {{ 95, 253}, {293, 253}, { 97, 253}},
{{96, 254}, {294, 254}, {296, 254}}, {{ 96, 254}, {294, 254}, {296, 254}},
{{95, 255}, {297, 255}, {295, 255}}, {{ 95, 255}, {297, 255}, {295, 255}},
{{298, 256}, {96, 256}, {296, 256}}, {{298, 256}, { 96, 256}, {296, 256}},
{{93, 257}, {299, 257}, {297, 257}}, {{ 93, 257}, {299, 257}, {297, 257}},
{{300, 258}, {94, 258}, {298, 258}}, {{300, 258}, { 94, 258}, {298, 258}},
{{308, 259}, {337, 259}, {307, 259}}, {{308, 259}, {337, 259}, {307, 259}},
{{308, 260}, {338, 260}, {328, 260}}, {{308, 260}, {338, 260}, {328, 260}},
{{307, 261}, {335, 261}, {306, 261}}, {{307, 261}, {335, 261}, {306, 261}},
{{307, 262}, {336, 262}, {338, 262}}, {{307, 262}, {336, 262}, {338, 262}},
{{306, 263}, {339, 263}, {305, 263}}, {{306, 263}, {339, 263}, {305, 263}},
{{306, 264}, {340, 264}, {336, 264}}, {{306, 264}, {340, 264}, {336, 264}},
{{88, 265}, {305, 265}, {339, 265}}, {{ 88, 265}, {305, 265}, {339, 265}},
{{305, 266}, {89, 266}, {340, 266}}, {{305, 266}, { 89, 266}, {340, 266}},
{{86, 267}, {339, 267}, {333, 267}}, {{ 86, 267}, {339, 267}, {333, 267}},
{{340, 268}, {87, 268}, {334, 268}}, {{340, 268}, { 87, 268}, {334, 268}},
{{84, 269}, {333, 269}, {329, 269}}, {{ 84, 269}, {333, 269}, {329, 269}},
{{334, 270}, {85, 270}, {330, 270}}, {{334, 270}, { 85, 270}, {330, 270}},
{{82, 271}, {329, 271}, {331, 271}}, {{ 82, 271}, {329, 271}, {331, 271}},
{{330, 272}, {83, 272}, {332, 272}}, {{330, 272}, { 83, 272}, {332, 272}},
{{329, 273}, {337, 273}, {331, 273}}, {{329, 273}, {337, 273}, {331, 273}},
{{338, 274}, {330, 274}, {332, 274}}, {{338, 274}, {330, 274}, {332, 274}},
{{333, 275}, {335, 275}, {329, 275}}, {{333, 275}, {335, 275}, {329, 275}},
{{334, 276}, {336, 276}, {340, 276}}, {{334, 276}, {336, 276}, {340, 276}},
{{331, 277}, {327, 277}, {325, 277}}, {{331, 277}, {327, 277}, {325, 277}},
{{332, 278}, {328, 278}, {338, 278}}, {{332, 278}, {328, 278}, {338, 278}},
{{80, 279}, {331, 279}, {325, 279}}, {{ 80, 279}, {331, 279}, {325, 279}},
{{332, 280}, {81, 280}, {326, 280}}, {{332, 280}, { 81, 280}, {326, 280}},
{{341, 281}, {214, 281}, {208, 281}}, {{341, 281}, {214, 281}, {208, 281}},
{{342, 282}, {215, 282}, {344, 282}}, {{342, 282}, {215, 282}, {344, 282}},
{{325, 283}, {208, 283}, {80, 283}}, {{325, 283}, {208, 283}, { 80, 283}},
{{326, 284}, {209, 284}, {342, 284}}, {{326, 284}, {209, 284}, {342, 284}},
{{214, 285}, {345, 285}, {78, 285}}, {{214, 285}, {345, 285}, { 78, 285}},
{{215, 286}, {346, 286}, {344, 286}}, {{215, 286}, {346, 286}, {344, 286}},
{{345, 287}, {91, 287}, {78, 287}}, {{345, 287}, { 91, 287}, { 78, 287}},
{{346, 288}, {92, 288}, {300, 288}}, {{346, 288}, { 92, 288}, {300, 288}},
{{323, 289}, {303, 289}, {76, 289}}, {{323, 289}, {303, 289}, { 76, 289}},
{{324, 290}, {303, 290}, {352, 290}}, {{324, 290}, {303, 290}, {352, 290}},
{{351, 291}, {77, 291}, {303, 291}}, {{351, 291}, { 77, 291}, {303, 291}},
{{352, 292}, {77, 292}, {350, 292}}, {{352, 292}, { 77, 292}, {350, 292}},
{{77, 293}, {347, 293}, {304, 293}}, {{ 77, 293}, {347, 293}, {304, 293}},
{{348, 294}, {77, 294}, {304, 294}}, {{348, 294}, { 77, 294}, {304, 294}},
{{304, 295}, {327, 295}, {308, 295}}, {{304, 295}, {327, 295}, {308, 295}},
{{328, 296}, {304, 296}, {308, 296}}, {{328, 296}, {304, 296}, {308, 296}},
{{327, 297}, {341, 297}, {325, 297}}, {{327, 297}, {341, 297}, {325, 297}},
{{328, 298}, {342, 298}, {348, 298}}, {{328, 298}, {342, 298}, {348, 298}},
{{295, 299}, {317, 299}, {309, 299}}, {{295, 299}, {317, 299}, {309, 299}},
{{318, 300}, {296, 300}, {310, 300}}, {{318, 300}, {296, 300}, {310, 300}},
{{315, 301}, {76, 301}, {75, 301}}, {{315, 301}, { 76, 301}, { 75, 301}},
{{316, 302}, {76, 302}, {324, 302}}, {{316, 302}, { 76, 302}, {324, 302}},
{{357, 303}, {302, 303}, {301, 303}}, {{357, 303}, {302, 303}, {301, 303}},
{{358, 304}, {302, 304}, {356, 304}}, {{358, 304}, {302, 304}, {356, 304}},
{{302, 305}, {353, 305}, {74, 305}}, {{302, 305}, {353, 305}, { 74, 305}},
{{354, 306}, {302, 306}, {74, 306}}, {{354, 306}, {302, 306}, { 74, 306}},
{{74, 307}, {315, 307}, {75, 307}}, {{ 74, 307}, {315, 307}, { 75, 307}},
{{316, 308}, {74, 308}, {75, 308}}, {{316, 308}, { 74, 308}, { 75, 308}},
{{291, 309}, {361, 309}, {363, 309}}, {{291, 309}, {361, 309}, {363, 309}},
{{362, 310}, {292, 310}, {364, 310}}, {{362, 310}, {292, 310}, {364, 310}},
{{363, 311}, {367, 311}, {365, 311}}, {{363, 311}, {367, 311}, {365, 311}},
@ -1792,14 +1792,14 @@ namespace suzanne {
{{364, 326}, {358, 326}, {366, 326}}, {{364, 326}, {358, 326}, {366, 326}},
{{291, 327}, {359, 327}, {289, 327}}, {{291, 327}, {359, 327}, {289, 327}},
{{292, 328}, {360, 328}, {364, 328}}, {{292, 328}, {360, 328}, {364, 328}},
{{359, 329}, {301, 329}, {73, 329}}, {{359, 329}, {301, 329}, { 73, 329}},
{{360, 330}, {301, 330}, {358, 330}}, {{360, 330}, {301, 330}, {358, 330}},
{{285, 331}, {289, 331}, {283, 331}}, {{285, 331}, {289, 331}, {283, 331}},
{{286, 332}, {290, 332}, {288, 332}}, {{286, 332}, {290, 332}, {288, 332}},
{{283, 333}, {359, 333}, {73, 333}}, {{283, 333}, {359, 333}, { 73, 333}},
{{360, 334}, {284, 334}, {73, 334}}, {{360, 334}, {284, 334}, { 73, 334}},
{{72, 335}, {283, 335}, {73, 335}}, {{ 72, 335}, {283, 335}, { 73, 335}},
{{73, 336}, {284, 336}, {72, 336}}, {{ 73, 336}, {284, 336}, { 72, 336}},
{{295, 337}, {361, 337}, {293, 337}}, {{295, 337}, {361, 337}, {293, 337}},
{{296, 338}, {362, 338}, {310, 338}}, {{296, 338}, {362, 338}, {310, 338}},
{{309, 339}, {367, 339}, {361, 339}}, {{309, 339}, {367, 339}, {361, 339}},
@ -1958,74 +1958,74 @@ namespace suzanne {
{{504, 487}, {314, 487}, {322, 487}}, {{504, 487}, {314, 487}, {322, 487}},
{{319, 488}, {503, 488}, {389, 488}}, {{319, 488}, {503, 488}, {389, 488}},
{{504, 489}, {320, 489}, {390, 489}}, {{504, 489}, {320, 489}, {390, 489}},
{{46, 490}, { 0, 490}, { 2, 490}}, {{ 46, 490}, { 0, 490}, { 2, 490}},
{{ 3, 491}, { 1, 491}, {47, 491}}, {{ 3, 491}, { 1, 491}, { 47, 491}},
{{44, 492}, { 2, 492}, { 4, 492}}, {{ 44, 492}, { 2, 492}, { 4, 492}},
{{ 5, 493}, { 3, 493}, {45, 493}}, {{ 5, 493}, { 3, 493}, { 45, 493}},
{{ 2, 494}, { 8, 494}, { 6, 494}}, {{ 2, 494}, { 8, 494}, { 6, 494}},
{{ 7, 495}, { 9, 495}, { 3, 495}}, {{ 7, 495}, { 9, 495}, { 3, 495}},
{{ 0, 496}, {10, 496}, { 8, 496}}, {{ 0, 496}, { 10, 496}, { 8, 496}},
{{ 9, 497}, {11, 497}, { 1, 497}}, {{ 9, 497}, { 11, 497}, { 1, 497}},
{{10, 498}, {12, 498}, {14, 498}}, {{ 10, 498}, { 12, 498}, { 14, 498}},
{{15, 499}, {13, 499}, {11, 499}}, {{ 15, 499}, { 13, 499}, { 11, 499}},
{{ 8, 500}, {14, 500}, {16, 500}}, {{ 8, 500}, { 14, 500}, { 16, 500}},
{{17, 501}, {15, 501}, { 9, 501}}, {{ 17, 501}, { 15, 501}, { 9, 501}},
{{20, 502}, {18, 502}, {16, 502}}, {{ 20, 502}, { 18, 502}, { 16, 502}},
{{21, 503}, {15, 503}, {17, 503}}, {{ 21, 503}, { 15, 503}, { 17, 503}},
{{22, 504}, {20, 504}, {14, 504}}, {{ 22, 504}, { 20, 504}, { 14, 504}},
{{23, 505}, {13, 505}, {15, 505}}, {{ 23, 505}, { 13, 505}, { 15, 505}},
{{22, 506}, {24, 506}, {26, 506}}, {{ 22, 506}, { 24, 506}, { 26, 506}},
{{27, 507}, {25, 507}, {23, 507}}, {{ 27, 507}, { 25, 507}, { 23, 507}},
{{26, 508}, {28, 508}, {18, 508}}, {{ 26, 508}, { 28, 508}, { 18, 508}},
{{27, 509}, {21, 509}, {19, 509}}, {{ 27, 509}, { 21, 509}, { 19, 509}},
{{32, 510}, {30, 510}, {28, 510}}, {{ 32, 510}, { 30, 510}, { 28, 510}},
{{33, 511}, {27, 511}, {29, 511}}, {{ 33, 511}, { 27, 511}, { 29, 511}},
{{34, 512}, {32, 512}, {26, 512}}, {{ 34, 512}, { 32, 512}, { 26, 512}},
{{35, 513}, {25, 513}, {27, 513}}, {{ 35, 513}, { 25, 513}, { 27, 513}},
{{36, 514}, {38, 514}, {32, 514}}, {{ 36, 514}, { 38, 514}, { 32, 514}},
{{37, 515}, {35, 515}, {33, 515}}, {{ 37, 515}, { 35, 515}, { 33, 515}},
{{38, 516}, {40, 516}, {30, 516}}, {{ 38, 516}, { 40, 516}, { 30, 516}},
{{39, 517}, {33, 517}, {31, 517}}, {{ 39, 517}, { 33, 517}, { 31, 517}},
{{44, 518}, {42, 518}, {40, 518}}, {{ 44, 518}, { 42, 518}, { 40, 518}},
{{45, 519}, {39, 519}, {41, 519}}, {{ 45, 519}, { 39, 519}, { 41, 519}},
{{46, 520}, {44, 520}, {38, 520}}, {{ 46, 520}, { 44, 520}, { 38, 520}},
{{47, 521}, {37, 521}, {39, 521}}, {{ 47, 521}, { 37, 521}, { 39, 521}},
{{36, 522}, {50, 522}, {48, 522}}, {{ 36, 522}, { 50, 522}, { 48, 522}},
{{37, 523}, {47, 523}, {49, 523}}, {{ 37, 523}, { 47, 523}, { 49, 523}},
{{34, 524}, {52, 524}, {50, 524}}, {{ 34, 524}, { 52, 524}, { 50, 524}},
{{35, 525}, {37, 525}, {51, 525}}, {{ 35, 525}, { 37, 525}, { 51, 525}},
{{24, 526}, {54, 526}, {52, 526}}, {{ 24, 526}, { 54, 526}, { 52, 526}},
{{25, 527}, {35, 527}, {53, 527}}, {{ 25, 527}, { 35, 527}, { 53, 527}},
{{22, 528}, {56, 528}, {54, 528}}, {{ 22, 528}, { 56, 528}, { 54, 528}},
{{23, 529}, {25, 529}, {55, 529}}, {{ 23, 529}, { 25, 529}, { 55, 529}},
{{22, 530}, {12, 530}, {58, 530}}, {{ 22, 530}, { 12, 530}, { 58, 530}},
{{59, 531}, {13, 531}, {23, 531}}, {{ 59, 531}, { 13, 531}, { 23, 531}},
{{12, 532}, {10, 532}, {62, 532}}, {{ 12, 532}, { 10, 532}, { 62, 532}},
{{63, 533}, {11, 533}, {13, 533}}, {{ 63, 533}, { 11, 533}, { 13, 533}},
{{10, 534}, { 0, 534}, {64, 534}}, {{ 10, 534}, { 0, 534}, { 64, 534}},
{{65, 535}, { 1, 535}, {11, 535}}, {{ 65, 535}, { 1, 535}, { 11, 535}},
{{ 0, 536}, {46, 536}, {48, 536}}, {{ 0, 536}, { 46, 536}, { 48, 536}},
{{49, 537}, {47, 537}, { 1, 537}}, {{ 49, 537}, { 47, 537}, { 1, 537}},
{{173, 538}, {175, 538}, {90, 538}}, {{173, 538}, {175, 538}, { 90, 538}},
{{174, 539}, {89, 539}, {90, 539}}, {{174, 539}, { 89, 539}, { 90, 539}},
{{171, 540}, {173, 540}, {88, 540}}, {{171, 540}, {173, 540}, { 88, 540}},
{{172, 541}, {87, 541}, {89, 541}}, {{172, 541}, { 87, 541}, { 89, 541}},
{{84, 542}, {169, 542}, {171, 542}}, {{ 84, 542}, {169, 542}, {171, 542}},
{{172, 543}, {170, 543}, {85, 543}}, {{172, 543}, {170, 543}, { 85, 543}},
{{82, 544}, {167, 544}, {169, 544}}, {{ 82, 544}, {167, 544}, {169, 544}},
{{170, 545}, {168, 545}, {83, 545}}, {{170, 545}, {168, 545}, { 83, 545}},
{{80, 546}, {165, 546}, {167, 546}}, {{ 80, 546}, {165, 546}, {167, 546}},
{{168, 547}, {166, 547}, {81, 547}}, {{168, 547}, {166, 547}, { 81, 547}},
{{78, 548}, {91, 548}, {145, 548}}, {{ 78, 548}, { 91, 548}, {145, 548}},
{{146, 549}, {92, 549}, {79, 549}}, {{146, 549}, { 92, 549}, { 79, 549}},
{{93, 550}, {147, 550}, {145, 550}}, {{ 93, 550}, {147, 550}, {145, 550}},
{{94, 551}, {92, 551}, {146, 551}}, {{ 94, 551}, { 92, 551}, {146, 551}},
{{93, 552}, {95, 552}, {149, 552}}, {{ 93, 552}, { 95, 552}, {149, 552}},
{{150, 553}, {96, 553}, {94, 553}}, {{150, 553}, { 96, 553}, { 94, 553}},
{{97, 554}, {151, 554}, {149, 554}}, {{ 97, 554}, {151, 554}, {149, 554}},
{{98, 555}, {96, 555}, {150, 555}}, {{ 98, 555}, { 96, 555}, {150, 555}},
{{99, 556}, {153, 556}, {151, 556}}, {{ 99, 556}, {153, 556}, {151, 556}},
{{100, 557}, {98, 557}, {152, 557}}, {{100, 557}, { 98, 557}, {152, 557}},
{{101, 558}, {155, 558}, {153, 558}}, {{101, 558}, {155, 558}, {153, 558}},
{{102, 559}, {100, 559}, {154, 559}}, {{102, 559}, {100, 559}, {154, 559}},
{{101, 560}, {103, 560}, {157, 560}}, {{101, 560}, {103, 560}, {157, 560}},
@ -2034,8 +2034,8 @@ namespace suzanne {
{{106, 563}, {104, 563}, {158, 563}}, {{106, 563}, {104, 563}, {158, 563}},
{{107, 564}, {161, 564}, {159, 564}}, {{107, 564}, {161, 564}, {159, 564}},
{{108, 565}, {106, 565}, {160, 565}}, {{108, 565}, {106, 565}, {160, 565}},
{{66, 566}, {67, 566}, {161, 566}}, {{ 66, 566}, { 67, 566}, {161, 566}},
{{66, 567}, {108, 567}, {162, 567}}, {{ 66, 567}, {108, 567}, {162, 567}},
{{127, 568}, {159, 568}, {161, 568}}, {{127, 568}, {159, 568}, {161, 568}},
{{128, 569}, {110, 569}, {162, 569}}, {{128, 569}, {110, 569}, {162, 569}},
{{127, 570}, {178, 570}, {157, 570}}, {{127, 570}, {178, 570}, {157, 570}},
@ -2056,10 +2056,10 @@ namespace suzanne {
{{146, 585}, {164, 585}, {114, 585}}, {{146, 585}, {164, 585}, {114, 585}},
{{113, 586}, {180, 586}, {176, 586}}, {{113, 586}, {180, 586}, {176, 586}},
{{176, 587}, {181, 587}, {114, 587}}, {{176, 587}, {181, 587}, {114, 587}},
{{161, 588}, {67, 588}, {111, 588}}, {{161, 588}, { 67, 588}, {111, 588}},
{{162, 589}, {110, 589}, {112, 589}}, {{162, 589}, {110, 589}, {112, 589}},
{{111, 590}, {67, 590}, {177, 590}}, {{111, 590}, { 67, 590}, {177, 590}},
{{177, 591}, {67, 591}, {112, 591}}, {{177, 591}, { 67, 591}, {112, 591}},
{{180, 592}, {182, 592}, {177, 592}}, {{180, 592}, {182, 592}, {177, 592}},
{{181, 593}, {176, 593}, {177, 593}}, {{181, 593}, {176, 593}, {177, 593}},
{{134, 594}, {136, 594}, {175, 594}}, {{134, 594}, {136, 594}, {175, 594}},
@ -2074,23 +2074,23 @@ namespace suzanne {
{{168, 603}, {170, 603}, {131, 603}}, {{168, 603}, {170, 603}, {131, 603}},
{{189, 130}, {188, 130}, {186, 130}}, {{189, 130}, {188, 130}, {186, 130}},
{{189, 604}, {144, 604}, {187, 604}}, {{189, 604}, {144, 604}, {187, 604}},
{{186, 132}, {188, 132}, {68, 132}}, {{186, 132}, {188, 132}, { 68, 132}},
{{187, 605}, {185, 605}, {68, 605}}, {{187, 605}, {185, 605}, { 68, 605}},
{{130, 133}, {184, 133}, {68, 133}}, {{130, 133}, {184, 133}, { 68, 133}},
{{131, 133}, {129, 133}, {68, 133}}, {{131, 133}, {129, 133}, { 68, 133}},
{{141, 606}, {192, 606}, {190, 606}}, {{141, 606}, {192, 606}, {190, 606}},
{{191, 607}, {193, 607}, {142, 607}}, {{191, 607}, {193, 607}, {142, 607}},
{{194, 608}, {192, 608}, {141, 608}}, {{194, 608}, {192, 608}, {141, 608}},
{{195, 609}, {140, 609}, {142, 609}}, {{195, 609}, {140, 609}, {142, 609}},
{{196, 610}, {194, 610}, {139, 610}}, {{196, 610}, {194, 610}, {139, 610}},
{{197, 611}, {138, 611}, {140, 611}}, {{197, 611}, {138, 611}, {140, 611}},
{{70, 612}, {196, 612}, {138, 612}}, {{ 70, 612}, {196, 612}, {138, 612}},
{{143, 613}, {190, 613}, {69, 613}}, {{143, 613}, {190, 613}, { 69, 613}},
{{144, 614}, {189, 614}, {69, 614}}, {{144, 614}, {189, 614}, { 69, 614}},
{{190, 144}, {205, 144}, {207, 144}}, {{190, 144}, {205, 144}, {207, 144}},
{{191, 145}, {69, 145}, {207, 145}}, {{191, 145}, { 69, 145}, {207, 145}},
{{70, 615}, {198, 615}, {199, 615}}, {{ 70, 615}, {198, 615}, {199, 615}},
{{200, 616}, {198, 616}, {70, 616}}, {{200, 616}, {198, 616}, { 70, 616}},
{{196, 617}, {199, 617}, {201, 617}}, {{196, 617}, {199, 617}, {201, 617}},
{{202, 618}, {200, 618}, {197, 618}}, {{202, 618}, {200, 618}, {197, 618}},
{{201, 619}, {203, 619}, {192, 619}}, {{201, 619}, {203, 619}, {192, 619}},
@ -2110,12 +2110,12 @@ namespace suzanne {
{{186, 633}, {165, 633}, {212, 633}}, {{186, 633}, {165, 633}, {212, 633}},
{{187, 634}, {144, 634}, {213, 634}}, {{187, 634}, {144, 634}, {213, 634}},
{{208, 635}, {212, 635}, {165, 635}}, {{208, 635}, {212, 635}, {165, 635}},
{{209, 636}, {81, 636}, {166, 636}}, {{209, 636}, { 81, 636}, {166, 636}},
{{214, 637}, {210, 637}, {212, 637}}, {{214, 637}, {210, 637}, {212, 637}},
{{215, 638}, {209, 638}, {213, 638}}, {{215, 638}, {209, 638}, {213, 638}},
{{78, 639}, {163, 639}, {210, 639}}, {{ 78, 639}, {163, 639}, {210, 639}},
{{211, 640}, {164, 640}, {79, 640}}, {{211, 640}, {164, 640}, { 79, 640}},
{{129, 641}, {71, 641}, {221, 641}}, {{129, 641}, { 71, 641}, {221, 641}},
{{129, 642}, {131, 642}, {222, 642}}, {{129, 642}, {131, 642}, {222, 642}},
{{132, 643}, {130, 643}, {221, 643}}, {{132, 643}, {130, 643}, {221, 643}},
{{222, 644}, {131, 644}, {133, 644}}, {{222, 644}, {131, 644}, {133, 644}},
@ -2129,8 +2129,8 @@ namespace suzanne {
{{227, 650}, {220, 650}, {218, 650}}, {{227, 650}, {220, 650}, {218, 650}},
{{219, 140}, {221, 140}, {224, 140}}, {{219, 140}, {221, 140}, {224, 140}},
{{225, 182}, {222, 182}, {220, 182}}, {{225, 182}, {222, 182}, {220, 182}},
{{71, 183}, {223, 183}, {224, 183}}, {{ 71, 183}, {223, 183}, {224, 183}},
{{71, 184}, {222, 184}, {225, 184}}, {{ 71, 184}, {222, 184}, {225, 184}},
{{223, 651}, {230, 651}, {228, 651}}, {{223, 651}, {230, 651}, {228, 651}},
{{229, 652}, {230, 652}, {223, 652}}, {{229, 652}, {230, 652}, {223, 652}},
{{182, 653}, {180, 653}, {233, 653}}, {{182, 653}, {180, 653}, {233, 653}},
@ -2185,74 +2185,74 @@ namespace suzanne {
{{282, 700}, {232, 700}, {254, 700}}, {{282, 700}, {232, 700}, {254, 700}},
{{231, 701}, {233, 701}, {279, 701}}, {{231, 701}, {233, 701}, {279, 701}},
{{280, 702}, {234, 702}, {232, 702}}, {{280, 702}, {234, 702}, {232, 702}},
{{66, 703}, {107, 703}, {283, 703}}, {{ 66, 703}, {107, 703}, {283, 703}},
{{284, 704}, {108, 704}, {66, 704}}, {{284, 704}, {108, 704}, { 66, 704}},
{{107, 705}, {105, 705}, {285, 705}}, {{107, 705}, {105, 705}, {285, 705}},
{{286, 706}, {106, 706}, {108, 706}}, {{286, 706}, {106, 706}, {108, 706}},
{{103, 707}, {287, 707}, {285, 707}}, {{103, 707}, {287, 707}, {285, 707}},
{{104, 708}, {106, 708}, {286, 708}}, {{104, 708}, {106, 708}, {286, 708}},
{{101, 709}, {289, 709}, {287, 709}}, {{101, 709}, {289, 709}, {287, 709}},
{{102, 710}, {104, 710}, {288, 710}}, {{102, 710}, {104, 710}, {288, 710}},
{{99, 711}, {291, 711}, {289, 711}}, {{ 99, 711}, {291, 711}, {289, 711}},
{{100, 712}, {102, 712}, {290, 712}}, {{100, 712}, {102, 712}, {290, 712}},
{{99, 713}, {97, 713}, {293, 713}}, {{ 99, 713}, { 97, 713}, {293, 713}},
{{294, 714}, {98, 714}, {100, 714}}, {{294, 714}, { 98, 714}, {100, 714}},
{{95, 715}, {295, 715}, {293, 715}}, {{ 95, 715}, {295, 715}, {293, 715}},
{{96, 716}, {98, 716}, {294, 716}}, {{ 96, 716}, { 98, 716}, {294, 716}},
{{95, 717}, {93, 717}, {297, 717}}, {{ 95, 717}, { 93, 717}, {297, 717}},
{{298, 718}, {94, 718}, {96, 718}}, {{298, 718}, { 94, 718}, { 96, 718}},
{{93, 719}, {91, 719}, {299, 719}}, {{ 93, 719}, { 91, 719}, {299, 719}},
{{300, 720}, {92, 720}, {94, 720}}, {{300, 720}, { 92, 720}, { 94, 720}},
{{308, 721}, {327, 721}, {337, 721}}, {{308, 721}, {327, 721}, {337, 721}},
{{308, 722}, {307, 722}, {338, 722}}, {{308, 722}, {307, 722}, {338, 722}},
{{307, 723}, {337, 723}, {335, 723}}, {{307, 723}, {337, 723}, {335, 723}},
{{307, 724}, {306, 724}, {336, 724}}, {{307, 724}, {306, 724}, {336, 724}},
{{306, 725}, {335, 725}, {339, 725}}, {{306, 725}, {335, 725}, {339, 725}},
{{306, 726}, {305, 726}, {340, 726}}, {{306, 726}, {305, 726}, {340, 726}},
{{88, 727}, {90, 727}, {305, 727}}, {{ 88, 727}, { 90, 727}, {305, 727}},
{{305, 728}, {90, 728}, {89, 728}}, {{305, 728}, { 90, 728}, { 89, 728}},
{{86, 729}, {88, 729}, {339, 729}}, {{ 86, 729}, { 88, 729}, {339, 729}},
{{340, 730}, {89, 730}, {87, 730}}, {{340, 730}, { 89, 730}, { 87, 730}},
{{84, 731}, {86, 731}, {333, 731}}, {{ 84, 731}, { 86, 731}, {333, 731}},
{{334, 732}, {87, 732}, {85, 732}}, {{334, 732}, { 87, 732}, { 85, 732}},
{{82, 733}, {84, 733}, {329, 733}}, {{ 82, 733}, { 84, 733}, {329, 733}},
{{330, 734}, {85, 734}, {83, 734}}, {{330, 734}, { 85, 734}, { 83, 734}},
{{329, 735}, {335, 735}, {337, 735}}, {{329, 735}, {335, 735}, {337, 735}},
{{338, 736}, {336, 736}, {330, 736}}, {{338, 736}, {336, 736}, {330, 736}},
{{333, 737}, {339, 737}, {335, 737}}, {{333, 737}, {339, 737}, {335, 737}},
{{334, 738}, {330, 738}, {336, 738}}, {{334, 738}, {330, 738}, {336, 738}},
{{331, 739}, {337, 739}, {327, 739}}, {{331, 739}, {337, 739}, {327, 739}},
{{332, 740}, {326, 740}, {328, 740}}, {{332, 740}, {326, 740}, {328, 740}},
{{80, 741}, {82, 741}, {331, 741}}, {{ 80, 741}, { 82, 741}, {331, 741}},
{{332, 742}, {83, 742}, {81, 742}}, {{332, 742}, { 83, 742}, { 81, 742}},
{{341, 743}, {343, 743}, {214, 743}}, {{341, 743}, {343, 743}, {214, 743}},
{{342, 744}, {209, 744}, {215, 744}}, {{342, 744}, {209, 744}, {215, 744}},
{{325, 745}, {341, 745}, {208, 745}}, {{325, 745}, {341, 745}, {208, 745}},
{{326, 746}, {81, 746}, {209, 746}}, {{326, 746}, { 81, 746}, {209, 746}},
{{214, 747}, {343, 747}, {345, 747}}, {{214, 747}, {343, 747}, {345, 747}},
{{215, 748}, {79, 748}, {346, 748}}, {{215, 748}, { 79, 748}, {346, 748}},
{{345, 749}, {299, 749}, {91, 749}}, {{345, 749}, {299, 749}, { 91, 749}},
{{346, 750}, {79, 750}, {92, 750}}, {{346, 750}, { 79, 750}, { 92, 750}},
{{323, 751}, {351, 751}, {303, 751}}, {{323, 751}, {351, 751}, {303, 751}},
{{324, 752}, {76, 752}, {303, 752}}, {{324, 752}, { 76, 752}, {303, 752}},
{{351, 753}, {349, 753}, {77, 753}}, {{351, 753}, {349, 753}, { 77, 753}},
{{352, 754}, {303, 754}, {77, 754}}, {{352, 754}, {303, 754}, { 77, 754}},
{{77, 755}, {349, 755}, {347, 755}}, {{ 77, 755}, {349, 755}, {347, 755}},
{{348, 756}, {350, 756}, {77, 756}}, {{348, 756}, {350, 756}, { 77, 756}},
{{304, 757}, {347, 757}, {327, 757}}, {{304, 757}, {347, 757}, {327, 757}},
{{328, 758}, {348, 758}, {304, 758}}, {{328, 758}, {348, 758}, {304, 758}},
{{327, 759}, {347, 759}, {341, 759}}, {{327, 759}, {347, 759}, {341, 759}},
{{328, 760}, {326, 760}, {342, 760}}, {{328, 760}, {326, 760}, {342, 760}},
{{295, 761}, {297, 761}, {317, 761}}, {{295, 761}, {297, 761}, {317, 761}},
{{318, 762}, {298, 762}, {296, 762}}, {{318, 762}, {298, 762}, {296, 762}},
{{315, 763}, {323, 763}, {76, 763}}, {{315, 763}, {323, 763}, { 76, 763}},
{{316, 764}, {75, 764}, {76, 764}}, {{316, 764}, { 75, 764}, { 76, 764}},
{{357, 765}, {355, 765}, {302, 765}}, {{357, 765}, {355, 765}, {302, 765}},
{{358, 766}, {301, 766}, {302, 766}}, {{358, 766}, {301, 766}, {302, 766}},
{{302, 767}, {355, 767}, {353, 767}}, {{302, 767}, {355, 767}, {353, 767}},
{{354, 768}, {356, 768}, {302, 768}}, {{354, 768}, {356, 768}, {302, 768}},
{{74, 769}, {353, 769}, {315, 769}}, {{ 74, 769}, {353, 769}, {315, 769}},
{{316, 770}, {354, 770}, {74, 770}}, {{316, 770}, {354, 770}, { 74, 770}},
{{291, 771}, {293, 771}, {361, 771}}, {{291, 771}, {293, 771}, {361, 771}},
{{362, 772}, {294, 772}, {292, 772}}, {{362, 772}, {294, 772}, {292, 772}},
{{363, 773}, {361, 773}, {367, 773}}, {{363, 773}, {361, 773}, {367, 773}},
@ -2274,7 +2274,7 @@ namespace suzanne {
{{291, 789}, {363, 789}, {359, 789}}, {{291, 789}, {363, 789}, {359, 789}},
{{292, 790}, {290, 790}, {360, 790}}, {{292, 790}, {290, 790}, {360, 790}},
{{359, 791}, {357, 791}, {301, 791}}, {{359, 791}, {357, 791}, {301, 791}},
{{360, 792}, {73, 792}, {301, 792}}, {{360, 792}, { 73, 792}, {301, 792}},
{{285, 793}, {287, 793}, {289, 793}}, {{285, 793}, {287, 793}, {289, 793}},
{{286, 794}, {284, 794}, {290, 794}}, {{286, 794}, {284, 794}, {290, 794}},
{{283, 795}, {289, 795}, {359, 795}}, {{283, 795}, {289, 795}, {359, 795}},
@ -2426,7 +2426,7 @@ namespace suzanne {
{{319, 939}, {321, 939}, {503, 939}}, {{319, 939}, {321, 939}, {503, 939}},
{{504, 940}, {322, 940}, {320, 940}}, {{504, 940}, {322, 940}, {320, 940}},
}; };
constexpr uint32_t num_faces = (sizeof (faces)) / (sizeof (face)); constexpr uint32_t num_faces = (sizeof (faces)) / (sizeof (face_vn));
} }

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +1,5 @@
#pragma once
#include <cstdint> #include <cstdint>
#include "../float_uint32.hpp" #include "../float_uint32.hpp"
@ -35,41 +37,53 @@ namespace ta_alloc_ctrl {
namespace opb_mode { namespace opb_mode {
constexpr uint32_t increasing_addresses = 0 << 20; constexpr uint32_t increasing_addresses = 0 << 20;
constexpr uint32_t decreasing_addresses = 1 << 20; constexpr uint32_t decreasing_addresses = 1 << 20;
constexpr uint32_t bit_mask = 0x1 << 20;
} }
namespace pt_opb { namespace pt_opb {
constexpr uint32_t no_list = 0 << 16; constexpr uint32_t no_list = 0 << 16;
constexpr uint32_t _8x4byte = 1 << 16; constexpr uint32_t _8x4byte = 1 << 16;
constexpr uint32_t _16x4byte = 2 << 16; constexpr uint32_t _16x4byte = 2 << 16;
constexpr uint32_t _32x4byte = 3 << 16; constexpr uint32_t _32x4byte = 3 << 16;
constexpr uint32_t bit_mask = 0x3 << 16;
} }
namespace tm_opb { namespace tm_opb {
constexpr uint32_t no_list = 0 << 12; constexpr uint32_t no_list = 0 << 12;
constexpr uint32_t _8x4byte = 1 << 12; constexpr uint32_t _8x4byte = 1 << 12;
constexpr uint32_t _16x4byte = 2 << 12; constexpr uint32_t _16x4byte = 2 << 12;
constexpr uint32_t _32x4byte = 3 << 12; constexpr uint32_t _32x4byte = 3 << 12;
constexpr uint32_t bit_mask = 0x3 << 12;
} }
namespace t_opb { namespace t_opb {
constexpr uint32_t no_list = 0 << 8; constexpr uint32_t no_list = 0 << 8;
constexpr uint32_t _8x4byte = 1 << 8; constexpr uint32_t _8x4byte = 1 << 8;
constexpr uint32_t _16x4byte = 2 << 8; constexpr uint32_t _16x4byte = 2 << 8;
constexpr uint32_t _32x4byte = 3 << 8; constexpr uint32_t _32x4byte = 3 << 8;
constexpr uint32_t bit_mask = 0x3 << 8;
} }
namespace om_opb { namespace om_opb {
constexpr uint32_t no_list = 0 << 4; constexpr uint32_t no_list = 0 << 4;
constexpr uint32_t _8x4byte = 1 << 4; constexpr uint32_t _8x4byte = 1 << 4;
constexpr uint32_t _16x4byte = 2 << 4; constexpr uint32_t _16x4byte = 2 << 4;
constexpr uint32_t _32x4byte = 3 << 4; constexpr uint32_t _32x4byte = 3 << 4;
constexpr uint32_t bit_mask = 0x3 << 4;
} }
namespace o_opb { namespace o_opb {
constexpr uint32_t no_list = 0 << 0; constexpr uint32_t no_list = 0 << 0;
constexpr uint32_t _8x4byte = 1 << 0; constexpr uint32_t _8x4byte = 1 << 0;
constexpr uint32_t _16x4byte = 2 << 0; constexpr uint32_t _16x4byte = 2 << 0;
constexpr uint32_t _32x4byte = 3 << 0; constexpr uint32_t _32x4byte = 3 << 0;
constexpr uint32_t bit_mask = 0x3 << 0;
} }
} }
@ -85,13 +99,17 @@ namespace ta_yuv_tex_ctrl {
namespace yuv_form { namespace yuv_form {
constexpr uint32_t yuv420 = 0 << 24; constexpr uint32_t yuv420 = 0 << 24;
constexpr uint32_t yuv422 = 1 << 24; constexpr uint32_t yuv422 = 1 << 24;
constexpr uint32_t bit_mask = 0x1 << 24;
} }
namespace yuv_tex { namespace yuv_tex {
constexpr uint32_t one_texture = 0 << 16; constexpr uint32_t one_texture = 0 << 16;
constexpr uint32_t multiple_textures = 1 << 16; constexpr uint32_t multiple_textures = 1 << 16;
constexpr uint32_t bit_mask = 0x1 << 16;
} }
constexpr uint32_t yuv_v_size(uint32_t num) { return (num & 0x3f) << 8; } constexpr uint32_t yuv_v_size(uint32_t num) { return (num & 0x3f) << 8; }
constexpr uint32_t yuv_u_size(uint32_t num) { return (num & 0x3f) << 0; } constexpr uint32_t yuv_u_size(uint32_t num) { return (num & 0x3f) << 0; }
} }

View File

@ -3,8 +3,8 @@
#include "align.hpp" #include "align.hpp"
#include "sh7091.hpp" #include "sh7091/sh7091.hpp"
#include "sh7091_bits.hpp" #include "sh7091/sh7091_bits.hpp"
#include "systembus.hpp" #include "systembus.hpp"
#include "systembus_bits.hpp" #include "systembus_bits.hpp"
@ -97,9 +97,11 @@ void init_block_write(uint32_t * command_buf, uint32_t * receive_buf,
void dma_start(uint32_t * command_buf) void dma_start(uint32_t * command_buf)
{ {
sh7091.DMAC.DMAOR = DMAOR__DDT // on-demand data transfer mode using namespace dmac;
| DMAOR__PR__CH2_CH0_CH1_CH3 // priority mode; CH2 > CH0 > CH1 > CH3
| DMAOR__DME; // DMAC master enable sh7091.DMAC.DMAOR = dmaor::ddt::on_demand_data_transfer_mode /* on-demand data transfer mode */
| dmaor::pr::ch2_ch0_ch1_ch3 /* priority mode; CH2 > CH0 > CH1 > CH3 */
| dmaor::dme::operation_enabled_on_all_channels; /* DMAC master enable */
// clear maple-DMA end status // clear maple-DMA end status
system.ISTNRM = ISTNRM__END_OF_DMA_MAPLE_DMA; system.ISTNRM = ISTNRM__END_OF_DMA_MAPLE_DMA;

View File

@ -43,4 +43,34 @@ void init_host_command_all_ports(uint32_t * command_buf, uint32_t * receive_buf,
host_command[3].bus_data.data_fields = data_fields; host_command[3].bus_data.data_fields = data_fields;
} }
template <typename C, typename R>
void init_host_command_all_ports(uint32_t * command_buf, uint32_t * receive_buf)
{
using command_type = maple::host_command<typename C::data_fields>;
using response_type = maple::command_response<typename R::data_fields>;
auto host_command = reinterpret_cast<command_type *>(command_buf);
auto response_command = reinterpret_cast<response_type *>(receive_buf);
init_host_command((uint32_t*)&host_command[0], (uint32_t*)&response_command[0],
host_instruction::port_select::a, // destination_port
ap::de::device | ap::port_select::a, C::command_code, (sizeof (typename C::data_fields)),
false); // end_flag
init_host_command((uint32_t*)&host_command[1], (uint32_t*)&response_command[1],
host_instruction::port_select::b, // destination_port
ap::de::device | ap::port_select::b, C::command_code, (sizeof (typename C::data_fields)),
false); // end_flag
init_host_command((uint32_t*)&host_command[2], (uint32_t*)&response_command[2],
host_instruction::port_select::c, // destination_port
ap::de::device | ap::port_select::c, C::command_code, (sizeof (typename C::data_fields)),
false); // end_flag
init_host_command((uint32_t*)&host_command[3], (uint32_t*)&response_command[3],
host_instruction::port_select::d, // destination_port
ap::de::device | ap::port_select::d, C::command_code, (sizeof (typename C::data_fields)),
true); // end_flag
}
} }

View File

@ -107,6 +107,12 @@ inline constexpr vec<2, T> operator*(vec<2, T> const& v1, T const& scalar)
return v1 * vec<2, T>(scalar); return v1 * vec<2, T>(scalar);
} }
template <typename T>
inline constexpr vec<2, T> operator*(T const& scalar, vec<2, T> const& v1)
{
return vec<2, T>(scalar) * v1;
}
template <typename T> template <typename T>
inline constexpr vec<2, T> operator/(vec<2, T> const& v1, vec<2, T> const& v2) inline constexpr vec<2, T> operator/(vec<2, T> const& v1, vec<2, T> const& v2)
{ {

View File

@ -9,24 +9,29 @@ namespace serial {
void init() void init()
{ {
using namespace scif;
sh7091.SCIF.SCSCR2 = 0; sh7091.SCIF.SCSCR2 = 0;
sh7091.SCIF.SCSMR2 = 0; sh7091.SCIF.SCSMR2 = 0;
sh7091.SCIF.SCBRR2 = 1; // 520833.3 sh7091.SCIF.SCBRR2 = 1; // 520833.3
sh7091.SCIF.SCFCR2 = SCFCR2__TFRST | SCFCR2__RFRST; sh7091.SCIF.SCFCR2 = scfcr2::tfrst::reset_operation_enabled
| scfcr2::rfrst::reset_operation_enabled;
// tx/rx trigger on 1 byte // tx/rx trigger on 1 byte
sh7091.SCIF.SCFCR2 = 0; sh7091.SCIF.SCFCR2 = 0;
sh7091.SCIF.SCSPTR2 = 0; sh7091.SCIF.SCSPTR2 = 0;
sh7091.SCIF.SCLSR2 = 0; sh7091.SCIF.SCLSR2 = 0;
sh7091.SCIF.SCSCR2 = SCSCR2__TE | SCSCR2__RE; sh7091.SCIF.SCSCR2 = scscr2::te::transmission_enabled
| scscr2::re::reception_enabled;
} }
void character(const char c) void character(const char c)
{ {
using namespace scif;
// wait for transmit fifo to become empty // wait for transmit fifo to become empty
while ((sh7091.SCIF.SCFSR2 & SCFSR2__TDFE) == 0); while ((sh7091.SCIF.SCFSR2 & scfsr2::tdfe::bit_mask) == 0);
for (int i = 0; i < 100000; i++) { for (int i = 0; i < 100000; i++) {
asm volatile ("nop;"); asm volatile ("nop;");

View File

@ -111,7 +111,7 @@ def generate_vertices(vertices):
else: else:
assert type(p_c) is Vertex assert type(p_c) is Vertex
p = p_c p = p_c
yield f"{{ {v.x:9f}f, {v.y:9f}f, {v.z:9f}f }}," yield f"{{ {p.x:9f}f, {p.y:9f}f, {p.z:9f}f }},"
yield "};" yield "};"
yield "" yield ""