--- nono/m680x0/m680x0.h 2026/04/29 17:05:30 1.1.1.1 +++ nono/m680x0/m680x0.h 2026/04/29 17:05:57 1.1.1.3 @@ -52,10 +52,10 @@ struct m680x0FPUType bool Is4060FPU() const noexcept { return (type & M680x0) != 0; } bool Is6888x() const noexcept { return (type & M6888x) != 0; } }; -static inline bool operator==(const m680x0FPUType& a, const m680x0FPUType& b) { +inline bool operator==(const m680x0FPUType& a, const m680x0FPUType& b) { return (a.type == b.type); } -static inline bool operator!=(const m680x0FPUType& a, const m680x0FPUType& b) { +inline bool operator!=(const m680x0FPUType& a, const m680x0FPUType& b) { return !(a == b); } @@ -127,11 +127,11 @@ struct M68030 { // SSW static constexpr uint32 SSW_SIZE(uint32 x) { return ((x) & 0x03) << 4; } - static const uint32 SSW_SIZE_LONG = (0 << 4); - static const uint32 SSW_SIZE_BYTE = (1 << 4); - static const uint32 SSW_SIZE_WORD = (2 << 4); - static const uint32 SSW_SIZE_3BYTES = (3 << 4); - static const uint32 SSW_SIZE_MASK = (0x03 << 4); + static const uint32 SSW_SIZE_LONG = (0U << 4); + static const uint32 SSW_SIZE_BYTE = (1U << 4); + static const uint32 SSW_SIZE_WORD = (2U << 4); + static const uint32 SSW_SIZE_3BYTES = (3U << 4); + static const uint32 SSW_SIZE_MASK = (0x03U << 4); static const uint32 SSW_FC_MASK = 0x0007; // FC_* static const uint32 SSW_RW = 0x0040; // SSW_BUS_{R,W} @@ -166,7 +166,7 @@ struct M68040 // SSW static const uint32 SSW_TM_MASK = 0x0007; static const uint32 SSW_TT_MASK = 0x0018; - static const uint32 SSW_SIZE_MASK = 0x0060; // (0x03 << 5) + static const uint32 SSW_SIZE_MASK = 0x0060; // (0x03U << 5) static const uint32 SSW_RW = 0x0100; static const uint32 SSW_LK = 0x0200; static const uint32 SSW_ATC = 0x0400; @@ -176,10 +176,10 @@ struct M68040 static const uint32 SSW_CU = 0x4000; static const uint32 SSW_CP = 0x8000; - static const uint32 SSW_SIZE_LONG = (0x00 << 5); - static const uint32 SSW_SIZE_BYTE = (0x01 << 5); - static const uint32 SSW_SIZE_WORD = (0x02 << 5); - static const uint32 SSW_SIZE_LINE = (0x03 << 5); + static const uint32 SSW_SIZE_LONG = (0x00U << 5); + static const uint32 SSW_SIZE_BYTE = (0x01U << 5); + static const uint32 SSW_SIZE_WORD = (0x02U << 5); + static const uint32 SSW_SIZE_LINE = (0x03U << 5); // バイトサイズから SSW_SIZE フィールドを作成する。1, 2, 4 バイトのみ。 static constexpr uint32 SSW_SIZE(uint32 x) { return ((x) & 0x03) << 5; } @@ -370,15 +370,9 @@ struct m68kreg // バス状態 struct m68kbus { - // 論理アドレス。(R/W, FC2-0, Addr すべて使用) + // 論理アドレス。(サイズ, R/W, FC2-0, Addr すべて使用) busaddr laddr; - // 対応する物理アドレス (FC2, Addr のみ使用) - busaddr paddr; - - // アクセスサイズ (バイト数で表す) - uint32 size; - // データバス。 // 今の所書き込みだけで使う。読み込みデータは戻り値のみ。 uint32 data; @@ -394,9 +388,6 @@ struct m68kbus // Supervisor アクセスなら true を返す bool IsSuper() const { return laddr.IsSuper(); } - - // バスが Write なら true を返す - bool IsWrite() const { return laddr.IsWrite(); } }; // 仮