Skip to content

Commit

Permalink
fixed a lot of code n shit
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Wu authored and Matthew Wu committed Dec 9, 2016
1 parent ba31344 commit 2be6b7b
Show file tree
Hide file tree
Showing 2 changed files with 225 additions and 219 deletions.
35 changes: 19 additions & 16 deletions blinkTest.s
@@ -1,6 +1,6 @@
.text

jal delay1S #NEED THIS DONT KNOW WHY
#jal delay1S #NEED THIS DONT KNOW WHY
j begin


Expand All @@ -19,16 +19,19 @@ jr $31
#FUNCTION END------------------------------------------------

#FUNCTION drawPixel------------------------------------------
#Draws the pixel at x = $25, y = $26, color = $27
#Draws the pixel at x = $4, y = $5, color = $6
#Dicks with registers: all the T registers from 8 to 15
#---------------------------
drawPixel:
lw $8, vgaStart($0) #Load VGAStart into $8
#lw $8, vgaStart($0) #Load VGAStart into $8
move $8, $gp
lw $9, screenWidth($0) #Load width into $9
mul $9, $9, $26 #Multiply width * Y
mul $9, $9, $5 #Multiply width * Y
sll $9, $9, 2
sll $4, $4, 2
add $8, $8, $9 #Add Y offset to $8
add $8, $8, $25 #Add X offset to $8
sw $27, 0($8) #Draw the pixel
add $8, $8, $4 #Add X offset to $8
sw $6, 0($8) #Draw the pixel

jr $31
#FUNCTION END------------------------------------------------
Expand All @@ -40,21 +43,21 @@ jr $31
drawRect:
addi $15, $31, 0 #BACK DAT STACK

addi $25, $20, 0
addi $26, $21, 0
addi $27, $24, 0
addi $4, $20, 0
addi $5, $21, 0
addi $6, $24, 0

add $10, $20, $22 #The end limit in X
add $11, $21, $23 #The end limit in Y

drawRow:
jal drawPixel
addi $25, $25, 1
blt $25, $10, drawRow
addi $4, $4, 4
blt $4, $10, drawRow

addi $26, $26, 1
addi $25, $20, 0
blt $26, $11, drawRow
addi $5, $5, 4
addi $4, $20, 0
blt $5, $11, drawRow

addi $31, $15, 0 #UNBACK DAT STACK
jr $31
Expand All @@ -69,10 +72,10 @@ addi $20, $20, 1
addi $21, $20, 0
addi $22, $20, 0
addi $23, $19, 0
addi $24, $19, 0
li $24, 0x0022cc22
jal drawRect

jal delay1S
#jal delay1S

j begin

Expand Down

0 comments on commit 2be6b7b

Please sign in to comment.