| Welcome, Guest |
You have to register before you can post on our site.
|
| 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
|
|
|
| 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
|
|
|
| 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)
|
|
|
| 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 
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 - 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 -->
|
|
|
| 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.
|
|
|
|