diff --git a/src/mame/drivers/88games.c b/src/mame/drivers/88games.c index 08536b0cb12..386909cc5d0 100644 --- a/src/mame/drivers/88games.c +++ b/src/mame/drivers/88games.c @@ -285,10 +285,7 @@ void _88games_state::machine_start() save_item(NAME(m_videobank)); save_item(NAME(m_zoomreadroms)); save_item(NAME(m_speech_chip)); - save_item(NAME(m_layer_colorbase)); save_item(NAME(m_k88games_priority)); - save_item(NAME(m_sprite_colorbase)); - save_item(NAME(m_zoom_colorbase)); } void _88games_state::machine_reset() @@ -297,11 +294,6 @@ void _88games_state::machine_reset() m_zoomreadroms = 0; m_speech_chip = 0; m_k88games_priority = 0; - m_layer_colorbase[0] = 64; - m_layer_colorbase[1] = 0; - m_layer_colorbase[2] = 16; - m_sprite_colorbase = 32; - m_zoom_colorbase = 48; } static MACHINE_CONFIG_START( 88games, _88games_state ) diff --git a/src/mame/drivers/blockhl.c b/src/mame/drivers/blockhl.c index 19fca42481f..492480708a7 100644 --- a/src/mame/drivers/blockhl.c +++ b/src/mame/drivers/blockhl.c @@ -38,11 +38,11 @@ public: blockhl_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), - m_bankedram(*this, "bankedram"), + m_bank5800(*this, "bank5800"), m_audiocpu(*this, "audiocpu"), m_k052109(*this, "k052109"), m_k051960(*this, "k051960"), - m_bankedrom(*this, "bankedrom") { } + m_rombank(*this, "rombank") { } DECLARE_WRITE8_MEMBER(blockhl_sh_irqtrigger_w); DECLARE_READ8_MEMBER(k052109_051960_r); @@ -58,22 +58,14 @@ protected: private: required_device m_maincpu; - required_device m_bankedram; + required_device m_bank5800; required_device m_audiocpu; required_device m_k052109; required_device m_k051960; - required_memory_bank m_bankedrom; - - // video-related - static const int LAYER_COLORBASE[3]; - static const int SPRITE_COLORBASE; + required_memory_bank m_rombank; }; -const int blockhl_state::LAYER_COLORBASE[] = { 0, 16, 32 }; -const int blockhl_state::SPRITE_COLORBASE = 48; - - /*************************************************************************** Callbacks for the K052109 @@ -82,8 +74,10 @@ const int blockhl_state::SPRITE_COLORBASE = 48; K052109_CB_MEMBER(blockhl_state::tile_callback) { + static const int layer_colorbase[] = { 0 / 16, 256 / 16, 512 / 16 }; + *code |= ((*color & 0x0f) << 8); - *color = LAYER_COLORBASE[layer] + ((*color & 0xe0) >> 5); + *color = layer_colorbase[layer] + ((*color & 0xe0) >> 5); } /*************************************************************************** @@ -94,12 +88,10 @@ K052109_CB_MEMBER(blockhl_state::tile_callback) K051960_CB_MEMBER(blockhl_state::sprite_callback) { - if(*color & 0x10) - *priority = 0xfe; // under K052109_tilemap[0] - else - *priority = 0xfc; // under K052109_tilemap[1] + enum { sprite_colorbase = 768 / 16 }; - *color = SPRITE_COLORBASE + (*color & 0x0f); + *priority = (*color & 0x10) ? GFX_PMASK_1 : 0; + *color = sprite_colorbase + (*color & 0x0f); } @@ -111,15 +103,14 @@ UINT32 blockhl_state::screen_update_blockhl(screen_device &screen, bitmap_ind16 m_k052109->tilemap_draw(screen, bitmap, cliprect, 2, TILEMAP_DRAW_OPAQUE, 0); // tile 2 m_k052109->tilemap_draw(screen, bitmap, cliprect, 1, 0, 1); // tile 1 - m_k052109->tilemap_draw(screen, bitmap, cliprect, 0, 0, 2); // tile 0 - - m_k051960->k051960_sprites_draw(bitmap, cliprect, screen.priority(), 0, -1); + m_k051960->k051960_sprites_draw(bitmap, cliprect, screen.priority(), -1, -1); + m_k052109->tilemap_draw(screen, bitmap, cliprect, 0, 0, 0); // tile 0 return 0; } INTERRUPT_GEN_MEMBER(blockhl_state::blockhl_interrupt) { - if (m_k052109->is_irq_enabled() && m_bankedrom->entry() == 0) /* kludge to prevent crashes */ + if (m_k052109->is_irq_enabled() && m_rombank->entry() == 0) /* kludge to prevent crashes */ device.execute().set_input_line(KONAMI_IRQ_LINE, HOLD_LINE); } @@ -166,12 +157,12 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, blockhl_state ) AM_RANGE(0x1f98, 0x1f98) AM_READ_PORT("DSW2") AM_RANGE(0x0000, 0x3fff) AM_READWRITE(k052109_051960_r, k052109_051960_w) AM_RANGE(0x4000, 0x57ff) AM_RAM - AM_RANGE(0x5800, 0x5fff) AM_DEVICE("bankedram", address_map_bank_device, amap8) - AM_RANGE(0x6000, 0x7fff) AM_ROMBANK("bankedrom") + AM_RANGE(0x5800, 0x5fff) AM_DEVICE("bank5800", address_map_bank_device, amap8) + AM_RANGE(0x6000, 0x7fff) AM_ROMBANK("rombank") AM_RANGE(0x8000, 0xffff) AM_ROM AM_REGION("maincpu", 0x8000) ADDRESS_MAP_END -static ADDRESS_MAP_START( bankedram_map, AS_PROGRAM, 8, blockhl_state ) +static ADDRESS_MAP_START( bank5800_map, AS_PROGRAM, 8, blockhl_state ) AM_RANGE(0x0000, 0x07ff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") AM_RANGE(0x0800, 0x0fff) AM_RAM ADDRESS_MAP_END @@ -242,20 +233,20 @@ INPUT_PORTS_END void blockhl_state::machine_start() { // the first 0x8000 are banked, the remaining 0x8000 are directly accessible - m_bankedrom->configure_entries(0, 4, memregion("maincpu")->base(), 0x2000); + m_rombank->configure_entries(0, 4, memregion("maincpu")->base(), 0x2000); } WRITE8_MEMBER( blockhl_state::banking_callback ) { /* bits 0-1 = ROM bank */ - m_bankedrom->set_entry(data & 0x03); + m_rombank->set_entry(data & 0x03); /* bits 3/4 = coin counters */ coin_counter_w(machine(), 0, data & 0x08); coin_counter_w(machine(), 1, data & 0x10); /* bit 5 = select palette RAM or work RAM at 5800-5fff */ - m_bankedram->set_bank(BIT(data, 5)); + m_bank5800->set_bank(BIT(data, 5)); /* bit 6 = enable char ROM reading through the video RAM */ m_k052109->set_rmrd_line((data & 0x40) ? ASSERT_LINE : CLEAR_LINE); @@ -265,7 +256,7 @@ WRITE8_MEMBER( blockhl_state::banking_callback ) /* other bits unknown */ if ((data & 0x84) != 0x80) - logerror("%04x: setlines %02x\n", machine().device("maincpu")->safe_pc(), data); + logerror("%04x: setlines %02x\n", m_maincpu->pc(), data); } static MACHINE_CONFIG_START( blockhl, blockhl_state ) @@ -276,8 +267,8 @@ static MACHINE_CONFIG_START( blockhl, blockhl_state ) MCFG_CPU_VBLANK_INT_DRIVER("screen", blockhl_state, blockhl_interrupt) MCFG_KONAMICPU_LINE_CB(WRITE8(blockhl_state, banking_callback)) - MCFG_DEVICE_ADD("bankedram", ADDRESS_MAP_BANK, 0) - MCFG_DEVICE_PROGRAM_MAP(bankedram_map) + MCFG_DEVICE_ADD("bank5800", ADDRESS_MAP_BANK, 0) + MCFG_DEVICE_PROGRAM_MAP(bank5800_map) MCFG_ADDRESS_MAP_BANK_ENDIANNESS(ENDIANNESS_BIG) MCFG_ADDRESS_MAP_BANK_DATABUS_WIDTH(8) MCFG_ADDRESS_MAP_BANK_ADDRBUS_WIDTH(12) diff --git a/src/mame/includes/88games.h b/src/mame/includes/88games.h index f2ebec8ac88..bdf62a239ed 100644 --- a/src/mame/includes/88games.h +++ b/src/mame/includes/88games.h @@ -29,9 +29,6 @@ public: /* video-related */ int m_k88games_priority; - int m_layer_colorbase[3]; - int m_sprite_colorbase; - int m_zoom_colorbase; int m_videobank; int m_zoomreadroms; int m_speech_chip; diff --git a/src/mame/includes/ajax.h b/src/mame/includes/ajax.h index 3a18d3b09d7..42cdb55ae98 100644 --- a/src/mame/includes/ajax.h +++ b/src/mame/includes/ajax.h @@ -22,9 +22,6 @@ public: m_palette(*this, "palette") { } /* video-related */ - int m_layer_colorbase[3]; - int m_sprite_colorbase; - int m_zoom_colorbase; UINT8 m_priority; /* misc */ @@ -49,7 +46,6 @@ public: DECLARE_WRITE8_MEMBER(k007232_extvol_w); virtual void machine_start(); virtual void machine_reset(); - virtual void video_start(); UINT32 screen_update_ajax(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(ajax_interrupt); DECLARE_WRITE8_MEMBER(volume_callback0); diff --git a/src/mame/includes/bottom9.h b/src/mame/includes/bottom9.h index d038e07b4d6..66ace28ab83 100644 --- a/src/mame/includes/bottom9.h +++ b/src/mame/includes/bottom9.h @@ -25,11 +25,6 @@ public: m_k051316(*this, "k051316"), m_palette(*this, "palette") { } - /* video-related */ - int m_layer_colorbase[3]; - int m_sprite_colorbase; - int m_zoom_colorbase; - /* misc */ int m_video_enable; int m_zoomreadroms; @@ -58,7 +53,6 @@ public: DECLARE_WRITE8_MEMBER(sound_bank_w); virtual void machine_start(); virtual void machine_reset(); - virtual void video_start(); UINT32 screen_update_bottom9(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(bottom9_interrupt); INTERRUPT_GEN_MEMBER(bottom9_sound_interrupt); diff --git a/src/mame/includes/chqflag.h b/src/mame/includes/chqflag.h index 22127cce04b..45e5cc4ea8d 100644 --- a/src/mame/includes/chqflag.h +++ b/src/mame/includes/chqflag.h @@ -28,10 +28,6 @@ public: m_palette(*this, "palette"), m_rombank(*this, "rombank") { } - /* video-related */ - int m_zoom_colorbase[2]; - int m_sprite_colorbase; - /* misc */ int m_k051316_readroms; int m_last_vreg; @@ -64,7 +60,6 @@ public: DECLARE_WRITE8_MEMBER(k007232_extvolume_w); virtual void machine_start(); virtual void machine_reset(); - virtual void video_start(); UINT32 screen_update_chqflag(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(chqflag_scanline); DECLARE_WRITE8_MEMBER(volume_callback0); diff --git a/src/mame/includes/spy.h b/src/mame/includes/spy.h index 71ad18d5ad5..1bdcf2aaf1c 100644 --- a/src/mame/includes/spy.h +++ b/src/mame/includes/spy.h @@ -29,10 +29,6 @@ public: UINT8 m_pmcram[0x800]; std::vector m_paletteram; - /* video-related */ - int m_layer_colorbase[3]; - int m_sprite_colorbase; - /* misc */ int m_rambank; int m_pmcbank; @@ -57,7 +53,6 @@ public: DECLARE_WRITE8_MEMBER(k052109_051960_w); virtual void machine_start(); virtual void machine_reset(); - virtual void video_start(); UINT32 screen_update_spy(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); INTERRUPT_GEN_MEMBER(spy_interrupt); void spy_collision( ); diff --git a/src/mame/video/88games.c b/src/mame/video/88games.c index b7b34342c01..70c1206b44c 100644 --- a/src/mame/video/88games.c +++ b/src/mame/video/88games.c @@ -12,8 +12,10 @@ K052109_CB_MEMBER(_88games_state::tile_callback) { + static const int layer_colorbase[] = { 1024 / 16, 0 / 16, 256 / 16 }; + *code |= ((*color & 0x0f) << 8) | (bank << 12); - *color = m_layer_colorbase[layer] + ((*color & 0xf0) >> 4); + *color = layer_colorbase[layer] + ((*color & 0xf0) >> 4); } @@ -25,8 +27,10 @@ K052109_CB_MEMBER(_88games_state::tile_callback) K051960_CB_MEMBER(_88games_state::sprite_callback) { + enum { sprite_colorbase = 512 / 16 }; + *priority = (*color & 0x20) >> 5; /* ??? */ - *color = m_sprite_colorbase + (*color & 0x0f); + *color = sprite_colorbase + (*color & 0x0f); } @@ -38,9 +42,11 @@ K051960_CB_MEMBER(_88games_state::sprite_callback) K051316_CB_MEMBER(_88games_state::zoom_callback) { + enum { zoom_colorbase = 768 / 16 }; + *flags = (*color & 0x40) ? TILE_FLIPX : 0; *code |= ((*color & 0x07) << 8); - *color = m_zoom_colorbase + ((*color & 0x38) >> 3) + ((*color & 0x80) >> 4); + *color = zoom_colorbase + ((*color & 0x38) >> 3) + ((*color & 0x80) >> 4); } /*************************************************************************** diff --git a/src/mame/video/ajax.c b/src/mame/video/ajax.c index d9bc8ec7feb..35e68312860 100644 --- a/src/mame/video/ajax.c +++ b/src/mame/video/ajax.c @@ -20,8 +20,10 @@ K052109_CB_MEMBER(ajax_state::tile_callback) { + static const int layer_colorbase[] = { 1024 / 16, 0 / 16, 512 / 16 }; + *code |= ((*color & 0x0f) << 8) | (bank << 12); - *color = m_layer_colorbase[layer] + ((*color & 0xf0) >> 4); + *color = layer_colorbase[layer] + ((*color & 0xf0) >> 4); } @@ -33,17 +35,19 @@ K052109_CB_MEMBER(ajax_state::tile_callback) K051960_CB_MEMBER(ajax_state::sprite_callback) { + enum { sprite_colorbase = 256 / 16 }; + /* priority bits: 4 over zoom (0 = have priority) 5 over B (0 = have priority) 6 over A (1 = have priority) never over F */ - *priority = 0xff00; /* F = 8 */ - if ( *color & 0x10) *priority |= 0xf0f0; /* Z = 4 */ - if (~*color & 0x40) *priority |= 0xcccc; /* A = 2 */ - if ( *color & 0x20) *priority |= 0xaaaa; /* B = 1 */ - *color = m_sprite_colorbase + (*color & 0x0f); + *priority = 0; + if ( *color & 0x10) *priority |= GFX_PMASK_4; /* Z = 4 */ + if (~*color & 0x40) *priority |= GFX_PMASK_2; /* A = 2 */ + if ( *color & 0x20) *priority |= GFX_PMASK_1; /* B = 1 */ + *color = sprite_colorbase + (*color & 0x0f); } @@ -55,28 +59,13 @@ K051960_CB_MEMBER(ajax_state::sprite_callback) K051316_CB_MEMBER(ajax_state::zoom_callback) { + enum { zoom_colorbase = 768 / 128 }; + *code |= ((*color & 0x07) << 8); - *color = m_zoom_colorbase + ((*color & 0x08) >> 3); + *color = zoom_colorbase + ((*color & 0x08) >> 3); } -/*************************************************************************** - - Start the video hardware emulation. - -***************************************************************************/ - -void ajax_state::video_start() -{ - m_layer_colorbase[0] = 64; - m_layer_colorbase[1] = 0; - m_layer_colorbase[2] = 32; - m_sprite_colorbase = 16; - m_zoom_colorbase = 6; /* == 48 since it's 7-bit graphics */ -} - - - /*************************************************************************** Display Refresh @@ -103,8 +92,7 @@ UINT32 ajax_state::screen_update_ajax(screen_device &screen, bitmap_ind16 &bitma m_k052109->tilemap_draw(screen, bitmap, cliprect, 1, 0, 2); m_k051316->zoom_draw(screen, bitmap, cliprect, 0, 4); } - m_k052109->tilemap_draw(screen, bitmap, cliprect, 0, 0, 8); - m_k051960->k051960_sprites_draw(bitmap, cliprect, screen.priority(), -1, -1); + m_k052109->tilemap_draw(screen, bitmap, cliprect, 0, 0, 0); return 0; } diff --git a/src/mame/video/bottom9.c b/src/mame/video/bottom9.c index 45df8f6bd10..912e5e0c2bb 100644 --- a/src/mame/video/bottom9.c +++ b/src/mame/video/bottom9.c @@ -10,10 +10,12 @@ ***************************************************************************/ +static const int layer_colorbase[] = { 0 / 16, 0 / 16, 256 / 16 }; + K052109_CB_MEMBER(bottom9_state::tile_callback) { *code |= (*color & 0x3f) << 8; - *color = m_layer_colorbase[layer] + ((*color & 0xc0) >> 6); + *color = layer_colorbase[layer] + ((*color & 0xc0) >> 6); } @@ -25,10 +27,15 @@ K052109_CB_MEMBER(bottom9_state::tile_callback) K051960_CB_MEMBER(bottom9_state::sprite_callback) { + enum { sprite_colorbase = 512 / 16 }; + /* bit 4 = priority over zoom (0 = have priority) */ /* bit 5 = priority over B (1 = have priority) */ - *priority = (*color & 0x30) >> 4; - *color = m_sprite_colorbase + (*color & 0x0f); + *priority = 0; + if ( *color & 0x10) *priority |= GFX_PMASK_1; + if (~*color & 0x20) *priority |= GFX_PMASK_2; + + *color = sprite_colorbase + (*color & 0x0f); } @@ -40,29 +47,14 @@ K051960_CB_MEMBER(bottom9_state::sprite_callback) K051316_CB_MEMBER(bottom9_state::zoom_callback) { + enum { zoom_colorbase = 768 / 16 }; + *flags = (*color & 0x40) ? TILE_FLIPX : 0; *code |= ((*color & 0x03) << 8); - *color = m_zoom_colorbase + ((*color & 0x3c) >> 2); + *color = zoom_colorbase + ((*color & 0x3c) >> 2); } -/*************************************************************************** - - Start the video hardware emulation. - -***************************************************************************/ - -void bottom9_state::video_start() -{ - m_layer_colorbase[0] = 0; /* not used */ - m_layer_colorbase[1] = 0; - m_layer_colorbase[2] = 16; - m_sprite_colorbase = 32; - m_zoom_colorbase = 48; -} - - - /*************************************************************************** Display refresh @@ -74,16 +66,14 @@ UINT32 bottom9_state::screen_update_bottom9(screen_device &screen, bitmap_ind16 m_k052109->tilemap_update(); /* note: FIX layer is not used */ - bitmap.fill(m_layer_colorbase[1], cliprect); + bitmap.fill(layer_colorbase[1], cliprect); + screen.priority().fill(0, cliprect); + // if (m_video_enable) { - m_k051960->k051960_sprites_draw(bitmap, cliprect, screen.priority(), 1, 1); - m_k051316->zoom_draw(screen, bitmap, cliprect, 0, 0); - m_k051960->k051960_sprites_draw(bitmap, cliprect, screen.priority(), 0, 0); - m_k052109->tilemap_draw(screen, bitmap, cliprect, 2, 0, 0); - /* note that priority 3 is opposite to the basic layer priority! */ - /* (it IS used, but hopefully has no effect) */ - m_k051960->k051960_sprites_draw(bitmap, cliprect, screen.priority(), 2, 3); + m_k051316->zoom_draw(screen, bitmap, cliprect, 0, 1); + m_k052109->tilemap_draw(screen, bitmap, cliprect, 2, 0, 2); + m_k051960->k051960_sprites_draw(bitmap, cliprect, screen.priority(), -1, -1); m_k052109->tilemap_draw(screen, bitmap, cliprect, 1, 0, 0); } return 0; diff --git a/src/mame/video/chqflag.c b/src/mame/video/chqflag.c index 74c8e12f8f0..21b74bf5712 100644 --- a/src/mame/video/chqflag.c +++ b/src/mame/video/chqflag.c @@ -20,8 +20,10 @@ K051960_CB_MEMBER(chqflag_state::sprite_callback) { - *priority = (*color & 0x10) >> 4; - *color = m_sprite_colorbase + (*color & 0x0f); + enum { sprite_colorbase = 0 }; + + *priority = (*color & 0x10) ? 0 : GFX_PMASK_1; + *color = sprite_colorbase + (*color & 0x0f); } /*************************************************************************** @@ -32,28 +34,19 @@ K051960_CB_MEMBER(chqflag_state::sprite_callback) K051316_CB_MEMBER(chqflag_state::zoom_callback_1) { + enum { zoom_colorbase_1 = 256 / 16 }; + *code |= ((*color & 0x03) << 8); - *color = m_zoom_colorbase[0] + ((*color & 0x3c) >> 2); + *color = zoom_colorbase_1 + ((*color & 0x3c) >> 2); } K051316_CB_MEMBER(chqflag_state::zoom_callback_2) { + enum { zoom_colorbase_2 = 512 / 256 }; + *flags = TILE_FLIPYX((*color & 0xc0) >> 6); *code |= ((*color & 0x0f) << 8); - *color = m_zoom_colorbase[1] + ((*color & 0x10) >> 4); -} - -/*************************************************************************** - - Start the video hardware emulation. - -***************************************************************************/ - -void chqflag_state::video_start() -{ - m_sprite_colorbase = 0; - m_zoom_colorbase[0] = 0x10; - m_zoom_colorbase[1] = 0x02; + *color = zoom_colorbase_2 + ((*color & 0x10) >> 4); } /*************************************************************************** @@ -64,12 +57,11 @@ void chqflag_state::video_start() UINT32 chqflag_state::screen_update_chqflag(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - bitmap.fill(0, cliprect); + screen.priority().fill(0, cliprect); m_k051316_2->zoom_draw(screen, bitmap, cliprect, TILEMAP_DRAW_LAYER1, 0); - m_k051960->k051960_sprites_draw(bitmap, cliprect, screen.priority(), 0, 0); - m_k051316_2->zoom_draw(screen, bitmap, cliprect, TILEMAP_DRAW_LAYER0, 0); - m_k051960->k051960_sprites_draw(bitmap, cliprect, screen.priority(), 1, 1); + m_k051316_2->zoom_draw(screen, bitmap, cliprect, TILEMAP_DRAW_LAYER0, 1); + m_k051960->k051960_sprites_draw(bitmap, cliprect, screen.priority(), -1, -1); m_k051316_1->zoom_draw(screen, bitmap, cliprect, 0, 0); return 0; } diff --git a/src/mame/video/k051960.c b/src/mame/video/k051960.c index a72ed132d86..1b2270db7fc 100644 --- a/src/mame/video/k051960.c +++ b/src/mame/video/k051960.c @@ -262,7 +262,7 @@ READ8_MEMBER( k051960_device::k051937_r ) /* some games need bit 0 to pulse */ return (m_k051937_counter++) & 1; - //logerror("%04x: read unknown 051937 address %x\n", device->cpu->safe_pc(), offset); + //logerror("%04x: read unknown 051937 address %x\n", space.device().safe_pc(), offset); return 0; } @@ -287,12 +287,12 @@ WRITE8_MEMBER( k051960_device::k051937_w ) /* bit 5 = enable gfx ROM reading */ m_readroms = data & 0x20; - //logerror("%04x: write %02x to 051937 address %x\n", machine().cpu->safe_pc(), data, offset); + //logerror("%04x: write %02x to 051937 address %x\n", space.device().safe_pc(), data, offset); } else if (offset == 1) { -// popmessage("%04x: write %02x to 051937 address %x", machine().cpu->safe_pc(), data, offset); -//logerror("%04x: write %02x to unknown 051937 address %x\n", machine().cpu->safe_pc(), data, offset); +// popmessage("%04x: write %02x to 051937 address %x", space.device().safe_pc(), data, offset); +//logerror("%04x: write %02x to unknown 051937 address %x\n", space.device().safe_pc(), data, offset); } else if (offset >= 2 && offset < 5) { @@ -300,8 +300,8 @@ WRITE8_MEMBER( k051960_device::k051937_w ) } else { - // popmessage("%04x: write %02x to 051937 address %x", machine().cpu->safe_pc(), data, offset); - //logerror("%04x: write %02x to unknown 051937 address %x\n", machine().cpu->safe_pc(), data, offset); + // popmessage("%04x: write %02x to 051937 address %x", space.device().safe_pc(), data, offset); + //logerror("%04x: write %02x to unknown 051937 address %x\n", space.device().safe_pc(), data, offset); } } diff --git a/src/mame/video/spy.c b/src/mame/video/spy.c index 4b0fa6f6a31..f657b716aa9 100644 --- a/src/mame/video/spy.c +++ b/src/mame/video/spy.c @@ -10,11 +10,13 @@ ***************************************************************************/ +static const int layer_colorbase[] = { 768 / 16, 0 / 16, 256 / 16 }; + K052109_CB_MEMBER(spy_state::tile_callback) { *flags = (*color & 0x20) ? TILE_FLIPX : 0; *code |= ((*color & 0x03) << 8) | ((*color & 0x10) << 6) | ((*color & 0x0c) << 9) | (bank << 13); - *color = m_layer_colorbase[layer] + ((*color & 0xc0) >> 6); + *color = layer_colorbase[layer] + ((*color & 0xc0) >> 6); } @@ -26,32 +28,18 @@ K052109_CB_MEMBER(spy_state::tile_callback) K051960_CB_MEMBER(spy_state::sprite_callback) { + enum { sprite_colorbase = 512 / 16 }; + /* bit 4 = priority over layer A (0 = have priority) */ /* bit 5 = priority over layer B (1 = have priority) */ *priority = 0x00; - if ( *color & 0x10) *priority |= 0xa; - if (~*color & 0x20) *priority |= 0xc; + if ( *color & 0x10) *priority |= GFX_PMASK_1; + if (~*color & 0x20) *priority |= GFX_PMASK_2; - *color = m_sprite_colorbase + (*color & 0x0f); + *color = sprite_colorbase + (*color & 0x0f); } -/*************************************************************************** - - Start the video hardware emulation. - -***************************************************************************/ - -void spy_state::video_start() -{ - m_layer_colorbase[0] = 48; - m_layer_colorbase[1] = 0; - m_layer_colorbase[2] = 16; - m_sprite_colorbase = 32; -} - - - /*************************************************************************** Display refresh @@ -65,7 +53,7 @@ UINT32 spy_state::screen_update_spy(screen_device &screen, bitmap_ind16 &bitmap, screen.priority().fill(0, cliprect); if (!m_video_enable) - bitmap.fill(16 * m_layer_colorbase[0], cliprect); + bitmap.fill(16 * layer_colorbase[0], cliprect); else { m_k052109->tilemap_draw(screen, bitmap, cliprect, 1, TILEMAP_DRAW_OPAQUE, 1); diff --git a/src/mame/video/thunderx.c b/src/mame/video/thunderx.c index 65d33a5316f..0c2d85a1d01 100644 --- a/src/mame/video/thunderx.c +++ b/src/mame/video/thunderx.c @@ -30,10 +30,10 @@ K052109_CB_MEMBER(thunderx_state::gbusters_tile_callback) ***************************************************************************/ -static const int sprite_colorbase = 512 / 16; - K051960_CB_MEMBER(thunderx_state::sprite_callback) { + enum { sprite_colorbase = 512 / 16 }; + /* Sprite priority 1 means appear behind background, used only to mask sprites */ /* in the foreground */ /* Sprite priority 3 means don't draw (not used) */