Add hex editor plugin

This commit is contained in:
peterdell 2018-12-30 16:27:49 +01:00
parent b32db01760
commit a77f5cf51c
12 changed files with 523 additions and 0 deletions

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View File

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>com.wudsn.ide.hex</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

View File

@ -0,0 +1,8 @@
#Wed Jun 20 22:39:08 CEST 2012
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.6

View File

@ -0,0 +1,11 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Hex Editor Test
Bundle-SymbolicName: com.wudsn.ide.hex
Bundle-Version: 1.6.6
Bundle-Activator: com.wudsn.ide.hex.HexPlugin
Bundle-Vendor: WUDSN
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ActivationPolicy: lazy

1
com.wudsn.ide.hex/bin/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/com

View File

@ -0,0 +1,10 @@
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.,\
build.properties,\
fonts/,\
src/,\
.project,\
.classpath

Binary file not shown.

View File

@ -0,0 +1,317 @@
{\rtf1\ansi\deff0\deftab720{\fonttbl{\f0\fswiss MS Sans Serif;}{\f1\froman\fcharset2 Symbol;}{\f2\fmodern\fprq1 Atari Classic Chunky;}{\f3\froman Times New Roman;}{\f4\fswiss\fprq2 Arial;}}
{\colortbl\red0\green0\blue0;\red0\green0\blue255;}
\deflang1033\pard\plain\f2\fs24\cf1 Atari Classic TrueType Fonts \plain\f2\fs24\cf0
\par \plain\f4\fs16\cf0 (Windows Version 1.1)
\par Created by Mark Simonson (v.1.0-1998, v.1.1-2001)
\par marksim@bitstream.net
\par Website: Mac/Atari Fusion--Atari Home Computer Resources for Mac Users
\par http://www2.bitstream.net/~marksim/atarimac/
\par Macintosh version also available.
\par
\par With these fonts installed, you can view and print Atari text files in any text editor that allows you to change fonts (WordPad, for example). Tip: In order to get the correct line breaks, you will need to change the ATASCII return character (155) to the DOS LF character. (In the Character Map accessory, the ATASCII return is the blank character that comes just before the inverse up-arrow.)
\par
\par There are three different fonts. \plain\f4\fs16\cf0\b Atari Classic Chunky \plain\f4\fs16\cf0 is a pixel-for-pixel copy of the original ATASCII character set. \plain\f4\fs16\cf0\b Atari Classic Smooth \plain\f4\fs16\cf0 interprets the pixel aliasing (stair steps) as diagonal lines. \plain\f4\fs16\cf0\b Atari Classic Extrasmooth \plain\f4\fs16\cf0 refines this idea further with the addition of curves. \plain\f4\fs16\cf0\b Smooth\plain\f4\fs16\cf0 and \plain\f4\fs16\cf0\b Extrasmooth\plain\f4\fs16\cf0 were designed for better appearance and legibility at larger sizes and on print-outs. Use the one that looks best to you.
\par
\par These fonts will tend to look uneven at font sizes that do not correspond to the 8-by-8 pixel grid that the characters are based on. Because Windows assumes 96ppi screen resolution, they will look best in a font size that is a multiple of 6 (i.e., 6pt, 12pt, 18pt, etc.). (In Windows, 6 points = 8 pixels.)
\par
\par The Atari Classic TrueType fonts duplicate the ATASCII character set on a low-level basis. Unlike a normal Windows font, ATASCII utilizes all character codes from $00 to $FF (0 to 255). The lower half are normal characters; the upper half are inverse versions of the lower half. The basic ASCII characters ($00 to $7F) correspond fairly closely except for the first 32, which don't normally contain characters in a Windows font.
\par
\par Due to differences between the way Windows and the Atari use character codes, not all characters will display properly in Windows. In fact, some characters will not display at all (though they do exist in the font). Unfortunately, this is due to certain character codes being reserved in Windows and there doesn't appear to be any way to work around it. The character codes affected are: $00-$1F (0-31), $7F-$81 (127-129), $8D-$90 (141-144), $9D (157), and $9F (158).
\par
\par Not all characters can be typed from the keyboard. You can however copy characters as needed from this document (see tables below). The Character Map desk accessory can help also.
\par
\par \plain\f4\fs16\cf0\b ATASCII CHARACTER SET TABLES
\par \plain\f4\fs16\cf0
\par In order to see the ATASCII character set with these tables, the Atari Classic TrueType fonts must be installed. Characters that are not displayed properly are due to character code usage differences between ATASCII and Windows (see above).
\par
\par
\par \plain\f4\fs16\cf0\b TABLE 1: ATASCII Character Dump Block
\par \plain\f4\fs16\cf0
\par All characters (ATASCII $00 thru $FF) 16 characters per
\par line.
\par
\par
\par \plain\f2\fs12\cf0 \'01\'02\'03\'04\'05\'06\'07\'08\tab
\par \'0b\'0c
\par \'0e\'0f
\par \'10\'11\'12\'13\'14\'15\'16\'17\'18\'19\'1a\'1b\'1c\'1d\'1e\'1f
\par !"#$%&'()*+,-./
\par 0123456789:;<=>?
\par @ABCDEFGHIJKLMNO
\par PQRSTUVWXYZ[\\]^_
\par `abcdefghijklmno
\par pqrstuvwxyz\{|\}~
\par \'80\'81\'82\'83\'84\'85\'86\'87\'88\'89\'8a\'8b\'8c\'8d\'8e\'8f
\par \'90''""\bullet \endash \emdash \'98\'99\'9a \'9c\'9d\'9e\'9f
\par \~\'a1\'a2\'a3\'a4\'a5\'a6\'a7\'a8\'a9\'aa\'ab\'ac\'ad\'ae\'af
\par \'b0\'b1\'b2\'b3\'b4\'b5\'b6\'b7\'b8\'b9\'ba\'bb\'bc\'bd\'be\'bf
\par \'c0\'c1\'c2\'c3\'c4\'c5\'c6\'c7\'c8\'c9\'ca\'cb\'cc\'cd\'ce\'cf
\par \'d0\'d1\'d2\'d3\'d4\'d5\'d6\'d7\'d8\'d9\'da\'db\'dc\'dd\'de\'df
\par \'e0\'e1\'e2\'e3\'e4\'e5\'e6\'e7\'e8\'e9\'ea\'eb\'ec\'ed\'ee\'ef
\par \'f0\'f1\'f2\'f3\'f4\'f5\'f6\'f7\'f8\'f9\'fa\'fb\'fc\'fd\'fe\'ff
\par \plain\f4\fs16\cf0
\par
\par \plain\f4\fs16\cf0\b TABLE 2: ATASCII Character Dump List
\par \plain\f4\fs16\cf0
\par All characters (ATASCII $00 thru $FF) one character per
\par line with hexadecimal value indicated on the left.
\par
\par \plain\f2\fs12\cf0 00=
\par 01=\'01
\par 02=\'02
\par 03=\'03
\par 04=\'04
\par 05=\'05
\par 06=\'06
\par 07=\'07
\par 08=\'08
\par 09=\tab
\par 0A=
\par
\par 0B=\'0b
\par 0C=\'0c
\par 0D=
\par 0E=\'0e
\par 0F=\'0f
\par 10=\'10
\par 11=\'11
\par 12=\'12
\par 13=\'13
\par 14=\'14
\par 15=\'15
\par 16=\'16
\par 17=\'17
\par 18=\'18
\par 19=\'19
\par 1A=\'1a
\par 1B=\'1b
\par 1C=\'1c
\par 1D=\'1d
\par 1E=\'1e
\par 1F=\'1f
\par 20=
\par 21=!
\par 22="
\par 23=#
\par 24=$
\par 25=%
\par 26=&
\par 27='
\par 28=(
\par 29=)
\par 2A=*
\par 2B=+
\par 2C=,
\par 2D=-
\par 2E=.
\par 2F=/
\par 30=0
\par 31=1
\par 32=2
\par 33=3
\par 34=4
\par 35=5
\par 36=6
\par 37=7
\par 38=8
\par 39=9
\par 3A=:
\par 3B=;
\par 3C=<
\par 3D==
\par 3E=>
\par 3F=?
\par 40=@
\par 41=A
\par 42=B
\par 43=C
\par 44=D
\par 45=E
\par 46=F
\par 47=G
\par 48=H
\par 49=I
\par 4A=J
\par 4B=K
\par 4C=L
\par 4D=M
\par 4E=N
\par 4F=O
\par 50=P
\par 51=Q
\par 52=R
\par 53=S
\par 54=T
\par 55=U
\par 56=V
\par 57=W
\par 58=X
\par 59=Y
\par 5A=Z
\par 5B=[
\par 5C=\\
\par 5D=]
\par 5E=^
\par 5F=_
\par 60=`
\par 61=a
\par 62=b
\par 63=c
\par 64=d
\par 65=e
\par 66=f
\par 67=g
\par 68=h
\par 69=i
\par 6A=j
\par 6B=k
\par 6C=l
\par 6D=m
\par 6E=n
\par 6F=o
\par 70=p
\par 71=q
\par 72=r
\par 73=s
\par 74=t
\par 75=u
\par 76=v
\par 77=w
\par 78=x
\par 79=y
\par 7A=z
\par 7B=\{
\par 7C=|
\par 7D=\}
\par 7E=~
\par 7F=
\par 80=\'80
\par 81=\'81
\par 82=\'82
\par 83=\'83
\par 84=\'84
\par 85=\'85
\par 86=\'86
\par 87=\'87
\par 88=\'88
\par 89=\'89
\par 8A=\'8a
\par 8B=\'8b
\par 8C=\'8c
\par 8D=\'8d
\par 8E=\'8e
\par 8F=\'8f
\par 90=\'90
\par 91='
\par 92='
\par 93="
\par 94="
\par 95=\bullet
\par 96=\endash
\par 97=\emdash
\par 98=\'98
\par 99=\'99
\par 9A=\'9a
\par 9B=
\par 9C=\'9c
\par 9D=\'9d
\par 9E=\'9e
\par 9F=\'9f
\par A0=\~
\par A1=\'a1
\par A2=\'a2
\par A3=\'a3
\par A4=\'a4
\par A5=\'a5
\par A6=\'a6
\par A7=\'a7
\par A8=\'a8
\par A9=\'a9
\par AA=\'aa
\par AB=\'ab
\par AC=\'ac
\par AD=\'ad
\par AE=\'ae
\par AF=\'af
\par B0=\'b0
\par B1=\'b1
\par B2=\'b2
\par B3=\'b3
\par B4=\'b4
\par B5=\'b5
\par B6=\'b6
\par B7=\'b7
\par B8=\'b8
\par B9=\'b9
\par BA=\'ba
\par BB=\'bb
\par BC=\'bc
\par BD=\'bd
\par BE=\'be
\par BF=\'bf
\par C0=\'c0
\par C1=\'c1
\par C2=\'c2
\par C3=\'c3
\par C4=\'c4
\par C5=\'c5
\par C6=\'c6
\par C7=\'c7
\par C8=\'c8
\par C9=\'c9
\par CA=\'ca
\par CB=\'cb
\par CC=\'cc
\par CD=\'cd
\par CE=\'ce
\par CF=\'cf
\par D0=\'d0
\par D1=\'d1
\par D2=\'d2
\par D3=\'d3
\par D4=\'d4
\par D5=\'d5
\par D6=\'d6
\par D7=\'d7
\par D8=\'d8
\par D9=\'d9
\par DA=\'da
\par DB=\'db
\par DC=\'dc
\par DD=\'dd
\par DE=\'de
\par DF=\'df
\par E0=\'e0
\par E1=\'e1
\par E2=\'e2
\par E3=\'e3
\par E4=\'e4
\par E5=\'e5
\par E6=\'e6
\par E7=\'e7
\par E8=\'e8
\par E9=\'e9
\par EA=\'ea
\par EB=\'eb
\par EC=\'ec
\par ED=\'ed
\par EE=\'ee
\par EF=\'ef
\par F0=\'f0
\par F1=\'f1
\par F2=\'f2
\par F3=\'f3
\par F4=\'f4
\par F5=\'f5
\par F6=\'f6
\par F7=\'f7
\par F8=\'f8
\par F9=\'f9
\par FA=\'fa
\par FB=\'fb
\par FC=\'fc
\par FD=\'fd
\par FE=\'fe
\par FF=\'ff
\par }

