Skip to content

Commit

Permalink
update PSEMU/RAM.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
Cherrytree56567 committed Oct 18, 2023
1 parent 26d0160 commit 839ef22
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions PSEMU/RAM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,12 @@ void RAM::store32(uint32_t offset, uint32_t value) {
ram[offset + 1] = static_cast<uint8_t>(value >> 8);
ram[offset + 2] = static_cast<uint8_t>(value >> 16);
ram[offset + 3] = static_cast<uint8_t>(value >> 24);
}

void CPU::store16(uint32_t offset, uint16_t val) {
uint8_t b0 = val;
uint8_t b1 = (val >> 8);

data[offset + 0] = b0;
data[offset + 1] = b1;
}

0 comments on commit 839ef22

Please sign in to comment.