Skip to content

Commit a29a018

Browse files
committed
Allow DISABLE_SCROLL macro
This will disable scroll if -D DISABLE_SCROLL is used or if #define DISABLE_SCROLL is used in the code
1 parent bbf2d36 commit a29a018

1 file changed

Lines changed: 18 additions & 8 deletions

File tree

library-asm/print.asm

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ __PRINTCHAR: ; Print character store in accumulator (A register)
5050
LOCAL __PRINT_UDG
5151
LOCAL __PRGRAPH
5252
LOCAL __PRINT_START
53-
LOCAL __NO_SCROLL
5453
LOCAL __ROM_SCROLL_SCR
5554
LOCAL __TVFLAGS
5655

@@ -62,20 +61,28 @@ PRINT_JUMP_STATE EQU __PRINT_JUMP + 1
6261
__PRINT_JUMP:
6362
jp __PRINT_START ; Where to jump. If we print 22 (AT), next two calls jumps to AT1 and AT2 respectively
6463

64+
#ifndef DISABLE_SCROLL
65+
LOCAL __SCROLL
66+
__SCROLL: ; Scroll?
67+
ld hl, __TVFLAGS
68+
bit 1, (hl)
69+
ret z
70+
call __ROM_SCROLL_SCR
71+
ld hl, __TVFLAGS
72+
res 1, (hl)
73+
ret
74+
#endif
75+
6576
__PRINT_START:
6677
cp ' '
6778
jp c, __PRINT_SPECIAL ; Characters below ' ' are special ones
6879

6980
exx ; Switch to alternative registers
7081
ex af, af' ; Saves a value (char to print) for later
7182

72-
ld hl, __TVFLAGS
73-
bit 1, (hl)
74-
jp z, __NO_SCROLL
75-
call __ROM_SCROLL_SCR
76-
ld hl, __TVFLAGS
77-
res 1, (hl)
78-
__NO_SCROLL:
83+
#ifndef DISABLE_SCROLL
84+
call __SCROLL
85+
#endif
7986
call __LOAD_S_POSN
8087

8188
; At this point we have the new coord
@@ -196,6 +203,9 @@ PRINT_EOL: ; Called WHENEVER there is no ";" at end of PRINT sentence
196203
exx
197204

198205
__PRINT_0Dh: ; Called WHEN printing CHR$(13)
206+
#ifndef DISABLE_SCROLL
207+
call __SCROLL
208+
#endif
199209
call __LOAD_S_POSN
200210

201211
__PRINT_EOL1: ; Another entry called from PRINT when next line required

0 commit comments

Comments
 (0)