/*
 * src/userspace/launcher/main.c - Bare-metal Demo Launcher
 * Proves execution handoff by drawing the White Pill interface.
 */

#include <stdint.h>
#include <stddef.h>

// Hardcoded Limine Framebuffer address for fast demo testing
// (In a full build, the kernel passes this via syscalls/shared registers)
#define FB_ADDRESS 0xffff800000000000 // Replace with your Limine FB base if mapped static

int florid_main(void) {
    // Let's pretend the kernel mapped the FB directly for us
    uint32_t* screen = (uint32_t*)FB_ADDRESS;
    int width = 1920;  // Standard assumption for demo
    int height = 1080;

    // Draw the Taskbar Background at the bottom (Height: 60px)
    for (int y = height - 60; y < height; y++) {
        for (int x = 0; x < width; x++) {
            screen[y * width + x] = 0x111111; // Darker taskbar base
        }
    }

    // Draw the "White Pill" on the far left (X: 20 to 100, Y: height-45 to height-15)
    for (int y = height - 45; y < height - 15; y++) {
        for (int x = 20; x < 100; x++) {
            // Simple visual rounding: cut the absolute corners
            if ((x < 25 || x > 95) && (y < height - 40 || y > height - 20)) continue;
            screen[y * width + x] = 0xFFFFFF; // Pure white pill trigger
        }
    }

    return 0;
}