mirror of
https://github.com/bobbimanners/emailler.git
synced 2024-07-31 23:28:55 +00:00
Improved random number generator on the Apple 2.
This commit is contained in:
parent
079e34939a
commit
bc17aefbfe
@ -51,8 +51,9 @@ ip65_error: .res 1 ; last error code
|
|||||||
; outputs: AX set to a pseudo-random 16 bit number
|
; outputs: AX set to a pseudo-random 16 bit number
|
||||||
ip65_random_word:
|
ip65_random_word:
|
||||||
jsr timer_read ;sets AX
|
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 $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
|
pha
|
||||||
adc ip65_ctr_arp
|
adc ip65_ctr_arp
|
||||||
ora #$08 ; make sure we grab at least 8 bytes from eth_inp
|
ora #$08 ; make sure we grab at least 8 bytes from eth_inp
|
||||||
|
Loading…
Reference in New Issue
Block a user