Don't know how many programmers there are on this list, but heres my
question:
On Kip Knight's site ( http://hometown.aol.com/newtsprism ) there is a
list of magic pointers, one of which is PenPos(). This is an
undocumented function returns a frame with the current absolute x and y
position of the pen if it is down and nil otherwise. Currently I am
putting the magic pointer info in a slot then calling it from C using
NSCallGlobalFn. Then I can deconstruct the data it returns to get the
x and y positions. Here is what some of it looks like:
in slot named PenPos:
{
class: Ref(0x132),
funcPtr: 7018699,
numArgs: 0x0
}
calling from c:
Ref penposition = NSCallGlobalFn(SYM(PenPos));
What I want to do is call this from C without going into NewtonScript.
I don't really understand how the magic pointers work. Can anyone
provide hints or code on how to do this? Hopefully this will allow
Napalm to run much faster and maybe graffiti to actually work.
Even better would be deconstruct the PenPos function to see what it is
doing. I assume there are simply some hardware registers it is
reading. In my investigations I found that PenPos first reports the
pen at 0,0 for a short time after being nil before getting the actual
position. I hope to have a bowel doc about this stuff sometime....
Brian Parker
Sealie Computing
bunnyboy_at_sealiecomputing.com
NewtGlider - www.sealiecomputing.com/NewtGlider
MathFaster - www.sealiecomputing.com/MathFaster
Napalm - www.sealiecomputing.com/Napalm4.GIF
-- This is the NewtonTalk list - http://www.newtontalk.net/ for all inquiries List FAQ/Etiquette/Terms: http://www.newtontalk.net/faq.html Official Newton FAQ: http://www.chuma.org/newton/faq/
This archive was generated by hypermail 2.1.2 : Sun Jan 26 2003 - 04:02:44 EST