// Meteor - A Nintendo Gameboy Advance emulator1// Copyright (C) 2009-2011 Philippe Daouadi2//3// This program is free software: you can redistribute it and/or modify4// it under the terms of the GNU General Public License as published by5// the Free Software Foundation, either version 3 of the License, or6// (at your option) any later version.7//8// This program is distributed in the hope that it will be useful,9// but WITHOUT ANY WARRANTY; without even the implied warranty of10// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the11// GNU General Public License for more details.12//13// You should have received a copy of the GNU General Public License14// along with this program. If not, see <http://www.gnu.org/licenses/>.1516#ifndef __FLASH_H__17#define __FLASH_H__1819#include "cartmem.hpp"20#include <stdint.h>21#include <istream>22#include <ostream>2324namespace AMeteor25{26class Flash : public CartMem27{28public :29Flash (bool big);3031void Reset ();3233bool Load (std::istream& f);34bool Save (std::ostream& f);3536uint8_t Read (uint16_t add);37bool Write (uint16_t add, uint8_t val);3839bool SaveState (std::ostream& stream);40bool LoadState (std::istream& stream);4142private :43uint8_t m_device_id;44uint8_t m_manufacturer_id;4546enum State47{48NORMAL,49CMD1,50CMD2,51ID,52ERASE1,53ERASE2,54ERASE3,55WRITE56};5758State m_state;59};60}6162#endif636465