HQ3X filter update
This commit is contained in:
@@ -492,7 +492,6 @@ hq3x:
|
|||||||
mov [w8],edx
|
mov [w8],edx
|
||||||
mov [w9],edx
|
mov [w9],edx
|
||||||
.loopx
|
.loopx
|
||||||
mov ebx,[BitConv32Ptr]
|
|
||||||
mov eax,[w2]
|
mov eax,[w2]
|
||||||
mov [w1],eax
|
mov [w1],eax
|
||||||
mov eax,[w5]
|
mov eax,[w5]
|
||||||
|
|||||||
@@ -1272,7 +1272,7 @@ NEWSYM GUIBIFIL, db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
|||||||
NEWSYM GUITBWVID, db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ; Triple Buffering (Win)
|
NEWSYM GUITBWVID, db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ; Triple Buffering (Win)
|
||||||
NEWSYM GUISMODE, db 0,0,0,0,1,0,0,0,1,0,0,1,0,1,0,0,1,0,1,0,0,0,0,1,0,1,0,0,1,0,1,0,0
|
NEWSYM GUISMODE, db 0,0,0,0,1,0,0,0,1,0,0,1,0,1,0,0,1,0,1,0,0,0,0,1,0,1,0,0,1,0,1,0,0
|
||||||
NEWSYM GUIDSMODE, db 0,0,0,0,0,1,0,1,0,0,0,0,1,0,0,1,0,1,0,0,1,0,0,0,1,0,0,1,0,1,0,0,1
|
NEWSYM GUIDSMODE, db 0,0,0,0,0,1,0,1,0,0,0,0,1,0,0,1,0,1,0,0,1,0,0,0,1,0,0,1,0,1,0,0,1
|
||||||
NEWSYM GUIHQ3X, db 0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0 ; hq3x filter
|
NEWSYM GUIHQ3X, db 0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,1,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0 ; hq3x filter
|
||||||
|
|
||||||
|
|
||||||
SECTION .text
|
SECTION .text
|
||||||
|
|||||||
@@ -1263,6 +1263,17 @@ void TestJoy()
|
|||||||
extern "C" DWORD converta;
|
extern "C" DWORD converta;
|
||||||
extern "C" unsigned int BitConv32Ptr;
|
extern "C" unsigned int BitConv32Ptr;
|
||||||
extern "C" unsigned int RGBtoYUVPtr;
|
extern "C" unsigned int RGBtoYUVPtr;
|
||||||
|
extern "C" unsigned char cvidmode;
|
||||||
|
extern "C" unsigned char hq3xFilter;
|
||||||
|
DWORD FirstVid=1;
|
||||||
|
DWORD FirstFull=1;
|
||||||
|
DWORD SMode=0;
|
||||||
|
DWORD DSMode=0;
|
||||||
|
DWORD prevHQ3XMode=-1;
|
||||||
|
extern "C" BYTE GUIWFVID[];
|
||||||
|
extern "C" BYTE GUISMODE[];
|
||||||
|
extern "C" BYTE GUIDSMODE[];
|
||||||
|
extern "C" BYTE GUIHQ3X[];
|
||||||
int Refresh = 0;
|
int Refresh = 0;
|
||||||
|
|
||||||
int InitDirectDraw()
|
int InitDirectDraw()
|
||||||
@@ -1308,20 +1319,26 @@ int InitDirectDraw()
|
|||||||
ClientToScreen(hMainWindow, ( LPPOINT )&rcWindow);
|
ClientToScreen(hMainWindow, ( LPPOINT )&rcWindow);
|
||||||
ClientToScreen(hMainWindow, ( LPPOINT )&rcWindow + 1);
|
ClientToScreen(hMainWindow, ( LPPOINT )&rcWindow + 1);
|
||||||
|
|
||||||
if (SurfaceX == 768 && SurfaceY == 720)
|
FullScreen=GUIWFVID[cvidmode];
|
||||||
|
DSMode=GUIDSMODE[cvidmode];
|
||||||
|
|
||||||
|
if (FullScreen == 1 && DSMode == 0)
|
||||||
{
|
{
|
||||||
int marginx = (rcWindow.right - rcWindow.left - BlitArea.right + BlitArea.left)/2;
|
if (SurfaceX == 768 && SurfaceY == 720)
|
||||||
int marginy = (rcWindow.bottom - rcWindow.top - BlitArea.bottom + BlitArea.top)/2;
|
{
|
||||||
if (marginx>0)
|
int marginx = (rcWindow.right - rcWindow.left - BlitArea.right + BlitArea.left)/2;
|
||||||
{
|
int marginy = (rcWindow.bottom - rcWindow.top - BlitArea.bottom + BlitArea.top)/2;
|
||||||
rcWindow.left += marginx;
|
if (marginx>0)
|
||||||
rcWindow.right -= marginx;
|
{
|
||||||
}
|
rcWindow.left += marginx;
|
||||||
if (marginy>0)
|
rcWindow.right -= marginx;
|
||||||
{
|
}
|
||||||
rcWindow.top += marginy;
|
if (marginy>0)
|
||||||
rcWindow.bottom -= marginy;
|
{
|
||||||
}
|
rcWindow.top += marginy;
|
||||||
|
rcWindow.bottom -= marginy;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pDirectDrawCreateEx(NULL, (void **)&lpDD, IID_IDirectDraw7, NULL) != DD_OK)
|
if (pDirectDrawCreateEx(NULL, (void **)&lpDD, IID_IDirectDraw7, NULL) != DD_OK)
|
||||||
@@ -1588,17 +1605,6 @@ void Stop36HZ(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
char WinMessage[256];
|
char WinMessage[256];
|
||||||
extern unsigned char cvidmode;
|
|
||||||
extern unsigned char hq3xFilter;
|
|
||||||
DWORD FirstVid=1;
|
|
||||||
DWORD FirstFull=1;
|
|
||||||
DWORD SMode=0;
|
|
||||||
DWORD DSMode=0;
|
|
||||||
DWORD prevHQ3XMode=-1;
|
|
||||||
extern BYTE GUIWFVID[];
|
|
||||||
extern BYTE GUISMODE[];
|
|
||||||
extern BYTE GUIDSMODE[];
|
|
||||||
extern BYTE GUIHQ3X[];
|
|
||||||
extern unsigned short resolutn;
|
extern unsigned short resolutn;
|
||||||
void clearwin();
|
void clearwin();
|
||||||
void clear_display();
|
void clear_display();
|
||||||
@@ -1684,16 +1690,8 @@ void initwinvideo(void)
|
|||||||
case 10:
|
case 10:
|
||||||
WindowWidth=768;
|
WindowWidth=768;
|
||||||
WindowHeight=672;
|
WindowHeight=672;
|
||||||
if (HQ3XMode!=0)
|
SurfaceX=512;
|
||||||
{
|
SurfaceY=480;
|
||||||
SurfaceX=768;
|
|
||||||
SurfaceY=720;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
SurfaceX=512;
|
|
||||||
SurfaceY=480;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case 11:
|
case 11:
|
||||||
WindowWidth=800;
|
WindowWidth=800;
|
||||||
@@ -1712,16 +1710,8 @@ void initwinvideo(void)
|
|||||||
case 14:
|
case 14:
|
||||||
WindowWidth=800;
|
WindowWidth=800;
|
||||||
WindowHeight=600;
|
WindowHeight=600;
|
||||||
if (HQ3XMode!=0)
|
SurfaceX=640;
|
||||||
{
|
SurfaceY=480;
|
||||||
SurfaceX=768;
|
|
||||||
SurfaceY=720;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
SurfaceX=640;
|
|
||||||
SurfaceY=480;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case 15:
|
case 15:
|
||||||
WindowWidth=800;
|
WindowWidth=800;
|
||||||
@@ -1746,16 +1736,8 @@ void initwinvideo(void)
|
|||||||
case 19:
|
case 19:
|
||||||
WindowWidth=1024;
|
WindowWidth=1024;
|
||||||
WindowHeight=768;
|
WindowHeight=768;
|
||||||
if (HQ3XMode!=0)
|
SurfaceX=640;
|
||||||
{
|
SurfaceY=480;
|
||||||
SurfaceX=768;
|
|
||||||
SurfaceY=720;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
SurfaceX=640;
|
|
||||||
SurfaceY=480;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case 20:
|
case 20:
|
||||||
WindowWidth=1024;
|
WindowWidth=1024;
|
||||||
@@ -1831,6 +1813,12 @@ void initwinvideo(void)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (HQ3XMode!=0)
|
||||||
|
{
|
||||||
|
SurfaceX=768;
|
||||||
|
SurfaceY=720;
|
||||||
|
}
|
||||||
|
|
||||||
BlitArea.top = 0;
|
BlitArea.top = 0;
|
||||||
BlitArea.left = 0;
|
BlitArea.left = 0;
|
||||||
BlitArea.right = SurfaceX;
|
BlitArea.right = SurfaceX;
|
||||||
@@ -1887,20 +1875,23 @@ void initwinvideo(void)
|
|||||||
ClientToScreen(hMainWindow, (LPPOINT) &rcWindow);
|
ClientToScreen(hMainWindow, (LPPOINT) &rcWindow);
|
||||||
ClientToScreen(hMainWindow, (LPPOINT) &rcWindow + 1);
|
ClientToScreen(hMainWindow, (LPPOINT) &rcWindow + 1);
|
||||||
|
|
||||||
if (SurfaceX == 768 && SurfaceY == 720)
|
if (FullScreen == 1 && DSMode == 0)
|
||||||
{
|
{
|
||||||
int marginx = (rcWindow.right - rcWindow.left - BlitArea.right + BlitArea.left)/2;
|
if (SurfaceX == 768 && SurfaceY == 720)
|
||||||
int marginy = (rcWindow.bottom - rcWindow.top - BlitArea.bottom + BlitArea.top)/2;
|
{
|
||||||
if (marginx>0)
|
int marginx = (rcWindow.right - rcWindow.left - BlitArea.right + BlitArea.left)/2;
|
||||||
{
|
int marginy = (rcWindow.bottom - rcWindow.top - BlitArea.bottom + BlitArea.top)/2;
|
||||||
rcWindow.left += marginx;
|
if (marginx>0)
|
||||||
rcWindow.right -= marginx;
|
{
|
||||||
}
|
rcWindow.left += marginx;
|
||||||
if (marginy>0)
|
rcWindow.right -= marginx;
|
||||||
{
|
}
|
||||||
rcWindow.top += marginy;
|
if (marginy>0)
|
||||||
rcWindow.bottom -= marginy;
|
{
|
||||||
}
|
rcWindow.top += marginy;
|
||||||
|
rcWindow.bottom -= marginy;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -2186,27 +2177,30 @@ void clearwin()
|
|||||||
|
|
||||||
void clear_display()
|
void clear_display()
|
||||||
{
|
{
|
||||||
if ((DD_Primary != NULL) && (DD_BackBuffer != NULL))
|
if (FullScreen == 1)
|
||||||
{
|
{
|
||||||
DDBLTFX ddbltfx;
|
if ((DD_Primary != NULL) && (DD_BackBuffer != NULL))
|
||||||
|
{
|
||||||
|
DDBLTFX ddbltfx;
|
||||||
|
|
||||||
ddbltfx.dwSize = sizeof(ddbltfx);
|
ddbltfx.dwSize = sizeof(ddbltfx);
|
||||||
ddbltfx.dwFillColor = 0;
|
ddbltfx.dwFillColor = 0;
|
||||||
|
|
||||||
if (DD_BackBuffer->Blt( NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &ddbltfx ) == DDERR_SURFACELOST)
|
if (DD_BackBuffer->Blt( NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &ddbltfx ) == DDERR_SURFACELOST)
|
||||||
DD_Primary->Restore();
|
DD_Primary->Restore();
|
||||||
|
|
||||||
if (DD_Primary->Flip(NULL, DDFLIP_WAIT) == DDERR_SURFACELOST)
|
if (DD_Primary->Flip(NULL, DDFLIP_WAIT) == DDERR_SURFACELOST)
|
||||||
DD_Primary->Restore();
|
DD_Primary->Restore();
|
||||||
|
|
||||||
if (DD_BackBuffer->Blt( NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &ddbltfx ) == DDERR_SURFACELOST)
|
if (DD_BackBuffer->Blt( NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &ddbltfx ) == DDERR_SURFACELOST)
|
||||||
DD_Primary->Restore();
|
DD_Primary->Restore();
|
||||||
|
|
||||||
if (DD_Primary->Flip(NULL, DDFLIP_WAIT) == DDERR_SURFACELOST)
|
if (DD_Primary->Flip(NULL, DDFLIP_WAIT) == DDERR_SURFACELOST)
|
||||||
DD_Primary->Restore();
|
DD_Primary->Restore();
|
||||||
|
|
||||||
if (DD_BackBuffer->Blt( NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &ddbltfx ) == DDERR_SURFACELOST)
|
if (DD_BackBuffer->Blt( NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &ddbltfx ) == DDERR_SURFACELOST)
|
||||||
DD_Primary->Restore();
|
DD_Primary->Restore();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user