2002-11-05 10:48:20 +00:00
|
|
|
;
|
|
|
|
; Ullrich von Bassewitz, 05.11.2002
|
|
|
|
;
|
2002-11-05 20:17:38 +00:00
|
|
|
; void _randomize (void);
|
2002-11-05 10:48:20 +00:00
|
|
|
; /* Initialize the random number generator */
|
|
|
|
;
|
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
.export __randomize
|
|
|
|
.import _srand
|
2002-11-05 10:48:20 +00:00
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
.include "vic20.inc"
|
2002-11-05 10:48:20 +00:00
|
|
|
|
2002-11-05 20:17:38 +00:00
|
|
|
__randomize:
|
2002-11-05 10:48:20 +00:00
|
|
|
lda VIC_LINES ; Get overflow bit
|
|
|
|
asl a ; Shift bit 7 into carry
|
2002-11-05 20:17:38 +00:00
|
|
|
lda VIC_HLINE ; Get bit 1-8 of rasterline
|
2002-11-05 10:48:20 +00:00
|
|
|
rol a ; Use bit 0-7
|
|
|
|
tax ; Use VIC rasterline as high byte
|
|
|
|
lda TIME ; Use 60HZ clock as low byte
|
|
|
|
jmp _srand ; Initialize generator
|
|
|
|
|