mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-08-29 06:30:27 +02:00
Update to v106r65 release.
byuu says: This synchronizes bsnes/higan with many recent internal nall changes. This will be the last WIP until I am situated in Japan. Apologies for the bugfixes that didn't get applied yet, I ran out of time.
This commit is contained in:
@@ -11,7 +11,27 @@ template<> struct vector<uint8_t> : vector_base<uint8_t> {
|
||||
}
|
||||
|
||||
template<typename U> auto appendm(U value, uint size) -> void {
|
||||
for(uint byte : reverse(range(size))) append(uint8_t(value >> byte * 8));
|
||||
for(uint byte : nall::reverse(range(size))) append(uint8_t(value >> byte * 8));
|
||||
}
|
||||
|
||||
//note: string_view is not declared here yet ...
|
||||
auto appends(array_view<uint8_t> memory) -> void {
|
||||
for(uint8_t byte : memory) append(byte);
|
||||
}
|
||||
|
||||
template<typename U> auto readl(int offset, uint size) -> U {
|
||||
if(offset < 0) offset = this->size() - abs(offset);
|
||||
U value = 0;
|
||||
for(uint byte : range(size)) value |= (U)operator[](offset + byte) << byte * 8;
|
||||
return value;
|
||||
}
|
||||
|
||||
auto view(uint offset, uint length) -> array_view<uint8_t> {
|
||||
#ifdef DEBUG
|
||||
struct out_of_bounds {};
|
||||
if(offset + length >= size()) throw out_of_bounds{};
|
||||
#endif
|
||||
return {data() + offset, length};
|
||||
}
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user