The following warnings occurred:
Warning [2] Undefined array key "attachments" - Line: 20 - File: portal.php(680) : eval()'d code PHP 8.2.31 (Linux)
File Line Function
/inc/class_error.php 157 errorHandler->error
/portal.php(680) : eval()'d code 20 errorHandler->error_callback
/portal.php 680 eval
Warning [2] Undefined array key "attachments" - Line: 20 - File: portal.php(680) : eval()'d code PHP 8.2.31 (Linux)
File Line Function
/inc/class_error.php 157 errorHandler->error
/portal.php(680) : eval()'d code 20 errorHandler->error_callback
/portal.php 680 eval
Warning [2] Undefined array key "attachments" - Line: 20 - File: portal.php(680) : eval()'d code PHP 8.2.31 (Linux)
File Line Function
/inc/class_error.php 157 errorHandler->error
/portal.php(680) : eval()'d code 20 errorHandler->error_callback
/portal.php 680 eval
Warning [2] Undefined array key "attachments" - Line: 20 - File: portal.php(680) : eval()'d code PHP 8.2.31 (Linux)
File Line Function
/inc/class_error.php 157 errorHandler->error
/portal.php(680) : eval()'d code 20 errorHandler->error_callback
/portal.php 680 eval
Warning [2] Undefined array key "attachments" - Line: 20 - File: portal.php(680) : eval()'d code PHP 8.2.31 (Linux)
File Line Function
/inc/class_error.php 157 errorHandler->error
/portal.php(680) : eval()'d code 20 errorHandler->error_callback
/portal.php 680 eval
Warning [2] Undefined array key "attachments" - Line: 20 - File: portal.php(680) : eval()'d code PHP 8.2.31 (Linux)
File Line Function
/inc/class_error.php 157 errorHandler->error
/portal.php(680) : eval()'d code 20 errorHandler->error_callback
/portal.php 680 eval
Warning [2] Undefined array key "attachments" - Line: 20 - File: portal.php(680) : eval()'d code PHP 8.2.31 (Linux)
File Line Function
/inc/class_error.php 157 errorHandler->error
/portal.php(680) : eval()'d code 20 errorHandler->error_callback
/portal.php 680 eval
Warning [2] Undefined array key "attachments" - Line: 20 - File: portal.php(680) : eval()'d code PHP 8.2.31 (Linux)
File Line Function
/inc/class_error.php 157 errorHandler->error
/portal.php(680) : eval()'d code 20 errorHandler->error_callback
/portal.php 680 eval
Warning [2] Undefined array key "attachments" - Line: 20 - File: portal.php(680) : eval()'d code PHP 8.2.31 (Linux)
File Line Function
/inc/class_error.php 157 errorHandler->error
/portal.php(680) : eval()'d code 20 errorHandler->error_callback
/portal.php 680 eval
Warning [2] Undefined array key "attachments" - Line: 20 - File: portal.php(680) : eval()'d code PHP 8.2.31 (Linux)
File Line Function
/inc/class_error.php 157 errorHandler->error
/portal.php(680) : eval()'d code 20 errorHandler->error_callback
/portal.php 680 eval




Welcome, Guest
You have to register before you can post on our site.

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 274
» Latest member: zxspecticle
» Forum threads: 1,086
» Forum posts: 6,487

Full Statistics

Online Users
There are currently 97 online users.
» 1 Member(s) | 96 Guest(s)
boriel

