From 8e9117eb864a6ffc66ced72f5bb168ee0b1cbf76 Mon Sep 17 00:00:00 2001 From: Irmen de Jong Date: Sat, 28 Dec 2024 03:40:59 +0100 Subject: [PATCH] [KERNAL] improve entropy_get by including scanline as source (#379) --- kernal/drivers/x16/entropy.s | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/kernal/drivers/x16/entropy.s b/kernal/drivers/x16/entropy.s index aaacf493..0c2692a6 100644 --- a/kernal/drivers/x16/entropy.s +++ b/kernal/drivers/x16/entropy.s @@ -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. @@ -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