bus/nes: Fixed graphics issues in Street Heroes. (#8624)

* Also added jumper setting to select title screen.

Software list items promoted to working (nes.xml)
---------------------------------------
Street Heroes (Taiwan)
This commit is contained in:
0kmg 2021-09-27 20:16:46 -08:00 committed by GitHub
parent bb492c0dba
commit 6b1057f205
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 52 additions and 28 deletions

View File

@ -53083,14 +53083,17 @@ preliminary proto for the PAL version, still running on NTSC systems) or the gfx
</part>
</software>
<software name="sheroes" supported="no">
<description>Street Heroes (Tw)</description>
<year>19??</year>
<software name="sheroes">
<description>Street Heroes (Taiwan)</description>
<year>199?</year>
<publisher>Sachen</publisher>
<info name="serial" value="TC-027"/>
<info name="alt_title" value="侍魂"/>
<info name="alt_title" value="Shìhún"/>
<part name="cart" interface="nes_cart">
<feature name="slot" value="unl_shero" />
<feature name="pcb" value="UNL-SHERO" />
<feature name="mirroring" value="4screen" />
<dataarea name="chr" size="524288">
<rom name="street heroes (asia) (unl).chr" size="524288" crc="123c0c4b" sha1="a2f99d60945a8f62d138414c97fe69cfdd114d6e" offset="00000" status="baddump" />
</dataarea>
@ -53100,10 +53103,6 @@ preliminary proto for the PAL version, still running on NTSC systems) or the gfx
<!-- 8k VRAM on cartridge -->
<dataarea name="vram" size="8192">
</dataarea>
<dipswitch name="Region" tag="DSW" mask="1">
<dipvalue name="USA" value="0"/>
<dipvalue name="Asia" value="1" default="yes"/>
</dipswitch>
</part>
</software>

View File

@ -83,6 +83,29 @@ DEFINE_DEVICE_TYPE(NES_PJOY84, nes_pjoy84_device, "nes_pjoy84",
DEFINE_DEVICE_TYPE(NES_COOLBOY, nes_coolboy_device, "nes_coolboy", "NES Cart CoolBoy PCB")
INPUT_PORTS_START( sachen_shero )
PORT_START("JUMPER")
PORT_CONFNAME( 0x80, 0x00, "Title Screen" )
PORT_CONFSETTING( 0x00, "Street Heroes" )
PORT_CONFSETTING( 0x80, u8"\u4f8d\u9b42 (Shìhún)" ) // 侍魂
INPUT_PORTS_END
//-------------------------------------------------
// input_ports - device-specific input ports
//-------------------------------------------------
ioport_constructor nes_sachen_shero_device::device_input_ports() const
{
return INPUT_PORTS_NAME( sachen_shero );
}
//**************************************************************************
// LIVE DEVICE
//**************************************************************************
nes_nitra_device::nes_nitra_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: nes_txrom_device(mconfig, NES_NITRA, tag, owner, clock)
{
@ -203,8 +226,10 @@ nes_sa9602b_device::nes_sa9602b_device(const machine_config &mconfig, const char
{
}
nes_sachen_shero_device::nes_sachen_shero_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: nes_txrom_device(mconfig, NES_SACHEN_SHERO, tag, owner, clock), m_reg(0)
nes_sachen_shero_device::nes_sachen_shero_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: nes_txrom_device(mconfig, NES_SACHEN_SHERO, tag, owner, clock)
, m_jumper(*this, "JUMPER")
, m_reg(0)
{
}
@ -533,7 +558,7 @@ void nes_sachen_shero_device::pcb_reset()
m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM;
m_reg = 0;
mmc3_common_initialize(0xff, 0x1ff, 0);
mmc3_common_initialize(0xff, 0xff, 0);
}
void nes_a9746_device::device_start()
@ -1887,22 +1912,21 @@ void nes_sa9602b_device::write_h(offs_t offset, uint8_t data)
Sachen boards used for Street Heroes
in MESS: Very Preliminary support
NES 2.0: mapper 262
In MAME: Supported.
-------------------------------------------------*/
void nes_sachen_shero_device::chr_cb( int start, int bank, int source )
void nes_sachen_shero_device::chr_cb(int start, int bank, int source)
{
int shift = start < 2 ? 5 :
start < 4 ? 6 :
start < 6 ? 8 : 7;
static constexpr u8 shift[4] = {5, 6, 8, 7};
if (!BIT(m_reg, 6))
chr1_x(start, ((m_reg << shift) & 0x100) | bank, source);
chr1_x(start, ((m_reg << shift[start >> 1]) & 0x100) | bank, source);
}
void nes_sachen_shero_device::write_l(offs_t offset, uint8_t data)
void nes_sachen_shero_device::write_l(offs_t offset, u8 data)
{
LOG_MMC(("shero write_l, offset: %04x, data: %02x\n", offset, data));
offset += 0x4100;
@ -1917,16 +1941,15 @@ void nes_sachen_shero_device::write_l(offs_t offset, uint8_t data)
}
}
uint8_t nes_sachen_shero_device::read_l(offs_t offset)
u8 nes_sachen_shero_device::read_l(offs_t offset)
{
LOG_MMC(("shero read_l, offset: %04x\n", offset));
offset += 0x4100;
if (offset == 0x4100)
{
// DSW read!
}
return get_open_bus(); // open bus
return m_jumper->read();
else
return get_open_bus();
}
/*-------------------------------------------------

View File

@ -412,20 +412,22 @@ class nes_sachen_shero_device : public nes_txrom_device
{
public:
// construction/destruction
nes_sachen_shero_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
nes_sachen_shero_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
virtual uint8_t read_l(offs_t offset) override;
virtual void write_l(offs_t offset, uint8_t data) override;
virtual u8 read_l(offs_t offset) override;
virtual void write_l(offs_t offset, u8 data) override;
virtual void chr_cb(int start, int bank, int source) override;
virtual void pcb_reset() override;
protected:
// device-level overrides
virtual ioport_constructor device_input_ports() const override;
virtual void device_start() override;
private:
uint8_t m_reg;
required_ioport m_jumper;
u8 m_reg;
};
// ======================> nes_a9746_device