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

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 267
» Latest member: ConradoBadenas
» Forum threads: 1,083
» Forum posts: 6,474

Full Statistics

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

Latest Threads
Old zxbasic game errors
Forum: Help & Support
Last Post: boriel
Yesterday, 11:52 AM
» Replies: 7
» Views: 140
Error: Undefined GLOBAL l...
Forum: Help & Support
Last Post: ardentcrest
2025-11-04, 05:46 PM
» Replies: 3
» Views: 109
A Fast(er) Plot Routine f...
Forum: How-To & Tutorials
Last Post: tubz74
2025-10-30, 03:16 PM
» Replies: 2
» Views: 160
Hall of Fame - Include fo...
Forum: How-To & Tutorials
Last Post: tubz74
2025-10-28, 03:48 PM
» Replies: 0
» Views: 92
[SOLVED] Array layout bug...
Forum: Bug Reports
Last Post: Zoran
2025-10-25, 05:48 PM
» Replies: 2
» Views: 219
3DOS Commands?
Forum: Help & Support
Last Post: boriel
2025-10-06, 02:54 PM
» Replies: 3
» Views: 383
How to open fuse as an ex...
Forum: How-To & Tutorials
Last Post: zedex82
2025-10-05, 07:36 PM
» Replies: 2
» Views: 280
CLS/Fade out ASM Sub-rout...
Forum: How-To & Tutorials
Last Post: tubz74
2025-10-05, 03:39 PM
» Replies: 2
» Views: 273
ZX Basic Studio Bugs
Forum: Bug Reports
Last Post: Duefectu
2025-09-23, 04:07 PM
» Replies: 5
» Views: 1,083
Printing with FZX
Forum: Help & Support
Last Post: boriel
2025-07-17, 10:08 PM
» Replies: 1
» Views: 1,965

 
  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

  ZX Basic Compiler?
Posted by: YorkshireMale - 2012-04-14, 09:53 PM - Forum: ZX Basic Compiler - Replies (5)

Hello All

I have download the ZX Basic Compiler and I dont know which Compiler do I have click as I want type in Basic Smile

There is

W9xpopen.exe
ZXb.exe
ZXbpp.exe

I do know other one is asm (ZXbasm.exe)

please let me know Smile

Print this item

  Using screen lookup tables
Posted by: britlion - 2012-04-14, 12:12 AM - Forum: Wishlist - Replies (5)

It occurs to me that a lot of game programmers would use screen address lookup tables - I've included one in with several library routines at this point.

I think we need to standardize this important library, to be honest.


1> It should be easily includable, and documented on its use. And only let itself be included once! Perhaps setting some parameter, such that the compiler includes it in automatically?
- it must, of course, be aligned. (which is another topic - the align code should be really clever about not wasting bytes, if it can squeeze some other code up in the "missed space"

2> It should be used, if available, by other ZX Basic functions - I'm thinking in particular of plot and draw, which use the ROM routine PIXELADD. Very important this. If we're willing to give up memory for a table, lets have everything use it!

3> It should be user-replaceable, if they follow the structure - so that they can define their own screen buffer, and fast-lookup screen addresses in the buffer, instead.

Print this item

  Tutorial: How to Write a Pac Man Clone in ZX Basic
Posted by: britlion - 2012-04-06, 03:04 PM - Forum: How-To & Tutorials - Replies (6)

Nowhere near finished, but it turning into a hefty dissertation on how to use ZX Basic.

Complaints about errors, typos, not finishing it for the next five years, and inability to write back to me please.

http://goo.gl/4jPd5

Print this item