Previous 199869 Revisions Next

r20558 Sunday 27th January, 2013 at 22:26:27 UTC by David Haywood
thinking about it these must be hashlookups too, we were converting the param to a char* string and passing it to ioport()
[src/mame/drivers]alg.c arcadia.c cd32.c mquake.c
[src/mame/includes]amiga.h cd32.h
[src/mame/machine]amiga.c
[src/mess/drivers]amiga.c

trunk/src/mess/drivers/amiga.c
r20557r20558
294294   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
295295
296296   PORT_START("JOY0DAT")
297   PORT_BIT( 0x0303, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, amiga_state,amiga_joystick_convert, "P1JOY")
297   PORT_BIT( 0x0303, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, amiga_state,amiga_joystick_convert, 0)
298298   PORT_BIT( 0xfcfc, IP_ACTIVE_HIGH, IPT_UNUSED )
299299
300300   PORT_START("JOY1DAT")
301   PORT_BIT( 0x0303, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, amiga_state,amiga_joystick_convert, "P2JOY")
301   PORT_BIT( 0x0303, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, amiga_state,amiga_joystick_convert, 1)
302302   PORT_BIT( 0xfcfc, IP_ACTIVE_HIGH, IPT_UNUSED )
303303
304304   PORT_START("POTGO")
trunk/src/mame/drivers/arcadia.c
r20557r20558
244244   PORT_BIT( 0xc0, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, arcadia_amiga_state,coin_counter_r, 1)
245245
246246   PORT_START("JOY0DAT")
247   PORT_BIT( 0x0303, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, arcadia_amiga_state,amiga_joystick_convert, "P1JOY")
247   PORT_BIT( 0x0303, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, arcadia_amiga_state,amiga_joystick_convert, 0)
248248   PORT_BIT( 0xfcfc, IP_ACTIVE_HIGH, IPT_UNUSED )
249249
250250   PORT_START("JOY1DAT")
251   PORT_BIT( 0x0303, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, arcadia_amiga_state,amiga_joystick_convert, "P2JOY")
251   PORT_BIT( 0x0303, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, arcadia_amiga_state,amiga_joystick_convert, 1)
252252   PORT_BIT( 0xfcfc, IP_ACTIVE_HIGH, IPT_UNUSED )
253253
254254   PORT_START("POTGO")
trunk/src/mame/drivers/cd32.c
r20557r20558
3333#include "machine/6526cia.h"
3434#include "machine/i2cmem.h"
3535#include "includes/cd32.h"
36#include "sound/cdda.h"
3736#include "imagedev/chd_cd.h"
3837#include "machine/amigafdc.h"
3938
r20557r20558
8584
8685WRITE8_MEMBER(cd32_state::cd32_cia_0_porta_w)
8786{
88   device_t *device = machine().device("cia_0");
8987   /* bit 1 = cd audio mute */
90   machine().device<cdda_device>("cdda")->set_output_gain( 0, ( data & 1 ) ? 0.0 : 1.0 );
88   m_cdda->set_output_gain( 0, ( data & 1 ) ? 0.0 : 1.0 );
9189
9290   /* bit 2 = Power Led on Amiga */
9391   set_led_status(machine(), 0, (data & 2) ? 0 : 1);
9492
95   handle_cd32_joystick_cia(machine(), data, mos6526_r(device, space, 2));
93   handle_cd32_joystick_cia(machine(), data, mos6526_r(m_cia_0, space, 2));
9694}
9795
9896/*************************************
r20557r20558
239237
240238CUSTOM_INPUT_MEMBER(cd32_state::cd32_sel_mirror_input)
241239{
242   UINT8 bits = ioport((const char *)param)->read();
240   ioport_port* ports[2]= { m_p1_port, m_p2_port };
241   UINT8 bits = ports[(int)param]->read();
243242   return (bits & 0x20)>>5;
244243}
245244
r20557r20558
249248   PORT_START("CIA0PORTA")
250249   PORT_BIT( 0x3f, IP_ACTIVE_LOW, IPT_SPECIAL )
251250   /* this is the regular port for reading a single button joystick on the Amiga, many CD32 games require this to mirror the pad start button! */
252   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, cd32_state,cd32_sel_mirror_input, "P2")
253   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, cd32_state,cd32_sel_mirror_input, "P1")
251   PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, cd32_state,cd32_sel_mirror_input, 1)
252   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, cd32_state,cd32_sel_mirror_input, 0)
254253
255254   PORT_START("CIA0PORTB")
256255   PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNKNOWN )
257256
258257   PORT_START("JOY0DAT")
259   PORT_BIT( 0x0303, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, cd32_state,amiga_joystick_convert, "P2JOY")
258   PORT_BIT( 0x0303, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, cd32_state,amiga_joystick_convert, 1)
260259   PORT_BIT( 0xfcfc, IP_ACTIVE_HIGH, IPT_UNUSED )
261260
262261   PORT_START("JOY1DAT")
263   PORT_BIT( 0x0303, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, cd32_state,amiga_joystick_convert, "P1JOY")
262   PORT_BIT( 0x0303, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, cd32_state,amiga_joystick_convert, 0)
264263   PORT_BIT( 0xfcfc, IP_ACTIVE_HIGH, IPT_UNUSED )
265264
266265   PORT_START("POTGO")
trunk/src/mame/drivers/alg.c
r20557r20558
333333
334334static INPUT_PORTS_START( alg )
335335   PORT_START("JOY0DAT")   /* read by Amiga core */
336   PORT_BIT( 0x0303, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, alg_state,amiga_joystick_convert, "P1JOY")
336   PORT_BIT( 0x0303, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, alg_state,amiga_joystick_convert, 0)
337337   PORT_BIT( 0xfcfc, IP_ACTIVE_HIGH, IPT_UNKNOWN )
338338
339339   PORT_START("JOY1DAT")   /* read by Amiga core */
340   PORT_BIT( 0x0303, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, alg_state,amiga_joystick_convert, "P2JOY")
340   PORT_BIT( 0x0303, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, alg_state,amiga_joystick_convert, 1)
341341   PORT_BIT( 0xfcfc, IP_ACTIVE_HIGH, IPT_UNKNOWN )
342342
343343   PORT_START("POTGO")     /* read by Amiga core */
trunk/src/mame/drivers/mquake.c
r20557r20558
164164   PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)         /* JS1SW */
165165
166166   PORT_START("JOY0DAT")
167   PORT_BIT( 0x0303, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, amiga_state,amiga_joystick_convert, "P1JOY")
167   PORT_BIT( 0x0303, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, amiga_state,amiga_joystick_convert, 0)
168168   PORT_BIT( 0xfcfc, IP_ACTIVE_HIGH, IPT_UNKNOWN )
169169
170170   PORT_START("JOY1DAT")
171   PORT_BIT( 0x0303, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, amiga_state,amiga_joystick_convert, "P2JOY")
171   PORT_BIT( 0x0303, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, amiga_state,amiga_joystick_convert, 1)
172172   PORT_BIT( 0xfcfc, IP_ACTIVE_HIGH, IPT_UNKNOWN )
173173
174174   PORT_START("P1JOY")
trunk/src/mame/machine/amiga.c
r20557r20558
411411
412412CUSTOM_INPUT_MEMBER( amiga_state::amiga_joystick_convert )
413413{
414   UINT8 bits = ioport((const char *)param)->read();
414   ioport_port* ports[2] = { m_p1joy_port, m_p2joy_port };
415   UINT8 bits;
416   if (ports[(int)param]) bits = ports[(int)param]->read();
417   else bits = 0xff;
418
415419   int up = (bits >> 0) & 1;
416420   int down = (bits >> 1) & 1;
417421   int left = (bits >> 2) & 1;
trunk/src/mame/includes/cd32.h
r20557r20558
99
1010#include "includes/amiga.h"
1111#include "machine/microtch.h"
12#include "sound/cdda.h"
1213
1314class cd32_state : public amiga_state
1415{
r20557r20558
1718      : amiga_state(mconfig, type, tag),
1819         m_microtouch(*this, "microtouch"),
1920         m_p1_port(*this, "P1"),
20         m_p2_port(*this, "P2")
21
21         m_p2_port(*this, "P2"),
22         m_cdda(*this, "cdda")
2223   {
2324   }
2425
2526   required_device<microtouch_device> m_microtouch;
2627   optional_ioport m_p1_port;
2728   optional_ioport m_p2_port;
29   required_device<cdda_device> m_cdda;
2830
2931   DECLARE_WRITE8_MEMBER(microtouch_tx);
3032   UINT16 m_potgo_value;
trunk/src/mame/includes/amiga.h
r20557r20558
385385         m_joy1dat_port(*this, "JOY1DAT"),
386386         m_potgo_port(*this, "POTGO"),
387387         m_pot0dat_port(*this, "POT0DAT"),
388         m_pot1dat_port(*this, "POT1DAT")
388         m_pot1dat_port(*this, "POT1DAT"),
389         m_p1joy_port(*this, "P1JOY"),
390         m_p2joy_port(*this, "P2JOY")
391
389392   { }
390393
391394   required_device<cpu_device> m_maincpu;
r20557r20558
402405   optional_ioport m_potgo_port;
403406   optional_ioport m_pot0dat_port;
404407   optional_ioport m_pot1dat_port;
408   optional_ioport m_p1joy_port;
409   optional_ioport m_p2joy_port;
405410
406411   
407412

Previous 199869 Revisions Next


© 1997-2024 The MAME Team