fork of PCE focusing on macplus, supporting DaynaPort SCSI network emulation
1/*****************************************************************************
2 * pce *
3 *****************************************************************************/
4
5/*****************************************************************************
6 * File name: src/arch/macplus/video.h *
7 * Created: 2007-04-16 by Hampa Hug <hampa@hampa.ch> *
8 * Copyright: (C) 2007-2012 Hampa Hug <hampa@hampa.ch> *
9 *****************************************************************************/
10
11/*****************************************************************************
12 * This program is free software. You can redistribute it and / or modify it *
13 * under the terms of the GNU General Public License version 2 as published *
14 * by the Free Software Foundation. *
15 * *
16 * This program is distributed in the hope that it will be useful, but *
17 * WITHOUT ANY WARRANTY, without even the implied warranty of *
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General *
19 * Public License for more details. *
20 *****************************************************************************/
21
22
23#ifndef PCE_MACPLUS_VIDEO_H
24#define PCE_MACPLUS_VIDEO_H 1
25
26
27#include <drivers/video/terminal.h>
28
29
30typedef struct {
31 const unsigned char *vbuf;
32
33 unsigned long vbuf_addr;
34 unsigned long vbuf_size;
35 char dirty;
36
37 unsigned w;
38 unsigned h;
39
40 unsigned long hfreq;
41 unsigned long vfreq;
42 unsigned long vb1;
43 unsigned long vb2;
44
45 char force;
46
47 unsigned cmp_cnt;
48
49 unsigned char *vcmp;
50
51 unsigned char *rgb;
52
53 unsigned brightness;
54 unsigned char col0[3];
55 unsigned char col1[3];
56
57 unsigned long clk;
58
59 terminal_t *trm;
60
61 unsigned char vbi_val;
62 void *vbi_ext;
63 void (*set_vbi) (void *ext, unsigned char val);
64} mac_video_t;
65
66
67int mac_video_init (mac_video_t *mv, unsigned w, unsigned h);
68mac_video_t *mac_video_new (unsigned w, unsigned h);
69
70void mac_video_free (mac_video_t *mv);
71void mac_video_del (mac_video_t *mv);
72
73void mac_video_set_vbi_fct (mac_video_t *mv, void *ext, void *fct);
74
75void mac_video_set_vbuf (mac_video_t *mv, const unsigned char *vbuf);
76void mac_video_set_vbuf_addr (mac_video_t *mv, unsigned long addr, unsigned long size);
77void mac_video_set_dirty (mac_video_t *mv);
78void mac_video_set_terminal (mac_video_t *mv, terminal_t *trm);
79
80/*****************************************************************************
81 * @short Set the video color
82 * @param col0 The background color
83 * @param col1 The foreground color
84 *****************************************************************************/
85void mac_video_set_color (mac_video_t *mv, unsigned long col0, unsigned long col1);
86
87/*****************************************************************************
88 * @short Set the video brightness
89 * @param val The brightness in the range 0 - 255.
90 *****************************************************************************/
91void mac_video_set_brightness (mac_video_t *mv, unsigned val);
92
93void mac_video_redraw (mac_video_t *mv);
94
95void mac_video_clock (mac_video_t *mv, unsigned long cnt);
96
97
98#endif