k052109.cpp : Updates

Simplify handlers, Remove unnecessary handlers, Fix notes
This commit is contained in:
cam900 2019-04-27 15:50:05 +09:00
parent 421651b9b7
commit f5cf58ba16
18 changed files with 55 additions and 72 deletions

View File

@ -94,12 +94,12 @@ READ8_MEMBER(_88games_state::k052109_051960_r)
if (offset >= 0x3800 && offset < 0x3808) if (offset >= 0x3800 && offset < 0x3808)
return m_k051960->k051937_r(space, offset - 0x3800); return m_k051960->k051937_r(space, offset - 0x3800);
else if (offset < 0x3c00) else if (offset < 0x3c00)
return m_k052109->read(space, offset); return m_k052109->read(offset);
else else
return m_k051960->k051960_r(space, offset - 0x3c00); return m_k051960->k051960_r(space, offset - 0x3c00);
} }
else else
return m_k052109->read(space, offset); return m_k052109->read(offset);
} }
WRITE8_MEMBER(_88games_state::k052109_051960_w) WRITE8_MEMBER(_88games_state::k052109_051960_w)
@ -107,7 +107,7 @@ WRITE8_MEMBER(_88games_state::k052109_051960_w)
if (offset >= 0x3800 && offset < 0x3808) if (offset >= 0x3800 && offset < 0x3808)
m_k051960->k051937_w(space, offset - 0x3800, data); m_k051960->k051937_w(space, offset - 0x3800, data);
else if (offset < 0x3c00) else if (offset < 0x3c00)
m_k052109->write(space, offset, data); m_k052109->write(offset, data);
else else
m_k051960->k051960_w(space, offset - 0x3c00, data); m_k051960->k051960_w(space, offset - 0x3c00, data);
} }

View File

@ -67,12 +67,12 @@ READ8_MEMBER(aliens_state::k052109_051960_r)
if (offset >= 0x3800 && offset < 0x3808) if (offset >= 0x3800 && offset < 0x3808)
return m_k051960->k051937_r(space, offset - 0x3800); return m_k051960->k051937_r(space, offset - 0x3800);
else if (offset < 0x3c00) else if (offset < 0x3c00)
return m_k052109->read(space, offset); return m_k052109->read(offset);
else else
return m_k051960->k051960_r(space, offset - 0x3c00); return m_k051960->k051960_r(space, offset - 0x3c00);
} }
else else
return m_k052109->read(space, offset); return m_k052109->read(offset);
} }
WRITE8_MEMBER(aliens_state::k052109_051960_w) WRITE8_MEMBER(aliens_state::k052109_051960_w)
@ -80,7 +80,7 @@ WRITE8_MEMBER(aliens_state::k052109_051960_w)
if (offset >= 0x3800 && offset < 0x3808) if (offset >= 0x3800 && offset < 0x3808)
m_k051960->k051937_w(space, offset - 0x3800, data); m_k051960->k051937_w(space, offset - 0x3800, data);
else if (offset < 0x3c00) else if (offset < 0x3c00)
m_k052109->write(space, offset, data); m_k052109->write(offset, data);
else else
m_k051960->k051960_w(space, offset - 0x3c00, data); m_k051960->k051960_w(space, offset - 0x3c00, data);
} }

View File

@ -155,12 +155,12 @@ READ8_MEMBER( blockhl_state::k052109_051960_r )
if (offset >= 0x3800 && offset < 0x3808) if (offset >= 0x3800 && offset < 0x3808)
return m_k051960->k051937_r(space, offset - 0x3800); return m_k051960->k051937_r(space, offset - 0x3800);
else if (offset < 0x3c00) else if (offset < 0x3c00)
return m_k052109->read(space, offset); return m_k052109->read(offset);
else else
return m_k051960->k051960_r(space, offset - 0x3c00); return m_k051960->k051960_r(space, offset - 0x3c00);
} }
else else
return m_k052109->read(space, offset); return m_k052109->read(offset);
} }
WRITE8_MEMBER( blockhl_state::k052109_051960_w ) WRITE8_MEMBER( blockhl_state::k052109_051960_w )
@ -168,7 +168,7 @@ WRITE8_MEMBER( blockhl_state::k052109_051960_w )
if (offset >= 0x3800 && offset < 0x3808) if (offset >= 0x3800 && offset < 0x3808)
m_k051960->k051937_w(space, offset - 0x3800, data); m_k051960->k051937_w(space, offset - 0x3800, data);
else if (offset < 0x3c00) else if (offset < 0x3c00)
m_k052109->write(space, offset, data); m_k052109->write(offset, data);
else else
m_k051960->k051960_w(space, offset - 0x3c00, data); m_k051960->k051960_w(space, offset - 0x3c00, data);
} }

View File

@ -38,12 +38,12 @@ READ8_MEMBER(bottom9_state::k052109_051960_r)
if (offset >= 0x3800 && offset < 0x3808) if (offset >= 0x3800 && offset < 0x3808)
return m_k051960->k051937_r(space, offset - 0x3800); return m_k051960->k051937_r(space, offset - 0x3800);
else if (offset < 0x3c00) else if (offset < 0x3c00)
return m_k052109->read(space, offset); return m_k052109->read(offset);
else else
return m_k051960->k051960_r(space, offset - 0x3c00); return m_k051960->k051960_r(space, offset - 0x3c00);
} }
else else
return m_k052109->read(space, offset); return m_k052109->read(offset);
} }
WRITE8_MEMBER(bottom9_state::k052109_051960_w) WRITE8_MEMBER(bottom9_state::k052109_051960_w)
@ -51,7 +51,7 @@ WRITE8_MEMBER(bottom9_state::k052109_051960_w)
if (offset >= 0x3800 && offset < 0x3808) if (offset >= 0x3800 && offset < 0x3808)
m_k051960->k051937_w(space, offset - 0x3800, data); m_k051960->k051937_w(space, offset - 0x3800, data);
else if (offset < 0x3c00) else if (offset < 0x3c00)
m_k052109->write(space, offset, data); m_k052109->write(offset, data);
else else
m_k051960->k051960_w(space, offset - 0x3c00, data); m_k051960->k051960_w(space, offset - 0x3c00, data);
} }

View File

@ -36,12 +36,12 @@ READ8_MEMBER(crimfght_state::k052109_051960_r)
if (offset >= 0x3800 && offset < 0x3808) if (offset >= 0x3800 && offset < 0x3808)
return m_k051960->k051937_r(space, offset - 0x3800); return m_k051960->k051937_r(space, offset - 0x3800);
else if (offset < 0x3c00) else if (offset < 0x3c00)
return m_k052109->read(space, offset); return m_k052109->read(offset);
else else
return m_k051960->k051960_r(space, offset - 0x3c00); return m_k051960->k051960_r(space, offset - 0x3c00);
} }
else else
return m_k052109->read(space, offset); return m_k052109->read(offset);
} }
WRITE8_MEMBER(crimfght_state::k052109_051960_w) WRITE8_MEMBER(crimfght_state::k052109_051960_w)
@ -49,7 +49,7 @@ WRITE8_MEMBER(crimfght_state::k052109_051960_w)
if (offset >= 0x3800 && offset < 0x3808) if (offset >= 0x3800 && offset < 0x3808)
m_k051960->k051937_w(space, offset - 0x3800, data); m_k051960->k051937_w(space, offset - 0x3800, data);
else if (offset < 0x3c00) else if (offset < 0x3c00)
m_k052109->write(space, offset, data); m_k052109->write(offset, data);
else else
m_k051960->k051960_w(space, offset - 0x3c00, data); m_k051960->k051960_w(space, offset - 0x3c00, data);
} }

View File

@ -38,17 +38,17 @@
READ16_MEMBER(gradius3_state::k052109_halfword_r) READ16_MEMBER(gradius3_state::k052109_halfword_r)
{ {
return m_k052109->read(space, offset); return m_k052109->read(offset);
} }
WRITE16_MEMBER(gradius3_state::k052109_halfword_w) WRITE16_MEMBER(gradius3_state::k052109_halfword_w)
{ {
if (ACCESSING_BITS_0_7) if (ACCESSING_BITS_0_7)
m_k052109->write(space, offset, data & 0xff); m_k052109->write(offset, data & 0xff);
/* is this a bug in the game or something else? */ /* is this a bug in the game or something else? */
if (!ACCESSING_BITS_0_7) if (!ACCESSING_BITS_0_7)
m_k052109->write(space, offset, (data >> 8) & 0xff); m_k052109->write(offset, (data >> 8) & 0xff);
// logerror("%s half %04x = %04x\n",machine().describe_context(),offset,data); // logerror("%s half %04x = %04x\n",machine().describe_context(),offset,data);
} }

View File

@ -473,7 +473,7 @@ READ8_MEMBER(konmedal_state::shuri_video_r)
{ {
if (!(m_control & 0x10)) if (!(m_control & 0x10))
{ {
return m_k052109->read(space, offset+0x2000); return m_k052109->read(offset+0x2000);
} }
uint8_t *ROM = memregion("k052109")->base(); uint8_t *ROM = memregion("k052109")->base();
@ -482,7 +482,7 @@ READ8_MEMBER(konmedal_state::shuri_video_r)
WRITE8_MEMBER(konmedal_state::shuri_video_w) WRITE8_MEMBER(konmedal_state::shuri_video_w)
{ {
m_k052109->write(space, offset+0x2000, data); m_k052109->write(offset+0x2000, data);
} }
READ8_MEMBER(konmedal_state::shuri_irq_r) READ8_MEMBER(konmedal_state::shuri_irq_r)

View File

@ -147,12 +147,12 @@ READ8_MEMBER(mainevt_state::k052109_051960_r)
if (offset >= 0x3800 && offset < 0x3808) if (offset >= 0x3800 && offset < 0x3808)
return m_k051960->k051937_r(space, offset - 0x3800); return m_k051960->k051937_r(space, offset - 0x3800);
else if (offset < 0x3c00) else if (offset < 0x3c00)
return m_k052109->read(space, offset); return m_k052109->read(offset);
else else
return m_k051960->k051960_r(space, offset - 0x3c00); return m_k051960->k051960_r(space, offset - 0x3c00);
} }
else else
return m_k052109->read(space, offset); return m_k052109->read(offset);
} }
WRITE8_MEMBER(mainevt_state::k052109_051960_w) WRITE8_MEMBER(mainevt_state::k052109_051960_w)
@ -160,7 +160,7 @@ WRITE8_MEMBER(mainevt_state::k052109_051960_w)
if (offset >= 0x3800 && offset < 0x3808) if (offset >= 0x3800 && offset < 0x3808)
m_k051960->k051937_w(space, offset - 0x3800, data); m_k051960->k051937_w(space, offset - 0x3800, data);
else if (offset < 0x3c00) else if (offset < 0x3c00)
m_k052109->write(space, offset, data); m_k052109->write(offset, data);
else else
m_k051960->k051960_w(space, offset - 0x3c00, data); m_k051960->k051960_w(space, offset - 0x3c00, data);
} }

View File

@ -356,12 +356,12 @@ READ8_MEMBER(spy_state::k052109_051960_r)
if (offset >= 0x3800 && offset < 0x3808) if (offset >= 0x3800 && offset < 0x3808)
return m_k051960->k051937_r(space, offset - 0x3800); return m_k051960->k051937_r(space, offset - 0x3800);
else if (offset < 0x3c00) else if (offset < 0x3c00)
return m_k052109->read(space, offset); return m_k052109->read(offset);
else else
return m_k051960->k051960_r(space, offset - 0x3c00); return m_k051960->k051960_r(space, offset - 0x3c00);
} }
else else
return m_k052109->read(space, offset); return m_k052109->read(offset);
} }
WRITE8_MEMBER(spy_state::k052109_051960_w) WRITE8_MEMBER(spy_state::k052109_051960_w)
@ -369,7 +369,7 @@ WRITE8_MEMBER(spy_state::k052109_051960_w)
if (offset >= 0x3800 && offset < 0x3808) if (offset >= 0x3800 && offset < 0x3808)
m_k051960->k051937_w(space, offset - 0x3800, data); m_k051960->k051937_w(space, offset - 0x3800, data);
else if (offset < 0x3c00) else if (offset < 0x3c00)
m_k052109->write(space, offset, data); m_k052109->write(offset, data);
else else
m_k051960->k051960_w(space, offset - 0x3c00, data); m_k051960->k051960_w(space, offset - 0x3c00, data);
} }

View File

