Skip to content

Commit

Permalink
helios: prepare for release
Browse files Browse the repository at this point in the history
  • Loading branch information
Federico Berti committed Apr 18, 2020
1 parent 04dc0b4 commit be941ba
Show file tree
Hide file tree
Showing 6 changed files with 81 additions and 30 deletions.
21 changes: 18 additions & 3 deletions CREDITS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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/)
40 changes: 40 additions & 0 deletions key.config.1p
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion src/main/java/omegadrive/ui/DisplayWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -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.";
Expand Down
21 changes: 21 additions & 0 deletions src/main/java/omegadrive/ui/KeyBindingsHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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<String> toConfigList() {
List<String> 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;
}
}
2 changes: 1 addition & 1 deletion src/main/java/omegadrive/ui/SwingWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
25 changes: 0 additions & 25 deletions src/test/java/omegadrive/ui/KeyBindingsHandlerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -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<String> toConfigList() {
List<String> 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();
Expand Down

0 comments on commit be941ba

Please sign in to comment.