mirror of
				https://github.com/PabloMK7/citra.git
				synced 2025-10-31 05:40:04 +00:00 
			
		
		
		
	dyncom: Handle modifying the APSR via an MRC instruction
This commit is contained in:
		
							parent
							
								
									8f39297c53
								
							
						
					
					
						commit
						fddfe946c8
					
				
					 1 changed files with 9 additions and 12 deletions
				
			
		|  | @ -4696,18 +4696,15 @@ unsigned InterpreterMainLoop(ARMul_State* cpu) { | ||||||
|         if (inst_base->cond == ConditionCode::AL || CondPassed(cpu, inst_base->cond)) { |         if (inst_base->cond == ConditionCode::AL || CondPassed(cpu, inst_base->cond)) { | ||||||
|             mrc_inst* inst_cream = (mrc_inst*)inst_base->component; |             mrc_inst* inst_cream = (mrc_inst*)inst_base->component; | ||||||
| 
 | 
 | ||||||
|             unsigned int inst = inst_cream->inst; |             if (inst_cream->cp_num == 15) { | ||||||
|             if (inst_cream->Rd == 15) { |                 const uint32_t value = cpu->ReadCP15Register(CRn, OPCODE_1, CRm, OPCODE_2); | ||||||
|                 DEBUG_MSG; | 
 | ||||||
|             } |                 if (inst_cream->Rd == 15) { | ||||||
|             if (inst_cream->inst == 0xeef04a10) { |                     cpu->Cpsr = (cpu->Cpsr & ~0xF0000000) | (value & 0xF0000000); | ||||||
|                 // Undefined instruction fmrx
 |                     LOAD_NZCVT; | ||||||
|                 RD = 0x20000000; |                 } else { | ||||||
|                 CITRA_IGNORE_EXIT(-1); |                     RD = value; | ||||||
|                 goto END; |                 } | ||||||
|             } else { |  | ||||||
|                 if (inst_cream->cp_num == 15) |  | ||||||
|                      RD = cpu->ReadCP15Register(CRn, OPCODE_1, CRm, OPCODE_2); |  | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|         cpu->Reg[15] += cpu->GetInstructionSize(); |         cpu->Reg[15] += cpu->GetInstructionSize(); | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue