Popeye: Fixed background in popeyej, popeyejo & popeyebl. popeyej does not run on the exact same hardware as sky skipper & was the basis for the popeyebl set. Fixed horizontal and vertical scroll register behaviour in popeye. Change function names from the game name to the hardware id the functionality was first used in. [smf]

This commit is contained in:
smf- 2018-01-12 12:51:38 +00:00
parent b3aba982da
commit 71c0ae310b
3 changed files with 56 additions and 66 deletions

View File

@ -12,8 +12,6 @@ Notes:
(which is the same revision of the program code) has the protection disabled
in a very clean way, so I don't know if it's an original (without the
protection device to save costs), or a very well done bootleg.
- The bootleg derives from a different revision of the program code which we
don't have.
***************************************************************************/
@ -159,7 +157,7 @@ WRITE8_MEMBER(popeye_state::protection_w)
static ADDRESS_MAP_START( skyskipr_map, AS_PROGRAM, 8, popeye_state )
static ADDRESS_MAP_START( tnx1_map, AS_PROGRAM, 8, popeye_state )
AM_RANGE(0x0000, 0x7fff) AM_ROM
AM_RANGE(0x8000, 0x87ff) AM_RAM
AM_RANGE(0x8800, 0x8bff) AM_WRITENOP // Attempts to initialize this area with 00 on boot
@ -169,11 +167,11 @@ static ADDRESS_MAP_START( skyskipr_map, AS_PROGRAM, 8, popeye_state )
AM_RANGE(0x8e80, 0x8fff) AM_RAM
AM_RANGE(0xa000, 0xa3ff) AM_WRITE(popeye_videoram_w) AM_SHARE("videoram")
AM_RANGE(0xa400, 0xa7ff) AM_WRITE(popeye_colorram_w) AM_SHARE("colorram")
AM_RANGE(0xc000, 0xcfff) AM_WRITE(skyskipr_bitmap_w)
AM_RANGE(0xc000, 0xcfff) AM_WRITE(tnx1_bitmap_w)
AM_RANGE(0xe000, 0xe001) AM_READWRITE(protection_r,protection_w)
ADDRESS_MAP_END
static ADDRESS_MAP_START( popeye_map, AS_PROGRAM, 8, popeye_state )
static ADDRESS_MAP_START( tpp2_map, AS_PROGRAM, 8, popeye_state )
AM_RANGE(0x0000, 0x7fff) AM_ROM
AM_RANGE(0x8000, 0x87ff) AM_RAM // unpopulated 7f
AM_RANGE(0x8800, 0x8bff) AM_RAM
@ -183,7 +181,7 @@ static ADDRESS_MAP_START( popeye_map, AS_PROGRAM, 8, popeye_state )
AM_RANGE(0x8e80, 0x8fff) AM_RAM
AM_RANGE(0xa000, 0xa3ff) AM_WRITE(popeye_videoram_w) AM_SHARE("videoram")
AM_RANGE(0xa400, 0xa7ff) AM_WRITE(popeye_colorram_w) AM_SHARE("colorram")
AM_RANGE(0xc000, 0xdfff) AM_WRITE(popeye_bitmap_w)
AM_RANGE(0xc000, 0xdfff) AM_WRITE(tpp2_bitmap_w)
AM_RANGE(0xe000, 0xe001) AM_READWRITE(protection_r,protection_w)
ADDRESS_MAP_END
@ -196,7 +194,7 @@ static ADDRESS_MAP_START( popeyebl_map, AS_PROGRAM, 8, popeye_state )
AM_RANGE(0x8e80, 0x8fff) AM_RAM
AM_RANGE(0xa000, 0xa3ff) AM_WRITE(popeye_videoram_w) AM_SHARE("videoram")
AM_RANGE(0xa400, 0xa7ff) AM_WRITE(popeye_colorram_w) AM_SHARE("colorram")
AM_RANGE(0xc000, 0xcfff) AM_WRITE(skyskipr_bitmap_w)
AM_RANGE(0xc000, 0xcfff) AM_WRITE(tnx1_bitmap_w)
AM_RANGE(0xe000, 0xe01f) AM_ROM AM_REGION("blprot", 0x00)
ADDRESS_MAP_END
@ -447,10 +445,10 @@ WRITE8_MEMBER(popeye_state::popeye_portB_w)
m_dswbit = (data & 0x0e) >> 1;
}
static MACHINE_CONFIG_START( skyskipr )
static MACHINE_CONFIG_START( tnx1 )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", Z80, XTAL_8MHz/2) /* 4 MHz */
MCFG_CPU_PROGRAM_MAP(skyskipr_map)
MCFG_CPU_PROGRAM_MAP(tnx1_map)
MCFG_CPU_IO_MAP(popeye_io_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", popeye_state, popeye_interrupt)
@ -465,7 +463,7 @@ static MACHINE_CONFIG_START( skyskipr )
MCFG_GFXDECODE_ADD("gfxdecode", "palette", popeye)
MCFG_PALETTE_ADD("palette", 16+16*2+64*4)
MCFG_PALETTE_INIT_OWNER(popeye_state, skyskipr)
MCFG_PALETTE_INIT_OWNER(popeye_state, tnx1)
/* sound hardware */
MCFG_SPEAKER_STANDARD_MONO("mono")
@ -476,14 +474,16 @@ static MACHINE_CONFIG_START( skyskipr )
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( popeyej, skyskipr )
static MACHINE_CONFIG_DERIVED( tpp1, tnx1 )
MCFG_PALETTE_MODIFY("palette")
MCFG_PALETTE_INIT_OWNER(popeye_state,popeye)
MCFG_PALETTE_INIT_OWNER(popeye_state,tpp1)
MCFG_VIDEO_START_OVERRIDE(popeye_state,tpp1)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( popeye, popeyej )
static MACHINE_CONFIG_DERIVED( tpp2, tpp1 )
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP(popeye_map)
MCFG_CPU_PROGRAM_MAP(tpp2_map)
MCFG_SOUND_MODIFY("aysnd")
MCFG_SOUND_ROUTES_RESET()
@ -507,12 +507,10 @@ static MACHINE_CONFIG_DERIVED( popeye, popeyej )
MCFG_NETLIST_STREAM_OUTPUT("snd_nl", 0, "ROUT.1")
MCFG_NETLIST_ANALOG_MULT_OFFSET(30000.0, -65000.0)
MCFG_VIDEO_START_OVERRIDE(popeye_state,popeye)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( popeyebl, popeye )
static MACHINE_CONFIG_DERIVED( popeyebl, tpp1 )
MCFG_CPU_MODIFY("maincpu")
MCFG_CPU_PROGRAM_MAP(popeyebl_map)
@ -815,7 +813,7 @@ ROM_START( popeyejo )
ROM_END
DRIVER_INIT_MEMBER(popeye_state,skyskipr)
DRIVER_INIT_MEMBER(popeye_state,tnx1)
{
uint8_t *rom = memregion("maincpu")->base();
int len = memregion("maincpu")->bytes();
@ -834,7 +832,7 @@ DRIVER_INIT_MEMBER(popeye_state,skyskipr)
save_item(NAME(m_prot_shift));
}
DRIVER_INIT_MEMBER(popeye_state,popeye)
DRIVER_INIT_MEMBER(popeye_state,tpp2)
{
uint8_t *rom = memregion("maincpu")->base();
int len = memregion("maincpu")->bytes();
@ -854,12 +852,12 @@ DRIVER_INIT_MEMBER(popeye_state,popeye)
}
GAME( 1981, skyskipr, 0, skyskipr, skyskipr, popeye_state, skyskipr, ROT0, "Nintendo", "Sky Skipper", MACHINE_SUPPORTS_SAVE )
GAME( 1982, popeye, 0, popeye, popeye, popeye_state, popeye, ROT0, "Nintendo", "Popeye (revision D)", MACHINE_SUPPORTS_SAVE )
GAME( 1982, popeyeu, popeye, popeye, popeye, popeye_state, popeye, ROT0, "Nintendo", "Popeye (revision D not protected)", MACHINE_SUPPORTS_SAVE )
GAME( 1982, popeyef, popeye, popeye, popeyef, popeye_state, popeye, ROT0, "Nintendo", "Popeye (revision F)", MACHINE_SUPPORTS_SAVE )
GAME( 1982, popeyebl, popeye, popeyebl, popeye, popeye_state, 0, ROT0, "bootleg", "Popeye (bootleg set 1)", MACHINE_SUPPORTS_SAVE )
GAME( 1982, popeyeb2, popeye, popeyebl, popeye, popeye_state, 0, ROT0, "bootleg", "Popeye (bootleg set 2)", MACHINE_SUPPORTS_SAVE )
GAME( 1982, popeyeb3, popeye, popeye, popeye, popeye_state, popeye, ROT0, "bootleg", "Popeye (bootleg set 3)", MACHINE_SUPPORTS_SAVE )
GAME( 1982, popeyej, popeye, popeyej, popeye, popeye_state, skyskipr, ROT0, "Nintendo", "Popeye (Japan, Sky Skipper hardware)", MACHINE_SUPPORTS_SAVE ) // this is the original Japanese release on the same hardware as Sky Skipper
GAME( 1982, popeyejo, popeye, popeyej, popeye, popeye_state, skyskipr, ROT0, "Nintendo", "Popeye (Japan, Sky Skipper hardware, Older)", MACHINE_SUPPORTS_SAVE )
GAME( 1981, skyskipr, 0, tnx1, skyskipr, popeye_state, tnx1, ROT0, "Nintendo", "Sky Skipper", MACHINE_SUPPORTS_SAVE )
GAME( 1982, popeye, 0, tpp2, popeye, popeye_state, tpp2, ROT0, "Nintendo", "Popeye (revision D)", MACHINE_SUPPORTS_SAVE )
GAME( 1982, popeyeu, popeye, tpp2, popeye, popeye_state, tpp2, ROT0, "Nintendo", "Popeye (revision D not protected)", MACHINE_SUPPORTS_SAVE )
GAME( 1982, popeyef, popeye, tpp2, popeyef, popeye_state, tpp2, ROT0, "Nintendo", "Popeye (revision F)", MACHINE_SUPPORTS_SAVE )
GAME( 1982, popeyebl, popeye, popeyebl, popeye, popeye_state, 0, ROT0, "bootleg", "Popeye (bootleg set 1)", MACHINE_SUPPORTS_SAVE )
GAME( 1982, popeyeb2, popeye, popeyebl, popeye, popeye_state, 0, ROT0, "bootleg", "Popeye (bootleg set 2)", MACHINE_SUPPORTS_SAVE )
GAME( 1982, popeyeb3, popeye, tpp2, popeye, popeye_state, tpp2, ROT0, "bootleg", "Popeye (bootleg set 3)", MACHINE_SUPPORTS_SAVE )
GAME( 1982, popeyej, popeye, tpp1, popeye, popeye_state, tnx1, ROT0, "Nintendo", "Popeye (Japan)", MACHINE_SUPPORTS_SAVE )
GAME( 1982, popeyejo, popeye, tpp1, popeye, popeye_state, tnx1, ROT0, "Nintendo", "Popeye (Japan, Older)", MACHINE_SUPPORTS_SAVE )

View File

@ -41,18 +41,18 @@ public:
DECLARE_WRITE8_MEMBER(protection_w);
DECLARE_WRITE8_MEMBER(popeye_videoram_w);
DECLARE_WRITE8_MEMBER(popeye_colorram_w);
DECLARE_WRITE8_MEMBER(popeye_bitmap_w);
DECLARE_WRITE8_MEMBER(skyskipr_bitmap_w);
DECLARE_WRITE8_MEMBER(tpp2_bitmap_w);
DECLARE_WRITE8_MEMBER(tnx1_bitmap_w);
DECLARE_WRITE8_MEMBER(popeye_portB_w);
DECLARE_CUSTOM_INPUT_MEMBER(dsw1_read);
DECLARE_DRIVER_INIT(skyskipr);
DECLARE_DRIVER_INIT(popeye);
DECLARE_DRIVER_INIT(tnx1);
DECLARE_DRIVER_INIT(tpp2);
TILE_GET_INFO_MEMBER(get_fg_tile_info);
virtual void video_start() override;
DECLARE_PALETTE_INIT(popeye);
DECLARE_VIDEO_START(popeye);
DECLARE_PALETTE_INIT(tpp1);
DECLARE_VIDEO_START(tpp1);
DECLARE_PALETTE_INIT(popeyebl);
DECLARE_PALETTE_INIT(skyskipr);
DECLARE_PALETTE_INIT(tnx1);
uint32_t screen_update_popeye(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(popeye_interrupt);
DECLARE_CUSTOM_INPUT_MEMBER( pop_field_r );

View File

@ -15,7 +15,7 @@
static const size_t popeye_bitmapram_size = 0x2000; // 8k nybbles packed into 4k ram chip
enum { TYPE_SKYSKIPR, TYPE_POPEYE };
enum { TYPE_TNX1, TYPE_TPP1 };
#define USE_NEW_COLOR (1)
@ -199,7 +199,7 @@ void popeye_state::convert_color_prom(const uint8_t *color_prom)
#endif
}
PALETTE_INIT_MEMBER(popeye_state, popeye)
PALETTE_INIT_MEMBER(popeye_state, tpp1)
{
m_invertmask = (USE_NEW_COLOR) ? 0x00 : 0xff;
@ -213,7 +213,7 @@ PALETTE_INIT_MEMBER(popeye_state,popeyebl)
convert_color_prom(m_color_prom);
}
PALETTE_INIT_MEMBER(popeye_state, skyskipr)
PALETTE_INIT_MEMBER(popeye_state, tnx1)
{
/* Two of the PROM address pins are tied together and one is not connected... */
for (int i = 0;i < 0x100;i++)
@ -265,7 +265,7 @@ void popeye_state::set_background_palette(int bank)
bit0 = 0;
bit1 = ((color_prom[0] ^ m_invertmask) >> 6) & 0x01;
bit2 = ((color_prom[0] ^ m_invertmask) >> 7) & 0x01;
if (m_bitmap_type == TYPE_SKYSKIPR)
if (m_bitmap_type == TYPE_TNX1)
{
/* Sky Skipper has different weights */
bit0 = bit1;
@ -292,13 +292,13 @@ WRITE8_MEMBER(popeye_state::popeye_colorram_w)
m_fg_tilemap->mark_tile_dirty(offset);
}
WRITE8_MEMBER(popeye_state::popeye_bitmap_w)
WRITE8_MEMBER(popeye_state::tpp2_bitmap_w)
{
int sx,sy,x,y,colour;
m_bitmapram[offset] = data & 0xf;
if (m_bitmap_type == TYPE_SKYSKIPR)
if (m_bitmap_type == TYPE_TNX1)
{
sx = 8 * (offset % 128);
sy = 8 * (offset / 128);
@ -334,13 +334,13 @@ WRITE8_MEMBER(popeye_state::popeye_bitmap_w)
}
}
WRITE8_MEMBER(popeye_state::skyskipr_bitmap_w)
WRITE8_MEMBER(popeye_state::tnx1_bitmap_w)
{
offset = ((offset & 0xfc0) << 1) | (offset & 0x03f);
if (data & 0x80)
offset |= 0x40;
popeye_bitmap_w(space,offset,data);
tpp2_bitmap_w(space,offset,data);
}
TILE_GET_INFO_MEMBER(popeye_state::get_fg_tile_info)
@ -356,7 +356,7 @@ void popeye_state::video_start()
m_bitmapram = std::make_unique<uint8_t[]>(popeye_bitmapram_size);
m_tmpbitmap2 = std::make_unique<bitmap_ind16>(1024,1024); /* actually 1024x512 but not rolling over vertically? */
m_bitmap_type = TYPE_SKYSKIPR;
m_bitmap_type = TYPE_TNX1;
m_fg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(popeye_state::get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
m_fg_tilemap->set_transparent_pen(0);
@ -370,12 +370,12 @@ void popeye_state::video_start()
save_pointer(NAME(m_bitmapram.get()), popeye_bitmapram_size);
}
VIDEO_START_MEMBER(popeye_state,popeye)
VIDEO_START_MEMBER(popeye_state,tpp1)
{
m_bitmapram = std::make_unique<uint8_t[]>(popeye_bitmapram_size);
m_tmpbitmap2 = std::make_unique<bitmap_ind16>(512,512);
m_tmpbitmap2 = std::make_unique<bitmap_ind16>(512,1024); /* actually 512x512 but not rolling over vertically? */
m_bitmap_type = TYPE_POPEYE;
m_bitmap_type = TYPE_TPP1;
m_fg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(FUNC(popeye_state::get_fg_tile_info),this), TILEMAP_SCAN_ROWS, 16, 16, 32, 32);
m_fg_tilemap->set_transparent_pen(0);
@ -397,33 +397,25 @@ void popeye_state::draw_background(bitmap_ind16 &bitmap, const rectangle &clipre
if (m_lastflip != flip_screen())
{
for (offs = 0;offs < popeye_bitmapram_size;offs++)
popeye_bitmap_w(space,offs,m_bitmapram[offs]);
tpp2_bitmap_w(space,offs,m_bitmapram[offs]);
m_lastflip = flip_screen();
}
set_background_palette((*m_palettebank & 0x08) >> 3);
if (m_background_pos[1] == 0) /* no background */
bitmap.fill(0, cliprect);
else
/* copy the background graphics */
int scrollx = 2 * (456 - (m_background_pos[0] | (m_background_pos[2] << 8)));
int scrolly = 2 * (256 - m_background_pos[1]);
if (flip_screen())
{
/* copy the background graphics */
int scrollx = 200 - m_background_pos[0] - 256*(m_background_pos[2]&1); /* ??? */
int scrolly = 2 * (256 - m_background_pos[1]);
if (m_bitmap_type == TYPE_SKYSKIPR)
scrollx = 2*scrollx - 512;
if (flip_screen())
{
if (m_bitmap_type == TYPE_POPEYE)
scrollx = -scrollx;
scrolly = -scrolly;
}
copyscrollbitmap(bitmap,*m_tmpbitmap2,1,&scrollx,1,&scrolly,cliprect);
if (m_bitmap_type == TYPE_TPP1)
scrollx = -scrollx;
scrolly = -scrolly;
}
copyscrollbitmap(bitmap,*m_tmpbitmap2,1,&scrollx,1,&scrolly,cliprect);
}
void popeye_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect)