diff -Nru base0125/src/emu/inptport.c w0125/src/emu/inptport.c
--- base0125/src/emu/inptport.c	2008-05-05 02:23:41.000000000 +1200
+++ w0125/src/emu/inptport.c	2008-05-05 22:41:10.000000000 +1200
@@ -2766,8 +2766,10 @@
 profiler_mark(PROFILER_INPUT);
 
 	/* record/playback information about the current frame */
-	playback_frame(machine, curtime);
-	record_frame(machine, curtime);
+	if(machine->playback_file)  // avoid re-recording - coz that's cheating. ;)
+		playback_frame(machine, curtime);
+	else
+		record_frame(machine, curtime);
 
 	/* track the duration of the previous frame */
 	last_delta = attotime_to_attoseconds(attotime_sub(curtime, last_update)) / ATTOSECONDS_PER_SECOND_SQRT;
@@ -3638,6 +3640,9 @@
 	if (filename[0] == 0)
 		return;
 
+	/* disable cheats */
+	options_set_bool(mame_options(),OPTION_CHEAT,0,OPTION_PRIORITY_MAXIMUM);
+
 	/* open the record file  */
 	filerr = mame_fopen(SEARCHPATH_INPUTLOG, filename, OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS, &machine->record_file);
 	assert_always(filerr == FILERR_NONE, "Failed to open file for recording");
diff -Nru base0125/src/emu/ui.c w0125/src/emu/ui.c
--- base0125/src/emu/ui.c	2008-05-04 05:56:41.000000000 +1200
+++ w0125/src/emu/ui.c	2008-05-05 22:41:10.000000000 +1200
@@ -316,7 +316,7 @@
 	int state;
 
 	/* disable everything if we are using -str */
-	if (!first_time || (str > 0 && str < 60*5) || machine->gamedrv == &driver_empty)
+	if (!first_time || (str > 0 && str < 60*5) || machine->gamedrv == &driver_empty || machine->record_file)
 		show_gameinfo = show_warnings = show_disclaimer = FALSE;
 
 	/* initialize the on-screen display system */
@@ -1273,7 +1273,7 @@
 		mame_schedule_soft_reset(machine);
 
 	/* handle a request to display graphics/palette */
-	if (input_ui_pressed(IPT_UI_SHOW_GFX))
+	if (input_ui_pressed(IPT_UI_SHOW_GFX) && !machine->record_file)
 	{
 		if (!is_paused)
 			mame_pause(machine, TRUE);
@@ -1281,14 +1281,14 @@
 	}
 
 	/* handle a save state request */
-	if (input_ui_pressed(IPT_UI_SAVE_STATE))
+	if (input_ui_pressed(IPT_UI_SAVE_STATE) && !machine->record_file)
 	{
 		mame_pause(machine, TRUE);
 		return ui_set_handler(handler_load_save, LOADSAVE_SAVE);
 	}
 
 	/* handle a load state request */
