[ros-diffs] [arty] 23765: Menu displays. Need stdin/hid objects.

arty at svn.reactos.org arty at svn.reactos.org
Tue Aug 29 09:16:16 CEST 2006


Author: arty
Date: Tue Aug 29 11:16:16 2006
New Revision: 23765

URL: http://svn.reactos.org/svn/reactos?rev=23765&view=rev
Log:
Menu displays.
Need stdin/hid objects.

Modified:
    branches/powerpc/reactos/boot/freeldr/freeldr/arch/powerpc/mach.c

Modified: branches/powerpc/reactos/boot/freeldr/freeldr/arch/powerpc/mach.c
URL: http://svn.reactos.org/svn/reactos/branches/powerpc/reactos/boot/freeldr/freeldr/arch/powerpc/mach.c?rev=23765&r1=23764&r2=23765&view=diff
==============================================================================
--- branches/powerpc/reactos/boot/freeldr/freeldr/arch/powerpc/mach.c (original)
+++ branches/powerpc/reactos/boot/freeldr/freeldr/arch/powerpc/mach.c Tue Aug 29 11:16:16 2006
@@ -30,6 +30,7 @@
 BOOLEAN AcpiPresent = FALSE;
 char BootPath[0x100] = { 0 }, BootPart[0x100] = { 0 }, CmdLine[0x100] = { 0 };
 jmp_buf jmp;
+char *video_mem = 0;
 
 void le_swap( void *start_addr_v, 
               void *end_addr_v, 
@@ -107,26 +108,29 @@
     ofw_print_string("ClearScreen\n");
 }
 
-VIDEODISPLAYMODE PpcVideoSetDisplayMode( char *DisplayMode, BOOLEAN Init ) {
-    printf( "DisplayMode: %s %s\n", DisplayMode, Init ? "true" : "false" );
-    return VideoGraphicsMode;
-}
-
-/* FIXME: Query */
 VOID PpcVideoGetDisplaySize( PULONG Width, PULONG Height, PULONG Depth ) {
-    ofw_print_string("GetDisplaySize\n");
-    *Width = 640;
-    *Height = 480;
-    *Depth = 8;
+    //ofw_print_string("GetDisplaySize\n");
+    *Width = 80;
+    *Height = 25;
+    *Depth = 16;
+    //printf("GetDisplaySize(%d,%d,%d)\n", *Width, *Height, *Depth);
 }
 
 ULONG PpcVideoGetBufferSize() {
     ULONG Width, Height, Depth;
-    ofw_print_string("PpcVideoGetBufferSize\n");
+    //ofw_print_string("PpcVideoGetBufferSize\n");
     PpcVideoGetDisplaySize( &Width, &Height, &Depth );
     return Width * Height * Depth / 8;
 }
 
+VIDEODISPLAYMODE PpcVideoSetDisplayMode( char *DisplayMode, BOOLEAN Init ) {
+    //printf( "DisplayMode: %s %s\n", DisplayMode, Init ? "true" : "false" );
+    if( Init && !video_mem ) {
+	video_mem = MmAllocateMemory( PpcVideoGetBufferSize() );
+    }
+    return VideoTextMode;
+}
+
 VOID PpcVideoSetTextCursorPosition( ULONG X, ULONG Y ) {
     printf("SetTextCursorPosition(%d,%d)\n", X,Y);
 }
@@ -140,7 +144,22 @@
 }
 
 VOID PpcVideoCopyOffScreenBufferToVRAM( PVOID Buffer ) {
-    printf( "CopyOffScreenBufferToVRAM(%x)\n", Buffer );
+    int i,j;
+    ULONG w,h,d;
+    PCHAR ChBuf = Buffer;
+    int offset = 0;
+
+    PpcVideoGetDisplaySize( &w, &h, &d );
+
+    for( i = 0; i < h; i++ ) {
+	for( j = 0; j < w; j++ ) {
+	    offset = (j * 2) + (i * w * 2);
+	    if( ChBuf[offset] != video_mem[offset] ) {
+		video_mem[offset] = ChBuf[offset];
+		PpcVideoPutChar(ChBuf[offset],0,j+1,i+1);
+	    }
+	}
+    }
 }
 
 BOOLEAN PpcVideoIsPaletteFixed() {
@@ -294,7 +313,7 @@
 
 VOID PpcRTCGetCurrentDateTime( PULONG Hear, PULONG Month, PULONG Day, 
                                PULONG Hour, PULONG Minute, PULONG Second ) {
-    printf("RTCGeturrentDateTime\n");
+    //printf("RTCGeturrentDateTime\n");
 }
 
 VOID PpcHwDetect() {




More information about the Ros-diffs mailing list