diff options
author | B. Watson <yalhcru@gmail.com> | 2021-04-19 16:21:59 -0400 |
---|---|---|
committer | B. Watson <yalhcru@gmail.com> | 2021-04-19 16:21:59 -0400 |
commit | d006d16715d70a0e7a6313dfb814166537ad9b6a (patch) | |
tree | 66b13ee40611ca0ceebea738177b54b1924a0755 | |
parent | 076849d61bba0ad62ac899271700e66f9bf5eea2 (diff) | |
download | taipan-d006d16715d70a0e7a6313dfb814166537ad9b6a.tar.gz |
Save 64 bytes, now at 8622
-rw-r--r-- | console.s | 12 | ||||
-rw-r--r-- | taipan.c | 14 |
2 files changed, 18 insertions, 8 deletions
@@ -11,7 +11,7 @@ .export _gotox0y22, _gotox0y3, _gotox0y, _gotox0y3_clrtoeol .export _cputc0, _set_orders, _pluralize, _print_combat_msg .export _rvs_on, _rvs_off - .export _prepare_report, _clear_msg_window, _print_item + .export _prepare_report, _clear_msg_window, _print_item, _print_location .importzp tmp3 ; ditto .import _revflag ; conio/revers.s @@ -21,7 +21,7 @@ .import _cprintulong, _cputc, _cprint_taipan, _timed_getch, _orders .import _turbo .import _print_msg, _cspaces - .import _item + .import _item, _location .ifdef CART_TARGET .segment "HIGHCODE" @@ -264,6 +264,14 @@ _print_combat_msg: jsr _print_msg jmp _clrtoeol +; extern void __fastcall__ print_location(char loc) +_print_location: + asl + tay + lda _location,y + ldx _location+1,y + jmp _print_msg + ; extern void __fastcall__ print_item(char item) _print_item: asl @@ -383,6 +383,8 @@ const char * const location[] = { M_at_sea, M_hong_kong, M_shanghai, M_nagasaki, M_saigon, M_manila, M_singapore, M_batavia }; +extern void __fastcall__ print_location(char loc); + // inverse "Jan\0Feb\0Mar\0Apr\0May\0Jun\0Jul\0Aug\0Sep\0Oct\0Nov\0Dec\0"; const char * const months = "\xca\xe1\xee\0" "\xc6\xe5\xe2\0" @@ -726,7 +728,7 @@ void at_sea(void) { // cspace(); rvs_on(); // cputs(location[0]); - print_msg(M_at_sea); + print_location(0); rvs_off(); cspaces(2); @@ -1681,7 +1683,7 @@ void port_stats(void) { cputs(firm); comma_space(); // cputs(location[1]); - print_msg(M_hong_kong); + print_location(1); clrtoeol(); } @@ -1736,7 +1738,7 @@ void port_stats(void) { if(port == 4 || port == 5) cspace(); rvs_on(); // cputs(location[port]); - print_msg(location[port]); + print_location(port); rvs_off(); clrtoeol(); @@ -2276,7 +2278,7 @@ unsigned char choose_port(void) { cputc(choice + 0xb0); // inverse number cputs(") "); // cputs(location[choice]); - print_msg(location[choice]); + print_location(choice); if(choice != 7) comma_space(); } cprint_question_space(); @@ -2474,7 +2476,7 @@ void quit(void) { // cputs("We've been blown off course\nto "); print_msg(M_blown_off_course); // cputs(location[port]); - print_msg(location[port]); + print_location(port); timed_getch(); } } @@ -2541,7 +2543,7 @@ void quit(void) { // cputs("Arriving at "); print_msg(M_arriving_at); // cputs(location[port]); - print_msg(location[port]); + print_location(port); // cputs("..."); print_msg(M_ellipsis); timed_getch(); |