Previous 199869 Revisions Next

r34813 Monday 2nd February, 2015 at 23:35:21 UTC by Couriersud
Merge branch 'master' of https://github.com/mamedev/mame.git
[hash]uzebox.xml
[src/mess/drivers]uzebox.c

trunk/hash/uzebox.xml
r243324r243325
7373      </part>
7474   </software>
7575
76   <software name="calc" supported="no">
77      <!-- required mouse emulation -->
76   <software name="calc">
7877      <description>Calculator Demo</description>
7978      <year>2010</year>
8079      <publisher>Belogic</publisher>
trunk/src/mess/drivers/uzebox.c
r243324r243325
99    TODO:
1010    - Sound
1111    - SDCard
12    - Mouse
1312
1413****************************************************************************/
1514
r243324r243325
1817#include "sound/dac.h"
1918#include "bus/generic/slot.h"
2019#include "bus/generic/carts.h"
20#include "bus/snes_ctrl/ctrl.h"
2121
2222// overclocked to 8 * NTSC burst frequency
2323#define MASTER_CLOCK 28618180
r243324r243325
3030   uzebox_state(const machine_config &mconfig, device_type type, const char *tag)
3131      : driver_device(mconfig, type, tag),
3232      m_maincpu(*this, "maincpu"),
33      m_cart(*this, "cartslot")
33      m_cart(*this, "cartslot"),
34      m_ctrl1(*this, "ctrl1"),
35      m_ctrl2(*this, "ctrl2")
3436   { }
3537
3638   required_device<avr8_device> m_maincpu;
3739   required_device<generic_slot_device> m_cart;
40   required_device<snes_control_port_device> m_ctrl1;
41   required_device<snes_control_port_device> m_ctrl2;
3842
3943   DECLARE_READ8_MEMBER(port_a_r);
4044   DECLARE_WRITE8_MEMBER(port_a_w);
r243324r243325
5963   UINT8           m_port_b;
6064   UINT8           m_port_c;
6165   UINT8           m_port_d;
62   UINT16          m_joy_data[2];
6366   bitmap_rgb32    m_bitmap;
6467};
6568
r243324r243325
8083   m_port_b = 0;
8184   m_port_c = 0;
8285   m_port_d = 0;
83   m_joy_data[0] = m_joy_data[1] = 0;
8486}
8587
8688
r243324r243325
9294   //  ---- --x-   SNES controller P2 data
9395   //  ---- ---x   SNES controller P1 data
9496
95   UINT8 changed = m_port_a ^ data;
97   m_ctrl1->write_strobe(BIT(data, 2));
98   m_ctrl2->write_strobe(BIT(data, 2));
9699
97   if (changed & data & 0x04)
100   UINT8 changed = m_port_a ^ data;
101   if ((changed & data & 0x08) || (changed & (~data) & 0x04))
98102   {
99      m_joy_data[0] = ioport("P1")->read();
100      m_joy_data[1] = ioport("P2")->read();
103      m_port_a &= ~0x03;
104      m_port_a |= m_ctrl1->read_pin4() ? 0 : 0x01;
105      m_port_a |= m_ctrl2->read_pin4() ? 0 : 0x02;
101106   }
102   else if (changed & 0x08)
103   {
104      if (changed & data & 0x08)
105      {
106         m_joy_data[0] >>= 1;
107         m_joy_data[1] >>= 1;
108      }
109107
110      m_port_a = (m_joy_data[0] & 0x01) | ((m_joy_data[1] & 0x01) << 1);
111   }
112
113108   m_port_a = (data & 0x0c) | (m_port_a & 0x03);
114109}
115110
r243324r243325
207202\****************************************************/
208203
209204static INPUT_PORTS_START( uzebox )
210   PORT_START( "P1" )
211   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P1 Button B") PORT_PLAYER(1)
212   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P1 Button Y") PORT_PLAYER(1)
213   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SELECT ) PORT_NAME("P1 Select") PORT_PLAYER(1)
214   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_START1 ) PORT_NAME("P1 Start") PORT_PLAYER(1)
215   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1)
216   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1)
217   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1)
218   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1)
219   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("P1 Button A") PORT_PLAYER(1)
220   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("P1 Button X") PORT_PLAYER(1)
221   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("P1 Button L") PORT_PLAYER(1)
222   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("P1 Button R") PORT_PLAYER(1)
223   PORT_BIT( 0xf000, IP_ACTIVE_LOW, IPT_UNUSED )
224
225   PORT_START( "P2" )
226   PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("P2 Button B") PORT_PLAYER(2)
227   PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_NAME("P2 Button Y") PORT_PLAYER(2)
228   PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SELECT ) PORT_NAME("P2 Select") PORT_PLAYER(2)
229   PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_START2 ) PORT_NAME("P2 Start")
230   PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2)
231   PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2)
232   PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2)
233   PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2)
234   PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("P2 Button A") PORT_PLAYER(2)
235   PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_NAME("P2 Button X") PORT_PLAYER(2)
236   PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_NAME("P2 Button L") PORT_PLAYER(2)
237   PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_BUTTON6 ) PORT_NAME("P2 Button R") PORT_PLAYER(2)
238   PORT_BIT( 0xf000, IP_ACTIVE_LOW, IPT_UNUSED )
239
240205   PORT_START("AD725_CE")
241206   PORT_CONFNAME( 0x01, 0x00, "AD725 CE" )
242207   PORT_CONFSETTING( 0x00, "VCC" )
r243324r243325
324289   MCFG_GENERIC_MANDATORY
325290   MCFG_GENERIC_LOAD(uzebox_state, uzebox_cart)
326291
292   MCFG_SNES_CONTROL_PORT_ADD("ctrl1", snes_control_port_devices, "joypad")
293   MCFG_SNES_CONTROL_PORT_ADD("ctrl2", snes_control_port_devices, "joypad")
294
327295   MCFG_SOFTWARE_LIST_ADD("eprom_list","uzebox")
328296MACHINE_CONFIG_END
329297


Previous 199869 Revisions Next


© 1997-2024 The MAME Team