Skip to content

Commit

Permalink
test: update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
boriel committed Oct 11, 2022
1 parent d69cdbb commit 8a7a5fa
Show file tree
Hide file tree
Showing 86 changed files with 21,892 additions and 22,006 deletions.
140 changes: 70 additions & 70 deletions tests/functional/zx48k/astore16.asm
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ _obj.__DATA__:
ld (hl), 15
inc hl
ld (hl), 39
call .core.COPY_ATTR
ld a, (_i)
ld l, a
ld h, 0
Expand Down Expand Up @@ -244,7 +245,8 @@ TMP_ARR_PTR:
DW 0 ; temporary storage for pointer to tables
ENDP
pop namespace
#line 51 "zx48k/astore16.bas"
#line 52 "zx48k/astore16.bas"
#line 1 "/zxbasic/src/arch/zx48k/library-asm/copy_attr.asm"
#line 1 "/zxbasic/src/arch/zx48k/library-asm/print.asm"
; vim:ts=4:sw=4:et:
; PRINT command routine
Expand Down Expand Up @@ -594,60 +596,6 @@ BRIGHT_TMP:
#line 1 "/zxbasic/src/arch/zx48k/library-asm/over.asm"
; Sets OVER flag in P_FLAG permanently
; Parameter: OVER flag in bit 0 of A register
#line 1 "/zxbasic/src/arch/zx48k/library-asm/copy_attr.asm"
#line 4 "/zxbasic/src/arch/zx48k/library-asm/copy_attr.asm"
push namespace core
COPY_ATTR:
; Just copies current permanent attribs into temporal attribs
; and sets print mode
PROC
LOCAL INVERSE1
LOCAL __REFRESH_TMP
INVERSE1 EQU 02Fh
ld hl, (ATTR_P)
ld (ATTR_T), hl
ld hl, FLAGS2
call __REFRESH_TMP
ld hl, P_FLAG
call __REFRESH_TMP
__SET_ATTR_MODE: ; Another entry to set print modes. A contains (P_FLAG)
LOCAL TABLE
LOCAL CONT2
rra ; Over bit to carry
ld a, (FLAGS2)
rla ; Over bit in bit 1, Over2 bit in bit 2
and 3 ; Only bit 0 and 1 (OVER flag)
ld c, a
ld b, 0
ld hl, TABLE
add hl, bc
ld a, (hl)
ld (PRINT_MODE), a
ld hl, (P_FLAG)
xor a ; NOP -> INVERSE0
bit 2, l
jr z, CONT2
ld a, INVERSE1 ; CPL -> INVERSE1
CONT2:
ld (INVERSE_MODE), a
ret
TABLE:
nop ; NORMAL MODE
xor (hl) ; OVER 1 MODE
and (hl) ; OVER 2 MODE
or (hl) ; OVER 3 MODE
#line 67 "/zxbasic/src/arch/zx48k/library-asm/copy_attr.asm"
__REFRESH_TMP:
ld a, (hl)
and 0b10101010
ld c, a
rra
or c
ld (hl), a
ret
ENDP
pop namespace
#line 4 "/zxbasic/src/arch/zx48k/library-asm/over.asm"
push namespace core
OVER:
PROC
Expand Down Expand Up @@ -889,11 +837,10 @@ INVERSE_MODE: ; 00 -> NOP -> INVERSE 0
inc hl
ld (DFCC), hl
ld hl, (DFCCL) ; current ATTR Pos
push hl
call __SET_ATTR
pop hl
inc hl
ld (DFCCL),hl
ld (DFCCL), hl
dec hl
call __SET_ATTR
exx
ret
; ------------- SPECIAL CHARS (< 32) -----------------
Expand All @@ -912,7 +859,7 @@ __PRINT_0Dh: ; Called WHEN printing CHR$(13)
push hl
call __SCROLL_SCR
pop hl
#line 210 "/zxbasic/src/arch/zx48k/library-asm/print.asm"
#line 209 "/zxbasic/src/arch/zx48k/library-asm/print.asm"
1:
ld l, 1
__PRINT_EOL_END:
Expand Down Expand Up @@ -1029,14 +976,14 @@ __PRINT_BOLD:
__PRINT_BOLD2:
call BOLD_TMP
jp __PRINT_RESTART
#line 354 "/zxbasic/src/arch/zx48k/library-asm/print.asm"
#line 353 "/zxbasic/src/arch/zx48k/library-asm/print.asm"
__PRINT_ITA:
ld hl, __PRINT_ITA2
jp __PRINT_SET_STATE
__PRINT_ITA2:
call ITALIC_TMP
jp __PRINT_RESTART
#line 364 "/zxbasic/src/arch/zx48k/library-asm/print.asm"
#line 363 "/zxbasic/src/arch/zx48k/library-asm/print.asm"
LOCAL __BOLD
__BOLD:
push hl
Expand All @@ -1054,7 +1001,7 @@ __BOLD:
pop hl
ld de, MEM0
ret
#line 385 "/zxbasic/src/arch/zx48k/library-asm/print.asm"
#line 384 "/zxbasic/src/arch/zx48k/library-asm/print.asm"
LOCAL __ITALIC
__ITALIC:
push hl
Expand All @@ -1079,12 +1026,12 @@ __ITALIC:
pop hl
ld de, MEM0
ret
#line 413 "/zxbasic/src/arch/zx48k/library-asm/print.asm"
#line 412 "/zxbasic/src/arch/zx48k/library-asm/print.asm"
LOCAL __SCROLL_SCR
#line 487 "/zxbasic/src/arch/zx48k/library-asm/print.asm"
#line 486 "/zxbasic/src/arch/zx48k/library-asm/print.asm"
__SCROLL_SCR EQU 0DFEh ; Use ROM SCROLL
#line 488 "/zxbasic/src/arch/zx48k/library-asm/print.asm"
#line 489 "/zxbasic/src/arch/zx48k/library-asm/print.asm"
#line 490 "/zxbasic/src/arch/zx48k/library-asm/print.asm"
PRINT_COMMA:
call __LOAD_S_POSN
ld a, e
Expand Down Expand Up @@ -1127,9 +1074,9 @@ PRINT_AT: ; Changes cursor to ROW, COL
LOCAL __PRINT_TABLE
LOCAL __PRINT_TAB, __PRINT_TAB1, __PRINT_TAB2
LOCAL __PRINT_ITA2
#line 546 "/zxbasic/src/arch/zx48k/library-asm/print.asm"
#line 545 "/zxbasic/src/arch/zx48k/library-asm/print.asm"
LOCAL __PRINT_BOLD2
#line 552 "/zxbasic/src/arch/zx48k/library-asm/print.asm"
#line 551 "/zxbasic/src/arch/zx48k/library-asm/print.asm"
__PRINT_TABLE: ; Jump table for 0 .. 22 codes
DW __PRINT_NOP ; 0
DW __PRINT_NOP ; 1
Expand Down Expand Up @@ -1157,7 +1104,60 @@ __PRINT_TABLE: ; Jump table for 0 .. 22 codes
DW __PRINT_TAB ; 23 TAB
ENDP
pop namespace
#line 52 "zx48k/astore16.bas"
#line 3 "/zxbasic/src/arch/zx48k/library-asm/copy_attr.asm"
#line 4 "/zxbasic/src/arch/zx48k/library-asm/copy_attr.asm"
push namespace core
COPY_ATTR:
; Just copies current permanent attribs into temporal attribs
; and sets print mode
PROC
LOCAL INVERSE1
LOCAL __REFRESH_TMP
INVERSE1 EQU 02Fh
ld hl, (ATTR_P)
ld (ATTR_T), hl
ld hl, FLAGS2
call __REFRESH_TMP
ld hl, P_FLAG
call __REFRESH_TMP
__SET_ATTR_MODE: ; Another entry to set print modes. A contains (P_FLAG)
LOCAL TABLE
LOCAL CONT2
rra ; Over bit to carry
ld a, (FLAGS2)
rla ; Over bit in bit 1, Over2 bit in bit 2
and 3 ; Only bit 0 and 1 (OVER flag)
ld c, a
ld b, 0
ld hl, TABLE
add hl, bc
ld a, (hl)
ld (PRINT_MODE), a
ld hl, (P_FLAG)
xor a ; NOP -> INVERSE0
bit 2, l
jr z, CONT2
ld a, INVERSE1 ; CPL -> INVERSE1
CONT2:
ld (INVERSE_MODE), a
ret
TABLE:
nop ; NORMAL MODE
xor (hl) ; OVER 1 MODE
and (hl) ; OVER 2 MODE
or (hl) ; OVER 3 MODE
#line 67 "/zxbasic/src/arch/zx48k/library-asm/copy_attr.asm"
__REFRESH_TMP:
ld a, (hl)
and 0b10101010
ld c, a
rra
or c
ld (hl), a
ret
ENDP
pop namespace
#line 53 "zx48k/astore16.bas"
#line 1 "/zxbasic/src/arch/zx48k/library-asm/printu16.asm"
#line 1 "/zxbasic/src/arch/zx48k/library-asm/printi16.asm"
#line 1 "/zxbasic/src/arch/zx48k/library-asm/printnum.asm"
Expand Down Expand Up @@ -1305,5 +1305,5 @@ __PRINTU_LOOP:
ENDP
pop namespace
#line 2 "/zxbasic/src/arch/zx48k/library-asm/printu16.asm"
#line 53 "zx48k/astore16.bas"
#line 55 "zx48k/astore16.bas"
END
11 changes: 5 additions & 6 deletions tests/functional/zx48k/attr.asm
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
call .core.OVER
ld a, 1
call .core.BOLD
call .core.COPY_ATTR
ld hl, 0
ld b, h
ld c, l
Expand Down Expand Up @@ -131,7 +130,7 @@ BOLD_TMP:
ret
ENDP
pop namespace
#line 28 "zx48k/attr.bas"
#line 27 "zx48k/attr.bas"
#line 1 "/zxbasic/src/arch/zx48k/library-asm/flash.asm"
; Sets flash flag in ATTR_P permanently
; Parameter: Paper color in A register
Expand Down Expand Up @@ -168,7 +167,7 @@ FLASH_TMP:
jr __SET_FLASH
ENDP
pop namespace
#line 30 "zx48k/attr.bas"
#line 28 "zx48k/attr.bas"
#line 1 "/zxbasic/src/arch/zx48k/library-asm/ink.asm"
; Sets ink color in ATTR_P permanently
; Parameter: Paper color in A register
Expand Down Expand Up @@ -205,7 +204,7 @@ INK_TMP:
jp __SET_INK
ENDP
pop namespace
#line 31 "zx48k/attr.bas"
#line 29 "zx48k/attr.bas"
#line 1 "/zxbasic/src/arch/zx48k/library-asm/over.asm"
; Sets OVER flag in P_FLAG permanently
; Parameter: OVER flag in bit 0 of A register
Expand Down Expand Up @@ -244,7 +243,7 @@ OVER_TMP:
jp __SET_ATTR_MODE
ENDP
pop namespace
#line 32 "zx48k/attr.bas"
#line 30 "zx48k/attr.bas"
#line 1 "/zxbasic/src/arch/zx48k/library-asm/paper.asm"
; Sets paper color in ATTR_P permanently
; Parameter: Paper color in A register
Expand Down Expand Up @@ -284,5 +283,5 @@ PAPER_TMP:
jp __SET_PAPER
ENDP
pop namespace
#line 33 "zx48k/attr.bas"
#line 31 "zx48k/attr.bas"
END
40 changes: 4 additions & 36 deletions tests/functional/zx48k/attr_in_subs.asm
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ _screenAttributes2:
call .core.BRIGHT
ld a, 2
call .core.INK
call .core.COPY_ATTR
_screenAttributes2__leave:
ld sp, ix
pop ix
Expand Down Expand Up @@ -115,7 +114,7 @@ BRIGHT_TMP:
jr __SET_BRIGHT
ENDP
pop namespace
#line 34 "zx48k/attr_in_subs.bas"
#line 33 "zx48k/attr_in_subs.bas"
#line 1 "/zxbasic/src/arch/zx48k/library-asm/cls.asm"
;; Clears the user screen (24 rows)
push namespace core
Expand Down Expand Up @@ -146,38 +145,7 @@ CLS:
ret
ENDP
pop namespace
#line 35 "zx48k/attr_in_subs.bas"
#line 1 "/zxbasic/src/arch/zx48k/library-asm/copy_attr.asm"
#line 4 "/zxbasic/src/arch/zx48k/library-asm/copy_attr.asm"
push namespace core
COPY_ATTR:
; Just copies current permanent attribs into temporal attribs
; and sets print mode
PROC
LOCAL INVERSE1
LOCAL __REFRESH_TMP
INVERSE1 EQU 02Fh
ld hl, (ATTR_P)
ld (ATTR_T), hl
ld hl, FLAGS2
call __REFRESH_TMP
ld hl, P_FLAG
call __REFRESH_TMP
__SET_ATTR_MODE: ; Another entry to set print modes. A contains (P_FLAG)
#line 65 "/zxbasic/src/arch/zx48k/library-asm/copy_attr.asm"
ret
#line 67 "/zxbasic/src/arch/zx48k/library-asm/copy_attr.asm"
__REFRESH_TMP:
ld a, (hl)
and 0b10101010
ld c, a
rra
or c
ld (hl), a
ret
ENDP
pop namespace
#line 36 "zx48k/attr_in_subs.bas"
#line 34 "zx48k/attr_in_subs.bas"
#line 1 "/zxbasic/src/arch/zx48k/library-asm/ink.asm"
; Sets ink color in ATTR_P permanently
; Parameter: Paper color in A register
Expand Down Expand Up @@ -214,7 +182,7 @@ INK_TMP:
jp __SET_INK
ENDP
pop namespace
#line 37 "zx48k/attr_in_subs.bas"
#line 35 "zx48k/attr_in_subs.bas"
#line 1 "/zxbasic/src/arch/zx48k/library-asm/paper.asm"
; Sets paper color in ATTR_P permanently
; Parameter: Paper color in A register
Expand Down Expand Up @@ -254,5 +222,5 @@ PAPER_TMP:
jp __SET_PAPER
ENDP
pop namespace
#line 38 "zx48k/attr_in_subs.bas"
#line 36 "zx48k/attr_in_subs.bas"
END
Loading

0 comments on commit 8a7a5fa

Please sign in to comment.