diff options
| author | Pieter-Jan Briers <pieterjan.briers+git@gmail.com> | 2026-06-20 02:44:05 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-06-19 17:44:05 -0700 |
| commit | 853a6addb4dba2cf7f5f336339e933011536c40e (patch) | |
| tree | 49c05ec2a8ffad23361e3ccfb90e5d0b068330b7 /libs/JSystem/src/JAudio2/JASSeqReader.cpp | |
| parent | 3f24f432fee178f226cf47ff7f49510cd5336e26 (diff) | |
JAudio naming pass (#3139)
* struct JASWaveArc forward declare fix
* JASAramStream::THeader improvement
* sizeof/offsetof unhardcodings
* JAudio field name/comment pass
HUGE thanks to XAYRGA for their work documenting JAudio file formats
* Some more names
* More names
* More minor names
* Attempt to fix regressions
Diffstat (limited to 'libs/JSystem/src/JAudio2/JASSeqReader.cpp')
| -rw-r--r-- | libs/JSystem/src/JAudio2/JASSeqReader.cpp | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/libs/JSystem/src/JAudio2/JASSeqReader.cpp b/libs/JSystem/src/JAudio2/JASSeqReader.cpp index c259c57d40..459c2edeee 100644 --- a/libs/JSystem/src/JAudio2/JASSeqReader.cpp +++ b/libs/JSystem/src/JAudio2/JASSeqReader.cpp @@ -8,81 +8,81 @@ #include "JSystem/JAudio2/JASSeqReader.h" void JASSeqReader::init() { - field_0x00 = 0; - field_0x04 = 0; - field_0x08 = 0; + mBase = 0; + mCurPos = 0; + mCurStackDepth = 0; - for (int i = 0; i < 8; i++) { - field_0x0c[i] = NULL; - field_0x2c[i] = 0; + for (int i = 0; i < JAS_SEQ_STACK_SIZE; i++) { + mReturnAddr[i] = NULL; + mLoopCount[i] = 0; } } -void JASSeqReader::init(void* param_0) { - field_0x00 = (u8*)param_0; - field_0x04 = field_0x00; - field_0x08 = 0; +void JASSeqReader::init(void* base) { + mBase = (u8*)base; + mCurPos = mBase; + mCurStackDepth = 0; - for (int i = 0; i < 8; i++) { - field_0x0c[i] = NULL; - field_0x2c[i] = 0; + for (int i = 0; i < JAS_SEQ_STACK_SIZE; i++) { + mReturnAddr[i] = NULL; + mLoopCount[i] = 0; } } bool JASSeqReader::call(u32 param_0) { - if (field_0x08 >= 8) { + if (mCurStackDepth >= JAS_SEQ_STACK_SIZE) { JUT_WARN(42, "%s", "Cannot exec call command"); return false; } - field_0x0c[field_0x08++] = (u16*)field_0x04; - field_0x04 = field_0x00 + param_0; + mReturnAddr[mCurStackDepth++] = (u16*)mCurPos; + mCurPos = mBase + param_0; return true; } bool JASSeqReader::loopStart(u32 param_0) { - if (8 <= field_0x08) { + if (JAS_SEQ_STACK_SIZE <= mCurStackDepth) { JUT_WARN(53, "%s", "Cannot exec loopStart command"); return false; } - field_0x0c[field_0x08] = (u16*)field_0x04; - field_0x2c[field_0x08++] = param_0; + mReturnAddr[mCurStackDepth] = (u16*)mCurPos; + mLoopCount[mCurStackDepth++] = param_0; return true; } bool JASSeqReader::loopEnd() { - if (field_0x08 == 0) { + if (mCurStackDepth == 0) { JUT_WARN(65, "%s", "cannot loopE for call-stack is NULL"); return false; } - u16 tmp = field_0x2c[field_0x08 - 1]; + u16 tmp = mLoopCount[mCurStackDepth - 1]; if (tmp != 0) { tmp--; } if (!tmp) { - field_0x08--; + mCurStackDepth--; return true; } - field_0x2c[field_0x08 - 1] = tmp; - field_0x04 = (u8*)field_0x0c[field_0x08 - 1]; + mLoopCount[mCurStackDepth - 1] = tmp; + mCurPos = (u8*)mReturnAddr[mCurStackDepth - 1]; return true; } bool JASSeqReader::ret() { - if (field_0x08 == 0) { + if (mCurStackDepth == 0) { return false; } - field_0x04 = (u8*)field_0x0c[--field_0x08]; + mCurPos = (u8*)mReturnAddr[--mCurStackDepth]; return true; } |
