OpenCores
URL https://opencores.org/ocsvn/or1k_old/or1k_old/trunk

Subversion Repositories or1k_old

[/] [or1k_old/] [trunk/] [mw/] [src/] [drivers/] [scr_debug.c] - Blame information for rev 1782

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 673 markom
/*
2
 * Copyright (c) 1999 Greg Haerr <greg@censoft.com>
3
 *
4
 * Experimental debug screen driver for Microwindows
5
 *
6
 * 21-Feb-2000 ajr@ecs.soton.ac.uk
7
 * Stripped down the VGA driver to make a debug driver so that I can debug the
8
 * rest of the code.
9
 *
10
 */
11
 
12
#include <stdio.h>
13
#include <stdlib.h>
14
#include "device.h"
15
#include "genfont.h"
16
#include "genmem.h"
17
 
18
/* DBG driver entry points*/
19
static PSD  DBG_open(PSD psd);
20
static void DBG_close(PSD psd);
21
static void DBG_getscreeninfo(PSD psd,PMWSCREENINFO psi);;
22
static void DBG_setpalette(PSD psd,int first,int count,MWPALENTRY *pal);
23
static void DBG_drawpixel(PSD psd,MWCOORD x, MWCOORD y, MWPIXELVAL c);
24
static MWPIXELVAL DBG_readpixel(PSD psd,MWCOORD x, MWCOORD y);
25
static void DBG_drawhline(PSD psd,MWCOORD x1, MWCOORD x2, MWCOORD y, MWPIXELVAL c);
26
static void DBG_drawvline(PSD psd,MWCOORD x,MWCOORD y1,MWCOORD y2,MWPIXELVAL c);
27
static void DBG_fillrect(PSD psd,MWCOORD x1,MWCOORD y1,MWCOORD x2,MWCOORD y2,
28
                MWPIXELVAL c);
29
void DBG_blit(PSD dstpsd, MWCOORD dstx, MWCOORD dsty, MWCOORD w, MWCOORD h,
30
                PSD srcpsd, MWCOORD srcx, MWCOORD srcy, long op);
31
 
32
SCREENDEVICE    scrdev = {
33
        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL,
34
        DBG_open,
35
        DBG_close,
36
        DBG_getscreeninfo,
37
        DBG_setpalette,
38
        DBG_drawpixel,
39
        DBG_readpixel,
40
        DBG_drawhline,
41
        DBG_drawvline,
42
        DBG_fillrect,
43
        gen_fonts,
44
        DBG_blit,
45
        NULL,                   /* PreSelect*/
46
        NULL,                   /* DrawArea subdriver*/
47
        NULL,                   /* SetIOPermissions*/
48
        gen_allocatememgc,
49
        NULL,                   /* MapMemGC*/
50
        NULL                    /* FreeMemGC*/
51
};
52
 
53
#define printd(_a)
54
 
55
static PSD
56
DBG_open(PSD psd)
57
{
58
        /* init driver variables depending on ega/vga mode*/
59
        psd->xres = psd->xvirtres = 640;
60
        psd->yres = psd->yvirtres = 480;
61
        psd->planes = 4;
62
        psd->bpp = 4;
63
        psd->ncolors = 16;
64
        psd->pixtype = MWPF_PALETTE;
65
        psd->flags = PSF_SCREEN;
66
 
67
        return psd;
68
}
69
 
70
static void
71
DBG_close(PSD psd)
72
{
73
        printd("DBG_close()\n");
74
}
75
 
76
static void
77
DBG_getscreeninfo(PSD psd,PMWSCREENINFO psi)
78
{
79
        psi->rows = psd->yvirtres;
80
        psi->cols = psd->xvirtres;
81
        psi->planes = psd->planes;
82
        psi->bpp = psd->bpp;
83
        psi->ncolors = psd->ncolors;
84
        psi->pixtype = psd->pixtype;
85
        psi->fonts = 1;
86
 
87
        /* DBG 640x480*/
88
        psi->xdpcm = 27;        /* assumes screen width of 24 cm*/
89
        psi->ydpcm = 27;        /* assumes screen height of 18 cm*/
90
        printd("DBG_getscreeninfo()\n");
91
}
92
 
93
static void
94
DBG_setpalette(PSD psd,int first,int count,MWPALENTRY *pal)
95
{
96
        printd("DBG_setpalette()\n");
97
}
98
 
99
static void
100
DBG_drawpixel(PSD psd,MWCOORD x, MWCOORD y, MWPIXELVAL c)
101
{
102
        printd("DBG_drawpixel()\n");
103
}
104
 
105
static MWPIXELVAL
106
DBG_readpixel(PSD psd,MWCOORD x, MWCOORD y)
107
{
108
        printd("DBG_readpixel()\n");
109
}
110
 
111
/* Draw horizontal line from x1,y to x2,y including final point*/
112
static void
113
DBG_drawhline(PSD psd,MWCOORD x1, MWCOORD x2, MWCOORD y, MWPIXELVAL c)
114
{
115
        printd("DBG_drawhline()\n");
116
}
117
 
118
/* Draw a vertical line from x,y1 to x,y2 including final point*/
119
static void
120
DBG_drawvline(PSD psd,MWCOORD x, MWCOORD y1, MWCOORD y2, MWPIXELVAL c)
121
{
122
        printd("DBG_drawvline()\n");
123
}
124
 
125
static void
126
DBG_fillrect(PSD psd,MWCOORD x1, MWCOORD y1, MWCOORD x2, MWCOORD y2,
127
        MWPIXELVAL c)
128
{
129
        printd("DBG_fillrect()\n");
130
}
131
 
132
void DBG_blit(PSD dstpsd, MWCOORD dstx, MWCOORD dsty, MWCOORD w, MWCOORD h,
133
        PSD srcpsd, MWCOORD srcx, MWCOORD srcy, long op)
134
{
135
        printd("DBG_blit()\n");
136
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.