From be941baff944059dad85e54631fa4dc1cf34e88a Mon Sep 17 00:00:00 2001 From: Federico Berti Date: Sat, 18 Apr 2020 13:27:30 +0100 Subject: [PATCH] helios: prepare for release --- CREDITS.md | 21 ++++++++-- key.config.1p | 40 +++++++++++++++++++ .../java/omegadrive/ui/DisplayWindow.java | 2 +- .../omegadrive/ui/KeyBindingsHandler.java | 21 ++++++++++ src/main/java/omegadrive/ui/SwingWindow.java | 2 +- .../omegadrive/ui/KeyBindingsHandlerTest.java | 25 ------------ 6 files changed, 81 insertions(+), 30 deletions(-) create mode 100644 key.config.1p diff --git a/CREDITS.md b/CREDITS.md index 27d14457..2f7f72e8 100644 --- a/CREDITS.md +++ b/CREDITS.md @@ -2,11 +2,17 @@ Initially based on the [Genefusto](https://github.com/DarkMoe/genefusto) emulator by DarkMoe. -Tony Headford for his [M68k](https://github.com/tonyheadford/m68k) core. +Tony Headford for his m68k core: +- [M68k](https://github.com/tonyheadford/m68k) -J. Sanchez for his [Z80](https://github.com/jsanchezv/Z80Core) core. +J. Sanchez for his Z80 core: +- [Z80](https://github.com/jsanchezv/Z80Core) -S. Dallongeville for his [YM2612](https://github.com/rofl0r/gens) core from the Gens project. +S. Dallongeville for his Ym2612 core from the Gens project: +- [YM2612](https://github.com/rofl0r/gens) + +Alexey Khokholov for his Ym2612 core: +- [Nuked-OPN2](https://github.com/nukeykt/Nuked-OPN2) Chris White for his JavaGear project and in particular: - [SN76489](http://javagear.sourceforge.net/source-repository.html) @@ -16,4 +22,13 @@ Tjitze Rienstra for his TMSX project and in particular: - [AY38910](https://github.com/tjitze/TMSX) - [TMS9918a VDP](https://github.com/tjitze/TMSX) +Digital Sound Antiques for his Ym2413 core: +- [emu2413](https://github.com/digital-sound-antiques/emu2413) + +Andrew Hoffman for his NES emulator: +- [halfnes](https://github.com/andrew-hoffman/halfnes) + +Tomek Rekawek for his GameBoy emulator: +- [coffee-gb](https://github.com/trekawek/coffee-gb) + C-BIOS Association for their open source [MSX bios](http://cbios.sourceforge.net/) \ No newline at end of file diff --git a/key.config.1p b/key.config.1p new file mode 100644 index 00000000..df30b10d --- /dev/null +++ b/key.config.1p @@ -0,0 +1,40 @@ +#ui bindings +CLOSE_APP=shift ctrl pressed ESCAPE +CLOSE_ROM=ctrl pressed ESCAPE +LOAD_STATE=ctrl pressed 7 +NEW_ROM=ctrl pressed L +QUICK_LOAD=ctrl pressed 9 +QUICK_SAVE=ctrl pressed 8 +RESET=ctrl pressed R +SAVE_STATE=ctrl pressed 6 +SET_DEBUG_UI=ctrl pressed D +TOGGLE_FULL_SCREEN=ctrl pressed F +TOGGLE_MUTE=ctrl pressed M +TOGGLE_PAUSE=ctrl pressed P +TOGGLE_SOUND_RECORD=shift ctrl pressed R +TOGGLE_THROTTLE=ctrl pressed T + +#player 1 +P.1.UP=UP +P.1.DOWN=DOWN +P.1.LEFT=LEFT +P.1.RIGHT=RIGHT +P.1.A=A +P.1.B=S +P.1.C=D +P.1.X=Q +P.1.Y=W +P.1.Z=E +P.1.MODE=L +P.1.START=ENTER + +#no player 2 +#P.2.UP=W +#P.2.DOWN=S +#P.2.LEFT=A +#P.2.RIGHT=D +#P.2.A=C +#P.2.B=V +#P.2.C=B +#P.2.MODE=N +#P.2.START=SPACE \ No newline at end of file diff --git a/src/main/java/omegadrive/ui/DisplayWindow.java b/src/main/java/omegadrive/ui/DisplayWindow.java index b1019cbd..1280c4a5 100644 --- a/src/main/java/omegadrive/ui/DisplayWindow.java +++ b/src/main/java/omegadrive/ui/DisplayWindow.java @@ -101,7 +101,7 @@ default void showInfo(String info) { default String getAboutString() { int year = LocalDate.now().getYear(); String yrString = year == 2018 ? "2018" : "2018-" + year; - String res = FRAME_TITLE_HEAD + "\nA Sega Megadrive (Genesis) emulator, written in Java"; + String res = FRAME_TITLE_HEAD + "\nA Java-based multi-system emulator."; res += "\n\nCopyright " + yrString + ", Federico Berti"; res += "\n\nSee CREDITS.TXT for more information"; res += "\n\nReleased under GPL v.3.0 license."; diff --git a/src/main/java/omegadrive/ui/KeyBindingsHandler.java b/src/main/java/omegadrive/ui/KeyBindingsHandler.java index e06359aa..d96003cc 100644 --- a/src/main/java/omegadrive/ui/KeyBindingsHandler.java +++ b/src/main/java/omegadrive/ui/KeyBindingsHandler.java @@ -29,7 +29,9 @@ import org.apache.logging.log4j.Logger; import javax.swing.*; +import java.awt.event.KeyEvent; import java.util.*; +import java.util.stream.Collectors; import static javax.swing.KeyStroke.getKeyStroke; @@ -131,4 +133,23 @@ public KeyStroke getKeyStrokeForEvent(SystemEvent event) { return Arrays.stream(keyMap.allKeys()).filter(ks -> event == getSystemEventIfAny(ks)). findFirst().orElse(null); } + + public static String toConfigString() { + return toConfigList().stream().collect(Collectors.joining("\n")); + } + + private static List toConfigList() { + List l = new ArrayList<>(); + for (KeyStroke ks : keyMap.allKeys()) { + l.add(keyMap.get(ks).toString() + DIV + ks.toString()); + } + Collections.sort(l); + KeyboardInputHelper.keyboardBindings.cellSet().stream().forEach(cell -> { + String tk = PLAYER_LINE_HEAD + cell.getRowKey().name().substring(1) + "."; + tk += cell.getColumnKey().getMnemonic() + DIV; + tk += KeyEvent.getKeyText(cell.getValue()).toUpperCase(); + l.add(tk); + }); + return l; + } } diff --git a/src/main/java/omegadrive/ui/SwingWindow.java b/src/main/java/omegadrive/ui/SwingWindow.java index 6a095fff..0a06a548 100644 --- a/src/main/java/omegadrive/ui/SwingWindow.java +++ b/src/main/java/omegadrive/ui/SwingWindow.java @@ -316,7 +316,7 @@ public void init() { JMenuItem keyBindingsItem = new JMenuItem("Key Bindings"); addAction(keyBindingsItem, e -> showHelpMessage(keyBindingsItem.getText(), - FileLoader.readFileContentAsString(KeyBindingsHandler.configFile))); + KeyBindingsHandler.toConfigString())); JMenuItem readmeItem = new JMenuItem("Readme"); addAction(readmeItem, e -> showHelpMessage(readmeItem.getText(), diff --git a/src/test/java/omegadrive/ui/KeyBindingsHandlerTest.java b/src/test/java/omegadrive/ui/KeyBindingsHandlerTest.java index afc12fb4..fc9ce87f 100644 --- a/src/test/java/omegadrive/ui/KeyBindingsHandlerTest.java +++ b/src/test/java/omegadrive/ui/KeyBindingsHandlerTest.java @@ -20,41 +20,16 @@ package omegadrive.ui; import omegadrive.input.InputProvider.PlayerNumber; -import omegadrive.input.KeyboardInputHelper; import org.junit.Assert; import org.junit.Test; -import javax.swing.*; -import java.awt.event.KeyEvent; -import java.util.ArrayList; import java.util.Arrays; -import java.util.Collections; import java.util.List; -import java.util.stream.Collectors; import static omegadrive.ui.KeyBindingsHandler.*; public class KeyBindingsHandlerTest { - private static List toConfigList() { - List l = new ArrayList<>(); - for (KeyStroke ks : keyMap.allKeys()) { - l.add(keyMap.get(ks).toString() + DIV + ks.toString()); - } - Collections.sort(l); - KeyboardInputHelper.keyboardBindings.cellSet().stream().forEach(cell -> { - String tk = PLAYER_LINE_HEAD + cell.getRowKey().name().substring(1) + "."; - tk += cell.getColumnKey().getMnemonic() + DIV; - tk += KeyEvent.getKeyText(cell.getValue()).toUpperCase(); - l.add(tk); - }); - return l; - } - - private static String toConfigString() { - return toConfigList().stream().collect(Collectors.joining("\n")); - } - @Test public void testParsing() { KeyBindingsHandler.getInstance();