#ifndef COMPILE_H
#include "COMPILE.H"
#endif
#ifdef MEDIA751_A36M_A31E_A31M_A33M_A35E_A35M_X31J_AU1E_AU2E_AU2F_AU2G_AU3E
extern FTL_LIBRARY* G9004_PRIMbase;

#if ((EXETYPE == C13_GRF1) && defined(MEDIA619_A31E_A31M))
#include "GRF1BASE.C"
#endif

FTL_LIBRARY* G9004_PRIMbase;


PRIM_29_Empty(
)
{
        asm {
                movea.l G9004_PRIMbase,a0
                movea.l -0x74(a0),a1
#if ((defined(MEDIA618_A31E) && (EXETYPE == C01_SWOOSH)) || (defined(MEDIA692_X31J) && (EXETYPE != C01_SWOOSH) && (EXETYPE != C04_SWITCH)))
                move.w  #29,d0
#endif
                jmp     (a1)
        }
}

PRIM_15_Memory_Allocate(
)
{
        asm {
                movea.l G9004_PRIMbase,a0
                movea.l -0x3C(a0),a1
#if ((defined(MEDIA618_A31E) && (EXETYPE == C01_SWOOSH)) || (defined(MEDIA692_X31J) && (EXETYPE != C01_SWOOSH) && (EXETYPE != C04_SWITCH)))
                move.w  #15,d0
#endif
                jmp     (a1)
        }
}

PRIM_16_Memory_Free(
)
{
        asm {
                movea.l G9004_PRIMbase,a0
                movea.l -0x40(a0),a1
#if ((defined(MEDIA618_A31E) && (EXETYPE == C01_SWOOSH)) || (defined(MEDIA692_X31J) && (EXETYPE != C01_SWOOSH) && (EXETYPE != C04_SWITCH)))
                move.w  #16,d0
#endif
                jmp     (a1)
        }
}

PRIM_17_File_Open(
)
{
        asm {
                movea.l G9004_PRIMbase,a0
                movea.l -0x44(a0),a1
#if ((defined(MEDIA618_A31E) && (EXETYPE == C01_SWOOSH)) || (defined(MEDIA692_X31J) && (EXETYPE != C01_SWOOSH) && (EXETYPE != C04_SWITCH)))
                move.w  #17,d0
#endif
                jmp     (a1)
        }
}

PRIM_18_File_Close(
)
{
        asm {
                movea.l G9004_PRIMbase,a0
                movea.l -0x48(a0),a1
#if ((defined(MEDIA618_A31E) && (EXETYPE == C01_SWOOSH)) || (defined(MEDIA692_X31J) && (EXETYPE != C01_SWOOSH) && (EXETYPE != C04_SWITCH)))
                move.w  #18,d0
#endif
                jmp     (a1)
        }
}

PRIM_19_File_Seek(
)
{
        asm {
                movea.l G9004_PRIMbase,a0
                movea.l -0x4C(a0),a1
#if ((defined(MEDIA618_A31E) && (EXETYPE == C01_SWOOSH)) || (defined(MEDIA692_X31J) && (EXETYPE != C01_SWOOSH) && (EXETYPE != C04_SWITCH)))
                move.w  #19,d0
#endif
                jmp     (a1)
        }
}

PRIM_20_File_Read(
)
{
        asm {
                movea.l G9004_PRIMbase,a0
                movea.l -0x50(a0),a1
#if ((defined(MEDIA618_A31E) && (EXETYPE == C01_SWOOSH)) || (defined(MEDIA692_X31J) && (EXETYPE != C01_SWOOSH) && (EXETYPE != C04_SWITCH)))
                move.w  #20,d0
#endif
                jmp     (a1)
        }
}

PRIM_22_Console_PrintMessage(
)
{
        asm {
                movea.l G9004_PRIMbase,a0
                movea.l -0x58(a0),a1
#if ((defined(MEDIA618_A31E) && (EXETYPE == C01_SWOOSH)) || (defined(MEDIA692_X31J) && (EXETYPE != C01_SWOOSH) && (EXETYPE != C04_SWITCH)))
                move.w  #22,d0
#endif
                jmp     (a1)
        }
}

PRIM_23_Input_WaitForChar(
)
{
        asm {
                movea.l G9004_PRIMbase,a0
                movea.l -0x5C(a0),a1
#if ((defined(MEDIA618_A31E) && (EXETYPE == C01_SWOOSH)) || (defined(MEDIA692_X31J) && (EXETYPE != C01_SWOOSH) && (EXETYPE != C04_SWITCH)))
                move.w  #23,d0
#endif
                jmp     (a1)
        }
}

