Skip to content

Commit c36efdf

Browse files
committed
fix: fixes control chr(22) (AT)
1 parent 6859d68 commit c36efdf

File tree

4 files changed

+40
-14
lines changed

4 files changed

+40
-14
lines changed

src/arch/zx48k/library-asm/print.asm

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,7 @@ __PRINT_SET_STATE:
264264

265265
__PRINT_AT1: ; Jumps here if waiting for 1st parameter
266266
ld hl, (S_POSN)
267+
ld h, a
267268
ld a, SCR_ROWS
268269
sub h
269270
ld (S_POSN + 1), a
@@ -272,13 +273,10 @@ __PRINT_AT1: ; Jumps here if waiting for 1st parameter
272273
jr __PRINT_SET_STATE
273274

274275
__PRINT_AT2:
275-
ld hl, __PRINT_START
276-
ld (PRINT_JUMP_STATE), hl ; Saves next entry call
277-
ld hl, (S_POSN)
278-
ld a, SCR_COLS
279-
sub l
280-
ld l, a
281-
jr __PRINT_EOL_END
276+
call __LOAD_S_POSN
277+
ld e, a
278+
call __SAVE_S_POSN
279+
jr __PRINT_RESTART
282280

283281
__PRINT_DEL:
284282
call __LOAD_S_POSN ; Gets current screen position

src/arch/zxnext/library-asm/print.asm

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,7 @@ __PRINT_SET_STATE:
264264

265265
__PRINT_AT1: ; Jumps here if waiting for 1st parameter
266266
ld hl, (S_POSN)
267+
ld h, a
267268
ld a, SCR_ROWS
268269
sub h
269270
ld (S_POSN + 1), a
@@ -272,13 +273,10 @@ __PRINT_AT1: ; Jumps here if waiting for 1st parameter
272273
jr __PRINT_SET_STATE
273274

274275
__PRINT_AT2:
275-
ld hl, __PRINT_START
276-
ld (PRINT_JUMP_STATE), hl ; Saves next entry call
277-
ld hl, (S_POSN)
278-
ld a, SCR_COLS
279-
sub l
280-
ld l, a
281-
jr __PRINT_EOL_END
276+
call __LOAD_S_POSN
277+
ld e, a
278+
call __SAVE_S_POSN
279+
jr __PRINT_RESTART
282280

283281
__PRINT_DEL:
284282
call __LOAD_S_POSN ; Gets current screen position

tests/runtime/cases/printchr22.bas

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#include "lib/tst_framework.bas"
2+
INIT("Testing CHR$(22, y, x)")
3+
4+
DIM aS$(21)
5+
DIM otro$
6+
DIM x,y,i as ubyte : REM aux
7+
8+
REM preparation sprite vars
9+
RESTORE: FOR i=1 TO 21: REM bulls
10+
READ zS$,x,y
11+
LET aS$(i)=CHR$ (22)+CHR$ (y)+CHR$ (x)+zS$
12+
LET otro$=CHR$(22)+CHR$(y)+CHR$(x)+zS$
13+
PRINT AT 23,0;x;" ";y;" ";zS$;" ";AT 0,0;
14+
PRINT aS$(i);otro$;
15+
NEXT i
16+
17+
REM bulls
18+
DATA "AB",30,3,"CD",30,4,"EFG",25,3,"HIJ",25,4
19+
DATA "KLM",21,3,"NOP",21,4,"QRS",15,3,"TUV",15,4
20+
DATA "WXY",10,3,"Zab",10,4,"cd\#008",10,7,"ef\#008",10,8
21+
DATA "ghi",14,7,"jkl",14,8,"mno",19,7,"pqr",19,8
22+
DATA "stu",24,7,"vwx",24,8,"yz!",29,7,"""#$",29,8
23+
DATA "A\#008\#008",31,11,"C\#008\#008",31,12,"EFG",26,11,"HIJ",26,12
24+
DATA "KLM",20,11,"NOP",20,12,"QRS",14,11,"TUV",14,12
25+
DATA "XY\#008",10,11,"ab\#008",10,12,"cd\#008",10,14,"cd\#008",10,14
26+
DATA "ghi",13,14,"ghi",13,14,"mno",17,14,"r\#008\#008",19,15
27+
DATA "stu",25,14,"v\#008\#008",25,15,"yz\#008",30,14,"yz\#008",30,14
28+
DATA " ",10,1," ",10,1
29+
30+
FINISH
6.75 KB
Binary file not shown.

0 commit comments

Comments
 (0)