vidmodes.h 3.73 KB
Newer Older
1
/* $Id: vidmodes.h,v 1.33 2020/06/27 00:04:45 deuce Exp $ */
2

deuce's avatar
deuce committed
3 4 5 6
/****************************************************************************
 * @format.tab-size 4		(Plain Text/Source Code File Header)			*
 * @format.use-tabs true	(see http://www.synchro.net/ptsc_hdr.html)		*
 *																			*
7
 * Copyright Rob Swindell - http://www.synchro.net/copyright.html			*
deuce's avatar
deuce committed
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
 *																			*
 * This library is free software; you can redistribute it and/or			*
 * modify it under the terms of the GNU Lesser General Public License		*
 * as published by the Free Software Foundation; either version 2			*
 * of the License, or (at your option) any later version.					*
 * See the GNU Lesser General Public License for more details: lgpl.txt or	*
 * http://www.fsf.org/copyleft/lesser.html									*
 *																			*
 * Anonymous FTP access to the most recent released source is available at	*
 * ftp://vert.synchro.net, ftp://cvs.synchro.net and ftp://ftp.synchro.net	*
 *																			*
 * Anonymous CVS access to the development source and modification history	*
 * is available at cvs.synchro.net:/cvsroot/sbbs, example:					*
 * cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs login			*
 *     (just hit return, no password is necessary)							*
 * cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs checkout src		*
 *																			*
 * For Synchronet coding style and modification guidelines, see				*
 * http://www.synchro.net/source.html										*
 *																			*
 * You are encouraged to submit any modifications (preferably in Unix diff	*
 * format) via e-mail to mods@synchro.net									*
 *																			*
 * Note: If this box doesn't appear square, then you need to fix your tabs.	*
 ****************************************************************************/
33

34 35 36
#ifndef _VIDMODES_H_
#define _VIDMODES_H_

37 38 39 40 41 42 43
#if (defined CIOLIB_IMPORTS)
 #undef CIOLIB_IMPORTS
#endif
#if (defined CIOLIB_EXPORTS)
 #undef CIOLIB_EXPORTS
#endif

44 45
#include "ciolib.h"

46
#define TOTAL_DAC_SIZE	274
47 48 49 50 51 52 53 54

/* Entry type for the DAC table. */
struct dac_colors {
	unsigned char red;
	unsigned char green;
	unsigned char blue;
};

55 56
struct  video_params {
	int	mode;
57
	int palette;
58 59 60 61 62 63
	int	cols;
	int rows;
	int	curs_start;
	int curs_end;
	int charheight;
	int charwidth;
64 65
	int	default_attr;
	int	flags;
66 67
	int	aspect_width;
	int	aspect_height;
68 69
	int	xres;
	int	yres;
70 71
};

deuce's avatar
deuce committed
72 73
struct vstat_vmem {
	unsigned refcount;
74
	struct vmem_cell *vmem;
deuce's avatar
deuce committed
75 76
};

77 78 79 80 81 82 83
struct video_stats {
	int rows;
	int cols;
	int curs_row;
	int curs_col;
	int curs_start;
	int curs_end;
deuce's avatar
deuce committed
84
	int curs_blinks;
85
	int curs_visible;
86 87 88 89 90
	int default_curs_start;
	int default_curs_end;
	int mode;
	int charheight;
	int charwidth;
91
	int bright_background;
92
	int blink;
93
	int curs_blink;
94
	int no_bright;
95
	int no_blink;
96
	int bright_altcharset;
97
	int blink_altcharset;
98 99
	int currattr;
	int scaling;
100 101
	int scrnwidth;
	int scrnheight;
deuce's avatar
deuce committed
102 103
	int winwidth;
	int winheight;
104 105
	int aspect_width;
	int aspect_height;
106
	uint32_t flags;
Deucе's avatar
Deucе committed
107 108 109
#define VIDMODES_FLAG_PALETTE_VMEM         1
#define VIDMODES_FLAG_EXPAND               2
#define VIDMODES_FLAG_LINE_GRAPHICS_EXPAND 4
110
	uint32_t palette[16];
deuce's avatar
deuce committed
111
	struct vstat_vmem *vmem;
112
	uint8_t *forced_font;
113 114
};

115 116 117 118
enum {
	 MONO_PALETTE
	,GREYSCALE_PALETTE
	,COLOUR_PALETTE
119
	,C64_PALETTE
deuce's avatar
deuce committed
120
	,ATARI_PALETTE
121
};
deuce's avatar
deuce committed
122

123
extern struct video_params vparams[56];
124
#define NUMMODES      (sizeof(vparams) / sizeof(struct video_params))
125
extern uint32_t palettes[5][16];
126
extern struct dac_colors dac_default[TOTAL_DAC_SIZE];
127 128 129
extern char vga_font_bitmap[4096];
extern char vga_font_bitmap14[3584];
extern char vga_font_bitmap8[2048];
deuce's avatar
deuce committed
130

131 132 133 134
#ifdef __cplusplus
extern "C" {
#endif
int find_vmode(int mode);
deuce's avatar
deuce committed
135 136
struct vstat_vmem *get_vmem(struct video_stats *vs);
void release_vmem(struct vstat_vmem *vm);
137 138
int load_vmode(struct video_stats *vs, int mode);
#ifdef __cplusplus
deuce's avatar
deuce committed
139
}
140
#endif
deuce's avatar
deuce committed
141

142
#endif