/*
** This file was automatically generated by fdtrans 52.1.
** Do not edit it by hand. Instead, edit the sfd file
** that was used to generate this file
*/

#ifdef __USE_INLINE__
#undef __USE_INLINE__
#endif
#ifndef __NOGLOBALIFACE__
#define __NOGLOBALIFACE__
#endif

#include <exec/interfaces.h>
#include <exec/libraries.h>
#include <exec/emulation.h>
#include <interfaces/exec.h>
#include <interfaces/cdplayer.h>
#include <proto/cdplayer.h>


static inline int8  convert_int8 (uint32 x) { return x; }
static inline int16 convert_int16(uint32 x) { return x; }


STATIC struct Library * stub_OpenPPC(ULONG *regarray)
{
    struct Library *Base = (struct Library *) regarray[REG68K_A6/4];
    struct ExtendedLibrary *ExtLib = (struct ExtendedLibrary *) ((ULONG)Base + Base->lib_PosSize);
    struct LibraryManagerInterface *Self = (struct LibraryManagerInterface *) ExtLib->ILibrary;

    return Self->Open(0);
}
STATIC CONST struct EmuTrap stub_Open = { TRAPINST, TRAPTYPE, (ULONG (*)(ULONG *))stub_OpenPPC };

STATIC APTR stub_ClosePPC(ULONG *regarray)
{
    struct Library *Base = (struct Library *) regarray[REG68K_A6/4];
    struct ExtendedLibrary *ExtLib = (struct ExtendedLibrary *) ((ULONG)Base + Base->lib_PosSize);
    struct LibraryManagerInterface *Self = (struct LibraryManagerInterface *) ExtLib->ILibrary;

    return Self->Close();
}
STATIC CONST struct EmuTrap stub_Close = { TRAPINST, TRAPTYPE, (ULONG (*)(ULONG *))stub_ClosePPC };

STATIC APTR stub_ExpungePPC(ULONG *regarray __attribute__((unused)))
{
    return NULL;
}
STATIC CONST struct EmuTrap stub_Expunge = { TRAPINST, TRAPTYPE, (ULONG (*)(ULONG *))stub_ExpungePPC };

STATIC ULONG stub_ReservedPPC(ULONG *regarray __attribute__((unused)))
{
    return 0UL;
}
STATIC CONST struct EmuTrap stub_Reserved = { TRAPINST, TRAPTYPE, stub_ReservedPPC };

static BYTE stub_CDEjectPPC(uint32 *regarray)
{
	struct Library *Base = (struct Library *) regarray[REG68K_A6/4];
	struct ExtendedLibrary *ExtLib = (struct ExtendedLibrary *) ((uint32)Base + Base->lib_PosSize);
	struct CDPlayerIFace *Self = (struct CDPlayerIFace *) ExtLib->MainIFace;

	return Self->CDEject(
		(struct IOStdReq *)regarray[13]
	);
}
STATIC CONST struct EmuTrap stub_CDEject = { TRAPINST, TRAPTYPE, (uint32 (*)(uint32 *))stub_CDEjectPPC };

static BYTE stub_CDPlayPPC(uint32 *regarray)
{
	struct Library *Base = (struct Library *) regarray[REG68K_A6/4];
	struct ExtendedLibrary *ExtLib = (struct ExtendedLibrary *) ((uint32)Base + Base->lib_PosSize);
	struct CDPlayerIFace *Self = (struct CDPlayerIFace *) ExtLib->MainIFace;

	return Self->CDPlay(
		(UBYTE)(regarray[8] & 0xff),
		(UBYTE)(regarray[9] & 0xff),
		(struct IOStdReq *)regarray[13]
	);
}
STATIC CONST struct EmuTrap stub_CDPlay = { TRAPINST, TRAPTYPE, (uint32 (*)(uint32 *))stub_CDPlayPPC };

static BYTE stub_CDResumePPC(uint32 *regarray)
{
	struct Library *Base = (struct Library *) regarray[REG68K_A6/4];
	struct ExtendedLibrary *ExtLib = (struct ExtendedLibrary *) ((uint32)Base + Base->lib_PosSize);
	struct CDPlayerIFace *Self = (struct CDPlayerIFace *) ExtLib->MainIFace;

	return Self->CDResume(
		(BOOL)convert_int16(regarray[8]),
		(struct IOStdReq *)regarray[13]
	);
}
STATIC CONST struct EmuTrap stub_CDResume = { TRAPINST, TRAPTYPE, (uint32 (*)(uint32 *))stub_CDResumePPC };

static BYTE stub_CDStopPPC(uint32 *regarray)
{
	struct Library *Base = (struct Library *) regarray[REG68K_A6/4];
	struct ExtendedLibrary *ExtLib = (struct ExtendedLibrary *) ((uint32)Base + Base->lib_PosSize);
	struct CDPlayerIFace *Self = (struct CDPlayerIFace *) ExtLib->MainIFace;

	return Self->CDStop(
		(struct IOStdReq *)regarray[13]
	);
}
STATIC CONST struct EmuTrap stub_CDStop = { TRAPINST, TRAPTYPE, (uint32 (*)(uint32 *))stub_CDStopPPC };

static BYTE stub_CDJumpPPC(uint32 *regarray)
{
	struct Library *Base = (struct Library *) regarray[REG68K_A6/4];
	struct ExtendedLibrary *ExtLib = (struct ExtendedLibrary *) ((uint32)Base + Base->lib_PosSize);
	struct CDPlayerIFace *Self = (struct CDPlayerIFace *) ExtLib->MainIFace;

	return Self->CDJump(
		(ULONG)regarray[8],
		(struct IOStdReq *)regarray[13]
	);
}
STATIC CONST struct EmuTrap stub_CDJump = { TRAPINST, TRAPTYPE, (uint32 (*)(uint32 *))stub_CDJumpPPC };

