--- margi2/cvdv.c 2001/01/31 14:19:02 1.4 +++ margi2/cvdv.c 2001/02/01 14:47:33 1.5 @@ -53,6 +53,46 @@ void rnd_omize(void) rnd_seed = (u16) jiffies; } +static char *cimlogo[] = { +".............................................", +".............................................", +"......................###....................", +".....................#####...................", +".....................######..................", +"..............#......#####...................", +"...........#####....######...................", +".........########...######...................", +"........########....######...................", +".......#########...######....................", +"......########.....######...####.............", +".....#######.......#####...#####.............", +".....######.......######...######............", +"....#######.......######....######...........", +"....######........######....######...........", +"....#####........######......#####...........", +"...######........######......#####...........", +"...#####.........######......######..........", +"...#####.........#####.......######..........", +"...#####........######........#####..........", +"...#####........######.......######..........", +"...#####........#####.........#####..........", +"...#####.......######........######..........", +"...#####.......######........#####...........", +"...######.......####.........#####...........", +"....#####........##.........######...........", +"....######..................######...........", +"....######.................######............", +".....#######..............######.....#####...", +".....########............#######....#######..", +"......#########........########.....#######..", +".......#######################......########.", +"........#####################.......#######..", +"..........#################.........#######..", +"............#############............#####...", +"...............#.#####.................##....", +".............................................", +"............................................." +}; ///////////////////////////////////////////// // // @@ -62,77 +102,25 @@ void rnd_omize(void) int OSDTest(struct cvdv_cards *card) { - int i, j, x, y, col, xpos, ypos, x0, y0, x1, y1, aspx, aspy, width, - height; - u8 row[130]; + int i, j, col, x0, y0, x1, y1,aspx; + u8 b; + if (!card->OSD.open) return -2; - //VideoSetBackground(card,2,83,90,249); // Red - //VideoSetBackground(card,2,155,53,53); // Green - //VideoSetBackground(card,2,35,212,114); // Blue - //VideoSetBackground(card,2,4,128,128); // Black - OSDQuery(card, &x0, &y0, &x1, &y1, &aspx); - aspy = 11; - width = 130; - height = width * aspy / aspx; - xpos = ((x1 - x0 + 1) - width) / 2; - ypos = ((y1 - y0 + 1) - height) / 2; - OSDShow(card); - - OSDSetColor(card, 0, 0, 0, 0, 1, 0, 1); // transparent background - for (i = 0; i < 2; i++) { - for (j = 0; j < 8; j++) { - col = 1 + i * 8 + j; - OSDSetColor(card, col, (j & 2) ? 192 : 0, - (j & 4) ? 192 : 0, (j & 1) ? 192 : 0, - 1, i, 0); - } - } - -// for (x=1; x<=16; x++) { -// OSDFill(card,x); -// } -// OSDClear(card); - - for (i = 0; i < 2; i++) { - for (j = 0; j < 8; j++) { - col = 1 + i * 8 + j; - for (x = 0; x < 16; x++) - row[1 + x + j * 16] = col; - } - for (y = 0; y < (height - 2) / 2; y++) { - OSDSetRow(card, xpos, - ypos + 1 + y + i * ((height - 2) / 2), - xpos + width - 1, row); + OSDSetColor(card, 0, 0, 0, 0, 0, 0, 0); + OSDSetColor(card, 1, 128, 255, 255, 0, 0, 0); + for ( i = 0; i < cimlogo_width; i++){ + for ( j = 0; j < cimlogo_height; j++){ + b = cimlogo[j][i]; + col = (b == '#') ? 1: 0; + OSDSetPixel(card, x0+i, y0+j, col); } } - OSDFillRow(card, xpos, ypos, xpos + width - 1, 8); - OSDFillRow(card, xpos, ypos + height - 1, xpos + width - 1, 8); - for (y = ypos; y < ypos + height; y++) { - OSDSetPixel(card, xpos, y, 8); - OSDSetPixel(card, xpos + width - 1, y, 8); - } - for (x = 0; x < 130; x++) { - OSDSetPixel(card, x + xpos, x * aspy / aspx + ypos, 8); - OSDSetPixel(card, width - x + xpos, x * aspy / aspx + ypos, - 8); - OSDSetPixel(card, x + xpos, - (x >> 3) + ypos + ((height / 2) - 8), 8); - } - OSDLine(card, x0, y0, x1, y0, 8); - OSDLine(card, x1, y0, x1, y1, 8); - OSDLine(card, x1, y1, x0, y1, 8); - OSDLine(card, x0, y1, x0, y0, 8); - OSDLine(card, x0, y0, x1, y1, 8); - OSDLine(card, x0, y1, x1, y0, 8); - -// OSDShow(card); - return 0; } @@ -893,7 +881,7 @@ static int PSopen(struct inode *inode, s if (card != NULL) { printk(KERN_DEBUG LOGNAME ": -- PSopen %d\n",channel); CloseCard(card); - + OSDClose(card); if (card->open[channel]) printk(KERN_DEBUG LOGNAME ": PSopen - already open: channel %d\n",