From 19608e05d044febba4b70656474b36ab7590215b Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Thu, 20 May 2021 04:37:53 -0400 Subject: Increase max score to 1 billion (was 1 million), save 8 bytes by eliminating a temp var --- taipan.c | 16 +++++++--------- 1 file 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 */ -- cgit v1.2.3