diff options
Diffstat (limited to 'src/mame/drivers/jokrwild.cpp')
-rw-r--r-- | src/mame/drivers/jokrwild.cpp | 45 |
1 files changed, 24 insertions, 21 deletions
diff --git a/src/mame/drivers/jokrwild.cpp b/src/mame/drivers/jokrwild.cpp index 63610e2cc4f..38c53c9fbe6 100644 --- a/src/mame/drivers/jokrwild.cpp +++ b/src/mame/drivers/jokrwild.cpp @@ -85,32 +85,36 @@ class jokrwild_state : public driver_device { public: - jokrwild_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), + jokrwild_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), m_videoram(*this, "videoram"), m_colorram(*this, "colorram"), m_maincpu(*this, "maincpu"), - m_gfxdecode(*this, "gfxdecode") { } + m_gfxdecode(*this, "gfxdecode") + { } void jokrwild(machine_config &config); void init_jokrwild(); +protected: + virtual void video_start() override; + private: required_shared_ptr<uint8_t> m_videoram; required_shared_ptr<uint8_t> m_colorram; tilemap_t *m_bg_tilemap; + required_device<cpu_device> m_maincpu; + required_device<gfxdecode_device> m_gfxdecode; + DECLARE_WRITE8_MEMBER(jokrwild_videoram_w); DECLARE_WRITE8_MEMBER(jokrwild_colorram_w); DECLARE_READ8_MEMBER(rng_r); DECLARE_WRITE8_MEMBER(testa_w); DECLARE_WRITE8_MEMBER(testb_w); TILE_GET_INFO_MEMBER(get_bg_tile_info); - virtual void video_start() override; - DECLARE_PALETTE_INIT(jokrwild); + void jokrwild_palette(palette_device &palette) const; uint32_t screen_update_jokrwild(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - required_device<cpu_device> m_maincpu; - required_device<gfxdecode_device> m_gfxdecode; void jokrwild_map(address_map &map); }; @@ -156,7 +160,7 @@ uint32_t jokrwild_state::screen_update_jokrwild(screen_device &screen, bitmap_in return 0; } -PALETTE_INIT_MEMBER(jokrwild_state, jokrwild) +void jokrwild_state::jokrwild_palette(palette_device &palette) const { //missing proms } @@ -436,9 +440,8 @@ MACHINE_CONFIG_START(jokrwild_state::jokrwild) MCFG_SCREEN_UPDATE_DRIVER(jokrwild_state, screen_update_jokrwild) MCFG_SCREEN_PALETTE("palette") - MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_jokrwild) - MCFG_PALETTE_ADD("palette", 512) - MCFG_PALETTE_INIT_OWNER(jokrwild_state, jokrwild) + GFXDECODE(config, m_gfxdecode, "palette", gfx_jokrwild); + PALETTE(config, "palette", FUNC(jokrwild_state::jokrwild_palette), 512); mc6845_device &crtc(MC6845(config, "crtc", MASTER_CLOCK/16)); /* guess */ crtc.set_screen("screen"); @@ -484,22 +487,22 @@ ROM_END **************************/ void jokrwild_state::init_jokrwild() -/***************************************************************************** +{ + /***************************************************************************** - Encryption was made by pages of 256 bytes. + Encryption was made by pages of 256 bytes. - For each page, the value is XORed with a fixed value (0xCC), - then XORed again with the offset of the original value inside its own page. + For each page, the value is XORed with a fixed value (0xCC), + then XORed again with the offset of the original value inside its own page. - Example: + Example: - For encrypted value at offset 0x123A (0x89)... + For encrypted value at offset 0x123A (0x89)... - 0x89 XOR 0xCC XOR 0x3A = 0x7F + 0x89 XOR 0xCC XOR 0x3A = 0x7F -*****************************************************************************/ -{ - uint8_t *srcp = memregion( "maincpu" )->base(); + *****************************************************************************/ + uint8_t *const srcp = memregion( "maincpu" )->base(); for (int i = 0x8000; i < 0x10000; i++) { int offs = i & 0xff; |