random generator compatibility fix, updated binaries
This commit is contained in:
1 parent
de605cd5ee
commit
8a8d27b234
12 files changed
+31
-3
No files matched your search
@@ -0,0 +1,3 @@
|
||||
This is an important floating point math routine, referenced by ACME SDK, see here:
|
||||
|
||||
- https://sourceforge.net/p/acme-crossass/code-0/38/tree/trunk/ACME_Lib/cbm/c64/float.a?force=True
|
||||
@@ -0,0 +1,20 @@
|
||||
// #LAYOUT# STD * #TAKE
|
||||
// #LAYOUT# * BASIC_0 #TAKE
|
||||
// #LAYOUT# * * #IGNORE
|
||||
|
||||
//
|
||||
// Random number generator routine
|
||||
//
|
||||
// Input:
|
||||
// - FAC1 (0 - reinitialize the seed with random value, negative - create seed from FAC1)
|
||||
//
|
||||
// Output:
|
||||
// - FAC1
|
||||
//
|
||||
|
||||
rnd_FAC1:
|
||||
|
||||
jsr sgn_FAC1_A
|
||||
|
||||
// FALLTROUGH to rnd_A
|
||||
|
||||
@@ -38,6 +38,8 @@ rnd_generate:
|
||||
eor #$04
|
||||
sta RNDX+4
|
||||
|
||||
sec // make sure Carry is always set, for adc
|
||||
|
||||
// FALLTROUGH
|
||||
|
||||
rnd_generate_copy:
|
||||
@@ -45,7 +47,7 @@ rnd_generate_copy:
|
||||
// Copy the generated number to FAC1, mangle it a little
|
||||
|
||||
lda RNDX+3
|
||||
eor #$62
|
||||
adc #$C6
|
||||
sta FAC1_mantissa+0
|
||||
|
||||
lda RNDX+1
|
||||
@@ -53,10 +55,12 @@ rnd_generate_copy:
|
||||
sta FAC1_mantissa+1
|
||||
|
||||
lda RNDX+4
|
||||
eor #$97
|
||||
eor #$62
|
||||
sta FAC1_mantissa+2
|
||||
|
||||
lda RNDX+2
|
||||
bit RNDX+2
|
||||
rol
|
||||
sta FAC1_mantissa+3
|
||||
|
||||
// FALLTROUGH
|
||||
|
||||
Reference in new issue
Block a user