Friday, May 8, 2015

Preprocessing of gradle android projects

Made some investigation how to use JCP with Gradle for Android projects, looks it works well, I have written some wiki

Sunday, May 3, 2015

J-J-JVM

I had found my old (2009) project of implementation a JVM interpreter in Java to play class files in J2ME (which didn't support class loaders), I made some changes, added tests and added support of long and double processing and moved the project to github, so that now it has been published under Apache License 2.0 and fully accessible
p.s.
also I renamed the project from M-JVM to J-J-JVM

Saturday, April 25, 2015

Javassist

Interesting detail about Javassist (as minimum 3.12.1.GA), it doesn't produce optimal Java code and for instance the switch keyword everytime produces lookupswitch instruction even if it is possible to use faster version - tableswitch. The Same situation with conditions, a condition like if (a==0) produces non-optimal code instead of ifeq

Friday, March 13, 2015

Farewell GoogleCode

Because Google Code is going to end its life, I have moved all my pet projects to GitHub and the repository link is https://github.com/raydac?tab=repositories

Wednesday, February 4, 2015

New version of Java Binary Block Parser (JBBP) 1.1.0 is out

The New version of JBBP 1.1.0 is out and accessible in the maven central, now it supports not only parsing of binary data and mapping them to classes but also and back operation - packing binary data blocks from mapped classes and even printing of mapped class  description, take a look at example


class Flags {
      @Bin(outOrder = 1, name = "f1", type = BinType.BIT, outBitNumber = JBBPBitNumber.BITS_1, comment = "It's flag one") byte flag1;
      @Bin(outOrder = 2, name = "f2", type = BinType.BIT, outBitNumber = JBBPBitNumber.BITS_2, comment = "It's second flag") byte flag2;
      @Bin(outOrder = 3, name = "f3", type = BinType.BIT, outBitNumber = JBBPBitNumber.BITS_1, comment = "It's 3th flag") byte flag3;
      @Bin(outOrder = 4, name = "f4", type = BinType.BIT, outBitNumber = JBBPBitNumber.BITS_4, comment = "It's 4th flag") byte flag4;
    }
    final int data = 0b10101010;
    Flags parsed = JBBPParser.prepare("bit:1 f1; bit:2 f2; bit:1 f3; bit:4 f4;", JBBPBitOrder.MSB0).parse(new byte[]{(byte)data}).mapTo(Flags.class);
    System.out.println(new JBBPTextWriter().Bin(parsed).Close().toString());
    assertEquals(data, JBBPOut.BeginBin(JBBPBitOrder.MSB0).Bin(parsed).End().toByteArray()[0] & 0xFF);
the code will parse the byte, then print its values

;--------------------------------------------------------------------------------
; START : Flags
;--------------------------------------------------------------------------------
    01; f1, It's flag one
    02; f2, It's second flag
    00; f3, It's 3th flag
    05; f4, It's 4th flag
;--------------------------------------------------------------------------------
; END : Flags
;--------------------------------------------------------------------------------
and again will pack parsed data into byte

New version of ZX-Poly emulator is out under GPL 3

I have reworked and published ZX-Poly emulator under GPL3, also the project contains Z80 emulator as separated block

The Emulator supports .TAP,.SNA,.Z80,.TRD and .SCL snapshots and even allows to generate tape WAV files from TAP snapshots.