Submitted-by: Doug Gwyn Posting-number: Volume 1, Source:23 Archive-name: gsos/driver/apw/video Architecture: ONLY_2gs Version-number: 1.00 This package includes a replacement for the APW VIDEO.H header file, using prototypes (thus requires ORCA/C) and with extensive usage comments so one can leave the manual on the shelf while hacking on applications for Apple's Video Overlay Card or other compatible devices. A utility is included for printing the status of the Video I/O Interface tool set. =ReadMe - "ReadMe" file for VIDEO OVERLAY CARD UTILITY - -This package includes a replacement for the APW VIDEO.H header file, -using prototypes (thus requires ORCA/C) and with extensive usage -comments so one can leave the manual on the shelf while hacking on -applications for Apple's Video Overlay Card or other compatible -devices. A utility is included for printing the status of the -Video I/O Interface tool set. - -This "apack"ed archive contains the following source files: - -ReadMe this file - -Video.h prototyped replacement for 2/ORCACDEFS/VIDEO.H - -VIDEO.DATA a section to be added to 6/DISASM.DATA to allow - the Orca Disassembler to handle Video I/O - Interface tool set calls - -vocstatus.cc source code for a Video I/O Interface tool set - status printer to be compiled for a hosted (shell) - environment - -mk.vocstatus a script for APW/Orca shell to compile and link - the "vocstatus" utility - -The "vocstatus" utility simply polls the Video tool set (# 33) -and prints on stdout what it discovers about the status of -everything known to the Video I/O Interface tool set. The main -purpose of this program is to safely exercise the Video tool set. - -For some reason, I cannot get the "vocstatus" utility to reliably -execute the VDGGStatus() polling section without a system crash. -I am not good at IIGS debugging, but it appears to me to be -crashing in the Orca run-time support. There is a conditional- -compilation flag "TRY_GG_STUFF" that can be #defined to enable -the troublesome section of code, if you'd like to help track down -the problem. - - -AUTHOR: Douglas A. Gwyn -STATUS: Public domain -CREDIT: Based on information gleaned from the VOC Developer Notes. -SYSTEM: Apple IIGS only -LANG.: ORCA/C -OS: GS/OS, APW/Orca environment -VERSION: 1.00 - =VIDEO.DATA -0021 --- Video I/O Interface --- -0121 VDBootInit -0221 VDStartup -0321 VDShutDown -0421 VDVersion -0521 VDReset -0621 VDStatus -0921 VDInStatus -0A21 VDInSetStd -0B21 VDInGetStd -0C21 VDInConvAdj -0D21 VDKeyControl -0E21 VDKeyStatus -0F21 VDKeySetKCol -1021 VDKeyGetKRCol -1121 VDKeyGetKGCol -1221 VDKeyGetKBCol -1321 VDKeySetKDiss -1421 VDKeyGetKDiss -1521 VDKeySetNKDiss -1621 VDKeyGetNKDiss -1721 VDOutSetStd -1821 VDOutGetStd -1921 VDOutControl -1A21 VDOutStatus -1B21 VDGetFeatures -1C21 VDInControl -1D21 VDGGControl -1E21 VDGGStatus - =Video.h -/* - video.h -- definitions for Apple's Video Overlay Card on Apple IIGS - (ORCA/C version) - - last edit: 08-Feb-1991 D A Gwyn - - Tool # 33 is the Video tool set. The following, - adapted from Apple's , describes its programmer interface: - */ - -#ifndef __VIDEO__ -#define __VIDEO__ /* avoids redefinition, for speed */ - -/* Video tool set routines: */ - -extern pascal void VDBootInit(void) /* tool locator init hook */ - inline(0x0121, 0xE10000L); -/* DO NOT CALL THIS! */ -/* No error codes. */ - -extern pascal void VDStartUp(void) /* initialize the toolset */ - inline(0x0221, 0xE10000L); -/* Error codes: */ -#define vdNoVideoDevice 0x2110 /* no video device found */ -#define vdAlreadyStarted 0x2111 /* video tool set already started */ - -extern pascal void VDShutDown(void) /* terminate the toolset */ - inline(0x0321, 0xE10000L); -/* No error codes. */ - -extern pascal unsigned VDVersion(void) /* return toolset version */ - inline(0x0421, 0xE10000L); -/* No error codes. */ - -extern pascal void VDReset(void) /* system reset hook */ - inline(0x0521, 0xE10000L); -/* DO NOT CALL THIS! */ -/* No error codes. */ - -extern pascal unsigned VDStatus(void) /* test if toolset active */ - inline(0x0621, 0xE10000L); -/* false 0 /* toolset not currently active */ -/* true 1 /* toolset currently active */ -/* Error codes: */ -/* vdNoVideoDevice 0x2110 /* no video device present */ - -extern pascal unsigned VDInStatus(unsigned Selector) /* ret inp status */ - inline(0x0921, 0xE10000L); -/* values for "Selector": */ -#define vdGenlock 0x32 /* return genlock control state */ -/* return values: */ -#define vdDisable 0x00 /* genlock disabled */ -#define vdEnable 0x01 /* genlock enabled */ -#define vdVideoDetect 0x33 /* is video detected? */ -#define vdFalse 0x00 /* video not detected */ -#define vdTrue 0x01 /* video detected */ -#define vdGenlocked 0x34 /* is genlock established? */ -/* vdFalse 0x00 /* not genlocked */ -/* vdTrue 0x01 /* genlocked */ -/* Error codes: */ -#define vdInvalidSelector 0x2112 /* invalid selector specified */ - -extern pascal void VDInSetStd(unsigned InStandard) /* select inp std */ - inline(0x0A21, 0xE10000L); -/* values for "InStandard": */ -#define vdNone 0x00 /* input disabled? */ -#define vdNTSC 0x01 /* NTSC video */ -#define vdPAL 0x02 /* PAL video */ -#define vdSECAM 0x04 /* SECAM video */ -#define vdSNTSC 0x08 /* SNTSC (Y/C) video */ -#define vdSPAL 0x10 /* SPAL (Y/C) video */ -#define vdSSECAM 0x20 /* SSECAM (Y/C) video */ -#define vdRGB60 0x40 /* RGB (60 Hz) */ -#define vdRGB50 0x80 /* RGB (50 Hz) */ -/* Error codes: */ -#define vdInvalidParam 0x2113 /* invalid parameter specified */ - -extern pascal unsigned VDInGetStd(void) /* return input standard */ - inline(0x0B21, 0xE10000L); -/* return values: */ -/* vdNone 0x00 /* input not available */ -/* vdNTSC 0x01 /* NTSC video */ -/* vdPAL 0x02 /* PAL video */ -/* vdSECAM 0x04 /* SECAM video */ -/* vdSNTSC 0x08 /* SNTSC (Y/C) video */ -/* vdSPAL 0x10 /* SPAL (Y/C) video */ -/* vdSSECAM 0x20 /* SSECAM (Y/C) video */ -/* vdRGB60 0x40 /* RGB (60 Hz) */ -/* vdRGB50 0x80 /* RGB (50 Hz) */ -/* No error codes. */ - -extern pascal void VDInConvAdj(unsigned Selector, unsigned AdjFunction) - /* adjust video input */ - inline(0x0C21, 0xE10000L); -/* values for "Selector": */ -#define vdInHueAdj 0x09 /* adjust input hue */ -/* values for "AdjFunction": */ -#define vdAdjInc 0x50 /* increment value */ -#define vdAdjDec 0x51 /* decrement value */ -#define vdAdjSave 0x52 /* save settings in NVRAM */ -#define vdInSatAdj 0x0A /* adjust input saturation */ -/* vdAdjInc 0x50 /* increment value */ -/* vdAdjDec 0x51 /* decrement value */ -/* vdAdjSave 0x52 /* save settings in NVRAM */ -/* Error codes: */ -/* vdInvalidSelector 0x2112 /* invalid selector specified */ -/* vdInvalidParam 0x2113 /* invalid parameter specified */ - -extern pascal void VDKeyControl(unsigned Selector, - unsigned KeyerCtrlVal) /* set keying */ - inline(0x0D21, 0xE10000L); -/* values for "Selector": */ -#define vdKeyEnhDiss 0x10 /* enable/disable enhanced diss. */ -/* values for "KeyerCtrlValue": */ -/* vdDisable 0x00 /* disable enh. dissolve */ -/* vdEnable 0x01 /* enable enh. dissolve */ -#define vdKColorEnable 0x64 /* enable/disable key color */ -/* vdDisable 0x00 /* disable key color */ -/* vdEnable 0x01 /* enable key color */ -/* Error codes: */ -/* vdInvalidSelector 0x2112 /* invalid selector specified */ -/* vdInvalidParam 0x2113 /* invalid parameter specified */ - -extern pascal unsigned VDKeyStatus(unsigned Selector) /* return keying */ - inline(0x0E21, 0xE10000L); -/* values for "Selector": */ -/* vdKeyEnhDiss 0x10 /* is enhanced dissolve enabled? */ -/* return values: */ -/* vdDisable 0x00 /* enh. dissolve disabled */ -/* vdEnable 0x01 /* enh. dissolve enabled */ -/* vdKColorEnable 0x64 /* is key color enabled? */ -/* vdDisable 0x00 /* key color disabled */ -/* vdEnable 0x01 /* key color enabled */ -/* Error codes: */ -/* vdInvalidSelector 0x2112 /* invalid selector specified */ - -extern pascal void VDKeySetKCol(unsigned RedValue, unsigned GreenValue, - unsigned BlueValue) /* set key color */ - inline(0x0F21, 0xE10000L); -/* Values are 16-bit (left adjusted); get significance from VDGetFeatures */ -/* Error codes: */ -/* vdInvalidParam 0x2113 /* invalid parameter specified */ - -extern pascal unsigned VDKeyGetKRCol(void) /* return key red value */ - inline(0x1021, 0xE10000L); -/* Value is 16-bit (left adjusted); get significance from VDGetFeatures */ -/* No error codes. */ - -extern pascal unsigned VDKeyGetKGCol(void) /* return key green value */ - inline(0x1121, 0xE10000L); -/* Value is 16-bit (left adjusted); get significance from VDGetFeatures */ -/* No error codes. */ - -extern pascal unsigned VDKeyGetKBCol(void) /* return key blue value */ - inline(0x1221, 0xE10000L); -/* Value is 16-bit (left adjusted); get significance from VDGetFeatures */ -/* No error codes. */ - -extern pascal void VDKeySetKDiss(unsigned KDissolve) - /* set key dissolve level */ - inline(0x1321, 0xE10000L); -/* Dissolve level 0 => all graphics, 65535 => all video */ -/* Error codes: */ -/* vdInvalidParam 0x2113 /* invalid parameter specified */ - -extern pascal unsigned VDKeyGetKDiss(void) /* return key diss. level */ - inline(0x1421, 0xE10000L); -/* Dissolve level 0 => all graphics, 65535 => all video */ -/* No error codes. */ - -extern pascal void VDKeySetNKDiss(unsigned NKDissolve) - /* set nonkey diss. level */ - inline(0x1521, 0xE10000L); -/* Dissolve level 0 => all graphics, 65535 => all video */ -/* Error codes: */ -/* vdInvalidParam 0x2113 /* invalid parameter specified */ - -extern pascal unsigned VDKeyGetNKDiss(void) /* return nonkey dissolve */ - inline(0x1621, 0xE10000L); -/* Dissolve level 0 => all graphics, 65535 => all video */ -/* No error codes. */ - -extern pascal void VDOutSetStd(unsigned OutStandard) - /* set output std */ - inline(0x1721, 0xE10000L); -/* values for "OutStandard": */ -/* vdNone 0x00 /* video output disabled? */ -/* vdNTSC 0x01 /* NTSC video */ -/* vdPAL 0x02 /* PAL video */ -/* vdSECAM 0x04 /* SECAM video */ -/* vdSNTSC 0x08 /* SNTSC (Y/C) video */ -/* vdSPAL 0x10 /* SPAL (Y/C) video */ -/* vdSSECAM 0x20 /* SSECAM (Y/C) video */ -/* RGB output is always available, but its framing depends on output std. */ -/* Error codes: */ -/* vdInvalidParam 0x2113 /* invalid parameter specified */ - -extern pascal unsigned VDOutGetStd(void) /* return output standard */ - inline(0x1821, 0xE10000L); -/* return values: */ -/* vdNone 0x00 /* video not available */ -/* vdNTSC 0x01 /* NTSC video */ -/* vdPAL 0x02 /* PAL video */ -/* vdSECAM 0x04 /* SECAM video */ -/* vdSNTSC 0x08 /* SNTSC (Y/C) video */ -/* vdSPAL 0x10 /* SPAL (Y/C) video */ -/* vdSSECAM 0x20 /* SSECAM (Y/C) video */ -/* RGB output is always available, but its framing depends on output std. */ -/* No error codes. */ - -extern pascal void VDOutControl(unsigned Selector, - unsigned OutCtrlValue) /* outp. controls */ - inline(0x1921, 0xE10000L); -/* values for "Selector": */ -#define vdOutSetup 0x0D /* control composite output setup */ -/* values for "OutCtrlValue": */ -/* vdDisable 0x00 /* disable output setup */ -/* vdEnable 0x01 /* enable output setup */ -#define vdOutChromaFltr 0x0E /* enable/disable chroma filter */ -/* vdDisable 0x00 /* disable chroma filter */ -/* vdEnable 0x01 /* enable chroma filter */ -#define vdOutExtBlank 0x0F /* select blanking source */ -#define vdExternal 0x00 /* pass through blanking */ -#define vdGraphics 0x01 /* blanking from graphics */ -#define vdTextMonoOver 0x14 /* select monochrome text mode */ -/* vdDisable 0x00 /* normal */ -/* vdEnable 0x01 /* monochr. text override */ - /* (requires vdAux) */ -/* Error codes: */ -/* vdInvalidSelector 0x2112 /* invalid selector specified */ -/* vdInvalidParam 0x2113 /* invalid parameter specified */ - -extern pascal unsigned VDOutStatus(unsigned Selector) /* ret out status */ - inline(0x1A21, 0xE10000L); -/* values for "Selector": */ -/* vdOutSetup 0x0D /* is comp. output setup enabled? */ -/* return values: */ -/* vdDisable 0x00 /* output setup disabled */ -/* vdEnable 0x01 /* output setup enabled */ -/* vdOutChromaFltr 0x0E /* is chroma filter enabled? */ -/* vdDisable 0x00 /* chroma filter disabled */ -/* vdEnable 0x01 /* chroma filter enabled */ -/* vdOutExtBlank 0x0F /* query blanking source */ -/* vdExternal 0x00 /* passing thru blanking */ -/* vdGraphics 0x01 /* blanking from graphics */ -/* vdTextMonoOver 0x14 /* query monochrome text mode */ -/* vdDisable 0x00 /* normal */ -/* vdEnable 0x01 /* monochr. text override */ -#define vdVerticalBlank 0x82 /* in vertical blanking interval? */ -#define vdActiveVideo 0x00 /* in video display */ -#define vdVBlank 0x01 /* in vertical blank */ -/* Error codes: */ -/* vdInvalidSelector 0x2112 /* invalid selector specified */ - -extern pascal unsigned VDGetFeatures(unsigned Selector) - inline(0x1B21, 0xE10000L); -/* values for "Selector": */ -#define vdVideoOverlay 0x01 /* is video overlay available? */ -/* return values: */ -#define vdNotAvail 0x00 /* video is not available */ -#define vdAvail 0x01 /* video is available */ -#define vdFrameGrabber 0x02 /* is frame grabber available? */ -/* vdNotAvail 0x00 /* grabber not available */ -/* vdAvail 0x01 /* grabber available */ -#define vdInVStandards 0x03 /* return avail. input standards */ -/* the following return values are bit flags: */ -/* vdNone 0x00 /* input not available */ -/* vdNTSC 0x01 /* NTSC video */ -/* vdPAL 0x02 /* PAL video */ -/* vdSECAM 0x04 /* SECAM video */ -/* vdSNTSC 0x08 /* SNTSC (Y/C) video */ -/* vdSPAL 0x10 /* SPAL (Y/C) video */ -/* vdSSECAM 0x20 /* SSECAM (Y/C) video */ -/* vdRGB60 0x40 /* RGB (60 Hz) */ -/* vdRGB50 0x80 /* RGB (50 Hz) */ -#define vdOutVStandards 0x04 /* return avail. output standards */ -/* the following return values are bit flags: */ -/* vdNone 0x00 /* output not available */ -/* vdNTSC 0x01 /* NTSC video */ -/* vdPAL 0x02 /* PAL video */ -/* vdSECAM 0x04 /* SECAM video */ -/* vdSNTSC 0x08 /* SNTSC (Y/C) video */ -/* vdSPAL 0x10 /* SPAL (Y/C) video */ -/* vdSSECAM 0x20 /* SSECAM (Y/C) video */ -/* RGB output is always available, but its framing depends on output std. */ -#define vdKeyDissLevels 0x05 /* return # key dissolve levels */ -#define vdNKeyDissLevels 0x06 /* return # nonkey diss. levels */ -#define vdAdjSideEffect 0x07 /* adjustments saved upon switch? */ -#define vdNo 0x00 /* not saved upon switch */ -#define vdYes 0x01 /* saved upon switch */ -#define vdKeyColorBits 0x08 /* return # signif key color bits */ -/* vdInHueAdj 0x09 /* has input hue adjustment? */ -/* vdNotAvail 0x00 /* hue adj. not available */ -/* vdAvail 0x01 /* hue adj. available */ -/* vdInSatAdj 0x0A /* has input saturation adj.? */ -/* vdNotAvail 0x00 /* sat adj. not available */ -/* vdAvail 0x01 /* sat adj. available */ -#define vdInContrastAdj 0x0B /* has input contrast adjustment? */ -/* vdNotAvail 0x00 /* con adj. not available */ -/* vdAvail 0x01 /* con adj. available */ -#define vdInBrightAdj 0x0C /* has input brightness adj.? */ -/* vdNotAvail 0x00 /* bri adj. not available */ -/* vdAvail 0x01 /* bri adj. available */ -/* vdOutSetup 0x0D /* supports compos. output setup? */ -/* vdNotAvail 0x00 /* setup not available */ -/* vdAvail 0x01 /* setup available */ -/* vdOutChromaFltr 0x0E /* has output chroma filter? */ -/* vdNotAvail 0x00 /* filter not available */ -/* vdAvail 0x01 /* filter available */ -/* vdOutExtBlank 0x0F /* can pass blanking int through? */ -/* vdNotAvail 0x00 /* interval not available */ -/* vdAvail 0x01 /* interval available */ -/* vdKeyEnhDiss 0x10 /* supports enhanced dissolve? */ -/* vdNotAvail 0x00 /* enhanced not available */ -/* vdAvail 0x01 /* enhanced available */ -#define vdLineInterrupt 0x11 /* supports scan-line interrupts? */ -/* vdNotAvail 0x00 /* intrs. not available */ -/* vdAvail 0x01 /* intrs. available */ -#define vdGGBus 0x12 /* disable Apple bus interface? */ -/* vdNotAvail 0x00 /* cannot disable II bus */ -/* vdAvail 0x01 /* can disable II bus */ -#define vdDualOut 0x13 /* motherboard/card both present? */ -/* vdNotAvail 0x00 /* only video card avail. */ -/* vdAvail 0x01 /* both generators avail. */ -/* vdTextMonoOver 0x14 /* supports text monochrome? */ -/* vdNotAvail 0x00 /* override not available */ -/* vdAvail 0x01 /* override available */ -/* Error codes: */ -/* vdInvalidSelector 0x2112 /* invalid selector specified */ - -extern pascal void VDInControl(unsigned Selector, unsigned InCtrlValue) - /* control video input */ - inline(0x1C21, 0xE10000L); -/* values for "Selector": */ -/* vdGenlock 0x32 /* enable/disable input genlock */ -/* values for "InCtrlValue": */ -/* vdDisable 0x00 /* disable genlock */ -/* vdEnable 0x01 /* enable genlock */ -/* Error codes: */ -/* vdInvalidSelector 0x2112 /* invalid selector specified */ -/* vdInvalidParam 0x2113 /* invalid parameter specified */ - -extern pascal void VDGGControl(unsigned Selector, unsigned GGCtrlValue) - /* control graphics gen. */ - inline(0x1D21, 0xE10000L); -/* values for "Selector": */ -/* vdLineInterrupt 0x11 /* control scan-line interrupts */ -/* values for "GGCtrlValue": */ -/* vdDisable 0x00 /* disable interrupts */ -/* vdEnable 0x01 /* enable interrupts */ -/* vdGGBus 0x12 /* control Apple II bus interface */ -/* vdDisable 0x00 /* disable II generator */ -/* vdEnable 0x01 /* enable II generator */ -#define vdMainPageLin 0xC8 /* main memory page linearization */ -/* vdDisable 0x00 /* don't linearize (old) */ -/* vdEnable 0x01 /* linearize (SHR) */ -#define vdRAMPageSel 0xC9 /* RAM page select (aux. default) */ -#define vdAux 0x00 /* auxiliary (0xE1) bank */ -#define vdMain 0x10 /* main (0xE0) bank */ -#define vdInterlace 0x30 /* interlace main & aux. */ -#define vdVBLInterrupt 0xCA /* control vert blank. interrupts */ -/* vdDisable 0x00 /* disable interrupts */ -/* vdEnable 0x01 /* enable interrupts */ -#define vdInterlaceMode 0xCB /* enable/disable interlace mode */ -/* vdDisable 0x00 /* disable interlace */ -/* vdEnable 0x01 /* enable interlace */ -#define vdClearVBLInt 0xCC /* clear vert. blanking interrupt */ -#define vdNil 0x00 -#define vdClearLineInt 0xCD /* clear the scan-line interrupt */ -/* vdNil 0x00 -/* Error codes: */ -/* vdInvalidSelector 0x2112 /* invalid selector specified */ -/* vdInvalidParam 0x2113 /* invalid parameter specified */ - -extern pascal unsigned VDGGStatus(unsigned Selector) /* get gen. state */ - inline(0x1E21, 0xE10000L); -/* values for "Selector": */ -/* vdLineInterrupt 0x11 /* query scan-line interrupts */ -/* return values: */ -/* vdDisable 0x00 /* interrupts disabled */ -/* vdEnable 0x01 /* interrupts enabled */ -/* vdGGBus 0x12 /* query Apple II bus interface */ -/* vdDisable 0x00 /* II generator disabled */ -/* vdEnable 0x01 /* II generator enabled */ -/* vdMainPageLin 0xC8 /* query main page linearization */ -/* vdDisable 0x00 /* not linearized (old) */ -/* vdEnable 0x01 /* linearized (SHR) */ -/* vdRAMPageSel 0xC9 /* query RAM page selection */ -/* vdAux 0x00 /* auxiliary (0xE1) bank */ -/* vdMain 0x10 /* main (0xE0) bank */ -/* vdInterlace 0x30 /* interlaced main & aux. */ -/* vdVBLInterrupt 0xCA /* query vert blanking interrupts */ -/* vdDisable 0x00 /* interrupts disabled */ -/* vdEnable 0x01 /* interrupts enabled */ -/* vdInterlaceMode 0xCB /* query interlace mode */ -/* vdDisable 0x00 /* interlace disabled */ -/* vdEnable 0x01 /* interlace enabled */ -#define vdDisplayField 0xCE /* query current display field */ -#define vdField0 0x00 /* in display field # 0 */ -#define vdField1 0x01 /* in display field # 1 */ -#define vdVBLIntRequest 0xCF /* test for vert blank. interrupt */ -/* vdFalse 0x00 /* interrupt requested */ -/* vdTrue 0x01 /* no interrupt requested */ -#define vdLineIntRequest 0xD0 /* test for scan-line interrupt */ -/* vdFalse 0x00 /* interrupt requested */ -/* vdTrue 0x01 /* no interrupt requested */ -/* Error codes: */ -/* vdInvalidSelector 0x2112 /* invalid selector specified */ - -/* Additional error codes: */ - -#define vdUnImplemented 0x21FF /* unimplemented routine called */ - -/* Additional, unused definitions from Apple's : */ - -#define vdOff 0x00 -#define vdOn 0x01 - -#endif /* __VIDEO__ */ =mk.vocstatus -* mk.vocstatus -- build "vocstatus" utility (for shell environment) - -* last edit: 08-Feb-1991 D A Gwyn - -compile vocstatus.cc keep=vocstatus -link vocstatus keep=vocstatus - =vocstatus.cc -/* - vocstatus -- prints current VOC status to stdout - - last edit: 08-Feb-1991 D A Gwyn -*/ -/*#define TRY_GG_STUFF /* to turn on the troublesome section of code */ - -#include - -#if __STDC__ -#include -#endif - -#ifndef EXIT_SUCCESS -#define EXIT_SUCCESS 0 -#endif - -#ifndef EXIT_FAILURE -#define EXIT_FAILURE (-1) -#endif - -#include /* Tool Locator tool set (# 1) defs. etc. */ -#include /* Video tool set (# 33) definitions etc. */ - -#define vdTOOL_NUMBER 33 /* really should be in */ - -#ifndef __ORCAC__ -static int -toolerror() - { - extern int _toolErr; - - return _toolErr; - } -#endif - -int -main( argc, argv ) - int argc; - char *argv[]; - { - register unsigned value, - status; - - LoadOneTool( vdTOOL_NUMBER, 0 ); - - switch ( toolerror() ) - { - case 0: - break; - - case toolNotFoundErr: - printf( "*** Couldn't load Video tool (# %d) ***\n", - vdTOOL_NUMBER - ); - exit( EXIT_FAILURE ); - - default: - printf( "*** Unexpected error 0x%04X from LoadOneTool ***\n", - toolerror() - ); - exit( EXIT_FAILURE ); - } - - if ( status = VDStatus() ) - printf( "Video toolset was already active\n" ); - - switch ( toolerror() ) - { - case 0: - break; - - case vdNoVideoDevice: - printf( "*** No video device installed ***\n" ); - exit( EXIT_FAILURE ); - - default: - printf( "*** Unknown error 0x%04X from VDStatus ***\n", - toolerror() - ); -/* exit( EXIT_FAILURE ); */ - } - - if ( !status ) - { - VDStartUp(); - - switch ( toolerror() ) - { - case 0: - break; - - case vdNoVideoDevice: - printf( "*** No video device installed ***\n" ); - exit( EXIT_FAILURE ); - - default: - printf( "*** Unexpected error 0x%04X from VDStartUp ***\n", - toolerror() - ); - exit( EXIT_FAILURE ); - } - } - - printf( "Video toolset version: %u\n", VDVersion() ); - - printf( "Video overlay is%s available\n", - VDGetFeatures( vdVideoOverlay ) ? "" : " not" - ); - - printf( "Frame grabber is%s available\n", - VDGetFeatures( vdFrameGrabber ) ? "" : " not" - ); - - if ( (value = VDGetFeatures( vdInVStandards )) == vdNone ) - printf( "Input is not available\n" ); - else { - struct { - unsigned bit; - char *name; - } *p, - list[] = - { - vdNTSC, "NTSC video", - vdPAL, "PAL video", - vdSECAM, "SECAM video", - vdSNTSC, "SNTSC (Y/C) video", - vdSPAL, "SPAL (Y/C) video", - vdSSECAM, "SSECAM (Y/C) video", - vdRGB60, "RGB (60 Hz)", - vdRGB50, "RGB (50 Hz)", - vdNone, 0 - }; - - printf( "Inputs available:\n" ); - - for ( p = list; p->name; ++p ) - if ( value & p->bit ) - printf( " %s\n", p->name ); - } - - if ( (value = VDGetFeatures( vdOutVStandards )) == vdNone ) - printf( "Output other than RGB is not available\n" ); - else { - struct { - unsigned bit; - char *name; - } *p, - list[] = - { - vdNTSC, "NTSC video", - vdPAL, "PAL video", - vdSECAM, "SECAM video", - vdSNTSC, "SNTSC (Y/C) video", - vdSPAL, "SPAL (Y/C) video", - vdSSECAM, "SSECAM (Y/C) video", - vdNone, 0 - }; - - printf( "Outputs other than RGB available:\n" ); - - for ( p = list; p->name; ++p ) - if ( value & p->bit ) - printf( " %s\n", p->name ); - } - - printf( "# key dissolve levels: %u\n", - VDGetFeatures( vdKeyDissLevels ) - ); - - printf( "# nonkey dissolve levels: %u\n", - VDGetFeatures( vdNKeyDissLevels ) - ); - - printf( "Adjustments are%s saved upon switch\n", - VDGetFeatures( vdAdjSideEffect ) ? "" : " not" - ); - - printf( "# significant key color bits: %u\n", - VDGetFeatures( vdKeyColorBits ) - ); - - printf( "%s input hue adjustment\n", - VDGetFeatures( vdInHueAdj ) ? "Has" : "Does not have" - ); - - printf( "%s input saturation adjustment\n", - VDGetFeatures( vdInSatAdj ) ? "Has" : "Does not have" - ); - - printf( "%s input contrast adjustment\n", - VDGetFeatures( vdInContrastAdj ) ? "Has" : "Does not have" - ); - - printf( "%s input brightness adjustment\n", - VDGetFeatures( vdInBrightAdj ) ? "Has" : "Does not have" - ); - - printf( "%s composite output setup\n", - VDGetFeatures( vdOutSetup ) ? "Supports" : "Does not support" - ); - - printf( "%s output chroma filter\n", - VDGetFeatures( vdOutChromaFltr ) ? "Has" : "Does not have" - ); - - printf( "Can%s pass blanking interval through\n", - VDGetFeatures( vdOutExtBlank ) ? "" : "not" - ); - - printf( "%s enhanced dissolve\n", - VDGetFeatures( vdKeyEnhDiss ) ? "Supports" : "Does not support" - ); - - printf( "%s scan-line interrupts\n", - VDGetFeatures( vdLineInterrupt ) ? "Supports" : "Does not support" - ); - - printf( "Can%s disable Apple II bus interface\n", - VDGetFeatures( vdGGBus ) ? "" : "not" - ); - - printf( "Motherboard generator is%s also available\n", - VDGetFeatures( vdDualOut ) ? "" : " not" - ); - - printf( "%s text monochrome mode\n", - VDGetFeatures( vdTextMonoOver ) ? "Supports" : "Does not support" - ); - - printf( "Genlock is %s\n", - VDInStatus( vdGenlock ) ? "enabled" : "disabled" - ); - - printf( "Video is%s detected\n", - VDInStatus( vdVideoDetect ) ? "" : " not" - ); - - printf( "Genlock is%s established\n", - VDInStatus( vdGenlocked ) ? "" : " not" - ); - - if ( (value = VDInGetStd()) == vdNone ) - printf( "No input standard currently set\n" ); - else { - struct { - unsigned bit; - char *name; - } *p, - list[] = - { - vdNTSC, "NTSC video", - vdPAL, "PAL video", - vdSECAM, "SECAM video", - vdSNTSC, "SNTSC (Y/C) video", - vdSPAL, "SPAL (Y/C) video", - vdSSECAM, "SSECAM (Y/C) video", - vdRGB60, "RGB (60 Hz)", - vdRGB50, "RGB (50 Hz)", - vdNone, 0 - }; - - printf( "Input standard currently set:\n" ); - - for ( p = list; p->name; ++p ) - if ( value & p->bit ) - printf( " %s\n", p->name ); - /* should be only one, but proceed anyway */ - } - - printf( "Enhanced dissolve is %s\n", - VDKeyStatus( vdKeyEnhDiss ) ? "enabled" : "disabled" - ); - - printf( "Key color is %s\n", - VDKeyStatus( vdKColorEnable ) ? "enabled" : "disabled" - ); - - printf( "Key color: (R: 0x%04X, G: 0x%04X, B: 0x%04X)\n", - VDKeyGetKRCol(), VDKeyGetKGCol(), VDKeyGetKBCol() - ); - - printf( "Key dissolve level: %u\n", VDKeyGetKDiss() ); - - printf( "Nonkey dissolve level: %u\n", VDKeyGetNKDiss() ); - - if ( (value = VDOutGetStd()) == vdNone ) - printf( "No output standard other than RGB currently set\n" ); - else { - struct { - unsigned bit; - char *name; - } *p, - list[] = - { - vdNTSC, "NTSC video", - vdPAL, "PAL video", - vdSECAM, "SECAM video", - vdSNTSC, "SNTSC (Y/C) video", - vdSPAL, "SPAL (Y/C) video", - vdSSECAM, "SSECAM (Y/C) video", - vdRGB60, "RGB (60 Hz)", - vdRGB50, "RGB (50 Hz)", - vdNone, 0 - }; - - printf( "Output standard other than RGB currently set:\n" ); - - for ( p = list; p->name; ++p ) - if ( value & p->bit ) - printf( " %s\n", p->name ); - /* should be only one, but proceed anyway */ - } - - printf( "Composite output setup is %s\n", - VDOutStatus( vdOutSetup ) ? "enabled" : "disabled" - ); - - printf( "Output chroma filter is %s\n", - VDOutStatus( vdOutChromaFltr ) ? "enabled" : "disabled" - ); - - printf( "Output blanking is obtained from %s\n", - VDOutStatus( vdOutExtBlank ) ? "graphics" : "video input" - ); - - printf( "Monochrome text override is %s\n", - VDOutStatus( vdTextMonoOver ) ? "enabled" : "disabled" - ); - - printf( "Display scan is%s in the vertical blanking interval\n", - VDOutStatus( vdVerticalBlank ) ? "" : "not" - ); - -#ifdef TRY_GG_STUFF /* usually crashes when I try it */ - - printf( "Scan-line interrupts are %s\n", - VDGGStatus( vdLineInterrupt ) ? "enabled" : "disabled" - ); - - printf( "Apple II bus generator is %s\n", - VDGGStatus( vdGGBus ) ? "enabled" : "disabled" - ); - - printf( "Main page linearization is %s\n", - VDGGStatus( vdMainPageLin ) ? "enabled (SHR)" : "disabled (DHR)" - ); - - value = VDGGStatus( vdRAMPageSel ); - printf( "RAM pages obtained from %s bank\n", - value == vdAux ? "auxiliary" : value == vdMain ? "main" : - value == vdInterlace ? "interlaced main and auxiliary" : - "*** unknown ***" - ); - - printf( "Vertical-blanking interrupts are %s\n", - VDGGStatus( vdVBLInterrupt ) ? "enabled" : "disabled" - ); - - printf( "Current display field: %u\n", VDGGStatus( vdDisplayField ) ); - - printf( "Vertical-blanking interrupt is%s requested\n", - VDGGStatus( vdVBLIntRequest ) ? " not" : "" - ); - - printf( "Scan-line interrupt is%s requested\n", - VDGGStatus( vdLineIntRequest ) ? " not" : "" - ); - -#endif /* TRY_GG_STUFF */ - - if ( !status ) - { - VDShutDown(); - - switch ( toolerror() ) - { - case 0: - break; - - default: - printf( "*** Unexpected error 0x%04X from VDShutDown ***\n", - toolerror() - ); - exit( EXIT_FAILURE ); - } - } - - UnloadOneTool( vdTOOL_NUMBER ); - - switch ( toolerror() ) - { - case 0: - break; - - default: - printf( "*** Unexpected error 0x%04X from UnloadOneTool ***\n", - toolerror() - ); - exit( EXIT_FAILURE ); - } - - return EXIT_SUCCESS; - } - + END OF ARCHIVE