Binary files ../AmiPhone_1.92/AmiPhone.guide.icon.info and ./AmiPhone.guide.icon.info differ
Binary files ../AmiPhone_1.92/AmiPhoneDrawer.info and ./AmiPhoneDrawer.info differ
Binary files ../AmiPhone_1.92/AmiPhoneIcon.info and ./AmiPhoneIcon.info differ
diff -r -C 2 -P ../AmiPhone_1.92/AmiPhoned.h ./AmiPhoned.h
*** ../AmiPhone_1.92/AmiPhoned.h	Sat Nov 16 23:46:40 1996
--- ./AmiPhoned.h	Sun Feb 15 18:45:41 1998
***************
*** 4,7 ****
--- 4,9 ----
  #define MSG_READY   0x02
  
+ #include <CompilerSpecific.h>
+ 
  int MakeReq(char *sTitle, char *sText, char *sGadgets);
  int SpaceUsedInDir(char * szDirectory);
diff -r -C 2 -P ../AmiPhone_1.92/CompilerSpecific.h ./CompilerSpecific.h
*** ../AmiPhone_1.92/CompilerSpecific.h	Thu Jan  1 01:00:00 1970
--- ./CompilerSpecific.h	Sun Mar  1 02:23:59 1998
***************
*** 0 ****
--- 1,234 ----
+ #ifndef COMPILERSPECIFIC_H
+ #define COMPILERSPECIFIC_H
+ /*
+ **	$VER: CompilerSpecific.h 2.2 (1.10.97)
+ **
+ **	Copyright (C) 1997 Bernardo Innocenti. All rights reserved.
+ **
+ **	Compiler specific definitions is here. You can add support
+ **	for other compilers in this header. Please return any changes
+ **	you make to me, so I can add them to my personal copy of this file.
+ **
+ **	Here is a short description of the macros defined below:
+ **
+ **	LIBCALL
+ **		Shared library entry point, with register args
+ **
+ **	HOOKCALL
+ **		Hook or boopsi dispatcher entry point with arguments
+ **		passed in registers
+ **
+ **	INLINE
+ **		Please put function body inline to the calling code
+ **
+ **	STDARGS
+ **		Function uses standard C conventions for arguments
+ **
+ **	ASMCALL
+ **		Function takes arguments in the specified 68K registers
+ **
+ **	REGCALL
+ **		Function takes arguments in registers choosen by the compiler
+ **
+ **	CONSTCALL
+ **		Function does not modify any global variable
+ **
+ **	FORMATCALL(archetype,string_index,first_to_check)
+ **		Function uses printf or scanf-like formatting
+ **
+ **	SAVEDS
+ **		Function needs to reload context for small data model
+ **
+ **	INTERRUPT
+ **		Function will be called from within an interrupt
+ **
+ **	NORETURN
+ **		Function does never return
+ **
+ **	ALIGNED
+ **		Variable must be aligned to longword boundaries
+ **
+ **	CHIP
+ **		Variable must be stored in CHIP RAM
+ **
+ **	REG(reg,arg)
+ **		Put argument <arg> in 68K register <reg>
+ **
+ **	min(a,b)
+ **		Return the minimum between <a> and <b>
+ **
+ **	max(a,b)
+ **		Return the maximum between <a> and <b>
+ **
+ **	abs(a)
+ **		Return the absolute value of <a>
+ **
+ **	_COMPILED_WITH
+ **		A string containing the name of the compiler
+ */
+ 
+ #ifdef __SASC
+ 	/* SAS/C 6.58 or better */
+ 
+ 	#define INLINE		static __inline
+ 	#define STDARGS		__stdargs
+ 	#define ASMCALL		__asm
+ 	#define REGCALL		__regcall
+ 	#define CONSTCALL	/* unsupported */
+ 	#define FORMATCALL	/* unsupported */
+ 	#define SAVEDS		__saveds
+ 	#define INTERRUPT	__interrupt
+ 	#define NORETURN	/* unsupported */
+ 	#define ALIGNED		__aligned
+ 	#define CHIP		__chip
+ 	#define REG(reg,arg) register __##reg arg
+ 	#define _COMPILED_WITH	"SAS/C"
+ 
+ 	/* For min(), max() and abs() */
+ 	#define USE_BUILTIN_MATH
+ 	#include <string.h>
+ #else
+ #ifdef __GNUC__
+ 	/* GeekGadgets GCC 2.7.2.1 or better */
+ 
+ 	#define INLINE		static inline
+ 	#define STDARGS		__attribute__((stkparm))
+ 	#define ASMCALL		/* nothing */
+ 	#define REGCALL		/* nothing */
+ 	#define CONSTCALL	__attribute__((const))
+ 	#define FORMATCALL(a,s,f)	__attribute__((format(a,s,f)))
+ 	#define SAVEDS		__attribute__((saveds))
+ 	#define INTERRUPT	__attribute__((interrupt))
+ 	#define NORETURN	__attribute__((noreturn))
+ 	#define ALIGNED		__attribute__((aligned(4)))
+ 	#define REG(reg,arg) arg __asm(#reg)
+ 	#define _COMPILED_WITH	"GCC"
+ 
+ 	#define min(a,b)	(((a)<(b))?(a):(b))
+ 	#define max(a,b)	(((a)>(b))?(a):(b))
+ 	#define abs(a)		(((a)>0)?(a):-(a))
+ 
+ 	/* GCC produces code which calls these two functions
+ 	 * to initialize and copy structures and arrays.
+ 	 */
+ 	static inline void __attribute__((stkparm)) bzero (char *buf, int len)
+ 		{ while (len--) *buf++ = 0; }
+ 
+ 	static inline void __attribute__((stkparm)) bcopy (char *src, char *dest, int len)
+ 		{ while (len--) *dest++ = *src++; }
+ 
+ #else
+ #ifdef __STORM__
+ 	/* StormC 2.00.23 or better */
+ 	#define INLINE		__inline
+ 	#define STDARGS		/* nothing */
+ 	#define ASMCALL		/* nothing */
+ 	#define REGCALL		register
+ 	#define CONSTCALL	/* unsupported */
+ 	#define FORMATCALL	/* unsupported */
+ 	#define SAVEDS		__saveds
+ 	#define INTERRUPT	__interrupt
+ 	#define NORETURN	/* unsupported */
+ 	#define ALIGNED		/* unsupported */
+ 	#define CHIP		__chip
+ 	#define REG(reg,arg) register __##reg arg
+ 	#define _COMPILED_WITH	"StormC"
+ 
+ 	#define min(a,b)	(((a)<(b))?(a):(b))
+ 	#define max(a,b)	(((a)>(b))?(a):(b))
+ 	#define abs(a)		(((a)>0)?(a):-(a))
+ 
+ 	#define _INLINE_INCLUDES
+ 	#include <string.h>
+ #else
+ #ifdef __MAXON__
+ 	/* Maxon C/C++ */
+ 
+ 	#define INLINE		static inline
+ 	#define STDARGS		/* ? */
+ 	#define ASMCALL		/* ? */
+ 	#define REGCALL		/* ? */
+ 	#define CONSTCALL	/* unsupported */
+ 	#define FORMATCALL	/* unsupported */
+ 	#define SAVEDS		__saveds
+ 	#define INTERRUPT	__interrupt
+ 	#define NORETURN	/* unsupported */
+ 	#define ALIGNED		__aligned
+ 	#define REG(reg,arg) register __##reg arg
+ 	#define _COMPILED_WITH	"Maxon C"
+ 
+ 	/* For min(), max() and abs() */
+ 	#define USE_BUILTIN_MATH
+ 	#include <string.h>
+ 
+ 	#error Maxon C compiler support is untested. Please check all the above definitions
+ #else
+ #ifdef _DCC
+ 	/* DICE C */
+ 
+ 	#define INLINE		static __inline
+ 	#define STDARGS		__stdargs
+ 	#define ASMCALL		/* nothing */
+ 	#define REGCALL		/* ? */
+ 	#define CONSTCALL	/* unsupported */
+ 	#define FORMATCALL	/* unsupported */
+ 	#define SAVEDS		__geta4
+ 	#define INTERRUPT	/* unsupported */
+ 	#define NORETURN	/* unsupported */
+ 	#define ALIGNED		__aligned
+ 	#define REG(reg,arg)	__##reg arg
+ 	#define _COMPILED_WITH	"DICE"
+ 
+ 	#define min(a,b)	(((a)<(b))?(a):(b))
+ 	#define max(a,b)	(((a)>(b))?(a):(b))
+ 	#define abs(a)		(((a)>0)?(a):-(a))
+ 
+ 	#error DICE compiler support is untested. Please check all the above definitions
+ #else
+ #ifdef AZTEC_C
+ 	/* Aztec/Manx C */
+ 
+ 	#define INLINE		static
+ 	#define STDARGS		/* ? */
+ 	#define ASMCALL		/* ? */
+ 	#define REGCALL		/* ? */
+ 	#define CONSTCALL	/* unsupported */
+ 	#define FORMATCALL	/* unsupported */
+ 	#define SAVEDS		__geta4
+ 	#define INTERRUPT	/* unsupported */
+ 	#define NORETURN	/* unsupported */
+ 	#define ALIGNED		__aligned
+ 	#define REG(reg,arg)	__##reg arg
+ 	#define _COMPILED_WITH	"Manx C"
+ 
+ 	#define min(a,b)	(((a)<(b))?(a):(b))
+ 	#define max(a,b)	(((a)>(b))?(a):(b))
+ 	#define abs(a)		(((a)>0)?(a):-(a))
+ 
+ 	#error Aztec/Manx C compiler support is untested. Please check all the above definitions
+ #else
+ 	#error Please add compiler specific definitions for your compiler
+ #endif
+ #endif
+ #endif
+ #endif
+ #endif
+ #endif
+ 
+ 
+ /* Special function attributes */
+ 
+ #define LIBCALL		ASMCALL SAVEDS
+ #define HOOKCALL	ASMCALL SAVEDS
+ 
+ 
+ /* AROS Compatibility: IPTR is a type which can store a pointer
+  * as well as a long integer.
+  */
+ #ifndef IPTR
+ #define IPTR LONG
+ #endif /* IPTR */
+ 
+ 
+ 
+ #endif /* !COMPILERSPECIFIC_H */
diff -r -C 2 -P ../AmiPhone_1.92/EditTextFile.rexx ./EditTextFile.rexx
*** ../AmiPhone_1.92/EditTextFile.rexx	Thu Jan  1 01:00:00 1970
--- ./EditTextFile.rexx	Sun Jul  7 20:43:18 1996
***************
*** 0 ****
--- 1,141 ----
+ /* 
+    EditTextFile.rexx v1.1 by Jeremy Friesner
+ 
+    An ARexx script to cleanly modify text config
+    lines.  Any line beginning with sReplaceMe in 
+    the File fModifyMe will be replaced with the line sWithMe.
+    
+    If no such thing as sReplaceMe is found in the
+    file, then sWithMe will be added to the end of
+    the file. 
+ 
+    This script should never lose the original file:
+    the first thing it does it rename the file to
+    filename.bak and then reconstructs the modified
+    version at the original file name by reading the
+    .bak file.  If an error occurs, it will restore
+    filename.bak back to the original filename.
+    
+    Any ^ signs in the sReplaceMe or sWithMe args will
+    be turned into space characters.  (Although sReplaceMe
+    doesn't actually need these, because it's the last
+    arg and thus spaces will be included in it anyway.
+    Isn't Rexx argument passing fun?)
+ */
+    
+ parse arg fModifyMe sReplaceMe sWithMe
+ 
+ address COMMAND
+ 
+ sReplaceMe = ChangeToSpaces(sReplaceMe)
+ sWithMe    = strip(ChangeToSpaces(sWithMe))
+ 
+ fBackupFile = fModifyMe || ".bak"
+ say "File to be modified   = [" || fModifyMe || "]"
+ say "Backup file           = [" || fBackupFile || "]"
+ say "String to add/replace = [" || sReplaceMe || "]"
+ say "add/Replace with      = [" || sWithMe || "]"
+ 
+ keylength = length(sReplaceMe)
+ 
+ /* First, make sure rexxsupport.library is available. */
+ call addlib("rexxsupport.library", 0, -30, 0)
+ 
+ /* Delete any .bak file that now exists */
+ call delete(fBackupFile)
+ 
+ /* Rename the original filename to filename.bak */
+ if (rename(fModifyMe, fBackupFile) == 0) then do
+ 	say "Error:  Couldn't rename " || fModifyMe || " to " || fBackupFile
+ 	exit(30)
+ 	end
+ BFileRenamed = 1
+ 	
+ /* Default == haven't found the line we want to replace yet */
+ BFoundOurLine = 0
+ 
+ /* Open the backup file for reading */
+ if (open('oldfile',fBackupFile,'R') == 0) then do
+ 	say "Couldn't open backup file " || fBackupFile
+ 	call error
+ 	end
+ 	
+ /* and the new file for writing */
+ if (open('newfile',fModifyMe,'W') == 0) then do
+ 	say "Couldn't open output file " || fModifyMe
+ 	call error
+ 	end
+ 
+ 
+ /* Scan the old file, writing the new one */
+ do while (EOF('oldfile') == 0)
+  nextline = readln('oldfile')
+  sCheckPart = left(nextline,keylength)
+  
+  if ((BFoundOurLine == 0)&(sCheckPart = sReplaceMe)) then 
+  do
+  	/* don't write out this line... write out our substitute instead! */
+  	say "Found: [" || nextline || "] replacing with [" || sWithMe || "]"
+ 	call writeln('newfile',sWithMe)
+ 	BFoundOurLine = 1
+  end
+  else do
+ 	call writeln('newfile',nextline)
+ 	end
+ end
+ 
+ /* If we never found our line to replace, then just add our
+    line at the end of the file. */
+ if (BFoundOurLine == 0) then call writeln('newfile',sWithMe)
+ 
+ call close('oldfile')
+ call close('newfile')
+ 
+ /* success! */
+ successMessage = "File " || fModifyMe || " successfully modified (" || sReplaceMe || ") -> " || "(" || sWithMe || ")."
+ 
+ say successMessage
+ 
+ /* Show calling app that we succeeded */
+ address COMMAND 'echo ' || successMessage || ' >t:edit_text_succeeded'
+ exit(0)
+ 
+ 
+ /* Changes all occurrences of the character '^' to spaces in the string. 
+    Needed to get around ARexx's lame argument parsing.   I think.
+ */
+ ChangeToSpaces: procedure
+ 	parse arg sOrig
+ 	
+ 	sNew = ""
+ 	do while (length(sOrig) > 0)
+ 		cChar = left(sOrig,1)
+ 		if (cChar == "^") then cChar = " "
+ 		sNew = sNew || cChar
+ 		sOrig = right(sOrig,length(sOrig)-1)
+ 		end
+ 	return sNew
+ 		
+ 		
+ /* Replaces original file if an error occurs */		
+ error:
+ 	say "An error occured!"
+ 	call close('oldfile')
+ 	call close('newfile')
+ 	if (BFileRenamed == 1) then do
+ 		say "Attempting to restore the original file " || fModifyMe
+ 
+ 		/* Delete the incomplete file that now exists */
+ 		call rename(fModifyMe, fModifyMe || ".tobedeleted")
+ 
+ 		/* Rename filename.bak back to filename */
+ 		if (rename(fBackupFile, fModifyMe) == 0) then do
+ 			call rename(fModifyMe || ".tobedeleted", fModifyMe)
+ 			say "Error:  Couldn't rename " || fBackupFile || " to " || fModifyMe || ", aborting now."
+ 			exit(30)
+ 			end
+ 			
+ 		call delete(fModifyMe||".tobedeleted")
+ 		say "Recovery of original file " || fModifyMe || " was successful."
+ 		end
+ 	exit(30)
\ No newline at end of file
diff -r -C 2 -P ../AmiPhone_1.92/Install_AmiPhone ./Install_AmiPhone
*** ../AmiPhone_1.92/Install_AmiPhone	Sat Nov 16 23:46:46 1996
--- ./Install_AmiPhone	Sun Mar  1 02:31:10 1998
***************
*** 1,199 ****
  ; Installation script for AmiPhone
  ; by Jeremy Friesner
  
  (transcript "On installing AmiPhone...")
  
  (if (exists "AmiTCP:" (noreq))
!  (
! 	; make sure "rx" is available
! 	(if (not (exists "sys:rexxc/rx"))
! 	    (abort "This installer script needs to use the ARexx utility rx.\n\nPlease make sure the rx utility is installed in sys:rexxc and try to install again."))
! 
! 	; make sure we have the library that EditTextFile.rexx needs
! 	(if (not (exists "libs:rexxsupport.library"))
! 	    (abort "This installer script needs rexxsupport.library in LIBS: to run.\n\nPlease install this library and then run this Installer script again."))
! 
! 	; try and make sure ARexx is running 
! 	(run "rexxmast" (safe))
! 
! 	; if AmiPhoned is already in /serv, probably they've already installed before
! 	(set DefaultUpdate (exists "amitcp:serv/AmiPhoned" (noreq)))
  
! 	; don't want to make a distinction between 1 and 2
! 	(if (> DefaultUpdate 0)	(set DefaultUpdate 1))
  	
! 	(set PhoneUpdate
! 	      (askchoice
! 	         (prompt "Select which kind of install you want:")
! 	         (choices "First Time Install" "Update")
! 	         (default DefaultUpdate)
! 	         (help "If you've never installed AmiPhone on your system before, select First Time Install.  If you already have an earlier version, select Update.")
! 	   ))
! 
! 	; see if we can't guess what digitizer they use, based on files in their system drawer	
! 	(set nGuessDefault 8)	; default default is Generic
! 	(if (exists "devs:ahi.device") (set nGuessDefault 7))
! 	(if (exists "libs:toccata.library") (set nGuessDefault 3))
! 	(if (exists "libs:delfina.library") (set nGuessDefault 6))
  	
! 	; ask the user what kind of digitizer they use
! 	(set Digitizer
! 	      (askchoice
! 	      	 (prompt "Select which type of audio digitizer you will be using with AmiPhone:")
! 	      	 (choices "GVP DSS8" "PerfectSound" "A.M.A.S." "Toccata (Zorro II)" "Aura (PCMCIA)" "Sound Magic" "Delfina (Zorro II)" "AHI (Audio Library)" "Generic Parallel Port digitizer")
! 	      	 (default nGuessDefault)
! 	      	 (help "To send speech with AmiPhone, you need an audio digitizer connected to your parallel port.  If your digitizer model is not listed, please choose the Generic option.")
! 	      )
! 	)
! 	(select Digitizer
! 		(set Digitizer "DSS8")
! 		(set Digitizer "PERFECTSOUND")
! 		(set Digitizer "AMAS")
! 		(set Digitizer "TOCCATA")
! 		(set Digitizer "AURA")
! 		(set Digitizer "SOUNDMAGIC")
! 		(set Digitizer "DELFINA")
! 		(set Digitizer "AHI")
! 		(set Digitizer "GENERIC")
! 	)
  	(tooltype
  		(dest "AmiPhone")
! 		(settooltype "SAMPLER" Digitizer)
! 	)
  
! 	; do they want to set up AmiPhone to receive voice-mail?
! 	(if (= 1 (askbool 
! 		(prompt "\n\nDo you wish to set up AmiPhone to receive voice mail?")
! 		(help "AmiPhone is capable of receiving and storing voice messages while you are away from your computer.  This takes some disk space though, so if you're tight on space, you might want to leave it disabled.")
! 		(default 0)
! 		(choices "Yes" "No")))
! 	; answered yes
! 	(
! 		(set MessageDir 
! 			(askdir
!                 		(prompt "What directory would you like AmiPhone to keep the voice message files in?  (NOTE: You should not keep any other files in this directory!)")
!                         	(help @askdir-help)
!                         	(default "work:")))
!                 (set MaxDirSize
!                 	(asknumber
!                 		(prompt "\n\nWhat should be the maximum possible size (in kilobytes) of this directory be?  (Enter -1 for unlimited size)")
!                 		(help "By setting this value, you can guarantee that AmiPhoned will not let anyone fill up your hard drive.  AmiPhoned counts the bytes in the voice mail directory on startup, and will reject messages if the directory size has reached the size you specify here.")
! 				(default 500)
! 				(range -1 1000000)))
! 		
! 		; if a max size was set for the dir, use that as the max max file size as well
! 		(if (> MaxDirSize -1)
! 			(set MaxFileSize MaxDirSize)
! 			(set MaxFileSize 1000000))
! 		
! 		(set MaxFileSize
! 			(asknumber
! 				(prompt "\n\nWhat should the maximum possible size (in kilobytes) of each message be?  (Enter -1 to impose no special limit on individual message size)")
!                 		(help "By setting this value, you can guarantee that no one message will fill up your entire allotment of message space.")
! 				(default -1)
! 				(range -1 MaxFileSize)))
!                 (set AwayVar
!                 	(askstring
!                 		(prompt "\n\nAmiPhone uses the presence of an ENV: var to determine whether or not you're away.  If the ENV: var is present, it takes a message, otherwise it puts up a requester for you.  What ENV: var would you like AmiPhone to look for?")
!                 		(help "The ENV: var can be set manually by you, by a script, or perhaps by your screen blanker.")
! 				(default "BLANKED")))
! 		
! 		; set the tooltypes!	
! 		(set BlankString "")
! 
! 		(tooltype
! 			(dest "AmiPhone")
! 			(settooltype "VOICEMAILDIR" MessageDir))
! 		(tooltype
! 			(dest "AmiPhone")
! 			(settooltype "AWAYVAR" AwayVar))
! 
! 		(if (> MaxDirSize -1)
! 		((tooltype
! 			(dest "AmiPhone")
! 			(settooltype "MAXVOICEMAILSIZE" (cat BlankString MaxDirSize))))
! 		;else
! 		((tooltype (dest "AmiPhone") (settooltype "MAXVOICEMAILSIZE"))))
! 		
! 		(if (> MaxFileSize -1)	
! 		((tooltype
! 			(dest "AmiPhone")
! 			(settooltype "MAXMESSAGESIZE" (cat BlankString MaxFileSize))))
! 		;else
! 		((tooltype (dest "AmiPhone") (settooltype "MAXMESSAGESIZE"))))
! 		
! 	)
! 	; answered no
! 	(
! 		; clean out any related tooltypes 
! 		(tooltype (dest "AmiPhone") (settooltype "VOICEMAILDIR"))
! 		(tooltype (dest "AmiPhone") (settooltype "MAXVOICEMAILSIZE"))
! 		(tooltype (dest "AmiPhone") (settooltype "MAXMESSAGESIZE"))
! 		(tooltype (dest "AmiPhone") (settooltype "AWAYVAR"))
! 	))
! 	
! 	(set PhoneDir
! 		(askdir
!                 	(prompt "What directory would you like to put the AmiPhone executable in?  (no directory will be created)")
!                         (help @askdir-help)
!                         (default "AmiTCP:bin")
!                 )
!         )
! 
! 	; if PhoneDir isn't the usual, set the AMIPHONE env: var to let AmiPhoned know
! 	(if (not (PatMatch "Amitcp:bin" PhoneDir))
! 	   (
! 	    (run (cat "echo " (tackon PhoneDir "AmiPhone") " >env:AMIPHONE"))
! 	    (run (cat "echo " (tackon PhoneDir "AmiPhone") " >envarc:AMIPHONE"))
! 	   )
! 	)
  	
! 	; Copy AmiPhone and AmiPhoned to the bin and serv directories 
! 	(copyfiles
! 		(prompt (cat "Copying AmiPhone executable to " PhoneDir))
! 		(help @copyfiles-help)
! 		(source "")
! 		(infos)
! 		(pattern "AmiPhone")
! 		(dest PhoneDir)
! 	)
  	
! 	(copyfiles
! 		(prompt "Copying AmiPhoned daemon to amitcp:serv")
! 		(help @copyfiles-help)
! 		(source "")
! 		(infos)
! 		(pattern "AmiPhoned")
! 		(dest "amitcp:serv")
  	)
  
! 	; If we're doing a first-time install, update the user's AmiTCP config files
! 	(if (= 0 PhoneUpdate)	
! 	  (
! 		(delete "t:edit_text_succeeded")
! 		(set ARexxRunString (cat "sys:rexxc/rx EditTextFile.rexx amitcp:db/services AmiPhone AmiPhone^^^^^^^^2956/tcp"))
! 		(run
! 			(ARexxRunString)
! 			(prompt "If you plan to be running AmiPhone in conjunction with AmiTCP, the line:\n\nAmiPhone        2956/tcp\n\nneeds to be present in your amitcp:db/services file.  Do you wish me to update the file?  (Note:  AmiPhone will not receive connections if this line is not precisely as shown above!)")
! 			(help "The inclusion of this line into amitcp:db/services is done by an ARexx script which is smart enough to correctly edit previous installations.  Also it will make a backup (to amitcp:db/services.bak) before writing.")
! 			(confirm)
  		)
! 		(if (not (exists "t:edit_text_succeeded"))
! 		   (message "For some reason, the config file editing script (EditText.rexx) could not complete successfully.  You'll need to edit your amitcp:db/services file yourself.  Look in the 'Installation' section of the AmiPhone docs for instructions."))
! 					
! 		(delete "t:edit_text_succeeded")
! 		(set ARexxRunString (cat "sys:rexxc/rx EditTextFile.rexx amitcp:db/inetd.conf AmiPhone AmiPhone^^^^stream^^^^^^tcp^nowait^root^^^^amitcp:serv/AmiPhoned"))
! 		(run
! 			(ARexxRunString)
! 			(prompt "\nAlso, the line:\n\nAmiPhone    stream      tcp nowait root    amitcp:serv/AmiPhoned\n\nneeds to be present in your amitcp:db/inetd.conf file.  Do you wish me to update that file?\n(Note:  AmiPhone will not receive connections if this line is not precisely as shown above!)")
! 			(help "The inclusion of this line into amitcp:db/inetd.conf is done by an ARexx script which is smart enough to correctly edit previous installations.  Also it will make a backup (to amitcp:db/inetd.conf.bak) before writing.")
! 			(confirm)
  		)
! 		(if (not (exists "t:edit_text_succeeded"))
! 		   (message "For some reason, the config file editing script (EditText.rexx) could not complete successfully.  You'll need to edit your amitcp:db/inetd.conf file yourself.  Look in the 'Installation' section of the AmiPhone docs for instructions."))
! 	  )
  	)
  	(message "\n\nAmiPhone is now installed.\nRe-start AmiTCP and try it out!")
!  )
!  (abort "\n\nAmiTCP does not appear to be set up on your system.  (Specifically, the assign AmiTCP: has not been made)  Because of this, I am unable to install AmiPhone.  Please install AmiTCP and then try again.")
! )
\ No newline at end of file
--- 1,255 ----
  ; Installation script for AmiPhone
  ; by Jeremy Friesner
+ ; Miami additions by Fredrik Rambris
+ ; Martin Blom removed the Delfina lines...
  
  (transcript "On installing AmiPhone...")
  
  (if (exists "AmiTCP:" (noreq))
! 	(set defc 1)
! 	(set defc 0)
! )
! 
! (set inst
! 	(askchoice
! 		(prompt "Select which TCP/IP-stack to install for")
! 		(help "Short: Which package do you use to connect to internet with?")
! 		(choices "Miami"
! 		         "AmiTCP"
! 		)
! 		(default defc)
! 	)
! )
  
! (if inst
! 	(
! 		; make sure "rx" is available
! 		(if (not (exists "sys:rexxc/rx"))
! 		    (abort "This installer script needs to use the ARexx utility rx.\n\nPlease make sure the rx utility is installed in sys:rexxc and try to install again."))
! 
! 		; make sure we have the library that EditTextFile.rexx needs
! 		(if (not (exists "libs:rexxsupport.library"))
! 		    (abort "This installer script needs rexxsupport.library in LIBS: to run.\n\nPlease install this library and then run this Installer script again."))
! 
! 		; try and make sure ARexx is running 
! 		(run "rexxmast" (safe))
! 	)
! )
! 
! ; if AmiPhoned is already in /serv, probably they've already installed before
! (set DefaultUpdate (exists "amitcp:serv/AmiPhoned" (noreq)))
! 
! ; don't want to make a distinction between 1 and 2
! (if (> DefaultUpdate 0)	(set DefaultUpdate 1))
! 
! (set PhoneUpdate
!       (askchoice
!          (prompt "Select which kind of install you want:")
!          (choices "First Time Install" "Update")
!          (default DefaultUpdate)
!          (help "If you've never installed AmiPhone on your system before, select First Time Install.  If you already have an earlier version, select Update.")
!    ))
! 
! ; see if we can't guess what digitizer they use, based on files in their system drawer	
! (set nGuessDefault 7)	; default default is Generic
! (if (exists "devs:ahi.device") (set nGuessDefault 6))
! (if (exists "libs:toccata.library") (set nGuessDefault 3))
! 
! ; ask the user what kind of digitizer they use
! (set Digitizer
!       (askchoice
!       	 (prompt "Select which type of audio digitizer you will be using with AmiPhone:")
!       	 (choices "GVP DSS8" "PerfectSound" "A.M.A.S." "Toccata (Zorro II)" "Aura (PCMCIA)" "Sound Magic" "AHI" "Generic Parallel Port digitizer")
!       	 (default nGuessDefault)
!       	 (help "To send speech with AmiPhone, you need an audio digitizer connected to your parallel port.  If your digitizer model is not listed, please choose the Generic option.")
!       )
! )
! (select Digitizer
! 	(set Digitizer "DSS8")
! 	(set Digitizer "PERFECTSOUND")
! 	(set Digitizer "AMAS")
! 	(set Digitizer "TOCCATA")
! 	(set Digitizer "AURA")
! 	(set Digitizer "SOUNDMAGIC")
! 	(set Digitizer "AHI")
! 	(set Digitizer "GENERIC")
! )
! (tooltype
! 	(dest "AmiPhone")
! 	(settooltype "SAMPLER" Digitizer)
! )
! 
! ; do they want to set up AmiPhone to receive voice-mail?
! (if (= 1 (askbool 
! 	(prompt "\n\nDo you wish to set up AmiPhone to receive voice mail?")
! 	(help "AmiPhone is capable of receiving and storing voice messages while you are away from your computer.  This takes some disk space though, so if you're tight on space, you might want to leave it disabled.")
! 	(default 0)
! 	(choices "Yes" "No")))
! ; answered yes
! (
! 	(set MessageDir 
! 		(askdir
!             		(prompt "What directory would you like AmiPhone to keep the voice message files in?  (NOTE: You should not keep any other files in this directory!)")
!                     	(help @askdir-help)
!                     	(default "work:")))
!             (set MaxDirSize
!             	(asknumber
!             		(prompt "\n\nWhat should be the maximum possible size (in kilobytes) of this directory be?  (Enter -1 for unlimited size)")
!             		(help "By setting this value, you can guarantee that AmiPhoned will not let anyone fill up your hard drive.  AmiPhoned counts the bytes in the voice mail directory on startup, and will reject messages if the directory size has reached the size you specify here.")
! 			(default 500)
! 			(range -1 1000000)))
  	
! 	; if a max size was set for the dir, use that as the max max file size as well
! 	(if (> MaxDirSize -1)
! 		(set MaxFileSize MaxDirSize)
! 		(set MaxFileSize 1000000))
  	
! 	(set MaxFileSize
! 		(asknumber
! 			(prompt "\n\nWhat should the maximum possible size (in kilobytes) of each message be?  (Enter -1 to impose no special limit on individual message size)")
!             		(help "By setting this value, you can guarantee that no one message will fill up your entire allotment of message space.")
! 			(default -1)
! 			(range -1 MaxFileSize)))
!             (set AwayVar
!             	(askstring
!             		(prompt "\n\nAmiPhone uses the presence of an ENV: var to determine whether or not you're away.  If the ENV: var is present, it takes a message, otherwise it puts up a requester for you.  What ENV: var would you like AmiPhone to look for?")
!             		(help "The ENV: var can be set manually by you, by a script, or perhaps by your screen blanker.")
! 			(default "BLANKED")))
! 	
! 	; set the tooltypes!	
! 	(set BlankString "")
! 
  	(tooltype
  		(dest "AmiPhone")
! 		(settooltype "VOICEMAILDIR" MessageDir))
! 	(tooltype
! 		(dest "AmiPhone")
! 		(settooltype "AWAYVAR" AwayVar))
  
! 	(if (> MaxDirSize -1)
! 	((tooltype
! 		(dest "AmiPhone")
! 		(settooltype "MAXVOICEMAILSIZE" (cat BlankString MaxDirSize))))
! 	;else
! 	((tooltype (dest "AmiPhone") (settooltype "MAXVOICEMAILSIZE"))))
  	
! 	(if (> MaxFileSize -1)	
! 	((tooltype
! 		(dest "AmiPhone")
! 		(settooltype "MAXMESSAGESIZE" (cat BlankString MaxFileSize))))
! 	;else
! 	((tooltype (dest "AmiPhone") (settooltype "MAXMESSAGESIZE"))))
  	
! )
! ; answered no
! (
! 	; clean out any related tooltypes 
! 	(tooltype (dest "AmiPhone") (settooltype "VOICEMAILDIR"))
! 	(tooltype (dest "AmiPhone") (settooltype "MAXVOICEMAILSIZE"))
! 	(tooltype (dest "AmiPhone") (settooltype "MAXMESSAGESIZE"))
! 	(tooltype (dest "AmiPhone") (settooltype "AWAYVAR"))
! ))
! 
! (set PhoneDir
! 	(askdir
! 		(prompt "What directory would you like to put the AmiPhone executable in?\n(no directory will be created)")
! 		(help @askdir-help)
! 		(default (select inst "Work:" "AmiTCP:bin") )
  	)
+ )
+ 
+ (set @default-dest PhoneDir)
  
! (if inst
! 	(set PhonedDir "AmiTCP:Serv")
! 	(
! 		(set PhonedDir
! 			(askdir
! 				(prompt "What directory would you like to put the AmiPhoned daemon executable in?\n(no directory will be created)")
! 				(help @askdir-help)
! 				(default "Work:")
! 			)
  		)
! 	)
! )
! ; if PhoneDir isn't the usual, set the AMIPHONE env: var to let AmiPhoned know
! (if (not (PatMatch "Amitcp:bin" PhoneDir))
!    (
!     (run (cat "echo " (tackon PhoneDir "AmiPhone") " >env:AMIPHONE"))
!     (run (cat "echo " (tackon PhoneDir "AmiPhone") " >envarc:AMIPHONE"))
!    )
! )
! 
! ; Copy AmiPhone and AmiPhoned to the bin and serv directories 
! (copyfiles
! 	(prompt (cat "Copying AmiPhone executable to " PhoneDir))
! 	(help @copyfiles-help)
! 	(source "")
! 	(infos)
! 	(pattern "AmiPhone")
! 	(dest PhoneDir)
! )
! 
! (copyfiles
! 	(prompt (cat "Copying AmiPhoned daemon to %s" PhonedDir) )
! 	(help @copyfiles-help)
! 	(source "")
! 	(infos)
! 	(pattern "AmiPhoned")
! 	(dest PhonedDir)
! )
! 
! ; If we're doing a first-time install, update the user's AmiTCP config files
! (if (= 0 PhoneUpdate)	
! 	(if inst
! 		(
! 			(delete "t:edit_text_succeeded")
! 			(set ARexxRunString (cat "sys:rexxc/rx EditTextFile.rexx amitcp:db/services AmiPhone AmiPhone^^^^^^^^2956/tcp"))
! 			(run
! 				(ARexxRunString)
! 				(prompt "If you plan to be running AmiPhone in conjunction with AmiTCP, the line:\n\nAmiPhone        2956/tcp\n\nneeds to be present in your amitcp:db/services file.  Do you wish me to update the file?  (Note:  AmiPhone will not receive connections if this line is not precisely as shown above!)")
! 				(help "The inclusion of this line into amitcp:db/services is done by an ARexx script which is smart enough to correctly edit previous installations.  Also it will make a backup (to amitcp:db/services.bak) before writing.")
! 				(confirm)
! 			)
! 			(if (not (exists "t:edit_text_succeeded"))
! 			   (message "For some reason, the config file editing script (EditText.rexx) could not complete successfully.  You'll need to edit your amitcp:db/services file yourself.  Look in the 'Installation' section of the AmiPhone docs for instructions."))
! 						
! 			(delete "t:edit_text_succeeded")
! 			(set ARexxRunString (cat "sys:rexxc/rx EditTextFile.rexx amitcp:db/inetd.conf AmiPhone AmiPhone^^^^stream^^^^^^tcp^nowait^root^^^^amitcp:serv/AmiPhoned"))
! 			(run
! 				(ARexxRunString)
! 				(prompt "\nAlso, the line:\n\nAmiPhone    stream      tcp nowait root    amitcp:serv/AmiPhoned\n\nneeds to be present in your amitcp:db/inetd.conf file.  Do you wish me to update that file?\n(Note:  AmiPhone will not receive connections if this line is not precisely as shown above!)")
! 				(help "The inclusion of this line into amitcp:db/inetd.conf is done by an ARexx script which is smart enough to correctly edit previous installations.  Also it will make a backup (to amitcp:db/inetd.conf.bak) before writing.")
! 				(confirm)
! 			)
! 			(if (not (exists "t:edit_text_succeeded"))
! 			   (message "For some reason, the config file editing script (EditText.rexx) could not complete successfully.  You'll need to edit your amitcp:db/inetd.conf file yourself.  Look in the 'Installation' section of the AmiPhone docs for instructions."))
  		)
! 
! 		(
! 			; Create the textfile with a pointer to AmiPhoneD
! 			(textfile
! 			   (dest "t:dbtemp")
! 			   (append
! 			      "ADD services AmiPhone 2956/tcp\n"
! 			      ("ADD inetd AmiPhone stream tcp nowait root %s\n" (tackon PhonedDir "AmiPhoned") )
! 			   )
! 			)
! 
! 			; Add the lines to envarc:MiamiChangeDB (i.e. don't overwrite! Other programs
! 			; may have their lines there too)
! 			(run "type t:dbtemp >>envarc:MiamiChangeDB")
! 
! 			; If Miami shoule be running... why not make it read the new settings?
! 			(run "SYS:Rexxc/RX \"ADDRESS MIAMI.1;changedb\"")
! 
! 			; Clean up
! 			(delete "t:dbtemp")
! 		)	
! 
  	)
+ )
+ (if inst
  	(message "\n\nAmiPhone is now installed.\nRe-start AmiTCP and try it out!")
! 	(message "\n\nAmiPhone is now installed.\nYou may have to re-start Miami before you start AmiPhone!")
! )
Binary files ../AmiPhone_1.92/Install_AmiPhone.info and ./Install_AmiPhone.info differ
diff -r -C 2 -P ../AmiPhone_1.92/PhoneUtil.c ./PhoneUtil.c
*** ../AmiPhone_1.92/PhoneUtil.c	Sat Nov 16 23:46:42 1996
--- ./PhoneUtil.c	Sun Feb 15 23:04:50 1998
***************
*** 1,4 ****
--- 1,5 ----
  /* A quick program to read in an AmiPhone voice file and output
     an 8-bit raw sound file */
+ /* :ts=4 */
  
  #include <stdio.h>
diff -r -C 2 -P ../AmiPhone_1.92/README ./README
*** ../AmiPhone_1.92/README	Thu Jan  1 01:00:00 1970
--- ./README	Fri Mar 13 00:25:46 1998
***************
*** 0 ****
--- 1,52 ----
+ Short: v1.93: AmiTCP based voice chat program
+ Type: comm/net
+ Author: Jeremy Friesner <jfriesne@ucsd.edu>, Martin Blom <lcs@lysator.liu.se>
+ Uploader: Martin Blom <lcs@lysator.liu.se>
+ Requires: Workbench 2.04+, AmiTCP3.0b+, audio digitizer
+ Version: 1.93
+ 
+ ----------------------------------------------------------------
+ 	
+ 			AMIPHONE 1.93
+                      
+                    (Released 1998-03-13)
+                      
+ ----------------------------------------------------------------
+ 
+ This is a public release of Jeremy Friesner's TCP/IP based voice chat
+ software.  With it and a digitizer and microphone, you can transmit your
+ voice over the Internet or a LAN to another Amiga or Amigas that are
+ running AmiPhone.
+ 
+ AmiPhone requires Workbench 2.04 or higher, AmiTCP 3.0b or higher, and a
+ sampler with a microphone.  Also, a fast CPU and fast Internet connection
+ are highly recommended.
+ 
+ NOTE:  AmiPhone is not compatible with I-Phone or any other
+        Internet-phone type program at this time.     
+ 
+ New in version 1.93:
+ 
+      The 1.93 changes by Martin Blom:
+ 
+      - Recompiled using SAS/C 6.58.
+      * Removed the Delfina support (it didn't work anymore).
+      - New-Look menus.
+      - The AHI audio mode is now selectable.
+      - Input can be selected in AHI mode.
+      * Removed some debug code.
+      - Added Fredrik Rambris installer script (supports Miami).
+        (I hope you don't mind, Fredrik---your mail address is not
+        valid anymore.)
+ 
+ New in version 1.92:
+      - AmiPhone's GUI is now font-sensitive.
+      - Added "FONT" and "FONTSIZE" Startup Arguments.
+      - Added "PRESEND" and "POSTSEND" Startup Arguments.
+      - The maximum MaxXmitDelay parameter value is now 999.
+      * Removed HOSTNAME configuration from Install script and docs,
+        as this env var is no longer (directly) used by AmiPhone.
+      * Toccata support is improved some more.  (Thanks to Georges
+        Heinesch and Dan Piontak for feedback on this)
+      * Removed some floating point math that was causing crashes
+        on some Amigas.  (Thanks to Meni Berman for his help with this).
Binary files ../AmiPhone_1.92/README.icon.info and ./README.icon.info differ
diff -r -C 2 -P ../AmiPhone_1.92/Sampler.c ./Sampler.c
*** ../AmiPhone_1.92/Sampler.c	Sat Nov 16 23:46:44 1996
--- ./Sampler.c	Sun Feb 15 13:29:52 1998
***************
*** 46,52 ****
  #endif	// ciab
  
! extern __far volatile struct Custom	custom;
! extern __far volatile struct CIA	ciaa;
! extern __far volatile struct CIA	ciab;
  
  	// Audio channel bits
--- 46,52 ----
  #endif	// ciab
  
! extern FAR volatile struct Custom	custom;
! extern FAR volatile struct CIA	ciaa;
! extern FAR volatile struct CIA	ciab;
  
  	// Audio channel bits
***************
*** 71,75 ****
  #define SAMPLING_RATE	22050
  
! LONG __saveds
  Main(VOID)
  {
--- 71,75 ----
  #define SAMPLING_RATE	22050
  
! LONG SAVEDS
  Main(VOID)
  {
diff -r -C 2 -P ../AmiPhone_1.92/StringRequest.c ./StringRequest.c
*** ../AmiPhone_1.92/StringRequest.c	Sat Nov 16 23:46:44 1996
--- ./StringRequest.c	Sun Feb 15 23:04:53 1998
***************
*** 1,2 ****
--- 1,5 ----
+ 
+ /* :ts=4 */
+ 
  #include <stdio.h>
  #include <time.h>
***************
*** 157,161 ****
  void SetBusyPointer(struct Window *win)
  {
! 	static __chip UWORD waitPointer[] =
  	       {0x0000, 0x0000, 0x0400, 0x07c0, 0x0000, 0x07c0, 0x0100, 0x0380,
  		0x0000, 0x07e0, 0x07c0, 0x1ff8, 0x1ff0, 0x3fec, 0x3ff8, 0x7fde,
--- 160,164 ----
  void SetBusyPointer(struct Window *win)
  {
! 	static CHIP UWORD waitPointer[] =
  	       {0x0000, 0x0000, 0x0400, 0x07c0, 0x0000, 0x07c0, 0x0100, 0x0380,
  		0x0000, 0x07e0, 0x07c0, 0x1ff8, 0x1ff0, 0x3fec, 0x3ff8, 0x7fde,
diff -r -C 2 -P ../AmiPhone_1.92/TCPQueue.c ./TCPQueue.c
*** ../AmiPhone_1.92/TCPQueue.c	Sat Nov 16 23:46:40 1996
--- ./TCPQueue.c	Sun Feb 15 23:04:57 1998
***************
*** 1,5 ****
--- 1,9 ----
+ 
+ /* :ts=4 */
+ 
  #include <stdio.h>
  #include <string.h>
  
+ #include <netinclude:sys/types.h>
  #include <exec/types.h>
  
***************
*** 10,14 ****
  #include <clib/alib_protos.h>
  
! #include <errno.h>
  #include <inetd.h>
  #include <sys/types.h>
--- 14,18 ----
  #include <clib/alib_protos.h>
  
! /* #include <errno.h> */
  #include <inetd.h>
  #include <sys/types.h>
Only in ../AmiPhone_1.92: TCPQueue.c.info
diff -r -C 2 -P ../AmiPhone_1.92/amiphone.c ./amiphone.c
*** ../AmiPhone_1.92/amiphone.c	Sat Nov 16 23:46:46 1996
--- ./amiphone.c	Tue Mar  3 09:05:11 1998
***************
*** 1,3 ****
--- 1,4 ----
  /* AmiPhone!  by Jeremy Friesner - jfriesne@ucsd.edu */
+ /* :ts=4 */
  
  #define INTUI_V36_NAMES_ONLY
***************
*** 35,38 ****
--- 36,40 ----
  #include <errno.h>
  #include <inetd.h>
+ #include <sys/errno.h>
  
  #include <clib/alib_protos.h>
***************
*** 49,55 ****
  #include <pragmas/ahi_pragmas.h>
  
! #include "toccata/include/libraries/toccata.h"
! #include "toccata/include/clib/toccata_protos.h"
! #include "toccata/include/pragmas/toccata_pragmas.h"
  
  #include "phonerexx.h"
--- 51,59 ----
  #include <pragmas/ahi_pragmas.h>
  
! #include <libraries/toccata.h>
! #include <clib/toccata_protos.h>
! #include <pragmas/toccata_pragmas.h>
! 
! void kprintf(char *, ...);
  
  #include "phonerexx.h"
***************
*** 66,72 ****
  #include "stringrequest.h"
  #include "TCPQueue.h"
- #include "delfph.h"
- 
- #define EWOULDBLOCK     35
  
  #define IMAGE_QUIET	0
--- 70,73 ----
***************
*** 135,202 ****
  /* menus */
  struct NewMenu nmMenus[] = {
! 	NM_TITLE, "Project",         NULL,  0L,     	NULL, NULL,
! 	NM_ITEM,  "About",            "?",  0L,     	NULL, (void *) P_ABOUT,
! 	NM_ITEM,  NM_BARLABEL,       NULL,  0L,     	NULL, NULL,
! 	NM_ITEM,  "Quit",             "Q",  0L,     	NULL, (void *) P_QUIT,
! 	NM_TITLE, "TCP",             NULL,  0L,    	NULL, NULL,
! 	NM_ITEM,  "Connect To",      NULL,  0L,     	NULL, NULL,
! 	NM_SUB,   "",   	      "1",  0L,   	NULL, (void *) (T_CONNECTTO+0),
! 	NM_SUB,   "",		      "2",  0L,   	NULL, (void *) (T_CONNECTTO+1),
! 	NM_SUB,   "",   	      "3",  0L,   	NULL, (void *) (T_CONNECTTO+2),
! 	NM_SUB,   "",                 "4",  0L,   	NULL, (void *) (T_CONNECTTO+3),
! 	NM_SUB,   "",                 "5",  0L,   	NULL, (void *) (T_CONNECTTO+4),
! 	NM_SUB,   "",                 "6",  0L,   	NULL, (void *) (T_CONNECTTO+5),
! 	NM_SUB,   "",                 "7",  0L,   	NULL, (void *) (T_CONNECTTO+6),
! 	NM_SUB,   "",                 "8",  0L,   	NULL, (void *) (T_CONNECTTO+7),
! 	NM_SUB,   "",                 "9",  0L,   	NULL, (void *) (T_CONNECTTO+8),
! 	NM_SUB,   "",                 "0",  0L,   	NULL, (void *) (T_CONNECTTO+9),
! 	NM_ITEM,  "Connect",          "C",  0L,     	NULL, (void *) T_CONNECT,
! 	NM_ITEM,  "Disconnect",       "D",  0L,     	NULL, (void *) T_DISCONNECT,
! 	NM_ITEM,   "Show Daemon",     "S",  CHECKIT,    NULL, (void *) T_SHOWDAEMON,
! 	NM_TITLE, "Messages",	     NULL,  0L,         NULL, NULL,
! 	NM_ITEM,  "Messages...",      "M",  0L,         NULL, (void *) M_MESSAGES,
! 	NM_ITEM,  "Play Sound File",  "P",  0L,         NULL, (void *) M_PLAYFILE,
! 	NM_ITEM,  "Record Memo",      "W",  CHECKIT,    NULL, (void *) M_RECORDMEMO,
! 	NM_TITLE, "Settings",        NULL,  0L,     	NULL, NULL,
! 	NM_ITEM,  "Sampler",	     NULL,  0L,         NULL, NULL,
! 	NM_SUB,   "DSS8",	     NULL,  CHECKIT,    NULL, (void *) S_DSS8,
! 	NM_SUB,   "PerfectSound",    NULL,  CHECKIT,    NULL, (void *) S_PERFECTSOUND,
! 	NM_SUB,   "AMAS",	     NULL,  CHECKIT,    NULL, (void *) S_AMAS,
! 	NM_SUB,   "Sound Magic",     NULL,  CHECKIT,    NULL, (void *) S_SOMAGIC,
! 	NM_SUB,   "Toccata",         NULL,  CHECKIT,    NULL, (void *) S_TOCCATA,
! 	NM_SUB,   "Aura PCMCIA",     NULL,  CHECKIT,    NULL, (void *) S_AURA,
! 	NM_SUB,   "AHI Device",      NULL,  CHECKIT,    NULL, (void *) S_AHI,
! 	NM_SUB,   "Delfina",         NULL,  CHECKIT,    NULL, (void *) S_DELFINA,
! 	NM_SUB,   "Custom",	     NULL,  CHECKIT,    NULL, (void *) S_CUSTOM,
! 	NM_SUB,   "Generic",         NULL,  CHECKIT,    NULL, (void *) S_GENERIC,	
! 	NM_ITEM,  "Compression",     NULL,  0L,	        NULL, NULL,	
! 	NM_SUB,   "ADPCM2",           "U",  CHECKIT,    NULL, (void *) S_ADPCM2,
! 	NM_SUB,   "ADPCM3",           "I",  CHECKIT,    NULL, (void *) S_ADPCM3,
! 	NM_SUB,   "None",             "O",  CHECKIT,    NULL, (void *) S_NOCOMP,
! 	NM_ITEM,  "Transmit Enable", NULL,  0L,		NULL, NULL,	
! 	NM_SUB,   "Toggle",           "T",  CHECKIT,    NULL, (void *) S_TOGGLE,
! 	NM_SUB,   "Hold to Transmit", "H",  CHECKIT,    NULL, (void *) S_HOLD,
! 	NM_ITEM,  "Line Gain",       NULL,  0L,		NULL, NULL,	
! 	NM_SUB,   "Raise",            "]",  0L,    	NULL, (void *) S_RAISELINEGAIN,
! 	NM_SUB,   "Lower",            "[",  0L,    	NULL, (void *) S_LOWERLINEGAIN,
! 	NM_ITEM,  "Microphone Gain", NULL,  0L,		NULL, NULL,
! 	NM_SUB,   "+20 dB",           "}",  CHECKIT,   	NULL, (void *) S_TWENTYMICGAIN,
! 	NM_SUB,   "+0 dB",            "{",  CHECKIT,   	NULL, (void *) S_ZEROMICGAIN,	
! 	NM_ITEM,  "Digital Amplify", NULL,  0L,         NULL, NULL,
! 	NM_SUB,   "1X",	             NULL,  CHECKIT,    NULL, (void *) S_AMPONE,
! 	NM_SUB,   "2X",	             NULL,  CHECKIT,    NULL, (void *) S_AMPTWO,
! 	NM_SUB,   "4X",	             NULL,  CHECKIT,    NULL, (void *) S_AMPFOUR,
! 	NM_ITEM,  "Input Channel",   NULL,  0L,		NULL, NULL,		
! 	NM_SUB,   "Left",             "L",  CHECKIT,   	NULL, (void *) S_LEFTCHANNEL,
! 	NM_SUB,   "Right",            "R",  CHECKIT,   	NULL, (void *) S_RIGHTCHANNEL,
! 	NM_ITEM,  "Input Source",    NULL,  0L,		NULL, NULL,	
! 	NM_SUB,   "Microphone",       "-",  CHECKIT,   	NULL, (void *) S_INPUTMIC,
! 	NM_SUB,   "Line",             "=",  CHECKIT,   	NULL, (void *) S_INPUTEXT,
! 	NM_ITEM,  "Enable on Connect","X",  CHECKIT,    NULL, (void *) S_ENABLEONCONN,
! 	NM_ITEM,  "Xmit on Play",     "Y",  CHECKIT,    NULL, (void *) S_XMITONPLAY,
! 	NM_ITEM,  "TCP Batch Xmit",   "B",  CHECKIT,    NULL, (void *) S_TCPBATCHXMIT,
! 	NM_END,   NULL,		     NULL,  NULL,   	NULL, NULL
  };
  
  
  /* private functions */
--- 136,238 ----
  /* menus */
  struct NewMenu nmMenus[] = {
! 	NM_TITLE, "Project",		 NULL,	0L,			NULL, NULL,
! 	NM_ITEM,  "About",			  "?",	0L,			NULL, (void *) P_ABOUT,
! 	NM_ITEM,  NM_BARLABEL,		 NULL,	0L,			NULL, NULL,
! 	NM_ITEM,  "Quit",			  "Q",	0L,			NULL, (void *) P_QUIT,
! 	NM_TITLE, "TCP",			 NULL,	0L,			NULL, NULL,
! 	NM_ITEM,  "Connect To",		 NULL,	0L,			NULL, NULL,
! 	NM_SUB,	  "",				  "1",	0L,			NULL, (void *) (T_CONNECTTO+0),
! 	NM_SUB,	  "",				  "2",	0L,			NULL, (void *) (T_CONNECTTO+1),
! 	NM_SUB,	  "",				  "3",	0L,			NULL, (void *) (T_CONNECTTO+2),
! 	NM_SUB,	  "",				  "4",	0L,			NULL, (void *) (T_CONNECTTO+3),
! 	NM_SUB,	  "",				  "5",	0L,			NULL, (void *) (T_CONNECTTO+4),
! 	NM_SUB,	  "",				  "6",	0L,			NULL, (void *) (T_CONNECTTO+5),
! 	NM_SUB,	  "",				  "7",	0L,			NULL, (void *) (T_CONNECTTO+6),
! 	NM_SUB,	  "",				  "8",	0L,			NULL, (void *) (T_CONNECTTO+7),
! 	NM_SUB,	  "",				  "9",	0L,			NULL, (void *) (T_CONNECTTO+8),
! 	NM_SUB,	  "",				  "0",	0L,			NULL, (void *) (T_CONNECTTO+9),
! 	NM_ITEM,  "Connect",		  "C",	0L,			NULL, (void *) T_CONNECT,
! 	NM_ITEM,  "Disconnect",		  "D",	0L,			NULL, (void *) T_DISCONNECT,
! 	NM_ITEM,   "Show Daemon",	  "S",	CHECKIT,	NULL, (void *) T_SHOWDAEMON,
! 	NM_TITLE, "Messages",		 NULL,	0L,			NULL, NULL,
! 	NM_ITEM,  "Messages...",	  "M",	0L,			NULL, (void *) M_MESSAGES,
! 	NM_ITEM,  "Play Sound File",  "P",	0L,			NULL, (void *) M_PLAYFILE,
! 	NM_ITEM,  "Record Memo",	  "W",	CHECKIT,	NULL, (void *) M_RECORDMEMO,
! 	NM_TITLE, "Settings",		 NULL,	0L,			NULL, NULL,
! 	NM_ITEM,  "Sampler",		 NULL,	0L,			NULL, NULL,
! 	NM_SUB,	  "DSS8",			 NULL,	CHECKIT,	NULL, (void *) S_DSS8,
! 	NM_SUB,	  "PerfectSound",	 NULL,	CHECKIT,	NULL, (void *) S_PERFECTSOUND,
! 	NM_SUB,	  "AMAS",			 NULL,	CHECKIT,	NULL, (void *) S_AMAS,
! 	NM_SUB,	  "Sound Magic",	 NULL,	CHECKIT,	NULL, (void *) S_SOMAGIC,
! 	NM_SUB,	  "Toccata",		 NULL,	CHECKIT,	NULL, (void *) S_TOCCATA,
! 	NM_SUB,	  "Aura PCMCIA",	 NULL,	CHECKIT,	NULL, (void *) S_AURA,
! 	NM_SUB,	  "AHI Device",		 NULL,	CHECKIT,	NULL, (void *) S_AHI,
! 	NM_SUB,	  "Custom",			 NULL,	CHECKIT,	NULL, (void *) S_CUSTOM,
! 	NM_SUB,	  "Generic",		 NULL,	CHECKIT,	NULL, (void *) S_GENERIC,
! 	NM_SUB,	  NM_BARLABEL,		 NULL,	0L,			NULL, NULL,
! 	NM_SUB,	  "AHI Mode...",	 NULL,	0L,			NULL, (void *) S_AHIMODE,
! 
! 	NM_ITEM,  "Compression",	 NULL,	0L,			NULL, NULL, 
! 	NM_SUB,	  "ADPCM2",			  "U",	CHECKIT,	NULL, (void *) S_ADPCM2,
! 	NM_SUB,	  "ADPCM3",			  "I",	CHECKIT,	NULL, (void *) S_ADPCM3,
! 	NM_SUB,	  "None",			  "O",	CHECKIT,	NULL, (void *) S_NOCOMP,
! 	NM_ITEM,  "Transmit Enable", NULL,	0L,			NULL, NULL, 
! 	NM_SUB,	  "Toggle",			  "T",	CHECKIT,	NULL, (void *) S_TOGGLE,
! 	NM_SUB,	  "Hold to Transmit", "H",	CHECKIT,	NULL, (void *) S_HOLD,
! 	NM_ITEM,  "Line Gain",		 NULL,	0L,			NULL, NULL, 
! 	NM_SUB,	  "Raise",			  "]",	0L,			NULL, (void *) S_RAISELINEGAIN,
! 	NM_SUB,	  "Lower",			  "[",	0L,			NULL, (void *) S_LOWERLINEGAIN,
! 	NM_ITEM,  "Microphone Gain", NULL,	0L,			NULL, NULL,
! 	NM_SUB,	  "+20 dB",			  "}",	CHECKIT,	NULL, (void *) S_TWENTYMICGAIN,
! 	NM_SUB,	  "+0 dB",			  "{",	CHECKIT,	NULL, (void *) S_ZEROMICGAIN,	
! 	NM_ITEM,  "Digital Amplify", NULL,	0L,			NULL, NULL,
! 	NM_SUB,	  "1X",				 NULL,	CHECKIT,	NULL, (void *) S_AMPONE,
! 	NM_SUB,	  "2X",				 NULL,	CHECKIT,	NULL, (void *) S_AMPTWO,
! 	NM_SUB,	  "4X",				 NULL,	CHECKIT,	NULL, (void *) S_AMPFOUR,
! 	NM_ITEM,  "Input Channel",	 NULL,	0L,			NULL, NULL,		
! 	NM_SUB,	  "Left",			  "L",	CHECKIT,	NULL, (void *) S_LEFTCHANNEL,
! 	NM_SUB,	  "Right",			  "R",	CHECKIT,	NULL, (void *) S_RIGHTCHANNEL,
! 	NM_ITEM,  "Input Source",	 NULL,	0L,			NULL, NULL, 
! 	NM_SUB,	  "",		 		 "-",	CHECKIT,	NULL, (void *) S_INPUTSRC0,
! 	NM_SUB,	  "",				  "=",	CHECKIT,	NULL, (void *) S_INPUTSRC1,
! 	NM_SUB,	  "",				 NULL,	CHECKIT,	NULL, (void *) S_INPUTSRC2,
! 	NM_SUB,   "",				 NULL,	CHECKIT,	NULL, (void *) S_INPUTSRC3,
! 	NM_SUB,   "",				 NULL,	CHECKIT,	NULL, (void *) S_INPUTSRC4,
! 	NM_SUB,   "",				 NULL,	CHECKIT,	NULL, (void *) S_INPUTSRC5,
! 	NM_SUB,   "",				 NULL,	CHECKIT,	NULL, (void *) S_INPUTSRC6,
! 	NM_SUB,   "",				 NULL,	CHECKIT,	NULL, (void *) S_INPUTSRC7,
! 	NM_SUB,   "",				 NULL,	CHECKIT,	NULL, (void *) S_INPUTSRC8,
! 	NM_SUB,   "",				 NULL,	CHECKIT,	NULL, (void *) S_INPUTSRC9,
! 	NM_ITEM,  "Enable on Connect","X",	CHECKIT,	NULL, (void *) S_ENABLEONCONN,
! 	NM_ITEM,  "Xmit on Play",	  "Y",	CHECKIT,	NULL, (void *) S_XMITONPLAY,
! 	NM_ITEM,  "TCP Batch Xmit",	  "B",	CHECKIT,	NULL, (void *) S_TCPBATCHXMIT,
! 	NM_END,	  NULL,				 NULL,	NULL,		NULL, NULL
  };
  
+ /* inputs */
+ char input0[40] = "";
+ char input1[40] = "";
+ char input2[40] = "";
+ char input3[40] = "";
+ char input4[40] = "";
+ char input5[40] = "";
+ char input6[40] = "";
+ char input7[40] = "";
+ char input8[40] = "";
+ char input9[40] = "";
+ 
+ char *inputtxts[] =
+ {
+ 	input0,
+ 	input1,
+ 	input2,
+ 	input3,
+ 	input4,
+ 	input5,
+ 	input6,
+ 	input7,
+ 	input8,
+ 	input9,
+ };
  
  /* private functions */
***************
*** 215,219 ****
  
  /* private file-global data */
! static char [] = VERSION_STRING;
  static struct AmiPhoneInfo defMsg;
  static char szExitMessage[50] = "Error Initializing";
--- 251,255 ----
  
  /* private file-global data */
! static char my_version[] = AMIPHONE_VERSION;
  static struct AmiPhoneInfo defMsg;
  static char szExitMessage[50] = "Error Initializing";
***************
*** 224,228 ****
  static char * szPhoneFileName = NULL;
  static char szWinTitle[130] = "";
! static struct Gadget *glist=NULL, *gad=NULL, *freqslider=NULL, *volslider=NULL, *delayslider=NULL;
  static struct NewGadget ng;
  static struct MsgPort * AppWindowPort = NULL;
--- 260,264 ----
  static char * szPhoneFileName = NULL;
  static char szWinTitle[130] = "";
! static struct Gadget *glist=NULL, *gad=NULL, *volslider=NULL, *delayslider=NULL;
  static struct NewGadget ng;
  static struct MsgPort * AppWindowPort = NULL;
***************
*** 232,236 ****
  
  /* global vars */
! struct AmiPhoneInfo * daemonInfo = &defMsg;		
  
  /* AHI stuff? */
--- 268,275 ----
  
  /* global vars */
! struct AmiPhoneInfo * daemonInfo = &defMsg;
! struct Gadget *freqslider=NULL;
! 
! BOOL BUpdateMenus = TRUE;
  
  /* AHI stuff? */
***************
*** 247,251 ****
  struct Library * RexxSysBase   = NULL;
  struct Library * TimerBase     = NULL;
! struct Library * IntuitionBase = NULL;
  struct Library * SocketBase    = NULL;
  struct Library * GraphicsBase  = NULL;
--- 286,290 ----
  struct Library * RexxSysBase   = NULL;
  struct Library * TimerBase     = NULL;
! struct IntuitionBase * IntuitionBase = NULL;
  struct Library * SocketBase    = NULL;
  struct Library * GraphicsBase  = NULL;
***************
*** 255,259 ****
  struct Library * WorkbenchBase = NULL;
  struct Library * DiskFontBase  = NULL;
- extern struct Library * DelfinaBase;
  
  struct Library * MiscBase      = NULL;	/* this one not alloced with the others... */
--- 294,297 ----
***************
*** 299,302 ****
--- 337,341 ----
  char * pszCallNames[] = {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL};
  char * pszCallIPs[]   = {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL};
+ ULONG ulAHIMode = AHI_DEFAULT_ID;
  int windowtop=-1, windowleft=-1, nSendPri = 999, nReceivePri = 1, nToggleMode = TOGGLE_TOGGLE, nSampleTechnique = TECHNIQUE_HARDINT;
  ULONG ulSampleArraySize; 
***************
*** 327,336 ****
  extern struct IntInfo IntData;
  extern BYTE sighalf, sigfull;
! extern __chip unsigned short microphone_image[];
  extern UBYTE * pubAllocedArray, * pubRightBuffer;
  extern struct AmiPhonePacketHeader * TransmitPacket[2];
  extern LONG sTCPSocket;
! extern char szLastMemoFile[200] = "(unset)";
! extern int delfsig, nMicGainValue;
  
  /* Data to use after we get a CTRL-F from the Toccata Capture interrupt */
--- 366,375 ----
  extern struct IntInfo IntData;
  extern BYTE sighalf, sigfull;
! extern CHIP unsigned short microphone_image[];
  extern UBYTE * pubAllocedArray, * pubRightBuffer;
  extern struct AmiPhonePacketHeader * TransmitPacket[2];
  extern LONG sTCPSocket;
! extern char szLastMemoFile[200]; /* = "(unset)"; */
! extern int nMicGainValue;
  
  /* Data to use after we get a CTRL-F from the Toccata Capture interrupt */
***************
*** 363,368 ****
  BOOL UsesCIAInterrupt(void)
  {
! 	return((ubSamplerType != SAMPLER_DELFINA) &&
! 	       (ubSamplerType != SAMPLER_AHI) &&
  	       (ubSamplerType != SAMPLER_TOCCATA));
  }
--- 402,406 ----
  BOOL UsesCIAInterrupt(void)
  {
! 	return((ubSamplerType != SAMPLER_AHI) &&
  	       (ubSamplerType != SAMPLER_TOCCATA));
  }
***************
*** 377,381 ****
  	return((ubSamplerType == SAMPLER_PERFECT) ||
  	       (ubSamplerType == SAMPLER_TOCCATA) ||
- 	       (ubSamplerType == SAMPLER_DELFINA) ||
  	       (ubSamplerType == SAMPLER_GVPDSS8));
  }
--- 415,418 ----
***************
*** 383,388 ****
  BOOL CanAdjustMicGain(void)
  {
! 	return((ubSamplerType == SAMPLER_TOCCATA) ||
! 	       (ubSamplerType == SAMPLER_DELFINA));
  }
  
--- 420,424 ----
  BOOL CanAdjustMicGain(void)
  {
! 	return((ubSamplerType == SAMPLER_TOCCATA));
  }
  
***************
*** 391,396 ****
  	return((ubSamplerType == SAMPLER_SOMAGIC) ||
  	       (ubSamplerType == SAMPLER_CUSTOM)  ||
! 	       (ubSamplerType == SAMPLER_DELFINA) ||
! 	       (ubSamplerType == SAMPLER_TOCCATA));
  }
  
--- 427,432 ----
  	return((ubSamplerType == SAMPLER_SOMAGIC) ||
  	       (ubSamplerType == SAMPLER_CUSTOM)  ||
! 	       (ubSamplerType == SAMPLER_TOCCATA) ||
! 	       (ubSamplerType == SAMPLER_AHI));
  }
  
***************
*** 402,405 ****
--- 438,460 ----
  
  
+ LONG SAVEDS STDARGS FreqSliderFunc(struct Gadget *gadget, WORD level)
+ {
+ 
+ 	if((gadget != freqslider) || (AHIBase == NULL) || (ubSamplerType != SAMPLER_AHI))
+ 	{
+ 		return level;
+ 	}
+ 	else
+ 	{
+ 		ULONG freq = 0;
+ 		
+ 		AHI_GetAudioAttrs(ulAHIMode, NULL,
+ 			AHIDB_FrequencyArg,	level,
+ 			AHIDB_Frequency,	&freq,
+ 			TAG_DONE);
+ 
+ 		return freq;
+ 	}
+ }
  
  BOOL AllocSliders(BOOL BAlloc)
***************
*** 451,454 ****
--- 506,510 ----
  			GTSL_Level,		(WORD)ulBytesPerSecond,
  			GTSL_LevelFormat, 	szLevelString1,
+ 			GTSL_DispFunc,		FreqSliderFunc,
  			GTSL_LevelPlace,	PLACETEXT_RIGHT,
  			GTSL_MaxLevelLen,	7+(nMaxSampleRate >= 10000)+(BPropFont*2),
***************
*** 561,567 ****
  	if (strcmp(szParam,"AURA") == 0)    return(SAMPLER_AURA);
  
- 	/* Delfina board. */
- 	if ((DelfinaBase)&&(strcmp(szParam,"DELFINA") == 0)) return(SAMPLER_DELFINA);
- 
  	/* The AHI Device sound API */
  	if ((AHIBase)&&(strncmp(szParam,"AHI",3) == 0))  return(SAMPLER_AHI);
--- 617,620 ----
***************
*** 587,591 ****
  		case SAMPLER_SOMAGIC:	szType = "SOUNDMAGIC"; break;
  		case SAMPLER_AURA:	szType = "AURA";    break;
- 		case SAMPLER_DELFINA:	szType = "DELFINA"; break;
  		case SAMPLER_AHI:	szType = "AHI";	    break;
  	}
--- 640,643 ----
***************
*** 794,805 ****
--- 846,934 ----
  BOOL CreatePhoneMenus(BOOL BCreate)
  {   
+ 	struct NewMenu *newmenu;
+ 	ULONG inputs = 0;
+ 
  	void * VisualInfo = NULL;
  
  	if (BCreate == FALSE) 
  	{
+ 		if(PhoneWindow) ClearMenuStrip(PhoneWindow);
  		if (Menu) {FreeMenus(Menu); Menu = NULL;}
  		return(TRUE);
  	}
  
+ 	if(ubSamplerType == SAMPLER_AHI && AHIBase != NULL)
+ 	{
+ 		AHI_GetAudioAttrs(ulAHIMode, NULL,
+ 			AHIDB_Inputs,	&inputs,
+ 			TAG_DONE);
+ 	}
+ 	else
+ 	{
+ 		inputs = 2;
+ 	}
+ 
+ 	newmenu = nmMenus;
+ 
+ 
+ 	while(newmenu->nm_Type != NM_END)
+ 	{
+ 		int i;
+ 	
+ 
+ 		switch((ULONG) newmenu->nm_UserData)
+ 		{
+ 			case S_INPUTSRC0:
+ 			case S_INPUTSRC1:
+ 			case S_INPUTSRC2:
+ 			case S_INPUTSRC3:
+ 			case S_INPUTSRC4:
+ 			case S_INPUTSRC5:
+ 			case S_INPUTSRC6:
+ 			case S_INPUTSRC7:
+ 			case S_INPUTSRC8:
+ 			case S_INPUTSRC9:
+ 				i = ((ULONG) newmenu->nm_UserData - S_INPUTSRC0);
+ 				
+ 				if(i < inputs)
+ 				{
+ 					if(ubSamplerType == SAMPLER_AHI && AHIBase != NULL)
+ 					{
+ 						AHI_GetAudioAttrs(ulAHIMode, NULL,
+ 							AHIDB_BufferLen,	40,
+ 							AHIDB_InputArg,		i,
+ 							AHIDB_Input,		inputtxts[i],
+ 							TAG_DONE);
+ 						newmenu->nm_Label = inputtxts[i];
+ 					}
+ 					else
+ 					{
+ 						if(i == 0) newmenu->nm_Label = "Microphone";
+ 						else if(i == 1) newmenu->nm_Label = "Line";
+ 						else newmenu->nm_Label = "????";
+ 					}
+ 
+ 					newmenu->nm_Type  &= ~NM_IGNORE;
+ 					newmenu->nm_Flags &= ~NM_ITEMDISABLED;
+ 				}
+ 				else
+ 				{
+ 					newmenu->nm_Type  |= NM_IGNORE;
+ 					newmenu->nm_Label = "";
+ 					newmenu->nm_Flags |= NM_ITEMDISABLED;
+ 				}
+ 
+ 				if(i == 0 && inputs == 0)
+ 				{
+ 					newmenu->nm_Label = "None";
+ 					newmenu->nm_Type  &= ~NM_IGNORE;
+ 					newmenu->nm_Flags &= ~NM_ITEMDISABLED;
+ 				}
+ 
+ 				break;
+ 		}
+ 		newmenu++;
+ 	}
+ 
  	/* Create menus */
  	UNLESS(Menu = CreateMenus(nmMenus, TAG_DONE))
***************
*** 815,819 ****
  	}
  	
! 	if (LayoutMenus(Menu, VisualInfo, TAG_DONE))
  	{
  		SetMenuStrip(PhoneWindow, Menu);
--- 944,948 ----
  	}
  	
! 	if (LayoutMenus(Menu, VisualInfo, GTMN_NewLookMenus, TRUE, TAG_DONE))
  	{
  		SetMenuStrip(PhoneWindow, Menu);
***************
*** 826,829 ****
--- 955,961 ----
  	}
  	FreeVisualInfo(VisualInfo);
+ 
+ 	SetMenuValues();
+ 
  	return(TRUE);
  }
***************
*** 881,885 ****
  	const int diff = 'a' - 'A';
  
! 	UNLESS(sOldString) return();
  	
  	while (*i != '\0')
--- 1013,1017 ----
  	const int diff = 'a' - 'A';
  
! 	UNLESS(sOldString) return;
  	
  	while (*i != '\0')
***************
*** 897,901 ****
  	const int diff = 'a' - 'A';
  
! 	UNLESS(sOldString) return();
  	while (*i != '\0')
   	{
--- 1029,1033 ----
  	const int diff = 'a' - 'A';
  
! 	UNLESS(sOldString) return;
  	while (*i != '\0')
   	{
***************
*** 972,987 ****
  		  	UNCHECKSUB;
  		  }
- 	NEXTSUB;  if (DelfinaBase)
- 		  {
- 		  	ENABLESUB;
- 		  	if (ubSamplerType == SAMPLER_DELFINA) CHECKSUB; else UNCHECKSUB;
- 		  }
- 		  else
- 		  {
- 		  	DISABLESUB;
- 		  	UNCHECKSUB;
- 		  }
  	NEXTSUB;  if (ubSamplerType == SAMPLER_CUSTOM)  CHECKSUB; else UNCHECKSUB;
  	NEXTSUB;  if (ubSamplerType == SAMPLER_GENERIC) CHECKSUB; else UNCHECKSUB;
  
  	/* compression submenu */
--- 1104,1112 ----
  		  	UNCHECKSUB;
  		  }
  	NEXTSUB;  if (ubSamplerType == SAMPLER_CUSTOM)  CHECKSUB; else UNCHECKSUB;
  	NEXTSUB;  if (ubSamplerType == SAMPLER_GENERIC) CHECKSUB; else UNCHECKSUB;
+ 	NEXTSUB;  /* BARLABEL */
+ 	NEXTSUB;  if (ubSamplerType == SAMPLER_AHI) ENABLESUB; else DISABLESUB;
+ 
  
  	/* compression submenu */
***************
*** 1017,1022 ****
  	/* Input source submenu */
  	NEXTITEM; if (CanAdjustInputSource()) ENABLEITEM; else DISABLEITEM;
! 	FIRSTSUB; if (ubInputSource == INPUT_SOURCE_MIC) CHECKSUB; else UNCHECKSUB;
! 	NEXTSUB;  if (ubInputSource == INPUT_SOURCE_EXT) CHECKSUB; else UNCHECKSUB;
  	
  	/* Xmit on connect */
--- 1142,1152 ----
  	/* Input source submenu */
  	NEXTITEM; if (CanAdjustInputSource()) ENABLEITEM; else DISABLEITEM;
! 	FIRSTSUB; if (ubInputSource == INPUT_SOURCE_0) CHECKSUB; else UNCHECKSUB;
! 	for (i=1;i<10;i++) 
! 	{
! 		if(currentSub->NextItem == NULL) break;
! 
! 		NEXTSUB;  if (ubInputSource == i) CHECKSUB; else UNCHECKSUB;
! 	}
  	
  	/* Xmit on connect */
***************
*** 1149,1153 ****
  				{
  					case FREQ_SLIDER:
! 						/* everything is done below for us! */
  						break;
  						
--- 1279,1296 ----
  				{
  					case FREQ_SLIDER:
! 						if((AHIBase == NULL) || (ubSamplerType != SAMPLER_AHI))
! 						{
! 							/* everything is done below for us! */
! 						}
! 						else
! 						{
! 							LONG freq = 0;
! 
! 							AHI_GetAudioAttrs(ulAHIMode, NULL,
! 								AHIDB_FrequencyArg,	code,
! 								AHIDB_Frequency,	&freq,
! 								TAG_DONE);
! 							code = freq;
! 						}
  						break;
  						
***************
*** 1163,1168 ****
  						break;
  				}
! 				GT_SetGadgetAttrs(freqslider,PhoneWindow,NULL,GTSL_Level, 
! 				       ChangeSampleSpeed(code,ubCurrComp), TAG_END);
  				break;
  
--- 1306,1328 ----
  						break;
  				}
! 
! 				if((AHIBase == NULL) || (ubSamplerType != SAMPLER_AHI))
! 				{
! 					GT_SetGadgetAttrs(freqslider,PhoneWindow,NULL,GTSL_Level, 
! 					       ChangeSampleSpeed(code,ubCurrComp), TAG_END);
! 				}
! 				else
! 				{
! 					LONG index = 0;
! 
! 					AHI_GetAudioAttrs(ulAHIMode, NULL,
! 						AHIDB_IndexArg,	ChangeSampleSpeed(code,ubCurrComp),
! 						AHIDB_Index,	&index,
! 						TAG_DONE);
! 
! 					GT_SetGadgetAttrs(freqslider,PhoneWindow,NULL,GTSL_Level, 
! 					       index, TAG_END);
! 				}
! 
  				break;
  
***************
*** 1183,1187 ****
  			case IDCMP_CLOSEWINDOW: 
  				SetExitMessage("Window Closed",0);
! 				BProgramDone = TRUE;  
  				break;
  				
--- 1343,1347 ----
  			case IDCMP_CLOSEWINDOW: 
  				SetExitMessage("Window Closed",0);
! 				BProgramDone = TRUE;
  				break;
  				
***************
*** 1222,1225 ****
--- 1382,1436 ----
  					}
  				}
