Modules/FAT - Slight cleanup
[tpg/acess2.git] / KernelLand / Kernel / drv / vterm_font.c
index 841ea50..cb2702d 100644 (file)
@@ -132,6 +132,18 @@ void VT_Font_Render(Uint32 Codepoint, void *Buffer, int Depth, int Pitch, Uint32
        }
 }
 
+Uint16 VT_Colour24to12(Uint32 Col24)
+{
+       Uint16  ret = 0;
+       
+       for( int i = 0; i < 3; i ++ )
+       {
+               Uint32  comp = (Col24 >> (i*8)) & 0xFF;
+               ret |= ((comp * 15) / 255) << (i*4);
+       }
+       return ret;
+}
+
 /**
  * \fn Uint32 VT_Colour12to24(Uint16 Col12)
  * \brief Converts a 12-bit colour into 24 bits
@@ -167,7 +179,7 @@ Uint16 VT_Colour12to15(Uint16 Col12)
 /**
  * \brief Converts a 12-bit colour into any other depth
  * \param Col12        12-bit source colour
- * \param Depth        Desired bit deptj
+ * \param Depth        Desired bit depth
  * \note Green then blue get the extra avaliable bits (16:5-6-5, 14:4-5-5)
  */
 Uint32 VT_Colour12toN(Uint16 Col12, int Depth)

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