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 335 online users.
» 1 Member(s) | 332 Guest(s)
Applebot, Bing, Zoran

Latest Threads
.tap file code not execut...
Forum: Help & Support
Last Post: Zoran
04-28-2025, 10:59 AM
» Replies: 4
» Views: 231
Exit from more than one l...
Forum: Wishlist
Last Post: Duefectu
04-23-2025, 10:06 PM
» Replies: 3
» Views: 268
put small ASM programs li...
Forum: How-To & Tutorials
Last Post: Zoran
04-18-2025, 02:02 PM
» Replies: 6
» Views: 1,541
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,867
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,645

 
  Pass an Array to a Sub
Posted by: XoRRoX - 04-02-2020, 09:30 AM - Forum: ZX Basic Compiler - Replies (4)

Hello all,

I'm pretty new to ZX Basic so please forgive my possible beginner questions.

I'd like to pass an Array to a Sub but cannot seem to figure out how.


Code:
dim SortArray(10) as string

SUB SelectionSort (SortArray) 'Compile Error: Syntax Error. Unexpected token 'SortArray' <ARRAY_ID>

  {Code}

END sub


'************************ Main ****************************

Let SortArray(0) = "Line 00"
Let SortArray(1) = "Line 02"
Let SortArray(2) = "Line 08"
Let SortArray(3) = "Line 06"
Let SortArray(4) = "Line 01"
Let SortArray(5) = "Line 03"
Let SortArray(6) = "Line 07"
Let SortArray(7) = "Line 04"
Let SortArray(8) = "Line 05"

SelectionSort(SortArray) ' Compile Error: Variable 'SortArray' is an array and cannot be used in this context

Thanks in advance for any insights Smile

Print this item

  Wiki down
Posted by: LCD - 03-05-2020, 04:13 PM - Forum: How-To & Tutorials - Replies (2)

Hallo Jose. When I try to go to the ZXBC Wiki from your site, it is down. Any chance to bring it up again? I want to finish the help in BorIDE. are there new commands? added? (hint: like SWITCH/CASE)?

Print this item

  spectrum next compatibility
Posted by: ardentcrest - 03-01-2020, 01:56 AM - Forum: Wishlist - Replies (10)

Will we see Zx basic compiler compatible with the next????

Print this item

  Error while compiling little program (*solved*)
Posted by: maeloterkim - 02-24-2020, 08:15 PM - Forum: Bug Reports - Replies (2)

Hi  Smile 
This little program should work or am I missing something?

If I compile it gives error

Code:
'Begin program

const A as ubyte = 65
const a as ubyte = 97

print chr$ (A)
print chr$ (a)


'End program

i tried to compile with 1.9.9 version and 1.9.8 version and both have errors while compiling

Print this item

  Bug report with print64 routine
Posted by: maeloterkim - 02-08-2020, 07:29 PM - Forum: Bug Reports - Replies (1)

Hi  Smile 

I tried the print64 routine but has a bug 

If you try this program in red

#include <print64.bas>

'printat64(10,10)  'This will not work because de poke is incorrect You can try
print64("Hello world!")

print at 15,0;"@p64coords "; @p64coords
;


and then you look at the dissasembly attached image

where after the RET with red color in the image, is supposed that is the @p64coords address (when you run the program writes the @p64coords address to check where is)


in this @p64coords address is where is supposed to poke de X and Y values of the new coordinates with the printat64 routine that is included in print64.bas

but the coordinates are in the green lines addresses with the value 12 and 0 

you can check this if you look at the same time at the image with colors ( or your own dissasembly) and the print64.bas file

There is some bytes in between that are moving down the useful poke for the coodinates that  printat64 routine does


ANOTHER THING
----------------------------------


This bug was found because i was trying to change the print64 font to another one

I did this subroutine for this

' Changes character set of the print64 routine
' this does a poke where is the assembly instruction :      ld de, p64_charset
SUB change64Charset (new64CharSet as uinteger)

       poke uinteger ( @p64coords - 123 ), new64CharSet

END sub


Maybe you can solve the bug AND  at the same time include this subroutine in the print64.bas file

this way the people can change the print64 x,y  and the character set of the print64

i named the subroutine change64Charset but you change the name accordly to the print64 routine

i don't know for example  print64ChangeCharset or something

you can only must be sure that the poke is always made in the correct positions for both routines

i don't know if is posible to include some constant label inside the routine that makes some positions of memory fixed to be poked

Now we must calculate by hand until fixed someway, where are the addresses to poke

if you try this subroutine adding 7 to the original subroutine it works Smile 

SUB newPrintat64 (y as uByte, x as uByte)
    POKE @p64coords+7,x
    POKE @p64coords+8,y
END sub





Print this item

  New Game ESQUINAS
Posted by: maeloterkim - 02-06-2020, 04:43 PM - Forum: Gallery - Replies (1)

I made a new game in ZX BORIEL compiled BASIC

The name is ESQUINAS (CORNERS in english)

is very "simple"

You must only do 3 same UDGs in line to make points

there are 7 levels

Enjoy!

https://mega.nz/#!f7ghlKQD!Pjroq844ueINCByupjjbE_gI2t6rfZeWy4Y-ggni654

Print this item

  Usage of print42?
Posted by: GusmanB - 02-01-2020, 01:12 PM - Forum: ZX Basic Compiler - Replies (5)

Hi.

I'm trying to use the print42 library but whenever I reference it my program can no longer compile, I get a "Undeclared variable printAt42Coords"

I have found an old thread from 2015 with the same problem which was solved, I have tried the -o0 optimization level but it does not make a difference.

Any idea?

Also, I see the print42 routine includes a "isAt:" label that checks for a char 22, what would be the correct syntax to use it?

Cheers.

Print this item

Exclamation Al's Spectrum Annual 2020
Posted by: Alessandro - 01-23-2020, 11:38 AM - Forum: ZX Basic Compiler - Replies (3)

Hi fellas,

I just made Al's Spectrum Annual 2020, an annual magazine hosting my views about 25 games that I picked from those released in 2019, plus interviews to El Mundo del Spectrum and Bitmap Soft, and a behind-the-scenes article with facts and insight about my latest games, including of course my first ever game made with ZX-Basic, Ad Lunam.

Al's Spectrum Annual 2020 is available as a 32-pages A4 PDF file in Italian, English and Spanish. Download it for free at:

http://www.alessandrogrussu.it/annuario.html

Enjoy!

Print this item

Tongue Robo stalker
Posted by: Week of the agents - 12-12-2019, 08:17 AM - Forum: Gallery - Replies (4)

Hallo, Gordon Freeman

Behold my first (and mb last) expirience with ZX Spectrum. ROBO STALKER game for Yandex Retro Games Battle 2019 contest (rgb.yandex)

[Image: 01.png?raw=1]

Game about war robot hunter Vova that manhunts Ned Agent - escaped criminal

[Image: 02.png?raw=1]

[Image: 03.png?raw=1]

[Image: 04.png?raw=1]

TAP file
BAS files
Graphics and texts
Data converter

Gameplay:
On every level you must restore power to teleportation machine, find navigation circuit board for teleportation to next level.

Default keys:
Left - z
Right - c
Jump - x
Use - s
Fire - Space
Menu - m

Weapons - 1-4

I used INKEY so only one key is processing in time.


-- Compiler params
--tap --org=24576 --optimize 2 --heap-size=256


Version 1.02 with advanced controls by Verm-V
Source 1.02

Print this item

  Disable scroll
Posted by: Alessandro - 11-17-2019, 12:27 PM - Forum: How-To & Tutorials - Replies (22)

I noticed that v1.9.7 introduced upwards scrolling when a message is printed in the bottom lines of the screen.

Is there a way to disable this? In Ad Lunam, each time something is printed at lines 22-23, and this happens often, the screen scrolls and the information contained in it disappears. This is very annoying  Angry

Print this item