diff options
| author | 2026-02-27 14:37:20 +1100 | |
|---|---|---|
| committer | 2026-02-27 14:37:20 +1100 | |
| commit | 1b6d94aec6f774a32f1fdac235c4a580cc35e34c (patch) | |
| tree | 33aea1d549dc7acfbc13c4e5bf8d03f5c2d82336 | |
| parent | 3781db17e2d016798d269e14367ff6b62761ff0e (diff) | |
capcom/lastduel.cpp: Reduced RAM size for Last Duel. [Jim Westfall]
| -rw-r--r-- | src/mame/capcom/lastduel.cpp | 16 | ||||
| -rw-r--r-- | src/mame/capcom/lastduel_v.cpp | 37 |
2 files changed, 26 insertions, 27 deletions
diff --git a/src/mame/capcom/lastduel.cpp b/src/mame/capcom/lastduel.cpp index 294733dd162..0aa34f1214e 100644 --- a/src/mame/capcom/lastduel.cpp +++ b/src/mame/capcom/lastduel.cpp @@ -161,11 +161,11 @@ void lastduel_state::lastduel_map(address_map &map) map(0xfc4004, 0xfc4005).portr("DSW1"); map(0xfc4006, 0xfc4007).portr("DSW2"); map(0xfc8000, 0xfc800f).w(FUNC(lastduel_state::vctrl_w)); - map(0xfcc000, 0xfcdfff).ram().w(FUNC(lastduel_state::txram_w)).share("txram"); - map(0xfd0000, 0xfd3fff).ram().w(FUNC(lastduel_state::lastduel_vram_w<0>)).share("vram_0"); - map(0xfd4000, 0xfd7fff).ram().w(FUNC(lastduel_state::lastduel_vram_w<1>)).share("vram_1"); + map(0xfcc000, 0xfcdfff).ram().w(FUNC(lastduel_state::txram_w)).share(m_txram); + map(0xfd0000, 0xfd3fff).ram().w(FUNC(lastduel_state::lastduel_vram_w<0>)).share(m_vram[0]); + map(0xfd4000, 0xfd7fff).ram().w(FUNC(lastduel_state::lastduel_vram_w<1>)).share(m_vram[1]); map(0xfd8000, 0xfd87ff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); - map(0xfe0000, 0xffffff).ram(); + map(0xfe0000, 0xfe7fff).mirror(0x018000).ram(); } void lastduel_state::madgear_map(address_map &map) @@ -178,11 +178,11 @@ void lastduel_state::madgear_map(address_map &map) map(0xfc4003, 0xfc4003).w(m_soundlatch, FUNC(generic_latch_8_device::write)); map(0xfc4004, 0xfc4005).portr("P1_P2"); map(0xfc4006, 0xfc4007).portr("SYSTEM"); - map(0xfc8000, 0xfc9fff).ram().w(FUNC(lastduel_state::txram_w)).share("txram"); + map(0xfc8000, 0xfc9fff).ram().w(FUNC(lastduel_state::txram_w)).share(m_txram); map(0xfcc000, 0xfcc7ff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); map(0xfd0000, 0xfd000f).w(FUNC(lastduel_state::vctrl_w)); - map(0xfd4000, 0xfd7fff).ram().w(FUNC(lastduel_state::madgear_vram_w<0>)).share("vram_0"); - map(0xfd8000, 0xfdffff).ram().w(FUNC(lastduel_state::madgear_vram_w<1>)).share("vram_1"); + map(0xfd4000, 0xfd7fff).ram().w(FUNC(lastduel_state::madgear_vram_w<0>)).share(m_vram[0]); + map(0xfd8000, 0xfdffff).ram().w(FUNC(lastduel_state::madgear_vram_w<1>)).share(m_vram[1]); map(0xff0000, 0xffffff).ram(); } @@ -205,7 +205,7 @@ void lastduel_state::mg_bankswitch_w(uint8_t data) void lastduel_state::madgear_sound_map(address_map &map) { map(0x0000, 0x7fff).rom(); - map(0x8000, 0xcfff).bankr("audiobank"); + map(0x8000, 0xcfff).bankr(m_audiobank); map(0xd000, 0xd7ff).ram(); map(0xf000, 0xf001).rw("ym1", FUNC(ym2203_device::read), FUNC(ym2203_device::write)); map(0xf002, 0xf003).rw("ym2", FUNC(ym2203_device::read), FUNC(ym2203_device::write)); diff --git a/src/mame/capcom/lastduel_v.cpp b/src/mame/capcom/lastduel_v.cpp index 18bbd23bfea..1ffe562b5f1 100644 --- a/src/mame/capcom/lastduel_v.cpp +++ b/src/mame/capcom/lastduel_v.cpp @@ -116,12 +116,12 @@ VIDEO_START_MEMBER(lastduel_state,madgear) void lastduel_state::flip_w(uint8_t data) { - flip_screen_set(data & 0x01); + flip_screen_set(BIT(data, 0)); - machine().bookkeeping().coin_lockout_w(0, ~data & 0x10); - machine().bookkeeping().coin_lockout_w(1, ~data & 0x20); - machine().bookkeeping().coin_counter_w(0, data & 0x40); - machine().bookkeeping().coin_counter_w(1, data & 0x80); + machine().bookkeeping().coin_lockout_w(0, BIT(~data, 4)); + machine().bookkeeping().coin_lockout_w(1, BIT(~data, 5)); + machine().bookkeeping().coin_counter_w(0, BIT(data, 6)); + machine().bookkeeping().coin_counter_w(1, BIT(data, 7)); } void lastduel_state::vctrl_w(offs_t offset, uint16_t data, uint16_t mem_mask) @@ -133,6 +133,7 @@ void lastduel_state::vctrl_w(offs_t offset, uint16_t data, uint16_t mem_mask) case 1: m_tilemap[0]->set_scrollx(0, data); break; case 2: m_tilemap[1]->set_scrolly(0, data); break; case 3: m_tilemap[1]->set_scrollx(0, data); break; + //case 4: sprite DMA trigger case 7: m_tilemap_priority = data; break; default: logerror("Unmapped video write %d %04x\n", offset, data); @@ -166,7 +167,7 @@ rgb_t lastduel_state::lastduel_RRRRGGGGBBBBIIII(uint32_t raw) void lastduel_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, int pri ) { - const uint16_t *buffered_spriteram16 = m_spriteram->buffer(); + uint16_t const *const buffered_spriteram16 = m_spriteram->buffer(); int offs; if (!m_sprite_pri_mask) @@ -175,9 +176,7 @@ void lastduel_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &clipre for (offs = 0x400 - 4; offs >= 0; offs -= 4) { - int attr, sy, sx, flipx, flipy, code, color; - - attr = buffered_spriteram16[offs + 1]; + int const attr = buffered_spriteram16[offs + 1]; if (m_sprite_pri_mask) /* only madgear seems to have this */ { if (pri == 1 && (attr & m_sprite_pri_mask)) @@ -186,15 +185,15 @@ void lastduel_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &clipre continue; } - code = buffered_spriteram16[offs]; - sx = buffered_spriteram16[offs + 3] & 0x1ff; - sy = buffered_spriteram16[offs + 2] & 0x1ff; + int const code = buffered_spriteram16[offs]; + int sx = buffered_spriteram16[offs + 3] & 0x1ff; + int sy = buffered_spriteram16[offs + 2] & 0x1ff; if (sy > 0x100) sy -= 0x200; - flipx = attr & 0x20; - flipy = attr & m_sprite_flipy_mask; /* 0x40 for lastduel, 0x80 for madgear */ - color = attr & 0x0f; + int flipx = attr & 0x20; + int flipy = attr & m_sprite_flipy_mask; /* 0x40 for lastduel, 0x80 for madgear */ + int const color = attr & 0x0f; if (flip_screen()) { @@ -205,10 +204,10 @@ void lastduel_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &clipre } m_gfxdecode->gfx(0)->transpen(bitmap,cliprect, - code, - color, - flipx,flipy, - sx,sy,15); + code, + color, + flipx,flipy, + sx, sy, 15); } } |
