example: restore more examples

This commit is contained in:
Zack Buhman 2024-10-27 07:23:08 -05:00
parent fc536bd93a
commit d55fa64714
27 changed files with 174 additions and 133 deletions

View File

@ -50,6 +50,7 @@ void do_get_condition()
}
maple::dma_start(send_buf, writer.send_offset,
recv_buf, writer.recv_offset);
maple::dma_wait_complete();
for (uint8_t port = 0; port < 4; port++) {
auto& bus_data = host_response[port].bus_data;

View File

@ -53,6 +53,7 @@ void do_get_condition()
}
maple::dma_start(send_buf, writer.send_offset,
recv_buf, writer.recv_offset);
maple::dma_wait_complete();
for (uint8_t port = 0; port < 4; port++) {
auto& bus_data = host_response[port].bus_data;

View File

@ -55,6 +55,7 @@ void do_get_condition()
}
maple::dma_start(send_buf, writer.send_offset,
recv_buf, writer.recv_offset);
maple::dma_wait_complete();
for (uint8_t port = 0; port < 4; port++) {
auto& bus_data = host_response[port].bus_data;

View File

@ -43,11 +43,47 @@ MACAW_TWIDDLE_OBJ = \
holly/region_array.o \
holly/background.o \
holly/ta_fifo_polygon_converter.o \
macaw.data.o
texture/macaw/macaw.data.o
example/macaw_twiddle.elf: LDSCRIPT = $(LIB)/main.lds
example/macaw_twiddle.elf: $(START_OBJ) $(MACAW_TWIDDLE_OBJ)
MACAW_CUBE_OBJ = \
example/macaw_cube.o \
holly/video_output.o \
holly/core.o \
holly/region_array.o \
holly/background.o \
holly/ta_fifo_polygon_converter.o \
texture/macaw/macaw.data.o
example/macaw_cube.elf: LDSCRIPT = $(LIB)/main.lds
example/macaw_cube.elf: $(START_OBJ) $(MACAW_CUBE_OBJ)
MACAW_CUBE_RENDER_TO_TEXTURE_OBJ = \
example/macaw_cube_render_to_texture.o \
holly/video_output.o \
holly/core.o \
holly/region_array.o \
holly/background.o \
holly/ta_fifo_polygon_converter.o \
texture/macaw/macaw.data.o
example/macaw_cube_render_to_texture.elf: LDSCRIPT = $(LIB)/main.lds
example/macaw_cube_render_to_texture.elf: $(START_OBJ) $(MACAW_CUBE_RENDER_TO_TEXTURE_OBJ)
MACAW_MULTIPASS_OBJ = \
example/macaw_multipass.o \
holly/video_output.o \
holly/core.o \
holly/region_array.o \
holly/background.o \
holly/ta_fifo_polygon_converter.o \
texture/macaw/macaw.data.o
example/macaw_multipass.elf: LDSCRIPT = $(LIB)/main.lds
example/macaw_multipass.elf: $(START_OBJ) $(MACAW_MULTIPASS_OBJ)
FONT_BITMAP_OBJ = \
example/font_bitmap.o \
holly/video_output.o \
@ -67,7 +103,7 @@ FONT_OUTLINE_OBJ = \
holly/region_array.o \
holly/background.o \
holly/ta_fifo_polygon_converter.o \
dejavusansmono.data.o
font/dejavusansmono/dejavusansmono.data.o
example/font_outline.elf: LDSCRIPT = $(LIB)/main.lds
example/font_outline.elf: $(START_OBJ) $(FONT_OUTLINE_OBJ)
@ -79,23 +115,11 @@ FONT_OUTLINE_PUNCH_THROUGH_OBJ = \
holly/region_array.o \
holly/background.o \
holly/ta_fifo_polygon_converter.o \
dejavusansmono_mono.data.o
font/dejavusansmono/dejavusansmono_mono.data.o
example/font_outline_punch_through.elf: LDSCRIPT = $(LIB)/main.lds
example/font_outline_punch_through.elf: $(START_OBJ) $(FONT_OUTLINE_PUNCH_THROUGH_OBJ)
MACAW_MULTIPASS_OBJ = \
example/macaw_multipass.o \
holly/video_output.o \
holly/core.o \
holly/region_array.o \
holly/background.o \
holly/ta_fifo_polygon_converter.o \
macaw.data.o
example/macaw_multipass.elf: LDSCRIPT = $(LIB)/main.lds
example/macaw_multipass.elf: $(START_OBJ) $(MACAW_MULTIPASS_OBJ)
TRANSLUCENCY_OBJ = \
example/translucency.o \
holly/video_output.o \
@ -103,7 +127,7 @@ TRANSLUCENCY_OBJ = \
holly/region_array.o \
holly/background.o \
holly/ta_fifo_polygon_converter.o \
macaw.data.o
texture/macaw/macaw.data.o
example/translucency.elf: LDSCRIPT = $(LIB)/main.lds
example/translucency.elf: $(START_OBJ) $(TRANSLUCENCY_OBJ)
@ -174,8 +198,8 @@ MODIFIER_VOLUME_WITH_TWO_VOLUMES_OBJ = \
holly/region_array.o \
holly/background.o \
holly/ta_fifo_polygon_converter.o \
wolf.data.o \
macaw.data.o \
texture/wolf/wolf.data.o \
texture/macaw/macaw.data.o \
maple/maple.o \
$(LIBGCC)
@ -205,30 +229,6 @@ VIEWING_SYSTEM_OBJ = \
example/viewing_system.elf: LDSCRIPT = $(LIB)/main.lds
example/viewing_system.elf: $(START_OBJ) $(VIEWING_SYSTEM_OBJ)
MACAW_CUBE_OBJ = \
example/macaw_cube.o \
holly/video_output.o \
holly/core.o \
holly/region_array.o \
holly/background.o \
holly/ta_fifo_polygon_converter.o \
macaw.data.o
example/macaw_cube.elf: LDSCRIPT = $(LIB)/main.lds
example/macaw_cube.elf: $(START_OBJ) $(MACAW_CUBE_OBJ)
MACAW_CUBE_RENDER_TO_TEXTURE_OBJ = \
example/macaw_cube_render_to_texture.o \
holly/video_output.o \
holly/core.o \
holly/region_array.o \
holly/background.o \
holly/ta_fifo_polygon_converter.o \
macaw.data.o
example/macaw_cube_render_to_texture.elf: LDSCRIPT = $(LIB)/main.lds
example/macaw_cube_render_to_texture.elf: $(START_OBJ) $(MACAW_CUBE_RENDER_TO_TEXTURE_OBJ)
CLIPPING_OBJ = \
example/clipping.o \
holly/video_output.o \

View File

@ -18,6 +18,7 @@
#include "holly/region_array.hpp"
#include "twiddle.hpp"
#include "palette.hpp"
#include "sh7091/serial.hpp"
#include "font/font.hpp"
#include "font/dejavusansmono/dejavusansmono.data.h"
@ -72,7 +73,7 @@ uint32_t transform(ta_parameter_writer& parameter,
| tsp_instruction_word::texture_v_size::from_int(texture_height);
const uint32_t texture_address = texture_memory_alloc::texture.start;
const uint32_t texture_control_word = texture_control_word::pixel_format::_4bpp_palette
const uint32_t texture_control_word = texture_control_word::pixel_format::_8bpp_palette
| texture_control_word::scan_order::twiddled
| texture_control_word::texture_address(texture_address / 8);
@ -140,7 +141,7 @@ uint32_t transform2(ta_parameter_writer& parameter,
| tsp_instruction_word::texture_v_size::from_int(texture_height);
const uint32_t texture_address = texture_memory_alloc::texture.start;
const uint32_t texture_control_word = texture_control_word::pixel_format::_4bpp_palette
const uint32_t texture_control_word = texture_control_word::pixel_format::_8bpp_palette
| texture_control_word::scan_order::twiddled
| texture_control_word::texture_address(texture_address / 8);
@ -189,15 +190,24 @@ void init_texture_memory(const struct opb_size& opb_size)
background_parameter(0xff0000ff);
}
void inflate_font(const uint32_t * src,
const uint32_t stride,
const uint32_t curve_end_ix)
void inflate_font(const uint8_t * src,
const uint32_t width,
const uint32_t height)
{
auto texture = reinterpret_cast<volatile uint16_t *>(&texture_memory64[texture_memory_alloc::texture.start / 4]);
auto texture = reinterpret_cast<volatile uint32_t *>(&texture_memory64[texture_memory_alloc::texture.start / 4]);
twiddle::texture3<4, 8>(texture, reinterpret_cast<const uint8_t *>(src),
stride,
curve_end_ix);
const uint32_t size = width * height;
uint8_t temp[size] __attribute__((aligned(4)));
twiddle::texture(temp,
src,
width,
height);
for (uint32_t i = 0; i < size / 4; i++) {
texture[i] = reinterpret_cast<uint32_t *>(temp)[i];
}
}
uint32_t _ta_parameter_buf[((32 * 10 * 17) + 32) / 4];
@ -206,14 +216,13 @@ void main()
{
video_output::set_mode_vga();
auto font = reinterpret_cast<const struct font *>(&_binary_dejavusansmono_data_start);
auto font = reinterpret_cast<const struct font *>(&_binary_font_dejavusansmono_dejavusansmono_data_start);
auto glyphs = reinterpret_cast<const struct glyph *>(&font[1]);
auto texture = reinterpret_cast<const uint32_t *>(&glyphs[font->glyph_count]);
auto texture = reinterpret_cast<const uint8_t *>(&glyphs[font->glyph_count]);
/*
serial::integer<uint32_t>(font->first_char_code);
serial::integer<uint32_t>(font->glyph_count);
serial::integer<uint32_t>(font->glyph_height);
serial::integer<uint32_t>(font->texture_stride);
serial::integer<uint32_t>(font->texture_width);
serial::integer<uint32_t>(font->texture_height);
@ -223,9 +232,9 @@ void main()
*/
inflate_font(texture,
font->texture_stride,
font->max_z_curve_ix);
palette_data<16>();
font->texture_width,
font->texture_height);
palette_data<256>();
// 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.
@ -272,14 +281,14 @@ void main()
font->first_char_code,
glyphs,
ana, 17,
font->glyph_height * 0);
font->face_metrics.height * 0);
transform(parameter,
font->texture_width, font->texture_height,
font->first_char_code,
glyphs,
cabal, 26,
font->glyph_height * 1);
font->face_metrics.height * 1);
parameter.append<ta_global_parameter::end_of_list>() = ta_global_parameter::end_of_list(para_control::para_type::end_of_list);

