Skip to content

Commit

Permalink
[KERNAL] improve entropy_get by including scanline as source (#379)
Browse files Browse the repository at this point in the history
  • Loading branch information
irmen authored Dec 28, 2024
1 parent 58a1f9b commit 8e9117e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions kernal/drivers/x16/entropy.s
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ entropy_init:
; x random value
; y random value
;---------------------------------------------------------------
; We only have two bytes of entropy, so we return the XOR in the
; third byte:
; a timer lo
; We only have two bytes of entropy from the timer, so we
; also return the XOR with the current scan line as 3rd byte
; a timer lo eor rotated scanline
; x timer hi
; y timer lo + timer hi
; Timer lo is read twice, so there will be some difference.
Expand All @@ -43,5 +43,7 @@ entropy_get:
tax
adc d1t1l ; feed in .C from user
tay
lda d1t1l
lda VERA_IRQ_LINE_L
rol
eor d1t1l
rts

0 comments on commit 8e9117e

Please sign in to comment.