From 2507cab8a78fb609461a2b9cc4708bab60fc53a4 Mon Sep 17 00:00:00 2001 From: David 'Digit' Turner Date: Thu, 10 Feb 2011 16:29:17 +0100 Subject: Get rid of -android-gui core option. Instead, pass all LCD configuration in qemu-hardware.ini. + Make the latter file mandatory to launch a core. You can easily generate one by launching "emulator " though. Change-Id: I81a1938217562517e4c2bbb828aef934033c29a5 --- android/main-common.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) (limited to 'android/main-common.c') diff --git a/android/main-common.c b/android/main-common.c index bb07943..e11662c 100644 --- a/android/main-common.c +++ b/android/main-common.c @@ -341,6 +341,7 @@ void parse_skin_files(const char* skinDirPath, const char* skinName, AndroidOptions* opts, + AndroidHwConfig* hwConfig, AConfig* *skinConfig, char* *skinPath) { @@ -433,6 +434,53 @@ FOUND_SKIN: skin_network_delay = aconfig_str(n, "delay", 0); } + /* extract framebuffer information from the skin. + * + * for version 1 of the skin format, they are in the top-level + * 'display' element. + * + * for version 2 of the skin format, they are under parts.device.display + */ + n = aconfig_find(root, "display"); + if (n == NULL) { + n = aconfig_find(root, "parts"); + if (n != NULL) { + n = aconfig_find(root, "device"); + if (n != NULL) { + n = aconfig_find(root, "display"); + } + } + } + + if (n != NULL) { + int width = aconfig_int(n, "width", hwConfig->hw_lcd_width); + int height = aconfig_int(n, "height", hwConfig->hw_lcd_height); + int depth = aconfig_int(n, "bpp", hwConfig->hw_lcd_depth); + + if (width > 0 && height > 0) { + /* The emulated framebuffer wants sizes that are multiples of 4 */ + if (((width|height) & 3) != 0) { + width = (width+3) & ~3; + height = (height+3) & ~3; + D("adjusting LCD dimensions to (%dx%dx)", width, height); + } + + /* only depth values of 16 and 32 are correct. 16 is the default. */ + if (depth != 32 && depth != 16) { + depth = 16; + D("adjusting LCD bit depth to %d", depth); + } + + hwConfig->hw_lcd_width = width; + hwConfig->hw_lcd_height = height; + hwConfig->hw_lcd_depth = depth; + } + else { + D("ignoring invalid skin LCD dimensions (%dx%dx%d)", + width, height, depth); + } + } + *skinConfig = root; *skinPath = strdup(path); return; -- cgit v1.1