[OpenBIOS] [PATCH 03/20] packages: rename video.c to molvideo.c ready for MOL-specific video routines

Mark Cave-Ayland mark.cave-ayland at ilande.co.uk
Sat Jun 15 10:38:41 CEST 2013


While we are here, remove the INSTALL_OPEN flag since this is now handled by
is-install (removing the "open is not unique" warning on the serial console
during startup).

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland at ilande.co.uk>
---
 openbios-devel/packages/build.xml  |    2 +-
 openbios-devel/packages/molvideo.c |   97 ++++++++++++++++++++++++++++++++++++
 openbios-devel/packages/video.c    |   90 ---------------------------------
 3 files changed, 98 insertions(+), 91 deletions(-)
 create mode 100644 openbios-devel/packages/molvideo.c
 delete mode 100644 openbios-devel/packages/video.c

diff --git a/openbios-devel/packages/build.xml b/openbios-devel/packages/build.xml
index fded77c..0384c41 100644
--- a/openbios-devel/packages/build.xml
+++ b/openbios-devel/packages/build.xml
@@ -11,7 +11,7 @@
   <object source="nvram.c"/>
   <object source="pc-parts.c" condition="PC_PARTS"/>
   <object source="sun-parts.c" condition="SUN_PARTS"/>
-  <object source="video.c"/>
+  <object source="molvideo.c"/>
   <object source="xcoff-loader.c" condition="LOADER_XCOFF"/>
  </library>
 
diff --git a/openbios-devel/packages/molvideo.c b/openbios-devel/packages/molvideo.c
new file mode 100644
index 0000000..0e37cb5
--- /dev/null
+++ b/openbios-devel/packages/molvideo.c
@@ -0,0 +1,97 @@
+/*
+ *   Creation Date: <2002/10/23 20:26:40 samuel>
+ *   Time-stamp: <2004/01/07 19:39:15 samuel>
+ *
+ *	<video.c>
+ *
+ *	Mac-on-Linux display node
+ *
+ *   Copyright (C) 2002, 2003, 2004 Samuel Rydh (samuel at ibrium.se)
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation
+ *
+ */
+
+#include "config.h"
+#include "libopenbios/bindings.h"
+#include "libc/diskio.h"
+#include "libopenbios/ofmem.h"
+#include "drivers/drivers.h"
+#include "packages/video.h"
+#include "libopenbios/video.h"
+#include "libopenbios/console.h"
+#include "drivers/vga.h"
+
+
+/************************************************************************/
+/*	OF methods							*/
+/************************************************************************/
+
+DECLARE_NODE( video, 0, 0, "Tdisplay" );
+
+/* ( -- width height ) (?) */
+static void
+molvideo_dimensions( void )
+{
+	int w, h;
+	(void) video_get_res( &w, &h );
+	PUSH( w );
+	PUSH( h );
+}
+
+/* ( table start count -- ) (?) */
+static void
+molvideo_set_colors( void )
+{
+	int count = POP();
+	int start = POP();
+	unsigned char *p = (unsigned char*)cell2pointer(POP());
+	int i;
+
+	for( i=0; i<count; i++, p+=3 ) {
+		unsigned long col = (p[0] << 16) | (p[1] << 8) | p[2];
+		set_color( i + start, col );
+	}
+	refresh_palette();
+}
+
+/* ( r g b index -- ) */
+static void
+molvideo_color_bang( void )
+{
+	int index = POP();
+	int b = POP();
+	int g = POP();
+	int r = POP();
+	unsigned long col = ((r << 16) & 0xff0000) | ((g << 8) & 0x00ff00) | (b & 0xff);
+	/* printk("color!: %08lx %08lx %08lx %08lx\n", r, g, b, index ); */
+	set_color( index, col );
+	refresh_palette();
+}
+
+/* ( color_ind x y width height -- ) (?) */
+static void
+molvideo_fill_rect ( void )
+{
+	video_fill_rect();
+}
+
+NODE_METHODS( video ) = {
+	{"dimensions",		molvideo_dimensions	},
+	{"set-colors",		molvideo_set_colors	},
+	{"fill-rectangle",	molvideo_fill_rect	},
+	{"color!",		molvideo_color_bang	},
+};
+
+
+/************************************************************************/
+/*	init 								*/
+/************************************************************************/
+
+void
+molvideo_init(void)
+{
+	REGISTER_NODE( video );
+}
diff --git a/openbios-devel/packages/video.c b/openbios-devel/packages/video.c
deleted file mode 100644
index 99f0c3f..0000000
--- a/openbios-devel/packages/video.c
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- *   Creation Date: <2002/10/23 20:26:40 samuel>
- *   Time-stamp: <2004/01/07 19:39:15 samuel>
- *
- *	<video.c>
- *
- *	Mac-on-Linux display node
- *
- *   Copyright (C) 2002, 2003, 2004 Samuel Rydh (samuel at ibrium.se)
- *
- *   This program is free software; you can redistribute it and/or
- *   modify it under the terms of the GNU General Public License
- *   as published by the Free Software Foundation
- *
- */
-
-#include "config.h"
-#include "libopenbios/bindings.h"
-#include "libc/diskio.h"
-#include "libopenbios/ofmem.h"
-#include "drivers/drivers.h"
-#include "packages/video.h"
-#include "libopenbios/video.h"
-#include "libopenbios/console.h"
-#include "drivers/vga.h"
-
-
-/************************************************************************/
-/*	OF methods							*/
-/************************************************************************/
-
-DECLARE_NODE( video, INSTALL_OPEN, 0, "Tdisplay" );
-
-/* ( -- width height ) (?) */
-static void
-video_dimensions( void )
-{
-	int w, h;
-	(void) video_get_res( &w, &h );
-	PUSH( w );
-	PUSH( h );
-}
-
-/* ( table start count -- ) (?) */
-static void
-video_set_colors( void )
-{
-	int count = POP();
-	int start = POP();
-	unsigned char *p = (unsigned char*)cell2pointer(POP());
-	int i;
-
-	for( i=0; i<count; i++, p+=3 ) {
-		unsigned long col = (p[0] << 16) | (p[1] << 8) | p[2];
-		set_color( i + start, col );
-	}
-	refresh_palette();
-}
-
-/* ( r g b index -- ) */
-static void
-video_color_bang( void )
-{
-	int index = POP();
-	int b = POP();
-	int g = POP();
-	int r = POP();
-	unsigned long col = ((r << 16) & 0xff0000) | ((g << 8) & 0x00ff00) | (b & 0xff);
-	/* printk("color!: %08lx %08lx %08lx %08lx\n", r, g, b, index ); */
-	set_color( index, col );
-	refresh_palette();
-}
-
-NODE_METHODS( video ) = {
-	{"dimensions",		video_dimensions	},
-	{"set-colors",		video_set_colors	},
-	{"fill-rectangle",	video_fill_rect		},
-	{"color!",		video_color_bang	},
-};
-
-
-/************************************************************************/
-/*	init 								*/
-/************************************************************************/
-
-void
-molvideo_init(void)
-{
-	REGISTER_NODE( video );
-}
-- 
1.7.10.4




More information about the OpenBIOS mailing list