summaryrefslogtreecommitdiff
path: root/main.s
diff options
context:
space:
mode:
authorMikhail Osipov <mike.osipov@gmail.com>2021-09-23 19:51:53 +0300
committerMikhail Osipov <mike.osipov@gmail.com>2021-09-23 19:51:53 +0300
commitaae5708bf1722e8296ab8186851a44a0ecbe1c7b (patch)
treeb6c7481c52ccc347d749bca30cfde5bf926b3580 /main.s
parenteac88b9f4b7708531a1dc6b30bc25f6a325a68d8 (diff)
add time step modifiers
Diffstat (limited to 'main.s')
-rw-r--r--main.s24
1 files changed, 18 insertions, 6 deletions
diff --git a/main.s b/main.s
index a548e94..14b10a2 100644
--- a/main.s
+++ b/main.s
@@ -824,21 +824,30 @@ poll_loop:
movb $EV_EXIT, (event)
jmp exit
- 1:
- cmpb $'r, %al
+ 1: cmpb $'r, %al
jne 1f
movb $EV_RESTART, (event)
- 1:
- cmpb $' ', %al
+ 1: cmpb $' ', %al
jne 1f
notl (pause)
- 1:
- cmpb $'p', %al
+ 1: cmpb $'p', %al
jne 1f
movb $EV_PRINT, (event)
+ 1: cmpb $'-', %al
+ jne 1f
+ cmpl $TIMESTEP, (timespec + 4)
+ jle 1f
+ subl $TIMESTEP, (timespec + 4)
+
+ 1: cmpb $'=', %al
+ jne 1f
+ cmpl $TIMEUPTO, (timespec + 4)
+ jge 1f
+ addl $TIMESTEP, (timespec + 4)
+
1:
jmp poll_loop
@@ -1029,6 +1038,9 @@ str_fcntl: .asciz "fcntl"
sig_die_set:
.byte SIGINT, SIGQUIT, SIGILL, SIGABRT, SIGBUS, SIGTERM, SIGSEGV, 0
+.equ TIMEUPTO, 500000000
+.equ TIMESTEP, 25000000
+
timespec:
.int 0
.int 100000000