mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-08-08 06:36:43 +02:00
Update to v106r81 release.
byuu says: First 32 instructions implemented in the TLCS900H disassembler. Only 992 to go! I removed the use of anonymous namespaces in nall. It was something I rarely used, because it rarely did what I wanted. I updated all nested namespaces to use C++17-style namespace Foo::Bar {} syntax instead of classic C++-style namespace Foo { namespace Bar {}}. I updated ruby::Video::acquire() to return a struct, so we can use C++17 structured bindings. Long term, I want to get away from all functions that take references for output only. Even though C++ botched structured bindings by not allowing you to bind to existing variables, it's even worse to have function calls that take arguments by reference and then write to them. From the caller side, you can't tell the value is being written, nor that the value passed in doesn't matter, which is terrible.
This commit is contained in:
@@ -21,6 +21,7 @@ using nall::function;
|
||||
using nall::queue;
|
||||
using nall::shared_pointer;
|
||||
using nall::string;
|
||||
using nall::tuple;
|
||||
using nall::unique_pointer;
|
||||
using nall::vector;
|
||||
|
||||
|
@@ -92,8 +92,10 @@ auto Video::clear() -> void {
|
||||
return instance->clear();
|
||||
}
|
||||
|
||||
auto Video::acquire(uint32_t*& data, uint& pitch, uint width, uint height) -> bool {
|
||||
return instance->acquire(data, pitch, width, height);
|
||||
auto Video::acquire(uint width, uint height) -> Acquire {
|
||||
Acquire result;
|
||||
if(instance->acquire(result.data, result.pitch, width, height)) return result;
|
||||
return {};
|
||||
}
|
||||
|
||||
auto Video::release() -> void {
|
||||
|
@@ -86,7 +86,12 @@ struct Video {
|
||||
|
||||
auto configure(uint width, uint height, double inputFrequency, double outputFrequency) -> bool;
|
||||
auto clear() -> void;
|
||||
auto acquire(uint32_t*& data, uint& pitch, uint width, uint height) -> bool;
|
||||
struct Acquire {
|
||||
explicit operator bool() const { return data; }
|
||||
uint32_t* data = nullptr;
|
||||
uint pitch = 0;
|
||||
};
|
||||
auto acquire(uint width, uint height) -> Acquire;
|
||||
auto release() -> void;
|
||||
auto output() -> void;
|
||||
auto poll() -> void;
|
||||
|
Reference in New Issue
Block a user