Skip to content

Commit 07fe804

Browse files
fix typo in os_GetTokenInput
1 parent 4c0b219 commit 07fe804

3 files changed

Lines changed: 54 additions & 7 deletions

File tree

examples/standalone_examples/os_input/autotest.json

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,33 +22,64 @@
2222
"delay|200",
2323
"hashWait|3",
2424
"key|enter",
25+
"hashWait|4",
26+
"key|2",
27+
"delay|200",
28+
"key|1",
29+
"delay|200",
30+
"hashWait|5",
31+
"key|enter",
2532
"delay|200",
26-
"hashWait|4"
33+
"hashWait|6",
34+
"key|enter",
35+
"delay|200",
36+
"hashWait|7"
2737
],
2838
"hashes":
2939
{
3040
"1":
3141
{
32-
"description": "Test wait for input",
42+
"description": "Test wait for input 1",
3343
"start": "vram_start",
3444
"size": "vram_16_size",
3545
"expected_CRCs": [ "ED817E7E", "A5642ACC" ]
3646
},
3747
"2":
3848
{
39-
"description": "Test show user input",
49+
"description": "Test show user input 1",
4050
"start": "vram_start",
4151
"size": "vram_16_size",
4252
"expected_CRCs": [ "0597804D", "C2D3F3D4" ]
4353
},
4454
"3":
4555
{
46-
"description": "Test output display",
56+
"description": "Test output display 1",
4757
"start": "vram_start",
4858
"size": "vram_16_size",
4959
"expected_CRCs": [ "F90F17BE" ]
5060
},
5161
"4":
62+
{
63+
"description": "Test wait for input 2",
64+
"start": "vram_start",
65+
"size": "vram_16_size",
66+
"expected_CRCs": [ "4DD4EB5A", "5206C3F1" ]
67+
},
68+
"5":
69+
{
70+
"description": "Test show user input 2",
71+
"start": "vram_start",
72+
"size": "vram_16_size",
73+
"expected_CRCs": [ "5ABF91FF", "A2F97D43" ]
74+
},
75+
"6":
76+
{
77+
"description": "Test output display 2",
78+
"start": "vram_start",
79+
"size": "vram_16_size",
80+
"expected_CRCs": [ "E07B2B32" ]
81+
},
82+
"7":
5283
{
5384
"description": "Test program exit",
5485
"start": "vram_start",

examples/standalone_examples/os_input/src/main.c

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,29 @@ int main(void)
1414
/* Clear the homescreen */
1515
os_ClrHome();
1616

17-
/* Ask the user to type a string, which gets stored in `inputBuf` */
17+
/* Ask the user to type a string, which gets stored in `inputBuffer` */
1818
os_GetStringInput("What is N? ", inputBuffer, INPUT_SIZE);
1919

2020
/* Build the user response */
2121
sprintf(response, "N is %s.", inputBuffer);
2222

23-
/* Clear the homescreen and display the built response */
23+
/* Clear the homescreen and display the response */
24+
os_ClrHome();
25+
os_PutStrFull(response);
26+
27+
/* Waits for a key */
28+
while (!os_GetCSC());
29+
30+
/* Clear the homescreen */
31+
os_ClrHome();
32+
33+
/* Ask the user to type a tokenized string, which gets stored in `inputBuffer` */
34+
os_GetTokenInput("What is N (tokens)? ", inputBuffer, INPUT_SIZE);
35+
36+
/* Build the user response */
37+
sprintf(response, "N is %s.", inputBuffer);
38+
39+
/* Clear the homescreen and display the response */
2440
os_ClrHome();
2541
os_PutStrFull(response);
2642

src/ce/gettokeninput.src

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
_os_GetTokenInput:
3333
call __frameset0
34-
ld iy, flags
34+
ld iy, ti.flags
3535
ld l, (iy + $0D)
3636
ld h, (iy + $4C)
3737
push hl ; save text flags

0 commit comments

Comments
 (0)