summary refs log tree commit diff stats
path: root/src/input.asm
diff options
context:
space:
mode:
Diffstat (limited to 'src/input.asm')
-rw-r--r--src/input.asm19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/input.asm b/src/input.asm
index 278b640..f411eed 100644
--- a/src/input.asm
+++ b/src/input.asm
@@ -1,5 +1,5 @@
 section .bss
-    input_buffer resb 1
+    input_buffer resb 250
 
 section .text
     global input
@@ -13,6 +13,7 @@ input:
 
 handle_input:
     mov al, byte [input_buffer]
+    mov ah, byte [direction]
     cmp al, 'w'
     je _input_up
     cmp al, 's'
@@ -26,15 +27,31 @@ handle_input:
     ret
 
 _input_up:
+    cmp ah, 1
+    jnz _set_up
+    ret
+_set_up:
     mov byte [direction], 3
     ret
 _input_down:
+    cmp ah, 3
+    jnz _set_down
+    ret
+_set_down:
     mov byte [direction], 1
     ret
 _input_left:
+    cmp ah, 0
+    jnz _set_left
+    ret
+_set_left:
     mov byte [direction], 2
     ret
 _input_right:
+    cmp ah, 2
+    jnz _set_right
+    ret
+_set_right:
     mov byte [direction], 0
     ret