aboutsummaryrefslogtreecommitdiff
path: root/rand.s
diff options
context:
space:
mode:
authorB. Watson <yalhcru@gmail.com>2015-12-30 04:49:43 -0500
committerB. Watson <yalhcru@gmail.com>2015-12-30 04:49:43 -0500
commitd5c761515bd26f1f2a6b0f91e2b6f6762431566c (patch)
tree2358efc0ce7bfa5c11956193ad67bdcc7468c623 /rand.s
parent2300d2813a524cbfeabac794335e7abe99263df6 (diff)
downloadtaipan-d5c761515bd26f1f2a6b0f91e2b6f6762431566c.tar.gz
Visible damage
Diffstat (limited to 'rand.s')
-rw-r--r--rand.s10
1 files changed, 7 insertions, 3 deletions
diff --git a/rand.s b/rand.s
index c48478e..3d64c74 100644
--- a/rand.s
+++ b/rand.s
@@ -5,10 +5,14 @@
RANDOM = 53770 ; POKEY LFSR read address, defined in the Atari OS
; void __fastcall__ randi(void);
+; NB cc65's rand() returns a positive signed int, meaning
+; 0 to 0x7fff.
_randi:
- lda #0
- sta sreg
- beq randl1
+ lda RANDOM
+ and #$7f
+ tax
+ lda RANDOM
+ rts
; void __fastcall__ randl(void);
_randl: