Skip to content

Commit

Permalink
Initial Checkin.
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffAlyanak committed Oct 2, 2019
0 parents commit e126a2e
Show file tree
Hide file tree
Showing 171 changed files with 24,729 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
build
.idea
.gradle
*.xml
*.class
*.iml
339 changes: 339 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

57 changes: 57 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
Tile Monster
=============

Retro Console Tile Editor
--------------------------

Tile Monster is a fork of Ken Hanson's original TM brought ever-so-slightly into the modern era. Much of its interface will feel feel familiar to users of YY-CHR, MSPaint or tile tools, but Tile Monster is a much more powerful animal!

Tile Monster is a visual explorer of binary videogame data aimed at displaying and editing graphics content for editing and export. It supports many common platform formats out of the box but its design is platform-independant and employs relatively simple, XML-defined definitions for new graphics formats, file formats and palette formats. These "graphics codec" definitions can be linked to file extensions in order to automatically switch to the graphics mode associated with that extension.

Detailed instructions on can be found in the [Manual](manual/Manual.md).

Building & Running
--------

While this has only been tested with `gradle 4.4` it should be simple enough to build on most versions of `gradle`.

Simply running `gradle build` will build the `jar` in the `build/libs/` directory.

It can then be run with `java -jar tilemonster-1.jar`. _Tile Monster requires Java Runtime Environment (JRE) version 1.4.0 or greater._

Features
---------

Platform support:
* Famicom/NES
* SuFami/SNES
* GameBoy
* GameBoy Advance
* Sega Master System
* Sega Genesis/MegaDrive/32X
* Nintendo 64
* WonderSwan
* NeoGeo Pocket
* and more...you can even add your own!

Import/Export data in a variety of formats:
* JPG
* PNG
* GIF
* BMP
* PCX

Tons of useful features:
* Simple, familiar interface
* Automatic color reduction when pasting into low-res formats
* Bookmark ROM locations
* Create palettes or import them directly from ROM

Format definitions have been moved into the `jar` itself for simpler portability but new definitions can still easily be added to the XML `tmspec.xml` file. The same is true for translation files. Please reach out if you would like to contribute new format definitions or translations to any other languages.

Credits & License
---------

This minor modernization of Ken Hanson's original Tile program is relesed under the same GNU GPLv2 as outlined in the [LICENSE](LICENSE).

Some of the code included also comes from Kerry Shetline <[email protected]>, Matthias Burg <[email protected]>, Jef Poskanzer <[email protected]>, J. David Eisenberg <[email protected]>, Richard J.Osbaldeston, Kent Hansen and John Cristy. Where this is the case, the requisite notices and licenses are included.
12 changes: 12 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apply plugin: 'java'

sourceCompatibility = 1.7
version = '1'

jar {
manifest {
attributes 'Main-Class': 'TileMonster',
'Implementation-Title': 'Tile Monster',
'Implementation-Version': version
}
}
367 changes: 367 additions & 0 deletions manual/Manual.md

Large diffs are not rendered by default.

Binary file added manual/images/fig1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added manual/images/fig2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added manual/images/fig3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added manual/images/fig4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added manual/images/fig5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
50 changes: 50 additions & 0 deletions src/main/java/TileMonster.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/*
*
* This file is part of Tile Monster.
*
* Tile Monster is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* Tile Monster is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/

import tm.ui.TMUI;

/**
*
* Tile Monster main class.
* A quite pointless class really. The application is very UI-centric,
* so the TMUI class evolved into the real application backbone.
* This class just gets the show started.
*
**/

public class TileMonster {

/**
*
* Constructor.
*
**/

public TileMonster() {
new TMUI();
}

/**
*
* Starts up the program.
*
**/

public static void main(String[] args) {
new TileMonster();
}

}
219 changes: 219 additions & 0 deletions src/main/java/tm/FileImage.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,219 @@
/*
*
* This file is part of Tile Monster.
*
* Tile Monster is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* Tile Monster is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/

package tm;

import tm.treenodes.*;
import tm.ui.TMView;
import java.io.File;
import java.util.Vector;

/**
*
* A FileImage object represents a file that has been loaded into the editor.
*
**/

public class FileImage {

private byte[] contents;
private File file;
private Vector views = new Vector();
private static int fileNum=0;
private boolean modified;
private TMFileResources resources;

/**
*
* Creates a FileImage from a file on disk.
*
* The contents of the file have already been read into buffer contents.
*
**/

public FileImage(File file, byte[] contents) {
this.file = file;
this.contents = contents;
this.resources = null;
setModified(false);
}

/**
*
* Creates a blank FileImage of the requested size.
*
**/

public FileImage(int size) throws OutOfMemoryError {
file = new File(System.getProperty("user.dir") + (fileNum++));
this.resources = null;
try {
contents = new byte[size];
}
catch (OutOfMemoryError e) {
throw e;
}
// fill with zeroes
for (int i=0; i<size; i++) {
contents[i] = 0x00;
}
setModified(false);
}

/**
*
* Sets the file.
*
**/

public void setFile(File file) {
this.file = file;
}

/**
*
* Gets the file.
*
**/

public File getFile() {
return file;
}

/**
*
* Gets the binary contents of this FileImage.
*
**/

public byte[] getContents() {
return contents;
}

/**
*
* Gets the size (in # of bytes) of the file contents.
*
**/

public int getSize() {
return contents.length;
}

/**
*
* Gets the name of the file.
*
**/

public String getName() {
return file.getName();
}

/**
*
* Gets the TMViews associated with this FileImage.
*
**/

public TMView[] getViews() {
TMView[] vs = new TMView[views.size()];
for (int i=0; i<vs.length; i++) {
vs[i] = (TMView)views.get(i);
}
return vs;
}

/**
*
* Adds a TMView to this FileImage.
*
**/

public void addView(TMView view) {
views.add(view);
}

/**
*
* Removes a TMView for this FileImage.
*
**/

public void removeView(TMView view) {
views.remove(view);
if (views.size() == 0) {
contents = null; // kill the contents reference
resources = null;
file = null;
}
}

/**
*
* Sets the modified flag.
*
**/

public void setModified(boolean modified) {
this.modified = modified;
// update view titles
TMView[] views = getViews();
for (int i=0; i<views.length; i++) {
TMView v = views[i];
String t = v.getTitle();
if (modified) {
v.setTitle(getName()+"*");
v.getTMUI().setSaveButtonsEnabled(true);
}
else {
v.setTitle(getName());
}
}
}

/**
*
* Gets the modified flag.
*
**/

public boolean isModified() {
return modified;
}

/**
*
* Sets the resources associated with this fileimage.
* The resources contain bookmarks and palettes.
*
**/

public void setResources(TMFileResources resources) {
this.resources = resources;
}

/**
*
* Gets the resources related to this fileimage.
*
**/

public TMFileResources getResources() {
return resources;
}

}
Loading

0 comments on commit e126a2e

Please sign in to comment.