⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 jam_custom.c

📁 java 1.1 gemini 08_16
💻 C
📖 第 1 页 / 共 2 页
字号:
/*****************************************************************************
*  Copyright Statement:
*  --------------------
*  This software is protected by Copyright and the information contained
*  herein is confidential. The software may not be copied and the information
*  contained herein may not be used or disclosed except with the written
*  permission of MediaTek Inc. (C) 2002
*
*****************************************************************************/

/*****************************************************************************
 *
 * Filename:
 * ---------
 *  j2me_custom.c
 *
 * Project:
 * --------
 *   MAUI
 *
 * Description:
 * ------------
 *      This file is intends for customization of default Java midletsuites
 *
 * Author:
 * -------
 * -------
 *
 *============================================================================
 *             HISTORY
 * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
 *------------------------------------------------------------------------------
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 *------------------------------------------------------------------------------
 * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
 *============================================================================
 ****************************************************************************/

/*************************************************************************
 * Include Header Files
 *************************************************************************/
#include "jal.h"
#include "j2me_custom.h"
#include "jvm_internal.h"
#include "jpush_interface.h"

#include "machine_md.h"

/*************************************************************************
 * Global Definition
 *************************************************************************/
j2me_custom_file_info_struct *j2me_custom_file_info_ptr;

int j2me_default_game_count;
int virtual_file_count;

int game_j2me_default_game_count;
int game_virtual_file_count;

#ifdef __SUPPORT_INFUSIO__
j2me_custom_file_info_struct *eureka_custom_file_info_ptr;
int eureka_default_game_count;
int eureka_virtual_file_count;
#endif /* __SUPPORT_INFUSIO__ */

#ifdef SUPPORT_SURFKITCHEN
j2me_custom_file_info_struct *surfkitchen_custom_file_info_ptr;
int surfkitchen_default_game_count;
int surfkitchen_virtual_file_count;
#endif /* SUPPORT_SURFKITCHEN */

#ifdef SUPPORT_MUSICWAV
j2me_custom_file_info_struct *musicwav_custom_file_info_ptr;
int musicwav_default_game_count;
int musicwav_virtual_file_count;
#endif /* SUPPORT_MUSICWAV */

extern kal_char *release_verno(void);
extern void create_default_file(kal_char *, kal_uint32, game_type_enum type);
extern kal_int32 initiate_game_type;

kal_uint32 
get_default_game_check_sum(game_type_enum type)
{
	int i;
	int normal_file_count;
	const unsigned char*    normal_file_data;
	int                     normal_file_size;
	kal_uint32 sum = 0;
	j2me_custom_file_info_struct *info_ptr = _jvm_get_builtin_file_info(type);

	normal_file_count = info_ptr->normal_file_info.normal_file_count;
	for (i=0; i<normal_file_count; i++)
	{
		if (memcmp(info_ptr->normal_file_info.normal_file_name[i], "MIDSList.save", 13) == 0)
		{
			normal_file_data = info_ptr->normal_file_info.normal_file_data[i];
			normal_file_size = info_ptr->normal_file_info.normal_file_size[i];
			sum = (unsigned int)normal_file_data[normal_file_size - 1] |
				  ((unsigned int)normal_file_data[normal_file_size - 2] << 8)|
				  ((unsigned int)normal_file_data[normal_file_size - 3] << 16)|
				  ((unsigned int)normal_file_data[normal_file_size - 4] << 24);
			return sum;
		}
	}
	return 0xFFFFFFFF;
}

/*****************************************************************************
 * FUNCTION
 *  _jvm_get_dir_path
 *
 * DESCRIPTION
 *		return directory path according to game type
 *  
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
kal_char*
_jvm_get_dir_path(game_type_enum type)
{
	kal_char* dir_path = NULL;

	switch (type)
	{
	case GAMETYPE_JAVA_GAME:
		dir_path = j2me_sys_dir_path;
		break;

#ifdef __SUPPORT_INFUSIO__
	case GAMETYPE_INFUSIO_EUREKA:
		dir_path = eureka_sys_dir_path;
		break;
#endif /* __SUPPORT_INFUSIO__ */

#ifdef SUPPORT_SURFKITCHEN
	case GAMETYPE_SURFKITCHEN:
		dir_path = surfkitchen_sys_dir_path;
		break;
#endif /* __SUPPORT_INFUSIO__ */

#ifdef SUPPORT_MUSICWAV
	case GAMETYPE_MUSICWAV:
		dir_path = musicwav_sys_dir_path;
		break;
#endif /* SUPPORT_MUSICWAV */

	default:
		break;
	}

	return dir_path;
}

/*****************************************************************************
 * FUNCTION
 *  _jvm_get_builtin_file_info
 *
 * DESCRIPTION
 *		return directory path according to game type
 *  
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
j2me_custom_file_info_struct*
_jvm_get_builtin_file_info(game_type_enum type)
{
    j2me_custom_file_info_struct* info_ptr = NULL;

    switch (type)
    {
    case GAMETYPE_JAVA_GAME:
        j2me_default_game_count = game_j2me_default_game_count;
        virtual_file_count = game_virtual_file_count;
        info_ptr = j2me_custom_file_info_ptr;
        break;
#ifdef __SUPPORT_INFUSIO__
    case GAMETYPE_INFUSIO_EUREKA:
        j2me_default_game_count = eureka_default_game_count;
        virtual_file_count = eureka_virtual_file_count;
        info_ptr = eureka_custom_file_info_ptr;
        break;
#endif /* __SUPPORT_INFUSIO__ */
#ifdef SUPPORT_SURFKITCHEN
    case GAMETYPE_SURFKITCHEN:
        j2me_default_game_count = surfkitchen_default_game_count;
        virtual_file_count = surfkitchen_virtual_file_count;
        info_ptr = surfkitchen_custom_file_info_ptr;
        break;
#endif /* SUPPORT_SURFKITCHEN */
#ifdef SUPPORT_MUSICWAV
    case GAMETYPE_MUSICWAV:
        j2me_default_game_count = musicwav_default_game_count;
        virtual_file_count = musicwav_virtual_file_count;
        info_ptr = musicwav_custom_file_info_ptr;
        break;
#endif /* SUPPORT_MUSICWAV */
	case GAMETYPE_INVALID_TYPE:
		break;
	}
	return info_ptr;
}

/*****************************************************************************
 * FUNCTION
 *  _jvm_get_current_game_type()
 *
 * DESCRIPTION
 *	return current running context game type
 *  
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
kal_int32
jvm_get_current_game_type(void)
{

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -