aboutsummaryrefslogtreecommitdiff
path: root/timed_getch.s
diff options
context:
space:
mode:
authorB. Watson <yalhcru@gmail.com>2016-02-15 07:53:50 -0500
committerB. Watson <yalhcru@gmail.com>2016-02-15 07:53:50 -0500
commit3988e55f135d6328d16ce95fe363acf2d2e07f56 (patch)
tree366c9b791b11bf73f8c1279330c1becc57c57a57 /timed_getch.s
parent5cfa5659449c33f9dc0b2997ae2940531d16463d (diff)
downloadtaipan-3988e55f135d6328d16ce95fe363acf2d2e07f56.tar.gz
shave off some code size, spend some of it on better randomness. 5461 bytes free now.
Diffstat (limited to 'timed_getch.s')
-rw-r--r--timed_getch.s11
1 files changed, 10 insertions, 1 deletions
diff --git a/timed_getch.s b/timed_getch.s
index 9a0f9a1..41b9ecb 100644
--- a/timed_getch.s
+++ b/timed_getch.s
@@ -1,7 +1,7 @@
.export _timed_getch, _set_jiffy_timer, _agetc, _numgetc
.export _yngetc, _lcgetc, _jsleep
- .import _cgetc, _cblank, _cursor
+ .import _cgetc, _cblank, _cursor, _rand
.include "atari.inc"
@@ -69,6 +69,15 @@ _agetc:
jsr _cgetc ; get ATASCII code of keypress
+ ; twitch the random bottle based on the low bit of
+ ; the character entered.
+ pha
+ and #$01
+ beq @nr
+ jsr _rand
+@nr:
+ pla
+
; special cases
cmp #$9b ; enter key, return as-is
beq ok