@ -381,12 +381,12 @@ READ8_MEMBER(thunderx_state::k052109_051960_r)
if (offset >= 0x3800 && offset < 0x3808) if (offset >= 0x3800 && offset < 0x3808)
return m_k051960->k051937_r(space, offset - 0x3800); return m_k051960->k051937_r(space, offset - 0x3800);
else if (offset < 0x3c00) else if (offset < 0x3c00)
return m_k052109->read(space, offset); return m_k052109->read(offset);
else else
return m_k051960->k051960_r(space, offset - 0x3c00); return m_k051960->k051960_r(space, offset - 0x3c00);
} }
else else
return m_k052109->read(space, offset); return m_k052109->read(offset);
} }
WRITE8_MEMBER(thunderx_state::k052109_051960_w) WRITE8_MEMBER(thunderx_state::k052109_051960_w)
@ -394,7 +394,7 @@ WRITE8_MEMBER(thunderx_state::k052109_051960_w)
if (offset >= 0x3800 && offset < 0x3808) if (offset >= 0x3800 && offset < 0x3808)
m_k051960->k051937_w(space, offset - 0x3800, data); m_k051960->k051937_w(space, offset - 0x3800, data);
else if (offset < 0x3c00) else if (offset < 0x3c00)
m_k052109->write(space, offset, data); m_k052109->write(offset, data);
else else
m_k051960->k051960_w(space, offset - 0x3c00, data); m_k051960->k051960_w(space, offset - 0x3c00, data);
} }

View File

@ -76,7 +76,7 @@ READ16_MEMBER(tmnt_state::k052109_word_noA12_r)
/* some games have the A12 line not connected, so the chip spans */ /* some games have the A12 line not connected, so the chip spans */
/* twice the memory range, with mirroring */ /* twice the memory range, with mirroring */
offset = ((offset & 0x3000) >> 1) | (offset & 0x07ff); offset = ((offset & 0x3000) >> 1) | (offset & 0x07ff);
return m_k052109->word_r(space, offset, mem_mask); return m_k052109->word_r(offset);
} }
WRITE16_MEMBER(tmnt_state::k052109_word_noA12_w) WRITE16_MEMBER(tmnt_state::k052109_word_noA12_w)
@ -84,7 +84,7 @@ WRITE16_MEMBER(tmnt_state::k052109_word_noA12_w)
/* some games have the A12 line not connected, so the chip spans */ /* some games have the A12 line not connected, so the chip spans */
/* twice the memory range, with mirroring */ /* twice the memory range, with mirroring */
offset = ((offset & 0x3000) >> 1) | (offset & 0x07ff); offset = ((offset & 0x3000) >> 1) | (offset & 0x07ff);
m_k052109->word_w(space, offset, data, mem_mask); m_k052109->word_w(offset, data, mem_mask);
} }
WRITE16_MEMBER(tmnt_state::punkshot_k052109_word_w) WRITE16_MEMBER(tmnt_state::punkshot_k052109_word_w)
@ -92,9 +92,9 @@ WRITE16_MEMBER(tmnt_state::punkshot_k052109_word_w)
/* it seems that a word write is supposed to affect only the MSB. The */ /* it seems that a word write is supposed to affect only the MSB. The */
/* "ROUND 1" text in punkshtj goes lost otherwise. */ /* "ROUND 1" text in punkshtj goes lost otherwise. */
if (ACCESSING_BITS_8_15) if (ACCESSING_BITS_8_15)
m_k052109->write(space, offset, (data >> 8) & 0xff); m_k052109->write(offset, (data >> 8) & 0xff);
else if (ACCESSING_BITS_0_7) else if (ACCESSING_BITS_0_7)
m_k052109->write(space, offset + 0x2000, data & 0xff); m_k052109->write(offset + 0x2000, data & 0xff);
} }
WRITE16_MEMBER(tmnt_state::punkshot_k052109_word_noA12_w) WRITE16_MEMBER(tmnt_state::punkshot_k052109_word_noA12_w)

View File

@ -134,7 +134,7 @@ WRITE8_MEMBER(vendetta_state::eeprom_w)
READ8_MEMBER(vendetta_state::K052109_r) READ8_MEMBER(vendetta_state::K052109_r)
{ {
return m_k052109->read(space, offset + 0x2000); return m_k052109->read(offset + 0x2000);
} }
WRITE8_MEMBER(vendetta_state::K052109_w) WRITE8_MEMBER(vendetta_state::K052109_w)
@ -144,8 +144,8 @@ WRITE8_MEMBER(vendetta_state::K052109_w)
// * Tilemap mask ROM Test (0x1d80<->0x3d80, 0x1e00<->0x3e00, 0x1f00<->0x3f00) * // * Tilemap mask ROM Test (0x1d80<->0x3d80, 0x1e00<->0x3e00, 0x1f00<->0x3f00) *
// ************************************************************************************* // *************************************************************************************
if ((offset == 0x1d80) || (offset == 0x1e00) || (offset == 0x1f00)) if ((offset == 0x1d80) || (offset == 0x1e00) || (offset == 0x1f00))
m_k052109->write(space, offset, data); m_k052109->write(offset, data);
m_k052109->write(space, offset + 0x2000, data); m_k052109->write(offset + 0x2000, data);
} }

View File

@ -94,7 +94,7 @@ void xmen_state::main_map(address_map &map)
map(0x10a004, 0x10a005).portr("EEPROM"); map(0x10a004, 0x10a005).portr("EEPROM");
map(0x10a00c, 0x10a00d).r(m_k053246, FUNC(k053247_device::k053246_word_r)); map(0x10a00c, 0x10a00d).r(m_k053246, FUNC(k053247_device::k053246_word_r));
map(0x110000, 0x113fff).ram(); /* main RAM */ map(0x110000, 0x113fff).ram(); /* main RAM */
map(0x18c000, 0x197fff).rw(m_k052109, FUNC(k052109_device::lsb_r), FUNC(k052109_device::lsb_w)); map(0x18c000, 0x197fff).rw(m_k052109, FUNC(k052109_device::read), FUNC(k052109_device::write)).umask16(0x00ff);
map(0x18fa00, 0x18fa01).w(FUNC(xmen_state::xmen_18fa00_w)); map(0x18fa00, 0x18fa01).w(FUNC(xmen_state::xmen_18fa00_w));
} }

View File

@ -98,9 +98,8 @@ WRITE16_MEMBER(gradius3_state::gradius3_gfxram_w)
uint32_t gradius3_state::screen_update_gradius3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) uint32_t gradius3_state::screen_update_gradius3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{ {
/* TODO: this kludge enforces the char banks. For some reason, they don't work otherwise. */ /* TODO: this kludge enforces the char banks. For some reason, they don't work otherwise. */
address_space &space = machine().dummy_space(); m_k052109->write(0x1d80, 0x10);
m_k052109->write(space, 0x1d80, 0x10); m_k052109->write(0x1f00, 0x32);
m_k052109->write(space, 0x1f00, 0x32);
m_k052109->tilemap_update(); m_k052109->tilemap_update();

View File

@ -71,7 +71,7 @@ address lines), and then reading it from the 051962.
052109 memory layout: 052109 memory layout:
0000-07ff: layer FIX tilemap (attributes) 0000-07ff: layer FIX tilemap (attributes)
0800-0fff: layer A tilemap (attributes) 0800-0fff: layer A tilemap (attributes)
1000-1fff: layer B tilemap (attributes) 1000-17ff: layer B tilemap (attributes)
180c-1833: A y scroll 180c-1833: A y scroll
1a00-1bff: A x scroll 1a00-1bff: A x scroll
1c00 : ? 1c00 : ?
@ -293,7 +293,7 @@ void k052109_device::vblank_callback(screen_device &screen, bool state)
m_irq_handler(ASSERT_LINE); m_irq_handler(ASSERT_LINE);
} }
READ8_MEMBER( k052109_device::read ) u8 k052109_device::read(offs_t offset)
{ {
if (m_rmrd_line == CLEAR_LINE) if (m_rmrd_line == CLEAR_LINE)
{ {
@ -342,7 +342,7 @@ READ8_MEMBER( k052109_device::read )
} }
} }
WRITE8_MEMBER( k052109_device::write ) void k052109_device::write(offs_t offset, u8 data)
{ {
if ((offset & 0x1fff) < 0x1800) /* tilemap RAM */ if ((offset & 0x1fff) < 0x1800) /* tilemap RAM */
{ {
@ -470,28 +470,17 @@ WRITE8_MEMBER( k052109_device::write )
} }
} }
READ16_MEMBER( k052109_device::word_r ) u16 k052109_device::word_r(offs_t offset)
{ {
return read(space, offset + 0x2000) | (read(space, offset) << 8); return read(offset + 0x2000) | (read(offset) << 8);
} }
WRITE16_MEMBER( k052109_device::word_w ) void k052109_device::word_w(offs_t offset, u16 data, u16 mem_mask)
{ {
if (ACCESSING_BITS_8_15) if (ACCESSING_BITS_8_15)
write(space, offset, (data >> 8) & 0xff); write(offset, (data >> 8) & 0xff);
if (ACCESSING_BITS_0_7) if (ACCESSING_BITS_0_7)
write(space, offset + 0x2000, data & 0xff); write(offset + 0x2000, data & 0xff);
}
READ16_MEMBER( k052109_device::lsb_r )
{
return read(space, offset);
}
WRITE16_MEMBER( k052109_device::lsb_w )
{
if(ACCESSING_BITS_0_7)
write(space, offset, data & 0xff);
} }
void k052109_device::set_rmrd_line( int state ) void k052109_device::set_rmrd_line( int state )

