New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LilyPad: Another GUI update and add more new functions #1751

Merged
merged 5 commits into from Jan 27, 2017

Conversation

Projects
None yet
4 participants
@FlatOutPS2
Member

FlatOutPS2 commented Jan 8, 2017

Updates the UI by moving some functions on their respective tabs, removes "Ignore Key" and "Send escape on window close" hacks, and removes "L3 toggles Turbo" hack and replaces it with a bindable Turbo Button on the Pad tabs. The "Turbo" checkbox in the input configuration has been renamed "Rapid Fire".

Adds a new option called "Exclude Input" to the Pad tabs. This option disables an input so it will be ignored when trying to bind another input. This is helpful when binding controls for a device with an input that's difficult to center or faulty and always registered as active.

And adds neGcon as a pad type. This controller can be used in several PS1 and PS2 titles such as the Ridge Racer and Ace Combat series.

@turtleli

This comment has been minimized.

Member

turtleli commented Jan 8, 2017

...Note to self: consider refactoring LilyPad.

@FlatOutPS2 FlatOutPS2 force-pushed the FlatOutPS2:Lily branch Jan 8, 2017

@FlatOutPS2

This comment has been minimized.

Member

FlatOutPS2 commented Jan 8, 2017

...Note to self: set up a Linux build environment.

@gregory38

This comment has been minimized.

Contributor

gregory38 commented Jan 8, 2017

Note to not-myself add a Linux GUI ;)

@FlatOutPS2 FlatOutPS2 force-pushed the FlatOutPS2:Lily branch Jan 8, 2017

plugins/LilyPad/LilyPad.cpp Outdated
query.lastByte = 1;
DEBUG_OUT(pad->mode);
return pad->mode;
if (pad->config || value == 0x42 || value == 0x43) {

This comment has been minimized.

@turtleli

turtleli Jan 13, 2017

Member

It might be nicer to have an early return:

if (!pad->config && value != 0x42 && value != 0x43) {
    DEBUG_OUT(0xF3);
    return 0xF3;
}

I don't know whether you need to have query.numBytes = 0; and query.queryDone = 1; too.

It also might be worth commenting that the other commands don't respond unless in config mode.

This comment has been minimized.

@FlatOutPS2

FlatOutPS2 Jan 14, 2017

Member

don't know whether you need to have query.numBytes = 0; and query.queryDone = 1; too.

Those are necessary.

I used the early return in another build. Not sure why I didn't change it before pushing this PR.

plugins/LilyPad/LilyPad.cpp Outdated
query.lastByte = 1;
DEBUG_OUT(MODE_PS1_MOUSE);
return MODE_PS1_MOUSE;
} else if (padtype == neGconPad) {

This comment has been minimized.

@turtleli

turtleli Jan 13, 2017

Member

else after a return is redundant.

plugins/LilyPad/LilyPad.cpp Outdated
} else {
static const u8 modes[2] = {MODE_DIGITAL, MODE_ANALOG};
pad->mode = modes[value];
if (pad->config || query.currentCommand == 0x42 || query.currentCommand == 0x43) {

This comment has been minimized.

@turtleli

turtleli Jan 13, 2017

Member

Ditto the previous early return comment.

@@ -48,7 +48,7 @@ void PCSX2_overrideConfig(GeneralConfig &config_in_out)
config_in_out.disableScreenSaver = 0; // Not required - handled internally by PCSX2
config_in_out.escapeFullscreenHack = 0; // Not required - handled internally by PCSX2
config_in_out.saveStateTitle = 0; // Not required - handled internally by PCSX2
config_in_out.closeHacks = 0; // Cannot function when used by PCSX2
config_in_out.closeHack = 0; // Cannot function when used by PCSX2

This comment has been minimized.

@turtleli

turtleli Jan 13, 2017

Member

Is the remaining close hack useful? I'm not sure ExitProcess() allows for proper cleanup to happen.

This comment has been minimized.

@FlatOutPS2

FlatOutPS2 Jan 14, 2017

Member

It can be useful if you want a quick exit out of an emulator. Yes, it does say it might not do a proper cleanup, but that's been the case ever since it was introduced. I haven't found anyone ever complaining about it, but that might also be because hardly anyone has ever used it. :p

@FlatOutPS2 FlatOutPS2 force-pushed the FlatOutPS2:Lily branch 2 times, most recently Jan 14, 2017

plugins/LilyPad/LilyPad.cpp Outdated
@@ -1209,11 +1206,19 @@ u8 CALLBACK PADpoll(u8 value)
if (query.lastByte == 0) {
query.lastByte++;
query.currentCommand = value;
//Only 0x42 and 0x43 work outside of config mode, so avoid the other cases if not in config mode.

This comment has been minimized.

@turtleli

turtleli Jan 18, 2017

Member

The comment could be better - 0x42 and 0x43 aren't self explanatory.

plugins/LilyPad/LilyPad.cpp Outdated
@@ -1375,6 +1405,12 @@ u8 CALLBACK PADpoll(u8 value)
return 0xF3;
} else {
query.lastByte++;
//Only 0x42 and 0x43 work outside of config mode, so avoid the other cases if not in config mode.

This comment has been minimized.

@turtleli

turtleli Jan 18, 2017

Member

Ditto.

plugins/LilyPad/Config.cpp Outdated
if (dev && (selectedDevice == -1 || dm->devices[selectedDevice] == dev)) {
//Check the bindings for an excluded input, and ignore it if found.
bool exclude = false;
if (dev) {

This comment has been minimized.

@turtleli

turtleli Jan 18, 2017

Member

Having if (dev) twice isn't great.

You could probably early return first:

if (dev == nullptr || selectedDevice != -1 && dm->devices[selectedDevice] != dev)
    return 0;

And also return instead of using a bool when excluding inputs.

plugins/LilyPad/Config.cpp Outdated
config.closeHack = 0;
} else if (config.closeHack == 255) {
config.closeHack = (u8)GetPrivateProfileIntW(L"General Settings", L"Close Hack", 0, file);
}

This comment has been minimized.

@turtleli

turtleli Jan 18, 2017

Member

Might be better to not add old version compatibility code for an easily adjustable option - it may be more inconvenient from the user POV, but if you throw in compatibility code, who knows how long it'll stay there and that'll just make things less maintainable if this stuff builds up.

plugins/LilyPad/Linux/Config.cpp Outdated
config.closeHacks &= ~2;
config.closeHack = (u8)cfg.ReadInt(L"General Settings", L"Close Hacks");
if (config.closeHack == 0)
config.closeHack = (u8)cfg.ReadInt(L"General Settings", L"Close Hack");

This comment has been minimized.

@turtleli

turtleli Jan 18, 2017

Member

Ditto.

@FlatOutPS2 FlatOutPS2 force-pushed the FlatOutPS2:Lily branch Jan 24, 2017

@turtleli

This comment has been minimized.

Member

turtleli commented Jan 26, 2017

The commits need to be split up properly, but otherwise the code seems fine.

@FlatOutPS2 FlatOutPS2 force-pushed the FlatOutPS2:Lily branch 2 times, most recently to 8d00ae2 Jan 26, 2017

FlatOutPS2 added some commits Dec 30, 2016

LilyPad: Add neGcon support
Adds neGcon as a new pad type.

For use with several PS1 and PS2 games like the Ridge Racer and Ace
Combat series.
LilyPad: Add Exclude Input option
This new option on the pad tabs disables an input so it will be ignored
when trying to bind another input. This is helpful when binding controls
for a device with an input that's difficult to center like an
accelerator, or just always active like a faulty button or analog stick.
LilyPad: Remove outdated hacks
Removes Ignore Key(hasn't functioned since LilyPad 0.9.9 (PCSX2 0.9.6)),
and "Send escape on window close" hack (unnecessary for PCSX2 and caused
issues with other emulators).
LilyPad: Replace Turbo hack
The "L3 Toggles Turbo" hack has been removed and been replaced by a
bindable Turbo button on the Pad tabs. The Turbo function in the input
configuration has been renamed Rapid Fire.
LilyPad: UI restructure
UI restructure and improvements.

@turtleli turtleli merged commit 625c4a9 into PCSX2:master Jan 27, 2017

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@isamu99

This comment has been minimized.

isamu99 commented on plugins/LilyPad/Config.cpp in f8a79e5 Dec 19, 2017

Thank you for adding NeGcon support sir! Wrote a message to you in the LilyPad thread over in the PCSX2 forums.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment