viewer.h 3.32 KB
#ifndef __viewer__
#define __viewer__

#ifdef _PARTNER
#define CFB_SEGMENT_ADDR        0x80200000
#else
#define TEX_SEGMENT_ADDR        0x80001000
#define GAMETEX_SEGMENT_ADDR    0x802DF1D0
#define GAMETICKET_SEGMENT_ADDR 0x80393E80
#define CODE_SEGMENT_ADDR       0x804171D0
#define CFB_SEGMENT_ADDR        0x80690000
#define RESERVED_SEGMENT_ADDR   0x807BC000
#endif

#define STACKSIZEBYTES          0xc000

#ifdef _LANGUAGE_C

#include <ultra64.h>

#include <PR/os.h>
#include <PR/os_bbfs.h>
#include <PR/os_bbatb.h>

#include <PR/os_bbsa.h>

#include "gfx.h"


/*
 * debug print support
 */

#undef PRINTF

#ifdef DEBUG
#define	PRINTF	osSyncPrintf
#else
#define	PRINTF(format, args...)
#endif


#define MAX_MESGS               32
#define DMA_QUEUE_SIZE          200
#define NUM_FIELDS              1 /* 1 = 60 Hz video interrupts, 2 = 30 Hz, etc */

#define UTIL_PRIORITY           1
#define INIT_PRIORITY           10
#define GAME_PRIORITY           10
#define AUDIO_PRIORITY          12
#define SCHEDULER_PRIORITY      13

#define PAGE_TOP                0
#define PAGE_GAME               1
#define PAGE_MANAGE             2
#define PAGE_CONTROL            3
#define PAGE_CPAK               4
#define PAGE_GPAK               5
#define PAGE_BIND               6

#define VW_MOVE_STILL           0 
#define VW_MOVE_UP              1 
#define VW_MOVE_DOWN            2
#define VW_MOVE_LEFT            4
#define VW_MOVE_RIGHT           8 

#define MAX_LOGO_COUNT         90
#define MAX_WARN_COUNT        240

#define VW_DATE_YEAR            0
#define VW_DATE_MON             1
#define VW_DATE_DAY             2
#define VW_DATE_DOW             3
#define VW_DATE_HR              4 
#define VW_DATE_MIN             5  
#define VW_DATE_SEC             6 

/*
 * Block size for allocation
 */
#define BB_USER_BLOCK_SIZE              (1<<18)

extern OSMesgQueue      gGfxFrameMsgQ;
extern OSMesg           gpGfxFrameMsgBuf[MAX_MESGS];
extern OSMesgQueue      gControllerMsgQ;
extern OSMesg           gControllerMsgBuf;
extern OSPiHandle       *handler;

extern u32              gCid;
extern u16              gTid;
extern u16              gTidx;
extern u16              gRow;
extern u8               gValidControllers;
extern u8               gControllers[MAXCONTROLLERS];
extern u8               gControllerCnt;

extern u32              gPageNo;
extern int              gCardInit;
extern int              gPageTopInit;
extern int              gFrameInit;
extern u8               gCpakCnt;

extern u32              gBBID;
extern u32              gCardID;
extern int              gStatus;
extern int              gTicketStatus;
extern int              gPGameUnits;
extern int              gLPGameUnits;
extern s8               gCursorX, gCursorY;
extern int              gCursorCnt;
extern int              gStickCnt;
extern u32              gMove;
extern u8               gHotSpot;
extern u32              gButton;
extern int              gClubTicketIdx;

extern char             gWarningFile[9];
extern int              gWarn;

extern u8               gpDate[7];

#ifdef SHOW_BBID
extern int gFlashErr;
extern u32 gFlashErrAddr;
#endif

void     initGFX(void);
void     initCntrl(void);
void     createGfxTask(GFXInfo *i);
void     updateController(void);
s32      sberrCorrect(char stateName[] /* 8.3 <cid>.sta */);

extern   void  resetViewer(void);

#endif /* _LANGUAGE_C */

#endif /* __viewer__ */