-	if (input_ui_pressed(IPT_UI_LOAD_STATE))
+	if (input_ui_pressed(IPT_UI_LOAD_STATE) && !machine->record_file)
 	{
 		mame_pause(machine, TRUE);
 		return ui_set_handler(handler_load_save, LOADSAVE_LOAD);
@@ -1299,7 +1299,7 @@
 		video_save_active_screen_snapshots(machine);
 
 	/* toggle pause */
-	if (input_ui_pressed(IPT_UI_PAUSE))
+	if (input_ui_pressed(IPT_UI_PAUSE) && !machine->record_file)
 	{
 		/* with a shift key, it is single step */
 		if (is_paused && (input_code_pressed(KEYCODE_LSHIFT) || input_code_pressed(KEYCODE_RSHIFT)))
@@ -1365,11 +1365,11 @@
 	}
 
 	/* toggle throttle? */
-	if (input_ui_pressed(IPT_UI_THROTTLE))
+	if (input_ui_pressed(IPT_UI_THROTTLE) && !machine->record_file)
 		video_set_throttle(!video_get_throttle());
 
 	/* check for fast forward */
-	if (input_port_type_pressed(IPT_UI_FAST_FORWARD, 0))
+	if (input_port_type_pressed(IPT_UI_FAST_FORWARD, 0) && !machine->record_file)
 	{
 		video_set_fastforward(TRUE);
 		ui_show_fps_temp(0.5);
diff -Nru base0125/src/emu/uimenu.c w0125/src/emu/uimenu.c
--- base0125/src/emu/uimenu.c	2008-05-02 02:12:20.000000000 +1200
+++ w0125/src/emu/uimenu.c	2008-05-05 22:41:10.000000000 +1200
@@ -634,7 +634,7 @@
 		*selected = num_items - 1;
 
 	/* pause enables/disables pause */
-	if (input_ui_pressed(IPT_UI_PAUSE))
+	if (input_ui_pressed(IPT_UI_PAUSE) && !Machine->record_file)
 		mame_pause(Machine, !mame_is_paused(Machine));
 
 	return 0;
diff -Nru base0125/src/version.c w0125/src/version.c
--- base0125/src/version.c	2008-05-05 19:10:47.000000000 +1200
+++ w0125/src/version.c	2008-05-05 22:42:27.000000000 +1200
@@ -9,4 +9,4 @@
 
 ***************************************************************************/
 
-const char build_version[] = "0.125 ("__DATE__")";
+const char build_version[] = "0.125 [W] ("__DATE__")";
diff -Nru base0113s/src/emu/info.c w0113/src/emu/info.c
--- base0113s/src/emu/info.c	2007-02-12 16:43:00.000000000 +1300
+++ w0113/src/emu/info.c	2007-03-06 10:40:09.000000000 +1300
@@ -39,21 +39,28 @@
 
 static void print_game_switches(FILE *out, const game_driver *game, const input_port_entry *input)
 {
+	int port = -1;
 	/* iterate over input entries until we run out */
 	while (input->type != IPT_END)
 	{
+		if (input->start.tag != NULL)
+			port++;
 		/* once we hit a name entry, start outputting */
 		if (input->type == IPT_DIPSWITCH_NAME)
 		{
 			int def = input->default_value;
 
 			/* output the switch name information */
-			fprintf(out, "\t\t<dipswitch name=\"%s\">\n", xml_normalize_string(input->name));
+			fprintf(out, "\t\t<dipswitch");
+			fprintf(out, " mask=\"%i\"", input->mask);
+			fprintf(out, " port=\"%i\"", port);
+			fprintf(out, " name=\"%s\">\n", xml_normalize_string(input->name));
 
 			/* loop over settings */
 			for (input++; input->type == IPT_DIPSWITCH_SETTING; input++)
 			{
 				fprintf(out, "\t\t\t<dipvalue name=\"%s\"", xml_normalize_string(input->name));
+				fprintf(out, " value=\"%i\"", input->default_value);
 				if (def == input->default_value)
 					fprintf(out, " default=\"yes\"");
 				fprintf(out, "/>\n");
diff -Nru base0125/src/emu/emu.mak w0125/src/emu/emu.mak
--- base0125/src/emu/emu.mak	2008-04-21 12:00:55.000000000 +1200
+++ w0125/src/emu/emu.mak	2008-05-05 23:23:34.000000000 +1200
@@ -78,7 +78,8 @@
 	$(EMUOBJ)/uimenu.o \
 	$(EMUOBJ)/validity.o \
 	$(EMUOBJ)/video.o \
-	$(EMUOBJ)/watchdog.o
+	$(EMUOBJ)/watchdog.o \
+	$(EMUOBJ)/inpview.o
 
 ifdef PROFILER
 EMUOBJS += \
diff -Nru base0125/src/emu/emuopts.c w0125/src/emu/emuopts.c
--- base0125/src/emu/emuopts.c	2008-04-21 12:05:54.000000000 +1200
+++ w0125/src/emu/emuopts.c	2008-05-05 23:21:51.000000000 +1200
@@ -157,6 +157,8 @@
 	{ "bios",                        NULL,        0,                 "select the system BIOS to use" },
 	{ "cheat;c",                     "0",         OPTION_BOOLEAN,    "enable cheat subsystem" },
 	{ "skip_gameinfo",               "0",         OPTION_BOOLEAN,    "skip displaying the information screen at startup" },
+	{ "inpview;iv",		             "0",         0,                 "enable input viewer" },
+	{ "inplayout;il",                "standard",  0,                 "set input viewer layout type" },
 
 	{ NULL }
 };
diff -Nru base0125/src/emu/inptport.c w0125/src/emu/inptport.c
--- base0125/src/emu/inptport.c	2008-05-05 02:23:41.000000000 +1200
+++ w0125/src/emu/inptport.c	2008-05-06 00:44:02.000000000 +1200
@@ -106,6 +106,7 @@
 #include "inputx.h"
 #endif
 
+#include "inpview.h"
 
 /***************************************************************************
     CONSTANTS
@@ -1142,6 +1143,9 @@
 	/* register callbacks for when we load configurations */
 	config_register("input", input_port_load, input_port_save);
 
+	/* INPVIEW: initialise -inpview and -inplayout options */
+	inpview_set_data(options_get_int(mame_options(),"inpview"),options_get_string(mame_options(),"inplayout"));
+
 	/* open playback and record files if specified */
 	basetime = playback_init(machine);
 	record_init(machine);
@@ -3812,3 +3816,33 @@
 		}
 	}
 }
+
+int input_port_used(int type,int player)
+{
+	int portnum, bitnum;
+
+	/* loop over all input ports */
+	for (portnum = 0; portnum < MAX_INPUT_PORTS; portnum++)
+	{
+		input_port_info *portinfo = &port_info[portnum];
+		input_bit_info *info;
+		unsigned long portvalue;
+
+		for (bitnum = 0, info = &portinfo->bit[0]; bitnum < MAX_BITS_PER_PORT && info->portentry; bitnum++, info++)
+		{
+			if((portinfo->defvalue & info->portentry->mask) != 0)  // default value for the bit should be 0 if active high.
+				portvalue = ~portinfo->digital;
+			else
+				portvalue = portinfo->digital;
+
+			if(info->portentry->type == type && info->portentry->player == player)
+			{
+				if((info->portentry->type == type) && (portvalue & info->portentry->mask) != (info->portentry->default_value & info->portentry->mask))
+					return 1;
+				else
+					return 0;
+			}
+		}
+	}
+	return 0;
+}
diff -Nru base0125/src/emu/inptport.h w0125/src/emu/inptport.h
--- base0125/src/emu/inptport.h	2008-05-04 05:56:41.000000000 +1200
+++ w0125/src/emu/inptport.h	2008-05-05 23:21:51.000000000 +1200
@@ -944,4 +944,6 @@
 UINT32 input_port_read(running_machine *machine, const char *tag);
 UINT32 input_port_read_safe(running_machine *machine, const char *tag, UINT32 defvalue);
 
+int input_port_used(int, int);
+
 #endif	/* __INPTPORT_H__ */
diff -Nru base0125/src/emu/inpview.c w0125/src/emu/inpview.c
--- base0125/src/emu/inpview.c	1970-01-01 13:00:00.000000000 +1300
+++ w0125/src/emu/inpview.c	2008-05-05 23:21:51.000000000 +1200
@@ -0,0 +1,257 @@
+// Input viewer module for MAME
+// Complete re-write started Aug 23, 2006
+
+#include <stdio.h>
+#include "ui.h"
+#include "inptport.h"
+#include "render.h"
+#include "inpview.h"
+
+#define CHAR_WIDTH  (1.0f / 80.0f)
+#define INPUT_TYPES 5
+
+#define COL_RED     MAKE_ARGB(0xff, 0xff, 0x00, 0x00)
+#define COL_BLUE    MAKE_ARGB(0xff, 0x00, 0x00, 0xff)
+#define COL_GREEN   MAKE_ARGB(0xff, 0x00, 0xff, 0x00)
+#define COL_YELLOW  MAKE_ARGB(0xff, 0xff, 0xff, 0x00)
+#define COL_ORANGE  MAKE_ARGB(0xff, 0xff, 0x80, 0x00)
+#define COL_BLACK   MAKE_ARGB(0xff, 0x00, 0x00, 0x00)
+#define COL_GRAY    MAKE_ARGB(0xff, 0x80, 0x80, 0x80)
+#define COL_WHITE   MAKE_ARGB(0xff, 0xff, 0xff, 0xff)
+
+#define BGCOL       MAKE_ARGB(0x80, 0x80, 0x00, 0x00)
+
+// uncomment if you plan to use MAME's built-in font
+//#define OLD_UI_FONT 1
+
+#ifndef OLD_UI_FONT
+#define DIR_LEFT   0x2190
+#define DIR_UP     0x2191
+#define DIR_RIGHT  0x2192
+#define DIR_DOWN   0x2193
+#else
+#define DIR_LEFT   'L'
+#define DIR_UP     'U'
+#define DIR_RIGHT  'R'
+#define DIR_DOWN   'D'
+#endif
+
+struct input_type_definition inptype[INPUT_TYPES] = 
+{
+	{
+		"standard",
+		1,
+		{
+			{"1P", IPT_START1, 1, 50, 0, 0, COL_WHITE},
+			{"2P", IPT_START2, 1, 53, 0, 0, COL_WHITE},
+			{"3P", IPT_START3, 1, 56, 0, 0, COL_WHITE},
+			{"4P", IPT_START4, 1, 59, 0, 0, COL_WHITE},
+			{"5P", IPT_START5, 1, 62, 0, 0, COL_WHITE},
+			{"6P", IPT_START6, 1, 65, 0, 0, COL_WHITE},
+			{"7P", IPT_START7, 1, 68, 0, 0, COL_WHITE},
+			{"8P", IPT_START8, 1, 71, 0, 0, COL_WHITE},
+			{"1",  IPT_BUTTON1, 1, 20, 0, 1, COL_WHITE},
+			{"2",  IPT_BUTTON2, 1, 22, 0, 1, COL_WHITE},
+			{"3",  IPT_BUTTON3, 1, 24, 0, 1, COL_WHITE},
+			{"4",  IPT_BUTTON4, 1, 26, 0, 1, COL_WHITE},
+			{"5",  IPT_BUTTON5, 1, 28, 0, 1, COL_WHITE},
+			{"6",  IPT_BUTTON6, 1, 30, 0, 1, COL_WHITE},
+			{"7",  IPT_BUTTON7, 1, 32, 0, 1, COL_WHITE},
+			{"8",  IPT_BUTTON8, 1, 34, 0, 1, COL_WHITE},
+			{"9",  IPT_BUTTON9, 1, 36, 0, 1, COL_WHITE},
+			{"0",  IPT_BUTTON10, 1, 38, 0, 1, COL_WHITE},
+			{"_L",  IPT_JOYSTICK_LEFT, 1, 10, 0, 1, COL_WHITE},
+			{"_R",  IPT_JOYSTICK_RIGHT, 1, 12, 0, 1, COL_WHITE},
+			{"_U",  IPT_JOYSTICK_UP, 1, 14, 0, 1, COL_WHITE},
+			{"_D",  IPT_JOYSTICK_DOWN, 1, 16, 0, 1, COL_WHITE},
+			{"NULL", -1, 0,0,0,0,0}
+		}
+	},
+	{
+		"mahjong",
+		2,
+		{
+			{"1P", IPT_START1, 1, 50, 0, 0, COL_WHITE},
+			{"2P", IPT_START2, 1, 53, 0, 0, COL_WHITE},
+			{"3P", IPT_START3, 1, 56, 0, 0, COL_WHITE},
+			{"4P", IPT_START4, 1, 59, 0, 0, COL_WHITE},
+			{"5P", IPT_START5, 1, 62, 0, 0, COL_WHITE},
+			{"6P", IPT_START6, 1, 65, 0, 0, COL_WHITE},
+			{"7P", IPT_START7, 1, 68, 0, 0, COL_WHITE},
+			{"8P", IPT_START8, 1, 71, 0, 0, COL_WHITE},
+			{"A",  IPT_MAHJONG_A, 1, 10, 0, 1, COL_WHITE},
+			{"B",  IPT_MAHJONG_B, 1, 12, 0, 1, COL_WHITE},
+			{"C",  IPT_MAHJONG_C, 1, 14, 0, 1, COL_WHITE},
+			{"D",  IPT_MAHJONG_D, 1, 16, 0, 1, COL_WHITE},
+			{"E",  IPT_MAHJONG_E, 1, 18, 0, 1, COL_WHITE},
+			{"F",  IPT_MAHJONG_F, 1, 20, 0, 1, COL_WHITE},
+			{"G",  IPT_MAHJONG_G, 1, 22, 0, 1, COL_WHITE},
+			{"H",  IPT_MAHJONG_H, 1, 24, 0, 1, COL_WHITE},
+			{"I",  IPT_MAHJONG_I, 1, 26, 0, 1, COL_WHITE},
+			{"J",  IPT_MAHJONG_J, 1, 28, 0, 1, COL_WHITE},
+			{"K",  IPT_MAHJONG_K, 1, 30, 0, 1, COL_WHITE},
+			{"L",  IPT_MAHJONG_L, 1, 32, 0, 1, COL_WHITE},
+			{"M",  IPT_MAHJONG_M, 1, 34, 0, 1, COL_WHITE},
+			{"N",  IPT_MAHJONG_N, 1, 36, 0, 1, COL_WHITE},
+			{"O",  IPT_MAHJONG_O, 1, 38, 0, 1, COL_WHITE},
+			{"P",  IPT_MAHJONG_P, 1, 40, 0, 1, COL_WHITE},
+			{"Q",  IPT_MAHJONG_Q, 1, 42, 0, 1, COL_WHITE},
+			{"REACH",  IPT_MAHJONG_REACH, 2, 14, 0, 1, COL_WHITE},
+			{"CHI",  IPT_MAHJONG_CHI, 2, 26, 0, 1, COL_WHITE},
+			{"PON",  IPT_MAHJONG_PON, 2, 34, 0, 1, COL_WHITE},
+			{"KAN",  IPT_MAHJONG_KAN, 2, 42, 0, 1, COL_WHITE},
+			{"RON",  IPT_MAHJONG_RON, 2, 50, 0, 1, COL_WHITE},
+			{"BET",  IPT_MAHJONG_BET, 2, 58, 0, 1, COL_WHITE},
+			{"NULL", -1, 0,0,0,0,0}
+		}
+	},
+	{
+		"dualstick",
+		1,
+		{
+			{"1P", IPT_START1, 1, 50, 0, 0, COL_WHITE},
+			{"2P", IPT_START2, 1, 53, 0, 0, COL_WHITE},
+			{"3P", IPT_START3, 1, 56, 0, 0, COL_WHITE},
+			{"4P", IPT_START4, 1, 59, 0, 0, COL_WHITE},
+			{"5P", IPT_START5, 1, 62, 0, 0, COL_WHITE},
+			{"6P", IPT_START6, 1, 65, 0, 0, COL_WHITE},
+			{"7P", IPT_START7, 1, 68, 0, 0, COL_WHITE},
+			{"8P", IPT_START8, 1, 71, 0, 0, COL_WHITE},
+			{"1",  IPT_BUTTON1, 1, 30, 0, 1, COL_WHITE},
+			{"2",  IPT_BUTTON2, 1, 32, 0, 1, COL_WHITE},
+			{"3",  IPT_BUTTON3, 1, 34, 0, 1, COL_WHITE},
+			{"4",  IPT_BUTTON4, 1, 36, 0, 1, COL_WHITE},
+			{"5",  IPT_BUTTON5, 1, 38, 0, 1, COL_WHITE},
+			{"6",  IPT_BUTTON6, 1, 40, 0, 1, COL_WHITE},
+			{"7",  IPT_BUTTON7, 1, 42, 0, 1, COL_WHITE},
+			{"8",  IPT_BUTTON8, 1, 44, 0, 1, COL_WHITE},
+			{"9",  IPT_BUTTON9, 1, 46, 0, 1, COL_WHITE},
+			{"0",  IPT_BUTTON10, 1, 48, 0, 1, COL_WHITE},
+			{"_L",  IPT_JOYSTICKLEFT_LEFT,   1, 6, 0, 1, COL_WHITE},
+			{"_R",  IPT_JOYSTICKLEFT_RIGHT,  1, 8, 0, 1, COL_WHITE},
+			{"_U",  IPT_JOYSTICKLEFT_UP,     1, 10, 0, 1, COL_WHITE},
+			{"_D",  IPT_JOYSTICKLEFT_DOWN,   1, 12, 0, 1, COL_WHITE},
+			{"_L",  IPT_JOYSTICKRIGHT_LEFT,  1, 18, 0, 1, COL_WHITE},
+			{"_R",  IPT_JOYSTICKRIGHT_RIGHT, 1, 20, 0, 1, COL_WHITE},
+			{"_U",  IPT_JOYSTICKRIGHT_UP,    1, 22, 0, 1, COL_WHITE},
+			{"_D",  IPT_JOYSTICKRIGHT_DOWN,  1, 24, 0, 1, COL_WHITE},
+			{"NULL", -1, 0,0,0,0,0}
+		}
+	},
+	{
+		"neogeo",
+		2,
+		{
+			{"1P", IPT_START1, 2, 53, 0, 0, COL_YELLOW},
+			{"2P", IPT_START2, 1, 53, 0, 0, COL_YELLOW},
+			{"A",  IPT_BUTTON1, 1, 26, 0, 1, COL_RED},
+			{"B",  IPT_BUTTON2, 2, 29, 0, 1, COL_YELLOW},
+			{"C",  IPT_BUTTON3, 2, 32, 0, 1, COL_GREEN},
+			{"D",  IPT_BUTTON4, 1, 35, 0, 1, COL_BLUE},
+			{"_L",  IPT_JOYSTICK_LEFT, 1, 15, 0, 1, COL_WHITE},
+			{"_R",  IPT_JOYSTICK_RIGHT, 1, 19, 0, 1, COL_WHITE},
+			{"_U",  IPT_JOYSTICK_UP, 2, 17, 0, 1, COL_WHITE},
+			{"_D",  IPT_JOYSTICK_DOWN, 1, 17, 0, 1, COL_WHITE},
+			{"NULL", -1, 0,0,0,0,0}
+		}
+	},
+	{
+		"6button",
+		2,
+		{
+			{"1P", IPT_START1, 2, 53, 0, 0, COL_YELLOW},
+			{"2P", IPT_START2, 1, 53, 0, 0, COL_YELLOW},
+			{"1",  IPT_BUTTON1, 2, 30, 0, 1, COL_WHITE},
+			{"2",  IPT_BUTTON2, 2, 33, 0, 1, COL_WHITE},
+			{"3",  IPT_BUTTON3, 2, 36, 0, 1, COL_WHITE},
+			{"4",  IPT_BUTTON4, 1, 30, 0, 1, COL_WHITE},
+			{"5",  IPT_BUTTON5, 1, 33, 0, 1, COL_WHITE},
+			{"6",  IPT_BUTTON6, 1, 36, 0, 1, COL_WHITE},
+			{"_L",  IPT_JOYSTICK_LEFT, 1, 15, 0, 1, COL_WHITE},
+			{"_R",  IPT_JOYSTICK_RIGHT, 1, 19, 0, 1, COL_WHITE},
+			{"_U",  IPT_JOYSTICK_UP, 2, 17, 0, 1, COL_WHITE},
+			{"_D",  IPT_JOYSTICK_DOWN, 1, 17, 0, 1, COL_WHITE},
+			{"NULL", -1, 0,0,0,0,0}
+		}
+	}
+};
+
+int player;
+int layout;
+
+void render_input()
+{
+	int port = 0;
+	char txt[6];
+	float height = ui_get_line_height();
+
+	if(player < 1 || player > 8)
+		return;  // invalid player
+
+	render_ui_add_rect(0.0f,1.0f-(float)(inptype[layout].lines*height),1.0f,1.0f,BGCOL,PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA));
+	while(inptype[layout].inp[port].port != -1)
+	{
+		strcpy(txt,inptype[layout].inp[port].text);
+
+		if(inptype[layout].inp[port].playerspecific == 0)
+		{
+			if(input_port_used(inptype[layout].inp[port].port,0) != 0)
+			{
+				int ch = convert_txt(txt);
+				int col = inptype[layout].inp[port].colour;
+				if(ch == 0)
+					ui_draw_text_full(txt,(float)(inptype[layout].inp[port].x * CHAR_WIDTH),1.0f - (float)(height * inptype[layout].inp[port].line),1.0f,JUSTIFY_LEFT,WRAP_NEVER,DRAW_OPAQUE,col,0,NULL,NULL);
+				else
+					render_ui_add_char((float)(inptype[layout].inp[port].x * CHAR_WIDTH),1.0f - (float)(height * inptype[layout].inp[port].line),height,render_get_ui_aspect(),col,ui_get_font(),ch);
+			}
+		}
+		else
+		{
+			if(input_port_used(inptype[layout].inp[port].port,player-1) != 0)
+			{
+				int ch = convert_txt(txt);
+				int col = inptype[layout].inp[port].colour;
+				if(ch == 0)
+					ui_draw_text_full(txt,(float)(inptype[layout].inp[port].x * CHAR_WIDTH),1.0f - (float)(height * inptype[layout].inp[port].line),1.0f,JUSTIFY_LEFT,WRAP_NEVER,DRAW_OPAQUE,col,0,NULL,NULL);
+				else
+					render_ui_add_char((float)(inptype[layout].inp[port].x * CHAR_WIDTH),1.0f - (float)(height * inptype[layout].inp[port].line),height,render_get_ui_aspect(),col,ui_get_font(),ch);
+			}
+		}
+		port++;
+	}
+}
+
+void inpview_set_data(int ply, const char* lay)
+{
+	player = ply;
+	layout = 0;
+	while(layout < INPUT_TYPES)
+	{
+		if(strcmp(inptype[layout].name,lay) == 0)
+		{
+			printf("INPVIEW: using layout type '%s'\n",lay);
+			return;
+		}
+		layout++;
+	}
+	printf("INPVIEW: invalid type specified, standard layout in use\n");
+	layout = 0;
+}
+
+int inpview_get_player()
+{
+	return player;
+}
+
+unsigned int convert_txt(char* txt)
+{
+		if(strcmp(txt,"_L") == 0)
+			return DIR_LEFT;
+		if(strcmp(txt,"_R") == 0)
+			return DIR_RIGHT;
+		if(strcmp(txt,"_U") == 0)
+			return DIR_UP;
+		if(strcmp(txt,"_D") == 0)
+			return DIR_DOWN;
+	return 0;
+}
diff -Nru base0125/src/emu/inpview.h w0125/src/emu/inpview.h
--- base0125/src/emu/inpview.h	1970-01-01 13:00:00.000000000 +1300
+++ w0125/src/emu/inpview.h	2008-05-05 23:21:51.000000000 +1200
@@ -0,0 +1,24 @@
+// Input viewer header
+
+struct inputs
+{
+	char text[6];  // character(s) to display
+	int port;  // port to check
+	int line;  // line to display on
+	int x;  // location on line to display at
+	char isanalogue;  // non-zero if the input is analogue
+	char playerspecific;  // is a player specific port (if 0, then player should be 0 too)
+	unsigned long colour;
+};
+
+struct input_type_definition
+{
+	char name[13];  // NULL-terminated string to identify different type using a possible -inplayout option
+	int lines;  // number of lines to use for this type
+	struct inputs inp[64];  // list of displayed buttons, and the inputs they correspond to (64 max)
+};
+
+void render_input(void);
+void inpview_set_data(int,const char*);
+int inpview_get_player(void);
+unsigned int convert_txt(char*);
diff -Nru base0125/src/emu/ui.c w0125/src/emu/ui.c
--- base0125/src/emu/ui.c	2008-05-04 05:56:41.000000000 +1200
+++ w0125/src/emu/ui.c	2008-05-06 00:45:53.000000000 +1200
@@ -28,7 +28,7 @@
 
 #include <ctype.h>
 
-
+#include "inpview.h"
 
 /***************************************************************************
     CONSTANTS
@@ -447,6 +447,11 @@
 	/* let MESS display its stuff */
 	mess_ui_update(machine);
 #endif /* MESS */
+
+	// Input viewer
+	if(inpview_get_player() != 0)
+		render_input();
+
 }
 
 
