-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdisplay.h
98 lines (70 loc) · 3.41 KB
/
display.h
1
2
3
4
5
6
7
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
/* display.h: Routines for printing the Spectrum's screen
Copyright (c) 1999-2006 Philip Kendall
$Id: display.h 2889 2007-05-26 17:45:08Z zubzero $
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Author contact information:
E-mail: [email protected]
*/
#ifndef FUSE_DISPLAY_H
#define FUSE_DISPLAY_H
#include <stddef.h>
#include <libspectrum.h>
/* The width and height of the Speccy's screen */
#define DISPLAY_WIDTH_COLS 32
#define DISPLAY_HEIGHT_ROWS 24
/* The width and height of the Speccy's screen */
/* Each main screen column can produce 16 pixels in hires mode */
#define DISPLAY_WIDTH ( DISPLAY_WIDTH_COLS * 16 )
/* Each main screen row can produce only 8 pixels in any mode */
#define DISPLAY_HEIGHT ( DISPLAY_HEIGHT_ROWS * 8 )
/* The width and height of the (emulated) border */
#define DISPLAY_BORDER_WIDTH_COLS 4
#define DISPLAY_BORDER_HEIGHT_COLS 3
/* The width and height of the (emulated) border */
/* Each main screen column can produce 16 pixels in hires mode */
#define DISPLAY_BORDER_WIDTH ( DISPLAY_BORDER_WIDTH_COLS * 16 )
/* Aspect corrected border width */
#define DISPLAY_BORDER_ASPECT_WIDTH ( DISPLAY_BORDER_WIDTH_COLS * 8 )
/* Each main screen row can produce only 8 pixels in any mode */
#define DISPLAY_BORDER_HEIGHT ( DISPLAY_BORDER_HEIGHT_COLS * 8 )
/* The width and height of the window we'll be displaying */
#define DISPLAY_SCREEN_WIDTH ( DISPLAY_WIDTH + 2 * DISPLAY_BORDER_WIDTH )
#define DISPLAY_SCREEN_HEIGHT ( DISPLAY_HEIGHT + 2 * DISPLAY_BORDER_HEIGHT )
/* And the width in columns */
#define DISPLAY_SCREEN_WIDTH_COLS ( DISPLAY_WIDTH_COLS + 2 * DISPLAY_BORDER_WIDTH_COLS )
/* The aspect ratio corrected display width */
#define DISPLAY_ASPECT_WIDTH ( DISPLAY_SCREEN_WIDTH / 2 )
extern int display_ui_initialised;
extern libspectrum_byte display_lores_border;
extern libspectrum_byte display_hires_border;
/* Offsets as to where the data and the attributes for each pixel
line start */
extern libspectrum_word display_line_start[ DISPLAY_HEIGHT ];
extern libspectrum_word display_attr_start[ DISPLAY_HEIGHT ];
int display_init(int *argc, char ***argv);
void display_line(void);
void display_dirty( libspectrum_word offset );
void display_parse_attr( libspectrum_byte attr, libspectrum_byte *ink,
libspectrum_byte *paper );
void display_set_lores_border(int colour);
void display_set_hires_border(int colour);
int display_dirty_border(void);
int display_frame(void);
void display_refresh_main_screen(void);
void display_refresh_all(void);
#define display_get_addr( x, y ) \
scld_last_dec.name.altdfile ? display_line_start[(y)]+(x)+ALTDFILE_OFFSET : \
display_line_start[(y)]+(x)
int display_getpixel( int x, int y );
void display_update_critical( int x, int y );
#endif /* #ifndef FUSE_DISPLAY_H */