]> git.saurik.com Git - apple/xnu.git/blobdiff - osfmk/console/panic_dialog.c
xnu-792.13.8.tar.gz
[apple/xnu.git] / osfmk / console / panic_dialog.c
index 3489a53d2277b6819bc9ec4fa7da3111f00620e7..aaa6974f9432841c58488704e843f0ff5b9a2688 100644 (file)
@@ -30,6 +30,7 @@
 
 #include <vc.h>
 #include <console/video_console.h>
+#include <libkern/OSByteOrder.h>
 #include <kdp/kdp_udp.h>
 #include <kern/debug.h>
 #include <mach/mach_time.h>
@@ -525,9 +526,9 @@ blit_digit( int digit )
                for( j=FONT_WIDTH-1; j>=0; j--) {
 
                        if ( bits & 0x80 )
-                               rendered_font[row][j] = 0x0100 | panic_dialog->pd_info_color[0];
+                               rendered_font[row][j] = OSSwapBigToHostInt16(0x0100 | panic_dialog->pd_info_color[0]);
                        else
-                               rendered_font[row][j] = 0x0100 | panic_dialog->pd_info_color[1];
+                               rendered_font[row][j] = OSSwapBigToHostInt16(0x0100 | panic_dialog->pd_info_color[1]);
                        bits <<= 1;
                }
        }
@@ -886,16 +887,16 @@ findbestgray( unsigned int color24 )
 static unsigned char
 color24togray8( unsigned int color24 )
 {       
-    float R, G, B;
-    float Gray;
+    int R, G, B;
+    int Gray;
     unsigned char gray8;
     
     R = (color24 & 0xFF0000) >> 16 ;
     G = (color24 & 0xFF00) >> 8 ;
     B = (color24 & 0xFF);
     
-    Gray = (R*.30) + (G*.59) + (B*.11);
-    gray8 = (unsigned char) ( Gray + .5);
+    Gray = (R*30) + (G*59) + (B*11);
+    gray8 = (unsigned char) ((Gray + 50) / 100);
     return gray8;
 }