Skip to content

Commit

Permalink
Shots Factory: add '[x] Keep' checkbox to keep the settings until end…
Browse files Browse the repository at this point in the history
… of emulation of current game
  • Loading branch information
dinkc64 committed Jul 22, 2023
1 parent c3867ca commit 4dd6419
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 16 deletions.
1 change: 1 addition & 0 deletions src/burner/win32/app.rc
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTI
CAPTION "Shots Factory"
FONT 8, "MS Shell Dlg"
BEGIN
CONTROL "Keep", IDC_SHOTKEEP, "Button", BS_AUTOCHECKBOX | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 9, 72, 31, 14
DEFPUSHBUTTON "&Capture",IDCAPTURE,125,72,70,14
PUSHBUTTON "OK",IDOK,197,72,70,14
PUSHBUTTON "&Advance Frame",IDC_ADVANCE,54,72,70,14
Expand Down
1 change: 1 addition & 0 deletions src/burner/win32/resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@
#define IDC_LAYER3 20204
#define IDC_LAYER4 20205
#define IDC_SHOW 20206
#define IDC_SHOTKEEP 20207

#define IDC_LENGTH 20255
#define IDC_FRAMES 20256
Expand Down
34 changes: 18 additions & 16 deletions src/burner/win32/sfactd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
#include "burner.h"

static HWND hSFactdlg=NULL;
unsigned char layerBackup;

static bool bShotsFactory;
static bool bOldPause;
static int bKeepLayerCfg = 0;

void ToggleSprite(unsigned char PriNum)
{
Expand All @@ -28,6 +28,8 @@ void ToggleSprite(unsigned char PriNum)

static int SFactdUpdate()
{
CheckDlgButton(hSFactdlg,IDC_SHOTKEEP,(bKeepLayerCfg)?BST_CHECKED:BST_UNCHECKED);

CheckDlgButton(hSFactdlg,IDC_LAYER1,(nBurnLayer & 1)?BST_CHECKED:BST_UNCHECKED);
CheckDlgButton(hSFactdlg,IDC_LAYER2,(nBurnLayer & 2)?BST_CHECKED:BST_UNCHECKED);
CheckDlgButton(hSFactdlg,IDC_LAYER3,(nBurnLayer & 4)?BST_CHECKED:BST_UNCHECKED);
Expand All @@ -45,28 +47,23 @@ static int SFactdUpdate()

static int SFactdInit()
{
layerBackup=nBurnLayer;
bKeepLayerCfg = 0;

bRunPause=1;
CheckDlgButton(hSFactdlg,IDC_LAYER1,(nBurnLayer & 1)?BST_CHECKED:BST_UNCHECKED);
CheckDlgButton(hSFactdlg,IDC_LAYER2,(nBurnLayer & 2)?BST_CHECKED:BST_UNCHECKED);
CheckDlgButton(hSFactdlg,IDC_LAYER3,(nBurnLayer & 4)?BST_CHECKED:BST_UNCHECKED);
CheckDlgButton(hSFactdlg,IDC_LAYER4,(nBurnLayer & 8)?BST_CHECKED:BST_UNCHECKED);
CheckDlgButton(hSFactdlg,IDC_SPRITE1,(nSpriteEnable & 0x01)?BST_CHECKED:BST_UNCHECKED);
CheckDlgButton(hSFactdlg,IDC_SPRITE2,(nSpriteEnable & 0x02)?BST_CHECKED:BST_UNCHECKED);
CheckDlgButton(hSFactdlg,IDC_SPRITE3,(nSpriteEnable & 0x04)?BST_CHECKED:BST_UNCHECKED);
CheckDlgButton(hSFactdlg,IDC_SPRITE4,(nSpriteEnable & 0x08)?BST_CHECKED:BST_UNCHECKED);
CheckDlgButton(hSFactdlg,IDC_SPRITE5,(nSpriteEnable & 0x10)?BST_CHECKED:BST_UNCHECKED);
CheckDlgButton(hSFactdlg,IDC_SPRITE6,(nSpriteEnable & 0x20)?BST_CHECKED:BST_UNCHECKED);
CheckDlgButton(hSFactdlg,IDC_SPRITE7,(nSpriteEnable & 0x40)?BST_CHECKED:BST_UNCHECKED);
CheckDlgButton(hSFactdlg,IDC_SPRITE8,(nSpriteEnable & 0x80)?BST_CHECKED:BST_UNCHECKED);

SFactdUpdate();

return 0;
}


static int SFactdExit()
{
nBurnLayer = layerBackup;
nSpriteEnable = 0xFF;
if (bKeepLayerCfg == 0) {
nBurnLayer = 0xff;
nSpriteEnable = 0xff;
}

hSFactdlg = NULL;
bShotsFactory = 0;
bRunPause = bOldPause;
Expand Down Expand Up @@ -121,6 +118,11 @@ static INT_PTR CALLBACK DialogProc(HWND hDlg,UINT Msg,WPARAM wParam,LPARAM lPara
SFactdUpdate();
}
}
if (Id==IDC_SHOTKEEP && Notify==BN_CLICKED)
{
bKeepLayerCfg ^= 1;
SFactdUpdate();
}
if (Id==IDC_LAYER1 && Notify==BN_CLICKED)
{
ToggleLayer(1);
Expand Down

0 comments on commit 4dd6419

Please sign in to comment.