ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/BasiliskII/src/include/video.h
(Generate patch)

Comparing BasiliskII/src/include/video.h (file contents):
Revision 1.9 by cebix, 2001-07-01T00:46:38Z vs.
Revision 1.12 by cebix, 2001-07-03T19:20:47Z

# Line 23 | Line 23
23  
24   #include <vector>
25  
26 + #ifndef NO_STD_NAMESPACE
27 + using std::vector;
28 + #endif
29 +
30   /*
31     Some of the terminology here is completely frelled. In Basilisk II, a
32     "video mode" refers to a combination of resolution and color depth, and
# Line 51 | Line 55 | enum video_depth {
55          VDEPTH_32BIT  // "Millions"
56   };
57  
58 < inline uint16 DepthToAppleMode(video_depth depth)
59 < {
60 <        return depth + 0x80;
61 < }
58 > // For compatibility reasons with older (pre-Display Manager) versions of
59 > // MacOS, the Apple modes must start at 0x80 and be contiguous. Therefore
60 > // we construct an array to map the depth codes to the corresponding Apple
61 > // mode. This array is initialized by video_init_depth_list() which must
62 > // be called by the platform-dependant VideoInit() routine after filling
63 > // the VideoModes array.
64 > extern uint16 apple_mode_for_depth[6];
65  
66 < inline video_depth AppleModeToDepth(uint16 mode)
66 > inline uint16 DepthToAppleMode(video_depth depth)
67   {
68 <        return video_depth(mode - 0x80);
68 >        return apple_mode_for_depth[depth];
69   }
70  
71   inline bool IsDirectMode(video_depth depth)
# Line 66 | Line 73 | inline bool IsDirectMode(video_depth dep
73          return depth == VDEPTH_16BIT || depth == VDEPTH_32BIT;
74   }
75  
69 inline bool IsDirectMode(uint16 mode)
70 {
71        return IsDirectMode(AppleModeToDepth(mode));
72 }
73
76   // Return the depth code that corresponds to the specified bits-per-pixel value
77   inline video_depth DepthModeForPixelDepth(int depth)
78   {
# Line 95 | Line 97 | inline uint32 TrivialBytesPerRow(uint32
97                  case VDEPTH_8BIT: return width;
98                  case VDEPTH_16BIT: return width * 2;
99                  case VDEPTH_32BIT: return width * 4;
100 +                default: return width;
101          }
102   }
103  
# Line 141 | Line 144 | inline bool IsDirectMode(const video_mod
144   }
145  
146   // List of all supported video modes
147 < extern std::vector<video_mode> VideoModes;
147 > extern vector<video_mode> VideoModes;
148  
149   // Description for one (possibly virtual) monitor
150   struct monitor_desc {
# Line 170 | Line 173 | extern void video_switch_to_mode(const v
173  
174   // Called by the video driver to set the color palette (in indexed modes)
175   // or gamma table (in direct modes)
176 < extern void video_set_palette(uint8 *pal);
176 > extern void video_set_palette(uint8 *pal, int num);
177 >
178 > // Check whether a mode with the specified depth exists
179 > extern bool video_has_depth(video_depth depth);
180 >
181 > // Get bytes-per-row value for specified resolution/depth
182 > extern uint32 video_bytes_per_row(video_depth depth, uint32 id);
183 >
184 > // Initialize apple_mode_for_depth[] array from VideoModes list
185 > extern void video_init_depth_list(void);
186  
187   #endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines