Skip to content

Commit

Permalink
�updated changelog, and clarified strings/words a bit further
Browse files Browse the repository at this point in the history
  • Loading branch information
ahrnbom committed Nov 26, 2020
1 parent a19e490 commit 93aaace
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion gbasmdev.tex
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ \section{Defining data}
\label{defdata}
When you write code, it will be compiled into simple numbers to be stored in the ROM file. It is possible to generate arbitrary numbers into the ROM file, which can be used for many things that are not necessarily game code to be executed on the CPU. Since the Game Boy CPU is so limited, it is often a good idea to precompute any complicated calculations, if possible, and store the results in a table in the ROM, where the Game Boy can simply read the results instead of trying to compute them. This can be useful for things like trigonometric functions (to have an object move like a sine-wave across the screen, for example). Computing a sine-wave in real-time on the Game Boy CPU would probably be a lot slower than just having a pre-computed one which can be read from the ROM.

To define such a table, it is a good idea to create a label at the top, so that the table can be referred to in code. There exist compiler commands for defining such data: |db| (to define data as bytes, 8-bit numbers) and |dw| (to define 16-bit numbers, called "words"; nothing to do with strings!). For example
To define such a table, it is a good idea to create a label at the top, so that the table can be referred to in code. There exist compiler commands for defining such data: |db| (to define data as bytes, 8-bit numbers) and |dw| (to define 16-bit numbers, called "words"; this has nothing to do with human words, typically stored as strings). For example

\begin{code}
SomeTable:
Expand Down Expand Up @@ -1483,6 +1483,7 @@ \chapter{Version history}
\item Version 1.3: Fixed a minor error about |xor| usage. Thanks u/insta\_\_mash! Also fixed a typo on page 17. Thanks kwdiggs!
\item Version 1.4: Fixes several errors found by JL2210. Thanks!
\item Version 1.5: Fixes some links, including one pointed out by JL2210. Thanks!
\item Version 1.6 (in progress): Fixed a link and a clarification about words/strings.
\end{itemize}

\end{document}

0 comments on commit 93aaace

Please sign in to comment.