diff options
Diffstat (limited to 'taipan.c')
-rw-r--r-- | taipan.c | 69 |
1 files changed, 22 insertions, 47 deletions
@@ -72,6 +72,9 @@ extern unsigned char __fastcall__ yngetc(char dflt); /* sleep for j jiffies (no PAL adjustment at the moment) */ extern void __fastcall__ jsleep(unsigned int j); +/* flash screen when we're hit in combat */ +extern void explosion(void); + #define flushinp() (POKE(764,255)) /* Atari-specific random number functions from rand.s. @@ -679,7 +682,7 @@ void update_guns() { } void fight_stats(int ships, int orders) { - cursor(0); + // cursor(0); gotoxy(0, 0); justify_int(ships); @@ -750,8 +753,7 @@ int sea_battle(int id, int num_ships) { } clrscr(); - cursor(0); - // flushinp(); + // cursor(0); /* the static part of "we have N guns" display, gets printed only once per battle. Bloats the code by 30-odd bytes, but @@ -1103,30 +1105,10 @@ int sea_battle(int id, int num_ships) { cputs("They're firing on us, Taipan!"); timed_getch(); - - /* screen flash doesn't change the hue bit of - COLOR2 register, since we now support changing - it on the title screen. */ - for(i = 0; i < 3; i++) { - unsigned char color = PEEK(710) & 0xf0; - unsigned char textcolor = PEEK(709); - POKE(709,0); - POKE(710, color | 0x0c); - jsleep(10); - POKE(710, color & 0xf0); - jsleep(10); - POKE(709,textcolor); - } + hide_cursor(); + explosion(); fight_stats(num_ships, orders); - /* XXX: I don't think this is needed at all! - for(i = 0; i <= 9; i++) { - if(ships_on_screen[i] > 0) { - draw_lorcha(i); - } - } - */ - plus_or_space(num_ships > num_on_screen); gotoxy(0, 3); @@ -1230,8 +1212,8 @@ unsigned long get_num(void) { unsigned char count = 0; char input; - cursor(1); - cblank(1); + // cursor(1); + // cblank(1); while((input = numgetc()) != '\n') { if(count >= 10) continue; @@ -1242,7 +1224,7 @@ unsigned long get_num(void) { count--; } else if(input == 'a') { if(!count) { - cursor(0); + // cursor(0); return UINT32_MAX; } } else if(input == 'k' || input == 'm') { @@ -1263,7 +1245,7 @@ unsigned long get_num(void) { num_buf[count++] = input; } } - cursor(0); + // cursor(0); num_buf[count] = '\0'; return strtoul(num_buf, (char **)NULL, 10); } @@ -1283,10 +1265,10 @@ void cash_or_guns(void) while ((choice != '1') && (choice != '2')) { gotoxy(10, 10); - cursor(1); + // cursor(1); cputc('?'); choice = get_one(); - cursor(0); + // cursor(0); } cputc(choice); @@ -1400,17 +1382,13 @@ 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)... but it doesn't work :( */ - // waitvcount(84); memcpy(p, &port_stat_screen, 640); port_stat_dirty = 0; } #endif /* dynamic stuff: */ - // waitvcount(84); - cursor(0); + // cursor(0); gotoxy(firmpos, 0); cputs("Firm: "); cputs(firm); @@ -1604,7 +1582,7 @@ void aire(void) { #endif void retire(void) { - cursor(0); + // cursor(0); compradores_report(); revers(1); retire_blanks(); @@ -2552,7 +2530,7 @@ int port_choices(void) { gotoxy(0, 22); clrtobot(); - cursor(0); + // cursor(0); #ifdef BIGNUM // TODO: make this smaller! @@ -2579,7 +2557,7 @@ int port_choices(void) { if(!retire_ok) cputs("or "); cputs("Quit trading"); if(retire_ok) cputs(", or Retire"); - cursor(1); + // cursor(1); cputs("? "); for(;;) { @@ -2593,7 +2571,7 @@ int port_choices(void) { break; } } - cursor(0); + // cursor(0); return choice; } @@ -2601,7 +2579,7 @@ int port_choices(void) { void name_firm(void) { unsigned char input, firmlen = 0; - cursor(0); + // cursor(0); clrscr(); chlinexy(1, 7, 38); @@ -2618,7 +2596,7 @@ void name_firm(void) { gotoxy(2, 11); cputs("What will you name your"); gotoxy(6, 13); - cursor(1); + // cursor(1); cputs("Firm:"); chlinexy(12, 14, 22); @@ -2641,7 +2619,7 @@ void name_firm(void) { } } - cursor(0); + // cursor(0); firm[firmlen] = '\0'; firmpos = 12 - firmlen / 2; return; @@ -2956,6 +2934,7 @@ int main(void) { #endif atari_text_setup(); + cursor(0); #ifdef BIGNUM_TEST bignum_test(); @@ -3020,8 +2999,6 @@ int main(void) { timed_getch(); clear_msg_window(); - // gotoxy(0, 18); - // clrtobot(); cputs("Elder Brother Wu reminds you of the\r\n"); cputs("Confucian ideal of personal worthiness,\r\n"); cputs("and how this applies to paying one's\r\n"); @@ -3030,8 +3007,6 @@ int main(void) { timed_getch(); clear_msg_window(); - // gotoxy(0, 18); - // clrtobot(); cputs("He is reminded of a fabled barbarian\r\n"); cputs("who came to a bad end, after not caring\r\n"); cputs("for his obligations.\r\n\r\n"); |