Update to v106r83 release.

byuu says:

Changelog:

  - reverted nall/inline-if.hpp usage for now, since the
    nall/primitives.hpp math operators still cast to (u)int64_t
  - improved nall/primitives.hpp more; integer8 x = -128; print(-x) will
    now print 128 (unary operator+ and - cast to (u)int64_t)
  - renamed processor/lr35902 to processor/sm83; after the Sharp SM83
    CPU core [gekkio discovered the name]
  - a few bugfixes to the TLCS900H CPU core
  - completed the disassembler for the TLCS900H core

As a result of reverting most of the inline if stuff, I guess the
testing priority has been reduced. Which is probably a good thing,
considering I seem to have a smaller pool of testers these days.

Indeed, the TLCS900H core has ended up at 131KiB compared to the M68000
core at 128KiB. So it's now the largest CPU core in all of higan. It's
even more ridiculous because the M68000 core would ordinarily be quite a
bit smaller, had I not gone overboard with the extreme templating to
reduce instruction decoding overhead (you kind of have to do this for
RISC CPUs, and the inverted design of the TLCS900H kind of makes it
infeasible to do the same there.)

This CPU core is bound to have dozens of extremely difficult CPU bugs,
and there's no easy way for me to test them. I would greatly appreciate
any help in looking over the core for bugs. A fresh pair of eyes to spot
a mistake could save me up to several days of tedious debugging work.

The core still isn't ready to actually be tested: I have to hook up
cartridge loading, a memory bus, interrupts, timers, and the micro DMA
controller before it's likely that anything happens at all.
This commit is contained in:
Tim Allen
2019-01-19 12:34:17 +11:00
parent 2d9ce59e99
commit 37b610da53
48 changed files with 1213 additions and 915 deletions

View File

@@ -2,18 +2,18 @@
namespace nall {
template<int Requested> struct BitRange {
enum : uint { Precision = Requested < 1 ? 1 : Requested > 64 ? 64 : Requested };
template<int Precision> struct BitRange {
static_assert(Precision >= 1 && Precision <= 64);
static inline constexpr auto bits() -> uint { return Precision; }
using type =
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;
static inline constexpr auto mask() -> type { return ~0ull >> 64 - bits(); }
static inline constexpr auto mask() -> utype { return ~0ull >> 64 - bits(); }
inline BitRange(type& source, int lo, int hi) : source(source) {
inline BitRange(utype& source, int lo, int hi) : source(source) {
if(lo < 0) lo = Precision + lo;
if(hi < 0) hi = Precision + hi;
if(lo > hi) swap(lo, hi);
@@ -28,7 +28,7 @@ template<int Requested> struct BitRange {
inline auto& operator++() { return set(get() + 1); }
inline auto& operator--() { return set(get() - 1); }
inline operator type() const { return get(); }
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); }
@@ -42,20 +42,20 @@ template<int Requested> struct BitRange {
template<typename T> inline auto& operator |=(const T& value) { return set(get() | value); }
private:
inline auto get() const -> type {
const type rangeBits = hi - lo + 1;
const type rangeMask = (1ull << rangeBits) - 1 << lo & mask();
inline auto get() const -> utype {
const utype rangeBits = hi - lo + 1;
const utype rangeMask = (1ull << rangeBits) - 1 << lo & mask();
return (source & rangeMask) >> lo;
}
inline auto& set(const type& value) {
const type rangeBits = hi - lo + 1;
const type rangeMask = (1ull << rangeBits) - 1 << lo & mask();
inline auto& set(const utype& value) {
const utype rangeBits = hi - lo + 1;
const utype rangeMask = (1ull << rangeBits) - 1 << lo & mask();
source = source & ~rangeMask | value << lo & rangeMask;
return *this;
}
type& source;
utype& source;
uint lo;
uint hi;
};