#ifndef  CLIB_GAMES_PROTOS_H
#define  CLIB_GAMES_PROTOS_H

/*
**	$VER: games_protos.h 0.3 (11.9.96)
**	Includes Release xx.xx
**
**	C prototypes.
**
**	(C) Copyright 1996 DreamWorld Productions.
**	    All Rights Reserved
*/

#ifndef  GAMES_GMS_H
#include <games/games.h>
#endif

#ifndef  EXEC_TYPES_H
#include <exec/types.h>
#endif

#ifndef  EXEC_TASKS_H
#include <exec/tasks.h>
#endif

/* Standard functions */

ULONG Init_GPI(UWORD GPI_ID);
ULONG Remove_GPI(UWORD GPI_ID);

ULONG Read_Mouse(UWORD PortName);
ULONG Read_JoyPort(UWORD Portname, UWORD ReturnType);
ULONG Read_JoyStick(UWORD PortName);
ULONG Read_JoyPad(UWORD PortName);
ULONG Read_SegaPad(UWORD PortName);
ULONG Read_Analog(UWORD PortName);
ULONG Read_Key(struct KeyStruct *);

ULONG FastRandom(UWORD Range);
ULONG SlowRandom(UWORD Range);
void  Wait_LMB(void);
void  Wait_Fire(UWORD PortName);
void  Wait_Time(UWORD MicroSeconds);
void  SetRequesters(UWORD NewStatus);
void  SetFilter(UWORD NewStatus);

void  Add_InputHandler(void);
void  Rem_InputHandler(void);
void  Add_Interrupt(APTR Interrupt, UWORD IntNum, UWORD IntPri);
void  Rem_Interrupt(APTR IntBase);

APTR  SmartLoad(char *FileName, APTR Destination, ULONG Password, ULONG MemType);
APTR  QuickLoad(char *FileName, APTR Destination, ULONG MemType);
APTR  SmartUnpack(APTR Source, APTR Destination, ULONG Password, ULONG MemType);
void  SmartSave(char *FileName, APTR Source, APTR SrcLength);
void  SetUserPri(void);
void  SetGMSPrefs(struct PrefsStruct *);
ULONG UnpackPic(APTR Source, struct Picture *);
ULONG LoadPic(char *FileName, struct Picture *);
APTR  GetPicInfo(struct Picture *);
APTR  AllocMemBlock(ULONG Size, ULONG MemType);
void  FreeMemBlock(APTR MemBlock);

/* Screens.GPI functions */

ULONG Add_Screen(struct GameScreen *);
void  Delete_Screen(struct GameScreen *);
void  Show_Screen(struct GameScreen *);
APTR  Hide_Screen(void);
void  ReturnToOS(void);
void  AutoOSReturn(void);
void  SwapBuffers(struct GameScreen *);
void  Wait_VBL(void);
void  Wait_OSVBL(void);
void  Wait_RastLine(WORD LinePosition);
void  Remake_Screen(struct GameScreen *);
void  Move_Picture(struct GameScreen *);
void  Reset_Picture(struct GameScreen *);

/* Palette alteration functions */

UWORD B12_FadeToBlack(struct GameScreen *, UWORD FadeState);
UWORD B12_FadeToWhite(struct GameScreen *, UWORD FadeState, UWORD StartCol, UWORD AmtCols);
UWORD B12_FadeToPalette(struct GameScreen *, UWORD FadeState, APTR Palette, UWORD StartCol, UWORD AmtCols);
UWORD B12_FadeToColour(struct GameScreen *, UWORD FadeState, UWORD RGB);
UWORD B24_FadeToBlack(struct GameScreen *, UWORD FadeState, UWORD Speed);
UWORD B24_FadeToWhite(struct GameScreen *, UWORD FadeState, UWORD Speed);
UWORD B24_FadeToPalette(struct GameScreen *, UWORD FadeState, APTR Palette, UWORD Speed);
UWORD B24_FadeToColour(struct GameScreen *, UWORD FadeState, ULONG RRGGBB, UWORD Speed);
void  Change_Colours(struct GameScreen *, UWORD FadeState, APTR Colours, UWORD StartColour, UWORD AmtColours);
void  Blank_Colours(struct GameScreen *);

/* Rasterlist functions */

ULONG Init_RasterList(struct GameScreen *);
void  Update_RasterList(struct GameScreen *);
void  Update_RasterCommand(struct GameScreen *, APTR Command);
void  Update_RasterCommands(struct GameScreen *, APTR Command, UWORD Amount);
void  Update_RasterLines(struct GameScreen *);
void  Remove_RasterList(struct GameScreen *);
void  Hide_RasterList(struct GameScreen *);
void  Show_RasterList(struct GameScreen *);

/* Sprite functions */

void  Init_Sprite(struct GameScreen *, struct Sprite *);
void  Update_Sprite(struct GameScreen *, struct Sprite *);
void  Move_Sprite(struct GameScreen *);
void  Remove_Sprite(struct GameScreen *, UWORD SpriteNum);
void  Update_SpriteList(APTR SpriteList);
void  Remove_SpriteList(APTR SpriteList);
void  Remove_AllSprites(void);
void  Return_AllSprites(void);

/* Blitter.GPI functions.  Not implemented yet */

/* Sound.GPI functions */

ULONG AllocAudio(void);
void  FreeAudio(void);
ULONG InitSound(struct Sound *);
void  FreeSound(struct Sound *);
UWORD CheckChannel(UWORD ChannelName);

void  PlaySound(struct Sound *);
void  PlaySoundDAC1(struct Sound *);
void  PlaySoundDAC2(struct Sound *);
void  PlaySoundDAC3(struct Sound *);
void  PlaySoundDAC4(struct Sound *);
void  PlaySoundPri(struct Sound *);
void  PlaySoundPriDAC1(struct Sound *);
void  PlaySoundPriDAC2(struct Sound *);
void  PlaySoundPriDAC3(struct Sound *);
void  PlaySoundPriDAC4(struct Sound *);

void  SetVolume(UWORD Channel, UWORD Volume);
void  FadeVolume(UWORD Channel);
void  StopSound(struct Sound *);
void  StopChannel(UWORD Channel);

#endif /* CLIB_GAMES_PROTOS_H */
