static emulator_config_info _emul_info;
-void set_emul_info_resolution(int width, int height)
+void set_emul_lcd_size(int width, int height)
{
_emul_info.resolution_w = width;
_emul_info.resolution_h = height;
INFO("emulator graphic resolution %dx%d\n", _emul_info.resolution_w, _emul_info.resolution_h);
}
-int get_emul_info_resolution_width(void)
+int get_emul_lcd_width(void)
{
return _emul_info.resolution_w;
}
-int get_emul_info_resolution_height(void)
+int get_emul_lcd_height(void)
{
return _emul_info.resolution_h;
}
/* setter */
-void set_emul_info_resolution(int width, int height);
+void set_emul_lcd_size(int width, int height);
/* getter */
-int get_emul_info_resolution_width(void);
-int get_emul_info_resolution_height(void);
+int get_emul_lcd_width(void);
+int get_emul_lcd_height(void);
#endif /* __EMUL_STATE_H__ */
#endif
}
-void maruskin_sdl_init(int swt_handle)
+void maruskin_sdl_init(int swt_handle, int lcd_size_width, int lcd_size_height)
{
gchar SDL_windowhack[32];
SDL_SysWMinfo info;
}
INFO( "qemu_sdl_initialize\n");
- surface_screen = SDL_SetVideoMode(480, 800,
+ surface_screen = SDL_SetVideoMode(lcd_size_width, lcd_size_height,
0, SDL_HWSURFACE | SDL_ASYNCBLIT | SDL_HWACCEL | SDL_NOFRAME);
+ set_emul_lcd_size(lcd_size_width, lcd_size_height);
#ifndef _WIN32
SDL_VERSION(&info.version);
#include <SDL_syswm.h>
void maruskin_display_init(DisplayState *ds);
-void maruskin_sdl_init(int swt_handle);
+void maruskin_sdl_init(int swt_handle, int lcd_size_width, int lcd_size_height);
#endif /* MARU_SDL_H_ */
short scale = config.getPropertyShort(PropertiesConstants.WINDOW_SCALE, Scale.HALF.value() );
short rotation = config.getPropertyShort( PropertiesConstants.WINDOW_DIRECTION, (short) 0 );
- sendToQEMU(SendCommand.SEND_START, new StartData(windowHandleId, scale, rotation));
+ sendToQEMU(SendCommand.SEND_START,
+ new StartData(windowHandleId,
+ Integer.parseInt( config.getArg(ArgsConstants.RESOLUTION_WIDTH) ),
+ Integer.parseInt( config.getArg(ArgsConstants.RESOLUTION_HEIGHT) ),
+ scale, rotation));
} catch (IOException e) {
e.printStackTrace();
public class StartData extends AbstractSendData {
private int windowHandleId;
+ private int lcdSizeWidth;
+ private int lcdSizeHeight;
private short scale;
private short rotation;
- public StartData(int windowHandleId, short scale, short rotation ) {
+ public StartData(int windowHandleId, int lcdSizeWidth, int lcdSizeHeight, short scale, short rotation ) {
this.windowHandleId = windowHandleId;
+ this.lcdSizeWidth = lcdSizeWidth;
+ this.lcdSizeHeight = lcdSizeHeight;
this.scale = scale;
this.rotation = rotation;
}
@Override
protected void write() throws IOException {
writeInt( windowHandleId );
+ writeInt( lcdSizeWidth );
+ writeInt( lcdSizeHeight );
writeShort( scale );
writeShort( rotation );
}
StringBuilder builder = new StringBuilder();
builder.append("StartData [windowHandleId=");
builder.append(windowHandleId);
+ builder.append(", lcd size " + lcdSizeWidth +"x" + lcdSizeHeight);
builder.append(", scale=");
builder.append(scale);
builder.append(", rotation=");
INFO( "start_display handle_id:%d, lcd size:%dx%d, scale:%d, rotation:%d\n",
handle_id, lcd_size_width, lcd_size_height, scale, rotation );
- maruskin_sdl_init(handle_id);
+ maruskin_sdl_init(handle_id, lcd_size_width, lcd_size_height);
}
void do_mouse_event( int event_type, int x, int y, int z ) {