Skip to content

Commit e3cabc2

Browse files
committed
Test added
1 parent a29a018 commit e3cabc2

55 files changed

Lines changed: 1696 additions & 1272 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/astore16.asm

Lines changed: 32 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -730,34 +730,38 @@ __PRINTCHAR: ; Print character store in accumulator (A register)
730730
LOCAL __PRINT_UDG
731731
LOCAL __PRGRAPH
732732
LOCAL __PRINT_START
733-
LOCAL __NO_SCROLL
734733
LOCAL __ROM_SCROLL_SCR
735734
LOCAL __TVFLAGS
736735
__ROM_SCROLL_SCR EQU 0DFEh
737736
__TVFLAGS EQU 5C3Ch
738737
PRINT_JUMP_STATE EQU __PRINT_JUMP + 1
739738
__PRINT_JUMP:
740739
jp __PRINT_START ; Where to jump. If we print 22 (AT), next two calls jumps to AT1 and AT2 respectively
741-
__PRINT_START:
742-
cp ' '
743-
jp c, __PRINT_SPECIAL ; Characters below ' ' are special ones
744-
exx ; Switch to alternative registers
745-
ex af, af' ; Saves a value (char to print) for later
740+
LOCAL __SCROLL
741+
__SCROLL: ; Scroll?
746742
ld hl, __TVFLAGS
747743
bit 1, (hl)
748-
jp z, __NO_SCROLL
744+
ret z
749745
call __ROM_SCROLL_SCR
750746
ld hl, __TVFLAGS
751747
res 1, (hl)
752-
__NO_SCROLL:
748+
ret
749+
#line 75 "/zxbasic/library-asm/print.asm"
750+
__PRINT_START:
751+
cp ' '
752+
jp c, __PRINT_SPECIAL ; Characters below ' ' are special ones
753+
exx ; Switch to alternative registers
754+
ex af, af' ; Saves a value (char to print) for later
755+
call __SCROLL
756+
#line 86 "/zxbasic/library-asm/print.asm"
753757
call __LOAD_S_POSN
754758
; At this point we have the new coord
755759
ld hl, (SCREEN_ADDR)
756760
ld a, d
757-
ld c, a ; Saves it for later
761+
ld c, a ; Saves it for later
758762
and 0F8h ; Masks 3 lower bit ; zy
759763
ld d, a
760-
ld a, c ; Recovers it
764+
ld a, c ; Recovers it
761765
and 07h ; MOD 7 ; y1
762766
rrca
763767
rrca
@@ -785,9 +789,9 @@ __PRINT_UDG:
785789
__SRCADDR:
786790
ld bc, (CHARS)
787791
__PRGRAPH0:
788-
add a, a ; A = a * 2 (since a < 80h) ; Thanks to Metalbrain at http://foro.speccy.org
792+
add a, a ; A = a * 2 (since a < 80h) ; Thanks to Metalbrain at http://foro.speccy.org
789793
ld l, a
790-
ld h, 0 ; HL = a * 2 (accumulator)
794+
ld h, 0 ; HL = a * 2 (accumulator)
791795
add hl, hl
792796
add hl, hl ; HL = a * 8
793797
add hl, bc ; HL = CHARS address
@@ -800,19 +804,19 @@ __PRGRAPH:
800804
ld b, 8 ; 8 bytes per char
801805
__PRCHAR:
802806
ld a, (de) ; DE *must* be ALWAYS source, and HL destiny
803-
PRINT_MODE: ; Which operation is used to write on the screen
807+
PRINT_MODE: ; Which operation is used to write on the screen
804808
; Set it with:
805809
; LD A, <OPERATION>
806810
; LD (PRINT_MODE), A
807811
;
808812
; Available opertions:
809-
; NORMAL: 0h --> NOP ; OVER 0
810-
; XOR : AEh --> XOR (HL) ; OVER 1
811-
; OR : B6h --> OR (HL) ; PUTSPRITE
812-
; AND : A6h --> AND (HL) ; PUTMASK
813-
nop ;
814-
INVERSE_MODE: ; 00 -> NOP -> INVERSE 0
815-
nop ; 2F -> CPL -> INVERSE 1
813+
; NORMAL : 0h --> NOP ; OVER 0
814+
; XOR : AEh --> XOR (HL) ; OVER 1
815+
; OR : B6h --> OR (HL) ; PUTSPRITE
816+
; AND : A6h --> AND (HL) ; PUTMASK
817+
nop ;
818+
INVERSE_MODE: ; 00 -> NOP -> INVERSE 0
819+
nop ; 2F -> CPL -> INVERSE 1
816820
ld (hl), a
817821
inc de
818822
inc h ; Next line
@@ -843,6 +847,8 @@ __PRINT_SPECIAL: ; Jumps here if it is a special char
843847
PRINT_EOL: ; Called WHENEVER there is no ";" at end of PRINT sentence
844848
exx
845849
__PRINT_0Dh: ; Called WHEN printing CHR$(13)
850+
call __SCROLL
851+
#line 209 "/zxbasic/library-asm/print.asm"
846852
call __LOAD_S_POSN
847853
__PRINT_EOL1: ; Another entry called from PRINT when next line required
848854
ld e, 0
@@ -1057,7 +1063,7 @@ LOOP:
10571063
djnz LOOP
10581064
ret
10591065
ENDP
1060-
PRINT_AT: ; CHanges cursor to ROW, COL
1066+
PRINT_AT: ; Changes cursor to ROW, COL
10611067
; COL in A register
10621068
; ROW in stack
10631069
pop hl ; Ret address
@@ -1066,6 +1072,8 @@ PRINT_AT: ; CHanges cursor to ROW, COL
10661072
ex de, hl
10671073
call __IN_SCREEN
10681074
ret nc ; Return if out of screen
1075+
ld hl, __TVFLAGS
1076+
res 1, (hl)
10691077
jp __SAVE_S_POSN
10701078
LOCAL __PRINT_COM
10711079
LOCAL __BOLD
@@ -1100,16 +1108,16 @@ __PRINT_TABLE: ; Jump table for 0 .. 22 codes
11001108
DW __PRINT_NOP ; 11
11011109
DW __PRINT_NOP ; 12
11021110
DW __PRINT_0Dh ; 13
1103-
DW __PRINT_BOLD ; 14
1111+
DW __PRINT_BOLD ; 14
11041112
DW __PRINT_ITA ; 15
11051113
DW __PRINT_INK ; 16
11061114
DW __PRINT_PAP ; 17
11071115
DW __PRINT_FLA ; 18
11081116
DW __PRINT_BRI ; 19
11091117
DW __PRINT_INV ; 20
11101118
DW __PRINT_OVR ; 21
1111-
DW __PRINT_AT ; 22 AT
1112-
DW __PRINT_TAB ; 23 TAB
1119+
DW __PRINT_AT ; 22 AT
1120+
DW __PRINT_TAB ; 23 TAB
11131121
ENDP
11141122
#line 53 "astore16.bas"
11151123
#line 1 "printu16.asm"

