mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-10-04 08:21:49 +02:00
byuu says: New terminal is in. Much nicer to use now. Command history makes a major difference in usability. The SMP is now fully traceable and debuggable. Basically they act as separate entities, you can trace both at the same time, but for the most part running and stepping is performed on the chip you select. I'm going to put off CPU+SMP interleave support for a while. I don't actually think it'll be too hard. Will get trickier if/when we support coprocessor debugging. Remaining tasks: - aliases - hotkeys - save states - window geometry Basically, the debugger's done. Just have to add the UI fluff. I also removed tracing/memory export from higan. It was always meant to be temporary until the debugger was remade.
34 lines
1015 B
C++
34 lines
1015 B
C++
#ifdef NALL_STRING_INTERNAL_HPP
|
|
|
|
//usage example:
|
|
//if(auto position = strpos(str, key)) print(position(), "\n");
|
|
//prints position of key within str; but only if it is found
|
|
|
|
namespace nall {
|
|
|
|
template<bool Insensitive, bool Quoted>
|
|
maybe<unsigned> ustrpos(const char* str, const char* key) {
|
|
const char* base = str;
|
|
|
|
while(*str) {
|
|
if(quoteskip<Quoted>(str)) continue;
|
|
for(unsigned n = 0;; n++) {
|
|
if(key[n] == 0) return (unsigned)(str - base);
|
|
if(str[n] == 0) return nothing;
|
|
if(!chrequal<Insensitive>(str[n], key[n])) break;
|
|
}
|
|
str++;
|
|
}
|
|
|
|
return nothing;
|
|
}
|
|
|
|
maybe<unsigned> strpos(const char* str, const char* key) { return ustrpos<false, false>(str, key); }
|
|
maybe<unsigned> istrpos(const char* str, const char* key) { return ustrpos<true, false>(str, key); }
|
|
maybe<unsigned> qstrpos(const char* str, const char* key) { return ustrpos<false, true>(str, key); }
|
|
maybe<unsigned> iqstrpos(const char* str, const char* key) { return ustrpos<true, true>(str, key); }
|
|
|
|
}
|
|
|
|
#endif
|