1 /* 2 * KCemu -- The emulator for the KC85 homecomputer series and much more. 3 * Copyright (C) 1997-2010 Torsten Paul 4 * 5 * This program is free software; you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation; either version 2 of the License, or 8 * (at your option) any later version. 9 * 10 * This program is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU General Public License for more details. 14 * 15 * You should have received a copy of the GNU General Public License along 16 * with this program; if not, write to the Free Software Foundation, Inc., 17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 */ 19 20 #ifndef __kc_memory2_h 21 #define __kc_memory2_h 22 23 #include "kc/system.h" 24 25 #include "kc/kc.h" 26 #include "kc/memory.h" 27 28 class Memory2 : public Memory 29 { 30 private: 31 byte_t _ram[0x4000]; 32 33 byte_t _rom_caos[0x2000]; 34 35 byte_t _irm[0x4000]; 36 37 bool _access_color; 38 39 MemAreaGroup *_m_scr; /* scratch memory */ 40 MemAreaGroup *_m_caos; /* CAOS e000h - e7ffh, f000h - f7ffh */ 41 MemAreaGroup *_m_ram; /* RAM 0000h - 3fffh */ 42 MemAreaGroup *_m_irm; /* IRM 8000h - bfffh */ 43 44 public: 45 Memory2(void); 46 virtual ~Memory2(void); 47 void dumpCore(void); 48 49 byte_t memRead8(word_t addr); 50 void memWrite8(word_t addr, byte_t val); 51 52 byte_t * get_irm(void); 53 byte_t * get_char_rom(void); 54 55 void enableCAOS(int v); 56 void enableIRM(int v); 57 void enableRAM(int v); 58 void protectRAM(int v); 59 60 virtual void reset(bool power_on = false); 61 }; 62 63 #endif /* __kc_memory2_h */ 64