From d5c761515bd26f1f2a6b0f91e2b6f6762431566c Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Wed, 30 Dec 2015 04:49:43 -0500 Subject: Visible damage --- rand.s | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'rand.s') 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: -- cgit v1.2.3