]> git.localhorst.tv Git - l2e.git/blobdiff - src/common/Script.h
removed stupid file headers that eclipse put in
[l2e.git] / src / common / Script.h
index 93bc53105dd3a4de050e802f66d23a6bb8a4971c..2459edc54f1d54971036196edbf550ab0aaf5fa8 100644 (file)
@@ -1,13 +1,8 @@
-/*
- * Script.h
- *
- *  Created on: Oct 13, 2012
- *      Author: holy
- */
-
 #ifndef COMMON_SCRIPT_H_
 #define COMMON_SCRIPT_H_
 
+#include <SDL.h>
+
 namespace common {
 
 class Script {
@@ -16,27 +11,40 @@ public:
        Script();
        ~Script();
 
-       enum Code {
-               CODE_MOVE_A0,
-               CODE_MOVE_A1,
-               CODE_MOVE_I0,
-               CODE_MOVE_I1,
-               CODE_MOVE_V0,
-               CODE_MOVE_V1,
-
-               CODE_ADD_I0,
-               CODE_ADD_I1,
-               CODE_ADD_V0,
-               CODE_ADD_V1,
+       enum Command {
+               COMMAND_NOOP,
+               COMMAND_MOVE,
+               COMMAND_ADD,
+               COMMAND_MOD,
+               COMMAND_RAND,
+               COMMAND_CMP,
+               COMMAND_JMP,
+               COMMAND_JEQ,
+               COMMAND_JNE,
+               COMMAND_JL,
+               COMMAND_JLE,
+               COMMAND_JG,
+               COMMAND_JGE,
+               COMMAND_SYSC,
+       };
 
-               CODE_RAND_I0,
-               CODE_RAND_I1,
+       enum Type {
+               TYPE_NONE,
+               TYPE_ADDRESS,
+               TYPE_INTEGER,
+               TYPE_VECTOR,
+       };
 
-               CODE_SYSCALL,
+       struct Code {
+               Command command : 6;
+               unsigned int numParams : 2;
+               Type type : 2;
+               unsigned int reg1 : 3;
+               unsigned int reg2 : 3;
        };
 
 public:
-       const unsigned char *text;
+       const char *text;
        int textlen;
 
 };