--- sdlmess0122/makefile.sdl.orig	2008-01-01 12:30:10.000000000 -0800
+++ sdlmess0122/makefile	2008-01-01 12:57:53.000000000 -0800
@@ -355,6 +355,13 @@
 endif
 LDFLAGSEMULATOR =
 
+CFLAGS += -Wno-error
+ifndef PTR64
+CFLAGS += -m32
+DEFS += -m32
+LDFLAGS += -m32
+endif
+
 # add profiling information for the linker
 ifdef PROFILE
 LDFLAGS += -pg
--- sdlmess/src/osd/sdl/sdl.mak	2007-05-10 16:34:36.000000000 -0700
+++ sdlmess0115/src/osd/sdl/sdl.mak	2007-05-10 17:07:53.000000000 -0700
@@ -20,6 +20,12 @@
 
 OBJDIRS += $(SDLOBJ)
 
+ifdef PTR64
+SDL_LIBS = `sdl-config --libs`
+else
+SDL_LIBS = `sdl-config --libs|sed s/64//`
+endif
+
 SDLMAIN =
 
 #-------------------------------------------------
@@ -98,7 +104,7 @@
 # OS2: add the necessary libraries
 ifeq ($(SUBARCH),os2)
 CFLAGS += `sdl-config --cflags`
