Browse Source

Emulator: Fix loading 16-bit immediate value

The 8 lower bits are read first. The 8 higher bits come afterwards!
master
Riyyi 2 years ago
parent
commit
ab5d9cbe69
  1. 2
      src/cpu.h

2
src/cpu.h

@ -55,7 +55,7 @@ private:
uint8_t peekMemory(int32_t offset = 0) const; uint8_t peekMemory(int32_t offset = 0) const;
uint8_t consumeMemory(); uint8_t consumeMemory();
uint32_t immediate16() { return (consumeMemory() << 8) | consumeMemory(); } uint32_t immediate16() { return consumeMemory() | (consumeMemory() << 8); }
void setBc(uint32_t value); void setBc(uint32_t value);
void setDe(uint32_t value); void setDe(uint32_t value);

Loading…
Cancel
Save