/*
 * $Id: p4specials.h 1.5 1998/04/01 10:06:06 crest Exp crest $
 *
 * :ts=8
 *
 * Copyright © 1998 Village Tronic Computer
 */

#ifndef LIBRARIES_P4SPECIALS_H
#define LIBRARIES_P4SPECIALS_H 1

/****************************************************************************/

#define P4SPECIALSNAME		"p4specials.library"

/****************************************************************************/

#define P4SPEC_Context_unknown		0
#define P4SPEC_Context_FlickerFixer	1
#define P4SPEC_Context_Paloma		2
#define P4SPEC_Context_3DOverDrive	3
#define P4SPEC_Context_MPEG		4

/****************************************************************************/

#define P4SPEC_TYPE	(TAG_USER + 0xf00000)	// Mask
#define P4SPEC_FLIFI	(TAG_USER + 0x100000)	// This Tag is for FlickerFixer
#define P4SPEC_PALOMA	(TAG_USER + 0x200000)	// This Tag is for Paloma
#define P4SPEC_3DOD	(TAG_USER + 0x300000)	// This Tag is for 3DOverDrive
#define P4SPEC_MPEG	(TAG_USER + 0x400000)	// This Tag is for MPEG Decoder

#define P4SPEC_GLOBAL	(TAG_USER + 0xf00000)	// This Tag is for GlobalControl

/****************************************************************************/

#define	P4GLOBAL_CaptureMode		(P4SPEC_GLOBAL + 0x01)	// which mode for Capture-Port
#define	P4GLOBAL_CaptureHook		(P4SPEC_GLOBAL + 0x02)	// add Interrupt-Hook
#define	P4GLOBAL_CaptureBandwidth	(P4SPEC_GLOBAL + 0x03)	// get required bandwidth

/****************************************************************************/

#define	P4FLIFI_Control_VMI	(P4SPEC_FLIFI + 0x00)	// De/Activate FlickerFixer
#define	P4FLIFI_24BIT		(P4SPEC_FLIFI + 0x01)	// 12/24 Bit mode
#define	P4FLIFI_GetAmigaMode	(P4SPEC_FLIFI + 0x02)	// detect Amiga video-mode

/****************************************************************************/

#define	P4PALO_TAGTYPE		(P4SPEC_PALOMA + 0x0f0000)	// Mask
#define	P4PALO_CONTROL		(P4SPEC_PALOMA + 0x010000)	// Paloma-Control
#define	P4PALO_VIDEO		(P4SPEC_PALOMA + 0x020000)	// video-related stuff
#define	P4PALO_TUNER		(P4SPEC_PALOMA + 0x030000)	// tuner-related stuff
#define	P4PALO_AUDIO		(P4SPEC_PALOMA + 0x040000)	// audio-related stuff

#define	P4PALO_Control_VMI		(P4PALO_CONTROL + 0x00)	// En/Disable VMI
#define	P4PALO_FeedbackLoad		(P4PALO_CONTROL + 0x01)	// En/Disable Load on Feedback

#define	P4PALO_Video_Init		(P4PALO_VIDEO + 0x00)
#define	P4PALO_Video_Source		(P4PALO_VIDEO + 0x01)
#define	P4PALO_Video_Brightness		(P4PALO_VIDEO + 0x02)
#define	P4PALO_Video_Contrast		(P4PALO_VIDEO + 0x03)
#define	P4PALO_Video_ColorSaturation	(P4PALO_VIDEO + 0x04)
#define	P4PALO_Video_ColorMode		(P4PALO_VIDEO + 0x05)
#define	P4PALO_Video_Window1		(P4PALO_VIDEO + 0x06)
#define	P4PALO_Video_Window2		(P4PALO_VIDEO + 0x07)
#define	P4PALO_Video_Timingmode		(P4PALO_VIDEO + 0x08)
#define	P4PALO_Video_SetStandard        (P4PALO_VIDEO + 0x09)
#define	P4PALO_Video_DetectStandard	(P4PALO_VIDEO + 0x0a)
#define	P4PALO_Video_GetStandard	(P4PALO_VIDEO + 0x0b)
#define	P4PALO_Video_GetLinesPerFrame	(P4PALO_VIDEO + 0x0c)
#define	P4PALO_Video_NTSC_Tint		(P4PALO_VIDEO + 0x0d)
#define	P4PALO_Video_SECAM_CrAdj	(P4PALO_VIDEO + 0x0e)
#define	P4PALO_Video_SECAM_CbAdj	(P4PALO_VIDEO + 0x0f)
#define	P4PALO_Video_ColorKiller	(P4PALO_VIDEO + 0x10)
#define	P4PALO_Video_Comp		(P4PALO_VIDEO + 0x11)

#define	P4PALO_Tuner_Frequency		(P4PALO_TUNER + 0x00)
#define	P4PALO_Tuner_Type		(P4PALO_TUNER + 0x01)
#define	P4PALO_Tuner_Is_Station		(P4PALO_TUNER + 0x02)
#define	P4PALO_Tuner_Granularity	(P4PALO_TUNER + 0x03)
#define	P4PALO_Tuner_MaxFrequency	(P4PALO_TUNER + 0x04)
#define	P4PALO_Tuner_ChannelTable	(P4PALO_TUNER + 0x05)
#define	P4PALO_Tuner_MinFrequency	(P4PALO_TUNER + 0x06)
#define	P4PALO_Tuner_NextStationUp	(P4PALO_TUNER + 0x07)
#define	P4PALO_Tuner_NextStationDown	(P4PALO_TUNER + 0x08)

