Update to v106r58 release.

byuu says:

The main thing I worked on today was emulating the MBC7 EEPROM.

And... I have many things to say about that, but not here, and not now...

The missing EEPROM support is why the accelerometer was broken. Although
it's not evidently clear that I'm emulating the actual values
incorrectly. I'll think about it and get it fixed, though.

bsnes went from ~308fps to ~328fps, and I don't even know why. Probably
something somewhere in the 140KB of changes to other things made in this
WIP.
This commit is contained in:
Tim Allen
2018-08-21 13:17:12 +10:00
parent 9a6ae6dacb
commit f9adb4d2c6
98 changed files with 3422 additions and 1539 deletions

View File

@@ -2,6 +2,14 @@
namespace nall {
template<typename T> vector<T>::vector(Literal::Capacity capacity) {
reserve(capacity.value);
}
template<typename T> vector<T>::vector(Literal::Size size) {
resize(size.value);
}
template<typename T> vector<T>::vector(const initializer_list<T>& values) {
reserveRight(values.size());
for(auto& value : values) append(value);
@@ -23,20 +31,20 @@ template<typename T> vector<T>::operator bool() const {
return _size;
}
template<typename T> auto vector<T>::capacity() const -> uint {
return _left + _size + _right;
template<typename T> template<typename Cast> auto vector<T>::capacity() const -> uint {
return (_left + _size + _right) * sizeof(T) / sizeof(Cast);
}
template<typename T> auto vector<T>::size() const -> uint {
return _size;
template<typename T> template<typename Cast> auto vector<T>::size() const -> uint {
return _size * sizeof(T) / sizeof(Cast);
}
template<typename T> auto vector<T>::data() -> T* {
return _pool;
template<typename T> template<typename Cast> auto vector<T>::data(uint offset) -> Cast* {
return (Cast*)_pool + offset;
}
template<typename T> auto vector<T>::data() const -> const T* {
return _pool;
template<typename T> template<typename Cast> auto vector<T>::data(uint offset) const -> const Cast* {
return (const Cast*)_pool + offset;
}
}

View File

@@ -16,6 +16,16 @@ template<typename T> auto vector<T>::find(const T& value) const -> maybe<uint> {
return nothing;
}
template<typename T> auto vector<T>::findSorted(const T& value) const -> maybe<uint> {
int l = 0, r = size() - 1;
while(l <= r) {
int m = l + (r - l >> 1);
if(value == _pool[m]) return m;
value < _pool[m] ? r = m - 1 : l = m + 1;
}
return nothing;
}
template<typename T> auto vector<T>::foreach(const function<void (const T&)>& callback) -> void {
for(uint n : range(size())) callback(_pool[n]);
}