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

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

 
  for/next/step - did i find a bug?
Posted by: nitrofurano - 2011-11-03, 02:53 PM - Forum: Help & Support - Replies (3)

i don't know if this is a bug, or if i'm defining variable kind wrongly ('j' is not stopping at '0') - thanks in advance! Smile

Code:
border 0:cls dim i,j as uinteger for i=0 to 6143 step 3 poke 16384+0+i,128+16+2 poke 16384+1+i,64+8+1 poke 16384+2+i,32+4 next i lp01: for j=16384 to 0 step -32 print at 0,0;j;" " pause 1 for i=0 to 767 poke 16384+6144+i,peek(i+j) band 127 next i next j goto lp01

Print this item

  ASM features EQU and DEFM
Posted by: LCD - 2011-11-01, 01:59 AM - Forum: Wishlist - Replies (4)

Hi Boriel. I just adapted a ASM routine for key-redefining from WOS Forum to ZXBC for my next game, and noticed following:
EQU is not supported?
DEFM supports only Strings, but not mixed bytes+strings in one line like: DEFM 14,10,5,"Down",255
I adapted the lines by lacerating them to DEFB,DEFM and DEFB again, but maybe it would be a good idea to support bytes and Strings with DEFM, like other assemblers do.

Print this item

  OO
Posted by: slenkar - 2011-10-31, 01:36 AM - Forum: Wishlist - Replies (14)

any chance of OO programming features?

Print this item

  its fussy about #include
Posted by: slenkar - 2011-10-30, 08:53 PM - Forum: Help & Support - Replies (20)

the compiler doesnt like it when #include statements are not the first thing in a line
so this will work:
#include
but this will not:
<space> #include
the error message complains about a period or full stop being in the wrong place which is not the right issue.

This may turn someone off the language if they cant solve the problem

Print this item

  sprites like MJ's Trabajo Basura (not unregr. Fourspriter)
Posted by: nitrofurano - 2011-10-29, 11:45 PM - Forum: Wishlist - Replies (19)

not unregretting that awesome Fourspriter, what about that technique used on MojonTwin's Trabajo Basura? <!-- m --><a class="postlink" href="http://www.mojontwins.com/juegos_mojonos/trabajo-basura-dire-job/">http://www.mojontwins.com/juegos_mojono ... -dire-job/</a><!-- m -->
it seems to be very similar to most of the sprites used on zx-spectrum games - how would we use this kind of sprites from a zxbasic-compiler library?

Print this item

  asm context issue?
Posted by: britlion - 2011-10-25, 10:41 PM - Forum: Help & Support - Replies (3)

Code:
asm sub a,3 end asm

I think this is expecting sub to be the basic context subroutine, not the asm subtract command, so fails to compile?

zxb 1.2.8-s758

Print this item

  bezier and cubic curves
Posted by: nitrofurano - 2011-10-25, 05:33 PM - Forum: Help & Support - Replies (1)

finally i coded some snipets - two of them are about drawing bezier and cubic curves - btw, if someone can help them being faster, or part of the library, be welcome! Smile

beziercurve.bas

Code:
dim x0,y0,x1,y1,x2,y2,x3,y3 as float dim stpv,xi,xo,yi,yo,ir,i as float dim xr1,yr1,xr2,yr2 as float dim xsn,ycs as float dim xa,ya,xb,yb,xc,yc as float dim tw,t as float x0=20:y0=30:x1=50:y1=80:x2=150:y2=40:x3=110:y3=10 xa=(x3)-(3*x2)+(3*x1)-(x0) ya=(y3)-(3*y2)+(3*y1)-(y0) xb=(3*x2)-(6*x1)+(3*x0) yb=(3*y2)-(6*y1)+(3*y0) xc=(3*x1)-(3*x0) yc=(3*y1)-(3*y0) stpv=32 for tw=0 to stpv t=tw/stpv x=(((((xa*t)+xb)*t)+xc)*t)+x0 y=(((((ya*t)+yb)*t)+yc)*t)+y0 if tw=0 then:xo=x:yo=y:end if plot xo,yo:draw x-xo,y-yo :'- line (xo,yo,x,y): xo=x:yo=y next pause 0

cubiccurve.bas
Code:
dim x0,y0,x1,y1,x2,y2,x3,y3 as float dim stpv,xi,xo,yi,yo,ir,i as float dim xr1,yr1,xr2,yr2 as float dim xsn,ycs as float x0=20:y0=30:x1=50:y1=80:x2=150:y2=40 xr1=x1-x0:yr1=y2-y1 x3=x0+x2-x1:y3=y0+y2-y1 xr2=x2-x1:yr2=y3-y2 stpv=32 for i=0 to stpv ir=i*(1.570796/stpv) xsn=(xr1*sin(ir))-(xr2*cos(ir)) ycs=(yr1*(cos(ir)*-1))-(yr2*sin(ir)) xi=x3+xsn:yi=y3+ycs if i=0 then:xo=xi:yo=yi:end if if i<>0 then: plot xo,yo:draw xi-xo,yi-yo :'- line (xo,yo,xi,yi) end if xo=xi yo=yi next i pause 0

circlefill.bas
Code:
dim x,y,r,xl as ubyte dim yd as float x=50:y=60:r=40 for yd=0 to r xl=int((sin(acs(yd/r)))*r) plot x-xl,y+yd:draw xl*2,0 if yd<>0 then:plot x-xl,y-yd:draw xl*2,0:end if next yd pause 0

boxfill.bas
Code:
dim x1,y1,x2,y2 as integer x1=20:y1=30:x2=50:y2=80 for y=y1 to y2 plot x1,y:draw x2-x1,0 next y pause 0

box.bas
Code:
dim x1,y1,x2,y2 as integer x1=20:y1=30:x2=50:y2=80 plot x1,y1 draw x2-x1,0 draw 0,y2-y1 draw x1-x2,0 draw 0,y1-y2 pause 0

line.bas
Code:
dim x1,y1,x2,y2 as integer x1=20:y1=30:x2=50:y2=80 plot x1,y1 draw x2-x1,y2-y1 pause 0

Print this item

  Attribute Address
Posted by: britlion - 2011-10-25, 02:32 AM - Forum: How-To & Tutorials - No Replies

To unearth an aside I hadn't ever responded to in an old topic...I got playing.

boriel Wrote:There's already such a function in attr.asm library, but this one uses a different approach:
Code:
__ATTR_ADDR: ; calc start address in DE (as (32 * d) + e) ; Contributed by Santiago Romero at http://www.speccy.org ld h, 0 ld l, d add hl, hl ; HL = HL*2 add hl, hl ; HL = HL*4 add hl, hl ; HL = HL*8 add hl, hl ; HL = HL*16 add hl, hl ; HL = HL*32 ;; Note: *THIS IS WRONG* ; the addition of 6144 could be optimized to ; ld a, 18h ; add a, h ; ld h, a ; this saves 3 T-States (The above calculation misses E register) ;; adds 6144 for attribute start ld d, 18h ; DE = 6144 + E. Note: 6144 is the screen size (before attr zone) add hl, de ld de, (SCREEN_ADDR) ; Adds the screen address add hl, de ; Return current screen address in HL ret
Please check which one is faster (I'm not sure): This function takes 102 T-States (RET Included), your takes 67 (RET Included). With the commented optimization it will take 99 T-States.

The problem here is __ATTR_ADDR is taking into account a configurable SCREEN_ADDRESS variable (previously discussed here). So if you want your program to work in a variable screen address, you should work considering 0 offset an adding (SCREEN_ADDRESS) at the end, so should change it this way:
Code:
FUNCTION FASTCALL attrAddress(x as uByte, y as uByte) as Uinteger : REM Will issue a Warning asm ; This function returns the address into HL of the screen address ; x,y in character grid notation. ; Original code was extracted by BloodBaz - Adapted for ZX BASiC by Britlion from Na_TH_AN's fourspriter ld e, a ; X comes in A register (fastcall). Saves X in E register pop hl ; ret Address pop af ; Get Y in A [F not used] ld d, a ; Saves Y in D register, So DE register stores YX coords. push hl ; Put RET address back in the Stack ;; 39 T-States up to here, but we don't count this to be fair with the above ;; So 0 T-States. Start counting them from here ;; At this point, A already has Y coord rrca rrca rrca ; Multiply by 32 ld l,a ; Pass to L and 3 ; Mask with 00000011 ;; 23 T-States up to here ;; The following must be changed, start form 0 and add (SCREEN_ADDRESS) later ; add a,88 ; 88 * 256 = 22528 - start of attributes. add a,24 ; 24 * 256 = 6144 - start of attributes from address 0x0000h ld h,a ; Put it in the High Byte ld a,l ; We get y value *32 and 224 ; Mask with 11100000 ;; The following can be optimized ??? ; ld l,a ; Put it in L ; ld a,d ; xpos ; add a,l ; Add it to the Low byte add a, e ; add xpos ld l,a ; Put it back in L, and we're done. HL=Address. ;; 53 T-States up to here ld de, (SCREEN_ADDRESS) add hl, de ;; Total T-States = 84 T-States ;; (implicit RET) + 10 T-States = 94 T-States end asm END FUNCTION
So this function, adapted for a configurable screen address is 8 T-states faster than the original in ZX Basic (only 5 if the commented optimization is done) :?:


Just to be completely oddball, I started toying with this.
Code:
takes Y value in D, and X value in E returns attr address 4 AND A ; clear carry flag (this may optimise out if we know it's cleared?) 7 LD H,22 4 LD A,D ; we know left three bits are zero, since d <= 23 so rotate around: 4 RLCA 4 RLCA 4 RLCA ; now it /could/ get interesting we have to rotate potential 1's into H, simultaneously turning that 22 into the 88 H needs to point to address 22528. 4 RLA 8 RL H 4 RLA 8 RL H 4 add a,l 4 ld l,a 63 T states.

I haven't tested this, and it's after midnight. So it might not work. But I think that doing left shifts all the way might be faster?

I think this shaves about 40 T states of each Attr lookup in the current assembly. More if it can be assured it doesn't need to clear the carry flag.

This method does demand that screen address is on 1K boundaries, so as to be divided by 4 and stored in H. The default of 16384 for a screeen mem start fits (attr=22528).

Print this item

  what about a contest related with Boriel's zxbasic-compiler?
Posted by: nitrofurano - 2011-10-21, 11:31 PM - Forum: Help & Support - Replies (2)

i think would be great if, regularly (like once or twice per year), we can have some kind of contest for divulgate (and specific about) Boriel's zxbasic-compiler, and to have more people testing and contributing to this awesome project - what do you all think, and what can help making this contest popular in the zx-spectrum retro-development scene?

Print this item

  playing sound samples
Posted by: nitrofurano - 2011-10-14, 01:00 PM - Forum: Wishlist - Replies (10)

interesting would be a kind of command for playing samples, just like this type-in example found at wos repository:
http://www.worldofspectrum.org/infoseeki...id=0024188
ftp://ftp.worldofspectrum.org/pub/sincla...ampler.txt

since i knew from some magazine snippets from 80's, it seems to be not that hard to be implemented
the idea would be, somehow, we could convert a kind of .wav (or .flac, .aiff, .ogg, .mp3, .raw, etc., like from SoX or Audacity) into a kind of 8khz/1bit sound sample raw binary to be added as defb values, and play it from some zxbasiccompiler library

what do you all think? thanks!

Print this item