\hypertarget{classComSquare_1_1Memory_1_1IRectangleMemory}{}\doxysection{Com\+Square\+::Memory\+::I\+Rectangle\+Memory Class Reference}
\label{classComSquare_1_1Memory_1_1IRectangleMemory}\index{ComSquare::Memory::IRectangleMemory@{ComSquare::Memory::IRectangleMemory}}


Superset of the \mbox{\hyperlink{classComSquare_1_1Memory_1_1IMemory}{I\+Memory}} to map non continuous rectangle to the memory. (A rectangle that spam across more than one bank but that does not start at 0000 or end at F\+F\+FF).  




{\ttfamily \#include $<$I\+Rectangle\+Memory.\+hpp$>$}



Inheritance diagram for Com\+Square\+::Memory\+::I\+Rectangle\+Memory\+:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=550pt]{classComSquare_1_1Memory_1_1IRectangleMemory__inherit__graph}
\end{center}
\end{figure}


Collaboration diagram for Com\+Square\+::Memory\+::I\+Rectangle\+Memory\+:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=205pt]{classComSquare_1_1Memory_1_1IRectangleMemory__coll__graph}
\end{center}
\end{figure}
\doxysubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
uint8\+\_\+t \mbox{\hyperlink{classComSquare_1_1Memory_1_1IRectangleMemory_a478251bc0c7272712b6f6f25aa17b71a}{read}} (\mbox{\hyperlink{Ints_8hpp_a89f009aaf5d1964a000f44f09fa0bcf8}{uint24\+\_\+t}} addr) override
\begin{DoxyCompactList}\small\item\em Read data from the component using the same method as the basic \mbox{\hyperlink{classComSquare_1_1Memory_1_1IMemory}{I\+Memory}}. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{classComSquare_1_1Memory_1_1IRectangleMemory_a54b0ace13a17556f6072399ffed9b817}{write}} (\mbox{\hyperlink{Ints_8hpp_a89f009aaf5d1964a000f44f09fa0bcf8}{uint24\+\_\+t}} addr, uint8\+\_\+t data) override
\begin{DoxyCompactList}\small\item\em Write data to this component using the same method as the basic \mbox{\hyperlink{classComSquare_1_1Memory_1_1IMemory}{I\+Memory}}. \end{DoxyCompactList}\item 
virtual uint8\+\_\+t \mbox{\hyperlink{classComSquare_1_1Memory_1_1IRectangleMemory_a2a239baa265b31e222d4e5b0a9d2d5e0}{read\+\_\+internal}} (\mbox{\hyperlink{Ints_8hpp_a89f009aaf5d1964a000f44f09fa0bcf8}{uint24\+\_\+t}} addr)=0
\begin{DoxyCompactList}\small\item\em Internal component read. Implement this as you would implement a basic \mbox{\hyperlink{classComSquare_1_1Memory_1_1IMemory}{I\+Memory}}\textquotesingle{}s read. \end{DoxyCompactList}\item 
virtual void \mbox{\hyperlink{classComSquare_1_1Memory_1_1IRectangleMemory_ac37e86292b5e7b0bd099757c2e6263cc}{write\+\_\+internal}} (\mbox{\hyperlink{Ints_8hpp_a89f009aaf5d1964a000f44f09fa0bcf8}{uint24\+\_\+t}} addr, uint8\+\_\+t data)=0
\begin{DoxyCompactList}\small\item\em Internal component write. Implement this as you would implement a basic \mbox{\hyperlink{classComSquare_1_1Memory_1_1IMemory}{I\+Memory}}\textquotesingle{}s write. \end{DoxyCompactList}\item 
bool \mbox{\hyperlink{classComSquare_1_1Memory_1_1IRectangleMemory_ab165286db6b6c7cea0e635ca49a07824}{has\+Memory\+At}} (\mbox{\hyperlink{Ints_8hpp_a89f009aaf5d1964a000f44f09fa0bcf8}{uint24\+\_\+t}} addr) override
\begin{DoxyCompactList}\small\item\em Return true if this component has mapped the address. \end{DoxyCompactList}\item 
\mbox{\hyperlink{Ints_8hpp_a89f009aaf5d1964a000f44f09fa0bcf8}{uint24\+\_\+t}} \mbox{\hyperlink{classComSquare_1_1Memory_1_1IRectangleMemory_a6b55c812fb38ed7c67d19f32748b5286}{get\+Start}} () override
\begin{DoxyCompactList}\small\item\em Get the first address mapped to this component. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{classComSquare_1_1Memory_1_1IRectangleMemory_a90bb7d98b2e8c2da70cc29c36ac70adc}{set\+Memory\+Region}} (uint8\+\_\+t start\+Bank, uint8\+\_\+t end\+Bank, uint16\+\_\+t start\+Page, uint16\+\_\+t end\+Page)
\begin{DoxyCompactList}\small\item\em Change starting and ending points of this mapped memory. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Private Attributes}
\begin{DoxyCompactItemize}
\item 
uint8\+\_\+t \mbox{\hyperlink{classComSquare_1_1Memory_1_1IRectangleMemory_a94658df7460fd7f9f59f22955d93bf6b}{\+\_\+start\+Bank}} = 0
\begin{DoxyCompactList}\small\item\em The first bank to map to. \end{DoxyCompactList}\item 
uint8\+\_\+t \mbox{\hyperlink{classComSquare_1_1Memory_1_1IRectangleMemory_acc2002b644d61a7dc4d40c92e0b93a3d}{\+\_\+end\+Bank}} = 0
\begin{DoxyCompactList}\small\item\em The last bank to map to. \end{DoxyCompactList}\item 
uint16\+\_\+t \mbox{\hyperlink{classComSquare_1_1Memory_1_1IRectangleMemory_a9178184277528ac54064ca6caacab474}{\+\_\+start\+Page}} = 0
\begin{DoxyCompactList}\small\item\em The first address of each bank to map. \end{DoxyCompactList}\item 
uint16\+\_\+t \mbox{\hyperlink{classComSquare_1_1Memory_1_1IRectangleMemory_aece911d747bb326279bc7e661e06a9a3}{\+\_\+end\+Page}} = 0
\begin{DoxyCompactList}\small\item\em The last address of each bank to map. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
Superset of the \mbox{\hyperlink{classComSquare_1_1Memory_1_1IMemory}{I\+Memory}} to map non continuous rectangle to the memory. (A rectangle that spam across more than one bank but that does not start at 0000 or end at F\+F\+FF). 

\doxysubsection{Member Function Documentation}
\mbox{\Hypertarget{classComSquare_1_1Memory_1_1IRectangleMemory_a6b55c812fb38ed7c67d19f32748b5286}\label{classComSquare_1_1Memory_1_1IRectangleMemory_a6b55c812fb38ed7c67d19f32748b5286}} 
\index{ComSquare::Memory::IRectangleMemory@{ComSquare::Memory::IRectangleMemory}!getStart@{getStart}}
\index{getStart@{getStart}!ComSquare::Memory::IRectangleMemory@{ComSquare::Memory::IRectangleMemory}}
\doxysubsubsection{\texorpdfstring{getStart()}{getStart()}}
{\footnotesize\ttfamily \mbox{\hyperlink{Ints_8hpp_a89f009aaf5d1964a000f44f09fa0bcf8}{uint24\+\_\+t}} Com\+Square\+::\+Memory\+::\+I\+Rectangle\+Memory\+::get\+Start (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [override]}, {\ttfamily [virtual]}}



Get the first address mapped to this component. 

\begin{DoxyReturn}{Returns}
the \+\_\+start value. 
\end{DoxyReturn}


Reimplemented from \mbox{\hyperlink{classComSquare_1_1Memory_1_1IMemory_ab8910c303177d212bfca0a563b04c7a8}{Com\+Square\+::\+Memory\+::\+I\+Memory}}.

\mbox{\Hypertarget{classComSquare_1_1Memory_1_1IRectangleMemory_ab165286db6b6c7cea0e635ca49a07824}\label{classComSquare_1_1Memory_1_1IRectangleMemory_ab165286db6b6c7cea0e635ca49a07824}} 
\index{ComSquare::Memory::IRectangleMemory@{ComSquare::Memory::IRectangleMemory}!hasMemoryAt@{hasMemoryAt}}
\index{hasMemoryAt@{hasMemoryAt}!ComSquare::Memory::IRectangleMemory@{ComSquare::Memory::IRectangleMemory}}
\doxysubsubsection{\texorpdfstring{hasMemoryAt()}{hasMemoryAt()}}
{\footnotesize\ttfamily bool Com\+Square\+::\+Memory\+::\+I\+Rectangle\+Memory\+::has\+Memory\+At (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{Ints_8hpp_a89f009aaf5d1964a000f44f09fa0bcf8}{uint24\+\_\+t}}}]{addr }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [override]}, {\ttfamily [virtual]}}



Return true if this component has mapped the address. 


\begin{DoxyParams}{Parameters}
{\em addr} & The address to check. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
True if this address is mapped to the component. False otherwise. 
\end{DoxyReturn}


Reimplemented from \mbox{\hyperlink{classComSquare_1_1Memory_1_1IMemory_a3a7ac0be32c2c42e6421b55719f93f25}{Com\+Square\+::\+Memory\+::\+I\+Memory}}.

\mbox{\Hypertarget{classComSquare_1_1Memory_1_1IRectangleMemory_a478251bc0c7272712b6f6f25aa17b71a}\label{classComSquare_1_1Memory_1_1IRectangleMemory_a478251bc0c7272712b6f6f25aa17b71a}} 
\index{ComSquare::Memory::IRectangleMemory@{ComSquare::Memory::IRectangleMemory}!read@{read}}
\index{read@{read}!ComSquare::Memory::IRectangleMemory@{ComSquare::Memory::IRectangleMemory}}
\doxysubsubsection{\texorpdfstring{read()}{read()}}
{\footnotesize\ttfamily uint8\+\_\+t Com\+Square\+::\+Memory\+::\+I\+Rectangle\+Memory\+::read (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{Ints_8hpp_a89f009aaf5d1964a000f44f09fa0bcf8}{uint24\+\_\+t}}}]{addr }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [override]}, {\ttfamily [virtual]}}



Read data from the component using the same method as the basic \mbox{\hyperlink{classComSquare_1_1Memory_1_1IMemory}{I\+Memory}}. 


\begin{DoxyParams}{Parameters}
{\em addr} & The local address to read from. 0x0 should refer to the first byte of this component on the fist bank. This method is responsible of mapping to the component\textquotesingle{}s read. \\
\hline
\end{DoxyParams}

\begin{DoxyExceptions}{Exceptions}
{\em \mbox{\hyperlink{classComSquare_1_1InvalidAddress}{Invalid\+Address}}} & if the address is not mapped to the component. \\
\hline
\end{DoxyExceptions}
\begin{DoxyReturn}{Returns}
Return the data at the address given as parameter. 
\end{DoxyReturn}


Implements \mbox{\hyperlink{classComSquare_1_1Memory_1_1IMemory_a8459ed12c4172ee29ecdc84330f99ff7}{Com\+Square\+::\+Memory\+::\+I\+Memory}}.