+ 				else if (ubSamplerType == SAMPLER_AHI)
+ 				{
+ 					LONG index = 0, freqs = 0, freq = 0;
+ 
+ 					AHI_GetAudioAttrs(ulAHIMode, NULL,
+ 						AHIDB_IndexArg,		ulBytesPerSecond,
+ 						AHIDB_Index,		&index,
+ 						AHIDB_Frequencies,	&freqs,
+ 						TAG_DONE);
+ 
+ 					if ((code == '.')||(code == '>'))
+ 					{
+ 						if(index < (freqs - 1))
+ 						{
+ 							index++;
+ 						}
+ 
+ 						AHI_GetAudioAttrs(ulAHIMode, NULL,
+ 							AHIDB_FrequencyArg,	index,
+ 							AHIDB_Frequency,	&freq,
+ 							TAG_DONE);
+ 
+ 
+ 						if(freq <= nMaxSampleRate)
+ 						{
+ 							ChangeSampleSpeed(freq, ubCurrComp);
+ 
+ 							GT_SetGadgetAttrs(freqslider,PhoneWindow,NULL,
+ 								GTSL_Level, index,
+ 								TAG_END);
+ 						}
+ 					}
+ 					if ((code == ',')||(code == '<'))
+ 					{
+ 						if(index > 0)
+ 						{
+ 							index--;
+ 						}
+ 
+ 						AHI_GetAudioAttrs(ulAHIMode, NULL,
+ 							AHIDB_FrequencyArg,	index,
+ 							AHIDB_Frequency,	&freq,
+ 							TAG_DONE);
+ 
+ 						ChangeSampleSpeed(freq, ubCurrComp);
+ 
+ 						GT_SetGadgetAttrs(freqslider,PhoneWindow,NULL,
+ 							GTSL_Level, index,
+ 							TAG_END);
+ 					}
+ 				}
  				else
  				{
***************
*** 1258,1262 ****
  						case M_RECORDMEMO:	StartRecording(fpMemo == NULL,NULL);break;
  						case S_DSS8:		ChangeSamplerType(SAMPLER_GVPDSS8); break;
! 						case S_PERFECTSOUND:	ChangeSamplerType(SAMPLER_PERFECT); break;
  						case S_AMAS:		ChangeSamplerType(SAMPLER_AMAS);    break;
  						case S_TOCCATA:		ChangeSamplerType(SAMPLER_TOCCATA); break;
--- 1469,1473 ----
  						case M_RECORDMEMO:	StartRecording(fpMemo == NULL,NULL);break;
  						case S_DSS8:		ChangeSamplerType(SAMPLER_GVPDSS8); break;
! 						case S_PERFECTSOUND:ChangeSamplerType(SAMPLER_PERFECT); break;
  						case S_AMAS:		ChangeSamplerType(SAMPLER_AMAS);    break;
  						case S_TOCCATA:		ChangeSamplerType(SAMPLER_TOCCATA); break;
***************
*** 1264,1270 ****
  						case S_GENERIC:		ChangeSamplerType(SAMPLER_GENERIC); break;
  						case S_AURA:		ChangeSamplerType(SAMPLER_AURA);    break;
! 						case S_AHI:		ChangeSamplerType(SAMPLER_AHI);     break;
! 						case S_DELFINA:		ChangeSamplerType(SAMPLER_DELFINA); break;
  						case S_SOMAGIC:		ChangeSamplerType(SAMPLER_SOMAGIC); break;
  						case S_ADPCM2:		ChangeCompressMode(COMPRESS_ADPCM2);break;
  						case S_ADPCM3:		ChangeCompressMode(COMPRESS_ADPCM3);break;
--- 1475,1481 ----
  						case S_GENERIC:		ChangeSamplerType(SAMPLER_GENERIC); break;
  						case S_AURA:		ChangeSamplerType(SAMPLER_AURA);    break;
! 						case S_AHI:			ChangeSamplerType(SAMPLER_AHI);     break;
  						case S_SOMAGIC:		ChangeSamplerType(SAMPLER_SOMAGIC); break;
+ 						case S_AHIMODE:		ChangeAHIMode();					break;
  						case S_ADPCM2:		ChangeCompressMode(COMPRESS_ADPCM2);break;
  						case S_ADPCM3:		ChangeCompressMode(COMPRESS_ADPCM3);break;
***************
*** 1272,1281 ****
  						case S_TOGGLE:		nToggleMode = TOGGLE_TOGGLE;    break;
  						case S_HOLD:		nToggleMode = TOGGLE_HOLD; ToggleMicButton(CODE_OFF); break;
! 						case S_ENABLEONCONN:	BEnableOnConnect = Not[BEnableOnConnect];	   break;
  						case S_XMITONPLAY:	BXmitOnPlay      = Not[BXmitOnPlay];	   break;
! 						case S_TCPBATCHXMIT:	BTCPBatchXmit    = Not[BTCPBatchXmit]; break;
! 						case S_RAISELINEGAIN:	RaiseLineGain(1);		     break;
! 						case S_LOWERLINEGAIN:	RaiseLineGain(-1);	   	     break;
! 						case S_TWENTYMICGAIN:   SetMicGain(20);			     break;
  						case S_ZEROMICGAIN:	SetMicGain(0);			     break;
  						case S_AMPONE:		nAmpShift = 0; IntData.ulShiftLeft = 0L; break;
--- 1483,1492 ----
  						case S_TOGGLE:		nToggleMode = TOGGLE_TOGGLE;    break;
  						case S_HOLD:		nToggleMode = TOGGLE_HOLD; ToggleMicButton(CODE_OFF); break;
! 						case S_ENABLEONCONN:BEnableOnConnect = Not[BEnableOnConnect];	   break;
  						case S_XMITONPLAY:	BXmitOnPlay      = Not[BXmitOnPlay];	   break;
! 						case S_TCPBATCHXMIT:BTCPBatchXmit    = Not[BTCPBatchXmit]; break;
! 						case S_RAISELINEGAIN:RaiseLineGain(1);		     break;
! 						case S_LOWERLINEGAIN:RaiseLineGain(-1);	   	     break;
! 						case S_TWENTYMICGAIN:SetMicGain(20);		     break;
  						case S_ZEROMICGAIN:	SetMicGain(0);			     break;
  						case S_AMPONE:		nAmpShift = 0; IntData.ulShiftLeft = 0L; break;
***************
*** 1283,1289 ****
  						case S_AMPFOUR:		nAmpShift = 2; IntData.ulShiftLeft = 2L; break;
  						case S_LEFTCHANNEL:	ChangeInputChannel(INPUT_JACK_LEFT); break;
! 						case S_RIGHTCHANNEL:	ChangeInputChannel(INPUT_JACK_RIGHT); break;
! 						case S_INPUTMIC:        ChangeInputSource(INPUT_SOURCE_MIC,TRUE); break;
! 						case S_INPUTEXT:        ChangeInputSource(INPUT_SOURCE_EXT,TRUE); break;
  						default: 		
  							if ((ulItemCode >= T_CONNECTTO)&&(ulItemCode <= T_CONNECTTO+9))
--- 1494,1508 ----
  						case S_AMPFOUR:		nAmpShift = 2; IntData.ulShiftLeft = 2L; break;
  						case S_LEFTCHANNEL:	ChangeInputChannel(INPUT_JACK_LEFT); break;
! 						case S_RIGHTCHANNEL:ChangeInputChannel(INPUT_JACK_RIGHT); break;
! 						case S_INPUTSRC0:
! 						case S_INPUTSRC1:
! 						case S_INPUTSRC2:
! 						case S_INPUTSRC3:
! 						case S_INPUTSRC4:
! 						case S_INPUTSRC5:
! 						case S_INPUTSRC6:
! 						case S_INPUTSRC7:
! 						case S_INPUTSRC8:
! 						case S_INPUTSRC9:   ChangeInputSource(ulItemCode-S_INPUTSRC0,TRUE); break;
  						default: 		
  							if ((ulItemCode >= T_CONNECTTO)&&(ulItemCode <= T_CONNECTTO+9))
***************
*** 1297,1300 ****
--- 1516,1520 ----
  					code = (message == fakeMessage) ? MENUNULL : mItem->NextSelect;
  				}
+ 
  				SetMenuValues();
  				break;
***************
*** 1326,1329 ****
--- 1546,1561 ----
  		message = (struct IntuiMessage *)GT_GetIMsg(PhoneWindow->UserPort);
  	}
+ 
+     if(BUpdateMenus)
+     {
+         BUpdateMenus = FALSE;
+         CreatePhoneMenus(FALSE);
+         UNLESS(CreatePhoneMenus(TRUE))
+         {
+     		SetExitMessage("Couldn't Create Menus!",RETURN_ERROR);
+     		BProgramDone = TRUE;
+         }
+     }
+ 
  	return(BProgramDone);
  }
***************
*** 1350,1355 ****
  		RexxSysBase   = OpenLibrary("rexxsyslib.library", 36L);
  		
- 		InitDelfina();	/* On success of this function, DelfinaBase is set to non-NULL */
- 		
  		AllocAHI(TRUE);
  	}
--- 1582,1585 ----
***************
*** 1357,1361 ****
  	{
  		AllocAHI(FALSE);
- 		if (DelfinaBase)	 CleanupDelfina();
  		if (ToccataBase)	 CloseLibrary(ToccataBase);
  		if (WorkbenchBase)	 CloseLibrary(WorkbenchBase);
--- 1587,1590 ----
***************
*** 1514,1524 ****
  		Forbid();
  		while(amsg = (struct AppMessage *) GetMsg(AppWindowPort)) ReplyMsg(amsg);
! 	 	Permit();
!  		DeleteMsgPort(AppWindowPort);
!  	}
!  	
! 	if (PhoneWindow) CloseWindow(PhoneWindow);
! 	
  	CreatePhoneMenus(FALSE);		
  	AllocSliders(FALSE);	
  	if (Scr) UnlockPubScreen(NULL,Scr);
--- 1743,1757 ----
  		Forbid();
  		while(amsg = (struct AppMessage *) GetMsg(AppWindowPort)) ReplyMsg(amsg);
! 		Permit();
! 		DeleteMsgPort(AppWindowPort);
! 	}
! 
  	CreatePhoneMenus(FALSE);		
+ 
+ 	if (PhoneWindow)
+ 	{
+ 		CloseWindow(PhoneWindow);
+ 	}
+ 	
  	AllocSliders(FALSE);	
  	if (Scr) UnlockPubScreen(NULL,Scr);
***************
*** 1531,1535 ****
  	{
  		if (pszCallNames[i]) FreeMem(pszCallNames[i],strlen(pszCallNames[i])+1);
! 		if (pszCallIPs[i])   FreeMem(pszCallIPs[i],  strlen(pszCallIPs[i])  +1);
  
  	}
--- 1764,1768 ----
  	{
  		if (pszCallNames[i]) FreeMem(pszCallNames[i],strlen(pszCallNames[i])+1);
! 		if (pszCallIPs[i])	 FreeMem(pszCallIPs[i],	 strlen(pszCallIPs[i])	+1);
  
  	}
