Some radical Re-Structuring ;)

This commit is contained in:
0xMAC8205 2023-10-29 02:30:16 +02:00
parent f80b827012
commit 894dc18288
15 changed files with 106 additions and 19 deletions

68
KernelRoutineList.txt Normal file
View File

@ -0,0 +1,68 @@
Kernel Routines Grouped
(everything NOT starting with "+-", are "wants")
Char.s
Event_Handler.s
Hardware.s
|
+- vram_write
+- vram_write_color
+- vram_read
+- vram_dump
Int.s
Irq.s
|
+- irq
Keyboard.s
Memory_Manager.s
Software Stack:
(for A, X and Y)
push
pop
Maybe also: External Fragmantation
or: Variable houskeeping in a List of pointers
String.s
to lower
to upper
count
flip
contains
equals
trim
Video.s
|
+- video_write
+- video_write_static
+- video_writeline
+- video_writeline_static
+- video_set_color
+- video_set_foreground
+- video_set_background
+- video_read_line
+- video_read_char
+- video_set_cursor
+- video_get_cursor
+- video_return
+- video_scroll
+- video_clear
+- video_reset_color
+- video_reset
+- video_load_font

View File

@ -1,13 +0,0 @@
.include "lib/src/irq.s"
.include "lib/src/keyboard.s"
.include "lib/src/video.s"
.include "lib/src/string.s"
.include "lib/src/int.s"
kernel_init
rts

4
main.s
View File

@ -1,8 +1,8 @@
.include "lib/variables.s" .include "src/variables.s"
.org $c000 ; $c000 for 16k ROM .org $c000 ; $c000 for 16k ROM
.include "lib/kernel.s" .include "src/kernel.s"
.org $f700 .org $f700

13
src/kernel.s Normal file
View File

@ -0,0 +1,13 @@
.include "src/kernel/irq.s"
.include "src/kernel/keyboard.s"
.include "src/kernel/video.s"
.include "src/kernel/string.s"
.include "src/kernel/int.s"
.include "src/kernel/event_handler.s"
.include "src/kernel/memory_manager.s"
.include "src/kernel/hardware.s"
kernel_init
rts

View File

@ -9,9 +9,12 @@ vram_write
; Y => Y Coordinate ; Y => Y Coordinate
; Output: (none) ; Output: (none)
rts
;vram_write_color vram_write_color
; VRAM Write Color ; VRAM Write Color
; Writes A to the given Coordinate, but adds 0x40 to X ; Writes A to the given Coordinate, but adds 0x40 to X
@ -23,6 +26,8 @@ vram_write
; Output: (none) ; Output: (none)
rts
vram_read vram_read
; VRAM Read ; VRAM Read
; Reads Data from the given Coordinate ; Reads Data from the given Coordinate
@ -35,6 +40,8 @@ vram_read
; A <= Data ; A <= Data
rts
vram_dump vram_dump
; VRAM Dump ; VRAM Dump
; Dumps all bytes from VRAM in the given Range ; Dumps all bytes from VRAM in the given Range
@ -48,4 +55,7 @@ vram_dump
; K3 => LOW Memory Pointer ; K3 => LOW Memory Pointer
; K4 => HIGH Memory Pointer ; K4 => HIGH Memory Pointer
; Output: (none) ; Output: (none)
rts

View File

@ -168,7 +168,6 @@ video_scroll
; +---- 0 = Scroll Text Video Buffer (Y 0 - 31) (4k) ; +---- 0 = Scroll Text Video Buffer (Y 0 - 31) (4k)
; 1 = Scroll Entire Video Buffer (Y 0 - 255) (32k) ; 1 = Scroll Entire Video Buffer (Y 0 - 255) (32k)
; I.E => 0x03 (0b00001011) => Scrolls Entire Videobuffer Right & Up and ; I.E => 0x03 (0b00001011) => Scrolls Entire Videobuffer Right & Up and
; Disposes "scrolled away" content. Fills gaps with empty cells ; Disposes "scrolled away" content. Fills gaps with empty cells
@ -205,4 +204,14 @@ video_reset
rts rts
video_load_font video_load_font
; Video Load Font
; Loads a 2k BitMap font from a Pointer to VRAM
; Input:
; X => LOW Memory Pointer
; Y => HIGH Memory Pointer
; Output: (none)
rts

View File

@ -42,5 +42,5 @@ soft_system_register = $21d ; 8 bit (internal)
color = $2fe ; 8 bit Fore & Background Color color = $2fe ; 8 bit Fore & Background Color
typelength = $2ff ; 8 bit Length of typebuffer typelength = $2ff ; 8 bit Length of typebuffer
typebuffer = $300 ; 256 bit 256 bit, All Purpose Char Buffer typebuffer = $300 ; 256 byte 256 bit, All Purpose Char Buffer