residual/residual — pull request #390 by giucam (2011-10-12 15:54:33+00:00)
Title: GRIM: Incapsulate the lua opcodes in a class hierarchy.

After some tries i finally managed to create a class hierarchy to incapsulate the lua opcodes.
Since Lua wants global or static member functions i created a macro more or less like this:

```c++
#define DECLARE_LUA_OPCODE(func) \
static static_##func() { instance()->func(); }\
virtual void func
```

To be used this way:
```c++
class Lua {
...
DECLARE_LUA_OPCODE(Opcode) { ... } // definition and declaration
DECLARE_LUA_OPCODE(Opcode2); //declaration only.
```

This way the opcodes are now virtual functions and Lua_L2, the one for EMI, can easily reimplement any opcode. Lua_L2 doesn't need to register all the opcodes common to Grim anymore, by using a virtual registerOpcodes() function.

I want also to move the lua handlers in grim.cpp into lua.cpp, once this is in.

Thoughts?