View File

@ -20,7 +20,7 @@
#include "palette.hpp"
#include "font/font.hpp"
#include "dejavusansmono_mono.hpp"
#include "font/dejavusansmono/dejavusansmono_mono.data.h"
struct vertex {
float x;
@ -71,7 +71,7 @@ uint32_t transform(ta_parameter_writer& parameter,
| tsp_instruction_word::texture_v_size::from_int(texture_height);
const uint32_t texture_address = texture_memory_alloc::texture.start;
const uint32_t texture_control_word = texture_control_word::pixel_format::_4bpp_palette
const uint32_t texture_control_word = texture_control_word::pixel_format::_8bpp_palette
| texture_control_word::scan_order::twiddled
| texture_control_word::texture_address(texture_address / 8);
@ -139,7 +139,7 @@ uint32_t transform2(ta_parameter_writer& parameter,
| tsp_instruction_word::texture_v_size::from_int(texture_height);
const uint32_t texture_address = texture_memory_alloc::texture.start;
const uint32_t texture_control_word = texture_control_word::pixel_format::_4bpp_palette
const uint32_t texture_control_word = texture_control_word::pixel_format::_8bpp_palette
| texture_control_word::scan_order::twiddled
| texture_control_word::texture_address(texture_address / 8);
@ -188,15 +188,39 @@ void init_texture_memory(const struct opb_size& opb_size)
background_parameter(0xff0000ff);
}
void inflate_font(const uint32_t * src,
const uint32_t stride,
const uint32_t curve_end_ix)
void inflate_font(const uint8_t * src,
const uint32_t width,
const uint32_t height)
{
auto texture = reinterpret_cast<volatile uint16_t *>(&texture_memory64[texture_memory_alloc::texture.start / 4]);
auto texture = reinterpret_cast<volatile uint32_t *>(&texture_memory64[texture_memory_alloc::texture.start / 4]);
twiddle::texture3<4, 1>(texture, reinterpret_cast<const uint8_t *>(src),
stride,
curve_end_ix);
const uint32_t bits_per_pixel = 1;
const uint32_t pixels_per_byte = 8;
const uint32_t stride = width / pixels_per_byte;
const uint32_t mask = (1 << bits_per_pixel) - 1;
const uint32_t size = width * height;
uint8_t temp1[size];
for (uint32_t y = 0; y < height; y++) {
for (uint32_t x = 0; x < width; x++) {
const uint32_t texture_ix = y * stride + x / pixels_per_byte;
const uint32_t texture_ix_mod = x % pixels_per_byte;
const uint32_t value = (src[texture_ix] >> (bits_per_pixel * texture_ix_mod)) & mask;
temp1[y * width + x] = value;
}
}
uint8_t temp[size] __attribute__((aligned(4)));
twiddle::texture(temp,
temp1,
width,
height);
for (uint32_t i = 0; i < size / 4; i++) {
texture[i] = reinterpret_cast<uint32_t *>(temp)[i];
}
}
uint32_t _ta_parameter_buf[((32 * 10 * 17) + 32) / 4];
@ -205,9 +229,9 @@ void main()
{
video_output::set_mode_vga();
auto font = reinterpret_cast<const struct font *>(&_binary_dejavusansmono_mono_data_start);
auto font = reinterpret_cast<const struct font *>(&_binary_font_dejavusansmono_dejavusansmono_mono_data_start);
auto glyphs = reinterpret_cast<const struct glyph *>(&font[1]);
auto texture = reinterpret_cast<const uint32_t *>(&glyphs[font->glyph_count]);
auto texture = reinterpret_cast<const uint8_t *>(&glyphs[font->glyph_count]);
/*
serial::integer<uint32_t>(font->first_char_code);
@ -222,8 +246,8 @@ void main()
*/
inflate_font(texture,
font->texture_stride,
font->max_z_curve_ix);
font->texture_width,
font->texture_height);
palette_data<2>();
// The address of `ta_parameter_buf` must be a multiple of 32 bytes.
@ -274,14 +298,14 @@ void main()
font->first_char_code,
glyphs,
ana, 17,
font->glyph_height * 0);
font->face_metrics.height * 0);
transform(parameter,
font->texture_width, font->texture_height,
font->first_char_code,
glyphs,
cabal, 26,
font->glyph_height * 1);
font->face_metrics.height * 1);
parameter.append<ta_global_parameter::end_of_list>() = ta_global_parameter::end_of_list(para_control::para_type::end_of_list);

