00001 /* ES40 emulator. 00002 * Copyright (C) 2007-2008 by the ES40 Emulator Project 00003 * 00004 * Website: http://sourceforge.net/projects/es40 00005 * E-mail : camiel@camicom.com 00006 * 00007 * This program is free software; you can redistribute it and/or 00008 * modify it under the terms of the GNU General Public License 00009 * as published by the Free Software Foundation; either version 2 00010 * of the License, or (at your option) any later version. 00011 * 00012 * This program is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 * GNU General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU General Public License 00018 * along with this program; if not, write to the Free Software 00019 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00020 * 00021 * Although this is not required, the author would appreciate being notified of, 00022 * and receiving any modifications you may make to the source code that might serve 00023 * the general public. 00024 */ 00025 00068 #if !defined(INCLUDED_FLASH_H) 00069 #define INCLUDED_FLASH_H 00070 00071 #include "SystemComponent.h" 00072 00079 class CFlash : public CSystemComponent 00080 { 00081 public: 00082 virtual void WriteMem(int index, u64 address, int dsize, u64 data); 00083 virtual u64 ReadMem(int index, u64 address, int dsize); 00084 CFlash(CConfigurator* cfg, class CSystem* c); 00085 virtual ~CFlash(); 00086 virtual int SaveState(FILE* f); 00087 virtual int RestoreState(FILE* f); 00088 void SaveStateF(); 00089 void RestoreStateF(); 00090 void SaveStateF(char* fn); 00091 void RestoreStateF(char* fn); 00092 protected: 00093 00095 struct SFlash_state 00096 { 00097 u8 Flash[2 * 1024 * 1024]; 00098 int mode; 00099 } state; 00100 }; 00101 00102 extern CFlash* theSROM; 00103 #endif // !defined(INCLUDED_FLASH_H)