mirror of
https://github.com/dingusdev/dingusppc.git
synced 2024-12-26 09:29:28 +00:00
ppcopcodes: Use macro to grab instruction fields.
This commit is contained in:
parent
29a832c68d
commit
1e50d88183
@ -888,8 +888,8 @@ static void update_decrementer(uint32_t val) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void dppc_interpreter::ppc_mfspr() {
|
void dppc_interpreter::ppc_mfspr() {
|
||||||
uint32_t ref_spr = (((ppc_cur_instruction >> 11) & 0x1F) << 5) |
|
ppc_grab_dab(ppc_cur_instruction);
|
||||||
((ppc_cur_instruction >> 16) & 0x1F);
|
uint32_t ref_spr = (reg_b << 5) | reg_a;
|
||||||
|
|
||||||
#ifdef CPU_PROFILING
|
#ifdef CPU_PROFILING
|
||||||
if (ref_spr > 31) {
|
if (ref_spr > 31) {
|
||||||
@ -911,12 +911,12 @@ void dppc_interpreter::ppc_mfspr() {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
ppc_state.gpr[(ppc_cur_instruction >> 21) & 0x1F] = ppc_state.spr[ref_spr];
|
ppc_state.gpr[reg_d] = ppc_state.spr[ref_spr];
|
||||||
}
|
}
|
||||||
|
|
||||||
void dppc_interpreter::ppc_mtspr() {
|
void dppc_interpreter::ppc_mtspr() {
|
||||||
uint32_t ref_spr = (((ppc_cur_instruction >> 11) & 0x1F) << 5) |
|
ppc_grab_dab(ppc_cur_instruction);
|
||||||
((ppc_cur_instruction >> 16) & 0x1F);
|
uint32_t ref_spr = (reg_b << 5) | reg_a;
|
||||||
|
|
||||||
#ifdef CPU_PROFILING
|
#ifdef CPU_PROFILING
|
||||||
if (ref_spr > 31) {
|
if (ref_spr > 31) {
|
||||||
@ -930,7 +930,7 @@ void dppc_interpreter::ppc_mtspr() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t val = ppc_state.gpr[(ppc_cur_instruction >> 21) & 0x1F];
|
uint32_t val = ppc_state.gpr[reg_d];
|
||||||
ppc_state.spr[ref_spr] = val;
|
ppc_state.spr[ref_spr] = val;
|
||||||
|
|
||||||
switch (ref_spr) {
|
switch (ref_spr) {
|
||||||
@ -980,9 +980,8 @@ void dppc_interpreter::ppc_mtspr() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void dppc_interpreter::ppc_mftb() {
|
void dppc_interpreter::ppc_mftb() {
|
||||||
uint32_t ref_spr = (((ppc_cur_instruction >> 11) & 0x1F) << 5) |
|
ppc_grab_dab(ppc_cur_instruction);
|
||||||
((ppc_cur_instruction >> 16) & 0x1F);
|
uint32_t ref_spr = (reg_b << 5) | reg_a;
|
||||||
int reg_d = (ppc_cur_instruction >> 21) & 0x1F;
|
|
||||||
|
|
||||||
uint64_t tbr_value = calc_tbr_value();
|
uint64_t tbr_value = calc_tbr_value();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user