Metropoli BBS
VIEWER: cusdiag.dat MODE: TEXT (ASCII)
menu main at 1,2 dims 4,70
	background blue
	set hiddenstring type str "  Brought to you by Media Vision Technical Support"
	item "Media Vision Customer Diagnostics Facility - One moment..." at 1,2 onkey script main return 1
	display hiddenstring using "%-54s" at 2, textcolor ltblue background ltblue

	script main
		set srcdir      type str `pwd
		set baseport    type str "   "
		set gotpas      type int 0
		set playexe     tpcm.exe
		set loadedfm type int 0
		set recrate type str "11025"
		set recchan type str "Mono"
		set recdsiz type str "8-bit"
		set recfile type str "NUL"

		:getboardaddress
		runmenu getboardaddress
		if issame $gotpas 0             return
		if issame $gotpas 2     goto getboardaddress

		runscript setproductcode
		if issame $productcode 0        return

		runmenu showproduct

		execute proas b:$baseport v:70

		runmenu pasdiag.dat
		runscript shutdown
		return

menu pasdiag.dat at 0,0 dims 25,80
	background blue
	textcolor white

	text "Media Vision Hardware Diagnostics Program for the Pro Studio 16 Basic"
	text ""
	text "Select an Item to Test" at ,10
	text ""
	box at ,8 dims 11,30
	item "Digital Audio Playback"           at ,10 menu digaudplay
	item "Digital Audio Recording"          at ,10 menu digaudrec
	item "FM Synthesizer"                   at ,10 menu fmsynth2op
	item "Joystick Tracking"                at ,10 execute joy.exe
	item "PAS Mixer Program"                at ,10 execute "pas *"
	item "Set Volume"                       at ,10 menu setvolume
	item "Show System Configuration"        at ,10 menu showproduct
	text ""
	item "Return To DOS"                    at ,10 return 1

script shutdown
	if issame $productcode 2        execute -eo proas s:0
	if issame $loadedfm 1   execute fm -qu
	return 

menu digaudplay at 2,1 dims 20,78
	set playstatus type int 0

	text "Digital Audio Playback"
	text ""
	text "This test will verify the ability of your sound card"
	text "to playback various types of Digital Audio."
	text ""
	text "Select an Item to Test"
	text ""
	item "Play  8-bit, 11025 Mono"          at ,10 script dap0811m
	item "Play  8-bit, 22050 Stereo"        at ,10 script dap0822s
	item "Play 16-bit, 22050 Stereo"        at ,10 script dap1622s
	text ""
	item "8-bit, 11025 Mono on SB"          at ,10 script sbc0811m
	text ""
	item "Play User Recorded File"          at ,10 script dapusers
	text ""
	item "Return To Previous Screen"        at ,10 return 1

script dap0811m
	if issame $productcode 2        execute -eo proas s:0
	execute pcm -l $playexe -b$baseport -w1 -B64D8 pcm0811m.wav
	set playstatus $errorlevel

	if issame $playstatus 2         runmenu dapfailed
	if issame $playstatus 1         runmenu dapinterrupted
	if issame $playstatus 0         runmenu dapsuccess
	return 1

script dap0822s
	if issame $productcode 2        execute -eo proas s:0
	execute pcm -l $playexe -b$baseport -w1 -B64D8 pcm0822s.wav
	set playstatus $errorlevel

	if issame $playstatus 2         runmenu dapfailed
	if issame $playstatus 1         runmenu dapinterrupted
	if issame $playstatus 0         runmenu dapsuccess
	return 1

script dap1622s
	if issame $productcode 2        execute -eo proas s:0
	execute pcm -l $playexe -b$baseport -w1 -B64D8 pcm1622s.wav
	set playstatus $errorlevel

	if issame $playstatus 2         runmenu dapfailed
	if issame $playstatus 1         runmenu dapinterrupted
	if issame $playstatus 0         runmenu dapsuccess
	return 1

script sbc0811m
	if issame "%blaster%" ""        goto needblaster
	if issame $productcode 1        goto nosbconcard
	if issame $productcode 2        execute -eo proas s:1
	execute pcm -l $playexe -b$baseport -w1 -T -B64D8 pcm0811m.wav
	set playstatus $errorlevel

	if issame $playstatus 2         runmenu dapfailed
	if issame $playstatus 1         runmenu dapinterrupted
	if issame $playstatus 0         runmenu dapsuccess
	return 1

	:needblaster
	runmenu needblaster
	return

	:nosbconcard
	runmenu nosbconcard
	return

script sbc0822m
	if issame "%blaster%" ""        goto needblaster
	if issame $productcode 1        goto nosbconcard
	if issame $productcode 2        execute -eo proas s:1
	execute pcm -l $playexe -b$baseport -w1 -T -B64D8 pcm0822m.wav
	set playstatus $errorlevel

	if issame $playstatus 2         runmenu dapfailed
	if issame $playstatus 1         runmenu dapinterrupted
	if issame $playstatus 0         runmenu dapsuccess
	return 1

	:needblaster
	runmenu needblaster
	return

	:nosbconcard
	runmenu nosbconcard
	return

	menu needblaster at 10,5
		background red
		text "Sorry!" 
		text ""
		text "There should be a 'SET BLASTER=' statement in the environment!"

	menu nosbconcard at 10,5
		background red
		text "Sorry!"
		text ""
		text "There is no Sound Blaster Compatible Sound Device!"

menu dapusers at 10,10
	background brown
	text "Play User Recorded File"
	text ""
	text "Enter the name of an existing file, "
	text "or use the name you specified during "
	text "Digital Audio Recording."
	box at ,8 dims 4,20
	item $recfile at ,10 script dapusers
	item "Return" at ,10 return 1

	script dapusers
		runscript dapfile
		if issame "${recfile}" ""       return
		if issame "${recfile}" "NUL"    return
		if not isfile $recfile          return
		if issame $productcode 2        execute -eo proas s:0
		runmenu playtpcm
		return

	script dapfile
		set tmpfile $recfile
		runmenu gettmpfileplay
		if issame "${tmpfile}" "" set tmpfile "nul"
		set recfile $tmpfile
		return

	menu gettmpfileplay at 10,10
		background blue
		text "Enter the Name of the File"
		text ""
		text "The default name is that specified during the"
		text "Record process."
		text ""
		text "If you know about another file in this directory,"
		text "you can enter that name, instead."
		text ""
		item $tmpfile at ,5 onkey script gettmpfileplay return 1

	script gettmpfileplay
		:again
		getstring tmpfile length 13 uppercase
		if not isfile $tmpfile  goto fileexistsnot
		if isdir $tmpfile       goto notafilename
		return

		:fileexistsnot
		runmenu fileexistsnot
		goto again

		:notafile
		runmenu notafile
		goto again

		menu fileexistsnot at 10,10
			background red
			text "File Does Not Exist!"
			text ""
			text "The filename you entered does not exist!"

##########################
	menu playtpcm at 0,0 dims 25,80
		item "" execute "$playexe -b$baseport -v -B64D8 $recfile" return 1

menu dapfailed at 10,10 
	background red
	text "Digital Audio Failure" background ltblue textcolor btwhite
	text ""
	text "The Diagnostic Routine detected a Failure."
	text ""
	text "If you pressed Escape to terminate the Playback,"
	text "then ignore this message."
	text ""
	text "If the sound 'looped', or did not play, then there"
	text "may be an IRQ or DMA conflict."

menu dapsuccess at 10,10
	background red
	text "Digital Audio Success" background ltblue textcolor btwhite
	text ""
	text "The Diagnostic Routine detected no Failure."
	text ""
	text "Your sound card is operating correctly."
	
menu dapinterrupted at 10,10
	background red
	text "Digital Audio Interrupted" background ltblue textcolor btwhite
	text ""
	text "The Diagnostic Routine was unable to determine the status."
	text ""
	text "The playback routine was interrupted by you pressing ESCAPE!"

menu digaudrec at 10,10 dims 14,65
	text "Digital Audio Recording"
	text ""
	text "These tests will verify the ability for you to record"
	text "Digital Audio using your sound card."
	box at ,3 dims 8,30
	item "Set Record Parameters"    at ,5 menu darsetparms
	item "Start Recording"          at ,5 script darstart
	text ""
	item "Specify Filename to Save" at ,5 script darfile
	text ""
	item "Return..."                at ,5   return 1

	display recrate using "Sample Rate: %10s" at 6,40 textcolor btwhite background green
	display recchan using "Channels:    %10s" at 7,40 textcolor btwhite background green
	display recdsiz using "Data Size:   %10s" at 8,40 textcolor btwhite background green
	display recfile using "Filename: %13s" at 9,40    textcolor btwhite background green
	
	menu darsetparms at 11,10 dims 11,65
		background brown

		text "Set Record Parameters"
		text ""
		text "Move the cursor, and press ENTER to select parameter."

		item "11025"    at 5,5  script setrate11
		item "22050"    at 6,5  script setrate22
		item "44100"    at 7,5  script setrate44
		item "Mono"     at 6,15 script setchanm
		item "Stereo"   at 7,15 script setchans
		item "8-bit"    at 6,25 script setdsiz08
		item "16-bit"   at 7,25 script setdsiz16
		text ""
		text "Press ESCAPE when parameters are correct."

		display recrate using "Sample Rate: %10s" at 5,40       textcolor btwhite background green
		display recchan using "Channels:    %10s" at 6,40       textcolor btwhite background green
		display recdsiz using "Data Size:   %10s" at 7,40       textcolor btwhite background green
									
		script setrate11
			set recrate 11025
			return
		script setrate22
			set recrate 22050
			return
		script setrate44
			set recrate 44100
			return
		script setchanm
			set recchan "Mono"
			return
		script setchans
			set recchan "Stereo"
			return
		script setdsiz08
			set recdsiz 8-bit
			return
		script setdsiz16
			if issame $productcode 1        return
			if issame $productcode 2        return
			set recdsiz 16-bit
			return


	script darstart
		set chanparm type str ""
		set dsizparm type str "8"
		set rateparm type str $recrate
		set fileparm type str "nul"

		if isfile $recfile      goto fileexists

		:dorecord

		if issame $productcode 2        execute proas s:0

		if issame $recchan "Stereo" set chanparm "-s"
		if issame $recdsiz "16-bit" set dsizparm "16"
		if not issame "${recfile}" "" set fileparm $recfile
		runmenu rectpcm 
		return 

		:fileexists
		if issame $recfile nul  goto dorecord
		set clobber type int 0
		runmenu fileexists
		if issame $clobber 0 return
		goto dorecord

		menu fileexists at 10,10
			background red
			text "File Exists!"
			text ""
			text "The filename you entered already exists!"
			text ""
			text "If you continue, you will overwrite it!"
			text ""
			item "Overwrite"                at 7,5  script clobber return 1
			item "Enter another Name"       at 7,20 return 1

			script clobber
				set clobber 1
				return 

script darfile
	set tmpfile $recfile
	runmenu gettmpfile
	if issame "${tmpfile}" "" set tmpfile "nul"
	set recfile $tmpfile
	return

	menu gettmpfile at 10,10
		background blue
		text "Enter the Name of the File"
		text ""
		text "The default name is 'NUL', which indicates that"
		text "the recording will not be saved to any file."
		text "This is useful for testing purposes."
		text ""
		item $tmpfile at ,5 onkey script gettmpfile return 1

	script gettmpfile
		:again
		getstring tmpfile length 13 uppercase
		if isdir $tmpfile       goto notafilename
		return

		:notafile
		runmenu notafile
		goto again

		menu notafile at 10,10
			background red
			text "Sorry!"
			text ""
			text "The name you entered is not a valid filename!"
			text ""
			text "It appears to be a directory name!"
			text ""
			text "Please try again!"

	menu rectpcm at 0,0 dims 25,80
	item "" execute "$playexe -b$baseport -r$rateparm -l$dsizparm $chanparm -v -R -B64D8 $fileparm" return 1
			
########################################################################
# cdaudio() - check the audio playback on the CDROM drive
#  This section was removed becuse the Basic does not support CDs.
########################################################################
########################################################################
# getboardaddress() - find the board at the specified address
########################################################################
menu getboardaddress at 10,10 dims 12,50
	background brown
	set gotpas 0
	text "Select the Base Port Address for the PAS"
	text ""
	display baseport using "PAS Board Address: %s"
	text ""
	item "Port 388h - Default Address"      at  5,10 script sba388 return 1
	item "Port 384h - Alternate Address 1"  at  6,10 script sba384 return 1
	item "Port 38Ch - Alternate Address 2"  at  7,10 script sba38C return 1
	item "Port 288h - Alternate Address 3"  at  8,10 script sba288 return 1
	text "Enter Port Value:" at 9,10
	item $baseport  at  9,40 onkey script getsba return 1
	item "Return"   at  10,40 return 1

	script sba388
		set tmpbaseport 388
		runscript checkbaseport
		return
	script sba384
		set tmpbaseport 384
		runscript checkbaseport
		return
	script sba38c
		set tmpbaseport 38C
		runscript checkbaseport
		return
	script sba288
		set tmpbaseport 288
		runscript checkbaseport
		return
	script getsba
		getstring tmpbaseport length 3 uppercase
		runscript checkbaseport
		return
	script checkbaseport
		execute -eo proas b:$tmpbaseport
		if issame $errorlevel 0         runmenu badbaseport
		if not issame $errorlevel 0     runmenu gotbaseport
		return

		menu badbaseport at 6,5 dims 5,60
			background red
			set gotpas 2
			text "Sorry!"
			text ""
			display tmpbaseport using "There is not a PAS at port address '%s'!"

		menu gotbaseport at 6,5 dims 5,60
			background red
			set gotpas 1
			set baseport $tmpbaseport
			text "Yes!"
			text ""
			display tmpbaseport using "There is a PAS at port address '%s'!"

#####################################################################
# setproductcode() - set up for the type of PAS found
#####################################################################

script setproductcode
	set mvsoundloaded NO
	set pasdma type int 0
	set pasirq type int 0
	set sbcdma type int 0
	set sbcirq type int 0
	if isfile mvproas               set mvsoundloaded Yes

	if not issame $mvsoundloaded Yes        goto skipgetdmairq
	interrupt 2Fh ax BC04h return bx pasdma cx pasirq
	interrupt 2Fh ax BC10h return bx sbcdma cx sbcirq
	:skipgetdmairq

	execute -eo proas b:$baseport 
	set productcode $errorlevel

	set mvsoundinconfig type str No
	sedit -C c:\ config.sys device=+mvsound.sys dummy locate 
	if issame $errorlevel 1 set mvsoundinconfig Yes
	set tslcdrinconfig type str No
	sedit -C c:\ config.sys device=+tslcdr.sys dummy locate 
	if issame $errorlevel 1 set tslcdrinconfig Yes
	set mscdexinautoex type str No
	sedit -B c:\ autoexec.bat mscdex.exe dummy locate
	if issame $errorlevel 1 set mscdexinautoex Yes

	if issame $productcode 1        runscript setuppasorg
	if issame $productcode 2        runscript setuppasplus
	if issame $productcode 3        runscript setuppas16
	if issame $productcode 4        runscript setupcdpc

	return

script setuppasorg
	set productname "PAS Original"
	return

script setuppasplus
	set productname "PAS Plus"
	return

script setuppas16
	set productname "PAS Studio"
	return

script setupcdpc
	set productname "CDPC"
	return

menu showproduct at 10,10 dims 13,60
	background red
	display productname using "Product is a %s" 
	display mvsoundloaded   using "MVSOUND.SYS is loaded:          %s"
	display mvsoundinconfig using "MVSOUND.SYS is in CONFIG.SYS:   %s"
	display tslcdrinconfig  using "TSLCDR.SYS  is in CONFIG.SYS:   %s"
	display mscdexinautoex  using "MSCDEX      is in AUTOEXEC.BAT: %s"
	display pasdma using "PAS DMA: %u"
	display pasirq using "PAS IRQ: %u"
	display sbcdma using "SBC DMA: %u"
	display sbcirq using "SBC IRQ: %u"
	
###################################################################
# fmsynth2op() - test the 3812 chip
###################################################################
menu fmsynth2op at 1,1 dims 23,78
	set fmstatus type int 0
	text "FM Synthesis - 2 Operator"
	text ""
	text "This test will verify the operation of the FM Synthesizer chip."
	text ""
	item "Play Song 1" script fm2opsong1
	item "Play Song 2" script fm2opsong2
	text ""
	item "Stop Song Playback" script fm2opstop
	item "Return" return 1

	script fm2opsong1
		runscript loadfm
		if not issame $havefm 1         goto nofmdriver

		execute i65
		execute bo
		return 1

		:nofmdriver
		runmenu nofmdriver
		return

	script fm2opsong2
		runscript loadfm
		if not issame $havefm 1         goto nofmdriver

		execute i65
		execute bo
		return 1
		
		:nofmdriver
		runmenu nofmdriver
		return

	script loadfm
		execute fm -qs
		if not issame $errorlevel 0     goto skipfmload
		execute fm -qi
		execute fm -qs
		if issame $errorlevel 0         goto fmloadfailed
		set loadedfm 1

		:skipfmload
		set havefm type int 1
		return

		:fmloadfailed
		runmenu fmloadfailed
		return

	script fm2opstop
		execute fm -qs
		if issame $errorlevel 0         goto skipunload
		execute bf
		if issame ${loadedfm} 1         execute fm -qu
		execute fm -qs
		if not issame $errorlevel 0     goto fmunloadfailed
		set loadedfm 0
		:skipunload
		return

		:fmunloadfailed
		runmenu fmunloadfailed
		return

	menu fmunloadfailed at 10,10
		background red
		text "FM.COM Unload Failure!"
		text ""
		text "Unable to unload the FM Driver!"
		
	menu nofmdriver at 10,10
		background red
		text "No FM Driver!"
		text ""
		text "Unable to test FM Synthesizer."
		text ""
		text "There was a problem loading the fm.com driver!"
		text ""
		text "Contact Technical Support for assistance."

menu setvolume at 10,10
	background blue
	text "Set PAS Volume"
	text ""
	text "Select the Volume Level Below"
	text ""
	text "Use the ALT-CTRL-U and -D keys to control the Volume."
	text ""
	text "If these do not work, then select a volume level below."
	text ""
	item "Maximum Volume"   execute "proas v:100"
	item "Minimum Volume"   execute "proas v:10"
	item "Medium Volume"    execute "proas v:50"
	item "Enter Volume Level"       menu entervolume
	item "Return"           return 1

	menu entervolume at 15,20 
		set volumelevel type int 0
		text "Enter a Volume Level from 0 to 100"
		text ""
		text "A Level of 0 will produce no sound!"
		text ""
		text "A Level of 100 will probably be annoying!"
		box at ,9 dims 3,5
		item $volumelevel at ,10 script getvolume return 1

		script getvolume
			:again
			set tmpvolumelevel type int 50
			getstring tmpvolumelevel length 3 allownull
			if issame "${tmpvolumelevel}" "" return

			set t type int 0
			:check
			if issame $t $tmpvolumelevel    goto gotit
			set t $t + 1
			if issame $t 101                goto outofrange
			goto check

			:gotit
			set volumelevel $tmpvolumelevel
			execute proas b:$baseport v:$volumelevel
			return

			:outofrange
			runmenu outofrange
			goto again

			menu outofrange at 16,20
			text "Sorry!"
			text ""
			text "The Number entered is not Valid!"
			
			
	
[ RETURN TO DIRECTORY ]