aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorB. Watson <yalhcru@gmail.com>2016-01-07 17:01:49 -0500
committerB. Watson <yalhcru@gmail.com>2016-01-07 17:01:49 -0500
commitf219789f03097055be5210166bd35557e3414637 (patch)
treed7234d8e1af28cbd0038f3d33a7b287efc84147c
parent1478b0c357fac4cabb574e521f69e062bf0e4d70 (diff)
downloadtaipan-f219789f03097055be5210166bd35557e3414637.tar.gz
temporarily switch back to cc65's rand()
-rw-r--r--README.txt3
-rw-r--r--taipan.c14
2 files changed, 15 insertions, 2 deletions
diff --git a/README.txt b/README.txt
index f951ca1..5b85282 100644
--- a/README.txt
+++ b/README.txt
@@ -121,6 +121,9 @@ arcade game).
Bugs! At least these:
+- After a battle, the prices don't get reset (or, not always?) when
+ entering the new port.
+
- The BSS overlaps the start of the title screen. Consequences: There
is a momentary graphics glitch when the main game is done loading and
before it shows the "name your firm" screen. Also, we can't go back
diff --git a/taipan.c b/taipan.c
index 44c8f78..c93c6c0 100644
--- a/taipan.c
+++ b/taipan.c
@@ -8,6 +8,11 @@
#include "sounds.h"
+/* define this to use cc65's rand() instead of POKEY's RANDOM
+ register. Leave disabled for now as POKEY never returns 0 (it's an
+ LFSR, I should have known that would happen...) */
+// #define POKEY_RANDOM
+
/* define this for testing sea_battle(). it causes a pirate
attack every time you leave port. Don't leave defined for
a release!! */
@@ -67,14 +72,19 @@ extern void __fastcall__ jsleep(unsigned int j);
/* Atari-specific random number functions from rand.s.
Non-Atari platforms can probably just:
-#define initrand() _randomize();
-#define randi() rand();
+#define initrand() _randomize()
+#define randi() rand()
#define randl() (unsigned long)((randi() << 16) | randi())
*/
+#if POKEY_RANDOM
#define initrand() /* no-op on Atari */
/* random positive int, 0 to 32767 */
extern unsigned int __fastcall__ randi(void);
+#else
+#define initrand() _randomize()
+#define randi() rand()
+#endif
/* random long, 0 to 2**32-1 */
extern unsigned long __fastcall__ randl(void);