diff options
| author | spicyjpeg <88942473+spicyjpeg@users.noreply.github.com> | 2021-12-30 14:56:55 +0100 |
|---|---|---|
| committer | spicyjpeg <88942473+spicyjpeg@users.noreply.github.com> | 2021-12-30 14:56:55 +0100 |
| commit | ba03884e3d52d47a4fa1b474ca7dc6b419ee6898 (patch) | |
| tree | a5e711b2bbc6980b8f06af21cca02a6823757168 /examples/system/dynlink/display.c | |
| parent | fe42ce7f1c98947baa49427835deb5ce70470afb (diff) | |
| download | psn00bsdk-ba03884e3d52d47a4fa1b474ca7dc6b419ee6898.tar.gz | |
Refactor dynamic linker API, fix system/dynlink example
Diffstat (limited to 'examples/system/dynlink/display.c')
| -rw-r--r-- | examples/system/dynlink/display.c | 74 |
1 files changed, 0 insertions, 74 deletions
diff --git a/examples/system/dynlink/display.c b/examples/system/dynlink/display.c deleted file mode 100644 index 573f17c..0000000 --- a/examples/system/dynlink/display.c +++ /dev/null @@ -1,74 +0,0 @@ -/* - * PSn00bSDK dynamic linker example (utilities) - * (C) 2021 spicyjpeg - MPL licensed - */ - -#include <psxgpu.h> - -#include "library/dll_common.h" - -#define SCREEN_XRES 320 -#define SCREEN_YRES 240 - -#define BGCOLOR_R 48 -#define BGCOLOR_G 24 -#define BGCOLOR_B 0 - -/* Display/GPU context utilities */ - -void init_context(CONTEXT *ctx) { - DB *db; - - ResetGraph(0); - ctx->xres = SCREEN_XRES; - ctx->yres = SCREEN_YRES; - ctx->db_active = 0; - - db = &(ctx->db[0]); - SetDefDispEnv(&(db->disp), 0, 0, SCREEN_XRES, SCREEN_YRES); - SetDefDrawEnv(&(db->draw), SCREEN_XRES, 0, SCREEN_XRES, SCREEN_YRES); - setRGB0(&(db->draw), BGCOLOR_R, BGCOLOR_G, BGCOLOR_B); - db->draw.isbg = 1; - db->draw.dtd = 1; - - db = &(ctx->db[1]); - SetDefDispEnv(&(db->disp), SCREEN_XRES, 0, SCREEN_XRES, SCREEN_YRES); - SetDefDrawEnv(&(db->draw), 0, 0, SCREEN_XRES, SCREEN_YRES); - setRGB0(&(db->draw), BGCOLOR_R, BGCOLOR_G, BGCOLOR_B); - db->draw.isbg = 1; - db->draw.dtd = 1; - - // Set up the ordering tables and primitive buffers. - db = &(ctx->db[0]); - ctx->db_nextpri = db->p; - ClearOTagR((u_long *) db->ot, OT_LEN); - - PutDrawEnv(&(db->draw)); - //PutDispEnv(&(db->disp)); - - db = &(ctx->db[1]); - ClearOTagR((u_long *) db->ot, OT_LEN); - - // Create a text stream at the top of the screen. - FntLoad(960, 0); - FntOpen(4, 12, 312, 32, 2, 256); -} - -void display(CONTEXT *ctx) { - DB *db; - - DrawSync(0); - VSync(0); - ctx->db_active ^= 1; - - db = &(ctx->db[ctx->db_active]); - ctx->db_nextpri = db->p; - ClearOTagR((u_long *) db->ot, OT_LEN); - - PutDrawEnv(&(db->draw)); - PutDispEnv(&(db->disp)); - SetDispMask(1); - - db = &(ctx->db[!ctx->db_active]); - DrawOTag((u_long *) &(db->ot[OT_LEN - 1])); -} |
