Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

64 lines
1.6 KiB

  1. /***************************************************************************
  2. *
  3. * fm.h
  4. *
  5. * Copyright (c) 1991-1996 Microsoft Corporation. All Rights Reserved.
  6. *
  7. * This code provides VDD support for SB 2.0 sound output, specifically:
  8. * FM Chip OPL2 (a.k.a. Adlib)
  9. *
  10. ***************************************************************************/
  11. /*****************************************************************************
  12. *
  13. * #defines
  14. *
  15. *****************************************************************************/
  16. /*
  17. * OPL2/Adlib Ports
  18. */
  19. #define ADLIB_REGISTER_SELECT_PORT 0x388 // select the register to write data
  20. #define ADLIB_STATUS_PORT 0x388 // read to determine opl2 status
  21. #define ADLIB_DATA_PORT 0x389 // write data port
  22. /*
  23. * FM information
  24. */
  25. #define AD_MASK 0x04 // adlib register used to control opl2
  26. #define AD_NEW 0x105 // used to determine if app entering opl3 mode
  27. #define BATCH_SIZE 40 // how much data is batched to opl2
  28. typedef struct { // structure written to fm device
  29. unsigned short IoPort;
  30. unsigned short PortData;
  31. } SYNTH_DATA, *PSYNTH_DATA;
  32. /*****************************************************************************
  33. *
  34. * Function Prototypes
  35. *
  36. *****************************************************************************/
  37. void ResetFM(void);
  38. BOOL OpenFMDevice(void);
  39. void CloseFMDevice(void);
  40. BOOL FMPortWrite(void);
  41. VOID
  42. FMDataWrite(
  43. BYTE data
  44. );
  45. VOID
  46. FMRegisterSelect(
  47. BYTE data
  48. );
  49. VOID
  50. FMStatusRead(
  51. BYTE *data
  52. );