From the GCC manual. > GCC permits a C structure to have no members: struct empty { }; > The structure has size zero. In C++, empty structures are part of the > language. G++ treats empty structures as if they had a single member of type > char. I was not aware of the different behavior in C++. This fixes every maple example--most were broken for multiple reasons, including this one. This also enables SH4 caching. This includes linking code/data into the P1 area (previously this was not the case). The maple examples (which indeed involve much use of DMA) require much work to successfully work with the operand and copyback caches. The vibration example currently is the most complete, though I should consider more on how I want to structure maple response operand cache invalidation more generally.
58 lines
1.8 KiB
C++
58 lines
1.8 KiB
C++
#pragma once
|
|
|
|
#include "geometry.hpp"
|
|
|
|
namespace border {
|
|
constexpr vec3 vertices[] = {
|
|
{ -1.000000f, -0.000000f, 1.000000f },
|
|
{ 1.000000f, -0.000000f, 1.000000f },
|
|
{ -1.000000f, 0.000000f, -1.000000f },
|
|
{ 1.000000f, 0.000000f, -1.000000f },
|
|
{ 0.950000f, -0.000000f, 1.000000f },
|
|
{ 0.950000f, 0.000000f, -1.000000f },
|
|
{ 0.950000f, -0.000000f, 0.950000f },
|
|
{ 0.950000f, 0.000000f, -0.950000f },
|
|
{ -0.950000f, 0.000000f, -1.000000f },
|
|
{ -0.950000f, -0.000000f, 1.000000f },
|
|
{ -0.950000f, -0.000000f, 0.950000f },
|
|
{ -0.950000f, 0.000000f, -0.950000f },
|
|
};
|
|
|
|
constexpr vec2 texture[] = {
|
|
{ 0.000100f, 0.974905f },
|
|
{ 0.025095f, 0.025096f },
|
|
{ 0.025095f, 0.974905f },
|
|
{ 0.999900f, 0.974905f },
|
|
{ 0.974905f, 0.025095f },
|
|
{ 0.999900f, 0.025095f },
|
|
{ 0.000100f, 0.025096f },
|
|
{ 0.974905f, 0.974905f },
|
|
{ 0.000100f, 0.999900f },
|
|
{ 0.999900f, 0.000100f },
|
|
{ 0.000100f, 0.000101f },
|
|
{ 0.999900f, 0.999900f },
|
|
};
|
|
|
|
constexpr vec3 normals[] = {
|
|
{ -0.000000f, 1.000000f, -0.000000f },
|
|
};
|
|
|
|
constexpr face_vtn faces[] = {
|
|
{{ 5, 0, 0}, {11, 1, 0}, { 7, 2, 0}},
|
|
{{ 4, 3, 0}, {10, 4, 0}, { 9, 5, 0}},
|
|
{{ 5, 0, 0}, { 8, 6, 0}, {11, 1, 0}},
|
|
{{ 4, 3, 0}, { 6, 7, 0}, {10, 4, 0}},
|
|
{{ 7, 2, 0}, { 3, 8, 0}, { 5, 0, 0}},
|
|
{{ 0, 9, 0}, {10, 4, 0}, {11, 1, 0}},
|
|
{{11, 1, 0}, { 2, 10, 0}, { 0, 9, 0}},
|
|
{{ 1, 11, 0}, { 6, 7, 0}, { 4, 3, 0}},
|
|
{{ 7, 2, 0}, { 6, 7, 0}, { 3, 8, 0}},
|
|
{{ 0, 9, 0}, { 9, 5, 0}, {10, 4, 0}},
|
|
{{11, 1, 0}, { 8, 6, 0}, { 2, 10, 0}},
|
|
{{ 1, 11, 0}, { 3, 8, 0}, { 6, 7, 0}},
|
|
};
|
|
|
|
constexpr uint32_t num_faces = (sizeof (faces)) / (sizeof (face_vtn));
|
|
|
|
}
|