View File

@ -205,7 +205,7 @@ void transform_model(ta_parameter_writer& parameter,
c.g += color.g * 0.1;
c.b += color.b * 0.1;
if (n_dot_l > 0) {
float intensity = n_dot_l / (length(n) * length(l));
float intensity = n_dot_l / (magnitude(n) * magnitude(l));
c.r += color.r * intensity * lighting_weight;
c.g += color.g * intensity * lighting_weight;
c.b += color.b * intensity * lighting_weight;

View File

@ -17,7 +17,7 @@
#include "holly/background.hpp"
#include "memorymap.hpp"
#include "macaw.hpp"
#include "texture/macaw/macaw.data.h"
struct vertex {
float x;
@ -145,8 +145,8 @@ void init_texture_memory(const struct opb_size& opb_size)
void copy_macaw_texture()
{
auto src = reinterpret_cast<const uint8_t *>(&_binary_macaw_data_start);
auto size = reinterpret_cast<const uint32_t>(&_binary_macaw_data_size);
auto src = reinterpret_cast<const uint8_t *>(&_binary_texture_macaw_macaw_data_start);
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]);
for (uint32_t px = 0; px < size / 3; px++) {
uint8_t r = src[px * 3 + 0];

View File

@ -17,7 +17,7 @@
#include "holly/background.hpp"
#include "memorymap.hpp"
#include "macaw.hpp"
#include "texture/macaw/macaw.data.h"
struct vertex {
float x;
@ -178,8 +178,8 @@ void transform(ta_parameter_writer& parameter,
void copy_macaw_texture()
{
auto src = reinterpret_cast<const uint8_t *>(&_binary_macaw_data_start);
auto size = reinterpret_cast<const uint32_t>(&_binary_macaw_data_size);
auto src = reinterpret_cast<const uint8_t *>(&_binary_texture_macaw_macaw_data_start);
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]);
for (uint32_t px = 0; px < size / 3; px++) {
uint8_t r = src[px * 3 + 0];

View File

@ -17,7 +17,7 @@
#include "holly/video_output.hpp"
#include "memorymap.hpp"
#include "macaw.hpp"
#include "texture/macaw/macaw.data.h"
struct vertex {
float x;
@ -134,11 +134,12 @@ uint32_t transform(uint32_t * ta_parameter_buf,
void init_texture_memory(const struct opb_size * opb_size, uint32_t render_passes)
{
region_array_multipass(640 / 32, // width
480 / 32, // height
region_array_multipass(640 / 32, // tile_width
480 / 32, // tile_height
opb_size,
render_passes
);
render_passes,
texture_memory_alloc::region_array.start,
texture_memory_alloc::object_list.start);
background_parameter(0xff00ff00);
}
@ -147,8 +148,8 @@ uint32_t _ta_parameter_buf[((32 * (strip_length + 2)) + 32) / 4];
void copy_macaw_texture()
{
auto src = reinterpret_cast<const uint8_t *>(&_binary_macaw_data_start);
auto size = reinterpret_cast<const uint32_t>(&_binary_macaw_data_size);
auto src = reinterpret_cast<const uint8_t *>(&_binary_texture_macaw_macaw_data_start);
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]);
for (uint32_t px = 0; px < size / 3; px++) {
uint8_t r = src[px * 3 + 0];

View File

@ -18,7 +18,7 @@
#include "memorymap.hpp"
#include "twiddle.hpp"
#include "macaw.hpp"
#include "texture/macaw/macaw.data.h"
struct vertex {
float x;
@ -116,8 +116,8 @@ void init_texture_memory(const struct opb_size& opb_size)
void init_macaw_texture()
{
auto src = reinterpret_cast<const uint8_t *>(&_binary_macaw_data_start);
auto size = reinterpret_cast<const uint32_t>(&_binary_macaw_data_size);
auto src = reinterpret_cast<const uint8_t *>(&_binary_texture_macaw_macaw_data_start);
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]);
uint16_t temp[size / 3];

View File

@ -30,16 +30,16 @@
static ft0::data_transfer::data_format data[4];
void do_get_condition()
{
uint32_t send_buf[1024] __attribute__((aligned(32)));
uint32_t recv_buf[1024] __attribute__((aligned(32)));
void do_get_condition()
{
auto writer = maple::host_command_writer(send_buf, recv_buf);
using command_type = maple::get_condition;
using response_type = maple::data_transfer<ft0::data_transfer::data_format>;
auto writer = maple::host_command_writer(send_buf, recv_buf);
auto [host_command, host_response]
= writer.append_command_all_ports<command_type, response_type>();
@ -47,6 +47,7 @@ void do_get_condition()
maple::dma_start(send_buf, writer.send_offset,
recv_buf, writer.recv_offset);
maple::dma_wait_complete();
for (uint8_t port = 0; port < 4; port++) {
auto& bus_data = host_response[port].bus_data;
@ -58,8 +59,8 @@ void do_get_condition()
return;
}
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_coordinate_axis[2] = data_fields.data.analog_coordinate_axis[2];
data[port].analog_coordinate_axis[3] = data_fields.data.analog_coordinate_axis[3];
}
}
@ -188,8 +189,8 @@ void main()
640 / 32,
480 / 32);
float x_pos = static_cast<float>(data[0].analog_axis_3 - 0x80) * (0.5 / 127);
float y_pos = static_cast<float>(data[0].analog_axis_4 - 0x80) * (0.5 / 127);
float x_pos = static_cast<float>(data[0].analog_coordinate_axis[2] - 0x80) * (0.5 / 127);
float y_pos = static_cast<float>(data[0].analog_coordinate_axis[3] - 0x80) * (0.5 / 127);
auto parameter = ta_parameter_writer(ta_parameter_buf);
for (uint32_t i = 0; i < border::num_faces; i++) {

View File

@ -21,8 +21,8 @@ void do_get_condition()
auto writer = maple::host_command_writer(send_buf, recv_buf);
using command_type = get_condition;
using response_type = data_transfer<ft0::data_transfer::data_format>;
using command_type = maple::get_condition;
using response_type = maple::data_transfer<ft0::data_transfer::data_format>;
auto [host_command, host_response]
= writer.append_command_all_ports<command_type, response_type>();
@ -31,6 +31,7 @@ void do_get_condition()
maple::dma_start(send_buf, writer.send_offset,
recv_buf, writer.recv_offset);
maple::dma_wait_complete();
for (uint8_t port = 0; port < 4; port++) {
auto& bus_data = host_response[port].bus_data;
@ -61,8 +62,8 @@ void do_lm_request(uint8_t port, uint8_t lm)
uint32_t host_port_select = host_instruction_port_select(port);
uint32_t destination_ap = ap_port_select(port) | ap::de::expansion_device | lm;
using command_type = device_request;
using response_type = device_status;
using command_type = maple::device_request;
using response_type = maple::device_status;
auto [host_command, host_response]
= writer.append_command<command_type, response_type>(host_port_select,
@ -71,10 +72,11 @@ void do_lm_request(uint8_t port, uint8_t lm)
maple::dma_start(send_buf, writer.send_offset,
recv_buf, writer.recv_offset);
maple::dma_wait_complete();
auto& bus_data = host_response->bus_data;
auto& data_fields = bus_data.data_fields;
if (bus_data.command_code != device_status::command_code) {
if (bus_data.command_code != maple::device_status::command_code) {
serial::string("lm did not reply: ");
serial::integer<uint8_t>(port, ' ');
serial::integer<uint8_t>(lm);
@ -115,19 +117,20 @@ void do_device_request()
auto writer = maple::host_command_writer(send_buf, recv_buf);
using command_type = device_request;
using response_type = device_status;
using command_type = maple::device_request;
using response_type = maple::device_status;
auto [host_command, host_response]
= writer.append_command_all_ports<command_type, response_type>();
maple::dma_start(send_buf, writer.send_offset,
recv_buf, writer.recv_offset);
maple::dma_wait_complete();
for (uint8_t port = 0; port < 4; port++) {
auto& bus_data = host_response[port].bus_data;
auto& data_fields = bus_data.data_fields;
if (bus_data.command_code != device_status::command_code) {
if (bus_data.command_code != maple::device_status::command_code) {
serial::string("port: ");
serial::integer<uint8_t>(port);
serial::string(" disconnected\n");
@ -153,6 +156,7 @@ void do_device_request()
void main()
{
serial::init(0);
// flycast needs this in HLE mode, or else it won't start the vcount
// counter.
video_output::set_mode_vga();

View File

@ -7,7 +7,7 @@
void main()
{
serial::init(4);
serial::init(0);
uint32_t send_buf[1024] __attribute__((aligned(32)));
uint32_t recv_buf[1024] __attribute__((aligned(32)));
@ -22,6 +22,7 @@ void main()
maple::dma_start(send_buf, writer.send_offset,
recv_buf, writer.recv_offset);
maple::dma_wait_complete();
for (uint8_t port = 0; port < 4; port++) {
auto& bus_data = host_response[port].bus_data;

View File

@ -72,6 +72,7 @@ void send_vmu_framebuffer(uint8_t port, uint8_t lm)
maple::dma_start(send_buf, writer.send_offset,
recv_buf, writer.recv_offset);
maple::dma_wait_complete();
serial::integer<uint8_t>(host_response->bus_data.command_code);
serial::integer<uint8_t>(host_response->bus_data.destination_ap);
@ -99,6 +100,7 @@ void do_lm_request(uint8_t port, uint8_t lm)
maple::dma_start(send_buf, writer.send_offset,
recv_buf, writer.recv_offset);
maple::dma_wait_complete();
auto& bus_data = host_response->bus_data;
auto& data_fields = bus_data.data_fields;
@ -156,6 +158,7 @@ void do_device_request()
maple::dma_start(send_buf, writer.send_offset,
recv_buf, writer.recv_offset);
maple::dma_wait_complete();
for (uint8_t port = 0; port < 4; port++) {
auto& bus_data = host_response[port].bus_data;

View File

@ -49,6 +49,7 @@ void do_get_condition()
maple::dma_start(send_buf, writer.send_offset,
recv_buf, writer.recv_offset);
maple::dma_wait_complete();
for (uint8_t port = 0; port < 4; port++) {
auto& bus_data = host_response[port].bus_data;

View File

@ -146,6 +146,7 @@ bool do_block_read(storage_state& state, uint16_t block_number, uint8_t * dest)
maple::dma_start(state.send_buf, writer.send_offset,
state.recv_buf, writer.recv_offset);
maple::dma_wait_complete();
for (uint32_t phase = 0; phase < state.device_status.read_accesses; phase++) {
auto& bus_data = host_responses[phase]->bus_data;
@ -227,6 +228,7 @@ bool do_block_write(storage_state& state, uint16_t block_number, uint8_t * src)
maple::dma_start(state.send_buf, writer.send_offset,
state.recv_buf, writer.recv_offset);
maple::dma_wait_complete();
serial::string("block write status: ");
serial::integer(host_response->bus_data.command_code);
@ -316,6 +318,7 @@ void do_lm_request(uint8_t port, uint8_t lm)
maple::dma_start(send_buf, writer.send_offset,
recv_buf, writer.recv_offset);
maple::dma_wait_complete();
auto& bus_data = host_response->bus_data;
auto& data_fields = bus_data.data_fields;
@ -361,6 +364,7 @@ void do_lm_request(uint8_t port, uint8_t lm)
maple::dma_start(send_buf, writer.send_offset,
recv_buf, writer.recv_offset);
maple::dma_wait_complete();
auto& bus_data = host_response->bus_data;
auto& data_fields = bus_data.data_fields;
@ -556,6 +560,7 @@ void do_device_request()
maple::dma_start(send_buf, writer.send_offset,
recv_buf, writer.recv_offset);
maple::dma_wait_complete();
for (uint8_t port = 0; port < 4; port++) {
auto& bus_data = host_response[port].bus_data;

View File

@ -63,6 +63,7 @@ void do_lm_request(uint8_t port, uint8_t lm)
serial::string("dma start\n");
maple::dma_start(command_buf, maple::sizeof_command(host_command),
receive_buf, maple::sizeof_command(host_response));
maple::dma_wait_complete();
auto& bus_data = host_response->bus_data;
if (bus_data.command_code != response_type::command_code) {
@ -123,6 +124,7 @@ void do_lm_request(uint8_t port, uint8_t lm)
auto host_response = reinterpret_cast<host_response_type *>(receive_buf);
maple::dma_start(command_buf, maple::sizeof_command(host_command),
receive_buf, maple::sizeof_command(host_response));
maple::dma_wait_complete();
auto& bus_data = host_response->bus_data;
@ -160,6 +162,7 @@ void do_device_request()
const uint32_t command_size = maple::init_host_command_all_ports<command_type, response_type>(command_buf, receive_buf);
maple::dma_start(command_buf, command_size,
receive_buf, maple::sizeof_command(host_response) * 4);
maple::dma_wait_complete();
for (uint8_t port = 0; port < 4; port++) {
auto& bus_data = host_response[port].bus_data;

View File

@ -76,6 +76,7 @@ void send_wink(uint8_t port, uint8_t lm)
maple::dma_start(send_buf, writer.send_offset,
recv_buf, writer.recv_offset);
maple::dma_wait_complete();
serial::integer<uint8_t>(host_response->bus_data.command_code);
serial::integer<uint8_t>(host_response->bus_data.destination_ap);
@ -103,6 +104,7 @@ void do_lm_request(uint8_t port, uint8_t lm)
maple::dma_start(send_buf, writer.send_offset,
recv_buf, writer.recv_offset);
maple::dma_wait_complete();
auto& bus_data = host_response->bus_data;
auto& data_fields = bus_data.data_fields;
@ -160,6 +162,7 @@ void do_device_request()
maple::dma_start(send_buf, writer.send_offset,
recv_buf, writer.recv_offset);
maple::dma_wait_complete();
for (uint8_t port = 0; port < 4; port++) {
auto& bus_data = host_response[port].bus_data;

View File

@ -52,6 +52,7 @@ void do_get_condition(uint32_t * command_buf,
maple::dma_start(command_buf, command_size,
receive_buf, maple::sizeof_command(host_response));
maple::dma_wait_complete();
for (uint8_t port = 0; port < 4; port++) {
auto& bus_data = host_response[port].bus_data;

View File

@ -249,6 +249,7 @@ void do_get_condition(uint32_t * command_buf,
maple::dma_start(command_buf, command_size,
receive_buf, maple::sizeof_command(host_response));
maple::dma_wait_complete();
buttons.reset();

View File

@ -0,0 +1,5 @@
#pragma once
#include <cstdint>
extern uint32_t _binary_font_dejavusansmono_dejavusansmono_mono_data_start __asm("_binary_font_dejavusansmono_dejavusansmono_mono_data_start");
extern uint32_t _binary_font_dejavusansmono_dejavusansmono_mono_data_end __asm("_binary_font_dejavusansmono_dejavusansmono_mono_data_end");
extern uint32_t _binary_font_dejavusansmono_dejavusansmono_mono_data_size __asm("_binary_font_dejavusansmono_dejavusansmono_mono_data_size");

View File

@ -1,5 +0,0 @@
#include <cstdint>
extern uint32_t _binary_dejavusansmono_mono_data_start __asm("_binary_dejavusansmono_mono_data_start");
extern uint32_t _binary_dejavusansmono_mono_data_end __asm("_binary_dejavusansmono_mono_data_end");
extern uint32_t _binary_dejavusansmono_mono_data_size __asm("_binary_dejavusansmono_mono_data_size");

View File

@ -1,7 +0,0 @@
#pragma once
#include <cstdint>
extern uint32_t _binary_europc_mono_9x14_data_start __asm("_binary_europc_mono_9x14_data_start");
extern uint32_t _binary_europc_mono_9x14_data_end __asm("_binary_europc_mono_9x14_data_end");
extern uint32_t _binary_europc_mono_9x14_data_size __asm("_binary_europc_mono_9x14_data_size");

View File

@ -1,5 +0,0 @@
#include <cstdint>
extern uint32_t _binary_ter_u20n_data_start __asm("_binary_ter_u20n_data_start");
extern uint32_t _binary_ter_u20n_data_end __asm("_binary_ter_u20n_data_end");
extern uint32_t _binary_ter_u20n_data_size __asm("_binary_ter_u20n_data_size");

View File

@ -1,7 +0,0 @@
#pragma once
#include <cstdint>
extern uint32_t _binary_verite_8x16_data_start __asm("_binary_verite_8x16_data_start");
extern uint32_t _binary_verite_8x16_data_end __asm("_binary_verite_8x16_data_end");
extern uint32_t _binary_verite_8x16_data_size __asm("_binary_verite_8x16_data_size");