based on pcsx4all code.
plugins/dfsound/xa.o plugins/dfsound/freeze.o plugins/dfsound/cfg.o plugins/dfsound/registers.o \
plugins/dfsound/spu.o
# gpu
-OBJS += plugins/dfxvideo/cfg.o plugins/dfxvideo/fps.o plugins/dfxvideo/key.o plugins/dfxvideo/prim.o \
- plugins/dfxvideo/gpu.o plugins/dfxvideo/menu.o plugins/dfxvideo/soft.o plugins/dfxvideo/zn.o
+plugins/dfxvideo/%.o: CFLAGS += -Wall
+OBJS += plugins/dfxvideo/gpu.o
ifdef X11
LDFLAGS += -lX11 -lXv
OBJS += plugins/dfxvideo/draw.o
else
-plugins/dfxvideo/%.o: CFLAGS += -D_MACGL # disables X in dfxvideo
OBJS += plugins/dfxvideo/draw_fb.o
endif
# cdrcimg
+++ /dev/null
-/***************************************************************************
- cfg.c - description
- -------------------
- begin : Sun Oct 28 2001
- copyright : (C) 2001 by Pete Bernert
- email : BlackDove@addcom.de
- ***************************************************************************/
-/***************************************************************************
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. See also the license.txt file for *
- * additional informations. *
- * *
- ***************************************************************************/
-
-#define _IN_CFG
-
-#include <sys/stat.h>
-#include <unistd.h>
-#include <stdlib.h>
-
-#undef FALSE
-#undef TRUE
-#define MAKELONG(low,high) ((unsigned long)(((unsigned short)(low)) | (((unsigned long)((unsigned short)(high))) << 16)))
-
-#include "externals.h"
-#include "cfg.h"
-#include "gpu.h"
-
-char * pConfigFile = NULL;
-
-// CONFIG FILE helpers....
-// some helper macros:
-
-#define GetValue(name, var) \
- p = strstr(pB, name); \
- if (p != NULL) { \
- p+=strlen(name); \
- while ((*p == ' ') || (*p == '=')) p++; \
- if (*p != '\n') var = atoi(p); \
- }
-
-#define GetFloatValue(name, var) \
- p = strstr(pB, name); \
- if (p != NULL) { \
- p+=strlen(name); \
- while ((*p == ' ') || (*p == '=')) p++; \
- if (*p != '\n') var = (float)atof(p); \
- }
-
-#define SetValue(name, var) \
- p = strstr(pB, name); \
- if (p != NULL) { \
- p+=strlen(name); \
- while ((*p == ' ') || (*p == '=')) p++; \
- if (*p != '\n') { \
- len = sprintf(t1, "%d", var); \
- strncpy(p, t1, len); \
- if (p[len] != ' ' && p[len] != '\n' && p[len] != 0) p[len] = ' '; \
- } \
- } \
- else { \
- size+=sprintf(pB+size, "%s = %d\n", name, var); \
- }
-
-#define SetFloatValue(name, var) \
- p = strstr(pB, name); \
- if (p != NULL) { \
- p+=strlen(name); \
- while ((*p == ' ') || (*p == '=')) p++; \
- if (*p != '\n') { \
- len = sprintf(t1, "%.1f", (double)var); \
- strncpy(p, t1, len); \
- if (p[len] != ' ' && p[len] != '\n' && p[len] != 0) p[len] = ' '; \
- } \
- } \
- else { \
- size+=sprintf(pB+size, "%s = %.1f\n", name, (double)var); \
- }
-
-static void ReadConfigFile()
-{
- struct stat buf;
- FILE *in;char t[256];int len, size;
- char * pB, * p;
-
- if(pConfigFile)
- strcpy(t,pConfigFile);
- else
- {
- strcpy(t,"dfxvideo.cfg");
- in = fopen(t,"rb");
- if (!in)
- {
- strcpy(t,"cfg/dfxvideo.cfg");
- in = fopen(t,"rb");
- if(!in) sprintf(t,"%s/.pcsx/plugins/dfxvideo.cfg",getenv("HOME"));
- else fclose(in);
- }
- else fclose(in);
- }
-
- if (stat(t, &buf) == -1) return;
- size = buf.st_size;
-
- in = fopen(t,"rb");
- if (!in) return;
-
- pB=(char *)malloc(size + 1);
- memset(pB,0,size + 1);
-
- len = fread(pB, 1, size, in);
- fclose(in);
-
- GetValue("ResX", iResX);
- if(iResX<20) iResX=20;
- iResX=(iResX/4)*4;
-
- GetValue("ResY", iResY);
- if(iResY<20) iResY=20;
- iResY=(iResY/4)*4;
-
- iWinSize=MAKELONG(iResX,iResY);
-
- GetValue("NoStretch", iUseNoStretchBlt);
-
- GetValue("Dithering", iUseDither);
-
- GetValue("FullScreen", iWindowMode);
- if(iWindowMode!=0) iWindowMode=0;
- else iWindowMode=1;
-
- GetValue("ShowFPS", iShowFPS);
- if(iShowFPS<0) iShowFPS=0;
- if(iShowFPS>1) iShowFPS=1;
-
- GetValue("Maintain43", iMaintainAspect);
- if(iMaintainAspect<0) iMaintainAspect=0;
- if(iMaintainAspect>1) iMaintainAspect=1;
-
- GetValue("UseFrameLimit", UseFrameLimit);
- if(UseFrameLimit<0) UseFrameLimit=0;
- if(UseFrameLimit>1) UseFrameLimit=1;
-
- GetValue("UseFrameSkip", UseFrameSkip);
- if(UseFrameSkip<0) UseFrameSkip=0;
- if(UseFrameSkip>1) UseFrameSkip=1;
-
- GetValue("FPSDetection", iFrameLimit);
- if(iFrameLimit<1) iFrameLimit=1;
- if(iFrameLimit>2) iFrameLimit=2;
-
- GetFloatValue("FrameRate", fFrameRate);
- fFrameRate/=10;
- if(fFrameRate<10.0f) fFrameRate=10.0f;
- if(fFrameRate>1000.0f) fFrameRate=1000.0f;
-
- GetValue("CfgFixes", dwCfgFixes);
-
- GetValue("UseFixes", iUseFixes);
- if(iUseFixes<0) iUseFixes=0;
- if(iUseFixes>1) iUseFixes=1;
-
- free(pB);
-}
-
-void ExecCfg(char *arg) {
- char cfg[256];
- struct stat buf;
-
- strcpy(cfg, "./cfgDFXVideo");
- if (stat(cfg, &buf) != -1) {
- if (fork() == 0) {
- execl(cfg, "cfgDFXVideo", arg, NULL);
- exit(0);
- }
- return;
- }
-
- strcpy(cfg, "./cfg/cfgDFXVideo");
- if (stat(cfg, &buf) != -1) {
- if (fork() == 0) {
- execl(cfg, "cfgDFXVideo", arg, NULL);
- exit(0);
- }
- return;
- }
-
- sprintf(cfg, "%s/.pcsx/plugins/cfg/cfgDFXVideo", getenv("HOME"));
- if (stat(cfg, &buf) != -1) {
- if (fork() == 0) {
- execl(cfg, "cfgDFXVideo", arg, NULL);
- exit(0);
- }
- return;
- }
-
- printf("ERROR: cfgDFXVideo file not found!\n");
-}
-
-void SoftDlgProc(void)
-{
- ExecCfg("CFG");
-}
-
-void AboutDlgProc(void)
-{
- char args[256];
-
- sprintf(args, "ABOUT");
- ExecCfg(args);
-}
-
-void ReadConfigGPU(void)
-{
- // defaults
- iResX=640;iResY=480;
- iWinSize=MAKELONG(iResX,iResY);
- iColDepth=32;
- iWindowMode=1;
- iMaintainAspect=0;
- iFrameLimit=2;
- fFrameRate=200.0f;
- iUseFixes=0;
- iUseNoStretchBlt=0;
- iShowFPS=0;
- // pcsx-rearmed: managed by frontend
- //UseFrameLimit=1;
- //UseFrameSkip=0;
- //dwCfgFixes=0;
- //iUseDither=0;
-
- // read sets
- ReadConfigFile();
-
- // additional checks
- if(!iColDepth) iColDepth=32;
- if(iUseFixes) dwActFixes=dwCfgFixes;
- SetFixes();
-}
-
-void WriteConfig(void) {
-
- struct stat buf;
- FILE *out;char t[256];int len, size;
- char * pB, * p; char t1[8];
-
- if(pConfigFile)
- strcpy(t,pConfigFile);
- else
- {
- strcpy(t,"dfxvideo.cfg");
- out = fopen(t,"rb");
- if (!out)
- {
- strcpy(t,"cfg/dfxvideo.cfg");
- out = fopen(t,"rb");
- if(!out) sprintf(t,"%s/.pcsx/plugins/dfxvideo.cfg",getenv("HOME"));
- else fclose(out);
- }
- else fclose(out);
- }
-
- if (stat(t, &buf) != -1) size = buf.st_size;
- else size = 0;
-
- out = fopen(t,"rb");
- if (!out) {
- // defaults
- iResX=640;iResY=480;
- iColDepth=32;
- iWindowMode=1;
- iMaintainAspect=0;
- UseFrameLimit=0;
- UseFrameSkip=0;
- iFrameLimit=2;
- fFrameRate=200.0f;
- dwCfgFixes=0;
- iUseFixes=0;
- iUseNoStretchBlt=0;
- iUseDither=0;
- iShowFPS=0;
-
- size = 0;
- pB=(char *)malloc(4096);
- memset(pB,0,4096);
- }
- else {
- pB=(char *)malloc(size+4096);
- memset(pB,0,size+4096);
-
- len = fread(pB, 1, size, out);
- fclose(out);
- }
-
- SetValue("ResX", iResX);
- SetValue("ResY", iResY);
- SetValue("NoStretch", iUseNoStretchBlt);
- SetValue("Dithering", iUseDither);
- SetValue("FullScreen", !iWindowMode);
- SetValue("ShowFPS", iShowFPS);
- SetValue("Maintain43", iMaintainAspect);
- SetValue("UseFrameLimit", UseFrameLimit);
- SetValue("UseFrameSkip", UseFrameSkip);
- SetValue("FPSDetection", iFrameLimit);
- SetFloatValue("FrameRate", fFrameRate);
- SetValue("CfgFixes", (unsigned int)dwCfgFixes);
- SetValue("UseFixes", iUseFixes);
-
- out = fopen(t,"wb");
- if (!out) return;
-
- len = fwrite(pB, 1, size, out);
- fclose(out);
-
- free(pB);
-}
+++ /dev/null
-/***************************************************************************
- cfg.h - description
- -------------------
- begin : Sun Oct 28 2001
- copyright : (C) 2001 by Pete Bernert
- email : BlackDove@addcom.de
- ***************************************************************************/
-/***************************************************************************
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. See also the license.txt file for *
- * additional informations. *
- * *
- ***************************************************************************/
-
-#ifndef _GPU_CFG_H_
-#define _GPU_CFG_H_
-
-void ReadConfigGPU(void);
-void WriteConfig(void);
-void ReadWinSizeConfig(void);
-
-void SoftDlgProc(void);
-void AboutDlgProc(void);
-
-#endif // _GPU_CFG_H_
#define _IN_DRAW
-#include "externals.h"
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+#include <X11/cursorfont.h>
+
#include "gpu.h"
-#include "draw.h"
-#include "prim.h"
-#include "menu.h"
-#include "interp.h"
-#include "swap.h"
// misc globals
-int iResX;
-int iResY;
+int iResX=640;
+int iResY=480;
long lLowerpart;
BOOL bIsFirstFrame = TRUE;
BOOL bCheckMask = FALSE;
int iFVDisplay = 0;
PSXPoint_t ptCursorPoint[8];
unsigned short usCursorActive = 0;
+unsigned long ulKeybits;
+
+int iWindowMode=1;
+int iColDepth=32;
+char szDispBuf[64];
+char szMenuBuf[36];
+char szDebugText[512];
+void InitMenu(void) {}
+void CloseMenu(void) {}
//unsigned int LUT16to32[65536];
//unsigned int RGBtoYUV[65536];
XShmSegmentInfo shminfo;
int finalw,finalh;
+typedef struct {
+#define MWM_HINTS_DECORATIONS 2
+ long flags;
+ long functions;
+ long decorations;
+ long input_mode;
+} MotifWmHints;
+
extern XvImage *XvShmCreateImage(Display*, XvPortID, int, char*, int, int, XShmSegmentInfo*);
#include <time.h>
}
}
-extern time_t tStart;
+time_t tStart;
//Note: dest x,y,w,h are both input and output variables
inline void MaintainAspect(unsigned int *dx,unsigned int *dy,unsigned int *dw,unsigned int *dh)
p2XSaIFunc=NULL;
+#if 0
if(iUseNoStretchBlt==1)
{
p2XSaIFunc=Std2xSaI_ex8;
{
p2XSaIFunc=hq3x_32;
}
+#endif
bUsingTWin=FALSE;
iShowFPS=0;
ulKeybits|=KEY_SHOWFPS;
szDispBuf[0]=0;
- BuildDispMenu(0);
+ //BuildDispMenu(0);
}
return 0;
{
}
+#if 0
static void hq2x_32_def(uint32_t * dst0, uint32_t * dst1, const uint32_t * src0, const uint32_t * src1, const uint32_t * src2, unsigned count)
{
static unsigned char cache_vert_mask[640];
hq3x_32_def(dst0, dst1, dst2, src0, src1, src1, width);
}
+#endif
+++ /dev/null
-/***************************************************************************
- draw.h - description
- -------------------
- begin : Sun Oct 28 2001
- copyright : (C) 2001 by Pete Bernert
- email : BlackDove@addcom.de
- ***************************************************************************/
-/***************************************************************************
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. See also the license.txt file for *
- * additional informations. *
- * *
- ***************************************************************************/
-
-#ifndef _GPU_DRAW_H_
-#define _GPU_DRAW_H_
-
-void DoBufferSwap(void);
-void DoClearScreenBuffer(void);
-void DoClearFrontBuffer(void);
-unsigned long ulInitDisplay(void);
-void CloseDisplay(void);
-void CreatePic(unsigned char * pMem);
-void DestroyPic(void);
-void DisplayPic(void);
-void ShowGpuPic(void);
-void ShowTextGpuPic(void);
-
-typedef struct {
-#define MWM_HINTS_DECORATIONS 2
- long flags;
- long functions;
- long decorations;
- long input_mode;
-} MotifWmHints;
-
-#ifdef _WINDOWS
-void MoveScanLineArea(HWND hwnd);
-#endif
-
-///////////////////////////////////////////////////////////////////////
-
-#endif // _GPU_DRAW_H_
#define _IN_DRAW
-#include "externals.h"
#include "gpu.h"
-#include "draw.h"
-#include "prim.h"
-#include "menu.h"
-#include "interp.h"
-#include "swap.h"
#include "plugin_lib.h"
#include "pcnt.h"
// misc globals
-int iResX;
-int iResY;
long lLowerpart;
-BOOL bIsFirstFrame = TRUE;
BOOL bCheckMask = FALSE;
-unsigned short sSetMask = 0;
-unsigned long lSetMask = 0;
-int iDesktopCol = 16;
-int iShowFPS = 0;
-int iWinSize;
-int iMaintainAspect = 0;
-int iUseNoStretchBlt = 0;
-int iFastFwd = 0;
-int iFVDisplay = 0;
-PSXPoint_t ptCursorPoint[8];
-unsigned short usCursorActive = 0;
-char * pCaptionText;
+unsigned short sSetMask;
+unsigned long lSetMask;
#ifndef __arm__
#define bgr555_to_rgb565 memcpy
pl_fbdev_flip();
}
-void DoClearScreenBuffer(void) // CLEAR DX BUFFER
+void DoClearScreenBuffer(void)
{
}
-void DoClearFrontBuffer(void) // CLEAR DX BUFFER
-{
-}
-
-static int initialize(void)
-{
- iDesktopCol=32;
-
- bUsingTWin=FALSE;
- bIsFirstFrame = FALSE; // done
-
- if(iShowFPS)
- {
- iShowFPS=0;
- ulKeybits|=KEY_SHOWFPS;
- szDispBuf[0]=0;
- BuildDispMenu(0);
- }
-
- return 0;
-}
-
unsigned long ulInitDisplay(void)
{
- iShowFPS=1;
- initialize();
-
if (pl_fbdev_open() != 0)
return 0;
void CloseDisplay(void)
{
- CloseMenu();
pl_fbdev_close();
- //WriteConfig();
}
-void CreatePic(unsigned char * pMem)
-{
-}
-
-void DestroyPic(void)
-{
-}
-
-void HandleKey(int keycode)
-{
-}
+++ /dev/null
-/***************************************************************************
- externals.h - description
- -------------------
- begin : Sun Oct 28 2001
- copyright : (C) 2001 by Pete Bernert
- email : BlackDove@addcom.de
- ***************************************************************************/
-/***************************************************************************
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. See also the license.txt file for *
- * additional informations. *
- * *
- ***************************************************************************/
-
-#define INFO_TW 0
-#define INFO_DRAWSTART 1
-#define INFO_DRAWEND 2
-#define INFO_DRAWOFF 3
-
-#define SHADETEXBIT(x) ((x>>24) & 0x1)
-#define SEMITRANSBIT(x) ((x>>25) & 0x1)
-#define PSXRGB(r,g,b) ((g<<10)|(b<<5)|r)
-
-#define DATAREGISTERMODES unsigned short
-
-#define DR_NORMAL 0
-#define DR_VRAMTRANSFER 1
-
-
-#define GPUSTATUS_ODDLINES 0x80000000
-#define GPUSTATUS_DMABITS 0x60000000 // Two bits
-#define GPUSTATUS_READYFORCOMMANDS 0x10000000
-#define GPUSTATUS_READYFORVRAM 0x08000000
-#define GPUSTATUS_IDLE 0x04000000
-#define GPUSTATUS_DISPLAYDISABLED 0x00800000
-#define GPUSTATUS_INTERLACED 0x00400000
-#define GPUSTATUS_RGB24 0x00200000
-#define GPUSTATUS_PAL 0x00100000
-#define GPUSTATUS_DOUBLEHEIGHT 0x00080000
-#define GPUSTATUS_WIDTHBITS 0x00070000 // Three bits
-#define GPUSTATUS_MASKENABLED 0x00001000
-#define GPUSTATUS_MASKDRAWN 0x00000800
-#define GPUSTATUS_DRAWINGALLOWED 0x00000400
-#define GPUSTATUS_DITHER 0x00000200
-
-#define GPUIsBusy (lGPUstatusRet &= ~GPUSTATUS_IDLE)
-#define GPUIsIdle (lGPUstatusRet |= GPUSTATUS_IDLE)
-
-#define GPUIsNotReadyForCommands (lGPUstatusRet &= ~GPUSTATUS_READYFORCOMMANDS)
-#define GPUIsReadyForCommands (lGPUstatusRet |= GPUSTATUS_READYFORCOMMANDS)
-
-#define __X11_C_
-//X11 render
-#define __inline inline
-#define CALLBACK
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/time.h>
-#ifndef _MACGL
-#include <X11/Xlib.h>
-#include <X11/Xutil.h>
-#include <X11/cursorfont.h>
-#endif
-#include <math.h>
-#include <stdint.h>
-
-/////////////////////////////////////////////////////////////////////////////
-
-typedef struct VRAMLOADTTAG
-{
- short x;
- short y;
- short Width;
- short Height;
- short RowsRemaining;
- short ColsRemaining;
- unsigned short *ImagePtr;
-} VRAMLoad_t;
-
-/////////////////////////////////////////////////////////////////////////////
-
-typedef struct PSXPOINTTAG
-{
- int32_t x;
- int32_t y;
-} PSXPoint_t;
-
-typedef struct PSXSPOINTTAG
-{
- short x;
- short y;
-} PSXSPoint_t;
-
-typedef struct PSXRECTTAG
-{
- short x0;
- short x1;
- short y0;
- short y1;
-} PSXRect_t;
-
-// linux defines for some windows stuff
-
-#define FALSE 0
-#define TRUE 1
-#define BOOL unsigned short
-#define LOWORD(l) ((unsigned short)(l))
-#define HIWORD(l) ((unsigned short)(((uint32_t)(l) >> 16) & 0xFFFF))
-#define max(a,b) (((a) > (b)) ? (a) : (b))
-#define min(a,b) (((a) < (b)) ? (a) : (b))
-#define DWORD uint32_t
-#define __int64 long long int
-
-typedef struct RECTTAG
-{
- int left;
- int top;
- int right;
- int bottom;
-}RECT;
-
-
-
-/////////////////////////////////////////////////////////////////////////////
-
-typedef struct TWINTAG
-{
- PSXRect_t Position;
-} TWin_t;
-
-/////////////////////////////////////////////////////////////////////////////
-
-typedef struct PSXDISPLAYTAG
-{
- PSXPoint_t DisplayModeNew;
- PSXPoint_t DisplayMode;
- PSXPoint_t DisplayPosition;
- PSXPoint_t DisplayEnd;
-
- int32_t Double;
- int32_t Height;
- int32_t PAL;
- int32_t InterlacedNew;
- int32_t Interlaced;
- int32_t RGB24New;
- int32_t RGB24;
- PSXSPoint_t DrawOffset;
- int32_t Disabled;
- PSXRect_t Range;
-
-} PSXDisplay_t;
-
-/////////////////////////////////////////////////////////////////////////////
-
-// draw.c
-
-#ifndef _IN_DRAW
-
-extern char * pCaptionText;
-
-extern int iResX;
-extern int iResY;
-extern int32_t GlobalTextAddrX,GlobalTextAddrY,GlobalTextTP;
-extern int32_t GlobalTextREST,GlobalTextABR,GlobalTextPAGE;
-extern short ly0,lx0,ly1,lx1,ly2,lx2,ly3,lx3;
-extern long lLowerpart;
-extern BOOL bIsFirstFrame;
-extern int iWinSize;
-extern BOOL bCheckMask;
-extern unsigned short sSetMask;
-extern unsigned long lSetMask;
-extern BOOL bDeviceOK;
-extern short g_m1;
-extern short g_m2;
-extern short g_m3;
-extern short DrawSemiTrans;
-extern int iUseGammaVal;
-extern int iMaintainAspect;
-extern int iDesktopCol;
-extern int iUseNoStretchBlt;
-extern int iShowFPS;
-extern int iFastFwd;
-extern int iDebugMode;
-extern int iFVDisplay;
-extern PSXPoint_t ptCursorPoint[];
-extern unsigned short usCursorActive;
-
-
-#endif
-
-// prim.c
-
-#ifndef _IN_PRIMDRAW
-
-extern BOOL bUsingTWin;
-extern TWin_t TWin;
-//extern unsigned long clutid;
-extern void (*primTableJ[256])(unsigned char *);
-extern void (*primTableSkip[256])(unsigned char *);
-extern unsigned short usMirror;
-extern int iDither;
-extern uint32_t dwCfgFixes;
-extern uint32_t dwActFixes;
-extern uint32_t dwEmuFixes;
-extern int iUseFixes;
-extern int iUseDither;
-extern BOOL bDoVSyncUpdate;
-extern int32_t drawX;
-extern int32_t drawY;
-extern int32_t drawW;
-extern int32_t drawH;
-
-#endif
-
-// gpu.c
-
-#ifndef _IN_GPU
-
-extern VRAMLoad_t VRAMWrite;
-extern VRAMLoad_t VRAMRead;
-extern DATAREGISTERMODES DataWriteMode;
-extern DATAREGISTERMODES DataReadMode;
-extern int iColDepth;
-extern int iWindowMode;
-extern char szDispBuf[];
-extern char szMenuBuf[];
-extern char szDebugText[];
-extern short sDispWidths[];
-extern BOOL bDebugText;
-//extern unsigned int iMaxDMACommandCounter;
-//extern unsigned long dwDMAChainStop;
-extern PSXDisplay_t PSXDisplay;
-extern PSXDisplay_t PreviousPSXDisplay;
-extern BOOL bSkipNextFrame;
-extern long lGPUstatusRet;
-//extern long drawingLines;
-extern unsigned char * psxVSecure;
-extern unsigned char * psxVub;
-extern signed char * psxVsb;
-extern unsigned short * psxVuw;
-extern signed short * psxVsw;
-extern uint32_t * psxVul;
-extern int32_t * psxVsl;
-extern unsigned short * psxVuw_eom;
-extern BOOL bChangeWinMode;
-extern long lSelectedSlot;
-extern BOOL bInitCap;
-extern DWORD dwLaceCnt;
-extern uint32_t lGPUInfoVals[];
-extern uint32_t ulStatusControl[];
-
-#endif
-
-// menu.c
-
-#ifndef _IN_MENU
-
-extern uint32_t dwCoreFlags;
-
-#endif
-
-// key.c
-
-#ifndef _IN_KEY
-
-extern unsigned long ulKeybits;
-
-#endif
-
-// fps.c
-
-#ifndef _IN_FPS
-
-extern int UseFrameLimit;
-extern int UseFrameSkip;
-extern float fFrameRate;
-extern int iFrameLimit;
-extern float fFrameRateHz;
-extern float fps_skip;
-extern float fps_cur;
-
-#endif
-
-// key.c
-
-#ifndef _IN_KEY
-
-#endif
-
-// cfg.c
-
-#ifndef _IN_CFG
-
-extern char * pConfigFile;
-
-#endif
-
-// zn.c
-
-#ifndef _IN_ZN
-
-extern uint32_t dwGPUVersion;
-extern int iGPUHeight;
-extern int iGPUHeightMask;
-extern int GlobalTextIL;
-extern int iTileCheat;
-
-#endif
-
-
* *
***************************************************************************/
-#define _IN_FPS
-
-#include <unistd.h>
-
-#include "externals.h"
-#include "fps.h"
-#include "gpu.h"
-
// FPS stuff
float fFrameRateHz=0;
DWORD dwFrameRateTicks=16;
-float fFrameRate;
-int iFrameLimit;
+float fFrameRate=200.0f;
+int iFrameLimit=2;
int UseFrameLimit=0;
int UseFrameSkip=0;
float fps_skip = 0;
float fps_cur = 0;
+#define TIMEBASE 100000
#define MAXLACE 16
+#define MAXSKIP 120
+
+static void calcfps(void);
+static void FrameCap(void);
void CheckFrameRate(void)
{
else // non-skipping mode:
{
if(UseFrameLimit) FrameCap(); // -> do it
- /*if(ulKeybits&KEY_SHOWFPS)*/ calcfps(); // -> and calc fps display
+ calcfps(); // -> and calc fps display
}
}
-#define TIMEBASE 100000
-
-unsigned long timeGetTime()
+static unsigned long timeGetTime(void)
{
struct timeval tv;
gettimeofday(&tv, 0); // well, maybe there are better ways
return tv.tv_sec * 100000 + tv.tv_usec/10; // to do that, but at least it works
}
-void FrameCap (void)
+static void FrameCap (void)
{
static unsigned long curticks, lastticks, _ticks_since_last_update;
static unsigned int TicksToWait = 0;
}
}
-#define MAXSKIP 120
-
-void FrameSkip(void)
+static void FrameSkip(void)
{
static int iNumSkips=0,iAdditionalSkip=0; // number of additional frames to skip
static DWORD dwLastLace=0; // helper var for frame limitation
dwLaceCnt=0; // init lace counter
}
-void calcfps(void)
+static void calcfps(void)
{
static unsigned long curticks,_ticks_since_last_update,lastticks;
static long fps_cnt = 0;
fps_cnt = 0;
fps_tck = 1;
-
- //if(UseFrameLimit && fps_cur>fFrameRateHz) // optical adjust ;) avoids flickering fps display
- //fps_cur=fFrameRateHz;
}
}
-void PCFrameCap (void)
+static void PCFrameCap (void)
{
static unsigned long curticks, lastticks, _ticks_since_last_update;
static unsigned long TicksToWait = 0;
}
}
-void PCcalcfps(void)
+static void PCcalcfps(void)
{
static unsigned long curticks,_ticks_since_last_update,lastticks;
static long fps_cnt = 0;
}
}
-void SetFPSHandler(void)
-{
-}
-
-void InitFPS(void)
+static void InitFPS(void)
{
if(!fFrameRate) fFrameRate=200.0f;
if(fFrameRateHz==0) fFrameRateHz=fFrameRate; // set user framerate
+++ /dev/null
-/***************************************************************************\r
- fps.h - description\r
- -------------------\r
- begin : Sun Oct 28 2001\r
- copyright : (C) 2001 by Pete Bernert\r
- email : BlackDove@addcom.de\r
- ***************************************************************************/\r
-/***************************************************************************\r
- * *\r
- * This program is free software; you can redistribute it and/or modify *\r
- * it under the terms of the GNU General Public License as published by *\r
- * the Free Software Foundation; either version 2 of the License, or *\r
- * (at your option) any later version. See also the license.txt file for *\r
- * additional informations. *\r
- * *\r
- ***************************************************************************/\r
-\r
-#ifndef _FPS_INTERNALS_H\r
-#define _FPS_INTERNALS_H\r
-\r
-void FrameCap(void); \r
-void FrameSkip(void); \r
-void calcfps(void);\r
-void PCFrameCap (void);\r
-void PCcalcfps(void);\r
-void SetAutoFrameCap(void);\r
-void SetFPSHandler(void);\r
-void InitFPS(void);\r
-void CheckFrameRate(void);\r
-\r
-#endif // _FPS_INTERNALS_H\r
* *
***************************************************************************/
-#ifndef _MACGL
-#include "config.h"
-#endif
-
-#define _IN_GPU
-
-#include "externals.h"
#include "gpu.h"
-#include "draw.h"
-#include "cfg.h"
-#include "prim.h"
#include "stdint.h"
#include "psemu_plugin_defs.h"
-#include "menu.h"
-#include "key.h"
-#include "fps.h"
-#include "swap.h"
-
-#ifdef ENABLE_NLS
-#include <libintl.h>
-#include <locale.h>
-#define _(x) gettext(x)
-#define N_(x) (x)
-#else
-#define _(x) (x)
-#define N_(x) (x)
-#endif
-
-////////////////////////////////////////////////////////////////////////
-// PPDK developer must change libraryName field and can change revision and build
-////////////////////////////////////////////////////////////////////////
-
-const unsigned char version = 1; // do not touch - library for PSEmu 1.x
-const unsigned char revision = 1;
-const unsigned char build = 17; // increase that with each version
-
-#ifdef _MACGL
-static char *libraryName = N_("SoftGL Driver");
-static char *libraryInfo = N_("P.E.Op.S. SoftGL Driver V1.17\nCoded by Pete Bernert and the P.E.Op.S. team\n");
-#else
-static char *libraryName = N_("XVideo Driver");
-static char *libraryInfo = N_("P.E.Op.S. Xvideo Driver V1.17\nCoded by Pete Bernert and the P.E.Op.S. team\n");
-#endif
-
-static char *PluginAuthor = N_("Pete Bernert and the P.E.Op.S. team");
////////////////////////////////////////////////////////////////////////
// memory image of the PSX vram
unsigned short *psxVuw;
unsigned short *psxVuw_eom;
signed short *psxVsw;
-uint32_t *psxVul;
+uint32_t *psxVul;
int32_t *psxVsl;
////////////////////////////////////////////////////////////////////////
static long lGPUdataRet;
long lGPUstatusRet;
-char szDispBuf[64];
-char szMenuBuf[36];
-char szDebugText[512];
-uint32_t ulStatusControl[256];
+uint32_t ulStatusControl[256];
static uint32_t gpuDataM[256];
static unsigned char gpuCommand = 0;
BOOL bSkipNextFrame = FALSE;
DWORD dwLaceCnt=0;
-int iColDepth;
-int iWindowMode;
short sDispWidths[8] = {256,320,512,640,368,384,512,640};
PSXDisplay_t PSXDisplay;
PSXDisplay_t PreviousPSXDisplay;
long lSelectedSlot=0;
-BOOL bChangeWinMode=FALSE;
BOOL bDoLazyUpdate=FALSE;
uint32_t lGPUInfoVals[16];
static int iFakePrimBusy=0;
////////////////////////////////////////////////////////////////////////
#include <time.h>
-time_t tStart;
-void CALLBACK GPUdisplayText(char * pText) // some debug func
-{
- if(!pText) {szDebugText[0]=0;return;}
- if(strlen(pText)>511) return;
- time(&tStart);
- strcpy(szDebugText,pText);
-}
-
-////////////////////////////////////////////////////////////////////////
-
-void CALLBACK GPUdisplayFlags(unsigned long dwFlags) // some info func
-{
- dwCoreFlags=dwFlags;
- BuildDispMenu(0);
-}
+// FPS library
+#include "fps.c"
-////////////////////////////////////////////////////////////////////////
-// stuff to make this a true PDK module
-////////////////////////////////////////////////////////////////////////
-
-/*
-char * CALLBACK PSEgetLibName(void)
-{
- return _(libraryName);
-}
-
-unsigned long CALLBACK PSEgetLibType(void)
-{
- return PSE_LT_GPU;
-}
-
-unsigned long CALLBACK PSEgetLibVersion(void)
-{
- return version<<16|revision<<8|build;
-}
-
-char * GPUgetLibInfos(void)
-{
- return _(libraryInfo);
-}
-*/
////////////////////////////////////////////////////////////////////////
-// Snapshot func
+// sets all kind of act fixes
////////////////////////////////////////////////////////////////////////
-static char * pGetConfigInfos(int iCfg)
-{
- char szO[2][4]={"off","on "};
- char szTxt[256];
- char * pB = (char *)malloc(32767);
-
- if (!pB) return NULL;
- *pB = 0;
- //----------------------------------------------------//
- sprintf(szTxt,"Plugin: %s %d.%d.%d\r\n",libraryName,version,revision,build);
- strcat(pB,szTxt);
- sprintf(szTxt,"Author: %s\r\n\r\n",PluginAuthor);
- strcat(pB,szTxt);
- //----------------------------------------------------//
- if(iCfg && iWindowMode)
- sprintf(szTxt,"Resolution/Color:\r\n- %dx%d ",LOWORD(iWinSize),HIWORD(iWinSize));
- else
- sprintf(szTxt,"Resolution/Color:\r\n- %dx%d ",iResX,iResY);
- strcat(pB,szTxt);
- if(iWindowMode && iCfg)
- strcpy(szTxt,"Window mode\r\n");
- else
- if(iWindowMode)
- sprintf(szTxt,"Window mode - [%d Bit]\r\n",iDesktopCol);
- else
- sprintf(szTxt,"Fullscreen - [%d Bit]\r\n",iColDepth);
- strcat(pB,szTxt);
-
- sprintf(szTxt,"Stretch mode: %d\r\n",iUseNoStretchBlt);
- strcat(pB,szTxt);
- sprintf(szTxt,"Dither mode: %d\r\n\r\n",iUseDither);
- strcat(pB,szTxt);
- //----------------------------------------------------//
- sprintf(szTxt,"Framerate:\r\n- FPS limit: %s\r\n",szO[UseFrameLimit]);
- strcat(pB,szTxt);
- sprintf(szTxt,"- Frame skipping: %s",szO[UseFrameSkip]);
- strcat(pB,szTxt);
- if(iFastFwd) strcat(pB," (fast forward)");
- strcat(pB,"\r\n");
- if(iFrameLimit==2)
- strcpy(szTxt,"- FPS limit: Auto\r\n\r\n");
- else sprintf(szTxt,"- FPS limit: %.1f\r\n\r\n",fFrameRate);
- strcat(pB,szTxt);
- //----------------------------------------------------//
-#ifndef _MACGL
- strcpy(szTxt,"Misc:\r\n- MaintainAspect: ");
- if(iMaintainAspect == 0) strcat(szTxt,"disabled");
- else
- if(iMaintainAspect == 1) strcat(szTxt,"enabled");
- strcat(szTxt,"\r\n");
- strcat(pB,szTxt);
-#endif
- sprintf(szTxt,"- Game fixes: %s [%08x]\r\n",szO[iUseFixes],dwCfgFixes);
- strcat(pB,szTxt);
- //----------------------------------------------------//
- return pB;
-}
-
-static void DoTextSnapShot(int iNum)
-{
- FILE *txtfile;
- char szTxt[256];
- char *pB;
-
- sprintf(szTxt,"%s/pcsx%04d.txt",getenv("HOME"),iNum);
-
- if ((txtfile = fopen(szTxt, "wb")) == NULL)
- return;
-
- pB = pGetConfigInfos(0);
- if (pB)
- {
- fwrite(pB, strlen(pB), 1, txtfile);
- free(pB);
- }
- fclose(txtfile);
-}
-
-void CALLBACK GPUmakeSnapshot(void)
-{
- FILE *bmpfile;
- char filename[256];
- unsigned char header[0x36];
- long size, height;
- unsigned char line[1024 * 3];
- short i, j;
- unsigned char empty[2] = {0,0};
- unsigned short color;
- unsigned long snapshotnr = 0;
- unsigned char *pD;
-
- height = PreviousPSXDisplay.DisplayMode.y;
-
- size = height * PreviousPSXDisplay.Range.x1 * 3 + 0x38;
-
- // fill in proper values for BMP
-
- // hardcoded BMP header
- memset(header, 0, 0x36);
- header[0] = 'B';
- header[1] = 'M';
- header[2] = size & 0xff;
- header[3] = (size >> 8) & 0xff;
- header[4] = (size >> 16) & 0xff;
- header[5] = (size >> 24) & 0xff;
- header[0x0a] = 0x36;
- header[0x0e] = 0x28;
- header[0x12] = PreviousPSXDisplay.Range.x1 % 256;
- header[0x13] = PreviousPSXDisplay.Range.x1 / 256;
- header[0x16] = height % 256;
- header[0x17] = height / 256;
- header[0x1a] = 0x01;
- header[0x1c] = 0x18;
- header[0x26] = 0x12;
- header[0x27] = 0x0B;
- header[0x2A] = 0x12;
- header[0x2B] = 0x0B;
-
- // increment snapshot value & try to get filename
- do
- {
- snapshotnr++;
- sprintf(filename, "%s/pcsx%04ld.bmp", getenv("HOME"), snapshotnr);
-
- bmpfile = fopen(filename,"rb");
- if (bmpfile == NULL)
- break;
-
- fclose(bmpfile);
- }
- while(TRUE);
-
- // try opening new snapshot file
- if ((bmpfile = fopen(filename,"wb")) == NULL)
- return;
-
- fwrite(header, 0x36, 1, bmpfile);
- for (i = height + PSXDisplay.DisplayPosition.y - 1; i >= PSXDisplay.DisplayPosition.y; i--)
- {
- pD = (unsigned char *)&psxVuw[i * 1024 + PSXDisplay.DisplayPosition.x];
- for (j = 0; j < PreviousPSXDisplay.Range.x1; j++)
- {
- if (PSXDisplay.RGB24)
- {
- uint32_t lu = *(uint32_t *)pD;
- line[j * 3 + 2] = RED(lu);
- line[j * 3 + 1] = GREEN(lu);
- line[j * 3 + 0] = BLUE(lu);
- pD += 3;
- }
- else
- {
- color = GETLE16(pD);
- line[j * 3 + 2] = (color << 3) & 0xf1;
- line[j * 3 + 1] = (color >> 2) & 0xf1;
- line[j * 3 + 0] = (color >> 7) & 0xf1;
- pD += 2;
- }
- }
- fwrite(line, PreviousPSXDisplay.Range.x1 * 3, 1, bmpfile);
- }
- fwrite(empty, 0x2, 1, bmpfile);
- fclose(bmpfile);
-
- DoTextSnapShot(snapshotnr);
-}
+static void SetFixes(void)
+ {
+ if(dwActFixes&0x02) sDispWidths[4]=384;
+ else sDispWidths[4]=368;
+ }
////////////////////////////////////////////////////////////////////////
// INIT, will be called after lib load... well, just do some var init...
////////////////////////////////////////////////////////////////////////
-long CALLBACK GPUinit() // GPU INIT
+long CALLBACK GPUinit(void) // GPU INIT
{
memset(ulStatusControl,0,256*sizeof(uint32_t)); // init save state scontrol field
- szDebugText[0] = 0; // init debug text buffer
-
- psxVSecure = (unsigned char *)malloc((iGPUHeight*2)*1024 + (1024*1024)); // always alloc one extra MB for soft drawing funcs security
+ psxVSecure = (unsigned char *)malloc((512*2)*1024 + (1024*1024)); // always alloc one extra MB for soft drawing funcs security
if (!psxVSecure)
return -1;
psxVuw=(unsigned short *)psxVub;
psxVul=(uint32_t *)psxVub;
- psxVuw_eom=psxVuw+1024*iGPUHeight; // pre-calc of end of vram
+ psxVuw_eom=psxVuw+1024*512; // pre-calc of end of vram
- memset(psxVSecure,0x00,(iGPUHeight*2)*1024 + (1024*1024));
+ memset(psxVSecure,0x00,(512*2)*1024 + (1024*1024));
memset(lGPUInfoVals,0x00,16*sizeof(uint32_t));
- SetFPSHandler();
-
PSXDisplay.RGB24 = FALSE; // init some stuff
PSXDisplay.Interlaced = FALSE;
PSXDisplay.DrawOffset.x = 0;
long GPUopen(unsigned long * disp,char * CapText,char * CfgFile)
{
unsigned long d;
-
- pCaptionText=CapText;
-
-
- ReadConfigGPU(); // read registry
+
+ SetFixes();
InitFPS();
- bIsFirstFrame = TRUE; // we have to init later
bDoVSyncUpdate = TRUE;
d=ulInitDisplay(); // setup x
long CALLBACK GPUclose() // GPU CLOSE
{
-
- ReleaseKeyHandler(); // de-subclass window
-
CloseDisplay(); // shutdown direct draw
return 0;
// I shot the sheriff
////////////////////////////////////////////////////////////////////////
-long CALLBACK GPUshutdown() // GPU SHUTDOWN
+long CALLBACK GPUshutdown(void) // GPU SHUTDOWN
{
+ CloseDisplay(); // shutdown direct draw
free(psxVSecure);
-
return 0; // nothinh to do
}
// Update display (swap buffers)
////////////////////////////////////////////////////////////////////////
-void updateDisplay(void) // UPDATE DISPLAY
+static void updateDisplay(void) // UPDATE DISPLAY
{
if(PSXDisplay.Disabled) // disable?
{
- DoClearFrontBuffer(); // -> clear frontbuffer
return; // -> and bye
}
if(dwActFixes&32) // pc fps calculation fix
{
if(UseFrameLimit) PCFrameCap(); // -> brake
- if(UseFrameSkip || ulKeybits&KEY_SHOWFPS)
- PCcalcfps();
- }
-
- if(ulKeybits&KEY_SHOWFPS) // make fps display buf
- {
- sprintf(szDispBuf,"FPS %06.1f",fps_cur);
- }
-
- if(iFastFwd) // fastfwd ?
- {
- static int fpscount; UseFrameSkip=1;
-
- if(!bSkipNextFrame) DoBufferSwap(); // -> to skip or not to skip
- if(fpscount%6) // -> skip 6/7 frames
- bSkipNextFrame = TRUE;
- else bSkipNextFrame = FALSE;
- fpscount++;
- if(fpscount >= (int)fFrameRateHz) fpscount = 0;
- return;
+ if(UseFrameSkip) PCcalcfps();
}
if(UseFrameSkip) // skip ?
}
-
// some linux alignment security
PreviousPSXDisplay.Range.x0=PreviousPSXDisplay.Range.x0>>1;
PreviousPSXDisplay.Range.x0=PreviousPSXDisplay.Range.x0<<1;
PreviousPSXDisplay.Range.x1=PreviousPSXDisplay.Range.x1>>1;
PreviousPSXDisplay.Range.x1=PreviousPSXDisplay.Range.x1<<1;
-
DoClearScreenBuffer();
}
// new
- if((PreviousPSXDisplay.DisplayModeNew.x+PSXDisplay.DisplayModeNew.y)>iGPUHeight)
+ if((PreviousPSXDisplay.DisplayModeNew.x+PSXDisplay.DisplayModeNew.y)>512)
{
- int dy1=iGPUHeight-PreviousPSXDisplay.DisplayModeNew.x;
- int dy2=(PreviousPSXDisplay.DisplayModeNew.x+PSXDisplay.DisplayModeNew.y)-iGPUHeight;
+ int dy1=512-PreviousPSXDisplay.DisplayModeNew.x;
+ int dy2=(PreviousPSXDisplay.DisplayModeNew.x+PSXDisplay.DisplayModeNew.y)-512;
if(dy1>=dy2)
{
// check if update needed
////////////////////////////////////////////////////////////////////////
-void updateDisplayIfChanged(void) // UPDATE DISPLAY IF CHANGED
+static void updateDisplayIfChanged(void) // UPDATE DISPLAY IF CHANGED
{
if ((PSXDisplay.DisplayMode.y == PSXDisplay.DisplayModeNew.y) &&
(PSXDisplay.DisplayMode.x == PSXDisplay.DisplayModeNew.x))
if(UseFrameSkip) updateDisplay(); // stupid stuff when frame skipping enabled
}
-////////////////////////////////////////////////////////////////////////
-
-#ifndef _MACGL
-
-#include "draw.h"
-
-void ChangeWindowMode(void) // TOGGLE FULLSCREEN - WINDOW
-{
- extern Display *display;
- extern Window window;
- extern int root_window_id;
- Screen *screen;
- XSizeHints hints;
- MotifWmHints mwmhints;
- Atom mwmatom;
-
- screen=DefaultScreenOfDisplay(display);
- iWindowMode=!iWindowMode;
-
- if(!iWindowMode) // fullscreen
- {
- mwmhints.flags=MWM_HINTS_DECORATIONS;
- mwmhints.functions=0;
- mwmhints.decorations=0;
- mwmhints.input_mode=0;
- mwmatom=XInternAtom(display,"_MOTIF_WM_HINTS",0);
- XChangeProperty(display,window,mwmatom,mwmatom,32,
- PropModeReplace,(unsigned char *)&mwmhints,5);
-
- XResizeWindow(display,window,screen->width,screen->height);
-
- hints.min_width = hints.max_width = hints.base_width = screen->width;
- hints.min_height= hints.max_height = hints.base_height = screen->height;
-
- XSetWMNormalHints(display,window,&hints);
-
- {
- XEvent xev;
-
- memset(&xev, 0, sizeof(xev));
- xev.xclient.type = ClientMessage;
- xev.xclient.serial = 0;
- xev.xclient.send_event = 1;
- xev.xclient.message_type = XInternAtom(display, "_NET_WM_STATE", 0);
- xev.xclient.window = window;
- xev.xclient.format = 32;
- xev.xclient.data.l[0] = 1;
- xev.xclient.data.l[1] = XInternAtom(display, "_NET_WM_STATE_FULLSCREEN", 0);
- xev.xclient.data.l[2] = 0;
- xev.xclient.data.l[3] = 0;
- xev.xclient.data.l[4] = 0;
-
- XSendEvent(display, root_window_id, 0,
- SubstructureRedirectMask | SubstructureNotifyMask, &xev);
- }
- } else {
- {
- XEvent xev;
-
- memset(&xev, 0, sizeof(xev));
- xev.xclient.type = ClientMessage;
- xev.xclient.serial = 0;
- xev.xclient.send_event = 1;
- xev.xclient.message_type = XInternAtom(display, "_NET_WM_STATE", 0);
- xev.xclient.window = window;
- xev.xclient.format = 32;
- xev.xclient.data.l[0] = 0;
- xev.xclient.data.l[1] = XInternAtom(display, "_NET_WM_STATE_FULLSCREEN", 0);
- xev.xclient.data.l[2] = 0;
- xev.xclient.data.l[3] = 0;
- xev.xclient.data.l[4] = 0;
-
- XSendEvent(display, root_window_id, 0,
- SubstructureRedirectMask | SubstructureNotifyMask, &xev);
- }
-
- mwmhints.flags=MWM_HINTS_DECORATIONS;
- mwmhints.functions=0;
- mwmhints.decorations=1;
- mwmhints.input_mode=0;
- mwmatom=XInternAtom(display,"_MOTIF_WM_HINTS",0);
-
- //This shouldn't work on 64 bit longs, but it does...in fact, it breaks when I change all the mwmhints to int.
- //I don't pretend to understand it.
- XChangeProperty(display,window,mwmatom,mwmatom,32,
- PropModeReplace,(unsigned char *)&mwmhints,5);
-
- hints.flags=USPosition|USSize;
- hints.base_width = iResX;
- hints.base_height = iResY;
- XSetWMNormalHints(display,window,&hints);
-
- XResizeWindow(display,window,iResX,iResY);
-}
-
- DoClearScreenBuffer();
-
- bChangeWinMode=FALSE;
- bDoVSyncUpdate=TRUE;
-}
-
-#endif
-
-////////////////////////////////////////////////////////////////////////
-// gun cursor func: player=0-7, x=0-511, y=0-255
-////////////////////////////////////////////////////////////////////////
-
-void CALLBACK GPUcursor(int iPlayer,int x,int y)
-{
- if(iPlayer<0) return;
- if(iPlayer>7) return;
-
- usCursorActive|=(1<<iPlayer);
-
- if(x<0) x=0;
- if(x>511) x=511;
- if(y<0) y=0;
- if(y>255) y=255;
-
- ptCursorPoint[iPlayer].x=x;
- ptCursorPoint[iPlayer].y=y;
-}
-
////////////////////////////////////////////////////////////////////////
// update lace is called evry VSync
////////////////////////////////////////////////////////////////////////
updateDisplay(); // -> update display
}
}
-#ifndef _MACGL
- if(bChangeWinMode) ChangeWindowMode(); // toggle full - window mode
-#endif
bDoVSyncUpdate=FALSE; // vsync done
}
PreviousPSXDisplay.DisplayPosition.x = PSXDisplay.DisplayPosition.x;
PreviousPSXDisplay.DisplayPosition.y = PSXDisplay.DisplayPosition.y;
-////////
-/*
- PSXDisplay.DisplayPosition.y = (short)((gdata>>10)&0x3ff);
- if (PSXDisplay.DisplayPosition.y & 0x200)
- PSXDisplay.DisplayPosition.y |= 0xfffffc00;
- if(PSXDisplay.DisplayPosition.y<0)
- {
- PreviousPSXDisplay.DisplayModeNew.y=PSXDisplay.DisplayPosition.y/PSXDisplay.Double;
- PSXDisplay.DisplayPosition.y=0;
- }
- else PreviousPSXDisplay.DisplayModeNew.y=0;
-*/
-
// new
- if(iGPUHeight==1024)
- {
- if(dwGPUVersion==2)
- PSXDisplay.DisplayPosition.y = (short)((gdata>>12)&0x3ff);
- else PSXDisplay.DisplayPosition.y = (short)((gdata>>10)&0x3ff);
- }
- else PSXDisplay.DisplayPosition.y = (short)((gdata>>10)&0x1ff);
+ PSXDisplay.DisplayPosition.y = (short)((gdata>>10)&0x1ff);
// store the same val in some helper var, we need it on later compares
PreviousPSXDisplay.DisplayModeNew.x=PSXDisplay.DisplayPosition.y;
- if((PSXDisplay.DisplayPosition.y+PSXDisplay.DisplayMode.y)>iGPUHeight)
+ if((PSXDisplay.DisplayPosition.y+PSXDisplay.DisplayMode.y)>512)
{
- int dy1=iGPUHeight-PSXDisplay.DisplayPosition.y;
- int dy2=(PSXDisplay.DisplayPosition.y+PSXDisplay.DisplayMode.y)-iGPUHeight;
+ int dy1=512-PSXDisplay.DisplayPosition.y;
+ int dy2=(PSXDisplay.DisplayPosition.y+PSXDisplay.DisplayMode.y)-512;
if(dy1>=dy2)
{
lGPUdataRet=lGPUInfoVals[INFO_DRAWOFF]; // draw offset
return;
case 0x07:
- if(dwGPUVersion==2)
- lGPUdataRet=0x01;
- else lGPUdataRet=0x02; // gpu type
+ lGPUdataRet=0x02; // gpu type
return;
case 0x08:
case 0x0F: // some bios addr?
// vram read/write helpers, needed by LEWPY's optimized vram read/write :)
////////////////////////////////////////////////////////////////////////
-__inline void FinishedVRAMWrite(void)
+static inline void FinishedVRAMWrite(void)
{
-/*
-// NEWX
- if(!PSXDisplay.Interlaced && UseFrameSkip) // stupid frame skipping
- {
- VRAMWrite.Width +=VRAMWrite.x;
- VRAMWrite.Height+=VRAMWrite.y;
- if(VRAMWrite.x<PSXDisplay.DisplayEnd.x &&
- VRAMWrite.Width >=PSXDisplay.DisplayPosition.x &&
- VRAMWrite.y<PSXDisplay.DisplayEnd.y &&
- VRAMWrite.Height>=PSXDisplay.DisplayPosition.y)
- updateDisplay();
- }
-*/
-
// Set register to NORMAL operation
DataWriteMode = DR_NORMAL;
// Reset transfer values, to prevent mis-transfer of data
VRAMWrite.RowsRemaining = 0;
}
-__inline void FinishedVRAMRead(void)
+static inline void FinishedVRAMRead(void)
{
// Set register to NORMAL operation
DataReadMode = DR_NORMAL;
// adjust read ptr, if necessary
while(VRAMRead.ImagePtr>=psxVuw_eom)
- VRAMRead.ImagePtr-=iGPUHeight*1024;
+ VRAMRead.ImagePtr-=512*1024;
while(VRAMRead.ImagePtr<psxVuw)
- VRAMRead.ImagePtr+=iGPUHeight*1024;
+ VRAMRead.ImagePtr+=512*1024;
for(i=0;i<iSize;i++)
{
lGPUdataRet=(uint32_t)GETLE16(VRAMRead.ImagePtr);
VRAMRead.ImagePtr++;
- if(VRAMRead.ImagePtr>=psxVuw_eom) VRAMRead.ImagePtr-=iGPUHeight*1024;
+ if(VRAMRead.ImagePtr>=psxVuw_eom) VRAMRead.ImagePtr-=512*1024;
VRAMRead.RowsRemaining --;
if(VRAMRead.RowsRemaining<=0)
VRAMRead.RowsRemaining = VRAMRead.Width;
VRAMRead.ColsRemaining--;
VRAMRead.ImagePtr += 1024 - VRAMRead.Width;
- if(VRAMRead.ImagePtr>=psxVuw_eom) VRAMRead.ImagePtr-=iGPUHeight*1024;
+ if(VRAMRead.ImagePtr>=psxVuw_eom) VRAMRead.ImagePtr-=512*1024;
}
// higher 16 bit (always, even if it's an odd width)
{FinishedVRAMRead();goto ENDREAD;}
VRAMRead.ImagePtr++;
- if(VRAMRead.ImagePtr>=psxVuw_eom) VRAMRead.ImagePtr-=iGPUHeight*1024;
+ if(VRAMRead.ImagePtr>=psxVuw_eom) VRAMRead.ImagePtr-=512*1024;
VRAMRead.RowsRemaining--;
if(VRAMRead.RowsRemaining<=0)
{
VRAMRead.RowsRemaining = VRAMRead.Width;
VRAMRead.ColsRemaining--;
VRAMRead.ImagePtr += 1024 - VRAMRead.Width;
- if(VRAMRead.ImagePtr>=psxVuw_eom) VRAMRead.ImagePtr-=iGPUHeight*1024;
+ if(VRAMRead.ImagePtr>=psxVuw_eom) VRAMRead.ImagePtr-=512*1024;
}
if(VRAMRead.ColsRemaining <= 0)
{FinishedVRAMRead();goto ENDREAD;}
return lGPUdataRet;
}
+// Software drawing function
+#include "soft.c"
+
+// PSX drawing primitives
+#include "prim.c"
+
////////////////////////////////////////////////////////////////////////
// processes data send to GPU data register
// extra table entries for fixing polyline troubles
////////////////////////////////////////////////////////////////////////
-const unsigned char primTableCX[256] =
+static const unsigned char primTableCX[256] =
{
// 00
0,0,3,0,0,0,0,0,
// make sure we are in vram
while(VRAMWrite.ImagePtr>=psxVuw_eom)
- VRAMWrite.ImagePtr-=iGPUHeight*1024;
+ VRAMWrite.ImagePtr-=512*1024;
while(VRAMWrite.ImagePtr<psxVuw)
- VRAMWrite.ImagePtr+=iGPUHeight*1024;
+ VRAMWrite.ImagePtr+=512*1024;
// now do the loop
while(VRAMWrite.ColsRemaining>0)
gdata=GETLE32(pMem); pMem++;
PUTLE16(VRAMWrite.ImagePtr, (unsigned short)gdata); VRAMWrite.ImagePtr++;
- if(VRAMWrite.ImagePtr>=psxVuw_eom) VRAMWrite.ImagePtr-=iGPUHeight*1024;
+ if(VRAMWrite.ImagePtr>=psxVuw_eom) VRAMWrite.ImagePtr-=512*1024;
VRAMWrite.RowsRemaining --;
if(VRAMWrite.RowsRemaining <= 0)
}
PUTLE16(VRAMWrite.ImagePtr, (unsigned short)(gdata>>16)); VRAMWrite.ImagePtr++;
- if(VRAMWrite.ImagePtr>=psxVuw_eom) VRAMWrite.ImagePtr-=iGPUHeight*1024;
+ if(VRAMWrite.ImagePtr>=psxVuw_eom) VRAMWrite.ImagePtr-=512*1024;
VRAMWrite.RowsRemaining --;
}
{
gpuDataC=gpuDataP=0;
primFunc[gpuCommand]((unsigned char *)gpuDataM);
- if(dwEmuFixes&0x0001 || dwActFixes&0x0400) // hack for emulating "gpu busy" in some games
- iFakePrimBusy=4;\r }
+ if(dwActFixes&0x0400) // hack for emulating "gpu busy" in some games
+ iFakePrimBusy=4;
+ }
}
}
GPUwriteDataMem(&gdata,1);
}
-////////////////////////////////////////////////////////////////////////
-// this functions will be removed soon (or 'soonish')... not really needed, but some emus want them
-////////////////////////////////////////////////////////////////////////
-
-void CALLBACK GPUsetMode(unsigned long gdata)
-{
-// Peops does nothing here...
-// DataWriteMode=(gdata&1)?DR_VRAMTRANSFER:DR_NORMAL;
-// DataReadMode =(gdata&2)?DR_VRAMTRANSFER:DR_NORMAL;
-}
-
-long CALLBACK GPUgetMode(void)
-{
- long iT=0;
-
- if(DataWriteMode==DR_VRAMTRANSFER) iT|=0x1;
- if(DataReadMode ==DR_VRAMTRANSFER) iT|=0x2;
- return iT;
-}
-
-////////////////////////////////////////////////////////////////////////
-// call config dlg
-////////////////////////////////////////////////////////////////////////
-
-long CALLBACK GPUconfigure(void)
-{
- SoftDlgProc();
-
- return 0;
-}
-
-////////////////////////////////////////////////////////////////////////
-// sets all kind of act fixes
-////////////////////////////////////////////////////////////////////////
-
-void SetFixes(void)
- {
- if(dwActFixes&0x02) sDispWidths[4]=384;
- else sDispWidths[4]=368;
- }
-
////////////////////////////////////////////////////////////////////////
// process gpu commands
////////////////////////////////////////////////////////////////////////
unsigned long lUsedAddr[3];
-__inline BOOL CheckForEndlessLoop(unsigned long laddr)
+static inline BOOL CheckForEndlessLoop(unsigned long laddr)
{
if(laddr==lUsedAddr[1]) return TRUE;
if(laddr==lUsedAddr[2]) return TRUE;
do
{
- if(iGPUHeight==512) addr&=0x1FFFFC;
+ addr&=0x1FFFFC;
if(DMACommandCounter++ > 2000000) break;
if(CheckForEndlessLoop(addr)) break;
return 0;
}
-////////////////////////////////////////////////////////////////////////
-// show about dlg
-////////////////////////////////////////////////////////////////////////
-
-
-void CALLBACK GPUabout(void) // ABOUT
-{
- AboutDlgProc();
- return;
-}
-
-////////////////////////////////////////////////////////////////////////
-// We are ever fine ;)
-////////////////////////////////////////////////////////////////////////
-
-long CALLBACK GPUtest(void)
-{
- // if test fails this function should return negative value for error (unable to continue)
- // and positive value for warning (can continue but output might be crappy)
- return 0;
-}
-
////////////////////////////////////////////////////////////////////////
// Freeze
////////////////////////////////////////////////////////////////////////
if(lSlotNum<0) return 0;
if(lSlotNum>8) return 0;
lSelectedSlot=lSlotNum+1;
- BuildDispMenu(0);
return 1;
}
//----------------------------------------------------//
{
pF->ulStatus=lGPUstatusRet;
memcpy(pF->ulControl,ulStatusControl,256*sizeof(uint32_t));
- memcpy(pF->psxVRam, psxVub, 1024*iGPUHeight*2);
+ memcpy(pF->psxVRam, psxVub, 1024*512*2);
return 1;
}
lGPUstatusRet=pF->ulStatus;
memcpy(ulStatusControl,pF->ulControl,256*sizeof(uint32_t));
- memcpy(psxVub, pF->psxVRam, 1024*iGPUHeight*2);
+ memcpy(psxVub, pF->psxVRam, 1024*512*2);
// RESET TEXTURE STORE HERE, IF YOU USE SOMETHING LIKE THAT
return 1;
}
-
-////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////
-////////////////////////////////////////////////////////////////////////
-
-////////////////////////////////////////////////////////////////////////
-// SAVE STATE DISPLAY STUFF
-////////////////////////////////////////////////////////////////////////
-
-// font 0-9, 24x20 pixels, 1 byte = 4 dots
-// 00 = black
-// 01 = white
-// 10 = red
-// 11 = transparent
-
-unsigned char cFont[10][120]=
-{
-// 0
-{0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,
- 0x80,0x00,0x00,0x00,0x00,0x00,
- 0x80,0x00,0x00,0x00,0x00,0x00,
- 0x80,0x00,0x00,0x00,0x00,0x00,
- 0x80,0x00,0x00,0x00,0x00,0x00,
- 0x80,0x00,0x05,0x54,0x00,0x00,
- 0x80,0x00,0x14,0x05,0x00,0x00,
- 0x80,0x00,0x14,0x05,0x00,0x00,
- 0x80,0x00,0x14,0x05,0x00,0x00,
- 0x80,0x00,0x14,0x05,0x00,0x00,
- 0x80,0x00,0x14,0x05,0x00,0x00,
- 0x80,0x00,0x14,0x05,0x00,0x00,
- 0x80,0x00,0x14,0x05,0x00,0x00,
- 0x80,0x00,0x14,0x05,0x00,0x00,
- 0x80,0x00,0x05,0x54,0x00,0x00,
- 0x80,0x00,0x00,0x00,0x00,0x00,
- 0x80,0x00,0x00,0x00,0x00,0x00,
- 0x80,0x00,0x00,0x00,0x00,0x00,
- 0x80,0x00,0x00,0x00,0x00,0x00,
- 0xaa,0xaa,0xaa,0xaa,0xaa,0xaa
-},
-// 1
-{0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,
- 0x80,0x00,0x00,0x00,0x00,0x00,
- 0x80,0x00,0x00,0x00,0x00,0x00,
- 0x80,0x00,0x00,0x00,0x00,0x00,
- 0x80,0x00,0x00,0x00,0x00,0x00,
- 0x80,0x00,0x00,0x50,0x00,0x00,
- 0x80,0x00,0x05,0x50,0x00,0x00,
- 0x80,0x00,0x00,0x50,0x00,0x00,
- 0x80,0x00,0x00,0x50,0x00,0x00,
- 0x80,0x00,0x00,0x50,0x00,0x00,
- 0x80,0x00,0x00,0x50,0x00,0x00,
- 0x80,0x00,0x00,0x50,0x00,0x00,
- 0x80,0x00,0x00,0x50,0x00,0x00,
- 0x80,0x00,0x00,0x50,0x00,0x00,
- 0x80,0x00,0x05,0x55,0x00,0x00,
- 0x80,0x00,0x00,0x00,0x00,0x00,
- 0x80,0x00,0x00,0x00,0x00,0x00,
- 0x80,0x00,0x00,0x00,0x00,0x00,
- 0x80,0x00,0x00,0x00,0x00,0x00,
- 0xaa,0xaa,0xaa,0xaa,0xaa,0xaa
-},
-// 2
-{0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,
- 0x80,0x00,0x00,0x00,0x00,0x00,
- 0x80,0x00,0x00,0x00,0x00,0x00,
- 0x80,0x00,0x00,0x00,0x00,0x00,
- 0x80,0x00,0x00,0x00,0x00,0x00,
- 0x80,0x00,0x05,0x54,0x00,0x00,
- 0x80,0x00,0x14,0x05,0x00,0x00,
- 0x80,0x00,0x00,0x05,0x00,0x00,
- 0x80,0x00,0x00,0x05,0x00,0x00,
- 0x80,0x00,0x00,0x14,0x00,0x00,
- 0x80,0x00,0x00,0x50,0x00,0x00,
- 0x80,0x00,0x01,0x40,0x00,0x00,
- 0x80,0x00,0x05,0x00,0x00,0x00,
- 0x80,0x00,0x14,0x00,0x00,0x00,
- 0x80,0x00,0x15,0x55,0x00,0x00,
- 0x80,0x00,0x00,0x00,0x00,0x00,
- 0x80,0x00,0x00,0x00,0x00,0x00,
- 0x80,0x00,0x00,0x00,0x00,0x00,
- 0x80,0x00,0x00,0x00,0x00,0x00,
- 0xaa,0xaa,0xaa,0xaa,0xaa,0xaa
-},
-// 3
-{0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,
- 0x80,0x00,0x00,0x00,0x00,0x00,
- 0x80,0x00,0x00,0x00,0x00,0x00,
- 0x80,0x00,0x00,0x00,0x00,0x00,
- 0x80,0x00,0x00,0x00,0x00,0x00,
- 0x80,0x00,0x05,0x54,0x00,0x00,
- 0x80,0x00,0x14,0x05,0x00,0x00,
- 0x80,0x00,0x00,0x05,0x00,0x00,
- 0x80,0x00,0x00,0x05,0x00,0x00,
- 0x80,0x00,0x01,0x54,0x00,0x00,
- 0x80,0x00,0x00,0x05,0x00,0x00,
- 0x80,0x00,0x00,0x05,0x00,0x00,
- 0x80,0x00,0x00,0x05,0x00,0x00,
- 0x80,0x00,0x14,0x05,0x00,0x00,
- 0x80,0x00,0x05,0x54,0x00,0x00,
- 0x80,0x00,0x00,0x00,0x00,0x00,
- 0x80,0x00,0x00,0x00,0x00,0x00,
- 0x80,0x00,0x00,0x00,0x00,0x00,
- 0x80,0x00,0x00,0x00,0x00,0x00,
- 0xaa,0xaa,0xaa,0xaa,0xaa,0xaa
-},
-// 4
-{0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,
- 0x80,0x00,0x00,0x00,0x00,0x00,
- 0x80,0x00,0x00,0x00,0x00,0x00,
- 0x80,0x00,0x00,0x00,0x00,0x00,
- 0x80,0x00,0x00,0x00,0x00,0x00,
- 0x80,0x00,0x00,0x14,0x00,0x00,
- 0x80,0x00,0x00,0x54,0x00,0x00,
- 0x80,0x00,0x01,0x54,0x00,0x00,
- 0x80,0x00,0x01,0x54,0x00,0x00,
- 0x80,0x00,0x05,0x14,0x00,0x00,
- 0x80,0x00,0x14,0x14,0x00,0x00,
- 0x80,0x00,0x15,0x55,0x00,0x00,
- 0x80,0x00,0x00,0x14,0x00,0x00,
- 0x80,0x00,0x00,0x14,0x00,0x00,
- 0x80,0x00,0x00,0x55,0x00,0x00,
- 0x80,0x00,0x00,0x00,0x00,0x00,
- 0x80,0x00,0x00,0x00,0x00,0x00,
- 0x80,0x00,0x00,0x00,0x00,0x00,
- 0x80,0x00,0x00,0x00,0x00,0x00,
- 0xaa,0xaa,0xaa,0xaa,0xaa,0xaa
-},
-// 5
-{0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,
- 0x80,0x00,0x00,0x00,0x00,0x00,
- 0x80,0x00,0x00,0x00,0x00,0x00,
- 0x80,0x00,0x00,0x00,0x00,0x00,
- 0x80,0x00,0x00,0x00,0x00,0x00,
- 0x80,0x00,0x15,0x55,0x00,0x00,
- 0x80,0x00,0x14,0x00,0x00,0x00,
- 0x80,0x00,0x14,0x00,0x00,0x00,
- 0x80,0x00,0x14,0x00,0x00,0x00,
- 0x80,0x00,0x15,0x54,0x00,0x00,
- 0x80,0x00,0x00,0x05,0x00,0x00,
- 0x80,0x00,0x00,0x05,0x00,0x00,
- 0x80,0x00,0x00,0x05,0x00,0x00,
- 0x80,0x00,0x14,0x05,0x00,0x00,
- 0x80,0x00,0x05,0x54,0x00,0x00,
- 0x80,0x00,0x00,0x00,0x00,0x00,
- 0x80,0x00,0x00,0x00,0x00,0x00,
- 0x80,0x00,0x00,0x00,0x00,0x00,
- 0x80,0x00,0x00,0x00,0x00,0x00,
- 0xaa,0xaa,0xaa,0xaa,0xaa,0xaa
-},
-// 6
-{0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,
- 0x80,0x00,0x00,0x00,0x00,0x00,
- 0x80,0x00,0x00,0x00,0x00,0x00,
- 0x80,0x00,0x00,0x00,0x00,0x00,
- 0x80,0x00,0x00,0x00,0x00,0x00,
- 0x80,0x00,0x01,0x54,0x00,0x00,
- 0x80,0x00,0x05,0x00,0x00,0x00,
- 0x80,0x00,0x14,0x00,0x00,0x00,
- 0x80,0x00,0x14,0x00,0x00,0x00,
- 0x80,0x00,0x15,0x54,0x00,0x00,
- 0x80,0x00,0x15,0x05,0x00,0x00,
- 0x80,0x00,0x14,0x05,0x00,0x00,
- 0x80,0x00,0x14,0x05,0x00,0x00,
- 0x80,0x00,0x14,0x05,0x00,0x00,
- 0x80,0x00,0x05,0x54,0x00,0x00,
- 0x80,0x00,0x00,0x00,0x00,0x00,
- 0x80,0x00,0x00,0x00,0x00,0x00,
- 0x80,0x00,0x00,0x00,0x00,0x00,
- 0x80,0x00,0x00,0x00,0x00,0x00,
- 0xaa,0xaa,0xaa,0xaa,0xaa,0xaa
-},
-// 7
-{0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,
- 0x80,0x00,0x00,0x00,0x00,0x00,
- 0x80,0x00,0x00,0x00,0x00,0x00,
- 0x80,0x00,0x00,0x00,0x00,0x00,
- 0x80,0x00,0x00,0x00,0x00,0x00,
- 0x80,0x00,0x15,0x55,0x00,0x00,
- 0x80,0x00,0x14,0x05,0x00,0x00,
- 0x80,0x00,0x00,0x14,0x00,0x00,
- 0x80,0x00,0x00,0x14,0x00,0x00,
- 0x80,0x00,0x00,0x50,0x00,0x00,
- 0x80,0x00,0x00,0x50,0x00,0x00,
- 0x80,0x00,0x01,0x40,0x00,0x00,
- 0x80,0x00,0x01,0x40,0x00,0x00,
- 0x80,0x00,0x05,0x00,0x00,0x00,
- 0x80,0x00,0x05,0x00,0x00,0x00,
- 0x80,0x00,0x00,0x00,0x00,0x00,
- 0x80,0x00,0x00,0x00,0x00,0x00,
- 0x80,0x00,0x00,0x00,0x00,0x00,
- 0x80,0x00,0x00,0x00,0x00,0x00,
- 0xaa,0xaa,0xaa,0xaa,0xaa,0xaa
-},
-// 8
-{0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,
- 0x80,0x00,0x00,0x00,0x00,0x00,
- 0x80,0x00,0x00,0x00,0x00,0x00,
- 0x80,0x00,0x00,0x00,0x00,0x00,
- 0x80,0x00,0x00,0x00,0x00,0x00,
- 0x80,0x00,0x05,0x54,0x00,0x00,
- 0x80,0x00,0x14,0x05,0x00,0x00,
- 0x80,0x00,0x14,0x05,0x00,0x00,
- 0x80,0x00,0x14,0x05,0x00,0x00,
- 0x80,0x00,0x05,0x54,0x00,0x00,
- 0x80,0x00,0x14,0x05,0x00,0x00,
- 0x80,0x00,0x14,0x05,0x00,0x00,
- 0x80,0x00,0x14,0x05,0x00,0x00,
- 0x80,0x00,0x14,0x05,0x00,0x00,
- 0x80,0x00,0x05,0x54,0x00,0x00,
- 0x80,0x00,0x00,0x00,0x00,0x00,
- 0x80,0x00,0x00,0x00,0x00,0x00,
- 0x80,0x00,0x00,0x00,0x00,0x00,
- 0x80,0x00,0x00,0x00,0x00,0x00,
- 0xaa,0xaa,0xaa,0xaa,0xaa,0xaa
-},
-// 9
-{0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,
- 0x80,0x00,0x00,0x00,0x00,0x00,
- 0x80,0x00,0x00,0x00,0x00,0x00,
- 0x80,0x00,0x00,0x00,0x00,0x00,
- 0x80,0x00,0x00,0x00,0x00,0x00,
- 0x80,0x00,0x05,0x54,0x00,0x00,
- 0x80,0x00,0x14,0x05,0x00,0x00,
- 0x80,0x00,0x14,0x05,0x00,0x00,
- 0x80,0x00,0x14,0x05,0x00,0x00,
- 0x80,0x00,0x14,0x15,0x00,0x00,
- 0x80,0x00,0x05,0x55,0x00,0x00,
- 0x80,0x00,0x00,0x05,0x00,0x00,
- 0x80,0x00,0x00,0x05,0x00,0x00,
- 0x80,0x00,0x00,0x14,0x00,0x00,
- 0x80,0x00,0x05,0x50,0x00,0x00,
- 0x80,0x00,0x00,0x00,0x00,0x00,
- 0x80,0x00,0x00,0x00,0x00,0x00,
- 0x80,0x00,0x00,0x00,0x00,0x00,
- 0x80,0x00,0x00,0x00,0x00,0x00,
- 0xaa,0xaa,0xaa,0xaa,0xaa,0xaa
-}
-};
-
-////////////////////////////////////////////////////////////////////////
-
-void PaintPicDot(unsigned char * p,unsigned char c)
-{
-
- if(c==0) {*p++=0x00;*p++=0x00;*p=0x00;return;} // black
- if(c==1) {*p++=0xff;*p++=0xff;*p=0xff;return;} // white
- if(c==2) {*p++=0x00;*p++=0x00;*p=0xff;return;} // red
- // transparent
-}
-
-////////////////////////////////////////////////////////////////////////
-// the main emu allocs 128x96x3 bytes, and passes a ptr
-// to it in pMem... the plugin has to fill it with
-// 8-8-8 bit BGR screen data (Win 24 bit BMP format
-// without header).
-// Beware: the func can be called at any time,
-// so you have to use the frontbuffer to get a fully
-// rendered picture
-
-// LINUX version:
-
-extern char * Xpixels;
-
-void GPUgetScreenPic(unsigned char * pMem)
-{
-/*
- unsigned short c;unsigned char * pf;int x,y;
-
- float XS=(float)iResX/128;
- float YS=(float)iResY/96;
-
- pf=pMem;
- memset(pMem, 0, 128*96*3);
-
- if(Xpixels)
- {
- unsigned char * ps=(unsigned char *)Xpixels;
- {
- long lPitch=iResX<<2;
- uint32_t sx;
-
- for(y=0;y<96;y++)
- {
- for(x=0;x<128;x++)
- {
- sx=*((uint32_t *)((ps)+
- (((int)((float)y*YS))*lPitch)+
- ((int)((float)x*XS))*4));
- *(pf+0)=(sx&0xff);
- *(pf+1)=(sx&0xff00)>>8;
- *(pf+2)=(sx&0xff0000)>>16;
- pf+=3;
- }
- }
- }
- }
-
-
- /////////////////////////////////////////////////////////////////////
- // generic number/border painter
-
- pf=pMem+(103*3); // offset to number rect
-
- for(y=0;y<20;y++) // loop the number rect pixel
- {
- for(x=0;x<6;x++)
- {
- c=cFont[lSelectedSlot][x+y*6]; // get 4 char dot infos at once (number depends on selected slot)
- PaintPicDot(pf,(c&0xc0)>>6);pf+=3; // paint the dots into the rect
- PaintPicDot(pf,(c&0x30)>>4);pf+=3;
- PaintPicDot(pf,(c&0x0c)>>2);pf+=3;
- PaintPicDot(pf,(c&0x03)); pf+=3;
- }
- pf+=104*3; // next rect y line
- }
-
- pf=pMem; // ptr to first pos in 128x96 pic
- for(x=0;x<128;x++) // loop top/bottom line
- {
- *(pf+(95*128*3))=0x00;*pf++=0x00;
- *(pf+(95*128*3))=0x00;*pf++=0x00; // paint it red
- *(pf+(95*128*3))=0xff;*pf++=0xff;
- }
- pf=pMem; // ptr to first pos
- for(y=0;y<96;y++) // loop left/right line
- {
- *(pf+(127*3))=0x00;*pf++=0x00;
- *(pf+(127*3))=0x00;*pf++=0x00; // paint it red
- *(pf+(127*3))=0xff;*pf++=0xff;
- pf+=127*3; // offset to next line
- }
-*/
-}
-
-
-////////////////////////////////////////////////////////////////////////
-// func will be called with 128x96x3 BGR data.
-// the plugin has to store the data and display
-// it in the upper right corner.
-// If the func is called with a NULL ptr, you can
-// release your picture data and stop displaying
-// the screen pic
-
-void CALLBACK GPUshowScreenPic(unsigned char * pMem)
-{
- DestroyPic(); // destroy old pic data
- if(pMem==0) return; // done
- CreatePic(pMem); // create new pic... don't free pMem or something like that... just read from it
-}
-
-void CALLBACK GPUsetfix(uint32_t dwFixBits)
-{
- dwEmuFixes=dwFixBits;
-}
* *
***************************************************************************/
-#ifndef _GPU_INTERNALS_H
-#define _GPU_INTERNALS_H
+#ifndef _PSX_GPU_
+#define _PSX_GPU_
+
+#define INFO_TW 0
+#define INFO_DRAWSTART 1
+#define INFO_DRAWEND 2
+#define INFO_DRAWOFF 3
+
+#define SHADETEXBIT(x) ((x>>24) & 0x1)
+#define SEMITRANSBIT(x) ((x>>25) & 0x1)
+#define PSXRGB(r,g,b) ((g<<10)|(b<<5)|r)
+
+#define DATAREGISTERMODES unsigned short
+
+#define DR_NORMAL 0
+#define DR_VRAMTRANSFER 1
+
+
+#define GPUSTATUS_ODDLINES 0x80000000
+#define GPUSTATUS_DMABITS 0x60000000 // Two bits
+#define GPUSTATUS_READYFORCOMMANDS 0x10000000
+#define GPUSTATUS_READYFORVRAM 0x08000000
+#define GPUSTATUS_IDLE 0x04000000
+#define GPUSTATUS_DISPLAYDISABLED 0x00800000
+#define GPUSTATUS_INTERLACED 0x00400000
+#define GPUSTATUS_RGB24 0x00200000
+#define GPUSTATUS_PAL 0x00100000
+#define GPUSTATUS_DOUBLEHEIGHT 0x00080000
+#define GPUSTATUS_WIDTHBITS 0x00070000 // Three bits
+#define GPUSTATUS_MASKENABLED 0x00001000
+#define GPUSTATUS_MASKDRAWN 0x00000800
+#define GPUSTATUS_DRAWINGALLOWED 0x00000400
+#define GPUSTATUS_DITHER 0x00000200
+
+#define GPUIsBusy (lGPUstatusRet &= ~GPUSTATUS_IDLE)
+#define GPUIsIdle (lGPUstatusRet |= GPUSTATUS_IDLE)
+
+#define GPUIsNotReadyForCommands (lGPUstatusRet &= ~GPUSTATUS_READYFORCOMMANDS)
+#define GPUIsReadyForCommands (lGPUstatusRet |= GPUSTATUS_READYFORCOMMANDS)
+
+#define CALLBACK
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/time.h>
+#include <math.h>
+#include <stdint.h>
+#include <unistd.h>
+
+/////////////////////////////////////////////////////////////////////////////
+
+// byteswappings
+
+#define SWAP16(x) ({ uint16_t y=(x); (((y)>>8 & 0xff) | ((y)<<8 & 0xff00)); })
+#define SWAP32(x) ({ uint32_t y=(x); (((y)>>24 & 0xfful) | ((y)>>8 & 0xff00ul) | ((y)<<8 & 0xff0000ul) | ((y)<<24 & 0xff000000ul)); })
+
+#ifdef __BIG_ENDIAN__
+
+// big endian config
+#define HOST2LE32(x) SWAP32(x)
+#define HOST2BE32(x) (x)
+#define LE2HOST32(x) SWAP32(x)
+#define BE2HOST32(x) (x)
+
+#define HOST2LE16(x) SWAP16(x)
+#define HOST2BE16(x) (x)
+#define LE2HOST16(x) SWAP16(x)
+#define BE2HOST16(x) (x)
+
+#else
+
+// little endian config
+#define HOST2LE32(x) (x)
+#define HOST2BE32(x) SWAP32(x)
+#define LE2HOST32(x) (x)
+#define BE2HOST32(x) SWAP32(x)
+
+#define HOST2LE16(x) (x)
+#define HOST2BE16(x) SWAP16(x)
+#define LE2HOST16(x) (x)
+#define BE2HOST16(x) SWAP16(x)
+
+#endif
+
+#define GETLEs16(X) ((int16_t)GETLE16((uint16_t *)X))
+#define GETLEs32(X) ((int16_t)GETLE32((uint16_t *)X))
+
+#define GETLE16(X) LE2HOST16(*(uint16_t *)X)
+#define GETLE32(X) LE2HOST32(*(uint32_t *)X)
+#define GETLE16D(X) ({uint32_t val = GETLE32(X); (val<<16 | val >> 16);})
+#define PUTLE16(X, Y) do{*((uint16_t *)X)=HOST2LE16((uint16_t)Y);}while(0)
+#define PUTLE32(X, Y) do{*((uint32_t *)X)=HOST2LE16((uint32_t)Y);}while(0)
+
+/////////////////////////////////////////////////////////////////////////////
+
+typedef struct VRAMLOADTTAG
+{
+ short x;
+ short y;
+ short Width;
+ short Height;
+ short RowsRemaining;
+ short ColsRemaining;
+ unsigned short *ImagePtr;
+} VRAMLoad_t;
+
+/////////////////////////////////////////////////////////////////////////////
+
+typedef struct PSXPOINTTAG
+{
+ int32_t x;
+ int32_t y;
+} PSXPoint_t;
+
+typedef struct PSXSPOINTTAG
+{
+ short x;
+ short y;
+} PSXSPoint_t;
+
+typedef struct PSXRECTTAG
+{
+ short x0;
+ short x1;
+ short y0;
+ short y1;
+} PSXRect_t;
+
+// linux defines for some windows stuff
+
+#define FALSE 0
+#define TRUE 1
+#define BOOL unsigned short
+#define LOWORD(l) ((unsigned short)(l))
+#define HIWORD(l) ((unsigned short)(((uint32_t)(l) >> 16) & 0xFFFF))
+#define max(a,b) (((a) > (b)) ? (a) : (b))
+#define min(a,b) (((a) < (b)) ? (a) : (b))
+#define DWORD uint32_t
+#ifndef __int64
+#define __int64 long long int
+#endif
+
+typedef struct RECTTAG
+{
+ int left;
+ int top;
+ int right;
+ int bottom;
+}RECT;
+
+/////////////////////////////////////////////////////////////////////////////
+
+typedef struct TWINTAG
+{
+ PSXRect_t Position;
+} TWin_t;
+
+/////////////////////////////////////////////////////////////////////////////
+
+typedef struct PSXDISPLAYTAG
+{
+ PSXPoint_t DisplayModeNew;
+ PSXPoint_t DisplayMode;
+ PSXPoint_t DisplayPosition;
+ PSXPoint_t DisplayEnd;
+
+ int32_t Double;
+ int32_t Height;
+ int32_t PAL;
+ int32_t InterlacedNew;
+ int32_t Interlaced;
+ int32_t RGB24New;
+ int32_t RGB24;
+ PSXSPoint_t DrawOffset;
+ int32_t Disabled;
+ PSXRect_t Range;
+
+} PSXDisplay_t;
+
+/////////////////////////////////////////////////////////////////////////////
+
+// draw.c
+
+extern int32_t GlobalTextAddrX,GlobalTextAddrY,GlobalTextTP;
+extern int32_t GlobalTextREST,GlobalTextABR,GlobalTextPAGE;
+extern short ly0,lx0,ly1,lx1,ly2,lx2,ly3,lx3;
+extern long lLowerpart;
+extern BOOL bCheckMask;
+extern unsigned short sSetMask;
+extern unsigned long lSetMask;
+extern short g_m1;
+extern short g_m2;
+extern short g_m3;
+extern short DrawSemiTrans;
+
+// prim.c
+
+extern BOOL bUsingTWin;
+extern TWin_t TWin;
+extern void (*primTableJ[256])(unsigned char *);
+extern void (*primTableSkip[256])(unsigned char *);
+extern unsigned short usMirror;
+extern int iDither;
+extern uint32_t dwCfgFixes;
+extern uint32_t dwActFixes;
+extern int iUseFixes;
+extern int iUseDither;
+extern BOOL bDoVSyncUpdate;
+extern int32_t drawX;
+extern int32_t drawY;
+extern int32_t drawW;
+extern int32_t drawH;
+
+// gpu.h
#define OPAQUEON 10
#define OPAQUEOFF 11
#define KEY_RESETDITHER 8
#define KEY_RESETFILTER 16
#define KEY_RESETADVBLEND 32
-//#define KEY_BLACKWHITE 64
#define KEY_BADTEXTURES 128
#define KEY_CHECKTHISOUT 256
#define COLOR(x) SWAP32(x & 0xffffff)
#endif
-/////////////////////////////////////////////////////////////////////////////
+// gpu.c
-void updateDisplay(void);
-void SetAutoFrameCap(void);
-void SetFixes(void);
+extern VRAMLoad_t VRAMWrite;
+extern VRAMLoad_t VRAMRead;
+extern DATAREGISTERMODES DataWriteMode;
+extern DATAREGISTERMODES DataReadMode;
+extern short sDispWidths[];
+extern BOOL bDebugText;
+extern PSXDisplay_t PSXDisplay;
+extern PSXDisplay_t PreviousPSXDisplay;
+extern BOOL bSkipNextFrame;
+extern long lGPUstatusRet;
+extern unsigned char * psxVSecure;
+extern unsigned char * psxVub;
+extern signed char * psxVsb;
+extern unsigned short * psxVuw;
+extern signed short * psxVsw;
+extern uint32_t * psxVul;
+extern int32_t * psxVsl;
+extern unsigned short * psxVuw_eom;
+extern BOOL bChangeWinMode;
+extern long lSelectedSlot;
+extern BOOL bInitCap;
+extern DWORD dwLaceCnt;
+extern uint32_t lGPUInfoVals[];
+extern uint32_t ulStatusControl[];
-/////////////////////////////////////////////////////////////////////////////
+// fps.c
+
+extern int UseFrameLimit;
+extern int UseFrameSkip;
+extern float fFrameRate;
+extern int iFrameLimit;
+extern float fFrameRateHz;
+extern float fps_skip;
+extern float fps_cur;
-#endif // _GPU_INTERNALS_H
+// draw.c
+
+void DoBufferSwap(void);
+void DoClearScreenBuffer(void);
+void DoClearFrontBuffer(void);
+unsigned long ulInitDisplay(void);
+void CloseDisplay(void);
+
+#endif
+++ /dev/null
-#include <gtk/gtk.h>
-#include <glade/glade.h>
-
-#include "config.h"
-
-#ifdef ENABLE_NLS
-#include <libintl.h>
-#include <locale.h>
-#endif
-
-#include <unistd.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/stat.h>
-
-void SaveConfig(GtkWidget *widget, gpointer user_datal);
-
-#define READBINARY "rb"
-#define WRITEBINARY "wb"
-#define CONFIG_FILENAME "dfxvideo.cfg"
-
-enum {
- VIDMODE_320x200 = 0,
- VIDMODE_640x480,
- VIDMODE_800x600,
- VIDMODE_1024x768,
- VIDMODE_1152x864,
- VIDMODE_1280x1024,
- VIDMODE_1600x1200
-}; /* Video_modes */
-
-/*ADB static GtkWidget * wndMain=0;*/
-
-/* This function checks for the value being outside the accepted range,
- and returns the appropriate boundary value */
-int set_limit (char *p, int len, int lower, int upper)
-{
- int val = 0;
-
- if (p)
- val = atoi(p + len);
- /* printf("Checking for val %d greater than %d and lower than %d, ", val, lower, upper);*/
- if (val < lower)
- val = lower;
- if (val > upper)
- val = upper;
- /* printf ("val is now %d\n", val);*/
- return val;
-}
-
-void on_about_clicked(GtkWidget *widget, gpointer user_data)
-{
- gtk_widget_destroy (widget);
- exit (0);
-}
-
-void set_widget_sensitive(GtkWidget *widget, gpointer user_data)
-{
- gtk_widget_set_sensitive (widget, (int)user_data);
-}
-
-void on_fullscreen_toggled(GtkWidget *widget, gpointer user_data)
-{
- GtkWidget *check, *resCombo2;
- GladeXML *xml;
- xml = (GladeXML*) user_data;
-
- check = glade_xml_get_widget(xml, "checkFullscreen");
- resCombo2 = glade_xml_get_widget(xml, "resCombo2");
-
- set_widget_sensitive(resCombo2, !gtk_toggle_button_get_active(check));
-}
-
-void on_use_fixes_toggled(GtkWidget *widget, gpointer user_data)
-{
- GtkWidget *check, *table_fixes;
- GladeXML *xml;
- xml = (GladeXML*) user_data;
- check = glade_xml_get_widget (xml, "checkUseFixes");
-
- table_fixes = glade_xml_get_widget (xml, "table_fixes");
-
- /* Set the state of each of the fixes to the value of the use fixes toggle */
- gtk_container_foreach (GTK_CONTAINER (table_fixes), (GtkCallback) set_widget_sensitive,
- (void *)gtk_toggle_button_get_active (check));
-}
-
-void on_fps_toggled(GtkWidget *widget, gpointer user_data)
-{
- GtkWidget *checkSetFPS, *checkAutoFPSLimit, *entryFPS;
- GladeXML *xml;
-
- xml = (GladeXML*) user_data;
- checkSetFPS = glade_xml_get_widget(xml, "checkSetFPS");
- checkAutoFPSLimit = glade_xml_get_widget(xml, "checkAutoFPSLimit");
- entryFPS = glade_xml_get_widget(xml, "entryFPS");
-
- set_widget_sensitive(entryFPS,
- gtk_toggle_button_get_active(checkSetFPS) && !gtk_toggle_button_get_active(checkAutoFPSLimit));
- set_widget_sensitive(checkAutoFPSLimit, gtk_toggle_button_get_active(checkSetFPS));
-}
-
-void OnConfigClose(GtkWidget *widget, gpointer user_data)
-{
- GladeXML *xml = (GladeXML *)user_data;
-
- gtk_widget_destroy(glade_xml_get_widget(xml, "CfgWnd"));
- gtk_exit(0);
-}
-
-int
-main (int argc, char *argv[])
-{
- GtkWidget *CfgWnd, *widget;
- GladeXML *xml;
- FILE *in;char t[256];int len,val;
- float valf;
- char * pB, * p;
- char cfg[255];
- int i;
- char tempstr[50];
-
-#ifdef ENABLE_NLS
- setlocale (LC_ALL, "");
- bindtextdomain (GETTEXT_PACKAGE, LOCALE_DIR);
- bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
- textdomain (GETTEXT_PACKAGE);
-#endif
-
- if (argc!=2) {
- printf("Usage: cfgDFXVideo {ABOUT | CFG}\n");
- return 0;
- }
- if(strcmp(argv[1],"CFG")!=0 && strcmp(argv[1],"ABOUT")!=0) {
- printf("Usage: cfgDFXVideo {ABOUT | CFG}\n");
- return 0;
- }
-
- gtk_set_locale ();
- gtk_init (&argc, &argv);
-
-
- if (strcmp(argv[1], "ABOUT") == 0) {
- const char *authors[]= {"Pete Bernert and the P.E.Op.S. team", "Ryan Schultz", "Andrew Burton", NULL};
- widget = gtk_about_dialog_new ();
- gtk_about_dialog_set_name (GTK_ABOUT_DIALOG (widget), "P.E.Op.S PCSX Video Plugin");
- gtk_about_dialog_set_version (GTK_ABOUT_DIALOG (widget), "1.17");
- gtk_about_dialog_set_authors (GTK_ABOUT_DIALOG (widget), authors);
- gtk_about_dialog_set_website (GTK_ABOUT_DIALOG (widget), "http://pcsx-df.sourceforge.net/");
-
- g_signal_connect_data(GTK_OBJECT(widget), "response",
- GTK_SIGNAL_FUNC(on_about_clicked), NULL, NULL, G_CONNECT_AFTER);
-
- gtk_widget_show (widget);
- gtk_main();
-
- return 0;
- }
-
- xml = glade_xml_new(DATADIR "dfxvideo.glade2", "CfgWnd", NULL);
- if (!xml) {
- g_warning("We could not load the interface!");
- return -1;
- }
-
- /*ADB wndMain = glade_xml_get_widget(xml, "CfgWnd");*/
-
- strcpy(cfg, CONFIG_FILENAME);
-
- in = fopen(cfg,READBINARY);
- /* ADB TODO This is bad - asking for problems; need to read in line by line */
- if(in)
- {
- pB=(char *)malloc(32767);
- memset(pB,0,32767);
- len = fread(pB, 1, 32767, in);
- fclose(in);
- }
- else{ pB=0;printf("Couldn't find config file %s\n", cfg);}
-/* ADB TODO Parse this like we parse the config file in PCSX - use common functions! */
- val=1;
- if(pB)
- {
- strcpy(t,"\nResX");p=strstr(pB,t);if(p) {p=strstr(p,"=");len=1;}
- val = set_limit (p, len, 0, 1600);
- }
-
- if (val == 1600) val = VIDMODE_1600x1200;
- else if (val == 1280) val = VIDMODE_1280x1024;
- else if (val == 1152) val = VIDMODE_1152x864;
- else if (val == 1024) val = VIDMODE_1024x768;
- else if (val == 800) val = VIDMODE_800x600;
- else if (val == 640) val = VIDMODE_640x480;
- else if (val == 320) val = VIDMODE_320x200;
-
- gtk_combo_box_set_active(GTK_COMBO_BOX (glade_xml_get_widget(xml, "resCombo2")), val);
-
- val=0;
- if(pB)
- {
- strcpy(t,"\nNoStretch");p=strstr(pB,t);if(p) {p=strstr(p,"=");len=1;}
-
- val = set_limit (p, len, 0, 9);
- }
-
- gtk_combo_box_set_active(GTK_COMBO_BOX (glade_xml_get_widget(xml, "stretchCombo2")), val);
-
- val=0;
- if(pB)
- {
- strcpy(t,"\nDithering");p=strstr(pB,t);if(p) {p=strstr(p,"=");len=1;}
-
- val = set_limit (p, len, 0, 2);
- }
-
- gtk_combo_box_set_active(GTK_COMBO_BOX (glade_xml_get_widget(xml, "ditherCombo2")), val);
-
- val=0;
- if(pB)
- {
- strcpy(t,"\nMaintain43");p=strstr(pB,t);if(p) {p=strstr(p,"=");len=1;}
-
- val = set_limit (p, len, 0, 1);
- }
-
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON (glade_xml_get_widget(xml, "maintain43")), val);
-
- val=0; //ADB Leave - these are default values
- if(pB)
- {
- strcpy(t,"\nFullScreen");p=strstr(pB,t);if(p) {p=strstr(p,"=");len=1;}
-
- val = set_limit (p, len, 0, 1);
- }
-
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON (glade_xml_get_widget(xml, "checkFullscreen")), val);
-
- val=0;
- if(pB)
- {
- strcpy(t,"\nShowFPS");p=strstr(pB,t);if(p) {p=strstr(p,"=");len=1;}
-
- val = set_limit (p, len, 0, 1);
- }
-
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON (glade_xml_get_widget(xml, "checkShowFPS")), val);
-
- val=1;
- if(pB)
- {
- strcpy(t,"\nUseFrameLimit");p=strstr(pB,t);if(p) {p=strstr(p,"=");len=1;}
-
- val = set_limit (p, len, 0, 1);
- }
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON (glade_xml_get_widget(xml, "checkSetFPS")), val);
-
- val=0;
- if(pB)
- {
- strcpy(t,"\nFPSDetection");p=strstr(pB,t);if(p) {p=strstr(p,"=");len=1;}
-
- val = set_limit (p, len, 1, 2);
- }
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON (glade_xml_get_widget(xml, "checkAutoFPSLimit")), (val-1));
-
- val=0;
- if(pB)
- {
- strcpy(t,"\nUseFrameSkip");p=strstr(pB,t);if(p) {p=strstr(p,"=");len=1;}
- val = set_limit (p, len, 0, 1);
- }
-
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON (glade_xml_get_widget(xml, "checkFrameSkip")), val);
-
- valf=200;
- if(pB)
- {
- strcpy(t,"\nFrameRate");p=strstr(pB,t);if(p) {p=strstr(p,"=");len=1;}
- if(p) valf=(float)atoi(p+len) / 10;
- if(valf<1) valf=1;
- if(valf>500) valf=500;
- }
- sprintf(tempstr,"%.1f",valf);
- gtk_entry_set_text(glade_xml_get_widget(xml, "entryFPS"),tempstr);
-
- val=0;
- if(pB)
- {
- strcpy(t,"\nUseFixes");p=strstr(pB,t);if(p) {p=strstr(p,"=");len=1;}
-
- val = set_limit (p, len, 0, 1);
- }
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON (glade_xml_get_widget(xml, "checkUseFixes")), val);
-
-
- if(pB)
- {
- strcpy(t,"\nCfgFixes");p=strstr(pB,t);if(p) {p=strstr(p,"=");len=1;}
- if (p)
- val = atoi(p + len);
- }
-
- for (i=0; i<11; i++)
- {
- sprintf(tempstr, "checkFix%d", i+1);
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (glade_xml_get_widget (xml, tempstr)), (val>>i)&1 );
- }
-
-
- if(pB) free(pB);
-
- widget = glade_xml_get_widget(xml, "CfgWnd");
- g_signal_connect_data(GTK_OBJECT(widget), "destroy",
- GTK_SIGNAL_FUNC(SaveConfig), xml, NULL, 0);
-
- widget = glade_xml_get_widget(xml, "btn_close");
- g_signal_connect_data(GTK_OBJECT(widget), "clicked",
- GTK_SIGNAL_FUNC(OnConfigClose), xml, NULL, G_CONNECT_AFTER);
-
- widget = glade_xml_get_widget(xml, "checkFullscreen");
- g_signal_connect_data(GTK_OBJECT(widget), "clicked",
- GTK_SIGNAL_FUNC(on_fullscreen_toggled), xml, NULL, G_CONNECT_AFTER);
-
- widget = glade_xml_get_widget(xml, "checkUseFixes");
- g_signal_connect_data(GTK_OBJECT(widget), "clicked",
- GTK_SIGNAL_FUNC(on_use_fixes_toggled), xml, NULL, G_CONNECT_AFTER);
-
- widget = glade_xml_get_widget(xml, "checkSetFPS");
- g_signal_connect_data(GTK_OBJECT(widget), "clicked",
- GTK_SIGNAL_FUNC(on_fps_toggled), xml, NULL, G_CONNECT_AFTER);
-
- widget = glade_xml_get_widget(xml, "checkAutoFPSLimit");
- g_signal_connect_data(GTK_OBJECT(widget), "clicked",
- GTK_SIGNAL_FUNC(on_fps_toggled), xml, NULL, G_CONNECT_AFTER);
-
- on_fullscreen_toggled(widget, (gpointer) xml);
- on_fps_toggled(widget, (gpointer) xml);
- on_use_fixes_toggled(widget, (gpointer) xml);
-
- gtk_main ();
- return 0;
-}
-
-
-void SetCfgVal(char * pB,char * pE,int val)
-{
- char * p, *ps, *pC;char t[32];
-
- sprintf(t,"%d",val);
-
- p=strstr(pB,pE);
- if(p)
- {
- p=strstr(p,"=");
- if(!p) return;
- p++;
- while(*p && *p!='\n' && (*p<'0' || *p>'9')) p++;
- if(*p==0 || *p=='\n') return;
- ps=p;
- while(*p>='0' && *p<='9') p++;
- pC=(char *)malloc(32767);
- strcpy(pC,p);
- strcpy(ps,t);
- strcat(pB,pC);
- free(pC);
- }
- else
- {
- strcat(pB,pE);
- strcat(pB," = ");
- strcat(pB,t);
- strcat(pB,"\n");
- }
-}
-
-void SaveConfig(GtkWidget *widget, gpointer user_data)
-{
- FILE *in;int len,val;char * pB;
- GladeXML *xml;
- char cfg[255];
- char tempstr[50];
- int i;
- struct stat buf;
-
- pB=(char *)malloc(32767);
- memset(pB,0,32767);
-
- strcpy(cfg, CONFIG_FILENAME);
-
- /* ADB TODO Why do we read this in just to replace it again? */
- in = fopen(cfg,READBINARY);
- if(in)
- {
- len = fread(pB, 1, 32767, in);
- fclose(in);
- }
- xml = (GladeXML*) user_data;
-
- val = gtk_combo_box_get_active (GTK_COMBO_BOX (glade_xml_get_widget (xml, "resCombo2")));
-
- if (val == VIDMODE_320x200) { SetCfgVal(pB,"\nResX",320); SetCfgVal(pB,"\nResY",240); }
- else if (val == VIDMODE_640x480) { SetCfgVal(pB,"\nResX",640); SetCfgVal(pB,"\nResY",480); }
- else if (val == VIDMODE_800x600) { SetCfgVal(pB,"\nResX",800); SetCfgVal(pB,"\nResY",600); }
- else if (val == VIDMODE_1024x768) { SetCfgVal(pB,"\nResX",1024); SetCfgVal(pB,"\nResY",768); }
- else if (val == VIDMODE_1152x864) { SetCfgVal(pB,"\nResX",1152); SetCfgVal(pB,"\nResY",864); }
- else if (val == VIDMODE_1280x1024) { SetCfgVal(pB,"\nResX",1280); SetCfgVal(pB,"\nResY",1024); }
- else if (val == VIDMODE_1600x1200) { SetCfgVal(pB,"\nResX",1600); SetCfgVal(pB,"\nResY",1200); }
-
- val = gtk_combo_box_get_active (GTK_COMBO_BOX (glade_xml_get_widget (xml, "stretchCombo2")));
- SetCfgVal(pB,"\nNoStretch",val);
-
- val = gtk_combo_box_get_active (GTK_COMBO_BOX (glade_xml_get_widget (xml, "ditherCombo2")));
- SetCfgVal(pB,"\nDithering",val);
-
- val = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (glade_xml_get_widget (xml, "maintain43")));
- SetCfgVal(pB,"\nMaintain43",val);
-
- val = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (glade_xml_get_widget (xml, "checkFullscreen")));
- SetCfgVal(pB,"\nFullScreen",val);
-
- val = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (glade_xml_get_widget (xml, "checkShowFPS")));
- SetCfgVal(pB,"\nShowFPS",val);
-
- val = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (glade_xml_get_widget (xml, "checkSetFPS")));
- SetCfgVal(pB,"\nUseFrameLimit",val);
-
- val = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (glade_xml_get_widget (xml, "checkAutoFPSLimit")));
- SetCfgVal(pB,"\nFPSDetection",val+1);
-
- val = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (glade_xml_get_widget (xml, "checkFrameSkip")));
- SetCfgVal(pB,"\nUseFrameSkip",val);
-
- //Framerate stored *10
- val = atof(gtk_entry_get_text(glade_xml_get_widget(xml, "entryFPS"))) * 10;
- SetCfgVal(pB,"\nFrameRate",val);
-
- val = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (glade_xml_get_widget (xml, "checkUseFixes")));
- SetCfgVal(pB,"\nUseFixes",val);
-
-
- val = 0;
- for (i=0; i<11; i++)
- {
- sprintf(tempstr, "checkFix%d", i+1);
- if( gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (glade_xml_get_widget (xml, tempstr))) )
- val |= 1 << i;
- }
-
- SetCfgVal(pB,"\nCfgFixes",val);
-
-
-
- if((in=fopen(cfg, WRITEBINARY))!=NULL)
- {
- fwrite(pB,strlen(pB),1,in);
- fclose(in);
- }
-
- free(pB);
-
- // Close the window and exit control from the plugin
- gtk_exit (0);
-}
+++ /dev/null
-#define P0 dst0[0]
-#define P1 dst0[1]
-#define P2 dst1[0]
-#define P3 dst1[1]
-#define MUR interp_32_diff(c[1], c[5])
-#define MDR interp_32_diff(c[5], c[7])
-#define MDL interp_32_diff(c[7], c[3])
-#define MUL interp_32_diff(c[3], c[1])
-#define IC(p0) c[p0]
-#define I11(p0,p1) interp_32_11(c[p0], c[p1])
-#define I211(p0,p1,p2) interp_32_211(c[p0], c[p1], c[p2])
-#define I31(p0,p1) interp_32_31(c[p0], c[p1])
-#define I332(p0,p1,p2) interp_32_332(c[p0], c[p1], c[p2])
-#define I431(p0,p1,p2) interp_32_431(c[p0], c[p1], c[p2])
-#define I521(p0,p1,p2) interp_32_521(c[p0], c[p1], c[p2])
-#define I53(p0,p1) interp_32_53(c[p0], c[p1])
-#define I611(p0,p1,p2) interp_32_611(c[p0], c[p1], c[p2])
-#define I71(p0,p1) interp_32_71(c[p0], c[p1])
-#define I772(p0,p1,p2) interp_32_772(c[p0], c[p1], c[p2])
-#define I97(p0,p1) interp_32_97(c[p0], c[p1])
-#define I1411(p0,p1,p2) interp_32_1411(c[p0], c[p1], c[p2])
-#define I151(p0,p1) interp_32_151(c[p0], c[p1])
-
-case 0 :
-case 1 :
-case 4 :
-case 5 :
-case 32 :
-case 33 :
-case 36 :
-case 37 :
-case 128 :
-case 129 :
-case 132 :
-case 133 :
-case 160 :
-case 161 :
-case 164 :
-case 165 :
-{
- P0 = I211(4, 1, 3);
- P1 = I211(4, 1, 5);
- P2 = I211(4, 3, 7);
- P3 = I211(4, 5, 7);
-} break;
-case 2 :
-case 34 :
-case 130 :
-case 162 :
-{
- P0 = I31(4, 0);
- P1 = I31(4, 2);
- P2 = I211(4, 3, 7);
- P3 = I211(4, 5, 7);
-} break;
-case 3 :
-case 35 :
-case 131 :
-case 163 :
-{
- P0 = I31(4, 3);
- P1 = I31(4, 2);
- P2 = I211(4, 3, 7);
- P3 = I211(4, 5, 7);
-} break;
-case 6 :
-case 38 :
-case 134 :
-case 166 :
-{
- P0 = I31(4, 0);
- P1 = I31(4, 5);
- P2 = I211(4, 3, 7);
- P3 = I211(4, 5, 7);
-} break;
-case 7 :
-case 39 :
-case 135 :
-case 167 :
-{
- P0 = I31(4, 3);
- P1 = I31(4, 5);
- P2 = I211(4, 3, 7);
- P3 = I211(4, 5, 7);
-} break;
-case 8 :
-case 12 :
-case 136 :
-case 140 :
-{
- P0 = I31(4, 0);
- P1 = I211(4, 1, 5);
- P2 = I31(4, 6);
- P3 = I211(4, 5, 7);
-} break;
-case 9 :
-case 13 :
-case 137 :
-case 141 :
-{
- P0 = I31(4, 1);
- P1 = I211(4, 1, 5);
- P2 = I31(4, 6);
- P3 = I211(4, 5, 7);
-} break;
-case 10 :
-case 138 :
-{
- P1 = I31(4, 2);
- P2 = I31(4, 6);
- P3 = I211(4, 5, 7);
- if (MUL) {
- P0 = I31(4, 0);
- } else {
- P0 = I211(4, 1, 3);
- }
-} break;
-case 11 :
-case 139 :
-{
- P1 = I31(4, 2);
- P2 = I31(4, 6);
- P3 = I211(4, 5, 7);
- if (MUL) {
- P0 = IC(4);
- } else {
- P0 = I211(4, 1, 3);
- }
-} break;
-case 14 :
-case 142 :
-{
- P2 = I31(4, 6);
- P3 = I211(4, 5, 7);
- if (MUL) {
- P0 = I31(4, 0);
- P1 = I31(4, 5);
- } else {
- P0 = I332(1, 3, 4);
- P1 = I521(4, 1, 5);
- }
-} break;
-case 15 :
-case 143 :
-{
- P2 = I31(4, 6);
- P3 = I211(4, 5, 7);
- if (MUL) {
- P0 = IC(4);
- P1 = I31(4, 5);
- } else {
- P0 = I332(1, 3, 4);
- P1 = I521(4, 1, 5);
- }
-} break;
-case 16 :
-case 17 :
-case 48 :
-case 49 :
-{
- P0 = I211(4, 1, 3);
- P1 = I31(4, 2);
- P2 = I211(4, 3, 7);
- P3 = I31(4, 8);
-} break;
-case 18 :
-case 50 :
-{
- P0 = I31(4, 0);
- P2 = I211(4, 3, 7);
- P3 = I31(4, 8);
- if (MUR) {
- P1 = I31(4, 2);
- } else {
- P1 = I211(4, 1, 5);
- }
-} break;
-case 19 :
-case 51 :
-{
- P2 = I211(4, 3, 7);
- P3 = I31(4, 8);
- if (MUR) {
- P0 = I31(4, 3);
- P1 = I31(4, 2);
- } else {
- P0 = I521(4, 1, 3);
- P1 = I332(1, 5, 4);
- }
-} break;
-case 20 :
-case 21 :
-case 52 :
-case 53 :
-{
- P0 = I211(4, 1, 3);
- P1 = I31(4, 1);
- P2 = I211(4, 3, 7);
- P3 = I31(4, 8);
-} break;
-case 22 :
-case 54 :
-{
- P0 = I31(4, 0);
- P2 = I211(4, 3, 7);
- P3 = I31(4, 8);
- if (MUR) {
- P1 = IC(4);
- } else {
- P1 = I211(4, 1, 5);
- }
-} break;
-case 23 :
-case 55 :
-{
- P2 = I211(4, 3, 7);
- P3 = I31(4, 8);
- if (MUR) {
- P0 = I31(4, 3);
- P1 = IC(4);
- } else {
- P0 = I521(4, 1, 3);
- P1 = I332(1, 5, 4);
- }
-} break;
-case 24 :
-case 66 :
-{
- P0 = I31(4, 0);
- P1 = I31(4, 2);
- P2 = I31(4, 6);
- P3 = I31(4, 8);
-} break;
-case 25 :
-{
- P0 = I31(4, 1);
- P1 = I31(4, 2);
- P2 = I31(4, 6);
- P3 = I31(4, 8);
-} break;
-case 26 :
-case 31 :
-case 95 :
-{
- P2 = I31(4, 6);
- P3 = I31(4, 8);
- if (MUL) {
- P0 = IC(4);
- } else {
- P0 = I211(4, 1, 3);
- }
- if (MUR) {
- P1 = IC(4);
- } else {
- P1 = I211(4, 1, 5);
- }
-} break;
-case 27 :
-case 75 :
-{
- P1 = I31(4, 2);
- P2 = I31(4, 6);
- P3 = I31(4, 8);
- if (MUL) {
- P0 = IC(4);
- } else {
- P0 = I211(4, 1, 3);
- }
-} break;
-case 28 :
-{
- P0 = I31(4, 0);
- P1 = I31(4, 1);
- P2 = I31(4, 6);
- P3 = I31(4, 8);
-} break;
-case 29 :
-{
- P0 = I31(4, 1);
- P1 = I31(4, 1);
- P2 = I31(4, 6);
- P3 = I31(4, 8);
-} break;
-case 30 :
-case 86 :
-{
- P0 = I31(4, 0);
- P2 = I31(4, 6);
- P3 = I31(4, 8);
- if (MUR) {
- P1 = IC(4);
- } else {
- P1 = I211(4, 1, 5);
- }
-} break;
-case 40 :
-case 44 :
-case 168 :
-case 172 :
-{
- P0 = I31(4, 0);
- P1 = I211(4, 1, 5);
- P2 = I31(4, 7);
- P3 = I211(4, 5, 7);
-} break;
-case 41 :
-case 45 :
-case 169 :
-case 173 :
-{
- P0 = I31(4, 1);
- P1 = I211(4, 1, 5);
- P2 = I31(4, 7);
- P3 = I211(4, 5, 7);
-} break;
-case 42 :
-case 170 :
-{
- P1 = I31(4, 2);
- P3 = I211(4, 5, 7);
- if (MUL) {
- P0 = I31(4, 0);
- P2 = I31(4, 7);
- } else {
- P0 = I332(1, 3, 4);
- P2 = I521(4, 3, 7);
- }
-} break;
-case 43 :
-case 171 :
-{
- P1 = I31(4, 2);
- P3 = I211(4, 5, 7);
- if (MUL) {
- P0 = IC(4);
- P2 = I31(4, 7);
- } else {
- P0 = I332(1, 3, 4);
- P2 = I521(4, 3, 7);
- }
-} break;
-case 46 :
-case 174 :
-{
- P1 = I31(4, 5);
- P2 = I31(4, 7);
- P3 = I211(4, 5, 7);
- if (MUL) {
- P0 = I31(4, 0);
- } else {
- P0 = I611(4, 1, 3);
- }
-} break;
-case 47 :
-case 175 :
-{
- P1 = I31(4, 5);
- P2 = I31(4, 7);
- P3 = I211(4, 5, 7);
- if (MUL) {
- P0 = IC(4);
- } else {
- P0 = I1411(4, 1, 3);
- }
-} break;
-case 56 :
-{
- P0 = I31(4, 0);
- P1 = I31(4, 2);
- P2 = I31(4, 7);
- P3 = I31(4, 8);
-} break;
-case 57 :
-{
- P0 = I31(4, 1);
- P1 = I31(4, 2);
- P2 = I31(4, 7);
- P3 = I31(4, 8);
-} break;
-case 58 :
-{
- P2 = I31(4, 7);
- P3 = I31(4, 8);
- if (MUL) {
- P0 = I31(4, 0);
- } else {
- P0 = I611(4, 1, 3);
- }
- if (MUR) {
- P1 = I31(4, 2);
- } else {
- P1 = I611(4, 1, 5);
- }
-} break;
-case 59 :
-{
- P2 = I31(4, 7);
- P3 = I31(4, 8);
- if (MUL) {
- P0 = IC(4);
- } else {
- P0 = I211(4, 1, 3);
- }
- if (MUR) {
- P1 = I31(4, 2);
- } else {
- P1 = I611(4, 1, 5);
- }
-} break;
-case 60 :
-{
- P0 = I31(4, 0);
- P1 = I31(4, 1);
- P2 = I31(4, 7);
- P3 = I31(4, 8);
-} break;
-case 61 :
-{
- P0 = I31(4, 1);
- P1 = I31(4, 1);
- P2 = I31(4, 7);
- P3 = I31(4, 8);
-} break;
-case 62 :
-{
- P0 = I31(4, 0);
- P2 = I31(4, 7);
- P3 = I31(4, 8);
- if (MUR) {
- P1 = IC(4);
- } else {
- P1 = I211(4, 1, 5);
- }
-} break;
-case 63 :
-{
- P2 = I31(4, 7);
- P3 = I31(4, 8);
- if (MUL) {
- P0 = IC(4);
- } else {
- P0 = I1411(4, 1, 3);
- }
- if (MUR) {
- P1 = IC(4);
- } else {
- P1 = I211(4, 1, 5);
- }
-} break;
-case 64 :
-case 65 :
-case 68 :
-case 69 :
-{
- P0 = I211(4, 1, 3);
- P1 = I211(4, 1, 5);
- P2 = I31(4, 6);
- P3 = I31(4, 8);
-} break;
-case 67 :
-{
- P0 = I31(4, 3);
- P1 = I31(4, 2);
- P2 = I31(4, 6);
- P3 = I31(4, 8);
-} break;
-case 70 :
-{
- P0 = I31(4, 0);
- P1 = I31(4, 5);
- P2 = I31(4, 6);
- P3 = I31(4, 8);
-} break;
-case 71 :
-{
- P0 = I31(4, 3);
- P1 = I31(4, 5);
- P2 = I31(4, 6);
- P3 = I31(4, 8);
-} break;
-case 72 :
-case 76 :
-{
- P0 = I31(4, 0);
- P1 = I211(4, 1, 5);
- P3 = I31(4, 8);
- if (MDL) {
- P2 = I31(4, 6);
- } else {
- P2 = I211(4, 3, 7);
- }
-} break;
-case 73 :
-case 77 :
-{
- P1 = I211(4, 1, 5);
- P3 = I31(4, 8);
- if (MDL) {
- P0 = I31(4, 1);
- P2 = I31(4, 6);
- } else {
- P0 = I521(4, 3, 1);
- P2 = I332(3, 7, 4);
- }
-} break;
-case 74 :
-case 107 :
-case 123 :
-{
- P1 = I31(4, 2);
- P3 = I31(4, 8);
- if (MDL) {
- P2 = IC(4);
- } else {
- P2 = I211(4, 3, 7);
- }
- if (MUL) {
- P0 = IC(4);
- } else {
- P0 = I211(4, 1, 3);
- }
-} break;
-case 78 :
-{
- P1 = I31(4, 5);
- P3 = I31(4, 8);
- if (MDL) {
- P2 = I31(4, 6);
- } else {
- P2 = I611(4, 3, 7);
- }
- if (MUL) {
- P0 = I31(4, 0);
- } else {
- P0 = I611(4, 1, 3);
- }
-} break;
-case 79 :
-{
- P1 = I31(4, 5);
- P3 = I31(4, 8);
- if (MDL) {
- P2 = I31(4, 6);
- } else {
- P2 = I611(4, 3, 7);
- }
- if (MUL) {
- P0 = IC(4);
- } else {
- P0 = I211(4, 1, 3);
- }
-} break;
-case 80 :
-case 81 :
-{
- P0 = I211(4, 1, 3);
- P1 = I31(4, 2);
- P2 = I31(4, 6);
- if (MDR) {
- P3 = I31(4, 8);
- } else {
- P3 = I211(4, 5, 7);
- }
-} break;
-case 82 :
-case 214 :
-case 222 :
-{
- P0 = I31(4, 0);
- P2 = I31(4, 6);
- if (MDR) {
- P3 = IC(4);
- } else {
- P3 = I211(4, 5, 7);
- }
- if (MUR) {
- P1 = IC(4);
- } else {
- P1 = I211(4, 1, 5);
- }
-} break;
-case 83 :
-{
- P0 = I31(4, 3);
- P2 = I31(4, 6);
- if (MDR) {
- P3 = I31(4, 8);
- } else {
- P3 = I611(4, 5, 7);
- }
- if (MUR) {
- P1 = I31(4, 2);
- } else {
- P1 = I611(4, 1, 5);
- }
-} break;
-case 84 :
-case 85 :
-{
- P0 = I211(4, 1, 3);
- P2 = I31(4, 6);
- if (MDR) {
- P1 = I31(4, 1);
- P3 = I31(4, 8);
- } else {
- P1 = I521(4, 5, 1);
- P3 = I332(5, 7, 4);
- }
-} break;
-case 87 :
-{
- P0 = I31(4, 3);
- P2 = I31(4, 6);
- if (MDR) {
- P3 = I31(4, 8);
- } else {
- P3 = I611(4, 5, 7);
- }
- if (MUR) {
- P1 = IC(4);
- } else {
- P1 = I211(4, 1, 5);
- }
-} break;
-case 88 :
-case 248 :
-case 250 :
-{
- P0 = I31(4, 0);
- P1 = I31(4, 2);
- if (MDL) {
- P2 = IC(4);
- } else {
- P2 = I211(4, 3, 7);
- }
- if (MDR) {
- P3 = IC(4);
- } else {
- P3 = I211(4, 5, 7);
- }
-} break;
-case 89 :
-{
- P0 = I31(4, 1);
- P1 = I31(4, 2);
- if (MDL) {
- P2 = I31(4, 6);
- } else {
- P2 = I611(4, 3, 7);
- }
- if (MDR) {
- P3 = I31(4, 8);
- } else {
- P3 = I611(4, 5, 7);
- }
-} break;
-case 90 :
-{
- if (MDL) {
- P2 = I31(4, 6);
- } else {
- P2 = I611(4, 3, 7);
- }
- if (MDR) {
- P3 = I31(4, 8);
- } else {
- P3 = I611(4, 5, 7);
- }
- if (MUL) {
- P0 = I31(4, 0);
- } else {
- P0 = I611(4, 1, 3);
- }
- if (MUR) {
- P1 = I31(4, 2);
- } else {
- P1 = I611(4, 1, 5);
- }
-} break;
-case 91 :
-{
- if (MDL) {
- P2 = I31(4, 6);
- } else {
- P2 = I611(4, 3, 7);
- }
- if (MDR) {
- P3 = I31(4, 8);
- } else {
- P3 = I611(4, 5, 7);
- }
- if (MUL) {
- P0 = IC(4);
- } else {
- P0 = I211(4, 1, 3);
- }
- if (MUR) {
- P1 = I31(4, 2);
- } else {
- P1 = I611(4, 1, 5);
- }
-} break;
-case 92 :
-{
- P0 = I31(4, 0);
- P1 = I31(4, 1);
- if (MDL) {
- P2 = I31(4, 6);
- } else {
- P2 = I611(4, 3, 7);
- }
- if (MDR) {
- P3 = I31(4, 8);
- } else {
- P3 = I611(4, 5, 7);
- }
-} break;
-case 93 :
-{
- P0 = I31(4, 1);
- P1 = I31(4, 1);
- if (MDL) {
- P2 = I31(4, 6);
- } else {
- P2 = I611(4, 3, 7);
- }
- if (MDR) {
- P3 = I31(4, 8);
- } else {
- P3 = I611(4, 5, 7);
- }
-} break;
-case 94 :
-{
- if (MDL) {
- P2 = I31(4, 6);
- } else {
- P2 = I611(4, 3, 7);
- }
- if (MDR) {
- P3 = I31(4, 8);
- } else {
- P3 = I611(4, 5, 7);
- }
- if (MUL) {
- P0 = I31(4, 0);
- } else {
- P0 = I611(4, 1, 3);
- }
- if (MUR) {
- P1 = IC(4);
- } else {
- P1 = I211(4, 1, 5);
- }
-} break;
-case 96 :
-case 97 :
-case 100 :
-case 101 :
-{
- P0 = I211(4, 1, 3);
- P1 = I211(4, 1, 5);
- P2 = I31(4, 3);
- P3 = I31(4, 8);
-} break;
-case 98 :
-{
- P0 = I31(4, 0);
- P1 = I31(4, 2);
- P2 = I31(4, 3);
- P3 = I31(4, 8);
-} break;
-case 99 :
-{
- P0 = I31(4, 3);
- P1 = I31(4, 2);
- P2 = I31(4, 3);
- P3 = I31(4, 8);
-} break;
-case 102 :
-{
- P0 = I31(4, 0);
- P1 = I31(4, 5);
- P2 = I31(4, 3);
- P3 = I31(4, 8);
-} break;
-case 103 :
-{
- P0 = I31(4, 3);
- P1 = I31(4, 5);
- P2 = I31(4, 3);
- P3 = I31(4, 8);
-} break;
-case 104 :
-case 108 :
-{
- P0 = I31(4, 0);
- P1 = I211(4, 1, 5);
- P3 = I31(4, 8);
- if (MDL) {
- P2 = IC(4);
- } else {
- P2 = I211(4, 3, 7);
- }
-} break;
-case 105 :
-case 109 :
-{
- P1 = I211(4, 1, 5);
- P3 = I31(4, 8);
- if (MDL) {
- P0 = I31(4, 1);
- P2 = IC(4);
- } else {
- P0 = I521(4, 3, 1);
- P2 = I332(3, 7, 4);
- }
-} break;
-case 106 :
-case 120 :
-{
- P0 = I31(4, 0);
- P1 = I31(4, 2);
- P3 = I31(4, 8);
- if (MDL) {
- P2 = IC(4);
- } else {
- P2 = I211(4, 3, 7);
- }
-} break;
-case 110 :
-{
- P0 = I31(4, 0);
- P1 = I31(4, 5);
- P3 = I31(4, 8);
- if (MDL) {
- P2 = IC(4);
- } else {
- P2 = I211(4, 3, 7);
- }
-} break;
-case 111 :
-{
- P1 = I31(4, 5);
- P3 = I31(4, 8);
- if (MDL) {
- P2 = IC(4);
- } else {
- P2 = I211(4, 3, 7);
- }
- if (MUL) {
- P0 = IC(4);
- } else {
- P0 = I1411(4, 1, 3);
- }
-} break;
-case 112 :
-case 113 :
-{
- P0 = I211(4, 1, 3);
- P1 = I31(4, 2);
- if (MDR) {
- P2 = I31(4, 3);
- P3 = I31(4, 8);
- } else {
- P2 = I521(4, 7, 3);
- P3 = I332(5, 7, 4);
- }
-} break;
-case 114 :
-{
- P0 = I31(4, 0);
- P2 = I31(4, 3);
- if (MDR) {
- P3 = I31(4, 8);
- } else {
- P3 = I611(4, 5, 7);
- }
- if (MUR) {
- P1 = I31(4, 2);
- } else {
- P1 = I611(4, 1, 5);
- }
-} break;
-case 115 :
-{
- P0 = I31(4, 3);
- P2 = I31(4, 3);
- if (MDR) {
- P3 = I31(4, 8);
- } else {
- P3 = I611(4, 5, 7);
- }
- if (MUR) {
- P1 = I31(4, 2);
- } else {
- P1 = I611(4, 1, 5);
- }
-} break;
-case 116 :
-case 117 :
-{
- P0 = I211(4, 1, 3);
- P1 = I31(4, 1);
- P2 = I31(4, 3);
- if (MDR) {
- P3 = I31(4, 8);
- } else {
- P3 = I611(4, 5, 7);
- }
-} break;
-case 118 :
-{
- P0 = I31(4, 0);
- P2 = I31(4, 3);
- P3 = I31(4, 8);
- if (MUR) {
- P1 = IC(4);
- } else {
- P1 = I211(4, 1, 5);
- }
-} break;
-case 119 :
-{
- P2 = I31(4, 3);
- P3 = I31(4, 8);
- if (MUR) {
- P0 = I31(4, 3);
- P1 = IC(4);
- } else {
- P0 = I521(4, 1, 3);
- P1 = I332(1, 5, 4);
- }
-} break;
-case 121 :
-{
- P0 = I31(4, 1);
- P1 = I31(4, 2);
- if (MDL) {
- P2 = IC(4);
- } else {
- P2 = I211(4, 3, 7);
- }
- if (MDR) {
- P3 = I31(4, 8);
- } else {
- P3 = I611(4, 5, 7);
- }
-} break;
-case 122 :
-{
- if (MDL) {
- P2 = IC(4);
- } else {
- P2 = I211(4, 3, 7);
- }
- if (MDR) {
- P3 = I31(4, 8);
- } else {
- P3 = I611(4, 5, 7);
- }
- if (MUL) {
- P0 = I31(4, 0);
- } else {
- P0 = I611(4, 1, 3);
- }
- if (MUR) {
- P1 = I31(4, 2);
- } else {
- P1 = I611(4, 1, 5);
- }
-} break;
-case 124 :
-{
- P0 = I31(4, 0);
- P1 = I31(4, 1);
- P3 = I31(4, 8);
- if (MDL) {
- P2 = IC(4);
- } else {
- P2 = I211(4, 3, 7);
- }
-} break;
-case 125 :
-{
- P1 = I31(4, 1);
- P3 = I31(4, 8);
- if (MDL) {
- P0 = I31(4, 1);
- P2 = IC(4);
- } else {
- P0 = I521(4, 3, 1);
- P2 = I332(3, 7, 4);
- }
-} break;
-case 126 :
-{
- P0 = I31(4, 0);
- P3 = I31(4, 8);
- if (MDL) {
- P2 = IC(4);
- } else {
- P2 = I211(4, 3, 7);
- }
- if (MUR) {
- P1 = IC(4);
- } else {
- P1 = I211(4, 1, 5);
- }
-} break;
-case 127 :
-{
- P3 = I31(4, 8);
- if (MDL) {
- P2 = IC(4);
- } else {
- P2 = I211(4, 3, 7);
- }
- if (MUL) {
- P0 = IC(4);
- } else {
- P0 = I1411(4, 1, 3);
- }
- if (MUR) {
- P1 = IC(4);
- } else {
- P1 = I211(4, 1, 5);
- }
-} break;
-case 144 :
-case 145 :
-case 176 :
-case 177 :
-{
- P0 = I211(4, 1, 3);
- P1 = I31(4, 2);
- P2 = I211(4, 3, 7);
- P3 = I31(4, 7);
-} break;
-case 146 :
-case 178 :
-{
- P0 = I31(4, 0);
- P2 = I211(4, 3, 7);
- if (MUR) {
- P1 = I31(4, 2);
- P3 = I31(4, 7);
- } else {
- P1 = I332(1, 5, 4);
- P3 = I521(4, 5, 7);
- }
-} break;
-case 147 :
-case 179 :
-{
- P0 = I31(4, 3);
- P2 = I211(4, 3, 7);
- P3 = I31(4, 7);
- if (MUR) {
- P1 = I31(4, 2);
- } else {
- P1 = I611(4, 1, 5);
- }
-} break;
-case 148 :
-case 149 :
-case 180 :
-case 181 :
-{
- P0 = I211(4, 1, 3);
- P1 = I31(4, 1);
- P2 = I211(4, 3, 7);
- P3 = I31(4, 7);
-} break;
-case 150 :
-case 182 :
-{
- P0 = I31(4, 0);
- P2 = I211(4, 3, 7);
- if (MUR) {
- P1 = IC(4);
- P3 = I31(4, 7);
- } else {
- P1 = I332(1, 5, 4);
- P3 = I521(4, 5, 7);
- }
-} break;
-case 151 :
-case 183 :
-{
- P0 = I31(4, 3);
- P2 = I211(4, 3, 7);
- P3 = I31(4, 7);
- if (MUR) {
- P1 = IC(4);
- } else {
- P1 = I1411(4, 1, 5);
- }
-} break;
-case 152 :
-{
- P0 = I31(4, 0);
- P1 = I31(4, 2);
- P2 = I31(4, 6);
- P3 = I31(4, 7);
-} break;
-case 153 :
-{
- P0 = I31(4, 1);
- P1 = I31(4, 2);
- P2 = I31(4, 6);
- P3 = I31(4, 7);
-} break;
-case 154 :
-{
- P2 = I31(4, 6);
- P3 = I31(4, 7);
- if (MUL) {
- P0 = I31(4, 0);
- } else {
- P0 = I611(4, 1, 3);
- }
- if (MUR) {
- P1 = I31(4, 2);
- } else {
- P1 = I611(4, 1, 5);
- }
-} break;
-case 155 :
-{
- P1 = I31(4, 2);
- P2 = I31(4, 6);
- P3 = I31(4, 7);
- if (MUL) {
- P0 = IC(4);
- } else {
- P0 = I211(4, 1, 3);
- }
-} break;
-case 156 :
-{
- P0 = I31(4, 0);
- P1 = I31(4, 1);
- P2 = I31(4, 6);
- P3 = I31(4, 7);
-} break;
-case 157 :
-{
- P0 = I31(4, 1);
- P1 = I31(4, 1);
- P2 = I31(4, 6);
- P3 = I31(4, 7);
-} break;
-case 158 :
-{
- P2 = I31(4, 6);
- P3 = I31(4, 7);
- if (MUL) {
- P0 = I31(4, 0);
- } else {
- P0 = I611(4, 1, 3);
- }
- if (MUR) {
- P1 = IC(4);
- } else {
- P1 = I211(4, 1, 5);
- }
-} break;
-case 159 :
-{
- P2 = I31(4, 6);
- P3 = I31(4, 7);
- if (MUL) {
- P0 = IC(4);
- } else {
- P0 = I211(4, 1, 3);
- }
- if (MUR) {
- P1 = IC(4);
- } else {
- P1 = I1411(4, 1, 5);
- }
-} break;
-case 184 :
-{
- P0 = I31(4, 0);
- P1 = I31(4, 2);
- P2 = I31(4, 7);
- P3 = I31(4, 7);
-} break;
-case 185 :
-{
- P0 = I31(4, 1);
- P1 = I31(4, 2);
- P2 = I31(4, 7);
- P3 = I31(4, 7);
-} break;
-case 186 :
-{
- P2 = I31(4, 7);
- P3 = I31(4, 7);
- if (MUL) {
- P0 = I31(4, 0);
- } else {
- P0 = I611(4, 1, 3);
- }
- if (MUR) {
- P1 = I31(4, 2);
- } else {
- P1 = I611(4, 1, 5);
- }
-} break;
-case 187 :
-{
- P1 = I31(4, 2);
- P3 = I31(4, 7);
- if (MUL) {
- P0 = IC(4);
- P2 = I31(4, 7);
- } else {
- P0 = I332(1, 3, 4);
- P2 = I521(4, 3, 7);
- }
-} break;
-case 188 :
-{
- P0 = I31(4, 0);
- P1 = I31(4, 1);
- P2 = I31(4, 7);
- P3 = I31(4, 7);
-} break;
-case 189 :
-{
- P0 = I31(4, 1);
- P1 = I31(4, 1);
- P2 = I31(4, 7);
- P3 = I31(4, 7);
-} break;
-case 190 :
-{
- P0 = I31(4, 0);
- P2 = I31(4, 7);
- if (MUR) {
- P1 = IC(4);
- P3 = I31(4, 7);
- } else {
- P1 = I332(1, 5, 4);
- P3 = I521(4, 5, 7);
- }
-} break;
-case 191 :
-{
- P2 = I31(4, 7);
- P3 = I31(4, 7);
- if (MUL) {
- P0 = IC(4);
- } else {
- P0 = I1411(4, 1, 3);
- }
- if (MUR) {
- P1 = IC(4);
- } else {
- P1 = I1411(4, 1, 5);
- }
-} break;
-case 192 :
-case 193 :
-case 196 :
-case 197 :
-{
- P0 = I211(4, 1, 3);
- P1 = I211(4, 1, 5);
- P2 = I31(4, 6);
- P3 = I31(4, 5);
-} break;
-case 194 :
-{
- P0 = I31(4, 0);
- P1 = I31(4, 2);
- P2 = I31(4, 6);
- P3 = I31(4, 5);
-} break;
-case 195 :
-{
- P0 = I31(4, 3);
- P1 = I31(4, 2);
- P2 = I31(4, 6);
- P3 = I31(4, 5);
-} break;
-case 198 :
-{
- P0 = I31(4, 0);
- P1 = I31(4, 5);
- P2 = I31(4, 6);
- P3 = I31(4, 5);
-} break;
-case 199 :
-{
- P0 = I31(4, 3);
- P1 = I31(4, 5);
- P2 = I31(4, 6);
- P3 = I31(4, 5);
-} break;
-case 200 :
-case 204 :
-{
- P0 = I31(4, 0);
- P1 = I211(4, 1, 5);
- if (MDL) {
- P2 = I31(4, 6);
- P3 = I31(4, 5);
- } else {
- P2 = I332(3, 7, 4);
- P3 = I521(4, 7, 5);
- }
-} break;
-case 201 :
-case 205 :
-{
- P0 = I31(4, 1);
- P1 = I211(4, 1, 5);
- P3 = I31(4, 5);
- if (MDL) {
- P2 = I31(4, 6);
- } else {
- P2 = I611(4, 3, 7);
- }
-} break;
-case 202 :
-{
- P1 = I31(4, 2);
- P3 = I31(4, 5);
- if (MDL) {
- P2 = I31(4, 6);
- } else {
- P2 = I611(4, 3, 7);
- }
- if (MUL) {
- P0 = I31(4, 0);
- } else {
- P0 = I611(4, 1, 3);
- }
-} break;
-case 203 :
-{
- P1 = I31(4, 2);
- P2 = I31(4, 6);
- P3 = I31(4, 5);
- if (MUL) {
- P0 = IC(4);
- } else {
- P0 = I211(4, 1, 3);
- }
-} break;
-case 206 :
-{
- P1 = I31(4, 5);
- P3 = I31(4, 5);
- if (MDL) {
- P2 = I31(4, 6);
- } else {
- P2 = I611(4, 3, 7);
- }
- if (MUL) {
- P0 = I31(4, 0);
- } else {
- P0 = I611(4, 1, 3);
- }
-} break;
-case 207 :
-{
- P2 = I31(4, 6);
- P3 = I31(4, 5);
- if (MUL) {
- P0 = IC(4);
- P1 = I31(4, 5);
- } else {
- P0 = I332(1, 3, 4);
- P1 = I521(4, 1, 5);
- }
-} break;
-case 208 :
-case 209 :
-{
- P0 = I211(4, 1, 3);
- P1 = I31(4, 2);
- P2 = I31(4, 6);
- if (MDR) {
- P3 = IC(4);
- } else {
- P3 = I211(4, 5, 7);
- }
-} break;
-case 210 :
-case 216 :
-{
- P0 = I31(4, 0);
- P1 = I31(4, 2);
- P2 = I31(4, 6);
- if (MDR) {
- P3 = IC(4);
- } else {
- P3 = I211(4, 5, 7);
- }
-} break;
-case 211 :
-{
- P0 = I31(4, 3);
- P1 = I31(4, 2);
- P2 = I31(4, 6);
- if (MDR) {
- P3 = IC(4);
- } else {
- P3 = I211(4, 5, 7);
- }
-} break;
-case 212 :
-case 213 :
-{
- P0 = I211(4, 1, 3);
- P2 = I31(4, 6);
- if (MDR) {
- P1 = I31(4, 1);
- P3 = IC(4);
- } else {
- P1 = I521(4, 5, 1);
- P3 = I332(5, 7, 4);
- }
-} break;
-case 215 :
-{
- P0 = I31(4, 3);
- P2 = I31(4, 6);
- if (MDR) {
- P3 = IC(4);
- } else {
- P3 = I211(4, 5, 7);
- }
- if (MUR) {
- P1 = IC(4);
- } else {
- P1 = I1411(4, 1, 5);
- }
-} break;
-case 217 :
-{
- P0 = I31(4, 1);
- P1 = I31(4, 2);
- P2 = I31(4, 6);
- if (MDR) {
- P3 = IC(4);
- } else {
- P3 = I211(4, 5, 7);
- }
-} break;
-case 218 :
-{
- if (MDL) {
- P2 = I31(4, 6);
- } else {
- P2 = I611(4, 3, 7);
- }
- if (MDR) {
- P3 = IC(4);
- } else {
- P3 = I211(4, 5, 7);
- }
- if (MUL) {
- P0 = I31(4, 0);
- } else {
- P0 = I611(4, 1, 3);
- }
- if (MUR) {
- P1 = I31(4, 2);
- } else {
- P1 = I611(4, 1, 5);
- }
-} break;
-case 219 :
-{
- P1 = I31(4, 2);
- P2 = I31(4, 6);
- if (MDR) {
- P3 = IC(4);
- } else {
- P3 = I211(4, 5, 7);
- }
- if (MUL) {
- P0 = IC(4);
- } else {
- P0 = I211(4, 1, 3);
- }
-} break;
-case 220 :
-{
- P0 = I31(4, 0);
- P1 = I31(4, 1);
- if (MDL) {
- P2 = I31(4, 6);
- } else {
- P2 = I611(4, 3, 7);
- }
- if (MDR) {
- P3 = IC(4);
- } else {
- P3 = I211(4, 5, 7);
- }
-} break;
-case 221 :
-{
- P0 = I31(4, 1);
- P2 = I31(4, 6);
- if (MDR) {
- P1 = I31(4, 1);
- P3 = IC(4);
- } else {
- P1 = I521(4, 5, 1);
- P3 = I332(5, 7, 4);
- }
-} break;
-case 223 :
-{
- P2 = I31(4, 6);
- if (MDR) {
- P3 = IC(4);
- } else {
- P3 = I211(4, 5, 7);
- }
- if (MUL) {
- P0 = IC(4);
- } else {
- P0 = I211(4, 1, 3);
- }
- if (MUR) {
- P1 = IC(4);
- } else {
- P1 = I1411(4, 1, 5);
- }
-} break;
-case 224 :
-case 225 :
-case 228 :
-case 229 :
-{
- P0 = I211(4, 1, 3);
- P1 = I211(4, 1, 5);
- P2 = I31(4, 3);
- P3 = I31(4, 5);
-} break;
-case 226 :
-{
- P0 = I31(4, 0);
- P1 = I31(4, 2);
- P2 = I31(4, 3);
- P3 = I31(4, 5);
-} break;
-case 227 :
-{
- P0 = I31(4, 3);
- P1 = I31(4, 2);
- P2 = I31(4, 3);
- P3 = I31(4, 5);
-} break;
-case 230 :
-{
- P0 = I31(4, 0);
- P1 = I31(4, 5);
- P2 = I31(4, 3);
- P3 = I31(4, 5);
-} break;
-case 231 :
-{
- P0 = I31(4, 3);
- P1 = I31(4, 5);
- P2 = I31(4, 3);
- P3 = I31(4, 5);
-} break;
-case 232 :
-case 236 :
-{
- P0 = I31(4, 0);
- P1 = I211(4, 1, 5);
- if (MDL) {
- P2 = IC(4);
- P3 = I31(4, 5);
- } else {
- P2 = I332(3, 7, 4);
- P3 = I521(4, 7, 5);
- }
-} break;
-case 233 :
-case 237 :
-{
- P0 = I31(4, 1);
- P1 = I211(4, 1, 5);
- P3 = I31(4, 5);
- if (MDL) {
- P2 = IC(4);
- } else {
- P2 = I1411(4, 3, 7);
- }
-} break;
-case 234 :
-{
- P1 = I31(4, 2);
- P3 = I31(4, 5);
- if (MDL) {
- P2 = IC(4);
- } else {
- P2 = I211(4, 3, 7);
- }
- if (MUL) {
- P0 = I31(4, 0);
- } else {
- P0 = I611(4, 1, 3);
- }
-} break;
-case 235 :
-{
- P1 = I31(4, 2);
- P3 = I31(4, 5);
- if (MDL) {
- P2 = IC(4);
- } else {
- P2 = I1411(4, 3, 7);
- }
- if (MUL) {
- P0 = IC(4);
- } else {
- P0 = I211(4, 1, 3);
- }
-} break;
-case 238 :
-{
- P0 = I31(4, 0);
- P1 = I31(4, 5);
- if (MDL) {
- P2 = IC(4);
- P3 = I31(4, 5);
- } else {
- P2 = I332(3, 7, 4);
- P3 = I521(4, 7, 5);
- }
-} break;
-case 239 :
-{
- P1 = I31(4, 5);
- P3 = I31(4, 5);
- if (MDL) {
- P2 = IC(4);
- } else {
- P2 = I1411(4, 3, 7);
- }
- if (MUL) {
- P0 = IC(4);
- } else {
- P0 = I1411(4, 1, 3);
- }
-} break;
-case 240 :
-case 241 :
-{
- P0 = I211(4, 1, 3);
- P1 = I31(4, 2);
- if (MDR) {
- P2 = I31(4, 3);
- P3 = IC(4);
- } else {
- P2 = I521(4, 7, 3);
- P3 = I332(5, 7, 4);
- }
-} break;
-case 242 :
-{
- P0 = I31(4, 0);
- P2 = I31(4, 3);
- if (MDR) {
- P3 = IC(4);
- } else {
- P3 = I211(4, 5, 7);
- }
- if (MUR) {
- P1 = I31(4, 2);
- } else {
- P1 = I611(4, 1, 5);
- }
-} break;
-case 243 :
-{
- P0 = I31(4, 3);
- P1 = I31(4, 2);
- if (MDR) {
- P2 = I31(4, 3);
- P3 = IC(4);
- } else {
- P2 = I521(4, 7, 3);
- P3 = I332(5, 7, 4);
- }
-} break;
-case 244 :
-case 245 :
-{
- P0 = I211(4, 1, 3);
- P1 = I31(4, 1);
- P2 = I31(4, 3);
- if (MDR) {
- P3 = IC(4);
- } else {
- P3 = I1411(4, 5, 7);
- }
-} break;
-case 246 :
-{
- P0 = I31(4, 0);
- P2 = I31(4, 3);
- if (MDR) {
- P3 = IC(4);
- } else {
- P3 = I1411(4, 5, 7);
- }
- if (MUR) {
- P1 = IC(4);
- } else {
- P1 = I211(4, 1, 5);
- }
-} break;
-case 247 :
-{
- P0 = I31(4, 3);
- P2 = I31(4, 3);
- if (MDR) {
- P3 = IC(4);
- } else {
- P3 = I1411(4, 5, 7);
- }
- if (MUR) {
- P1 = IC(4);
- } else {
- P1 = I1411(4, 1, 5);
- }
-} break;
-case 249 :
-{
- P0 = I31(4, 1);
- P1 = I31(4, 2);
- if (MDL) {
- P2 = IC(4);
- } else {
- P2 = I1411(4, 3, 7);
- }
- if (MDR) {
- P3 = IC(4);
- } else {
- P3 = I211(4, 5, 7);
- }
-} break;
-case 251 :
-{
- P1 = I31(4, 2);
- if (MDL) {
- P2 = IC(4);
- } else {
- P2 = I1411(4, 3, 7);
- }
- if (MDR) {
- P3 = IC(4);
- } else {
- P3 = I211(4, 5, 7);
- }
- if (MUL) {
- P0 = IC(4);
- } else {
- P0 = I211(4, 1, 3);
- }
-} break;
-case 252 :
-{
- P0 = I31(4, 0);
- P1 = I31(4, 1);
- if (MDL) {
- P2 = IC(4);
- } else {
- P2 = I211(4, 3, 7);
- }
- if (MDR) {
- P3 = IC(4);
- } else {
- P3 = I1411(4, 5, 7);
- }
-} break;
-case 253 :
-{
- P0 = I31(4, 1);
- P1 = I31(4, 1);
- if (MDL) {
- P2 = IC(4);
- } else {
- P2 = I1411(4, 3, 7);
- }
- if (MDR) {
- P3 = IC(4);
- } else {
- P3 = I1411(4, 5, 7);
- }
-} break;
-case 254 :
-{
- P0 = I31(4, 0);
- if (MDL) {
- P2 = IC(4);
- } else {
- P2 = I211(4, 3, 7);
- }
- if (MDR) {
- P3 = IC(4);
- } else {
- P3 = I1411(4, 5, 7);
- }
- if (MUR) {
- P1 = IC(4);
- } else {
- P1 = I211(4, 1, 5);
- }
-} break;
-case 255 :
-{
- if (MDL) {
- P2 = IC(4);
- } else {
- P2 = I1411(4, 3, 7);
- }
- if (MDR) {
- P3 = IC(4);
- } else {
- P3 = I1411(4, 5, 7);
- }
- if (MUL) {
- P0 = IC(4);
- } else {
- P0 = I1411(4, 1, 3);
- }
- if (MUR) {
- P1 = IC(4);
- } else {
- P1 = I1411(4, 1, 5);
- }
-} break;
-
-#undef P0
-#undef P1
-#undef P2
-#undef P3
-#undef MUR
-#undef MDR
-#undef MDL
-#undef MUL
-#undef IC
-#undef I11
-#undef I211
-#undef I31
-#undef I332
-#undef I431
-#undef I521
-#undef I53
-#undef I611
-#undef I71
-#undef I772
-#undef I97
-#undef I1411
-#undef I151
+++ /dev/null
-/*
- * This file is part of the Advance project.
- *
- * Copyright (C) 2004 Andrea Mazzoleni
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * In addition, as a special exception, Andrea Mazzoleni
- * gives permission to link the code of this program with
- * the MAME library (or with modified versions of MAME that use the
- * same license as MAME), and distribute linked combinations including
- * the two. You must obey the GNU General Public License in all
- * respects for all of the code used other than MAME. If you modify
- * this file, you may extend this exception to your version of the
- * file, but you are not obligated to do so. If you do not wish to
- * do so, delete this exception statement from your version.
- */
-
-/*
- * This effect is a rewritten implementation of the hq effect made by Maxim Stepin
- */
-
-#define P0 dst0[0]
-#define P1 dst0[1]
-#define P2 dst0[2]
-#define P3 dst1[0]
-#define P4 dst1[1]
-#define P5 dst1[2]
-#define P6 dst2[0]
-#define P7 dst2[1]
-#define P8 dst2[2]
-#define MUR interp_32_diff(c[1], c[5])
-#define MDR interp_32_diff(c[5], c[7])
-#define MDL interp_32_diff(c[7], c[3])
-#define MUL interp_32_diff(c[3], c[1])
-#define IC(p0) c[p0]
-#define I11(p0,p1) interp_32_11(c[p0], c[p1])
-#define I211(p0,p1,p2) interp_32_211(c[p0], c[p1], c[p2])
-#define I31(p0,p1) interp_32_31(c[p0], c[p1])
-#define I332(p0,p1,p2) interp_32_332(c[p0], c[p1], c[p2])
-#define I431(p0,p1,p2) interp_32_431(c[p0], c[p1], c[p2])
-#define I521(p0,p1,p2) interp_32_521(c[p0], c[p1], c[p2])
-#define I53(p0,p1) interp_32_53(c[p0], c[p1])
-#define I611(p0,p1,p2) interp_32_611(c[p0], c[p1], c[p2])
-#define I71(p0,p1) interp_32_71(c[p0], c[p1])
-#define I772(p0,p1,p2) interp_32_772(c[p0], c[p1], c[p2])
-#define I97(p0,p1) interp_32_97(c[p0], c[p1])
-#define I1411(p0,p1,p2) interp_32_1411(c[p0], c[p1], c[p2])
-#define I151(p0,p1) interp_32_151(c[p0], c[p1])
-
-case 0 :
-case 1 :
-case 4 :
-case 5 :
-case 32 :
-case 33 :
-case 36 :
-case 37 :
-case 128 :
-case 129 :
-case 132 :
-case 133 :
-case 160 :
-case 161 :
-case 164 :
-case 165 :
-{
-P0 = I211(4, 1, 3);
-P1 = I31(4,1);
-P2 = I211(4, 1, 5);
-P3 = I31(4, 3);
-P4 = IC(4);
-P5 = I31(4,5);
-P6 = I211(4, 3, 7);
-P7 = I31(4, 7);
-P8 = I211(4, 5, 7);
-
-} break;
-case 2 :
-case 34 :
-case 130 :
-case 162 :
-{
-P0 = I31(4, 0);
-P1 = IC(4);
-P2 = I31(4, 2);
-P3 = I31(4, 3);
-P4 = IC(4);
-P5 = I31(4,5);
-P6 = I211(4, 3, 7);
-P7 = I31(4, 7);
-P8 = I211(4, 5, 7);
-} break;
-case 3 :
-case 35 :
-case 131 :
-case 163 :
-{
-P0 = I31(4, 3);
-P1 = IC(4);
-P2 = I31(4, 2);
-P3 = I31(4, 3);
-P4 = IC(4);
-P5 = I31(4,5);
-P6 = I211(4, 3, 7);
-P7 = I31(4, 7);
-P8 = I211(4, 5, 7);
-} break;
-case 6 :
-case 38 :
-case 134 :
-case 166 :
-{
-P0 = I31(4, 0);
-P1 = IC(4);
-P2 = I31(4,5);
-P3 = I31(4, 3);
-P4 = IC(4);
-P5 = I31(4,5);
-P6 = I211(4, 3, 7);
-P7 = I31(4, 7);
-P8 = I211(4, 5, 7);
-} break;
-case 7 :
-case 39 :
-case 135 :
-case 167 :
-{
-P0 = I31(4, 3);
-P1 = IC(4);
-P2 = I31(4,5);
-P3 = I31(4, 3);
-P4 = IC(4);
-P5 = I31(4,5);
-P6 = I211(4, 3, 7);
-P7 = I31(4, 7);
-P8 = I211(4, 5, 7);
-} break;
-case 8 :
-case 12 :
-case 136 :
-case 140 :
-{
-P0 = I31(4, 0);
-P1 = I31(4,1);
-P2 = I211(4, 1, 5);
-P3 = IC(4);
-P4 = IC(4);
-P5 = I31(4,5);
-P6 = I31(4, 6);
-P7 = I31(4, 7);
-P8 = I211(4, 5, 7);
-} break;
-case 9 :
-case 13 :
-case 137 :
-case 141 :
-{
-P0 = I31(4,1);
-P1 = I31(4,1);
-P2 = I211(4, 1, 5);
-P3 = IC(4);
-P4 = IC(4);
-P5 = I31(4,5);
-P6 = I31(4, 6);
-P7 = I31(4, 7);
-P8 = I211(4, 5, 7);
-} break;
-case 10 :
-case 138 :
-{
-P2 = I31(4, 2);
-P4 = IC(4);
-P5 = I31(4,5);
-P6 = I31(4, 6);
-P7 = I31(4, 7);
-P8 = I211(4, 5, 7);
-if (MUL) {
- P0 = I31(4, 0);
- P1 = IC(4);
- P3 = IC(4);
-} else {
- P0 = I772(1, 3, 4);
- P1 = I71(4, 1);
- P3 = I71(4, 3);
-}
-} break;
-case 11 :
-case 139 :
-{
-P2 = I31(4, 2);
-P4 = IC(4);
-P5 = I31(4,5);
-P6 = I31(4, 6);
-P7 = I31(4, 7);
-P8 = I211(4, 5, 7);
-if (MUL) {
- P0 = IC(4);
- P1 = IC(4);
- P3 = IC(4);
-} else {
- P0 = I772(1, 3, 4);
- P1 = I71(4, 1);
- P3 = I71(4, 3);
-}
-} break;
-case 14 :
-case 142 :
-{
-P4 = IC(4);
-P5 = I31(4,5);
-P6 = I31(4, 6);
-P7 = I31(4, 7);
-P8 = I211(4, 5, 7);
-if (MUL) {
- P0 = I31(4, 0);
- P1 = IC(4);
- P2 = I31(4,5);
- P3 = IC(4);
-} else {
- P0 = I11(1, 3);
- P1 = I31(1, 4);
- P2 = I211(4, 1, 5);
- P3 = I31(4, 3);
-}
-} break;
-case 15 :
-case 143 :
-{
-P4 = IC(4);
-P5 = I31(4,5);
-P6 = I31(4, 6);
-P7 = I31(4, 7);
-P8 = I211(4, 5, 7);
-if (MUL) {
- P0 = IC(4);
- P1 = IC(4);
- P2 = I31(4,5);
- P3 = IC(4);
-} else {
- P0 = I11(1, 3);
- P1 = I31(1, 4);
- P2 = I211(4, 1, 5);
- P3 = I31(4, 3);
-}
-} break;
-case 16 :
-case 17 :
-case 48 :
-case 49 :
-{
-P0 = I211(4, 1, 3);
-P1 = I31(4,1);
-P2 = I31(4, 2);
-P3 = I31(4, 3);
-P4 = IC(4);
-P5 = IC(4);
-P6 = I211(4, 3, 7);
-P7 = I31(4, 7);
-P8 = I31(4, 8);
-} break;
-case 18 :
-case 50 :
-{
-P0 = I31(4, 0);
-P3 = I31(4, 3);
-P4 = IC(4);
-P6 = I211(4, 3, 7);
-P7 = I31(4, 7);
-P8 = I31(4, 8);
-if (MUR) {
- P1 = IC(4);
- P2 = I31(4, 2);
- P5 = IC(4);
-} else {
- P1 = I71(4, 1);
- P2 = I772(1, 5, 4);
- P5 = I71(4, 5);
-}
-} break;
-case 19 :
-case 51 :
-{
-P3 = I31(4, 3);
-P4 = IC(4);
-P6 = I211(4, 3, 7);
-P7 = I31(4, 7);
-P8 = I31(4, 8);
-if (MUR) {
- P0 = I31(4, 3);
- P1 = IC(4);
- P2 = I31(4, 2);
- P5 = IC(4);
-} else {
- P0 = I211(4, 1, 3);
- P1 = I31(1, 4);
- P2 = I11(1, 5);
- P5 = I31(4,5);
-}
-} break;
-case 20 :
-case 21 :
-case 52 :
-case 53 :
-{
-P0 = I211(4, 1, 3);
-P1 = I31(4,1);
-P2 = I31(4,1);
-P3 = I31(4, 3);
-P4 = IC(4);
-P5 = IC(4);
-P6 = I211(4, 3, 7);
-P7 = I31(4, 7);
-P8 = I31(4, 8);
-} break;
-case 22 :
-case 54 :
-{
-P0 = I31(4, 0);
-P3 = I31(4, 3);
-P4 = IC(4);
-P6 = I211(4, 3, 7);
-P7 = I31(4, 7);
-P8 = I31(4, 8);
-if (MUR) {
- P1 = IC(4);
- P2 = IC(4);
- P5 = IC(4);
-} else {
- P1 = I71(4, 1);
- P2 = I772(1, 5, 4);
- P5 = I71(4, 5);
-}
-} break;
-case 23 :
-case 55 :
-{
-P3 = I31(4, 3);
-P4 = IC(4);
-P6 = I211(4, 3, 7);
-P7 = I31(4, 7);
-P8 = I31(4, 8);
-if (MUR) {
- P0 = I31(4, 3);
- P1 = IC(4);
- P2 = IC(4);
- P5 = IC(4);
-} else {
- P0 = I211(4, 1, 3);
- P1 = I31(1, 4);
- P2 = I11(1, 5);
- P5 = I31(4,5);
-}
-} break;
-case 24 :
-{
-P0 = I31(4, 0);
-P1 = I31(4,1);
-P2 = I31(4, 2);
-P3 = IC(4);
-P4 = IC(4);
-P5 = IC(4);
-P6 = I31(4, 6);
-P7 = I31(4, 7);
-P8 = I31(4, 8);
-} break;
-case 25 :
-{
-P0 = I31(4,1);
-P1 = I31(4,1);
-P2 = I31(4, 2);
-P3 = IC(4);
-P4 = IC(4);
-P5 = IC(4);
-P6 = I31(4, 6);
-P7 = I31(4, 7);
-P8 = I31(4, 8);
-} break;
-case 26 :
-case 31 :
-{
-P1 = IC(4);
-P4 = IC(4);
-P6 = I31(4, 6);
-P7 = I31(4, 7);
-P8 = I31(4, 8);
-if (MUL) {
- P0 = IC(4);
- P3 = IC(4);
-} else {
- P0 = I772(1, 3, 4);
- P3 = I71(4, 3);
-}
-if (MUR) {
- P2 = IC(4);
- P5 = IC(4);
-} else {
- P2 = I772(1, 5, 4);
- P5 = I71(4, 5);
-}
-} break;
-case 27 :
-{
-P2 = I31(4, 2);
-P4 = IC(4);
-P5 = IC(4);
-P6 = I31(4, 6);
-P7 = I31(4, 7);
-P8 = I31(4, 8);
-if (MUL) {
- P0 = IC(4);
- P1 = IC(4);
- P3 = IC(4);
-} else {
- P0 = I772(1, 3, 4);
- P1 = I71(4, 1);
- P3 = I71(4, 3);
-}
-} break;
-case 28 :
-{
-P0 = I31(4, 0);
-P1 = I31(4,1);
-P2 = I31(4,1);
-P3 = IC(4);
-P4 = IC(4);
-P5 = IC(4);
-P6 = I31(4, 6);
-P7 = I31(4, 7);
-P8 = I31(4, 8);
-} break;
-case 29 :
-{
-P0 = I31(4,1);
-P1 = I31(4,1);
-P2 = I31(4,1);
-P3 = IC(4);
-P4 = IC(4);
-P5 = IC(4);
-P6 = I31(4, 6);
-P7 = I31(4, 7);
-P8 = I31(4, 8);
-} break;
-case 30 :
-{
-P0 = I31(4, 0);
-P3 = IC(4);
-P4 = IC(4);
-P6 = I31(4, 6);
-P7 = I31(4, 7);
-P8 = I31(4, 8);
-if (MUR) {
- P1 = IC(4);
- P2 = IC(4);
- P5 = IC(4);
-} else {
- P1 = I71(4, 1);
- P2 = I772(1, 5, 4);
- P5 = I71(4, 5);
-}
-} break;
-case 40 :
-case 44 :
-case 168 :
-case 172 :
-{
-P0 = I31(4, 0);
-P1 = I31(4,1);
-P2 = I211(4, 1, 5);
-P3 = IC(4);
-P4 = IC(4);
-P5 = I31(4,5);
-P6 = I31(4, 7);
-P7 = I31(4, 7);
-P8 = I211(4, 5, 7);
-} break;
-case 41 :
-case 45 :
-case 169 :
-case 173 :
-{
-P0 = I31(4,1);
-P1 = I31(4,1);
-P2 = I211(4, 1, 5);
-P3 = IC(4);
-P4 = IC(4);
-P5 = I31(4,5);
-P6 = I31(4, 7);
-P7 = I31(4, 7);
-P8 = I211(4, 5, 7);
-} break;
-case 42 :
-case 170 :
-{
-P2 = I31(4, 2);
-P4 = IC(4);
-P5 = I31(4,5);
-P7 = I31(4, 7);
-P8 = I211(4, 5, 7);
-if (MUL) {
- P0 = I31(4, 0);
- P1 = IC(4);
- P3 = IC(4);
- P6 = I31(4, 7);
-} else {
- P0 = I11(1, 3);
- P1 = I31(4,1);
- P3 = I31(3, 4);
- P6 = I211(4, 3, 7);
-}
-} break;
-case 43 :
-case 171 :
-{
-P2 = I31(4, 2);
-P4 = IC(4);
-P5 = I31(4,5);
-P7 = I31(4, 7);
-P8 = I211(4, 5, 7);
-if (MUL) {
- P0 = IC(4);
- P1 = IC(4);
- P3 = IC(4);
- P6 = I31(4, 7);
-} else {
- P0 = I11(1, 3);
- P1 = I31(4,1);
- P3 = I31(3, 4);
- P6 = I211(4, 3, 7);
-}
-} break;
-case 46 :
-case 174 :
-{
-P1 = IC(4);
-P2 = I31(4,5);
-P3 = IC(4);
-P4 = IC(4);
-P5 = I31(4,5);
-P6 = I31(4, 7);
-P7 = I31(4, 7);
-P8 = I211(4, 5, 7);
-if (MUL) {
- P0 = I31(4, 0);
-} else {
- P0 = I211(4, 1, 3);
-}
-} break;
-case 47 :
-case 175 :
-{
-P1 = IC(4);
-P2 = I31(4,5);
-P3 = IC(4);
-P4 = IC(4);
-P5 = I31(4,5);
-P6 = I31(4, 7);
-P7 = I31(4, 7);
-P8 = I211(4, 5, 7);
-if (MUL) {
- P0 = IC(4);
-} else {
- P0 = I211(4, 1, 3);
-}
-} break;
-case 56 :
-{
-P0 = I31(4, 0);
-P1 = I31(4,1);
-P2 = I31(4, 2);
-P3 = IC(4);
-P4 = IC(4);
-P5 = IC(4);
-P6 = I31(4, 7);
-P7 = I31(4, 7);
-P8 = I31(4, 8);
-} break;
-case 57 :
-{
-P0 = I31(4,1);
-P1 = I31(4,1);
-P2 = I31(4, 2);
-P3 = IC(4);
-P4 = IC(4);
-P5 = IC(4);
-P6 = I31(4, 7);
-P7 = I31(4, 7);
-P8 = I31(4, 8);
-} break;
-case 58 :
-{
-P1 = IC(4);
-P3 = IC(4);
-P4 = IC(4);
-P5 = IC(4);
-P6 = I31(4, 7);
-P7 = I31(4, 7);
-P8 = I31(4, 8);
-if (MUL) {
- P0 = I31(4, 0);
-} else {
- P0 = I211(4, 1, 3);
-}
-if (MUR) {
- P2 = I31(4, 2);
-} else {
- P2 = I211(4, 1, 5);
-}
-} break;
-case 59 :
-{
-P4 = IC(4);
-P5 = IC(4);
-P6 = I31(4, 7);
-P7 = I31(4, 7);
-P8 = I31(4, 8);
-if (MUL) {
- P0 = IC(4);
- P1 = IC(4);
- P3 = IC(4);
-} else {
- P0 = I772(1, 3, 4);
- P1 = I71(4, 1);
- P3 = I71(4, 3);
-}
-if (MUR) {
- P2 = I31(4, 2);
-} else {
- P2 = I211(4, 1, 5);
-}
-} break;
-case 60 :
-{
-P0 = I31(4, 0);
-P1 = I31(4,1);
-P2 = I31(4,1);
-P3 = IC(4);
-P4 = IC(4);
-P5 = IC(4);
-P6 = I31(4, 7);
-P7 = I31(4, 7);
-P8 = I31(4, 8);
-} break;
-case 61 :
-{
-P0 = I31(4,1);
-P1 = I31(4,1);
-P2 = I31(4,1);
-P3 = IC(4);
-P4 = IC(4);
-P5 = IC(4);
-P6 = I31(4, 7);
-P7 = I31(4, 7);
-P8 = I31(4, 8);
-} break;
-case 62 :
-{
-P0 = I31(4, 0);
-P3 = IC(4);
-P4 = IC(4);
-P6 = I31(4, 7);
-P7 = I31(4, 7);
-P8 = I31(4, 8);
-if (MUR) {
- P1 = IC(4);
- P2 = IC(4);
- P5 = IC(4);
-} else {
- P1 = I71(4, 1);
- P2 = I772(1, 5, 4);
- P5 = I71(4, 5);
-}
-} break;
-case 63 :
-{
-P1 = IC(4);
-P3 = IC(4);
-P4 = IC(4);
-P6 = I31(4, 7);
-P7 = I31(4, 7);
-P8 = I31(4, 8);
-if (MUL) {
- P0 = IC(4);
-} else {
- P0 = I211(4, 1, 3);
-}
-if (MUR) {
- P2 = IC(4);
- P5 = IC(4);
-} else {
- P2 = I772(1, 5, 4);
- P5 = I71(4, 5);
-}
-} break;
-case 64 :
-case 65 :
-case 68 :
-case 69 :
-{
-P0 = I211(4, 1, 3);
-P1 = I31(4,1);
-P2 = I211(4, 1, 5);
-P3 = I31(4, 3);
-P4 = IC(4);
-P5 = I31(4,5);
-P6 = I31(4, 6);
-P7 = IC(4);
-P8 = I31(4, 8);
-} break;
-case 66 :
-{
-P0 = I31(4, 0);
-P1 = IC(4);
-P2 = I31(4, 2);
-P3 = I31(4, 3);
-P4 = IC(4);
-P5 = I31(4,5);
-P6 = I31(4, 6);
-P7 = IC(4);
-P8 = I31(4, 8);
-} break;
-case 67 :
-{
-P0 = I31(4, 3);
-P1 = IC(4);
-P2 = I31(4, 2);
-P3 = I31(4, 3);
-P4 = IC(4);
-P5 = I31(4,5);
-P6 = I31(4, 6);
-P7 = IC(4);
-P8 = I31(4, 8);
-} break;
-case 70 :
-{
-P0 = I31(4, 0);
-P1 = IC(4);
-P2 = I31(4,5);
-P3 = I31(4, 3);
-P4 = IC(4);
-P5 = I31(4,5);
-P6 = I31(4, 6);
-P7 = IC(4);
-P8 = I31(4, 8);
-} break;
-case 71 :
-{
-P0 = I31(4, 3);
-P1 = IC(4);
-P2 = I31(4,5);
-P3 = I31(4, 3);
-P4 = IC(4);
-P5 = I31(4,5);
-P6 = I31(4, 6);
-P7 = IC(4);
-P8 = I31(4, 8);
-} break;
-case 72 :
-case 76 :
-{
-P0 = I31(4, 0);
-P1 = I31(4,1);
-P2 = I211(4, 1, 5);
-P4 = IC(4);
-P5 = I31(4,5);
-P8 = I31(4, 8);
-if (MDL) {
- P3 = IC(4);
- P6 = I31(4, 6);
- P7 = IC(4);
-} else {
- P3 = I71(4, 3);
- P6 = I772(3, 7, 4);
- P7 = I71(4, 7);
-}
-} break;
-case 73 :
-case 77 :
-{
-P1 = I31(4,1);
-P2 = I211(4, 1, 5);
-P4 = IC(4);
-P5 = I31(4,5);
-P8 = I31(4, 8);
-if (MDL) {
- P0 = I31(4,1);
- P3 = IC(4);
- P6 = I31(4, 6);
- P7 = IC(4);
-} else {
- P0 = I211(4, 1, 3);
- P3 = I31(3, 4);
- P6 = I11(3, 7);
- P7 = I31(4, 7);
-}
-} break;
-case 74 :
-case 107 :
-{
-P2 = I31(4, 2);
-P3 = IC(4);
-P4 = IC(4);
-P5 = I31(4,5);
-P8 = I31(4, 8);
-if (MDL) {
- P6 = IC(4);
- P7 = IC(4);
-} else {
- P6 = I772(3, 7, 4);
- P7 = I71(4, 7);
-}
-if (MUL) {
- P0 = IC(4);
- P1 = IC(4);
-} else {
- P0 = I772(1, 3, 4);
- P1 = I71(4, 1);
-}
-} break;
-case 75 :
-{
-P2 = I31(4, 2);
-P4 = IC(4);
-P5 = I31(4,5);
-P6 = I31(4, 6);
-P7 = IC(4);
-P8 = I31(4, 8);
-if (MUL) {
- P0 = IC(4);
- P1 = IC(4);
- P3 = IC(4);
-} else {
- P0 = I772(1, 3, 4);
- P1 = I71(4, 1);
- P3 = I71(4, 3);
-}
-} break;
-case 78 :
-{
-P1 = IC(4);
-P2 = I31(4,5);
-P3 = IC(4);
-P4 = IC(4);
-P5 = I31(4,5);
-P7 = IC(4);
-P8 = I31(4, 8);
-if (MDL) {
- P6 = I31(4, 6);
-} else {
- P6 = I211(4, 3, 7);
-}
-if (MUL) {
- P0 = I31(4, 0);
-} else {
- P0 = I211(4, 1, 3);
-}
-} break;
-case 79 :
-{
-P2 = I31(4,5);
-P4 = IC(4);
-P5 = I31(4,5);
-P7 = IC(4);
-P8 = I31(4, 8);
-if (MDL) {
- P6 = I31(4, 6);
-} else {
- P6 = I211(4, 3, 7);
-}
-if (MUL) {
- P0 = IC(4);
- P1 = IC(4);
- P3 = IC(4);
-} else {
- P0 = I772(1, 3, 4);
- P1 = I71(4, 1);
- P3 = I71(4, 3);
-}
-} break;
-case 80 :
-case 81 :
-{
-P0 = I211(4, 1, 3);
-P1 = I31(4,1);
-P2 = I31(4, 2);
-P3 = I31(4, 3);
-P4 = IC(4);
-P6 = I31(4, 6);
-if (MDR) {
- P5 = IC(4);
- P7 = IC(4);
- P8 = I31(4, 8);
-} else {
- P5 = I71(4, 5);
- P7 = I71(4, 7);
- P8 = I772(5, 7, 4);
-}
-} break;
-case 82 :
-case 214 :
-{
-P0 = I31(4, 0);
-P3 = I31(4, 3);
-P4 = IC(4);
-P5 = IC(4);
-P6 = I31(4, 6);
-if (MDR) {
- P7 = IC(4);
- P8 = IC(4);
-} else {
- P7 = I71(4, 7);
- P8 = I772(5, 7, 4);
-}
-if (MUR) {
- P1 = IC(4);
- P2 = IC(4);
-} else {
- P1 = I71(4, 1);
- P2 = I772(1, 5, 4);
-}
-} break;
-case 83 :
-{
-P0 = I31(4, 3);
-P1 = IC(4);
-P3 = I31(4, 3);
-P4 = IC(4);
-P5 = IC(4);
-P6 = I31(4, 6);
-P7 = IC(4);
-if (MDR) {
- P8 = I31(4, 8);
-} else {
- P8 = I211(4, 5, 7);
-}
-if (MUR) {
- P2 = I31(4, 2);
-} else {
- P2 = I211(4, 1, 5);
-}
-} break;
-case 84 :
-case 85 :
-{
-P0 = I211(4, 1, 3);
-P1 = I31(4,1);
-P3 = I31(4, 3);
-P4 = IC(4);
-P6 = I31(4, 6);
-if (MDR) {
- P2 = I31(4,1);
- P5 = IC(4);
- P7 = IC(4);
- P8 = I31(4, 8);
-} else {
- P2 = I211(4, 1, 5);
- P5 = I31(5, 4);
- P7 = I31(4, 7);
- P8 = I11(5, 7);
-}
-} break;
-case 86 :
-{
-P0 = I31(4, 0);
-P3 = I31(4, 3);
-P4 = IC(4);
-P6 = I31(4, 6);
-P7 = IC(4);
-P8 = I31(4, 8);
-if (MUR) {
- P1 = IC(4);
- P2 = IC(4);
- P5 = IC(4);
-} else {
- P1 = I71(4, 1);
- P2 = I772(1, 5, 4);
- P5 = I71(4, 5);
-}
-} break;
-case 87 :
-{
-P0 = I31(4, 3);
-P3 = I31(4, 3);
-P4 = IC(4);
-P6 = I31(4, 6);
-P7 = IC(4);
-if (MDR) {
- P8 = I31(4, 8);
-} else {
- P8 = I211(4, 5, 7);
-}
-if (MUR) {
- P1 = IC(4);
- P2 = IC(4);
- P5 = IC(4);
-} else {
- P1 = I71(4, 1);
- P2 = I772(1, 5, 4);
- P5 = I71(4, 5);
-}
-} break;
-case 88 :
-case 248 :
-{
-P0 = I31(4, 0);
-P1 = I31(4,1);
-P2 = I31(4, 2);
-P4 = IC(4);
-P7 = IC(4);
-if (MDL) {
- P3 = IC(4);
- P6 = IC(4);
-} else {
- P3 = I71(4, 3);
- P6 = I772(3, 7, 4);
-}
-if (MDR) {
- P5 = IC(4);
- P8 = IC(4);
-} else {
- P5 = I71(4, 5);
- P8 = I772(5, 7, 4);
-}
-} break;
-case 89 :
-{
-P0 = I31(4,1);
-P1 = I31(4,1);
-P2 = I31(4, 2);
-P3 = IC(4);
-P4 = IC(4);
-P5 = IC(4);
-P7 = IC(4);
-if (MDL) {
- P6 = I31(4, 6);
-} else {
- P6 = I211(4, 3, 7);
-}
-if (MDR) {
- P8 = I31(4, 8);
-} else {
- P8 = I211(4, 5, 7);
-}
-} break;
-case 90 :
-{
-P1 = IC(4);
-P3 = IC(4);
-P4 = IC(4);
-P5 = IC(4);
-P7 = IC(4);
-if (MDL) {
- P6 = I31(4, 6);
-} else {
- P6 = I211(4, 3, 7);
-}
-if (MDR) {
- P8 = I31(4, 8);
-} else {
- P8 = I211(4, 5, 7);
-}
-if (MUL) {
- P0 = I31(4, 0);
-} else {
- P0 = I211(4, 1, 3);
-}
-if (MUR) {
- P2 = I31(4, 2);
-} else {
- P2 = I211(4, 1, 5);
-}
-} break;
-case 91 :
-{
-P4 = IC(4);
-P5 = IC(4);
-P7 = IC(4);
-if (MDL) {
- P6 = I31(4, 6);
-} else {
- P6 = I211(4, 3, 7);
-}
-if (MDR) {
- P8 = I31(4, 8);
-} else {
- P8 = I211(4, 5, 7);
-}
-if (MUL) {
- P0 = IC(4);
- P1 = IC(4);
- P3 = IC(4);
-} else {
- P0 = I772(1, 3, 4);
- P1 = I71(4, 1);
- P3 = I71(4, 3);
-}
-if (MUR) {
- P2 = I31(4, 2);
-} else {
- P2 = I211(4, 1, 5);
-}
-} break;
-case 92 :
-{
-P0 = I31(4, 0);
-P1 = I31(4,1);
-P2 = I31(4,1);
-P3 = IC(4);
-P4 = IC(4);
-P5 = IC(4);
-P7 = IC(4);
-if (MDL) {
- P6 = I31(4, 6);
-} else {
- P6 = I211(4, 3, 7);
-}
-if (MDR) {
- P8 = I31(4, 8);
-} else {
- P8 = I211(4, 5, 7);
-}
-} break;
-case 93 :
-{
-P0 = I31(4,1);
-P1 = I31(4,1);
-P2 = I31(4,1);
-P3 = IC(4);
-P4 = IC(4);
-P5 = IC(4);
-P7 = IC(4);
-if (MDL) {
- P6 = I31(4, 6);
-} else {
- P6 = I211(4, 3, 7);
-}
-if (MDR) {
- P8 = I31(4, 8);
-} else {
- P8 = I211(4, 5, 7);
-}
-} break;
-case 94 :
-{
-P3 = IC(4);
-P4 = IC(4);
-P7 = IC(4);
-if (MDL) {
- P6 = I31(4, 6);
-} else {
- P6 = I211(4, 3, 7);
-}
-if (MDR) {
- P8 = I31(4, 8);
-} else {
- P8 = I211(4, 5, 7);
-}
-if (MUL) {
- P0 = I31(4, 0);
-} else {
- P0 = I211(4, 1, 3);
-}
-if (MUR) {
- P1 = IC(4);
- P2 = IC(4);
- P5 = IC(4);
-} else {
- P1 = I71(4, 1);
- P2 = I772(1, 5, 4);
- P5 = I71(4, 5);
-}
-} break;
-case 95 :
-{
-P1 = IC(4);
-P4 = IC(4);
-P6 = I31(4, 6);
-P7 = IC(4);
-P8 = I31(4, 8);
-if (MUL) {
- P0 = IC(4);
- P3 = IC(4);
-} else {
- P0 = I772(1, 3, 4);
- P3 = I71(4, 3);
-}
-if (MUR) {
- P2 = IC(4);
- P5 = IC(4);
-} else {
- P2 = I772(1, 5, 4);
- P5 = I71(4, 5);
-}
-} break;
-case 96 :
-case 97 :
-case 100 :
-case 101 :
-{
-P0 = I211(4, 1, 3);
-P1 = I31(4,1);
-P2 = I211(4, 1, 5);
-P3 = I31(4, 3);
-P4 = IC(4);
-P5 = I31(4,5);
-P6 = I31(4, 3);
-P7 = IC(4);
-P8 = I31(4, 8);
-} break;
-case 98 :
-{
-P0 = I31(4, 0);
-P1 = IC(4);
-P2 = I31(4, 2);
-P3 = I31(4, 3);
-P4 = IC(4);
-P5 = I31(4,5);
-P6 = I31(4, 3);
-P7 = IC(4);
-P8 = I31(4, 8);
-} break;
-case 99 :
-{
-P0 = I31(4, 3);
-P1 = IC(4);
-P2 = I31(4, 2);
-P3 = I31(4, 3);
-P4 = IC(4);
-P5 = I31(4,5);
-P6 = I31(4, 3);
-P7 = IC(4);
-P8 = I31(4, 8);
-} break;
-case 102 :
-{
-P0 = I31(4, 0);
-P1 = IC(4);
-P2 = I31(4,5);
-P3 = I31(4, 3);
-P4 = IC(4);
-P5 = I31(4,5);
-P6 = I31(4, 3);
-P7 = IC(4);
-P8 = I31(4, 8);
-} break;
-case 103 :
-{
-P0 = I31(4, 3);
-P1 = IC(4);
-P2 = I31(4,5);
-P3 = I31(4, 3);
-P4 = IC(4);
-P5 = I31(4,5);
-P6 = I31(4, 3);
-P7 = IC(4);
-P8 = I31(4, 8);
-} break;
-case 104 :
-case 108 :
-{
-P0 = I31(4, 0);
-P1 = I31(4,1);
-P2 = I211(4, 1, 5);
-P4 = IC(4);
-P5 = I31(4,5);
-P8 = I31(4, 8);
-if (MDL) {
- P3 = IC(4);
- P6 = IC(4);
- P7 = IC(4);
-} else {
- P3 = I71(4, 3);
- P6 = I772(3, 7, 4);
- P7 = I71(4, 7);
-}
-} break;
-case 105 :
-case 109 :
-{
-P1 = I31(4,1);
-P2 = I211(4, 1, 5);
-P4 = IC(4);
-P5 = I31(4,5);
-P8 = I31(4, 8);
-if (MDL) {
- P0 = I31(4,1);
- P3 = IC(4);
- P6 = IC(4);
- P7 = IC(4);
-} else {
- P0 = I211(4, 1, 3);
- P3 = I31(3, 4);
- P6 = I11(3, 7);
- P7 = I31(4, 7);
-}
-} break;
-case 106 :
-{
-P0 = I31(4, 0);
-P1 = IC(4);
-P2 = I31(4, 2);
-P4 = IC(4);
-P5 = I31(4,5);
-P8 = I31(4, 8);
-if (MDL) {
- P3 = IC(4);
- P6 = IC(4);
- P7 = IC(4);
-} else {
- P3 = I71(4, 3);
- P6 = I772(3, 7, 4);
- P7 = I71(4, 7);
-}
-} break;
-case 110 :
-{
-P0 = I31(4, 0);
-P1 = IC(4);
-P2 = I31(4,5);
-P4 = IC(4);
-P5 = I31(4,5);
-P8 = I31(4, 8);
-if (MDL) {
- P3 = IC(4);
- P6 = IC(4);
- P7 = IC(4);
-} else {
- P3 = I71(4, 3);
- P6 = I772(3, 7, 4);
- P7 = I71(4, 7);
-}
-} break;
-case 111 :
-{
-P1 = IC(4);
-P2 = I31(4,5);
-P3 = IC(4);
-P4 = IC(4);
-P5 = I31(4,5);
-P8 = I31(4, 8);
-if (MDL) {
- P6 = IC(4);
- P7 = IC(4);
-} else {
- P6 = I772(3, 7, 4);
- P7 = I71(4, 7);
-}
-if (MUL) {
- P0 = IC(4);
-} else {
- P0 = I211(4, 1, 3);
-}
-} break;
-case 112 :
-case 113 :
-{
-P0 = I211(4, 1, 3);
-P1 = I31(4,1);
-P2 = I31(4, 2);
-P3 = I31(4, 3);
-P4 = IC(4);
-if (MDR) {
- P5 = IC(4);
- P6 = I31(4, 3);
- P7 = IC(4);
- P8 = I31(4, 8);
-} else {
- P5 = I31(4,5);
- P6 = I211(4, 3, 7);
- P7 = I31(7, 4);
- P8 = I11(5, 7);
-}
-} break;
-case 114 :
-{
-P0 = I31(4, 0);
-P1 = IC(4);
-P3 = I31(4, 3);
-P4 = IC(4);
-P5 = IC(4);
-P6 = I31(4, 3);
-P7 = IC(4);
-if (MDR) {
- P8 = I31(4, 8);
-} else {
- P8 = I211(4, 5, 7);
-}
-if (MUR) {
- P2 = I31(4, 2);
-} else {
- P2 = I211(4, 1, 5);
-}
-} break;
-case 115 :
-{
-P0 = I31(4, 3);
-P1 = IC(4);
-P3 = I31(4, 3);
-P4 = IC(4);
-P5 = IC(4);
-P6 = I31(4, 3);
-P7 = IC(4);
-if (MDR) {
- P8 = I31(4, 8);
-} else {
- P8 = I211(4, 5, 7);
-}
-if (MUR) {
- P2 = I31(4, 2);
-} else {
- P2 = I211(4, 1, 5);
-}
-} break;
-case 116 :
-case 117 :
-{
-P0 = I211(4, 1, 3);
-P1 = I31(4,1);
-P2 = I31(4,1);
-P3 = I31(4, 3);
-P4 = IC(4);
-P5 = IC(4);
-P6 = I31(4, 3);
-P7 = IC(4);
-if (MDR) {
- P8 = I31(4, 8);
-} else {
- P8 = I211(4, 5, 7);
-}
-} break;
-case 118 :
-{
-P0 = I31(4, 0);
-P3 = I31(4, 3);
-P4 = IC(4);
-P6 = I31(4, 3);
-P7 = IC(4);
-P8 = I31(4, 8);
-if (MUR) {
- P1 = IC(4);
- P2 = IC(4);
- P5 = IC(4);
-} else {
- P1 = I71(4, 1);
- P2 = I772(1, 5, 4);
- P5 = I71(4, 5);
-}
-} break;
-case 119 :
-{
-P3 = I31(4, 3);
-P4 = IC(4);
-P6 = I31(4, 3);
-P7 = IC(4);
-P8 = I31(4, 8);
-if (MUR) {
- P0 = I31(4, 3);
- P1 = IC(4);
- P2 = IC(4);
- P5 = IC(4);
-} else {
- P0 = I211(4, 1, 3);
- P1 = I31(1, 4);
- P2 = I11(1, 5);
- P5 = I31(4,5);
-}
-} break;
-case 120 :
-{
-P0 = I31(4, 0);
-P1 = I31(4,1);
-P2 = I31(4, 2);
-P4 = IC(4);
-P5 = IC(4);
-P8 = I31(4, 8);
-if (MDL) {
- P3 = IC(4);
- P6 = IC(4);
- P7 = IC(4);
-} else {
- P3 = I71(4, 3);
- P6 = I772(3, 7, 4);
- P7 = I71(4, 7);
-}
-} break;
-case 121 :
-{
-P0 = I31(4,1);
-P1 = I31(4,1);
-P2 = I31(4, 2);
-P4 = IC(4);
-P5 = IC(4);
-if (MDL) {
- P3 = IC(4);
- P6 = IC(4);
- P7 = IC(4);
-} else {
- P3 = I71(4, 3);
- P6 = I772(3, 7, 4);
- P7 = I71(4, 7);
-}
-if (MDR) {
- P8 = I31(4, 8);
-} else {
- P8 = I211(4, 5, 7);
-}
-} break;
-case 122 :
-{
-P1 = IC(4);
-P4 = IC(4);
-P5 = IC(4);
-if (MDL) {
- P3 = IC(4);
- P6 = IC(4);
- P7 = IC(4);
-} else {
- P3 = I71(4, 3);
- P6 = I772(3, 7, 4);
- P7 = I71(4, 7);
-}
-if (MDR) {
- P8 = I31(4, 8);
-} else {
- P8 = I211(4, 5, 7);
-}
-if (MUL) {
- P0 = I31(4, 0);
-} else {
- P0 = I211(4, 1, 3);
-}
-if (MUR) {
- P2 = I31(4, 2);
-} else {
- P2 = I211(4, 1, 5);
-}
-} break;
-case 123 :
-{
-P2 = I31(4, 2);
-P3 = IC(4);
-P4 = IC(4);
-P5 = IC(4);
-P8 = I31(4, 8);
-if (MDL) {
- P6 = IC(4);
- P7 = IC(4);
-} else {
- P6 = I772(3, 7, 4);
- P7 = I71(4, 7);
-}
-if (MUL) {
- P0 = IC(4);
- P1 = IC(4);
-} else {
- P0 = I772(1, 3, 4);
- P1 = I71(4, 1);
-}
-} break;
-case 124 :
-{
-P0 = I31(4, 0);
-P1 = I31(4,1);
-P2 = I31(4,1);
-P4 = IC(4);
-P5 = IC(4);
-P8 = I31(4, 8);
-if (MDL) {
- P3 = IC(4);
- P6 = IC(4);
- P7 = IC(4);
-} else {
- P3 = I71(4, 3);
- P6 = I772(3, 7, 4);
- P7 = I71(4, 7);
-}
-} break;
-case 125 :
-{
-P1 = I31(4,1);
-P2 = I31(4,1);
-P4 = IC(4);
-P5 = IC(4);
-P8 = I31(4, 8);
-if (MDL) {
- P0 = I31(4,1);
- P3 = IC(4);
- P6 = IC(4);
- P7 = IC(4);
-} else {
- P0 = I211(4, 1, 3);
- P3 = I31(3, 4);
- P6 = I11(3, 7);
- P7 = I31(4, 7);
-}
-} break;
-case 126 :
-{
-P0 = I31(4, 0);
-P4 = IC(4);
-P8 = I31(4, 8);
-if (MDL) {
- P3 = IC(4);
- P6 = IC(4);
- P7 = IC(4);
-} else {
- P3 = I71(4, 3);
- P6 = I772(3, 7, 4);
- P7 = I71(4, 7);
-}
-if (MUR) {
- P1 = IC(4);
- P2 = IC(4);
- P5 = IC(4);
-} else {
- P1 = I71(4, 1);
- P2 = I772(1, 5, 4);
- P5 = I71(4, 5);
-}
-} break;
-case 127 :
-{
-P4 = IC(4);
-P8 = I31(4, 8);
-if (MDL) {
- P6 = IC(4);
- P7 = IC(4);
-} else {
- P6 = I772(3, 7, 4);
- P7 = I71(4, 7);
-}
-if (MUL) {
- P0 = IC(4);
- P1 = IC(4);
- P3 = IC(4);
-} else {
- P0 = I211(4, 1, 3);
- P1 = I71(4, 1);
- P3 = I71(4, 3);
-}
-if (MUR) {
- P2 = IC(4);
- P5 = IC(4);
-} else {
- P2 = I772(1, 5, 4);
- P5 = I71(4, 5);
-}
-} break;
-case 144 :
-case 145 :
-case 176 :
-case 177 :
-{
-P0 = I211(4, 1, 3);
-P1 = I31(4,1);
-P2 = I31(4, 2);
-P3 = I31(4, 3);
-P4 = IC(4);
-P5 = IC(4);
-P6 = I211(4, 3, 7);
-P7 = I31(4, 7);
-P8 = I31(4, 7);
-} break;
-case 146 :
-case 178 :
-{
-P0 = I31(4, 0);
-P3 = I31(4, 3);
-P4 = IC(4);
-P6 = I211(4, 3, 7);
-P7 = I31(4, 7);
-if (MUR) {
- P1 = IC(4);
- P2 = I31(4, 2);
- P5 = IC(4);
- P8 = I31(4, 7);
-} else {
- P1 = I31(4,1);
- P2 = I11(1, 5);
- P5 = I31(5, 4);
- P8 = I211(4, 5, 7);
-}
-} break;
-case 147 :
-case 179 :
-{
-P0 = I31(4, 3);
-P1 = IC(4);
-P3 = I31(4, 3);
-P4 = IC(4);
-P5 = IC(4);
-P6 = I211(4, 3, 7);
-P7 = I31(4, 7);
-P8 = I31(4, 7);
-if (MUR) {
- P2 = I31(4, 2);
-} else {
- P2 = I211(4, 1, 5);
-}
-} break;
-case 148 :
-case 149 :
-case 180 :
-case 181 :
-{
-P0 = I211(4, 1, 3);
-P1 = I31(4,1);
-P2 = I31(4,1);
-P3 = I31(4, 3);
-P4 = IC(4);
-P5 = IC(4);
-P6 = I211(4, 3, 7);
-P7 = I31(4, 7);
-P8 = I31(4, 7);
-} break;
-case 150 :
-case 182 :
-{
-P0 = I31(4, 0);
-P3 = I31(4, 3);
-P4 = IC(4);
-P6 = I211(4, 3, 7);
-P7 = I31(4, 7);
-if (MUR) {
- P1 = IC(4);
- P2 = IC(4);
- P5 = IC(4);
- P8 = I31(4, 7);
-} else {
- P1 = I31(4,1);
- P2 = I11(1, 5);
- P5 = I31(5, 4);
- P8 = I211(4, 5, 7);
-}
-} break;
-case 151 :
-case 183 :
-{
-P0 = I31(4, 3);
-P1 = IC(4);
-P3 = I31(4, 3);
-P4 = IC(4);
-P5 = IC(4);
-P6 = I211(4, 3, 7);
-P7 = I31(4, 7);
-P8 = I31(4, 7);
-if (MUR) {
- P2 = IC(4);
-} else {
- P2 = I211(4, 1, 5);
-}
-} break;
-case 152 :
-{
-P0 = I31(4, 0);
-P1 = I31(4,1);
-P2 = I31(4, 2);
-P3 = IC(4);
-P4 = IC(4);
-P5 = IC(4);
-P6 = I31(4, 6);
-P7 = I31(4, 7);
-P8 = I31(4, 7);
-} break;
-case 153 :
-{
-P0 = I31(4,1);
-P1 = I31(4,1);
-P2 = I31(4, 2);
-P3 = IC(4);
-P4 = IC(4);
-P5 = IC(4);
-P6 = I31(4, 6);
-P7 = I31(4, 7);
-P8 = I31(4, 7);
-} break;
-case 154 :
-{
-P1 = IC(4);
-P3 = IC(4);
-P4 = IC(4);
-P5 = IC(4);
-P6 = I31(4, 6);
-P7 = I31(4, 7);
-P8 = I31(4, 7);
-if (MUL) {
- P0 = I31(4, 0);
-} else {
- P0 = I211(4, 1, 3);
-}
-if (MUR) {
- P2 = I31(4, 2);
-} else {
- P2 = I211(4, 1, 5);
-}
-} break;
-case 155 :
-{
-P2 = I31(4, 2);
-P4 = IC(4);
-P5 = IC(4);
-P6 = I31(4, 6);
-P7 = I31(4, 7);
-P8 = I31(4, 7);
-if (MUL) {
- P0 = IC(4);
- P1 = IC(4);
- P3 = IC(4);
-} else {
- P0 = I772(1, 3, 4);
- P1 = I71(4, 1);
- P3 = I71(4, 3);
-}
-} break;
-case 156 :
-{
-P0 = I31(4, 0);
-P1 = I31(4,1);
-P2 = I31(4,1);
-P3 = IC(4);
-P4 = IC(4);
-P5 = IC(4);
-P6 = I31(4, 6);
-P7 = I31(4, 7);
-P8 = I31(4, 7);
-} break;
-case 157 :
-{
-P0 = I31(4,1);
-P1 = I31(4,1);
-P2 = I31(4,1);
-P3 = IC(4);
-P4 = IC(4);
-P5 = IC(4);
-P6 = I31(4, 6);
-P7 = I31(4, 7);
-P8 = I31(4, 7);
-} break;
-case 158 :
-{
-P3 = IC(4);
-P4 = IC(4);
-P6 = I31(4, 6);
-P7 = I31(4, 7);
-P8 = I31(4, 7);
-if (MUL) {
- P0 = I31(4, 0);
-} else {
- P0 = I211(4, 1, 3);
-}
-if (MUR) {
- P1 = IC(4);
- P2 = IC(4);
- P5 = IC(4);
-} else {
- P1 = I71(4, 1);
- P2 = I772(1, 5, 4);
- P5 = I71(4, 5);
-}
-} break;
-case 159 :
-{
-P1 = IC(4);
-P4 = IC(4);
-P5 = IC(4);
-P6 = I31(4, 6);
-P7 = I31(4, 7);
-P8 = I31(4, 7);
-if (MUL) {
- P0 = IC(4);
- P3 = IC(4);
-} else {
- P0 = I772(1, 3, 4);
- P3 = I71(4, 3);
-}
-if (MUR) {
- P2 = IC(4);
-} else {
- P2 = I211(4, 1, 5);
-}
-} break;
-case 184 :
-{
-P0 = I31(4, 0);
-P1 = I31(4,1);
-P2 = I31(4, 2);
-P3 = IC(4);
-P4 = IC(4);
-P5 = IC(4);
-P6 = I31(4, 7);
-P7 = I31(4, 7);
-P8 = I31(4, 7);
-} break;
-case 185 :
-{
-P0 = I31(4,1);
-P1 = I31(4,1);
-P2 = I31(4, 2);
-P3 = IC(4);
-P4 = IC(4);
-P5 = IC(4);
-P6 = I31(4, 7);
-P7 = I31(4, 7);
-P8 = I31(4, 7);
-} break;
-case 186 :
-{
-P1 = IC(4);
-P3 = IC(4);
-P4 = IC(4);
-P5 = IC(4);
-P6 = I31(4, 7);
-P7 = I31(4, 7);
-P8 = I31(4, 7);
-if (MUL) {
- P0 = I31(4, 0);
-} else {
- P0 = I211(4, 1, 3);
-}
-if (MUR) {
- P2 = I31(4, 2);
-} else {
- P2 = I211(4, 1, 5);
-}
-} break;
-case 187 :
-{
-P2 = I31(4, 2);
-P4 = IC(4);
-P5 = IC(4);
-P7 = I31(4, 7);
-P8 = I31(4, 7);
-if (MUL) {
- P0 = IC(4);
- P1 = IC(4);
- P3 = IC(4);
- P6 = I31(4, 7);
-} else {
- P0 = I11(1, 3);
- P1 = I31(4,1);
- P3 = I31(3, 4);
- P6 = I211(4, 3, 7);
-}
-} break;
-case 188 :
-{
-P0 = I31(4, 0);
-P1 = I31(4,1);
-P2 = I31(4,1);
-P3 = IC(4);
-P4 = IC(4);
-P5 = IC(4);
-P6 = I31(4, 7);
-P7 = I31(4, 7);
-P8 = I31(4, 7);
-} break;
-case 189 :
-{
-P0 = I31(4,1);
-P1 = I31(4,1);
-P2 = I31(4,1);
-P3 = IC(4);
-P4 = IC(4);
-P5 = IC(4);
-P6 = I31(4, 7);
-P7 = I31(4, 7);
-P8 = I31(4, 7);
-} break;
-case 190 :
-{
-P0 = I31(4, 0);
-P3 = IC(4);
-P4 = IC(4);
-P6 = I31(4, 7);
-P7 = I31(4, 7);
-if (MUR) {
- P1 = IC(4);
- P2 = IC(4);
- P5 = IC(4);
- P8 = I31(4, 7);
-} else {
- P1 = I31(4,1);
- P2 = I11(1, 5);
- P5 = I31(5, 4);
- P8 = I211(4, 5, 7);
-}
-} break;
-case 191 :
-{
-P1 = IC(4);
-P3 = IC(4);
-P4 = IC(4);
-P5 = IC(4);
-P6 = I31(4, 7);
-P7 = I31(4, 7);
-P8 = I31(4, 7);
-if (MUL) {
- P0 = IC(4);
-} else {
- P0 = I211(4, 1, 3);
-}
-if (MUR) {
- P2 = IC(4);
-} else {
- P2 = I211(4, 1, 5);
-}
-} break;
-case 192 :
-case 193 :
-case 196 :
-case 197 :
-{
-P0 = I211(4, 1, 3);
-P1 = I31(4,1);
-P2 = I211(4, 1, 5);
-P3 = I31(4, 3);
-P4 = IC(4);
-P5 = I31(4,5);
-P6 = I31(4, 6);
-P7 = IC(4);
-P8 = I31(4,5);
-} break;
-case 194 :
-{
-P0 = I31(4, 0);
-P1 = IC(4);
-P2 = I31(4, 2);
-P3 = I31(4, 3);
-P4 = IC(4);
-P5 = I31(4,5);
-P6 = I31(4, 6);
-P7 = IC(4);
-P8 = I31(4,5);
-} break;
-case 195 :
-{
-P0 = I31(4, 3);
-P1 = IC(4);
-P2 = I31(4, 2);
-P3 = I31(4, 3);
-P4 = IC(4);
-P5 = I31(4,5);
-P6 = I31(4, 6);
-P7 = IC(4);
-P8 = I31(4,5);
-} break;
-case 198 :
-{
-P0 = I31(4, 0);
-P1 = IC(4);
-P2 = I31(4,5);
-P3 = I31(4, 3);
-P4 = IC(4);
-P5 = I31(4,5);
-P6 = I31(4, 6);
-P7 = IC(4);
-P8 = I31(4,5);
-} break;
-case 199 :
-{
-P0 = I31(4, 3);
-P1 = IC(4);
-P2 = I31(4,5);
-P3 = I31(4, 3);
-P4 = IC(4);
-P5 = I31(4,5);
-P6 = I31(4, 6);
-P7 = IC(4);
-P8 = I31(4,5);
-} break;
-case 200 :
-case 204 :
-{
-P0 = I31(4, 0);
-P1 = I31(4,1);
-P2 = I211(4, 1, 5);
-P4 = IC(4);
-P5 = I31(4,5);
-if (MDL) {
- P3 = IC(4);
- P6 = I31(4, 6);
- P7 = IC(4);
- P8 = I31(4,5);
-} else {
- P3 = I31(4, 3);
- P6 = I11(3, 7);
- P7 = I31(7, 4);
- P8 = I211(4, 5, 7);
-}
-} break;
-case 201 :
-case 205 :
-{
-P0 = I31(4,1);
-P1 = I31(4,1);
-P2 = I211(4, 1, 5);
-P3 = IC(4);
-P4 = IC(4);
-P5 = I31(4,5);
-P7 = IC(4);
-P8 = I31(4,5);
-if (MDL) {
- P6 = I31(4, 6);
-} else {
- P6 = I211(4, 3, 7);
-}
-} break;
-case 202 :
-{
-P1 = IC(4);
-P2 = I31(4, 2);
-P3 = IC(4);
-P4 = IC(4);
-P5 = I31(4,5);
-P7 = IC(4);
-P8 = I31(4,5);
-if (MDL) {
- P6 = I31(4, 6);
-} else {
- P6 = I211(4, 3, 7);
-}
-if (MUL) {
- P0 = I31(4, 0);
-} else {
- P0 = I211(4, 1, 3);
-}
-} break;
-case 203 :
-{
-P2 = I31(4, 2);
-P4 = IC(4);
-P5 = I31(4,5);
-P6 = I31(4, 6);
-P7 = IC(4);
-P8 = I31(4,5);
-if (MUL) {
- P0 = IC(4);
- P1 = IC(4);
- P3 = IC(4);
-} else {
- P0 = I772(1, 3, 4);
- P1 = I71(4, 1);
- P3 = I71(4, 3);
-}
-} break;
-case 206 :
-{
-P1 = IC(4);
-P2 = I31(4,5);
-P3 = IC(4);
-P4 = IC(4);
-P5 = I31(4,5);
-P7 = IC(4);
-P8 = I31(4,5);
-if (MDL) {
- P6 = I31(4, 6);
-} else {
- P6 = I211(4, 3, 7);
-}
-if (MUL) {
- P0 = I31(4, 0);
-} else {
- P0 = I211(4, 1, 3);
-}
-} break;
-case 207 :
-{
-P4 = IC(4);
-P5 = I31(4,5);
-P6 = I31(4, 6);
-P7 = IC(4);
-P8 = I31(4,5);
-if (MUL) {
- P0 = IC(4);
- P1 = IC(4);
- P2 = I31(4,5);
- P3 = IC(4);
-} else {
- P0 = I11(1, 3);
- P1 = I31(1, 4);
- P2 = I211(4, 1, 5);
- P3 = I31(4, 3);
-}
-} break;
-case 208 :
-case 209 :
-{
-P0 = I211(4, 1, 3);
-P1 = I31(4,1);
-P2 = I31(4, 2);
-P3 = I31(4, 3);
-P4 = IC(4);
-P6 = I31(4, 6);
-if (MDR) {
- P5 = IC(4);
- P7 = IC(4);
- P8 = IC(4);
-} else {
- P5 = I71(4, 5);
- P7 = I71(4, 7);
- P8 = I772(5, 7, 4);
-}
-} break;
-case 210 :
-{
-P0 = I31(4, 0);
-P1 = IC(4);
-P2 = I31(4, 2);
-P3 = I31(4, 3);
-P4 = IC(4);
-P6 = I31(4, 6);
-if (MDR) {
- P5 = IC(4);
- P7 = IC(4);
- P8 = IC(4);
-} else {
- P5 = I71(4, 5);
- P7 = I71(4, 7);
- P8 = I772(5, 7, 4);
-}
-} break;
-case 211 :
-{
-P0 = I31(4, 3);
-P1 = IC(4);
-P2 = I31(4, 2);
-P3 = I31(4, 3);
-P4 = IC(4);
-P6 = I31(4, 6);
-if (MDR) {
- P5 = IC(4);
- P7 = IC(4);
- P8 = IC(4);
-} else {
- P5 = I71(4, 5);
- P7 = I71(4, 7);
- P8 = I772(5, 7, 4);
-}
-} break;
-case 212 :
-case 213 :
-{
-P0 = I211(4, 1, 3);
-P1 = I31(4,1);
-P3 = I31(4, 3);
-P4 = IC(4);
-P6 = I31(4, 6);
-if (MDR) {
- P2 = I31(4,1);
- P5 = IC(4);
- P7 = IC(4);
- P8 = IC(4);
-} else {
- P2 = I211(4, 1, 5);
- P5 = I31(5, 4);
- P7 = I31(4, 7);
- P8 = I11(5, 7);
-}
-} break;
-case 215 :
-{
-P0 = I31(4, 3);
-P1 = IC(4);
-P3 = I31(4, 3);
-P4 = IC(4);
-P5 = IC(4);
-P6 = I31(4, 6);
-if (MDR) {
- P7 = IC(4);
- P8 = IC(4);
-} else {
- P7 = I71(4, 7);
- P8 = I772(5, 7, 4);
-}
-if (MUR) {
- P2 = IC(4);
-} else {
- P2 = I211(4, 1, 5);
-}
-} break;
-case 216 :
-{
-P0 = I31(4, 0);
-P1 = I31(4,1);
-P2 = I31(4, 2);
-P3 = IC(4);
-P4 = IC(4);
-P6 = I31(4, 6);
-if (MDR) {
- P5 = IC(4);
- P7 = IC(4);
- P8 = IC(4);
-} else {
- P5 = I71(4, 5);
- P7 = I71(4, 7);
- P8 = I772(5, 7, 4);
-}
-} break;
-case 217 :
-{
-P0 = I31(4,1);
-P1 = I31(4,1);
-P2 = I31(4, 2);
-P3 = IC(4);
-P4 = IC(4);
-P6 = I31(4, 6);
-if (MDR) {
- P5 = IC(4);
- P7 = IC(4);
- P8 = IC(4);
-} else {
- P5 = I71(4, 5);
- P7 = I71(4, 7);
- P8 = I772(5, 7, 4);
-}
-} break;
-case 218 :
-{
-P1 = IC(4);
-P3 = IC(4);
-P4 = IC(4);
-if (MDL) {
- P6 = I31(4, 6);
-} else {
- P6 = I211(4, 3, 7);
-}
-if (MDR) {
- P5 = IC(4);
- P7 = IC(4);
- P8 = IC(4);
-} else {
- P5 = I71(4, 5);
- P7 = I71(4, 7);
- P8 = I772(5, 7, 4);
-}
-if (MUL) {
- P0 = I31(4, 0);
-} else {
- P0 = I211(4, 1, 3);
-}
-if (MUR) {
- P2 = I31(4, 2);
-} else {
- P2 = I211(4, 1, 5);
-}
-} break;
-case 219 :
-{
-P2 = I31(4, 2);
-P4 = IC(4);
-P6 = I31(4, 6);
-if (MDR) {
- P5 = IC(4);
- P7 = IC(4);
- P8 = IC(4);
-} else {
- P5 = I71(4, 5);
- P7 = I71(4, 7);
- P8 = I772(5, 7, 4);
-}
-if (MUL) {
- P0 = IC(4);
- P1 = IC(4);
- P3 = IC(4);
-} else {
- P0 = I772(1, 3, 4);
- P1 = I71(4, 1);
- P3 = I71(4, 3);
-}
-} break;
-case 220 :
-{
-P0 = I31(4, 0);
-P1 = I31(4,1);
-P2 = I31(4,1);
-P3 = IC(4);
-P4 = IC(4);
-if (MDL) {
- P6 = I31(4, 6);
-} else {
- P6 = I211(4, 3, 7);
-}
-if (MDR) {
- P5 = IC(4);
- P7 = IC(4);
- P8 = IC(4);
-} else {
- P5 = I71(4, 5);
- P7 = I71(4, 7);
- P8 = I772(5, 7, 4);
-}
-} break;
-case 221 :
-{
-P0 = I31(4,1);
-P1 = I31(4,1);
-P3 = IC(4);
-P4 = IC(4);
-P6 = I31(4, 6);
-if (MDR) {
- P2 = I31(4,1);
- P5 = IC(4);
- P7 = IC(4);
- P8 = IC(4);
-} else {
- P2 = I211(4, 1, 5);
- P5 = I31(5, 4);
- P7 = I31(4, 7);
- P8 = I11(5, 7);
-}
-} break;
-case 222 :
-{
-P0 = I31(4, 0);
-P3 = IC(4);
-P4 = IC(4);
-P5 = IC(4);
-P6 = I31(4, 6);
-if (MDR) {
- P7 = IC(4);
- P8 = IC(4);
-} else {
- P7 = I71(4, 7);
- P8 = I772(5, 7, 4);
-}
-if (MUR) {
- P1 = IC(4);
- P2 = IC(4);
-} else {
- P1 = I71(4, 1);
- P2 = I772(1, 5, 4);
-}
-} break;
-case 223 :
-{
-P4 = IC(4);
-P6 = I31(4, 6);
-if (MDR) {
- P7 = IC(4);
- P8 = IC(4);
-} else {
- P7 = I71(4, 7);
- P8 = I772(5, 7, 4);
-}
-if (MUL) {
- P0 = IC(4);
- P3 = IC(4);
-} else {
- P0 = I772(1, 3, 4);
- P3 = I71(4, 3);
-}
-if (MUR) {
- P1 = IC(4);
- P2 = IC(4);
- P5 = IC(4);
-} else {
- P1 = I71(4, 1);
- P2 = I211(4, 1, 5);
- P5 = I71(4, 5);
-}
-} break;
-case 224 :
-case 225 :
-case 228 :
-case 229 :
-{
-P0 = I211(4, 1, 3);
-P1 = I31(4,1);
-P2 = I211(4, 1, 5);
-P3 = I31(4, 3);
-P4 = IC(4);
-P5 = I31(4,5);
-P6 = I31(4, 3);
-P7 = IC(4);
-P8 = I31(4,5);
-} break;
-case 226 :
-{
-P0 = I31(4, 0);
-P1 = IC(4);
-P2 = I31(4, 2);
-P3 = I31(4, 3);
-P4 = IC(4);
-P5 = I31(4,5);
-P6 = I31(4, 3);
-P7 = IC(4);
-P8 = I31(4,5);
-} break;
-case 227 :
-{
-P0 = I31(4, 3);
-P1 = IC(4);
-P2 = I31(4, 2);
-P3 = I31(4, 3);
-P4 = IC(4);
-P5 = I31(4,5);
-P6 = I31(4, 3);
-P7 = IC(4);
-P8 = I31(4,5);
-} break;
-case 230 :
-{
-P0 = I31(4, 0);
-P1 = IC(4);
-P2 = I31(4,5);
-P3 = I31(4, 3);
-P4 = IC(4);
-P5 = I31(4,5);
-P6 = I31(4, 3);
-P7 = IC(4);
-P8 = I31(4,5);
-} break;
-case 231 :
-{
-P0 = I31(4, 3);
-P1 = IC(4);
-P2 = I31(4,5);
-P3 = I31(4, 3);
-P4 = IC(4);
-P5 = I31(4,5);
-P6 = I31(4, 3);
-P7 = IC(4);
-P8 = I31(4,5);
-} break;
-case 232 :
-case 236 :
-{
-P0 = I31(4, 0);
-P1 = I31(4,1);
-P2 = I211(4, 1, 5);
-P4 = IC(4);
-P5 = I31(4,5);
-if (MDL) {
- P3 = IC(4);
- P6 = IC(4);
- P7 = IC(4);
- P8 = I31(4,5);
-} else {
- P3 = I31(4, 3);
- P6 = I11(3, 7);
- P7 = I31(7, 4);
- P8 = I211(4, 5, 7);
-}
-} break;
-case 233 :
-case 237 :
-{
-P0 = I31(4,1);
-P1 = I31(4,1);
-P2 = I211(4, 1, 5);
-P3 = IC(4);
-P4 = IC(4);
-P5 = I31(4,5);
-P7 = IC(4);
-P8 = I31(4,5);
-if (MDL) {
- P6 = IC(4);
-} else {
- P6 = I211(4, 3, 7);
-}
-} break;
-case 234 :
-{
-P1 = IC(4);
-P2 = I31(4, 2);
-P4 = IC(4);
-P5 = I31(4,5);
-P8 = I31(4,5);
-if (MDL) {
- P3 = IC(4);
- P6 = IC(4);
- P7 = IC(4);
-} else {
- P3 = I71(4, 3);
- P6 = I772(3, 7, 4);
- P7 = I71(4, 7);
-}
-if (MUL) {
- P0 = I31(4, 0);
-} else {
- P0 = I211(4, 1, 3);
-}
-} break;
-case 235 :
-{
-P2 = I31(4, 2);
-P3 = IC(4);
-P4 = IC(4);
-P5 = I31(4,5);
-P7 = IC(4);
-P8 = I31(4,5);
-if (MDL) {
- P6 = IC(4);
-} else {
- P6 = I211(4, 3, 7);
-}
-if (MUL) {
- P0 = IC(4);
- P1 = IC(4);
-} else {
- P0 = I772(1, 3, 4);
- P1 = I71(4, 1);
-}
-} break;
-case 238 :
-{
-P0 = I31(4, 0);
-P1 = IC(4);
-P2 = I31(4,5);
-P4 = IC(4);
-P5 = I31(4,5);
-if (MDL) {
- P3 = IC(4);
- P6 = IC(4);
- P7 = IC(4);
- P8 = I31(4,5);
-} else {
- P3 = I31(4, 3);
- P6 = I11(3, 7);
- P7 = I31(7, 4);
- P8 = I211(4, 5, 7);
-}
-} break;
-case 239 :
-{
-P1 = IC(4);
-P2 = I31(4,5);
-P3 = IC(4);
-P4 = IC(4);
-P5 = I31(4,5);
-P7 = IC(4);
-P8 = I31(4,5);
-if (MDL) {
- P6 = IC(4);
-} else {
- P6 = I211(4, 3, 7);
-}
-if (MUL) {
- P0 = IC(4);
-} else {
- P0 = I211(4, 1, 3);
-}
-} break;
-case 240 :
-case 241 :
-{
-P0 = I211(4, 1, 3);
-P1 = I31(4,1);
-P2 = I31(4, 2);
-P3 = I31(4, 3);
-P4 = IC(4);
-if (MDR) {
- P5 = IC(4);
- P6 = I31(4, 3);
- P7 = IC(4);
- P8 = IC(4);
-} else {
- P5 = I31(4,5);
- P6 = I211(4, 3, 7);
- P7 = I31(7, 4);
- P8 = I11(5, 7);
-}
-} break;
-case 242 :
-{
-P0 = I31(4, 0);
-P1 = IC(4);
-P3 = I31(4, 3);
-P4 = IC(4);
-P6 = I31(4, 3);
-if (MDR) {
- P5 = IC(4);
- P7 = IC(4);
- P8 = IC(4);
-} else {
- P5 = I71(4, 5);
- P7 = I71(4, 7);
- P8 = I772(5, 7, 4);
-}
-if (MUR) {
- P2 = I31(4, 2);
-} else {
- P2 = I211(4, 1, 5);
-}
-} break;
-case 243 :
-{
-P0 = I31(4, 3);
-P1 = IC(4);
-P2 = I31(4, 2);
-P3 = I31(4, 3);
-P4 = IC(4);
-if (MDR) {
- P5 = IC(4);
- P6 = I31(4, 3);
- P7 = IC(4);
- P8 = IC(4);
-} else {
- P5 = I31(4,5);
- P6 = I211(4, 3, 7);
- P7 = I31(7, 4);
- P8 = I11(5, 7);
-}
-} break;
-case 244 :
-case 245 :
-{
-P0 = I211(4, 1, 3);
-P1 = I31(4,1);
-P2 = I31(4,1);
-P3 = I31(4, 3);
-P4 = IC(4);
-P5 = IC(4);
-P6 = I31(4, 3);
-P7 = IC(4);
-if (MDR) {
- P8 = IC(4);
-} else {
- P8 = I211(4, 5, 7);
-}
-} break;
-case 246 :
-{
-P0 = I31(4, 0);
-P3 = I31(4, 3);
-P4 = IC(4);
-P5 = IC(4);
-P6 = I31(4, 3);
-P7 = IC(4);
-if (MDR) {
- P8 = IC(4);
-} else {
- P8 = I211(4, 5, 7);
-}
-if (MUR) {
- P1 = IC(4);
- P2 = IC(4);
-} else {
- P1 = I71(4, 1);
- P2 = I772(1, 5, 4);
-}
-} break;
-case 247 :
-{
-P0 = I31(4, 3);
-P1 = IC(4);
-P3 = I31(4, 3);
-P4 = IC(4);
-P5 = IC(4);
-P6 = I31(4, 3);
-P7 = IC(4);
-if (MDR) {
- P8 = IC(4);
-} else {
- P8 = I211(4, 5, 7);
-}
-if (MUR) {
- P2 = IC(4);
-} else {
- P2 = I211(4, 1, 5);
-}
-} break;
-case 249 :
-{
-P0 = I31(4,1);
-P1 = I31(4,1);
-P2 = I31(4, 2);
-P3 = IC(4);
-P4 = IC(4);
-P7 = IC(4);
-if (MDL) {
- P6 = IC(4);
-} else {
- P6 = I211(4, 3, 7);
-}
-if (MDR) {
- P5 = IC(4);
- P8 = IC(4);
-} else {
- P5 = I71(4, 5);
- P8 = I772(5, 7, 4);
-}
-} break;
-case 250 :
-{
-P0 = I31(4, 0);
-P1 = IC(4);
-P2 = I31(4, 2);
-P4 = IC(4);
-P7 = IC(4);
-if (MDL) {
- P3 = IC(4);
- P6 = IC(4);
-} else {
- P3 = I71(4, 3);
- P6 = I772(3, 7, 4);
-}
-if (MDR) {
- P5 = IC(4);
- P8 = IC(4);
-} else {
- P5 = I71(4, 5);
- P8 = I772(5, 7, 4);
-}
-} break;
-case 251 :
-{
-P2 = I31(4, 2);
-P4 = IC(4);
-if (MDL) {
- P3 = IC(4);
- P6 = IC(4);
- P7 = IC(4);
-} else {
- P3 = I71(4, 3);
- P6 = I211(4, 3, 7);
- P7 = I71(4, 7);
-}
-if (MDR) {
- P5 = IC(4);
- P8 = IC(4);
-} else {
- P5 = I71(4, 5);
- P8 = I772(5, 7, 4);
-}
-if (MUL) {
- P0 = IC(4);
- P1 = IC(4);
-} else {
- P0 = I772(1, 3, 4);
- P1 = I71(4, 1);
-}
-} break;
-case 252 :
-{
-P0 = I31(4, 0);
-P1 = I31(4,1);
-P2 = I31(4,1);
-P4 = IC(4);
-P5 = IC(4);
-P7 = IC(4);
-if (MDL) {
- P3 = IC(4);
- P6 = IC(4);
-} else {
- P3 = I71(4, 3);
- P6 = I772(3, 7, 4);
-}
-if (MDR) {
- P8 = IC(4);
-} else {
- P8 = I211(4, 5, 7);
-}
-} break;
-case 253 :
-{
-P0 = I31(4,1);
-P1 = I31(4,1);
-P2 = I31(4,1);
-P3 = IC(4);
-P4 = IC(4);
-P5 = IC(4);
-P7 = IC(4);
-if (MDL) {
- P6 = IC(4);
-} else {
- P6 = I211(4, 3, 7);
-}
-if (MDR) {
- P8 = IC(4);
-} else {
- P8 = I211(4, 5, 7);
-}
-} break;
-case 254 :
-{
-P0 = I31(4, 0);
-P4 = IC(4);
-if (MDL) {
- P3 = IC(4);
- P6 = IC(4);
-} else {
- P3 = I71(4, 3);
- P6 = I772(3, 7, 4);
-}
-if (MDR) {
- P5 = IC(4);
- P7 = IC(4);
- P8 = IC(4);
-} else {
- P5 = I71(4, 5);
- P7 = I71(4, 7);
- P8 = I211(4, 5, 7);
-}
-if (MUR) {
- P1 = IC(4);
- P2 = IC(4);
-} else {
- P1 = I71(4, 1);
- P2 = I772(1, 5, 4);
-}
-} break;
-case 255 :
-{
-P1 = IC(4);
-P3 = IC(4);
-P4 = IC(4);
-P5 = IC(4);
-P7 = IC(4);
-if (MDL) {
- P6 = IC(4);
-} else {
- P6 = I211(4, 3, 7);
-}
-if (MDR) {
- P8 = IC(4);
-} else {
- P8 = I211(4, 5, 7);
-}
-if (MUL) {
- P0 = IC(4);
-} else {
- P0 = I211(4, 1, 3);
-}
-if (MUR) {
- P2 = IC(4);
-} else {
- P2 = I211(4, 1, 5);
-}
-} break;
-
-#undef P0
-#undef P1
-#undef P2
-#undef P3
-#undef P4
-#undef P5
-#undef P6
-#undef P7
-#undef P8
-#undef MUR
-#undef MDR
-#undef MDL
-#undef MUL
-#undef IC
-#undef I11
-#undef I211
-#undef I31
-#undef I332
-#undef I431
-#undef I521
-#undef I53
-#undef I611
-#undef I71
-#undef I772
-#undef I97
-#undef I1411
-#undef I151
+++ /dev/null
-; i386.asm - description
-; -------------------
-; begin : Sun Nov 08 2001
-; copyright : (C) 2001 by Pete Bernert
-; email : BlackDove@addcom.de
-
-; ported from inline gcc to nasm by linuzappz
-
-
-; This program is free software; you can redistribute it and/or modify *
-; it under the terms of the GNU General Public License as published by *
-; the Free Software Foundation; either version 2 of the License, or *
-; (at your option) any later version. See also the license.txt file for *
-; additional informations. *
-
-
-bits 32
-
-section .text
-
-%include "macros.inc"
-
-NEWSYM i386_BGR24to16
- push ebp
- mov ebp, esp
- push ebx
- push edx
-
- mov eax, [ebp+8] ; this can hold the G value
- mov ebx, eax ; this can hold the R value
- mov edx, eax ; this can hold the B value
- shr ebx, 3 ; move the R value
- and edx, 00f80000h ; mask the B value
- shr edx, 9 ; move the B value
- and eax, 00f800h ; mask the G value
- shr eax, 6 ; move the G value
- and ebx, 0000001fh ; mask the R value
- or eax, ebx ; add R to G value
- or eax, edx ; add B to RG value
- pop edx
- pop ebx
- mov esp, ebp
- pop ebp
- ret
-
-NEWSYM i386_shl10idiv
- push ebp
- mov ebp, esp
- push ebx
- push edx
-
- mov eax, [ebp+8]
- mov ebx, [ebp+12]
- mov edx, eax
- shl eax, 10
- sar edx, 22
- idiv ebx
-
- pop edx
- pop ebx
- mov esp, ebp
- pop ebp
- ret
-%ifidn __OUTPUT_FORMAT__,elf
-section .note.GNU-stack noalloc noexec nowrite progbits
-%endif
-
+++ /dev/null
-/*
- * This file is part of the Advance project.
- *
- * Copyright (C) 2003 Andrea Mazzoleni
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * In addition, as a special exception, Andrea Mazzoleni
- * gives permission to link the code of this program with
- * the MAME library (or with modified versions of MAME that use the
- * same license as MAME), and distribute linked combinations including
- * the two. You must obey the GNU General Public License in all
- * respects for all of the code used other than MAME. If you modify
- * this file, you may extend this exception to your version of the
- * file, but you are not obligated to do so. If you do not wish to
- * do so, delete this exception statement from your version.
- */
-
-#ifndef __INTERP_H
-#define __INTERP_H
-
-/***************************************************************************/
-/* Basic types */
-
-/***************************************************************************/
-/* interpolation */
-
-static unsigned interp_mask[2];
-static unsigned interp_bits_per_pixel;
-
-#define INTERP_16_MASK_1(v) (v & interp_mask[0])
-#define INTERP_16_MASK_2(v) (v & interp_mask[1])
-
-static __inline unsigned short interp_16_521(unsigned short p1, unsigned short p2, unsigned short p3)
-{
- return INTERP_16_MASK_1((INTERP_16_MASK_1(p1)*5 + INTERP_16_MASK_1(p2)*2 + INTERP_16_MASK_1(p3)*1) / 8)
- | INTERP_16_MASK_2((INTERP_16_MASK_2(p1)*5 + INTERP_16_MASK_2(p2)*2 + INTERP_16_MASK_2(p3)*1) / 8);
-}
-
-static __inline unsigned short interp_16_332(unsigned short p1, unsigned short p2, unsigned short p3)
-{
- return INTERP_16_MASK_1((INTERP_16_MASK_1(p1)*3 + INTERP_16_MASK_1(p2)*3 + INTERP_16_MASK_1(p3)*2) / 8)
- | INTERP_16_MASK_2((INTERP_16_MASK_2(p1)*3 + INTERP_16_MASK_2(p2)*3 + INTERP_16_MASK_2(p3)*2) / 8);
-}
-
-static __inline unsigned short interp_16_611(unsigned short p1, unsigned short p2, unsigned short p3)
-{
- return INTERP_16_MASK_1((INTERP_16_MASK_1(p1)*6 + INTERP_16_MASK_1(p2) + INTERP_16_MASK_1(p3)) / 8)
- | INTERP_16_MASK_2((INTERP_16_MASK_2(p1)*6 + INTERP_16_MASK_2(p2) + INTERP_16_MASK_2(p3)) / 8);
-}
-
-static __inline unsigned short interp_16_71(unsigned short p1, unsigned short p2)
-{
- return INTERP_16_MASK_1((INTERP_16_MASK_1(p1)*7 + INTERP_16_MASK_1(p2)) / 8)
- | INTERP_16_MASK_2((INTERP_16_MASK_2(p1)*7 + INTERP_16_MASK_2(p2)) / 8);
-}
-
-static __inline unsigned short interp_16_211(unsigned short p1, unsigned short p2, unsigned short p3)
-{
- return INTERP_16_MASK_1((INTERP_16_MASK_1(p1)*2 + INTERP_16_MASK_1(p2) + INTERP_16_MASK_1(p3)) / 4)
- | INTERP_16_MASK_2((INTERP_16_MASK_2(p1)*2 + INTERP_16_MASK_2(p2) + INTERP_16_MASK_2(p3)) / 4);
-}
-
-static __inline unsigned short interp_16_772(unsigned short p1, unsigned short p2, unsigned short p3)
-{
- return INTERP_16_MASK_1(((INTERP_16_MASK_1(p1) + INTERP_16_MASK_1(p2))*7 + INTERP_16_MASK_1(p3)*2) / 16)
- | INTERP_16_MASK_2(((INTERP_16_MASK_2(p1) + INTERP_16_MASK_2(p2))*7 + INTERP_16_MASK_2(p3)*2) / 16);
-}
-
-static __inline unsigned short interp_16_11(unsigned short p1, unsigned short p2)
-{
- return INTERP_16_MASK_1((INTERP_16_MASK_1(p1) + INTERP_16_MASK_1(p2)) / 2)
- | INTERP_16_MASK_2((INTERP_16_MASK_2(p1) + INTERP_16_MASK_2(p2)) / 2);
-}
-
-static __inline unsigned short interp_16_31(unsigned short p1, unsigned short p2)
-{
- return INTERP_16_MASK_1((INTERP_16_MASK_1(p1)*3 + INTERP_16_MASK_1(p2)) / 4)
- | INTERP_16_MASK_2((INTERP_16_MASK_2(p1)*3 + INTERP_16_MASK_2(p2)) / 4);
-}
-
-static __inline unsigned short interp_16_1411(unsigned short p1, unsigned short p2, unsigned short p3)
-{
- return INTERP_16_MASK_1((INTERP_16_MASK_1(p1)*14 + INTERP_16_MASK_1(p2) + INTERP_16_MASK_1(p3)) / 16)
- | INTERP_16_MASK_2((INTERP_16_MASK_2(p1)*14 + INTERP_16_MASK_2(p2) + INTERP_16_MASK_2(p3)) / 16);
-}
-
-static __inline unsigned short interp_16_431(unsigned short p1, unsigned short p2, unsigned short p3)
-{
- return INTERP_16_MASK_1((INTERP_16_MASK_1(p1)*4 + INTERP_16_MASK_1(p2)*3 + INTERP_16_MASK_1(p3)) / 8)
- | INTERP_16_MASK_2((INTERP_16_MASK_2(p1)*4 + INTERP_16_MASK_2(p2)*3 + INTERP_16_MASK_2(p3)) / 8);
-}
-
-static __inline unsigned short interp_16_53(unsigned short p1, unsigned short p2)
-{
- return INTERP_16_MASK_1((INTERP_16_MASK_1(p1)*5 + INTERP_16_MASK_1(p2)*3) / 8)
- | INTERP_16_MASK_2((INTERP_16_MASK_2(p1)*5 + INTERP_16_MASK_2(p2)*3) / 8);
-}
-
-static __inline unsigned short interp_16_151(unsigned short p1, unsigned short p2)
-{
- return INTERP_16_MASK_1((INTERP_16_MASK_1(p1)*15 + INTERP_16_MASK_1(p2)) / 16)
- | INTERP_16_MASK_2((INTERP_16_MASK_2(p1)*15 + INTERP_16_MASK_2(p2)) / 16);
-}
-
-static __inline unsigned short interp_16_97(unsigned short p1, unsigned short p2)
-{
- return INTERP_16_MASK_1((INTERP_16_MASK_1(p1)*9 + INTERP_16_MASK_1(p2)*7) / 16)
- | INTERP_16_MASK_2((INTERP_16_MASK_2(p1)*9 + INTERP_16_MASK_2(p2)*7) / 16);
-}
-
-#define INTERP_32_MASK_1(v) (v & 0xFF00FF)
-#define INTERP_32_MASK_2(v) (v & 0x00FF00)
-
-static __inline unsigned int interp_32_521(unsigned int p1, unsigned int p2, unsigned int p3)
-{
- return INTERP_32_MASK_1((INTERP_32_MASK_1(p1)*5 + INTERP_32_MASK_1(p2)*2 + INTERP_32_MASK_1(p3)*1) / 8)
- | INTERP_32_MASK_2((INTERP_32_MASK_2(p1)*5 + INTERP_32_MASK_2(p2)*2 + INTERP_32_MASK_2(p3)*1) / 8);
-}
-
-static __inline unsigned int interp_32_332(unsigned int p1, unsigned int p2, unsigned int p3)
-{
- return INTERP_32_MASK_1((INTERP_32_MASK_1(p1)*3 + INTERP_32_MASK_1(p2)*3 + INTERP_32_MASK_1(p3)*2) / 8)
- | INTERP_32_MASK_2((INTERP_32_MASK_2(p1)*3 + INTERP_32_MASK_2(p2)*3 + INTERP_32_MASK_2(p3)*2) / 8);
-}
-
-static __inline unsigned int interp_32_211(unsigned int p1, unsigned int p2, unsigned int p3)
-{
- return INTERP_32_MASK_1((INTERP_32_MASK_1(p1)*2 + INTERP_32_MASK_1(p2) + INTERP_32_MASK_1(p3)) / 4)
- | INTERP_32_MASK_2((INTERP_32_MASK_2(p1)*2 + INTERP_32_MASK_2(p2) + INTERP_32_MASK_2(p3)) / 4);
-}
-
-static __inline unsigned int interp_32_611(unsigned int p1, unsigned int p2, unsigned int p3)
-{
- return INTERP_32_MASK_1((INTERP_32_MASK_1(p1)*6 + INTERP_32_MASK_1(p2) + INTERP_32_MASK_1(p3)) / 8)
- | INTERP_32_MASK_2((INTERP_32_MASK_2(p1)*6 + INTERP_32_MASK_2(p2) + INTERP_32_MASK_2(p3)) / 8);
-}
-
-static __inline unsigned int interp_32_71(unsigned int p1, unsigned int p2)
-{
- return INTERP_32_MASK_1((INTERP_32_MASK_1(p1)*7 + INTERP_32_MASK_1(p2)) / 8)
- | INTERP_32_MASK_2((INTERP_32_MASK_2(p1)*7 + INTERP_32_MASK_2(p2)) / 8);
-}
-
-static __inline unsigned int interp_32_772(unsigned int p1, unsigned int p2, unsigned int p3)
-{
- return INTERP_32_MASK_1(((INTERP_32_MASK_1(p1) + INTERP_32_MASK_1(p2))*7 + INTERP_32_MASK_1(p3)*2) / 16)
- | INTERP_32_MASK_2(((INTERP_32_MASK_2(p1) + INTERP_32_MASK_2(p2))*7 + INTERP_32_MASK_2(p3)*2) / 16);
-}
-
-static __inline unsigned int interp_32_11(unsigned int p1, unsigned int p2)
-{
- return INTERP_32_MASK_1((INTERP_32_MASK_1(p1) + INTERP_32_MASK_1(p2)) / 2)
- | INTERP_32_MASK_2((INTERP_32_MASK_2(p1) + INTERP_32_MASK_2(p2)) / 2);
-}
-
-static __inline unsigned int interp_32_31(unsigned int p1, unsigned int p2)
-{
- return INTERP_32_MASK_1((INTERP_32_MASK_1(p1)*3 + INTERP_32_MASK_1(p2)) / 4)
- | INTERP_32_MASK_2((INTERP_32_MASK_2(p1)*3 + INTERP_32_MASK_2(p2)) / 4);
-}
-
-static __inline unsigned int interp_32_1411(unsigned int p1, unsigned int p2, unsigned int p3)
-{
- return INTERP_32_MASK_1((INTERP_32_MASK_1(p1)*14 + INTERP_32_MASK_1(p2) + INTERP_32_MASK_1(p3)) / 16)
- | INTERP_32_MASK_2((INTERP_32_MASK_2(p1)*14 + INTERP_32_MASK_2(p2) + INTERP_32_MASK_2(p3)) / 16);
-}
-
-static __inline unsigned int interp_32_431(unsigned int p1, unsigned int p2, unsigned int p3)
-{
- return INTERP_32_MASK_1((INTERP_32_MASK_1(p1)*4 + INTERP_32_MASK_1(p2)*3 + INTERP_32_MASK_1(p3)) / 8)
- | INTERP_32_MASK_2((INTERP_32_MASK_2(p1)*4 + INTERP_32_MASK_2(p2)*3 + INTERP_32_MASK_2(p3)) / 8);
-}
-
-static __inline unsigned int interp_32_53(unsigned int p1, unsigned int p2)
-{
- return INTERP_32_MASK_1((INTERP_32_MASK_1(p1)*5 + INTERP_32_MASK_1(p2)*3) / 8)
- | INTERP_32_MASK_2((INTERP_32_MASK_2(p1)*5 + INTERP_32_MASK_2(p2)*3) / 8);
-}
-
-static __inline unsigned int interp_32_151(unsigned int p1, unsigned int p2)
-{
- return INTERP_32_MASK_1((INTERP_32_MASK_1(p1)*15 + INTERP_32_MASK_1(p2)) / 16)
- | INTERP_32_MASK_2((INTERP_32_MASK_2(p1)*15 + INTERP_32_MASK_2(p2)) / 16);
-}
-
-static __inline unsigned int interp_32_97(unsigned int p1, unsigned int p2)
-{
- return INTERP_32_MASK_1((INTERP_32_MASK_1(p1)*9 + INTERP_32_MASK_1(p2)*7) / 16)
- | INTERP_32_MASK_2((INTERP_32_MASK_2(p1)*9 + INTERP_32_MASK_2(p2)*7) / 16);
-}
-
-/***************************************************************************/
-/* diff */
-
-#define INTERP_Y_LIMIT (0x30*4)
-#define INTERP_U_LIMIT (0x07*4)
-#define INTERP_V_LIMIT (0x06*8)
-
-inline static int interp_16_diff(unsigned short p1, unsigned short p2)
-{
- int r, g, b;
- int y, u, v;
-
- if (p1 == p2)
- return 0;
-
- if (interp_bits_per_pixel == 16) {
- b = (int)((p1 & 0x1F) - (p2 & 0x1F)) << 3;
- g = (int)((p1 & 0x7E0) - (p2 & 0x7E0)) >> 3;
- r = (int)((p1 & 0xF800) - (p2 & 0xF800)) >> 8;
- } else {
- b = (int)((p1 & 0x1F) - (p2 & 0x1F)) << 3;
- g = (int)((p1 & 0x3E0) - (p2 & 0x3E0)) >> 2;
- r = (int)((p1 & 0x7C00) - (p2 & 0x7C00)) >> 7;
- }
-
- y = r + g + b;
- u = r - b;
- v = -r + 2*g - b;
-
- if (y < -INTERP_Y_LIMIT || y > INTERP_Y_LIMIT)
- return 1;
-
- if (u < -INTERP_U_LIMIT || u > INTERP_U_LIMIT)
- return 1;
-
- if (v < -INTERP_V_LIMIT || v > INTERP_V_LIMIT)
- return 1;
-
- return 0;
-}
-
-inline static int interp_32_diff(unsigned int p1, unsigned int p2)
-{
- int r, g, b;
- int y, u, v;
-
- if ((p1 & 0xF8F8F8) == (p2 & 0xF8F8F8))
- return 0;
-
- b = (int)((p1 & 0xFF) - (p2 & 0xFF));
- g = (int)((p1 & 0xFF00) - (p2 & 0xFF00)) >> 8;
- r = (int)((p1 & 0xFF0000) - (p2 & 0xFF0000)) >> 16;
-
- y = r + g + b;
- u = r - b;
- v = -r + 2*g - b;
-
- if (y < -INTERP_Y_LIMIT || y > INTERP_Y_LIMIT)
- return 1;
-
- if (u < -INTERP_U_LIMIT || u > INTERP_U_LIMIT)
- return 1;
-
- if (v < -INTERP_V_LIMIT || v > INTERP_V_LIMIT)
- return 1;
-
- return 0;
-}
-
-#if 0
-
-static void interp_set(unsigned bits_per_pixel)
-{
- interp_bits_per_pixel = bits_per_pixel;
-
- switch (bits_per_pixel) {
- case 15 :
- interp_mask[0] = 0x7C1F;
- interp_mask[1] = 0x03E0;
- break;
- case 16 :
- interp_mask[0] = 0xF81F;
- interp_mask[1] = 0x07E0;
- break;
- case 32 :
- interp_mask[0] = 0xFF00FF;
- interp_mask[1] = 0x00FF00;
- break;
- }
-}
-
-#endif
-
-#endif
+++ /dev/null
-/***************************************************************************
- key.c - description
- -------------------
- begin : Sun Oct 28 2001
- copyright : (C) 2001 by Pete Bernert
- email : BlackDove@addcom.de
- ***************************************************************************/
-/***************************************************************************
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. See also the license.txt file for *
- * additional informations. *
- * *
- ***************************************************************************/
-
-#define _IN_KEY
-
-#include "externals.h"
-#include "menu.h"
-#include "gpu.h"
-#include "draw.h"
-#include "key.h"
-
-#define VK_INSERT 65379
-#define VK_HOME 65360
-#define VK_PRIOR 65365
-#define VK_NEXT 65366
-#define VK_END 65367
-#define VK_DEL 65535
-#define VK_F5 65474
-
-void GPUmakeSnapshot(void);
-
-unsigned long ulKeybits=0;
-
-void GPUkeypressed(int keycode)
-{
- switch(keycode)
- {
- case 0xFFC9: //X11 key: F12
- case ((1<<29) | 0xFF0D): //special keycode from pcsx-df: alt-enter
- bChangeWinMode=TRUE;
- break;
- case VK_F5:
- GPUmakeSnapshot();
- break;
-
- case VK_INSERT:
- if(iUseFixes) {iUseFixes=0;dwActFixes=0;}
- else {iUseFixes=1;dwActFixes=dwCfgFixes;}
- SetFixes();
- if(iFrameLimit==2) SetAutoFrameCap();
- break;
-
- case VK_DEL:
- if(ulKeybits&KEY_SHOWFPS)
- {
- ulKeybits&=~KEY_SHOWFPS;
- DoClearScreenBuffer();
- }
- else
- {
- ulKeybits|=KEY_SHOWFPS;
- szDispBuf[0]=0;
- BuildDispMenu(0);
- }
- break;
-
- case VK_PRIOR: BuildDispMenu(-1); break;
- case VK_NEXT: BuildDispMenu( 1); break;
- case VK_END: SwitchDispMenu(1); break;
- case VK_HOME: SwitchDispMenu(-1); break;
- case 0x60:
- {
- iFastFwd = 1 - iFastFwd;
- bSkipNextFrame = FALSE;
- UseFrameSkip = iFastFwd;
- BuildDispMenu(0);
- break;
- }
-#ifdef _MACGL
- default: { void HandleKey(int keycode); HandleKey(keycode); }
-#endif
- }
-}
-
-void SetKeyHandler(void)
-{
-}
-
-void ReleaseKeyHandler(void)
-{
-}
+++ /dev/null
-/***************************************************************************
- key.h - description
- -------------------
- begin : Sun Oct 28 2001
- copyright : (C) 2001 by Pete Bernert
- email : BlackDove@addcom.de
- ***************************************************************************/
-/***************************************************************************
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. See also the license.txt file for *
- * additional informations. *
- * *
- ***************************************************************************/
-
-#ifndef _KEY_INTERNALS_H
-#define _KEY_INTERNALS_H
-
-void SetKeyHandler(void);
-void ReleaseKeyHandler(void);
-
-#endif // _KEY_INTERNALS_H
+++ /dev/null
-; macros.inc - description
-; -------------------
-; begin : Sun Nov 08 2001
-; based on ZSNES macros.mac
-; email : linuzappz@pcsx.net
-
-; This program is free software; you can redistribute it and/or modify *
-; it under the terms of the GNU General Public License as published by *
-; the Free Software Foundation; either version 2 of the License, or *
-; (at your option) any later version. See also the license.txt file for *
-; additional informations. *
-
-
-%ifdef __WIN32__
-
-%imacro EXTSYM 1-*
-%rep %0
- extern _%1
- %define %1 _%1
-%rotate 1
-%endrep
-%endmacro
-
-%imacro NEWSYM 1
- global _%1
- _%1:
- %1:
-%endmacro
-
-%else
-
-%define EXTSYM extern
-
-%imacro NEWSYM 1
- global %1
- %1:
-%endmacro
-
-%endif
-
+++ /dev/null
-/***************************************************************************
- menu.c - description
- -------------------
- begin : Sun Oct 28 2001
- copyright : (C) 2001 by Pete Bernert
- email : BlackDove@addcom.de
- ***************************************************************************/
-/***************************************************************************
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. See also the license.txt file for *
- * additional informations. *
- * *
- ***************************************************************************/
-
-#define _IN_MENU
-
-#include "externals.h"
-#include "draw.h"
-#include "menu.h"
-#include "gpu.h"
-
-unsigned long dwCoreFlags = 0;
-
-// create lists/stuff for fonts (actually there are no more lists, but I am too lazy to change the func names ;)
-void InitMenu(void)
-{
-}
-
-// kill existing lists/fonts
-void CloseMenu(void)
-{
- DestroyPic();
-}
-
-// DISPLAY FPS/MENU TEXT
-
-#include <time.h>
-extern time_t tStart;
-
-int iMPos=0; // menu arrow pos
-
-void DisplayText(void) // DISPLAY TEXT
-{
-}
-
-// Build Menu buffer (== Dispbuffer without FPS)...
-void BuildDispMenu(int iInc)
-{
- if(!(ulKeybits&KEY_SHOWFPS)) return; // mmm, cheater ;)
-
- iMPos+=iInc; // up or down
- if(iMPos<0) iMPos=3; // wrap around
- if(iMPos>3) iMPos=0;
-
- strcpy(szMenuBuf," FL FS DI GF "); // main menu items
-
- if(UseFrameLimit) // set marks
- {
- if(iFrameLimit==1) szMenuBuf[2] = '+';
- else szMenuBuf[2] = '*';
- }
- if(iFastFwd) szMenuBuf[7] = '~';
- else
- if(UseFrameSkip) szMenuBuf[7] = '*';
-
- if(iUseDither) // set marks
- {
- if(iUseDither==1) szMenuBuf[12] = '+';
- else szMenuBuf[12] = '*';
- }
-
- if(dwActFixes) szMenuBuf[17] = '*';
-
- if(dwCoreFlags&1) szMenuBuf[23] = 'A';
- if(dwCoreFlags&2) szMenuBuf[23] = 'M';
-
- if(dwCoreFlags&0xff00) //A/M/G/D
- {
- if((dwCoreFlags&0x0f00)==0x0000) // D
- szMenuBuf[23] = 'D';
- else
- if((dwCoreFlags&0x0f00)==0x0100) // A
- szMenuBuf[23] = 'A';
- else
- if((dwCoreFlags&0x0f00)==0x0200) // M
- szMenuBuf[23] = 'M';
- else
- if((dwCoreFlags&0x0f00)==0x0300) // G
- szMenuBuf[23] = 'G';
-
- szMenuBuf[24]='0'+(char)((dwCoreFlags&0xf000)>>12); // number
- }
-
-
- if(lSelectedSlot) szMenuBuf[26] = '0'+(char)lSelectedSlot;
-
- szMenuBuf[(iMPos+1)*5]='<'; // set arrow
-
-}
-
-// Some menu action...
-void SwitchDispMenu(int iStep) // SWITCH DISP MENU
-{
- if(!(ulKeybits&KEY_SHOWFPS)) return; // tststs
-
- switch(iMPos)
- {
- case 0: // frame limit
- {
- int iType=0;
- bInitCap = TRUE;
-
- if(UseFrameLimit) iType=iFrameLimit;
- iType+=iStep;
- if(iType<0) iType=2;
- if(iType>2) iType=0;
- if(iType==0) UseFrameLimit=0;
- else
- {
- UseFrameLimit=1;
- iFrameLimit=iType;
- SetAutoFrameCap();
- }
- } break;
-
- case 1: // frame skip
- bInitCap = TRUE;
- if(iStep>0)
- {
- if(!UseFrameSkip) {UseFrameSkip=1;iFastFwd = 0;}
- else
- {
- if(!iFastFwd) iFastFwd=1;
- else {UseFrameSkip=0;iFastFwd = 0;}
- }
- }
- else
- {
- if(!UseFrameSkip) {UseFrameSkip=1;iFastFwd = 1;}
- else
- {
- if(iFastFwd) iFastFwd=0;
- else {UseFrameSkip=0;iFastFwd = 0;}
- }
- }
- bSkipNextFrame=FALSE;
- break;
-
- case 2: // dithering
- iUseDither+=iStep;
- if(iUseDither<0) iUseDither=2;
- if(iUseDither>2) iUseDither=0;
- break;
-
- case 3: // special fixes
- if(iUseFixes) {iUseFixes=0;dwActFixes=0;}
- else {iUseFixes=1;dwActFixes=dwCfgFixes;}
- SetFixes();
- if(iFrameLimit==2) SetAutoFrameCap();
- break;
- }
-
- BuildDispMenu(0); // update info
-}
+++ /dev/null
-/***************************************************************************
- menu.h - description
- -------------------
- begin : Sun Oct 28 2001
- copyright : (C) 2001 by Pete Bernert
- email : BlackDove@addcom.de
- ***************************************************************************/
-/***************************************************************************
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. See also the license.txt file for *
- * additional informations. *
- * *
- ***************************************************************************/
-
-#ifndef _GPU_MENU_H_
-#define _GPU_MENU_H_
-
-void DisplayText(void);
-void CloseMenu(void);
-void InitMenu(void);
-void BuildDispMenu(int iInc);
-void SwitchDispMenu(int iStep);
-
-#endif // _GPU_MENU_H_
* *
***************************************************************************/
-#define _IN_PRIMDRAW
-
-#include "externals.h"
-#include "gpu.h"
-#include "draw.h"
-#include "soft.h"
-#include "swap.h"
-
////////////////////////////////////////////////////////////////////////
// globals
////////////////////////////////////////////////////////////////////////
int32_t drawH;
uint32_t dwCfgFixes;
uint32_t dwActFixes=0;
-uint32_t dwEmuFixes=0;
int iUseFixes;
int iUseDither=0;
BOOL bDoVSyncUpdate=FALSE;
-////////////////////////////////////////////////////////////////////////
-// Some ASM color convertion by LEWPY
-////////////////////////////////////////////////////////////////////////
-
-#ifdef USE_NASM
-
-#define BGR24to16 i386_BGR24to16
-__inline unsigned short BGR24to16 (uint32_t BGR);
-
-#else
-
-__inline unsigned short BGR24to16 (uint32_t BGR)
+// USE_NASM
+static inline unsigned short BGR24to16 (uint32_t BGR)
{
return (unsigned short)(((BGR>>3)&0x1f)|((BGR&0xf80000)>>9)|((BGR&0xf800)>>6));
}
-#endif
-
////////////////////////////////////////////////////////////////////////
// Update global TP infos
////////////////////////////////////////////////////////////////////////
-__inline void UpdateGlobalTP(unsigned short gdata)
+static inline void UpdateGlobalTP(unsigned short gdata)
{
GlobalTextAddrX = (gdata << 6) & 0x3c0; // texture addr
- if(iGPUHeight==1024)
- {
- if(dwGPUVersion==2)
- {
- GlobalTextAddrY =((gdata & 0x60 ) << 3);
- GlobalTextIL =(gdata & 0x2000) >> 13;
- GlobalTextABR = (unsigned short)((gdata >> 7) & 0x3);
- GlobalTextTP = (gdata >> 9) & 0x3;
- if(GlobalTextTP==3) GlobalTextTP=2;
- usMirror =0;
- lGPUstatusRet = (lGPUstatusRet & 0xffffe000 ) | (gdata & 0x1fff );
-
- // tekken dithering? right now only if dithering is forced by user
- if(iUseDither==2) iDither=2; else iDither=0;
-
- return;
- }
- else
- {
- GlobalTextAddrY = (unsigned short)(((gdata << 4) & 0x100) | ((gdata >> 2) & 0x200));
- }
- }
- else GlobalTextAddrY = (gdata << 4) & 0x100;
+ GlobalTextAddrY = (gdata << 4) & 0x100;
GlobalTextTP = (gdata >> 7) & 0x3; // tex mode (4,8,15)
////////////////////////////////////////////////////////////////////////
-__inline void SetRenderMode(uint32_t DrawAttributes)
+static inline void SetRenderMode(uint32_t DrawAttributes)
{
DrawSemiTrans = (SEMITRANSBIT(DrawAttributes)) ? TRUE : FALSE;
#define CHKMAX_X 1024
#define CHKMAX_Y 512
-void AdjustCoord4()
+static inline void AdjustCoord4(void)
{
lx0=(short)(((int)lx0<<SIGNSHIFT)>>SIGNSHIFT);
lx1=(short)(((int)lx1<<SIGNSHIFT)>>SIGNSHIFT);
ly3=(short)(((int)ly3<<SIGNSHIFT)>>SIGNSHIFT);
}
-void AdjustCoord3()
+static inline void AdjustCoord3(void)
{
lx0=(short)(((int)lx0<<SIGNSHIFT)>>SIGNSHIFT);
lx1=(short)(((int)lx1<<SIGNSHIFT)>>SIGNSHIFT);
ly2=(short)(((int)ly2<<SIGNSHIFT)>>SIGNSHIFT);
}
-void AdjustCoord2()
+static inline void AdjustCoord2(void)
{
lx0=(short)(((int)lx0<<SIGNSHIFT)>>SIGNSHIFT);
lx1=(short)(((int)lx1<<SIGNSHIFT)>>SIGNSHIFT);
ly1=(short)(((int)ly1<<SIGNSHIFT)>>SIGNSHIFT);
}
-void AdjustCoord1()
+static inline void AdjustCoord1(void)
{
lx0=(short)(((int)lx0<<SIGNSHIFT)>>SIGNSHIFT);
ly0=(short)(((int)ly0<<SIGNSHIFT)>>SIGNSHIFT);
// y 20 -228 222 -100
// 0 __1
-// \ / \
+// \ / \ .
// 2___3
-__inline BOOL CheckCoord4()
+static inline BOOL CheckCoord4(void)
{
if(lx0<0)
{
return FALSE;
}
-__inline BOOL CheckCoord3()
+static inline BOOL CheckCoord3(void)
{
if(lx0<0)
{
}
-__inline BOOL CheckCoord2()
+static inline BOOL CheckCoord2(void)
{
if(lx0<0)
{
return FALSE;
}
-__inline BOOL CheckCoordL(short slx0,short sly0,short slx1,short sly1)
+static inline BOOL CheckCoordL(short slx0,short sly0,short slx1,short sly1)
{
if(slx0<0)
{
// mask stuff... used in silent hill
////////////////////////////////////////////////////////////////////////
-void cmdSTP(unsigned char * baseAddr)
+static inline void cmdSTP(unsigned char * baseAddr)
{
uint32_t gdata = GETLE32(&((uint32_t*)baseAddr)[0]);
// cmd: Set texture page infos
////////////////////////////////////////////////////////////////////////
-void cmdTexturePage(unsigned char * baseAddr)
+static void cmdTexturePage(unsigned char * baseAddr)
{
uint32_t gdata = GETLE32(&((uint32_t*)baseAddr)[0]);
// cmd: turn on/off texture window
////////////////////////////////////////////////////////////////////////
-void cmdTextureWindow(unsigned char *baseAddr)
+static void cmdTextureWindow(unsigned char *baseAddr)
{
uint32_t gdata = GETLE32(&((uint32_t*)baseAddr)[0]);
-void cmdDrawAreaStart(unsigned char * baseAddr)
+static void cmdDrawAreaStart(unsigned char * baseAddr)
{
uint32_t gdata = GETLE32(&((uint32_t*)baseAddr)[0]);
drawX = gdata & 0x3ff; // for soft drawing
- if(dwGPUVersion==2)
- {
- lGPUInfoVals[INFO_DRAWSTART]=gdata&0x3FFFFF;
- drawY = (gdata>>12)&0x3ff;
- if(drawY>=1024) drawY=1023; // some security
- }
- else
- {
lGPUInfoVals[INFO_DRAWSTART]=gdata&0xFFFFF;
drawY = (gdata>>10)&0x3ff;
if(drawY>=512) drawY=511; // some security
- }
}
////////////////////////////////////////////////////////////////////////
// cmd: end of drawing area... primitives will be clipped inside
////////////////////////////////////////////////////////////////////////
-void cmdDrawAreaEnd(unsigned char * baseAddr)
+static void cmdDrawAreaEnd(unsigned char * baseAddr)
{
uint32_t gdata = GETLE32(&((uint32_t*)baseAddr)[0]);
drawW = gdata & 0x3ff; // for soft drawing
- if(dwGPUVersion==2)
- {
- lGPUInfoVals[INFO_DRAWEND]=gdata&0x3FFFFF;
- drawH = (gdata>>12)&0x3ff;
- if(drawH>=1024) drawH=1023; // some security
- }
- else
- {
lGPUInfoVals[INFO_DRAWEND]=gdata&0xFFFFF;
drawH = (gdata>>10)&0x3ff;
if(drawH>=512) drawH=511; // some security
- }
}
////////////////////////////////////////////////////////////////////////
// cmd: draw offset... will be added to prim coords
////////////////////////////////////////////////////////////////////////
-void cmdDrawOffset(unsigned char * baseAddr)
+static void cmdDrawOffset(unsigned char * baseAddr)
{
uint32_t gdata = GETLE32(&((uint32_t*)baseAddr)[0]);
PSXDisplay.DrawOffset.x = (short)(gdata & 0x7ff);
- if(dwGPUVersion==2)
- {
- lGPUInfoVals[INFO_DRAWOFF]=gdata&0x7FFFFF;
- PSXDisplay.DrawOffset.y = (short)((gdata>>12) & 0x7ff);
- }
- else
- {
lGPUInfoVals[INFO_DRAWOFF]=gdata&0x3FFFFF;
PSXDisplay.DrawOffset.y = (short)((gdata>>11) & 0x7ff);
- }
PSXDisplay.DrawOffset.y=(short)(((int)PSXDisplay.DrawOffset.y<<21)>>21);
PSXDisplay.DrawOffset.x=(short)(((int)PSXDisplay.DrawOffset.x<<21)>>21);
// cmd: load image to vram
////////////////////////////////////////////////////////////////////////
-void primLoadImage(unsigned char * baseAddr)
+static void primLoadImage(unsigned char * baseAddr)
{
unsigned short *sgpuData = ((unsigned short *) baseAddr);
VRAMWrite.x = GETLEs16(&sgpuData[2])&0x3ff;
- VRAMWrite.y = GETLEs16(&sgpuData[3])&iGPUHeightMask;
+ VRAMWrite.y = GETLEs16(&sgpuData[3])&511;
VRAMWrite.Width = GETLEs16(&sgpuData[4]);
VRAMWrite.Height = GETLEs16(&sgpuData[5]);
// cmd: vram -> psx mem
////////////////////////////////////////////////////////////////////////
-void primStoreImage(unsigned char * baseAddr)
+static void primStoreImage(unsigned char * baseAddr)
{
unsigned short *sgpuData = ((unsigned short *) baseAddr);
VRAMRead.x = GETLEs16(&sgpuData[2])&0x03ff;
- VRAMRead.y = GETLEs16(&sgpuData[3])&iGPUHeightMask;
+ VRAMRead.y = GETLEs16(&sgpuData[3])&511;
VRAMRead.Width = GETLEs16(&sgpuData[4]);
VRAMRead.Height = GETLEs16(&sgpuData[5]);
// cmd: blkfill - NO primitive! Doesn't care about draw areas...
////////////////////////////////////////////////////////////////////////
-void primBlkFill(unsigned char * baseAddr)
+static void primBlkFill(unsigned char * baseAddr)
{
uint32_t *gpuData = ((uint32_t *) baseAddr);
short *sgpuData = ((short *) baseAddr);
// cmd: move image vram -> vram
////////////////////////////////////////////////////////////////////////
-void primMoveImage(unsigned char * baseAddr)
+static void primMoveImage(unsigned char * baseAddr)
{
short *sgpuData = ((short *) baseAddr);
short imageY0,imageX0,imageY1,imageX1,imageSX,imageSY,i,j;
imageX0 = GETLEs16(&sgpuData[2])&0x03ff;
- imageY0 = GETLEs16(&sgpuData[3])&iGPUHeightMask;
+ imageY0 = GETLEs16(&sgpuData[3])&511;
imageX1 = GETLEs16(&sgpuData[4])&0x03ff;
- imageY1 = GETLEs16(&sgpuData[5])&iGPUHeightMask;
+ imageY1 = GETLEs16(&sgpuData[5])&511;
imageSX = GETLEs16(&sgpuData[6]);
imageSY = GETLEs16(&sgpuData[7]);
if(imageSX<=0) return;
if(imageSY<=0) return;
- // ZN SF2: screwed moves
- //
- // move sgpuData[2],sgpuData[3],sgpuData[4],sgpuData[5],sgpuData[6],sgpuData[7]
- //
- // move 365 182 32723 -21846 17219 15427
- // move 127 160 147 -1 20817 13409
- // move 141 165 16275 -21862 -32126 13442
- // move 161 136 24620 -1 16962 13388
- // move 168 138 32556 -13090 -29556 15500
- //
- // and here's the hack for it:
-
- if(iGPUHeight==1024 && GETLEs16(&sgpuData[7])>1024) return;
-
- if((imageY0+imageSY)>iGPUHeight ||
+ if((imageY0+imageSY)>512 ||
(imageX0+imageSX)>1024 ||
- (imageY1+imageSY)>iGPUHeight ||
+ (imageY1+imageSY)>512 ||
(imageX1+imageSX)>1024)
{
int i,j;
for(j=0;j<imageSY;j++)
for(i=0;i<imageSX;i++)
- psxVuw [(1024*((imageY1+j)&iGPUHeightMask))+((imageX1+i)&0x3ff)]=
- psxVuw[(1024*((imageY0+j)&iGPUHeightMask))+((imageX0+i)&0x3ff)];
+ psxVuw [(1024*((imageY1+j)&511))+((imageX1+i)&0x3ff)]=
+ psxVuw[(1024*((imageY0+j)&511))+((imageX0+i)&0x3ff)];
bDoVSyncUpdate=TRUE;
imageSX+=imageX1;
imageSY+=imageY1;
-/*
- if(!PSXDisplay.Interlaced) // stupid frame skip stuff
- {
- if(UseFrameSkip &&
- imageX1<PSXDisplay.DisplayEnd.x &&
- imageSX>=PSXDisplay.DisplayPosition.x &&
- imageY1<PSXDisplay.DisplayEnd.y &&
- imageSY>=PSXDisplay.DisplayPosition.y)
- updateDisplay();
- }
-*/
-
bDoVSyncUpdate=TRUE;
}
// cmd: draw free-size Tile
////////////////////////////////////////////////////////////////////////
-//#define SMALLDEBUG
-//#include <dbgout.h>
-
-void primTileS(unsigned char * baseAddr)
+static void primTileS(unsigned char * baseAddr)
{
uint32_t *gpuData = ((uint32_t*)baseAddr);
short *sgpuData = ((short *) baseAddr);
short sW = GETLEs16(&sgpuData[4]) & 0x3ff;
- short sH = GETLEs16(&sgpuData[5]) & iGPUHeightMask; // mmm... limit tiles to 0x1ff or height?
+ short sH = GETLEs16(&sgpuData[5]) & 511; // mmm... limit tiles to 0x1ff or height?
lx0 = GETLEs16(&sgpuData[2]);
ly0 = GETLEs16(&sgpuData[3]);
DrawSemiTrans = (SEMITRANSBIT(GETLE32(&gpuData[0]))) ? TRUE : FALSE;
- if(!(iTileCheat && sH==32 && GETLE32(&gpuData[0])==0x60ffffff)) // special cheat for certain ZiNc games
FillSoftwareAreaTrans(lx0,ly0,lx2,ly2,
BGR24to16(GETLE32(&gpuData[0])));
// cmd: draw 1 dot Tile (point)
////////////////////////////////////////////////////////////////////////
-void primTile1(unsigned char * baseAddr)
+static void primTile1(unsigned char * baseAddr)
{
uint32_t *gpuData = ((uint32_t*)baseAddr);
short *sgpuData = ((short *) baseAddr);
// cmd: draw 8 dot Tile (small rect)
////////////////////////////////////////////////////////////////////////
-void primTile8(unsigned char * baseAddr)
+static void primTile8(unsigned char * baseAddr)
{
uint32_t *gpuData = ((uint32_t*)baseAddr);
short *sgpuData = ((short *) baseAddr);
// cmd: draw 16 dot Tile (medium rect)
////////////////////////////////////////////////////////////////////////
-void primTile16(unsigned char * baseAddr)
+static void primTile16(unsigned char * baseAddr)
{
uint32_t *gpuData = ((uint32_t*)baseAddr);
short *sgpuData = ((short *) baseAddr);
// cmd: small sprite (textured rect)
////////////////////////////////////////////////////////////////////////
-void primSprt8(unsigned char * baseAddr)
+static void primSprt8(unsigned char * baseAddr)
{
uint32_t *gpuData = ((uint32_t *) baseAddr);
short *sgpuData = ((short *) baseAddr);
// cmd: medium sprite (textured rect)
////////////////////////////////////////////////////////////////////////
-void primSprt16(unsigned char * baseAddr)
+static void primSprt16(unsigned char * baseAddr)
{
uint32_t *gpuData = ((uint32_t *) baseAddr);
short *sgpuData = ((short *) baseAddr);
////////////////////////////////////////////////////////////////////////
// func used on texture coord wrap
-void primSprtSRest(unsigned char * baseAddr,unsigned short type)
+static void primSprtSRest(unsigned char * baseAddr,unsigned short type)
{
uint32_t *gpuData = ((uint32_t *) baseAddr);
short *sgpuData = ((short *) baseAddr);
////////////////////////////////////////////////////////////////////////
-void primSprtS(unsigned char * baseAddr)
+static void primSprtS(unsigned char * baseAddr)
{
uint32_t *gpuData = ((uint32_t *) baseAddr);
short *sgpuData = ((short *) baseAddr);
// cmd: flat shaded Poly4
////////////////////////////////////////////////////////////////////////
-void primPolyF4(unsigned char *baseAddr)
+static void primPolyF4(unsigned char *baseAddr)
{
uint32_t *gpuData = ((uint32_t *) baseAddr);
short *sgpuData = ((short *) baseAddr);
// cmd: smooth shaded Poly4
////////////////////////////////////////////////////////////////////////
-void primPolyG4(unsigned char * baseAddr)
+static void primPolyG4(unsigned char * baseAddr)
{
uint32_t *gpuData = (uint32_t *)baseAddr;
short *sgpuData = ((short *) baseAddr);
// cmd: flat shaded Texture3
////////////////////////////////////////////////////////////////////////
-void primPolyFT3(unsigned char * baseAddr)
+static void primPolyFT3(unsigned char * baseAddr)
{
uint32_t *gpuData = ((uint32_t *) baseAddr);
short *sgpuData = ((short *) baseAddr);
// cmd: flat shaded Texture4
////////////////////////////////////////////////////////////////////////
-void primPolyFT4(unsigned char * baseAddr)
+static void primPolyFT4(unsigned char * baseAddr)
{
uint32_t *gpuData = ((uint32_t *) baseAddr);
short *sgpuData = ((short *) baseAddr);
// cmd: smooth shaded Texture3
////////////////////////////////////////////////////////////////////////
-void primPolyGT3(unsigned char *baseAddr)
+static void primPolyGT3(unsigned char *baseAddr)
{
uint32_t *gpuData = ((uint32_t *) baseAddr);
short *sgpuData = ((short *) baseAddr);
// cmd: smooth shaded Poly3
////////////////////////////////////////////////////////////////////////
-void primPolyG3(unsigned char *baseAddr)
+static void primPolyG3(unsigned char *baseAddr)
{
uint32_t *gpuData = ((uint32_t *) baseAddr);
short *sgpuData = ((short *) baseAddr);
// cmd: smooth shaded Texture4
////////////////////////////////////////////////////////////////////////
-void primPolyGT4(unsigned char *baseAddr)
+static void primPolyGT4(unsigned char *baseAddr)
{
uint32_t *gpuData = ((uint32_t *) baseAddr);
short *sgpuData = ((short *) baseAddr);
// cmd: smooth shaded Poly3
////////////////////////////////////////////////////////////////////////
-void primPolyF3(unsigned char *baseAddr)
+static void primPolyF3(unsigned char *baseAddr)
{
uint32_t *gpuData = ((uint32_t *) baseAddr);
short *sgpuData = ((short *) baseAddr);
// cmd: skipping shaded polylines
////////////////////////////////////////////////////////////////////////
-void primLineGSkip(unsigned char *baseAddr)
+static void primLineGSkip(unsigned char *baseAddr)
{
uint32_t *gpuData = ((uint32_t *) baseAddr);
int iMax=255;
// cmd: shaded polylines
////////////////////////////////////////////////////////////////////////
-void primLineGEx(unsigned char *baseAddr)
+static void primLineGEx(unsigned char *baseAddr)
{
uint32_t *gpuData = ((uint32_t *) baseAddr);
int iMax=255;
// cmd: shaded polyline2
////////////////////////////////////////////////////////////////////////
-void primLineG2(unsigned char *baseAddr)
+static void primLineG2(unsigned char *baseAddr)
{
uint32_t *gpuData = ((uint32_t *) baseAddr);
short *sgpuData = ((short *) baseAddr);
// cmd: skipping flat polylines
////////////////////////////////////////////////////////////////////////
-void primLineFSkip(unsigned char *baseAddr)
+static void primLineFSkip(unsigned char *baseAddr)
{
uint32_t *gpuData = ((uint32_t *) baseAddr);
int i=2,iMax=255;
// cmd: drawing flat polylines
////////////////////////////////////////////////////////////////////////
-void primLineFEx(unsigned char *baseAddr)
+static void primLineFEx(unsigned char *baseAddr)
{
uint32_t *gpuData = ((uint32_t *) baseAddr);
int iMax;
// cmd: drawing flat polyline2
////////////////////////////////////////////////////////////////////////
-void primLineF2(unsigned char *baseAddr)
+static void primLineF2(unsigned char *baseAddr)
{
uint32_t *gpuData = ((uint32_t *) baseAddr);
short *sgpuData = ((short *) baseAddr);
// cmd: well, easiest command... not implemented
////////////////////////////////////////////////////////////////////////
-void primNI(unsigned char *bA)
+static void primNI(unsigned char *bA)
{
}
+++ /dev/null
-/***************************************************************************
- prim.h - description
- -------------------
- begin : Sun Oct 28 2001
- copyright : (C) 2001 by Pete Bernert
- email : BlackDove@addcom.de
- ***************************************************************************/
-/***************************************************************************
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. See also the license.txt file for *
- * additional informations. *
- * *
- ***************************************************************************/
-
-#ifndef _PRIMDRAW_H_
-#define _PRIMDRAW_H_
-
-void UploadScreen (long Position);
-void PrepareFullScreenUpload (long Position);
-
-#endif // _PRIMDRAW_H_
* *
***************************************************************************/
-#define _IN_SOFT
-
-#include "externals.h"
-#include "soft.h"
-
-//#define VC_INLINE
-#include "gpu.h"
-#include "prim.h"
-#include "menu.h"
-#include "swap.h"
-
-////////////////////////////////////////////////////////////////////////////////////
-// "NO EDGE BUFFER" POLY VERSION... FUNCS BASED ON FATMAP.TXT FROM MRI / Doomsday
-////////////////////////////////////////////////////////////////////////////////////
-
-////////////////////////////////////////////////////////////////////////////////////
-// defines
-////////////////////////////////////////////////////////////////////////////////////
-
// switches for painting textured quads as 2 triangles (small glitches, but better shading!)
// can be toggled by game fix 0x200 in version 1.17 anyway, so let the defines enabled!
-
#define POLYQUAD3
#define POLYQUAD3GT
// fast solid loops... a bit more additional code, of course
-
#define FASTSOLID
// psx blending mode 3 with 25% incoming color (instead 50% without the define)
-
#define HALFBRIGHTMODE3
// color decode defines
#define XPSXCOL(r,g,b) ((g&0x7c00)|(b&0x3e0)|(r&0x1f))
-////////////////////////////////////////////////////////////////////////////////////
// soft globals
-////////////////////////////////////////////////////////////////////////////////////
-
short g_m1=255,g_m2=255,g_m3=255;
short DrawSemiTrans=FALSE;
short Ymin;
short Ymax;
-
short ly0,lx0,ly1,lx1,ly2,lx2,ly3,lx3; // global psx vertex coords
-int32_t GlobalTextAddrX,GlobalTextAddrY,GlobalTextTP;
+int32_t GlobalTextAddrX,GlobalTextAddrY,GlobalTextTP,GlobalTextIL;
int32_t GlobalTextREST,GlobalTextABR,GlobalTextPAGE;
////////////////////////////////////////////////////////////////////////
// POLYGON OFFSET FUNCS
////////////////////////////////////////////////////////////////////////
-void offsetPSXLine(void)
-{
- short x0,x1,y0,y1,dx,dy;float px,py;
-
- x0 = lx0+1+PSXDisplay.DrawOffset.x;
- x1 = lx1+1+PSXDisplay.DrawOffset.x;
- y0 = ly0+1+PSXDisplay.DrawOffset.y;
- y1 = ly1+1+PSXDisplay.DrawOffset.y;
-
- dx=x1-x0;
- dy=y1-y0;
-
- // tricky line width without sqrt
-
- if(dx>=0)
- {
- if(dy>=0)
- {
- px=0.5f;
- if(dx>dy) py=-0.5f;
- else if(dx<dy) py= 0.5f;
- else py= 0.0f;
- }
- else
- {
- py=-0.5f;
- dy=-dy;
- if(dx>dy) px= 0.5f;
- else if(dx<dy) px=-0.5f;
- else px= 0.0f;
- }
- }
- else
- {
- if(dy>=0)
- {
- py=0.5f;
- dx=-dx;
- if(dx>dy) px=-0.5f;
- else if(dx<dy) px= 0.5f;
- else px= 0.0f;
- }
- else
- {
- px=-0.5f;
- if(dx>dy) py=-0.5f;
- else if(dx<dy) py= 0.5f;
- else py= 0.0f;
- }
- }
-
- lx0=(short)((float)x0-px);
- lx3=(short)((float)x0+py);
-
- ly0=(short)((float)y0-py);
- ly3=(short)((float)y0-px);
-
- lx1=(short)((float)x1-py);
- lx2=(short)((float)x1+px);
-
- ly1=(short)((float)y1+px);
- ly2=(short)((float)y1+py);
-}
-
-void offsetPSX2(void)
+static void offsetPSX2(void)
{
lx0 += PSXDisplay.DrawOffset.x;
ly0 += PSXDisplay.DrawOffset.y;
ly1 += PSXDisplay.DrawOffset.y;
}
-void offsetPSX3(void)
+static void offsetPSX3(void)
{
lx0 += PSXDisplay.DrawOffset.x;
ly0 += PSXDisplay.DrawOffset.y;
ly2 += PSXDisplay.DrawOffset.y;
}
-void offsetPSX4(void)
+static void offsetPSX4(void)
{
lx0 += PSXDisplay.DrawOffset.x;
ly0 += PSXDisplay.DrawOffset.y;
4, 3, 5, 2
};
-void Dither16(unsigned short * pdest,uint32_t r,uint32_t g,uint32_t b,unsigned short sM)
+static inline void Dither16(unsigned short * pdest,uint32_t r,uint32_t g,uint32_t b,unsigned short sM)
{
unsigned char coeff;
unsigned char rlow, glow, blow;
/////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////
-__inline void GetShadeTransCol_Dither(unsigned short * pdest, int32_t m1, int32_t m2, int32_t m3)
+static inline void GetShadeTransCol_Dither(unsigned short * pdest, int32_t m1, int32_t m2, int32_t m3)
{
int32_t r,g,b;
////////////////////////////////////////////////////////////////////////
-__inline void GetShadeTransCol(unsigned short * pdest,unsigned short color)
+static inline void GetShadeTransCol(unsigned short * pdest,unsigned short color)
{
if(bCheckMask && (*pdest & HOST2LE16(0x8000))) return;
{
PUTLE16(pdest, (((GETLE16(pdest)&0x7bde)>>1)+(((color)&0x7bde)>>1))|sSetMask);//0x8000;
return;
-/*
- r=(XCOL1(*pdest)>>1)+((XCOL1(color))>>1);
- b=(XCOL2(*pdest)>>1)+((XCOL2(color))>>1);
- g=(XCOL3(*pdest)>>1)+((XCOL3(color))>>1);
-*/
}
else
if(GlobalTextABR==1)
////////////////////////////////////////////////////////////////////////
-__inline void GetShadeTransCol32(uint32_t * pdest,uint32_t color)
+static inline void GetShadeTransCol32(uint32_t * pdest,uint32_t color)
{
if(DrawSemiTrans)
{
////////////////////////////////////////////////////////////////////////
-__inline void GetTextureTransColG(unsigned short * pdest,unsigned short color)
+static inline void GetTextureTransColG(unsigned short * pdest,unsigned short color)
{
int32_t r,g,b;unsigned short l;
r=(XCOL1(d))+((((XCOL1(color)))* g_m1)>>7);
b=(XCOL2(d))+((((XCOL2(color)))* g_m2)>>7);
g=(XCOL3(d))+((((XCOL3(color)))* g_m3)>>7);
-
-/*
- r=(XCOL1(*pdest)>>1)+((((XCOL1(color))>>1)* g_m1)>>7);
- b=(XCOL2(*pdest)>>1)+((((XCOL2(color))>>1)* g_m2)>>7);
- g=(XCOL3(*pdest)>>1)+((((XCOL3(color))>>1)* g_m3)>>7);
-*/
}
else
if(GlobalTextABR==1)
////////////////////////////////////////////////////////////////////////
-__inline void GetTextureTransColG_S(unsigned short * pdest,unsigned short color)
+static inline void GetTextureTransColG_S(unsigned short * pdest,unsigned short color)
{
int32_t r,g,b;unsigned short l;
////////////////////////////////////////////////////////////////////////
-__inline void GetTextureTransColG_SPR(unsigned short * pdest,unsigned short color)
+static inline void GetTextureTransColG_SPR(unsigned short * pdest,unsigned short color)
{
int32_t r,g,b;unsigned short l;
r=(XCOL1(d))+((((XCOL1(color)))* g_m1)>>7);
b=(XCOL2(d))+((((XCOL2(color)))* g_m2)>>7);
g=(XCOL3(d))+((((XCOL3(color)))* g_m3)>>7);
-
-/*
- r=(XCOL1(*pdest)>>1)+((((XCOL1(color))>>1)* g_m1)>>7);
- b=(XCOL2(*pdest)>>1)+((((XCOL2(color))>>1)* g_m2)>>7);
- g=(XCOL3(*pdest)>>1)+((((XCOL3(color))>>1)* g_m3)>>7);
-*/
}
else
if(GlobalTextABR==1)
////////////////////////////////////////////////////////////////////////
-__inline void GetTextureTransColG32(uint32_t * pdest,uint32_t color)
+static inline void GetTextureTransColG32(uint32_t * pdest,uint32_t color)
{
int32_t r,g,b,l;
////////////////////////////////////////////////////////////////////////
-__inline void GetTextureTransColG32_S(uint32_t * pdest,uint32_t color)
+static inline void GetTextureTransColG32_S(uint32_t * pdest,uint32_t color)
{
int32_t r,g,b;
////////////////////////////////////////////////////////////////////////
-__inline void GetTextureTransColG32_SPR(uint32_t * pdest,uint32_t color)
+static inline void GetTextureTransColG32_SPR(uint32_t * pdest,uint32_t color)
{
int32_t r,g,b;
////////////////////////////////////////////////////////////////////////
-__inline void GetTextureTransColGX_Dither(unsigned short * pdest,unsigned short color,int32_t m1,int32_t m2,int32_t m3)
+static inline void GetTextureTransColGX_Dither(unsigned short * pdest,unsigned short color,int32_t m1,int32_t m2,int32_t m3)
{
int32_t r,g,b;
////////////////////////////////////////////////////////////////////////
-__inline void GetTextureTransColGX(unsigned short * pdest,unsigned short color,short m1,short m2,short m3)
+static inline void GetTextureTransColGX(unsigned short * pdest,unsigned short color,short m1,short m2,short m3)
{
int32_t r,g,b;unsigned short l;
r=(XCOL1(d))+((((XCOL1(color)))* m1)>>7);
b=(XCOL2(d))+((((XCOL2(color)))* m2)>>7);
g=(XCOL3(d))+((((XCOL3(color)))* m3)>>7);
-/*
- r=(XCOL1(*pdest)>>1)+((((XCOL1(color))>>1)* m1)>>7);
- b=(XCOL2(*pdest)>>1)+((((XCOL2(color))>>1)* m2)>>7);
- g=(XCOL3(*pdest)>>1)+((((XCOL3(color))>>1)* m3)>>7);
-*/
}
else
if(GlobalTextABR==1)
////////////////////////////////////////////////////////////////////////
-__inline void GetTextureTransColGX_S(unsigned short * pdest,unsigned short color,short m1,short m2,short m3)
+static inline void GetTextureTransColGX_S(unsigned short * pdest,unsigned short color,short m1,short m2,short m3)
{
int32_t r,g,b;
////////////////////////////////////////////////////////////////////////
-__inline void GetTextureTransColGX32_S(uint32_t * pdest,uint32_t color,short m1,short m2,short m3)
+static inline void GetTextureTransColGX32_S(uint32_t * pdest,uint32_t color,short m1,short m2,short m3)
{
int32_t r,g,b;
// FILL FUNCS
////////////////////////////////////////////////////////////////////////
-void FillSoftwareAreaTrans(short x0,short y0,short x1, // FILL AREA TRANS
+static void FillSoftwareAreaTrans(short x0,short y0,short x1, // FILL AREA TRANS
short y1,unsigned short col)
{
short j,i,dx,dy;
x0=max(x0,drawX);
y0=max(y0,drawY);
- if(y0>=iGPUHeight) return;
+ if(y0>=512) return;
if(x0>1023) return;
- if(y1>iGPUHeight) y1=iGPUHeight;
+ if(y1>512) y1=512;
if(x1>1024) x1=1024;
dx=x1-x0;dy=y1-y0;
if(dx==1 && dy==1 && x0==1020 && y0==511) // special fix for pinball game... emu protection???
{
-/*
-m->v 1020 511 1 1
-writedatamem 0x00000000 1
-tile1 newcol 7fff (orgcol 0xffffff), oldvram 0
-v->m 1020 511 1 1
-readdatamem 0x00007fff 1
-m->v 1020 511 1 1
-writedatamem 0x00000000 1
-tile1 newcol 8000 (orgcol 0xffffff), oldvram 0
-v->m 1020 511 1 1
-readdatamem 0x00008000 1
-*/
-
static int iCheat=0;
col+=iCheat;
if(iCheat==1) iCheat=0; else iCheat=1;
////////////////////////////////////////////////////////////////////////
-void FillSoftwareArea(short x0,short y0,short x1, // FILL AREA (BLK FILL)
+static void FillSoftwareArea(short x0,short y0,short x1, // FILL AREA (BLK FILL)
short y1,unsigned short col) // no draw area check here!
{
short j,i,dx,dy;
if(y0>y1) return;
if(x0>x1) return;
- if(y0>=iGPUHeight) return;
+ if(y0>=512) return;
if(x0>1023) return;
- if(y1>iGPUHeight) y1=iGPUHeight;
+ if(y1>512) y1=512;
if(x1>1024) x1=1024;
dx=x1-x0;dy=y1-y0;
static int left_G, delta_left_G, right_G, delta_right_G;
static int left_B, delta_left_B, right_B, delta_right_B;
-#ifdef USE_NASM
-
-// NASM version (external):
-#define shl10idiv i386_shl10idiv
-
-__inline int shl10idiv(int x, int y);
-
-#else
-
-__inline int shl10idiv(int x, int y)
+// USE_NASM
+static inline int shl10idiv(int x, int y)
{
__int64 bi=x;
bi<<=10;
return bi/y;
}
-#endif
-
-#if 0
-
-// GNUC long long int version:
-
-__inline int shl10idiv(int x, int y)
-{
- long long int bi=x;
- bi<<=10;
- return bi/y;
-}
-
-#endif
-
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
-__inline int RightSection_F(void)
+static inline int RightSection_F(void)
{
soft_vertex * v1 = right_array[ right_section ];
soft_vertex * v2 = right_array[ right_section-1 ];
////////////////////////////////////////////////////////////////////////
-__inline int LeftSection_F(void)
+static inline int LeftSection_F(void)
{
soft_vertex * v1 = left_array[ left_section ];
soft_vertex * v2 = left_array[ left_section-1 ];
////////////////////////////////////////////////////////////////////////
-__inline BOOL NextRow_F(void)
+static inline BOOL NextRow_F(void)
{
if(--left_section_height<=0)
{
////////////////////////////////////////////////////////////////////////
-__inline BOOL SetupSections_F(short x1, short y1, short x2, short y2, short x3, short y3)
+static inline BOOL SetupSections_F(short x1, short y1, short x2, short y2, short x3, short y3)
{
soft_vertex * v1, * v2, * v3;
int height,longest;
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
-__inline int RightSection_G(void)
+static inline int RightSection_G(void)
{
soft_vertex * v1 = right_array[ right_section ];
soft_vertex * v2 = right_array[ right_section-1 ];
////////////////////////////////////////////////////////////////////////
-__inline int LeftSection_G(void)
+static inline int LeftSection_G(void)
{
soft_vertex * v1 = left_array[ left_section ];
soft_vertex * v2 = left_array[ left_section-1 ];
////////////////////////////////////////////////////////////////////////
-__inline BOOL NextRow_G(void)
+static inline BOOL NextRow_G(void)
{
if(--left_section_height<=0)
{
////////////////////////////////////////////////////////////////////////
-__inline BOOL SetupSections_G(short x1,short y1,short x2,short y2,short x3,short y3,int32_t rgb1, int32_t rgb2, int32_t rgb3)
+static inline BOOL SetupSections_G(short x1,short y1,short x2,short y2,short x3,short y3,int32_t rgb1, int32_t rgb2, int32_t rgb3)
{
soft_vertex * v1, * v2, * v3;
int height,longest,temp;
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
-__inline int RightSection_FT(void)
+static inline int RightSection_FT(void)
{
soft_vertex * v1 = right_array[ right_section ];
soft_vertex * v2 = right_array[ right_section-1 ];
////////////////////////////////////////////////////////////////////////
-__inline int LeftSection_FT(void)
+static inline int LeftSection_FT(void)
{
soft_vertex * v1 = left_array[ left_section ];
soft_vertex * v2 = left_array[ left_section-1 ];
////////////////////////////////////////////////////////////////////////
-__inline BOOL NextRow_FT(void)
+static inline BOOL NextRow_FT(void)
{
if(--left_section_height<=0)
{
////////////////////////////////////////////////////////////////////////
-__inline BOOL SetupSections_FT(short x1, short y1, short x2, short y2, short x3, short y3, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3)
+static inline BOOL SetupSections_FT(short x1, short y1, short x2, short y2, short x3, short y3, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3)
{
soft_vertex * v1, * v2, * v3;
int height,longest,temp;
delta_right_u=shl10idiv(temp*((v3->u - v1->u)>>10)+((v1->u - v2->u)<<6),longest);
delta_right_v=shl10idiv(temp*((v3->v - v1->v)>>10)+((v1->v - v2->v)<<6),longest);
-/*
-Mmm... adjust neg tex deltas... will sometimes cause slight
-texture distortions
-
- longest>>=16;
- if(longest)
- {
- if(longest<0) longest=-longest;
- if(delta_right_u<0)
- delta_right_u-=delta_right_u/longest;
- if(delta_right_v<0)
- delta_right_v-=delta_right_v/longest;
- }
-*/
-
return TRUE;
}
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
-__inline int RightSection_GT(void)
+static inline int RightSection_GT(void)
{
soft_vertex * v1 = right_array[ right_section ];
soft_vertex * v2 = right_array[ right_section-1 ];
////////////////////////////////////////////////////////////////////////
-__inline int LeftSection_GT(void)
+static inline int LeftSection_GT(void)
{
soft_vertex * v1 = left_array[ left_section ];
soft_vertex * v2 = left_array[ left_section-1 ];
////////////////////////////////////////////////////////////////////////
-__inline BOOL NextRow_GT(void)
+static inline BOOL NextRow_GT(void)
{
if(--left_section_height<=0)
{
////////////////////////////////////////////////////////////////////////
-__inline BOOL SetupSections_GT(short x1, short y1, short x2, short y2, short x3, short y3, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3, int32_t rgb1, int32_t rgb2, int32_t rgb3)
+static inline BOOL SetupSections_GT(short x1, short y1, short x2, short y2, short x3, short y3, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3, int32_t rgb1, int32_t rgb2, int32_t rgb3)
{
soft_vertex * v1, * v2, * v3;
int height,longest,temp;
delta_right_u=shl10idiv(temp*((v3->u - v1->u)>>10)+((v1->u - v2->u)<<6),longest);
delta_right_v=shl10idiv(temp*((v3->v - v1->v)>>10)+((v1->v - v2->v)<<6),longest);
-
-/*
-Mmm... adjust neg tex deltas... will sometimes cause slight
-texture distortions
- longest>>=16;
- if(longest)
- {
- if(longest<0) longest=-longest;
- if(delta_right_u<0)
- delta_right_u-=delta_right_u/longest;
- if(delta_right_v<0)
- delta_right_v-=delta_right_v/longest;
- }
-*/
-
-
return TRUE;
}
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
-__inline int RightSection_F4(void)
+static inline int RightSection_F4(void)
{
soft_vertex * v1 = right_array[ right_section ];
soft_vertex * v2 = right_array[ right_section-1 ];
////////////////////////////////////////////////////////////////////////
-__inline int LeftSection_F4(void)
+static inline int LeftSection_F4(void)
{
soft_vertex * v1 = left_array[ left_section ];
soft_vertex * v2 = left_array[ left_section-1 ];
////////////////////////////////////////////////////////////////////////
-__inline BOOL NextRow_F4(void)
+static inline BOOL NextRow_F4(void)
{
if(--left_section_height<=0)
{
////////////////////////////////////////////////////////////////////////
-__inline BOOL SetupSections_F4(short x1, short y1, short x2, short y2, short x3, short y3, short x4, short y4)
+static inline BOOL SetupSections_F4(short x1, short y1, short x2, short y2, short x3, short y3, short x4, short y4)
{
soft_vertex * v1, * v2, * v3, * v4;
int height,width,longest1,longest2;
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
-__inline int RightSection_FT4(void)
+static inline int RightSection_FT4(void)
{
soft_vertex * v1 = right_array[ right_section ];
soft_vertex * v2 = right_array[ right_section-1 ];
////////////////////////////////////////////////////////////////////////
-__inline int LeftSection_FT4(void)
+static inline int LeftSection_FT4(void)
{
soft_vertex * v1 = left_array[ left_section ];
soft_vertex * v2 = left_array[ left_section-1 ];
////////////////////////////////////////////////////////////////////////
-__inline BOOL NextRow_FT4(void)
+static inline BOOL NextRow_FT4(void)
{
if(--left_section_height<=0)
{
////////////////////////////////////////////////////////////////////////
-__inline BOOL SetupSections_FT4(short x1, short y1, short x2, short y2, short x3, short y3, short x4, short y4, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3, short tx4, short ty4)
+static inline BOOL SetupSections_FT4(short x1, short y1, short x2, short y2, short x3, short y3, short x4, short y4, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3, short tx4, short ty4)
{
soft_vertex * v1, * v2, * v3, * v4;
int height,width,longest1,longest2;
////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////
-__inline int RightSection_GT4(void)
+static inline int RightSection_GT4(void)
{
soft_vertex * v1 = right_array[ right_section ];
soft_vertex * v2 = right_array[ right_section-1 ];
////////////////////////////////////////////////////////////////////////
-__inline int LeftSection_GT4(void)
+static inline int LeftSection_GT4(void)
{
soft_vertex * v1 = left_array[ left_section ];
soft_vertex * v2 = left_array[ left_section-1 ];
////////////////////////////////////////////////////////////////////////
-__inline BOOL NextRow_GT4(void)
+static inline BOOL NextRow_GT4(void)
{
if(--left_section_height<=0)
{
////////////////////////////////////////////////////////////////////////
-__inline BOOL SetupSections_GT4(short x1, short y1, short x2, short y2, short x3, short y3, short x4, short y4, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3, short tx4, short ty4,int32_t rgb1,int32_t rgb2,int32_t rgb3,int32_t rgb4)
+static inline BOOL SetupSections_GT4(short x1, short y1, short x2, short y2, short x3, short y3, short x4, short y4, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3, short tx4, short ty4,int32_t rgb1,int32_t rgb2,int32_t rgb3,int32_t rgb4)
{
soft_vertex * v1, * v2, * v3, * v4;
int height,width,longest1,longest2;
// POLY 3/4 FLAT SHADED
////////////////////////////////////////////////////////////////////////
-__inline void drawPoly3Fi(short x1,short y1,short x2,short y2,short x3,short y3,int32_t rgb)
+static inline void drawPoly3Fi(short x1,short y1,short x2,short y2,short x3,short y3,int32_t rgb)
{
int i,j,xmin,xmax,ymin,ymax;
unsigned short color;uint32_t lcolor;
////////////////////////////////////////////////////////////////////////
-void drawPoly3F(int32_t rgb)
+static void drawPoly3F(int32_t rgb)
{
drawPoly3Fi(lx0,ly0,lx1,ly1,lx2,ly2,rgb);
}
#ifdef POLYQUAD3FS
-void drawPoly4F_TRI(int32_t rgb)
+static void drawPoly4F_TRI(int32_t rgb)
{
drawPoly3Fi(lx1,ly1,lx3,ly3,lx2,ly2,rgb);
drawPoly3Fi(lx0,ly0,lx1,ly1,lx2,ly2,rgb);
// more exact:
-void drawPoly4F(int32_t rgb)
+static void drawPoly4F(int32_t rgb)
{
int i,j,xmin,xmax,ymin,ymax;
unsigned short color;uint32_t lcolor;
// POLY 3/4 F-SHADED TEX PAL 4
////////////////////////////////////////////////////////////////////////
-void drawPoly3TEx4(short x1, short y1, short x2, short y2, short x3, short y3, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3,short clX, short clY)
+static void drawPoly3TEx4(short x1, short y1, short x2, short y2, short x3, short y3, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3,short clX, short clY)
{
int i,j,xmin,xmax,ymin,ymax;
int32_t difX, difY,difX2, difY2;
////////////////////////////////////////////////////////////////////////
-void drawPoly3TEx4_IL(short x1, short y1, short x2, short y2, short x3, short y3, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3,short clX, short clY)
+static void drawPoly3TEx4_IL(short x1, short y1, short x2, short y2, short x3, short y3, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3,short clX, short clY)
{
int i,j,xmin,xmax,ymin,ymax,n_xi,n_yi,TXV;
int32_t difX, difY,difX2, difY2;
////////////////////////////////////////////////////////////////////////
-void drawPoly3TEx4_TW(short x1, short y1, short x2, short y2, short x3, short y3, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3,short clX, short clY)
+static void drawPoly3TEx4_TW(short x1, short y1, short x2, short y2, short x3, short y3, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3,short clX, short clY)
{
int i,j,xmin,xmax,ymin,ymax;
int32_t difX, difY,difX2, difY2;
#ifdef POLYQUAD3
-void drawPoly4TEx4_TRI(short x1, short y1, short x2, short y2, short x3, short y3, short x4, short y4, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3, short tx4, short ty4,short clX, short clY)
+static void drawPoly4TEx4_TRI(short x1, short y1, short x2, short y2, short x3, short y3, short x4, short y4, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3, short tx4, short ty4,short clX, short clY)
{
drawPoly3TEx4(x2,y2,x3,y3,x4,y4,
tx2,ty2,tx3,ty3,tx4,ty4,
// more exact:
-void drawPoly4TEx4(short x1, short y1, short x2, short y2, short x3, short y3, short x4, short y4, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3, short tx4, short ty4,short clX, short clY)
+static void drawPoly4TEx4(short x1, short y1, short x2, short y2, short x3, short y3, short x4, short y4, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3, short tx4, short ty4,short clX, short clY)
{
int32_t num;
int32_t i,j,xmin,xmax,ymin,ymax;
////////////////////////////////////////////////////////////////////////
-void drawPoly4TEx4_IL(short x1, short y1, short x2, short y2, short x3, short y3, short x4, short y4, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3, short tx4, short ty4,short clX, short clY)
+static void drawPoly4TEx4_IL(short x1, short y1, short x2, short y2, short x3, short y3, short x4, short y4, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3, short tx4, short ty4,short clX, short clY)
{
int32_t num;
int32_t i,j=0,xmin,xmax,ymin,ymax,n_xi,n_yi,TXV;
////////////////////////////////////////////////////////////////////////
-void drawPoly4TEx4_TW(short x1, short y1, short x2, short y2, short x3, short y3, short x4, short y4, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3, short tx4, short ty4,short clX, short clY)
+static void drawPoly4TEx4_TW(short x1, short y1, short x2, short y2, short x3, short y3, short x4, short y4, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3, short tx4, short ty4,short clX, short clY)
{
int32_t num;
int32_t i,j,xmin,xmax,ymin,ymax;
////////////////////////////////////////////////////////////////////////
-void drawPoly4TEx4_TW_S(short x1, short y1, short x2, short y2, short x3, short y3, short x4, short y4, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3, short tx4, short ty4,short clX, short clY)
+static void drawPoly4TEx4_TW_S(short x1, short y1, short x2, short y2, short x3, short y3, short x4, short y4, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3, short tx4, short ty4,short clX, short clY)
{
int32_t num;
int32_t i,j,xmin,xmax,ymin,ymax;
// POLY 3 F-SHADED TEX PAL 8
////////////////////////////////////////////////////////////////////////
-void drawPoly3TEx8(short x1, short y1, short x2, short y2, short x3, short y3, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3,short clX, short clY)
+static void drawPoly3TEx8(short x1, short y1, short x2, short y2, short x3, short y3, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3,short clX, short clY)
{
int i,j,xmin,xmax,ymin,ymax;
int32_t difX, difY,difX2, difY2;
////////////////////////////////////////////////////////////////////////
-void drawPoly3TEx8_IL(short x1, short y1, short x2, short y2, short x3, short y3, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3,short clX, short clY)
+static void drawPoly3TEx8_IL(short x1, short y1, short x2, short y2, short x3, short y3, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3,short clX, short clY)
{
int i,j,xmin,xmax,ymin,ymax,n_xi,n_yi,TXV,TXU;
int32_t difX, difY,difX2, difY2;
////////////////////////////////////////////////////////////////////////
-void drawPoly3TEx8_TW(short x1, short y1, short x2, short y2, short x3, short y3, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3,short clX, short clY)
+static void drawPoly3TEx8_TW(short x1, short y1, short x2, short y2, short x3, short y3, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3,short clX, short clY)
{
int i,j,xmin,xmax,ymin,ymax;
int32_t difX, difY,difX2, difY2;
#ifdef POLYQUAD3
-void drawPoly4TEx8_TRI(short x1, short y1, short x2, short y2, short x3, short y3, short x4, short y4, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3, short tx4, short ty4,short clX, short clY)
+static void drawPoly4TEx8_TRI(short x1, short y1, short x2, short y2, short x3, short y3, short x4, short y4, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3, short tx4, short ty4,short clX, short clY)
{
drawPoly3TEx8(x2,y2,x3,y3,x4,y4,
tx2,ty2,tx3,ty3,tx4,ty4,
// more exact:
-void drawPoly4TEx8(short x1, short y1, short x2, short y2, short x3, short y3, short x4, short y4, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3, short tx4, short ty4,short clX, short clY)
+static void drawPoly4TEx8(short x1, short y1, short x2, short y2, short x3, short y3, short x4, short y4, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3, short tx4, short ty4,short clX, short clY)
{
int32_t num;
int32_t i,j,xmin,xmax,ymin,ymax;
////////////////////////////////////////////////////////////////////////
-void drawPoly4TEx8_IL(short x1, short y1, short x2, short y2, short x3, short y3, short x4, short y4, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3, short tx4, short ty4,short clX, short clY)
+static void drawPoly4TEx8_IL(short x1, short y1, short x2, short y2, short x3, short y3, short x4, short y4, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3, short tx4, short ty4,short clX, short clY)
{
int32_t num;
int32_t i,j,xmin,xmax,ymin,ymax,n_xi,n_yi,TXV,TXU;
////////////////////////////////////////////////////////////////////////
-void drawPoly4TEx8_TW(short x1, short y1, short x2, short y2, short x3, short y3, short x4, short y4, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3, short tx4, short ty4,short clX, short clY)
+static void drawPoly4TEx8_TW(short x1, short y1, short x2, short y2, short x3, short y3, short x4, short y4, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3, short tx4, short ty4,short clX, short clY)
{
int32_t num;
int32_t i,j,xmin,xmax,ymin,ymax;
////////////////////////////////////////////////////////////////////////
-void drawPoly4TEx8_TW_S(short x1, short y1, short x2, short y2, short x3, short y3, short x4, short y4, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3, short tx4, short ty4,short clX, short clY)
+static void drawPoly4TEx8_TW_S(short x1, short y1, short x2, short y2, short x3, short y3, short x4, short y4, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3, short tx4, short ty4,short clX, short clY)
{
int32_t num;
int32_t i,j,xmin,xmax,ymin,ymax;
// POLY 3 F-SHADED TEX 15 BIT
////////////////////////////////////////////////////////////////////////
-void drawPoly3TD(short x1, short y1, short x2, short y2, short x3, short y3, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3)
+static void drawPoly3TD(short x1, short y1, short x2, short y2, short x3, short y3, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3)
{
int i,j,xmin,xmax,ymin,ymax;
int32_t difX, difY,difX2, difY2;
////////////////////////////////////////////////////////////////////////
-void drawPoly3TD_TW(short x1, short y1, short x2, short y2, short x3, short y3, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3)
+static void drawPoly3TD_TW(short x1, short y1, short x2, short y2, short x3, short y3, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3)
{
int i,j,xmin,xmax,ymin,ymax;
int32_t difX, difY,difX2, difY2;
#ifdef POLYQUAD3
-void drawPoly4TD_TRI(short x1, short y1, short x2, short y2, short x3, short y3, short x4, short y4, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3, short tx4, short ty4)
+static void drawPoly4TD_TRI(short x1, short y1, short x2, short y2, short x3, short y3, short x4, short y4, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3, short tx4, short ty4)
{
drawPoly3TD(x2,y2,x3,y3,x4,y4,
tx2,ty2,tx3,ty3,tx4,ty4);
// more exact:
-void drawPoly4TD(short x1, short y1, short x2, short y2, short x3, short y3, short x4, short y4, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3, short tx4, short ty4)
+static void drawPoly4TD(short x1, short y1, short x2, short y2, short x3, short y3, short x4, short y4, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3, short tx4, short ty4)
{
int32_t num;
int32_t i,j,xmin,xmax,ymin,ymax;
////////////////////////////////////////////////////////////////////////
-void drawPoly4TD_TW(short x1, short y1, short x2, short y2, short x3, short y3, short x4, short y4, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3, short tx4, short ty4)
+static void drawPoly4TD_TW(short x1, short y1, short x2, short y2, short x3, short y3, short x4, short y4, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3, short tx4, short ty4)
{
int32_t num;
int32_t i,j,xmin,xmax,ymin,ymax;
////////////////////////////////////////////////////////////////////////
-void drawPoly4TD_TW_S(short x1, short y1, short x2, short y2, short x3, short y3, short x4, short y4, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3, short tx4, short ty4)
+static void drawPoly4TD_TW_S(short x1, short y1, short x2, short y2, short x3, short y3, short x4, short y4, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3, short tx4, short ty4)
{
int32_t num;
int32_t i,j,xmin,xmax,ymin,ymax;
// POLY 3/4 G-SHADED
////////////////////////////////////////////////////////////////////////
-__inline void drawPoly3Gi(short x1,short y1,short x2,short y2,short x3,short y3,int32_t rgb1, int32_t rgb2, int32_t rgb3)
+static inline void drawPoly3Gi(short x1,short y1,short x2,short y2,short x3,short y3,int32_t rgb1, int32_t rgb2, int32_t rgb3)
{
int i,j,xmin,xmax,ymin,ymax;
int32_t cR1,cG1,cB1;
////////////////////////////////////////////////////////////////////////
-void drawPoly3G(int32_t rgb1, int32_t rgb2, int32_t rgb3)
+static void drawPoly3G(int32_t rgb1, int32_t rgb2, int32_t rgb3)
{
drawPoly3Gi(lx0,ly0,lx1,ly1,lx2,ly2,rgb1,rgb2,rgb3);
}
// draw two g-shaded tris for right psx shading emulation
-void drawPoly4G(int32_t rgb1, int32_t rgb2, int32_t rgb3, int32_t rgb4)
+static void drawPoly4G(int32_t rgb1, int32_t rgb2, int32_t rgb3, int32_t rgb4)
{
drawPoly3Gi(lx1,ly1,lx3,ly3,lx2,ly2,
rgb2,rgb4,rgb3);
// POLY 3/4 G-SHADED TEX PAL4
////////////////////////////////////////////////////////////////////////
-void drawPoly3TGEx4(short x1, short y1, short x2, short y2, short x3, short y3, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3, short clX, short clY,int32_t col1, int32_t col2, int32_t col3)
+static void drawPoly3TGEx4(short x1, short y1, short x2, short y2, short x3, short y3, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3, short clX, short clY,int32_t col1, int32_t col2, int32_t col3)
{
int i,j,xmin,xmax,ymin,ymax;
int32_t cR1,cG1,cB1;
////////////////////////////////////////////////////////////////////////
-void drawPoly3TGEx4_IL(short x1, short y1, short x2, short y2, short x3, short y3, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3, short clX, short clY,int32_t col1, int32_t col2, int32_t col3)
+static void drawPoly3TGEx4_IL(short x1, short y1, short x2, short y2, short x3, short y3, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3, short clX, short clY,int32_t col1, int32_t col2, int32_t col3)
{
int i,j,xmin,xmax,ymin,ymax,n_xi,n_yi,TXV;
int32_t cR1,cG1,cB1;
////////////////////////////////////////////////////////////////////////
-void drawPoly3TGEx4_TW(short x1, short y1, short x2, short y2, short x3, short y3, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3, short clX, short clY,int32_t col1, int32_t col2, int32_t col3)
+static void drawPoly3TGEx4_TW(short x1, short y1, short x2, short y2, short x3, short y3, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3, short clX, short clY,int32_t col1, int32_t col2, int32_t col3)
{
int i,j,xmin,xmax,ymin,ymax;
int32_t cR1,cG1,cB1;
// correct that way, so small texture distortions can
// happen...
-void drawPoly4TGEx4_TRI_IL(short x1, short y1, short x2, short y2, short x3, short y3, short x4, short y4,
+static void drawPoly4TGEx4_TRI_IL(short x1, short y1, short x2, short y2, short x3, short y3, short x4, short y4,
short tx1, short ty1, short tx2, short ty2, short tx3, short ty3, short tx4, short ty4,
short clX, short clY,
int32_t col1, int32_t col2, int32_t col3, int32_t col4)
#ifdef POLYQUAD3GT
-void drawPoly4TGEx4_TRI(short x1, short y1, short x2, short y2, short x3, short y3, short x4, short y4,
+static void drawPoly4TGEx4_TRI(short x1, short y1, short x2, short y2, short x3, short y3, short x4, short y4,
short tx1, short ty1, short tx2, short ty2, short tx3, short ty3, short tx4, short ty4,
short clX, short clY,
int32_t col1, int32_t col2, int32_t col3, int32_t col4)
////////////////////////////////////////////////////////////////////////
-void drawPoly4TGEx4(short x1, short y1, short x2, short y2, short x3, short y3, short x4, short y4,
+static void drawPoly4TGEx4(short x1, short y1, short x2, short y2, short x3, short y3, short x4, short y4,
short tx1, short ty1, short tx2, short ty2, short tx3, short ty3, short tx4, short ty4,
short clX, short clY,
int32_t col1, int32_t col2, int32_t col4, int32_t col3)
////////////////////////////////////////////////////////////////////////
-void drawPoly4TGEx4_TW(short x1, short y1, short x2, short y2, short x3, short y3, short x4, short y4,
+static void drawPoly4TGEx4_TW(short x1, short y1, short x2, short y2, short x3, short y3, short x4, short y4,
short tx1, short ty1, short tx2, short ty2, short tx3, short ty3, short tx4, short ty4,
short clX, short clY,
int32_t col1, int32_t col2, int32_t col3, int32_t col4)
// POLY 3/4 G-SHADED TEX PAL8
////////////////////////////////////////////////////////////////////////
-void drawPoly3TGEx8(short x1, short y1, short x2, short y2, short x3, short y3, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3, short clX, short clY,int32_t col1, int32_t col2, int32_t col3)
+static void drawPoly3TGEx8(short x1, short y1, short x2, short y2, short x3, short y3, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3, short clX, short clY,int32_t col1, int32_t col2, int32_t col3)
{
int i,j,xmin,xmax,ymin,ymax;
int32_t cR1,cG1,cB1;
////////////////////////////////////////////////////////////////////////
-void drawPoly3TGEx8_IL(short x1, short y1, short x2, short y2, short x3, short y3, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3, short clX, short clY,int32_t col1, int32_t col2, int32_t col3)
+static void drawPoly3TGEx8_IL(short x1, short y1, short x2, short y2, short x3, short y3, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3, short clX, short clY,int32_t col1, int32_t col2, int32_t col3)
{
int i,j,xmin,xmax,ymin,ymax,n_xi,n_yi,TXV,TXU;
int32_t cR1,cG1,cB1;
////////////////////////////////////////////////////////////////////////
-void drawPoly3TGEx8_TW(short x1, short y1, short x2, short y2, short x3, short y3, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3, short clX, short clY,int32_t col1, int32_t col2, int32_t col3)
+static void drawPoly3TGEx8_TW(short x1, short y1, short x2, short y2, short x3, short y3, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3, short clX, short clY,int32_t col1, int32_t col2, int32_t col3)
{
int i,j,xmin,xmax,ymin,ymax;
int32_t cR1,cG1,cB1;
// note: two g-shaded tris: small texture distortions can happen
-void drawPoly4TGEx8_TRI_IL(short x1, short y1, short x2, short y2, short x3, short y3, short x4, short y4,
+static void drawPoly4TGEx8_TRI_IL(short x1, short y1, short x2, short y2, short x3, short y3, short x4, short y4,
short tx1, short ty1, short tx2, short ty2, short tx3, short ty3, short tx4, short ty4,
short clX, short clY,
int32_t col1, int32_t col2, int32_t col3, int32_t col4)
#ifdef POLYQUAD3GT
-void drawPoly4TGEx8_TRI(short x1, short y1, short x2, short y2, short x3, short y3, short x4, short y4,
+static void drawPoly4TGEx8_TRI(short x1, short y1, short x2, short y2, short x3, short y3, short x4, short y4,
short tx1, short ty1, short tx2, short ty2, short tx3, short ty3, short tx4, short ty4,
short clX, short clY,
int32_t col1, int32_t col2, int32_t col3, int32_t col4)
#endif
-void drawPoly4TGEx8(short x1, short y1, short x2, short y2, short x3, short y3, short x4, short y4,
+static void drawPoly4TGEx8(short x1, short y1, short x2, short y2, short x3, short y3, short x4, short y4,
short tx1, short ty1, short tx2, short ty2, short tx3, short ty3, short tx4, short ty4,
short clX, short clY,
int32_t col1, int32_t col2, int32_t col4, int32_t col3)
////////////////////////////////////////////////////////////////////////
-void drawPoly4TGEx8_TW(short x1, short y1, short x2, short y2, short x3, short y3, short x4, short y4,
+static void drawPoly4TGEx8_TW(short x1, short y1, short x2, short y2, short x3, short y3, short x4, short y4,
short tx1, short ty1, short tx2, short ty2, short tx3, short ty3, short tx4, short ty4,
short clX, short clY,
int32_t col1, int32_t col2, int32_t col3, int32_t col4)
// POLY 3 G-SHADED TEX 15 BIT
////////////////////////////////////////////////////////////////////////
-void drawPoly3TGD(short x1, short y1, short x2, short y2, short x3, short y3, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3,int32_t col1, int32_t col2, int32_t col3)
+static void drawPoly3TGD(short x1, short y1, short x2, short y2, short x3, short y3, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3,int32_t col1, int32_t col2, int32_t col3)
{
int i,j,xmin,xmax,ymin,ymax;
int32_t cR1,cG1,cB1;
////////////////////////////////////////////////////////////////////////
-void drawPoly3TGD_TW(short x1, short y1, short x2, short y2, short x3, short y3, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3,int32_t col1, int32_t col2, int32_t col3)
+static void drawPoly3TGD_TW(short x1, short y1, short x2, short y2, short x3, short y3, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3,int32_t col1, int32_t col2, int32_t col3)
{
int i,j,xmin,xmax,ymin,ymax;
int32_t cR1,cG1,cB1;
#ifdef POLYQUAD3GT
-void drawPoly4TGD_TRI(short x1, short y1, short x2, short y2, short x3, short y3, short x4, short y4, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3, short tx4, short ty4, int32_t col1, int32_t col2, int32_t col3, int32_t col4)
+static void drawPoly4TGD_TRI(short x1, short y1, short x2, short y2, short x3, short y3, short x4, short y4, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3, short tx4, short ty4, int32_t col1, int32_t col2, int32_t col3, int32_t col4)
{
drawPoly3TGD(x2,y2,x3,y3,x4,y4,
tx2,ty2,tx3,ty3,tx4,ty4,
#endif
-void drawPoly4TGD(short x1, short y1, short x2, short y2, short x3, short y3, short x4, short y4, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3, short tx4, short ty4, int32_t col1, int32_t col2, int32_t col4, int32_t col3)
+static void drawPoly4TGD(short x1, short y1, short x2, short y2, short x3, short y3, short x4, short y4, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3, short tx4, short ty4, int32_t col1, int32_t col2, int32_t col4, int32_t col3)
{
int32_t num;
int32_t i,j,xmin,xmax,ymin,ymax;
////////////////////////////////////////////////////////////////////////
-void drawPoly4TGD_TW(short x1, short y1, short x2, short y2, short x3, short y3, short x4, short y4, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3, short tx4, short ty4, int32_t col1, int32_t col2, int32_t col3, int32_t col4)
+static void drawPoly4TGD_TW(short x1, short y1, short x2, short y2, short x3, short y3, short x4, short y4, short tx1, short ty1, short tx2, short ty2, short tx3, short ty3, short tx4, short ty4, int32_t col1, int32_t col2, int32_t col3, int32_t col4)
{
drawPoly3TGD_TW(x2,y2,x3,y3,x4,y4,
tx2,ty2,tx3,ty3,tx4,ty4,
/*
// no real rect test, but it does its job the way I need it
-__inline BOOL IsNoRect(void)
+static inline BOOL IsNoRect(void)
{
if(lx0==lx1 && lx2==lx3) return FALSE;
if(lx0==lx2 && lx1==lx3) return FALSE;
*/
// real rect test
-__inline BOOL IsNoRect(void)
+static inline BOOL IsNoRect(void)
{
if(!(dwActFixes&0x200)) return FALSE;
////////////////////////////////////////////////////////////////////////
-void drawPoly3FT(unsigned char * baseAddr)
+static void drawPoly3FT(unsigned char * baseAddr)
{
uint32_t *gpuData = ((uint32_t *) baseAddr);
if(GlobalTextTP==0)
drawPoly3TEx4_IL(lx0,ly0,lx1,ly1,lx2,ly2,
(GETLE32(&gpuData[2]) & 0x000000ff), ((GETLE32(&gpuData[2])>>8) & 0x000000ff), (GETLE32(&gpuData[4]) & 0x000000ff), ((GETLE32(&gpuData[4])>>8) & 0x000000ff),(GETLE32(&gpuData[6]) & 0x000000ff), ((GETLE32(&gpuData[6])>>8) & 0x000000ff),
- ((GETLE32(&gpuData[2])>>12) & 0x3f0), ((GETLE32(&gpuData[2])>>22) & iGPUHeightMask));
+ ((GETLE32(&gpuData[2])>>12) & 0x3f0), ((GETLE32(&gpuData[2])>>22) & 511));
else
drawPoly3TEx8_IL(lx0,ly0,lx1,ly1,lx2,ly2,
(GETLE32(&gpuData[2]) & 0x000000ff), ((GETLE32(&gpuData[2])>>8) & 0x000000ff), (GETLE32(&gpuData[4]) & 0x000000ff), ((GETLE32(&gpuData[4])>>8) & 0x000000ff),(GETLE32(&gpuData[6]) & 0x000000ff), ((GETLE32(&gpuData[6])>>8) & 0x000000ff),
- ((GETLE32(&gpuData[2])>>12) & 0x3f0), ((GETLE32(&gpuData[2])>>22) & iGPUHeightMask));
+ ((GETLE32(&gpuData[2])>>12) & 0x3f0), ((GETLE32(&gpuData[2])>>22) & 511));
return;
}
case 0:
drawPoly3TEx4(lx0,ly0,lx1,ly1,lx2,ly2,
(GETLE32(&gpuData[2]) & 0x000000ff), ((GETLE32(&gpuData[2])>>8) & 0x000000ff), (GETLE32(&gpuData[4]) & 0x000000ff), ((GETLE32(&gpuData[4])>>8) & 0x000000ff),(GETLE32(&gpuData[6]) & 0x000000ff), ((GETLE32(&gpuData[6])>>8) & 0x000000ff),
- ((GETLE32(&gpuData[2])>>12) & 0x3f0), ((GETLE32(&gpuData[2])>>22) & iGPUHeightMask));
+ ((GETLE32(&gpuData[2])>>12) & 0x3f0), ((GETLE32(&gpuData[2])>>22) & 511));
return;
case 1:
drawPoly3TEx8(lx0,ly0,lx1,ly1,lx2,ly2,
(GETLE32(&gpuData[2]) & 0x000000ff), ((GETLE32(&gpuData[2])>>8) & 0x000000ff), (GETLE32(&gpuData[4]) & 0x000000ff), ((GETLE32(&gpuData[4])>>8) & 0x000000ff),(GETLE32(&gpuData[6]) & 0x000000ff), ((GETLE32(&gpuData[6])>>8) & 0x000000ff),
- ((GETLE32(&gpuData[2])>>12) & 0x3f0), ((GETLE32(&gpuData[2])>>22) & iGPUHeightMask));
+ ((GETLE32(&gpuData[2])>>12) & 0x3f0), ((GETLE32(&gpuData[2])>>22) & 511));
return;
case 2:
drawPoly3TD(lx0,ly0,lx1,ly1,lx2,ly2,(GETLE32(&gpuData[2]) & 0x000000ff), ((GETLE32(&gpuData[2])>>8) & 0x000000ff), (GETLE32(&gpuData[4]) & 0x000000ff), ((GETLE32(&gpuData[4])>>8) & 0x000000ff),(GETLE32(&gpuData[6]) & 0x000000ff), ((GETLE32(&gpuData[6])>>8) & 0x000000ff));
case 0:
drawPoly3TEx4_TW(lx0,ly0,lx1,ly1,lx2,ly2,
(GETLE32(&gpuData[2]) & 0x000000ff), ((GETLE32(&gpuData[2])>>8) & 0x000000ff), (GETLE32(&gpuData[4]) & 0x000000ff), ((GETLE32(&gpuData[4])>>8) & 0x000000ff),(GETLE32(&gpuData[6]) & 0x000000ff), ((GETLE32(&gpuData[6])>>8) & 0x000000ff),
- ((GETLE32(&gpuData[2])>>12) & 0x3f0), ((GETLE32(&gpuData[2])>>22) & iGPUHeightMask));
+ ((GETLE32(&gpuData[2])>>12) & 0x3f0), ((GETLE32(&gpuData[2])>>22) & 511));
return;
case 1:
drawPoly3TEx8_TW(lx0,ly0,lx1,ly1,lx2,ly2,
(GETLE32(&gpuData[2]) & 0x000000ff), ((GETLE32(&gpuData[2])>>8) & 0x000000ff), (GETLE32(&gpuData[4]) & 0x000000ff), ((GETLE32(&gpuData[4])>>8) & 0x000000ff),(GETLE32(&gpuData[6]) & 0x000000ff), ((GETLE32(&gpuData[6])>>8) & 0x000000ff),
- ((GETLE32(&gpuData[2])>>12) & 0x3f0), ((GETLE32(&gpuData[2])>>22) & iGPUHeightMask));
+ ((GETLE32(&gpuData[2])>>12) & 0x3f0), ((GETLE32(&gpuData[2])>>22) & 511));
return;
case 2:
drawPoly3TD_TW(lx0,ly0,lx1,ly1,lx2,ly2,(GETLE32(&gpuData[2]) & 0x000000ff), ((GETLE32(&gpuData[2])>>8) & 0x000000ff), (GETLE32(&gpuData[4]) & 0x000000ff), ((GETLE32(&gpuData[4])>>8) & 0x000000ff),(GETLE32(&gpuData[6]) & 0x000000ff), ((GETLE32(&gpuData[6])>>8) & 0x000000ff));
////////////////////////////////////////////////////////////////////////
-void drawPoly4FT(unsigned char * baseAddr)
+static void drawPoly4FT(unsigned char * baseAddr)
{
uint32_t *gpuData = ((uint32_t *) baseAddr);
{
if(GlobalTextTP==0)
drawPoly4TEx4_IL(lx0,ly0,lx1,ly1,lx3,ly3,lx2,ly2,
- (GETLE32(&gpuData[2]) & 0x000000ff), ((GETLE32(&gpuData[2])>>8) & 0x000000ff), (GETLE32(&gpuData[4]) & 0x000000ff), ((GETLE32(&gpuData[4])>>8) & 0x000000ff),(GETLE32(&gpuData[8]) & 0x000000ff), ((GETLE32(&gpuData[8])>>8) & 0x000000ff),(GETLE32(&gpuData[6]) & 0x000000ff), ((GETLE32(&gpuData[6])>>8) & 0x000000ff), ((GETLE32(&gpuData[2])>>12) & 0x3f0), ((GETLE32(&gpuData[2])>>22) & iGPUHeightMask));
+ (GETLE32(&gpuData[2]) & 0x000000ff), ((GETLE32(&gpuData[2])>>8) & 0x000000ff), (GETLE32(&gpuData[4]) & 0x000000ff), ((GETLE32(&gpuData[4])>>8) & 0x000000ff),(GETLE32(&gpuData[8]) & 0x000000ff), ((GETLE32(&gpuData[8])>>8) & 0x000000ff),(GETLE32(&gpuData[6]) & 0x000000ff), ((GETLE32(&gpuData[6])>>8) & 0x000000ff), ((GETLE32(&gpuData[2])>>12) & 0x3f0), ((GETLE32(&gpuData[2])>>22) & 511));
else
drawPoly4TEx8_IL(lx0,ly0,lx1,ly1,lx3,ly3,lx2,ly2,
- (GETLE32(&gpuData[2]) & 0x000000ff), ((GETLE32(&gpuData[2])>>8) & 0x000000ff), (GETLE32(&gpuData[4]) & 0x000000ff), ((GETLE32(&gpuData[4])>>8) & 0x000000ff),(GETLE32(&gpuData[8]) & 0x000000ff), ((GETLE32(&gpuData[8])>>8) & 0x000000ff),(GETLE32(&gpuData[6]) & 0x000000ff), ((GETLE32(&gpuData[6])>>8) & 0x000000ff), ((GETLE32(&gpuData[2])>>12) & 0x3f0), ((GETLE32(&gpuData[2])>>22) & iGPUHeightMask));
+ (GETLE32(&gpuData[2]) & 0x000000ff), ((GETLE32(&gpuData[2])>>8) & 0x000000ff), (GETLE32(&gpuData[4]) & 0x000000ff), ((GETLE32(&gpuData[4])>>8) & 0x000000ff),(GETLE32(&gpuData[8]) & 0x000000ff), ((GETLE32(&gpuData[8])>>8) & 0x000000ff),(GETLE32(&gpuData[6]) & 0x000000ff), ((GETLE32(&gpuData[6])>>8) & 0x000000ff), ((GETLE32(&gpuData[2])>>12) & 0x3f0), ((GETLE32(&gpuData[2])>>22) & 511));
return;
}
{
case 0:
drawPoly4TEx4_TRI(lx0,ly0,lx1,ly1,lx3,ly3,lx2,ly2,
- (GETLE32(&gpuData[2]) & 0x000000ff), ((GETLE32(&gpuData[2])>>8) & 0x000000ff), (GETLE32(&gpuData[4]) & 0x000000ff), ((GETLE32(&gpuData[4])>>8) & 0x000000ff),(GETLE32(&gpuData[8]) & 0x000000ff), ((GETLE32(&gpuData[8])>>8) & 0x000000ff),(GETLE32(&gpuData[6]) & 0x000000ff), ((GETLE32(&gpuData[6])>>8) & 0x000000ff), ((GETLE32(&gpuData[2])>>12) & 0x3f0), ((GETLE32(&gpuData[2])>>22) & iGPUHeightMask));
+ (GETLE32(&gpuData[2]) & 0x000000ff), ((GETLE32(&gpuData[2])>>8) & 0x000000ff), (GETLE32(&gpuData[4]) & 0x000000ff), ((GETLE32(&gpuData[4])>>8) & 0x000000ff),(GETLE32(&gpuData[8]) & 0x000000ff), ((GETLE32(&gpuData[8])>>8) & 0x000000ff),(GETLE32(&gpuData[6]) & 0x000000ff), ((GETLE32(&gpuData[6])>>8) & 0x000000ff), ((GETLE32(&gpuData[2])>>12) & 0x3f0), ((GETLE32(&gpuData[2])>>22) & 511));
return;
case 1:
drawPoly4TEx8_TRI(lx0,ly0,lx1,ly1,lx3,ly3,lx2,ly2,
- (GETLE32(&gpuData[2]) & 0x000000ff), ((GETLE32(&gpuData[2])>>8) & 0x000000ff), (GETLE32(&gpuData[4]) & 0x000000ff), ((GETLE32(&gpuData[4])>>8) & 0x000000ff),(GETLE32(&gpuData[8]) & 0x000000ff), ((GETLE32(&gpuData[8])>>8) & 0x000000ff),(GETLE32(&gpuData[6]) & 0x000000ff), ((GETLE32(&gpuData[6])>>8) & 0x000000ff), ((GETLE32(&gpuData[2])>>12) & 0x3f0), ((GETLE32(&gpuData[2])>>22) & iGPUHeightMask));
+ (GETLE32(&gpuData[2]) & 0x000000ff), ((GETLE32(&gpuData[2])>>8) & 0x000000ff), (GETLE32(&gpuData[4]) & 0x000000ff), ((GETLE32(&gpuData[4])>>8) & 0x000000ff),(GETLE32(&gpuData[8]) & 0x000000ff), ((GETLE32(&gpuData[8])>>8) & 0x000000ff),(GETLE32(&gpuData[6]) & 0x000000ff), ((GETLE32(&gpuData[6])>>8) & 0x000000ff), ((GETLE32(&gpuData[2])>>12) & 0x3f0), ((GETLE32(&gpuData[2])>>22) & 511));
return;
case 2:
drawPoly4TD_TRI(lx0,ly0,lx1,ly1,lx3,ly3,lx2,ly2,(GETLE32(&gpuData[2]) & 0x000000ff), ((GETLE32(&gpuData[2])>>8) & 0x000000ff), (GETLE32(&gpuData[4]) & 0x000000ff), ((GETLE32(&gpuData[4])>>8) & 0x000000ff),(GETLE32(&gpuData[8]) & 0x000000ff), ((GETLE32(&gpuData[8])>>8) & 0x000000ff),(GETLE32(&gpuData[6]) & 0x000000ff), ((GETLE32(&gpuData[6])>>8) & 0x000000ff));
{
case 0: // grandia investigations needed
drawPoly4TEx4(lx0,ly0,lx1,ly1,lx3,ly3,lx2,ly2,
- (GETLE32(&gpuData[2]) & 0x000000ff), ((GETLE32(&gpuData[2])>>8) & 0x000000ff), (GETLE32(&gpuData[4]) & 0x000000ff), ((GETLE32(&gpuData[4])>>8) & 0x000000ff),(GETLE32(&gpuData[8]) & 0x000000ff), ((GETLE32(&gpuData[8])>>8) & 0x000000ff),(GETLE32(&gpuData[6]) & 0x000000ff), ((GETLE32(&gpuData[6])>>8) & 0x000000ff), ((GETLE32(&gpuData[2])>>12) & 0x3f0), ((GETLE32(&gpuData[2])>>22) & iGPUHeightMask));
+ (GETLE32(&gpuData[2]) & 0x000000ff), ((GETLE32(&gpuData[2])>>8) & 0x000000ff), (GETLE32(&gpuData[4]) & 0x000000ff), ((GETLE32(&gpuData[4])>>8) & 0x000000ff),(GETLE32(&gpuData[8]) & 0x000000ff), ((GETLE32(&gpuData[8])>>8) & 0x000000ff),(GETLE32(&gpuData[6]) & 0x000000ff), ((GETLE32(&gpuData[6])>>8) & 0x000000ff), ((GETLE32(&gpuData[2])>>12) & 0x3f0), ((GETLE32(&gpuData[2])>>22) & 511));
return;
case 1:
drawPoly4TEx8(lx0,ly0,lx1,ly1,lx3,ly3,lx2,ly2,
- (GETLE32(&gpuData[2]) & 0x000000ff), ((GETLE32(&gpuData[2])>>8) & 0x000000ff), (GETLE32(&gpuData[4]) & 0x000000ff), ((GETLE32(&gpuData[4])>>8) & 0x000000ff),(GETLE32(&gpuData[8]) & 0x000000ff), ((GETLE32(&gpuData[8])>>8) & 0x000000ff),(GETLE32(&gpuData[6]) & 0x000000ff), ((GETLE32(&gpuData[6])>>8) & 0x000000ff), ((GETLE32(&gpuData[2])>>12) & 0x3f0), ((GETLE32(&gpuData[2])>>22) & iGPUHeightMask));
+ (GETLE32(&gpuData[2]) & 0x000000ff), ((GETLE32(&gpuData[2])>>8) & 0x000000ff), (GETLE32(&gpuData[4]) & 0x000000ff), ((GETLE32(&gpuData[4])>>8) & 0x000000ff),(GETLE32(&gpuData[8]) & 0x000000ff), ((GETLE32(&gpuData[8])>>8) & 0x000000ff),(GETLE32(&gpuData[6]) & 0x000000ff), ((GETLE32(&gpuData[6])>>8) & 0x000000ff), ((GETLE32(&gpuData[2])>>12) & 0x3f0), ((GETLE32(&gpuData[2])>>22) & 511));
return;
case 2:
drawPoly4TD(lx0,ly0,lx1,ly1,lx3,ly3,lx2,ly2,(GETLE32(&gpuData[2]) & 0x000000ff), ((GETLE32(&gpuData[2])>>8) & 0x000000ff), (GETLE32(&gpuData[4]) & 0x000000ff), ((GETLE32(&gpuData[4])>>8) & 0x000000ff),(GETLE32(&gpuData[8]) & 0x000000ff), ((GETLE32(&gpuData[8])>>8) & 0x000000ff),(GETLE32(&gpuData[6]) & 0x000000ff), ((GETLE32(&gpuData[6])>>8) & 0x000000ff));
{
case 0:
drawPoly4TEx4_TW(lx0,ly0,lx1,ly1,lx3,ly3,lx2,ly2,
- (GETLE32(&gpuData[2]) & 0x000000ff), ((GETLE32(&gpuData[2])>>8) & 0x000000ff), (GETLE32(&gpuData[4]) & 0x000000ff), ((GETLE32(&gpuData[4])>>8) & 0x000000ff),(GETLE32(&gpuData[8]) & 0x000000ff), ((GETLE32(&gpuData[8])>>8) & 0x000000ff),(GETLE32(&gpuData[6]) & 0x000000ff), ((GETLE32(&gpuData[6])>>8) & 0x000000ff), ((GETLE32(&gpuData[2])>>12) & 0x3f0), ((GETLE32(&gpuData[2])>>22) & iGPUHeightMask));
+ (GETLE32(&gpuData[2]) & 0x000000ff), ((GETLE32(&gpuData[2])>>8) & 0x000000ff), (GETLE32(&gpuData[4]) & 0x000000ff), ((GETLE32(&gpuData[4])>>8) & 0x000000ff),(GETLE32(&gpuData[8]) & 0x000000ff), ((GETLE32(&gpuData[8])>>8) & 0x000000ff),(GETLE32(&gpuData[6]) & 0x000000ff), ((GETLE32(&gpuData[6])>>8) & 0x000000ff), ((GETLE32(&gpuData[2])>>12) & 0x3f0), ((GETLE32(&gpuData[2])>>22) & 511));
return;
case 1:
drawPoly4TEx8_TW(lx0,ly0,lx1,ly1,lx3,ly3,lx2,ly2,
- (GETLE32(&gpuData[2]) & 0x000000ff), ((GETLE32(&gpuData[2])>>8) & 0x000000ff), (GETLE32(&gpuData[4]) & 0x000000ff), ((GETLE32(&gpuData[4])>>8) & 0x000000ff),(GETLE32(&gpuData[8]) & 0x000000ff), ((GETLE32(&gpuData[8])>>8) & 0x000000ff),(GETLE32(&gpuData[6]) & 0x000000ff), ((GETLE32(&gpuData[6])>>8) & 0x000000ff), ((GETLE32(&gpuData[2])>>12) & 0x3f0), ((GETLE32(&gpuData[2])>>22) & iGPUHeightMask));
+ (GETLE32(&gpuData[2]) & 0x000000ff), ((GETLE32(&gpuData[2])>>8) & 0x000000ff), (GETLE32(&gpuData[4]) & 0x000000ff), ((GETLE32(&gpuData[4])>>8) & 0x000000ff),(GETLE32(&gpuData[8]) & 0x000000ff), ((GETLE32(&gpuData[8])>>8) & 0x000000ff),(GETLE32(&gpuData[6]) & 0x000000ff), ((GETLE32(&gpuData[6])>>8) & 0x000000ff), ((GETLE32(&gpuData[2])>>12) & 0x3f0), ((GETLE32(&gpuData[2])>>22) & 511));
return;
case 2:
drawPoly4TD_TW(lx0,ly0,lx1,ly1,lx3,ly3,lx2,ly2,(GETLE32(&gpuData[2]) & 0x000000ff), ((GETLE32(&gpuData[2])>>8) & 0x000000ff), (GETLE32(&gpuData[4]) & 0x000000ff), ((GETLE32(&gpuData[4])>>8) & 0x000000ff),(GETLE32(&gpuData[8]) & 0x000000ff), ((GETLE32(&gpuData[8])>>8) & 0x000000ff),(GETLE32(&gpuData[6]) & 0x000000ff), ((GETLE32(&gpuData[6])>>8) & 0x000000ff));
////////////////////////////////////////////////////////////////////////
-void drawPoly3GT(unsigned char * baseAddr)
+static void drawPoly3GT(unsigned char * baseAddr)
{
uint32_t *gpuData = ((uint32_t *) baseAddr);
if(GlobalTextTP==0)
drawPoly3TGEx4_IL(lx0,ly0,lx1,ly1,lx2,ly2,
(GETLE32(&gpuData[2]) & 0x000000ff), ((GETLE32(&gpuData[2])>>8) & 0x000000ff), (GETLE32(&gpuData[5]) & 0x000000ff), ((GETLE32(&gpuData[5])>>8) & 0x000000ff),(GETLE32(&gpuData[8]) & 0x000000ff), ((GETLE32(&gpuData[8])>>8) & 0x000000ff),
- ((GETLE32(&gpuData[2])>>12) & 0x3f0), ((GETLE32(&gpuData[2])>>22) & iGPUHeightMask),
+ ((GETLE32(&gpuData[2])>>12) & 0x3f0), ((GETLE32(&gpuData[2])>>22) & 511),
GETLE32(&gpuData[0]),GETLE32(&gpuData[3]),GETLE32(&gpuData[6]));
else
drawPoly3TGEx8_IL(lx0,ly0,lx1,ly1,lx2,ly2,
(GETLE32(&gpuData[2]) & 0x000000ff), ((GETLE32(&gpuData[2])>>8) & 0x000000ff), (GETLE32(&gpuData[5]) & 0x000000ff), ((GETLE32(&gpuData[5])>>8) & 0x000000ff),(GETLE32(&gpuData[8]) & 0x000000ff), ((GETLE32(&gpuData[8])>>8) & 0x000000ff),
- ((GETLE32(&gpuData[2])>>12) & 0x3f0), ((GETLE32(&gpuData[2])>>22) & iGPUHeightMask),
+ ((GETLE32(&gpuData[2])>>12) & 0x3f0), ((GETLE32(&gpuData[2])>>22) & 511),
GETLE32(&gpuData[0]),GETLE32(&gpuData[3]),GETLE32(&gpuData[6]));
return;
}
case 0:
drawPoly3TGEx4(lx0,ly0,lx1,ly1,lx2,ly2,
(GETLE32(&gpuData[2]) & 0x000000ff), ((GETLE32(&gpuData[2])>>8) & 0x000000ff), (GETLE32(&gpuData[5]) & 0x000000ff), ((GETLE32(&gpuData[5])>>8) & 0x000000ff),(GETLE32(&gpuData[8]) & 0x000000ff), ((GETLE32(&gpuData[8])>>8) & 0x000000ff),
- ((GETLE32(&gpuData[2])>>12) & 0x3f0), ((GETLE32(&gpuData[2])>>22) & iGPUHeightMask),
+ ((GETLE32(&gpuData[2])>>12) & 0x3f0), ((GETLE32(&gpuData[2])>>22) & 511),
GETLE32(&gpuData[0]),GETLE32(&gpuData[3]),GETLE32(&gpuData[6]));
return;
case 1:
drawPoly3TGEx8(lx0,ly0,lx1,ly1,lx2,ly2,
(GETLE32(&gpuData[2]) & 0x000000ff), ((GETLE32(&gpuData[2])>>8) & 0x000000ff), (GETLE32(&gpuData[5]) & 0x000000ff), ((GETLE32(&gpuData[5])>>8) & 0x000000ff),(GETLE32(&gpuData[8]) & 0x000000ff), ((GETLE32(&gpuData[8])>>8) & 0x000000ff),
- ((GETLE32(&gpuData[2])>>12) & 0x3f0), ((GETLE32(&gpuData[2])>>22) & iGPUHeightMask),
+ ((GETLE32(&gpuData[2])>>12) & 0x3f0), ((GETLE32(&gpuData[2])>>22) & 511),
GETLE32(&gpuData[0]),GETLE32(&gpuData[3]),GETLE32(&gpuData[6]));
return;
case 2:
case 0:
drawPoly3TGEx4_TW(lx0,ly0,lx1,ly1,lx2,ly2,
(GETLE32(&gpuData[2]) & 0x000000ff), ((GETLE32(&gpuData[2])>>8) & 0x000000ff), (GETLE32(&gpuData[5]) & 0x000000ff), ((GETLE32(&gpuData[5])>>8) & 0x000000ff),(GETLE32(&gpuData[8]) & 0x000000ff), ((GETLE32(&gpuData[8])>>8) & 0x000000ff),
- ((GETLE32(&gpuData[2])>>12) & 0x3f0), ((GETLE32(&gpuData[2])>>22) & iGPUHeightMask),
+ ((GETLE32(&gpuData[2])>>12) & 0x3f0), ((GETLE32(&gpuData[2])>>22) & 511),
GETLE32(&gpuData[0]),GETLE32(&gpuData[3]),GETLE32(&gpuData[6]));
return;
case 1:
drawPoly3TGEx8_TW(lx0,ly0,lx1,ly1,lx2,ly2,
(GETLE32(&gpuData[2]) & 0x000000ff), ((GETLE32(&gpuData[2])>>8) & 0x000000ff), (GETLE32(&gpuData[5]) & 0x000000ff), ((GETLE32(&gpuData[5])>>8) & 0x000000ff),(GETLE32(&gpuData[8]) & 0x000000ff), ((GETLE32(&gpuData[8])>>8) & 0x000000ff),
- ((GETLE32(&gpuData[2])>>12) & 0x3f0), ((GETLE32(&gpuData[2])>>22) & iGPUHeightMask),
+ ((GETLE32(&gpuData[2])>>12) & 0x3f0), ((GETLE32(&gpuData[2])>>22) & 511),
GETLE32(&gpuData[0]),GETLE32(&gpuData[3]),GETLE32(&gpuData[6]));
return;
case 2:
////////////////////////////////////////////////////////////////////////
-void drawPoly4GT(unsigned char *baseAddr)
+static void drawPoly4GT(unsigned char *baseAddr)
{
uint32_t *gpuData = ((uint32_t *) baseAddr);
if(GlobalTextTP==0)
drawPoly4TGEx4_TRI_IL(lx0,ly0,lx1,ly1,lx3,ly3,lx2,ly2,
(GETLE32(&gpuData[2]) & 0x000000ff), ((GETLE32(&gpuData[2])>>8) & 0x000000ff), (GETLE32(&gpuData[5]) & 0x000000ff), ((GETLE32(&gpuData[5])>>8) & 0x000000ff),(GETLE32(&gpuData[11]) & 0x000000ff), ((GETLE32(&gpuData[11])>>8) & 0x000000ff),(GETLE32(&gpuData[8]) & 0x000000ff), ((GETLE32(&gpuData[8])>>8) & 0x000000ff),
- ((GETLE32(&gpuData[2])>>12) & 0x3f0),((GETLE32(&gpuData[2])>>22) & iGPUHeightMask),
+ ((GETLE32(&gpuData[2])>>12) & 0x3f0),((GETLE32(&gpuData[2])>>22) & 511),
GETLE32(&gpuData[0]),GETLE32(&gpuData[3]),GETLE32(&gpuData[6]),GETLE32(&gpuData[9]));
else
drawPoly4TGEx8_TRI_IL(lx0,ly0,lx1,ly1,lx3,ly3,lx2,ly2,
(GETLE32(&gpuData[2]) & 0x000000ff), ((GETLE32(&gpuData[2])>>8) & 0x000000ff), (GETLE32(&gpuData[5]) & 0x000000ff), ((GETLE32(&gpuData[5])>>8) & 0x000000ff),(GETLE32(&gpuData[11]) & 0x000000ff), ((GETLE32(&gpuData[11])>>8) & 0x000000ff),(GETLE32(&gpuData[8]) & 0x000000ff), ((GETLE32(&gpuData[8])>>8) & 0x000000ff),
- ((GETLE32(&gpuData[2])>>12) & 0x3f0),((GETLE32(&gpuData[2])>>22) & iGPUHeightMask),
+ ((GETLE32(&gpuData[2])>>12) & 0x3f0),((GETLE32(&gpuData[2])>>22) & 511),
GETLE32(&gpuData[0]),GETLE32(&gpuData[3]),GETLE32(&gpuData[6]),GETLE32(&gpuData[9]));
return;
}
case 0:
drawPoly4TGEx4_TRI(lx0,ly0,lx1,ly1,lx3,ly3,lx2,ly2,
(GETLE32(&gpuData[2]) & 0x000000ff), ((GETLE32(&gpuData[2])>>8) & 0x000000ff), (GETLE32(&gpuData[5]) & 0x000000ff), ((GETLE32(&gpuData[5])>>8) & 0x000000ff),(GETLE32(&gpuData[11]) & 0x000000ff), ((GETLE32(&gpuData[11])>>8) & 0x000000ff),(GETLE32(&gpuData[8]) & 0x000000ff), ((GETLE32(&gpuData[8])>>8) & 0x000000ff),
- ((GETLE32(&gpuData[2])>>12) & 0x3f0),((GETLE32(&gpuData[2])>>22) & iGPUHeightMask),
+ ((GETLE32(&gpuData[2])>>12) & 0x3f0),((GETLE32(&gpuData[2])>>22) & 511),
GETLE32(&gpuData[0]),GETLE32(&gpuData[3]),GETLE32(&gpuData[6]),GETLE32(&gpuData[9]));
return;
case 1:
drawPoly4TGEx8_TRI(lx0,ly0,lx1,ly1,lx3,ly3,lx2,ly2,
(GETLE32(&gpuData[2]) & 0x000000ff), ((GETLE32(&gpuData[2])>>8) & 0x000000ff), (GETLE32(&gpuData[5]) & 0x000000ff), ((GETLE32(&gpuData[5])>>8) & 0x000000ff),(GETLE32(&gpuData[11]) & 0x000000ff), ((GETLE32(&gpuData[11])>>8) & 0x000000ff),(GETLE32(&gpuData[8]) & 0x000000ff), ((GETLE32(&gpuData[8])>>8) & 0x000000ff),
- ((GETLE32(&gpuData[2])>>12) & 0x3f0),((GETLE32(&gpuData[2])>>22) & iGPUHeightMask),
+ ((GETLE32(&gpuData[2])>>12) & 0x3f0),((GETLE32(&gpuData[2])>>22) & 511),
GETLE32(&gpuData[0]),GETLE32(&gpuData[3]),GETLE32(&gpuData[6]),GETLE32(&gpuData[9]));
return;
case 2:
case 0:
drawPoly4TGEx4(lx0,ly0,lx1,ly1,lx3,ly3,lx2,ly2,
(GETLE32(&gpuData[2]) & 0x000000ff), ((GETLE32(&gpuData[2])>>8) & 0x000000ff), (GETLE32(&gpuData[5]) & 0x000000ff), ((GETLE32(&gpuData[5])>>8) & 0x000000ff),(GETLE32(&gpuData[11]) & 0x000000ff), ((GETLE32(&gpuData[11])>>8) & 0x000000ff),(GETLE32(&gpuData[8]) & 0x000000ff), ((GETLE32(&gpuData[8])>>8) & 0x000000ff),
- ((GETLE32(&gpuData[2])>>12) & 0x3f0),((GETLE32(&gpuData[2])>>22) & iGPUHeightMask),
+ ((GETLE32(&gpuData[2])>>12) & 0x3f0),((GETLE32(&gpuData[2])>>22) & 511),
GETLE32(&gpuData[0]),GETLE32(&gpuData[3]),GETLE32(&gpuData[6]),GETLE32(&gpuData[9]));
return;
case 1:
drawPoly4TGEx8(lx0,ly0,lx1,ly1,lx3,ly3,lx2,ly2,
(GETLE32(&gpuData[2]) & 0x000000ff), ((GETLE32(&gpuData[2])>>8) & 0x000000ff), (GETLE32(&gpuData[5]) & 0x000000ff), ((GETLE32(&gpuData[5])>>8) & 0x000000ff),(GETLE32(&gpuData[11]) & 0x000000ff), ((GETLE32(&gpuData[11])>>8) & 0x000000ff),(GETLE32(&gpuData[8]) & 0x000000ff), ((GETLE32(&gpuData[8])>>8) & 0x000000ff),
- ((GETLE32(&gpuData[2])>>12) & 0x3f0),((GETLE32(&gpuData[2])>>22) & iGPUHeightMask),
+ ((GETLE32(&gpuData[2])>>12) & 0x3f0),((GETLE32(&gpuData[2])>>22) & 511),
GETLE32(&gpuData[0]),GETLE32(&gpuData[3]),GETLE32(&gpuData[6]),GETLE32(&gpuData[9]));
return;
case 2:
case 0:
drawPoly4TGEx4_TW(lx0,ly0,lx1,ly1,lx3,ly3,lx2,ly2,
(GETLE32(&gpuData[2]) & 0x000000ff), ((GETLE32(&gpuData[2])>>8) & 0x000000ff), (GETLE32(&gpuData[5]) & 0x000000ff), ((GETLE32(&gpuData[5])>>8) & 0x000000ff),(GETLE32(&gpuData[11]) & 0x000000ff), ((GETLE32(&gpuData[11])>>8) & 0x000000ff),(GETLE32(&gpuData[8]) & 0x000000ff), ((GETLE32(&gpuData[8])>>8) & 0x000000ff),
- ((GETLE32(&gpuData[2])>>12) & 0x3f0),((GETLE32(&gpuData[2])>>22) & iGPUHeightMask),
+ ((GETLE32(&gpuData[2])>>12) & 0x3f0),((GETLE32(&gpuData[2])>>22) & 511),
GETLE32(&gpuData[0]),GETLE32(&gpuData[3]),GETLE32(&gpuData[6]),GETLE32(&gpuData[9]));
return;
case 1:
drawPoly4TGEx8_TW(lx0,ly0,lx1,ly1,lx3,ly3,lx2,ly2,
(GETLE32(&gpuData[2]) & 0x000000ff), ((GETLE32(&gpuData[2])>>8) & 0x000000ff), (GETLE32(&gpuData[5]) & 0x000000ff), ((GETLE32(&gpuData[5])>>8) & 0x000000ff),(GETLE32(&gpuData[11]) & 0x000000ff), ((GETLE32(&gpuData[11])>>8) & 0x000000ff),(GETLE32(&gpuData[8]) & 0x000000ff), ((GETLE32(&gpuData[8])>>8) & 0x000000ff),
- ((GETLE32(&gpuData[2])>>12) & 0x3f0),((GETLE32(&gpuData[2])>>22) & iGPUHeightMask),
+ ((GETLE32(&gpuData[2])>>12) & 0x3f0),((GETLE32(&gpuData[2])>>22) & 511),
GETLE32(&gpuData[0]),GETLE32(&gpuData[3]),GETLE32(&gpuData[6]),GETLE32(&gpuData[9]));
return;
case 2:
// SPRITE FUNCS
////////////////////////////////////////////////////////////////////////
-void DrawSoftwareSpriteTWin(unsigned char * baseAddr,int32_t w,int32_t h)
+static void DrawSoftwareSpriteTWin(unsigned char * baseAddr,int32_t w,int32_t h)
{
uint32_t *gpuData = (uint32_t *)baseAddr;
short sx0,sy0,sx1,sy1,sx2,sy2,sx3,sy3;
case 0:
drawPoly4TEx4_TW_S(sx0,sy0,sx1,sy1,sx2,sy2,sx3,sy3,
tx0,ty0,tx1,ty1,tx2,ty2,tx3,ty3,
- ((GETLE32(&gpuData[2])>>12) & 0x3f0), ((GETLE32(&gpuData[2])>>22) & iGPUHeightMask));
+ ((GETLE32(&gpuData[2])>>12) & 0x3f0), ((GETLE32(&gpuData[2])>>22) & 511));
return;
case 1:
drawPoly4TEx8_TW_S(sx0,sy0,sx1,sy1,sx2,sy2,sx3,sy3,
tx0,ty0,tx1,ty1,tx2,ty2,tx3,ty3,
- ((GETLE32(&gpuData[2])>>12) & 0x3f0), ((GETLE32(&gpuData[2])>>22) & iGPUHeightMask));
+ ((GETLE32(&gpuData[2])>>12) & 0x3f0), ((GETLE32(&gpuData[2])>>22) & 511));
return;
case 2:
drawPoly4TD_TW_S(sx0,sy0,sx1,sy1,sx2,sy2,sx3,sy3,
////////////////////////////////////////////////////////////////////////
-void DrawSoftwareSpriteMirror(unsigned char * baseAddr,int32_t w,int32_t h)
+static void DrawSoftwareSpriteMirror(unsigned char * baseAddr,int32_t w,int32_t h)
{
int32_t sprtY,sprtX,sprtW,sprtH,lXDir,lYDir;
int32_t clutY0,clutX0,clutP,textX0,textY0,sprtYa,sprCY,sprCX,sprA;
sprtX = lx0;
sprtH = h;
sprtW = w;
- clutY0 = (GETLE32(&gpuData[2])>>22) & iGPUHeightMask;
+ clutY0 = (GETLE32(&gpuData[2])>>22) & 511;
clutX0 = (GETLE32(&gpuData[2])>>12) & 0x3f0;
clutP = (clutY0<<11) + (clutX0<<1);
textY0 = ((GETLE32(&gpuData[2])>>8) & 0x000000ff) + GlobalTextAddrY;
sprtX+=PSXDisplay.DrawOffset.x;
sprtY+=PSXDisplay.DrawOffset.y;
-// while (sprtX>1023) sprtX-=1024;
-// while (sprtY>MAXYLINESMIN1) sprtY-=MAXYLINES;
-
if(sprtX>drawW)
{
-// if((sprtX+sprtW)>1023) sprtX-=1024;
-// else return;
return;
}
if(sprtY>drawH)
{
-// if ((sprtY+sprtH)>MAXYLINESMIN1) sprtY-=MAXYLINES;
-// else return;
return;
}
if(GlobalTextTP==0)
drawPoly4TEx4_IL(sprtX,sprtY,sprtX,sprtH,sprtW,sprtH,sprtW,sprtY,
tx,ty, tx,tdy, tdx,tdy, tdx,ty,
- (GETLE32(&gpuData[2])>>12) & 0x3f0, ((GETLE32(&gpuData[2])>>22) & iGPUHeightMask));
+ (GETLE32(&gpuData[2])>>12) & 0x3f0, ((GETLE32(&gpuData[2])>>22) & 511));
else
drawPoly4TEx8_IL(sprtX,sprtY,sprtX,sprtH,sprtW,sprtH,sprtW,sprtY,
tx,ty, tx,tdy, tdx,tdy, tdx,ty,
- (GETLE32(&gpuData[2])>>12) & 0x3f0, ((GETLE32(&gpuData[2])>>22) & iGPUHeightMask));
+ (GETLE32(&gpuData[2])>>12) & 0x3f0, ((GETLE32(&gpuData[2])>>22) & 511));
}
////////////////////////////////////////////////////////////////////////
-void DrawSoftwareSprite(unsigned char * baseAddr,short w,short h,int32_t tx,int32_t ty)
+static void DrawSoftwareSprite(unsigned char * baseAddr,short w,short h,int32_t tx,int32_t ty)
{
int32_t sprtY,sprtX,sprtW,sprtH;
int32_t clutY0,clutX0,clutP,textX0,textY0,sprtYa,sprCY,sprCX,sprA;
sprtX = lx0;
sprtH = h;
sprtW = w;
- clutY0 = (GETLE32(&gpuData[2])>>22) & iGPUHeightMask;
+ clutY0 = (GETLE32(&gpuData[2])>>22) & 511;
clutX0 = (GETLE32(&gpuData[2])>>12) & 0x3f0;
clutP = (clutY0<<11) + (clutX0<<1);
sprtX+=PSXDisplay.DrawOffset.x;
sprtY+=PSXDisplay.DrawOffset.y;
- //while (sprtX>1023) sprtX-=1024;
- //while (sprtY>MAXYLINESMIN1) sprtY-=MAXYLINES;
-
if(sprtX>drawW)
{
-// if((sprtX+sprtW)>1023) sprtX-=1024;
-// else return;
return;
}
if(sprtY>drawH)
{
-// if ((sprtY+sprtH)>MAXYLINESMIN1) sprtY-=MAXYLINES;
-// else return;
return;
}
///////////////////////////////////////////////////////////////////////
-void Line_E_SE_Shade(int x0, int y0, int x1, int y1, uint32_t rgb0, uint32_t rgb1)
+static void Line_E_SE_Shade(int x0, int y0, int x1, int y1, uint32_t rgb0, uint32_t rgb1)
{
int dx, dy, incrE, incrSE, d;
uint32_t r0, g0, b0, r1, g1, b1;
///////////////////////////////////////////////////////////////////////
-void Line_S_SE_Shade(int x0, int y0, int x1, int y1, uint32_t rgb0, uint32_t rgb1)
+static void Line_S_SE_Shade(int x0, int y0, int x1, int y1, uint32_t rgb0, uint32_t rgb1)
{
int dx, dy, incrS, incrSE, d;
uint32_t r0, g0, b0, r1, g1, b1;
///////////////////////////////////////////////////////////////////////
-void Line_N_NE_Shade(int x0, int y0, int x1, int y1, uint32_t rgb0, uint32_t rgb1)
+static void Line_N_NE_Shade(int x0, int y0, int x1, int y1, uint32_t rgb0, uint32_t rgb1)
{
int dx, dy, incrN, incrNE, d;
uint32_t r0, g0, b0, r1, g1, b1;
///////////////////////////////////////////////////////////////////////
-void Line_E_NE_Shade(int x0, int y0, int x1, int y1, uint32_t rgb0, uint32_t rgb1)
+static void Line_E_NE_Shade(int x0, int y0, int x1, int y1, uint32_t rgb0, uint32_t rgb1)
{
int dx, dy, incrE, incrNE, d;
uint32_t r0, g0, b0, r1, g1, b1;
///////////////////////////////////////////////////////////////////////
-void VertLineShade(int x, int y0, int y1, uint32_t rgb0, uint32_t rgb1)
+static void VertLineShade(int x, int y0, int y1, uint32_t rgb0, uint32_t rgb1)
{
int y, dy;
uint32_t r0, g0, b0, r1, g1, b1;
///////////////////////////////////////////////////////////////////////
-void HorzLineShade(int y, int x0, int x1, uint32_t rgb0, uint32_t rgb1)
+static void HorzLineShade(int y, int x0, int x1, uint32_t rgb0, uint32_t rgb1)
{
int x, dx;
uint32_t r0, g0, b0, r1, g1, b1;
///////////////////////////////////////////////////////////////////////
-void Line_E_SE_Flat(int x0, int y0, int x1, int y1, unsigned short colour)
+static void Line_E_SE_Flat(int x0, int y0, int x1, int y1, unsigned short colour)
{
int dx, dy, incrE, incrSE, d, x, y;
///////////////////////////////////////////////////////////////////////
-void Line_S_SE_Flat(int x0, int y0, int x1, int y1, unsigned short colour)
+static void Line_S_SE_Flat(int x0, int y0, int x1, int y1, unsigned short colour)
{
int dx, dy, incrS, incrSE, d, x, y;
///////////////////////////////////////////////////////////////////////
-void Line_N_NE_Flat(int x0, int y0, int x1, int y1, unsigned short colour)
+static void Line_N_NE_Flat(int x0, int y0, int x1, int y1, unsigned short colour)
{
int dx, dy, incrN, incrNE, d, x, y;
///////////////////////////////////////////////////////////////////////
-void Line_E_NE_Flat(int x0, int y0, int x1, int y1, unsigned short colour)
+static void Line_E_NE_Flat(int x0, int y0, int x1, int y1, unsigned short colour)
{
int dx, dy, incrE, incrNE, d, x, y;
///////////////////////////////////////////////////////////////////////
-void VertLineFlat(int x, int y0, int y1, unsigned short colour)
+static void VertLineFlat(int x, int y0, int y1, unsigned short colour)
{
int y;
///////////////////////////////////////////////////////////////////////
-void HorzLineFlat(int y, int x0, int x1, unsigned short colour)
+static void HorzLineFlat(int y, int x0, int x1, unsigned short colour)
{
int x;
///////////////////////////////////////////////////////////////////////
/* Bresenham Line drawing function */
-void DrawSoftwareLineShade(int32_t rgb0, int32_t rgb1)
+static void DrawSoftwareLineShade(int32_t rgb0, int32_t rgb1)
{
short x0, y0, x1, y1, xt, yt;
int32_t rgbt;
///////////////////////////////////////////////////////////////////////
-void DrawSoftwareLineFlat(int32_t rgb)
+static void DrawSoftwareLineFlat(int32_t rgb)
{
short x0, y0, x1, y1, xt, yt;
double m, dy, dx;
+++ /dev/null
-/***************************************************************************\r
- soft.h - description\r
- -------------------\r
- begin : Sun Oct 28 2001\r
- copyright : (C) 2001 by Pete Bernert\r
- email : BlackDove@addcom.de\r
- ***************************************************************************/\r
-/***************************************************************************\r
- * *\r
- * This program is free software; you can redistribute it and/or modify *\r
- * it under the terms of the GNU General Public License as published by *\r
- * the Free Software Foundation; either version 2 of the License, or *\r
- * (at your option) any later version. See also the license.txt file for *\r
- * additional informations. *\r
- * *\r
- ***************************************************************************/\r
-\r
-#ifndef _GPU_SOFT_H_\r
-#define _GPU_SOFT_H_\r
-\r
-void offsetPSXLine(void);\r
-void offsetPSX2(void);\r
-void offsetPSX3(void);\r
-void offsetPSX4(void);\r
-\r
-void FillSoftwareAreaTrans(short x0,short y0,short x1,short y1,unsigned short col);\r
-void FillSoftwareArea(short x0,short y0,short x1,short y1,unsigned short col);\r
-void drawPoly3G(int32_t rgb1, int32_t rgb2, int32_t rgb3);\r
-void drawPoly4G(int32_t rgb1, int32_t rgb2, int32_t rgb3, int32_t rgb4);\r
-void drawPoly3F(int32_t rgb);\r
-void drawPoly4F(int32_t rgb);\r
-void drawPoly4FT(unsigned char * baseAddr);\r
-void drawPoly4GT(unsigned char * baseAddr);\r
-void drawPoly3FT(unsigned char * baseAddr);\r
-void drawPoly3GT(unsigned char * baseAddr);\r
-void DrawSoftwareSprite(unsigned char * baseAddr,short w,short h,int32_t tx,int32_t ty);\r
-void DrawSoftwareSpriteTWin(unsigned char * baseAddr,int32_t w,int32_t h);\r
-void DrawSoftwareSpriteMirror(unsigned char * baseAddr,int32_t w,int32_t h);\r
-void DrawSoftwareLineShade(int32_t rgb0, int32_t rgb1);\r
-void DrawSoftwareLineFlat(int32_t rgb);\r
-\r
-#endif // _GPU_SOFT_H_\r
+++ /dev/null
-#include <stdint.h>
-
-// byteswappings
-
-#define SWAP16(x) ({ uint16_t y=(x); (((y)>>8 & 0xff) | ((y)<<8 & 0xff00)); })
-#define SWAP32(x) ({ uint32_t y=(x); (((y)>>24 & 0xfful) | ((y)>>8 & 0xff00ul) | ((y)<<8 & 0xff0000ul) | ((y)<<24 & 0xff000000ul)); })
-
-#ifdef __BIG_ENDIAN__
-
-// big endian config
-#define HOST2LE32(x) SWAP32(x)
-#define HOST2BE32(x) (x)
-#define LE2HOST32(x) SWAP32(x)
-#define BE2HOST32(x) (x)
-
-#define HOST2LE16(x) SWAP16(x)
-#define HOST2BE16(x) (x)
-#define LE2HOST16(x) SWAP16(x)
-#define BE2HOST16(x) (x)
-
-#else
-
-// little endian config
-#define HOST2LE32(x) (x)
-#define HOST2BE32(x) SWAP32(x)
-#define LE2HOST32(x) (x)
-#define BE2HOST32(x) SWAP32(x)
-
-#define HOST2LE16(x) (x)
-#define HOST2BE16(x) SWAP16(x)
-#define LE2HOST16(x) (x)
-#define BE2HOST16(x) SWAP16(x)
-
-#endif
-
-#define GETLEs16(X) ((int16_t)GETLE16((uint16_t *)X))
-#define GETLEs32(X) ((int16_t)GETLE32((uint16_t *)X))
-
-#if defined(__PPC__) && defined(__BIG_ENDIAN__)
-
-// GCC style
-static __inline__ uint16_t GETLE16(uint16_t *ptr) {
- uint16_t ret; __asm__ ("lhbrx %0, 0, %1" : "=r" (ret) : "r" (ptr));
- return ret;
-}
-static __inline__ uint32_t GETLE32(uint32_t *ptr) {
- uint32_t ret;
- __asm__ ("lwbrx %0, 0, %1" : "=r" (ret) : "r" (ptr));
- return ret;
-}
-static __inline__ uint32_t GETLE16D(uint32_t *ptr) {
- uint32_t ret;
- __asm__ ("lwbrx %0, 0, %1\n"
- "rlwinm %0, %0, 16, 0, 31" : "=r" (ret) : "r" (ptr));
- return ret;
-}
-
-static __inline__ void PUTLE16(uint16_t *ptr, uint16_t val) {
- __asm__ ("sthbrx %0, 0, %1" : : "r" (val), "r" (ptr) : "memory");
-}
-static __inline__ void PUTLE32(uint32_t *ptr, uint32_t val) {
- __asm__ ("stwbrx %0, 0, %1" : : "r" (val), "r" (ptr) : "memory");
-}
-
-#else
-#define GETLE16(X) LE2HOST16(*(uint16_t *)X)
-#define GETLE16D(X) ({uint32_t val = GETLE32(X); (val<<16 | val >> 16);})
-#define PUTLE16(X, Y) do{*((uint16_t *)X)=HOST2LE16((uint16_t)Y);}while(0)
-#ifdef __arm__
-#define GETLE32(X) (*(uint16_t *)X|(((uint16_t *)X)[1]<<16))
-#define PUTLE32(X, Y) do{*((uint16_t *)X)=(uint32_t)Y;((uint16_t *)X)[1]=(uint32_t)(Y)>>16;}while(0)
-#else
-#define GETLE32(X) LE2HOST32(*(uint32_t *)X)
-#define PUTLE32(X, Y) do{*((uint32_t *)X)=HOST2LE16((uint32_t)Y);}while(0)
-#endif
-#endif
+++ /dev/null
-/***************************************************************************
- zn.c - description
- -------------------
- begin : Sat Jan 31 2004
- copyright : (C) 2004 by Pete Bernert
- email : BlackDove@addcom.de
- ***************************************************************************/
-/***************************************************************************
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. See also the license.txt file for *
- * additional informations. *
- * *
- ***************************************************************************/
-
-#define _IN_ZN
-
-#include "externals.h"
-
-// --------------------------------------------------- //
-// - psx gpu plugin interface prototypes-------------- //
-// --------------------------------------------------- //
-
-long GPUopen(unsigned long *disp, const char *CapText, const char *CfgFile);
-
-void CALLBACK GPUdisplayText(char * pText);
-void CALLBACK GPUdisplayFlags(uint32_t dwFlags);
-void CALLBACK GPUmakeSnapshot(void);
-long CALLBACK GPUinit();
-long CALLBACK GPUclose();
-long CALLBACK GPUshutdown();
-void CALLBACK GPUcursor(int iPlayer,int x,int y);
-void CALLBACK GPUupdateLace(void);
-uint32_t CALLBACK GPUreadStatus(void);
-void CALLBACK GPUwriteStatus(uint32_t gdata);
-void CALLBACK GPUreadDataMem(uint32_t * pMem, int iSize);
-uint32_t CALLBACK GPUreadData(void);
-void CALLBACK GPUwriteDataMem(uint32_t * pMem, int iSize);
-void CALLBACK GPUwriteData(uint32_t gdata);
-void CALLBACK GPUsetMode(uint32_t gdata);
-long CALLBACK GPUgetMode(void);
-long CALLBACK GPUdmaChain(uint32_t * baseAddrL, uint32_t addr);
-long CALLBACK GPUconfigure(void);
-void CALLBACK GPUabout(void);
-long CALLBACK GPUtest(void);
-long CALLBACK GPUfreeze(uint32_t ulGetFreezeData,void * pF);
-void CALLBACK GPUgetScreenPic(unsigned char * pMem);
-void CALLBACK GPUshowScreenPic(unsigned char * pMem);
-
-void CALLBACK GPUkeypressed(int keycode);
-
-
-// --------------------------------------------------- //
-// - zn gpu interface -------------------------------- //
-// --------------------------------------------------- //
-
-uint32_t dwGPUVersion=0;
-int iGPUHeight=512;
-int iGPUHeightMask=511;
-int GlobalTextIL=0;
-int iTileCheat=0;
-
-// --------------------------------------------------- //
-// --------------------------------------------------- //
-// --------------------------------------------------- //
-
-typedef struct GPUOTAG
- {
- uint32_t Version; // Version of structure - currently 1
- long hWnd; // Window handle
- uint32_t ScreenRotation; // 0 = 0CW, 1 = 90CW, 2 = 180CW, 3 = 270CW = 90CCW
- uint32_t GPUVersion; // 0 = a, 1 = b, 2 = c
- const char* GameName; // NULL terminated string
- const char* CfgFile; // NULL terminated string
- } GPUConfiguration_t;
-
-// --------------------------------------------------- //
-// --------------------------------------------------- //
-// --------------------------------------------------- //
-
-void CALLBACK ZN_GPUdisplayFlags(uint32_t dwFlags)
-{
- GPUdisplayFlags(dwFlags);
-}
-
-// --------------------------------------------------- //
-
-void CALLBACK ZN_GPUmakeSnapshot(void)
-{
- GPUmakeSnapshot();
-}
-
-// --------------------------------------------------- //
-
-long CALLBACK ZN_GPUinit()
-{ // we always set the vram size to 2MB, if the ZN interface is used
- iGPUHeight=1024;
- iGPUHeightMask=1023;
-
- return GPUinit();
-}
-
-// --------------------------------------------------- //
-
-long CALLBACK ZN_GPUopen(void * vcfg)
-{
- GPUConfiguration_t * cfg=(GPUConfiguration_t *)vcfg;
- long lret;
-
- if(!cfg) return -1;
- if(cfg->Version!=1) return -1;
-
- lret = GPUopen(&cfg->hWnd, cfg->GameName, cfg->CfgFile);
-
-
-/*
- if(!lstrcmp(cfg->GameName,"kikaioh") ||
- !lstrcmp(cfg->GameName,"sr2j") ||
- !lstrcmp(cfg->GameName,"rvschool_a"))
- iTileCheat=1;
-*/
-
- // some ZN games seem to erase the cluts with a 'white' TileS... strange..
- // I've added a cheat to avoid this issue. We can set it globally (for
- // all ZiNc games) without much risk
-
- iTileCheat=1;
-
- dwGPUVersion=cfg->GPUVersion;
-
- return lret;
-}
-
-// --------------------------------------------------- //
-
-long CALLBACK ZN_GPUclose()
-{
- return GPUclose();
-}
-
-// --------------------------------------------------- //
-
-long CALLBACK ZN_GPUshutdown()
-{
- return GPUshutdown();
-}
-
-// --------------------------------------------------- //
-
-void CALLBACK ZN_GPUupdateLace(void)
-{
- GPUupdateLace();
-}
-
-// --------------------------------------------------- //
-
-uint32_t CALLBACK ZN_GPUreadStatus(void)
-{
- return GPUreadStatus();
-}
-
-// --------------------------------------------------- //
-
-void CALLBACK ZN_GPUwriteStatus(uint32_t gdata)
-{
- GPUwriteStatus(gdata);
-}
-
-// --------------------------------------------------- //
-
-long CALLBACK ZN_GPUdmaSliceOut(uint32_t *baseAddrL, uint32_t addr, uint32_t iSize)
-{
- GPUreadDataMem(baseAddrL+addr,iSize);
- return 0;
-}
-
-// --------------------------------------------------- //
-
-uint32_t CALLBACK ZN_GPUreadData(void)
-{
- return GPUreadData();
-}
-
-// --------------------------------------------------- //
-
-void CALLBACK ZN_GPUsetMode(uint32_t gdata)
-{
- GPUsetMode(gdata);
-}
-
-// --------------------------------------------------- //
-
-long CALLBACK ZN_GPUgetMode(void)
-{
- return GPUgetMode();
-}
-
-// --------------------------------------------------- //
-
-long CALLBACK ZN_GPUdmaSliceIn(uint32_t *baseAddrL, uint32_t addr, uint32_t iSize)
-{
- GPUwriteDataMem(baseAddrL+addr,iSize);
- return 0;
-}
-// --------------------------------------------------- //
-
-void CALLBACK ZN_GPUwriteData(uint32_t gdata)
-{
- GPUwriteDataMem(&gdata,1);
-}
-
-// --------------------------------------------------- //
-
-long CALLBACK ZN_GPUdmaChain(uint32_t * baseAddrL, uint32_t addr)
-{
- return GPUdmaChain(baseAddrL,addr);
-}
-
-// --------------------------------------------------- //
-
-long CALLBACK ZN_GPUtest(void)
-{
- return GPUtest();
-}
-
-// --------------------------------------------------- //
-
-long CALLBACK ZN_GPUfreeze(uint32_t ulGetFreezeData,void * pF)
-{
- return GPUfreeze(ulGetFreezeData,pF);
-}
-
-// --------------------------------------------------- //
-
-void CALLBACK ZN_GPUgetScreenPic(unsigned char * pMem)
-{
- GPUgetScreenPic(pMem);
-}
-
-// --------------------------------------------------- //
-
-void CALLBACK ZN_GPUshowScreenPic(unsigned char * pMem)
-{
- GPUshowScreenPic(pMem);
-}
-
-// --------------------------------------------------- //
-
-void CALLBACK ZN_GPUkeypressed(int keycode)
-{
- GPUkeypressed(keycode);
-}
-