nichibutsu/cclimber.cpp: Improves Swimmer driver and adds a new game set (#12446)

New machines added as WORKING
-----------------------------------
Au (Swimmer conversion) [Neill Baker Tech]

---------
Co-authored-by: hap <happppp@users.noreply.github.com>
This commit is contained in:
Neill Bakers 2024-06-29 16:17:20 +00:00 committed by GitHub
parent 962a32bb38
commit 7c38ac0330
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 565 additions and 375 deletions

View File

@ -33894,6 +33894,7 @@ terrafu // (c) 1987 Nichibutsu USA
terrafua // (c) 1987 Nichibutsu USA
@source:nichibutsu/cclimber.cpp
au // hack
bagmanf // bootleg on Falcon FCK-00 (Falcon Crazy Kong) PCB
bigkong // bootleg
cannonb // (c) 1985 Soft

File diff suppressed because it is too large Load Diff

View File

@ -10,6 +10,7 @@
#include "machine/gen_latch.h"
#include "emupal.h"
#include "screen.h"
#include "tilemap.h"
class cclimber_state : public driver_device
@ -19,19 +20,16 @@ public:
driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_audiocpu(*this, "audiocpu"),
m_screen(*this, "screen"),
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette"),
m_mainlatch(*this, "mainlatch"),
m_soundlatch(*this, "soundlatch"),
m_bigsprite_videoram(*this, "bigspriteram"),
m_videoram(*this, "videoram"),
m_column_scroll(*this, "column_scroll"),
m_spriteram(*this, "spriteram"),
m_bigsprite_control(*this, "bigspritectrl"),
m_colorram(*this, "colorram"),
m_swimmer_background_color(*this, "bgcolor"),
m_toprollr_bg_videoram(*this, "bg_videoram"),
m_toprollr_bg_coloram(*this, "bg_coloram"),
m_column_scroll(*this, "column_scroll"),
m_decrypted_opcodes(*this, "decrypted_opcodes")
{ }
@ -42,8 +40,6 @@ public:
void init_ckongb();
void init_dking();
void init_rpatrol();
void init_toprollr();
void init_yamato();
void root(machine_config &config);
void bagmanf(machine_config &config);
@ -51,111 +47,188 @@ public:
void cclimber(machine_config &config);
void cclimberx(machine_config &config);
void ckongb(machine_config &config);
void guzzler(machine_config &config);
void rpatrol(machine_config &config);
void swimmer(machine_config &config);
void toprollr(machine_config &config);
void yamato(machine_config &config);
protected:
virtual void machine_start() override;
virtual void machine_reset() override { m_maincpu->pulse_input_line(INPUT_LINE_RESET, attotime::zero); }
private:
required_device<cpu_device> m_maincpu;
optional_device<cpu_device> m_audiocpu;
optional_device<screen_device> m_screen;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
required_device<ls259_device> m_mainlatch;
optional_device<generic_latch_8_device> m_soundlatch;
required_shared_ptr<uint8_t> m_bigsprite_videoram;
required_shared_ptr<uint8_t> m_videoram;
optional_shared_ptr<uint8_t> m_column_scroll;
required_shared_ptr<uint8_t> m_spriteram;
required_shared_ptr<uint8_t> m_bigsprite_control;
required_shared_ptr<uint8_t> m_colorram;
optional_shared_ptr<uint8_t> m_swimmer_background_color;
optional_shared_ptr<uint8_t> m_toprollr_bg_videoram;
optional_shared_ptr<uint8_t> m_toprollr_bg_coloram;
optional_shared_ptr<uint8_t> m_decrypted_opcodes;
bool m_flip_x = false;
bool m_flip_y = false;
bool m_swimmer_side_background_enabled = false;
bool m_swimmer_palettebank = false;
uint8_t m_yamato_p0 = 0U;
uint8_t m_yamato_p1 = 0U;
uint8_t m_toprollr_rombank = 0U;
bool m_nmi_mask = false;
tilemap_t *m_pf_tilemap = nullptr;
tilemap_t *m_bs_tilemap = nullptr;
tilemap_t *m_toproller_bg_tilemap = nullptr;
std::unique_ptr<uint8_t[]> m_opcodes;
void swimmer_sh_soundlatch_w(uint8_t data);
void yamato_p0_w(uint8_t data);
void yamato_p1_w(uint8_t data);
uint8_t yamato_p0_r();
uint8_t yamato_p1_r();
void toprollr_rombank_w(int state);
void nmi_mask_w(int state);
uint8_t bagmanf_a000_r();
void cclimber_colorram_w(offs_t offset, uint8_t data);
void flip_screen_x_w(int state);
void flip_screen_y_w(int state);
void sidebg_enable_w(int state);
void palette_bank_w(int state);
void cclimber_portmap(address_map &map);
void vblank_irq(int state);
bool m_flip_x = false;
bool m_flip_y = false;
tilemap_t *m_pf_tilemap = nullptr;
tilemap_t *m_bs_tilemap = nullptr;
TILE_GET_INFO_MEMBER(cclimber_get_pf_tile_info);
TILE_GET_INFO_MEMBER(cclimber_get_bs_tile_info);
void draw_playfield(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void cclimber_draw_bigsprite(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void toprollr_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, gfx_element *gfx);
private:
optional_shared_ptr<uint8_t> m_column_scroll;
optional_shared_ptr<uint8_t> m_decrypted_opcodes;
bool m_nmi_mask = false;
uint8_t bagmanf_a000_r();
void bagmanf_vblank_irq(int state);
DECLARE_VIDEO_START(cclimber);
void cclimber_palette(palette_device &palette) const;
DECLARE_VIDEO_START(swimmer);
void swimmer_palette(palette_device &palette) const;
void yamato_palette(palette_device &palette) const;
DECLARE_VIDEO_START(toprollr);
void toprollr_palette(palette_device &palette) const;
TILE_GET_INFO_MEMBER(cclimber_get_pf_tile_info);
TILE_GET_INFO_MEMBER(swimmer_get_pf_tile_info);
TILE_GET_INFO_MEMBER(toprollr_get_pf_tile_info);
TILE_GET_INFO_MEMBER(cclimber_get_bs_tile_info);
TILE_GET_INFO_MEMBER(toprollr_get_bs_tile_info);
TILE_GET_INFO_MEMBER(toproller_get_bg_tile_info);
uint32_t screen_update_cclimber(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
uint32_t screen_update_swimmer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
uint32_t screen_update_yamato(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
uint32_t screen_update_toprollr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void swimmer_set_background_pen();
void draw_playfield(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void cclimber_draw_bigsprite(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void toprollr_draw_bigsprite(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void cclimber_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, gfx_element *gfx);
void toprollr_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, gfx_element *gfx);
void swimmer_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, gfx_element *gfx);
void cclimber_decode(const uint8_t convtable[8][16]);
void bagmanf_map(address_map &map);
void cannonb_map(address_map &map);
void cclimber_map(address_map &map);
void cclimber_portmap(address_map &map);
void decrypted_opcodes_map(address_map &map);
void guzzler_map(address_map &map);
void rpatrol_map(address_map &map);
void rpatrol_portmap(address_map &map);
};
class swimmer_state : public cclimber_state
{
public:
swimmer_state(const machine_config &mconfig, device_type type, const char* tag) :
cclimber_state(mconfig, type, tag),
m_swimmer_background_color(*this, "bgcolor"),
m_soundlatch(*this, "soundlatch")
{}
void swimmer_root(machine_config &config);
void swimmer(machine_config &config);
void au(machine_config &config);
void guzzler(machine_config &config);
private:
optional_shared_ptr<uint8_t> m_swimmer_background_color;
optional_device<generic_latch_8_device> m_soundlatch;
uint8_t soundlatch_read_and_clear();
void swimmer_sh_soundlatch_w(uint8_t data);
void sidebg_enable_w(int state);
void palette_bank_w(int state);
void swimmer_root_map(address_map &map);
void swimmer_map(address_map &map);
void swimmer_audio_map(address_map &map);
void swimmer_audio_portmap(address_map &map);
void swimmer_map(address_map &map);
void au_map(address_map &map);
void guzzler_map(address_map &map);
static rgb_t au_palette(u32 raw);
void swimmer_palette(palette_device &palette) const;
void swimmer_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, gfx_element* gfx);
uint32_t screen_update_swimmer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void swimmer_set_background_pen();
TILE_GET_INFO_MEMBER(swimmer_get_pf_tile_info);
DECLARE_VIDEO_START(swimmer);
DECLARE_VIDEO_START(au);
bool m_swimmer_side_background_enabled = false;
bool m_swimmer_palettebank = false;
int m_swimmer_sidepen = 0x120;
static constexpr int SWIMMER_BG_SPLIT = 0x18 * 8;
};
class toprollr_state : public cclimber_state
{
public:
toprollr_state(const machine_config &mconfig, device_type type, const char* tag) :
cclimber_state(mconfig, type, tag),
m_toprollr_bg_videoram(*this, "bg_videoram"),
m_toprollr_bg_coloram(*this, "bg_coloram"),
m_bank1(*this, "bank1"),
m_bank1d(*this, "bank1d")
{}
void toprollr(machine_config &config);
void init_toprollr();
private:
optional_shared_ptr<uint8_t> m_toprollr_bg_videoram;
optional_shared_ptr<uint8_t> m_toprollr_bg_coloram;
required_memory_bank m_bank1;
required_memory_bank m_bank1d;
void toprollr_decrypted_opcodes_map(address_map &map);
void toprollr_map(address_map &map);
void toprollr_palette(palette_device &palette) const;
void toprollr_draw_bigsprite(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void toprollr_rombank_w(int state);
uint32_t screen_update_toprollr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TILE_GET_INFO_MEMBER(toprollr_get_pf_tile_info);
TILE_GET_INFO_MEMBER(toprollr_get_bs_tile_info);
TILE_GET_INFO_MEMBER(toproller_get_bg_tile_info);
DECLARE_VIDEO_START(toprollr);
tilemap_t *m_toproller_bg_tilemap = nullptr;
uint8_t m_toprollr_rombank = 0U;
};
class yamato_state : public cclimber_state
{
public:
yamato_state(const machine_config &mconfig, device_type type, const char* tag) :
cclimber_state(mconfig, type, tag)
{}
void yamato(machine_config &config);
void init_yamato();
private:
void yamato_p0_w(uint8_t data);
void yamato_p1_w(uint8_t data);
uint8_t yamato_p0_r();
uint8_t yamato_p1_r();
void yamato_map(address_map &map);
void yamato_decrypted_opcodes_map(address_map &map);
void yamato_portmap(address_map &map);
void yamato_audio_map(address_map &map);
void yamato_audio_portmap(address_map &map);
void yamato_decrypted_opcodes_map(address_map &map);
void yamato_map(address_map &map);
void yamato_portmap(address_map &map);
void yamato_palette(palette_device &palette) const;
uint32_t screen_update_yamato(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
uint8_t m_yamato_p0 = 0U;
uint8_t m_yamato_p1 = 0U;
static constexpr int YAMATO_SKY_PEN_BASE = 0x60;
};
#endif // MAME_NICHIBUT_CCLIMBER_H

View File

@ -12,13 +12,6 @@
#include "video/resnet.h"
#include "cclimber.h"
#define CCLIMBER_BG_PEN (0)
#define SWIMMER_SIDE_BG_PEN (0x120)
#define SWIMMER_BG_SPLIT (0x18 * 8)
#define YAMATO_SKY_PEN_BASE (0x60)
/***************************************************************************
Convert the color PROMs into a more useable format.
@ -112,7 +105,7 @@ void cclimber_state::cclimber_palette(palette_device &palette) const
***************************************************************************/
void cclimber_state::swimmer_palette(palette_device &palette) const
void swimmer_state::swimmer_palette(palette_device &palette) const
{
const uint8_t *color_prom = memregion("proms")->base();
@ -172,13 +165,13 @@ void cclimber_state::swimmer_palette(palette_device &palette) const
// side panel backgrond pen
#if 0
// values calculated from the resistors don't seem to match the real board
palette.set_pen_color(SWIMMER_SIDE_BG_PEN, rgb_t(0x24, 0x5d, 0x4e));
palette.set_pen_color(m_swimmer_sidepen, rgb_t(0x24, 0x5d, 0x4e));
#endif
palette.set_pen_color(SWIMMER_SIDE_BG_PEN, rgb_t(0x20, 0x98, 0x79));
palette.set_pen_color(m_swimmer_sidepen, rgb_t(0x20, 0x98, 0x79));
}
void cclimber_state::yamato_palette(palette_device &palette) const
void yamato_state::yamato_palette(palette_device &palette) const
{
uint8_t const *const color_prom = memregion("proms")->base();
@ -243,7 +236,7 @@ void cclimber_state::yamato_palette(palette_device &palette) const
}
void cclimber_state::toprollr_palette(palette_device &palette) const
void toprollr_state::toprollr_palette(palette_device &palette) const
{
uint8_t const *const color_prom = memregion("proms")->base();
@ -291,34 +284,34 @@ void cclimber_state::toprollr_palette(palette_device &palette) const
***************************************************************************/
void cclimber_state::swimmer_set_background_pen()
void swimmer_state::swimmer_set_background_pen()
{
int bit0, bit1, bit2;
int r, g, b;
/* red component */
bit0 = 0;
bit1 = (*m_swimmer_background_color >> 6) & 0x01;
bit2 = (*m_swimmer_background_color >> 7) & 0x01;
r = 0x20 * bit0 + 0x40 * bit1 + 0x80 * bit2;
int const r = 0x20 * bit0 + 0x40 * bit1 + 0x80 * bit2;
/* green component */
bit0 = (*m_swimmer_background_color >> 3) & 0x01;
bit1 = (*m_swimmer_background_color >> 4) & 0x01;
bit2 = (*m_swimmer_background_color >> 5) & 0x01;
g = 0x20 * bit0 + 0x40 * bit1 + 0x80 * bit2;
int const g = 0x20 * bit0 + 0x40 * bit1 + 0x80 * bit2;
/* blue component */
bit0 = (*m_swimmer_background_color >> 0) & 0x01;
bit1 = (*m_swimmer_background_color >> 1) & 0x01;
bit2 = (*m_swimmer_background_color >> 2) & 0x01;
b = 0x20 * bit0 + 0x40 * bit1 + 0x80 * bit2;
int const b = 0x20 * bit0 + 0x40 * bit1 + 0x80 * bit2;
m_palette->set_pen_color(CCLIMBER_BG_PEN, rgb_t(r, g, b));
m_palette->set_pen_color(0, rgb_t(r, g, b));
}
void cclimber_state::cclimber_colorram_w(offs_t offset, uint8_t data)
{
/* A5 is not connected, there is only 0x200 bytes of RAM */
@ -339,13 +332,13 @@ void cclimber_state::flip_screen_y_w(int state)
}
void cclimber_state::sidebg_enable_w(int state)
void swimmer_state::sidebg_enable_w(int state)
{
m_swimmer_side_background_enabled = state;
}
void cclimber_state::palette_bank_w(int state)
void swimmer_state::palette_bank_w(int state)
{
m_swimmer_palettebank = state;
}
@ -353,48 +346,42 @@ void cclimber_state::palette_bank_w(int state)
TILE_GET_INFO_MEMBER(cclimber_state::cclimber_get_pf_tile_info)
{
int code, color;
int flags = TILE_FLIPYX(m_colorram[tile_index] >> 6);
const int flags = TILE_FLIPYX(m_colorram[tile_index] >> 6);
/* vertical flipping flips two adjacent characters */
if (flags & 0x02)
tile_index = tile_index ^ 0x20;
code = ((m_colorram[tile_index] & 0x10) << 5) |
const int code = ((m_colorram[tile_index] & 0x10) << 5) |
((m_colorram[tile_index] & 0x20) << 3) |
m_videoram[tile_index];
color = m_colorram[tile_index] & 0x0f;
const int color = m_colorram[tile_index] & 0x0f;
tileinfo.set(0, code, color, flags);
}
TILE_GET_INFO_MEMBER(cclimber_state::swimmer_get_pf_tile_info)
TILE_GET_INFO_MEMBER(swimmer_state::swimmer_get_pf_tile_info)
{
int code, color;
int flags = TILE_FLIPYX(m_colorram[tile_index] >> 6);
const int flags = TILE_FLIPYX(m_colorram[tile_index] >> 6);
/* vertical flipping flips two adjacent characters */
if (flags & 0x02)
tile_index = tile_index ^ 0x20;
code = ((m_colorram[tile_index] & 0x10) << 4) | m_videoram[tile_index];
color = (m_swimmer_palettebank << 4) | (m_colorram[tile_index] & 0x0f);
const int code = ((m_colorram[tile_index] & 0x30) << 4) | m_videoram[tile_index];
const int color = (m_swimmer_palettebank << 4) | (m_colorram[tile_index] & 0x0f);
tileinfo.set(0, code, color, flags);
}
TILE_GET_INFO_MEMBER(cclimber_state::toprollr_get_pf_tile_info)
TILE_GET_INFO_MEMBER(toprollr_state::toprollr_get_pf_tile_info)
{
int code, attr, color;
attr = m_colorram[tile_index];
code = ((attr & 0x10) << 5) | ((attr & 0x20) << 3) | m_videoram[tile_index];
color = attr & 0x0f;
const int attr = m_colorram[tile_index];
const int code = ((attr & 0x10) << 5) | ((attr & 0x20) << 3) | m_videoram[tile_index];
const int color = attr & 0x0f;
tileinfo.set(0, code, color, 0);
}
@ -402,42 +389,38 @@ TILE_GET_INFO_MEMBER(cclimber_state::toprollr_get_pf_tile_info)
TILE_GET_INFO_MEMBER(cclimber_state::cclimber_get_bs_tile_info)
{
int code, color;
/* only the lower right is visible */
tileinfo.group = ((tile_index & 0x210) == 0x210) ? 0 : 1;
/* the address doesn't use A4 of the coordinates, giving a 16x16 map */
tile_index = ((tile_index & 0x1e0) >> 1) | (tile_index & 0x0f);
code = ((m_bigsprite_control[1] & 0x08) << 5) | m_bigsprite_videoram[tile_index];
color = m_bigsprite_control[1] & 0x07;
const int code = ((m_bigsprite_control[1] & 0x08) << 5) | m_bigsprite_videoram[tile_index];
const int color = m_bigsprite_control[1] & 0x07;
tileinfo.set(2, code, color, 0);
}
TILE_GET_INFO_MEMBER(cclimber_state::toprollr_get_bs_tile_info)
TILE_GET_INFO_MEMBER(toprollr_state::toprollr_get_bs_tile_info)
{
int code, color;
/* only the lower right is visible */
tileinfo.group = ((tile_index & 0x210) == 0x210) ? 0 : 1;
/* the address doesn't use A4 of the coordinates, giving a 16x16 map */
tile_index = ((tile_index & 0x1e0) >> 1) | (tile_index & 0x0f);
code = ((m_bigsprite_control[1] & 0x18) << 5) | m_bigsprite_videoram[tile_index];
color = m_bigsprite_control[1] & 0x07;
const int code = ((m_bigsprite_control[1] & 0x18) << 5) | m_bigsprite_videoram[tile_index];
const int color = m_bigsprite_control[1] & 0x07;
tileinfo.set(2, code, color, 0);
}
TILE_GET_INFO_MEMBER(cclimber_state::toproller_get_bg_tile_info)
TILE_GET_INFO_MEMBER(toprollr_state::toproller_get_bg_tile_info)
{
int code = ((m_toprollr_bg_coloram[tile_index] & 0x40) << 2) | m_toprollr_bg_videoram[tile_index];
int color = m_toprollr_bg_coloram[tile_index] & 0x0f;
const int code = ((m_toprollr_bg_coloram[tile_index] & 0x40) << 2) | m_toprollr_bg_videoram[tile_index];
const int color = m_toprollr_bg_coloram[tile_index] & 0x0f;
tileinfo.set(3, code, color, TILE_FLIPX);
}
@ -460,13 +443,13 @@ VIDEO_START_MEMBER(cclimber_state,cclimber)
}
VIDEO_START_MEMBER(cclimber_state,swimmer)
VIDEO_START_MEMBER(swimmer_state,swimmer)
{
m_pf_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(cclimber_state::swimmer_get_pf_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
m_pf_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(swimmer_state::swimmer_get_pf_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
m_pf_tilemap->set_transparent_pen(0);
m_pf_tilemap->set_scroll_cols(32);
m_bs_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(cclimber_state::cclimber_get_bs_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
m_bs_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(swimmer_state::cclimber_get_bs_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
m_bs_tilemap->set_scroll_cols(1);
m_bs_tilemap->set_scroll_rows(1);
m_bs_tilemap->set_transmask(0, 0x01, 0); // pen 0 is transparent
@ -478,16 +461,21 @@ VIDEO_START_MEMBER(cclimber_state,swimmer)
save_item(NAME(m_swimmer_palettebank));
}
VIDEO_START_MEMBER(cclimber_state,toprollr)
VIDEO_START_MEMBER(swimmer_state, au)
{
m_pf_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(cclimber_state::toprollr_get_pf_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
VIDEO_START_CALL_MEMBER(swimmer);
m_swimmer_sidepen = 0;
}
VIDEO_START_MEMBER(toprollr_state,toprollr)
{
m_pf_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(toprollr_state::toprollr_get_pf_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
m_pf_tilemap->set_transparent_pen(0);
m_toproller_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(cclimber_state::toproller_get_bg_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
m_toproller_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(toprollr_state::toproller_get_bg_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
m_toproller_bg_tilemap->set_scroll_rows(1);
m_bs_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(cclimber_state::toprollr_get_bs_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
m_bs_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(toprollr_state::toprollr_get_bs_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32);
m_bs_tilemap->set_scroll_cols(1);
m_bs_tilemap->set_scroll_rows(1);
m_bs_tilemap->set_transmask(0, 0x01, 0); // pen 0 is transparent
@ -533,7 +521,7 @@ void cclimber_state::cclimber_draw_bigsprite(screen_device &screen, bitmap_ind16
}
void cclimber_state::toprollr_draw_bigsprite(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
void toprollr_state::toprollr_draw_bigsprite(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
uint8_t x = m_bigsprite_control[3] - 8;
uint8_t y = m_bigsprite_control[2];
@ -554,11 +542,9 @@ void cclimber_state::toprollr_draw_bigsprite(screen_device &screen, bitmap_ind16
void cclimber_state::cclimber_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, gfx_element *gfx)
{
int offs;
/* draw the sprites -- note that it is important to draw them exactly in this
order, to have the correct priorities. */
for (offs = 0x1c; offs >= 0; offs -= 4)
for (int offs = 0x1c; offs >= 0; offs -= 4)
{
int x = m_spriteram[offs + 3] + 1;
/* x + 1 is evident in cclimber and ckong. It looks worse,
@ -594,20 +580,18 @@ void cclimber_state::cclimber_draw_sprites(bitmap_ind16 &bitmap, const rectangle
void cclimber_state::toprollr_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, gfx_element *gfx)
{
int offs;
/* draw the sprites -- note that it is important to draw them exactly in this
order, to have the correct priorities. */
for (offs = m_spriteram.bytes() - 4; offs >= 0; offs -= 4)
for (int offs = m_spriteram.bytes() - 4; offs >= 0; offs -= 4)
{
int x = m_spriteram[offs + 3];
int y = 240 - m_spriteram[offs + 2];
int code = ((m_spriteram[offs + 1] & 0x10) << 3) |
const int code = ((m_spriteram[offs + 1] & 0x10) << 3) |
((m_spriteram[offs + 1] & 0x20) << 1) |
( m_spriteram[offs + 0] & 0x3f);
int color = m_spriteram[offs + 1] & 0x0f;
const int color = m_spriteram[offs + 1] & 0x0f;
int flipx = m_spriteram[offs + 0] & 0x40;
int flipy = m_spriteram[offs + 0] & 0x80;
@ -629,21 +613,19 @@ void cclimber_state::toprollr_draw_sprites(bitmap_ind16 &bitmap, const rectangle
}
void cclimber_state::swimmer_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, gfx_element *gfx)
void swimmer_state::swimmer_draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, gfx_element *gfx)
{
int offs;
/* draw the sprites -- note that it is important to draw them exactly in this
order, to have the correct priorities. */
for (offs = 0x1c; offs >= 0; offs -= 4)
for (int offs = 0x1c; offs >= 0; offs -= 4)
{
int x = m_spriteram[offs + 3];
int y = 240 - m_spriteram[offs + 2];
int code = ((m_spriteram[offs + 1] & 0x10) << 2) |
const int code = ((m_spriteram[offs + 1] & 0x30) << 2) |
(m_spriteram[offs + 0] & 0x3f);
int color = (m_swimmer_palettebank << 4) |
const int color = (m_swimmer_palettebank << 4) |
(m_spriteram[offs + 1] & 0x0f);
int flipx = m_spriteram[offs + 0] & 0x40;
@ -668,7 +650,7 @@ void cclimber_state::swimmer_draw_sprites(bitmap_ind16 &bitmap, const rectangle
uint32_t cclimber_state::screen_update_cclimber(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
bitmap.fill(CCLIMBER_BG_PEN, cliprect);
bitmap.fill(0, cliprect);
draw_playfield(screen, bitmap, cliprect);
/* draw the "big sprite" under the regular sprites */
@ -689,7 +671,7 @@ uint32_t cclimber_state::screen_update_cclimber(screen_device &screen, bitmap_in
}
uint32_t cclimber_state::screen_update_yamato(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
uint32_t yamato_state::screen_update_yamato(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
uint8_t const *const sky_rom = memregion("user1")->base() + 0x1200;
@ -721,9 +703,10 @@ uint32_t cclimber_state::screen_update_yamato(screen_device &screen, bitmap_ind1
}
uint32_t cclimber_state::screen_update_swimmer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
uint32_t swimmer_state::screen_update_swimmer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
swimmer_set_background_pen();
if (m_swimmer_background_color)
swimmer_set_background_pen();
if (m_swimmer_side_background_enabled)
{
@ -733,10 +716,10 @@ uint32_t cclimber_state::screen_update_swimmer(screen_device &screen, bitmap_ind
rectangle split_rect_right(0x100 - SWIMMER_BG_SPLIT, 0xff, 0, 0xff);
split_rect_left &= cliprect;
bitmap.fill(SWIMMER_SIDE_BG_PEN, split_rect_left);
bitmap.fill(m_swimmer_sidepen, split_rect_left);
split_rect_right &= cliprect;
bitmap.fill(CCLIMBER_BG_PEN, split_rect_right);
bitmap.fill(0, split_rect_right);
}
else
{
@ -744,14 +727,14 @@ uint32_t cclimber_state::screen_update_swimmer(screen_device &screen, bitmap_ind
rectangle split_rect_right(SWIMMER_BG_SPLIT, 0xff, 0, 0xff);
split_rect_left &= cliprect;
bitmap.fill(CCLIMBER_BG_PEN, split_rect_left);
bitmap.fill(0, split_rect_left);
split_rect_right &= cliprect;
bitmap.fill(SWIMMER_SIDE_BG_PEN, split_rect_right);
bitmap.fill(m_swimmer_sidepen, split_rect_right);
}
}
else
bitmap.fill(CCLIMBER_BG_PEN, cliprect);
bitmap.fill(0, cliprect);
draw_playfield(screen, bitmap, cliprect);
@ -773,14 +756,14 @@ uint32_t cclimber_state::screen_update_swimmer(screen_device &screen, bitmap_ind
}
uint32_t cclimber_state::screen_update_toprollr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
uint32_t toprollr_state::screen_update_toprollr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
rectangle scroll_area_clip = cliprect;
scroll_area_clip.min_x = (m_flip_x ? 3 : 5) * 8;
scroll_area_clip.max_x = (m_flip_x ? 27 : 29) * 8 - 1;
scroll_area_clip &= cliprect;
bitmap.fill(CCLIMBER_BG_PEN, cliprect);
bitmap.fill(0, cliprect);
m_toproller_bg_tilemap->set_scrollx(0, m_toprollr_bg_videoram[0]);
m_toproller_bg_tilemap->set_flip((m_flip_x ? TILEMAP_FLIPX : 0) | (m_flip_y ? TILEMAP_FLIPY : 0));