/*************************************************
*           BK Emulator v3.8 for Windows         *
*************************************************/

/*
File: MSF.h
Version: 1.0.0
Written by: Yuriy Kalmykov <kalmykov@stoik.com>
    Copyright (c) 2002-2004 Yuriy Kalmykov

    BK Emulator is a program emulated hardware environment for running
code for BK 0010(01) in different configurations.

    This code may be used in compiled form in any way you desire.
This file or it's parts can't be redistributed without the authors
written consent, but can be modified for your private needs.
    Providing that this notice and the authors name and all copyright
notices remains intact.

    Please, an email me to know how you are using it and where. You can
ask me for any information about this below code or any attendant
knowledge.

    This file is provided "as is" with no expressed or implied warranty.
The author accepts no liability for any damage or loss of business that
this product may cause.
*/


// MSF.h: interface for the COperand class.
//


#pragma once

enum MSF_CONF
{
	MSF_CONF_BK1001 = 1,
	MSF_CONF_BK1001_MSTD,
	MSF_CONF_BK1001_EXT32,
	MSF_CONF_BK1001_FDD,
	MSF_CONF_BK11M,
	MSF_CONF_BK11M_FDD,
	MSF_CONF_BK11,
	MSF_CONF_BK11_FDD
};

enum MSF_BLOCKTYPE
{
	MSF_BLOCKTYPE_UNKNOWN = - 1,
	MSF_BLOCKTYPE_BASEMEMORY = 0,
	MSF_BLOCKTYPE_CPU_REGISTERS,
	MSF_BLOCKTYPE_PREVIEW,
	MSF_BLOCKTYPE_10EXT16,
	MSF_BLOCKTYPE_10EXT32,
	MSF_BLOCKTYPE_11EXT64,
	MSF_BLOCKTYPE_PORT_REGS,
	MSF_BLOCKTYPE_MEMMAP,
	MSF_BLOCKTYPE_BASEMEMORY11M,
	MSF_BLOCKTYPE_MEMORY_SMK512,
	MSF_BLOCKTYPE_CONFIG,
	MSF_BLOCKTYPE_FRAMEDATA,
	MSF_BLOCKTYPE_WAVE = 200
};

#pragma pack(push)
#pragma pack(4)
struct MSF_FILE_HEADER
{
	DWORD   type;
	DWORD   version;
	DWORD   configuration;
};

struct MSF_BLOCK_HEADER
{
	DWORD   type;
	DWORD   length;
};

struct MSF_CPU_REGISTERS
{
	WORD    r0;
	WORD    r1;
	WORD    r2;
	WORD    r3;
	WORD    r4;
	WORD    r5;
	WORD    sp;
	WORD    pc;
	WORD    psw;
};

struct MSF_PORT_REGS
{
	WORD    p0177660;
	WORD    p0177662_in;
	WORD    p0177662_out;
	WORD    p0177664;
	WORD    p0177700;
	WORD    p0177702;
	WORD    p0177704;
	WORD    p0177706;
	WORD    p0177710;
	WORD    p0177712;
	WORD    p0177714_in;
	WORD    p0177714_out;
	WORD    p0177716_in;
	WORD    p0177716_out_tap;
	WORD    p0177716_out_mem;
};

struct MSF_FRAMEDATA
{
	//состояние экрана
	DWORD   nScreenBufferAddressOffset;
	int     nScreenCycleCount;
	int     nScreenLinesCount;
	int     nScreenLineBytesCount;
	int     nScreenStage;
	int     nScreenLinesStage;
	int     nScreenLineCycleCount;
	int     nTimerSpeed;

	int     nCPUTicks;
	double  fTickCount;
	double  fMediaTicks;
	double  fMedia_Mod;
	double  fMemoryTicks;
	double  fMemory_Mod;
	double  fFDDTicks;
	double  fFDD_Mod;
};

struct MSF_BLOCK_INFO
{
	DWORD               offset;
	MSF_BLOCK_HEADER    header;
};

#pragma pack(pop)
