From 48015204245ba8bb62e381624bc7f42f8fe31ba9 Mon Sep 17 00:00:00 2001 From: Gelthor Date: Sun, 6 Sep 2026 17:37:49 +0100 Subject: [PATCH] Split framebuffer stride into stride and depth Stride is now U16, depth is U16, and stores the bits per pixel of the buffer. --- src/globals.asm | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/src/globals.asm b/src/globals.asm index 3c86fb7..d9398c5 100755 --- a/src/globals.asm +++ b/src/globals.asm @@ -4,25 +4,27 @@ pub const MAGIC_ADDRESS_LONG = 0x0c ; U32 Location of the magic value pub const MAGIC_VALUE_LONG = 0xb301534c ; U32 Full 32 bits of the magic value pub const MAGIC_ADDRESS = 0x0e ; U16 Location of the low 16 bits of magic value pub const MAGIC_VALUE = 0x534c ; U16 Low 16 bits of the magic value - - ; If not double buffering these point to the same buffer - ; If double buffering they must the same size + +; If not double buffering these point to the same buffer +; If double buffering they must the same size pub const FB_DISPLAY_PTR = 0x10 ; U32 Currently displayed buffer -pub const FB_DISPLAY_STRIDE = 0x14 ; U32 Bytes in each row of the displayed buffer +pub const FB_DISPLAY_STRIDE = 0x14 ; U16 Bytes in each row of the displayed buffer +pub const FB_DISPLAY_DEPTH = 0x16 ; U16 Bits per pixel of the display buffer pub const FB_DRAW_PTR = 0x18 ; U32 Draw to this buffer -pub const FB_DRAW_STRIDE = 0x1c ; U32 Bytes in each row of the draw buffer +pub const FB_DRAW_STRIDE = 0x1c ; U16 Bytes in each row of the draw buffer == FB_DISPLAY_STRIDE +pub const FB_DRAW_DEPTH = 0x1e ; U16 Bits per pixel of the draw buffer == FB_DISPLAY_DEPTH pub const FB_SIZE_BYTE = 0x20 ; U32 In bytes pub const FB_WIDTH_PX = 0x24 ; U16 Width of screen in pixels pub const FB_HEIGHT_PX = 0x26 ; U16 Height of screen in pixels - - ; Log2 of width in pixels, e.g. - ; * 10 => 1024 * 768 - ; * 8 => 256 * 192 + +; Log2 of width in pixels, e.g. +; * 10 => 1024 * 768 +; * 8 => 256 * 192 pub const FB_LOG_WIDTH = 0x28 ; U8 pub const FB_LOG_STRIDE = 0x29 ; U8 Log2 of FB_xxx_STRIDE in bytes - + pub const FB_BYTES_PER_PIXEL = 0x2a ; U8 Specialisations should hardcode this - ; Log2 of bytes per pixel - ; * 0 => 8 bits per pixel - ; * 2 => 32 bits per pixel -pub const FB_LOG_BPP = 0x2b ; U8 Specialisations should hardcode this +; Log2 of bytes per pixel +; * 0 => 8 bits per pixel +; * 2 => 32 bits per pixel +pub const FB_LOG_BPP = 0x2b ; U8 Specialisations should hardcode this \ No newline at end of file