diff --git a/configure.py b/configure.py index 41d6373d0..285e9ed5e 100644 --- a/configure.py +++ b/configure.py @@ -665,7 +665,7 @@ config.libs = [ Object(NonMatching, "JSystem/JAudio/JASNoteMgr.cpp"), Object(NonMatching, "JSystem/JAudio/JASOuterParam.cpp"), Object(NonMatching, "JSystem/JAudio/JASPlayer_impl.cpp"), - Object(NonMatching, "JSystem/JAudio/JASRegisterParam.cpp"), + Object(Matching, "JSystem/JAudio/JASRegisterParam.cpp"), Object(NonMatching, "JSystem/JAudio/JASSeqCtrl.cpp"), Object(NonMatching, "JSystem/JAudio/JASSeqParser.cpp"), Object(NonMatching, "JSystem/JAudio/JASTrack.cpp"), diff --git a/include/JSystem/JAudio/JASRegisterParam.h b/include/JSystem/JAudio/JASRegisterParam.h new file mode 100644 index 000000000..5f3b6378d --- /dev/null +++ b/include/JSystem/JAudio/JASRegisterParam.h @@ -0,0 +1,33 @@ +#ifndef JASREGISTERPARAM_H +#define JASREGISTERPARAM_H + +#include "dolphin/types.h" + +namespace JASystem { + class TRegisterParam { + public: + TRegisterParam(); + void init(); + void inherit(const TRegisterParam&); + u8 getBankNumber() const; + u8 getProgramNumber() const; + + /* 0x00 */ short field_0x0; + /* 0x02 */ short field_0x2; + /* 0x04 */ short field_0x4; + /* 0x06 */ short field_0x6; + /* 0x08 */ short field_0x8; + /* 0x0A */ short field_0xa; + /* 0x0C */ u16 field_0xc; + /* 0x0E */ u16 field_0xe; + /* 0x10 */ u16 field_0x10[5]; + /* 0x1A */ u16 field_0x1a; + /* 0x1C */ int field_0x1c; + /* 0x20 */ int field_0x20; + /* 0x24 */ int field_0x24; + /* 0x28 */ int field_0x28; + /* 0x2C */ int field_0x2c; + }; +} + +#endif /* JASREGISTERPARAM_H */ diff --git a/src/JSystem/JAudio/JASRegisterParam.cpp b/src/JSystem/JAudio/JASRegisterParam.cpp index 3523d59a1..7bff29b3a 100644 --- a/src/JSystem/JAudio/JASRegisterParam.cpp +++ b/src/JSystem/JAudio/JASRegisterParam.cpp @@ -3,31 +3,79 @@ // Translation Unit: JASRegisterParam.cpp // -#include "JASRegisterParam.h" +#include "JSystem/JAudio/JASRegisterParam.h" #include "dolphin/types.h" /* 8027E2C0-8027E310 .text __ct__Q28JASystem14TRegisterParamFv */ JASystem::TRegisterParam::TRegisterParam() { - /* Nonmatching */ + field_0x0 = 0; + field_0x2 = 0; + field_0x4 = 0; + field_0x6 = 0; + field_0x8 = 0; + field_0xa = 0; + field_0xc = 0; + field_0xe = 0; + field_0x1a = 0; + field_0x10[0] = 0; + field_0x10[1] = 0; + field_0x10[2] = 0; + field_0x10[3] = 0; + field_0x10[4] = 0; + field_0x20 = 0; + field_0x24 = 0; + field_0x28 = 0; + field_0x2c = 0; } /* 8027E310-8027E378 .text init__Q28JASystem14TRegisterParamFv */ void JASystem::TRegisterParam::init() { - /* Nonmatching */ + field_0x0 = 0; + field_0x2 = 0; + field_0x4 = 0; + field_0x6 = 0; + field_0x8 = 0; + field_0xa = 0; + field_0xc = 0xf0; + field_0xe = 0x0c; + field_0x1a = 0x40; + field_0x10[0] = 0; + field_0x10[1] = 1; + field_0x10[2] = 1; + field_0x10[3] = 0x7fff; + field_0x10[4] = 0x4000; + field_0x20 = 0; + field_0x24 = 0; + field_0x28 = 0; + field_0x2c = 0; } /* 8027E378-8027E3E0 .text inherit__Q28JASystem14TRegisterParamFRCQ28JASystem14TRegisterParam */ -void JASystem::TRegisterParam::inherit(const JASystem::TRegisterParam&) { - /* Nonmatching */ +void JASystem::TRegisterParam::inherit(const JASystem::TRegisterParam& param_1) { + field_0x0 = 0; + field_0x2 = 0; + field_0x4 = 0; + field_0x6 = 0; + field_0x8 = 0; + field_0xa = 0; + field_0xc = param_1.field_0xc; + field_0xe = param_1.field_0xe; + field_0x1a = param_1.field_0x1a; + for (int i = 0; i < 5; i++) { + field_0x10[i] = param_1.field_0x10[i]; + } + field_0x20 = 0; + field_0x24 = 0; + field_0x28 = 0; + field_0x2c = 0; } /* 8027E3E0-8027E3EC .text getBankNumber__Q28JASystem14TRegisterParamCFv */ -void JASystem::TRegisterParam::getBankNumber() const { - /* Nonmatching */ +u8 JASystem::TRegisterParam::getBankNumber() const { + return field_0xc >> 8 & 0xff; } /* 8027E3EC-8027E3F8 .text getProgramNumber__Q28JASystem14TRegisterParamCFv */ -void JASystem::TRegisterParam::getProgramNumber() const { - /* Nonmatching */ +u8 JASystem::TRegisterParam::getProgramNumber() const { + return field_0xc & 0xff; } -