mirror of
https://github.com/mamedev/mame.git
synced 2024-09-29 17:38:18 +02:00
fphantom,robotadv: small fix to internal layout, combine x/y into one output
This commit is contained in:
parent
af29cf22f1
commit
98ee9e7d4b
7 changed files with 28 additions and 31 deletions
|
@ -69,7 +69,7 @@ DEFINE_DEVICE_TYPE(SENSORBOARD, sensorboard_device, "sensorboard", "Sensorboard"
|
|||
sensorboard_device::sensorboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
|
||||
device_t(mconfig, SENSORBOARD, tag, owner, clock),
|
||||
device_nvram_interface(mconfig, *this),
|
||||
m_out_piece(*this, "piece_%c%u", 0U + 'a', 1U),
|
||||
m_out_piece(*this, "piece_%c%u", unsigned('a'), 1U),
|
||||
m_out_pui(*this, "piece_ui%u", 0U),
|
||||
m_out_count(*this, "count_ui%u", 0U),
|
||||
m_inp_rank(*this, "RANK.%u", 1),
|
||||
|
|
|
@ -77,8 +77,7 @@ public:
|
|||
m_inputs(*this, "IN.%u", 0),
|
||||
m_piece_hand(*this, "cpu_hand"),
|
||||
m_out_motor(*this, "motor%u", 0U),
|
||||
m_out_magnetx(*this, "magnetx"),
|
||||
m_out_magnety(*this, "magnety")
|
||||
m_out_pos(*this, "pos_%c", unsigned('x'))
|
||||
{ }
|
||||
|
||||
void phantom(machine_config &config);
|
||||
|
@ -97,8 +96,7 @@ protected:
|
|||
optional_ioport_array<2> m_inputs;
|
||||
output_finder<> m_piece_hand;
|
||||
output_finder<5> m_out_motor;
|
||||
output_finder<> m_out_magnetx;
|
||||
output_finder<> m_out_magnety;
|
||||
output_finder<2> m_out_pos;
|
||||
|
||||
// address maps
|
||||
virtual void main_map(address_map &map);
|
||||
|
@ -141,8 +139,7 @@ void phantom_state::machine_start()
|
|||
// resolve outputs
|
||||
m_piece_hand.resolve();
|
||||
m_out_motor.resolve();
|
||||
m_out_magnetx.resolve();
|
||||
m_out_magnety.resolve();
|
||||
m_out_pos.resolve();
|
||||
|
||||
// register for savestates
|
||||
save_item(NAME(m_mux));
|
||||
|
@ -237,8 +234,8 @@ void phantom_state::output_magnet_pos()
|
|||
{
|
||||
// put active state on x bit 8
|
||||
const int active = BIT(m_motors_ctrl, 4) ? 0x100 : 0;
|
||||
m_out_magnetx = m_hmotor_pos | active;
|
||||
m_out_magnety = m_vmotor_pos;
|
||||
m_out_pos[0] = m_hmotor_pos | active;
|
||||
m_out_pos[1] = m_vmotor_pos;
|
||||
}
|
||||
|
||||
TIMER_DEVICE_CALLBACK_MEMBER(phantom_state::motors_timer)
|
||||
|
|
|
@ -690,20 +690,21 @@ license:CC0-1.0
|
|||
|
||||
<!-- optional magnet position overlay -->
|
||||
<collection name="Magnet Position">
|
||||
<element name="magnetx" ref="mpos">
|
||||
<animate name="magnety" />
|
||||
<element name="pos_x" ref="mpos">
|
||||
<animate name="pos_y" />
|
||||
<bounds state="4" x="-17.5" y="84.0" width="320" height="1.25" />
|
||||
<bounds state="136" x="-17.5" y="1.5" width="320" height="1.25" />
|
||||
<color alpha="0.4" />
|
||||
</element>
|
||||
<element name="magnetx" ref="mpos">
|
||||
<animate name="magnety" />
|
||||
<element name="pos_x" ref="mpos">
|
||||
<animate name="pos_y" />
|
||||
<bounds state="4" x="-177.5" y="84.0" width="320" height="1.25" />
|
||||
<bounds state="136" x="-177.5" y="1.5" width="320" height="1.25" />
|
||||
<color alpha="0.9" />
|
||||
</element>
|
||||
|
||||
<element ref="blackb"><bounds x="-177.5" y="0" width="140" height="100" /></element>
|
||||
<element ref="blackb"><bounds x="142.5" y="0" width="160" height="100" /></element>
|
||||
</collection>
|
||||
|
||||
</view>
|
||||
|
|
|
@ -687,20 +687,21 @@ license:CC0-1.0
|
|||
|
||||
<!-- optional magnet position overlay -->
|
||||
<collection name="Magnet Position">
|
||||
<element name="magnetx" ref="mpos">
|
||||
<animate name="magnety" />
|
||||
<element name="pos_x" ref="mpos">
|
||||
<animate name="pos_y" />
|
||||
<bounds state="4" x="-17.5" y="84.0" width="320" height="1.25" />
|
||||
<bounds state="136" x="-17.5" y="1.5" width="320" height="1.25" />
|
||||
<color alpha="0.4" />
|
||||
</element>
|
||||
<element name="magnetx" ref="mpos">
|
||||
<animate name="magnety" />
|
||||
<element name="pos_x" ref="mpos">
|
||||
<animate name="pos_y" />
|
||||
<bounds state="4" x="-177.5" y="84.0" width="320" height="1.25" />
|
||||
<bounds state="136" x="-177.5" y="1.5" width="320" height="1.25" />
|
||||
<color alpha="0.9" />
|
||||
</element>
|
||||
|
||||
<element ref="blackb"><bounds x="-177.5" y="0" width="140" height="100" /></element>
|
||||
<element ref="blackb"><bounds x="142.5" y="0" width="160" height="100" /></element>
|
||||
</collection>
|
||||
|
||||
</view>
|
||||
|
|
|
@ -51,7 +51,7 @@ license:CC0-1.0
|
|||
<rect state="1"><color red="1.0" green="0.1" blue="0.15" /></rect>
|
||||
</element>
|
||||
|
||||
<element name="clawpos" defstate="0">
|
||||
<element name="mpos" defstate="0">
|
||||
<rect>
|
||||
<bounds x="0" y="0" width="4096" height="6.25" />
|
||||
<color alpha="0" />
|
||||
|
@ -723,20 +723,21 @@ license:CC0-1.0
|
|||
|
||||
<!-- optional claw position overlay -->
|
||||
<collection name="Claw Position">
|
||||
<element name="clawx" ref="clawpos">
|
||||
<animate name="clawy" />
|
||||
<element name="pos_x" ref="mpos">
|
||||
<animate name="pos_y" />
|
||||
<bounds state="0" x="-106.625" y="-168.625" width="819.2" height="1.25" />
|
||||
<bounds state="1500" x="-106.625" y="131.375" width="819.2" height="1.25" />
|
||||
<color alpha="0.4" />
|
||||
</element>
|
||||
<element name="clawx" ref="clawpos">
|
||||
<animate name="clawy" />
|
||||
<element name="pos_x" ref="mpos">
|
||||
<animate name="pos_y" />
|
||||
<bounds state="0" x="-516.225" y="-168.625" width="819.2" height="1.25" />
|
||||
<bounds state="1500" x="-516.225" y="131.375" width="819.2" height="1.25" />
|
||||
<color alpha="0.9" />
|
||||
</element>
|
||||
|
||||
<element ref="blackb"><bounds x="-516.225" y="-200" width="409.6" height="400" /></element>
|
||||
<element ref="blackb"><bounds x="302.975" y="-200" width="409.6" height="400" /></element>
|
||||
</collection>
|
||||
|
||||
</view>
|
||||
|
|
|
@ -64,8 +64,7 @@ public:
|
|||
m_inputs(*this, "IN.%u", 0),
|
||||
m_piece_hand(*this, "cpu_hand"),
|
||||
m_out_motor(*this, "motor%u", 0U),
|
||||
m_out_clawx(*this, "clawx"),
|
||||
m_out_clawy(*this, "clawy")
|
||||
m_out_pos(*this, "pos_%c", unsigned('x'))
|
||||
{ }
|
||||
|
||||
void robotadv(machine_config &config);
|
||||
|
@ -82,8 +81,7 @@ private:
|
|||
required_ioport_array<3> m_inputs;
|
||||
output_finder<> m_piece_hand;
|
||||
output_finder<6> m_out_motor;
|
||||
output_finder<> m_out_clawx;
|
||||
output_finder<> m_out_clawy;
|
||||
output_finder<2> m_out_pos;
|
||||
|
||||
void main_map(address_map &map);
|
||||
void io_map(address_map &map);
|
||||
|
@ -118,8 +116,7 @@ void robotadv_state::machine_start()
|
|||
// resolve outputs
|
||||
m_piece_hand.resolve();
|
||||
m_out_motor.resolve();
|
||||
m_out_clawx.resolve();
|
||||
m_out_clawy.resolve();
|
||||
m_out_pos.resolve();
|
||||
|
||||
// register for savestates
|
||||
save_item(NAME(m_control1));
|
||||
|
@ -312,8 +309,8 @@ void robotadv_state::refresh()
|
|||
|
||||
// output claw position
|
||||
const int open = (m_limits & 1) ? 0x800 : 0; // put open state on x bit 11
|
||||
m_out_clawx = int((x + 15.0) * 50.0) | open;
|
||||
m_out_clawy = int((y + 15.0) * 50.0);
|
||||
m_out_pos[0] = int((x + 15.0) * 50.0) | open;
|
||||
m_out_pos[1] = int((y + 15.0) * 50.0);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -324,7 +324,7 @@ void fortyl_state::undoukai_map(address_map &map)
|
|||
map(0xa804, 0xa804).r(m_soundlatch2, FUNC(generic_latch_8_device::read));
|
||||
map(0xa804, 0xa804).w("soundlatch", FUNC(generic_latch_8_device::write));
|
||||
map(0xa805, 0xa805).r(FUNC(fortyl_state::snd_flag_r)).nopw(); /*sound_reset*/ //????
|
||||
map(0xa807, 0xa807).nopr().nopw(); /* unknown */
|
||||
map(0xa807, 0xa807).noprw(); /* unknown */
|
||||
map(0xa808, 0xa808).portr("DSW3");
|
||||
map(0xa809, 0xa809).portr("P1");
|
||||
map(0xa80a, 0xa80a).portr("SYSTEM");
|
||||
|
|
Loading…
Reference in a new issue