mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-08-30 22:59:52 +02:00
Update to v106r69 release.
byuu says: The biggest change was improving WonderSwan emulation. With help from trap15, I tracked down a bug where I was checking the wrong bit for reverse DMA transfers. Then I also emulated VTOTAL to support variable refresh rate. Then I improved HyperVoice emulation which should be unsigned samples in three of four modes. That got Fire Lancer running great. I also rewrote the disassembler. The old one disassembled many instructions completely wrong, and deviated too much from any known x86 syntax. I also emulated some of the quirks of the V30 (two-byte POP into registers fails, SALC is just XLAT mirrored, etc) which probably don't matter unless someone tries to run code to verify it's a NEC CPU and not an Intel CPU, but hey, why not? I also put more work into the MSX skeleton, but it's still just a skeleton with no real emulation yet.
This commit is contained in:
@@ -13,14 +13,12 @@ auto string::contains(string_view characters) const -> maybe<uint> {
|
||||
|
||||
template<bool Insensitive, bool Quoted> auto string::_find(int offset, string_view source) const -> maybe<uint> {
|
||||
if(source.size() == 0) return nothing;
|
||||
|
||||
auto p = data();
|
||||
for(uint n = offset, quoted = 0; n < size();) {
|
||||
if(Quoted) { if(p[n] == '\"') { quoted ^= 1; n++; continue; } if(quoted) { n++; continue; } }
|
||||
if(_compare<Insensitive>(p + n, size() - n, source.data(), source.size())) { n++; continue; }
|
||||
return n - offset;
|
||||
}
|
||||
|
||||
return nothing;
|
||||
}
|
||||
|
||||
@@ -32,4 +30,36 @@ auto string::iqfind(string_view source) const -> maybe<uint> { return _find<1, 1
|
||||
auto string::findFrom(int offset, string_view source) const -> maybe<uint> { return _find<0, 0>(offset, source); }
|
||||
auto string::ifindFrom(int offset, string_view source) const -> maybe<uint> { return _find<1, 0>(offset, source); }
|
||||
|
||||
auto string::findNext(int offset, string_view source) const -> maybe<uint> {
|
||||
if(source.size() == 0) return nothing;
|
||||
for(int n = offset + 1; n < size(); n++) {
|
||||
if(memory::compare(data() + n, size() - n, source.data(), source.size()) == 0) return n;
|
||||
}
|
||||
return nothing;
|
||||
}
|
||||
|
||||
auto string::ifindNext(int offset, string_view source) const -> maybe<uint> {
|
||||
if(source.size() == 0) return nothing;
|
||||
for(int n = offset + 1; n < size(); n++) {
|
||||
if(memory::icompare(data() + n, size() - n, source.data(), source.size()) == 0) return n;
|
||||
}
|
||||
return nothing;
|
||||
}
|
||||
|
||||
auto string::findPrevious(int offset, string_view source) const -> maybe<uint> {
|
||||
if(source.size() == 0) return nothing;
|
||||
for(int n = offset - 1; n >= 0; n--) {
|
||||
if(memory::compare(data() + n, size() - n, source.data(), source.size()) == 0) return n;
|
||||
}
|
||||
return nothing;
|
||||
}
|
||||
|
||||
auto string::ifindPrevious(int offset, string_view source) const -> maybe<uint> {
|
||||
if(source.size() == 0) return nothing;
|
||||
for(int n = offset - 1; n >= 0; n--) {
|
||||
if(memory::icompare(data() + n, size() - n, source.data(), source.size()) == 0) return n;
|
||||
}
|
||||
return nothing;
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user