? .DS_Store
? build
? config_old.h
? conflicts
? hatari-080912.patch
? hatari-081004.patch
? hatari-081026.patch
? q
? Hatari.xcodeproj/giz.mode1
? Hatari.xcodeproj/giz.mode1v3
? Hatari.xcodeproj/giz.pbxuser
? src/.DS_Store
? src/gemdos.c_
? src/gui-osx/PrefsController.m_
? src/includes/configuration.h_
? src/uae-cpu/build68k.dSYM
? src/uae-cpu/newcpu.c_
Index: Hatari.xcodeproj/project.pbxproj
===================================================================
RCS file: /cvsroot/hatari/hatari/Hatari.xcodeproj/project.pbxproj,v
retrieving revision 1.13
diff -u -r1.13 project.pbxproj
--- Hatari.xcodeproj/project.pbxproj	10 Oct 2008 22:01:28 -0000	1.13
+++ Hatari.xcodeproj/project.pbxproj	26 Oct 2008 10:10:31 -0000
@@ -3,7 +3,7 @@
 	archiveVersion = 1;
 	classes = {
 	};
-	objectVersion = 42;
+	objectVersion = 44;
 	objects = {
 
 /* Begin PBXBuildFile section */
@@ -15,7 +15,10 @@
 		4EE4B6070DD8E15C00DF27A2 /* change.h in Headers */ = {isa = PBXBuildFile; fileRef = 4EE4B6040DD8E15C00DF27A2 /* change.h */; };
 		4EE4B6080DD8E15C00DF27A2 /* control.h in Headers */ = {isa = PBXBuildFile; fileRef = 4EE4B6050DD8E15C00DF27A2 /* control.h */; };
 		4EE4B6090DD8E15C00DF27A2 /* str.h in Headers */ = {isa = PBXBuildFile; fileRef = 4EE4B6060DD8E15C00DF27A2 /* str.h */; };
-		961322D80B5BCDB900007C3E /* config-default.h in Headers */ = {isa = PBXBuildFile; fileRef = 961322D30B5BCDB900007C3E /* config-default.h */; };
+		637694150E72DD1700AFC63A /* utils.c in Sources */ = {isa = PBXBuildFile; fileRef = 637694140E72DD1700AFC63A /* utils.c */; };
+		6376941A0E72DDB400AFC63A /* dsp_core.c in Sources */ = {isa = PBXBuildFile; fileRef = 637694180E72DDB400AFC63A /* dsp_core.c */; };
+		6376941B0E72DDB400AFC63A /* dsp_core.h in Headers */ = {isa = PBXBuildFile; fileRef = 637694190E72DDB400AFC63A /* dsp_core.h */; };
+		63E840130E745FDC00578D4F /* ym2149_fixed_vol.h in Headers */ = {isa = PBXBuildFile; fileRef = 63E840120E745FDC00578D4F /* ym2149_fixed_vol.h */; };
 		961322E70B5BCFBB00007C3E /* config.h in Headers */ = {isa = PBXBuildFile; fileRef = 961322E60B5BCFBB00007C3E /* config.h */; };
 		961322FB0B5BD0B800007C3E /* araglue.h in Headers */ = {isa = PBXBuildFile; fileRef = 961322EF0B5BD0B800007C3E /* araglue.h */; };
 		961322FC0B5BD0B800007C3E /* dsp_cpu.c in Sources */ = {isa = PBXBuildFile; fileRef = 961322F00B5BD0B800007C3E /* dsp_cpu.c */; };
@@ -195,7 +198,6 @@
 		E99613BA0E6DC6900047F6A0 /* statusbar.c in Sources */ = {isa = PBXBuildFile; fileRef = E99613B90E6DC6900047F6A0 /* statusbar.c */; };
 		E99613BD0E6DC6C50047F6A0 /* statusbar.h in Headers */ = {isa = PBXBuildFile; fileRef = E99613BB0E6DC6C50047F6A0 /* statusbar.h */; };
 		E99613BE0E6DC6C50047F6A0 /* utils.h in Headers */ = {isa = PBXBuildFile; fileRef = E99613BC0E6DC6C50047F6A0 /* utils.h */; };
-		E9D75D5A0E8C1BB1000E76DE /* ym2149_fixed_vol.h in Headers */ = {isa = PBXBuildFile; fileRef = E9D75D590E8C1BB1000E76DE /* ym2149_fixed_vol.h */; };
 /* End PBXBuildFile section */
 
 /* Begin PBXBuildRule section */
@@ -250,7 +252,11 @@
 		4EE4B6040DD8E15C00DF27A2 /* change.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = change.h; sourceTree = "<group>"; };
 		4EE4B6050DD8E15C00DF27A2 /* control.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = control.h; sourceTree = "<group>"; };
 		4EE4B6060DD8E15C00DF27A2 /* str.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = str.h; sourceTree = "<group>"; };
-		961322D30B5BCDB900007C3E /* config-default.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "config-default.h"; sourceTree = "<group>"; };
+		636E057F0E29C43D008DF96D /* utils.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = utils.c; path = src/utils.c; sourceTree = "<group>"; };
+		637694140E72DD1700AFC63A /* utils.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = utils.c; path = src/utils.c; sourceTree = "<group>"; };
+		637694180E72DDB400AFC63A /* dsp_core.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = dsp_core.c; path = src/falcon/dsp_core.c; sourceTree = "<group>"; };
+		637694190E72DDB400AFC63A /* dsp_core.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = dsp_core.h; path = src/falcon/dsp_core.h; sourceTree = "<group>"; };
+		63E840120E745FDC00578D4F /* ym2149_fixed_vol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ym2149_fixed_vol.h; path = src/includes/ym2149_fixed_vol.h; sourceTree = "<group>"; };
 		961322E60B5BCFBB00007C3E /* config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = config.h; sourceTree = "<group>"; };
 		961322EF0B5BD0B800007C3E /* araglue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = araglue.h; path = src/falcon/araglue.h; sourceTree = "<group>"; };
 		961322F00B5BD0B800007C3E /* dsp_cpu.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = dsp_cpu.c; path = src/falcon/dsp_cpu.c; sourceTree = "<group>"; };
@@ -276,7 +282,7 @@
 		96635B750BF86FDF00518B3B /* nvram.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = nvram.c; path = src/falcon/nvram.c; sourceTree = "<group>"; };
 		96635B760BF86FDF00518B3B /* nvram.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = nvram.h; path = src/falcon/nvram.h; sourceTree = "<group>"; };
 		9670E1B00A5FA132009A73E0 /* Info-Hatari.plist */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = "Info-Hatari.plist"; sourceTree = "<group>"; };
-		9670E1B10A5FA132009A73E0 /* Hatari.app */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = wrapper.application; path = Hatari.app; sourceTree = BUILT_PRODUCTS_DIR; };
+		9670E1B10A5FA132009A73E0 /* Hatari.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Hatari.app; sourceTree = BUILT_PRODUCTS_DIR; };
 		9670E1C10A5FA25A009A73E0 /* SDL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SDL.framework; path = /Library/Frameworks/SDL.framework; sourceTree = "<absolute>"; };
 		968B50EE0D83704D00C21920 /* dlgDisk.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = dlgDisk.c; sourceTree = "<group>"; };
 		968B50EF0D83704D00C21920 /* dlgNewDisk.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = dlgNewDisk.c; sourceTree = "<group>"; };
@@ -479,7 +485,6 @@
 			isa = PBXGroup;
 			children = (
 				961322E60B5BCFBB00007C3E /* config.h */,
-				961322D30B5BCDB900007C3E /* config-default.h */,
 				96D6324C0A4E9A4300FBFA27 /* gui-osx */,
 				29B97315FDCFA39411CA2CEA /* Other Sources */,
 				29B97317FDCFA39411CA2CEA /* Resources */,
@@ -493,6 +498,7 @@
 		29B97315FDCFA39411CA2CEA /* Other Sources */ = {
 			isa = PBXGroup;
 			children = (
+				63E840120E745FDC00578D4F /* ym2149_fixed_vol.h */,
 				4E5138320DE5515200605B70 /* high640x8.c */,
 				4E5138330DE5515200605B70 /* low320x8.c */,
 				4E5138340DE5515200605B70 /* low320x16.c */,
@@ -524,6 +530,8 @@
 				961323090B5BD14B00007C3E /* ioMemTabSTE.c */,
 				9613230A0B5BD14B00007C3E /* ioMemTabTT.c */,
 				961322EF0B5BD0B800007C3E /* araglue.h */,
+				637694180E72DDB400AFC63A /* dsp_core.c */,
+				637694190E72DDB400AFC63A /* dsp_core.h */,
 				961322F00B5BD0B800007C3E /* dsp_cpu.c */,
 				961322F10B5BD0B800007C3E /* dsp_cpu.h */,
 				961322F20B5BD0B800007C3E /* dsp_disasm.c */,
@@ -561,6 +569,7 @@
 				E9283ED307512EA200DA6B24 /* int.c */,
 				E99035B107E8C909000E7CD7 /* ioMem.c */,
 				E9283ED507512EA200DA6B24 /* joy.c */,
+				636E057F0E29C43D008DF96D /* utils.c */,
 				E9283ED607512EA200DA6B24 /* keymap.c */,
 				E9933BC20802F0F800E20172 /* log.c */,
 				E9283ED707512EA200DA6B24 /* m68000.c */,
@@ -585,6 +594,7 @@
 				E9283EEC07512EA200DA6B24 /* tos.c */,
 				E9283EED07512EA200DA6B24 /* uae-cpu */,
 				E9283F0107512EA200DA6B24 /* unzip.c */,
+				637694140E72DD1700AFC63A /* utils.c */,
 				E9283F0207512EA200DA6B24 /* vdi.c */,
 				E9283F0307512EA200DA6B24 /* video.c */,
 				E9283F0407512EA200DA6B24 /* wavFormat.c */,
@@ -831,7 +841,6 @@
 				9670E1540A5FA132009A73E0 /* gemdos_defines.h in Headers */,
 				9670E1550A5FA132009A73E0 /* options.h in Headers */,
 				9691912A0AA205D60008B3A0 /* scandir.h in Headers */,
-				961322D80B5BCDB900007C3E /* config-default.h in Headers */,
 				961322E70B5BCFBB00007C3E /* config.h in Headers */,
 				961322FB0B5BD0B800007C3E /* araglue.h in Headers */,
 				961322FD0B5BD0B800007C3E /* dsp_cpu.h in Headers */,
@@ -849,7 +858,8 @@
 				4E5138500DE5515200605B70 /* routines.h in Headers */,
 				E99613BD0E6DC6C50047F6A0 /* statusbar.h in Headers */,
 				E99613BE0E6DC6C50047F6A0 /* utils.h in Headers */,
-				E9D75D5A0E8C1BB1000E76DE /* ym2149_fixed_vol.h in Headers */,
+				6376941B0E72DDB400AFC63A /* dsp_core.h in Headers */,
+				63E840130E745FDC00578D4F /* ym2149_fixed_vol.h in Headers */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -900,7 +910,7 @@
 		29B97313FDCFA39411CA2CEA /* Project object */ = {
 			isa = PBXProject;
 			buildConfigurationList = 96F027C90998116700577C54 /* Build configuration list for PBXProject "Hatari" */;
-			compatibilityVersion = "Xcode 2.4";
+			compatibilityVersion = "Xcode 3.0";
 			hasScannedForEncodings = 1;
 			mainGroup = 29B97314FDCFA39411CA2CEA /* Hatari */;
 			projectDirPath = "";
@@ -1025,6 +1035,8 @@
 				4EE4B5EE0DD8E0DD00DF27A2 /* control.c in Sources */,
 				4EE4B5EF0DD8E0DD00DF27A2 /* str.c in Sources */,
 				E99613BA0E6DC6900047F6A0 /* statusbar.c in Sources */,
+				637694150E72DD1700AFC63A /* utils.c in Sources */,
+				6376941A0E72DDB400AFC63A /* dsp_core.c in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -1055,6 +1067,7 @@
 			isa = XCBuildConfiguration;
 			buildSettings = {
 				COPY_PHASE_STRIP = NO;
+				ENABLE_DSP_EMU = 1;
 				FRAMEWORK_SEARCH_PATHS = "\"$(HOME)/Library/Frameworks\"";
 				GCC_DYNAMIC_NO_PIC = NO;
 				GCC_ENABLE_FIX_AND_CONTINUE = YES;
@@ -1075,7 +1088,10 @@
 				INFOPLIST_FILE = "Info-Hatari.plist";
 				INSTALL_PATH = "$(HOME)/Applications";
 				LIBRARY_SEARCH_PATHS = "";
-				OTHER_CFLAGS = "-Wno-unused";
+				OTHER_CFLAGS = (
+					"-Wno-unused",
+					"-DENABLE_DSP_EMU",
+				);
 				OTHER_LDFLAGS = "-lz";
 				PRODUCT_NAME = Hatari;
 				SECTORDER_FLAGS = "";
@@ -1093,6 +1109,7 @@
 			isa = XCBuildConfiguration;
 			buildSettings = {
 				COPY_PHASE_STRIP = YES;
+				ENABLE_DSP_EMU = 1;
 				FRAMEWORK_SEARCH_PATHS = "\"$(HOME)/Library/Frameworks\"";
 				GCC_ENABLE_FIX_AND_CONTINUE = NO;
 				GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
@@ -1111,7 +1128,10 @@
 				INFOPLIST_FILE = "Info-Hatari.plist";
 				INSTALL_PATH = "$(HOME)/Applications";
 				LIBRARY_SEARCH_PATHS = "";
-				OTHER_CFLAGS = "-Wno-unused";
+				OTHER_CFLAGS = (
+					"-Wno-unused",
+					"-DENABLE_DSP_EMU",
+				);
 				OTHER_LDFLAGS = "-lz";
 				PRODUCT_NAME = Hatari;
 				SECTORDER_FLAGS = "";
@@ -1170,10 +1190,15 @@
 		96F027CA0998116700577C54 /* Development */ = {
 			isa = XCBuildConfiguration;
 			buildSettings = {
-				MACOSX_DEPLOYMENT_TARGET = 10.3;
+				DEPLOYMENT_POSTPROCESSING = NO;
+				GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
+				HEADER_SEARCH_PATHS = "";
+				MACOSX_DEPLOYMENT_TARGET = 10.5;
 				MACOSX_DEPLOYMENT_TARGET_i386 = 10.4;
 				MACOSX_DEPLOYMENT_TARGET_ppc = 10.3.9;
-				SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;
+				SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk";
+				SEPARATE_STRIP = YES;
+				USER_HEADER_SEARCH_PATHS = "";
 			};
 			name = Development;
 		};
@@ -1184,15 +1209,18 @@
 					ppc,
 					i386,
 				);
+				DEPLOYMENT_POSTPROCESSING = NO;
+				ENABLE_DSP_EMU = 1;
 				GCC_AUTO_VECTORIZATION = YES;
 				GCC_ENABLE_SUPPLEMENTAL_SSE3_INSTRUCTIONS = YES;
 				GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
 				GCC_OPTIMIZATION_LEVEL = 3;
-				MACOSX_DEPLOYMENT_TARGET = 10.3;
+				MACOSX_DEPLOYMENT_TARGET = 10.5;
 				MACOSX_DEPLOYMENT_TARGET_i386 = 10.4;
 				MACOSX_DEPLOYMENT_TARGET_ppc = 10.3.9;
 				OTHER_CFLAGS = "-ftree-vectorizer-verbose=3";
-				SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;
+				SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk";
+				SEPARATE_STRIP = YES;
 			};
 			name = Deployment;
 		};
