From 5c9a533e5fbb16e7f205d2bbb997e5f706324ba8 Mon Sep 17 00:00:00 2001 From: 0xMAC8205 Date: Sat, 28 Oct 2023 23:49:48 +0200 Subject: [PATCH] Added hardware.s --- a.out | Bin 16384 -> 16384 bytes assets/{UTF.8.bin => UTF-8.bin} | Bin assets/{UTF.8.bmf => UTF-8.bmf} | Bin lib/src/hardware.s | 51 ++++++++++++++++++++++++++++++++ lib/src/video.s | 4 +++ lib/variables.s | 43 ++++++++++++++------------- main.s | 43 +++++++++++++++------------ 7 files changed, 101 insertions(+), 40 deletions(-) rename assets/{UTF.8.bin => UTF-8.bin} (100%) rename assets/{UTF.8.bmf => UTF-8.bmf} (100%) create mode 100644 lib/src/hardware.s diff --git a/a.out b/a.out index e8d9b3b13ef7b649d93f1d4cafdc3b440dbabcd0..84cf076f9dbf3b5aa64bcfff7b185c19c963dc2c 100644 GIT binary patch literal 16384 zcmeIy!HN?>5C-6)wpr#7*LGcXTt{h!LG~CtNC<6cn<2yyWR=B3*uxTJ@!-Le2Ml`7~BdELJy!Bk%d-BOm% z-!0q|N{bll7^%v0pXU|kLkM|B>mtwdVvYJ?9njZy408N+#PQgl7HJ}W=>Gr=27ShI z_Gwl|!Y+uK;^lIQwG>xx=TnSQFBU1`Vk#`?^LcUH=W?Ep!OQh;_f4b@!pm3`@WZ%V zUSdCNf~^Q$W@vzFHmMUo+!p6NQIIQU^3s>_WKT-5*+oq_y8G^V5?@dV=c~9n#~eC9 zJ?8N=PRD&-2Ty}Txv%0oo=(T?`}L@AX^80&G3_&Ro`q1(PCu0WtjrUAeucn@{jpy5 zm+O&ybq;{-ek{3o5KRD3Z6Bk<0dg$w`@je{qL@7+an%-w$TkUQ7> z;qFWGfV)j|#LYc!54pX|?R{=jZXa=*al7I67Pkl7(%1GeyE|8lH=B=p_#3 Data + ; X => X Coordinate + ; Y => Y Coordinate + + ; Output: (none) + + +;vram_write_color + ; VRAM Write Color + ; Writes A to the given Coordinate, but adds 0x40 to X + + ; Input: + ; A => Data + ; X => X Coordinate + ; Y => Y Coordinate + + ; Output: (none) + + +vram_read + ; VRAM Read + ; Reads Data from the given Coordinate + + ; Input: + ; X => X Coordinate + ; Y => Y Coordinate + + ; Output: + ; A => Data + + +vram_dump + ; VRAM Dump + ; Dumps all bytes from VRAM in the given Range + ; to a specified Memory Adress + + ; Input: + ; X => Start X Coordinate + ; Y => Start Y Coordnate + ; K1 => End X Coordinate + ; K2 => End Y Coordinate + ; K3 => LOW Memory Pointer + ; K4 => HIGH Memory Pointer + + ; Output: (none) \ No newline at end of file diff --git a/lib/src/video.s b/lib/src/video.s index e5fefde..e384c92 100644 --- a/lib/src/video.s +++ b/lib/src/video.s @@ -1,3 +1,4 @@ + video_write ; Video Write (string) ; String will be written from a Pointer, @@ -201,3 +202,6 @@ video_reset rts + +video_load_font + diff --git a/lib/variables.s b/lib/variables.s index 703f941..3f541d5 100644 --- a/lib/variables.s +++ b/lib/variables.s @@ -2,16 +2,16 @@ ; Name Address Size Status Comment -z0 = $0 ; 8 bit +z0 = $0 ; 8 bit All Purpose 16 bit Zero Page Variable z1 = $1 ; 8 bit -irq_a = $200 ; 8 bit (internal) +irq_a = $200 ; 8 bit (internal) IRQ Variable Save irq_x = $201 ; 8 bit (internal) irq_y = $202 ; 8 bit (internal) -irq_vector = $203 ; 16 bit +irq_vector = $203 ; 16 bit IRQ 16 bit Jump Vector -k0 = $205 ; 8 bit -k1 = $206 ; 8 bit +k0 = $205 ; 8 bit General Purpose Registers +k1 = $206 ; 8 bit ... k2 = $207 ; 8 bit k3 = $208 ; 8 bit k4 = $209 ; 8 bit @@ -19,27 +19,28 @@ k5 = $20a ; 8 bit k6 = $20b ; 8 bit k7 = $20c ; 8 bit -keyboard_current = $20d ; 8 bit -keyboard_previous = $20e ; 8 bit -keyboard_format = $20f ; 8 bit -keyboard_arrow = $210 ; 8 bit -keyboard_modifier = $211 ; 8 bit +keyboard_current = $20d ; 8 bit Held Keyboard Key, without Formatting (shift, etc.) "Scan Key" +keyboard_previous = $20e ; 8 bit Previous held "Scan Key" +keyboard_format = $20f ; 8 bit Formatted Char, from keyboard_current +keyboard_arrow = $210 ; 8 bit Held Arrow Keys +keyboard_modifier = $211 ; 8 bit Held Modifier Keys, such as "shift, alt, control" -cursor_x = $212 ; 8 bit -cursor_y = $213 ; 8 bit -cursor_x_previous = $214 ; 8 bit (internal) -cursor_y_previous = $215 ; 8 bit (internal) -cursor_value = $216 ; 8 bit -cursor_speed = $217 ; 8 bit -cursor_speed_count = $218 ; 8 bit (internal) -cursor_delay_interval = $219 ; 8 bit +cursor_x = $212 ; 8 bit Current Cursor X Position +cursor_y = $213 ; 8 bit Current Cursor Y Position +cursor_x_previous = $214 ; 8 bit (internal) Previous Cursor X Position +cursor_y_previous = $215 ; 8 bit (internal) Previous Cursor Y Position +cursor_value = $216 ; 8 bit +cursor_speed = $217 ; 8 bit Cursor Blink Speed (in IRQ Ticks) +cursor_speed_count = $218 ; 8 bit (internal) Cursor Blink Speed Counter +cursor_delay_interval = $219 ; 8 bit cursor_delay = $21a ; 8 bit cursor_delay_count = $21b ; 8 bit (internal) cursor_delay_switch = $21c ; 8 bit (internal) soft_system_register = $21d ; 8 bit (internal) -color = $2fe ; 8 bit +color = $2fe ; 8 bit Fore & Background Color + +typelength = $2ff ; 8 bit Length of typebuffer +typebuffer = $300 ; 256 bit 256 bit, All Purpose Char Buffer -typelength = $2ff ; 8 bit -typebuffer = $300 ; 256 bit \ No newline at end of file diff --git a/main.s b/main.s index 9c92b11..4d275d9 100644 --- a/main.s +++ b/main.s @@ -1,10 +1,14 @@ - .include "lib/variables.s" + .include "lib/variables.s" - .org $c000 ; $c000 for 16k ROM - - ; libraries + + .org $c000 ; $c000 for 16k ROM .include "lib/kernel.s" + + .org $f700 +charset .incbin "assets/UTF-8.bin" + + .org $ff00 reset sei cld @@ -55,22 +59,23 @@ irq_jump jmp (irq_vector) .addr irq_jump ; hardware registers -vidx = $be00 -vidy = $be01 -vidm = $be02 -vidd = $be03 -porta = $bf80 -portb = $bf81 -ddrb = $bf82 -ddra = $bf83 -t1cl = $bf84 -t1ch = $bf85 -acr = $bf8b -ifr = $bf8d -ier = $bf8e +vidx = $be00 +vidy = $be01 +vidm = $be02 +vidd = $be03 -keyboard_port = $bd00 -system_register = $bc00 +porta = $bf80 +portb = $bf81 +ddrb = $bf82 +ddra = $bf83 +t1cl = $bf84 +t1ch = $bf85 +acr = $bf8b +ifr = $bf8d +ier = $bf8e + +keyboard_port = $bd00 +system_register = $bc00 .end \ No newline at end of file