📄 ua.c
字号:
#include "our_p_main.h"
#include "stdio.h"
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
typedef unsigned int UINT;
typedef unsigned char U8;
typedef unsigned short U16;
typedef unsigned short uint16;
typedef short S16;
typedef int S32;
typedef unsigned int U32;
typedef int FS_HANDLE;
typedef int BOOL;
typedef S32 MMI_key_event_type;
typedef unsigned short WCHAR;
typedef unsigned int UINT;
typedef unsigned int uint32;
typedef S32 gdi_result;
typedef unsigned long kal_uint32;
typedef BOOL kal_bool;
typedef int int32;
typedef short wchar;
typedef uint32 KeyCode;
typedef unsigned char uint8;
typedef unsigned char S8;
typedef U8 UI_character_type;
typedef UI_character_type* UI_string_type;
extern int Image$$RO$$Limit;
//
typedef unsigned char UCHAR;
enum
{
KEY_0 = 0,
KEY_1,
KEY_2,
KEY_3,
KEY_4,
KEY_5,
KEY_6,
KEY_7,
KEY_8,
KEY_9,
KEY_LSK,
KEY_RSK,
KEY_CSK,
KEY_UP_ARROW,
KEY_DOWN_ARROW,
KEY_LEFT_ARROW,
KEY_RIGHT_ARROW,
KEY_SEND,
KEY_END,
KEY_CLEAR,
KEY_STAR,
KEY_POUND,
KEY_VOL_UP,
KEY_VOL_DOWN,
KEY_QUICK_ACS,
KEY_CAMERA = KEY_QUICK_ACS,
KEY_ENTER,
KEY_WAP = KEY_ENTER,
KEY_IP = KEY_ENTER,
KEY_EXTRA_1,
KEY_EXTRA_2,
KEY_PLAY_STOP,
KEY_FWD,
KEY_BACK,
KEY_POWER,
KEY_EXTRA_A,
KEY_EXTRA_B,
#ifdef __SENDKEY2_SUPPORT__
/*
* the second call key is define for MERCURY dual mode
* KEY_SEND means KEY_SEND1 and KEY_SEND2
* But the application could set the individual key handler in using KEY_SEND1 and KEY_SEND2
* KEY_SEND1 has its KEY_SEND1's entry in nKeyPadMap[]
* KEY_SEND2 has its KEY_SEND2's entry in nKeyPadMap[]
*/
KEY_SEND1,
KEY_SEND2,
#endif /* __SENDKEY2_SUPPORT__ */
MAX_KEYS, /* max key codes support */
KEY_INVALID = 0xFE // 255 /* By JL, to sync with driver */
} ;
enum
{
KEY_FULL_PRESS_DOWN,
KEY_EVENT_DOWN = KEY_FULL_PRESS_DOWN,
KEY_EVENT_UP,
KEY_LONG_PRESS,
KEY_REPEAT,
KEY_HALF_PRESS_DOWN,
KEY_HALF_PRESS_UP,
MAX_KEY_TYPE
} ;
extern void OUR_extern_back_demo1();
typedef void (*FuncPtr) (void);
typedef struct
{
S16 x;
S16 y;
}mmi_pen_point_struct;
typedef void (*mmi_pen_hdlr) (mmi_pen_point_struct pos);
//----0-----------------------------------------------
typedef void (*SetKeyHandler__)(FuncPtr funcPtr, USHORT keyCode, USHORT keyType);
SetKeyHandler__ SetKeyHandler=0;
//----1-----------------------------------------------
typedef void (*gui_cancel_timer__) (FuncPtr callback) ;
gui_cancel_timer__ gui_cancel_timer=0;
//----2-----------------------------------------------
typedef void (*gui_start_timer__) (S32 count, FuncPtr callback) ;
gui_start_timer__ gui_start_timer=0;
//----3-----------------------------------------------
typedef void (*gui_BLT_double_buffer__) (S32 x1, S32 y1, S32 x2, S32 y2) ;
gui_BLT_double_buffer__ gui_BLT_double_buffer=0;
//---------------------------------------------------
typedef void (*wgui_register_pen_down_handler__)(mmi_pen_hdlr pen_down_hdlr);
wgui_register_pen_down_handler__ wgui_register_pen_down_handler=0;
//---------------------------------------------------
typedef void (*wgui_register_pen_up_handler__)(mmi_pen_hdlr pen_down_hdlr);
wgui_register_pen_up_handler__ wgui_register_pen_up_handler=0;
//---------------------------------------------------
typedef void (*wgui_register_pen_move_handler__)(mmi_pen_hdlr pen_down_hdlr);
wgui_register_pen_move_handler__ wgui_register_pen_move_handler=0;
//----7-----------------------------------------------
typedef U8 (*EntryNewScreen__)(U16 newscrnID, FuncPtr newExitHandler, FuncPtr newEntryHandler, void *flag);
EntryNewScreen__ EntryNewScreen=0;
//----8-----------------------------------------------
typedef void (*GoBackHistory__)(void);
GoBackHistory__ GoBackHistory=0;
//----9-----------------------------------------------
typedef kal_uint32 (*drv_get_duration_ms__)(kal_uint32 previous_time);
drv_get_duration_ms__ drv_get_duration_ms=0;
//----10-----------------------------------------------
typedef void *(*med_alloc_ext_mem_ext__)(int size,char* file_p, long line_p);
med_alloc_ext_mem_ext__ med_alloc_ext_mem_ext=0;
//----11-----------------------------------------------
typedef void (*med_free_ext_mem_ext__)(void **pointer,char* file_p, long line_p);
med_free_ext_mem_ext__ med_free_ext_mem_ext=0;
//----12-----------------------------------------------
typedef void (*UI_print_text__)(U8* text);
UI_print_text__ UI_print_text=0;
//----13-----------------------------------------------
typedef void (*UI_move_text_cursor__)(S32 x, S32 y);
UI_move_text_cursor__ UI_move_text_cursor=0;
//----14-----------------------------------------------
typedef void (*UI_set_text_color__)(CLR c);
UI_set_text_color__ UI_set_text_color=0;
//----15-----------------------------------------------
typedef void (*gui_measure_string__) (UI_string_type text, S32 *width, S32 *height);
gui_measure_string__ gui_measure_string=0;
//---------------------------------------------------
//0x000696bc
typedef int (*OUR_SHOW_TEXT)(int x,int y,USHORT *s);
typedef struct
{
UCHAR *video_buffer2;
OUR_EVENT* our_event;
int* INFO;
char ** our_spase;
UINT windows_id;
UINT time_next;
UINT x_re,y_re,w_re,h_re;
//OUR_SHOW_TEXT our_show_text;
void *FUN_OTHER[100];
} OUR_DATA_OUT;
#if 1
#define KEEP_SP1() KEEP_SP()
#define REAL_SP1() REAL_SP()
#define LOAD_SP1() LOAD_SP()
#else
#define KEEP_SP1()
#define REAL_SP1()
#define LOAD_SP1()
#endif
static int cout=1;
//__global_reg(8) INT* R9;
OUR_DATA_OUT* data_out111;
OUR_DATA_OUT* data_out;
OUR_EVENT our_event_other;
typedef void (*OUR_OUT_FUN)(int,OUR_DATA_OUT*);
UCHAR*video_buffer_u;
char our_file_data=8;
int sound_on=0;
int get_chang=1;
static int getout=1;
static int game_exit=1;
int info[4];
char *whole_base;
//===============================
//---------------------------------------------------
void init_handles()
{
SetKeyHandler=(SetKeyHandler__)(data_out->FUN_OTHER[0]);
gui_cancel_timer=(gui_cancel_timer__)(data_out->FUN_OTHER[1]);
gui_start_timer=(gui_start_timer__)(data_out->FUN_OTHER[2]);
gui_BLT_double_buffer=(gui_BLT_double_buffer__)(data_out->FUN_OTHER[3]);
wgui_register_pen_down_handler=(wgui_register_pen_down_handler__)(data_out->FUN_OTHER[4]);
wgui_register_pen_up_handler=(wgui_register_pen_up_handler__)(data_out->FUN_OTHER[5]);
wgui_register_pen_move_handler=(wgui_register_pen_move_handler__)(data_out->FUN_OTHER[6]);
EntryNewScreen=(EntryNewScreen__)(data_out->FUN_OTHER[7]);
GoBackHistory=(GoBackHistory__)(data_out->FUN_OTHER[8]);
drv_get_duration_ms=(drv_get_duration_ms__)(data_out->FUN_OTHER[9]);
med_alloc_ext_mem_ext=(med_alloc_ext_mem_ext__)(data_out->FUN_OTHER[10]);
med_free_ext_mem_ext=(med_free_ext_mem_ext__)(data_out->FUN_OTHER[11]);
UI_print_text=(UI_print_text__)(data_out->FUN_OTHER[12]);
UI_move_text_cursor=(UI_move_text_cursor__)(data_out->FUN_OTHER[13]);
UI_set_text_color=(UI_set_text_color__)(data_out->FUN_OTHER[14]);
gui_measure_string=(gui_measure_string__)(data_out->FUN_OTHER[15]);
}
//===============================
void DO_OUR_3D_1();
void DO_OUR_3D_100();
void our_in_2_time();
//---------------------------------------------------------------
//---------------------------------------------------------------
void OUR_KEY_RIGHT_key()
{
KEEP_SP1();
our_event_other.key=OUR_KEY_RIGHT;
getout=1;
DO_OUR_3D_1();
REAL_SP1();
}
void OUR_KEY_LEFT_key()
{
KEEP_SP1();
our_event_other.key=OUR_KEY_LEFT;
getout=1;
DO_OUR_3D_1();
REAL_SP1();
}
void OUR_KEY_UP_key()
{
KEEP_SP1();
our_event_other.key=OUR_KEY_UP;
getout=1;
DO_OUR_3D_1();
REAL_SP1();
}
void OUR_KEY_DOWN_key()
{
KEEP_SP1();
our_event_other.key=OUR_KEY_DOWN;
getout=1;
DO_OUR_3D_1();
REAL_SP1();
}
void OUR_KEY_LS_key()
{
KEEP_SP1();
our_event_other.key=OUR_KEY_L_soft;
getout=1;
DO_OUR_3D_1();
REAL_SP1();
}
void OUR_KEY_RS_key()
{
KEEP_SP1();
our_event_other.key=OUR_KEY_R_soft;
getout=1;
DO_OUR_3D_1();
REAL_SP1();
}
void OUR_KEY_OK_key()
{
KEEP_SP1();
our_event_other.key=OUR_KEY_OK;
getout=1;
DO_OUR_3D_1();
REAL_SP1();
}
//=========================================
void change_char_short(char *c, USHORT* s)
{
int i;
while(*c)
{
*s++=*c++;
}
*s=0;
}
void our_sent_sms()
{
}
void our_draw_txt_out_UICOD(int x,int y,CLR16 c,char* s)
{
U8 u[50];
//utf8_to_ucs2_string(u,sizeof(u),(U8 *)s);
UI_move_text_cursor(x,y);
UI_set_text_color(OUR_RGB16_2_32(c));
UI_print_text((U8*)s);
/**/
}
void our_draw_txt_out(int x,int y,CLR16 c,char* s)
{
U8 u[50];
change_char_short(s,( USHORT*)u);
UI_move_text_cursor(x,y);
UI_set_text_color(OUR_RGB16_2_32(c));
UI_print_text((U8*)u);
/**/
}
void our_play_sound(int sound_id)
{
}
void our_get_out()
{
game_exit=0;
gui_cancel_timer(DO_OUR_3D_100);
GoBackHistory();
med_free_ext_mem_ext((void **)data_out->our_spase,__FILE__,__LINE__);
}
//---------------------------------------------------------------
//---------------------------------------------------------------
void power_key()
{
KEEP_SP1();
our_event_other.key=OUR_KEY_RIGHT;
getout=1;
DO_OUR_3D_1();
REAL_SP1();
}
void out_key()
{
KEEP_SP1();
our_get_out();
REAL_SP1();
}
void up_v_key()
{
KEEP_SP1();
our_event_other.key=OUR_KEY_OK;
getout=1;
DO_OUR_3D_1();
REAL_SP1();
}
void down_v_key()
{
KEEP_SP1();
our_event_other.key=OUR_KEY_L_soft;
getout=1;
DO_OUR_3D_1();
REAL_SP1();
}
//==================================================
void our_m_d(mmi_pen_point_struct pos)
{
KEEP_SP1();
our_event_other.key=OUR_MOUSE_DOWN;
our_event_other.x=pos.x;
our_event_other.y=pos.y;
getout=1;
DO_OUR_3D_1();
REAL_SP1();
}
//==================================================
void our_m_u(mmi_pen_point_struct pos)
{
KEEP_SP1();
our_event_other.key=OUR_MOUSE_UP;
our_event_other.x=pos.x;
our_event_other.y=pos.y;
getout=1;
DO_OUR_3D_1();
REAL_SP1();
}
//==================================================
void our_m_m(mmi_pen_point_struct pos)
{
KEEP_SP1();
our_event_other.key=OUR_MOUSE_MOVE;
our_event_other.x=pos.x;
our_event_other.y=pos.y;
getout=1;
DO_OUR_3D_1();
REAL_SP1();
}
void DO_OUR_3D_100()
{
KEEP_SP1();
DO_OUR_3D_1();
REAL_SP1();
}
void DO_OUR_3D_1()
{
static U8 clr;
if(getout&&game_exit)
{
clr+=9;
our_event_other.time=drv_get_duration_ms(0);
//gui_start_timer(80,DO_OUR_3D_100);
//getout=OUR_3D_Main(data_out->video_buffer2,&our_event_other,info);
memset(data_out->video_buffer2,clr,240*300);
our_event_other.key=0;
gui_BLT_double_buffer(0,0,1000,1000);
}
}
void our_exit()
{
KEEP_SP1();
//game_exit=0;
gui_cancel_timer(DO_OUR_3D_100);
//our_get_out();
REAL_SP1();
}
void our_in()
{
EntryNewScreen (0x11235,our_exit,our_in_2_time,0);
/**/
SetKeyHandler (out_key, KEY_END, KEY_EVENT_DOWN);
SetKeyHandler (out_key, KEY_END, KEY_EVENT_DOWN);
SetKeyHandler (OUR_KEY_UP_key,KEY_UP_ARROW,KEY_EVENT_DOWN);
SetKeyHandler (OUR_KEY_DOWN_key,KEY_DOWN_ARROW,KEY_EVENT_DOWN);
SetKeyHandler (OUR_KEY_LEFT_key,KEY_LEFT_ARROW,KEY_EVENT_DOWN);
SetKeyHandler (OUR_KEY_RIGHT_key,KEY_RIGHT_ARROW,KEY_EVENT_DOWN);
SetKeyHandler (OUR_KEY_OK_key,KEY_ENTER,KEY_EVENT_DOWN);
SetKeyHandler (OUR_KEY_LS_key,KEY_LSK,KEY_EVENT_DOWN);
SetKeyHandler (OUR_KEY_RIGHT_key,KEY_RSK,KEY_EVENT_DOWN);
wgui_register_pen_down_handler(our_m_d);
wgui_register_pen_up_handler(our_m_u);
wgui_register_pen_move_handler(our_m_m);
our_event_other.key=0;
getout=1;
DO_OUR_3D_1();
}
void our_in_2_time()
{
KEEP_SP1();
our_in();
REAL_SP1();
}
int aa;
extern void R9_bf();
extern void sp_bf();
extern int GET_SP();
int our_main(int aaa,OUR_DATA_OUT* data_out_1)
{
static int first=1;
//__global_reg(6) char *sb;
//data_out111=(OUR_DATA_OUT*)data_out_1;
//our_event_other.key=data_out_1->our_event->key;
//*R9 =aaa;
//
// KEEP_SP;
KEEP_SP1();
info[0]=(int)aaa;
info[1]=*((int*)sp_bf);
info[2]=GET_SP();
whole_base=(char*)aaa;
data_out=(OUR_DATA_OUT*)data_out_1;
if(1)
{
//and__
if(first==1)
{
first=0;
//OUR_3D_Init();
}
//=======================================
data_out->windows_id=8;
init_handles();
our_in();
//===============================================================
//data_out->windows_id=0;
//OUR_extern_back_demo1();
}
else
{
int i;
int a[5];
CLR16 *d;
cout=100;
d=(CLR16 *)data_out_1->video_buffer2;
if( cout==100)
{
for (i=0;i<320*240;i++)
{
*d++=0xf00;
}
}
else
{
for (i=0;i<320*240;i++)
{
*d++=0xffff;
}
}
data_out_1->windows_id=0;
}
//REAL_SP;
REAL_SP1();
}
//__global_reg(6) = ...
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -