// // Copyright (c) 2004 K. Wilkins // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from // the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it // freely, subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; you must not // claim that you wrote the original software. If you use this software // in a product, an acknowledgment in the product documentation would be // appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, and must not // be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // ////////////////////////////////////////////////////////////////////////////// // Handy - An Atari Lynx Emulator // // Copyright (c) 1996,1997 // // K. Wilkins // ////////////////////////////////////////////////////////////////////////////// // Lynx memory map class // ////////////////////////////////////////////////////////////////////////////// // // // This class provides the register $FFF9 functionality to the emulator, it // // sets which devices can be seen by the CPU. // // // // K. Wilkins // // August 1997 // // // ////////////////////////////////////////////////////////////////////////////// // Revision History: // // ----------------- // // // // 01Aug1997 KW Document header added & class documented. // // // ////////////////////////////////////////////////////////////////////////////// #define MEMMAP_CPP #include #include #include "system.h" #include "memmap.h" // IGNORE THIS TEXT, now overridden by new system // // We will hold 16 different memory maps for the "top" area which are selected // on the basis of mMemMap->mSelector: // // Code Vect ROM Mikie Susie //---------------------------------------------------- // (Default) 0000 V R M S // 0001 V R M RAM // 0001 V R RAM S // 0011 V R RAM RAM // 0100 V RAM M S // .. // .. // 1111 RAM RAM RAM RAM // // Get it..... // // We can then index with mMemoryHandlers[mMemMap->mSelector][addr] for speed // CMemMap::CMemMap(CSystem& parent) :mSystem(parent) { Reset(); } void CMemMap::Reset(void) { // Initialise ALL pointers to RAM then overload to correct for(int loop=0;loop