Nugget
Loading...
Searching...
No Matches
Classes | Macros | Functions | Variables
modplayer.c File Reference
#include "modplayer/modplayer.h"
#include <stddef.h>
#include <stdint.h>
#include "common/hardware/dma.h"
#include "common/hardware/spu.h"
Include dependency graph for modplayer.c:

Classes

struct  MODSampleData
 
struct  MODFileFormat
 
struct  SPUChannelData
 
struct  SpuInstrumentData
 

Macros

#define SETVOICESAMPLERATE(channel, newPeriod)    SPUSetVoiceSampleRate(channel, ((7093789 / (newPeriod * 2)) << 12) / 44100)
 
#define SETVOICEVOLUME(channel, volume)
 

Functions

unsigned MOD_Check (const struct MODFileFormat *module)
 
uint32_t MOD_Load (const struct MODFileFormat *module)
 
unsigned MOD_LoadEx (const struct MODFileFormat *module, const uint8_t *sampleData)
 
void MOD_Silence ()
 
void MOD_Relocate (uint8_t *s1)
 
void MOD_Poll ()
 
void MOD_PlayNote (unsigned channel, unsigned sampleID, unsigned note, int16_t volume)
 
void MOD_PlaySoundEffect (unsigned channel, unsigned sampleID, unsigned note, int16_t volume)
 
void MOD_SetMusicVolume (uint32_t musicVolume)
 

Variables

unsigned MOD_Channels = 0
 
unsigned MOD_SongLength = 0
 
unsigned MOD_CurrentOrder = 0
 
unsigned MOD_CurrentPattern = 0
 
unsigned MOD_CurrentRow = 0
 
unsigned MOD_Speed = 0
 
unsigned MOD_Tick = 0
 
unsigned MOD_BPM = 0
 
const uint8_t * MOD_RowPointer = NULL
 
int MOD_ChangeRowNextTick = 0
 
unsigned MOD_NextRow = 0
 
int MOD_ChangeOrderNextTick = 0
 
unsigned MOD_NextOrder = 0
 
uint8_t MOD_PatternDelay = 0
 
unsigned MOD_LoopStart = 0
 
unsigned MOD_LoopCount = 0
 
int MOD_Stereo = 0
 
uint32_t MOD_hblanks
 
const uint16_t MOD_PeriodTable [36 *16]
 

Macro Definition Documentation

◆ SETVOICESAMPLERATE

#define SETVOICESAMPLERATE (   channel,
  newPeriod 
)     SPUSetVoiceSampleRate(channel, ((7093789 / (newPeriod * 2)) << 12) / 44100)

◆ SETVOICEVOLUME

#define SETVOICEVOLUME (   channel,
  volume 
)
Value:
volume <<= 8; \
if (MOD_Stereo) { \
int pan = (channel & 1) ^ (channel >> 1); \
int16_t left = pan == 0 ? volume : 0; \
int16_t right = pan == 0 ? 0 : volume; \
SPUSetVoiceVolume(channel, left, right); \
} else { \
SPUSetVoiceVolume(channel, volume, volume); \
}
int MOD_Stereo
Definition modplayer.c:188

Function Documentation

◆ MOD_Check()

unsigned MOD_Check ( const struct MODFileFormat module)

◆ MOD_Load()

uint32_t MOD_Load ( const struct MODFileFormat module)

◆ MOD_LoadEx()

unsigned MOD_LoadEx ( const struct MODFileFormat module,
const uint8_t *  sampleData 
)

◆ MOD_PlayNote()

void MOD_PlayNote ( unsigned  channel,
unsigned  sampleID,
unsigned  note,
int16_t  volume 
)

◆ MOD_PlaySoundEffect()

void MOD_PlaySoundEffect ( unsigned  channel,
unsigned  sampleID,
unsigned  note,
int16_t  volume 
)

◆ MOD_Poll()

void MOD_Poll ( )

◆ MOD_Relocate()

void MOD_Relocate ( uint8_t *  s1)

◆ MOD_SetMusicVolume()

void MOD_SetMusicVolume ( uint32_t  musicVolume)

◆ MOD_Silence()

void MOD_Silence ( )

Variable Documentation

◆ MOD_BPM

unsigned MOD_BPM = 0

◆ MOD_ChangeOrderNextTick

int MOD_ChangeOrderNextTick = 0

◆ MOD_ChangeRowNextTick

int MOD_ChangeRowNextTick = 0

◆ MOD_Channels

unsigned MOD_Channels = 0

◆ MOD_CurrentOrder

unsigned MOD_CurrentOrder = 0

◆ MOD_CurrentPattern

unsigned MOD_CurrentPattern = 0

◆ MOD_CurrentRow

unsigned MOD_CurrentRow = 0

◆ MOD_hblanks

uint32_t MOD_hblanks

◆ MOD_LoopCount

unsigned MOD_LoopCount = 0

◆ MOD_LoopStart

unsigned MOD_LoopStart = 0

◆ MOD_NextOrder

unsigned MOD_NextOrder = 0

◆ MOD_NextRow

unsigned MOD_NextRow = 0

◆ MOD_PatternDelay

uint8_t MOD_PatternDelay = 0

◆ MOD_PeriodTable

const uint16_t MOD_PeriodTable[36 *16]

◆ MOD_RowPointer

const uint8_t* MOD_RowPointer = NULL

◆ MOD_SongLength

unsigned MOD_SongLength = 0

◆ MOD_Speed

unsigned MOD_Speed = 0

◆ MOD_Stereo

int MOD_Stereo = 0

◆ MOD_Tick

unsigned MOD_Tick = 0