#define	P4PALO_Audio_Init		(P4PALO_AUDIO + 0x00)
#define	P4PALO_TV_Mute			(P4PALO_AUDIO + 0x01)
#define	P4PALO_TV_Volume		(P4PALO_AUDIO + 0x02)

/****************************************************************************/

/* definitions for P4GLOBAL_CaptureMode */
#define	P4GLOBAL_CaptureSingleEdge	0	// capture only on single clock edges
#define	P4GLOBAL_CaptureDoubleEdge	1	// capture on both clock edges
#define	P4GLOBAL_CaptureClockNonInvert	0	// use noninverted clock
#define	P4GLOBAL_CaptureClockInvert	2	// invert capture clock
#define	P4GLOBAL_CaptureStandardField	0	// use normal Odd/Even field decode
#define	P4GLOBAL_CaptureReverseField	4	// revers Odd/Even field decode
#define	P4GLOBAL_Capture8Bit		0	// capture 8 bit wide
#define	P4GLOBAL_Capture16Bit		8	// capture 16 bit wide

/* definitions for P4PALO_Video_Source */
#define P4PALO_VideoSource_unknown	0
#define P4PALO_VideoSource_Tuner	1	// select(ed) source: Tuner
#define P4PALO_VideoSource_CVBS		2	// select(ed) source: CVBS-In
#define P4PALO_VideoSource_YC		3	// select(ed) source: Y/C-In
#define P4PALO_VideoSource_Pablo	4	// select(ed) source: Pablo/2ndCVBS

/* definition of color operation modes */
#define P4PALO_ColorMode_unknown	0	// YUV422/ITU-R601
#define P4PALO_ColorMode_YUV422		1	// YUV422/ITU-R601
#define P4PALO_ColorMode_RGB565G	2
#define P4PALO_ColorMode_RGB555G	3
#define P4PALO_ColorMode_YUV444		4
#define P4PALO_ColorMode_RGB888G	5
//#define P4PALO_ColorMode_YUV422	6	// YUV422/ITU-R656 embedded syns
//#define P4PALO_ColorMode_YUV422	7	// YUV422/BStream embedded syncs (unterschiede???)


/* Constants for TimingMode */
#define P4PALO_TM_OPEN   0
#define P4PALO_TM_FORCED 1
#define P4PALO_TM_SCAN   2


/* window definition */
typedef struct
{
	UWORD	pwt_vbeg;
	UWORD	pwt_vlinei;
	UWORD	pwt_vlineo;
	UWORD	pwt_hbeg;
	UWORD	pwt_hlen;
	UWORD	pwt_npix;
	UWORD	pwt_sharp;
	UWORD	pwt_winen;
} PALO_WIN;

#define P4PALO_WINEN_ALL  0                     // Enable Window for all frames
#define P4PALO_WINEN_EVEN 1                     // Enable Window only for even frames
#define P4PALO_WINEN_ODD  2                     // Enable Window only for odd frames
#define P4PALO_WINEN_NONE 3                     // Disable Window

#define P4PALO_SHARP_BYPASS    0
#define P4PALO_SHARP_MAXBLUR   1
#define P4PALO_SHARP_MIDBLUR   2
#define P4PALO_SHARP_MINBLUR   3
#define P4PALO_SHARP_DEFAULT   4
#define P4PALO_SHARP_MINALIAS  5
#define P4PALO_SHARP_MIDALIAS  6
#define P4PALO_SHARP_MAXALIAS  7


/* Constants for SetStandard */
#define P4PALO_AUTO   0x80000000
#define P4PALO_PAL    0
#define P4PALO_NTSC   1
#define P4PALO_SECAM  2
#define P4PALO_NTSC44 3
#define P4PALO_PALM   4
#define P4PALO_PALN   5
#define P4PALO_PAL60  6
#define P4PALO_NTSCC  7
#define P4PALO_NTSCK  8 // not included in settv, it's NTSC with PAL decoding

/****************************************************************************/

struct TunerChannel
{
	STRPTR	tc_Name;	/* Name of the channel */
	ULONG	tc_Frequency;	/* Channel frequency in Hz */
	UWORD	tc_Properties;	/* Properties of this channel */
};

#define CHANPROPB_VHF_Low	(0)	/* Channel is located in the lower VHF band */
#define CHANPROPB_VHF_High	(1)	/* Channel is located in the higher VHF band */
#define CHANPROPB_UHF		(2)	/* Channel is located in the UHF band */
#define CHANPROPB_Air		(3)	/* Channel is used for aerial transmission */
#define CHANPROPB_Cable		(4)	/* Channel is used for cable transmission */
#define CHANPROPB_Air_XOR_Cable	(5)	/* Cable and air channels cannot be mixed for
					 * this type of tuner since they are too close
					 * together or even assigned to the same frequencies
					 * and bands.
					 */

#define CHANPROPF_VHF_Low	(1UL<<CHANPROPB_VHF_Low)
#define CHANPROPF_VHF_High	(1UL<<CHANPROPB_VHF_High)
#define CHANPROPF_UHF		(1UL<<CHANPROPB_UHF)
#define CHANPROPF_Air		(1UL<<CHANPROPB_Air)
#define CHANPROPF_Cable		(1UL<<CHANPROPB_Cable)
#define CHANPROPF_Air_XOR_Cable	(1UL<<CHANPROPB_Air_XOR_Cable)

/****************************************************************************/

#endif	/* LIBRARIES_P4SPECIALS_H */
