📄 our_cpu.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"
//================================================================================================
//==========================
//==========================
#if 1
#define LCD_W 240
#define LCD_H 320
#else
#define LCD_W (800)
#define LCD_H (400)
#endif
//----------------------
#define CLOR_MOD_8888 1
#define CLOR_MOD_565 2
#define CLOR_MOD_555 3
#define CLOR_MOD CLOR_MOD_565
#define OUR_FAST_2D 0
//==========================
//==========================
//================================================================================================
#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_BITS 9
#define PI2_MY (1<<PI2_MY_BITS)
// 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 INT;
//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
//-----------------------------------------------------------------------------------------------
*/
//================================================================================================
#if 1
/*
//-----------------------------------------------------------
08-0826-1640
添加了 cmp_z in obj
//-----------------------------------------------------------
08-0826-1040
添加了 clip-bmp,clip-groud,clip-flat
//-----------------------------------------------------------
08-0819-1640
更改了 sin—cos—table,可以改变精度
//-----------------------------------------------------------
//-----------------------------------------------------------
08-0819-1040
更改MATERIAL的emn,增加了 好几个选项,并实现功能,下次添加,一个三角形每个点对应一个颜色。
//-----------------------------------------------------------
08-0818-1720
添加了一个点对应一个颜色。下次添加,一个三角形每个点对应一个颜色。
//-----------------------------------------------------------
08-0818-1701
ojb结构添加clor ,和clor_work,去掉tran结构里的clor and clor_work,这样可以减少内存
特别在用MATERIAL_point
//-----------------------------------------------------------
080422
使obj的变化可以更多
//-----------------------------------------------------------
080417
添加了点光源,平行光,环境光,obj_init,lit_init
添加了除函数,但是效率不高
//-----------------------------------------------------------
//-----------------------------------------------------------
080410
可以移植到ads编译了,并测了一些函数的时间,添加了一个光源
//-----------------------------------------------------------
//-----------------------------------------------------------
080409
很久没有写了,今天再看看有什么可以做的,整理了一下
//-----------------------------------------------------------
*/
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -