aboutsummaryrefslogtreecommitdiff
path: root/taipan.c
diff options
context:
space:
mode:
authorB. Watson <yalhcru@gmail.com>2016-02-04 17:33:17 -0500
committerB. Watson <yalhcru@gmail.com>2016-02-04 17:33:17 -0500
commit3ccfe725cfd1672e04dcf5caa555ceaaf3f27159 (patch)
treebbe8c3e4651d0994f57d0cb48e30cfc196e0fc54 /taipan.c
parent00d78b9f401ec6f1ba0a1c900e382ec323058337 (diff)
downloadtaipan-3ccfe725cfd1672e04dcf5caa555ceaaf3f27159.tar.gz
rewrite cspace() in asm, save a few more bytes
Diffstat (limited to 'taipan.c')
-rw-r--r--taipan.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/taipan.c b/taipan.c
index 6ff242f..039db7e 100644
--- a/taipan.c
+++ b/taipan.c
@@ -104,10 +104,12 @@ extern const char *port_stat_screen;
port_stat_screen into screen RAM) */
char port_stat_dirty = 1;
-/* asm curses/conio funcs from clrtobot.s. Old C versions moved to
+/* asm curses/conio funcs from console.s. Old C versions moved to
oldcurses.c for reference. */
extern void clrtobot(void);
extern void clrtoeol(void);
+/* print 'count' spaces: */
+extern void __fastcall__ cspaces(unsigned char count);
/* asm funcs from draw_lorcha.s for drawing/animating enemy ships.
used by sea_battle() */
@@ -155,9 +157,9 @@ void cspace(void) {
cputc(' ');
}
-/* print 'count' spaces */
-void cspaces(unsigned char count) {
- while(count--) cspace();
+/* print the letter s (for pluralization) */
+void cputc_s(void) {
+ cputc('s');
}
/* print 'count' spaces, but leave the cursor where it was.
@@ -699,7 +701,7 @@ void fight_stats(int ships, int orders) {
justify_int(ships);
cputs(" ship");
- if(ships != 1) cputc('s');
+ if(ships != 1) cputc_s();
// cputs(" attacking, Taipan! \r\n");
cputs(" attacking");
cprint_taipan_bang();
@@ -1726,14 +1728,14 @@ void final_stats(void)
cputs(" year");
if (years != 1)
{
- cputc('s');
+ cputc_s();
}
cputs(" and ");
cprintulong(month);
cputs(" month");
if (month > 1)
{
- cputc('s');
+ cputc_s();
}
cputs("\r\n\n");
revers(1);
@@ -2054,7 +2056,7 @@ void quit(void)
}
cprintulong(num_ships);
cputs(" hostile ship");
- if(num_ships != 1) cputc('s');
+ if(num_ships != 1) cputc_s();
// cputs(" approaching, Taipan!\r\n");
cputs(" approaching");
cprint_taipan_bang();