| 238 | } |
| 239 | |
| 240 | void Dump_RSPDisassemble(const char * p_file_name) |
| 241 | { |
| 242 | u8 * base; |
| 243 | u32 start = 0xa4000000; |
| 244 | u32 end = 0xa4002000; |
| 245 | |
| 246 | if (!Memory_GetInternalReadAddress(start, (void**)&base)) |
| 247 | { |
| 248 | DBGConsole_Msg(0, "[Yrdis: Invalid base 0x%08x]", start); |
| 249 | return; |
| 250 | } |
| 251 | |
| 252 | IO::Filename file_path; |
| 253 | |
| 254 | if (p_file_name == NULL || strlen(p_file_name) == 0) |
| 255 | { |
| 256 | Dump_GetDumpDirectory(file_path, ""); |
| 257 | IO::Path::Append(file_path, "rdis.txt"); |
| 258 | } |
| 259 | else |
| 260 | { |
| 261 | IO::Path::Assign(file_path, p_file_name); |
| 262 | } |
| 263 | |
| 264 | DBGConsole_Msg(0, "Disassembling from 0x%08x to 0x%08x ([C%s])", start, end, file_path); |
| 265 | |
| 266 | FILE * fp( fopen(file_path, "w") ); |
| 267 | if (fp == NULL) |
| 268 | return; |
| 269 | |
| 270 | const u32 * mem_start( reinterpret_cast< const u32 * >( base + 0x0000 ) ); |
| 271 | const u32 * mem_end( reinterpret_cast< const u32 * >( base + 0x1000 ) ); |
| 272 | |
| 273 | Dump_MemoryRange( fp, start, mem_start, mem_end ); |
| 274 | |
| 275 | const OpCode * op_start( reinterpret_cast< const OpCode * >( base + 0x1000 ) ); |
| 276 | const OpCode * op_end( reinterpret_cast< const OpCode * >( base + 0x2000 ) ); |
| 277 | |
| 278 | Dump_DisassembleRSPRange( fp, start + 0x1000, op_start, op_end ); |
| 279 | |
| 280 | fclose(fp); |
| 281 | } |
| 282 | #endif |
| 283 | |
| 284 | #ifndef DAEDALUS_SILENT |
nothing calls this directly
no test coverage detected