2 ### Class GateMOS: Create a MorphOS gatestub file #############################
11 my $class = ref($proto) || $proto;
12 my $self = $class->SUPER::new
( @_ );
13 bless ($self, $class);
20 $self->SUPER::header
(@_);
22 print "#include <emul/emulregs.h>\n";
29 my $prototype = $params{'prototype'};
30 my $sfd = $self->{SFD
};
32 print "$prototype->{return}\n";
33 print "$gateprefix$prototype->{funcname}(void)";
47 if (!$self->{PROTO
}) {
49 my $prototype = $params{'prototype'};
50 my $argtype = $params{'argtype'};
51 my $argname = $params{'argname'};
52 my $argreg = $params{'argreg'};
53 my $argnum = $params{'argnum'};
54 my $sfd = $self->{SFD
};
56 print " $prototype->{___args}[$argnum] = ($argtype) REG_" .
64 if (!$self->{PROTO
}) {
66 my $prototype = $params{'prototype'};
67 my $sfd = $self->{SFD
};
69 if ($libarg ne 'none' && !$prototype->{nb
}) {
70 print " $sfd->{basetype} _base = ($sfd->{basetype}) ".
74 print " return $libprefix$prototype->{funcname}(";
76 if ($libarg eq 'first' && !$prototype->{nb
}) {
78 print $prototype->{numargs
} > 0 ?
", " : "";
81 print join (', ', @
{$prototype->{___argnames
}});
83 if ($libarg eq 'last' && !$prototype->{nb
}) {
84 print $prototype->{numargs
} > 0 ?
", " : "";