Difference between revisions of "Modules/psg"

From MSX Game Library

< Modules

(Created page with "{{MODULE |name=psg |category=Device |image=raw.githubusercontent.com/aoineko-fr/MSXgl/main/engine/doc/img/sample_psg.jpg |dependency1= |dependency2= |dependency3= |sample1=s_p...")
 
 
Line 1: Line 1:
 
{{MODULE
 
{{MODULE
 
|name=psg
 
|name=psg
|category=Device
+
|category=Audio
 
|image=raw.githubusercontent.com/aoineko-fr/MSXgl/main/engine/doc/img/sample_psg.jpg
 
|image=raw.githubusercontent.com/aoineko-fr/MSXgl/main/engine/doc/img/sample_psg.jpg
 
|dependency1=
 
|dependency1=

Latest revision as of 00:08, 16 January 2024

psg

Code: psg.h

Category: Audio

Dependencies: None

Samples:

The psg module provides direct access to the functions of the PSG sound processor (AY-3-8910, YM2149 or T7766A).

Usage

To use this module, include "psg.h" in your source code, and add "psg" to the modules list (LibModules) in your project's configuration file (project_config.js).


Samples

See module use cases in the sample programs:

Settings

Library configuration (msxgl_config.h):

// PSG options
// - PSG_INTERNAL ................. Use internal PSG chip (port A0-A2)
// - PSG_EXTERNAL ................. Use external PSG chip (port 10-12)
// - PSG_BOTH ..................... Use both internal and external PSG chips
#define PSG_CHIP					PSG_INTERNAL
// - PSG_DIRECT ................... Function set directly the PSG registers
// - PSG_INDIRECT ................. Function set a buffer (Apply() function must be call once a frame)
#define PSG_ACCESS					PSG_INDIRECT
#define PSG_USE_NOTES				FALSE	// Add notes table to convert note to tone
#define PSG_USE_EXTRA				TRUE	// Add helper functions to handle PSG settings
#define PSG_USE_RESUME

Dependencies

Dependency on other modules: None

Documentation