Category : Alternate Operating Systems - Quarterdeck DesqView, CP/M, etc
Archive   : PCCAPP.ZIP
Filename : COUNT.CC

 
Output of file : COUNT.CC contained in archive : PCCAPP.ZIP
/*
* This file is part of the Choices Operating System
* Developed by: The TAPESTRY Parallel Computing Laboratory
* University of Illinois at Urbana-Champaign
* Department of Computer Science
* 1304 W. Springfield Ave.
* Urbana, IL 61801
*
* Copyright (c) 1987, 1988, 1989, 1990, 1991, 1992
* The University of Illinois Board of Trustees.
* All Rights Reserved.
*
* Author: Lee Lup Yuen ([email protected])
* Project Manager and Principal Investigator: Roy Campbell ([email protected])
*
* Funded by: NSF TAPESTRY Grant No. 1-5-30035, NASA ICLASS Grant
* No. 1-5-25469 and No. NSG1471 and AT&T Metronet Grant No. 1-5-37411.
*
* Permission to use, copy, modify, and distribute this software and
* its documentation for educational, research, and non-profit purposes
* is hereby granted provided that the above copyright notice, the
* original authors names, and this permission notice appear in all such
* copies and supporting documentation; that no charge be made for such
* copies; and that the name of the University of Illinois not be used
* in advertising or publicity pertaining to distribution of the
* software without specific prior written permission. Any entity
* desiring permission to incorporate this software into commercial
* products should contact the Computing Research Laboratory, Department
* of Computer Science, University of Illinois, 1304 W. Springfield
* Avenue, Urbana, IL 61801. The University of Illinois makes no
* representations about the suitability of this software for any
* purpose. It is provided "as is" without express or implied warranty.
*/

#include "TimeoutTimer.h"
#include "TimeoutTimerStar.h"

// These are bitmaps for the 10 digits drawn with "bitmap". d0_bits to
// d9_bits are raster arrays defined in these files.
#include "Bitmaps/d0.xbm"
#include "Bitmaps/d1.xbm"
#include "Bitmaps/d2.xbm"
#include "Bitmaps/d3.xbm"
#include "Bitmaps/d4.xbm"
#include "Bitmaps/d5.xbm"
#include "Bitmaps/d6.xbm"
#include "Bitmaps/d7.xbm"
#include "Bitmaps/d8.xbm"
#include "Bitmaps/d9.xbm"

static char *digits [] = {d0_bits, d1_bits, d2_bits, d3_bits, d4_bits, d5_bits,
d6_bits, d7_bits, d8_bits, d9_bits};

void plotDigit (int i, unsigned char colour);
void plot (int row, int col, unsigned char colour);

int main (int, char **)
{
// Flash the digits 9 - 0 on the screen.
TimeoutTimerStar timer = new TimeoutTimer;
// Number of microseconds to wait between digits.
const delay = 5 * 1000000;
for (int i = 9; i >= 0; i--)
{
// Show digit i.
plotDigit (i, 0x70);
// Wait a while.
timer -> start (delay);
timer -> await ();
// Erase digit i.
plotDigit (i, 0x7);
}
}

void plotDigit (int i, unsigned char colour)
{
// Plot digit i on the screen with that colour.
for (int row = 0; row <= 19; row++)
for (int col = 0; col <= 4; col++)
{
unsigned char b = (unsigned char) digits [i][row * 5 + col];
for (int j = 0; j <= 7; j++)
{
if (b % 2) plot (row + 1, col * 8 + j + 20, colour);
b = b / 2;
}
}
}

void plot (int row, int col, unsigned char colour)
{
// Plot a box at row,col with that colour.
unsigned char *screen = (unsigned char *) 0xb8000;
screen [row * 160 + col * 2 + 1] = colour;
}



  3 Responses to “Category : Alternate Operating Systems - Quarterdeck DesqView, CP/M, etc
Archive   : PCCAPP.ZIP
Filename : COUNT.CC

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/