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

📄 our_cpu.h

📁 MTK上3D特效的一些开源代码
💻 H
字号:
/**************************************************************************
Copyright (C) jianbo miao Corporation.  All Rights Released.
this is a 3d engin named our_3d_engin.
our_3d_engin feature:
1:there is no float.
2:it do the 3d things all by softwear.
3:base on 1 and 2 , it can execution on arm which have no 3d hardwear accelerate.

if you have any  suggestion or question,pls contact with me
mail:miaojb@126.com
msn:miaojianbo@hotmail.com
qq:30209027

2008/01/01
***************************************************************************/

#ifndef OUR_CPU
#define OUR_CPU

//#include "our_math.h"

//================================================================================================
//==========================
//==========================

#define LCD_W 480
#define LCD_H 640

//----------------------

#define	CLOR_MOD_8888   1
#define	CLOR_MOD_565    2
#define	CLOR_MOD_555    3

#define CLOR_MOD CLOR_MOD_565

//==========================
//==========================

//================================================================================================
#define PI         ((float)3.141592654f)
#define PI2        ((float)6.283185307f)
#define PI_DIV_2   ((float)1.570796327f)
#define PI_DIV_4   ((float)0.785398163f) 
#define PI_INV     ((float)0.318309886f) 
#define NULL		(0)

#define PI2_MY	512

// defines for parametric line intersections
#define PARM_LINE_NO_INTERSECT         		0
#define PARM_LINE_INTERSECT_IN_SEGMENT  	1
#define PARM_LINE_INTERSECT_OUT_SEGMENT 	2
#define PARM_LINE_INTERSECT_EVERYWHERE  	3

// fixed point mathematics constants
#define FIXP15_SHIFT     15
#define FIXP16_MAG       65536
#define FIXP16_DP_MASK   0x0000ffff
#define FIXP16_WP_MASK   0xffff0000
#define FIXP16_ROUND_UP  0x00008000
//=============================================
typedef int FIXP16;
typedef int *FIXP16_PTR;
typedef int sint32;
typedef unsigned int uint32;
typedef unsigned int UINT;
typedef unsigned char UCHAR;
typedef unsigned short USHORT;
typedef unsigned short CLR16;
typedef  int CLR;

#define TIMER_VULE (*(volatile unsigned *)0xa800004)

//---------------------------------------------------
#endif

//================================================================================================
/*
---每一个细节所占用的cpu资源描述
乘法----5t
加法----1t
减法----1t
除法----80t
赋值----2t
移位----1t
跳转----3t
//-----------------------------------------------------------------------------------------------
用16位色做
565

//-----------------------------------------------------------------------------------------------
本lib设计用来做3d的UI,主要针对arm平台.
例如在手机的开机画面,和九宫图之类的.
主要是的arm的运算能力越来越快的前提下,
用纯软件到达一般3d的效果.
现在很多大公司起始也在做这方面的工作
并有望今年年末有所表现
可能这对我们来说是挑战
同样也是机遇
*/
//================================================================================================

#if 0
//-----------------------------------------------------------
080422
使obj的变化可以更多
//-----------------------------------------------------------
080417
添加了点光源,平行光,环境光,obj_init,lit_init
添加了除函数,但是效率不高
//-----------------------------------------------------------
//-----------------------------------------------------------
080410
可以移植到ads编译了,并测了一些函数的时间,添加了一个光源
//-----------------------------------------------------------
//-----------------------------------------------------------
080409
很久没有写了,今天再看看有什么可以做的,整理了一下
//-----------------------------------------------------------
#endif

⌨️ 快捷键说明

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