gfx.h 1.5 KB
#ifndef __viewergfx__
#define __viewergfx__

#include <sched.h>

#ifdef HI_RES
#define SCREEN_HT          480
#define SCREEN_WD          640
#define FRAME_WD           544
#define FRAME_HT           416
#define FRAME_X            48
#define FRAME_Y            0 
#else
#define SCREEN_HT          240
#define SCREEN_WD          320 
#define FRAME_WD           272 
#define FRAME_HT           208
#define FRAME_X            24 
#define FRAME_Y            16 
#endif


#ifdef _LANGUAGE_C /* needed because file is included by "spec" */

/*
 * Layout of our dynamic segment
 */
typedef struct {
    Mtx    projection;
    Mtx    viewing;
    Mtx    bg_model;
    Mtx    logo_scale;
    Mtx    logo_rotate;
    Mtx    logo_trans;
    Gfx    glist[10240];    /* buffer to hold display list */
} Dynamic;

typedef union {    
    struct {
        short  type;
    } gen;
    struct {
        short  type;
    } done;
    OSScMsg    app;
} GFXMsg;

typedef struct {
    OSScTask    task;
    Dynamic     dp;
    GFXMsg      msg;
    u16         *cfb;
} GFXInfo;

/* dynamic segment structure: */
extern Dynamic  dynamic;

/* some static display lists: */
extern Gfx      rdpinit_dl[];
extern Gfx      rspinit_dl[];

/* global pointer for display list: */
extern Gfx      *gpGfxList;

/* frame buffer, zbuffer: */
extern unsigned short cfb_16_a[];
extern unsigned short cfb_16_b[];

/* yield buffer: */
extern u64    gfxYieldBuf[];

/* matrix stack buffer: */
extern u64    dram_stack[];

#endif    /* _LANGUAGE_C */
#endif /* __viewergfx__ */