diff options
author | B. Watson <yalhcru@gmail.com> | 2021-04-14 13:27:22 -0400 |
---|---|---|
committer | B. Watson <yalhcru@gmail.com> | 2021-04-14 13:27:22 -0400 |
commit | c94725152b4bb2e46f94a32d0dbee68f47de343b (patch) | |
tree | 0aff7d22e81d5b8a3f04c83e8865d200fce4fac7 | |
parent | 5db422731acc4bea80ae353d7541fc1bb9026a5b (diff) | |
download | taipan-c94725152b4bb2e46f94a32d0dbee68f47de343b.tar.gz |
Save 45 bytes
-rw-r--r-- | console.s | 7 | ||||
-rw-r--r-- | taipan.c | 50 |
2 files changed, 23 insertions, 34 deletions
@@ -2,7 +2,7 @@ .include "atari.inc" .include "conio/mul40.s" - .export _clrtobot, _clrtoeol, _clr_screen, _clrtoline, _cspaces, _cblank, _cblankto, _backspace, _cprint_pipe, _cprint_bang, _cspace, _cputc_s, _comma_space, _cprint_colon_space, _cprint_question_space, _cprint_period, _cprint_taipan_prompt, _plus_or_space, _gotox0y22, _gotox0y3, _gotox0y, _cputc0, _set_orders + .export _clrtobot, _clrtoeol, _clr_screen, _clrtoline, _cspaces, _cblank, _cblankto, _backspace, _cprint_pipe, _cprint_bang, _cspace, _cputc_s, _comma_space, _cprint_colon_space, _cprint_question_space, _cprint_period, _cprint_taipan_prompt, _plus_or_space, _gotox0y22, _gotox0y3, _gotox0y, _gotox0y3_clrtoeol,_cputc0, _set_orders .export _rvs_on, _rvs_off .importzp tmp3 ; ditto @@ -249,6 +249,11 @@ _gotox0y: sta COLCRS rts +; extern void gotox0y3_clrtoeol(void); +_gotox0y3_clrtoeol: + jsr _gotox0y3 + jmp _clrtoeol + ; extern void set_orders(void); ;_set_orders: ; jsr _timed_getch @@ -138,6 +138,7 @@ extern void __fastcall__ gotox0y(char y); save us 43 bytes. */ extern void __fastcall__ gotox0y3(void); /* same as gotoxy(0,3) */ extern void __fastcall__ gotox0y22(void); /* same as gotoxy(0,22) */ +extern void __fastcall__ gotox0y3_clrtoeol(void); /* same as gotoxy(0,3); clrtoeol(); */ /* each prints one specific character */ extern void crlf(void); @@ -1125,8 +1126,7 @@ char sea_battle(char id, int num_ships) { set_orders(); if(!orders) { turbo = 0; - gotox0y3(); - clrtoeol(); + gotox0y3_clrtoeol(); cprint_taipan_comma(); // cputs("what shall we do??\n(Fight, Run, Throw cargo)"); print_msg(M_what_shall_we_do); @@ -1135,7 +1135,7 @@ char sea_battle(char id, int num_ships) { while(!orders) set_orders(); gotox0y3(); - cblank(80); + cblank(80); /* clears 2 lines */ } } @@ -1146,15 +1146,13 @@ char sea_battle(char id, int num_ships) { ok = 3; ik = 1; - gotox0y3(); - clrtoeol(); + gotox0y3_clrtoeol(); // cputs("Aye, we'll fight 'em"); print_msg(M_aye_fight); cprint_taipan_period(); set_orders(); - gotox0y3(); - clrtoeol(); + gotox0y3_clrtoeol(); // cputs("We're firing on 'em"); print_msg(M_were_firing); cprint_taipan_bang(); @@ -1218,8 +1216,7 @@ char sea_battle(char id, int num_ships) { tjsleep(10); } } - gotox0y3(); - clrtoeol(); + gotox0y3_clrtoeol(); if(sk > 0) { // cputs("Sunk "); print_msg(M_sunk); @@ -1243,8 +1240,7 @@ char sea_battle(char id, int num_ships) { num_ships -= ran; fight_stats(num_ships, orders); - gotox0y3(); - clrtoeol(); + gotox0y3_clrtoeol(); cprintuint(ran); // cputs(" ran away"); print_msg(M_ran_away); @@ -1271,8 +1267,7 @@ char sea_battle(char id, int num_ships) { set_orders(); } } else if ((orders == 1) && (guns == 0)) { - gotox0y3(); - clrtoeol(); + gotox0y3_clrtoeol(); // cputs("We have no guns"); print_msg(M_we_have_no_guns); cprint_taipan_bangbang(); @@ -1344,8 +1339,7 @@ char sea_battle(char id, int num_ships) { cblank(120); if(total > 0) { - gotox0y3(); - clrtoeol(); + gotox0y3_clrtoeol(); // cputs("Let's hope we lose 'em"); print_msg(M_hope_we_lose_em); cprint_taipan_bang(); @@ -1365,8 +1359,7 @@ char sea_battle(char id, int num_ships) { set_orders(); } else { - gotox0y3(); - clrtoeol(); + gotox0y3_clrtoeol(); // cputs("There's nothing there"); print_msg(M_nothing_there); cprint_taipan_bang(); @@ -1378,8 +1371,7 @@ char sea_battle(char id, int num_ships) { if((orders == 2) || (orders == 3)) { if(orders == 2) { - gotox0y3(); - clrtoeol(); + gotox0y3_clrtoeol(); // cputs("Aye, we'll run"); print_msg(M_aye_run); cprint_taipan_period(); @@ -1387,9 +1379,8 @@ char sea_battle(char id, int num_ships) { } ok += ik++; + gotox0y3_clrtoeol(); if(randi()%ok > randi()%num_ships) { - gotox0y3(); - clrtoeol(); // cputs("We got away from 'em"); print_msg(M_we_got_away); cprint_taipan_bang(); @@ -1400,8 +1391,6 @@ char sea_battle(char id, int num_ships) { timed_getch(); num_ships = 0; } else { - gotox0y3(); - clrtoeol(); // cputs("Couldn't lose 'em."); print_msg(M_couldnt_lose_em); set_orders(); @@ -1412,8 +1401,7 @@ char sea_battle(char id, int num_ships) { num_ships -= lost; fight_stats(num_ships, orders); - gotox0y3(); - clrtoeol(); + gotox0y3_clrtoeol(); // cputs("But we escaped from "); print_msg(M_but_we_escaped); cprintuint(lost); @@ -1441,8 +1429,7 @@ char sea_battle(char id, int num_ships) { } if(num_ships > 0) { - gotox0y3(); - clrtoeol(); + gotox0y3_clrtoeol(); // cputs("They're firing on us"); print_msg(M_theyre_firing); cprint_taipan_bang(); @@ -1453,8 +1440,7 @@ char sea_battle(char id, int num_ships) { fight_stats(num_ships, orders); plus_or_space(num_ships > num_on_screen); - gotox0y3(); - clrtoeol(); + gotox0y3_clrtoeol(); // cputs("We've been hit"); print_msg(M_weve_been_hit); cprint_taipan_bangbang(); @@ -1475,8 +1461,7 @@ char sea_battle(char id, int num_ships) { guns--; hold += 10; fight_stats(num_ships, orders); - gotox0y3(); - clrtoeol(); + gotox0y3_clrtoeol(); // cputs("The buggers hit a gun"); print_msg(M_buggers_hit_gun); cprint_taipan_bangbang(); @@ -1540,8 +1525,7 @@ char sea_battle(char id, int num_ships) { if(orders == 1) { fight_stats(num_ships, orders); - gotox0y3(); - clrtoeol(); + gotox0y3_clrtoeol(); // cputs("We got 'em all"); print_msg(M_we_got_em_all); cprint_taipan_bang(); |