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 352 online users.
» 0 Member(s) | 350 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: 269
Exit from more than one l...
Forum: Wishlist
Last Post: Duefectu
04-23-2025, 10:06 PM
» Replies: 3
» Views: 280
put small ASM programs li...
Forum: How-To & Tutorials
Last Post: Zoran
04-18-2025, 02:02 PM
» Replies: 6
» Views: 1,570
Creating +3 Menus - Loadi...
Forum: Help & Support
Last Post: merlinkv
04-16-2025, 02:08 PM
» Replies: 6
» Views: 533
Randomize not very random...
Forum: Help & Support
Last Post: Zoran
04-08-2025, 10:40 AM
» Replies: 4
» Views: 431
Scope rules
Forum: Bug Reports
Last Post: Zoran
04-04-2025, 09:46 AM
» Replies: 2
» Views: 303
Using constants not allow...
Forum: Bug Reports
Last Post: baltasarq
03-19-2025, 10:00 PM
» Replies: 8
» Views: 1,057
404 page not found
Forum: Documentation
Last Post: boriel
03-08-2025, 07:16 PM
» Replies: 5
» Views: 2,882
Spectrum keywords codes
Forum: Bug Reports
Last Post: boriel
03-08-2025, 11:00 AM
» Replies: 1
» Views: 416
ZXodus][Engine
Forum: ZX Basic Compiler
Last Post: boriel
02-19-2025, 11:43 PM
» Replies: 69
» Views: 213,738

 
  bug on mod (*solved*)
Posted by: nitrofurano - 09-29-2018, 10:36 AM - Forum: Bug Reports - Replies (1)

since few months ago i noticed some weird behaviour from mod operand

Code:
dim i as uinteger
cls
do
for i=0 to 65535
print at 9,9;chr$( 48+(i mod 10) )
print at 9,8;chr$( 48+(int(i/10) mod 10) )
print at 9,7;chr$( 48+(int(i/100) mod 10) )
print at 9,6;chr$( 48+(int(i/1000) mod 10) )
print at 9,5;chr$( 48+(int(i/10000) mod 10) )
next
loop

as happened months ago, it is supposed to display a number on screen ranging from 0 to 65535, but the result gets totally messy
(tested on version 1.8.5 now, the result is as messy as 1.6.12)

Print this item

  Looking for an Inkey$ routine.
Posted by: ardentcrest - 09-16-2018, 12:54 AM - Forum: Help & Support - Replies (12)

I'm thinking of re-doing my spectranet client but I need a good inkey$ input routine. the one I have ether misses keys presses or does multi letters.

I am using

#include <input.bas>
#include <keys.bas>

Code:
MAIN:
   NETmainloop()
   gosub NETinputloop
   NETmainloop()
goto MAIN

NETinputloop:
    for timeout=0 to 1500 : next timeout
   if rowx=0 then printat64(22,0):print64(xx$+" "):goto NetJump1 : end if


   FOR ii = 0 TO rowx : printat64(22,ii):print64(chr$(peek (@MyLabel + ii))) : NEXT ii : print64(xx$+" ")

NetJump1:
   let k=code inkey$ : for timeout=0 to 1500 : next timeout
   if k>31 and k<128 then goto NetKeyPress : end if
   if k=13 then goto senddata : end if
   if k=12 then goto NetDeleteKey : end if
return

NetDeleteKey:
   if rowx=0 then goto NETinputloop : end if
   POKE (@MyLabel + (rowx-1)), 0
   let rowx = rowx - 1
return

NetKeyPress:
   if rowx=length then goto NETinputloop : end if
   POKE (@MyLabel + rowx), k
   let rowx = rowx + 1
return

senddata:
printat64(22,0):print64("                                                            ")
   POKE (@MyLabel + rowx), 13
   POKE (@MyLabel + rowx+1), 10
   poke (@MyLabel2),(rowx+2)
poke (@MyLabel2+1),0
   send2()
NETline()

for ii=0 to rowx+1 : POKE (@MyLabel + ii), 0 : next ii

let rowx=0
return


END


any hekp

Print this item

  [msx] v9990 experiences
Posted by: nitrofurano - 09-09-2018, 09:00 AM - Forum: Other Archs - No Replies

starting some experiences using Yamaha v9990 display processor - <!-- m --><a class="postlink" href="https://gitlab.com/nitrofurano/borielzxbasicexamples/tree/master/examples/z80/msx/demos/Experiences_Video9990">https://gitlab.com/nitrofurano/borielzx ... _Video9990</a><!-- m -->

Print this item

  Inconsistency in RND
Posted by: Alessandro - 08-05-2018, 06:21 PM - Forum: Help & Support - Replies (5)

If I write this simple program:

Code:
DIM u as UBYTE
10 let u =rnd*40
  print u
  pause 0
  if code inkey$=13 then stop
40 goto 10
a number between 0 and 40 will be shown at every pressing of ENTER.

However, inside of a larger program, this instruction:
Code:
DIM x AS UBYTE
...
x = rnd*40
always returns 38 when executed.

Also, the RND of the first example always returns exactly the same sequence when started afresh, at least under emulation (Spectaculator): 9, 34, 15, 7, 16, 25, 13, 37, 7, 24, 19 etc.

In the past I used a simple routine (by John Connolly) to generate random numbers. Here it is, modified to let it return values from 0 to 31:
Code:
LD A,R
AND %00011111
LD (address),A
When placed in a ZX-Basic listing as a subroutine, it will always return the first value. The only way to make it work is to assemble it elsewhere and call it from within ZX-BASIC with the usual RANDOMIZE USR call, then assign the PEEK [address] to a variable.

Print this item

  FZX support
Posted by: Alessandro - 07-31-2018, 07:11 AM - Forum: Help & Support - Replies (5)

Is there a way to implement FZX? The compiler won't accept the PRINT#4 command, whereas, for instance, HiSoftBasic will.

Print this item

  Compatibilty with windows 10
Posted by: GITTARD - 06-12-2018, 10:37 AM - Forum: Bug Reports - Replies (1)

Hi,
Are zxb, zxbasm or zxbpp applications compatible with windows 10 ?
I can not execute them.
Best regards.

Print this item

  Multiplication result greater than 255 in UINTEGER var
Posted by: LukeBord1 - 05-30-2018, 08:42 AM - Forum: Help & Support - Replies (2)

First of all, as usual, sorry if this was discussed before... at a first sight around the arguments, i didn't find a solution.

The below code works till the "32*(PEEK 32044)" multiplicaton returns a a value within 255, but why?...

Code:
REM 32043 and 32044 store line and column values
REM the routine should return the screen attr address
DIM a AS UINTEGER
a = 22528+PEEK 32043+(32*(PEEK 32044))
REM it doesn't work if the result of the multiplication exceeds 255!

Print this item

  Clarification about HEAP
Posted by: LukeBord1 - 04-18-2018, 08:49 PM - Forum: How-To & Tutorials - Replies (6)

I tried for months to make a compiled intro menu for my Arcade Game Designer projects without success... even storing the compiled menu program in a free memory area (below the AGD code), the game always crashed.

Finally I realized the importance of the HEAP setting in ZXB !
Reading various posts in this excellent forum, Boriel explained that the HEAP setting is a reserved memory area for string variables (please correct me if I'm wrong), and the memory allocation for this parameter is 4768 bytes by default !
So the light turned on and it seems I've finally discovered the cause of the memory collisions...

Since my Basic menu is very simple, including just a couple of UBYTEs without handling any string variable, I tried to set the HEAP to a minimum value like this:

Code:
zxb menu.bas --org=25000 --heap=128
...the magic is done... no crashes and a perfect compiled intro menu for my AGD game!

Now... I just wonder what could be the minimum HEAP setting when there's no string variables at all... and the reason why such an important parameter is just quoted in the ZXB command-line page without any further information !?

Print this item

  [gameatron-gotya] first test
Posted by: nitrofurano - 03-06-2018, 12:35 PM - Forum: Other Archs - No Replies

first test for the Game-A-Tron’s Got-Ya arcade machine
( the wiki page related to this thread will be at <!-- m --><a class="postlink" href="http://www.boriel.com/wiki/en/index.php/ZX_BASIC:Released_Programs_-_GameatronGotya">http://www.boriel.com/wiki/en/index.php ... atronGotya</a><!-- m --> not there yet because that wiki bug )

( <!-- m --><a class="postlink" href="http://i.xomf.com/hcjvm.png">http://i.xomf.com/hcjvm.png</a><!-- m --> )



Attached Files
.zip   example01g_improving.zip (Size: 23.38 KB / Downloads: 731)
Print this item

  [irem-m58] first test
Posted by: nitrofurano - 03-06-2018, 12:32 PM - Forum: Other Archs - No Replies

first test for the Irem’s M58 arcade machine (10 Yard Fight)
( the wiki page related to this thread will be at <!-- m --><a class="postlink" href="http://www.boriel.com/wiki/en/index.php/ZX_BASIC:Released_Programs_-_IremM58">http://www.boriel.com/wiki/en/index.php ... _-_IremM58</a><!-- m --> not there yet because that wiki bug )

( <!-- m --><a class="postlink" href="http://i.xomf.com/cnmvh.png">http://i.xomf.com/cnmvh.png</a><!-- m --> )



Attached Files
.zip   example01d_improving.zip (Size: 31.81 KB / Downloads: 701)
Print this item