[Files] PNG icons with WB3.5 & 3.9 | ANN.lu |
Posted on 20-Oct-2003 15:00 GMT by Amon_Re | 34 comments View flat View list |
Elena Novaretti has produced a superb PNG icon patch for OS 3.5/3.9 which lets you use PNG icons, like those in Morph OS.
Download PowerIcons.
(Info found on aw.net)
|
|
List of all comments to this article |
PNG icons with WB3.5 & 3.9 : Comment 26 of 34 | ANN.lu |
Posted by Georg Steger on 21-Oct-2003 18:32 GMT | In reply to Comment 25 (Kjetil): Well, compilers like gcc "implement" library calls through
inline assembly anyway:
#define PutMsg(port, message) \
LP2NR(0x16e, PutMsg, struct MsgPort *, port, a0, struct Message *, message, a1, \
, EXEC_BASE_NAME)
#define LP2NR(offs, name, t1, v1, r1, t2, v2, r2, bt, bn) \
({ \
t1 _##name##_v1 = (v1); \
t2 _##name##_v2 = (v2); \
{ \
register struct Library *const _##name##_bn __asm("a6") = (struct Library*)(bn); \
register t1 _n1 __asm(#r1) = _##name##_v1; \
register t2 _n2 __asm(#r2) = _##name##_v2; \
__asm volatile ("jsr a6@(-"#offs":W)" \
: /* no output */ \
: "r" (_##name##_bn), "rf"(_n1), "rf"(_n2) \
: "d0", "d1", "a0", "a1", "fp0", "fp1", "cc", "memory"); \
} \
})
But you can actually do that even without assembly. Basically
you just need to type cast the function address pointer in the
LVO to a "pointer to a function with register params xyz ..."
and call it. AROS does that. It looks kinda complicated when
looking at all the macros, etc., but it's basically like this:
struct LVO
{
UWORD jmp_opcode;
ULONG func_addr;
};
#define PutMsg(port,message) \
(\
(void (*)(register struct MsgPort *_port asm("a0"), register struct Message *_message asm("a1"))) \
( ( ((struct LVO *)ExecBase) [-61]).func_addr ) \
(port,message) \
) |
|
List of all comments to this article (continued) |
|
- User Menu
-
- About ANN archives
- The ANN archives is powered by #AmigaZeux. It was updated daily (news last: 22-Oct-2004; comments last: 18-May-2005).
ANN.lu was created, previously owned and maintained by Christian Kemp, www.ckemp.com.
- Contribute
- Not possible at this time!
- Search ANN archives
- Advanced search
- Hosting
- ANN.lu was hosted by Dreamhost. Sign up through this link, mention "ckemp" as referrer and he will get a 10% commission on any account you purchase.
Please show your appreciation for any past, present and future work on ANN.lu by making a contribution via PayPal.
|