View File

@ -42,12 +42,10 @@ public:
chip so it must not be set by the callback. chip so it must not be set by the callback.
*/ */
DECLARE_READ8_MEMBER( read ); u8 read(offs_t offset);
DECLARE_WRITE8_MEMBER( write ); void write(offs_t offset, u8 data);
DECLARE_READ16_MEMBER( word_r ); u16 word_r(offs_t offset);
DECLARE_WRITE16_MEMBER( word_w ); void word_w(offs_t offset, u16 data, u16 mem_mask = ~0);
DECLARE_READ16_MEMBER( lsb_r );
DECLARE_WRITE16_MEMBER( lsb_w );
void set_rmrd_line(int state); void set_rmrd_line(int state);
int get_rmrd_line(); int get_rmrd_line();

View File

@ -47,12 +47,12 @@ K053246_CB_MEMBER(simpsons_state::sprite_callback)
READ8_MEMBER(simpsons_state::simpsons_k052109_r) READ8_MEMBER(simpsons_state::simpsons_k052109_r)
{ {
return m_k052109->read(space, offset + 0x2000); return m_k052109->read(offset + 0x2000);
} }
WRITE8_MEMBER(simpsons_state::simpsons_k052109_w) WRITE8_MEMBER(simpsons_state::simpsons_k052109_w)
{ {
m_k052109->write(space, offset + 0x2000, data); m_k052109->write(offset + 0x2000, data);
} }
READ8_MEMBER(simpsons_state::simpsons_k053247_r) READ8_MEMBER(simpsons_state::simpsons_k053247_r)

View File

@ -151,7 +151,6 @@ WRITE_LINE_MEMBER(xmen_state::screen_vblank_xmen6p)
cliprect.set(0, 64 * 8 - 1, 2 * 8, 30 * 8 - 1); cliprect.set(0, 64 * 8 - 1, 2 * 8, 30 * 8 - 1);
address_space &space = machine().dummy_space();
if (m_screen->frame_number() & 0x01) if (m_screen->frame_number() & 0x01)
{ {
/* copy the desired spritelist to the chip */ /* copy the desired spritelist to the chip */
@ -163,8 +162,7 @@ WRITE_LINE_MEMBER(xmen_state::screen_vblank_xmen6p)
*/ */
for (offset = 0; offset < (0xc000 / 2); offset++) for (offset = 0; offset < (0xc000 / 2); offset++)
{ {
// m_k052109->lsb_w m_k052109->write(offset, m_xmen6p_tilemapright[offset] & 0x00ff);
m_k052109->write(space, offset, m_xmen6p_tilemapright[offset] & 0x00ff);
} }
@ -182,8 +180,7 @@ WRITE_LINE_MEMBER(xmen_state::screen_vblank_xmen6p)
*/ */
for (offset = 0; offset < (0xc000 / 2); offset++) for (offset = 0; offset < (0xc000 / 2); offset++)
{ {
// m_k052109->lsb_w m_k052109->write(offset, m_xmen6p_tilemapleft[offset] & 0x00ff);
m_k052109->write(space, offset, m_xmen6p_tilemapleft[offset] & 0x00ff);
} }