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




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 240 online users.
» 0 Member(s) | 239 Guest(s)
Bing

Latest Threads
New video Couse / Nuevo c...
Forum: News
Last Post: Duefectu
2026-04-29, 11:02 PM
» Replies: 0
» Views: 215
location of heap manageme...
Forum: Help & Support
Last Post: boriel
2026-03-07, 12:13 AM
» Replies: 1
» Views: 487
non-paged supervisor code...
Forum: Help & Support
Last Post: sdo303
2026-02-20, 06:38 PM
» Replies: 8
» Views: 1,302
How to open fuse as an ex...
Forum: How-To & Tutorials
Last Post: Duefectu
2026-02-09, 01:52 PM
» Replies: 3
» Views: 1,392
Old zxbasic game errors
Forum: Help & Support
Last Post: boriel
2025-11-09, 11:52 AM
» Replies: 7
» Views: 2,080
Error: Undefined GLOBAL l...
Forum: Help & Support
Last Post: ardentcrest
2025-11-04, 05:46 PM
» Replies: 3
» Views: 1,082
A Fast(er) Plot Routine f...
Forum: How-To & Tutorials
Last Post: tubz74
2025-10-30, 03:16 PM
» Replies: 2
» Views: 1,181
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,221
3DOS Commands?
Forum: Help & Support
Last Post: boriel
2025-10-06, 02:54 PM
» Replies: 3
» Views: 1,383

 
  [orca-marineboy] first test
Posted by: nitrofurano - 2014-11-06, 06:23 PM - Forum: Other Archs - No Replies

first test for the Orca-MarineBoy arcade machine
( <!-- m --><a class="postlink" href="http://www.boriel.com/wiki/en/index.php/ZX_BASIC:Released_Programs_-_OrcaMarineBoy">http://www.boriel.com/wiki/en/index.php ... aMarineBoy</a><!-- m --> )



Attached Files
.zip   example01f_working.zip (Size: 34.3 KB / Downloads: 1,154)
Print this item

  [komax-flower] first test
Posted by: nitrofurano - 2014-11-05, 02:11 PM - Forum: Other Archs - No Replies

first test for the Komax-Flower arcade machine
( <!-- m --><a class="postlink" href="http://www.boriel.com/wiki/en/index.php/ZX_BASIC:Released_Programs_-_KomaxFlower">http://www.boriel.com/wiki/en/index.php ... omaxFlower</a><!-- m --> )



Attached Files
.zip   example01d_working.zip (Size: 27.69 KB / Downloads: 1,036)
Print this item

  Another optimizer bug (*solved*)
Posted by: einar - 2014-11-04, 02:47 AM - Forum: Bug Reports - Replies (3)

Ouch! This bug gave me a headache! It took me some time to figure out the reason my game was crashing...

Take a look at this sample:

Code:
sub test() asm call $fc12 di ld a, $fe ld i, a im 2 ei end asm end sub test()

Try compiling this sample above using:

Code:
zxb.exe -A -O2 prog.bas

And it will produce the expected result:

Code:
_test: push ix ld ix, 0 add ix, sp #line 1 call $fc12 di ld a, $fe ld i, a im 2 ei #line 7 _test__leave: ld sp, ix pop ix ret

However try compiling it again using:

Code:
zxb.exe -A -O3 prog.bas

Now the result won't make sense anymore:

Code:
_test: push ix ld ix, 0 add ix, sp #line 1 call $fc12 di im 2 ei #line 7 _test__leave: ld sp, ix pop ix ret

The problem is, the optimizer is supposed to try to optimize its own generated code only, not someone else's assembly code that it doesn't have enough information to understand!

Print this item

  [sega-bankpanic] first test
Posted by: nitrofurano - 2014-11-02, 04:45 PM - Forum: Other Archs - No Replies

first test for the Sega-BankPanic arcade machine



Attached Files
.zip   example01c_working.zip (Size: 29.8 KB / Downloads: 1,071)
Print this item

  [sega-gigas] first test
Posted by: nitrofurano - 2014-11-02, 04:36 PM - Forum: Other Archs - No Replies

first test for the Sega-Gigas arcade machine (Free Kick configuration)
( <!-- m --><a class="postlink" href="http://www.boriel.com/wiki/en/index.php/ZX_BASIC:Released_Programs_-_SegaGigas">http://www.boriel.com/wiki/en/index.php ... _SegaGigas</a><!-- m --> )



Attached Files
.zip   example01d_working.zip (Size: 35.9 KB / Downloads: 1,059)
Print this item

  Weird bug involving OVER 1 (*solved*)
Posted by: einar - 2014-11-02, 02:47 PM - Forum: Bug Reports - Replies (5)

ZX BASIC has some weird bug involving OVER 1. Unfortunately I was unable to isolate this problem to produce a short example, so I will have to provide my full source code...

The ZEN source code is available here:

<!-- m --><a class="postlink" href="https://www.dropbox.com/sh/bgtoq6tdwropzzr/AAAknv_0PeJGhn36dLJZfGASa">https://www.dropbox.com/sh/bgtoq6tdwrop ... 6dLJZfGASa</a><!-- m -->

Right at the beginning, you will notice it sets ATTR_P to INK 0:

Code:
INK 0: PAPER 0: FLASH 0: BRIGHT 0: CLS

Afterwards it never sets a different INK, except for a single PRINT statement at the end of this sub-routine:

Code:
sub drawTile(row AS UBYTE, col AS UBYTE, color AS UBYTE) DIM tile AS UBYTE DIM ch AS UBYTE LET tile = PEEK BOARD(row, col) IF tile = 0 THEN IF row=0 AND col=width THEN OVER 1 ELSEIF color=2 THEN LET tile = 16 END IF END IF LET ch = (tile<<2)+32 POKE UINTEGER 23606, @zenchr-256 INK color PRINT AT row0+(row<<1), col0+(col<<1); CHR$(ch);CHR$(ch+1);AT row0+(row<<1)+1, col0+(col<<1);CHR$(ch+2);CHR$(ch+3);: INK 0 OVER 0 end sub

An obvious optimization would be setting a temporary INK inside this PRINT statement, instead of using a separate INK statement before, and another INK 0 immediately afterwards. Right? Unfortunately that won't work! Try it yourself. Replace these lines:

Code:
INK color PRINT AT row0+(row<<1), col0+(col<<1); CHR$(ch);CHR$(ch+1);AT row0+(row<<1)+1, col0+(col<<1);CHR$(ch+2);CHR$(ch+3);: INK 0 OVER 0

with this:

Code:
PRINT INK color; AT row0+(row<<1), col0+(col<<1); CHR$(ch);CHR$(ch+1);AT row0+(row<<1)+1, col0+(col<<1);CHR$(ch+2);CHR$(ch+3);: OVER 0

If you recompile ZEN with this change, parts of the board will be disappearing on screen. If you analyze the screen when it happens, you will notice the INK colors are correct on screen, but the pixels are missing. Therefore this PRINT statement is apparently using OVER 1 even in cases where OVER 1 wasn't set.

This bug is not relevant for me anymore since I have already released this game anyway, but it demonstrates ZX BASIC has some bug involving OVER 1 that may affect other developers in the future.

Print this item

  Routine mapping?
Posted by: einar - 2014-11-02, 06:51 AM - Forum: Wishlist - Replies (2)

Right now, ZX BASIC already supports variable mapping. If I already have a variable defined at a certain memory address, I can reference it as follows:

Code:
DIM x AS UBYTE AT 64000

It would be nice if ZX BASIC could also support routine mapping. If I already have an assembly routine implemented at a certain memory address, I would like to reference it as follows:

Code:
DECLARE sub FASTCALL doSomething(src as UINTEGER, dst as UINTEGER) AT 64000

In the meantime, I'm having to use this workaround:

Code:
sub FASTCALL doSomething(src as UINTEGER, dst as UINTEGER) asm jp 64000 end asm end sub


EDIT: Of course routine mapping should also work with both sub-routines and functions, either FASTCALL or not, exactly like any other ZX BASIC routine implemented in asm directly inside the routine body.

Print this item

  [sun-stratovox] first test
Posted by: nitrofurano - 2014-10-30, 08:00 PM - Forum: Other Archs - No Replies

first test for the Sun-Stratovox arcade machine
( <!-- m --><a class="postlink" href="http://www.boriel.com/wiki/en/index.php/ZX_BASIC:Released_Programs_-_SunStratovox">http://www.boriel.com/wiki/en/index.php ... nStratovox</a><!-- m --> )



Attached Files
.zip   example01e_working.zip (Size: 118.52 KB / Downloads: 1,065)
Print this item

  [capcom-sectionz] first test
Posted by: nitrofurano - 2014-10-29, 10:42 PM - Forum: Other Archs - No Replies

first test for the Capcom’s Section-Z arcade machine (Legendary Wings configuration)
( the wiki page related to this thread is at <!-- m --><a class="postlink" href="http://www.boriel.com/wiki/en/index.php/ZX_BASIC:Released_Programs_-_CapcomSectionZ">http://www.boriel.com/wiki/en/index.php ... omSectionZ</a><!-- m --> )



Attached Files
.zip   example01e_working.zip (Size: 128.42 KB / Downloads: 1,074)
Print this item

  [tecmo] first test - rygar
Posted by: nitrofurano - 2014-10-26, 11:01 PM - Forum: Other Archs - No Replies

first test for the Tecmo arcade machine (Rygar configuration)



Attached Files
.zip   example01d_working.zip (Size: 135.09 KB / Downloads: 1,092)
Print this item