forked from mirror/openmw-tes3mp
added xbox function
This commit is contained in:
parent
34b824cb70
commit
3df5d377f2
6 changed files with 84 additions and 13 deletions
|
@ -39,6 +39,7 @@ set(GAMESCRIPT
|
||||||
apps/openmw/mwscript/compilercontext.cpp
|
apps/openmw/mwscript/compilercontext.cpp
|
||||||
apps/openmw/mwscript/interpretercontext.cpp
|
apps/openmw/mwscript/interpretercontext.cpp
|
||||||
apps/openmw/mwscript/cellextensions.cpp
|
apps/openmw/mwscript/cellextensions.cpp
|
||||||
|
apps/openmw/mwscript/miscextensions.cpp
|
||||||
apps/openmw/mwscript/extensions.cpp
|
apps/openmw/mwscript/extensions.cpp
|
||||||
apps/openmw/mwscript/globalscripts.cpp
|
apps/openmw/mwscript/globalscripts.cpp
|
||||||
)
|
)
|
||||||
|
@ -48,6 +49,7 @@ set(GAMESCRIPT_HEADER
|
||||||
apps/openmw/mwscript/compilercontext.hpp
|
apps/openmw/mwscript/compilercontext.hpp
|
||||||
apps/openmw/mwscript/interpretercontext.hpp
|
apps/openmw/mwscript/interpretercontext.hpp
|
||||||
apps/openmw/mwscript/cellextensions.hpp
|
apps/openmw/mwscript/cellextensions.hpp
|
||||||
|
apps/openmw/mwscript/miscextensions.hpp
|
||||||
apps/openmw/mwscript/extensions.hpp
|
apps/openmw/mwscript/extensions.hpp
|
||||||
apps/openmw/mwscript/globalscripts.hpp
|
apps/openmw/mwscript/globalscripts.hpp
|
||||||
)
|
)
|
||||||
|
|
|
@ -21,17 +21,18 @@ Segment 4:
|
||||||
opcodes 0x200-0x3ff unused
|
opcodes 0x200-0x3ff unused
|
||||||
|
|
||||||
Segment 5:
|
Segment 5:
|
||||||
op 2000000: CellChanged
|
op 0x2000000: CellChanged
|
||||||
op 2000001: Say
|
op 0x2000001: Say
|
||||||
op 2000002: SayDone
|
op 0x2000002: SayDone
|
||||||
op 2000003: StreamMusic
|
op 0x2000003: StreamMusic
|
||||||
op 2000004: PlaySound
|
op 0x2000004: PlaySound
|
||||||
op 2000005: PlaySoundVP
|
op 0x2000005: PlaySoundVP
|
||||||
op 2000006: PlaySound3D
|
op 0x2000006: PlaySound3D
|
||||||
op 2000007: PlaySound3DVP
|
op 0x2000007: PlaySound3DVP
|
||||||
op 2000008: PlayLoopSound3D
|
op 0x2000008: PlayLoopSound3D
|
||||||
op 2000009: PlayLoopSound3DVP
|
op 0x2000009: PlayLoopSound3DVP
|
||||||
op 200000a: StopSound
|
op 0x200000a: StopSound
|
||||||
op 200000b: GetSoundPlaying
|
op 0x200000b: GetSoundPlaying
|
||||||
opcodes 0x200000c-0x3ffffff unused
|
op 0x200000c: XBox (always 0)
|
||||||
|
opcodes 0x200000d-0x3ffffff unused
|
||||||
|
|
||||||
|
|
|
@ -4,12 +4,14 @@
|
||||||
#include "../mwsound/extensions.hpp"
|
#include "../mwsound/extensions.hpp"
|
||||||
|
|
||||||
#include "cellextensions.hpp"
|
#include "cellextensions.hpp"
|
||||||
|
#include "miscextensions.hpp"
|
||||||
|
|
||||||
namespace MWScript
|
namespace MWScript
|
||||||
{
|
{
|
||||||
void registerExtensions (Compiler::Extensions& extensions)
|
void registerExtensions (Compiler::Extensions& extensions)
|
||||||
{
|
{
|
||||||
Cell::registerExtensions (extensions);
|
Cell::registerExtensions (extensions);
|
||||||
|
Misc::registerExtensions (extensions);
|
||||||
MWSound::registerExtensions (extensions);
|
MWSound::registerExtensions (extensions);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
38
apps/openmw/mwscript/miscextensions.cpp
Normal file
38
apps/openmw/mwscript/miscextensions.cpp
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
|
||||||
|
#include "miscextensions.hpp"
|
||||||
|
|
||||||
|
#include <components/compiler/extensions.hpp>
|
||||||
|
|
||||||
|
#include <components/interpreter/interpreter.hpp>
|
||||||
|
#include <components/interpreter/runtime.hpp>
|
||||||
|
#include <components/interpreter/opcodes.hpp>
|
||||||
|
|
||||||
|
namespace MWScript
|
||||||
|
{
|
||||||
|
namespace Misc
|
||||||
|
{
|
||||||
|
class OpXBox : public Interpreter::Opcode0
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
virtual void execute (Interpreter::Runtime& runtime)
|
||||||
|
{
|
||||||
|
runtime.push (0);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const int opcodeXBox = 0x200000c;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void registerExtensions (Compiler::Extensions& extensions)
|
||||||
|
{
|
||||||
|
extensions.registerFunction ("xbox", 'l', "", opcodeXBox);
|
||||||
|
}
|
||||||
|
|
||||||
|
void installOpcodes (Interpreter::Interpreter& interpreter)
|
||||||
|
{
|
||||||
|
interpreter.installSegment5 (opcodeXBox, new OpXBox);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
26
apps/openmw/mwscript/miscextensions.hpp
Normal file
26
apps/openmw/mwscript/miscextensions.hpp
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
#ifndef GAME_SCRIPT_MISCEXTENSIONS_H
|
||||||
|
#define GAME_SCRIPT_MISCEXTENSIONS_H
|
||||||
|
|
||||||
|
namespace Compiler
|
||||||
|
{
|
||||||
|
class Extensions;
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace Interpreter
|
||||||
|
{
|
||||||
|
class Interpreter;
|
||||||
|
}
|
||||||
|
|
||||||
|
namespace MWScript
|
||||||
|
{
|
||||||
|
namespace Misc
|
||||||
|
{
|
||||||
|
void registerExtensions (Compiler::Extensions& extensions);
|
||||||
|
|
||||||
|
void installOpcodes (Interpreter::Interpreter& interpreter);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
#include "../mwsound/extensions.hpp"
|
#include "../mwsound/extensions.hpp"
|
||||||
|
|
||||||
#include "cellextensions.hpp"
|
#include "cellextensions.hpp"
|
||||||
|
#include "miscextensions.hpp"
|
||||||
|
|
||||||
namespace MWScript
|
namespace MWScript
|
||||||
{
|
{
|
||||||
|
@ -121,6 +122,7 @@ namespace MWScript
|
||||||
{
|
{
|
||||||
Interpreter::installOpcodes (interpreter);
|
Interpreter::installOpcodes (interpreter);
|
||||||
Cell::installOpcodes (interpreter);
|
Cell::installOpcodes (interpreter);
|
||||||
|
Misc::installOpcodes (interpreter);
|
||||||
MWSound::installOpcodes (interpreter);
|
MWSound::installOpcodes (interpreter);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue