Skip to content

Commit

Permalink
minor
Browse files Browse the repository at this point in the history
  • Loading branch information
Federico Berti committed Mar 26, 2021
1 parent bc5da54 commit e4875fb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
4 changes: 4 additions & 0 deletions src/main/java/omegadrive/TODO.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ md: vdp perf
ok (buggy) - 78b91eeb on 11/11/2019 at 11:52
- ie. adds a rendering bug

md: hint tweaks
05c7ce0a 25/01/2021 at 17:20
breaks fullscreen_niccc2000_for_megadrive_fixed.bin

//region issue EUJ -> U, should use U
120: Toejam & Earl in Panic on Funkotron (E) [f2].bin
Robocop Versus The Terminator (U) [T+Rus].bin
Expand Down
12 changes: 9 additions & 3 deletions src/main/java/omegadrive/ui/SwingWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public class SwingWindow implements DisplayWindow {

private List<AbstractButton> regionItems;
private JCheckBoxMenuItem fullScreenItem;
private JMenu recentFilesMenu;
private JMenu recentFilesMenu, joypadTypeMenu;
private JMenuItem[] recentFilesItems;
private Map<PlayerNumber, JMenu> inputMenusMap;
private final static int screenChangedCheckFrequency = 60;
Expand Down Expand Up @@ -262,7 +262,7 @@ public void init() {
inputMenusMap.values().forEach(inputMenu::add);
setting.add(inputMenu);

JMenu joypadTypeMenu = new JMenu("Joypad Type");
joypadTypeMenu = new JMenu("Joypad Type");
createAndAddJoypadTypes(joypadTypeMenu);
setting.add(joypadTypeMenu);

Expand Down Expand Up @@ -584,7 +584,10 @@ public void reloadSystem(SystemProvider systemProvider) {

Arrays.stream(jFrame.getKeyListeners()).forEach(jFrame::removeKeyListener);
setupFrameKeyListener();
Optional.ofNullable(mainEmu).ifPresent(sp -> setTitle(""));
Optional.ofNullable(mainEmu).ifPresent(sp -> {
setTitle("");
joypadTypeMenu.setEnabled(mainEmu.getSystemType() == SystemLoader.SystemType.GENESIS);
});
}

@Override
Expand Down Expand Up @@ -701,6 +704,9 @@ private void createAndAddJoypadTypes(JMenu joypadTypeMenu) {
JMenu pMenu = new JMenu(pn.name());
ButtonGroup bg = new ButtonGroup();
for (JoypadType type : JoypadType.values()) {
if (type == JoypadType.BUTTON_2) {
continue;
}
JRadioButtonMenuItem it = new JRadioButtonMenuItem(type.name(), type == JoypadType.BUTTON_6);
addAction(it, e -> handleSystemEvent(PAD_SETUP_CHANGE, pn.name() + ":" + type.name(),
pn.name() + ":" + type.name()));
Expand Down

0 comments on commit e4875fb

Please sign in to comment.