Welcome, Guest |
You have to register before you can post on our site.
|
Online Users |
There are currently 184 online users. » 0 Member(s) | 181 Guest(s) Applebot, Bing, Google
|
Latest Threads |
.tap file code not execut...
Forum: Help & Support
Last Post: Zoran
04-28-2025, 10:59 AM
» Replies: 4
» Views: 319
|
Exit from more than one l...
Forum: Wishlist
Last Post: Duefectu
04-23-2025, 10:06 PM
» Replies: 3
» Views: 299
|
put small ASM programs li...
Forum: How-To & Tutorials
Last Post: Zoran
04-18-2025, 02:02 PM
» Replies: 6
» Views: 1,597
|
Creating +3 Menus - Loadi...
Forum: Help & Support
Last Post: merlinkv
04-16-2025, 02:08 PM
» Replies: 6
» Views: 554
|
Randomize not very random...
Forum: Help & Support
Last Post: Zoran
04-08-2025, 10:40 AM
» Replies: 4
» Views: 892
|
Scope rules
Forum: Bug Reports
Last Post: Zoran
04-04-2025, 09:46 AM
» Replies: 2
» Views: 328
|
Using constants not allow...
Forum: Bug Reports
Last Post: baltasarq
03-19-2025, 10:00 PM
» Replies: 8
» Views: 1,065
|
404 page not found
Forum: Documentation
Last Post: boriel
03-08-2025, 07:16 PM
» Replies: 5
» Views: 2,886
|
Spectrum keywords codes
Forum: Bug Reports
Last Post: boriel
03-08-2025, 11:00 AM
» Replies: 1
» Views: 419
|
ZXodus][Engine
Forum: ZX Basic Compiler
Last Post: boriel
02-19-2025, 11:43 PM
» Replies: 69
» Views: 213,807
|
|
|
Apotheosis |
Posted by: slenkar - 02-19-2011, 03:35 AM - Forum: Off-Topic
- No Replies
|
 |
Its quite cool to program a spectrum, because I owned one when I was 7 until the age of about 11 and I gave up on understanding Basic
|
|
|
Rnd help please |
Posted by: slenkar - 02-18-2011, 07:47 PM - Forum: Help & Support
- Replies (5)
|
 |
heres my code
Code: POKE Uinteger 23675, @MyUdgBlock
randomize
BORDER 7 : PAPER 7 : INK 0 : CLS
PRINT AT 3,13 ; PAPER 1 ; INK 7 ; "BattleField"
PRINT AT 5,9 ; PAPER 7 ; INK 0 ; "Q - Up"
PRINT AT 6,9 ; PAPER 7 ; INK 0 ; "A - Down"
PRINT AT 7,9 ; PAPER 7 ; INK 0 ; "O - Left"
PRINT AT 8,9 ; PAPER 7 ; INK 0 ; "P - Right"
PRINT AT 9,9 ; PAPER 7 ; INK 0 ; "M - Select"
PRINT AT 10,3 ; PAPER 7 ; INK 0 ; "You have to select units"
PRINT AT 11,3 ; PAPER 7 ; INK 0 ; "to fight the enemy units"
PRINT AT 15,3 ; PAPER 7 ; INK 0 ; "Press any key to start"
60 LET j$ = INKEY$
IF j$ = "" THEN GOTO 60: END IF
Function byterndrange (first As uByte, last As uByte) As uByte
return Rnd * (last - first) + first
End Function
paper 4
cls
BORDER 4: INK 0
for x=0 to 200
plot byterndrange(0,255),byterndrange(0,192)
next
Dim BlueFactoryX (6) as uByte
Dim BlueFactoryY (6) as uByte
For x =0 to 5
BlueFactoryX(x) = byterndrange(1,9)
BlueFactoryY(x) = byterndrange(1,24)
Next
dim RedFactoryX (6) as uByte
dim RedFactoryY (6) as uByte
For x =0 to 5
RedFactoryX(x) = byterndrange(28,32)
RedFactoryY(x) = byterndrange(1,24)
Next
drawFactories()
sub drawFactories()
for x =0 to 5
ink 1
print at BlueFactoryX(x), BlueFactoryY(x); CHR$(144)
ink 2
print at RedFactoryX(x), RedFactoryY(x); CHR$(144)
next
End sub
STOP : REM Avoid execution to enter this zone
MyUdgBlock: REM a simple Label; @Label returns it's memory address
ASM
incbin "factory.BIN"
END ASM
When I draw random dots the rnd function works fine,
but when I draw factories at random positions it doesnt turn out right
I am trying to draw the red ones on the right side of the screen but they end up on the left
the blue ones are all over the screen
|
|
|
compilador separado |
Posted by: sindecencia - 02-18-2011, 04:13 PM - Forum: Wishlist
- Replies (12)
|
 |
Hola Boriel
Perdona que escriba en español, pero mi inglés es malísimo.
Más o menos lo que te dije por twitter. Ya que la versión compatible con Sinclair Basic no sería muy útil, sí que se podrías sacar una versión extendida más simple. Se que es mucho trabajo y no te vas a poner después de 2 años, pero ya que es una idea te la comento.
-Quitar el tipo Float Point y todas las rutinas asociadas.
-Simplificar el parser. Por ejemplo impidiendo etiquetas con números y obligar los dos puntos detrás.
-Nuevas librerías de sprites: puedes usar las mismas del z88dk.
-Usar un modo de compilación que no dependa de la ROM. Para este modo los programas serán más largos pero por ejemplo puedes hacer juegos compatibles con interfaz 2.
-Permitir compilar en los primeros 16K. Esto es útil para juegos en cartucho o para usar los modos especiales del +2a y +3.
-Usar el doble buffer. Esto es para modelos +2a y +3 que disponen de video shadow (creo que puedes alternar la página 5 y la 7 como memoria de video)
|
|
|
compilador separado |
Posted by: sindecencia - 02-18-2011, 04:07 PM - Forum: Wishlist
- Replies (4)
|
 |
[trans]ES[/trans]
Hola Boriel
Perdona que escriba en español, pero mi inglés es malísimo.
Más o menos lo que te dije por twitter. Ya que la versión compatible con Sinclair Basic no sería muy útil, sí que se podrías sacar una versión extendida más simple. Se que es mucho trabajo y no te vas a poner después de 2 años, pero ya que es una idea te la comento.
-Quitar el tipo Float Point y todas las rutinas asociadas.
-Simplificar el parser. Por ejemplo impidiendo etiquetas con números y obligar los dos puntos detrás.
-Nuevas librerías de sprites: puedes usar las mismas del z88dk.
-Usar un modo de compilación que no dependa de la ROM. Para este modo los programas serán más largos pero por ejemplo puedes hacer juegos compatibles con interfaz 2.
-Permitir compilar en los primeros 16K. Esto es útil para juegos en cartucho o para usar los modos especiales del +2a y +3.
-Usar el doble buffer. Esto es para modelos +2a y +3 que disponen de video shadow (creo que puedes alternar la página 5 y la 7 como memoria de video)
|
|
|
Problems with -Z option (*solved*) |
Posted by: LTee - 02-18-2011, 01:36 PM - Forum: Bug Reports
- Replies (18)
|
 |
I seem to be having some weird problems with this latest version.
If I'm compiling without the -Z flag (which provides the extra Speccy stuff like ATTR) then it keeps complaining about "illegal preprocessor characters" in REM statements and doesn't compile. Specifically it seems to be punctuation which is throwing it out - ?, !, etc.
If I do use -Z (or strip those characters out of the REM statements) then it seems to be a coin-toss as to whether I get a workable program or not. Many of my files are compiling to very small TZXs which load and run but do nothing at all (in those cases the compilation seems suspiciously fast).
As a test, I make a simple program like this:
If I compile with:
zxb.py test.bas -T -B -a
... then I get a working TZX.
But if I compile with:
zxb.py test.bas -T -B -a -Z
... I get a TZX that loads but does nothing.
If I make the file:
Code: rem test!
print "hello world"
... then without -Z compilation fails, with -Z compilation succeeds but the program does nothing.
Is anyone else having similar issues? I'm using the Python-based version of 2077 (from the zip) with Python 2.7.1.
|
|
|
compiler error (*solved*) |
Posted by: slenkar - 02-15-2011, 04:44 AM - Forum: Bug Reports
- Replies (8)
|
 |
im using the latest beta build
here is my source:
Code: BORDER 7 : PAPER 7 : INK 0 : CLS
PRINT AT 3,13 ; PAPER 1 ; INK 7 ; "BattleField"
PRINT AT 5,9 ; PAPER 7 ; INK 0 ; "Q - Up"
PRINT AT 6,9 ; PAPER 7 ; INK 0 ; "A - Down"
PRINT AT 7,9 ; PAPER 7 ; INK 0 ; "O - Left"
PRINT AT 8,9 ; PAPER 7 ; INK 0 ; "P - Right"
PRINT AT 9,9 ; PAPER 7 ; INK 0 ; "M - Select"
PRINT AT 10,3 ; PAPER 7 ; INK 0 ; "You have to select units"
PRINT AT 11,3 ; PAPER 7 ; INK 0 ; "to fight the enemy units"
PRINT AT 15,3 ; PAPER 7 ; INK 0 ; "Press any key to start"
60 LET j$ = INKEY$
IF j$ = "" THEN GOTO 60: END IF
cls
Dim BlueFactoryX (6) as uByte
Dim BlueFactoryY (6) as uByte
for x =1 to 6
BlueFactoryX(x) = byterndrange(1,30)
BlueFactoryY(x) = byterndrange(1,30)
next
drawFactories()
function drawFactories()
for x =1 to 6
print at BlueFactoryX(x), BlueFactoryY(x); "O"
next
end function
Function byterndrange (first As uByte, last As uByte) As uByte
return Rnd * (last - first) + first
End Function
here is the error message when I compile:
Quote:Traceback (most recent call last):
File "zxb.py", line 309, in <module>
File "zxb.py", line 242, in main
File "zxbtrad.pyc", line 316, in traverse
File "zxbtrad.pyc", line 1202, in traverse
File "zxbtrad.pyc", line 217, in emmit_let_left_part
TypeError: bad operand type for unary -: 'NoneType'
also it seems that underscores are not allowed in function names, is this right?
|
|
|
IDE bug? |
Posted by: slenkar - 02-13-2011, 05:06 AM - Forum: Bug Reports
- Replies (3)
|
 |
I tried the program UDG.bas in the examples folder.
When I try to change the BIN values and run the program one of the numbers is removed from each BIN statement,
e.g.
0 DATA BIN 1111,BIN 1011,BIN 1011,BIN 1011,BIN 1011,BIN 1011,BIN 1011,BIN 1111
becomes:
DATA BIN 111,BIN 011,BIN 011,BIN 011,BIN 011,BIN 011,BIN 011,BIN 111
|
|
|
|