Skip to content

Commit

Permalink
add retro scanlines shader to the dx9-alt list
Browse files Browse the repository at this point in the history
  • Loading branch information
dinkc64 committed Oct 24, 2024
1 parent 83505d5 commit 508178d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/burner/win32/app.rc
Original file line number Diff line number Diff line change
Expand Up @@ -1453,6 +1453,7 @@ BEGIN
MENUITEM "CRT Easy Mode", MENU_DX9_ALT_HARD_FX_CRT_EASY_MODE
MENUITEM "CRT Standard", MENU_DX9_ALT_HARD_FX_CRT_STANDARD
MENUITEM "CRT Bicubic", MENU_DX9_ALT_HARD_FX_CRT_BICUBIC
MENUITEM "CRT Retro Scanlines", MENU_DX9_ALT_HARD_FX_CRT_RETROSL
MENUITEM "CRT CGA", MENU_DX9_ALT_HARD_FX_CRT_CGA
END
POPUP "SoftFX algorithm"
Expand Down
5 changes: 3 additions & 2 deletions src/burner/win32/resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -895,8 +895,9 @@
#define MENU_DX9_ALT_HARD_FX_CRT_EASY_MODE 11454
#define MENU_DX9_ALT_HARD_FX_CRT_STANDARD 11455
#define MENU_DX9_ALT_HARD_FX_CRT_BICUBIC 11456
#define MENU_DX9_ALT_HARD_FX_CRT_CGA 11457
#define MENU_DX9_ALT_HARD_FX_LAST 11457 // last one
#define MENU_DX9_ALT_HARD_FX_CRT_RETROSL 11457
#define MENU_DX9_ALT_HARD_FX_CRT_CGA 11458
#define MENU_DX9_ALT_HARD_FX_LAST 11459 // last one
#define MENU_DX9_ALT_SOFT_AUTOSIZE 11490
#define MENU_DX9_ALT_FORCE_16BIT 11491

Expand Down
1 change: 1 addition & 0 deletions src/burner/win32/scrn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3439,6 +3439,7 @@ static void OnCommand(HWND /*hDlg*/, int id, HWND /*hwndCtl*/, UINT codeNotify)
case MENU_DX9_ALT_HARD_FX_CRT_EASY_MODE:
case MENU_DX9_ALT_HARD_FX_CRT_STANDARD:
case MENU_DX9_ALT_HARD_FX_CRT_BICUBIC:
case MENU_DX9_ALT_HARD_FX_CRT_RETROSL:
case MENU_DX9_ALT_HARD_FX_CRT_CGA:
nVidDX9HardFX = id - MENU_DX9_ALT_HARD_FX_NONE;
break;
Expand Down
10 changes: 9 additions & 1 deletion src/intf/video/win32/vid_directx9.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1797,6 +1797,7 @@ char *HardFXFilenames[] = {
"support/shaders/crt_easymode.fx",
"support/shaders/crt_standard.fx",
"support/shaders/crt_bicubic.fx",
"support/shaders/crt_retrosl.fx",
"support/shaders/crt_cga.fx"
};

Expand Down Expand Up @@ -2077,6 +2078,7 @@ static int dx9AltSetHardFX(int nHardFX)
// common parameters
pVidEffect->SetParamFloat2("texture_size", nTextureWidth, nTextureHeight);
pVidEffect->SetParamFloat2("video_size", (nRotateGame ? nGameHeight : nGameWidth) + 0.5f, nRotateGame ? nGameWidth : nGameHeight + 0.5f);
pVidEffect->SetParamFloat2("video_time", nCurrentFrame / 5, nCurrentFrame / 5);
}
else
{
Expand Down Expand Up @@ -2420,8 +2422,9 @@ static int dx9AltRender() // MemToSurf
dx9AltSetVertex(0, 0, nWidth, nHeight, nTextureWidth, nTextureHeight, 0, 0, nImageWidth, nImageHeight);
}

if (pVidEffect && pVidEffect->IsValid())
if (pVidEffect && pVidEffect->IsValid()) {
pVidEffect->SetParamFloat2("output_size", nImageWidth, nImageHeight);
}

D3DVIEWPORT9 vp;

Expand All @@ -2446,6 +2449,11 @@ static int dx9AltRender() // MemToSurf
}
}

if (pVidEffect && pVidEffect->IsValid()) {
pVidEffect->SetParamFloat2("video_time", nCurrentFrame / 5, nCurrentFrame / 5);
// pVidEffect->SetParamFloat2("user_settings", fDX9ShaderSettings[0], fDX9ShaderSettings[1]); // at some point!
}

pD3DDevice->BeginScene();

{
Expand Down

0 comments on commit 508178d

Please sign in to comment.