}
/* emulator rotation */
-void set_emul_rotation(int rotation)
+void set_emul_rotation(short rotation)
{
_emul_state.rotation = rotation;
INFO("emulator rotation = %d\n", _emul_state.rotation);
}
-int get_emul_rotation(void)
+short get_emul_rotation(void)
{
return _emul_state.rotation;
}
typedef struct emulator_config_state {
int scale;
- int rotation;
+ short rotation;
//TODO:
} emulator_config_state;
/* setter */
void set_emul_lcd_size(int width, int height);
void set_emul_win_scale(int scale);
-void set_emul_rotation(int scale);
+void set_emul_rotation(short scale);
/* getter */
int get_emul_lcd_width(void);
int get_emul_lcd_height(void);
int get_emul_win_scale(void);
-int get_emul_rotation(void);
+short get_emul_rotation(void);
#endif /* __EMUL_STATE_H__ */
static int skin_argc = 0;
static char** skin_argv = NULL;
-void prepare_maru()
+void prepare_maru(void)
{
INFO("Prepare maru specified feature\n");
*
*/
-/**
- * @file emulator.h
- * @brief - header of file these are config struecture and defines in emulator
- */
#ifndef __EMULATOR_H__
#define __EMULATOR_H__
+
+enum {
+ ROTATION_PORTRAIT = 0,
+ ROTATION_LANDSCAPE = 1,
+ ROTATION_REVERSE_PORTRAIT = 2,
+ ROTATION_REVERSE_LANDSCAPE = 3,
+};
+
+
int get_emulator_condition(void);
void set_emulator_condition(int state);
void exit_emulator(void);
#ifndef SDL_THREAD
pthread_mutex_lock(&sdl_mutex);
#endif
-
SDL_Surface *processing_screen;
- processing_screen = rotozoomSurface(surface_qemu, 0.0, ((double)get_emul_win_scale()) / 100, 1);
+ double angle = 0.0;
+
+//TODO: convert type define to angle value
+ short rotaton_type = get_emul_rotation();
+ if (rotaton_type == 1) {
+ angle = 90.0;
+ } else if (rotaton_type == 2) {
+ angle = 180.0;
+ } else if (rotaton_type == 3) {
+ angle = 270.0;
+ }
+
+ processing_screen = rotozoomSurface(surface_qemu, angle, ((double)get_emul_win_scale()) / 100, 1);
SDL_BlitSurface(processing_screen, NULL, surface_screen, NULL);
SDL_UpdateRect(surface_screen, 0, 0, 0, 0);
public enum RotationInfo {
PORTRAIT( RotationNameType.PORTRAIT.value(), (short)0, 0 ),
- REVERSE_PORTRAIT( RotationNameType.REVERSE_PORTRAIT.value(), (short)1, 180 ),
- LANDSCAPE( RotationNameType.LANDSCAPE.value(), (short)2, -90 ),
+ LANDSCAPE( RotationNameType.LANDSCAPE.value(), (short)1, -90 ),
+ REVERSE_PORTRAIT( RotationNameType.REVERSE_PORTRAIT.value(), (short)2, 180 ),
REVERSE_LANDSCAPE( RotationNameType.REVERSE_LANDSCAPE.value(), (short)3, 90 );
private String value;
void do_scale_event( int event_type) {
INFO( "do_scale_event event_type:%d", event_type);
- //double scale_factor = event_type / 100; //TODO: define
- //TODO:
+ //TODO: qemu refresh
set_emul_win_scale(event_type);
}
}
int scale = 0;
- int rotation = 0;
+ short rotation = 0;
char* p = readbuf;
memcpy( &scale, p, sizeof( scale ) );
memcpy( &rotation, p, sizeof( rotation ) );
scale = ntohl( scale );
- rotation = ntohl( rotation );
+ rotation = ntohs( rotation );
if ( get_emul_win_scale() != scale ) {
do_scale_event( scale );