/*
    JPC-RR: A x86 PC Hardware Emulator
    Release 1

    Copyright (C) 2007-2009 Isis Innovation Limited
    Copyright (C) 2009-2010 H. Ilari Liusvaara

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License version 2 as published by
    the Free Software Foundation.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License along
    with this program; if not, write to the Free Software Foundation, Inc.,
    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

    Based on JPC x86 PC Hardware emulator,
    A project from the Physics Dept, The University of Oxford

    Details about original JPC can be found at:

    www-jpc.physics.ox.ac.uk

*/

package org.jpc.output;

public class OutputFrameVolumeChange extends OutputFrame
{
    private int[] num;

    public OutputFrameVolumeChange(long timeStamp, int ln, int ld, int rn, int rd)
    {
        super(timeStamp, (byte)0);
        num = new int[]{ln, ld, rn, rd};
    }

    protected byte[] dumpInternal()
    {
        byte[] buf = new byte[16];
        for(int i = 0; i < 4; i++) {
            buf[4 * i + 0] = (byte)((num[i] >>> 24) & 0xFF);
            buf[4 * i + 1] = (byte)((num[i] >>> 16) & 0xFF);
            buf[4 * i + 2] = (byte)((num[i] >>> 8) & 0xFF);
            buf[4 * i + 3] = (byte)(num[i] & 0xFF);
        }
        return buf;
    }
};
