The following warnings occurred:
Warning [2] Undefined array key "attachments" - Line: 20 - File: portal.php(680) : eval()'d code PHP 8.2.31 (Linux)
File Line Function
/inc/class_error.php 157 errorHandler->error
/portal.php(680) : eval()'d code 20 errorHandler->error_callback
/portal.php 680 eval
Warning [2] Undefined array key "attachments" - Line: 20 - File: portal.php(680) : eval()'d code PHP 8.2.31 (Linux)
File Line Function
/inc/class_error.php 157 errorHandler->error
/portal.php(680) : eval()'d code 20 errorHandler->error_callback
/portal.php 680 eval
Warning [2] Undefined array key "attachments" - Line: 20 - File: portal.php(680) : eval()'d code PHP 8.2.31 (Linux)
File Line Function
/inc/class_error.php 157 errorHandler->error
/portal.php(680) : eval()'d code 20 errorHandler->error_callback
/portal.php 680 eval
Warning [2] Undefined array key "attachments" - Line: 20 - File: portal.php(680) : eval()'d code PHP 8.2.31 (Linux)
File Line Function
/inc/class_error.php 157 errorHandler->error
/portal.php(680) : eval()'d code 20 errorHandler->error_callback
/portal.php 680 eval
Warning [2] Undefined array key "attachments" - Line: 20 - File: portal.php(680) : eval()'d code PHP 8.2.31 (Linux)
File Line Function
/inc/class_error.php 157 errorHandler->error
/portal.php(680) : eval()'d code 20 errorHandler->error_callback
/portal.php 680 eval
Warning [2] Undefined array key "attachments" - Line: 20 - File: portal.php(680) : eval()'d code PHP 8.2.31 (Linux)
File Line Function
/inc/class_error.php 157 errorHandler->error
/portal.php(680) : eval()'d code 20 errorHandler->error_callback
/portal.php 680 eval
Warning [2] Undefined array key "attachments" - Line: 20 - File: portal.php(680) : eval()'d code PHP 8.2.31 (Linux)
File Line Function
/inc/class_error.php 157 errorHandler->error
/portal.php(680) : eval()'d code 20 errorHandler->error_callback
/portal.php 680 eval
Warning [2] Undefined array key "attachments" - Line: 20 - File: portal.php(680) : eval()'d code PHP 8.2.31 (Linux)
File Line Function
/inc/class_error.php 157 errorHandler->error
/portal.php(680) : eval()'d code 20 errorHandler->error_callback
/portal.php 680 eval
Warning [2] Undefined array key "attachments" - Line: 20 - File: portal.php(680) : eval()'d code PHP 8.2.31 (Linux)
File Line Function
/inc/class_error.php 157 errorHandler->error
/portal.php(680) : eval()'d code 20 errorHandler->error_callback
/portal.php 680 eval
Warning [2] Undefined array key "attachments" - Line: 20 - File: portal.php(680) : eval()'d code PHP 8.2.31 (Linux)
File Line Function
/inc/class_error.php 157 errorHandler->error
/portal.php(680) : eval()'d code 20 errorHandler->error_callback
/portal.php 680 eval




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

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 274
» Latest member: zxspecticle
» Forum threads: 1,086
» Forum posts: 6,487

Full Statistics

Online Users
There are currently 204 online users.
» 0 Member(s) | 204 Guest(s)

Latest Threads
New video Couse / Nuevo c...
Forum: News
Last Post: Duefectu
2026-04-29, 11:02 PM
» Replies: 0
» Views: 213
location of heap manageme...
Forum: Help & Support
Last Post: boriel
2026-03-07, 12:13 AM
» Replies: 1
» Views: 485
non-paged supervisor code...
Forum: Help & Support
Last Post: sdo303
2026-02-20, 06:38 PM
» Replies: 8
» Views: 1,299
How to open fuse as an ex...
Forum: How-To & Tutorials
Last Post: Duefectu
2026-02-09, 01:52 PM
» Replies: 3
» Views: 1,389
Old zxbasic game errors
Forum: Help & Support
Last Post: boriel
2025-11-09, 11:52 AM
» Replies: 7
» Views: 2,079
Error: Undefined GLOBAL l...
Forum: Help & Support
Last Post: ardentcrest
2025-11-04, 05:46 PM
» Replies: 3
» Views: 1,080
A Fast(er) Plot Routine f...
Forum: How-To & Tutorials
Last Post: tubz74
2025-10-30, 03:16 PM
» Replies: 2
» Views: 1,179
Hall of Fame - Include fo...
Forum: How-To & Tutorials
Last Post: tubz74
2025-10-28, 03:48 PM
» Replies: 0
» Views: 630
[SOLVED] Array layout bug...
Forum: Bug Reports
Last Post: Zoran
2025-10-25, 05:48 PM
» Replies: 2
» Views: 1,217
3DOS Commands?
Forum: Help & Support
Last Post: boriel
2025-10-06, 02:54 PM
» Replies: 3
» Views: 1,381

 
  Bool
Posted by: slenkar - 2012-04-30, 10:31 PM - Forum: Wishlist - Replies (11)

Are bools supported by zxbasic?

If so, would an array of bools take up only 1/8 of the room as an array of Bytes?

Print this item

  BlitzMax
Posted by: slenkar - 2012-04-30, 04:42 PM - Forum: Wishlist - No Replies

If you (boriel) ever feel you want to re-write the compiler blitzmax would be a good choice, it has similar syntax to python but is a lot faster. It has a regular expressions module too and is crossplatform.

Print this item

  pathfinding
Posted by: slenkar - 2012-04-30, 12:10 AM - Forum: How-To & Tutorials - Replies (2)

you can run the code to get a little demo:

Code:
const found as ubyte=1 const pathsuccess as ubyte=1 const CantCreatePathError as ubyte=2 Dim path as integer Dim SquareState(32,24) as UByte Dim SquareParentX(32,24) as Ubyte Dim SquareParentY(32,24) as Ubyte Dim HCost(32,24) as UByte Dim PathToWalkX(255) as UByte Dim PathToWalkY(255) as UByte Dim StepsOnPath as Integer Dim PathBlockedByPerson as Ubyte Dim PathBlocker as Integer Dim numberofopenlistitems as Integer Dim LowestFCostSquareX as Integer Dim LowestFCostSquareY as Integer Function FindPath(startx as Integer,starty as Integer,targetx as Integer,targety as Integer) as Integer ClearPath() pathfindmessage("FindPath") If startx =targetx And starty = targety then pathfindmessage("target square = start square") Return 3 End if HCost(startx,starty)=GetHCost(startx,starty,targetx,targety) AddToOpenList(startx,starty,startx,starty) LowestFCostSquareX=startx LowestFCostSquareY=starty path=-1 Dim DebugIter as Integer while path=-1 DebugIter=DebugIter+1 If DebugIter>200 then pathfindmessage("path too long") Exit While End if If numberofopenlistitems=0 then pathfindmessage("no more open list items") Exit While End if 'pathfindmessage("Lowest f cost square "+STR(LowestFCostSquareX)+" "+STR(LowestFCostSquareY)) Dim lowx as ubyte lowx=LowestFCostSquareX Dim lowy as ubyte lowy=LowestFCostSquareY CheckSquare(lowx+1,lowy,targetx,targety,lowx,lowy) CheckSquare(lowx-1,lowy,targetx,targety,lowx,lowy) CheckSquare(lowx,lowy+1,targetx,targety,lowx,lowy) CheckSquare(lowx,lowy-1,targetx,targety,lowx,lowy) if path<>found then AddToClosedList(lowx,lowy) end if end while If path = found then 'Print "path was found" If CreatePath(startx , starty , targetx ,targety)<>1 then Return CantCreatePathError End if Return 1 End if return 0 End Function Function CheckSquare(squarex as integer,squarey as integer,targetx as integer,targety as integer,originalx as integer,originaly as integer) as UByte if squarex>-1 then if squarex<32 then if squarey>-1 then if squarey<24 then 'pathfindmessage("Check square:"+STR(squarex)+" "+STR(squarey)) If OnClosedList(squarex,squarey)=0 then 'pathfindmessage("not on closed list") If OnOpenList(squarex,squarey)=0 then 'pathfindmessage("not on open list") If squarex=targetx And squarey=targety then path = found End if HCost(squarex,squarey)=GetHCost(squarex,squarey,targetx,targety) AddToOpenList(squarex,squarey,originalx,originaly) If path=found then SquareParentX(squarex,squarey)=originalx SquareParentY(squarex,squarey)=originaly 'Print "path is found" AddToClosedList(squarex,squarey) End if End if End if End if End if End if end if End Function Function GetHCost(squarex as integer,squarey as integer,targetx as integer,targety as integer) as integer Return (Abs(squarex-targetx)+Abs(squarey-targety)) End Function Function OnOpenList(squarex as Integer, squarey as Integer) as integer if SquareState(squarex,squarey)=1 then return 1 end if return 0 end function Function OnClosedList(squarex as Integer, squarey as Integer) as integer if SquareState(squarex,squarey)=2 then return 1 end if return 0 end function Function AddToOpenList(squarex as Integer, squarey as Integer,parx as integer, pary as integer) SquareParentX(squarex,squarey)=parx SquareParentY(squarex,squarey)=pary numberofopenlistitems=numberofopenlistitems+1 If HCost(squarex,squarey)<HCost(LowestFCostSquareX,LowestFCostSquareY) then LowestFCostSquareX=squarex LowestFCostSquareY=squarey End if SquareState(squarex,squarey)=1 Print at squarey,squarex;"O" end function Function AddToClosedList(squarex as Integer, squarey as Integer) if LowestFCostSquareX=squarex then if LowestFCostSquareY=squarey then Dim dist as Integer dim chosenX as integer Dim chosenY as integer chosenX=-1 chosenY=-1 dist=9999 for x=0 to 32 for y=0 to 24 if OnOpenList(x,y) then If HCost(x,y)<dist then dist=HCost(x,y) chosenX=x chosenY=y end if End if Next Next If chosenX>-1 then LowestFCostSquareX=chosenX LowestFCostSquareY=chosenY End if end if end if if SquareState(squarex,squarey)=1 then numberofopenlistitems=numberofopenlistitems-1 end if SquareState(squarex,squarey)=2 Print at squarey,squarex;"C" end function Function AddToPath(squarex as Integer, squarey as Integer) Print at squarey,squarex;"P" end function Function CreatePath(StartX as integer,StartY as integer,TargetX as integer,TargetY as integer) as integer PathBlockedByPerson=0 PathBlocker=0 dim PathCreated as Ubyte dim ParX as Integer dim ParY as Integer StepsOnPath=StepsOnPath+1 PathToWalkX(StepsOnPath)=TargetX PathToWalkY(StepsOnPath)=TargetY ParX=PathToWalkX(StepsOnPath) ParY=PathToWalkY(StepsOnPath) While PathCreated=0 Dim NewParX as integer Dim NewParY as integer NewParX=SquareParentX(ParX,ParY) NewParY=SquareParentY(ParX,ParY) ParX=NewParX ParY=NewParY AddToPath(ParX,ParY) StepsOnPath=StepsOnPath+1 If StepsOnPath=StepsOnPath>254 then Return 2 End if PathToWalkX(StepsOnPath)=ParX PathToWalkY(StepsOnPath)=ParY If PathToWalkX(StepsOnPath)=StartX And PathToWalkY(StepsOnPath)=StartY then exit while End if Wend Return 1 End Function function ClearPath() for x=0 to 32 for y=0 to 24 SquareState(x,y)=0 SquareParentX(x,y)=0 SquareParentY(x,y)=0 HCost(x,y)=0 next next 'for x=0 to 768 'PathToWalkX(x)=0 'PathToWalkY(x)=0 'next StepsOnPath=0 PathBlockedByPerson=0 PathBlocker=0 numberofopenlistitems=0 End Function Dim pathfindprint as ubyte Function pathfindmessage(msg as string) Print at pathfindprint,0 ; msg pathfindprint=pathfindprint+1 if pathfindprint>24 then pathfindprint=0 end if end function Border 5 FindPath(0,10,10,0) FindPath(0,10,31,23) FindPath(31,23,0,0)