static BOOL stub_CDActivePPC(uint32 *regarray)
{
	struct Library *Base = (struct Library *) regarray[REG68K_A6/4];
	struct ExtendedLibrary *ExtLib = (struct ExtendedLibrary *) ((uint32)Base + Base->lib_PosSize);
	struct CDPlayerIFace *Self = (struct CDPlayerIFace *) ExtLib->MainIFace;

	return Self->CDActive(
		(struct IOStdReq *)regarray[13]
	);
}
STATIC CONST struct EmuTrap stub_CDActive = { TRAPINST, TRAPTYPE, (uint32 (*)(uint32 *))stub_CDActivePPC };

static ULONG stub_CDCurrentTitlePPC(uint32 *regarray)
{
	struct Library *Base = (struct Library *) regarray[REG68K_A6/4];
	struct ExtendedLibrary *ExtLib = (struct ExtendedLibrary *) ((uint32)Base + Base->lib_PosSize);
	struct CDPlayerIFace *Self = (struct CDPlayerIFace *) ExtLib->MainIFace;

	return Self->CDCurrentTitle(
		(struct IOStdReq *)regarray[13]
	);
}
STATIC CONST struct EmuTrap stub_CDCurrentTitle = { TRAPINST, TRAPTYPE, (uint32 (*)(uint32 *))stub_CDCurrentTitlePPC };

static BYTE stub_CDTitleTimePPC(uint32 *regarray)
{
	struct Library *Base = (struct Library *) regarray[REG68K_A6/4];
	struct ExtendedLibrary *ExtLib = (struct ExtendedLibrary *) ((uint32)Base + Base->lib_PosSize);
	struct CDPlayerIFace *Self = (struct CDPlayerIFace *) ExtLib->MainIFace;

	return Self->CDTitleTime(
		(struct CD_Time *)regarray[8],
		(struct IOStdReq *)regarray[13]
	);
}
STATIC CONST struct EmuTrap stub_CDTitleTime = { TRAPINST, TRAPTYPE, (uint32 (*)(uint32 *))stub_CDTitleTimePPC };

static BYTE stub_CDGetVolumePPC(uint32 *regarray)
{
	struct Library *Base = (struct Library *) regarray[REG68K_A6/4];
	struct ExtendedLibrary *ExtLib = (struct ExtendedLibrary *) ((uint32)Base + Base->lib_PosSize);
	struct CDPlayerIFace *Self = (struct CDPlayerIFace *) ExtLib->MainIFace;

	return Self->CDGetVolume(
		(struct CD_Volume *)regarray[8],
		(struct IOStdReq *)regarray[13]
	);
}
STATIC CONST struct EmuTrap stub_CDGetVolume = { TRAPINST, TRAPTYPE, (uint32 (*)(uint32 *))stub_CDGetVolumePPC };

static BYTE stub_CDSetVolumePPC(uint32 *regarray)
{
	struct Library *Base = (struct Library *) regarray[REG68K_A6/4];
	struct ExtendedLibrary *ExtLib = (struct ExtendedLibrary *) ((uint32)Base + Base->lib_PosSize);
	struct CDPlayerIFace *Self = (struct CDPlayerIFace *) ExtLib->MainIFace;

	return Self->CDSetVolume(
		(struct CD_Volume *)regarray[8],
		(struct IOStdReq *)regarray[13]
	);
}
STATIC CONST struct EmuTrap stub_CDSetVolume = { TRAPINST, TRAPTYPE, (uint32 (*)(uint32 *))stub_CDSetVolumePPC };

static BYTE stub_CDReadTOCPPC(uint32 *regarray)
{
	struct Library *Base = (struct Library *) regarray[REG68K_A6/4];
	struct ExtendedLibrary *ExtLib = (struct ExtendedLibrary *) ((uint32)Base + Base->lib_PosSize);
	struct CDPlayerIFace *Self = (struct CDPlayerIFace *) ExtLib->MainIFace;

	return Self->CDReadTOC(
		(struct CD_TOC *)regarray[8],
		(struct IOStdReq *)regarray[13]
	);
}
STATIC CONST struct EmuTrap stub_CDReadTOC = { TRAPINST, TRAPTYPE, (uint32 (*)(uint32 *))stub_CDReadTOCPPC };

static BYTE stub_CDInfoPPC(uint32 *regarray)
{
	struct Library *Base = (struct Library *) regarray[REG68K_A6/4];
	struct ExtendedLibrary *ExtLib = (struct ExtendedLibrary *) ((uint32)Base + Base->lib_PosSize);
	struct CDPlayerIFace *Self = (struct CDPlayerIFace *) ExtLib->MainIFace;

	return Self->CDInfo(
		(struct CD_Info *)regarray[8],
		(struct IOStdReq *)regarray[13]
	);
}
STATIC CONST struct EmuTrap stub_CDInfo = { TRAPINST, TRAPTYPE, (uint32 (*)(uint32 *))stub_CDInfoPPC };

CONST CONST_APTR VecTable68K[] =
{
	&stub_Open,
	&stub_Close,
	&stub_Expunge,
	&stub_Reserved,
	&stub_CDEject,
	&stub_CDPlay,
	&stub_CDResume,
	&stub_CDStop,
	&stub_CDJump,
	&stub_CDActive,
	&stub_CDCurrentTitle,
	&stub_CDTitleTime,
	&stub_CDGetVolume,
	&stub_CDSetVolume,
	&stub_CDReadTOC,
	&stub_CDInfo,
	(CONST_APTR)-1
};
