Skip to content

Commit a020994

Browse files
committed
Implemented object tree navigation in program information dialog
1 parent 1a9451d commit a020994

15 files changed

Lines changed: 439 additions & 371 deletions

spin-tools/src/main/java/com/maccasoft/propeller/Compiler.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,4 +323,8 @@ public Map<String, List<Token>> getDefines() {
323323
return defines;
324324
}
325325

326+
protected void linkObjects(int memoryOffset, ObjectCompiler objectCompiler) {
327+
328+
}
329+
326330
}

spin-tools/src/main/java/com/maccasoft/propeller/P1MemoryDialog.java

Lines changed: 214 additions & 197 deletions
Large diffs are not rendered by default.

spin-tools/src/main/java/com/maccasoft/propeller/P2MemoryDialog.java

Lines changed: 200 additions & 151 deletions
Large diffs are not rendered by default.

spin-tools/src/main/java/com/maccasoft/propeller/SpinCompiler.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,8 @@ Options createOptions() {
191191
binaryOptions.addOption(new Option("e", false, "output flash binary file (P2 only)"));
192192
binaryOptions.addOption(new Option("c", false, "output only DAT sections"));
193193
options.addOptionGroup(binaryOptions);
194-
options.addOption(new Option("l", false, "output listing file"));
195-
options.addOption(new Option("d", false, "enable debug (P2 only)"));
194+
options.addOption(new Option("l", "list", false, "output listing file"));
195+
options.addOption(new Option("d", "debug", false, "enable debug (P2 only)"));
196196
options.addOption(new Option("z", false, "compress binary (P2 only)"));
197197

198198
OptionGroup targetOptions = new OptionGroup();

spin-tools/src/main/java/com/maccasoft/propeller/SpinObject.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,7 @@ public void generateListing(int address, int offset, PrintStream ps) {
362362
}
363363

364364
File file;
365+
int address;
365366

366367
int clkfreq;
367368
int clkmode;
@@ -376,18 +377,19 @@ public SpinObject() {
376377

377378
}
378379

379-
public SpinObject(File file) {
380+
public SpinObject(File file, int address) {
380381
this.file = file;
381-
}
382-
383-
public String getName() {
384-
return file != null ? file.getName() : null;
382+
this.address = address;
385383
}
386384

387385
public File getFile() {
388386
return file;
389387
}
390388

389+
public int getAddress() {
390+
return address;
391+
}
392+
391393
public void addChildObject(SpinObject object) {
392394
for (SpinObject child : childObjects) {
393395
if (child == object) {

spin-tools/src/main/java/com/maccasoft/propeller/spin1/Spin1Compiler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public void addDefine(String identifier, String value) {
8484
public Spin1Object compile(File file, String text) {
8585
Spin1Object obj = compileObject(file, text);
8686

87-
Spin1Object object = new Spin1Object(file);
87+
Spin1Object object = new Spin1Object(file, 0);
8888
for (SpinObject child : obj.getChildObjects()) {
8989
object.addChildObject(child);
9090
}

spin-tools/src/main/java/com/maccasoft/propeller/spin1/Spin1Object.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ public Spin1Object() {
6262

6363
}
6464

65-
public Spin1Object(File file) {
66-
super(file);
65+
public Spin1Object(File file, int address) {
66+
super(file, address);
6767
}
6868

6969
public int getDcurr() {

spin-tools/src/main/java/com/maccasoft/propeller/spin1/Spin1ObjectCompiler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ public int getVarSize() {
489489

490490
@Override
491491
public Spin1Object generateObject(int memoryOffset) {
492-
Spin1Object object = new Spin1Object(getFile());
492+
Spin1Object object = new Spin1Object(getFile(), memoryOffset);
493493

494494
object.setClkFreq(clkFreq);
495495
object.setClkMode(clkMode);

spin-tools/src/main/java/com/maccasoft/propeller/spin2/Spin2Compiler.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,13 +103,11 @@ Spin2Object compileObject(File file, String text) {
103103
}
104104

105105
Spin2Object object = objectCompiler.generateObject(memoryOffset);
106-
memoryOffset += object.getSize();
107106

108107
for (ObjectInfo info : childObjects) {
109108
info.offset = object.getSize();
110-
info.object = info.compiler.generateObject(memoryOffset);
109+
info.object = info.compiler.generateObject(memoryOffset + object.getSize());
111110
object.writeObject(info.object);
112-
memoryOffset += info.object.getSize();
113111
}
114112

115113
for (ObjectInfo info : childObjects) {

spin-tools/src/main/java/com/maccasoft/propeller/spin2/Spin2Object.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ public Spin2Object() {
9595

9696
}
9797

98-
public Spin2Object(File file) {
99-
super(file);
98+
public Spin2Object(File file, int address) {
99+
super(file, address);
100100
}
101101

102102
public void setClockSetter(boolean clockSetter) {

0 commit comments

Comments
 (0)