﻿//----------------------------------------------------------------------------//
//                                                                            //
// Z80 Emulator Core Library 2 (c) 2017 Søren Amtorp                          //
//                                                                            //
// Permission is hereby granted, free of charge, to any person obtaining a    //
// copy of this software and associated documentation files (the "Software"), //
// to deal in the Software without restriction, including without limitation  //
// the rights to use, copy, modify, merge, publish, distribute, sublicense,   //
// and/or sell copies of the Software, and to permit persons to whom the      //
// Software is furnished to do so, subject to the following conditions:       //
//                                                                            //
// The above copyright notice and this permission notice shall be included in //
// all copies or substantial portions of the Software.                        //
//                                                                            //
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR //
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,   //
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL    //
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER //
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING    //
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER        //
// DEALINGS IN THE SOFTWARE.                                                  //
//                                                                            //
//----------------------------------------------------------------------------//
//
// IZ80
//

using Z80lib.Memory;
using Z80lib.Io;

namespace Z80lib.Emulator
{
    public interface IZ80
    {
        byte F { get; set; }
        byte A { get; set; }
        byte B { get; set; }
        byte C { get; set; }
        byte D { get; set; }
        byte E { get; set; }
        byte H { get; set; }
        byte L { get; set; }
        ushort AF { get; set; }
        ushort BC { get; set; }
        ushort DE { get; set; }
        ushort HL { get; set; }
        ushort PC { get; set; }
        ushort SP { get; set; }
        ushort IX { get; set; }
        byte IXH { get; set; }
        byte IXL { get; set; }
        ushort IY { get; set; }
        byte IYH { get; set; }
        byte IYL { get; set; }
        ushort AltAF { get; set; }
        ushort AltBC { get; set; }
        ushort AltDE { get; set; }
        ushort AltHL { get; set; }
        bool Carry { get; set; }
        bool Sign { get; set; }
        bool Zero { get; set; }
        bool Half { get; set; }
        bool N { get; set; }
        bool PV { get; set; }
        bool F3 { get; set; }
        bool F5 { get; set; }

        IMemoryHandler Memory { get; set; }
        IIoHandler Io { get; set; }
        void ExecuteNext();
        bool Int(IInterruptReturn pInterruptReturn = null, byte pData = 0);
        void Reset();
        void EnableUserInstructions(IUserInstructions pDispatcher);
    }
}
