add verite font

There are still texture sampling issues that I don't understand. Until
I properly understand this, using (bitmap) fonts that have
power-of-two dimensions seem to produce "acceptable but incorrect"
results.
This commit is contained in:
Zack Buhman 2024-02-02 09:12:51 +08:00
parent 62f47f8f0b
commit b17e075138
12 changed files with 35 additions and 28 deletions

View File

@ -1,7 +0,0 @@
#pragma once
#include <cstdint>
extern uint32_t _binary_europc_mono_data_start __asm("_binary_europc_mono_data_start");
extern uint32_t _binary_europc_mono_data_end __asm("_binary_europc_mono_data_end");
extern uint32_t _binary_europc_mono_data_size __asm("_binary_europc_mono_data_size");

7
europc_mono_9x14.hpp Normal file
View File

@ -0,0 +1,7 @@
#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

@ -40,7 +40,7 @@ FONT_BITMAP_OBJ = \
holly/region_array.o \
holly/background.o \
holly/ta_fifo_polygon_converter.o \
sperrypc.data.o
sperrypc_8x8.data.o
example/font_bitmap.elf: LDSCRIPT = $(LIB)/alt.lds
example/font_bitmap.elf: $(START_OBJ) $(FONT_BITMAP_OBJ)
@ -124,7 +124,7 @@ SUZANNE_PROFILE_OBJ = \
holly/ta_fifo_polygon_converter.o \
font/font_bitmap.o \
sh7091/serial.o \
europc_mono.data.o
verite_8x16.data.o
example/suzanne_profile.elf: LDSCRIPT = $(LIB)/alt.lds
example/suzanne_profile.elf: $(START_OBJ) $(SUZANNE_PROFILE_OBJ)

View File

@ -18,7 +18,7 @@
#include "holly/region_array.hpp"
#include "twiddle.hpp"
#include "sperrypc.hpp"
#include "sperrypc_8x8.hpp"
struct vertex {
float x;
@ -229,7 +229,7 @@ void main()
{
vga();
auto src = reinterpret_cast<const uint8_t *>(&_binary_sperrypc_data_start);
auto src = reinterpret_cast<const uint8_t *>(&_binary_sperrypc_8x8_data_start);
inflate_font(src);
palette_data();

View File

@ -21,7 +21,7 @@
#include "math/vec4.hpp"
#include "font/font_bitmap.hpp"
#include "europc_mono.hpp"
#include "verite_8x16.hpp"
constexpr float half_degree = 0.01745329f / 2;
@ -239,11 +239,11 @@ void main()
{
vga();
auto src = reinterpret_cast<const uint8_t *>(&_binary_europc_mono_data_start);
font_bitmap::inflate(2, // pitch
9, // width
14, // height
16, // texture_width
auto src = reinterpret_cast<const uint8_t *>(&_binary_verite_8x16_data_start);
font_bitmap::inflate(1, // pitch
8, // width
16, // height
8, // texture_width
16, // texture_height
src);
font_bitmap::palette_data();
@ -308,8 +308,8 @@ void main()
transform2(parameter, lights[2], {0.f, 0.f, 1.f, 1.f});
font_bitmap::transform_string(parameter,
16, 16, // texture
9, 14, // glyph
8, 16, // texture
8, 16, // glyph
40, 40, // position
"test", 4);

View File

@ -156,8 +156,8 @@ void transform_string(ta_parameter_writer& parameter,
y += static_cast<float>(position_y);
z = 1.f / (z + 10.f);
u *= static_cast<float>(glyph_width - 1) / static_cast<float>(texture_width);
v *= static_cast<float>(glyph_height - 1) / static_cast<float>(texture_height);
u *= static_cast<float>(glyph_width) / static_cast<float>(texture_width);
v *= static_cast<float>(glyph_height) / static_cast<float>(texture_height);
parameter.append<ta_vertex_parameter::polygon_type_3>() =
ta_vertex_parameter::polygon_type_3(polygon_vertex_parameter_control_word(end_of_strip),

View File

@ -1,7 +0,0 @@
#pragma once
#include <cstdint>
extern uint32_t _binary_sperrypc_data_start __asm("_binary_sperrypc_data_start");
extern uint32_t _binary_sperrypc_data_end __asm("_binary_sperrypc_data_end");
extern uint32_t _binary_sperrypc_data_size __asm("_binary_sperrypc_data_size");

7
sperrypc_8x8.hpp Normal file
View File

@ -0,0 +1,7 @@
#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");

BIN
verite_8x16.data Normal file

Binary file not shown.

7
verite_8x16.hpp Normal file
View File

@ -0,0 +1,7 @@
#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");