mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-08-16 08:54:29 +02:00
Update to v106r85 release.
byuu says: The bad instruction was due to the instruction before it fetching one too many bytes. Didn't notice right away as the disassembler got it right. The register map was incorrect on the active 16-bit flags. I fixed and improved some other things along those lines. Hooked up some basic KnGE (VPU) timings, made it print out VRAM and some of the WRAM onto the screen each frame, tried to drive Vblank and Hblank IRQs, but ... I don't know for sure what vector addresses they belong to. MAME says "INT4" for Vblank, and says nothing for Hblank. I am wildly guessing INT4==SWI 4==0xffff10, but ... I have no idea. I'm also not emulating the interrupts properly based on line levels, I'm just firing on the 0→1 transitions. Sounds like Vblank is more nuanced too, but I guess we'll see. Emulation is running further along now, even to the point of it successfully enabling the KnGE IRQs, but VRAM doesn't appear to get much useful stuff written into it yet. I reverted the nall/primitive changes, so request for testing is I guess rescinded, for whatever it was worth.
This commit is contained in:
@@ -2,15 +2,18 @@
|
||||
|
||||
namespace nall {
|
||||
|
||||
//warning: so that BitRange can modify the underlying number directly, it must bind a reference.
|
||||
//as a result, auto value = number.bits() will capture by-reference, rather than by-value.
|
||||
|
||||
template<int Precision> struct BitRange {
|
||||
static_assert(Precision >= 1 && Precision <= 64);
|
||||
static inline constexpr auto bits() -> uint { return Precision; }
|
||||
using utype =
|
||||
typename conditional<bits() <= 8, uint8_t,
|
||||
typename conditional<bits() <= 16, uint16_t,
|
||||
typename conditional<bits() <= 32, uint32_t,
|
||||
typename conditional<bits() <= 64, uint64_t,
|
||||
void>::type>::type>::type>::type;
|
||||
conditional_t<bits() <= 8, uint8_t,
|
||||
conditional_t<bits() <= 16, uint16_t,
|
||||
conditional_t<bits() <= 32, uint32_t,
|
||||
conditional_t<bits() <= 64, uint64_t,
|
||||
void>>>>;
|
||||
static inline constexpr auto mask() -> utype { return ~0ull >> 64 - bits(); }
|
||||
|
||||
inline BitRange(utype& source, int lo, int hi) : source(source) {
|
||||
@@ -22,13 +25,14 @@ template<int Precision> struct BitRange {
|
||||
}
|
||||
inline auto& operator=(BitRange& source) { return set(source.get()); }
|
||||
|
||||
inline operator utype() const { return get(); }
|
||||
|
||||
inline auto operator++(int) { auto value = get(); set(value + 1); return value; }
|
||||
inline auto operator--(int) { auto value = get(); set(value - 1); return value; }
|
||||
|
||||
inline auto& operator++() { return set(get() + 1); }
|
||||
inline auto& operator--() { return set(get() - 1); }
|
||||
|
||||
inline operator utype() const { return get(); }
|
||||
template<typename T> inline auto& operator =(const T& value) { return set( value); }
|
||||
template<typename T> inline auto& operator *=(const T& value) { return set(get() * value); }
|
||||
template<typename T> inline auto& operator /=(const T& value) { return set(get() / value); }
|
||||
|
Reference in New Issue
Block a user