Welcome, Guest |
You have to register before you can post on our site.
|
Online Users |
There are currently 448 online users. » 0 Member(s) | 445 Guest(s) Bing, Facebook, Yandex
|
Latest Threads |
Includes in ASM
Forum: How-To & Tutorials
Last Post: bracckets
04-04-2024, 12:17 AM
» Replies: 2
» Views: 668
|
Intermittent errors
Forum: Help & Support
Last Post: zarsoft
03-12-2024, 12:39 PM
» Replies: 0
» Views: 366
|
Store array information i...
Forum: Help & Support
Last Post: rbiondi
03-10-2024, 09:42 PM
» Replies: 0
» Views: 476
|
ScrollLeft function scrol...
Forum: Bug Reports
Last Post: rbiondi
03-07-2024, 03:57 PM
» Replies: 2
» Views: 931
|
string.bas errors when co...
Forum: Bug Reports
Last Post: rbiondi
03-01-2024, 10:10 AM
» Replies: 2
» Views: 820
|
Using Beepola with ZX BAS...
Forum: How-To & Tutorials
Last Post: edtoo
02-29-2024, 09:47 AM
» Replies: 15
» Views: 33,348
|
Johnny Bravo
Forum: Gallery
Last Post: zarsoft
02-11-2024, 11:20 PM
» Replies: 0
» Views: 522
|
Compiling +D G+DOS progra...
Forum: ZX Basic Compiler
Last Post: boriel
01-22-2024, 08:32 AM
» Replies: 4
» Views: 8,827
|
VAL = ? (solved)
Forum: Bug Reports
Last Post: zarsoft
01-03-2024, 11:44 PM
» Replies: 8
» Views: 3,517
|
Wrong math (solved)
Forum: Bug Reports
Last Post: zarsoft
01-03-2024, 11:38 PM
» Replies: 4
» Views: 1,925
|
|
|
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
|
|
|
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
|
|
|
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
|
|
|
The sound effect thread |
Posted by: worcestersource - 02-19-2022, 12:03 AM - Forum: How-To & Tutorials
- Replies (3)
|
|
Hello everyone,
I thought this would be a nifty place to pop some routines to make sound effects without resorting to asm.
Code: sub soundBwop()
dim x, y as uByte
do until x = 255
out 254, (y * 8)
let y = x
do until y > 239
let y = y + 16
loop
let x = x + 1
loop
end sub
Which makes a nice 'bwop' sound. it'll also change your border colour, so add the border value to the out statement to stop it changing colour. For example, for the a blue border:
Code: out 254, (y * 8) + 1
You can play around with this, such as changing the 16 for an 8, or making y count down so the loop duration gets longer each time.
Steve
|
|
|
Testing a variable within a range |
Posted by: worcestersource - 01-27-2022, 08:14 PM - Forum: Help & Support
- Replies (11)
|
|
Hello!
I was wondering if there was a better way of testing whether a variable was within a range.
So instead of:
Code: IF a > 0 and a < 30 then...
There was a neater and/or more memory efficient method? These sorts of tricks that can help us eke out every last drop out of zxbasic.
Cheers,
Steve
|
|
|
|