├── .classpath
├── .project
├── .settings
└── org.eclipse.jdt.core.prefs
├── README.md
├── bin
├── TSEmuTest.class
└── textScreenEmu
│ ├── ASCIIname.class
│ ├── Palette.class
│ ├── PaletteFactory.class
│ ├── PalettePredef.class
│ ├── Screen.class
│ ├── Tile.class
│ ├── TileImage.class
│ ├── Tileset.class
│ ├── TilesetFactory.class
│ ├── TilesetPredef.class
│ └── images
│ ├── palettes
│ ├── pal_APPLEII_16.png
│ ├── pal_BLACK_AND_WHITE.png
│ ├── pal_C16_128.png
│ ├── pal_C64_16.png
│ ├── pal_CGA_16.png
│ ├── pal_EGA_64.png
│ ├── pal_GAMEBOY_4.png
│ ├── pal_GREY_16.png
│ ├── pal_GREY_256.png
│ ├── pal_GREY_32.png
│ ├── pal_GREY_4.png
│ ├── pal_GREY_8.png
│ ├── pal_MSX_16.png
│ ├── pal_NES_64.png
│ ├── pal_PHOSPHOR_8.png
│ ├── pal_SPECTRUM_16.png
│ └── pal_VGA_16.png
│ └── tilesets
│ ├── antique_8x16.bmp
│ ├── basic_8x8.png
│ ├── broadway_8x16.bmp
│ ├── comicsans_16x16.png
│ ├── courier_8x16.bmp
│ ├── cp437_10x10.png
│ ├── cp437_12x12.png
│ ├── cp437_16x16.png
│ ├── cp437_8x8.png
│ ├── cp437_9x16.png
│ ├── doodle_16x16.png
│ ├── doodle_6x6.png
│ ├── medieval_8x16.bmp
│ ├── retro_10x10.png
│ └── sm_16x16.png
├── jars
├── TextScreenEmu_v0.1.0.jar
├── TextScreenEmu_v0.1.1.jar
├── TextScreenEmu_v0.1.2.jar
├── TextScreenEmu_v0.1.3.jar
├── TextScreenEmu_v0.1.4.jar
├── TextScreenEmu_v0.1.5.jar
├── TextScreenEmu_v0.1.6.jar
└── TextScreenEmu_v1.0.0.jar
└── src
├── TSEmuTest.java
└── textScreenEmu
├── ASCIIname.java
├── Palette.java
├── PaletteFactory.java
├── PalettePredef.java
├── Screen.java
├── Tile.java
├── TileImage.java
├── Tileset.java
├── TilesetFactory.java
├── TilesetPredef.java
└── images
├── palettes
├── pal_APPLEII_16.png
├── pal_BLACK_AND_WHITE.png
├── pal_C16_128.png
├── pal_C64_16.png
├── pal_CGA_16.png
├── pal_EGA_64.png
├── pal_GAMEBOY_4.png
├── pal_GREY_16.png
├── pal_GREY_256.png
├── pal_GREY_32.png
├── pal_GREY_4.png
├── pal_GREY_8.png
├── pal_MSX_16.png
├── pal_NES_64.png
├── pal_PHOSPHOR_8.png
├── pal_SPECTRUM_16.png
└── pal_VGA_16.png
└── tilesets
├── antique_8x16.bmp
├── basic_8x8.png
├── broadway_8x16.bmp
├── comicsans_16x16.png
├── courier_8x16.bmp
├── cp437_10x10.png
├── cp437_12x12.png
├── cp437_16x16.png
├── cp437_8x8.png
├── cp437_9x16.png
├── doodle_16x16.png
├── doodle_6x6.png
├── medieval_8x16.bmp
├── retro_10x10.png
└── sm_16x16.png
/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | TextScreenEmu
4 |
5 |
6 |
7 |
8 |
9 | org.eclipse.jdt.core.javabuilder
10 |
11 |
12 |
13 |
14 |
15 | org.eclipse.jdt.core.javanature
16 |
17 |
18 |
--------------------------------------------------------------------------------
/.settings/org.eclipse.jdt.core.prefs:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
3 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
4 | org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
5 | org.eclipse.jdt.core.compiler.compliance=1.8
6 | org.eclipse.jdt.core.compiler.debug.lineNumber=generate
7 | org.eclipse.jdt.core.compiler.debug.localVariable=generate
8 | org.eclipse.jdt.core.compiler.debug.sourceFile=generate
9 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
10 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
11 | org.eclipse.jdt.core.compiler.source=1.8
12 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # TextScreenEmu
2 |
3 | TextScreenEmu is a java package which provides tools for emulating that old school text mode we all know and love (and sometimes hate).
4 | It provides a main `Screen` onto which characters from a `Tileset` can be drawn. The screen has a foreground and background colour which are set according to a `Palette`.
5 |
6 | Several tilesets and palettes are provided but you can make your own using the factory classes.
7 |
8 | [Check out the wiki](https://github.com/sirrandalot/TextScreenEmu/wiki) for more information, or [download the jar](https://github.com/sirrandalot/TextScreenEmu/tree/master/jars) and get started!
9 |
10 | If anyone uses this to make something cool, I'd love to see it and I could even link to it from here!
11 |
12 | ## Example Tileset
13 | [See all pre-defined tilesets!](https://github.com/sirrandalot/TextScreenEmu/wiki/Pre-Defined-Tilesets)
14 | 
15 |
16 | ## Example Palette
17 | [See all pre-defined palettes!](https://github.com/sirrandalot/TextScreenEmu/wiki/Pre-Defined-Palettes)
18 | 
19 |
20 | ## Example Image
21 | [Check out some example code!](https://github.com/sirrandalot/TextScreenEmu/wiki/Example-Code)
22 | 
23 |
--------------------------------------------------------------------------------
/bin/TSEmuTest.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sirrandalot/TextScreenEmu/2dc254224d4590a87e30698483ddb4c8aead4970/bin/TSEmuTest.class
--------------------------------------------------------------------------------
/bin/textScreenEmu/ASCIIname.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sirrandalot/TextScreenEmu/2dc254224d4590a87e30698483ddb4c8aead4970/bin/textScreenEmu/ASCIIname.class
--------------------------------------------------------------------------------
/bin/textScreenEmu/Palette.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sirrandalot/TextScreenEmu/2dc254224d4590a87e30698483ddb4c8aead4970/bin/textScreenEmu/Palette.class
--------------------------------------------------------------------------------
/bin/textScreenEmu/PaletteFactory.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sirrandalot/TextScreenEmu/2dc254224d4590a87e30698483ddb4c8aead4970/bin/textScreenEmu/PaletteFactory.class
--------------------------------------------------------------------------------
/bin/textScreenEmu/PalettePredef.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sirrandalot/TextScreenEmu/2dc254224d4590a87e30698483ddb4c8aead4970/bin/textScreenEmu/PalettePredef.class
--------------------------------------------------------------------------------
/bin/textScreenEmu/Screen.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sirrandalot/TextScreenEmu/2dc254224d4590a87e30698483ddb4c8aead4970/bin/textScreenEmu/Screen.class
--------------------------------------------------------------------------------
/bin/textScreenEmu/Tile.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sirrandalot/TextScreenEmu/2dc254224d4590a87e30698483ddb4c8aead4970/bin/textScreenEmu/Tile.class
--------------------------------------------------------------------------------
/bin/textScreenEmu/TileImage.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sirrandalot/TextScreenEmu/2dc254224d4590a87e30698483ddb4c8aead4970/bin/textScreenEmu/TileImage.class
--------------------------------------------------------------------------------
/bin/textScreenEmu/Tileset.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sirrandalot/TextScreenEmu/2dc254224d4590a87e30698483ddb4c8aead4970/bin/textScreenEmu/Tileset.class
--------------------------------------------------------------------------------
/bin/textScreenEmu/TilesetFactory.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sirrandalot/TextScreenEmu/2dc254224d4590a87e30698483ddb4c8aead4970/bin/textScreenEmu/TilesetFactory.class
--------------------------------------------------------------------------------
/bin/textScreenEmu/TilesetPredef.class:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sirrandalot/TextScreenEmu/2dc254224d4590a87e30698483ddb4c8aead4970/bin/textScreenEmu/TilesetPredef.class
--------------------------------------------------------------------------------
/bin/textScreenEmu/images/palettes/pal_APPLEII_16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sirrandalot/TextScreenEmu/2dc254224d4590a87e30698483ddb4c8aead4970/bin/textScreenEmu/images/palettes/pal_APPLEII_16.png
--------------------------------------------------------------------------------
/bin/textScreenEmu/images/palettes/pal_BLACK_AND_WHITE.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sirrandalot/TextScreenEmu/2dc254224d4590a87e30698483ddb4c8aead4970/bin/textScreenEmu/images/palettes/pal_BLACK_AND_WHITE.png
--------------------------------------------------------------------------------
/bin/textScreenEmu/images/palettes/pal_C16_128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sirrandalot/TextScreenEmu/2dc254224d4590a87e30698483ddb4c8aead4970/bin/textScreenEmu/images/palettes/pal_C16_128.png
--------------------------------------------------------------------------------
/bin/textScreenEmu/images/palettes/pal_C64_16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sirrandalot/TextScreenEmu/2dc254224d4590a87e30698483ddb4c8aead4970/bin/textScreenEmu/images/palettes/pal_C64_16.png
--------------------------------------------------------------------------------
/bin/textScreenEmu/images/palettes/pal_CGA_16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sirrandalot/TextScreenEmu/2dc254224d4590a87e30698483ddb4c8aead4970/bin/textScreenEmu/images/palettes/pal_CGA_16.png
--------------------------------------------------------------------------------
/bin/textScreenEmu/images/palettes/pal_EGA_64.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sirrandalot/TextScreenEmu/2dc254224d4590a87e30698483ddb4c8aead4970/bin/textScreenEmu/images/palettes/pal_EGA_64.png
--------------------------------------------------------------------------------
/bin/textScreenEmu/images/palettes/pal_GAMEBOY_4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sirrandalot/TextScreenEmu/2dc254224d4590a87e30698483ddb4c8aead4970/bin/textScreenEmu/images/palettes/pal_GAMEBOY_4.png
--------------------------------------------------------------------------------
/bin/textScreenEmu/images/palettes/pal_GREY_16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sirrandalot/TextScreenEmu/2dc254224d4590a87e30698483ddb4c8aead4970/bin/textScreenEmu/images/palettes/pal_GREY_16.png
--------------------------------------------------------------------------------
/bin/textScreenEmu/images/palettes/pal_GREY_256.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sirrandalot/TextScreenEmu/2dc254224d4590a87e30698483ddb4c8aead4970/bin/textScreenEmu/images/palettes/pal_GREY_256.png
--------------------------------------------------------------------------------
/bin/textScreenEmu/images/palettes/pal_GREY_32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sirrandalot/TextScreenEmu/2dc254224d4590a87e30698483ddb4c8aead4970/bin/textScreenEmu/images/palettes/pal_GREY_32.png
--------------------------------------------------------------------------------
/bin/textScreenEmu/images/palettes/pal_GREY_4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sirrandalot/TextScreenEmu/2dc254224d4590a87e30698483ddb4c8aead4970/bin/textScreenEmu/images/palettes/pal_GREY_4.png
--------------------------------------------------------------------------------
/bin/textScreenEmu/images/palettes/pal_GREY_8.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sirrandalot/TextScreenEmu/2dc254224d4590a87e30698483ddb4c8aead4970/bin/textScreenEmu/images/palettes/pal_GREY_8.png
--------------------------------------------------------------------------------
/bin/textScreenEmu/images/palettes/pal_MSX_16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sirrandalot/TextScreenEmu/2dc254224d4590a87e30698483ddb4c8aead4970/bin/textScreenEmu/images/palettes/pal_MSX_16.png
--------------------------------------------------------------------------------
/bin/textScreenEmu/images/palettes/pal_NES_64.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sirrandalot/TextScreenEmu/2dc254224d4590a87e30698483ddb4c8aead4970/bin/textScreenEmu/images/palettes/pal_NES_64.png
--------------------------------------------------------------------------------
/bin/textScreenEmu/images/palettes/pal_PHOSPHOR_8.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sirrandalot/TextScreenEmu/2dc254224d4590a87e30698483ddb4c8aead4970/bin/textScreenEmu/images/palettes/pal_PHOSPHOR_8.png
--------------------------------------------------------------------------------
/bin/textScreenEmu/images/palettes/pal_SPECTRUM_16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sirrandalot/TextScreenEmu/2dc254224d4590a87e30698483ddb4c8aead4970/bin/textScreenEmu/images/palettes/pal_SPECTRUM_16.png
--------------------------------------------------------------------------------
/bin/textScreenEmu/images/palettes/pal_VGA_16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sirrandalot/TextScreenEmu/2dc254224d4590a87e30698483ddb4c8aead4970/bin/textScreenEmu/images/palettes/pal_VGA_16.png
--------------------------------------------------------------------------------
/bin/textScreenEmu/images/tilesets/antique_8x16.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sirrandalot/TextScreenEmu/2dc254224d4590a87e30698483ddb4c8aead4970/bin/textScreenEmu/images/tilesets/antique_8x16.bmp
--------------------------------------------------------------------------------
/bin/textScreenEmu/images/tilesets/basic_8x8.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sirrandalot/TextScreenEmu/2dc254224d4590a87e30698483ddb4c8aead4970/bin/textScreenEmu/images/tilesets/basic_8x8.png
--------------------------------------------------------------------------------
/bin/textScreenEmu/images/tilesets/broadway_8x16.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sirrandalot/TextScreenEmu/2dc254224d4590a87e30698483ddb4c8aead4970/bin/textScreenEmu/images/tilesets/broadway_8x16.bmp
--------------------------------------------------------------------------------
/bin/textScreenEmu/images/tilesets/comicsans_16x16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sirrandalot/TextScreenEmu/2dc254224d4590a87e30698483ddb4c8aead4970/bin/textScreenEmu/images/tilesets/comicsans_16x16.png
--------------------------------------------------------------------------------
/bin/textScreenEmu/images/tilesets/courier_8x16.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sirrandalot/TextScreenEmu/2dc254224d4590a87e30698483ddb4c8aead4970/bin/textScreenEmu/images/tilesets/courier_8x16.bmp
--------------------------------------------------------------------------------
/bin/textScreenEmu/images/tilesets/cp437_10x10.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sirrandalot/TextScreenEmu/2dc254224d4590a87e30698483ddb4c8aead4970/bin/textScreenEmu/images/tilesets/cp437_10x10.png
--------------------------------------------------------------------------------
/bin/textScreenEmu/images/tilesets/cp437_12x12.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sirrandalot/TextScreenEmu/2dc254224d4590a87e30698483ddb4c8aead4970/bin/textScreenEmu/images/tilesets/cp437_12x12.png
--------------------------------------------------------------------------------
/bin/textScreenEmu/images/tilesets/cp437_16x16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sirrandalot/TextScreenEmu/2dc254224d4590a87e30698483ddb4c8aead4970/bin/textScreenEmu/images/tilesets/cp437_16x16.png
--------------------------------------------------------------------------------
/bin/textScreenEmu/images/tilesets/cp437_8x8.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sirrandalot/TextScreenEmu/2dc254224d4590a87e30698483ddb4c8aead4970/bin/textScreenEmu/images/tilesets/cp437_8x8.png
--------------------------------------------------------------------------------
/bin/textScreenEmu/images/tilesets/cp437_9x16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sirrandalot/TextScreenEmu/2dc254224d4590a87e30698483ddb4c8aead4970/bin/textScreenEmu/images/tilesets/cp437_9x16.png
--------------------------------------------------------------------------------
/bin/textScreenEmu/images/tilesets/doodle_16x16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sirrandalot/TextScreenEmu/2dc254224d4590a87e30698483ddb4c8aead4970/bin/textScreenEmu/images/tilesets/doodle_16x16.png
--------------------------------------------------------------------------------
/bin/textScreenEmu/images/tilesets/doodle_6x6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sirrandalot/TextScreenEmu/2dc254224d4590a87e30698483ddb4c8aead4970/bin/textScreenEmu/images/tilesets/doodle_6x6.png
--------------------------------------------------------------------------------
/bin/textScreenEmu/images/tilesets/medieval_8x16.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sirrandalot/TextScreenEmu/2dc254224d4590a87e30698483ddb4c8aead4970/bin/textScreenEmu/images/tilesets/medieval_8x16.bmp
--------------------------------------------------------------------------------
/bin/textScreenEmu/images/tilesets/retro_10x10.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sirrandalot/TextScreenEmu/2dc254224d4590a87e30698483ddb4c8aead4970/bin/textScreenEmu/images/tilesets/retro_10x10.png
--------------------------------------------------------------------------------
/bin/textScreenEmu/images/tilesets/sm_16x16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sirrandalot/TextScreenEmu/2dc254224d4590a87e30698483ddb4c8aead4970/bin/textScreenEmu/images/tilesets/sm_16x16.png
--------------------------------------------------------------------------------
/jars/TextScreenEmu_v0.1.0.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sirrandalot/TextScreenEmu/2dc254224d4590a87e30698483ddb4c8aead4970/jars/TextScreenEmu_v0.1.0.jar
--------------------------------------------------------------------------------
/jars/TextScreenEmu_v0.1.1.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sirrandalot/TextScreenEmu/2dc254224d4590a87e30698483ddb4c8aead4970/jars/TextScreenEmu_v0.1.1.jar
--------------------------------------------------------------------------------
/jars/TextScreenEmu_v0.1.2.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sirrandalot/TextScreenEmu/2dc254224d4590a87e30698483ddb4c8aead4970/jars/TextScreenEmu_v0.1.2.jar
--------------------------------------------------------------------------------
/jars/TextScreenEmu_v0.1.3.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sirrandalot/TextScreenEmu/2dc254224d4590a87e30698483ddb4c8aead4970/jars/TextScreenEmu_v0.1.3.jar
--------------------------------------------------------------------------------
/jars/TextScreenEmu_v0.1.4.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sirrandalot/TextScreenEmu/2dc254224d4590a87e30698483ddb4c8aead4970/jars/TextScreenEmu_v0.1.4.jar
--------------------------------------------------------------------------------
/jars/TextScreenEmu_v0.1.5.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sirrandalot/TextScreenEmu/2dc254224d4590a87e30698483ddb4c8aead4970/jars/TextScreenEmu_v0.1.5.jar
--------------------------------------------------------------------------------
/jars/TextScreenEmu_v0.1.6.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sirrandalot/TextScreenEmu/2dc254224d4590a87e30698483ddb4c8aead4970/jars/TextScreenEmu_v0.1.6.jar
--------------------------------------------------------------------------------
/jars/TextScreenEmu_v1.0.0.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sirrandalot/TextScreenEmu/2dc254224d4590a87e30698483ddb4c8aead4970/jars/TextScreenEmu_v1.0.0.jar
--------------------------------------------------------------------------------
/src/TSEmuTest.java:
--------------------------------------------------------------------------------
1 | import java.io.File;
2 | import java.io.IOException;
3 | import java.lang.reflect.Field;
4 |
5 | import javax.imageio.ImageIO;
6 | import javax.swing.JFrame;
7 |
8 | import textScreenEmu.ASCIIname;
9 | import textScreenEmu.Palette;
10 | import textScreenEmu.PaletteFactory;
11 | import textScreenEmu.PalettePredef;
12 | import textScreenEmu.Screen;
13 | import textScreenEmu.TileImage;
14 | import textScreenEmu.TilesetFactory;
15 | import textScreenEmu.TilesetPredef;
16 |
17 | public class TSEmuTest {
18 |
19 | public static void main(String[] args){
20 |
21 | JFrame mainFrame = new JFrame();
22 |
23 | Screen s;
24 |
25 | TilesetPredef tsPredef = TilesetPredef.CODEPAGE437_16x16;
26 | PalettePredef plPredef = PalettePredef.APPLEII_16;
27 |
28 | //Palette pal = PaletteFactory.createPalette(plPredef);
29 |
30 | s = new Screen(16, 16, 2, TilesetFactory.createTileset(tsPredef), PaletteFactory.createPalette(plPredef));
31 | //s = new Screen(8, 1, 1, TilesetFactory.createTileset(1, 1, 2, new int[]{0, 1}), pal);
32 |
33 | mainFrame.add(s);
34 |
35 | mainFrame.setResizable(false);
36 |
37 | mainFrame.pack();
38 |
39 |
40 |
41 | mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
42 |
43 | mainFrame.setVisible(true);
44 |
45 |
46 | s.clearScreen();
47 |
48 | s.setForegroundColour(7);
49 |
50 | s.drawTile(1, 1, 2);
51 | s.drawRandomTile(2, 2, (long)(Math.random()*100000.0));
52 |
53 | s.setBackgroundColour(4);
54 |
55 | s.drawTile(5, 5, ASCIIname.LETTER_i_UMLAUT);
56 | s.drawTile(5, 6, ASCIIname.AMPERSAND);
57 | s.drawTile(5, 7, ASCIIname.ARROW_VERTICAL_LINE);
58 | s.drawTile(5, 8, ASCIIname.LETTER_A_RING);
59 |
60 | s.drawTile(8, 5, ASCIIname.LETTER_i_UMLAUT);
61 | s.drawTile(8, 6, ASCIIname.AMPERSAND);
62 | s.drawTile(8, 7, ASCIIname.ARROW_VERTICAL_LINE);
63 | s.drawTile(8, 8, ASCIIname.LETTER_A_RING);
64 |
65 | s.setColours(6, 9);
66 |
67 | s.drawTile(6, 5, ASCIIname.DIVIDE);
68 | s.drawTile(6, 6, ASCIIname.FRACTION_QUARTER);
69 | s.drawTile(6, 7, ASCIIname.GREEK_PHI_UPPER);
70 | s.drawTile(6, 8, ASCIIname.APPROXIMATION);
71 |
72 |
73 | //s.useSameBackground(true);
74 | s.setBackgroundColour(-1);
75 |
76 | s.drawTile(8, 5, ASCIIname.DIVIDE);
77 |
78 | //s.useSameBackground(false);
79 | s.setBackgroundColour(6);
80 | //s.useSameForeground(true);
81 | s.setForegroundColour(-1);
82 |
83 | s.drawTile(8, 6, ASCIIname.FRACTION_QUARTER);
84 |
85 | //s.useSameBackground(true);
86 | s.setBackgroundColour(-1);
87 |
88 | s.drawTile(8, 7, ASCIIname.GREEK_PHI_UPPER);
89 |
90 | //s.useSameBackground(false);
91 | //s.useSameForeground(false);
92 | s.setColours(6, 9);
93 |
94 | s.drawTile(8, 8, ASCIIname.APPROXIMATION);
95 |
96 | s.setColours(7, 10);
97 |
98 | for(int i = 0; i < 10; i++){
99 | s.drawGarbageTile(10, 3 + i, (long)(Math.random()*100000.0));
100 | }
101 |
102 | s.setColours(8, 11);
103 |
104 | s.drawTile(6, 12, ASCIIname.LETTER_R);
105 | s.setColours(9, 12);
106 | s.drawTile(7, 12, ASCIIname.LETTER_R, true, false);
107 | s.drawTile(6, 13, ASCIIname.LETTER_R, false, true);
108 | s.setColours(8, 11);
109 | s.drawTile(7, 13, ASCIIname.LETTER_R, true, true);
110 |
111 |
112 | TileImage t = new TileImage(2, 2,
113 | new int[]{ASCIIname.AMPERSAND, ASCIIname.LETTER_r, ASCIIname.LINE_U2_L2_D0_R2, ASCIIname.LINE_U0_L2_D2_R0},
114 | new int[][]{new int[]{-1, -1}, new int[]{2, 14}, new int[]{4, 6}, new int[]{5, 6}});
115 |
116 | s.drawTileImage(2, 2, t);
117 | s.drawTileImage(4, 2, t, true, false);
118 | s.drawTileImage(2, 4, t, false, true);
119 | s.drawTileImage(4, 4, t, true, true);
120 |
121 |
122 | //s.drawTileset(false);
123 |
124 | s.drawPalette(false);
125 |
126 |
127 |
128 | // Field[] fields = ASCIIname.class.getDeclaredFields();
129 | //
130 | // int c = 0;
131 | //
132 | // for(Field f : fields){
133 | // System.out.println(c + ". " + f.getName());
134 | //
135 | // c++;
136 | //
137 | // if(c%16 == 0) System.out.println();
138 | // }
139 |
140 | // for(int i = 0; i < 10; i++){
141 | // s.drawRandomTile(i, i, i*((long)(Math.random()*5000)));
142 | // }
143 | //
144 | // s.drawTile(10, 2, '+');
145 | //
146 | //
147 | // s.setForegroundColour(3);
148 | //
149 | // s.drawString(2, 5, "Testing sTrIng!!?? Testing out this new draw string feature man this is pretty cool but I have to keep writing in order to test it properly.", true, true);
150 |
151 |
152 | s.repaint();
153 |
154 | // try {
155 | // Thread.sleep(1000);
156 | // } catch (InterruptedException e1) {
157 | // e1.printStackTrace();
158 | // }
159 | //
160 | // File outputfile = new File("Tileset_" + tsPredef.toString() + ".png");
161 | // try {
162 | // ImageIO.write(s.BIScaled, "png", outputfile);
163 | // } catch (IOException e) {
164 | // e.printStackTrace();
165 | // }
166 |
167 |
168 | }
169 | }
170 |
--------------------------------------------------------------------------------
/src/textScreenEmu/ASCIIname.java:
--------------------------------------------------------------------------------
1 | package textScreenEmu;
2 |
3 | /**
4 | * Static class of ascii integer values by name from 0 to 255
5 | * @author sirrandalot
6 | *
7 | */
8 | public final class ASCIIname {
9 | public static final int NULL = 0;
10 | public static final int FACE_BACKGROUND = 1;
11 | public static final int FACE_FOREGROUND = 2;
12 | public static final int SUIT_HEART = 3;
13 | public static final int SUIT_DIAMOND = 4;
14 | public static final int SUIT_CLUB = 5;
15 | public static final int SUIT_SPADE = 6;
16 | public static final int BULLET_FOREGROUND = 7;
17 | public static final int BULLET_BACKGROUND = 8;
18 | public static final int BULLET2_FOREGROUND = 9;
19 | public static final int BULLET2_BACKGROUND = 10;
20 | public static final int GLYPH_MARS = 11;
21 | public static final int GLYPH_VENUS = 12;
22 | public static final int NOTE_SINGLE = 13;
23 | public static final int NOTE_DOUBLE = 14;
24 | public static final int SUN = 15;
25 |
26 | public static final int TRIANGLE_RIGHT = 16;
27 | public static final int TRIANGLE_LEFT = 17;
28 | public static final int ARROW_VERTICAL_DOUBLE = 18;
29 | public static final int EXCLAMATION_DOUBLE = 19;
30 | public static final int PARAGRAPH = 20;
31 | public static final int SECTION = 21;
32 | public static final int INSERT = 22;
33 | public static final int ARROW_VERTICAL_LINE = 23;
34 | public static final int ARROW_UP = 24;
35 | public static final int ARROW_DOWN = 25;
36 | public static final int ARROW_RIGHT = 26;
37 | public static final int ARROW_LEFT = 27;
38 | public static final int RIGHTANGLE = 28;
39 | public static final int ARROW_HORIZONTAL_DOUBLE = 29;
40 | public static final int TRIANGLE_UP = 30;
41 | public static final int TRIANGLE_DOWN = 31;
42 |
43 | public static final int SPACE = 32;
44 | public static final int EXCLAMATION = 33;
45 | public static final int QUOTATION = 34;
46 | public static final int POUND = 35;
47 | public static final int MONEY_DOLLAR = 36;
48 | public static final int PERCENT = 37;
49 | public static final int AMPERSAND = 38;
50 | public static final int APOSTROPHE = 39;
51 | public static final int PARENTHESES_LEFT = 40;
52 | public static final int PARENTHESES_RIGHT = 41;
53 | public static final int ASTERISK = 42;
54 | public static final int PLUS = 43;
55 | public static final int COMMA = 44;
56 | public static final int HYPHEN = 45;
57 | public static final int DOT = 46;
58 | public static final int SLASH = 47;
59 |
60 | public static final int NUMBER_0 = 48;
61 | public static final int NUMBER_1 = 49;
62 | public static final int NUMBER_2 = 50;
63 | public static final int NUMBER_3 = 51;
64 | public static final int NUMBER_4 = 52;
65 | public static final int NUMBER_5 = 53;
66 | public static final int NUMBER_6 = 54;
67 | public static final int NUMBER_7 = 55;
68 | public static final int NUMBER_8 = 56;
69 | public static final int NUMBER_9 = 57;
70 | public static final int COLON = 58;
71 | public static final int SEMICOLON = 59;
72 | public static final int LESSTHAN = 60;
73 | public static final int EQUALS = 61;
74 | public static final int GREATERTHAN = 62;
75 | public static final int QUESTION = 63;
76 |
77 | public static final int AT = 64;
78 | public static final int LETTER_A = 65;
79 | public static final int LETTER_B = 66;
80 | public static final int LETTER_C = 67;
81 | public static final int LETTER_D = 68;
82 | public static final int LETTER_E = 69;
83 | public static final int LETTER_F = 70;
84 | public static final int LETTER_G = 71;
85 | public static final int LETTER_H = 72;
86 | public static final int LETTER_I = 73;
87 | public static final int LETTER_J = 74;
88 | public static final int LETTER_K = 75;
89 | public static final int LETTER_L = 76;
90 | public static final int LETTER_M = 77;
91 | public static final int LETTER_N = 78;
92 | public static final int LETTER_O = 79;
93 |
94 | public static final int LETTER_P = 80;
95 | public static final int LETTER_Q = 81;
96 | public static final int LETTER_R = 82;
97 | public static final int LETTER_S = 83;
98 | public static final int LETTER_T = 84;
99 | public static final int LETTER_U = 85;
100 | public static final int LETTER_V = 86;
101 | public static final int LETTER_W = 87;
102 | public static final int LETTER_X = 88;
103 | public static final int LETTER_Y = 89;
104 | public static final int LETTER_Z = 90;
105 | public static final int BRACKET_LEFT = 91;
106 | public static final int BACKSLASH = 92;
107 | public static final int BRACKET_RIGHT = 93;
108 | public static final int CIRCUMFLEX = 94;
109 | public static final int UNDERSCORE = 95;
110 |
111 | public static final int GRAVE = 96;
112 | public static final int LETTER_a = 97;
113 | public static final int LETTER_b = 98;
114 | public static final int LETTER_c = 99;
115 | public static final int LETTER_d = 100;
116 | public static final int LETTER_e = 101;
117 | public static final int LETTER_f = 102;
118 | public static final int LETTER_g = 103;
119 | public static final int LETTER_h = 104;
120 | public static final int LETTER_i = 105;
121 | public static final int LETTER_j = 106;
122 | public static final int LETTER_k = 107;
123 | public static final int LETTER_l = 108;
124 | public static final int LETTER_m = 109;
125 | public static final int LETTER_n = 110;
126 | public static final int LETTER_o = 111;
127 |
128 | public static final int LETTER_p = 112;
129 | public static final int LETTER_q = 113;
130 | public static final int LETTER_r = 114;
131 | public static final int LETTER_s = 115;
132 | public static final int LETTER_t = 116;
133 | public static final int LETTER_u = 117;
134 | public static final int LETTER_v = 118;
135 | public static final int LETTER_w = 119;
136 | public static final int LETTER_x = 120;
137 | public static final int LETTER_y = 121;
138 | public static final int LETTER_z = 122;
139 | public static final int BRACE_LEFT = 123;
140 | public static final int BAR = 124;
141 | public static final int BRACE_RIGHT = 125;
142 | public static final int TILDE = 126;
143 | public static final int HOUSE = 127;
144 |
145 | public static final int LETTER_C_CEDILLA = 18;
146 | public static final int LETTER_u_UMLAUT = 129;
147 | public static final int LETTER_e_ACUTE = 130;
148 | public static final int LETTER_a_CIRCUMFLEX = 131;
149 | public static final int LETTER_a_UMLAUT = 132;
150 | public static final int LETTER_a_GRAVE = 133;
151 | public static final int LETTER_a_RING = 134;
152 | public static final int LETTER_c_CEDILLA = 135;
153 | public static final int LETTER_e_CIRCUMFLEX = 136;
154 | public static final int LETTER_e_UMLAUT = 137;
155 | public static final int LETTER_e_GRAVE = 138;
156 | public static final int LETTER_i_UMLAUT = 139;
157 | public static final int LETTER_i_CIRCUMFLEX = 140;
158 | public static final int LETTER_i_GRAVE = 141;
159 | public static final int LETTER_A_UMLAUT = 142;
160 | public static final int LETTER_A_RING = 143;
161 |
162 | public static final int LETTER_E_ACUTE = 144;
163 | public static final int LETTER_ASH_LOWER = 145;
164 | public static final int LETTER_ASH_UPPER = 146;
165 | public static final int LETTER_o_CIRCUMFLEX = 147;
166 | public static final int LETTER_o_UMLAUT = 148;
167 | public static final int LETTER_o_GRAVE = 149;
168 | public static final int LETTER_u_CIRCUMFLEX = 150;
169 | public static final int LETTER_u_GRAVE = 151;
170 | public static final int LETTER_y_UMLAUT = 152;
171 | public static final int LETTER_O_UMLAUT = 153;
172 | public static final int LETTER_U_UMLAUT = 154;
173 | public static final int MONEY_CENT = 155;
174 | public static final int MONEY_POUND = 156;
175 | public static final int MONEY_YEN = 157;
176 | public static final int MONEY_PESETA = 158;
177 | public static final int f_HOOK = 159;
178 |
179 | public static final int LETTER_a_ACUTE = 160;
180 | public static final int LETTER_i_ACUTE = 161;
181 | public static final int LETTER_o_ACUTE = 162;
182 | public static final int LETTER_u_ACUTE = 163;
183 | public static final int LETTER_n_TILDE = 164;
184 | public static final int LETTER_N_TILDE = 165;
185 | public static final int ORDINAL_a = 166;
186 | public static final int ORDINAL_o = 167;
187 | public static final int QUESTION_INVERTED = 168;
188 | public static final int NEGATION_LEFT = 169;
189 | public static final int NEGATION_RIGHT = 170;
190 | public static final int FRACTION_HALF = 171;
191 | public static final int FRACTION_QUARTER = 172;
192 | public static final int EXCLAMATION_INVERTED = 173;
193 | public static final int GUILLEMET_LEFT = 174;
194 | public static final int GUILLEMET_RIGHT = 175;
195 |
196 | public static final int BLOCK_SHADE_LIGHT = 176;
197 | public static final int BLOCK_SHADE_MEDIUM = 177;
198 | public static final int BLOCK_SHADE_DARK = 178;
199 | public static final int LINE_U1_L0_D1_R0 = 179;
200 | public static final int LINE_U1_L1_D1_R0 = 180;
201 | public static final int LINE_U1_L2_D1_R0 = 181;
202 | public static final int LINE_U2_L1_D2_R0 = 182;
203 | public static final int LINE_U0_L1_D2_R0 = 183;
204 | public static final int LINE_U0_L2_D1_R0 = 184;
205 | public static final int LINE_U2_L2_D2_R0 = 185;
206 | public static final int LINE_U2_L0_D2_R0 = 186;
207 | public static final int LINE_U0_L2_D2_R0 = 187;
208 | public static final int LINE_U2_L2_D0_R0 = 188;
209 | public static final int LINE_U2_L1_D0_R0 = 189;
210 | public static final int LINE_U1_L2_D0_R0 = 190;
211 | public static final int LINE_U0_L1_D1_R0 = 191;
212 |
213 | public static final int LINE_U1_L0_D0_R1 = 192;
214 | public static final int LINE_U1_L1_D0_R1 = 193;
215 | public static final int LINE_U0_L1_D1_R1 = 194;
216 | public static final int LINE_U1_L0_D1_R1 = 195;
217 | public static final int LINE_U0_L1_D0_R1 = 196;
218 | public static final int LINE_U1_L1_D1_R1 = 197;
219 | public static final int LINE_U1_L0_D1_R2 = 198;
220 | public static final int LINE_U2_L0_D2_R1 = 199;
221 | public static final int LINE_U2_L0_D0_R2 = 200;
222 | public static final int LINE_U0_L0_D2_R2 = 201;
223 | public static final int LINE_U2_L2_D0_R2 = 202;
224 | public static final int LINE_U0_L2_D2_R2 = 203;
225 | public static final int LINE_U2_L0_D2_R2 = 204;
226 | public static final int LINE_U0_L2_D0_R2 = 205;
227 | public static final int LINE_U2_L2_D2_R2 = 206;
228 | public static final int LINE_U1_L2_D0_R2 = 207;
229 |
230 | public static final int LINE_U2_L1_D0_R1 = 208;
231 | public static final int LINE_U0_L2_D1_R2 = 209;
232 | public static final int LINE_U0_L1_D2_R1 = 210;
233 | public static final int LINE_U2_L0_D0_R1 = 211;
234 | public static final int LINE_U1_L0_D0_R2 = 212;
235 | public static final int LINE_U0_L0_D1_R2 = 213;
236 | public static final int LINE_U0_L0_D2_R1 = 214;
237 | public static final int LINE_U2_L1_D2_R1 = 215;
238 | public static final int LINE_U1_L2_D1_R2 = 216;
239 | public static final int LINE_U1_L1_D0_R0 = 217;
240 | public static final int LINE_U0_L0_D1_R1 = 218;
241 | public static final int BLOCK_FULL = 219;
242 | public static final int BLOCK_BOTTOM = 220;
243 | public static final int BLOCK_LEFT = 221;
244 | public static final int BLOCK_RIGHT = 222;
245 | public static final int BLOCK_TOP = 223;
246 |
247 | public static final int GREEK_ALPHA = 224;
248 | public static final int GREEK_BETA = 225;
249 | public static final int GREEK_GAMMA = 226;
250 | public static final int GREEK_PI = 227;
251 | public static final int GREEK_SIGMA_UPPER = 228;
252 | public static final int GREEK_SIGMA_LOWER = 229;
253 | public static final int GREEK_MU = 230;
254 | public static final int GREEK_TAU = 231;
255 | public static final int GREEK_PHI_UPPER = 232;
256 | public static final int GREEK_THETA = 233;
257 | public static final int GREEK_OMEGA = 234;
258 | public static final int GREEK_DELTA = 235;
259 | public static final int INFINITY = 236;
260 | public static final int GREEK_PHI_LOWER = 237;
261 | public static final int GREEK_EPSILON = 238;
262 | public static final int INTERSECTION = 239;
263 |
264 | public static final int IDENTICAL = 240;
265 | public static final int PLUS_MINUS = 241;
266 | public static final int GREATERTHAN_EQUALTO = 242;
267 | public static final int LESSTHAN_EQUALTO = 243;
268 | public static final int INTEGRAL_TOP = 244;
269 | public static final int INTEGRAL_BOTTOM = 245;
270 | public static final int DIVIDE = 246;
271 | public static final int APPROXIMATION = 247;
272 | public static final int DEGREE = 248;
273 | public static final int BULLET = 249;
274 | public static final int INTERPUNCT = 250;
275 | public static final int SQUAREROOT = 251;
276 | public static final int SUPER_n = 252;
277 | public static final int SUPER_2 = 253;
278 | public static final int BLACKSQUARE = 254;
279 | public static final int NBSP = 255;
280 |
281 | }
282 |
--------------------------------------------------------------------------------
/src/textScreenEmu/Palette.java:
--------------------------------------------------------------------------------
1 | package textScreenEmu;
2 |
3 | /**
4 | * Class representing a colour palette, with colours represented as integers following the scheme 0x__RRGGBB.
5 | * @author sirrandalot
6 | *
7 | */
8 | public class Palette {
9 |
10 | /**
11 | * The colour values in this palette.
12 | */
13 | protected int[] colours;
14 |
15 |
16 | /**
17 | * Constructor for Palette using an array of ints.
18 | * @param cols The integer colour values.
19 | */
20 | protected Palette(int[] cols){
21 |
22 | try{
23 |
24 | if(cols.length > 256)
25 | throw new Exception("Array length " + cols.length + " out of range, must be between 0 and 256 inclusively.");
26 |
27 | colours = cols.clone();
28 |
29 | }catch(Exception e){
30 | System.out.println("ERROR: " + e);
31 | e.printStackTrace();
32 | }
33 |
34 | }
35 |
36 |
37 | /**
38 | * Gets the number of colours in this palette.
39 | * @return The number of colours in this palette.
40 | */
41 | public int getNumColours(){
42 | return colours.length;
43 | }
44 |
45 |
46 | /**
47 | * Gets the colour at a specified index.
48 | * @param index The index.
49 | * @return The colour at the specified index.
50 | */
51 | public int getColourAt(int index){
52 | try{
53 |
54 | if(index < 0 || index > colours.length)
55 | throw new Exception("Index " + index + " out of range, must be between 0 and colours array length.");
56 |
57 | return colours[index];
58 |
59 | }catch(Exception e){
60 | System.out.println("ERROR: " + e);
61 | e.printStackTrace();
62 |
63 | return Integer.parseInt("00000000", 16);
64 | }
65 |
66 | }
67 |
68 |
69 | /**
70 | * Sets the colour at the specified index.
71 | * @param index The index.
72 | * @param colour The colour to set.
73 | */
74 | public void setColourAt(int index, int colour){
75 | try{
76 |
77 | if(index < 0 || index > colours.length)
78 | throw new Exception("Index " + index + " out of range, must be between 0 and colours array length.");
79 |
80 | colours[index] = colour;
81 |
82 | }catch(Exception e){
83 | System.out.println("ERROR: " + e);
84 | e.printStackTrace();
85 | }
86 | }
87 |
88 |
89 | /**
90 | * Adds a given integer colour onto the end of the palette.
91 | * @param colour The colour to add.
92 | */
93 | public void addColour(int colour){
94 |
95 | try{
96 |
97 | if(colours.length == 256)
98 | throw new Exception("Colour array full (256 colours), cannot add any more.");
99 |
100 | int[] newColours = new int[colours.length + 1];
101 |
102 | for(int i = 0; i < colours.length; i++)
103 | newColours[i] = colours[i];
104 |
105 | newColours[newColours.length-1] = colour;
106 |
107 | colours = newColours;
108 |
109 | }catch(Exception e){
110 | System.out.println("ERROR: " + e);
111 | e.printStackTrace();
112 | }
113 |
114 | }
115 |
116 | }
117 |
--------------------------------------------------------------------------------
/src/textScreenEmu/PaletteFactory.java:
--------------------------------------------------------------------------------
1 | package textScreenEmu;
2 |
3 | import java.awt.image.BufferedImage;
4 |
5 | import javax.imageio.ImageIO;
6 |
7 | /**
8 | * Class for creating Palettes.
9 | * @author sirrandalot
10 | *
11 | */
12 | public class PaletteFactory {
13 |
14 | /**
15 | * Creates a Palette using an integer array of colours.
16 | * @param colours The colour array.
17 | * @return A Palette using the colours provided.
18 | */
19 | public static Palette createPalette(int[] colours){
20 |
21 | try{
22 |
23 | if(colours.length < 2)
24 | throw new Exception("Palette must contain at least 2 colours.");
25 |
26 | return new Palette(colours);
27 |
28 | }catch(Exception e){
29 | System.out.println("ERROR: " + e);
30 | e.printStackTrace();
31 | }
32 |
33 | return null;
34 | }
35 |
36 |
37 | /**
38 | * Creates a pre-defined Palette.
39 | * @param p The PalettePredef enum value.
40 | * @return A Palette based on the value given.
41 | */
42 | public static Palette createPalette(PalettePredef p){
43 |
44 | switch(p){
45 | case BLACK_AND_WHITE:
46 | return getPaletteFromFile("pal_BLACK_AND_WHITE.png", 2);
47 | case GREY_4:
48 | return getPaletteFromFile("pal_GREY_4.png", 4);
49 | case GREY_8:
50 | return getPaletteFromFile("pal_GREY_8.png", 8);
51 | case GREY_16:
52 | return getPaletteFromFile("pal_GREY_16.png", 16);
53 | case GREY_32:
54 | return getPaletteFromFile("pal_GREY_32.png", 32);
55 | case GREY_256:
56 | return getPaletteFromFile("pal_GREY_256.png", 256);
57 | case VGA_16:
58 | return getPaletteFromFile("pal_VGA_16.png", 16);
59 | case EGA_64:
60 | return getPaletteFromFile("pal_EGA_64.png", 64);
61 | case C64_16:
62 | return getPaletteFromFile("pal_C64_16.png", 16);
63 | case APPLEII_16:
64 | return getPaletteFromFile("pal_APPLEII_16.png", 16);
65 | case SPECTRUM_16:
66 | return getPaletteFromFile("pal_SPECTRUM_16.png", 16);
67 | case CGA_16:
68 | return getPaletteFromFile("pal_CGA_16.png", 16);
69 | case MSX_16:
70 | return getPaletteFromFile("pal_MSX_16.png", 16);
71 | case C16_128:
72 | return getPaletteFromFile("pal_C16_128.png", 128);
73 | case GAMEBOY_4:
74 | return getPaletteFromFile("pal_GAMEBOY_4.png", 4);
75 | case NES_64:
76 | return getPaletteFromFile("pal_NES_64.png", 64);
77 | case PHOSPHOR_8:
78 | return getPaletteFromFile("pal_PHOSPHOR_8.png", 8);
79 | default:
80 | System.out.println("Enum value not recognized, returning black and white palette...");
81 | return getPaletteFromFile("pal_BLACK_AND_WHITE.png", 2);
82 |
83 | }
84 | }
85 |
86 |
87 |
88 | /**
89 | * Creates a Palette using an image saved inside the image package.
90 | * @param name The name of the image file.
91 | * @param numColours The number of colours to use.
92 | * @return A Palette based off of an image file in the image package.
93 | */
94 | private static Palette getPaletteFromFile(String name, int numColours){
95 | BufferedImage img = null;
96 |
97 | try{
98 |
99 | img = ImageIO.read(PaletteFactory.class.getResource("/textScreenEmu/images/palettes/" + name));
100 |
101 | return getPaletteFromImage(img, numColours);
102 |
103 | }catch(Exception e){
104 | e.printStackTrace();
105 | }
106 |
107 | //If all fails return black and white
108 | return new Palette(new int[]{Integer.parseUnsignedInt("00000000", 16), Integer.parseUnsignedInt("00FFFFFF", 16)});
109 | }
110 |
111 |
112 | /**
113 | * Creates a palette from a BufferedImage, each pixel represents one colour to use,
114 | * limited (if applicable) by the number of colours wanted.
115 | * @param img The BufferedImage to use.
116 | * @param numColours The number of colours to use.
117 | * @return A Palette based off of a BufferedImage.
118 | */
119 | public static Palette getPaletteFromImage(BufferedImage img, int numColours){
120 |
121 | try{
122 | //Check if the parameters are appropriate
123 | if(numColours < 2 || numColours > 256 || numColours > img.getWidth()*img.getHeight())
124 | throw new Exception("Number of colours " + numColours + " out of range, must be between 2 and " + Integer.min(256, img.getWidth()*img.getHeight()) + " inclusively.");
125 |
126 | //Create an array
127 | int[] vals = new int[numColours];
128 |
129 | int x = 0;
130 | int y = 0;
131 |
132 | //Get the colours from each pixel
133 | for(int c = 0; c < numColours; c++){
134 |
135 | vals[c] = img.getRGB(x, y);
136 |
137 | x++;
138 |
139 | if(x >= img.getWidth()){
140 | x = 0;
141 | y++;
142 | }
143 | }
144 |
145 | return new Palette(vals);
146 |
147 |
148 | }catch(Exception e){
149 | System.out.println("ERROR: " + e);
150 | e.printStackTrace();
151 | }
152 |
153 | //If all fails return black and white
154 | return new Palette(new int[]{Integer.parseUnsignedInt("00000000", 16), Integer.parseUnsignedInt("00FFFFFF", 16)});
155 |
156 | }
157 |
158 | }
159 |
--------------------------------------------------------------------------------
/src/textScreenEmu/PalettePredef.java:
--------------------------------------------------------------------------------
1 | package textScreenEmu;
2 |
3 | /**
4 | * Enum of pre-defined palettes.
5 | * @author sirrandalot
6 | *
7 | */
8 | public enum PalettePredef {
9 | BLACK_AND_WHITE,
10 | GREY_4,
11 | GREY_8,
12 | GREY_16,
13 | GREY_32,
14 | GREY_256,
15 | VGA_16,
16 | EGA_64,
17 | C64_16,
18 | APPLEII_16,
19 | SPECTRUM_16,
20 | CGA_16,
21 | MSX_16,
22 | C16_128,
23 | GAMEBOY_4,
24 | NES_64,
25 | PHOSPHOR_8
26 | }
27 |
--------------------------------------------------------------------------------
/src/textScreenEmu/Screen.java:
--------------------------------------------------------------------------------
1 | package textScreenEmu;
2 |
3 | import java.awt.Dimension;
4 | import java.awt.Graphics;
5 | import java.awt.Graphics2D;
6 | import java.awt.RenderingHints;
7 | import java.awt.image.BufferedImage;
8 | import java.util.Random;
9 |
10 | import javax.swing.JPanel;
11 |
12 | /**
13 | * Class which emulates a screen by extending a JPanel and drawing to a scaled BufferedImage.
14 | * @author sirrandalot
15 | *
16 | */
17 | public class Screen extends JPanel{
18 |
19 | /**
20 | * Default serial UID, needed becuase JPanel implements Serializable.
21 | * Not really necessary but gets rid of compiler warning.
22 | */
23 | private static final long serialVersionUID = 1L;
24 |
25 | /**
26 | * The image to which everything will be drawn.
27 | */
28 | private BufferedImage BI;
29 |
30 | /**
31 | * The image which will be drawn to the panel.
32 | */
33 | private BufferedImage BIScaled;
34 |
35 | /**
36 | * How much to scale the base image.
37 | */
38 | public final int imageScale;
39 |
40 | /**
41 | * The horizontal number of tiles in the screen.
42 | */
43 | public final int numTilesX;
44 |
45 | /**
46 | * The vertical number of tiles in the screen.
47 | */
48 | public final int numTilesY;
49 |
50 | /**
51 | * The indices representing the background and foreground colours.
52 | */
53 | private int[] colourIndices = {0, 1};
54 |
55 | /**
56 | * the Tileset to use.
57 | */
58 | public Tileset tileset;
59 |
60 | /**
61 | * The colour palette to use.
62 | */
63 | public Palette palette;
64 |
65 | /**
66 | * Whether or not to draw using the background colour that was most
67 | * recently drawn at a given position.
68 | */
69 | private boolean[] useSameColour = {false, false};
70 |
71 | /**
72 | * Hold the most recently used values for foreground and background colours.
73 | */
74 | private int[][] tileColours;
75 |
76 |
77 | /**
78 | * Constructor for Screen.
79 | * @param numTx The horizontal number of tiles.
80 | * @param numTy The vertical number of tiles.
81 | * @param scale The scale of the screen.
82 | * @param t The Tileset to use.
83 | * @param p The Palette to use.
84 | */
85 | public Screen(int numTx, int numTy, int scale, Tileset t, Palette p){
86 |
87 | int nx = numTx;
88 | int ny = numTy;
89 | int s = scale;
90 |
91 | try{
92 |
93 | if(numTx < 1 || numTx > 256)
94 | throw new Exception("Number of tiles X " + numTx + " out of range, must be between 1 and 256 inclusively.");
95 |
96 | if(numTy < 1 || numTy > 256)
97 | throw new Exception("Number of tiles Y " + numTy + " out of range, must be between 1 and 256 inclusively.");
98 |
99 | if(scale < 1 || scale > 16)
100 | throw new Exception("Image scale " + scale + " out of range, must be between 1 and 16 inclusively.");
101 |
102 |
103 | }catch(Exception e){
104 | System.out.println("ERROR: " + e);
105 | e.printStackTrace();
106 |
107 | nx = 16;
108 | ny = 16;
109 | s = 2;
110 | }
111 |
112 | numTilesX = nx;
113 | numTilesY = ny;
114 | imageScale = s;
115 |
116 | tileset = t;
117 | palette = p;
118 |
119 | BI = new BufferedImage(numTilesX*tileset.tileWidth, numTilesY*tileset.tileHeight, BufferedImage.TYPE_INT_RGB);
120 | BIScaled = new BufferedImage(numTilesX*tileset.tileWidth*imageScale, numTilesY*tileset.tileHeight*imageScale, BufferedImage.TYPE_INT_RGB);
121 |
122 | this.setPreferredSize(new Dimension(numTilesX*tileset.tileWidth*imageScale, numTilesY*tileset.tileHeight*imageScale));
123 |
124 | tileColours = new int[numTilesX*numTilesY][2];
125 |
126 | clearScreen();
127 | }
128 |
129 |
130 | /**
131 | * Colours the entire screen with the current background colour.
132 | */
133 | public void clearScreen(){
134 |
135 | //Set all pixels to background colour
136 | for(int i = 0; i < BI.getWidth(); i++){
137 | for(int j = 0; j < BI.getHeight(); j++){
138 | BI.setRGB(i, j, palette.colours[colourIndices[0]]);
139 | }
140 | }
141 |
142 | for(int i = 0; i < tileColours.length; i++){
143 | tileColours[i][0] = colourIndices[0];
144 | tileColours[i][1] = colourIndices[1];
145 | }
146 | }
147 |
148 |
149 | /**
150 | * Sets the foreground colour.
151 | * @param index The new colour index.
152 | * @return True if the colour was set successfully, false otherwise.
153 | */
154 | public boolean setForegroundColour(int index){
155 | if(index >= 0 && index < palette.getNumColours()){
156 | colourIndices[1] = index;
157 | useSameColour[1] = false;
158 | return true;
159 | }
160 |
161 | if(index == -1){
162 | useSameColour[1] = true;
163 | return true;
164 | }
165 |
166 | return false;
167 | }
168 |
169 |
170 | /**
171 | * Sets the background colour, -1 for "transparent".
172 | * @param index The new colour index.
173 | * @return True if the colour was set successfully, false otherwise.
174 | */
175 | public boolean setBackgroundColour(int index){
176 | if(index >= 0 && index < palette.getNumColours()){
177 | colourIndices[0] = index;
178 | useSameColour[0] = false;
179 | return true;
180 | }
181 |
182 | if(index == -1){
183 | useSameColour[0] = true;
184 | return true;
185 | }
186 |
187 | return false;
188 | }
189 |
190 |
191 | /**
192 | * Sets whether or not to use the most recently used background colour for a tile position
193 | * when drawing a tile.
194 | * @param use Whether or not to use the previous background colour of a tile.
195 | */
196 | public void useSameBackground(boolean use){
197 | useSameColour[0] = use;
198 | }
199 |
200 |
201 | /**
202 | * Sets whether or not to use the most recently used foreground colour for a tile position
203 | * when drawing a tile.
204 | * @param use Whether or not to use the previous foreground colour of a tile.
205 | */
206 | public void useSameForeground(boolean use){
207 | useSameColour[1] = use;
208 | }
209 |
210 |
211 | /**
212 | * Sets both the foreground and background colour.
213 | * @param indexBackground The new background colour index.
214 | * @param indexForeground The new foreground colour index.
215 | * @return True if the colour was set successfully, false otherwise (for both background and foreground).
216 | */
217 | public boolean[] setColours(int indexBackground, int indexForeground){
218 | return new boolean[]{setBackgroundColour(indexBackground), setForegroundColour(indexForeground)};
219 | }
220 |
221 |
222 | /**
223 | * Draws a specified tile at a tile position.
224 | * @param x The x position.
225 | * @param y The y position.
226 | * @param tile The index of the tile to draw.
227 | * @return True if the tile was drawn, false if it was out of bounds.
228 | */
229 | public boolean drawTile(int x, int y, int tile){
230 | return drawTile(x, y, tile, false, false);
231 | }
232 |
233 |
234 | /**
235 | * Draws a specified tile (flipped either horizontally, vertically or both) at a tile position.
236 | * @param x The x position.
237 | * @param y The y position.
238 | * @param tile The index of the tile to draw.
239 | * @param flipX Whether or not to flip the tile horizontally.
240 | * @param flipY Whether or not to flip the tile vertically.
241 | * @return True if the tile was drawn, false if it was out of bounds.
242 | */
243 | public boolean drawTile(int x, int y, int tile, boolean flipX, boolean flipY){
244 | if(x < 0 || x > numTilesX-1 || y < 0 || y > numTilesY-1 || tile < 0 || tile > tileset.numTiles-1){
245 | return false;
246 | }
247 |
248 | int[] tempCol = {colourIndices[0], colourIndices[1]};
249 |
250 | //Use the most recent colours of this tile if we're supposed to
251 | for(int t = 0; t < 2; t++)
252 | if(useSameColour[t])
253 | colourIndices[t] = tileColours[y*numTilesX + x][t];
254 |
255 |
256 |
257 | int offset = tile*tileset.tileWidth*tileset.tileHeight;
258 |
259 | int offX = x*tileset.tileWidth;
260 | int offY = y*tileset.tileHeight;
261 |
262 | int dx = 1;
263 | int sx = 0;
264 | int ex = tileset.tileWidth;
265 | if(flipX){
266 | dx = -1;
267 | sx = tileset.tileWidth-1;
268 | ex = -1;
269 | }
270 |
271 | int dy = 1;
272 | int sy = 0;
273 | int ey = tileset.tileHeight;
274 | if(flipY){
275 | dy = -1;
276 | sy = tileset.tileHeight-1;
277 | ey = -1;
278 | }
279 |
280 | int c = 0;
281 |
282 | for(int j = sy; j != ey; j += dy){
283 | for(int i = sx; i != ex; i += dx){
284 | BI.setRGB(offX + i, offY + j, palette.colours[colourIndices[tileset.values[offset+c]]]);
285 | c++;
286 | }
287 | }
288 |
289 | //Keep track of what colours were used to draw this tile
290 | tileColours[y*numTilesX + x][0] = colourIndices[0];
291 | tileColours[y*numTilesX + x][1] = colourIndices[1];
292 |
293 | for(int t = 0; t < 2; t++)
294 | if(useSameColour[t])
295 | colourIndices[t] = tempCol[t];
296 |
297 |
298 | return true;
299 | }
300 |
301 |
302 | /**
303 | * Draws a (seeded) random tile at a tile position.
304 | * @param x The x position.
305 | * @param y The y position.
306 | * @param seed The seed for the random tile number.
307 | * @return True if the tile was draw, false if it was out of bounds.
308 | */
309 | public boolean drawRandomTile(int x, int y, long seed){
310 | Random r = new Random(seed);
311 |
312 | return drawTile(x, y, r.nextInt(tileset.numTiles));
313 | }
314 |
315 |
316 | /**
317 | * Draws a (seeded) garbage tile at a tile position by randomly mixing
318 | * several tiles together.
319 | * @param x The x position.
320 | * @param y The y position.
321 | * @param seed The seed for the randomness.
322 | * @return True if the tile was draw, false if it was out of bounds.
323 | */
324 | public boolean drawGarbageTile(int x, int y, long seed){
325 |
326 | if(x < 0 || x > numTilesX-1 || y < 0 || y > numTilesY-1){
327 | return false;
328 | }
329 |
330 | Random r = new Random(seed);
331 |
332 | int[] tileNums = new int[]{
333 | r.nextInt(tileset.numTiles),
334 | r.nextInt(tileset.numTiles),
335 | r.nextInt(tileset.numTiles),
336 | r.nextInt(tileset.numTiles)
337 | };
338 |
339 | int xRand = r.nextInt(3);
340 | int yRand = r.nextInt(3);
341 |
342 | int xSplit = (int)Math.floor(tileset.tileWidth*(0.25*(1+xRand)));
343 | int ySplit = (int)Math.floor(tileset.tileHeight*(0.25*(1+yRand)));
344 |
345 |
346 | int[] tempCol = {colourIndices[0], colourIndices[1]};
347 |
348 | //Use the most recent colours of this tile if we're supposed to
349 | for(int t = 0; t < 2; t++)
350 | if(useSameColour[t])
351 | colourIndices[t] = tileColours[y*numTilesX + x][t];
352 |
353 |
354 | int offset = 0;
355 | int tile = 0;
356 |
357 | int offX = x*tileset.tileWidth;
358 | int offY = y*tileset.tileHeight;
359 |
360 | int c = 0;
361 |
362 | for(int j = 0; j < tileset.tileHeight; j++){
363 | for(int i = 0; i < tileset.tileWidth; i++){
364 |
365 | if(i < xSplit && j < ySplit){
366 | tile = tileNums[0];
367 | }else if(i < xSplit && j >= ySplit){
368 | tile = tileNums[1];
369 | }else if(i >= xSplit && j < ySplit){
370 | tile = tileNums[2];
371 | }else{
372 | tile = tileNums[3];
373 | }
374 |
375 | offset = tile*tileset.tileWidth*tileset.tileHeight;
376 |
377 | BI.setRGB(offX + i, offY + j, palette.colours[colourIndices[tileset.values[offset+c]]]);
378 | c++;
379 | }
380 | }
381 |
382 | //Keep track of what colours were used to draw this tile
383 | tileColours[y*numTilesX + x][0] = colourIndices[0];
384 | tileColours[y*numTilesX + x][1] = colourIndices[1];
385 |
386 | for(int t = 0; t < 2; t++)
387 | if(useSameColour[t])
388 | colourIndices[t] = tempCol[t];
389 |
390 |
391 | return true;
392 | }
393 |
394 |
395 | /**
396 | * Draws a String to the screen starting at a given position, assuming the tileset uses typical ASCII values.
397 | * @param x The starting x position.
398 | * @param y The starting y position.
399 | * @param s The string to draw.
400 | * @param wrapX If true, wraps the string horizontally.
401 | * @param wrapOnSpace If true, tries to wrap the string at spaces.
402 | */
403 | public void drawString(int x, int y, String s, boolean wrapX, boolean wrapOnSpace){
404 |
405 | int xp = x;
406 | int yp = y;
407 |
408 | if(wrapX && x < 0)
409 | xp = 0;
410 |
411 |
412 | for(int c = 0; c < s.length(); c++){
413 | if(wrapX && xp >= numTilesX){
414 | yp++;
415 | xp = 0;
416 |
417 | if(s.charAt(c) == ' ') continue;
418 | }
419 |
420 | if(!wrapX || !wrapOnSpace || s.charAt(c) != ' '){
421 | drawTile(xp, yp, s.charAt(c));
422 | }else{
423 | if(noMoreSpaces(s, c, c-xp+numTilesX)){
424 | yp++;
425 | xp = 0;
426 | continue;
427 | }
428 | }
429 |
430 |
431 | xp++;
432 | }
433 |
434 | }
435 |
436 |
437 | /**
438 | * Checks if there are any more spaces on the current line of text (if the string extends past the end of the line).
439 | * @param s The string.
440 | * @param startSpace The index of the current space.
441 | * @param end The index of the end of the line.
442 | * @return True if there are no more spaces on the line, false otherwise or if the string doesn't extend past the end of the line anyways.
443 | */
444 | private boolean noMoreSpaces(String s, int startSpace, int end){
445 |
446 | if(s.length() < end)
447 | return false;
448 |
449 | for(int i = startSpace+1; i < end; i++){
450 | if(s.charAt(i) == ' ')
451 | return false;
452 | }
453 |
454 | return true;
455 | }
456 |
457 |
458 | /**
459 | * Draws a TileImage starting at the specified x and y positions on the screen.
460 | * @param x The starting x position.
461 | * @param y The starting y position.
462 | * @param t The TileImage to draw.
463 | */
464 | public void drawTileImage(int x, int y, TileImage t){
465 | drawTileImage(x, y, t, false, false);
466 | }
467 |
468 |
469 | /**
470 | * Draws a TileImage (flipped either horizontally, vertically or both)
471 | * at the specified x and y positions on the screen.
472 | * @param x The starting x position.
473 | * @param y The starting y position.
474 | * @param t The TileImage to draw.
475 | * @param flipX Whether or not to flip the image horizontally.
476 | * @param flipY Whether or not to flip the image vertically.
477 | */
478 | public void drawTileImage(int x, int y, TileImage t, boolean flipX, boolean flipY){
479 |
480 | int dx = 1;
481 | int sx = 0;
482 | int ex = t.imageWidth;
483 | if(flipX){
484 | dx = -1;
485 | sx = t.imageWidth-1;
486 | ex = -1;
487 | }
488 |
489 | int dy = 1;
490 | int sy = 0;
491 | int ey = t.imageHeight;
492 | if(flipY){
493 | dy = -1;
494 | sy = t.imageHeight-1;
495 | ey = -1;
496 | }
497 |
498 | int c = 0;
499 |
500 | for(int j = sy; j != ey; j += dy){
501 | for(int i = sx; i != ex; i += dx){
502 | if(t.tileValues[c] != -1){
503 | setColours(t.colourValues[c][0], t.colourValues[c][1]);
504 | drawTile(x + i, y + j, t.tileValues[c], flipX, flipY);
505 | }
506 | c++;
507 | }
508 | }
509 | }
510 |
511 |
512 | /**
513 | * Draws the current Tileset.
514 | * @param flat If true, wraps at screen width, otherwise wraps at 16.
515 | */
516 | public void drawTileset(boolean flat){
517 |
518 | int c = 0;
519 |
520 | int x = 0;
521 | int y = 0;
522 |
523 | while(c < tileset.numTiles){
524 |
525 | drawTile(x, y, c);
526 |
527 | x++;
528 |
529 | if(flat){
530 | if(x == numTilesX){
531 | x = 0;
532 | y++;
533 | }
534 | }else{
535 | if(x == 16){
536 | x = 0;
537 | y++;
538 | }
539 | }
540 |
541 | c++;
542 | }
543 | }
544 |
545 |
546 | /**
547 | * Draws the current palette.
548 | * @param flat If true, wraps at screen width, otherwise wraps at 16.
549 | */
550 | public void drawPalette(boolean flat){
551 |
552 | int c = 0;
553 |
554 | int x = 0;
555 | int y = 0;
556 |
557 | while(c < palette.getNumColours()){
558 |
559 | int offX = x*tileset.tileWidth;
560 | int offY = y*tileset.tileHeight;
561 |
562 | for(int j = 0; j < tileset.tileHeight; j++){
563 | for(int i = 0; i < tileset.tileWidth; i++){
564 | BI.setRGB(offX + i, offY + j, palette.colours[c]);
565 | }
566 | }
567 |
568 | x++;
569 |
570 | if(flat){
571 | if(x == numTilesX){
572 | x = 0;
573 | y++;
574 | }
575 | }else{
576 | if(x == 16){
577 | x = 0;
578 | y++;
579 | }
580 | }
581 |
582 | c++;
583 | }
584 | }
585 |
586 |
587 | /**
588 | * Scales the BufferedImage and then draws it to the panel.
589 | */
590 | @Override
591 | public void paintComponent(Graphics g){
592 | Graphics2D g2d = BIScaled.createGraphics();
593 |
594 | //Scale by nearest neighbour
595 | g2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR);
596 |
597 | //Draw original imaged scaled up
598 | g2d.drawImage(BI, 0, 0, BIScaled.getWidth(), BIScaled.getHeight(), null);
599 |
600 | g2d.dispose();
601 |
602 | //Draw scaled image to panel
603 | g.drawImage(BIScaled, 0, 0, null);
604 | }
605 | }
606 |
--------------------------------------------------------------------------------
/src/textScreenEmu/Tile.java:
--------------------------------------------------------------------------------
1 | package textScreenEmu;
2 |
3 | /**
4 | * Class representing a single "tile" aka character.
5 | * @author sirrandalot
6 | *
7 | */
8 | public class Tile {
9 |
10 | /**
11 | * The values of this tile.
12 | */
13 | public int[] values;
14 |
15 |
16 | /**
17 | * The width of this tile.
18 | */
19 | public final int tileWidth;
20 |
21 |
22 | /**
23 | * The height of this tile.
24 | */
25 | public final int tileHeight;
26 |
27 |
28 | /**
29 | * Constructor for the tile class using width, height and a value array.
30 | * @param width The width to give this tile.
31 | * @param height The height to give this tile.
32 | * @param vals The values to give this tile.
33 | */
34 | public Tile(int width, int height, int[] vals){
35 |
36 |
37 | //Check if the input values are appropriate
38 | try{
39 |
40 | if(width <= 0 || width > 256)
41 | throw new Exception("Width " + width + " out of range, must be between 1 and 256 inclusively.");
42 |
43 | if(height <= 0 || height > 256)
44 | throw new Exception("Height " + height + " out of range, must be between 1 and 256 inclusively.");
45 |
46 | if(vals.length != width*height)
47 | throw new Exception("Array length does not match width and height parameters, must be width * height.");
48 |
49 | values = vals.clone();
50 |
51 | }catch(Exception e){
52 | System.out.println("ERROR: " + e);
53 | e.printStackTrace();
54 | }
55 |
56 | tileWidth = width;
57 | tileHeight = height;
58 |
59 | }
60 |
61 | /**
62 | * Constructor for Tile class using just width and height, calls the other constructor with a blank array for values.
63 | * @param width The width to give this tile.
64 | * @param height The height to give this tile.
65 | */
66 | public Tile(int width, int height){
67 | this(width, height, new int[width*height]);
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/src/textScreenEmu/TileImage.java:
--------------------------------------------------------------------------------
1 | package textScreenEmu;
2 |
3 | /**
4 | *
5 | * @author sirrandalot
6 | *
7 | */
8 | public class TileImage {
9 |
10 | /**
11 | * The number of horizontal tiles in the image.
12 | */
13 | public final int imageWidth;
14 |
15 | /**
16 | * The number of vertical tiles in the image.
17 | */
18 | public final int imageHeight;
19 |
20 | /**
21 | * The values for all the tiles.
22 | */
23 | protected int[] tileValues;
24 |
25 | /**
26 | * The foreground and background colour values for all the tiles.
27 | */
28 | protected int[][] colourValues;
29 |
30 |
31 | /**
32 | * Constructor taking the width and height of the image.
33 | * Creates a totally blank image with default 0 values.
34 | * @param width The width of the image.
35 | * @param height The height of the image.
36 | */
37 | public TileImage(int width, int height){
38 | this(width, height, new int[width*height], new int[width*height][2]);
39 | }
40 |
41 |
42 | /**
43 | * Creates a TileImage using the width and height, an array of tile values and
44 | * an array of background and foreground colour values.
45 | * @param width The width of the image.
46 | * @param height The height of the image.
47 | * @param vals The tile values.
48 | * @param cols The colour values.
49 | */
50 | public TileImage(int width, int height, int[] vals, int[][] cols){
51 |
52 | //Check if the input values are appropriate
53 | try{
54 | if(width <= 0 || height <= 0)
55 | throw new Exception("Width and height must be greater than 0.");
56 |
57 | if(vals.length != width*height)
58 | throw new Exception("Wrong number of tile values: " + vals.length + ", must be " + (width*height) + ".");
59 |
60 | if(cols.length != width*height)
61 | throw new Exception("Wrong number of colour values: " + cols.length + ", must be " + (width*height) + ".");
62 |
63 | }catch(Exception e){
64 | System.out.println("ERROR: " + e);
65 | e.printStackTrace();
66 | }
67 |
68 | imageWidth = width;
69 | imageHeight = height;
70 |
71 | tileValues = vals.clone();
72 |
73 | colourValues = new int[width*height][2];
74 | for(int i = 0; i < cols.length; i++)
75 | colourValues[i] = new int[]{cols[i][0], cols[i][1]};
76 | }
77 |
78 | /**
79 | * Sets the value and colours of a tile at a given position.
80 | * @param x The x position of the tile.
81 | * @param y The y position of the tile.
82 | * @param val The value to set.
83 | * @param background The background colour to set.
84 | * @param foreground The foreground colour to set.
85 | */
86 | public void setTile(int x, int y, int val, int background, int foreground){
87 | setTileValue(x, y, val);
88 | setTileColour(x, y, background, foreground);
89 | }
90 |
91 | /**
92 | * Sets the value of a tile at a given position.
93 | * @param x The x position of the tile.
94 | * @param y The y position of the tile.
95 | * @param val The value to set.
96 | */
97 | public void setTileValue(int x, int y, int val){
98 |
99 | //Check if the input values are appropriate
100 | try{
101 |
102 | if(x < 0 || x >= imageWidth)
103 | throw new Exception("X position " + x + " out of range, must be between 0 and " + (imageWidth-1) + " inclusively.");
104 |
105 | if(y < 0 || y >= imageHeight)
106 | throw new Exception("Y position " + y + " out of range, must be between 0 and " + (imageHeight-1) + " inclusively.");
107 |
108 | }catch(Exception e){
109 | System.out.println("ERROR: " + e);
110 | e.printStackTrace();
111 | }
112 |
113 | tileValues[y*imageWidth + x] = val;
114 | }
115 |
116 | /**
117 | * Sets the colours of a tile at a given position.
118 | * @param x The x position of the tile.
119 | * @param y The y position of the tile.
120 | * @param background The background colour to set.
121 | * @param foreground The foreground colour to set.
122 | */
123 | public void setTileColour(int x, int y, int background, int foreground){
124 |
125 | //Check if the input values are appropriate
126 | try{
127 |
128 | if(x < 0 || x >= imageWidth)
129 | throw new Exception("X position " + x + " out of range, must be between 0 and " + (imageWidth-1) + " inclusively.");
130 |
131 | if(y < 0 || y >= imageHeight)
132 | throw new Exception("Y position " + y + " out of range, must be between 0 and " + (imageHeight-1) + " inclusively.");
133 |
134 | }catch(Exception e){
135 | System.out.println("ERROR: " + e);
136 | e.printStackTrace();
137 | }
138 |
139 | colourValues[y*imageWidth + x] = new int[]{background, foreground};
140 | }
141 |
142 |
143 | /**
144 | * Gets the tile value at a specified position.
145 | * @param x The x position.
146 | * @param y The y position.
147 | * @return The tile value.
148 | */
149 | public int getTileValue(int x, int y){
150 |
151 | //Check if the input values are appropriate
152 | try{
153 |
154 | if(x < 0 || x >= imageWidth)
155 | throw new Exception("X position " + x + " out of range, must be between 0 and " + (imageWidth-1) + " inclusively.");
156 |
157 | if(y < 0 || y >= imageHeight)
158 | throw new Exception("Y position " + y + " out of range, must be between 0 and " + (imageHeight-1) + " inclusively.");
159 |
160 | }catch(Exception e){
161 | System.out.println("ERROR: " + e);
162 | e.printStackTrace();
163 | }
164 |
165 | return tileValues[y*imageWidth + x];
166 | }
167 |
168 |
169 | /**
170 | * Gets the background and foreground colours of a tile ad a specified position.
171 | * @param x The x position.
172 | * @param y The y position.
173 | * @return The background and foreground colours.
174 | */
175 | public int[] getTileColours(int x, int y){
176 |
177 | //Check if the input values are appropriate
178 | try{
179 |
180 | if(x < 0 || x >= imageWidth)
181 | throw new Exception("X position " + x + " out of range, must be between 0 and " + (imageWidth-1) + " inclusively.");
182 |
183 | if(y < 0 || y >= imageHeight)
184 | throw new Exception("Y position " + y + " out of range, must be between 0 and " + (imageHeight-1) + " inclusively.");
185 |
186 | }catch(Exception e){
187 | System.out.println("ERROR: " + e);
188 | e.printStackTrace();
189 | }
190 |
191 | return colourValues[y*imageWidth + x].clone();
192 | }
193 | }
194 |
--------------------------------------------------------------------------------
/src/textScreenEmu/Tileset.java:
--------------------------------------------------------------------------------
1 | package textScreenEmu;
2 |
3 | /**
4 | * Class representing a set of Tiles.
5 | * @author sirrandalot
6 | *
7 | */
8 | public class Tileset {
9 |
10 | /**
11 | * The width of the tiles in this set.
12 | */
13 | public final int tileWidth;
14 |
15 | /**
16 | * The height of the tiles in this set.
17 | */
18 | public final int tileHeight;
19 |
20 | /**
21 | * The number of tiles in this set.
22 | */
23 | public final int numTiles;
24 |
25 | /**
26 | * The values of the tiles in this set.
27 | */
28 | protected int[] values;
29 |
30 |
31 | /**
32 | * Constructor for Tileset using tile width, tile height and number of tiles, calls another constructor using a zero array for values.
33 | * @param tWidth The width of the tiles.
34 | * @param tHeight The height of the tiles.
35 | * @param numT The number of tiles.
36 | */
37 | protected Tileset(int tWidth, int tHeight, int numT){
38 | this(tWidth, tHeight, numT, new int[tWidth*tHeight*numT]);
39 | }
40 |
41 |
42 | /**
43 | * Constructor for Tileset using tile width, tile height, number of tiles and an array of values.
44 | * @param tWidth The width of the tiles.
45 | * @param tHeight The height of the tiles.
46 | * @param numT The number of tiles.
47 | * @param vals The values of the tiles.
48 | */
49 | protected Tileset(int tWidth, int tHeight, int numT, int[] vals){
50 |
51 | //Check if the input values are appropriate
52 | try{
53 |
54 | if(tWidth <= 0 || tWidth > 256)
55 | throw new Exception("Width " + tWidth + " out of range, must be between 1 and 256 inclusively.");
56 |
57 | if(tHeight <= 0 || tHeight > 256)
58 | throw new Exception("Height " + tHeight + " out of range, must be between 1 and 256 inclusively.");
59 |
60 | if(numT <= 0 || numT > 256)
61 | throw new Exception("Number of tiles " + numT + " out of range, must be between 1 and 256 inclusively.");
62 |
63 | if(vals.length != tWidth*tHeight*numT)
64 | throw new Exception("Array length does not match width, height and num parameters, must be tWidth * tHeight * numT.");
65 |
66 | values = vals.clone();
67 |
68 | }catch(Exception e){
69 | System.out.println("ERROR: " + e);
70 | e.printStackTrace();
71 | }
72 |
73 | tileWidth = tWidth;
74 | tileHeight = tHeight;
75 | numTiles = numT;
76 |
77 | }
78 |
79 |
80 | /**
81 | * Constructor for Tileset using tile width and an array of Tiles.
82 | * @param tWidth The width of the tiles.
83 | * @param tHeight The height of the tiles.
84 | * @param tiles The array of Tiles.
85 | */
86 | protected Tileset(int tWidth, int tHeight, Tile[] tiles){
87 |
88 | //Check if the input values are appropriate
89 | try{
90 |
91 | if(tWidth <= 0 || tWidth > 256)
92 | throw new Exception("Width " + tWidth + " out of range, must be between 1 and 256 inclusively.");
93 |
94 | if(tHeight <= 0 || tHeight > 256)
95 | throw new Exception("Height " + tHeight + " out of range, must be between 1 and 256 inclusively.");
96 |
97 | if(tiles.length > 256)
98 | throw new Exception("Number of tiles " + tiles.length + " out of range, must be between 1 and 256 inclusively.");
99 |
100 | for(int i = 0; i < tiles.length; i++)
101 | if(tiles[i].tileWidth != tWidth || tiles[i].tileHeight != tHeight)
102 | throw new Exception("Tile size " + tiles[i].tileWidth + "x" + tiles[i].tileHeight + " does not match specified size: " + tWidth + "x" + tHeight + ".");
103 |
104 | values = new int[tWidth*tHeight*tiles.length];
105 |
106 | }catch(Exception e){
107 | System.out.println("ERROR: " + e);
108 | e.printStackTrace();
109 | }
110 |
111 |
112 | tileWidth = tWidth;
113 | tileHeight = tHeight;
114 | numTiles = tiles.length;
115 |
116 | for(int i = 0; i < tiles.length; i++)
117 | setTile(i, tiles[i]);
118 | }
119 |
120 |
121 | /**
122 | * Sets the values for a tile at a specific index given an array for values.
123 | * @param index The tile index.
124 | * @param vals The values to use.
125 | */
126 | public void setTile(int index, int[] vals){
127 |
128 | //Check if the input values are appropriate
129 | try{
130 |
131 | if(index < 0 || index >= numTiles)
132 | throw new Exception("Tile index " + index + " out of range, must be between 0 and " + (numTiles-1) + " inclusively.");
133 |
134 | if(vals.length != tileWidth*tileHeight)
135 | throw new Exception("Array length does not match tile width and height, must be " + tileWidth + " * " + tileHeight + " = " + (tileWidth*tileHeight) + ".");
136 |
137 | for(int t = 0; t < vals.length; t++){
138 | values[index*tileWidth*tileHeight + t] = vals[t];
139 | }
140 |
141 | }catch(Exception e){
142 | System.out.println("ERROR: " + e);
143 | e.printStackTrace();
144 | }
145 |
146 | }
147 |
148 |
149 | /**
150 | * Sets the values for a tile at a specific index given a tile.
151 | * @param index The tile index.
152 | * @param tile The tile whose values to use.
153 | */
154 | public void setTile(int index, Tile tile){
155 |
156 | //Check if the input values are appropriate
157 | try{
158 |
159 | if(tile.tileWidth != tileWidth || tile.tileHeight != tileHeight)
160 | throw new Exception("Tile size " + tile.tileWidth + "x" + tile.tileHeight + " does not match specified size: " + tileWidth + "x" + tileHeight + ".");
161 |
162 | setTile(index, tile.values);
163 |
164 | }catch(Exception e){
165 | System.out.println("ERROR: " + e);
166 | e.printStackTrace();
167 | }
168 |
169 | }
170 | }
171 |
--------------------------------------------------------------------------------
/src/textScreenEmu/TilesetFactory.java:
--------------------------------------------------------------------------------
1 | package textScreenEmu;
2 |
3 | import java.awt.image.BufferedImage;
4 |
5 | import javax.imageio.ImageIO;
6 |
7 | /**
8 | * Factory class for creating Tilesets.
9 | * @author sirrandalot
10 | *
11 | */
12 | public class TilesetFactory {
13 |
14 | /**
15 | * Creates a blank Tileset given a tile width, height and a number of Tiles.
16 | * @param tileWidth The width of the tiles.
17 | * @param tileHeight The height of the tiles.
18 | * @param numT The number of tiles.
19 | * @return A blank Tileset.
20 | */
21 | public static Tileset createTileset(int tileWidth, int tileHeight, int numT){
22 | return new Tileset(tileWidth, tileHeight, numT);
23 | }
24 |
25 | /**
26 | * Creates a tileset given a tile width, height, number of tiles and an array of values.
27 | * @param tileWidth The width of the tiles.
28 | * @param tileHeight The height of the tiles.
29 | * @param numT The number of tiles.
30 | * @param vals The values for the Tileset.
31 | * @return A Tileset using the provided values.
32 | */
33 | public static Tileset createTileset(int tileWidth, int tileHeight, int numT, int[] vals){
34 | return new Tileset(tileWidth, tileHeight, numT, vals);
35 | }
36 |
37 | /**
38 | * Creates a tileset given a tile width, height, and an array of Tiles.
39 | * @param tileWidth The width of the tiles.
40 | * @param tileHeight The height of the tiles.
41 | * @param tiles The Tile array.
42 | * @return A Tileset using the provided Tiles.
43 | */
44 | public static Tileset createTileset(int tileWidth, int tileHeight, Tile[] tiles){
45 | return new Tileset(tileWidth, tileHeight, tiles);
46 | }
47 |
48 | /**
49 | * Creates a pre-defined Tileset given a TilesetPredef enum value.
50 | * @param t The TilesetPredef enum value.
51 | * @return A pre-defined Tileset.
52 | */
53 | public static Tileset createTileset(TilesetPredef t){
54 |
55 | switch(t){
56 | case CODEPAGE437_9x16:
57 | return getTilesetFromFile("cp437_9x16.png", 9, 16, 16, 16, 5);
58 | case CODEPAGE437_8x8:
59 | return getTilesetFromFile("cp437_8x8.png", 8, 8, 16, 16, 5);
60 | case CODEPAGE437_10x10:
61 | return getTilesetFromFile("cp437_10x10.png", 10, 10, 16, 16, 5);
62 | case CODEPAGE437_12x12:
63 | return getTilesetFromFile("cp437_12x12.png", 12, 12, 16, 16, 5);
64 | case CODEPAGE437_16x16:
65 | return getTilesetFromFile("cp437_16x16.png", 16, 16, 16, 16, 5);
66 | case SIMPLEMOOD_16x16:
67 | return getTilesetFromFile("sm_16x16.png", 16, 16, 16, 16, 5);
68 | case MEDIEVAL_8x16:
69 | return getTilesetFromFile("medieval_8x16.bmp", 8, 16, 16, 16, 5);
70 | case BROADWAY_8x16:
71 | return getTilesetFromFile("broadway_8x16.bmp", 8, 16, 16, 16, 5);
72 | case ANTIQUE_8x16:
73 | return getTilesetFromFile("antique_8x16.bmp", 8, 16, 16, 16, 5);
74 | case COURIER_8x16:
75 | return getTilesetFromFile("courier_8x16.bmp", 8, 16, 16, 16, 5);
76 | case RETRO_10x10:
77 | return getTilesetFromFile("retro_10x10.png", 10, 10, 16, 16, 5);
78 | case BASIC_8x8:
79 | return getTilesetFromFile("basic_8x8.png", 8, 8, 16, 16, 5);
80 | case COMICSANS_16x16:
81 | return getTilesetFromFile("comicsans_16x16.png", 16, 16, 16, 16, 50);
82 | case DOODLE_6x6:
83 | return getTilesetFromFile("doodle_6x6.png", 6, 6, 16, 16, 50);
84 | case DOODLE_16x16:
85 | return getTilesetFromFile("doodle_16x16.png", 16, 16, 16, 16, 50);
86 | default:
87 | System.out.println("Enum value not recognized, returning code page 437 9x16 tileset...");
88 | return getTilesetFromFile("cp437_9x16.png", 9, 16, 16, 16, 5);
89 | }
90 | }
91 |
92 |
93 |
94 | /**
95 | * Creates a Tileset using an image saved inside the image package.
96 | * @param name The file name.
97 | * @param tileWidth The tile width.
98 | * @param tileHeight The tile height.
99 | * @param numX The number of horizontal tiles.
100 | * @param numY The number of vertical tiles.
101 | * @param thresh The threshold for determining if a pixel is foreground.
102 | * @return A Tileset based off of a file in the image package.
103 | */
104 | private static Tileset getTilesetFromFile(String name, int tileWidth, int tileHeight, int numX, int numY, int thresh){
105 | BufferedImage img = null;
106 |
107 | try{
108 |
109 | img = ImageIO.read(TilesetFactory.class.getResource("/textScreenEmu/images/tilesets/" + name));
110 |
111 | return getTilesetFromImage(img, tileWidth, tileHeight, numX, numY, thresh);
112 |
113 | }catch(Exception e){
114 | e.printStackTrace();
115 | }
116 |
117 | return new Tileset(tileWidth, tileHeight, numX*numY);
118 | }
119 |
120 |
121 | /**
122 | * Creates a Tileset from a BufferedImage, the red value of pixels is used to determine
123 | * whether or not to set the array value to 0 or 1, and a constant threshold is used.
124 | * @param img The image to use.
125 | * @param tileWidth The tile width.
126 | * @param tileHeight The tile height.
127 | * @param numX The number of horizontal tiles.
128 | * @param numY The number of vertical tiles.
129 | * @param thresh The threshold for determining if a pixel is foreground.
130 | * @return A Tileset based off of the input image.
131 | */
132 | public static Tileset getTilesetFromImage(BufferedImage img, int tileWidth, int tileHeight, int numX, int numY, int thresh){
133 |
134 | //Create an array to hold the values
135 | int[] values = new int[img.getWidth()*img.getHeight()];
136 |
137 | //Check if the input parameters are appropriate
138 | try{
139 |
140 | if(img.getWidth() != tileWidth*numX)
141 | throw new Exception("Image width " + img.getWidth() + " does not match tile width and number of x tiles " + tileWidth + " and " + numX + ".");
142 |
143 | if(img.getHeight() != tileHeight*numY)
144 | throw new Exception("Image height " + img.getHeight() + " does not match tile width and number of x tiles " + tileHeight + " and " + numY + ".");
145 |
146 | //Index counter
147 | int c = 0;
148 |
149 | //Iterate through the image
150 | for(int ty = 0; ty < numY; ty++){
151 | for(int tx = 0; tx < numX; tx++){
152 |
153 | for(int j = 0; j < tileHeight; j++){
154 | for(int i = 0; i < tileWidth; i++){
155 |
156 | //Check the red value of the pixel
157 | int r = img.getRGB(tileWidth*tx + i, tileHeight*ty + j) & 0xFF;
158 |
159 | if(r > thresh)
160 | values[c] = 1;
161 |
162 | c++;
163 | }
164 | }
165 | }
166 | }
167 |
168 | }catch(Exception e){
169 | System.out.println("ERROR: " + e);
170 | e.printStackTrace();
171 | }
172 |
173 |
174 | return new Tileset(tileWidth, tileHeight, numX*numY, values);
175 | }
176 |
177 | }
178 |
--------------------------------------------------------------------------------
/src/textScreenEmu/TilesetPredef.java:
--------------------------------------------------------------------------------
1 | package textScreenEmu;
2 |
3 | /**
4 | * Enum of pre-defined Tilesets
5 | * @author sirrandalot
6 | *
7 | */
8 | public enum TilesetPredef {
9 | CODEPAGE437_9x16,
10 | CODEPAGE437_8x8,
11 | CODEPAGE437_10x10,
12 | CODEPAGE437_12x12,
13 | CODEPAGE437_16x16,
14 | SIMPLEMOOD_16x16,
15 | MEDIEVAL_8x16,
16 | BROADWAY_8x16,
17 | ANTIQUE_8x16,
18 | COURIER_8x16,
19 | RETRO_10x10,
20 | BASIC_8x8,
21 | COMICSANS_16x16,
22 | DOODLE_6x6,
23 | DOODLE_16x16
24 | }
25 |
--------------------------------------------------------------------------------
/src/textScreenEmu/images/palettes/pal_APPLEII_16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sirrandalot/TextScreenEmu/2dc254224d4590a87e30698483ddb4c8aead4970/src/textScreenEmu/images/palettes/pal_APPLEII_16.png
--------------------------------------------------------------------------------
/src/textScreenEmu/images/palettes/pal_BLACK_AND_WHITE.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sirrandalot/TextScreenEmu/2dc254224d4590a87e30698483ddb4c8aead4970/src/textScreenEmu/images/palettes/pal_BLACK_AND_WHITE.png
--------------------------------------------------------------------------------
/src/textScreenEmu/images/palettes/pal_C16_128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sirrandalot/TextScreenEmu/2dc254224d4590a87e30698483ddb4c8aead4970/src/textScreenEmu/images/palettes/pal_C16_128.png
--------------------------------------------------------------------------------
/src/textScreenEmu/images/palettes/pal_C64_16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sirrandalot/TextScreenEmu/2dc254224d4590a87e30698483ddb4c8aead4970/src/textScreenEmu/images/palettes/pal_C64_16.png
--------------------------------------------------------------------------------
/src/textScreenEmu/images/palettes/pal_CGA_16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sirrandalot/TextScreenEmu/2dc254224d4590a87e30698483ddb4c8aead4970/src/textScreenEmu/images/palettes/pal_CGA_16.png
--------------------------------------------------------------------------------
/src/textScreenEmu/images/palettes/pal_EGA_64.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sirrandalot/TextScreenEmu/2dc254224d4590a87e30698483ddb4c8aead4970/src/textScreenEmu/images/palettes/pal_EGA_64.png
--------------------------------------------------------------------------------
/src/textScreenEmu/images/palettes/pal_GAMEBOY_4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sirrandalot/TextScreenEmu/2dc254224d4590a87e30698483ddb4c8aead4970/src/textScreenEmu/images/palettes/pal_GAMEBOY_4.png
--------------------------------------------------------------------------------
/src/textScreenEmu/images/palettes/pal_GREY_16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sirrandalot/TextScreenEmu/2dc254224d4590a87e30698483ddb4c8aead4970/src/textScreenEmu/images/palettes/pal_GREY_16.png
--------------------------------------------------------------------------------
/src/textScreenEmu/images/palettes/pal_GREY_256.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sirrandalot/TextScreenEmu/2dc254224d4590a87e30698483ddb4c8aead4970/src/textScreenEmu/images/palettes/pal_GREY_256.png
--------------------------------------------------------------------------------
/src/textScreenEmu/images/palettes/pal_GREY_32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sirrandalot/TextScreenEmu/2dc254224d4590a87e30698483ddb4c8aead4970/src/textScreenEmu/images/palettes/pal_GREY_32.png
--------------------------------------------------------------------------------
/src/textScreenEmu/images/palettes/pal_GREY_4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sirrandalot/TextScreenEmu/2dc254224d4590a87e30698483ddb4c8aead4970/src/textScreenEmu/images/palettes/pal_GREY_4.png
--------------------------------------------------------------------------------
/src/textScreenEmu/images/palettes/pal_GREY_8.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sirrandalot/TextScreenEmu/2dc254224d4590a87e30698483ddb4c8aead4970/src/textScreenEmu/images/palettes/pal_GREY_8.png
--------------------------------------------------------------------------------
/src/textScreenEmu/images/palettes/pal_MSX_16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sirrandalot/TextScreenEmu/2dc254224d4590a87e30698483ddb4c8aead4970/src/textScreenEmu/images/palettes/pal_MSX_16.png
--------------------------------------------------------------------------------
/src/textScreenEmu/images/palettes/pal_NES_64.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sirrandalot/TextScreenEmu/2dc254224d4590a87e30698483ddb4c8aead4970/src/textScreenEmu/images/palettes/pal_NES_64.png
--------------------------------------------------------------------------------
/src/textScreenEmu/images/palettes/pal_PHOSPHOR_8.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sirrandalot/TextScreenEmu/2dc254224d4590a87e30698483ddb4c8aead4970/src/textScreenEmu/images/palettes/pal_PHOSPHOR_8.png
--------------------------------------------------------------------------------
/src/textScreenEmu/images/palettes/pal_SPECTRUM_16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sirrandalot/TextScreenEmu/2dc254224d4590a87e30698483ddb4c8aead4970/src/textScreenEmu/images/palettes/pal_SPECTRUM_16.png
--------------------------------------------------------------------------------
/src/textScreenEmu/images/palettes/pal_VGA_16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sirrandalot/TextScreenEmu/2dc254224d4590a87e30698483ddb4c8aead4970/src/textScreenEmu/images/palettes/pal_VGA_16.png
--------------------------------------------------------------------------------
/src/textScreenEmu/images/tilesets/antique_8x16.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sirrandalot/TextScreenEmu/2dc254224d4590a87e30698483ddb4c8aead4970/src/textScreenEmu/images/tilesets/antique_8x16.bmp
--------------------------------------------------------------------------------
/src/textScreenEmu/images/tilesets/basic_8x8.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sirrandalot/TextScreenEmu/2dc254224d4590a87e30698483ddb4c8aead4970/src/textScreenEmu/images/tilesets/basic_8x8.png
--------------------------------------------------------------------------------
/src/textScreenEmu/images/tilesets/broadway_8x16.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sirrandalot/TextScreenEmu/2dc254224d4590a87e30698483ddb4c8aead4970/src/textScreenEmu/images/tilesets/broadway_8x16.bmp
--------------------------------------------------------------------------------
/src/textScreenEmu/images/tilesets/comicsans_16x16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sirrandalot/TextScreenEmu/2dc254224d4590a87e30698483ddb4c8aead4970/src/textScreenEmu/images/tilesets/comicsans_16x16.png
--------------------------------------------------------------------------------
/src/textScreenEmu/images/tilesets/courier_8x16.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sirrandalot/TextScreenEmu/2dc254224d4590a87e30698483ddb4c8aead4970/src/textScreenEmu/images/tilesets/courier_8x16.bmp
--------------------------------------------------------------------------------
/src/textScreenEmu/images/tilesets/cp437_10x10.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sirrandalot/TextScreenEmu/2dc254224d4590a87e30698483ddb4c8aead4970/src/textScreenEmu/images/tilesets/cp437_10x10.png
--------------------------------------------------------------------------------
/src/textScreenEmu/images/tilesets/cp437_12x12.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sirrandalot/TextScreenEmu/2dc254224d4590a87e30698483ddb4c8aead4970/src/textScreenEmu/images/tilesets/cp437_12x12.png
--------------------------------------------------------------------------------
/src/textScreenEmu/images/tilesets/cp437_16x16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sirrandalot/TextScreenEmu/2dc254224d4590a87e30698483ddb4c8aead4970/src/textScreenEmu/images/tilesets/cp437_16x16.png
--------------------------------------------------------------------------------
/src/textScreenEmu/images/tilesets/cp437_8x8.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sirrandalot/TextScreenEmu/2dc254224d4590a87e30698483ddb4c8aead4970/src/textScreenEmu/images/tilesets/cp437_8x8.png
--------------------------------------------------------------------------------
/src/textScreenEmu/images/tilesets/cp437_9x16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sirrandalot/TextScreenEmu/2dc254224d4590a87e30698483ddb4c8aead4970/src/textScreenEmu/images/tilesets/cp437_9x16.png
--------------------------------------------------------------------------------
/src/textScreenEmu/images/tilesets/doodle_16x16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sirrandalot/TextScreenEmu/2dc254224d4590a87e30698483ddb4c8aead4970/src/textScreenEmu/images/tilesets/doodle_16x16.png
--------------------------------------------------------------------------------
/src/textScreenEmu/images/tilesets/doodle_6x6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sirrandalot/TextScreenEmu/2dc254224d4590a87e30698483ddb4c8aead4970/src/textScreenEmu/images/tilesets/doodle_6x6.png
--------------------------------------------------------------------------------
/src/textScreenEmu/images/tilesets/medieval_8x16.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sirrandalot/TextScreenEmu/2dc254224d4590a87e30698483ddb4c8aead4970/src/textScreenEmu/images/tilesets/medieval_8x16.bmp
--------------------------------------------------------------------------------
/src/textScreenEmu/images/tilesets/retro_10x10.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sirrandalot/TextScreenEmu/2dc254224d4590a87e30698483ddb4c8aead4970/src/textScreenEmu/images/tilesets/retro_10x10.png
--------------------------------------------------------------------------------
/src/textScreenEmu/images/tilesets/sm_16x16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sirrandalot/TextScreenEmu/2dc254224d4590a87e30698483ddb4c8aead4970/src/textScreenEmu/images/tilesets/sm_16x16.png
--------------------------------------------------------------------------------