Print this item

  SLS <reg>
Posted by: britlion - 2012-04-23, 12:25 AM - Forum: Help & Support - Replies (2)

Technically undocumented - but the assembler doesn't support the shift instruction SLS. Unfortunately, not being documented, it doesn't have an official name - I've seen the same instructions called "SLL" as well - and shift left logical does seem to match with shift right logical.

Have a look at:
<!-- m --><a class="postlink" href="http://www.ime.usp.br/~einar/z80table/">http://www.ime.usp.br/~einar/z80table/</a><!-- m -->


In particular CB30 - CB37


That table is quite useful, actually Smile

Print this item

  byte loops (*solved*)
Posted by: britlion - 2012-04-19, 02:50 AM - Forum: Bug Reports - Replies (15)

This seems to not work - skipping the loop. Surely small negative numbers shouldn't be an issue for a byte sized variable?

Code:
DIM x as byte for x=-91 to 91 print x next x

Print this item

  Double Size Print
Posted by: britlion - 2012-04-19, 02:19 AM - Forum: Documentation - Replies (8)

You know, I've focused so much on making itty bitty unreadable text, that it was time to make up the balance.

A whole evening poking in assembly, and it's 143 bytes? Heck, I'm slow!

Anyway - Double sized printing. Including UDG.

<!-- m --><a class="postlink" href="http://www.boriel.com/wiki/en/index.php/ZX_BASIC:DoubleSizePrint.bas">http://www.boriel.com/wiki/en/index.php ... ePrint.bas</a><!-- m -->


