12-16-2010, 09:40 AM
Okay, a new beta release with a fix and two interesting optimizations :!:
To do:
- ! The optimizer could hang under rare circumstances. Fixed.
- ! The csrlin() routine had a bug reporting sometimes the wrong position (this also affected Input() library which uses it). Fixed.
- + Every BEEP command always took 21 bytes. Now it only takes 11 bytes and it's faster (good for sound effects) if only constant numbers are used. So beep <num1>, <num2> is much optimized.
- DRAW routine has been improved for speed. Now it's 200% faster (aprox.) and takes only 150 bytes more.
- PLOT, DRAW & CIRCLE now uses SCREEN_ADD positioning => you can "DRAW" at part of the memory pointed by this internal variable.
To do:
- If several constant beeps (BEEP <num1>, <num2>) are specified one after another, they will be "compressed" and played with a beep sequencer. So every beep in the sequence takes only 4 bytes.
- A new library routine is in preparation: polyline, which draws a sequence of lines to coords Xn, Yn:
Code:REM A list of coords (Unsigned Bytes)
DIM CoordList(10, 2) as UByte = { {1, 1}, {3, 100}, {20, 80}, ... _
... ' More coord lists
{128, 189}}
REM Draws a polilyne of 10 coordinates, taking coord 0 as the 1st one
REM The 2nd 0 is mondatory, but useless here.
PolyLine(10, @CoordList(0, 0)) - UBound and LBound soon to come (for getting the Upper and Lower bound of arrays).
Code:DIM a(2 To 5, 1 TO 8) as Byte
PRINT Ubound(a, 1) : REM prints 2
PRINT LBound(a, 2) : REM prints 8 - Variable parameters function calls, like in FreeBasic or C
This way, function AVG can receive any numbers of parameters of any type.Code:Function Avg(n as uByte, ...)
...
End Function
PRINT Avg(3, 2.5, 3.6, 7.8)
PRINT Avg(5, 1, 4, 5, 7, 9)