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
Signed by: Lephenixnoir
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:
* bopti: remove image_t, leaving only bopti_image_t
For the 2.1.0 release:
* 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
* gray: remove g*() functions
* core: remove the boot log
Crucial, missing things.
! core: the four basic memory functions (with automated tests)
! core: use gint_switch() to handle TLB misses
! core: recheck SH3 compatibility
Issues.
Issues:
* #3 make drawing functions parameterized
* #5 add decent random number generation (TinyMT)
* #8 support fx-CG Manager
* #10 support fx-CG 20
Complementary elements on existing code.
Extensions on existing code:
* gray: add gprint()
* gray: double-buffer gray settings and unify d* with g*
* display: deprecate image_t and rename it bopti_image_t
* topti: support unicode fonts
* 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)
* core: try to leave add-in without reset in case of panic
* hardware: fill in the HWMEM_FITTLB flag
@ -31,24 +25,19 @@ Complementary elements on existing code.
* core: use cmp/str for memchr()
* r61524: brightness control and clean the file
* t6k11: check if dupdate() can be done by the DMA
Keep in mind.
* core: review forgotten globals and MPU addresses not in <gint/mpu/*.h>
* 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: 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
* 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>
Future directions.
* A complete file system abstraction
* Integrate overclock management
* Audio playback using Martin Poupe's method
* Serial communication [SCIF] [SCIFA]
* USB communication [USB]
* Audio playback using TSWilliamson's libsnd method
* Serial communication
* USB communication, using Yatis' reverse-engineering of the module
* 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
@v1 @v2 VRAMs
@bopti_asm Rendering function */
void bopti_render_clip(int x, int y, image_t const *img, int left, int top,
int w, int h, uint32_t *v1, uint32_t *v2, void *bopti_asm);
void bopti_render_clip(int x, int y, bopti_image_t const *img, int left,
int top, int w, int h, uint32_t *v1, uint32_t *v2, void *bopti_asm);
/* bopti_render_noclip() - render a bopti image without clipping
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
@v1 @v2 VRAMs
@bopti_asm Rendering function */
void bopti_render_noclip(int x, int y, image_t const *img, int left, int top,
int w, int h, uint32_t *v1, uint32_t *v2, void *bopti_asm);
void bopti_render_noclip(int x, int y, bopti_image_t const *img, int left,
int top, int w, int h, uint32_t *v1, uint32_t *v2, void *bopti_asm);
#endif /* DISPLAY_FX */

View File

@ -56,7 +56,7 @@ enum {
// 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. */
typedef struct
{
@ -78,7 +78,11 @@ typedef struct
Then raw pixel data in row-major order. */
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

View File

@ -61,7 +61,7 @@ typedef enum
// 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
[fxconv] tool. The bopti routines can render it extremely fast, which makes
it preferable over plain bitmaps if the images are never edited. */
@ -81,7 +81,11 @@ typedef struct
/* Raw layer 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 */

View File

@ -226,7 +226,7 @@ void dprint(int x, int y, int fg, int bg, char const *format, ...);
// Image rendering (bopti)
//---
/* The image_t structure is platform-dependent. */
/* The bopti_image_t structure is platform-dependent. */
/* dimage(): Render a full image
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
@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() */
enum {
@ -256,7 +256,7 @@ enum {
@left @top Top-left coordinates of the subrectangle within [image]
@width @height Subrectangle dimensions
@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);
//---

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
@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
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]
@width @height Subrectangle dimensions
@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);
//---

View File

@ -11,7 +11,7 @@ static void *bopti_asm[] = {
};
/* 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;
gvram(&light, &dark);
@ -21,7 +21,7 @@ void gimage(int x, int y, image_t const *img)
}
/* 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)
{
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
Same parameters as dsubimage(), except for flags. */
void bopti_render_clip(int x, int y, image_t const *img, int left, int top,
int width, int height);
void bopti_render_clip(int x, int y, bopti_image_t const *img, int left,
int top, int width, int height);
/* bopti_render_clip(): Render without clipping
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.
Same parameters as dsubimage(), except for flags. */
void bopti_render_noclip(int x, int y, image_t const *img, int left, int top,
int width, int height);
void bopti_render_noclip(int x, int y, bopti_image_t const *img, int left,
int top, int width, int height);
#endif /* GINT_RENDERCG_BOPTIASM */

View File

@ -18,7 +18,7 @@ enum {
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 */
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,
int width, int height)
void bopti_render_clip(int x, int y, bopti_image_t const *img, int left,
int top, int width, int height)
{
/* Adjust the bounding box of the input image */
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);
}
void bopti_render_noclip(int x, int y, image_t const *img, int left, int top,
int width, int height)
void bopti_render_noclip(int x, int y, bopti_image_t const *img, int left,
int top, int width, int height)
{
struct box box = { x, y, width, height, left, top };
bopti_render(img, &box);

View File

@ -2,13 +2,13 @@
#include "bopti-asm.h"
/* 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);
}
/* 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)
{
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)
{
/* 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);
}
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,
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);
}
void bopti_render_noclip(int visual_x, int y, image_t const *img, int left,
int top, int width, int height, uint32_t *v1, uint32_t *v2,
void bopti_render_noclip(int visual_x, int y, bopti_image_t const *img,
int left, int top, int width, int height, uint32_t *v1, uint32_t *v2,
void *bopti_asm)
{
/* End row (excluded) */

View File

@ -9,7 +9,7 @@ static void *bopti_asm[] = {
};
/* 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;
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 */
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)
{
if(img->gray) return;