This commit is contained in:
Robin K 2022-03-30 15:51:19 +02:00
parent 6b7fb4765b
commit 9736e3eeeb
5 changed files with 7 additions and 8 deletions

View File

@ -64,7 +64,6 @@ public class DataCell implements Serializable {
this.table = table; this.table = table;
this.rom = rom; this.rom = rom;
setBitMask(table.getBitMask()); //Take the global bitmask first setBitMask(table.getBitMask()); //Take the global bitmask first
calcValueRange();
} }
public DataCell(Table table, String staticText, Rom rom) { public DataCell(Table table, String staticText, Rom rom) {
@ -130,14 +129,12 @@ public class DataCell implements Serializable {
} }
} }
else { else {
if(bitMask == 0) { if(bitMask == 0) {
maxAllowedBin = (Math.pow(256, table.getStorageType()) - 1); maxAllowedBin = (Math.pow(256, table.getStorageType()) - 1);
} }
else { else {
maxAllowedBin =(int)(Math.pow(2,ByteUtil.lengthOfMask(bitMask)) - 1); maxAllowedBin =(int)(Math.pow(2,ByteUtil.lengthOfMask(bitMask)) - 1);
} }
minAllowedBin = 0.0; minAllowedBin = 0.0;
} }
} else { } else {

View File

@ -1,6 +1,6 @@
/* /*
* RomRaider Open-Source Tuning, Logging and Reflashing * RomRaider Open-Source Tuning, Logging and Reflashing
* Copyright (C) 2006-2021 RomRaider.com * Copyright (C) 2006-2022 RomRaider.com
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View File

@ -68,7 +68,9 @@ public class TableBitwiseSwitch extends TableSwitch {
@Override @Override
public void setPresetValues(String name, String bitPos) { public void setPresetValues(String name, String bitPos) {
if (bitPos != null && bitPos.length() > 0) {
bits.add(Integer.parseInt(bitPos)); bits.add(Integer.parseInt(bitPos));
super.setPresetValues(name, "1", bits.size() - 1); super.setPresetValues(name, "1", bits.size() - 1);
} }
} }
}

View File

@ -1,6 +1,6 @@
/* /*
* RomRaider Open-Source Tuning, Logging and Reflashing * RomRaider Open-Source Tuning, Logging and Reflashing
* Copyright (C) 2006-2021 RomRaider.com * Copyright (C) 2006-2022 RomRaider.com
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by

View File

@ -299,7 +299,7 @@ public class TableScaleUnmarshaller {
} else if (n.getNodeName().equalsIgnoreCase("bit")) { } else if (n.getNodeName().equalsIgnoreCase("bit")) {
table.setPresetValues( table.setPresetValues(
unmarshallAttribute(n, "name", ""), unmarshallAttribute(n, "name", ""),
unmarshallAttribute(n, "position", "0")); unmarshallAttribute(n, "position", ""));
} else { /* unexpected element in Table (skip) */ } else { /* unexpected element in Table (skip) */
} }