***************
*** 1546,1550 ****
  LONG ChopValue(LONG ulVal, LONG ulLow, LONG ulHigh)
  {
! 	if (ulVal < ulLow)  ulVal = ulLow;
  	if (ulVal > ulHigh) ulVal = ulHigh;
  	return(ulVal);
--- 1779,1783 ----
  LONG ChopValue(LONG ulVal, LONG ulLow, LONG ulHigh)
  {
! 	if (ulVal < ulLow)	ulVal = ulLow;
  	if (ulVal > ulHigh) ulVal = ulHigh;
  	return(ulVal);
***************
*** 1661,1672 ****
  	if (GetPhoneArg("SAMPLERATE", &nParam, &szParam))    ulBytesPerSecond = ChopValue(nParam,MIN_SAMPLE_RATE,nMaxSampleRate);
  	if (GetPhoneArg("SAMPLER", &nParam, &szParam))       ubSamplerType    = ParseSamplerType(szParam);
  	if (GetPhoneArg("INPUTCHANNEL", &nParam, &szParam))  ubInputChannel   = ParseInputChannel(szParam);
  	if (GetPhoneArg("VOICEMAILDIR", &nParam, &szParam))  Strncpy(szVoiceMailDir,szParam,sizeof(szVoiceMailDir));
!         if (GetPhoneArg("INPUTSOURCE",&nParam,&szParam))
!         {
!         	if (*szParam == 'M') ubInputSource = INPUT_SOURCE_MIC;
!         	if (*szParam == 'L') ubInputSource = INPUT_SOURCE_EXT;
!         }
!         else if (ubSamplerType == SAMPLER_TOCCATA)
  	{
  		/* Try to get current input source setting from Toccata prefs */
--- 1894,1907 ----
  	if (GetPhoneArg("SAMPLERATE", &nParam, &szParam))    ulBytesPerSecond = ChopValue(nParam,MIN_SAMPLE_RATE,nMaxSampleRate);
  	if (GetPhoneArg("SAMPLER", &nParam, &szParam))       ubSamplerType    = ParseSamplerType(szParam);
+ 	if (GetPhoneArg("AHIMODE", &nParam, &szParam))       ulAHIMode        = nParam;
  	if (GetPhoneArg("INPUTCHANNEL", &nParam, &szParam))  ubInputChannel   = ParseInputChannel(szParam);
  	if (GetPhoneArg("VOICEMAILDIR", &nParam, &szParam))  Strncpy(szVoiceMailDir,szParam,sizeof(szVoiceMailDir));
!     if (GetPhoneArg("INPUTSOURCE",&nParam,&szParam))
!     {
!     	if (*szParam == 'M') ubInputSource = INPUT_SOURCE_MIC;
!     	else if (*szParam == 'L') ubInputSource = INPUT_SOURCE_EXT;
!     	else ubInputSource = ChopValue(nParam,0,255);
!     }
!     else if (ubSamplerType == SAMPLER_TOCCATA)
  	{
  		/* Try to get current input source setting from Toccata prefs */
***************
*** 1678,1688 ****
  		T_GetPart(taglist);
  		ubInputSource = (lInputSource == TINPUT_Mic) ? INPUT_SOURCE_MIC : INPUT_SOURCE_EXT;
!         }
!         if (GetPhoneArg("AMPLIFY",&nParam,&szParam))
!         {
!         	if (*szParam == '1') nAmpShift = 0;
!         	if (*szParam == '2') nAmpShift = 1;
!         	if (*szParam == '4') nAmpShift = 2;
!         }
  
  	BSuccess = GetPhoneArg("PUBSCREEN", &nParam, &szParam);
--- 1913,1923 ----
  		T_GetPart(taglist);
  		ubInputSource = (lInputSource == TINPUT_Mic) ? INPUT_SOURCE_MIC : INPUT_SOURCE_EXT;
!     }
!     if (GetPhoneArg("AMPLIFY",&nParam,&szParam))
!     {
!     	if (*szParam == '1') nAmpShift = 0;
!     	if (*szParam == '2') nAmpShift = 1;
!     	if (*szParam == '4') nAmpShift = 2;
!     }
  
  	BSuccess = GetPhoneArg("PUBSCREEN", &nParam, &szParam);
***************
*** 1842,1891 ****
  
  	BReturn = ((0==strcmp(szBuf,"TOP"))  		||
! 		  (0==strcmp(szBuf,"LEFT")) 		||
! 		  (0==strcmp(szBuf,"KEY"))  		||
! 	 	  (0==strcmp(szBuf,"PUBSCREEN")) 	||
  	 	  (0==strcmp(szBuf,"THRESHVOLUME")) 	||
   	          (0==strcmp(szBuf,"MINVOLUME")) 	||
! 	 	  (0==strcmp(szBuf,"XMITDELAY")) 	||
  	 	  (0==strcmp(szBuf,"PACKETINTERVAL")) 	||
! 	 	  (0==strcmp(szBuf,"SAMPLERATE")) 	||
  	 	  (0==strcmp(szBuf,"ENABLEONCONNECT")) 	||
  	 	  (0==strcmp(szBuf,"XMITONCONNECT")) 	||
!   	 	  (0==strcmp(szBuf,"XMITONPLAY")) 	||
    	 	  (0==strcmp(szBuf,"TCPBATCHXMIT")) 	||
! 	 	  (0==strcmp(szBuf,"SENDPRI")) 		||
! 	 	  (0==strcmp(szBuf,"RECEIVEPRI")) 	||
  	 	  (0==strcmp(szBuf,"HOLDTOTRANSMIT")) 	||
! 	 	  (0==strcmp(szBuf,"COMPRESS")) 	||
  	 	  (0==strcmp(szBuf,"MAXBANDWIDTH")) 	||
! 	 	  (0==strcmp(szBuf,"CONNECT")) 		||
  	 	  (0==strcmp(szBuf,"SAMPLETECHNIQUE")) 	||
  	 	  (0==strcmp(szBuf,"MAXSAMPLERATE")) 	||
  	 	  (0==strcmp(szBuf,"INPUTCHANNEL")) 	||
! 	 	  (0==strcmp(szBuf,"SAMPLER")) 		||
  	 	  (0==strcmp(szBuf,"VOICEMAILDIR")) 	||
  	 	  (0==strcmp(szBuf,"INPUTSOURCE"))      ||
  	 	  (0==strcmp(szBuf,"AMPLIFY"))          ||
! 	 	  (0==strcmp(szBuf,"PUBSCREEN"))	||
  	 	  (0==strcmp(szBuf,"PUBLICSCREEN"))     ||
  	 	  (0==strcmp(szBuf,"CUSTSTARTBITS"))    ||
! 		  (0==strcmp(szBuf,"CUSTDIRBITS")) 	||
! 		  (0==strcmp(szBuf,"CUSTLEFTBITS"))	||
  		  (0==strcmp(szBuf,"CUSTRIGHTBITS"))	||
! 		  (0==strcmp(szBuf,"CUSTEXTBITS"))	||
! 		  (0==strcmp(szBuf,"CUSTSTOPBITS"))	||
! 		  (0==strcmp(szBuf,"MAXXMITDELAY"))	||
! 		  (0==strcmp(szBuf,"MICGAIN"))		||
! 		  (0==strcmp(szBuf,"LINEGAIN"))		||
! 		  (0==strcmp(szBuf,"IDLERATE"))		||
! 		  (0==strncmp(szBuf,"PHONEBOOK",9))	||
  		  (0==strcmp(szBuf,"CUSTSAMPLEADDRESS"))||
  		  (0==strcmp(szBuf,"MAXVOLBYTECOUNT"))  ||
! 		  (0==strcmp(szBuf,"HACKAMPVOL"))  	||
! 		  (0==strcmp(szBuf,"DEBUG"))  		||
! 		  (0==strcmp(szBuf,"FONT"))  		||
! 		  (0==strcmp(szBuf,"FONTSIZE"))  	||
! 		  (0==strcmp(szBuf,"PRESEND"))  	||
! 		  (0==strcmp(szBuf,"POSTSEND"))  	||
  		  (0==strcmp(szBuf,"CUSTMICBITS")));
  
--- 2077,2127 ----
  
  	BReturn = ((0==strcmp(szBuf,"TOP"))  		||
! 		  (0==strcmp(szBuf,"LEFT"))				||
! 		  (0==strcmp(szBuf,"KEY"))				||
! 	 	  (0==strcmp(szBuf,"PUBSCREEN"))		||
  	 	  (0==strcmp(szBuf,"THRESHVOLUME")) 	||
   	          (0==strcmp(szBuf,"MINVOLUME")) 	||
! 	 	  (0==strcmp(szBuf,"XMITDELAY"))		||
  	 	  (0==strcmp(szBuf,"PACKETINTERVAL")) 	||
! 	 	  (0==strcmp(szBuf,"SAMPLERATE"))		||
  	 	  (0==strcmp(szBuf,"ENABLEONCONNECT")) 	||
  	 	  (0==strcmp(szBuf,"XMITONCONNECT")) 	||
!   	 	  (0==strcmp(szBuf,"XMITONPLAY"))		||
    	 	  (0==strcmp(szBuf,"TCPBATCHXMIT")) 	||
! 	 	  (0==strcmp(szBuf,"SENDPRI"))			||
! 	 	  (0==strcmp(szBuf,"RECEIVEPRI"))		||
  	 	  (0==strcmp(szBuf,"HOLDTOTRANSMIT")) 	||
! 	 	  (0==strcmp(szBuf,"COMPRESS"))			||
  	 	  (0==strcmp(szBuf,"MAXBANDWIDTH")) 	||
! 	 	  (0==strcmp(szBuf,"CONNECT"))			||
  	 	  (0==strcmp(szBuf,"SAMPLETECHNIQUE")) 	||
  	 	  (0==strcmp(szBuf,"MAXSAMPLERATE")) 	||
  	 	  (0==strcmp(szBuf,"INPUTCHANNEL")) 	||
! 	 	  (0==strcmp(szBuf,"SAMPLER"))			||
! 	 	  (0==strcmp(szBuf,"AHIMODE"))			||
  	 	  (0==strcmp(szBuf,"VOICEMAILDIR")) 	||
  	 	  (0==strcmp(szBuf,"INPUTSOURCE"))      ||
  	 	  (0==strcmp(szBuf,"AMPLIFY"))          ||
! 	 	  (0==strcmp(szBuf,"PUBSCREEN"))		||
  	 	  (0==strcmp(szBuf,"PUBLICSCREEN"))     ||
  	 	  (0==strcmp(szBuf,"CUSTSTARTBITS"))    ||
! 		  (0==strcmp(szBuf,"CUSTDIRBITS")) 		||
! 		  (0==strcmp(szBuf,"CUSTLEFTBITS"))		||
  		  (0==strcmp(szBuf,"CUSTRIGHTBITS"))	||
! 		  (0==strcmp(szBuf,"CUSTEXTBITS"))		||
! 		  (0==strcmp(szBuf,"CUSTSTOPBITS"))		||
! 		  (0==strcmp(szBuf,"MAXXMITDELAY"))		||
! 		  (0==strcmp(szBuf,"MICGAIN"))			||
! 		  (0==strcmp(szBuf,"LINEGAIN"))			||
! 		  (0==strcmp(szBuf,"IDLERATE"))			||
! 		  (0==strncmp(szBuf,"PHONEBOOK",9))		||
  		  (0==strcmp(szBuf,"CUSTSAMPLEADDRESS"))||
  		  (0==strcmp(szBuf,"MAXVOLBYTECOUNT"))  ||
! 		  (0==strcmp(szBuf,"HACKAMPVOL"))  		||
! 		  (0==strcmp(szBuf,"DEBUG"))  			||
! 		  (0==strcmp(szBuf,"FONT"))  			||
! 		  (0==strcmp(szBuf,"FONTSIZE"))  		||
! 		  (0==strcmp(szBuf,"PRESEND"))  		||
! 		  (0==strcmp(szBuf,"POSTSEND"))  		||
  		  (0==strcmp(szBuf,"CUSTMICBITS")));
  
***************
*** 2138,2142 ****
  
  /* This is where the Graphics Daemon starts executing at! */
! __geta4 void GraphicsTaskMain(void)
  {
  	/* Global data to be used by the graphics daemon ONLY */
--- 2374,2378 ----
  
  /* This is where the Graphics Daemon starts executing at! */
! void SAVEDS GraphicsTaskMain(void)
  {
  	/* Global data to be used by the graphics daemon ONLY */
***************
*** 2357,2361 ****
    	 ((AHImp = CreateMsgPort()) && 
    	  (AHIio = (struct AHIRequest *)CreateIORequest(AHImp,sizeof(struct AHIRequest))) &&
!   	  (AHIio->ahir_Version = 1) &&
    	  ((AHIDevice = OpenDevice(AHINAME,AHI_NO_UNIT,(struct IORequest *)AHIio,0L)) == 0))
    	{
--- 2593,2597 ----
    	 ((AHImp = CreateMsgPort()) && 
    	  (AHIio = (struct AHIRequest *)CreateIORequest(AHImp,sizeof(struct AHIRequest))) &&
!   	  (AHIio->ahir_Version = 4) &&
    	  ((AHIDevice = OpenDevice(AHINAME,AHI_NO_UNIT,(struct IORequest *)AHIio,0L)) == 0))
    	{
***************
*** 2477,2486 ****
  	UWORD wZoomCoords[4];
  
- 	/* Put this to a known state of non-allocation! */
- 	DelfinaBase = NULL;
- 		
  	if ((BStartedFromWB == FALSE)&&(largc == 2)&&(*largv[1] == '?'))
  	{
! 		printf("Template:  AmiPhone PEERNAME/A,TOP/K/N,LEFT/K/N,PUBSCREEN/K,COMPRESS/K,CONNECT/K,THRESHVOLUME/K/N,SAMPLERATE/K/N,XMITDELAY/K/N,MAXBANDWIDTH/K/N,SAMPLETECHNIQUE/K,MAXXMITDELAY/K/N,MAXSAMPLERATE/K/N,SAMPLER/K,VOICEMAILDIR/K,AMPLIFY/K/N,INPUTSOURCE/K,PHONEBOOKx/K,MICGAIN/K/N,IDLERATE/K/N,ENABLEONCONNECT/S,XMITONPLAY/S,HOLDTOTRANSMIT/S,TCPBATCHXMIT/S,INVERTWAVEFORM/S\n");
  		exit(0);
  	}	
--- 2713,2726 ----
  	UWORD wZoomCoords[4];
  
  	if ((BStartedFromWB == FALSE)&&(largc == 2)&&(*largv[1] == '?'))
  	{
! 		printf("Template:  AmiPhone"
! 		       "PEERNAME/A,TOP/K/N,LEFT/K/N,PUBSCREEN/K,COMPRESS/K,CONNECT/K,"
! 		       "THRESHVOLUME/K/N,SAMPLERATE/K/N,XMITDELAY/K/N,MAXBANDWIDTH/K/N,"
! 		       "SAMPLETECHNIQUE/K,MAXXMITDELAY/K/N,MAXSAMPLERATE/K/N,SAMPLER/K,"
! 		       "AHIMODE/K/N,"
! 		       "VOICEMAILDIR/K,AMPLIFY/K/N,INPUTSOURCE/K,PHONEBOOKx/K,MICGAIN/K/N,"
! 		       "IDLERATE/K/N,ENABLEONCONNECT/S,XMITONPLAY/S,HOLDTOTRANSMIT/S,"
! 		       "TCPBATCHXMIT/S,INVERTWAVEFORM/S\n");
  		exit(0);
  	}	
***************
*** 2577,2581 ****
  	        		  		IDCMP_MOUSEBUTTONS|SLIDERIDCMP|IDCMP_VANILLAKEY|IDCMP_NEWSIZE,
  	        WA_Flags,       WFLG_SIZEBBOTTOM|WFLG_SMART_REFRESH|WFLG_ACTIVATE|
! 	        		 		/*WFLG_NEWLOOKMENUS|*/WFLG_CLOSEGADGET|WFLG_DRAGBAR|
  	        				WFLG_DEPTHGADGET,
  	        WA_Gadgets,	glist,
--- 2817,2821 ----
  	        		  		IDCMP_MOUSEBUTTONS|SLIDERIDCMP|IDCMP_VANILLAKEY|IDCMP_NEWSIZE,
  	        WA_Flags,       WFLG_SIZEBBOTTOM|WFLG_SMART_REFRESH|WFLG_ACTIVATE|
! 	        		 		WFLG_NEWLOOKMENUS|WFLG_CLOSEGADGET|WFLG_DRAGBAR|
  	        				WFLG_DEPTHGADGET,
  	        WA_Gadgets,	glist,
***************
*** 2631,2636 ****
  			   (1L << SoundTaskPort->mp_SigBit)	    |
  		   	   (AppWindowPort ? (1L<<AppWindowPort->mp_SigBit) : 0)  |
! 			   (rexxHost ? (1L<<rexxHost->port->mp_SigBit) : 0) 	 |
! 			   (DelfinaBase ? delfsig : 0));
  
  	/* Fill out our message to the graphics daemon */
--- 2871,2875 ----
  			   (1L << SoundTaskPort->mp_SigBit)	    |
  		   	   (AppWindowPort ? (1L<<AppWindowPort->mp_SigBit) : 0)  |
! 			   (rexxHost ? (1L<<rexxHost->port->mp_SigBit) : 0) );
  
  	/* Fill out our message to the graphics daemon */
***************
*** 2661,2664 ****
--- 2900,2906 ----
  	}
  
+ 	ChangeSamplerType(ubSamplerType);
+     SetMenuValues();
+ 
  	/* Main loop */
  	while (BProgramDone == FALSE) 
***************
*** 2669,2682 ****
  		if (signal & (1<<sigfull)) TransmitData(pubRightBuffer,  ALL_OF_BUFFER, ubCurrComp);  /* send right buffer */ 
  
- 		if ((DelfinaBase)&&(signal & delfsig))
- 		{
- 			int nBytesAfterComp = ulSampleArraySize;
- 			
- 			if (ubCurrComp == COMPRESS_ADPCM2) nBytesAfterComp >>= 2;
- 			if (ubCurrComp == COMPRESS_ADPCM3) nBytesAfterComp = (nBytesAfterComp * 3)>>3;
- 
- 			TransmitData(pubAllocedArray, nBytesAfterComp, ubCurrComp);
- 		}
- 				
  		if ((signal & SIGBREAKF_CTRL_F)&&((ubSamplerType == SAMPLER_TOCCATA)||(ubSamplerType == SAMPLER_AHI)))
  		{
--- 2911,2914 ----
Only in ../AmiPhone_1.92: amiphone.c.info
diff -r -C 2 -P ../AmiPhone_1.92/amiphone.guide ./amiphone.guide
*** ../AmiPhone_1.92/amiphone.guide	Sat Nov 16 23:46:44 1996
--- ./amiphone.guide	Fri Mar 13 00:25:23 1998
***************
*** 6,10 ****
  @node Main "Contents"
  
! @{"AmiPhone" link Introduction} @{"V1.92" link History} by @{"Jeremy Friesner" link Me}
  
  AmiPhone is a program that allows you to have a voice conversation
--- 6,17 ----
  @node Main "Contents"
  
! @{"AmiPhone" link Introduction} @{"V1.93" link History} by @{"Jeremy Friesner" link Me}
! 
! (This version by Martin Blom, <lcs@lysator.liu.se>. DISCLAIMER: This is
! just a quick AHI fix. I am not going to maintain this program, and I'm
! not interested in bug reports. The 1.92 source is on Aminet, and my patches
! should come with this file. And please don't bother Jeremy with bug reports
! either, I'm sure he has other things to do.)
! 
  
  AmiPhone is a program that allows you to have a voice conversation
***************
*** 12,16 ****
  and an 8 bit parallel port digitizer and microphone.
  
! NOTE:  AmiPhone 1.92 is not compatible with AmiPhone 1.41ß or lower!  
         Make sure anyone you connect to has the latest version installed!
         
--- 19,23 ----
  and an 8 bit parallel port digitizer and microphone.
  
! NOTE:  AmiPhone 1.93 is not compatible with AmiPhone 1.41ß or lower!  
         Make sure anyone you connect to has the latest version installed!
         
***************
*** 92,96 ****
  @node Credits
  
!                             @{b}@{u}AmiPhone V1.92@{uu}@{ub}
  
                        Created by @{"Jeremy Friesner" link Me}
--- 99,103 ----
  @node Credits
  
!                             @{b}@{u}AmiPhone V1.93@{uu}@{ub}
  
                        Created by @{"Jeremy Friesner" link Me}
***************
*** 102,106 ****
           Interrupt handlers assembled with PhxAss by Frank Wille
  
!                    Delfina DSP coding by Teemu Suikki
  @endnode
  
--- 109,113 ----
           Interrupt handlers assembled with PhxAss by Frank Wille
  
!                     Additional AHI code my Martin Blom
  @endnode
  
***************
*** 252,258 ****
  asl.library		37 	in LIBS:, required to use File Requesters
  toccata.library		6       in LIBS:, required to use Toccata digitizer
- delfina.library		2	in LIBS:, required to use Delfina digitizer
  timer.device		?	in ROM, required
! ahi.device              ?       in DEVS:, required to use AHI
  @endnode
  
--- 259,264 ----
  asl.library		37 	in LIBS:, required to use File Requesters
  toccata.library		6       in LIBS:, required to use Toccata digitizer
  timer.device		?	in ROM, required
! ahi.device              4       in DEVS:, required to use AHI
  @endnode
  
***************
*** 611,614 ****
--- 617,621 ----
     @{"PLAYFILE" link playfile}		Play a sound file.
     @{"QUIT" link quit}			Exit AmiPhone
+    @{"SETAHIMODE" link setahimode}	        Set the AHI audio mode.
     @{"SETCOMPRESSION" link setcompression}	Choose a compression algorithm.
     @{"SETENABLEONCONNECT" link setenableonconnect}	Set Enable on Connect menu item.
***************
*** 830,834 ****
  			  hardware:  "GVPDSS8", "CUSTOM", "PERFECTSOUND",
  			  "TOCCATA", "AMAS", "GENERIC", "SOUNDMAGIC", 
! 			  "DELFINA", "AURA", or "AHI".
  	compression	- The currently selected compression algorithm:
  			  "ADPCM2", "ADPCM3", or "NONE".
--- 837,841 ----
  			  hardware:  "GVPDSS8", "CUSTOM", "PERFECTSOUND",
  			  "TOCCATA", "AMAS", "GENERIC", "SOUNDMAGIC", 
! 			  "AURA", or "AHI".
  	compression	- The currently selected compression algorithm:
  			  "ADPCM2", "ADPCM3", or "NONE".
***************
*** 836,843 ****
  			  "HOLD" or "TOGGLE".
  	inputgain	- The current input gain value (0-8 for DSS8,
! 			  0-15 for the Toccata or Delfina).
  	amplify		- The current digital amplify value (1, 2, or 4).
  	inputchannel	- The current input channel.  "LEFT" or "RIGHT".
! 	inputsource	- The current input source.  "MIC" or "LINE".
  	enableonconnect	- 1 if @{"Enable On Connect" link EnableOnConnect} is checked, else 0.
  	xmitonplay	- 1 if @{"Xmit on Play" link XmitOnPlay} is checked, else 0.
--- 843,850 ----
  			  "HOLD" or "TOGGLE".
  	inputgain	- The current input gain value (0-8 for DSS8,
! 			  0-15 for the Toccata).
  	amplify		- The current digital amplify value (1, 2, or 4).
  	inputchannel	- The current input channel.  "LEFT" or "RIGHT".
! 	inputsource	- The current input source.  "MIC", "LINE" or a number (AHI).
  	enableonconnect	- 1 if @{"Enable On Connect" link EnableOnConnect} is checked, else 0.
  	xmitonplay	- 1 if @{"Xmit on Play" link XmitOnPlay} is checked, else 0.
***************
*** 970,973 ****
--- 977,1002 ----
  
  
+ @node setahimode
+ 
+ 	SETAHIMODE
+ 
+ 	Arguments
+ 	---------
+ 	MODE
+ 
+ 	Effect/Description
+ 	------------------
+ 	Sets the current AHI audio mode to MODE.
+ 
+ 	Return Values
+ 	-------------
+ 	Returns 1.
+ 
+ 	Example
+ 	-------
+ 	SETAHIMODE 131079
+ 
+ @endnode
+ 
  @node setcompression
  
***************
*** 1077,1081 ****
  	------------------
  	Sets the input gain.  This currently only has an effect for
! 	the DSS8, PERFECTSOUND, DELFINA, or TOCCATA samplers.  If the 
  	RELATIVE switch is specified, the input gain will be changed 
  	by GAIN, otherwise it will be set to GAIN.
--- 1106,1110 ----
  	------------------
  	Sets the input gain.  This currently only has an effect for
! 	the DSS8, PERFECTSOUND or TOCCATA samplers.  If the 
  	RELATIVE switch is specified, the input gain will be changed 
  	by GAIN, otherwise it will be set to GAIN.
***************
*** 1103,1107 ****
  	Arguments
  	---------
! 	[MIC] [LINE]
  
  	Effect/Description
--- 1132,1136 ----
  	Arguments
  	---------
! 	[MIC] [LINE] [
  
  	Effect/Description
***************
*** 1117,1120 ****
--- 1146,1151 ----
  	-------
  	SETINPUTSOURCE MIC
+ 	SETINPUTSOURCE 0
+ 
  
  @endnode
***************
*** 1129,1133 ****
  	---------
  	[DSS8] [PERFECTSOUND] [AMAS] [SOUNDMAGIC] [TOCCATA] [AURA] 
! 	[DELFINA] [AHI] [CUSTOM] [GENERIC]
  
  	Effect/Description
--- 1160,1164 ----
  	---------
  	[DSS8] [PERFECTSOUND] [AMAS] [SOUNDMAGIC] [TOCCATA] [AURA] 
! 	[AHI] [CUSTOM] [GENERIC]
  
  	Effect/Description
***************
*** 1573,1584 ****
  Template:  AmiPhone PEERNAME/A, TOP/K/N, LEFT/K/N, COMPRESS/K, PUBSCREEN/K,
                      CONNECT/K, THRESHVOLUME/K/N, XMITDELAY/K/N, FONT/K,
!                     FONTSIZE/K, SAMPLERATE/K/N, MAXBANDWIDTH/K/N, SENDPRI/K/N, 
                      RECEIVEPRI/K/N, MAXSAMPLERATE/K/N, MAXXMITDELAY/K/N,
!                     SAMPLER/K, INPUTCHANNEL/K, VOICEMAILDIR/K, AMPLIFY/K/N, 
                      INPUTSOURCE/K, PHONEBOOKx/K, MICGAIN/K/N, LINEGAIN/K/N,
!                     IDLERATE/K/N, PRESEND/K/N, POSTSEND/K/N, XMITONPLAY/S, 
!                     ENABLEONCONNECT/S, HOLDTOTRANSMIT/S, BATCHTCPXMIT/S, 
!                     INVERTWAVEFORM/S
  		                        
  	@{"AMPLIFY/K/N" link AmplifyArg}       Specify a digital signal amplification value
  	@{"BATCHTCPXMIT/S" link TCPBatchXmitArg}    Send whole sentences at once over slow links
--- 1604,1616 ----
  Template:  AmiPhone PEERNAME/A, TOP/K/N, LEFT/K/N, COMPRESS/K, PUBSCREEN/K,
                      CONNECT/K, THRESHVOLUME/K/N, XMITDELAY/K/N, FONT/K,
!                     FONTSIZE/K, SAMPLERATE/K/N, MAXBANDWIDTH/K/N, SENDPRI/K/N,
                      RECEIVEPRI/K/N, MAXSAMPLERATE/K/N, MAXXMITDELAY/K/N,
!                     SAMPLER/K, AHIMODE/K/N, INPUTCHANNEL/K, VOICEMAILDIR/K,
                      INPUTSOURCE/K, PHONEBOOKx/K, MICGAIN/K/N, LINEGAIN/K/N,
!                     AMPLIFY/K/N, IDLERATE/K/N, PRESEND/K/N, POSTSEND/K/N,
!                     XMITONPLAY/S, ENABLEONCONNECT/S, HOLDTOTRANSMIT/S,
!                     BATCHTCPXMIT/S, INVERTWAVEFORM/S
  		                        
+ 	@{"AHIMODE/K" link AHIModeArg}         Inform AmiPhone as to what audio mode you like
  	@{"AMPLIFY/K/N" link AmplifyArg}       Specify a digital signal amplification value
  	@{"BATCHTCPXMIT/S" link TCPBatchXmitArg}    Send whole sentences at once over slow links
***************
*** 1700,1704 ****
         otherwise used with parallel port based samplers.  Thus,
         PreSend is most useful when used with non-Parallel-port
!        based samplers such as the Toccata or Delfina.  For 
         parallel-port based samplers, try raising the @{"idle rate" link IdleRateArg}
         before resorting to using this argument.
--- 1732,1736 ----
         otherwise used with parallel port based samplers.  Thus,
         PreSend is most useful when used with non-Parallel-port
!        based samplers such as the Toccata.  For 
         parallel-port based samplers, try raising the @{"idle rate" link IdleRateArg}
         before resorting to using this argument.
***************
*** 1766,1771 ****
  This startup argument allows you to set AmiPhone to use a given
  hardware microphone amplification level for the audio being digitized.  
! Microphone gain is supported on two digitizers--the Toccata and the
! Delfina.  It can be set to either +20dB (the default), or +0dB.
  
  Usage Example:
--- 1798,1803 ----
  This startup argument allows you to set AmiPhone to use a given
  hardware microphone amplification level for the audio being digitized.  
! Microphone gain is supported on two digitizers--the Toccata.  It can be set
! to either +20dB (the default), or +0dB.
  
  Usage Example:
***************
*** 1796,1803 ****
    	 Example:  AmiPhone SAMPLER=TOCCATA LINEGAIN=9
    
-   DELFINA - Gain levels range from 0 to 15.
- 
-   	 Example:  AmiPhone SAMPLER=DELFINA LINEGAIN=14
-   	    	 	   
    PERFECTSOUND - This digitizer has a way to change the current
    		 amplification by a given amount, but no known
--- 1828,1831 ----
***************
*** 1952,1955 ****
--- 1980,1995 ----
  
  
+ @node AHIModeArg
+ 
+ With this argument, you can let AmiPhone know which audio mode
+ you'd like to use when using an AHI sampler. The argument
+ is the desired audio mode, in decimal.
+ 
+ Usage Example:
+ 
+ AmiPhone SAMPLER=AHI AHIMODE=131079 INPUTSOURCE=0
+ 
+ @endnode
+ 
  @node SamplerArg
  
***************
*** 1975,1981 ****
    	Set this to use the Toccata Zorro II sound card as a sampler.
  
-   DELFINA
-   	Set this to use the Delfina Zorro II sound card as a sampler.
-   
    AURA
    	Set this to use the Aura PCMCIA card as a sampler.
--- 2015,2018 ----
***************
*** 1989,1995 ****
    AHI
    	Set this to use the AHI audio library as an interface
!   	to your sampler.  (Beware:  AHI support is COMPLETELY untested
!   	right now!)
!   	
    CUSTOM
          This setting allows you to set technical details of the 
--- 2026,2031 ----
    AHI
    	Set this to use the AHI audio library as an interface
!   	to your sampler.
! 
    CUSTOM
          This setting allows you to set technical details of the 
***************
*** 2043,2047 ****
  
  Note that this will only work with digitizers that connect to the 
! parallel port (so don't try it with your Delfina, Toccata or AHI board).
  
  Most parallel port digitizers use three binary switches to control
--- 2079,2083 ----
  
  Note that this will only work with digitizers that connect to the 
! parallel port (so don't try it with your Toccata or AHI board).
  
  Most parallel port digitizers use three binary switches to control
***************
*** 2155,2159 ****
  @node InputSourceArg
  
! Certain digitizers (to be exact, the Sound Magic, Delfina and 
  Toccata digitizers) have multiple sound input jacks.  This 
  startup argument allows you to set the default jack to receive 
--- 2191,2195 ----
  @node InputSourceArg
  
! Certain digitizers (to be exact, the Sound Magic and 
  Toccata digitizers) have multiple sound input jacks.  This 
  startup argument allows you to set the default jack to receive 
***************
*** 2168,2171 ****
--- 2204,2211 ----
  AmiPhone INPUTSOURCE=LINE
  
+ or
+ 
+ AmiPhone SAMPLER=AHI AHIMODE=131079 INPUTSOURCE=0
+ 
  @endnode
  
***************
*** 2551,2559 ****
  Line Gain - This submenu allows you to raise and lower the gain of the
              sound signal entering the digitizer.  This menu currently
!             only works with the DSS8, Delfina, Toccata and PerfectSound 
              digitizers.
  
  Mic Gain - This submenu allows you to set or unset the +20dB microphone
! 	   gain that is available on the Toccata and Delfina samplers.
  
  Digital Amplify - This submenu lets you @{"digitally amplify" link DigitalAmplification} the input
--- 2591,2599 ----
  Line Gain - This submenu allows you to raise and lower the gain of the
              sound signal entering the digitizer.  This menu currently
!             only works with the DSS8, Toccata and PerfectSound 
              digitizers.
  
  Mic Gain - This submenu allows you to set or unset the +20dB microphone
! 	   gain that is available on the Toccata sampler.
  
  Digital Amplify - This submenu lets you @{"digitally amplify" link DigitalAmplification} the input
***************
*** 2567,2572 ****
  Input Source - This submenu lets you choose which input jack to sample
                 from--either the microphone jack or the line-level jack.
!                This submenu is only applicable to the Toccata, Delfina, 
!                and Sound Magic digitizers.
                 
  Enable on Connect - If this is checked, you will begin transmission of 
--- 2607,2612 ----
  Input Source - This submenu lets you choose which input jack to sample
                 from--either the microphone jack or the line-level jack.
!                This submenu is only applicable to the Toccata and Sound
!                Magic digitizers.
                 
  Enable on Connect - If this is checked, you will begin transmission of 
***************
*** 2637,2641 ****
  the signal coming from the microphone is a little bit soft.  You have
  to talk loudly into the microphone to be heard clearly.  For some 
! digitizers, such as the DSS8, PerfectSound, Delfina, or Toccata, you 
  can use the @{"Mic" link MicGainArg} or {"Line" link LineGainArg} Gain startup arguments or @{"menu items" link SettingsMenu} to fix this problem.
  However, other brands of sampler either do not support this, or do
--- 2677,2681 ----
  the signal coming from the microphone is a little bit soft.  You have
  to talk loudly into the microphone to be heard clearly.  For some 
! digitizers, such as the DSS8, PerfectSound or Toccata, you 
  can use the @{"Mic" link MicGainArg} or {"Line" link LineGainArg} Gain startup arguments or @{"menu items" link SettingsMenu} to fix this problem.
  However, other brands of sampler either do not support this, or do
***************
*** 2740,2747 ****
      has been tested successfully with the DSS8+, PerfectSound 3, 
      Sound Magic, and several homemade samplers.  AmiPhone also supports 
!     the Delfina and Toccata Zorro II sound boards, as well as the Aura 
      PCMCIA sound card for digitizing purposes, and the AHI sound card 
!     interface library.  The AHI implementation is untested, so it 
!     probably doesn't work, though.
  
  Q:  But I don't have any sampler!
--- 2780,2786 ----
      has been tested successfully with the DSS8+, PerfectSound 3, 
      Sound Magic, and several homemade samplers.  AmiPhone also supports 
!     the Toccata Zorro II sound board, as well as the Aura 
      PCMCIA sound card for digitizing purposes, and the AHI sound card 
!     interface library.
  
  Q:  But I don't have any sampler!
***************
*** 2823,2828 ****
  ( "-" = new feature, "*" = bug fix)
  
! 1.93 :
! ND   - Add menu item to toggle the VOICEMAIL env var
  
  1.92 : (Public Release 07/07/96)
--- 2862,2878 ----
  ( "-" = new feature, "*" = bug fix)
  
! 1.93 : (Public Release 1998-03-13)
! 
!      The 1.93 changes by Martin Blom:
! 
!      - Recompiled using SAS/C 6.58.
!      * Removed the Delfina support (it didn't work anymore).
!      - New-Look menus.
!      - The AHI audio mode is now selectable.
!      - Input can be selected in AHI mode.
!      * Removed some debug code.
!      - Added Fredrik Rambris installer script (supports Miami).
!        (I hope you don't mind, Fredrik---your mail address is not
!        valid anymore.)
  
  1.92 : (Public Release 07/07/96)
***************
*** 3217,3221 ****
  @node Knownproblems "Known Bugs and Other Problems"
  
! Here are the things that still don't work right with AmiPhone V1.91:
  
  - There are occasional skipped or repeated packets.
--- 3267,3271 ----
  @node Knownproblems "Known Bugs and Other Problems"
  
! Here are the things that still don't work right with AmiPhone V1.93:
  
  - There are occasional skipped or repeated packets.
***************
*** 3224,3229 ****
    be read from the stream, their memory is not freed.  (This may
    be an AmiTCP problem, actually)
- 
- - The AHI interface is not tested and probably doesn't work.
  
  - The Toccata support may be broken again.  If you want it working
--- 3274,3277 ----
Only in ../AmiPhone_1.92: amiphone.guide.info
diff -r -C 2 -P ../AmiPhone_1.92/amiphone.h ./amiphone.h
*** ../AmiPhone_1.92/amiphone.h	Sat Nov 16 23:46:40 1996
--- ./amiphone.h	Mon Feb 16 04:06:05 1998
***************
*** 4,7 ****
--- 4,18 ----
  #define AMIPHONE_H
  
+ #include <CompilerSpecific.h>
+ 
+ #ifdef __SASC
+   #pragma msg 85 ignore
+   #pragma msg 104 ignore
+   #pragma msg 225 ignore
+ #endif
+ 
+ 
+ 
+ 
  #define ALL_OF_BUFFER -1
  #define MAXPEERNAMELENGTH 100
***************
*** 19,23 ****
  #define SAMPLER_SOMAGIC 5
  #define SAMPLER_AURA    6
! #define SAMPLER_DELFINA 7
  #define SAMPLER_CUSTOM  8
  #define SAMPLER_AHI     9
--- 30,34 ----
  #define SAMPLER_SOMAGIC 5
  #define SAMPLER_AURA    6
! /* #define SAMPLER_DELFINA 7 */
  #define SAMPLER_CUSTOM  8
  #define SAMPLER_AHI     9
***************
*** 39,42 ****
--- 50,63 ----
  #define INPUT_SOURCE_MIC 0
  #define INPUT_SOURCE_EXT 1
+ #define INPUT_SOURCE_0   0
+ #define INPUT_SOURCE_1   1
+ #define INPUT_SOURCE_2   2
+ #define INPUT_SOURCE_3   3
+ #define INPUT_SOURCE_4   4
+ #define INPUT_SOURCE_5   5
+ #define INPUT_SOURCE_6   6
+ #define INPUT_SOURCE_7   7
+ #define INPUT_SOURCE_8   8
+ #define INPUT_SOURCE_9   9
  
  /* different methods of selecting sampling */
***************
*** 85,89 ****
  void ChangeVolumeThreshold(int nNewPercentage);
  
! __geta4 void GraphicsTaskMain(void);
  
  /* Functions in the graphics subtask */
--- 106,110 ----
  void ChangeVolumeThreshold(int nNewPercentage);
  
! void SAVEDS GraphicsTaskMain(void);
  
  /* Functions in the graphics subtask */
diff -r -C 2 -P ../AmiPhone_1.92/amiphoned.c ./amiphoned.c
*** ../AmiPhone_1.92/amiphoned.c	Sat Nov 16 23:46:40 1996
--- ./amiphoned.c	Fri Mar  6 00:21:40 1998
***************
*** 1,4 ****
! #define DICE_C
  
  #include <stdio.h>
  #include <stdlib.h>
--- 1,5 ----
! /* :ts=4 */
  
+ #include <netinclude:sys/types.h>
  #include <stdio.h>
  #include <stdlib.h>
***************
*** 83,87 ****
  
  /* Why does this come out as 18 unless I define it explicitely here?  Weird! */
! #define EWOULDBLOCK 35
  
  /* private functions */
--- 84,88 ----
  
  /* Why does this come out as 18 unless I define it explicitely here?  Weird! */
! /* #define EWOULDBLOCK 35*/
  
  /* private functions */
***************
*** 128,132 ****
  
  /* private vars for this module */
! static char [] = VERSION_STRING;
  static char * szRelayName[10] = {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL};
  static LONG   sRelayUDPSocket[10]= {-1  ,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1};
--- 129,133 ----
  
  /* private vars for this module */
! static char my_version[] = AMIPHONED_VERSION;
  static char * szRelayName[10] = {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL};
  static LONG   sRelayUDPSocket[10]= {-1  ,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1};
***************
*** 827,831 ****
  	}
  	
! 	if (LayoutMenus(Menu, VisualInfo, TAG_DONE))
  	{
  		/* Update the menus */
--- 828,832 ----
  	}
  	
! 	if (LayoutMenus(Menu, VisualInfo, GTMN_NewLookMenus, TRUE, TAG_DONE))
  	{
  		/* Update the menus */
***************
*** 851,855 ****
  	const int diff = 'a' - 'A';
  
! 	if (sOldString == NULL) return();
   	while (*i != '\0')
   	{
--- 852,856 ----
  	const int diff = 'a' - 'A';
  
! 	if (sOldString == NULL) return;
   	while (*i != '\0')
   	{
***************
*** 1278,1282 ****
  	}
  
! 	if (FD_ISSET(sUDPSocket, &fsReadSet))    
  	{
  		ReceiveUDPPacket(&recBuffer);
--- 1279,1283 ----
  	}
  
! 	if (sUDPSocket != -1 && FD_ISSET(sUDPSocket, &fsReadSet))    
  	{
  		ReceiveUDPPacket(&recBuffer);
***************
*** 1284,1294 ****
  	}
  
! 	if (FD_ISSET(sTCPSocket, &fsWriteSet)) ReduceTCPQueue(CLIENT_TCP_QUEUE, sTCPSocket);
! 	if (FD_ISSET(sTCPSocket, &fsReadSet))  ReceiveTCPPacket();
  	
  	for (i=0;i<10;i++) 
  	{
! 		if (FD_ISSET(sRelayTCPSocket[i],&fsReadSet)) HandleRelayResponse(i);
! 		if (FD_ISSET(sRelayTCPSocket[i],&fsWriteSet)) ReduceTCPQueue(i, sRelayTCPSocket[i]);
  	}
  	
--- 1285,1301 ----
  	}
  
!     if(sTCPSocket != -1)
!     {
!     	if (FD_ISSET(sTCPSocket, &fsWriteSet)) ReduceTCPQueue(CLIENT_TCP_QUEUE, sTCPSocket);
! 	    if (FD_ISSET(sTCPSocket, &fsReadSet))  ReceiveTCPPacket();
!     }
  	
  	for (i=0;i<10;i++) 
  	{
! 	    if(sRelayTCPSocket[i] != -1)
! 	    {
!     		if (FD_ISSET(sRelayTCPSocket[i],&fsReadSet)) HandleRelayResponse(i);
! 	    	if (FD_ISSET(sRelayTCPSocket[i],&fsWriteSet)) ReduceTCPQueue(i, sRelayTCPSocket[i]);
! 	    }
  	}
  	
***************
*** 1329,1333 ****
  	fprintf(fpDebug,"sin_family   =%d\n",psaSock->sin_family);
  	fprintf(fpDebug,"sin_port     =%d\n",psaSock->sin_port);
! 	fprintf(fpDebug,"sin_sin_addr =%d\n",(ULONG)(psaSock->sin_addr));
  	fprintf(fpDebug,"sin_zero     = %i %i %i %i %i %i %i %i\n",
  			psaSock->sin_zero[0],
--- 1336,1340 ----
  	fprintf(fpDebug,"sin_family   =%d\n",psaSock->sin_family);
  	fprintf(fpDebug,"sin_port     =%d\n",psaSock->sin_port);
! 	fprintf(fpDebug,"sin_sin_addr =%d\n",(ULONG)(psaSock->sin_addr.s_addr));
  	fprintf(fpDebug,"sin_zero     = %i %i %i %i %i %i %i %i\n",
  			psaSock->sin_zero[0],
***************
*** 1476,1480 ****
  	const int diff = 'a' - 'A';
  
! 	UNLESS(sOldString) return();
  	
  	while (*i != '\0')
--- 1483,1487 ----
  	const int diff = 'a' - 'A';
  
! 	UNLESS(sOldString) return;
  	
  	while (*i != '\0')
***************
*** 2022,2026 ****
  	BPTR MyLock = Lock(szDirectory, ACCESS_READ);
  	LONG ulBlocksFree;
! 	__aligned struct InfoData MyData;
  	
  	if (MyLock == 0)
--- 2029,2033 ----
  	BPTR MyLock = Lock(szDirectory, ACCESS_READ);
  	LONG ulBlocksFree;
! 	ALIGNED struct InfoData MyData;
  	
  	if (MyLock == 0)
***************
*** 2100,2104 ****
  	struct ExAllControl * eac;
  	struct ExAllData * ead;
! 	__aligned UBYTE EAData[sizeof(struct ExAllData)*30];
  	
  	if (MyLock == 0) 
--- 2107,2111 ----
  	struct ExAllControl * eac;
  	struct ExAllData * ead;
! 	ALIGNED UBYTE EAData[sizeof(struct ExAllData)*30];
  	
  	if (MyLock == 0) 
Only in ../AmiPhone_1.92: amiphoned.c.info
diff -r -C 2 -P ../AmiPhone_1.92/amiphonepacket.h ./amiphonepacket.h
*** ../AmiPhone_1.92/amiphonepacket.h	Sat Nov 16 23:46:40 1996
--- ./amiphonepacket.h	Tue Mar  3 19:49:35 1998
***************
*** 4,12 ****
  /* Current Version number for both AmiPhone and AmiPhoned */
  /* Make sure ALL THREE of these #define lines are in-sync! */
! #define VERSION_NUMBER 		192
  #ifdef DEBUG_FLAG
! #define VERSION_STRING 	"$VER: 1.92D"
  #else
! #define VERSION_STRING 	"$VER: 1.92"
  #endif
  
--- 4,14 ----
  /* Current Version number for both AmiPhone and AmiPhoned */
  /* Make sure ALL THREE of these #define lines are in-sync! */
! #define VERSION_NUMBER 		193
  #ifdef DEBUG_FLAG
! #define AMIPHONE_VERSION 	"$VER: AmiPhone 1.93D " __AMIGADATE__ "\r\n"
! #define AMIPHONED_VERSION 	"$VER: AmiPhoned 1.93D " __AMIGADATE__ "\r\n"
  #else
! #define AMIPHONE_VERSION 	"$VER: AmiPhone 1.93 " __AMIGADATE__ "\r\n"
! #define AMIPHONED_VERSION 	"$VER: AmiPhoned 1.93 " __AMIGADATE__ "\r\n"
  #endif
  
diff -r -C 2 -P ../AmiPhone_1.92/asl.c ./asl.c
*** ../AmiPhone_1.92/asl.c	Sat Nov 16 23:46:40 1996
--- ./asl.c	Sun Feb 15 23:04:17 1998
***************
*** 1,3 ****
--- 1,4 ----
  /* asl.c -- function for getting filenames */
+ /* :ts=4 */
  
  #ifndef ASL_C
***************
*** 34,57 ****
  	if (szDefaultDirParam == NULL) 	szDefaultDir  = szDefaultDefaultDir; else szDefaultDir = szDefaultDirParam;
  	if (szDefaultFile == NULL) 	szDefaultFile = "";
!        
! 	struct TagItem frtags[] =
! 	{
! 		ASL_Hail,	(ULONG)szMessage,
  		ASL_Height,	185,
! 		ASL_Width,	320,
! 		ASL_LeftEdge,	0,
  		ASL_TopEdge,	15,
! 		ASL_Dir,        (ULONG)szDefaultDir,
! 		ASL_File,       (ULONG)szDefaultFile,
  		ASL_OKText,	(ULONG)szOKMessage,
! 		ASL_FuncFlags,  lFlags,
! 		ASL_CancelText,	(ULONG)"Cancel",
  		ASL_Window,	PhoneWindow,
! 		TAG_DONE
! 	};
! 	
! 	fr = (struct FileRequester *) AllocAslRequest(ASL_FileRequest, frtags);	
! 	if (fr == NULL) return(FALSE);
! 	
  /*	SetPointer(PhoneWindow, (UWORD *)waitPointer, 16, 16, -6, 0); */
  	if (AslRequest(fr, NULL))
--- 35,55 ----
  	if (szDefaultDirParam == NULL) 	szDefaultDir  = szDefaultDefaultDir; else szDefaultDir = szDefaultDirParam;
  	if (szDefaultFile == NULL) 	szDefaultFile = "";
! 
! 	fr = (struct FileRequester *) AllocAslRequestTags(ASL_FileRequest,
! 	  ASL_Hail,	(ULONG)szMessage,
  		ASL_Height,	185,
!   	ASL_Width,	320,
! 	  ASL_LeftEdge,	0,
  		ASL_TopEdge,	15,
!   	ASL_Dir,        (ULONG)szDefaultDir,
! 	  ASL_File,       (ULONG)szDefaultFile,
  		ASL_OKText,	(ULONG)szOKMessage,
!   	ASL_FuncFlags,  lFlags,
! 	  ASL_CancelText,	(ULONG)"Cancel",
  		ASL_Window,	PhoneWindow,
!   	TAG_DONE);	
! 
!   if (fr == NULL) return(FALSE);
! 
  /*	SetPointer(PhoneWindow, (UWORD *)waitPointer, 16, 16, -6, 0); */
  	if (AslRequest(fr, NULL))
Only in ../AmiPhone_1.92: bin
diff -r -C 2 -P ../AmiPhone_1.92/browse.c ./browse.c
*** ../AmiPhone_1.92/browse.c	Sat Nov 16 23:46:38 1996
--- ./browse.c	Mon Feb 16 01:15:51 1998
***************
*** 1,7 ****
--- 1,9 ----
  /* Module for the voice mail browser window */
+ /* :ts=4 */
  
  #ifndef BROWSE_C
  #define BROWSE_C
  
+ #include <netinclude:sys/types.h>
  #include <stdio.h>
  
***************
*** 62,66 ****
  /* private data */
  static struct GfxBase * GfxBase       = NULL;
! static struct Library * IntuitionBase = NULL;
  static struct Library * GadToolsBase  = NULL;
  static struct List    * FileList      = NULL;
--- 64,68 ----
  /* private data */
  static struct GfxBase * GfxBase       = NULL;
! static struct IntuitionBase * IntuitionBase = NULL;
  static struct Library * GadToolsBase  = NULL;
  static struct List    * FileList      = NULL;
***************
*** 197,201 ****
  	struct ExAllControl * eac;
  	struct ExAllData * ead;
! 	__aligned UBYTE EAData[sizeof(struct ExAllData)*30];
  	struct List * FileList = NULL;
  	struct Node * newnode;
--- 199,203 ----
  	struct ExAllControl * eac;
  	struct ExAllData * ead;
! 	ALIGNED UBYTE EAData[sizeof(struct ExAllData)*30];
  	struct List * FileList = NULL;
  	struct Node * newnode;
***************
*** 628,632 ****
  
  
! __geta4 void BrowserMain(void)
  {	
  	ULONG ulBrowseMask = SIGBREAKF_CTRL_C, ulSignals;
--- 630,634 ----
  
  
! SAVEDS void BrowserMain(void)
  {	
  	ULONG ulBrowseMask = SIGBREAKF_CTRL_C, ulSignals;
***************
*** 678,682 ****
  	        WA_IDCMP,       IDCMP_REFRESHWINDOW|IDCMP_CLOSEWINDOW|SLIDERIDCMP|IDCMP_NEWSIZE,
  	        WA_Flags,       WFLG_SIZEBBOTTOM|WFLG_SMART_REFRESH|WFLG_ACTIVATE|
! 	        		/*WFLG_NEWLOOKMENUS|*/WFLG_CLOSEGADGET|WFLG_DRAGBAR|
  	        		WFLG_DEPTHGADGET,
  	        WA_Gadgets,	glist,
--- 680,684 ----
  	        WA_IDCMP,       IDCMP_REFRESHWINDOW|IDCMP_CLOSEWINDOW|SLIDERIDCMP|IDCMP_NEWSIZE,
  	        WA_Flags,       WFLG_SIZEBBOTTOM|WFLG_SMART_REFRESH|WFLG_ACTIVATE|
! 	        		WFLG_NEWLOOKMENUS|WFLG_CLOSEGADGET|WFLG_DRAGBAR|
  	        		WFLG_DEPTHGADGET,
  	        WA_Gadgets,	glist,
Only in ../AmiPhone_1.92: browse.c.info
diff -r -C 2 -P ../AmiPhone_1.92/browse.h ./browse.h
*** ../AmiPhone_1.92/browse.h	Sat Nov 16 23:46:40 1996
--- ./browse.h	Sun Feb 15 13:25:08 1998
***************
*** 3,7 ****
  #define BROWSE_H
  
! __geta4 void BrowserMain(void);
  
  void StopBrowser(void);
--- 3,9 ----
  #define BROWSE_H
  
! #include <CompilerSpecific.h>
! 
! SAVEDS void BrowserMain(void);
  
  void StopBrowser(void);
diff -r -C 2 -P ../AmiPhone_1.92/ciatimer.c ./ciatimer.c
*** ../AmiPhone_1.92/ciatimer.c	Sat Nov 16 23:46:44 1996
--- ./ciatimer.c	Sun Mar  1 20:47:16 1998
***************
*** 1,6 ****
--- 1,10 ----
+ 
+ /* :ts=4 */
+ 
  #include <time.h>
  #include <stdlib.h>
  #include <stdio.h>
  #include <string.h>
+ #include <math.h>
  
  #include <exec/io.h>
***************
*** 16,23 ****
  #include <clib/mathieeedoubbas_protos.h>
  
  #include <resources/cia.h>
  
  #include <libraries/dos.h>
- #include <libraries/delfina.h>
  #include <resources/misc.h>
  #include <utility/tagitem.h>
--- 20,29 ----
  #include <clib/mathieeedoubbas_protos.h>
  
+ #include <libraries/gadtools.h>
+ #include <clib/gadtools_protos.h>
+ 
  #include <resources/cia.h>
  
  #include <libraries/dos.h>
  #include <resources/misc.h>
  #include <utility/tagitem.h>
***************
*** 39,52 ****
  #include "messages.h"
  #include "codec.h"
- #include "delfph.h"
  
! #include "toccata/include/libraries/toccata.h"
! #include "toccata/include/clib/toccata_protos.h"
! #include "toccata/include/pragmas/toccata_pragmas.h"
  
  /* Some hardware addresses to sample from */
! #define AMIGA_HARDWARE_SAMPLE_ADDRESS 	((UBYTE *) (&pciaa->ciaprb))
! #define AURA_SAMPLE_ADDRESS_LEFT  	((UBYTE *) 0xA20000)
! #define AURA_SAMPLE_ADDRESS_RIGHT 	((UBYTE *) 0xA20002)
  
  	
--- 45,59 ----
  #include "messages.h"
  #include "codec.h"
  
! #include <libraries/toccata.h>
! #include <clib/toccata_protos.h>
! #include <pragmas/toccata_pragmas.h>
! 
! void kprintf(char *, ...);
  
  /* Some hardware addresses to sample from */
! #define AMIGA_HARDWARE_SAMPLE_ADDRESS	((UBYTE *) (&pciaa->ciaprb))
! #define AURA_SAMPLE_ADDRESS_LEFT	((UBYTE *) 0xA20000)
! #define AURA_SAMPLE_ADDRESS_RIGHT	((UBYTE *) 0xA20002)
  
  	
***************
*** 76,88 ****
  
  /* external data */
! extern void AHIhookEntry();	    /* hook stub */
  extern void Idle();			
  extern void InvertIdle();
  extern void PerfectIdle();
! extern void Record();          /* prototype for assembly interrupt routine */
  extern void PerfectRecord();   /* prototype for assembly interrupt routine */
  
  extern BOOL BTransmitting, BSoundOn, BButtonHeld, BSpaceTapped, BTCPBatchXmit, BUserDebug;
  extern UBYTE ubSamplerType, ubInputChannel, ubCurrComp, ubInputSource;
  extern UBYTE ubCustStart, ubCustStop, ubCustLeft, ubCustRight, ubCustMic, ubCustExt, ubCustDir;
  extern UBYTE * pubCustSampleAt;
--- 83,96 ----
  
  /* external data */
! extern void AHIhookEntry();		/* hook stub */
  extern void Idle();			
  extern void InvertIdle();
  extern void PerfectIdle();
! extern void Record();		   /* prototype for assembly interrupt routine */
  extern void PerfectRecord();   /* prototype for assembly interrupt routine */
  
  extern BOOL BTransmitting, BSoundOn, BButtonHeld, BSpaceTapped, BTCPBatchXmit, BUserDebug;
  extern UBYTE ubSamplerType, ubInputChannel, ubCurrComp, ubInputSource;
+ extern ULONG ulAHIMode;
  extern UBYTE ubCustStart, ubCustStop, ubCustLeft, ubCustRight, ubCustMic, ubCustExt, ubCustDir;
  extern UBYTE * pubCustSampleAt;
***************
*** 102,106 ****
  extern struct Library * AHIBase;
  extern struct Library * ToccataBase;
! extern struct Library * DelfinaBase;
  
  /* data */
--- 110,119 ----
  extern struct Library * AHIBase;
  extern struct Library * ToccataBase;
! 
! extern struct Window *PhoneWindow;
! 
! extern BOOL BUpdateMenus;
! extern struct Gadget *freqslider; 
! 
  
  /* data */
***************
*** 108,115 ****
  BYTE sighalf=0, sigfull=0;
  UBYTE * pubAllocedArray = NULL;
! UBYTE * pubRightBuffer  = NULL;
  int nLineGainValue=0, nMicGainValue=20;
  UBYTE * pubBulkSamplePacket = NULL;
! ULONG   ulBulkSamplePacketLen, ulBulkSamplePacketSum, ulAHIAudioMode = 0L;
  
  /* private data */
--- 121,129 ----
  BYTE sighalf=0, sigfull=0;
  UBYTE * pubAllocedArray = NULL;
! UBYTE * pubRightBuffer	= NULL;
  int nLineGainValue=0, nMicGainValue=20;
  UBYTE * pubBulkSamplePacket = NULL;
! ULONG	ulBulkSamplePacketLen, ulBulkSamplePacketSum;
! 
  
  /* private data */
***************
*** 121,124 ****
--- 135,139 ----
  static struct List * PreSendQueue = NULL;
  static int nCurrentPreSendQLen;
+ static UBYTE * pubAHIRecordBuffer = NULL;
  
  /* private function prototypes */
***************
*** 133,143 ****
  static void UpdatePreSendQueue(struct AmiPhoneSendBuffer * sBuf);
  static void FreePreSendNode(struct Node * current);
  
  /* Used by toccata & AHI samplers */
! static __geta4 BOOL ToccataSendData(UBYTE * ubData, ULONG ulDataSize);
! static __geta4 ULONG AHISendData(struct Hook *hook, struct AHIAudioCtrl * ctrl, struct AHIRecordMessage * msg);
  static BOOL StartToccataCapture(BOOL BStart, ULONG ulBPS);
  static BOOL StartAHICapture(BOOL BStart, ULONG ulBPS);
- static BOOL StartDelfinaCapture(BOOL BStart, ULONG ulBPS);
  
  /* Front-ends to setting the various data direction and control bits on the parallel port */
--- 148,159 ----
  static void UpdatePreSendQueue(struct AmiPhoneSendBuffer * sBuf);
  static void FreePreSendNode(struct Node * current);
+ static ULONG ProcessAHIBuffer(UBYTE * pubSrc, UBYTE * pubDst, ULONG ulDataLen, ULONG ulType);
+ static ULONG ProcessToccataBuffer(UBYTE * pubData, ULONG ulDataLen);
  
  /* Used by toccata & AHI samplers */
! static SAVEDS BOOL ToccataSendData(UBYTE * ubData, ULONG ulDataSize);
! static SAVEDS ULONG AHISendData(struct Hook *hook, struct AHIAudioCtrl * ctrl, struct AHIRecordMessage * msg);
  static BOOL StartToccataCapture(BOOL BStart, ULONG ulBPS);
  static BOOL StartAHICapture(BOOL BStart, ULONG ulBPS);
  
  /* Front-ends to setting the various data direction and control bits on the parallel port */
***************
*** 147,157 ****
  static char * RegToString(UBYTE ubReg);
  
! #define EVENT_NONE  0
  #define EVENT_START 1
! #define EVENT_STOP  2
! #define EVENT_LEFT  3
  #define EVENT_RIGHT 4
! #define EVENT_MIC   5
! #define EVENT_EXT   6
  
  char * szEventStrings[] = {
--- 163,173 ----
  static char * RegToString(UBYTE ubReg);
  
! #define EVENT_NONE	0
  #define EVENT_START 1
! #define EVENT_STOP	2
! #define EVENT_LEFT	3
  #define EVENT_RIGHT 4
! #define EVENT_MIC	5
! #define EVENT_EXT	6
  
  char * szEventStrings[] = {
***************
*** 172,182 ****
  	;
  	; STOP -
! 	; 	START bit 0 == 0 (STOP IMMEDIATELY)
! 	; 	PBON  bit 1 == same
! 	; 	OUT   bit 2 == same
! 	;	RUN   bit 3 == 0 (SET CONTINUOUS MODE)
  	;	LOAD  bit 4 == 0 (NO FORCE LOAD)
! 	;	IN    bit 5 == 0 (COUNTS 02 PULSES)
! 	;	SP    bit 6 == same
  	;	TODIN bit 7 == same (unused on ciacra)
  	;
--- 188,198 ----
  	;
  	; STOP -
! 	;	START bit 0 == 0 (STOP IMMEDIATELY)
! 	;	PBON  bit 1 == same
! 	;	OUT	  bit 2 == same
! 	;	RUN	  bit 3 == 0 (SET CONTINUOUS MODE)
  	;	LOAD  bit 4 == 0 (NO FORCE LOAD)
! 	;	IN	  bit 5 == 0 (COUNTS 02 PULSES)
! 	;	SP	  bit 6 == same
  	;	TODIN bit 7 == same (unused on ciacra)
  	;
***************
*** 191,201 ****
  	;
  	; STOP -
! 	; 	START bit 0 == 0 (STOP IMMEDIATELY)
! 	; 	PBON  bit 1 == same
! 	; 	OUT   bit 2 == same
! 	;	RUN   bit 3 == 0 (SET CONTINUOUS MODE)
  	;	LOAD  bit 4 == 0 (NO FORCE LOAD)
! 	;	IN0   bit 5 == 0 (COUNTS 02 PULSES)
! 	;	IN1   bit 6 == 0 (COUNDS 02 PULSES)
  	;	ALARM bit 7 == same (TOD alarm control bit)
  	;
--- 207,217 ----
  	;
  	; STOP -
! 	;	START bit 0 == 0 (STOP IMMEDIATELY)
! 	;	PBON  bit 1 == same
! 	;	OUT	  bit 2 == same
! 	;	RUN	  bit 3 == 0 (SET CONTINUOUS MODE)
  	;	LOAD  bit 4 == 0 (NO FORCE LOAD)
! 	;	IN0	  bit 5 == 0 (COUNTS 02 PULSES)
! 	;	IN1	  bit 6 == 0 (COUNDS 02 PULSES)
  	;	ALARM bit 7 == same (TOD alarm control bit)
  	;
***************
*** 268,272 ****
  			case SAMPLER_SOMAGIC:
  				BWasInput = ((pciab->ciaddra & CIAF_PRTRBUSY) == 0);
! 		     		pciab->ciaddra &= ~(CIAF_PRTRBUSY); /* set this line to input so we can read it */
  				PrevSource = (pciab->ciapra & CIAF_PRTRBUSY) ? INPUT_SOURCE_EXT : INPUT_SOURCE_MIC;
  				UNLESS(BWasInput) pciab->ciaddra |= CIAF_PRTRBUSY;	/* put it back to original state */
--- 284,288 ----
  			case SAMPLER_SOMAGIC:
  				BWasInput = ((pciab->ciaddra & CIAF_PRTRBUSY) == 0);
! 					pciab->ciaddra &= ~(CIAF_PRTRBUSY); /* set this line to input so we can read it */
  				PrevSource = (pciab->ciapra & CIAF_PRTRBUSY) ? INPUT_SOURCE_EXT : INPUT_SOURCE_MIC;
  				UNLESS(BWasInput) pciab->ciaddra |= CIAF_PRTRBUSY;	/* put it back to original state */
***************
*** 293,297 ****
  	
  	if ((nNewSamplerType < 0)||(nNewSamplerType >= SAMPLER_MAX)) return;
- 	if ((nNewSamplerType == SAMPLER_DELFINA)&&(!DelfinaBase)) return;
  	if ((nNewSamplerType == SAMPLER_TOCCATA)&&(!ToccataBase)) return;
  	if ((nNewSamplerType == SAMPLER_AHI)&&(!AHIBase)) return;
--- 309,312 ----
***************
*** 303,309 ****
--- 318,454 ----
  	ChangeInputSource(ubInputSource,TRUE);
  
+ 	BUpdateMenus = TRUE;
+ 
+ 	if(ubSamplerType == SAMPLER_AHI)
+ 	{
+ 		LONG freqs = 0, index = 0, inputs = 0;
+ 		int i;
+ 		
+ 		AHI_GetAudioAttrs(ulAHIMode, NULL,
+ 			AHIDB_Frequencies,	&freqs,
+ 			AHIDB_IndexArg,		ulBytesPerSecond,
+ 			AHIDB_Index,		&index,
+ 			AHIDB_FrequencyArg,	0,
+ 			AHIDB_Inputs		&inputs,
+ 			TAG_DONE);
+ 
+ 
+ 		/* Remove frequencies over nMaxSampleRate */
+ 
+ 		for( i = freqs; i > 0; i--)
+ 		{
+ 			LONG freq = 0;
+ 
+ 			AHI_GetAudioAttrs(ulAHIMode, NULL,
+ 				AHIDB_FrequencyArg,	i,
+ 				AHIDB_Frequency,	&freq,
+ 				TAG_DONE);
+ 			
+ 			if(freq > nMaxSampleRate)
+ 			{
+ 				freqs--;
+ 			}
+ 		}
+ 
+ 		/* Make sure the selected frequency is in range */
+ 
+ 		index = max(0, min(index, freqs - 1));
+ 
+ 		/* Set ulBytesPerSecond */
+ 
+ 		AHI_GetAudioAttrs(ulAHIMode, NULL,
+ 			AHIDB_FrequencyArg,	index,
+ 			AHIDB_Frequency,	&ulBytesPerSecond,
+ 			TAG_DONE);
+ 
+ 		/* Set frequency slider */
+ 
+ 		GT_SetGadgetAttrs(freqslider,PhoneWindow,NULL,
+ 			GTSL_Min,		0,
+ 			GTSL_Max,		freqs,
+ 			GTSL_Level,		index,
+ 			TAG_END);
+ 	}
+ 	else
+ 	{
+ 		GT_SetGadgetAttrs(freqslider,PhoneWindow,NULL,
+ 			GTSL_Min,		(WORD)MIN_SAMPLE_RATE,
+ 			GTSL_Max,		(WORD)nMaxSampleRate,
+ 			GTSL_Level,		(WORD)ulBytesPerSecond,
+ 			TAG_END);
+ 	}
+ 
  	if (BWasTransmitting) ToggleMicButton(CODE_ON);
  }
  
+ static struct TagItem ReqFilterTags[] =
+ {
+ //	  AHIDB_Realtime,	TRUE,
+ 	AHIDB_Record,	TRUE,
+ 	TAG_DONE,		NULL
+ };
+ 
+ 
+ static ULONG ASMCALL SAVEDS
+ ReqFunc( REG(a0, struct Hook *hook),
+ 		 REG(a2, struct AHIAudioModeRequester *req),
+ 		 REG(a1, ULONG id) )
+ {
+ 	// Dirty! Filter all Paula modes away.
+ 	if((id & 0x001f0000) == 0x00020000) return 0;
+ 	return 1;
+ }
+ 
+ static struct Hook
+ ReqHook = {
+ 	0, 0,
+ 	ReqFunc, NULL, NULL
+ };
+ 
+ 
+ void ChangeAHIMode(void)
+ {
+ 	struct AHIAudioModeRequester *req;
+ 	BOOL rc = FALSE;
+ 
+ 	if(AHIBase == NULL) return;
+ 
+ 	req = AHI_AllocAudioRequest(
+ 		AHIR_Window,			PhoneWindow,
+ 		AHIR_SleepWindow,		TRUE,
+ 		AHIR_DoDefaultMode,		TRUE,
+ 		AHIR_InitialAudioID,	ulAHIMode,
+ 		AHIR_FilterTags,		ReqFilterTags,
+ 		AHIR_FilterFunc,		&ReqHook,
+ 		TAG_DONE);
+ 
+ 	if(req == NULL)
+ 	{
+ 		SetWindowTitle("Out of memory!");
+ 		return;
+ 	}
+ 
+ 	rc = AHI_AudioRequest(req, TAG_DONE);
+ 
+ 	if(!rc)
+ 	{
+ 		if(IoErr() == ERROR_NO_FREE_STORE)
+ 			SetWindowTitle("Out of memory!");
+ 		else if(IoErr() == ERROR_NO_MORE_ENTRIES)
+ 			SetWindowTitle("No available modes!");
+ 	}
+ 	else
+ 	{
+ 		ulAHIMode = req->ahiam_AudioID;
+ 		ubInputSource = 0;
+ 		BUpdateMenus = TRUE;
+ 	}
+ 
+ 	AHI_FreeAudioRequest(req);
+ 
+ 	/* Update */
+ 	ChangeSamplerType(ubSamplerType);
+ 
+ }
  
  	
***************
*** 311,330 ****
  {
  	struct TagItem taglist[3];
! 	
! 	if (BMakeCurrentMode) ubInputSource = nNewSource;
  	
  	switch(ubSamplerType)
  	{
  		case SAMPLER_TOCCATA:
! 			taglist[0].ti_Tag  = PAT_Input;        
  			switch (ubInputSource)
  			{
! 				case INPUT_SOURCE_MIC: taglist[0].ti_Data = TINPUT_Mic;  break;
  				case INPUT_SOURCE_EXT: taglist[0].ti_Data = TINPUT_Line; break;
  			}
! 			taglist[1].ti_Tag  = TAG_DONE;	taglist[1].ti_Data = NULL;
  			T_SetPart(taglist);
  			break;
! 		
  		case SAMPLER_SOMAGIC:
  			switch(nNewSource)
--- 456,493 ----
  {
  	struct TagItem taglist[3];
! 
! 	if(nNewSource < 0) nNewSource = 0;
  	
  	switch(ubSamplerType)
  	{
  		case SAMPLER_TOCCATA:
! 			taglist[0].ti_Tag  = PAT_Input;		   
  			switch (ubInputSource)
  			{
! 				case INPUT_SOURCE_MIC: taglist[0].ti_Data = TINPUT_Mic;	 break;
  				case INPUT_SOURCE_EXT: taglist[0].ti_Data = TINPUT_Line; break;
  			}
! 			taglist[1].ti_Tag  = TAG_DONE;	taglist[1].ti_Data = 0;
  			T_SetPart(taglist);
  			break;
! 
! 		case SAMPLER_AHI:
! 		{
! 			ULONG inputs = 0;
! 
! 			AHI_GetAudioAttrs( ulAHIMode, NULL,
! 				AHIDB_Inputs, &inputs,
! 				TAG_DONE);
! 
! 			nNewSource = max(0, min(nNewSource, inputs - 1));
! 
! 			if(AHIAudioControl)
! 			{
! 				AHI_ControlAudio(AHIAudioControl, 
! 					AHIC_Input, nNewSource,
! 					TAG_DONE);
! 			}
! 		}
! 
  		case SAMPLER_SOMAGIC:
  			switch(nNewSource)
***************
*** 335,345 ****
  			break;
  	
- 		case SAMPLER_DELFINA:
- 			taglist[0].ti_Tag = DA_MicIn;	taglist[0].ti_Data = (nNewSource == INPUT_SOURCE_MIC);
- 			taglist[1].ti_Tag = DA_LineIn;	taglist[1].ti_Data = (nNewSource == INPUT_SOURCE_EXT);
- 			taglist[2].ti_Tag = TAG_DONE;	taglist[2].ti_Data = NULL;
- 			Delf_SetAttrsA(taglist);
- 			break;
- 				
  		case SAMPLER_CUSTOM:
  			switch(ubInputSource)
--- 498,501 ----
***************
*** 349,352 ****
--- 505,510 ----
  			}
  	}
+ 
+ 	if (BMakeCurrentMode) ubInputSource = nNewSource;
  }
  
***************
*** 361,371 ****
  				 break;
  						
! 			case SAMPLER_GVPDSS8: 	/* this verified to work by JAF */
  				 SetParallelBits(EVENT_NONE,SAMPBIT_SELSET);
! 			  	 break;		
  				 
  			case SAMPLER_SOMAGIC:
  				 SetParallelBits(EVENT_NONE,SAMPBIT_POUTCLR | SAMPBIT_SELSET);
! 			 	 break;
  
  			case SAMPLER_AURA:
--- 519,529 ----
  				 break;
  						
! 			case SAMPLER_GVPDSS8:	/* this verified to work by JAF */
  				 SetParallelBits(EVENT_NONE,SAMPBIT_SELSET);
! 				 break;		
  				 
  			case SAMPLER_SOMAGIC:
  				 SetParallelBits(EVENT_NONE,SAMPBIT_POUTCLR | SAMPBIT_SELSET);
! 				 break;
  
  			case SAMPLER_AURA:
***************
*** 378,390 ****
  				 break;		
  			
- 			case SAMPLER_DELFINA:
- 				 if (StartSampling(CHECK_STATUS,0) == TRUE) 
- 				 {
- 					ubInputChannel = INPUT_JACK_LEFT;	/* must be set BEFORE the StartSampling pair! */
- 					BTransmitting = StartSampling(FALSE,0);
- 					BTransmitting = StartSampling(TRUE,ulBytesPerSecond);
- 				 }
- 				 break;
- 				 					 
  			default: case SAMPLER_PERFECT: case SAMPLER_AMAS: 
  				 /* as described by Marcel Offermans & AGMSRecordSound author */
--- 536,539 ----
***************
*** 400,412 ****
  				 break;
  			
- 			case SAMPLER_DELFINA:
- 				 if (StartSampling(CHECK_STATUS,0) == TRUE) 
- 				 {
- 					ubInputChannel = INPUT_JACK_RIGHT;	/* must be set BEFORE the StartSampling pair! */
- 					BTransmitting = StartSampling(FALSE,0);
- 					BTransmitting = StartSampling(TRUE,ulBytesPerSecond);
- 				 }
- 				 break;	 					 
- 
  			case SAMPLER_GVPDSS8: 
  				 SetParallelBits(EVENT_NONE, SAMPBIT_SELCLR);
--- 549,552 ----
***************
*** 425,429 ****
  				 if (pubCustSampleAt) IntData.pubSampleAt = pubCustSampleAt;
  				 break;
! 				 				 
  			default: case SAMPLER_PERFECT: case SAMPLER_AMAS: 
  				 SetParallelBits(EVENT_NONE, SAMPBIT_POUTCLR | SAMPBIT_SELSET);
--- 565,569 ----
  				 if (pubCustSampleAt) IntData.pubSampleAt = pubCustSampleAt;
  				 break;
! 								 
  			default: case SAMPLER_PERFECT: case SAMPLER_AMAS: 
  				 SetParallelBits(EVENT_NONE, SAMPBIT_POUTCLR | SAMPBIT_SELSET);
***************
*** 455,460 ****
  	if (ubSamplerType == SAMPLER_AHI) return(BTimerStarted = StartAHICapture(BStart, ulBPS));
  	
- 	if (ubSamplerType == SAMPLER_DELFINA) return(BTimerStarted = StartDelfinaCapture(BStart, ulBPS));
- 	
  	/* set up data which will be passed to interrupt */
  	if (BStart == TRUE)
--- 595,598 ----
***************
*** 465,469 ****
  		{
  			ResetDigitizer(FALSE);	/* record state */
! 			BFirstTime = FALSE;	
  		}
  		
--- 603,607 ----
  		{
  			ResetDigitizer(FALSE);	/* record state */
! 			BFirstTime = FALSE; 
  		}
  		
***************
*** 476,481 ****
  		AmiPhoneTimer.timerint.is_Node.ln_Pri  = 0;
  		AmiPhoneTimer.timerint.is_Node.ln_Name = "AmiPhone Sample Timer";
! 		AmiPhoneTimer.timerint.is_Data	       = (APTR) &IntData;
! 		AmiPhoneTimer.timerint.is_Code	       = (ubSamplerType == SAMPLER_PERFECT) ? PerfectIdle : ((UsesInvertedSamples()) ? InvertIdle : Idle);
  		
  		/* Call function to find a free CIA interval timer
--- 614,619 ----
  		AmiPhoneTimer.timerint.is_Node.ln_Pri  = 0;
  		AmiPhoneTimer.timerint.is_Node.ln_Name = "AmiPhone Sample Timer";
! 		AmiPhoneTimer.timerint.is_Data		   = (APTR) &IntData;
! 		AmiPhoneTimer.timerint.is_Code		   = (ubSamplerType == SAMPLER_PERFECT) ? PerfectIdle : ((UsesInvertedSamples()) ? InvertIdle : Idle);
  		
  		/* Call function to find a free CIA interval timer
***************
*** 517,521 ****
  
  		/* Send what we have of the current packet, if we were sending */
! 		pubPartialSend     = (IntData.pubIndex >= IntData.pubHalfIndex) ? IntData.pubHalfIndex : IntData.pubArray;
  		nPartialSendLength = (int) (IntData.pubIndex-pubPartialSend);
  		if (nPartialSendLength == 0) nPartialSendLength = 1;
--- 655,659 ----
  
  		/* Send what we have of the current packet, if we were sending */
! 		pubPartialSend	   = (IntData.pubIndex >= IntData.pubHalfIndex) ? IntData.pubHalfIndex : IntData.pubArray;
  		nPartialSendLength = (int) (IntData.pubIndex-pubPartialSend);
  		if (nPartialSendLength == 0) nPartialSendLength = 1;
***************
*** 523,527 ****
  		/* pro-rate the partial sample's volume to represent the full range */
  		IntData.ulSaveByteSum = ((ULONG) (IntData.ulByteSum * ((ULONG)(IntData.pubHalfIndex-IntData.pubArray)))) / ((ULONG) nPartialSendLength);
! 		TransmitData(pubPartialSend, nPartialSendLength, ubCurrComp);			    
  		
  		/* Deallocate any RAM that was previously allocated */
--- 661,665 ----
  		/* pro-rate the partial sample's volume to represent the full range */
  		IntData.ulSaveByteSum = ((ULONG) (IntData.ulByteSum * ((ULONG)(IntData.pubHalfIndex-IntData.pubArray)))) / ((ULONG) nPartialSendLength);
! 		TransmitData(pubPartialSend, nPartialSendLength, ubCurrComp);				
  		
  		/* Deallocate any RAM that was previously allocated */
***************
*** 531,535 ****
  	}
  	return(BTimerStarted);
! };
  
  
--- 669,673 ----
  	}
  	return(BTimerStarted);
! }
  
  
***************
*** 539,622 ****
  static BOOL StartAHICapture(BOOL BStart, ULONG ulBPS)
  {
- 	struct TagItem taglist[15];
  	static struct Hook RecordFuncHook;
! 	ULONG ulAHIVolume,ulAHIRecord,ulAHIRealtime,ulAHIBits,ulAHIFrequencies,
! 	      ulAHIIndex,ulAHIMaxRecordSamples,ulBestAudioMode, ulError;
! 	char szDriverName[200] = "szDriverName",
! 	     szModeName[200]   = "szModeName",
! 	     szAuthorName[200] = "szAuthorName",
! 	     szVersionName[200]= "szVersionName";
  	
  	if (BStart)
  	{
! 		printf("StartAHICapture():  Setting up capture....\n");
! 		
! 		taglist[0].ti_Tag = AHIDB_Record; taglist[0].ti_Data = TRUE;
! 		taglist[1].ti_Tag = AHIDB_Bits;   taglist[1].ti_Data = 8;
! 		taglist[2].ti_Tag = TAG_DONE;	  taglist[2].ti_Data = NULL;
! 		ulBestAudioMode = AHI_BestAudioIDA(taglist);
! 		
! 		printf("ulBestAudioMode is 0x%X\n",ulBestAudioMode);
! 		if (ulBestAudioMode == AHI_INVALID_ID) printf("Warning, INVALID ID!\n");
! 		
! 		taglist[0].ti_Tag  = AHIDB_Volume; 	taglist[0].ti_Data  = &ulAHIVolume;
! 		taglist[1].ti_Tag  = AHIDB_Record; 	taglist[1].ti_Data  = &ulAHIRecord;
! 		taglist[2].ti_Tag  = AHIDB_Realtime; 	taglist[2].ti_Data  = &ulAHIRealtime;
! 		taglist[3].ti_Tag  = AHIDB_Bits; 	taglist[3].ti_Data  = &ulAHIBits;
! 		taglist[4].ti_Tag  = AHIDB_Frequencies; taglist[4].ti_Data  = &ulAHIFrequencies;
! 		taglist[5].ti_Tag  = AHIDB_Index; 	taglist[5].ti_Data  = &ulAHIIndex;
! 		taglist[6].ti_Tag  = AHIDB_IndexArg; 	taglist[6].ti_Data  = ulBPS;
! 		taglist[7].ti_Tag  = AHIDB_MaxRecordSamples; taglist[7].ti_Data = &ulAHIMaxRecordSamples;
! 		taglist[8].ti_Tag  = AHIDB_BufferLen;   taglist[8].ti_Data  = sizeof(szDriverName);
! 		taglist[9].ti_Tag  = AHIDB_Driver; 	taglist[9].ti_Data  = szDriverName;
! 		taglist[10].ti_Tag = AHIDB_Name; 	taglist[10].ti_Data = szModeName;
! 		taglist[11].ti_Tag = AHIDB_Author; 	taglist[11].ti_Data = szAuthorName;
! 		taglist[12].ti_Tag = AHIDB_Version;	taglist[12].ti_Data = szVersionName;
! 		taglist[13].ti_Tag = TAG_DONE; 		taglist[13].ti_Data = NULL;
! 		UNLESS(AHI_GetAudioAttrsA(ulBestAudioMode, NULL, taglist))
  		{
! 			printf("AHI_GetAudioAttrsA failed!\n");
  			return(FALSE);
  		}
  
! 		printf("---------AHI_GetAudioAttrs reports:\n");
! 		printf("VolumeAdjustable = %lu\n",ulAHIVolume);
! 		printf("CanRecord        = %lu\n",ulAHIRecord);
! 		printf("Realtime         = %lu\n",ulAHIRealtime);
! 		printf("BitsPerSample    = %lu\n",ulAHIBits);
! 		printf("NumFrequencies   = %lu\n",ulAHIFrequencies);
! 		printf("IndexOf(f=%lu)   = %lu\n",ulBPS,ulAHIIndex);
! 		printf("MaxRecordSamples = %lu\n",ulAHIMaxRecordSamples);
! 		printf("szDriverName  = [%s]\n",szDriverName);
! 		printf("szModeName    = [%s]\n",szModeName);
! 		printf("szAuthorName  = [%s]\n",szAuthorName);
! 		printf("szVersionName = [%s]\n",szVersionName);
! 		printf("---------End AHI_GetAudioAttrs\n");
  
! 		/* Setup our Hook! */
! 		RecordFuncHook.h_Entry    = (ULONG (*) ()) AHIhookEntry;
! 		RecordFuncHook.h_SubEntry = AHISendData;
! 		RecordFuncHook.h_Data	  = NULL;	/* Should there be something here? */
! 		
! 		/* Now start the capture */
! 		taglist[0].ti_Tag = AHIA_AudioID; 	taglist[0].ti_Data = ulBestAudioMode;
! 		taglist[1].ti_Tag = AHIA_Channels;	taglist[1].ti_Data = 0;	/* Is zero channels okay since we won't be playing any sounds?? */
! 		taglist[2].ti_Tag = AHIA_Sounds;  	taglist[2].ti_Data = 0;	/* What is this arg, anyway??? */
! 		taglist[3].ti_Tag = AHIA_RecordFunc;	taglist[3].ti_Data = &RecordFuncHook;
! 		taglist[4].ti_Tag = TAG_DONE;	  	taglist[4].ti_Data = NULL;
! 		UNLESS(AHIAudioControl = AHI_AllocAudioA(taglist))
  		{
! 			SetWindowTitle("AHI_AllocAudioA failed!");
  			return(FALSE);
  		}
! 		ulAHIAudioMode = ulBestAudioMode;
! 		
! 		taglist[0].ti_Tag = AHIC_Play; 		taglist[0].ti_Data = FALSE;
! 		taglist[1].ti_Tag = AHIC_Record;	taglist[1].ti_Data = TRUE;
! 		taglist[2].ti_Tag = AHIA_RecordFunc;	taglist[2].ti_Data = &RecordFuncHook;
! 		taglist[3].ti_Tag = TAG_DONE;	  	taglist[3].ti_Data = NULL;
! 		if (ulError = AHI_ControlAudioA(AHIAudioControl, taglist))
  		{
! 			printf("AHI_ControlAudioA failed, error %lu\n",ulError);
  			AHI_FreeAudio(AHIAudioControl); AHIAudioControl = NULL;
  			return(FALSE);
--- 677,728 ----
  static BOOL StartAHICapture(BOOL BStart, ULONG ulBPS)
  {
  	static struct Hook RecordFuncHook;
! 	ULONG ulError = AHIE_OK;
! 	ULONG inputs = 0, samples = 0;
  	
+ 	if(AHIBase == NULL) return FALSE;
+ 
  	if (BStart)
  	{
! 		/* Setup our Hook! */
! 		RecordFuncHook.h_Entry	  = (ULONG (*) ()) AHIhookEntry;
! 		RecordFuncHook.h_SubEntry = AHISendData;
! 		RecordFuncHook.h_Data	  = NULL;	/* Should there be something here? */
! 
! 		/* Now start the capture */
! 		UNLESS(AHIAudioControl = AHI_AllocAudio(
! 			AHIA_AudioID,		ulAHIMode,
! 			AHIA_MixFreq,		ulBytesPerSecond,
! 			AHIA_Channels,		1,
! 			AHIA_Sounds,		1,
! 			AHIA_RecordFunc,	&RecordFuncHook,
! 			TAG_DONE))
  		{
! 			SetWindowTitle("AHI_AllocAudio failed!");
  			return(FALSE);
  		}
  
! 		AHI_GetAudioAttrs( AHI_INVALID_ID, AHIAudioControl,
! 			AHIDB_Inputs,			&inputs,
! 			AHIDB_MaxRecordSamples, &samples,
! 			TAG_DONE);
  
! 		pubAHIRecordBuffer = AllocVec(samples, MEMF_PUBLIC);
! 
! 		if(pubAHIRecordBuffer == NULL)
  		{
! 			printf("Out of memory!\n");
! 			AHI_FreeAudio(AHIAudioControl); AHIAudioControl = NULL;
  			return(FALSE);
  		}
! 
! 		ubInputSource = min(ubInputSource, inputs - 1);
! 
! 		if (ulError = AHI_ControlAudio(AHIAudioControl, 
! 			AHIC_Record,	TRUE,
! 			AHIC_Input,		ubInputSource,
! 			TAG_DONE))
  		{
! 			printf("AHI_ControlAudio failed, error %lu\n",ulError);
  			AHI_FreeAudio(AHIAudioControl); AHIAudioControl = NULL;
  			return(FALSE);
***************
*** 626,639 ****
  	else
  	{
- 		printf("StartAHICapture():  Ending capture....\n");
  		if (AHIAudioControl)
  		{
! 			taglist[0].ti_Tag = AHIC_Play; 		taglist[0].ti_Data = FALSE;
! 			taglist[1].ti_Tag = AHIC_Record;	taglist[1].ti_Data = FALSE;
! 			taglist[2].ti_Tag = TAG_DONE;	  	taglist[2].ti_Data = NULL;
! 			if (ulError = AHI_ControlAudioA(AHIAudioControl, taglist))
! 				printf("AHI_ControlAudioA failed on stop, error %lu\n",ulError);
  			AHI_FreeAudio(AHIAudioControl); 
  			AHIAudioControl = NULL;
  		}
  		else printf("Um, AHIAudioControl was like, NULL or something\n");
--- 732,746 ----
  	else
  	{
  		if (AHIAudioControl)
  		{
! 			if (ulError = AHI_ControlAudio(AHIAudioControl,
! 				AHIC_Record,	FALSE,
! 				TAG_DONE))
! 				printf("AHI_ControlAudio failed on stop, error %lu\n",ulError);
  			AHI_FreeAudio(AHIAudioControl); 
  			AHIAudioControl = NULL;
+ 
+ 			FreeVec(pubAHIRecordBuffer);
+ 			pubAHIRecordBuffer = NULL;
  		}
  		else printf("Um, AHIAudioControl was like, NULL or something\n");
***************
*** 645,688 ****
  
  
- /* Returns current state of the delfina sampler after operation attempted! */
- static BOOL StartDelfinaCapture(BOOL BStart, ULONG ulBPS)
- {
- 	int compmode;
- 	
- 	if (BStart)
- 	{
- 		UNLESS(DelfinaBase) return(FALSE);
- 
- 		ulSampleArraySize = ((CalcSampleArraySize(ulBPS, ubCurrComp, fPacketDelay) >> 4)+1)<<3;
- 
- 		switch(ubCurrComp)
- 		{
- 			case COMPRESS_ADPCM2:	compmode = 1; break;
- 			case COMPRESS_ADPCM3:	compmode = 2; break;
- 			default:				compmode = 0; break;
- 		}
- 		/* Now allocate a buffer for us.  The >>3 is due to warts in AllocSamplingBuffer (read its header for more info) */
- 		UNLESS(AllocSamplingBuffer(ulSampleArraySize>>3))
- 		{
- 			printf("StartDelfinaCapture():  Couldn't allocate sampling buffer!\n");
- 			return(FALSE);
- 		}
- 		UNLESS(StartDelfina(ulBPS, ulSampleArraySize, compmode, (ubInputChannel == INPUT_JACK_RIGHT)))
- 		{
- 			printf("StartDelfinaCapture(): StartDelfina() failed!\n");
- 			AllocSamplingBuffer(0);
- 			return(FALSE);
- 		}
- 		return(TRUE);
- 	}
- 	else
- 	{
- 		StopDelfina();
- 		AllocSamplingBuffer(0);	/* Free the mem we were using */
- 		return(FALSE);
- 	}	
- }
- 
- 
  /* BSTart controls whether to start or stop capture.  ulBPS is, of course,
     the sampling rate (for the Toccata, this should be set to one of the
--- 752,755 ----
***************
*** 724,733 ****
  		/* Prepare taglist to send to T_Capture */
  		taglist[0].ti_Tag  = TT_BufferSize; taglist[0].ti_Data = ulTocArraySize;
! 		taglist[1].ti_Tag  = TT_Save;	    taglist[1].ti_Data = ToccataSendData;
! 		taglist[2].ti_Tag  = TT_Mode;	    taglist[2].ti_Data = TMODE_LINEAR_8;
! 		taglist[3].ti_Tag  = TT_Frequency;  taglist[3].ti_Data = ulBPS;
! 		taglist[4].ti_Tag  = TT_ErrorTask;  taglist[4].ti_Data = MainTask;
! 		taglist[5].ti_Tag  = TT_ErrorMask;  taglist[5].ti_Data = SIGBREAKF_CTRL_D;
! 		taglist[6].ti_Tag  = TAG_DONE;	    taglist[6].ti_Data = NULL;
  
  		/* and off it goes! */
--- 791,800 ----
  		/* Prepare taglist to send to T_Capture */
  		taglist[0].ti_Tag  = TT_BufferSize; taglist[0].ti_Data = ulTocArraySize;
! 		taglist[1].ti_Tag  = TT_Save;		taglist[1].ti_Data = ToccataSendData;
! 		taglist[2].ti_Tag  = TT_Mode;		taglist[2].ti_Data = TMODE_LINEAR_8;
! 		taglist[3].ti_Tag  = TT_Frequency;	taglist[3].ti_Data = ulBPS;
! 		taglist[4].ti_Tag  = TT_ErrorTask;	taglist[4].ti_Data = MainTask;
! 		taglist[5].ti_Tag  = TT_ErrorMask;	taglist[5].ti_Data = SIGBREAKF_CTRL_D;
! 		taglist[6].ti_Tag  = TAG_DONE;		taglist[6].ti_Data = 0;
  
  		/* and off it goes! */
***************
*** 753,762 ****
  
  /* Called by AHI whenever data is to be xmitted */	
! static __geta4 ULONG AHISendData(struct Hook *hook, struct AHIAudioCtrl * ctrl, struct AHIRecordMessage * msg)
  {
! 	pubBulkSamplePacket   = msg->ahirm_Buffer; 
! 	ulSampleArraySize     = msg->ahirm_Length;
  
! 	ulBulkSamplePacketSum = ProcessAHIBuffer(pubBulkSamplePacket, &ulSampleArraySize, msg->ahirm_Type);
  	Signal(MainTask, SIGBREAKF_CTRL_F);
  	return(1);
--- 820,830 ----
  
  /* Called by AHI whenever data is to be xmitted */	
! static SAVEDS ULONG AHISendData(struct Hook *hook, struct AHIAudioCtrl * ctrl, struct AHIRecordMessage * msg)
  {
! 	pubBulkSamplePacket	  = pubAHIRecordBuffer;
! 	ulSampleArraySize	  = msg->ahirm_Length;
  
! 	ulBulkSamplePacketSum = ProcessAHIBuffer(msg->ahirm_Buffer, 
! 		 pubBulkSamplePacket, ulSampleArraySize, msg->ahirm_Type);
  	Signal(MainTask, SIGBREAKF_CTRL_F);
  	return(1);
***************
*** 765,772 ****
  
  /* called by the Toccata library whenever we need to send the data */
! static __geta4 BOOL ToccataSendData(UBYTE * pubData, ULONG ulDataSize)
  {	
! 	pubBulkSamplePacket   = pubData;
! 	ulSampleArraySize     = ulDataSize;
  
  	ulBulkSamplePacketSum = ProcessToccataBuffer(pubData, ulDataSize);
--- 833,840 ----
  
  /* called by the Toccata library whenever we need to send the data */
! static SAVEDS BOOL ToccataSendData(UBYTE * pubData, ULONG ulDataSize)
  {	
! 	pubBulkSamplePacket	  = pubData;
! 	ulSampleArraySize	  = ulDataSize;
  
  	ulBulkSamplePacketSum = ProcessToccataBuffer(pubData, ulDataSize);
***************
*** 789,804 ****
  	switch(ubSamplerType)
  	{
- 	   case SAMPLER_DELFINA:
- 		nLineGainValue = ChopValue(nLineGainValue+nSteps,0,15);
- 		taglist[0].ti_Tag = DA_InputGain;	taglist[0].ti_Data = (nLineGainValue * 0x10000)/15;
- 		taglist[1].ti_Tag = TAG_DONE;		taglist[1].ti_Data = NULL;
- 		Delf_SetAttrsA(taglist);
- 		break;
- 		
  	   case SAMPLER_TOCCATA:
! 		nLineGainValue = ChopValue(nLineGainValue+nSteps,0,15);	
  		taglist[0].ti_Tag  = PAT_InputVolumeRight; taglist[0].ti_Data = nLineGainValue;
  		taglist[1].ti_Tag  = PAT_InputVolumeLeft;  taglist[1].ti_Data = nLineGainValue;
! 		taglist[2].ti_Tag  = TAG_DONE; 		   taglist[2].ti_Data = NULL;
  		T_SetPart(taglist);
  		break;
--- 857,865 ----
  	switch(ubSamplerType)
  	{
  	   case SAMPLER_TOCCATA:
! 		nLineGainValue = ChopValue(nLineGainValue+nSteps,0,15); 
  		taglist[0].ti_Tag  = PAT_InputVolumeRight; taglist[0].ti_Data = nLineGainValue;
  		taglist[1].ti_Tag  = PAT_InputVolumeLeft;  taglist[1].ti_Data = nLineGainValue;
! 		taglist[2].ti_Tag  = TAG_DONE;		   taglist[2].ti_Data = 0;
  		T_SetPart(taglist);
  		break;
***************
*** 806,810 ****
  	   case SAMPLER_GVPDSS8:
  		nLineGainValue = ChopValue(nLineGainValue+nSteps,0,7);
! 	        pciaa->ciaddrb  = 0xFF;	/* set data direction bits to output */
  		SetDirectionBits(SAMPBIT_BUSYSET);	/* busy bit as output */
  		SetParallelBits(EVENT_NONE, SAMPBIT_BUSYCLR);
--- 867,871 ----
  	   case SAMPLER_GVPDSS8:
  		nLineGainValue = ChopValue(nLineGainValue+nSteps,0,7);
! 			pciaa->ciaddrb	= 0xFF; /* set data direction bits to output */
  		SetDirectionBits(SAMPBIT_BUSYSET);	/* busy bit as output */
  		SetParallelBits(EVENT_NONE, SAMPBIT_BUSYCLR);
***************
*** 812,816 ****
  		SetParallelBits(EVENT_NONE, SAMPBIT_BUSYSET);
  		SetDirectionBits(SAMPBIT_BUSYCLR);
! 	        pciaa->ciaddrb  = 0x00;	/* data back to input */
  		break;
  		
--- 873,877 ----
  		SetParallelBits(EVENT_NONE, SAMPBIT_BUSYSET);
  		SetDirectionBits(SAMPBIT_BUSYCLR);
! 			pciaa->ciaddrb	= 0x00; /* data back to input */
  		break;
  		
***************
*** 823,834 ****
  			/* Set SEL to 0 for decrease, 1 for increase */
  			if (BRaise == TRUE) SetParallelBits(EVENT_NONE,SAMPBIT_SELSET);
! 				       else SetParallelBits(EVENT_NONE,SAMPBIT_SELCLR);
  				
  			/* Now toggle PB7 */
! 		        pciaa->ciaprb  &= ~(0x80);	/* Gain control goes to zero */
  			Delay(1);
! 		        pciaa->ciaprb  |= 0x80;		/* And back to one.  This is the trigger. */
  		}
! 		ChangeInputChannel(ubInputChannel);	
  		break;
  	}
--- 884,895 ----
  			/* Set SEL to 0 for decrease, 1 for increase */
  			if (BRaise == TRUE) SetParallelBits(EVENT_NONE,SAMPBIT_SELSET);
! 					   else SetParallelBits(EVENT_NONE,SAMPBIT_SELCLR);
  				
  			/* Now toggle PB7 */
! 				pciaa->ciaprb  &= ~(0x80);	/* Gain control goes to zero */
  			Delay(1);
! 				pciaa->ciaprb  |= 0x80;		/* And back to one.	 This is the trigger. */
  		}
! 		ChangeInputChannel(ubInputChannel); 
  		break;
  	}
***************
*** 850,863 ****
  	switch(ubSamplerType)
  	{
- 	   case SAMPLER_DELFINA:
- 		taglist[0].ti_Tag = DA_MicIsLine;	taglist[0].ti_Data = (nNewValue==0);
- 		taglist[1].ti_Tag = DA_HighPass;	taglist[1].ti_Data = (nNewValue==20);
- 		taglist[2].ti_Tag = TAG_DONE;		taglist[2].ti_Data = NULL;
- 		Delf_SetAttrsA(taglist);
- 		break;
- 
  	   case SAMPLER_TOCCATA:
! 		taglist[0].ti_Tag  = PAT_MicGain;       taglist[0].ti_Data = (nNewValue > 0);
! 		taglist[1].ti_Tag  = TAG_DONE; 		taglist[1].ti_Data = NULL;
  		T_SetPart(taglist);
  		break;
--- 911,917 ----
  	switch(ubSamplerType)
  	{
  	   case SAMPLER_TOCCATA:
! 		taglist[0].ti_Tag  = PAT_MicGain;		taglist[0].ti_Data = (nNewValue > 0);
! 		taglist[1].ti_Tag  = TAG_DONE;		taglist[1].ti_Data = 0;
  		T_SetPart(taglist);
  		break;
***************
*** 873,878 ****
  /* 
   * This routine sets up the interval timer we allocated with
!  * AddICRVector().  Note that we may have alreay received one, or
!  * more interrupts from our timer.  Make no assumptions about the
   * initial state of any of the hardware registers we will be using.
   *
--- 927,932 ----
  /* 
   * This routine sets up the interval timer we allocated with
!  * AddICRVector().	Note that we may have alreay received one, or
!  * more interrupts from our timer.	Make no assumptions about the
   * initial state of any of the hardware registers we will be using.
   *
***************
*** 886,937 ****
  	{
  		case SAMPLER_PERFECT:
! 		     pciaa->ciaddrb  = 0xC0;	/* high two bits are output/control bits on the PerfectSound! */
! 		     pciaa->ciaprb  |= 0xC0;	/* PB6, PB7 both high when sampling? */
! 		     SetDirectionBits(SAMPBIT_BUSYCLR);	/* per generic.source? */
! 		     break;
! 				     
! 		case SAMPLER_TOCCATA: case SAMPLER_AHI: case SAMPLER_DELFINA:
! 		     /* Don't call StartTimer() with these sampler types, fruit loop! */
! 		     return(FALSE);
! 		     break;
  		
  		case SAMPLER_SOMAGIC:
! 		     pciaa->ciaddrb  = 0x00;	/* all bits: input mode */
! 		     /* for this model, BUSY is used as an output also */
! 		     SetDirectionBits(SAMPBIT_SELSET | SAMPBIT_POUTSET | SAMPBIT_BUSYSET);
! 		     break; 
  		
  		case SAMPLER_CUSTOM:
! 		     /* Make all data bits input */
! 		     pciaa->ciaddrb  = 0x00;
! 		     /* User-customizable set of control direction bits */
! 		     SetDirectionBits(ubCustDir);
! 		     /* User-customizable set of control data bits */
! 		     SetParallelBits(EVENT_START, ubCustStart);
! 		     break;
! 	 	
  		default:
! 		     pciaa->ciaddrb  = 0x00;	/* all bits: input mode */
! 		     SetDirectionBits(SAMPBIT_SELSET | SAMPBIT_POUTSET | SAMPBIT_BUSYCLR);
! 		     break;
  	}
  
  	UNLESS(AllocSamplingBuffer(ulSmallestArraySize)) return(FALSE);
  	
! 	IntData.pubSampleAt   = AMIGA_HARDWARE_SAMPLE_ADDRESS;		/* default = parallel hardware */
! 	IntData.stTask        = FindTask(NULL);
  	IntData.ulHalfSignal  = (1<<sighalf);
  	IntData.ulFullSignal  = (1<<sigfull);
! 	IntData.ulShiftLeft   = (ULONG) nAmpShift;
! 	IntData.ulByteSum     = 0L;
  	IntData.ulSaveByteSum = 0L;
  	IntData.ulThreshhold  = (nPreSendQLen == 0) ? ((ULONG) ((nMinSampleVol*255)/100)) : 0L;
! 	IntData.uwCiavals     = uwMicros;
! 	IntData.uwClearCode   = (ft->BUsingCIAB) ? INTF_EXTER : INTF_PORTS;
! 	IntData.BIdle	      = 1L;
  	
! 	ChangeInputChannel(ubInputChannel);	/* select channel for input if possible */
  
! 	ulLastVolume = SILENCE;	
  	TransmitData(0,0,0);
  		
--- 940,992 ----
  	{
  		case SAMPLER_PERFECT:
! 			 pciaa->ciaddrb	 = 0xC0;	/* high two bits are output/control bits on the PerfectSound! */
! 			 pciaa->ciaprb	|= 0xC0;	/* PB6, PB7 both high when sampling? */
! 			 SetDirectionBits(SAMPBIT_BUSYCLR); /* per generic.source? */
! 			 break;
! 					 
! 		case SAMPLER_TOCCATA:
! 		case SAMPLER_AHI:
! 			 /* Don't call StartTimer() with these sampler types, fruit loop! */
! 			 return(FALSE);
! 			 break;
  		
  		case SAMPLER_SOMAGIC:
! 			 pciaa->ciaddrb	 = 0x00;	/* all bits: input mode */
! 			 /* for this model, BUSY is used as an output also */
! 			 SetDirectionBits(SAMPBIT_SELSET | SAMPBIT_POUTSET | SAMPBIT_BUSYSET);
! 			 break; 
  		
  		case SAMPLER_CUSTOM:
! 			 /* Make all data bits input */
! 			 pciaa->ciaddrb	 = 0x00;
! 			 /* User-customizable set of control direction bits */
! 			 SetDirectionBits(ubCustDir);
! 			 /* User-customizable set of control data bits */
! 			 SetParallelBits(EVENT_START, ubCustStart);
! 			 break;
! 		
  		default:
! 			 pciaa->ciaddrb	 = 0x00;	/* all bits: input mode */
! 			 SetDirectionBits(SAMPBIT_SELSET | SAMPBIT_POUTSET | SAMPBIT_BUSYCLR);
! 			 break;
  	}
  
  	UNLESS(AllocSamplingBuffer(ulSmallestArraySize)) return(FALSE);
  	
! 	IntData.pubSampleAt	  = AMIGA_HARDWARE_SAMPLE_ADDRESS;		/* default = parallel hardware */
! 	IntData.stTask		  = FindTask(NULL);
  	IntData.ulHalfSignal  = (1<<sighalf);
  	IntData.ulFullSignal  = (1<<sigfull);
! 	IntData.ulShiftLeft	  = (ULONG) nAmpShift;
! 	IntData.ulByteSum	  = 0L;
  	IntData.ulSaveByteSum = 0L;
  	IntData.ulThreshhold  = (nPreSendQLen == 0) ? ((ULONG) ((nMinSampleVol*255)/100)) : 0L;
! 	IntData.uwCiavals	  = uwMicros;
! 	IntData.uwClearCode	  = (ft->BUsingCIAB) ? INTF_EXTER : INTF_PORTS;
! 	IntData.BIdle		  = 1L;
  	
! 	ChangeInputChannel(ubInputChannel); /* select channel for input if possible */
  
! 	ulLastVolume = SILENCE; 
  	TransmitData(0,0,0);
  		
***************
*** 962,972 ****
  	}
  
! 	IntData.pubCiahi      = ft->ciahi;
! 	IntData.pubCialo      = ft->cialo;
  		
  	/* Modify control register within Disable().  This is done to avoid
  	 * race conditions since our compiler may generate code such as:
  	 *
! 	 * 	value = Read hardware byte
  	 *	AND value with MASK
  	 *	Write value to hardware byte
--- 1017,1027 ----
  	}
  
! 	IntData.pubCiahi	  = ft->ciahi;
! 	IntData.pubCialo	  = ft->cialo;
  		
  	/* Modify control register within Disable().  This is done to avoid
  	 * race conditions since our compiler may generate code such as:
  	 *
! 	 *	value = Read hardware byte
  	 *	AND value with MASK
  	 *	Write value to hardware byte
***************
*** 1036,1050 ****
  	/* Initialize arg struct for inthandler */
  	Disable();
! 	IntData.pubIndex      = pubAllocedArray;
! 	IntData.pubArray      = pubAllocedArray;
  	if (pubAllocedArray)
  	{
  		IntData.pubHalfIndex  = &pubAllocedArray[ulAllocedArraySize/2];
! 		IntData.pubEndIndex   = &pubAllocedArray[ulAllocedArraySize-1];
  	}
  	else
  	{
  		IntData.pubHalfIndex  = NULL;
! 		IntData.pubEndIndex   = NULL;
  	}
  	Enable();
--- 1091,1105 ----
  	/* Initialize arg struct for inthandler */
  	Disable();
! 	IntData.pubIndex	  = pubAllocedArray;
! 	IntData.pubArray	  = pubAllocedArray;
  	if (pubAllocedArray)
  	{
  		IntData.pubHalfIndex  = &pubAllocedArray[ulAllocedArraySize/2];
! 		IntData.pubEndIndex	  = &pubAllocedArray[ulAllocedArraySize-1];
  	}
  	else
  	{
  		IntData.pubHalfIndex  = NULL;
! 		IntData.pubEndIndex	  = NULL;
  	}
  	Enable();
***************
*** 1073,1077 ****
  	Disable();
  	*ft->ciahi = ((uwMicros & 0xFF00)>>8);
! 	*ft->cialo =  (uwMicros & 0x00FF)    ;
  	Enable();
  }
--- 1128,1132 ----
  	Disable();
  	*ft->ciahi = ((uwMicros & 0xFF00)>>8);
! 	*ft->cialo =  (uwMicros & 0x00FF)	 ;
  	Enable();
  }
***************
*** 1083,1087 ****
   *
   * This routine makes no assumptions about which interval timers
!  * (if any) are available for use.  Currently there are two interval
   * timers per CIA chip.
   *
--- 1138,1142 ----
   *
   * This routine makes no assumptions about which interval timers
!  * (if any) are available for use.	Currently there are two interval
   * timers per CIA chip.
   *
***************
*** 1105,1109 ****
  	/* Try for CIA-A */
  	ft->ciabase = ciaabase;		/* library address for */
! 	ft->cia	= pciaa;
  	ft->BUsingCIAB = FALSE;
  	if (TryTimer(ft)) return(TRUE);
--- 1160,1164 ----
  	/* Try for CIA-A */
  	ft->ciabase = ciaabase;		/* library address for */
! 	ft->cia = pciaa;
  	ft->BUsingCIAB = FALSE;
  	if (TryTimer(ft)) return(TRUE);
***************
*** 1111,1117 ****
  	/* Couldn't get CIA-A, try for CIA-B */
  	ft->ciabase = ciabbase;
! 	ft->cia	    = pciab;
  	ft->BUsingCIAB = TRUE;
!  	return(TryTimer(ft));
  }
  
--- 1166,1172 ----
  	/* Couldn't get CIA-A, try for CIA-B */
  	ft->ciabase = ciabbase;
! 	ft->cia		= pciab;
  	ft->BUsingCIAB = TRUE;
! 	return(TryTimer(ft));
  }
  
***************
*** 1141,1145 ****
  /* returns success, or if BAlloc == CHECK_STATUS, returns TRUE if
     available, FALSE if not */
! /* Don't call this manually except to check_status!  StartSampling
     will call it as necessary! */
  BOOL AllocParallel(BOOL BAlloc, BOOL BGrab)
--- 1196,1200 ----
  /* returns success, or if BAlloc == CHECK_STATUS, returns TRUE if
     available, FALSE if not */
! /* Don't call this manually except to check_status!	 StartSampling
     will call it as necessary! */
  BOOL AllocParallel(BOOL BAlloc, BOOL BGrab)
***************
*** 1159,1167 ****
  			/* If another AmiPhone is using the parallel, we'll try to kick them off! */
  			if ((BGrab == TRUE)&&(strncmp(szCurrentUser, "AmiPhone", 8) == 0)&&
! 			    (TellOtherAmiPhoneToLetGo(szCurrentUser) == TRUE)) 
! 			    {
! 			    	Delay(5);	/* allow the other guy time to disengage */
! 			    	return(AllocParallel(TRUE, FALSE));
! 			    }
  			
  			sprintf(szMessage,"%s Parallel port in use.",pcErrType);
--- 1214,1222 ----
  			/* If another AmiPhone is using the parallel, we'll try to kick them off! */
  			if ((BGrab == TRUE)&&(strncmp(szCurrentUser, "AmiPhone", 8) == 0)&&
! 				(TellOtherAmiPhoneToLetGo(szCurrentUser) == TRUE)) 
! 				{
! 					Delay(5);	/* allow the other guy time to disengage */
! 					return(AllocParallel(TRUE, FALSE));
! 				}
  			
  			sprintf(szMessage,"%s Parallel port in use.",pcErrType);
***************
*** 1182,1186 ****
  	if ((BAlloc == FALSE)||(BAlloc == CHECK_STATUS))	
  	{		
! 		FreeMiscResource(MR_PARALLELBITS); 		
  		FreeMiscResource(MR_PARALLELPORT);
  	}			
--- 1237,1241 ----
  	if ((BAlloc == FALSE)||(BAlloc == CHECK_STATUS))	
  	{		
! 		FreeMiscResource(MR_PARALLELBITS);		
  		FreeMiscResource(MR_PARALLELPORT);
  	}			
***************
*** 1215,1219 ****
  	{
  		if (sigfull != 0) {FreeSignal(sigfull);	 sigfull = 0;}
! 		if (sighalf != 0) {FreeSignal(sighalf);  sighalf = 0;}
  	}	
  	return(TRUE);	
--- 1270,1274 ----
  	{
  		if (sigfull != 0) {FreeSignal(sigfull);	 sigfull = 0;}
! 		if (sighalf != 0) {FreeSignal(sighalf);	 sighalf = 0;}
  	}	
  	return(TRUE);	
***************
*** 1240,1249 ****
  	ulTemp >>= 2;
  
! 	/* compression algorithm specific size restrictions implemented here */	
  	switch(bComp)
  	{
  		case COMPRESS_ADPCM2: while (ulTemp % 2) ulTemp++; break;
  		case COMPRESS_ADPCM3: while (ulTemp % 3) ulTemp++; break;
! 		case COMPRESS_NONE:   while (ulTemp % 2) ulTemp++; break;
  	}
  	return(ulTemp);
--- 1295,1304 ----
  	ulTemp >>= 2;
  
! 	/* compression algorithm specific size restrictions implemented here */ 
  	switch(bComp)
  	{
  		case COMPRESS_ADPCM2: while (ulTemp % 2) ulTemp++; break;
  		case COMPRESS_ADPCM3: while (ulTemp % 3) ulTemp++; break;
! 		case COMPRESS_NONE:	  while (ulTemp % 2) ulTemp++; break;
  	}
  	return(ulTemp);
***************
*** 1254,1260 ****
  {
  	ubCurrComp = ubNewMode;
- 	
- 	/* Force reset! */
- 	if (ubSamplerType == SAMPLER_DELFINA) ChangeSampleSpeed(ulBytesPerSecond, ubCurrComp);
  }
  
--- 1309,1312 ----
***************
*** 1269,1283 ****
  		if ((ulNewBPS == 0)||(ulNewBPS > nMaxSampleRate)) ulNewBPS = T_FindFrequency(0);
  	}
! 	if (ubSamplerType == SAMPLER_DELFINA) ulNewBPS = GetClosestDelfRate(ulNewBPS, NULL, NULL);
! 	if ((ubSamplerType == SAMPLER_AHI)&&(ulAHIAudioMode)) ulNewBPS = AHI_FindFrequency(ulNewBPS);
  
  	/* make sure our sampling isn't too fast or too slow */
  	if (UsesCIAInterrupt())
! 	    	ulNewBPS = ChopValue(ulNewBPS, MIN_SAMPLE_RATE, nMaxSampleRate);
  
  	/* make sure our packets aren't too small  */
  	if (fPacketDelay < MIN_PACKET_INTERVAL) fPacketDelay = MIN_PACKET_INTERVAL;
  
! 	/* To keep a particular speed, add this:         */
  	/* if (bComp == COMPRESS_SDP1) ulNewBPS = 6000L; */
  
--- 1321,1334 ----
  		if ((ulNewBPS == 0)||(ulNewBPS > nMaxSampleRate)) ulNewBPS = T_FindFrequency(0);
  	}
! 	if ((ubSamplerType == SAMPLER_AHI)&&(ulAHIMode != AHI_INVALID_ID)) ulNewBPS = AHI_FindFrequency(ulNewBPS);
  
  	/* make sure our sampling isn't too fast or too slow */
  	if (UsesCIAInterrupt())
! 			ulNewBPS = ChopValue(ulNewBPS, MIN_SAMPLE_RATE, nMaxSampleRate);
  
  	/* make sure our packets aren't too small  */
  	if (fPacketDelay < MIN_PACKET_INTERVAL) fPacketDelay = MIN_PACKET_INTERVAL;
  
! 	/* To keep a particular speed, add this:		 */
  	/* if (bComp == COMPRESS_SDP1) ulNewBPS = 6000L; */
  
***************
*** 1294,1298 ****
  			
  			Disable();
! 			IntData.uwCiavals     = ulTimerDelay;
  			IntData.ulThreshhold  = (ULONG) (nMinSampleVol*255)/100;
  			UNLESS(IntData.BIdle) SetTimerCountdown(NULL,ulTimerDelay);
--- 1345,1349 ----
  			
  			Disable();
! 			IntData.uwCiavals	  = ulTimerDelay;
  			IntData.ulThreshhold  = (ULONG) (nMinSampleVol*255)/100;
  			UNLESS(IntData.BIdle) SetTimerCountdown(NULL,ulTimerDelay);
***************
*** 1315,1319 ****
  /* Go through and make the bytes in the buffer unsigned,
     and add up their total and return it as well */
! ULONG ProcessToccataBuffer(UBYTE * pubData, ULONG ulDataLen)
  {
  	register ULONG ulSum = 0L;
--- 1366,1370 ----
  /* Go through and make the bytes in the buffer unsigned,
     and add up their total and return it as well */
! static ULONG ProcessToccataBuffer(UBYTE * pubData, ULONG ulDataLen)
  {
  	register ULONG ulSum = 0L;
***************
*** 1332,1370 ****
  
  
! /* Turn the words in the buffer into bytes.  Note that the
!    ulDataLen parameter is the length of the buffer in BYTES,
!    and when the function returns, only the first half of
!    the buffer will be valid. */
  /* Returns the sample sum, just like ProcessToccataBuffer() */
  
! /* pubData    - pointer to the sampled buffer */
! /* ulDataLen  - in/out variable, sends in length of buffer at current
! 		bit-width, etc... returns out the length of buffer 
! 		in 8-bit mono */
! /* ulType     - The data type as given by AHI */
! ULONG ProcessAHIBuffer(UBYTE * pubData, ULONG * ulDataLen, ULONG ulType)
  {
  	register ULONG ulSum = 0L;
! 	register UBYTE ubTemp, ubReadDiff;
! 	register UBYTE * pubCurrentRead  = pubData;
! 	register UBYTE * pubCurrentWrite = pubData;
! 	register ULONG ulLeft;
  	
  	switch(ulType)
  	{
- 		case AHIST_M8S:   /* Mono, 8 bit signed (BYTE) */
- 			ubReadDiff = 1;
- 			break;
- 								
- 		case AHIST_M8U:   /* Mono, 8 bit unsigned (UBYTE) */
- 			ubReadDiff = 1;
- 			break;
- 			
- 		case AHIST_M16S:  /* Mono, 16 bit signed (WORD) */
- 			ubReadDiff = 2;
- 			break;
- 			
  		case AHIST_S16S:  /* Stereo 16 bit signed (2×WORD) */
- 			ubReadDiff = 4;
  			if (ubInputChannel == INPUT_JACK_RIGHT) pubCurrentRead += 2;
  			break;
--- 1383,1404 ----
  
  
! /* Turn the words in the buffer into bytes. */
  /* Returns the sample sum, just like ProcessToccataBuffer() */
  
! /* pubSrc	  - pointer to the sampled buffer */
! /* pubDst	  - pointer to the destination buffer */
! /* ulDataLen  - length is samples */
! /* ulType	  - The data type as given by AHI */
! static ULONG ProcessAHIBuffer(UBYTE * pubSrc, UBYTE * pubDst, ULONG ulDataLen, ULONG ulType)
  {
  	register ULONG ulSum = 0L;
! 	register UBYTE ubTemp = 0;
! 	register UBYTE * pubCurrentRead	 = pubSrc;
! 	register UBYTE * pubCurrentWrite = pubDst;
! 	register ULONG ulLeft = ulDataLen;
  	
  	switch(ulType)
  	{
  		case AHIST_S16S:  /* Stereo 16 bit signed (2×WORD) */
  			if (ubInputChannel == INPUT_JACK_RIGHT) pubCurrentRead += 2;
  			break;
***************
*** 1375,1386 ****
  	}
  	
- 	*ulDataLen = ulLeft = (*ulDataLen)/ubReadDiff;
- 	
  	while(ulLeft--)
  	{
! 		ubTemp = ((*pubCurrentRead)-128)<<nAmpShift;
! 		ulSum += ubTemp;
  		*pubCurrentWrite = ubTemp;
! 		pubCurrentRead += ubReadDiff; pubCurrentWrite++;
  	}
  	return(ulSum);
--- 1409,1419 ----
  	}
  	
  	while(ulLeft--)
  	{
! 		ubTemp = (*pubCurrentRead)<<nAmpShift;
  		*pubCurrentWrite = ubTemp;
! 		ulSum += ubTemp;
! 		pubCurrentRead += 4;
! 		pubCurrentWrite++;
  	}
  	return(ulSum);
***************
*** 1400,1404 ****
  	{
  		ulMaxArrayCount = ulSampleArraySize << 6;
! 		ulVolume >>= 4;	/* It's still a mystery to me why this is 16 times too big! */
  	}
  	else
--- 1433,1437 ----
  	{
  		ulMaxArrayCount = ulSampleArraySize << 6;
! 		ulVolume >>= 4; /* It's still a mystery to me why this is 16 times too big! */
  	}
  	else
***************
*** 1420,1424 ****
  	{
  		case SAMPLER_GVPDSS8:	ulVol <<= 1; break;
! 		case SAMPLER_TOCCATA:   ulVol <<= 2; break;
  	}
  	
--- 1453,1457 ----
  	{
  		case SAMPLER_GVPDSS8:	ulVol <<= 1; break;
! 		case SAMPLER_TOCCATA:	ulVol <<= 2; break;
  	}
  	
***************
*** 1437,1441 ****
  
  /* If nBytes == ALL_OF_BUFFER, transmit the whole buffer section.
!    Otherwise, transmit the first nBytes of the indicated buffer. */   
  void TransmitData(UBYTE * pubStart, int nBytes, int bComp)
  {
--- 1470,1474 ----
  
  /* If nBytes == ALL_OF_BUFFER, transmit the whole buffer section.
!    Otherwise, transmit the first nBytes of the indicated buffer. */	  
  void TransmitData(UBYTE * pubStart, int nBytes, int bComp)
  {
***************
*** 1443,1447 ****
  	BOOL BSoundWasOnBefore = BSoundOn;
  	static ULONG ulSaveJoin = 0L, ulJoinCode = 0L;
! 	static int nPostGracePeriod = nPostSendLen;
  			
  	if (nBytes == 0)
--- 1476,1482 ----
  	BOOL BSoundWasOnBefore = BSoundOn;
  	static ULONG ulSaveJoin = 0L, ulJoinCode = 0L;
! 	static int nPostGracePeriod;
! 
!   nPostGracePeriod = nPostSendLen;
  			
  	if (nBytes == 0)
***************
*** 1454,1460 ****
  
  	/* Was there enough sound there to transmit? */
! 	if (ubSamplerType == SAMPLER_DELFINA)
! 		ulLastVolume = IntData.ulSaveByteSum = DelfPacket(sendBuf.ubData, nBytes, &ulSaveJoin);
! 	   else ulLastVolume = IntData.ulSaveByteSum;
  	   
  	if (CalcVolumePercentage(ulLastVolume) < nMinSampleVol)
--- 1489,1493 ----
  
  	/* Was there enough sound there to transmit? */
!   ulLastVolume = IntData.ulSaveByteSum;
  	   
  	if (CalcVolumePercentage(ulLastVolume) < nMinSampleVol)
***************
*** 1462,1467 ****
  		/* This section entered if the current buffer is too quiet */
  		if (nPostGracePeriod > 0) 
! 		     nPostGracePeriod--; /* time is running out to hear something! */
! 		else BSoundOn = FALSE;	 /* time's up!  Shut off the transmission! */
  	}
  	else 
--- 1495,1500 ----
  		/* This section entered if the current buffer is too quiet */
  		if (nPostGracePeriod > 0) 
! 			 nPostGracePeriod--; /* time is running out to hear something! */
! 		else BSoundOn = FALSE;	 /* time's up!	Shut off the transmission! */
  	}
  	else 
***************
*** 1488,1506 ****
  		/* Prepare/compress the packet */
  		sendBuf.header.ubCommand  = PHONECOMMAND_DATA;
! 		sendBuf.header.ubType     = bComp;
  		sendBuf.header.ulBPS	  = ulBytesPerSecond;
  		sendBuf.header.ulJoinCode = ulJoinCode;
  
! 		if (ubSamplerType == SAMPLER_DELFINA)
! 		{
! 			/* Compression was done by the Delfina's DSP, 
! 			   all we need to do here is get the next ulJoinCode */
! 			sendBuf.header.ulDataLen = nBytes;
! 		}
! 		else
! 		{
! 			/* Do the compression ourselves! */
! 			sendBuf.header.ulDataLen  = CompressData(pubStart,sendBuf.ubData,bComp,ulLength,&ulJoinCode);
! 		}	
  	}
  
--- 1521,1529 ----
  		/* Prepare/compress the packet */
  		sendBuf.header.ubCommand  = PHONECOMMAND_DATA;
! 		sendBuf.header.ubType	  = bComp;
  		sendBuf.header.ulBPS	  = ulBytesPerSecond;
  		sendBuf.header.ulJoinCode = ulJoinCode;
  
! 		sendBuf.header.ulDataLen  = CompressData(pubStart,sendBuf.ubData,bComp,ulLength,&ulJoinCode);
  	}
  
***************
*** 1519,1525 ****
  	}	
  
- 	/* For Delfina:  *Now* update ulJoinCode, AFTER we've set sendBuf.header.ulJoinCode */
- 	if (ubSamplerType == SAMPLER_DELFINA) ulJoinCode = ulSaveJoin;
- 
  	/* If we're doing hold-to-transmit and button is no longer being held, turn sampler off */
  	if ((nToggleMode == TOGGLE_HOLD)&&(BButtonHeld == FALSE)) ToggleMicButton(CODE_OFF);
--- 1542,1545 ----
***************
*** 1556,1560 ****
  
  /* Empty the presend queue, either with or without transmitting packets */
! void FlushPreSendQueue(BOOL BTransmit, BOOL BTCP)
  {	
  	struct Node * current;
--- 1576,1580 ----
  
  /* Empty the presend queue, either with or without transmitting packets */
! static void FlushPreSendQueue(BOOL BTransmit, BOOL BTCP)
  {	
  	struct Node * current;
***************
*** 1567,1571 ****
  }
  
! void FreePreSendNode(struct Node * current)
  {
  	struct AmiPhoneSendBuffer * packet = current->ln_Name;
--- 1587,1591 ----
  }
  
! static void FreePreSendNode(struct Node * current)
  {
  	struct AmiPhoneSendBuffer * packet = current->ln_Name;
***************
*** 1576,1580 ****
  }
  
! void UpdatePreSendQueue(struct AmiPhoneSendBuffer * sBuf)
  {
  	struct AmiPhoneSendBuffer * newPacket;
--- 1596,1600 ----
  }
  
! static void UpdatePreSendQueue(struct AmiPhoneSendBuffer * sBuf)
  {
  	struct AmiPhoneSendBuffer * newPacket;
***************
*** 1631,1636 ****
  	if (ubBitCode & SAMPBIT_POUTSET) SETCIA(CIAF_PRTRPOUT);
  	
! 	if (ubBitCode & SAMPBIT_SELCLR)  CLRCIA(CIAF_PRTRSEL);
! 	if (ubBitCode & SAMPBIT_SELSET)  SETCIA(CIAF_PRTRSEL);
  	
  	if (ubBitCode & SAMPBIT_BUSYCLR) CLRCIA(CIAF_PRTRBUSY);
--- 1651,1656 ----
  	if (ubBitCode & SAMPBIT_POUTSET) SETCIA(CIAF_PRTRPOUT);
  	
! 	if (ubBitCode & SAMPBIT_SELCLR)	 CLRCIA(CIAF_PRTRSEL);
! 	if (ubBitCode & SAMPBIT_SELSET)	 SETCIA(CIAF_PRTRSEL);
  	
  	if (ubBitCode & SAMPBIT_BUSYCLR) CLRCIA(CIAF_PRTRBUSY);
***************
*** 1651,1656 ****
  	if (ubBitCode & SAMPBIT_POUTSET) SETDCIA(CIAF_PRTRPOUT);
  	
! 	if (ubBitCode & SAMPBIT_SELCLR)  CLRDCIA(CIAF_PRTRSEL);
! 	if (ubBitCode & SAMPBIT_SELSET)  SETDCIA(CIAF_PRTRSEL);
  	
  	if (ubBitCode & SAMPBIT_BUSYCLR) CLRDCIA(CIAF_PRTRBUSY);
--- 1671,1676 ----
  	if (ubBitCode & SAMPBIT_POUTSET) SETDCIA(CIAF_PRTRPOUT);
  	
! 	if (ubBitCode & SAMPBIT_SELCLR)	 CLRDCIA(CIAF_PRTRSEL);
! 	if (ubBitCode & SAMPBIT_SELSET)	 SETDCIA(CIAF_PRTRSEL);
  	
  	if (ubBitCode & SAMPBIT_BUSYCLR) CLRDCIA(CIAF_PRTRBUSY);
***************
*** 1658,1662 ****
  
  	if ((ubSamplerType == SAMPLER_CUSTOM)&&
! 	    (ubBitCode != (SAMPBIT_POUTSET | SAMPBIT_SELSET | SAMPBIT_BUSYSET))) printf("SetDirectionBits:  Executed %s, direction bits are now %s\n",BitsToString(ubBitCode),RegToString(pciab->ciaddra));
  }
  
--- 1678,1682 ----
  
  	if ((ubSamplerType == SAMPLER_CUSTOM)&&
! 		(ubBitCode != (SAMPBIT_POUTSET | SAMPBIT_SELSET | SAMPBIT_BUSYSET))) printf("SetDirectionBits:	Executed %s, direction bits are now %s\n",BitsToString(ubBitCode),RegToString(pciab->ciaddra));
  }
  
***************
*** 1684,1688 ****
  		(ubReg & CIAF_PRTRPOUT) != 0,
  		(ubReg & CIAF_PRTRBUSY) != 0,
! 		(ubReg & CIAF_PRTRSEL)  != 0);
  	
  	return(szResult);
--- 1704,1708 ----
  		(ubReg & CIAF_PRTRPOUT) != 0,
  		(ubReg & CIAF_PRTRBUSY) != 0,
! 		(ubReg & CIAF_PRTRSEL)	!= 0);
  	
  	return(szResult);
***************
*** 1696,1710 ****
  	struct TagItem taglist[3];
  
! 	taglist[0].ti_Tag  = AHIDB_Index; 	taglist[0].ti_Data  = &ulIndex;
! 	taglist[1].ti_Tag  = AHIDB_IndexArg; 	taglist[1].ti_Data  = ulBPS;
! 	taglist[2].ti_Tag  = TAG_DONE;		taglist[2].ti_Data  = NULL;
! 	if (AHI_GetAudioAttrsA(ulAHIAudioMode, NULL, taglist))
! 	{
! 		printf("AHI_FindFrequency: Nearest index = %lu\n",ulIndex);
! 		taglist[0].ti_Tag  = AHIDB_Frequency; 	taglist[0].ti_Data  = &ulFreq;
! 		taglist[1].ti_Tag  = AHIDB_FrequencyArg;taglist[1].ti_Data  = ulIndex;
! 		if (AHI_GetAudioAttrsA(ulAHIAudioMode, NULL, taglist))
  		{
! 			printf("AHI_FindFrequency: Frequency to use:  %lu\n",ulFreq);
  			return(ulFreq);
  		}
--- 1716,1730 ----
  	struct TagItem taglist[3];
  
! 	taglist[0].ti_Tag  = AHIDB_Index;	taglist[0].ti_Data	= &ulIndex;
! 	taglist[1].ti_Tag  = AHIDB_IndexArg;	taglist[1].ti_Data	= ulBPS;
! 	taglist[2].ti_Tag  = TAG_DONE;		taglist[2].ti_Data	= NULL;
! 	if (AHI_GetAudioAttrsA(ulAHIMode, NULL, taglist))
! 	{
! //		printf("AHI_FindFrequency: Nearest index = %lu\n",ulIndex);
! 		taglist[0].ti_Tag  = AHIDB_Frequency;	taglist[0].ti_Data	= &ulFreq;
! 		taglist[1].ti_Tag  = AHIDB_FrequencyArg;taglist[1].ti_Data	= ulIndex;
! 		if (AHI_GetAudioAttrsA(ulAHIMode, NULL, taglist))
  		{
! //			printf("AHI_FindFrequency: Frequency to use:  %lu\n",ulFreq);
  			return(ulFreq);
  		}
Only in ../AmiPhone_1.92: ciatimer.c.info
diff -r -C 2 -P ../AmiPhone_1.92/ciatimer.h ./ciatimer.h
*** ../AmiPhone_1.92/ciatimer.h	Sat Nov 16 23:46:40 1996
--- ./ciatimer.h	Mon Feb 16 23:09:58 1998
***************
*** 44,53 ****
  BOOL SetupPreSendQueue(BOOL BSetup);
  
- ULONG ProcessToccataBuffer(UBYTE * pubData, ULONG ulDataLen);
- ULONG ProcessAHIBuffer(UBYTE * pubData, ULONG * ulDataLen, ULONG ulType);
- 
  void TransmitData(UBYTE * pubStart, int ulLength, int bTransmitMode);
  void ChangeInputChannel(int nNewChannel);
  void ChangeSamplerType(int nNewSamplerType);
  void ChangeInputSource(int nNewSource, BOOL BMakePermanent);
  void ChangeCompressMode(UBYTE ubNewMode);
--- 44,51 ----
  BOOL SetupPreSendQueue(BOOL BSetup);
  
  void TransmitData(UBYTE * pubStart, int ulLength, int bTransmitMode);
  void ChangeInputChannel(int nNewChannel);
  void ChangeSamplerType(int nNewSamplerType);
+ void ChangeAHIMode(void);
  void ChangeInputSource(int nNewSource, BOOL BMakePermanent);
  void ChangeCompressMode(UBYTE ubNewMode);
diff -r -C 2 -P ../AmiPhone_1.92/codec.c ./codec.c
*** ../AmiPhone_1.92/codec.c	Sat Nov 16 23:46:38 1996
--- ./codec.c	Sun Feb 15 23:04:26 1998
***************
*** 1,8 ****
--- 1,10 ----
  #ifndef CODEC_C
  #define CODEC_C
+ /* :ts=4 */
  
  /* codec.c : routines shared by AmiPhone AND AmiPhoned--govern audio
     	     compression, decompression, and playing */
  
+ #include <netinclude:sys/types.h>
  #include <stdio.h>
  #include <string.h>
***************
*** 224,228 ****
  	}
  	return(TRUE);
! };
  
  
--- 226,230 ----
  	}
  	return(TRUE);
! }
  
  
Only in ../AmiPhone_1.92: codec.c.info
diff -r -C 2 -P ../AmiPhone_1.92/compress/ADPCM2_Crunch.a ./compress/ADPCM2_Crunch.a
*** ../AmiPhone_1.92/compress/ADPCM2_Crunch.a	Sat Nov 16 23:46:46 1996
--- ./compress/ADPCM2_Crunch.a	Sun Feb 15 18:40:33 1998
***************
*** 20,25 ****
  
  
! 		XDEF @CompressADPCM2
! @CompressADPCM2
  		movem.l	d2-d4,-(sp)
  
--- 20,25 ----
  
  
! 		XDEF _CompressADPCM2
! _CompressADPCM2
  		movem.l	d2-d4,-(sp)
  
diff -r -C 2 -P ../AmiPhone_1.92/compress/ADPCM2_Decrunch.a ./compress/ADPCM2_Decrunch.a
*** ../AmiPhone_1.92/compress/ADPCM2_Decrunch.a	Sat Nov 16 23:46:46 1996
--- ./compress/ADPCM2_Decrunch.a	Sun Feb 15 18:40:29 1998
***************
*** 26,31 ****
  	;
  
! 		XDEF @DecompressADPCM2
! @DecompressADPCM2
  		movem.l	d2-d4,-(sp)
  
--- 26,31 ----
  	;
  
! 		XDEF _DecompressADPCM2
! _DecompressADPCM2
  		movem.l	d2-d4,-(sp)
  
diff -r -C 2 -P ../AmiPhone_1.92/compress/ADPCM3_Crunch.a ./compress/ADPCM3_Crunch.a
*** ../AmiPhone_1.92/compress/ADPCM3_Crunch.a	Sat Nov 16 23:46:46 1996
--- ./compress/ADPCM3_Crunch.a	Sun Feb 15 18:40:26 1998
***************
*** 18,23 ****
  	; Function of the JoinCode: See above.
  
! 		XDEF @CompressADPCM3
! @CompressADPCM3
  		movem.l	d2-d4,-(sp)
  
--- 18,23 ----
  	; Function of the JoinCode: See above.
  
! 		XDEF _CompressADPCM3
! _CompressADPCM3
  		movem.l	d2-d4,-(sp)
  
diff -r -C 2 -P ../AmiPhone_1.92/compress/ADPCM3_Decrunch.a ./compress/ADPCM3_Decrunch.a
*** ../AmiPhone_1.92/compress/ADPCM3_Decrunch.a	Sat Nov 16 23:46:46 1996
--- ./compress/ADPCM3_Decrunch.a	Sun Feb 15 18:40:23 1998
***************
*** 28,33 ****
  	;
  
! 		XDEF @DecompressADPCM3
! @DecompressADPCM3
  		movem.l	d2-d4,-(sp)
  
--- 28,33 ----
  	;
  
! 		XDEF _DecompressADPCM3
! _DecompressADPCM3
  		movem.l	d2-d4,-(sp)
  
Only in ../AmiPhone_1.92: delfph.c
Only in ../AmiPhone_1.92: delfph.c.info
Only in ../AmiPhone_1.92: delfph.h
Only in ../AmiPhone_1.92: delfphone.c
diff -r -C 2 -P ../AmiPhone_1.92/dmakefile ./dmakefile
*** ../AmiPhone_1.92/dmakefile	Sat Nov 16 23:46:48 1996
--- ./dmakefile	Sun Feb 15 12:47:03 1998
***************
*** 1,4 ****
  SCC = dcc -proto
! ASM = phxass I=include:amiga SD SC
  
  ASM_OBJS  = inthandler.o compress/ADPCM2_Crunch.o compress/ADPCM3_Crunch.o compress/ADPCM2_Decrunch.o compress/ADPCM3_Decrunch.o
--- 1,4 ----
  SCC = dcc -proto
! ASM = phxass SD SC
  
  ASM_OBJS  = inthandler.o compress/ADPCM2_Crunch.o compress/ADPCM3_Crunch.o compress/ADPCM2_Decrunch.o compress/ADPCM3_Decrunch.o
Only in ../AmiPhone_1.92: dmakefile.info
diff -r -C 2 -P ../AmiPhone_1.92/gst.c ./gst.c
*** ../AmiPhone_1.92/gst.c	Thu Jan  1 01:00:00 1970
--- ./gst.c	Mon Feb 16 23:29:06 1998
***************
*** 0 ****
--- 1,351 ----
+ #include <stdio.h>
+ #include <stdlib.h> 
+ #include <string.h>
+ #include <time.h>
+ #include <devices/timer.h>
+ #include <devices/ahi.h>
+ #include <dos/dos.h>
+ #include <dos/dostags.h>
+ #include <dos/dosextens.h>
+ #include <intuition/intuition.h>
+ #include <intuition/intuitionbase.h>
+ #include <intuition/gadgetclass.h>
+ #include <intuition/screens.h>
+ #include <libraries/gadtools.h>
+ #include <exec/ports.h>
+ #include <exec/memory.h>
+ #include <exec/types.h>
+ #include <exec/tasks.h>
+ #include <exec/io.h>
+ #include <exec/libraries.h>
+ #include <libraries/dos.h>			/* contains RETURN_OK, RETURN_WARN #def's */
+ #include <graphics/gfxbase.h>
+ #include <libraries/gadtools.h>
+ #include <sys/types.h>
+ #include <workbench/workbench.h>
+ #include <workbench/startup.h>
+ #include <resources/misc.h>
+ #include <graphics/text.h>
+ #include <errno.h>
+ #include <inetd.h>
+ #include <sys/errno.h>
+ #include <clib/alib_protos.h>
+ #include <clib/dos_protos.h>
+ #include <clib/exec_protos.h>
+ #include <clib/intuition_protos.h>
+ #include <clib/graphics_protos.h>
+ #include <clib/gadtools_protos.h>
+ #include <clib/wb_protos.h>
+ #include <clib/icon_protos.h>
+ #include <clib/diskfont_protos.h>
+ #include <clib/iffparse_protos.h>
+ #include <pragmas/ahi_pragmas.h>
+ #include <libraries/toccata.h>
+ #include <clib/toccata_protos.h>
+ #include <pragmas/toccata_pragmas.h>
+ #include <netinclude:sys/types.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
+ #include <time.h>
+ #include <exec/types.h>
+ #include <exec/io.h>
+ #include <exec/lists.h>
+ #include <exec/memory.h>
+ #include <devices/audio.h>
+ #include <libraries/dos.h>			/* contains RETURN_OK, RETURN_WARN #def's */
+ #include <dos/dos.h>
+ #include <dos/dosextens.h>
+ #include <dos/dostags.h>
+ #include <dos/var.h>
+ #include <dos/exall.h>
+ #include <graphics/gfxbase.h>		/* to determine if we are on a PAL or NTSC Amiga */
+ #include <intuition/intuition.h>
+ #include <libraries/gadtools.h>
+ #include <clib/exec_protos.h>
+ #include <clib/alib_protos.h>
+ #include <clib/dos_protos.h>
+ #include <clib/intuition_protos.h>
+ #include <clib/icon_protos.h>
+ #include <clib/gadtools_protos.h>
+ #include <clib/graphics_protos.h>
+ #include <errno.h>
+ #include <inetd.h>
+ #include <sys/types.h>
+ #include <proto/socket.h>
+ #include <sys/errno.h>
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ #include <sys/ioctl.h>
+ #include <sys/syslog.h>
+ #include <netdb.h>
+ #include <pragmas/socket_pragmas.h>
+ #include <inetd.h>
+ #include <stdio.h>
+ #include <string.h>
+ #include <time.h>
+ #include <clib/asl_protos.h>
+ #include <clib/intuition_protos.h>
+ #include <libraries/asl.h>
+ #include <netinclude:sys/types.h>
+ #include <stdio.h>
+ #include <stdio.h>
+ #include <stdlib.h> 
+ #include <string.h>
+ #include <time.h>
+ #include <dos/dos.h>
+ #include <dos/dostags.h>
+ #include <dos/dosextens.h>
+ #include <dos/var.h>
+ #include <dos/exall.h>
+ #include <intuition/intuition.h>
+ #include <intuition/intuitionbase.h>
+ #include <intuition/gadgetclass.h>
+ #include <intuition/screens.h>
+ #include <libraries/gadtools.h>
+ #include <exec/ports.h>
+ #include <exec/memory.h>
+ #include <exec/types.h>
+ #include <exec/tasks.h>
+ #include <exec/io.h>
+ #include <exec/libraries.h>
+ #include <libraries/dos.h>			/* contains RETURN_OK, RETURN_WARN #def's */
+ #include <libraries/gadtools.h>
+ #include <clib/alib_protos.h>
+ #include <clib/dos_protos.h>
+ #include <clib/exec_protos.h>
+ #include <clib/intuition_protos.h>
+ #include <clib/graphics_protos.h>
+ #include <clib/gadtools_protos.h>
+ #include <clib/diskfont_protos.h>
+ #include <time.h>
+ #include <stdlib.h>
+ #include <stdio.h>
+ #include <string.h>
+ #include <math.h>
+ #include <exec/io.h>
+ #include <exec/types.h>
+ #include <exec/memory.h>
+ #include <exec/tasks.h>
+ #include <exec/interrupts.h>
+ #include <exec/ports.h>
+ #include <exec/lists.h>
+ #include <hardware/cia.h>
+ #include <hardware/intbits.h>
+ #include <libraries/mathieeesp.h>
+ #include <clib/mathieeedoubbas_protos.h>
+ #include <resources/cia.h>
+ #include <libraries/dos.h>
+ #include <resources/misc.h>
+ #include <utility/tagitem.h>
+ #include <pragmas/ahi_pragmas.h>
+ #include <devices/ahi.h>
+ #include <clib/alib_protos.h>
+ #include <clib/ahi_protos.h>
+ #include <clib/dos_protos.h>
+ #include <clib/cia_protos.h>
+ #include <clib/exec_protos.h>
+ #include <clib/misc_protos.h>
+ #include <libraries/toccata.h>
+ #include <clib/toccata_protos.h>
+ #include <pragmas/toccata_pragmas.h>
+ #include <netinclude:sys/types.h>
+ #include <stdio.h>
+ #include <string.h>
+ #include <stdlib.h>
+ #include <time.h>
+ #include <exec/types.h>
+ #include <exec/memory.h>
+ #include <exec/ports.h>
+ #include <devices/audio.h>
+ #include <libraries/dos.h>		/* contains RETURN_OK, RETURN_WARN #def's */
+ #include <graphics/gfxbase.h>		/* to determine if we are on a PAL or NTSC Amiga */
+ #include <clib/intuition_protos.h>
+ #include <clib/alib_protos.h>
+ #include <clib/exec_protos.h>
+ #include <clib/dos_protos.h>
+ #include <clib/socket_protos.h>
+ #include <pragmas/socket_pragmas.h>
+ #include <stdio.h>
+ #include <exec/types.h>
+ #include <hardware/cia.h>
+ #include <netinclude:sys/types.h>
+ #include <stdio.h>
+ #include <stdlib.h> 
+ #include <string.h>
+ #include <dos/dos.h>
+ #include <dos/dostags.h>
+ #include <devices/audio.h>
+ #include <intuition/intuition.h>
+ #include <intuition/intuitionbase.h>
+ #include <intuition/gadgetclass.h>
+ #include <intuition/screens.h>
+ #include <libraries/gadtools.h>
+ #include <dos/dosextens.h>
+ #include <exec/ports.h>
+ #include <exec/memory.h>
+ #include <exec/types.h>
+ #include <exec/tasks.h>
+ #include <exec/io.h>
+ #include <exec/libraries.h>
+ #include <libraries/dos.h>			/* contains RETURN_OK, RETURN_WARN #def's */
+ #include <graphics/gfxbase.h>
+ #include <libraries/gadtools.h>
+ #include <libraries/iffparse.h>
+ #include <errno.h>
+ #include <inetd.h>
+ #include <sys/errno.h>
+ #include <clib/alib_protos.h>
+ #include <clib/dos_protos.h>
+ #include <clib/exec_protos.h>
+ #include <clib/iffparse_protos.h>
+ #include <clib/intuition_protos.h>
+ #include <clib/graphics_protos.h>
+ #include <clib/gadtools_protos.h>
+ #include <clib/diskfont_protos.h>
+ #include <clib/iffparse_protos.h>
+ #include <libraries/toccata.h>
+ #include <clib/toccata_protos.h>
+ #include <pragmas/toccata_pragmas.h>
+ #include <exec/types.h>
+ #include <exec/memory.h>
+ #include <dos/dos.h>
+ #include <rexx/storage.h>
+ #include <rexx/rxslib.h>
+ #include <dos/exall.h>
+ #include <graphics/graphint.h>
+ #include <intuition/classes.h>
+ #include <devices/keymap.h>
+ #include <exec/semaphores.h>
+ #include <clib/alib_protos.h>
+ #include <clib/exec_protos.h>
+ #include <clib/dos_protos.h>
+ #include <clib/rexxsyslib_protos.h>
+ #include <pragmas/exec_pragmas.h>
+ #include <pragmas/dos_pragmas.h>
+ #include <pragmas/rexxsyslib_pragmas.h>
+ #include <stdlib.h>
+ #include <stdio.h>
+ #include <string.h>
+ #include <ctype.h>
+ #include <dos/rdargs.h>
+ #include <exec/types.h>
+ #include <dos/dos.h>
+ #include <rexx/storage.h>
+ #include <exec/types.h>
+ #include <exec/memory.h>
+ #include <dos/dos.h>
+ #include <rexx/storage.h>
+ #include <rexx/rxslib.h>
+ #include <dos/exall.h>
+ #include <graphics/graphint.h>
+ #include <intuition/classes.h>
+ #include <devices/keymap.h>
+ #include <exec/semaphores.h>
+ #include <clib/alib_protos.h>
+ #include <clib/exec_protos.h>
+ #include <clib/dos_protos.h>
+ #include <clib/rexxsyslib_protos.h>
+ #include <pragmas/exec_pragmas.h>
+ #include <pragmas/dos_pragmas.h>
+ #include <pragmas/rexxsyslib_pragmas.h>
+ #include <stdlib.h>
+ #include <stdio.h>
+ #include <string.h>
+ #include <ctype.h>
+ #include <netinclude:sys/types.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <errno.h>
+ #include <string.h>
+ #include <time.h>
+ #include <exec/types.h>
+ #include <exec/memory.h>
+ #include <libraries/dos.h>			/* contains RETURN_OK, RETURN_WARN #def's */
+ #include <dos/dosextens.h>
+ #include <dos/var.h>
+ #include <clib/exec_protos.h>
+ #include <clib/intuition_protos.h>
+ #include <clib/dos_protos.h>
+ #include <intuition/intuition.h>
+ #include <graphics/gfxbase.h>
+ #include <proto/socket.h>
+ #include <sys/errno.h>
+ #include <sys/socket.h>
+ #include <sys/ioctl.h>
+ #include <sys/syslog.h>
+ #include <netdb.h>
+ #include <amitcp/socketbasetags.h>
+ #include <pragmas/socket_pragmas.h>
+ #include <inetd.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <exec/types.h>
+ #include <proto/dos.h>
+ #include <proto/exec.h>
+ #include <proto/intuition.h>
+ #include <libraries/dos.h>
+ #include <intuition/intuition.h>
+ #include <exec/io.h>
+ #include <exec/memory.h>
+ #include <string.h>
+ #include <time.h>
+ #include <hardware/dmabits.h>
+ #include <hardware/intbits.h>
+ #include <hardware/custom.h>
+ #include <hardware/cia.h>
+ #include <devices/audio.h>
+ #include <resources/misc.h>
+ #include <dos/dosextens.h>
+ #include <exec/execbase.h>
+ #include <exec/memory.h>
+ #include <clib/exec_protos.h>
+ #include <clib/misc_protos.h>
+ #include <clib/dos_protos.h>
+ #include <clib/alib_protos.h>
+ #include <pragmas/exec_pragmas.h>
+ #include <pragmas/misc_pragmas.h>
+ #include <stdio.h>
+ #include <time.h>
+ #include <intuition/intuition.h>
+ #include <intuition/intuitionbase.h>
+ #include <intuition/screens.h>
+ #include <intuition/gadgetclass.h>
+ #include <libraries/gadtools.h>
+ #include <exec/types.h>
+ #include <exec/libraries.h>
+ #include <libraries/dos.h>			/* contains RETURN_OK, RETURN_WARN #def's */
+ #include <clib/exec_protos.h>
+ #include <clib/intuition_protos.h>
+ #include <clib/gadtools_protos.h>
+ #include <string.h>
+ #include <errno.h>
+ #include <libraries/gadtools.h>
+ #include <stdio.h>
+ #include <string.h>
+ #include <netinclude:sys/types.h>
+ #include <exec/types.h>
+ #include <exec/lists.h>
+ #include <exec/memory.h>
+ #include <clib/exec_protos.h>
+ #include <clib/alib_protos.h>
+ /* #include <errno.h> */
+ #include <inetd.h>
+ #include <sys/types.h>
+ #include <proto/socket.h>
+ #include <sys/errno.h>
+ #include <sys/types.h>
+ #include <sys/socket.h>
+ #include <sys/ioctl.h>
+ #include <sys/syslog.h>
+ #include <pragmas/socket_pragmas.h>
+ #include <CompilerSpecific.h>
+ #include <CompilerSpecific.h>
+ #include <exec/ports.h>
+ #include <CompilerSpecific.h>
+ #include <time.h>
+ #include <stdio.h>
+ #include <intuition/intuition.h>
+ #include <intuition/intuitionbase.h>
+ #include <intuition/gadgetclass.h>
+ #include <clib/intuition_protos.h>
Only in ../AmiPhone_1.92: include
diff -r -C 2 -P ../AmiPhone_1.92/listen.c ./listen.c
*** ../AmiPhone_1.92/listen.c	Sat Nov 16 23:46:42 1996
--- ./listen.c	Sun Feb 15 23:04:29 1998
***************
*** 1,2 ****
--- 1,3 ----
+ /* :ts=4 */
  
  #include <stdio.h>
diff -r -C 2 -P ../AmiPhone_1.92/menuconstants.h ./menuconstants.h
*** ../AmiPhone_1.92/menuconstants.h	Sat Nov 16 23:46:42 1996
--- ./menuconstants.h	Mon Feb 16 04:01:41 1998
***************
*** 2,32 ****
  /* menu constants */
  
! #define P_ABOUT		100
! #define P_QUIT		110
  
! #define T_CONNECT	200
  #define T_CONNECTTO     210
! #define T_DISCONNECT	220
  #define T_SHOWDAEMON    221
  
! #define M_MESSAGES	300
  #define M_PLAYFILE      301
  #define M_RECORDMEMO    302
  
! #define	S_DSS8		400
! #define	S_PERFECTSOUND  401
! #define	S_AMAS          402
! #define	S_TOCCATA       403
! #define	S_SOMAGIC       404
! #define	S_AURA		405
! #define S_AHI		406
! #define S_DELFINA	407
! #define S_CUSTOM	408
! #define	S_GENERIC	409
! #define S_ADPCM2	410
! #define S_ADPCM3	411
! #define S_NOCOMP	412
! #define S_TOGGLE	413
! #define S_HOLD		414
  #define S_RAISELINEGAIN 415
  #define S_LOWERLINEGAIN 416
--- 2,32 ----
  /* menu constants */
  
! #define P_ABOUT         100
! #define P_QUIT          110
  
! #define T_CONNECT       200
  #define T_CONNECTTO     210
! #define T_DISCONNECT    220
  #define T_SHOWDAEMON    221
  
! #define M_MESSAGES      300
  #define M_PLAYFILE      301
  #define M_RECORDMEMO    302
  
! #define S_DSS8          400
! #define S_PERFECTSOUND  401
! #define S_AMAS          402
! #define S_TOCCATA       403
! #define S_SOMAGIC       404
! #define S_AURA          405
! #define S_AHI           406
! #define S_CUSTOM        407
! #define S_GENERIC       408
! #define S_AHIMODE       409
! #define S_ADPCM2        410
! #define S_ADPCM3        411
! #define S_NOCOMP        412
! #define S_TOGGLE        413
! #define S_HOLD          414
  #define S_RAISELINEGAIN 415
  #define S_LOWERLINEGAIN 416
***************
*** 34,50 ****
  #define S_ZEROMICGAIN   418
  #define S_AMPONE        419
! #define S_AMPTWO	420
! #define S_AMPFOUR	421
  #define S_LEFTCHANNEL   422
  #define S_RIGHTCHANNEL  423
! #define S_INPUTMIC      424
! #define S_INPUTEXT      425
! #define S_ENABLEONCONN  426
! #define S_XMITONPLAY    427
! #define S_TCPBATCHXMIT  428
  
  
  /* slider id's */
! #define FREQ_SLIDER	(1)
! #define VOLUME_SLIDER	(2)
! #define DELAY_SLIDER	(3)
--- 34,58 ----
  #define S_ZEROMICGAIN   418
  #define S_AMPONE        419
! #define S_AMPTWO        420
! #define S_AMPFOUR       421
  #define S_LEFTCHANNEL   422
  #define S_RIGHTCHANNEL  423
! #define S_INPUTSRC0     424
! #define S_INPUTSRC1     425
! #define S_INPUTSRC2     426
! #define S_INPUTSRC3     427
! #define S_INPUTSRC4     428
! #define S_INPUTSRC5     429
! #define S_INPUTSRC6     430
! #define S_INPUTSRC7     431
! #define S_INPUTSRC8     432
! #define S_INPUTSRC9     433
! #define S_ENABLEONCONN  434
! #define S_XMITONPLAY    435
! #define S_TCPBATCHXMIT  436
  
  
  /* slider id's */
! #define FREQ_SLIDER     (1)
! #define VOLUME_SLIDER   (2)
! #define DELAY_SLIDER    (3)
diff -r -C 2 -P ../AmiPhone_1.92/messages.c ./messages.c
*** ../AmiPhone_1.92/messages.c	Sat Nov 16 23:46:42 1996
--- ./messages.c	Mon Feb 16 01:09:14 1998
***************
*** 1,6 ****
--- 1,8 ----
  /* AmiPhone!  by Jeremy Friesner - jfriesne@ucsd.edu */
+ /* :ts=4 */
  
  #define INTUI_V36_NAMES_ONLY
  
+ #include <netinclude:sys/types.h>
  #include <stdio.h>
  #include <stdlib.h> 
***************
*** 26,34 ****
  #include <libraries/gadtools.h>
  #include <libraries/iffparse.h>
- #include <sys/types.h>
  
  #include <errno.h>
  #include <inetd.h>
  
  #include <clib/alib_protos.h>
  #include <clib/dos_protos.h>
--- 28,37 ----
  #include <libraries/gadtools.h>
  #include <libraries/iffparse.h>
  
  #include <errno.h>
  #include <inetd.h>
  
+ #include <sys/errno.h>
+ 
  #include <clib/alib_protos.h>
  #include <clib/dos_protos.h>
***************
*** 41,47 ****
  #include <clib/iffparse_protos.h>
  
! #include "toccata/include/libraries/toccata.h"
! #include "toccata/include/clib/toccata_protos.h"
! #include "toccata/include/pragmas/toccata_pragmas.h"
  
  #include "AmiPhone.h"
--- 44,50 ----
  #include <clib/iffparse_protos.h>
  
! #include <libraries/toccata.h>
! #include <clib/toccata_protos.h>
! #include <pragmas/toccata_pragmas.h>
  
  #include "AmiPhone.h"
***************
*** 95,99 ****
  struct AmiPhonePacketHeader * TransferPacket;
  
! __geta4 void SoundPlayerMain(void);
  
  /* private vars */
--- 98,102 ----
  struct AmiPhonePacketHeader * TransferPacket;
  
! SAVEDS void SoundPlayerMain(void);
  
  /* private vars */
***************
*** 142,146 ****
  /* This tasks opens a file requester and if a file is selected, sends
     a MESSAGE_PLAY_FILE to the SoundPort. */
! __geta4 void FileReqMain(void)
  {
  	char szFile[300];
--- 145,149 ----
  /* This tasks opens a file requester and if a file is selected, sends
     a MESSAGE_PLAY_FILE to the SoundPort. */
! SAVEDS void FileReqMain(void)
  {
  	char szFile[300];
***************
*** 198,202 ****
     process to play the given sound, and may be stopped by sending it
     a control-C or a MESSAGE_DIE */
! __geta4 void SoundPlayerMain(void)
  {
  	char szBuf[5] = "\0\0\0\0\0";
--- 201,205 ----
     process to play the given sound, and may be stopped by sending it
     a control-C or a MESSAGE_DIE */
! SAVEDS void SoundPlayerMain(void)
  {
  	char szBuf[5] = "\0\0\0\0\0";
diff -r -C 2 -P ../AmiPhone_1.92/phonerexx.arb ./phonerexx.arb
*** ../AmiPhone_1.92/phonerexx.arb	Sat Nov 16 23:46:40 1996
--- ./phonerexx.arb	Sun Feb 15 23:32:01 1998
***************
*** 1,8 ****
  ARB
! $1 831931909 27
  AmiPhone
  0
  BROWSER
! $1 24 N
  $2 N
  SHOW/S
--- 1,8 ----
  ARB
! $1 831931909 28
  AmiPhone
  0
  BROWSER
! $1 24 O
  $2 N
  SHOW/S
***************
*** 11,15 ****
  -
  CONNECT
! $1 2 N
  $2 N
  HOSTNAME
--- 11,15 ----
  -
  CONNECT
! $1 2 O
  $2 N
  HOSTNAME
***************
*** 19,23 ****
  -
  CONNECTTO
! $1 4 N
  $2 N
  ENTRY/N
--- 19,23 ----
  -
  CONNECTTO
! $1 4 O
  $2 N
  ENTRY/N
***************
*** 27,31 ****
  -
  DAEMON
! $1 25 N
  $2 N
  SHOW/S
--- 27,31 ----
  -
  DAEMON
! $1 25 O
  $2 N
  SHOW/S
***************
*** 34,53 ****
  -
  DISABLE
! $1 22 N
  $2 N
  -
  -
  DISCONNECT
! $1 3 N
  $2 N
  -
  -
  ENABLE
! $1 21 N
  $2 N
  -
  -
  GETSTATE
! $1 23 N
  $2 N
  -
--- 34,53 ----
  -
  DISABLE
! $1 22 O
  $2 N
  -
  -
  DISCONNECT
! $1 3 O
  $2 N
  -
  -
  ENABLE
! $1 21 O
  $2 N
  -
  -
  GETSTATE
! $1 23 O
  $2 N
  -
***************
*** 78,82 ****
  -
  MEMO
! $1 6 N
  $2 N
  START/S
--- 78,82 ----
  -
  MEMO
! $1 6 O
  $2 N
  START/S
***************
*** 86,90 ****
  -
  PLAYFILE
! $1 5 N
  $2 N
  FILENAME
--- 86,90 ----
  -
  PLAYFILE
! $1 5 O
  $2 N
  FILENAME
***************
*** 94,103 ****
  -
  QUIT
! $1 1 N
  $2 N
  -
  -
  SETCOMPRESSION
! $1 8 N
  $2 N
  ADPCM2/S
--- 94,109 ----
  -
  QUIT
! $1 1 O
  $2 N
  -
  -
+ SETAHIMODE
+ $1 27 O
+ $2 N
+ MODE/N
+ -
+ -
  SETCOMPRESSION
! $1 8 O
  $2 N
  ADPCM2/S
***************
*** 107,111 ****
  -
  SETENABLEONCONNECT
! $1 14 N
  $2 N
  ON/S
--- 113,117 ----
  -
  SETENABLEONCONNECT
! $1 14 O
  $2 N
  ON/S
***************
*** 114,118 ****
  -
  SETINPUTAMPLIFY
! $1 11 N
  $2 N
  MULTIPLIER/N
--- 120,124 ----
  -
  SETINPUTAMPLIFY
! $1 11 O
  $2 N
  MULTIPLIER/N
***************
*** 120,124 ****
  -
  SETINPUTCHANNEL
! $1 12 N
  $2 N
  LEFT/S
--- 126,130 ----
  -
  SETINPUTCHANNEL
! $1 12 O
  $2 N
  LEFT/S
***************
*** 127,131 ****
  -
  SETINPUTGAIN
! $1 10 N
  $2 N
  GAIN/N
--- 133,137 ----
  -
  SETINPUTGAIN
! $1 10 O
  $2 N
  GAIN/N
***************
*** 134,145 ****
  -
  SETINPUTSOURCE
! $1 15 N
  $2 N
  MIC/S
  LINE/S
  -
  -
  SETSAMPLER
! $1 7 N
  $2 N
  DSS8/S
--- 140,152 ----
  -
  SETINPUTSOURCE
! $1 15 O
  $2 N
  MIC/S
  LINE/S
+ AHIINPUT/N
  -
  -
  SETSAMPLER
! $1 7 O
  $2 N
  DSS8/S
***************
*** 155,159 ****
  -
  SETSAMPLERATE
! $1 18 N
  $2 N
  RATE/N
--- 162,166 ----
  -
  SETSAMPLERATE
! $1 18 O
  $2 N
  RATE/N
***************
*** 161,165 ****
  -
  SETTCPBATCHXMIT
! $1 17 N
  $2 N
  ON/S
--- 168,172 ----
  -
  SETTCPBATCHXMIT
! $1 17 O
  $2 N
  ON/S
***************
*** 168,172 ****
  -
  SETTHRESHVOL
! $1 20 N
  $2 N
  THRESHOLD/N
--- 175,179 ----
  -
  SETTHRESHVOL
! $1 20 O
  $2 N
  THRESHOLD/N
***************
*** 174,178 ****
  -
  SETXMITDELAY
! $1 19 N
  $2 N
  MILLISECONDS/N
--- 181,185 ----
  -
  SETXMITDELAY
! $1 19 O
  $2 N
  MILLISECONDS/N
***************
*** 180,184 ****
  -
  SETXMITENABLE
! $1 9 N
  $2 N
  HOLD/S
--- 187,191 ----
  -
  SETXMITENABLE
! $1 9 O
  $2 N
  HOLD/S
***************
*** 187,191 ****
  -
  SETXMITONPLAY
! $1 16 N
  $2 N
  ON/S
--- 194,198 ----
  -
  SETXMITONPLAY
! $1 16 O
  $2 N
  ON/S
***************
*** 194,198 ****
  -
  ZOOM
! $1 26 N
  $2 N
  BIG/S
--- 201,205 ----
  -
  ZOOM
! $1 26 O
  $2 N
  BIG/S
diff -r -C 2 -P ../AmiPhone_1.92/phonerexx.c ./phonerexx.c
*** ../AmiPhone_1.92/phonerexx.c	Sat Nov 16 23:46:42 1996
--- ./phonerexx.c	Mon Feb 16 00:21:08 1998
***************
*** 26,35 ****
  #ifndef __NO_PRAGMAS
  
- #ifdef AZTEC_C
- #include <pragmas/exec_lib.h>
- #include <pragmas/dos_lib.h>
- #include <pragmas/rexxsyslib_lib.h>
- #endif
- 
  #ifdef LATTICE
  #include <pragmas/exec_pragmas.h>
--- 26,29 ----
***************
*** 58,63 ****
  #endif
  
  #define inline
! 
  
  #include <dos/rdargs.h>
--- 52,58 ----
  #endif
  
+ #ifdef AZTEC_C
  #define inline
! #endif
  
  #include <dos/rdargs.h>
diff -r -C 2 -P ../AmiPhone_1.92/phonerexx.h ./phonerexx.h
*** ../AmiPhone_1.92/phonerexx.h	Sat Nov 16 23:46:42 1996
--- ./phonerexx.h	Mon Feb 16 00:22:28 1998
***************
*** 203,206 ****
--- 203,216 ----
  void rx_quit( struct RexxHost *, struct rxd_quit **, long, struct RexxMsg * );
  
+ struct rxd_setahimode
+ {
+ 	long rc, rc2;
+ 	struct {
+ 		long *mode;
+ 	} arg;
+ };
+ 
+ void rx_setahimode( struct RexxHost *, struct rxd_setahimode **, long, struct RexxMsg * );
+ 
  struct rxd_setcompression
  {
***************
*** 264,267 ****
--- 274,278 ----
  		long mic;
  		long line;
+ 		long *ahiinput;
  	} arg;
  };
diff -r -C 2 -P ../AmiPhone_1.92/phonerexx_rxcl.c ./phonerexx_rxcl.c
*** ../AmiPhone_1.92/phonerexx_rxcl.c	Sat Nov 16 23:46:42 1996
--- ./phonerexx_rxcl.c	Mon Feb 16 00:22:17 1998
***************
*** 29,32 ****
--- 29,33 ----
  	{ "PLAYFILE", "FILENAME,RATE/N,PROMPT/S", NULL, 0, (void (*)(struct RexxHost *,void **,long,struct RexxMsg *)) rx_playfile, 1 },
  	{ "QUIT", NULL, NULL, 0, (void (*)(struct RexxHost *,void **,long,struct RexxMsg *)) rx_quit, 1 },
+ 	{ "SETAHIMODE", "MODE/N", NULL, 0, (void (*)(struct RexxHost *,void **,long,struct RexxMsg *)) rx_setahimode, 1 },
  	{ "SETCOMPRESSION", "ADPCM2/S,ADPCM3/S,NONE/S", NULL, 0, (void (*)(struct RexxHost *,void **,long,struct RexxMsg *)) rx_setcompression, 1 },
  	{ "SETENABLEONCONNECT", "ON/S,OFF/S", NULL, 0, (void (*)(struct RexxHost *,void **,long,struct RexxMsg *)) rx_setenableonconnect, 1 },
***************
*** 34,38 ****
  	{ "SETINPUTCHANNEL", "LEFT/S,RIGHT/S", NULL, 0, (void (*)(struct RexxHost *,void **,long,struct RexxMsg *)) rx_setinputchannel, 1 },
  	{ "SETINPUTGAIN", "GAIN/N,RELATIVE/S", NULL, 0, (void (*)(struct RexxHost *,void **,long,struct RexxMsg *)) rx_setinputgain, 1 },
! 	{ "SETINPUTSOURCE", "MIC/S,LINE/S", NULL, 0, (void (*)(struct RexxHost *,void **,long,struct RexxMsg *)) rx_setinputsource, 1 },
  	{ "SETSAMPLER", "DSS8/S,PERFECTSOUND/S,AMAS/S,SOUNDMAGIC/S,TOCCATA/S,AURA/S,AHI/S,CUSTOM/S,GENERIC/S", NULL, 0, (void (*)(struct RexxHost *,void **,long,struct RexxMsg *)) rx_setsampler, 1 },
  	{ "SETSAMPLERATE", "RATE/N", NULL, 0, (void (*)(struct RexxHost *,void **,long,struct RexxMsg *)) rx_setsamplerate, 1 },
--- 35,39 ----
  	{ "SETINPUTCHANNEL", "LEFT/S,RIGHT/S", NULL, 0, (void (*)(struct RexxHost *,void **,long,struct RexxMsg *)) rx_setinputchannel, 1 },
  	{ "SETINPUTGAIN", "GAIN/N,RELATIVE/S", NULL, 0, (void (*)(struct RexxHost *,void **,long,struct RexxMsg *)) rx_setinputgain, 1 },
! 	{ "SETINPUTSOURCE", "MIC/S,LINE/S,AHIINPUT/N", NULL, 0, (void (*)(struct RexxHost *,void **,long,struct RexxMsg *)) rx_setinputsource, 1 },
  	{ "SETSAMPLER", "DSS8/S,PERFECTSOUND/S,AMAS/S,SOUNDMAGIC/S,TOCCATA/S,AURA/S,AHI/S,CUSTOM/S,GENERIC/S", NULL, 0, (void (*)(struct RexxHost *,void **,long,struct RexxMsg *)) rx_setsampler, 1 },
  	{ "SETSAMPLERATE", "RATE/N", NULL, 0, (void (*)(struct RexxHost *,void **,long,struct RexxMsg *)) rx_setsamplerate, 1 },
***************
*** 46,58 ****
  };
  
! int		command_cnt = 25;
  
  static struct arb_p_link link0[] = {
! 	{"ZOOM", 1}, {"SET", 2}, {"QUIT", 19}, {"PLAYFILE", 20}, {"MEMO", 21}, {"GETSTATE", 22},
! 	{"ENABLE", 23}, {"D", 24}, {"CONNECT", 29}, {"BROWSER", 31}, {NULL, 0} };
  
  static struct arb_p_link link2[] = {
  	{"XMIT", 3}, {"T", 7}, {"SAMPLER", 10}, {"INPUT", 12}, {"ENABLEONCONNECT", 17}, {"COMPRESSION", 18},
! 	{NULL, 0} };
  
  static struct arb_p_link link3[] = {
--- 47,59 ----
  };
  
! int		command_cnt = 26;
  
  static struct arb_p_link link0[] = {
! 	{"ZOOM", 1}, {"SET", 2}, {"QUIT", 20}, {"PLAYFILE", 21}, {"MEMO", 22}, {"GETSTATE", 23},
! 	{"ENABLE", 24}, {"D", 25}, {"CONNECT", 30}, {"BROWSER", 32}, {NULL, 0} };
  
  static struct arb_p_link link2[] = {
  	{"XMIT", 3}, {"T", 7}, {"SAMPLER", 10}, {"INPUT", 12}, {"ENABLEONCONNECT", 17}, {"COMPRESSION", 18},
! 	{"AHIMODE", 19}, {NULL, 0} };
  
  static struct arb_p_link link3[] = {
***************
*** 68,87 ****
  	{"SOURCE", 13}, {"GAIN", 14}, {"CHANNEL", 15}, {"AMPLIFY", 16}, {NULL, 0} };
  
- static struct arb_p_link link24[] = {
- 	{"IS", 25}, {"AEMON", 28}, {NULL, 0} };
- 
  static struct arb_p_link link25[] = {
! 	{"CONNECT", 26}, {"ABLE", 27}, {NULL, 0} };
  
! static struct arb_p_link link29[] = {
! 	{"TO", 30}, {NULL, 0} };
  
  struct arb_p_state arb_p_state[] = {
! 	{-1, link0}, {24, NULL}, {11, link2}, {21, link3}, {23, NULL},
! 	{22, NULL}, {21, NULL}, {19, link7}, {20, NULL}, {19, NULL},
! 	{17, link10}, {18, NULL}, {13, link12}, {16, NULL}, {15, NULL},
! 	{14, NULL}, {13, NULL}, {12, NULL}, {11, NULL}, {10, NULL},
! 	{9, NULL}, {8, NULL}, {7, NULL}, {6, NULL}, {3, link24},
! 	{4, link25}, {5, NULL}, {4, NULL}, {3, NULL}, {1, link29},
! 	{2, NULL}, {0, NULL}  };
  
--- 69,88 ----
  	{"SOURCE", 13}, {"GAIN", 14}, {"CHANNEL", 15}, {"AMPLIFY", 16}, {NULL, 0} };
  
  static struct arb_p_link link25[] = {
! 	{"IS", 26}, {"AEMON", 29}, {NULL, 0} };
! 
! static struct arb_p_link link26[] = {
! 	{"CONNECT", 27}, {"ABLE", 28}, {NULL, 0} };
  
! static struct arb_p_link link30[] = {
! 	{"TO", 31}, {NULL, 0} };
  
  struct arb_p_state arb_p_state[] = {
! 	{-1, link0}, {25, NULL}, {11, link2}, {22, link3}, {24, NULL},
! 	{23, NULL}, {22, NULL}, {20, link7}, {21, NULL}, {20, NULL},
! 	{18, link10}, {19, NULL}, {14, link12}, {17, NULL}, {16, NULL},
! 	{15, NULL}, {14, NULL}, {13, NULL}, {12, NULL}, {11, NULL},
! 	{10, NULL}, {9, NULL}, {8, NULL}, {7, NULL}, {6, NULL},
! 	{3, link25}, {4, link26}, {5, NULL}, {4, NULL}, {3, NULL},
! 	{1, link30}, {2, NULL}, {0, NULL}  };
  
diff -r -C 2 -P ../AmiPhone_1.92/phonerexx_rxif.c ./phonerexx_rxif.c
*** ../AmiPhone_1.92/phonerexx_rxif.c	Sat Nov 16 23:46:42 1996
--- ./phonerexx_rxif.c	Sat Feb 28 00:33:47 1998
***************
*** 3,6 ****
--- 3,7 ----
   * which is Copyright (c) 1992,1993 Michael Balzer
   */
+ /* :ts=2 */
  
  #include <exec/types.h>
***************
*** 26,35 ****
  #ifndef __NO_PRAGMAS
  
- #ifdef AZTEC_C
- #include <pragmas/exec_lib.h>
- #include <pragmas/dos_lib.h>
- #include <pragmas/rexxsyslib_lib.h>
- #endif
- 
  #ifdef LATTICE
  #include <pragmas/exec_pragmas.h>
--- 27,30 ----
***************
*** 69,72 ****
--- 64,68 ----
  extern struct RxsLib *RexxSysBase;
  
+ extern ULONG ulAHIMode;
  
  /* $ARB: I 831931909 */
***************
*** 525,530 ****
  			/* Insert your CODE here */
  			if (rd->arg.mic)  ChangeInputSource(INPUT_SOURCE_MIC, TRUE);
! 			if (rd->arg.line) ChangeInputSource(INPUT_SOURCE_EXT, TRUE);
! 			rd->rc = (rd->arg.mic || rd->arg.line);
  			break;
  		
--- 521,527 ----
  			/* Insert your CODE here */
  			if (rd->arg.mic)  ChangeInputSource(INPUT_SOURCE_MIC, TRUE);
! 			else if (rd->arg.line) ChangeInputSource(INPUT_SOURCE_EXT, TRUE);
! 			else if (rd->arg.ahiinput) ChangeInputSource(*rd->arg.ahiinput, TRUE);
! 			rd->rc = (rd->arg.mic || rd->arg.line || rd->arg.ahiinput);
  			break;
  		
***************
*** 794,801 ****
  	                rd->res.inputchannel = szResChannel;
  
! 			     if (ubInputSource == INPUT_SOURCE_MIC) strcpy(szResSource,"MIC");
! 			else if (ubInputSource == INPUT_SOURCE_EXT) strcpy(szResSource,"LINE");
! 			else strcpy(szResSource, "????");
! 	                rd->res.inputsource = szResSource;
  
  			GetSamplerType(szResSampler, ubSamplerType);
--- 791,805 ----
  	                rd->res.inputchannel = szResChannel;
  
! 			if(ubSamplerType != SAMPLER_AHI)
! 			{
! 				     if (ubInputSource == INPUT_SOURCE_MIC) strcpy(szResSource,"MIC");
! 				else if (ubInputSource == INPUT_SOURCE_EXT) strcpy(szResSource,"LINE");
! 				else strcpy(szResSource, "????");
! 			}
! 			else
! 			{
! 				sprintf(szResSource, "%d", ubInputSource);
! 			}
!       rd->res.inputsource = szResSource;
  
  			GetSamplerType(szResSampler, ubSamplerType);
***************
*** 947,950 ****
--- 951,987 ----
  }
  /* $ARB: E 26 ZOOM */
+ 
+ /* $ARB: B 27 SETAHIMODE */
+ void rx_setahimode( struct RexxHost *host, struct rxd_setahimode **rxd, long action, struct RexxMsg *rexxmsg )
+ {
+ 	struct rxd_setahimode *rd = *rxd;
+ 
+ 	switch( action )
+ 	{
+ 		case RXIF_INIT:
+ 			*rxd = AllocVec( sizeof *rd, MEMF_CLEAR );
+ 			if( rd = *rxd )
+ 			{
+ 				/* set your DEFAULTS here */
+ 			}
+ 			break;
+ 			
+ 		case RXIF_ACTION:
+ 			/* Insert your CODE here */
+ 			if (rd->arg.mode)
+ 			{
+   			ulAHIMode = *rd->arg.mode;
+ 				rd->rc = 1;
+ 			} else rd->rc = 0;
+ 			break;
+ 		
+ 		case RXIF_FREE:
+ 			/* FREE your local data here */
+ 			FreeVec( rd );
+ 			break;
+ 	}
+ 	return;
+ }
+ /* $ARB: E 27 SETAHIMODE */
  
  
diff -r -C 2 -P ../AmiPhone_1.92/phoneudp.c ./phoneudp.c
*** ../AmiPhone_1.92/phoneudp.c	Sat Nov 16 23:46:40 1996
--- ./phoneudp.c	Mon Feb 16 06:47:08 1998
***************
*** 1,4 ****
! #define DICE_C
  
  #include <stdio.h>
  #include <stdlib.h>
--- 1,5 ----
! /* :ts=4 */
  
+ #include <netinclude:sys/types.h>
  #include <stdio.h>
  #include <stdlib.h>
***************
*** 21,25 ****
  #include <proto/socket.h>
  #include <sys/errno.h>
- #include <sys/types.h>
  #include <sys/socket.h>
  #include <sys/ioctl.h>
--- 22,25 ----
***************
*** 39,43 ****
  
  /* Why does this come out as 18 unless I define it explicitely here?  Weird! */
! #define EWOULDBLOCK 35
  
  /* Prototypes for the compression/decompression asm functions! */
--- 39,43 ----
  
  /* Why does this come out as 18 unless I define it explicitely here?  Weird! */
! /* #define EWOULDBLOCK 35 */
  
  /* Prototypes for the compression/decompression asm functions! */
***************
*** 359,369 ****
  		WaitSelect(nMaxSocket+1, &fsReadSet, &fsWriteSet, NULL, NULL, &Mask);
  			
! 		if (FD_ISSET(sTCPSocket, &fsReadSet)) ProcessReply();
! 		if (FD_ISSET(sTCPSocket, &fsWriteSet)) 
  		{
! 			ulBytesSentSince += ReduceTCPQueue(0,sTCPSocket);
! 			SetWindowTitle(NULL);
! 		}
! 		
  		return(Mask);
  	}
--- 359,375 ----
  		WaitSelect(nMaxSocket+1, &fsReadSet, &fsWriteSet, NULL, NULL, &Mask);
  			
! 		if (sTCPSocket != -1)
  		{
!   	    	if (FD_ISSET(sTCPSocket, &fsReadSet)) ProcessReply();
!   	    }
! 
! 		if (sTCPSocket != -1) 
! 		{
!        	  	if (FD_ISSET(sTCPSocket, &fsWriteSet)) 
! 		    {
! 			    ulBytesSentSince += ReduceTCPQueue(0,sTCPSocket);
!   			    SetWindowTitle(NULL);
! 	      	}
! 	    }
  		return(Mask);
  	}
Only in ../AmiPhone_1.92: phoneudp.c.info
diff -r -C 2 -P ../AmiPhone_1.92/smakefile ./smakefile
*** ../AmiPhone_1.92/smakefile	Thu Jan  1 01:00:00 1970
--- ./smakefile	Sat Feb 28 12:25:20 1998
***************
*** 0 ****
--- 1,200 ----
+ 
+ 
+ ##
+ ## Macros
+ ##
+ ###############################################################################
+ 
+ CC		= SC:C/SC IDIR=NetInclude: DEBUG=FULL NOSTACKCHECK NOICONS\
+ 		  STRUCTUREEQUIVALENCE MULTIPLECHARACTERCONSTANTS\
+ 		  OPTIMIZE OPTTIME OPTSCHED #GST=gst
+ 
+ LD		= SC:C/SLink NOICONS LIB LIB:sc.lib LIB:scm.lib LIB:debug.lib LIB:amiga.lib
+ 
+ ASM		= Programmering:PhxAss/Bin/PhxAss I=include: SD SC
+ 
+ ASM_OBJS 	= inthandler.o compress/ADPCM2_Crunch.o compress/ADPCM3_Crunch.o\
+ 		  compress/ADPCM2_Decrunch.o compress/ADPCM3_Decrunch.o
+ 
+ C_OBJS		= ciatimer.o AmiPhone.o phoneudp.o stringrequest.o microphone.o\
+ 		  messages.o asl.o codec_c.o browse.o TCPQueue.o phonerexx.o\
+ 		  phonerexx_rxif.o phonerexx_rxcl.o
+ 
+ 
+ ##
+ ## Default rules
+ ##
+ ###############################################################################
+ 
+ .c.o:
+ 	$(CC) $< OBJNAME $@
+ 
+ .a.o:
+ 	$(ASM) $< TO $@
+ 
+ 
+ ##
+ ## Targets
+ ##
+ ###############################################################################
+ 
+ all:		AmiPhone AmiPhoned AmiPhoned_debug PhoneUtil
+ 
+ AmiPhone:	$(ASM_OBJS) $(C_OBJS)
+ 	$(LD) TO $@ FROM LIB:c.o $(ASM_OBJS) $(C_OBJS) 
+ 
+ AmiPhoned:	AmiPhoned.o compress/ADPCM2_Decrunch.o compress/ADPCM3_Decrunch.o codec_s.o stringrequest.o TCPQueue.o
+ 	$(LD) TO $@ FROM LIB:c.o AmiPhoned.o compress/ADPCM2_Decrunch.o compress/ADPCM3_Decrunch.o codec_s.o stringrequest.o TCPQueue.o
+ 
+ AmiPhoned_debug: AmiPhoned_debug.o compress/ADPCM2_Decrunch.o compress/ADPCM3_Decrunch.o codec_s.o stringrequest.o TCPQueue.o
+ 	$(LD) TO $@ FROM LIB:c.o AmiPhoned_debug.o compress/ADPCM2_Decrunch.o compress/ADPCM3_Decrunch.o codec_s.o stringrequest.o TCPQueue.o
+ 
+ PhoneUtil:	PhoneUtil.o compress/ADPCM2_Decrunch.o compress/ADPCM3_Decrunch.o compress/ADPCM2_Crunch.o compress/ADPCM3_Crunch.o codec_v.o
+ 	$(LD) TO $@ FROM LIB:c.o PhoneUtil.o compress/ADPCM2_Decrunch.o compress/ADPCM3_Decrunch.o compress/ADPCM2_Crunch.o compress/ADPCM3_Crunch.o codec_v.o
+ 
+ 
+ ##
+ ## Rules
+ ##
+ ###############################################################################
+ 
+ 
+ codec_c.o: codec.c AmiPhoned.h AmiPhone.h AmiPhoneMsg.h AmiPhonePacket.h\
+ 	 codec.h TCPQueue.h
+ 	$(CC) FROM $< OBJNAME $@ DEFINE AMIPHONE
+ 
+ codec_v.o: codec.c AmiPhoned.h AmiPhone.h AmiPhoneMsg.h AmiPhonePacket.h\
+ 	 codec.h TCPQueue.h
+ 	$(CC) FROM $< OBJNAME $@ DEFINE CONV_UTIL
+ 
+ codec_s.o: codec.c AmiPhoned.h AmiPhone.h AmiPhoneMsg.h AmiPhonePacket.h\
+ 	 codec.h TCPQueue.h
+ 
+ microphone.c:	microphone.brush
+ 	citas microphone.brush -c -m -h -o -s 
+ AmiPhoned_debug.o: amiphoned.c AmiPhoned.h AmiPhoneMsg.h AmiPhonePacket.h\
+ 	 codec.h TCPQueue.h
+ 	$(CC) FROM $< OBJNAME $@ DEFINE DEBUG_FLAG
+ 
+ inthandler.o:			inthandler.a
+ compress/ADPCM2_Crunch.o:	compress/ADPCM2_Crunch.a
+ compress/ADPCM3_Crunch.o:	compress/ADPCM3_Crunch.a
+ compress/ADPCM2_Decrunch.o:	compress/ADPCM2_Decrunch.a
+ compress/ADPCM3_Decrunch.o:	compress/ADPCM3_Decrunch.a
+ 
+ #$(C_OBJS):	gst
+ 
+ ##
+ ## GST
+ ##
+ ###############################################################################
+ 
+ 
+ gst:
+ 	# Don't cache my own include files
+ 	grep -h "\#include <" *.c *.h > gst.c
+ 	$(CC) NOOBJNAME MGST=gst gst.c
+ 	-delete gst.c QUIET
+ 
+ ##
+ ## Other targets
+ ##
+ ###############################################################################
+ 
+ clean:       
+ 	-delete \#?.o QUIET
+ 	-delete compress/\#?.o QUIET
+ 	-delete \#?.bak QUIET
+ 	-delete AmiPhone AmiPhoned AmiPhoned_debug PhoneUtil QUIET
+ 	-delete gst QUIET
+ 	-avail flush   # Flush gst from memory
+ 
+ diff:
+ 	-delete Source.patch
+ 	-diff -r -C 2 -P ../AmiPhone_1.92 . > T:Source.patch
+ 	copy T:Source.patch ""
+ 	-delete T:Source.patch
+ 
+ depend:
+ 	makedepend -f smakefile amiphone.c amiphoned.c asl.c browse.c ciatimer.c\
+ 	codec.c listen.c messages.c microphone.c phonerexx.c phonerexx_rxcl.c\
+ 	phonerexx_rxif.c phoneudp.c PhoneUtil.c Sampler.c StringRequest.c TCPQueue.c
+ 
+ archive:
+ 	smake clean
+ 	-delete ram:AmiPhoneSource.lha ram:src all
+ 	makedir ram:src
+ 	copy #? ram:src all
+ 	lha -r a ram:AmiPhoneSource.lha ram:src
+ 	@echo "archive made in ram:"
+ 	 
+ dist:	AmiPhone AmiPhoned AmiPhoned_debug PhoneUtil
+ 	-delete ram:AmiPhone all
+ 	-delete ram:AmiPhone.info
+ 	-delete ram:AmiPhone.lha
+ 	makedir ram:AmiPhone
+ 	$(LD) ND NOICONS FROM AmiPhone TO ram:AmiPhone/AmiPhone
+ 	copy AmiPhoneIcon.info ram:AmiPhone/AmiPhone.info
+ 	$(LD) ND NOICONS FROM AmiPhoned TO ram:AmiPhone/AmiPhoned
+ 	$(LD) ND NOICONS FROM AmiPhoned_debug TO ram:AmiPhone/AmiPhoned_debug
+ 	copy Install_AmiPhone ram:AmiPhone
+ 	copy Install_AmiPhone.info ram:AmiPhone
+ 	copy AmiPhone.guide ram:AmiPhone
+ 	copy AmiPhone.guide.icon.info ram:AmiPhone/AmiPhone.guide.info
+ 	copy AmiPhoneDrawer.info ram:AmiPhone.info
+ 	copy README ram:AmiPhone
+ 	copy README ram:AmiPhone.readme
+ 	copy README.icon.info ram:AmiPhone/README.info
+ 	$(LD) ND NOICONS FROM PhoneUtil TO ram:AmiPhone/PhoneUtil
+ 	copy EditTextFile.rexx ram:AmiPhone
+ 	copy Source.patch ram:AmiPhone
+ 	lha -r a ram:AmiPhone.lha ram:AmiPhone ram:AmiPhone.info
+ 	@echo "distribution made in ram:"
+ 
+ 
+ 
+ #DEPENDENCIES
+ 
+ amiphone.o: amiphone.c phonerexx.h menuconstants.h ciatimer.h\
+ 	 phoneudp.h AmiPhonePacket.h messages.h AmiPhoneMsg.h browse.h\
+ 	 stringrequest.h TCPQueue.h
+ 
+ amiphoned.o: amiphoned.c AmiPhoned.h AmiPhoneMsg.h AmiPhonePacket.h\
+ 	 codec.h TCPQueue.h
+ 
+ asl.o: asl.c codec.h asl.h
+ 
+ browse.o: browse.c AmiPhone.h codec.h messages.h browse.h
+ 
+ ciatimer.o: ciatimer.c AmiPhoneMsg.h AmiPhone.h phoneudp.h\
+ 	 AmiPhonePacket.h ciatimer.h codec.h
+ 
+ codec.o: codec.c AmiPhoned.h AmiPhone.h AmiPhoneMsg.h AmiPhonePacket.h\
+ 	 codec.h TCPQueue.h
+ 
+ listen.o: listen.c
+ 
+ messages.o: messages.c AmiPhone.h AmiPhonePacket.h asl.h codec.h\
+ 	 browse.h
+ 
+ microphone.o: microphone.c
+ 
+ phonerexx.o: phonerexx.c phonerexx.h
+ 
+ phonerexx_rxcl.o: phonerexx_rxcl.c phonerexx.h
+ 
+ phonerexx_rxif.o: phonerexx_rxif.c phonerexx.h phonerexx_aux.h\
+ 	 menuconstants.h AmiPhone.h phoneudp.h AmiPhonePacket.h ciatimer.h\
+ 	 codec.h AmiPhoneMsg.h
+ 
+ phoneudp.o: phoneudp.c AmiPhone.h AmiPhoneMsg.h stringrequest.h codec.h\
+ 	 TCPQueue.h
+ 
+ PhoneUtil.o: PhoneUtil.c codec.h AmiPhonePacket.h
+ 
+ Sampler.o: Sampler.c
+ 
+ StringRequest.o: StringRequest.c codec.h AmiPhone.h stringrequest.h
+ 
+ TCPQueue.o: TCPQueue.c AmiPhone.h TCPQueue.h
+ 
