aboutsummaryrefslogtreecommitdiff
path: root/taipan.c
diff options
context:
space:
mode:
authorB. Watson <yalhcru@gmail.com>2021-05-14 03:51:43 -0400
committerB. Watson <yalhcru@gmail.com>2021-05-14 03:51:43 -0400
commit9f4f1e18cd5b14c3c277f2e1752100bba9f4fc25 (patch)
tree4df25398989047d116f9017da2bb0e6b5f12c01d /taipan.c
parent9b2fa6472b78828f4af74ecc6992fb75a290b2f5 (diff)
downloadtaipan-9f4f1e18cd5b14c3c277f2e1752100bba9f4fc25.tar.gz
Increase firm name limit from 22 to 24 chars (costs 2 bytes, now 8834)
Diffstat (limited to 'taipan.c')
-rw-r--r--taipan.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/taipan.c b/taipan.c
index 313d48b..3d695a8 100644
--- a/taipan.c
+++ b/taipan.c
@@ -321,6 +321,9 @@ extern char *ultostr(unsigned long value, char* s);
#define DEBT_MAX 1952257860L
char wu_assassin;
+/* maximum length of the user's firm name. was 22, no reason not to allow 24. */
+#define MAX_FIRM 24
+
/* taipan functions (modified as little as possible) */
#define GENERIC 1
#define LI_YUEN 2
@@ -391,7 +394,7 @@ extern void clear_hkw(void);
/* use page 6 for these buffers, for .xex build. Otherwise they're BSS. */
#ifdef CART_TARGET
-char firm[23];
+char firm[MAX_FIRM + 1];
char num_buf[20];
#else
char *firm = (char *) 0x680;
@@ -1732,14 +1735,14 @@ void port_stats(void) {
chline(40);
gotox0y(0);
- cspaces(firmpos);
+ clrtoeol();
+ if(firmpos) cspaces(firmpos);
// cputs("Firm: ");
cprint_firm_colon();
cputs(firm);
comma_space();
// cputs(location[1]);
print_location(1);
- clrtoeol();
}
/* dynamic stuff: */
@@ -3059,9 +3062,9 @@ void name_firm(void) {
cputc(5);
print_bar_line();
cprint_pipe();
- cspaces(5);
+ cspaces(4);
cprint_taipan_comma();
- cspaces(25);
+ cspaces(26);
cprint_pipe();
print_bar_line();
cprint_pipe();
@@ -3071,21 +3074,21 @@ void name_firm(void) {
cprint_pipe();
print_bar_line();
cprint_pipe();
- cspaces(5);
+ cspaces(4);
cprint_firm_colon();
- cspaces(28);
+ cspaces(29);
cprint_pipe();
cprint_pipe();
- cspaces(11);
- chline(22);
- cspaces(5);
+ cspaces(10);
+ chline(MAX_FIRM);
+ cspaces(4);
cprint_pipe();
print_bar_line();
cputc(26);
chline(38);
cputc(3);
- gotoxy(12, 13);
+ gotoxy(11, 13);
while(1) {
if((input = agetc()) == ENTER) {
@@ -3102,7 +3105,7 @@ void name_firm(void) {
backspace();
--firmlen;
}
- } else if(firmlen < 22) {
+ } else if(firmlen < MAX_FIRM) {
cputc(firm[firmlen++] = input | 0x80);
randseed <<= 1;
randseed += (input - 32);