===========================================================================
| 6106 | |
| 6107 | //=========================================================================== |
| 6108 | Update_t _SearchMemoryDisplay (int nArgs) |
| 6109 | { |
| 6110 | int const nFound = (int) (g_vMemorySearchResults.size() - 1); |
| 6111 | |
| 6112 | if (nFound > 0) |
| 6113 | { |
| 6114 | std::string sMatches; |
| 6115 | |
| 6116 | int iFound = 1; |
| 6117 | while (iFound <= nFound) |
| 6118 | { |
| 6119 | WORD const nAddress = g_vMemorySearchResults.at( iFound ); |
| 6120 | |
| 6121 | // 2.6.2.17 Search Results: The n'th result now using correct color (was command, now number decimal) |
| 6122 | // BUGFIX: 2.6.2.32 n'th Search results were being displayed in dec, yet parser takes hex numbers. i.e. SH D000:FFFF A9 00 |
| 6123 | // Intentional default instead of CHC_ARG_SEP for better readability |
| 6124 | // 2.6.2.16 Fixed: Search Results: The hex specify for target address results now colorized properly |
| 6125 | // 2.6.2.15 Fixed: Search Results: Added space between results for better readability |
| 6126 | |
| 6127 | // FIXME: Color is DEC whereas the format is "%X". What's the real intention? |
| 6128 | std::string sResult = StrFormat( CHC_NUM_DEC "%02X" CHC_DEFAULT ":" CHC_ARG_SEP "$" CHC_ADDRESS "%04X ", |
| 6129 | iFound, nAddress ); |
| 6130 | |
| 6131 | // Fit on same line? |
| 6132 | if ((sMatches.length() + sResult.length()) > (size_t(g_nConsoleDisplayWidth) - 1)) // CONSOLE_WIDTH |
| 6133 | { |
| 6134 | //ConsoleDisplayPush( sMatches.c_str() ); |
| 6135 | ConsolePrint( sMatches.c_str() ); |
| 6136 | sMatches = sResult; |
| 6137 | } |
| 6138 | else |
| 6139 | { |
| 6140 | sMatches += sResult; |
| 6141 | } |
| 6142 | |
| 6143 | iFound++; |
| 6144 | } |
| 6145 | |
| 6146 | ConsolePrint( sMatches.c_str() ); |
| 6147 | } |
| 6148 | |
| 6149 | //ConsoleDisplayPushFormat( "Total: %d (#$%04X)", nFound, nFound ); |
| 6150 | |
| 6151 | ConsolePrintFormat( CHC_USAGE "Total" CHC_DEFAULT ": " CHC_NUM_DEC "%d " CHC_ARG_SEP "(" CHC_ARG_SEP "#$" CHC_NUM_HEX "%04X" CHC_ARG_SEP ")", |
| 6152 | nFound /*dec*/, nFound /*hex*/ ); |
| 6153 | |
| 6154 | // g_vMemorySearchResults is cleared in DebugEnd() |
| 6155 | |
| 6156 | // return UPDATE_CONSOLE_DISPLAY; |
| 6157 | return ConsoleUpdate(); |
| 6158 | } |
| 6159 | |
| 6160 | |
| 6161 | //=========================================================================== |
no test coverage detected