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

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 259
» Latest member: Jeffreybub
» Forum threads: 1,074
» Forum posts: 6,434

Full Statistics

Online Users
There are currently 282 online users.
» 0 Member(s) | 280 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: 141
Exit from more than one l...
Forum: Wishlist
Last Post: Duefectu
04-23-2025, 10:06 PM
» Replies: 3
» Views: 241
put small ASM programs li...
Forum: How-To & Tutorials
Last Post: Zoran
04-18-2025, 02:02 PM
» Replies: 6
» Views: 1,487
Creating +3 Menus - Loadi...
Forum: Help & Support
Last Post: merlinkv
04-16-2025, 02:08 PM
» Replies: 6
» Views: 501
Randomize not very random...
Forum: Help & Support
Last Post: Zoran
04-08-2025, 10:40 AM
» Replies: 4
» Views: 402
Scope rules
Forum: Bug Reports
Last Post: Zoran
04-04-2025, 09:46 AM
» Replies: 2
» Views: 276
Using constants not allow...
Forum: Bug Reports
Last Post: baltasarq
03-19-2025, 10:00 PM
» Replies: 8
» Views: 995
404 page not found
Forum: Documentation
Last Post: boriel
03-08-2025, 07:16 PM
» Replies: 5
» Views: 2,828
Spectrum keywords codes
Forum: Bug Reports
Last Post: boriel
03-08-2025, 11:00 AM
» Replies: 1
» Views: 383
ZXodus][Engine
Forum: ZX Basic Compiler
Last Post: boriel
02-19-2025, 11:43 PM
» Replies: 69
» Views: 213,377

 
  Filling drawings
Posted by: baltasarq - 02-07-2025, 12:16 PM - Forum: Help & Support - Replies (3)

There's no function or command "fill", allowing to pass two coordinates and making the computer to fill all delimited pixels with the current color.


Code:
circle 50, 50, 30
fill 50, 50

In the eighties, I used to fill a circle with a for loop:


Code:
circle 50, 50, 30
for i = 1 to 30
    circle 50, 50, i
next i
I suppose I could do something like this for rectangles, as well. This is, however, slow, ugly (certain pixels remain unplotted), and clumsy. Is there an alternate way?
Thanks,

Print this item

  put small ASM programs like bin in a bank 128 and call from basic
Posted by: funkheld - 02-06-2025, 10:24 AM - Forum: How-To & Tutorials - Replies (6)

hello, good day.

zxbasic:
put small ASM programs like bin in a bank(1,3,4,6)  from spectrum 128 and then call them from basic in the $c000 ?


how does that work please?



thanks.

Print this item

  Headerless load routine in ZX Basic
Posted by: Maywind - 02-04-2025, 05:19 AM - Forum: Help & Support - Replies (2)

Hello,
I'm trying to code a simple headerless LOAD routine in ZX Basic using the inline assembly feature of the compiler. The basic idea here is to write a function that uses assembly to set up the necessary registers and call the ROM routine 0556h for a headerless load (e.g. to load an extra level from the tape). I have some progress in this area, but it looks like I misunderstand how to clean up things correctly after the ROM routine returns and my function ends, so the poor Speccy either hangs or is reset after the code loading routine completes. I tried a few things so far, but the experiment that went the farthest so far is this one:

Code:
function hload(addr as uInteger, size as uInteger) as uByte
    asm
        pop hl
        pop de
        pop ix
        ld a, 255
        scf
        call 0556h
        push hl
    end asm
end function


The expected result is that calling this function, for instance, in this way:
Code:
hload(16384, 6912)

should be able to load standard ZX screen data correctly. Trying to load a screen this way indicates that the screen is indeed loaded into the right area of memory, but once the loading completes, the computer is reset.

I'm pretty sure that this indicates that something is screwed up at the end of the function call. Could be due to the fact that SP or something else is modified from within 0556h and that changes the register state, or something else along those lines, but I can't quite figure it out :/ I would appreciate some help since I'm not sure how to proceed. I tried a few other cleanup tricks, but none of them worked. 

Another question is: how do I properly return a value from this function? As far as I understand, the return value can be stored in the A register. Suppose I wanted to indicate that the tape loaded correctly with a value of 0, would I simply LD A, 0 at the end of the function and that would be enough? This, of course, is a separate issue once I can actually get this function to load anything without resetting the PC or hanging Smile

Thanks in advance.

Print this item

  Turn Off Keyword Hint
Posted by: ChewBakker - 01-30-2025, 12:00 PM - Forum: Help & Support - Replies (2)

Is it possible to turn off the Keyword hints in ZXBasicStudio ?

I can't see them in the dropdown popup, and it annoyingly makes entering code awkward.

Print this item

  Unable to see Key Words
Posted by: ChewBakker - 01-29-2025, 11:57 AM - Forum: Help & Support - Replies (1)

I had an issue with my Boriel that prevented me from using the debugger. This has been fixed with help from the forum and me installing the latest version of the Boriel ZXBasicStudio.

My issue now is that I can no longer see Key Words when entering code (see attachment). If anyone could help on this it would be highly appreciated.

I checked with the older version and that does show the KeyWords, but won't run in debug mode.



Attached Files
.jpg   key words.jpg (Size: 57.19 KB / Downloads: 137)
Print this item

Sad Just Installed ZXBasicStudio but cannot debug
Posted by: ChewBakker - 01-28-2025, 05:20 PM - Forum: Help & Support - Replies (8)

Hi, I am new to the forum, but not to the ZX Spectrum :-)

I have installed the latest version of ZXBasicStudio and ZXBasic compiler onto my PC.

I have created a very simple program than runs from within ZXBasicStudio.

However, when I try and Debug it creates some new files in the project folder:

Main.buildtemp.bas
Main.buildtemp.bin
Main.buildtemp.ir
MEMORY_MAP


but I get the following error mesage:

Exception: Could not find file 'D:\BorielDev\Projects\HelloWorld\Main.buildtemp.ic' at

.
.
.

Screenshot below...

If anyone could point me to where I am going wrong it would be highly appreciated.




John




.jpg   ZXBasicIssue.jpg (Size: 261.7 KB / Downloads: 152)

Print this item

  Question on file extension
Posted by: zedex82 - 01-18-2025, 10:11 PM - Forum: Help & Support - Replies (2)

I am working my way through the book 'Boriel Basic for Beginners'. It is a very good book and well written. I have convinced my friend to buy a copy too.

On page 166 in the example the first command is '#INCLUDE "ship.gdu.bas". When I exported the UDG's as per the instructions on page 165 it creates a file 'ship.gdu.zxbas'

I was wondering why it did not export with the extension '.bas'. I understand I just need to change the extension in the code and it loads in fine, I just want to understand why. It may be something I have done wrong.

ZeDeX82

Print this item

  Colors only shown... sometimes?
Posted by: baltasarq - 01-07-2025, 01:21 PM - Forum: Bug Reports - Replies (3)

Hi,

I'm using print64.bas, and the code I'm using to show a command menu is as follows:

Code:
const COLOR_BLACK            as ubyte = 0
const COLOR_BLUE              as ubyte = 1
const COLOR_RED              as ubyte = 2
const COLOR_MAGENTA          as ubyte = 3
const COLOR_GREEN            as ubyte = 4
const COLOR_CYAN              as ubyte = 5
const COLOR_YELLOW            as ubyte = 6
const COLOR_WHITE            as ubyte = 7


sub cursor_to(row as ubyte, col as ubyte)
    printat64( row, col )
end sub


sub cprint(s as string)
    print64( s )
end sub


sub lf()
    cprint( CR )
end sub


sub set_colors(i as ubyte, p as ubyte)
    paper( p )
    ink( i )
end sub


sub set_default_colors()
    set_colors( COLOR_WHITE, COLOR_BLACK )
end sub


sub set_highlighted_colors()
    set_colors( COLOR_CYAN, COLOR_BLACK )
end sub


sub set_action_colors()
    set_colors( COLOR_YELLOW, COLOR_BLACK )
end sub


sub print_word_marked_initial(word as string)
    set_action_colors()
    cprint( word( 0 ) )
    set_default_colors()
    cprint( word( 1 to ) )
end sub


sub print_cmds()
' Print basic options
cursor_to( SCR_FIRST_LINE_CMDS, 0 )
print_word_marked_initial( "Inv " )
print_word_marked_initial( "Mira alrededor " )
cprint( "E" ): print_word_marked_initial( "xamina... " )
print_word_marked_initial( "Norte " )
print_word_marked_initial( "Sur " )
print_word_marked_initial( "Este " )
print_word_marked_initial( "Oeste " )
print_word_marked_initial( "Arriba " )
cprint( "A" )
        print_word_marked_initial( "bajo" )
        lf()

' Print object manipulation options
print_word_marked_initial( "Coge... " )
print_word_marked_initial( "Deja... " )
cprint( "Em" ): print_word_marked_initial( "puja... " )
print_word_marked_initial( "Tira de... " )
print_word_marked_initial( "Rompe... " )
end sub

Well, the code should be straightforward. I also know it should work because I ported it from C, the same source code I used wtith z88dk. Unfortunately, it does not work, or it does not always work... (check the image).

What could be wrong?

-- Baltasar



Attached Files
.png   speccy_reveni_cmds.png (Size: 4.33 KB / Downloads: 164)
Print this item

  Play on a bank ($c000) in spectrum128 and then copy to $4000
Posted by: funkheld - 01-05-2025, 02:06 PM - Forum: How-To & Tutorials - Replies (4)

Hello, good day.

How can you play on the $c000 area if you have the Specrum128 mode? You can assign the banks to $c000.

thanks.
greetings

Print this item

  strange behaviour of raise to power
Posted by: jjluke65 - 01-05-2025, 12:53 PM - Forum: Bug Reports - Replies (2)

In this code:

DIM x1, x2 AS float
x1 = -3
x2 = x1^2
PRINT x2


if x1 = 3 (or any positive number) the correct result (9) is printed.
If x1 = -3  I get no result in the output (nothing is printed on the screen) and no message is shown.
I've tried to define x1 and x2 as integer, with the same problem.
I'm using 1.17.3 version with ZX Basic Studio, but I also tried with Visual Studio Code and Fuse (same result).
I'm doing something wrong or it's a bug?
Thanks

Print this item