Revision 367
added report
proj/libs/utils/include/errors.h | ||
---|---|---|
3 | 3 |
|
4 | 4 |
/** |
5 | 5 |
* @defgroup errors errors |
6 |
* @ingroup utils |
|
6 | 7 |
* @brief Error codes. |
7 | 8 |
* |
8 | 9 |
* @{ |
proj/report/report.tex | ||
---|---|---|
152 | 152 |
\end{figure} |
153 | 153 |
\pagebreak |
154 | 154 |
\subsection{Multiplayer} |
155 |
In multiplayer mode, |
|
155 |
In multiplayer mode, \textcolor{red}{INCOMPLETE}.
|
|
156 | 156 |
\pagebreak |
157 | 157 |
\subsection{Chat} |
158 | 158 |
This chat tool was initially designed as a simple, text mode, test communication between different machines. We have however decided to include it as a functionality in the project for a number of reasons: |
... | ... | |
166 | 166 |
\includegraphics[scale=0.45]{chat01} |
167 | 167 |
\caption{Chat environment} |
168 | 168 |
\end{figure} |
169 |
The chat can be used for exchanging messages of up to 75 characters directy writable with the keyboard. The character limit was imposed to prevent strings from rendering as wider than the input box, and the fact they should be directy writable with the keyboard simplifies the process of capturing scancodes, having as downside not allowing to write characters that require more than one key press (like exclamation or question marks in a Portuguese keyboard). \par
|
|
169 |
The chat can be used for exchanging messages of up to 75 characters directly writable with the keyboard. The character limit was imposed to prevent strings from rendering as wider than the input box, and the fact they should be directly writable with the keyboard simplifies the process of capturing scancodes, having as downside not allowing to write characters that require more than one key press (like exclamation or question marks in a Portuguese keyboard). \par
|
|
170 | 170 |
\begin{figure}[H] \centering |
171 | 171 |
\begin{subfigure}[b]{0.48\linewidth} |
172 | 172 |
\includegraphics[width=\linewidth]{chat02_01} |
... | ... | |
201 | 201 |
Timer interrupts regulate screen refreshing, which happens at a rate of 60Hz. In all game modes, timer interrupts serve not only the purpose of refreshing the screen, but also to process all the game data: collisions, movement, path-finding algorithms, etc. \par |
202 | 202 |
To manage timer interrupt subscriptions, functions \texttt{subscribe\_timer\_interrupt}, \texttt{timer\_int\_handler} and \texttt{timer\_get\_no\_interrupts} were implemented and used. |
203 | 203 |
\subsection{Keyboard} |
204 |
The keyboard was configured to issue interrupts on key presses and releases. |
|
205 |
|
|
206 |
To manage keyboard interrupt subscription, function \texttt{subscribe\_kbc\_interrupt, } was implemented. To manage keyboard interrupts, functions \texttt{kbc\_ih}, \texttt{keyboard\_get\_scancode} were implemented and used. |
|
207 |
|
|
208 |
\func{Keyboard in interrupt mode.} |
|
204 |
The keyboard was configured to issue interrupts on key presses and releases. \par |
|
205 |
The keyboard is used to control some menus (namely using \textbf{ESC}), to input text in the chat, and to control player movement in the game and zoom in/out options.\par |
|
206 |
To manage keyboard interrupt subscription, function \texttt{subscribe\_kbc\_interrupt} was implemented. To manage keyboard interrupts, functions \texttt{kbc\_ih}, \texttt{keyboard\_get\_done}, \texttt{keyboard\_get\_scancode} and \linebreak \texttt{update\_key\_presses} were implemented and used. |
|
209 | 207 |
\subsection{Mouse} |
210 |
\func{Mouse buttons and movement in interrupt mode.} |
|
208 |
The mouse was configured to issue interrupts on movement and button presses. \par |
|
209 |
The mouse is used to control all menus (position and buttons), as well as allowing the player to aim at the opponents (position) and shoot bullets (buttons). \par |
|
210 |
To manage mouse interrupt subscription, function \texttt{subscribe\_mouse\_interrupt} was implemented. To manage mouse interrupts, functions \texttt{mouse\_ih}, \texttt{mouse\_parse\_packet} and \texttt{update\_mouse}, among others, were implemented. |
|
211 | 211 |
\subsection{Video card} |
212 |
\func{Video Card in graphic mode with direct color encoding, dynamic updating of VRAM/screen.} |
|
212 |
The video card was configured to work in graphic mode with direct color encoding, with resolution 1024x768 pixels and 8 bits for each color component Red, Green and Blue, yielding a total of approximately 16.8 million colors. \par |
|
213 |
Simple buffering was used to eliminate flickering. All graphics are first drawn to the scree buffer, and only after all graphical operations (that is, at the end of the processing of the timer interrupt) is the buffer information copied to the VRAM. \par |
|
214 |
The modules \texttt{rectangle\_t} and \texttt{menu\_t} were developed for displaying simple shapes and menus. The modules \texttt{basic\_sprite\_t} and \texttt{sprite\_t} were developed for displaying moving sprites, allowing for rotation around the "center" of the image, as well as scaling and movement. \par |
|
215 |
The modules \texttt{font\_t} and \texttt{text\_t} were developed to allow for dynamic rendering of text, using as default (and, for now, sole) font Consolas. The only type of supported fonts are bitmap fonts. \par |
|
216 |
Configuration of the UART was made using the functions \texttt{graph\_init} and \texttt{graph\_cleanup} developed during the project. Drawing to the buffer is made primarily through the functions \texttt{graph\_get\_XRes}, \linebreak \texttt{graph\_get\_YRes}, \texttt{graph\_set\_pixel}, \texttt{graph\_clear\_screen} and \texttt{graph\_draw}.\par |
|
217 |
Basic sprites are constructed from small XPM files, or loaded at runtime from XPM2 files. A XPM2 file is a XPM file stripped from all the C syntax, leaving only the strings. This format is easier to load at runtime than XPM. A XPM file can be easily converted to a XPM2 file using the function \texttt{xpm\_save\_as\_xpm2}. All XPM arrays of strings are loaded to bitmaps using the function \texttt{xpm\_load} provided by the LCF. |
|
213 | 218 |
\subsection{Real-Time Clock (RTC)} |
214 |
\func{Use of the RTC functionalities needed to implement the requirements stated in the role of the device.}
|
|
219 |
\textcolor{red}{INCOMPLETE (TELMO)}
|
|
215 | 220 |
\subsection{Serial port} |
216 |
\func{Point-to-point communication between two computers.} |
|
221 |
The UART was configured to issue interrupts for Receiver Ready and Transmitter Empty. Communication is processed with the same parameters at both ends, at a bit-rate of 115200bps, 8 bits per char, 2 stop bits. UART FIFOs are not used. The protocols that were developed will be discussed in section \ref{sec:details}. \par |
|
222 |
In multiplayer mode, data is transferred from host to remote at a frequency of 60Hz, with each message having at least 24 bytes. Data transference from remote to host is made whenever needed, with each message having on average 9 bytes. |
|
217 | 223 |
\pagebreak |
218 | 224 |
\section{Code organization/structure} |
219 |
Hey |
|
220 |
\section{Implementation details} |
|
221 |
Hey |
|
225 |
\subsection{\texttt{libs}} |
|
226 |
Collection of useful classes and functions. This module was developed with the goal of being as general and independent from \texttt{proj} as possible, although there are rare occasions where sub-modules of \texttt{libs} include sub-modules of \texttt{proj}. |
|
227 |
\subsubsection{\texttt{classes}} |
|
228 |
Provides classes \texttt{list\_t} and \texttt{queue\_t}. These classes achieve generality by storing pointers to \texttt{void}, which have as major disadvantage requiring the use of \texttt{free}. \par |
|
229 |
\textcolor{red}{CONTINUE LIBS MODULES} |
|
230 |
\subsection{\texttt{proj}} |
|
231 |
\textcolor{red}{MAKE PROJ MODULES} |
|
232 |
\section{Implementation details} \label{sec:details} |
|
233 |
\textcolor{red}{WRITE IMPLEMENTATION DETAILS} |
|
234 |
\subsection{XPM and XPM2} |
|
235 |
\textcolor{red}{WRITE STUFF} |
|
236 |
\subsection{Communication protocols} |
|
237 |
\textcolor{red}{WRITE IMPLEMENTATION DETAILS} |
|
222 | 238 |
\section{Conclusions} |
223 |
Hey
|
|
239 |
\textcolor{red}{WRITE CONCLUSION}
|
|
224 | 240 |
\end{document} |
Also available in: Unified diff