\mbox{\Hypertarget{classComSquare_1_1Memory_1_1IRectangleMemory_a2a239baa265b31e222d4e5b0a9d2d5e0}\label{classComSquare_1_1Memory_1_1IRectangleMemory_a2a239baa265b31e222d4e5b0a9d2d5e0}} 
\index{ComSquare::Memory::IRectangleMemory@{ComSquare::Memory::IRectangleMemory}!read\_internal@{read\_internal}}
\index{read\_internal@{read\_internal}!ComSquare::Memory::IRectangleMemory@{ComSquare::Memory::IRectangleMemory}}
\doxysubsubsection{\texorpdfstring{read\_internal()}{read\_internal()}}
{\footnotesize\ttfamily virtual uint8\+\_\+t Com\+Square\+::\+Memory\+::\+I\+Rectangle\+Memory\+::read\+\_\+internal (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{Ints_8hpp_a89f009aaf5d1964a000f44f09fa0bcf8}{uint24\+\_\+t}}}]{addr }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}



Internal component read. Implement this as you would implement a basic \mbox{\hyperlink{classComSquare_1_1Memory_1_1IMemory}{I\+Memory}}\textquotesingle{}s read. 


\begin{DoxyParams}{Parameters}
{\em addr} & The local address to read from. 0x0 refer to the first byte of your data and the address is in the component\textquotesingle{}s space. That means that you can consider this address as continuous \\
\hline
\end{DoxyParams}

\begin{DoxyExceptions}{Exceptions}
{\em This} & function should thrown an \mbox{\hyperlink{classComSquare_1_1InvalidAddress}{Invalid\+Address}} for address that are not mapped to the component. \\
\hline
\end{DoxyExceptions}
\begin{DoxyReturn}{Returns}
Return the data at the address given as parameter. 
\end{DoxyReturn}


Implemented in \mbox{\hyperlink{classComSquare_1_1Cartridge_1_1Cartridge_a940771d62cb665381e89d8c841fdad72}{Com\+Square\+::\+Cartridge\+::\+Cartridge}}.

\mbox{\Hypertarget{classComSquare_1_1Memory_1_1IRectangleMemory_a90bb7d98b2e8c2da70cc29c36ac70adc}\label{classComSquare_1_1Memory_1_1IRectangleMemory_a90bb7d98b2e8c2da70cc29c36ac70adc}} 
\index{ComSquare::Memory::IRectangleMemory@{ComSquare::Memory::IRectangleMemory}!setMemoryRegion@{setMemoryRegion}}
\index{setMemoryRegion@{setMemoryRegion}!ComSquare::Memory::IRectangleMemory@{ComSquare::Memory::IRectangleMemory}}
\doxysubsubsection{\texorpdfstring{setMemoryRegion()}{setMemoryRegion()}}
{\footnotesize\ttfamily void Com\+Square\+::\+Memory\+::\+I\+Rectangle\+Memory\+::set\+Memory\+Region (\begin{DoxyParamCaption}\item[{uint8\+\_\+t}]{start\+Bank,  }\item[{uint8\+\_\+t}]{end\+Bank,  }\item[{uint16\+\_\+t}]{start\+Page,  }\item[{uint16\+\_\+t}]{end\+Page }\end{DoxyParamCaption})}



Change starting and ending points of this mapped memory. 


\begin{DoxyParams}{Parameters}
{\em start\+Bank} & The first bank mapped to this component. \\
\hline
{\em end\+Bank} & The last bank mapped to this component. \\
\hline
{\em start\+Page} & The first page mapped to this component (every mapped banks will have this page mapped) \\
\hline
{\em end\+Page} & The end page mapped to this component (every mapped banks will have this pages lower than this mapped) \\
\hline
\end{DoxyParams}
\begin{DoxyWarning}{Warning}
The start/end address should be a rectangle. To mirror memory, use the \mbox{\hyperlink{classComSquare_1_1Memory_1_1MemoryShadow}{Memory\+Shadow}} class and not this one. 
\end{DoxyWarning}
\mbox{\Hypertarget{classComSquare_1_1Memory_1_1IRectangleMemory_a54b0ace13a17556f6072399ffed9b817}\label{classComSquare_1_1Memory_1_1IRectangleMemory_a54b0ace13a17556f6072399ffed9b817}} 
\index{ComSquare::Memory::IRectangleMemory@{ComSquare::Memory::IRectangleMemory}!write@{write}}
\index{write@{write}!ComSquare::Memory::IRectangleMemory@{ComSquare::Memory::IRectangleMemory}}
\doxysubsubsection{\texorpdfstring{write()}{write()}}
{\footnotesize\ttfamily void Com\+Square\+::\+Memory\+::\+I\+Rectangle\+Memory\+::write (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{Ints_8hpp_a89f009aaf5d1964a000f44f09fa0bcf8}{uint24\+\_\+t}}}]{addr,  }\item[{uint8\+\_\+t}]{data }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [override]}, {\ttfamily [virtual]}}



Write data to this component using the same method as the basic \mbox{\hyperlink{classComSquare_1_1Memory_1_1IMemory}{I\+Memory}}. 


\begin{DoxyParams}{Parameters}
{\em addr} & The local address to write data 0x0 should refer to the first byte of this component on the fist bank. This method is responsible of mapping to the component\textquotesingle{}s write. \\
\hline
{\em data} & The new data to write. \\
\hline
\end{DoxyParams}

\begin{DoxyExceptions}{Exceptions}
{\em \mbox{\hyperlink{classComSquare_1_1InvalidAddress}{Invalid\+Address}}} & if the address is not mapped to the component. \\
\hline
\end{DoxyExceptions}


Implements \mbox{\hyperlink{classComSquare_1_1Memory_1_1IMemory_a449bc89798a0b86028bb0413106514d9}{Com\+Square\+::\+Memory\+::\+I\+Memory}}.

\mbox{\Hypertarget{classComSquare_1_1Memory_1_1IRectangleMemory_ac37e86292b5e7b0bd099757c2e6263cc}\label{classComSquare_1_1Memory_1_1IRectangleMemory_ac37e86292b5e7b0bd099757c2e6263cc}} 
\index{ComSquare::Memory::IRectangleMemory@{ComSquare::Memory::IRectangleMemory}!write\_internal@{write\_internal}}
\index{write\_internal@{write\_internal}!ComSquare::Memory::IRectangleMemory@{ComSquare::Memory::IRectangleMemory}}
\doxysubsubsection{\texorpdfstring{write\_internal()}{write\_internal()}}
{\footnotesize\ttfamily virtual void Com\+Square\+::\+Memory\+::\+I\+Rectangle\+Memory\+::write\+\_\+internal (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{Ints_8hpp_a89f009aaf5d1964a000f44f09fa0bcf8}{uint24\+\_\+t}}}]{addr,  }\item[{uint8\+\_\+t}]{data }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [pure virtual]}}



Internal component write. Implement this as you would implement a basic \mbox{\hyperlink{classComSquare_1_1Memory_1_1IMemory}{I\+Memory}}\textquotesingle{}s write. 


\begin{DoxyParams}{Parameters}
{\em addr} & The local address to write to. 0x0 refer to the first byte of your data and the address is in the component\textquotesingle{}s space. That means that you can consider this address as continuous \\
\hline
{\em data} & The new data to write. \\
\hline
\end{DoxyParams}

\begin{DoxyExceptions}{Exceptions}
{\em This} & function should thrown an \mbox{\hyperlink{classComSquare_1_1InvalidAddress}{Invalid\+Address}} for address that are not mapped to the component. \\
\hline
\end{DoxyExceptions}


Implemented in \mbox{\hyperlink{classComSquare_1_1Cartridge_1_1Cartridge_a02d9c1db34d043234aef35a7357356fd}{Com\+Square\+::\+Cartridge\+::\+Cartridge}}.



