summaryrefslogtreecommitdiffstats
path: root/sys/modules/syscons/star
diff options
context:
space:
mode:
authoryokota <yokota@FreeBSD.org>1999-01-11 03:18:56 +0000
committeryokota <yokota@FreeBSD.org>1999-01-11 03:18:56 +0000
commitae16d918a316eb60407be875de416efb373a652f (patch)
tree114e5de93fcbb59a8cff261d560719502d115314 /sys/modules/syscons/star
parentf24a0f863faf18c039916001f2cc71561fc29b38 (diff)
downloadFreeBSD-src-ae16d918a316eb60407be875de416efb373a652f.zip
FreeBSD-src-ae16d918a316eb60407be875de416efb373a652f.tar.gz
The first stage of console driver reorganization: activate new
keyboard and video card drivers. Because of the changes, you are required to update your kernel configuration file now! The files in sys/dev/syscons are still i386-specific (but less so than before), and won't compile for alpha and PC98 yet. syscons still directly accesses the video card registers here and there; this will be rectified in the later stages.
Diffstat (limited to 'sys/modules/syscons/star')
-rw-r--r--sys/modules/syscons/star/star_saver.c45
1 files changed, 24 insertions, 21 deletions
diff --git a/sys/modules/syscons/star/star_saver.c b/sys/modules/syscons/star/star_saver.c
index 719d502..ca4b588 100644
--- a/sys/modules/syscons/star/star_saver.c
+++ b/sys/modules/syscons/star/star_saver.c
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: star_saver.c,v 1.16 1998/09/17 19:40:30 sos Exp $
+ * $Id: star_saver.c,v 1.17 1998/11/04 03:49:39 peter Exp $
*/
#include <sys/param.h>
@@ -41,13 +41,14 @@
#define NUM_STARS 50
static u_short *window;
+static int blanked;
/*
* Alternate saver that got its inspiration from a well known utility
* package for an inferior^H^H^H^H^H^Hfamous OS.
*/
-static void
-star_saver(int blank)
+static int
+star_saver(video_adapter_t *adp, int blank)
{
scr_stat *scp = cur_console;
int cell, i;
@@ -57,15 +58,15 @@ star_saver(int blank)
static u_short stars[NUM_STARS][2];
if (blank) {
- if (!ISTEXTSC(scp))
- return;
- if (scrn_blanked <= 0) {
- scp->status |= SAVER_RUNNING;
- window = (u_short *)(*biosvidsw.adapter)(scp->adp)->va_window;
- scrn_blanked = 1;
- fillw((FG_LIGHTGREY|BG_BLACK)<<8|scr_map[0x20], window,
- scp->xsize * scp->ysize);
+ if (adp->va_mode_flags & V_INFO_GRAPHICS)
+ return ENODEV;
+ if (!blanked) {
+ window = (u_short *)adp->va_window;
+ /* clear the screen and set the border color */
+ fillw(((FG_LIGHTGREY|BG_BLACK) << 8) | scr_map[0x20],
+ window, scp->xsize * scp->ysize);
set_border(scp, 0);
+ blanked = TRUE;
for(i=0; i<NUM_STARS; i++) {
stars[i][0] =
random() % (scp->xsize*scp->ysize);
@@ -82,24 +83,26 @@ star_saver(int blank)
}
}
else {
- if (scrn_blanked > 0) {
- set_border(scp, scp->border);
- scrn_blanked = 0;
- scp->status &= ~SAVER_RUNNING;
- }
+ blanked = FALSE;
}
+ return 0;
}
static int
-star_saver_load(void)
+star_init(video_adapter_t *adp)
{
- return add_scrn_saver(star_saver);
+ blanked = FALSE;
+ return 0;
}
static int
-star_saver_unload(void)
+star_term(video_adapter_t *adp)
{
- return remove_scrn_saver(star_saver);
+ return 0;
}
-SAVER_MODULE(star_saver);
+static scrn_saver_t star_module = {
+ "star_saver", star_init, star_term, star_saver, NULL,
+};
+
+SAVER_MODULE(star_saver, star_module);
OpenPOWER on IntegriCloud