Added Graphics.s and Video.s Sub-Routines
This commit is contained in:
parent
cc53736b9c
commit
97dde5c46a
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
.vscode
|
@ -35,8 +35,8 @@ Hardware.s
|
||||
+- vram_dump
|
||||
|
||||
beep
|
||||
set_activity
|
||||
set_user
|
||||
set_activity_led
|
||||
set_user_led
|
||||
scan_keyboard
|
||||
|
||||
Int.s
|
||||
@ -104,23 +104,21 @@ console.s
|
||||
|
||||
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
|
||||
+- 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
|
||||
+- video_clear
|
||||
+- video_copy_memory
|
||||
+- video_set_mode
|
||||
+- video_get_mode
|
||||
+- video_set_accent
|
||||
+- video_get_accent
|
@ -0,0 +1,150 @@
|
||||
; !!! This module only works with the Full
|
||||
; Pixel Graphics mode.
|
||||
; i.e. LS7 Computer Rev. 2 !!!
|
||||
|
||||
graphics_draw_rectangle:
|
||||
; Graphics Draw Rectangle
|
||||
; Draws a Rectangle Outline on the Screen
|
||||
|
||||
; Input:
|
||||
; A => BorderColor
|
||||
; X => X Start Position
|
||||
; Y => Y Start Position
|
||||
; K1 => Rectangle Width
|
||||
; K2 => Rectangle Height
|
||||
|
||||
; Output: (none)
|
||||
|
||||
|
||||
rts
|
||||
|
||||
graphics_draw_line:
|
||||
; Graphics Draw Line
|
||||
; Draws a line on the Screen
|
||||
|
||||
; Input:
|
||||
; A => FillColor
|
||||
; X => X Start Position
|
||||
; Y => Y Start Position
|
||||
; K1 => X End Position
|
||||
; K2 => Y End Position
|
||||
|
||||
; Output: (none)
|
||||
|
||||
|
||||
rts
|
||||
|
||||
graphics_draw_triangle:
|
||||
; Graphics Draw Triangle
|
||||
; Draws a Triangle Outline on the Screen
|
||||
|
||||
; Input:
|
||||
; A => BorderColor
|
||||
; X => A X Position
|
||||
; Y => A Y Position
|
||||
; K1 => B X Position
|
||||
; K2 => B Y Position
|
||||
; K3 => C X Position
|
||||
; K4 => C X Position
|
||||
|
||||
; Output: (none)
|
||||
|
||||
|
||||
rts
|
||||
|
||||
graphics_draw_polygon:
|
||||
; Graphics Draw Polygon
|
||||
; Draws a Polygon Outline on the Screen,
|
||||
; from a Coordinate List
|
||||
|
||||
; Input:
|
||||
; A => BorderColor
|
||||
; X => LOW List Pointer
|
||||
; Y => HIGH List Pointer
|
||||
|
||||
; Output: (none)
|
||||
|
||||
|
||||
rts
|
||||
|
||||
graphics_draw_text:
|
||||
; Graphics Draw Text
|
||||
; Draws Text on the Screen,
|
||||
; with custom color and fond
|
||||
|
||||
; Input:
|
||||
; A => FillColor
|
||||
; X => X Position
|
||||
; Y => Y Position
|
||||
; K1 => LOW String Pointer
|
||||
; K2 => HIGH String Pointer
|
||||
; K3 => LOW Font Pointer
|
||||
; K4 => HIGH Font Pointer
|
||||
|
||||
; Output: (none)
|
||||
|
||||
|
||||
rts
|
||||
|
||||
graphics_fill_rectangle:
|
||||
; Graphics Fill Rectangle
|
||||
; Draws a Filled Rectangle on the Screen
|
||||
|
||||
; Input:
|
||||
; A => FillColor
|
||||
; X => X Start Position
|
||||
; Y => Y Start Position
|
||||
; K1 => Rectangle Width
|
||||
; K2 => Rectangle Height
|
||||
|
||||
; Output: (none)
|
||||
|
||||
|
||||
rts
|
||||
|
||||
graphics_fill_triangle:
|
||||
; Graphics Draw Triangle
|
||||
; Draws a Filled Triangle on the Screen
|
||||
|
||||
; Input:
|
||||
; A => FillColor
|
||||
; X => A X Position
|
||||
; Y => A Y Position
|
||||
; K1 => B X Position
|
||||
; K2 => B Y Position
|
||||
; K3 => C X Position
|
||||
; K4 => C X Position
|
||||
|
||||
; Output: (none)
|
||||
|
||||
|
||||
rts
|
||||
|
||||
graphics_fill_polygon:
|
||||
; Graphics Draw Polygon
|
||||
; Draws a Filled Polygon on the Screen,
|
||||
; from a Coordinate List
|
||||
|
||||
; Input:
|
||||
; A => FillColor
|
||||
; X => LOW List Pointer
|
||||
; Y => HIGH List Pointer
|
||||
|
||||
; Output: (none)
|
||||
|
||||
|
||||
rts
|
||||
|
||||
graphics_set_pixel:
|
||||
; Graphics Set Pixel
|
||||
; Sets the Pixel to a Color
|
||||
|
||||
; Input:
|
||||
; A => FillColor
|
||||
; X => X Position
|
||||
; Y => Y Position
|
||||
|
||||
; Output: (none)
|
||||
|
||||
|
||||
rts
|
@ -96,4 +96,5 @@ vram_dump:
|
||||
; Output: (none)
|
||||
|
||||
|
||||
rts
|
||||
rts
|
||||
|
||||
|
@ -0,0 +1,77 @@
|
||||
video_clear:
|
||||
; Video Clear
|
||||
; Clears the Screen, black
|
||||
|
||||
; Input: (none)
|
||||
; Output: (none)
|
||||
|
||||
|
||||
rts
|
||||
|
||||
video_copy_memory:
|
||||
; Video Copy Memory
|
||||
; Sets the Pixel to a Color
|
||||
|
||||
; Input:
|
||||
; A => Horizontal Wrap
|
||||
; X => X Start Position
|
||||
; Y => Y Start Position
|
||||
; K1 => X End Position
|
||||
; K2 => Y End Position
|
||||
; K3 => LOW Memory Pointer
|
||||
; K4 => HIGH Memory Pointer
|
||||
|
||||
; Output:
|
||||
; X <= LOW Memory Pointer (end)
|
||||
; Y <= HIGH Memory Pointer (end)
|
||||
|
||||
|
||||
rts
|
||||
|
||||
video_set_mode:
|
||||
; Video Set Mode
|
||||
; Sets the Video Mode to
|
||||
; 0 => Text; 1 => Graphics
|
||||
|
||||
; Input:
|
||||
; A => Mode
|
||||
|
||||
; Output: (none)
|
||||
|
||||
|
||||
rts
|
||||
|
||||
video_get_mode:
|
||||
; Video Get Mode
|
||||
; Gets the Video mode
|
||||
; 0 => Text; 1 => Graphics
|
||||
|
||||
; Input: (none)
|
||||
; Output:
|
||||
; A <= Mode
|
||||
|
||||
|
||||
rts
|
||||
|
||||
video_set_accent:
|
||||
; Video Set Accent
|
||||
; Sets the Video Card's Accent
|
||||
|
||||
; Input:
|
||||
; A => Accent
|
||||
|
||||
; Output: (none)
|
||||
|
||||
|
||||
rts
|
||||
|
||||
video_get_accent:
|
||||
; Video Get Accent
|
||||
; Gets the Video Card's Accent
|
||||
|
||||
; Input: (none)
|
||||
; Output:
|
||||
; A <= Accent
|
||||
|
||||
|
||||
rts
|
Loading…
Reference in New Issue
Block a user