Commit a9537219 authored by BearOso's avatar BearOso
Browse files

win32: Adapt to GFX.Screen in core.

parent aa6abace
......@@ -66,11 +66,10 @@ TRenderMethod _RenderMethod = RenderPlain;
TRenderMethod _RenderMethodHiRes = RenderPlain;
// Used as change log
static uint8 ChangeLog1 [EXT_PITCH * MAX_SNES_HEIGHT];
static uint8 ChangeLog2 [EXT_PITCH * MAX_SNES_HEIGHT];
static uint8 ChangeLog3 [EXT_PITCH * MAX_SNES_HEIGHT];
static uint8 ChangeLog1 [2 * MAX_SNES_WIDTH * MAX_SNES_HEIGHT];
static uint8 ChangeLog2 [2 * MAX_SNES_WIDTH * MAX_SNES_HEIGHT];
static uint8 ChangeLog3 [2 * MAX_SNES_WIDTH * MAX_SNES_HEIGHT];
BYTE *BlendBuf = NULL;
BYTE *BlendBuffer = NULL;
uint8 *ChangeLog [3] = {
......@@ -383,7 +382,7 @@ void RenderMethod(SSurface Src, SSurface Dst, RECT * rect)
AdjustHeightExtend(Src.Height);
if(Src.Height > SNES_HEIGHT_EXTENDED || Src.Width == 512) {
if(GUI.BlendHiRes && Src.Width == 512 && !GetFilterBlendSupport(GUI.ScaleHiRes)) {
RenderMergeHires(Src.Surface,Src.Pitch,BlendBuffer,EXT_PITCH,Src.Width,Src.Height);
RenderMergeHires(Src.Surface,Src.Pitch,BlendBuffer,GFX.Pitch,Src.Width,Src.Height);
Src.Surface = BlendBuffer;
}
_RenderMethodHiRes(Src,Dst,rect);
......@@ -398,10 +397,8 @@ void InitRenderFilters(void)
if(!ntsc) {
ntsc = new snes_ntsc_t;
}
if(!BlendBuf) {
BlendBuf = new BYTE [EXT_PITCH * EXT_HEIGHT];
BlendBuffer = BlendBuf + EXT_OFFSET;
memset(BlendBuf, 0, EXT_PITCH * EXT_HEIGHT);
if(!BlendBuffer) {
BlendBuffer = new BYTE [GFX.Pitch * MAX_SNES_HEIGHT];
}
SYSTEM_INFO sysinfo;
......@@ -424,8 +421,8 @@ void DeInitRenderFilters()
if (ntsc) {
delete ntsc;
}
if (BlendBuf) {
delete[] BlendBuf;
if (BlendBuffer) {
delete[] BlendBuffer;
}
if (xbrz_thread_sync_data) {
delete[] xbrz_thread_sync_data;
......
......@@ -31,9 +31,6 @@
#include <math.h>
BYTE *ScreenBuf = NULL;
BYTE *ScreenBuffer = NULL;
struct SJoyState Joystick [16];
uint32 joypads [8];
bool8 do_frame_adjust=false;
......@@ -850,14 +847,6 @@ void InitSnes9x( void)
extern void S9xPostRomInit();
Memory.PostRomInitFunc = S9xPostRomInit;
ScreenBuf = new BYTE [EXT_PITCH * EXT_HEIGHT_WITH_CENTERING];
ScreenBuffer = ScreenBuf + EXT_OFFSET_WITH_CENTERING;
memset (ScreenBuf, 0, EXT_PITCH * EXT_HEIGHT_WITH_CENTERING);
GFX.Pitch = EXT_PITCH;
GFX.RealPPL = EXT_PITCH;
GFX.Screen = (uint16*)(ScreenBuffer);
InitializeCriticalSection(&GUI.SoundCritSect);
GUI.SoundSyncEvent = CreateEvent(NULL,TRUE,TRUE,NULL);
CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
......@@ -873,9 +862,6 @@ void InitSnes9x( void)
}
void DeinitS9x()
{
if(ScreenBuf)
delete [] ScreenBuf;
DeleteCriticalSection(&GUI.SoundCritSect);
CloseHandle(GUI.SoundSyncEvent);
CoUninitialize();
......
......@@ -8102,7 +8102,6 @@ updateFilterBox2:
//UpdateScale(GUI.Scale, prevScale);
GUI.Scale = (RenderFilter)prevScale;
GUI.ScaleHiRes = (RenderFilter)prevScaleHiRes;
GFX.RealPPL = prevPPL;
GUI.Stretch = prevStretch;
Settings.AutoDisplayMessages = prevAutoDisplayMessages;
Settings.BilinearFilter = prevBilinearFilter;
......
......@@ -440,16 +440,6 @@ enum
#define S9X_REG_KEY_BASE MY_REG_KEY
#define S9X_REG_KEY_VERSION REG_KEY_VER
#define EXT_WIDTH (MAX_SNES_WIDTH + 4)
#define EXT_PITCH (EXT_WIDTH * 2)
#define EXT_HEIGHT (MAX_SNES_HEIGHT + 4)
#define EXT_HEIGHT_WITH_CENTERING (EXT_HEIGHT + 16) // extra lines to center non ext height images
// Offset into buffer to allow a two pixel border around the whole rendered
// SNES image. This is a speed up hack to allow some of the image processing
// routines to access black pixel data outside the normal bounds of the buffer.
#define EXT_OFFSET (EXT_PITCH * 2 + 2 * 2)
#define EXT_OFFSET_WITH_CENTERING (EXT_OFFSET + EXT_PITCH * 16) // same as above
#define WIN32_WHITE RGB(255,255,255)
/*****************************************************************************/
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment