ACTIONSCRIPT: Initial ActionScript byte code interpreter #294
Conversation
844f6bb
to
f565d3d
Neat! There's some issues I'd like you to address first, though. See below. Also, AppVeyor fails for this PR. I think you forgot to include somewhere. |
|
||
} // End of namespace ActionScript | ||
|
||
} // End of namespace Aurora |
DrMcCoy
Jun 11, 2018
Member
Missing end-of-line at the end of the file
Missing end-of-line at the end of the file
size_t startPos = _script->pos(); | ||
|
||
switch (opcode) { | ||
case kActionStop: actionStop(avm);break; |
DrMcCoy
Jun 11, 2018
Member
Please use spaces for alignment. As you can see, when you mix spaces and tabs for alignment, it suddenly doesn't align.
(Of course, the indentation at the start of the line should still be tabs)
Please use spaces for alignment. As you can see, when you mix spaces and tabs for alignment, it suddenly doesn't align.
(Of course, the indentation at the start of the line should still be tabs)
void ASBuffer::execute(AVM &avm) { | ||
byte opcode; | ||
if (_printAssembly) | ||
info("-----"); |
DrMcCoy
Jun 11, 2018
Member
That should rather be a debug channel.
See, for example, how src/aurora/nwscript/ncsfile.cpp
handles it with debugC()
. You should add a relevant debug channel into the Common::DebugManager
.
(Possible, the "kDebugScripts" channel should be renamed to say that it's about NWScript. Lua (and now ActionScript) should be their own debug channels)
That should rather be a debug channel.
See, for example, how src/aurora/nwscript/ncsfile.cpp
handles it with debugC()
. You should add a relevant debug channel into the Common::DebugManager
.
(Possible, the "kDebugScripts" channel should be renamed to say that it's about NWScript. Lua (and now ActionScript) should be their own debug channels)
#include "src/aurora/actionscript/variable.h" | ||
#include "src/aurora/actionscript/object.h" | ||
#include "variable.h" | ||
#include "function.h" |
DrMcCoy
Jun 11, 2018
Member
These two need a full path
These two need a full path
#include <vector> | ||
|
||
#include "src/aurora/actionscript/variable.h" | ||
#include "asbuffer.h" |
DrMcCoy
Jun 11, 2018
Member
Full paths, please
Full paths, please
* @param value | ||
* The parameters of the fscommand | ||
*/ | ||
void fscommand(const Common::UString &name, const Common::UString &value); |
DrMcCoy
Jun 11, 2018
Member
Should be fsCommand
, then, I guess?
Should be fsCommand
, then, I guess?
Nostritius
Jun 11, 2018
Author
Contributor
yes and no, since the fscommand is written this way in the actionscript code, i wanted to make an exception here, to match it with the actionscript specification. But if you want i will change this.
yes and no, since the fscommand is written this way in the actionscript code, i wanted to make an exception here, to match it with the actionscript specification. But if you want i will change this.
DrMcCoy
Jun 11, 2018
•
Member
Yes, please change it, thanks
Yes, please change it, thanks
|
||
#include <boost/none_t.hpp> | ||
#include <src/common/bitstream.h> | ||
#include <src/common/memreadstream.h> |
DrMcCoy
Jun 11, 2018
Member
Please include our own includes with #include ""
, not #include <>
Please include our own includes with #include ""
, not #include <>
f565d3d
to
65c5eda
65c5eda
to
31dc0ba
The issues should now be fixed and appveyor works again. |
|
||
class ASBuffer { | ||
public: | ||
ASBuffer(Common::SeekableReadStream *as, bool printAssembly = false); |
DrMcCoy
Jun 11, 2018
Member
The parameter printAssembly
can go now
The parameter printAssembly
can go now
|
||
void ASBuffer::execute(AVM &avm) { | ||
byte opcode; | ||
debugC(kDebugEngineActionScript, 2, "--- Start Actionscript ---"); |
DrMcCoy
Jun 11, 2018
Member
Start is debug level 2, end is debug level 1? Is that correct?
Start is debug level 2, end is debug level 1? Is that correct?
kDebugEngineLogic , ///< "ELogic", engine game logic. | ||
|
||
kDebugEngineScripts , ///< "EScripts", engine nwscripts | ||
kDebugEngineActionScript, ///< "EActionScript", engine actionscript |
DrMcCoy
Jun 11, 2018
Member
kDebugEngineActionScript is the wrong debug channel for the action script there.
If you look into NWScript, it uses kDebugScripts for the general script disassembly, things that are the same for every engine. kDebugEngineScripts is for things that the engine modifies or does, like engine functions.
I.e. you should rather use kDebugActionScript for most (all?) of the debug stuff in the ActionScript interpreter there.
kDebugEngineActionScript is the wrong debug channel for the action script there.
If you look into NWScript, it uses kDebugScripts for the general script disassembly, things that are the same for every engine. kDebugEngineScripts is for things that the engine modifies or does, like engine functions.
I.e. you should rather use kDebugActionScript for most (all?) of the debug stuff in the ActionScript interpreter there.
31dc0ba
to
ad3511b
The issues should now be fixed |
|
||
namespace ActionScript { | ||
|
||
const static byte kActionNextFrame = 0x04; |
DrMcCoy
Jun 12, 2018
Member
These should probably rather be an enum.
These should probably rather be an enum.
size_t startPos = _script->pos(); | ||
|
||
switch (opcode) { | ||
case kActionStop: actionStop(avm);break; |
DrMcCoy
Jun 12, 2018
Member
Could you add a space before the "break;"? And also an extra one after the ":", so that "kActionDefineFunction2:" isn't squished against the actionDefineFunction2() without any space.
Could you add a space before the "break;"? And also an extra one after the ":", so that "kActionDefineFunction2:" isn't squished against the actionDefineFunction2() without any space.
ad3511b
to
d0aacf6
The issues should now be fixed |
Merged as 3efa87d...bb83638, thanks! :) |
This is an initial attempt for an actionscript interpreter, usable for the dragonage and dragonage2 scaleform ui. It is not feature complete, to interpret all actionscript used in both dragon age games, mainly because scaleform utilizes a subset of the flash Api which needs to be implemented as additional PRs. This should be considered a Proof of Concept demo.