1 
2 // automatically generated by m4 from headers in proto subdir
3 
4 
5 #ifndef __SMS_PSGLIB_H__
6 #define __SMS_PSGLIB_H__
7 
8 #include <arch.h>
9 
10 /* **************************************************
11    PSGlib - C programming library for the SEGA PSG
12    ( part of devkitSMS - github.com/sverx/devkitSMS )
13    Synchronized March 29, 2017
14    ************************************************** */
15 
16 #define PSG_STOPPED         __PSGLIB_PSG_STOPPED
17 #define PSG_PLAYING         __PSGLIB_PSG_PLAYING
18 
19 #define SFX_CHANNEL2        __PSGLIB_SFX_CHANNEL2
20 #define SFX_CHANNEL3        __PSGLIB_SFX_CHANNEL3
21 #define SFX_CHANNELS2AND3   __PSGLIB_SFX_CHANNELS2AND3
22 
23 extern void PSGPlay(void *song) __preserves_regs(b,c,d,e,iyl,iyh);
24 extern void PSGPlay_fastcall(void *song) __preserves_regs(b,c,d,e,h,l,iyl,iyh) __z88dk_fastcall;
25 #define PSGPlay(a) PSGPlay_fastcall(a)
26 
27 
28 extern void PSGCancelLoop(void) __preserves_regs(b,c,d,e,h,l,iyl,iyh);
29 
30 extern void PSGPlayNoRepeat(void *song) __preserves_regs(b,c,d,e,iyl,iyh);
31 extern void PSGPlayNoRepeat_fastcall(void *song) __preserves_regs(b,c,d,e,h,l,iyl,iyh) __z88dk_fastcall;
32 #define PSGPlayNoRepeat(a) PSGPlayNoRepeat_fastcall(a)
33 
34 
35 extern void PSGStop(void) __preserves_regs(b,c,d,e,h,l,iyl,iyh);
36 
37 extern unsigned char PSGGetStatus(void) __preserves_regs(a,b,c,d,e,iyl,iyh);
38 
39 extern void PSGSetMusicVolumeAttenuation(unsigned char attenuation) __preserves_regs(b,c,d,e,iyl,iyh);
40 extern void PSGSetMusicVolumeAttenuation_fastcall(unsigned char attenuation) __preserves_regs(b,c,d,e,h,l,iyl,iyh) __z88dk_fastcall;
41 #define PSGSetMusicVolumeAttenuation(a) PSGSetMusicVolumeAttenuation_fastcall(a)
42 
43 
44 
45 extern void PSGSFXPlay(void *sfx,unsigned char channels) __preserves_regs(iyl,iyh);
46 extern void PSGSFXPlay_callee(void *sfx,unsigned char channels) __preserves_regs(b,iyl,iyh) __z88dk_callee;
47 #define PSGSFXPlay(a,b) PSGSFXPlay_callee(a,b)
48 
49 
50 extern void PSGSFXPlayLoop(void *sfx,unsigned char channels) __preserves_regs(iyl,iyh);
51 extern void PSGSFXPlayLoop_callee(void *sfx,unsigned char channels) __preserves_regs(b,iyl,iyh) __z88dk_callee;
52 #define PSGSFXPlayLoop(a,b) PSGSFXPlayLoop_callee(a,b)
53 
54 
55 extern void PSGSFXCancelLoop(void) __preserves_regs(b,c,d,e,h,l,iyl,iyh);
56 
57 extern void PSGSFXStop(void) __preserves_regs(b,c,d,e,iyl,iyh);
58 
59 extern unsigned char PSGSFXGetStatus(void) __preserves_regs(a,b,c,d,e,iyl,iyh);
60 
61 
62 extern void PSGSilenceChannels(void) __preserves_regs(a,d,e,iyl,iyh);
63 
64 extern void PSGRestoreVolumes(void) __preserves_regs(b,c,d,e,iyl,iyh);
65 
66 
67 extern void PSGFrame(void) __preserves_regs(d,e,iyl,iyh);
68 
69 extern void PSGSFXFrame(void) __preserves_regs(d,e,iyl,iyh);
70 
71 
72 #endif
73