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.h
Go to the documentation of this file.
1
48#ifndef EVE_CO_DL__H
49#define EVE_CO_DL__H
50
51#include "EVE_CoCmd.h"
52
53#define EVE_VERTEX2F_MIN -16384L
54#define EVE_VERTEX2F_MAX 16383L
55#define EVE_VERTEX2II_MIN 0UL
56#define EVE_VERTEX2II_MAX 511UL
65
69static inline void EVE_CoDl_display(EVE_HalContext *phost)
70{
71 EVE_CoCmd_dl(phost, DISPLAY());
72}
73
74/* Fixed point vertex with subprecision depending on current vertex format */
75ESD_FUNCTION(EVE_CoDl_vertex2f, Type = void, Category = EveRenderFunctions, Inline)
76ESD_PARAMETER(phost, Type = EVE_HalContext *, Default = Esd_GetHost, Hidden, Internal, Static) // PHOST
77ESD_PARAMETER(x, Type = int16_t)
78ESD_PARAMETER(y, Type = int16_t)
86static inline void EVE_CoDl_vertex2f(EVE_HalContext *phost, int16_t x, int16_t y)
87{
88#if (EVE_SUPPORT_CHIPID < EVE_FT810) || defined(EVE_MULTI_GRAPHICS_TARGET)
90 {
91 /* Compatibility */
92 x <<= EVE_DL_STATE.VertexFormat; /* 4 - frac */
93 y <<= EVE_DL_STATE.VertexFormat; /* 4 - frac */
94 x += EVE_DL_STATE.VertexTranslateX;
95 y += EVE_DL_STATE.VertexTranslateY;
96 }
97#endif
98 EVE_CoCmd_dl(phost, VERTEX2F(x, y));
99}
100
101#if (EVE_SUPPORT_CHIPID < EVE_FT810) || defined(EVE_MULTI_GRAPHICS_TARGET)
110EVE_HAL_EXPORT void EVE_CoDlImpl_vertex2ii_translate(EVE_HalContext *phost, uint16_t x, uint16_t y, uint8_t handle, uint8_t cell);
111#endif
112
113ESD_FUNCTION(EVE_CoDl_vertex2ii, Type = void, Category = EveRenderFunctions, Inline)
114ESD_PARAMETER(phost, Type = EVE_HalContext *, Default = Esd_GetHost, Hidden, Internal, Static) // PHOST
115ESD_PARAMETER(x, Type = uint16_t)
116ESD_PARAMETER(y, Type = uint16_t)
117ESD_PARAMETER(handle, Type = uint8_t)
118ESD_PARAMETER(cell, Type = uint8_t)
126inline static void EVE_CoDl_vertex2ii(EVE_HalContext *phost, uint16_t x, uint16_t y, uint8_t handle, uint8_t cell)
127{
128#if (EVE_SUPPORT_CHIPID < EVE_FT810) || defined(EVE_MULTI_GRAPHICS_TARGET)
129 if (EVE_CHIPID < EVE_FT810 && (EVE_DL_STATE.VertexTranslateX || EVE_DL_STATE.VertexTranslateY))
130 {
131 /* Compatibility for FT80X series */
132 EVE_CoDlImpl_vertex2ii_translate(phost, x, y, handle, cell);
133 }
134 else
135#endif
136 {
137 EVE_CoCmd_dl(phost, VERTEX2II(x, y, handle, cell));
138 }
139}
140
146{
148}
149
155inline static void EVE_CoDl_bitmapSource_ex(EVE_HalContext *phost, uint32_t addr, bool flash)
156{
157 EVE_CoCmd_dl(phost, BITMAP_SOURCE2(flash, addr));
158}
159
160/* Specify clear color RGB */
161ESD_FUNCTION(EVE_CoDl_clearColorRgb_ex, Type = void, Category = EveRenderFunctions, Inline)
162ESD_PARAMETER(phost, Type = EVE_HalContext *, Default = Esd_GetHost, Hidden, Internal, Static) // PHOST
163ESD_PARAMETER(c, Type = rgb32_t, DisplayName = "Color")
171{
172 EVE_CoCmd_dl(phost, CLEAR_COLOR_RGB(0, 0, 0) | (c & 0xFFFFFF));
173}
174
184{
185 EVE_CoCmd_dl(phost, CLEAR_COLOR_RGB(r, g, b));
186}
187
188/* Specify clear alpha channel */
189ESD_FUNCTION(EVE_CoDl_clearColorA, Type = void, Category = EveRenderFunctions, Inline)
190ESD_PARAMETER(phost, Type = EVE_HalContext *, Default = Esd_GetHost, Hidden, Internal, Static) // PHOST
191ESD_PARAMETER(alpha, Type = uint8_t, DisplayName = "Alpha", Default = 255, Min = 0, Max = 255)
198inline static void EVE_CoDl_clearColorA(EVE_HalContext *phost, uint8_t alpha)
199{
200 EVE_CoCmd_dl(phost, CLEAR_COLOR_A(alpha));
201}
202
203/* Specify clear color: Alpha (bits 31:24) + RGB (bits 23:0) */
204ESD_FUNCTION(EVE_CoDl_clearColorArgb_ex, Type = void, Category = EveRenderFunctions, Inline)
205ESD_PARAMETER(phost, Type = EVE_HalContext *, Default = Esd_GetHost, Hidden, Internal, Static) // PHOST
206ESD_PARAMETER(c, Type = argb32_t, DisplayName = "Color")
214{
216 EVE_CoDl_clearColorA(phost, c >> 24);
217}
218
219/* Set current tag. Must be returned to 255 after usage, to ensure next widgets don't draw with invalid tag */
220ESD_FUNCTION(EVE_CoDl_tag, Type = void, Category = EveRenderFunctions, Inline)
221ESD_PARAMETER(phost, Type = EVE_HalContext *, Default = Esd_GetHost, Hidden, Internal, Static) // PHOST
222ESD_PARAMETER(s, Type = uint8_t, DisplayName = "Tag", Default = 255, Min = 0, Max = 255)
230inline static void EVE_CoDl_tag(EVE_HalContext *phost, uint8_t s)
231{
232 EVE_CoCmd_dl(phost, TAG(s));
233}
234
235/* Specify color RGB */
236ESD_FUNCTION(EVE_CoDl_colorRgb_ex, Type = void, Category = EveRenderFunctions, Inline)
237ESD_PARAMETER(phost, Type = EVE_HalContext *, Default = Esd_GetHost, Hidden, Internal, Static) // PHOST
238ESD_PARAMETER(c, Type = rgb32_t, DisplayName = "Color")
246{
247 uint32_t rgb = c & 0xFFFFFF;
248#if EVE_DL_OPTIMIZE
249 if (rgb != EVE_DL_STATE.ColorRGB)
250 {
251#endif
252 EVE_CoCmd_dl(phost, COLOR_RGB(0, 0, 0) | (c & 0xFFFFFF));
253#if EVE_DL_OPTIMIZE
254 EVE_DL_STATE.ColorRGB = rgb;
255 }
256#endif
257}
258
267inline static void EVE_CoDl_colorRgb(EVE_HalContext *phost, uint8_t r, uint8_t g, uint8_t b)
268{
269 uint32_t rgb = ((uint32_t)r << 16) | ((uint32_t)g << 8) | ((uint32_t)b);
270 EVE_CoDl_colorRgb_ex(phost, rgb);
271}
272
273/* Specify alpha channel */
274ESD_FUNCTION(EVE_CoDl_colorA, Type = void, Category = EveRenderFunctions, Inline)
275ESD_PARAMETER(phost, Type = EVE_HalContext *, Default = Esd_GetHost, Hidden, Internal, Static) // PHOST
276ESD_PARAMETER(alpha, Type = uint8_t, DisplayName = "Alpha", Default = 255, Min = 0, Max = 255)
283inline static void EVE_CoDl_colorA(EVE_HalContext *phost, uint8_t alpha)
284{
285#if EVE_DL_OPTIMIZE
286 if (alpha != EVE_DL_STATE.ColorA)
287 {
288#endif
289 EVE_CoCmd_dl(phost, COLOR_A(alpha));
290#if EVE_DL_OPTIMIZE
291 EVE_DL_STATE.ColorA = alpha;
292 }
293#endif
294}
295
296/* Specify color: Alpha (bits 31:24) + RGB (bits 23:0) */
297ESD_FUNCTION(EVE_CoDl_colorArgb_ex, Type = void, Category = EveRenderFunctions, Inline)
298ESD_PARAMETER(phost, Type = EVE_HalContext *, Default = Esd_GetHost, Hidden, Internal, Static) // PHOST
299ESD_PARAMETER(c, Type = argb32_t, DisplayName = "Color")
307{
308 EVE_CoDl_colorRgb_ex(phost, c);
309 EVE_CoDl_colorA(phost, c >> 24);
310}
311
312/* Specify bitmap handle, see BITMAP_HANDLE */
313ESD_FUNCTION(EVE_CoDl_bitmapHandle, Type = void, Category = EveRenderFunctions, Inline)
314ESD_PARAMETER(phost, Type = EVE_HalContext *, Default = Esd_GetHost, Hidden, Internal, Static) // PHOST
315ESD_PARAMETER(handle, Type = uint8_t, Min = 0, Max = 31)
322inline static void EVE_CoDl_bitmapHandle(EVE_HalContext *phost, uint8_t handle)
323{
324#if EVE_DL_OPTIMIZE
325 if (handle != EVE_DL_STATE.Handle)
326 {
327#endif
328 EVE_CoCmd_dl(phost, BITMAP_HANDLE(handle));
329#if EVE_DL_OPTIMIZE
330 EVE_DL_STATE.Handle = handle;
331 }
332#endif
333}
334
335/* Specify cell number for bitmap, see CELL */
336ESD_FUNCTION(EVE_CoDl_cell, Type = void, Category = EveRenderFunctions, Inline)
337ESD_PARAMETER(phost, Type = EVE_HalContext *, Default = Esd_GetHost, Hidden, Internal, Static) // PHOST
338ESD_PARAMETER(cell, Type = uint8_t, Min = 0, Max = 255)
345inline static void EVE_CoDl_cell(EVE_HalContext *phost, uint8_t cell)
346{
347#if EVE_DL_OPTIMIZE
348 if (cell != EVE_DL_STATE.Cell)
349 {
350#endif
351 EVE_CoCmd_dl(phost, CELL(cell));
352#if EVE_DL_OPTIMIZE
353 EVE_DL_STATE.Cell = cell;
354 }
355#endif
356}
357
364static inline void EVE_CoDl_bitmapLayout(EVE_HalContext *phost, uint8_t format, uint16_t linestride, uint16_t height)
365{
366#if (EVE_SUPPORT_CHIPID >= EVE_FT810)
367 if (EVE_CHIPID >= EVE_FT810)
368 {
369 EVE_CoCmd_dl(phost, BITMAP_LAYOUT_H(linestride >> 10, height >> 9));
370 }
371#endif
372 EVE_CoCmd_dl(phost, BITMAP_LAYOUT(format, linestride, height));
373}
374
383static inline void EVE_CoDl_bitmapSize(EVE_HalContext *phost, uint8_t filter, uint8_t wrapx, uint8_t wrapy, uint16_t width, uint16_t height)
384{
385#if (EVE_SUPPORT_CHIPID >= EVE_FT810)
386 if (EVE_CHIPID >= EVE_FT810)
387 {
388 EVE_CoCmd_dl(phost, BITMAP_SIZE_H(width >> 9, height >> 9));
389 }
390#endif
391 EVE_CoCmd_dl(phost, BITMAP_SIZE(filter, wrapx, wrapy, width, height));
392}
393
399static inline void EVE_CoDl_alphaFunc(EVE_HalContext *phost, uint8_t func, uint8_t ref)
400{
401 EVE_CoCmd_dl(phost, ALPHA_FUNC(func, ref));
402}
403
410static inline void EVE_CoDl_stencilFunc(EVE_HalContext *phost, uint8_t func, uint8_t ref, uint8_t mask)
411{
412 EVE_CoCmd_dl(phost, STENCIL_FUNC(func, ref, mask));
413}
414
420static inline void EVE_CoDl_blendFunc(EVE_HalContext *phost, uint8_t src, uint8_t dst)
421{
422 EVE_CoCmd_dl(phost, BLEND_FUNC(src, dst));
423}
424
429{
430 EVE_CoDl_blendFunc(phost, SRC_ALPHA, ONE_MINUS_SRC_ALPHA); // TODO: Add default calls for all display list state instructions
431}
432
438static inline void EVE_CoDl_stencilOp(EVE_HalContext *phost, uint8_t sfail, uint8_t spass)
439{
440 EVE_CoCmd_dl(phost, STENCIL_OP(sfail, spass));
441}
442
443ESD_FUNCTION(EVE_CoDl_pointSize, Type = void, Category = EveRenderFunctions, Inline)
444ESD_PARAMETER(phost, Type = EVE_HalContext *, Default = Esd_GetHost, Hidden, Internal, Static) // PHOST
445ESD_PARAMETER(size, Type = esd_int16_f4_t)
450inline static void EVE_CoDl_pointSize(EVE_HalContext *phost, int16_t size)
451{
452#if EVE_DL_OPTIMIZE
453 if (size != EVE_DL_STATE.PointSize)
454 {
455#endif
456 EVE_CoCmd_dl(phost, POINT_SIZE(size));
457#if EVE_DL_OPTIMIZE
458 EVE_DL_STATE.PointSize = size;
459 }
460#endif
461}
462
463ESD_FUNCTION(EVE_CoDl_lineWidth, Type = void, Category = EveRenderFunctions, Inline)
464ESD_PARAMETER(phost, Type = EVE_HalContext *, Default = Esd_GetHost, Hidden, Internal, Static) // PHOST
465ESD_PARAMETER(width, Type = esd_int16_f4_t)
470inline static void EVE_CoDl_lineWidth(EVE_HalContext *phost, int16_t width)
471{
472#if EVE_DL_OPTIMIZE
473 if (width != EVE_DL_STATE.LineWidth)
474 {
475#endif
476 EVE_CoCmd_dl(phost, LINE_WIDTH(width));
477#if EVE_DL_OPTIMIZE
478 EVE_DL_STATE.LineWidth = width;
479 }
480#endif
481}
482
487static inline void EVE_CoDl_clearStencil(EVE_HalContext *phost, uint8_t s)
488{
489 EVE_CoCmd_dl(phost, CLEAR_STENCIL(s));
490}
491
496static inline void EVE_CoDl_clearTag(EVE_HalContext *phost, uint8_t s)
497{
498 EVE_CoCmd_dl(phost, CLEAR_TAG(s));
499}
500
505static inline void EVE_CoDl_stencilMask(EVE_HalContext *phost, uint8_t mask)
506{
507 EVE_CoCmd_dl(phost, STENCIL_MASK(mask));
508}
509
514static inline void EVE_CoDl_tagMask(EVE_HalContext *phost, bool mask)
515{
516 EVE_CoCmd_dl(phost, TAG_MASK(mask));
517}
518
524{
526#if EVE_DL_OPTIMIZE
527 EVE_DL_STATE.BitmapTransform = true;
528#endif
529}
530
536static inline void EVE_CoDl_bitmapTransformA_ex(EVE_HalContext *phost, bool p, uint16_t v)
537{
539#if EVE_DL_OPTIMIZE
540 EVE_DL_STATE.BitmapTransform = true;
541#endif
542}
543
549{
551#if EVE_DL_OPTIMIZE
552 EVE_DL_STATE.BitmapTransform = true;
553#endif
554}
555
561static inline void EVE_CoDl_bitmapTransformB_ex(EVE_HalContext *phost, bool p, uint16_t v)
562{
564#if EVE_DL_OPTIMIZE
565 EVE_DL_STATE.BitmapTransform = true;
566#endif
567}
568
574{
576#if EVE_DL_OPTIMIZE
577 EVE_DL_STATE.BitmapTransform = true;
578#endif
579}
580
586{
588#if EVE_DL_OPTIMIZE
589 EVE_DL_STATE.BitmapTransform = true;
590#endif
591}
592
598static inline void EVE_CoDl_bitmapTransformD_ex(EVE_HalContext *phost, bool p, uint16_t v)
599{
601#if EVE_DL_OPTIMIZE
602 EVE_DL_STATE.BitmapTransform = true;
603#endif
604}
605
611{
613#if EVE_DL_OPTIMIZE
614 EVE_DL_STATE.BitmapTransform = true;
615#endif
616}
617
623static inline void EVE_CoDl_bitmapTransformE_ex(EVE_HalContext *phost, bool p, uint16_t v)
624{
626#if EVE_DL_OPTIMIZE
627 EVE_DL_STATE.BitmapTransform = true;
628#endif
629}
630
636{
638#if EVE_DL_OPTIMIZE
639 EVE_DL_STATE.BitmapTransform = true;
640#endif
641}
642
654{
661#if EVE_DL_OPTIMIZE
662 EVE_DL_STATE.BitmapTransform = true;
663#endif
664}
665
670{
671#if EVE_DL_OPTIMIZE
672 if (EVE_DL_STATE.BitmapTransform)
673 {
674 /* Setting matrix can be skipped if already identity, since it's a no-op */
675#endif
676 EVE_CoDl_bitmapTransformA_ex(phost, 0, 256);
677 EVE_CoDl_bitmapTransformB_ex(phost, 0, 0);
679 EVE_CoDl_bitmapTransformD_ex(phost, 0, 0);
680 EVE_CoDl_bitmapTransformE_ex(phost, 0, 256);
682#if EVE_DL_OPTIMIZE
683 EVE_DL_STATE.BitmapTransform = false;
684 }
685#endif
686}
687
693static inline void EVE_CoDl_scissorXY(EVE_HalContext *phost, uint16_t x, uint16_t y)
694{
695#if EVE_DL_OPTIMIZE && EVE_DL_CACHE_SCISSOR
696 if (EVE_DL_STATE.ScissorX != x || EVE_DL_STATE.ScissorY != y)
697#endif
698 {
699 EVE_CoCmd_dl(phost, SCISSOR_XY(x, y));
700#if EVE_DL_CACHE_SCISSOR
701 EVE_DL_STATE.ScissorX = x;
702 EVE_DL_STATE.ScissorY = y;
703#endif
704 }
705}
706
712static inline void EVE_CoDl_scissorSize(EVE_HalContext *phost, uint16_t width, uint16_t height)
713{
714#if EVE_DL_OPTIMIZE && EVE_DL_CACHE_SCISSOR
715 if (EVE_DL_STATE.ScissorWidth != width || EVE_DL_STATE.ScissorHeight != height)
716#endif
717 {
718 EVE_CoCmd_dl(phost, SCISSOR_SIZE(width, height));
719#if EVE_DL_CACHE_SCISSOR
720 EVE_DL_STATE.ScissorWidth = width;
721 EVE_DL_STATE.ScissorHeight = height;
722#endif
723 }
724}
725
730static inline void EVE_CoDl_call(EVE_HalContext *phost, uint16_t dest)
731{
732 EVE_CoCmd_dl(phost, CALL(dest));
733}
734
739static inline void EVE_CoDl_jump(EVE_HalContext *phost, uint16_t dest)
740{
741 EVE_CoCmd_dl(phost, JUMP(dest));
742}
743
744ESD_FUNCTION(EVE_CoDl_begin, Type = void, Category = EveRenderFunctions, Inline)
745ESD_PARAMETER(phost, Type = EVE_HalContext *, Default = Esd_GetHost, Hidden, Internal, Static) // PHOST
746ESD_PARAMETER(prim, Type = uint8_t)
751static inline void EVE_CoDl_begin(EVE_HalContext *phost, uint8_t prim)
752{
753#if EVE_DL_OPTIMIZE
754 /* For continuous primitives, reset the active primitive. */
755 uint8_t oldPrim = phost->DlPrimitive;
756 switch (oldPrim)
757 {
758 case LINE_STRIP:
759 case EDGE_STRIP_R:
760 case EDGE_STRIP_L:
761 case EDGE_STRIP_A:
762 case EDGE_STRIP_B:
763 oldPrim = 0;
764 break;
765 default:
766 break;
767 }
768 if (prim != oldPrim)
769 {
770#endif
771 EVE_CoCmd_dl(phost, BEGIN(prim));
772#if EVE_DL_OPTIMIZE
773 phost->DlPrimitive = prim;
774 }
775#endif
776}
777
785static inline void EVE_CoDl_colorMask(EVE_HalContext *phost, bool r, bool g, bool b, bool a)
786{
787 EVE_CoCmd_dl(phost, COLOR_MASK(r, g, b, a));
788}
789
790ESD_FUNCTION(EVE_CoDl_end, Type = void, Category = EveRenderFunctions, Inline)
791ESD_PARAMETER(phost, Type = EVE_HalContext *, Default = Esd_GetHost, Hidden, Internal, Static) // PHOST
795inline static void EVE_CoDl_end(EVE_HalContext *phost)
796{
797#if EVE_DL_END_PRIMITIVE || !EVE_DL_OPTIMIZE
798#if EVE_DL_OPTIMIZE
799 if (phost->DlPrimitive != 0)
800 {
801#endif
802 EVE_CoCmd_dl(phost, END());
803#if EVE_DL_OPTIMIZE
804 phost->DlPrimitive = 0;
805 }
806#endif
807#endif
808}
809
810/* Save EVE context, see SAVE_CONTEXT */
811ESD_FUNCTION(EVE_CoDl_saveContext, Type = void, Category = EveRenderFunctions, Inline)
812ESD_PARAMETER(phost, Type = EVE_HalContext *, Default = Esd_GetHost, Hidden, Internal, Static) // PHOST
818inline static void EVE_CoDl_saveContext(EVE_HalContext *phost)
819{
820#if (EVE_DL_OPTIMIZE) || (EVE_DL_CACHE_SCISSOR) || (EVE_SUPPORT_CHIPID < EVE_FT810) || defined(EVE_MULTI_GRAPHICS_TARGET)
821 uint8_t nextState;
822#endif
823 EVE_CoCmd_dl(phost, SAVE_CONTEXT());
824#if (EVE_DL_OPTIMIZE) || (EVE_DL_CACHE_SCISSOR) || (EVE_SUPPORT_CHIPID < EVE_FT810) || defined(EVE_MULTI_GRAPHICS_TARGET)
825 nextState = (phost->DlStateIndex + 1) & EVE_DL_STATE_STACK_MASK;
826 phost->DlState[nextState] = phost->DlState[phost->DlStateIndex];
827 phost->DlStateIndex = nextState;
828#endif
829}
830
831/* Restore EVE context, see RESTORE_CONTEXT */
832ESD_FUNCTION(EVE_CoDl_restoreContext, Type = void, Category = EveRenderFunctions, Inline)
833ESD_PARAMETER(phost, Type = EVE_HalContext *, Default = Esd_GetHost, Hidden, Internal, Static) // PHOST
839inline static void EVE_CoDl_restoreContext(EVE_HalContext *phost)
840{
842#if (EVE_DL_OPTIMIZE) || (EVE_DL_CACHE_SCISSOR) || (EVE_SUPPORT_CHIPID < EVE_FT810) || defined(EVE_MULTI_GRAPHICS_TARGET)
843 phost->DlStateIndex = (phost->DlStateIndex - 1) & EVE_DL_STATE_STACK_MASK;
844#endif
845}
846
850static inline void EVE_CoDl_return(EVE_HalContext *phost)
851{
852 EVE_CoCmd_dl(phost, RETURN());
853}
854
859static inline void EVE_CoDl_macro(EVE_HalContext *phost, uint16_t m)
860{
861 EVE_CoCmd_dl(phost, MACRO(m));
862}
863
864ESD_FUNCTION(EVE_CoDl_clear, Type = void, Category = EveRenderFunctions, Inline)
865ESD_PARAMETER(phost, Type = EVE_HalContext *, Default = Esd_GetHost, Hidden, Internal, Static) // PHOST
866ESD_PARAMETER(c, Type = bool, DisplayName = "Clear Color")
867ESD_PARAMETER(s, Type = bool, DisplayName = "Clear Stencil")
868ESD_PARAMETER(t, Type = bool, DisplayName = "Clear Tag")
875static inline void EVE_CoDl_clear(EVE_HalContext *phost, bool c, bool s, bool t)
876{
877 EVE_CoCmd_dl(phost, CLEAR(c, s, t));
878}
879
884static inline void EVE_CoDl_vertexFormat(EVE_HalContext *phost, uint8_t frac)
885{
886#if (EVE_SUPPORT_CHIPID >= EVE_FT810) || defined(EVE_MULTI_GRAPHICS_TARGET)
887 if (EVE_CHIPID >= EVE_FT810)
888 {
889#if EVE_DL_OPTIMIZE
890 if (frac != EVE_DL_STATE.VertexFormat)
891 {
892#endif
893 EVE_CoCmd_dl(phost, VERTEX_FORMAT(frac));
894#if EVE_DL_OPTIMIZE
895 EVE_DL_STATE.VertexFormat = frac;
896 }
897#endif
898 }
899 else
900#endif
901 {
902#if (EVE_SUPPORT_CHIPID < EVE_FT810) || defined(EVE_MULTI_GRAPHICS_TARGET)
903 /* Compatibility for FT80X series */
904 EVE_DL_STATE.VertexFormat = (4 - frac);
905#endif
906 }
907}
908
909/* Set palette source, see PALETTE_SOURCE command */
910ESD_FUNCTION(EVE_CoDl_paletteSource, Type = void, Category = EveRenderFunctions, Inline)
911ESD_PARAMETER(phost, Type = EVE_HalContext *, Default = Esd_GetHost, Hidden, Internal, Static) // PHOST
912ESD_PARAMETER(addr, Type = uint32_t, Min = 0)
920{
921#if (EVE_SUPPORT_CHIPID >= EVE_FT810)
922 if (EVE_CHIPID >= EVE_FT810)
923 {
924#if EVE_DL_OPTIMIZE
925 if (addr != EVE_DL_STATE.PaletteSource)
926 {
927#endif
929#if EVE_DL_OPTIMIZE
930 EVE_DL_STATE.PaletteSource = addr;
931 }
932#endif
933 }
934#endif
935}
936
942{
943#if (EVE_SUPPORT_CHIPID >= EVE_FT810) || defined(EVE_MULTI_GRAPHICS_TARGET)
944 if (EVE_CHIPID >= EVE_FT810)
945 {
947 }
948 else
949#endif
950 {
951#if (EVE_SUPPORT_CHIPID < EVE_FT810) || defined(EVE_MULTI_GRAPHICS_TARGET)
952 /* Compatibility for FT80X series */
953 EVE_DL_STATE.VertexTranslateX = x;
954#endif
955 }
956}
957
963{
964#if (EVE_SUPPORT_CHIPID >= EVE_FT810) || defined(EVE_MULTI_GRAPHICS_TARGET)
965 if (EVE_CHIPID >= EVE_FT810)
966 {
968 }
969 else
970#endif
971 {
972#if (EVE_SUPPORT_CHIPID < EVE_FT810) || defined(EVE_MULTI_GRAPHICS_TARGET)
973 /* Compatibility for FT80X series */
974 EVE_DL_STATE.VertexTranslateY = y;
975#endif
976 }
977}
978
982static inline void EVE_CoDl_nop(EVE_HalContext *phost)
983{
984#if (EVE_SUPPORT_CHIPID >= EVE_BT815) || defined(EVE_MULTI_GRAPHICS_TARGET)
985 if (EVE_CHIPID >= EVE_BT815)
986 {
987 EVE_CoCmd_dl(phost, NOP());
988 }
989#endif
990}
991
996static inline void EVE_CoDl_bitmapExtFormat(EVE_HalContext *phost, uint16_t format)
997{
998#if (EVE_SUPPORT_CHIPID >= EVE_BT815) || defined(EVE_MULTI_GRAPHICS_TARGET)
999 if (EVE_CHIPID >= EVE_BT815)
1000 {
1001 EVE_CoCmd_dl(phost, BITMAP_EXT_FORMAT(format));
1002 }
1003#endif
1004}
1005
1014{
1015#if (EVE_SUPPORT_CHIPID >= EVE_BT815) || defined(EVE_MULTI_GRAPHICS_TARGET)
1016 if (EVE_CHIPID >= EVE_BT815)
1017 {
1018 EVE_CoCmd_dl(phost, BITMAP_SWIZZLE(r, g, b, a));
1019 }
1020#endif
1021}
1022
1023/* Fixed point vertex using 4 bits subprecision */
1024ESD_FUNCTION(EVE_CoDl_vertex2f_4, Type = void, Category = EveRenderFunctions, Inline)
1025ESD_PARAMETER(phost, Type = EVE_HalContext *, Default = Esd_GetHost, Hidden, Internal, Static) // PHOST
1026ESD_PARAMETER(x, Type = esd_int16_f4_t)
1027ESD_PARAMETER(y, Type = esd_int16_f4_t)
1035inline static void EVE_CoDl_vertex2f_4(EVE_HalContext *phost, int16_t x, int16_t y)
1036{
1037 if (EVE_CHIPID >= EVE_FT810 && (x > EVE_VERTEX2F_MAX || y > EVE_VERTEX2F_MAX)) /* Support display up to 2048 px */
1038 {
1039 EVE_CoDl_vertexFormat(phost, 3);
1040 EVE_CoDl_vertex2f(phost, x >> 1, y >> 1);
1041 }
1042 else
1043 {
1044 EVE_CoDl_vertexFormat(phost, 4);
1045 EVE_CoDl_vertex2f(phost, x, y);
1046 }
1047}
1048
1049/* Fixed point vertex using 2 bits subprecision */
1050ESD_FUNCTION(EVE_CoDl_vertex2f_2, Type = void, Category = EveRenderFunctions, Inline)
1051ESD_PARAMETER(phost, Type = EVE_HalContext *, Default = Esd_GetHost, Hidden, Internal, Static) // PHOST
1052ESD_PARAMETER(x, Type = esd_int16_f2_t)
1053ESD_PARAMETER(y, Type = esd_int16_f2_t)
1061inline static void EVE_CoDl_vertex2f_2(EVE_HalContext *phost, int16_t x, int16_t y)
1062{
1063 EVE_CoDl_vertexFormat(phost, 2);
1064 EVE_CoDl_vertex2f(phost, x, y);
1065}
1066
1067/* Fixed point vertex using 0 bits subprecision, or integer point vertex */
1068ESD_FUNCTION(EVE_CoDl_vertex2f_0, Type = void, Category = EveRenderFunctions, Inline)
1069ESD_PARAMETER(phost, Type = EVE_HalContext *, Default = Esd_GetHost, Hidden, Internal, Static) // PHOST
1070ESD_PARAMETER(x, Type = int16_t)
1071ESD_PARAMETER(y, Type = int16_t)
1079inline static void EVE_CoDl_vertex2f_0(EVE_HalContext *phost, int16_t x, int16_t y)
1080{
1081 EVE_CoDl_vertexFormat(phost, 0);
1082 EVE_CoDl_vertex2f(phost, x, y);
1083}
1084
1085#endif /* EVE_CO_DL__H */
1086
1087/* end of file */
static uint32_t a
Definition Common.c:36
static uint32_t b
Definition Common.c:37
static uint32_t d
Definition Common.c:39
static uint32_t e
Definition Common.c:40
static uint32_t c
Definition Common.c:38
static uint32_t f
Definition Common.c:41
EVE's co-processor commmands.
static void EVE_CoCmd_dl(EVE_HalContext *phost, uint32_t dl)
Write a display list instruction. Example: EVE_CoCmd_dl(DISPLAY());.
Definition EVE_CoCmd.h:117
#define ESD_FUNCTION(name,...)
Definition EVE_CoCmd.h:48
#define ESD_PARAMETER(name,...)
Definition EVE_CoCmd.h:54
static void EVE_CoDl_clearTag(EVE_HalContext *phost, uint8_t s)
Definition EVE_CoDl.h:496
static void EVE_CoDl_bitmapTransformA_ex(EVE_HalContext *phost, bool p, uint16_t v)
Definition EVE_CoDl.h:536
static void EVE_CoDl_tag(EVE_HalContext *phost, uint8_t s)
Set current tag.
Definition EVE_CoDl.h:230
static void EVE_CoDl_lineWidth(EVE_HalContext *phost, int16_t width)
Definition EVE_CoDl.h:470
static void EVE_CoDl_tagMask(EVE_HalContext *phost, bool mask)
Definition EVE_CoDl.h:514
static void EVE_CoDl_blendFunc_default(EVE_HalContext *phost)
Definition EVE_CoDl.h:428
static void EVE_CoDl_colorRgb(EVE_HalContext *phost, uint8_t r, uint8_t g, uint8_t b)
Specify color RGB.
Definition EVE_CoDl.h:267
static void EVE_CoDl_restoreContext(EVE_HalContext *phost)
Restore EVE context, see RESTORE_CONTEXT.
Definition EVE_CoDl.h:839
static void EVE_CoDl_display(EVE_HalContext *phost)
Definition EVE_CoDl.h:69
static void EVE_CoDl_bitmapSource(EVE_HalContext *phost, uint32_t addr)
Definition EVE_CoDl.h:145
static void EVE_CoDl_nop(EVE_HalContext *phost)
Definition EVE_CoDl.h:982
static void EVE_CoDl_stencilFunc(EVE_HalContext *phost, uint8_t func, uint8_t ref, uint8_t mask)
Definition EVE_CoDl.h:410
static void EVE_CoDl_vertexTranslateX(EVE_HalContext *phost, int16_t x)
Definition EVE_CoDl.h:941
static void EVE_CoDl_paletteSource(EVE_HalContext *phost, uint32_t addr)
Set palette source, see PALETTE_SOURCE command.
Definition EVE_CoDl.h:919
static void EVE_CoDl_vertex2f_0(EVE_HalContext *phost, int16_t x, int16_t y)
Fixed point vertex using 0 bits subprecision, or integer point vertex.
Definition EVE_CoDl.h:1079
static void EVE_CoDl_cell(EVE_HalContext *phost, uint8_t cell)
Specify cell number for bitmap, see CELL.
Definition EVE_CoDl.h:345
static void EVE_CoDl_vertex2f_4(EVE_HalContext *phost, int16_t x, int16_t y)
Fixed point vertex using 4 bits subprecision.
Definition EVE_CoDl.h:1035
static void EVE_CoDl_colorArgb_ex(EVE_HalContext *phost, uint32_t c)
Specify color: Alpha (bits 31:24) + RGB (bits 23:0)
Definition EVE_CoDl.h:306
static void EVE_CoDl_begin(EVE_HalContext *phost, uint8_t prim)
Definition EVE_CoDl.h:751
static void EVE_CoDl_blendFunc(EVE_HalContext *phost, uint8_t src, uint8_t dst)
Definition EVE_CoDl.h:420
static void EVE_CoDl_bitmapTransform_ex(EVE_HalContext *phost, bool p, uint16_t a, uint16_t b, uint32_t c, uint16_t d, uint16_t e, uint32_t f)
Definition EVE_CoDl.h:653
static void EVE_CoDl_bitmapTransformB_ex(EVE_HalContext *phost, bool p, uint16_t v)
Definition EVE_CoDl.h:561
static void EVE_CoDl_clearStencil(EVE_HalContext *phost, uint8_t s)
Definition EVE_CoDl.h:487
static void EVE_CoDl_bitmapTransformF(EVE_HalContext *phost, uint32_t v)
Definition EVE_CoDl.h:635
static void EVE_CoDl_clearColorRgb(EVE_HalContext *phost, uint8_t r, uint8_t g, uint8_t b)
Specify clear color RGB.
Definition EVE_CoDl.h:183
static void EVE_CoDl_stencilOp(EVE_HalContext *phost, uint8_t sfail, uint8_t spass)
Definition EVE_CoDl.h:438
static void EVE_CoDl_vertexFormat(EVE_HalContext *phost, uint8_t frac)
Definition EVE_CoDl.h:884
static void EVE_CoDl_bitmapTransform_identity(EVE_HalContext *phost)
Definition EVE_CoDl.h:669
static void EVE_CoDl_stencilMask(EVE_HalContext *phost, uint8_t mask)
Definition EVE_CoDl.h:505
static void EVE_CoDl_bitmapSize(EVE_HalContext *phost, uint8_t filter, uint8_t wrapx, uint8_t wrapy, uint16_t width, uint16_t height)
Definition EVE_CoDl.h:383
static void EVE_CoDl_bitmapTransformE(EVE_HalContext *phost, uint16_t v)
Definition EVE_CoDl.h:610
static void EVE_CoDl_scissorXY(EVE_HalContext *phost, uint16_t x, uint16_t y)
Definition EVE_CoDl.h:693
static void EVE_CoDl_pointSize(EVE_HalContext *phost, int16_t size)
Definition EVE_CoDl.h:450
static void EVE_CoDl_clearColorRgb_ex(EVE_HalContext *phost, uint32_t c)
Specify clear color RGB.
Definition EVE_CoDl.h:170
static void EVE_CoDl_bitmapLayout(EVE_HalContext *phost, uint8_t format, uint16_t linestride, uint16_t height)
Definition EVE_CoDl.h:364
static void EVE_CoDl_colorRgb_ex(EVE_HalContext *phost, uint32_t c)
Specify color RGB.
Definition EVE_CoDl.h:245
EVE_HAL_EXPORT void EVE_CoDlImpl_resetCoState(EVE_HalContext *phost)
Definition EVE_CoDl.c:83
static void EVE_CoDl_bitmapTransformD_ex(EVE_HalContext *phost, bool p, uint16_t v)
Definition EVE_CoDl.h:598
static void EVE_CoDl_colorA(EVE_HalContext *phost, uint8_t alpha)
Specify alpha channel.
Definition EVE_CoDl.h:283
static void EVE_CoDl_clearColorA(EVE_HalContext *phost, uint8_t alpha)
Specify clear alpha channel.
Definition EVE_CoDl.h:198
static void EVE_CoDl_clear(EVE_HalContext *phost, bool c, bool s, bool t)
Definition EVE_CoDl.h:875
static void EVE_CoDl_bitmapHandle(EVE_HalContext *phost, uint8_t handle)
Specify bitmap handle, see BITMAP_HANDLE.
Definition EVE_CoDl.h:322
static void EVE_CoDl_alphaFunc(EVE_HalContext *phost, uint8_t func, uint8_t ref)
Definition EVE_CoDl.h:399
static void EVE_CoDl_bitmapSwizzle(EVE_HalContext *phost, uint8_t r, uint8_t g, uint8_t b, uint8_t a)
Definition EVE_CoDl.h:1013
static void EVE_CoDl_jump(EVE_HalContext *phost, uint16_t dest)
Definition EVE_CoDl.h:739
static void EVE_CoDl_saveContext(EVE_HalContext *phost)
Save EVE context, see SAVE_CONTEXT.
Definition EVE_CoDl.h:818
static void EVE_CoDl_vertexTranslateY(EVE_HalContext *phost, int16_t y)
Definition EVE_CoDl.h:962
static void EVE_CoDl_bitmapTransformE_ex(EVE_HalContext *phost, bool p, uint16_t v)
Definition EVE_CoDl.h:623
static void EVE_CoDl_end(EVE_HalContext *phost)
Definition EVE_CoDl.h:795
static void EVE_CoDl_bitmapTransformA(EVE_HalContext *phost, uint16_t v)
Definition EVE_CoDl.h:523
static void EVE_CoDl_bitmapExtFormat(EVE_HalContext *phost, uint16_t format)
Definition EVE_CoDl.h:996
static void EVE_CoDl_clearColorArgb_ex(EVE_HalContext *phost, uint32_t c)
Specify clear color: Alpha (bits 31:24) + RGB (bits 23:0)
Definition EVE_CoDl.h:213
EVE_HAL_EXPORT void EVE_CoDlImpl_resetDlState(EVE_HalContext *phost)
Definition EVE_CoDl.c:38
static void EVE_CoDl_bitmapSource_ex(EVE_HalContext *phost, uint32_t addr, bool flash)
Definition EVE_CoDl.h:155
static void EVE_CoDl_vertex2f(EVE_HalContext *phost, int16_t x, int16_t y)
Fixed point vertex with subprecision depending on current vertex format.
Definition EVE_CoDl.h:86
static void EVE_CoDl_vertex2f_2(EVE_HalContext *phost, int16_t x, int16_t y)
Fixed point vertex using 2 bits subprecision.
Definition EVE_CoDl.h:1061
#define EVE_VERTEX2F_MAX
Definition EVE_CoDl.h:54
static void EVE_CoDl_call(EVE_HalContext *phost, uint16_t dest)
Definition EVE_CoDl.h:730
static void EVE_CoDl_bitmapTransformB(EVE_HalContext *phost, uint16_t v)
Definition EVE_CoDl.h:548
static void EVE_CoDl_vertex2ii(EVE_HalContext *phost, uint16_t x, uint16_t y, uint8_t handle, uint8_t cell)
Definition EVE_CoDl.h:126
static void EVE_CoDl_return(EVE_HalContext *phost)
Definition EVE_CoDl.h:850
static void EVE_CoDl_colorMask(EVE_HalContext *phost, bool r, bool g, bool b, bool a)
Definition EVE_CoDl.h:785
static void EVE_CoDl_bitmapTransformC(EVE_HalContext *phost, uint32_t v)
Definition EVE_CoDl.h:573
static void EVE_CoDl_scissorSize(EVE_HalContext *phost, uint16_t width, uint16_t height)
Definition EVE_CoDl.h:712
static void EVE_CoDl_macro(EVE_HalContext *phost, uint16_t m)
Definition EVE_CoDl.h:859
static void EVE_CoDl_bitmapTransformD(EVE_HalContext *phost, uint16_t v)
Definition EVE_CoDl.h:585
#define EVE_HAL_EXPORT
#define EVE_BT815
Definition EVE_Config.h:66
#define EVE_DL_STATE_STACK_MASK
#define EVE_CHIPID
#define EVE_FT810
Definition EVE_Config.h:58
#define VERTEX2F(x, y)
#define VERTEX_TRANSLATE_Y(y)
#define SRC_ALPHA
#define POINT_SIZE(size)
#define SAVE_CONTEXT()
#define TAG_MASK(mask)
#define EDGE_STRIP_B
#define CLEAR(c, s, t)
#define BITMAP_LAYOUT(format, linestride, height)
#define BITMAP_TRANSFORM_B(b)
#define BITMAP_TRANSFORM_E(e)
#define VERTEX_FORMAT(frac)
#define EDGE_STRIP_L
#define BEGIN(prim)
#define BITMAP_TRANSFORM_B_EXT(p, v)
#define BITMAP_HANDLE(handle)
#define RETURN()
#define BITMAP_SIZE_H(width, height)
#define DISPLAY()
#define JUMP(dest)
#define RESTORE_CONTEXT()
#define BITMAP_TRANSFORM_D(d)
#define BITMAP_EXT_FORMAT(format)
#define END()
#define BITMAP_TRANSFORM_C(c)
#define COLOR_RGB(red, green, blue)
#define TAG(s)
#define BITMAP_SOURCE(addr)
#define ONE_MINUS_SRC_ALPHA
#define BLEND_FUNC(src, dst)
#define BITMAP_TRANSFORM_E_EXT(p, v)
#define VERTEX_TRANSLATE_X(x)
#define CALL(dest)
#define ALPHA_FUNC(func, ref)
#define BITMAP_TRANSFORM_A(a)
#define CLEAR_TAG(s)
#define STENCIL_MASK(mask)
#define LINE_WIDTH(width)
#define MACRO(m)
#define EDGE_STRIP_R
#define BITMAP_SOURCE2(flash_or_ram, addr)
#define BITMAP_TRANSFORM_F(f)
#define BITMAP_LAYOUT_H(linestride, height)
#define EDGE_STRIP_A
#define SCISSOR_SIZE(width, height)
#define BITMAP_SWIZZLE(r, g, b, a)
#define PALETTE_SOURCE(addr)
#define BITMAP_SIZE(filter, wrapx, wrapy, width, height)
#define LINE_STRIP
#define BITMAP_TRANSFORM_D_EXT(p, v)
#define COLOR_MASK(r, g, b, a)
#define COLOR_A(alpha)
#define CELL(cell)
#define STENCIL_OP(sfail, spass)
#define NOP()
#define CLEAR_COLOR_A(alpha)
#define CLEAR_STENCIL(s)
#define STENCIL_FUNC(func, ref, mask)
#define BITMAP_TRANSFORM_A_EXT(p, v)
#define CLEAR_COLOR_RGB(red, green, blue)
#define VERTEX2II(x, y, handle, cell)
#define SCISSOR_XY(x, y)
#define EVE_DL_STATE
unsigned short uint16_t
unsigned int uint32_t
short int16_t
unsigned char uint8_t
static ft_uint32_t addr
Definition FT_Gpu_Hal.h:139