07-25-2003, 12:47 AM
Jark:
1.- I have been tweaking with the mandelbrot Set drawer. The first thing I have made is a keyboard control, as I am a poor W2000 user and the mouse does'nt work for me..
I have stumbled on the following line
being
If I'm not wrong, 1.4E45 ^100 = 1.whatever ^4500
and the minimum double QBcan handle is 4.9e-324, so your eps^100 is simply 0.....
2.- Here is a small suggestion to make Tclib faster
Just change the present PSet24 and Point24 by the following ones. No arrays to precalculate, or VESA line lengthts to change, just rename or erase present Point24 and Pset24 and add next two subs.
and
This must be combinded with SetVGA ending by
(this makes a bank to be set before the first pixel is drawn)
1.- I have been tweaking with the mandelbrot Set drawer. The first thing I have made is a keyboard control, as I am a poor W2000 user and the mouse does'nt work for me..
I have stumbled on the following line
Code:
Hmdb = 60 + LOG(MdbVar# + eps ^ 100) * 120
Code:
CONST eps = 1.401298E-45 ' Avoids logarithm overflow
If I'm not wrong, 1.4E45 ^100 = 1.whatever ^4500
and the minimum double QBcan handle is 4.9e-324, so your eps^100 is simply 0.....
2.- Here is a small suggestion to make Tclib faster
Just change the present PSet24 and Point24 by the following ones. No arrays to precalculate, or VESA line lengthts to change, just rename or erase present Point24 and Pset24 and add next two subs.
Code:
DEFINT A-Z
SUB Point24 (x%, y%)
' Returns the current RGB combination of the selected pixel
'just an idea...
CONST windw = 65536
'Point needs a safety need or it could try to set an unexistant bank
IF x% < xPlotMin% OR x% > xPlotMax% OR y% < yPlotMin% OR y% > yPlotMax% THEN
Red% = -1
Green% = -1
Blue% = -1
EXIT SUB
END IF
Offset& = Bpl * y% + Bpp * x%
bank = Offset& \ windw
Offset& = Offset& AND 65535
DEF SEG = &HA000
IF bank <> CurBank THEN
CurBank = bank
Regs.ax = &H4F05
Regs.bx = 0
Regs.dx = CurBank
CALL INTERRUPT(&H10, Regs, Regs)
END IF
Blue% = PEEK(Offset&)
Offset& = Offset& + 1
IF Offset& = windw THEN
Offset& = 0
CurBank = CurBank + 1
Regs.ax = &H4F05
Regs.bx = 0
Regs.dx = CurBank
CALL INTERRUPT(&H10, Regs, Regs)
END IF
Green% = PEEK(Offset&)
Offset& = Offset& + 1
IF Offset& = windw THEN
Offset& = 0
CurBank = CurBank + 1
Regs.ax = &H4F05
Regs.bx = 0
Regs.dx = CurBank
CALL INTERRUPT(&H10, Regs, Regs)
END IF
Red% = PEEK(Offset&)
END SUB
and
Code:
DEFINT A-Z
SUB Pset24 (x%, y%)
' Plots a pixel using the current RGB combination
CONST windw = 65536
DEF SEG = &HA000
IF x% < xPlotMin% OR x% > xPlotMax% OR y% < yPlotMin% OR y% > yPlotMax% THEN EXIT SUB
Offset& = Bpl * y% + Bpp * x%
bank = Offset& \ windw
Offset& = Offset& AND 65535
IF bank <> CurBank THEN
CurBank = bank
Regs.ax = &H4F05
Regs.bx = 0
Regs.dx = CurBank
CALL INTERRUPT(&H10, Regs, Regs)
END IF
POKE Offset&, Blue%
Offset& = Offset& + 1&
IF Offset& >= windw THEN
Offset& = 0
CurBank = CurBank + 1
Regs.ax = &H4F05
Regs.bx = 0
Regs.dx = CurBank
CALL INTERRUPT(&H10, Regs, Regs)
END IF
POKE Offset&, Green%
Offset& = Offset& + 1&
IF Offset& >= windw THEN
Offset& = 0
CurBank = CurBank + 1
Regs.ax = &H4F05
Regs.bx = 0
Regs.dx = CurBank
CALL INTERRUPT(&H10, Regs, Regs)
END IF
POKE Offset&, Red%
END SUB
This must be combinded with SetVGA ending by
Code:
Curbank=-1
Antoni