diff --git a/shared-bindings/_eve/__init__.c b/shared-bindings/_eve/__init__.c index 000e3526ed567..a3914d07f324f 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))); }
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: