| Welcome, Guest |
You have to register before you can post on our site.
|
| Forum Statistics |
» Members: 272
» Latest member: sdo303
» Forum threads: 1,084
» Forum posts: 6,479
Full Statistics
|
| Online Users |
There are currently 175 online users. » 0 Member(s) | 172 Guest(s) Baidu, Bing, Google
|
| Latest Threads |
non-paged supervisor code...
Forum: Help & Support
Last Post: sdo303
57 minutes ago
» Replies: 3
» Views: 34
|
How to open fuse as an ex...
Forum: How-To & Tutorials
Last Post: Duefectu
2026-02-09, 01:52 PM
» Replies: 3
» Views: 778
|
Old zxbasic game errors
Forum: Help & Support
Last Post: boriel
2025-11-09, 11:52 AM
» Replies: 7
» Views: 1,326
|
Error: Undefined GLOBAL l...
Forum: Help & Support
Last Post: ardentcrest
2025-11-04, 05:46 PM
» Replies: 3
» Views: 650
|
A Fast(er) Plot Routine f...
Forum: How-To & Tutorials
Last Post: tubz74
2025-10-30, 03:16 PM
» Replies: 2
» Views: 719
|
Hall of Fame - Include fo...
Forum: How-To & Tutorials
Last Post: tubz74
2025-10-28, 03:48 PM
» Replies: 0
» Views: 395
|
[SOLVED] Array layout bug...
Forum: Bug Reports
Last Post: Zoran
2025-10-25, 05:48 PM
» Replies: 2
» Views: 778
|
3DOS Commands?
Forum: Help & Support
Last Post: boriel
2025-10-06, 02:54 PM
» Replies: 3
» Views: 912
|
CLS/Fade out ASM Sub-rout...
Forum: How-To & Tutorials
Last Post: tubz74
2025-10-05, 03:39 PM
» Replies: 2
» Views: 685
|
ZX Basic Studio Bugs
Forum: Bug Reports
Last Post: Duefectu
2025-09-23, 04:07 PM
» Replies: 5
» Views: 1,784
|
|
|
| Print String Bug (*solved*) |
|
Posted by: britlion - 2012-11-12, 11:41 PM - Forum: Bug Reports
- Replies (14)
|
 |
Confirmed - this demonstrates it. zxb 1.3.0-s928
Code: DIM score as uLong
SUB displayScore(amount as ulong)
ink 2
dim a$ as string
a$="000000"+STR$(amount)
print at 12,12;a$(LEN a$-7 TO);"#"
END SUB
FOR score= 0 to 1000000 step 10
displayScore(score)
NEXT score
Should print a string, followed by a # - but the # ends up printing OVER the prior string, not after it and then on the next line and all over the place - the printed string seems to print beyond where it should. Seems to work on some numbers - so perhaps it's a STR$ bug? Though I think I've seen it on non STR$ stuff.
I just spent ages recompiling Berksman trying to find where on earth it was printing blank data across half the screen - It was the print line above! Not my fault!
|
|
|
| Not so much a bug, as slow! |
|
Posted by: britlion - 2012-11-11, 05:05 PM - Forum: Bug Reports
- Replies (24)
|
 |
This program was posted on the WOS forums:
Code: For x=-100 To 100
For y=-100 To 100
If (x/2-25)*(x/2-25)+(y-50)*(y-50)<200 Or (x/2+25)*(x/2+25)+(y-50)*(y-50)<200 then plot x+100,96-y
Next y
Next x
And if run as is, takes about 9 seconds in Basic, I think.
As ZX Basic:
Code: FUNCTION t() as uLong
asm
DI
LD DE,(23674)
LD D,0
LD HL,(23672)
EI
end asm
end function
DIM x,y as integer
DIM time as uLONG
time=t()
For x=-100 To 100
For y=-100 To 100
If (x/2-25)*(x/2-25)+(y-50)*(y-50)<200 Or (x/2+25)*(x/2+25)+(y-50)*(y-50)<200 then plot x+100,96-y
END IF
Next y
Next x
time=t()-time
print CAST(float,time)/50
It takes 53 seconds!
|
|
|
| Label as a string var |
|
Posted by: oblo - 2012-11-06, 09:56 PM - Forum: ZX Basic Compiler
- Replies (3)
|
 |
