bopti: deprecate image_t, renamed to bopti_image_t

This commit is contained in:
Lephe 2020-06-01 12:11:59 +02:00
parent 0498344349
commit caa4f675c9
No known key found for this signature in database
GPG key ID: 1BBA026E13FC0495
12 changed files with 51 additions and 54 deletions

33
TODO
View file

@ -1,27 +1,21 @@
For the 2.0.0 release: For the 2.1.0 release:
* bopti: remove image_t, leaving only bopti_image_t * core: use gint_switch() to handle TLB misses
* core: the four basic memory functions (with automated tests)
* bopti: remove the deprecated image_t definition
* project: remove the compat branch * project: remove the compat branch
* gray: remove g*() functions * gray: remove g*() functions
* core: remove the boot log * core: remove the boot log
Crucial, missing things. Issues:
! core: the four basic memory functions (with automated tests)
! core: use gint_switch() to handle TLB misses
! core: recheck SH3 compatibility
Issues.
* #3 make drawing functions parameterized * #3 make drawing functions parameterized
* #5 add decent random number generation (TinyMT)
* #8 support fx-CG Manager * #8 support fx-CG Manager
* #10 support fx-CG 20 * #10 support fx-CG 20
Complementary elements on existing code. Extensions on existing code:
* gray: add gprint() * gray: add gprint()
* gray: double-buffer gray settings and unify d* with g* * gray: double-buffer gray settings and unify d* with g*
* display: deprecate image_t and rename it bopti_image_t
* topti: support unicode fonts * topti: support unicode fonts
* gray: find good values for more models than the Graph 35+E II * gray: find good values for more models than the Graph 35+E II
* dma: maybe relax the 4-byte size constraint for dma_memset()
* dma: fx9860g support (need to switch it on and update the Makefile) * dma: fx9860g support (need to switch it on and update the Makefile)
* core: try to leave add-in without reset in case of panic * core: try to leave add-in without reset in case of panic
* hardware: fill in the HWMEM_FITTLB flag * hardware: fill in the HWMEM_FITTLB flag
@ -31,24 +25,19 @@ Complementary elements on existing code.
* core: use cmp/str for memchr() * core: use cmp/str for memchr()
* r61524: brightness control and clean the file * r61524: brightness control and clean the file
* t6k11: check if dupdate() can be done by the DMA * t6k11: check if dupdate() can be done by the DMA
* core: review forgotten globals and MPU addresses not in <gint/mpu/*.h>
Keep in mind.
* build: make the build system simpler (two targets are enough by default) * build: make the build system simpler (two targets are enough by default)
* core: run destructors when a task-switch results in leaving the app * core: run destructors when a task-switch results in leaving the app
* core: invoke main menu instead of returning after main() ends * core: invoke main menu instead of returning after main() ends
* prizm: don't hardcode stack address in fxcg50.ld * prizm: don't hardcode stack address in fxcg50.ld (if possible)
* prizm: detect P1 static RAM (stack) in TLB * prizm: detect P1 static RAM (stack) in TLB
* core rtc: use qdiv10 to massively improve division performance * core rtc: use qdiv10 to massively improve division performance
* setjmp: more registers may need to be saved
* core: free heap when a task-switch results in leaving the app
* core: save and restore interrupt masks
* timer: make sure ETMU interrupts are disabled in ctx_restore()
* core: document the SH7305 PFC in <gint/mpu/pfc.h> * core: document the SH7305 PFC in <gint/mpu/pfc.h>
Future directions. Future directions.
* A complete file system abstraction * A complete file system abstraction
* Integrate overclock management * Integrate overclock management
* Audio playback using Martin Poupe's method * Audio playback using TSWilliamson's libsnd method
* Serial communication [SCIF] [SCIFA] * Serial communication
* USB communication [USB] * USB communication, using Yatis' reverse-engineering of the module
* Make fx9860g projects work out of the box on fxcg50 * Make fx9860g projects work out of the box on fxcg50

View file

@ -30,8 +30,8 @@ void masks(int x1, int x2, uint32_t *masks);
@left @top @w @h Bounding box to render @left @top @w @h Bounding box to render
@v1 @v2 VRAMs @v1 @v2 VRAMs
@bopti_asm Rendering function */ @bopti_asm Rendering function */
void bopti_render_clip(int x, int y, image_t const *img, int left, int top, void bopti_render_clip(int x, int y, bopti_image_t const *img, int left,
int w, int h, uint32_t *v1, uint32_t *v2, void *bopti_asm); int top, int w, int h, uint32_t *v1, uint32_t *v2, void *bopti_asm);
/* bopti_render_noclip() - render a bopti image without clipping /* bopti_render_noclip() - render a bopti image without clipping
This function is only ever slightly faster than bopti_render_clip(), This function is only ever slightly faster than bopti_render_clip(),
@ -44,7 +44,7 @@ void bopti_render_clip(int x, int y, image_t const *img, int left, int top,
@left @top @w @h Bounding box to render @left @top @w @h Bounding box to render
@v1 @v2 VRAMs @v1 @v2 VRAMs
@bopti_asm Rendering function */ @bopti_asm Rendering function */
void bopti_render_noclip(int x, int y, image_t const *img, int left, int top, void bopti_render_noclip(int x, int y, bopti_image_t const *img, int left,
int w, int h, uint32_t *v1, uint32_t *v2, void *bopti_asm); int top, int w, int h, uint32_t *v1, uint32_t *v2, void *bopti_asm);
#endif /* DISPLAY_FX */ #endif /* DISPLAY_FX */

