diff -Nru --strip-trailing-cr mames.131/src/emu/inptport.h mames/src/emu/inptport.h
--- mames.131/src/emu/inptport.h	2009-06-01 14:59:25.000000000 -0700
+++ mames/src/emu/inptport.h	2009-06-01 15:00:54.000000000 -0700
@@ -134,6 +134,8 @@
 typedef struct _input_port_config input_port_config;
 typedef struct _input_field_config input_field_config;
 
+void playback_end(running_machine* machine, const char *message);
+void record_end(running_machine* machine, const char *message);
 /* custom input port callback function */
 typedef UINT32 (*input_field_custom_func)(const input_field_config *field, void *param);
 
diff -Nru --strip-trailing-cr mames.131/src/emu/ui.c mames/src/emu/ui.c
--- mames.131/src/emu/ui.c	2009-06-01 14:49:20.000000000 -0700
+++ mames/src/emu/ui.c	2009-06-01 14:58:31.000000000 -0700
@@ -1206,9 +1206,29 @@
 
 	/* handle a reset request */
 	if (ui_input_pressed(machine, IPT_UI_RESET_MACHINE))
-		mame_schedule_hard_reset(machine);
+	{
+		if (get_playback_file(machine) || get_record_file(machine))
+		{
+			if (get_playback_file(machine))
+				playback_end(machine, "USER TERMINATED PLAYBACK");
+			if (get_record_file(machine))
+				record_end(machine, "USER TERMINATED RECORD");
+		}
+		else
+			mame_schedule_hard_reset(machine);
+	}
 	if (ui_input_pressed(machine, IPT_UI_SOFT_RESET))
-		mame_schedule_soft_reset(machine);
+	{
+		if (get_playback_file(machine) || get_record_file(machine))
+		{
+			if (get_playback_file(machine))
+				playback_end(machine, "USER TERMINATED PLAYBACK");
+			if (get_record_file(machine))
+				record_end(machine, "USER TERMINATED RECORD");
+		}
+		else
+			mame_schedule_soft_reset(machine);
+	}
 
 	/* handle a request to display graphics/palette */
 	if (ui_input_pressed(machine, IPT_UI_SHOW_GFX) && !get_record_file(machine))
diff -Nru --strip-trailing-cr mames.131/src/emu/inptport.c mames/src/emu/inptport.c
--- mames.131/src/emu/inptport.c	2009-06-02 14:43:15.000000000 -0700
+++ mames/src/emu/inptport.c	2009-06-02 14:20:58.000000000 -0700
@@ -512,13 +512,11 @@
 
 /* input playback */
 static time_t playback_init(running_machine *machine);
-static void playback_end(running_machine *machine, const char *message);
 static void playback_frame(running_machine *machine, attotime curtime);
 static void playback_port(const input_port_config *port);
 
 /* input recording */
 static void record_init(running_machine *machine);
-static void record_end(running_machine *machine, const char *message);
 static void record_frame(running_machine *machine, attotime curtime);
 static void record_port(const input_port_config *port);
 
@@ -3963,7 +3961,7 @@
     playback_end - end INP playback
 -------------------------------------------------*/
 
-static void playback_end(running_machine *machine, const char *message)
+void playback_end(running_machine *machine, const char *message)
 {
 	input_port_private *portdata = machine->input_port_data;
 	char timearray[]="100d 00:00:00.00:";
@@ -4241,7 +4239,7 @@
     record_end - end INP recording
 -------------------------------------------------*/
 
-static void record_end(running_machine *machine, const char *message)
+void record_end(running_machine *machine, const char *message)
 {
 	input_port_private *portdata = machine->input_port_data;
 

