#include <stdint.h>

// The linker looks for _start by default
void _start() {
    // Material 3 Surface Color
    uint32_t m3_surface = 0x1C1B1F;
    
    // Pointer to framebuffer (Assuming it's mapped to 0xFD000000 or provided by bootloader)
    // For a real test, we just loop to keep the CPU busy so it doesn't crash
    while(1) {
        __asm__("hlt");
    }
}

void terminal_main() {
    // In a real FPF, the kernel passes the framebuffer info. 
    // We'll assume a standard 1920x1080 mapping for this demo.
    uint32_t* fb = (uint32_t*)0; // This would be mapped via syscall in a finished build
    
    int term_width = 800;
    int term_height = 500;
    int start_x = 100;
    int start_y = 100;

    // 1. Draw Terminal Window Shadow/Outline
    for (int y = start_y - 2; y < start_y + term_height + 2; y++) {
        for (int x = start_x - 2; x < start_x + term_width + 2; x++) {
            // fb[y * 1920 + x] = M3_OUTLINE; 
        }
    }

    // 2. Draw Terminal Surface
    for (int y = start_y; y < start_y + term_height; y++) {
        for (int x = start_x; x < start_x + term_width; x++) {
            // fb[y * 1920 + x] = M3_SURFACE;
        }
    }

    // 3. Draw Mock "Prompt" line
    // [ > _ ]
    for (int i = 0; i < 10; i++) {
        // Pixel logic for a cursor
    }
}