2016-05-02 09:57:04 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
namespace nall {
|
|
|
|
|
|
|
|
template<typename T> auto vector<T>::prepend(const T& value) -> void {
|
|
|
|
reserveLeft(size() + 1);
|
|
|
|
new(--_pool) T(value);
|
|
|
|
_left--;
|
|
|
|
_size++;
|
|
|
|
}
|
|
|
|
|
|
|
|
template<typename T> auto vector<T>::prepend(T&& value) -> void {
|
|
|
|
reserveLeft(size() + 1);
|
|
|
|
new(--_pool) T(move(value));
|
|
|
|
_left--;
|
|
|
|
_size++;
|
|
|
|
}
|
|
|
|
|
|
|
|
template<typename T> auto vector<T>::prepend(const vector<T>& values) -> void {
|
|
|
|
reserveLeft(size() + values.size());
|
|
|
|
_pool -= values.size();
|
2018-12-22 10:28:15 +00:00
|
|
|
for(uint64_t n : range(values)) new(_pool + n) T(values[n]);
|
2016-05-02 09:57:04 +00:00
|
|
|
_left -= values.size();
|
|
|
|
_size += values.size();
|
|
|
|
}
|
|
|
|
|
|
|
|
template<typename T> auto vector<T>::prepend(vector<T>&& values) -> void {
|
|
|
|
reserveLeft(size() + values.size());
|
|
|
|
_pool -= values.size();
|
2018-12-22 10:28:15 +00:00
|
|
|
for(uint64_t n : range(values)) new(_pool + n) T(move(values[n]));
|
2016-05-02 09:57:04 +00:00
|
|
|
_left -= values.size();
|
|
|
|
_size += values.size();
|
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
template<typename T> auto vector<T>::append(const T& value) -> void {
|
|
|
|
reserveRight(size() + 1);
|
|
|
|
new(_pool + _size) T(value);
|
|
|
|
_right--;
|
|
|
|
_size++;
|
|
|
|
}
|
|
|
|
|
|
|
|
template<typename T> auto vector<T>::append(T&& value) -> void {
|
|
|
|
reserveRight(size() + 1);
|
|
|
|
new(_pool + _size) T(move(value));
|
|
|
|
_right--;
|
|
|
|
_size++;
|
|
|
|
}
|
|
|
|
|
|
|
|
template<typename T> auto vector<T>::append(const vector<T>& values) -> void {
|
|
|
|
reserveRight(size() + values.size());
|
2018-12-22 10:28:15 +00:00
|
|
|
for(uint64_t n : range(values.size())) new(_pool + _size + n) T(values[n]);
|
2016-05-02 09:57:04 +00:00
|
|
|
_right -= values.size();
|
|
|
|
_size += values.size();
|
|
|
|
}
|
|
|
|
|
|
|
|
template<typename T> auto vector<T>::append(vector<T>&& values) -> void {
|
|
|
|
reserveRight(size() + values.size());
|
2018-12-22 10:28:15 +00:00
|
|
|
for(uint64_t n : range(values.size())) new(_pool + _size + n) T(move(values[n]));
|
2016-05-02 09:57:04 +00:00
|
|
|
_right -= values.size();
|
|
|
|
_size += values.size();
|
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
|
2018-12-22 10:28:15 +00:00
|
|
|
template<typename T> auto vector<T>::insert(uint64_t offset, const T& value) -> void {
|
2016-05-02 09:57:04 +00:00
|
|
|
if(offset == 0) return prepend(value);
|
|
|
|
if(offset == size() - 1) return append(value);
|
|
|
|
reserveRight(size() + 1);
|
|
|
|
_size++;
|
2018-12-22 10:28:15 +00:00
|
|
|
for(int64_t n = size() - 1; n > offset; n--) {
|
2016-05-02 09:57:04 +00:00
|
|
|
_pool[n] = move(_pool[n - 1]);
|
|
|
|
}
|
|
|
|
new(_pool + offset) T(value);
|
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
|
2018-12-22 10:28:15 +00:00
|
|
|
template<typename T> auto vector<T>::removeLeft(uint64_t length) -> void {
|
2016-05-02 09:57:04 +00:00
|
|
|
if(length > size()) length = size();
|
|
|
|
resizeLeft(size() - length);
|
|
|
|
}
|
|
|
|
|
2018-12-22 10:28:15 +00:00
|
|
|
template<typename T> auto vector<T>::removeRight(uint64_t length) -> void {
|
2016-05-02 09:57:04 +00:00
|
|
|
if(length > size()) length = size();
|
|
|
|
resizeRight(size() - length);
|
|
|
|
}
|
|
|
|
|
2018-12-22 10:28:15 +00:00
|
|
|
template<typename T> auto vector<T>::remove(uint64_t offset, uint64_t length) -> void {
|
2016-05-02 09:57:04 +00:00
|
|
|
if(offset == 0) return removeLeft(length);
|
|
|
|
if(offset == size() - 1) return removeRight(length);
|
|
|
|
|
2018-12-22 10:28:15 +00:00
|
|
|
for(uint64_t n = offset; n < size(); n++) {
|
2016-05-02 09:57:04 +00:00
|
|
|
if(n + length < size()) {
|
|
|
|
_pool[n] = move(_pool[n + length]);
|
|
|
|
} else {
|
|
|
|
_pool[n].~T();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
_size -= length;
|
|
|
|
}
|
|
|
|
|
2019-08-16 10:44:16 +00:00
|
|
|
template<typename T> auto vector<T>::removeByIndex(uint64_t index) -> bool {
|
|
|
|
if(index < size()) return remove(index), true;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
template<typename T> auto vector<T>::removeByValue(const T& value) -> bool {
|
|
|
|
if(auto index = find(value)) return remove(*index), true;
|
|
|
|
return false;
|
Update to bsnes v107.1 release.
byuu says:
Don't let the point release fool you, there are many significant changes in this
release. I will be keeping bsnes releases using a point system until the new
higan release is ready.
Changelog:
- GUI: added high DPI support
- GUI: fixed the state manager image preview
- Windows: added a new waveOut driver with support for dynamic rate control
- Windows: corrected the XAudio 2.1 dynamic rate control support [BearOso]
- Windows: corrected the Direct3D 9.0 fullscreen exclusive window centering
- Windows: fixed XInput controller support on Windows 10
- SFC: added high-level emulation for the DSP1, DSP2, DSP4, ST010, and Cx4
coprocessors
- SFC: fixed a slight rendering glitch in the intro to Megalomania
If the coprocessor firmware is missing, bsnes will fallback on HLE where it is
supported, which is everything other than SD Gundam GX and the two Hayazashi
Nidan Morita Shougi games.
The Windows dynamic rate control works best with Direct3D in fullscreen
exclusive mode. I recommend the waveOut driver over the XAudio 2.1 driver, as it
is not possible to target a single XAudio2 version on all Windows OS releases.
The waveOut driver should work everywhere out of the box.
Note that with DRC, the synchronization source is your monitor, so you will
want to be running at 60hz (NTSC) or 50hz (PAL). If you have an adaptive sync
monitor, you should instead use the WASAPI (exclusive) or ASIO audio driver.
2019-04-09 01:16:30 +00:00
|
|
|
}
|
|
|
|
|
2016-05-02 09:57:04 +00:00
|
|
|
//
|
|
|
|
|
|
|
|
template<typename T> auto vector<T>::takeLeft() -> T {
|
|
|
|
T value = move(_pool[0]);
|
|
|
|
removeLeft();
|
|
|
|
return value;
|
|
|
|
}
|
|
|
|
|
|
|
|
template<typename T> auto vector<T>::takeRight() -> T {
|
|
|
|
T value = move(_pool[size() - 1]);
|
|
|
|
removeRight();
|
|
|
|
return value;
|
|
|
|
}
|
|
|
|
|
2018-12-22 10:28:15 +00:00
|
|
|
template<typename T> auto vector<T>::take(uint64_t offset) -> T {
|
2016-05-02 09:57:04 +00:00
|
|
|
if(offset == 0) return takeLeft();
|
|
|
|
if(offset == size() - 1) return takeRight();
|
|
|
|
|
|
|
|
T value = move(_pool[offset]);
|
|
|
|
remove(offset);
|
|
|
|
return value;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|