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

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 289
» Latest member: rnleao
» Forum threads: 1,027
» Forum posts: 6,209

Full Statistics

Online Users
There are currently 300 online users.
» 0 Member(s) | 299 Guest(s)
Yandex

Latest Threads
Intermittent errors
Forum: Help & Support
Last Post: zarsoft
03-12-2024, 12:39 PM
» Replies: 0
» Views: 27
Store array information i...
Forum: Help & Support
Last Post: rbiondi
03-10-2024, 09:42 PM
» Replies: 0
» Views: 49
ScrollLeft function scrol...
Forum: Bug Reports
Last Post: rbiondi
03-07-2024, 03:57 PM
» Replies: 2
» Views: 196
string.bas errors when co...
Forum: Bug Reports
Last Post: rbiondi
03-01-2024, 10:10 AM
» Replies: 2
» Views: 193
Using Beepola with ZX BAS...
Forum: How-To & Tutorials
Last Post: edtoo
02-29-2024, 09:47 AM
» Replies: 15
» Views: 29,908
Johnny Bravo
Forum: Gallery
Last Post: zarsoft
02-11-2024, 11:20 PM
» Replies: 0
» Views: 183
Compiling +D G+DOS progra...
Forum: ZX Basic Compiler
Last Post: boriel
01-22-2024, 08:32 AM
» Replies: 4
» Views: 7,768
VAL = ? (solved)
Forum: Bug Reports
Last Post: zarsoft
01-03-2024, 11:44 PM
» Replies: 8
» Views: 1,726
Wrong math (solved)
Forum: Bug Reports
Last Post: zarsoft
01-03-2024, 11:38 PM
» Replies: 4
» Views: 911
Version 1.7.2 released!
Forum: ZX Basic Compiler
Last Post: boriel
01-01-2024, 07:38 PM
» Replies: 0
» Views: 282

 
  Intermittent errors
Posted by: zarsoft - 03-12-2024, 12:39 PM - Forum: Help & Support - No Replies

I have a subroutine that works well most of the time but sometimes gives an error.
Once every few hundred iterations it gives an error.
I tried changing the mathematical expression but it continues to give errors - sometimes in the old expression, other times in the new expression.
Intermittent errors also occur on other lines of this routine.
I tried changing the type of variables but it also gave errors.
Am I doing something wrong or is the compiler wrong?
If I delete most of the program the intermittent error may continue to appear or may stop appearing.

Does anyone have any idea what could be causing this?

Simplified routine:

Code:
SUB print_sprite (x0 AS LONG, y0 AS LONG)
DIM x,y AS LONG
DIM Width,Height AS LONG
DIM xold AS LONG

LET xold=x0-INT(SPRITES(ix_SpriteWidth)/2)

LET Width=SPRITES(ix_SpriteWidth)
LET x=x0-INT(Width/2)

IF x<>xold THEN PRINT AT 10,10;" xold=";xold;" x=";x: PAUSE 0
END SUB


LET SPRITES(ix_SpriteWidth) = 8

print_sprite(236,46)
' sometimes printout is
xold=232 x=236
'x in error

print_sprite(84,90)
' sometimes printout is
xold=84 x=80
'xold in error

Print this item

  Store array information in extended memory (128kb)
Posted by: rbiondi - 03-10-2024, 09:42 PM - Forum: Help & Support - No Replies

Hello,

Is it possible storing arrays and/or Strings in Zx Spectrum Extended Memory (128kb)? 
How could this would be accomplished?

Thank you very much!
Rogerio

Print this item

  ScrollLeft function scrolling more than 1 pixels left
Posted by: rbiondi - 03-01-2024, 10:42 AM - Forum: Bug Reports - Replies (2)

Hello,

I'm trying to use the ScrollLeft function to create a scrolling chart and the ScrollLeft function seems to be scrolling more than 1 pixel left. 
The screening area on the left also seems to be not to be pixel acurate. 

Sample program:

Code:
#include <scroll.bas>

INK 7
PAPER 0
CLS
sub square(x1 as UBYTE, y1 as UBYTE, x2 as UBYTE, y2 as UBYTE, color as UBYTE)
    DIM x AS UBYTE = 0
    DIM y AS UBYTE = 0
    FOR x = 0 TO x2 - x1
        PLOT INK color; x1 + x, y1
        PLOT INK color; x1 + x, y2
    NEXT x
    FOR y = 0 TO y2 - y1
        PLOT ink color; x1, y1 + y
        PLOT ink color; x2, y1 + y
    NEXT y
END SUB
SUB plott(x as FLOAT, y as FLOAT, sx as FLOAT, sy as FLOAT, x1 as UBYTE, y1 as UBYTE, x2 as UBYTE, y2 as UBYTE, color as UBYTE)
    DIM alfa AS UINTEGER
    DIM beta AS UINTEGER
    DIM mx AS UINTEGER
    alfa = ((x/sx) * (x2 - x1)) + x1
    beta = ((y/sy) * (y2 - y1)) + y1 + ((y2-y1)/2)
    ' Limites da tela
    IF alfa >= x2 - 1 then alfa = x2 - 1
    IF beta <= y1 + 1 then beta = y1 + 1
    mx = alfa mod x2
    IF alfa >= (x2-1) then
        ScrollLeft(x1 + 1, y1 + 1, x2 - 1, y2 - 1)
        alfa = x2-1
    END IF
    PRINT at 10,10; "alfa: "; alfa
    PRINT at 11,10; "beta: "; beta
    PLOT ink color; alfa, beta
END SUB
square(10, 15, 80, 60, 6)
DIM dia AS INTEGER
DIM valor AS float = 0
DIM incremento AS FLOAT = 1
' Create a sample scrolling chart
FOR dia = 1 TO 5000
    plott(dia, valor, 360, 100000, 10, 15, 80, 60, 6)
    valor = valor + 1000 * incremento
    IF valor > 49000 then incremento = -1
    IF valor < -49000 then incremento = 1
NEXT dia


Thank you very much!

Print this item

  string.bas errors when compiling with strict
Posted by: rbiondi - 02-23-2024, 11:29 AM - Forum: Bug Reports - Replies (2)

Hello,

I'm trying to compile my program with --strict option and getting some errors in string.bas:


Code:
zxbasic/src/arch/zx48k/library/string.bas:124: error: strict mode: missing type declaration for 's$'

I just fixed and tried to create a branch and send a merge request to zxbasic git repository but I'm not authorized.


Thank you,
Rogerio

Print this item

  Johnny Bravo
Posted by: zarsoft - 02-11-2024, 11:20 PM - Forum: Gallery - No Replies

To play online, click HERE.

[Image: Johnny%20Bravo%20-%20Run%20Johnny%20Run%...oft%5d.png]

Print this item

  Version 1.7.2 released!
Posted by: boriel - 01-01-2024, 07:38 PM - Forum: ZX Basic Compiler - No Replies

Well, long time I don't announce new releases here (usually goes to Twitter or Mastodon).

  • ! Fixes bugs related to using CONST strings
  • ! Fixed a bug with local Arrays of Floats
  • ! Fix PEEK (ULong, ...)
  • Other minor errors fixes and improvements
  • NextTool is now directly executable

Download it here: https://zxbasic.readthedocs.io/en/latest/archive/

Print this item

Photo Mimex
Posted by: rbiondi - 12-31-2023, 11:08 PM - Forum: Gallery - No Replies

Hi,

I hope you and your families had a Merry Christmas.

I'm publishing this post before the end of this year (2023)  to announce a new game in development for the ZX Spectrum Computers (ZX Spectrum 128 and ZX Spectrum Next).

BOVESPA (B3) is the Brazilian Stock Exchange. It was formerly called "Bolsa de Valores de São Paulo"  before changing its name to B3 (Brasil, Bolsa, Balcão), founded on August 23, 1890.

If you want to know more about B3, follow this link.

MIMEX is a game inspired by the Magnavox Odyssey 2 game "The Great Wall Street Treasure Hunt" from the Strategy Series. 
Odyssey 2  was marketed here in Brazil by Philips and this was my first videogame.  I received it from my parents as a Christmas Gift, in 1983, with the large Wall Street box, that was the first game I played on this system. It was a deception because I was only 8 years old and could barely pass the Level 1 game (buy and sell stocks). But 40 years passed since then and now I'm older, stronger, smarter and faster Wink , and I'm finishing my MBA in Capital Markets and Investments, so I just wanted to recreate a much improved version of the childwood game with the following features:

- Buy and Sell Stocks (Level 1);
- Buy and Sell Treasure Bills (Improved Level2);
- Buying on Margin (Improved Level 3);
- Buy and Sell PUT or CALL Options (Improved  Level 4);
- IR (Investor Relations Events) - 1:2 splits, 2:1 grouping, dividend payments, judicial recoveries and bankruptcies;
- Much Improved Market Engine, written from scratch;
- Updated tickers (Brazilian B3);
- Updated news headlines; 

Other improvements in consideration:

- 4 Players (instead of the original 2 players);
- Game length selection (1 - 5 years) ;
- Other secret improvements to be disclosed in the future;

[Image: dI%2BeNV.png]

Best regards and a happy new year to all!
Rogerio Biondi


More info:


Game Page

Print this item

  Rounding float numbers to 2 decimal places
Posted by: rbiondi - 12-29-2023, 10:41 PM - Forum: How-To & Tutorials - Replies (2)

Hello,

I need to round or at least truncate a Float variable to 2 decimal places.
Do you know how this could be accomplished since there's no ROUND function?

Thank you very much,
Rogerio

Print this item

  Jesus versus The Romans
Posted by: zarsoft - 12-27-2023, 12:51 AM - Forum: Gallery - No Replies

To play online click HERE
[Image: Jesus%20versus%20The%20Romans%20(Boriel)...oft%5d.png]

Print this item

  From Forum
Posted by: zarsoft - 12-07-2023, 02:54 PM - Forum: Wishlist - Replies (1)

Email notifications from the Forum come from "Forum".

WICH FORUM?!

Can you change 
Forum <forum@boriel.com>
To
Boriel Forum <forum@boriel.com>
or
ZX BASIC Forum <forum@boriel.com>

or something like that?


Thanks.

Print this item