mirror of
				https://github.com/PabloMK7/citra.git
				synced 2025-10-30 21:30:04 +00:00 
			
		
		
		
	arm_dyncom_thumb: Fix handling of writeback for thumb LDMIA
This commit is contained in:
		
							parent
							
								
									7589a5ad4d
								
							
						
					
					
						commit
						04f204ed00
					
				
					 1 changed files with 19 additions and 5 deletions
				
			
		|  | @ -327,11 +327,25 @@ tdstate thumb_translate(u32 addr, u32 instr, u32* ainstr, u32* inst_size) { | ||||||
| 
 | 
 | ||||||
|     case 24: //  STMIA
 |     case 24: //  STMIA
 | ||||||
|     case 25: //  LDMIA
 |     case 25: //  LDMIA
 | ||||||
|         *ainstr = ((tinstr & (1 << 11))         // base
 |         if (tinstr & (1 << 11)) | ||||||
|                ? 0xE8B00000                     // LDMIA
 |         { | ||||||
|                : 0xE8A00000)                    // STMIA
 |             unsigned int base = 0xE8900000; | ||||||
|             |((tinstr & 0x0700) << (16 - 8))    // Rb
 |             unsigned int rn = BITS(tinstr, 8, 10); | ||||||
|             |(tinstr & 0x00FF);                 // mask8
 | 
 | ||||||
|  |             // Writeback
 | ||||||
|  |             if ((tinstr & (1 << rn)) == 0) | ||||||
|  |                 base |= (1 << 21); | ||||||
|  | 
 | ||||||
|  |             *ainstr = base           // base (LDMIA)
 | ||||||
|  |                 | (rn << 16)         // Rn
 | ||||||
|  |                 | (tinstr & 0x00FF); // Register list
 | ||||||
|  |         } | ||||||
|  |         else | ||||||
|  |         { | ||||||
|  |             *ainstr = 0xE8A00000              // base (STMIA)
 | ||||||
|  |                 | (BITS(tinstr, 8, 10) << 16) // Rn
 | ||||||
|  |                 | (tinstr & 0x00FF);          // Register list
 | ||||||
|  |         } | ||||||
|         break; |         break; | ||||||
| 
 | 
 | ||||||
|     case 26: // Bcc
 |     case 26: // Bcc
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue