diff options
author | Benji Dial <benji@benjidial.net> | 2024-01-27 23:14:29 -0500 |
---|---|---|
committer | Benji Dial <benji@benjidial.net> | 2024-01-27 23:14:29 -0500 |
commit | a8a80d326de9550b2a25b1255a2093ab43219ede (patch) | |
tree | d42a800f735caf93679d1728e2d5f20004db3b65 /applications/init/main.cpp | |
parent | 7199e74aa22e592a3b77bdd81f735edca5470596 (diff) | |
download | hilbert-os-a8a80d326de9550b2a25b1255a2093ab43219ede.tar.gz |
keyboard input
Diffstat (limited to 'applications/init/main.cpp')
-rw-r--r-- | applications/init/main.cpp | 17 |
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; } |