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:
parent
62f47f8f0b
commit
b17e075138
@ -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
7
europc_mono_9x14.hpp
Normal 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");
|
@ -40,7 +40,7 @@ FONT_BITMAP_OBJ = \
|
|||||||
holly/region_array.o \
|
holly/region_array.o \
|
||||||
holly/background.o \
|
holly/background.o \
|
||||||
holly/ta_fifo_polygon_converter.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: LDSCRIPT = $(LIB)/alt.lds
|
||||||
example/font_bitmap.elf: $(START_OBJ) $(FONT_BITMAP_OBJ)
|
example/font_bitmap.elf: $(START_OBJ) $(FONT_BITMAP_OBJ)
|
||||||
@ -124,7 +124,7 @@ SUZANNE_PROFILE_OBJ = \
|
|||||||
holly/ta_fifo_polygon_converter.o \
|
holly/ta_fifo_polygon_converter.o \
|
||||||
font/font_bitmap.o \
|
font/font_bitmap.o \
|
||||||
sh7091/serial.o \
|
sh7091/serial.o \
|
||||||
europc_mono.data.o
|
verite_8x16.data.o
|
||||||
|
|
||||||
example/suzanne_profile.elf: LDSCRIPT = $(LIB)/alt.lds
|
example/suzanne_profile.elf: LDSCRIPT = $(LIB)/alt.lds
|
||||||
example/suzanne_profile.elf: $(START_OBJ) $(SUZANNE_PROFILE_OBJ)
|
example/suzanne_profile.elf: $(START_OBJ) $(SUZANNE_PROFILE_OBJ)
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
#include "holly/region_array.hpp"
|
#include "holly/region_array.hpp"
|
||||||
#include "twiddle.hpp"
|
#include "twiddle.hpp"
|
||||||
|
|
||||||
#include "sperrypc.hpp"
|
#include "sperrypc_8x8.hpp"
|
||||||
|
|
||||||
struct vertex {
|
struct vertex {
|
||||||
float x;
|
float x;
|
||||||
@ -229,7 +229,7 @@ void main()
|
|||||||
{
|
{
|
||||||
vga();
|
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);
|
inflate_font(src);
|
||||||
palette_data();
|
palette_data();
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
#include "math/vec4.hpp"
|
#include "math/vec4.hpp"
|
||||||
|
|
||||||
#include "font/font_bitmap.hpp"
|
#include "font/font_bitmap.hpp"
|
||||||
#include "europc_mono.hpp"
|
#include "verite_8x16.hpp"
|
||||||
|
|
||||||
constexpr float half_degree = 0.01745329f / 2;
|
constexpr float half_degree = 0.01745329f / 2;
|
||||||
|
|
||||||
@ -239,11 +239,11 @@ void main()
|
|||||||
{
|
{
|
||||||
vga();
|
vga();
|
||||||
|
|
||||||
auto src = reinterpret_cast<const uint8_t *>(&_binary_europc_mono_data_start);
|
auto src = reinterpret_cast<const uint8_t *>(&_binary_verite_8x16_data_start);
|
||||||
font_bitmap::inflate(2, // pitch
|
font_bitmap::inflate(1, // pitch
|
||||||
9, // width
|
8, // width
|
||||||
14, // height
|
16, // height
|
||||||
16, // texture_width
|
8, // texture_width
|
||||||
16, // texture_height
|
16, // texture_height
|
||||||
src);
|
src);
|
||||||
font_bitmap::palette_data();
|
font_bitmap::palette_data();
|
||||||
@ -308,8 +308,8 @@ void main()
|
|||||||
transform2(parameter, lights[2], {0.f, 0.f, 1.f, 1.f});
|
transform2(parameter, lights[2], {0.f, 0.f, 1.f, 1.f});
|
||||||
|
|
||||||
font_bitmap::transform_string(parameter,
|
font_bitmap::transform_string(parameter,
|
||||||
16, 16, // texture
|
8, 16, // texture
|
||||||
9, 14, // glyph
|
8, 16, // glyph
|
||||||
40, 40, // position
|
40, 40, // position
|
||||||
"test", 4);
|
"test", 4);
|
||||||
|
|
||||||
|
@ -156,8 +156,8 @@ void transform_string(ta_parameter_writer& parameter,
|
|||||||
y += static_cast<float>(position_y);
|
y += static_cast<float>(position_y);
|
||||||
z = 1.f / (z + 10.f);
|
z = 1.f / (z + 10.f);
|
||||||
|
|
||||||
u *= static_cast<float>(glyph_width - 1) / static_cast<float>(texture_width);
|
u *= static_cast<float>(glyph_width) / static_cast<float>(texture_width);
|
||||||
v *= static_cast<float>(glyph_height - 1) / static_cast<float>(texture_height);
|
v *= static_cast<float>(glyph_height) / static_cast<float>(texture_height);
|
||||||
|
|
||||||
parameter.append<ta_vertex_parameter::polygon_type_3>() =
|
parameter.append<ta_vertex_parameter::polygon_type_3>() =
|
||||||
ta_vertex_parameter::polygon_type_3(polygon_vertex_parameter_control_word(end_of_strip),
|
ta_vertex_parameter::polygon_type_3(polygon_vertex_parameter_control_word(end_of_strip),
|
||||||
|
@ -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
7
sperrypc_8x8.hpp
Normal 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
BIN
verite_8x16.data
Normal file
Binary file not shown.
7
verite_8x16.hpp
Normal file
7
verite_8x16.hpp
Normal 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");
|
Loading…
x
Reference in New Issue
Block a user