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: Zilog_Z80A
» Forum threads: 961
» Forum posts: 6,051

Full Statistics

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

Latest Threads
Print color bug
Forum: Bug Reports
Last Post: Darkstar
10-11-2022, 06:57 PM
» Replies: 18
» Views: 974
SIN and COS functions hav...
Forum: Bug Reports
Last Post: boriel
08-17-2022, 06:49 AM
» Replies: 2
» Views: 497
Binary into asm
Forum: Help & Support
Last Post: Nando
08-11-2022, 12:10 PM
» Replies: 12
» Views: 1,685
Set Number Layout to xx.0...
Forum: Help & Support
Last Post: boriel
08-02-2022, 10:32 PM
» Replies: 1
» Views: 461
Using Beepola with ZX BAS...
Forum: How-To & Tutorials
Last Post: Nando
08-02-2022, 09:25 PM
» Replies: 12
» Views: 21,611
HRPrintFast
Forum: Help & Support
Last Post: boriel
07-25-2022, 12:06 PM
» Replies: 2
» Views: 538
Features breaking compila...
Forum: Core
Last Post: Ljg701
06-19-2022, 08:44 AM
» Replies: 1
» Views: 609
New Text Adventure game u...
Forum: Gallery
Last Post: RandomiserUsr
06-01-2022, 10:21 PM
» Replies: 0
» Views: 452
Testing a variable within...
Forum: Help & Support
Last Post: RandomiserUsr
03-25-2022, 09:59 PM
» Replies: 11
» Views: 4,094
WHILE Loop vs FOR/NEXT Lo...
Forum: Help & Support
Last Post: RandomiserUsr
03-25-2022, 09:55 PM
» Replies: 2
» Views: 1,341

 
  Print color bug
Posted by: Darkstar - 10-03-2022, 08:18 PM - Forum: Bug Reports - Replies (18)

Code:
Declare sub CenterText (ByVal Row as ubyte, ByVal Text as string)

Ink 6
Paper 1
Print at 20, 0; "\k";

Ink 7
Paper 0

'Print ; 'Put here to update colors, there is a bug in the compiler.
CenterText (21, "Hello")


Sub CenterText (ByVal Row as ubyte, ByVal Text as string)

Dim i As UInteger

i = Len(Text) / 2
i = 16 - i
Print at Row, i; Text;

End sub

Hi there Boriel.

The above code does not work correctly, both the "K" and the word "Hello" come out with blue paper and yellow ink unless you unrem the print statement. Then the "Hello" comes out with black paper and white ink.

This was not a problem before, this is a recent problem. I can use this "print" workaround for the time being but there is a bug in the complier.

Print this item

  SIN and COS functions have bug ?
Posted by: papa_robot - 08-16-2022, 09:42 PM - Forum: Bug Reports - Replies (2)

Hello to the zx basic community. I'm integrating the compiler into my own spectrum bot.

I created a sample sinewave graph

Code:
FOR x = 10 TO 245 STEP 2
  PLOT x,100+SIN(2*x*PI/180)*50
NEXT x

However I see the values jump around 90 deg, see video here

https://twitter.com/ZxSpectrumBot1/statu...twCv438ECA

I cannot find any reference in the doc , it is supposed to be sinclair compatible, but in sinclair basic it works ok

https://twitter.com/ZxSpectrumBot1/statu...twCv438ECA

thanks a lot

Print this item

  Binary into asm
Posted by: Nando - 07-31-2022, 12:27 AM - Forum: Help & Support - Replies (12)

Hi everyone.

I'm trying to create a routine in assembly to copy an image from memory to the screen (a third of the screen, centered)
I know the assembly code to do this.
But, in ZX Basic, afaik, I must include the image from a bin file, and label it (I know how to do that)
So, if I need to use the address of the bin file, in Basic I would use @label (and this works)
But how to I use this label inside an asm routine?

Code:
art:
asm
incbin "final.bin"
end asm

pause 0
paper 0: ink 7: border 0: CLS

asm
ld hl,(_art)
ld de,18434
ld bc,2048
ED
LDIR
RET
end asm

It's probably some syntax issue. I need to load HL with the address of the bin file, but get "error: Undefined GLOBAL label '._art'" when compiling

Print this item

  Set Number Layout to xx.00?
Posted by: Lars_74 - 07-28-2022, 11:11 PM - Forum: Help & Support - Replies (1)

Hi,
I have been trying all evening to work on a very easy task. Well, I thought it would be easy... Nothing really worked and the only positive sideffect is that I learned a lot about ZX Basic.

I would like to set the number's layout to xx.00 Because it looks nicer.

Examples:
1.5 > 1.50
1 > 1.00
.1 > 0.10

The only thing I could come up is to work on two levels.
level a: the correct numbers the computer is working with, e.g. 12.012345
level b: the number handed over to a Sub-Routine which switches the number to a string, searches for "." and gives back a formated string to the main routine.


Thus: the Spectrum works with level a (number), the user only sees level b (string).

Is it really that difficult or is it me being just to stupid...?
Lars

Print this item

  HRPrintFast
Posted by: Nando - 07-23-2022, 07:42 PM - Forum: Help & Support - Replies (2)

Hello all.
This is my first post here.
I used to do some platform games in Sinclair Basic back in the early 90s, and am now planning on writing a new game using ZX Basic (kudos to Boriel for the fantastic work btw)
I am just begining so I might be making some silly questions, sorry in advance Wink

I am considering using HRPrintFast for sprites (in a similar way I used print back in the day, but without the 8pixel block limitation)
But the routine calls for 2 asm tables,  "Screentables.asm" and "Rotatetables.asm", which are not included (as far as I could see) in the library.
There is a link to a dropbox in the forum, but it's dead.
Can anyone help me get the asm code to make the routine work?

Thanks in advance.


Sorry, I think I just found them in another routine, on another post

Print this item

  Features breaking compilation in older ZXBasic programs
Posted by: MrKOSMOS - 06-17-2022, 06:51 AM - Forum: Core - Replies (1)

Hello

So I've been using ZXBasic for a while, and after struggling for a while trying to compile some code finally realised some issues. To sum it up, I tried compiling Souls Remastered, since the keyboard input wasn't working on my Timex TC2048. However, while trying to compile I kept getting IF statement errors, which I attributed to the compiler itself. However, it turned out to be due to comments placed in front of the IFs, which were being recognized as one-line commands and "resolving" the IFs, creating errors with the END IFs afterwards. This seems to date back to a previous version before the one-line IF feature was implemented. In fact, many other ZXBasic games by Retrobytes and even the BerkzMan game from the tutorials page seem to expect this feature to be absent in order to compile, so providing a solution seems like a must.
So what do I propose? Well, I see two solutions: One, adding a legacy option for the compiler, say -L. This would be the easiest, and allow compilation of unmodified older code.
Two: implementing a routine that counts all IFs and END IFs in the program flow and checks if they are the same, as well as checking for comments in front of IFs. This may be a more robust solution, letting everyone program as they want without having to check some obscure command line option.

Aside from that, there seem to be a few other bugs. There seems to be no check for writing to memory above the 64k limit, since I have written a few programs that, when loaded through the BASIC loader, give an Out Of Memory error on the Spectrum. Other than that, there seems to be a bunch of data added along the print command, which I assume is a character set. But is this really necessary when the program only uses UDGs or spaces? In that case, the whole set could be left out, saving a decent amount of space. It could even be optionally left out, and swapped for the ROM character set.

Well that would be all, please say what you think

Print this item

  New Text Adventure game underway
Posted by: RandomiserUsr - 06-01-2022, 10:21 PM - Forum: Gallery - No Replies

I have now spent over a year developing a prototype, to a short demo game and on to the new game, Framed!

You can follow the progress here:- 

Game Dev Blog » My Computer World

and how it started
Retro Game Dev » My Computer World

Not sure when it will be finished though as this done in my spare time.
Smile

Print this item

  The Disputed Territories of Ghotto
Posted by: Jbizzel - 03-21-2022, 05:29 PM - Forum: Gallery - No Replies

I made a new game

2 pixel scrolling city bomber type game, with a story built in.

Please let me know what you think. 

Credits:

zx basic,
putChar
zx0
zx paint
beepfx
beepola
DamienG fonts

get it here

Print this item

  WHILE Loop vs FOR/NEXT Loop
Posted by: RandomiserUsr - 03-12-2022, 10:05 AM - Forum: Help & Support - Replies (2)

Hi, quick question:


Programming styles aside which performs better at run time, WHILE or FOR/NEXT ?

I will guess with both are the same? :-)

Thanks

Print this item

Big Grin mine sweeper
Posted by: Jbizzel - 02-20-2022, 09:03 PM - Forum: Gallery - Replies (2)

I made a mine sweeper game for the zx spectrum.

the code is here. 


https://gitlab.com/JB1zzel1/mine-sweeper-zx-spectrum


I'll release it as a tap file with graphics when its finished.

The game is fully working as it is. just fine tuning everything now.

Print this item