Previous 15994 Revisions Next

r12653 Wednesday 17th August, 2011 at 17:26:09 UTC by Fabio Priuli
[NES] Attached emulated keyboards (Famicom and Subor) directly to famicom driver now
that keyboard emulation does not affect the emulation if only gamepad are attached to the
system. Removed accordingly the fami_key driver, which became redundant. [Fabio Priuli]
[src/mess]mess.lst
[src/mess/drivers]nes.c

src/mess/mess.lst
r12652r12653
5858nespal   // Nintendo Entertainment System PAL
5959m82       // Nintendo M82 Display Unit
6060famicom   // Nintendo Family Computer (a.k.a. Famicom) + Disk System add-on
61fami_key  // Nintendo Family Computer (a.k.a. Famicom) + Disk System add-on + Keyboard add-on
6261famitwin  // Sharp Famicom Twin System
6362drpcjr    // Bung Doctor PC Jr
6463dendy     // Dendy (Classic russian famiclone)
src/mess/drivers/nes.c
r12652r12653
5656
5757
5858static INPUT_PORTS_START( nes_controllers )
59   PORT_START("CTRLSEL")  /* Select Controller Type */
60   PORT_CONFNAME( 0x000f, 0x0001, "P1 Controller")
61   PORT_CONFSETTING(  0x0000, "Unconnected" )
62   PORT_CONFSETTING(  0x0001, "Gamepad" )
63   PORT_CONFSETTING(  0x0002, "Zapper" )
64   PORT_CONFSETTING(  0x0006, "Crazy Climber pad" )
65   PORT_CONFNAME( 0x00f0, 0x0010, "P2 Controller")
66   PORT_CONFSETTING(  0x0000, "Unconnected" )
67   PORT_CONFSETTING(  0x0010, "Gamepad" )
68   PORT_CONFSETTING(  0x0030, "Zapper" )
69   PORT_CONFSETTING(  0x0040, "Arkanoid paddle" )
70//  PORT_CONFSETTING(  0x0050, "Family Trainer" )
71   PORT_CONFNAME( 0x0f00, 0x0000, "P3 Controller")
72   PORT_CONFSETTING(  0x0000, "Unconnected" )
73   PORT_CONFSETTING(  0x0100, "Gamepad" )
74   PORT_CONFNAME( 0xf000, 0x0000, "P4 Controller")
75   PORT_CONFSETTING(  0x0000, "Unconnected" )
76   PORT_CONFSETTING(  0x1000, "Gamepad" )
77
7859   PORT_START("PAD1")   /* Joypad 1 */
7960   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("P1 A") PORT_PLAYER(1)   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0001)
8061   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("P1 B") PORT_PLAYER(1)   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0001)
r12652r12653
154135
155136INPUT_PORTS_END
156137
157static INPUT_PORTS_START( nes )
158   PORT_INCLUDE( nes_controllers )
159
160   PORT_START("CONFIG")  /* configuration */
161   PORT_CONFNAME( 0x01, 0x00, "Draw Top/Bottom 8 Lines")
162   PORT_CONFSETTING(    0x01, DEF_STR(No) )
163   PORT_CONFSETTING(    0x00, DEF_STR(Yes) )
164   PORT_CONFNAME( 0x02, 0x00, "Enforce 8 Sprites/line")
165   PORT_CONFSETTING(    0x02, DEF_STR(No) )
166   PORT_CONFSETTING(    0x00, DEF_STR(Yes) )
167INPUT_PORTS_END
168
169static INPUT_PORTS_START( famicom )
170   PORT_INCLUDE( nes_controllers )
171
172   PORT_START("FLIPDISK") /* fake keys */
173   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON3) PORT_NAME("Change Disk Side")
174INPUT_PORTS_END
175
176138static INPUT_PORTS_START( fc_keyboard )
177139   PORT_START("FCKEY0")
178140   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F8) PORT_CHAR(UCHAR_MAMEKEY(F8))   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0008)
r12652r12653
335297   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F4) PORT_CHAR(UCHAR_MAMEKEY(F4))   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
336298   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_U)   PORT_CHAR('U')   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
337299   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8)   PORT_CHAR('8')   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
338   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_J)   PORT_CHAR('J')
300   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_J)   PORT_CHAR('J')   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
339301
340302   PORT_START("SUBKEY7")
341303   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_MINUS)   PORT_CHAR('-')   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
r12652r12653
361323   PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_UNUSED ) PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
362324
363325   PORT_START("SUBKEY10")
364   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("LMENU")
326   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("LMENU")   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
365327   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4_PAD)   PORT_CHAR(UCHAR_MAMEKEY(4_PAD))   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
366328   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7_PAD)   PORT_CHAR(UCHAR_MAMEKEY(7_PAD))   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
367329   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F11)      PORT_CHAR(UCHAR_MAMEKEY(F11))   PORT_CONDITION("CTRLSEL", 0x000f, PORTCOND_EQUALS, 0x0009)
r12652r12653
392354
393355INPUT_PORTS_END
394356
395static INPUT_PORTS_START( famikey )
396   PORT_INCLUDE( famicom )
357static INPUT_PORTS_START( nes )
358   PORT_INCLUDE( nes_controllers )
359
360   PORT_START("CTRLSEL")  /* Select Controller Type */
361   PORT_CONFNAME( 0x000f, 0x0001, "P1 Controller")
362   PORT_CONFSETTING(  0x0000, "Unconnected" )
363   PORT_CONFSETTING(  0x0001, "Gamepad" )
364   PORT_CONFSETTING(  0x0002, "Zapper" )
365   PORT_CONFSETTING(  0x0006, "Crazy Climber pad" )
366   PORT_CONFNAME( 0x00f0, 0x0010, "P2 Controller")
367   PORT_CONFSETTING(  0x0000, "Unconnected" )
368   PORT_CONFSETTING(  0x0010, "Gamepad" )
369   PORT_CONFSETTING(  0x0030, "Zapper" )
370   PORT_CONFSETTING(  0x0040, "Arkanoid paddle" )
371//  PORT_CONFSETTING(  0x0050, "Family Trainer" )
372   PORT_CONFNAME( 0x0f00, 0x0000, "P3 Controller")
373   PORT_CONFSETTING(  0x0000, "Unconnected" )
374   PORT_CONFSETTING(  0x0100, "Gamepad" )
375   PORT_CONFNAME( 0xf000, 0x0000, "P4 Controller")
376   PORT_CONFSETTING(  0x0000, "Unconnected" )
377   PORT_CONFSETTING(  0x1000, "Gamepad" )
378
379   PORT_START("CONFIG")  /* configuration */
380   PORT_CONFNAME( 0x01, 0x00, "Draw Top/Bottom 8 Lines")
381   PORT_CONFSETTING(    0x01, DEF_STR(No) )
382   PORT_CONFSETTING(    0x00, DEF_STR(Yes) )
383   PORT_CONFNAME( 0x02, 0x00, "Enforce 8 Sprites/line")
384   PORT_CONFSETTING(    0x02, DEF_STR(No) )
385   PORT_CONFSETTING(    0x00, DEF_STR(Yes) )
386INPUT_PORTS_END
387
388static INPUT_PORTS_START( famicom )
389   PORT_INCLUDE( nes )
397390   PORT_INCLUDE( fc_keyboard )
398391   PORT_INCLUDE( subor_keyboard )
399392
r12652r12653
406399   PORT_CONFSETTING(  0x0008, "FC Keyboard" )
407400   PORT_CONFSETTING(  0x0009, "Subor Keyboard" )
408401
402   PORT_START("FLIPDISK") /* fake keys */
403   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON3) PORT_NAME("Change Disk Side")
409404INPUT_PORTS_END
410405
406
411407#ifdef UNUSED_FUNCTION
412408/* This layout is not changed at runtime */
413409gfx_layout nes_vram_charlayout =
r12652r12653
576572   ROM_REGION( 0x800,   "gfx3", ROMREGION_ERASE00 )  /* CI RAM */
577573ROM_END
578574
579#define rom_fami_key rom_famicom
580
581575ROM_START( famitwin )
582576   ROM_REGION( 0x10000, "maincpu", 0 )  /* Main RAM + program banks */
583577   ROM_LOAD_OPTIONAL( "disksyst.rom", 0xe000, 0x2000, CRC(4df24a6c) SHA1(e4e41472c454f928e53eb10e0509bf7d1146ecc1) )
r12652r12653
629623CONS( 1985, nes,       0,      0,     nes,      nes,     0,       "Nintendo",  "Nintendo Entertainment System / Famicom (NTSC)", GAME_IMPERFECT_GRAPHICS )
630624CONS( 1987, nespal,    nes,    0,     nespal,   nes,     0,       "Nintendo",  "Nintendo Entertainment System (PAL)", GAME_IMPERFECT_GRAPHICS )
631625CONS( 1983, famicom,   nes,    0,     famicom,  famicom, famicom, "Nintendo",  "Famicom (w/ Disk System add-on)", GAME_IMPERFECT_GRAPHICS )
632CONS( 1983, fami_key,  nes,    0,     famicom,  famikey, famicom, "Nintendo",  "Famicom (w/ Disk System add-on + Keyboard add-on)", GAME_IMPERFECT_GRAPHICS )
633626CONS( 1986, famitwin,  nes,    0,     famicom,  famicom, famicom, "Sharp",     "Famicom Twin", GAME_IMPERFECT_GRAPHICS )
634627CONS( 198?, m82,       nes,    0,     nes,      nes,     0,       "Nintendo",  "M82 Display Unit", GAME_IMPERFECT_GRAPHICS | GAME_NOT_WORKING )
635628CONS( 1996, drpcjr,    nes,    0,     famicom,  famicom, famicom, "Bung",      "Doctor PC Jr", GAME_IMPERFECT_GRAPHICS )

Previous 15994 Revisions Next


© 1998-2018 The MESS Team