Fbsl.exe v3.5 Beta

(Vital Data and New Beta Release Info)

Re: Fbsl.exe v3.5 Beta

Unread postby Codeman » Mon Mar 11, 2013 8:03 pm

it say include skipped line 30 31 and 32 wtf ???

fixed my issue, as expected it came from kernel32 :/
_-=<(¯`·._.·[ CodeMan ]·._.·´¯)>=-_
Your only limit : Your imagination

FBSL V3 TESTED On :
Image

Chris 1 (Corei5-4460S 2.9 GHZ w/ 16GB RAM, GeForce GTX 745 w/ 4GB VRAM, Windows 8 x64 Fr)
Chris 2 (2.0GHz AMD Atlon 64 X2 3800+ w/ 4GB RAM, GeForce 9600GT w/ 1GB VRAM, Windows 7 x64 Fr)
Chris 3 (Tablet pc : ASUS Transformer Book T100)
User avatar
Codeman
FBSL Administrator
FBSL Administrator
 
Posts: 497
Joined: Sat Nov 24, 2007 4:33 pm
Location: France

Re: Fbsl.exe v3.5 Beta

Unread postby Mike Lobanovsky » Mon Mar 11, 2013 8:31 pm

Codeman wrote:fixed my issue, as expected it came from kernel32 :/

Do you mean your 17,000-line monster now works for you with Fbsl.exe v3.5 Beta? Can we know exactly what was causing the crash?

Codeman wrote:it say include skipped line 30 31 and 32 wtf ???

Can you try a cold reboot to see if your TestDynC6.fbs starts to work for you again?
Mike
"Я старый солдат, мадам, и не знаю слов любви."
"I am an old soldier, ma'am, and I don't know the words of love."
"Je suis un vieux soldat, madame, et je ne connais pas les mots d'amour."
"Ich bin ein alter Soldat, gnädige Frau, und ich weiß nicht die Worte der Liebe."

__________________________________________________________________________________________________________________________________________________
(3.2GHz i5 Core Quad, 8GB RAM / 2 x nVidia GTX 550Ti SLI-bridged, 2GB VRAM)
(x86 Win XP Pro Russian Sp3/x86 Win Vista Ultimate Sp2/x64 Win 7 Ultimate Sp1/Wine in x64 elementaryOS Luna)
User avatar
Mike Lobanovsky
FBSL Administrator
FBSL Administrator
 
Posts: 1824
Joined: Tue Apr 19, 2005 8:22 am
Location: Republic of Belarus

Re: Fbsl.exe v3.5 Beta

Unread postby Mike Lobanovsky » Mon Mar 11, 2013 8:39 pm

To All:

I forgot to mention that FBSL v3.5's preprocessor now supports a new directive:

#Warnings On -- all yellow-color console warnings are printed (default)
#Warnings Off -- all yellow-color console warnings are suppressed (doesn't affect red-color errors)

FBSL v3.5 reports many more warnings and errors than the previous versions did. You may now suppress warnings enforcing FBSL to break on red-alert errors only.

Note that #Warnings On|Off does not affect the methods and scope of error evaluation by #Option Implicit|Explicit|Strict which remained the same as before.

Thanks Gerome for reminding me of this new feature! :)
Mike
"Я старый солдат, мадам, и не знаю слов любви."
"I am an old soldier, ma'am, and I don't know the words of love."
"Je suis un vieux soldat, madame, et je ne connais pas les mots d'amour."
"Ich bin ein alter Soldat, gnädige Frau, und ich weiß nicht die Worte der Liebe."

__________________________________________________________________________________________________________________________________________________
(3.2GHz i5 Core Quad, 8GB RAM / 2 x nVidia GTX 550Ti SLI-bridged, 2GB VRAM)
(x86 Win XP Pro Russian Sp3/x86 Win Vista Ultimate Sp2/x64 Win 7 Ultimate Sp1/Wine in x64 elementaryOS Luna)
User avatar
Mike Lobanovsky
FBSL Administrator
FBSL Administrator
 
Posts: 1824
Joined: Tue Apr 19, 2005 8:22 am
Location: Republic of Belarus

Re: Fbsl.exe v3.5 Beta

Unread postby Mike Lobanovsky » Mon Mar 11, 2013 9:01 pm

To All:

!!! VERY IMPORTANT !!!

There is yet another caveat regarding name shadowing, this time related to Windows.inc.

This include file is very extensive -- in fact, much more exhaustive than the meager define list of the former "@|WIN32" library. There's a fair chance that some of the names you used for your variables in your old scripts are already reserved by M$ in this include file. A #Define always takes precedence over anything else you type in your script, so please make sure the names you choose for your variables and functions are not "shadowed" by Kernel32.dll and User32.dll function name imports and/or Windows.inc #Defines.
Mike
"Я старый солдат, мадам, и не знаю слов любви."
"I am an old soldier, ma'am, and I don't know the words of love."
"Je suis un vieux soldat, madame, et je ne connais pas les mots d'amour."
"Ich bin ein alter Soldat, gnädige Frau, und ich weiß nicht die Worte der Liebe."

__________________________________________________________________________________________________________________________________________________
(3.2GHz i5 Core Quad, 8GB RAM / 2 x nVidia GTX 550Ti SLI-bridged, 2GB VRAM)
(x86 Win XP Pro Russian Sp3/x86 Win Vista Ultimate Sp2/x64 Win 7 Ultimate Sp1/Wine in x64 elementaryOS Luna)
User avatar
Mike Lobanovsky
FBSL Administrator
FBSL Administrator
 
Posts: 1824
Joined: Tue Apr 19, 2005 8:22 am
Location: Republic of Belarus

Re: Fbsl.exe v3.5 Beta

Unread postby Mike Lobanovsky » Mon Mar 11, 2013 9:57 pm

My private messaging with Gerome forces me to make another note on name shadowing in anticipation of the shouts like gimme my RCDATA id 256 back! i don't want to keep track of all that name shadowing myself! i've got monstrous scripts to write and your horrible Windows.inc is interfering with my business!!!

Lazy bones! That's what Visual Studio is all about: helping out the user to avoid extra work. As you type in your C script, context-sensitive help pops up suggesting the names which you already used either in your imports, or in your headers, or somewhere above in you script. Knowing that you intend to type a completely new name, you simply avoid typing the names which are already there in the popup list.

Simple? Yes! So who's gonna set off developing a 17,000-line script of a Visual Studio for FBSL which everyone of us needs very very badly? Who's that brave guy might be, I wonder? :winkwink: Who's that brave guy might have been for all these years? :whip:
Mike
"Я старый солдат, мадам, и не знаю слов любви."
"I am an old soldier, ma'am, and I don't know the words of love."
"Je suis un vieux soldat, madame, et je ne connais pas les mots d'amour."
"Ich bin ein alter Soldat, gnädige Frau, und ich weiß nicht die Worte der Liebe."

__________________________________________________________________________________________________________________________________________________
(3.2GHz i5 Core Quad, 8GB RAM / 2 x nVidia GTX 550Ti SLI-bridged, 2GB VRAM)
(x86 Win XP Pro Russian Sp3/x86 Win Vista Ultimate Sp2/x64 Win 7 Ultimate Sp1/Wine in x64 elementaryOS Luna)
User avatar
Mike Lobanovsky
FBSL Administrator
FBSL Administrator
 
Posts: 1824
Joined: Tue Apr 19, 2005 8:22 am
Location: Republic of Belarus

Re: Fbsl.exe v3.5 Beta

Unread postby Mike Lobanovsky » Wed Mar 13, 2013 5:00 am

Here's yet another script which demonstrates the efficiency of Dynamic C layer. Please comment out the DynC block at the end of the script to see FBSL doing the job at approx. 10 FPS vs. approx. 1,450FPS for Dynamic C.

Plasma.png
Plasma.png (135.58 KiB) Viewed 2536 times


FBSL_35_Plasma.fbs:
Code: Select all
' ==============================================
' Based on Delphi 7 Code by Jan Horn w/ bugfixes
' ==============================================
' Author      : Jan Horn
' Email       : jhorn@global.co.za
' Website     : http://www.sulaco.co.za
'               http://home.global.co.za/~jhorn
' Date        : 2 October 2001
' Version     : 1.0
' ==============================================

#Option Strict

#Include <Include/Windows.inc>

#DllImports OpenGL32, Glu32

#Define GL_TEXTURE_2D &H0DE1
#Define GL_TEXTURE_ENV &H2300
#Define GL_TEXTURE_ENV_MODE &H2200
#Define GL_MODULATE &H2100
#Define GL_TEXTURE_MAG_FILTER &H2800
#Define GL_LINEAR &H2601
#Define GL_TEXTURE_MIN_FILTER &H2801
#Define GL_RGB &H1907
#Define GL_UNSIGNED_BYTE &H1401
#Define GL_COLOR_BUFFER_BIT &H4000
#Define GL_DEPTH_BUFFER_BIT &H0100
#Define GL_QUADS &H0007
#Define GL_SMOOTH &H1D01
#Define GL_DEPTH_TEST &H0B71
#Define GL_LESS &H0201
#Define GL_PERSPECTIVE_CORRECTION_HINT &H0C50
#Define GL_NICEST &H1102
#Define GL_PROJECTION &H1701
#Define GL_MODELVIEW &H1700

Type BYTE
   Default %b * 8
End Type

Type TPixel Align 1
   R As BYTE
   G As BYTE
   B As BYTE
End Type

Type PIXELFORMATDESCRIPTOR Align 1
   nSize As Integer
   nVersion As Integer
   dwFlags As Integer
   iPixelType As BYTE
   cColorBits As BYTE
   cRedBits As BYTE
   cRedShift As BYTE
   cGreenBits As BYTE
   cGreenShift As BYTE
   cBlueBits As BYTE
   cBlueShift As BYTE
   cAlphaBits As BYTE
   cAlphaShift As BYTE
   cAccumBits As BYTE
   cAccumRedBits As BYTE
   cAccumGreenBits As BYTE
   cAccumBlueBits As BYTE
   cAccumAlphaBits As BYTE
   cDepthBits As BYTE
   cStencilBits As BYTE
   cAuxBuffers As BYTE
   iLayerType As BYTE
   bReserved As BYTE
   dwLayerMask As Integer
   dwVisibleMask As Integer
   dwDamageMask As Integer
End Type

Dim h_DC As Integer ' Global device context
Dim h_RC As Integer ' OpenGL rendering context
Dim ElapsedTime As Integer ' Elapsed time between frames

' Textures
Dim Plasma As String
Dim PlasmaTex As Integer

' User vaiables
Dim sr[7] As Integer
Dim sc[7] As Integer
Dim sinHalfTable[511] As Integer, sinOneTable[511] As Integer
Dim sinTwoTable[511] As Integer, sinFourTable[511] As Integer

' Perform application initialization:
If Not glCreateWnd(800, 600, 32) Then ExitProgram(-1)

'{------------------------------------------------------------------}
'{  Determines the application’s response to the messages received  }
'{------------------------------------------------------------------}
Begin Events
   Static $ps * 64 ' fake PAINTSTRUCT
   Static %LastTime, %DemoStart = GetTickCount() ' Get Time when demo started

   Select Case CBMSG
      Case WM_COMMAND
         If CBWPARAM = 2 Then Destroy(ME) ' VK_ESCAPE pressed
      Case WM_SIZE ' Resize the window with the new width and height
         glResizeWnd(LoWord(CBLPARAM), HiWord(CBLPARAM))
         Return 0
      Case WM_ERASEBKGND
         Return 1
      Case WM_PAINT
         BeginPaint(ME, @ps)
         EndPaint(ME, @ps)
         
         LastTime = ElapsedTime
         ElapsedTime = GetTickCount() - DemoStart ' Calculate Elapsed Time
         ElapsedTime = (LastTime + ElapsedTime) \ 2 ' Average it out for smoother movement
         
         glDraw() ' Draw the scene
         SwapBuffers(h_DC) ' Display the scene
         
         InvalidateRect(ME, NULL, FALSE) ' Initiate next draw
         Return 0
      Case WM_DESTROY
         glKillWnd()
      Case Else
         Return DefWindowProc(CBHWND, CBMSG, CBWPARAM, CBLPARAM) ' Default result if nothing happens
   End Select
End Events

'{------------------------------------------------------------------}
'{  Function to make a texture from the pixel data                  }
'{------------------------------------------------------------------}
Function CreateTexture(%Width, %Height, $pData) As Integer
   Dim %Texture

   glGenTextures(1, @Texture)
   glBindTexture(GL_TEXTURE_2D, Texture)
   glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE) 'Texture blends with object background
   glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR) ' only first two can be used
   glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR) ' all of the above can be used
   glTexImage2D(GL_TEXTURE_2D, 0, 3, 64, 64, 0, GL_RGB, GL_UNSIGNED_BYTE, pData)
   
   Return Texture
End Function

'{------------------------------------------------------------------}
'{  Function to draw the actual scene                               }
'{------------------------------------------------------------------}
Sub glDraw()
   Static ThatTime

   glClear(GL_COLOR_BUFFER_BIT BOr GL_DEPTH_BUFFER_BIT) ' Clear The Screen And The Depth Buffer
   glLoadIdentity() ' Reset The View
   glTranslated(0.0, 0.0, -1.4)
   
   glRotated(ElapsedTime / 100, 0.0, 0.0, 1.0)
   If ElapsedTime - ThatTime > 24 Then
      UpdatePlasma()
      ThatTime = ElapsedTime
   End If
   
   glBindTexture(GL_TEXTURE_2D, PlasmaTex)
   glBegin(GL_QUADS)
      glTexCoord2d(1.0, 0.0): glVertex2d(-1.0, -1.0)
      glTexCoord2d(0.0, 0.0): glVertex2d(1.0, -1.0)
      glTexCoord2d(0.0, 1.0): glVertex2d(1.0, 1.0)
      glTexCoord2d(1.0, 1.0): glVertex2d(-1.0, 1.0)
   glEnd()
End Sub

'{------------------------------------------------------------------}
'{  Initialise OpenGL                                               }
'{------------------------------------------------------------------}
Sub glInit()
   Dim %I
   Dim !!Temp
   
   glClearColor(0, 0, 0, 0) ' Black Background
   glShadeModel(GL_SMOOTH) ' Enables Smooth Color Shading
   glClearDepth(1.0) ' Depth Buffer Setup
   glEnable(GL_DEPTH_TEST) ' Enable Depth Buffer
   glDepthFunc(GL_LESS) ' The Type Of Depth Test To Do
   
   glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST) 'Realy Nice perspective calculations
   
   glEnable(GL_TEXTURE_2D) ' Enable Texture Mapping
   
   ' Create a blank texture to start with
   Alloc(Plasma, 64 * 64 * 3)
   PlasmaTex = CreateTexture(64, 64, Plasma)
   
   For I = 0 To 511
      Temp = 4 * PI * I / 512
      sinHalfTable[I] = Sin(temp / 2) * 128 + 128
      sinOneTable[I] = Sin(temp) * 128 + 128
      sinTwoTable[I] = Sin(temp * 2) * 128 + 128
      sinFourTable[I] = Sin(temp * 4) * 128 + 128
   Next
   
   ' if sr and sc = 0 then its a greyscale image
   Randomize
   For I = 0 To 7
      sr[I] = RandInt(0, 255)
      sc[I] = sr[I]
   Next
End Sub

'{------------------------------------------------------------------}
'{  Handle window resize                                            }
'{------------------------------------------------------------------}
Sub glResizeWnd(%Width, %Height)
   If Height = 0 Then Height = 1 ' prevent divide by zero exception
   glViewport(0, 0, Width, Height) ' Set the viewport for the OpenGL window
   glMatrixMode(GL_PROJECTION) ' Change Matrix Mode to Projection
   glLoadIdentity() ' Reset View
   gluPerspective(45.0, Width / Height, 1.0, 100.0) ' Do the perspective calculations. Last value = max clipping depth
   
   glMatrixMode(GL_MODELVIEW) ' Return to the modelview matrix
   glLoadIdentity() ' Reset View
End Sub

'{---------------------------------------------------------------------}
'{  Properly destroys the window created at startup (no memory leaks)  }
'{---------------------------------------------------------------------}
Sub glKillWnd()
   ' Makes current rendering context not current, and releases the device
   ' context that is used by the rendering context.
   If Not wglMakeCurrent(h_DC, 0) Then
      MsgBox(ME, "Release of DC and RC failed!", "Error", MB_OK BOr MB_ICONERROR)
   End If
   
   ' Attempts to delete the rendering context
   If Not wglDeleteContext(h_RC) Then
      MsgBox(ME, "Release of rendering context failed!", "Error", MB_OK BOr MB_ICONERROR)
      h_RC = 0
   End If
   
   ' Attemps to release the device context
   If (h_DC = 1) And (ReleaseDC(ME, h_DC) <> 0) Then
      MsgBox(ME, "Release of device context failed!", "Error", MB_OK BOr MB_ICONERROR)
      h_DC = 0
   End If
End Sub

'{--------------------------------------------------------------------}
'{  Creates the window and attaches a OpenGL rendering context to it  }
'{--------------------------------------------------------------------}
Function glCreateWnd(%Width, %Height, %PixelDepth) As Boolean
   Dim PixelFormat As Integer ' Settings for the OpenGL rendering
   Dim pfd As PIXELFORMATDESCRIPTOR ' Settings for the OpenGL window
   
   ' Try to get a device context
   h_DC = GetDC(ME)
   If h_DC = 0 Then
      MsgBox(ME, "Unable to get a device context!", "Error", MB_OK BOr MB_ICONERROR)
      PostMessage(ME, WM_DESTROY, 0, 0)
      Return FALSE
   End If
   
   ' Settings for the OpenGL window
   With pfd
      .nSize = LenB(PIXELFORMATDESCRIPTOR) ' Size Of This Pixel Format Descriptor
      .nVersion = 1 ' The version of this data structure
      .dwFlags = PFD_DRAW_TO_WINDOW _ ' Buffer supports drawing to window
               BOr PFD_SUPPORT_OPENGL _ ' Buffer supports OpenGL drawing
               BOr PFD_DOUBLEBUFFER ' Supports double buffering
      .iPixelType = PFD_TYPE_RGBA ' RGBA color format
      .cColorBits = PixelDepth ' OpenGL color depth
      .cRedBits = 0 ' Number of red bitplanes
      .cRedShift = 0 ' Shift count for red bitplanes
      .cGreenBits = 0 ' Number of green bitplanes
      .cGreenShift = 0 ' Shift count for green bitplanes
      .cBlueBits = 0 ' Number of blue bitplanes
      .cBlueShift = 0 ' Shift count for blue bitplanes
      .cAlphaBits = 0 ' Not supported
      .cAlphaShift = 0 ' Not supported
      .cAccumBits = 0 ' No accumulation buffer
      .cAccumRedBits = 0 ' Number of red bits in a-buffer
      .cAccumGreenBits = 0 ' Number of green bits in a-buffer
      .cAccumBlueBits = 0 ' Number of blue bits in a-buffer
      .cAccumAlphaBits = 0 ' Number of alpha bits in a-buffer
      .cDepthBits = 16 ' Specifies the depth of the depth buffer
      .cStencilBits = 0 ' Turn off stencil buffer
      .cAuxBuffers = 0 ' Not supported
      .iLayerType = PFD_MAIN_PLANE ' Ignored
      .bReserved = 0 ' Number of overlay and underlay planes
      .dwLayerMask = 0 ' Ignored
      .dwVisibleMask = 0 ' Transparent color of underlay plane
      .dwDamageMask = 0 ' Ignored
   End With

   ' Attempts to find the pixel format supported by a device context that is the best match to a given pixel format specification.
   PixelFormat = ChoosePixelFormat(h_DC, @pfd)
   If PixelFormat = 0 Then
      MsgBox(ME, "Unable to find a suitable pixel format", "Error", MB_OK BOr MB_ICONERROR)
      PostMessage(ME, WM_DESTROY, 0, 0)
      Return FALSE
   End If
   
   ' Sets the specified device context's pixel format to the format specified by the PixelFormat.
   If Not SetPixelFormat(h_DC, PixelFormat, @pfd) Then
      MsgBox(ME, "Unable to set the pixel format", "Error", MB_OK BOr MB_ICONERROR)
      PostMessage(ME, WM_DESTROY, 0, 0)
      Return FALSE
   End If
   
   ' Create a OpenGL rendering context
   h_RC = wglCreateContext(h_DC)
   If h_RC = 0 Then
      MsgBox(ME, "Unable to create an OpenGL rendering context", "Error", MB_OK BOr MB_ICONERROR)
      PostMessage(ME, WM_DESTROY, 0, 0)
      Return FALSE
   End If
   
   ' Makes the specified OpenGL rendering context the calling thread's current rendering context
   If Not wglMakeCurrent(h_DC, h_RC) Then
      MsgBox(ME, "Unable to activate OpenGL rendering context", "Error", MB_OK BOr MB_ICONERROR)
      PostMessage(ME, WM_DESTROY, 0, 0)
      Return FALSE
   End If
   
   ' Ensure the OpenGL window is resized properly
   Resize(ME, 0, 0, Width, Height)
   FbslSetText(ME, "Simple OpenGL Plasma")

   glInit()
   glResizeWnd(800, 600)

   Center(ME)
   Show(ME)

   ' Enforce Redraw
   InvalidateRect(ME, NULL, FALSE)

   Return TRUE
End Function

Sub UpdatePlasma()
   Dim %X[3], %XCount[3], %Y[3], %YCount[3]
   Dim %I, %J, %C
   Dim Pixel As TPixel
   
   For C = 0 To 3
      Y[C] = sr[C + 4]
   Next
   
   For C = 0 To 3
      XCount[C] = sc[C]
      YCount[C] = sc[C + 4]
   Next
   
   For I = 0 To 63
      ' reset the x values & counters
      For C = 0 To 3
         X[C] = sr[C]
      Next
      
      For C = 0 To 3
         XCount[C] = (sc[C] + I * 2) Mod 512
         YCount[C] = (sc[C + 4] + I * 2) Mod 512
      Next
      
      For J = 0 To 63
         ' Set the Pixel Values
         @Pixel = @Plasma + 3 * (I * 64 + J)
         Pixel.R = ((sinHalfTable[X[0]] + sinOneTable[X[1]] + sinTwoTable[X[2]] + sinFourTable[X[3]]) + _
         (sinHalfTable[Y[0]] + sinOneTable[Y[1]] + sinTwoTable[Y[2]] + sinFourTable[Y[3]])) >> 3
         Pixel.G = ((sinHalfTable[X[2]] + sinOneTable[X[3]] + sinTwoTable[X[0]] + sinFourTable[X[1]]) + _
         (sinHalfTable[Y[2]] + sinOneTable[Y[3]] + sinTwoTable[Y[0]] + sinFourTable[Y[1]])) >> 3
         Pixel.B = ((sinHalfTable[X[3]] + sinOneTable[X[0]] + sinTwoTable[X[1]] + sinFourTable[X[2]]) + _
         (sinHalfTable[Y[1]] + sinOneTable[Y[2]] + sinTwoTable[Y[3]] + sinFourTable[Y[0]])) >> 3
         
         ' increment the x values
         For C = 0 To 3
            X[C] = (X[C] + sinTwoTable[XCount[C]] / 32 - 4 + 512) Mod 512
            XCount[C] = (XCount[C] + 2) Mod 512
         Next
      Next
   Next
      
   ' increment the y values
   For C = 0 To 3
      Y[C] = (Y[C] + sinOneTable[YCount[C]] / 32 - 4 + 512) Mod 512
   Next
   
   ' update statics
   For C = 0 To 7
      sr[C] = (sr[C] + sinTwoTable[sc[C]] / 32 - 4 + 512) Mod 512
      sc[C] = (sc[C] + 2) Mod 512
   Next

   glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 64, 64, GL_RGB, GL_UNSIGNED_BYTE, Plasma)
End Sub

/* Comment out this block to let FBSL do the job approx. 145 times slower than Dynamic C */
DynC UpdatePlasma(%sht = @sinHalfTable[0], %sot = @sinOneTable[0], %stt = @sinTwoTable[0], _
%sft = @sinFourTable[0], %sr = @sr[0], %sc = @sc[0], %p = @Plasma)

#include <windows.h>
#include <gl\gl.h>

#pragma comment(lib, "opengl32")

#pragma pack(push,1)
typedef struct {
   char R, G, B;
} TPixel;
#pragma pack(pop)

void STDCALL main(int* sht, int* sot, int* stt, int* sft, int* sr, int* sc, TPixel* p)
{
   int X[4], XCount[4], Y[4], YCount[4];
   int I, J, C;
   TPixel* Pixel;
   
   for (C=0; C<4; C++) Y[C] = sr[C + 4];
   
   for (C=0; C<4; C++) {
      XCount[C] = sc[C];
      YCount[C] = sc[C + 4];
   }
   
   for (I=0; I<64; I++) {
      // reset the x values & counters
      for (C=0; C<4; C++) X[C] = sr[C + 4];
      
      for (C=0; C<4; C++) {
         XCount[C] = (sc[C] + I * 2) % 512;
         YCount[C] = (sc[C + 4] + I * 2) % 512;
      }
      
      for (J=0; J<64; J++) {
         // Set the Pixel Values
         Pixel = p + (I * 64 + J); // pointer arithmetics
         Pixel->R = ((sht[X[0]] + sot[X[1]] + stt[X[2]] + sft[X[3]]) +
         (sht[Y[0]] + sot[Y[1]] + stt[Y[2]] + sft[Y[3]])) >> 3;
         Pixel->G = ((sht[X[2]] + sot[X[3]] + stt[X[0]] + sft[X[1]]) +
         (sht[Y[2]] + sot[Y[3]] + stt[Y[0]] + sft[Y[1]])) >> 3;
         Pixel->B = ((sht[X[3]] + sot[X[0]] + stt[X[1]] + sft[X[2]]) +
         (sht[Y[1]] + sot[Y[2]] + stt[Y[3]] + sft[Y[0]])) >> 3;
         
         // increment the x values
         for (C=0; C<4; C++) {
            X[C] = (X[C] + stt[XCount[C]] / 32 - 4 + 512) % 512;
            XCount[C] = (XCount[C] + 2) % 512;
         }
      }
   }
      
   // increment the y values
   for (C=0; C<4; C++) Y[C] = (Y[C] + sot[YCount[C]] / 32 - 4 + 512) % 512;
   
   // update statics
   for (C=0; C<8; C++) {
      sr[C] = (sr[C] + stt[sc[C]] / 32 - 4 + 512) % 512;
      sc[C] = (sc[C] + 2) % 512;
   }

   glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 64, 64, GL_RGB, GL_UNSIGNED_BYTE, p);
}
End DynC
Mike
"Я старый солдат, мадам, и не знаю слов любви."
"I am an old soldier, ma'am, and I don't know the words of love."
"Je suis un vieux soldat, madame, et je ne connais pas les mots d'amour."
"Ich bin ein alter Soldat, gnädige Frau, und ich weiß nicht die Worte der Liebe."

__________________________________________________________________________________________________________________________________________________
(3.2GHz i5 Core Quad, 8GB RAM / 2 x nVidia GTX 550Ti SLI-bridged, 2GB VRAM)
(x86 Win XP Pro Russian Sp3/x86 Win Vista Ultimate Sp2/x64 Win 7 Ultimate Sp1/Wine in x64 elementaryOS Luna)
User avatar
Mike Lobanovsky
FBSL Administrator
FBSL Administrator
 
Posts: 1824
Joined: Tue Apr 19, 2005 8:22 am
Location: Republic of Belarus

Fbsl.exe v3.5 Beta BUG FIXES

Unread postby Mike Lobanovsky » Sun Mar 17, 2013 1:32 am

Hello everybody,

Three bugs have been fixed in Fbsl.exe v3.5 Beta. Please load the attached archive and see readme for details.

[EDIT] The most recent version of Fbsl.exe v3.5 Beta distro can be downloaded from the topic starter message on page 1 of this thread.
Mike
"Я старый солдат, мадам, и не знаю слов любви."
"I am an old soldier, ma'am, and I don't know the words of love."
"Je suis un vieux soldat, madame, et je ne connais pas les mots d'amour."
"Ich bin ein alter Soldat, gnädige Frau, und ich weiß nicht die Worte der Liebe."

__________________________________________________________________________________________________________________________________________________
(3.2GHz i5 Core Quad, 8GB RAM / 2 x nVidia GTX 550Ti SLI-bridged, 2GB VRAM)
(x86 Win XP Pro Russian Sp3/x86 Win Vista Ultimate Sp2/x64 Win 7 Ultimate Sp1/Wine in x64 elementaryOS Luna)
User avatar
Mike Lobanovsky
FBSL Administrator
FBSL Administrator
 
Posts: 1824
Joined: Tue Apr 19, 2005 8:22 am
Location: Republic of Belarus

Re: Fbsl.exe v3.5 Beta

Unread postby Gerome » Sun Mar 17, 2013 1:39 am

Thanks for those mods Mike!
Hope you have added my little mod too :)
Yours,

(¯`·._.·[Gerome GUILLEMIN]·._.·´¯)
:: Full SETUP w. HELP 05th of December 2011 ::
http://www.fbsl.net/setup/FBSLv3.exe [full v3.4.10 installation pack]
http://www.fbsl.net/setup/FBSLv3bin.zip [minimal upgrade to v3.4.10]
Laissons les jolies femmes aux hommes sans imagination. / Let us leave pretty women to men without imagination.(M.Proust)
The success is a defeat for the one who does not want to dance any more! (H.F. Thiefaine)
User avatar
Gerome
FBSL Administrator
FBSL Administrator
 