PRIM_24_Input_Read(
)
{
        asm {
                movea.l G9004_PRIMbase,a0
                movea.l -0x60(a0),a1
#if ((defined(MEDIA618_A31E) && (EXETYPE == C01_SWOOSH)) || (defined(MEDIA692_X31J) && (EXETYPE != C01_SWOOSH) && (EXETYPE != C04_SWITCH)))
                move.w  #24,d0
#endif
                jmp     (a1)
        }
}

PRIM_21_FTL_FatalLoaderError(
)
{
        asm {
                movea.l G9004_PRIMbase,a0
                movea.l -0x54(a0),a1
#if ((defined(MEDIA618_A31E) && (EXETYPE == C01_SWOOSH)) || (defined(MEDIA692_X31J) && (EXETYPE != C01_SWOOSH) && (EXETYPE != C04_SWITCH)))
                move.w  #21,d0
#endif
                jmp     (a1)
        }
}

PRIM_04_Library_HookFunction(
)
{
        asm {
                movea.l G9004_PRIMbase,a0
                movea.l -0x10(a0),a1
#if ((defined(MEDIA618_A31E) && (EXETYPE == C01_SWOOSH)) || (defined(MEDIA692_X31J) && (EXETYPE != C01_SWOOSH) && (EXETYPE != C04_SWITCH)))
                move.w  #4,d0
#endif
                jmp     (a1)
        }
}

PRIM_28_Library_UnhookFunction(
)
{
        asm {
                movea.l G9004_PRIMbase,a0
                movea.l -0x70(a0),a1
#if ((defined(MEDIA618_A31E) && (EXETYPE == C01_SWOOSH)) || (defined(MEDIA692_X31J) && (EXETYPE != C01_SWOOSH) && (EXETYPE != C04_SWITCH)))
                move.w  #28,d0
#endif
                jmp     (a1)
        }
}

PRIM_27_File_IsOpenable(
)
{
        asm {
                movea.l G9004_PRIMbase,a0
                movea.l -0x6C(a0),a1
#if ((defined(MEDIA618_A31E) && (EXETYPE == C01_SWOOSH)) || (defined(MEDIA692_X31J) && (EXETYPE != C01_SWOOSH) && (EXETYPE != C04_SWITCH)))
                move.w  #27,d0
#endif
                jmp     (a1)
        }
}

FTL_LIBRARY* PRIM_08_Library_Open(
)
{
        asm {
                movea.l G9004_PRIMbase,a0
                movea.l -0x20(a0),a1
#if ((defined(MEDIA618_A31E) && (EXETYPE == C01_SWOOSH)) || (defined(MEDIA692_X31J) && (EXETYPE != C01_SWOOSH) && (EXETYPE != C04_SWITCH)))
                move.w  #8,d0
#endif
                jmp     (a1)
        }
}

PRIM_09_Library_Close(
)
{
        asm {
                movea.l G9004_PRIMbase,a0
                movea.l -0x24(a0),a1
#if ((defined(MEDIA618_A31E) && (EXETYPE == C01_SWOOSH)) || (defined(MEDIA692_X31J) && (EXETYPE != C01_SWOOSH) && (EXETYPE != C04_SWITCH)))
                move.w  #9,d0
#endif
                jmp     (a1)
        }
}

PRIM_10_Library_FlagAsCanBeExpunged(
)
{
        asm {
                movea.l G9004_PRIMbase,a0
                movea.l -0x28(a0),a1
#if ((defined(MEDIA618_A31E) && (EXETYPE == C01_SWOOSH)) || (defined(MEDIA692_X31J) && (EXETYPE != C01_SWOOSH) && (EXETYPE != C04_SWITCH)))
                move.w  #10,d0
#endif
                jmp     (a1)
        }
}

PRIM_05_FTL_Load(
)
{
        asm {
                movea.l G9004_PRIMbase,a0
                movea.l -0x14(a0),a1
#if ((defined(MEDIA618_A31E) && (EXETYPE == C01_SWOOSH)) || (defined(MEDIA692_X31J) && (EXETYPE != C01_SWOOSH) && (EXETYPE != C04_SWITCH)))
                move.w  #5,d0
#endif
                jmp     (a1)
        }
}

