From 1c5087c830f290f3e88996fc1594d94abc1e3f22 Mon Sep 17 00:00:00 2001 From: Ian C Date: Tue, 19 Apr 2016 11:48:18 +0100 Subject: Fixs to GB 16-bit register load op and others --- src/gbcpu.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'src/gbcpu.c') diff --git a/src/gbcpu.c b/src/gbcpu.c index 9f33bf5..074bf82 100644 --- a/src/gbcpu.c +++ b/src/gbcpu.c @@ -765,6 +765,7 @@ static CommandStatus LD(const char *label, int argc, char *argv[], if (Is16Bit(t1) && !IsMemory(t1) && r2 == VALUE) { PCWrite(register_bitmask[r1] << 4 | 0x01); + PCWriteWord(off2); return CMD_OK; } @@ -1810,6 +1811,21 @@ static CommandStatus RST(const char *label, int argc, char *argv[], } +static CommandStatus STOP(const char *label, int argc, char *argv[], + int quoted[], char *err, size_t errsize) +{ + if (argc == 1) + { + PCWrite(0x10); + PCWrite(0x00); + return CMD_OK; + } + + return IllegalArgs(argc, argv, quoted, err, errsize); +} + + + /* ---------------------------------------- OPCODE TABLES */ typedef struct @@ -1856,6 +1872,7 @@ static const HandlerTable handler_table[] = {"CALL", CALL}, {"RET", RET}, {"RST", RST}, + {"STOP", STOP}, {NULL} }; @@ -1876,7 +1893,6 @@ static const OpcodeTable implied_opcodes[] = {"RLA", {0x17}}, {"RRA", {0x1f}}, {"RETI", {0xd9}}, - {"STOP", {0x10}}, {NULL} }; -- cgit v1.2.3