Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve entropy_get by including scanline as source #379

Merged
merged 1 commit into from
Dec 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading