Skip to content

Commit 786a6e8

Browse files
committed
test: update tests
1 parent 821eca5 commit 786a6e8

92 files changed

Lines changed: 19623 additions & 23230 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

tests/functional/zx48k/astore16.asm

Lines changed: 261 additions & 315 deletions
Large diffs are not rendered by default.

tests/functional/zx48k/attr.asm

Lines changed: 31 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,32 @@
5151
; Parameter: BOLD flag in bit 0 of A register
5252
#line 1 "/zxbasic/src/arch/zx48k/library-asm/copy_attr.asm"
5353
#line 4 "/zxbasic/src/arch/zx48k/library-asm/copy_attr.asm"
54-
#line 1 "/zxbasic/src/arch/zx48k/library-asm/const.asm"
55-
; Global constants
56-
push namespace core
57-
P_FLAG EQU 23697
58-
FLAGS2 EQU 23681
59-
ATTR_P EQU 23693 ; permanet ATTRIBUTES
60-
ATTR_T EQU 23695 ; temporary ATTRIBUTES
61-
CHARS EQU 23606 ; Pointer to ROM/RAM Charset
62-
UDG EQU 23675 ; Pointer to UDG Charset
63-
MEM0 EQU 5C92h ; Temporary memory buffer used by ROM chars
64-
pop namespace
54+
#line 1 "/zxbasic/src/arch/zx48k/library-asm/sysvars.asm"
55+
;; -----------------------------------------------------------------------
56+
;; ZX Basic System Vars
57+
;; Some of them will be mapped over Sinclair ROM ones for compatibility
58+
;; -----------------------------------------------------------------------
59+
push namespace core
60+
SCREEN_ADDR: DW 16384 ; Screen address (can be pointed to other place to use a screen buffer)
61+
SCREEN_ATTR_ADDR: DW 22528 ; Screen attribute address (ditto.)
62+
; These are mapped onto ZX Spectrum ROM VARS
63+
CHARS EQU 23606 ; Pointer to ROM/RAM Charset
64+
TVFLAGS EQU 23612 ; TV Flags
65+
UDG EQU 23675 ; Pointer to UDG Charset
66+
COORDS EQU 23677 ; Last PLOT coordinates
67+
FLAGS2 EQU 23681 ;
68+
ECHO_E EQU 23682 ;
69+
DFCC EQU 23684 ; Next screen addr for PRINT
70+
DFCCL EQU 23686 ; Next screen attr for PRINT
71+
S_POSN EQU 23688
72+
ATTR_P EQU 23693 ; Current Permanent ATTRS set with INK, PAPER, etc commands
73+
ATTR_T EQU 23695 ; temporary ATTRIBUTES
74+
P_FLAG EQU 23697 ;
75+
MEM0 EQU 23698 ; Temporary memory buffer used by ROM chars
76+
SCR_COLS EQU 33 ; Screen with in columns + 1
77+
SCR_ROWS EQU 24 ; Screen height in rows
78+
SCR_SIZE EQU (SCR_ROWS << 8) + SCR_COLS
79+
pop namespace
6580
#line 6 "/zxbasic/src/arch/zx48k/library-asm/copy_attr.asm"
6681
push namespace core
6782
COPY_ATTR:
@@ -116,7 +131,7 @@ BOLD_TMP:
116131
ret
117132
ENDP
118133
pop namespace
119-
#line 28 "attr.bas"
134+
#line 28 "zx48k/attr.bas"
120135
#line 1 "/zxbasic/src/arch/zx48k/library-asm/flash.asm"
121136
; Sets flash flag in ATTR_P permanently
122137
; Parameter: Paper color in A register
@@ -153,7 +168,7 @@ FLASH_TMP:
153168
jr __SET_FLASH
154169
ENDP
155170
pop namespace
156-
#line 30 "attr.bas"
171+
#line 30 "zx48k/attr.bas"
157172
#line 1 "/zxbasic/src/arch/zx48k/library-asm/ink.asm"
158173
; Sets ink color in ATTR_P permanently
159174
; Parameter: Paper color in A register
@@ -190,7 +205,7 @@ INK_TMP:
190205
jp __SET_INK
191206
ENDP
192207
pop namespace
193-
#line 31 "attr.bas"
208+
#line 31 "zx48k/attr.bas"
194209
#line 1 "/zxbasic/src/arch/zx48k/library-asm/over.asm"
195210
; Sets OVER flag in P_FLAG permanently
196211
; Parameter: OVER flag in bit 0 of A register
@@ -229,7 +244,7 @@ OVER_TMP:
229244
jp __SET_ATTR_MODE
230245
ENDP
231246
pop namespace
232-
#line 32 "attr.bas"
247+
#line 32 "zx48k/attr.bas"
233248
#line 1 "/zxbasic/src/arch/zx48k/library-asm/paper.asm"
234249
; Sets paper color in ATTR_P permanently
235250
; Parameter: Paper color in A register
@@ -269,5 +284,5 @@ PAPER_TMP:
269284
jp __SET_PAPER
270285
ENDP
271286
pop namespace
272-
#line 33 "attr.bas"
287+
#line 33 "zx48k/attr.bas"
273288
END

