mirror of
https://github.com/holub/mame
synced 2025-04-22 08:22:15 +03:00
hng64: refactor (nw) (#3861)
* hng64: refactor (nw) document outputs (lamps, coin counters) and use device finder for analog ports * improve sprite filtering in roadedge (nw)
This commit is contained in:
parent
0fb5d79542
commit
e3a13bf8e2
@ -1471,7 +1471,7 @@ void hng64_state::init_ss64()
|
||||
m_samsho64_3d_hack = 1;
|
||||
}
|
||||
|
||||
void hng64_state::init_hng64_race()
|
||||
void hng64_state::init_hng64_drive()
|
||||
{
|
||||
m_no_machine_error_code = 0x02;
|
||||
init_hng64();
|
||||
@ -1479,7 +1479,7 @@ void hng64_state::init_hng64_race()
|
||||
|
||||
void hng64_state::init_roadedge()
|
||||
{
|
||||
init_hng64_race();
|
||||
init_hng64_drive();
|
||||
m_roadedge_3d_hack = 1;
|
||||
}
|
||||
|
||||
@ -1821,7 +1821,7 @@ void hng64_state::machine_reset()
|
||||
|
||||
WRITE8_MEMBER(hng64_state::ioport1_w)
|
||||
{
|
||||
LOG("%s: ioport1_w %02x\n", machine().describe_context(), data);
|
||||
//LOG("%s: ioport1_w %02x\n", machine().describe_context(), data);
|
||||
|
||||
/* Port bits
|
||||
|
||||
@ -1842,19 +1842,127 @@ WRITE8_MEMBER(hng64_state::ioport1_w)
|
||||
// it does write 0xff here before each set of reading, but before setting a new output address?
|
||||
WRITE8_MEMBER(hng64_state::ioport3_w)
|
||||
{
|
||||
int addr = (m_port1&0xe0)>>5;
|
||||
|
||||
LOG("%s: ioport3_w %02x (to address %02x) (other bits of m_port1 %02x)\n", machine().describe_context(), data, addr, m_port1 & 0x1f);
|
||||
if (m_port1 & 0x08) // 0x08 in port1 enables write? otherwise it writes 0xff to port 7 all the time, when port 7 is also lamps
|
||||
{
|
||||
int addr = (m_port1 & 0xe0) >> 5;
|
||||
m_lamps->lamps_w(space, addr, data);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
READ8_MEMBER(hng64_state::ioport3_r)
|
||||
{
|
||||
int addr = (m_port1&0xe0)>>5;
|
||||
|
||||
//LOG("%s: ioport3_r (from address %02x) (other bits of m_port1 %02x)\n", machine().describe_context(), addr, m_port1 & 0x1f);
|
||||
return m_intest[addr]->read();
|
||||
return m_in[addr]->read();
|
||||
}
|
||||
|
||||
DEFINE_DEVICE_TYPE(HNG64_LAMPS, hng64_lamps_device, "hng64_lamps", "HNG64 Lamps")
|
||||
|
||||
hng64_lamps_device::hng64_lamps_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
|
||||
: device_t(mconfig, HNG64_LAMPS, tag, owner, clock)
|
||||
, m_lamps_out_cb{{*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}, {*this}}
|
||||
{
|
||||
}
|
||||
|
||||
void hng64_lamps_device::device_start()
|
||||
{
|
||||
for (auto &cb : m_lamps_out_cb)
|
||||
cb.resolve_safe();
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(hng64_state::hng64_drive_lamps7_w)
|
||||
{
|
||||
/*
|
||||
0x80 - BGM Select #2 (Active High)
|
||||
0x40 - BGM Select #1 (Active High)
|
||||
0x20
|
||||
0x10
|
||||
0x08
|
||||
0x04
|
||||
0x02
|
||||
0x01
|
||||
*/
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(hng64_state::hng64_drive_lamps6_w)
|
||||
{
|
||||
/*
|
||||
0x80 - BGM Select #4 (Active High)
|
||||
0x40 - BGM Select #3 (Active High)
|
||||
0x20 - Winning Lamp (0x00 = ON, 0x10 = Blink 1, 0x20 = Blink 2, 0x30 = OFF)
|
||||
0x10 - ^^
|
||||
0x08 - Breaking Lamp (Active Low?)
|
||||
0x04 - Start Lamp (Active High)
|
||||
0x02
|
||||
0x01 - Coin Counter #1
|
||||
*/
|
||||
machine().bookkeeping().coin_counter_w(0, data & 0x01);
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(hng64_state::hng64_drive_lamps5_w)
|
||||
{
|
||||
// force feedback steering position
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(hng64_state::hng64_shoot_lamps7_w)
|
||||
{
|
||||
/*
|
||||
0x80
|
||||
0x40 - Gun #3
|
||||
0x20 - Gun #2
|
||||
0x10 - Gun #1
|
||||
0x08
|
||||
0x04
|
||||
0x02
|
||||
0x01
|
||||
*/
|
||||
}
|
||||
|
||||
/*
|
||||
Beast Busters 2 outputs (all written to offset 0x1c in dualport ram):
|
||||
0x00000001 start #1
|
||||
0x00000002 start #2
|
||||
0x00000004 start #3
|
||||
0x00001000 gun #1
|
||||
0x00002000 gun #2
|
||||
0x00004000 gun #3
|
||||
*/
|
||||
|
||||
WRITE8_MEMBER(hng64_state::hng64_shoot_lamps6_w)
|
||||
{
|
||||
// Start Lamp #1 / #2 don't get written to the output port, is this a TLCS870 bug or are they not connected to the 'lamp' outputs, they do get written to the DP ram, see above notes
|
||||
/*
|
||||
0x80
|
||||
0x40
|
||||
0x20
|
||||
0x10
|
||||
0x08
|
||||
0x04 - Start Lamp #3
|
||||
0x02
|
||||
0x01
|
||||
*/
|
||||
}
|
||||
|
||||
WRITE8_MEMBER(hng64_state::hng64_fight_lamps6_w)
|
||||
{
|
||||
/*
|
||||
0x80
|
||||
0x40
|
||||
0x20
|
||||
0x10
|
||||
0x08
|
||||
0x04
|
||||
0x02 - Coin Counter #2
|
||||
0x01 - Coin Counter #1
|
||||
*/
|
||||
machine().bookkeeping().coin_counter_w(0, data & 0x01);
|
||||
machine().bookkeeping().coin_counter_w(1, data & 0x02);
|
||||
}
|
||||
|
||||
|
||||
/***********************************************
|
||||
|
||||
Dual Port RAM access from MCU side
|
||||
@ -1943,14 +2051,14 @@ WRITE8_MEMBER(hng64_state::ioport4_w)
|
||||
|
||||
***********************************************/
|
||||
|
||||
READ8_MEMBER(hng64_state::anport0_r) { return ioport("AN0")->read(); }
|
||||
READ8_MEMBER(hng64_state::anport1_r) { return ioport("AN1")->read(); }
|
||||
READ8_MEMBER(hng64_state::anport2_r) { return ioport("AN2")->read(); }
|
||||
READ8_MEMBER(hng64_state::anport3_r) { return ioport("AN3")->read(); }
|
||||
READ8_MEMBER(hng64_state::anport4_r) { return ioport("AN4")->read(); }
|
||||
READ8_MEMBER(hng64_state::anport5_r) { return ioport("AN5")->read(); }
|
||||
READ8_MEMBER(hng64_state::anport6_r) { return ioport("AN6")->read(); }
|
||||
READ8_MEMBER(hng64_state::anport7_r) { return ioport("AN7")->read(); }
|
||||
READ8_MEMBER(hng64_state::anport0_r) { return m_an_in[0]->read(); }
|
||||
READ8_MEMBER(hng64_state::anport1_r) { return m_an_in[1]->read(); }
|
||||
READ8_MEMBER(hng64_state::anport2_r) { return m_an_in[2]->read(); }
|
||||
READ8_MEMBER(hng64_state::anport3_r) { return m_an_in[3]->read(); }
|
||||
READ8_MEMBER(hng64_state::anport4_r) { return m_an_in[4]->read(); }
|
||||
READ8_MEMBER(hng64_state::anport5_r) { return m_an_in[5]->read(); }
|
||||
READ8_MEMBER(hng64_state::anport6_r) { return m_an_in[6]->read(); }
|
||||
READ8_MEMBER(hng64_state::anport7_r) { return m_an_in[7]->read(); }
|
||||
|
||||
/***********************************************
|
||||
|
||||
@ -2035,7 +2143,7 @@ MACHINE_CONFIG_START(hng64_state::hng64)
|
||||
iomcu.p0_out_cb().set(FUNC(hng64_state::ioport0_w)); // writes to shared ram
|
||||
iomcu.p1_out_cb().set(FUNC(hng64_state::ioport1_w)); // configuration / clocking for input port (port 3) accesses
|
||||
//iomcu.p2_out_cb().set(FUNC(hng64_state::ioport2_w)); // the IO MCU uses EXTINT0 which shares one of the pins on this port, but the port is not used for IO
|
||||
iomcu.p3_out_cb().set(FUNC(hng64_state::ioport3_w)); // writes to input ports? maybe lamps, coin counters etc.?
|
||||
iomcu.p3_out_cb().set(FUNC(hng64_state::ioport3_w)); // writes to ports for lamps, coin counters, force feedback etc.
|
||||
iomcu.p4_out_cb().set(FUNC(hng64_state::ioport4_w)); // unknown, lower 2 IO bits accessed along with serial accesses
|
||||
//iomcu.p5_out_cb().set(FUNC(hng64_state::ioport5_w)); // simply seems to be unused, neither used for an IO port, nor any of the other features
|
||||
//iomcu.p6_out_cb().set(FUNC(hng64_state::ioport6_w)); // the IO MCU code uses the ADC which shares pins with port 6, meaning port 6 isn't used as an IO port
|
||||
@ -2055,7 +2163,44 @@ MACHINE_CONFIG_START(hng64_state::hng64)
|
||||
|
||||
MCFG_DEVICE_ADD("dt71321_dpram", IDT71321, 0)
|
||||
//MCFG_MB8421_INTL_AN0R(INPUTLINE("xxx", 0)) // I don't think the IRQs are connected
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
MACHINE_CONFIG_START(hng64_state::hng64_default)
|
||||
hng64(config);
|
||||
|
||||
hng64_lamps_device &lamps(HNG64_LAMPS(config, m_lamps, 0));
|
||||
lamps.lamps0_out_cb().set(FUNC(hng64_state::hng64_default_lamps0_w));
|
||||
lamps.lamps1_out_cb().set(FUNC(hng64_state::hng64_default_lamps1_w));
|
||||
lamps.lamps2_out_cb().set(FUNC(hng64_state::hng64_default_lamps2_w));
|
||||
lamps.lamps3_out_cb().set(FUNC(hng64_state::hng64_default_lamps3_w));
|
||||
lamps.lamps4_out_cb().set(FUNC(hng64_state::hng64_default_lamps4_w));
|
||||
lamps.lamps5_out_cb().set(FUNC(hng64_state::hng64_default_lamps5_w));
|
||||
lamps.lamps6_out_cb().set(FUNC(hng64_state::hng64_default_lamps6_w));
|
||||
lamps.lamps7_out_cb().set(FUNC(hng64_state::hng64_default_lamps7_w));
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
MACHINE_CONFIG_START(hng64_state::hng64_drive)
|
||||
hng64(config);
|
||||
|
||||
hng64_lamps_device &lamps(HNG64_LAMPS(config, m_lamps, 0));
|
||||
lamps.lamps5_out_cb().set(FUNC(hng64_state::hng64_drive_lamps5_w)); // force feedback steering
|
||||
lamps.lamps6_out_cb().set(FUNC(hng64_state::hng64_drive_lamps6_w)); // lamps + coin counter
|
||||
lamps.lamps7_out_cb().set(FUNC(hng64_state::hng64_drive_lamps7_w)); // lamps
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
MACHINE_CONFIG_START(hng64_state::hng64_shoot)
|
||||
hng64(config);
|
||||
|
||||
hng64_lamps_device &lamps(HNG64_LAMPS(config, m_lamps, 0));
|
||||
lamps.lamps6_out_cb().set(FUNC(hng64_state::hng64_shoot_lamps6_w)); // start lamps (some misisng?!)
|
||||
lamps.lamps7_out_cb().set(FUNC(hng64_state::hng64_shoot_lamps7_w)); // gun lamps
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
MACHINE_CONFIG_START(hng64_state::hng64_fight)
|
||||
hng64(config);
|
||||
|
||||
hng64_lamps_device &lamps(HNG64_LAMPS(config, m_lamps, 0));
|
||||
lamps.lamps6_out_cb().set(FUNC(hng64_state::hng64_fight_lamps6_w)); // coin counters
|
||||
MACHINE_CONFIG_END
|
||||
|
||||
|
||||
@ -2509,13 +2654,13 @@ ROM_START( buriki )
|
||||
ROM_END
|
||||
|
||||
/* Bios */
|
||||
GAME( 1997, hng64, 0, hng64, hng64, hng64_state, init_hng64, ROT0, "SNK", "Hyper NeoGeo 64 Bios", MACHINE_NOT_WORKING|MACHINE_IMPERFECT_SOUND|MACHINE_IS_BIOS_ROOT )
|
||||
GAME( 1997, hng64, 0, hng64_default, hng64, hng64_state, init_hng64, ROT0, "SNK", "Hyper NeoGeo 64 Bios", MACHINE_NOT_WORKING|MACHINE_IMPERFECT_SOUND|MACHINE_IS_BIOS_ROOT )
|
||||
|
||||
/* Games */
|
||||
GAME( 1997, roadedge, hng64, hng64, hng64_drive, hng64_state, init_roadedge, ROT0, "SNK", "Roads Edge / Round Trip (rev.B)", MACHINE_NOT_WORKING|MACHINE_IMPERFECT_SOUND ) /* 001 */
|
||||
GAME( 1998, sams64, hng64, hng64, hng64_fight, hng64_state, init_ss64, ROT0, "SNK", "Samurai Shodown 64 / Samurai Spirits 64", MACHINE_NOT_WORKING|MACHINE_IMPERFECT_SOUND ) /* 002 */
|
||||
GAME( 1998, xrally, hng64, hng64, hng64_drive, hng64_state, init_hng64_race, ROT0, "SNK", "Xtreme Rally / Off Beat Racer!", MACHINE_NOT_WORKING|MACHINE_IMPERFECT_SOUND ) /* 003 */
|
||||
GAME( 1998, bbust2, hng64, hng64, hng64_shoot, hng64_state, init_hng64_shoot, ROT0, "SNK", "Beast Busters 2nd Nightmare", MACHINE_NOT_WORKING|MACHINE_IMPERFECT_SOUND ) /* 004 */
|
||||
GAME( 1998, sams64_2, hng64, hng64, hng64_fight, hng64_state, init_ss64, ROT0, "SNK", "Samurai Shodown: Warrior's Rage / Samurai Spirits 2: Asura Zanmaden", MACHINE_NOT_WORKING|MACHINE_IMPERFECT_SOUND ) /* 005 */
|
||||
GAME( 1998, fatfurwa, hng64, hng64, hng64_fight, hng64_state, init_hng64_fght, ROT0, "SNK", "Fatal Fury: Wild Ambition (rev.A)", MACHINE_NOT_WORKING|MACHINE_IMPERFECT_SOUND ) /* 006 */
|
||||
GAME( 1999, buriki, hng64, hng64, hng64_fight, hng64_state, init_hng64_fght, ROT0, "SNK", "Buriki One (rev.B)", MACHINE_NOT_WORKING|MACHINE_IMPERFECT_SOUND ) /* 007 */
|
||||
GAME( 1997, roadedge, hng64, hng64_drive, hng64_drive, hng64_state, init_roadedge, ROT0, "SNK", "Roads Edge / Round Trip (rev.B)", MACHINE_NOT_WORKING|MACHINE_IMPERFECT_SOUND ) /* 001 */
|
||||
GAME( 1998, sams64, hng64, hng64_fight, hng64_fight, hng64_state, init_ss64, ROT0, "SNK", "Samurai Shodown 64 / Samurai Spirits 64", MACHINE_NOT_WORKING|MACHINE_IMPERFECT_SOUND ) /* 002 */
|
||||
GAME( 1998, xrally, hng64, hng64_drive, hng64_drive, hng64_state, init_hng64_drive, ROT0, "SNK", "Xtreme Rally / Off Beat Racer!", MACHINE_NOT_WORKING|MACHINE_IMPERFECT_SOUND ) /* 003 */
|
||||
GAME( 1998, bbust2, hng64, hng64_shoot, hng64_shoot, hng64_state, init_hng64_shoot, ROT0, "SNK", "Beast Busters 2nd Nightmare", MACHINE_NOT_WORKING|MACHINE_IMPERFECT_SOUND ) /* 004 */
|
||||
GAME( 1998, sams64_2, hng64, hng64_fight, hng64_fight, hng64_state, init_ss64, ROT0, "SNK", "Samurai Shodown: Warrior's Rage / Samurai Spirits 2: Asura Zanmaden", MACHINE_NOT_WORKING|MACHINE_IMPERFECT_SOUND ) /* 005 */
|
||||
GAME( 1998, fatfurwa, hng64, hng64_fight, hng64_fight, hng64_state, init_hng64_fght, ROT0, "SNK", "Fatal Fury: Wild Ambition (rev.A)", MACHINE_NOT_WORKING|MACHINE_IMPERFECT_SOUND ) /* 006 */
|
||||
GAME( 1999, buriki, hng64, hng64_fight, hng64_fight, hng64_state, init_hng64_fght, ROT0, "SNK", "Buriki One (rev.B)", MACHINE_NOT_WORKING|MACHINE_IMPERFECT_SOUND ) /* 007 */
|
||||
|
@ -126,6 +126,31 @@ private:
|
||||
};
|
||||
|
||||
|
||||
// TODO, this could become the IO board device emulation
|
||||
class hng64_lamps_device : public device_t
|
||||
{
|
||||
public:
|
||||
hng64_lamps_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
auto lamps0_out_cb() { return m_lamps_out_cb[0].bind(); }
|
||||
auto lamps1_out_cb() { return m_lamps_out_cb[1].bind(); }
|
||||
auto lamps2_out_cb() { return m_lamps_out_cb[2].bind(); }
|
||||
auto lamps3_out_cb() { return m_lamps_out_cb[3].bind(); }
|
||||
auto lamps4_out_cb() { return m_lamps_out_cb[4].bind(); }
|
||||
auto lamps5_out_cb() { return m_lamps_out_cb[5].bind(); }
|
||||
auto lamps6_out_cb() { return m_lamps_out_cb[6].bind(); }
|
||||
auto lamps7_out_cb() { return m_lamps_out_cb[7].bind(); }
|
||||
|
||||
DECLARE_WRITE8_MEMBER(lamps_w) { m_lamps_out_cb[offset](data); }
|
||||
|
||||
protected:
|
||||
virtual void device_start() override;
|
||||
|
||||
private:
|
||||
devcb_write8 m_lamps_out_cb[8];
|
||||
};
|
||||
|
||||
|
||||
class hng64_state : public driver_device
|
||||
{
|
||||
public:
|
||||
@ -136,6 +161,7 @@ public:
|
||||
m_maincpu(*this, "maincpu"),
|
||||
m_audiocpu(*this, "audiocpu"),
|
||||
m_iomcu(*this, "iomcu"),
|
||||
m_lamps(*this, "lamps"),
|
||||
m_dt71321_dpram(*this, "dt71321_dpram"),
|
||||
m_dsp(*this, "l7a1045"),
|
||||
m_comm(*this, "network"),
|
||||
@ -155,15 +181,20 @@ public:
|
||||
m_fbram2(*this, "fbram2"),
|
||||
m_idt7133_dpram(*this, "com_ram"),
|
||||
m_gfxdecode(*this, "gfxdecode"),
|
||||
m_intest(*this, "IN%u", 0U),
|
||||
m_in(*this, "IN%u", 0U),
|
||||
m_an_in(*this, "AN%u", 0U),
|
||||
m_samsho64_3d_hack(0),
|
||||
m_roadedge_3d_hack(0)
|
||||
{}
|
||||
|
||||
void hng64(machine_config &config);
|
||||
void hng64_default(machine_config &config);
|
||||
void hng64_drive(machine_config &config);
|
||||
void hng64_shoot(machine_config &config);
|
||||
void hng64_fight(machine_config &config);
|
||||
|
||||
void init_roadedge();
|
||||
void init_hng64_race();
|
||||
void init_hng64_drive();
|
||||
void init_hng64();
|
||||
void init_hng64_shoot();
|
||||
void init_ss64();
|
||||
@ -189,6 +220,7 @@ private:
|
||||
required_device<mips3_device> m_maincpu;
|
||||
required_device<v53a_device> m_audiocpu;
|
||||
required_device<tmp87ph40an_device> m_iomcu;
|
||||
required_device<hng64_lamps_device> m_lamps;
|
||||
required_device<idt71321_device> m_dt71321_dpram;
|
||||
required_device<l7a1045_sound_device> m_dsp;
|
||||
required_device<cpu_device> m_comm;
|
||||
@ -215,7 +247,27 @@ private:
|
||||
|
||||
required_device<gfxdecode_device> m_gfxdecode;
|
||||
|
||||
optional_ioport_array<8> m_intest;
|
||||
required_ioport_array<8> m_in;
|
||||
required_ioport_array<8> m_an_in;
|
||||
|
||||
|
||||
DECLARE_WRITE8_MEMBER(hng64_default_lamps0_w) { logerror("lamps0 %02x\n", data); }
|
||||
DECLARE_WRITE8_MEMBER(hng64_default_lamps1_w) { logerror("lamps1 %02x\n", data); }
|
||||
DECLARE_WRITE8_MEMBER(hng64_default_lamps2_w) { logerror("lamps2 %02x\n", data); }
|
||||
DECLARE_WRITE8_MEMBER(hng64_default_lamps3_w) { logerror("lamps3 %02x\n", data); }
|
||||
DECLARE_WRITE8_MEMBER(hng64_default_lamps4_w) { logerror("lamps4 %02x\n", data); }
|
||||
DECLARE_WRITE8_MEMBER(hng64_default_lamps5_w) { logerror("lamps5 %02x\n", data); }
|
||||
DECLARE_WRITE8_MEMBER(hng64_default_lamps6_w) { logerror("lamps6 %02x\n", data); }
|
||||
DECLARE_WRITE8_MEMBER(hng64_default_lamps7_w) { logerror("lamps7 %02x\n", data); }
|
||||
|
||||
DECLARE_WRITE8_MEMBER(hng64_drive_lamps7_w);
|
||||
DECLARE_WRITE8_MEMBER(hng64_drive_lamps6_w);
|
||||
DECLARE_WRITE8_MEMBER(hng64_drive_lamps5_w);
|
||||
|
||||
DECLARE_WRITE8_MEMBER(hng64_shoot_lamps7_w);
|
||||
DECLARE_WRITE8_MEMBER(hng64_shoot_lamps6_w);
|
||||
|
||||
DECLARE_WRITE8_MEMBER(hng64_fight_lamps6_w);
|
||||
|
||||
int m_samsho64_3d_hack;
|
||||
int m_roadedge_3d_hack;
|
||||
|
@ -22,26 +22,22 @@
|
||||
* (*) Fatal Fury WA standard elements are 0x1000-0x1000, all the other games sets 0x100-0x100, related to the bit 27 of sprite regs 0?
|
||||
* (**) setted by black squares in ranking screen in Samurai Shodown 64 1, sprite disable?
|
||||
* (***) bit 22 is setted on some Fatal Fury WA snow (not all of them), bit 21 is setted on Xrally how to play elements in attract mode
|
||||
*
|
||||
* Sprite Global Registers
|
||||
** Sprite Global Registers
|
||||
* -----------------------
|
||||
*
|
||||
* uint32_t | Bits | Use
|
||||
* | 3322 2222 2222 1111 1111 11 |
|
||||
* -------+-1098-7654-3210-9876-5432-1098-7654-3210-+----------------
|
||||
* 0 | ---- z--- b--- ---- ---- ---- ---- ---- | zooming mode, bpp select
|
||||
* 1 | yyyy yyyy yyyy yyyy xxxx xxxx xxxx xxxx | global sprite offset (ss64 rankings in attract)
|
||||
* 2 | ---- ---- ---- ---- ---- ---- ---- ---- |
|
||||
* 0 | ssss z--f b--- -aap ---- ---- ---- ---- | s = unknown, samsho z = zooming mode, f = depthfilter mode (unset set in roadedge ingame) b = bpp select a = always, p = post, disable?
|
||||
* 1 | yyyy yyyy yyyy yyyy xxxx xxxx xxxx xxxx | global sprite offset (ss64 rankings in attract, roadedge HUD scroll when starting game)
|
||||
* 2 | ---- ---- ---- uuuu uuuu uuuu uuuu uuuu | u = unknown, set to 0x000fffff in roadedge ingame, bbust2, samsho - also possible depthfilter related
|
||||
* 3 | ---- ---- ---- ---- ---- ---- ---- ---- |
|
||||
* 4 | ---- ---- ---- ---- ---- ---- ---- ---- |
|
||||
* (anything else is unknown at the current time)
|
||||
* Notes:
|
||||
* [0]
|
||||
* 0xf0000000 setted in both Samurai Shodown
|
||||
* 0x00060000 always setted in all the games
|
||||
* 0x00010000 setted in POST, sprite disable?
|
||||
* [4]
|
||||
* 0x0e0 in Samurai Shodown/Xrally games, 0x1c0 in all the others, zooming factor?
|
||||
|
||||
*/
|
||||
|
||||
void hng64_state::draw_sprites(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
|
||||
@ -74,7 +70,6 @@ void hng64_state::draw_sprites(screen_device &screen, bitmap_rgb32 &bitmap, cons
|
||||
int disable;
|
||||
|
||||
|
||||
|
||||
ypos = (source[0]&0xffff0000)>>16;
|
||||
xpos = (source[0]&0x0000ffff)>>0;
|
||||
xpos += (spriteoffsx);
|
||||
@ -96,13 +91,21 @@ void hng64_state::draw_sprites(screen_device &screen, bitmap_rgb32 &bitmap, cons
|
||||
zoomy = (source[1]&0xffff0000)>>16;
|
||||
zoomx = (source[1]&0x0000ffff)>>0;
|
||||
|
||||
#if 1
|
||||
if(zbuf == 0x7ff) //temp kludge to avoid garbage on screen
|
||||
int filtervalue = 0x000;
|
||||
|
||||
// This flips between ingame and other screens for roadedge, where the sprites which are filtered definitely needs to change and the game explicitly swaps the values in the sprite list at the same time.
|
||||
// m_spriteregs[2] could also play a part as it also flips between 0x00000000 and 0x000fffff at the same time
|
||||
// Samsho games also set the upper 3 bits which could be related, samsho games still have some unwanted sprites (but also use the other 'sprite clear' mechanism)
|
||||
// Could also be draw order related, check if it inverts the z value?
|
||||
if (m_spriteregs[0] & 0x01000000)
|
||||
filtervalue = 0x7ff;
|
||||
|
||||
if(zbuf == filtervalue)
|
||||
{
|
||||
source+=8;
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
|
||||
if(disable)
|
||||
{
|
||||
source+=8;
|
||||
|
Loading…
Reference in New Issue
Block a user