diff --git a/src/mame/drivers/sshangha.cpp b/src/mame/drivers/sshangha.cpp index 4187993a9b8..cf97d40a778 100644 --- a/src/mame/drivers/sshangha.cpp +++ b/src/mame/drivers/sshangha.cpp @@ -10,11 +10,6 @@ Emulation by Bryan McPhail, mish@tendril.co.uk + Charles MacDonald, David Haywood - ToDo: - - Palette handling is somewhat hacked, see paletteram16_xbgr_word_be_sprites_w - - check this on the original set - ---- Stephh's notes (based on the games M68000 code and some tests) : @@ -88,7 +83,6 @@ HB-PCB-A5 M6100691A (distributed by Taito) #include "cpu/m68000/m68000.h" #include "sound/2203intf.h" #include "sound/okim6295.h" -#include "machine/deco146.h" #include "screen.h" #include "speaker.h" @@ -102,7 +96,7 @@ HB-PCB-A5 M6100691A (distributed by Taito) -READ16_MEMBER(sshangha_state::sshanghb_protection16_r) // bootleg inputs +READ16_MEMBER(sshangha_state::sshanghab_protection16_r) // bootleg inputs { switch (offset) { @@ -123,11 +117,6 @@ READ16_MEMBER(sshangha_state::deco_71_r) return 0xffff; } -/******************************************************************************/ - -void sshangha_state::machine_reset() -{ -} /******************************************************************************/ @@ -167,7 +156,7 @@ WRITE16_MEMBER( sshangha_state::sshangha_protection_region_8_146_w ) /* - Swizzzle palette writes a bit so that the 'tilemap_12_combine_draw' code in the tilemap device works with this game (used for girl, see attract mode) + Swizzle palette writes a bit so that the 'tilemap_12_combine_draw' code in the tilemap device works with this game (used for girl, see attract mode) Normal Palette layout @@ -214,22 +203,22 @@ void sshangha_state::sshangha_map(address_map &map) { map.global_mask(0x3fffff); map(0x000000, 0x03ffff).rom(); - map(0x100000, 0x10000f).ram().share("sound_shared"); + map(0x100000, 0x10000f).ram().share(m_sound_shared_ram); - map(0x200000, 0x201fff).rw(m_deco_tilegen1, FUNC(deco16ic_device::pf1_data_r), FUNC(deco16ic_device::pf1_data_w)); - map(0x202000, 0x203fff).rw(m_deco_tilegen1, FUNC(deco16ic_device::pf2_data_r), FUNC(deco16ic_device::pf2_data_w)); - map(0x204000, 0x2047ff).ram().share("pf1_rowscroll"); - map(0x206000, 0x2067ff).ram().share("pf2_rowscroll"); + map(0x200000, 0x201fff).rw(m_tilegen, FUNC(deco16ic_device::pf1_data_r), FUNC(deco16ic_device::pf1_data_w)); + map(0x202000, 0x203fff).rw(m_tilegen, FUNC(deco16ic_device::pf2_data_r), FUNC(deco16ic_device::pf2_data_w)); + map(0x204000, 0x2047ff).ram().share(m_pf1_rowscroll); + map(0x206000, 0x2067ff).ram().share(m_pf2_rowscroll); map(0x206800, 0x207fff).ram(); - map(0x300000, 0x30000f).w(m_deco_tilegen1, FUNC(deco16ic_device::pf_control_w)); - map(0x320000, 0x320001).w(FUNC(sshangha_state::sshangha_video_w)); + map(0x300000, 0x30000f).w(m_tilegen, FUNC(deco16ic_device::pf_control_w)); + map(0x320000, 0x320001).w(FUNC(sshangha_state::video_w)); map(0x320002, 0x320005).nopw(); map(0x320006, 0x320007).nopr(); //irq ack - map(0x340000, 0x3407ff).mirror(0x800).ram().share("spriteram2"); + map(0x340000, 0x3407ff).mirror(0x800).ram().share(m_spriteram2); map(0x350000, 0x350001).r(FUNC(sshangha_state::deco_71_r)); map(0x350000, 0x350007).nopw(); - map(0x360000, 0x3607ff).mirror(0x800).ram().share("spriteram"); + map(0x360000, 0x3607ff).mirror(0x800).ram().share(m_spriteram); map(0x370000, 0x370001).r(FUNC(sshangha_state::deco_71_r)); map(0x370000, 0x370007).nopw(); @@ -237,22 +226,22 @@ void sshangha_state::sshangha_map(address_map &map) map(0x381000, 0x383fff).ram(); // unused palette area map(0x3e0000, 0x3e3fff).rw(FUNC(sshangha_state::sshangha_protection_region_8_146_r), FUNC(sshangha_state::sshangha_protection_region_8_146_w)); map(0x3ec000, 0x3f3fff).ram(); - map(0x3f4000, 0x3f7fff).rw(FUNC(sshangha_state::sshangha_protection_region_d_146_r), FUNC(sshangha_state::sshangha_protection_region_d_146_w)).share("prot_data"); + map(0x3f4000, 0x3f7fff).rw(FUNC(sshangha_state::sshangha_protection_region_d_146_r), FUNC(sshangha_state::sshangha_protection_region_d_146_w)).share(m_prot_data); } -void sshangha_state::sshanghb_map(address_map &map) +void sshangha_state::sshanghab_map(address_map &map) { map(0x000000, 0x03ffff).rom(); - map(0x084000, 0x0847ff).r(FUNC(sshangha_state::sshanghb_protection16_r)); - map(0x101000, 0x10100f).ram().share("sound_shared"); /* the bootleg writes here */ + map(0x084000, 0x0847ff).r(FUNC(sshangha_state::sshanghab_protection16_r)); + map(0x101000, 0x10100f).ram().share(m_sound_shared_ram); /* the bootleg writes here */ - map(0x200000, 0x201fff).rw(m_deco_tilegen1, FUNC(deco16ic_device::pf1_data_r), FUNC(deco16ic_device::pf1_data_w)); - map(0x202000, 0x203fff).rw(m_deco_tilegen1, FUNC(deco16ic_device::pf2_data_r), FUNC(deco16ic_device::pf2_data_w)); - map(0x204000, 0x2047ff).ram().share("pf1_rowscroll"); - map(0x206000, 0x2067ff).ram().share("pf2_rowscroll"); + map(0x200000, 0x201fff).rw(m_tilegen, FUNC(deco16ic_device::pf1_data_r), FUNC(deco16ic_device::pf1_data_w)); + map(0x202000, 0x203fff).rw(m_tilegen, FUNC(deco16ic_device::pf2_data_r), FUNC(deco16ic_device::pf2_data_w)); + map(0x204000, 0x2047ff).ram().share(m_pf1_rowscroll); + map(0x206000, 0x2067ff).ram().share(m_pf2_rowscroll); map(0x206800, 0x207fff).ram(); - map(0x300000, 0x30000f).w(m_deco_tilegen1, FUNC(deco16ic_device::pf_control_w)); - map(0x320000, 0x320001).w(FUNC(sshangha_state::sshangha_video_w)); + map(0x300000, 0x30000f).w(m_tilegen, FUNC(deco16ic_device::pf_control_w)); + map(0x320000, 0x320001).w(FUNC(sshangha_state::video_w)); map(0x320002, 0x320005).nopw(); map(0x320006, 0x320007).nopr(); //irq ack @@ -261,8 +250,8 @@ void sshangha_state::sshanghb_map(address_map &map) map(0x380000, 0x380fff).ram().rw(FUNC(sshangha_state::palette_r),FUNC(sshangha_state::palette_w)).share("palette"); map(0x381000, 0x383fff).ram(); // unused palette area - map(0x3c0000, 0x3c07ff).ram().share("spriteram"); // bootleg spriteram - map(0x3c0800, 0x3c0fff).ram().share("spriteram2"); + map(0x3c0000, 0x3c07ff).ram().share(m_spriteram); // bootleg spriteram + map(0x3c0800, 0x3c0fff).ram().share(m_spriteram2); map(0xfec000, 0xff3fff).ram(); map(0xff4000, 0xff47ff).ram(); @@ -272,23 +261,23 @@ void sshangha_state::sshanghb_map(address_map &map) /* 8 "sound latches" shared between main and sound cpus. */ -READ8_MEMBER(sshangha_state::sshangha_sound_shared_r) +READ8_MEMBER(sshangha_state::sound_shared_r) { return m_sound_shared_ram[offset] & 0xff; } -WRITE8_MEMBER(sshangha_state::sshangha_sound_shared_w) +WRITE8_MEMBER(sshangha_state::sound_shared_w) { m_sound_shared_ram[offset] = data & 0xff; } /* Note: there's rom data after 0x8000 but the game never seem to call a rom bank, left-over? */ -void sshangha_state::sshangha_sound_map(address_map &map) +void sshangha_state::sound_map(address_map &map) { map(0x0000, 0x7fff).rom(); map(0xc000, 0xc001).rw("ymsnd", FUNC(ym2203_device::read), FUNC(ym2203_device::write)); map(0xc200, 0xc201).rw("oki", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); - map(0xf800, 0xf807).rw(FUNC(sshangha_state::sshangha_sound_shared_r), FUNC(sshangha_state::sshangha_sound_shared_w)); + map(0xf800, 0xf807).rw(FUNC(sshangha_state::sound_shared_r), FUNC(sshangha_state::sound_shared_w)); map(0xf808, 0xffff).ram(); } @@ -420,79 +409,81 @@ DECO16IC_BANK_CB_MEMBER(sshangha_state::bank_callback) return (bank >> 4) * 0x1000; } -MACHINE_CONFIG_START(sshangha_state::sshangha) - +void sshangha_state::sshangha(machine_config &config) +{ /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M68000, 16_MHz_XTAL) /* CPU marked as 16MHz part */ - MCFG_DEVICE_PROGRAM_MAP(sshangha_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", sshangha_state, irq6_line_hold) + M68000(config, m_maincpu, 16_MHz_XTAL); /* CPU marked as 16MHz part */ + m_maincpu->set_addrmap(AS_PROGRAM, &sshangha_state::sshangha_map); + m_maincpu->set_vblank_int("screen", FUNC(sshangha_state::irq6_line_hold)); - MCFG_DEVICE_ADD("audiocpu", Z80, 16_MHz_XTAL / 4) - MCFG_DEVICE_PROGRAM_MAP(sshangha_sound_map) + Z80(config, m_audiocpu, 16_MHz_XTAL / 4); + m_audiocpu->set_addrmap(AS_PROGRAM, &sshangha_state::sound_map); - MCFG_QUANTUM_TIME(attotime::from_hz(6000)) - - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_REFRESH_RATE(60) - MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(529)) - MCFG_SCREEN_SIZE(40*8, 32*8) - MCFG_SCREEN_VISIBLE_AREA(0*8, 40*8-1, 1*8, 31*8-1) - MCFG_SCREEN_UPDATE_DRIVER(sshangha_state, screen_update_sshangha) - - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_sshangha) - MCFG_PALETTE_ADD("palette", 0x4000) - MCFG_PALETTE_FORMAT(XBGR) + config.m_minimum_quantum = attotime::from_hz(6000); - MCFG_DEVICE_ADD("tilegen1", DECO16IC, 0) - MCFG_DECO16IC_SPLIT(0) - MCFG_DECO16IC_PF1_SIZE(DECO_64x32) - MCFG_DECO16IC_PF2_SIZE(DECO_64x32) - MCFG_DECO16IC_PF1_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF2_TRANS_MASK(0x0f) - MCFG_DECO16IC_PF1_COL_BANK(0x30) - MCFG_DECO16IC_PF2_COL_BANK(0x20) - MCFG_DECO16IC_PF1_COL_MASK(0x0f) - MCFG_DECO16IC_PF2_COL_MASK(0x0f) - MCFG_DECO16IC_BANK1_CB(sshangha_state, bank_callback) - MCFG_DECO16IC_BANK2_CB(sshangha_state, bank_callback) - MCFG_DECO16IC_PF12_8X8_BANK(0) - MCFG_DECO16IC_PF12_16X16_BANK(1) - MCFG_DECO16IC_GFXDECODE("gfxdecode") + screen_device& screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); + screen.set_refresh_hz(60); + screen.set_vblank_time(ATTOSECONDS_IN_USEC(529)); + screen.set_size(40*8, 32*8); + screen.set_visarea(0*8, 40*8-1, 1*8, 31*8-1); + screen.set_screen_update(FUNC(sshangha_state::screen_update)); - MCFG_DEVICE_ADD("spritegen1", DECO_SPRITE, 0) - MCFG_DECO_SPRITE_GFX_REGION(2) - MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") + GFXDECODE(config, "gfxdecode", m_palette, gfx_sshangha); - MCFG_DEVICE_ADD("spritegen2", DECO_SPRITE, 0) - MCFG_DECO_SPRITE_GFX_REGION(3) - MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") + PALETTE(config, m_palette, 0x4000).set_format(PALETTE_FORMAT_XBGR); - MCFG_DECO146_ADD("ioprot") - MCFG_DECO146_IN_PORTA_CB(IOPORT("INPUTS")) - MCFG_DECO146_IN_PORTB_CB(IOPORT("SYSTEM")) - MCFG_DECO146_IN_PORTC_CB(IOPORT("DSW")) + DECO16IC(config, m_tilegen, 0); + m_tilegen->set_split(0); + m_tilegen->set_pf1_size(DECO_64x32); + m_tilegen->set_pf2_size(DECO_64x32); + m_tilegen->set_pf1_trans_mask(0x0f); + m_tilegen->set_pf2_trans_mask(0x0f); + m_tilegen->set_pf1_col_bank(0x30); + m_tilegen->set_pf2_col_bank(0x20); + m_tilegen->set_pf1_col_mask(0x0f); + m_tilegen->set_pf2_col_mask(0x0f); + m_tilegen->set_bank1_callback(FUNC(sshangha_state::bank_callback), this); + m_tilegen->set_bank2_callback(FUNC(sshangha_state::bank_callback), this); + m_tilegen->set_pf12_8x8_bank(0); + m_tilegen->set_pf12_16x16_bank(1); + m_tilegen->set_gfxdecode_tag("gfxdecode"); + + DECO_SPRITE(config, m_sprgen1, 0); + m_sprgen1->set_gfx_region(2); + m_sprgen1->set_gfxdecode_tag("gfxdecode"); + + DECO_SPRITE(config, m_sprgen2, 0); + m_sprgen2->set_gfx_region(3); + m_sprgen2->set_gfxdecode_tag("gfxdecode"); + + DECO146PROT(config, m_deco146, 0); + m_deco146->port_a_cb().set_ioport("INPUTS"); + m_deco146->port_b_cb().set_ioport("SYSTEM"); + m_deco146->port_c_cb().set_ioport("DSW"); /* sound hardware */ SPEAKER(config, "lspeaker").front_left(); // sure it's stereo? SPEAKER(config, "rspeaker").front_right(); - MCFG_DEVICE_ADD("ymsnd", YM2203, 16_MHz_XTAL / 4) - MCFG_YM2203_IRQ_HANDLER(INPUTLINE("audiocpu", 0)) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.33) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.33) + ym2203_device &ymsnd(YM2203(config, "ymsnd", 16_MHz_XTAL / 4)); + ymsnd.irq_handler().set_inputline(m_audiocpu, 0); + ymsnd.add_route(ALL_OUTPUTS, "lspeaker", 0.33); + ymsnd.add_route(ALL_OUTPUTS, "rspeaker", 0.33); - MCFG_DEVICE_ADD("oki", OKIM6295, 16_MHz_XTAL / 8, okim6295_device::PIN7_LOW) // clock frequency & pin 7 not verified - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.27) - MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.27) -MACHINE_CONFIG_END + okim6295_device &oki(OKIM6295(config, "oki", 16_MHz_XTAL / 8, okim6295_device::PIN7_LOW)); // clock frequency & pin 7 not verified + oki.add_route(ALL_OUTPUTS, "lspeaker", 0.27); + oki.add_route(ALL_OUTPUTS, "rspeaker", 0.27); +} -MACHINE_CONFIG_START(sshangha_state::sshanghb) +void sshangha_state::sshanghab(machine_config &config) +{ sshangha(config); - MCFG_DEVICE_MODIFY("maincpu") - MCFG_DEVICE_PROGRAM_MAP(sshanghb_map) -MACHINE_CONFIG_END + m_maincpu->set_addrmap(AS_PROGRAM, &sshangha_state::sshanghab_map); + + config.device_remove("ioprot"); +} /******************************************************************************/ @@ -588,6 +579,6 @@ void sshangha_state::init_sshangha() } -GAME( 1992, sshangha, 0, sshangha, sshangha, sshangha_state, init_sshangha, ROT0, "Hot-B", "Super Shanghai Dragon's Eye (World)", 0 ) -GAME( 1992, sshanghaj, sshangha, sshangha, sshangha, sshangha_state, init_sshangha, ROT0, "Hot-B", "Super Shanghai Dragon's Eye (Japan)", 0 ) -GAME( 1992, sshanghab, sshangha, sshanghb, sshangha, sshangha_state, init_sshangha, ROT0, "bootleg", "Super Shanghai Dragon's Eye (World, bootleg)", 0 ) +GAME( 1992, sshangha, 0, sshangha, sshangha, sshangha_state, init_sshangha, ROT0, "Hot-B", "Super Shanghai Dragon's Eye (World)", MACHINE_SUPPORTS_SAVE ) +GAME( 1992, sshanghaj, sshangha, sshangha, sshangha, sshangha_state, init_sshangha, ROT0, "Hot-B", "Super Shanghai Dragon's Eye (Japan)", MACHINE_SUPPORTS_SAVE ) +GAME( 1992, sshanghab, sshangha, sshanghab, sshangha, sshangha_state, init_sshangha, ROT0, "bootleg", "Super Shanghai Dragon's Eye (World, bootleg)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/includes/sshangha.h b/src/mame/includes/sshangha.h index 2512c035a1e..611ecfa76c5 100644 --- a/src/mame/includes/sshangha.h +++ b/src/mame/includes/sshangha.h @@ -11,7 +11,7 @@ public: sshangha_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), m_deco146(*this, "ioprot"), - m_deco_tilegen1(*this, "tilegen1"), + m_tilegen(*this, "tilegen"), m_spriteram(*this, "spriteram"), m_spriteram2(*this, "spriteram2"), m_sound_shared_ram(*this, "sound_shared"), @@ -25,16 +25,19 @@ public: m_palette(*this, "palette") { } - void sshanghb(machine_config &config); + void sshanghab(machine_config &config); void sshangha(machine_config &config); void init_sshangha(); +protected: + virtual void video_start() override; + private: optional_device m_deco146; - required_device m_deco_tilegen1; + required_device m_tilegen; required_shared_ptr m_spriteram; - optional_shared_ptr m_spriteram2; + required_shared_ptr m_spriteram2; required_shared_ptr m_sound_shared_ram; required_shared_ptr m_pf1_rowscroll; @@ -42,8 +45,11 @@ private: optional_shared_ptr m_prot_data; - optional_device m_sprgen1; - optional_device m_sprgen2; + required_device m_sprgen1; + required_device m_sprgen2; + required_device m_maincpu; + required_device m_audiocpu; + required_device m_palette; int m_video_control; DECO16IC_BANK_CB_MEMBER(bank_callback); @@ -52,26 +58,20 @@ private: DECLARE_WRITE16_MEMBER(sshangha_protection_region_8_146_w); DECLARE_READ16_MEMBER(sshangha_protection_region_d_146_r); DECLARE_WRITE16_MEMBER(sshangha_protection_region_d_146_w); + DECLARE_READ16_MEMBER(deco_71_r); + DECLARE_READ16_MEMBER(sshanghab_protection16_r); DECLARE_READ16_MEMBER(palette_r); DECLARE_WRITE16_MEMBER(palette_w); - DECLARE_READ16_MEMBER(sshanghb_protection16_r); - DECLARE_READ16_MEMBER(deco_71_r); - DECLARE_READ8_MEMBER(sshangha_sound_shared_r); - DECLARE_WRITE8_MEMBER(sshangha_sound_shared_w); + DECLARE_READ8_MEMBER(sound_shared_r); + DECLARE_WRITE8_MEMBER(sound_shared_w); - DECLARE_WRITE16_MEMBER(sshangha_video_w); + DECLARE_WRITE16_MEMBER(video_w); - virtual void machine_reset() override; - virtual void video_start() override; - uint32_t screen_update_sshangha(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); - - required_device m_maincpu; - required_device m_audiocpu; - required_device m_palette; + uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); void sshangha_map(address_map &map); - void sshangha_sound_map(address_map &map); - void sshanghb_map(address_map &map); + void sound_map(address_map &map); + void sshanghab_map(address_map &map); }; diff --git a/src/mame/video/deco16ic.h b/src/mame/video/deco16ic.h index 3ecd5f53f33..dd03e162cfc 100644 --- a/src/mame/video/deco16ic.h +++ b/src/mame/video/deco16ic.h @@ -35,8 +35,8 @@ public: // configuration void set_gfxdecode_tag(const char *tag) { m_gfxdecode.set_tag(tag); } // void set_palette_tag(const char *tag); - template void set_bank1_callback(Object &&cb) { m_bank1_cb = std::forward(cb); } - template void set_bank2_callback(Object &&cb) { m_bank2_cb = std::forward(cb); } + template void set_bank1_callback(T &&... args) { m_bank1_cb = deco16_bank_cb_delegate(std::forward(args)...); } + template void set_bank2_callback(T &&... args) { m_bank2_cb = deco16_bank_cb_delegate(std::forward(args)...); } void set_split(int split) { m_split = split; } void set_pf1_size(int size) { m_pf1_size = size; } void set_pf2_size(int size) { m_pf2_size = size; } @@ -173,10 +173,10 @@ DECLARE_DEVICE_TYPE(DECO16IC, deco16ic_device) #define MCFG_DECO16IC_SET_SCREEN MCFG_VIDEO_SET_SCREEN #define MCFG_DECO16IC_BANK1_CB(_class, _method) \ - downcast(*device).set_bank1_callback(deco16_bank_cb_delegate(&_class::_method, #_class "::" #_method, this)); + downcast(*device).set_bank1_callback(&_class::_method, #_class "::" #_method, this); #define MCFG_DECO16IC_BANK2_CB(_class, _method) \ - downcast(*device).set_bank2_callback(deco16_bank_cb_delegate(&_class::_method, #_class "::" #_method, this)); + downcast(*device).set_bank2_callback(&_class::_method, #_class "::" #_method, this); #define MCFG_DECO16IC_SPLIT(_split) \ downcast(*device).set_split(_split); diff --git a/src/mame/video/sshangha.cpp b/src/mame/video/sshangha.cpp index 270727bb0f4..789ba128820 100644 --- a/src/mame/video/sshangha.cpp +++ b/src/mame/video/sshangha.cpp @@ -13,11 +13,11 @@ /******************************************************************************/ -WRITE16_MEMBER(sshangha_state::sshangha_video_w) +WRITE16_MEMBER(sshangha_state::video_w) { /* 0x4: Special video mode, other bits unknown */ - m_video_control=data; -// popmessage("%04x",data); + m_video_control = data; +// popmessage("%04x", data); } /******************************************************************************/ @@ -26,17 +26,19 @@ void sshangha_state::video_start() { m_sprgen1->alloc_sprite_bitmap(); m_sprgen2->alloc_sprite_bitmap(); + + save_item(NAME(m_video_control)); } /******************************************************************************/ -uint32_t sshangha_state::screen_update_sshangha(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t sshangha_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { const bool combine_tilemaps = (m_video_control&4) ? false : true; // sprites are flipped relative to tilemaps address_space &space = machine().dummy_space(); - uint16_t flip = m_deco_tilegen1->pf_control_r(space, 0, 0xffff); + uint16_t flip = m_tilegen->pf_control_r(space, 0, 0xffff); flip_screen_set(BIT(flip, 7)); m_sprgen1->set_flip_screen(!BIT(flip, 7)); m_sprgen2->set_flip_screen(!BIT(flip, 7)); @@ -48,23 +50,23 @@ uint32_t sshangha_state::screen_update_sshangha(screen_device &screen, bitmap_rg // draw / mix bitmap.fill(m_palette->black_pen(), cliprect); - m_deco_tilegen1->pf_update(m_pf1_rowscroll, m_pf2_rowscroll); + m_tilegen->pf_update(m_pf1_rowscroll, m_pf2_rowscroll); // TODO: fully verify draw order / priorities /* the tilemap 4bpp + 4bpp = 8bpp mixing actually seems external to the tilemap, note video_control is not part of the tilemap chip */ if (combine_tilemaps) { - m_deco_tilegen1->tilemap_12_combine_draw(screen, bitmap, cliprect, 0, 0, 1); + m_tilegen->tilemap_12_combine_draw(screen, bitmap, cliprect, 0, 0, 1); } else { - m_deco_tilegen1->tilemap_2_draw(screen, bitmap, cliprect, 0, 0); + m_tilegen->tilemap_2_draw(screen, bitmap, cliprect, 0, 0); } // pri, primask,palbase,palmask m_sprgen1->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x000, 0x000, 0x000, 0x0ff); // low+high pri spr1 (definitely needs to be below low pri spr2 - game tiles & definitely needs to be below tilemap1 - lightning on win screen in traditional mode) m_sprgen2->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x200, 0x200, 0x100, 0x0ff); // low pri spr2 (definitely needs to be below tilemap1 - 2nd level failure screen etc.) if (!combine_tilemaps) - m_deco_tilegen1->tilemap_1_draw(screen, bitmap, cliprect, 0, 0); + m_tilegen->tilemap_1_draw(screen, bitmap, cliprect, 0, 0); // pri, primask,palbase,palmask m_sprgen2->inefficient_copy_sprite_bitmap(bitmap, cliprect, 0x000, 0x200, 0x100, 0x0ff); // high pri spr2 (definitely needs to be above tilemap1 - title logo)