/*************************************************
*            BK Emulator for Window 3.0          *
*************************************************/

/*
File: Board_FDD.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.
*/


// Board_FDD.h: interface for the CMotherBoard_FDD class.
//

/*
Организация массива памяти (делается один большой массив)
32кб: ОЗУ
000000--банк 0 ---страница 0 --- 0
020000--банк 1
040000--банк 2 ---страница 1 --- 16384
060000--банк 3
32кб: ПЗУ
100000--банк 4 ---страница 2 --- 32768 - монитор MONIT10.ROM
120000--банк 5 ------------------------- бейсик Basic10_1.rom
140000--банк 6 ---страница 3 --- 49152 - бейсик Basic10_2.rom
160000--банк 7 ------------------------- бейсик и регистры Basic10_2.rom
8кб: ПЗУ
200000--банк 8
16кб: ОЗУ
220000--банк 9 дополнительные 16 кб озу
240000--банк 10
260000 - конец
*/
#pragma once

#include "Board.h"


class CMotherBoard_FDD : public CMotherBoard
{
		WORD m_nFDDCatchAddr, m_nFDDExitCatchAddr;

		BKMEMBank_Type      m_MemMapBasic[6];   //специально для бейсика придётся ввести ещё один массив. Тут будут храниться данные, которые замещаются ПЗУ Бейсика
		BOOL                m_bBasicOn;         //флаг, что бейсик подключен

		virtual void        OnReset();
		virtual void        ResetDevices();
		// Initialize memory
		virtual BOOL        InitMemoryModules();
		virtual void        MemoryManager(void);

		// Methods for loading and saving emulator state
		virtual BOOL        RestoreMemory(CMSFManager &msf);

		// Methods emulate registers bihaviour
		virtual BOOL        OnSetSystemRegister(WORD num, WORD src, BOOL bByteOperation = FALSE);
		virtual BOOL        OnGetSystemRegister(WORD num, void *pDst, BOOL bByteOperation = FALSE);

		virtual void        Interception(); // Called after each command

	public:
		CMotherBoard_FDD();
		virtual ~CMotherBoard_FDD();

		virtual DWORD       GetConfiguration()
		{
			return MSF_CONF_BK1001_FDD;
		}
		virtual void        SetFDDType(BK_FDD_MODEL model, BOOL bInit = TRUE);
		virtual BYTE       *GetAddMemory(void)
		{
			return m_pMemory + 0220000;
		}
};
