Skip to content

Commit

Permalink
Code formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
EgonOlsen committed Dec 27, 2019
1 parent b7d8d6f commit 54df176
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 26 deletions.
Binary file modified dist/basicv2.jar
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ protected void addLabels(List<String> res, String[] labels) {
res.add(label);
}
}

protected void addMemoryLocations(List<String> res) {
String[] labels = Loader.loadProgram(TransformerX16.class.getResourceAsStream("/rommap/memloc-c64.map"));
addLabels(res, labels);
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/sixtyfour/cbmnative/shell/MoSpeedCL.java
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public static void main(String[] args) {

PlatformProvider platform = new Platform64();
String appendix = ".prg";
boolean multiByteTokens=false;
boolean multiByteTokens = false;
if (cmds.containsKey("platform")) {
String pl = cmds.get("platform");
if (pl.equalsIgnoreCase("c64")) {
Expand All @@ -137,7 +137,7 @@ public static void main(String[] args) {
platform = new PlatformX16();
Basic.registerExtension(new X16Extensions());
cfg.setNonDecimalNumbersAware(true);
multiByteTokens=true;
multiByteTokens = true;
appendix = ".prg";
} else if (pl.equalsIgnoreCase("ps")) {
platform = new PlatformPs();
Expand Down
11 changes: 3 additions & 8 deletions src/main/java/com/sixtyfour/elements/Variable.java
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,9 @@ public Variable(String name, Object value) {
findType(c);

if (type == null) {
int pos = woa.indexOf("{");
if (pos != -1) {
// This is trying to detect the type of something like L${T4}, which actually shouldn't occur
// in the first place, but for some reason still does.
c = woa.substring(pos - 1, pos).charAt(0);
findType(c);
}
if (type == null) {
if (!Character.isAlphabetic(c) && !Character.isDigit(c)) {
throw new RuntimeException("Syntax error: " + name + "/" + woa);
} else {
throw new RuntimeException("Unknown variable type for: " + name + "/" + woa);
}
}
Expand Down
10 changes: 7 additions & 3 deletions src/main/java/com/sixtyfour/extensions/x16/functions/Joy.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,13 @@ public String toCode(Machine machine) {
public int getParameterCount() {
return 1;
}

/* (non-Javadoc)
* @see com.sixtyfour.elements.functions.AbstractFunction#addNativeFunctionCall(java.util.List)

/*
* (non-Javadoc)
*
* @see
* com.sixtyfour.elements.functions.AbstractFunction#addNativeFunctionCall(java.
* util.List)
*/
@Override
public boolean addNativeFunctionCall(List<String> code) {
Expand Down
14 changes: 7 additions & 7 deletions src/main/java/com/sixtyfour/parser/cbmnative/UnTokenizer.java
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public class UnTokenizer {
this.put(201, "RIGHT$");
this.put(202, "MID$");
this.put(203, "GO");

// Add X16-Tokens to the mix...
this.putAll(X16Extensions.getTokens());
}
Expand Down Expand Up @@ -138,18 +138,18 @@ public List<String> getText(byte[] program, boolean multiByte) {
if (c == '"') {
inString = !inString;
}
if (b < 128 || inString || (b > 203 && (!multiByte || b!=206))) {
if (b < 128 || inString || (b > 203 && (!multiByte || b != 206))) {
if (inString && isSpecialChar(c)) {
line.append(ControlCodes.getPlaceHolder(b));
} else {
line.append(convertChar(c));
}
} else {
String token = TOKENS.get(b);
if (multiByte && b==206) {
int mb = b*256+(program[(addr++) - start] & 0xff);
token=TOKENS.get(mb);
}
String token = TOKENS.get(b);
if (multiByte && b == 206) {
int mb = b * 256 + (program[(addr++) - start] & 0xff);
token = TOKENS.get(mb);
}
if (token == null) {
throw new RuntimeException("Unknown token: " + b);
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/sixtyfour/util/rommap/CallMapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public static Mapping mapCalls(CompilerConfig config, boolean verbose) {
}
mappedCalls.put(uLabel, "$" + newAddr.toUpperCase(Locale.ENGLISH));
}

if (verbose) {
Logger.log("---------------------------------------------------------");
}
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/com/sixtyfour/util/rommap/MapLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@ public static Map<String, String> getRomCalls(InputStream file) {
String[] lines = Loader.loadProgram(file);
for (String line : lines) {
String[] parts = line.split("=");
if (parts.length<2) {
if (parts.length < 2) {
continue;
}
String label = parts[0].trim();
String addr = parts[1].trim();
int pos=addr.indexOf(";");
if (pos!=-1) {
addr=addr.substring(0, pos).trim();
int pos = addr.indexOf(";");
if (pos != -1) {
addr = addr.substring(0, pos).trim();
}
if (addr.startsWith("$")) {
addr = addr.substring(1);
Expand Down

0 comments on commit 54df176

Please sign in to comment.