image/svg+xml
Brteve's API for EveApps
Version 0.0.1
The reference document for common folder of EveApps project.
 
Loading...
Searching...
No Matches
EVE_CoDl.c File Reference

EVE's co-processor command. More...

#include "EVE_CoDl.h"

Go to the source code of this file.

Functions

EVE_HAL_EXPORT void EVE_CoDlImpl_resetDlState (EVE_HalContext *phost)
 
EVE_HAL_EXPORT void EVE_CoDlImpl_resetCoState (EVE_HalContext *phost)
 

Detailed Description

EVE's co-processor command.

Author
Bridgetek
Date
2018

MIT License

Copyright (c) [2019] [Bridgetek Pte Ltd (BRTChip)]

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Definition in file EVE_CoDl.c.

Function Documentation

◆ EVE_CoDlImpl_resetCoState()

EVE_HAL_EXPORT void EVE_CoDlImpl_resetCoState ( EVE_HalContext phost)
Parameters
phostPointer to Hal context

Definition at line 83 of file EVE_CoDl.c.

84{
85#if (EVE_DL_OPTIMIZE)
86 phost->CoFgColor = 0x003870;
87 phost->CoBgColor = 0x002040;
88 phost->CoBitmapTransform = false;
89#endif
90
91#if (EVE_SUPPORT_CHIPID >= EVE_FT810)
92 if (EVE_CHIPID >= EVE_FT810)
93 {
94 phost->CoScratchHandle = 15;
95 }
96#endif
97}
#define EVE_CHIPID
#define EVE_FT810
Definition EVE_Config.h:58
uint32_t CoBgColor
uint8_t CoScratchHandle
uint32_t CoFgColor

◆ EVE_CoDlImpl_resetDlState()

EVE_HAL_EXPORT void EVE_CoDlImpl_resetDlState ( EVE_HalContext phost)
Parameters
phostPointer to Hal context

Definition at line 38 of file EVE_CoDl.c.

39{
40#if (EVE_DL_OPTIMIZE) || (EVE_DL_CACHE_SCISSOR) || (EVE_SUPPORT_CHIPID < EVE_FT810) || defined(EVE_MULTI_GRAPHICS_TARGET)
41 phost->DlStateIndex = 0;
42#if defined(_MSC_VER) && (_MSC_VER < 1800)
43 /* Designated initializers not supported in older Visual Studio versions */
44 memset(&phost->DlState[0], 0, sizeof(EVE_HalDlState));
45#if (EVE_DL_OPTIMIZE)
46 phost->DlState[0].LineWidth = 16;
47 phost->DlState[0].PointSize = 16;
48 phost->DlState[0].ColorRGB = 0xFFFFFF;
49 phost->DlState[0].ColorA = 0xFF;
50 phost->DlState[0].Handle = 0x3F; /* Invalid value */
51#endif
52 phost->DlState[0].VertexFormat = 4;
53#else
54 phost->DlState[0] = (EVE_HalDlState)
55 {
56#if (EVE_DL_OPTIMIZE)
57 .LineWidth = 16,
58 .PointSize = 16,
59 .ColorRGB = 0xFFFFFF,
60#endif
61#if (EVE_DL_CACHE_SCISSOR)
62 .ScissorWidth = (uint16_t)phost->Width,
63 .ScissorHeight = (uint16_t)phost->Height,
64#endif
65#if (EVE_DL_OPTIMIZE)
66 .ColorA = 0xFF,
67 .Handle = 0x3F, /* Invalid value */
68#endif
69#if (EVE_DL_OPTIMIZE) || (EVE_SUPPORT_CHIPID < EVE_FT810) || defined(EVE_MULTI_GRAPHICS_TARGET)
70 .VertexFormat = 4,
71#elif (EVE_DL_CACHE_SCISSOR)
72 0
73#endif
74 };
75#endif
76#endif
77
78#if (EVE_DL_OPTIMIZE)
79 phost->DlPrimitive = 0;
80#endif
81}
unsigned short uint16_t
uint32_t Height
uint8_t DlPrimitive
uint8_t DlStateIndex
EVE_HalDlState DlState[EVE_DL_STATE_STACK_SIZE]
int16_t LineWidth
uint8_t VertexFormat
uint32_t ColorRGB
int16_t PointSize