Welcome, Guest |
You have to register before you can post on our site.
|
Online Users |
There are currently 130 online users. » 0 Member(s) | 127 Guest(s) Applebot, Bing, Google
|
Latest Threads |
.tap file code not execut...
Forum: Help & Support
Last Post: Zoran
04-28-2025, 10:59 AM
» Replies: 4
» Views: 347
|
Exit from more than one l...
Forum: Wishlist
Last Post: Duefectu
04-23-2025, 10:06 PM
» Replies: 3
» Views: 302
|
put small ASM programs li...
Forum: How-To & Tutorials
Last Post: Zoran
04-18-2025, 02:02 PM
» Replies: 6
» Views: 1,608
|
Creating +3 Menus - Loadi...
Forum: Help & Support
Last Post: merlinkv
04-16-2025, 02:08 PM
» Replies: 6
» Views: 558
|
Randomize not very random...
Forum: Help & Support
Last Post: Zoran
04-08-2025, 10:40 AM
» Replies: 4
» Views: 896
|
Scope rules
Forum: Bug Reports
Last Post: Zoran
04-04-2025, 09:46 AM
» Replies: 2
» Views: 340
|
Using constants not allow...
Forum: Bug Reports
Last Post: baltasarq
03-19-2025, 10:00 PM
» Replies: 8
» Views: 1,070
|
404 page not found
Forum: Documentation
Last Post: boriel
03-08-2025, 07:16 PM
» Replies: 5
» Views: 2,888
|
Spectrum keywords codes
Forum: Bug Reports
Last Post: boriel
03-08-2025, 11:00 AM
» Replies: 1
» Views: 421
|
ZXodus][Engine
Forum: ZX Basic Compiler
Last Post: boriel
02-19-2025, 11:43 PM
» Replies: 69
» Views: 213,820
|
|
|
byte loops (*solved*) |
Posted by: britlion - 04-19-2012, 01: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
|
|
|
Double Size Print |
Posted by: britlion - 04-19-2012, 01: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)
|
|
|
Screen handling |
Posted by: britlion - 04-18-2012, 01: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 
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"
|
|
|
clearbox |
Posted by: britlion - 04-17-2012, 01: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 -->
|
|
|
Using screen lookup tables |
Posted by: britlion - 04-13-2012, 11:12 PM - 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.
|
|
|
Line Feed and ",," bug (*solved*) |
Posted by: LCD - 03-25-2012, 05:04 PM - Forum: Bug Reports
- Replies (4)
|
 |
Just one small question. How to make Line Feed with Print with ZXBC?
in Sinclair BASIC this worked:
Code: Print "Line1" ' "Line2"
But in ZXBC the '-Character is used for REM, and ยด and ` are illegal characters for the compiler.
It looks also like I stepped on a bug in release 809 (maybe in earlier versions too:
Code: Print at 0,0;"Spectrum users to celebrate the",,"30th birthday of our Speccy.";
the double coma should leave one line free, but in fact it prints the character "3" at Position x=31,y=1, where it should be position x=0,y=2.
|
|
|
|