From 2f9bf2051cebd979e882d05f94a1d3d0da7601c6 Mon Sep 17 00:00:00 2001 From: peterdell Date: Sun, 26 Sep 2021 22:57:39 +0200 Subject: [PATCH] First commit of new com.wudsn.ide.lng.run plugin --- com.wudsn.ide.lng.run/.classpath | 7 + com.wudsn.ide.lng.run/.gitignore | 1 + com.wudsn.ide.lng.run/.project | 28 ++++ .../.settings/org.eclipse.jdt.core.prefs | 9 ++ com.wudsn.ide.lng.run/META-INF/MANIFEST.MF | 9 ++ .../OSGI-INF/l10n/bundle.properties | 39 +++++ .../OSGI-INF/l10n/bundle_de_DE.properties | 39 +++++ com.wudsn.ide.lng.run/build.properties | 7 + com.wudsn.ide.lng.run/plugin.xml | 146 ++++++++++++++++++ .../com/wudsn/ide/lng/run/atari8/Altirra.java | 78 ++++++++++ .../wudsn/ide/lng/run/atari8/Atari800Win.java | 32 ++++ 11 files changed, 395 insertions(+) create mode 100644 com.wudsn.ide.lng.run/.classpath create mode 100644 com.wudsn.ide.lng.run/.gitignore create mode 100644 com.wudsn.ide.lng.run/.project create mode 100644 com.wudsn.ide.lng.run/.settings/org.eclipse.jdt.core.prefs create mode 100644 com.wudsn.ide.lng.run/META-INF/MANIFEST.MF create mode 100644 com.wudsn.ide.lng.run/OSGI-INF/l10n/bundle.properties create mode 100644 com.wudsn.ide.lng.run/OSGI-INF/l10n/bundle_de_DE.properties create mode 100644 com.wudsn.ide.lng.run/build.properties create mode 100644 com.wudsn.ide.lng.run/plugin.xml create mode 100644 com.wudsn.ide.lng.run/src/com/wudsn/ide/lng/run/atari8/Altirra.java create mode 100644 com.wudsn.ide.lng.run/src/com/wudsn/ide/lng/run/atari8/Atari800Win.java diff --git a/com.wudsn.ide.lng.run/.classpath b/com.wudsn.ide.lng.run/.classpath new file mode 100644 index 00000000..ca3785c4 --- /dev/null +++ b/com.wudsn.ide.lng.run/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/com.wudsn.ide.lng.run/.gitignore b/com.wudsn.ide.lng.run/.gitignore new file mode 100644 index 00000000..ae3c1726 --- /dev/null +++ b/com.wudsn.ide.lng.run/.gitignore @@ -0,0 +1 @@ +/bin/ diff --git a/com.wudsn.ide.lng.run/.project b/com.wudsn.ide.lng.run/.project new file mode 100644 index 00000000..f1c06860 --- /dev/null +++ b/com.wudsn.ide.lng.run/.project @@ -0,0 +1,28 @@ + + + com.wudsn.ide.lng.run + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/com.wudsn.ide.lng.run/.settings/org.eclipse.jdt.core.prefs b/com.wudsn.ide.lng.run/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000..bd1095bb --- /dev/null +++ b/com.wudsn.ide.lng.run/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,9 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=11 +org.eclipse.jdt.core.compiler.compliance=11 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/com.wudsn.ide.lng.run/META-INF/MANIFEST.MF b/com.wudsn.ide.lng.run/META-INF/MANIFEST.MF new file mode 100644 index 00000000..22c5b749 --- /dev/null +++ b/com.wudsn.ide.lng.run/META-INF/MANIFEST.MF @@ -0,0 +1,9 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: WUDSN IDE Runners Plugin +Bundle-SymbolicName: com.wudsn.ide.lng.run;singleton:=true +Bundle-Version: 1.7.2.qualifier +Bundle-Vendor: Peter Dell +Automatic-Module-Name: com.wudsn.ide.lng.run +Bundle-RequiredExecutionEnvironment: JavaSE-11 +Require-Bundle: com.wudsn.ide.lng diff --git a/com.wudsn.ide.lng.run/OSGI-INF/l10n/bundle.properties b/com.wudsn.ide.lng.run/OSGI-INF/l10n/bundle.properties new file mode 100644 index 00000000..cf220eee --- /dev/null +++ b/com.wudsn.ide.lng.run/OSGI-INF/l10n/bundle.properties @@ -0,0 +1,39 @@ +# +# Hardware: APPLE2 +# +com.wudsn.ide.lng.run.apple2.applewin.name=AppleWin +com.wudsn.ide.lng.run.apple2.jace.name=JACE +com.wudsn.ide.lng.run.apple2.virtu.name=Virtu +com.wudsn.ide.lng.run.apple2.virtualii.name=Virtual ][ + +# +# Hardware: ATARI2600 +# +com.wudsn.ide.lng.run.atari2600.stella.name=Stella + +# +# Hardware: ATARI7800 +# +com.wudsn.ide.lng.run.atari7800.emu7800.name=EMU7800 + +# +# Hardware: ATARI8 +# +com.wudsn.ide.lng.run.atari8.atari800.name=Atari800 +com.wudsn.ide.lng.run.atari8.atari800_win.name=Atari800Win +com.wudsn.ide.lng.run.atari8.atari800_macx.name=Atari800MacX +com.wudsn.ide.lng.run.atari8.altirra.name=Altirra +com.wudsn.ide.lng.run.atari8.atari_plus_plus.name=Atari++ + +# +# Hardware: C64 +# +com.wudsn.ide.lng.run.c64.ccs64.name=CCS64 +com.wudsn.ide.lng.run.c64.vice.name=VICE + +# +# Hardware: NES +# +com.wudsn.ide.lng.run.nes.bsnes.name=BSNES +com.wudsn.ide.lng.run.nes.fceux.name=FCEUX +com.wudsn.ide.lng.run.nes.nintendulator.name=Nintendulator \ No newline at end of file diff --git a/com.wudsn.ide.lng.run/OSGI-INF/l10n/bundle_de_DE.properties b/com.wudsn.ide.lng.run/OSGI-INF/l10n/bundle_de_DE.properties new file mode 100644 index 00000000..cf220eee --- /dev/null +++ b/com.wudsn.ide.lng.run/OSGI-INF/l10n/bundle_de_DE.properties @@ -0,0 +1,39 @@ +# +# Hardware: APPLE2 +# +com.wudsn.ide.lng.run.apple2.applewin.name=AppleWin +com.wudsn.ide.lng.run.apple2.jace.name=JACE +com.wudsn.ide.lng.run.apple2.virtu.name=Virtu +com.wudsn.ide.lng.run.apple2.virtualii.name=Virtual ][ + +# +# Hardware: ATARI2600 +# +com.wudsn.ide.lng.run.atari2600.stella.name=Stella + +# +# Hardware: ATARI7800 +# +com.wudsn.ide.lng.run.atari7800.emu7800.name=EMU7800 + +# +# Hardware: ATARI8 +# +com.wudsn.ide.lng.run.atari8.atari800.name=Atari800 +com.wudsn.ide.lng.run.atari8.atari800_win.name=Atari800Win +com.wudsn.ide.lng.run.atari8.atari800_macx.name=Atari800MacX +com.wudsn.ide.lng.run.atari8.altirra.name=Altirra +com.wudsn.ide.lng.run.atari8.atari_plus_plus.name=Atari++ + +# +# Hardware: C64 +# +com.wudsn.ide.lng.run.c64.ccs64.name=CCS64 +com.wudsn.ide.lng.run.c64.vice.name=VICE + +# +# Hardware: NES +# +com.wudsn.ide.lng.run.nes.bsnes.name=BSNES +com.wudsn.ide.lng.run.nes.fceux.name=FCEUX +com.wudsn.ide.lng.run.nes.nintendulator.name=Nintendulator \ No newline at end of file diff --git a/com.wudsn.ide.lng.run/build.properties b/com.wudsn.ide.lng.run/build.properties new file mode 100644 index 00000000..385a1a4e --- /dev/null +++ b/com.wudsn.ide.lng.run/build.properties @@ -0,0 +1,7 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + plugin.xml,\ + OSGI-INF/,\ + bin/ diff --git a/com.wudsn.ide.lng.run/plugin.xml b/com.wudsn.ide.lng.run/plugin.xml new file mode 100644 index 00000000..b4565029 --- /dev/null +++ b/com.wudsn.ide.lng.run/plugin.xml @@ -0,0 +1,146 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/com.wudsn.ide.lng.run/src/com/wudsn/ide/lng/run/atari8/Altirra.java b/com.wudsn.ide.lng.run/src/com/wudsn/ide/lng/run/atari8/Altirra.java new file mode 100644 index 00000000..764defd3 --- /dev/null +++ b/com.wudsn.ide.lng.run/src/com/wudsn/ide/lng/run/atari8/Altirra.java @@ -0,0 +1,78 @@ +/** + * Copyright (C) 2009 - 2021 Peter Dell + * + * This file is part of WUDSN IDE. + * + * WUDSN IDE 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. + * + * WUDSN IDE 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. + * + * You should have received a copy of the GNU General Public License + * along with WUDSN IDE. If not, see . + */ + +package com.wudsn.ide.lng.run.atari8; + +import java.io.File; + +import org.eclipse.core.resources.IMarker; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.debug.core.model.IBreakpoint; + +import com.wudsn.ide.lng.breakpoint.LanguageBreakpoint; +import com.wudsn.ide.lng.compiler.CompilerFiles; +import com.wudsn.ide.lng.runner.Runner; + +/** + * Runner for Altirra 2.0 and above which support source line breakpoints. + * + * @author Peter Dell + * @since 1.6.1 + */ +public final class Altirra extends Runner { + + @Override + public File createBreakpointsFile(CompilerFiles files) { + if (files == null) { + throw new IllegalArgumentException("Parameter 'files' must not be null."); + } + return new File(files.outputFilePathWithoutExtension + ".atdbg"); + } + + @Override + public int createBreakpointsFileContent(LanguageBreakpoint[] breakpoints, StringBuilder breakpointBuilder) { + if (breakpoints == null) { + throw new IllegalArgumentException("Parameter 'breakpoints' must not be null."); + } + int activeBreakpoints = 0; + breakpointBuilder.append(".sourcemode on\n"); + breakpointBuilder.append(".echo\n"); + breakpointBuilder.append(".echo \"Loading executable...\"\n"); + breakpointBuilder.append(".echo\n"); + breakpointBuilder.append("bc *\n"); + breakpointBuilder.append(".onexerun .echo \"Launching executable...\"\n"); + for (IBreakpoint breakpoint : breakpoints) { + try { + if (breakpoint.isEnabled()) { + LanguageBreakpoint assemberBreakpoint = (LanguageBreakpoint) breakpoint; + IMarker marker = breakpoint.getMarker(); + String sourceFilePath = marker.getResource().getLocation().toOSString(); + breakpointBuilder + .append("bp \"`" + sourceFilePath + ":" + assemberBreakpoint.getLineNumber() + "`\"\n"); + activeBreakpoints++; + } + } catch (CoreException ex) { + throw new RuntimeException(ex); + } + + } + return activeBreakpoints; + } + +} diff --git a/com.wudsn.ide.lng.run/src/com/wudsn/ide/lng/run/atari8/Atari800Win.java b/com.wudsn.ide.lng.run/src/com/wudsn/ide/lng/run/atari8/Atari800Win.java new file mode 100644 index 00000000..a46b92fa --- /dev/null +++ b/com.wudsn.ide.lng.run/src/com/wudsn/ide/lng/run/atari8/Atari800Win.java @@ -0,0 +1,32 @@ +/** + * Copyright (C) 2009 - 2021 Peter Dell + * + * This file is part of WUDSN IDE. + * + * WUDSN IDE 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. + * + * WUDSN IDE 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. + * + * You should have received a copy of the GNU General Public License + * along with WUDSN IDE. If not, see . + */ + +package com.wudsn.ide.lng.run.atari8; + +import com.wudsn.ide.lng.runner.Runner; + +/** + * Runner for Atar800Win. + * + * @author Peter Dell + * @since 1.7.0. + */ +public final class Atari800Win extends Runner { + +}