From 38090fb34ff3484b910d9dcac31b38690c7c8c14 Mon Sep 17 00:00:00 2001 From: 0xMAC8205 Date: Fri, 3 Nov 2023 21:27:32 +0100 Subject: [PATCH] split video into "console", "graphics" and "video" --- .gitignore | 1 + KernelRoutineList.txt | 36 +++++++++++++++++++++++++++++++++++- a.out | Bin 16384 -> 16384 bytes main.s | 12 ++++++++++-- src/kernel.s | 2 ++ src/kernel/console.s | 41 ++++++++++++++++++++++++----------------- src/kernel/graphics.s | 0 src/kernel/video.s | 0 src/variables.s | 3 +++ 9 files changed, 75 insertions(+), 20 deletions(-) create mode 100644 .gitignore create mode 100644 src/kernel/graphics.s create mode 100644 src/kernel/video.s diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..600d2d3 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.vscode \ No newline at end of file diff --git a/KernelRoutineList.txt b/KernelRoutineList.txt index ec6a7f6..1d86822 100644 --- a/KernelRoutineList.txt +++ b/KernelRoutineList.txt @@ -1,5 +1,12 @@ Kernel Routines Grouped by File +Maybes: { + - Virtual Sprites + + May change Bit-Mapped to full Pixel mode + => 256x256 16 color mode +} + Byte.S | @@ -27,6 +34,11 @@ Hardware.s +- vram_read +- vram_dump + beep + set_activity + set_user + scan_keyboard + Int.s | +- int16_add_byte @@ -89,4 +101,26 @@ console.s +- console_reset_color +- console_reset +- console_load_font - \ No newline at end of file + +graphics.s + | + graphics_draw_rectangle + graphics_draw_line + graphics_draw_triangle + graphics_draw_polygon + graphics_draw_text + + graphics_fill_rectangle + graphics_fill_triangle + graphics_fill_polygon + + graphics_set_pixel + +video.s + | ! Don't support 16 row mode! => Changes in future + video_clear + video_copy_memory + video_set_mode + video_get_mode + video_set_accent + video_get_accent \ No newline at end of file diff --git a/a.out b/a.out index a8115870c1cabc1992c6d0bcee5548019fba7d16..7db7e88b870104fe25b4fe41fe67c5bc6f198662 100644 GIT binary patch delta 146 zcmZo@U~Fh$oS-J{c`)OJ0+i5c*}s;7X&oce8YU(UhlGg^+Kd4cb3Aq49#|>gE6lV` zh-r;56HxIxA*L#y$p@A)EMrtKKA7;UN}>Ni)U5;{sqkjvLt%E$gKOoO6rv{nmS*(a uEYA4BY%_<2JG<1o1B)0Id{^K(xblMn!+|-hOe+~ytys$nG;wmK{d55E*f?DP delta 160 zcmZo@U~Fh$oS-JA|MSSjBt%(PC3 zX^k)wQ0+S*rYfIF2bMA{V^lCYnDDDgq3=M{tpp&c@cKXk0xV)!z_3yQs9~)flS1Ug xKhlgIncharset - jsr video_load_font + jsr console_load_font lda #$f0 jsr irq_init diff --git a/src/kernel.s b/src/kernel.s index 6421f8f..79624a0 100644 --- a/src/kernel.s +++ b/src/kernel.s @@ -1,6 +1,8 @@ .include "src/kernel/irq.s" .include "src/kernel/keyboard.s" .include "src/kernel/video.s" + .include "src/kernel/console.s" + .include "src/kernel/graphics.s" .include "src/kernel/string.s" .include "src/kernel/int.s" .include "src/kernel/event_handler.s" diff --git a/src/kernel/console.s b/src/kernel/console.s index 07f3a14..8ae4b44 100644 --- a/src/kernel/console.s +++ b/src/kernel/console.s @@ -1,6 +1,6 @@ console_write: - ; console Write (string) + ; Console Write (string) ; String will be written from a Pointer, ; without a new line at the end @@ -10,6 +10,13 @@ console_write: ; Output: (none) + + ; ToDo: + ; Support for ASCII (0-32) Chars, Line feed etc. + ; Support for Color codes => Maybe #$ff Indicator + ; Return propper work addresses in X & Y + ; + stx z0 sty z1 @@ -64,7 +71,7 @@ console_write_return: rts console_write_static: - ; console Write Static (string) + ; Console Write Static (string) ; String will be written wich follows after ; the JSR call without a new line at the end @@ -82,7 +89,7 @@ console_write_static: rts console_writeline: - ; console Writeline (string) + ; Console Writeline (string) ; Same as "console_write", except at ; the end, a new line begins @@ -98,7 +105,7 @@ console_writeline: rts console_writeline_static: - ; console Writeline Static (string) + ; Console Writeline Static (string) ; Same as "console_write_static", except at ; the end, a new line begins @@ -109,7 +116,7 @@ console_writeline_static: rts console_set_color: - ; console Set Color + ; Console Set Color ; Sets the color, of the content ; that will be written, following @@ -122,7 +129,7 @@ console_set_color: rts console_set_foreground: - ; console Set Foreground + ; Console Set Foreground ; Sets the Foreground color ; Input: @@ -134,7 +141,7 @@ console_set_foreground: rts console_set_background: - ; console Set Background + ; Console Set Background ; Sets the Background color ; Input: @@ -146,7 +153,7 @@ console_set_background: rts console_read_line: - ; console Read Line + ; Console Read Line ; Loops, till the Return key is pressed ; Output is stored in $300 => "Typebuffer" @@ -157,7 +164,7 @@ console_read_line: rts console_read_char: - ; console Read Char + ; Console Read Char ; Loops, till a Key is pressed ; Input: (none) @@ -169,7 +176,7 @@ console_read_char: rts console_set_cursor: - ; console Set Cursor + ; Console Set Cursor ; Sets the Cursor Location ; Input: @@ -182,7 +189,7 @@ console_set_cursor: rts console_get_cursor: - ; console Get Cursor + ; Console Get Cursor ; Gets the Cursor Location ; Input: (none) @@ -195,7 +202,7 @@ console_get_cursor: rts console_return: - ; console Return + ; Console Return ; Sets the Cursor to it's line starting Position ; and if nessesary, scrolls it up and prints the Start Text @@ -206,7 +213,7 @@ console_return: rts console_scroll: - ; console Scroll + ; Console Scroll ; Scrolls the screen in the given direction ; Input: @@ -234,7 +241,7 @@ console_scroll: rts console_clear: - ; console Clear + ; Console Clear ; Clears the Screen blank, with the normal Color and #$20 Chars ; Input: (none) @@ -260,7 +267,7 @@ console_clear_loop: rts console_reset_color: - ; console Reset Color + ; Console Reset Color ; Resets the Color to it's initial state ; Input: (none) @@ -270,7 +277,7 @@ console_reset_color: rts console_reset: - ; console Reset + ; Console Reset ; Resets the console Display ; to it's initial state, i.e ; clears the screen, resets the Cursor etc... @@ -282,7 +289,7 @@ console_reset: rts console_load_font: - ; console Load Font + ; Console Load Font ; Loads a 2k BitMap font from a Pointer to VRAM ; Input: diff --git a/src/kernel/graphics.s b/src/kernel/graphics.s new file mode 100644 index 0000000..e69de29 diff --git a/src/kernel/video.s b/src/kernel/video.s new file mode 100644 index 0000000..e69de29 diff --git a/src/variables.s b/src/variables.s index 76952fd..8d0abef 100644 --- a/src/variables.s +++ b/src/variables.s @@ -1,3 +1,6 @@ +; + + ; Static System Variables ; Name Address Size Status Comment