blob: 45d79166c0bb9d15e68f463ed0301a575994bea3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
*** src/chips/z80/z80.cpp Sat Sep 19 18:22:46 2020
--- /home/tmoment/z80.cpp Sat Sep 19 18:22:00 2020
***************
*** 1355,1379 ****
}
! template<bool rlc, bool adjust> u8 Core_z80::doRL (u8 val) {
bool _c = reg.bit.c;
reg.bit.c = !! (val & 0x80);
val <<= 1;
val |= rlc ? (u8)reg.bit.c : (u8)_c;
setUndocumentedFlags(val);
reg.bit.h = reg.bit.n = 0;
! if (adjust) setStandardFlags(val);
return val;
}
! template<bool rrc, bool adjust> u8 Core_z80::doRR (u8 val) {
bool _c = reg.bit.c;
reg.bit.c = !! (val & 0x01);
val >>= 1;
val |= rrc ? u8 (reg.bit.c << 7) : u8 (_c << 7);
setUndocumentedFlags(val);
reg.bit.h = reg.bit.n = 0;
! if (adjust) setStandardFlags(val);
return val;
}
--- 1355,1379 ----
}
! template<bool rlc, char adjust> u8 Core_z80::doRL (u8 val) {
bool _c = reg.bit.c;
reg.bit.c = !! (val & 0x80);
val <<= 1;
val |= rlc ? (u8)reg.bit.c : (u8)_c;
setUndocumentedFlags(val);
reg.bit.h = reg.bit.n = 0;
! if (adjust != 0) setStandardFlags(val);
return val;
}
! template<bool rrc, char adjust> u8 Core_z80::doRR (u8 val) {
bool _c = reg.bit.c;
reg.bit.c = !! (val & 0x01);
val >>= 1;
val |= rrc ? u8 (reg.bit.c << 7) : u8 (_c << 7);
setUndocumentedFlags(val);
reg.bit.h = reg.bit.n = 0;
! if (adjust != 0) setStandardFlags(val);
return val;
}
|