mirror of
				https://github.com/hedge-dev/XenonRecomp.git
				synced 2025-11-04 06:47:09 +00:00 
			
		
		
		
	Don't print save/restore calls when non volatile registers as local variables option is enabled.
This commit is contained in:
		@@ -157,7 +157,14 @@ bool Recompiler::Recompile(
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
                if (targetSymbol != image.symbols.end() && targetSymbol->address == address && targetSymbol->type == Symbol_Function)
 | 
					                if (targetSymbol != image.symbols.end() && targetSymbol->address == address && targetSymbol->type == Symbol_Function)
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    println("\t{}(ctx, base);", targetSymbol->name);
 | 
					                    if (config.nonVolatileRegistersAsLocalVariables && (targetSymbol->name.starts_with("__rest") || targetSymbol->name.starts_with("__save")))
 | 
				
			||||||
 | 
					                    {
 | 
				
			||||||
 | 
					                        // print nothing
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    else
 | 
				
			||||||
 | 
					                    {
 | 
				
			||||||
 | 
					                        println("\t{}(ctx, base);", targetSymbol->name);
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                else
 | 
					                else
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -20,7 +20,18 @@ void SWARecompiler::Analyse()
 | 
				
			|||||||
        f.base = fn.BeginAddress;
 | 
					        f.base = fn.BeginAddress;
 | 
				
			||||||
        f.size = fn.FunctionLength * 4;
 | 
					        f.size = fn.FunctionLength * 4;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        image.symbols.emplace(std::format("sub_{:X}", f.base), f.base, f.size, Symbol_Function);
 | 
					        std::string name;
 | 
				
			||||||
 | 
					        if (f.base == 0x831B0B40) name = "__restgprlr_14";
 | 
				
			||||||
 | 
					        else if (f.base == 0x831B0AF0) name = "__savegprlr_14";
 | 
				
			||||||
 | 
					        else if (f.base == 0x831B144C) name = "__restfpr_14";
 | 
				
			||||||
 | 
					        else if (f.base == 0x831B1400) name = "__savefpr_14";
 | 
				
			||||||
 | 
					        else if (f.base == 0x831B36E8) name = "__restvmx_14";
 | 
				
			||||||
 | 
					        else if (f.base == 0x831B3450) name = "__savevmx_14";
 | 
				
			||||||
 | 
					        else if (f.base == 0x831B377C) name = "__restvmx_64";
 | 
				
			||||||
 | 
					        else if (f.base == 0x831B34E4) name = "__savevmx_64";
 | 
				
			||||||
 | 
					        else name = std::format("sub_{:X}", f.base);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        image.symbols.emplace(name, f.base, f.size, Symbol_Function);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    for (size_t i = 15; i < 128; i++)
 | 
					    for (size_t i = 15; i < 128; i++)
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user