2016-05-02 09:57:04 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
namespace nall {
|
|
|
|
|
|
|
|
template<typename T> auto vector<T>::operator[](uint offset) -> T& {
|
Update to v106r2 release.
byuu says:
Changelog:
- Super Famicom: added support for loading manifests without embedded
mapping information¹
- genius: initial commit
- various Makefile cleanups
¹: so the idea here is to try and aim for a stable manifest format,
and to allow direct transposition of icarus/genius database entries into
manifest files. The exact mechanics of how this is going to work is
currently in flux, but we'll get there.
For right now, `Super Famicom.sys` gains `boards.bml`, which is the raw
database from my board-editor tool, and higan itself tries to load
`boards.bml`, match an entry to game/board from the game's `manifest.bml`
file, and then transform it into the format currently used by higan. It
does this only when the game's `manifest.bml` file lacks a board node.
When such a board node exists, it works as previous versions of higan
did.
The only incompatible change right now is information/title is now
located at game/label. I may transition window title display to just use
the filenames instead.
Longer term, some thought is going to need to go into the format of the
`boards.bml` database itself, and at which point in the process I should
be transforming things.
Give it time, we'll refine this into something nicer.
2018-02-01 08:20:37 +00:00
|
|
|
#ifdef DEBUG
|
|
|
|
struct out_of_bounds {};
|
|
|
|
if(offset >= size()) throw out_of_bounds{};
|
|
|
|
#endif
|
2016-05-02 09:57:04 +00:00
|
|
|
return _pool[offset];
|
|
|
|
}
|
|
|
|
|
|
|
|
template<typename T> auto vector<T>::operator[](uint offset) const -> const T& {
|
Update to v106r2 release.
byuu says:
Changelog:
- Super Famicom: added support for loading manifests without embedded
mapping information¹
- genius: initial commit
- various Makefile cleanups
¹: so the idea here is to try and aim for a stable manifest format,
and to allow direct transposition of icarus/genius database entries into
manifest files. The exact mechanics of how this is going to work is
currently in flux, but we'll get there.
For right now, `Super Famicom.sys` gains `boards.bml`, which is the raw
database from my board-editor tool, and higan itself tries to load
`boards.bml`, match an entry to game/board from the game's `manifest.bml`
file, and then transform it into the format currently used by higan. It
does this only when the game's `manifest.bml` file lacks a board node.
When such a board node exists, it works as previous versions of higan
did.
The only incompatible change right now is information/title is now
located at game/label. I may transition window title display to just use
the filenames instead.
Longer term, some thought is going to need to go into the format of the
`boards.bml` database itself, and at which point in the process I should
be transforming things.
Give it time, we'll refine this into something nicer.
2018-02-01 08:20:37 +00:00
|
|
|
#ifdef DEBUG
|
|
|
|
struct out_of_bounds {};
|
|
|
|
if(offset >= size()) throw out_of_bounds{};
|
|
|
|
#endif
|
2016-05-02 09:57:04 +00:00
|
|
|
return _pool[offset];
|
|
|
|
}
|
|
|
|
|
|
|
|
template<typename T> auto vector<T>::operator()(uint offset) -> T& {
|
|
|
|
while(offset >= size()) append(T());
|
|
|
|
return _pool[offset];
|
|
|
|
}
|
|
|
|
|
|
|
|
template<typename T> auto vector<T>::operator()(uint offset, const T& value) const -> const T& {
|
|
|
|
if(offset >= size()) return value;
|
|
|
|
return _pool[offset];
|
|
|
|
}
|
|
|
|
|
|
|
|
template<typename T> auto vector<T>::left() -> T& {
|
|
|
|
return _pool[0];
|
|
|
|
}
|
|
|
|
|
|
|
|
template<typename T> auto vector<T>::left() const -> const T& {
|
|
|
|
return _pool[0];
|
|
|
|
}
|
|
|
|
|
|
|
|
template<typename T> auto vector<T>::right() -> T& {
|
|
|
|
return _pool[_size - 1];
|
|
|
|
}
|
|
|
|
|
|
|
|
template<typename T> auto vector<T>::right() const -> const T& {
|
|
|
|
return _pool[_size - 1];
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|