More work on UDI, Added more Login VTerms
[tpg/acess2.git] / Kernel / debug.c
index f78ea01..ea30379 100644 (file)
@@ -2,7 +2,7 @@
  * AcessOS Microkernel Version
  * debug.c
  */
-#include <common.h>
+#include <acess.h>
 #include <stdarg.h>
 
 #define DEBUG_TO_E9    1
@@ -56,7 +56,7 @@ void E9_Fmt(const char *format, va_list *args)
        char    *p = NULL;
         int    isLongLong = 0;
        Uint64  arg;
-  
+       
        while((c = *format++) != 0)
        {
                // Non control character
@@ -152,7 +152,18 @@ void E9_Fmt(const char *format, va_list *args)
                        if(!p)          p = "(null)";
                        while(*p)       E9(*p++);
                        break;
-                       
+               
+               // Single Character / Array
+               case 'c':
+                       if(minSize == 1) {
+                               E9(arg);
+                               break;
+                       }
+                       p = (char*)(Uint)arg;
+                       if(!p)  goto printString;
+                       while(minSize--)        E9(*p++);
+                       break;
+               
                default:        E9(arg);        break;
                }
     }
@@ -223,7 +234,7 @@ void Debug_SetKTerminal(char *File)
        if(giDebug_KTerm != -1)
                VFS_Close(giDebug_KTerm);
        giDebug_KTerm = VFS_Open(File, VFS_OPENFLAG_WRITE);
-       Log("Opened '%s' as %i\n", File, giDebug_KTerm);
+       Log("Opened '%s' as 0x%x", File, giDebug_KTerm);
 }
 
 void Debug_Enter(char *FuncName, char *ArgTypes, ...)
@@ -294,6 +305,10 @@ void Debug_Leave(char *FuncName, char RetType, ...)
        
        va_start(args, RetType);
        
+       if( i == -1 ) {
+               gDebug_Level = 0;
+               i = 0;
+       }
        // Indenting
        while(i--)      E9(' ');
        

UCC git Repository :: git.ucc.asn.au