Final changes and tweaks before submission

This commit is contained in:
iDunnoDev
2022-11-25 11:19:26 +00:00
committed by iDunnoDev
parent 4d5dd089f6
commit 75183113f4
25 changed files with 100 additions and 220 deletions

View File

@ -124,7 +124,7 @@ getdigit:
IntBuffer: .string " "
# Draw Line function DrawLine(x0 (4), y0 (6), x1 (8), y1 (10), color (12))
# Draw Line function DrawLine(int x0 (4), int y0 (6), int x1 (8), int y1 (10), short color (12))
# Define parameter address positions in stack
#define color 12
#define y1 10
@ -230,7 +230,7 @@ cons_line_loop_end:
# we also tell it to free the 10 bytes in the stack for the paramters
# 5 x Word (2 bytes)
# Function PlotPixel(pixelx (4), pixely (6), pixelColor (8))
# Function PlotPixel(int pixelx (4), int pixely (6), short pixelColor (8))
#define pixelcolor 8
#define pixely 6
#define pixelx 4
@ -287,7 +287,7 @@ cons_plot_pixel_end:
popw %bp
ret $6 # Finish the loop and return to the call address
# Draw Line function DrawFilledRect(rectx (4), recty (6), rectWidth (8), rectHeight (10), rectColor (12))
# Draw Line function DrawFilledRect(int rectx (4), int recty (6), int rectWidth (8), int rectHeight (10), short rectColor (12))
# Define parameter address positions in stack
#define rectcolor 12
#define rectheight 10
@ -410,7 +410,7 @@ cons_filled_rect_loop_end:
# we also tell it to free the 10 bytes in the stack for the paramters
# 5 x Word (2 bytes)
# Draw Line function DrawCircle(circlex (4), circley (6), circleRadius (8), circleColor (10))
# Draw Line function DrawCircle(int circlex (4), int circley (6), int circleRadius (8), short circleColor (10))
# This follows the bresenham circle drawing algorithm so that we can stick to integer values
# Define parameter address positions in stack
#define circlecolor 10
@ -664,6 +664,7 @@ arr_dump_end:
# This function fills the array with FF bytes (FF being a value i can use in a loop to end it and not effect the x/y positions)
#define clearsize 6
#define clearptr 4
arr_clear:
pushw %bp
movw %sp, %bp
@ -686,12 +687,12 @@ arr_clear_setup:
addw $2, %si # to make sure a correct address was given
arr_clear_loop_start:
movb %al, (%si)
movb %al, (%si) # Loop the array and add the bit pattern given as filler
inc %si
loop arr_clear_loop_start
arr_clear_add_end_bytes:
movw $0x7fff, (%si)
movw $0x7fff, (%si) # End the array with the ending word
arr_clear_loop_end:
# Return all the original values to each register before we return back
@ -851,9 +852,9 @@ setup_polygon_arrays:
call arr_clear
# Map points for the star polygon array
pushw (screen_height)
pushw $0
pushw $0x1000
pushw (screen_height) # y
pushw $0 # x
pushw $0x1000 # Array ptr
call arr_add_point
pushw $140
pushw $40
@ -894,9 +895,9 @@ setup_polygon_arrays:
call arr_clear
# Array for the moon polygon
pushw $0
pushw $0
pushw $0x1050
pushw $0 # y
pushw $0 # x
pushw $0x1050 # Array ptr
call arr_add_point
pushw $5
pushw $8

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
stage5/xv6.img (Stored with Git LFS)

Binary file not shown.