utils: separated `Print` function into `Print.inc` file

This commit is contained in:
Ivan Tatarinov 2021-04-24 20:46:41 +03:00
parent fe2bda5950
commit 46f5d18b8b
12 changed files with 37 additions and 80 deletions

View File

@ -40,12 +40,14 @@ $(BUILD_DIR):
$(BUILD_DIR)/BACK16M: back16m.asm\
zxuno.def\
esxdos.def\
Print.inc\
| $(BUILD_DIR)
$(AS) $(AFLAGS) --raw=$@ $<
$(BUILD_DIR)/BACKZX2: back32m.asm\
zxuno.def\
esxdos.def\
Print.inc\
| $(BUILD_DIR)
echo ' define zxdos 1' >back32m.def
$(AS) $(AFLAGS) --raw=$@ $<
@ -54,6 +56,7 @@ $(BUILD_DIR)/BACKZX2: back32m.asm\
$(BUILD_DIR)/BACKZXD: back32m.asm\
zxuno.def\
esxdos.def\
Print.inc\
| $(BUILD_DIR)
echo ' define zxdos 0' >back32m.def
$(AS) $(AFLAGS) --raw=$@ $<
@ -62,41 +65,48 @@ $(BUILD_DIR)/BACKZXD: back32m.asm\
$(BUILD_DIR)/BACKUP: backup.asm\
zxuno.def\
esxdos.def\
Print.inc\
| $(BUILD_DIR)
$(AS) $(AFLAGS) --raw=$@ $<
$(BUILD_DIR)/CORCLEAN: corclean.asm\
zxuno.def\
Print.inc\
| $(BUILD_DIR)
$(AS) $(AFLAGS) --raw=$@ $<
$(BUILD_DIR)/COREBIOS: corebios.asm\
zxuno.def\
esxdos.def\
Print.inc\
| $(BUILD_DIR)
$(AS) $(AFLAGS) --raw=$@ $<
$(BUILD_DIR)/ROMSBACK: romsback.asm\
zxuno.def\
esxdos.def\
Print.inc\
| $(BUILD_DIR)
$(AS) $(AFLAGS) --raw=$@ $<
$(BUILD_DIR)/ROMSUPGR: romsupgr.asm\
zxuno.def\
esxdos.def\
Print.inc\
| $(BUILD_DIR)
$(AS) $(AFLAGS) --raw=$@ $<
$(BUILD_DIR)/UPGR16M: upgr16m.asm\
zxuno.def\
esxdos.def\
Print.inc\
| $(BUILD_DIR)
$(AS) $(AFLAGS) --raw=$@ $<
$(BUILD_DIR)/UPGRZX2: upgr32m.asm\
zxuno.def\
esxdos.def\
Print.inc\
| $(BUILD_DIR)
echo ' define zxdos 1' >upgr32m.def
$(AS) $(AFLAGS) --raw=$@ $<
@ -105,6 +115,7 @@ $(BUILD_DIR)/UPGRZX2: upgr32m.asm\
$(BUILD_DIR)/UPGRZXD: upgr32m.asm\
zxuno.def\
esxdos.def\
Print.inc\
| $(BUILD_DIR)
echo ' define zxdos 0' >upgr32m.def
$(AS) $(AFLAGS) --raw=$@ $<
@ -113,6 +124,7 @@ $(BUILD_DIR)/UPGRZXD: upgr32m.asm\
$(BUILD_DIR)/UPGRADE: upgrade.asm\
zxuno.def\
esxdos.def\
Print.inc\
| $(BUILD_DIR)
$(AS) $(AFLAGS) --raw=$@ $<

15
utils/Print.inc Normal file
View File

@ -0,0 +1,15 @@
; SPDX-FileCopyrightText: Copyright (C) 2019, 2021 Antonio Villena
;
; SPDX-License-Identifier: GPL-3.0-only
; Compatible compilers:
; SJAsmPlus, <https://github.com/sjasmplus/sjasmplus/>
Print pop hl
db $3e ; ld a,$nn
Print1 rst $10 ; db $d7
ld a, (hl)
inc hl
or a
jr nz, Print1
jp (hl)

View File

@ -118,14 +118,7 @@ WriteOK ld de, $0040
dz 13, 'Backup complete'
ret
Print pop hl
db $3e
Print1 rst $10
ld a, (hl)
inc hl
or a
jr nz, Print1
jp (hl)
include Print.inc
; ------------------------
; Read from SPI flash

View File

@ -152,14 +152,7 @@ WriteOK ld de, $0040
jr nc, Bucle
ret
Print pop hl
db $3e
Print1 rst $10
ld a, (hl)
inc hl
or a
jr nz, Print1
jp (hl)
include Print.inc
; ------------------------
; Read from SPI flash

View File

@ -102,14 +102,7 @@ WriteOK ld de, $0040
dz 13, 'Backup complete'
ret
Print pop hl
db $3e
Print1 rst $10
ld a, (hl)
inc hl
or a
jr nz, Print1
jp (hl)
include Print.inc
; ------------------------
; Read from SPI flash

View File

@ -72,14 +72,7 @@ normal ld a, 0
out (c), a
ret
Print pop hl
db $3e
Print1 rst $10
ld a, (hl)
inc hl
or a
jr nz, Print1
jp (hl)
include Print.inc
; ------------------------
; Read from SPI flash

View File

@ -130,14 +130,7 @@ normal ld a, 0
out (c), a
ret
Print pop hl
db $3e
Print1 rst $10
ld a, (hl)
inc hl
or a
jr nz, Print1
jp (hl)
include Print.inc
; ------------------------
; Read from SPI flash

View File

@ -152,14 +152,7 @@ wrear0 wreg flash_cs, 0 ; activamos spi, enviando un 0
wreg flash_cs, 1 ; desactivamos spi, enviando un 1
ret
Print pop hl
db $3e
Print1 rst $10
ld a, (hl)
inc hl
or a
jr nz, Print1
jp (hl)
include Print.inc
; ------------------------
; Read from SPI flash

View File

@ -179,14 +179,7 @@ wrear0 wreg flash_cs, 0 ; activamos spi, enviando un 0
wreg flash_cs, 1 ; desactivamos spi, enviando un 1
ret
Print pop hl
db $3e
Print1 rst $10
ld a, (hl)
inc hl
or a
jr nz, Print1
jp (hl)
include Print.inc
; ------------------------
; Read from SPI flash

View File

@ -124,14 +124,7 @@ ReadOK ld a, $40
dz 13, 'Upgrade complete'
ret
Print pop hl
db $3e
Print1 rst $10
ld a, (hl)
inc hl
or a
jr nz, Print1
jp (hl)
include Print.inc
; ------------------------
; Write to SPI flash

View File

@ -157,14 +157,7 @@ ReadOK ld a, $40
jr nz, Bucle
ret
Print pop hl
db $3e
Print1 rst $10
ld a, (hl)
inc hl
or a
jr nz, Print1
jp (hl)
include Print.inc
; ------------------------
; Write to SPI flash

View File

@ -107,14 +107,7 @@ ReadOK ld a, $40
dz 13, 'Upgrade complete'
ret
Print pop hl
db $3e
Print1 rst $10
ld a, (hl)
inc hl
or a
jr nz, Print1
jp (hl)
include Print.inc
; ------------------------
; Write to SPI flash