diff options
Diffstat (limited to 'src/mame/machine/gaelco2.cpp')
-rw-r--r-- | src/mame/machine/gaelco2.cpp | 68 |
1 files changed, 32 insertions, 36 deletions
diff --git a/src/mame/machine/gaelco2.cpp b/src/mame/machine/gaelco2.cpp index 672afa9d51e..8c186326c3c 100644 --- a/src/mame/machine/gaelco2.cpp +++ b/src/mame/machine/gaelco2.cpp @@ -22,7 +22,7 @@ ***************************************************************************/ -void gaelco2_state::ROM16_split_gfx(const char *src_reg, const char *dst_reg, int start, int length, int dest1, int dest2) +void gaelco2_state::gaelco2_ROM16_split_gfx(const char *src_reg, const char *dst_reg, int start, int length, int dest1, int dest2) { int i; @@ -67,16 +67,16 @@ void gaelco2_state::init_alighunt() */ /* split ROM u48 */ - ROM16_split_gfx("gfx2", "gfx1", 0x0000000, 0x0400000, 0x0000000, 0x0400000); + gaelco2_ROM16_split_gfx("gfx2", "gfx1", 0x0000000, 0x0400000, 0x0000000, 0x0400000); /* split ROM u47 */ - ROM16_split_gfx("gfx2", "gfx1", 0x0400000, 0x0400000, 0x0200000, 0x0600000); + gaelco2_ROM16_split_gfx("gfx2", "gfx1", 0x0400000, 0x0400000, 0x0200000, 0x0600000); /* split ROM u50 */ - ROM16_split_gfx("gfx2", "gfx1", 0x0800000, 0x0400000, 0x0800000, 0x0c00000); + gaelco2_ROM16_split_gfx("gfx2", "gfx1", 0x0800000, 0x0400000, 0x0800000, 0x0c00000); /* split ROM u49 */ - ROM16_split_gfx("gfx2", "gfx1", 0x0c00000, 0x0400000, 0x0a00000, 0x0e00000); + gaelco2_ROM16_split_gfx("gfx2", "gfx1", 0x0c00000, 0x0400000, 0x0a00000, 0x0e00000); } @@ -98,17 +98,17 @@ void gaelco2_state::init_touchgo() */ /* split ROM ic65 */ - ROM16_split_gfx("gfx2", "gfx1", 0x0000000, 0x0400000, 0x0000000, 0x0400000); + gaelco2_ROM16_split_gfx("gfx2", "gfx1", 0x0000000, 0x0400000, 0x0000000, 0x0400000); /* split ROM ic66 */ - ROM16_split_gfx("gfx2", "gfx1", 0x0400000, 0x0200000, 0x0200000, 0x0600000); + gaelco2_ROM16_split_gfx("gfx2", "gfx1", 0x0400000, 0x0200000, 0x0200000, 0x0600000); /* split ROM ic67 */ - ROM16_split_gfx("gfx2", "gfx1", 0x0800000, 0x0400000, 0x0800000, 0x0c00000); + gaelco2_ROM16_split_gfx("gfx2", "gfx1", 0x0800000, 0x0400000, 0x0800000, 0x0c00000); } -void gaelco2_state::init_snowboara() +void gaelco2_state::init_snowboar() { /* For "gfx2" we have this memory map: @@ -126,14 +126,13 @@ void gaelco2_state::init_snowboara() */ /* split ROM sb44 */ - ROM16_split_gfx("gfx2", "gfx1", 0x0000000, 0x0400000, 0x0000000, 0x0400000); + gaelco2_ROM16_split_gfx("gfx2", "gfx1", 0x0000000, 0x0400000, 0x0000000, 0x0400000); /* split ROM sb45 */ - ROM16_split_gfx("gfx2", "gfx1", 0x0400000, 0x0400000, 0x0200000, 0x0600000); + gaelco2_ROM16_split_gfx("gfx2", "gfx1", 0x0400000, 0x0400000, 0x0200000, 0x0600000); /* split ROM sb46 */ - ROM16_split_gfx("gfx2", "gfx1", 0x0800000, 0x0400000, 0x0800000, 0x0c00000); - init_snowboar(); + gaelco2_ROM16_split_gfx("gfx2", "gfx1", 0x0800000, 0x0400000, 0x0800000, 0x0c00000); } @@ -152,10 +151,10 @@ void gaelco2_state::init_wrally2() */ /* split ROM wr2_ic69.ic69 */ - ROM16_split_gfx("gfx2", "gfx1", 0x0000000, 0x0400000, 0x0000000, 0x0200000); + gaelco2_ROM16_split_gfx("gfx2", "gfx1", 0x0000000, 0x0400000, 0x0000000, 0x0200000); /* split ROM wr2_ic70.ic70 */ - ROM16_split_gfx("gfx2", "gfx1", 0x0400000, 0x0200000, 0x0400000, 0x0600000); + gaelco2_ROM16_split_gfx("gfx2", "gfx1", 0x0400000, 0x0200000, 0x0400000, 0x0600000); } @@ -165,13 +164,13 @@ void gaelco2_state::init_wrally2() ***************************************************************************/ -void gaelco2_state::shareram_w(offs_t offset, u8 data) +WRITE8_MEMBER(gaelco2_state::shareram_w) { // why isn't there an AM_SOMETHING macro for this? reinterpret_cast<u8 *>(m_shareram.target())[BYTE_XOR_BE(offset)] = data; } -u8 gaelco2_state::shareram_r(offs_t offset) +READ8_MEMBER(gaelco2_state::shareram_r) { // why isn't there an AM_SOMETHING macro for this? return reinterpret_cast<u8 const *>(m_shareram.target())[BYTE_XOR_BE(offset)]; @@ -184,7 +183,7 @@ u8 gaelco2_state::shareram_r(offs_t offset) ***************************************************************************/ -void gaelco2_state::wrally2_latch_w(offs_t offset, u16 data) +WRITE16_MEMBER(gaelco2_state::wrally2_latch_w) { m_mainlatch->write_bit(offset >> 2, BIT(data, 0)); } @@ -209,7 +208,7 @@ WRITE_LINE_MEMBER(gaelco2_state::coin4_counter_w) machine().bookkeeping().coin_counter_w(3, state); } -void gaelco2_state::alighunt_coin_w(u16 data) +WRITE16_MEMBER(gaelco2_state::alighunt_coin_w) { /* Coin Lockouts */ machine().bookkeeping().coin_lockout_w(0, ~data & 0x01); @@ -232,7 +231,7 @@ void bang_state::init_bang() m_clr_gun_int = 0; } -void bang_state::bang_clr_gun_int_w(u16 data) +WRITE16_MEMBER(bang_state::bang_clr_gun_int_w) { m_clr_gun_int = 1; } @@ -301,17 +300,12 @@ WRITE_LINE_MEMBER(wrally2_state::wrally2_adc_cs) ***************************************************************************/ -void gaelco2_state::init_snowboar() -{ - save_item(NAME(m_snowboard_latch)); -} - -static u32 rol(u32 x, u8 c) +static uint32_t rol(uint32_t x, unsigned int c) { return (x << c) | (x >> (32 - c)); } -static u16 get_lo(u32 x) +static uint16_t get_lo(uint32_t x) { return ((x & 0x00000010) << 1) | ((x & 0x00000800) << 3) | @@ -328,7 +322,7 @@ static u16 get_lo(u32 x) ((x & 0x00000020) >> 1); } -static u16 get_hi(u32 x) +static uint16_t get_hi(uint32_t x) { return ((x & 0x00001400) >> 0) | ((x & 0x10000000) >> 26) | @@ -347,7 +341,7 @@ static u16 get_hi(u32 x) ((x & 0x00000100) >> 1); } -static u16 get_out(u16 x) +static uint16_t get_out(uint16_t x) { return ((x & 0xc840) << 0) | ((x & 0x0080) << 2) | @@ -363,25 +357,27 @@ static u16 get_out(u16 x) ((x & 0x0020) >> 2); } -u16 mangle(u32 x) +uint16_t mangle(uint32_t x) { - u16 a = get_lo(x); - u16 b = get_hi(x); + uint16_t a = get_lo(x); + uint16_t b = get_hi(x); return get_out(((a ^ 0x0010) - (b ^ 0x0024)) ^ 0x5496); } -u16 gaelco2_state::snowboar_protection_r() +READ16_MEMBER(gaelco2_state::snowboar_protection_r) { - u16 ret = mangle(m_snowboard_latch); + uint16_t ret = mangle(snowboard_latch); ret = ((ret & 0xff00) >> 8) | ((ret & 0x00ff) << 8); return ret; + } -void gaelco2_state::snowboar_protection_w(offs_t offset, u16 data, u16 mem_mask) +WRITE16_MEMBER(gaelco2_state::snowboar_protection_w) { COMBINE_DATA(&m_snowboar_protection[offset]); - m_snowboard_latch = (m_snowboard_latch << 16) | data; + snowboard_latch = (snowboard_latch << 16) | data; logerror("%06x: protection write %04x to %04x\n", m_maincpu->pc(), data, offset*2); + } |