Previous 199869 Revisions Next

r30771 Monday 2nd June, 2014 at 07:01:58 UTC by Osso
hec2hrp.c converted to ioport_array (nw)
[src/mess/drivers]hec2hrp.c
[src/mess/includes]hec2hrp.h
[src/mess/machine]hec2hrp.c

trunk/src/mess/drivers/hec2hrp.c
r30770r30771
197197/* Input ports */
198198static INPUT_PORTS_START( hec2hrp )
199199   /* keyboard input */
200   PORT_START("KEY0") /* [0] - port 3000 @ 0 */
200   PORT_START("KEY.0") /* [0] - port 3000 @ 0 */
201201      PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_BACKSLASH)    PORT_CHAR('\\') PORT_CHAR('|')
202202      PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Space")          PORT_CODE(KEYCODE_SPACE)
203203      PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Return")         PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13)
r30770r30771
206206      PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Caps Lock")      PORT_CODE(KEYCODE_CAPSLOCK)
207207      PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Ctrl")           PORT_CODE(KEYCODE_LCONTROL)   PORT_CHAR(UCHAR_MAMEKEY(LCONTROL))
208208      PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Shift")          PORT_CODE(KEYCODE_LSHIFT)     PORT_CODE(KEYCODE_RSHIFT) PORT_CHAR(UCHAR_SHIFT_1)
209   PORT_START("KEY1") /* [1] - port 3000 @ 1 */    /* touches => 2  1  0  /  .  -  ,  +     */
209   PORT_START("KEY.1") /* [1] - port 3000 @ 1 */    /* touches => 2  1  0  /  .  -  ,  +     */
210210      PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("2 \"")           PORT_CODE(KEYCODE_2)    PORT_CHAR('2')
211211      PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("1 >")            PORT_CODE(KEYCODE_1)    PORT_CHAR('1')
212212      PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("0 <")            PORT_CODE(KEYCODE_0)    PORT_CHAR('0')
r30770r30771
216216      PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_M)
217217      PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_EQUALS)   PORT_CHAR('=') PORT_CHAR('+')
218218
219   PORT_START("KEY2") /* [1] - port 3000 @ 2 */     /* touches => .. 9  8  7  6  5  4  3  */
219   PORT_START("KEY.2") /* [1] - port 3000 @ 2 */     /* touches => .. 9  8  7  6  5  4  3  */
220220      PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_UNUSED)
221221      PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("9 )")            PORT_CODE(KEYCODE_9)    PORT_CHAR('9')
222222      PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("8 (")            PORT_CODE(KEYCODE_8)    PORT_CHAR('8')
r30770r30771
225225      PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("5 %")            PORT_CODE(KEYCODE_5)    PORT_CHAR('5')
226226      PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("4 $")            PORT_CODE(KEYCODE_4)    PORT_CHAR('4')
227227      PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("3 /")            PORT_CODE(KEYCODE_3)    PORT_CHAR('3')
228   PORT_START("KEY3") /* [1] - port 3000 @ 3 */    /* touches =>  B  A  ..  ? .. =   ..  ;       */
228   PORT_START("KEY.3") /* [1] - port 3000 @ 3 */    /* touches =>  B  A  ..  ? .. =   ..  ;       */
229229      PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_B)     PORT_CHAR('B')
230230      PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("A")           PORT_CODE(KEYCODE_Q)   PORT_CHAR('Q')
231231      PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_UNUSED)
r30770r30771
234234      PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_CLOSEBRACE)   PORT_CHAR(']') PORT_CHAR('}')
235235      PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNUSED)
236236      PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_SLASH)       PORT_CHAR('/') PORT_CHAR('?')
237   PORT_START("KEY4") /* [1] - port 3000 @ 4 */
237   PORT_START("KEY.4") /* [1] - port 3000 @ 4 */
238238      PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_J)            PORT_CHAR('J')
239239      PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_I)            PORT_CHAR('I')
240240      PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_H)            PORT_CHAR('H')
r30770r30771
244244      PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_C)            PORT_CHAR('C')
245245      PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_D)            PORT_CHAR('D')
246246
247   PORT_START("KEY5") /* [1] - port 3000 @ 5 */
247   PORT_START("KEY.5") /* [1] - port 3000 @ 5 */
248248      PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_R)            PORT_CHAR('R')
249249      PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Q")         PORT_CODE(KEYCODE_A)         PORT_CHAR('A')
250250      PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_P)            PORT_CHAR('P')
r30770r30771
254254      PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_L)            PORT_CHAR('L')
255255      PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_K)            PORT_CHAR('K')
256256
257   PORT_START("KEY6") /* [1] - port 3000 @ 6 */
257   PORT_START("KEY.6") /* [1] - port 3000 @ 6 */
258258      PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Z")          PORT_CODE(KEYCODE_W)            PORT_CHAR('W')
259259      PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_Y)            PORT_CHAR('Y')
260260      PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("X")          PORT_CODE(KEYCODE_X)            PORT_CHAR('X')
r30770r30771
264264      PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_T)            PORT_CHAR('T')
265265      PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_S)            PORT_CHAR('S')
266266
267   PORT_START("KEY7") /* [1] - port 3000 @ 7  JOYSTICK */
267   PORT_START("KEY.7") /* [1] - port 3000 @ 7  JOYSTICK */
268268      PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Joy(0) LEFT")        PORT_CODE(KEYCODE_LEFT)     PORT_CHAR(UCHAR_MAMEKEY(LEFT))
269269      PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Joy(0) RIGHT")       PORT_CODE(KEYCODE_RIGHT)    PORT_CHAR(UCHAR_MAMEKEY(RIGHT))
270270      PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Joy(0) UP")          PORT_CODE(KEYCODE_UP)       PORT_CHAR(UCHAR_MAMEKEY(UP))
r30770r30771
274274      PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Joy(1) UP")          PORT_CODE(KEYCODE_5_PAD)
275275      PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Joy(1) DOWN")        PORT_CODE(KEYCODE_2_PAD)
276276
277   PORT_START("KEY8") /* [1] - port 3000 @ 8  not for the real machine, but to emulate the analog signal of the joystick */
277   PORT_START("KEY.8") /* [1] - port 3000 @ 8  not for the real machine, but to emulate the analog signal of the joystick */
278278      PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("RESET")             PORT_CODE(KEYCODE_ESC)      PORT_CHAR(27)
279279      PORT_BIT(0x02, IP_ACTIVE_LOW,  IPT_KEYBOARD) PORT_NAME("Joy(0) FIRE")       PORT_CODE(KEYCODE_TILDE)
280280      PORT_BIT(0x04, IP_ACTIVE_LOW,  IPT_KEYBOARD) PORT_NAME("Joy(1) FIRE")       PORT_CODE(KEYCODE_PLUS_PAD)
trunk/src/mess/machine/hec2hrp.c
r30770r30771
231231{
232232   UINT8 data = 0xff;
233233
234   static const char *const keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4", "KEY5", "KEY6", "KEY7", "KEY8" };
235
236234   if (offset ==7) /* Only when joy reading*/
237235   {
238236      /* Read special key for analog joystick emulation only (button and pot are analog signal!) and the reset */
239      data=ioport(keynames[8])->read();
237      data=m_keyboard[8]->read();
240238
241239      if (data & 0x01) /* Reset machine ! (on ESC key)*/
242240      {
r30770r30771
294292   }
295293
296294   /* in all case return the request value*/
297   return ioport(keynames[offset])->read();
295   return m_keyboard[offset]->read();
298296}
299297
300298WRITE8_MEMBER(hec2hrp_state::hector_sn_2000_w)
trunk/src/mess/includes/hec2hrp.h
r30770r30771
7474public:
7575   hec2hrp_state(const machine_config &mconfig, device_type type, const char *tag)
7676      : driver_device(mconfig, type, tag),
77      m_videoram(*this,"videoram"),
78      m_hector_videoram(*this,"hector_videoram") ,
7977      m_maincpu(*this, "maincpu"),
8078      m_disc2cpu(*this, "disc2cpu"),
8179      m_cassette(*this, "cassette"),
8280      m_sn(*this, "sn76477"),
83      m_palette(*this, "palette")  { }
81      m_palette(*this, "palette"),
82      m_videoram(*this,"videoram"),
83      m_hector_videoram(*this,"hector_videoram") ,
84      m_keyboard(*this, "KEY") { }
8485
86   required_device<cpu_device> m_maincpu;
87   optional_device<cpu_device> m_disc2cpu;
88   required_device<cassette_image_device> m_cassette;
89   required_device<sn76477_device> m_sn;
90   required_device<palette_device> m_palette;
8591   optional_shared_ptr<UINT8> m_videoram;
8692   optional_shared_ptr<UINT8> m_hector_videoram;
93   required_ioport_array<9> m_keyboard;
94   
8795   UINT8 m_hector_flag_hr;
8896   UINT8 m_hector_flag_80c;
8997   UINT8 m_hector_color[4];
r30770r30771
148156
149157   DECLARE_WRITE_LINE_MEMBER( disc2_fdc_interrupt );
150158   DECLARE_WRITE_LINE_MEMBER( disc2_fdc_dma_irq );
151   required_device<cpu_device> m_maincpu;
152   optional_device<cpu_device> m_disc2cpu;
153   required_device<cassette_image_device> m_cassette;
154   required_device<sn76477_device> m_sn;
155   required_device<palette_device> m_palette;
156159   int isHectorWithDisc2();
157160   int isHectorWithMiniDisc();
158161   int isHectorHR();

Previous 199869 Revisions Next


© 1997-2024 The MAME Team