split video into "console", "graphics" and "video"

This commit is contained in:
0xMAC8205 2023-11-03 21:27:32 +01:00
parent a6568b17d8
commit 38090fb34f
9 changed files with 75 additions and 20 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.vscode

View File

@ -1,5 +1,12 @@
Kernel Routines Grouped by File Kernel Routines Grouped by File
Maybes: {
- Virtual Sprites
May change Bit-Mapped to full Pixel mode
=> 256x256 16 color mode
}
Byte.S Byte.S
| |
@ -27,6 +34,11 @@ Hardware.s
+- vram_read +- vram_read
+- vram_dump +- vram_dump
beep
set_activity
set_user
scan_keyboard
Int.s Int.s
| |
+- int16_add_byte +- int16_add_byte
@ -89,4 +101,26 @@ console.s
+- console_reset_color +- console_reset_color
+- console_reset +- console_reset
+- console_load_font +- console_load_font
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

BIN
a.out

Binary file not shown.

12
main.s
View File

@ -1,3 +1,11 @@
; Important To-Do!
;
; Get launch & tasks json working
; fix Keyboard scanning
; work on KernelRoutinesList.txt
.include "src/variables.s" .include "src/variables.s"
@ -47,11 +55,11 @@ reset: sei
;jsr video_writeline_static ;jsr video_writeline_static
;.string "Hello World" ;.string "Hello World"
jsr video_clear jsr console_clear
ldx #<charset ldx #<charset
ldy #>charset ldy #>charset
jsr video_load_font jsr console_load_font
lda #$f0 lda #$f0
jsr irq_init jsr irq_init

View File

@ -1,6 +1,8 @@
.include "src/kernel/irq.s" .include "src/kernel/irq.s"
.include "src/kernel/keyboard.s" .include "src/kernel/keyboard.s"
.include "src/kernel/video.s" .include "src/kernel/video.s"
.include "src/kernel/console.s"
.include "src/kernel/graphics.s"
.include "src/kernel/string.s" .include "src/kernel/string.s"
.include "src/kernel/int.s" .include "src/kernel/int.s"
.include "src/kernel/event_handler.s" .include "src/kernel/event_handler.s"

View File

@ -1,6 +1,6 @@
console_write: console_write:
; console Write (string) ; Console Write (string)
; String will be written from a Pointer, ; String will be written from a Pointer,
; without a new line at the end ; without a new line at the end
@ -10,6 +10,13 @@ console_write:
; Output: (none) ; 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 stx z0
sty z1 sty z1
@ -64,7 +71,7 @@ console_write_return:
rts rts
console_write_static: console_write_static:
; console Write Static (string) ; Console Write Static (string)
; String will be written wich follows after ; String will be written wich follows after
; the JSR call without a new line at the end ; the JSR call without a new line at the end
@ -82,7 +89,7 @@ console_write_static:
rts rts
console_writeline: console_writeline:
; console Writeline (string) ; Console Writeline (string)
; Same as "console_write", except at ; Same as "console_write", except at
; the end, a new line begins ; the end, a new line begins
@ -98,7 +105,7 @@ console_writeline:
rts rts
console_writeline_static: console_writeline_static:
; console Writeline Static (string) ; Console Writeline Static (string)
; Same as "console_write_static", except at ; Same as "console_write_static", except at
; the end, a new line begins ; the end, a new line begins
@ -109,7 +116,7 @@ console_writeline_static:
rts rts
console_set_color: console_set_color:
; console Set Color ; Console Set Color
; Sets the color, of the content ; Sets the color, of the content
; that will be written, following ; that will be written, following
@ -122,7 +129,7 @@ console_set_color:
rts rts
console_set_foreground: console_set_foreground:
; console Set Foreground ; Console Set Foreground
; Sets the Foreground color ; Sets the Foreground color
; Input: ; Input:
@ -134,7 +141,7 @@ console_set_foreground:
rts rts
console_set_background: console_set_background:
; console Set Background ; Console Set Background
; Sets the Background color ; Sets the Background color
; Input: ; Input:
@ -146,7 +153,7 @@ console_set_background:
rts rts
console_read_line: console_read_line:
; console Read Line ; Console Read Line
; Loops, till the Return key is pressed ; Loops, till the Return key is pressed
; Output is stored in $300 => "Typebuffer" ; Output is stored in $300 => "Typebuffer"
@ -157,7 +164,7 @@ console_read_line:
rts rts
console_read_char: console_read_char:
; console Read Char ; Console Read Char
; Loops, till a Key is pressed ; Loops, till a Key is pressed
; Input: (none) ; Input: (none)
@ -169,7 +176,7 @@ console_read_char:
rts rts
console_set_cursor: console_set_cursor:
; console Set Cursor ; Console Set Cursor
; Sets the Cursor Location ; Sets the Cursor Location
; Input: ; Input:
@ -182,7 +189,7 @@ console_set_cursor:
rts rts
console_get_cursor: console_get_cursor:
; console Get Cursor ; Console Get Cursor
; Gets the Cursor Location ; Gets the Cursor Location
; Input: (none) ; Input: (none)
@ -195,7 +202,7 @@ console_get_cursor:
rts rts
console_return: console_return:
; console Return ; Console Return
; Sets the Cursor to it's line starting Position ; Sets the Cursor to it's line starting Position
; and if nessesary, scrolls it up and prints the Start Text ; and if nessesary, scrolls it up and prints the Start Text
@ -206,7 +213,7 @@ console_return:
rts rts
console_scroll: console_scroll:
; console Scroll ; Console Scroll
; Scrolls the screen in the given direction ; Scrolls the screen in the given direction
; Input: ; Input:
@ -234,7 +241,7 @@ console_scroll:
rts rts
console_clear: console_clear:
; console Clear ; Console Clear
; Clears the Screen blank, with the normal Color and #$20 Chars ; Clears the Screen blank, with the normal Color and #$20 Chars
; Input: (none) ; Input: (none)
@ -260,7 +267,7 @@ console_clear_loop:
rts rts
console_reset_color: console_reset_color:
; console Reset Color ; Console Reset Color
; Resets the Color to it's initial state ; Resets the Color to it's initial state
; Input: (none) ; Input: (none)
@ -270,7 +277,7 @@ console_reset_color:
rts rts
console_reset: console_reset:
; console Reset ; Console Reset
; Resets the console Display ; Resets the console Display
; to it's initial state, i.e ; to it's initial state, i.e
; clears the screen, resets the Cursor etc... ; clears the screen, resets the Cursor etc...
@ -282,7 +289,7 @@ console_reset:
rts rts
console_load_font: console_load_font:
; console Load Font ; Console Load Font
; Loads a 2k BitMap font from a Pointer to VRAM ; Loads a 2k BitMap font from a Pointer to VRAM
; Input: ; Input:

0
src/kernel/graphics.s Normal file
View File

0
src/kernel/video.s Normal file
View File

View File

@ -1,3 +1,6 @@
;
; Static System Variables ; Static System Variables
; Name Address Size Status Comment ; Name Address Size Status Comment