Search the web
Sign In
New User? Sign Up
amithlondev · Amithlon-Dev
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Hear how Yahoo! Groups has changed the lives of others. Take me there.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Amithlon native software & MUI ?   Message List  
Reply | Forward Message #294 of 313 |
Re: Amithlon native software & MUI ?

Miłosz Staszewski wrote:

> Well I think this is a dispatcher. I've never written anything for MUI and
> have no experience with it.
> I get this error message:
>
> YAM.c:425: syntax error before `void'
> YAM.c:590: syntax error before `void'
>
> and begining with the 425th line we can see this fragment of code:
>
> ==========
>
> HOOKPROTONHNONP(AY_GoPageFunc, void)
> {
> GotoURL("http://www.yam.ch/");
> }
>
> ==========
>
> HOOKPROTONHNONP is defined in the SDI_Hook.h which I enclose.
> As you can see it's full of m68k registers. Isn't it then architecture
> related ?
>
> Thanks in advance for any help and best regards,

OK. I don't understand why people keep making the Hooks so complicated.
:-) I can't imagine YAM being that performance sensitive ...

Anyway. You could define your own macros in the spirit of the existing,
but it will required inline assembly. Here is the source code of
HookEntry which could be helpful for figuring out what registers to use:

__asm("
.text
.balign 4
.type _HookEntry,@function
_HookEntry:
movl %ebp,%eax /* A1 */
bswap %eax
push %eax

movl %esi,%eax /* A2 */
bswap %eax
push %eax

movl %ebx,%eax /* A0 */
bswap %eax
push %eax

mov 12(%ebx),%eax
bswap %eax
call *%eax
add $12,%esp
ret

.L_HookEntry:
.size _HookEntry,.L_HookEntry-_HookEntry

.globl HookEntry
.type HookEntry,@function
HookEntry = _HookEntry+1
");

However, I would suggest you to change the code to use Hookentry
instead. Here is an example. The following code works EVERYWHERE, be it
AmigaOS, MorphOS, Amithlon, AmigaOS 4.x or AROS ...

#include <clib/alib_protos.h>

ULONG AY_GoPageFunc(struct Hook *hookPtr, Object *obj, APTR message)
{
GotoURL("http://www.yam.ch/");
}

struct Hook hookname = {
{NULL, NULL},
HookEntry, AY_GoPageFunc, NULL
};

--
---- Martin Blom --------------------------- martin@... ----
Eccl 1:18 http://martin.blom.org/



Sat Mar 13, 2004 3:41 pm

leviticus_mb
Offline Offline
Send Email Send Email

Forward
Message #294 of 313 |
Expand Messages Author Sort by Date

Hi all, I would like to ask if it is possible to recompile for Amithlon things that were written with MUI in mind and they pass some args through emulated 68k ...
Miosz Staszewski
sofcik@...
Send Email
Mar 12, 2004
9:38 pm

... Yes, of course. I assume you're talking about the dispatcher? Just use HookEntry and there is no need to worry about registers. If that's not what you...
Martin Blom
leviticus_mb
Offline Send Email
Mar 13, 2004
11:45 am

Hello Martin, ... Well I think this is a dispatcher. I've never written anything for MUI and have no experience with it. I get this error message: YAM.c:425:...
Miosz Staszewski
sofcik@...
Send Email
Mar 13, 2004
2:06 pm

... OK. I don't understand why people keep making the Hooks so complicated. ... Anyway. You could define your own macros in the spirit of the existing, but it...
Martin Blom
leviticus_mb
Offline Send Email
Mar 13, 2004
3:42 pm

... I won't bet on this, this is an amiga.lib function with the purpose to serve as 68k->C interface... Regards - Rudolph...
rudolph.riedel@...
rudolph_riedel
Offline Send Email
Mar 13, 2004
5:55 pm

... It's used in AHI, for example, and there is no implementation in the sources I have, at least. It was my understanding that it was added to the AOS4...
Martin Blom
leviticus_mb
Offline Send Email
Mar 13, 2004
9:43 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help