summaryrefslogtreecommitdiff
path: root/applications/init/main.cpp
diff options
context:
space:
mode:
authorBenji Dial <benji@benjidial.net>2024-01-27 23:14:29 -0500
committerBenji Dial <benji@benjidial.net>2024-01-27 23:14:29 -0500
commita8a80d326de9550b2a25b1255a2093ab43219ede (patch)
treed42a800f735caf93679d1728e2d5f20004db3b65 /applications/init/main.cpp
parent7199e74aa22e592a3b77bdd81f735edca5470596 (diff)
downloadhilbert-os-a8a80d326de9550b2a25b1255a2093ab43219ede.tar.gz
keyboard input
Diffstat (limited to 'applications/init/main.cpp')
-rw-r--r--applications/init/main.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/applications/init/main.cpp b/applications/init/main.cpp
index 06a8203..57ebd02 100644
--- a/applications/init/main.cpp
+++ b/applications/init/main.cpp
@@ -15,7 +15,7 @@ int main(int, char **) {
daguerre::image<daguerre::color24> img;
- std::FILE *file = std::fopen("/assets/burdon.ppm", "r");
+ std::FILE *file = std::fopen("/init/burdon.ppm", "r");
assert(file != 0);
assert(daguerre::try_load_ppm(file, img));
std::fclose(file);
@@ -30,6 +30,21 @@ int main(int, char **) {
daguerre::copy_image(img, fb, 0, 0, x_off, y_off, width, height);
+ while (true) {
+
+ uint32_t kp = _syscall_read_key_packet();
+ if ((kp & 0x0400ff) == 0x04005a) {
+ for (unsigned y = 0; y < img.get_height(); ++y)
+ for (unsigned x = 0; x < img.get_width(); ++x) {
+ img.get(x, y).r = ~img.get(x, y).r;
+ img.get(x, y).g = ~img.get(x, y).g;
+ img.get(x, y).b = ~img.get(x, y).b;
+ }
+ daguerre::copy_image(img, fb, 0, 0, x_off, y_off, width, height);
+ }
+
+ }
+
return 0;
}