Skip to content

Commit

Permalink
applen: add re-add option to skip video update.
Browse files Browse the repository at this point in the history
Signed-off-by: Andrea Odetti <mariofutire@gmail.com>
  • Loading branch information
audetto committed Dec 23, 2023
1 parent fc57b79 commit 025ffc3
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
3 changes: 2 additions & 1 deletion source/frontends/common2/commonframe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ namespace common2

CommonFrame::CommonFrame(const EmulatorOptions & options)
: mySpeed(options.fixedSpeed)
, myAllowVideoUpdate(!options.noVideoUpdate)
{
}

Expand Down Expand Up @@ -150,7 +151,7 @@ namespace common2

void CommonFrame::Execute(const DWORD cyclesToExecute)
{
const bool bVideoUpdate = !g_bFullSpeed;
const bool bVideoUpdate = myAllowVideoUpdate && !g_bFullSpeed;
const UINT dwClksPerFrame = NTSC_GetCyclesPerFrame();

// do it in the same batches as AppleWin (1 ms)
Expand Down
4 changes: 3 additions & 1 deletion source/frontends/common2/commonframe.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,11 @@ namespace common2
void ExecuteInDebugMode(const uint64_t microseconds);
void Execute(const DWORD uCycles);

const bool myAllowVideoUpdate;
Speed mySpeed;

std::vector<BYTE> myResource;

Speed mySpeed;

private:
CConfigNeedingRestart myHardwareConfig;
Expand Down
4 changes: 2 additions & 2 deletions source/frontends/common2/programoptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ namespace common2
po::options_description applenDesc("applen");
applenDesc.add_options()
("headless", "Headless: disable video (freewheel)")
("ntsc,nt", "NTSC: execute NTSC code")
("no-video-update,nv", "Do not execute NTSC code")
("device-name", po::value<std::string>(), "Gamepad device name (for applen)")
;
desc.add(applenDesc);
Expand Down Expand Up @@ -235,7 +235,7 @@ namespace common2

// applen
options.headless = vm.count("headless") > 0;
options.ntsc = vm.count("ntsc") > 0;
options.noVideoUpdate = vm.count("no-video-update") > 0;
setOption(vm, "device-name", options.paddleDeviceName);

return true;
Expand Down
2 changes: 1 addition & 1 deletion source/frontends/common2/programoptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ namespace common2

bool benchmark = false;
bool headless = false;
bool ntsc = false; // only for applen
bool noVideoUpdate = false; // only for applen

bool paddleSquaring = true; // turn the x/y range to a square
// on my PC it is something like
Expand Down

0 comments on commit 025ffc3

Please sign in to comment.