PRIM_06_FTL_FreeMemory(
)
{
        asm {
                movea.l G9004_PRIMbase,a0
                movea.l -0x18(a0),a1
#if ((defined(MEDIA618_A31E) && (EXETYPE == C01_SWOOSH)) || (defined(MEDIA692_X31J) && (EXETYPE != C01_SWOOSH) && (EXETYPE != C04_SWITCH)))
                move.w  #6,d0
#endif
                jmp     (a1)
        }
}

PRIM_07_FTL_Execute(
)
{
        asm {
                movea.l G9004_PRIMbase,a0
                movea.l -0x1C(a0),a1
#if ((defined(MEDIA618_A31E) && (EXETYPE == C01_SWOOSH)) || (defined(MEDIA692_X31J) && (EXETYPE != C01_SWOOSH) && (EXETYPE != C04_SWITCH)))
                move.w  #7,d0
#endif
                jmp     (a1)
        }
}

PRIM_26_FTL_LoadAndExecute(
)
{
        asm {
                movea.l G9004_PRIMbase,a0
                movea.l -0x68(a0),a1
#if ((defined(MEDIA618_A31E) && (EXETYPE == C01_SWOOSH)) || (defined(MEDIA692_X31J) && (EXETYPE != C01_SWOOSH) && (EXETYPE != C04_SWITCH)))
                move.w  #26,d0
#endif
                jmp     (a1)
        }
}

PRIM_25_FTL_DecompressCODESegment(
)
{
        asm {
                movea.l G9004_PRIMbase,a0
                movea.l -0x64(a0),a1
#if ((defined(MEDIA618_A31E) && (EXETYPE == C01_SWOOSH)) || (defined(MEDIA692_X31J) && (EXETYPE != C01_SWOOSH) && (EXETYPE != C04_SWITCH)))
                move.w  #25,d0
#endif
                jmp     (a1)
        }
}

PRIM_13_Library_InitializeList(
)
{
        asm {
                movea.l G9004_PRIMbase,a0
                movea.l -0x34(a0),a1
#if ((defined(MEDIA618_A31E) && (EXETYPE == C01_SWOOSH)) || (defined(MEDIA692_X31J) && (EXETYPE != C01_SWOOSH) && (EXETYPE != C04_SWITCH)))
                move.w  #13,d0
#endif
                jmp     (a1)
        }
}

PRIM_14_Library_FindInList(
)
{
        asm {
                movea.l G9004_PRIMbase,a0
                movea.l -0x38(a0),a1
#if ((defined(MEDIA618_A31E) && (EXETYPE == C01_SWOOSH)) || (defined(MEDIA692_X31J) && (EXETYPE != C01_SWOOSH) && (EXETYPE != C04_SWITCH)))
                move.w  #14,d0
#endif
                jmp     (a1)
        }
}

PRIM_11_Library_AddToList(
)
{
        asm {
                movea.l G9004_PRIMbase,a0
                movea.l -0x2C(a0),a1
#if ((defined(MEDIA618_A31E) && (EXETYPE == C01_SWOOSH)) || (defined(MEDIA692_X31J) && (EXETYPE != C01_SWOOSH) && (EXETYPE != C04_SWITCH)))
                move.w  #11,d0
#endif
                jmp     (a1)
        }
}

PRIM_12_Library_RemoveFromList(
)
{
        asm {
                movea.l G9004_PRIMbase,a0
                movea.l -0x30(a0),a1
#if ((defined(MEDIA618_A31E) && (EXETYPE == C01_SWOOSH)) || (defined(MEDIA692_X31J) && (EXETYPE != C01_SWOOSH) && (EXETYPE != C04_SWITCH)))
                move.w  #12,d0
#endif
                jmp     (a1)
        }
}

FTL_LIBRARY* F9008_OpenPRIM(P9008_ps_, P9009_i_MinimumVersion)
register FTL_LIBRARY* P9008_ps_;
int16_t P9009_i_MinimumVersion;
{
        G9004_PRIMbase = P9008_ps_;
        if ((P9009_i_MinimumVersion <= 5) && (P9008_ps_->Version >= P9009_i_MinimumVersion)) {
                return P9008_ps_;
        } else {
                return NULL;
        }
}

long F9009_ClosePRIM(
)
{
}

#if ((EXETYPE == C13_GRF1) && defined(MEDIA619_A31E_A31M))
#include "GRF1STUB.C"
#endif
#endif
