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

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 273
» Latest member: mindlin
» Forum threads: 1,085
» Forum posts: 6,486

Full Statistics

Online Users
There are currently 43 online users.
» 0 Member(s) | 43 Guest(s)

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: 684
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: 926
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

 
  Version 1.2.7 released!
Posted by: boriel - 2011-02-26, 11:42 PM - Forum: ZX Basic Compiler - Replies (2)

Okay, finally version 1.2.7 is out (revision 2114).
It's a major refactorization of the zxbpp and zxbasmpp (the preprocessors).

Check the changelog if interested. Basically, main changes are:

  • + DRAW is now much faster (and a bit more larger)
  • + PLOT, DRAW and CIRCLE now supports change screen address (for double-buffering)
  • + Added LBOUND() and UBOUND() functions
  • ! Fixed a bug in IF/THEN/ELSEIF/ELSE construct (thanks to LTee)
  • + Added a completely new preprocessor which now support true macros and
    better line counting handling. This has been a major change in the compiler.
  • + Added string management library with
    UCase(), LCase(), Ucase2(), LCase2(), InStr() and StrPos()
  • ! UDG where not being handled into the Heap, which might lead to program
    crash (fixed). This is done only if --sinclair or -Z flag is used.
  • + Added suport for BIN, so BIN 01010101 is also accepted now.
  • ! Fixed a bug with string parameters passed by value (again) not being correctly
    free upon return and crashing the program.
  • + BEEP with constant duration and pitch (e.g. BEEP 1, 2) has been
    optimized for space (and also slightly faster)
  • + Added Flight Simulator example

You can download it at <!-- m --><a class="postlink" href="http://www.boriel.com/files/zxb">http://www.boriel.com/files/zxb</a><!-- m --> (will redirect you to the archive).
Legacy version 1.2.6 will also remain there. :wink:

Print this item

  UBYTE/FOR loop issue?
Posted by: LTee - 2011-02-25, 02:07 PM - Forum: Help & Support - Replies (4)

I wrote the following code to list out the numbers from 0 to 255:

Code:
DIM i as UBYTE = 0
for i = 0 to 255
    print i;"   "
next i

The code compiles and runs, but it never ends. When the loop gets to 255, it begins again from 0. :-)

Making the loop "0 to 254" or changing i to an INTEGER/UINTEGER gets around the issue.

Print this item

  Pass an array as a parameter?
Posted by: LTee - 2011-02-24, 03:46 PM - Forum: Help & Support - Replies (3)

A question today, rather than a bug. :-)

Is it possible to pass an array as a parameter to a function or a sub?

And if so, does the function/sub receive a copy of the array or a pointer to the original? i.e. if I made changes to the array within a function, would those changes be local to the function or would they also be visible from the calling method?

Print this item

  ELSE issue? (*solved*)
Posted by: LTee - 2011-02-23, 05:29 PM - Forum: Bug Reports - Replies (12)

Have you had enough of me yet? :-D

I'm having a weird issue with ELSE, but I'm not sure if I'm doing something wrong or not. Take a look at this test program:

Code:
dim num as ubyte

cls
num = 1
test()
num = 2
test()
num = 3
test()
num = 4
test ()

sub test
    IF num = 1 THEN
        PRINT "1"
    ELSEIF num = 2 THEN
        PRINT "2"
    ELSEIF num = 3 THEN
        PRINT "3"
    ELSE
        PRINT "X"
    END IF
    PRINT "---"
end sub

I would expect the output from this to be like this:
Code:
1
---
2
---
3
---
X
---

But it's actually like this:
Code:
1
---
2
---
3
X
---
X
---

Condition "3" is running correctly, but the final ELSE block is also being processed so you get two lines output if num is 3. Have I messed up the syntax there? The behaviour is certainly different to how it used to be, as an old program that used to be okay is now failing.

I've tried this in 2100 and also 1866 and it does the same in both, so it must've been a while since I compiled it! :-)

Print this item

  Small brackets-parsing glitch (*solved*)
Posted by: LTee - 2011-02-23, 02:38 PM - Forum: Bug Reports - Replies (5)

Messing around with some of my other code over lunchtime with the latest beta (2100), I discovered a small error when parsing brackets.

Take a look at this code:

Code:
DIM test(10, 10) as UBYTE
DIM x as UBYTE
DIM y as UBYTE

x = 5
y = 5

PRINT test(x - 1, y)
PRINT test((x - 1), y)
PRINT test(x, y - 1)
PRINT test(x, (y - 1))

The final PRINT statement will not compile unless you remove the brackets from around the (y - 1). Strangely, the brackets seem to be okay if we're dealing with the first dimension of the array (so it's okay to have 'x - 1' in brackets), just not for the second. :-)

Print this item

  array bounds must be constant
Posted by: slenkar - 2011-02-22, 06:02 PM - Forum: Help & Support - Replies (11)

How do I create an array with an integer instead of a literal number?

I want to do this:

Code:
DIM personX (numPersons) as ubyte
DIM personY (numPersons) as ubyte
DIM personHealth (numPersons) as ubyte
DIM personWeapon (numPersons) as ubyte

instead of:
Code:
DIM personX (6) as ubyte
DIM personY (6) as ubyte
DIM personHealth (6) as ubyte
DIM personWeapon (6) as ubyte
just in case I decide to change my mind about the number of persons

Print this item

  UDG problem
Posted by: slenkar - 2011-02-22, 05:32 PM - Forum: Help & Support - No Replies

I have 2 graphics
factory.bin and select.bin

factory is 17 bytes and select.bin is 9 bytes

When I put include select.bin first the graphics work
but when i include factory.bin first the select.bin graphic is not shown on screen, it is just blank

both were created and exported from sevenup sprite editor.

Print this item

  too fast :)
Posted by: slenkar - 2011-02-22, 01:48 AM - Forum: Help & Support - Replies (8)

i have a cursor that i move around the screen with the keys but its too fast

when i press "p" it shoots half way across the screen, how do i make it move 1 square every half a second

Print this item

  clear ink from attr
Posted by: slenkar - 2011-02-22, 01:36 AM - Forum: Help & Support - Replies (6)

How do you use print to remove all ink from an attribute (8*8 square)

the opposite is 'print /::' to draw a block but i want to clear all ink away and leave the paper

Print this item

  Psyco for Python
Posted by: slenkar - 2011-02-22, 12:11 AM - Forum: Wishlist - Replies (2)

<!-- m --><a class="postlink" href="http://psyco.sourceforge.net/">http://psyco.sourceforge.net/</a><!-- m -->

Would this speed up compilation?

Print this item