diff --git a/src/devices/cpu/sparc/sparcdasm.cpp b/src/devices/cpu/sparc/sparcdasm.cpp index a813892f8b3..c0a42cb0b79 100644 --- a/src/devices/cpu/sparc/sparcdasm.cpp +++ b/src/devices/cpu/sparc/sparcdasm.cpp @@ -13,9 +13,9 @@ namespace { - int32_t get_disp16(uint32_t op) { return DISP19; } + int32_t get_disp16(uint32_t op) { return DISP16; } int32_t get_disp19(uint32_t op) { return DISP19; } - int32_t get_disp22(uint32_t op) { return DISP19; } + int32_t get_disp22(uint32_t op) { return DISP22; } const char *bicc_comment(const sparc_disassembler::config *conf, bool use_cc, offs_t pc, uint32_t op) { diff --git a/src/devices/cpu/sparc/sparcdefs.h b/src/devices/cpu/sparc/sparcdefs.h index 12f5aba1937..66147c37780 100644 --- a/src/devices/cpu/sparc/sparcdefs.h +++ b/src/devices/cpu/sparc/sparcdefs.h @@ -99,7 +99,7 @@ #define DISP30 (int32_t(op << 2)) #define DISP22 util::sext(op << 2, 24) #define DISP19 util::sext(op << 2, 21) -#define DISP16 (int32_t(((op << 10) & 0xc0000000) | ((op << 16) & 0x3fff0000)) >> 14) +#define DISP16 util::sext((op & 0x300000) >> 4 | (op & 0x3fff) << 2, 18) #define IMM22 (op << 10) #define CONST22 (op & 0x3fffff) #define SIMM13 util::sext(op, 13)