From f6ed807bf9356b6423d83b2249cc78e9500307b3 Mon Sep 17 00:00:00 2001 From: Ivan Tatarinov Date: Wed, 5 May 2021 12:06:51 +0300 Subject: [PATCH 1/2] firmware/scroll: extracted `playstc.bin` and `music.stc` from `music.bin` --- firmware/scroll/music.stc | Bin 0 -> 2037 bytes firmware/scroll/playstc.bin | Bin 0 -> 1078 bytes 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 firmware/scroll/music.stc create mode 100644 firmware/scroll/playstc.bin diff --git a/firmware/scroll/music.stc b/firmware/scroll/music.stc new file mode 100644 index 0000000000000000000000000000000000000000..15804e3439a3c296dcc6ae772a7cc8ff984fe030 GIT binary patch literal 2037 zcmc&zy>HV%6n~EGICh=1nHXSbl_-r{*|DNTQK}4vitr&yE0v`iC=F67B}z*-25v<{ z8DaIEfvR+2W@2LCFF>pa1T!#)cRt&+MQw!|MDF+Q&hOs6kNdr3p2`REnzFun``YZ4 zjoI}(v&*Y1Yd3CP{i#XW1u&P$B?~S(#Hz#m0;x6NaslA&gaC4efJQ(iAQMQ1kO;s8 z0gB_piVuAsp7?O!!+RgT`S8_$_Qikm$^S5cSfEbqK~8#DNM}6|Fg*~M@*siX0YVRv z@jwfa_5h)Jpu~_p5J-8DK=J?qpqm5`Qy~ljh7Wp(j1Ph)WQxOwbO>baPbdTuAg2O? zSpY*P@K13;&7yyiZ8}U(By+gC&f8#+OP=UhEPRb)wI?n8cR@jyK!Oww8Ha*H#c}3O z0!2F&=ubNp@{couOq*ar1iqj|BU+?gWm z+bTL}U8ZGbQ5#+LhKo3(qcSdWDX+rh1JuMtu-+q^E;5@(i#M)A2i$d^PaXHULwh0$ zWi8GF%n0!S literal 0 HcmV?d00001 diff --git a/firmware/scroll/playstc.bin b/firmware/scroll/playstc.bin new file mode 100644 index 0000000000000000000000000000000000000000..fbc81487f4257dc781ab2916a0084231e9058765 GIT binary patch literal 1078 zcmaKqe`p(J7{{OYl3W_QrLDzk=Cr+>x|tS)gOyT~D%(U*u-M908Khx4o#=CSg~<`D zXZ<<wzB!-t!w0_2Itx@ST+Jh&MJ=lXM@rqj~P`Di|8<)bTQ1}$X(-PeZF5tF*4hmwB?~p`Z4y zeZ5+P&2_x;f4jN~GPyu@0psF6af$3%4lEgMFnsj&VH%=3F<%Kb&-3ylrp9ygL3ww% z{aG64s1EDpl_s|KSISKaHHn-v7mVJ^*e{&MOtD8!^+%=4_}o2kuYKSIh8`1jNmG-N z2_$}C=WznD2d6iqNN<)IH0UmFh3Yk`aYpYHJM9(wq{Raitl|&MA5|QT$!5szqL@jum$(`8$>Bt9h?d zeJy{NQax7OqZB@3v#C}Sv!+ZnLc0NIx4%O)3W-JX6huy;^YQdW4?W^7IVO>{Yewoe zuAnZme-$}dH~8ogo_1HkH5JCB5{kMgT}P&o#ngYDC1;%OkLF@As`=Mhy#3K~JJq0a zk;XlApI1mgNRR!|uGDo=k20f?oV_?I6(GHZ^i>@)i3#a5|ANfNz^f?y=z`gSk(bx6P}xVH;adXWT)Vd}!O`J1 z5Z+Zo>|QQ?TQLvr^qS)#W5OOVHiFH;#MZGbR~vUWzJ1e5AQ8CHFw}6vKk9Grr}+o@ zUwrTR_WCxwX|L+-@~(I?o;N&0o(|7%T%H@}M!6xbhil_D$aOMLrpR&f5;;U3Cw-)g zY$uK6FZdNoP=FkK4m0oxdcJ7?A3D_3Hvj+t literal 0 HcmV?d00001 From fea6c0f304d3dc6f361810993f1dcf399adc5b77 Mon Sep 17 00:00:00 2001 From: Ivan Tatarinov Date: Wed, 5 May 2021 16:19:34 +0300 Subject: [PATCH 2/2] firmware/scroll: added legal stuff --- firmware/scroll/fondo.atr.license | 9 + firmware/scroll/fondo.png.license | 9 + firmware/scroll/fuente6x8.png.license | 9 + firmware/scroll/lineas.asm | 7 + firmware/scroll/loader.asm | 185 +++---- firmware/scroll/music.stc.license | 11 + firmware/scroll/playstc.bin.license | 9 + firmware/scroll/scroll.asm | 700 +++++++++++++------------- firmware/scroll/scroll.bat | 5 +- firmware/scroll/scrolldesc.asm | 127 ++--- firmware/scroll/string.asm | 13 +- firmware/scroll/upgrade.asm | 677 +++++++++++++------------ 12 files changed, 947 insertions(+), 814 deletions(-) create mode 100644 firmware/scroll/fondo.atr.license create mode 100644 firmware/scroll/fondo.png.license create mode 100644 firmware/scroll/fuente6x8.png.license create mode 100644 firmware/scroll/music.stc.license create mode 100644 firmware/scroll/playstc.bin.license diff --git a/firmware/scroll/fondo.atr.license b/firmware/scroll/fondo.atr.license new file mode 100644 index 0000000..ca0382f --- /dev/null +++ b/firmware/scroll/fondo.atr.license @@ -0,0 +1,9 @@ +SPDX-FileName: fondo.atr + +SPDX-FileType: OTHER + +SPDX-FileChecksum: SHA1: 9214a48d573cfe87145d32a461a0c3f6abccfdc6 + +SPDX-FileCopyrightText: Copyright (C) 2016 Samuel Baselga (a.k.a. Quest) + +SPDX-License-Identifier: CC-BY-SA-4.0 diff --git a/firmware/scroll/fondo.png.license b/firmware/scroll/fondo.png.license new file mode 100644 index 0000000..ffdcc00 --- /dev/null +++ b/firmware/scroll/fondo.png.license @@ -0,0 +1,9 @@ +SPDX-FileName: fondo.png + +SPDX-FileType: IMAGE + +SPDX-FileChecksum: SHA1: f3ad5c77329ae235982fbd67feb8c0d85269e37c + +SPDX-FileCopyrightText: Copyright (C) 2016 Samuel Baselga (a.k.a. Quest) + +SPDX-License-Identifier: CC-BY-SA-4.0 diff --git a/firmware/scroll/fuente6x8.png.license b/firmware/scroll/fuente6x8.png.license new file mode 100644 index 0000000..77e134c --- /dev/null +++ b/firmware/scroll/fuente6x8.png.license @@ -0,0 +1,9 @@ +SPDX-FileName: fuente6x8.png + +SPDX-FileType: IMAGE + +SPDX-FileChecksum: SHA1: 740d34e262db2f3fa2989592027d1907f861ba37 + +SPDX-FileCopyrightText: Copyright (C) 2016 Samuel Baselga (a.k.a. Quest) + +SPDX-License-Identifier: CC-BY-SA-4.0 diff --git a/firmware/scroll/lineas.asm b/firmware/scroll/lineas.asm index 8e162cc..911b6b3 100644 --- a/firmware/scroll/lineas.asm +++ b/firmware/scroll/lineas.asm @@ -1,3 +1,10 @@ +; SPDX-FileCopyrightText: Copyright (C) 2016, 2017, 2020, 2021 Antonio Villena +; +; SPDX-License-Identifier: GPL-3.0-only + +; Compatible compilers: +; SJAsmPlus, + macro linea src1, src2, src3, dst1, dst2, dst3 ld sp, $4005+$800*src1+$100*src3+$20*src2 pop hl diff --git a/firmware/scroll/loader.asm b/firmware/scroll/loader.asm index 1e32839..4555c66 100644 --- a/firmware/scroll/loader.asm +++ b/firmware/scroll/loader.asm @@ -1,89 +1,96 @@ - include define.asm - output loader.bin - org $5ccb - ld de, $8000 - di - defb $de, $c0, $37, $0e, $8f, $39, $96 ; Basic de Paolo Ferraris - ld hl, finload-1 - ld de, $baff - call dzx7b - inc hl - inc hl - ld bc, $4000 ; filtro RCS inverso (jamorski) - ld a, b -init xor c - and $f8 - xor c - ld d, a - xor b - xor c - rlca - rlca - ld e, a -init2 inc bc - ldi - inc bc - ld a, b - cp $58 - jr c, init - sub $5b - jr nz, init2 - ld hl, $5e6d-2 - ld de, compsize - call $07f4 - di - ld de, $5e6d+rawsize-1 - ld hl, $5e6d-2+compsize-1 - call dzx7b - jp $7be4 - -; ----------------------------------------------------------------------------- -; ZX7 Backwards by Einar Saukas, Antonio Villena -; Parameters: -; HL: source address (compressed data) -; DE: destination address (decompressing) -; ----------------------------------------------------------------------------- -dzx7b ld bc, $8000 - ld a, b -copyby inc c - ldd -mainlo add a, a - call z, getbit - jr nc, copyby - push de - ld d, c - defb $30 -lenval add a, a - call z, getbit - rl c - rl b - add a, a - call z, getbit - jr nc, lenval - inc c - jr z, exitdz - ld e, (hl) - dec hl - sll e - jr nc, offend - ld d, $10 -nexbit add a, a - call z, getbit - rl d - jr nc, nexbit - inc d - srl d -offend rr e - ex (sp), hl - ex de, hl - adc hl, de - lddr -exitdz pop hl - jr nc, mainlo -getbit ld a, (hl) - dec hl - adc a, a - ret - -loadscr incbin loadscr.rcs.zx7b -finload +; SPDX-FileCopyrightText: Copyright (C) 2016, 2017, 2020, 2021 Antonio Villena +; +; SPDX-License-Identifier: GPL-3.0-only + +; Compatible compilers: +; SJAsmPlus, + + include define.asm + output loader.bin + org $5ccb + ld de, $8000 + di + defb $de, $c0, $37, $0e, $8f, $39, $96 ; Basic de Paolo Ferraris + ld hl, finload-1 + ld de, $baff + call dzx7b + inc hl + inc hl + ld bc, $4000 ; filtro RCS inverso (jamorski) + ld a, b +init xor c + and $f8 + xor c + ld d, a + xor b + xor c + rlca + rlca + ld e, a +init2 inc bc + ldi + inc bc + ld a, b + cp $58 + jr c, init + sub $5b + jr nz, init2 + ld hl, $5e6d-2 + ld de, compsize + call $07f4 + di + ld de, $5e6d+rawsize-1 + ld hl, $5e6d-2+compsize-1 + call dzx7b + jp $7be4 + +; ----------------------------------------------------------------------------- +; ZX7 Backwards by Einar Saukas, Antonio Villena +; Parameters: +; HL: source address (compressed data) +; DE: destination address (decompressing) +; ----------------------------------------------------------------------------- +dzx7b ld bc, $8000 + ld a, b +copyby inc c + ldd +mainlo add a, a + call z, getbit + jr nc, copyby + push de + ld d, c + defb $30 +lenval add a, a + call z, getbit + rl c + rl b + add a, a + call z, getbit + jr nc, lenval + inc c + jr z, exitdz + ld e, (hl) + dec hl + sll e + jr nc, offend + ld d, $10 +nexbit add a, a + call z, getbit + rl d + jr nc, nexbit + inc d + srl d +offend rr e + ex (sp), hl + ex de, hl + adc hl, de + lddr +exitdz pop hl + jr nc, mainlo +getbit ld a, (hl) + dec hl + adc a, a + ret + +loadscr incbin loadscr.rcs.zx7b +finload diff --git a/firmware/scroll/music.stc.license b/firmware/scroll/music.stc.license new file mode 100644 index 0000000..fd63d12 --- /dev/null +++ b/firmware/scroll/music.stc.license @@ -0,0 +1,11 @@ +SPDX-FileName: music.stc + +SPDX-FileType: OTHER + +SPDX-FileChecksum: SHA1: c45309ee13cc7cb0cbb7becb2eda9ecc4d905788 + +SPDX-FileCopyrightText: Copyright (C) 2016 Michal B. (a.k.a Yerzmyey) + +SPDX-License-Identifier: CC-BY-SA-4.0 + +SPDX-FileComment: https://zxart.ee/eng/authors/y/yerzmyey/ diff --git a/firmware/scroll/playstc.bin.license b/firmware/scroll/playstc.bin.license new file mode 100644 index 0000000..06edc42 --- /dev/null +++ b/firmware/scroll/playstc.bin.license @@ -0,0 +1,9 @@ +SPDX-FileName: playstc.bin + +SPDX-FileType: BINARY + +SPDX-FileChecksum: SHA1: 163afa437d12a65e0b78a4cfddf87959ca1502ee + +SPDX-FileCopyrightText: Copyright (C) 2016 Antonio Villena + +SPDX-License-Identifier: GPL-3.0-only diff --git a/firmware/scroll/scroll.asm b/firmware/scroll/scroll.asm index 506141a..9a1f426 100644 --- a/firmware/scroll/scroll.asm +++ b/firmware/scroll/scroll.asm @@ -1,336 +1,364 @@ - output scroll.bin - org $5e6d - display $6d35+string-music -string include string.asm -music ld (vari+2), ix - incbin music.bin -fuente incbin fuente6x8.bin -start ld hl, $c000 - ld de, $c001 - ld bc, $017f - ld (hl), l - ldir - ld hl, fuente - ld b, 3 - ldir - ld hl, fondo - ld b, $40 ; filtro RCS inverso -start0 ld a, b - xor c - and $f8 - xor c - ld d, a - xor b - xor c - rlca - rlca - ld e, a - inc bc - ldi - inc bc - ld a, b - sub $58 - jr nz, start0 - ld b, 3 - ldir - out ($fe), a - inc a - ex af, af' -; ld de, $401f -;rever ld hl, $ffe1 -; add hl, de -; ld c, (hl) -; ld a, $80 -;revl1 rl c -; rra -; jr nc, revl1 -; ld (de), a -; inc hl -; dec de -; ld c, (hl) -; ld a, $80 -;revl2 rl c -; rra -; jr nc, revl2 -; ld (de), a -; inc hl -; dec de -; ld c, (hl) -; ld a, $80 -;revl3 rl c -; rra -; jr nc, revl3 -; ld (de), a -; inc hl -; dec de -; ld c, (hl) -; ld a, $80 -;revl4 rl c -; rra -; jr nc, revl4 -; ld (de), a -; ld hl, $23 -; add hl, de -; ex de, hl -; ld a, d -; cp $58 -; jr nz, rever - - ld hl, $c000 - ld de, $c400 -start1 ld b, $08 -start2 ld a, (hl) - rrca - ld (de), a - inc de - cpi - jp pe, start2 - jr nc, start1 - ld a, $c9 - ld ($c006), a - ld hl, $716f - call music+7 -start3 call $6e77 - ei - halt - di - ld bc, 5 -start4 djnz start4 - dec c - jr nz, start4 - include lineas.asm - ld sp, $401b+$800*2+$100*7+$20*7 - sbc hl, hl - push hl - push hl - push hl - push hl - push hl - push hl - push hl - push hl - push hl - push hl - push hl - ld sp, hl -vari ld ix, string - ld hl, start3 - push hl - ld hl, music - push hl - ex af, af' - rrca - jr c, start5 - ex af, af' - ret -start5 ex af, af' - linea 3, 1, 0, 3, 0, 0 - linea 3, 2, 0, 3, 1, 0 - linea 3, 3, 0, 3, 2, 0 - linea 3, 4, 0, 3, 3, 0 - linea 3, 5, 0, 3, 4, 0 - linea 3, 6, 0, 3, 5, 0 - linea 3, 7, 0, 3, 6, 0 - linea 3, 0, 1, 3, 7, 0 - linea 3, 1, 1, 3, 0, 1 - linea 3, 2, 1, 3, 1, 1 - linea 3, 3, 1, 3, 2, 1 - linea 3, 4, 1, 3, 3, 1 - linea 3, 5, 1, 3, 4, 1 - linea 3, 6, 1, 3, 5, 1 - linea 3, 7, 1, 3, 6, 1 - linea 3, 0, 2, 3, 7, 1 - linea 3, 1, 2, 3, 0, 2 - linea 3, 2, 2, 3, 1, 2 - linea 3, 3, 2, 3, 2, 2 - linea 3, 4, 2, 3, 3, 2 - linea 3, 5, 2, 3, 4, 2 - linea 3, 6, 2, 3, 5, 2 - ld sp, $fffc - ld b, (ix) - djnz start6 - ld ix, string -start6 inc ix - ld hl, $5ac5 - ld (hl), b - ld de, $5ac6 - ld bc, 21 - ldir - xor a - push ix - pop hl - ld bc, $172b - cpir - srl c - ld a, c - jr c, prn2 - and %11111100 - ld d, a - xor c - ld c, a - ld e, a - jr z, prn1 - dec e -prn1 ld a, d - rrca - ld d, a - rrca - add a, d - add a, e - ld e, a - ld a, b - and %00011000 - or %01000000 - ld d, a - ld a, b - and %00000111 - rrca - rrca - rrca - add a, e - ld e, a - rr c - jr c, pos26 - jr nz, pos4 -pos0 ld a, (ix) - inc ix - add a, a - ret z - ld h, $c0 >> 2 - call simple -pos2 ld a, (ix) - inc ix - add a, a - ret z - ld h, $d8 >> 2 - ld bc, $04fc - call doble -pos4 ld a, (ix) - inc ix - add a, a - ret z - ld h, $d0 >> 2 - ld bc, $04f0 - call doble -pos6 ld a, (ix) - inc ix - add a, a - ret z - ld h, $c8 >> 2 - call simple - inc de - jr pos0 -pos26 rr c - jr c, pos6 - jr pos2 -prn2 and %11111100 - ld d, a - xor c - ld c, a - cp 2 - adc a, -1 - ld e, a - ld a, d - rrca - ld d, a - rrca - add a, d - add a, e - ld e, a - ld a, b - and %00011000 - or %01000000 - ld d, a - ld a, b - and %00000111 - rrca - rrca - rrca - add a, e - ld e, a - rr c - jr c, pos37 - jr nz, pos5 -pos1 ld a, (ix) - inc ix - add a, a - ret z - ld h, $cc >> 2 - ld bc, $04e0 - call doble -pos3 ld a, (ix) - inc ix - add a, a - ret z - ld h, $c4 >> 2 - call simple -pos5 ld a, (ix) - inc ix - add a, a - ret z - ld h, $dc >> 2 - ld bc, $04fe - call doble -pos7 ld a, (ix) - inc ix - add a, a - ret z - ld h, $d4 >> 2 - ld bc, $04f8 - call doble - jr pos1 -pos37 rr c - jr c, pos7 - jr pos3 - -simple ld b, 4 - ld l, a - add hl, hl - add hl, hl -simple2 ld a, (de) - xor (hl) - ld (de), a - inc d - inc l - ld a, (de) - xor (hl) - ld (de), a - inc d - inc l - djnz simple2 - ld hl, $f800 - add hl, de - ex de, hl - ret - -doble ld l, a - add hl, hl - add hl, hl -doble2 ld a, (de) - xor (hl) - and c - xor (hl) - ld (de), a - inc e - ld a, (hl) - and c - ld (de), a - inc d - inc l - ld a, (hl) - and c - ld (de), a - dec e - ld a, (de) - xor (hl) - and c - xor (hl) - ld (de), a - inc d - inc l - djnz doble2 - ld hl, $f801 - add hl, de - ex de, hl - ret -fondo incbin fondo.rcs +; scroll.asm - an easteg egg showing the list of people who participated +; in the crowdfunding of the ZX-Uno project through Verkami: +; https://www.verkami.com/projects/14074-zx-uno +; +; We put the nick that they agreed. Some of them decided to put their +; complete names. +; +; Copyright (C) 2016, 2017, 2020, 2021 Antonio Villena +; +; This program is free software: you can redistribute it and/or modify +; it under the terms of the GNU General Public License as published by +; the Free Software Foundation, version 3. +; +; This program is distributed in the hope that it will be useful, +; but WITHOUT ANY WARRANTY; without even the implied warranty of +; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +; GNU General Public License for more details. +; +; You should have received a copy of the GNU General Public License +; along with this program. If not, see . +; +; SPDX-FileCopyrightText: Copyright (C) 2016, 2017, 2020, 2021 Antonio Villena +; +; SPDX-License-Identifier: GPL-3.0-only + +; Compatible compilers: +; SJAsmPlus, + + output scroll.bin + org $5e6d + display $6d35+string-music +string include string.asm +music ld (vari+2), ix + incbin music.bin +fuente incbin fuente6x8.bin +start ld hl, $c000 + ld de, $c001 + ld bc, $017f + ld (hl), l + ldir + ld hl, fuente + ld b, 3 + ldir + ld hl, fondo + ld b, $40 ; filtro RCS inverso +start0 ld a, b + xor c + and $f8 + xor c + ld d, a + xor b + xor c + rlca + rlca + ld e, a + inc bc + ldi + inc bc + ld a, b + sub $58 + jr nz, start0 + ld b, 3 + ldir + out ($fe), a + inc a + ex af, af' +; ld de, $401f +;rever ld hl, $ffe1 +; add hl, de +; ld c, (hl) +; ld a, $80 +;revl1 rl c +; rra +; jr nc, revl1 +; ld (de), a +; inc hl +; dec de +; ld c, (hl) +; ld a, $80 +;revl2 rl c +; rra +; jr nc, revl2 +; ld (de), a +; inc hl +; dec de +; ld c, (hl) +; ld a, $80 +;revl3 rl c +; rra +; jr nc, revl3 +; ld (de), a +; inc hl +; dec de +; ld c, (hl) +; ld a, $80 +;revl4 rl c +; rra +; jr nc, revl4 +; ld (de), a +; ld hl, $23 +; add hl, de +; ex de, hl +; ld a, d +; cp $58 +; jr nz, rever + + ld hl, $c000 + ld de, $c400 +start1 ld b, $08 +start2 ld a, (hl) + rrca + ld (de), a + inc de + cpi + jp pe, start2 + jr nc, start1 + ld a, $c9 + ld ($c006), a + ld hl, $716f + call music+7 +start3 call $6e77 + ei + halt + di + ld bc, 5 +start4 djnz start4 + dec c + jr nz, start4 + include lineas.asm + ld sp, $401b+$800*2+$100*7+$20*7 + sbc hl, hl + push hl + push hl + push hl + push hl + push hl + push hl + push hl + push hl + push hl + push hl + push hl + ld sp, hl +vari ld ix, string + ld hl, start3 + push hl + ld hl, music + push hl + ex af, af' + rrca + jr c, start5 + ex af, af' + ret +start5 ex af, af' + linea 3, 1, 0, 3, 0, 0 + linea 3, 2, 0, 3, 1, 0 + linea 3, 3, 0, 3, 2, 0 + linea 3, 4, 0, 3, 3, 0 + linea 3, 5, 0, 3, 4, 0 + linea 3, 6, 0, 3, 5, 0 + linea 3, 7, 0, 3, 6, 0 + linea 3, 0, 1, 3, 7, 0 + linea 3, 1, 1, 3, 0, 1 + linea 3, 2, 1, 3, 1, 1 + linea 3, 3, 1, 3, 2, 1 + linea 3, 4, 1, 3, 3, 1 + linea 3, 5, 1, 3, 4, 1 + linea 3, 6, 1, 3, 5, 1 + linea 3, 7, 1, 3, 6, 1 + linea 3, 0, 2, 3, 7, 1 + linea 3, 1, 2, 3, 0, 2 + linea 3, 2, 2, 3, 1, 2 + linea 3, 3, 2, 3, 2, 2 + linea 3, 4, 2, 3, 3, 2 + linea 3, 5, 2, 3, 4, 2 + linea 3, 6, 2, 3, 5, 2 + ld sp, $fffc + ld b, (ix) + djnz start6 + ld ix, string +start6 inc ix + ld hl, $5ac5 + ld (hl), b + ld de, $5ac6 + ld bc, 21 + ldir + xor a + push ix + pop hl + ld bc, $172b + cpir + srl c + ld a, c + jr c, prn2 + and %11111100 + ld d, a + xor c + ld c, a + ld e, a + jr z, prn1 + dec e +prn1 ld a, d + rrca + ld d, a + rrca + add a, d + add a, e + ld e, a + ld a, b + and %00011000 + or %01000000 + ld d, a + ld a, b + and %00000111 + rrca + rrca + rrca + add a, e + ld e, a + rr c + jr c, pos26 + jr nz, pos4 +pos0 ld a, (ix) + inc ix + add a, a + ret z + ld h, $c0 >> 2 + call simple +pos2 ld a, (ix) + inc ix + add a, a + ret z + ld h, $d8 >> 2 + ld bc, $04fc + call doble +pos4 ld a, (ix) + inc ix + add a, a + ret z + ld h, $d0 >> 2 + ld bc, $04f0 + call doble +pos6 ld a, (ix) + inc ix + add a, a + ret z + ld h, $c8 >> 2 + call simple + inc de + jr pos0 +pos26 rr c + jr c, pos6 + jr pos2 +prn2 and %11111100 + ld d, a + xor c + ld c, a + cp 2 + adc a, -1 + ld e, a + ld a, d + rrca + ld d, a + rrca + add a, d + add a, e + ld e, a + ld a, b + and %00011000 + or %01000000 + ld d, a + ld a, b + and %00000111 + rrca + rrca + rrca + add a, e + ld e, a + rr c + jr c, pos37 + jr nz, pos5 +pos1 ld a, (ix) + inc ix + add a, a + ret z + ld h, $cc >> 2 + ld bc, $04e0 + call doble +pos3 ld a, (ix) + inc ix + add a, a + ret z + ld h, $c4 >> 2 + call simple +pos5 ld a, (ix) + inc ix + add a, a + ret z + ld h, $dc >> 2 + ld bc, $04fe + call doble +pos7 ld a, (ix) + inc ix + add a, a + ret z + ld h, $d4 >> 2 + ld bc, $04f8 + call doble + jr pos1 +pos37 rr c + jr c, pos7 + jr pos3 + +simple ld b, 4 + ld l, a + add hl, hl + add hl, hl +simple2 ld a, (de) + xor (hl) + ld (de), a + inc d + inc l + ld a, (de) + xor (hl) + ld (de), a + inc d + inc l + djnz simple2 + ld hl, $f800 + add hl, de + ex de, hl + ret + +doble ld l, a + add hl, hl + add hl, hl +doble2 ld a, (de) + xor (hl) + and c + xor (hl) + ld (de), a + inc e + ld a, (hl) + and c + ld (de), a + inc d + inc l + ld a, (hl) + and c + ld (de), a + dec e + ld a, (de) + xor (hl) + and c + xor (hl) + ld (de), a + inc d + inc l + djnz doble2 + ld hl, $f801 + add hl, de + ex de, hl + ret +fondo incbin fondo.rcs diff --git a/firmware/scroll/scroll.bat b/firmware/scroll/scroll.bat index 27fe7b4..fa9e9b0 100644 --- a/firmware/scroll/scroll.bat +++ b/firmware/scroll/scroll.bat @@ -1,5 +1,8 @@ +@rem SPDX-FileCopyrightText: 2016, 2021 Antonio Villena +@rem +@rem SPDX-License-Identifier: GPL-3.0-only @call ..\..\sdk\setenv.bat -FuenteABin +FuenteABin fuente6x8.png fuente6x8.bin Png2Rcs fondo.png fondo.rcs -a fondo.atr sjasmplus scroll.asm call :getfilesize scroll.bin diff --git a/firmware/scroll/scrolldesc.asm b/firmware/scroll/scrolldesc.asm index a21fd64..3d3f584 100644 --- a/firmware/scroll/scrolldesc.asm +++ b/firmware/scroll/scrolldesc.asm @@ -1,59 +1,68 @@ - include define.asm - output scrolldesc.bin - org $5ccb - ld de, $5e6d+filesize-1 - di - defb $de, $c0, $37, $0e, $8f, $39, $96 - jr aqui -getbit ld a, (hl) - dec hl - adc a, a - ret -aqui ld hl, fin-1 - -; ----------------------------------------------------------------------------- -; ZX7 Backwards by Einar Saukas, Antonio Villena -; Parameters: -; HL: source address (compressed data) -; DE: destination address (decompressing) -; ----------------------------------------------------------------------------- -dzx7b ld bc, $8000 - ld a, b -copyby inc c - ldd -mainlo add a, a - call z, getbit - jr nc, copyby - push de - ld d, c - defb $30 -lenval add a, a - call z, getbit - rl c - rl b - add a, a - call z, getbit - jr nc, lenval - inc c - jr z, exitdz - ld e, (hl) - dec hl - sll e - jr nc, offend - ld d, $10 -nexbit add a, a - call z, getbit - rl d - jr nc, nexbit - inc d - srl d -offend rr e - ex (sp), hl - ex de, hl - adc hl, de - lddr -exitdz pop hl - jr nc, mainlo - jp $7be4 - incbin scroll.bin.zx7b -fin \ No newline at end of file +; scrolldesc.asm +; +; SPDX-FileCopyrightText: Copyright (C) 2016, 2017, 2020, 2021 Antonio Villena +; +; SPDX-License-Identifier: GPL-3.0-only + +; Compatible compilers: +; SJAsmPlus, + + include define.asm + output scrolldesc.bin + org $5ccb + ld de, $5e6d+filesize-1 + di + defb $de, $c0, $37, $0e, $8f, $39, $96 + jr aqui +getbit ld a, (hl) + dec hl + adc a, a + ret +aqui ld hl, fin-1 + +; ----------------------------------------------------------------------------- +; ZX7 Backwards by Einar Saukas, Antonio Villena +; Parameters: +; HL: source address (compressed data) +; DE: destination address (decompressing) +; ----------------------------------------------------------------------------- +dzx7b ld bc, $8000 + ld a, b +copyby inc c + ldd +mainlo add a, a + call z, getbit + jr nc, copyby + push de + ld d, c + defb $30 +lenval add a, a + call z, getbit + rl c + rl b + add a, a + call z, getbit + jr nc, lenval + inc c + jr z, exitdz + ld e, (hl) + dec hl + sll e + jr nc, offend + ld d, $10 +nexbit add a, a + call z, getbit + rl d + jr nc, nexbit + inc d + srl d +offend rr e + ex (sp), hl + ex de, hl + adc hl, de + lddr +exitdz pop hl + jr nc, mainlo + jp $7be4 + incbin scroll.bin.zx7b +fin diff --git a/firmware/scroll/string.asm b/firmware/scroll/string.asm index ca83c07..5d9fc01 100644 --- a/firmware/scroll/string.asm +++ b/firmware/scroll/string.asm @@ -1,3 +1,12 @@ +; string.asm +; +; SPDX-FileCopyrightText: Copyright (C) 2016, 2017, 2020, 2021 Antonio Villena +; +; SPDX-License-Identifier: GPL-3.0-only + +; Compatible compilers: +; SJAsmPlus, + ; 01234567 01234567 01234567 01234567 ; abcdefab cdefabcd efabcdef 0642 ; abcde fabcdefa bcdefabc def 3175 @@ -187,7 +196,7 @@ dz $48, 'Pagantipaco' dz $48, 'Pedro Romero' dz $48, 'Peter Robert Jones' - dz $48, 'Peter \'Sweetlilmre\' Edwards' + dz $48, "Peter 'Sweetlilmre' Edwards" dz $48, 'peterthedark' dz $48, 'princemegahit' dz $48, 'Radastan' @@ -280,4 +289,4 @@ dz $48 dz $48 dz $48 - defb 1 \ No newline at end of file + defb 1 diff --git a/firmware/scroll/upgrade.asm b/firmware/scroll/upgrade.asm index 0b52654..c6abb75 100644 --- a/firmware/scroll/upgrade.asm +++ b/firmware/scroll/upgrade.asm @@ -1,327 +1,350 @@ - output UPGRADE - - define FA_READ 0x01 - define M_GETSETDRV 0x89 - define F_OPEN 0x9a - define F_CLOSE 0x9b - define F_READ 0x9d - define F_SEEK 0x9f - - define zxuno_port $fc3b - define flash_spi 2 - define flash_cs 48 - - macro wreg dir, dato - call rst28 - defb dir, dato - endm - - org $2000 ; comienzo de la ejecución de los comandos ESXDOS - -Main xor a - rst $08 - db 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 - ld (handle+1), a - jr nc, FileFound - call Print - dz 'File FLASH not found' - ret -FileFound ld l, 0 - ld bc, 0 - ld de, 0 - rst $08 - db F_SEEK - call Print - dz 'No ' - ld a, (puerto+2) - add a, $30 - rst $10 - call repe - jr nz, nfallo -; call hex - call Print - dz 'Flash error' - jr Next -nfallo halt - halt - ;jr Verify;call hex - ld ixl, 0 - ld de, $0000 - exx -Bucle ld a, ixl - inc a - and $0f - jr nz, punto - ld a, '.' - exx - push de - rst $10 - pop de - exx -punto ld hl, $8000 - ld bc, $4000 -handle ld a, 0 - rst $08 - db F_READ - jr nc, ReadOK - call Print - dz 'Read Error' - ret -ReadOK ld a, $40 - ld hl, $8000 - exx - call wrflsh - inc de - exx - dec ixl - jr nz, Bucle - - halt - halt - -Verify ld de, $8000 - ld hl, $0040 - ld a, 2 - call rdflsh - ld de, $8000 - ld hl, 0 -Verify1 ex de, hl - ld c, (hl) - inc l - ld b, (hl) - inc hl - ex de, hl - add hl, bc - bit 1, d - jr z, Verify1 - ld a, h - call hex - ld a, l - call hex - halt - halt - -; ld de, $371a -; sbc hl, de -; jr z, Next -; call Print -; dz 'CRC Error' -Next ld a, 13 - rst $10 - ld a, (puerto+2) - inc a - ld (puerto+2), a - cp $10 - ld a, (handle+1) - jp nz, FileFound - rst $08 - db F_CLOSE - ret - -Print pop hl - db $3e -Print1 rst $10 - ld a, (hl) - inc hl - or a - jr nz, Print1 - jp (hl) - -; ------------------------ -; Write to SPI flash -; Parameters: -; A: number of pages (256 bytes) to write -; DE: target address without last byte -; BC': zxuno_port+$100 (constant) -; HL': source address from memory -; ------------------------ -wrflsh ex af, af' -wrfls1 call puerto - wreg flash_spi, 6 ; envío write enable - call flashcs - call puerto - wreg flash_spi, $20 ; envío sector erase - out (c), d - out (c), e - out (c), a - call flashcs -wrfls2 call waits5 - call puerto - wreg flash_spi, 6 ; envío write enable - call flashcs - call puerto - wreg flash_spi, 2 ; page program - out (c), d - out (c), e - out (c), a - ld a, $20 - exx - ld bc, zxuno_port+$100 -wrfls3 inc b - outi - inc b - outi - inc b - outi - inc b - outi - inc b - outi - inc b - outi - inc b - outi - inc b - outi - dec a - jr nz, wrfls3 - exx - call flashcs - ex af, af' - dec a - jr z, waits5 - ex af, af' - inc e - ld a, e - and $0f - jr nz, wrfls2 - ld hl, wrfls1 - push hl -waits5 call puerto - wreg flash_spi, 5 ; envío read status - in a, (c) -waits6 in a, (c) - and 1 - jr nz, waits6 - -flashcs push af - ld a, (puerto+2) - rrca - jr c, flashcs1 - wreg flash_cs, $ff - pop af - ret -flashcs1 wreg flash_cs+1, $ff - pop af - ret - -puerto push af - ld a, 0 - srl a - push af - ld bc, zxuno_port - ld a, flash_cs - adc a, 0 - out (c), a - pop bc - inc b - ld a, $7f -puerto1 rlca - djnz puerto1 - ld bc, zxuno_port + $100 - out (c), a - pop af - ret - -rst28 ld bc, zxuno_port + $100 - pop hl - outi - ld b, (zxuno_port >> 8)+2 - outi - jp (hl) - -repe ld e, 0 -repe1 call puerto - wreg flash_spi, 6 ; envío write enable - call flashcs - call puerto - wreg flash_spi, 1 ; envío write register status - out (c), 0 - ld a, 2 - out (c), a - call flashcs - call puerto - wreg flash_spi, $35 ; envío write register status - in a, (c) - in a, (c) - call flashcs - and 2 - ret nz - dec e - jr nz, repe1 - ret - -; ------------------------ -; 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 - call puerto - 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 - call flashcs - pop hl - ret - -hex push af - and $f0 - rrca - rrca - rrca - rrca - cp $0a - jr c, mayo - add a, 7 -mayo add a, $30 - rst $10 - pop af - and $0f - cp $0a - jr c, maya - add a, 7 -maya add a, $30 - rst $10 - ret - -FileName dz 'FLASH.ZX1' +; upgrade.asm +; +; Copyright (C) 2016, 2020, 2021 Antonio Villena +; +; This program is free software: you can redistribute it and/or modify +; it under the terms of the GNU General Public License as published by +; the Free Software Foundation, version 3. +; +; This program is distributed in the hope that it will be useful, +; but WITHOUT ANY WARRANTY; without even the implied warranty of +; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +; GNU General Public License for more details. +; +; You should have received a copy of the GNU General Public License +; along with this program. If not, see . +; +; SPDX-FileCopyrightText: Copyright (C) 2016, 2020, 2021 Antonio Villena +; +; SPDX-License-Identifier: GPL-3.0-only + +; Compatible compilers: +; SJAsmPlus, + + output UPGRADE + + define FA_READ 0x01 + define M_GETSETDRV 0x89 + define F_OPEN 0x9a + define F_CLOSE 0x9b + define F_READ 0x9d + define F_SEEK 0x9f + + define zxuno_port $fc3b + define flash_spi 2 + define flash_cs 48 + + macro wreg dir, dato + call rst28 + defb dir, dato + endm + + org $2000 ; comienzo de la ejecución de los comandos ESXDOS + +Main xor a + rst $08 + db 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 + ld (handle+1), a + jr nc, FileFound + call Print + dz 'File FLASH not found' + ret +FileFound ld l, 0 + ld bc, 0 + ld de, 0 + rst $08 + db F_SEEK + call Print + dz 'No ' + ld a, (puerto+2) + add a, $30 + rst $10 + call repe + jr nz, nfallo +; call hex + call Print + dz 'Flash error' + jr Next +nfallo halt + halt + ;jr Verify;call hex + ld ixl, 0 + ld de, $0000 + exx +Bucle ld a, ixl + inc a + and $0f + jr nz, punto + ld a, '.' + exx + push de + rst $10 + pop de + exx +punto ld hl, $8000 + ld bc, $4000 +handle ld a, 0 + rst $08 + db F_READ + jr nc, ReadOK + call Print + dz 'Read Error' + ret +ReadOK ld a, $40 + ld hl, $8000 + exx + call wrflsh + inc de + exx + dec ixl + jr nz, Bucle + + halt + halt + +Verify ld de, $8000 + ld hl, $0040 + ld a, 2 + call rdflsh + ld de, $8000 + ld hl, 0 +Verify1 ex de, hl + ld c, (hl) + inc l + ld b, (hl) + inc hl + ex de, hl + add hl, bc + bit 1, d + jr z, Verify1 + ld a, h + call hex + ld a, l + call hex + halt + halt + +; ld de, $371a +; sbc hl, de +; jr z, Next +; call Print +; dz 'CRC Error' +Next ld a, 13 + rst $10 + ld a, (puerto+2) + inc a + ld (puerto+2), a + cp $10 + ld a, (handle+1) + jp nz, FileFound + rst $08 + db F_CLOSE + ret + +Print pop hl + db $3e +Print1 rst $10 + ld a, (hl) + inc hl + or a + jr nz, Print1 + jp (hl) + +; ------------------------ +; Write to SPI flash +; Parameters: +; A: number of pages (256 bytes) to write +; DE: target address without last byte +; BC': zxuno_port+$100 (constant) +; HL': source address from memory +; ------------------------ +wrflsh ex af, af' +wrfls1 call puerto + wreg flash_spi, 6 ; envío write enable + call flashcs + call puerto + wreg flash_spi, $20 ; envío sector erase + out (c), d + out (c), e + out (c), a + call flashcs +wrfls2 call waits5 + call puerto + wreg flash_spi, 6 ; envío write enable + call flashcs + call puerto + wreg flash_spi, 2 ; page program + out (c), d + out (c), e + out (c), a + ld a, $20 + exx + ld bc, zxuno_port+$100 +wrfls3 inc b + outi + inc b + outi + inc b + outi + inc b + outi + inc b + outi + inc b + outi + inc b + outi + inc b + outi + dec a + jr nz, wrfls3 + exx + call flashcs + ex af, af' + dec a + jr z, waits5 + ex af, af' + inc e + ld a, e + and $0f + jr nz, wrfls2 + ld hl, wrfls1 + push hl +waits5 call puerto + wreg flash_spi, 5 ; envío read status + in a, (c) +waits6 in a, (c) + and 1 + jr nz, waits6 + +flashcs push af + ld a, (puerto+2) + rrca + jr c, flashcs1 + wreg flash_cs, $ff + pop af + ret +flashcs1 wreg flash_cs+1, $ff + pop af + ret + +puerto push af + ld a, 0 + srl a + push af + ld bc, zxuno_port + ld a, flash_cs + adc a, 0 + out (c), a + pop bc + inc b + ld a, $7f +puerto1 rlca + djnz puerto1 + ld bc, zxuno_port + $100 + out (c), a + pop af + ret + +rst28 ld bc, zxuno_port + $100 + pop hl + outi + ld b, (zxuno_port >> 8)+2 + outi + jp (hl) + +repe ld e, 0 +repe1 call puerto + wreg flash_spi, 6 ; envío write enable + call flashcs + call puerto + wreg flash_spi, 1 ; envío write register status + out (c), 0 + ld a, 2 + out (c), a + call flashcs + call puerto + wreg flash_spi, $35 ; envío write register status + in a, (c) + in a, (c) + call flashcs + and 2 + ret nz + dec e + jr nz, repe1 + ret + +; ------------------------ +; 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 + call puerto + 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 + call flashcs + pop hl + ret + +hex push af + and $f0 + rrca + rrca + rrca + rrca + cp $0a + jr c, mayo + add a, 7 +mayo add a, $30 + rst $10 + pop af + and $0f + cp $0a + jr c, maya + add a, 7 +maya add a, $30 + rst $10 + ret + +FileName dz 'FLASH.ZX1'