summaryrefslogtreecommitdiffstats
path: root/uisimulator/x11
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2005-10-23 13:06:25 +0000
committerJens Arnold <amiconn@rockbox.org>2005-10-23 13:06:25 +0000
commitfc03c8e3c9a4067beccda3303236044d970d336b (patch)
tree87fea06b8b554f6583bec4946de5bcd986a48562 /uisimulator/x11
parentbdf558ca53f293aa112c36b7662a092abdc9f5d5 (diff)
downloadrockbox-fc03c8e3c9a4067beccda3303236044d970d336b.tar.gz
rockbox-fc03c8e3c9a4067beccda3303236044d970d336b.tar.bz2
rockbox-fc03c8e3c9a4067beccda3303236044d970d336b.zip
X11 simulator: Fixed margins and scaling (window zoom) for all simulated targets.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7654 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'uisimulator/x11')
-rw-r--r--uisimulator/x11/lcd-x11.c11
-rw-r--r--uisimulator/x11/screenhack.c33
-rw-r--r--uisimulator/x11/uibasic.c10
3 files changed, 17 insertions, 37 deletions
diff --git a/uisimulator/x11/lcd-x11.c b/uisimulator/x11/lcd-x11.c
index 3ad5a79ec7..4a7dbc6bf3 100644
--- a/uisimulator/x11/lcd-x11.c
+++ b/uisimulator/x11/lcd-x11.c
@@ -131,8 +131,7 @@ void lcd_update_rect(int x_start, int y_start,
extern unsigned char lcd_remote_framebuffer[LCD_REMOTE_HEIGHT/8][LCD_REMOTE_WIDTH];
unsigned char lcd_remote_framebuffer_copy[LCD_REMOTE_HEIGHT/8][LCD_REMOTE_WIDTH];
-#define REMOTE_MARGIN_X 2
-#define REMOTE_MARGIN_Y (LCD_HEIGHT + 2 + MARGIN_Y)
+#define REMOTE_START_Y (LCD_HEIGHT + 2*MARGIN_Y)
void lcd_remote_update (void)
{
@@ -181,15 +180,15 @@ void lcd_remote_update_rect(int x_start, int y_start,
if(lcd_remote_framebuffer[yline][x]&(1<<bit)) {
/* set a dot */
colors[p]=3;
- points[p].x = x + REMOTE_MARGIN_X;
- points[p].y = y+bit + REMOTE_MARGIN_Y;
+ points[p].x = x + MARGIN_X;
+ points[p].y = y+bit + (REMOTE_START_Y + MARGIN_Y);
p++; /* increase the point counter */
}
else if(diff &(1<<bit)) {
/* clear a dot */
colors[p]=0;
- points[p].x = x + REMOTE_MARGIN_X;
- points[p].y = y+bit + REMOTE_MARGIN_Y;
+ points[p].x = x + MARGIN_X;
+ points[p].y = y+bit + (REMOTE_START_Y + MARGIN_Y);
p++; /* increase the point counter */
}
}
diff --git a/uisimulator/x11/screenhack.c b/uisimulator/x11/screenhack.c
index 6c08da7123..3ad14428a9 100644
--- a/uisimulator/x11/screenhack.c
+++ b/uisimulator/x11/screenhack.c
@@ -53,6 +53,7 @@
#else
# include "xmu.h"
#endif
+#include "lcd-x11.h"
#include "screenhack.h"
#include "version.h"
#include "vroot.h"
@@ -147,13 +148,7 @@ static XrmOptionDescRec default_options [] = {
static char *default_defaults[] = {
".root: false",
#define GEOMETRY_POSITION 1
- "*geometry: "
-#ifdef HAVE_LCD_BITMAP
- "120x68"
-#else
- "280x132" /* A bit larger that necessary */
-#endif
- , /* this should be .geometry, but nooooo... */
+ "*geometry: 120x68", /* to be replaced anyway */
"*mono: false",
"*installColormap: false",
"*visualID: default",
@@ -415,24 +410,15 @@ int main (int argc, char **argv)
if (!strcmp("--old_lcd", argv[x])) {
having_new_lcd=FALSE;
printf("Using old LCD layout.\n");
- } else if (!strcmp("--recorder_zoom", argv[x])) {
- x++;
-#ifdef HAVE_LCD_BITMAP
- display_zoom=atoi(argv[x]);
- printf("Window zoom is %d\n", display_zoom);
-#endif
- } else if (!strcmp("--player_zoom", argv[x])) {
+ } else if (!strcmp("--zoom", argv[x])) {
x++;
-#ifndef HAVE_LCD_BITMAP
display_zoom=atoi(argv[x]);
printf("Window zoom is %d\n", display_zoom);
-#endif
} else {
printf("rockboxui\n");
printf("Arguments:\n");
printf(" --old_lcd \t [Player] simulate old playermodel (ROM version<4.51)\n");
- printf(" --player_zoom \t [Player] window zoom\n");
- printf(" --recorder_zoom \t [Recorder] window zoom\n");
+ printf(" --zoom \t window zoom\n");
printf(KEYBOARD_GENERIC KEYBOARD_SPECIFIC);
exit(0);
}
@@ -440,18 +426,13 @@ int main (int argc, char **argv)
}
{
static char geometry[40];
-#ifdef HAVE_LCD_BITMAP
- unsigned int height = LCD_HEIGHT;
+ unsigned int height = (LCD_HEIGHT+2*MARGIN_Y);
#ifdef LCD_REMOTE_HEIGHT
- height += LCD_REMOTE_HEIGHT;
+ height += (LCD_REMOTE_HEIGHT+2*MARGIN_Y);
#endif
printf("height: %d\n", height);
snprintf(geometry, 40, "*geometry: %dx%d",
- LCD_WIDTH*display_zoom+14, height*display_zoom+8);
-#else
- snprintf(geometry, 40, "*geometry: %dx%d", 280*display_zoom,
- 132*display_zoom);
-#endif
+ (LCD_WIDTH+2*MARGIN_X) * display_zoom, height * display_zoom);
default_defaults[GEOMETRY_POSITION]=geometry;
}
printf(KEYBOARD_GENERIC KEYBOARD_SPECIFIC);
diff --git a/uisimulator/x11/uibasic.c b/uisimulator/x11/uibasic.c
index 2228e3b038..40389e946e 100644
--- a/uisimulator/x11/uibasic.c
+++ b/uisimulator/x11/uibasic.c
@@ -252,8 +252,8 @@ void screen_redraw()
/* draw a border around the screen */
#define X1 0
#define Y1 0
-#define X2 (LCD_WIDTH + MARGIN_X*2)
-#define Y2 (LCD_HEIGHT + MARGIN_Y)
+#define X2 (LCD_WIDTH + 2*MARGIN_X - 1)
+#define Y2 (LCD_HEIGHT + 2*MARGIN_Y - 1)
drawline(1, X1, Y1, X2, Y1);
drawline(1, X2, Y1, X2, Y2);
@@ -263,9 +263,9 @@ void screen_redraw()
#ifdef LCD_REMOTE_HEIGHT
/* draw a border around the remote LCD screen */
#define RX1 0
-#define RY1 (Y2 +1)
-#define RX2 (LCD_REMOTE_WIDTH + MARGIN_X*2)
-#define RY2 (Y2 + 1 + LCD_REMOTE_HEIGHT)
+#define RY1 (Y2 + 1)
+#define RX2 (LCD_REMOTE_WIDTH + 2*MARGIN_X - 1)
+#define RY2 (RY1 + LCD_REMOTE_HEIGHT + 2*MARGIN_Y - 1)
drawline(1, RX1, RY1, RX2, RY1);
drawline(1, RX2, RY1, RX2, RY2);