![]() |
|
New beta release 1.2.7r2021 - Printable Version +- Boriel Basic Forum (https://forum.boriel.com) +-- Forum: Compilers and Computer Languages (https://forum.boriel.com/forumdisplay.php?fid=12) +--- Forum: ZX Basic Compiler (https://forum.boriel.com/forumdisplay.php?fid=11) +---- Forum: Bug Reports (https://forum.boriel.com/forumdisplay.php?fid=15) +---- Thread: New beta release 1.2.7r2021 (/showthread.php?tid=295) |
New beta release 1.2.7r2021 - boriel - 2011-02-01 Okay, a new beta release with a *critical* fix and two interesting optimizations :!:
Please, test needed :!: The compiler has undergone *deep changes* with this update. You can download (as always) from <!-- m --><a class="postlink" href="http://www.boriel.com/files/zxb">http://www.boriel.com/files/zxb</a><!-- m --> Re: New beta release 1.2.7r2021 - apenao - 2011-02-01 Great ! I'm going to try my ongoing projets with this version this night, I'll tell you if it doesn't work ![]() Thanks ! Re: New beta release 1.2.7r2021 - LCD - 2011-02-01 Me too. Currently a bit busy, but will test it with some of my code. if it will fail, I will cry ...
Re: New beta release 1.2.7r2021 - apenao - 2011-02-01 First problem ![]() Compiling this: Code: DIM bufferx (0 to 4,0 to 5) as ubyte => {{10,0,0,0,0,0},_
{0,0,0,0,0,0},_
{0,0,0,0,0,0},_
{0,0,0,0,0,0},_
{0,0,0,0,0,0}}Returns this: > Executing: C:\Program Files (x86)\ConTEXT\ConExec.exe -i "C:\Program Files (x86)\Boriel Tm\ZX Basic Compiler\zxb.exe" -T -B -O 3 -S 24000 -a PRUEBA~1.bas Generating LALR tables PRUEBA~1.bas:1 Error: illegal preprocessor character '{' > Execution finished. I hope it's not a big thing. Re: New beta release 1.2.7r2021 - apenao - 2011-02-01 I have just noticed that 2 new files have appeared in the directory where the .bas file is: parser.out zxbasmpptab.py Maybe it's related to the problem I had. Re: New beta release 1.2.7r2021 - boriel - 2011-02-01 apenao Wrote:I have just noticed that 2 new files have appeared in the directory where the .bas file is:Nope, they are *rubbish*. I did include them by accident. The bug is due to the new preprocessor which do not accept "unknown" characters. This is an easy fix. Fixing... Re: New beta release 1.2.7r2021 - boriel - 2011-02-02 Ok, please. Redownload new version 1.2.7-r2024 :roll: <!-- m --><a class="postlink" href="http://www.boriel.com/wiki/en/index.php/ZX_BASIC:Archive#Latest_Development_Version">http://www.boriel.com/wiki/en/index.php ... nt_Version</a><!-- m --> Re: New beta release 1.2.7r2021 - LCD - 2011-02-02 But this test program (and a second one which I sent by PM) still suffer from this problem: Code: FUNCTION scrAddress(x as uByte, y as uByte) as Uinteger
asm
;' This fn 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
; x Arrives in A, y is in stack.
and 31
ld l,a
ld a,(IX+7) ; Y value
ld d,a
and 24
add a,64
ld h,a
ld a,d
and 7
rrca
rrca
rrca
or l
ld l,a
end asm
END FUNCTION
FUNCTION attrAddress(x as uByte, y as uByte) as uInteger
';; This function returns the memory address of the Character Position
';; x,y in the attribute screen memory.
';; Adapted from code by Jonathan Cauldwell - Adapted for ZX BASiC by Britlion from Na_TH_AN's fourspriter
asm
ld a,(IX+7) ;ypos
rrca
rrca
rrca ; Multiply by 32
ld l,a ; Pass to L
and 3 ; Mask with 00000011
add a,88 ; 88 * 256 = 22528 - start of attributes.
ld h,a ; Put it in the High Byte
ld a,l ; We get y value *32
and 224 ; Mask with 11100000
ld l,a ; Put it in L
ld a,(IX+5) ; xpos
add a,l ; Add it to the Low byte
ld l,a ; Put it back in L, and we're done. HL=Address.
end asm
END FUNCTION
sub putblock(x as Ubyte,y as ubyte,wid as ubyte,hgt as ubyte,adr as Uinteger)
dim scr,attribute as Uinteger
dim x1,y1 as Ubyte
dim a as Ubyte
poke uinteger @putblock1+7,wid
poke uinteger @putblock2+7,wid
for y1=0 to hgt-1
scr=scrAddress(x,y+y1)
for a=0 to 7
poke uinteger @putblock1+1,adr
poke uinteger @putblock1+4,scr
putblock1:
asm
ld hl,1
ld de,2
ld bc,3
ldir
end asm
adr=adr+wid
scr=scr+256
next a
next y1
attribute=attrAddress(x,y)
for y1=0 to hgt-1
poke uinteger @putblock2+1,adr
poke uinteger @putblock2+4,attribute
adr=adr+wid
attribute=attribute+32
putblock2:
asm
ld hl,4
ld de,5
ld bc,6
ldir
end asm
next y1
End sub
start:
putblock(0,18,8,6,0)
putblock(8,18,8,6,0)
putblock(16,18,8,6,0)
putblock(24,18,8,6,0)
putblock(24,12,8,6,0)
putblock(24,6,8,6,0)
putblock(24,0,8,6,0)
putblock(0,0,24,18,0)
pause 0Re: New beta release 1.2.7r2021 - apenao - 2011-02-02 boriel Wrote:Ok, please. Redownload new version 1.2.7-r2024 :roll: It compiles without problems my new project (that doesn't use inline assembler, just basic), but when I try to compile my other game (the one with the walking hat) I get this: Quote:> Executing: C:\Program Files (x86)\ConTEXT\ConExec.exe -i "C:\Program Files (x86)\Boriel Tm\ZX Basic Compiler\zxb.exe" -T -B -O 3 -S 24000 -a GEB742~1.bas Re: New beta release 1.2.7r2021 - boriel - 2011-02-02 Okay, please download 1.2.7r2028, just uploaded: <!-- m --><a class="postlink" href="http://www.boriel.com/wiki/en/index.php/ZX_BASIC:Archive#Latest_Development_Version">http://www.boriel.com/wiki/en/index.php ... nt_Version</a><!-- m --> Hope this time it works! :roll: It's all related to the zxbpp module, not the compiler itself. Re: New beta release 1.2.7r2021 - boriel - 2011-02-02 apenao Wrote:Your *new* project? Please, don't tell me you abandoned the Gentleman project:!:boriel Wrote:Ok, please. Redownload new version 1.2.7-r2024 :roll: I was expecting it, to show off the compiler capabilities! ![]() Quote:Generating LALR tablesNote: This message should not appear. It means it is recalculating compiling tables, takes time, and writes the parser.out trash temp file. *Fixed* :wink: (I precalculate compiler tables and remove trash files when packaging the .msi installer file) Re: New beta release 1.2.7r2021 - apenao - 2011-02-02 boriel Wrote:Your *new* project? Please, don't tell me you abandoned the Gentleman project:!: No, I just put it on the side while finishing a game for the radastan's basic games compo. I didn't make it on time, but it's going quite well so I decided to go on with it for a while. But I will go back with HTBACG, in fact some of the last features you included in the compiler (such as faster draw routine, bitwise logical operators) seems to be taylor-made for this game alone .) Re: New beta release 1.2.7r2021 - boriel - 2011-02-02 apenao Wrote:Thx! 8)boriel Wrote:Your *new* project? Please, don't tell me you abandoned the Gentleman project:!: Please, test the latest versión (r2028) just uploaded! Re: New beta release 1.2.7r2021 - apenao - 2011-02-02 I just compiled it again (the Gentleman game) with the 2028 version and I get this: Code: > Executing: C:\Program Files (x86)\ConTEXT\ConExec.exe -i "C:\Program Files (x86)\Boriel Tm\ZX Basic Compiler\zxb.exe" -T -B -O 3 -S 24000 -a GE2240~1.bas
input.bas:38: warning: Empty loop
GE2240~1.bas:1088: Syntax Error. Unexpected token 'SUB' <ID>
GE2240~1.bas:1088: warning: Variable 'xd' declared as 'float'
GE2240~1.bas:1088: Syntax Error. Unexpected token 'as' <ID>
GE2240~1.bas:1088: illegal character ','
> Execution finished.The input.bas... line refers to an #include <sinclair.bas> sentence The other stuff is related to my sprite routine (sprite2). It's the same I sent you a while ago, but if you need it again, tell me. Re: New beta release 1.2.7r2021 - boriel - 2011-02-02 Okay. This is another preprocessor issue. Can you send me your code by mail on in a priv. msg? I can't reproduce it. |