diff options
author | B. Watson <yalhcru@gmail.com> | 2016-01-03 04:16:11 -0500 |
---|---|---|
committer | B. Watson <yalhcru@gmail.com> | 2016-01-03 04:16:11 -0500 |
commit | 52b3efa3cae299a2df153f3a33a6de3dc9b6d1ad (patch) | |
tree | 60d95bc4a3c7e33df85672ca011d5621861b441b | |
parent | 7d412a05b2eb563f268d81387be0dacd1b77cac2 (diff) | |
download | taipan-52b3efa3cae299a2df153f3a33a6de3dc9b6d1ad.tar.gz |
cursor visibility fixes
-rw-r--r-- | taipan.c | 17 | ||||
-rw-r--r-- | timed_getch.s | 19 |
2 files changed, 22 insertions, 14 deletions
@@ -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: |