example: use uint8_t for all maple send_buf/recv_buf

This commit is contained in:
Zack Buhman 2024-12-19 18:31:34 -06:00
parent d74804f2b3
commit d2dc73ace2
16 changed files with 59 additions and 48 deletions

View File

@ -1,4 +1,4 @@
all: $(patsubst %.cpp,%.elf,$(wildcard example/*.cpp))
all: $(patsubst %.cpp,%.bin,$(wildcard example/*.cpp))
include base.mk
include common.mk

View File

@ -31,8 +31,8 @@
static ft0::data_transfer::data_format data[4];
uint32_t send_buf[1024] __attribute__((aligned(32)));
uint32_t recv_buf[1024] __attribute__((aligned(32)));
uint8_t send_buf[1024] __attribute__((aligned(32)));
uint8_t recv_buf[1024] __attribute__((aligned(32)));
void do_get_condition()
{

View File

@ -34,8 +34,8 @@
static ft0::data_transfer::data_format data[4];
uint32_t send_buf[1024] __attribute__((aligned(32)));
uint32_t recv_buf[1024] __attribute__((aligned(32)));
uint8_t send_buf[1024] __attribute__((aligned(32)));
uint8_t recv_buf[1024] __attribute__((aligned(32)));
void do_get_condition()
{

View File

@ -36,8 +36,8 @@
static ft0::data_transfer::data_format data[4];
uint32_t send_buf[1024] __attribute__((aligned(32)));
uint32_t recv_buf[1024] __attribute__((aligned(32)));
uint8_t send_buf[1024] __attribute__((aligned(32)));
uint8_t recv_buf[1024] __attribute__((aligned(32)));
void do_get_condition()
{

View File

@ -30,8 +30,8 @@
static ft0::data_transfer::data_format data[4];
uint32_t send_buf[1024] __attribute__((aligned(32)));
uint32_t recv_buf[1024] __attribute__((aligned(32)));
uint8_t send_buf[1024] __attribute__((aligned(32)));
uint8_t recv_buf[1024] __attribute__((aligned(32)));
void do_get_condition()
{

View File

@ -16,8 +16,8 @@
void do_get_condition()
{
uint32_t send_buf[1024] __attribute__((aligned(32)));
uint32_t recv_buf[1024] __attribute__((aligned(32)));
uint8_t send_buf[1024] __attribute__((aligned(32)));
uint8_t recv_buf[1024] __attribute__((aligned(32)));
auto writer = maple::host_command_writer(send_buf, recv_buf);
@ -54,8 +54,8 @@ void do_get_condition()
void do_lm_request(uint8_t port, uint8_t lm)
{
uint32_t send_buf[1024] __attribute__((aligned(32)));
uint32_t recv_buf[1024] __attribute__((aligned(32)));
uint8_t send_buf[1024] __attribute__((aligned(32)));
uint8_t recv_buf[1024] __attribute__((aligned(32)));
auto writer = maple::host_command_writer(send_buf, recv_buf);
@ -112,8 +112,8 @@ void do_lm_requests(uint8_t port, uint8_t lm)
void do_device_request()
{
uint32_t send_buf[1024] __attribute__((aligned(32)));
uint32_t recv_buf[1024] __attribute__((aligned(32)));
uint8_t send_buf[1024] __attribute__((aligned(32)));
uint8_t recv_buf[1024] __attribute__((aligned(32)));
auto writer = maple::host_command_writer(send_buf, recv_buf);

View File

@ -42,8 +42,8 @@ static uint8_t * framebuffer;
void send_vmu_framebuffer(uint8_t port, uint8_t lm)
{
uint32_t send_buf[1024] __attribute__((aligned(32)));
uint32_t recv_buf[1024] __attribute__((aligned(32)));
uint8_t send_buf[1024] __attribute__((aligned(32)));
uint8_t recv_buf[1024] __attribute__((aligned(32)));
using command_type = maple::block_write<uint8_t[0]>;
using response_type = maple::device_reply;
@ -82,8 +82,8 @@ void send_vmu_framebuffer(uint8_t port, uint8_t lm)
void do_lm_request(uint8_t port, uint8_t lm)
{
uint32_t send_buf[1024] __attribute__((aligned(32)));
uint32_t recv_buf[1024] __attribute__((aligned(32)));
uint8_t send_buf[1024] __attribute__((aligned(32)));
uint8_t recv_buf[1024] __attribute__((aligned(32)));
auto writer = maple::host_command_writer(send_buf, recv_buf);
@ -145,8 +145,8 @@ void do_lm_requests(uint8_t port, uint8_t lm)
void do_device_request()
{
uint32_t send_buf[1024] __attribute__((aligned(32)));
uint32_t recv_buf[1024] __attribute__((aligned(32)));
uint8_t send_buf[1024] __attribute__((aligned(32)));
uint8_t recv_buf[1024] __attribute__((aligned(32)));
auto writer = maple::host_command_writer(send_buf, recv_buf);

View File

@ -34,8 +34,8 @@ static ft9::data_transfer::data_format data;
void do_get_condition()
{
uint32_t send_buf[1024] __attribute__((aligned(32)));
uint32_t recv_buf[1024] __attribute__((aligned(32)));
uint8_t send_buf[1024] __attribute__((aligned(32)));
uint8_t recv_buf[1024] __attribute__((aligned(32)));
using command_type = maple::get_condition;
using response_type = maple::data_transfer<ft9::data_transfer::data_format>;

View File

@ -16,8 +16,8 @@
#include "systembus.hpp"
struct storage_state {
uint32_t * send_buf;
uint32_t * recv_buf;
uint8_t * send_buf;
uint8_t * recv_buf;
uint32_t host_port_select;
uint32_t destination_ap;
struct {
@ -289,8 +289,8 @@ bool allocate_file_information_data(storage_state& state,
void do_lm_request(uint8_t port, uint8_t lm)
{
uint32_t send_buf[1024] __attribute__((aligned(32)));
uint32_t recv_buf[1024] __attribute__((aligned(32)));
uint8_t send_buf[1024] __attribute__((aligned(32)));
uint8_t recv_buf[1024] __attribute__((aligned(32)));
const uint32_t host_port_select = host_instruction_port_select(port);
const uint32_t destination_ap = ap_port_select(port) | ap::de::expansion_device | lm;
@ -547,8 +547,8 @@ void do_lm_requests(uint8_t port, uint8_t lm)
void do_device_request()
{
uint32_t send_buf[1024] __attribute__((aligned(32)));
uint32_t recv_buf[1024] __attribute__((aligned(32)));
uint8_t send_buf[1024] __attribute__((aligned(32)));
uint8_t recv_buf[1024] __attribute__((aligned(32)));
auto writer = maple::host_command_writer(send_buf, recv_buf);

View File

@ -11,8 +11,8 @@
#include "maple/maple_bus_ft8.hpp"
#include "sh7091/serial.hpp"
uint32_t send_buf[1024] __attribute__((aligned(32)));
uint32_t recv_buf[1024] __attribute__((aligned(32)));
uint8_t send_buf[1024] __attribute__((aligned(32)));
uint8_t recv_buf[1024] __attribute__((aligned(32)));
void do_lm_request(uint8_t port, uint8_t lm)
{

View File

@ -48,8 +48,8 @@ inline void copy(T * dst, const T * src, const int32_t n) noexcept
void send_wink(uint8_t port, uint8_t lm)
{
uint32_t send_buf[1024] __attribute__((aligned(32)));
uint32_t recv_buf[1024] __attribute__((aligned(32)));
uint8_t send_buf[1024] __attribute__((aligned(32)));
uint8_t recv_buf[1024] __attribute__((aligned(32)));
using command_type = maple::block_write<uint8_t[0]>;
using response_type = maple::device_reply;
@ -86,8 +86,8 @@ void send_wink(uint8_t port, uint8_t lm)
void do_lm_request(uint8_t port, uint8_t lm)
{
uint32_t send_buf[1024] __attribute__((aligned(32)));
uint32_t recv_buf[1024] __attribute__((aligned(32)));
uint8_t send_buf[1024] __attribute__((aligned(32)));
uint8_t recv_buf[1024] __attribute__((aligned(32)));
auto writer = maple::host_command_writer(send_buf, recv_buf);
@ -149,8 +149,8 @@ void do_lm_requests(uint8_t port, uint8_t lm)
void do_device_request()
{
uint32_t send_buf[1024] __attribute__((aligned(32)));
uint32_t recv_buf[1024] __attribute__((aligned(32)));
uint8_t send_buf[1024] __attribute__((aligned(32)));
uint8_t recv_buf[1024] __attribute__((aligned(32)));
auto writer = maple::host_command_writer(send_buf, recv_buf);

View File

@ -37,8 +37,8 @@ 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)));
uint8_t send_buf[1024] __attribute__((aligned(32)));
uint8_t recv_buf[1024] __attribute__((aligned(32)));
auto writer = maple::host_command_writer(send_buf, recv_buf);

View File

@ -246,8 +246,8 @@ void do_get_condition(uint32_t * command_buf,
uint32_t * receive_buf,
button_state& buttons)
{
uint32_t send_buf[1024] __attribute__((aligned(32)));
uint32_t recv_buf[1024] __attribute__((aligned(32)));
uint8_t send_buf[1024] __attribute__((aligned(32)));
uint8_t recv_buf[1024] __attribute__((aligned(32)));
auto writer = maple::host_command_writer(send_buf, recv_buf);

View File

@ -1,5 +1,15 @@
#pragma once
#include <cstdint>
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
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");
#ifdef __cplusplus
}
#endif

View File

@ -6,6 +6,7 @@
#include "serial_load.hpp"
#include "crc32.h"
#include "memory.hpp"
#include "align.hpp"
#include "memory.hpp"

View File

@ -68,16 +68,16 @@ eeprom_type=6 # Integer: Chip Type / EEPROM Type. Corresponds to ftdi_
# Strings to be used in this config file are:
# "TRISTATE", "TXLED", "RXLED", "TXRXLED", "PWREN", "SLEEP", "DRIVE_0", "DRIVE1", "IOMODE", "TXDEN", "CLK30", "CLK15", "CLK7_5"
##Type_232H Chips
cbush0=TRISTATE # String parsed to integer:
cbush1=TRISTATE # String parsed to integer:
cbush0=RXLED # String parsed to integer:
cbush1=TXLED # String parsed to integer:
cbush2=TRISTATE # String parsed to integer:
cbush3=TRISTATE # String parsed to integer:
cbush4=TRISTATE # String parsed to integer:
cbush5=TRISTATE # String parsed to integer:
cbush6=TRISTATE # String parsed to integer:
cbush5=IOMODE # String parsed to integer:
cbush6=IOMODE # String parsed to integer:
cbush7=TRISTATE # String parsed to integer:
cbush8=TXLED # String parsed to integer:
cbush9=RXLED # String parsed to integer:
cbush8=IOMODE # String parsed to integer:
cbush9=IOMODE # String parsed to integer:
# Group Drive
# Strings to be used in this config file are:
# "4MA", "8MA", "12MA", "16MA"