From 6e0c24f3c7cf696e7cbaffcf7e4c7d894bd05f01 Mon Sep 17 00:00:00 2001 From: James Bowman Date: Fri, 6 Jun 2025 15:37:10 -0700 Subject: [PATCH 1/3] Support for REGION instruction of new bt820 --- py/circuitpy_mpconfig.h | 5 ++++- shared-bindings/_eve/__init__.c | 22 ++++++++++++++++++++++ shared-bindings/_eve/__init__.h | 1 + shared-module/_eve/__init__.c | 5 +++++ 4 files changed, 32 insertions(+), 1 deletion(-) diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index bc894e98606eb..52d010f008b1f 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -639,7 +639,8 @@ void background_callback_run_all(void); #define MICROPY_PY_BUILTINS_COMPILE (1) #ifndef CIRCUITPY_MIN_GCC_VERSION -#define CIRCUITPY_MIN_GCC_VERSION 14 +// #define CIRCUITPY_MIN_GCC_VERSION 14 +#define CIRCUITPY_MIN_GCC_VERSION 11 #endif #ifndef CIRCUITPY_SAVES_PARTITION_SIZE @@ -655,6 +656,7 @@ void background_callback_run_all(void); #error "CIRCUITPY_BOOT_BUTTON and CIRCUITPY_BOOT_BUTTON_NO_GPIO are mutually exclusive" #endif +/* #if defined(__GNUC__) && !defined(__ZEPHYR__) #if __GNUC__ < CIRCUITPY_MIN_GCC_VERSION // (the 3 level scheme here is required to get expansion & stringization @@ -666,3 +668,4 @@ void background_callback_run_all(void); DO_ERROR(CIRCUITPY_MIN_GCC_VERSION); #endif #endif +*/ diff --git a/shared-bindings/_eve/__init__.c b/shared-bindings/_eve/__init__.c index 000e3526ed567..d0189fab71165 100644 --- a/shared-bindings/_eve/__init__.c +++ b/shared-bindings/_eve/__init__.c @@ -970,6 +970,7 @@ static MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(vertex2ii_obj, 3, 5, _vertex2ii); { MP_ROM_QSTR(MP_QSTR_PaletteSource), MP_ROM_PTR(&palettesource_obj) }, \ { MP_ROM_QSTR(MP_QSTR_PaletteSourceH), MP_ROM_PTR(&palettesourceh_obj) }, \ { MP_ROM_QSTR(MP_QSTR_PointSize), MP_ROM_PTR(&pointsize_obj) }, \ + { MP_ROM_QSTR(MP_QSTR_Region), MP_ROM_PTR(®ion_obj) }, \ { MP_ROM_QSTR(MP_QSTR_RestoreContext), MP_ROM_PTR(&restorecontext_obj) }, \ { MP_ROM_QSTR(MP_QSTR_Return), MP_ROM_PTR(&return_obj) }, \ { MP_ROM_QSTR(MP_QSTR_SaveContext), MP_ROM_PTR(&savecontext_obj) }, \ @@ -1061,8 +1062,29 @@ static mp_obj_t _pointsize(mp_obj_t self, mp_obj_t a0) { common_hal__eve_PointSize(EVEHAL(self), size); return mp_const_none; } + static MP_DEFINE_CONST_FUN_OBJ_2(pointsize_obj, _pointsize); +//| def Region(self, y: int: h: int, dest: int) -> None: +//| """Specify a cull region in the display list +//| +//| :param int y: Starting Y band in the render buffer. Range 0-63 +//| :param int h: Y height in the render buffer. Range 0-63 +//| :param int dest: destination address in the display list if the raster is outside the region +//| +//| """ +//| ... +//| + +static mp_obj_t _region(size_t n_args, const mp_obj_t *args) { + uint32_t y = mp_obj_get_int_truncated(args[1]); + uint32_t h = mp_obj_get_int_truncated(args[2]); + uint32_t dest = mp_obj_get_int_truncated(args[3]); + common_hal__eve_Region(EVEHAL(args[0]), y, h, dest); + return mp_const_none; +} +static MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(region_obj, 4, 4, _region); + //| def VertexTranslateX(self, x: float) -> None: //| """Set the vertex transformation's x translation component //| diff --git a/shared-bindings/_eve/__init__.h b/shared-bindings/_eve/__init__.h index e75f8db792840..13ae1b8a6cb50 100644 --- a/shared-bindings/_eve/__init__.h +++ b/shared-bindings/_eve/__init__.h @@ -49,6 +49,7 @@ 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_PaletteSourceH(common_hal__eve_t *eve, uint32_t addr); void common_hal__eve_PointSize(common_hal__eve_t *eve, mp_float_t size); +void common_hal__eve_Region(common_hal__eve_t *eve, uint32_t y, uint32_t h, uint32_t dest); 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); diff --git a/shared-module/_eve/__init__.c b/shared-module/_eve/__init__.c index ecd310b55a3c1..ca084d9b43b36 100644 --- a/shared-module/_eve/__init__.c +++ b/shared-module/_eve/__init__.c @@ -246,6 +246,11 @@ void common_hal__eve_PointSize(common_hal__eve_t *eve, mp_float_t size) { } +void common_hal__eve_Region(common_hal__eve_t *eve, uint32_t y, uint32_t h, uint32_t dest) { + C4(eve, ((52 << 24) | ((y & 0x3f) << 18) | ((h & 0x3f) << 12) | (dest & 0xfff))); +} + + void common_hal__eve_RestoreContext(common_hal__eve_t *eve) { C4(eve, ((35 << 24))); } From 75440c8347fdc1df72fb68d763736dd3d74498e5 Mon Sep 17 00:00:00 2001 From: James Bowman Date: Fri, 6 Jun 2025 16:44:49 -0700 Subject: [PATCH 2/3] Restore accidental change --- py/circuitpy_mpconfig.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index 52d010f008b1f..bc894e98606eb 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -639,8 +639,7 @@ void background_callback_run_all(void); #define MICROPY_PY_BUILTINS_COMPILE (1) #ifndef CIRCUITPY_MIN_GCC_VERSION -// #define CIRCUITPY_MIN_GCC_VERSION 14 -#define CIRCUITPY_MIN_GCC_VERSION 11 +#define CIRCUITPY_MIN_GCC_VERSION 14 #endif #ifndef CIRCUITPY_SAVES_PARTITION_SIZE @@ -656,7 +655,6 @@ void background_callback_run_all(void); #error "CIRCUITPY_BOOT_BUTTON and CIRCUITPY_BOOT_BUTTON_NO_GPIO are mutually exclusive" #endif -/* #if defined(__GNUC__) && !defined(__ZEPHYR__) #if __GNUC__ < CIRCUITPY_MIN_GCC_VERSION // (the 3 level scheme here is required to get expansion & stringization @@ -668,4 +666,3 @@ void background_callback_run_all(void); DO_ERROR(CIRCUITPY_MIN_GCC_VERSION); #endif #endif -*/ From 5903b67ef1b238f9c491f636e0eecefff963c980 Mon Sep 17 00:00:00 2001 From: James Bowman Date: Fri, 6 Jun 2025 16:55:03 -0700 Subject: [PATCH 3/3] Fix typo in doc signature of REGION --- shared-bindings/_eve/__init__.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared-bindings/_eve/__init__.c b/shared-bindings/_eve/__init__.c index d0189fab71165..a3914d07f324f 100644 --- a/shared-bindings/_eve/__init__.c +++ b/shared-bindings/_eve/__init__.c @@ -1065,7 +1065,7 @@ static mp_obj_t _pointsize(mp_obj_t self, mp_obj_t a0) { static MP_DEFINE_CONST_FUN_OBJ_2(pointsize_obj, _pointsize); -//| def Region(self, y: int: h: int, dest: int) -> None: +//| def Region(self, y: int, h: int, dest: int) -> None: //| """Specify a cull region in the display list //| //| :param int y: Starting Y band in the render buffer. Range 0-63 pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy