diff options
-rw-r--r-- | android/main.c | 16 | ||||
-rw-r--r-- | android/qemulator.c | 16 | ||||
-rw-r--r-- | android/qemulator.h | 4 |
3 files changed, 36 insertions, 0 deletions
diff --git a/android/main.c b/android/main.c index 51ef6d7..944d6ad 100644 --- a/android/main.c +++ b/android/main.c @@ -1296,5 +1296,21 @@ int main(int argc, char **argv) /* Setup SDL UI just before calling the code */ init_sdl_ui(skinConfig, skinPath, opts); + /* HACK: Do not merge this back to master, the following should + * only be used for the tools_r11 emulator binary. + */ +#ifndef CONFIG_STANDALONE_CORE + { + char temp[64]; + + snprintf(temp, sizeof temp, "width=%d,height=%d,bpp=16", + qemulator_get_lcd_width(), + qemulator_get_lcd_height()); + + args[n++] = "-android-gui"; + args[n++] = strdup(temp); + } +#endif + return qemu_main(n, args); } diff --git a/android/qemulator.c b/android/qemulator.c index ee9ccbb..2dedf57 100644 --- a/android/qemulator.c +++ b/android/qemulator.c @@ -213,6 +213,22 @@ qemulator_get_first_framebuffer(QEmulator* emulator) return NULL; } +int +qemulator_get_lcd_width(void) +{ + QEmulator* emulator = qemulator_get(); + QFrameBuffer* qfb = qemulator_get_first_framebuffer(emulator); + return qfb ? qfb->width : 640; +} + +int +qemulator_get_lcd_height(void) +{ + QEmulator* emulator = qemulator_get(); + QFrameBuffer* qfb = qemulator_get_first_framebuffer(emulator); + return qfb ? qfb->height : 480; +} + void qemulator_set_title(QEmulator* emulator) { diff --git a/android/qemulator.h b/android/qemulator.h index 189cc53..9e88a5d 100644 --- a/android/qemulator.h +++ b/android/qemulator.h @@ -66,6 +66,10 @@ qemulator_get_layout( QEmulator* emulator ); QFrameBuffer* qemulator_get_first_framebuffer(QEmulator* emulator); +/* Temporary hacks for hw/goldfish_events_device.c */ +int qemulator_get_lcd_width(void); +int qemulator_get_lcd_height(void); + /* A helper routine for getting device DPI. */ int get_device_dpi( AndroidOptions* opts ); |