tmnt2: get rid of unused k053251_glfgreat_w

This commit is contained in:
hap 2023-06-27 18:33:57 +02:00
parent 5d7ad631c9
commit 50c253c78a
6 changed files with 12 additions and 76 deletions

View File

@ -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( ) void k052109_device::tilemap_update( )
{ {
int xscroll, yscroll, offs; int xscroll, yscroll, offs;

View File

@ -50,7 +50,6 @@ public:
void set_rmrd_line(int state); void set_rmrd_line(int state);
int get_rmrd_line(); int get_rmrd_line();
void tilemap_update(); 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 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); void vblank_callback(screen_device &screen, bool state);

View File

@ -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") 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) k053251_device::k053251_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
: device_t(mconfig, K053251, tag, owner, clock), device_t(mconfig, K053251, tag, owner, clock),
//m_dirty_tmap[5],
//m_ram[16],
m_tilemaps_set(0) 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_ram));
save_item(NAME(m_tilemaps_set)); 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() void k053251_device::device_reset()
{ {
int i;
m_tilemaps_set = 0; m_tilemaps_set = 0;
for (i = 0; i < 0x10; i++) for (int i = 0; i < 0x10; i++)
m_ram[i] = 0; m_ram[i] = 0;
for (i = 0; i < 5; i++)
m_dirty_tmap[i] = 0;
reset_indexes(); reset_indexes();
} }
@ -182,8 +173,6 @@ void k053251_device::device_post_load()
void k053251_device::write(offs_t offset, u8 data) void k053251_device::write(offs_t offset, u8 data)
{ {
int i, newind;
data &= 0x3f; data &= 0x3f;
if (m_ram[offset] != data) if (m_ram[offset] != data)
@ -192,14 +181,11 @@ void k053251_device::write(offs_t offset, u8 data)
if (offset == 9) if (offset == 9)
{ {
/* palette base index */ /* 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) if (m_palette_index[i] != newind)
{
m_palette_index[i] = newind; m_palette_index[i] = newind;
m_dirty_tmap[i] = 1;
}
} }
if (!m_tilemaps_set) if (!m_tilemaps_set)
@ -208,14 +194,11 @@ void k053251_device::write(offs_t offset, u8 data)
else if (offset == 10) else if (offset == 10)
{ {
/* palette base index */ /* 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) if (m_palette_index[3 + i] != newind)
{
m_palette_index[3 + i] = newind; m_palette_index[3 + i] = newind;
m_dirty_tmap[3 + i] = 1;
}
} }
if (!m_tilemaps_set) if (!m_tilemaps_set)
@ -234,18 +217,6 @@ int k053251_device::get_palette_index( int ci )
return m_palette_index[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() void k053251_device::reset_indexes()
{ {
m_palette_index[0] = 32 * ((m_ram[9] >> 0) & 0x03); 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) u8 k053251_device::read(offs_t offset)
{ {
return m_ram[offset]; return m_ram[offset]; // PCU1
} // PCU1 }

View File

@ -26,8 +26,6 @@ public:
void write(offs_t offset, u8 data); void write(offs_t offset, u8 data);
int get_priority(int ci); int get_priority(int ci);
int get_palette_index(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
@ -39,8 +37,6 @@ protected:
private: private:
// internal state // internal state
int m_dirty_tmap[5];
uint8_t m_ram[16]; uint8_t m_ram[16];
int m_tilemaps_set; int m_tilemaps_set;
int m_palette_index[5]; int m_palette_index[5];

View File

@ -158,7 +158,7 @@ private:
// misc // misc
int m_tmnt_soundlatch = 0; int m_tmnt_soundlatch = 0;
int m_last = 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 // devices
required_device<cpu_device> m_maincpu; required_device<cpu_device> m_maincpu;

View File

@ -236,7 +236,6 @@ public:
void glfgreat(machine_config &config); void glfgreat(machine_config &config);
private: private:
void k053251_glfgreat_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0);
uint8_t controller_r(); uint8_t controller_r();
uint16_t glfgreat_rom_r(offs_t offset); uint16_t glfgreat_rom_r(offs_t offset);
void glfgreat_122000_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); 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) void tmnt2_state::punkshot_main_map(address_map &map)
{ {
map(0x000000, 0x03ffff).rom(); 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); 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() uint8_t glfgreat_state::controller_r()
{ {
return m_analog_controller[m_controller_select]->read(); return m_analog_controller[m_controller_select]->read();