summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/devices/bus/isa/isa.cpp22
-rw-r--r--src/devices/cpu/axc51/axc51extops.hxx2
-rw-r--r--src/devices/cpu/tms9900/tms9900.cpp2
-rw-r--r--src/devices/cpu/tms9900/tms9995.cpp2
-rw-r--r--src/devices/cpu/upd7725/upd7725.cpp2
-rw-r--r--src/devices/cpu/v810/v810.cpp2
-rw-r--r--src/devices/video/315_5313.cpp2
-rw-r--r--src/lib/formats/vt_dsk.cpp3
-rw-r--r--src/mame/bandai/wswan_v.cpp15
-rw-r--r--src/mame/bandai/wswan_v.h1
-rw-r--r--src/mame/force/force68k.cpp2
-rw-r--r--src/mame/igs/igs022.cpp4
-rw-r--r--src/mame/igs/igs028.cpp4
-rw-r--r--src/mame/olivetti/m24_z8000.cpp35
-rw-r--r--src/mame/sega/coolridr.cpp20
-rw-r--r--src/mame/sega/m3comm.cpp18
-rw-r--r--src/mame/seibu/raiden_ms.cpp8
-rw-r--r--src/mame/seta/st0020.cpp4
-rw-r--r--src/mame/tatsumi/tatsumi_v.cpp2
19 files changed, 64 insertions, 86 deletions
diff --git a/src/devices/bus/isa/isa.cpp b/src/devices/bus/isa/isa.cpp
index d8ac97b547f..11aca68d0e7 100644
--- a/src/devices/bus/isa/isa.cpp
+++ b/src/devices/bus/isa/isa.cpp
@@ -596,35 +596,33 @@ void isa16_device::io16_w(offs_t offset, uint16_t data, uint16_t mem_mask)
uint16_t isa16_device::mem16_swap_r(offs_t offset, uint16_t mem_mask)
{
- uint16_t rv;
- mem_mask = (mem_mask<<8) | (mem_mask>>8);
+ mem_mask = swapendian_int16(mem_mask);
- rv = m_memspace->read_word(offset<<1, mem_mask);
+ uint16_t rv = m_memspace->read_word(offset<<1, mem_mask);
- return (rv<<8) | (rv>>8);
+ return swapendian_int16(rv);
}
void isa16_device::mem16_swap_w(offs_t offset, uint16_t data, uint16_t mem_mask)
{
- mem_mask = (mem_mask<<8) | (mem_mask>>8);
- data = (data<<8) | (data>>8);
+ mem_mask = swapendian_int16(mem_mask);
+ data = swapendian_int16(data);
m_memspace->write_word(offset<<1, data, mem_mask);
}
uint16_t isa16_device::io16_swap_r(offs_t offset, uint16_t mem_mask)
{
- uint16_t rv;
- mem_mask = (mem_mask<<8) | (mem_mask>>8);
+ mem_mask = swapendian_int16(mem_mask);
- rv = m_iospace->read_word(offset<<1, mem_mask);
+ uint16_t rv = m_iospace->read_word(offset<<1, mem_mask);
- return (rv<<8) | (rv>>8);
+ return swapendian_int16(rv);
}
void isa16_device::io16_swap_w(offs_t offset, uint16_t data, uint16_t mem_mask)
{
- mem_mask = (mem_mask<<8) | (mem_mask>>8);
- data = (data<<8) | (data>>8);
+ mem_mask = swapendian_int16(mem_mask);
+ data = swapendian_int16(data);
m_iospace->write_word(offset<<1, data, mem_mask);
}
diff --git a/src/devices/cpu/axc51/axc51extops.hxx b/src/devices/cpu/axc51/axc51extops.hxx
index 49d74711df1..4ff83d15880 100644
--- a/src/devices/cpu/axc51/axc51extops.hxx
+++ b/src/devices/cpu/axc51/axc51extops.hxx
@@ -427,7 +427,7 @@ void axc51base_cpu_device::axc51_extended_a5(uint8_t r)
// SWAP16 ERn
uint8_t n = (prm & 0x0c) >> 2;
uint16_t val = get_erx(n);
- uint16_t newval = (val << 8) | (val >> 8);
+ uint16_t newval = swapendian_int16(val);
set_erx(n, newval);
break;
}
diff --git a/src/devices/cpu/tms9900/tms9900.cpp b/src/devices/cpu/tms9900/tms9900.cpp
index 9ce8c60d22b..6f9ef5f7926 100644
--- a/src/devices/cpu/tms9900/tms9900.cpp
+++ b/src/devices/cpu/tms9900/tms9900.cpp
@@ -2222,7 +2222,7 @@ void tms99xx_device::alu_clr_swpb()
sign = 0x8000;
break;
case SWPB:
- m_current_value = ((m_current_value << 8) | (m_current_value >> 8)) & 0xffff;
+ m_current_value = swapendian_int16(m_current_value);
setstatus = false;
break;
}
diff --git a/src/devices/cpu/tms9900/tms9995.cpp b/src/devices/cpu/tms9900/tms9995.cpp
index 4f7cc3db071..c1b07bcbc70 100644
--- a/src/devices/cpu/tms9900/tms9995.cpp
+++ b/src/devices/cpu/tms9900/tms9995.cpp
@@ -3254,7 +3254,7 @@ void tms9995_device::alu_single_arithm()
set_status_bit(ST_OV, src_val == 0x8000);
break;
case SWPB:
- m_current_value = ((m_current_value << 8) | (m_current_value >> 8)) & 0xffff;
+ m_current_value = swapendian_int16(m_current_value);
// I don't know what they are doing right now, but we lose a lot of cycles
// according to the spec (which can indeed be proved on a real system)
diff --git a/src/devices/cpu/upd7725/upd7725.cpp b/src/devices/cpu/upd7725/upd7725.cpp
index cb63995abb3..51c2faf3b6a 100644
--- a/src/devices/cpu/upd7725/upd7725.cpp
+++ b/src/devices/cpu/upd7725/upd7725.cpp
@@ -437,7 +437,7 @@ void necdsp_device::exec_op(uint32_t opcode) {
case 12: r = (q << 1) | (c ? 1 : 0); break; //SHL1 (ROL)
case 13: r = (q << 2) | 3; break; //SHL2
case 14: r = (q << 4) | 15; break; //SHL4
- case 15: r = (q << 8) | (q >> 8); break; //XCHG
+ case 15: r = swapendian_int16(q); break; //XCHG
}
flag.s0 = (r & 0x8000);
diff --git a/src/devices/cpu/v810/v810.cpp b/src/devices/cpu/v810/v810.cpp
index ddf14a2b7fe..47a672baf69 100644
--- a/src/devices/cpu/v810/v810.cpp
+++ b/src/devices/cpu/v810/v810.cpp
@@ -1029,7 +1029,7 @@ void v810_device::opXB(uint32_t op)
{
int val=GETREG(GET2);
SET_OV(0);
- val = (val & 0xffff0000) | ((val & 0xff) << 8) | ((val & 0xff00) >> 8);
+ val = (val & 0xffff0000) | swapendian_int16(val & 0xffff);
SET_Z((val==0.0f)?1:0);
SET_S((val<0.0f)?1:0);
SETREG(GET2,val);
diff --git a/src/devices/video/315_5313.cpp b/src/devices/video/315_5313.cpp
index eed0c2409c7..9d79b2dc396 100644
--- a/src/devices/video/315_5313.cpp
+++ b/src/devices/video/315_5313.cpp
@@ -433,7 +433,7 @@ void sega315_5313_device::vdp_vram_write(u16 data)
if (m_vdp_address & 1)
{
- data = ((data & 0x00ff) << 8) | ((data & 0xff00) >> 8);
+ data = swapendian_int16(data);
}
vram_w(m_vdp_address >> 1, data);
diff --git a/src/lib/formats/vt_dsk.cpp b/src/lib/formats/vt_dsk.cpp
index 5923c8f366b..a410d7b4e4f 100644
--- a/src/lib/formats/vt_dsk.cpp
+++ b/src/lib/formats/vt_dsk.cpp
@@ -11,6 +11,7 @@
#include "formats/vt_dsk.h"
#include "ioprocs.h"
+#include "osdcomm.h"
// Zero = | 9187 |
@@ -332,7 +333,7 @@ bool vtech_dsk_format::load(util::random_read &io, uint32_t form_factor, const s
} else if(count == 128+2) {
uint16_t disk_checksum = buf;
- disk_checksum = (disk_checksum << 8) | (disk_checksum >> 8);
+ disk_checksum = swapendian_int16(disk_checksum);
mode = 0;
}
break;
diff --git a/src/mame/bandai/wswan_v.cpp b/src/mame/bandai/wswan_v.cpp
index cd39e76805d..596781d0c73 100644
--- a/src/mame/bandai/wswan_v.cpp
+++ b/src/mame/bandai/wswan_v.cpp
@@ -188,11 +188,6 @@ void wswan_video_device::setup_palettes()
}
-inline u16 wswan_video_device::swap_bytes(u16 word) {
- return (word << 8) | (word >> 8);
-}
-
-
void wswan_video_device::draw_background()
{
const u16 map_addr = m_layer_bg_address + (((m_current_line + m_layer_bg_scroll_y) & 0xf8) << 2);
@@ -215,7 +210,7 @@ void wswan_video_device::draw_background()
const u16 tile_address = ((tile_data & 0x2000) ? 0x4000 : 0x2000) + (tile_number * 16) + (tile_line << 1);
if (m_tile_packed)
{
- plane0 = (swap_bytes(m_vram[tile_address]) << 16) | swap_bytes(m_vram[tile_address + 1]);
+ plane0 = (swapendian_int16(m_vram[tile_address]) << 16) | swapendian_int16(m_vram[tile_address + 1]);
}
else
{
@@ -317,7 +312,7 @@ void wswan_video_device::draw_foreground_0()
const u16 tile_address = ((tile_data & 0x2000) ? 0x4000 : 0x2000) + (tile_number * 16) + (tile_line << 1);
if (m_tile_packed)
{
- plane0 = (swap_bytes(m_vram[tile_address]) << 16) | swap_bytes(m_vram[tile_address + 1]);
+ plane0 = (swapendian_int16(m_vram[tile_address]) << 16) | swapendian_int16(m_vram[tile_address + 1]);
}
else
{
@@ -420,7 +415,7 @@ void wswan_video_device::draw_foreground_2()
const u16 tile_address = ((tile_data & 0x2000) ? 0x4000 : 0x2000) + (tile_number * 16) + (tile_line << 1);
if (m_tile_packed)
{
- plane0 = (swap_bytes(m_vram[tile_address]) << 16) | swap_bytes(m_vram[tile_address + 1]);
+ plane0 = (swapendian_int16(m_vram[tile_address]) << 16) | swapendian_int16(m_vram[tile_address + 1]);
}
else
{
@@ -522,7 +517,7 @@ void wswan_video_device::draw_foreground_3()
const u16 tile_address = ((tile_data & 0x2000) ? 0x4000 : 0x2000) + (tile_number * 16) + (tile_line << 1);
if (m_tile_packed)
{
- plane0 = (swap_bytes(m_vram[tile_address]) << 16) | swap_bytes(m_vram[tile_address + 1]);
+ plane0 = (swapendian_int16(m_vram[tile_address]) << 16) | swapendian_int16(m_vram[tile_address + 1]);
}
else
{
@@ -630,7 +625,7 @@ void wswan_video_device::handle_sprites(int mask)
const u16 tile_address = 0x2000 + (tile_number * 16) + (tile_line << 1);
if (m_tile_packed)
{
- plane0 = (swap_bytes(m_vram[tile_address]) << 16) | swap_bytes(m_vram[tile_address + 1]);
+ plane0 = (swapendian_int16(m_vram[tile_address]) << 16) | swapendian_int16(m_vram[tile_address + 1]);
}
else
{
diff --git a/src/mame/bandai/wswan_v.h b/src/mame/bandai/wswan_v.h
index 8231573bbdd..030f9ef5f1b 100644
--- a/src/mame/bandai/wswan_v.h
+++ b/src/mame/bandai/wswan_v.h
@@ -62,7 +62,6 @@ protected:
void refresh_scanline();
TIMER_CALLBACK_MEMBER(scanline_interrupt);
void common_save();
- u16 swap_bytes(u16 word);
bitmap_ind16 m_bitmap;
u8 m_layer_bg_enable; // Background layer on/off
diff --git a/src/mame/force/force68k.cpp b/src/mame/force/force68k.cpp
index 88b41fb6aad..f84ace19d75 100644
--- a/src/mame/force/force68k.cpp
+++ b/src/mame/force/force68k.cpp
@@ -407,7 +407,7 @@ void force68k_state::machine_reset ()
/* A very inefficient User cart emulation of two 8 bit sockets (odd and even) */
uint16_t force68k_state::read16_rom(offs_t offset){
offset = offset % m_cart->common_get_size("rom"); // Don't read outside buffer...
- return ((m_usrrom [offset] << 8) & 0xff00) | ((m_usrrom [offset] >> 8) & 0x00ff);
+ return swapendian_int16(m_usrrom [offset]);
}
/* Boot vector handler, the PCB hardwires the first 8 bytes from 0x80000 to 0x0 */
diff --git a/src/mame/igs/igs022.cpp b/src/mame/igs/igs022.cpp
index 8f6a4291d61..e41863df27a 100644
--- a/src/mame/igs/igs022.cpp
+++ b/src/mame/igs/igs022.cpp
@@ -58,7 +58,7 @@ void igs022_device::device_reset()
const u16 size = PROTROM[0x104 / 2];
u16 mode = PROTROM[0x106 / 2];
- mode = (mode >> 8) | (mode << 8);
+ mode = swapendian_int16(mode);
src >>= 1;
@@ -152,7 +152,7 @@ void igs022_device::do_dma(u16 src, u16 dst, u16 size, u16 mode)
{
u16 dat = PROTROM[src + x];
- dat = ((dat &0x00ff) << 8) | ((dat &0xff00) >> 8);
+ dat = swapendian_int16(dat);
m_sharedprotram[dst + x] = dat;
}
diff --git a/src/mame/igs/igs028.cpp b/src/mame/igs/igs028.cpp
index 7060d33395f..59f57bb43b8 100644
--- a/src/mame/igs/igs028.cpp
+++ b/src/mame/igs/igs028.cpp
@@ -116,7 +116,7 @@ void igs028_device::IGS028_do_dma(uint16_t src, uint16_t dst, uint16_t size, uin
if (mode==0) dat2 -= extraxor;
else if (mode==1) dat2 = ((dat2 & 0xf0f0) >> 4)|((dat2 & 0x0f0f) << 4);
else if (mode==2) dat2 ^= extraxor;
- else if (mode==5) dat2 = ((dat2 &0x00ff) << 8) | ((dat2 &0xff00) >> 8);
+ else if (mode==5) dat2 = swapendian_int16(dat2);
else if (mode==6) dat2 += extraxor;
else
{
@@ -134,7 +134,7 @@ void igs028_device::IGS028_do_dma(uint16_t src, uint16_t dst, uint16_t size, uin
if ((x & 0x300) == 0x300) extraxor2 |= 0x2000; // ' '
- printf("mode %d - %04x (%04x %04x %04x - %04x %04x %04x - %04x %04x \n", mode, dat2, (uint16_t)(dat2-extraxor), (uint16_t)(dat2+extraxor), (uint16_t)(dat2^extraxor), (uint16_t)(dat2-extraxor2), (uint16_t)(dat2+extraxor2), (uint16_t)(dat2^extraxor2), ((dat2 & 0xf0f0) >> 4)|((dat2 & 0x0f0f) << 4), ((dat2 &0x00ff) << 8) | ((dat2 &0xff00) >> 8) );
+ printf("mode %d - %04x (%04x %04x %04x - %04x %04x %04x - %04x %04x \n", mode, dat2, (uint16_t)(dat2-extraxor), (uint16_t)(dat2+extraxor), (uint16_t)(dat2^extraxor), (uint16_t)(dat2-extraxor2), (uint16_t)(dat2+extraxor2), (uint16_t)(dat2^extraxor2), ((dat2 & 0xf0f0) >> 4)|((dat2 & 0x0f0f) << 4), swapendian_int16(dat2) );
dat2 = 0x4e75; // hack
}
diff --git a/src/mame/olivetti/m24_z8000.cpp b/src/mame/olivetti/m24_z8000.cpp
index 5ad15a34568..82b62bb5104 100644
--- a/src/mame/olivetti/m24_z8000.cpp
+++ b/src/mame/olivetti/m24_z8000.cpp
@@ -99,34 +99,30 @@ const uint8_t m24_z8000_device::pmem_table[16][4] =
uint16_t m24_z8000_device::pmem_r(offs_t offset, uint16_t mem_mask)
{
- uint16_t ret;
- uint8_t hostseg;
offset <<= 1;
if(!m_z8000_mem)
return memregion(subtag("z8000").c_str())->as_u16(offset >> 1);
- hostseg = pmem_table[(offset >> 16) & 0xf][(offset >> 14) & 3];
+ uint8_t hostseg = pmem_table[(offset >> 16) & 0xf][(offset >> 14) & 3];
if(hostseg == 255)
return 0;
offset = (offset & 0x3fff) | (hostseg << 14);
if((hostseg >= 40) && (hostseg <= 47))
offset = (offset & 0xf0000) | bitswap<16>(offset,15,7,6,14,13,12,11,10,9,8,5,4,3,2,1,0); // move A6/A7 so CGA framebuffer appears linear
- ret = m_maincpu->space(AS_PROGRAM).read_word(offset, (mem_mask << 8) | (mem_mask >> 8));
- return (ret << 8) | (ret >> 8);
+ uint16_t ret = m_maincpu->space(AS_PROGRAM).read_word(offset, swapendian_int16(mem_mask));
+ return swapendian_int16(ret);
}
void m24_z8000_device::pmem_w(offs_t offset, uint16_t data, uint16_t mem_mask)
{
- uint8_t hostseg;
- data = (data << 8) | (data >> 8);
offset <<= 1;
- hostseg = pmem_table[(offset >> 16) & 0xf][(offset >> 14) & 3];
+ uint8_t hostseg = pmem_table[(offset >> 16) & 0xf][(offset >> 14) & 3];
if(hostseg == 255)
return;
offset = (offset & 0x3fff) | (hostseg << 14);
if((hostseg >= 40) && (hostseg <= 47))
offset = (offset & 0xf0000) | bitswap<16>(offset,15,7,6,14,13,12,11,10,9,8,5,4,3,2,1,0);
- m_maincpu->space(AS_PROGRAM).write_word(offset, data, (mem_mask << 8) | (mem_mask >> 8));
+ m_maincpu->space(AS_PROGRAM).write_word(offset, swapendian_int16(data), swapendian_int16(mem_mask));
}
const uint8_t m24_z8000_device::dmem_table[16][4] =
@@ -137,43 +133,38 @@ const uint8_t m24_z8000_device::dmem_table[16][4] =
uint16_t m24_z8000_device::dmem_r(offs_t offset, uint16_t mem_mask)
{
- uint16_t ret;
- uint8_t hostseg;
offset <<= 1;
- hostseg = dmem_table[(offset >> 16) & 0xf][(offset >> 14) & 3];
+ uint8_t hostseg = dmem_table[(offset >> 16) & 0xf][(offset >> 14) & 3];
if(hostseg == 255)
return 0;
offset = (offset & 0x3fff) | (hostseg << 14);
if((hostseg >= 40) && (hostseg <= 47))
offset = (offset & 0xf0000) | bitswap<16>(offset,15,7,6,14,13,12,11,10,9,8,5,4,3,2,1,0);
- ret = m_maincpu->space(AS_PROGRAM).read_word(offset, (mem_mask << 8) | (mem_mask >> 8));
- return (ret << 8) | (ret >> 8);
+ uint16_t ret = m_maincpu->space(AS_PROGRAM).read_word(offset, swapendian_int16(mem_mask));
+ return swapendian_int16(ret);
}
void m24_z8000_device::dmem_w(offs_t offset, uint16_t data, uint16_t mem_mask)
{
- uint8_t hostseg;
- data = (data << 8) | (data >> 8);
offset <<= 1;
- hostseg = dmem_table[(offset >> 16) & 0xf][(offset >> 14) & 3];
+ uint8_t hostseg = dmem_table[(offset >> 16) & 0xf][(offset >> 14) & 3];
if(hostseg == 255)
return;
offset = (offset & 0x3fff) | (hostseg << 14);
if((hostseg >= 40) && (hostseg <= 47))
offset = (offset & 0xf0000) | bitswap<16>(offset,15,7,6,14,13,12,11,10,9,8,5,4,3,2,1,0);
- m_maincpu->space(AS_PROGRAM).write_word(offset, data, (mem_mask << 8) | (mem_mask >> 8));
+ m_maincpu->space(AS_PROGRAM).write_word(offset, swapendian_int16(data), swapendian_int16(mem_mask));
}
uint16_t m24_z8000_device::i86_io_r(offs_t offset, uint16_t mem_mask)
{
- uint16_t ret = m_maincpu->space(AS_IO).read_word(offset << 1, (mem_mask << 8) | (mem_mask >> 8));
- return (ret << 8) | (ret >> 8);
+ uint16_t ret = m_maincpu->space(AS_IO).read_word(offset << 1, swapendian_int16(mem_mask));
+ return swapendian_int16(ret);
}
void m24_z8000_device::i86_io_w(offs_t offset, uint16_t data, uint16_t mem_mask)
{
- data = (data << 8) | (data >> 8);
- m_maincpu->space(AS_IO).write_word(offset << 1, data, (mem_mask << 8) | (mem_mask >> 8));
+ m_maincpu->space(AS_IO).write_word(offset << 1, swapendian_int16(data), swapendian_int16(mem_mask));
}
void m24_z8000_device::irqctl_w(uint8_t data)
diff --git a/src/mame/sega/coolridr.cpp b/src/mame/sega/coolridr.cpp
index 4f7d356d9d4..8c624c88a0b 100644
--- a/src/mame/sega/coolridr.cpp
+++ b/src/mame/sega/coolridr.cpp
@@ -3155,16 +3155,16 @@ void coolridr_state::machine_start()
int count = 0;
for (int i=0;i<size/2/10;i++)
{
- m_rearranged_16bit_gfx[count+0] = ((compressed[i+((0x0400000/2)*0)]&0x00ff) << 8) | ((compressed[i+((0x0400000/2)*0)]&0xff00) >> 8);
- m_rearranged_16bit_gfx[count+1] = ((compressed[i+((0x0400000/2)*1)]&0x00ff) << 8) | ((compressed[i+((0x0400000/2)*1)]&0xff00) >> 8);
- m_rearranged_16bit_gfx[count+2] = ((compressed[i+((0x0400000/2)*2)]&0x00ff) << 8) | ((compressed[i+((0x0400000/2)*2)]&0xff00) >> 8);
- m_rearranged_16bit_gfx[count+3] = ((compressed[i+((0x0400000/2)*3)]&0x00ff) << 8) | ((compressed[i+((0x0400000/2)*3)]&0xff00) >> 8);
- m_rearranged_16bit_gfx[count+4] = ((compressed[i+((0x0400000/2)*4)]&0x00ff) << 8) | ((compressed[i+((0x0400000/2)*4)]&0xff00) >> 8);
- m_rearranged_16bit_gfx[count+5] = ((compressed[i+((0x0400000/2)*5)]&0x00ff) << 8) | ((compressed[i+((0x0400000/2)*5)]&0xff00) >> 8);
- m_rearranged_16bit_gfx[count+6] = ((compressed[i+((0x0400000/2)*6)]&0x00ff) << 8) | ((compressed[i+((0x0400000/2)*6)]&0xff00) >> 8);
- m_rearranged_16bit_gfx[count+7] = ((compressed[i+((0x0400000/2)*7)]&0x00ff) << 8) | ((compressed[i+((0x0400000/2)*7)]&0xff00) >> 8);
- m_rearranged_16bit_gfx[count+8] = ((compressed[i+((0x0400000/2)*8)]&0x00ff) << 8) | ((compressed[i+((0x0400000/2)*8)]&0xff00) >> 8);
- m_rearranged_16bit_gfx[count+9] = ((compressed[i+((0x0400000/2)*9)]&0x00ff) << 8) | ((compressed[i+((0x0400000/2)*9)]&0xff00) >> 8);
+ m_rearranged_16bit_gfx[count+0] = swapendian_int16(compressed[i+((0x0400000/2)*0)]);
+ m_rearranged_16bit_gfx[count+1] = swapendian_int16(compressed[i+((0x0400000/2)*1)]);
+ m_rearranged_16bit_gfx[count+2] = swapendian_int16(compressed[i+((0x0400000/2)*2)]);
+ m_rearranged_16bit_gfx[count+3] = swapendian_int16(compressed[i+((0x0400000/2)*3)]);
+ m_rearranged_16bit_gfx[count+4] = swapendian_int16(compressed[i+((0x0400000/2)*4)]);
+ m_rearranged_16bit_gfx[count+5] = swapendian_int16(compressed[i+((0x0400000/2)*5)]);
+ m_rearranged_16bit_gfx[count+6] = swapendian_int16(compressed[i+((0x0400000/2)*6)]);
+ m_rearranged_16bit_gfx[count+7] = swapendian_int16(compressed[i+((0x0400000/2)*7)]);
+ m_rearranged_16bit_gfx[count+8] = swapendian_int16(compressed[i+((0x0400000/2)*8)]);
+ m_rearranged_16bit_gfx[count+9] = swapendian_int16(compressed[i+((0x0400000/2)*9)]);
count+=10;
}
diff --git a/src/mame/sega/m3comm.cpp b/src/mame/sega/m3comm.cpp
index c60ecbbf7bf..f52cd7c2e38 100644
--- a/src/mame/sega/m3comm.cpp
+++ b/src/mame/sega/m3comm.cpp
@@ -188,12 +188,6 @@ void m3comm_device::device_reset_after_children()
/////////////
-uint16_t swapb16(uint16_t data)
-{
- return (data << 8) | (data >> 8);
-}
-
-
TIMER_CALLBACK_MEMBER(m3comm_device::trigger_irq5)
{
m_commcpu->set_input_line(M68K_IRQ_5, ASSERT_LINE);
@@ -332,11 +326,11 @@ void m3comm_device::ioregs_w(offs_t offset, uint16_t data, uint16_t mem_mask)
uint16_t m3comm_device::m3_m68k_ram_r(offs_t offset)
{
uint16_t value = m_68k_ram[offset]; // FIXME endian
- return swapb16(value);
+ return swapendian_int16(value);
}
void m3comm_device::m3_m68k_ram_w(offs_t offset, uint16_t data)
{
- m_68k_ram[offset] = swapb16(data); // FIXME endian
+ m_68k_ram[offset] = swapendian_int16(data); // FIXME endian
}
uint8_t m3comm_device::m3_comm_ram_r(offs_t offset)
{
@@ -350,13 +344,13 @@ void m3comm_device::m3_comm_ram_w(offs_t offset, uint8_t data)
}
uint16_t m3comm_device::m3_ioregs_r(offs_t offset, uint16_t mem_mask)
{
- uint16_t value = ioregs_r(offset, swapb16(mem_mask));
- return swapb16(value);
+ uint16_t value = ioregs_r(offset, swapendian_int16(mem_mask));
+ return swapendian_int16(value);
}
void m3comm_device::m3_ioregs_w(offs_t offset, uint16_t data, uint16_t mem_mask)
{
- uint16_t value = swapb16(data);
- ioregs_w(offset, value, swapb16(mem_mask));
+ uint16_t value = swapendian_int16(data);
+ ioregs_w(offset, value, swapendian_int16(mem_mask));
// guess, can be asserted at any reg write
if (offset == (0x88 / 2))
diff --git a/src/mame/seibu/raiden_ms.cpp b/src/mame/seibu/raiden_ms.cpp
index 74a3fadb0f9..5f7197a5e09 100644
--- a/src/mame/seibu/raiden_ms.cpp
+++ b/src/mame/seibu/raiden_ms.cpp
@@ -259,10 +259,10 @@ private:
required_device_array<generic_latch_8_device, 2> m_soundlatch;
required_memory_bank m_soundbank;
- uint16_t pal_read16(offs_t offset, u16 mem_mask = ~0) { uint16_t data = m_palette->read16(offset); return ((data & 0xff00) >> 8) | ((data & 0x00ff) << 8); };
- uint16_t pal_read16_ext(offs_t offset, u16 mem_mask = ~0) { uint16_t data = m_palette->read16_ext(offset); return ((data & 0xff00) >> 8) | ((data & 0x00ff) << 8); };
- void pal_write16(offs_t offset, u16 data, u16 mem_mask = ~0) { m_palette->write16(offset, ((data & 0xff00) >> 8) | ((data & 0x00ff) << 8), ((mem_mask & 0xff00) >> 8) | ((mem_mask & 0x00ff) << 8)); };
- void pal_write16_ext(offs_t offset, u16 data, u16 mem_mask = ~0) { m_palette->write16_ext(offset, ((data & 0xff00) >> 8) | ((data & 0x00ff) << 8), ((mem_mask & 0xff00) >> 8) | ((mem_mask & 0x00ff) << 8)); };
+ uint16_t pal_read16(offs_t offset, u16 mem_mask = ~0) { uint16_t data = m_palette->read16(offset); return swapendian_int16(data); };
+ uint16_t pal_read16_ext(offs_t offset, u16 mem_mask = ~0) { uint16_t data = m_palette->read16_ext(offset); return swapendian_int16(data); };
+ void pal_write16(offs_t offset, u16 data, u16 mem_mask = ~0) { m_palette->write16(offset, swapendian_int16(data), swapendian_int16(mem_mask)); };
+ void pal_write16_ext(offs_t offset, u16 data, u16 mem_mask = ~0) { m_palette->write16_ext(offset, swapendian_int16(data), swapendian_int16(mem_mask)); };
uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
diff --git a/src/mame/seta/st0020.cpp b/src/mame/seta/st0020.cpp
index f378dbbc302..e04f9232eb5 100644
--- a/src/mame/seta/st0020.cpp
+++ b/src/mame/seta/st0020.cpp
@@ -24,9 +24,9 @@ DEFINE_DEVICE_TYPE(ST0020_SPRITES, st0020_device, "st0020", "Seta ST0020 Sprites
#define ST0020_ST0032_BYTESWAP_DATA() \
- do { if (m_is_st0032) data = ((data & 0x00ff)<<8) | ((data & 0xff00)>>8); } while (false)
+ do { if (m_is_st0032) data = swapendian_int16(data); } while (false)
#define ST0020_ST0032_BYTESWAP_MEM_MASK() \
- do { if (m_is_st0032) mem_mask = ((mem_mask & 0x00ff)<<8) | ((mem_mask & 0xff00)>>8); } while (false)
+ do { if (m_is_st0032) mem_mask = swapendian_int16(mem_mask); } while (false)
st0020_device::st0020_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
diff --git a/src/mame/tatsumi/tatsumi_v.cpp b/src/mame/tatsumi/tatsumi_v.cpp
index 4bdd6240b43..32bcb9e948a 100644
--- a/src/mame/tatsumi/tatsumi_v.cpp
+++ b/src/mame/tatsumi/tatsumi_v.cpp
@@ -804,7 +804,7 @@ pos is 11.5 fixed point
int shift=data[0];
int shift2=data[2];
int pal = 4; //(data[3]>>8)&0xf;
- int step=((data[1]&0xff)<<8)|((data[1]&0xff00)>>8);
+ int step = swapendian_int16(data[1]);
int samplePos=0;
uint16_t const *const linedata=m_road_pixel_ram;// + (0x100 * pal);
int startPos=0, endPos=0;