2010-08-09 13:28:56 +00:00
|
|
|
#ifndef NALL_VARINT_HPP
|
|
|
|
#define NALL_VARINT_HPP
|
|
|
|
|
|
|
|
#include <nall/bit.hpp>
|
2013-07-29 09:42:45 +00:00
|
|
|
#include <nall/serializer.hpp>
|
Update to v093r02 release.
byuu says:
Changelog:
- nall: fixed major memory leak in string class
- ruby: video shaders support #define-based settings now
- phoenix/GTK+: support > 256x256 icons for window / task bar / alt-tab
- sfc: remove random/ and config/, merge into system/
- ethos: delete higan.png (48x48), replace with higan512.png (512x512)
as new higan.png
- ethos: default gamma to 100% (no color adjustment)
- ethos: use "Video Shaders/Display Emulation/" instead of "Video
Shaders/Emulation/"
- use g++ instead of g++-4.7 (g++ -v must be >= 4.7)
- use -std=c++11 instead of -std=gnu++11
- applied a few patches from Debian upstream to make their packaging job
easier
So because colors are normalized in GLSL, I won't be able to offer video
shaders absolute color literals. We will have to perform basic color
conversion inside the core.
As such, the current plan is to create some sort of Emulator::Settings
interface. With that, I'll connect an option for color correction, which
will be on by default. For FC/SFC, that will mean gamma correction
(darker / stronger colors), and for GB/GBC/GBA, it will mean simulating
the weird brightness levels of the displays. I am undecided on whether
to use pea soup green for the GB or not. By not doing so, it'll be
easier for the display emulation shader to do it.
2013-11-09 11:45:54 +00:00
|
|
|
#include <nall/stdint.hpp>
|
2010-08-09 13:28:56 +00:00
|
|
|
|
|
|
|
namespace nall {
|
|
|
|
|
Update to v093r02 release.
byuu says:
Changelog:
- nall: fixed major memory leak in string class
- ruby: video shaders support #define-based settings now
- phoenix/GTK+: support > 256x256 icons for window / task bar / alt-tab
- sfc: remove random/ and config/, merge into system/
- ethos: delete higan.png (48x48), replace with higan512.png (512x512)
as new higan.png
- ethos: default gamma to 100% (no color adjustment)
- ethos: use "Video Shaders/Display Emulation/" instead of "Video
Shaders/Emulation/"
- use g++ instead of g++-4.7 (g++ -v must be >= 4.7)
- use -std=c++11 instead of -std=gnu++11
- applied a few patches from Debian upstream to make their packaging job
easier
So because colors are normalized in GLSL, I won't be able to offer video
shaders absolute color literals. We will have to perform basic color
conversion inside the core.
As such, the current plan is to create some sort of Emulator::Settings
interface. With that, I'll connect an option for color correction, which
will be on by default. For FC/SFC, that will mean gamma correction
(darker / stronger colors), and for GB/GBC/GBA, it will mean simulating
the weird brightness levels of the displays. I am undecided on whether
to use pea soup green for the GB or not. By not doing so, it'll be
easier for the display emulation shader to do it.
2013-11-09 11:45:54 +00:00
|
|
|
struct varint {
|
2015-07-14 09:32:43 +00:00
|
|
|
virtual auto read() -> uint8_t = 0;
|
|
|
|
virtual auto write(uint8_t) -> void = 0;
|
Update to v093r02 release.
byuu says:
Changelog:
- nall: fixed major memory leak in string class
- ruby: video shaders support #define-based settings now
- phoenix/GTK+: support > 256x256 icons for window / task bar / alt-tab
- sfc: remove random/ and config/, merge into system/
- ethos: delete higan.png (48x48), replace with higan512.png (512x512)
as new higan.png
- ethos: default gamma to 100% (no color adjustment)
- ethos: use "Video Shaders/Display Emulation/" instead of "Video
Shaders/Emulation/"
- use g++ instead of g++-4.7 (g++ -v must be >= 4.7)
- use -std=c++11 instead of -std=gnu++11
- applied a few patches from Debian upstream to make their packaging job
easier
So because colors are normalized in GLSL, I won't be able to offer video
shaders absolute color literals. We will have to perform basic color
conversion inside the core.
As such, the current plan is to create some sort of Emulator::Settings
interface. With that, I'll connect an option for color correction, which
will be on by default. For FC/SFC, that will mean gamma correction
(darker / stronger colors), and for GB/GBC/GBA, it will mean simulating
the weird brightness levels of the displays. I am undecided on whether
to use pea soup green for the GB or not. By not doing so, it'll be
easier for the display emulation shader to do it.
2013-11-09 11:45:54 +00:00
|
|
|
|
2015-07-14 09:32:43 +00:00
|
|
|
auto readvu() -> uintmax_t {
|
Update to v093r02 release.
byuu says:
Changelog:
- nall: fixed major memory leak in string class
- ruby: video shaders support #define-based settings now
- phoenix/GTK+: support > 256x256 icons for window / task bar / alt-tab
- sfc: remove random/ and config/, merge into system/
- ethos: delete higan.png (48x48), replace with higan512.png (512x512)
as new higan.png
- ethos: default gamma to 100% (no color adjustment)
- ethos: use "Video Shaders/Display Emulation/" instead of "Video
Shaders/Emulation/"
- use g++ instead of g++-4.7 (g++ -v must be >= 4.7)
- use -std=c++11 instead of -std=gnu++11
- applied a few patches from Debian upstream to make their packaging job
easier
So because colors are normalized in GLSL, I won't be able to offer video
shaders absolute color literals. We will have to perform basic color
conversion inside the core.
As such, the current plan is to create some sort of Emulator::Settings
interface. With that, I'll connect an option for color correction, which
will be on by default. For FC/SFC, that will mean gamma correction
(darker / stronger colors), and for GB/GBC/GBA, it will mean simulating
the weird brightness levels of the displays. I am undecided on whether
to use pea soup green for the GB or not. By not doing so, it'll be
easier for the display emulation shader to do it.
2013-11-09 11:45:54 +00:00
|
|
|
uintmax_t data = 0, shift = 1;
|
|
|
|
while(true) {
|
|
|
|
uint8_t x = read();
|
|
|
|
data += (x & 0x7f) * shift;
|
|
|
|
if(x & 0x80) break;
|
|
|
|
shift <<= 7;
|
|
|
|
data += shift;
|
|
|
|
}
|
|
|
|
return data;
|
|
|
|
}
|
|
|
|
|
2015-07-14 09:32:43 +00:00
|
|
|
auto readvs() -> intmax_t {
|
Update to v093r02 release.
byuu says:
Changelog:
- nall: fixed major memory leak in string class
- ruby: video shaders support #define-based settings now
- phoenix/GTK+: support > 256x256 icons for window / task bar / alt-tab
- sfc: remove random/ and config/, merge into system/
- ethos: delete higan.png (48x48), replace with higan512.png (512x512)
as new higan.png
- ethos: default gamma to 100% (no color adjustment)
- ethos: use "Video Shaders/Display Emulation/" instead of "Video
Shaders/Emulation/"
- use g++ instead of g++-4.7 (g++ -v must be >= 4.7)
- use -std=c++11 instead of -std=gnu++11
- applied a few patches from Debian upstream to make their packaging job
easier
So because colors are normalized in GLSL, I won't be able to offer video
shaders absolute color literals. We will have to perform basic color
conversion inside the core.
As such, the current plan is to create some sort of Emulator::Settings
interface. With that, I'll connect an option for color correction, which
will be on by default. For FC/SFC, that will mean gamma correction
(darker / stronger colors), and for GB/GBC/GBA, it will mean simulating
the weird brightness levels of the displays. I am undecided on whether
to use pea soup green for the GB or not. By not doing so, it'll be
easier for the display emulation shader to do it.
2013-11-09 11:45:54 +00:00
|
|
|
uintmax_t data = readvu();
|
2015-08-02 06:23:13 +00:00
|
|
|
bool negate = data & 1;
|
Update to v093r02 release.
byuu says:
Changelog:
- nall: fixed major memory leak in string class
- ruby: video shaders support #define-based settings now
- phoenix/GTK+: support > 256x256 icons for window / task bar / alt-tab
- sfc: remove random/ and config/, merge into system/
- ethos: delete higan.png (48x48), replace with higan512.png (512x512)
as new higan.png
- ethos: default gamma to 100% (no color adjustment)
- ethos: use "Video Shaders/Display Emulation/" instead of "Video
Shaders/Emulation/"
- use g++ instead of g++-4.7 (g++ -v must be >= 4.7)
- use -std=c++11 instead of -std=gnu++11
- applied a few patches from Debian upstream to make their packaging job
easier
So because colors are normalized in GLSL, I won't be able to offer video
shaders absolute color literals. We will have to perform basic color
conversion inside the core.
As such, the current plan is to create some sort of Emulator::Settings
interface. With that, I'll connect an option for color correction, which
will be on by default. For FC/SFC, that will mean gamma correction
(darker / stronger colors), and for GB/GBC/GBA, it will mean simulating
the weird brightness levels of the displays. I am undecided on whether
to use pea soup green for the GB or not. By not doing so, it'll be
easier for the display emulation shader to do it.
2013-11-09 11:45:54 +00:00
|
|
|
data >>= 1;
|
2015-08-02 06:23:13 +00:00
|
|
|
if(negate) data = ~data;
|
Update to v093r02 release.
byuu says:
Changelog:
- nall: fixed major memory leak in string class
- ruby: video shaders support #define-based settings now
- phoenix/GTK+: support > 256x256 icons for window / task bar / alt-tab
- sfc: remove random/ and config/, merge into system/
- ethos: delete higan.png (48x48), replace with higan512.png (512x512)
as new higan.png
- ethos: default gamma to 100% (no color adjustment)
- ethos: use "Video Shaders/Display Emulation/" instead of "Video
Shaders/Emulation/"
- use g++ instead of g++-4.7 (g++ -v must be >= 4.7)
- use -std=c++11 instead of -std=gnu++11
- applied a few patches from Debian upstream to make their packaging job
easier
So because colors are normalized in GLSL, I won't be able to offer video
shaders absolute color literals. We will have to perform basic color
conversion inside the core.
As such, the current plan is to create some sort of Emulator::Settings
interface. With that, I'll connect an option for color correction, which
will be on by default. For FC/SFC, that will mean gamma correction
(darker / stronger colors), and for GB/GBC/GBA, it will mean simulating
the weird brightness levels of the displays. I am undecided on whether
to use pea soup green for the GB or not. By not doing so, it'll be
easier for the display emulation shader to do it.
2013-11-09 11:45:54 +00:00
|
|
|
return data;
|
|
|
|
}
|
|
|
|
|
2015-07-14 09:32:43 +00:00
|
|
|
auto writevu(uintmax_t data) -> void {
|
Update to v093r02 release.
byuu says:
Changelog:
- nall: fixed major memory leak in string class
- ruby: video shaders support #define-based settings now
- phoenix/GTK+: support > 256x256 icons for window / task bar / alt-tab
- sfc: remove random/ and config/, merge into system/
- ethos: delete higan.png (48x48), replace with higan512.png (512x512)
as new higan.png
- ethos: default gamma to 100% (no color adjustment)
- ethos: use "Video Shaders/Display Emulation/" instead of "Video
Shaders/Emulation/"
- use g++ instead of g++-4.7 (g++ -v must be >= 4.7)
- use -std=c++11 instead of -std=gnu++11
- applied a few patches from Debian upstream to make their packaging job
easier
So because colors are normalized in GLSL, I won't be able to offer video
shaders absolute color literals. We will have to perform basic color
conversion inside the core.
As such, the current plan is to create some sort of Emulator::Settings
interface. With that, I'll connect an option for color correction, which
will be on by default. For FC/SFC, that will mean gamma correction
(darker / stronger colors), and for GB/GBC/GBA, it will mean simulating
the weird brightness levels of the displays. I am undecided on whether
to use pea soup green for the GB or not. By not doing so, it'll be
easier for the display emulation shader to do it.
2013-11-09 11:45:54 +00:00
|
|
|
while(true) {
|
|
|
|
uint8_t x = data & 0x7f;
|
|
|
|
data >>= 7;
|
|
|
|
if(data == 0) return write(0x80 | x);
|
|
|
|
write(x);
|
|
|
|
data--;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-07-14 09:32:43 +00:00
|
|
|
auto writevs(intmax_t data) -> void {
|
2015-08-02 06:23:13 +00:00
|
|
|
bool negate = data < 0;
|
|
|
|
if(negate) data = ~data;
|
|
|
|
data = (data << 1) | negate;
|
Update to v093r02 release.
byuu says:
Changelog:
- nall: fixed major memory leak in string class
- ruby: video shaders support #define-based settings now
- phoenix/GTK+: support > 256x256 icons for window / task bar / alt-tab
- sfc: remove random/ and config/, merge into system/
- ethos: delete higan.png (48x48), replace with higan512.png (512x512)
as new higan.png
- ethos: default gamma to 100% (no color adjustment)
- ethos: use "Video Shaders/Display Emulation/" instead of "Video
Shaders/Emulation/"
- use g++ instead of g++-4.7 (g++ -v must be >= 4.7)
- use -std=c++11 instead of -std=gnu++11
- applied a few patches from Debian upstream to make their packaging job
easier
So because colors are normalized in GLSL, I won't be able to offer video
shaders absolute color literals. We will have to perform basic color
conversion inside the core.
As such, the current plan is to create some sort of Emulator::Settings
interface. With that, I'll connect an option for color correction, which
will be on by default. For FC/SFC, that will mean gamma correction
(darker / stronger colors), and for GB/GBC/GBA, it will mean simulating
the weird brightness levels of the displays. I am undecided on whether
to use pea soup green for the GB or not. By not doing so, it'll be
easier for the display emulation shader to do it.
2013-11-09 11:45:54 +00:00
|
|
|
writevu(data);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2013-05-02 11:25:45 +00:00
|
|
|
template<unsigned bits> struct uint_t {
|
Update to v094r09 release.
byuu says:
This will easily be the biggest diff in the history of higan. And not in
a good way.
* target-higan and target-loki have been blown away completely
* nall and ruby massively updated
* phoenix replaced with hiro (pretty near a total rewrite)
* target-higan restarted using hiro (just a window for now)
* all emulation cores updated to compile again
* installation changed to not require root privileges (installs locally)
For the foreseeable future (maybe even permanently?), the new higan UI
will only build under Linux/BSD with GTK+ 2.20+. Probably the most
likely route for Windows/OS X will be to try and figure out how to build
hiro/GTK on those platforms, as awful as that would be. The other
alternative would be to produce new UIs for those platforms ... which
would actually be a good opportunity to make something much more user
friendly.
Being that I just started on this a few hours ago, that means that for
at least a few weeks, don't expect to be able to actually play any
games. Right now, you can pretty much just compile the binary and that's
it. It's quite possible that some nall changes didn't produce
compilation errors, but will produce runtime errors. So until the UI can
actually load games, we won't know if anything is broken. But we should
mostly be okay. It was mostly just trim<1> -> trim changes, moving to
Hash::SHA256 (much cleaner), and patching some reckless memory copy
functions enough to compile.
Progress isn't going to be like it was before: I'm now dividing my time
much thinner between studying and other hobbies.
My aim this time is not to produce a binary for everyone to play games
on. Rather, it's to keep the emulator alive. I want to be able to apply
critical patches again. And I would also like the base of the emulator
to live on, for use in other emulator frontends that utilize higan.
2015-02-26 10:10:46 +00:00
|
|
|
using type_t = type_if<expression<bits <= 8 * sizeof(unsigned)>, unsigned, uintmax_t>;
|
2010-08-09 13:28:56 +00:00
|
|
|
|
2013-05-02 11:25:45 +00:00
|
|
|
inline operator type_t() const { return data; }
|
2015-07-14 09:32:43 +00:00
|
|
|
inline auto operator ++(int) { type_t r = data; data = uclip<bits>(data + 1); return r; }
|
|
|
|
inline auto operator --(int) { type_t r = data; data = uclip<bits>(data - 1); return r; }
|
|
|
|
inline auto operator ++() { return data = uclip<bits>(data + 1); }
|
|
|
|
inline auto operator --() { return data = uclip<bits>(data - 1); }
|
|
|
|
inline auto operator =(const type_t i) { return data = uclip<bits>(i); }
|
|
|
|
inline auto operator |=(const type_t i) { return data = uclip<bits>(data | i); }
|
|
|
|
inline auto operator ^=(const type_t i) { return data = uclip<bits>(data ^ i); }
|
|
|
|
inline auto operator &=(const type_t i) { return data = uclip<bits>(data & i); }
|
|
|
|
inline auto operator<<=(const type_t i) { return data = uclip<bits>(data << i); }
|
|
|
|
inline auto operator>>=(const type_t i) { return data = uclip<bits>(data >> i); }
|
|
|
|
inline auto operator +=(const type_t i) { return data = uclip<bits>(data + i); }
|
|
|
|
inline auto operator -=(const type_t i) { return data = uclip<bits>(data - i); }
|
|
|
|
inline auto operator *=(const type_t i) { return data = uclip<bits>(data * i); }
|
|
|
|
inline auto operator /=(const type_t i) { return data = uclip<bits>(data / i); }
|
|
|
|
inline auto operator %=(const type_t i) { return data = uclip<bits>(data % i); }
|
2011-09-12 10:30:44 +00:00
|
|
|
|
2013-05-02 11:25:45 +00:00
|
|
|
inline uint_t() : data(0) {}
|
|
|
|
inline uint_t(const type_t i) : data(uclip<bits>(i)) {}
|
2010-08-09 13:28:56 +00:00
|
|
|
|
2015-07-14 09:32:43 +00:00
|
|
|
template<unsigned s> inline uint_t(const uint_t<s>& i) : data(uclip<bits>(i)) {}
|
|
|
|
template<unsigned s> inline auto operator=(const uint_t<s>& i) { return data = uclip<bits>((type_t)i); }
|
2013-07-29 09:42:45 +00:00
|
|
|
|
2015-07-14 09:32:43 +00:00
|
|
|
auto serialize(serializer& s) { s(data); }
|
|
|
|
|
|
|
|
private:
|
|
|
|
type_t data;
|
2013-05-02 11:25:45 +00:00
|
|
|
};
|
2010-08-09 13:28:56 +00:00
|
|
|
|
2013-05-02 11:25:45 +00:00
|
|
|
template<unsigned bits> struct int_t {
|
Update to v094r09 release.
byuu says:
This will easily be the biggest diff in the history of higan. And not in
a good way.
* target-higan and target-loki have been blown away completely
* nall and ruby massively updated
* phoenix replaced with hiro (pretty near a total rewrite)
* target-higan restarted using hiro (just a window for now)
* all emulation cores updated to compile again
* installation changed to not require root privileges (installs locally)
For the foreseeable future (maybe even permanently?), the new higan UI
will only build under Linux/BSD with GTK+ 2.20+. Probably the most
likely route for Windows/OS X will be to try and figure out how to build
hiro/GTK on those platforms, as awful as that would be. The other
alternative would be to produce new UIs for those platforms ... which
would actually be a good opportunity to make something much more user
friendly.
Being that I just started on this a few hours ago, that means that for
at least a few weeks, don't expect to be able to actually play any
games. Right now, you can pretty much just compile the binary and that's
it. It's quite possible that some nall changes didn't produce
compilation errors, but will produce runtime errors. So until the UI can
actually load games, we won't know if anything is broken. But we should
mostly be okay. It was mostly just trim<1> -> trim changes, moving to
Hash::SHA256 (much cleaner), and patching some reckless memory copy
functions enough to compile.
Progress isn't going to be like it was before: I'm now dividing my time
much thinner between studying and other hobbies.
My aim this time is not to produce a binary for everyone to play games
on. Rather, it's to keep the emulator alive. I want to be able to apply
critical patches again. And I would also like the base of the emulator
to live on, for use in other emulator frontends that utilize higan.
2015-02-26 10:10:46 +00:00
|
|
|
using type_t = type_if<expression<bits <= 8 * sizeof(signed)>, signed, intmax_t>;
|
2010-08-09 13:28:56 +00:00
|
|
|
|
2013-05-02 11:25:45 +00:00
|
|
|
inline operator type_t() const { return data; }
|
2015-07-14 09:32:43 +00:00
|
|
|
inline auto operator ++(int) { type_t r = data; data = sclip<bits>(data + 1); return r; }
|
|
|
|
inline auto operator --(int) { type_t r = data; data = sclip<bits>(data - 1); return r; }
|
|
|
|
inline auto operator ++() { return data = sclip<bits>(data + 1); }
|
|
|
|
inline auto operator --() { return data = sclip<bits>(data - 1); }
|
|
|
|
inline auto operator =(const type_t i) { return data = sclip<bits>(i); }
|
|
|
|
inline auto operator |=(const type_t i) { return data = sclip<bits>(data | i); }
|
|
|
|
inline auto operator ^=(const type_t i) { return data = sclip<bits>(data ^ i); }
|
|
|
|
inline auto operator &=(const type_t i) { return data = sclip<bits>(data & i); }
|
|
|
|
inline auto operator<<=(const type_t i) { return data = sclip<bits>(data << i); }
|
|
|
|
inline auto operator>>=(const type_t i) { return data = sclip<bits>(data >> i); }
|
|
|
|
inline auto operator +=(const type_t i) { return data = sclip<bits>(data + i); }
|
|
|
|
inline auto operator -=(const type_t i) { return data = sclip<bits>(data - i); }
|
|
|
|
inline auto operator *=(const type_t i) { return data = sclip<bits>(data * i); }
|
|
|
|
inline auto operator /=(const type_t i) { return data = sclip<bits>(data / i); }
|
|
|
|
inline auto operator %=(const type_t i) { return data = sclip<bits>(data % i); }
|
2012-02-29 12:59:48 +00:00
|
|
|
|
2013-05-02 11:25:45 +00:00
|
|
|
inline int_t() : data(0) {}
|
|
|
|
inline int_t(const type_t i) : data(sclip<bits>(i)) {}
|
Update to v074 release.
byuu says (since v073):
This release adds full low-level emulation of the NEC uPD96050
coprocessor, used by the ST-0010 (F1 Race of Champions II) and the
ST-0011 (Hayazashi Nidan Morita Shougi). The former was already playable
with HLE, but lacked timing emulation. The latter has never been
playable through emulation before now. But as with SD Gundam GX before,
you really weren't missing much.
[...]
Also new in this release is my own Game Boy emulator. It is being used
to provide native Super Game Boy support, built directly into bsnes.
This core is released under the GPLv2, but I am willing to grant a more
permissive license for other SNES emulators, if anyone is interested.
Of course I cannot compete with the quality of gambatte, and certainly
not from only a weeks' worth of work. Currently, there is no Game
Boy-side sound output and there are quite a few bugs remaining in its
emulation core. I would appreciate any help on this, the Game Boy is not
my forte. So yes, we are taking a step back today, so that we may take
two steps forward in the future.
[...]
Lastly, the debugger is still Linux-only, but it is now stable enough to
be considered usable. Check it out if you like, compile with -DDEBUGGER
to enable it.
2011-01-11 10:30:47 +00:00
|
|
|
|
2015-07-14 09:32:43 +00:00
|
|
|
template<unsigned s> inline int_t(const int_t<s>& i) : data(sclip<bits>(i)) {}
|
|
|
|
template<unsigned s> inline auto operator=(const int_t<s>& i) { return data = sclip<bits>((type_t)i); }
|
2013-07-29 09:42:45 +00:00
|
|
|
|
2015-07-14 09:32:43 +00:00
|
|
|
auto serialize(serializer& s) { s(data); }
|
Update to v074 release.
byuu says (since v073):
This release adds full low-level emulation of the NEC uPD96050
coprocessor, used by the ST-0010 (F1 Race of Champions II) and the
ST-0011 (Hayazashi Nidan Morita Shougi). The former was already playable
with HLE, but lacked timing emulation. The latter has never been
playable through emulation before now. But as with SD Gundam GX before,
you really weren't missing much.
[...]
Also new in this release is my own Game Boy emulator. It is being used
to provide native Super Game Boy support, built directly into bsnes.
This core is released under the GPLv2, but I am willing to grant a more
permissive license for other SNES emulators, if anyone is interested.
Of course I cannot compete with the quality of gambatte, and certainly
not from only a weeks' worth of work. Currently, there is no Game
Boy-side sound output and there are quite a few bugs remaining in its
emulation core. I would appreciate any help on this, the Game Boy is not
my forte. So yes, we are taking a step back today, so that we may take
two steps forward in the future.
[...]
Lastly, the debugger is still Linux-only, but it is now stable enough to
be considered usable. Check it out if you like, compile with -DDEBUGGER
to enable it.
2011-01-11 10:30:47 +00:00
|
|
|
|
2013-05-02 11:25:45 +00:00
|
|
|
private:
|
|
|
|
type_t data;
|
2015-07-14 09:32:43 +00:00
|
|
|
};
|
2013-05-02 11:25:45 +00:00
|
|
|
|
2015-07-14 09:32:43 +00:00
|
|
|
template<typename type_t> struct varuint_t {
|
2013-05-02 11:25:45 +00:00
|
|
|
inline operator type_t() const { return data; }
|
2015-07-14 09:32:43 +00:00
|
|
|
inline auto operator ++(int) { type_t r = data; data = (data + 1) & mask; return r; }
|
|
|
|
inline auto operator --(int) { type_t r = data; data = (data - 1) & mask; return r; }
|
|
|
|
inline auto operator ++() { return data = (data + 1) & mask; }
|
|
|
|
inline auto operator --() { return data = (data - 1) & mask; }
|
|
|
|
inline auto operator =(const type_t i) { return data = (i) & mask; }
|
|
|
|
inline auto operator |=(const type_t i) { return data = (data | i) & mask; }
|
|
|
|
inline auto operator ^=(const type_t i) { return data = (data ^ i) & mask; }
|
|
|
|
inline auto operator &=(const type_t i) { return data = (data & i) & mask; }
|
|
|
|
inline auto operator<<=(const type_t i) { return data = (data << i) & mask; }
|
|
|
|
inline auto operator>>=(const type_t i) { return data = (data >> i) & mask; }
|
|
|
|
inline auto operator +=(const type_t i) { return data = (data + i) & mask; }
|
|
|
|
inline auto operator -=(const type_t i) { return data = (data - i) & mask; }
|
|
|
|
inline auto operator *=(const type_t i) { return data = (data * i) & mask; }
|
|
|
|
inline auto operator /=(const type_t i) { return data = (data / i) & mask; }
|
|
|
|
inline auto operator %=(const type_t i) { return data = (data % i) & mask; }
|
|
|
|
|
|
|
|
inline auto bits(type_t bits) { mask = (1ull << (bits - 1)) + ((1ull << (bits - 1)) - 1); data &= mask; }
|
2013-05-02 11:25:45 +00:00
|
|
|
inline varuint_t() : data(0ull), mask((type_t)~0ull) {}
|
|
|
|
inline varuint_t(const type_t i) : data(i), mask((type_t)~0ull) {}
|
2013-07-29 09:42:45 +00:00
|
|
|
|
2015-07-14 09:32:43 +00:00
|
|
|
auto serialize(serializer& s) { s(data); s(mask); }
|
|
|
|
|
|
|
|
private:
|
|
|
|
type_t data;
|
|
|
|
type_t mask;
|
2013-05-02 11:25:45 +00:00
|
|
|
};
|
Update to v087r30 release.
byuu says:
Changelog:
- DMA channel masks added (some are 27-bit source/target and some are
14-bit length -- hooray, varuint_t class.)
- No more state.pending flags. Instead, we set dma.pending flag when we
want a transfer (fixes GBA Video - Pokemon audio) [Cydrak]
- fixed OBJ Vmosaic [Cydrak, krom]
- OBJ cannot read <=0x13fff in BG modes 3-5 (fixes the garbled tile at
the top-left of some games)
- DMA timing should be much closer to hardware now, but probably not
perfect
- PPU frame blending uses blargg's bit-perfect, rounded method (slower,
but what can you do?)
- GBA carts really unload now
- added nall/gba/cartridge.hpp: used when there is no manifest. Scans
ROMs for library tags, and selects the first valid one found
- added EEPROM auto-detection when EEPROM size=0. Forces disk/save state
size to 8192 (otherwise states could crash between pre and post
detect.)
- detects first read after a set read address command when the size
is zero, and sets all subsequent bit-lengths to that value, prints
detected size to terminal
- added nall/nes/cartridge.hpp: moves iNES detection out of emulation
core.
Important to note: long-term goal is to remove all
nall/(system)/cartridge.hpp detections from the core and replace with
databases. All in good time.
Anyway, the GBA workarounds should work for ~98.5% of the library, if my
pre-scanning was correct (~40 games with odd tags. I reject ones without
numeric versions now, too.)
I think we're basically at a point where we can release a new version
now. Compatibility should be relatively high (at least for a first
release), and fixes are only going to affect one or two games at a time.
I'd like to start doing some major cleaning house internally (rename
NES->Famicom, SNES->SuperFamicom and such.) Would be much wiser to do
that on a .01 WIP to minimize regressions.
The main problems with a release now:
- speed is pretty bad, haven't really optimized much yet (not sure how
much we can improve it yet, this usually isn't easy)
- sound isn't -great-, but the GBA audio sucks anyway :P
- couple of known bugs (Sonic X video, etc.)
2012-04-22 10:49:19 +00:00
|
|
|
|
2010-08-09 13:28:56 +00:00
|
|
|
}
|
|
|
|
|
2015-11-10 11:02:29 +00:00
|
|
|
using int1 = nall::int_t<1>;
|
|
|
|
using int2 = nall::int_t<2>;
|
|
|
|
using int3 = nall::int_t<3>;
|
|
|
|
using int4 = nall::int_t<4>;
|
|
|
|
using int5 = nall::int_t<5>;
|
|
|
|
using int6 = nall::int_t<6>;
|
|
|
|
using int7 = nall::int_t<7>;
|
2015-11-16 08:38:05 +00:00
|
|
|
|
2015-11-10 11:02:29 +00:00
|
|
|
using int9 = nall::int_t<9>;
|
|
|
|
using int10 = nall::int_t<10>;
|
|
|
|
using int11 = nall::int_t<11>;
|
|
|
|
using int12 = nall::int_t<12>;
|
|
|
|
using int13 = nall::int_t<13>;
|
|
|
|
using int14 = nall::int_t<14>;
|
|
|
|
using int15 = nall::int_t<15>;
|
2015-11-16 08:38:05 +00:00
|
|
|
|
2015-11-10 11:02:29 +00:00
|
|
|
using int17 = nall::int_t<17>;
|
|
|
|
using int18 = nall::int_t<18>;
|
|
|
|
using int19 = nall::int_t<19>;
|
|
|
|
using int20 = nall::int_t<20>;
|
|
|
|
using int21 = nall::int_t<21>;
|
|
|
|
using int22 = nall::int_t<22>;
|
|
|
|
using int23 = nall::int_t<23>;
|
|
|
|
using int24 = nall::int_t<24>;
|
|
|
|
using int25 = nall::int_t<25>;
|
|
|
|
using int26 = nall::int_t<26>;
|
|
|
|
using int27 = nall::int_t<27>;
|
|
|
|
using int28 = nall::int_t<28>;
|
|
|
|
using int29 = nall::int_t<29>;
|
|
|
|
using int30 = nall::int_t<30>;
|
|
|
|
using int31 = nall::int_t<31>;
|
2015-11-16 08:38:05 +00:00
|
|
|
|
2015-11-10 11:02:29 +00:00
|
|
|
using int33 = nall::int_t<33>;
|
|
|
|
using int34 = nall::int_t<34>;
|
|
|
|
using int35 = nall::int_t<35>;
|
|
|
|
using int36 = nall::int_t<36>;
|
|
|
|
using int37 = nall::int_t<37>;
|
|
|
|
using int38 = nall::int_t<38>;
|
|
|
|
using int39 = nall::int_t<39>;
|
|
|
|
using int40 = nall::int_t<40>;
|
|
|
|
using int41 = nall::int_t<41>;
|
|
|
|
using int42 = nall::int_t<42>;
|
|
|
|
using int43 = nall::int_t<43>;
|
|
|
|
using int44 = nall::int_t<44>;
|
|
|
|
using int45 = nall::int_t<45>;
|
|
|
|
using int46 = nall::int_t<46>;
|
|
|
|
using int47 = nall::int_t<47>;
|
|
|
|
using int48 = nall::int_t<48>;
|
|
|
|
using int49 = nall::int_t<49>;
|
|
|
|
using int50 = nall::int_t<50>;
|
|
|
|
using int51 = nall::int_t<51>;
|
|
|
|
using int52 = nall::int_t<52>;
|
|
|
|
using int53 = nall::int_t<53>;
|
|
|
|
using int54 = nall::int_t<54>;
|
|
|
|
using int55 = nall::int_t<55>;
|
|
|
|
using int56 = nall::int_t<56>;
|
|
|
|
using int57 = nall::int_t<57>;
|
|
|
|
using int58 = nall::int_t<58>;
|
|
|
|
using int59 = nall::int_t<59>;
|
|
|
|
using int60 = nall::int_t<60>;
|
|
|
|
using int61 = nall::int_t<61>;
|
|
|
|
using int62 = nall::int_t<62>;
|
|
|
|
using int63 = nall::int_t<63>;
|
|
|
|
|
|
|
|
using uint1 = nall::uint_t<1>;
|
|
|
|
using uint2 = nall::uint_t<2>;
|
|
|
|
using uint3 = nall::uint_t<3>;
|
|
|
|
using uint4 = nall::uint_t<4>;
|
|
|
|
using uint5 = nall::uint_t<5>;
|
|
|
|
using uint6 = nall::uint_t<6>;
|
|
|
|
using uint7 = nall::uint_t<7>;
|
2015-11-16 08:38:05 +00:00
|
|
|
|
2015-11-10 11:02:29 +00:00
|
|
|
using uint9 = nall::uint_t<9>;
|
|
|
|
using uint10 = nall::uint_t<10>;
|
|
|
|
using uint11 = nall::uint_t<11>;
|
|
|
|
using uint12 = nall::uint_t<12>;
|
|
|
|
using uint13 = nall::uint_t<13>;
|
|
|
|
using uint14 = nall::uint_t<14>;
|
|
|
|
using uint15 = nall::uint_t<15>;
|
2015-11-16 08:38:05 +00:00
|
|
|
|
2015-11-10 11:02:29 +00:00
|
|
|
using uint17 = nall::uint_t<17>;
|
|
|
|
using uint18 = nall::uint_t<18>;
|
|
|
|
using uint19 = nall::uint_t<19>;
|
|
|
|
using uint20 = nall::uint_t<20>;
|
|
|
|
using uint21 = nall::uint_t<21>;
|
|
|
|
using uint22 = nall::uint_t<22>;
|
|
|
|
using uint23 = nall::uint_t<23>;
|
|
|
|
using uint24 = nall::uint_t<24>;
|
|
|
|
using uint25 = nall::uint_t<25>;
|
|
|
|
using uint26 = nall::uint_t<26>;
|
|
|
|
using uint27 = nall::uint_t<27>;
|
|
|
|
using uint28 = nall::uint_t<28>;
|
|
|
|
using uint29 = nall::uint_t<29>;
|
|
|
|
using uint30 = nall::uint_t<30>;
|
|
|
|
using uint31 = nall::uint_t<31>;
|
2015-11-16 08:38:05 +00:00
|
|
|
|
2015-11-10 11:02:29 +00:00
|
|
|
using uint33 = nall::uint_t<33>;
|
|
|
|
using uint34 = nall::uint_t<34>;
|
|
|
|
using uint35 = nall::uint_t<35>;
|
|
|
|
using uint36 = nall::uint_t<36>;
|
|
|
|
using uint37 = nall::uint_t<37>;
|
|
|
|
using uint38 = nall::uint_t<38>;
|
|
|
|
using uint39 = nall::uint_t<39>;
|
|
|
|
using uint40 = nall::uint_t<40>;
|
|
|
|
using uint41 = nall::uint_t<41>;
|
|
|
|
using uint42 = nall::uint_t<42>;
|
|
|
|
using uint43 = nall::uint_t<43>;
|
|
|
|
using uint44 = nall::uint_t<44>;
|
|
|
|
using uint45 = nall::uint_t<45>;
|
|
|
|
using uint46 = nall::uint_t<46>;
|
|
|
|
using uint47 = nall::uint_t<47>;
|
|
|
|
using uint48 = nall::uint_t<48>;
|
|
|
|
using uint49 = nall::uint_t<49>;
|
|
|
|
using uint50 = nall::uint_t<50>;
|
|
|
|
using uint51 = nall::uint_t<51>;
|
|
|
|
using uint52 = nall::uint_t<52>;
|
|
|
|
using uint53 = nall::uint_t<53>;
|
|
|
|
using uint54 = nall::uint_t<54>;
|
|
|
|
using uint55 = nall::uint_t<55>;
|
|
|
|
using uint56 = nall::uint_t<56>;
|
|
|
|
using uint57 = nall::uint_t<57>;
|
|
|
|
using uint58 = nall::uint_t<58>;
|
|
|
|
using uint59 = nall::uint_t<59>;
|
|
|
|
using uint60 = nall::uint_t<60>;
|
|
|
|
using uint61 = nall::uint_t<61>;
|
|
|
|
using uint62 = nall::uint_t<62>;
|
|
|
|
using uint63 = nall::uint_t<63>;
|
Update to v085r08 release.
byuu says:
Changelog:
- follow the Laevateinn topic to get most of it
- also added NMI, IRQ step buttons to CPU debugger
- also added trace masking + trace mask reset
- also added memory export
- cartridge loading is entirely folder-based now
FitzRoy, I'll go ahead and make a second compromise with you for v086:
I'll match the following:
/path/to/SNES.sfc/*.sfc
/path/to/NES.fc/*.prg, *.chr (split format)
/path/to/NES.fc/*.fc (merged format)
/path/to/GB.gb/*.gb
/path/to/GBC.gbc/*.gbc
Condition will be that there can only be one of each file. If there's
more than one, it'll abort. That lets me name my ROMs as
"Game.fc/Game.fc", and you can name yours as "Game.fc/cartridge.prg,
cartridge.chr". Or whatever you want.
We'll just go with that, see what fares out as the most popular, and
then restrict it back to that method.
The folder must have the .fc, etc extension though. That will be how we
avoid false-positive folder matches.
[Editor's note - the Laevateinn topic mentions these changes for
v085r08:
Added SMP/PPU breakpoints, SMP debugger, SMP stepping / tracing,
memory editing on APU-bus / VRAM / OAM / CGRAM, save state menu,
WRAM mirroring on breakpoints, protected MMIO memory regions
(otherwise, viewing $002100 could crash your game.)
Major missing components:
- trace mask
- trace mask clear / usage map clear
- window geometry caching / sizing improvements
- VRAM viewer
- properties viewer
- working memory export button
The rest will most likely appear after v086 is released.
]
2012-02-12 05:35:40 +00:00
|
|
|
|
2010-08-09 13:28:56 +00:00
|
|
|
#endif
|