-LIBS += `sdl-config --libs`
+LIBS += $(SDL_LIBS)
 endif # OS2
 
 TOOLS += \
--- sdlmess0115/src/emu/cpu/cpu.mak.orig	2007-05-25 23:12:32.000000000 -0700
+++ sdlmess0115/src/emu/cpu/cpu.mak	2007-05-25 23:16:43.000000000 -0700
@@ -870,7 +870,6 @@
 							$(CPUSRC)/m6502/t65c02.c \
 							$(CPUSRC)/m6502/t65sc02.c \
 							$(CPUSRC)/m6502/t6510.c \
-							$(CPUSRC)/m6502/tdeco16.c
 
 $(CPUOBJ)/m6502/m65ce02.o:	$(CPUSRC)/m6502/m65ce02.c \
 							$(CPUSRC)/m6502/m65ce02.h \
@@ -1066,8 +1065,6 @@
 							$(CPUSRC)/powerpc/ppc.h \
 							$(CPUSRC)/powerpc/ppc_ops.c \
 							$(CPUSRC)/powerpc/ppc_mem.c \
-							$(CPUSRC)/powerpc/ppc403.c \
-							$(CPUSRC)/powerpc/ppc602.c \
 							$(CPUSRC)/powerpc/ppc603.c
 
 $(CPUOBJ)/powerpc/ppcdrc.o:	$(CPUSRC)/powerpc/ppcdrc.c \