Latest Threads
New video Couse / Nuevo c...
Forum: News
Last Post: Duefectu
2026-04-29, 11:02 PM
» Replies: 0
» Views: 210
location of heap manageme...
Forum: Help & Support
Last Post: boriel
2026-03-07, 12:13 AM
» Replies: 1
» Views: 483
non-paged supervisor code...
Forum: Help & Support
Last Post: sdo303
2026-02-20, 06:38 PM
» Replies: 8
» Views: 1,295
How to open fuse as an ex...
Forum: How-To & Tutorials
Last Post: Duefectu
2026-02-09, 01:52 PM
» Replies: 3
» Views: 1,389
Old zxbasic game errors
Forum: Help & Support
Last Post: boriel
2025-11-09, 11:52 AM
» Replies: 7
» Views: 2,075
Error: Undefined GLOBAL l...
Forum: Help & Support
Last Post: ardentcrest
2025-11-04, 05:46 PM
» Replies: 3
» Views: 1,080
A Fast(er) Plot Routine f...
Forum: How-To & Tutorials
Last Post: tubz74
2025-10-30, 03:16 PM
» Replies: 2
» Views: 1,178
Hall of Fame - Include fo...
Forum: How-To & Tutorials
Last Post: tubz74
2025-10-28, 03:48 PM
» Replies: 0
» Views: 630
[SOLVED] Array layout bug...
Forum: Bug Reports
Last Post: Zoran
2025-10-25, 05:48 PM
» Replies: 2
» Views: 1,217
3DOS Commands?
Forum: Help & Support
Last Post: boriel
2025-10-06, 02:54 PM
» Replies: 3
» Views: 1,380

 
  Version 1.2.8 Released!
Posted by: boriel - 2011-10-10, 09:02 PM - Forum: ZX Basic Compiler - Replies (4)

This version is (IMHO) tested enough, and so, released as Stable.
You can download it here

NOTE: This is revision 1.2.8 s758
If you already have it, you don't need to download it again.

Changelog since 1.2.7:
* Code rearranged and reestructured for future refactorizations.
*! Complete rewritten backend (or almost!) to fix a bug in code
:generation which was being suboptimal. Now generated code is
:much faster and take less memory than before!
*+ Added support for Bitwise syntax (|, &, ~)
*! Fixed some bugs in ASM
*! Fixed some bugs in the peephole optimizer (-O3)
*! Fixed a bug with line continuation comments /' ...
*! Fixed bugs in ASM parser regarding to comments
*+ Added ATTRADDR function in <attrib.bas>
*! Many more bugs fixed related to STRING memory leak
*! Fixed a bug related to parameters.
* Some optimizations for code size and speed for FLOAT types
* Optimization for STRING parameters
* Optimization for 32 bit values
*! Fixed a bug for Uinteger/Integer arrays assignation
*! Fixed 2 bugs in CAST operation and type conversion
*! Fixed a bug in OVER attribute during PRINT
* Added PONG game example
*! Fixed a bug in POKE
*! PRINT optimized and slighty faster. Now fully compatible with
:SINCLAIR BASIC (no Out of Screen error on program exit)
*! CSRLN and POS optimized to this new PRINT SCHEME!
... and much much more

Print this item

  reading simultaneous keys pressed
Posted by: nitrofurano - 2011-10-08, 06:49 PM - Forum: Help & Support - Replies (6)

i forgot how to read simultaneous keys pressed on zx-spectrum - is it from port 254? and only port 254? and how?
and how can we read them in a zxbasic-compiler snippet?
thanks! Smile

Print this item

  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'?

Print this item

  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?

Print this item

  64 char print - 32 lines version
Posted by: nitrofurano - 2011-10-08, 02:11 PM - Forum: Wishlist - Replies (20)

Since zxbasic compiler has a library for 4x8 characters, how possible or easy to implement would be a 4x6 characters version?
[Image: charset4x6.png]

Print this item

  how MojonTwin's fourspriter.bas, from library, works?
Posted by: nitrofurano - 2011-10-06, 06:29 PM - Forum: Help & Support - Replies (3)

while browsing the compiler's content, i found './library/mj/fourspriter.bas'
supposed that '#include <fourspriter.bas>' or '#include <mj/fourspriter.bas>' should be part of our snippets, but i have no idea about how to used...
some ideas?
thanks! Smile

Print this item

  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

Print this item

  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...

[Image: zxbasiccompilerbug.png]

Print this item

  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?

Print this item

  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! Smile

Print this item