vxKernel/vxgos/kernel/include/vhex/display/image/render.h
Yann MAGNIN 597b25682a vxkernel - v0.7.0-1 : architecture overhaul + bootloader KASLR resolve
---

The objective of this early rework of the kernel architecture is to prepare the
project to run on other hardware than the Casio calculator (like Raspberry Pi
devices). This is why I switched the kernel workflow to integrate a custom
bootloader for the particular kernel image we generate.

The v0.7.0 of the kernel is not released since the USB driver is not stable
yet. But the need to deeply rework the architecture is prioritized. So, as this
is a critical update, I update the minor version (which is a major indicator
here since I don't have the mature version yet (v1.x.x)).

Also, I work on a brand-new micro-kernel (for the Raspberry Pi 3b and Google
Pixels), so, the name of this project, Vhex, has migrated to a temporary
name(?): VxGOS (for Vhex Gaming Operating System), which will be changed as
soon as the v0.8.0 is released. (I choose this name only because the word
"gaming" make me laugh. Take showers folks).

The objective of version 0.8.0 is to support:

    - architecture rework
    - internal bootloader
    - proper KASLR support
    - stack protection (libSSP)

---

*update*
> [common]
  | [kernel] move kernel source file in the new "vxgos" root directory
  | [boards] move board-related files / scripts in the new "vxgos"
  | [bootloader] support fxcg50 self-translation from ROM to RAM
  | [bootloader] support fxcg50 KASLR patching
  | [scripts] move `vxdev` tool in the new "scripts" root directory
  | [scripts] move norm related files to "checker" directory
  | [vxsdk] update the vxSDK indication file
2023-04-13 13:59:46 +02:00

85 lines
1.9 KiB
C

#ifndef __VHEX_DISPLAY_DRAW_IMAGE_RENDER__
# define __VHEX_DISPLAY_DRAW_IMAGE_RENDER__
#include <vhex/display/image/types.h>
//---
// User-level API
//---
/* render part */
/* Alignment settings for dimage*(). Combining a vertical and a horizontal
alignment option specifies where a given point (x,y) should be relative to
the rendered image. */
enum {
/* Horizontal settings: default in diage*() is DIMAGE_LEFT */
DIMAGE_LEFT = 0x00,
DIMAGE_CENTER = 0x01,
DIMAGE_RIGHT = 0x02,
/* Vertical settings: default in dimage*() is DIMAGE_TOP */
DIMAGE_TOP = 0x10,
DIMAGE_MIDDLE = 0x20,
DIMAGE_BOTTOM = 0x40,
};
/* dimage(): Render a full image */
extern did_t dimage(image_t const *image, int x, int y, int mode);
/* dsubimage(): Render a section of an image */
extern did_t dsubimage(
image_t const *image,
int x, int y,
int left, int top, int width, int height
);
/* shader part */
/* dimage_shader_shadow() : add shadows in any image rendered */
extern int dimage_shader_shadow(did_t did, int xoff, int yoff);
//---
// Kernel-level API
//---
/* dsubimage_render() : draw a subimage in the surface */
extern void dsubimage_render(
dsurface_t *surface,
image_t const *image,
int x, int y,
int left, int top, int width, int height
);
/* dimage_render(): Render a full image */
extern void dimage_render(dsurface_t *s, image_t const *img, int x, int y);
/* help part */
struct imgbox {
struct {
struct {
int start;
int end;
} y;
struct {
int start;
int end;
} x;
} img;
struct {
uint16_t *vram;
int voff;
} surface;
};
/* dsubimage_render_box() : generate box information */
extern int dsubimage_render_box(
struct imgbox *imgbox,
dsurface_t *surface,
image_t const *image,
int x, int y,
int left, int top, int width, int height
);
#endif /* __VHEX_DISPLAY_DRAW_IMAGE_RENDER__ */