Skip to content

Commit 0c17531

Browse files
authored
Merge pull request #1019 from boriel-basic/release/bumpversion
Release/bumpversion
2 parents 1c70ae1 + 66fef09 commit 0c17531

9 files changed

Lines changed: 884 additions & 12 deletions

File tree

.bumpversion.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 1.18.3
2+
current_version = 1.18.4
33

44
[bumpversion:file:src/zxbc/version.py]
55
search = VERSION: Final[str] = "{current_version}"

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
[v1.18.4](https://github.com/boriel-basic/zxbasic/tree/v1.18.4)
2+
===
3+
+ ! Fixed a bug with arrays and strings
4+
+ Updated documentation
5+
+ Added Scroll-Aligned (aligned to column) functions
6+
17
[v1.18.3](https://github.com/boriel-basic/zxbasic/tree/v1.18.3)
28
===
39
+ ! Fix `ByRef` with an array element

docs/archive.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,28 +10,28 @@ repository (git).
1010
You can contribute to ZX BASIC by reporting possible bugs or improvement suggestions at the
1111
[forum](https://forum.boriel.com/) or in social media.
1212

13-
The latest stable version is <span style={{color: "green"}}>**1.18.3**</span>.
13+
The latest stable version is <span style={{color: "green"}}>**1.18.4**</span>.
1414
Click on the desired icon below to download the package suitable for your platform:
1515

1616
* [<img src="https://zxbasic.readthedocs.io/en/docs/img/win32.png" alt="win32zip" width="32px"/>
17-
https://www.boriel.com/files/zxb/zxbasic-1.18.3-win32.zip](https://www.boriel.com/files/zxb/zxbasic-1.18.3-win32.zip)
17+
https://www.boriel.com/files/zxb/zxbasic-1.18.4-win32.zip](https://www.boriel.com/files/zxb/zxbasic-1.18.4-win32.zip)
1818
<br />Windows .exe zip package. No install needed, just uncompress it in a directory of your choice.
1919
<br/>&nbsp;
2020
* [<img src="https://zxbasic.readthedocs.io/en/docs/img/macos.png" alt="macostargz" width="32px"/>
21-
https://www.boriel.com/files/zxb/zxbasic-1.18.3-macos.tar.gz](https://www.boriel.com/files/zxb/zxbasic-1.18.3-macos.tar.gz)
21+
https://www.boriel.com/files/zxb/zxbasic-1.18.4-macos.tar.gz](https://www.boriel.com/files/zxb/zxbasic-1.18.4-macos.tar.gz)
2222
<br />Mac OS x64 package. No install needed, just uncompress it in a directory of your choice (needs Python installed
2323
in your system).
2424
<br/>&nbsp;
2525
* [<img src="https://zxbasic.readthedocs.io/en/docs/img/linux.png" alt="macostargz" width="32px"/>
26-
https://www.boriel.com/files/zxb/zxbasic-1.18.3-linux64.tar.gz](https://www.boriel.com/files/zxb/zxbasic-1.18.3-linux64.tar.gz)
26+
https://www.boriel.com/files/zxb/zxbasic-1.18.4-linux64.tar.gz](https://www.boriel.com/files/zxb/zxbasic-1.18.4-linux64.tar.gz)
2727
<br />Linux x64 binary package. No install needed, just uncompress it in a directory of your choice.
2828
<br/>&nbsp;
2929
* [<img src="https://zxbasic.readthedocs.io/en/docs/img/zip-package.png" alt="zip" width="32px"/>
30-
https://www.boriel.com/files/zxb/zxbasic-1.18.3.zip](https://www.boriel.com/files/zxb/zxbasic-1.18.3.zip)
30+
https://www.boriel.com/files/zxb/zxbasic-1.18.4.zip](https://www.boriel.com/files/zxb/zxbasic-1.18.4.zip)
3131
<br />Windows, Linux, Mac zip package, with python scripts. Requires python installed in your system.
3232
<br/>&nbsp;
3333
* [<img src="https://zxbasic.readthedocs.io/en/docs/img/driver-down.png" alt="tar.gz" width="32px"/>
34-
https://www.boriel.com/files/zxb/zxbasic-1.18.3.tar.gz](https://www.boriel.com/files/zxb/zxbasic-1.18.3.tar.gz)
34+
https://www.boriel.com/files/zxb/zxbasic-1.18.4.tar.gz](https://www.boriel.com/files/zxb/zxbasic-1.18.4.tar.gz)
3535
<br />Windows, Linux, Mac tar.gz package, with python scripts. Requires python installed in your system.
3636

3737
### What's new

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "zxbasic"
3-
version = "1.18.3"
3+
version = "1.18.4"
44
description = "Boriel's ZX BASIC Compiler"
55
authors = ["Jose Rodriguez <zxbasic@boriel.com>"]
66
license = "AGPL-3.0-or-later"

src/lib/arch/zx48k/stdlib/scroll.bas

Lines changed: 316 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -717,6 +717,322 @@ EMPTYLINE:
717717
end asm
718718
end sub
719719

720+
721+
' ----------------------------------------------------------------
722+
' sub ScrollRightAligned
723+
' pixel by pixel right scroll.
724+
' scrolls 1 pixel right the window defined by (x1, y1, x2, y2)
725+
' This scroll is aligned to columns.
726+
' x1 and x2 are divided by 8 and rounded down (floor) to get the column number (0..31)
727+
' ----------------------------------------------------------------
728+
sub fastcall ScrollRightAligned(x1 as uByte, y1 as uByte, x2 as Ubyte, y2 as Ubyte)
729+
asm
730+
push namespace core
731+
732+
PROC
733+
LOCAL LOOP1
734+
LOCAL LOOP2
735+
736+
; a = x1
737+
pop hl ; RET address
738+
pop bc ; b = y1
739+
pop de ; d = x2
740+
ex (sp), hl ; h = y2, (sp) = RET address. Stack ok now
741+
742+
ld c, a ; BC = y1x1
743+
ld a, d
744+
sub c
745+
ret c ; x1 > x2
746+
747+
srl a
748+
srl a
749+
srl a
750+
inc a
751+
ld e, a ; e = (x2 - x1) / 8 + 1
752+
753+
ld a, h
754+
sub b
755+
ret c ; y1 > y2
756+
757+
inc a
758+
ld d, a ; d = y2 - y1 + 1
759+
760+
ld b, h ; BC = y2x1
761+
ld a, 191
762+
LOCAL __PIXEL_ADDR
763+
__PIXEL_ADDR EQU 22ACh
764+
call __PIXEL_ADDR
765+
res 6, h ; Starts from 0
766+
ld bc, (SCREEN_ADDR)
767+
add hl, bc ; Now current offset
768+
769+
LOOP1:
770+
push hl
771+
ld b, e ; C cols
772+
or a ; clear carry flag
773+
LOOP2:
774+
rr (hl)
775+
inc hl
776+
djnz LOOP2
777+
pop hl
778+
779+
dec d
780+
ret z
781+
call SP.PixelDown
782+
jp LOOP1
783+
ENDP
784+
785+
pop namespace
786+
end asm
787+
end sub
788+
789+
790+
' ----------------------------------------------------------------
791+
' sub ScrolLeftAligned
792+
' pixel by pixel left scroll
793+
' scrolls 1 pixel left the window defined by (x1, y1, x2, y2)
794+
' This scroll is aligned to columns.
795+
' x1 and x2 are divided by 8 and rounded down (floor) to get the column number (0..31)
796+
' ----------------------------------------------------------------
797+
sub fastcall ScrollLeftAligned(x1 as uByte, y1 as uByte, x2 as Ubyte, y2 as Ubyte)
798+
asm
799+
push namespace core
800+
801+
PROC
802+
LOCAL LOOP1
803+
LOCAL LOOP2
804+
805+
; a = x1
806+
pop hl ; RET address
807+
pop bc ; b = y1
808+
pop de ; d = x2
809+
ex (sp), hl ; h = y2, (sp) = RET address. Stack ok now
810+
811+
ld c, a ; BC = y1x1
812+
ld a, d
813+
sub c
814+
ret c ; x1 > x2
815+
816+
srl a
817+
srl a
818+
srl a
819+
inc a
820+
ld e, a ; e = (x2 - x1) / 8 + 1
821+
822+
ld a, h
823+
sub b
824+
ret c ; y1 > y2
825+
826+
ld c, d
827+
inc a
828+
ld d, a ; d = y2 - y1 + 1
829+
830+
ld b, h ; BC = y2x1
831+
ld a, 191
832+
LOCAL __PIXEL_ADDR
833+
__PIXEL_ADDR EQU 22ACh
834+
call __PIXEL_ADDR
835+
res 6, h ; Starts from 0
836+
ld bc, (SCREEN_ADDR)
837+
add hl, bc ; Now current offset
838+
839+
LOOP1:
840+
push hl
841+
ld b, e ; C cols
842+
or a ; clear carry flag
843+
LOOP2:
844+
rl (hl)
845+
dec hl
846+
djnz LOOP2
847+
pop hl
848+
849+
dec d
850+
ret z
851+
call SP.PixelDown
852+
jp LOOP1
853+
ENDP
854+
855+
pop namespace
856+
end asm
857+
end sub
858+
859+
860+
' ----------------------------------------------------------------
861+
' sub ScrolUpAligned
862+
' pixel by pixel up scroll
863+
' scrolls 1 pixel up the window defined by (x1, y1, x2, y2)
864+
' This scroll is aligned to columns.
865+
' x1 and x2 are divided by 8 and rounded down (floor) to get the column number (0..31)
866+
' ----------------------------------------------------------------
867+
sub fastcall ScrollUpAligned(x1 as uByte, y1 as uByte, x2 as Ubyte, y2 as Ubyte)
868+
asm
869+
push namespace core
870+
871+
PROC
872+
LOCAL LOOP1
873+
874+
; a = x1
875+
pop hl ; RET address
876+
pop bc ; b = y1
877+
pop de ; d = x2
878+
ex (sp), hl ; h = y2, (sp) = RET address. Stack ok now
879+
880+
ld c, a ; BC = y1x1
881+
ld a, d
882+
sub c
883+
ret c ; x1 > x2
884+
885+
srl a
886+
srl a
887+
srl a
888+
inc a
889+
ld e, a ; e = (x2 - x1) / 8 + 1
890+
ex af, af' ; save it for later
891+
892+
ld a, h
893+
sub b
894+
ret c ; y1 > y2
895+
896+
inc a
897+
ld d, a ; d = y2 - y1 + 1
898+
899+
ld b, h ; BC = y2x1
900+
ld a, 191
901+
LOCAL __PIXEL_ADDR
902+
__PIXEL_ADDR EQU 22ACh
903+
call __PIXEL_ADDR
904+
res 6, h ; Starts from 0
905+
ld bc, (SCREEN_ADDR)
906+
add hl, bc ; Now current offset
907+
908+
ld a, d ; Num. of scan lines
909+
ld b, 0
910+
exx
911+
ld b, a ; Scan lines counter
912+
ex af, af' ; Recovers cols
913+
ld c, a
914+
jp LOOP_START
915+
916+
LOOP1:
917+
exx
918+
ld d, h
919+
ld e, l
920+
ld c, a ; C cols
921+
call SP.PixelDown
922+
push hl
923+
ldir
924+
pop hl
925+
exx
926+
ld a, c ; Recovers C Cols
927+
LOCAL LOOP_START
928+
LOOP_START:
929+
djnz LOOP1
930+
931+
; Clears bottom line
932+
exx
933+
ld (hl), 0
934+
ld d, h
935+
ld e, l
936+
inc de
937+
ld c, a
938+
dec c
939+
ret z
940+
ldir
941+
ENDP
942+
943+
pop namespace
944+
end asm
945+
end sub
946+
947+
948+
' ----------------------------------------------------------------
949+
' sub ScrolDownAligned
950+
' pixel by pixel down scroll
951+
' scrolls 1 pixel down the window defined by (x1, y1, x2, y2)
952+
' This scroll is aligned to columns.
953+
' x1 and x2 are divided by 8 and rounded down (floor) to get the column number (0..31)
954+
' ----------------------------------------------------------------
955+
sub fastcall ScrollDownAligned(x1 as uByte, y1 as uByte, x2 as Ubyte, y2 as Ubyte)
956+
asm
957+
push namespace core
958+
959+
PROC
960+
LOCAL LOOP1
961+
962+
; a = x1
963+
pop hl ; RET address
964+
pop bc ; b = y1
965+
pop de ; d = x2
966+
ex (sp), hl ; h = y2, (sp) = RET address. Stack ok now
967+
968+
ld c, a ; BC = y1x1
969+
ld a, d
970+
sub c
971+
ret c ; x1 > x2
972+
973+
srl a
974+
srl a
975+
srl a
976+
inc a
977+
ld e, a ; e = (x2 - x1) / 8 + 1
978+
ex af, af' ; save it for later
979+
980+
ld a, h
981+
sub b
982+
ret c ; y1 > y2
983+
984+
inc a
985+
ld d, a ; d = y2 - y1 + 1
986+
987+
ld a, 191
988+
LOCAL __PIXEL_ADDR
989+
__PIXEL_ADDR EQU 22ACh
990+
call __PIXEL_ADDR
991+
res 6, h ; Starts from 0
992+
ld bc, (SCREEN_ADDR)
993+
add hl, bc ; Now current offset
994+
995+
ld a, d ; Num. of scan lines
996+
ld b, 0
997+
exx
998+
ld b, a ; Scan lines counter
999+
ex af, af' ; Recovers cols
1000+
ld c, a
1001+
jp LOOP_START
1002+
1003+
LOOP1:
1004+
exx
1005+
ld d, h
1006+
ld e, l
1007+
ld c, a ; C cols
1008+
call SP.PixelUp
1009+
push hl
1010+
ldir
1011+
pop hl
1012+
exx
1013+
ld a, c ; Recovers C Cols
1014+
LOCAL LOOP_START
1015+
LOOP_START:
1016+
djnz LOOP1
1017+
1018+
; Clears top line
1019+
exx
1020+
ld (hl), 0
1021+
ld d, h
1022+
ld e, l
1023+
inc de
1024+
ld c, a
1025+
dec c
1026+
ret z
1027+
ldir
1028+
1029+
ENDP
1030+
1031+
pop namespace
1032+
end asm
1033+
end sub
1034+
1035+
7201036
#pragma pop(case_insensitive)
7211037

7221038
REM the following is required, because it defines SCREEN_ADDR and SCREEN_ATTR_ADDR

0 commit comments

Comments
 (0)