aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--taipan.c17
-rw-r--r--timed_getch.s19
2 files changed, 22 insertions, 14 deletions
diff --git a/taipan.c b/taipan.c
index 2a8bc2d..ae04e59 100644
--- a/taipan.c
+++ b/taipan.c
@@ -158,7 +158,8 @@ unsigned char get_item(unsigned char allow_all) {
/* title screen now a separate xex segment (see Makefile for details) */
// void splash_intro(void);
-int get_one(void);
+// int get_one(void);
+#define get_one() agetc();
long get_num(void);
void name_firm(void);
void cash_or_guns(void);
@@ -1038,7 +1039,8 @@ int get_one(void)
return choice;
}
-#else
+
+/* new version. Still too much code! */
int get_one(void) {
cursor(1);
cblank(1);
@@ -1115,11 +1117,11 @@ long get_num(void) {
if(!count) return -1;
} else {
cputc(input);
- number[count] = input;
- count++;
+ number[count++] = input;
}
}
cursor(0);
+ number[count] = '\0';
return strtol(number, (char **)NULL, 10);
}
#endif
@@ -1674,8 +1676,8 @@ void transfer(void)
void quit(void)
{
- int choice = 0,
- result = 0,
+ unsigned char choice;
+ int result = 0,
damagepct, sunk;
compradores_report();
@@ -2515,7 +2517,7 @@ void sell(void) {
gotoxy(0, 22);
clrtobot();
- cputs("What do you wish me to buy, Taipan? ");
+ cputs("What do you wish me to sell, Taipan? ");
choice = get_item(0);
/*
@@ -2653,6 +2655,7 @@ int main(void) {
#endif
atari_text_setup();
+
initrand();
name_firm();
cash_or_guns();
diff --git a/timed_getch.s b/timed_getch.s
index a5ac4d5..3259d7e 100644
--- a/timed_getch.s
+++ b/timed_getch.s
@@ -1,6 +1,6 @@
.export _timed_getch, _set_jiffy_timer, _agetc, _numgetc, _yngetc, _lcgetc
- .import _cgetc, _cblank
+ .import _cgetc, _cblank, _cursor
.include "atari.inc"
@@ -42,10 +42,11 @@ done:
; (such as clear, delete, escape) are replaced with a space.
; extern char lcgetc();
_agetc:
-; lda #0 ; show cursor
-; sta CRSINH
-; lda #$20
-; jsr _cblank
+ lda #1 ; show cursor
+ jsr _cursor
+ sta FR0+2 ; save old cursor status
+ lda #1
+ jsr _cblank
jsr _cgetc ; get ATASCII code of keypress
@@ -70,8 +71,12 @@ notcontrol:
bcc ok ; (remember, $7e, backspace, was handled above)
lda #$20
ok:
-; ldx #$01 ; hide cursor
-; stx CRSINH
+ pha
+ lda #1
+ lda FR0+2
+ jsr _cursor
+ pla
+ ldx #0
rts
_lcgetc: