On 2/12/07, Ralph Versteegen <[EMAIL PROTECTED]> wrote:
> On 2/13/07, Keith Gable <[EMAIL PROTECTED]> wrote:
> > On 2/12/07, Ralph Versteegen <[EMAIL PROTECTED]> wrote:
> > > On 2/13/07, Keith Gable <[EMAIL PROTECTED]> wrote:
> > > > Hey guys,
> > > >
> > > > I'm in a class where we're learning C++ data structures. I've been 
> > > > thinking
> > > > of some useful dataset I can work on to help make sure I know what I'm
> > > > doing. Then it hit me -- you guys are still loading .RPG files from
> > > > FreeBasic! :) So, I'm wondering....
> > >
> > > Huh?
> >
> > It's my understanding that FreeBasic is like VB in that it's compiled
> > to "fake" code and is then executed by an interpreter. So, using a C
> > library to do this will be faster. If it's not, then it's really the
> > same either way... :)
> >
>
> Oh, no, it's compiled! It's slower than C, but only because the
> compiler is no where near as advanced at optimisation as compilers
> like GCC - something which will hopefully change in the future.

Yes, especially when it starts to use GCC as the backend :)

> Sure, unlumping speed could be improved, especially by not unlumping
> at all (instead keep offsets to each lump) - which has been suggested
> and was rejected at the time because of memory constraints - we were
> still using QB.

This coming from someone who limited the script buffer to 256kb? What
you're talking about is loading the entire RPG into memory. If not,
then you're not gaining anything by reading directly from the RPG
except disk space, and losing the ability to muck with the lumps on
the fly.

> > > > 1) How useful would a native code lump/unlump library be to OHRRPGCE?
> > > > Preferably, I don't want to mess with underlying implementation of stuff
> > > > right now (so -- basically, just extract lumps into memory and such). 
> > > > So,
> > > > you could call it liblump.so/lump.dll or something like that. Later, if 
> > > > it's
> > > > useful, I could try for a librpgfile.so/rpgfile.dll that does all of 
> > > > that
> > > > underlying parsing.
> > > >
> > >
> > > What do you mean by native code?
> >
> > Again, I understand that FreeBasic is interpreted. If not, nevermind :)

No, not at all. It's very much compiled.

> > > Well, that sort of library would be useful to programs which access
> > > RPG files. I tried to make a lump.dll for Fyre for VB, but I don't
> > > think he got it working - VB seems to require special activex dlls or
> > > something.
> >
> > DLLs work fine. You have to use Declare Function. Something like this:
> >
> > In C:
> > int function_name(int &var1, int var2);
> >
> > In VB:
> > Declare Function function_name Lib "dllname.dll" (ByRef var1 As
> > Integer, ByVal var2 As Integer) As Integer
> >
> > If you actually want to associate the DLL with the project, it has to
> > be an ActiveX DLL. It's easier to do it using Declare Function. Or,
> > option #2 is to write a .ocx (ActiveX Control) in VB that executes
> > stuff in the DLL and then have VB users use the VB OCX. Slower, but
> > hey, it's VB6. :)
>
> Maybe. But I don't have a copy of VB.NET to try it out with, I only
> tested my dll with FB.

VB.NET != Visual Basic. VB6 uses ActiveX files, but VB.NET uses .NET
assemblies. Wholly different concepts, implementations, and uses.

> > > Have a look at OHR++, it includes unlumping to memory and a (nearly
> > > finished?) RPG file loader.
> >
> > Ahh.... If there's already a project, nevermind! :)
> >
> > >
> > > > 2) Does FreeBasic support C++'s ABI, or does it only support C?

As I've said before, FreeBasic is C with a different syntax.

> > > Only C. See Mike's wrapper for the audiere library.

Written under duress, and with difficulty.

> > Ouch. Nobody supports the C++ ABI except those coding in C++ -_-.

Hmm, wonder why? That said, FB is actively working towards supporting
C++'s name-mangling and whatnot, for binary compatability with
existing APIs (What is an ABI? I'm not a C++ coder, so I may be
missing something)

-- 
Mike Caron
Final Fantasy Q
http://finalfantasyq.com
_______________________________________________
ohrrpgce mailing list
[email protected]
http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org

Reply via email to