Index: src/debugui.c
===================================================================
RCS file: /cvsroot/hatari/hatari/src/debugui.c,v
retrieving revision 1.26
diff -u -r1.26 debugui.c
--- src/debugui.c	25 Oct 2008 22:32:15 -0000	1.26
+++ src/debugui.c	26 Oct 2008 10:10:31 -0000
@@ -39,14 +39,14 @@
 #define NON_PRINT_CHAR '.'     /* character to display for non-printables */
 #define DISASM_INSTS   5       /* disasm - number of instructions */
 
+bool bDebugStep=FALSE;		/* Are we single stepping the CPU? */
+
 static bool bMemDump;          /* has memdump been called? */
 static unsigned long memdump_addr; /* memdump address */
 static unsigned long disasm_addr;  /* disasm address */
 
 static FILE *debugOutput;
 
-
-
 /*-----------------------------------------------------------------------*/
 /**
  * Get a hex adress range, eg. "fa0000-fa0100" 
@@ -570,6 +570,7 @@
 	        " l filename address - load a file into memory starting at address. \n"
 	        " s filename address length - dump length bytes from memory to a file. \n"
 	        " o [command line] - set Hatari command line options\n\n"
+		" i - step one instruction\n"
 	        " q - quit emulator\n"
 	        " c - continue emulation\n\n"
 	        " Adresses may be given as a range e.g. fc0000-fc0100\nAll values in hexadecimal.\n"
@@ -684,6 +685,11 @@
 			DebugUI_SaveBin(input);
 		break;
 
+	case 'i':
+		//DebugUI_Step();
+		retval = DEBUG_STEP;
+		break;
+			
 	 default:
 		if (command[0])
 			fprintf(stderr,"  Unknown command: '%s'\n", command);
@@ -722,20 +728,38 @@
 	return retval;
 }
 
-
 /*-----------------------------------------------------------------------*/
 /**
  * Debug UI
  */
 void DebugUI(void)
 {
+	int cmd;
 	bMemDump = FALSE;
 	disasm_addr = 0;
 
-	fprintf(stderr, "\nYou have entered debug mode. Type c to continue emulation, h for help."
+	if(bDebugStep)
+	{
+		uaecptr disasm_addr = M68000_GetPC();
+		uaecptr nextpc;
+		m68k_disasm(debugOutput, (uaecptr)disasm_addr, &nextpc, 1);		
+	}
+	else
+	{
+		fprintf(stderr, "\nYou have entered debug mode. Type c to continue emulation, h for help."
 	                "\n----------------------------------------------------------------------\n");
-	while (DebugUI_GetCommand() != DEBUG_QUIT)
-		;
+	}
+	
+	while ( (cmd=DebugUI_GetCommand()) != DEBUG_QUIT)
+	{
+		if(cmd == DEBUG_STEP)
+		{
+			fprintf(stderr,"Stepping...\n");
+			bDebugStep=TRUE;
+			return;
+		}
+	}
+	bDebugStep=FALSE;
 	fprintf(stderr,"Returning to emulation...\n------------------------------\n\n");
 	DebugUI_SetLogDefault();
 }
Index: src/main.c
===================================================================
RCS file: /cvsroot/hatari/hatari/src/main.c,v
retrieving revision 1.145
diff -u -r1.145 main.c
--- src/main.c	25 Oct 2008 20:31:56 -0000	1.145
+++ src/main.c	26 Oct 2008 10:10:31 -0000
@@ -50,7 +50,6 @@
 #include "falcon/dsp.h"
 #endif
 
-
 bool bQuitProgram = FALSE;                /* Flag to quit program cleanly */
 bool bEnableDebug = FALSE;                /* Enable debug UI? */
 
Index: src/options.c
===================================================================
RCS file: /cvsroot/hatari/hatari/src/options.c,v
retrieving revision 1.72
diff -u -r1.72 options.c
--- src/options.c	20 Sep 2008 12:01:08 -0000	1.72
+++ src/options.c	26 Oct 2008 10:10:31 -0000
@@ -43,11 +43,9 @@
 
 #include "hatari-glue.h"
 
-
 bool bLoadAutoSave;        /* Load autosave memory snapshot at startup */
 bool bLoadMemorySave;      /* Load memory snapshot provided via option at startup */
-bool bBiosIntercept;       /* whether UAE should intercept Bios & XBios calls */
-
+bool bBiosIntercept=TRUE;  /* whether UAE should intercept Bios & XBios calls */
 
 /*  List of supported options. */
 enum {
Index: src/rs232.c
===================================================================
RCS file: /cvsroot/hatari/hatari/src/rs232.c,v
retrieving revision 1.33
diff -u -r1.33 rs232.c
--- src/rs232.c	16 Jun 2008 19:22:37 -0000	1.33
+++ src/rs232.c	26 Oct 2008 10:10:31 -0000
@@ -54,7 +54,7 @@
 #if HAVE_TERMIOS_H
 
 #if !HAVE_CFMAKERAW
-static inline void cfmakeraw(struct termios *termios_p)
+void cfmakeraw(struct termios *termios_p)
 {
 	termios_p->c_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP|INLCR|IGNCR|ICRNL|IXON);
 	termios_p->c_oflag &= ~OPOST;
Index: src/xbios.c
===================================================================
RCS file: /cvsroot/hatari/hatari/src/xbios.c,v
retrieving revision 1.17
diff -u -r1.17 xbios.c
--- src/xbios.c	25 May 2008 19:58:56 -0000	1.17
+++ src/xbios.c	26 Oct 2008 10:10:31 -0000
@@ -20,11 +20,10 @@
 #include "screenSnapShot.h"
 #include "stMemory.h"
 #include "xbios.h"
-
+#include "debugui.h"
 
 #define XBIOS_DEBUG 0	/* for floppy read/write */
 
-
 /* List of Atari ST RS-232 baud rates */
 static const int BaudRates[] =
 {
@@ -174,6 +173,154 @@
 	return TRUE;
 }
 
+/*----------------------------------------------------------------------- */
+/**
+ * XBIOS Change Emulator Options
+ * Call 255
+ */
+static bool XBios_HatariOption(Uint32 Params)
+{
+  int option = STMemory_ReadWord(Params+2);
+  fprintf(stderr, "Intercepted XBIOS HatariOption(), option=%d (%08x), ", option, Params);
+
+  switch(option)
+  {
+  case 1: /* Min speed? */
+    ConfigureParams.System.bFastForward = false;
+    //ConfigureParams.System.nMinMaxSpeed = MINMAXSPEED_MIN;
+    /* Reset the sound emulation variables: */
+    Sound_ResetBufferIndex();
+    fprintf(stderr, "Normal speed\n");
+    Regs[REG_D0] = 0;
+    break;
+  case 2: /* Max speed? */
+    ConfigureParams.System.bFastForward = true;
+    //ConfigureParams.System.nMinMaxSpeed = MINMAXSPEED_MAX;
+    fprintf(stderr, "Maximum speed!\n");
+    Regs[REG_D0] = 0;
+    break;
+  case 3:  /* Enable debugger? */
+	  bEnableDebug = TRUE;  
+	  fprintf(stderr, "Debugger enabled\n");
+	  Regs[REG_D0] = 0;
+    break;
+  case 4:  /* Disable debugger? */
+	  bEnableDebug = FALSE;  
+	  fprintf(stderr, "Debugger disabled\n");
+	  Regs[REG_D0] = 0;
+    break;
+  default:
+    fprintf(stderr, "Unknown argument (%d)\n",Params);
+    Regs[REG_D0] = -1;
+  }
+
+  return(TRUE);
+}
+
+/*----------------------------------------------------------------------- */
+/**
+ * XBIOS Debug output to console
+ * Call 254
+ * Parameters: memptr at -2(sp) and numbytes at -6(sp)
+ */
+static bool XBios_Debug(Uint32 Params)
+{
+  int i;
+  Uint32 memptr = STMemory_ReadLong(Params+2);
+  Uint32 length = STMemory_ReadLong(Params+6);
+  
+  fprintf(stderr, "Memory dump at 0x%08x (%d bytes): ", memptr, length);
+  if(length>256)
+  {
+    length = 256;
+    fprintf(stderr,"length truncated to 256 bytes! ");
+  }
+  for(i=0;i<length;i++)
+  {
+    if( (i%16) == 0) fprintf(stderr,"\n");
+    fprintf(stderr,"%02x ",STMemory_ReadByte(memptr+i));
+  }
+  fprintf(stderr,"\n");
+  
+  return(TRUE);
+}
+
+/**
+ * XBIOS Dump all registers to console
+ * Call 251
+ * Parameters: none
+ */
+static bool XBios_Registers(Uint32 Params)
+{
+//	Uint32 memptr = STMemory_ReadLong(Params+2);
+//	Uint32 length = STMemory_ReadLong(Params+6);
+	
+	fprintf(stderr, "Registers: \n");
+	fprintf(stderr,"d/a0     d/a1     d/a2     d/a3      d/a4     d/a5     d/a6     d/a7 \n");
+	fprintf(stderr,"%08x %08x %08x %08x %08x %08x %08x %08x \n",
+		Regs[REG_D0], Regs[REG_D1], Regs[REG_D2], Regs[REG_D3],
+		Regs[REG_D4], Regs[REG_D5], Regs[REG_D6], Regs[REG_D7] );
+	fprintf(stderr,"%08x %08x %08x %08x %08x %08x %08x %08x \n",
+		Regs[REG_A0], Regs[REG_A1], Regs[REG_A2], Regs[REG_A3],
+		Regs[REG_A4], Regs[REG_A5], Regs[REG_A6], Regs[REG_A7] );
+	
+	return(TRUE);
+}
+
+static Uint32 sCycleCounter[256];
+extern int nScanlinesPerFrame;                   /* Number of scan lines per frame */
+extern int nCyclesPerLine;                       /* Cycles per horizontal line scan */
+
+/**
+ * XBIOS Start or restart a cycle counter
+ * Call 253
+ * Parameters: counter no at -2(sp)
+ */
+static bool XBios_CounterStart(Uint32 Params)
+{
+  Params = STMemory_ReadWord(Params+2);
+  Params &= 0xFF;  /* we only use 255 cycle counters */
+  sCycleCounter[Params] = Cycles_GetCounter(CYCLES_COUNTER_VIDEO);
+/*  fprintf(stderr,"XBios cycle counter #%d started at %d\n",Params,sCycleCounter[Params]); */
+  return(TRUE);
+}
+
+/**
+ * XBIOS Stop a cycle counter
+ * Call 252
+ * Parameters: counter no at -2(sp)
+ */
+static bool XBios_CounterRead(Uint32 Params)
+{
+  Uint32 cycles,curr_cycles;
+  Params = STMemory_ReadWord(Params+2);
+  Params &= 0xFF;  /* we only use 255 cycle counters */
+/*  sCycleCounter[Params] = nCycleMainCounter - sCycleCounter[Params]; */
+
+  cycles = Cycles_GetCounter(CYCLES_COUNTER_VIDEO);
+
+  /* has the frame refreshed? */
+  if(cycles < sCycleCounter[Params])
+  {  /* extend the frame... */
+    cycles += nScanlinesPerFrame*nCyclesPerLine;;
+  }
+
+  curr_cycles = cycles-sCycleCounter[Params];
+  fprintf(stderr,"Cnt #%d at %d : %d cycles (%d frames + %d cycles)\n",
+    Params,cycles,curr_cycles,curr_cycles/nCyclesPerLine,curr_cycles%nCyclesPerLine);
+  return(TRUE);
+}
+
+/**
+ * XBIOS Enter Hatari debug UI
+ * Call 251
+ * Parameters: none
+ */
+static bool XBios_DebugUI(Uint32 Params)
+{
+	DebugUI();
+	return(TRUE);
+}
 
 /*-----------------------------------------------------------------------*/
 /**
@@ -183,11 +330,10 @@
 {
 	Uint32 Params;
 	Uint16 XBiosCall;
-
 	/* Find call */
 	Params = Regs[REG_A7];
 	XBiosCall = STMemory_ReadWord(Params);
-
+	Log_Printf(LOG_DEBUG, "XBIOS %d\n",XBiosCall);
 	switch (XBiosCall)
 	{
 	 case 8:
@@ -206,6 +352,26 @@
 		HATARI_TRACE ( HATARI_TRACE_OS_XBIOS, "XBIOS Prtblk()\n" );
 		return XBios_Prtblk(Params);
 
+	/* DHS specific debug patches */
+	case 250:
+		HATARI_TRACE ( HATARI_TRACE_OS_XBIOS, "XBIOS DHS Registers()\n" );
+		return(XBios_Registers(Params));
+	case 251:
+		HATARI_TRACE ( HATARI_TRACE_OS_XBIOS, "XBIOS DHS DebugUI()\n" );
+		return(XBios_DebugUI(Params));
+	case 252:
+		HATARI_TRACE ( HATARI_TRACE_OS_XBIOS, "XBIOS DHS CounterRead()\n" );
+		return(XBios_CounterRead(Params));
+	case 253:
+		HATARI_TRACE ( HATARI_TRACE_OS_XBIOS, "XBIOS DHS CounterStart()\n" );
+		return(XBios_CounterStart(Params));
+	case 254:
+		HATARI_TRACE ( HATARI_TRACE_OS_XBIOS, "XBIOS DHS Debug()\n" );
+		return(XBios_Debug(Params));
+	case 255:
+		HATARI_TRACE ( HATARI_TRACE_OS_XBIOS, "XBIOS DHS HatariOption()\n" );
+		return(XBios_HatariOption(Params));
+			
 	 default:  /* Call as normal! */
 		HATARI_TRACE ( HATARI_TRACE_OS_XBIOS, "XBIOS %d\n", XBiosCall );
 		return FALSE;
Index: src/includes/debugui.h
===================================================================
RCS file: /cvsroot/hatari/hatari/src/includes/debugui.h,v
retrieving revision 1.3
diff -u -r1.3 debugui.h
--- src/includes/debugui.h	8 May 2008 20:41:29 -0000	1.3
+++ src/includes/debugui.h	26 Oct 2008 10:10:32 -0000
@@ -11,10 +11,13 @@
 /* DebugUI_ParseCommand() return values */
 enum {
 	DEBUG_QUIT,
-	DEBUG_CMD
+	DEBUG_CMD,
+	DEBUG_STEP
 };
 
 extern void DebugUI(void);
 extern int DebugUI_ParseCommand(char *input);
 
+extern bool bDebugStep;
+
 #endif /* HATARI_DEBUGUI_H */
Index: src/uae-cpu/newcpu.c
===================================================================
RCS file: /cvsroot/hatari/hatari/src/uae-cpu/newcpu.c,v
retrieving revision 1.60
diff -u -r1.60 newcpu.c
--- src/uae-cpu/newcpu.c	25 Oct 2008 22:31:54 -0000	1.60
+++ src/uae-cpu/newcpu.c	26 Oct 2008 10:10:32 -0000
@@ -908,7 +908,16 @@
 	    }
 	    if (bEnableDebug && BusErrorAddress!=0xff8a00) {
 	      fprintf(stderr,"Bus Error at address $%x, PC=$%lx\n", BusErrorAddress, (long)currpc);
-	      DebugUI();
+	      if(currpc == 0xe00406 ||
+		 currpc == 0xe0041e ||
+		 currpc == 0xe004c4 ||
+		 currpc == 0xe0058a ||
+		 currpc == 0xe029bc ||
+		 currpc == 0xe0290c ||
+		 currpc == 0x02f354)
+	         fprintf(stderr,"Ignoring: probably in TOS boot sequence!\n");
+	      else
+	        DebugUI();
 	    }
 	}
     }
@@ -1514,6 +1523,8 @@
 	int cycles;
 	uae_u32 opcode = get_iword_prefetch (0);
 
+	if(bDebugStep) DebugUI();
+
 #ifdef DEBUG_PREFETCH
 	if (get_ilong (0) != do_get_mem_long (&regs.prefetch)) {
 	    fprintf (stderr, "Prefetch differs from memory.\n");
@@ -1582,6 +1593,8 @@
 	int cycles;
 	uae_u32 opcode = get_iword (0);
 
+	if(bDebugStep) DebugUI();
+
 	/*m68k_dumpstate(stderr, NULL);*/
 	if ( HATARI_TRACE_LEVEL ( HATARI_TRACE_CPU_DISASM ) )
 	  {
