From 3db113bac384385d3979357c1505eac88673d762 Mon Sep 17 00:00:00 2001 From: hap Date: Wed, 21 Dec 2022 23:12:19 +0100 Subject: splndrbt: get rid of tag lookup in screen update --- src/mame/alpha/champbas.cpp | 4 ++-- src/mame/alpha/champbas.h | 2 +- src/mame/alpha/champbas_v.cpp | 2 +- src/mame/alpha/equites.cpp | 38 ++++++++++++-------------------- src/mame/alpha/equites.h | 51 +++++++++++++++++++++++++++---------------- src/mame/alpha/equites_v.cpp | 6 ++--- 6 files changed, 53 insertions(+), 50 deletions(-) diff --git a/src/mame/alpha/champbas.cpp b/src/mame/alpha/champbas.cpp index 048e138450d..c5705d05b71 100644 --- a/src/mame/alpha/champbas.cpp +++ b/src/mame/alpha/champbas.cpp @@ -1,5 +1,5 @@ // license:BSD-3-Clause -// copyright-holders:Ernesto Corvi, Jarek Parchanski, Nicola Salmoria, hap +// copyright-holders:Ernesto Corvi, Jarek Parchanski, Nicola Salmoria /*************************************************************************** Talbot - (c) 1982 Alpha Denshi Co. @@ -1298,7 +1298,7 @@ void exctsccr_state::init_exctsccr() * *************************************/ -/* YEAR NAME PARENT MACHINE INPUT INIT MONITOR COMPANY, FULLNAME, FLAGS */ +/* YEAR NAME PARENT MACHINE INPUT INIT MONITOR COMPANY, FULLNAME, FLAGS */ GAME( 1982, talbot, 0, talbot, talbot, champbas_state, empty_init, ROT270, "Alpha Denshi Co. (Volt Electronics license)", "Talbot", MACHINE_SUPPORTS_SAVE ) GAME( 1983, champbas, 0, champbas, champbas, champbas_state, init_champbas, ROT0, "Alpha Denshi Co. (Sega license)", "Champion Base Ball", MACHINE_SUPPORTS_SAVE ) // no protection diff --git a/src/mame/alpha/champbas.h b/src/mame/alpha/champbas.h index 7bf3d3abbcc..666ca7ac63d 100644 --- a/src/mame/alpha/champbas.h +++ b/src/mame/alpha/champbas.h @@ -1,5 +1,5 @@ // license:BSD-3-Clause -// copyright-holders:Ernesto Corvi, Jarek Parchanski, Nicola Salmoria, hap +// copyright-holders:Ernesto Corvi, Jarek Parchanski, Nicola Salmoria /************************************************************************* Talbot - Champion Base Ball - Exciting Soccer diff --git a/src/mame/alpha/champbas_v.cpp b/src/mame/alpha/champbas_v.cpp index 36ea7d9a04c..8f427ae5a96 100644 --- a/src/mame/alpha/champbas_v.cpp +++ b/src/mame/alpha/champbas_v.cpp @@ -1,5 +1,5 @@ // license:BSD-3-Clause -// copyright-holders:Ernesto Corvi, Jarek Parchanski, Nicola Salmoria, hap +// copyright-holders:Ernesto Corvi, Jarek Parchanski, Nicola Salmoria /************************************************************************* Talbot - Champion Base Ball - Exciting Soccer diff --git a/src/mame/alpha/equites.cpp b/src/mame/alpha/equites.cpp index 497781b7788..ca9691ec76a 100644 --- a/src/mame/alpha/equites.cpp +++ b/src/mame/alpha/equites.cpp @@ -829,10 +829,6 @@ GFXDECODE_END void equites_state::machine_start() { - // zerofill - m_bgcolor = 0; - - // register for savestates save_item(NAME(m_bgcolor)); } @@ -840,8 +836,6 @@ void gekisou_state::machine_start() { equites_state::machine_start(); - m_gekisou_unknown_bit = 0; - save_item(NAME(m_gekisou_unknown_bit)); } @@ -852,10 +846,6 @@ void splndrbt_state::machine_start() save_item(NAME(m_fg_char_bank)); save_item(NAME(m_splndrbt_bg_scrollx)); save_item(NAME(m_splndrbt_bg_scrolly)); - - m_fg_char_bank = 0; - m_splndrbt_bg_scrollx = 0; - m_splndrbt_bg_scrolly = 0; } void equites_state::equites(machine_config &config) @@ -919,7 +909,7 @@ void splndrbt_state::splndrbt(machine_config &config) TIMER(config, "scantimer").configure_scanline(FUNC(splndrbt_state::splndrbt_scanline), "screen", 0, 1); LS259(config, m_mainlatch); - m_mainlatch->q_out_cb<0>().set(FUNC(equites_state::flip_screen_w)); + m_mainlatch->q_out_cb<0>().set(FUNC(splndrbt_state::flip_screen_w)); m_mainlatch->q_out_cb<1>().set(m_alpha_8201, FUNC(alpha_8201_device::mcu_start_w)); m_mainlatch->q_out_cb<2>().set(m_alpha_8201, FUNC(alpha_8201_device::bus_dir_w)).invert(); m_mainlatch->q_out_cb<3>().set(FUNC(splndrbt_state::splndrbt_selchar_w)); @@ -1256,7 +1246,7 @@ ROM_START( kouyakyu ) ROM_LOAD( "epr-6698.bin", 0x0a000, 0x2000, CRC(7adfd1ff) SHA1(b543dd6734a681a187dabf602bea390de663039c) ) ROM_REGION( 0x2000, "alpha_8201:mcu", 0 ) - ROM_LOAD( "alpha-8505_44801c57.bin", 0x0000, 0x2000, BAD_DUMP CRC(1f5a1405) SHA1(23f2e23db402f88037a5cbdab2935ec1b9a05298) ) // 8304 is not dumped yet, using 8505 instead + ROM_LOAD( "alpha-8505_44801c57.bin", 0x0000, 0x2000, BAD_DUMP CRC(1f5a1405) SHA1(23f2e23db402f88037a5cbdab2935ec1b9a05298) ) // 8304 is not dumped yet, using 8505 instead, works ok ROM_REGION( 0x1000, "gfx1", 0 ) // chars ROM_LOAD( "epr-6710.bin", 0x00000, 0x1000, CRC(accda190) SHA1(265d2fd92574d65e7890e48d5f305bf903a67bc8) ) @@ -1321,7 +1311,7 @@ ROM_START( gekisou ) ROM_LOAD( "v3.1e", 0x08000, 0x4000, CRC(0ab5e777) SHA1(9177c42418f022a65d73c3302873b894c5a137a4) ) ROM_REGION( 0x2000, "alpha_8201:mcu", 0 ) - ROM_LOAD( "alpha-8505_44801c57.bin", 0x0000, 0x2000, BAD_DUMP CRC(1f5a1405) SHA1(23f2e23db402f88037a5cbdab2935ec1b9a05298) ) // 8304 is not dumped yet, using 8505 instead + ROM_LOAD( "alpha-8505_44801c57.bin", 0x0000, 0x2000, BAD_DUMP CRC(1f5a1405) SHA1(23f2e23db402f88037a5cbdab2935ec1b9a05298) ) // 8304 is not dumped yet, using 8505 instead, works ok ROM_REGION( 0x1000, "gfx1", 0 ) // chars ROM_LOAD( "0.5c", 0x00000, 0x1000, CRC(7e8bf4d1) SHA1(8abb82be006e8d1df449a5f83d59637314405119) ) @@ -1417,11 +1407,11 @@ ROM_START( splndrbt ) ROM_REGION( 0x0020, "prom", 0 ) ROM_LOAD( "3h.bpr", 0x00000, 0x020, CRC(33b98466) SHA1(017c73cf8c17dc5047c89316ae5b45f8d22092e8) ) - ROM_REGION( 0x2100, "user1", 0 ) // bg scaling + ROM_REGION( 0x2100, "scale1", 0 ) // bg scaling ROM_LOAD( "0.8h", 0x0000, 0x2000, CRC(12681fb5) SHA1(7a0930819d4cd00475d1897128daa6ac865e07d0) ) // x ROM_LOAD( "1.9j", 0x2000, 0x0100, CRC(f5b9b777) SHA1(a4ec731be77306db6baf319391c4fe78517fe43e) ) // y - ROM_REGION( 0x0200, "user2", 0 ) // sprite scaling + ROM_REGION( 0x0200, "scale2", 0 ) // sprite scaling ROM_LOAD( "4.7m", 0x0000, 0x0100, CRC(12cbcd2c) SHA1(a7946820bbf3f7e110a328b673123988af97ce7e) ) // x ROM_LOAD( "s3.8l", 0x0100, 0x0100, CRC(1314b0b5) SHA1(31ef4b916110581390afc1ba90c5dca7c08c619f) ) // y ROM_END @@ -1465,11 +1455,11 @@ ROM_START( splndrbta ) ROM_REGION( 0x0020, "prom", 0 ) ROM_LOAD( "3h.bpr", 0x00000, 0x020, CRC(33b98466) SHA1(017c73cf8c17dc5047c89316ae5b45f8d22092e8) ) - ROM_REGION( 0x2100, "user1", 0 ) // bg scaling + ROM_REGION( 0x2100, "scale1", 0 ) // bg scaling ROM_LOAD( "0.8h", 0x0000, 0x2000, CRC(12681fb5) SHA1(7a0930819d4cd00475d1897128daa6ac865e07d0) ) // x ROM_LOAD( "1.9j", 0x2000, 0x0100, CRC(f5b9b777) SHA1(a4ec731be77306db6baf319391c4fe78517fe43e) ) // y - ROM_REGION( 0x0200, "user2", 0 ) // sprite scaling + ROM_REGION( 0x0200, "scale2", 0 ) // sprite scaling ROM_LOAD( "4.7m", 0x0000, 0x0100, CRC(12cbcd2c) SHA1(a7946820bbf3f7e110a328b673123988af97ce7e) ) // x ROM_LOAD( "s3.8l", 0x0100, 0x0100, CRC(1314b0b5) SHA1(31ef4b916110581390afc1ba90c5dca7c08c619f) ) // y ROM_END @@ -1515,11 +1505,11 @@ ROM_START( splndrbtb ) ROM_REGION( 0x0020, "prom", 0 ) ROM_LOAD( "3h.bpr", 0x00000, 0x020, CRC(33b98466) SHA1(017c73cf8c17dc5047c89316ae5b45f8d22092e8) ) - ROM_REGION( 0x2100, "user1", 0 ) // bg scaling + ROM_REGION( 0x2100, "scale1", 0 ) // bg scaling ROM_LOAD( "0.8h", 0x0000, 0x2000, CRC(12681fb5) SHA1(7a0930819d4cd00475d1897128daa6ac865e07d0) ) // x ROM_LOAD( "1.9j", 0x2000, 0x0100, CRC(f5b9b777) SHA1(a4ec731be77306db6baf319391c4fe78517fe43e) ) // y - ROM_REGION( 0x0200, "user2", 0 ) // sprite scaling + ROM_REGION( 0x0200, "scale2", 0 ) // sprite scaling ROM_LOAD( "4.7m", 0x0000, 0x0100, CRC(12cbcd2c) SHA1(a7946820bbf3f7e110a328b673123988af97ce7e) ) // x ROM_LOAD( "s3.8l", 0x0100, 0x0100, CRC(1314b0b5) SHA1(31ef4b916110581390afc1ba90c5dca7c08c619f) ) // y ROM_END @@ -1567,11 +1557,11 @@ ROM_START( splndrbt2 ) ROM_REGION( 0x0020, "prom", 0 ) ROM_LOAD( "3h.bpr", 0x00000, 0x020, CRC(33b98466) SHA1(017c73cf8c17dc5047c89316ae5b45f8d22092e8) ) - ROM_REGION( 0x2100, "user1", 0 ) // bg scaling + ROM_REGION( 0x2100, "scale1", 0 ) // bg scaling ROM_LOAD( "0.h7", 0x0000, 0x2000, CRC(12681fb5) SHA1(7a0930819d4cd00475d1897128daa6ac865e07d0) ) // x ROM_LOAD( "1.9j", 0x2000, 0x0100, CRC(f5b9b777) SHA1(a4ec731be77306db6baf319391c4fe78517fe43e) ) // y - ROM_REGION( 0x0200, "user2", 0 ) // sprite scaling + ROM_REGION( 0x0200, "scale2", 0 ) // sprite scaling ROM_LOAD( "4.7m", 0x0000, 0x0100, CRC(12cbcd2c) SHA1(a7946820bbf3f7e110a328b673123988af97ce7e) ) // x ROM_LOAD( "s3.8l", 0x0100, 0x0100, CRC(1314b0b5) SHA1(31ef4b916110581390afc1ba90c5dca7c08c619f) ) // y ROM_END @@ -1606,7 +1596,7 @@ ROM_START( hvoltage ) ROM_LOAD( "7_v.1e", 0x08000, 0x4000, CRC(44d38554) SHA1(6765971376eafa218fda1accb1e173a7c1850cc8) ) ROM_REGION( 0x2000, "alpha_8201:mcu", 0 ) - ROM_LOAD( "alpha-8505_44801c57.bin", 0x0000, 0x2000, BAD_DUMP CRC(1f5a1405) SHA1(23f2e23db402f88037a5cbdab2935ec1b9a05298) ) // 8304 is not dumped yet, using 8505 instead + ROM_LOAD( "alpha-8505_44801c57.bin", 0x0000, 0x2000, BAD_DUMP CRC(1f5a1405) SHA1(23f2e23db402f88037a5cbdab2935ec1b9a05298) ) // 8304 is not dumped yet, using 8505 instead, works ok ROM_REGION( 0x2000, "gfx1", 0 ) // chars ROM_LOAD( "5.8c", 0x00000, 0x2000, CRC(656d53cd) SHA1(9971ed7e7da0e8bf46e97e8f75a2c2201b33fc2f) ) @@ -1633,11 +1623,11 @@ ROM_START( hvoltage ) ROM_REGION( 0x0020, "prom", 0 ) ROM_LOAD( "3h.bpr", 0x00000, 0x020, CRC(33b98466) SHA1(017c73cf8c17dc5047c89316ae5b45f8d22092e8) ) - ROM_REGION( 0x2100, "user1", 0 ) // bg scaling + ROM_REGION( 0x2100, "scale1", 0 ) // bg scaling ROM_LOAD( "0.8h", 0x0000, 0x2000, CRC(12681fb5) SHA1(7a0930819d4cd00475d1897128daa6ac865e07d0) ) // x ROM_LOAD( "1.9j", 0x2000, 0x0100, CRC(f5b9b777) SHA1(a4ec731be77306db6baf319391c4fe78517fe43e) ) // y - ROM_REGION( 0x0200, "user2", 0 ) // sprite scaling + ROM_REGION( 0x0200, "scale2", 0 ) // sprite scaling ROM_LOAD( "4.7m", 0x0000, 0x0100, CRC(12cbcd2c) SHA1(a7946820bbf3f7e110a328b673123988af97ce7e) ) // x ROM_LOAD( "3.8l", 0x0100, 0x0100, CRC(1314b0b5) SHA1(31ef4b916110581390afc1ba90c5dca7c08c619f) ) // y ROM_END diff --git a/src/mame/alpha/equites.h b/src/mame/alpha/equites.h index da751ece1c8..9b03bd67238 100644 --- a/src/mame/alpha/equites.h +++ b/src/mame/alpha/equites.h @@ -34,18 +34,18 @@ public: m_mainlatch(*this, "mainlatch") { } - /* memory pointers */ + void equites(machine_config &config); + void bngotime(machine_config &config); + void init_equites(); + +protected: + // memory pointers required_shared_ptr m_bg_videoram; - std::unique_ptr m_fg_videoram; // 8bits + std::unique_ptr m_fg_videoram; // 8bits required_shared_ptr m_spriteram; optional_shared_ptr m_spriteram_2; - /* video-related */ - tilemap_t *m_fg_tilemap = nullptr; - tilemap_t *m_bg_tilemap = nullptr; - uint8_t m_bgcolor = 0U; - - /* devices */ + // devices required_device m_maincpu; required_device m_gfxdecode; required_device m_palette; @@ -53,6 +53,11 @@ public: required_device m_alpha_8201; required_device m_mainlatch; + // video-related + tilemap_t *m_fg_tilemap = nullptr; + tilemap_t *m_bg_tilemap = nullptr; + uint8_t m_bgcolor = 0U; + uint16_t equites_spriteram_kludge_r(); uint8_t equites_fg_videoram_r(offs_t offset); void equites_fg_videoram_w(offs_t offset, uint8_t data); @@ -60,7 +65,6 @@ public: void equites_bgcolor_w(offs_t offset, uint8_t data); void equites_scrollreg_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); DECLARE_WRITE_LINE_MEMBER(flip_screen_w); - void init_equites(); TILE_GET_INFO_MEMBER(equites_fg_info); TILE_GET_INFO_MEMBER(equites_bg_info); DECLARE_VIDEO_START(equites); @@ -71,29 +75,31 @@ public: void equites_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); void unpack_block(const char *region, int offset, int size); void unpack_region(const char *region); - void equites(machine_config &config); - void bngotime(machine_config &config); -protected: virtual void machine_start() override; void bngotime_map(address_map &map); void equites_map(address_map &map); void equites_common_map(address_map &map); }; + class gekisou_state : public equites_state { public: - using equites_state::equites_state; + gekisou_state(const machine_config &mconfig, device_type type, const char *tag) : + equites_state(mconfig, type, tag) + { } + DECLARE_READ_LINE_MEMBER(gekisou_unknown_bit_r); void gekisou(machine_config &config); protected: virtual void machine_start() override; + +private: void gekisou_map(address_map &map); void gekisou_unknown_bit_w(offs_t offset, uint16_t data); -private: int m_gekisou_unknown_bit = 0; }; @@ -101,12 +107,20 @@ private: class splndrbt_state : public equites_state { public: - using equites_state::equites_state; + splndrbt_state(const machine_config &mconfig, device_type type, const char *tag) : + equites_state(mconfig, type, tag), + m_scale_rom(*this, "scale%u", 1U) + { } + void init_splndrbt(); void splndrbt(machine_config &config); protected: virtual void machine_start() override; + +private: + required_region_ptr_array m_scale_rom; + void splndrbt_map(address_map &map); DECLARE_WRITE_LINE_MEMBER(splndrbt_selchar_w); void splndrbt_bg_scrollx_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); @@ -120,10 +134,9 @@ protected: void splndrbt_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); void splndrbt_copy_bg(bitmap_ind16 &dst_bitmap, const rectangle &cliprect); -private: - int m_fg_char_bank = 0; - uint16_t m_splndrbt_bg_scrollx = 0U; - uint16_t m_splndrbt_bg_scrolly = 0U; + int m_fg_char_bank = 0; + uint16_t m_splndrbt_bg_scrollx = 0U; + uint16_t m_splndrbt_bg_scrolly = 0U; }; #endif // MAME_INCLUDES_EQUITES_H diff --git a/src/mame/alpha/equites_v.cpp b/src/mame/alpha/equites_v.cpp index 394d70652af..b4aaafb80b4 100644 --- a/src/mame/alpha/equites_v.cpp +++ b/src/mame/alpha/equites_v.cpp @@ -264,7 +264,7 @@ void equites_state::equites_draw_sprites(bitmap_ind16 &bitmap, const rectangle & /* -This is (probabbly) the sprite x scaling PROM. +This is (probably) the sprite x scaling PROM. The layout is strange. Clearly every line os for one xscale setting. However, it seems that bytes 0-3 are handled separately from bytes 4-F. Also, note that sprites are 30x30, not 32x32. @@ -288,7 +288,7 @@ Also, note that sprites are 30x30, not 32x32. void splndrbt_state::splndrbt_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect) { - const uint8_t * const xrom = memregion("user2")->base(); + const uint8_t * const xrom = m_scale_rom[1]; const uint8_t * const yrom = xrom + 0x100; gfx_element* gfx = m_gfxdecode->gfx(2); @@ -364,7 +364,7 @@ void splndrbt_state::splndrbt_copy_bg(bitmap_ind16 &dst_bitmap, const rectangle { bitmap_ind16 &src_bitmap = m_bg_tilemap->pixmap(); bitmap_ind8 &flags_bitmap = m_bg_tilemap->flagsmap(); - const uint8_t * const xrom = memregion("user1")->base(); + const uint8_t * const xrom = m_scale_rom[0]; const uint8_t * const yrom = xrom + 0x2000; int scroll_x = m_splndrbt_bg_scrollx; int scroll_y = m_splndrbt_bg_scrolly; -- cgit v1.2.3