- JsonObject o = (JsonObject) p;
- int addressBits = o.get(addrKey).getAsInt();
- int cellWidth = o.get(cellWidthKey).getAsInt();
- long maxAddr = o.get(maxAddrKey).getAsLong();
- long minAddr = o.get(minAddrKey).getAsLong();
- return new GUIMemoryWA(m, MainMemoryDefinition.create(addressBits, cellWidth, minAddr, maxAddr), n);
+ GUIMemoryWAParams params = JsonHandler.fromJsonTree(p, GUIMemoryWAParams.class);
+ return new GUIMemoryWA(m, MainMemoryDefinition.create(params.addrBits, params.cellWidth, params.minAddr, params.maxAddr), n);