\doxysubsection{Member Data Documentation}
\mbox{\Hypertarget{classComSquare_1_1Memory_1_1IRectangleMemory_acc2002b644d61a7dc4d40c92e0b93a3d}\label{classComSquare_1_1Memory_1_1IRectangleMemory_acc2002b644d61a7dc4d40c92e0b93a3d}} 
\index{ComSquare::Memory::IRectangleMemory@{ComSquare::Memory::IRectangleMemory}!\_endBank@{\_endBank}}
\index{\_endBank@{\_endBank}!ComSquare::Memory::IRectangleMemory@{ComSquare::Memory::IRectangleMemory}}
\doxysubsubsection{\texorpdfstring{\_endBank}{\_endBank}}
{\footnotesize\ttfamily uint8\+\_\+t Com\+Square\+::\+Memory\+::\+I\+Rectangle\+Memory\+::\+\_\+end\+Bank = 0\hspace{0.3cm}{\ttfamily [private]}}



The last bank to map to. 

\mbox{\Hypertarget{classComSquare_1_1Memory_1_1IRectangleMemory_aece911d747bb326279bc7e661e06a9a3}\label{classComSquare_1_1Memory_1_1IRectangleMemory_aece911d747bb326279bc7e661e06a9a3}} 
\index{ComSquare::Memory::IRectangleMemory@{ComSquare::Memory::IRectangleMemory}!\_endPage@{\_endPage}}
\index{\_endPage@{\_endPage}!ComSquare::Memory::IRectangleMemory@{ComSquare::Memory::IRectangleMemory}}
\doxysubsubsection{\texorpdfstring{\_endPage}{\_endPage}}
{\footnotesize\ttfamily uint16\+\_\+t Com\+Square\+::\+Memory\+::\+I\+Rectangle\+Memory\+::\+\_\+end\+Page = 0\hspace{0.3cm}{\ttfamily [private]}}



The last address of each bank to map. 

\mbox{\Hypertarget{classComSquare_1_1Memory_1_1IRectangleMemory_a94658df7460fd7f9f59f22955d93bf6b}\label{classComSquare_1_1Memory_1_1IRectangleMemory_a94658df7460fd7f9f59f22955d93bf6b}} 
\index{ComSquare::Memory::IRectangleMemory@{ComSquare::Memory::IRectangleMemory}!\_startBank@{\_startBank}}
\index{\_startBank@{\_startBank}!ComSquare::Memory::IRectangleMemory@{ComSquare::Memory::IRectangleMemory}}
\doxysubsubsection{\texorpdfstring{\_startBank}{\_startBank}}
{\footnotesize\ttfamily uint8\+\_\+t Com\+Square\+::\+Memory\+::\+I\+Rectangle\+Memory\+::\+\_\+start\+Bank = 0\hspace{0.3cm}{\ttfamily [private]}}



The first bank to map to. 

\mbox{\Hypertarget{classComSquare_1_1Memory_1_1IRectangleMemory_a9178184277528ac54064ca6caacab474}\label{classComSquare_1_1Memory_1_1IRectangleMemory_a9178184277528ac54064ca6caacab474}} 
\index{ComSquare::Memory::IRectangleMemory@{ComSquare::Memory::IRectangleMemory}!\_startPage@{\_startPage}}
\index{\_startPage@{\_startPage}!ComSquare::Memory::IRectangleMemory@{ComSquare::Memory::IRectangleMemory}}
\doxysubsubsection{\texorpdfstring{\_startPage}{\_startPage}}
{\footnotesize\ttfamily uint16\+\_\+t Com\+Square\+::\+Memory\+::\+I\+Rectangle\+Memory\+::\+\_\+start\+Page = 0\hspace{0.3cm}{\ttfamily [private]}}



The first address of each bank to map. 



The documentation for this class was generated from the following files\+:\begin{DoxyCompactItemize}
\item 
sources/\+Memory/\mbox{\hyperlink{IRectangleMemory_8hpp}{I\+Rectangle\+Memory.\+hpp}}\item 
sources/\+Memory/\mbox{\hyperlink{IRectangleMemory_8cpp}{I\+Rectangle\+Memory.\+cpp}}\end{DoxyCompactItemize}
