; AC3 Passthrough for Emu10k2 (Audigy)
; Author: Daniel Bertrand
; Date: Feb 10, 2002

;;; This program is free software; you can redistribute it and/or modify
;;; it under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 2 of the License, or
;;; (at your option) any later version.

	include "emu_constants.inc"

	name "AC3pass"

	
out_a	io
out_b	io
in_a	equ out_a
in_b	equ out_b

enable		control 0,0,1
tmp_a	dyn
tmp_b   dyn
mask	con $ffff0000

	move out_a, in_a
	move out_b, in_b
	test enable
	beq .end
	move tmp_a, $3c
	ble  .next_a
	add  tmp_a, C_65536, tmp_a
.next_a
	move tmp_b, $3d
	ble  .next_b
	add  tmp_b, C_65536, tmp_b
.next_b
	and out_a, tmp_a, mask
	and out_b, tmp_b, mask
.end
	end
