Fix various size_t related warnings and errors
[kugel-rb.git] / manual / plugins / chip8emulator.tex
blobc410396039031150a463df3692144c27444dd9d8
1 \subsection{\label{ref:Chip8emulator}Chip{}-8 Emulator}
2 Chip8 is a kind of assembly language for a long-gone architecture.
3 This plugin runs games written using the chip8 instructions.
4 To start a game open a \fname{.ch8} file in the \setting{File Browser}
6 There are lots of tiny Chip8 games (usually only about 256 bytes to a
7 couple of KB) which were made popular by the HP48
8 calculator's emulator for them. The original Chip8 had
9 64x32 pixel graphics, and the new superchip emulator supports 128x64
10 graphics.
12 The only problem is that they are based on a 4x4 keyboard, but since most
13 games do not use all of the buttons, this can easily be worked around.
15 To do this, one may put a \fname{.c8k} file with the same name as the
16 original program which contains new key mappings (for \fname{BLINKY.ch8}, one
17 writes a \fname{BLINKY.c8k} file). That \fname{.c8k} file contains 16
18 characters describing the mapping from the Chip8 keyboard to the default key
19 mapping (that way, several Chip8 keys can be pressed using only one
20 Rockbox key). For example, a file containing the single line:
21 \begin{code}
22 0122458469ABCDEF
23 \end{code}
24 would correspond to the following non-default mappings:
26 3 $\rightarrow$ 2, 6 $\rightarrow$ 8, 7 $\rightarrow$4, 8 $\rightarrow$ 6.
28 The default keymappings are:
29 \begin{table}
30 \begin{center}
31 \begin{tabularx}{.9\textwidth}{c|ccccccccccccccccc}
32 \toprule
33 Chip8 & Off & 0 & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9
34 & A & B & C & D & E & F\\
35 \midrule
36 \begin{sideways}Key\end{sideways}
38 % key "off"
39 \begin{sideways}
40 \opt{RECORDER_PAD,ONDIO_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOff}
41 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonMenu}
42 \opt{IAUDIO_X5_PAD,IRIVER_H10_PAD,SANSA_E200_PAD,SANSA_C200_PAD%
43 ,GIGABEAT_PAD,MROBE100_PAD,SANSA_FUZE_PAD}
44 {\ButtonPower}
45 \opt{GIGABEAT_S_PAD}{\ButtonBack}
46 \opt{PBELL_VIBE500_PAD}{\ButtonRec}
47 \end{sideways}
49 % Key "0"
51 % "Key "1"
52 \begin{sideways}
53 \opt{RECORDER_PAD}{\ButtonFOne}
54 \opt{ONDIO_PAD}{\ButtonUp}
55 \opt{GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD}{\ButtonMenu}
56 \end{sideways}
58 % Key "2"
59 \begin{sideways}
60 \opt{RECORDER_PAD,ONDIO_PAD}{\ButtonUp}
61 \opt{IPOD_4G_PAD,IPOD_3G_PAD,SANSA_E200_PAD,SANSA_FUZE_PAD}
62 {\ButtonScrollBack}
63 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD,GIGABEAT_PAD%
64 ,GIGABEAT_S_PAD,MROBE100_PAD,PBELL_VIBE500_PAD}{\ButtonUp}
65 \opt{IRIVER_H10_PAD}{\ButtonScrollUp}
66 \opt{SANSA_C200_PAD}{\ButtonVolUp}
67 \end{sideways}
69 % Key "3"
70 \begin{sideways}
71 \opt{RECORDER_PAD}{\ButtonFThree}
72 \opt{MROBE100_PAD}{\ButtonPlay}
73 \opt{GIGABEAT_PAD,GIGABEAT_S_PAD}{\ButtonVolDown}
74 \end{sideways}
76 % Key "4"
77 \begin{sideways}
78 \opt{RECORDER_PAD,ONDIO_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD,IPOD_4G_PAD%
79 ,IPOD_3G_PAD,IAUDIO_X5_PAD,IRIVER_H10_PAD,SANSA_E200_PAD%
80 ,SANSA_C200_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD%
81 ,SANSA_FUZE_PAD,PBELL_VIBE500_PAD}
82 {\ButtonLeft}
83 \end{sideways}
85 % Key "5"
86 \begin{sideways}
87 \opt{RECORDER_PAD}{\ButtonPlay}
88 \opt{ONDIO_PAD}{\ButtonMenu}
89 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IAUDIO_X5_PAD,SANSA_E200_PAD%
90 ,SANSA_C200_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD%
91 ,SANSA_FUZE_PAD}
92 {\ButtonSelect}
93 \opt{IPOD_4G_PAD,IPOD_3G_PAD,IRIVER_H10_PAD}{\ButtonPlay}
94 \opt{PBELL_VIBE500_PAD}{\ButtonOK}
95 \end{sideways}
97 % Key "6"
98 \begin{sideways}
99 \opt{RECORDER_PAD,ONDIO_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD,IPOD_4G_PAD%
100 ,IPOD_3G_PAD,IAUDIO_X5_PAD,IRIVER_H10_PAD,SANSA_E200_PAD%
101 ,SANSA_C200_PAD,GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD%
102 ,SANSA_FUZE_PAD,PBELL_VIBE500_PAD}
103 {\ButtonRight}
104 \end{sideways}
106 % Key "7"
107 \begin{sideways}
108 \opt{RECORDER_PAD}{\ButtonFTwo}
109 \opt{MROBE100_PAD}{\ButtonDisplay}
110 \opt{GIGABEAT_PAD,GIGABEAT_S_PAD}{\ButtonVolUp}
111 \end{sideways}
113 % Key "8"
114 \begin{sideways}
115 \opt{RECORDER_PAD,ONDIO_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD%
116 ,GIGABEAT_PAD,GIGABEAT_S_PAD,MROBE100_PAD,PBELL_VIBE500_PAD}{\ButtonDown}
117 \opt{IPOD_4G_PAD,IPOD_3G_PAD,SANSA_E200_PAD,SANSA_FUZE_PAD}
118 {\ButtonScrollFwd}
119 \opt{IAUDIO_X5_PAD}{\ButtonDown}
120 \opt{IRIVER_H10_PAD}{\ButtonScrollDown}
121 \opt{SANSA_C200_PAD}{\ButtonVolDown}
122 \end{sideways}
124 % Key "9"
125 \begin{sideways}
126 \opt{RECORDER_PAD}{\ButtonOn}
127 \opt{GIGABEAT_PAD}{\ButtonA}
128 \opt{GIGABEAT_S_PAD}{\ButtonPlay}
129 \end{sideways}
131 % Key "A"
133 % Key "B"
135 % Key "C"
137 % Key "D"
139 % Key "E"
141 % Key "F"
142 \\\bottomrule
143 \end{tabularx}
144 \end{center}
145 \end{table}
147 Some places where can you can find \fname{.ch8} files:
148 \begin{itemize}
149 \item The PluginChip8 page on www.rockbox.org has several attached:
150 \wikilink{PluginChip8}
151 \item Check out the HP48 chip games section:
152 \url{http://www.hpcalc.org/hp48/games/chip/}
153 \item PC emulator by the guy who wrote the HP48 emulator:
154 \url{http://www.pdc.kth.se/~lfo/chip8/CHIP8.htm}
155 \item Links to other chip8 emulators:
156 \url{http://www.zophar.net/chip8.html}
157 \end{itemize}