-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTextUI.inc
95 lines (72 loc) · 1.74 KB
/
TextUI.inc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
jmp TextUIend
; *************************** Functions ***************************************
;******************************************************************************
;Move text cursor
;******************************************************************************
Go_XY:
phx ;Switching X and Y around so X is
phy ;Horizontal position and Y is
plx ;Vertical as we know from graphing
ply
clc
jsr PLOT
rts
;******************************************************************************
;Print string function
;******************************************************************************
Print_Str:
stx TMP1
sty TMP2
ldy #0
@Doprint
lda (TMP1), Y
beq @Printdone
jsr CHROUT
iny
jmp @Doprint
@Printdone
rts
TextUI:
ldx #31
ldy #0
jsr Go_XY
ldx #<@player
ldy #>@player
jsr Print_Str
ldx #31
ldy #2
jsr Go_XY
ldx #<@choose
ldy #>@choose
jsr Print_Str
ldx #31
ldy #3
jsr Go_XY
ldx #<@column
ldy #>@column
jsr Print_Str
ldx #38
ldy #0
jsr Go_XY
lda Player
bne @2
lda #$1C ;Change foreground color to red
jsr CHROUT
ldx #<@num1
ldy #>@num1
jsr Print_Str
bra @end
@2 lda #$1F ;Change foreground color to blue
jsr CHROUT
ldx #<@num2
ldy #>@num2
jsr Print_Str
@end lda #$05 ;Change foreground color to white
jsr CHROUT
rts
@player !pet "player ",0
@choose !pet "choose a",0
@column !pet "column!",0
@num1 !pet "1",0
@num2 !pet "2",0
TextUIend