From 7c870e6eabd53f7a8cb0c9b5ecb477797b4de09a Mon Sep 17 00:00:00 2001 From: Elizabeth Alexander Hunt Date: Sun, 11 Oct 2026 14:22:26 -0700 Subject: Scroll some pixels on the fuckin screen --- include/io.h | 13 +++++++++++++ include/utils.h | 8 +++++--- include/video.h | 23 +++++++++++++++++++++++ 3 files changed, 41 insertions(+), 3 deletions(-) create mode 100644 include/io.h create mode 100644 include/video.h (limited to 'include') diff --git a/include/io.h b/include/io.h new file mode 100644 index 0000000..ed71e6f --- /dev/null +++ b/include/io.h @@ -0,0 +1,13 @@ +#include + +#ifndef IO_H +#define IO_H + +uint8_t inportb(uint16_t port); +void outportb(uint16_t port, uint8_t data); +void init_serial(); +void serial_putc(char c); +void serial_puts(const char* s); +void serial_puthex(uint32_t h); + +#endif // IO_H \ No newline at end of file diff --git a/include/utils.h b/include/utils.h index 9ea1f09..beed3cc 100644 --- a/include/utils.h +++ b/include/utils.h @@ -1,5 +1,7 @@ #include +#define DEBUG 0 + #ifndef UTILS_H #define UTILS_H @@ -7,7 +9,7 @@ #define asm __asm__ volatile #endif -void macaroni_panic(char* msg); -void macaroni_assert(bool condition, char* msg); +void macaroni_panic(const char* msg); +void macaroni_assert(bool condition, const char* msg); -#endif // UTILS_H \ No newline at end of file +#endif // UTILS_H diff --git a/include/video.h b/include/video.h new file mode 100644 index 0000000..85a670c --- /dev/null +++ b/include/video.h @@ -0,0 +1,23 @@ +#include +#include "multiboot.h" + +#ifndef VIDEO_H +#define VIDEO_H + +#define MULTIBOOT_GODS_WIDTH 640 +#define MULTIBOOT_GODS_HEIGHT 480 +#define MULTIBOOT_VIDEO_BPP 24 + +typedef uint32_t macaroni_color; +static macaroni_color RED = 0xFF0000; +static macaroni_color GREEN = 0x00FF00; +static macaroni_color BLUE = 0x0000FF; + +static uint8_t* video_framebuffer; +static uint32_t pitch; +static uint32_t pixel_width; + +void init_video(multiboot_info_t* p_multiboot_info); +void put_pixel(macaroni_color color, uint16_t x, uint16_t y); + +#endif // VIDEO_H -- cgit v1.3