doc/mgba.6 (view raw)
1.\" Copyright (c) 2015 Anthony J. Bentley <anthony@anjbe.name>
2.\"
3.\" This Source Code Form is subject to the terms of the Mozilla Public
4.\" License, v. 2.0. If a copy of the MPL was not distributed with this
5.\" file, you can obtain one at https://mozilla.org/MPL/2.0/.
6.Dd July 29, 2015
7.Dt MGBA 6
8.Os
9.Sh NAME
10.Nm mgba
11.Nd Game Boy Advance emulator
12.Sh SYNOPSIS
13.Nm mgba
14.Op Fl 123456dfg
15.Op Fl b Ar biosfile
16.Op Fl c Ar cheatfile
17.Op Fl l Ar loglevel
18.Op Fl p Ar patchfile
19.Op Fl s Ar n
20.Op Fl v Ar moviefile
21.Ar file
22.Sh DESCRIPTION
23.Nm
24is a Game Boy Advance emulator.
25The options are as follows:
26.Bl -tag -width Ds
27.It Fl 1
28Scale the window 1\(mu.
29.It Fl 2
30Scale the window 2\(mu.
31.It Fl 3
32Scale the window 3\(mu.
33.It Fl 4
34Scale the window 4\(mu.
35.It Fl 5
36Scale the window 5\(mu.
37.It Fl 6
38Scale the window 6\(mu.
39.It Fl b Ar biosfile , Fl -bios Ar biosfile
40Specify a BIOS file to use during boot.
41If this flag is omitted,
42.Nm
43will use a high\(hylevel emulated BIOS.
44.It Fl c Ar cheatfile , Fl -cheats Ar cheatfile
45Apply cheat codes from
46.Ar cheatfile .
47.It Fl d
48Start emulating via the command\(hyline debugger.
49.It Fl f
50Start the emulator full\(hyscreen.
51.It Fl g
52Start a
53.Xr gdb 1
54session.
55By default the session starts on port 2345.
56.It Fl l Ar loglevel
57Log messages during emulation to
58.Dv stdout .
59.Ar loglevel
60is a bitmask defining which types of messages to log:
61.Bl -inset
62.It 0x01
63fatal errors
64.It 0x02
65errors
66.It 0x04
67warnings
68.It 0x08
69informative messages
70.It 0x10
71debugging messages
72.It 0x20
73stub messages
74.It 0x100
75in\(hygame errors
76.It 0x200
77software interrupts
78.It 0x400
79emulator status messages
80.It 0x800
81serial I/O messages
82.El
83The default is to log warnings, errors, fatal errors, and status messages.
84.It Fl p Ar patchfile , Fl -patch Ar patchfile
85Specify a patch file in IPS or UPS format.
86.It Fl s Ar n , Fl -frameskip Ar n
87Skip every
88.Ar n
89frames.
90.It Fl v Ar moviefile , Fl -movie Ar moviefile
91Play back a movie of recording input from
92.Ar moviefile .
93.El
94.Sh CONTROLS
95The default controls are as follows:
96.Bl -hang -width "Frame advance" -compact
97.It A
98.Cm x
99.It B
100.Cm z
101.It L
102.Cm a
103.It R
104.Cm s
105.It Start
106.Aq Cm Enter
107.It Select
108.Aq Cm Backspace
109.It Load state
110.Cm F1 Ns \(en Ns Cm F9
111.It Save state
112.Ao Cm Shift Ac Ns \(hy Ns Cm F1 Ns \(en Ns Cm F9
113.It Frame advance
114.Ao Cm Ctrl Ac Ns \(hy Ns Cm n
115.El
116.Sh DEBUGGER
117When
118.Nm
119is run with the
120.Fl d
121option, the command\(hyline debugger is enabled.
122It supports the following commands:
123.Pp
124.Bl -tag -compact -width 1
125.It Cm b Ns Oo Cm reak Oc Ar address
126.It Cm b Ns Oo Cm reak Oc Ns Cm /a Ar address
127.It Cm b Ns Oo Cm reak Oc Ns Cm /t Ar address
128Set a breakpoint \(en ARM
129.Pq Ql /a ,
130Thumb
131.Pq Ql /t ,
132or the current CPU mode \(en at
133.Ar address .
134.It Cm c Ns Op Cm ontinue
135Continue execution.
136.It Cm d Ns Oo elete Oc Ar address
137Delete a breakpoint at
138.Ar address .
139.It Cm dis Ns Oo Cm asm Oc Ar address Op Ar count
140.It Cm dis Ns Oo Cm asm Oc Ns Cm /a Ar address Op Ar count
141.It Cm dis Ns Oo Cm asm Oc Ns Cm /t Ar address Op Ar count
142.It Cm dis Ns Oo Cm assemble Oc Ar address Op Ar count
143.It Cm dis Ns Oo Cm assemble Oc Ns Cm /a Ar address Op Ar count
144.It Cm dis Ns Oo Cm assemble Oc Ns Cm /t Ar address Op Ar count
145Disassemble
146.Ar count
147instructions starting at
148.Ar address ,
149as ARM
150.Pq Ql /a ,
151Thumb
152.Pq Ql /t ,
153or the current CPU mode.
154If
155.Ar count
156is not specified, only disassemble the instruction at
157.Ar address .
158.It Cm h Ns Op Cm elp
159Print help.
160.It Cm i Ns Op Cm nfo
161.It Cm status
162Print the current contents of general\(hypurpose registers.
163.It Cm n Ns Op Cm ext
164Execute the next instruction.
165.It Cm p Ns Oo Cm rint Oc Ar value ...
166.It Cm p Ns Oo Cm rint Oc Ns Cm /t Ar value ...
167.It Cm p Ns Oo Cm rint Oc Ns Cm /x Ar value ...
168Print one or more
169.Ar value Ns s
170as binary
171.Pq Ql /t ,
172hexadecimal
173.Pq Ql /x ,
174or decimal.
175.It Cm q Ns Op Cm uit
176Quit the emulator.
177.It Cm reset
178Reset the emulation.
179.It Cm r/1 Ar address
180.It Cm r/2 Ar address
181.It Cm r/4 Ar address
182Read a byte
183.Pq Ql /1 ,
184halfword
185.Pq Ql /2 ,
186or word
187.Pq Ql /4
188from
189.Ar address .
190.It Cm w Ns Oo Cm atch Oc Ar address
191Set a watchpoint at
192.Ar address .
193.It Cm w/1 Ar address
194.It Cm w/2 Ar address
195.It Cm w/4 Ar address
196Write a byte
197.Pq Ql /1 ,
198halfword
199.Pq Ql /2 ,
200or word
201.Pq Ql /4
202to
203.Ar address .
204.It Cm w/r Ar register
205Write a word to
206.Ar register .
207.It Cm x/1 Ar address
208.It Cm x/2 Ar address
209.It Cm x/4 Ar address
210Examine bytes
211.Pq Ql /1 ,
212halfwords
213.Pq Ql /2 ,
214or words
215.Pq Ql /4
216from
217.Ar address .
218.It Cm \&!\ \&
219Break into the attached debugger.
220.El
221.Sh AUTHORS
222.An Jeffrey Pfau Aq Mt jeffrey@endrift.com
223.Sh HOMEPAGE
224.Bl -bullet
225.It
226.Lk https://mgba.io/ "mGBA homepage"
227.It
228.Lk https://github.com/mgba-emu/mgba "Development repository"
229.It
230.Lk https://github.com/mgba-emu/mgba/issues "Bug tracker"
231.It
232.Lk https://forums.mgba.io/ "Message board"
233.El