Split into shared-module and shared-bindings

This commit is contained in:
James Bowman 2020-02-07 10:30:49 -08:00
parent a20490c0b3
commit 5c6d94d3e5
5 changed files with 557 additions and 259 deletions

View File

@ -363,7 +363,8 @@ SRC_SHARED_MODULE_ALL = \
uheap/__init__.c \
ustack/__init__.c \
_pew/__init__.c \
_pew/PewPew.c
_pew/PewPew.c \
_eve/__init__.c
# All possible sources are listed here, and are filtered by SRC_PATTERNS.
SRC_SHARED_MODULE = $(filter $(SRC_PATTERNS), $(SRC_SHARED_MODULE_ALL))

View File

@ -31,6 +31,8 @@
#include "py/runtime.h"
#include "py/binary.h"
#include "shared-module/_eve/__init__.h"
//| :mod:`_eve` --- low-level BridgeTek EVE bindings
//| ================================================
//|
@ -45,94 +47,57 @@
typedef struct _mp_obj__EVE_t {
mp_obj_base_t base;
mp_obj_t dest[3]; // Own 'write' method, plus argument
int vscale; // fixed-point scaling used for Vertex2f
size_t n; // Current size of command buffer
uint8_t buf[512]; // Command buffer
common_hal__eve_t _eve;
} mp_obj__EVE_t;
STATIC const mp_obj_type_t _EVE_type;
STATIC void _write(mp_obj__EVE_t *_EVE, mp_obj_t b) {
_EVE->dest[2] = b;
mp_call_method_n_kw(1, 0, _EVE->dest);
}
#define EVEHAL(s) \
(&((mp_obj__EVE_t*)mp_instance_cast_to_native_base((s), &_EVE_type))->_eve)
STATIC mp_obj_t _register(mp_obj_t self, mp_obj_t o) {
mp_obj__EVE_t *_EVE = mp_instance_cast_to_native_base(self, &_EVE_type);
mp_load_method(o, MP_QSTR_write, _EVE->dest);
common_hal__eve_t *eve = EVEHAL(self);
mp_load_method(o, MP_QSTR_write, eve->dest);
return mp_const_none;
}
STATIC MP_DEFINE_CONST_FUN_OBJ_2(register_obj, _register);
STATIC mp_obj_t _flush(mp_obj_t self) {
mp_obj__EVE_t *_EVE = mp_instance_cast_to_native_base(self, &_EVE_type);
if (_EVE->n != 0) {
_write(_EVE, mp_obj_new_bytearray_by_ref(_EVE->n, _EVE->buf));
_EVE->n = 0;
}
common_hal__eve_flush(EVEHAL(self));
return mp_const_none;
}
STATIC MP_DEFINE_CONST_FUN_OBJ_1(flush_obj, _flush);
STATIC void *append(mp_obj_t self, size_t m) {
mp_obj__EVE_t *_EVE = mp_instance_cast_to_native_base(self, &_EVE_type);
if ((_EVE->n + m) > sizeof(_EVE->buf))
_flush((mp_obj_t)_EVE);
uint8_t *r = _EVE->buf + _EVE->n;
_EVE->n += m;
return (void*)r;
}
STATIC mp_obj_t _cc(mp_obj_t self, mp_obj_t b) {
mp_obj__EVE_t *_EVE = mp_instance_cast_to_native_base(self, &_EVE_type);
mp_buffer_info_t buffer_info;
mp_get_buffer_raise(b, &buffer_info, MP_BUFFER_READ);
if (buffer_info.len <= sizeof(_EVE->buf)) {
uint8_t *p = (uint8_t*)append(_EVE, buffer_info.len);
// memcpy(p, buffer_info.buf, buffer_info.len);
uint8_t *s = buffer_info.buf;
for (size_t i = 0; i < buffer_info.len; i++)
*p++ = *s++;
} else {
_flush(self);
_write(_EVE, b);
}
common_hal__eve_add(EVEHAL(self), buffer_info.len, buffer_info.buf);
return mp_const_none;
}
STATIC MP_DEFINE_CONST_FUN_OBJ_2(cc_obj, _cc);
#define C4(self, u) (*(uint32_t*)append((self), sizeof(uint32_t)) = (u))
#include "mod_eve-gen.h"
// Hand-written functions {
#define ADD_X(self, x) \
common_hal__eve_add(EVEHAL(self), sizeof(x), &(x));
STATIC mp_obj_t _cmd0(mp_obj_t self, mp_obj_t n) {
C4(self, (0xffffff00 | mp_obj_get_int_truncated(n)));
uint32_t code = 0xffffff00 | mp_obj_get_int_truncated(n);
ADD_X(self, code);
return mp_const_none;
}
STATIC MP_DEFINE_CONST_FUN_OBJ_2(cmd0_obj, _cmd0);
STATIC mp_obj_t _vertex2f(mp_obj_t self, mp_obj_t a0, mp_obj_t a1) {
mp_obj__EVE_t *_EVE = mp_instance_cast_to_native_base(self, &_EVE_type);
int16_t x = (int16_t)(_EVE->vscale * mp_obj_get_float(a0));
int16_t y = (int16_t)(_EVE->vscale * mp_obj_get_float(a1));
C4(self, (0x40000000 | ((x & 32767) << 15) | (y & 32767)));
mp_float_t x = mp_obj_get_float(a0);
mp_float_t y = mp_obj_get_float(a1);
common_hal__eve_Vertex2f(EVEHAL(self), x, y);
return mp_const_none;
}
STATIC MP_DEFINE_CONST_FUN_OBJ_3(vertex2f_obj, _vertex2f);
STATIC mp_obj_t _vertexformat(mp_obj_t self, mp_obj_t a0) {
mp_obj__EVE_t *_EVE = mp_instance_cast_to_native_base(self, &_EVE_type);
uint32_t frac = mp_obj_get_int_truncated(a0);
C4(self, ((0x27 << 24) | (frac & 3)));
_EVE->vscale = 1 << frac;
return mp_const_none;
}
STATIC MP_DEFINE_CONST_FUN_OBJ_2(vertexformat_obj, _vertexformat);
STATIC mp_obj_t _cmd(size_t n_args, const mp_obj_t *args) {
mp_obj_t self = args[0];
mp_obj_t num = args[1];
@ -159,7 +124,8 @@ STATIC mp_obj_t _cmd(size_t n_args, const mp_obj_t *args) {
}
}
uint32_t *p = (uint32_t*)append(self, sizeof(uint32_t) * (1 + n));
uint32_t buf[16];
uint32_t *p = buf;
*p++ = 0xffffff00 | mp_obj_get_int_truncated(num);
mp_obj_t *a = items;
uint32_t lo;
@ -181,6 +147,8 @@ STATIC mp_obj_t _cmd(size_t n_args, const mp_obj_t *args) {
break;
}
}
common_hal__eve_add(EVEHAL(self), sizeof(uint32_t) * (1 + n), buf);
return mp_const_none;
}
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(cmd_obj, 4, 4, _cmd);
@ -190,7 +158,6 @@ STATIC const mp_rom_map_elem_t _EVE_locals_dict_table[] = {
{ MP_ROM_QSTR(MP_QSTR_cc), MP_ROM_PTR(&cc_obj) },
{ MP_ROM_QSTR(MP_QSTR_flush), MP_ROM_PTR(&flush_obj) },
{ MP_ROM_QSTR(MP_QSTR_Vertex2f), MP_ROM_PTR(&vertex2f_obj) },
{ MP_ROM_QSTR(MP_QSTR_VertexFormat), MP_ROM_PTR(&vertexformat_obj) },
{ MP_ROM_QSTR(MP_QSTR_cmd), MP_ROM_PTR(&cmd_obj) },
{ MP_ROM_QSTR(MP_QSTR_cmd0), MP_ROM_PTR(&cmd0_obj) },
ROM_DECLS
@ -206,10 +173,9 @@ STATIC void _EVE_print(const mp_print_t *print, mp_obj_t self_in, mp_print_kind_
STATIC mp_obj_t _EVE_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *args, mp_map_t *kw_args) {
// mp_arg_check_num(n_args, kw_args, 1, 1, false);
mp_obj__EVE_t *o = m_new_obj(mp_obj__EVE_t);
mp_printf(&mp_plat_print, "_EVE %p make_new\n", o);
o->base.type = &_EVE_type;
o->n = 0;
o->vscale = 16;
o->_eve.n = 0;
o->_eve.vscale = 16;
return MP_OBJ_FROM_PTR(o);
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,270 @@
/*
* This file is part of the MicroPython project, http://micropython.org/
*
* The MIT License (MIT)
*
* Copyright (c) 2020 James Bowman for Excamera Labs
*
* 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.
*/
#include <stddef.h>
#include <stdint.h>
#include "py/runtime.h"
#include "shared-module/_eve/__init__.h"
STATIC void write(common_hal__eve_t *eve, size_t len, void *buf) {
eve->dest[2] = mp_obj_new_bytearray_by_ref(len, buf);
mp_call_method_n_kw(1, 0, eve->dest);
}
void common_hal__eve_flush(common_hal__eve_t *eve) {
if (eve->n != 0) {
write(eve, eve->n, eve->buf);
eve->n = 0;
}
}
static void *append(common_hal__eve_t *eve, size_t m) {
if ((eve->n + m) > sizeof(eve->buf))
common_hal__eve_flush(eve);
uint8_t *r = eve->buf + eve->n;
eve->n += m;
return (void*)r;
}
void common_hal__eve_add(common_hal__eve_t *eve, size_t len, void *buf) {
if (len <= sizeof(eve->buf)) {
uint8_t *p = (uint8_t*)append(eve, len);
// memcpy(p, buffer_info.buf, buffer_info.len);
uint8_t *s = buf; for (size_t i = 0; i < len; i++) *p++ = *s++;
} else {
common_hal__eve_flush(eve);
write(eve, len, buf);
}
}
#define C4(eve, u) (*(uint32_t*)append((eve), sizeof(uint32_t)) = (u))
void common_hal__eve_Vertex2f(common_hal__eve_t *eve, mp_float_t x, mp_float_t y) {
int16_t ix = (int)(eve->vscale * x);
int16_t iy = (int)(eve->vscale * y);
C4(eve, (1 << 30) | ((ix & 32767) << 15) | (iy & 32767));
}
void common_hal__eve_VertexFormat(common_hal__eve_t *eve, uint32_t frac)
{
C4(eve, ((27 << 24) | ((frac & 7))));
eve->vscale = 1 << eve->vscale;
}
void common_hal__eve_AlphaFunc(common_hal__eve_t *eve, uint32_t func, uint32_t ref) {
C4(eve, ((9 << 24) | ((func & 7) << 8) | ((ref & 255))));
}
void common_hal__eve_Begin(common_hal__eve_t *eve, uint32_t prim) {
C4(eve, ((31 << 24) | ((prim & 15))));
}
void common_hal__eve_BitmapExtFormat(common_hal__eve_t *eve, uint32_t fmt) {
C4(eve, ((46 << 24) | (fmt & 65535)));
}
void common_hal__eve_BitmapHandle(common_hal__eve_t *eve, uint32_t handle) {
C4(eve, ((5 << 24) | ((handle & 31))));
}
void common_hal__eve_BitmapLayoutH(common_hal__eve_t *eve, uint32_t linestride, uint32_t height) {
C4(eve, ((40 << 24) | (((linestride) & 3) << 2) | (((height) & 3))));
}
void common_hal__eve_BitmapLayout(common_hal__eve_t *eve, uint32_t format, uint32_t linestride, uint32_t height) {
C4(eve, ((7 << 24) | ((format & 31) << 19) | ((linestride & 1023) << 9) | ((height & 511))));
}
void common_hal__eve_BitmapSizeH(common_hal__eve_t *eve, uint32_t width, uint32_t height) {
C4(eve, ((41 << 24) | (((width) & 3) << 2) | (((height) & 3))));
}
void common_hal__eve_BitmapSize(common_hal__eve_t *eve, uint32_t filter, uint32_t wrapx, uint32_t wrapy, uint32_t width, uint32_t height) {
C4(eve, ((8 << 24) | ((filter & 1) << 20) | ((wrapx & 1) << 19) | ((wrapy & 1) << 18) | ((width & 511) << 9) | ((height & 511))));
}
void common_hal__eve_BitmapSource(common_hal__eve_t *eve, uint32_t addr) {
C4(eve, ((1 << 24) | ((addr & 0xffffff))));
}
void common_hal__eve_BitmapSwizzle(common_hal__eve_t *eve, uint32_t r, uint32_t g, uint32_t b, uint32_t a) {
C4(eve, ((47 << 24) | ((r & 7) << 9) | ((g & 7) << 6) | ((b & 7) << 3) | ((a & 7))));
}
void common_hal__eve_BitmapTransformA(common_hal__eve_t *eve, uint32_t a, uint32_t p) {
C4(eve, ((21 << 24) | ((p & 1) << 17) | ((a & 131071))));
}
void common_hal__eve_BitmapTransformB(common_hal__eve_t *eve, uint32_t b, uint32_t p) {
C4(eve, ((22 << 24) | ((p & 1) << 17) | ((b & 131071))));
}
void common_hal__eve_BitmapTransformC(common_hal__eve_t *eve, uint32_t c, uint32_t p) {
C4(eve, ((23 << 24) | ((p & 1) << 17) | ((c & 16777215))));
}
void common_hal__eve_BitmapTransformD(common_hal__eve_t *eve, uint32_t d, uint32_t p) {
C4(eve, ((24 << 24) | ((p & 1) << 17) | ((d & 131071))));
}
void common_hal__eve_BitmapTransformE(common_hal__eve_t *eve, uint32_t e, uint32_t p) {
C4(eve, ((25 << 24) | ((p & 1) << 17) | ((e & 131071))));
}
void common_hal__eve_BitmapTransformF(common_hal__eve_t *eve, uint32_t f, uint32_t p) {
C4(eve, ((26 << 24) | ((p & 1) << 17) | ((f & 16777215))));
}
void common_hal__eve_BlendFunc(common_hal__eve_t *eve, uint32_t src, uint32_t dst) {
C4(eve, ((11 << 24) | ((src & 7) << 3) | ((dst & 7))));
}
void common_hal__eve_Call(common_hal__eve_t *eve, uint32_t dest) {
C4(eve, ((29 << 24) | ((dest & 65535))));
}
void common_hal__eve_Cell(common_hal__eve_t *eve, uint32_t cell) {
C4(eve, ((6 << 24) | ((cell & 127))));
}
void common_hal__eve_ClearColorA(common_hal__eve_t *eve, uint32_t alpha) {
C4(eve, ((15 << 24) | ((alpha & 255))));
}
void common_hal__eve_ClearColorRGB(common_hal__eve_t *eve, uint32_t red, uint32_t green, uint32_t blue) {
C4(eve, ((2 << 24) | ((red & 255) << 16) | ((green & 255) << 8) | ((blue & 255))));
}
void common_hal__eve_Clear(common_hal__eve_t *eve, uint32_t c, uint32_t s, uint32_t t) {
C4(eve, ((38 << 24) | ((c & 1) << 2) | ((s & 1) << 1) | ((t & 1))));
}
void common_hal__eve_ClearStencil(common_hal__eve_t *eve, uint32_t s) {
C4(eve, ((17 << 24) | ((s & 255))));
}
void common_hal__eve_ClearTag(common_hal__eve_t *eve, uint32_t s) {
C4(eve, ((18 << 24) | ((s & 255))));
}
void common_hal__eve_ColorA(common_hal__eve_t *eve, uint32_t alpha) {
C4(eve, ((16 << 24) | ((alpha & 255))));
}
void common_hal__eve_ColorMask(common_hal__eve_t *eve, uint32_t r, uint32_t g, uint32_t b, uint32_t a) {
C4(eve, ((32 << 24) | ((r & 1) << 3) | ((g & 1) << 2) | ((b & 1) << 1) | ((a & 1))));
}
void common_hal__eve_ColorRGB(common_hal__eve_t *eve, uint32_t red, uint32_t green, uint32_t blue) {
C4(eve, ((4 << 24) | ((red & 255) << 16) | ((green & 255) << 8) | ((blue & 255))));
}
void common_hal__eve_Display(common_hal__eve_t *eve) {
C4(eve, ((0 << 24)));
}
void common_hal__eve_End(common_hal__eve_t *eve) {
C4(eve, ((33 << 24)));
}
void common_hal__eve_Jump(common_hal__eve_t *eve, uint32_t dest) {
C4(eve, ((30 << 24) | ((dest & 65535))));
}
void common_hal__eve_LineWidth(common_hal__eve_t *eve, uint32_t width) {
C4(eve, ((14 << 24) | ((width & 4095))));
}
void common_hal__eve_Macro(common_hal__eve_t *eve, uint32_t m) {
C4(eve, ((37 << 24) | ((m & 1))));
}
void common_hal__eve_Nop(common_hal__eve_t *eve) {
C4(eve, ((45 << 24)));
}
void common_hal__eve_PaletteSource(common_hal__eve_t *eve, uint32_t addr) {
C4(eve, ((42 << 24) | (((addr) & 4194303))));
}
void common_hal__eve_PointSize(common_hal__eve_t *eve, uint32_t size) {
C4(eve, ((13 << 24) | ((size & 8191))));
}
void common_hal__eve_RestoreContext(common_hal__eve_t *eve) {
C4(eve, ((35 << 24)));
}
void common_hal__eve_Return(common_hal__eve_t *eve) {
C4(eve, ((36 << 24)));
}
void common_hal__eve_SaveContext(common_hal__eve_t *eve) {
C4(eve, ((34 << 24)));
}
void common_hal__eve_ScissorSize(common_hal__eve_t *eve, uint32_t width, uint32_t height) {
C4(eve, ((28 << 24) | ((width & 4095) << 12) | ((height & 4095))));
}
void common_hal__eve_ScissorXY(common_hal__eve_t *eve, uint32_t x, uint32_t y) {
C4(eve, ((27 << 24) | ((x & 2047) << 11) | ((y & 2047))));
}
void common_hal__eve_StencilFunc(common_hal__eve_t *eve, uint32_t func, uint32_t ref, uint32_t mask) {
C4(eve, ((10 << 24) | ((func & 7) << 16) | ((ref & 255) << 8) | ((mask & 255))));
}
void common_hal__eve_StencilMask(common_hal__eve_t *eve, uint32_t mask) {
C4(eve, ((19 << 24) | ((mask & 255))));
}
void common_hal__eve_StencilOp(common_hal__eve_t *eve, uint32_t sfail, uint32_t spass) {
C4(eve, ((12 << 24) | ((sfail & 7) << 3) | ((spass & 7))));
}
void common_hal__eve_TagMask(common_hal__eve_t *eve, uint32_t mask) {
C4(eve, ((20 << 24) | ((mask & 1))));
}
void common_hal__eve_Tag(common_hal__eve_t *eve, uint32_t s) {
C4(eve, ((3 << 24) | ((s & 255))));
}
void common_hal__eve_VertexTranslateX(common_hal__eve_t *eve, uint32_t x) {
C4(eve, ((43 << 24) | (((x) & 131071))));
}
void common_hal__eve_VertexTranslateY(common_hal__eve_t *eve, uint32_t y) {
C4(eve, ((44 << 24) | (((y) & 131071))));
}
void common_hal__eve_Vertex2ii(common_hal__eve_t *eve, uint32_t x, uint32_t y, uint32_t handle, uint32_t cell) {
C4(eve, ((2 << 30) | (((x) & 511) << 21) | (((y) & 511) << 12) | (((handle) & 31) << 7) | (((cell) & 127) << 0)));
}

View File

@ -0,0 +1,91 @@
/*
* This file is part of the Micro Python project, http://micropython.org/
*
* The MIT License (MIT)
*
* Copyright (c) 2020 James Bowman for Excamera Labs
*
* 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.
*/
#ifndef MICROPY_INCLUDED_SHARED_MODULE__EVE___INIT___H
#define MICROPY_INCLUDED_SHARED_MODULE__EVE___INIT___H
typedef struct _common_hal__eve_t {
mp_obj_t dest[3]; // Own 'write' method, plus argument
int vscale; // fixed-point scaling used for Vertex2f
size_t n; // Current size of command buffer
uint8_t buf[512]; // Command buffer
} common_hal__eve_t;
void common_hal__eve_flush(common_hal__eve_t *eve);
void common_hal__eve_add(common_hal__eve_t *eve, size_t len, void *buf);
void common_hal__eve_Vertex2f(common_hal__eve_t *eve, mp_float_t x, mp_float_t y);
void common_hal__eve_AlphaFunc(common_hal__eve_t *eve, uint32_t func, uint32_t ref);
void common_hal__eve_Begin(common_hal__eve_t *eve, uint32_t prim);
void common_hal__eve_BitmapExtFormat(common_hal__eve_t *eve, uint32_t fmt);
void common_hal__eve_BitmapHandle(common_hal__eve_t *eve, uint32_t handle);
void common_hal__eve_BitmapLayoutH(common_hal__eve_t *eve, uint32_t linestride, uint32_t height);
void common_hal__eve_BitmapLayout(common_hal__eve_t *eve, uint32_t format, uint32_t linestride, uint32_t height);
void common_hal__eve_BitmapSizeH(common_hal__eve_t *eve, uint32_t width, uint32_t height);
void common_hal__eve_BitmapSize(common_hal__eve_t *eve, uint32_t filter, uint32_t wrapx, uint32_t wrapy, uint32_t width, uint32_t height);
void common_hal__eve_BitmapSource(common_hal__eve_t *eve, uint32_t addr);
void common_hal__eve_BitmapSwizzle(common_hal__eve_t *eve, uint32_t r, uint32_t g, uint32_t b, uint32_t a);
void common_hal__eve_BitmapTransformA(common_hal__eve_t *eve, uint32_t a, uint32_t p);
void common_hal__eve_BitmapTransformB(common_hal__eve_t *eve, uint32_t b, uint32_t p);
void common_hal__eve_BitmapTransformC(common_hal__eve_t *eve, uint32_t c, uint32_t p);
void common_hal__eve_BitmapTransformD(common_hal__eve_t *eve, uint32_t d, uint32_t p);
void common_hal__eve_BitmapTransformE(common_hal__eve_t *eve, uint32_t e, uint32_t p);
void common_hal__eve_BitmapTransformF(common_hal__eve_t *eve, uint32_t f, uint32_t p);
void common_hal__eve_BlendFunc(common_hal__eve_t *eve, uint32_t src, uint32_t dst);
void common_hal__eve_Call(common_hal__eve_t *eve, uint32_t dest);
void common_hal__eve_Cell(common_hal__eve_t *eve, uint32_t cell);
void common_hal__eve_ClearColorA(common_hal__eve_t *eve, uint32_t alpha);
void common_hal__eve_ClearColorRGB(common_hal__eve_t *eve, uint32_t red, uint32_t green, uint32_t blue);
void common_hal__eve_Clear(common_hal__eve_t *eve, uint32_t c, uint32_t s, uint32_t t);
void common_hal__eve_ClearStencil(common_hal__eve_t *eve, uint32_t s);
void common_hal__eve_ClearTag(common_hal__eve_t *eve, uint32_t s);
void common_hal__eve_ColorA(common_hal__eve_t *eve, uint32_t alpha);
void common_hal__eve_ColorMask(common_hal__eve_t *eve, uint32_t r, uint32_t g, uint32_t b, uint32_t a);
void common_hal__eve_ColorRGB(common_hal__eve_t *eve, uint32_t red, uint32_t green, uint32_t blue);
void common_hal__eve_Display(common_hal__eve_t *eve);
void common_hal__eve_End(common_hal__eve_t *eve);
void common_hal__eve_Jump(common_hal__eve_t *eve, uint32_t dest);
void common_hal__eve_LineWidth(common_hal__eve_t *eve, uint32_t width);
void common_hal__eve_Macro(common_hal__eve_t *eve, uint32_t m);
void common_hal__eve_Nop(common_hal__eve_t *eve);
void common_hal__eve_PaletteSource(common_hal__eve_t *eve, uint32_t addr);
void common_hal__eve_PointSize(common_hal__eve_t *eve, uint32_t size);
void common_hal__eve_RestoreContext(common_hal__eve_t *eve);
void common_hal__eve_Return(common_hal__eve_t *eve);
void common_hal__eve_SaveContext(common_hal__eve_t *eve);
void common_hal__eve_ScissorSize(common_hal__eve_t *eve, uint32_t width, uint32_t height);
void common_hal__eve_ScissorXY(common_hal__eve_t *eve, uint32_t x, uint32_t y);
void common_hal__eve_StencilFunc(common_hal__eve_t *eve, uint32_t func, uint32_t ref, uint32_t mask);
void common_hal__eve_StencilMask(common_hal__eve_t *eve, uint32_t mask);
void common_hal__eve_StencilOp(common_hal__eve_t *eve, uint32_t sfail, uint32_t spass);
void common_hal__eve_TagMask(common_hal__eve_t *eve, uint32_t mask);
void common_hal__eve_Tag(common_hal__eve_t *eve, uint32_t s);
void common_hal__eve_VertexTranslateX(common_hal__eve_t *eve, uint32_t x);
void common_hal__eve_VertexTranslateY(common_hal__eve_t *eve, uint32_t y);
void common_hal__eve_VertexFormat(common_hal__eve_t *eve, uint32_t frac);
void common_hal__eve_Vertex2ii(common_hal__eve_t *eve, uint32_t x, uint32_t y, uint32_t handle, uint32_t cell);
#endif // MICROPY_INCLUDED_SHARED_MODULE__EVE___INIT___H