1 /******************************************************************************
2 * Arachnoid Graphics Plugin for Mupen64Plus
3 * http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
5 * Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 *****************************************************************************/
25 //*****************************************************************************
27 //! Handle RDRAM, Texture Memory and Segments
28 //*****************************************************************************
33 //Constructor / Destructor
38 bool initialize(unsigned char* RDRAM, unsigned char* DMEM);
42 unsigned char* getRDRAM(int address=0) { return &m_RDRAM[address]; }
43 unsigned int* getRDRAMint32() { return (unsigned int*)m_RDRAM; }
44 unsigned int getRDRAMSize() { return m_RDRAMSize; }
47 unsigned char* getDMEM(int address=0) { return &m_DMEM[address]; }
50 static unsigned long long* getTextureMemory(int address=0) { return &m_TMEM[address]; }
53 unsigned int getRDRAMAddress(unsigned int segmentAddress)
55 return (m_segments[(segmentAddress >> 24) & 0x0F] + (segmentAddress & 0x00FFFFFF)) & 0x00FFFFFF;
58 void setSegment(unsigned int address, unsigned int value)
60 if ( address >= 16 ) {
65 m_segments[address] = value;
70 unsigned char* m_RDRAM; //!< Rambus Dynamic Random Access Memory
71 unsigned char* m_DMEM; //!< RSP Data Memory
72 static unsigned long long m_TMEM[512]; //!< Texture Memory
73 unsigned int m_segments[16]; //!< Temporary memory for storing segment values
74 unsigned int m_RDRAMSize; //!< Size of RDRAM