|
| 1 | +/* |
| 2 | +# _____ ___ ____ ___ ____ |
| 3 | +# ____| | ____| | | |____| |
| 4 | +# | ___| |____ ___| ____| | \ PS2DEV Open Source Project. |
| 5 | +#----------------------------------------------------------------------- |
| 6 | +# Copyright ps2dev - http://www.ps2dev.org |
| 7 | +# Licenced under Academic Free License version 2.0 |
| 8 | +# Review ps2sdk README & LICENSE files for further details. |
| 9 | +*/ |
| 10 | + |
| 11 | +#ifndef _SDSQ_H |
| 12 | +#define _SDSQ_H |
| 13 | + |
| 14 | +#ifdef _IOP |
| 15 | +#include <tamtypes.h> |
| 16 | +#endif |
| 17 | + |
| 18 | +typedef struct sceSeqMidiCompBlock_ |
| 19 | +{ |
| 20 | + u16 compOption; |
| 21 | + u16 compTableSize; |
| 22 | + u8 compTable[]; |
| 23 | +} sceSeqMidiCompBlock; |
| 24 | + |
| 25 | +typedef struct sceSeqMidiDataBlock_ |
| 26 | +{ |
| 27 | + unsigned int sequenceDataOffset; |
| 28 | + u16 Division; |
| 29 | + sceSeqMidiCompBlock compBlock[]; |
| 30 | +} sceSeqMidiDataBlock; |
| 31 | + |
| 32 | +typedef struct SceSdSqMidiData_ |
| 33 | +{ |
| 34 | + u32 readStatus; |
| 35 | + u32 midiNumber; |
| 36 | + sceSeqMidiDataBlock *midiData; |
| 37 | + u32 offset; |
| 38 | + u32 nextOffset; |
| 39 | + u32 division; |
| 40 | + u32 compMode; |
| 41 | + u32 compTableSize; |
| 42 | + u32 deltaTime; |
| 43 | + u8 lastStatus; |
| 44 | + u8 reserve[3]; |
| 45 | + u32 messageLength; |
| 46 | + u8 message[8]; |
| 47 | + u32 originalMessageLength; |
| 48 | + u8 originalMessage[12]; |
| 49 | +} SceSdSqMidiData; |
| 50 | + |
| 51 | +typedef struct SceSdSqSongData_ |
| 52 | +{ |
| 53 | + u32 readStatus; |
| 54 | + u32 songNumber; |
| 55 | + void *topAddr; |
| 56 | + u32 offset; |
| 57 | + u32 nextOffset; |
| 58 | + u8 message[3]; |
| 59 | + u8 reserve; |
| 60 | +} SceSdSqSongData; |
| 61 | + |
| 62 | +struct SceSdSqCompTableData_ |
| 63 | +{ |
| 64 | + u8 status; |
| 65 | + u8 data; |
| 66 | +}; |
| 67 | + |
| 68 | +typedef struct SceSdSqCompTableData_ SceSdSqCompTableData; |
| 69 | +typedef struct SceSdSqCompTableData_ SceSdSqPolyKeyData; |
| 70 | + |
| 71 | +typedef struct SceSdSqCompTableNoteOnEvent_ |
| 72 | +{ |
| 73 | + u8 status; |
| 74 | + u8 note; |
| 75 | + u8 velocity; |
| 76 | + u8 reserve; |
| 77 | +} SceSdSqCompTableNoteOnEvent; |
| 78 | + |
| 79 | +extern int sceSdSqGetMaxMidiNumber(void *addr); |
| 80 | +extern int sceSdSqGetMaxSongNumber(void *addr); |
| 81 | +extern int sceSdSqInitMidiData(void *addr, u32 midiNumber, SceSdSqMidiData *midiData); |
| 82 | +extern int sceSdSqReadMidiData(SceSdSqMidiData *midiData); |
| 83 | +extern int sceSdSqInitSongData(void *addr, u32 songNumber, SceSdSqSongData *songData); |
| 84 | +extern int sceSdSqReadSongData(SceSdSqSongData *songData); |
| 85 | +extern int sceSdSqGetMaxCompTableIndex(void *addr, u32 midiNumber); |
| 86 | +extern int sceSdSqGetCompTableOffset(void *addr, u32 midiNumber, u32 *offset); |
| 87 | +extern int sceSdSqGetCompTableDataByIndex(void *addr, u32 midiNumber, u32 compTableIndex, SceSdSqCompTableData *data); |
| 88 | +extern int sceSdSqGetNoteOnEventByPolyKeyPress( |
| 89 | + void *addr, u32 midiNumber, const SceSdSqPolyKeyData *pData, SceSdSqCompTableNoteOnEvent *kData); |
| 90 | +extern int sceSdSqCopyMidiData(SceSdSqMidiData *to, const SceSdSqMidiData *from); |
| 91 | +extern int sceSdSqCopySongData(SceSdSqSongData *to, const SceSdSqSongData *from); |
| 92 | + |
| 93 | +#define sdsq_IMPORTS_start DECLARE_IMPORT_TABLE(sdsq, 1, 1) |
| 94 | +#define sdsq_IMPORTS_end END_IMPORT_TABLE |
| 95 | + |
| 96 | +#define I_sceSdSqGetMaxMidiNumber DECLARE_IMPORT(4, sceSdSqGetMaxMidiNumber) |
| 97 | +#define I_sceSdSqGetMaxSongNumber DECLARE_IMPORT(5, sceSdSqGetMaxSongNumber) |
| 98 | +#define I_sceSdSqInitMidiData DECLARE_IMPORT(6, sceSdSqInitMidiData) |
| 99 | +#define I_sceSdSqReadMidiData DECLARE_IMPORT(7, sceSdSqReadMidiData) |
| 100 | +#define I_sceSdSqInitSongData DECLARE_IMPORT(8, sceSdSqInitSongData) |
| 101 | +#define I_sceSdSqReadSongData DECLARE_IMPORT(9, sceSdSqReadSongData) |
| 102 | +#define I_sceSdSqGetMaxCompTableIndex DECLARE_IMPORT(10, sceSdSqGetMaxCompTableIndex) |
| 103 | +#define I_sceSdSqGetCompTableOffset DECLARE_IMPORT(11, sceSdSqGetCompTableOffset) |
| 104 | +#define I_sceSdSqGetCompTableDataByIndex DECLARE_IMPORT(12, sceSdSqGetCompTableDataByIndex) |
| 105 | +#define I_sceSdSqGetNoteOnEventByPolyKeyPress DECLARE_IMPORT(13, sceSdSqGetNoteOnEventByPolyKeyPress) |
| 106 | +#define I_sceSdSqCopyMidiData DECLARE_IMPORT(14, sceSdSqCopyMidiData) |
| 107 | +#define I_sceSdSqCopySongData DECLARE_IMPORT(15, sceSdSqCopySongData) |
| 108 | + |
| 109 | +#endif |
0 commit comments