rk05: update register first to not overwrite it at function exit
This commit is contained in:
parent
171afe7af9
commit
44f08ad6e9
1 changed files with 3 additions and 3 deletions
6
rk05.cpp
6
rk05.cpp
|
@ -150,6 +150,9 @@ void rk05::writeWord(const uint16_t addr, uint16_t v)
|
|||
const int reg = (addr - RK05_BASE) / 2;
|
||||
fprintf(stderr, "RK05 write %s/%o: %o\n", regnames[reg], addr, v);
|
||||
|
||||
D(fprintf(stderr, "set register %o to %o\n", addr, v);)
|
||||
registers[reg] = v;
|
||||
|
||||
if (addr == RK05_CS) {
|
||||
if (v & 1) { // GO
|
||||
const int func = (v >> 1) & 7; // FUNCTION
|
||||
|
@ -277,9 +280,6 @@ void rk05::writeWord(const uint16_t addr, uint16_t v)
|
|||
}
|
||||
}
|
||||
|
||||
D(fprintf(stderr, "set register %o to %o\n", addr, v);)
|
||||
registers[reg] = v;
|
||||
|
||||
#if defined(ESP32)
|
||||
digitalWrite(LED_BUILTIN, HIGH);
|
||||
#endif
|
||||
|
|
Loading…
Add table
Reference in a new issue