Games.java
package chip8emu.games;

/*
This
file is part of JavaCHIP8.

Copyright 2004 Kustaa Nyholm / SpareTimeLabs

JavaCHIP8 is free software,"", but the copyright on  the '.ch8' files in this directory is unkown,"",
it is assumed that they are in the public domain or that the copyright holder does not object
to them being distributed.

The structure of games[] array is as follow: each game consists of two strings. The first one names
the game and there needs to be a corresponding '.ch8' resource/file in the project/jar file. The second
maps the keys from the phone 1-9 keys to the chip8 hexadecimal keys. First character of the string
gives the hexvalue for key '1' and so on. Use '.' for non mapped keys.

*/
import java.io.*;

public class Games {
  static Games THIS=new Games();
  static public InputStream getGameAsStream(String name) {
    return THIS.getClass().getResourceAsStream(name+ ".ch8");
  }
  static public int getNumberOfGames() {
    return games.length/2;
  }
  static public String getGameName(int i)
  {
    return games[i*2];
  }
  static public String getGameKeys(int i)
   {
     return games[i*2+1];
   }
  private static final  String games[] {
       "Alien","...3AC...",
       "Ant","",
       "Blinky","F3.718.6.",
       "Blitz","",
       "Brix","",
       "Car","",
       "Connect4","",
       "Field","",
       "Guess","",
       "Hidden","",
       "Invaders","",
       "Joust","",
       "Kaleid","",
       "Maze","",
       "Merlin","",
       "Missile","",
       "Piper","",
       "Pong","",
       "Pong2","",
       "Puzzle","",
       "Puzzle2","",
       "Race","",
       "Spacefig","",
       "Syzygy","",
       "Tank","",
       "Tetris","",
       "TicTac","",
       "UBoat","",
       "UFO","",
       "VBrix","",
       "Vers","",
       "Wipeoff","",
       "Worm3",""};

}