Exemple #1
0
    void FixedUpdate()
    {
        const int frameCycles = VIC2.CYCLES_PER_LINE * VIC2.NUM_LINES;

        _processor.Cycles = 0;
        _audioCycles      = 0;

        for (ushort i = 0; i < VIC2.FIRST_VISIBLE_LINE; ++i)
        {
            ExecuteLine(i, false);
        }

        _vic2.BeginFrame();

        for (ushort i = VIC2.FIRST_VISIBLE_LINE; i < VIC2.FIRST_INVISIBLE_LINE; ++i)
        {
            ExecuteLine(i, true);
        }

        for (ushort i = VIC2.FIRST_INVISIBLE_LINE; i < VIC2.NUM_LINES; ++i)
        {
            ExecuteLine(i, false);
        }

        // Render rest of audio until end of frame
        if (_audioCycles < frameCycles)
        {
            _sid.BufferSamples(frameCycles - _audioCycles);
            _audioCycles = frameCycles;
        }

        _textureDirty = true;

        //Debug.Log(_sid.samples.Count);
    }