Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions library-asm/print.asm
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ __PRINTCHAR: ; Print character store in accumulator (A register)
LOCAL __PRINT_UDG
LOCAL __PRGRAPH
LOCAL __PRINT_START
LOCAL __NO_SCROLL
LOCAL __ROM_SCROLL_SCR
LOCAL __TVFLAGS

__ROM_SCROLL_SCR EQU 0DFEh
__TVFLAGS EQU 5C3Ch

PRINT_JUMP_STATE EQU __PRINT_JUMP + 1

Expand All @@ -60,9 +66,16 @@ __PRINT_START:
cp ' '
jp c, __PRINT_SPECIAL ; Characters below ' ' are special ones

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

ld hl, __TVFLAGS
bit 1, (hl)
jp z, __NO_SCROLL
call __ROM_SCROLL_SCR
ld hl, __TVFLAGS
res 1, (hl)
__NO_SCROLL:
call __LOAD_S_POSN

; At this point we have the new coord
Expand Down Expand Up @@ -196,7 +209,9 @@ __PRINT_AT1_END:
ld hl, (MAXY)
cp l
jr c, __PRINT_EOL_END ; Carry if (MAXY) < d
xor a
ld hl, __TVFLAGS
set 1, (hl)
ld a, d

__PRINT_EOL_END:
ld d, a
Expand Down
18 changes: 16 additions & 2 deletions tests/functional/astore16.asm
Original file line number Diff line number Diff line change
Expand Up @@ -730,14 +730,26 @@ __PRINTCHAR: ; Print character store in accumulator (A register)
LOCAL __PRINT_UDG
LOCAL __PRGRAPH
LOCAL __PRINT_START
LOCAL __NO_SCROLL
LOCAL __ROM_SCROLL_SCR
LOCAL __TVFLAGS
__ROM_SCROLL_SCR EQU 0DFEh
__TVFLAGS EQU 5C3Ch
PRINT_JUMP_STATE EQU __PRINT_JUMP + 1
__PRINT_JUMP:
jp __PRINT_START ; Where to jump. If we print 22 (AT), next two calls jumps to AT1 and AT2 respectively
__PRINT_START:
cp ' '
jp c, __PRINT_SPECIAL ; Characters below ' ' are special ones
exx ; Switch to alternative registers
exx ; Switch to alternative registers
ex af, af' ; Saves a value (char to print) for later
ld hl, __TVFLAGS
bit 1, (hl)
jp z, __NO_SCROLL
call __ROM_SCROLL_SCR
ld hl, __TVFLAGS
res 1, (hl)
__NO_SCROLL:
call __LOAD_S_POSN
; At this point we have the new coord
ld hl, (SCREEN_ADDR)
Expand Down Expand Up @@ -841,7 +853,9 @@ __PRINT_AT1_END:
ld hl, (MAXY)
cp l
jr c, __PRINT_EOL_END ; Carry if (MAXY) < d
xor a
ld hl, __TVFLAGS
set 1, (hl)
ld a, d
__PRINT_EOL_END:
ld d, a
__PRINT_AT2_END:
Expand Down
18 changes: 16 additions & 2 deletions tests/functional/code00.asm
Original file line number Diff line number Diff line change
Expand Up @@ -979,14 +979,26 @@ __PRINTCHAR: ; Print character store in accumulator (A register)
LOCAL __PRINT_UDG
LOCAL __PRGRAPH
LOCAL __PRINT_START
LOCAL __NO_SCROLL
LOCAL __ROM_SCROLL_SCR
LOCAL __TVFLAGS
__ROM_SCROLL_SCR EQU 0DFEh
__TVFLAGS EQU 5C3Ch
PRINT_JUMP_STATE EQU __PRINT_JUMP + 1
__PRINT_JUMP:
jp __PRINT_START ; Where to jump. If we print 22 (AT), next two calls jumps to AT1 and AT2 respectively
__PRINT_START:
cp ' '
jp c, __PRINT_SPECIAL ; Characters below ' ' are special ones
exx ; Switch to alternative registers
exx ; Switch to alternative registers
ex af, af' ; Saves a value (char to print) for later
ld hl, __TVFLAGS
bit 1, (hl)
jp z, __NO_SCROLL
call __ROM_SCROLL_SCR
ld hl, __TVFLAGS
res 1, (hl)
__NO_SCROLL:
call __LOAD_S_POSN
; At this point we have the new coord
ld hl, (SCREEN_ADDR)
Expand Down Expand Up @@ -1090,7 +1102,9 @@ __PRINT_AT1_END:
ld hl, (MAXY)
cp l
jr c, __PRINT_EOL_END ; Carry if (MAXY) < d
xor a
ld hl, __TVFLAGS
set 1, (hl)
ld a, d
__PRINT_EOL_END:
ld d, a
__PRINT_AT2_END:
Expand Down
18 changes: 16 additions & 2 deletions tests/functional/code01.asm
Original file line number Diff line number Diff line change
Expand Up @@ -979,14 +979,26 @@ __PRINTCHAR: ; Print character store in accumulator (A register)
LOCAL __PRINT_UDG
LOCAL __PRGRAPH
LOCAL __PRINT_START
LOCAL __NO_SCROLL
LOCAL __ROM_SCROLL_SCR
LOCAL __TVFLAGS
__ROM_SCROLL_SCR EQU 0DFEh
__TVFLAGS EQU 5C3Ch
PRINT_JUMP_STATE EQU __PRINT_JUMP + 1
__PRINT_JUMP:
jp __PRINT_START ; Where to jump. If we print 22 (AT), next two calls jumps to AT1 and AT2 respectively
__PRINT_START:
cp ' '
jp c, __PRINT_SPECIAL ; Characters below ' ' are special ones
exx ; Switch to alternative registers
exx ; Switch to alternative registers
ex af, af' ; Saves a value (char to print) for later
ld hl, __TVFLAGS
bit 1, (hl)
jp z, __NO_SCROLL
call __ROM_SCROLL_SCR
ld hl, __TVFLAGS
res 1, (hl)
__NO_SCROLL:
call __LOAD_S_POSN
; At this point we have the new coord
ld hl, (SCREEN_ADDR)
Expand Down Expand Up @@ -1090,7 +1102,9 @@ __PRINT_AT1_END:
ld hl, (MAXY)
cp l
jr c, __PRINT_EOL_END ; Carry if (MAXY) < d
xor a
ld hl, __TVFLAGS
set 1, (hl)
ld a, d
__PRINT_EOL_END:
ld d, a
__PRINT_AT2_END:
Expand Down
18 changes: 16 additions & 2 deletions tests/functional/code02.asm
Original file line number Diff line number Diff line change
Expand Up @@ -979,14 +979,26 @@ __PRINTCHAR: ; Print character store in accumulator (A register)
LOCAL __PRINT_UDG
LOCAL __PRGRAPH
LOCAL __PRINT_START
LOCAL __NO_SCROLL
LOCAL __ROM_SCROLL_SCR
LOCAL __TVFLAGS
__ROM_SCROLL_SCR EQU 0DFEh
__TVFLAGS EQU 5C3Ch
PRINT_JUMP_STATE EQU __PRINT_JUMP + 1
__PRINT_JUMP:
jp __PRINT_START ; Where to jump. If we print 22 (AT), next two calls jumps to AT1 and AT2 respectively
__PRINT_START:
cp ' '
jp c, __PRINT_SPECIAL ; Characters below ' ' are special ones
exx ; Switch to alternative registers
exx ; Switch to alternative registers
ex af, af' ; Saves a value (char to print) for later
ld hl, __TVFLAGS
bit 1, (hl)
jp z, __NO_SCROLL
call __ROM_SCROLL_SCR
ld hl, __TVFLAGS
res 1, (hl)
__NO_SCROLL:
call __LOAD_S_POSN
; At this point we have the new coord
ld hl, (SCREEN_ADDR)
Expand Down Expand Up @@ -1090,7 +1102,9 @@ __PRINT_AT1_END:
ld hl, (MAXY)
cp l
jr c, __PRINT_EOL_END ; Carry if (MAXY) < d
xor a
ld hl, __TVFLAGS
set 1, (hl)
ld a, d
__PRINT_EOL_END:
ld d, a
__PRINT_AT2_END:
Expand Down
18 changes: 16 additions & 2 deletions tests/functional/einarattr.asm
Original file line number Diff line number Diff line change
Expand Up @@ -545,14 +545,26 @@ __PRINTCHAR: ; Print character store in accumulator (A register)
LOCAL __PRINT_UDG
LOCAL __PRGRAPH
LOCAL __PRINT_START
LOCAL __NO_SCROLL
LOCAL __ROM_SCROLL_SCR
LOCAL __TVFLAGS
__ROM_SCROLL_SCR EQU 0DFEh
__TVFLAGS EQU 5C3Ch
PRINT_JUMP_STATE EQU __PRINT_JUMP + 1
__PRINT_JUMP:
jp __PRINT_START ; Where to jump. If we print 22 (AT), next two calls jumps to AT1 and AT2 respectively
__PRINT_START:
cp ' '
jp c, __PRINT_SPECIAL ; Characters below ' ' are special ones
exx ; Switch to alternative registers
exx ; Switch to alternative registers
ex af, af' ; Saves a value (char to print) for later
ld hl, __TVFLAGS
bit 1, (hl)
jp z, __NO_SCROLL
call __ROM_SCROLL_SCR
ld hl, __TVFLAGS
res 1, (hl)
__NO_SCROLL:
call __LOAD_S_POSN
; At this point we have the new coord
ld hl, (SCREEN_ADDR)
Expand Down Expand Up @@ -656,7 +668,9 @@ __PRINT_AT1_END:
ld hl, (MAXY)
cp l
jr c, __PRINT_EOL_END ; Carry if (MAXY) < d
xor a
ld hl, __TVFLAGS
set 1, (hl)
ld a, d
__PRINT_EOL_END:
ld d, a
__PRINT_AT2_END:
Expand Down
18 changes: 16 additions & 2 deletions tests/functional/einarshift.asm
Original file line number Diff line number Diff line change
Expand Up @@ -581,14 +581,26 @@ __PRINTCHAR: ; Print character store in accumulator (A register)
LOCAL __PRINT_UDG
LOCAL __PRGRAPH
LOCAL __PRINT_START
LOCAL __NO_SCROLL
LOCAL __ROM_SCROLL_SCR
LOCAL __TVFLAGS
__ROM_SCROLL_SCR EQU 0DFEh
__TVFLAGS EQU 5C3Ch
PRINT_JUMP_STATE EQU __PRINT_JUMP + 1
__PRINT_JUMP:
jp __PRINT_START ; Where to jump. If we print 22 (AT), next two calls jumps to AT1 and AT2 respectively
__PRINT_START:
cp ' '
jp c, __PRINT_SPECIAL ; Characters below ' ' are special ones
exx ; Switch to alternative registers
exx ; Switch to alternative registers
ex af, af' ; Saves a value (char to print) for later
ld hl, __TVFLAGS
bit 1, (hl)
jp z, __NO_SCROLL
call __ROM_SCROLL_SCR
ld hl, __TVFLAGS
res 1, (hl)
__NO_SCROLL:
call __LOAD_S_POSN
; At this point we have the new coord
ld hl, (SCREEN_ADDR)
Expand Down Expand Up @@ -692,7 +704,9 @@ __PRINT_AT1_END:
ld hl, (MAXY)
cp l
jr c, __PRINT_EOL_END ; Carry if (MAXY) < d
xor a
ld hl, __TVFLAGS
set 1, (hl)
ld a, d
__PRINT_EOL_END:
ld d, a
__PRINT_AT2_END:
Expand Down
18 changes: 16 additions & 2 deletions tests/functional/fact.asm
Original file line number Diff line number Diff line change
Expand Up @@ -738,14 +738,26 @@ __PRINTCHAR: ; Print character store in accumulator (A register)
LOCAL __PRINT_UDG
LOCAL __PRGRAPH
LOCAL __PRINT_START
LOCAL __NO_SCROLL
LOCAL __ROM_SCROLL_SCR
LOCAL __TVFLAGS
__ROM_SCROLL_SCR EQU 0DFEh
__TVFLAGS EQU 5C3Ch
PRINT_JUMP_STATE EQU __PRINT_JUMP + 1
__PRINT_JUMP:
jp __PRINT_START ; Where to jump. If we print 22 (AT), next two calls jumps to AT1 and AT2 respectively
__PRINT_START:
cp ' '
jp c, __PRINT_SPECIAL ; Characters below ' ' are special ones
exx ; Switch to alternative registers
exx ; Switch to alternative registers
ex af, af' ; Saves a value (char to print) for later
ld hl, __TVFLAGS
bit 1, (hl)
jp z, __NO_SCROLL
call __ROM_SCROLL_SCR
ld hl, __TVFLAGS
res 1, (hl)
__NO_SCROLL:
call __LOAD_S_POSN
; At this point we have the new coord
ld hl, (SCREEN_ADDR)
Expand Down Expand Up @@ -849,7 +861,9 @@ __PRINT_AT1_END:
ld hl, (MAXY)
cp l
jr c, __PRINT_EOL_END ; Carry if (MAXY) < d
xor a
ld hl, __TVFLAGS
set 1, (hl)
ld a, d
__PRINT_EOL_END:
ld d, a
__PRINT_AT2_END:
Expand Down
18 changes: 16 additions & 2 deletions tests/functional/for0.asm
Original file line number Diff line number Diff line change
Expand Up @@ -618,14 +618,26 @@ __PRINTCHAR: ; Print character store in accumulator (A register)
LOCAL __PRINT_UDG
LOCAL __PRGRAPH
LOCAL __PRINT_START
LOCAL __NO_SCROLL
LOCAL __ROM_SCROLL_SCR
LOCAL __TVFLAGS
__ROM_SCROLL_SCR EQU 0DFEh
__TVFLAGS EQU 5C3Ch
PRINT_JUMP_STATE EQU __PRINT_JUMP + 1
__PRINT_JUMP:
jp __PRINT_START ; Where to jump. If we print 22 (AT), next two calls jumps to AT1 and AT2 respectively
__PRINT_START:
cp ' '
jp c, __PRINT_SPECIAL ; Characters below ' ' are special ones
exx ; Switch to alternative registers
exx ; Switch to alternative registers
ex af, af' ; Saves a value (char to print) for later
ld hl, __TVFLAGS
bit 1, (hl)
jp z, __NO_SCROLL
call __ROM_SCROLL_SCR
ld hl, __TVFLAGS
res 1, (hl)
__NO_SCROLL:
call __LOAD_S_POSN
; At this point we have the new coord
ld hl, (SCREEN_ADDR)
Expand Down Expand Up @@ -729,7 +741,9 @@ __PRINT_AT1_END:
ld hl, (MAXY)
cp l
jr c, __PRINT_EOL_END ; Carry if (MAXY) < d
xor a
ld hl, __TVFLAGS
set 1, (hl)
ld a, d
__PRINT_EOL_END:
ld d, a
__PRINT_AT2_END:
Expand Down
18 changes: 16 additions & 2 deletions tests/functional/ifelse1.asm
Original file line number Diff line number Diff line change
Expand Up @@ -594,14 +594,26 @@ __PRINTCHAR: ; Print character store in accumulator (A register)
LOCAL __PRINT_UDG
LOCAL __PRGRAPH
LOCAL __PRINT_START
LOCAL __NO_SCROLL
LOCAL __ROM_SCROLL_SCR
LOCAL __TVFLAGS
__ROM_SCROLL_SCR EQU 0DFEh
__TVFLAGS EQU 5C3Ch
PRINT_JUMP_STATE EQU __PRINT_JUMP + 1
__PRINT_JUMP:
jp __PRINT_START ; Where to jump. If we print 22 (AT), next two calls jumps to AT1 and AT2 respectively
__PRINT_START:
cp ' '
jp c, __PRINT_SPECIAL ; Characters below ' ' are special ones
exx ; Switch to alternative registers
exx ; Switch to alternative registers
ex af, af' ; Saves a value (char to print) for later
ld hl, __TVFLAGS
bit 1, (hl)
jp z, __NO_SCROLL
call __ROM_SCROLL_SCR
ld hl, __TVFLAGS
res 1, (hl)
__NO_SCROLL:
call __LOAD_S_POSN
; At this point we have the new coord
ld hl, (SCREEN_ADDR)
Expand Down Expand Up @@ -705,7 +717,9 @@ __PRINT_AT1_END:
ld hl, (MAXY)
cp l
jr c, __PRINT_EOL_END ; Carry if (MAXY) < d
xor a
ld hl, __TVFLAGS
set 1, (hl)
ld a, d
__PRINT_EOL_END:
ld d, a
__PRINT_AT2_END:
Expand Down
Loading