bus/nubus/nubus_image.cpp, cpu/i386/i486ops.hxx: Use swapendian_int32

This commit is contained in:
AJR 2022-09-22 10:30:18 -04:00
parent 9b8e71c78c
commit 5738e34596
3 changed files with 12 additions and 15 deletions

View file

@ -242,8 +242,8 @@ uint32_t nubus_image_device::image_r()
void nubus_image_device::image_super_w(offs_t offset, uint32_t data, uint32_t mem_mask)
{
uint32_t *image = (uint32_t*)m_image->m_data.get();
data = ((data & 0xff) << 24) | ((data & 0xff00) << 8) | ((data & 0xff0000) >> 8) | ((data & 0xff000000) >> 24);
mem_mask = ((mem_mask & 0xff) << 24) | ((mem_mask & 0xff00) << 8) | ((mem_mask & 0xff0000) >> 8) | ((mem_mask & 0xff000000) >> 24);
data = swapendian_int32(data);
mem_mask = swapendian_int32(mem_mask);
COMBINE_DATA(&image[offset]);
}
@ -251,13 +251,12 @@ void nubus_image_device::image_super_w(offs_t offset, uint32_t data, uint32_t me
uint32_t nubus_image_device::image_super_r(offs_t offset, uint32_t mem_mask)
{
uint32_t *image = (uint32_t*)m_image->m_data.get();
uint32_t data = image[offset];
return ((data & 0xff) << 24) | ((data & 0xff00) << 8) | ((data & 0xff0000) >> 8) | ((data & 0xff000000) >> 24);
return swapendian_int32(image[offset]);
}
void nubus_image_device::file_cmd_w(uint32_t data)
{
// data = ((data & 0xff) << 24) | ((data & 0xff00) << 8) | ((data & 0xff0000) >> 8) | ((data & 0xff000000) >> 24);
// data = swapendian_int32(data);
filectx.curcmd = data;
switch (data) {
case kFileCmdGetDir:

View file

@ -368,8 +368,6 @@ extern MODRM_TABLE i386_MODRM_table[256];
#define STORE_RM16(x, value) (REG16(i386_MODRM_table[x].rm.w) = value)
#define STORE_RM32(x, value) (REG32(i386_MODRM_table[x].rm.d) = value)
#define SWITCH_ENDIAN_32(x) (((((x) << 24) & (0xff << 24)) | (((x) << 8) & (0xff << 16)) | (((x) >> 8) & (0xff << 8)) | (((x) >> 24) & (0xff << 0))))
/***********************************************************************************/
enum X86_CYCLES

View file

@ -458,49 +458,49 @@ void i386_device::i486_group0F01_32() // Opcode 0x0f 01
void i386_device::i486_bswap_eax() // Opcode 0x0f 38
{
REG32(EAX) = SWITCH_ENDIAN_32(REG32(EAX));
REG32(EAX) = swapendian_int32(REG32(EAX));
CYCLES(1); // TODO
}
void i386_device::i486_bswap_ecx() // Opcode 0x0f 39
{
REG32(ECX) = SWITCH_ENDIAN_32(REG32(ECX));
REG32(ECX) = swapendian_int32(REG32(ECX));
CYCLES(1); // TODO
}
void i386_device::i486_bswap_edx() // Opcode 0x0f 3A
{
REG32(EDX) = SWITCH_ENDIAN_32(REG32(EDX));
REG32(EDX) = swapendian_int32(REG32(EDX));
CYCLES(1); // TODO
}
void i386_device::i486_bswap_ebx() // Opcode 0x0f 3B
{
REG32(EBX) = SWITCH_ENDIAN_32(REG32(EBX));
REG32(EBX) = swapendian_int32(REG32(EBX));
CYCLES(1); // TODO
}
void i386_device::i486_bswap_esp() // Opcode 0x0f 3C
{
REG32(ESP) = SWITCH_ENDIAN_32(REG32(ESP));
REG32(ESP) = swapendian_int32(REG32(ESP));
CYCLES(1); // TODO
}
void i386_device::i486_bswap_ebp() // Opcode 0x0f 3D
{
REG32(EBP) = SWITCH_ENDIAN_32(REG32(EBP));
REG32(EBP) = swapendian_int32(REG32(EBP));
CYCLES(1); // TODO
}
void i386_device::i486_bswap_esi() // Opcode 0x0f 3E
{
REG32(ESI) = SWITCH_ENDIAN_32(REG32(ESI));
REG32(ESI) = swapendian_int32(REG32(ESI));
CYCLES(1); // TODO
}
void i386_device::i486_bswap_edi() // Opcode 0x0f 3F
{
REG32(EDI) = SWITCH_ENDIAN_32(REG32(EDI));
REG32(EDI) = swapendian_int32(REG32(EDI));
CYCLES(1); // TODO
}