Skip to content

Commit

Permalink
Handlers added VCall Left only
Browse files Browse the repository at this point in the history
  • Loading branch information
TobitoFatitoRE committed Aug 3, 2019
1 parent 46b53e2 commit 68d720d
Show file tree
Hide file tree
Showing 25 changed files with 519 additions and 3 deletions.
8 changes: 7 additions & 1 deletion Rhydon.CLI/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,13 @@ static void Main() {
KoiHeader.Parse(ctx);
OpCodeMap.Parse(ctx);

var emu = new KoiEmulator(ctx, ctx.Header.Methods[4]);
var emu = new KoiEmulator(ctx, ctx.Header.Methods[3]);
emu.EmulateNext();
emu.EmulateNext();
emu.EmulateNext();
emu.EmulateNext();
emu.EmulateNext();
emu.EmulateNext();
emu.EmulateNext();

ctx.Logger.Warning("Warning");
Expand Down
31 changes: 31 additions & 0 deletions Rhydon.Emulator/Handlers/Add.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
using Rhydon.Core;
namespace Rhydon.Emulator.Handlers
{
class AddDWord : IKoiHandler {
public KoiOpCodes Handles => KoiOpCodes.OP_ADD_DWORD;
public void Emulate(EmuContext ctx) {
//throw new System.NotImplementedException();
}
}
class AddQWord : IKoiHandler
{
public KoiOpCodes Handles => KoiOpCodes.OP_ADD_QWORD;
public void Emulate(EmuContext ctx) {
//throw new System.NotImplementedException();
}
}
class AddR32 : IKoiHandler
{
public KoiOpCodes Handles => KoiOpCodes.OP_ADD_R32;
public void Emulate(EmuContext ctx) {
//throw new System.NotImplementedException();
}
}
class AddR64 : IKoiHandler
{
public KoiOpCodes Handles => KoiOpCodes.OP_ADD_R64;
public void Emulate(EmuContext ctx) {
//throw new System.NotImplementedException();
}
}
}
11 changes: 11 additions & 0 deletions Rhydon.Emulator/Handlers/Call.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using Rhydon.Core;

namespace Rhydon.Emulator.Handlers
{
class Call : IKoiHandler {
public KoiOpCodes Handles => KoiOpCodes.OP_CALL;
public void Emulate(EmuContext ctx) {
//throw new System.NotImplementedException();
}
}
}
34 changes: 34 additions & 0 deletions Rhydon.Emulator/Handlers/Cmp.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
using Rhydon.Core;
namespace Rhydon.Emulator.Handlers
{
class Cmp : IKoiHandler {
public KoiOpCodes Handles => KoiOpCodes.OP_CMP;
public void Emulate(EmuContext ctx) {
//throw new System.NotImplementedException();
}
}
class CmpDWord : IKoiHandler {
public KoiOpCodes Handles => KoiOpCodes.OP_CMP_DWORD;
public void Emulate(EmuContext ctx) {
//throw new System.NotImplementedException();
}
}
class CmpQWord : IKoiHandler {
public KoiOpCodes Handles => KoiOpCodes.OP_CMP_QWORD;
public void Emulate(EmuContext ctx) {
//throw new System.NotImplementedException();
}
}
class CmpR32 : IKoiHandler {
public KoiOpCodes Handles => KoiOpCodes.OP_CMP_R32;
public void Emulate(EmuContext ctx) {
//throw new System.NotImplementedException();
}
}
class CmpR64 : IKoiHandler {
public KoiOpCodes Handles => KoiOpCodes.OP_CMP_R64;
public void Emulate(EmuContext ctx) {
//throw new System.NotImplementedException();
}
}
}
29 changes: 29 additions & 0 deletions Rhydon.Emulator/Handlers/Div.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
using Rhydon.Core;

namespace Rhydon.Emulator.Handlers
{
class DivDWord : IKoiHandler {
public KoiOpCodes Handles => KoiOpCodes.OP_DIV_DWORD;
public void Emulate(EmuContext ctx) {
//throw new System.NotImplementedException();
}
}
class DivQWord : IKoiHandler {
public KoiOpCodes Handles => KoiOpCodes.OP_DIV_QWORD;
public void Emulate(EmuContext ctx) {
//throw new System.NotImplementedException();
}
}
class DivR32 : IKoiHandler {
public KoiOpCodes Handles => KoiOpCodes.OP_DIV_R32;
public void Emulate(EmuContext ctx) {
//throw new System.NotImplementedException();
}
}
class DivR64 : IKoiHandler {
public KoiOpCodes Handles => KoiOpCodes.OP_DIV_R64;
public void Emulate(EmuContext ctx) {
//throw new System.NotImplementedException();
}
}
}
28 changes: 28 additions & 0 deletions Rhydon.Emulator/Handlers/FConv.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using Rhydon.Core;
namespace Rhydon.Emulator.Handlers
{
class FConvR32 : IKoiHandler {
public KoiOpCodes Handles => KoiOpCodes.OP_FCONV_R32;
public void Emulate(EmuContext ctx) {
//throw new System.NotImplementedException();
}
}
class FConvR32R64 : IKoiHandler {
public KoiOpCodes Handles => KoiOpCodes.OP_FCONV_R32_R64;
public void Emulate(EmuContext ctx) {
//throw new System.NotImplementedException();
}
}
class FConvR64 : IKoiHandler {
public KoiOpCodes Handles => KoiOpCodes.OP_FCONV_R64;
public void Emulate(EmuContext ctx) {
//throw new System.NotImplementedException();
}
}
class FConvR64R32 : IKoiHandler {
public KoiOpCodes Handles => KoiOpCodes.OP_FCONV_R64_R32;
public void Emulate(EmuContext ctx) {
//throw new System.NotImplementedException();
}
}
}
16 changes: 16 additions & 0 deletions Rhydon.Emulator/Handlers/IConv.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using Rhydon.Core;
namespace Rhydon.Emulator.Handlers
{
class IConvPtr : IKoiHandler {
public KoiOpCodes Handles => KoiOpCodes.OP_ICONV_PTR;
public void Emulate(EmuContext ctx) {
//throw new System.NotImplementedException();
}
}
class IConvR64 : IKoiHandler {
public KoiOpCodes Handles => KoiOpCodes.OP_ICONV_R64;
public void Emulate(EmuContext ctx) {
//throw new System.NotImplementedException();
}
}
}
28 changes: 28 additions & 0 deletions Rhydon.Emulator/Handlers/Jmp.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using Rhydon.Core;
namespace Rhydon.Emulator.Handlers
{
class Jmp : IKoiHandler {
public KoiOpCodes Handles => KoiOpCodes.OP_JMP;
public void Emulate(EmuContext ctx) {
//throw new System.NotImplementedException();
}
}
class Jnz : IKoiHandler {
public KoiOpCodes Handles => KoiOpCodes.OP_JNZ;
public void Emulate(EmuContext ctx) {
//throw new System.NotImplementedException();
}
}
class Jz : IKoiHandler {
public KoiOpCodes Handles => KoiOpCodes.OP_JZ;
public void Emulate(EmuContext ctx) {
//throw new System.NotImplementedException();
}
}
class Swt : IKoiHandler {
public KoiOpCodes Handles => KoiOpCodes.OP_SWT;
public void Emulate(EmuContext ctx) {
//throw new System.NotImplementedException();
}
}
}
10 changes: 10 additions & 0 deletions Rhydon.Emulator/Handlers/Leave.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using Rhydon.Core;
namespace Rhydon.Emulator.Handlers
{
class Leave : IKoiHandler {
public KoiOpCodes Handles => KoiOpCodes.OP_LEAVE;
public void Emulate(EmuContext ctx) {
//throw new System.NotImplementedException();
}
}
}
40 changes: 40 additions & 0 deletions Rhydon.Emulator/Handlers/Lind.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
using Rhydon.Core;
namespace Rhydon.Emulator.Handlers
{
class LindByte : IKoiHandler {
public KoiOpCodes Handles => KoiOpCodes.OP_LIND_BYTE;
public void Emulate(EmuContext ctx) {
//throw new System.NotImplementedException();
}
}
class LindDword : IKoiHandler {
public KoiOpCodes Handles => KoiOpCodes.OP_LIND_DWORD;
public void Emulate(EmuContext ctx) {
//throw new System.NotImplementedException();
}
}
class LindObject : IKoiHandler {
public KoiOpCodes Handles => KoiOpCodes.OP_LIND_OBJECT;
public void Emulate(EmuContext ctx) {
//throw new System.NotImplementedException();
}
}
class LindPtr : IKoiHandler {
public KoiOpCodes Handles => KoiOpCodes.OP_LIND_PTR;
public void Emulate(EmuContext ctx) {
//throw new System.NotImplementedException();
}
}
class LindQword : IKoiHandler {
public KoiOpCodes Handles => KoiOpCodes.OP_LIND_QWORD;
public void Emulate(EmuContext ctx) {
//throw new System.NotImplementedException();
}
}
class LindWord : IKoiHandler {
public KoiOpCodes Handles => KoiOpCodes.OP_LIND_WORD;
public void Emulate(EmuContext ctx) {
//throw new System.NotImplementedException();
}
}
}
28 changes: 28 additions & 0 deletions Rhydon.Emulator/Handlers/Mul.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using Rhydon.Core;
namespace Rhydon.Emulator.Handlers
{
class MulDword : IKoiHandler {
public KoiOpCodes Handles => KoiOpCodes.OP_MUL_DWORD;
public void Emulate(EmuContext ctx) {
//throw new System.NotImplementedException();
}
}
class MulQWord : IKoiHandler {
public KoiOpCodes Handles => KoiOpCodes.OP_MUL_QWORD;
public void Emulate(EmuContext ctx) {
//throw new System.NotImplementedException();
}
}
class MulR32 : IKoiHandler {
public KoiOpCodes Handles => KoiOpCodes.OP_MUL_R32;
public void Emulate(EmuContext ctx) {
//throw new System.NotImplementedException();
}
}
class MulR64 : IKoiHandler {
public KoiOpCodes Handles => KoiOpCodes.OP_MUL_R64;
public void Emulate(EmuContext ctx) {
//throw new System.NotImplementedException();
}
}
}
10 changes: 10 additions & 0 deletions Rhydon.Emulator/Handlers/Nop.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using Rhydon.Core;
namespace Rhydon.Emulator.Handlers
{
class Nop : IKoiHandler {
public KoiOpCodes Handles => KoiOpCodes.OP_NOP;
public void Emulate(EmuContext ctx) {
//throw new System.NotImplementedException();
}
}
}
16 changes: 16 additions & 0 deletions Rhydon.Emulator/Handlers/Nor.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using Rhydon.Core;
namespace Rhydon.Emulator.Handlers
{
class NorDword : IKoiHandler {
public KoiOpCodes Handles => KoiOpCodes.OP_NOR_DWORD;
public void Emulate(EmuContext ctx) {
//throw new System.NotImplementedException();
}
}
class NorQword : IKoiHandler {
public KoiOpCodes Handles => KoiOpCodes.OP_NOR_QWORD;
public void Emulate(EmuContext ctx) {
//throw new System.NotImplementedException();
}
}
}
11 changes: 11 additions & 0 deletions Rhydon.Emulator/Handlers/Pop.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using Rhydon.Core;
namespace Rhydon.Emulator.Handlers
{
class Pop : IKoiHandler {
public KoiOpCodes Handles => KoiOpCodes.OP_POP;
public void Emulate(EmuContext ctx) {
//throw new System.NotImplementedException();
ctx.Reader.ReadKoiByte(ctx.Export); // ReadByte gets used on original opcode.
}
}
}
43 changes: 43 additions & 0 deletions Rhydon.Emulator/Handlers/Push.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,49 @@ class PushRDword : IKoiHandler {
public KoiOpCodes Handles => KoiOpCodes.OP_PUSHR_DWORD;
public void Emulate(EmuContext ctx) {
//throw new System.NotImplementedException();
ctx.Reader.ReadKoiByte(ctx.Export); // ReadByte gets used on original opcode.
}
class PushIDword : IKoiHandler {
public KoiOpCodes Handles => KoiOpCodes.OP_PUSHI_DWORD;
public void Emulate(EmuContext ctx) {
//throw new System.NotImplementedException();
ctx.Reader.ReadKoiByte(ctx.Export); // ReadByte gets used on original opcode.
}
}
class PushIQword : IKoiHandler {
public KoiOpCodes Handles => KoiOpCodes.OP_PUSHI_QWORD;
public void Emulate(EmuContext ctx) {
//throw new System.NotImplementedException();
ctx.Reader.ReadKoiByte(ctx.Export); // ReadByte gets used on original opcode.
}
}
class PushRByte : IKoiHandler {
public KoiOpCodes Handles => KoiOpCodes.OP_PUSHR_BYTE;
public void Emulate(EmuContext ctx) {
//throw new System.NotImplementedException();
ctx.Reader.ReadKoiByte(ctx.Export); // ReadByte gets used on original opcode.
}
}
class PushRObject : IKoiHandler {
public KoiOpCodes Handles => KoiOpCodes.OP_PUSHR_OBJECT;
public void Emulate(EmuContext ctx) {
//throw new System.NotImplementedException();
ctx.Reader.ReadKoiByte(ctx.Export); // ReadByte gets used on original opcode.
}
}
class PushRQword : IKoiHandler {
public KoiOpCodes Handles => KoiOpCodes.OP_PUSHR_QWORD;
public void Emulate(EmuContext ctx) {
//throw new System.NotImplementedException();
ctx.Reader.ReadKoiByte(ctx.Export); // ReadByte gets used on original opcode.
}
}
class PushRWord : IKoiHandler {
public KoiOpCodes Handles => KoiOpCodes.OP_PUSHR_WORD;
public void Emulate(EmuContext ctx) {
//throw new System.NotImplementedException();
ctx.Reader.ReadKoiByte(ctx.Export); // ReadByte gets used on original opcode.
}
}
}
}
28 changes: 28 additions & 0 deletions Rhydon.Emulator/Handlers/Rem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using Rhydon.Core;
namespace Rhydon.Emulator.Handlers
{
class RemDword : IKoiHandler {
public KoiOpCodes Handles => KoiOpCodes.OP_REM_DWORD;
public void Emulate(EmuContext ctx) {
//throw new System.NotImplementedException();
}
}
class RemQword : IKoiHandler {
public KoiOpCodes Handles => KoiOpCodes.OP_REM_QWORD;
public void Emulate(EmuContext ctx) {
//throw new System.NotImplementedException();
}
}
class RemR32 : IKoiHandler {
public KoiOpCodes Handles => KoiOpCodes.OP_REM_R32;
public void Emulate(EmuContext ctx) {
//throw new System.NotImplementedException();
}
}
class RemR64 : IKoiHandler {
public KoiOpCodes Handles => KoiOpCodes.OP_REM_R64;
public void Emulate(EmuContext ctx) {
//throw new System.NotImplementedException();
}
}
}
Loading

0 comments on commit 68d720d

Please sign in to comment.