Welcome, Guest |
You have to register before you can post on our site.
|
Online Users |
There are currently 335 online users. » 0 Member(s) | 333 Guest(s) Bing, Google
|
Latest Threads |
.tap file code not execut...
Forum: Help & Support
Last Post: Zoran
04-28-2025, 10:59 AM
» Replies: 4
» Views: 232
|
Exit from more than one l...
Forum: Wishlist
Last Post: Duefectu
04-23-2025, 10:06 PM
» Replies: 3
» Views: 270
|
put small ASM programs li...
Forum: How-To & Tutorials
Last Post: Zoran
04-18-2025, 02:02 PM
» Replies: 6
» Views: 1,543
|
Creating +3 Menus - Loadi...
Forum: Help & Support
Last Post: merlinkv
04-16-2025, 02:08 PM
» Replies: 6
» Views: 524
|
Randomize not very random...
Forum: Help & Support
Last Post: Zoran
04-08-2025, 10:40 AM
» Replies: 4
» Views: 423
|
Scope rules
Forum: Bug Reports
Last Post: Zoran
04-04-2025, 09:46 AM
» Replies: 2
» Views: 294
|
Using constants not allow...
Forum: Bug Reports
Last Post: baltasarq
03-19-2025, 10:00 PM
» Replies: 8
» Views: 1,026
|
404 page not found
Forum: Documentation
Last Post: boriel
03-08-2025, 07:16 PM
» Replies: 5
» Views: 2,868
|
Spectrum keywords codes
Forum: Bug Reports
Last Post: boriel
03-08-2025, 11:00 AM
» Replies: 1
» Views: 403
|
ZXodus][Engine
Forum: ZX Basic Compiler
Last Post: boriel
02-19-2025, 11:43 PM
» Replies: 69
» Views: 213,650
|
|
|
Maximal size for a compiled program |
Posted by: Week of the agents - 11-09-2019, 04:27 PM - Forum: Bug Reports
- Replies (17)
|
 |
Hi, I am developing game with ZX Basic for a Spectrum 48k and when total size of compiled code approach up to 35-36K shit happens. Program can hang on or some pixels on screen are highlighted or INKEY stops to working.
Is there some limit?
I load code at address 24576 (24K) so I thought I have 40K room for free.
|
|
|
Resta da siempre como resultado 0 |
Posted by: Alessandro - 10-20-2019, 05:08 PM - Forum: Help & Support
- Replies (2)
|
 |
Hola,
este código no funciona más en todas las versiones de la 1.9.3 en adelante. Hasta la 1.9.2 funcionaba. Empleadas bajo Windows 10.
Debeo restar 1 de una variable a dos dimensiones, pero el resultado es siempre 0 aunque el valor inicial no es 1:
Code: SUB addest()
CLS
' Determina qué habilidad estamos entrenando (1-5)
w = abi(7,n)
' -----------------------------------------------------------------------
' ACA ESTÁ EL PROBLEMA:
' Sube de 1 el número de turnos de entrenamiento requerido
abi(6,n) = abi(6,n) - 1
' EL RESULTADO ES SIEMPRE 0 AUNQUE abi(6,n) EN ESTE CASO ESTÁ PUESTO A 5
' -----------------------------------------------------------------------
' Si el entrenamiento aún no ha terminado, sale
IF abi(6,n) > 0 THEN PRINT AT 8,1; "TURNI: ";abi(6,n); AT 1,3; PAPER naz; "\{i7} PILOTA IN ADDESTRAMENTO ": GOTO esci3
' Calcula el resultado del entrenamiento
pseudorand()
' risultadd:
abi(w,n) = abi(w,n) + rand
' Nivel maximo 9
IF abi(w,n) > 9 THEN abi(w,n) = 9
' Imprime el resultado
PRINT AT 1,3; PAPER naz; "\{i7} RISULTATO ADDESTRAMENTO "
' Marca el piloto nuevamente como disponible
pilost$(n) = "D"
esci3:
PRINT AT 4,1; pilo$(n); AT 6,2; abl$(w); ": "; abi(w,n)
premitasto()
END SUB
Si en lugar de la variable dimensionada empleo una variable fija, el código funciona como deseado:
Code: SUB addest()
CLS
' Determina qué habilidad estamos entrenando (1-5)
w = abi(7,n)
k = abi(6,n)
' Sube de 1 el número de turnos de entrenamiento requerido
k = k - 1
' Si el entrenamiento aún no ha terminado, sale
IF k > 0 THEN PRINT AT 8,1; "TURNI: ";k; AT 1,3; PAPER naz; "\{i7} PILOTA IN ADDESTRAMENTO ": GOTO esci3
' Calcula el resultado del entrenamiento
pseudorand()
' risultadd:
abi(w,n) = abi(w,n) + rand
' Nivel maximo 9
IF abi(w,n) > 9 THEN abi(w,n) = 9
' Imprime el resultado
PRINT AT 1,3; PAPER naz; "\{i7} RISULTATO ADDESTRAMENTO "
' Marca el piloto nuevamente como disponible
pilost$(n) = "D"
esci3:
abi(6,n) = k
PRINT AT 4,1; pilo$(n); AT 6,2; abl$(w); ": "; abi(w,n)
premitasto()
END SUB
|
|
|
Ad Lunam |
Posted by: Alessandro - 07-28-2019, 12:19 PM - Forum: Gallery
- Replies (10)
|
 |
![[Image: AdLunam.png]](http://www.alessandrogrussu.it/zx/AdLunam.png)
Hi everybody,
this is my first project made with ZX-Basic: Ad Lunam, a strategy/management game for the 48K ZX Spectrum where you are put in charge of the space program of the United States or of the Soviet Union. Starting from 1956, you must send a crew on the Moon and safely back to Earth within 20 years.
Before you even attempt such a task you must research new spacecraft and equipment, plan and carry out missions, recruit and train pilots, and try to stay ahead of your opponents.
The game has not yet reached its final stage, and is currently at version 0.2. Users should be able to play it to the end, although some features have not yet been implemented, fine tuning is needed and bugs might still be present. So beware!
For now, game and documentation are only available in English. Italian will follow, then Spanish, and possibly other languages as well. There's a very large amount of text in it, so translation won't be an easy task.
Download link will stay unchanged on every release. Here it is: http://www.alessandrogrussu.it/zx/AdLunam.zip
Feedback is welcome. Enjoy!
|
|
|
Can values assigned with DIM be reinitialized? |
Posted by: Alessandro - 07-25-2019, 06:24 PM - Forum: How-To & Tutorials
- Replies (1)
|
 |
At the start of a program, some variables are declared and their values assigned accordingly, e.g.:
Code: start:
DIM year AS UBYTE = 56
DIM pre AS BYTE = 100
DIM stru(3,9) AS UBYTE => {{1,0,0,1,0,1,0,1,0}, {0,3,3,0,4,0,4,0,5}, {0,30,30,0,60,0,50,0,70}}
While the program is running, some of these values are changed:
Code: year = year + 10
stru(2,9) = 1
etc.
At the end, when the program should go back to the start
variables retain the values they held at that time instead of being reinitialized. To do that, I must explicitly insert a series of LET instructions after the DIMs, e.g.
Code: DIM year AS UBYTE
DIM pre AS BYTE
DIM stru(3,9) AS UBYTE
...
year = 56
pre = 100
RESTORE strudata
FOR n = 1 TO 3
FOR m = 1 TO 9
READ stru(n,m)
NEXT m
NEXT n
which is pretty annoying as well as making the program use more memory.
Is there any way to make DIM reinitialize variables?
|
|
|
Text scrolling |
Posted by: pinback - 07-22-2019, 08:12 PM - Forum: Help & Support
- Replies (11)
|
 |
I'm continuing my porto of an old ZX Spectrum program.
Now the next problem:
It was text based and printed everything to the bottom of the screen and the rest of the screen was scrolled.
With the Boriel Basic the behavior is different: Once the bottom of the screen is reached printing rolls over and continues at the top of the screen.
Is it possible to change the behavior so that it scrolls?
|
|
|
How redirect PRINT to the printer how makes LPRINT? |
Posted by: maeloterkim - 07-21-2019, 03:47 PM - Forum: Help & Support
- Replies (4)
|
 |
How redirect PRINT to the printer? how makes LPRINT?
HI
Is possible redirect the output of the PRINT to the printer ?
Something like
PRINT #3; "This go to the printer"
that print on the printer
or something like
OPEN #4, "p"
that redirects the channel four to the printer and after this we can do
PRINT #4; "This go to the printer"
Is there some "easy way" to do that with the ZX basic ?
Maybe there are some library that makes the LPRINT of the ZX spectrum
Thanks
|
|
|
Debugging |
Posted by: pinback - 07-21-2019, 10:50 AM - Forum: Help & Support
- Replies (7)
|
 |
Hi,
I have proved an old program from the ZX Spectrum Basic to Boriel's Basic.
Some 700 lines of code.
The program can compile now and it is running on a Spectrum emulator.
However I get an error "3 Subscript wrong, 30:1"
wich is a very generic error coming from the "RANDOMIZE USR 32768".
Is there any way to tell where the error occurred in my source file?
Here is what I used for compilation:
Code: python3 zxb.py -taB program.bas --array-base 1 --string-base 1 --debug-array --debug-memory
|
|
|
Is posible hide variables unused message on some functions? |
Posted by: maeloterkim - 06-26-2019, 01:07 PM - Forum: Help & Support
- Replies (1)
|
 |
HI
I know that i have variables unused on assembler functions
where I use assembler only and i grab the values for example like this LD E, (ix+8)
Is there any pragma or something to not show this on the compiler message?
because if i have a lot of assembler functions there are a lot of messy output on the compiler
with message like this : warning: Parameter 'parameterName' is never used
Can i hide this type of message when i know that is "unused" in a assembler function?
If i can hide this type of message is more easy to develop
i don't know something like
#thisFunction dontShowThisTypeOfMessage
I don't know if i explained myself
Thanks
|
|
|
What is the reserved data at $FF18 - $FFFF? |
Posted by: JMcGibbitts - 06-16-2019, 02:42 AM - Forum: Help & Support
- Replies (1)
|
 |
Hi.
I see data from address $FF18 (65304) - $FFFF. 231 bytes. It seems to start with F3 0D CE 0B E3 50 CE 0B... I have not seen it change size or start address across a few programs.
What is this data? Does it remain constant / static?
Provided I keep my main program code < $C000 and I copy this reserved data from $FF18, into all 128K banks 1-7, will I be free to use 128K paging as I choose, loading data and / or binary code into each page at specific addresses?
Will the program need this reserved data in the other 128K pages or is it maybe only used during program initialisation?
Thanks!
|
|
|
|