mirror of https://github.com/zxdos/zxuno.git
utils: small optimizations using DEFINE pseudo-op
This commit is contained in:
parent
363ea0a7a3
commit
fe2bda5950
|
@ -31,6 +31,8 @@
|
|||
include zxuno.def
|
||||
include esxdos.def
|
||||
|
||||
define FLASH_FILE "FLASH.ZX1"
|
||||
|
||||
org $2000 ; comienzo de la ejecución de los comandos ESXDOS
|
||||
|
||||
Main ld bc, zxuno_port
|
||||
|
@ -82,10 +84,10 @@ SDCard ld b, FA_WRITE | FA_OPEN_AL ; B = modo de apertura
|
|||
ld (handle+1), a
|
||||
jr nc, FileFound
|
||||
call Print
|
||||
dz 'Cannot open FLASH.ZX1'
|
||||
dz 'Cannot open ', FLASH_FILE
|
||||
ret
|
||||
FileFound call Print
|
||||
db 'Backing up FLASH.ZX1 to SD', 13
|
||||
db 'Backing up ', FLASH_FILE, ' to SD', 13
|
||||
dz '[', 6, ' ]', 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8
|
||||
ld hl, $0000
|
||||
Bucle push hl
|
||||
|
@ -177,4 +179,4 @@ rst28 ld bc, zxuno_port + $100
|
|||
outi
|
||||
jp (hl)
|
||||
|
||||
FileName dz 'FLASH.ZX1'
|
||||
FileName dz FLASH_FILE
|
||||
|
|
|
@ -42,6 +42,12 @@
|
|||
include zxuno.def
|
||||
include esxdos.def
|
||||
|
||||
IF zxdos=1
|
||||
define FLASH_FILE "FLASH.ZX2"
|
||||
ELSE
|
||||
define FLASH_FILE "FLASH.ZXD"
|
||||
ENDIF
|
||||
|
||||
org $2000 ; comienzo de la ejecución de los comandos ESXDOS
|
||||
|
||||
call wrear0
|
||||
|
@ -94,18 +100,10 @@ SDCard ld b, FA_WRITE | FA_OPEN_AL ; B = modo de apertura
|
|||
ld (handle+1), a
|
||||
jr nc, FileFound
|
||||
call Print
|
||||
IF zxdos=1
|
||||
dz 'Cannot open FLASH.ZX2'
|
||||
ELSE
|
||||
dz 'Cannot open FLASH.ZXD'
|
||||
ENDIF
|
||||
dz 'Cannot open ', FLASH_FILE
|
||||
ret
|
||||
FileFound call Print
|
||||
IF zxdos=1
|
||||
dz 'Backing up FLASH.ZX2 to SD', 13
|
||||
ELSE
|
||||
dz 'Backing up FLASH.ZXD to SD', 13
|
||||
ENDIF
|
||||
dz 'Backing up ', FLASH_FILE, ' to SD', 13
|
||||
call write16m
|
||||
wreg flash_cs, 0 ; activamos spi, enviando un 0
|
||||
wreg flash_spi, 6 ; envío write enable
|
||||
|
@ -215,8 +213,4 @@ rst28 ld bc, zxuno_port + $100
|
|||
outi
|
||||
jp (hl)
|
||||
|
||||
IF zxdos=1
|
||||
FileName dz 'FLASH.ZX2'
|
||||
ELSE
|
||||
FileName dz 'FLASH.ZXD'
|
||||
ENDIF
|
||||
FileName dz FLASH_FILE
|
||||
|
|
|
@ -26,6 +26,8 @@
|
|||
include zxuno.def
|
||||
include esxdos.def
|
||||
|
||||
define FLASH_FILE "FLASH.ZX1"
|
||||
|
||||
org $2000 ; comienzo de la ejecución de los comandos ESXDOS
|
||||
|
||||
Main ld bc, zxuno_port
|
||||
|
@ -65,10 +67,10 @@ SDCard ld b, FA_WRITE | FA_OPEN_AL ; B = modo de apertura
|
|||
ld (handle+1), a
|
||||
jr nc, FileFound
|
||||
call Print
|
||||
dz 'Cannot open FLASH.ZX1'
|
||||
dz 'Cannot open ', FLASH_FILE
|
||||
ret
|
||||
FileFound call Print
|
||||
db 'Backing up FLASH.ZX1 to SD', 13
|
||||
db 'Backing up ', FLASH_FILE, ' to SD', 13
|
||||
dz '[', 6, ' ]', 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8
|
||||
ld hl, $0000
|
||||
Bucle push hl
|
||||
|
@ -161,4 +163,4 @@ rst28 ld bc, zxuno_port + $100
|
|||
outi
|
||||
jp (hl)
|
||||
|
||||
FileName dz 'FLASH.ZX1'
|
||||
FileName dz FLASH_FILE
|
||||
|
|
|
@ -25,6 +25,8 @@
|
|||
|
||||
include zxuno.def
|
||||
|
||||
; define ROMS_FILE "ROMS.ZX1"
|
||||
|
||||
org $2000 ; comienzo de la ejecución de los comandos ESXDOS
|
||||
|
||||
Main ld bc, zxuno_port
|
||||
|
@ -200,4 +202,4 @@ rst28 ld bc, zxuno_port + $100
|
|||
outi
|
||||
jp (hl)
|
||||
|
||||
FileName dz 'ROMS.ZX1'
|
||||
;FileName dz ROMS_FILE
|
||||
|
|
|
@ -26,6 +26,9 @@
|
|||
include zxuno.def
|
||||
include esxdos.def
|
||||
|
||||
define CORE_FILE "SPECTRUM.ZX1"
|
||||
define BIOS_FILE "FIRMWARE.ZX1"
|
||||
|
||||
org $2000 ; comienzo de la ejecución de los comandos ESXDOS
|
||||
|
||||
Main ld bc, zxuno_port
|
||||
|
@ -56,7 +59,7 @@ SDCard ld (drive+1), a
|
|||
esxdos F_OPEN
|
||||
jr nc, FileFound
|
||||
call Print
|
||||
dz 'File SPECTRUM.ZX1 not found'
|
||||
dz 'File ', CORE_FILE, ' not found'
|
||||
ret
|
||||
FileFound ld (handle2+1), a
|
||||
drive: ld a, 0
|
||||
|
@ -65,7 +68,7 @@ drive: ld a, 0
|
|||
esxdos F_OPEN
|
||||
jr nc, FileFound2
|
||||
call Print
|
||||
dz 'File FIRMWARE.ZX1 not found'
|
||||
dz 'File ', BIOS_FILE, ' not found'
|
||||
ret
|
||||
FileFound2 ld (handle+1), a
|
||||
call Print
|
||||
|
@ -78,7 +81,7 @@ handle ld a, 0
|
|||
esxdos F_READ
|
||||
jr nc, GoodRead
|
||||
call Print
|
||||
dz 'Error reading FIRMWARE.ZX1'
|
||||
dz 'Error reading ', BIOS_FILE
|
||||
ret
|
||||
GoodRead ld a, (handle+1)
|
||||
esxdos F_CLOSE
|
||||
|
@ -105,7 +108,7 @@ handle2: ld a, 0
|
|||
esxdos F_READ
|
||||
jr nc, GoodRead2
|
||||
call Print
|
||||
dz 'Error reading SPECTRUM.ZX1'
|
||||
dz 'Error reading ', CORE_FILE
|
||||
ret
|
||||
GoodRead2 ld a, $40
|
||||
ld hl, $8000
|
||||
|
@ -257,5 +260,5 @@ rst28 ld bc, zxuno_port + $100
|
|||
outi
|
||||
jp (hl)
|
||||
|
||||
FileCore dz 'SPECTRUM.ZX1'
|
||||
FileBios dz 'FIRMWARE.ZX1'
|
||||
FileCore dz CORE_FILE
|
||||
FileBios dz BIOS_FILE
|
||||
|
|
|
@ -31,6 +31,8 @@
|
|||
include zxuno.def
|
||||
include esxdos.def
|
||||
|
||||
define ROMS_FILE "ROMS.ZX1"
|
||||
|
||||
org $2000 ; comienzo de la ejecución de los comandos ESXDOS
|
||||
|
||||
call wrear0
|
||||
|
@ -71,10 +73,10 @@ SDCard ld b, FA_WRITE | FA_OPEN_AL ; B = modo de apertura
|
|||
ld (handle+1), a
|
||||
jr nc, FileFound
|
||||
call Print
|
||||
dz 'Cannot open ROMS.ZX1'
|
||||
dz 'Cannot open ', ROMS_FILE
|
||||
ret
|
||||
FileFound call Print
|
||||
db 'Backing up ROMS.ZX1 to SD', 13
|
||||
db 'Backing up ', ROMS_FILE, ' to SD', 13
|
||||
dz '[', 6, ' ]', 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8
|
||||
wreg flash_cs, 0 ; activamos spi, enviando un 0
|
||||
wreg flash_spi, $9f ; jedec id
|
||||
|
@ -211,4 +213,4 @@ rst28 ld bc, zxuno_port + $100
|
|||
outi
|
||||
jp (hl)
|
||||
|
||||
FileName dz 'ROMS.ZX1'
|
||||
FileName dz ROMS_FILE
|
||||
|
|
|
@ -30,6 +30,8 @@
|
|||
include zxuno.def
|
||||
include esxdos.def
|
||||
|
||||
define ROMS_FILE "ROMS.ZX1"
|
||||
|
||||
org $2000 ; comienzo de la ejecución de los comandos ESXDOS
|
||||
|
||||
call wrear0
|
||||
|
@ -70,7 +72,7 @@ SDCard ld b, FA_READ ; B = modo de apertura
|
|||
ld (handle+1), a
|
||||
jr nc, FileFound
|
||||
call Print
|
||||
dz 'File ROMS.ZX1 not found'
|
||||
dz 'File ', ROMS_FILE, ' not found'
|
||||
ret
|
||||
FileFound wreg flash_cs, 0 ; activamos spi, enviando un 0
|
||||
wreg flash_spi, $9f ; jedec id
|
||||
|
@ -89,11 +91,11 @@ FileFound wreg flash_cs, 0 ; activamos spi, enviando un 0
|
|||
inc a
|
||||
jr nz, ZX2P
|
||||
call Print
|
||||
db 'Upgrading ROMS.ZX1 from SD', 13
|
||||
db 'Upgrading ', ROMS_FILE, ' from SD', 13
|
||||
dz '[ ]', 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8
|
||||
jr ZX2PC
|
||||
ZX2P call Print
|
||||
db 'Upgrading ROMS.ZX1 from SD', 13
|
||||
db 'Upgrading ', ROMS_FILE, ' from SD', 13
|
||||
dz '[', 6, ' ]', 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8
|
||||
ZX2PC ld a, ($8000)
|
||||
inc a
|
||||
|
@ -103,7 +105,7 @@ ZX2PC ld a, ($8000)
|
|||
ld ix, $1840
|
||||
jr ZX2cont
|
||||
ZX1 call Print
|
||||
db 'Upgrading ROMS.ZX1 from SD', 13
|
||||
db 'Upgrading ', ROMS_FILE, ' from SD', 13
|
||||
dz '[', 6, ' ]', 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8
|
||||
ld ix, $2e40
|
||||
ld iy, $34c0
|
||||
|
@ -307,4 +309,4 @@ rst28 ld bc, zxuno_port + $100
|
|||
outi
|
||||
jp (hl)
|
||||
|
||||
FileName dz 'ROMS.ZX1'
|
||||
FileName dz ROMS_FILE
|
||||
|
|
|
@ -29,6 +29,8 @@
|
|||
include zxuno.def
|
||||
include esxdos.def
|
||||
|
||||
define FLASH_FILE "FLASH.ZX1"
|
||||
|
||||
org $2000 ; comienzo de la ejecución de los comandos ESXDOS
|
||||
|
||||
Main ld bc, zxuno_port
|
||||
|
@ -80,10 +82,10 @@ SDCard ld b, FA_READ ; B = modo de apertura
|
|||
ld (handle+1), a
|
||||
jr nc, FileFound
|
||||
call Print
|
||||
dz 'File FLASH not found'
|
||||
dz 'File ', FLASH_FILE, ' not found'
|
||||
ret
|
||||
FileFound call Print
|
||||
db 'Upgrading FLASH.ZX1 from SD', 13
|
||||
db 'Upgrading ', FLASH_FILE, ' from SD', 13
|
||||
dz '[', 6, ' ]', 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8
|
||||
ld ix, $0400
|
||||
ld de, $0000
|
||||
|
@ -208,4 +210,4 @@ rst28 ld bc, zxuno_port + $100
|
|||
outi
|
||||
jp (hl)
|
||||
|
||||
FileName dz 'FLASH.ZX1'
|
||||
FileName dz FLASH_FILE
|
||||
|
|
|
@ -39,6 +39,12 @@
|
|||
include zxuno.def
|
||||
include esxdos.def
|
||||
|
||||
IF zxdos=1
|
||||
define FLASH_FILE "FLASH.ZX2"
|
||||
ELSE
|
||||
define FLASH_FILE "FLASH.ZXD"
|
||||
ENDIF
|
||||
|
||||
org $2000 ; comienzo de la ejecución de los comandos ESXDOS
|
||||
|
||||
call wrear0
|
||||
|
@ -91,18 +97,10 @@ SDCard ld b, FA_READ ; B = modo de apertura
|
|||
ld (handle+1), a
|
||||
jr nc, FileFound
|
||||
call Print
|
||||
IF zxdos=1
|
||||
dz 'Cannot open FLASH.ZX2'
|
||||
ELSE
|
||||
dz 'Cannot open FLASH.ZXD'
|
||||
ENDIF
|
||||
dz 'Cannot open ', FLASH_FILE
|
||||
ret
|
||||
FileFound call Print
|
||||
IF zxdos=1
|
||||
dz 'Upgrading FLASH.ZX2 from SD', 13
|
||||
ELSE
|
||||
dz 'Upgrading FLASH.ZXD from SD', 13
|
||||
ENDIF
|
||||
dz 'Upgrading ', FLASH_FILE, ' from SD', 13
|
||||
call read16m
|
||||
wreg flash_cs, 0 ; activamos spi, enviando un 0
|
||||
wreg flash_spi, 6 ; envío write enable
|
||||
|
@ -245,8 +243,4 @@ rst28 ld bc, zxuno_port + $100
|
|||
outi
|
||||
jp (hl)
|
||||
|
||||
IF zxdos=1
|
||||
FileName dz 'FLASH.ZX2'
|
||||
ELSE
|
||||
FileName dz 'FLASH.ZXD'
|
||||
ENDIF
|
||||
FileName dz FLASH_FILE
|
||||
|
|
|
@ -26,6 +26,8 @@
|
|||
include zxuno.def
|
||||
include esxdos.def
|
||||
|
||||
define FLASH_FILE "FLASH.ZX1"
|
||||
|
||||
org $2000 ; comienzo de la ejecución de los comandos ESXDOS
|
||||
|
||||
Main ld bc, zxuno_port
|
||||
|
@ -65,10 +67,10 @@ SDCard ld b, FA_READ ; B = modo de apertura
|
|||
ld (handle+1), a
|
||||
jr nc, FileFound
|
||||
call Print
|
||||
dz 'File FLASH not found'
|
||||
dz 'File ', FLASH_FILE, ' not found'
|
||||
ret
|
||||
FileFound call Print
|
||||
db 'Upgrading FLASH.ZX1 from SD', 13
|
||||
db 'Upgrading ', FLASH_FILE, ' from SD', 13
|
||||
dz '[', 6, ' ]', 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8
|
||||
ld ixl, 0
|
||||
ld de, $0000
|
||||
|
@ -191,4 +193,4 @@ rst28 ld bc, zxuno_port + $100
|
|||
outi
|
||||
jp (hl)
|
||||
|
||||
FileName dz 'FLASH.ZX1'
|
||||
FileName dz FLASH_FILE
|
||||
|
|
Loading…
Reference in New Issue