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

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 264
» Latest member: ChrisEmask
» Forum threads: 1,075
» Forum posts: 6,435

Full Statistics

Online Users
There are currently 178 online users.
» 0 Member(s) | 176 Guest(s)
Bing, Google

Latest Threads
Strange Happenings
Forum: Bug Reports
Last Post: zedex82
Yesterday, 09:05 AM
» Replies: 0
» Views: 14
.tap file code not execut...
Forum: Help & Support
Last Post: Zoran
04-28-2025, 10:59 AM
» Replies: 4
» Views: 381
Exit from more than one l...
Forum: Wishlist
Last Post: Duefectu
04-23-2025, 10:06 PM
» Replies: 3
» Views: 318
put small ASM programs li...
Forum: How-To & Tutorials
Last Post: Zoran
04-18-2025, 02:02 PM
» Replies: 6
» Views: 1,638
Creating +3 Menus - Loadi...
Forum: Help & Support
Last Post: merlinkv
04-16-2025, 02:08 PM
» Replies: 6
» Views: 579
Randomize not very random...
Forum: Help & Support
Last Post: Zoran
04-08-2025, 10:40 AM
» Replies: 4
» Views: 917
Scope rules
Forum: Bug Reports
Last Post: Zoran
04-04-2025, 09:46 AM
» Replies: 2
» Views: 363
Using constants not allow...
Forum: Bug Reports
Last Post: baltasarq
03-19-2025, 10:00 PM
» Replies: 8
» Views: 1,096
404 page not found
Forum: Documentation
Last Post: boriel
03-08-2025, 07:16 PM
» Replies: 5
» Views: 2,904
Spectrum keywords codes
Forum: Bug Reports
Last Post: boriel
03-08-2025, 11:00 AM
» Replies: 1
» Views: 435

 
  Not so much a bug, as slow!
Posted by: britlion - 11-11-2012, 04: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!

Print this item

  Label as a string var
Posted by: oblo - 11-06-2012, 08: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 Smile
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

Print this item

  Default Strings
Posted by: compiuter - 11-05-2012, 10: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?

Print this item

  Some glitches (*solved*)
Posted by: LCD - 10-13-2012, 07: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:
Code:
z=CODE(INKEY$)

Print this item

  DIM var ... AT @address (*solved*)
Posted by: LCD - 10-11-2012, 08: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.

Print this item

  Cooming 2013: "Yumiko in the haunted Mansion"
Posted by: LCD - 10-03-2012, 06:38 PM - Forum: Gallery - Replies (35)

I'm currently working on a survival horror game for the Spectrum. Today posted two screenshots of the game in my forum:
<!-- m --><a class="postlink" href="http://lcd.forenworld.at/viewtopic.php?f=14&t=32">http://lcd.forenworld.at/viewtopic.php?f=14&t=32</a><!-- m -->
Yumiko is not Nanako! Yumiko has no sex appeal. And Yumiko is not alone in a haunted mansion...
The lightning effect is working well and fast enough. The game mechanic is finished until I can find some bugs, and no levels designed yet.
The "Death" sequence is disturbing, I promise! Imagine a tentacle grabing this girl foot and pulling her out of the visible field.
Yumiko game is not suitable for children who fear darkness! In fact even some adult had nightmares after playing the test level. I had not a good feeling to let a little girl walking alone in a nightie in a demonic mansion at night, but it looks like it works Wink.

Print this item

  Randomize problem? (*solved*)
Posted by: na_th_an - 09-27-2012, 10: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

Print this item

  started msx version - help needed as well
Posted by: nitrofurano - 09-20-2012, 02:06 PM - Forum: Wishlist - Replies (28)

also started the msx version as well - the .rom file is created fine, but i still don't know why the .rom file isn't running on OpenMSX - if someone know, please let me know! Smile

for now, the idea is to support msx1, msx2, msx2+, and gfx9000 in the libraries - and having zxbasic-compiler as an useful tool for creating stuff like for contests like msxdev (for this year, the deadline is at november 30! Big Grin )



Attached Files
.zip   example01_msx_zxbasic.zip (Size: 18.6 KB / Downloads: 1196)
Print this item

  a proposal for an icon
Posted by: nitrofurano - 09-20-2012, 01: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:
[Image: zxbasiccompilericonc.png]

Print this item

  6502.py , 6809.py, 68000.py, etc.
Posted by: nitrofurano - 09-19-2012, 11:47 AM - Forum: Wishlist - Replies (3)

Since z80.py is the essential part of zxbasic-compiler that is used for reference when compiling the resulting .asm into binary, would be a good idea if we start to create similar code for 6502, 6809, 68000, etc., for expanding zxbasic-compiler to other 8bit/16bit platforms? would be this a good start?

Print this item