example: restore several examples
The dump_* examples were removed because the serial_transfer example now handles that use-case more generically.
This commit is contained in:
parent
45c6bcf211
commit
fc536bd93a
@ -7,7 +7,8 @@ GENERATED ?=
|
|||||||
|
|
||||||
AARCH = -march=armv4 -mlittle-endian
|
AARCH = -march=armv4 -mlittle-endian
|
||||||
|
|
||||||
CARCH = -mno-thumb-interwork -march=armv4 -mtune=arm7di -mlittle-endian
|
CARCH = -mno-thumb-interwork -march=armv4 -mlittle-endian
|
||||||
|
#-mtune=arm7di
|
||||||
CFLAGS += -I$(dir $(MAKEFILE_PATH))/../..
|
CFLAGS += -I$(dir $(MAKEFILE_PATH))/../..
|
||||||
|
|
||||||
CXXFLAGS += -std=c++2a
|
CXXFLAGS += -std=c++2a
|
||||||
|
@ -24,33 +24,32 @@
|
|||||||
#include "math/math.hpp"
|
#include "math/math.hpp"
|
||||||
|
|
||||||
#include "maple/maple.hpp"
|
#include "maple/maple.hpp"
|
||||||
#include "maple/maple_impl.hpp"
|
#include "maple/maple_host_command_writer.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"
|
||||||
|
|
||||||
uint32_t _command_buf[(1024 + 32) / 4];
|
|
||||||
uint32_t _receive_buf[(1024 + 32) / 4];
|
|
||||||
|
|
||||||
static ft0::data_transfer::data_format data[4];
|
static ft0::data_transfer::data_format data[4];
|
||||||
|
|
||||||
void do_get_condition(uint32_t * command_buf,
|
uint32_t send_buf[1024] __attribute__((aligned(32)));
|
||||||
uint32_t * receive_buf)
|
uint32_t recv_buf[1024] __attribute__((aligned(32)));
|
||||||
|
|
||||||
|
void do_get_condition()
|
||||||
{
|
{
|
||||||
using command_type = get_condition;
|
auto writer = maple::host_command_writer(send_buf, recv_buf);
|
||||||
using response_type = data_transfer<ft0::data_transfer::data_format>;
|
|
||||||
|
|
||||||
get_condition::data_fields data_fields = {
|
using command_type = maple::get_condition;
|
||||||
.function_type = std::byteswap(function_type::controller)
|
using response_type = maple::data_transfer<ft0::data_transfer::data_format>;
|
||||||
};
|
|
||||||
|
|
||||||
const uint32_t command_size = maple::init_host_command_all_ports<command_type, response_type>(command_buf, receive_buf,
|
auto [host_command, host_response]
|
||||||
data_fields);
|
= writer.append_command_all_ports<command_type, response_type>();
|
||||||
using host_response_type = struct maple::host_response<response_type::data_fields>;
|
|
||||||
auto host_response = reinterpret_cast<host_response_type *>(receive_buf);
|
|
||||||
|
|
||||||
maple::dma_start(command_buf, command_size,
|
for (int port = 0; port < 4; port++) {
|
||||||
receive_buf, maple::sizeof_command(host_response));
|
auto& data_fields = host_command[port].bus_data.data_fields;
|
||||||
|
data_fields.function_type = std::byteswap(function_type::controller);
|
||||||
|
}
|
||||||
|
maple::dma_start(send_buf, writer.send_offset,
|
||||||
|
recv_buf, writer.recv_offset);
|
||||||
|
|
||||||
for (uint8_t port = 0; port < 4; port++) {
|
for (uint8_t port = 0; port < 4; port++) {
|
||||||
auto& bus_data = host_response[port].bus_data;
|
auto& bus_data = host_response[port].bus_data;
|
||||||
@ -62,8 +61,10 @@ void do_get_condition(uint32_t * command_buf,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
data[port].analog_axis_3 = data_fields.data.analog_axis_3;
|
for (int i = 0; i < 6; i++) {
|
||||||
data[port].analog_axis_4 = data_fields.data.analog_axis_4;
|
data[port].analog_coordinate_axis[i]
|
||||||
|
= data_fields.data.analog_coordinate_axis[i];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -232,9 +233,6 @@ uint32_t _ta_parameter_buf[((32 * 8192) + 32) / 4];
|
|||||||
|
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
uint32_t * command_buf = align_32byte(_command_buf);
|
|
||||||
uint32_t * receive_buf = align_32byte(_receive_buf);
|
|
||||||
|
|
||||||
video_output::set_mode_vga();
|
video_output::set_mode_vga();
|
||||||
|
|
||||||
// The address of `ta_parameter_buf` must be a multiple of 32 bytes.
|
// The address of `ta_parameter_buf` must be a multiple of 32 bytes.
|
||||||
@ -267,15 +265,15 @@ void main()
|
|||||||
float y_pos = 0;
|
float y_pos = 0;
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
do_get_condition(command_buf, receive_buf);
|
do_get_condition();
|
||||||
|
|
||||||
ta_polygon_converter_init(opb_size.total(),
|
ta_polygon_converter_init(opb_size.total(),
|
||||||
ta_alloc,
|
ta_alloc,
|
||||||
640 / 32,
|
640 / 32,
|
||||||
480 / 32);
|
480 / 32);
|
||||||
|
|
||||||
float x_ = static_cast<float>(data[0].analog_axis_3 - 0x80) / 127.f;
|
const float x_ = static_cast<float>(data[0].analog_coordinate_axis[2] - 0x80) / 127.f;
|
||||||
float y_ = static_cast<float>(data[0].analog_axis_4 - 0x80) / 127.f;
|
const float y_ = static_cast<float>(data[0].analog_coordinate_axis[3] - 0x80) / 127.f;
|
||||||
if (x_ > x_pos) x_pos += (0.09f * ((x_ - x_pos) * (x_ - x_pos)));
|
if (x_ > x_pos) x_pos += (0.09f * ((x_ - x_pos) * (x_ - x_pos)));
|
||||||
if (x_ < x_pos) x_pos -= (0.09f * ((x_ - x_pos) * (x_ - x_pos)));
|
if (x_ < x_pos) x_pos -= (0.09f * ((x_ - x_pos) * (x_ - x_pos)));
|
||||||
if (y_ > y_pos) y_pos += (0.09f * ((y_ - y_pos) * (y_ - y_pos)));
|
if (y_ > y_pos) y_pos += (0.09f * ((y_ - y_pos) * (y_ - y_pos)));
|
||||||
|
@ -25,33 +25,34 @@
|
|||||||
#include "math/geometry.hpp"
|
#include "math/geometry.hpp"
|
||||||
|
|
||||||
#include "maple/maple.hpp"
|
#include "maple/maple.hpp"
|
||||||
#include "maple/maple_impl.hpp"
|
#include "maple/maple_host_command_writer.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 "sh7091/serial.hpp"
|
#include "sh7091/serial.hpp"
|
||||||
|
|
||||||
uint32_t _command_buf[(1024 + 32) / 4];
|
|
||||||
uint32_t _receive_buf[(1024 + 32) / 4];
|
|
||||||
|
|
||||||
static ft0::data_transfer::data_format data[4];
|
static ft0::data_transfer::data_format data[4];
|
||||||
|
|
||||||
void do_get_condition(uint32_t * command_buf,
|
uint32_t send_buf[1024] __attribute__((aligned(32)));
|
||||||
uint32_t * receive_buf)
|
uint32_t recv_buf[1024] __attribute__((aligned(32)));
|
||||||
|
|
||||||
|
void do_get_condition()
|
||||||
{
|
{
|
||||||
using command_type = get_condition;
|
auto writer = maple::host_command_writer(send_buf, recv_buf);
|
||||||
using response_type = data_transfer<ft0::data_transfer::data_format>;
|
|
||||||
|
|
||||||
get_condition::data_fields data_fields = {
|
using command_type = maple::get_condition;
|
||||||
.function_type = std::byteswap(function_type::controller)
|
using response_type = maple::data_transfer<ft0::data_transfer::data_format>;
|
||||||
};
|
|
||||||
|
|
||||||
const uint32_t command_size = maple::init_host_command_all_ports<command_type, response_type>(command_buf, receive_buf, data_fields);
|
auto [host_command, host_response]
|
||||||
using host_response_type = struct maple::host_response<response_type::data_fields>;
|
= writer.append_command_all_ports<command_type, response_type>();
|
||||||
auto host_response = reinterpret_cast<host_response_type *>(receive_buf);
|
|
||||||
maple::dma_start(command_buf, command_size,
|
for (int port = 0; port < 4; port++) {
|
||||||
receive_buf, maple::sizeof_command(host_response));
|
auto& data_fields = host_command[port].bus_data.data_fields;
|
||||||
|
data_fields.function_type = std::byteswap(function_type::controller);
|
||||||
|
}
|
||||||
|
maple::dma_start(send_buf, writer.send_offset,
|
||||||
|
recv_buf, writer.recv_offset);
|
||||||
|
|
||||||
for (uint8_t port = 0; port < 4; port++) {
|
for (uint8_t port = 0; port < 4; port++) {
|
||||||
auto& bus_data = host_response[port].bus_data;
|
auto& bus_data = host_response[port].bus_data;
|
||||||
@ -63,10 +64,10 @@ void do_get_condition(uint32_t * command_buf,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
data[port].analog_axis_1 = data_fields.data.analog_axis_1;
|
for (int i = 0; i < 6; i++) {
|
||||||
data[port].analog_axis_2 = data_fields.data.analog_axis_2;
|
data[port].analog_coordinate_axis[i]
|
||||||
data[port].analog_axis_3 = data_fields.data.analog_axis_3;
|
= data_fields.data.analog_coordinate_axis[i];
|
||||||
data[port].analog_axis_4 = data_fields.data.analog_axis_4;
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -209,9 +210,6 @@ uint32_t _ta_parameter_buf[((32 * 8192) + 32) / 4];
|
|||||||
|
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
uint32_t * command_buf = align_32byte(_command_buf);
|
|
||||||
uint32_t * receive_buf = align_32byte(_receive_buf);
|
|
||||||
|
|
||||||
video_output::set_mode_vga();
|
video_output::set_mode_vga();
|
||||||
|
|
||||||
// The address of `ta_parameter_buf` must be a multiple of 32 bytes.
|
// The address of `ta_parameter_buf` must be a multiple of 32 bytes.
|
||||||
@ -244,22 +242,22 @@ void main()
|
|||||||
float y_pos = 0;
|
float y_pos = 0;
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
do_get_condition(command_buf, receive_buf);
|
do_get_condition();
|
||||||
|
|
||||||
ta_polygon_converter_init(opb_size.total(),
|
ta_polygon_converter_init(opb_size.total(),
|
||||||
ta_alloc,
|
ta_alloc,
|
||||||
640 / 32,
|
640 / 32,
|
||||||
480 / 32);
|
480 / 32);
|
||||||
|
|
||||||
const float l_ = static_cast<float>(data[0].analog_axis_1) * (1.f / 255.f);
|
const float l_ = static_cast<float>(data[0].analog_coordinate_axis[0]) * (1.f / 255.f);
|
||||||
const float r_ = static_cast<float>(data[0].analog_axis_2) * (1.f / 255.f);
|
const float r_ = static_cast<float>(data[0].analog_coordinate_axis[1]) * (1.f / 255.f);
|
||||||
const float t_ = ((l_ > r_) ? l_ : -r_) * 3.14f / 2.f;
|
const float t_ = ((l_ > r_) ? l_ : -r_) * 3.14f / 2.f;
|
||||||
|
|
||||||
if (t_ > theta) theta += (0.04f * ((t_ - theta) * (t_ - theta)));
|
if (t_ > theta) theta += (0.04f * ((t_ - theta) * (t_ - theta)));
|
||||||
else theta -= (0.04f * ((t_ - theta) * (t_ - theta)));
|
else theta -= (0.04f * ((t_ - theta) * (t_ - theta)));
|
||||||
|
|
||||||
const float x_ = static_cast<float>(data[0].analog_axis_3 - 0x80) / 127.f;
|
const float x_ = static_cast<float>(data[0].analog_coordinate_axis[2] - 0x80) / 127.f;
|
||||||
const float y_ = static_cast<float>(data[0].analog_axis_4 - 0x80) / 127.f;
|
const float y_ = static_cast<float>(data[0].analog_coordinate_axis[3] - 0x80) / 127.f;
|
||||||
if (x_ > x_pos) x_pos += (0.02f * ((x_ - x_pos) * (x_ - x_pos)));
|
if (x_ > x_pos) x_pos += (0.02f * ((x_ - x_pos) * (x_ - x_pos)));
|
||||||
else x_pos -= (0.02f * ((x_ - x_pos) * (x_ - x_pos)));
|
else x_pos -= (0.02f * ((x_ - x_pos) * (x_ - x_pos)));
|
||||||
if (y_ > y_pos) y_pos += (0.02f * ((y_ - y_pos) * (y_ - y_pos)));
|
if (y_ > y_pos) y_pos += (0.02f * ((y_ - y_pos) * (y_ - y_pos)));
|
||||||
|
@ -26,40 +26,38 @@
|
|||||||
#include "math/geometry.hpp"
|
#include "math/geometry.hpp"
|
||||||
|
|
||||||
#include "maple/maple.hpp"
|
#include "maple/maple.hpp"
|
||||||
#include "maple/maple_impl.hpp"
|
#include "maple/maple_host_command_writer.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 "twiddle.hpp"
|
#include "twiddle.hpp"
|
||||||
#include "macaw.hpp"
|
#include "texture/macaw/macaw.data.h"
|
||||||
|
|
||||||
uint32_t _command_buf[(1024 + 32) / 4];
|
|
||||||
uint32_t _receive_buf[(1024 + 32) / 4];
|
|
||||||
|
|
||||||
static ft0::data_transfer::data_format data[4];
|
static ft0::data_transfer::data_format data[4];
|
||||||
|
|
||||||
void do_get_condition(uint32_t * command_buf,
|
uint32_t send_buf[1024] __attribute__((aligned(32)));
|
||||||
uint32_t * receive_buf)
|
uint32_t recv_buf[1024] __attribute__((aligned(32)));
|
||||||
|
|
||||||
|
void do_get_condition()
|
||||||
{
|
{
|
||||||
using command_type = get_condition;
|
auto writer = maple::host_command_writer(send_buf, recv_buf);
|
||||||
using response_type = data_transfer<ft0::data_transfer::data_format>;
|
|
||||||
|
|
||||||
get_condition::data_fields data_fields = {
|
using command_type = maple::get_condition;
|
||||||
.function_type = std::byteswap(function_type::controller)
|
using response_type = maple::data_transfer<ft0::data_transfer::data_format>;
|
||||||
};
|
|
||||||
|
|
||||||
const uint32_t command_size = maple::init_host_command_all_ports<command_type, response_type>(command_buf, receive_buf,
|
auto [host_command, host_response]
|
||||||
data_fields);
|
= writer.append_command_all_ports<command_type, response_type>();
|
||||||
using host_response_type = struct maple::host_response<response_type::data_fields>;
|
|
||||||
auto host_response = reinterpret_cast<host_response_type *>(receive_buf);
|
for (int port = 0; port < 4; port++) {
|
||||||
maple::dma_start(command_buf, command_size,
|
auto& data_fields = host_command[port].bus_data.data_fields;
|
||||||
receive_buf, maple::sizeof_command(host_response));
|
data_fields.function_type = std::byteswap(function_type::controller);
|
||||||
|
}
|
||||||
|
maple::dma_start(send_buf, writer.send_offset,
|
||||||
|
recv_buf, writer.recv_offset);
|
||||||
|
|
||||||
using host_response_type = struct maple::host_response<response_type::data_fields>;
|
|
||||||
for (uint8_t port = 0; port < 4; port++) {
|
for (uint8_t port = 0; port < 4; port++) {
|
||||||
auto response = reinterpret_cast<host_response_type *>(receive_buf);
|
auto& bus_data = host_response[port].bus_data;
|
||||||
auto& bus_data = response[port].bus_data;
|
|
||||||
if (bus_data.command_code != response_type::command_code) {
|
if (bus_data.command_code != response_type::command_code) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -68,10 +66,10 @@ void do_get_condition(uint32_t * command_buf,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
data[port].analog_axis_1 = data_fields.data.analog_axis_1;
|
for (int i = 0; i < 6; i++) {
|
||||||
data[port].analog_axis_2 = data_fields.data.analog_axis_2;
|
data[port].analog_coordinate_axis[i]
|
||||||
data[port].analog_axis_3 = data_fields.data.analog_axis_3;
|
= data_fields.data.analog_coordinate_axis[i];
|
||||||
data[port].analog_axis_4 = data_fields.data.analog_axis_4;
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -229,8 +227,8 @@ void init_texture_memory(const struct opb_size& opb_size)
|
|||||||
|
|
||||||
void init_macaw_texture()
|
void init_macaw_texture()
|
||||||
{
|
{
|
||||||
auto src = reinterpret_cast<const uint8_t *>(&_binary_macaw_data_start);
|
auto src = reinterpret_cast<const uint8_t *>(&_binary_texture_macaw_macaw_data_start);
|
||||||
auto size = reinterpret_cast<const uint32_t>(&_binary_macaw_data_size);
|
auto size = reinterpret_cast<const uint32_t>(&_binary_texture_macaw_macaw_data_size);
|
||||||
auto texture = reinterpret_cast<volatile uint16_t *>(&texture_memory64[texture_memory_alloc::texture.start / 4]);
|
auto texture = reinterpret_cast<volatile uint16_t *>(&texture_memory64[texture_memory_alloc::texture.start / 4]);
|
||||||
|
|
||||||
uint16_t temp[size / 3];
|
uint16_t temp[size / 3];
|
||||||
@ -249,9 +247,6 @@ uint32_t _ta_parameter_buf[((32 * 8192) + 32) / 4];
|
|||||||
|
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
uint32_t * command_buf = align_32byte(_command_buf);
|
|
||||||
uint32_t * receive_buf = align_32byte(_receive_buf);
|
|
||||||
|
|
||||||
video_output::set_mode_vga();
|
video_output::set_mode_vga();
|
||||||
init_macaw_texture();
|
init_macaw_texture();
|
||||||
|
|
||||||
@ -285,22 +280,22 @@ void main()
|
|||||||
float y_pos = 0;
|
float y_pos = 0;
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
do_get_condition(command_buf, receive_buf);
|
do_get_condition();
|
||||||
|
|
||||||
ta_polygon_converter_init(opb_size.total(),
|
ta_polygon_converter_init(opb_size.total(),
|
||||||
ta_alloc,
|
ta_alloc,
|
||||||
640 / 32,
|
640 / 32,
|
||||||
480 / 32);
|
480 / 32);
|
||||||
|
|
||||||
const float l_ = static_cast<float>(data[0].analog_axis_1) * (1.f / 255.f);
|
const float l_ = static_cast<float>(data[0].analog_coordinate_axis[0]) * (1.f / 255.f);
|
||||||
const float r_ = static_cast<float>(data[0].analog_axis_2) * (1.f / 255.f);
|
const float r_ = static_cast<float>(data[0].analog_coordinate_axis[1]) * (1.f / 255.f);
|
||||||
const float t_ = ((l_ > r_) ? l_ : -r_) * 3.14f / 2.f;
|
const float t_ = ((l_ > r_) ? l_ : -r_) * 3.14f / 2.f;
|
||||||
|
|
||||||
if (t_ > theta) theta += (0.04f * ((t_ - theta) * (t_ - theta)));
|
if (t_ > theta) theta += (0.04f * ((t_ - theta) * (t_ - theta)));
|
||||||
else theta -= (0.04f * ((t_ - theta) * (t_ - theta)));
|
else theta -= (0.04f * ((t_ - theta) * (t_ - theta)));
|
||||||
|
|
||||||
const float x_ = static_cast<float>(data[0].analog_axis_3 - 0x80) / 127.f;
|
const float x_ = static_cast<float>(data[0].analog_coordinate_axis[2] - 0x80) / 127.f;
|
||||||
const float y_ = static_cast<float>(data[0].analog_axis_4 - 0x80) / 127.f;
|
const float y_ = static_cast<float>(data[0].analog_coordinate_axis[3] - 0x80) / 127.f;
|
||||||
if (x_ > x_pos) x_pos += (0.02f * ((x_ - x_pos) * (x_ - x_pos)));
|
if (x_ > x_pos) x_pos += (0.02f * ((x_ - x_pos) * (x_ - x_pos)));
|
||||||
else x_pos -= (0.02f * ((x_ - x_pos) * (x_ - x_pos)));
|
else x_pos -= (0.02f * ((x_ - x_pos) * (x_ - x_pos)));
|
||||||
if (y_ > y_pos) y_pos += (0.02f * ((y_ - y_pos) * (y_ - y_pos)));
|
if (y_ > y_pos) y_pos += (0.02f * ((y_ - y_pos) * (y_ - y_pos)));
|
||||||
|
@ -91,7 +91,7 @@ void transform(ta_parameter_writer& parameter,
|
|||||||
auto l = lights[0] - point;
|
auto l = lights[0] - point;
|
||||||
auto n_dot_l = dot(n, l);
|
auto n_dot_l = dot(n, l);
|
||||||
if (n_dot_l > 0) {
|
if (n_dot_l > 0) {
|
||||||
color.x += 0.35 * n_dot_l / (length(n) * length(l));
|
color.x += 0.35 * n_dot_l / (magnitude(n) * magnitude(l));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -99,7 +99,7 @@ void transform(ta_parameter_writer& parameter,
|
|||||||
auto l = lights[1] - point;
|
auto l = lights[1] - point;
|
||||||
auto n_dot_l = dot(n, l);
|
auto n_dot_l = dot(n, l);
|
||||||
if (n_dot_l > 0) {
|
if (n_dot_l > 0) {
|
||||||
color.y += 0.35 * n_dot_l / (length(n) * length(l));
|
color.y += 0.35 * n_dot_l / (magnitude(n) * magnitude(l));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,239 +0,0 @@
|
|||||||
#include <cstdint>
|
|
||||||
|
|
||||||
#include "align.hpp"
|
|
||||||
#include "holly/video_output.hpp"
|
|
||||||
|
|
||||||
#include "holly/texture_memory_alloc.hpp"
|
|
||||||
#include "holly/holly.hpp"
|
|
||||||
#include "holly/core.hpp"
|
|
||||||
#include "holly/core_bits.hpp"
|
|
||||||
#include "holly/ta_fifo_polygon_converter.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 "holly/region_array.hpp"
|
|
||||||
#include "holly/background.hpp"
|
|
||||||
#include "memorymap.hpp"
|
|
||||||
|
|
||||||
#include "sh7091/serial.hpp"
|
|
||||||
|
|
||||||
#include "macaw.hpp"
|
|
||||||
|
|
||||||
struct vertex {
|
|
||||||
float x;
|
|
||||||
float y;
|
|
||||||
float z;
|
|
||||||
};
|
|
||||||
|
|
||||||
const struct vertex strip_vertices[3] = {
|
|
||||||
// [ position ]
|
|
||||||
{ -0.5f, 0.5f, 0.f }, // the first two base colors in a
|
|
||||||
{ -0.5f, -0.5f, 0.f }, // non-Gouraud triangle strip are ignored
|
|
||||||
{ 0.5f, 0.5f, 0.f },
|
|
||||||
};
|
|
||||||
constexpr uint32_t strip_length = (sizeof (strip_vertices)) / (sizeof (struct vertex));
|
|
||||||
|
|
||||||
const struct vertex quad_verticies[4] = {
|
|
||||||
{ 200.f, 360.f, 0.1f },
|
|
||||||
{ 200.f, 120.f, 0.1f },
|
|
||||||
{ 440.f, 120.f, 0.1f },
|
|
||||||
{ 440.f, 360.f, 0.1f },
|
|
||||||
};
|
|
||||||
|
|
||||||
uint32_t transform(uint32_t * ta_parameter_buf,
|
|
||||||
const vertex * strip_vertices,
|
|
||||||
const uint32_t strip_length)
|
|
||||||
{
|
|
||||||
auto parameter = ta_parameter_writer(ta_parameter_buf);
|
|
||||||
|
|
||||||
const uint32_t parameter_control_word = para_control::para_type::sprite
|
|
||||||
//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;
|
|
||||||
|
|
||||||
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;
|
|
||||||
|
|
||||||
const uint32_t texture_control_word = 0;
|
|
||||||
|
|
||||||
constexpr uint32_t base_color = 0xffff0000;
|
|
||||||
|
|
||||||
/*
|
|
||||||
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++) {
|
|
||||||
float x = strip_vertices[i].x;
|
|
||||||
float y = strip_vertices[i].y;
|
|
||||||
float z = strip_vertices[i].z;
|
|
||||||
|
|
||||||
x *= 240.f;
|
|
||||||
y *= 240.f;
|
|
||||||
x += 320.f;
|
|
||||||
y += 240.f;
|
|
||||||
z = 1.f / (z + 10.f);
|
|
||||||
|
|
||||||
bool end_of_strip = i == strip_length - 1;
|
|
||||||
parameter.append<ta_vertex_parameter::polygon_type_0>() =
|
|
||||||
ta_vertex_parameter::polygon_type_0(polygon_vertex_parameter_control_word(end_of_strip),
|
|
||||||
x, y, z,
|
|
||||||
base_color
|
|
||||||
);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
parameter.append<ta_global_parameter::sprite>() =
|
|
||||||
ta_global_parameter::sprite(parameter_control_word,
|
|
||||||
isp_tsp_instruction_word,
|
|
||||||
tsp_instruction_word,
|
|
||||||
texture_control_word,
|
|
||||||
base_color,
|
|
||||||
0, // offset_color
|
|
||||||
0, // data_size_for_sort_dma
|
|
||||||
0); // next_address_for_sort_dma
|
|
||||||
|
|
||||||
parameter.append<ta_vertex_parameter::sprite_type_0>() =
|
|
||||||
ta_vertex_parameter::sprite_type_0(para_control::para_type::vertex_parameter,
|
|
||||||
quad_verticies[0].x,
|
|
||||||
quad_verticies[0].y,
|
|
||||||
quad_verticies[0].z,
|
|
||||||
quad_verticies[1].x,
|
|
||||||
quad_verticies[1].y,
|
|
||||||
quad_verticies[1].z,
|
|
||||||
quad_verticies[2].x,
|
|
||||||
quad_verticies[2].y,
|
|
||||||
quad_verticies[2].z,
|
|
||||||
quad_verticies[3].x,
|
|
||||||
quad_verticies[3].y);
|
|
||||||
|
|
||||||
parameter.append<ta_global_parameter::end_of_list>() = ta_global_parameter::end_of_list(para_control::para_type::end_of_list);
|
|
||||||
|
|
||||||
return parameter.offset;
|
|
||||||
}
|
|
||||||
|
|
||||||
void init_texture_memory(const struct opb_size& opb_size)
|
|
||||||
{
|
|
||||||
auto object_list = &texture_memory32[texture_memory_alloc::object_list.start / 4];
|
|
||||||
auto isp_tsp_parameters = &texture_memory32[texture_memory_alloc::isp_tsp_parameters.start / 4];
|
|
||||||
|
|
||||||
// zeroize
|
|
||||||
for (uint32_t i = 0; i < 0x00100000 / 4; i++) {
|
|
||||||
object_list[i] = 0xeeeeeeee;
|
|
||||||
isp_tsp_parameters[i] = 0xeeeeeeee;
|
|
||||||
}
|
|
||||||
|
|
||||||
region_array2(640 / 32, // width
|
|
||||||
480 / 32, // height
|
|
||||||
opb_size
|
|
||||||
);
|
|
||||||
background_parameter(0xff222200);
|
|
||||||
}
|
|
||||||
|
|
||||||
uint32_t _ta_parameter_buf[((32 * (strip_length + 2)) + 32) / 4];
|
|
||||||
|
|
||||||
union u32_u8 {
|
|
||||||
uint32_t u32;
|
|
||||||
uint8_t u8[4];
|
|
||||||
};
|
|
||||||
static_assert((sizeof (union u32_u8)) == 4);
|
|
||||||
|
|
||||||
void dump()
|
|
||||||
{
|
|
||||||
auto object_list = &texture_memory32[texture_memory_alloc::object_list.start / 4];
|
|
||||||
auto isp_tsp_parameters = &texture_memory32[texture_memory_alloc::isp_tsp_parameters.start / 4];
|
|
||||||
|
|
||||||
constexpr uint32_t screen_ol_size = 8 * 4 * (640 / 32) * (480 / 32);
|
|
||||||
for (uint32_t i = 0; i < (screen_ol_size + 0x100) / 4; i++) {
|
|
||||||
union u32_u8 n;
|
|
||||||
n.u32 = object_list[i];
|
|
||||||
|
|
||||||
if (((i * 4) & 0x1f) == 0)
|
|
||||||
serial::character('\n');
|
|
||||||
//if (((i * 4) & 0x3f) == 0)
|
|
||||||
// serial::character('\n');
|
|
||||||
|
|
||||||
serial::integer<uint32_t>(n.u32, ' ');
|
|
||||||
}
|
|
||||||
|
|
||||||
serial::character('\n');
|
|
||||||
serial::character('\n');
|
|
||||||
serial::character('\n');
|
|
||||||
|
|
||||||
for (uint32_t i = 0; i < (0x100) / 4; i++) {
|
|
||||||
union u32_u8 n;
|
|
||||||
n.u32 = isp_tsp_parameters[i];
|
|
||||||
|
|
||||||
if (((i * 4) & 0x1f) == 0)
|
|
||||||
serial::character('\n');
|
|
||||||
|
|
||||||
serial::integer<uint32_t>(n.u32, ' ');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void main()
|
|
||||||
{
|
|
||||||
video_output::set_mode_vga();
|
|
||||||
|
|
||||||
// The address of `ta_parameter_buf` must be a multiple of 32 bytes.
|
|
||||||
// This is mandatory for ch2-dma to the ta fifo polygon converter.
|
|
||||||
uint32_t * ta_parameter_buf = align_32byte(_ta_parameter_buf);
|
|
||||||
|
|
||||||
constexpr uint32_t ta_alloc = ta_alloc_ctrl::pt_opb::no_list
|
|
||||||
| ta_alloc_ctrl::tm_opb::no_list
|
|
||||||
| ta_alloc_ctrl::t_opb::no_list
|
|
||||||
| ta_alloc_ctrl::om_opb::no_list
|
|
||||||
| ta_alloc_ctrl::o_opb::_8x4byte;
|
|
||||||
|
|
||||||
constexpr struct opb_size opb_size = { .opaque = 8 * 4
|
|
||||||
, .opaque_modifier = 0
|
|
||||||
, .translucent = 0
|
|
||||||
, .translucent_modifier = 0
|
|
||||||
, .punch_through = 0
|
|
||||||
};
|
|
||||||
|
|
||||||
holly.SOFTRESET = softreset::pipeline_soft_reset
|
|
||||||
| softreset::ta_soft_reset;
|
|
||||||
holly.SOFTRESET = 0;
|
|
||||||
|
|
||||||
core_init();
|
|
||||||
init_texture_memory(opb_size);
|
|
||||||
|
|
||||||
uint32_t frame_ix = 0;
|
|
||||||
|
|
||||||
bool dumped = false;
|
|
||||||
while (true) {
|
|
||||||
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);
|
|
||||||
ta_polygon_converter_transfer(ta_parameter_buf, ta_parameter_size);
|
|
||||||
ta_wait_opaque_list();
|
|
||||||
|
|
||||||
core_start_render(frame_ix);
|
|
||||||
core_wait_end_of_render_video();
|
|
||||||
|
|
||||||
while (!spg_status::vsync(holly.SPG_STATUS));
|
|
||||||
core_flip(frame_ix);
|
|
||||||
while (spg_status::vsync(holly.SPG_STATUS));
|
|
||||||
|
|
||||||
frame_ix = (frame_ix + 1) & 1;
|
|
||||||
|
|
||||||
if (frame_ix == 10 && dumped == false) {
|
|
||||||
dump();
|
|
||||||
dumped = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,28 +0,0 @@
|
|||||||
#include <cstdint>
|
|
||||||
|
|
||||||
#include "memorymap.hpp"
|
|
||||||
|
|
||||||
#include "sh7091/serial.hpp"
|
|
||||||
|
|
||||||
void dump_ram(const volatile uint32_t * mem, const uint32_t len)
|
|
||||||
{
|
|
||||||
uint32_t sum = 0;
|
|
||||||
for (uint32_t i = 0; i < len; i++) {
|
|
||||||
uint8_t n = mem[i];
|
|
||||||
sum += n;
|
|
||||||
serial::hexlify(n);
|
|
||||||
if ((i & 0xf) == 0xf)
|
|
||||||
serial::character('\n');
|
|
||||||
}
|
|
||||||
serial::character('\n');
|
|
||||||
serial::integer<uint32_t>(sum);
|
|
||||||
}
|
|
||||||
|
|
||||||
void main()
|
|
||||||
{
|
|
||||||
// dump the first 64k of system memory
|
|
||||||
dump_ram(system_memory, 0x10000);
|
|
||||||
|
|
||||||
|
|
||||||
while (1);
|
|
||||||
}
|
|
@ -55,7 +55,7 @@ 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 \
|
||||||
sperrypc_8x8.data.o
|
font/sperrypc/sperrypc_8x8.data.o
|
||||||
|
|
||||||
example/font_bitmap.elf: LDSCRIPT = $(LIB)/main.lds
|
example/font_bitmap.elf: LDSCRIPT = $(LIB)/main.lds
|
||||||
example/font_bitmap.elf: $(START_OBJ) $(FONT_BITMAP_OBJ)
|
example/font_bitmap.elf: $(START_OBJ) $(FONT_BITMAP_OBJ)
|
||||||
@ -264,7 +264,7 @@ CLIPPING_TEXTURED_OBJ = \
|
|||||||
holly/ta_fifo_polygon_converter.o \
|
holly/ta_fifo_polygon_converter.o \
|
||||||
maple/maple.o \
|
maple/maple.o \
|
||||||
sh7091/serial.o \
|
sh7091/serial.o \
|
||||||
macaw.data.o \
|
texture/macaw/macaw.data.o \
|
||||||
$(LIBGCC)
|
$(LIBGCC)
|
||||||
|
|
||||||
example/clipping_textured.elf: LDSCRIPT = $(LIB)/main.lds
|
example/clipping_textured.elf: LDSCRIPT = $(LIB)/main.lds
|
||||||
@ -381,25 +381,6 @@ INTERRUPT_OBJ = \
|
|||||||
example/interrupt.elf: LDSCRIPT = $(LIB)/main.lds
|
example/interrupt.elf: LDSCRIPT = $(LIB)/main.lds
|
||||||
example/interrupt.elf: $(START_OBJ) $(INTERRUPT_OBJ)
|
example/interrupt.elf: $(START_OBJ) $(INTERRUPT_OBJ)
|
||||||
|
|
||||||
DUMP_OBJECT_LIST_OBJ = \
|
|
||||||
example/dump_object_list.o \
|
|
||||||
holly/video_output.o \
|
|
||||||
holly/core.o \
|
|
||||||
holly/region_array.o \
|
|
||||||
holly/background.o \
|
|
||||||
holly/ta_fifo_polygon_converter.o \
|
|
||||||
sh7091/serial.o
|
|
||||||
|
|
||||||
example/dump_object_list.elf: LDSCRIPT = $(LIB)/main.lds
|
|
||||||
example/dump_object_list.elf: $(START_OBJ) $(DUMP_OBJECT_LIST_OBJ)
|
|
||||||
|
|
||||||
DUMP_RAM_OBJ = \
|
|
||||||
example/dump_ram.o \
|
|
||||||
sh7091/serial.o
|
|
||||||
|
|
||||||
example/dump_ram.elf: LDSCRIPT = $(LIB)/main.lds
|
|
||||||
example/dump_ram.elf: $(START_OBJ) $(DUMP_RAM_OBJ)
|
|
||||||
|
|
||||||
SOFTWARE_TA_OBJ = \
|
SOFTWARE_TA_OBJ = \
|
||||||
example/software_ta.o \
|
example/software_ta.o \
|
||||||
holly/video_output.o \
|
holly/video_output.o \
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
#include "holly/region_array.hpp"
|
#include "holly/region_array.hpp"
|
||||||
#include "twiddle.hpp"
|
#include "twiddle.hpp"
|
||||||
|
|
||||||
#include "sperrypc_8x8.hpp"
|
#include "font/sperrypc/sperrypc_8x8.data.h"
|
||||||
|
|
||||||
struct vertex {
|
struct vertex {
|
||||||
float x;
|
float x;
|
||||||
@ -184,21 +184,15 @@ inline void inflate_character(const uint8_t * src, const uint8_t c)
|
|||||||
|
|
||||||
uint32_t offset = ((8 * 8) / 2) * character_index;
|
uint32_t offset = ((8 * 8) / 2) * character_index;
|
||||||
|
|
||||||
/*
|
|
||||||
union {
|
union {
|
||||||
uint8_t u8[8 * 8];
|
uint8_t u8[8 * 8];
|
||||||
uint32_t u32[8 * 8 / 4];
|
uint32_t u32[8 * 8 / 4];
|
||||||
} temp2;
|
} temp2;
|
||||||
|
|
||||||
twiddle::texure_4bpp(temp2.u8, temp, 8, 8);
|
twiddle::texture_4bpp(temp2.u8, temp, 8, 8);
|
||||||
for (uint32_t i = 0; i < 8 * 8 / 4; i++) {
|
for (uint32_t i = 0; i < 8 * 8 / 4; i++) {
|
||||||
texture[(offset / 4) + i] = temp2.u32[i];
|
texture[(offset / 4) + i] = temp2.u32[i];
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
twiddle::texture2<4>(&texture[offset / 4], temp,
|
|
||||||
8,
|
|
||||||
8 * 8);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void inflate_font(const uint8_t * src)
|
void inflate_font(const uint8_t * src)
|
||||||
@ -222,7 +216,7 @@ void main()
|
|||||||
{
|
{
|
||||||
video_output::set_mode_vga();
|
video_output::set_mode_vga();
|
||||||
|
|
||||||
auto src = reinterpret_cast<const uint8_t *>(&_binary_sperrypc_8x8_data_start);
|
auto src = reinterpret_cast<const uint8_t *>(&_binary_font_sperrypc_sperrypc_8x8_data_start);
|
||||||
inflate_font(src);
|
inflate_font(src);
|
||||||
palette_data();
|
palette_data();
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
#include "palette.hpp"
|
#include "palette.hpp"
|
||||||
|
|
||||||
#include "font/font.hpp"
|
#include "font/font.hpp"
|
||||||
#include "dejavusansmono.hpp"
|
#include "font/dejavusansmono/dejavusansmono.data.h"
|
||||||
|
|
||||||
struct vertex {
|
struct vertex {
|
||||||
float x;
|
float x;
|
||||||
|
5
font/dejavusansmono/dejavusansmono.data.h
Normal file
5
font/dejavusansmono/dejavusansmono.data.h
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
#pragma once
|
||||||
|
#include <cstdint>
|
||||||
|
extern uint32_t _binary_font_dejavusansmono_dejavusansmono_data_start __asm("_binary_font_dejavusansmono_dejavusansmono_data_start");
|
||||||
|
extern uint32_t _binary_font_dejavusansmono_dejavusansmono_data_end __asm("_binary_font_dejavusansmono_dejavusansmono_data_end");
|
||||||
|
extern uint32_t _binary_font_dejavusansmono_dejavusansmono_data_size __asm("_binary_font_dejavusansmono_dejavusansmono_data_size");
|
@ -1,5 +0,0 @@
|
|||||||
#include <cstdint>
|
|
||||||
|
|
||||||
extern uint32_t _binary_dejavusansmono_data_start __asm("_binary_dejavusansmono_data_start");
|
|
||||||
extern uint32_t _binary_dejavusansmono_data_end __asm("_binary_dejavusansmono_data_end");
|
|
||||||
extern uint32_t _binary_dejavusansmono_data_size __asm("_binary_dejavusansmono_data_size");
|
|
5
font/sperrypc/sperrypc_8x8.data.h
Normal file
5
font/sperrypc/sperrypc_8x8.data.h
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
#pragma once
|
||||||
|
#include <cstdint>
|
||||||
|
extern uint32_t _binary_font_sperrypc_sperrypc_8x8_data_start __asm("_binary_font_sperrypc_sperrypc_8x8_data_start");
|
||||||
|
extern uint32_t _binary_font_sperrypc_sperrypc_8x8_data_end __asm("_binary_font_sperrypc_sperrypc_8x8_data_end");
|
||||||
|
extern uint32_t _binary_font_sperrypc_sperrypc_8x8_data_size __asm("_binary_font_sperrypc_sperrypc_8x8_data_size");
|
@ -1,7 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include <cstdint>
|
|
||||||
|
|
||||||
extern uint32_t _binary_sperrypc_8x8_data_start __asm("_binary_sperrypc_8x8_data_start");
|
|
||||||
extern uint32_t _binary_sperrypc_8x8_data_end __asm("_binary_sperrypc_8x8_data_end");
|
|
||||||
extern uint32_t _binary_sperrypc_8x8_data_size __asm("_binary_sperrypc_8x8_data_size");
|
|
@ -10,6 +10,7 @@ struct device_id {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static_assert((sizeof (struct device_id)) == 16);
|
static_assert((sizeof (struct device_id)) == 16);
|
||||||
|
|
||||||
struct device_request {
|
struct device_request {
|
||||||
static constexpr uint32_t command_code = 0x1;
|
static constexpr uint32_t command_code = 0x1;
|
||||||
|
|
||||||
@ -278,4 +279,5 @@ struct ar_error {
|
|||||||
|
|
||||||
static_assert((sizeof (struct ar_error::data_fields)) == 4);
|
static_assert((sizeof (struct ar_error::data_fields)) == 4);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -10,10 +10,14 @@ def should_autonewline(line):
|
|||||||
def _render(out, lines):
|
def _render(out, lines):
|
||||||
indent = " "
|
indent = " "
|
||||||
level = 0
|
level = 0
|
||||||
|
namespace = 0
|
||||||
for l in lines:
|
for l in lines:
|
||||||
if l and (l[0] == "}" or l[0] == ")"):
|
if l and (l[0] == "}" or l[0] == ")"):
|
||||||
level -= 2
|
level -= 2
|
||||||
assert level >= 0, out.getvalue()
|
if level < 0:
|
||||||
|
assert namespace >= 0
|
||||||
|
namespace -= 1
|
||||||
|
level = 0
|
||||||
|
|
||||||
if len(l) == 0:
|
if len(l) == 0:
|
||||||
out.write("\n")
|
out.write("\n")
|
||||||
@ -21,7 +25,10 @@ def _render(out, lines):
|
|||||||
out.write(indent * level + l + "\n")
|
out.write(indent * level + l + "\n")
|
||||||
|
|
||||||
if l and (l[-1] == "{" or l[-1] == "("):
|
if l and (l[-1] == "{" or l[-1] == "("):
|
||||||
level += 2
|
if l.startswith("namespace"):
|
||||||
|
namespace += 1
|
||||||
|
else:
|
||||||
|
level += 2
|
||||||
|
|
||||||
if level == 0 and l and l[-1] == ";":
|
if level == 0 and l and l[-1] == ";":
|
||||||
if should_autonewline(l):
|
if should_autonewline(l):
|
||||||
|
@ -159,11 +159,20 @@ def headers():
|
|||||||
yield ""
|
yield ""
|
||||||
yield "#include <cstdint>"
|
yield "#include <cstdint>"
|
||||||
yield ""
|
yield ""
|
||||||
|
|
||||||
|
def namespace():
|
||||||
|
yield "namespace maple {"
|
||||||
|
yield ""
|
||||||
yield "struct device_id {"
|
yield "struct device_id {"
|
||||||
yield "uint32_t ft;"
|
yield "uint32_t ft;"
|
||||||
yield "uint32_t fd[3];"
|
yield "uint32_t fd[3];"
|
||||||
yield "};"
|
yield "};"
|
||||||
yield "static_assert((sizeof (struct device_id)) == 16);"
|
yield "static_assert((sizeof (struct device_id)) == 16);"
|
||||||
|
yield ""
|
||||||
|
for namespace, data_fields in process(rows):
|
||||||
|
yield from command_namespace(namespace, data_fields)
|
||||||
|
yield ""
|
||||||
|
yield "}"
|
||||||
|
|
||||||
input_file = sys.argv[1]
|
input_file = sys.argv[1]
|
||||||
rows = read_input(input_file)
|
rows = read_input(input_file)
|
||||||
@ -171,6 +180,5 @@ process = new_aggregator()
|
|||||||
|
|
||||||
render, out = renderer()
|
render, out = renderer()
|
||||||
render(headers())
|
render(headers())
|
||||||
for namespace, data_fields in process(rows):
|
render(namespace())
|
||||||
render(command_namespace(namespace, data_fields))
|
|
||||||
sys.stdout.write(out.getvalue())
|
sys.stdout.write(out.getvalue())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user