Posts: 3149
Joined: Sat Mar 12, 2005 9:06 pm
Location: Paris -- France

Re: Fbsl.exe v3.5 Beta

Unread postby Mike Lobanovsky » Sun Mar 17, 2013 1:54 am

Gerome wrote:Hope you have added my little mod too :)


I did the very moment I got it.
Mike
"Я старый солдат, мадам, и не знаю слов любви."
"I am an old soldier, ma'am, and I don't know the words of love."
"Je suis un vieux soldat, madame, et je ne connais pas les mots d'amour."
"Ich bin ein alter Soldat, gnädige Frau, und ich weiß nicht die Worte der Liebe."

__________________________________________________________________________________________________________________________________________________
(3.2GHz i5 Core Quad, 8GB RAM / 2 x nVidia GTX 550Ti SLI-bridged, 2GB VRAM)
(x86 Win XP Pro Russian Sp3/x86 Win Vista Ultimate Sp2/x64 Win 7 Ultimate Sp1/Wine in x64 elementaryOS Luna)
User avatar
Mike Lobanovsky
FBSL Administrator
FBSL Administrator
 
Posts: 1824
Joined: Tue Apr 19, 2005 8:22 am
Location: Republic of Belarus

Re: Fbsl.exe v3.5 Beta

Unread postby Gerome » Sun Mar 17, 2013 2:00 am

