| Welcome, Guest |
You have to register before you can post on our site.
|
| Forum Statistics |
» Members: 273
» Latest member: mindlin
» Forum threads: 1,085
» Forum posts: 6,486
Full Statistics
|
| Online Users |
There are currently 32 online users. » 0 Member(s) | 31 Guest(s) Bing
|
| Latest Threads |
location of heap manageme...
Forum: Help & Support
Last Post: boriel
2026-03-07, 12:13 AM
» Replies: 1
» Views: 212
|
non-paged supervisor code...
Forum: Help & Support
Last Post: sdo303
2026-02-20, 06:38 PM
» Replies: 8
» Views: 685
|
How to open fuse as an ex...
Forum: How-To & Tutorials
Last Post: Duefectu
2026-02-09, 01:52 PM
» Replies: 3
» Views: 1,062
|
Old zxbasic game errors
Forum: Help & Support
Last Post: boriel
2025-11-09, 11:52 AM
» Replies: 7
» Views: 1,671
|
Error: Undefined GLOBAL l...
Forum: Help & Support
Last Post: ardentcrest
2025-11-04, 05:46 PM
» Replies: 3
» Views: 808
|
A Fast(er) Plot Routine f...
Forum: How-To & Tutorials
Last Post: tubz74
2025-10-30, 03:16 PM
» Replies: 2
» Views: 927
|
Hall of Fame - Include fo...
Forum: How-To & Tutorials
Last Post: tubz74
2025-10-28, 03:48 PM
» Replies: 0
» Views: 473
|
[SOLVED] Array layout bug...
Forum: Bug Reports
Last Post: Zoran
2025-10-25, 05:48 PM
» Replies: 2
» Views: 942
|
3DOS Commands?
Forum: Help & Support
Last Post: boriel
2025-10-06, 02:54 PM
» Replies: 3
» Views: 1,105
|
CLS/Fade out ASM Sub-rout...
Forum: How-To & Tutorials
Last Post: tubz74
2025-10-05, 03:39 PM
» Replies: 2
» Views: 835
|
|
|
| equivalent of waitvbl (from Amos and sdlBasic) needed |
|
Posted by: nitrofurano - 2011-10-08, 06:07 PM - Forum: Help & Support
- Replies (2)
|
 |
i tried this code
Code: #include <print64.bas>
10 ink 7:paper 0:border 2: bright 1:flash 0:cls
20 let x=10:let y=10
30 printat64(y,x):print64("X")
100 let a$=inkey$
200 if a$="w" or a$="W" or a$="7" or a$=chr$(11) then printat64(y,x):print64(" "):y=y-1:printat64(y,x):print64("X"):end if
210 if a$="s" or a$="S" or a$="6" or a$=chr$(10) then printat64(y,x):print64(" "):y=y+1:printat64(y,x):print64("X"):end if
220 if a$="a" or a$="A" or a$="5" or a$=chr$(8) then printat64(y,x):print64(" "):x=x-1:printat64(y,x):print64("X"):end if
230 if a$="d" or a$="D" or a$="8" or a$=chr$(9) then printat64(y,x):print64(" "):x=x+1:printat64(y,x):print64("X"):end if
1000 goto 100
but it runs too fast, and i only need to synchronize it with the display frequence (50hz or 60hz)
i think zxspectrum uses this with some z80 interrupt instruction? which one, and how can we use it inside 'asm/endasm'?
|
|
|
| interesting performance differences with sub/endsub |
|
Posted by: nitrofurano - 2011-10-08, 03:22 PM - Forum: Help & Support
- No Replies
|
 |
i were trying to make some experiences with display memory byte sequence references from coco2 (pmode 4) and msx1 (screen 2)
first i tried these:
coco2-pmode4 with sub/endsub (around 49 seconds):
Code: dim a1, a2, v1, i as integer
sub vpokeln(a1,v1)
let a2=16384 + ((a1 band 31) bor ((a1 band 224)*8) bor ((a1 band 1792)/8) bor (a1 band 6144))
if a1>=0 and a1<=6143 then: poke a2,v1:end if
end sub
out 254,6
for i=400 to 6000
vpokeln(i,40)
next i
pause 0
msx1-screen2 with sub/endsub (around 60 seconds):
Code: dim a1, a2, v1, i as integer
sub vpokech(a1,v1)
let a2=16384+(((a1 band 7)*256) bor ((a1 band 248)/8) bor ((a1 band 1792)/8) bor (a1 band 6144))
if a1>=0 and a1<=6143 then: poke a2,v1:end if
end sub
out 254,6
for i=400 to 6000
vpokech(i,40)
next i
pause 0
but when i don't use sub/endsub, i got these results as benchmark:
coco2-pmode4 without sub/endsub (around 3 seconds):
Code: dim i as integer
out 254,6
for i=400 to 6000
poke 16384+((i band 31) bor ((i band 224)*8) bor ((i band 1792)/8) bor (i band 6144)),40
next i
pause 0
msx1-screen2 with sub/endsub (around 7 seconds):
Code: dim i as integer
out 254,6
for i=400 to 6000
poke 16384+(((i band 7)*256) bor ((i band 248)/8) bor ((i band 1792)/8) bor (i band 6144)),40
next i
pause 0
and i used the original zx-spectrum byte sequence display, i got this:
with sub/endsub (around 30 seconds):
Code: dim a1, a2, v1, i as integer
sub vpokezx(a1,v1)
let a2=16384+a1
if a1>=0 and a1<=6143 then: poke a2,v1:end if
end sub
out 254,6
for i=400 to 6000
vpokezx(i,40)
next i
pause 0
without sub/endsub (around 0.25 seconds or less):
Code: dim i as integer
out 254,6
for i=400 to 6000
poke 16384+i,40
next i
pause 0
the question: what is causing so large performances differences from my expectations (i expected faster on the slower ones), and should i do for optimizing this?
|
|
|
| asm/endasm DEFB not accepting 0xFE or FEh instead of 254 |
|
Posted by: nitrofurano - 2011-10-06, 05:02 PM - Forum: Help & Support
- Replies (2)
|
 |
hi!
i always had some idea that z80 assemblers accepts byte values in hexadecimal format, instead of only decimals - i'm i wrong, or is this zxbasic compiling missing this feature? (or can we suggest this feature?)
Code: guest@macbook_mint1 /mnt/sda4/trabalhos/programacao/8bit/zxspectrum/ftpupload/zxspectrumstuff_20111001/borielzxbasiccompiler/snippets $ zxb.py -t -B -a asm.bas Generating LALR tables
WARNING: Token 'BIN' defined, but not used
WARNING: There is 1 unused token
Generating LALR tables
WARNING: Token 'UMINUS' defined, but not used
WARNING: There is 1 unused token
asm.bas:2: Error: Syntax error. Unexpected token 'x00' [ID]
guest@macbook_mint1 /mnt/sda4/trabalhos/programacao/8bit/zxspectrum/ftpupload/zxspectrumstuff_20111001/borielzxbasiccompiler/snippets $ zxb.py -t -B -a asm.bas
Generating LALR tables
WARNING: Token 'BIN' defined, but not used
WARNING: There is 1 unused token
Generating LALR tables
WARNING: Token 'UMINUS' defined, but not used
WARNING: There is 1 unused token
asm.bas:3: Error: Undefined label 'ffh'
guest@macbook_mint1 /mnt/sda4/trabalhos/programacao/8bit/zxspectrum/ftpupload/zxspectrumstuff_20111001/borielzxbasiccompiler/snippets $
Code: asm
DEFB 0,1,2,3,4,5,6,7
DEFB 00h,01h,02h,03h,04h,05h,06h,07h
DEFB 0xff,0xfe,0xfd,0xfc,0xfb,0xfa,0xf9,0xf8
end asm
|
|
|
| found a bug on draw command |
|
Posted by: nitrofurano - 2011-10-01, 03:15 PM - Forum: Help & Support
- Replies (2)
|
 |
Code: 10 cls:out 254,6
12 let x1=60:let y1=60
14 let x2=70:let y2=50
16 plot x1,192-y1
18 draw x2-x1,y1-y2
22 let x1=80:let y1=60
24 let x2=90:let y2=70
26 plot x1,192-y1
28 draw x2-x1,y1-y2
30 pause 0
this code should draw two lines, not one line and one dot...
|
|
|
| bug on a bezier draw attempt |
|
Posted by: nitrofurano - 2011-09-29, 07:28 PM - Forum: Help & Support
- Replies (2)
|
 |
i'm trying to draw a kind of custom simplified vectorial file, converted from postscript or svg, with a code like this:
Code: 1000 CA=49152:LET XT=0: LET YT=0:LET CT=0
1004 PAPER 7:BORDER 7: BRIGHT 0: INK CT: CLS: OUT 254,0
1100 REM FILE READING
1102 LET CM=PEEK(CA):LET CA=CA+1
1104 IF CM=ASC("M") THEN GOSUB 5002
1106 IF CM=ASC("L") THEN GOSUB 5102
1108 IF CM=ASC("C") THEN GOSUB 5202
1110 IF CM=ASC("F") THEN GOSUB 5302
1112 IF CM=ASC("I") THEN GOSUB 5402
1114 IF CM=ASC("Z") THEN GOSUB 5502
1116 GOTO 1102
5000 REM _M_ MOVE
5002 LET XT=PEEK(CA):LET CA=CA+1:LET YT=191-PEEK(CA):CA=CA+1:RETURN
5100 REM _L_ LINE
5102 LET X1=PEEK(CA):LET CA=CA+1:LET Y1=191-PEEK(CA):CA=CA+1
5104 INK CT: PLOT XT,YT: DRAW XT-X1,YT-Y1 :LET XT=X1:LET YT=Y1:RETURN
5200 REM _C_ BEZIER
5202 LET X1=PEEK(CA):LET CA=CA+1:LET Y1=191-PEEK(CA):LET CA=CA+1
5204 LET X2=PEEK(CA):LET CA=CA+1:LET Y2=191-PEEK(CA):LET CA=CA+1
5206 LET X3=PEEK(CA):LET CA=CA+1:LET Y3=191-PEEK(CA):LET CA=CA+1
5208 LET XA=(X3)-(3*X2)+(3*X1)-(XT):LET YA=(Y3)-(3*Y2)+(3*Y1)-(YT)
5210 LET XB=(3*X2)-(6*X1)+(3*XT):LET YB=(3*Y2)-(6*Y1)+(3*YT)
5212 LET XC=(3*X1)-(3*XT):LET YC=(3*Y1)-(3*YT)
5213 LET X=0: LET Y=0
5214 FOR T=0 TO 1 STEP 0.25
5215 LET XO=X:LET YO=Y
5216 LET X=(((((XA*T)+XB)*T)+XC)*T)+XT
5218 LET Y=(((((YA*T)+YB)*T)+YC)*T)+YT
5220 IF T=0 THEN INK CT: PLOT X,Y
5222 IF T<>0 THEN INK CT: DRAW X-XO,Y-YO
5224 NEXT T
5226 LET XT=X3:LET YT=Y3:RETURN
5300 REM _F_ FILL
5302 LET XT=PEEK(CA):LET CA=CA+1:LET YT=191-PEEK(CA):LET CA=CA+1
5304 REM PAINT (XT,YT),CT
5306 RETURN
5400 REM _I_ INK COLOUR
5402 LET CT=PEEK(CA):CA=CA+1:RETURN
5500 REM _Z_ END OF DOCUMENT
5502 GOTO 5502
but when i try to compile it:
Code: guest@macbook_mint1 /mnt/sda4/emulation/zxspectrum/basic/BorielZxBasicCompiler $ zxb.py /mnt/sda4/emulation/zxspectrum/basic/bin2tap_py/zvfreader_
zxspectrum.bas -t -S 32768
zvfreader_zxspectrum.bas:31: Syntax Error. Unexpected token 'NEXT' <NEXT>
guest@macbook_mint1 /mnt/sda4/emulation/zxspectrum/basic/BorielZxBasicCompiler $
very weird... what could cause this?
|
|
|
| zxb.py as command from Bash |
|
Posted by: nitrofurano - 2011-09-29, 06:21 PM - Forum: Help & Support
- Replies (2)
|
 |
do someone know how can we have zxb.py as command from Bash, and having Boriel's zx-spectrum compiler placed in some directory inside '/opt/'?
this question is because:
1- would be great having a more comfortable way to use the compiler from the terminal, without having to do a 'cd' inside the compiler directory, just like using tools like zmakebas (available in Ubuntu and Debian repository)
2- would help package maintainers to help creating a package, in formats like .deb, .rpm, etc., and having it available defaulty in their repositories, like on Ubuntu or Debian, we only needed to enter 'sudo apt-get install borielzxspectrumcompiler' (if this could be the name of the package), for installing it
any help is very welcome! thanks!
|
|
|
| tool for converting binaries into .tap files |
|
Posted by: nitrofurano - 2011-09-29, 03:59 PM - Forum: Wishlist
- Replies (1)
|
 |
btw, sorry if i'm posting this in a wrong place if it looks offtopic - i don't know where else to post it...
as i think some people here missed tools for converting binary files into .tap , i recoded this converter in python, which i don't know if this can be useful for you
(i think LCD knows the sdlBasic and Amos versions of this converter i coded since around 10 years ago)
http://pastebin.com/b8fm44ue
maybe a tool like this would be missing on the Boriel's zx-basic compiler package?
(btw, it provides a weird bug, the binary files are opening fine on Fbzx emulator, but not in Fuse... (both Linux versions) - i don't know what i'm doing wrong )
|
|
|
|