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

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 269
» Latest member: Josephcew
» Forum threads: 1,075
» Forum posts: 6,435

Full Statistics

Online Users
There are currently 173 online users.
» 0 Member(s) | 170 Guest(s)
Applebot, Bing, Google

Latest Threads
Strange Happenings
Forum: Bug Reports
Last Post: zedex82
05-07-2025, 09:05 AM
» Replies: 0
» Views: 40
.tap file code not execut...
Forum: Help & Support
Last Post: Zoran
04-28-2025, 10:59 AM
» Replies: 4
» Views: 416
Exit from more than one l...
Forum: Wishlist
Last Post: Duefectu
04-23-2025, 10:06 PM
» Replies: 3
» Views: 331
put small ASM programs li...
Forum: How-To & Tutorials
Last Post: Zoran
04-18-2025, 02:02 PM
» Replies: 6
» Views: 1,658
Creating +3 Menus - Loadi...
Forum: Help & Support
Last Post: merlinkv
04-16-2025, 02:08 PM
» Replies: 6
» Views: 602
Randomize not very random...
Forum: Help & Support
Last Post: Zoran
04-08-2025, 10:40 AM
» Replies: 4
» Views: 934
Scope rules
Forum: Bug Reports
Last Post: Zoran
04-04-2025, 09:46 AM
» Replies: 2
» Views: 371
Using constants not allow...
Forum: Bug Reports
Last Post: baltasarq
03-19-2025, 10:00 PM
» Replies: 8
» Views: 1,131
404 page not found
Forum: Documentation
Last Post: boriel
03-08-2025, 07:16 PM
» Replies: 5
» Views: 2,919
Spectrum keywords codes
Forum: Bug Reports
Last Post: boriel
03-08-2025, 11:00 AM
» Replies: 1
» Views: 437

 
  [sega-bankpanic] first test
Posted by: nitrofurano - 11-02-2014, 03: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: 759)
Print this item

  [sega-gigas] first test
Posted by: nitrofurano - 11-02-2014, 03: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: 740)
Print this item

  Weird bug involving OVER 1 (*solved*)
Posted by: einar - 11-02-2014, 01: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 - 11-02-2014, 05: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 - 10-30-2014, 07: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: 765)
Print this item

  [capcom-sectionz] first test
Posted by: nitrofurano - 10-29-2014, 09: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: 755)
Print this item

  [tecmo] first test - rygar
Posted by: nitrofurano - 10-26-2014, 10: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: 779)
Print this item

  [konami-timepilot] first test
Posted by: nitrofurano - 10-26-2014, 07:04 PM - Forum: Other Archs - No Replies

first test for the Konami-TimePilot arcade machine



Attached Files
.zip   example01d_working.zip (Size: 152.44 KB / Downloads: 737)
Print this item

  [poby-news] first test
Posted by: nitrofurano - 10-23-2014, 12:19 PM - Forum: Other Archs - No Replies

first test for Poby-News arcade machine:
<!-- m --><a class="postlink" href="https://dl.dropboxusercontent.com/u/795795/retrocoding/arcade/PobyNews/example01c_works.zip">https://dl.dropboxusercontent.com/u/795 ... _works.zip</a><!-- m -->

Print this item

  [scramble] first test
Posted by: nitrofurano - 10-23-2014, 10:02 AM - Forum: Other Archs - No Replies

first test for Scramble hardware (Triple Punch machine configuration)



Attached Files
.zip   example01d_working.zip (Size: 137.31 KB / Downloads: 765)
Print this item