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

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 258
» Latest member: manuelzo75
» Forum threads: 1,074
» Forum posts: 6,434

Full Statistics

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

Print this item

  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

Print this item

  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)

Print this item

  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)

Print this item

  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:

Code:
print "hello world"

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.

Print this item

  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?

Print this item

  Show off your creativity!
Posted by: boriel - 02-14-2011, 11:25 PM - Forum: Gallery - Replies (54)

Have you created a game or a program with ZX BASIC? Want to show off what you are able to??
Just put here a screenshot (and optionally a .tap or .tzx file) so people can try your game or program.
You needn't to put the source code (so keep your secrets with you) :!:

The only requisite is that your program must be created using ZX BASIC (and optionally other tools). Idea

Print this item

  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

Print this item

  How to create and draw graphics
Posted by: slenkar - 02-13-2011, 03:59 AM - Forum: Help & Support - Replies (21)

What is the best way to draw graphics to the screen e.g. UDG or other method

How do you get sprites from the sprite editor into the basic program?

Print this item

  New beta release 1.2.7r2058
Posted by: boriel - 02-12-2011, 03:33 PM - Forum: Bug Reports - Replies (3)

Okay, a new beta release with Lbound() and UBound() functions implemented. This is a final release candidate. So, please, give it a try.
Also fixes an internal bug (but not critical), with the backend.

See LBound() and UBound() for usage. These functions allow to get the number of the dimensions of a given array (passing 0 as 2nd parameter), and also the lower and upper bounds of its dimensions.

They're not very useful yet, but will be when dynamic arrays are implemented. :wink:

Download:
<!-- m --><a class="postlink" href="http://www.boriel.com/files/zxb">http://www.boriel.com/files/zxb</a><!-- m -->

Update: The wiki has been *vandalized* Cry I've managed to clean it up. Also have put some documentation on Lbound() and Ubound() (see reserved keywords)

Print this item