@@ -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
10921096PRINT_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"
13641372LOAD_CODE:
0 commit comments