mirror of
https://github.com/holub/mame
synced 2025-04-22 08:22:15 +03:00
chanbara: fix cocktail mode and garbage sprites, assume ym2203 read is unconnected, small cleanup
This commit is contained in:
parent
9e18cb128e
commit
e5c0f78931
@ -1,9 +1,13 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:Tomasz Slanina, David Haywood
|
||||
/****************************************************************************************
|
||||
|
||||
Chanbara
|
||||
Data East, 1985
|
||||
|
||||
Driver by Tomasz Slanina & David Haywood
|
||||
Inputs and Dip Switches by stephh
|
||||
|
||||
PCB Layout
|
||||
----------
|
||||
|
||||
@ -40,35 +44,27 @@ Notes:
|
||||
|
||||
------------------------
|
||||
|
||||
Driver by Tomasz Slanina & David Haywood
|
||||
Inputs and Dip Switches by stephh
|
||||
|
||||
TODO:
|
||||
- Support screen flipping for sprites
|
||||
- If you force-scroll an enemy off the screen rather than fight them, you'll get graphical
|
||||
corruption (bad sprites) before a new enemy appears, does this happen on the PCB?
|
||||
- BGM tempo is incorrect, but clocks are verified above? ( see https://www.youtube.com/watch?v=pW9nhx1hcLM )
|
||||
- Verify if YM2203 RD is connected. If it is, it waits too long checking the busy flag,
|
||||
while it already does soft-delays itself. This would cause too slow BGM tempo.
|
||||
|
||||
BTANB:
|
||||
- on enemies that hide behind the roof on the 3rd level, their feet are visible below
|
||||
the roof, and their head is behind the sky
|
||||
|
||||
****************************************************************************************/
|
||||
|
||||
#include "emu.h"
|
||||
|
||||
#include "cpu/m6809/m6809.h"
|
||||
#include "sound/ymopn.h"
|
||||
|
||||
#include "emupal.h"
|
||||
#include "screen.h"
|
||||
#include "speaker.h"
|
||||
#include "tilemap.h"
|
||||
|
||||
|
||||
// configurable logging
|
||||
#define LOG_AYOUTS (1U << 1)
|
||||
|
||||
//#define VERBOSE (LOG_GENERAL | LOG_AYOUTS)
|
||||
|
||||
#include "logmacro.h"
|
||||
|
||||
#define LOGAYOUTS(...) LOGMASKED(LOG_AYOUTS, __VA_ARGS__)
|
||||
|
||||
namespace {
|
||||
|
||||
class chanbara_state : public driver_device
|
||||
@ -91,14 +87,13 @@ public:
|
||||
|
||||
protected:
|
||||
virtual void machine_start() override ATTR_COLD;
|
||||
virtual void machine_reset() override ATTR_COLD;
|
||||
virtual void video_start() override ATTR_COLD;
|
||||
|
||||
private:
|
||||
template <uint8_t Which> void videoram_w(offs_t offset, uint8_t data);
|
||||
template <uint8_t Which> void colorram_w(offs_t offset, uint8_t data);
|
||||
void ay_out_0_w(uint8_t data);
|
||||
void ay_out_1_w(uint8_t data);
|
||||
void ym_porta_w(uint8_t data);
|
||||
void ym_portb_w(uint8_t data);
|
||||
TILE_GET_INFO_MEMBER(get_bg_tile_info);
|
||||
TILE_GET_INFO_MEMBER(get_bg2_tile_info);
|
||||
void palette(palette_device &palette) const;
|
||||
@ -113,9 +108,8 @@ private:
|
||||
required_memory_bank m_rombank;
|
||||
|
||||
// video-related
|
||||
tilemap_t *m_bg_tilemap[2];
|
||||
uint8_t m_scroll;
|
||||
uint8_t m_scrollhi;
|
||||
tilemap_t *m_bg_tilemap[2];
|
||||
uint16_t m_scroll = 0;
|
||||
|
||||
// devices
|
||||
required_device<cpu_device> m_maincpu;
|
||||
@ -186,13 +180,23 @@ void chanbara_state::draw_sprites(screen_device &screen, bitmap_ind16& bitmap, c
|
||||
int pri_mask = (m_spriteram[offs + 0x80] & 0x80) ? 0xfffc : 0xfffe;
|
||||
int attr = m_spriteram[offs + 0];
|
||||
int code = m_spriteram[offs + 1];
|
||||
int color = m_spriteram[offs + 0x80] & 0x1f;
|
||||
int flipx = attr & 4;
|
||||
int flipy = attr & 2;
|
||||
int sx = 240 - m_spriteram[offs + 3];
|
||||
int sy = 232 - m_spriteram[offs + 2];
|
||||
int color = m_spriteram[offs + 0x80] & 0xf;
|
||||
int flipx = BIT(attr, 2);
|
||||
int flipy = BIT(attr, 1);
|
||||
int sx = (240 - m_spriteram[offs + 3]) & 0xff;
|
||||
int sy = (240 - m_spriteram[offs + 2]) & 0xff;
|
||||
|
||||
sy += 16;
|
||||
// hidden or invalid?
|
||||
if (~attr & 0x01 || attr & 0x08)
|
||||
continue;
|
||||
|
||||
if (flip_screen())
|
||||
{
|
||||
sx = 240 - sx;
|
||||
sy = 240 - sy;
|
||||
flipx = !flipx;
|
||||
flipy = !flipy;
|
||||
}
|
||||
|
||||
// could be simplified by rearranging gfx in loading / init
|
||||
if (m_spriteram[offs + 0x80] & 0x10) code += 0x200;
|
||||
@ -201,16 +205,11 @@ void chanbara_state::draw_sprites(screen_device &screen, bitmap_ind16& bitmap, c
|
||||
|
||||
if (attr & 0x10)
|
||||
{
|
||||
if (!flipy)
|
||||
{
|
||||
m_gfxdecode->gfx(1)->prio_transpen(bitmap, cliprect, code, color, flipx, flipy, sx, sy - 16, screen.priority(), pri_mask, 0);
|
||||
m_gfxdecode->gfx(1)->prio_transpen(bitmap, cliprect, code + 1, color, flipx, flipy, sx, sy, screen.priority(), pri_mask, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_gfxdecode->gfx(1)->prio_transpen(bitmap, cliprect, code, color, flipx, flipy, sx, sy, screen.priority(), pri_mask, 0);
|
||||
m_gfxdecode->gfx(1)->prio_transpen(bitmap, cliprect, code + 1, color, flipx, flipy, sx, sy - 16, screen.priority(), pri_mask, 0);
|
||||
}
|
||||
if (flip_screen())
|
||||
sy += 16;
|
||||
|
||||
m_gfxdecode->gfx(1)->prio_transpen(bitmap, cliprect, code + (flipy ^ 1), color, flipx, flipy, sx, sy, screen.priority(), pri_mask, 0);
|
||||
m_gfxdecode->gfx(1)->prio_transpen(bitmap, cliprect, code + flipy, color, flipx, flipy, sx, sy - 16, screen.priority(), pri_mask, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -223,7 +222,7 @@ uint32_t chanbara_state::screen_update(screen_device &screen, bitmap_ind16 &bitm
|
||||
{
|
||||
screen.priority().fill(0, cliprect);
|
||||
|
||||
m_bg_tilemap[1]->set_scrolly(0, m_scroll | (m_scrollhi << 8));
|
||||
m_bg_tilemap[1]->set_scrolly(0, m_scroll);
|
||||
m_bg_tilemap[1]->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); // ensure bg pen for each tile gets drawn behind sprites
|
||||
m_bg_tilemap[1]->draw(screen, bitmap, cliprect, 0, 1);
|
||||
m_bg_tilemap[0]->draw(screen, bitmap, cliprect, 0, 2);
|
||||
@ -247,7 +246,7 @@ void chanbara_state::prg_map(address_map &map)
|
||||
map(0x2001, 0x2001).portr("SYSTEM");
|
||||
map(0x2002, 0x2002).portr("P2");
|
||||
map(0x2003, 0x2003).portr("P1");
|
||||
map(0x3800, 0x3801).rw("ymsnd", FUNC(ym2203_device::read), FUNC(ym2203_device::write));
|
||||
map(0x3800, 0x3801).w("ymsnd", FUNC(ym2203_device::write)).nopr();
|
||||
map(0x4000, 0x7fff).bankr(m_rombank);
|
||||
map(0x8000, 0xffff).rom();
|
||||
}
|
||||
@ -256,59 +255,59 @@ void chanbara_state::prg_map(address_map &map)
|
||||
|
||||
// verified from M6809 code
|
||||
static INPUT_PORTS_START( chanbara )
|
||||
PORT_START ("DSW1")
|
||||
PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:1,2")
|
||||
PORT_START("DSW1")
|
||||
PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW1:1,2")
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( 2C_1C ) )
|
||||
PORT_DIPSETTING( 0x03, DEF_STR( 1C_1C ) )
|
||||
PORT_DIPSETTING( 0x02, DEF_STR( 1C_2C ) )
|
||||
PORT_DIPSETTING( 0x01, DEF_STR( 1C_3C ) )
|
||||
PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:3,4")
|
||||
PORT_DIPNAME( 0x0c, 0x0c, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:3,4")
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( 2C_1C ) )
|
||||
PORT_DIPSETTING( 0x0c, DEF_STR( 1C_1C ) )
|
||||
PORT_DIPSETTING( 0x08, DEF_STR( 1C_2C ) )
|
||||
PORT_DIPSETTING( 0x04, DEF_STR( 1C_3C ) )
|
||||
PORT_DIPNAME( 0x10, 0x10, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:5") // code at 0xedc0
|
||||
PORT_DIPNAME( 0x10, 0x10, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:5") // code at 0xedc0
|
||||
PORT_DIPSETTING( 0x10, DEF_STR( Easy ) )
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( Hard ) )
|
||||
PORT_DIPNAME( 0x20, 0x20, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:6")
|
||||
PORT_DIPNAME( 0x20, 0x20, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:6")
|
||||
PORT_DIPSETTING( 0x00, "1" )
|
||||
PORT_DIPSETTING( 0x20, "3" )
|
||||
PORT_DIPNAME( 0x40, 0x40, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW1:7") // table at 0xc249 (2 * 2 words)
|
||||
PORT_DIPNAME( 0x40, 0x40, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW1:7") // table at 0xc249 (2 * 2 words)
|
||||
PORT_DIPSETTING( 0x40, "50k and 70k" )
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( None ) )
|
||||
PORT_DIPNAME( 0x80, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW1:8")
|
||||
PORT_DIPNAME( 0x80, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW1:8")
|
||||
PORT_DIPSETTING( 0x00, DEF_STR( Upright ) )
|
||||
PORT_DIPSETTING( 0x80, DEF_STR( Cocktail ) )
|
||||
|
||||
PORT_START ("SYSTEM")
|
||||
PORT_START("SYSTEM")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_START1 )
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START2 )
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
|
||||
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
|
||||
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 )
|
||||
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 )
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE1 ) // same coinage as COIN1
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE1 ) // same coinage as COIN1
|
||||
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
|
||||
|
||||
PORT_START ("P1")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_DOWN ) PORT_4WAY
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_UP ) PORT_4WAY
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_LEFT ) PORT_4WAY
|
||||
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_RIGHT ) PORT_4WAY
|
||||
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_DOWN ) PORT_4WAY
|
||||
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_UP ) PORT_4WAY
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_LEFT ) PORT_4WAY
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_RIGHT ) PORT_4WAY
|
||||
PORT_START("P1")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_DOWN ) PORT_4WAY
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_UP ) PORT_4WAY
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_LEFT ) PORT_4WAY
|
||||
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_RIGHT ) PORT_4WAY
|
||||
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_DOWN ) PORT_4WAY
|
||||
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_UP ) PORT_4WAY
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_LEFT ) PORT_4WAY
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_RIGHT ) PORT_4WAY
|
||||
|
||||
PORT_START ("P2")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_DOWN ) PORT_4WAY PORT_COCKTAIL
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_UP ) PORT_4WAY PORT_COCKTAIL
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_LEFT ) PORT_4WAY PORT_COCKTAIL
|
||||
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_RIGHT ) PORT_4WAY PORT_COCKTAIL
|
||||
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_DOWN ) PORT_4WAY PORT_COCKTAIL
|
||||
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_UP ) PORT_4WAY PORT_COCKTAIL
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_LEFT ) PORT_4WAY PORT_COCKTAIL
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_RIGHT ) PORT_4WAY PORT_COCKTAIL
|
||||
PORT_START("P2")
|
||||
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_DOWN ) PORT_4WAY PORT_COCKTAIL
|
||||
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_UP ) PORT_4WAY PORT_COCKTAIL
|
||||
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_LEFT ) PORT_4WAY PORT_COCKTAIL
|
||||
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICKRIGHT_RIGHT ) PORT_4WAY PORT_COCKTAIL
|
||||
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_DOWN ) PORT_4WAY PORT_COCKTAIL
|
||||
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_UP ) PORT_4WAY PORT_COCKTAIL
|
||||
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_LEFT ) PORT_4WAY PORT_COCKTAIL
|
||||
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICKLEFT_RIGHT ) PORT_4WAY PORT_COCKTAIL
|
||||
INPUT_PORTS_END
|
||||
|
||||
/***************************************************************************/
|
||||
@ -330,11 +329,11 @@ static const gfx_layout tile16layout =
|
||||
RGN_FRAC(1,4), // number of tiles
|
||||
3, // bits per pixel
|
||||
{ RGN_FRAC(1,2),0,4 }, // plane offsets
|
||||
{ 16*8+RGN_FRAC(1,4)+0,16*8+ RGN_FRAC(1,4)+1,16*8+ RGN_FRAC(1,4)+2,16*8+ RGN_FRAC(1,4)+3,
|
||||
{
|
||||
16*8+RGN_FRAC(1,4)+0,16*8+ RGN_FRAC(1,4)+1,16*8+ RGN_FRAC(1,4)+2,16*8+ RGN_FRAC(1,4)+3,
|
||||
0,1,2,3,
|
||||
RGN_FRAC(1,4)+0, RGN_FRAC(1,4)+1, RGN_FRAC(1,4)+2, RGN_FRAC(1,4)+3,
|
||||
16*8+0, 16*8+1, 16*8+2, 16*8+3,
|
||||
|
||||
}, // x offsets
|
||||
{ 0*8,1*8,2*8,3*8, 4*8, 5*8, 6*8, 7*8,8*8,9*8,10*8,11*8,12*8,13*8,14*8,15*8 }, // y offsets
|
||||
32*8 // offset to next tile
|
||||
@ -346,7 +345,7 @@ static const gfx_layout spritelayout =
|
||||
16,16,
|
||||
RGN_FRAC(1,3),
|
||||
3,
|
||||
{ RGN_FRAC(2,3),RGN_FRAC(1,3), 0},
|
||||
{ RGN_FRAC(2,3),RGN_FRAC(1,3), 0 },
|
||||
{ 2*8*8+0,2*8*8+1,2*8*8+2,2*8*8+3,2*8*8+4,2*8*8+5,2*8*8+6,2*8*8+7,
|
||||
0,1,2,3,4,5,6,7 },
|
||||
{ 0*8,1*8,2*8,3*8,4*8,5*8,6*8,7*8,
|
||||
@ -355,61 +354,48 @@ static const gfx_layout spritelayout =
|
||||
};
|
||||
|
||||
static GFXDECODE_START( gfx_chanbara )
|
||||
GFXDECODE_ENTRY( "gfx1", 0x00000, tilelayout, 0x40, 32 )
|
||||
GFXDECODE_ENTRY( "sprites", 0x00000, spritelayout, 0x80, 16 )
|
||||
GFXDECODE_ENTRY( "gfx3", 0x00000, tile16layout, 0, 32 )
|
||||
GFXDECODE_ENTRY( "gfx1", 0, tilelayout, 0x40, 32 )
|
||||
GFXDECODE_ENTRY( "sprites", 0, spritelayout, 0x80, 16 )
|
||||
GFXDECODE_ENTRY( "gfx3", 0, tile16layout, 0, 32 )
|
||||
GFXDECODE_END
|
||||
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
void chanbara_state::ay_out_0_w(uint8_t data)
|
||||
void chanbara_state::ym_porta_w(uint8_t data)
|
||||
{
|
||||
LOGAYOUTS("ay_out_0_w %02x\n", data);
|
||||
|
||||
m_scroll = data;
|
||||
m_scroll = (m_scroll & ~0xff) | data;
|
||||
}
|
||||
|
||||
void chanbara_state::ay_out_1_w(uint8_t data)
|
||||
void chanbara_state::ym_portb_w(uint8_t data)
|
||||
{
|
||||
LOGAYOUTS("ay_out_1_w %02x\n", data);
|
||||
// bit 0: scroll high bit
|
||||
m_scroll = (m_scroll & 0xff) | (data << 8 & 0x100);
|
||||
|
||||
m_scrollhi = data & 0x01;
|
||||
|
||||
flip_screen_set(data & 0x02);
|
||||
// bit 1: flip screen
|
||||
flip_screen_set(BIT(data, 1));
|
||||
|
||||
// bit 2: ROM bank
|
||||
m_rombank->set_entry((data & 0x04) >> 2);
|
||||
|
||||
// others: unused
|
||||
if (data & 0xf8)
|
||||
LOGAYOUTS("ay_out_1_w unused bits set %02x\n", data & 0xf8);
|
||||
logerror("ym_portb_w unused bits set %02x\n", data & 0xf8);
|
||||
}
|
||||
|
||||
void chanbara_state::machine_start()
|
||||
{
|
||||
save_item(NAME(m_scroll));
|
||||
save_item(NAME(m_scrollhi));
|
||||
}
|
||||
|
||||
void chanbara_state::machine_reset()
|
||||
{
|
||||
m_scroll = 0;
|
||||
m_scrollhi = 0;
|
||||
}
|
||||
|
||||
void chanbara_state::chanbara(machine_config &config)
|
||||
{
|
||||
MC6809E(config, m_maincpu, XTAL(12'000'000)/8);
|
||||
// basic machine hardware
|
||||
MC6809E(config, m_maincpu, 12_MHz_XTAL / 8);
|
||||
m_maincpu->set_addrmap(AS_PROGRAM, &chanbara_state::prg_map);
|
||||
|
||||
|
||||
/* video hardware */
|
||||
// video hardware
|
||||
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
|
||||
// screen.set_refresh_hz(57.4122);
|
||||
// screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500) /* not accurate */);
|
||||
// screen.set_size(32*8, 32*8);
|
||||
// screen.set_visarea(0, 32*8-1, 2*8, 30*8-1);
|
||||
// DECO video CRTC
|
||||
screen.set_raw(XTAL(12'000'000)/2,384,0,256,272,16,240);
|
||||
screen.set_raw(12_MHz_XTAL / 2, 384, 0, 256, 272, 8, 248); // DECO video CRTC
|
||||
screen.set_screen_update(FUNC(chanbara_state::screen_update));
|
||||
screen.set_palette(m_palette);
|
||||
|
||||
@ -417,46 +403,47 @@ void chanbara_state::chanbara(machine_config &config)
|
||||
|
||||
PALETTE(config, m_palette, FUNC(chanbara_state::palette), 256);
|
||||
|
||||
// sound hardware
|
||||
SPEAKER(config, "mono").front_center();
|
||||
|
||||
ym2203_device &ymsnd(YM2203(config, "ymsnd", 12000000/8));
|
||||
ym2203_device &ymsnd(YM2203(config, "ymsnd", 12_MHz_XTAL / 8));
|
||||
ymsnd.irq_handler().set_inputline(m_maincpu, 0);
|
||||
ymsnd.port_a_write_callback().set(FUNC(chanbara_state::ay_out_0_w));
|
||||
ymsnd.port_b_write_callback().set(FUNC(chanbara_state::ay_out_1_w));
|
||||
ymsnd.port_a_write_callback().set(FUNC(chanbara_state::ym_porta_w));
|
||||
ymsnd.port_b_write_callback().set(FUNC(chanbara_state::ym_portb_w));
|
||||
ymsnd.add_route(ALL_OUTPUTS, "mono", 1.0);
|
||||
}
|
||||
|
||||
|
||||
ROM_START( chanbara )
|
||||
ROM_REGION( 0x10000, "maincpu", 0 )
|
||||
ROM_LOAD( "cp01.16c", 0x08000, 0x4000, CRC(a0c3c24c) SHA1(8445dc39dd763187a2d66c6165b487f146e7d474))
|
||||
ROM_LOAD( "cp00-2.17c", 0x0c000, 0x4000, CRC(a045e463) SHA1(2eb546e16f163be6ed72238f2f0203527a957efd) )
|
||||
ROM_LOAD( "cp01.16c", 0x8000, 0x4000, CRC(a0c3c24c) SHA1(8445dc39dd763187a2d66c6165b487f146e7d474) )
|
||||
ROM_LOAD( "cp00-2.17c", 0xc000, 0x4000, CRC(a045e463) SHA1(2eb546e16f163be6ed72238f2f0203527a957efd) )
|
||||
|
||||
ROM_REGION( 0x8000, "user1", 0 ) // background data
|
||||
ROM_LOAD( "cp02.14c", 0x00000, 0x8000, CRC(c2b66cea) SHA1(f72f57add5f38313a72f5c521dce157edf49f70e) )
|
||||
ROM_LOAD( "cp02.14c", 0x0000, 0x8000, CRC(c2b66cea) SHA1(f72f57add5f38313a72f5c521dce157edf49f70e) )
|
||||
|
||||
ROM_REGION( 0x02000, "gfx1", 0 ) // text layer
|
||||
ROM_LOAD( "cp12.17h", 0x00000, 0x2000, CRC(b87b96de) SHA1(f8bb9f094917df305c4fed071edaa775071e40fd) )
|
||||
ROM_LOAD( "cp12.17h", 0x0000, 0x2000, CRC(b87b96de) SHA1(f8bb9f094917df305c4fed071edaa775071e40fd) )
|
||||
|
||||
ROM_REGION( 0x08000, "gfx3", 0 ) // bg layer
|
||||
ROM_LOAD( "cp13.15h", 0x00000, 0x4000, CRC(2dc38c3d) SHA1(4bb1335b8285e91b51c28e74d8de11a8d6df0486) )
|
||||
ROM_LOAD( "cp13.15h", 0x0000, 0x4000, CRC(2dc38c3d) SHA1(4bb1335b8285e91b51c28e74d8de11a8d6df0486) )
|
||||
// ROM cp14.13h is expanded at 0x4000 - 0x8000
|
||||
|
||||
ROM_REGION( 0x08000, "gfx4", 0 )
|
||||
ROM_LOAD( "cp14.13h", 0x00000, 0x2000, CRC(d31db368) SHA1(b62834137bfe4ac2013d2d16b0ead10bf2a2df83) )
|
||||
ROM_LOAD( "cp14.13h", 0x0000, 0x2000, CRC(d31db368) SHA1(b62834137bfe4ac2013d2d16b0ead10bf2a2df83) )
|
||||
|
||||
ROM_REGION( 0x30000, "sprites", ROMREGION_ERASE00 )
|
||||
ROM_LOAD( "cp05.9c", 0x00000, 0x4000, CRC(df2dc3cb) SHA1(3505042c91566bb09fcd2102fecbe2034551b8eb) )
|
||||
ROM_LOAD( "cp04.10c", 0x04000, 0x4000, CRC(f7dce87b) SHA1(129ae41d70d96720e020ec1bc1d3f2d9e87ebf47) )
|
||||
ROM_LOAD( "cp03.12c", 0x08000, 0x4000, CRC(dea247fb) SHA1(d54fa30813613ef6c3b5f86b563e9ab618a9f627))
|
||||
ROM_LOAD( "cp05.9c", 0x00000, 0x4000, CRC(df2dc3cb) SHA1(3505042c91566bb09fcd2102fecbe2034551b8eb) )
|
||||
ROM_LOAD( "cp04.10c", 0x04000, 0x4000, CRC(f7dce87b) SHA1(129ae41d70d96720e020ec1bc1d3f2d9e87ebf47) )
|
||||
ROM_LOAD( "cp03.12c", 0x08000, 0x4000, CRC(dea247fb) SHA1(d54fa30813613ef6c3b5f86b563e9ab618a9f627) )
|
||||
|
||||
ROM_LOAD( "cp08.5c", 0x10000, 0x4000, CRC(4cf35192) SHA1(1891dcc412caf72ba5a2ea56c1cab35cb3ae6123) )
|
||||
ROM_LOAD( "cp07.6c", 0x14000, 0x4000, CRC(0e3727f2) SHA1(d177651bc20a56f5651ae5ce6f3d3ff7ad0e2053) )
|
||||
ROM_LOAD( "cp06.7c", 0x18000, 0x4000, CRC(2f337c08) SHA1(657ee6776780fa0a979a278ff27a49b459232cad) )
|
||||
ROM_LOAD( "cp08.5c", 0x10000, 0x4000, CRC(4cf35192) SHA1(1891dcc412caf72ba5a2ea56c1cab35cb3ae6123) )
|
||||
ROM_LOAD( "cp07.6c", 0x14000, 0x4000, CRC(0e3727f2) SHA1(d177651bc20a56f5651ae5ce6f3d3ff7ad0e2053) )
|
||||
ROM_LOAD( "cp06.7c", 0x18000, 0x4000, CRC(2f337c08) SHA1(657ee6776780fa0a979a278ff27a49b459232cad) )
|
||||
|
||||
ROM_LOAD( "cp11.1c", 0x20000, 0x4000, CRC(33e6160a) SHA1(b0171b554825072eebe935d12a6085d158b87bdc) )
|
||||
ROM_LOAD( "cp10.2c", 0x24000, 0x4000, CRC(bfa324c0) SHA1(c7ff09bb5f1dd2d3707970fae1fd60b6004250c0) )
|
||||
ROM_LOAD( "cp09.4c", 0x28000, 0x4000, CRC(3f58b647) SHA1(4eb212667aedd7c397a4911ac7f1b542c5c0a70d) )
|
||||
ROM_LOAD( "cp11.1c", 0x20000, 0x4000, CRC(33e6160a) SHA1(b0171b554825072eebe935d12a6085d158b87bdc) )
|
||||
ROM_LOAD( "cp10.2c", 0x24000, 0x4000, CRC(bfa324c0) SHA1(c7ff09bb5f1dd2d3707970fae1fd60b6004250c0) )
|
||||
ROM_LOAD( "cp09.4c", 0x28000, 0x4000, CRC(3f58b647) SHA1(4eb212667aedd7c397a4911ac7f1b542c5c0a70d) )
|
||||
|
||||
ROM_REGION( 0x0300, "proms", 0 )
|
||||
ROM_LOAD( "cp17.4k", 0x0000, 0x0100, CRC(cf03706e) SHA1(2dd2b29067f418ec590c56a38cc64d09d8dc8e09) ) // red
|
||||
@ -485,4 +472,4 @@ void chanbara_state::init_chanbara()
|
||||
} // Anonymous namespace
|
||||
|
||||
|
||||
GAME( 1985, chanbara, 0, chanbara, chanbara, chanbara_state, init_chanbara, ROT270, "Data East Corporation", "Chanbara (Japan)", MACHINE_SUPPORTS_SAVE | MACHINE_NO_COCKTAIL ) // title & flyer suggests "Chan Bara" but it's actually チャンバラ
|
||||
GAME( 1985, chanbara, 0, chanbara, chanbara, chanbara_state, init_chanbara, ROT270, "Data East Corporation", "Chanbara (Japan)", MACHINE_SUPPORTS_SAVE ) // title & flyer suggests "Chan Bara" but it's actually チャンバラ
|
||||
|
@ -277,21 +277,21 @@ void seicross_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprec
|
||||
int const color = data[1] & 0x0f;
|
||||
int flipx = BIT(data[0], 6);
|
||||
int flipy = BIT(data[0], 7);
|
||||
int x = data[3];
|
||||
int y = 240 - data[2];
|
||||
int sx = data[3];
|
||||
int sy = 240 - data[2];
|
||||
|
||||
if (flip_screen())
|
||||
{
|
||||
x = 240 - x;
|
||||
y = 240 - y;
|
||||
sx = 240 - sx;
|
||||
sy = 240 - sy;
|
||||
flipx = !flipx;
|
||||
flipy = !flipy;
|
||||
}
|
||||
|
||||
m_gfxdecode->gfx(1)->transpen(bitmap, cliprect, code, color, flipx, flipy, x, y, 0);
|
||||
m_gfxdecode->gfx(1)->transpen(bitmap, cliprect, code, color, flipx, flipy, sx, sy, 0);
|
||||
|
||||
if (x > 0xf0)
|
||||
m_gfxdecode->gfx(1)->transpen(bitmap, cliprect, code, color, flipx, flipy, x - 256, y, 0);
|
||||
if (sx > 0xf0)
|
||||
m_gfxdecode->gfx(1)->transpen(bitmap, cliprect, code, color, flipx, flipy, sx - 256, sy, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -200,6 +200,7 @@ void dogfgt_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect)
|
||||
int sy = (241 - m_spriteram[offs + 2]) & 0xff;
|
||||
int flipx = m_spriteram[offs] & 0x04;
|
||||
int flipy = m_spriteram[offs] & 0x02;
|
||||
|
||||
if (flip_screen())
|
||||
{
|
||||
sx = 240 - sx;
|
||||
|
Loading…
Reference in New Issue
Block a user