2016-06-20 11:00:32 +00:00
|
|
|
#pragma once
|
|
|
|
|
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
|
|
|
#include <nall/file.hpp>
|
|
|
|
#include <nall/decode/zip.hpp>
|
|
|
|
|
2019-01-16 00:46:42 +00:00
|
|
|
namespace nall::vfs::memory {
|
2016-06-20 11:00:32 +00:00
|
|
|
|
|
|
|
struct file : vfs::file {
|
|
|
|
~file() { delete[] _data; }
|
|
|
|
|
2019-08-16 10:44:16 +00:00
|
|
|
static auto open(const void* data, uintmax size) -> shared_pointer<vfs::file> {
|
2016-06-20 11:00:32 +00:00
|
|
|
auto instance = shared_pointer<file>{new file};
|
2018-08-05 09:00:15 +00:00
|
|
|
instance->_open((const uint8_t*)data, size);
|
2016-06-20 11:00:32 +00:00
|
|
|
return instance;
|
|
|
|
}
|
|
|
|
|
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
|
|
|
static auto open(string location, bool decompress = false) -> shared_pointer<file> {
|
|
|
|
auto instance = shared_pointer<file>{new file};
|
|
|
|
if(decompress && location.iendsWith(".zip")) {
|
|
|
|
Decode::ZIP archive;
|
|
|
|
if(archive.open(location) && archive.file.size() == 1) {
|
|
|
|
auto memory = archive.extract(archive.file.first());
|
|
|
|
instance->_open(memory.data(), memory.size());
|
|
|
|
return instance;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
auto memory = nall::file::read(location);
|
|
|
|
instance->_open(memory.data(), memory.size());
|
|
|
|
return instance;
|
|
|
|
}
|
|
|
|
|
|
|
|
auto data() const -> const uint8_t* { return _data; }
|
2016-08-09 11:07:18 +00:00
|
|
|
auto size() const -> uintmax override { return _size; }
|
|
|
|
auto offset() const -> uintmax override { return _offset; }
|
2016-06-20 11:00:32 +00:00
|
|
|
|
2016-08-09 11:07:18 +00:00
|
|
|
auto seek(intmax offset, index mode) -> void override {
|
|
|
|
if(mode == index::absolute) _offset = (uintmax)offset;
|
|
|
|
if(mode == index::relative) _offset += (intmax)offset;
|
2016-06-20 11:00:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
auto read() -> uint8_t override {
|
|
|
|
if(_offset >= _size) return 0x00;
|
|
|
|
return _data[_offset++];
|
|
|
|
}
|
|
|
|
|
|
|
|
auto write(uint8_t data) -> void override {
|
|
|
|
if(_offset >= _size) return;
|
|
|
|
_data[_offset++] = data;
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
file() = default;
|
|
|
|
file(const file&) = delete;
|
|
|
|
auto operator=(const file&) -> file& = delete;
|
|
|
|
|
2016-08-09 11:07:18 +00:00
|
|
|
auto _open(const uint8_t* data, uintmax size) -> void {
|
2016-06-20 11:00:32 +00:00
|
|
|
_size = size;
|
|
|
|
_data = new uint8_t[size];
|
|
|
|
nall::memory::copy(_data, data, size);
|
|
|
|
}
|
|
|
|
|
|
|
|
uint8_t* _data = nullptr;
|
2016-08-09 11:07:18 +00:00
|
|
|
uintmax _size = 0;
|
|
|
|
uintmax _offset = 0;
|
2016-06-20 11:00:32 +00:00
|
|
|
};
|
|
|
|
|
2019-01-16 00:46:42 +00:00
|
|
|
}
|