Welcome, Guest |
You have to register before you can post on our site.
|
Online Users |
There are currently 21 online users. » 0 Member(s) | 20 Guest(s) Google
|
Latest Threads |
Robo stalker
Forum: Gallery
Last Post: Week of the agents
8 hours ago
» Replies: 2
» Views: 22
|
DIM At?
Forum: Help & Support
Last Post: boriel
11-25-2019, 09:47 AM
» Replies: 8
» Views: 2,096
|
Disable scroll
Forum: How-To & Tutorials
Last Post: Alessandro
11-20-2019, 09:41 AM
» Replies: 6
» Views: 245
|
Maximal size for a compil...
Forum: Bug Reports
Last Post: Week of the agents
11-20-2019, 09:24 AM
» Replies: 12
» Views: 440
|
What is the sintaxis for ...
Forum: Help & Support
Last Post: maeloterkim
11-14-2019, 02:24 PM
» Replies: 4
» Views: 184
|
Ad Lunam
Forum: Gallery
Last Post: Alessandro
11-02-2019, 03:36 PM
» Replies: 6
» Views: 456
|
Resta da siempre como res...
Forum: Bug Reports
Last Post: Alessandro
10-26-2019, 08:08 AM
» Replies: 1
» Views: 178
|
Text scrolling
Forum: Help & Support
Last Post: boriel
07-29-2019, 09:23 PM
» Replies: 6
» Views: 451
|
Can values assigned with ...
Forum: How-To & Tutorials
Last Post: boriel
07-29-2019, 08:30 AM
» Replies: 1
» Views: 248
|
Debugging
Forum: Help & Support
Last Post: pinback
07-25-2019, 03:00 PM
» Replies: 6
» Views: 435
|
|
|
Maximal size for a compiled program |
Posted by: Week of the agents - 11-09-2019, 04:27 PM - Forum: Bug Reports
- Replies (12)
|
 |
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: Bug Reports
- Replies (1)
|
 |
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 (6)
|
 |
![[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: <!-- m --><a class="postlink" href="http://www.alessandrogrussu.it/zx/AdLunam.zip">http://www.alessandrogrussu.it/zx/AdLunam.zip</a><!-- m -->
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 (6)
|
 |
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 (2)
|
 |
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 (6)
|
 |
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
|
|
|
|