Support randomize().

In order to have randomize() work as expected (and the Apple II random number generation in general) it is necessary to update the random counter during keypress wait just like the ROM function does.
This commit is contained in:
Oliver Schmidt 2018-09-08 18:44:30 +02:00
parent b6ccd4d5d4
commit 73faf60fe0

View file

@ -25,8 +25,11 @@ _cgetc:
jsr putchardirect ; Returns old character in X
; Wait for keyboard strobe.
: inc RNDL ; Increment random counter low
bne :+
inc RNDH ; Increment random counter high
: lda KBD
bpl :- ; If < 128, no key pressed
bpl :-- ; If < 128, no key pressed
; Cursor on ?
ldy cursor