summaryrefslogtreecommitdiff
path: root/lib/nes/app
diff options
context:
space:
mode:
authorHannes Schulze <haschu0103@outlook.de>2025-02-01 14:21:04 +0100
committerHannes Schulze <haschu0103@outlook.de>2025-02-01 14:29:12 +0100
commitbf88e17d552d85cd18bc31757ef9d73049b327c4 (patch)
treebf46e60bef0fc2247c44cf2291fbfa38765a7b98 /lib/nes/app
parentcbde52a60605a4fe853d3a3562b2a059e2143e6e (diff)
implement text rendering
Diffstat (limited to 'lib/nes/app')
-rw-r--r--lib/nes/app/graphics/CMakeLists.txt4
-rw-r--r--lib/nes/app/graphics/image-view.hh2
-rw-r--r--lib/nes/app/graphics/mask-tile.hh15
-rw-r--r--lib/nes/app/graphics/renderer.cc80
-rw-r--r--lib/nes/app/graphics/renderer.hh1
-rw-r--r--lib/nes/app/graphics/tiles/CMakeLists.txt79
-rw-r--r--lib/nes/app/graphics/tiles/banner.pngbin0 -> 1196 bytes
-rw-r--r--lib/nes/app/graphics/tiles/digit_0.pngbin0 -> 158 bytes
-rw-r--r--lib/nes/app/graphics/tiles/digit_1.pngbin0 -> 151 bytes
-rw-r--r--lib/nes/app/graphics/tiles/digit_2.pngbin0 -> 157 bytes
-rw-r--r--lib/nes/app/graphics/tiles/digit_3.pngbin0 -> 152 bytes
-rw-r--r--lib/nes/app/graphics/tiles/digit_4.pngbin0 -> 156 bytes
-rw-r--r--lib/nes/app/graphics/tiles/digit_5.pngbin0 -> 157 bytes
-rw-r--r--lib/nes/app/graphics/tiles/digit_6.pngbin0 -> 153 bytes
-rw-r--r--lib/nes/app/graphics/tiles/digit_7.pngbin0 -> 149 bytes
-rw-r--r--lib/nes/app/graphics/tiles/digit_8.pngbin0 -> 159 bytes
-rw-r--r--lib/nes/app/graphics/tiles/digit_9.pngbin0 -> 156 bytes
-rw-r--r--lib/nes/app/graphics/tiles/icon_cartridge.pngbin0 -> 158 bytes
-rw-r--r--lib/nes/app/graphics/tiles/icon_directory.pngbin0 -> 149 bytes
-rw-r--r--lib/nes/app/graphics/tiles/letter_a.pngbin0 -> 158 bytes
-rw-r--r--lib/nes/app/graphics/tiles/letter_b.pngbin0 -> 147 bytes
-rw-r--r--lib/nes/app/graphics/tiles/letter_c.pngbin0 -> 155 bytes
-rw-r--r--lib/nes/app/graphics/tiles/letter_d.pngbin0 -> 157 bytes
-rw-r--r--lib/nes/app/graphics/tiles/letter_e.pngbin0 -> 153 bytes
-rw-r--r--lib/nes/app/graphics/tiles/letter_f.pngbin0 -> 152 bytes
-rw-r--r--lib/nes/app/graphics/tiles/letter_g.pngbin0 -> 158 bytes
-rw-r--r--lib/nes/app/graphics/tiles/letter_h.pngbin0 -> 153 bytes
-rw-r--r--lib/nes/app/graphics/tiles/letter_i.pngbin0 -> 150 bytes
-rw-r--r--lib/nes/app/graphics/tiles/letter_j.pngbin0 -> 148 bytes
-rw-r--r--lib/nes/app/graphics/tiles/letter_k.pngbin0 -> 160 bytes
-rw-r--r--lib/nes/app/graphics/tiles/letter_l.pngbin0 -> 145 bytes
-rw-r--r--lib/nes/app/graphics/tiles/letter_m.pngbin0 -> 156 bytes
-rw-r--r--lib/nes/app/graphics/tiles/letter_n.pngbin0 -> 157 bytes
-rw-r--r--lib/nes/app/graphics/tiles/letter_o.pngbin0 -> 151 bytes
-rw-r--r--lib/nes/app/graphics/tiles/letter_p.pngbin0 -> 153 bytes
-rw-r--r--lib/nes/app/graphics/tiles/letter_q.pngbin0 -> 157 bytes
-rw-r--r--lib/nes/app/graphics/tiles/letter_r.pngbin0 -> 158 bytes
-rw-r--r--lib/nes/app/graphics/tiles/letter_s.pngbin0 -> 158 bytes
-rw-r--r--lib/nes/app/graphics/tiles/letter_t.pngbin0 -> 144 bytes
-rw-r--r--lib/nes/app/graphics/tiles/letter_u.pngbin0 -> 146 bytes
-rw-r--r--lib/nes/app/graphics/tiles/letter_v.pngbin0 -> 155 bytes
-rw-r--r--lib/nes/app/graphics/tiles/letter_w.pngbin0 -> 154 bytes
-rw-r--r--lib/nes/app/graphics/tiles/letter_x.pngbin0 -> 157 bytes
-rw-r--r--lib/nes/app/graphics/tiles/letter_y.pngbin0 -> 151 bytes
-rw-r--r--lib/nes/app/graphics/tiles/letter_z.pngbin0 -> 152 bytes
-rw-r--r--lib/nes/app/graphics/tiles/symbol_ampersand.pngbin0 -> 158 bytes
-rw-r--r--lib/nes/app/graphics/tiles/symbol_apostrophe.pngbin0 -> 140 bytes
-rw-r--r--lib/nes/app/graphics/tiles/symbol_bracket_close.pngbin0 -> 150 bytes
-rw-r--r--lib/nes/app/graphics/tiles/symbol_bracket_open.pngbin0 -> 153 bytes
-rw-r--r--lib/nes/app/graphics/tiles/symbol_colon.pngbin0 -> 143 bytes
-rw-r--r--lib/nes/app/graphics/tiles/symbol_comma.pngbin0 -> 142 bytes
-rw-r--r--lib/nes/app/graphics/tiles/symbol_dollar.pngbin0 -> 153 bytes
-rw-r--r--lib/nes/app/graphics/tiles/symbol_equal.pngbin0 -> 139 bytes
-rw-r--r--lib/nes/app/graphics/tiles/symbol_exclamation_mark.pngbin0 -> 149 bytes
-rw-r--r--lib/nes/app/graphics/tiles/symbol_greater.pngbin0 -> 138 bytes
-rw-r--r--lib/nes/app/graphics/tiles/symbol_hashtag.pngbin0 -> 153 bytes
-rw-r--r--lib/nes/app/graphics/tiles/symbol_less.pngbin0 -> 140 bytes
-rw-r--r--lib/nes/app/graphics/tiles/symbol_minus.pngbin0 -> 137 bytes
-rw-r--r--lib/nes/app/graphics/tiles/symbol_paren_close.pngbin0 -> 145 bytes
-rw-r--r--lib/nes/app/graphics/tiles/symbol_paren_open.pngbin0 -> 147 bytes
-rw-r--r--lib/nes/app/graphics/tiles/symbol_percent.pngbin0 -> 155 bytes
-rw-r--r--lib/nes/app/graphics/tiles/symbol_period.pngbin0 -> 137 bytes
-rw-r--r--lib/nes/app/graphics/tiles/symbol_plus.pngbin0 -> 146 bytes
-rw-r--r--lib/nes/app/graphics/tiles/symbol_question_mark.pngbin0 -> 155 bytes
-rw-r--r--lib/nes/app/graphics/tiles/symbol_quotation_mark.pngbin0 -> 141 bytes
-rw-r--r--lib/nes/app/graphics/tiles/symbol_semicolon.pngbin0 -> 145 bytes
-rw-r--r--lib/nes/app/graphics/tiles/symbol_slash.pngbin0 -> 134 bytes
-rw-r--r--lib/nes/app/graphics/tiles/symbol_star.pngbin0 -> 152 bytes
-rw-r--r--lib/nes/app/graphics/tiles/symbol_unknown.pngbin0 -> 151 bytes
-rw-r--r--lib/nes/app/ui/screen-title.cc9
70 files changed, 169 insertions, 21 deletions
diff --git a/lib/nes/app/graphics/CMakeLists.txt b/lib/nes/app/graphics/CMakeLists.txt
index 81bd0ff..0f869b7 100644
--- a/lib/nes/app/graphics/CMakeLists.txt
+++ b/lib/nes/app/graphics/CMakeLists.txt
@@ -6,4 +6,6 @@ target_sources(
mask-tile.hh
image-tile.hh
renderer.hh
- renderer.cc) \ No newline at end of file
+ renderer.cc)
+
+add_subdirectory(tiles) \ No newline at end of file
diff --git a/lib/nes/app/graphics/image-view.hh b/lib/nes/app/graphics/image-view.hh
index cde4989..10754d1 100644
--- a/lib/nes/app/graphics/image-view.hh
+++ b/lib/nes/app/graphics/image-view.hh
@@ -28,6 +28,6 @@ namespace nes::app
auto get_data() const -> image_tile const* { return data_; }
auto get_width() const -> u32 { return width_; }
auto get_height() const -> u32 { return height_; }
- auto get(u32 const x, u32 const y) const -> image_tile const& { return data_[y * height_ + x]; }
+ auto get(u32 const x, u32 const y) const -> image_tile const& { return data_[y * width_ + x]; }
};
} // namespace nes::app \ No newline at end of file
diff --git a/lib/nes/app/graphics/mask-tile.hh b/lib/nes/app/graphics/mask-tile.hh
index deb750a..160a170 100644
--- a/lib/nes/app/graphics/mask-tile.hh
+++ b/lib/nes/app/graphics/mask-tile.hh
@@ -12,19 +12,4 @@ namespace nes::app
{
u8 data[8]{};
};
-
- namespace tiles
- {
- inline constexpr auto letter_a = mask_tile
- {
- 0b00111000,
- 0b01101100,
- 0b11000110,
- 0b11000110,
- 0b11111110,
- 0b11000110,
- 0b11000110,
- 0b00000000,
- };
- } // namespace tiles
} // namespace nes::app \ No newline at end of file
diff --git a/lib/nes/app/graphics/renderer.cc b/lib/nes/app/graphics/renderer.cc
index 1a4dc4d..6a45b6c 100644
--- a/lib/nes/app/graphics/renderer.cc
+++ b/lib/nes/app/graphics/renderer.cc
@@ -3,6 +3,7 @@
#include "nes/app/graphics/mask-tile.hh"
#include "nes/app/graphics/image-tile.hh"
#include "nes/app/graphics/image-view.hh"
+#include "nes/app/graphics/tiles/characters.hh"
#include "nes/common/display.hh"
namespace nes::app
@@ -55,11 +56,20 @@ namespace nes::app
{
for (auto x_img = u32{ 0 }; x_img < image.get_width(); ++x_img)
{
- render_image_tile(x + x_img, y + y_img, image.get(x, y));
+ render_image_tile(x + x_img, y + y_img, image.get(x_img, y_img));
}
}
}
+ auto renderer::render_text(u32 const x, u32 const y, std::string_view const str, color const c) -> void
+ {
+ for (auto i = u32{ 0 }; i < str.size(); ++i)
+ {
+ auto const character = str[i];
+ render_mask_tile(x + i, y, resolve_character(str[i]), c);
+ }
+ }
+
auto renderer::render_rect(
u32 const x, u32 const y, u32 const width, u32 const height, color const c) -> void
{
@@ -101,4 +111,72 @@ namespace nes::app
return rgb::from_hex(0x000000);
}
+
+ auto renderer::resolve_character(u32 const c) const -> mask_tile
+ {
+ switch (c)
+ {
+ case ' ': return mask_tile{};
+ case 'a': case 'A': return tiles::letter_a;
+ case 'b': case 'B': return tiles::letter_b;
+ case 'c': case 'C': return tiles::letter_c;
+ case 'd': case 'D': return tiles::letter_d;
+ case 'e': case 'E': return tiles::letter_e;
+ case 'f': case 'F': return tiles::letter_f;
+ case 'g': case 'G': return tiles::letter_g;
+ case 'h': case 'H': return tiles::letter_h;
+ case 'i': case 'I': return tiles::letter_i;
+ case 'j': case 'J': return tiles::letter_j;
+ case 'k': case 'K': return tiles::letter_k;
+ case 'l': case 'L': return tiles::letter_l;
+ case 'm': case 'M': return tiles::letter_m;
+ case 'n': case 'N': return tiles::letter_n;
+ case 'o': case 'O': return tiles::letter_o;
+ case 'p': case 'P': return tiles::letter_p;
+ case 'q': case 'Q': return tiles::letter_q;
+ case 'r': case 'R': return tiles::letter_r;
+ case 's': case 'S': return tiles::letter_s;
+ case 't': case 'T': return tiles::letter_t;
+ case 'u': case 'U': return tiles::letter_u;
+ case 'v': case 'V': return tiles::letter_v;
+ case 'w': case 'W': return tiles::letter_w;
+ case 'x': case 'X': return tiles::letter_x;
+ case 'y': case 'Y': return tiles::letter_y;
+ case 'z': case 'Z': return tiles::letter_z;
+ case '0': return tiles::digit_0;
+ case '1': return tiles::digit_1;
+ case '2': return tiles::digit_2;
+ case '3': return tiles::digit_3;
+ case '4': return tiles::digit_4;
+ case '5': return tiles::digit_5;
+ case '6': return tiles::digit_6;
+ case '7': return tiles::digit_7;
+ case '8': return tiles::digit_8;
+ case '9': return tiles::digit_9;
+ case '&': return tiles::symbol_ampersand;
+ case '\'': return tiles::symbol_apostrophe;
+ case '[': return tiles::symbol_bracket_open;
+ case ']': return tiles::symbol_bracket_close;
+ case ':': return tiles::symbol_colon;
+ case ',': return tiles::symbol_comma;
+ case '$': return tiles::symbol_dollar;
+ case '=': return tiles::symbol_equal;
+ case '!': return tiles::symbol_exclamation_mark;
+ case '>': return tiles::symbol_greater;
+ case '#': return tiles::symbol_hashtag;
+ case '<': return tiles::symbol_less;
+ case '-': return tiles::symbol_minus;
+ case '(': return tiles::symbol_paren_open;
+ case ')': return tiles::symbol_paren_close;
+ case '%': return tiles::symbol_percent;
+ case '.': return tiles::symbol_period;
+ case '+': return tiles::symbol_plus;
+ case '?': return tiles::symbol_question_mark;
+ case '"': return tiles::symbol_quotation_mark;
+ case ';': return tiles::symbol_semicolon;
+ case '/': return tiles::symbol_slash;
+ case '*': return tiles::symbol_star;
+ default: return tiles::symbol_unknown;
+ }
+ }
} // namespace nes::app \ No newline at end of file
diff --git a/lib/nes/app/graphics/renderer.hh b/lib/nes/app/graphics/renderer.hh
index 5de3dcd..08e4225 100644
--- a/lib/nes/app/graphics/renderer.hh
+++ b/lib/nes/app/graphics/renderer.hh
@@ -58,5 +58,6 @@ namespace nes::app
private:
auto resolve_color(color) const -> rgb;
+ auto resolve_character(u32) const -> mask_tile;
};
} // namespace nes::app \ No newline at end of file
diff --git a/lib/nes/app/graphics/tiles/CMakeLists.txt b/lib/nes/app/graphics/tiles/CMakeLists.txt
new file mode 100644
index 0000000..144b9da
--- /dev/null
+++ b/lib/nes/app/graphics/tiles/CMakeLists.txt
@@ -0,0 +1,79 @@
+nes_generate_tiles(
+ nes
+ characters
+ TYPE mask
+ FILES
+ letter_a.png
+ letter_b.png
+ letter_c.png
+ letter_d.png
+ letter_e.png
+ letter_f.png
+ letter_g.png
+ letter_h.png
+ letter_i.png
+ letter_j.png
+ letter_k.png
+ letter_l.png
+ letter_m.png
+ letter_n.png
+ letter_o.png
+ letter_p.png
+ letter_q.png
+ letter_r.png
+ letter_s.png
+ letter_t.png
+ letter_u.png
+ letter_v.png
+ letter_w.png
+ letter_x.png
+ letter_y.png
+ letter_z.png
+ digit_0.png
+ digit_1.png
+ digit_2.png
+ digit_3.png
+ digit_4.png
+ digit_5.png
+ digit_6.png
+ digit_7.png
+ digit_8.png
+ digit_9.png
+ symbol_ampersand.png
+ symbol_apostrophe.png
+ symbol_bracket_open.png
+ symbol_bracket_close.png
+ symbol_colon.png
+ symbol_comma.png
+ symbol_dollar.png
+ symbol_equal.png
+ symbol_exclamation_mark.png
+ symbol_greater.png
+ symbol_hashtag.png
+ symbol_less.png
+ symbol_minus.png
+ symbol_paren_open.png
+ symbol_paren_close.png
+ symbol_percent.png
+ symbol_period.png
+ symbol_plus.png
+ symbol_question_mark.png
+ symbol_quotation_mark.png
+ symbol_semicolon.png
+ symbol_slash.png
+ symbol_star.png
+ symbol_unknown.png)
+
+nes_generate_tiles(
+ nes
+ icons
+ TYPE mask
+ FILES
+ icon_directory.png
+ icon_cartridge.png)
+
+nes_generate_tiles(
+ nes
+ banner
+ TYPE image
+ FILES banner.png) \ No newline at end of file
diff --git a/lib/nes/app/graphics/tiles/banner.png b/lib/nes/app/graphics/tiles/banner.png
new file mode 100644
index 0000000..6a77097
--- /dev/null
+++ b/lib/nes/app/graphics/tiles/banner.png
Binary files differ
diff --git a/lib/nes/app/graphics/tiles/digit_0.png b/lib/nes/app/graphics/tiles/digit_0.png
new file mode 100644
index 0000000..54e7750
--- /dev/null
+++ b/lib/nes/app/graphics/tiles/digit_0.png
Binary files differ
diff --git a/lib/nes/app/graphics/tiles/digit_1.png b/lib/nes/app/graphics/tiles/digit_1.png
new file mode 100644
index 0000000..0e7f1a1
--- /dev/null
+++ b/lib/nes/app/graphics/tiles/digit_1.png
Binary files differ
diff --git a/lib/nes/app/graphics/tiles/digit_2.png b/lib/nes/app/graphics/tiles/digit_2.png
new file mode 100644
index 0000000..fb333e2
--- /dev/null
+++ b/lib/nes/app/graphics/tiles/digit_2.png
Binary files differ
diff --git a/lib/nes/app/graphics/tiles/digit_3.png b/lib/nes/app/graphics/tiles/digit_3.png
new file mode 100644
index 0000000..44b4101
--- /dev/null
+++ b/lib/nes/app/graphics/tiles/digit_3.png
Binary files differ
diff --git a/lib/nes/app/graphics/tiles/digit_4.png b/lib/nes/app/graphics/tiles/digit_4.png
new file mode 100644
index 0000000..129a7f4
--- /dev/null
+++ b/lib/nes/app/graphics/tiles/digit_4.png
Binary files differ
diff --git a/lib/nes/app/graphics/tiles/digit_5.png b/lib/nes/app/graphics/tiles/digit_5.png
new file mode 100644
index 0000000..f98b63a
--- /dev/null
+++ b/lib/nes/app/graphics/tiles/digit_5.png
Binary files differ
diff --git a/lib/nes/app/graphics/tiles/digit_6.png b/lib/nes/app/graphics/tiles/digit_6.png
new file mode 100644
index 0000000..385a065
--- /dev/null
+++ b/lib/nes/app/graphics/tiles/digit_6.png
Binary files differ
diff --git a/lib/nes/app/graphics/tiles/digit_7.png b/lib/nes/app/graphics/tiles/digit_7.png
new file mode 100644
index 0000000..2afcfc1
--- /dev/null
+++ b/lib/nes/app/graphics/tiles/digit_7.png
Binary files differ
diff --git a/lib/nes/app/graphics/tiles/digit_8.png b/lib/nes/app/graphics/tiles/digit_8.png
new file mode 100644
index 0000000..32d27de
--- /dev/null
+++ b/lib/nes/app/graphics/tiles/digit_8.png
Binary files differ
diff --git a/lib/nes/app/graphics/tiles/digit_9.png b/lib/nes/app/graphics/tiles/digit_9.png
new file mode 100644
index 0000000..48b93f3
--- /dev/null
+++ b/lib/nes/app/graphics/tiles/digit_9.png
Binary files differ
diff --git a/lib/nes/app/graphics/tiles/icon_cartridge.png b/lib/nes/app/graphics/tiles/icon_cartridge.png
new file mode 100644
index 0000000..1115c6e
--- /dev/null
+++ b/lib/nes/app/graphics/tiles/icon_cartridge.png
Binary files differ
diff --git a/lib/nes/app/graphics/tiles/icon_directory.png b/lib/nes/app/graphics/tiles/icon_directory.png
new file mode 100644
index 0000000..e40dd4c
--- /dev/null
+++ b/lib/nes/app/graphics/tiles/icon_directory.png
Binary files differ
diff --git a/lib/nes/app/graphics/tiles/letter_a.png b/lib/nes/app/graphics/tiles/letter_a.png
new file mode 100644
index 0000000..25ad686
--- /dev/null
+++ b/lib/nes/app/graphics/tiles/letter_a.png
Binary files differ
diff --git a/lib/nes/app/graphics/tiles/letter_b.png b/lib/nes/app/graphics/tiles/letter_b.png
new file mode 100644
index 0000000..f60f93a
--- /dev/null
+++ b/lib/nes/app/graphics/tiles/letter_b.png
Binary files differ
diff --git a/lib/nes/app/graphics/tiles/letter_c.png b/lib/nes/app/graphics/tiles/letter_c.png
new file mode 100644
index 0000000..00a5bd7
--- /dev/null
+++ b/lib/nes/app/graphics/tiles/letter_c.png
Binary files differ
diff --git a/lib/nes/app/graphics/tiles/letter_d.png b/lib/nes/app/graphics/tiles/letter_d.png
new file mode 100644
index 0000000..58f5aaf
--- /dev/null
+++ b/lib/nes/app/graphics/tiles/letter_d.png
Binary files differ
diff --git a/lib/nes/app/graphics/tiles/letter_e.png b/lib/nes/app/graphics/tiles/letter_e.png
new file mode 100644
index 0000000..0288421
--- /dev/null
+++ b/lib/nes/app/graphics/tiles/letter_e.png
Binary files differ
diff --git a/lib/nes/app/graphics/tiles/letter_f.png b/lib/nes/app/graphics/tiles/letter_f.png
new file mode 100644
index 0000000..4fdb312
--- /dev/null
+++ b/lib/nes/app/graphics/tiles/letter_f.png
Binary files differ
diff --git a/lib/nes/app/graphics/tiles/letter_g.png b/lib/nes/app/graphics/tiles/letter_g.png
new file mode 100644
index 0000000..3758cd4
--- /dev/null
+++ b/lib/nes/app/graphics/tiles/letter_g.png
Binary files differ
diff --git a/lib/nes/app/graphics/tiles/letter_h.png b/lib/nes/app/graphics/tiles/letter_h.png
new file mode 100644
index 0000000..07f2baf
--- /dev/null
+++ b/lib/nes/app/graphics/tiles/letter_h.png
Binary files differ
diff --git a/lib/nes/app/graphics/tiles/letter_i.png b/lib/nes/app/graphics/tiles/letter_i.png
new file mode 100644
index 0000000..1fd6549
--- /dev/null
+++ b/lib/nes/app/graphics/tiles/letter_i.png
Binary files differ
diff --git a/lib/nes/app/graphics/tiles/letter_j.png b/lib/nes/app/graphics/tiles/letter_j.png
new file mode 100644
index 0000000..17f6d57
--- /dev/null
+++ b/lib/nes/app/graphics/tiles/letter_j.png
Binary files differ
diff --git a/lib/nes/app/graphics/tiles/letter_k.png b/lib/nes/app/graphics/tiles/letter_k.png
new file mode 100644
index 0000000..7c66c6b
--- /dev/null
+++ b/lib/nes/app/graphics/tiles/letter_k.png
Binary files differ
diff --git a/lib/nes/app/graphics/tiles/letter_l.png b/lib/nes/app/graphics/tiles/letter_l.png
new file mode 100644
index 0000000..d35647d
--- /dev/null
+++ b/lib/nes/app/graphics/tiles/letter_l.png
Binary files differ
diff --git a/lib/nes/app/graphics/tiles/letter_m.png b/lib/nes/app/graphics/tiles/letter_m.png
new file mode 100644
index 0000000..8a82a18
--- /dev/null
+++ b/lib/nes/app/graphics/tiles/letter_m.png
Binary files differ
diff --git a/lib/nes/app/graphics/tiles/letter_n.png b/lib/nes/app/graphics/tiles/letter_n.png
new file mode 100644
index 0000000..c51f068
--- /dev/null
+++ b/lib/nes/app/graphics/tiles/letter_n.png
Binary files differ
diff --git a/lib/nes/app/graphics/tiles/letter_o.png b/lib/nes/app/graphics/tiles/letter_o.png
new file mode 100644
index 0000000..95d27e7
--- /dev/null
+++ b/lib/nes/app/graphics/tiles/letter_o.png
Binary files differ
diff --git a/lib/nes/app/graphics/tiles/letter_p.png b/lib/nes/app/graphics/tiles/letter_p.png
new file mode 100644
index 0000000..444966b
--- /dev/null
+++ b/lib/nes/app/graphics/tiles/letter_p.png
Binary files differ
diff --git a/lib/nes/app/graphics/tiles/letter_q.png b/lib/nes/app/graphics/tiles/letter_q.png
new file mode 100644
index 0000000..d84bac6
--- /dev/null
+++ b/lib/nes/app/graphics/tiles/letter_q.png
Binary files differ
diff --git a/lib/nes/app/graphics/tiles/letter_r.png b/lib/nes/app/graphics/tiles/letter_r.png
new file mode 100644
index 0000000..f425d0c
--- /dev/null
+++ b/lib/nes/app/graphics/tiles/letter_r.png
Binary files differ
diff --git a/lib/nes/app/graphics/tiles/letter_s.png b/lib/nes/app/graphics/tiles/letter_s.png
new file mode 100644
index 0000000..b9fa683
--- /dev/null
+++ b/lib/nes/app/graphics/tiles/letter_s.png
Binary files differ
diff --git a/lib/nes/app/graphics/tiles/letter_t.png b/lib/nes/app/graphics/tiles/letter_t.png
new file mode 100644
index 0000000..b42c8e1
--- /dev/null
+++ b/lib/nes/app/graphics/tiles/letter_t.png
Binary files differ
diff --git a/lib/nes/app/graphics/tiles/letter_u.png b/lib/nes/app/graphics/tiles/letter_u.png
new file mode 100644
index 0000000..6e96b78
--- /dev/null
+++ b/lib/nes/app/graphics/tiles/letter_u.png
Binary files differ
diff --git a/lib/nes/app/graphics/tiles/letter_v.png b/lib/nes/app/graphics/tiles/letter_v.png
new file mode 100644
index 0000000..265b7a7
--- /dev/null
+++ b/lib/nes/app/graphics/tiles/letter_v.png
Binary files differ
diff --git a/lib/nes/app/graphics/tiles/letter_w.png b/lib/nes/app/graphics/tiles/letter_w.png
new file mode 100644
index 0000000..743cea8
--- /dev/null
+++ b/lib/nes/app/graphics/tiles/letter_w.png
Binary files differ
diff --git a/lib/nes/app/graphics/tiles/letter_x.png b/lib/nes/app/graphics/tiles/letter_x.png
new file mode 100644
index 0000000..b5979de
--- /dev/null
+++ b/lib/nes/app/graphics/tiles/letter_x.png
Binary files differ
diff --git a/lib/nes/app/graphics/tiles/letter_y.png b/lib/nes/app/graphics/tiles/letter_y.png
new file mode 100644
index 0000000..b85df7b
--- /dev/null
+++ b/lib/nes/app/graphics/tiles/letter_y.png
Binary files differ
diff --git a/lib/nes/app/graphics/tiles/letter_z.png b/lib/nes/app/graphics/tiles/letter_z.png
new file mode 100644
index 0000000..52c57e8
--- /dev/null
+++ b/lib/nes/app/graphics/tiles/letter_z.png
Binary files differ
diff --git a/lib/nes/app/graphics/tiles/symbol_ampersand.png b/lib/nes/app/graphics/tiles/symbol_ampersand.png
new file mode 100644
index 0000000..cdee683
--- /dev/null
+++ b/lib/nes/app/graphics/tiles/symbol_ampersand.png
Binary files differ
diff --git a/lib/nes/app/graphics/tiles/symbol_apostrophe.png b/lib/nes/app/graphics/tiles/symbol_apostrophe.png
new file mode 100644
index 0000000..8c33457
--- /dev/null
+++ b/lib/nes/app/graphics/tiles/symbol_apostrophe.png
Binary files differ
diff --git a/lib/nes/app/graphics/tiles/symbol_bracket_close.png b/lib/nes/app/graphics/tiles/symbol_bracket_close.png
new file mode 100644
index 0000000..ea88b56
--- /dev/null
+++ b/lib/nes/app/graphics/tiles/symbol_bracket_close.png
Binary files differ
diff --git a/lib/nes/app/graphics/tiles/symbol_bracket_open.png b/lib/nes/app/graphics/tiles/symbol_bracket_open.png
new file mode 100644
index 0000000..9e394e1
--- /dev/null
+++ b/lib/nes/app/graphics/tiles/symbol_bracket_open.png
Binary files differ
diff --git a/lib/nes/app/graphics/tiles/symbol_colon.png b/lib/nes/app/graphics/tiles/symbol_colon.png
new file mode 100644
index 0000000..473867e
--- /dev/null
+++ b/lib/nes/app/graphics/tiles/symbol_colon.png
Binary files differ
diff --git a/lib/nes/app/graphics/tiles/symbol_comma.png b/lib/nes/app/graphics/tiles/symbol_comma.png
new file mode 100644
index 0000000..3f9c206
--- /dev/null
+++ b/lib/nes/app/graphics/tiles/symbol_comma.png
Binary files differ
diff --git a/lib/nes/app/graphics/tiles/symbol_dollar.png b/lib/nes/app/graphics/tiles/symbol_dollar.png
new file mode 100644
index 0000000..e112684
--- /dev/null
+++ b/lib/nes/app/graphics/tiles/symbol_dollar.png
Binary files differ
diff --git a/lib/nes/app/graphics/tiles/symbol_equal.png b/lib/nes/app/graphics/tiles/symbol_equal.png
new file mode 100644
index 0000000..047121c
--- /dev/null
+++ b/lib/nes/app/graphics/tiles/symbol_equal.png
Binary files differ
diff --git a/lib/nes/app/graphics/tiles/symbol_exclamation_mark.png b/lib/nes/app/graphics/tiles/symbol_exclamation_mark.png
new file mode 100644
index 0000000..11b053f
--- /dev/null
+++ b/lib/nes/app/graphics/tiles/symbol_exclamation_mark.png
Binary files differ
diff --git a/lib/nes/app/graphics/tiles/symbol_greater.png b/lib/nes/app/graphics/tiles/symbol_greater.png
new file mode 100644
index 0000000..c9b558c
--- /dev/null
+++ b/lib/nes/app/graphics/tiles/symbol_greater.png
Binary files differ
diff --git a/lib/nes/app/graphics/tiles/symbol_hashtag.png b/lib/nes/app/graphics/tiles/symbol_hashtag.png
new file mode 100644
index 0000000..4c3083c
--- /dev/null
+++ b/lib/nes/app/graphics/tiles/symbol_hashtag.png
Binary files differ
diff --git a/lib/nes/app/graphics/tiles/symbol_less.png b/lib/nes/app/graphics/tiles/symbol_less.png
new file mode 100644
index 0000000..e1d5c66
--- /dev/null
+++ b/lib/nes/app/graphics/tiles/symbol_less.png
Binary files differ
diff --git a/lib/nes/app/graphics/tiles/symbol_minus.png b/lib/nes/app/graphics/tiles/symbol_minus.png
new file mode 100644
index 0000000..e87b97f
--- /dev/null
+++ b/lib/nes/app/graphics/tiles/symbol_minus.png
Binary files differ
diff --git a/lib/nes/app/graphics/tiles/symbol_paren_close.png b/lib/nes/app/graphics/tiles/symbol_paren_close.png
new file mode 100644
index 0000000..c829f6f
--- /dev/null
+++ b/lib/nes/app/graphics/tiles/symbol_paren_close.png
Binary files differ
diff --git a/lib/nes/app/graphics/tiles/symbol_paren_open.png b/lib/nes/app/graphics/tiles/symbol_paren_open.png
new file mode 100644
index 0000000..8980a82
--- /dev/null
+++ b/lib/nes/app/graphics/tiles/symbol_paren_open.png
Binary files differ
diff --git a/lib/nes/app/graphics/tiles/symbol_percent.png b/lib/nes/app/graphics/tiles/symbol_percent.png
new file mode 100644
index 0000000..b7249e5
--- /dev/null
+++ b/lib/nes/app/graphics/tiles/symbol_percent.png
Binary files differ
diff --git a/lib/nes/app/graphics/tiles/symbol_period.png b/lib/nes/app/graphics/tiles/symbol_period.png
new file mode 100644
index 0000000..e2eaf0f
--- /dev/null
+++ b/lib/nes/app/graphics/tiles/symbol_period.png
Binary files differ
diff --git a/lib/nes/app/graphics/tiles/symbol_plus.png b/lib/nes/app/graphics/tiles/symbol_plus.png
new file mode 100644
index 0000000..f46a109
--- /dev/null
+++ b/lib/nes/app/graphics/tiles/symbol_plus.png
Binary files differ
diff --git a/lib/nes/app/graphics/tiles/symbol_question_mark.png b/lib/nes/app/graphics/tiles/symbol_question_mark.png
new file mode 100644
index 0000000..598d094
--- /dev/null
+++ b/lib/nes/app/graphics/tiles/symbol_question_mark.png
Binary files differ
diff --git a/lib/nes/app/graphics/tiles/symbol_quotation_mark.png b/lib/nes/app/graphics/tiles/symbol_quotation_mark.png
new file mode 100644
index 0000000..0a37a5d
--- /dev/null
+++ b/lib/nes/app/graphics/tiles/symbol_quotation_mark.png
Binary files differ
diff --git a/lib/nes/app/graphics/tiles/symbol_semicolon.png b/lib/nes/app/graphics/tiles/symbol_semicolon.png
new file mode 100644
index 0000000..b0f6ce7
--- /dev/null
+++ b/lib/nes/app/graphics/tiles/symbol_semicolon.png
Binary files differ
diff --git a/lib/nes/app/graphics/tiles/symbol_slash.png b/lib/nes/app/graphics/tiles/symbol_slash.png
new file mode 100644
index 0000000..549ad14
--- /dev/null
+++ b/lib/nes/app/graphics/tiles/symbol_slash.png
Binary files differ
diff --git a/lib/nes/app/graphics/tiles/symbol_star.png b/lib/nes/app/graphics/tiles/symbol_star.png
new file mode 100644
index 0000000..abc3dc5
--- /dev/null
+++ b/lib/nes/app/graphics/tiles/symbol_star.png
Binary files differ
diff --git a/lib/nes/app/graphics/tiles/symbol_unknown.png b/lib/nes/app/graphics/tiles/symbol_unknown.png
new file mode 100644
index 0000000..1ea56ee
--- /dev/null
+++ b/lib/nes/app/graphics/tiles/symbol_unknown.png
Binary files differ
diff --git a/lib/nes/app/ui/screen-title.cc b/lib/nes/app/ui/screen-title.cc
index 2a7bc5c..f1e4f98 100644
--- a/lib/nes/app/ui/screen-title.cc
+++ b/lib/nes/app/ui/screen-title.cc
@@ -1,7 +1,8 @@
#include "nes/app/ui/screen-title.hh"
#include "nes/app/graphics/renderer.hh"
#include "nes/app/graphics/color.hh"
-#include "nes/app/graphics/mask-tile.hh"
+#include "nes/app/graphics/tiles/banner.hh"
+#include "nes/app/graphics/tiles/icons.hh"
#include "nes/app/input/input-manager.hh"
namespace nes::app
@@ -14,8 +15,10 @@ namespace nes::app
auto screen_title::render(renderer& renderer) -> void
{
renderer.render_fill(color::background_primary);
- renderer.render_rect(2, 4, 28, 8, color::accent_primary);
- renderer.render_mask_tile(10, 16, tiles::letter_a, color::foreground_primary);
+ renderer.render_text(10, 16, "Hello, world!", color::foreground_primary);
+ renderer.render_mask_tile(14, 18, tiles::icon_directory, color::accent_primary);
+ renderer.render_mask_tile(16, 18, tiles::icon_cartridge, color::accent_primary);
+ renderer.render_image(2, 4, tiles::banner);
}
auto screen_title::process_events() -> action