summaryrefslogtreecommitdiff
path: root/agbx/source/gfx/plot.c
diff options
context:
space:
mode:
Diffstat (limited to 'agbx/source/gfx/plot.c')
-rw-r--r--agbx/source/gfx/plot.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/agbx/source/gfx/plot.c b/agbx/source/gfx/plot.c
new file mode 100644
index 0000000..5a65972
--- /dev/null
+++ b/agbx/source/gfx/plot.c
@@ -0,0 +1,34 @@
+/*
+ Copyright 2022 Gabriel Jensen.
+ This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
+ If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
+*/
+
+#include <agbx/priv.h>
+
+agbx_i10 agbx_plot3(agbx_i8 const _x,agbx_i8 const _y,agbx_i10 const _col) {
+#if defined(__agbx_dbg)
+ if (_x >= 0xF0u || _y >= 0xA0u) {agbx_done(agbx_err_pos2big);}
+#endif
+ agbx_i10 const px = _y * 0xF0u + _x;
+ __agbx_setpx2(px,_col)
+ return px;
+}
+
+agbx_i10 agbx_plot4(agbx_i8 const _x,agbx_i8 const _y,agbx_i8 const _col) {
+#if defined(__agbx_dbg)
+ if (_x >= 0xF0u || _y >= 0xA0u) {agbx_done(agbx_err_pos2big);}
+#endif
+ agbx_i10 const px = _y * 0xF0u + _x;
+ __agbx_setpx1(px,_col)
+ return px;
+}
+
+agbx_i10 agbx_plot5(agbx_i8 const _x,agbx_i8 const _y,agbx_i10 const _col) {
+#if defined(__agbx_dbg)
+ if (_x >= 0xA0u || _y >= 0x80u) {agbx_done(agbx_err_pos2big);}
+#endif
+ agbx_i10 const px = _y * 0xA0u + _x;
+ __agbx_setpx2(px,_col)
+ return px;
+}