example: fixed all examples

This commit is contained in:
Zack Buhman 2024-10-27 11:01:54 -05:00
parent 213ad656cb
commit 17c1418574
35 changed files with 262 additions and 162 deletions

View File

@ -163,7 +163,7 @@ SUZANNE_PROFILE_OBJ = \
holly/ta_fifo_polygon_converter.o \
font/font_bitmap.o \
sh7091/serial.o \
verite_8x16.data.o
font/verite_8x16/verite_8x16.data.o
example/suzanne_profile.elf: LDSCRIPT = $(LIB)/main.lds
example/suzanne_profile.elf: $(START_OBJ) $(SUZANNE_PROFILE_OBJ)
@ -304,7 +304,7 @@ MAPLE_WINK_OBJ = \
rgb.o \
sh7091/serial.o \
maple/maple.o \
wink.data.o
texture/wink/wink.data.o
example/maple_wink.elf: LDSCRIPT = $(LIB)/main.lds
example/maple_wink.elf: $(START_OBJ) $(MAPLE_WINK_OBJ)
@ -473,17 +473,17 @@ TEXTURE_FILTERING_OBJ = \
holly/background.o \
holly/ta_fifo_polygon_converter.o \
holly/video_output.o \
bbb1.data.o \
bbb2.data.o \
bbb4.data.o \
bbb8.data.o \
bbb16.data.o \
bbb32.data.o \
bbb64.data.o \
bbb128.data.o \
bbb256.data.o \
bbb512.data.o \
bbb1024.data.o
texture/bbb/bbb1.data.o \
texture/bbb/bbb2.data.o \
texture/bbb/bbb4.data.o \
texture/bbb/bbb8.data.o \
texture/bbb/bbb16.data.o \
texture/bbb/bbb32.data.o \
texture/bbb/bbb64.data.o \
texture/bbb/bbb128.data.o \
texture/bbb/bbb256.data.o \
texture/bbb/bbb512.data.o \
texture/bbb/bbb1024.data.o
example/texture_filtering.elf: LDSCRIPT = $(LIB)/main.lds
example/texture_filtering.elf: $(START_OBJ) $(TEXTURE_FILTERING_OBJ)
@ -495,21 +495,21 @@ TEXTURE_FILTERING_MAPLE_OBJ = \
holly/background.o \
holly/ta_fifo_polygon_converter.o \
holly/video_output.o \
bbb1.data.o \
bbb2.data.o \
bbb4.data.o \
bbb8.data.o \
bbb16.data.o \
bbb32.data.o \
bbb64.data.o \
bbb128.data.o \
bbb256.data.o \
bbb512.data.o \
bbb1024.data.o \
texture/bbb/bbb1.data.o \
texture/bbb/bbb2.data.o \
texture/bbb/bbb4.data.o \
texture/bbb/bbb8.data.o \
texture/bbb/bbb16.data.o \
texture/bbb/bbb32.data.o \
texture/bbb/bbb64.data.o \
texture/bbb/bbb128.data.o \
texture/bbb/bbb256.data.o \
texture/bbb/bbb512.data.o \
texture/bbb/bbb1024.data.o \
maple/maple.o \
sh7091/serial.o \
font/font_bitmap.o \
verite_8x16.data.o
font/verite_8x16/verite_8x16.data.o
example/texture_filtering_maple.elf: LDSCRIPT = $(LIB)/main.lds
example/texture_filtering_maple.elf: $(START_OBJ) $(TEXTURE_FILTERING_MAPLE_OBJ)
@ -553,10 +553,10 @@ SIERPINSKI_OBJ = \
holly/background.o \
holly/ta_fifo_polygon_converter.o \
holly/video_output.o \
wolf2.data.o \
wolf2.data.pal.o \
strawberry.data.o \
strawberry.data.pal.o \
texture/wolf2/wolf2.data.o \
texture/wolf2/wolf2.data.pal.o \
texture/strawberry/strawberry.data.o \
texture/strawberry/strawberry.data.pal.o \
$(LIBGCC)
example/sierpinski.elf: LDSCRIPT = $(LIB)/main.lds

View File

@ -11,7 +11,7 @@
#include "holly/video_output.hpp"
extern uint32_t _binary_wink_data_start __asm("_binary_wink_data_start");
extern uint32_t _binary_wink_data_start __asm("_binary_texture_wink_wink_data_start");
constexpr uint32_t width = 48;
constexpr uint32_t height = 32;
constexpr uint32_t pixels_per_byte = 8;

View File

@ -24,34 +24,34 @@
#include "math/vec4.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_commands.hpp"
#include "maple/maple_bus_ft0.hpp"
#include "macaw.hpp"
#include "wolf.hpp"
#include "texture/macaw/macaw.data.h"
#include "texture/wolf/wolf.data.h"
#include "twiddle.hpp"
static ft0::data_transfer::data_format data[4];
void do_get_condition(uint32_t * command_buf,
uint32_t * receive_buf)
void do_get_condition()
{
using command_type = get_condition;
using response_type = data_transfer<ft0::data_transfer::data_format>;
uint32_t send_buf[1024] __attribute__((aligned(32)));
uint32_t recv_buf[1024] __attribute__((aligned(32)));
get_condition::data_fields data_fields = {
.function_type = std::byteswap(function_type::controller)
};
auto writer = maple::host_command_writer(send_buf, recv_buf);
const uint32_t command_size = maple::init_host_command_all_ports<command_type, response_type>(command_buf, receive_buf,
data_fields);
using host_response_type = struct maple::host_response<response_type::data_fields>;
auto host_response = reinterpret_cast<host_response_type *>(receive_buf);
using command_type = maple::get_condition;
using response_type = maple::data_transfer<ft0::data_transfer::data_format>;
maple::dma_start(command_buf, command_size,
receive_buf, maple::sizeof_command(host_response));
auto [host_command, host_response]
= writer.append_command_all_ports<command_type, response_type>();
host_command->bus_data.data_fields.function_type = std::byteswap(function_type::controller);
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++) {
@ -64,10 +64,10 @@ void do_get_condition(uint32_t * command_buf,
return;
}
data[port].analog_axis_1 = data_fields.data.analog_axis_1;
data[port].analog_axis_2 = data_fields.data.analog_axis_2;
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[0] = data_fields.data.analog_coordinate_axis[0];
data[port].analog_coordinate_axis[1] = data_fields.data.analog_coordinate_axis[1];
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];
}
}
@ -325,11 +325,11 @@ load_texture(const uint8_t * src,
void update_rot_pos(struct rot_pos& rot_pos)
{
const float l_pos = static_cast<float>(data[0].analog_axis_1) * (1.f / 255.f);
const float r_pos = static_cast<float>(data[0].analog_axis_2) * (1.f / 255.f);
const float l_pos = static_cast<float>(data[0].analog_coordinate_axis[0]) * (1.f / 255.f);
const float r_pos = static_cast<float>(data[0].analog_coordinate_axis[1]) * (1.f / 255.f);
const float x_pos = static_cast<float>(data[0].analog_axis_3 - 0x80) * (0.5f / 127.f);
const float y_pos = static_cast<float>(data[0].analog_axis_4 - 0x80) * (0.5f / 127.f);
const float x_pos = static_cast<float>(data[0].analog_coordinate_axis[2] - 0x80) * (0.5f / 127.f);
const float y_pos = static_cast<float>(data[0].analog_coordinate_axis[3] - 0x80) * (0.5f / 127.f);
const float rotation = (l_pos > r_pos) ? (l_pos) : (-r_pos);
@ -341,18 +341,16 @@ void update_rot_pos(struct rot_pos& rot_pos)
}
uint32_t _ta_parameter_buf[((32 * 8192) + 32) / 4];
uint32_t _command_buf[(1024 + 32) / 4];
uint32_t _receive_buf[(1024 + 32) / 4];
void main()
{
video_output::set_mode_vga();
auto src0 = reinterpret_cast<const uint8_t *>(&_binary_macaw_data_start);
auto size0 = reinterpret_cast<const uint32_t>(&_binary_macaw_data_size);
auto src0 = reinterpret_cast<const uint8_t *>(&_binary_texture_macaw_macaw_data_start);
auto size0 = reinterpret_cast<const uint32_t>(&_binary_texture_macaw_macaw_data_size);
auto src1 = reinterpret_cast<const uint8_t *>(&_binary_wolf_data_start);
auto size1 = reinterpret_cast<const uint32_t>(&_binary_wolf_data_size);
auto src1 = reinterpret_cast<const uint8_t *>(&_binary_texture_wolf_wolf_data_start);
auto size1 = reinterpret_cast<const uint32_t>(&_binary_texture_wolf_wolf_data_size);
load_texture(src0, size0, 0);
load_texture(src1, size1, 1);
@ -360,8 +358,6 @@ void main()
// 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);
uint32_t * command_buf = align_32byte(_command_buf);
uint32_t * receive_buf = align_32byte(_receive_buf);
constexpr uint32_t ta_alloc = ta_alloc_ctrl::pt_opb::no_list
| ta_alloc_ctrl::tm_opb::no_list
@ -389,7 +385,7 @@ void main()
struct rot_pos rot_pos = { 0.f, 0.f, 0.f };
while (true) {
do_get_condition(command_buf, receive_buf);
do_get_condition();
update_rot_pos(rot_pos);

View File

@ -29,7 +29,7 @@ int main()
serial::string("wait\n");
while (true) {
serial::recv_dma(&bufi[0], 4);
serial::recv_dma(reinterpret_cast<uint32_t>(bufi), 4);
while ((sh7091.DMAC.CHCR1 & dmac::chcr::te::transfers_completed) == 0) {
};

View File

@ -16,9 +16,10 @@
#include "sh7091/store_queue.hpp"
#include "math/vec2.hpp"
#include "wolf2.hpp"
#include "strawberry.hpp"
#include "texture/wolf2/wolf2.data.h"
#include "texture/strawberry/strawberry.data.h"
#include "texture/wolf2/wolf2.data.pal.h"
#include "texture/strawberry/strawberry.data.pal.h"
/*
a
@ -267,14 +268,14 @@ void copy_textures_palettes()
{
auto texture = reinterpret_cast<volatile uint32_t *>(&texture_memory64[texture_memory_alloc::texture.start / 4]);
auto wolf_src = reinterpret_cast<const uint8_t *>(&_binary_wolf2_data_start);
auto wolf_pal_src = reinterpret_cast<const uint8_t *>(&_binary_wolf2_data_pal_start);
auto wolf_src = reinterpret_cast<const uint8_t *>(&_binary_texture_wolf2_wolf2_data_start);
auto wolf_pal_src = reinterpret_cast<const uint8_t *>(&_binary_texture_wolf2_wolf2_data_pal_start);
auto wolf_texture = &texture[1024 * 1024 / 4 * 1];
copy_texture(wolf_src, wolf_texture);
copy_palette(wolf_pal_src, 1);
auto strawberry_src = reinterpret_cast<const uint8_t *>(&_binary_strawberry_data_start);
auto strawberry_pal_src = reinterpret_cast<const uint8_t *>(&_binary_strawberry_data_pal_start);
auto strawberry_src = reinterpret_cast<const uint8_t *>(&_binary_texture_strawberry_strawberry_data_start);
auto strawberry_pal_src = reinterpret_cast<const uint8_t *>(&_binary_texture_strawberry_strawberry_data_pal_start);
auto strawberry_texture = &texture[1024 * 1024 / 4 * 0];
copy_texture(strawberry_src, strawberry_texture);
copy_palette(strawberry_pal_src, 0);

View File

@ -19,7 +19,7 @@
#include "sh7091/serial.hpp"
#include "macaw.hpp"
#include "texture/macaw/macaw.data.h"
#include "software_ta.hpp"
uint32_t transform(uint32_t * ta_parameter_buf,

View File

@ -26,7 +26,7 @@
#include "math/vec4.hpp"
#include "font/font_bitmap.hpp"
#include "verite_8x16.hpp"
#include "font/verite_8x16/verite_8x16.data.h"
#include "string.hpp"
constexpr float half_degree = 0.01745329f / 2;
@ -100,7 +100,7 @@ void transform(ta_parameter_writer& parameter,
auto l = lights[0] - point;
auto n_dot_l = dot(n, l);
if (n_dot_l > 0) {
color.x += 0.6 * n_dot_l / (length(n) * length(l));
color.x += 0.6 * n_dot_l / (magnitude(n) * magnitude(l));
}
}
@ -108,7 +108,7 @@ void transform(ta_parameter_writer& parameter,
auto l = lights[1] - point;
auto n_dot_l = dot(n, l);
if (n_dot_l > 0) {
color.y += 0.6 * n_dot_l / (length(n) * length(l));
color.y += 0.6 * n_dot_l / (magnitude(n) * magnitude(l));
}
}
@ -116,7 +116,7 @@ void transform(ta_parameter_writer& parameter,
auto l = lights[2] - point;
auto n_dot_l = dot(n, l);
if (n_dot_l > 0) {
color.z += 0.6 * n_dot_l / (length(n) * length(l));
color.z += 0.6 * n_dot_l / (magnitude(n) * magnitude(l));
}
}
@ -274,7 +274,7 @@ void main()
video_output::set_mode_vga();
auto src = reinterpret_cast<const uint8_t *>(&_binary_verite_8x16_data_start);
auto src = reinterpret_cast<const uint8_t *>(&_binary_font_verite_8x16_verite_8x16_data_start);
font_bitmap::inflate(1, // pitch
8, // width
16, // height

View File

@ -198,6 +198,7 @@ void ta_copy(uint32_t * address, uint32_t size)
void main()
{
serial::init(0);
video_output::set_mode_vga();
constexpr uint32_t ta_alloc = ta_alloc_ctrl::pt_opb::no_list

View File

@ -20,7 +20,18 @@
#include "sh7091/serial.hpp"
#include "bbb.hpp"
#include "texture/bbb/bbb1024.data.h"
#include "texture/bbb/bbb128.data.h"
#include "texture/bbb/bbb16.data.h"
#include "texture/bbb/bbb1.data.h"
#include "texture/bbb/bbb256.data.h"
#include "texture/bbb/bbb2.data.h"
#include "texture/bbb/bbb32.data.h"
#include "texture/bbb/bbb4.data.h"
#include "texture/bbb/bbb512.data.h"
#include "texture/bbb/bbb64.data.h"
#include "texture/bbb/bbb8.data.h"
#include "texture/bbb/bbb.data.h"
struct vertex {
float x;
@ -253,17 +264,17 @@ void init_texture_memory(const struct opb_size& opb_size)
}
uint8_t const * const mips[] = {
reinterpret_cast<uint8_t *>(&_binary_bbb1_data_start),
reinterpret_cast<uint8_t *>(&_binary_bbb2_data_start),
reinterpret_cast<uint8_t *>(&_binary_bbb4_data_start),
reinterpret_cast<uint8_t *>(&_binary_bbb8_data_start),
reinterpret_cast<uint8_t *>(&_binary_bbb16_data_start),
reinterpret_cast<uint8_t *>(&_binary_bbb32_data_start),
reinterpret_cast<uint8_t *>(&_binary_bbb64_data_start),
reinterpret_cast<uint8_t *>(&_binary_bbb128_data_start),
reinterpret_cast<uint8_t *>(&_binary_bbb256_data_start),
reinterpret_cast<uint8_t *>(&_binary_bbb512_data_start),
reinterpret_cast<uint8_t *>(&_binary_bbb1024_data_start)
reinterpret_cast<uint8_t *>(&_binary_texture_bbb_bbb1_data_start),
reinterpret_cast<uint8_t *>(&_binary_texture_bbb_bbb2_data_start),
reinterpret_cast<uint8_t *>(&_binary_texture_bbb_bbb4_data_start),
reinterpret_cast<uint8_t *>(&_binary_texture_bbb_bbb8_data_start),
reinterpret_cast<uint8_t *>(&_binary_texture_bbb_bbb16_data_start),
reinterpret_cast<uint8_t *>(&_binary_texture_bbb_bbb32_data_start),
reinterpret_cast<uint8_t *>(&_binary_texture_bbb_bbb64_data_start),
reinterpret_cast<uint8_t *>(&_binary_texture_bbb_bbb128_data_start),
reinterpret_cast<uint8_t *>(&_binary_texture_bbb_bbb256_data_start),
reinterpret_cast<uint8_t *>(&_binary_texture_bbb_bbb512_data_start),
reinterpret_cast<uint8_t *>(&_binary_texture_bbb_bbb1024_data_start)
};
void _copy_bbb_texture(uint32_t dst_offset, uint8_t const * const src, uint32_t mip)

View File

@ -21,17 +21,28 @@
#include "palette.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_commands.hpp"
#include "maple/maple_bus_ft0.hpp"
#include "font/font_bitmap.hpp"
#include "verite_8x16.hpp"
#include "font/verite_8x16/verite_8x16.data.h"
#include "sh7091/serial.hpp"
#include "bbb.hpp"
#include "texture/bbb/bbb1024.data.h"
#include "texture/bbb/bbb128.data.h"
#include "texture/bbb/bbb16.data.h"
#include "texture/bbb/bbb1.data.h"
#include "texture/bbb/bbb256.data.h"
#include "texture/bbb/bbb2.data.h"
#include "texture/bbb/bbb32.data.h"
#include "texture/bbb/bbb4.data.h"
#include "texture/bbb/bbb512.data.h"
#include "texture/bbb/bbb64.data.h"
#include "texture/bbb/bbb8.data.h"
#include "texture/bbb/bbb.data.h"
struct vertex {
float x;
@ -166,17 +177,17 @@ void append_trilinear_pass_b(ta_parameter_writer& parameter, uint32_t texture_co
}
uint8_t const * const mips[] = {
reinterpret_cast<uint8_t *>(&_binary_bbb1_data_start),
reinterpret_cast<uint8_t *>(&_binary_bbb2_data_start),
reinterpret_cast<uint8_t *>(&_binary_bbb4_data_start),
reinterpret_cast<uint8_t *>(&_binary_bbb8_data_start),
reinterpret_cast<uint8_t *>(&_binary_bbb16_data_start),
reinterpret_cast<uint8_t *>(&_binary_bbb32_data_start),
reinterpret_cast<uint8_t *>(&_binary_bbb64_data_start),
reinterpret_cast<uint8_t *>(&_binary_bbb128_data_start),
reinterpret_cast<uint8_t *>(&_binary_bbb256_data_start),
reinterpret_cast<uint8_t *>(&_binary_bbb512_data_start),
reinterpret_cast<uint8_t *>(&_binary_bbb1024_data_start)
reinterpret_cast<uint8_t *>(&_binary_texture_bbb_bbb1_data_start),
reinterpret_cast<uint8_t *>(&_binary_texture_bbb_bbb2_data_start),
reinterpret_cast<uint8_t *>(&_binary_texture_bbb_bbb4_data_start),
reinterpret_cast<uint8_t *>(&_binary_texture_bbb_bbb8_data_start),
reinterpret_cast<uint8_t *>(&_binary_texture_bbb_bbb16_data_start),
reinterpret_cast<uint8_t *>(&_binary_texture_bbb_bbb32_data_start),
reinterpret_cast<uint8_t *>(&_binary_texture_bbb_bbb64_data_start),
reinterpret_cast<uint8_t *>(&_binary_texture_bbb_bbb128_data_start),
reinterpret_cast<uint8_t *>(&_binary_texture_bbb_bbb256_data_start),
reinterpret_cast<uint8_t *>(&_binary_texture_bbb_bbb512_data_start),
reinterpret_cast<uint8_t *>(&_binary_texture_bbb_bbb1024_data_start)
};
void _copy_bbb_texture(uint32_t dst_offset, uint8_t const * const src, uint32_t mip)
@ -235,20 +246,21 @@ void do_get_condition(uint32_t * command_buf,
uint32_t * receive_buf,
button_state& buttons)
{
using command_type = get_condition;
using response_type = data_transfer<ft0::data_transfer::data_format>;
uint32_t send_buf[1024] __attribute__((aligned(32)));
uint32_t recv_buf[1024] __attribute__((aligned(32)));
get_condition::data_fields data_fields = {
.function_type = std::byteswap(function_type::controller)
};
auto writer = maple::host_command_writer(send_buf, recv_buf);
const uint32_t command_size = maple::init_host_command_all_ports<command_type, response_type>(command_buf, receive_buf,
data_fields);
using host_response_type = struct maple::host_response<response_type::data_fields>;
auto host_response = reinterpret_cast<host_response_type *>(receive_buf);
using command_type = maple::get_condition;
using response_type = maple::data_transfer<ft0::data_transfer::data_format>;
maple::dma_start(command_buf, command_size,
receive_buf, maple::sizeof_command(host_response));
auto [host_command, host_response]
= writer.append_command_all_ports<command_type, response_type>();
host_command->bus_data.data_fields.function_type = std::byteswap(function_type::controller);
maple::dma_start(send_buf, writer.send_offset,
recv_buf, writer.recv_offset);
maple::dma_wait_complete();
buttons.reset();
@ -582,7 +594,7 @@ void main()
holly.PT_ALPHA_REF = 0x1;
background_parameter(0xff00ff00);
auto src = reinterpret_cast<const uint8_t *>(&_binary_verite_8x16_data_start);
auto src = reinterpret_cast<const uint8_t *>(&_binary_font_verite_8x16_verite_8x16_data_start);
uint32_t bbb_offset = font_bitmap::inflate(1, // pitch
8, // width
16, // height

View File

@ -17,7 +17,7 @@
#include "holly/texture_memory_alloc.hpp"
#include "memorymap.hpp"
#include "macaw.hpp"
#include "texture/macaw/macaw.data.h"
struct vertex {
float x;
@ -145,8 +145,8 @@ void main()
{
video_output::set_mode_vga();
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

@ -49,11 +49,17 @@ static inline void inflate_character(const uint32_t pitch,
auto texture = reinterpret_cast<volatile uint32_t *>(&texture_memory64[texture_memory_alloc::texture.start / 4]);
uint8_t temp2[texture_width * texture_height / 2];
const uint32_t texture_offset = texture_width * texture_height * character_index / 2;
twiddle::texture2<4>(&texture[texture_offset / 4], // uint32_t *
temp,
texture_width,
texture_width * texture_height);
twiddle::texture_4bpp(temp2,
temp,
texture_width,
texture_height);
for (uint32_t i = 0; i < texture_width * texture_height / (2 * 4); i++) {
texture[texture_offset / 4 + i] = reinterpret_cast<uint32_t *>(temp2)[i];
}
}
uint32_t inflate(const uint32_t pitch,

View File

@ -0,0 +1,5 @@
#pragma once
#include <cstdint>
extern uint32_t _binary_font_verite_8x16_verite_8x16_data_start __asm("_binary_font_verite_8x16_verite_8x16_data_start");
extern uint32_t _binary_font_verite_8x16_verite_8x16_data_end __asm("_binary_font_verite_8x16_verite_8x16_data_end");
extern uint32_t _binary_font_verite_8x16_verite_8x16_data_size __asm("_binary_font_verite_8x16_verite_8x16_data_size");

23
insert_bytes.py Normal file
View File

@ -0,0 +1,23 @@
import sys
start_offset = sys.argv[1]
size = sys.argv[2]
input_file = sys.argv[3]
output_file = sys.argv[4]
assert start_offset.startswith('0x')
start_offset = int(start_offset[2:], 16)
assert size.startswith('0x')
size = int(size[2:], 16)
with open(sys.argv[3], 'rb') as f:
in_buf = f.read()
with open(sys.argv[4], 'rb') as f:
out_buf = bytearray(f.read())
for i in range(start_offset, start_offset + size):
out_buf[i] = in_buf[i]
with open(sys.argv[4], 'wb') as f:
f.write(out_buf)

5
texture/bbb/bbb.data.h Normal file
View File

@ -0,0 +1,5 @@
#pragma once
#include <cstdint>
extern uint32_t _binary_texture_bbb_bbb_data_start __asm("_binary_texture_bbb_bbb_data_start");
extern uint32_t _binary_texture_bbb_bbb_data_end __asm("_binary_texture_bbb_bbb_data_end");
extern uint32_t _binary_texture_bbb_bbb_data_size __asm("_binary_texture_bbb_bbb_data_size");

View File

@ -1,17 +0,0 @@
#include <cstdint>
extern uint32_t _binary_bbb_data_start __asm("_binary_bbb_data_start");
extern uint32_t _binary_bbb_data_end __asm("_binary_bbb_data_end");
extern uint32_t _binary_bbb_data_size __asm("_binary_bbb_data_size");
extern uint32_t _binary_bbb1_data_start __asm("_binary_bbb1_data_start");
extern uint32_t _binary_bbb2_data_start __asm("_binary_bbb2_data_start");
extern uint32_t _binary_bbb4_data_start __asm("_binary_bbb4_data_start");
extern uint32_t _binary_bbb8_data_start __asm("_binary_bbb8_data_start");
extern uint32_t _binary_bbb16_data_start __asm("_binary_bbb16_data_start");
extern uint32_t _binary_bbb32_data_start __asm("_binary_bbb32_data_start");
extern uint32_t _binary_bbb64_data_start __asm("_binary_bbb64_data_start");
extern uint32_t _binary_bbb128_data_start __asm("_binary_bbb128_data_start");
extern uint32_t _binary_bbb256_data_start __asm("_binary_bbb256_data_start");
extern uint32_t _binary_bbb512_data_start __asm("_binary_bbb512_data_start");
extern uint32_t _binary_bbb1024_data_start __asm("_binary_bbb1024_data_start");

5
texture/bbb/bbb1.data.h Normal file
View File

@ -0,0 +1,5 @@
#pragma once
#include <cstdint>
extern uint32_t _binary_texture_bbb_bbb1_data_start __asm("_binary_texture_bbb_bbb1_data_start");
extern uint32_t _binary_texture_bbb_bbb1_data_end __asm("_binary_texture_bbb_bbb1_data_end");
extern uint32_t _binary_texture_bbb_bbb1_data_size __asm("_binary_texture_bbb_bbb1_data_size");

View File

@ -0,0 +1,5 @@
#pragma once
#include <cstdint>
extern uint32_t _binary_texture_bbb_bbb1024_data_start __asm("_binary_texture_bbb_bbb1024_data_start");
extern uint32_t _binary_texture_bbb_bbb1024_data_end __asm("_binary_texture_bbb_bbb1024_data_end");
extern uint32_t _binary_texture_bbb_bbb1024_data_size __asm("_binary_texture_bbb_bbb1024_data_size");

View File

@ -0,0 +1,5 @@
#pragma once
#include <cstdint>
extern uint32_t _binary_texture_bbb_bbb128_data_start __asm("_binary_texture_bbb_bbb128_data_start");
extern uint32_t _binary_texture_bbb_bbb128_data_end __asm("_binary_texture_bbb_bbb128_data_end");
extern uint32_t _binary_texture_bbb_bbb128_data_size __asm("_binary_texture_bbb_bbb128_data_size");

5
texture/bbb/bbb16.data.h Normal file
View File

@ -0,0 +1,5 @@
#pragma once
#include <cstdint>
extern uint32_t _binary_texture_bbb_bbb16_data_start __asm("_binary_texture_bbb_bbb16_data_start");
extern uint32_t _binary_texture_bbb_bbb16_data_end __asm("_binary_texture_bbb_bbb16_data_end");
extern uint32_t _binary_texture_bbb_bbb16_data_size __asm("_binary_texture_bbb_bbb16_data_size");

5
texture/bbb/bbb2.data.h Normal file
View File

@ -0,0 +1,5 @@
#pragma once
#include <cstdint>
extern uint32_t _binary_texture_bbb_bbb2_data_start __asm("_binary_texture_bbb_bbb2_data_start");
extern uint32_t _binary_texture_bbb_bbb2_data_end __asm("_binary_texture_bbb_bbb2_data_end");
extern uint32_t _binary_texture_bbb_bbb2_data_size __asm("_binary_texture_bbb_bbb2_data_size");

View File

@ -0,0 +1,5 @@
#pragma once
#include <cstdint>
extern uint32_t _binary_texture_bbb_bbb256_data_start __asm("_binary_texture_bbb_bbb256_data_start");
extern uint32_t _binary_texture_bbb_bbb256_data_end __asm("_binary_texture_bbb_bbb256_data_end");
extern uint32_t _binary_texture_bbb_bbb256_data_size __asm("_binary_texture_bbb_bbb256_data_size");

5
texture/bbb/bbb32.data.h Normal file
View File

@ -0,0 +1,5 @@
#pragma once
#include <cstdint>
extern uint32_t _binary_texture_bbb_bbb32_data_start __asm("_binary_texture_bbb_bbb32_data_start");
extern uint32_t _binary_texture_bbb_bbb32_data_end __asm("_binary_texture_bbb_bbb32_data_end");
extern uint32_t _binary_texture_bbb_bbb32_data_size __asm("_binary_texture_bbb_bbb32_data_size");

5
texture/bbb/bbb4.data.h Normal file
View File

@ -0,0 +1,5 @@
#pragma once
#include <cstdint>
extern uint32_t _binary_texture_bbb_bbb4_data_start __asm("_binary_texture_bbb_bbb4_data_start");
extern uint32_t _binary_texture_bbb_bbb4_data_end __asm("_binary_texture_bbb_bbb4_data_end");
extern uint32_t _binary_texture_bbb_bbb4_data_size __asm("_binary_texture_bbb_bbb4_data_size");

View File

@ -0,0 +1,5 @@
#pragma once
#include <cstdint>
extern uint32_t _binary_texture_bbb_bbb512_data_start __asm("_binary_texture_bbb_bbb512_data_start");
extern uint32_t _binary_texture_bbb_bbb512_data_end __asm("_binary_texture_bbb_bbb512_data_end");
extern uint32_t _binary_texture_bbb_bbb512_data_size __asm("_binary_texture_bbb_bbb512_data_size");

5
texture/bbb/bbb64.data.h Normal file
View File

@ -0,0 +1,5 @@
#pragma once
#include <cstdint>
extern uint32_t _binary_texture_bbb_bbb64_data_start __asm("_binary_texture_bbb_bbb64_data_start");
extern uint32_t _binary_texture_bbb_bbb64_data_end __asm("_binary_texture_bbb_bbb64_data_end");
extern uint32_t _binary_texture_bbb_bbb64_data_size __asm("_binary_texture_bbb_bbb64_data_size");

5
texture/bbb/bbb8.data.h Normal file
View File

@ -0,0 +1,5 @@
#pragma once
#include <cstdint>
extern uint32_t _binary_texture_bbb_bbb8_data_start __asm("_binary_texture_bbb_bbb8_data_start");
extern uint32_t _binary_texture_bbb_bbb8_data_end __asm("_binary_texture_bbb_bbb8_data_end");
extern uint32_t _binary_texture_bbb_bbb8_data_size __asm("_binary_texture_bbb_bbb8_data_size");

View File

@ -0,0 +1,5 @@
#pragma once
#include <cstdint>
extern uint32_t _binary_texture_strawberry_strawberry_data_start __asm("_binary_texture_strawberry_strawberry_data_start");
extern uint32_t _binary_texture_strawberry_strawberry_data_end __asm("_binary_texture_strawberry_strawberry_data_end");
extern uint32_t _binary_texture_strawberry_strawberry_data_size __asm("_binary_texture_strawberry_strawberry_data_size");

View File

@ -0,0 +1,5 @@
#pragma once
#include <cstdint>
extern uint32_t _binary_texture_strawberry_strawberry_data_pal_start __asm("_binary_texture_strawberry_strawberry_data_pal_start");
extern uint32_t _binary_texture_strawberry_strawberry_data_pal_end __asm("_binary_texture_strawberry_strawberry_data_pal_end");
extern uint32_t _binary_texture_strawberry_strawberry_data_pal_size __asm("_binary_texture_strawberry_strawberry_data_pal_size");

View File

@ -1,9 +0,0 @@
#include <cstdint>
extern uint32_t _binary_strawberry_data_start __asm("_binary_strawberry_data_start");
extern uint32_t _binary_strawberry_data_end __asm("_binary_strawberry_data_end");
extern uint32_t _binary_strawberry_data_size __asm("_binary_strawberry_data_size");
extern uint32_t _binary_strawberry_data_pal_start __asm("_binary_strawberry_data_pal_start");
extern uint32_t _binary_strawberry_data_pal_end __asm("_binary_strawberry_data_pal_end");
extern uint32_t _binary_strawberry_data_pal_size __asm("_binary_strawberry_data_pal_size");

5
texture/wolf/wolf.data.h Normal file
View File

@ -0,0 +1,5 @@
#pragma once
#include <cstdint>
extern uint32_t _binary_texture_wolf_wolf_data_start __asm("_binary_texture_wolf_wolf_data_start");
extern uint32_t _binary_texture_wolf_wolf_data_end __asm("_binary_texture_wolf_wolf_data_end");
extern uint32_t _binary_texture_wolf_wolf_data_size __asm("_binary_texture_wolf_wolf_data_size");

View File

@ -1,5 +0,0 @@
#include <cstdint>
extern uint32_t _binary_wolf_data_start __asm("_binary_wolf_data_start");
extern uint32_t _binary_wolf_data_end __asm("_binary_wolf_data_end");
extern uint32_t _binary_wolf_data_size __asm("_binary_wolf_data_size");

View File

@ -0,0 +1,5 @@
#pragma once
#include <cstdint>
extern uint32_t _binary_texture_wolf2_wolf2_data_start __asm("_binary_texture_wolf2_wolf2_data_start");
extern uint32_t _binary_texture_wolf2_wolf2_data_end __asm("_binary_texture_wolf2_wolf2_data_end");
extern uint32_t _binary_texture_wolf2_wolf2_data_size __asm("_binary_texture_wolf2_wolf2_data_size");

View File

@ -0,0 +1,5 @@
#pragma once
#include <cstdint>
extern uint32_t _binary_texture_wolf2_wolf2_data_pal_start __asm("_binary_texture_wolf2_wolf2_data_pal_start");
extern uint32_t _binary_texture_wolf2_wolf2_data_pal_end __asm("_binary_texture_wolf2_wolf2_data_pal_end");
extern uint32_t _binary_texture_wolf2_wolf2_data_pal_size __asm("_binary_texture_wolf2_wolf2_data_pal_size");

View File

@ -1,9 +0,0 @@
#include <cstdint>
extern uint32_t _binary_wolf2_data_start __asm("_binary_wolf2_data_start");
extern uint32_t _binary_wolf2_data_end __asm("_binary_wolf2_data_end");
extern uint32_t _binary_wolf2_data_size __asm("_binary_wolf2_data_size");
extern uint32_t _binary_wolf2_data_pal_start __asm("_binary_wolf2_data_pal_start");
extern uint32_t _binary_wolf2_data_pal_end __asm("_binary_wolf2_data_pal_end");
extern uint32_t _binary_wolf2_data_pal_size __asm("_binary_wolf2_data_pal_size");