; rdflsh.inc ; ; SPDX-FileCopyrightText: Copyright (C) 2019, 2021 Antonio Villena ; ; SPDX-License-Identifier: GPL-3.0-only ; Compatible compilers: ; SJAsmPlus, include zxuno.def ; ------------------------ ; Read from SPI flash ; Parameters: ; DE: destination address ; HL: source address without last byte ; A: number of pages (256 bytes) to read ; ------------------------ rdflsh ex af, af' xor a push hl wreg flash_cs, 0 ; activamos spi, enviando un 0 wreg flash_spi, 3 ; envio flash_spi un 3, orden de lectura pop hl push hl out (c), h out (c), l out (c), a ex af, af' ex de, hl in f, (c) rdfls1 ld e, $20 rdfls2 ini inc b ini inc b ini inc b ini inc b ini inc b ini inc b ini inc b ini inc b dec e jr nz, rdfls2 dec a jr nz, rdfls1 wreg flash_cs, 1 pop hl ret