It is currently Wed Jan 20, 2021 5:03 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: How/where to find EXTRN variables?
PostPosted: Sun Oct 20, 2013 12:41 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sun Feb 12, 2006 10:06 pm
Posts: 638
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:
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

_________________
there is no sig, only zuul (and the following disclaimer)

WARNING: may be talking out of his hat


Top
 Profile  
Reply with quote  
 Post subject: Re: How/where to find EXTRN variables?
PostPosted: Sun Oct 20, 2013 6:59 pm 
Offline
Addict
Addict
User avatar

Joined: Fri Jan 21, 2011 8:25 am
Posts: 1021
Location: 'stralia!
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. :)

_________________
Image
Blog: Why Does It Suck? (http://whydoesitsuck.com/)
"You can disagree with me as much as you want, but during this talk, by definition, anybody who disagrees is stupid and ugly."
- Linus Torvalds


Top
 Profile  
Reply with quote  
 Post subject: Re: How/where to find EXTRN variables?
PostPosted: Sun Oct 20, 2013 8:10 pm 
Offline
Addict
Addict
User avatar

Joined: Wed Aug 31, 2005 11:09 pm
Posts: 3698
Location: Italy
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.

_________________
[ My little PureBasic review ]


Top
 Profile  
Reply with quote  
 Post subject: Re: How/where to find EXTRN variables?
PostPosted: Sun Oct 20, 2013 8:19 pm 
Offline
Always Here
Always Here
User avatar

Joined: Thu Jun 24, 2004 2:44 pm
Posts: 5756
Location: Berlin - Germany
http://www.realsource.de/downloads/doc_ ... or-pb-libs :wink:
PBLIBTool should show all infos.

_________________
PureBasic 5.71 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 19.3 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image


Top
 Profile  
Reply with quote  
 Post subject: Re: How/where to find EXTRN variables?
PostPosted: Sun Oct 20, 2013 11:23 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sun Feb 12, 2006 10:06 pm
Posts: 638
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

_________________
there is no sig, only zuul (and the following disclaimer)

WARNING: may be talking out of his hat


Top
 Profile  
Reply with quote  
 Post subject: Re: How/where to find EXTRN variables?
PostPosted: Mon Oct 21, 2013 10:53 am 
Offline
Addict
Addict
User avatar

Joined: Wed Aug 31, 2005 11:09 pm
Posts: 3698
Location: Italy
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:
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()

_________________
[ My little PureBasic review ]


Top
 Profile  
Reply with quote  
 Post subject: Re: How/where to find EXTRN variables?
PostPosted: Tue Oct 22, 2013 11:35 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sun Feb 12, 2006 10:06 pm
Posts: 638
ts-soft wrote:
http://www.realsource.de/downloads/doc_details/20-pb-tools-for-pb-libs :wink:
PBLIBTool should show all infos.


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.

_________________
there is no sig, only zuul (and the following disclaimer)

WARNING: may be talking out of his hat


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye