diff options
| author | 2024-04-17 18:06:42 +0200 | |
|---|---|---|
| committer | 2024-04-17 18:06:42 +0200 | |
| commit | 4aabcb5c73dfa232608f78ba272214d0aed1e2f1 (patch) | |
| tree | c2554c79b0a6428107430de6a0b398dfd7cd21e4 | |
| parent | be3f632ddf36dfb0c2c86c037347ffa7b1f92706 (diff) | |
bmc/bmcpokr.cpp: ported over backpen handling from bmc/koftball.cpp, fixes some minor GFX problems
| -rw-r--r-- | src/mame/bmc/bmcpokr.cpp | 10 | ||||
| -rw-r--r-- | src/mame/bmc/koftball.cpp | 72 |
2 files changed, 42 insertions, 40 deletions
diff --git a/src/mame/bmc/bmcpokr.cpp b/src/mame/bmc/bmcpokr.cpp index a199ee27178..63331cebcb5 100644 --- a/src/mame/bmc/bmcpokr.cpp +++ b/src/mame/bmc/bmcpokr.cpp @@ -50,6 +50,7 @@ public: m_pixram(*this, "pixram"), m_priority(*this, "priority"), m_layerctrl(*this, "layerctrl"), + m_backpen(*this, "backpen"), m_gfxdecode(*this, "gfxdecode"), m_palette(*this, "palette"), m_dsw(*this, "DSW%u", 1U), @@ -78,6 +79,7 @@ private: required_shared_ptr<uint16_t> m_pixram; required_shared_ptr<uint16_t> m_priority; required_shared_ptr<uint16_t> m_layerctrl; + required_shared_ptr<uint16_t> m_backpen; required_device<gfxdecode_device> m_gfxdecode; required_device<palette_device> m_palette; @@ -283,7 +285,7 @@ uint32_t bmcpokr_state::screen_update(screen_device &screen, bitmap_ind16 &bitma } #endif - bitmap.fill(m_palette->black_pen(), cliprect); + bitmap.fill(*m_backpen, cliprect); if (layers_ctrl & 2) draw_layer(screen, bitmap, cliprect, 2); /* @@ -424,7 +426,7 @@ void bmcpokr_state::bmcpokr_mem(address_map &map) map(0x340009, 0x340009).w(FUNC(bmcpokr_state::irq_enable_w)); map(0x34000e, 0x34000f).ram().share(m_priority); // 34000f.b, w (priority?) map(0x340017, 0x340017).w(FUNC(bmcpokr_state::pixpal_w)); - map(0x340018, 0x340019).ram(); // 340019.b, w + map(0x340018, 0x340019).ram().share(m_backpen); // 340019.b, w map(0x34001a, 0x34001b).r(FUNC(bmcpokr_state::unk_r)).nopw(); map(0x34001c, 0x34001d).ram(); // 34001d.b, w(0) @@ -508,7 +510,7 @@ void bmcpokr_state::mjmaglmp_map(address_map &map) map(0x3ca009, 0x3ca009).w(FUNC(bmcpokr_state::irq_enable_w)); map(0x3ca00e, 0x3ca00f).ram().share(m_priority); // 3ca00f.b, w (priority?) map(0x3ca017, 0x3ca017).w(FUNC(bmcpokr_state::pixpal_w)); - map(0x3ca018, 0x3ca019).ram(); // 3ca019.b, w + map(0x3ca018, 0x3ca019).ram().share(m_backpen); // 3ca019.b, w map(0x3ca01a, 0x3ca01b).r(FUNC(bmcpokr_state::unk_r)).nopw(); map(0x3ca01c, 0x3ca01d).ram(); // 3ca01d.b, w(0) } @@ -540,7 +542,7 @@ void bmcpokr_state::shendeng_map(address_map &map) map(0x370009, 0x370009).w(FUNC(bmcpokr_state::irq_enable_w)); map(0x37000e, 0x37000f).ram().share(m_priority); // 37000f.b, w (priority?) map(0x370017, 0x370017).w(FUNC(bmcpokr_state::pixpal_w)); - map(0x370018, 0x370019).ram(); // 370019.b, w + map(0x370018, 0x370019).ram().share(m_backpen); // 370019.b, w map(0x37001a, 0x37001b).r(FUNC(bmcpokr_state::unk_r)).nopw(); map(0x37001c, 0x37001d).ram(); // 3ca01d.b, w(0) map(0x380001, 0x380001).w("ramdac", FUNC(ramdac_device::index_w)); diff --git a/src/mame/bmc/koftball.cpp b/src/mame/bmc/koftball.cpp index 994518a229a..44a5e681cd5 100644 --- a/src/mame/bmc/koftball.cpp +++ b/src/mame/bmc/koftball.cpp @@ -91,31 +91,31 @@ protected: private: required_device<cpu_device> m_maincpu; - optional_shared_ptr<uint16_t> m_main_ram; - required_shared_ptr_array<uint16_t, 4> m_videoram; - required_shared_ptr<uint16_t> m_pixram; + optional_shared_ptr<u16> m_main_ram; + required_shared_ptr_array<u16, 4> m_videoram; + required_shared_ptr<u16> m_pixram; required_device<gfxdecode_device> m_gfxdecode; required_device<palette_device> m_palette; tilemap_t *m_tilemap[4]{}; - uint16_t m_prot_data = 0; - uint8_t m_irq_enable = 0; - uint8_t m_gfx_ctrl = 0; - uint8_t m_priority = 0; - uint8_t m_backpen = 0; + u16 m_prot_data = 0; + u8 m_irq_enable = 0; + u8 m_gfx_ctrl = 0; + u8 m_priority = 0; + u8 m_backpen = 0; std::unique_ptr<bitmap_ind16> m_pixbitmap; - uint8_t m_pixpal = 0; + u8 m_pixpal = 0; - void irq_ack_w(uint8_t data); - uint16_t random_number_r(); - uint16_t prot_r(); - void prot_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); - void pixpal_w(offs_t offset, uint8_t data, uint8_t mem_mask = ~0); - template <uint8_t Which> void videoram_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); + void irq_ack_w(u8 data); + u16 random_number_r(); + u16 prot_r(); + void prot_w(offs_t offset, u16 data, u16 mem_mask = ~0); + void pixpal_w(offs_t offset, u8 data, u8 mem_mask = ~0); + template <u8 Which> void videoram_w(offs_t offset, u16 data, u16 mem_mask = ~0); - template <uint8_t Which> TILE_GET_INFO_MEMBER(get_tile_info); + template <u8 Which> TILE_GET_INFO_MEMBER(get_tile_info); void draw_pixlayer(bitmap_ind16 &bitmap, const rectangle &cliprect); - uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + u32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_DEVICE_CALLBACK_MEMBER(interrupt); void jxzh_mem(address_map &map); @@ -136,14 +136,14 @@ void koftball_state::machine_start() save_item(NAME(m_pixpal)); } -template <uint8_t Which> +template <u8 Which> TILE_GET_INFO_MEMBER(koftball_state::get_tile_info) { int const data = m_videoram[Which][tile_index]; tileinfo.set(0, data, 0, 0); } -void koftball_state::pixpal_w(offs_t offset, uint8_t data, uint8_t mem_mask) +void koftball_state::pixpal_w(offs_t offset, u8 data, u8 mem_mask) { COMBINE_DATA(&m_pixpal); } @@ -175,7 +175,7 @@ void koftball_state::draw_pixlayer(bitmap_ind16 &bitmap, const rectangle &clipre for (int x = cliprect.min_x; x <= cliprect.max_x >> 2; x++) { const u16 tile_data = m_pixram[(pitch + x) & 0xffff]; - for (int xi = 0; xi < 4; xi ++) + for (int xi = 0; xi < 4; xi++) { const u8 nibble = (tile_data >> ((3 - xi) * 4)) & 0xf; if (nibble) @@ -185,7 +185,7 @@ void koftball_state::draw_pixlayer(bitmap_ind16 &bitmap, const rectangle &clipre } } -uint32_t koftball_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +u32 koftball_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { /* TODO: @@ -239,13 +239,13 @@ uint32_t koftball_state::screen_update(screen_device &screen, bitmap_ind16 &bitm return 0; } -uint16_t koftball_state::random_number_r() +u16 koftball_state::random_number_r() { return machine().rand(); } -uint16_t koftball_state::prot_r() +u16 koftball_state::prot_r() { switch (m_prot_data) { @@ -259,19 +259,19 @@ uint16_t koftball_state::prot_r() return machine().rand(); } -void koftball_state::prot_w(offs_t offset, uint16_t data, uint16_t mem_mask) +void koftball_state::prot_w(offs_t offset, u16 data, u16 mem_mask) { COMBINE_DATA(&m_prot_data); } -template <uint8_t Which> -void koftball_state::videoram_w(offs_t offset, uint16_t data, uint16_t mem_mask) +template <u8 Which> +void koftball_state::videoram_w(offs_t offset, u16 data, u16 mem_mask) { COMBINE_DATA(&m_videoram[Which][offset]); m_tilemap[Which]->mark_tile_dirty(offset); } -void koftball_state::irq_ack_w(uint8_t data) +void koftball_state::irq_ack_w(u8 data) { for (int i = 1; i < 8; i++) if (BIT(data, i)) @@ -292,10 +292,10 @@ void koftball_state::koftball_mem(address_map &map) map(0x280000, 0x29ffff).ram().share(m_pixram); map(0x2a0007, 0x2a0007).w(FUNC(koftball_state::irq_ack_w)); - map(0x2a0009, 0x2a0009).lw8(NAME([this] (uint8_t data) { m_irq_enable = data; })); - map(0x2a000f, 0x2a000f).lw8(NAME([this] (uint8_t data) { m_priority = data; LOGGFX("GFX ctrl $2a000f (priority) %02x\n", data); })); + map(0x2a0009, 0x2a0009).lw8(NAME([this] (u8 data) { m_irq_enable = data; })); + map(0x2a000f, 0x2a000f).lw8(NAME([this] (u8 data) { m_priority = data; LOGGFX("GFX ctrl $2a000f (priority) %02x\n", data); })); map(0x2a0017, 0x2a0017).w(FUNC(koftball_state::pixpal_w)); - map(0x2a0019, 0x2a0019).lw8(NAME([this] (uint8_t data) { m_backpen = data; LOGGFX("GFX ctrl $2a0019 (backpen) %02x\n", data); })); + map(0x2a0019, 0x2a0019).lw8(NAME([this] (u8 data) { m_backpen = data; LOGGFX("GFX ctrl $2a0019 (backpen) %02x\n", data); })); map(0x2a001a, 0x2a001b).nopw(); map(0x2a0000, 0x2a001f).r(FUNC(koftball_state::random_number_r)); map(0x2b0000, 0x2b0001).portr("DSW"); @@ -310,7 +310,7 @@ void koftball_state::koftball_mem(address_map &map) map(0x2dc000, 0x2dc000).rw("oki", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); map(0x2f0000, 0x2f0003).portr("INPUTS"); map(0x300000, 0x300001).nopw(); - map(0x320000, 0x320000).lw8(NAME([this] (uint8_t data) { m_gfx_ctrl = data; LOGGFX("GFX ctrl 320000 %02x\n", data); })); + map(0x320000, 0x320000).lw8(NAME([this] (u8 data) { m_gfx_ctrl = data; LOGGFX("GFX ctrl $320000 (layer enable) %02x\n", data); })); map(0x340000, 0x340001).r(FUNC(koftball_state::prot_r)); map(0x360000, 0x360001).w(FUNC(koftball_state::prot_w)); } @@ -329,10 +329,10 @@ void koftball_state::jxzh_mem(address_map &map) map(0x280000, 0x29ffff).ram().share(m_pixram); map(0x2a0007, 0x2a0007).w(FUNC(koftball_state::irq_ack_w)); - map(0x2a0009, 0x2a0009).lw8(NAME([this] (uint8_t data) { m_irq_enable = data; })); - map(0x2a000f, 0x2a000f).lw8(NAME([this] (uint8_t data) { m_priority = data; LOGGFX("GFX ctrl $2a000f (priority) %02x\n", data); })); + map(0x2a0009, 0x2a0009).lw8(NAME([this] (u8 data) { m_irq_enable = data; })); + map(0x2a000f, 0x2a000f).lw8(NAME([this] (u8 data) { m_priority = data; LOGGFX("GFX ctrl $2a000f (priority) %02x\n", data); })); map(0x2a0017, 0x2a0017).w(FUNC(koftball_state::pixpal_w)); - map(0x2a0019, 0x2a0019).lw8(NAME([this] (uint8_t data) { m_backpen = data; LOGGFX("GFX ctrl $2a0019 (backpen) %02x\n", data); })); + map(0x2a0019, 0x2a0019).lw8(NAME([this] (u8 data) { m_backpen = data; LOGGFX("GFX ctrl $2a0019 (backpen) %02x\n", data); })); map(0x2a001a, 0x2a001d).nopw(); map(0x2a0000, 0x2a001f).r(FUNC(koftball_state::random_number_r)); map(0x2b0000, 0x2b0001).portr("DSW"); @@ -346,7 +346,7 @@ void koftball_state::jxzh_mem(address_map &map) map(0x2dc000, 0x2dc000).rw("oki", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); map(0x2f0000, 0x2f0001).portr("INPUTS"); map(0x300000, 0x300001).nopw(); - map(0x320000, 0x320000).lw8(NAME([this] (uint8_t data) { m_gfx_ctrl = data; LOGGFX("GFX ctrl 320000 %02x\n", data); })); + map(0x320000, 0x320000).lw8(NAME([this] (u8 data) { m_gfx_ctrl = data; LOGGFX("GFX ctrl $320000 (layer enable) %02x\n", data); })); map(0x340000, 0x340001).r(FUNC(koftball_state::prot_r)); map(0x360000, 0x360001).w(FUNC(koftball_state::prot_w)); map(0x380000, 0x380001).w(FUNC(koftball_state::prot_w)); @@ -656,7 +656,7 @@ ROM_END #if NVRAM_HACK -static const uint16_t nvram[]= +static const u16 nvram[]= { 0x0000,0x5555,0x0000,0x5555,0x0000,0x5555,0x0000,0x5555, 0x0000,0x5555,0x0000,0x0000,0x0000,0x0000,0x5555,0x5555, |
