Page 2 of 3
Posted: Mon May 16, 2005 2:17 pm
by Fred
How did you solved it ?
Posted: Mon May 16, 2005 2:57 pm
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.

Posted: Mon May 16, 2005 7:01 pm
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?

Posted: Tue May 17, 2005 2:04 am
by Fred
Yes, /COMMENTED doesn't work with the debugger for now..
Posted: Tue May 17, 2005 7:56 am
by traumatic
Hmm... the macro-way is the only real solution then...
Posted: Tue May 17, 2005 10:03 am
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
! }
Posted: Tue May 17, 2005 12:25 pm
by traumatic
El_Choni wrote:Here, my non-working approach. Maybe it helps you to get somewhere [...]
Ufff...
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?

Posted: Tue May 17, 2005 7:15 pm
by traumatic
El_Choni wrote:EDIT: the macro works now:
You rock! Thank you very much!
See? I knew it was possible...

Posted: Tue May 17, 2005 7:19 pm
by Fred
It's just amazing

Posted: Wed May 18, 2005 7:48 am
by dige
Hmm, nice Macro, but how it works? Could anyone post a working
example? Thanks.
cya dige
Posted: Wed May 18, 2005 7:50 am
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).
Posted: Wed May 18, 2005 10:35 pm
by traumatic
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.

Posted: Mon May 23, 2005 11:56 pm
by Inner
please note the above macro has been fixed again.
Re: IrrLicht without wrapper DLL
Posted: Sun Oct 09, 2011 11:15 pm
by idle
did anything come of this?
Re: IrrLicht without wrapper DLL
Posted: Sun Oct 09, 2011 11:36 pm
by PMV
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