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_CoCmd_State.c File Reference

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

#include "EVE_Platform.h"

Go to the source code of this file.

Functions

EVE_HAL_EXPORT bool EVE_CoCmd_bitmapTransform (EVE_HalContext *phost, int32_t x0, int32_t y0, int32_t x1, int32_t y1, int32_t x2, int32_t y2, int32_t tx0, int32_t ty0, int32_t tx1, int32_t ty1, int32_t tx2, int32_t ty2, uint16_t *result)
 Send CMD_BITMAP_TRANSFORM. Blocking call if a pointer is passed to result
 

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_CoCmd_State.c.

Function Documentation

◆ EVE_CoCmd_bitmapTransform()

EVE_HAL_EXPORT bool EVE_CoCmd_bitmapTransform ( EVE_HalContext phost,
int32_t  x0,
int32_t  y0,
int32_t  x1,
int32_t  y1,
int32_t  x2,
int32_t  y2,
int32_t  tx0,
int32_t  ty0,
int32_t  tx1,
int32_t  ty1,
int32_t  tx2,
int32_t  ty2,
uint16_t result 
)

Send CMD_BITMAP_TRANSFORM. Blocking call if a pointer is passed to result

Parameters
phostPointer to Hal context
x0Point X0 screen coordinate, in pixels
y0Point Y0 screen coordinate, in pixels
x1Point X1 screen coordinate, in pixels
y1Point Y1 screen coordinate, in pixels
x2Point X2 screen coordinate, in pixels
y2Point Y2 screen coordinate, in pixels
tx0Point X0 bitmap coordinate, in pixels
ty0Point Y0 bitmap coordinate, in pixels
tx1Point X1 bitmap coordinate, in pixels
ty1Point Y1 bitmap coordinate, in pixels
tx2Point X2 bitmap coordinate, in pixels
ty2Point Y2 bitmap coordinate, in pixels
resultOptional parameter result is set to -1 on success, 0 on failure
Returns
bool Returns false on coprocessor error

Definition at line 34 of file EVE_CoCmd_State.c.

35{
36 uint16_t resAddr;
37
38#if EVE_CMD_HOOKS
39 if (phost->CoCmdHook && phost->CoCmdHook(phost, CMD_BITMAP_TRANSFORM, 0))
40 return false;
41#endif
42
43 EVE_Cmd_startFunc(phost);
45 EVE_Cmd_wr32(phost, x0);
46 EVE_Cmd_wr32(phost, y0);
47 EVE_Cmd_wr32(phost, x1);
48 EVE_Cmd_wr32(phost, y1);
49 EVE_Cmd_wr32(phost, x2);
50 EVE_Cmd_wr32(phost, y2);
51 EVE_Cmd_wr32(phost, tx0);
52 EVE_Cmd_wr32(phost, ty0);
53 EVE_Cmd_wr32(phost, tx1);
54 EVE_Cmd_wr32(phost, ty1);
55 EVE_Cmd_wr32(phost, tx2);
56 EVE_Cmd_wr32(phost, ty2);
57 resAddr = EVE_Cmd_moveWp(phost, 4);
58 EVE_Cmd_endFunc(phost);
59
60#if EVE_DL_OPTIMIZE
61 EVE_DL_STATE.BitmapTransform = true;
62#endif
63
64 /* Read result */
65 if (result)
66 {
67 if (!EVE_Cmd_waitFlush(phost))
68 return false;
69 *result = EVE_Hal_rd16(phost, RAM_CMD + resAddr);
70 }
71 return true;
72}
EVE_HAL_EXPORT uint16_t EVE_Cmd_moveWp(EVE_HalContext *phost, uint16_t bytes)
Move the write pointer forward by the specified number of bytes. Returns the previous write pointer.
Definition EVE_Cmd.c:446
EVE_HAL_EXPORT void EVE_Cmd_startFunc(EVE_HalContext *phost)
Begin writing a function, keeps the transfer open.
Definition EVE_Cmd.c:262
EVE_HAL_EXPORT void EVE_Cmd_endFunc(EVE_HalContext *phost)
End writing a function, closes the transfer.
Definition EVE_Cmd.c:274
EVE_HAL_EXPORT bool EVE_Cmd_wr32(EVE_HalContext *phost, uint32_t value)
Write 4 bytes to Coprocessor's command fifo.
Definition EVE_Cmd.c:394
#define RAM_CMD
#define CMD_BITMAP_TRANSFORM
EVE_HAL_EXPORT uint16_t EVE_Hal_rd16(EVE_HalContext *phost, uint32_t addr)
Read 2 bytes from Coprocessor's memory.
Definition EVE_Hal.c:173
#define EVE_DL_STATE
unsigned short uint16_t
void EVE_Cmd_waitFlush(EVE_HalContext *host)
Definition Gpu_Hal.cpp:775