mirror of
https://github.com/SMGCommunity/Petari.git
synced 2024-11-23 21:49:45 +00:00
100% JASSeqReader.o
This commit is contained in:
parent
59fd3cb3dd
commit
d9b42c8e51
@ -42,7 +42,7 @@ def main(compile_non_matching, use_ninja, clean_ninja, link):
|
||||
|
||||
isNotWindows = os.name != "nt"
|
||||
|
||||
flags = "-c -nodefaults -nostdlib -proc gekko -align powerpc -enum int -enc SJIS -fp hard -Cpp_exceptions off -rtti off -DEPPC -DGEKKO -O4,p -inline auto "
|
||||
flags = flags = "-c -nodefaults -nostdlib -proc gekko -align powerpc -enum int -enc SJIS -fp hard -Cpp_exceptions off -rtti off -DEPPC -DGEKKO -O4,s -sdata 4 -sdata2 4 -inline auto -ipa file "
|
||||
includes = "-i . -I- -i include "
|
||||
|
||||
msl_path = pathlib.Path("../MSL_C/include")
|
||||
|
@ -189,15 +189,15 @@ __ct__16JASRegisterParamFv,JASRegisterParam.o,JAudio2.a,false
|
||||
init__16JASRegisterParamFv,JASRegisterParam.o,JAudio2.a,false
|
||||
write__16JASRegisterParamFQ216JASRegisterParam5RegIDUl,JASRegisterParam.o,JAudio2.a,false
|
||||
read__16JASRegisterParamFQ216JASRegisterParam5RegID,JASRegisterParam.o,JAudio2.a,false
|
||||
__ct__10JASSeqCtrlFv,JASSeqCtrl.o,JAudio2.a,false
|
||||
init__10JASSeqCtrlFv,JASSeqCtrl.o,JAudio2.a,false
|
||||
start__10JASSeqCtrlFPvUl,JASSeqCtrl.o,JAudio2.a,false
|
||||
tickProc__10JASSeqCtrlFP8JASTrack,JASSeqCtrl.o,JAudio2.a,false
|
||||
interrupt__10JASSeqCtrlFQ210JASSeqCtrl8IntrType,JASSeqCtrl.o,JAudio2.a,false
|
||||
setIntrMask__10JASSeqCtrlFUl,JASSeqCtrl.o,JAudio2.a,false
|
||||
clrIntrMask__10JASSeqCtrlFUl,JASSeqCtrl.o,JAudio2.a,false
|
||||
retIntr__10JASSeqCtrlFv,JASSeqCtrl.o,JAudio2.a,false
|
||||
findIntr__10JASSeqCtrlFv,JASSeqCtrl.o,JAudio2.a,false
|
||||
__ct__10JASSeqCtrlFv,JASSeqCtrl.o,JAudio2.a,true
|
||||
init__10JASSeqCtrlFv,JASSeqCtrl.o,JAudio2.a,true
|
||||
start__10JASSeqCtrlFPvUl,JASSeqCtrl.o,JAudio2.a,true
|
||||
tickProc__10JASSeqCtrlFP8JASTrack,JASSeqCtrl.o,JAudio2.a,true
|
||||
interrupt__10JASSeqCtrlFQ210JASSeqCtrl8IntrType,JASSeqCtrl.o,JAudio2.a,true
|
||||
setIntrMask__10JASSeqCtrlFUl,JASSeqCtrl.o,JAudio2.a,true
|
||||
clrIntrMask__10JASSeqCtrlFUl,JASSeqCtrl.o,JAudio2.a,true
|
||||
retIntr__10JASSeqCtrlFv,JASSeqCtrl.o,JAudio2.a,true
|
||||
findIntr__10JASSeqCtrlFv,JASSeqCtrl.o,JAudio2.a,true
|
||||
checkIntr__10JASSeqCtrlFv,JASSeqCtrl.o,JAudio2.a,false
|
||||
timerProcess__10JASSeqCtrlFv,JASSeqCtrl.o,JAudio2.a,false
|
||||
__sinit_\JASSeqCtrl_cpp,JASSeqCtrl.o,JAudio2.a,false
|
||||
@ -271,14 +271,14 @@ parseCommand__12JASSeqParserFP8JASTrackUcUs,JASSeqParser.o,JAudio2.a,false
|
||||
parseRegCommand__12JASSeqParserFP8JASTracki,JASSeqParser.o,JAudio2.a,false
|
||||
parse__12JASSeqParserFP8JASTrack,JASSeqParser.o,JAudio2.a,false
|
||||
__sinit_\JASSeqParser_cpp,JASSeqParser.o,JAudio2.a,false
|
||||
init__12JASSeqReaderFv,JASSeqReader.o,JAudio2.a,false
|
||||
init__12JASSeqReaderFPv,JASSeqReader.o,JAudio2.a,false
|
||||
call__12JASSeqReaderFUl,JASSeqReader.o,JAudio2.a,false
|
||||
loopStart__12JASSeqReaderFUl,JASSeqReader.o,JAudio2.a,false
|
||||
loopEnd__12JASSeqReaderFv,JASSeqReader.o,JAudio2.a,false
|
||||
ret__12JASSeqReaderFv,JASSeqReader.o,JAudio2.a,false
|
||||
readMidiValue__12JASSeqReaderFv,JASSeqReader.o,JAudio2.a,false
|
||||
getStackPtr__12JASSeqReaderCFUl,JASSeqReader.o,JAudio2.a,false
|
||||
init__12JASSeqReaderFv,JASSeqReader.o,JAudio2.a,true
|
||||
init__12JASSeqReaderFPv,JASSeqReader.o,JAudio2.a,true
|
||||
call__12JASSeqReaderFUl,JASSeqReader.o,JAudio2.a,true
|
||||
loopStart__12JASSeqReaderFUl,JASSeqReader.o,JAudio2.a,true
|
||||
loopEnd__12JASSeqReaderFv,JASSeqReader.o,JAudio2.a,true
|
||||
ret__12JASSeqReaderFv,JASSeqReader.o,JAudio2.a,true
|
||||
readMidiValue__12JASSeqReaderFv,JASSeqReader.o,JAudio2.a,true
|
||||
getStackPtr__12JASSeqReaderCFUl,JASSeqReader.o,JAudio2.a,true
|
||||
initSystem__13JASAramStreamFUlUl,JASAramStream.o,JAudio2.a,false
|
||||
__ct__13JASAramStreamFv,JASAramStream.o,JAudio2.a,false
|
||||
init__13JASAramStreamFUlUlPFUlP13JASAramStreamPv_vPv,JASAramStream.o,JAudio2.a,false
|
||||
|
|
25
libs/JSystem/include/JSystem/JAudio2/JASSeqReader.h
Normal file
25
libs/JSystem/include/JSystem/JAudio2/JASSeqReader.h
Normal file
@ -0,0 +1,25 @@
|
||||
#pragma once
|
||||
|
||||
#include <revolution/types.h>
|
||||
|
||||
struct int24 {
|
||||
unsigned num: 24;
|
||||
};
|
||||
|
||||
class JASSeqReader {
|
||||
public:
|
||||
void init();
|
||||
void init(void *);
|
||||
bool call(u32);
|
||||
bool loopStart(u32);
|
||||
bool loopEnd();
|
||||
bool ret();
|
||||
u32 readMidiValue();
|
||||
void* getStackPtr(u32) const;
|
||||
|
||||
void* _0;
|
||||
void* _4;
|
||||
u32 _8;
|
||||
void* _C[8];
|
||||
u16 _2C[8];
|
||||
};
|
84
libs/JSystem/source/JSystem/JAudio2/JASSeqReader.cpp
Normal file
84
libs/JSystem/source/JSystem/JAudio2/JASSeqReader.cpp
Normal file
@ -0,0 +1,84 @@
|
||||
#include "JSystem/JAudio2/JASSeqReader.h"
|
||||
|
||||
void JASSeqReader::init() {
|
||||
_0 = nullptr;
|
||||
_4 = nullptr;
|
||||
_8 = 0;
|
||||
for(u32 i = 0; i < 8; i++) {
|
||||
_C[i] = 0;
|
||||
_2C[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void JASSeqReader::init(void *buf) {
|
||||
_0 = buf;
|
||||
_4 = buf;
|
||||
_8 = 0;
|
||||
for(u32 i = 0; i < 8; i++) {
|
||||
_C[i] = 0;
|
||||
_2C[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
bool JASSeqReader::call(u32 num) {
|
||||
if(_8 >= 8) return false;
|
||||
else {
|
||||
_C[_8++] = _4;
|
||||
_4 = (char*)_0 + num;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
bool JASSeqReader::loopStart(u32 num) {
|
||||
if(_8 >= 8) return false;
|
||||
else {
|
||||
_C[_8] = _4;
|
||||
_2C[_8++] = num;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
bool JASSeqReader::loopEnd() {
|
||||
if(_8 == 0) return false;
|
||||
else {
|
||||
u16 end = _2C[_8 - 1];
|
||||
if(end > 0) end--;
|
||||
if(end == 0) {
|
||||
_8--;
|
||||
return true;
|
||||
}
|
||||
_2C[_8 - 1] = end;
|
||||
_4 = _C[_8 - 1];
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
bool JASSeqReader::ret() {
|
||||
if(_8 == 0) return false;
|
||||
else {
|
||||
_4 = _C[--_8];
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
u32 JASSeqReader::readMidiValue() {
|
||||
u8 byte = *((u8*)_4)++;
|
||||
if(!(byte & 0x80)) return byte;
|
||||
u32 byte2 = byte & 0x7f;
|
||||
s32 i = 0;
|
||||
u8 byte4;
|
||||
do {
|
||||
if(i > 2) return 0;
|
||||
byte2 = byte2 << 7;
|
||||
byte4 = *((u8*)_4)++;
|
||||
byte2 |= byte4 & 0x7f;
|
||||
if(!(byte4 & 0x80)) break;
|
||||
i++;
|
||||
} while(true);
|
||||
return byte2;
|
||||
}
|
||||
|
||||
void* JASSeqReader::getStackPtr(u32 idx) const {
|
||||
if(idx >= _8) return nullptr;
|
||||
else return _C[idx];
|
||||
}
|
Loading…
Reference in New Issue
Block a user