Nice nice :)
Thanks alot Mike!
Yours,

(¯`·._.·[Gerome GUILLEMIN]·._.·´¯)
:: Full SETUP w. HELP 05th of December 2011 ::
http://www.fbsl.net/setup/FBSLv3.exe [full v3.4.10 installation pack]
http://www.fbsl.net/setup/FBSLv3bin.zip [minimal upgrade to v3.4.10]
Laissons les jolies femmes aux hommes sans imagination. / Let us leave pretty women to men without imagination.(M.Proust)
The success is a defeat for the one who does not want to dance any more! (H.F. Thiefaine)
User avatar
Gerome
FBSL Administrator
FBSL Administrator
 
Posts: 3149
Joined: Sat Mar 12, 2005 9:06 pm
Location: Paris -- France

Fbsl.exe v3.5 Beta BUG FIXES

Unread postby Mike Lobanovsky » Sat Mar 23, 2013 6:18 am

Hello everybody,

I know you dislike v3.5 because your old scripts, as well as your Eclecta, FMFD, 2exe.fbs and 2fbs.fbs, refuse to run in it.

Well, I can't do anything about your own scripts, I guess you'll have to fix them up yourselves. But I'd like to inform you that I've reworked FMFD, 2exe.fbs and 2fbs.fbs to run under FBSL v3.5 and do their job as expected. What concerns 2exe.fbs, it will compile your v3.5 scripts with FBSL and Dynamic Assembler code cleanly as before, but currently it will be able to compile the scripts with DynC code to completely standalone executables only if they don't use external C header files but rather have all the #defines, function protos, typedefs, structs and unions directly in their own code.

I'm also working to upgrade Eclecta for the v3.5 environment. It now has many bug fixes and new functionalities. It uses DynC blocks with integral #defines and declarations, and it compiles fine to a completely standalone executable:

Eclecta35.PNG
Eclecta35.PNG (65.32 KiB) Viewed 2519 times


To be able to use these scripts when they are published, you'll need the latest Fbsl.exe v3.5 Beta which is attached in the zip below. It has two more important bug fixes so please reload it and use it instead of your earlier binary.

Thank you,

[EDIT] The most recent version of Fbsl.exe v3.5 Beta distro can be downloaded from the topic starter message on page 1 of this thread.
Mike
"Я старый солдат, мадам, и не знаю слов любви."
"I am an old soldier, ma'am, and I don't know the words of love."
"Je suis un vieux soldat, madame, et je ne connais pas les mots d'amour."
"Ich bin ein alter Soldat, gnädige Frau, und ich weiß nicht die Worte der Liebe."

__________________________________________________________________________________________________________________________________________________
(3.2GHz i5 Core Quad, 8GB RAM / 2 x nVidia GTX 550Ti SLI-bridged, 2GB VRAM)
(x86 Win XP Pro Russian Sp3/x86 Win Vista Ultimate Sp2/x64 Win 7 Ultimate Sp1/Wine in x64 elementaryOS Luna)
User avatar
Mike Lobanovsky
FBSL Administrator
FBSL Administrator
 
Posts: 1824
Joined: Tue Apr 19, 2005 8:22 am
Location: Republic of Belarus

Re: Fbsl.exe v3.5 Beta

Unread postby Mike Lobanovsky » Fri Mar 29, 2013 10:32 pm

I thought it would be important for everybody to know that the new Eclecta version will address the issue of shadowing the user's variable and function names by names of defines imported from Include/Windows.inc or by names of functions dllimported from Kernel32.dll, User32.dll and Gdi32.dll on default, by highlighting them differently from FBSL's native keywords and function names in its code window:

HiliteShadows.PNG
HiliteShadows.PNG (113.69 KiB) Viewed 2467 times


So, if the user sees that his/her keyword or variable or function name is highlighted improperly, it will serve as an indication of that keyword/variable/function name being already reserved by other objects in the application, in which case the user is advised to alter the name of his/her variable or function or to precise the FBSL keyword or function name with the FBSL namespace prefix, e.g. "Fbsl.LoadLibrary("somename.dll")". The dot notation of the namespace prefixes is resolved at compile time and will not affect the application's execution speed.
Mike
"Я старый солдат, мадам, и не знаю слов любви."
"I am an old soldier, ma'am, and I don't know the words of love."
"Je suis un vieux soldat, madame, et je ne connais pas les mots d'amour."
"Ich bin ein alter Soldat, gnädige Frau, und ich weiß nicht die Worte der Liebe."

__________________________________________________________________________________________________________________________________________________
(3.2GHz i5 Core Quad, 8GB RAM / 2 x nVidia GTX 550Ti SLI-bridged, 2GB VRAM)
(x86 Win XP Pro Russian Sp3/x86 Win Vista Ultimate Sp2/x64 Win 7 Ultimate Sp1/Wine in x64 elementaryOS Luna)
User avatar
Mike Lobanovsky
FBSL Administrator
FBSL Administrator
 
Posts: 1824
Joined: Tue Apr 19, 2005 8:22 am
Location: Republic of Belarus

Re: Fbsl.exe v3.5 Beta

Unread postby Mike Lobanovsky » Sat Apr 06, 2013 9:01 pm

Hello,

I've spotted a bug in the current implementation of With/End With. It would not work with array elements.

But I nearly succeeded in fixing it although it cost me almost 2 extra kilobytes of Fbsl.exe size.

Now With/End With will support array elements with simple numeric literal (decimal and hexadecimal) and simple variable (including dot-named) indices. It won't however accept expressions as array indices and will throw an exception, e.g.:
Code: Select all
Type ABC
    %a
    %b
    %c
End Type

Dim array[0] As ABC, i As ABC, j = 0

i.c = 0

With array[0] ' <== OK
    .b = 1
....
With array[&H0] ' <== OK
    .b = 1
....
With array[0x0] ' <== OK
    .b = 1
....
With array[i.c] ' <== OK
    .b = 1
....
With array[j] ' <== OK
    .b = 1
....
With array[i.c + j] ' EXCEPTION
    .b = 1


Out-of-bounds exceptions will also be thrown for illegal index values, either literal or variable.
Mike
"Я старый солдат, мадам, и не знаю слов любви."
"I am an old soldier, ma'am, and I don't know the words of love."
"Je suis un vieux soldat, madame, et je ne connais pas les mots d'amour."
"Ich bin ein alter Soldat, gnädige Frau, und ich weiß nicht die Worte der Liebe."

__________________________________________________________________________________________________________________________________________________
(3.2GHz i5 Core Quad, 8GB RAM / 2 x nVidia GTX 550Ti SLI-bridged, 2GB VRAM)
(x86 Win XP Pro Russian Sp3/x86 Win Vista Ultimate Sp2/x64 Win 7 Ultimate Sp1/Wine in x64 elementaryOS Luna)
User avatar
Mike Lobanovsky
FBSL Administrator
FBSL Administrator
 
Posts: 1824
Joined: Tue Apr 19, 2005 8:22 am
Location: Republic of Belarus

Re: Fbsl.exe v3.5 Beta

Unread postby bugmagnet » Sun Apr 07, 2013 2:48 pm

Following on from my posting elsewhere about a "true" console binary, I've discovered that if I use setsubsys to change FBSL.EXE into a console app, I no longer need "Pause" at the end of my v3.5 scripts. This would probably work for v3.4 too, but I'm far too interested in using v3.5 to try it.

Kind regards,
Bugmagnet
User avatar
bugmagnet
FBSL geek
FBSL geek
 
Posts: 175
Joined: Sat Apr 06, 2013 5:58 am
Location: Fremantle WA, Australia

Re: Fbsl.exe v3.5 Beta

Unread postby Mike Lobanovsky » Sun Apr 07, 2013 8:04 pm

Please Read This Carefully

The pre-v3.5 FBSL executables can be compiled as true console apps too provided you add a corresponding InputBox() dialog to the old 2exe.fbs (the script is free to use and modify) before the call to Fbsl2Exe() for the user to specify the required value of Fbsl2Exe's second parameter. I just mentioned the old-skool Fbsl2Exe() was also able to do that PE header patching hack similar to your SetSubSys.exe utility.

The new implementation of Fbsl2Exe() in FBSL v3.5 does not have to resort to hacking because it creates an appropriate console or GUI PE header from scratch. Additionally, it does a lot of work to compensate for numerous PE glitches which the Linuxoid GCC v4.3.3 produces while compiling the FBSL sources into a Windows executable and a DLL. Fbsl_Tiny.exe v3.5 has been written by me in pure machine code almost from scratch. It now is only 3.5KB large together with its icon and manifest.

The PE headers of all the three v3.5 binaries are perfect from the standpoint of Windows program launcher and AV's, and so are the headers of all v3.5 executables which you obtain via a call to Fbsl2Exe(), whether console or GUI. Brute-force patching is not recommended because it renders the application's checksum in the PE header invalid, and while Windows would still allow you to launch such an application (as long as it is not a driver), many AV programs tend to regard such smaller glitches as virus manifestations and may throw false positives.

As far as Fbsl.exe is concerned, it is itself a true GUI application and we have never intended to restrict it to the Windows shell console alone. This means patching the original binaries' headers forcibly to the Win32 console subsystem yourself with whatever exe patcher you use is detrimental to FBSL. You do it exclusively at your own risk and the dev team cannot be held responsible for such activities should any Windows program launcher or AV problems arise for the end-users of your scripts and compiled executables.
Mike
"Я старый солдат, мадам, и не знаю слов любви."
"I am an old soldier, ma'am, and I don't know the words of love."
"Je suis un vieux soldat, madame, et je ne connais pas les mots d'amour."
"Ich bin ein alter Soldat, gnädige Frau, und ich weiß nicht die Worte der Liebe."

__________________________________________________________________________________________________________________________________________________
(3.2GHz i5 Core Quad, 8GB RAM / 2 x nVidia GTX 550Ti SLI-bridged, 2GB VRAM)
(x86 Win XP Pro Russian Sp3/x86 Win Vista Ultimate Sp2/x64 Win 7 Ultimate Sp1/Wine in x64 elementaryOS Luna)
User avatar
Mike Lobanovsky
FBSL Administrator
FBSL Administrator
 
Posts: 1824
Joined: Tue Apr 19, 2005 8:22 am
Location: Republic of Belarus

PreviousNext

Return to FBSL v3 News

Who is online

Users browsing this forum: No registered users and 1 guest

cron