tests/functional/zx48k/attr_in_subs.asm

Lines changed: 41 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -55,17 +55,32 @@ _screenAttributes2__leave:
5555
#line 1 "/zxbasic/src/arch/zx48k/library-asm/bright.asm"
5656
; Sets bright flag in ATTR_P permanently
5757
; Parameter: Paper color in A register
58-
#line 1 "/zxbasic/src/arch/zx48k/library-asm/const.asm"
59-
; Global constants
60-
push namespace core
61-
P_FLAG EQU 23697
62-
FLAGS2 EQU 23681
63-
ATTR_P EQU 23693 ; permanet ATTRIBUTES
64-
ATTR_T EQU 23695 ; temporary ATTRIBUTES
65-
CHARS EQU 23606 ; Pointer to ROM/RAM Charset
66-
UDG EQU 23675 ; Pointer to UDG Charset
67-
MEM0 EQU 5C92h ; Temporary memory buffer used by ROM chars
68-
pop namespace
58+
#line 1 "/zxbasic/src/arch/zx48k/library-asm/sysvars.asm"
59+
;; -----------------------------------------------------------------------
60+
;; ZX Basic System Vars
61+
;; Some of them will be mapped over Sinclair ROM ones for compatibility
62+
;; -----------------------------------------------------------------------
63+
push namespace core
64+
SCREEN_ADDR: DW 16384 ; Screen address (can be pointed to other place to use a screen buffer)
65+
SCREEN_ATTR_ADDR: DW 22528 ; Screen attribute address (ditto.)
66+
; These are mapped onto ZX Spectrum ROM VARS
67+
CHARS EQU 23606 ; Pointer to ROM/RAM Charset
68+
TVFLAGS EQU 23612 ; TV Flags
69+
UDG EQU 23675 ; Pointer to UDG Charset
70+
COORDS EQU 23677 ; Last PLOT coordinates
71+
FLAGS2 EQU 23681 ;
72+
ECHO_E EQU 23682 ;
73+
DFCC EQU 23684 ; Next screen addr for PRINT
74+
DFCCL EQU 23686 ; Next screen attr for PRINT
75+
S_POSN EQU 23688
76+
ATTR_P EQU 23693 ; Current Permanent ATTRS set with INK, PAPER, etc commands
77+
ATTR_T EQU 23695 ; temporary ATTRIBUTES
78+
P_FLAG EQU 23697 ;
79+
MEM0 EQU 23698 ; Temporary memory buffer used by ROM chars
80+
SCR_COLS EQU 33 ; Screen with in columns + 1
81+
SCR_ROWS EQU 24 ; Screen height in rows
82+
SCR_SIZE EQU (SCR_ROWS << 8) + SCR_COLS
83+
pop namespace
6984
#line 5 "/zxbasic/src/arch/zx48k/library-asm/bright.asm"
7085
push namespace core
7186
BRIGHT:
@@ -100,73 +115,38 @@ BRIGHT_TMP:
100115
jr __SET_BRIGHT
101116
ENDP
102117
pop namespace
103-
#line 34 "attr_in_subs.bas"
118+
#line 34 "zx48k/attr_in_subs.bas"
104119
#line 1 "/zxbasic/src/arch/zx48k/library-asm/cls.asm"
105-
; JUMPS directly to spectrum CLS
106-
; This routine does not clear lower screen
107-
;CLS EQU 0DAFh
108-
; Our faster implementation
109-
#line 1 "/zxbasic/src/arch/zx48k/library-asm/sposn.asm"
110-
; Printing positioning library.
111-
push namespace core
112-
PROC
113-
LOCAL ECHO_E
114-
__LOAD_S_POSN: ; Loads into DE current ROW, COL print position from S_POSN mem var.
115-
ld de, (S_POSN)
116-
ld hl, (MAXX)
117-
or a
118-
sbc hl, de
119-
ex de, hl
120-
ret
121-
__SAVE_S_POSN: ; Saves ROW, COL from DE into S_POSN mem var.
122-
ld hl, (MAXX)
123-
or a
124-
sbc hl, de
125-
ld (S_POSN), hl ; saves it again
126-
ret
127-
ECHO_E EQU 23682
128-
MAXX EQU ECHO_E ; Max X position + 1
129-
MAXY EQU MAXX + 1 ; Max Y position + 1
130-
S_POSN EQU 23688
131-
POSX EQU S_POSN ; Current POS X
132-
POSY EQU S_POSN + 1 ; Current POS Y
133-
ENDP
134-
pop namespace
135-
#line 9 "/zxbasic/src/arch/zx48k/library-asm/cls.asm"
120+
;; Clears the user screen (24 rows)
136121
push namespace core
137122
CLS:
138123
PROC
139-
LOCAL COORDS
140-
LOCAL __CLS_SCR
141-
LOCAL ATTR_P
142-
LOCAL SCREEN
143124
ld hl, 0
144125
ld (COORDS), hl
145-
ld hl, 1821h
126+
ld hl, SCR_SIZE
146127
ld (S_POSN), hl
147-
__CLS_SCR:
148-
ld hl, SCREEN
128+
ld hl, (SCREEN_ADDR)
129+
ld (DFCC), hl
149130
ld (hl), 0
150131
ld d, h
151132
ld e, l
152133
inc de
153-
ld bc, 6144
134+
ld bc, 6143
154135
ldir
155136
; Now clear attributes
137+
ld hl, (SCREEN_ATTR_ADDR)
138+
ld (DFCCL), hl
139+
ld d, h
140+
ld e, l
141+
inc de
156142
ld a, (ATTR_P)
157143
ld (hl), a
158144
ld bc, 767
159145
ldir
160146
ret
161-
COORDS EQU 23677
162-
SCREEN EQU 16384 ; Default start of the screen (can be changed)
163-
ATTR_P EQU 23693
164-
;you can poke (SCREEN_SCRADDR) to change CLS, DRAW & PRINTing address
165-
SCREEN_ADDR EQU (__CLS_SCR + 1) ; Address used by print and other screen routines
166-
; to get the start of the screen
167147
ENDP
168148
pop namespace
169-
#line 35 "attr_in_subs.bas"
149+
#line 35 "zx48k/attr_in_subs.bas"
170150
#line 1 "/zxbasic/src/arch/zx48k/library-asm/copy_attr.asm"
171151
#line 4 "/zxbasic/src/arch/zx48k/library-asm/copy_attr.asm"
172152
push namespace core
@@ -197,7 +177,7 @@ __REFRESH_TMP:
197177
ret
198178
ENDP
199179
pop namespace
200-
#line 36 "attr_in_subs.bas"
180+
#line 36 "zx48k/attr_in_subs.bas"
201181
#line 1 "/zxbasic/src/arch/zx48k/library-asm/ink.asm"
202182
; Sets ink color in ATTR_P permanently
203183
; Parameter: Paper color in A register
@@ -234,7 +214,7 @@ INK_TMP:
234214
jp __SET_INK
235215
ENDP
236216
pop namespace
237-
#line 37 "attr_in_subs.bas"
217+
#line 37 "zx48k/attr_in_subs.bas"
238218
#line 1 "/zxbasic/src/arch/zx48k/library-asm/paper.asm"
239219
; Sets paper color in ATTR_P permanently
240220
; Parameter: Paper color in A register
@@ -274,5 +254,5 @@ PAPER_TMP:
274254
jp __SET_PAPER
275255
ENDP
276256
pop namespace
277-
#line 38 "attr_in_subs.bas"
257+
#line 38 "zx48k/attr_in_subs.bas"
278258
END

0 commit comments

Comments
 (0)