forked from TCShenanigans/symphony_stdlib
Add globals and error codes
Added support for global variables. This requires including `start.asm` as the first code. This includes a `jmp` to 0x100 for user code, and a magic number that modules can check to verify th the user has correctly reserved the space. The magic number is 0xb301534c: * This has the high bit set so is not a valid instruction * On builds that ignore the high bit this decodes to `nor zr, zr, 0x534c` a no-op. * The immediate is "SL" for standardl ibrary. Due to a bug start pads with U... 0, instead of @addr. `start.asm` also initialises `sp` so it start just below the 64KiB LUT memory alocation. Added some error codes for the upcoming graphics module.
This commit is contained in:
+17
-7
@@ -1,18 +1,28 @@
|
||||
; Addresses of global variables
|
||||
|
||||
; If not double buffering these point to the same buffer
|
||||
; If double buffering they must the same size
|
||||
pub const FB_DISPLAY_PTR = 16 ; U32 Currently displayed buffer
|
||||
pub const FB_DRAW_PTR = 20 ; U32 Draw to this buffer
|
||||
pub const FRAME_BUFFER_SIZE = 24 ; U32
|
||||
pub const PIXEL_WIDTH = 28 ; U16
|
||||
pub const PIXEL_HEIGHT = 30 ; U16
|
||||
pub const FB_DISPLAY_STRIDE = 20 ; U32 Bytes in each row of the displayed buffer
|
||||
pub const FB_DRAW_PTR = 24 ; U32 Draw to this buffer
|
||||
pub const FB_DRAW_STRIDE = 28 ; U32 Bytes in each row of the draw buffer
|
||||
pub const FB_SIZE_BYTE = 32 ; U32 In bytes
|
||||
pub const FB_WIDTH_PX = 36 ; U16 Width of screen in pixels
|
||||
pub const FB_HEIGHT_PX = 38 ; U16 Height of screen in pixels
|
||||
|
||||
; Log2 of width in pixels, e.g.
|
||||
; * 10 => 1024 * 768
|
||||
pub const LOG_WIDTH = 32 ; U8
|
||||
; * 8 => 256 * 192
|
||||
pub const FB_LOG_WIDTH = 40 ; U8
|
||||
pub const FB_LOG_STRIDE = 41 ; U8 Log2 of FB_xxx_STRIDE in bytes
|
||||
|
||||
pub const BYTES_PER_PIXEL = 33 ; U8
|
||||
pub const FB_BYTES_PER_PIXEL = 42 ; U8 Specialisations should hardcode this
|
||||
; Log2 of bytes per pixel
|
||||
; * 0 => 8 bits per pixel
|
||||
; * 2 => 32 bits per pixel
|
||||
pub const LOG_BPP = 34 ; U8
|
||||
pub const FB_LOG_BPP = 43 ; U8 Specialisations should hardcode this
|
||||
|
||||
pub const MAGIC_ADDRESS_LONG = 12 ; U32 Location of the magic value
|
||||
pub const MAGIC_VALUE_LONG = 0xb301534c ; U32 Full 32 bits of the magic value
|
||||
pub const MAGIC_ADDRESS = 14 ; U16 Location of the low 16 bits of magic value
|
||||
pub const MAGIC_VALUE = 0x534c ; U16 Low 16 bits of the magic value
|
||||
|
||||
Reference in New Issue
Block a user