diff options
author | Mitya Selivanov <automainint@guattari.tech> | 2024-11-19 04:39:24 +0100 |
---|---|---|
committer | Mitya Selivanov <automainint@guattari.tech> | 2024-11-19 04:39:24 +0100 |
commit | 2578a9f397f3637667fc9518d89f06570b161705 (patch) | |
tree | 3ca6a2b05652c58eafc1104a6cb71073c5562475 | |
parent | 0269c40d9b94f49576b1c7ece0f768eb551686e5 (diff) | |
download | reduced_system_layer-2578a9f397f3637667fc9518d89f06570b161705.zip |
Add prefix for bitfont var
-rw-r--r-- | graphics.c | 10 | ||||
-rwxr-xr-x | reduced_system_layer.c | 3 |
2 files changed, 6 insertions, 7 deletions
@@ -82,7 +82,7 @@ u32 u32_from_rgb(f32 red, f32 green, f32 blue) { return (r << 16) | (g << 8) | b; } -u64 bitfont[] = { +static u64 _bitfont[] = { 0xbc0000000000, 0xc00300000, 0x5fd5040093f24fc9, 0xa00a2c2a1a280105, 0xc000415e6f, 0x400000020be0000, 0x1c38a8400000007d, 0x40002043e1020215, 0x408102000000010, 0x9800000000020002, 0xf913e00000033, 0x53200000207c8800, 0x3654880000099, 0x54b800000f840e00, 0xe953c000001a, 0x953e000000674080, 0x1e54b800000f, 0x490000000000240, 0x88a08000000, 0x20a220050a142850, 0x6520800000, 0x912f801eab260be, 0x800034952bf0001f, 0xc850bf0000921427, 0xf00010a54afc0003, 0xd29427800002142b, 0x840007e1023f0000, 0x7d09100000217e, 0x3f000188a08fc000, 0xc30c0cfc00000810, 0x27803f101013f00f, 0xc244bf0000f214, 0x4bf0002f21427800, 0xc254a480006c24, 0x407c00102fc08100, 0xf208080f0000fa0, 0x531007d81c607c0, 0xc208288c031141, 0x83fc00046954b10, 0x180e03000000, 0x41040000000ff04, 0x8102040810000404, 0x2a54600000000101, 0x309123e0000e, 0xc912180000a22447, 0x8000062a54700007, 0xe52a4300000029f0, 0xa0000602043e0001, 0x1d48000002074, 0x1f000003610f8000, 0x13e04f800000010, 0x470000780813e00f, 0x184893e0000e224, 0x23e0001f12243000, 0x82a54100000008, 0x40780000009f0200, 0xe208080e0001f20, 0xa22007981860780, 0x82082888022282, 0x16c200004ca95320, 0x7f000004, 0x408200000086d04, 0x8204, }; @@ -90,8 +90,6 @@ u64 bitfont[] = { #define CHAR_NUM_BITS_Y 7 #define CHAR_NUM_BITS (CHAR_NUM_BITS_X * CHAR_NUM_BITS_Y) -#define BITFONT_LEN ((i64) (sizeof bitfont / sizeof *bitfont)) - i64 char_column_offset(c32 c, i64 column_index) { if (column_index < 0 || column_index >= CHAR_NUM_BITS_X) return -1; @@ -99,15 +97,15 @@ i64 char_column_offset(c32 c, i64 column_index) { } b8 char_bit(i64 column_offset, i64 row_index) { - if (column_offset < 0 || column_offset / 64 >= BITFONT_LEN || row_index < 0 || row_index >= CHAR_NUM_BITS_Y) + if (column_offset < 0 || row_index < 0 || row_index >= CHAR_NUM_BITS_Y) return 0; i64 bit_index = column_offset + row_index; i64 qword_index = bit_index / 64; - if (qword_index < 0 || qword_index >= BITFONT_LEN) + if (qword_index < 0 || qword_index >= (i64) (sizeof _bitfont / sizeof *_bitfont)) return 0; u64 mask = 1ull << (bit_index % 64); - return !!(bitfont[qword_index] & mask); + return !!(_bitfont[qword_index] & mask); } u64 char_column_convolved(c32 c, i64 column_index) { diff --git a/reduced_system_layer.c b/reduced_system_layer.c index bbb2a87..17956b3 100755 --- a/reduced_system_layer.c +++ b/reduced_system_layer.c @@ -48,6 +48,7 @@ #/ - Graphics #/ - Self-contained impl #/ - UI +#/ - Icons #/ - Vector math #/ - Blending #/ - Anti-aliasing @@ -1713,7 +1714,7 @@ __attribute__((export_name("js_max_num_audio_frames"))) i32 js_max_num_audio_fra } __attribute__((export_name("js_sound_buffer"))) void *js_sound_buffer(void) { - return NULL; + return _sound_ring; } __attribute__((export_name("js_sound_sync"))) i64 js_sound_sync(void) { |