Hi all
Long time no see around here :oops: but now I'm getting some free time to spend with ZX Basic, so I hope to come more often 
In fact, I have a question: I want to store a label name in a variable, in order to do GOSUBs using a var, not fixed names. I made this code so far, but it fails with the message 'identifier 'eti$' is a var, not a label':
Code: #INCLUDE <keys.bas>
paper 0: border 0: ink 7: cls
dim eti$
eti$="l01"
while 1=1
if Multikeys(KEY1)<>0 then
eti$="l01"
gosub eti$
elseif Multikeys(KEY2)<>0 then
eti$="l02"
gosub eti$
elseif Multikeys(KEY3)<>0 then
eti$="l03"
gosub eti$
end If
end While
l01:
print at 0,0;ink 1;"ESTAS EN LA ETI1";
RETURN
l02:
print at 0,0;ink 2;"ESTAS EN LA ETI2";
RETURN
l03:
print at 0,0;ink 3;"ESTAS EN LA ETI3";
RETURN
Can be it done or what I'm asking is impossible right now? Note that I'm asking for a string, not numbers.
Thanks and regards
|
|
|
| Default Strings |
|
Posted by: compiuter - 2012-11-05, 11:07 AM - Forum: Wishlist
- Replies (1)
|
 |
I don“t know about the default strings, but old compilers had options to select string length, my question is about effect of retail length of strings. Example: DefaultShort=8 chars DefaultLong=32 chars.
What do you think of this?
|
|
|
| Some glitches (*solved*) |
|
Posted by: LCD - 2012-10-13, 08:38 PM - Forum: Bug Reports
- Replies (12)
|
 |
So, I found some glitches again.
1. In Optimisation modes when procedures (e.g. dummy procedures for ASM containers as used in BeepFX) are not called, ZXBC shows a warning that procedures are not used, but exit with exitcode 1 (Error).
2. Assigning part of String variables do not work. Compiler says, Variable is not Array, but in Sinclair BASIC it works. This example changes string "Test188" to "Tezt188".
Code: 10 LET a$="Test188"
20 PRINT a$(3)
30 LET a$(3)="z"
40 PRINT a$
3. This crases the Spectrum when compiled:
|
|
|
| DIM var ... AT @address (*solved*) |
|
Posted by: LCD - 2012-10-11, 09:56 PM - Forum: Bug Reports
- Replies (7)
|
 |
Hi Boriel.
The Address of a label or variable is afaik a constant (@label/@variable), so I wonder why it is not possible to use it in the DIM:
Code: DIM variable AS UINTEGER AT @label
is rejected by the compiler.
I understand why it would reject variables, even if this would be useful, but @labels or @variablenames should be IMHO not rejected. I just noticed the saved space when using DIMed variable to a adress and then equation label=variable over POKE UINTEGER @label,value. Used this technique in "Yumiko in the haunted Mansion" to read and write frames counter system variable. This made a lot stuff simpler.
|
|
|
| Randomize problem? (*solved*) |
|
Posted by: na_th_an - 2012-09-27, 11:52 AM - Forum: Bug Reports
- Replies (7)
|
 |
I've searched the forums about this issue but I haven't found anything.
I gather that RANDOMIZE uses the timer to seed the variable, doesn't it? So this program, depending on the time I take to press the key, should render different numbers. Well, the result is always 6.
Code: Print "PRESS KEY": Pause 0
Randomize
Let a = Int (Rnd * 10)
Print a
If I try...
Code: '''
Dim a as uByte
Dim b as uByte
Print "PRESS KEY": Pause 0
b = Peek 23672
Print "FRAMES LSB IS "; b
Randomize b
let a = Int (Rnd * 10)
Print a
The result is always 0, no matter which value is in b. This shouldn't be!
I'm using 1.2.9-s888
|
|
|
| a proposal for an icon |
|
Posted by: nitrofurano - 2012-09-20, 02:15 PM - Forum: Wishlist
- Replies (2)
|
 |
Boriel asked me to ask you all here, and i think it's not so offtopic (i don't know where else to ask it, since it's not a technical question)
as far as we may need to create groups about zxbasic-compiler, like at identi.ca, twitter, facebook, create a favicon for this project, etc. - maybe we need a icon/logomark for this project, for a better/easier visual identification
the idea is, since it is becoming multitarget (besides zx-spectrum only), and the essential would be making it targeting the processor itself, and since these processors are from around 70's and 80's, i used a colour palette very used on 70's (and some computers from that time, like from Atari and Commodore uses this palette as well), and the cube as the most used to represent a basic compiler-interpreter, and the simplicity because how simple is to use a tool like zxbasic-compiler - what do you all think?
the final version is this one:
|
|
|
|