From: Christian B. <cb...@th...> - 2002-03-15 15:43:20
|
Hi! Sorry for the delay, but I never seem to have the ShapeShifter source at hand when I need it... On Thu, Mar 07, 2002 at 01:01:25PM +1100, Nigel Pearson wrote: > 2) If we ever augment B2 to support more than one monitor, > the monitor_desc structure would need to have a list > of video_modes supported by that monitor. Now would be a good time to do that augmentation. Here's a draft: - struct video_mode remains as it is now - the global VideoModes vector is removed - struct monitor_desc gets transformed into an abstract base class: class monitor_desc { public: monitor_desc() { slot_id = next_slot_id++; } virtual ~monitor_desc() {} // Get Mac frame buffer base address uint32 get_mac_frame_base(void) const {return mac_frame_base;} // Get bytes-per-row value for specified resolution/depth uint32 get_bytes_per_row(video_depth depth, uint32 id) const; // Get Mac slot ID number uint8 get_slot_id(void) const {return slot_id;} // Get current video mode const video_mode ¤t_mode(void) const {return *current_mode;} // Check whether a mode with the specified depth exists on this display bool has_depth(video_depth depth) const; // Switch video mode on this display virtual void switch_to_mode(const video_mode &mode) = 0; // Set palette or gamma table virtual void set_palette(uint8 *pal, int num) = 0; // List of supported video modes vector<video_mode> modes; // Maybe some utility routines from video.cpp should be moved here as // well, such as get_size_of_resolution(). Practically anything that // used the VideoModes vector. ... protected: // Pointer (iterator?) to currently active mode video_mode *current_mode; // Mac frame buffer base uint32 mac_frame_base; // Mac slot ID number uint8 slot_id; // Next available slot ID static uint8 next_slot_id = 0x80; }; - platform-specific code subclasses monitor_desc (e.g. X11_monitor_desc, or even X11_DGA_monitor_desc; this could replace the driver_base class in video_x.cpp), implementing the virtual functions - the global VideoMonitor variable gets replaced by a vector<monitor_desc *> which is filled in by VideoInit() - I'm not sure whether the apple_mode_for_depth[] array needs to be global or local to each monitor (my guess is local). This array and associated functions (video_init_depth_list(), DepthToAppleMode()) would then have to be moved to monitor_desc as well. - for UAE banked addressing, we need multiple MacFrameBaseHost/MacFrameSize variables - slot.cpp needs to create one slot resource for each monitor, using the slot_id in the monitor_desc - the Mac video driver code can determine the monitor_desc its associated with by looking at its dCtlSlotId and scanning the monitor_desc vector (or maybe it would be better to have a map<uint8, monitor_desc *>?) Any comments/ideas? Bye, Christian -- / Coding on PowerPC and proud of it \/ http://www.uni-mainz.de/~bauec002/ |