mirror of https://github.com/zeldaret/tmc.git
song table
This commit is contained in:
parent
e0ee481eeb
commit
9fb5b1fdd0
8610
data/data_089FC6C4.s
8610
data/data_089FC6C4.s
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -1,4 +1,63 @@
|
||||||
#ifndef GUARD_M4A_INTERNAL_H
|
#ifndef GUARD_M4A_INTERNAL_H
|
||||||
#define GUARD_M4A_INTERNAL_H
|
#define GUARD_M4A_INTERNAL_H
|
||||||
|
|
||||||
|
#include "global.h"
|
||||||
|
|
||||||
|
typedef struct MusicPlayerTrack MusicPlayerTrack;
|
||||||
|
typedef struct MusicPlayerInfo MusicPlayerInfo;
|
||||||
|
|
||||||
|
typedef struct WaveData {
|
||||||
|
u16 type;
|
||||||
|
u16 status;
|
||||||
|
u32 freq;
|
||||||
|
u32 loopStart;
|
||||||
|
u32 size; // number of samples
|
||||||
|
s8 data[1]; // samples
|
||||||
|
} WaveData;
|
||||||
|
|
||||||
|
#define TONEDATA_TYPE_CGB 0x07
|
||||||
|
#define TONEDATA_TYPE_FIX 0x08
|
||||||
|
#define TONEDATA_TYPE_SPL 0x40 // key split
|
||||||
|
#define TONEDATA_TYPE_RHY 0x80 // rhythm
|
||||||
|
|
||||||
|
#define TONEDATA_P_S_PAN 0xc0
|
||||||
|
#define TONEDATA_P_S_PAM TONEDATA_P_S_PAN
|
||||||
|
|
||||||
|
typedef struct ToneData {
|
||||||
|
u8 type;
|
||||||
|
u8 key;
|
||||||
|
u8 length; // sound length (compatible sound)
|
||||||
|
u8 pan_sweep; // pan or sweep (compatible sound ch. 1)
|
||||||
|
WaveData* wav;
|
||||||
|
u8 attack;
|
||||||
|
u8 decay;
|
||||||
|
u8 sustain;
|
||||||
|
u8 release;
|
||||||
|
} ToneData;
|
||||||
|
|
||||||
|
typedef struct SongHeader {
|
||||||
|
u8 trackCount;
|
||||||
|
u8 blockCount;
|
||||||
|
u8 priority;
|
||||||
|
u8 reverb;
|
||||||
|
ToneData* tone;
|
||||||
|
u8* part[1];
|
||||||
|
} SongHeader;
|
||||||
|
|
||||||
|
typedef struct Song {
|
||||||
|
const SongHeader* header;
|
||||||
|
u16 ms;
|
||||||
|
u16 me;
|
||||||
|
} Song;
|
||||||
|
|
||||||
|
typedef struct MusicPlayer {
|
||||||
|
MusicPlayerInfo* info;
|
||||||
|
MusicPlayerTrack* track;
|
||||||
|
u8 unk_8;
|
||||||
|
u16 unk_A;
|
||||||
|
} MusicPlayer;
|
||||||
|
|
||||||
|
extern const MusicPlayer gMPlayTable[];
|
||||||
|
extern const Song gSongTable[];
|
||||||
|
|
||||||
#endif // GUARD_M4A_INTERNAL_H
|
#endif // GUARD_M4A_INTERNAL_H
|
||||||
|
|
|
@ -1042,6 +1042,8 @@ SECTIONS {
|
||||||
data/sprite_table.o(.rodata);
|
data/sprite_table.o(.rodata);
|
||||||
src/gba/m4a.o(.rodata);
|
src/gba/m4a.o(.rodata);
|
||||||
data/data_089FC6C4.o(.rodata);
|
data/data_089FC6C4.o(.rodata);
|
||||||
|
src/sound.o(.rodata);
|
||||||
|
data/data_08A127A1.o(.rodata);
|
||||||
src/eeprom.o(.rodata);
|
src/eeprom.o(.rodata);
|
||||||
} >rom
|
} >rom
|
||||||
|
|
||||||
|
|
|
@ -36,9 +36,6 @@
|
||||||
#define SOUND_MODE_DA_BIT 0x00B00000
|
#define SOUND_MODE_DA_BIT 0x00B00000
|
||||||
#define SOUND_MODE_DA_BIT_SHIFT 20
|
#define SOUND_MODE_DA_BIT_SHIFT 20
|
||||||
|
|
||||||
typedef struct MusicPlayerTrack MusicPlayerTrack;
|
|
||||||
typedef struct MusicPlayerInfo MusicPlayerInfo;
|
|
||||||
|
|
||||||
typedef void (*MPlayFunc)();
|
typedef void (*MPlayFunc)();
|
||||||
typedef void (*PlyNoteFunc)(u32, MusicPlayerInfo*, MusicPlayerTrack*);
|
typedef void (*PlyNoteFunc)(u32, MusicPlayerInfo*, MusicPlayerTrack*);
|
||||||
typedef void (*CgbSoundFunc)(void);
|
typedef void (*CgbSoundFunc)(void);
|
||||||
|
@ -48,35 +45,6 @@ typedef void (*ExtVolPitFunc)(void);
|
||||||
typedef void (*MPlayMainFunc)(MusicPlayerInfo*);
|
typedef void (*MPlayMainFunc)(MusicPlayerInfo*);
|
||||||
typedef void (*XcmdFunc)(MusicPlayerInfo*, MusicPlayerTrack*);
|
typedef void (*XcmdFunc)(MusicPlayerInfo*, MusicPlayerTrack*);
|
||||||
|
|
||||||
typedef struct WaveData {
|
|
||||||
u16 type;
|
|
||||||
u16 status;
|
|
||||||
u32 freq;
|
|
||||||
u32 loopStart;
|
|
||||||
u32 size; // number of samples
|
|
||||||
s8 data[1]; // samples
|
|
||||||
} WaveData;
|
|
||||||
|
|
||||||
#define TONEDATA_TYPE_CGB 0x07
|
|
||||||
#define TONEDATA_TYPE_FIX 0x08
|
|
||||||
#define TONEDATA_TYPE_SPL 0x40 // key split
|
|
||||||
#define TONEDATA_TYPE_RHY 0x80 // rhythm
|
|
||||||
|
|
||||||
#define TONEDATA_P_S_PAN 0xc0
|
|
||||||
#define TONEDATA_P_S_PAM TONEDATA_P_S_PAN
|
|
||||||
|
|
||||||
typedef struct ToneData {
|
|
||||||
u8 type;
|
|
||||||
u8 key;
|
|
||||||
u8 length; // sound length (compatible sound)
|
|
||||||
u8 pan_sweep; // pan or sweep (compatible sound ch. 1)
|
|
||||||
WaveData* wav;
|
|
||||||
u8 attack;
|
|
||||||
u8 decay;
|
|
||||||
u8 sustain;
|
|
||||||
u8 release;
|
|
||||||
} ToneData;
|
|
||||||
|
|
||||||
typedef struct CgbChannel {
|
typedef struct CgbChannel {
|
||||||
u8 statusFlags;
|
u8 statusFlags;
|
||||||
u8 type;
|
u8 type;
|
||||||
|
@ -194,15 +162,6 @@ typedef struct SoundInfo {
|
||||||
s8 pcmBuffer[PCM_DMA_BUF_SIZE];
|
s8 pcmBuffer[PCM_DMA_BUF_SIZE];
|
||||||
} SoundInfo;
|
} SoundInfo;
|
||||||
|
|
||||||
typedef struct SongHeader {
|
|
||||||
u8 trackCount;
|
|
||||||
u8 blockCount;
|
|
||||||
u8 priority;
|
|
||||||
u8 reverb;
|
|
||||||
ToneData* tone;
|
|
||||||
u8* part[1];
|
|
||||||
} SongHeader;
|
|
||||||
|
|
||||||
#define MPT_FLG_VOLSET 0x01
|
#define MPT_FLG_VOLSET 0x01
|
||||||
#define MPT_FLG_VOLCHG 0x03
|
#define MPT_FLG_VOLCHG 0x03
|
||||||
#define MPT_FLG_PITSET 0x04
|
#define MPT_FLG_PITSET 0x04
|
||||||
|
@ -265,7 +224,7 @@ struct MusicPlayerTrack {
|
||||||
|
|
||||||
// typedef above
|
// typedef above
|
||||||
struct MusicPlayerInfo {
|
struct MusicPlayerInfo {
|
||||||
SongHeader* songHeader;
|
const SongHeader* songHeader;
|
||||||
u32 status;
|
u32 status;
|
||||||
u8 trackCount;
|
u8 trackCount;
|
||||||
u8 priority;
|
u8 priority;
|
||||||
|
@ -288,22 +247,6 @@ struct MusicPlayerInfo {
|
||||||
u32* intp;
|
u32* intp;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct MusicPlayer {
|
|
||||||
MusicPlayerInfo* info;
|
|
||||||
MusicPlayerTrack* track;
|
|
||||||
u8 unk_8;
|
|
||||||
u16 unk_A;
|
|
||||||
} MusicPlayer;
|
|
||||||
|
|
||||||
typedef struct Song {
|
|
||||||
SongHeader* header;
|
|
||||||
u16 ms;
|
|
||||||
u16 me;
|
|
||||||
} Song;
|
|
||||||
|
|
||||||
extern const MusicPlayer gMPlayTable[];
|
|
||||||
extern const Song gSongTable[];
|
|
||||||
|
|
||||||
extern u8 gMPlayMemAccArea[];
|
extern u8 gMPlayMemAccArea[];
|
||||||
|
|
||||||
extern char SoundMainRAM[];
|
extern char SoundMainRAM[];
|
||||||
|
@ -326,7 +269,7 @@ void MPlayMain();
|
||||||
void RealClearChain(void* x);
|
void RealClearChain(void* x);
|
||||||
|
|
||||||
void MPlayContinue(MusicPlayerInfo* mplayInfo);
|
void MPlayContinue(MusicPlayerInfo* mplayInfo);
|
||||||
void MPlayStart(MusicPlayerInfo* mplayInfo, SongHeader* songHeader);
|
void MPlayStart(MusicPlayerInfo* mplayInfo, const SongHeader* songHeader);
|
||||||
void MPlayStop(MusicPlayerInfo* mplayInfo);
|
void MPlayStop(MusicPlayerInfo* mplayInfo);
|
||||||
void FadeOutBody(MusicPlayerInfo* mplayInfo);
|
void FadeOutBody(MusicPlayerInfo* mplayInfo);
|
||||||
void TrkVolPitSet(MusicPlayerInfo* mplayInfo, MusicPlayerTrack* track);
|
void TrkVolPitSet(MusicPlayerInfo* mplayInfo, MusicPlayerTrack* track);
|
||||||
|
@ -979,7 +922,7 @@ void MPlayOpen(MusicPlayerInfo* mplayInfo, MusicPlayerTrack* tracks, u8 trackCou
|
||||||
mplayInfo->ident = ID_NUMBER;
|
mplayInfo->ident = ID_NUMBER;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MPlayStart(MusicPlayerInfo* mplayInfo, SongHeader* songHeader) {
|
void MPlayStart(MusicPlayerInfo* mplayInfo, const SongHeader* songHeader) {
|
||||||
s32 i;
|
s32 i;
|
||||||
u8 unk_B;
|
u8 unk_B;
|
||||||
MusicPlayerTrack* track;
|
MusicPlayerTrack* track;
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue