+//==========================================================================
+//
+
+void
+printVBEModeInfo()
+{
+ VBEInfoBlock vbeInfo;
+ unsigned short * modePtr;
+ VBEModeInfoBlock modeInfo;
+ int err;
+ int line;
+
+ err = getVBEInfo( &vbeInfo );
+ if ( err != errSuccess )
+ return;
+
+ line = 0;
+
+ // Activate and clear page 1
+ setActiveDisplayPage(1);
+ clearScreenRows(0, 24);
+ setCursorPosition( 0, 0, 1 );
+
+ printVBEInfo();
+ printf("Video modes supported:\n", VBEDecodeFP(const char *, vbeInfo.OEMStringPtr));
+
+ // Loop through the mode list, and find the matching mode.
+
+ for ( modePtr = VBEDecodeFP( unsigned short *, vbeInfo.VideoModePtr );
+ *modePtr != modeEndOfList; modePtr++ )
+ {
+ // Get mode information.
+
+ bzero( &modeInfo, sizeof(modeInfo) );
+ err = getVBEModeInfo( *modePtr, &modeInfo );
+ if ( err != errSuccess )
+ {
+ continue;
+ }
+
+ printf("Mode %x: %dx%dx%d mm:%d attr:%x\n",
+ *modePtr, modeInfo.XResolution, modeInfo.YResolution,
+ modeInfo.BitsPerPixel, modeInfo.MemoryModel,
+ modeInfo.ModeAttributes);
+
+ if (line++ >= 20) {
+ printf("(Press a key to continue...)");
+ getc();
+ line = 0;
+ clearScreenRows(0, 24);
+ setCursorPosition( 0, 0, 1 );
+ }
+ }
+ if (line != 0) {
+ printf("(Press a key to continue...)");
+ getc();
+ }
+ setActiveDisplayPage(0);
+}
+
+