tests/functional/code00.asm

Lines changed: 32 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -979,34 +979,38 @@ __PRINTCHAR: ; Print character store in accumulator (A register)
979979
LOCAL __PRINT_UDG
980980
LOCAL __PRGRAPH
981981
LOCAL __PRINT_START
982-
LOCAL __NO_SCROLL
983982
LOCAL __ROM_SCROLL_SCR
984983
LOCAL __TVFLAGS
985984
__ROM_SCROLL_SCR EQU 0DFEh
986985
__TVFLAGS EQU 5C3Ch
987986
PRINT_JUMP_STATE EQU __PRINT_JUMP + 1
988987
__PRINT_JUMP:
989988
jp __PRINT_START ; Where to jump. If we print 22 (AT), next two calls jumps to AT1 and AT2 respectively
990-
__PRINT_START:
991-
cp ' '
992-
jp c, __PRINT_SPECIAL ; Characters below ' ' are special ones
993-
exx ; Switch to alternative registers
994-
ex af, af' ; Saves a value (char to print) for later
989+
LOCAL __SCROLL
990+
__SCROLL: ; Scroll?
995991
ld hl, __TVFLAGS
996992
bit 1, (hl)
997-
jp z, __NO_SCROLL
993+
ret z
998994
call __ROM_SCROLL_SCR
999995
ld hl, __TVFLAGS
1000996
res 1, (hl)
1001-
__NO_SCROLL:
997+
ret
998+
#line 75 "/zxbasic/library-asm/print.asm"
999+
__PRINT_START:
1000+
cp ' '
1001+
jp c, __PRINT_SPECIAL ; Characters below ' ' are special ones
1002+
exx ; Switch to alternative registers
1003+
ex af, af' ; Saves a value (char to print) for later
1004+
call __SCROLL
1005+
#line 86 "/zxbasic/library-asm/print.asm"
10021006
call __LOAD_S_POSN
10031007
; At this point we have the new coord
10041008
ld hl, (SCREEN_ADDR)
10051009
ld a, d
1006-
ld c, a ; Saves it for later
1010+
ld c, a ; Saves it for later
10071011
and 0F8h ; Masks 3 lower bit ; zy
10081012
ld d, a
1009-
ld a, c ; Recovers it
1013+
ld a, c ; Recovers it
10101014
and 07h ; MOD 7 ; y1
10111015
rrca
10121016
rrca
@@ -1034,9 +1038,9 @@ __PRINT_UDG:
10341038
__SRCADDR:
10351039
ld bc, (CHARS)
10361040
__PRGRAPH0:
1037-
add a, a ; A = a * 2 (since a < 80h) ; Thanks to Metalbrain at http://foro.speccy.org
1041+
add a, a ; A = a * 2 (since a < 80h) ; Thanks to Metalbrain at http://foro.speccy.org
10381042
ld l, a
1039-
ld h, 0 ; HL = a * 2 (accumulator)
1043+
ld h, 0 ; HL = a * 2 (accumulator)
10401044
add hl, hl
10411045
add hl, hl ; HL = a * 8
10421046
add hl, bc ; HL = CHARS address
@@ -1049,19 +1053,19 @@ __PRGRAPH:
10491053
ld b, 8 ; 8 bytes per char
10501054
__PRCHAR:
10511055
ld a, (de) ; DE *must* be ALWAYS source, and HL destiny
1052-
PRINT_MODE: ; Which operation is used to write on the screen
1056+
PRINT_MODE: ; Which operation is used to write on the screen
10531057
; Set it with:
10541058
; LD A, <OPERATION>
10551059
; LD (PRINT_MODE), A
10561060
;
10571061
; Available opertions:
1058-
; NORMAL: 0h --> NOP ; OVER 0
1059-
; XOR : AEh --> XOR (HL) ; OVER 1
1060-
; OR : B6h --> OR (HL) ; PUTSPRITE
1061-
; AND : A6h --> AND (HL) ; PUTMASK
1062-
nop ;
1063-
INVERSE_MODE: ; 00 -> NOP -> INVERSE 0
1064-
nop ; 2F -> CPL -> INVERSE 1
1062+
; NORMAL : 0h --> NOP ; OVER 0
1063+
; XOR : AEh --> XOR (HL) ; OVER 1
1064+
; OR : B6h --> OR (HL) ; PUTSPRITE
1065+
; AND : A6h --> AND (HL) ; PUTMASK
1066+
nop ;
1067+
INVERSE_MODE: ; 00 -> NOP -> INVERSE 0
1068+
nop ; 2F -> CPL -> INVERSE 1
10651069
ld (hl), a
10661070
inc de
10671071
inc h ; Next line
@@ -1092,6 +1096,8 @@ __PRINT_SPECIAL: ; Jumps here if it is a special char
10921096
PRINT_EOL: ; Called WHENEVER there is no ";" at end of PRINT sentence
10931097
exx
10941098
__PRINT_0Dh: ; Called WHEN printing CHR$(13)
1099+
call __SCROLL
1100+
#line 209 "/zxbasic/library-asm/print.asm"
10951101
call __LOAD_S_POSN
10961102
__PRINT_EOL1: ; Another entry called from PRINT when next line required
10971103
ld e, 0
@@ -1306,7 +1312,7 @@ LOOP:
13061312
djnz LOOP
13071313
ret
13081314
ENDP
1309-
PRINT_AT: ; CHanges cursor to ROW, COL
1315+
PRINT_AT: ; Changes cursor to ROW, COL
13101316
; COL in A register
13111317
; ROW in stack
13121318
pop hl ; Ret address
@@ -1315,6 +1321,8 @@ PRINT_AT: ; CHanges cursor to ROW, COL
13151321
ex de, hl
13161322
call __IN_SCREEN
13171323
ret nc ; Return if out of screen
1324+
ld hl, __TVFLAGS
1325+
res 1, (hl)
13181326
jp __SAVE_S_POSN
13191327
LOCAL __PRINT_COM
13201328
LOCAL __BOLD
@@ -1349,16 +1357,16 @@ __PRINT_TABLE: ; Jump table for 0 .. 22 codes
13491357
DW __PRINT_NOP ; 11
13501358
DW __PRINT_NOP ; 12
13511359
DW __PRINT_0Dh ; 13
1352-
DW __PRINT_BOLD ; 14
1360+
DW __PRINT_BOLD ; 14
13531361
DW __PRINT_ITA ; 15
13541362
DW __PRINT_INK ; 16
13551363
DW __PRINT_PAP ; 17
13561364
DW __PRINT_FLA ; 18
13571365
DW __PRINT_BRI ; 19
13581366
DW __PRINT_INV ; 20
13591367
DW __PRINT_OVR ; 21
1360-
DW __PRINT_AT ; 22 AT
1361-
DW __PRINT_TAB ; 23 TAB
1368+
DW __PRINT_AT ; 22 AT
1369+
DW __PRINT_TAB ; 23 TAB
13621370
ENDP
13631371
#line 4 "load.asm"
13641372
LOAD_CODE:

0 commit comments

Comments
 (0)