No colour. That's what windowPaint - <!-- m --><a class="postlink" href="http://www.boriel.com/wiki/en/index.php/ZX_BASIC:WindowPaint">http://www.boriel.com/wiki/en/index.php ... indowPaint</a><!-- m --> - is for!

(Yes, I also added this - though it's solidly based on the paint routine packaged with putChars)

Print this item

  Screen handling
Posted by: britlion - 2012-04-18, 02:10 AM - Forum: ZX Basic Compiler - Replies (9)

This is interesting. There's quite a lot of overhead in PLOT, I think - this is fairly unoptimized, still - and appears to be a little buggy. It also doesn't use the screen tables lookup yet. But it's late and I need to go to bed Smile

Code:
SUB plotPoint (x as uByte, y as uByte) ASM ld d,(IX+5) ;'X ld e,(IX+7) ;'Y ld a, 191 sub e ret c ld e, a and a rra scf rra and a rra xor e and 248 xor e ld h, a ld a, d rlca rlca rlca xor e and 199 xor e rlca rlca ld l, a ld a, d and 7 ld b, a inc b ld a, 1 plotPoint_loop: rrca djnz plotPoint_loop ;cpl ld b, a ld a, (hl) or b ld (hl), a END ASM END SUB FUNCTION t() as uLong asm DI LD DE,(23674) LD D,0 LD HL,(23672) EI end asm end function dim time0, time1, time2 as long dim n as uInteger cls for n=1 to 150 plotPoint(n,n-1) plot n,n+3 next n time0=t() for n=0 to 50000 plot 50,50 next n time1=t() for n=0 to 50000 plotPoint(50,50) next n time2=t() print "ZX Basic 50,000 plot:" print time1-time0;"frames =";(time1-time0)/cast(float,50);" seconds" print print "plotPoint 50,000 times:" print time2-time1;"frames=";(time2-time1)/cast(float,50);" seconds"

Print this item

  clearbox
Posted by: britlion - 2012-04-17, 02:30 AM - Forum: Documentation - Replies (6)

I've added a partial clear screen routine (clearBox.bas) to the library. It does what it says - clears a defined rectangle of the screen. Good for clearing out the bits you don't want, such as the game board, but leave the status bit alone.

<!-- m --><a class="postlink" href="http://www.boriel.com/wiki/en/index.php/ZX_BASIC:ClearBox">http://www.boriel.com/wiki/en/index.php ... C:ClearBox</a><!-- m -->

Print this item

  Does anyone Know where LCD's IDE is?
Posted by: YorkshireMale - 2012-04-16, 07:50 PM - Forum: How-To & Tutorials - Replies (5)

Where I can download them as I would love to have crack on ZX Basic Compiler on LCD IDE Smile :mrgreen:

Print this item

  new members
Posted by: slenkar - 2012-04-16, 05:05 PM - Forum: ZX Basic Compiler - Replies (1)

I advertised this site to a few friends and they say they have posted, but their posts arent showing up

Print this item