aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorB. Watson <yalhcru@gmail.com>2021-05-21 03:20:25 -0400
committerB. Watson <yalhcru@gmail.com>2021-05-21 03:20:25 -0400
commite27d2ac43c63aa1e65c445360b6359eeac751247 (patch)
tree425a403efbd69fac7555a45cb7a505f1085f3077
parent8c8c219d3e5bf4f2c0af74528de21ebe7783743b (diff)
downloadtaipan-e27d2ac43c63aa1e65c445360b6359eeac751247.tar.gz
Correctly pluralize "we have N guns". Costs 18 bytes, now 8956
-rw-r--r--console.s40
-rw-r--r--taipan.c3
2 files changed, 16 insertions, 27 deletions
diff --git a/console.s b/console.s
index 3d43dc1..50fe3ed 100644
--- a/console.s
+++ b/console.s
@@ -385,33 +385,19 @@ _print_score_msg:
ldx #>_M_land_based_job
bne @pm ; branch always (since message is not in zero page)
-;;
-;;
-;;
-;; sta FR0
-;; stx FR0+1
-;; ldy #3
-;; lda (FR0),y ; look at MSB of score
-;; bpl @notneg ; is it negative?
-;; lda #<_M_stay_on_shore ; if so, print this message
-;; ldx #>_M_stay_on_shore
-;;@pm:
-;; jmp _print_msg
-;;@notneg: ; else...
-;; bne done1 ; if MSB non-zero, score is at least 2^24+1, no message
-;; dey
-;; lda (FR0),y
-;; dey
-;; ora (FR0),y
-;; bne done1 ; if either of these is non-zero, score is >= 256, no message
-;; dey
-;; lda (FR0),y ; here, the top 3 bytes are zero, so check the LSB.
-;; cmp #100 ; is it < 100?
-;; bcs done1 ; if not, no message. or,
-;; lda #<_M_land_based_job ; if so, print this message
-;; ldx #>_M_land_based_job
-;; bne @pm ; branch always (since message is not in zero page)
-
+;; .import _guns
+;; .export _gun_or_guns
+;;_gun_or_guns:
+;; lda _guns+1
+;; bne @s
+;; lda _guns
+;; cmp #1
+;; bne @s
+;; lda #' '
+;; .byte $2c
+;;@s:
+;; lda #'s'
+;; jmp _cputc
.rodata
orders_tbl: .byte "frt"
diff --git a/taipan.c b/taipan.c
index 6e8ac49..0a2f670 100644
--- a/taipan.c
+++ b/taipan.c
@@ -1021,6 +1021,9 @@ void update_guns(void) {
rvs_on();
gotoxy(31, 1);
justify_int(guns);
+ gotox(39);
+ cblank(1);
+ pluralize(guns);
rvs_off();
}