@@ -1109,7 +1106,6 @@
 						$(CPUSRC)/nec/nec.h \
 						$(CPUSRC)/nec/necintrf.h \
 						$(CPUSRC)/nec/necea.h \
-						$(CPUSRC)/nec/nechost.h \
 						$(CPUSRC)/nec/necinstr.h \
 						$(CPUSRC)/nec/necmodrm.h
 
@@ -1118,7 +1114,6 @@
 							$(CPUSRC)/v30mz/necmodrm.h \
 							$(CPUSRC)/v30mz/necinstr.h \
 							$(CPUSRC)/v30mz/necea.h \
-							$(CPUSRC)/v30mz/nechost.h \
 							$(CPUSRC)/v30mz/necintrf.h
 
 
@@ -1249,7 +1248,6 @@
 
 $(CPUOBJ)/minx/minx.o:		$(CPUSRC)/minx/minx.c \
 							$(CPUSRC)/minx/minx.h \
-							$(CPUSRC)/minx/minxd.c \
 							$(CPUSRC)/minx/minxopce.h \
 							$(CPUSRC)/minx/minxopcf.h \
 							$(CPUSRC)/minx/minxops.h \
@@ -1398,7 +1393,6 @@
 $(CPUOBJ)/tms9900/tms9900.o:	$(CPUSRC)/tms9900/tms9900.c \
 								$(CPUSRC)/tms9900/tms9900.h \
 								$(CPUSRC)/tms9900/99xxcore.h \
-								$(CPUSRC)/tms9900/99xxstat.h
 
 $(CPUOBJ)/tms9900/tms9980a.o:	$(CPUSRC)/tms9900/tms9980a.c \
 								$(CPUSRC)/tms9900/tms9900.h \

