- int start = (((int)dis.readByte()) << 16) | (int)dis.readShort();
- int end = (((int)dis.readByte()) << 16) | (int)dis.readShort();
- Log.debug(this, " window " + i + " spans addresses " + hex24(start) + " - " + hex24(end));
- for(int j=start; j<=end; j++) {
- int z = (j & 0x0000ff) >> 0;
- int y = (j & 0x00ff00) >> 8;
- int x = (j & 0xff0000) >> 16;
- mode4(x, y, z, dis.readByte());
+ int start = (dis.readUnsignedByte() << 16) | (int)dis.readShort();
+ int end = (dis.readUnsignedByte() << 16) | (int)dis.readShort();
+ count = 0;
+ Log.debug(this, " window " + dec2(i) + " spans addresses " + hex24(start) + " - " + hex24(end) + "[count="+count+"]");
+ int _z = (start & 0x0000ff) >> 0;
+ int _y = (start & 0x00ff00) >> 8;
+ int _x = (start & 0xff0000) >> 16;
+ int z_ = (end & 0x0000ff) >> 0;
+ int y_ = (end & 0x00ff00) >> 8;
+ int x_ = (end & 0xff0000) >> 16;
+ int z = (start & 0x0000ff) >> 0;
+ int y = (start & 0x00ff00) >> 8;
+ int x = (start & 0xff0000) >> 16;
+
+ while(true) {
+ count++;
+ mode4(x, y, z, dis.readUnsignedByte());
+ x++;
+ if (x > 15) { x = 0; y++; }
+ if (y > 15) { y = 0; z++; }
+ do {
+ z++;
+ if (z > 77) {
+ z = _z;
+ x++;
+ if (x > 15) {
+ x = _x;
+ y++;
+ if (y > y_) break;
+ }
+ }
+ } while(!valid(x,y,z));