diff options
author | B. Watson <yalhcru@gmail.com> | 2016-01-03 22:31:31 -0500 |
---|---|---|
committer | B. Watson <yalhcru@gmail.com> | 2016-01-03 22:31:31 -0500 |
commit | 78955cb3856cfc0115c7e2f2813132cc46c4fd23 (patch) | |
tree | 051c4061a451cbd66c42b9cca9315417fcf632c6 /taipan.c | |
parent | 3e443ad06e61cf6f67c335f657b4010efc7993fe (diff) | |
download | taipan-78955cb3856cfc0115c7e2f2813132cc46c4fd23.tar.gz |
choose pallette on title screen (atari logo key)
Diffstat (limited to 'taipan.c')
-rw-r--r-- | taipan.c | 49 |
1 files changed, 31 insertions, 18 deletions
@@ -99,12 +99,15 @@ void atari_text_setup() { jsleep(1); POKE(559, 34); // turn on the screen (normal playfield) jsleep(1); - POKE(710, 0xc0); // green background - POKE(709, 0x0c); // bright text + // POKE(710, 0xc0); // green background + // POKE(709, 0x0c); // bright text POKE(756, 0xb8); // use our custom font POKE(731, 1); // disable keyclick on XL/XE (does nothing on 400/800) } +/* this didn't work out, bummer. */ +// extern void __fastcall__ waitvcount(unsigned char c); + /**** End of atari-specific stuff */ /* old version of this used to just 'return randl()%clamp'. @@ -892,9 +895,10 @@ int sea_battle(int id, int num_ships) { flushinp(); for(i = 0; i < 3; i++) { - POKE(710, 0xcc); + unsigned char color = PEEK(710) & 0xf0; + POKE(710, color | 0x0c); jsleep(10); - POKE(710, 0xc0); + POKE(710, color & 0xf0); jsleep(10); } @@ -1180,6 +1184,7 @@ void set_prices(void) void port_stats(void) { + static int firmpos = 0; int i, in_use, status = 100 - ((damage * 100) / capacity); @@ -1231,14 +1236,19 @@ void port_stats(void) if(port_stat_dirty) { void *p = (void *)(PEEK(88) + 256 * PEEK(89)); + /* don't update the top of the screen while ANTIC is + reading from it (prevents tearing) */ + // waitvcount(84); memcpy(p, &port_stat_screen, 640); port_stat_dirty = 0; } #endif /* dynamic stuff: */ + // waitvcount(84); cursor(0); - gotoxy(12 - strlen(firm) / 2, 0); /* TODO: store in global */ + if(!firmpos) firmpos = 12 - strlen(firm) / 2; + gotoxy(firmpos, 0); cputs("Firm: "); cputs(firm); cputs(", Hong Kong"); @@ -1313,7 +1323,7 @@ void port_stats(void) gotoy(9); fancy_numbers(debt, fancy_num); - gotox(33 - strlen(fancy_num) / 2); + gotox(34 - strlen(fancy_num) / 2); clrtoeol(); revers(1); cputs(fancy_num); @@ -1426,6 +1436,9 @@ void retire(void) void final_stats(void) { + /* TODO: write cprintlong() to print signed value */ + long finalcash; + int years = year - 1860, time = ((year - 1860) * 12) + month, choice = 0; @@ -1434,8 +1447,8 @@ void final_stats(void) clrscr(); cputs("Your final status:\r\n\r\n"); - cash = cash + bank - debt; - fancy_numbers(cash, fancy_num); + finalcash = cash + bank - debt; + fancy_numbers(finalcash, fancy_num); cputs("Net cash: "); cputs(fancy_num); cputs("\r\nShip size: "); @@ -1458,16 +1471,16 @@ void final_stats(void) cputc('s'); } cputs("\r\n\r\n"); - cash = cash / 100 / time; + finalcash = finalcash / 100 / time; revers(1); cputs("Your score is "); - cprintulong(cash); + cprintulong(finalcash); cputs(".\r\n"); revers(0); - if ((cash < 100) && (cash >= 0)) + if ((finalcash < 100) && (finalcash >= 0)) { cputs("Have you considered a land based job?\r\n\r\n\r\n"); - } else if (cash < 0) { + } else if (finalcash < 0) { cputs("The crew has requested that you stay on\r\n"); cputs("shore for their safety!!\r\n\r\n"); } else { @@ -1480,7 +1493,7 @@ void final_stats(void) cputs("\r\n"); // cputs(" _______________________________\r\n"); cputc('|'); - if (cash > 49999L) + if (finalcash > 49999L) { revers(1); } @@ -1488,7 +1501,7 @@ void final_stats(void) revers(0); cputs(" 50,000 and over |\r\n"); cputc('|'); - if ((cash < 50000L) && (cash > 7999L)) + if ((finalcash < 50000L) && (finalcash > 7999L)) { revers(1); } @@ -1496,7 +1509,7 @@ void final_stats(void) revers(0); cputs(" 8,000 to 49,999|\r\n"); cputc('|'); - if ((cash < 8000L) && (cash > 999L)) + if ((finalcash < 8000L) && (finalcash > 999L)) { revers(1); } @@ -1504,7 +1517,7 @@ void final_stats(void) revers(0); cputs(" 1,000 to 7,999|\r\n"); cputc('|'); - if ((cash < 1000) && (cash > 499)) + if ((finalcash < 1000) && (finalcash > 499)) { revers(1); } @@ -1512,7 +1525,7 @@ void final_stats(void) revers(0); cputs(" 500 to 999|\r\n"); cputc('|'); - if (cash < 500) + if (finalcash < 500) { revers(1); } @@ -1620,7 +1633,7 @@ void transfer(void) gotoxy(0, 21); cputs("Your warehouse will only hold an\r\nadditional "); cprintulong(10000 - in_use); - cputs("%d, Taipan!"); + cputs(", Taipan!"); timed_getch(TMOUT_5S); } |