Page 1 of 1
How/where to find EXTRN variables?
Posted: Sun Oct 20, 2013 12:41 pm
by citystate
Hi guys,
I've been trying some of Freak's old, old code to determine the current DrawingMode in a Start/Stop drawing block, but I can't figure out where to find the EXTRN variables; so get back a fatal POLINK error: unresolved external(s). This is the code I'm using:
Code: Select all
Procedure GetDrawingMode()
!EXTRN _PB_2DDrawing_CurrentMode
!MOV EAX, [_PB_2DDrawing_CurrentMode]
ProcedureReturn
EndProcedure
I can only guess that the internals have changed significantly since 2004 (see
other thread )
any help would be appreciated
thanks
Re: How/where to find EXTRN variables?
Posted: Sun Oct 20, 2013 6:59 pm
by Shield
There is no documentation on them because it is generally a very bad idea
to rely on them in the first place.
You might be able to find them when you analyze the libraries.
For this example, it might be worth it to wait for an answer from freak.

Re: How/where to find EXTRN variables?
Posted: Sun Oct 20, 2013 8:10 pm
by luis
Don't you set by YOURSELF in YOUR code the drawing mode ?
If the answer is yes, you can simply save it and query it when needed later.
You can use a couple of macros to override the PB commands and a global var for example, this way work with code made by other people too, as long it is in source format.
Re: How/where to find EXTRN variables?
Posted: Sun Oct 20, 2013 8:19 pm
by ts-soft
Re: How/where to find EXTRN variables?
Posted: Sun Oct 20, 2013 11:23 pm
by citystate
luis wrote:Don't you set by YOURSELF in YOUR code the drawing mode ?
If the answer is yes, you can simply save it and query it when needed later.
You can use a couple of macros to override the PB commands and a global var for example, this way work with code made by other people too, as long it is in source format.
usually, yes - I'm looking to create some additions in the drawing library, it would be useful to know what the current drawing mode is, to change the fill property of custom shapes (for example)
yes, I could just create a macro, but the idea is to include these in a library - that won't work (afaik)
Shield wrote:You might be able to find them when you analyze the libraries.
For this example, it might be worth it to wait for an answer from freak.
I'm somewhat new to ASM, and I'm not 100% sure how to analyse the libraries (I'll have to check out ts-soft's link) - considering this is just a case of not knowing the correct EXTRN variable, I'd tend to agree with you; waiting for freak seems like the best option - fortunately I'm not in any hurry
in any case, thanks for your input guys
Re: How/where to find EXTRN variables?
Posted: Mon Oct 21, 2013 10:53 am
by luis
citystate wrote:
yes, I could just create a macro, but the idea is to include these in a library - that won't work (afaik)
If you mean a "binary" library (tailbite ?) yes, it will not work. If you just mean something included in source form, written by you or someone else, it should.
Code: Select all
Define CurrDrawingMode = #PB_2DDrawing_Default
Procedure MyDrawingMode (mode)
Shared CurrDrawingMode
DrawingMode(mode)
CurrDrawingMode = mode
EndProcedure
Macro DrawingMode (mode)
MyDrawingMode (mode)
EndMacro
Procedure.i GetDrawingMode()
Shared CurrDrawingMode
ProcedureReturn CurrDrawingMode
EndProcedure
CreateImage(1, 320, 200, 32)
StartDrawing(ImageOutput(1))
Debug #PB_2DDrawing_Default
Debug GetDrawingMode()
DrawingMode(#PB_2DDrawing_AllChannels)
Debug #PB_2DDrawing_AllChannels
Debug GetDrawingMode()
DrawingMode(#PB_2DDrawing_AlphaBlend)
Debug #PB_2DDrawing_AlphaBlend
Debug GetDrawingMode()
StopDrawing()
Re: How/where to find EXTRN variables?
Posted: Tue Oct 22, 2013 11:35 pm
by citystate
thanks ts-soft, this brought me closest to solving the problem - but it seems like the symbol no longer exists (and nothing appears to have replaced it)... unless an asm guru steps up with a magic fix, I'll either simulate it with parameters, or use macros in a pbi - really wanted a self contained lib, though - oh well.