46 |
|
APPLE_32_BIT |
47 |
|
}; |
48 |
|
|
49 |
+ |
// 1, 2, 4 and 8 bit depths use a color palette |
50 |
+ |
inline bool IsDirectMode(int mode) |
51 |
+ |
{ |
52 |
+ |
return mode == APPLE_16_BIT || mode == APPLE_32_BIT; |
53 |
+ |
} |
54 |
+ |
|
55 |
+ |
// Return the depth code that corresponds to the specified bits-per-pixel value |
56 |
+ |
inline int DepthModeForPixelDepth(int depth) |
57 |
+ |
{ |
58 |
+ |
switch (depth) { |
59 |
+ |
case 1: return APPLE_1_BIT; |
60 |
+ |
case 2: return APPLE_2_BIT; |
61 |
+ |
case 4: return APPLE_4_BIT; |
62 |
+ |
case 8: return APPLE_8_BIT; |
63 |
+ |
case 15: case 16: return APPLE_16_BIT; |
64 |
+ |
case 24: case 32: return APPLE_32_BIT; |
65 |
+ |
default: return APPLE_1_BIT; |
66 |
+ |
} |
67 |
+ |
} |
68 |
+ |
|
69 |
+ |
// Return a bytes-per-row value (assuming no padding) for the specified depth and pixel width |
70 |
+ |
inline uint32 TrivialBytesPerRow(uint32 width, int mode) |
71 |
+ |
{ |
72 |
+ |
switch (mode) { |
73 |
+ |
case APPLE_1_BIT: return width / 8; |
74 |
+ |
case APPLE_2_BIT: return width / 4; |
75 |
+ |
case APPLE_4_BIT: return width / 2; |
76 |
+ |
case APPLE_8_BIT: return width; |
77 |
+ |
case APPLE_16_BIT: return width * 2; |
78 |
+ |
case APPLE_32_BIT: return width * 4; |
79 |
+ |
default: return width; |
80 |
+ |
} |
81 |
+ |
} |
82 |
+ |
|
83 |
|
enum { // viAppleID |
84 |
|
APPLE_640x480 = 0x81, |
85 |
|
APPLE_W_640x480, |
86 |
|
APPLE_800x600, |
87 |
|
APPLE_W_800x600, |
88 |
|
APPLE_1024x768, |
89 |
+ |
APPLE_1152x768, |
90 |
|
APPLE_1152x900, |
91 |
|
APPLE_1280x1024, |
92 |
|
APPLE_1600x1200, |
138 |
|
|
139 |
|
extern void video_set_palette(void); |
140 |
|
extern void video_set_cursor(void); |
141 |
+ |
extern bool video_can_change_cursor(void); |
142 |
|
extern int16 video_mode_change(VidLocals *csSave, uint32 ParamPtr); |
143 |
|
|
144 |
|
extern int16 VSLDoInterruptService(uint32 arg1); |
145 |
|
extern void NQDMisc(uint32 arg1, void *arg2); |
146 |
|
|
147 |
+ |
// Native QuickDraw acceleration callbacks |
148 |
+ |
extern bool NQD_sync_hook(uint32); |
149 |
+ |
extern bool NQD_bitblt_hook(uint32); |
150 |
+ |
extern bool NQD_fillrect_hook(uint32); |
151 |
+ |
extern void NQD_bitblt(uint32); |
152 |
+ |
extern void NQD_invrect(uint32); |
153 |
+ |
extern void NQD_fillrect(uint32); |
154 |
+ |
|
155 |
|
extern bool keyfile_valid; |
156 |
|
|
157 |
|
#endif |