Welcome, Guest |
You have to register before you can post on our site.
|
Online Users |
There are currently 225 online users. » 0 Member(s) | 223 Guest(s) Bing, Google
|
Latest Threads |
Красивые букетики
Forum: News
Last Post: AnthonyGaxia
5 hours ago
» Replies: 0
» Views: 7
|
Printing with FZX
Forum: Help & Support
Last Post: boriel
07-17-2025, 09:08 PM
» Replies: 1
» Views: 360
|
Strange Happenings
Forum: Bug Reports
Last Post: boriel
05-23-2025, 09:15 AM
» Replies: 4
» Views: 2,534
|
.tap file code not execut...
Forum: Help & Support
Last Post: Zoran
04-28-2025, 10:59 AM
» Replies: 4
» Views: 2,712
|
Exit from more than one l...
Forum: Wishlist
Last Post: Duefectu
04-23-2025, 10:06 PM
» Replies: 3
» Views: 2,264
|
put small ASM programs li...
Forum: How-To & Tutorials
Last Post: Zoran
04-18-2025, 02:02 PM
» Replies: 6
» Views: 5,267
|
Creating +3 Menus - Loadi...
Forum: Help & Support
Last Post: merlinkv
04-16-2025, 02:08 PM
» Replies: 6
» Views: 3,698
|
Randomize not very random...
Forum: Help & Support
Last Post: Zoran
04-08-2025, 10:40 AM
» Replies: 4
» Views: 3,435
|
Scope rules
Forum: Bug Reports
Last Post: Zoran
04-04-2025, 09:46 AM
» Replies: 2
» Views: 1,953
|
Using constants not allow...
Forum: Bug Reports
Last Post: baltasarq
03-19-2025, 10:00 PM
» Replies: 8
» Views: 4,738
|
|
|
Value of FastPlot library |
Posted by: patters - 01-28-2021, 06:39 PM - Forum: Help & Support
- Replies (9)
|
 |
Is the FastPlot library really going to be faster than a compiled PLOT instruction? Since you've optimised your own PRINT implementation, I would assume that PLOT and DRAW compile to pretty lean machine code do they not? I did some very basic testing comparison of filling using DRAW commands versus looping through FastPlots instead and it seemed roughly the same. Is it perhaps that some libraries are old, and now the compiler is as good with native commands in terms of performance?
|
|
|
PRINT AT 22,0 |
Posted by: patters - 01-27-2021, 06:57 PM - Forum: Help & Support
- Replies (2)
|
 |
Is it normal that the entire screen scrolls every time I print at line 22 - not even filling the line? Surely it should behave like the other lines, no? Or else it's not much of an improvement over Sinclair BASIC's PRINT #0; AT 1,0;
|
|
|
Compiler optimization setting |
Posted by: patters - 01-27-2021, 06:35 PM - Forum: Help & Support
- Replies (2)
|
 |
Is it a good idea to use -O3? I know typically there are trade-offs - like loop unrolling can make code bigger in order to become faster. Is there much of a difference for ZX Basic between -O2 and -O3? Am I better off sticking to the default -O2 since it's more tried and tested?
Or since I'm not yet running into memory limits should I use -O3 while I can?
|
|
|
Mute compiler warnings for included libraries |
Posted by: patters - 01-26-2021, 03:24 PM - Forum: Library
- Replies (1)
|
 |
Every time I compile I get a big wall of text of warnings about unused variables and functions in libraries that are included in my program (input.bas, attr.bas and its own includes, HRPrint.bas, fastTrig.bas). Could such warnings for libraries be muted by default perhaps and make them elective for library debugging, or at least allow me to exclude them in my build script? I didn't write these pieces of code, so I'm not interested in these warnings. However if I mute all warnings then I could miss an issue with my own code. Even with warnings enabled I have missed many genuine warnings because they were drowned out by the noise (variable unused is the classic one - when a name has been mistyped or the capitalisation is wrong somewhere in the listing).
|
|
|
Screen attribute statement ignored on SUB exit (*solved*) |
Posted by: patters - 01-26-2021, 12:22 PM - Forum: Bug Reports
- Replies (5)
|
 |
If I have multiple attribute changes on a single line, the last one is ignored on exit from a SUB.
Consider this example which exposes the problem:
Code: SUB screenAttributes
PAPER 3: INK 7: BRIGHT 1
END SUB
SUB screenAttributes2
PAPER 4: BRIGHT 1: INK 2
END SUB
CLS
screenAttributes()
PRINT AT 0,0;"test"
screenAttributes2()
PRINT AT 2,0;"test2"
For the first example print, it should be bright but it isn't.
The second example print should have red ink but it doesn't.
I thought I was going mad until I found this.
If I substitute another command in this last statement position of the SUB (like a PRINT for instance) then that works. It's only attribute assignments that seem to fail. Also, if I insert another command before the END SUB, then it all works as expected. e.g. the below code works fine:
Code: SUB screenAttributes
PAPER 3: INK 7: BRIGHT 1
BEEP 0.1,60
END SUB
SUB screenAttributes2
PAPER 4: BRIGHT 1: INK 2
BEEP 0.1,60
END SUB
CLS
screenAttributes()
PRINT AT 0,0;"test"
screenAttributes2()
PRINT AT 2,0;"test2"
On further testing, the issue is not related to multiple colon-separated statements on the same line. With the following code the compiler also loses the last statement in each Sub and fails to work as expected:
Code: SUB screenAttributes
PAPER 3
INK 7
BRIGHT 1
END SUB
SUB screenAttributes2
PAPER 4
BRIGHT 1
INK 2
END SUB
CLS
screenAttributes()
PRINT AT 0,0;"test"
screenAttributes2()
PRINT AT 2,0;"test2"
|
|
|
Creating a populated array of strings |
Posted by: patters - 01-26-2021, 01:07 AM - Forum: Help & Support
- Replies (1)
|
 |
Hi Boriel,
I notice that I cannot do the following:
Code: DIM stringArray(2) AS STRING => {"apples", "oranges", "pears"}
The compiler returns "error: Initializer expression is not constant."
Digging on this forum reveals a post from 2009, in which you state this is not possible because string lengths are dynamic. Is this still the case? As you posted in that thread, it ought to be simple to just have the compiler run a bunch of individual LET assignments, but it's a bit ugly to have to type them out.
Thanks,
Patters
|
|
|
Clearing an array |
Posted by: patters - 01-19-2021, 10:47 PM - Forum: Help & Support
- Replies (6)
|
 |
What is the recommended way to reset an array's contents? Do we have to run a FOR loop from 0 TO UBOUND and clear it element by element, or is there a neater way?
I see that the following doesn't work:
|
|
|
Custom TAP loader with SCREEN$ |
Posted by: patters - 01-17-2021, 06:24 PM - Forum: Help & Support
- Replies (6)
|
 |
I have a Sinclair BASIC loader for my game which will CLEAR 32767, load a SCREEN$, LOAD ""CODE, and finally RANDOMIZE USR 32678. I have assembled the loader and the SCREEN$ into a TAP file - but how to I get zxbc.py to append its output to this TAP file? I can't seem to get it to work.
When I try:
Code: ./zxbc.py -t --append-binary ../loader+scr.tap ../arti12.bas
I get a file arti12.tap as expected but it doesn't load the machine code. If I browse the TAP file in Fuse emulator I see that zxbc.py appears to have prepended an additional self-contained TAP file into the loader TAP file, rather than appended the binary data. Am I doing this wrong, or is this a bug?
I have managed to work around the issue by producing a .bin file instead, and then Fuse's 'Import Binary Data' option and then saving the memory range back out to the mounted TAP file - but it would be much nicer to automate that with zxbc.py if possible.
Thanks
|
|
|
Documentation frequently offline |
Posted by: patters - 01-13-2021, 12:01 PM - Forum: Documentation
- No Replies
|
 |
Hi,
I have been frequently referring to the ZX Basic documentation while I have been programming. I find that at random (but multiple times a day) the search feature on the wiki returns no results for a short period which is quite frustrating. It's happened again right now. During though outages, luckily I can consult the markdown files on GitHub. However, they don't have a search function, which is useful so I do prefer the wiki.
I also notice that the boriel.com landing site frequently drops off the Internet late at night too. Can you perhaps set up some kind of host monitoring to determine just how big a problem this is, or maybe raise a support ticket with the webhost?
Thanks,
Patters
|
|
|
|