aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorB. Watson <yalhcru@gmail.com>2016-02-21 16:37:18 -0500
committerB. Watson <yalhcru@gmail.com>2016-02-21 16:37:18 -0500
commit6f5bc5adbc21865093ff24af6dbf0c24ea4cfe9c (patch)
tree91d60ac915e8d672c80d13cba575b8adb6bb266e
parent98f104586e89d7cc96869ab43b307915728184eb (diff)
downloadtaipan-6f5bc5adbc21865093ff24af6dbf0c24ea4cfe9c.tar.gz
save a few more bytes, now 6283 free
-rw-r--r--taipan.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/taipan.c b/taipan.c
index 4321062..ce9d5c1 100644
--- a/taipan.c
+++ b/taipan.c
@@ -250,7 +250,7 @@ void name_firm(void);
void cash_or_guns(void);
void set_prices(void);
void port_stats(void);
-int port_choices(void);
+int port_choices(void); /* making this an char actually wastes 1 byte! */
void new_ship(void);
void new_gun(void);
void li_yuen_extortion(void);
@@ -284,7 +284,7 @@ void cprint_taipan_prompt(void);
void cprint_elder_brother_wu(void);
void cprint_li_yuen(void);
void cprint_firm_colon(void);
-int get_ship_status(void);
+char get_ship_status(void);
/* local replacement for strtoul, see strtonum.c */
unsigned long __fastcall__ strtonum(const char* nptr);
@@ -496,7 +496,7 @@ void cprint_firm_colon(void) {
}
/* making this a function saved 52 bytes */
-int get_ship_status(void) {
+char get_ship_status(void) {
return 100 - ((damage * 100L) / capacity);
}
@@ -604,7 +604,7 @@ void prepare_report(void) {
void compradores_report(void) {
prepare_report();
- cputs("Comprador's Report\r\n\n");
+ cputs("Comprador's Report\r\n\n");
}
void captains_report(void) {
@@ -640,7 +640,7 @@ void new_ship(void) {
}
compradores_report();
- cputs("Do you wish to trade in your ");
+ cputs("Do you wish to trade in your ");
if(damage > 0) {
cputs("\xe4\xe1\xed\xe1\xe7\xe5\xe4"); // inverse "damaged"
} else {
@@ -864,10 +864,9 @@ char sea_battle(char id, int num_ships) {
s0,
ok,
ik,
- i,
+ i;
// input,
- status;
- char choice, flashctr, num_on_screen;
+ char choice, flashctr, num_on_screen, status;
unsigned long amount, total;
port_stat_dirty = 1;
@@ -1468,7 +1467,7 @@ unsigned int warehouse_in_use() {
void port_stats(void)
{
- int i, in_use, status = get_ship_status();
+ int i, in_use, status = get_ship_status();
// status = 100 - ((damage * 100L) / capacity);
/* all the static text that used to be in port_stats() has
@@ -2100,7 +2099,7 @@ void quit(void)
#ifdef BIGNUM
bignum(banktmp);
#endif
- unsigned char choice, sunk, result;
+ unsigned char result = 0, choice, sunk;
int damagepct;
compradores_report();
@@ -2148,7 +2147,7 @@ void quit(void)
#ifdef COMBAT_TEST
if(1)
#else
- if (randi()%bp == 0)
+ if(one_chance_in(bp))
#endif
{
int num_ships = randi()%((capacity / 10) + guns) + 1;
@@ -2664,8 +2663,8 @@ void good_prices(void) {
unsigned char i = randi()%4;
compradores_report();
- cprint_taipan();
- cputs("!! The price of ");
+ cprint_taipan_bangbang();
+ cputs(" The price of ");
cputs(item[i]);
cputs("\r\n has ");
@@ -3120,7 +3119,7 @@ hangx: goto hangx;
/* N.B. cc65 is perfectly OK with main(void), and it avoids
warnings about argv/argc unused. */
int main(void) {
- int choice;
+ char choice;
atari_text_setup();