Skip to content

Commit

Permalink
feat: add state cell, sync, and counter ic gates
Browse files Browse the repository at this point in the history
  • Loading branch information
MrTJP committed Apr 8, 2024
1 parent d587468 commit 3b5ccd1
Show file tree
Hide file tree
Showing 14 changed files with 793 additions and 59 deletions.
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// 1.19.2 2024-04-03T14:34:15.996265 ProjectRed-Fabrication Languages: en_us
185f10b0a3ebb21bb94ee65a6e1180c345526012 assets/projectred_fabrication/lang/en_us.json
// 1.19.2 2024-04-05T16:47:53.695184 ProjectRed-Fabrication Languages: en_us
dd1226a77b7ec67a85f9d088ba5a3f78a16f2bf4 assets/projectred_fabrication/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@
"projectred_fabrication.tilegroup.memory": "Memory",
"projectred_fabrication.tilegroup.redwire": "Redwire",
"projectred_fabrication.tilegroup.timing": "Timing",
"projectred_fabrication.tiles.counter.decr": "Decrement",
"projectred_fabrication.tiles.counter.incr": "Increment",
"projectred_fabrication.tiles.counter.max": "Max",
"projectred_fabrication.tiles.counter.value": "Value",
"projectred_fabrication.tiles.io_gate": "IO Gate",
"projectred_fabrication.tiles.timer.interval": "Interval",
"projectred_fabrication.tool.eraser": "Erase",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@ protected void addTranslations() {

add(UL_IO_GATE_TILE, "IO Gate");
add(UL_TIMER_INTERVAL, "Interval");
add(UL_COUNTER_VALUE, "Value");
add(UL_COUNTER_MAX, "Max");
add(UL_COUNTER_INCR, "Increment");
add(UL_COUNTER_DECR, "Decrement");

add(UL_TILEGROUP_REDWIRE, "Redwire");
add(UL_TILEGROUP_BUNDLED, "Bundled");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,22 @@ public byte pullRegisterValue(int regId) {
return simulation.getRegByteVal(regId);
}

public short pullShortValue(int r1, int r0) {
return simulation.getRegShortVal(r1, r0);
}

public short pullShortValue(int[] r, int offset) {
return simulation.getRegShortVal(r, offset);
}

public int pullIntValue(int r3, int r2, int r1, int r0) {
return simulation.getRegIntVal(r3, r2, r1, r0);
}

public int pullIntValue(int[] r, int offset) {
return simulation.getRegIntVal(r, offset);
}

public long pullLongValue(int r7, int r6, int r5, int r4, int r3, int r2, int r1, int r0) {
return simulation.getRegLongVal(r7, r6, r5, r4, r3, r2, r1, r0);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ public enum ICTileType {
TRANSPARENT_LATCH_GATE(ID_OFFSET_GATE + 14, TRANSPARENT_LATCH, TransparentLatchGateTile::new),
TIMER_GATE (ID_OFFSET_GATE + 15, TIMER, TimerGateTile::new),
SEQUENCER_GATE (ID_OFFSET_GATE + 16, SEQUENCER, SequencerGateTile::new),
COUNTER_GATE (ID_OFFSET_GATE + 17, COUNTER, CounterGateTile::new),
STATE_CELL_GATE (ID_OFFSET_GATE + 18, STATE_CELL, StateCellGateTile::new),
SYNCHRONIZER_GATE (ID_OFFSET_GATE + 19, SYNCHRONIZER, SynchronizerGateTile::new),

RED_ALLOY_WIRE (ID_OFFSET_WIRE_RED, RED_ALLOY, RedAlloyWireTile::new),
INSULATED_WHITE_WIRE (ID_OFFSET_WIRE_RED + 1, INSULATED_WHITE, () -> new InsulatedWireTile(0)),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ public Map<Class<? extends ICGate>, String> getGateSerializationMap() {
map.put(TransparentLatchGateTile.TransparentLatchGate.class, "pr_trlatch");
map.put(TimerGateTile.TimerGate.class, "pr_timer");
map.put(SequencerGateTile.SequencerGate.class, "pr_seq");
map.put(CounterGateTile.CounterGate.class, "pr_counter");
map.put(StateCellGateTile.StateCellGate.class, "pr_statecell");
map.put(SynchronizerGateTile.SynchronizerGate.class, "pr_sync");

return map;
}
Expand Down
Loading

0 comments on commit 3b5ccd1

Please sign in to comment.