Author Topic: BassBox Soundscape translation for FreeBasic  (Read 15778 times)

0 Members and 1 Guest are viewing this topic.

Offline Charles Pegge

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 674
  • User-Rate: +27/-1
    • Charles Pegge
BassBox Soundscape translation for FreeBasic
« on: February 06, 2008, 01:57:45 AM »
This is an unexpurgated version with battle scars left in. I will produce a gift-wrapped version shortly.

It should appear identical to the previous PB version of SoundscapGLSL.

The ZIP file below contains source code only. (Too many square brackets to display here!). There are some notes at the beginning including details of two modifications to BassBox itself.

« Last Edit: February 06, 2008, 02:11:24 AM by Charles Pegge »

Offline Patrice Terrier

  • ROMs
  • Hero Member
  • *****
  • Posts: 934
  • User-Rate: +62/-1
    • www.zapsolution.com
Re: BassBox Soundscape translation for FreeBasic
« Reply #1 on: February 06, 2008, 02:17:42 PM »
--Charles

Just out of curriosity, do you know what is the meaning/purpose of the decoration added by FreeBasic when dealing with DLL?

...
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Offline Charles Pegge

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 674
  • User-Rate: +27/-1
    • Charles Pegge
Re: BassBox Soundscape translation for FreeBasic
« Reply #2 on: February 06, 2008, 03:08:44 PM »
This decoration is used by FreeBasic in STDcalls on the Windows platform to tell the compiler how many bytes of parameters are being passed to a function. I understand it is a Microsoft invention and helps to distinguish overloaded functions. ( same name, different parameters). Unfortunately there are many different schemes about:

Article on Name Mangling

http://en.wikipedia.org/wiki/Name_mangling

PE / DLL viewer (Platform independent Online Tool)

http://www.ucware.com/apev/index.htm


Offline Patrice Terrier

  • ROMs
  • Hero Member
  • *****
  • Posts: 934
  • User-Rate: +62/-1
    • www.zapsolution.com
Re: BassBox Soundscape translation for FreeBasic
« Reply #3 on: February 06, 2008, 05:22:31 PM »
--Charles

Thank you for the provided links.

Now about FreeBasic, i have never seen any descent or commercial application written with it.
Have you ever seen one yourself?

...
« Last Edit: February 06, 2008, 05:24:39 PM by Patrice Terrier »
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Offline Charles Pegge

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 674
  • User-Rate: +27/-1
    • Charles Pegge
Re: BassBox Soundscape translation for FreeBasic
« Reply #4 on: February 06, 2008, 07:53:29 PM »

That is a question I have not really asked myself before in appraising FreeBasic. It has not reached version 1 yet - so it definitely considers itself to be a youngster. There are some 2700 members registered on their Forum and the postings go back to around June 2005. But it has some solid technology behind it, and the  evolution of the language from Qbasic is very impressive.

I've written about 7000 lines of code with it so far, and find it codes very nicely with no major problems, but with new features coming out so rapidly it is hard to keep up.

Quote
It makes use of the GNU binutils programming tools as backends and can produce console and graphical/GUI executables, besides dynamic and static libraries. FreeBASIC fully supports the use of C libraries and partially C++ library support. This allows the programmer to use and also create libraries for C and many other languages.

http://en.wikipedia.org/wiki/FreeBASIC

Offline Charles Pegge

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 674
  • User-Rate: +27/-1
    • Charles Pegge
Re: BassBox Soundscape translation for FB: Patrice
« Reply #5 on: February 07, 2008, 10:24:35 PM »
Patrice, Good News!

With some help from the FreeBasic Forums We do not have to worry about @4 decorations any more.

In FB to suppress the decorations the solution is to enclose the whole BBProc in an Extern block like this:

Code: [Select]
Extern
Extern "Windows-MS"
'// The main exported plugin's function would be bbProc, like this:
FUNCTION BBProc (byref  BBP AS BBPLUGIN) AS integer export
.....
End Function
End Extern

Offline Patrice Terrier

  • ROMs
  • Hero Member
  • *****
  • Posts: 934
  • User-Rate: +62/-1
    • www.zapsolution.com
Re: BassBox Soundscape translation for FreeBasic
« Reply #6 on: February 08, 2008, 10:57:06 AM »
--Charles

Fine thank you.

Now, the problem is: would you find someone (except you) to write new bassBox plugins with FB  ;)

If you think yes, then go ahead posting on FB's forum and let's see  :o

Cordialy

...

Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Offline Charles Pegge

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 674
  • User-Rate: +27/-1
    • Charles Pegge
Re: BassBox Soundscape translation for FreeBasic
« Reply #7 on: February 08, 2008, 11:29:55 AM »
I am warming to the challenge Patrice. The first thing is to get acquainted with the Freebasic Forum and its groups. The obvious choice is GameDev but anyone into computer graphics might take an interest  But the technically minded might want to dismantle BassBox and use the parts for their own projects :). There is a wealth of technology, you have put together in this project.

Would you be interested in doing C++ Plugins? That might attract more interest in Code Project.

Offline Patrice Terrier

  • ROMs
  • Hero Member
  • *****
  • Posts: 934
  • User-Rate: +62/-1
    • www.zapsolution.com
Re: BassBox Soundscape translation for FreeBasic
« Reply #8 on: February 08, 2008, 03:15:17 PM »
--Charles

When i wrote BassBox i had several ideas in mind:

  • Express my grateful to Jose's work, with something concrete.
  • Demonstrate the supremacy of SDK over anything else.
  • Produce something that would cover the complete process of GUI creation from A-Z.
  • Use this project to create a synergy with other programmers.
  • Show that advanced multimedia programming can be done in full procedural mode.
  • Mixing several Win32 languages altogether.
  • Create a simplified plugin concept easy to understand for anyone familiar with the WinProc style message.
  • Choose a topic that could attract the largest audience with something universel (a media player).
  • Something that could combine artwork and programming skill altogether.
  • Explore some of the new VISTA API.
  • Attract new members to this community, to make it a top notch programming place.

All that being said, i have developed BassBox with the same rigour as i would have done for a paid job, spending three full monthes work on it.

Quote
But the technically minded might want to dismantle BassBox and use the parts for their own projects
Now that the project has grown up to reach maturity, i am waiting to see if it would arouse new vocations, or just being used for (see your quote)  :)

...
« Last Edit: April 13, 2009, 03:40:54 PM by Patrice Terrier »
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Offline Charles Pegge

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 674
  • User-Rate: +27/-1
    • Charles Pegge
Re: BassBox Soundscape translation for FreeBasic
« Reply #9 on: February 08, 2008, 03:44:08 PM »

Updated to remove FreeImage dependency

Here is the cleaned up source code and DLL compiled with FreeBasic 0.18.3. The shader folder is also included, but no changes have been made apart from turning a 6 into a 6.0 on the final statement in the fragment shader. This is to placate the irritable GLSL Validator.

It should appear immediately to the right of the PB compiled version in the line of Plugins, looking and performing the same. The code is about 7k larger than the PB version at around 50K.
 

PS: Thank you Patrice. I hope this will help to propagate the project and achieve some of those objectives.
« Last Edit: February 08, 2008, 07:16:06 PM by Charles Pegge »

Offline Patrice Terrier

  • ROMs
  • Hero Member
  • *****
  • Posts: 934
  • User-Rate: +62/-1
    • www.zapsolution.com
Re: BassBox Soundscape translation for FreeBasic
« Reply #10 on: February 08, 2008, 06:05:02 PM »
--Charles

The SoundscapeGLSLf.dll requires the freeimage.dll that is not provided with BassBox, thus causing havoc on system without it.

Better to stay with GDIPLUS that is a standard DLL on both XP and VISTA.

...


Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Offline Charles Pegge

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 674
  • User-Rate: +27/-1
    • Charles Pegge
Re: BassBox Soundscape translation for FreeBasic
« Reply #11 on: February 08, 2008, 07:21:41 PM »
Yes sorry about that. If you would  like to download it again, I have removed the FreeImage dependency. So it uses only GDIplus.

The source code contains functions for both alternatives.



Offline Patrice Terrier

  • ROMs
  • Hero Member
  • *****
  • Posts: 934
  • User-Rate: +62/-1
    • www.zapsolution.com
Re: BassBox Soundscape translation for FreeBasic
« Reply #12 on: February 08, 2008, 07:46:20 PM »
--Charles

Feedback:
the FB plugin version works fine on VISTA.

Perhaps the rookies (and also the old dogs) will be intimidated to see it coded in ASM  ;D

...
« Last Edit: February 08, 2008, 08:57:42 PM by Patrice Terrier »
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Offline Charles Pegge

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 674
  • User-Rate: +27/-1
    • Charles Pegge
Re: BassBox Soundscape translation for FreeBasic
« Reply #13 on: February 08, 2008, 11:01:46 PM »

Well it is quite feasible to do nearly all of it in Inline assembler. It does get rather lengthy though - about 4000 lines on this plugin. FreeBasic emits assembler during compilation to the 'GAS' assembler to generate executable code. - so it's assembler facilities are a bit more developed than PB's. For instance it is possible  to call external (dll) functions directly, as well as internal functions and labels.

I wonder why it's called GAS and not GASM  ;D

Offline Petr Schreiber

  • Full Member
  • ***
  • Posts: 183
  • User-Rate: +14/-4
Re: BassBox Soundscape translation for FreeBasic
« Reply #14 on: February 08, 2008, 11:59:48 PM »
 ;D

Charles,

how can you see the assembly output from FreeBASIC?
I find FreeBASIC interesting, although for now PB is more than enough for me :)


Thanks,
Petr
AMD Sempron 3400+ | 1GB RAM @ 533MHz | GeForce 6200 / GeForce 9500GT | 32bit Windows XP SP3

psch.thinbasic.com