]> git.sur5r.net Git - cc65/commitdiff
added randomize
authorcpg <cpg@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Wed, 6 Nov 2002 22:21:15 +0000 (22:21 +0000)
committercpg <cpg@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Wed, 6 Nov 2002 22:21:15 +0000 (22:21 +0000)
git-svn-id: svn://svn.cc65.org/cc65/trunk@1494 b7a2c559-68d2-44c3-8de9-860c34a00d81

libsrc/atari/Makefile
libsrc/atari/randomize.s [new file with mode: 0644]

index 9b1549f333391b6365226671d3391928dc68a4b7..afc4e7c9c3d54f7984d5e2e89ec9a802fc522a2c 100644 (file)
@@ -50,6 +50,7 @@ OBJS =        _scrsize.o   \
        oserrlist.o  \
        oserror.o    \
        ostype.o     \
+       randomize.o  \
        read.o       \
        readjoy.o    \
        remove.o     \
diff --git a/libsrc/atari/randomize.s b/libsrc/atari/randomize.s
new file mode 100644 (file)
index 0000000..067bcc1
--- /dev/null
@@ -0,0 +1,17 @@
+;
+; Christian Groessler, 06.11.2002
+;
+; void _randomize (void);
+; /* Initialize the random number generator */
+;
+
+       .export         __randomize
+       .import         _srand
+
+       .include        "atari.inc"
+
+__randomize:             
+       ldx     VCOUNT          ; Use vertical line counter as high byte
+       lda     RTCLOK+2        ; Use clock as low byte
+       jmp     _srand          ; Initialize generator
+