mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-01 04:45:34 +00:00
Merge branch 'opcode2' into 'master'
Remove 2-arguments opcodes See merge request OpenMW/openmw!187
This commit is contained in:
commit
0329003af7
3 changed files with 0 additions and 71 deletions
|
@ -28,22 +28,6 @@ namespace Interpreter
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
case 1:
|
|
||||||
{
|
|
||||||
int opcode = (code>>24) & 0x3f;
|
|
||||||
unsigned int arg0 = (code>>16) & 0xfff;
|
|
||||||
unsigned int arg1 = code & 0xfff;
|
|
||||||
|
|
||||||
std::map<int, Opcode2 *>::iterator iter = mSegment1.find (opcode);
|
|
||||||
|
|
||||||
if (iter==mSegment1.end())
|
|
||||||
abortUnknownCode (1, opcode);
|
|
||||||
|
|
||||||
iter->second->execute (mRuntime, arg0, arg1);
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
{
|
{
|
||||||
int opcode = (code>>20) & 0x3ff;
|
int opcode = (code>>20) & 0x3ff;
|
||||||
|
@ -79,22 +63,6 @@ namespace Interpreter
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
case 0x31:
|
|
||||||
{
|
|
||||||
int opcode = (code>>16) & 0x3ff;
|
|
||||||
unsigned int arg0 = (code>>8) & 0xff;
|
|
||||||
unsigned int arg1 = code & 0xff;
|
|
||||||
|
|
||||||
std::map<int, Opcode2 *>::iterator iter = mSegment4.find (opcode);
|
|
||||||
|
|
||||||
if (iter==mSegment4.end())
|
|
||||||
abortUnknownCode (4, opcode);
|
|
||||||
|
|
||||||
iter->second->execute (mRuntime, arg0, arg1);
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
case 0x32:
|
case 0x32:
|
||||||
{
|
{
|
||||||
int opcode = code & 0x3ffffff;
|
int opcode = code & 0x3ffffff;
|
||||||
|
@ -161,10 +129,6 @@ namespace Interpreter
|
||||||
iter!=mSegment0.end(); ++iter)
|
iter!=mSegment0.end(); ++iter)
|
||||||
delete iter->second;
|
delete iter->second;
|
||||||
|
|
||||||
for (std::map<int, Opcode2 *>::iterator iter (mSegment1.begin());
|
|
||||||
iter!=mSegment1.end(); ++iter)
|
|
||||||
delete iter->second;
|
|
||||||
|
|
||||||
for (std::map<int, Opcode1 *>::iterator iter (mSegment2.begin());
|
for (std::map<int, Opcode1 *>::iterator iter (mSegment2.begin());
|
||||||
iter!=mSegment2.end(); ++iter)
|
iter!=mSegment2.end(); ++iter)
|
||||||
delete iter->second;
|
delete iter->second;
|
||||||
|
@ -173,10 +137,6 @@ namespace Interpreter
|
||||||
iter!=mSegment3.end(); ++iter)
|
iter!=mSegment3.end(); ++iter)
|
||||||
delete iter->second;
|
delete iter->second;
|
||||||
|
|
||||||
for (std::map<int, Opcode2 *>::iterator iter (mSegment4.begin());
|
|
||||||
iter!=mSegment4.end(); ++iter)
|
|
||||||
delete iter->second;
|
|
||||||
|
|
||||||
for (std::map<int, Opcode0 *>::iterator iter (mSegment5.begin());
|
for (std::map<int, Opcode0 *>::iterator iter (mSegment5.begin());
|
||||||
iter!=mSegment5.end(); ++iter)
|
iter!=mSegment5.end(); ++iter)
|
||||||
delete iter->second;
|
delete iter->second;
|
||||||
|
@ -188,12 +148,6 @@ namespace Interpreter
|
||||||
mSegment0.insert (std::make_pair (code, opcode));
|
mSegment0.insert (std::make_pair (code, opcode));
|
||||||
}
|
}
|
||||||
|
|
||||||
void Interpreter::installSegment1 (int code, Opcode2 *opcode)
|
|
||||||
{
|
|
||||||
assert(mSegment1.find(code) == mSegment1.end());
|
|
||||||
mSegment1.insert (std::make_pair (code, opcode));
|
|
||||||
}
|
|
||||||
|
|
||||||
void Interpreter::installSegment2 (int code, Opcode1 *opcode)
|
void Interpreter::installSegment2 (int code, Opcode1 *opcode)
|
||||||
{
|
{
|
||||||
assert(mSegment2.find(code) == mSegment2.end());
|
assert(mSegment2.find(code) == mSegment2.end());
|
||||||
|
@ -206,12 +160,6 @@ namespace Interpreter
|
||||||
mSegment3.insert (std::make_pair (code, opcode));
|
mSegment3.insert (std::make_pair (code, opcode));
|
||||||
}
|
}
|
||||||
|
|
||||||
void Interpreter::installSegment4 (int code, Opcode2 *opcode)
|
|
||||||
{
|
|
||||||
assert(mSegment4.find(code) == mSegment4.end());
|
|
||||||
mSegment4.insert (std::make_pair (code, opcode));
|
|
||||||
}
|
|
||||||
|
|
||||||
void Interpreter::installSegment5 (int code, Opcode0 *opcode)
|
void Interpreter::installSegment5 (int code, Opcode0 *opcode)
|
||||||
{
|
{
|
||||||
assert(mSegment5.find(code) == mSegment5.end());
|
assert(mSegment5.find(code) == mSegment5.end());
|
||||||
|
|
|
@ -11,7 +11,6 @@ namespace Interpreter
|
||||||
{
|
{
|
||||||
class Opcode0;
|
class Opcode0;
|
||||||
class Opcode1;
|
class Opcode1;
|
||||||
class Opcode2;
|
|
||||||
|
|
||||||
class Interpreter
|
class Interpreter
|
||||||
{
|
{
|
||||||
|
@ -19,10 +18,8 @@ namespace Interpreter
|
||||||
bool mRunning;
|
bool mRunning;
|
||||||
Runtime mRuntime;
|
Runtime mRuntime;
|
||||||
std::map<int, Opcode1 *> mSegment0;
|
std::map<int, Opcode1 *> mSegment0;
|
||||||
std::map<int, Opcode2 *> mSegment1;
|
|
||||||
std::map<int, Opcode1 *> mSegment2;
|
std::map<int, Opcode1 *> mSegment2;
|
||||||
std::map<int, Opcode1 *> mSegment3;
|
std::map<int, Opcode1 *> mSegment3;
|
||||||
std::map<int, Opcode2 *> mSegment4;
|
|
||||||
std::map<int, Opcode0 *> mSegment5;
|
std::map<int, Opcode0 *> mSegment5;
|
||||||
|
|
||||||
// not implemented
|
// not implemented
|
||||||
|
@ -48,18 +45,12 @@ namespace Interpreter
|
||||||
void installSegment0 (int code, Opcode1 *opcode);
|
void installSegment0 (int code, Opcode1 *opcode);
|
||||||
///< ownership of \a opcode is transferred to *this.
|
///< ownership of \a opcode is transferred to *this.
|
||||||
|
|
||||||
void installSegment1 (int code, Opcode2 *opcode);
|
|
||||||
///< ownership of \a opcode is transferred to *this.
|
|
||||||
|
|
||||||
void installSegment2 (int code, Opcode1 *opcode);
|
void installSegment2 (int code, Opcode1 *opcode);
|
||||||
///< ownership of \a opcode is transferred to *this.
|
///< ownership of \a opcode is transferred to *this.
|
||||||
|
|
||||||
void installSegment3 (int code, Opcode1 *opcode);
|
void installSegment3 (int code, Opcode1 *opcode);
|
||||||
///< ownership of \a opcode is transferred to *this.
|
///< ownership of \a opcode is transferred to *this.
|
||||||
|
|
||||||
void installSegment4 (int code, Opcode2 *opcode);
|
|
||||||
///< ownership of \a opcode is transferred to *this.
|
|
||||||
|
|
||||||
void installSegment5 (int code, Opcode0 *opcode);
|
void installSegment5 (int code, Opcode0 *opcode);
|
||||||
///< ownership of \a opcode is transferred to *this.
|
///< ownership of \a opcode is transferred to *this.
|
||||||
|
|
||||||
|
|
|
@ -25,16 +25,6 @@ namespace Interpreter
|
||||||
virtual ~Opcode1() {}
|
virtual ~Opcode1() {}
|
||||||
};
|
};
|
||||||
|
|
||||||
/// opcode for 2 arguments
|
|
||||||
class Opcode2
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
virtual void execute (Runtime& runtime, unsigned int arg1, unsigned int arg2) = 0;
|
|
||||||
|
|
||||||
virtual ~Opcode2() {}
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue