aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorB. Watson <yalhcru@gmail.com>2016-01-17 04:15:52 -0500
committerB. Watson <yalhcru@gmail.com>2016-01-17 04:15:52 -0500
commit7b2440363630fc413f7d6540c9c47f521aa6c912 (patch)
tree1a13bd1516950d3acfe38b906172bde6ce7bcb8d
parentd72f8556e703eb8c84d055bfc5a8dcb2620ad61e (diff)
downloadtaipan-7b2440363630fc413f7d6540c9c47f521aa6c912.tar.gz
add missing header from previous commit
-rw-r--r--bigfloat.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/bigfloat.h b/bigfloat.h
new file mode 100644
index 0000000..bcfcfd1
--- /dev/null
+++ b/bigfloat.h
@@ -0,0 +1,33 @@
+/* bignum implementation for Atari OS floating point ROM.
+ Only FP constants and the bignum/bugnump data types need
+ be defined here. See bignum.h for API. */
+
+#define bignum(x) char x[6]
+#define bignump char *
+
+/****** constants ******/
+/* zero */
+#define BIG_0 { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }
+
+/* TODO: calculate bank interest differently: this bignum
+ implementation is floating point, but I might swap it out
+ for an int-based one! */
+/* 1.005 (bank interest) */
+#define BIG_1_005 { 0x40, 0x01, 0x00, 0x50, 0x00, 0x00 }
+
+/* bignum 100, used for score calculations in final_stats() */
+#define BIG_100 { 0x41, 0x01, 0x00, 0x00, 0x00, 0x00 }
+
+/* one thousand, one million, one hundred million */
+#define BIG_1K { 0x41, 0x10, 0x00, 0x00, 0x00, 0x00 }
+#define BIG_1M { 0x43, 0x01, 0x00, 0x00, 0x00, 0x00 }
+#define BIG_100M { 0x44, 0x01, 0x00, 0x00, 0x00, 0x00 }
+
+/* 10 million, one billion, one trillion */
+#define BIG_10M { 0x43, 0x10, 0x00, 0x00, 0x00, 0x00 }
+#define BIG_1B { 0x44, 0x10, 0x00, 0x00, 0x00, 0x00 }
+#define BIG_1T { 0x46, 0x01, 0x00, 0x00, 0x00, 0x00 }
+
+/* max value for a ulong, 2**32-1 */
+#define BIG_MAX_ULONG { 0x44, 0x42, 0x94, 0x96, 0x72, 0x95 }
+