ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

fw.c
Go to the documentation of this file.
00001 /*
00002  * PROJECT:         ReactOS Boot Loader
00003  * LICENSE:         BSD - See COPYING.ARM in the top level directory
00004  * FILE:            boot/armllb/fw.c
00005  * PURPOSE:         LLB Firmware Routines (accessible by OS Loader)
00006  * PROGRAMMERS:     ReactOS Portable Systems Group
00007  */
00008 
00009 #include "precomp.h"
00010 
00011 USHORT ColorPalette[16][3] =
00012 {
00013     {0x00, 0x00, 0x00},
00014     {0x00, 0x00, 0xAA},
00015     {0x00, 0xAA, 0x00},
00016     {0x00, 0xAA, 0xAA},
00017     {0xAA, 0x00, 0x00},
00018     {0xAA, 0x00, 0xAA},
00019     {0xAA, 0x55, 0x00},
00020     {0xAA, 0xAA, 0xAA},
00021     {0x55, 0x55, 0x55},
00022     {0x55, 0x55, 0xFF},
00023     {0x55, 0xFF, 0x55},
00024     {0x55, 0xFF, 0xFF},
00025     {0xFF, 0x55, 0x55},
00026     {0xFF, 0x55, 0xFF},
00027     {0xFF, 0xFF, 0x55},
00028     {0xFF, 0xFF, 0xFF},
00029 };
00030 
00031 VOID
00032 LlbFwPutChar(INT Ch)
00033 {
00034     /* Just call directly the video function */
00035     LlbVideoPutChar(Ch);
00036 
00037     /* DEBUG ONLY */
00038     LlbSerialPutChar(Ch);
00039 }
00040 
00041 BOOLEAN
00042 LlbFwKbHit(VOID)
00043 {
00044     /* Check RX buffer */
00045     return LlbHwKbdReady();
00046 }
00047 
00048 INT
00049 LlbFwGetCh(VOID)
00050 {
00051     /* Return the key pressed */
00052 #ifdef _ZOOM2_
00053     return LlbKeypadGetChar();
00054 #else
00055     return LlbKeyboardGetChar();
00056 #endif
00057 }
00058 
00059 ULONG
00060 LlbFwVideoSetDisplayMode(IN PCHAR DisplayModeName,
00061                          IN BOOLEAN Init)
00062 {
00063     /* Return text mode */
00064     return 0;
00065 }
00066 
00067 VOID
00068 LlbFwVideoGetDisplaySize(OUT PULONG Width,
00069                          OUT PULONG Height,
00070                          OUT PULONG Depth)
00071 {
00072     /* Query static settings */
00073     *Width = LlbHwGetScreenWidth() / 8;
00074     *Height = LlbHwGetScreenHeight() / 16;
00075     
00076     /* Depth is always 16 bpp */
00077     *Depth = 16;
00078 }
00079 
00080 VOID
00081 LlbFwVideoClearScreen(IN UCHAR Attr)
00082 {
00083     /* Clear the screen */
00084     LlbVideoClearScreen(TRUE);
00085 }
00086 
00087 VOID
00088 LlbFwVideoPutChar(IN INT c,
00089                   IN UCHAR Attr,
00090                   IN ULONG X,
00091                   IN ULONG Y)
00092 {
00093     ULONG Color, BackColor;
00094     PUSHORT Buffer;
00095     
00096     /* Convert EGA index to color used by hardware */
00097     Color = LlbHwVideoCreateColor(ColorPalette[Attr & 0xF][0],
00098                                   ColorPalette[Attr & 0xF][1],
00099                                   ColorPalette[Attr & 0xF][2]);
00100     BackColor = LlbHwVideoCreateColor(ColorPalette[Attr >> 4][0],
00101                                       ColorPalette[Attr >> 4][1],
00102                                       ColorPalette[Attr >> 4][2]);
00103                                       
00104     /* Compute buffer address */
00105     Buffer = (PUSHORT)LlbHwGetFrameBuffer() + (LlbHwGetScreenWidth() * (Y * 16)) + (X * 8);
00106                                       
00107     /* Draw it */
00108     LlbVideoDrawChar(c, Buffer, Color, BackColor);
00109 }
00110 
00111 
00112 TIMEINFO*
00113 LlbFwGetTime(VOID)
00114 {
00115     /* Call existing function */
00116     return LlbGetTime();
00117 }
00118 
00119 /* EOF */

Generated on Sat May 26 2012 04:17:46 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.