18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */
28c2ecf20Sopenharmony_ci/***************************************************************************
38c2ecf20Sopenharmony_ci *            au88x0_a3d.h
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci *  Fri Jul 18 14:16:03 2003
68c2ecf20Sopenharmony_ci *  Copyright  2003  mjander
78c2ecf20Sopenharmony_ci *  mjander@users.sourceforge.net
88c2ecf20Sopenharmony_ci ****************************************************************************/
98c2ecf20Sopenharmony_ci
108c2ecf20Sopenharmony_ci/*
118c2ecf20Sopenharmony_ci */
128c2ecf20Sopenharmony_ci
138c2ecf20Sopenharmony_ci#ifndef _AU88X0_A3D_H
148c2ecf20Sopenharmony_ci#define _AU88X0_A3D_H
158c2ecf20Sopenharmony_ci
168c2ecf20Sopenharmony_ci//#include <openal.h>
178c2ecf20Sopenharmony_ci
188c2ecf20Sopenharmony_ci#define HRTF_SZ 0x38
198c2ecf20Sopenharmony_ci#define DLINE_SZ 0x28
208c2ecf20Sopenharmony_ci
218c2ecf20Sopenharmony_ci#define CTRLID_HRTF		1
228c2ecf20Sopenharmony_ci#define CTRLID_ITD		2
238c2ecf20Sopenharmony_ci#define CTRLID_ILD		4
248c2ecf20Sopenharmony_ci#define CTRLID_FILTER	8
258c2ecf20Sopenharmony_ci#define CTRLID_GAINS	16
268c2ecf20Sopenharmony_ci
278c2ecf20Sopenharmony_ci/* 3D parameter structs */
288c2ecf20Sopenharmony_citypedef unsigned short int a3d_Hrtf_t[HRTF_SZ];
298c2ecf20Sopenharmony_citypedef unsigned short int a3d_ItdDline_t[DLINE_SZ];
308c2ecf20Sopenharmony_citypedef unsigned short int a3d_atmos_t[5];
318c2ecf20Sopenharmony_citypedef unsigned short int a3d_LRGains_t[2];
328c2ecf20Sopenharmony_citypedef unsigned short int a3d_Itd_t[2];
338c2ecf20Sopenharmony_citypedef unsigned short int a3d_Ild_t[2];
348c2ecf20Sopenharmony_ci
358c2ecf20Sopenharmony_citypedef struct {
368c2ecf20Sopenharmony_ci	void *vortex;		// Formerly CAsp4HwIO*, now vortex_t*.
378c2ecf20Sopenharmony_ci	unsigned int source;	/* this_04 */
388c2ecf20Sopenharmony_ci	unsigned int slice;	/* this_08 */
398c2ecf20Sopenharmony_ci	a3d_Hrtf_t hrtf[2];
408c2ecf20Sopenharmony_ci	a3d_Itd_t itd;
418c2ecf20Sopenharmony_ci	a3d_Ild_t ild;
428c2ecf20Sopenharmony_ci	a3d_ItdDline_t dline;
438c2ecf20Sopenharmony_ci	a3d_atmos_t filter;
448c2ecf20Sopenharmony_ci} a3dsrc_t;
458c2ecf20Sopenharmony_ci
468c2ecf20Sopenharmony_ci/* First Register bank */
478c2ecf20Sopenharmony_ci
488c2ecf20Sopenharmony_ci#define A3D_A_HrtfCurrent	0x18000	/* 56 ULONG */
498c2ecf20Sopenharmony_ci#define A3D_A_GainCurrent	0x180E0
508c2ecf20Sopenharmony_ci#define A3D_A_GainTarget	0x180E4
518c2ecf20Sopenharmony_ci#define A3D_A_A12Current	0x180E8	/* Atmospheric current. */
528c2ecf20Sopenharmony_ci#define A3D_A_A21Target		0x180EC	/* Atmospheric target */
538c2ecf20Sopenharmony_ci#define A3D_A_B01Current	0x180F0	/* Atmospheric current */
548c2ecf20Sopenharmony_ci#define A3D_A_B10Target		0x180F4	/* Atmospheric target */
558c2ecf20Sopenharmony_ci#define A3D_A_B2Current		0x180F8	/* Atmospheric current */
568c2ecf20Sopenharmony_ci#define A3D_A_B2Target		0x180FC	/* Atmospheric target */
578c2ecf20Sopenharmony_ci#define A3D_A_HrtfTarget	0x18100	/* 56 ULONG */
588c2ecf20Sopenharmony_ci#define A3D_A_ITDCurrent	0x181E0
598c2ecf20Sopenharmony_ci#define A3D_A_ITDTarget		0x181E4
608c2ecf20Sopenharmony_ci#define A3D_A_HrtfDelayLine	0x181E8	/* 56 ULONG */
618c2ecf20Sopenharmony_ci#define A3D_A_ITDDelayLine	0x182C8	/* 40/45 ULONG */
628c2ecf20Sopenharmony_ci#define A3D_A_HrtfTrackTC	0x1837C	/* Time Constants */
638c2ecf20Sopenharmony_ci#define A3D_A_GainTrackTC	0x18380
648c2ecf20Sopenharmony_ci#define A3D_A_CoeffTrackTC	0x18384
658c2ecf20Sopenharmony_ci#define A3D_A_ITDTrackTC	0x18388
668c2ecf20Sopenharmony_ci#define A3D_A_x1			0x1838C
678c2ecf20Sopenharmony_ci#define A3D_A_x2			0x18390
688c2ecf20Sopenharmony_ci#define A3D_A_y1			0x18394
698c2ecf20Sopenharmony_ci#define A3D_A_y2			0x18398
708c2ecf20Sopenharmony_ci#define A3D_A_HrtfOutL		0x1839C
718c2ecf20Sopenharmony_ci#define A3D_A_HrtfOutR		0x183A0
728c2ecf20Sopenharmony_ci#define 	A3D_A_TAIL		0x183A4
738c2ecf20Sopenharmony_ci
748c2ecf20Sopenharmony_ci/* Second register bank */
758c2ecf20Sopenharmony_ci#define A3D_B_HrtfCurrent	0x19000	/* 56 ULONG */
768c2ecf20Sopenharmony_ci#define A3D_B_GainCurrent	0x190E0
778c2ecf20Sopenharmony_ci#define A3D_B_GainTarget	0x190E4
788c2ecf20Sopenharmony_ci#define A3D_B_A12Current	0x190E8
798c2ecf20Sopenharmony_ci#define A3D_B_A21Target		0x190EC
808c2ecf20Sopenharmony_ci#define A3D_B_B01Current	0x190F0
818c2ecf20Sopenharmony_ci#define A3D_B_B10Target		0x190F4
828c2ecf20Sopenharmony_ci#define A3D_B_B2Current		0x190F8
838c2ecf20Sopenharmony_ci#define A3D_B_B2Target		0x190FC
848c2ecf20Sopenharmony_ci#define A3D_B_HrtfTarget	0x19100	/* 56 ULONG */
858c2ecf20Sopenharmony_ci#define A3D_B_ITDCurrent	0x191E0
868c2ecf20Sopenharmony_ci#define A3D_B_ITDTarget		0x191E4
878c2ecf20Sopenharmony_ci#define A3D_B_HrtfDelayLine	0x191E8	/* 56 ULONG */
888c2ecf20Sopenharmony_ci#define 	A3D_B_TAIL		0x192C8
898c2ecf20Sopenharmony_ci
908c2ecf20Sopenharmony_ci/* There are 4 slices, 4 a3d each = 16 a3d sources. */
918c2ecf20Sopenharmony_ci#define A3D_SLICE_BANK_A		0x18000	/* 4 sources */
928c2ecf20Sopenharmony_ci#define A3D_SLICE_BANK_B		0x19000	/* 4 sources */
938c2ecf20Sopenharmony_ci#define A3D_SLICE_VDBDest		0x19C00	/* 8 ULONG */
948c2ecf20Sopenharmony_ci#define A3D_SLICE_VDBSource		0x19C20	/* 4 ULONG */
958c2ecf20Sopenharmony_ci#define A3D_SLICE_ABReg			0x19C30
968c2ecf20Sopenharmony_ci#define A3D_SLICE_CReg			0x19C34
978c2ecf20Sopenharmony_ci#define A3D_SLICE_Control		0x19C38
988c2ecf20Sopenharmony_ci#define A3D_SLICE_DebugReserved	0x19C3c	/* Dangerous! */
998c2ecf20Sopenharmony_ci#define A3D_SLICE_Pointers		0x19C40
1008c2ecf20Sopenharmony_ci#define 	A3D_SLICE_TAIL		0x1A000
1018c2ecf20Sopenharmony_ci
1028c2ecf20Sopenharmony_ci// Slice size: 0x2000
1038c2ecf20Sopenharmony_ci// Source size: 0x3A4, 0x2C8
1048c2ecf20Sopenharmony_ci
1058c2ecf20Sopenharmony_ci/* Address generator macro. */
1068c2ecf20Sopenharmony_ci#define a3d_addrA(slice,source,reg) (((slice)<<0xd)+((source)*0x3A4)+(reg))
1078c2ecf20Sopenharmony_ci#define a3d_addrB(slice,source,reg) (((slice)<<0xd)+((source)*0x2C8)+(reg))
1088c2ecf20Sopenharmony_ci#define a3d_addrS(slice,reg) (((slice)<<0xd)+(reg))
1098c2ecf20Sopenharmony_ci//#define a3d_addr(slice,source,reg) (((reg)>=0x19000) ? a3d_addr2((slice),(source),(reg)) : a3d_addr1((slice),(source),(reg)))
1108c2ecf20Sopenharmony_ci
1118c2ecf20Sopenharmony_ci#endif				/* _AU88X0_A3D_H */
112