SGDK
A free and open development kit for the Sega Mega Drive
Loading...
Searching...
No Matches
xgm.h
Go to the documentation of this file.
1
12
13#ifndef _XGM_H_
14#define _XGM_H_
15
16
20#define SND_isPlaying_XGM() _Pragma("GCC error \"This method is deprecated, use XGM_isPlaying() instead.\"")
24#define SND_startPlay_XGM(song) _Pragma("GCC error \"This method is deprecated, use XGM_startPlay(..) instead.\"")
28#define SND_stopPlay_XGM() _Pragma("GCC error \"This method is deprecated, use XGM_stopPlay() instead.\"")
32#define SND_pausePlay_XGM() _Pragma("GCC error \"This method is deprecated, use XGM_pausePlay() instead.\"")
36#define SND_resumePlay_XGM() _Pragma("GCC error \"This method is deprecated, use XGM_resumePlay() instead.\"")
37
41#define SND_isPlayingPCM_XGM(channel_mask) _Pragma("GCC error \"This method is deprecated, use XGM_isPlayingPCM(..) instead.\"")
45#define SND_setPCM_XGM(id, sample, len) _Pragma("GCC error \"This method is deprecated, use XGM_setPCM(..) instead.\"")
49#define SND_setPCMFast_XGM(id, sample, len) _Pragma("GCC error \"This method is deprecated, use XGM_setPCMFast(..) instead.\"")
53#define SND_startPlayPCM_XGM(id, prio, ch) _Pragma("GCC error \"This method is deprecated, use XGM_startPlayPCM(..) instead.\"")
57#define SND_stopPlayPCM_XGM(channel) _Pragma("GCC error \"This method is deprecated, use XGM_stopPlayPCM(..) instead.\"")
58
62#define SND_getMusicTempo_XGM() _Pragma("GCC error \"This method is deprecated, use XGM_getMusicTempo() instead.\"")
66#define SND_setMusicTempo_XGM(value) _Pragma("GCC error \"This method is deprecated, use XGM_setMusicTempo(..) instead.\"")
67
71#define SND_getManualSync_XGM() _Pragma("GCC error \"This method is deprecated, use XGM_getManualSync() instead.\"")
75#define SND_setManualSync_XGM() _Pragma("GCC error \"This method is deprecated, use XGM_setManualSync() instead.\"")
79#define SND_nextFrame_XGM() _Pragma("GCC error \"This method is deprecated, use XGM_nextFrame() instead.\"")
83#define SND_nextXFrame_XGM(num) _Pragma("GCC error \"This method is deprecated, use XGM_nextXFrame(..) instead.\"")
84
88#define SND_setLoopNumber_XGM(value) _Pragma("GCC error \"This method is deprecated, use XGM_setLoopNumber(..) instead.\"")
89
93#define SND_set68KBUSProtection_XGM(value) _Pragma("GCC error \"This method is deprecated, use XGM_set68KBUSProtection(..) instead.\"")
97#define SND_getForceDelayDMA_XGM() _Pragma("GCC error \"This method is deprecated, use XGM_getForceDelayDMA() instead.\"")
101#define SND_setForceDelayDMA_XGM(value) _Pragma("GCC error \"This method is deprecated, use XGM_setForceDelayDMA(..) instead.\"")
105#define SND_getCPULoad_XGM() _Pragma("GCC error \"This method is deprecated, use XGM_getCPULoad() instead.\"")
106
107
114void XGM_loadDriver(const bool waitReady);
121void XGM_unloadDriver(void);
122
127bool XGM_isPlaying(void);
140void XGM_startPlay(const u8 *song);
155void XGM_startPlay_FAR(const u8 *song, u32 size);
156
163void XGM_stopPlay(void);
173void XGM_pausePlay(void);
183void XGM_resumePlay(void);
184
204u8 XGM_isPlayingPCM(const u16 channel_mask);
223void XGM_setPCM(const u8 id, const u8 *sample, const u32 len);
241void XGM_setPCMFast(const u8 id, const u8 *sample, const u32 len);
246void XGM_setPCM_FAR(const u8 id, const u8 *sample, const u32 len);
251void XGM_setPCMFast_FAR(const u8 id, const u8 *sample, const u32 len);
270void XGM_startPlayPCM(const u8 id, const u8 priority, const SoundPCMChannel channel);
283void XGM_stopPlayPCM(const SoundPCMChannel channel);
284
293u32 XGM_getElapsed(void);
319void XGM_setMusicTempo(const u16 value);
320
336void XGM_setManualSync(const bool value);
357#define XGM_nextFrame() XGM_nextXFrame(1)
364void XGM_nextXFrame(const u16 num);
365
372void XGM_setLoopNumber(const s8 value);
373
380void XGM_set68KBUSProtection(const bool value);
387bool XGM_getForceDelayDMA(void);
392void XGM_setForceDelayDMA(const bool value);
393
405u32 XGM_getCPULoad(void);
406
407
408#endif // _XGM_H_
SoundPCMChannel
Sound PCM channel enum.
Definition sound.h:18
unsigned long u32
Definition types.h:105
char s8
Definition types.h:79
unsigned short u16
Definition types.h:100
unsigned char u8
Definition types.h:95
void XGM_setPCMFast(const u8 id, const u8 *sample, const u32 len)
Same as XGM_setPCM but fast version. This method assume that XGM driver is loaded and that 68000 has...
Definition xgm.c:327
void XGM_set68KBUSProtection(const bool value)
Same as Z80_setBusProtection(..) (generic version of the method)
Definition xgm.c:447
void XGM_stopPlay(void)
Stop playing music (XGM music player driver).
Definition xgm.c:199
void XGM_setPCMFast_FAR(const u8 id, const u8 *sample, const u32 len)
Same as XGM_setPCMFast(..) allowing PCM access through bank switch.
Definition xgm.c:355
u8 XGM_isPlayingPCM(const u16 channel_mask)
Return play status of specified PCM channel (XGM music player driver).
Definition xgm.c:287
void XGM_unloadDriver(void)
Unload the XGM sound driver.
Definition xgm.c:94
void XGM_stopPlayPCM(const SoundPCMChannel channel)
Stop play PCM on specified channel (XGM music player driver). No effect if no sample was currently p...
Definition xgm.c:397
void XGM_resumePlay(void)
Resume playing music after pausing with XGM_pausePlay (XGM music player driver). Note that due to th...
Definition xgm.c:260
void XGM_loadDriver(const bool waitReady)
Load the XGM sound driver.
Definition xgm.c:54
void XGM_startPlay_FAR(const u8 *song, u32 size)
Same as XGM_startPlay(..) except it supports music accessible through bank switch.
Definition xgm.c:194
void XGM_setManualSync(const bool value)
Set manual sync mode of XGM driver (by default auto sync is used).
Definition xgm.c:458
u32 XGM_getCPULoad(void)
Returns an estimation of the Z80 CPU load (XGM driver). The low 16 bits returns the estimated Z80 CP...
Definition xgm.c:535
bool XGM_isPlaying(void)
Returns play music state (XGM music player driver).
Definition xgm.c:103
u32 XGM_getElapsed(void)
Return the elapsed play time since the last XGM_startPlay(..) call. The returned value is in music f...
Definition xgm.c:500
void XGM_startPlay(const u8 *song)
Start playing the specified XGM track (XGM music player driver).
Definition xgm.c:127
void XGM_startPlayPCM(const u8 id, const u8 priority, const SoundPCMChannel channel)
Play a PCM sample on specified channel (XGM music player driver). If a sample was currently playing ...
Definition xgm.c:369
void XGM_setForceDelayDMA(const bool value)
Same as Z80_setForceDelayDMA(..) (generic version of the method)
Definition xgm.c:483
void XGM_pausePlay(void)
Pause playing music, music can be resumed by calling XGM_resumePlay (XGM music player driver)....
Definition xgm.c:236
void XGM_setMusicTempo(const u16 value)
Set the music tempo (in tick per second). Default value is 60 or 50 depending the system is NTSC or ...
Definition xgm.c:493
void XGM_setPCM(const u8 id, const u8 *sample, const u32 len)
Declare a new PCM sample (maximum = 255) for the XGM music player driver. Sample id < 64 are reserve...
Definition xgm.c:311
void XGM_nextXFrame(const u16 num)
Same as XGM_nextFrame() except you can specify the numer of frame.
Definition xgm.c:644
void XGM_setPCM_FAR(const u8 id, const u8 *sample, const u32 len)
Same as XGM_setPCM(..) allowing PCM access through bank switch.
Definition xgm.c:339
bool XGM_getForceDelayDMA(void)
Same as Z80_getForceDelayDMA() (generic version of the method)
Definition xgm.c:478
u16 XGM_getManualSync(void)
Returns manual sync mode state of XGM driver (by default auto sync is used).
Definition xgm.c:453
void XGM_setLoopNumber(const s8 value)
Set the loop number for music with loop command. Default value is -1 for pseudo unfinite (255) loops...
Definition xgm.c:425
u16 XGM_getMusicTempo(void)
Get the current music tempo (in tick per second). Default value is 60 or 50 depending the system is ...
Definition xgm.c:488