diff --git a/firmware/FIRMWARE.ZX1 b/firmware/FIRMWARE.ZX1 index c9dc5f3..749cd31 100644 Binary files a/firmware/FIRMWARE.ZX1 and b/firmware/FIRMWARE.ZX1 differ diff --git a/firmware/bootloader.asm b/firmware/bootloader.asm index 6fae9c4..3961c5f 100644 --- a/firmware/bootloader.asm +++ b/firmware/bootloader.asm @@ -13,30 +13,23 @@ define scandbl_ctrl 11 di - ld sp, $bfff-67 - ld de, $c761 ; tras el out (c), h de bffc se ejecuta + ld sp, $bfff-ini+6 + ld de, $c771 ; tras el out (c), h de bffc se ejecuta push de ; un rst 0 para iniciar la nueva ROM ld de, $ed80 ; en $bffc para evitar que el cambio de ROM + push de ; colisione con la siguiente instruccion + ld bc, $bffc-ini+6 + push bc wreg joyconf, %00010000 - jr lspi - -ldedg2 rst $18 ; call routine ld-edge-1 below. - jr nz, ldedg1 - ret - -lspi in a, ($1f) - jr lspi2 - -ldedg1 ld a, $16 ; a delay value of twenty two. -ldelay dec a ; decrement counter - jr nz, ldelay ; loop back to ld-delay 22 times. -lsampl inc b ; increment the time-out counter. - ret z ; return with failure when $ff passed. - in a, ($fe) ; row $7ffe. bit 6 is ear, bit 0 is space key. - xor c ; compare with initial long-term state. - and $40 ; isolate bit 5 - jr z, lsampl ; back to ld-sample if no edge. - jr lcont + wreg master_mapper, 8 ; paginamos la ROM en $c000 + wreg scandbl_ctrl, $c0 ; lo pongo a 28MHz + in a, ($1f) + cp %00011000 ; arriba y disparo a la vez + jr z, recov + cp %00010100 ; arriba y disparo a la vez + jr z, recov + wreg flash_cs, 1 ; desactivamos spi, enviando un 0 + jr cont rst28 ld bc, zxuno_port + $100 pop hl @@ -45,18 +38,17 @@ rst28 ld bc, zxuno_port + $100 outi jp (hl) -lspi2 wreg scandbl_ctrl, $c0 ; lo pongo a 28MHz - push de ; colisione con la siguiente instruccion - defb $fe +getbit ld a, (hl) + dec hl + adc a, a + ret + nop rst38 jp $c006 -lspi3 wreg flash_cs, 1 ; desactivamos spi, enviando un 0 - wreg master_mapper, 8 ; paginamos la ROM en $c000 - wreg flash_cs, 0 ; activamos spi, enviando un 0 +cont wreg flash_cs, 0 ; activamos spi, enviando un 0 wreg flash_spi, 3 ; envio flash_spi un 3, orden de lectura - and c - out (c), h ; envia direccion 008000, a=00,e=80,a=00 +ini out (c), h ; envia direccion 008000, a=00,e=80,a=00 out (c), e out (c), h add hl, sp @@ -64,87 +56,31 @@ boot ini inc b cp h ; compruebo si la direccion es 0000 (final) jr c, boot ; repito si no lo es - wreg scandbl_ctrl, 0 ; lo pongo a 3.5MHz - dec b - out (c), h ; a master_conf quiero enviar un 0 para pasar +boot1 dec b + out (c), 0 ; a master_conf quiero enviar un 0 para pasar inc b - cp %00011000 ; arriba y disparo a la vez - ld de, $bffc-67 - push de - ld ixh, e - jr nbreak + ret + +recov ld hl, firmware-1 + ld de, $ffff + push bc + call dzx7b + pop bc + jr boot1 + + defb 'AV2018' nmi66 jp $c003 retn -lcont ld a, c ; fetch comparison value. - xor $47 ; switch the bits - ld c, a ; and put back in c for long-term. - out ($fe), a ; send to port to effect the change of colour. - ret ; return. - -nbreak ret nz - ld de, $0051+2 - call lbytes - ld ix, $c000 - ld de, $4000+2 -lbytes ld a, $0f ; make the border white and mic off. - out ($fe), a ; output to port. - ld c, 10 -lstart rst $18 ; routine ld-edge-1 - jr z, lstart ; back to ld-break with time out and no edge present on tape - xor a ; set up 8-bit outer loop counter for approx 0.45 second delay -ldwait add hl, hl - djnz ldwait ; self loop to ld-wait (for 256 times) - dec a ; decrease outer loop counter. - jr nz, ldwait ; back to ld-wait, if not zero, with zero in b. - rst $10 ; routine ld-edge-2 - jr z, lstart ; back to ld-break if no edges at all. -leader ld b, $9c ; two edges must be spaced apart. - rst $10 ; routine ld-edge-2 - jr z, lstart ; back to ld-break if time-out - ld a, $c6 ; two edges must be spaced apart. - cp b ; compare - jr nc, lstart ; back to ld-start if too close together for a lead-in. - inc h ; proceed to test 256 edged sample. - jr nz, leader ; back to ld-leader while more to do. -ldsync ld b, $c9 ; two edges must be spaced apart. - rst $18 ; routine ld-edge-1 - jr z, lstart ; back to ld-break with time-out. - ld a, b ; fetch augmented timing value from b. - cp $d4 ; compare - jr nc, ldsync ; back to ld-sync if gap too big, that is, a normal lead-in edge gap - rst $18 ; routine ld-edge-1 - jr z, binf - xor 3 - ld c, a -ldloop ld (ix-2), l ; place loaded byte at memory location. - inc ix ; increment byte pointer. - dec de ; decrement length. - ld l, $01 ; initialize as %00000001 -l8bits ld b, $b2 ; timing. - rst $10 ; routine ld-edge-2 increments b relative to gap between 2 edges -binf jr z, binf ; return with time-out. - ld a, $cb ; the comparison byte. - cp b ; compare to incremented value of b. - rl l ; rotate the carry bit into l. - jr nc, l8bits ; jump back to ld-8-bits - ld a, h ; fetch the running parity byte. - xor l ; include the new byte. - ld h, a ; and store back in parity register. - ld a, d ; check length of - or e ; expected bytes. - jr nz, ldloop ; back to ld-loop while there are more. - or h -bin2 jr nz, bin2 - ld bc, zxuno_port + $100 - ret ; return block $0100 - $ include scroll/define.asm ld sp, 0 ld de, $5e6d+filesize-1 - ld hl, fin-1 + ld hl, scroll-1 + call dzx7b + jp $7be4 ; ----------------------------------------------------------------------------- ; ZX7 Backwards by Einar Saukas, Antonio Villena @@ -189,12 +125,10 @@ offend rr e lddr exitdz pop hl jr nc, mainlo - jp $7be4 - -getbit ld a, (hl) - dec hl - adc a, a ret + incbin firmware.rom.zx7b +firmware incbin scroll/scroll.bin.zx7b -fin ;block $4000 - $ +scroll + ;block $4000 - $ diff --git a/firmware/firmware.asm b/firmware/firmware.asm index c05b3be..3ccebb7 100644 --- a/firmware/firmware.asm +++ b/firmware/firmware.asm @@ -1,6 +1,8 @@ include version.asm define LX16 $32 define recovery 0 + define recodire 0 + define zesarux 0 define vertical 0 output firmware_strings.rom macro wreg dir, dato @@ -174,7 +176,11 @@ keysc5 ld a, h rlc b jr c, keyscn in a, ($1f) + IF zesarux=0 or a + ELSE + xor a + ENDIF jr z, nokemp ld hl, kemp-1 sikemp inc hl @@ -237,6 +243,7 @@ keytab defb $00, $7a, $78, $63, $76 ; Caps z x c v defb $0d, $3d, $2b, $2d, $5e ; Enter = + - ^ defb $20, $00, $2e, $2c, $2a ; Space Symbol . , * kemp defb $1f, $1e, $1d, $1c, $0d ; Right Left Down Up Enter + defb $0c ; Break start ld bc, chrend-sdtab ldir @@ -406,6 +413,7 @@ star10 add hl, hl jr nz, star10 ld (alto fllen), hl ENDIF + IF recovery=0 star11 ld a, (layout) rr a ld hl, fines-1 @@ -422,9 +430,7 @@ star14 inc b outi bit 4, h ; compruebo si la direccion es D000 (final) jr z, star14 ; repito si no lo es -star15 - IF recovery=0 - ld d, 4 +star15 ld d, 4 pop af jr nz, star16 ld d, 16 @@ -2071,13 +2077,17 @@ upgr38 ld e, a ld a, (bitstr) upgra4 ld hl, $0102 ld d, $18 + IF recodire=0 call combol + ELSE + ld a, 2 + ENDIF ld (menuop+1), a inc a ld iyl, a + IF recovery=0 ld a, (codcnt) cp $0d - IF recovery=0 jp nz, main9 ENDIF ld hl, (menuop) @@ -2097,8 +2107,14 @@ tosd ld ix, cad75 ENDIF call imyesn ld ix, cad445 + IF recodire=0 call yesno ret nz + ELSE + ld c, 8 + call_prnstr + call_prnstr + ENDIF ld d, h ld a, %01001111 ; fondo azul tinta blanca call window diff --git a/firmware/strings.asm b/firmware/strings.asm index 938d78f..fe1835c 100644 --- a/firmware/strings.asm +++ b/firmware/strings.asm @@ -1,6 +1,6 @@ cad0 defb 'Core: ',0 cad1 defb 'http://zxuno.speccy.org', 0 - defb 'ZX-Uno BIOS v0.73', 0 + defb 'ZX-Uno BIOS v0.74', 0 defb 'Copyleft ', 127, ' 2018 ZX-Uno Team', 0 defb 'Processor: Z80 3.5MHz', 0 defb 'Memory: ' @@ -37,7 +37,7 @@ cad8 defb $10, ' ', $10, ' ', $10, 0 cad9 defb $14, $11, $11, $11, $11, $11, $11, $11, $11, $11, $11, $11, $11, $11 defb $11, $11, $11, $11, $11, $11, $11, $11, $11, $11, $11, $11, $18, $11 defb $11, $11, $11, $11, $11, $11, $11, $11, $11, $11, $11, $11, $11, $15, 0 - defb ' BIOS v0.73 ', $7f, '2018 ZX-Uno Team', 0 + defb ' BIOS v0.74 ', $7f, '2018 ZX-Uno Team', 0 ELSE defb 'Press to Setup',0 defb ' Boot Menu', 0 @@ -68,7 +68,7 @@ cad8 defb $10, ' ', $10, 0 cad9 defb $14, $11, $11, $11, $11, $11, $11, $11, $11, $11, $11, $11, $11, $11 defb $11, $11, $11, $11 defb $11, $11, $11, $11, $11, $11, $11, $11, $11, $11, $11, $11, $11, $15, 0 - defb ' BIOS v0.73 ', $7f, '2018 ZX1 Team', 0 + defb ' BIOS v0.74 ', $7f, '2018 ZX1 Team', 0 defs $66 ENDIF cad10 defb 'Hardware tests', 0