IrrLicht without wrapper DLL

Everything else that doesn't fall into one of the other PB categories.
Fred
Administrator
Administrator
Posts: 18553
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

How did you solved it ?
traumatic
PureBasic Expert
PureBasic Expert
Posts: 1661
Joined: Sun Apr 27, 2003 4:41 pm
Location: Germany
Contact:

Post by traumatic »

Fred wrote:How did you solved it ?
Sorry, I didn't want anyone to get the impression that I've got a
working fix for it.

I just changed PUSH eax to MOV ecx, eax as El_Choni suggested
(to allow my brain to get the basic idea).

Next step would be what has already been discussed...

a) write macros
b) write a small parser that gets called before FASM which - as
you said - shouldn't be that hard. The problem will be to keep it
universally usable but as we all know, there's a solution to every
problem! ;)

My "It works!" was only meant to thank El_Choni for his help. :)
Good programmers don't comment their code. It was hard to write, should be hard to read.
traumatic
PureBasic Expert
PureBasic Expert
Posts: 1661
Joined: Sun Apr 27, 2003 4:41 pm
Location: Germany
Contact:

Post by traumatic »

I spent some time thinking about the macro-idea but couldn't get it to work.
I just don't see a way to execute the macro depending on the lines before or after.
In another attempt I tried to check if eax == p_device but also failed...

Well, I'm neither a ASM nor a FASM guru, what did I expect?! ;)

So I went the parser / pre-processor route and noticed I couldn't use
/COMMENTED respectively /REASM with /DEBUGGER... Is that true? :(
Good programmers don't comment their code. It was hard to write, should be hard to read.
Fred
Administrator
Administrator
Posts: 18553
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

Yes, /COMMENTED doesn't work with the debugger for now..
traumatic
PureBasic Expert
PureBasic Expert
Posts: 1661
Joined: Sun Apr 27, 2003 4:41 pm
Location: Germany
Contact:

Post by traumatic »

Hmm... the macro-way is the only real solution then...
Good programmers don't comment their code. It was hard to write, should be hard to read.
El_Choni
TailBite Expert
TailBite Expert
Posts: 1007
Joined: Fri Apr 25, 2003 6:09 pm
Location: Spain

Post by El_Choni »

EDIT: the macro works now:

Code: Select all

; Place at the beginning of the code
!macro CALL arg
! {
! clabel = $
! CALL arg
! plabel = clabel-3
! callsize = $-clabel
! load ops dword from plabel
! load opc byte from plabel+4
! If ops=$FF008B50 & (opc=$10 | opc=$50 | opc=$90)
!   If opc=$10
!     db $10
!   Else If (opc=$50 | opc=$90)
!     db $00
!     Repeat callsize
!       load op byte from clabel+callsize-%
!       store byte op at clabel+callsize-%+1
!     End Repeat
!   End If
!   store dword $008BC189 at plabel
! End If
! }
Last edited by El_Choni on Mon May 23, 2005 11:07 am, edited 4 times in total.
El_Choni
traumatic
PureBasic Expert
PureBasic Expert
Posts: 1661
Joined: Sun Apr 27, 2003 4:41 pm
Location: Germany
Contact:

Post by traumatic »

El_Choni wrote:Here, my non-working approach. Maybe it helps you to get somewhere [...]
Ufff... :shock:
Quoting Fred: "that looks frightening!!!"

...even spanish looks easier to me ;)

El_Choni, honestly, I'm deeply impressed!
I got the idea but... ...that's way beyond my understanding... :roll:


You don't think you should finish that by any chance? :P
Good programmers don't comment their code. It was hard to write, should be hard to read.
traumatic
PureBasic Expert
PureBasic Expert
Posts: 1661
Joined: Sun Apr 27, 2003 4:41 pm
Location: Germany
Contact:

Post by traumatic »

El_Choni wrote:EDIT: the macro works now:
You rock! Thank you very much!

See? I knew it was possible... ;)
Good programmers don't comment their code. It was hard to write, should be hard to read.
Fred
Administrator
Administrator
Posts: 18553
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

It's just amazing :)
dige
Addict
Addict
Posts: 1432
Joined: Wed Apr 30, 2003 8:15 am
Location: Germany
Contact:

Post by dige »

Hmm, nice Macro, but how it works? Could anyone post a working
example? Thanks.

cya dige
El_Choni
TailBite Expert
TailBite Expert
Posts: 1007
Joined: Fri Apr 25, 2003 6:09 pm
Location: Spain

Post by El_Choni »

If you put it at the beginning of your code, all method calls made in your code will use the object-->ecx calling convention (ThisCall convention), instead of object-->stack calling "convention" (used by PB, COM compatible, stdcall convention).
El_Choni
traumatic
PureBasic Expert
PureBasic Expert
Posts: 1661
Joined: Sun Apr 27, 2003 4:41 pm
Location: Germany
Contact:

Post by traumatic »

rufio72 wrote:1) I downloaded examples from irrlichtnx site ( http://www.irrlichtnx.mmdevel.de/), and it seem to be faster...
why are you focalized on irrlicht ???
I guess no one here is focused on IrrLicht.

This thread is neither about this engine in particular nor about working code
examples. All of this discussion is only meant to be some kind of "prove of
concept".
rufio72 wrote:2) I don't know assembler, how can I use your code width Irrlicht dll ???
All the work (converting the needed constants, interfaces, helperfunctions
etc.) has yet to be done. El_Choni's macro only enables you to call IrrLicht's
methods directly from PureBasic (This isn't possible without the macro).

No asm-knowledge is needed in order to use the macro. Try putting the
macro on top of the code El_Choni posted (the one with the interfaces)
and run it. You'll see what I mean. ;)
Good programmers don't comment their code. It was hard to write, should be hard to read.
User avatar
Inner
PureBasic Expert
PureBasic Expert
Posts: 715
Joined: Fri Apr 25, 2003 4:47 pm
Location: New Zealand

Post by Inner »

please note the above macro has been fixed again.
User avatar
idle
Always Here
Always Here
Posts: 6238
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: IrrLicht without wrapper DLL

Post by idle »

did anything come of this?
Windows 11, Manjaro, Raspberry Pi OS
Image
PMV
Enthusiast
Enthusiast
Posts: 727
Joined: Sat Feb 24, 2007 3:15 pm
Location: Germany

Re: IrrLicht without wrapper DLL

Post by PMV »

:shock:

do i get it right? the macro from El_Choni is doing nothing more then
converting all interface calls from std to the object-com convention?
So when i use that ... i could access any COM DLL with PB and interfaces?
Or is it just the irrlicht dll?

MFG PMV
Post Reply