@@ -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
843847PRINT_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"
0 commit comments