From 363ea0a7a3554bd81761a6172dcbd41e657a8db8 Mon Sep 17 00:00:00 2001 From: Ivan Tatarinov Date: Sat, 24 Apr 2021 20:01:38 +0300 Subject: [PATCH] utils: used `esxdos` macro when possible --- utils/backup.asm | 12 ++++-------- utils/corebios.asm | 21 +++++++-------------- utils/upgrade.asm | 12 ++++-------- 3 files changed, 15 insertions(+), 30 deletions(-) diff --git a/utils/backup.asm b/utils/backup.asm index 2640efa..059b018 100644 --- a/utils/backup.asm +++ b/utils/backup.asm @@ -54,16 +54,14 @@ normal ld a, 0 out (c), a ret init xor a - rst $08 - db M_GETSETDRV ; A = unidad actual + esxdos M_GETSETDRV ; A = unidad actual jr nc, SDCard call Print dz 'SD card not inserted' ret SDCard ld b, FA_WRITE | FA_OPEN_AL ; B = modo de apertura ld hl, FileName ; HL = Puntero al nombre del fichero (ASCIIZ) - rst $08 - db F_OPEN + esxdos F_OPEN ld (handle+1), a jr nc, FileFound call Print @@ -87,8 +85,7 @@ Bucle push hl punto ld hl, $8000 ld bc, $4000 handle ld a, 0 - rst $08 - db F_WRITE + esxdos F_WRITE pop hl jr nc, WriteOK call Print @@ -98,8 +95,7 @@ WriteOK ld de, $0040 add hl, de bit 6, h jr z, Bucle - rst $08 - db F_CLOSE + esxdos F_CLOSE call Print dz 13, 'Backup complete' ret diff --git a/utils/corebios.asm b/utils/corebios.asm index a183acd..120495f 100644 --- a/utils/corebios.asm +++ b/utils/corebios.asm @@ -45,8 +45,7 @@ Nonlock ld a, scandbl_ctrl or $80 out (c), a xor a - rst $08 - db M_GETSETDRV ; A = unidad actual + esxdos M_GETSETDRV ; A = unidad actual jr nc, SDCard call Print dz 'SD card not inserted' @@ -54,8 +53,7 @@ Nonlock ld a, scandbl_ctrl SDCard ld (drive+1), a ld b, FA_READ ; B = modo de apertura ld hl, FileCore ; HL = Puntero al nombre del fichero (ASCIIZ) - rst $08 - db F_OPEN + esxdos F_OPEN jr nc, FileFound call Print dz 'File SPECTRUM.ZX1 not found' @@ -64,8 +62,7 @@ FileFound ld (handle2+1), a drive: ld a, 0 ld b, FA_READ ; B = modo de apertura ld hl, FileBios ; HL = Puntero al nombre del fichero (ASCIIZ) - rst $08 - db F_OPEN + esxdos F_OPEN jr nc, FileFound2 call Print dz 'File FIRMWARE.ZX1 not found' @@ -78,15 +75,13 @@ FileFound2 ld (handle+1), a ld hl, $8000 ld bc, $4000 handle ld a, 0 - rst $08 - db F_READ + esxdos F_READ jr nc, GoodRead call Print dz 'Error reading FIRMWARE.ZX1' ret GoodRead ld a, (handle+1) - rst $08 - db F_CLOSE + esxdos F_CLOSE ld a, $40 ld hl, $8000 exx @@ -107,8 +102,7 @@ Bucle ld a, ixl punto ld hl, $8000 ld bc, $4000 handle2: ld a, 0 - rst $08 - db F_READ + esxdos F_READ jr nc, GoodRead2 call Print dz 'Error reading SPECTRUM.ZX1' @@ -122,8 +116,7 @@ GoodRead2 ld a, $40 dec ixl jr nz, Bucle ld a, (handle2+1) - rst $08 - db F_CLOSE + esxdos F_CLOSE call Print dz 13, 'Upgrade complete', 13 ld bc, zxuno_port diff --git a/utils/upgrade.asm b/utils/upgrade.asm index 7331817..d153389 100644 --- a/utils/upgrade.asm +++ b/utils/upgrade.asm @@ -54,16 +54,14 @@ normal ld a, 0 out (c), a ret init xor a - rst $08 - db M_GETSETDRV ; A = unidad actual + esxdos M_GETSETDRV ; A = unidad actual jr nc, SDCard call Print dz 'SD card not inserted' ret SDCard ld b, FA_READ ; B = modo de apertura ld hl, FileName ; HL = Puntero al nombre del fichero (ASCIIZ) - rst $08 - db F_OPEN + esxdos F_OPEN ld (handle+1), a jr nc, FileFound call Print @@ -88,8 +86,7 @@ Bucle ld a, ixl punto ld hl, $8000 ld bc, $4000 handle ld a, 0 - rst $08 - db F_READ + esxdos F_READ jr nc, ReadOK call Print dz 'Read Error' @@ -103,8 +100,7 @@ ReadOK ld a, $40 dec ixl jr nz, Bucle ld a, (handle+1) - rst $08 - db F_CLOSE + esxdos F_CLOSE call Print dz 13, 'Upgrade complete' ret