diff options
| author | 2025-07-20 12:16:26 +0200 | |
|---|---|---|
| committer | 2025-07-20 12:16:40 +0200 | |
| commit | 5265b2ec7d77315896ce7819742187170ab5d043 (patch) | |
| tree | 5408e315c414d69246ecc9d40bf643cc821ddee0 | |
| parent | e3b1d8ccef8883a6f375f73cdca6af159705cf0f (diff) | |
k053251: remove obsolete code (all dirty tilemap marking after colorbase changed is done locally in drivers)
| -rw-r--r-- | src/mame/konami/dbz.cpp | 9 | ||||
| -rw-r--r-- | src/mame/konami/gijoe.cpp | 2 | ||||
| -rw-r--r-- | src/mame/konami/k053251.cpp | 43 | ||||
| -rw-r--r-- | src/mame/konami/k053251.h | 7 | ||||
| -rw-r--r-- | src/mame/konami/moo.cpp | 9 | ||||
| -rw-r--r-- | src/mame/konami/overdriv.cpp | 67 |
6 files changed, 51 insertions, 86 deletions
diff --git a/src/mame/konami/dbz.cpp b/src/mame/konami/dbz.cpp index 777d2f2ee04..8af8fe8c160 100644 --- a/src/mame/konami/dbz.cpp +++ b/src/mame/konami/dbz.cpp @@ -220,7 +220,7 @@ void dbz_state::video_start() m_k056832->set_layer_offs(0, -35, -16); m_k056832->set_layer_offs(1, -31, -16); - m_k056832->set_layer_offs(3, -31, -16); //? + m_k056832->set_layer_offs(3, -31, -16); // ? } uint32_t dbz_state::screen_update_dbz(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) @@ -237,7 +237,7 @@ uint32_t dbz_state::screen_update_dbz(screen_device &screen, bitmap_ind16 &bitma { m_layer_colorbase[plane] = new_colorbase; if (plane <= 3) - m_k056832->mark_plane_dirty( plane); + m_k056832->mark_plane_dirty(plane); else if (plane == 4) m_bg1_tilemap->mark_all_dirty(); else if (plane == 5) @@ -245,8 +245,7 @@ uint32_t dbz_state::screen_update_dbz(screen_device &screen, bitmap_ind16 &bitma } } - //layers priority - + // layers priority layer[0] = 0; m_layerpri[0] = m_k053251->get_priority(k053251_device::CI3); layer[1] = 1; @@ -298,7 +297,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(dbz_state::dbz_scanline) m_maincpu->set_input_line(M68K_IRQ_2, ASSERT_LINE); if(scanline == 0 && m_k053246->k053246_is_irq_enabled()) // vblank-in irq - m_maincpu->set_input_line(M68K_IRQ_4, HOLD_LINE); //auto-acks apparently + m_maincpu->set_input_line(M68K_IRQ_4, HOLD_LINE); // auto-acks apparently } #if 0 diff --git a/src/mame/konami/gijoe.cpp b/src/mame/konami/gijoe.cpp index df8f67a4f91..fe1553bc6bb 100644 --- a/src/mame/konami/gijoe.cpp +++ b/src/mame/konami/gijoe.cpp @@ -281,7 +281,7 @@ uint32_t gijoe_state::screen_update_gijoe(screen_device &screen, bitmap_ind16 &b if (dirty) { m_avac_occupancy[i] = 0; - m_k056832->mark_plane_dirty( i); + m_k056832->mark_plane_dirty(i); } } diff --git a/src/mame/konami/k053251.cpp b/src/mame/konami/k053251.cpp index 99b543b2f31..a5ec9ee9bd2 100644 --- a/src/mame/konami/k053251.cpp +++ b/src/mame/konami/k053251.cpp @@ -114,7 +114,6 @@ actually used, since the priority is taken from the external ports. 14 unused 15 unused - */ #include "emu.h" @@ -129,8 +128,7 @@ actually used, since the priority is taken from the external ports. DEFINE_DEVICE_TYPE(K053251, k053251_device, "k053251", "Konami 053251 Priority Encoder") k053251_device::k053251_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : - device_t(mconfig, K053251, tag, owner, clock), - m_tilemaps_set(0) + device_t(mconfig, K053251, tag, owner, clock) { } @@ -141,7 +139,6 @@ k053251_device::k053251_device(const machine_config &mconfig, const char *tag, d void k053251_device::device_start() { save_item(NAME(m_ram)); - save_item(NAME(m_tilemaps_set)); } //------------------------------------------------- @@ -150,8 +147,6 @@ void k053251_device::device_start() void k053251_device::device_reset() { - m_tilemaps_set = 0; - for (int i = 0; i < 0x10; i++) m_ram[i] = 0; @@ -173,38 +168,10 @@ void k053251_device::device_post_load() void k053251_device::write(offs_t offset, u8 data) { - data &= 0x3f; - - if (m_ram[offset] != data) - { - m_ram[offset] = data; - if (offset == 9) - { - /* palette base index */ - for (int i = 0; i < 3; i++) - { - int newind = 32 * ((data >> 2 * i) & 0x03); - if (m_palette_index[i] != newind) - m_palette_index[i] = newind; - } - - if (!m_tilemaps_set) - machine().tilemap().mark_all_dirty(); - } - else if (offset == 10) - { - /* palette base index */ - for (int i = 0; i < 2; i++) - { - int newind = 16 * ((data >> 3 * i) & 0x07); - if (m_palette_index[3 + i] != newind) - m_palette_index[3 + i] = newind; - } - - if (!m_tilemaps_set) - machine().tilemap().mark_all_dirty(); - } - } + m_ram[offset] = data & 0x3f; + + if (offset == 9 || offset == 10) + reset_indexes(); } int k053251_device::get_priority(int ci) diff --git a/src/mame/konami/k053251.h b/src/mame/konami/k053251.h index fa302665c83..f2bdfb90ea3 100644 --- a/src/mame/konami/k053251.h +++ b/src/mame/konami/k053251.h @@ -17,12 +17,6 @@ public: k053251_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - /* - Note: k053251_w() automatically does a ALL_TILEMAPS->mark_all_dirty() - when some palette index changes. If ALL_TILEMAPS is too expensive, use - k053251_set_tilemaps() to indicate which tilemap is associated with each index. - */ - void write(offs_t offset, u8 data); int get_priority(int ci); int get_palette_index(int ci); @@ -38,7 +32,6 @@ protected: private: // internal state uint8_t m_ram[16]; - int m_tilemaps_set; int m_palette_index[5]; void reset_indexes(); diff --git a/src/mame/konami/moo.cpp b/src/mame/konami/moo.cpp index 7093e00670b..e61f6bc053a 100644 --- a/src/mame/konami/moo.cpp +++ b/src/mame/konami/moo.cpp @@ -180,11 +180,11 @@ private: int m_layer_colorbase[4]; int m_layerpri[3]; int m_alpha_enabled = 0; - uint16_t m_zmask = 0; + uint16_t m_zmask = 0; /* misc */ - uint16_t m_protram[16]; - uint16_t m_cur_control2 = 0; + uint16_t m_protram[16]; + uint16_t m_cur_control2 = 0; /* devices */ required_device<cpu_device> m_maincpu; @@ -291,7 +291,7 @@ uint32_t moo_state::screen_update_moo(screen_device &screen, bitmap_rgb32 &bitma if (m_layer_colorbase[plane] != new_colorbase) { m_layer_colorbase[plane] = new_colorbase; - m_k056832->mark_plane_dirty( plane); + m_k056832->mark_plane_dirty(plane); } } } @@ -1247,6 +1247,7 @@ GAME( 1992, moomesauac, moomesa, moo, moo, moo_state, empty_init, ROT0, "K GAME( 1992, moomesauab, moomesa, moo, moo, moo_state, empty_init, ROT0, "Konami", "Wild West C.O.W.-Boys of Moo Mesa (ver UAB)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) GAME( 1992, moomesaaab, moomesa, moo, moo, moo_state, empty_init, ROT0, "Konami", "Wild West C.O.W.-Boys of Moo Mesa (ver AAB)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) GAME( 1992, moomesabl, moomesa, moobl, moo, moo_state, empty_init, ROT0, "bootleg", "Wild West C.O.W.-Boys of Moo Mesa (bootleg)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) // based on Version AA + GAME( 1992, bucky, 0, bucky, bucky, moo_state, empty_init, ROT0, "Konami", "Bucky O'Hare (ver EAB)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) GAME( 1992, buckyea, bucky, bucky, bucky, moo_state, empty_init, ROT0, "Konami", "Bucky O'Hare (ver EA)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) GAME( 1992, buckyjaa, bucky, bucky, bucky, moo_state, empty_init, ROT0, "Konami", "Bucky O'Hare (ver JAA)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/konami/overdriv.cpp b/src/mame/konami/overdriv.cpp index 46de2898302..4ffab08c3ab 100644 --- a/src/mame/konami/overdriv.cpp +++ b/src/mame/konami/overdriv.cpp @@ -58,8 +58,7 @@ public: , m_maincpu(*this, "maincpu") , m_subcpu(*this, "sub") , m_audiocpu(*this, "audiocpu") - , m_k051316_1(*this, "k051316_1") - , m_k051316_2(*this, "k051316_2") + , m_k051316(*this, "k051316_%u", 1) , m_k053246(*this, "k053246") , m_k053251(*this, "k053251") , m_k053252(*this, "k053252") @@ -69,6 +68,10 @@ public: void overdriv(machine_config &config); +protected: + virtual void machine_start() override ATTR_COLD; + virtual void machine_reset() override ATTR_COLD; + private: void eeprom_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); void cpuA_ctrl_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); @@ -92,10 +95,6 @@ private: void overdriv_slave_map(address_map &map) ATTR_COLD; void overdriv_sound_map(address_map &map) ATTR_COLD; - - virtual void machine_start() override ATTR_COLD; - virtual void machine_reset() override ATTR_COLD; - /* video-related */ int m_zoom_colorbase[2]{}; int m_road_colorbase[2]{}; @@ -103,20 +102,19 @@ private: emu_timer *m_objdma_end_timer = nullptr; /* misc */ - uint16_t m_cpuB_ctrl = 0; + uint16_t m_cpuB_ctrl = 0; + int m_fake_timer = 0; /* devices */ required_device<cpu_device> m_maincpu; required_device<cpu_device> m_subcpu; required_device<cpu_device> m_audiocpu; - required_device<k051316_device> m_k051316_1; - required_device<k051316_device> m_k051316_2; + required_device_array<k051316_device, 2> m_k051316; required_device<k053247_device> m_k053246; required_device<k053251_device> m_k053251; required_device<k053252_device> m_k053252; required_device<screen_device> m_screen; output_finder<> m_led; - int m_fake_timer = 0; }; @@ -191,7 +189,7 @@ void overdriv_state::cpuA_ctrl_w(offs_t offset, uint16_t data, uint16_t mem_mask machine().bookkeeping().coin_counter_w(0, data & 0x10); machine().bookkeeping().coin_counter_w(1, data & 0x20); -//logerror("%s: write %04x to cpuA_ctrl_w\n",machine().describe_context(),data); + //logerror("%s: write %04x to cpuA_ctrl_w\n",machine().describe_context(),data); } } @@ -284,15 +282,22 @@ uint32_t overdriv_state::screen_update_overdriv(screen_device &screen, bitmap_in m_sprite_colorbase = m_k053251->get_palette_index(k053251_device::CI0); m_road_colorbase[1] = m_k053251->get_palette_index(k053251_device::CI1); m_road_colorbase[0] = m_k053251->get_palette_index(k053251_device::CI2); - m_zoom_colorbase[1] = m_k053251->get_palette_index(k053251_device::CI3); - m_zoom_colorbase[0] = m_k053251->get_palette_index(k053251_device::CI4); + + for (int i = 0; i < 2; i++) + { + int prev_colorbase = m_zoom_colorbase[i]; + m_zoom_colorbase[i] = m_k053251->get_palette_index(k053251_device::CI4 - i); + + if (m_zoom_colorbase[i] != prev_colorbase) + m_k051316[i]->mark_tmap_dirty(); + } screen.priority().fill(0, cliprect); - m_k051316_1->zoom_draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); - m_k051316_2->zoom_draw(screen, bitmap, cliprect, 0, 1); + m_k051316[0]->zoom_draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); + m_k051316[1]->zoom_draw(screen, bitmap, cliprect, 0, 1); - m_k053246->k053247_sprites_draw( bitmap,cliprect); + m_k053246->k053247_sprites_draw(bitmap,cliprect); return 0; } @@ -308,8 +313,8 @@ void overdriv_state::overdriv_master_map(address_map &map) map(0x100000, 0x10001f).rw(m_k053252, FUNC(k053252_device::read), FUNC(k053252_device::write)).umask16(0x00ff); /* 053252? (LSB) */ map(0x140000, 0x140001).nopw(); //watchdog reset? map(0x180001, 0x180001).rw("adc", FUNC(adc0804_device::read), FUNC(adc0804_device::write)); - map(0x1c0000, 0x1c001f).w(m_k051316_1, FUNC(k051316_device::ctrl_w)).umask16(0xff00); - map(0x1c8000, 0x1c801f).w(m_k051316_2, FUNC(k051316_device::ctrl_w)).umask16(0xff00); + map(0x1c0000, 0x1c001f).w(m_k051316[0], FUNC(k051316_device::ctrl_w)).umask16(0xff00); + map(0x1c8000, 0x1c801f).w(m_k051316[1], FUNC(k051316_device::ctrl_w)).umask16(0xff00); map(0x1d0000, 0x1d001f).w(m_k053251, FUNC(k053251_device::write)).umask16(0xff00); map(0x1d8000, 0x1d8003).rw("k053260_1", FUNC(k053260_device::main_read), FUNC(k053260_device::main_write)).umask16(0x00ff); map(0x1e0000, 0x1e0003).rw("k053260_2", FUNC(k053260_device::main_read), FUNC(k053260_device::main_write)).umask16(0x00ff); @@ -317,10 +322,10 @@ void overdriv_state::overdriv_master_map(address_map &map) map(0x1f0000, 0x1f0001).w(FUNC(overdriv_state::cpuA_ctrl_w)); /* halt cpu B, coin counter, start lamp, other? */ map(0x1f8000, 0x1f8001).w(FUNC(overdriv_state::eeprom_w)); map(0x200000, 0x203fff).ram().share("share1"); - map(0x210000, 0x210fff).rw(m_k051316_1, FUNC(k051316_device::read), FUNC(k051316_device::write)).umask16(0xff00); - map(0x218000, 0x218fff).rw(m_k051316_2, FUNC(k051316_device::read), FUNC(k051316_device::write)).umask16(0xff00); - map(0x220000, 0x220fff).r(m_k051316_1, FUNC(k051316_device::rom_r)).umask16(0xff00); - map(0x228000, 0x228fff).r(m_k051316_2, FUNC(k051316_device::rom_r)).umask16(0xff00); + map(0x210000, 0x210fff).rw(m_k051316[0], FUNC(k051316_device::read), FUNC(k051316_device::write)).umask16(0xff00); + map(0x218000, 0x218fff).rw(m_k051316[1], FUNC(k051316_device::read), FUNC(k051316_device::write)).umask16(0xff00); + map(0x220000, 0x220fff).r(m_k051316[0], FUNC(k051316_device::rom_r)).umask16(0xff00); + map(0x228000, 0x228fff).r(m_k051316[1], FUNC(k051316_device::rom_r)).umask16(0xff00); map(0x230000, 0x230001).w(FUNC(overdriv_state::slave_irq4_assert_w)); map(0x238000, 0x238001).w(FUNC(overdriv_state::slave_irq5_assert_w)); } @@ -476,16 +481,16 @@ void overdriv_state::overdriv(machine_config &config) m_k053246->set_config(NORMAL_PLANE_ORDER, 77, 22); m_k053246->set_palette("palette"); - K051316(config, m_k051316_1, 24_MHz_XTAL / 2); - m_k051316_1->set_palette("palette"); - m_k051316_1->set_offsets(110, -1); - m_k051316_1->set_wrap(1); - m_k051316_1->set_zoom_callback(FUNC(overdriv_state::zoom_callback_1)); + K051316(config, m_k051316[0], 24_MHz_XTAL / 2); + m_k051316[0]->set_palette("palette"); + m_k051316[0]->set_offsets(110, -1); + m_k051316[0]->set_wrap(1); + m_k051316[0]->set_zoom_callback(FUNC(overdriv_state::zoom_callback_1)); - K051316(config, m_k051316_2, 24_MHz_XTAL / 2); - m_k051316_2->set_palette("palette"); - m_k051316_2->set_offsets(111, 1); - m_k051316_2->set_zoom_callback(FUNC(overdriv_state::zoom_callback_2)); + K051316(config, m_k051316[1], 24_MHz_XTAL / 2); + m_k051316[1]->set_palette("palette"); + m_k051316[1]->set_offsets(111, 1); + m_k051316[1]->set_zoom_callback(FUNC(overdriv_state::zoom_callback_2)); K053251(config, m_k053251, 0); |
