Skip to content

Commit

Permalink
Allow exclusive fullscreen on secondary displays.
Browse files Browse the repository at this point in the history
Also added some variables.
  • Loading branch information
michael-fadely committed Nov 5, 2015
1 parent a511f14 commit 6ed6686
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
18 changes: 13 additions & 5 deletions SADXModLoader/dllmain.cpp
Expand Up @@ -138,7 +138,7 @@ static void __cdecl ProcessCodes()
codeParser.processCodeList();
RaiseEvents(modFrameEvents);

const int numrows = (VerticalResolution / 12);
const int numrows = (VerticalResolution / (int)DebugFontSize);
int pos;
if ((int)msgqueue.size() <= numrows - 1)
pos = (numrows - 1) - (msgqueue.size() - 1);
Expand Down Expand Up @@ -1930,13 +1930,21 @@ static void __cdecl InitMods(void)
ConfigureFOV();

windowedfullscreen = settings->getBool("WindowedFullscreen");
stretchfullscreen = settings->getBool("StretchFullscreen", true);
screennum = settings->getInt("ScreenNum", 1);

if (!settings->getBool("PauseWhenInactive", true))
WriteData((uint8_t *)0x401914, (uint8_t)0xEBu);
if (!windowedfullscreen)
{
vector<uint8_t> nop(5, 0x90);
WriteData((void*)0x007943D0, nop.data(), nop.size());

stretchfullscreen = settings->getBool("StretchFullscreen", true);
// SADX automatically corrects values greater than the number of adapters available.
// DisplayAdapter is unsigned, so -1 will be greater than the number of adapters, and it will reset.
DisplayAdapter = screennum - 1;
}

screennum = settings->getInt("ScreenNum", 1);
if (!settings->getBool("PauseWhenInactive", true))
WriteData((uint8_t *)0x401914, (uint8_t)0xEBu);

if (settings->getBool("AutoMipmap", true))
{
Expand Down
4 changes: 4 additions & 0 deletions SADXModLoader/include/SADXModLoader/SADXVariables.h
Expand Up @@ -31,6 +31,7 @@ DataPointer(short, GameState, 0x03B22DE4);
DataPointer(NJS_VECTOR, Gravity, 0x3B0F0F8);
DataPointer(int, LevelFrameCount, 0x3B0F108);
DataPointer(int, FrameCounter, 0x3B0F13C);
DataPointer(int, FrameIncrement, 0x03B11178);
DataPointer(char, LastStoryFlag, 0x3B18DB4);
DataPointer(char, MetalSonicFlag, 0x3B18DB5);
DataPointer(short, CurrentCharacter, 0x3B22DC0);
Expand All @@ -52,6 +53,9 @@ DataPointer(char, Lives, 0x03B0EF34);
DataPointer(float, SkyChaseHealth, 0x03C82304);
DataPointer(char, HideHud, 0x03B0EF40);
DataPointer(int, CutscenePlaying, 0x3B2A2E4);
DataPointer(float, DebugFontSize, 0x03CE7154);
DataPointer(int, DebugFontColor, 0x03CE715C);
DataPointer(Uint32, DisplayAdapter, 0x03D0FDFC);

// Raw input array. It's recommended you use ControllerPointers instead.
// This will prevent compatibility issues with mods that need to redirect input.
Expand Down

0 comments on commit 6ed6686

Please sign in to comment.