diff options
author | Ian C <ianc@noddybox.co.uk> | 2016-04-19 11:48:18 +0100 |
---|---|---|
committer | Ian C <ianc@noddybox.co.uk> | 2016-04-19 11:48:18 +0100 |
commit | 1c5087c830f290f3e88996fc1594d94abc1e3f22 (patch) | |
tree | 2b22fd123a3879596cc6b58b4b5c37047e221329 /src/gbcpu.c | |
parent | 9a56d4339031204c48645b9dbec5582d58884d5e (diff) |
Fixs to GB 16-bit register load op and others
Diffstat (limited to 'src/gbcpu.c')
-rw-r--r-- | src/gbcpu.c | 18 |
1 files changed, 17 insertions, 1 deletions
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} }; |