private void processOAMChange(int pg, int index, int oamSubIndex, int oamTableIndex, int modifiers) {
        // its an oam right click
        byte oamVal = modelRef.getCHRModel().oamValues[pg][oamTableIndex];
        byte b[] = new byte[4];
        int oamPortion = 0;
        for (int i = 0; i < 4; i++) {
            b[i] = (byte) ((oamVal >> (i * 2)) & 0x03);
            if (i == oamSubIndex) {
                b[i] = (byte) ((b[i] + 1) & 0x03);
                oamPortion = b[i];
            }
        }
        byte newOamVal = (byte) (((b[3] << 6) + (b[2] << 4) + (b[1] << 2) + b[0]) & 0xFF);
        //     System.out.println(oamTableIndex + " " + oamSubIndex + " Was: " + ByteFormatter.formatByte(oamVal) + " Now:" + ByteFormatter.formatByte(newOamVal));

        modelRef.getCHRModel().oamValues[pg][oamTableIndex] = newOamVal;

        // we need to update 4 tiles.
        int boxX = index % PPUConstants.NAME_TABLE_WIDTH;
        int boxY = index / PPUConstants.NAME_TABLE_WIDTH; // yes, we divide by width here.
        //     System.out.println("Assuming" + boxX + " " + boxY + " " + ByteFormatter.formatInt(index));
        if (boxX % 2 == 1) {
            boxX--;
        }
        if (boxY % 2 == 1) {
            boxY--;
        }
        //     System.out.println("Correcting" + boxX + " " + boxY + " " + ByteFormatter.formatInt(index));
        for (int i = 0; i < 2; i++) {
            for (int j = 0; j < 2; j++) {
                int tempIndex = (boxY + i) * PPUConstants.NAME_TABLE_WIDTH + (boxX + j);
                if (tempIndex < modelRef.getCHRModel().nameTableIndexes[pg].length) {
                    //    System.out.println("Updating NT tile for index:" + ByteFormatter.formatInt(tempIndex));
                    modelRef.nameTableTiles[pg][tempIndex] = new CHRTile(modelRef.nameTableTiles[pg][tempIndex], oamPortion);
                }
            }
        }
    }