aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorB. Watson <yalhcru@gmail.com>2021-05-20 04:37:53 -0400
committerB. Watson <yalhcru@gmail.com>2021-05-20 12:44:01 -0400
commit19608e05d044febba4b70656474b36ab7590215b (patch)
tree4356643c251b7d420ba6843c5acf51874a9928af
parentc89875818d478c4a579a2f5af4e64fa35c7f78b6 (diff)
downloadtaipan-19608e05d044febba4b70656474b36ab7590215b.tar.gz
Increase max score to 1 billion (was 1 million), save 8 bytes by eliminating a temp var
-rw-r--r--taipan.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/taipan.c b/taipan.c
index f23bb86..a6f6e5f 100644
--- a/taipan.c
+++ b/taipan.c
@@ -1961,10 +1961,8 @@ void retire(void) {
// This didn't work out (revisit someday?)
// extern void __fastcall__ print_score_msg(long *scoreptr);
-void final_stats(void)
-{
- int years = year - 1860,
- time = get_time();
+void final_stats(void) {
+ int years = year - 1860;
#ifdef BIGNUM
long score;
@@ -1979,11 +1977,11 @@ void final_stats(void)
big_sub(finalcash, finalcash, bigtmp);
big_div(bigscore, finalcash, big_100);
- ulong_to_big((unsigned long)time, bigtmp);
+ ulong_to_big((unsigned long)get_time(), bigtmp);
big_div(bigscore, bigscore, bigtmp);
- if(big_cmp(bigscore, big1M) > 0) {
- score = 1000000L;
+ if(big_cmp(bigscore, big1B) > 0) {
+ score = 1000000000L;
} else if(big_cmp(bigscore, big0) < 0) {
score = -1;
} else {
@@ -1993,7 +1991,7 @@ void final_stats(void)
#else
/* TODO: write cprintlong() to print signed value */
long finalcash = cash + bank - debt;
- long score = finalcash / 100 / time;
+ long score = finalcash / 100 / get_time();
#endif
port_stat_dirty = 1;
@@ -2134,7 +2132,7 @@ void final_stats(void)
/* player said No, don't play again...
for the xex build, exit(0) gets us back to DOS.
- for the cartridge, it returns us to the title screen. */
+ for the cartridge, reboot the Atari (gets us back to the title screen). */
#ifdef CART_TARGET
__asm__("jmp $e477"); /* COLDSV, coldstart vector */