altosui: Add debug dongle API, split flash UI out
[fw/altos] / ao-tools / altosui / AltosHexfile.java
index c7078877ed5f647cf4de77e0983bf0eec5dbe9e3..360e24adeb6ba65f841db73b882d183d8b20d199 100644 (file)
@@ -214,6 +214,10 @@ public class AltosHexfile {
        public int      address;
        public byte[]   data;
 
+       public byte get_byte(int a) {
+               return data[a - address];
+       }
+
        public AltosHexfile(FileInputStream file) throws IOException {
                HexFileInputStream      input = new HexFileInputStream(file);
                LinkedList<HexRecord>   record_list = new LinkedList<HexRecord>();
@@ -244,5 +248,7 @@ public class AltosHexfile {
                                        data[records[i].address - base + j] = records[i].data[j];
                        }
                }
+               for (int i = 0xa0; i < 0xaa; i++)
+                       System.out.printf ("%04x: %02x\n", i, get_byte(i));
        }
 }
\ No newline at end of file