aboutsummaryrefslogtreecommitdiff
path: root/console.s
diff options
context:
space:
mode:
Diffstat (limited to 'console.s')
-rw-r--r--console.s64
1 files changed, 62 insertions, 2 deletions
diff --git a/console.s b/console.s
index 05445bd..f8d1c8d 100644
--- a/console.s
+++ b/console.s
@@ -1,7 +1,7 @@
.include "atari.inc"
- .export _clrtobot, _clrtoeol, _clr_screen, _clrtoline, _cspaces, _cblank, _backspace, _cprint_pipe, _cprint_bang, _cspace, _cputc_s, _comma_space, _cprint_colon_space, _cprint_question_space, _cprint_period, _cprint_taipan_prompt, _crlf
+ .export _clrtobot, _clrtoeol, _clr_screen, _clrtoline, _cspaces, _cblank, _backspace, _cprint_pipe, _cprint_bang, _cspace, _cputc_s, _comma_space, _cprint_colon_space, _cprint_question_space, _cprint_period, _cprint_taipan_prompt, _crlf, _plus_or_space, _gotox0y, _cputc0, _set_orders
.export _rvs_on, _rvs_off
.import mul40 ; from cc65's runtime
@@ -10,7 +10,7 @@
.import bump_destptr ; these two are
.importzp destptr ; from draw_lorcha.s
.importzp sreg
- .import _cprintulong, _cputc, _cprint_taipan
+ .import _cprintulong, _cputc, _cprint_taipan, _timed_getch, _orders
.ifdef CART_TARGET
.segment "HIGHCODE"
@@ -195,6 +195,9 @@ _comma_space:
_cspace:
lda #' '
.byte $2c
+_cputc0:
+ lda #'0'
+ .byte $2c
_cprint_pipe:
lda #'|'
.byte $2c
@@ -210,3 +213,60 @@ _cprint_bang:
_crlf:
lda #$9b
jmp _cputc
+
+; extern void plus_or_space(unsigned char b);
+_plus_or_space:
+ tax
+ beq @spc
+ lda #'+' + 128 ; inverse plus
+ .byte $2c
+@spc:
+ lda #' '
+ ldx #39
+ stx COLCRS
+ lda #15
+ stx ROWCRS
+ jmp _cputc
+
+; extern void gotox0y(char y);
+ _gotox0y:
+ sta ROWCRS
+ lda #0
+ sta COLCRS
+ rts
+
+; extern void set_orders(void);
+;_set_orders:
+; jsr _timed_getch
+; ldx _orders
+; cmp #'f'
+; bne @notf
+; ldx #1
+;@notf:
+; cmp #'r'
+; bne @notr
+; ldx #2
+;@notr:
+; cmp #'t'
+; bne @nott
+; ldx #3
+;@nott:
+; stx _orders
+; rts
+
+; extern void set_orders(void);
+_set_orders:
+ jsr _timed_getch
+ ldx #3
+@solp:
+ cmp orders_tbl-1,x
+ beq @returnx
+ dex
+ bne @solp
+ rts
+@returnx:
+ stx _orders
+ rts
+
+ .rodata
+orders_tbl: .byte "frt"