From: Keith Packard Date: Wed, 2 Sep 2020 01:47:23 +0000 (-0700) Subject: altoslib: Print more helpful debug messages when checking rom version X-Git-Tag: 1.9.5~1^2~4 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=2d239b9bf600fac46717980f45de3ca7a242236f altoslib: Print more helpful debug messages when checking rom version Make sure success and failure include enough info to debug what happened. Signed-off-by: Keith Packard --- diff --git a/altoslib/AltosRomconfig.java b/altoslib/AltosRomconfig.java index 8ef1848d..67094658 100644 --- a/altoslib/AltosRomconfig.java +++ b/altoslib/AltosRomconfig.java @@ -151,8 +151,8 @@ public class AltosRomconfig implements AltosUnitInfoListener { try { version = get_int(hexfile, ao_romconfig_version, 2, adjust); check = get_int(hexfile, ao_romconfig_check, 2, adjust); - System.out.printf("adjust %d version %x check %x\n", adjust, version, check); if (check == (~version & 0xffff)) { + System.out.printf("adjust %d version %x check %x success\n", adjust, version, check); switch (version) { case 2: case 1: @@ -177,9 +177,11 @@ public class AltosRomconfig implements AltosUnitInfoListener { break; } break; + } else { + System.out.printf("adjust %d version %x check %x fail\n", adjust, version, check); } } catch (ArrayIndexOutOfBoundsException aie) { - System.out.printf("adjust %d failed\n", adjust); + System.out.printf("adjust %d out of bounds\n", adjust); continue; } }