summaryrefslogtreecommitdiff
path: root/shared-module
diff options
context:
space:
mode:
authorScott Shawcroft <scott@adafruit.com>2021-01-25 14:44:48 -0800
committerGitHub <noreply@github.com>2021-01-25 14:44:48 -0800
commit4241fd4b18a9057bcd836b81c651cfb363ba8828 (patch)
tree669fe3d716af479d16f83db6a85a48ce411dcc94 /shared-module
parenta2ac2da7ccd3ffe60cfa56efd321cd967a8bc4a5 (diff)
parentdff3423c231c07751175ded39a18beef28aecd4f (diff)
Merge pull request #4051 from jamesbowman/main
EVE: change fixed-point integer arguments to floating point
Diffstat (limited to 'shared-module')
-rw-r--r--shared-module/_eve/__init__.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/shared-module/_eve/__init__.c b/shared-module/_eve/__init__.c
index d95c777dc..579729d42 100644
--- a/shared-module/_eve/__init__.c
+++ b/shared-module/_eve/__init__.c
@@ -226,8 +226,9 @@ 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) {
- C4(eve, ((14 << 24) | ((width & 4095))));
+void common_hal__eve_LineWidth(common_hal__eve_t *eve, mp_float_t width) {
+ int16_t iw = (int)(8 * width);
+ C4(eve, ((14 << 24) | ((iw & 4095))));
}
@@ -246,8 +247,9 @@ 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) {
- C4(eve, ((13 << 24) | ((size & 8191))));
+void common_hal__eve_PointSize(common_hal__eve_t *eve, mp_float_t size) {
+ int16_t is = (int)(8 * size);
+ C4(eve, ((13 << 24) | ((is & 8191))));
}
@@ -301,13 +303,15 @@ 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) {
- C4(eve, ((43 << 24) | (((x) & 131071))));
+void common_hal__eve_VertexTranslateX(common_hal__eve_t *eve, mp_float_t x) {
+ int16_t ix = (int)(16 * x);
+ C4(eve, ((43 << 24) | (ix & 131071)));
}
-void common_hal__eve_VertexTranslateY(common_hal__eve_t *eve, uint32_t y) {
- C4(eve, ((44 << 24) | (((y) & 131071))));
+void common_hal__eve_VertexTranslateY(common_hal__eve_t *eve, mp_float_t y) {
+ int16_t iy = (int)(16 * y);
+ C4(eve, ((44 << 24) | (iy & 131071)));
}