From 50c253c78a406c391585c0440d495889fcfa056c Mon Sep 17 00:00:00 2001 From: hap Date: Tue, 27 Jun 2023 18:33:57 +0200 Subject: tmnt2: get rid of unused k053251_glfgreat_w --- src/mame/konami/k052109.cpp | 6 ------ src/mame/konami/k052109.h | 1 - src/mame/konami/k053251.cpp | 47 +++++++++------------------------------------ src/mame/konami/k053251.h | 8 ++------ src/mame/konami/tmnt.cpp | 2 +- src/mame/konami/tmnt2.cpp | 24 ----------------------- 6 files changed, 12 insertions(+), 76 deletions(-) diff --git a/src/mame/konami/k052109.cpp b/src/mame/konami/k052109.cpp index 07595ac21a8..3742ce3109a 100644 --- a/src/mame/konami/k052109.cpp +++ b/src/mame/konami/k052109.cpp @@ -497,12 +497,6 @@ int k052109_device::get_rmrd_line( ) } -void k052109_device::tilemap_mark_dirty( int tmap_num ) -{ - m_tilemap[tmap_num]->mark_all_dirty(); -} - - void k052109_device::tilemap_update( ) { int xscroll, yscroll, offs; diff --git a/src/mame/konami/k052109.h b/src/mame/konami/k052109.h index 477a2ca75a3..8ac8185313b 100644 --- a/src/mame/konami/k052109.h +++ b/src/mame/konami/k052109.h @@ -50,7 +50,6 @@ public: void set_rmrd_line(int state); int get_rmrd_line(); void tilemap_update(); - void tilemap_mark_dirty(int tmap_num); void tilemap_draw(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int tmap_num, uint32_t flags, uint8_t priority); void vblank_callback(screen_device &screen, bool state); diff --git a/src/mame/konami/k053251.cpp b/src/mame/konami/k053251.cpp index c162e35f06b..76bd47c621d 100644 --- a/src/mame/konami/k053251.cpp +++ b/src/mame/konami/k053251.cpp @@ -128,12 +128,9 @@ actually used, since the priority is taken from the external ports. DEFINE_DEVICE_TYPE(K053251, k053251_device, "k053251", "K053251 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_dirty_tmap[5], - //m_ram[16], +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) - //m_palette_index[5] { } @@ -145,7 +142,6 @@ void k053251_device::device_start() { save_item(NAME(m_ram)); save_item(NAME(m_tilemaps_set)); - save_item(NAME(m_dirty_tmap)); } //------------------------------------------------- @@ -154,16 +150,11 @@ void k053251_device::device_start() void k053251_device::device_reset() { - int i; - m_tilemaps_set = 0; - for (i = 0; i < 0x10; i++) + for (int i = 0; i < 0x10; i++) m_ram[i] = 0; - for (i = 0; i < 5; i++) - m_dirty_tmap[i] = 0; - reset_indexes(); } @@ -182,8 +173,6 @@ void k053251_device::device_post_load() void k053251_device::write(offs_t offset, u8 data) { - int i, newind; - data &= 0x3f; if (m_ram[offset] != data) @@ -192,14 +181,11 @@ void k053251_device::write(offs_t offset, u8 data) if (offset == 9) { /* palette base index */ - for (i = 0; i < 3; i++) + for (int i = 0; i < 3; i++) { - newind = 32 * ((data >> 2 * i) & 0x03); + int newind = 32 * ((data >> 2 * i) & 0x03); if (m_palette_index[i] != newind) - { m_palette_index[i] = newind; - m_dirty_tmap[i] = 1; - } } if (!m_tilemaps_set) @@ -208,14 +194,11 @@ void k053251_device::write(offs_t offset, u8 data) else if (offset == 10) { /* palette base index */ - for (i = 0; i < 2; i++) + for (int i = 0; i < 2; i++) { - newind = 16 * ((data >> 3 * i) & 0x07); + int newind = 16 * ((data >> 3 * i) & 0x07); if (m_palette_index[3 + i] != newind) - { m_palette_index[3 + i] = newind; - m_dirty_tmap[3 + i] = 1; - } } if (!m_tilemaps_set) @@ -234,18 +217,6 @@ int k053251_device::get_palette_index( int ci ) return m_palette_index[ci]; } -int k053251_device::get_tmap_dirty( int tmap_num ) -{ - assert(tmap_num < 5); - return m_dirty_tmap[tmap_num]; -} - -void k053251_device::set_tmap_dirty( int tmap_num, int data ) -{ - assert(tmap_num < 5); - m_dirty_tmap[tmap_num] = data ? 1 : 0; -} - void k053251_device::reset_indexes() { m_palette_index[0] = 32 * ((m_ram[9] >> 0) & 0x03); @@ -259,5 +230,5 @@ void k053251_device::reset_indexes() u8 k053251_device::read(offs_t offset) { - return m_ram[offset]; -} // PCU1 + return m_ram[offset]; // PCU1 +} diff --git a/src/mame/konami/k053251.h b/src/mame/konami/k053251.h index 6fc7783c60e..0023d9bebca 100644 --- a/src/mame/konami/k053251.h +++ b/src/mame/konami/k053251.h @@ -26,10 +26,8 @@ public: void write(offs_t offset, u8 data); int get_priority(int ci); int get_palette_index(int ci); - int get_tmap_dirty(int tmap_num); - void set_tmap_dirty(int tmap_num, int data); - u8 read(offs_t offset); // PCU1 + u8 read(offs_t offset); // PCU1 protected: // device-level overrides @@ -39,9 +37,7 @@ protected: private: // internal state - int m_dirty_tmap[5]; - - uint8_t m_ram[16]; + uint8_t m_ram[16]; int m_tilemaps_set; int m_palette_index[5]; diff --git a/src/mame/konami/tmnt.cpp b/src/mame/konami/tmnt.cpp index ac99908217c..a129ee5ad54 100644 --- a/src/mame/konami/tmnt.cpp +++ b/src/mame/konami/tmnt.cpp @@ -158,7 +158,7 @@ private: // misc int m_tmnt_soundlatch = 0; int m_last = 0; - uint16_t m_cuebrick_nvram[0x400 * 0x20 / 2]; // 32k paged in a 1k window + uint16_t m_cuebrick_nvram[0x400 * 0x20 / 2]{}; // 32k paged in a 1k window // devices required_device m_maincpu; diff --git a/src/mame/konami/tmnt2.cpp b/src/mame/konami/tmnt2.cpp index 2242bd5735b..064026ecca4 100644 --- a/src/mame/konami/tmnt2.cpp +++ b/src/mame/konami/tmnt2.cpp @@ -236,7 +236,6 @@ public: void glfgreat(machine_config &config); private: - void k053251_glfgreat_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); uint8_t controller_r(); uint16_t glfgreat_rom_r(offs_t offset); void glfgreat_122000_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); @@ -1236,10 +1235,6 @@ void tmnt2_state::screen_vblank_blswhstl(int state) } } - - - - void tmnt2_state::punkshot_main_map(address_map &map) { map(0x000000, 0x03ffff).rom(); @@ -1306,25 +1301,6 @@ void tmnt2_state::blswhstl_main_map(address_map &map) map(0x780700, 0x78071f).w(m_k053251, FUNC(k053251_device::write)).umask16(0x00ff); } -void glfgreat_state::k053251_glfgreat_w(offs_t offset, uint16_t data, uint16_t mem_mask) -{ - if (ACCESSING_BITS_8_15) - { - m_k053251->write(offset, (data >> 8) & 0xff); - - /* FIXME: in the old code k052109 tilemaps were tilemaps 2,3,4 for k053251 - and got marked as dirty in the write above... how was the original hardware working?!? */ - for (int i = 0; i < 3; i++) - { - if (m_k053251->get_tmap_dirty(2 + i)) - { - m_k052109->tilemap_mark_dirty(i); - m_k053251->set_tmap_dirty(2 + i, 0); - } - } - } -} - uint8_t glfgreat_state::controller_r() { return m_analog_controller[m_controller_select]->read(); -- cgit v1.2.3