summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.txt6
-rw-r--r--agbx/source/bs/done.c29
-rw-r--r--demo/demo.c13
3 files changed, 35 insertions, 13 deletions
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index 6e810c1..3a2c6c6 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -1,3 +1,9 @@
+# 2.1
+
+* Add colour switching to the demo (press R);
+* Use mode 4 for the error screen;
+* Add an extra line on the error 'barcode';
+
# 2.0
* Update readme;
diff --git a/agbx/source/bs/done.c b/agbx/source/bs/done.c
index 6d56cb0..be8f423 100644
--- a/agbx/source/bs/done.c
+++ b/agbx/source/bs/done.c
@@ -16,20 +16,23 @@ void agbx_done(agbx_err const _err) {
__builtin_unreachable();
}
/* Display the barcode-like error message: */
- agbx_set10(0x400'0000u,0x403u);
- agbx_i10 err[0x8u];
- for (agbx_i8 pos = 0x0u;pos != 0x8u;++pos) {err[pos] = (agbx_i8)_err >> pos & 0x1u ? 0x19u : 0x0u;}
+ agbx_set10(0x400'0000u,0x404u);
+ agbx_set10(0x500'0000u,0x0u);
+ agbx_set10(0x500'0002u,0x19u);
+ agbx_i8 err[0x8u];
+ for (agbx_i8 pos = 0x0u;pos != 0x8u;++pos) {err[pos] = (agbx_i8)_err >> pos & 0x1u;}
for (agbx_i10 pos = 0x0u;pos != 0x9600u;pos += 0xF0u) {
- agbx_setpx2(0x600'0000u,pos, err[0x0u]);
- agbx_setpx2(0x600'0000u,pos + 0x1u,err[0x1u]);
- agbx_setpx2(0x600'0000u,pos + 0x2u,err[0x2u]);
- agbx_setpx2(0x600'0000u,pos + 0x3u,err[0x3u]);
- agbx_setpx2(0x600'0000u,pos + 0x4u,err[0x4u]);
- agbx_setpx2(0x600'0000u,pos + 0x5u,err[0x5u]);
- agbx_setpx2(0x600'0000u,pos + 0x6u,err[0x6u]);
- agbx_setpx2(0x600'0000u,pos + 0x7u,err[0x7u]);
- agbx_setpx2(0x600'0000u,pos + 0x8u,0x0u);
- agbx_setpx2(0x600'0000u,pos + 0x9u,0x19u);
+ agbx_setpx1(0x600'0000u,pos, err[0x0u]);
+ agbx_setpx1(0x600'0000u,pos + 0x1u,err[0x1u]);
+ agbx_setpx1(0x600'0000u,pos + 0x2u,err[0x2u]);
+ agbx_setpx1(0x600'0000u,pos + 0x3u,err[0x3u]);
+ agbx_setpx1(0x600'0000u,pos + 0x4u,err[0x4u]);
+ agbx_setpx1(0x600'0000u,pos + 0x5u,err[0x5u]);
+ agbx_setpx1(0x600'0000u,pos + 0x6u,err[0x6u]);
+ agbx_setpx1(0x600'0000u,pos + 0x7u,err[0x7u]);
+ agbx_setpx1(0x600'0000u,pos + 0x8u,0x0u);
+ agbx_setpx1(0x600'0000u,pos + 0x9u,0x1u);
+ agbx_setpx1(0x600'0000u,pos + 0xAu,0x0u);
}
__asm__ (
"swi 0x2\n"
diff --git a/demo/demo.c b/demo/demo.c
index d82e333..94578f6 100644
--- a/demo/demo.c
+++ b/demo/demo.c
@@ -6,6 +6,12 @@ agbx_err agbx_main(void) {
agbx_set10(0x500'0002u,0x19u);
agbx_set10(0x500'0004u,0xFFFFu);
agbx_set10(0x400'0000u,0x404u);
+ agbx_i10 const cols[] = {
+ 0b11111u,
+ 0b1111100000u,
+ 0b111110000000000u,
+ };
+ agbx_i8 col = 0x0u;
struct {
agbx_i8 x;
agbx_i8 y;
@@ -26,6 +32,13 @@ agbx_err agbx_main(void) {
while (agbx_chkkey(agbx_getkeymap(),agbx_key_l)) {}
continue;
}
+ if (agbx_chkkey(keymap,agbx_key_r)) {
+ if (col == 0x2u) {col = 0x0u;}
+ else {++col;}
+ agbx_set10(0x500'0002u,cols[col]);
+ while (agbx_chkkey(agbx_getkeymap(),agbx_key_r)) {}
+ continue;
+ }
typeof (pos) const prevpos = pos;
agbx_key key = agbx_key_pade;
if (agbx_chkkey(keymap,key)) {