Binary file not shown.

View File

@ -0,0 +1,6 @@
Fonts in this package are (c) 2010 Style.
You MAY NOT: sell this font; include/redistribute this font in any font collection regardless of pricing; provide the font for direct download from any web site. You MAY: link to "http://style64.org/c64-truetype" in order for others to download and install the font; embed this font or its .eot and .woff variants without any modification and using the same filename it was provided with for display on any web site using @font-face rules; use this font in static images and vector art; include this font without any modification and using the same filename it was provided with as part of a software package but ONLY if said software package is freely provided to end users. You may also contact us to negotiate a (possibly commercial) license for your use outside of these guidelines at "http://style64.org/contact-style".
At all times the most recent version of this license can be found at "http://style64.org/c64-truetype/license".

View File

@ -0,0 +1,83 @@
package com.wudsn.ide.hex;
import java.io.File;
import java.io.IOException;
import java.net.URISyntaxException;
import java.net.URL;
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.Path;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.widgets.Display;
final class HexEditorFonts {
private Font atari8Font;
private Font c64Font;
public HexEditorFonts() {
}
public void init() {
Display display = HexPlugin.getInstance().getWorkbench().getDisplay();
// From http://members.bitstream.net/~marksim/atarimac/fonts.html
atari8Font = loadFont(display, "fonts/atari8/ATARCC__.TTF", "");
// From http://style64.org/c64-truetype
c64Font = loadFont(display, "fonts/c64/C64_Pro_v1.0-STYLE.ttf",
"C64 Pro Mono");
}
public void dispose() {
atari8Font.dispose();
c64Font.dispose();
}
public Font getFont() {
return atari8Font;
}
private Font loadFont(Display display, String fileName, String fontName) {
if (display == null) {
throw new IllegalArgumentException(
"Parameter 'display' must not be null.");
}
if (fileName == null) {
throw new IllegalArgumentException(
"Parameter 'fileName' must not be null.");
}
if (fontName == null) {
throw new IllegalArgumentException(
"Parameter 'fontName' must not be null.");
}
URL url;
url = FileLocator.find(HexPlugin.getInstance().getBundle(), new Path(
fileName), null);
try {
url = FileLocator.toFileURL(url);
} catch (IOException ex) {
throw new IllegalArgumentException("Cannot load font from '"
+ fileName + "'.", ex);
}
try {
File file = new File(url.toURI());
fileName = file.getAbsolutePath();
} catch (URISyntaxException ex) {
throw new IllegalArgumentException("Cannot load font from '"
+ fileName + "'.", ex);
}
int fontSize = 8;
if (display.loadFont(fileName)) {
Font result = new Font(display, fontName, fontSize, SWT.NORMAL);
return result;
}
throw new IllegalArgumentException("Cannot load font from '" + fileName
+ "'.");
}
}

View File

@ -0,0 +1,52 @@
package com.wudsn.ide.hex;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
/**
* The activator class controls the plug-in life cycle
*/
public class HexPlugin extends AbstractUIPlugin {
// The plug-in ID
public static final String PLUGIN_ID = "com.wudsn.ide.hex"; //$NON-NLS-1$
// The shared instance
private static HexPlugin plugin;
/**
* The constructor
*/
public HexPlugin() {
}
/*
* (non-Javadoc)
* @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
*/
@Override
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
}
/*
* (non-Javadoc)
* @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
*/
@Override
public void stop(BundleContext context) throws Exception {
plugin = null;
super.stop(context);
}
/**
* Returns the shared instance
*
* @return the shared instance
*/
public static HexPlugin getInstance() {
return plugin;
}
}