View file

@ -56,7 +56,7 @@ enum {
// Image rendering (bopti) // Image rendering (bopti)
//--- //---
/* image_t: Image files encoded for bopti /* bopti_image_t: Image files encoded for bopti
This format is created by the fxSDK's [fxconv] tool from standard images. */ This format is created by the fxSDK's [fxconv] tool from standard images. */
typedef struct typedef struct
{ {
@ -78,7 +78,11 @@ typedef struct
Then raw pixel data in row-major order. */ Then raw pixel data in row-major order. */
uint16_t data[]; uint16_t data[];
} GPACKED(4) image_t; } GPACKED(4) bopti_image_t;
/* Old alias to image_t, now deprecated because of libimg */
typedef bopti_image_t image_t __attribute__((deprecated(
"image_t has been renamed to bopti_image_t")));
//--- //---
// Video RAM management // Video RAM management

View file

@ -61,7 +61,7 @@ typedef enum
// Image rendering (bopti) // Image rendering (bopti)
//--- //---
/* image_t - image files encoded for bopti /* bopti_image_t - image files encoded for bopti
This format is the result of encoding images for bopti with the fxSDK's This format is the result of encoding images for bopti with the fxSDK's
[fxconv] tool. The bopti routines can render it extremely fast, which makes [fxconv] tool. The bopti routines can render it extremely fast, which makes
it preferable over plain bitmaps if the images are never edited. */ it preferable over plain bitmaps if the images are never edited. */
@ -81,7 +81,11 @@ typedef struct
/* Raw layer data */ /* Raw layer data */
uint8_t data[]; uint8_t data[];
} GPACKED(4) image_t; } GPACKED(4) bopti_image_t;
/* Old alias to image_t, now deprecated because of libimg */
typedef bopti_image_t image_t __attribute__((deprecated(
"image_t has been renamed to bopti_image_t")));
#endif /* FX9860G */ #endif /* FX9860G */

View file

@ -226,7 +226,7 @@ void dprint(int x, int y, int fg, int bg, char const *format, ...);
// Image rendering (bopti) // Image rendering (bopti)
//--- //---
/* The image_t structure is platform-dependent. */ /* The bopti_image_t structure is platform-dependent. */
/* dimage(): Render a full image /* dimage(): Render a full image
This function blits an image on the VRAM using gint's special format. It is This function blits an image on the VRAM using gint's special format. It is
@ -234,7 +234,7 @@ void dprint(int x, int y, int fg, int bg, char const *format, ...);
@x @y Coordinates of the top-left corner of the image @x @y Coordinates of the top-left corner of the image
@image Pointer to image encoded with [fxconv] */ @image Pointer to image encoded with [fxconv] */
void dimage(int x, int y, image_t const *image); void dimage(int x, int y, bopti_image_t const *image);
/* Option values for dsubimage() */ /* Option values for dsubimage() */
enum { enum {
@ -256,7 +256,7 @@ enum {
@left @top Top-left coordinates of the subrectangle within [image] @left @top Top-left coordinates of the subrectangle within [image]
@width @height Subrectangle dimensions @width @height Subrectangle dimensions
@flags OR-combination of DIMAGE_* flags */ @flags OR-combination of DIMAGE_* flags */
void dsubimage(int x, int y, image_t const *image, int left, int top, void dsubimage(int x, int y, bopti_image_t const *image, int left, int top,
int width, int height, int flags); int width, int height, int flags);
//--- //---

View file

@ -171,7 +171,7 @@ void gtext(int x, int y, const char *str, int fg, int bg);
@x @y Coordinates of the top-left corner of the image @x @y Coordinates of the top-left corner of the image
@image Pointer to gray image encoded with [fxconv] */ @image Pointer to gray image encoded with [fxconv] */
void gimage(int x, int y, image_t const *image); void gimage(int x, int y, bopti_image_t const *image);
/* gsubimage(): Render a section of an image /* gsubimage(): Render a section of an image
Like dsubimage() for gray images. Same options apply. Like dsubimage() for gray images. Same options apply.
@ -181,7 +181,7 @@ void gimage(int x, int y, image_t const *image);
@left @top Top-left coordinates of the subrectangle within [image] @left @top Top-left coordinates of the subrectangle within [image]
@width @height Subrectangle dimensions @width @height Subrectangle dimensions
@flags OR-combination of DIMAGE_* flags */ @flags OR-combination of DIMAGE_* flags */
void gsubimage(int x, int y, image_t const *image, int left, int top, void gsubimage(int x, int y, bopti_image_t const *image, int left, int top,
int width, int height, int flags); int width, int height, int flags);
//--- //---

View file

@ -11,7 +11,7 @@ static void *bopti_asm[] = {
}; };
/* gimage(): Render a full image */ /* gimage(): Render a full image */
void gimage(int x, int y, image_t const *img) void gimage(int x, int y, bopti_image_t const *img)
{ {
uint32_t *light, *dark; uint32_t *light, *dark;
gvram(&light, &dark); gvram(&light, &dark);
@ -21,7 +21,7 @@ void gimage(int x, int y, image_t const *img)
} }
/* gsubimage(): Render a section of an image */ /* gsubimage(): Render a section of an image */
void gsubimage(int x, int y, image_t const *img, int left, int top, void gsubimage(int x, int y, bopti_image_t const *img, int left, int top,
int width, int height, int flags) int width, int height, int flags)
{ {
uint32_t *light, *dark; uint32_t *light, *dark;

View file

@ -42,14 +42,14 @@ void bopti_p4(uint8_t const *data, uint16_t *target, int width, int height,
/* bopti_render_clip(): Render with clipping /* bopti_render_clip(): Render with clipping
Same parameters as dsubimage(), except for flags. */ Same parameters as dsubimage(), except for flags. */
void bopti_render_clip(int x, int y, image_t const *img, int left, int top, void bopti_render_clip(int x, int y, bopti_image_t const *img, int left,
int width, int height); int top, int width, int height);
/* bopti_render_clip(): Render without clipping /* bopti_render_clip(): Render without clipping
Behaviour is not defined if (left,top)+(width,height) is not included in the Behaviour is not defined if (left,top)+(width,height) is not included in the
source image or (x,y)+(width,height) is not included in the VRAM area. source image or (x,y)+(width,height) is not included in the VRAM area.
Same parameters as dsubimage(), except for flags. */ Same parameters as dsubimage(), except for flags. */
void bopti_render_noclip(int x, int y, image_t const *img, int left, int top, void bopti_render_noclip(int x, int y, bopti_image_t const *img, int left,
int width, int height); int top, int width, int height);
#endif /* GINT_RENDERCG_BOPTIASM */ #endif /* GINT_RENDERCG_BOPTIASM */

View file

@ -18,7 +18,7 @@ enum {
PX_P4 = 3, PX_P4 = 3,
}; };
void bopti_render(image_t const *img, struct box *box) void bopti_render(bopti_image_t const *img, struct box *box)
{ {
/* Offset in video RAM and output stride */ /* Offset in video RAM and output stride */
uint16_t *target = gint_vram + (396 * box->y + box->x); uint16_t *target = gint_vram + (396 * box->y + box->x);
@ -70,8 +70,8 @@ void bopti_render(image_t const *img, struct box *box)
} }
} }
void bopti_render_clip(int x, int y, image_t const *img, int left, int top, void bopti_render_clip(int x, int y, bopti_image_t const *img, int left,
int width, int height) int top, int width, int height)
{ {
/* Adjust the bounding box of the input image */ /* Adjust the bounding box of the input image */
if(left < 0) width += left, x -= left, left = 0; if(left < 0) width += left, x -= left, left = 0;
@ -94,8 +94,8 @@ void bopti_render_clip(int x, int y, image_t const *img, int left, int top,
bopti_render(img, &box); bopti_render(img, &box);
} }
void bopti_render_noclip(int x, int y, image_t const *img, int left, int top, void bopti_render_noclip(int x, int y, bopti_image_t const *img, int left,
int width, int height) int top, int width, int height)
{ {
struct box box = { x, y, width, height, left, top }; struct box box = { x, y, width, height, left, top };
bopti_render(img, &box); bopti_render(img, &box);

View file

@ -2,13 +2,13 @@
#include "bopti-asm.h" #include "bopti-asm.h"
/* dimage() - render a full image */ /* dimage() - render a full image */
void dimage(int x, int y, image_t const *img) void dimage(int x, int y, bopti_image_t const *img)
{ {
bopti_render_clip(x, y, img, 0, 0, img->width, img->height); bopti_render_clip(x, y, img, 0, 0, img->width, img->height);
} }
/* dsubimage() - render a section of an image */ /* dsubimage() - render a section of an image */
void dsubimage(int x, int y, image_t const *img, int left, int top, void dsubimage(int x, int y, bopti_image_t const *img, int left, int top,
int width, int height, int flags) int width, int height, int flags)
{ {
if(flags & DIMAGE_NOCLIP) if(flags & DIMAGE_NOCLIP)

View file

@ -144,7 +144,7 @@ void bopti_grid(void **layer, int rows, struct command *c)
} }
} }
void bopti_render(image_t const *img, struct rbox *rbox, uint32_t *v1, void bopti_render(bopti_image_t const *img, struct rbox *rbox, uint32_t *v1,
uint32_t *v2, void *bopti_asm) uint32_t *v2, void *bopti_asm)
{ {
/* Compute rendering masks */ /* Compute rendering masks */
@ -204,7 +204,7 @@ void bopti_render(image_t const *img, struct rbox *rbox, uint32_t *v1,
bopti_grid((void **)&layer, rbox->bottom - rbox->top, &c); bopti_grid((void **)&layer, rbox->bottom - rbox->top, &c);
} }
void bopti_render_clip(int visual_x, int y, image_t const *img, int left, void bopti_render_clip(int visual_x, int y, bopti_image_t const *img, int left,
int top, int width, int height, uint32_t *v1, uint32_t *v2, int top, int width, int height, uint32_t *v1, uint32_t *v2,
void *bopti_asm) void *bopti_asm)
{ {
@ -249,8 +249,8 @@ void bopti_render_clip(int visual_x, int y, image_t const *img, int left,
bopti_render(img, &rbox, v1, v2, bopti_asm); bopti_render(img, &rbox, v1, v2, bopti_asm);
} }
void bopti_render_noclip(int visual_x, int y, image_t const *img, int left, void bopti_render_noclip(int visual_x, int y, bopti_image_t const *img,
int top, int width, int height, uint32_t *v1, uint32_t *v2, int left, int top, int width, int height, uint32_t *v1, uint32_t *v2,
void *bopti_asm) void *bopti_asm)
{ {
/* End row (excluded) */ /* End row (excluded) */

View file

@ -9,7 +9,7 @@ static void *bopti_asm[] = {
}; };
/* dimage() - render a full image */ /* dimage() - render a full image */
void dimage(int x, int y, image_t const *img) void dimage(int x, int y, bopti_image_t const *img)
{ {
if(img->gray) return; if(img->gray) return;
bopti_render_clip(x, y, img, 0, 0, img->width, img->height, gint_vram, bopti_render_clip(x, y, img, 0, 0, img->width, img->height, gint_vram,
@ -17,7 +17,7 @@ void dimage(int x, int y, image_t const *img)
} }
/* dsubimage() - render a section of an image */ /* dsubimage() - render a section of an image */
void dsubimage(int x, int y, image_t const *img, int left, int top, void dsubimage(int x, int y, bopti_image_t const *img, int left, int top,
int width, int height, int flags) int width, int height, int flags)
{ {
if(img->gray) return; if(img->gray) return;