Improved random number generator on the Apple 2.

This commit is contained in:
Oliver Schmidt 2015-02-16 17:48:48 +01:00
parent 079e34939a
commit bc17aefbfe

View File

@ -51,8 +51,9 @@ ip65_error: .res 1 ; last error code
; outputs: AX set to a pseudo-random 16 bit number
ip65_random_word:
jsr timer_read ;sets AX
adc $4e ; on an Apple 2, this is RNDL
adc $9004 ; on a VIC 20, this is the raster register
adc $d41b ; on a c64, this is a 'random' number from the SID
adc $d41b ; on a C64, this is a 'random' number from the SID
pha
adc ip65_ctr_arp
ora #$08 ; make sure we grab at least 8 bytes from eth_inp