mirror of
https://github.com/simon987/Much-Assembly-Required.git
synced 2025-04-10 14:26:45 +00:00
Merge branch 'master' into Missing-aliases-for-Jcc-instruction-family-#190
This commit is contained in:
commit
aed7b359b0
@ -125,6 +125,9 @@ public class CubotLidar extends HardwareModule {
|
||||
getCpu().getRegisterSet().getRegister("X").setValue(unit.getWorld().getX());
|
||||
getCpu().getRegisterSet().getRegister("Y").setValue(unit.getWorld().getY());
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -156,6 +156,9 @@ public class VaultWorldGenerator {
|
||||
map.setTileAt(floorTile, 1, worldSize / 2 - 1);
|
||||
roomCenters.add(new Point(1, worldSize / 2 - 1));
|
||||
break;
|
||||
default:
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -9,7 +9,7 @@ In its current state, players can walk around the game universe and collect Biom
|
||||

|
||||
|
||||
Wiki: [GitHub](https://github.com/simon987/Much-Assembly-Required/wiki)
|
||||
Chat: [Slack](https://join.slack.com/t/muchassemblyrequired/shared_invite/enQtMjY3Mjc1OTUwNjEwLTkyOTIwOTA5OGY4MDVlMGI4NzM5YzlhMWJiMGY1OWE2NjUxODQ1NWQ1YTcxMTA1NGZkYzNjYzMyM2E1ODdmNzg)
|
||||
Chat: [Slack](https://join.slack.com/t/muchassemblyrequired/shared_invite/enQtMjY3Mjc1OTUwNjEwLWRjMjRkZTg2N2EyNWRjN2YyMDc0YzIyMTUyYzFiNTBmMTU3OGQ1ZjA0MWY0M2IyYjUxZTA4NjRkMWVkNDk2NzY)
|
||||
|
||||
# Deploying the server
|
||||
|
||||
|
@ -170,7 +170,7 @@ public class Assembler {
|
||||
} catch (IllegalArgumentException e) {
|
||||
throw new InvalidOperandException(
|
||||
"Invalid string operand \"" + string + "\": " + e.getMessage(),
|
||||
currentLine);
|
||||
currentLine);
|
||||
}
|
||||
|
||||
out.write(string.getBytes(StandardCharsets.UTF_16BE));
|
||||
@ -220,6 +220,17 @@ public class Assembler {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse the DW instruction (Define word). Handles DUP operator
|
||||
*
|
||||
* @param line Current line. assuming that comments and labels are removed
|
||||
* @param currentLine Current line number
|
||||
* @return Encoded instruction, null if the line is not a DW instruction
|
||||
*/
|
||||
private static byte[] parseDWInstruction(String line, int currentLine) throws AssemblyException {
|
||||
return parseDWInstruction(line, null, currentLine);
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse the dup operator
|
||||
*
|
||||
@ -271,17 +282,6 @@ public class Assembler {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse the DW instruction (Define word). Handles DUP operator
|
||||
*
|
||||
* @param line Current line. assuming that comments and labels are removed
|
||||
* @param currentLine Current line number
|
||||
* @return Encoded instruction, null if the line is not a DW instruction
|
||||
*/
|
||||
private static byte[] parseDWInstruction(String line, int currentLine) throws AssemblyException {
|
||||
return parseDWInstruction(line, null, currentLine);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check for and handle section declarations (.text and .data)
|
||||
*
|
||||
@ -318,7 +318,7 @@ public class Assembler {
|
||||
/* the EQU pseudo instruction is equivalent to the #define compiler directive in C/C++
|
||||
* usage: constant_name EQU <immediate_value>
|
||||
* A constant treated the same way as a label.
|
||||
*/
|
||||
*/
|
||||
line = line.trim();
|
||||
String[] tokens = line.split("\\s+");
|
||||
|
||||
@ -362,7 +362,47 @@ public class Assembler {
|
||||
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
||||
|
||||
//Pass 1: Get code origin
|
||||
for (currentLine = 0; currentLine < lines.length; currentLine++) {
|
||||
getCodeOrigin(lines, result);
|
||||
//Pass 2: Save label names and location
|
||||
saveLabelNamesAndLocation(lines, result);
|
||||
//Pass 3: encode instructions
|
||||
encodeInstructions(lines, result, out);
|
||||
|
||||
|
||||
//If the code contains OffsetOverFlowException(s), don't bother writing the assembled bytes to memory
|
||||
boolean writeToMemory = true;
|
||||
for (Exception e : result.exceptions) {
|
||||
if (e instanceof OffsetOverflowException) {
|
||||
writeToMemory = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (writeToMemory) {
|
||||
result.bytes = out.toByteArray();
|
||||
} else {
|
||||
result.bytes = new byte[0];
|
||||
LogManager.LOGGER.fine("Skipping writing assembled bytes to memory. (OffsetOverflowException)");
|
||||
}
|
||||
|
||||
try {
|
||||
out.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
LogManager.LOGGER.info("Assembled " + result.bytes.length + " bytes (" + result.exceptions.size() + " errors)");
|
||||
for (AssemblyException e : result.exceptions) {
|
||||
LogManager.LOGGER.severe(e.getMessage() + '@' + e.getLine());
|
||||
}
|
||||
LogManager.LOGGER.info('\n' + Util.toHex(result.bytes));
|
||||
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
private void getCodeOrigin(String[] lines, AssemblyResult result) {
|
||||
for (int currentLine = 0; currentLine < lines.length; currentLine++) {
|
||||
try {
|
||||
checkForORGInstruction(lines[currentLine], result, currentLine);
|
||||
|
||||
@ -373,10 +413,11 @@ public class Assembler {
|
||||
//Ignore error
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Pass 2: Save label names and location
|
||||
private void saveLabelNamesAndLocation(String[] lines, AssemblyResult result) {
|
||||
int currentOffset = 0;
|
||||
for (currentLine = 0; currentLine < lines.length; currentLine++) {
|
||||
for (int currentLine = 0; currentLine < lines.length; currentLine++) {
|
||||
try {
|
||||
checkForLabel(lines[currentLine], result, (char)currentOffset);
|
||||
|
||||
@ -394,11 +435,11 @@ public class Assembler {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//Pass 3: encode instructions
|
||||
currentOffset = 0;
|
||||
for (currentLine = 0; currentLine < lines.length; currentLine++) {
|
||||
private void encodeInstructions(String[] lines, AssemblyResult result, ByteArrayOutputStream out) {
|
||||
int currentOffset = 0;
|
||||
for (int currentLine = 0; currentLine < lines.length; currentLine++) {
|
||||
|
||||
String line = lines[currentLine];
|
||||
|
||||
@ -439,36 +480,6 @@ public class Assembler {
|
||||
ioE.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
//If the code contains OffsetOverFlowException(s), don't bother writing the assembled bytes to memory
|
||||
boolean writeToMemory = true;
|
||||
for (Exception e : result.exceptions) {
|
||||
if (e instanceof OffsetOverflowException) {
|
||||
writeToMemory = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (writeToMemory) {
|
||||
result.bytes = out.toByteArray();
|
||||
} else {
|
||||
result.bytes = new byte[0];
|
||||
LogManager.LOGGER.fine("Skipping writing assembled bytes to memory. (OffsetOverflowException)");
|
||||
}
|
||||
|
||||
try {
|
||||
out.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
LogManager.LOGGER.info("Assembled " + result.bytes.length + " bytes (" + result.exceptions.size() + " errors)");
|
||||
for (AssemblyException e : result.exceptions) {
|
||||
LogManager.LOGGER.severe(e.getMessage() + '@' + e.getLine());
|
||||
}
|
||||
LogManager.LOGGER.info('\n' + Util.toHex(result.bytes));
|
||||
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -236,104 +236,11 @@ public class CPU implements MongoSerializable {
|
||||
ip++;
|
||||
instruction.execute(status);
|
||||
} else if (source == Operand.IMMEDIATE_VALUE) {
|
||||
ip++;
|
||||
int sourceValue = memory.get(ip);
|
||||
|
||||
if (destination == 0) {
|
||||
//Single operand
|
||||
ip++;
|
||||
instruction.execute(sourceValue, status);
|
||||
} else if (destination == Operand.IMMEDIATE_VALUE) {
|
||||
//Destination is an immediate value too
|
||||
//this shouldn't happen
|
||||
LogManager.LOGGER.severe("Trying to execute an instruction with 2" +
|
||||
"immediate values as operands"); //todo remove debug info
|
||||
|
||||
} else if (destination == Operand.IMMEDIATE_VALUE_MEM) {
|
||||
//Destination is memory immediate
|
||||
ip += 2;
|
||||
instruction.execute(memory, memory.get(ip - 1), sourceValue, status);
|
||||
} else if (destination <= registerSetSize) {
|
||||
//Destination is a register
|
||||
ip++;
|
||||
instruction.execute(registerSet, destination, sourceValue, status);
|
||||
|
||||
} else if (destination <= registerSetSize * 2) {
|
||||
//Destination is [reg]
|
||||
ip++;
|
||||
instruction.execute(memory, registerSet.get(destination - registerSetSize), sourceValue, status);
|
||||
} else {
|
||||
//Assuming that destination is [reg + x]
|
||||
ip += 2;
|
||||
instruction.execute(memory, registerSet.get(destination - registerSetSize - registerSetSize) + memory.get(ip - 1),
|
||||
sourceValue, status);
|
||||
}
|
||||
|
||||
executeImmediateValue(instruction, source, destination);
|
||||
} else if (source == Operand.IMMEDIATE_VALUE_MEM) {
|
||||
//Source is [x]
|
||||
ip++;
|
||||
int sourceValue = memory.get(memory.get(ip));
|
||||
|
||||
if (destination == 0) {
|
||||
//Single operand
|
||||
ip++;
|
||||
instruction.execute(memory, memory.get(ip - 1), status);
|
||||
} else if (destination == Operand.IMMEDIATE_VALUE) {
|
||||
//Destination is an immediate value
|
||||
|
||||
//this shouldn't happen
|
||||
LogManager.LOGGER.severe("Trying to execute an instruction with an" +
|
||||
"immediate values as dst operand"); //todo remove debug info
|
||||
} else if (destination == Operand.IMMEDIATE_VALUE_MEM) {
|
||||
//Destination is memory immediate too
|
||||
ip += 2;
|
||||
instruction.execute(memory, memory.get(ip - 1), sourceValue, status);
|
||||
} else if (destination <= registerSetSize) {
|
||||
//Destination is a register
|
||||
ip++;
|
||||
instruction.execute(registerSet, destination, sourceValue, status);
|
||||
} else if (destination <= registerSetSize * 2) {
|
||||
//Destination is [reg]
|
||||
ip++;
|
||||
instruction.execute(memory, registerSet.get(destination - registerSetSize), sourceValue, status);
|
||||
} else {
|
||||
//Assuming that destination is [reg + x]
|
||||
ip += 2;
|
||||
instruction.execute(memory, registerSet.get(destination - registerSetSize - registerSetSize) + memory.get(ip - 1), sourceValue, status);
|
||||
}
|
||||
|
||||
executeImmediateValueMem(instruction, source, destination);
|
||||
} else if (source <= registerSetSize) {
|
||||
//Source is a register
|
||||
|
||||
if (destination == 0) {
|
||||
//Single operand
|
||||
ip++;
|
||||
instruction.execute(registerSet, source, status);
|
||||
|
||||
} else if (destination == Operand.IMMEDIATE_VALUE) {
|
||||
//Destination is an immediate value
|
||||
//this shouldn't happen
|
||||
LogManager.LOGGER.severe("Trying to execute an instruction with an" +
|
||||
"immediate values as dst operand"); //todo remove debug info
|
||||
} else if (destination == Operand.IMMEDIATE_VALUE_MEM) {
|
||||
//Destination is memory immediate
|
||||
ip += 2;
|
||||
instruction.execute(memory, memory.get(ip - 1), registerSet, source, status);
|
||||
} else if (destination <= registerSetSize) {
|
||||
//Destination is a register too
|
||||
ip++;
|
||||
instruction.execute(registerSet, destination, registerSet, source, status);
|
||||
} else if (destination <= registerSetSize * 2) {
|
||||
//Destination is [reg]
|
||||
ip++;
|
||||
instruction.execute(memory, registerSet.get(destination - registerSetSize), registerSet, source, status);
|
||||
} else {
|
||||
//Assuming that destination is [reg + x]
|
||||
ip += 2;
|
||||
instruction.execute(memory, registerSet.get(destination - registerSetSize - registerSetSize) + memory.get(ip - 1),
|
||||
registerSet, source, status);
|
||||
}
|
||||
|
||||
executeSourceIsRegister(instruction, source, destination);
|
||||
} else if (source <= registerSetSize * 2) {
|
||||
//Source is [reg]
|
||||
if (destination == 0) {
|
||||
@ -403,6 +310,107 @@ public class CPU implements MongoSerializable {
|
||||
}
|
||||
}
|
||||
|
||||
private void executeSourceIsRegister(Instruction instruction, int source, int destination) {
|
||||
//Source is a register
|
||||
if (destination == 0) {
|
||||
//Single operand
|
||||
ip++;
|
||||
instruction.execute(registerSet, source, status);
|
||||
|
||||
} else if (destination == Operand.IMMEDIATE_VALUE) {
|
||||
//Destination is an immediate value
|
||||
//this shouldn't happen
|
||||
LogManager.LOGGER.severe("Trying to execute an instruction with an" +
|
||||
"immediate values as dst operand"); //todo remove debug info
|
||||
} else if (destination == Operand.IMMEDIATE_VALUE_MEM) {
|
||||
//Destination is memory immediate
|
||||
ip += 2;
|
||||
instruction.execute(memory, memory.get(ip - 1), registerSet, source, status);
|
||||
} else if (destination <= registerSetSize) {
|
||||
//Destination is a register too
|
||||
ip++;
|
||||
instruction.execute(registerSet, destination, registerSet, source, status);
|
||||
} else if (destination <= registerSetSize * 2) {
|
||||
//Destination is [reg]
|
||||
ip++;
|
||||
instruction.execute(memory, registerSet.get(destination - registerSetSize), registerSet, source, status);
|
||||
} else {
|
||||
//Assuming that destination is [reg + x]
|
||||
ip += 2;
|
||||
instruction.execute(memory, registerSet.get(destination - registerSetSize - registerSetSize) + memory.get(ip - 1),
|
||||
registerSet, source, status);
|
||||
}
|
||||
}
|
||||
|
||||
private void executeImmediateValue(Instruction instruction, int source, int destination) {
|
||||
ip++;
|
||||
int sourceValue = memory.get(ip);
|
||||
|
||||
if (destination == 0) {
|
||||
//Single operand
|
||||
ip++;
|
||||
instruction.execute(sourceValue, status);
|
||||
} else if (destination == Operand.IMMEDIATE_VALUE) {
|
||||
//Destination is an immediate value too
|
||||
//this shouldn't happen
|
||||
LogManager.LOGGER.severe("Trying to execute an instruction with 2" +
|
||||
"immediate values as operands"); //todo remove debug info
|
||||
|
||||
} else if (destination == Operand.IMMEDIATE_VALUE_MEM) {
|
||||
//Destination is memory immediate
|
||||
ip += 2;
|
||||
instruction.execute(memory, memory.get(ip - 1), sourceValue, status);
|
||||
} else if (destination <= registerSetSize) {
|
||||
//Destination is a register
|
||||
ip++;
|
||||
instruction.execute(registerSet, destination, sourceValue, status);
|
||||
|
||||
} else if (destination <= registerSetSize * 2) {
|
||||
//Destination is [reg]
|
||||
ip++;
|
||||
instruction.execute(memory, registerSet.get(destination - registerSetSize), sourceValue, status);
|
||||
} else {
|
||||
//Assuming that destination is [reg + x]
|
||||
ip += 2;
|
||||
instruction.execute(memory, registerSet.get(destination - registerSetSize - registerSetSize) + memory.get(ip - 1),
|
||||
sourceValue, status);
|
||||
}
|
||||
}
|
||||
|
||||
private void executeImmediateValueMem(Instruction instruction, int source, int destination) {
|
||||
//Source is [x]
|
||||
ip++;
|
||||
int sourceValue = memory.get(memory.get(ip));
|
||||
|
||||
if (destination == 0) {
|
||||
//Single operand
|
||||
ip++;
|
||||
instruction.execute(memory, memory.get(ip - 1), status);
|
||||
} else if (destination == Operand.IMMEDIATE_VALUE) {
|
||||
//Destination is an immediate value
|
||||
|
||||
//this shouldn't happen
|
||||
LogManager.LOGGER.severe("Trying to execute an instruction with an" +
|
||||
"immediate values as dst operand"); //todo remove debug info
|
||||
} else if (destination == Operand.IMMEDIATE_VALUE_MEM) {
|
||||
//Destination is memory immediate too
|
||||
ip += 2;
|
||||
instruction.execute(memory, memory.get(ip - 1), sourceValue, status);
|
||||
} else if (destination <= registerSetSize) {
|
||||
//Destination is a register
|
||||
ip++;
|
||||
instruction.execute(registerSet, destination, sourceValue, status);
|
||||
} else if (destination <= registerSetSize * 2) {
|
||||
//Destination is [reg]
|
||||
ip++;
|
||||
instruction.execute(memory, registerSet.get(destination - registerSetSize), sourceValue, status);
|
||||
} else {
|
||||
//Assuming that destination is [reg + x]
|
||||
ip += 2;
|
||||
instruction.execute(memory, registerSet.get(destination - registerSetSize - registerSetSize) + memory.get(ip - 1), sourceValue, status);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Document mongoSerialise() {
|
||||
Document dbObject = new Document();
|
||||
|
@ -104,18 +104,9 @@ public class DefaultInstructionSet implements InstructionSet {
|
||||
return defaultInstruction;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a new instruction to the instructionSet
|
||||
*
|
||||
* @param opcode opcode of the instruction
|
||||
* @param instruction Instruction to add
|
||||
* Get an instruction from its mnemonic
|
||||
*/
|
||||
public void addInstruction(int opcode, Instruction instruction) {
|
||||
instructionMap.put(opcode, instruction);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Instruction get(String mnemonic) {
|
||||
for (Instruction ins : instructionMap.values()) {
|
||||
@ -131,7 +122,15 @@ public class DefaultInstructionSet implements InstructionSet {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a new instruction to the instructionSet
|
||||
*
|
||||
* @param opcode opcode of the instruction
|
||||
* @param instruction Instruction to add
|
||||
*/
|
||||
public void addInstruction(int opcode, Instruction instruction) {
|
||||
instructionMap.put(opcode, instruction);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void add(Instruction instruction) {
|
||||
|
@ -89,6 +89,8 @@ public abstract class GameObject implements JSONSerializable, MongoSerializable
|
||||
case WEST:
|
||||
setX(nextWorld.getWorldSize() - 1);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
@ -270,4 +272,4 @@ public abstract class GameObject implements JSONSerializable, MongoSerializable
|
||||
|
||||
return document;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -412,6 +412,8 @@ public class World implements MongoSerializable {
|
||||
*/
|
||||
public Point getRandomTileWithAdjacent(int n, int tile) {
|
||||
int counter = 0;
|
||||
int[] xPositions = {1, 0, -1, 0, 1, -1, 1, -1};
|
||||
int[] yPositions = {0, 1, 0, -1, 1, 1, -1, -1};
|
||||
while (true) {
|
||||
counter++;
|
||||
|
||||
@ -425,29 +427,10 @@ public class World implements MongoSerializable {
|
||||
if (rTile != null) {
|
||||
int adjacentTiles = 0;
|
||||
|
||||
if (tileMap.isInBounds(rTile.x, rTile.y - 1) && !isTileBlocked(rTile.x, rTile.y - 1)) {
|
||||
adjacentTiles++;
|
||||
}
|
||||
if (tileMap.isInBounds(rTile.x + 1, rTile.y) && !isTileBlocked(rTile.x + 1, rTile.y)) {
|
||||
adjacentTiles++;
|
||||
}
|
||||
if (tileMap.isInBounds(rTile.x, rTile.y + 1) && !isTileBlocked(rTile.x, rTile.y + 1)) {
|
||||
adjacentTiles++;
|
||||
}
|
||||
if (tileMap.isInBounds(rTile.x - 1, rTile.y) && !isTileBlocked(rTile.x - 1, rTile.y)) {
|
||||
adjacentTiles++;
|
||||
}
|
||||
if (tileMap.isInBounds(rTile.x + 1, rTile.y + 1) && !isTileBlocked(rTile.x + 1, rTile.y + 1)) {
|
||||
adjacentTiles++;
|
||||
}
|
||||
if (tileMap.isInBounds(rTile.x - 1, rTile.y + 1) && !isTileBlocked(rTile.x - 1, rTile.y + 1)) {
|
||||
adjacentTiles++;
|
||||
}
|
||||
if (tileMap.isInBounds(rTile.x + 1, rTile.y - 1) && !isTileBlocked(rTile.x + 1, rTile.y - 1)) {
|
||||
adjacentTiles++;
|
||||
}
|
||||
if (tileMap.isInBounds(rTile.x - 1, rTile.y - 1) && !isTileBlocked(rTile.x - 1, rTile.y - 1)) {
|
||||
adjacentTiles++;
|
||||
for (int idx = 0; idx < xPositions.length; idx++) {
|
||||
if (tileMap.isInBounds(rTile.x + xPositions[idx], rTile.y + yPositions[idx]) && !isTileBlocked(rTile.x + xPositions[idx], rTile.y + yPositions[idx])) {
|
||||
adjacentTiles++;
|
||||
}
|
||||
}
|
||||
|
||||
if (adjacentTiles >= n) {
|
||||
|
@ -33,7 +33,7 @@
|
||||
* IT MIGHT NOT BE PERFECT ...But it's a good start from an existing *.tmlanguage file. *
|
||||
* fileTypes *
|
||||
****************************************************************************************/
|
||||
define("ace/mode/mar_rules", ["require", "exports", "module", "ace/lib/oop", "ace/mode/text_highlight_rules"], function (require, exports, module) {
|
||||
define("ace/mode/mar_rules", ["require", "exports", "ace/lib/oop", "ace/mode/text_highlight_rules"], function (require, exports) {
|
||||
"use strict";
|
||||
|
||||
var oop = require("../lib/oop");
|
||||
@ -95,7 +95,7 @@ define("ace/mode/mar_rules", ["require", "exports", "module", "ace/lib/oop", "ac
|
||||
exports.MarHighlightRules = MarHighlightRules;
|
||||
});
|
||||
|
||||
define("ace/mode/mar", ["require", "exports", "module", "ace/lib/oop", "ace/mode/text", "ace/mode/mar_rules"], function (require, exports, module) {
|
||||
define("ace/mode/mar", ["require", "exports", "ace/lib/oop", "ace/mode/text", "ace/mode/mar_rules"], function (require, exports) {
|
||||
"use strict";
|
||||
|
||||
var oop = require("../lib/oop");
|
||||
@ -114,4 +114,4 @@ define("ace/mode/mar", ["require", "exports", "module", "ace/lib/oop", "ace/mode
|
||||
}).call(Mode.prototype);
|
||||
|
||||
exports.Mode = Mode;
|
||||
});
|
||||
});
|
||||
|
@ -1,4 +1,4 @@
|
||||
define("ace/theme/chaos", ["require", "exports", "module", "ace/lib/dom"], function (require, exports, module) {
|
||||
define("ace/theme/chaos", ["require", "exports", "ace/lib/dom"], function (require, exports) {
|
||||
|
||||
exports.isDark = true;
|
||||
exports.cssClass = "ace-chaos";
|
||||
|
@ -1,4 +1,4 @@
|
||||
define("ace/theme/chrome", ["require", "exports", "module", "ace/lib/dom"], function (require, exports, module) {
|
||||
define("ace/theme/chrome", ["require", "exports", "ace/lib/dom"], function (require, exports) {
|
||||
|
||||
exports.isDark = false;
|
||||
exports.cssClass = "ace-chrome";
|
||||
|
@ -1,4 +1,4 @@
|
||||
define("ace/theme/clouds", ["require", "exports", "module", "ace/lib/dom"], function (require, exports, module) {
|
||||
define("ace/theme/clouds", ["require", "exports", "ace/lib/dom"], function (require, exports) {
|
||||
|
||||
exports.isDark = false;
|
||||
exports.cssClass = "ace-clouds";
|
||||
|
@ -1,4 +1,4 @@
|
||||
define("ace/theme/cobalt", ["require", "exports", "module", "ace/lib/dom"], function (require, exports, module) {
|
||||
define("ace/theme/cobalt", ["require", "exports", "ace/lib/dom"], function (require, exports) {
|
||||
|
||||
exports.isDark = true;
|
||||
exports.cssClass = "ace-cobalt";
|
||||
|
@ -1,4 +1,4 @@
|
||||
define("ace/theme/crimson_editor", ["require", "exports", "module", "ace/lib/dom"], function (require, exports, module) {
|
||||
define("ace/theme/crimson_editor", ["require", "exports", "ace/lib/dom"], function (require, exports) {
|
||||
exports.isDark = false;
|
||||
exports.cssText = ".ace-crimson-editor .ace_gutter {\
|
||||
background: #ebebeb;\
|
||||
|
@ -1,4 +1,4 @@
|
||||
define("ace/theme/dawn", ["require", "exports", "module", "ace/lib/dom"], function (require, exports, module) {
|
||||
define("ace/theme/dawn", ["require", "exports", "ace/lib/dom"], function (require, exports) {
|
||||
|
||||
exports.isDark = false;
|
||||
exports.cssClass = "ace-dawn";
|
||||
|
@ -1,4 +1,4 @@
|
||||
define("ace/theme/dracula", ["require", "exports", "module", "ace/lib/dom"], function (require, exports, module) {
|
||||
define("ace/theme/dracula", ["require", "exports", "ace/lib/dom"], function (require, exports) {
|
||||
|
||||
exports.isDark = true;
|
||||
exports.cssClass = "ace-dracula";
|
||||
|
@ -1,4 +1,4 @@
|
||||
define("ace/theme/dreamweaver", ["require", "exports", "module", "ace/lib/dom"], function (require, exports, module) {
|
||||
define("ace/theme/dreamweaver", ["require", "exports", "ace/lib/dom"], function (require, exports) {
|
||||
exports.isDark = false;
|
||||
exports.cssClass = "ace-dreamweaver";
|
||||
exports.cssText = ".ace-dreamweaver .ace_gutter {\
|
||||
|
@ -1,4 +1,4 @@
|
||||
define("ace/theme/eclipse", ["require", "exports", "module", "ace/lib/dom"], function (require, exports, module) {
|
||||
define("ace/theme/eclipse", ["require", "exports", "ace/lib/dom"], function (require, exports) {
|
||||
"use strict";
|
||||
|
||||
exports.isDark = false;
|
||||
|
@ -1,4 +1,4 @@
|
||||
define("ace/theme/github", ["require", "exports", "module", "ace/lib/dom"], function (require, exports, module) {
|
||||
define("ace/theme/github", ["require", "exports", "ace/lib/dom"], function (require, exports) {
|
||||
|
||||
exports.isDark = false;
|
||||
exports.cssClass = "ace-github";
|
||||
|
@ -1,4 +1,4 @@
|
||||
define("ace/theme/gob", ["require", "exports", "module", "ace/lib/dom"], function (require, exports, module) {
|
||||
define("ace/theme/gob", ["require", "exports", "ace/lib/dom"], function (require, exports) {
|
||||
|
||||
exports.isDark = true;
|
||||
exports.cssClass = "ace-gob";
|
||||
|
@ -1,4 +1,4 @@
|
||||
define("ace/theme/gruvbox", ["require", "exports", "module", "ace/lib/dom"], function (require, exports, module) {
|
||||
define("ace/theme/gruvbox", ["require", "exports", "ace/lib/dom"], function (require, exports) {
|
||||
|
||||
exports.isDark = true;
|
||||
exports.cssClass = "ace-gruvbox";
|
||||
|
@ -1,4 +1,4 @@
|
||||
define("ace/theme/idle_fingers", ["require", "exports", "module", "ace/lib/dom"], function (require, exports, module) {
|
||||
define("ace/theme/idle_fingers", ["require", "exports", "ace/lib/dom"], function (require, exports) {
|
||||
|
||||
exports.isDark = true;
|
||||
exports.cssClass = "ace-idle-fingers";
|
||||
|
@ -1,4 +1,4 @@
|
||||
define("ace/theme/iplastic", ["require", "exports", "module", "ace/lib/dom"], function (require, exports, module) {
|
||||
define("ace/theme/iplastic", ["require", "exports", "ace/lib/dom"], function (require, exports) {
|
||||
|
||||
exports.isDark = false;
|
||||
exports.cssClass = "ace-iplastic";
|
||||
|
@ -1,4 +1,4 @@
|
||||
define("ace/theme/katzenmilch", ["require", "exports", "module", "ace/lib/dom"], function (require, exports, module) {
|
||||
define("ace/theme/katzenmilch", ["require", "exports", "ace/lib/dom"], function (require, exports) {
|
||||
|
||||
exports.isDark = false;
|
||||
exports.cssClass = "ace-katzenmilch";
|
||||
|
@ -1,4 +1,4 @@
|
||||
define("ace/theme/kuroir", ["require", "exports", "module", "ace/lib/dom"], function (require, exports, module) {
|
||||
define("ace/theme/kuroir", ["require", "exports", "ace/lib/dom"], function (require, exports) {
|
||||
|
||||
exports.isDark = false;
|
||||
exports.cssClass = "ace-kuroir";
|
||||
|
@ -1,4 +1,4 @@
|
||||
define("ace/theme/merbivore", ["require", "exports", "module", "ace/lib/dom"], function (require, exports, module) {
|
||||
define("ace/theme/merbivore", ["require", "exports", "ace/lib/dom"], function (require, exports) {
|
||||
|
||||
exports.isDark = true;
|
||||
exports.cssClass = "ace-merbivore";
|
||||
|
@ -1,4 +1,4 @@
|
||||
define("ace/theme/merbivore_soft", ["require", "exports", "module", "ace/lib/dom"], function (require, exports, module) {
|
||||
define("ace/theme/merbivore_soft", ["require", "exports", "ace/lib/dom"], function (require, exports) {
|
||||
|
||||
exports.isDark = true;
|
||||
exports.cssClass = "ace-merbivore-soft";
|
||||
|
@ -1,4 +1,4 @@
|
||||
define("ace/theme/mono_industrial", ["require", "exports", "module", "ace/lib/dom"], function (require, exports, module) {
|
||||
define("ace/theme/mono_industrial", ["require", "exports", "ace/lib/dom"], function (require, exports) {
|
||||
|
||||
exports.isDark = true;
|
||||
exports.cssClass = "ace-mono-industrial";
|
||||
|
@ -1,4 +1,4 @@
|
||||
define("ace/theme/pastel_on_dark", ["require", "exports", "module", "ace/lib/dom"], function (require, exports, module) {
|
||||
define("ace/theme/pastel_on_dark", ["require", "exports", "ace/lib/dom"], function (require, exports) {
|
||||
|
||||
exports.isDark = true;
|
||||
exports.cssClass = "ace-pastel-on-dark";
|
||||
|
@ -1,4 +1,4 @@
|
||||
define("ace/theme/solarized_dark", ["require", "exports", "module", "ace/lib/dom"], function (require, exports, module) {
|
||||
define("ace/theme/solarized_dark", ["require", "exports", "ace/lib/dom"], function (require, exports) {
|
||||
|
||||
exports.isDark = true;
|
||||
exports.cssClass = "ace-solarized-dark";
|
||||
|
@ -1,4 +1,4 @@
|
||||
define("ace/theme/solarized_light", ["require", "exports", "module", "ace/lib/dom"], function (require, exports, module) {
|
||||
define("ace/theme/solarized_light", ["require", "exports", "ace/lib/dom"], function (require, exports) {
|
||||
|
||||
exports.isDark = false;
|
||||
exports.cssClass = "ace-solarized-light";
|
||||
|
@ -1,4 +1,4 @@
|
||||
define("ace/theme/sqlserver", ["require", "exports", "module", "ace/lib/dom"], function (require, exports, module) {
|
||||
define("ace/theme/sqlserver", ["require", "exports", "ace/lib/dom"], function (require, exports) {
|
||||
|
||||
exports.isDark = false;
|
||||
exports.cssClass = "ace-sqlserver";
|
||||
|
@ -1,4 +1,4 @@
|
||||
define("ace/theme/terminal", ["require", "exports", "module", "ace/lib/dom"], function (require, exports, module) {
|
||||
define("ace/theme/terminal", ["require", "exports", "ace/lib/dom"], function (require, exports) {
|
||||
|
||||
exports.isDark = true;
|
||||
exports.cssClass = "ace-terminal-theme";
|
||||
|
@ -1,4 +1,4 @@
|
||||
define("ace/theme/textmate", ["require", "exports", "module", "ace/lib/dom"], function (require, exports, module) {
|
||||
define("ace/theme/textmate", ["require", "exports", "ace/lib/dom"], function (require, exports) {
|
||||
"use strict";
|
||||
|
||||
exports.isDark = false;
|
||||
|
@ -1,4 +1,4 @@
|
||||
define("ace/theme/tomorrow", ["require", "exports", "module", "ace/lib/dom"], function (require, exports, module) {
|
||||
define("ace/theme/tomorrow", ["require", "exports", "ace/lib/dom"], function (require, exports) {
|
||||
|
||||
exports.isDark = false;
|
||||
exports.cssClass = "ace-tomorrow";
|
||||
|
@ -1,4 +1,4 @@
|
||||
define("ace/theme/tomorrow_night", ["require", "exports", "module", "ace/lib/dom"], function (require, exports, module) {
|
||||
define("ace/theme/tomorrow_night", ["require", "exports", "ace/lib/dom"], function (require, exports) {
|
||||
|
||||
exports.isDark = true;
|
||||
exports.cssClass = "ace-tomorrow-night";
|
||||
|
@ -1,4 +1,4 @@
|
||||
define("ace/theme/tomorrow_night_blue", ["require", "exports", "module", "ace/lib/dom"], function (require, exports, module) {
|
||||
define("ace/theme/tomorrow_night_blue", ["require", "exports", "ace/lib/dom"], function (require, exports) {
|
||||
|
||||
exports.isDark = true;
|
||||
exports.cssClass = "ace-tomorrow-night-blue";
|
||||
|
@ -1,4 +1,4 @@
|
||||
define("ace/theme/tomorrow_night_bright", ["require", "exports", "module", "ace/lib/dom"], function (require, exports, module) {
|
||||
define("ace/theme/tomorrow_night_bright", ["require", "exports", "ace/lib/dom"], function (require, exports) {
|
||||
|
||||
exports.isDark = true;
|
||||
exports.cssClass = "ace-tomorrow-night-bright";
|
||||
|
@ -1,4 +1,4 @@
|
||||
define("ace/theme/tomorrow_night_eighties", ["require", "exports", "module", "ace/lib/dom"], function (require, exports, module) {
|
||||
define("ace/theme/tomorrow_night_eighties", ["require", "exports", "ace/lib/dom"], function (require, exports) {
|
||||
|
||||
exports.isDark = true;
|
||||
exports.cssClass = "ace-tomorrow-night-eighties";
|
||||
|
@ -1,4 +1,4 @@
|
||||
define("ace/theme/twilight", ["require", "exports", "module", "ace/lib/dom"], function (require, exports, module) {
|
||||
define("ace/theme/twilight", ["require", "exports", "ace/lib/dom"], function (require, exports) {
|
||||
|
||||
exports.isDark = true;
|
||||
exports.cssClass = "ace-twilight";
|
||||
|
@ -1,4 +1,4 @@
|
||||
define("ace/theme/vibrant_ink", ["require", "exports", "module", "ace/lib/dom"], function (require, exports, module) {
|
||||
define("ace/theme/vibrant_ink", ["require", "exports", "ace/lib/dom"], function (require, exports) {
|
||||
|
||||
exports.isDark = true;
|
||||
exports.cssClass = "ace-vibrant-ink";
|
||||
|
@ -1,4 +1,4 @@
|
||||
define("ace/theme/xcode", ["require", "exports", "module", "ace/lib/dom"], function (require, exports, module) {
|
||||
define("ace/theme/xcode", ["require", "exports", "ace/lib/dom"], function (require, exports) {
|
||||
|
||||
exports.isDark = false;
|
||||
exports.cssClass = "ace-xcode";
|
||||
|
@ -296,7 +296,6 @@ class World {
|
||||
|
||||
this.tiles.push(tile);
|
||||
mar.isoGroup.add(tile);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -318,6 +317,10 @@ class World {
|
||||
mar.game.world.height = (size + 2) * 64;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Message text
|
||||
* @param msg string to set as the message
|
||||
*/
|
||||
public setBigMessage(msg: string) {
|
||||
this.bigMessage = mar.game.add.text(908, 450, msg, {
|
||||
fontSize: 46,
|
||||
@ -478,5 +481,3 @@ class WorldArrow extends Phaser.Plugin.Isometric.IsoSprite {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -127,32 +127,27 @@ public class OperandTest {
|
||||
}
|
||||
|
||||
//Invalid operands
|
||||
try{ new Operand("aa", labels, registerSet, 0); } catch (InvalidOperandException e){
|
||||
//It's not a valid Operand; that's okey, just continue; VALID FOR ALL THE OTHER CATCH SENTENCES
|
||||
try{ new Operand("aa", labels, registerSet, 0); } catch (InvalidOperandException ignored){
|
||||
//It's not a valid Operand; that's okay, just continue; VALID FOR ALL THE OTHER CATCH SENTENCES
|
||||
}
|
||||
try{ new Operand("a1", labels, registerSet, 0); } catch (InvalidOperandException e){}
|
||||
try{ new Operand("a_", labels, registerSet, 0); } catch (InvalidOperandException e){}
|
||||
try{ new Operand("_a", labels, registerSet, 0); } catch (InvalidOperandException e){}
|
||||
try{ new Operand("_1", labels, registerSet, 0); } catch (InvalidOperandException e){ }
|
||||
try{ new Operand("S", labels, registerSet, 0); } catch (InvalidOperandException e){}
|
||||
try{ new Operand("label1_", labels, registerSet, 0); } catch (InvalidOperandException e){}
|
||||
try{ new Operand("+label1", labels, registerSet, 0); } catch (InvalidOperandException e){}
|
||||
try{ new Operand("[- 12]", labels, registerSet, 0); } catch (InvalidOperandException e){}
|
||||
try{ new Operand("[12+1]", labels, registerSet, 0); } catch (InvalidOperandException e){}
|
||||
try{ new Operand("[+label1", labels, registerSet, 0); } catch (InvalidOperandException e){}
|
||||
try{ new Operand("[*12]", labels, registerSet, 0); } catch (InvalidOperandException e){}
|
||||
try{ new Operand("[-A]", labels, registerSet, 0); } catch (InvalidOperandException e){}
|
||||
try{ new Operand("[A B]", labels, registerSet, 0); } catch (InvalidOperandException e){}
|
||||
try{ new Operand("[A + B]", labels, registerSet, 0); } catch (InvalidOperandException e){}
|
||||
try{ new Operand("[A + -1]", labels, registerSet, 0); } catch (InvalidOperandException e){}
|
||||
try{ new Operand("[A + ]", labels, registerSet, 0); } catch (InvalidOperandException e){}
|
||||
try{ new Operand("[]", labels, registerSet, 0); } catch (InvalidOperandException e){}
|
||||
try{ new Operand("[A+A+]", labels, registerSet, 0); } catch (InvalidOperandException e){}
|
||||
try{ new Operand("[A+[1]]", labels, registerSet, 0); } catch (InvalidOperandException e){}
|
||||
|
||||
|
||||
|
||||
|
||||
try{ new Operand("a1", labels, registerSet, 0); } catch (InvalidOperandException ignored){}
|
||||
try{ new Operand("a_", labels, registerSet, 0); } catch (InvalidOperandException ignored){}
|
||||
try{ new Operand("_a", labels, registerSet, 0); } catch (InvalidOperandException ignored){}
|
||||
try{ new Operand("_1", labels, registerSet, 0); } catch (InvalidOperandException ignored){ }
|
||||
try{ new Operand("S", labels, registerSet, 0); } catch (InvalidOperandException ignored){}
|
||||
try{ new Operand("label1_", labels, registerSet, 0); } catch (InvalidOperandException ignored){}
|
||||
try{ new Operand("+label1", labels, registerSet, 0); } catch (InvalidOperandException ignored){}
|
||||
try{ new Operand("[- 12]", labels, registerSet, 0); } catch (InvalidOperandException ignored){}
|
||||
try{ new Operand("[12+1]", labels, registerSet, 0); } catch (InvalidOperandException ignored){}
|
||||
try{ new Operand("[+label1", labels, registerSet, 0); } catch (InvalidOperandException ignored){}
|
||||
try{ new Operand("[*12]", labels, registerSet, 0); } catch (InvalidOperandException ignored){}
|
||||
try{ new Operand("[-A]", labels, registerSet, 0); } catch (InvalidOperandException ignored){}
|
||||
try{ new Operand("[A B]", labels, registerSet, 0); } catch (InvalidOperandException ignored){}
|
||||
try{ new Operand("[A + B]", labels, registerSet, 0); } catch (InvalidOperandException ignored){}
|
||||
try{ new Operand("[A + -1]", labels, registerSet, 0); } catch (InvalidOperandException ignored){}
|
||||
try{ new Operand("[A + ]", labels, registerSet, 0); } catch (InvalidOperandException ignored){}
|
||||
try{ new Operand("[]", labels, registerSet, 0); } catch (InvalidOperandException ignored){}
|
||||
try{ new Operand("[A+A+]", labels, registerSet, 0); } catch (InvalidOperandException ignored){}
|
||||
try{ new Operand("[A+[1]]", labels, registerSet, 0); } catch (InvalidOperandException ignored){}
|
||||
}
|
||||
|
||||
}
|
||||
|
1
jenkins/Jenkinsfile
vendored
1
jenkins/Jenkinsfile
vendored
@ -8,6 +8,7 @@ remote.allowAnyHosts = true
|
||||
remote.retryCount = 3
|
||||
remote.retryWaitSec = 3
|
||||
logLevel = 'FINER'
|
||||
remote.port = 2299
|
||||
|
||||
pipeline {
|
||||
agent any
|
||||
|
Loading…
x
Reference in New Issue
Block a user