Update to v098r18 release.

byuu says:

Changelog:
- hiro: fixed the BrowserDialog column resizing when navigating to new
  folders (prevents clipping of filenames)
  - note: this is kind of a quick-fix; but I have a good idea how to do
    the proper fix now
- nall: added BitField<T, Lo, Hi> class
  - note: not yet working on the SFC CPU class; need to go at it with
    a debugger to find out what's happening
- GB: emulated DMG/SGB STAT IRQ bug; fixes Zerd no Densetsu and Road Rash
  (won't fix anything else; don't get hopes up)
This commit is contained in:
Tim Allen 2016-06-07 21:55:03 +10:00
parent 9b452c9f5f
commit b08449215a
8 changed files with 103 additions and 38 deletions

View File

@ -9,7 +9,7 @@ using namespace nall;
namespace Emulator {
static const string Name = "higan";
static const string Version = "098.17";
static const string Version = "098.18";
static const string Author = "byuu";
static const string License = "GPLv3";
static const string Website = "http://byuu.org/";

View File

@ -139,6 +139,12 @@ auto PPU::mmio_write(uint16 addr, uint8 data) -> void {
status.interrupt_oam = data & 0x20;
status.interrupt_vblank = data & 0x10;
status.interrupt_hblank = data & 0x08;
//hardware bug: writes to STAT on DMG,SGB during blanking triggers STAT IRQ
if(!system.cgb() && status.mode < 2) {
cpu.raise(CPU::Interrupt::Stat);
}
return;
}

View File

@ -9,7 +9,9 @@ L readPC();
auto R65816::op_xba() {
io();
L io();
swap(r.a.l, r.a.h);
r.a.l ^= r.a.h;
r.a.h ^= r.a.l;
r.a.l ^= r.a.h;
r.p.n = (r.a.l & 0x80);
r.p.z = (r.a.l == 0);
}

View File

@ -23,6 +23,8 @@ struct Flags {
struct reg16 {
union {
uint16_t w = 0;
//BitField<uint16_t, 0, 7> l;
//BitField<uint16_t, 8, 15> h;
struct { uint8_t order_lsb2(l, h); };
};
@ -43,6 +45,12 @@ struct reg16 {
struct reg24 {
union {
uint32_t d = 0;
//BitField<uint32_t, 0, 15> w;
//BitField<uint32_t, 16, 31> wh;
//BitField<uint32_t, 0, 7> l;
//BitField<uint32_t, 8, 15> h;
//BitField<uint32_t, 16, 23> b;
//BitField<uint32_t, 24, 31> bh;
struct { uint16_t order_lsb2(w, wh); };
struct { uint8_t order_lsb4(l, h, b, bh); };
};

View File

@ -181,6 +181,7 @@ auto BrowserDialogWindow::setPath(string path) -> void {
}
Application::processEvents();
view->resizeColumns(); //todo: on Windows, adding items may add vertical scrollbar; this hack corrects column width
view.setFocused().doChange();
}

View File

@ -46,6 +46,7 @@ auto pTableView::destruct() -> void {
}
auto pTableView::append(sTableViewHeader header) -> void {
resizeColumns();
}
auto pTableView::append(sTableViewItem item) -> void {

View File

@ -49,12 +49,12 @@ namespace bit {
}
//clear_lowest(0b1110) == 0b1100
constexpr inline auto clear_lowest(const uintmax x) -> uintmax {
constexpr inline auto clearLowest(const uintmax x) -> uintmax {
return x & (x - 1);
}
//set_lowest(0b0101) == 0b0111
constexpr inline auto set_lowest(const uintmax x) -> uintmax {
constexpr inline auto setLowest(const uintmax x) -> uintmax {
return x | (x + 1);
}

View File

@ -5,6 +5,52 @@
namespace nall {
template<typename Type, uint Lo, uint Hi> struct BitField {
static_assert(Lo <= Hi, "");
static_assert(Hi < sizeof(Type) * 8, "");
inline BitField() = default;
inline BitField(const BitField& value) { set(value.data); }
template<typename T> inline BitField(const T& value) { set(value << Lo); }
//inline explicit operator bool() const { return data & Mask; }
inline operator Type() const { return get(); }
inline auto& operator=(const BitField& value) { return set(value.data); }
template<typename T> inline auto& operator=(const T& value) { return set(value << Lo); }
inline auto operator++(int) { Type value = get(); set(data + (1 << Lo)); return value; }
inline auto operator--(int) { Type value = get(); set(data - (1 << Lo)); return value; }
inline auto& operator++() { return set(data + (1 << Lo)); }
inline auto& operator--() { return set(data - (1 << Lo)); }
inline auto& operator &=(const Type value) { return set(data & (value << Lo)); }
inline auto& operator |=(const Type value) { return set(data | (value << Lo)); }
inline auto& operator ^=(const Type value) { return set(data ^ (value << Lo)); }
inline auto& operator<<=(const Type value) { return set(data << value); }
inline auto& operator>>=(const Type value) { return set(data >> value); }
inline auto& operator +=(const Type value) { return set(data + (value << Lo)); }
inline auto& operator -=(const Type value) { return set(data - (value << Lo)); }
inline auto& operator *=(const Type value) { return set((get() * value) << Lo); }
inline auto& operator /=(const Type value) { return set((get() / value) << Lo); }
inline auto& operator %=(const Type value) { return set((get() % value) << Lo); }
private:
enum : uint { Bits = Hi - Lo + 1 };
enum : uint { Mask = ((1ull << Bits) - 1) << Lo };
Type data;
inline auto get() const -> Type {
return (data & Mask) >> Lo;
}
inline auto set(Type value) -> BitField& {
data = (data & ~Mask) | (value & Mask);
return *this;
}
};
struct Boolean {
inline Boolean() : data(false) {}
template<typename T> inline Boolean(const T& value) : data(value) {}
@ -29,27 +75,27 @@ template<uint Bits> struct Natural {
enum : type { Mask = ~0ull >> (64 - Bits) };
inline Natural() : data(0) {}
template<typename T> inline Natural(const T& value) { assign(value); }
template<typename T> inline Natural(const T& value) { set(value); }
inline operator type() const { return data; }
template<typename T> inline auto& operator=(const T& value) { assign(value); return *this; }
template<typename T> inline auto& operator=(const T& value) { set(value); return *this; }
inline auto operator++(int) { type value = data; assign(data + 1); return value; }
inline auto operator--(int) { type value = data; assign(data - 1); return value; }
inline auto operator++(int) { type value = data; set(data + 1); return value; }
inline auto operator--(int) { type value = data; set(data - 1); return value; }
inline auto& operator++() { assign(data + 1); return *this; }
inline auto& operator--() { assign(data - 1); return *this; }
inline auto& operator++() { set(data + 1); return *this; }
inline auto& operator--() { set(data - 1); return *this; }
inline auto& operator &=(const type value) { assign(data & value); return *this; }
inline auto& operator |=(const type value) { assign(data | value); return *this; }
inline auto& operator ^=(const type value) { assign(data ^ value); return *this; }
inline auto& operator<<=(const type value) { assign(data << value); return *this; }
inline auto& operator>>=(const type value) { assign(data >> value); return *this; }
inline auto& operator +=(const type value) { assign(data + value); return *this; }
inline auto& operator -=(const type value) { assign(data - value); return *this; }
inline auto& operator *=(const type value) { assign(data * value); return *this; }
inline auto& operator /=(const type value) { assign(data / value); return *this; }
inline auto& operator %=(const type value) { assign(data % value); return *this; }
inline auto& operator &=(const type value) { set(data & value); return *this; }
inline auto& operator |=(const type value) { set(data | value); return *this; }
inline auto& operator ^=(const type value) { set(data ^ value); return *this; }
inline auto& operator<<=(const type value) { set(data << value); return *this; }
inline auto& operator>>=(const type value) { set(data >> value); return *this; }
inline auto& operator +=(const type value) { set(data + value); return *this; }
inline auto& operator -=(const type value) { set(data - value); return *this; }
inline auto& operator *=(const type value) { set(data * value); return *this; }
inline auto& operator /=(const type value) { set(data / value); return *this; }
inline auto& operator %=(const type value) { set(data % value); return *this; }
inline auto serialize(serializer& s) { s(data); }
@ -92,7 +138,7 @@ template<uint Bits> struct Natural {
}
private:
auto assign(type value) -> void {
auto set(type value) -> void {
data = value & Mask;
}
@ -111,27 +157,27 @@ template<uint Bits> struct Integer {
enum : utype { Mask = ~0ull >> (64 - Bits), Sign = 1ull << (Bits - 1) };
inline Integer() : data(0) {}
template<typename T> inline Integer(const T& value) { assign(value); }
template<typename T> inline Integer(const T& value) { set(value); }
inline operator type() const { return data; }
template<typename T> inline auto& operator=(const T& value) { assign(value); return *this; }
template<typename T> inline auto& operator=(const T& value) { set(value); return *this; }
inline auto operator++(int) { type value = data; assign(data + 1); return value; }
inline auto operator--(int) { type value = data; assign(data - 1); return value; }
inline auto operator++(int) { type value = data; set(data + 1); return value; }
inline auto operator--(int) { type value = data; set(data - 1); return value; }
inline auto& operator++() { assign(data + 1); return *this; }
inline auto& operator--() { assign(data - 1); return *this; }
inline auto& operator++() { set(data + 1); return *this; }
inline auto& operator--() { set(data - 1); return *this; }
inline auto& operator &=(const type value) { assign(data & value); return *this; }
inline auto& operator |=(const type value) { assign(data | value); return *this; }
inline auto& operator ^=(const type value) { assign(data ^ value); return *this; }
inline auto& operator<<=(const type value) { assign(data << value); return *this; }
inline auto& operator>>=(const type value) { assign(data >> value); return *this; }
inline auto& operator +=(const type value) { assign(data + value); return *this; }
inline auto& operator -=(const type value) { assign(data - value); return *this; }
inline auto& operator *=(const type value) { assign(data * value); return *this; }
inline auto& operator /=(const type value) { assign(data / value); return *this; }
inline auto& operator %=(const type value) { assign(data % value); return *this; }
inline auto& operator &=(const type value) { set(data & value); return *this; }
inline auto& operator |=(const type value) { set(data | value); return *this; }
inline auto& operator ^=(const type value) { set(data ^ value); return *this; }
inline auto& operator<<=(const type value) { set(data << value); return *this; }
inline auto& operator>>=(const type value) { set(data >> value); return *this; }
inline auto& operator +=(const type value) { set(data + value); return *this; }
inline auto& operator -=(const type value) { set(data - value); return *this; }
inline auto& operator *=(const type value) { set(data * value); return *this; }
inline auto& operator /=(const type value) { set(data / value); return *this; }
inline auto& operator %=(const type value) { set(data % value); return *this; }
inline auto serialize(serializer& s) { s(data); }
@ -174,7 +220,7 @@ template<uint Bits> struct Integer {
}
private:
auto assign(type value) -> void {
auto set(type value) -> void {
data = ((value & Mask) ^ Sign) - Sign;
}
@ -208,6 +254,7 @@ template<uint Bits> struct Real {
inline auto serialize(serializer& s) { s(data); }
private:
type data;
};