From 9c087e64906d8ede6fe4f8c3d0f03a7dd572b476 Mon Sep 17 00:00:00 2001 From: Kyle J Cardoza Date: Fri, 12 Jul 2024 17:06:50 -0400 Subject: [PATCH] Separated font and kernel image builds. --- .vscode/settings.json | 3 ++- config/config.mk | 4 ++-- config/kernel.mk | 5 ++++- include/kernel/hardware/led.h | 8 ++++++++ include/kernel/hardware/vera.h | 16 ++-------------- src/kernel/hardware/vera/vera_font.s | 2 +- src/kernel/hardware/vera/vera_font_0.fnt | Bin 0 -> 4096 bytes 7 files changed, 19 insertions(+), 19 deletions(-) create mode 100644 src/kernel/hardware/vera/vera_font_0.fnt diff --git a/.vscode/settings.json b/.vscode/settings.json index 679f05a..2b616a7 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1,4 @@ { - "C_Cpp.errorSquiggles": "disabled" + "C_Cpp.errorSquiggles": "disabled", + "C_Cpp.dimInactiveRegions": false } \ No newline at end of file diff --git a/config/config.mk b/config/config.mk index fa4be15..645b7aa 100755 --- a/config/config.mk +++ b/config/config.mk @@ -63,10 +63,10 @@ endif @echo "Assembling $@..." @$(AS) $(ASFLAGS) -o $@ $< -.SUFFIXES: .png .bin .ase +.SUFFIXES: .png .fnt .ase %.png: %.ase aseprite -b $< -save-as $@ -%.bin: %.png +%.fnt: %.png bin/makechrom -f $< mv $<.bin $@ diff --git a/config/kernel.mk b/config/kernel.mk index bca26a9..9703082 100755 --- a/config/kernel.mk +++ b/config/kernel.mk @@ -15,10 +15,13 @@ FONT_SOURCES := $(wildcard src/kernel/hardware/vera/vera_font_*.ase) KERNEL_OBJ := $(KERNEL_ASM_SRC:.s=.o) KERNEL_OBJ += $(KERNEL_C_SRC:.c=.o) -FONTS := $(FONT_SOURCES:.ase=.bin) +FONTS := $(FONT_SOURCES:.ase=.fnt) KERNEL_LDFLAGS := --list-file build/kernel.lst +.PHONY: fonts +fonts: $(FONTS) + build/kernel.bin: $(KERNEL_OBJ) echo "Linking $@..." echo "$(FONTS)" diff --git a/include/kernel/hardware/led.h b/include/kernel/hardware/led.h index 944aeb6..7be12d1 100644 --- a/include/kernel/hardware/led.h +++ b/include/kernel/hardware/led.h @@ -7,6 +7,12 @@ #pragma once +typedef enum { + LED_RED, + LED_GREEN, + LED_BLUE +} LED; + void led_init(void); void led_red_off(void); @@ -20,3 +26,5 @@ void led_green_on(void); void led_blue_off(void); void led_blue_on(void); + + diff --git a/include/kernel/hardware/vera.h b/include/kernel/hardware/vera.h index 2411ffd..a9d3f57 100755 --- a/include/kernel/hardware/vera.h +++ b/include/kernel/hardware/vera.h @@ -131,21 +131,9 @@ // The assembler can't handle this stuff. #ifdef __CALYPSI_CC__ -void vera_set_address_0(uint32_t addr); +uint8_t vera_reg_get(uint8_t reg); -void vera_set_address_1(uint32_t addr); - -uint8_t vera_read_data_reg_0(void); - -uint8_t vera_read_data_reg_1(void); - -uint16_t vera_read_data_reg(void); - -void vera_write_data_reg_0(uint8_t new_value); - -void vera_write_data_reg_1(uint8_t new_value); - -void vera_write_data_reg(uint16_t new_value); +void vera_reg_set(uint8_t reg, uint8_t value); void vera_reset(void); diff --git a/src/kernel/hardware/vera/vera_font.s b/src/kernel/hardware/vera/vera_font.s index c405b2f..ea9de95 100644 --- a/src/kernel/hardware/vera/vera_font.s +++ b/src/kernel/hardware/vera/vera_font.s @@ -7,4 +7,4 @@ .section cfar,rodata vera_font_0: - .incbin "vera_font_0.bin" \ No newline at end of file + .incbin "vera_font_0.fnt" \ No newline at end of file diff --git a/src/kernel/hardware/vera/vera_font_0.fnt b/src/kernel/hardware/vera/vera_font_0.fnt new file mode 100644 index 0000000000000000000000000000000000000000..77819db989a3a5720498ebc523ee5444b4f3facd GIT binary patch literal 4096 zcmai1&ube;6rOCBunEH67=@@twzlfVETIG?2P1+cua|Au6~!&a0%LM0N$9PR-b_$s z5agct9@-po$*I>s2_fXqFd~0KD1qo8tbT9aywR>`=}R)&Z{C~tbLP!NDW&`<9jB3x zFQq(CezWdrU0c2HVv_23)TZG)(-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