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.7 by cebix, 2001-06-27T20:05:31Z vs.
Revision 1.8 by cebix, 2001-06-28T21:20:00Z

# Line 33 | Line 33 | enum video_depth {
33          VDEPTH_32BIT  // "Millions"
34   };
35  
36 + inline uint16 DepthToAppleMode(video_depth depth)
37 + {
38 +        return depth + 0x80;
39 + }
40 +
41 + inline video_depth AppleModeToDepth(uint16 mode)
42 + {
43 +        return video_depth(mode - 0x80);
44 + }
45 +
46   inline bool IsDirectMode(video_depth depth)
47   {
48          return depth == VDEPTH_16BIT || depth == VDEPTH_32BIT;
49   }
50  
51 < inline uint16 DepthToAppleMode(video_depth depth)
51 > inline bool IsDirectMode(uint16 mode)
52   {
53 <        return depth + 0x80;
53 >        return IsDirectMode(AppleModeToDepth(mode));
54   }
55  
56 < inline video_depth AppleModeToDepth(uint16 mode)
56 > inline video_depth DepthModeForPixelDepth(int depth)
57   {
58 <        return video_depth(mode - 0x80);
58 >        switch (depth) {
59 >                case 1: return VDEPTH_1BIT;
60 >                case 2: return VDEPTH_2BIT;
61 >                case 4: return VDEPTH_4BIT;
62 >                case 8: return VDEPTH_8BIT;
63 >                case 15: case 16: return VDEPTH_16BIT;
64 >                case 24: case 32: return VDEPTH_32BIT;
65 >                default: return VDEPTH_1BIT;
66 >        }
67 > }
68 >
69 > // Return a bytes-per-row value that assumes no padding for specified depth and pixel width
70 > inline uint32 TrivialBytesPerRow(uint32 width, video_depth depth)
71 > {
72 >        switch (depth) {
73 >                case VDEPTH_1BIT: return width / 8;
74 >                case VDEPTH_2BIT: return width / 4;
75 >                case VDEPTH_4BIT: return width / 2;
76 >                case VDEPTH_8BIT: return width;
77 >                case VDEPTH_16BIT: return width * 2;
78 >                case VDEPTH_32BIT: return width * 4;
79 >        }
80   }
81  
82   // Description of one video mode
# Line 63 | Line 94 | inline bool IsDirectMode(const video_mod
94   }
95  
96   // List of all supported video modes
97 < extern vector<video_mode> VideoModes;
97 > extern std::vector<video_mode> VideoModes;
98  
99   // Description for one (possibly virtual) monitor
100   struct monitor_desc {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines