From 81c66ced7dfc99cf8723140ea7931c7cce910b89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= Date: Thu, 10 Jan 2008 22:16:40 +0000 Subject: [PATCH] Video mode menu and support stubs. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23363 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/boot/platform/atari_m68k/video.cpp | 135 ++++++++++++++++++ src/system/boot/platform/atari_m68k/video.h | 18 +++ 2 files changed, 153 insertions(+) create mode 100644 src/system/boot/platform/atari_m68k/video.cpp create mode 100644 src/system/boot/platform/atari_m68k/video.h diff --git a/src/system/boot/platform/atari_m68k/video.cpp b/src/system/boot/platform/atari_m68k/video.cpp new file mode 100644 index 0000000000..3e36ae12f1 --- /dev/null +++ b/src/system/boot/platform/atari_m68k/video.cpp @@ -0,0 +1,135 @@ +/* + * Copyright 2004-2007, Axel Dörfler, axeld@pinc-software.de. + * Distributed under the terms of the MIT License. + */ + + +#include "video.h" +//#include "mmu.h" +#include "images.h" + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + + +//#define TRACE_VIDEO +#ifdef TRACE_VIDEO +# define TRACE(x) dprintf x +#else +# define TRACE(x) ; +#endif + + +// XXX: use falcon video monitor detection and build possible mode list there... + + +// #pragma mark - + + +bool +video_mode_hook(Menu *menu, MenuItem *item) +{ + // nothing yet +#if 0 + // find selected mode + video_mode *mode = NULL; + + menu = item->Submenu(); + item = menu->FindMarked(); + if (item != NULL) { + switch (menu->IndexOf(item)) { + case 0: + // "Default" mode special + sMode = sDefaultMode; + sModeChosen = false; + return true; + case 1: + // "Standard VGA" mode special + // sets sMode to NULL which triggers VGA mode + break; + default: + mode = (video_mode *)item->Data(); + break; + } + } + + if (mode != sMode) { + // update standard mode + // ToDo: update fb settings! + sMode = mode; + } + + sModeChosen = true; +#endif + return true; +} + + +Menu * +video_mode_menu() +{ + Menu *menu = new(nothrow) Menu(CHOICE_MENU, "Select Video Mode"); + MenuItem *item; + + menu->AddItem(item = new(nothrow) MenuItem("Default")); + item->SetMarked(true); + item->Select(true); + item->SetHelpText("The Default video mode is the one currently configured " + "in the system. If there is no mode configured yet, a viable mode will " + "be chosen automatically."); + +#if 0 + menu->AddItem(new(nothrow) MenuItem("Standard VGA")); + + video_mode *mode = NULL; + while ((mode = (video_mode *)list_get_next_item(&sModeList, mode)) != NULL) { + char label[64]; + sprintf(label, "%ux%u %u bit", mode->width, mode->height, + mode->bits_per_pixel); + + menu->AddItem(item = new(nothrow) MenuItem(label)); + item->SetData(mode); + } +#endif + + menu->AddSeparatorItem(); + menu->AddItem(item = new(nothrow) MenuItem("Return to main menu")); + item->SetType(MENU_ITEM_NO_CHOICE); + + return menu; +} + + +// #pragma mark - + + +extern "C" void +platform_switch_to_logo(void) +{ + // ToDo: implement me +} + + +extern "C" void +platform_switch_to_text_mode(void) +{ + // ToDo: implement me +} + + +extern "C" status_t +platform_init_video(void) +{ + // ToDo: implement me + return B_OK; +} + diff --git a/src/system/boot/platform/atari_m68k/video.h b/src/system/boot/platform/atari_m68k/video.h new file mode 100644 index 0000000000..37cd88782c --- /dev/null +++ b/src/system/boot/platform/atari_m68k/video.h @@ -0,0 +1,18 @@ +/* +** Copyright 2004, Axel Dörfler, axeld@pinc-software.de. All rights reserved. +** Distributed under the terms of the Haiku License. +*/ +#ifndef VIDEO_H +#define VIDEO_H + + +#include + + +class Menu; +class MenuItem; + +bool video_mode_hook(Menu *menu, MenuItem *item); +Menu *video_mode_menu(); + +#endif /* VIDEO_H */