OXYGENHUB
◆ main openmsx / doc / manual / commands.html
219.0 KiB · HTML · last changed chore(): initial commit 1 month ago source blame history raw
e8555c89 Andy McCall 1
<!DOCTYPE html>
2
<html lang="en">
3
<head>
4
  <meta charset="utf-8">
5
  <link title="Purple" rel="stylesheet" href="manual-purple.css" type="text/css">
6
  <link title="Minty" rel="alternate stylesheet" href="manual-minty.css" type="text/css">
7
  <link title="Plain" rel="alternate stylesheet" href="manual.css" type="text/css">
8
  <title>openMSX Console Command Reference</title>
9
</head>
10
11
<body>
12
  <h1>openMSX Console Command Reference</h1>
13
14
  <ol class="inlinetoccat">
15
    <li><a class="internal" href="#introduction">Introduction</a></li>
16
    <li><a class="internal" href="#commands">Commands</a>
17
18
      <ol class="inlinetoc">
19
        <li><a class="internal" href="#after">after</a></li>
20
        <li><a class="internal" href="#bind">bind / unbind / bind_default / unbind_default / activate_input_layer / deactivate_input_layer</a></li>
21
        <li><a class="internal" href="#cart">cart / cart&lt;x&gt;</a></li>
22
        <li><a class="internal" href="#cassetteplayer">cassetteplayer</a></li>
23
        <li><a class="internal" href="#cd">cd&lt;x&gt;</a></li>
24
        <li><a class="internal" href="#cycle">cycle / cycle_back</a></li>
25
        <li><a class="internal" href="#cycle_machine">cycle_machine / cycle_back_machine</a></li>
26
        <li><a class="internal" href="#debug">debug</a></li>
27
        <li><a class="internal" href="#disk">disk&lt;x&gt; / virtual_drive</a></li>
28
        <li><a class="internal" href="#diskmanipulator">diskmanipulator</a></li>
29
        <li><a class="internal" href="#escape_grab">escape_grab</a></li>
30
        <li><a class="internal" href="#exit">exit</a></li>
31
        <li><a class="internal" href="#ext">ext / ext&lt;x&gt;</a></li>
32
        <li><a class="internal" href="#filepool">filepool</a></li>
33
        <li><a class="internal" href="#findcheat">findcheat</a></li>
34
        <li><a class="internal" href="#get_clipboard_text">get_clipboard_text</a></li>
35
        <li><a class="internal" href="#hd">hd&lt;x&gt;</a></li>
36
        <li><a class="internal" href="#help">help</a></li>
37
        <li><a class="internal" href="#incr">incr</a></li>
38
        <li><a class="internal" href="#iomap">iomap</a></li>
39
        <li><a class="internal" href="#keymatrix">keymatrixdown / keymatrixup</a></li>
40
        <li><a class="internal" href="#laserdiscplayer">laserdiscplayer</a></li>
41
        <li><a class="internal" href="#list_extensions">list_extensions</a></li>
42
        <li><a class="internal" href="#load_settings">load_settings</a></li>
43
        <li><a class="internal" href="#machine">machine</a></li>
44
        <li><a class="internal" href="#machines">create_machine / load_machine / activate_machine / list_machines / delete_machine</a></li>
45
        <li><a class="internal" href="#machine_info">machine_info</a></li>
46
        <li><a class="internal" href="#message">message</a></li>
47
        <li><a class="internal" href="#monitor_type">monitor_type</a></li>
48
        <li><a class="internal" href="#msxcode2unicode">msxcode2unicode</a></li>
49
        <li><a class="internal" href="#mute_channels">mute_channels / unmute_channels / solo</a></li>
50
        <li><a class="internal" href="#nowind">nowind&lt;x&gt;</a></li>
51
        <li><a class="internal" href="#openmsx_info">openmsx_info</a></li>
52
        <li><a class="internal" href="#openmsx_update">openmsx_update</a></li>
53
        <li><a class="internal" href="#osd">osd</a></li>
54
        <li><a class="internal" href="#palette">palette</a></li>
55
        <li><a class="internal" href="#plugunplug">plug / unplug</a></li>
56
        <li><a class="internal" href="#psg_profile">psg_profile</a></li>
57
        <li><a class="internal" href="#record">record</a></li>
58
        <li><a class="internal" href="#record_channels">record_channels</a></li>
59
        <li><a class="internal" href="#remove_extension">remove_extension</a></li>
60
        <li><a class="internal" href="#reset">reset</a></li>
61
        <li><a class="internal" href="#reverse">reverse</a></li>
62
        <li><a class="internal" href="#save_settings">save_settings</a></li>
63
        <li><a class="internal" href="#savestate">savestate / loadstate / list_savestates / delete_savestate</a></li>
64
        <li><a class="internal" href="#screenshot">screenshot</a></li>
65
        <li><a class="internal" href="#set">set</a></li>
66
        <li><a class="internal" href="#set_clipboard_text">set_clipboard_text</a></li>
67
        <li><a class="internal" href="#setup">setup</a></li>
68
        <li><a class="internal" href="#sha1sum">sha1sum</a></li>
69
        <li><a class="internal" href="#slotmap">slotmap</a></li>
70
        <li><a class="internal" href="#slotselect">slotselect</a></li>
71
        <li><a class="internal" href="#soundlog">soundlog</a></li>
72
        <li><a class="internal" href="#store_machine">store_machine / restore_machine</a></li>
73
        <li><a class="internal" href="#store_setup">store_setup</a></li>
74
        <li><a class="internal" href="#test_machine">test_machine</a></li>
75
        <li><a class="internal" href="#toggle">toggle</a></li>
76
        <li><a class="internal" href="#trainer">trainer</a></li>
77
        <li><a class="internal" href="#type">type / type_via_keyboard</a></li>
78
        <li><a class="internal" href="#unicode2msxcode">unicode2msxcode</a></li>
79
        <li><a class="internal" href="#unset">unset</a></li>
80
        <li><a class="internal" href="#user_setting">user_setting</a></li>
81
        <li><a class="internal" href="#vdpregs">vdpregs</a></li>
82
        <li><a class="internal" href="#other">other</a></li>
83
      </ol>
84
    </li>
85
86
    <li><a class="internal" href="#settings">Settings</a>
87
88
      <ol class="inlinetoc">
89
        <li><a class="internal" href="#accuracy">accuracy</a></li>
90
        <li><a class="internal" href="#audio-inputfilename">audio-inputfilename</a></li>
91
        <li><a class="internal" href="#autoruncassettes">autoruncassettes</a></li>
92
        <li><a class="internal" href="#autorunlaserdisc">autorunlaserdisc</a></li>
93
        <li><a class="internal" href="#auto_enable_reverse">auto_enable_reverse</a></li>
94
        <li><a class="internal" href="#auto_save_replay">auto_save_replay</a></li>
95
        <li><a class="internal" href="#blur">blur</a></li>
96
        <li><a class="internal" href="#bootsector">bootsector</a></li>
97
        <li><a class="internal" href="#brightness">brightness</a></li>
98
        <li><a class="internal" href="#cmdtiming">cmdtiming</a></li>
99
        <li><a class="internal" href="#color_matrix">color_matrix</a></li>
100
        <li><a class="internal" href="#console">console</a></li>
101
        <li><a class="internal" href="#contrast">contrast</a></li>
102
        <li><a class="internal" href="#cputrace">cputrace</a></li>
103
        <li><a class="internal" href="#debugoutput">Debug Device output</a></li>
104
        <li><a class="internal" href="#default_machine">default_machine</a></li>
105
        <li><a class="internal" href="#default_setup">default_setup</a></li>
106
        <li><a class="internal" href="#deflicker">deflicker</a></li>
107
        <li><a class="internal" href="#deinterlace">deinterlace</a></li>
108
        <li><a class="internal" href="#DirAsDSKmode">DirAsDSKmode</a></li>
109
        <li><a class="internal" href="#disablesprites">disablesprites</a></li>
110
        <li><a class="internal" href="#display_deform">display_deform</a></li>
111
        <li><a class="internal" href="#di_halt_callback">di_halt_callback</a></li>
112
        <li><a class="internal" href="#enable_session_management">enable_session_management</a></li>
113
        <li><a class="internal" href="#fastforward">fastforward</a></li>
114
        <li><a class="internal" href="#fastforwardspeed">fastforwardspeed</a></li>
115
        <li><a class="internal" href="#frequency">frequency</a></li>
116
        <li><a class="internal" href="#firmwareswitch">firmwareswitch</a></li>
117
        <li><a class="internal" href="#fullscreen">fullscreen</a></li>
118
        <li><a class="internal" href="#fullspeedwhenloading">fullspeedwhenloading</a></li>
119
        <li><a class="internal" href="#full_stretch">full_stretch</a></li>
120
        <li><a class="internal" href="#gamma">gamma</a></li>
121
        <li><a class="internal" href="#glow">glow</a></li>
122
        <li><a class="internal" href="#grabinput">grabinput</a></li>
123
        <li><a class="internal" href="#horizontal_stretch">horizontal_stretch</a></li>
124
        <li><a class="internal" href="#inputdelay">inputdelay</a></li>
125
        <li><a class="internal" href="#interleave_black_frame">interleave_black_frame</a></li>
126
        <li><a class="internal" href="#invalid_ppi_mode_callback">invalid_ppi_mode_callback</a></li>
127
        <li><a class="internal" href="#invalid_psg_directions_callback">invalid_psg_directions_callback</a></li>
128
        <li><a class="internal" href="#msxjoystickN_config">msxjoystick&lt;n&gt;_config/joymega&lt;n&gt;_config</a></li>
129
        <li><a class="internal" href="#joystickN_deadzone">joystick&lt;n&gt;_deadzone</a></li>
130
        <li><a class="internal" href="#kbd_auto_toggle_code_kana_lock">kbd_auto_toggle_code_kana_lock</a></li>
131
        <li><a class="internal" href="#kbd_code_kana_host_key">kbd_code_kana_host_key</a></li>
132
        <li><a class="internal" href="#kbd_deadkey1_host_key">kbd_deadkey1_host_key</a></li>
133
        <li><a class="internal" href="#kbd_deadkey2_host_key">kbd_deadkey2_host_key</a></li>
134
        <li><a class="internal" href="#kbd_deadkey3_host_key">kbd_deadkey3_host_key</a></li>
135
        <li><a class="internal" href="#kbd_mapping_mode">kbd_mapping_mode</a></li>
136
        <li><a class="internal" href="#kbd_numkeypad_always_enabled">kbd_numkeypad_always_enabled</a></li>
137
        <li><a class="internal" href="#kbd_numkeypad_enter_key">kbd_numkeypad_enter_key</a></li>
138
        <li><a class="internal" href="#kbd_trace_key_presses">kbd_trace_key_presses</a></li>
139
        <li><a class="internal" href="#led">led_&lt;name&gt;</a></li>
140
        <li><a class="internal" href="#limitsprites">limitsprites</a></li>
141
        <li><a class="internal" href="#master_volume">master_volume</a></li>
142
        <li><a class="internal" href="#maxframeskip">maxframeskip</a></li>
143
        <li><a class="internal" href="#midi-in-readfilename">midi-in-readfilename</a></li>
144
        <li><a class="internal" href="#midi-out-logfilename">midi-out-logfilename</a></li>
145
        <li><a class="internal" href="#minframeskip">minframeskip</a></li>
146
        <li><a class="internal" href="#mode">mode</a></li>
147
        <li><a class="internal" href="#mute">mute</a></li>
148
        <li><a class="internal" href="#noise">noise</a></li>
149
        <li><a class="internal" href="#pause">pause</a></li>
150
        <li><a class="internal" href="#pause_on_lost_focus">pause_on_lost_focus</a></li>
151
        <li><a class="internal" href="#pointer_hide_delay">pointer_hide_delay</a></li>
152
        <li><a class="internal" href="#power">power</a></li>
153
        <li><a class="internal" href="#printerlogfilename">printerlogfilename</a></li>
154
        <li><a class="internal" href="#print-resolution">print-resolution</a></li>
155
        <li><a class="internal" href="#psg_detune_frequency">PSG_detune_frequency</a></li>
156
        <li><a class="internal" href="#psg_detune_percent">PSG_detune_percent</a></li>
157
        <li><a class="internal" href="#psg_vibrato_frequency">PSG_vibrato_frequency</a></li>
158
        <li><a class="internal" href="#psg_vibrato_percent">PSG_vibrato_percent</a></li>
159
        <li><a class="internal" href="#r800_freq">r800_freq / r800_freq_locked</a></li>
160
        <li><a class="internal" href="#renderer">renderer</a></li>
161
        <li><a class="internal" href="#renshaturbo">renshaturbo</a></li>
162
        <li><a class="internal" href="#resampler">resampler</a></li>
163
        <li><a class="internal" href="#rs232-inputfilename">rs232-inputfilename</a></li>
164
        <li><a class="internal" href="#rs232-outputfilename">rs232-outputfilename</a></li>
165
        <li><a class="internal" href="#rs232-net-address">rs232-net-address</a></li>
166
        <li><a class="internal" href="#rs232-net-ip232">rs232-net-ip232</a></li>
167
        <li><a class="internal" href="#rtcmode">rtcmode</a></li>
168
        <li><a class="internal" href="#samples">samples</a></li>
169
        <li><a class="internal" href="#save_settings_on_exit">save_settings_on_exit</a></li>
170
        <li><a class="internal" href="#save_setup_at_exit_name">save_setup_at_exit_name</a></li>
171
        <li><a class="internal" href="#save_setup_at_exit_depth">save_setup_at_exit_depth</a></li>
172
        <li><a class="internal" href="#scale_algorithm">scale_algorithm</a></li>
173
        <li><a class="internal" href="#scale_factor">scale_factor</a></li>
174
        <li><a class="internal" href="#scanline">scanline</a></li>
175
        <li><a class="internal" href="#sound_driver">sound_driver</a></li>
176
        <li><a class="internal" href="#speed">speed</a></li>
177
        <li><a class="internal" href="#soundchip_balance">&lt;soundchip&gt;_balance</a></li>
178
        <li><a class="internal" href="#soundchip_channel_record">&lt;soundchip&gt;_ch&lt;channel&gt;_record</a></li>
179
        <li><a class="internal" href="#soundchip_channel_mute">&lt;soundchip&gt;_ch&lt;channel&gt;_mute</a></li>
180
        <li><a class="internal" href="#soundchip_volume">&lt;soundchip&gt;_volume</a></li>
181
        <li><a class="internal" href="#throttle">throttle</a></li>
182
        <li><a class="internal" href="#too_fast_vram_access">too_fast_vram_access</a></li>
183
        <li><a class="internal" href="#too_fast_vram_access_callback">VDP.too_fast_vram_access_callback</a></li>
184
        <li><a class="internal" href="#touchpad_transform_matrix">touchpad_transform_matrix</a></li>
185
        <li><a class="internal" href="#turborpause">turborpause</a></li>
186
        <li><a class="internal" href="#umr_callback">umr_callback</a></li>
187
        <li><a class="internal" href="#vdpcmdinprogress_callback">vdpcmdinprogress_callback</a></li>
188
        <li><a class="internal" href="#vdpcmdtrace">vdpcmdtrace</a></li>
189
        <li><a class="internal" href="#videosource">videosource</a></li>
190
        <li><a class="internal" href="#vsync">vsync</a></li>
191
        <li><a class="internal" href="#v9990cmdtrace">v9990cmdtrace</a></li>
192
        <li><a class="internal" href="#z80_freq">z80_freq / z80_freq_locked</a></li>
193
        <li><a class="internal" href="#othersettings">other</a></li>
194
      </ol>
195
    </li>
196
  </ol>
197
198
  <h2><a id="introduction">Introduction</a></h2>
199
200
  <p>This manual describes all commands and settings which are available in openMSX. You can use them to control openMSX fully from the Console (a built-in command-line interface, use F10 to call it), via Tcl scripts and via remote connections (explained in <a class="external" href="openmsx-control.html">Controlling openMSX from External Applications</a>). If you want to unleash the full potential of openMSX or just want a reference of all available possibilities, this manual should serve you well.</p>
201
202
  <h2><a id="commands">Commands</a></h2>
203
204
  <h3><a id="after">after</a></h3>
205
206
  <p>Execute a command after a certain event occurs, for example a given amount of time has passed or the emulator has been idle for a given amount of time.
207
  Every postponed command executes just once; if you want a command to run periodically, you have to issue it again every time it runs.
208
  The <code>after</code> command returns the id of the postponed command.
209
  It is possible to query a list of
210
  postponed commands and also to cancel postponed commands.</p>
211
212
  <div class="subsectiontitle">
213
    usage:
214
  </div>
215
216
  <table>
217
    <tr>
218
      <td><code>after time &lt;seconds&gt; &lt;command&gt;</code></td>
219
220
      <td>Execute a command after some time. Timescale is in MSX seconds.</td>
221
    </tr>
222
223
    <tr>
224
      <td><code>after realtime &lt;seconds&gt; &lt;command&gt;</code></td>
225
226
      <td>Execute a command after some time. Timescale is in host seconds.</td>
227
    </tr>
228
229
    <tr>
230
      <td><code>after idle &lt;seconds&gt; &lt;command&gt;</code></td>
231
232
      <td>Execute a command after being idle for some time</td>
233
    </tr>
234
235
    <tr>
236
      <td><code>after frame &lt;command&gt;</code></td>
237
238
      <td>Execute a command when a video frame is finished
239
      (VDP scanning reaches vsync)</td>
240
    </tr>
241
242
    <tr>
243
      <td><code>after break &lt;command&gt;</code></td>
244
245
      <td>Execute a command after a breakpoint is reached</td>
246
    </tr>
247
248
    <tr>
249
      <td><code>after boot &lt;command&gt;</code></td>
250
251
      <td>Execute a command after a (re)boot</td>
252
    </tr>
253
254
    <tr>
255
      <td><code>after machine_switch &lt;command&gt;</code></td>
256
257
      <td>Execute a command after switch to new a machine</td>
258
    </tr>
259
260
    <tr>
261
      <td><code>after quit &lt;command&gt;</code></td>
262
263
      <td>Execute a command after receiving a quit event, while openMSX shuts down.</td>
264
    </tr>
265
266
    <tr>
267
      <td><code>after &lt;input-event&gt; &lt;command&gt;</code></td>
268
269
      <td>Execute a command after the given input event occurs. The events are e.g. mouse, joystick, focus and resize events, the same ones as for the <a class="internal" href="#bind">bind</a> command.</td>
270
    </tr>
271
272
    <tr>
273
      <td><code>after info</code></td>
274
275
      <td>List all postponed commands</td>
276
    </tr>
277
278
    <tr>
279
      <td><code>after cancel &lt;id&gt;</code></td>
280
281
      <td>Cancel the postponed command with given id</td>
282
    </tr>
283
  </table>
284
285
  <div class="subsectiontitle">
286
    examples:
287
  </div>
288
289
  <div class="examples">
290
    <code>after time 2.6 "set renderer SDLGL-PP"</code><br />
291
    <code>after idle 100 exit</code><br />
292
    <code>after info</code><br />
293
    <code>after cancel after#2</code><br />
294
    <code>after "mouse button1 down" foo</code>
295
  </div>
296
297
  <h3><a id="bind">bind / unbind / bind_default / unbind_default / activate_input_layer / deactivate_input_layer</a></h3>
298
299
  <p>Associate events (such as key presses) with commands. Whenever the
300
  specified event occurs (e.g. you press the specified key), the corresponding
301
  command will be executed. Any Tcl command or combination of commands
302
  separated with <code>;</code> (normal Tcl syntax) can be used. To customise your
303
  bindings you should use the (un)bind commands. A script that wants to provide
304
  a default binding for its functionality needs to use <code>bind_default</code>,
305
  this allows users with different preferences to overrule the default
306
  bindings. Using the <code>-repeat</code> option makes sure that if the event is
307
  repeated (e.g. keyboard events when keeping a key pressed), the command is
308
  repeated as well.</p>
309
310
  <p>Tcl scripts that need a whole set of bindings and only conditionally
311
  activate those bindings can use the 'input layer' system. It's possible to
312
  associate a binding with a specific layer and later specific layer(s) can be
313
  activated or deactivated. Such a layer can also be activated in a blocking
314
  mode. Blocking mode means that even if the layer didn't have a binding for a
315
  certain event, that event is still not passed to the emulated MSX. This can
316
  be useful to implement certain OSD widgets (like a virtual OSD keyboard).</p>
317
318
  <p>Events can be:</p>
319
320
  <table>
321
    <tr>
322
      <td><code>&lt;key&gt;[,release]</code></td>
323
      <td>Short for <code>keyb &lt;key&gt;[,release]</code></td>
324
    </tr>
325
    <tr>
326
      <td><code>keyb &lt;key&gt;[,release]</code></td>
327
      <td>&lt;key&gt; is pressed [or released]</td>
328
    </tr>
329
    <tr>
330
      <td><code>mouse button&lt;n&gt; &lt;up/down&gt;</code></td>
331
      <td>Mouse button &lt;n&gt; went up or down</td>
332
    </tr>
333
    <tr>
334
      <td><code>mouse motion &lt;x&gt; &lt;y&gt;</code></td>
335
      <td>Mouse motion of &lt;x&gt; and &lt;y&gt;</td>
336
    </tr>
337
    <tr>
338
      <td><code>joy&lt;n&gt; button&lt;m&gt; &lt;up/down&gt;</code></td>
339
      <td>Button &lt;m&gt; of joystick &lt;n&gt; went up/down</td>
340
    </tr>
341
    <tr>
342
      <td><code>joy&lt;n&gt; axis&lt;m&gt; &lt;value&gt;</code></td>
343
      <td>Axis &lt;m&gt; of joystick &lt;n&gt; got value &lt;value&gt;</td>
344
    </tr>
345
    <tr>
346
      <td><code>focus &lt;boolean&gt;</code></td>
347
      <td>The openMSX window got (1) or lost (0) focus</td>
348
    </tr>
349
350
    <tr>
351
      <td><code>OSDcontrol &lt;button&gt; PRESS|RELEASE</code></td>
352
353
      <td>The virtual OSDcontrol &lt;button&gt; got pressed or released.</td>
354
    </tr>
355
  </table>
356
357
  <div class="subsectiontitle">
358
    usage:
359
  </div>
360
361
  <table>
362
    <tr>
363
      <td><code>bind</code></td>
364
      <td>Show all bindings</td>
365
    </tr>
366
    <tr>
367
      <td><code>bind -layer &lt;layername&gt;</code></td>
368
      <td>Show all in a specific layer</td>
369
    </tr>
370
    <tr>
371
      <td><code>bind &lt;event&gt; [-layer &lt;layername&gt;]</code></td>
372
      <td>Show binding for the given event, optionally you can specify a layer</td>
373
    </tr>
374
    <tr>
375
      <td><code>bind &lt;event&gt; [-layer &lt;layername&gt;] [-repeat] &lt;command&gt;</code></td>
376
      <td>Make a new binding. Optionally make this binding in a specific layer.
377
      Also optionally it's possible to retrigger this binding periodically
378
      (e.g. when a key is kept pressed).</td>
379
    </tr>
380
    <tr>
381
      <td><code>bind -layers</code></td>
382
      <td>Show the names of all layers that currently have bindings</td>
383
    </tr>
384
    <tr>
385
      <td><code>unbind [-layer &lt;layername&gt;] &lt;event&gt;</code></td>
386
      <td>Undo binding for this event (optionally in a specific layer).</td>
387
    </tr>
388
    <tr>
389
      <td><code>unbind -layer &lt;layername&gt;</code></td>
390
      <td>Undo all bindings in the specified layer</td>
391
    </tr>
392
    <tr>
393
      <td><code>activate_input_layer</code></td>
394
      <td>Show a list of the currently active layers.</td>
395
    </tr>
396
    <tr>
397
      <td><code>activate_input_layer [-blocking] &lt;layername&gt;</code></td>
398
      <td>Activate the specified input layer, optionally this layer can be
399
      activate in blocking mode.</td>
400
    </tr>
401
    <tr>
402
      <td><code>deactivate_input_layer &lt;layername&gt;</code></td>
403
      <td>Deactivate the specified input layer.</td>
404
    </tr>
405
  </table>
406
407
  <div class="subsectiontitle">
408
    examples:
409
  </div>
410
  <div class="examples">
411
    <code>bind PAGEUP   "set speed 100"</code><br />
412
    <code>bind PAGEDOWN "set speed  50"</code><br />
413
    <br />
414
    Only run in fastforward-mode while F9 is pressed (like BrMSX):<br />
415
    <code>unbind F9</code><br />
416
    <code>bind F9         "set fastforward on"</code><br />
417
    <code>bind F9,release "set fastforward off"</code><br />
418
    <br />
419
    Pause when window loses focus (like fMSX):<br />
420
    <code>bind "focus 0" "set pause on"</code><br />
421
    <code>bind "focus 1" "set pause off"</code><br />
422
    <br />
423
    Middle-click to toggle input grabbing:<br />
424
    <code>bind "mouse button2 down" "toggle grabinput"</code><br />
425
    <br />
426
    Map button 8 of joystick 1 to F2-key:<br />
427
    <code>bind "joy1 button8 down" "keymatrixdown 6 0x40"</code><br />
428
    <code>bind "joy1 button8 up"   "keymatrixup   6 0x40"</code><br />
429
    <br />
430
    Use PageUp/Down to increase/decrease emulation speed.<br/>
431
    <code>bind PAGEUP   -repeat "incr speed  1"</code><br />
432
    <code>bind PAGEDOWN -repeat "incr speed -1"</code><br />
433
    <br />
434
    Use Joystick hat left/right to increase/decrease volume.<br/>
435
    <code>bind "joy1 hat0 left"  -repeat "incr speed -5"</code><br />
436
    <code>bind "joy1 hat0 right" -repeat "incr speed  5"</code><br />
437
    <br />
438
    Toggle fullscreen with ALT and ENTER.<br/>
439
    <code>bind ALT+RETURN "toggle fullscreen"</code><br />
440
    <br />
441
    React to joystick or cursor up movement in a Tcl script:<br />
442
    <code>bind_default "OSDcontrol UP PRESS" -repeat {osd_menu::menu_action UP }</code><br />
443
    React to joystick button 1 or spacebar press in a Tcl script:<br />
444
    <code>bind_default "OSDcontrol A PRESS" -repeat {osd_menu::menu_action A }</code><br />
445
  </div>
446
447
  <h3><a id="cart">cart / cart&lt;x&gt;</a></h3>
448
449
  <p>Insert a ROM cartridge in a running MSX. The <code>cart</code> command inserts the cartridge in the first available slot. The <code>carta</code>, <code>cartb</code> etc. commands insert it in the specified slot. The cartridges can be removed again with the <code>eject</code> subcommand.</p>
450
451
  <p>ROM cartridges are a special class of extensions. For extensions that are not ROM cartridges, see the commands <code><a class="internal" href="#ext">ext</a></code>, <code><a class="internal" href="#list_extensions">list_extensions</a></code> and <code><a class="internal" href="#remove_extension">remove_extension</a></code>.</p>
452
453
  <div class="subsectiontitle">
454
    usage:
455
  </div>
456
457
  <table>
458
    <tr>
459
      <td><code>cart KMARE.ROM</code></td>
460
      <td>Insert ROM cartridge in first free slot</td>
461
    </tr>
462
463
    <tr>
464
      <td><code>cart insert KMARE.ROM</code></td>
465
      <td>Insert ROM cartridge in first free slot</td>
466
    </tr>
467
468
    <tr>
469
      <td><code>carta USAS.ROM -ips USAS.IPS</code></td>
470
      <td>Insert ROM cartridge in slot A, with IPS patch applied to the ROM contents</td>
471
    </tr>
472
473
    <tr>
474
      <td><code>cartb NEMESIS.ROM -romtype Konami</code></td>
475
      <td>Insert ROM cartridge in slot B, and explicitly specify the mapper type (is normally auto detected)</td>
476
    </tr>
477
478
    <tr>
479
      <td><code>carta eject</code></td>
480
      <td>Eject the currently inserted cartridge from slot A</td>
481
    </tr>
482
  </table>
483
484
  <h3><a id="cassetteplayer">cassetteplayer</a></h3>
485
486
  <p>Controls the openMSX cassette player. The various subcommands can be used to insert, remove, create and rewind tape images.</p>
487
488
  <div class="subsectiontitle">
489
    usage:
490
  </div>
491
492
  <table>
493
    <tr>
494
      <td><code>cassetteplayer insert &lt;tape image&gt;</code></td>
495
496
      <td>Insert tape image (WAV, CAS or TSX format) in the cassette player</td>
497
    </tr>
498
499
    <tr>
500
      <td><code>cassetteplayer eject</code></td>
501
502
      <td>Remove tape from virtual cassette player</td>
503
    </tr>
504
505
    <tr>
506
      <td><code>cassetteplayer rewind</code></td>
507
508
      <td>Rewind the current tape</td>
509
    </tr>
510
511
    <tr>
512
      <td><code>cassetteplayer motorcontrol on|off</code></td>
513
514
      <td>Selects whether motor control signal (remote) is obeyed (default: on)</td>
515
    </tr>
516
517
    <tr>
518
      <td><code>cassetteplayer new [&lt;tape image&gt;]</code></td>
519
520
      <td>Create new tape image and go to record mode</td>
521
    </tr>
522
523
    <tr>
524
      <td><code>cassetteplayer play</code></td>
525
526
      <td>Go to play mode (when in record mode) and rewind the tape</td>
527
    </tr>
528
  </table>
529
530
  <h3><a id="cd">cd&lt;x&gt;</a></h3>
531
532
  <p>Change the CDROM image. The commands <code>cda</code>, <code>cdb</code> etc. are assigned to all available CDROM drives in the MSX. They will not
533
  correspond to drive names as used in MSX-DOS.</p>
534
535
  <div class="subsectiontitle">
536
    usage:
537
  </div>
538
539
  <table>
540
    <tr>
541
      <td><code>cda &lt;iso image&gt;</code></td>
542
543
      <td>Use ISO image for CDROM drive "cda"</td>
544
    </tr>
545
546
    <tr>
547
      <td><code>cda insert &lt;iso image&gt;</code></td>
548
549
      <td>Use ISO image for CDROM drive "cda"</td>
550
    </tr>
551
552
    <tr>
553
      <td><code>cda eject</code></td>
554
555
      <td>Eject CDROM from CDROM drive "cda"</td>
556
    </tr>
557
558
    <tr>
559
      <td><code>cda</code></td>
560
561
      <td>Show current ISO image for CDROM drive "cda"</td>
562
    </tr>
563
  </table>
564
565
566
  <h3><a id="cycle">cycle / cycle_back</a></h3>
567
568
  <p>Iterates through the values of an enumerated setting.</p>
569
570
  <p><code>cycle_back</code> does the same as <code>cycle</code>, but it goes in the opposite direction.</p>
571
572
  <div class="subsectiontitle">
573
    usage:
574
  </div>
575
576
  <table>
577
    <tr>
578
      <td><code>cycle &lt;setting&gt;</code></td>
579
      <td>Changes the specified setting to the next value in the cycle</td>
580
    </tr>
581
    <tr>
582
      <td><code>cycle_back &lt;setting&gt;</code></td>
583
      <td>Changes the specified setting to the previous value in the cycle</td>
584
    </tr>
585
  </table>
586
587
  <div class="subsectiontitle">
588
    examples:
589
  </div>
590
591
  <div class="examples">
592
    <code>cycle scale_algorithm</code><br />
593
    <code>cycle videosource</code>
594
  </div>
595
596
597
  <h3><a id="cycle_machine">cycle_machine / cycle_back_machine</a></h3>
598
599
  <p>Cycle through the current running machines.</p>
600
601
  <p><code>cycle_back_machine</code> does the same as <code>cycle_machine</code>, but it goes in the opposite direction.</p>
602
603
  <div class="subsectiontitle">
604
    usage:
605
  </div>
606
607
  <table>
608
    <tr>
609
      <td><code>cycle_machine</code></td>
610
      <td>Changes the current machine to the next one in the cycle</td>
611
    </tr>
612
    <tr>
613
      <td><code>cycle_back_machine</code></td>
614
      <td>Changes the current machine to the previous one in the cycle</td>
615
    </tr>
616
  </table>
617
618
619
  <h3><a id="debug">debug</a></h3>
620
621
  <p>This command provides access to the debugger functionality of openMSX. It can be used by an external debugger (see also <a class="external" href="openmsx-control.html">Controlling openMSX from External Applications</a>), but openMSX has since evolved to include its own debugger. The general format of the debug command is:</p>
622
623
  <p><code>debug &lt;subcommand&gt; [&lt;extra arguments&gt;]</code></p>
624
625
  <p>where 'extra arguments' are specific for each subcommand. Below is a list of the most common subcommands (deprecated commands are not listed):</p>
626
627
  <table>
628
    <tr>
629
      <td><code>debug list</code></td>
630
      <td>Return a list of all debuggables.<br />
631
      A debuggable is (part of) the state of an MSX device that can be accessed
632
      via these debug commands.<br />
633
      Examples are:
634
        <ul>
635
          <li> the VDP registers </li>
636
          <li> the currently visible memory for the Z80</li>
637
          <li> the contents of the RAM </li>
638
        </ul>
639
      </td>
640
    </tr>
641
642
    <tr>
643
      <td><code>debug desc &lt;name&gt;</code></td>
644
      <td>Return a description of this debuggable</td>
645
    </tr>
646
647
    <tr>
648
      <td><code>debug size &lt;name&gt;</code></td>
649
      <td>Return the size of this debuggable</td>
650
    </tr>
651
652
    <tr>
653
      <td><code>debug read &lt;name&gt; &lt;addr&gt;</code></td>
654
      <td>Read a byte from a debuggable</td>
655
    </tr>
656
657
    <tr>
658
      <td><code>debug write &lt;name&gt; &lt;addr&gt; &lt;val&gt;</code></td>
659
      <td>Write a byte to a debuggable</td>
660
    </tr>
661
662
    <tr>
663
      <td><code>debug read_block &lt;name&gt; &lt;addr&gt; &lt;size&gt;</code></td>
664
      <td>Read a whole block at once</td>
665
    </tr>
666
667
    <tr>
668
      <td><code>debug write_block &lt;name&gt; &lt;addr&gt; &lt;values&gt;</code></td>
669
      <td>Write a whole block at once</td>
670
    </tr>
671
672
    <tr>
673
      <td><code>debug break</code></td>
674
      <td>Break CPU at current position</td>
675
    </tr>
676
677
    <tr>
678
      <td><code>debug breaked</code></td>
679
      <td>Query CPU break status</td>
680
    </tr>
681
682
    <tr>
683
      <td><code>debug cont</code></td>
684
      <td>Continue execution after break</td>
685
    </tr>
686
687
    <tr>
688
      <td><code>debug step</code></td>
689
      <td>Execute one instruction</td>
690
    </tr>
691
692
    <tr>
693
      <td><code>debug breakpoint &lt;subcommand&gt;</code></td>
694
      <td><a class="internal" href="#debug-breakpoint">Breakpoint related commands</a>.</td>
695
    </tr>
696
697
    <tr>
698
      <td><code>debug watchpoint &lt;subcommand&gt;</code></td>
699
      <td><a class="internal" href="#debug-watchpoint">Watchpoint related commands</a>.</td>
700
    </tr>
701
702
    <tr>
703
      <td><code>debug watchexpr &lt;subcommand&gt;</code></td>
704
      <td><a class="internal" href="#debug-watchexpr">Watch expression related commands</a>.</td>
705
    </tr>
706
707
    <tr>
708
      <td><code>debug condition &lt;subcommand&gt;</code></td>
709
      <td><a class="internal" href="#debug-condition">Debug condition related commands</a>.</td>
710
    </tr>
711
712
    <tr>
713
      <td><code>debug probe &lt;subcommand&gt;</code></td>
714
      <td><a class="internal" href="#debug-probe">Probe related commands</a>.</td>
715
    </tr>
716
717
    <tr>
718
      <td><code>debug symbols &lt;subcommand&gt;</code></td>
719
      <td><a class="internal" href="#debug-symbols">Manage debug symbols</a>.<br />
720
      openMSX also provides a shortcut to access debug symbol addresses via Tcl dictionary <code>$::sym(&lt;symbol-name&gt;)</code>.
721
    </tr>
722
723
    <tr>
724
      <td><code>debug trace &lt;subcommand&gt;</code></td>
725
      <td><a class="internal" href="#debug-trace">Trace related commands</a>.</td>
726
    </tr>
727
728
    <tr>
729
      <td><code>debug disasm [&lt;addr&gt;]</code></td>
730
      <td>Disassemble instructions at PC or given address</td>
731
    </tr>
732
733
  </table>
734
735
  <p>This command is much better documented in openMSX itself. Type <code>help debug</code> or <code>help debug &lt;subcommand&gt;</code> for more detailed help.</p>
736
737
  <div class="subsectiontitle">
738
    <a id="debug-breakpoint">breakpoint subcommands:</a>
739
  </div>
740
741
  <table>
742
    <tr>
743
      <td><code>debug breakpoint list</code></td>
744
      <td>List all active breakpoints. The result is a Tcl dict where each key is a breakpoint ID and each value is another dict containing the properties of that breakpoint (see <code>create</code> below).</td>
745
    </tr>
746
747
    <tr>
748
      <td><code>debug breakpoint create [&lt;property-name&gt; &lt;property-value&gt;]...</code></td>
749
      <td>Create a new breakpoint with the given properties and return its ID. Supported properties:
750
        <ul>
751
          <li><code>-address</code>: the address where the breakpoint should trigger. An address is just a number [0..0xFFFF], but can also be dynamically evaluated from a known symbol by specifying <code>{$sym(MySymbol)}</code>.</li>
752
          <li><code>-condition</code>: a Tcl expression that must evaluate to true for the breakpoint to trigger (default = no condition).</li>
753
          <li><code>-command</code>: a Tcl command that should be executed when the breakpoint triggers (default = <code>debug break</code>).</li>
754
          <li><code>-enabled</code>: set to false to (temporarily) disable this breakpoint.</li>
755
          <li><code>-once</code>: if true, the breakpoint is automatically removed after it triggered (default = false, meaning recurring).</li>
756
        </ul>
757
      </td>
758
    </tr>
759
760
    <tr>
761
      <td><code>debug breakpoint configure &lt;id&gt; [&lt;property-name&gt; &lt;property-value&gt;]...</code></td>
762
      <td>Change one or more properties of an existing breakpoint. The same properties as for <code>create</code> are supported.</td>
763
    </tr>
764
765
    <tr>
766
      <td><code>debug breakpoint remove &lt;id&gt;</code></td>
767
      <td>Remove the breakpoint with the given ID.</td>
768
    </tr>
769
  </table>
770
771
  <div class="subsectiontitle">
772
    <a id="debug-watchpoint">watchpoint subcommands:</a>
773
  </div>
774
775
  <table>
776
    <tr>
777
      <td><code>debug watchpoint list</code></td>
778
      <td>List all active watchpoints. The result is a Tcl dict where each key is a watchpoint ID and each value is another dict containing the properties of that watchpoint (see <code>create</code> below).</td>
779
    </tr>
780
781
    <tr>
782
      <td><code>debug watchpoint create [&lt;property-name&gt; &lt;property-value&gt;]...</code></td>
783
      <td>Create a new watchpoint with the given properties and return its ID. Supported properties:
784
        <ul>
785
          <li><code>-type</code>: one of <code>read_io</code>, <code>write_io</code>, <code>read_mem</code> or <code>write_mem</code>.</li>
786
          <li><code>-address</code>: the address(es) where the watchpoint should trigger, either a single address or a begin/end pair. An address is just a number [0..0xFFFF], but can also be dynamically evaluated from a known symbol by specifying <code>{$sym(MySymbol)}</code>.</li>
787
          <li><code>-condition</code>: a Tcl expression that must evaluate to true for the watchpoint to trigger (default = no condition).</li>
788
          <li><code>-command</code>: a Tcl command that should be executed when the watchpoint triggers (default = <code>debug break</code>).</li>
789
          <li><code>-enabled</code>: set to false to (temporarily) disable this watchpoint.</li>
790
          <li><code>-once</code>: if true, the watchpoint is automatically removed after it triggered (default = false, meaning recurring).</li>
791
        </ul>
792
      </td>
793
    </tr>
794
795
    <tr>
796
      <td><code>debug watchpoint configure &lt;id&gt; [&lt;property-name&gt; &lt;property-value&gt;]...</code></td>
797
      <td>Change one or more properties of an existing watchpoint. The same properties as for <code>create</code> are supported.</td>
798
    </tr>
799
800
    <tr>
801
      <td><code>debug watchpoint remove &lt;id&gt;</code></td>
802
      <td>Remove the watchpoint with the given ID.</td>
803
    </tr>
804
  </table>
805
806
  <div class="subsectiontitle">
807
    <a id="debug-condition">debug condition subcommands:</a>
808
  </div>
809
810
  <p>A debug condition is evaluated continuously while the emulated MSX is
811
  running; unlike breakpoints and watchpoints it is not tied to a specific
812
  address or I/O access.</p>
813
814
  <table>
815
    <tr>
816
      <td><code>debug condition list</code></td>
817
      <td>List all active debug conditions. The result is a Tcl dict where each key is a debug condition ID and each value is another dict containing the properties of that condition (see <code>create</code> below).</td>
818
    </tr>
819
820
    <tr>
821
      <td><code>debug condition create [&lt;property-name&gt; &lt;property-value&gt;]...</code></td>
822
      <td>Create a new debug condition with the given properties and return its ID. Supported properties:
823
        <ul>
824
          <li><code>-condition</code>: a Tcl expression that must evaluate to true for the debug condition to trigger (default = no condition).</li>
825
          <li><code>-command</code>: a Tcl command that should be executed when the debug condition triggers (default = <code>debug break</code>).</li>
826
          <li><code>-enabled</code>: set to false to (temporarily) disable this debug condition.</li>
827
          <li><code>-once</code>: if true, the debug condition is automatically removed after it triggered (default = false, meaning recurring).</li>
828
        </ul>
829
      </td>
830
    </tr>
831
832
    <tr>
833
      <td><code>debug condition configure &lt;id&gt; [&lt;property-name&gt; &lt;property-value&gt;]...</code></td>
834
      <td>Change one or more properties of an existing debug condition. The same properties as for <code>create</code> are supported.</td>
835
    </tr>
836
837
    <tr>
838
      <td><code>debug condition remove &lt;id&gt;</code></td>
839
      <td>Remove the debug condition with the given ID.</td>
840
    </tr>
841
  </table>
842
843
  <div class="subsectiontitle">
844
    <a id="debug-probe">probe subcommands:</a>
845
  </div>
846
847
  <p>Probes are instrumentation points inside openMSX itself; they expose
848
  emulator-internal events (such as a pending Z80 IRQ or an executing VDP
849
  command) that cannot be observed from inside the emulated MSX. Use
850
  <code>debug probe list</code> to see which probes exist on the currently
851
  emulated machine.</p>
852
853
  <table>
854
    <tr>
855
      <td><code>debug probe list</code></td>
856
      <td>Returns a list of all probes.</td>
857
    </tr>
858
859
    <tr>
860
      <td><code>debug probe desc &lt;probe&gt;</code></td>
861
      <td>Returns a description of this probe.</td>
862
    </tr>
863
864
    <tr>
865
      <td><code>debug probe read &lt;probe&gt;</code></td>
866
      <td>Returns the current value of this probe.</td>
867
    </tr>
868
869
    <tr>
870
      <td><code>debug probe set_bp &lt;probe&gt; [-once] [&lt;cond&gt;] [&lt;cmd&gt;]</code></td>
871
      <td>Set a breakpoint on the given probe and return its ID. When <code>-once</code> is given, the breakpoint is automatically removed after it triggered. <code>&lt;cond&gt;</code> is an optional Tcl expression that must evaluate to true for the breakpoint to trigger; <code>&lt;cmd&gt;</code> is an optional Tcl command that should be executed when the breakpoint triggers (default = <code>debug break</code>).</td>
872
    </tr>
873
874
    <tr>
875
      <td><code>debug probe remove_bp &lt;id&gt;</code></td>
876
      <td>Remove the probe breakpoint with the given ID.</td>
877
    </tr>
878
879
    <tr>
880
      <td><code>debug probe list_bp</code></td>
881
      <td>Returns all breakpoints that are set on probes, as a Tcl dict where each key is a probe-breakpoint ID and each value contains the probe name, the condition and the command.</td>
882
    </tr>
883
  </table>
884
885
  <div class="subsectiontitle">
886
    <a id="debug-watchexpr">watch expression subcommands:</a>
887
  </div>
888
889
  <p>Watch expressions are mostly a GUI feature: they are evaluated while the
890
  emulated MSX is running and their values are shown in the debugger view of
891
  the openMSX GUI (menu bar &gt; Debugger &gt; Watch expression).</p>
892
893
  <table>
894
    <tr>
895
      <td><code>debug watchexpr list</code></td>
896
      <td>List all active watch expressions. The result is a Tcl dict where each key is a watch expression ID and each value is another dict containing the properties of that expression (see <code>create</code> below).</td>
897
    </tr>
898
899
    <tr>
900
      <td><code>debug watchexpr create [&lt;property-name&gt; &lt;property-value&gt;]...</code></td>
901
      <td>Create a new watch expression with the given properties and return its ID. Supported properties:
902
        <ul>
903
          <li><code>-description</code>: optional description for the expression.</li>
904
          <li><code>-expression</code>: the actual Tcl expression.</li>
905
          <li><code>-format</code>: optional format specifier.</li>
906
        </ul>
907
      </td>
908
    </tr>
909
910
    <tr>
911
      <td><code>debug watchexpr configure &lt;id&gt; [&lt;property-name&gt; &lt;property-value&gt;]...</code></td>
912
      <td>Change one or more properties of an existing watch expression. The same properties as for <code>create</code> are supported.</td>
913
    </tr>
914
915
    <tr>
916
      <td><code>debug watchexpr remove &lt;id&gt;</code></td>
917
      <td>Remove the watch expression with the given ID.</td>
918
    </tr>
919
  </table>
920
921
  <div class="subsectiontitle">
922
    <a id="debug-symbols">symbols subcommands:</a>
923
  </div>
924
925
  <p>Symbols map names to memory addresses and typically come from the
926
  assembler or compiler build of the MSX program being debugged. Loaded
927
  symbols can be used in breakpoint conditions and other Tcl expressions;
928
  an easier syntax to get the value of a symbol based on its name is the
929
  Tcl dictionary <code>$::sym(&lt;symbol-name&gt;)</code>.</p>
930
931
  <table>
932
    <tr>
933
      <td><code>debug symbols types</code></td>
934
      <td>Returns a list of supported symbol file types.</td>
935
    </tr>
936
937
    <tr>
938
      <td><code>debug symbols load &lt;filename&gt; [&lt;type&gt;]</code></td>
939
      <td>Load a symbol file; the type is auto-detected if none is given.</td>
940
    </tr>
941
942
    <tr>
943
      <td><code>debug symbols remove &lt;filename&gt;</code></td>
944
      <td>Remove a previously loaded symbol file.</td>
945
    </tr>
946
947
    <tr>
948
      <td><code>debug symbols files</code></td>
949
      <td>Returns a list of all loaded symbol files.</td>
950
    </tr>
951
952
    <tr>
953
      <td><code>debug symbols lookup [-filename &lt;filename&gt;] [-name &lt;name&gt;] [-value &lt;value&gt;]</code></td>
954
      <td>Returns a list of symbols in an optionally given file and/or with an optionally given name and/or with an optionally given value.</td>
955
    </tr>
956
  </table>
957
958
  <div class="subsectiontitle">
959
    <a id="debug-trace">trace subcommands:</a>
960
  </div>
961
962
  <p>Traces collect data points while the emulated MSX is running. Each data
963
  point stores a value together with the emulation time at which it was
964
  added. Traces are typically filled from Tcl code (for example from the
965
  command of a <a class="internal" href="#debug-condition">debug condition</a>)
966
  or automatically via <code>debug trace probe</code>. The collected data can
967
  be inspected with the trace viewer of the openMSX GUI.</p>
968
969
  <table>
970
    <tr>
971
      <td><code>debug trace add &lt;name&gt; [&lt;value&gt;] [-merge] [-description &lt;text&gt;] [-type &lt;t&gt;] [-format &lt;f&gt;]</code></td>
972
      <td>Add a new data point to the trace with the given name (the trace is created on first use); the timestamp of the data point is the current emulation time. The optional value can be an integer, a floating point number or a string; if no value is given, a void value is used. Flags: <code>-merge</code> ignores consecutive equal values; <code>-description &lt;text&gt;</code> gives a description for this trace; <code>-type &lt;t&gt;</code> must be one of <code>void</code>, <code>bool</code>, <code>int</code>, <code>double</code> or <code>string</code>; <code>-format &lt;f&gt;</code> must be one of <code>bin</code>, <code>dec</code> or <code>hex</code> (only relevant for type int). Typically the latter three options are only used once, while <code>-merge</code> is repeated on every invocation.</td>
973
    </tr>
974
975
    <tr>
976
      <td><code>debug trace list [&lt;name&gt;]</code></td>
977
      <td>Without arguments, list the names of all created traces. With a name argument, list all data points of the given trace in chronological order; each data point consists of a timestamp (seconds since emulation start) and a value.</td>
978
    </tr>
979
980
    <tr>
981
      <td><code>debug trace drop [&lt;name&gt;]</code></td>
982
      <td>Without arguments, drop all traces and their data points. With a name argument, drop only the trace with the given name (this also removes traces that were being filled automatically via <code>debug trace probe</code>).</td>
983
    </tr>
984
985
    <tr>
986
      <td><code>debug trace probe &lt;probe&gt;</code></td>
987
      <td>Start collecting changes of the given <a class="internal" href="#debug-probe">probe</a>: as if on each change there's an automatic <code>debug trace add &lt;name&gt; &lt;value&gt;</code>.</td>
988
    </tr>
989
  </table>
990
991
  <p>A convenient wrapper around these subcommands is the <code>cpu_trace</code>
992
  Tcl procedure (defined in <code>scripts/_trace.tcl</code>): execute e.g.
993
  <code>cpu_trace instr A HL</code> to trace the executed instructions together
994
  with the A and HL register values, and execute <code>cpu_trace</code> without
995
  arguments to disable tracing again. Note this can be expensive and/or can
996
  quickly consume a lot of memory: the Z80 (and certainly the R800) can execute
997
  almost one million instructions per second, so it is recommended to enable
998
  only those items you need and to limit the trace duration.</p>
999
1000
  <p>Many examples of usage of the debug command can be found in the scripts that come with openMSX (in the <code>share/scripts</code> directory). We also list a few here.
1001
  </p>
1002
1003
  <div class="subsectiontitle">
1004
    examples:
1005
  </div>
1006
1007
  <div class="examples">
1008
    <ul>
1009
      <li>break (only!) after 0 is written to 0x8000):<br/>
1010
         <code>debug watchpoint create -type write_mem -address 0x8000 -condition {[debug read "memory" 0x8000] == 0x00}</code></li>
1011
      <li>break on address 0xF37D, but only when Z80 register C has the value 0x2F:<br/>
1012
         <code>debug breakpoint create -address 0xF37D -condition {[reg C] == 0x2F}</code></li>
1013
      <li>break when CPU reads from any addresses between 0xFBE5 and 0xFBEF:<br/>
1014
         <code>debug watchpoint create -type read_mem -address {0xFBE5 0xFBEF}</code></li>
1015
      <li>break after a write was done to I/O port 0x99, but only when Z80 register A has a value of 0x81:<br/>
1016
         <code>debug watchpoint create -type write_io -address 0x99 -condition {[reg A] == 0x81}</code></li>
1017
      <li>break as soon as there is a pending Z80 IRQ (even when in DI mode):<br/>
1018
         <code>debug probe set_bp z80.pendingIRQ</code></li>
1019
      <li>break when register HL has the value 1234:<br/>
1020
         <code>debug condition create -condition {[reg hl] == 1234}</code></li>
1021
      <li>list the contents of all symbol files previously loaded by the Symbol Manager or by the <code>debug symbols load</code> subcommand:<br/>
1022
         <code>debug symbols lookup</code></li>
1023
    </ul>
1024
  </div>
1025
1026
  <div class="note">
1027
    Note: Some of the commands are pretty low level. In the share/scripts directory you'll find some Tcl scripts that
1028
    offer convenience wrappers around these commands. For example: <a class="internal" href="#other"><code>showmem</code></a>, <a class="internal" href="#other"><code>disasm</code></a>, <a class="internal" href="#other"><code>cpuregs</code></a>, <a class="internal" href="#other"><code>save_debuggable</code></a>, etc.
1029
  </div>
1030
1031
  <h3><a id="disk">disk&lt;x&gt; / virtual_drive</a></h3>
1032
1033
  <p>Insert a disk image in a drive. Optionally apply an IPS patch to the disk image.
1034
  The commands <code>diska</code>, <code>diskb</code> etc. are
1035
  assigned to all available "physical" disk drives in the MSX. They might not correspond to drive names as used in
1036
  MSX-DOS.</p>
1037
1038
  <p>In addition to the physical <code>disk&lt;x&gt;</code> drives, there is the <code>virtual_drive</code>. This fake drive does not correspond to any MSX hardware. It can be used as a source or target for <code><a class="internal" href="#diskmanipulator">diskmanipulator</a></code> operations just like physical drives.</p>
1039
1040
  <div class="subsectiontitle">
1041
    usage:
1042
  </div>
1043
1044
  <table>
1045
    <tr>
1046
      <td><code>diska &lt;disk image&gt;</code></td>
1047
      <td>Insert disk image in drive "diska"</td>
1048
    </tr>
1049
1050
    <tr>
1051
      <td><code>diskb insert &lt;disk image&gt;</code></td>
1052
      <td>Insert disk image in drive "diskb"</td>
1053
    </tr>
1054
1055
    <tr>
1056
      <td><code>diska &lt;disk image&gt; &lt;ips&gt;</code></td>
1057
      <td>Insert disk image and apply IPS patch</td>
1058
    </tr>
1059
1060
    <tr>
1061
      <td><code>diska eject</code></td>
1062
      <td>Remove disk from drive "diska"</td>
1063
    </tr>
1064
1065
    <tr>
1066
      <td><code>diska ramdsk</code></td>
1067
      <td>Insert scratch disk in drive "diska"</td>
1068
    </tr>
1069
  </table>
1070
1071
  <h3><a id="diskmanipulator">diskmanipulator</a></h3>
1072
1073
  <p>A collection of commands to manipulate (the files on) a disk image.</p>
1074
1075
  <p>It can be used in so many different ways, that we wrote a separate manual for it: <a class="external" href="diskmanipulator.html">Using Diskmanipulator</a>.</p>
1076
1077
  <h3><a id="escape_grab">escape_grab</a></h3>
1078
1079
  <p>Only has effect in windowed mode and when the <code><a class="internal" href="#grabinput">grabinput</a></code> setting is active. Temporarily release the input grab.
1080
  After the openMSX window has lost and regained the focus, the grab is again effective.</p>
1081
1082
  <div class="subsectiontitle">
1083
    usage:
1084
  </div>
1085
1086
  <table>
1087
    <tr>
1088
      <td><code>escape_grab</code></td>
1089
1090
      <td>Temporarily release the input grab</td>
1091
    </tr>
1092
  </table>
1093
1094
  <h3><a id="exit">exit</a></h3>
1095
1096
  <p>Terminate the openMSX application. Optionally you can pass an exit-code.</p>
1097
1098
  <div class="subsectiontitle">
1099
    usage:
1100
  </div>
1101
1102
  <table>
1103
    <tr>
1104
      <td><code>exit [exit-code]</code></td>
1105
      <td>Exits the emulator</td>
1106
    </tr>
1107
  </table>
1108
1109
  <h3><a id="ext">ext / ext&lt;x&gt;</a></h3>
1110
1111
  <p>Insert an MSX extension in a running MSX machine. The <code>ext</code> command inserts the extension in the first available slot. The <code>exta</code>, <code>extb</code> etc. commands insert it in the specified slot. The extension can be removed again with the <code><a class="internal" href="#remove_extension">remove_extension</a></code>
1112
  command. See also the commands <code><a class="internal" href="#cart">cart</a></code>, <code><a class="internal" href="#list_extensions">list_extensions</a></code> and <code><a class="internal" href="#remove_extension">remove_extension</a></code>.</p>
1113
1114
  <p>To get a list of possible extensions it's convenient to use the tab-completion feature, i.e. type '<code>ext&lt;space&gt;&lt;tab&gt;</code>'. Alternatively the command '<code><a class="internal" href="#openmsx_info">openmsx_info</a> extensions</code>' gives you the same information (and is easier to use in a scripting context).</p>
1115
1116
  <p>Note that some extensions (i.e. those without any memory) will not physically occupy any slot when inserted, even when they were inserted in a specific slot.</p>
1117
1118
  <div class="subsectiontitle">
1119
    usage:
1120
  </div>
1121
1122
  <table>
1123
    <tr>
1124
      <td><code>ext fmpac</code></td>
1125
1126
      <td>Insert an FMPAC in a running MSX machine in the first free slot</td>
1127
    </tr>
1128
    <tr>
1129
      <td><code>extb scc</code></td>
1130
1131
      <td>Insert the empty SCC cart in slot B of the running MSX machine</td>
1132
    </tr>
1133
  </table>
1134
1135
  <h3><a id="filepool">filepool</a></h3>
1136
1137
  <p>With this command you can manage your file pool settings. File pools are directories on your host system (PC/Mac/Dingoo/etc.). They are used by openMSX to search files in, which are referred to from machine or extension definition files, save states or replays which you are trying to load. First, the file will be searched at the path that was also used when the save state or replay was created. But if it isn't found there (which is usually the case if you load such a state or replay you got from someone else), it will use the file pools to search instead. In other words, if you are trying to load such replays, it's probably a good idea to put the media files referred to (ROMs, disks, tapes) in the (proper) file pool.</p>
1138
1139
  <p>File pools have the following properties:</p>
1140
  <dl>
1141
    <dt>path</dt>
1142
    <dd>The path to the directory which is the actual file pool</dd>
1143
1144
    <dt>position</dt>
1145
    <dd>There exists a list of file pools, which are searched in order of their position.</dd>
1146
1147
    <dt>type(s)</dt>
1148
    <dd>A file pool can serve specific types. Currently, the valid types are
1149
      <dl>
1150
        <dt><code>system_rom</code></dt>
1151
        <dd>for system ROMs, you are probably using this one already if you installed your system ROMs in the recommended place <code>share/systemroms</code>,</dd>
1152
        <dt><code>rom</code></dt>
1153
        <dd>for other ROM files,</dd>
1154
        <dt><code>disk</code></dt>
1155
        <dd>for disk images and</dd>
1156
        <dt><code>tape</code></dt>
1157
        <dd>for cassette/tape images.</dd>
1158
      </dl>
1159
    </dd>
1160
  </dl>
1161
1162
  <p>Apart from the default system ROM file pool as mentioned above, the other default file pool is <code>share/software</code>, which is configured for all other (than type <code>system_rom</code>) software files.</p>
1163
1164
  <div class="subsectiontitle">
1165
    usage:
1166
  </div>
1167
1168
  <table>
1169
    <tr>
1170
      <td><code>filepool list</code></td>
1171
1172
      <td>Shows the currently defined file pool entries (see below for example output)</td>
1173
    </tr>
1174
1175
    <tr>
1176
      <td><code>filepool add -path &lt;path&gt; -types &lt;typelist&gt; [-position &lt;pos&gt;]</code></td>
1177
1178
      <td>Add a new entry with the given properties as explained above. For the types, use a format like <code>"rom tape disk"</code>. Optionally, you can also specify where in the list of existing file pools the new file pool should be added. By default, this is at the end.</td>
1179
    </tr>
1180
1181
    <tr>
1182
      <td><code>filepool remove &lt;position&gt;</code></td>
1183
1184
      <td>Remove the file pool at the given position</td>
1185
    </tr>
1186
1187
    <tr>
1188
      <td><code>filepool reset</code></td>
1189
1190
      <td>Reset the file pool settings to the default values</td>
1191
    </tr>
1192
  </table>
1193
1194
  <p>An example of the default file pools for a Windows 7 system with user Quibus:</p>
1195
<pre>
1196
1: C:/Users/Quibus/Documents/openMSX/share/systemroms  [system_rom]
1197
2: C:/Users/Quibus/Documents/openMSX/share/software  [rom disk tape]
1198
3: C:/Program Files/openMSX/share/systemroms  [system_rom]
1199
4: C:/Program Files/openMSX/share/software  [rom disk tape]
1200
</pre>
1201
  <p>The first one is the system ROMs dir in the user's home directory. The second is the software file pool for other software in the user's home directory. The last two are similar, but then on system level. On a UNIX like system, you get something very similar.</p>
1202
1203
  <h3><a id="findcheat">findcheat</a></h3>
1204
1205
  <p>This is a tool to find new cheats, for example for a certain game it can help you find the memory location where the number of remaining lives is stored. These cheats can later be added to the <code><a class="internal" href="#trainer">trainer</a></code> command.</p>
1206
1207
  <p>It works more or less like this:</p>
1208
  <ol>
1209
    <li>Initialize the <code>findcheat</code> tool, this takes an initial snapshot of the MSX memory.</li>
1210
    <li>Perform some action in the game that changes the variable that you're interested in. For example if you want to find the memory location where the number of lives is stored, you have to loose (or gain) a life in the game.</li>
1211
    <li>Now use the <code>findcheat</code> tool to compare the current MSX memory state with the previous memory snapshot. <code>findcheat</code> offers a lot of possibilities here, for example you can search for memory locations that became bigger or smaller or locations whose value changed or didn't change.</li>
1212
    <li><code>findcheat</code> will show a list of memory locations that still match the search criteria.</li>
1213
    <li>If there still are still too many matches, repeat from step 2.</li>
1214
  </ol>
1215
1216
  <p>Vampier made a video tutorial on how to use <code>findcheat</code>, you can find it <a class="external" href="http://www.youtube.com/watch?v=F11ltfkCtKo">here</a>.</p>
1217
1218
  <h3><a id="get_clipboard_text">get_clipboard_text</a></h3>
1219
1220
  <p>Shows the (text) content of the clipboard as a string.</p>
1221
1222
  <div class="subsectiontitle">
1223
    usage:
1224
  </div>
1225
1226
  <table>
1227
    <tr>
1228
      <td><code>get_clipboard_text</code></td>
1229
1230
      <td>Returns the text content of the clipboard as a string.</td>
1231
    </tr>
1232
  </table>
1233
1234
1235
  <h3><a id="hd">hd&lt;x&gt;</a></h3>
1236
1237
  <p>Change the hard disk image. The commands <code>hda</code>, <code>hdb</code> etc. are assigned to all available hard disk drives in the MSX. They will not correspond to drive names as used in MSX-DOS.</p>
1238
1239
  <div class="subsectiontitle">
1240
    usage:
1241
  </div>
1242
1243
  <table>
1244
    <tr>
1245
      <td><code>hda &lt;disk image&gt;</code></td>
1246
1247
      <td>Use hard disk image for hard disk "hda"</td>
1248
    </tr>
1249
1250
    <tr>
1251
      <td><code>hda insert &lt;disk image&gt;</code></td>
1252
1253
      <td>Use hard disk image for hard disk "hda"</td>
1254
    </tr>
1255
1256
    <tr>
1257
      <td><code>hda</code></td>
1258
1259
      <td>Show current hard disk image for hard disk "hda"</td>
1260
    </tr>
1261
  </table>
1262
1263
  <div class="note">
1264
    Note: Because of disk caching, changing the hard disk when the MSX is running can lead to corruption of the hard disk contents. Therefore openMSX blocks the <code>hd&lt;x&gt;</code> commands unless the MSX is powered off. See <code><a class="internal" href="#power">power</a></code> setting.
1265
  </div>
1266
1267
  <h3><a id="help">help</a></h3>
1268
1269
  <p>Shows help info for console commands.</p>
1270
1271
  <div class="subsectiontitle">
1272
    usage:
1273
  </div>
1274
1275
  <table>
1276
    <tr>
1277
      <td><code>help</code></td>
1278
      <td>Shows a list of all possible commands</td>
1279
    </tr>
1280
1281
    <tr>
1282
      <td><code>help &lt;command&gt;</code></td>
1283
      <td>Shows help info for a specific command</td>
1284
    </tr>
1285
1286
    <tr>
1287
      <td><code>help &lt;command&gt; &lt;subcommand&gt;</code></td>
1288
      <td>Some commands have more detailed help on subcommands</td>
1289
    </tr>
1290
  </table>
1291
1292
  <h3><a id="incr">incr</a></h3>
1293
1294
  <p>Increment an integer setting.</p>
1295
1296
  <div class="subsectiontitle">
1297
    usage:
1298
  </div>
1299
1300
  <table>
1301
    <tr>
1302
      <td><code>incr &lt;setting&gt;</code></td>
1303
1304
      <td>Increment the specified setting by one</td>
1305
    </tr>
1306
1307
    <tr>
1308
      <td><code>incr &lt;setting&gt; &lt;num&gt;</code></td>
1309
1310
      <td>Increment the specified setting by the given amount (can be negative)</td>
1311
    </tr>
1312
  </table>
1313
1314
  <div class="subsectiontitle">
1315
    examples:
1316
  </div>
1317
1318
  <div class="examples">
1319
    <code>incr speed</code><br />
1320
    <code>incr renshaturbo 10</code><br />
1321
    <code>incr scanline -5</code>
1322
  </div>
1323
1324
  <h3><a id="iomap">iomap</a></h3>
1325
1326
  <p>Shows what I/O ports are connected to which devices. The related command <code><a class="internal" href="#slotmap">slotmap</a></code> shows a similar overview, but for memory-mapped devices.</p>
1327
1328
  <div class="subsectiontitle">
1329
    usage:
1330
  </div>
1331
1332
  <table>
1333
    <tr>
1334
      <td><code>iomap</code></td>
1335
1336
      <td>Shows the I/O map of the current MSX machine</td>
1337
    </tr>
1338
  </table>
1339
1340
  <h3><a id="keymatrix">keymatrixdown / keymatrixup</a></h3>
1341
1342
  <p>Press or release keys in the MSX keyboard matrix. Can be used to make an external program or Tcl script press MSX keys. For some more information about the keymatrix, you could read the <a href="http://map.grauw.nl/articles/keymatrix.php">article on the MAP</a>.</p>
1343
1344
  <div class="subsectiontitle">
1345
    usage:
1346
  </div>
1347
1348
  <table>
1349
    <tr>
1350
      <td><code>keymatrixdown &lt;row&gt; &lt;mask&gt;</code></td>
1351
      <td>Press the indicated MSX keys</td>
1352
    </tr>
1353
1354
    <tr>
1355
      <td><code>keymatrixup   &lt;row&gt; &lt;mask&gt;</code></td>
1356
      <td>Release the indicated MSX keys</td>
1357
    </tr>
1358
  </table>
1359
1360
  <div class="subsectiontitle">
1361
    examples:
1362
  </div>
1363
1364
  <div class="examples">
1365
    <code>keymatrixdown 6 0x01</code><br />
1366
    <code>keymatrixup   6 0x01</code>
1367
  </div>
1368
1369
  <h3><a id="laserdiscplayer">laserdiscplayer</a></h3>
1370
1371
  <p>Controls the Laserdisc player; a Laserdisc can be inserted or ejected. When a real Laserdisc player is connected to an MSX, no other controls are available either.</p>
1372
1373
  <p>Note that this command is only available when the Pioneer PX-7 or Pioneer PX-V60 MSX machine is being emulated, and only when openMSX was built with Laserdisc support (Laserdisc support is an optional compile-time feature)</p>
1374
1375
  <div class="subsectiontitle">
1376
    usage:
1377
  </div>
1378
1379
  <table>
1380
    <tr>
1381
      <td><code>laserdiscplayer insert &lt;filename&gt;</code></td>
1382
1383
      <td>Inserts the specified file into the virtual laserdisc player.</td>
1384
    </tr>
1385
1386
    <tr>
1387
      <td><code>laserdiscplayer eject</code></td>
1388
1389
      <td>Ejects the laserdisc from the virtual laserdisc player; this emulates pressing the eject button on a real Laserdisc Player.</td>
1390
    </tr>
1391
  </table>
1392
1393
  <h3><a id="list_extensions">list_extensions</a></h3>
1394
1395
  <p>Returns a list of inserted cartridges and extensions. These can be removed with the <code><a class="internal" href="#remove_extension">remove_extension</a></code> command or
1396
  additional items can be added with the <code><a class="internal" href="#cart">cart</a></code> and <code><a class="internal" href="#ext">ext</a></code> commands.</p>
1397
1398
  <div class="subsectiontitle">
1399
    usage:
1400
  </div>
1401
1402
  <table>
1403
    <tr>
1404
      <td><code>list_extensions</code></td>
1405
1406
      <td>Lists all currently inserted cartridges and extensions</td>
1407
    </tr>
1408
  </table>
1409
1410
  <h3><a id="load_settings">load_settings</a></h3>
1411
1412
  <p>Load settings from a given settings XML file. The settings file does not have to be complete: settings that are not mentioned in the given file are left untouched. See also <code><a class="internal" href="#save_settings">save_settings</a></code>.</p>
1413
1414
  <div class="subsectiontitle">
1415
    usage:
1416
  </div>
1417
1418
  <table>
1419
    <tr>
1420
      <td><code>load_settings &lt;filename&gt;</code></td>
1421
1422
      <td>Load settings from the given file</td>
1423
    </tr>
1424
  </table>
1425
1426
  <h3><a id="machine">machine</a></h3>
1427
1428
  <p>Switch to a new MSX machine.</p>
1429
1430
  <div class="subsectiontitle">
1431
    usage:
1432
  </div>
1433
1434
  <table>
1435
    <tr>
1436
      <td><code>machine</code></td>
1437
1438
      <td>Returns the handle for the currently active machine</td>
1439
    </tr>
1440
1441
    <tr>
1442
      <td><code>machine &lt;machine name&gt;</code></td>
1443
1444
      <td>Switch to the specified machine, also returns the handle for that machine</td>
1445
    </tr>
1446
  </table>
1447
1448
  <div class="note">
1449
    Note: The machine handle is mostly used by external applications controlling openMSX (see also <a class="external" href="openmsx-control.html">Controlling openMSX from External Applications</a>). For interactive use you can omit the machine handle to have the commands operate on the current machine.
1450
  </div>
1451
1452
1453
  <h3><a id="machines">create_machine / load_machine / activate_machine / list_machines / delete_machine</a></h3>
1454
1455
  <p>openMSX has the possibility to have multiple MSX machines concurrently in memory. This is more or less like multiple tabs in a web browser: you only work with one at-a-time, but you can have multiple open at the same time and easily switch between them. These commands are low level commands to manage this.</p>
1456
1457
  <p>Some commands are specific per machine, for example if you insert a disk image into the disk drive of the emulated MSX machine and if you have multiple MSX machines, you need to specify in which MSX machine you want to insert the disk. To solve this, we introduced the concept of the 'active' MSX machine (this is also the machine that is visible and audible). All unqualified machine-specific command will act on the active machine. If you want to execute the command in a specific machine, you can qualify the command with a machineID prefix.</p>
1458
1459
  <table>
1460
    <tr>
1461
      <td><code>diska &lt;diskimage&gt;</code></td>
1462
      <td>execute the diska command in the active machine</td>
1463
    </tr>
1464
    <tr>
1465
      <td><code>&lt;machine-ID&gt;::diska &lt;diskimage&gt;</code></td>
1466
      <td>execute the diska command in the specified machine</td>
1467
    </tr>
1468
  </table>
1469
1470
  <h4><code>create_machine</code>:</h4>
1471
  <p>This command returns a new machine-id. This machine-id can be used in the following commands. In the web browser analogy this command would open a new empty tab.</p>
1472
1473
  <h4><code>load_machine</code>:</h4>
1474
  <p>This command loads a machine configuration (= MSX model) into the given machine-ID.
1475
  In the web browser analogy, this command would load a page in a previously created empty tab. And unlike a web browser, where you can reload a different page in the same tab, you can only load a machine configuration once in the same machine-ID.</p>
1476
1477
  <h4><code>activate_machine</code>:</h4>
1478
  <p>This command activates the given machine-ID. At any time there can only be one active machine-ID. This is analogue to switching tabs in a web browser.</p>
1479
1480
  <h4><code>list_machines</code>:</h4>
1481
  <p>Returns a list of all currently existing machine-IDs.</p>
1482
1483
  <h4><code>delete_machine</code>:</h4>
1484
  <p>Deletes the given machine-ID. This is analogue to closing a tab in a web browser.</p>
1485
1486
  <h4>examples:</h4>
1487
  <table>
1488
    <tr>
1489
      <td><code>set oldID [machineID]</code></td>
1490
      <td>get the current machineID</td>
1491
    </tr>
1492
    <tr>
1493
      <td><code>set newID [create_machine]</code></td>
1494
      <td>create a new machineID</td>
1495
    </tr>
1496
    <tr>
1497
      <td><code>$newID::load_machine Philips_NMS_8250</code></td>
1498
      <td>load an MSX2 configuration in that new machineID</td>
1499
    </tr>
1500
    <tr>
1501
      <td><code>activate_machine $newID</code></td>
1502
      <td>switch to the new machine</td>
1503
    </tr>
1504
    <tr>
1505
      <td><code>activate_machine $oldID</code></td>
1506
      <td>switch back to old machine</td>
1507
    </tr>
1508
    <tr>
1509
      <td><code>delete_machine $newID</code></td>
1510
      <td>delete new machine</td>
1511
    </tr>
1512
  </table>
1513
1514
  <div class="note">
1515
    If you don't care about multiple active machines, the <code><a class="internal" href="#machine">machine</a></code> command is much more convenient to switch to a different MSX configuration.
1516
  </div>
1517
1518
1519
  <h3><a id="machine_info">machine_info</a></h3>
1520
1521
  <p>Shows information about a certain topic. This command is similar to the <code><a class="internal" href="#openmsx_info">openmsx_info</a></code> command. The topics of
1522
  <code>machine_info</code> are all machine specific, while the topics of <code><a class="internal" href="#openmsx_info">openmsx_info</a></code> are generic.</p>
1523
1524
  <div class="subsectiontitle">
1525
    usage:
1526
  </div>
1527
1528
  <table>
1529
    <tr>
1530
      <td><code>machine_info</code></td>
1531
1532
      <td>Shows a list of all possible topics</td>
1533
    </tr>
1534
1535
    <tr>
1536
      <td><code>machine_info &lt;topic&gt;</code></td>
1537
1538
      <td>Shows info on the given topic</td>
1539
    </tr>
1540
  </table>
1541
1542
  <h3><a id="message">message</a></h3>
1543
  <p>Show a message, with optional level (info, warning, error). By default this message will be shown in a coloured box at the top of the screen for a (short) duration and then fade away.</p>
1544
  <div class="subsectiontitle">
1545
    usage:
1546
  </div>
1547
  <table>
1548
    <tr>
1549
      <td><code>message &lt;text&gt; [&lt;level&gt;]</code></td>
1550
    </tr>
1551
  </table>
1552
  <div class="subsectiontitle">
1553
    examples:
1554
  </div>
1555
  <div class="examples">
1556
    <code>message "Hello world!"</code><br />
1557
    <code>message "Something bad happened" error</code><br />
1558
  </div>
1559
1560
1561
  <h3><a id="monitor_type">monitor_type</a></h3>
1562
1563
  <p>Select a monitor color profile.</p>
1564
1565
  <div class="subsectiontitle">
1566
    usage:
1567
  </div>
1568
1569
  <table>
1570
    <tr>
1571
      <td><code>monitor_type</code></td>
1572
1573
      <td>Shows the currently selected color profile</td>
1574
    </tr>
1575
1576
    <tr>
1577
      <td><code>monitor_type -list</code></td>
1578
1579
      <td>Lists all available color profiles</td>
1580
    </tr>
1581
1582
    <tr>
1583
      <td><code>monitor_type &lt;profile&gt;</code></td>
1584
1585
      <td>Selects a new color profile</td>
1586
    </tr>
1587
  </table>
1588
1589
  <div class="note">
1590
    Note: This command is a convenience wrapper around the <code><a class="internal" href="#color_matrix">color_matrix</a></code> setting.
1591
  </div>
1592
1593
1594
  <h3><a id="msxcode2unicode">msxcode2unicode</a></h3>
1595
1596
  <p>Returns a unicode string converted from an MSX-string, i.e., a string based on MSX character codes.</p>
1597
  <p>The optional fallback used for each character that cannot be mapped for the
1598
current MSX model can be:</p>
1599
  <ul>
1600
    <li>omitted: then space will be used as fallback character.</li>
1601
    <li>an integer number: then this number will be used as unicode point to be the
1602
  the fallback character.</li>
1603
    <li>a Tcl proc, which expects one input character and must return one unicode
1604
  point.</li>
1605
  </ul>
1606
1607
  <div class="subsectiontitle">
1608
    usage:
1609
  </div>
1610
  <table>
1611
    <tr>
1612
      <td><code>msxcode2unicode &lt;msx-string&gt; [&lt;fallback&gt;]</code></td>
1613
    </tr>
1614
  </table>
1615
  <div class="subsectiontitle">
1616
    examples:
1617
  </div>
1618
  <div class="examples">
1619
    <table>
1620
      <tr>
1621
        <td><code>msxcode2unicode [format %c 1]</code></td>
1622
        <td>Prints black smiley face if emulating an 'international' MSX model</td>
1623
      </tr>
1624
    </table>
1625
  </div>
1626
1627
1628
  <h3><a id="mute_channels">mute_channels / unmute_channels / solo</a></h3>
1629
1630
  <p>Mute or unmute specific individual channels of sound devices. The syntax is very similar to the <code><a class="internal" href="#record_channels">record_channels</a></code> command.</p>
1631
1632
  <div class="subsectiontitle">
1633
    usage:
1634
  </div>
1635
1636
  <table>
1637
    <tr>
1638
      <td><code>mute_channels &lt;device&gt; [&lt;channels&gt;]] [&lt;device&gt; [&lt;channels&gt;]]</code></td>
1639
1640
      <td>Mute the specified channels of the specified device(s). If a device is given but no specific channels are specified, all channels of that device are muted. If no arguments are given at all, this command return a list of all currently muted channels.</td>
1641
    </tr>
1642
1643
    <tr>
1644
      <td><code>unmute_channels &lt;device&gt; [&lt;channels&gt;]] [&lt;device&gt; [&lt;channels&gt;]]</code></td>
1645
1646
      <td>Unmute the specified channels of the specified device(s). If a device is given but no specific channels are specified, all channels of that device are unmuted. If no arguments are given at all, this command unmutes all channels of all devices. </td>
1647
    </tr>
1648
    <tr>
1649
      <td><code>solo &lt;device&gt; [&lt;channels&gt;]] [&lt;device&gt; [&lt;channels&gt;]]</code></td>
1650
1651
      <td>Mute all channels of all devices except for the specified channels.</td>
1652
    </tr>
1653
  </table>
1654
1655
  <div class="subsectiontitle">
1656
    examples:
1657
  </div>
1658
1659
  <div class="examples">
1660
    <code>mute_channels</code><br />
1661
    <code>mute_channels PSG</code><br />
1662
    <code>mute_channels SCC 2,4</code><br />
1663
    <code>unmute_channels</code><br />
1664
    <code>unmute_channels PSG 1 SCC 1,3-4</code><br />
1665
    <code>solo PSG 3</code>
1666
  </div>
1667
1668
1669
  <h3><a id="nowind">nowind&lt;x&gt;</a></h3>
1670
1671
  <p>Similar to the <code><a class="internal" href="#disk">disk&lt;x&gt;</a></code>
1672
  commands there is a <code>nowind&lt;x&gt;</code> command for each nowind
1673
  interface. This command is modelled after the 'usbhost' command of the real
1674
  nowind interface. Though only a subset of the options is supported. Here's a
1675
  short overview of the command-line options:</p>
1676
1677
  <table>
1678
    <tr><th>long</th>      <th>short</th><th>explanation</th></tr>
1679
    <tr><td>--image</td>   <td>-i</td>   <td>specify disk image</td></tr>
1680
    <tr><td>--hdimage</td> <td>-m</td>   <td>specify harddisk image</td></tr>
1681
    <tr><td>--romdisk</td> <td>-j</td>   <td>enable romdisk</td></tr>
1682
    <tr><td>--ctrl</td>    <td>-c</td>   <td>no phantom disks</td></tr>
1683
    <tr><td>--no-ctrl</td> <td>-C</td>   <td>enable phantom disks</td></tr>
1684
    <tr><td>--allow</td>   <td>-a</td>   <td>allow other diskroms to initialize</td></tr>
1685
    <tr><td>--no-allow</td><td>-A</td>   <td>don't allow other diskroms to initialize</td></tr>
1686
  </table>
1687
1688
  <p>If you don't pass any arguments to this command, you'll get an overview of
1689
  the current nowind status.</p>
1690
1691
  <p>This command will create a certain amount of drives on the nowind
1692
  interface and (optionally) insert diskimages in those drives. For each of
1693
  these drives there will also be a
1694
  <code><a class="internal" href="#disk">nowind&lt;x&gt;&lt;1..8&gt;</a></code>
1695
  command created. Those commands are similar to e.g. the
1696
  <code><a class="internal" href="#disk">diska</a></code>
1697
  command. They can be used to access the more advanced diskimage insertion
1698
  options.</p>
1699
1700
  <p>In some cases it is needed to reboot the MSX before the changes take
1701
  effect. In those cases you'll get a message that warns about this.</p>
1702
1703
  <div class="subsectiontitle">examples:</div>
1704
  <table>
1705
    <tr>
1706
      <td><code>nowinda -a image.dsk -j</code></td>
1707
      <td>Image.dsk is inserted into drive A: and the romdisk will be drive B:.
1708
      Other diskroms will be able to install drives as well. For example when
1709
      the MSX has an internal diskdrive, drive C: en D: will be available as
1710
      well.</td>
1711
    </tr>
1712
    <tr>
1713
      <td><code>nowinda disk1.dsk disk2.dsk</code></td>
1714
      <td>The two images will be inserted in A: and B: respectively.</td>
1715
    </tr>
1716
    <tr>
1717
      <td><code>nowinda -m hdimage.dsk</code></td>
1718
      <td>Inserts a harddisk image. All available partitions will be mounted
1719
      as drives.</td>
1720
    </tr>
1721
    <tr>
1722
      <td><code>nowinda -m hdimage.dsk:1</code></td>
1723
      <td>Inserts the first partition only.</td>
1724
    </tr>
1725
    <tr>
1726
      <td><code>nowinda -m hdimage.dsk:2-4</code></td>
1727
      <td>Inserts the 2nd, 3th and 4th partition as drive A: B: and C:.</td>
1728
    </tr>
1729
  </table>
1730
1731
1732
  <h3><a id="openmsx_info">openmsx_info</a></h3>
1733
1734
  <p>Shows information about a certain topic. For machine-specific topics, use the related command <code><a class="internal" href="#machine_info">machine_info</a></code>.</p>
1735
1736
  <div class="subsectiontitle">
1737
    usage:
1738
  </div>
1739
1740
  <table>
1741
    <tr>
1742
      <td><code>openmsx_info</code></td>
1743
1744
      <td>Shows a list of all possible topics</td>
1745
    </tr>
1746
1747
    <tr>
1748
      <td><code>openmsx_info &lt;topic&gt;</code></td>
1749
1750
      <td>Shows info on the given topic</td>
1751
    </tr>
1752
  </table>
1753
1754
1755
  <h3><a id="openmsx_update">openmsx_update</a></h3>
1756
1757
  <p>Enable or disable update notifications of a certain type. This command is intended for external programs controlling openMSX. More about this in <a class="external" href="openmsx-control.html">Controlling openMSX from External Applications</a>.</p>
1758
1759
  <div class="subsectiontitle">
1760
    usage:
1761
  </div>
1762
1763
  <table>
1764
    <tr>
1765
      <td><code>openmsx_update enable &lt;type&gt;</code></td>
1766
1767
      <td>enable notifications for this type</td>
1768
    </tr>
1769
1770
    <tr>
1771
      <td><code>openmsx_update disable &lt;type&gt;</code></td>
1772
1773
      <td>disable notifications for this type</td>
1774
    </tr>
1775
  </table>
1776
1777
  <div class="subsectiontitle">
1778
    examples:
1779
  </div>
1780
1781
  <div class="examples">
1782
    <code>openmsx_update enable led</code><br />
1783
    <code>openmsx_update disable setting</code>
1784
  </div>
1785
1786
1787
  <h3><a id="osd">osd</a></h3>
1788
1789
  <p>openMSX has the possibility to show OSD (on screen display) elements. For example, the game overlays and TAS tools are implemented via OSD elements. This command allows to create new OSD elements, configure existing elements or delete elements.</p>
1790
1791
  <p>This command is only useful if you plan to adjust or enhance the openMSX OSD, or create your own OSD widgets.</p>
1792
1793
  <!-- do we really have to repeat the help text from the openmsx source code here? -->
1794
1795
  <p>Execute "<code>help osd</code>" to get a detailed description of this command, which we will not repeat here.</p>
1796
1797
  <h3><a id="palette">palette</a></h3>
1798
1799
  <p>Shows the current VDP palette settings.  Related command: <code><a class="internal" href="#vdpregs">vdpregs</a></code>.</p>
1800
1801
  <div class="subsectiontitle">
1802
    usage:
1803
  </div>
1804
1805
  <table>
1806
    <tr>
1807
      <td><code>palette</code></td>
1808
1809
      <td>Show the currently active color palette</td>
1810
    </tr>
1811
  </table>
1812
1813
  <h3><a id="plugunplug">plug / unplug</a></h3>
1814
1815
  <p>Plugs or unplugs a plug into a connector, for example plug a virtual joystick into a virtual joystick port.</p>
1816
1817
  <div class="subsectiontitle">
1818
    usage:
1819
  </div>
1820
1821
  <table>
1822
    <tr>
1823
      <td><code>plug</code></td>
1824
1825
      <td>Shows all currently connected plugs</td>
1826
    </tr>
1827
1828
    <tr>
1829
      <td><code>plug &lt;connector&gt;</code></td>
1830
1831
      <td>Shows currently connected plug for the specified connector</td>
1832
    </tr>
1833
1834
    <tr>
1835
      <td><code>plug &lt;connector&gt; &lt;plug&gt;</code></td>
1836
1837
      <td>Plugs the specified plug into the specified connector</td>
1838
    </tr>
1839
1840
    <tr>
1841
      <td><code>unplug &lt;connector&gt;</code></td>
1842
1843
      <td>Unplugs the plug connected to the specified connector</td>
1844
    </tr>
1845
  </table>
1846
1847
  <div class="subsectiontitle">
1848
    examples:
1849
  </div>
1850
1851
  <div class="examples">
1852
    <code>plug cassetteport cassetteplayer</code><br />
1853
    <code>plug joyporta mouse</code><br />
1854
    <code>plug printerport logger</code><br />
1855
    <code>unplug joyportb</code><br />
1856
  </div>
1857
1858
  <h3><a id="psg_profile">psg_profile</a></h3>
1859
1860
  <p>Select a PSG sound profile.</p>
1861
1862
  <div class="subsectiontitle">
1863
    usage:
1864
  </div>
1865
1866
  <table>
1867
    <tr>
1868
      <td><code>psg_profile</code></td>
1869
1870
      <td>Shows the currently selected sound profile</td>
1871
    </tr>
1872
1873
    <tr>
1874
      <td><code>psg_profile -list</code></td>
1875
1876
      <td>Lists all available sound profiles</td>
1877
    </tr>
1878
1879
    <tr>
1880
      <td><code>psg_profile &lt;profile&gt;</code></td>
1881
1882
      <td>Selects a new sound profile</td>
1883
    </tr>
1884
  </table>
1885
1886
  <div class="note">
1887
    Note: This command is a convenience wrapper around the <code><a class="internal" href="#soundchip_vibrato_frequency">PSG_vibrato_frequency</a></code>, <code><a class="internal" href="#soundchip_vibrato_percent">PSG_vibrato_percent</a></code>, <code><a class="internal" href="#soundchip_detune_frequency">PSG_detune_frequency</a></code> and <code><a class="internal" href="#soundchip_detune_percent">PSG_detune_percent</a></code> settings.
1888
  </div>
1889
1890
  <h3><a id="record">record</a></h3>
1891
1892
  <p>Controls video recording: write openMSX audio/video to an AVI file.</p>
1893
1894
  <div class="subsectiontitle">
1895
    usage:
1896
  </div>
1897
1898
  <table>
1899
    <tr>
1900
      <td><code>record start</code></td>
1901
1902
      <td>Record to file "openmsxNNNN.avi"</td>
1903
    </tr>
1904
1905
    <tr>
1906
      <td><code>record start &lt;filename&gt;</code></td>
1907
1908
      <td>Record to indicated file</td>
1909
    </tr>
1910
1911
    <tr>
1912
      <td><code>record start -prefix foo</code></td>
1913
1914
      <td>Record to file "fooNNNN.avi"</td>
1915
    </tr>
1916
1917
    <tr>
1918
      <td><code>record stop</code></td>
1919
1920
      <td>Stop recording</td>
1921
    </tr>
1922
1923
    <tr>
1924
      <td><code>record toggle</code></td>
1925
1926
      <td>Toggle recording</td>
1927
    </tr>
1928
  </table>
1929
1930
  <p>The <code>start</code> subcommand also accepts an optional <code>-audioonly</code>, <code>-videoonly</code>, <code>-doublesize</code> and a <code>-triplesize</code> flag. Videos are recorded in a 320&times;240 size by default, at 640&times;480 when the <code>-doublesize</code> flag is used and 960&times;720 when using the <code>-triplesize</code> flag.
1931
  If only audio is recorded, the created file will be a WAV file instead of an AVI file.</p>
1932
  <p>If any stereo sound devices are present or any sound device has an off-center balance, the recording will be made in stereo, otherwise it will be mono.
1933
  If a recording is made in mono and then a stereo sound device is added, you'll receive a warning that stereo sound has been detected and that the two channels will be mixed down to mono.
1934
  You can prevent this from happening by using the <code>-stereo</code> option to force a stereo recording even if no stereo devices are present at the time you enter the command.
1935
  You can also force a mono recording with <code>-mono</code> to save space.</p>
1936
  <p>The <code><a class="internal" href="#soundlog">soundlog</a></code> command is a shorthand for <code>record -audioonly</code>.</p>
1937
  <p>Use <code>record_chunks</code> if you want some extra options. You can control the maximum length (in seconds) to record and also set up multiple recordings of a certain length. This is very useful if you want to record for e.g. YouTube. The default length is 14:59 (to make sure YouTube will accept it). Using this command implies <code>-doublesize</code>.</p>
1938
  <p>Use <code>record_chunks_on_framerate_changes</code> if you want to split up the recording in several files, whenever the frame rate of the MSX changes. An AVI file cannot contain video of multiple frame rates, so sound and video will get out of sync if that happens without using this special version of the command. Do not specify the target filename with this variant, or openMSX will record all chunks to the same file.</p>
1939
1940
  <h3><a id="record_channels">record_channels</a></h3>
1941
1942
  <p>A high level command to record individual channels of sound chips to separate files. In the following variants of the command you can specify devices and channels. Multiple devices can be specified and multiple channels as well. If you want to specify channels of a device, put them right after the device. You can also specify <code>all</code> for the device, which means that all sound devices in the currently running MSX will be recorded. When starting recording, an option <code>-prefix</code> can be given to specify a filename prefix.</p>
1943
1944
  <div class="subsectiontitle">
1945
    usage:
1946
  </div>
1947
1948
  <table>
1949
    <tr>
1950
      <td><code>record_channels [start] &lt;device&gt; [&lt;channels&gt;] [&lt;device&gt; [&lt;channels&gt;]] [-prefix &lt;prefix&gt;]</code></td>
1951
1952
      <td>Start recording the specified channel(s) of the specified device(s). If no channels are given, all channels of the device are recorded. </td>
1953
    </tr>
1954
1955
    <tr>
1956
      <td><code>record_channels stop [&lt;device&gt; [&lt;channels&gt;]] [&lt;device&gt; [&lt;channels&gt;]]</code></td>
1957
1958
      <td>Stop recording the specified channel(s) of the specified device(s). If no channels are given, recording for all channels is stopped for the given device(s). If no devices are given, all channel recording is stopped.</td>
1959
    </tr>
1960
1961
    <tr>
1962
      <td><code>record_channels all -prefix justtesting</code></td>
1963
1964
      <td>Record all channels of all sound devices and create the file names with prefix 'justtesting' (e.g. to quickly delete all these files again).</td>
1965
    </tr>
1966
1967
    <tr>
1968
      <td><code>record_channels list</code></td>
1969
1970
      <td>Lists which channels of which sound chips are currently being recorded.</td>
1971
    </tr>
1972
1973
  </table>
1974
1975
  <div class="subsectiontitle">
1976
    examples:
1977
  </div>
1978
1979
  <div class="examples">
1980
    <code>record_channels start PSG</code><br />
1981
    <code>record_channels PSG</code><br />
1982
    <code>record_channels SCC 1,4-5</code><br />
1983
    <code>record_channels SCC PSG 1</code><br />
1984
    <code>record_channels "MSX Music" 7-9 SCC 3,5 PSG 2</code><br />
1985
    <code>record_channels stop</code><br />
1986
    <code>record_channels stop PSG</code><br />
1987
    <code>record_channels stop SCC 3,5</code><br />
1988
    <code>record_channels list</code>
1989
  </div>
1990
1991
<h3><a id="remove_extension">remove_extension</a></h3>
1992
1993
  <p>Remove a cartridge or extension from a running MSX machine. See also the commands <code><a class="internal" href="#cart">cart</a></code>, <code><a class="internal" href="#ext">ext</a></code>, <code><a class="internal" href="#list_extensions">list_extensions</a></code>.</p>
1994
1995
  <div class="subsectiontitle">
1996
    usage:
1997
  </div>
1998
1999
  <table>
2000
    <tr>
2001
      <td><code>remove_extension fmpac</code></td>
2002
2003
      <td>Removes the FMPAC extension from the running MSX</td>
2004
    </tr>
2005
  </table>
2006
2007
  <h3><a id="reset">reset</a></h3>
2008
2009
  <p>Emulates the pressing of the reset button on the MSX. This sends a reset pulse to all devices, but does not erase memory contents.</p>
2010
2011
  <div class="subsectiontitle">
2012
    usage:
2013
  </div>
2014
2015
  <table>
2016
    <tr>
2017
      <td><code>reset</code></td>
2018
2019
      <td>Resets the current machine</td>
2020
    </tr>
2021
  </table>
2022
2023
  <h3><a id="reverse">reverse</a></h3>
2024
2025
  <p>Controls the reverse feature. When this feature is enabled (the default), openMSX will collect data while emulating, which enables you to go back (and forward) in MSX time. In other words: you cannot use the commands to go back and forward in time, if you disable the feature.</p>
2026
2027
  <div class="subsectiontitle">
2028
    usage:
2029
  </div>
2030
2031
  <table>
2032
    <tr>
2033
      <td><code>reverse start</code></td>
2034
2035
      <td>Start collecting data (enable the reverse feature).</td>
2036
    </tr>
2037
    <tr>
2038
      <td><code>reverse stop</code></td>
2039
2040
      <td>Stop collecting data (disable reverse feature) and remove all collected data.</td>
2041
    </tr>
2042
    <tr>
2043
      <td><code>reverse status</code></td>
2044
2045
      <td>Gives information about the reverse feature and the data it collected. Mostly useful for scripts.</td>
2046
    </tr>
2047
    <tr>
2048
      <td><code>reverse goback &lt;n&gt;</code></td>
2049
2050
      <td>Go back &lt;n&gt; seconds in time. Of course, you cannot go back to a time before the time the <code>reverse start</code> command was given.</td>
2051
    </tr>
2052
    <tr>
2053
      <td><code>reverse viewonlymode &lt;on|off&gt;</code></td>
2054
2055
      <td>Control the view only mode of the reverse feature. In view only mode, the replay will never get interrupted by any user actions that normally would interrupt the replay. Use this to safely view a replay without accidentally ruining it by touching a key.</td>
2056
    </tr>
2057
    <tr>
2058
      <td><code>reverse goto &lt;time&gt;</code></td>
2059
2060
      <td>Go to the indicated absolute moment in MSX time (given in seconds). If the time is before the time openMSX started collecting data (with the <code>reverse start</code> command) openMSX will jump to the time when collecting started.</td>
2061
    </tr>
2062
    <tr>
2063
      <td><code>reverse truncatereplay</code></td>
2064
2065
      <td>Stop replaying and wipe all replay data that is in the future (so after <strong>now</strong>). This is useful if you are hindered by the future events somehow, for instance when you are playing a game and jumped too early and therefore reversed. Be careful with this, as there is no way to recover this future. If you are at time 0, it means your whole replay will be gone after executing this command!</td>
2066
    </tr>
2067
    <tr>
2068
      <td><code>reverse savereplay [&lt;filename&gt;]</code></td>
2069
2070
      <td>Save the collected data (an initial savestate and all collected input events) to a file.</td>
2071
    </tr>
2072
    <tr>
2073
      <td><code>reverse loadreplay [-goto &lt;begin|end|savetime|&lt;n&gt;&gt;] [-viewonly] &lt;filename&gt;</code></td>
2074
2075
      <td>Load the replay from the given file and start it. It loads the initial snapshot, starts replaying the recorded events, and enables the reverse feature automatically. With the <code>-goto</code> option, you can specify where to jump to in the replay after loading (<code>begin</code> is default), where <code>savetime</code> is the time at which the replay was saved and <code>n</code> is an absolute time in seconds in the replay. The <code>-viewonly</code> option is a shortcut to put the reverse feature in viewonly mode directly after loading the replay. Without this option, it will always go to normal mode.</td>
2076
    </tr>
2077
  </table>
2078
2079
  <p>There are some extra helper commands to make the feature easier to use.</p>
2080
2081
  <div class="subsectiontitle">
2082
    usage:
2083
  </div>
2084
2085
  <table>
2086
    <tr>
2087
      <td><code>go_back_one_step</code> / <code>go_forward_one_step</code></td>
2088
2089
      <td>Go back or forward one second (at normal speed) in time (if possible). These are used for the default PageUp and PageDown key bindings.</td>
2090
    </tr>
2091
    <tr>
2092
      <td><code>reverse_prev [&lt;min&gt; [&lt;max&gt;]]</code></td>
2093
2094
      <td>Go back in time to the previous (internal) snapshot. The further back in the past the less dense the amount of snapshots are. So, executing this command multiple times, will take successively bigger steps in the past. You can optionally specify a minimal and maximal step size. You will at least go back the minimal amount of time (even if there's a snapshot closer to the current time) and at most the maximal amount of time (even if there's no snapshot within the maximum specified time from the current time).</td>
2095
    </tr>
2096
    <tr>
2097
      <td><code>reverse_next [&lt;min&gt; [&lt;max&gt;]]</code></td>
2098
2099
      <td>As <code>reverse_prev</code> but then it goes to the closest snapshot in the future (if possible).</td>
2100
    </tr>
2101
  </table>
2102
2103
  <p>Because the reverse feature is very useful, it is automatically enabled via <code><a class="internal" href="#auto_enable_reverse">auto_enable_reverse</a></code> setting.</p>
2104
2105
  <h3><a id="save_settings">save_settings</a></h3>
2106
2107
  <p>Write the current openMSX settings to a settings XML file. See also <code><a class="internal" href="#load_settings">load_settings</a></code>.</p>
2108
2109
  <p>If you disabled <code><a class="internal" href="#save_settings_on_exit">save_settings_on_exit</a></code>, you can use this command to save your preferences.</p>
2110
2111
  <div class="subsectiontitle">
2112
    usage:
2113
  </div>
2114
2115
  <table>
2116
    <tr>
2117
      <td><code>save_settings</code></td>
2118
2119
      <td>Save settings to the default settings file</td>
2120
    </tr>
2121
2122
    <tr>
2123
      <td><code>save_settings &lt;filename&gt;</code></td>
2124
2125
      <td>Save settings to the given file</td>
2126
    </tr>
2127
  </table>
2128
2129
2130
  <h3><a id="savestate">savestate / loadstate / list_savestates / delete_savestate</a></h3>
2131
2132
  <p>These commands can be used to manage savestates. These are much easier to use than the lowlevel <code><a class="internal" href="#store_machine">store_machine</a></code> and <code><a class="internal" href="#store_machine">restore_machine</a></code> commands.</p>
2133
2134
  <h4><code>savestate [&lt;name&gt;]</code></h4>
2135
  <p>This creates a snapshot of the currently emulated MSX machine. Optionally you can specify a name for the savestate, if you omit this name, the default name <code>quicksave</code> will be taken.</p>
2136
2137
  <h4><code>loadstate [&lt;name&gt;]</code></h4>
2138
  <p>This restores a previously created savestate. Like above you can specify a name which defaults to <code>quicksave</code> if omitted.</p>
2139
2140
  <h4><code>list_savestates</code></h4>
2141
  <p>This returns the names of all previously created savestates.</p>
2142
2143
  <h4><code>delete_savestate &lt;name&gt;</code></h4>
2144
  <p>Delete a previously created savestate.</p>
2145
2146
2147
  <h3><a id="screenshot">screenshot</a></h3>
2148
2149
  <p>Take a screenshot of the openMSX screen. By default this takes a screenshot of the 'scaled' MSX screen (see <code><a class="internal" href="#scale_algorithm">scale_algorithm</a></code> setting) without OSD/GUI elements (e.g. console and icons). If you want to include the GUI and OSD elements pass the <code>-with-osd</code> option. If you want a screenshot of the 'unscaled' raw MSX screen, pass the <code>-raw</code> option. The screenshots are PNG files and (by default) are saved in the <code>screenshots</code> subdirectory of the openMSX data directory in your home directory. There's also an option <code>-no-sprites</code> to take a screenshot with sprite rendering disabled.</p>
2150
2151
  <div class="subsectiontitle">
2152
    usage:
2153
  </div>
2154
2155
  <table>
2156
    <tr>
2157
      <td>
2158
        <code>screenshot [-with-osd] [-raw [-size &lt;width&gt;]] [-no-sprites] [-prefix &lt;prefix&gt;] [&lt;filename&gt;]</code>
2159
      </td>
2160
    </tr>
2161
  </table>
2162
2163
  <div class="subsectiontitle">
2164
    examples:
2165
  </div>
2166
2167
  <table>
2168
    <tr>
2169
      <td><code>screenshot</code></td>
2170
      <td>Write screenshot to file "openmsxNNNN.png"</td>
2171
    </tr>
2172
    <tr>
2173
      <td><code>screenshot &lt;filename&gt;</code></td>
2174
      <td>Write screenshot to indicated file</td>
2175
    </tr>
2176
    <tr>
2177
      <td><code>screenshot -prefix foo</code></td>
2178
      <td>Write screenshot to file "fooNNNN.png"</td>
2179
    </tr>
2180
    <tr>
2181
      <td><code>screenshot -raw</code></td>
2182
      <td>Create screenshot of the raw MSX screen only (so no icons or console and no scaling)</td>
2183
    </tr>
2184
    <tr>
2185
      <td><code>screenshot -raw -size auto</code></td>
2186
      <td>Create screenshot of the raw MSX screen only, with resolution dependent on the displayed MSX screen mode</td>
2187
    </tr>
2188
    <tr>
2189
      <td><code>screenshot -raw -size 320</code></td>
2190
      <td>Create screenshot of the raw MSX screen only, with resolution 320&times;240</td>
2191
    </tr>
2192
    <tr>
2193
      <td><code>screenshot -raw -size 640</code></td>
2194
      <td>Create screenshot of the raw MSX screen only, with resolution 640&times;480</td>
2195
    </tr>
2196
    <tr>
2197
      <td><code>screenshot -with-osd</code></td>
2198
      <td>Create screenshot of the scaled screen, including OSD elements</td>
2199
    </tr>
2200
    <tr>
2201
      <td><code>screenshot -no-sprites</code></td>
2202
      <td>Create screenshot with sprite rendering disabled</td>
2203
    </tr>
2204
  </table>
2205
2206
2207
  <h3><a id="set">set</a></h3>
2208
2209
  <p>Change or query the value of various settings. See also: <code><a class="internal" href="#unset">unset</a></code>.</p>
2210
2211
  <div class="subsectiontitle">
2212
    usage:
2213
  </div>
2214
2215
  <table>
2216
    <tr>
2217
      <td><code>set &lt;setting&gt;</code></td>
2218
2219
      <td>Query the current value of the specified setting</td>
2220
    </tr>
2221
2222
    <tr>
2223
      <td><code>set &lt;setting&gt; &lt;value&gt;</code></td>
2224
2225
      <td>Change the specified setting to the given value</td>
2226
    </tr>
2227
  </table>
2228
2229
  <p>The settings that can be adjusted with this command are listed and explained <a class="internal" href="#settings">later</a> in this document.</p>
2230
2231
  <div class="subsectiontitle">
2232
    examples:
2233
  </div>
2234
2235
  <div class="examples">
2236
    <code>set accuracy pixel</code><br />
2237
    <code>set blur 25</code><br />
2238
    <code>set scanline 20</code><br />
2239
    <code>set deinterlace on</code><br />
2240
  </div>
2241
2242
2243
  <h3><a id="set_clipboard_text">set_clipboard_text</a></h3>
2244
2245
  <p>Sends the given string to the clipboard.</p>
2246
2247
  <div class="subsectiontitle">
2248
    usage:
2249
  </div>
2250
2251
  <table>
2252
    <tr>
2253
      <td><code>set_clipboard_text &lt;text&gt;</code></td>
2254
2255
      <td>Sends the text to the clipboard as a string.</td>
2256
    </tr>
2257
  </table>
2258
2259
  <div class="subsectiontitle">
2260
    examples:
2261
  </div>
2262
  <div class="examples">
2263
    <code>set_clipboard_text "Hello world!"</code><br />
2264
  </div>
2265
2266
2267
  <h3><a id="setup">setup</a></h3>
2268
2269
  <p>Switch to a previously saved setup.</p>
2270
2271
  <div class="subsectiontitle">
2272
    usage:
2273
  </div>
2274
2275
  <table>
2276
    <tr>
2277
      <td><code>setup &lt;setup name&gt;</code></td>
2278
2279
      <td>Switch to the specified setup, which you have saved before with the GUI or the <code><a class="internal" href="#store_setup">store_setup</a></code> command. Also returns the handle of the new machine.</td>
2280
    </tr>
2281
  </table>
2282
2283
  <div class="note">
2284
    Note: The machine handle is mostly used by external applications controlling openMSX (see also <a class="external" href="openmsx-control.html">Controlling openMSX from External Applications</a>). For interactive use you can omit the machine handle to have the commands operate on the current machine.
2285
  </div>
2286
2287
2288
  <h3><a id="sha1sum">sha1sum</a></h3>
2289
2290
  <p>Calculates sha1 value for the given file. If the file is (g)zipped the sha1 is calculated on the unzipped version.</p>
2291
2292
  <div class="subsectiontitle">
2293
    usage:
2294
  </div>
2295
2296
  <table>
2297
    <tr>
2298
      <td><code>sha1sum &lt;filename&gt;</code></td>
2299
2300
      <td>Returns a string with the sha1 value for the specified file.</td>
2301
    </tr>
2302
  </table>
2303
2304
2305
  <h3><a id="slotmap">slotmap</a></h3>
2306
2307
  <p>Shows what devices are inserted into which slots. The related command <code><a class="internal" href="#iomap">iomap</a></code> shows a similar overview, but for I/O mapped devices.</p>
2308
2309
  <div class="subsectiontitle">
2310
    usage:
2311
  </div>
2312
2313
  <table>
2314
    <tr>
2315
      <td><code>slotmap</code></td>
2316
2317
      <td>Shows the slot map of the current MSX machine</td>
2318
    </tr>
2319
  </table>
2320
2321
2322
  <h3><a id="slotselect">slotselect</a></h3>
2323
2324
  <p>Shows the currently selected slots. To see what devices are located in the slots, use the <code><a class="internal" href="#slotmap">slotmap</a></code> command.</p>
2325
2326
  <div class="subsectiontitle">
2327
    usage:
2328
  </div>
2329
2330
  <table>
2331
    <tr>
2332
      <td><code>slotselect</code></td>
2333
2334
      <td>Shows the currently selected slot for each page</td>
2335
    </tr>
2336
  </table>
2337
2338
2339
  <h3><a id="soundlog">soundlog</a></h3>
2340
2341
  <p>Controls sound logging: writing the openMSX sound to a WAV file.</p>
2342
2343
  <p>This command is a shorthand for <code><a class="internal" href="#record">record</a> -audioonly</code>.</p>
2344
2345
  <div class="subsectiontitle">
2346
    usage:
2347
  </div>
2348
2349
  <table>
2350
    <tr>
2351
      <td><code>soundlog start</code></td>
2352
2353
      <td>Log sound to file "openmsxNNNN.wav"</td>
2354
    </tr>
2355
2356
    <tr>
2357
      <td><code>soundlog start &lt;filename&gt;</code></td>
2358
2359
      <td>Log sound to indicated file</td>
2360
    </tr>
2361
2362
    <tr>
2363
      <td><code>soundlog start -prefix foo</code></td>
2364
2365
      <td>Log sound to file "fooNNNN.wav"</td>
2366
    </tr>
2367
2368
    <tr>
2369
      <td><code>soundlog stop</code></td>
2370
2371
      <td>Stop logging sound</td>
2372
    </tr>
2373
2374
    <tr>
2375
      <td><code>soundlog toggle</code></td>
2376
2377
      <td>Toggle sound logging state</td>
2378
    </tr>
2379
  </table>
2380
2381
2382
  <h3><a id="store_machine">store_machine / restore_machine</a></h3>
2383
2384
  <p>These are low-level commands, used to implement savestates.</p>
2385
2386
  <h4><code>store_machine</code>:</h4>
2387
  <p>Saves the state of the specified machine to a file.</p>
2388
2389
  <table>
2390
    <tr>
2391
      <td><code>store_machine &lt;machineID&gt; &lt;filename&gt;</code></td>
2392
      <td>Save state of indicated machine to specified file</td>
2393
    </tr>
2394
  </table>
2395
2396
  <h4><code>restore_machine</code>:</h4>
2397
  <p>Load a previously saved machine in a new machine-ID, next to the already available machines. See the section on <code><a class="internal" href="#machines">activate_machine</a></code>.</p>
2398
2399
  <table>
2400
    <tr>
2401
      <td><code>restore_machine</code></td>
2402
      <td>Load state from last saved state in default directory</td>
2403
    </tr>
2404
    <tr>
2405
      <td><code>restore_machine &lt;filename&gt;</code></td>
2406
      <td>Load state from indicated file</td>
2407
    </tr>
2408
  </table>
2409
2410
  <div class="note">
2411
    Note: These commands are pretty low level. The <code><a class="internal" href="#savestate">savestate</a></code> and <code><a class="internal" href="#savestate">loadstate</a></code> scripts are built on top of this and are much more convenient to use.
2412
  </div>
2413
2414
2415
  <h3><a id="store_setup">store_setup</a></h3>
2416
2417
  <p>Store the current setup in a file.</p>
2418
2419
  <table>
2420
    <tr>
2421
      <td><code>store_setup [depth] &lt;filename&gt;</code></td>
2422
      <td>Save the setup with the given depth to specified file</td>
2423
    </tr>
2424
  </table>
2425
2426
  <p>If the filename isn't specified, openMSX creates a unique one for you, based on the name of the machine. The depth argument is mandatory and must be one of the following.</p>
2427
2428
  <dl>
2429
    <dt><code>machine</code></dt>
2430
    <dd>Save only the machine. This isn't too useful... but you can use it to give your favourite machine your own setup name</dd>
2431
    <dt><code>extensions</code></dt>
2432
    <dd>Save the machine with all plugged in extensions</dd>
2433
    <dt><code>connectors</code></dt>
2434
    <dd>As previous, but also include plugged in equipment in its connectors</dd>
2435
    <dt><code>media</code></dt>
2436
    <dd>As previous, but also include inserted media in its media slots</dd>
2437
    <dt><code>complete_state</code></dt>
2438
    <dd>As previous, but also include the run time state. This is basically identical to a savestate</dd>
2439
  </dl>
2440
2441
  <p>Storing the current setup can also be done with the GUI via <span class="menu-reference">Main menu bar
2442
&rarr; Machine &rarr; Save setup</span>.</p>
2443
2444
2445
  <h3><a id="test_machine">test_machine / test_all_machines / test_all_extensions</a></h3>
2446
2447
  <p>Test whether the given MSX machine configuration works. For example whether you have all required system ROMs for this machine. See also <code><a class="internal" href="#machines">load_machine</a></code>. This is an alternative to using the equivalent option in the GUI <span class="menu-reference">Main menu bar
2448
&rarr; Machine &rarr; Test MSX hardware</span></p>
2449
2450
  <div class="subsectiontitle">
2451
    usage:
2452
  </div>
2453
  <table>
2454
    <tr>
2455
      <td><code>test_machine &lt;machine-config&gt;</code></td>
2456
      <td>Test whether the given machine configuration is OK.</td>
2457
    </tr>
2458
  </table>
2459
2460
  <p>Use the convenience commands <code>test_all_machines</code> and <code>test_all_extensions</code> to get a full overview on which system ROMs you are still missing.</p>
2461
2462
2463
  <h3><a id="toggle">toggle</a></h3>
2464
2465
  <p>Toggles any boolean (on/off) setting: if it was on, it will be turned off and vice versa.
2466
  See also: <code><a class="internal" href="#cycle">cycle</a></code>.</p>
2467
2468
  <div class="subsectiontitle">
2469
    usage:
2470
  </div>
2471
2472
  <table>
2473
    <tr>
2474
      <td><code>toggle &lt;setting&gt;</code></td>
2475
2476
      <td>Toggles the specified setting</td>
2477
    </tr>
2478
  </table>
2479
2480
  <div class="subsectiontitle">
2481
    examples:
2482
  </div>
2483
2484
  <div class="examples">
2485
    <code>toggle mute</code><br />
2486
    <code>toggle throttle</code>
2487
  </div>
2488
2489
2490
  <h3><a id="trainer">trainer</a></h3>
2491
2492
  <p>Control game trainers. You can enable or disable individual cheats of each trainer. Make use of the TAB key to see
2493
  what is available. When switching trainers, the currently active trainer will be deactivated.</p>
2494
2495
  <div class="subsectiontitle">
2496
    usage:
2497
  </div>
2498
2499
  <table>
2500
    <tr>
2501
      <td><code>trainer</code></td>
2502
2503
      <td>See which trainer is currently active</td>
2504
    </tr>
2505
2506
    <tr>
2507
      <td><code>trainer &lt;game&gt;</code></td>
2508
2509
      <td>See which cheats are currently active in the trainer</td>
2510
    </tr>
2511
2512
    <tr>
2513
      <td><code>trainer &lt;game&gt; all</code></td>
2514
2515
      <td>Activate all cheats in the trainer of &lt;game&gt;</td>
2516
    </tr>
2517
2518
    <tr>
2519
      <td><code>trainer &lt;game&gt; [&lt;cheat&gt; ..]</code></td>
2520
2521
      <td>Toggle cheats of &lt;game&gt; on/off</td>
2522
    </tr>
2523
2524
    <tr>
2525
      <td><code>trainer deactivate</code></td>
2526
2527
      <td>Deactivate all trainers</td>
2528
    </tr>
2529
  </table>
2530
2531
  <div class="subsectiontitle">
2532
    examples:
2533
  </div>
2534
2535
  <div class="examples">
2536
    <code>trainer Frogger all</code><br />
2537
    <code>trainer "Circus Charlie" 1 2</code><br />
2538
    <code>trainer Pippols lives "jump shoes"</code>
2539
  </div>
2540
2541
2542
  <h3><a id="type">type / type_via_keyboard</a></h3>
2543
2544
  <p>Type a string in the emulated MSX. This command automatically presses and
2545
  releases keys in the simulated MSX keyboard matrix. This command is useful
2546
  for demoing and for automating tasks in MSX-BASIC.</p>
2547
2548
  <p>The command has a <code>-release</code> option, with which you can specify
2549
  that keys are always released before new ones are pressed. Some game input
2550
  routines need this, but it also makes typing twice as slow.</p>
2551
2552
  <p>With the <code>-freq</code> option, you can tweak how fast typing goes and
2553
  how long the keys will be pressed (and released if the <code>-release</code>
2554
  option is used). Keys will be typed at the given frequency and will remain
2555
  pressed/released for 1/freq seconds.</p>
2556
2557
  <p>With the <code>-cancel</code> option, you can cancel a (long) in progress
2558
  type command.</p>
2559
2560
  <p>This command should always work, because it is just like as if a user was
2561
  actually typing on the MSX keyboard. It is therefore a bit slow, though.
2562
  Check out the <code>type_via_keybuf</code> command if you're looking for
2563
  something faster (but more limited in where it works). With the
2564
  <code>default_type_proc</code> setting you can even make
2565
  <code>type_via_keybuf</code> the standard implementation for the
2566
  <code>type</code> command. Only do this if you really know what you're
2567
  doing!</p>
2568
2569
  <div class="subsectiontitle">
2570
    usage:
2571
  </div>
2572
2573
  <table>
2574
    <tr>
2575
      <td><code>type "Hello world!"</code></td>
2576
      <td>Yet another manifestation of the most famous program</td>
2577
    </tr>
2578
    <tr>
2579
      <td><code>type "PRINT \"Hi!\"\r"</code></td>
2580
      <td>Executes this basic command directly</td>
2581
    </tr>
2582
  </table>
2583
2584
  <p>There are also a few scripts extending this command:</p>
2585
2586
  <table>
2587
    <tr>
2588
      <td><code>type_from_file</code></td>
2589
2590
      <td>With this command you can automatically type text which is stored in
2591
      the given (text) file. Mostly useful if you want to type in some
2592
      BASIC program fragment that you found somewhere and pasted in a
2593
      text file.
2594
      </td>
2595
    </tr>
2596
    <tr>
2597
      <td><code>type_password_from_file</code></td>
2598
2599
      <td>A special version of <code>type_from_file</code>, made to type in
2600
      passwords of games, which you have stored in a file. The text
2601
      file should have a special format: one password per line, lines
2602
      starting with # are ignored. After the filename, you can give the
2603
      index of the password to type (which is the index of the first
2604
      non-comment and non-blank line in the file).
2605
      </td>
2606
    </tr>
2607
  </table>
2608
2609
2610
  <h3><a id="unicode2msxcode">unicode2msxcode</a></h3>
2611
2612
  <p>Returns an MSX string, i.e. a string based on MSX character codes, converted from a unicode string.</p>
2613
2614
  <p>The optional fallback used for each character that cannot be mapped for the current MSX model can be:</p>
2615
  <ul>
2616
    <li>omitted: then space will be used as fallback character.</li>
2617
    <li>an integer number: then this number will be used as MSX character number to to be the fallback character.</li>
2618
    <li>a Tcl proc, which expects one input character and must return one MSX character number.</li>
2619
  </ul>
2620
2621
  <div class="subsectiontitle">
2622
    usage:
2623
  </div>
2624
  <table>
2625
    <tr>
2626
      <td><code>unicode2msxcode &lt;unicode-string&gt; [&lt;fallback&gt;]</code></td>
2627
    </tr>
2628
  </table>
2629
  <div class="subsectiontitle">
2630
    examples:
2631
  </div>
2632
  <div class="examples">
2633
    <table>
2634
      <tr>
2635
        <td><code>unicode2msxcode [format %c 0x263a]</code></td>
2636
        <td>Prints MSX code for a smiley face if emulating an 'international' MSX model</td>
2637
      </tr>
2638
    </table>
2639
  </div>
2640
2641
2642
  <h3><a id="unset">unset</a></h3>
2643
2644
  <p>Undefines a Tcl variable. When used on openMSX settings, they are reverted to their default value. See also: <code><a class="internal" href="#set">set</a></code>.</p>
2645
2646
  <div class="subsectiontitle">
2647
    usage:
2648
  </div>
2649
2650
  <table>
2651
    <tr>
2652
      <td><code>unset &lt;variable&gt;</code></td>
2653
2654
      <td>Undefines the given variable</td>
2655
    </tr>
2656
2657
    <tr>
2658
      <td><code>unset &lt;setting&gt;</code></td>
2659
2660
      <td>Reverts the given setting to its default value</td>
2661
    </tr>
2662
  </table>
2663
2664
2665
  <h3><a id="user_setting">user_setting</a></h3>
2666
2667
  <p>This command is only meant to be used in Tcl scripts. It allows to create Tcl variables that act very much like built-in openMSX settings. They have a description (can be queried with "<code>help set &lt;setting-name&gt;</code>") and their value is stored saved/restored when openMSX is quit/restarted.</p>
2668
2669
  <!-- do we really have to repeat the help text from the openmsx source code here? -->
2670
2671
  <p>Execute "<code>help user_setting</code>" to get a detailed description of this command.</p>
2672
2673
2674
  <h3><a id="vdpregs">vdpregs</a></h3>
2675
2676
  <p>Shows the current register settings of the Video Display Processor (VDP). Related command: <code><a class="internal" href="#palette">palette</a></code>.</p>
2677
2678
  <div class="subsectiontitle">
2679
    usage:
2680
  </div>
2681
2682
  <table>
2683
    <tr>
2684
      <td><code>vdpregs</code></td>
2685
2686
      <td>Shows the current VDP control register contents</td>
2687
    </tr>
2688
  </table>
2689
2690
2691
  <h3><a id="other">other</a></h3>
2692
2693
  <p>Most commands described above are generally useful. openMSX also has a bunch of other more specialized commands. Some of these are intended for programmers who code MSX programs using openMSX as a tool. Other of these commands are more like toys or examples that show the openMSX scripting capabilities.</p>
2694
2695
  <p>We've only listed a very brief overview of these commands. As always execute "<code>help &lt;command-name&gt;</code>" to get a more detailed description of the command.</p>
2696
2697
  <table>
2698
    <tr>
2699
      <td><code>about</code></td>
2700
      <td>Searches command and setting help-texts for the given keyword</td>
2701
    </tr>
2702
    <tr>
2703
      <td><code>address_in_slot</code></td>
2704
      <td>Tests whether an address is inside a certain slot</td>
2705
    </tr>
2706
    <tr>
2707
      <td><code>cpuregs</code></td>
2708
      <td>Gives an overview of the CPU registers</td>
2709
    </tr>
2710
    <tr>
2711
      <td><code>data_file</code></td>
2712
      <td>Helps locate openMSX data files</td>
2713
    </tr>
2714
    <tr>
2715
      <td><code>disasm</code></td>
2716
      <td>Prints disassembled instructions at the given memory location</td>
2717
    </tr>
2718
    <tr>
2719
      <td><code>getcolor</code></td>
2720
      <td>Queries V99x8 palette settings</td>
2721
    </tr>
2722
    <tr>
2723
      <td><code>get_active_cpu</code></td>
2724
      <td>Returns the active cpu, z80 or r800</td>
2725
    </tr>
2726
    <tr>
2727
      <td><code>get_breakponts_dir</code></td>
2728
      <td>Returns breakpoints directory for this user</td>
2729
    </tr>
2730
    <tr>
2731
      <td><code>get_color_count</code></td>
2732
      <td>Gives an overview of the used colors in the current screen</td>
2733
    </tr>
2734
    <tr>
2735
      <td><code>get_mapper_size</code></td>
2736
      <td>Returns the size of the memory mapper in a given slot or 0 when there is no memory mapper in the slot</td>
2737
    </tr>
2738
    <tr>
2739
      <td><code>get_screen</code></td>
2740
      <td>Captures the content of an MSX text screen in a Tcl string</td>
2741
    </tr>
2742
    <tr>
2743
      <td><code>get_screen_mode</code></td>
2744
      <td>Decodes the current screen mode from the VDP registers and returns it as a Tcl string. <code>get_screen_mode_number</code> returns it as a number which would also be used for the basic command <code>SCREEN</code>.</td>
2745
    </tr>
2746
    <tr>
2747
      <td><code>get_selected_slot</code></td>
2748
      <td>Returns the selected slot for the given memory page</td>
2749
    </tr>
2750
    <tr>
2751
      <td><code>guess_title</code></td>
2752
      <td>Uses heuristics to guess the title of the current game (cartridge, disk or tape). For specific media use <code>guess_cassette_title</code>, <code>guess_disk_title</code> or <code>guess_rom_title</code>.</td>
2753
    </tr>
2754
    <tr>
2755
      <td><code>listing</code></td>
2756
      <td>Reimplementation of the BASIC LIST command in Tcl</td>
2757
    </tr>
2758
    <tr>
2759
      <td><code>load_debuggable</code></td>
2760
      <td>Writes the content of a file to a openMSX debuggable</td>
2761
    </tr>
2762
    <tr>
2763
      <td><code>load_breakpoints</code></td>
2764
      <td>Loads all breakpoint subtypes (breakpoints, watchpoints and conditions) from a given file</td>
2765
    </tr>
2766
    <tr>
2767
      <td><code>multi_screenshot</code></td>
2768
      <td>Takes screenshots of multiple successive frames</td>
2769
    </tr>
2770
    <tr>
2771
      <td><code>next_frame</code></td>
2772
      <td>Emulates until the (start of) the next frame, then pause emulation</td>
2773
    </tr>
2774
    <tr>
2775
      <td><code>prev_frame</code></td>
2776
      <td>Rewinds to the (start of) the previous frame</td>
2777
    </tr>
2778
    <tr>
2779
      <td><code>pc_in_slot</code></td>
2780
      <td>Checks whether CPU is executing from the specified slot (useful as breakpoint condition)</td>
2781
    </tr>
2782
    <tr>
2783
      <td><code>peek</code></td>
2784
      <td>Reads a byte from the given memory location</td>
2785
    </tr>
2786
    <tr>
2787
      <td><code>peek16</code></td>
2788
      <td>Reads a 16 bit word from the given memory location</td>
2789
    </tr>
2790
    <tr>
2791
      <td><code>peek16_BE</code></td>
2792
      <td>Reads a 16 bit word (big endian) from the given memory location</td>
2793
    </tr>
2794
    <tr>
2795
      <td><code>peek16_LE</code></td>
2796
      <td>Reads a 16 bit word (little endian) from the given memory location</td>
2797
    </tr>
2798
    <tr>
2799
      <td><code>peek8</code></td>
2800
      <td>Reads a byte from the given memory location</td>
2801
    </tr>
2802
    <tr>
2803
      <td><code>peek_s16</code></td>
2804
      <td>Reads a signed 16 bit word from the given memory location</td>
2805
    </tr>
2806
    <tr>
2807
      <td><code>peek_s16_BE</code></td>
2808
      <td>Reads a signed 16 bit word (big endian) from the given memory location</td>
2809
    </tr>
2810
    <tr>
2811
      <td><code>peek_s16_LE</code></td>
2812
      <td>Reads a signed 16 bit word (little endian) from the given memory location</td>
2813
    </tr>
2814
    <tr>
2815
      <td><code>peek_s8</code></td>
2816
      <td>Reads a signed byte from the given memory location</td>
2817
    </tr>
2818
    <tr>
2819
      <td><code>peek_u16</code></td>
2820
      <td>Reads an unsigned 16 bit word from the given memory location</td>
2821
    </tr>
2822
    <tr>
2823
      <td><code>peek_u16_BE</code></td>
2824
      <td>Reads an unsigned 16 bit word (big endian) from the given memory location</td>
2825
    </tr>
2826
    <tr>
2827
      <td><code>peek_u16_LE</code></td>
2828
      <td>Reads an unsigned 16 bit word (little endian) from the given memory location</td>
2829
    </tr>
2830
    <tr>
2831
      <td><code>peek_u8</code></td>
2832
      <td>Reads an unsigned byte from the given memory location</td>
2833
    </tr>
2834
    <tr>
2835
      <td><code>poke</code></td>
2836
      <td>Writes a byte to the given memory location. Use <code>dpoke</code> to only write if the value to be written is different from the current value.</td>
2837
    </tr>
2838
    <tr>
2839
      <td><code>poke16</code></td>
2840
      <td>Writes a 16 bit word to the given memory location</td>
2841
    </tr>
2842
    <tr>
2843
      <td><code>psg_log</code></td>
2844
      <td>Logs or replays PSG register values in binary format</td>
2845
    </tr>
2846
    <tr>
2847
      <td><code>ram_watch</code></td>
2848
      <td>Adds or removes RAM watch addresses to/from the list on the right side of the screen, useful for debugging or tool assisted speedrunning (TAS)</td>
2849
    </tr>
2850
    <tr>
2851
      <td><code>reg</code></td>
2852
      <td>Reads or writes CPU registers</td>
2853
    </tr>
2854
    <tr>
2855
      <td><code>reg_log</code></td>
2856
      <td>Logs or replays register values for the specified debuggable in ASCII format</td>
2857
    </tr>
2858
    <tr>
2859
      <td><code>reverse_bookmarks</code></td>
2860
      <td>Controls the reverse bookmarks functionality</td>
2861
    </tr>
2862
    <tr>
2863
      <td><code>rom_info</code></td>
2864
      <td>Gives information about the given ROM device, coming from the software database. If no argument is given, the first found (external) ROM device is assumed. This command replaces the info that was previously (before openMSX 0.8.1) automatically printed on stdout.</td>
2865
    </tr>
2866
    <tr>
2867
      <td><code>run_to</code></td>
2868
      <td>Executes instructions until the PC reaches the specified address</td>
2869
    </tr>
2870
    <tr>
2871
      <td><code>save_breakpoints</code></td>
2872
      <td>Saves all breakpoints subtypes (breakpoints, watchpoints, conditions) to a given file</td>
2873
    </tr>
2874
    <tr>
2875
      <td><code>save_debuggable</code></td>
2876
      <td>Saves the (partial) content of a debuggable to a file</td>
2877
    </tr>
2878
    <tr>
2879
      <td><code>save_msx_screen</code></td>
2880
      <td>Saves the current MSX screen into an MSX compatible binary file (BLOAD format).</td>
2881
    </tr>
2882
    <tr>
2883
      <td><code>save_to_file</code></td>
2884
      <td>Helper function to save data (e.g. the output of another command) to a file.</td>
2885
    </tr>
2886
    <tr>
2887
      <td><code>setcolor</code></td>
2888
      <td>Changes V99x8 palette settings</td>
2889
    </tr>
2890
    <tr>
2891
      <td><code>set_help_proc</code></td>
2892
      <td>Associates help text with a Tcl proc</td>
2893
    </tr>
2894
    <tr>
2895
      <td><code>set_help_text</code></td>
2896
      <td>Associates help text with a Tcl proc</td>
2897
    </tr>
2898
    <tr>
2899
      <td><code>set_tabcompletion_proc</code></td>
2900
      <td>Associates tab completion with a Tcl proc</td>
2901
    </tr>
2902
    <tr>
2903
      <td><code>showdebuggable</code></td>
2904
      <td>Prints the content of a debuggable in a table</td>
2905
    </tr>
2906
    <tr>
2907
      <td><code>showmem</code></td>
2908
      <td>Prints the content of memory in a table</td>
2909
    </tr>
2910
    <tr>
2911
      <td><code>show_osd</code></td>
2912
      <td>Prints an overview of the defined OSD elements</td>
2913
    </tr>
2914
    <tr>
2915
      <td><code>shuffler</code></td>
2916
      <td>A basic ROM-game shuffler, that switches between a set of ROM programs in a given folder after a certain time is passed.</td>
2917
    </tr>
2918
    <tr>
2919
      <td><code>skip_instruction</code></td>
2920
      <td>Skips the current CPU instruction</td>
2921
    </tr>
2922
    <tr>
2923
      <td><code>stack</code></td>
2924
      <td>Prints the top of the CPU stack</td>
2925
    </tr>
2926
    <tr>
2927
      <td><code>start_of_frame</code></td>
2928
      <td>Rewinds to the start of the current frame</td>
2929
    </tr>
2930
    <tr>
2931
      <td><code>step</code></td>
2932
      <td>Same as step_in</td>
2933
    </tr>
2934
    <tr>
2935
      <td><code>step_in</code></td>
2936
      <td>Executes one CPU instruction, go into subroutines</td>
2937
    </tr>
2938
    <tr>
2939
      <td><code>step_over</code></td>
2940
      <td>Executes one CPU instruction, but don't go into subroutines</td>
2941
    </tr>
2942
    <tr>
2943
      <td><code>step_out</code></td>
2944
      <td>Steps out of the current subroutine</td>
2945
    </tr>
2946
    <tr>
2947
      <td><code>step_back</code></td>
2948
      <td>Steps one instruction back in time</td>
2949
    </tr>
2950
    <tr>
2951
      <td><code>text_echo</code></td>
2952
      <td>Echoes all printed MSX text on stderr</td>
2953
    </tr>
2954
    <tr>
2955
      <td><code>toggle_breaked</code></td>
2956
      <td>Toggles breaked status</td>
2957
    </tr>
2958
    <tr>
2959
      <td><code>toggle_cursors</code></td>
2960
      <td>Shows (or hides) a widget which shows which keys are pressed</td>
2961
    </tr>
2962
    <tr>
2963
      <td><code>toggle_frame_counter</code></td>
2964
      <td>Shows (or hides) a widget which shows the current frame number since start-up</td>
2965
    </tr>
2966
    <tr>
2967
      <td><code>toggle_freq</code></td>
2968
      <td>Switches between PAL/NTSC</td>
2969
    </tr>
2970
    <tr>
2971
      <td><code>toggle_metal_gear_overlay</code></td>
2972
      <td>Shows OSD widgets that help you play Metal Gear</td>
2973
    </tr>
2974
    <tr>
2975
      <td><code>toggle_mog_editor</code></td>
2976
      <td>Enables (or disables) wall drawing and Popolon-placement with the mouse when playing The Maze of Galious; needs to have the MoG overlay enabled, see <code>toggle_mog_overlay</code></td>
2977
    </tr>
2978
    <tr>
2979
      <td><code>toggle_mog_overlay</code></td>
2980
      <td>Enables (or disables) graphical extra information and game hints when playing The Maze of Galious</td>
2981
    </tr>
2982
    <tr>
2983
      <td><code>toggle_movie_length_display</code></td>
2984
      <td>Toggles display of the movie length in the upper right corner</td>
2985
    </tr>
2986
    <tr>
2987
      <td><code>toggle_music_keyboard</code></td>
2988
      <td>Enables (or disables) keyboard view of all existing music channels. EXPERIMENTAL! Be careful, it's very slow when many channels are present in the system</td>
2989
    </tr>
2990
    <tr>
2991
      <td><code>toggle_nemesis_1_shield</code></td>
2992
      <td>Enables (or disables) an OSD drawn shield in Nemesis (Gradius) 1, all enemy objects will repel from it</td>
2993
    </tr>
2994
    <tr>
2995
      <td><code>toggle_psg2scc</code></td>
2996
      <td>Enables (or disables) playing PSG sound on SCC</td>
2997
    </tr>
2998
    <tr>
2999
      <td><code>toggle_scc_editor</code></td>
3000
      <td>Shows a graphical view of the SCC chip(s) of the system, showing waveforms and volume per channel and also enables you to edit the waveforms per channel</td>
3001
    </tr>
3002
    <tr>
3003
      <td><code>toggle_scc_viewer</code></td>
3004
      <td>Shows a graphical view of the SCC chip(s) of the system, showing
3005
          waveforms and volume per channel. In the future, this will be fully
3006
          replaced by <span class="menu-reference">Main menu bar &rarr; Tools
3007
          &rarr; SCC viewer</span>.
3008
      </td>
3009
    </tr>
3010
    <tr>
3011
      <td><code>toggle_tron</code></td>
3012
      <td>Shows (or hides) an OSD implementation of the MSX-BASIC TRON command to trace what the current line number of the BASIC interpreter is</td>
3013
    </tr>
3014
    <tr>
3015
      <td><code>toggle_vdp_access_test</code></td>
3016
      <td>Enables (or disables) reporting in the console when VDP I/O is done which could possibly cause data corruption on the slowest VDP (TMS9xxx), which is not emulated</td>
3017
    </tr>
3018
    <tr>
3019
      <td><code>toggle_vdp_busy</code></td>
3020
      <td>Enables (or disables) display on the OSD of how busy the VDP is</td>
3021
    </tr>
3022
    <tr>
3023
      <td><code>type_via_keybuf</code></td>
3024
      <td>Alternative to the <code>type_via_keyboard</code> (the default <code><a class="internal" href="#type">type</a></code> command), that uses the keyboard buffer; only works if the running software uses the standard keyboard buffer functions to get keyboard input, but is much faster</td>
3025
    </tr>
3026
    <tr>
3027
      <td><code>umrcallback</code></td>
3028
      <td>Example proc to use with the umr_callback setting</td>
3029
    </tr>
3030
    <tr>
3031
      <td><code>vdpcmdinprogresscallback</code></td>
3032
      <td>Example proc to use with the vdpcmdinprogress_callback setting</td>
3033
    </tr>
3034
    <tr>
3035
      <td><code>v9990reg</code></td>
3036
      <td>Reads or writes a V9990 register</td>
3037
    </tr>
3038
    <tr>
3039
      <td><code>v9990regs</code></td>
3040
      <td>Prints an overview of all V9990 registers</td>
3041
    </tr>
3042
    <tr>
3043
      <td><code>vdpreg</code></td>
3044
      <td>Reads or writes a V99x8 register</td>
3045
    </tr>
3046
    <tr>
3047
      <td><code>vdpstatus</code></td>
3048
      <td>Shortcut for reading the VDP status registers</td>
3049
    </tr>
3050
    <tr>
3051
      <td><code>vdpvramaddress</code></td>
3052
      <td>Gives the current VDP VRAM pointer</td>
3053
    </tr>
3054
    <tr>
3055
      <td><code>vdrive</code></td>
3056
      <td>Easily switch disks in multi-disk games</td>
3057
    </tr>
3058
    <tr>
3059
      <td><code>vgm_rec</code></td>
3060
      <td>Records the music played by PSG, MSX-MUSIC, MSX-AUDIO, OPL4 and SCC into a VGM file</td>
3061
    </tr>
3062
    <tr>
3063
      <td><code>vpeek/vpoke</code></td>
3064
      <td>Reads/writes bytes from/to video RAM</td>
3065
    </tr>
3066
  </table>
3067
3068
  <p>The source code of all these scripts is located in <code>share/scripts</code> directory. Feel free to inspect these scripts and modify them to suit your needs.</p>
3069
3070
  <h2><a id="settings">Settings</a></h2>
3071
3072
  <p>Settings control many aspects of openMSX. Below, the available settings are listed and described. You can change setting values with the <code><a class="internal" href="#set">set</a></code> command.</p>
3073
3074
3075
  <h3><a id="accuracy">accuracy</a></h3>
3076
3077
  <p>Sets the render accuracy. openMSX supports three levels of render accuracy:</p>
3078
3079
  <dl>
3080
    <dt>screen accurate:</dt>
3081
    <dd>Changes in VDP state become effective only once per video frame. Works well for most MSX1 software, but will break a lot of MSX2 software (anything that does so-called raster effects).</dd>
3082
3083
    <dt>line accurate:</dt>
3084
    <dd>Changes in VDP state become effective only once per display line. Works well for almost all software.</dd>
3085
3086
    <dt>pixel accurate:</dt>
3087
    <dd>Changes in VDP state become effective immediately. In this mode even the 'Unknown Reality scope part' is rendered correctly.</dd>
3088
  </dl>
3089
3090
  <p>In some cases switching to a lower accuracy level can speed up emulation, but in many cases the speed difference is negligible.</p>
3091
3092
  <p>The default is pixel accuracy, since this is the most realistic. If the software you are running shows a jittery screen split and you would prefer a stable screen split, switching to line accuracy can help.</p>
3093
3094
  <div class="subsectiontitle">
3095
    usage:
3096
  </div>
3097
3098
  <table>
3099
    <tr>
3100
      <td><code>set accuracy</code></td>
3101
3102
      <td>Shows the current setting</td>
3103
    </tr>
3104
3105
    <tr>
3106
      <td><code>set accuracy screen</code></td>
3107
3108
      <td>Selects screen accurate rendering</td>
3109
    </tr>
3110
3111
    <tr>
3112
      <td><code>set accuracy line</code></td>
3113
3114
      <td>Selects line accurate rendering</td>
3115
    </tr>
3116
3117
    <tr>
3118
      <td><code>set accuracy pixel</code></td>
3119
3120
      <td>Selects pixel accurate rendering</td>
3121
    </tr>
3122
  </table>
3123
3124
3125
  <h3><a id="audio-inputfilename">audio-inputfilename</a></h3>
3126
3127
  <p>Sets the audio file from which the wave input is read for the sampler.</p>
3128
3129
  <p>By default, it is read from "audio-input.wav" when available.</p>
3130
3131
  <div class="subsectiontitle">
3132
    usage:
3133
  </div>
3134
3135
  <table>
3136
    <tr>
3137
      <td><code>set audio-inputfilename</code></td>
3138
3139
      <td>Shows the current setting</td>
3140
    </tr>
3141
3142
    <tr>
3143
      <td><code>set audio-inputfilename mysample.wav</code></td>
3144
3145
      <td>Read from "mysample.wav"</td>
3146
    </tr>
3147
  </table>
3148
3149
  <div class="note">
3150
    Note: The file is fully read into memory, so under Linux/UNIX do not attempt to read from a device node such as <code>/dev/dsp</code>.
3151
  </div>
3152
3153
3154
  <h3><a id="autoruncassettes">autoruncassettes</a></h3>
3155
3156
  <p>Switches the "auto-run cassettes" feature on or off. When it's enabled, openMSX will try to type the proper loading
3157
  instruction when a cassette is inserted.</p>
3158
3159
  <div class="subsectiontitle">
3160
    usage:
3161
  </div>
3162
3163
  <table>
3164
    <tr>
3165
      <td><code>set autoruncassettes</code></td>
3166
3167
      <td>Shows the current setting</td>
3168
    </tr>
3169
3170
    <tr>
3171
      <td><code>set autoruncassettes on</code></td>
3172
3173
      <td>Try to run cassettes automatically</td>
3174
    </tr>
3175
3176
    <tr>
3177
      <td><code>set autoruncassettes off</code></td>
3178
3179
      <td>Do nothing when cassettes are inserted</td>
3180
    </tr>
3181
  </table>
3182
3183
  <div class="note">
3184
    Note: Autorun works practically always for cassette images in the CAS and TSX formats. If that fails or for WAV files, openMSX will try to find a hint of the loading instruction (in upper case) in the filename.
3185
  </div>
3186
3187
3188
  <h3><a id="autorunlaserdisc">autorunlaserdisc</a></h3>
3189
3190
  <p>Switches the "auto-run laserdisc" feature on or off. When it's enabled, openMSX will try to type the proper loading
3191
  instruction when a laserdisc is inserted.</p>
3192
3193
  <p>Note that this setting is only available when the Pioneer PX-7 or Pioneer PX-V60 MSX machine is being emulated, and only when openMSX was built with Laserdisc support (Laserdisc support is an optional compile-time feature).</p>
3194
3195
  <div class="subsectiontitle">
3196
    usage:
3197
  </div>
3198
3199
  <table>
3200
    <tr>
3201
      <td><code>set autorunlaserdisc</code></td>
3202
3203
      <td>Shows the current setting</td>
3204
    </tr>
3205
3206
    <tr>
3207
      <td><code>set autorunlaserdisc on</code></td>
3208
3209
      <td>Try to load Laserdiscs automatically</td>
3210
    </tr>
3211
3212
    <tr>
3213
      <td><code>set autorunlaserdisc off</code></td>
3214
3215
      <td>Do nothing when Laserdiscs are inserted</td>
3216
    </tr>
3217
  </table>
3218
3219
3220
  <h3><a id="auto_enable_reverse">auto_enable_reverse</a></h3>
3221
3222
  <p>Using the <code><a class="internal" href="#reverse">reverse</a></code> feature comes at a small memory and performance cost. Therefore it has to be enabled before it can be used. This setting controls whether the reverse feature should automatically be activated when openMSX starts. While with desktop computers this generally won't be a problem, the performance drop might be more noticeable on older/smaller handheld devices.</p>
3223
3224
  <div class="subsectiontitle">
3225
    usage:
3226
  </div>
3227
3228
  <table>
3229
    <tr>
3230
      <td><code>set auto_enable_reverse</code></td>
3231
      <td>Shows the current setting</td>
3232
    </tr>
3233
    <tr>
3234
      <td><code>set auto_enable_reverse off</code></td>
3235
      <td>Don't automatically enable the reverse feature</td>
3236
    </tr>
3237
    <tr>
3238
      <td><code>set auto_enable_reverse on</code></td>
3239
      <td>Enable the reverse feature when openMSX starts. Default setting for Desktop/PC</td>
3240
    </tr>
3241
  </table>
3242
3243
3244
  <h3><a id="auto_save_replay">auto_save_replay</a></h3>
3245
3246
  <p>Enable this setting to make automatic backups of your current replay. The replay is saved to the filename specified in the <code>auto_save_replay_filename</code> setting (default: "auto_save") at an interval as specified by the <code>auto_save_replay_interval</code> setting (default: 30 seconds). The interval is in real clock time, not in MSX time.</p>
3247
3248
3249
  <h3><a id="blur">blur</a></h3>
3250
3251
  <p>Sets the amount of horizontal blur effect. A value of 0 turns off blur, while 100 selects maximum blur.</p>
3252
3253
  <div class="subsectiontitle">
3254
    usage:
3255
  </div>
3256
3257
  <table>
3258
    <tr>
3259
      <td><code>set blur</code></td>
3260
3261
      <td>Shows the current setting</td>
3262
    </tr>
3263
3264
    <tr>
3265
      <td><code>set blur &lt;value&gt;</code></td>
3266
3267
      <td>Change the value</td>
3268
    </tr>
3269
  </table>
3270
3271
  <div class="note">
3272
    Note: Only some <a class="internal" href="#scale_algorithm">scale algorithms</a> apply horizontal blur; the default algorithm "simple" does.
3273
  </div>
3274
3275
3276
  <h3><a id="bootsector">bootsector</a></h3>
3277
3278
  <p>Sets the boot sector type for DirAsDSK. Default: DOS2. Only relevant on turboR, because it boots differently
3279
  depending on the type of boot sector on the disk in drive A.</p>
3280
3281
  <div class="subsectiontitle">
3282
    usage:
3283
  </div>
3284
3285
  <table>
3286
    <tr>
3287
      <td><code>set bootsector</code></td>
3288
3289
      <td>Shows the current setting</td>
3290
    </tr>
3291
3292
    <tr>
3293
      <td><code>set bootsector DOS1</code></td>
3294
3295
      <td>Use a DOS1 boot sector</td>
3296
    </tr>
3297
  </table>
3298
3299
3300
  <h3><a id="brightness">brightness</a></h3>
3301
3302
  <p>Controls the brightness of the video output. Can be between -100 and 100. Lower values are darker, higher values are brighter. The default is 0, which is neutral. This setting shifts the brightness of all colours, including black and white, while the <code><a class="internal" href="#gamma">gamma</a></code> setting changes the relative brightness of colours but does not change black and white.</p>
3303
3304
  <p>The section about the <code><a class="internal" href="#noise">noise</a></code> setting describes a typical way of using <code>brightness</code>.</p>
3305
3306
  <div class="subsectiontitle">
3307
    usage:
3308
  </div>
3309
3310
  <table>
3311
    <tr>
3312
      <td><code>set brightness</code></td>
3313
3314
      <td>Shows the current setting</td>
3315
    </tr>
3316
3317
    <tr>
3318
      <td><code>set brightness 5</code></td>
3319
3320
      <td>Make the video output a bit brighter than default</td>
3321
    </tr>
3322
  </table>
3323
3324
3325
  <h3><a id="cmdtiming">cmdtiming</a></h3>
3326
3327
  <p>Controls VDP command execution timing.</p>
3328
3329
  <p>This is useful for debugging and for speeding up games where the command engine performance is a bottleneck.</p>
3330
3331
  <div class="subsectiontitle">
3332
    usage:
3333
  </div>
3334
3335
  <table>
3336
    <tr>
3337
      <td><code>set cmdtiming</code></td>
3338
3339
      <td>Shows the current setting</td>
3340
    </tr>
3341
3342
    <tr>
3343
      <td><code>set cmdtiming broken</code></td>
3344
3345
      <td>Make VDP commands finish instantly</td>
3346
    </tr>
3347
3348
    <tr>
3349
      <td><code>set cmdtiming real</code></td>
3350
3351
      <td>Make VDP commands take a realistic amount of time</td>
3352
    </tr>
3353
  </table>
3354
3355
  <div class="note">
3356
    Note: When set to <code>broken</code> the emulated MSX acts different from a real MSX. This might cause some software to fail.
3357
  </div>
3358
3359
3360
  <h3><a id="color_matrix">color_matrix</a></h3>
3361
3362
  <p>This setting represents a 3&times;3 matrix that is used to transform MSX RGB colours to host RGB colours. This setting can
3363
  be used to generate all kind of colour schemes, see <code>scripts/monitor.tcl</code> for examples.</p>
3364
3365
  <p>To get the following colour transformation:</p>
3366
  <pre>
3367
        | a b c |   | Rm |   | Rh |
3368
        | d e f | &times; | Gm | = | Gh |
3369
        | g h i |   | Bm |   | Bh |
3370
  </pre>
3371
  <p>Use this command:</p>
3372
  <pre>
3373
        set color_matrix { { a b c } { d e f } { g h i } }
3374
  </pre>
3375
3376
  <div class="subsectiontitle">
3377
    usage:
3378
  </div>
3379
3380
  <table>
3381
    <tr>
3382
      <td><code>set color_matrix</code></td>
3383
3384
      <td>Shows the current value</td>
3385
    </tr>
3386
3387
    <tr>
3388
      <td><code>set color_matrix { { 1 0 0 } { 0 1 0 } { 0 0 1 } }</code></td>
3389
3390
      <td>This is the default (no colour transformation)</td>
3391
    </tr>
3392
3393
    <tr>
3394
      <td><code>set color_matrix { { .33 .33 .33 } { .33 .33 .33 } { .33 .33 .33 } }</code></td>
3395
3396
      <td>Transform to grey scale</td>
3397
    </tr>
3398
  </table>
3399
3400
  <div class="note">
3401
    Note: It is often more convenient to use the <code><a class="internal" href="#monitor_type">monitor_type</a></code> command.
3402
  </div>
3403
3404
3405
  <h3><a id="console">console</a></h3>
3406
3407
  <p>Turns the openMSX on-screen console on or off.</p>
3408
3409
  <div class="subsectiontitle">
3410
    usage:
3411
  </div>
3412
3413
  <table>
3414
    <tr>
3415
      <td><code>set console</code></td>
3416
3417
      <td>Shows the current setting</td>
3418
    </tr>
3419
3420
    <tr>
3421
      <td><code>set console on</code></td>
3422
3423
      <td>Turns the console on</td>
3424
    </tr>
3425
3426
    <tr>
3427
      <td><code>set console off</code></td>
3428
3429
      <td>Turns the console off</td>
3430
    </tr>
3431
  </table>
3432
3433
3434
  <h3><a id="contrast">contrast</a></h3>
3435
3436
  <p>Controls the contrast of the video output. Can be between -100 and 100. Lower values are less contrast, higher values are more contrast. The default is 0, which is neutral.</p>
3437
3438
  <p>The section about the <code><a class="internal" href="#noise">noise</a></code> setting describes a typical way of using <code>contrast</code>.</p>
3439
3440
  <div class="subsectiontitle">
3441
    usage:
3442
  </div>
3443
3444
  <table>
3445
    <tr>
3446
      <td><code>set contrast</code></td>
3447
3448
      <td>Shows the current setting</td>
3449
    </tr>
3450
3451
    <tr>
3452
      <td><code>set contrast -5</code></td>
3453
3454
      <td>Reduce the video contrast a bit</td>
3455
    </tr>
3456
  </table>
3457
3458
3459
  <h3><a id="cputrace">cputrace</a></h3>
3460
3461
  <p>Enable/disable CPU instruction tracing. When enabled, the state of the CPU (Z80/R800) is printed on stdout after every instruction. This creates a lot of output and slows down emulation considerably, but it can be very useful for debugging.</p>
3462
3463
  <div class="subsectiontitle">
3464
    usage:
3465
  </div>
3466
3467
  <table>
3468
    <tr>
3469
      <td><code>set cputrace</code></td>
3470
3471
      <td>Shows the current setting</td>
3472
    </tr>
3473
3474
    <tr>
3475
      <td><code>set cputrace on</code></td>
3476
3477
      <td>Enables CPU tracing</td>
3478
    </tr>
3479
3480
    <tr>
3481
      <td><code>set cputrace off</code></td>
3482
3483
      <td>Disables CPU tracing</td>
3484
    </tr>
3485
  </table>
3486
3487
3488
  <h3><a id="debugoutput">Debug Device output</a></h3>
3489
3490
  <p>Selects the file to where the output from the debug device goes.</p>
3491
3492
  <p>The User's Manual <a class="external" href="user.html#debugdevice">describes the debug device</a> in more detail.</p>
3493
3494
  <div class="subsectiontitle">
3495
    usage:
3496
  </div>
3497
3498
  <table>
3499
    <tr>
3500
      <td><code>set {Debug Device output}</code></td>
3501
3502
      <td>Shows the current output file name</td>
3503
    </tr>
3504
3505
    <tr>
3506
      <td><code>set {Debug Device output} stdout</code></td>
3507
3508
      <td>Writes debug output to openMSX's standard output stream</td>
3509
    </tr>
3510
3511
    <tr>
3512
      <td><code>set {Debug Device output} stderr</code></td>
3513
3514
      <td>Writes debug output to openMSX's standard error stream</td>
3515
    </tr>
3516
3517
    <tr>
3518
      <td><code>set {Debug Device output} &lt;output file&gt;</code></td>
3519
3520
      <td>Writes debug output to the specified file</td>
3521
    </tr>
3522
  </table>
3523
3524
  <div class="note">
3525
    Note: This setting only exists if the <code>debugdevice</code> extension is present in the current MSX machine.
3526
  </div>
3527
3528
3529
  <h3><a id="default_machine">default_machine</a></h3>
3530
3531
  <p>Selects the default MSX model. openMSX uses this machine when it is started without the <code>-machine</code> option and without the <code>-setup</code> option and the <code><a class="internal" href="#default_setup">default_setup</a></code> setting is empty or pointing to a non-existing setup. This is a typical setting that should be saved, see also <a class="internal" href="#save_settings"><code>save_settings</code></a>.</p>
3532
3533
  <p>In the GUI, under <span class="menu-reference">Main menu bar &rarr; Machine
3534
  &rarr; Setup settings</span> you can also configure what openMSX must do at startup, configuring this setting there.</p>
3535
3536
  <div class="subsectiontitle">
3537
    usage:
3538
  </div>
3539
3540
  <table>
3541
    <tr>
3542
      <td><code>set default_machine</code></td>
3543
3544
      <td>Shows current setting</td>
3545
    </tr>
3546
3547
    <tr>
3548
      <td><code>set default_machine Panasonic_FS-A1GT</code></td>
3549
3550
      <td>Use the turboR GT the next time openMSX is started</td>
3551
    </tr>
3552
  </table>
3553
3554
3555
  <h3><a id="default_setup">default_setup</a></h3>
3556
3557
  <p>Selects the default setup. openMSX uses this setup when it is started without the <code>-setup</code> or <code>-machine</code> option. By default, this setting is empty, because no setups are shipped with openMSX: they have to be created by users, after which this setting can be set to automatically start that setup that got saved earlier. If it is indeed empty or pointing to a non-existing setup, the value for the <code><a class="internal" href="#default_machine">default_machine</a></code> setting is used to determine what to start.</p>
3558
3559
  <p>In the GUI, under <span class="menu-reference">Main menu bar &rarr; Machine
3560
  &rarr; Setup settings</span> you can also configure what openMSX must do at startup, configuring this setting there.</p>
3561
3562
  <div class="subsectiontitle">
3563
    usage:
3564
  </div>
3565
3566
  <table>
3567
    <tr>
3568
      <td><code>set default_setup</code></td>
3569
3570
      <td>Shows current setting</td>
3571
    </tr>
3572
3573
    <tr>
3574
      <td><code>set default_setup mymsx</code></td>
3575
3576
      <td>Use the <code>mymsx</code> setup the next time openMSX is started without specifying setup or machine</td>
3577
    </tr>
3578
  </table>
3579
3580
  <div class="note">
3581
    If you set this setting to the same value as the <code><a class="internal" href="#save_setup_at_exit_name">save_setup_at_exit_name</a></code> setting and have the <code><a class="internal" href="#save_setup_at_exit_depth">save_setup_at_exit_depth</a></code> setting set to another depth than <code>none</code> , openMSX will automatically continue with the last setup when being started up again (and no other machine or setup is specified).
3582
  </div>
3583
3584
3585
  <h3><a id="DirAsDSKmode">DirAsDSKmode</a></h3>
3586
3587
  <p>Determine the behaviour of the DirAsDSK when inserting a directory to be used as diskimage.</p>
3588
3589
  <p>The possible values are <code>read_only</code> and <code>full</code>. The default mode is <code>full</code>.</p>
3590
3591
  <table>
3592
    <tr>
3593
      <td><code>read_only</code></td>
3594
      <td>The MSX can not write to the virtual disk.<br/>Changes on the host-OS are still reflected on the virtual disk, however.</td>
3595
    </tr>
3596
    <tr>
3597
      <td><code>full</code></td>
3598
      <td>All changes are performed both ways, no restrictions apply.</td>
3599
    </tr>
3600
  </table>
3601
3602
  <div class="subsectiontitle">
3603
    usage:
3604
  </div>
3605
  <table>
3606
    <tr>
3607
      <td><code>set DirAsDSKmode</code></td>
3608
      <td>Shows the current setting</td>
3609
    </tr>
3610
    <tr>
3611
      <td><code>set DirAsDSKmode read_only</code></td>
3612
      <td>Disk image will be read only</td>
3613
    </tr>
3614
  </table>
3615
3616
  <div class="note">
3617
    Note: this setting is only used when the directory is inserted, it is not possible to change the behaviour of the current virtual disk by altering the setting. The new setting will become effective after the current virtual disk has been ejected.
3618
  </div>
3619
3620
3621
  <h3><a id="deflicker">deflicker</a></h3>
3622
3623
  <p>Turns deflicker on/off. deflicker is a filter which tries to detect pixels
3624
  that alternate each frame between two different colour values and replaces
3625
  those alternations with the average colour. It gives a very nice result for
3626
  software (mostly demos) that use this technique to get the optical illusion
3627
  of more colours than are actually supported by the hardware. It also works
3628
  well in games with flickering sprites on a static background (like Maze of
3629
  Galious). This setting is disabled by default because there aren't that many
3630
  situations where the performance cost justifies the improved video quality. </p>
3631
3632
  <div class="subsectiontitle">
3633
    usage:
3634
  </div>
3635
3636
  <table>
3637
    <tr>
3638
      <td><code>set deflicker</code></td>
3639
      <td>Shows the current setting</td>
3640
    </tr>
3641
3642
    <tr>
3643
      <td><code>set deflicker on</code></td>
3644
      <td>Turns deflicker on</td>
3645
    </tr>
3646
3647
    <tr>
3648
      <td><code>set deflicker off</code></td>
3649
      <td>Turns deflicker off</td>
3650
    </tr>
3651
  </table>
3652
3653
3654
  <h3><a id="deinterlace">deinterlace</a></h3>
3655
3656
  <p>Turns deinterlacing on/off. Deinterlace is a filter which combines the even and odd field of interlaced video into a single frame which has double vertical resolution. It results in a sharp and stable image, but can show artifacts on fast animations.</p>
3657
3658
  <div class="subsectiontitle">
3659
    usage:
3660
  </div>
3661
3662
  <table>
3663
    <tr>
3664
      <td><code>set deinterlace</code></td>
3665
      <td>Shows the current setting</td>
3666
    </tr>
3667
3668
    <tr>
3669
      <td><code>set deinterlace on</code></td>
3670
      <td>Turns deinterlacing on</td>
3671
    </tr>
3672
3673
    <tr>
3674
      <td><code>set deinterlace off</code></td>
3675
      <td>Turns deinterlacing off</td>
3676
    </tr>
3677
  </table>
3678
3679
3680
  <h3><a id="disablesprites">disablesprites</a></h3>
3681
3682
  <p>Can be used to disable sprite rendering. Only the rendering itself is
3683
     disabled, all other MSX behaviour (like sprite collision detection) stays
3684
     the same.</p>
3685
3686
  <div class="subsectiontitle">
3687
    usage:
3688
  </div>
3689
3690
  <table>
3691
    <tr>
3692
      <td><code>set disablesprites</code></td>
3693
      <td>Shows the current setting</td>
3694
    </tr>
3695
3696
    <tr>
3697
      <td><code>set disablesprites on</code></td>
3698
      <td>Disable sprite rendering</td>
3699
    </tr>
3700
3701
    <tr>
3702
      <td><code>set disablesprites off</code></td>
3703
      <td>Enable sprite rendering (the default)</td>
3704
    </tr>
3705
  </table>
3706
3707
3708
  <h3><a id="display_deform">display_deform</a></h3>
3709
3710
  <p>Select display deformation effect.</p>
3711
3712
  <div class="subsectiontitle">
3713
    usage:
3714
  </div>
3715
3716
  <table>
3717
    <tr>
3718
      <td><code>set display_deform</code></td>
3719
3720
      <td>Shows the current setting</td>
3721
    </tr>
3722
3723
    <tr>
3724
      <td><code>set display_deform normal</code></td>
3725
3726
      <td>Turns off display deform</td>
3727
    </tr>
3728
3729
    <tr>
3730
      <td><code>set display_deform 3d</code></td>
3731
3732
      <td>Deforms the image in 3D, to look like a CRT (like JEmu2)</td>
3733
    </tr>
3734
  </table>
3735
3736
  <div class="note">
3737
    Note: In the past there was also a 'horizontal_stretch' mode. This is now replaced by the <code><a class="internal" href="#horizontal_stretch">horizontal_stretch</a></code> setting.
3738
  </div>
3739
3740
3741
  <h3><a id="di_halt_callback">di_halt_callback</a></h3>
3742
3743
  <p>Selects the Tcl procedure to be called when the running MSX software has executed a HALT instruction while the interrupts are disabled (DI).</p>
3744
3745
  <p>The default openmsx startup scripts initialize this setting with a proc that prints a warning message.</p>
3746
3747
  <div class="subsectiontitle">
3748
    usage:
3749
  </div>
3750
  <table>
3751
    <tr>
3752
      <td><code>set di_halt_callback</code></td>
3753
      <td>Shows the current setting</td>
3754
    </tr>
3755
    <tr>
3756
      <td><code>set di_halt_callback my_callback_proc</code></td>
3757
      <td>Sets a new callback proc</td>
3758
    </tr>
3759
  </table>
3760
3761
3762
  <h3><a id="enable_session_management">enable_session_management</a></h3>
3763
3764
  <p>Controls session management. When enabled, openMSX will store the state of all machines when you exit openMSX and restore that state again when starting it up next time. Note that the reverse history is not saved.
3765
  </p>
3766
3767
  <p>Sessions can also be saved manually with the command <code>save_session</code>, and explicitly loaded with <code>load_session</code>. A list of saved sessions can be retrieved with <code>list_sessions</code>.
3768
  </p>
3769
3770
3771
  <h3><a id="fastforward">fastforward</a></h3>
3772
3773
  <p>Chooses between normal speed (off) and fastforward speed (on).</p>
3774
3775
  <div class="subsectiontitle">
3776
    usage:
3777
  </div>
3778
3779
  <table>
3780
    <tr>
3781
      <td><code>set fastforward</code></td>
3782
3783
      <td>Shows the current setting</td>
3784
    </tr>
3785
3786
    <tr>
3787
      <td><code>set fastforward on</code></td>
3788
3789
      <td>Run at fastforward speed: the <code><a class="internal" href="#fastforwardspeed">fastforwardspeed</a></code> setting determines how fast the emulated MSX runs compared to real time</td>
3790
    </tr>
3791
3792
    <tr>
3793
      <td><code>set fastforward off</code></td>
3794
3795
      <td>Run at normal speed: the <code><a class="internal" href="#speed">speed</a></code> setting determines how fast the emulated MSX runs compared to real time</td>
3796
    </tr>
3797
  </table>
3798
3799
3800
  <h3><a id="fastforwardspeed">fastforwardspeed</a></h3>
3801
3802
  <p>Sets the emulation speed relative to the speed of a real MSX when we are running in <a class="internal" href="#fastforward">fastforward mode</a>. Speed 100 means as fast as a real MSX, lower values are slower than real MSX, higher values are faster than real MSX.</p>
3803
3804
  <div class="subsectiontitle">
3805
    usage:
3806
  </div>
3807
3808
  <table>
3809
    <tr>
3810
      <td><code>set fastforwardspeed</code></td>
3811
3812
      <td>Shows current fastforward speed</td>
3813
    </tr>
3814
3815
    <tr>
3816
      <td><code>set fastforwardspeed &lt;num&gt;</code></td>
3817
3818
      <td>Sets new fastforward speed to &lt;num&gt;% of real time</td>
3819
    </tr>
3820
  </table>
3821
3822
3823
  <h3><a id="frequency">frequency</a></h3>
3824
3825
  <p>Sets the sound mixer frequency. Sound hardware and sound APIs typically support a limited set of frequencies, such as 11025 Hz, 22050 Hz, 44100 Hz and 48000 Hz.</p>
3826
3827
  <div class="subsectiontitle">
3828
    usage:
3829
  </div>
3830
3831
  <table>
3832
    <tr>
3833
      <td><code>set frequency</code></td>
3834
3835
      <td>Shows the current setting</td>
3836
    </tr>
3837
3838
    <tr>
3839
      <td><code>set frequency 44100</code></td>
3840
3841
      <td>Use 44.1 kHz mixing frequency (CD quality)</td>
3842
    </tr>
3843
  </table>
3844
3845
3846
  <h3><a id="firmwareswitch">firmwareswitch</a></h3>
3847
3848
  <p>Some machines (e.g. turboR) have a switch on the front (or on the back) that controls if the machine should boot
3849
  'normally' or start the built-in software, also called firmware. This setting controls the position of that
3850
  switch.</p>
3851
3852
  <div class="subsectiontitle">
3853
    usage:
3854
  </div>
3855
3856
  <table>
3857
    <tr>
3858
      <td><code>set firmwareswitch</code></td>
3859
3860
      <td>Shows the current setting</td>
3861
    </tr>
3862
3863
    <tr>
3864
      <td><code>set firmwareswitch on</code></td>
3865
3866
      <td>Boot into the internal software</td>
3867
    </tr>
3868
3869
    <tr>
3870
      <td><code>set firmwareswitch off</code></td>
3871
3872
      <td>Boot into MSX-BASIC or on-disk software</td>
3873
    </tr>
3874
  </table>
3875
3876
3877
  <h3><a id="fullscreen">fullscreen</a></h3>
3878
3879
  <p>Switch to/from fullscreen mode.</p>
3880
3881
  <div class="subsectiontitle">
3882
    usage:
3883
  </div>
3884
3885
  <table>
3886
    <tr>
3887
      <td><code>set fullscreen</code></td>
3888
3889
      <td>Shows the current setting</td>
3890
    </tr>
3891
3892
    <tr>
3893
      <td><code>set fullscreen on</code></td>
3894
3895
      <td>Switch to fullscreen mode</td>
3896
    </tr>
3897
3898
    <tr>
3899
      <td><code>set fullscreen off</code></td>
3900
3901
      <td>Switch to windowed mode</td>
3902
    </tr>
3903
  </table>
3904
3905
3906
  <h3><a id="fullspeedwhenloading">fullspeedwhenloading</a></h3>
3907
3908
  <p>When enabled, openMSX will try to detect when the MSX is loading from diskette, cassette or laserdisc. During loading openMSX will run at full speed (<code><a class="internal" href="#throttle">throttle</a></code> off). This can be convenient if you're not interested in the realistic but slow loading times on MSX. Default is off, because it is not how a real MSX behaves.</p>
3909
3910
  <p>Unlike the fast loading features in for example fMSX, <code>fullspeedwhenloading</code> does not intercept BIOS calls. Instead, it speeds up the emulation of the entire MSX, including all hardware devices.</p>
3911
3912
  <div class="subsectiontitle">
3913
    usage:
3914
  </div>
3915
3916
  <table>
3917
    <tr>
3918
      <td><code>set fullspeedwhenloading</code></td>
3919
3920
      <td>Shows the current setting</td>
3921
    </tr>
3922
3923
    <tr>
3924
      <td><code>set fullspeedwhenloading on</code></td>
3925
3926
      <td>Load as fast as possible</td>
3927
    </tr>
3928
3929
    <tr>
3930
      <td><code>set fullspeedwhenloading off</code></td>
3931
3932
      <td>Load at the same speed as a real MSX</td>
3933
    </tr>
3934
  </table>
3935
3936
3937
  <h3><a id="full_stretch">full_stretch</a></h3>
3938
3939
  <p>Stretches the image to fill the entire screen when in fullscreen mode. This setting is useful when you want to use the full screen real estate, for example when displaying 4:3 content on a 16:9 monitor, or when you prefer to eliminate any black borders around the image.</p>
3940
3941
  <div class="subsectiontitle">
3942
    usage:
3943
  </div>
3944
3945
  <table>
3946
    <tr>
3947
      <td><code>set full_stretch</code></td>
3948
      <td>Shows the current setting</td>
3949
    </tr>
3950
3951
    <tr>
3952
      <td><code>set full_stretch on</code></td>
3953
      <td>Enable full screen stretching</td>
3954
    </tr>
3955
3956
    <tr>
3957
      <td><code>set full_stretch off</code></td>
3958
      <td>Disable full screen stretching</td>
3959
    </tr>
3960
  </table>
3961
3962
3963
  <h3><a id="gamma">gamma</a></h3>
3964
3965
  <p>Sets the amount of gamma correction. A value of 1.0 will turn off gamma correction. Lower values will result in a darker image, higher values in a brighter image.</p>
3966
3967
  <p>If you want to get a realistic picture, set the openMSX gamma correction to <i>PC gamma / MSX gamma</i>. TVs use a standardised gamma of 2.5, let's take that as the value of <i>MSX gamma</i>. You can measure the gamma of your PC screen with a simple test such as the Gamma Measurement Image in <a class="external" href="https://web.archive.org/web/20150714015749/http://www.bberger.net/rwb/gamma.html">Robert W. Berger's "An Explanation of Monitor Gamma"</a>. If your <i>PC gamma</i> would be for example 2.0, the most realistic value for gamma correction would be 2.0 / 2.5 = 0.8.</p>
3968
3969
  <p>Alternatively, you can just try a few values and see what you like.</p>
3970
3971
  <div class="subsectiontitle">
3972
    usage:
3973
  </div>
3974
3975
  <table>
3976
    <tr>
3977
      <td><code>set gamma</code></td>
3978
3979
      <td>Shows the current value</td>
3980
    </tr>
3981
3982
    <tr>
3983
      <td><code>set gamma &lt;num&gt;</code></td>
3984
3985
      <td>Sets a new gamma correction amount</td>
3986
    </tr>
3987
  </table>
3988
3989
3990
  <h3><a id="glow">glow</a></h3>
3991
3992
  <p>Sets the amount of afterglow effect: 0 is off and 100 is a very heavy afterglow.</p>
3993
3994
  <div class="subsectiontitle">
3995
    usage:
3996
  </div>
3997
3998
  <table>
3999
    <tr>
4000
      <td><code>set glow</code></td>
4001
4002
      <td>Shows the current setting</td>
4003
    </tr>
4004
4005
    <tr>
4006
      <td><code>set glow &lt;value&gt;</code></td>
4007
4008
      <td>Change the amount of afterglow</td>
4009
    </tr>
4010
  </table>
4011
4012
4013
  <h3><a id="grabinput">grabinput</a></h3>
4014
4015
  <p>Controls whether openMSX grabs all input events or not. When this setting is turned on, all input events are directly passed to openMSX. The mouse pointer can't leave the openMSX window and the window manager won't be able to react to keyboard shortcuts.</p>
4016
4017
   <p>You can turn this setting on when you want to use mouse-controlled MSX software while openMSX is in windowed mode. It is best turned off in all other cases. See also <a class="internal" href="#escape_grab"><code>escape_grab</code></a>.</p>
4018
4019
  <div class="subsectiontitle">
4020
    usage:
4021
  </div>
4022
4023
  <table>
4024
    <tr>
4025
      <td><code>set grabinput</code></td>
4026
4027
      <td>Shows the current setting</td>
4028
    </tr>
4029
4030
    <tr>
4031
      <td><code>set grabinput on</code></td>
4032
4033
      <td>Starts grabbing all input events</td>
4034
    </tr>
4035
4036
    <tr>
4037
      <td><code>set grabinput off</code></td>
4038
4039
      <td>Stops grabbing all input events</td>
4040
    </tr>
4041
  </table>
4042
4043
4044
  <h3><a id="horizontal_stretch">horizontal_stretch</a></h3>
4045
4046
  <p>Sets the amount of horizontal stretch, thus also the aspect ratio of the screen. More specifically, a setting of <code>n</code> means stretch the centre <code>n</code> MSX pixels to the full width of the host output window (at the virtual <code><a class="internal" href="#scale_factor">scale_factor</a></code> 1).</p>
4047
4048
  <div class="subsectiontitle">
4049
    usage:
4050
  </div>
4051
4052
  <table>
4053
    <tr>
4054
      <td><code>set horizontal_stretch</code></td>
4055
4056
      <td>Shows the current setting</td>
4057
    </tr>
4058
4059
    <tr>
4060
      <td><code>set horizontal_stretch &lt;value&gt;</code></td>
4061
4062
      <td>Change the amount of horizontal stretch</td>
4063
    </tr>
4064
  </table>
4065
4066
  <div class="subsectiontitle">
4067
    examples of typical useful values:
4068
  </div>
4069
4070
  <div class="examples">
4071
    <code>set horizontal_stretch 320</code> (no horizontal stretch)<br />
4072
    <code>set horizontal_stretch 272</code> (approach real aspect ratio of MSX screen)<br />
4073
    <code>set horizontal_stretch 280</code> (default: show all generated border pixels, so that all border demo effects are still visible)<br />
4074
    <code>set horizontal_stretch 256</code> (borders are not visible at all; doesn't work well in combination with set-adjust)
4075
  </div>
4076
4077
4078
  <h3><a id="inputdelay">inputdelay</a></h3>
4079
4080
  <p>Input events for the MSX machine are delayed by this amount. Increase this value when the MSX machine misses keyboard presses when you type very fast. Decrease this value to reduce the latency between pressing a key on the host machine and seeing it being typed in the MSX machine.</p>
4081
4082
  <div class="subsectiontitle">
4083
    usage:
4084
  </div>
4085
4086
  <table>
4087
    <tr>
4088
      <td><code>set inputdelay</code></td>
4089
      <td>Shows the current value</td>
4090
    </tr>
4091
    <tr>
4092
      <td><code>set inputdelay &lt;time&gt;</code></td>
4093
      <td>Sets the input delay to the specified number of seconds</td>
4094
    </tr>
4095
  </table>
4096
4097
  <div class="note">
4098
    Note: The default value of 0.0 seconds (no extra delay) should almost
4099
    always be OK. It only makes sense to increase this setting if you have
4100
    a slow host machine and you're typing text very fast and the emulated
4101
    MSX machine misses (some of) the keys you typed.
4102
  </div>
4103
4104
4105
  <h3><a id="interleave_black_frame">interleave_black_frame</a></h3>
4106
4107
  <p>Insert a black frame in between each normal MSX frame. Useful on (100Hz+)
4108
  lightboost enabled monitors to reduce motion blur and double frame
4109
  artifacts.</p>
4110
4111
  <p>Make sure you configure your monitor to use a refresh rate of 100Hz (for a
4112
  PAL MSX machine) or to 120Hz (for a NTSC machine). The brightness will
4113
  decrease, so adjust the <a class="internal" href="#gamma">gamma</a>,
4114
  <a class="internal" href="#brightness">brightness</a> and
4115
  <a class="internal" href="#contrast">contrast</a> settings to compensate.</p>
4116
4117
  <div class="subsectiontitle">
4118
    usage:
4119
  </div>
4120
  <table>
4121
    <tr>
4122
      <td><code>set interleave_black_frame</code></td>
4123
      <td>Shows the current value</td>
4124
    </tr>
4125
    <tr>
4126
      <td><code>set interleave_black_frame true</code></td>
4127
      <td>Enable this feature.</td>
4128
    </tr>
4129
  </table>
4130
4131
4132
  <h3><a id="invalid_ppi_mode_callback">invalid_ppi_mode_callback</a></h3>
4133
4134
  <p>Selects the Tcl procedure to be called when the running MSX software has selected an invalid PPI mode. Or at least a PPI mode that's not yet correctly emulated. Typically on a real machine these modes will hang the MSX.</p>
4135
4136
  <p>The default openMSX startup scripts initialize this setting with a proc that prints a warning message just once. Though if you're a developer you may want to change this to always print the warning or automatically break emulation when this happens so you can debug the problem.</p>
4137
4138
  <div class="subsectiontitle">
4139
    usage:
4140
  </div>
4141
  <table>
4142
    <tr>
4143
      <td><code>set invalid_ppi_mode_callback</code></td>
4144
      <td>Shows the current setting</td>
4145
    </tr>
4146
    <tr>
4147
      <td><code>set invalid_ppi_mode_callback my_callback_proc</code></td>
4148
      <td>Sets a new callback proc</td>
4149
    </tr>
4150
  </table>
4151
4152
4153
  <h3><a id="invalid_psg_directions_callback">invalid_psg_directions_callback</a></h3>
4154
4155
  <p>Selects the Tcl procedure to be called when the running MSX software has selected invalid PSG port directions (port A should always be set as input).</p>
4156
4157
  <p>The default openMSX startup scripts initialize this setting with a proc that prints a warning message just once. Though if you're a developer you may want to change this to always print the warning or automatically break emulation when this happens, so you can debug the problem.</p>
4158
4159
  <div class="subsectiontitle">
4160
    usage:
4161
  </div>
4162
  <table>
4163
    <tr>
4164
      <td><code>set invalid_psg_directions_callback</code></td>
4165
      <td>Shows the current setting</td>
4166
    </tr>
4167
    <tr>
4168
      <td><code>set invalid_psg_directions_callback my_callback_proc</code></td>
4169
      <td>Sets a new callback proc</td>
4170
    </tr>
4171
  </table>
4172
4173
4174
  <h3><a id="msxjoystickN_config">msxjoystick&lt;n&gt;_config/joymega&lt;n&gt;_config</a></h3>
4175
4176
  <p>This setting configures how the buttons/axis/keys of the host are
4177
  mapped to the inputs of the emulated MSX joysticks or JoyMega devices. For many
4178
  host controllers the initial value of this setting provides an acceptable default
4179
  mapping. But depending on your controller type and taste you may want to tweak
4180
  it.</p>
4181
4182
  <p>The easiest way to tweak it, is by using the GUI menu under <span class="menu-reference">Main menu bar &rarr; Settings
4183
  &rarr; Input &rarr; Configure MSX joysticks</span>.</p>
4184
4185
  <p>The value of this setting is a Tcl dictionary. This means it's a list of
4186
  key/value pairs where each even element is a key and each odd element is the
4187
  corresponding value. The keys in this dictionary represent the 6 possible MSX
4188
  joystick inputs. Possible key values are <code>LEFT</code>,
4189
  <code>RIGHT</code>, <code>UP</code>, <code>DOWN</code>, <code>A</code> and
4190
  <code>B</code>. For the JoyMega devices, add <code>C</code>, <code>X</code>,
4191
  <code>Y</code>, <code>Z</code>, <code>SELECT</code> and <code>START</code>.
4192
  The corresponding dictionary-values are lists of boolean host
4193
  inputs. Possible elements for these lists regarding host controller input are
4194
  <code>joy&lt;n&gt; button&lt;m&gt;</code>, <code>joy&lt;n&gt; +axis&lt;m&gt;</code>,
4195
  <code>joy&lt;n&gt; -axis&lt;m&gt;</code> and <code>joy&lt;n&gt; hat&lt;m&gt;
4196
  left/right/down/up</code>. But also host keyboard input can be configured
4197
  with <code>keyb &lt;KEYNAME&gt;</code>, where KEYNAME is the name of a
4198
  key.</p>
4199
4200
  <p>Let's explain this with an example. The following is the default value for
4201
  this setting:<br/>
4202
  &nbsp;<code>UP {{joy1 -axis1} {joy1 hat0 up}} DOWN {{joy1 +axis1} {joy1 hat0 down}} LEFT {{joy1 -axis0} {joy1 hat0 left}} RIGHT {{joy1 +axis0} {joy1 hat0 right}} A {{joy1 button0} {joy1 button2} {joy1 button4} {joy1 button6} {joy1 button8} {joy1 button10}} B {{joy1 button1} {joy1 button3} {joy1 button5} {joy1 button7} {joy1 button9} {joy1 button11}}</code><br/>
4203
  Axis 0 is usually the primary X-axis of the host controller's analogue stick.
4204
  When that axis is moved towards negative values the LEFT input switch on the
4205
  emulated joystick is activated. When it is moved towards positive values the
4206
  RIGHT MSX input switch is activated. The D-pad of the detected host
4207
  controller is also mapped via the <code>hat0</code> events.
4208
  Similarly host axis1 is mapped to the UP and DOWN MSX inputs. The (default)
4209
  configuration for the buttons is slightly more complicated. Here all even
4210
  numbered host buttons (0, 2, etc.) will activate MSX button A, and odd host
4211
  button numbers will activate MSX button B.</p>
4212
4213
  <p>There are no restrictions on the possible mappings. For example it is
4214
  allowed to map host axis/buttons to MSX buttons/axis or vice-versa. This
4215
  allows to for example map a host joypad (which acts like 4 buttons, instead of hats) to the
4216
  MSX directional inputs. (Technically speaking the MSX axis inputs LEFT,
4217
  RIGHT, UP and DOWN are just 4 input switches, just like the buttons A and B
4218
  are just 2 input switches). It's also allowed to map the same host action to
4219
  multiple MSX inputs. This allows to for example make one specific host button
4220
  press both MSX buttons simultaneously (e.g. to have a 'crouch button' in
4221
  Metal Gear).</p>
4222
4223
  <p>It is possible to set this setting directly using the <code>set</code>
4224
  command, but often using the Tcl <code>dict</code> command is more
4225
  convenient. See below for some examples.</p>
4226
4227
  <div class="subsectiontitle">
4228
    usage:
4229
  </div>
4230
  <table>
4231
    <tr>
4232
      <td><code>set msxjoystick1_config</code></td>
4233
      <td>Shows the current configuration of the first MSX joystick (there are 2 MSX joysticks defined)</td>
4234
    </tr>
4235
    <tr>
4236
      <td><code>dict set msxjoystick1_config A {joy1 button5}</code></td>
4237
      <td>(Re)map MSX button A to (only) host button 5 of host joystick/controller 1. Leave the mapping of the
4238
      other MSX inputs unchanged.</td>
4239
    </tr>
4240
    <tr>
4241
      <td><code>dict set msxjoystick1_config A {{joy1 button0} {joy1 button2}}<br/>
4242
                dict set msxjoystick1_config B {{joy1 button1} {joy1 button2}}</code></td>
4243
      <td>Map joystick/controller 1's button 0 to A, 1 to B and 2 to A+B. So pressing host button 2
4244
      will press both MSX buttons.</td>
4245
    </tr>
4246
    <tr>
4247
      <td><code>dict set msxjoystick1_config LEFT  {{joy2 -axis0} {joy2 -axis2} {joy1 button10}}<br/>
4248
                dict set msxjoystick1_config RIGHT {{joy2 +axis0} {joy2 +axis2} {joy1 button11}}<br/>
4249
                dict set msxjoystick1_config UP    {{joy2 -axis1} {joy2 -axis3} {joy1 button12}}<br/>
4250
                dict set msxjoystick1_config DOWN  {{joy2 +axis1} {joy2 +axis3} {joy1 button13}}</code></td>
4251
      <td>Map 2 pairs of axis and 1 keypad (4 buttons) from host controller/joystick 2 to the MSX direction inputs for MSX joystick 1.</td>
4252
    </tr>
4253
    <tr>
4254
      <td><code>dict lappend msxjoystick2_config LEFT  {joy1 hat0 left}<br/>
4255
                dict lappend msxjoystick2_config RIGHT {joy1 hat0 right}<br/>
4256
                dict lappend msxjoystick2_config UP    {joy1 hat0 up}<br/>
4257
                dict lappend msxjoystick2_config DOWN  {joy1 hat0 down}</code></td>
4258
      <td>Additionally map hat0 of host controller/joystick 1 to the 4 MSX directions of msxjoystick2.</td>
4259
    </tr>
4260
    <tr>
4261
      <td><code>dict lappend msxjoystick2_config LEFT  {keyb A}<br/>
4262
                dict lappend msxjoystick2_config RIGHT {keyb D}<br/>
4263
                dict lappend msxjoystick2_config UP    {keyb W}<br/>
4264
                dict lappend msxjoystick2_config DOWN  {keyb S}</code></td>
4265
      <td>Additionally map the W, A, S, D keyboard key presses to the 4 MSX directions of msxjoystick2.</td>
4266
    </tr>
4267
  </table>
4268
4269
4270
  <h3><a id="joystickN_deadzone">joystick&lt;n&gt;_deadzone</a></h3>
4271
4272
  <p>This setting configures how big the dead centre zone of an (analogue)
4273
  joystick is. This is expressed as a percentage: 0 means no dead zone, 100
4274
  means everything falls inside the dead zone. The setting is only available
4275
  when connected host analogue sticks are detected.</p>
4276
4277
  <div class="subsectiontitle">
4278
    usage:
4279
  </div>
4280
  <table>
4281
    <tr>
4282
      <td><code>set joystick1_deadzone</code></td>
4283
      <td>Shows the current size of the dead zone of the first joystick</td>
4284
    </tr>
4285
    <tr>
4286
      <td><code>set joystick1_deadzone 25</code></td>
4287
      <td>Set the size of the dead zone to &frac14; of the total range</td>
4288
    </tr>
4289
  </table>
4290
4291
4292
  <h3><a id="kbd_auto_toggle_code_kana_lock">kbd_auto_toggle_code_kana_lock</a></h3>
4293
4294
  <p>Switches the "Automatically toggle the CODE/KANA lock" feature on or off. When it's on, openMSX will
4295
  automatically toggle the CODE/KANA lock when a user enters a character for which the CODE/KANA lock
4296
  state must be changed.</p>
4297
4298
  <div class="subsectiontitle">
4299
    usage:
4300
  </div>
4301
4302
  <table>
4303
    <tr>
4304
      <td><code>set kbd_auto_toggle_code_kana_lock</code></td>
4305
4306
      <td>Shows the current setting</td>
4307
    </tr>
4308
4309
    <tr>
4310
      <td><code>set&nbsp;kbd_auto_toggle_code_kana_lock&nbsp;on</code></td>
4311
4312
      <td>Automatically toggle the CODE/KANA lock when required</td>
4313
    </tr>
4314
4315
    <tr>
4316
      <td><code>set&nbsp;kbd_auto_toggle_code_kana_lock&nbsp;off</code></td>
4317
4318
      <td>Only toggle CODE/KANA lock status when user presses the CODE/KANA lock key</td>
4319
    </tr>
4320
  </table>
4321
4322
  <div class="note">
4323
    Note: This only works on MSX models for which the CODE/KANA key locks (e.g. Japanese MSX models and the Philips VG8010). On other models, this setting is ignored.
4324
  </div>
4325
4326
4327
  <h3><a id="kbd_code_kana_host_key">kbd_code_kana_host_key</a></h3>
4328
4329
  <p>Host key that maps to the MSX CODE/KANA key. By default right-ALT (RALT) key.</p>
4330
  <p>It is especially useful for
4331
  people with AZERTY host keyboard, on which the RALT key has a special function; on
4332
  azerty keyboards it is called the ALT-GR key and not the right-ALT key and it's used to
4333
  enter some special characters (some keys are tagged with 3 characters; normal, key+SHIFT, key+ALT-GR).</p>
4334
  <p>It is also useful for people with a Japanese (jp106) keyboard; they can map the HENKAN_MODE key (which is similar to the KANA Lock on Japanese MSX models) to the CODE/KANA key.</p>
4335
4336
  <div class="subsectiontitle">
4337
    usage:
4338
  </div>
4339
4340
  <table>
4341
    <tr>
4342
      <td><code>set&nbsp;kbd_code_kana_host_key</code></td>
4343
4344
      <td>Shows the current setting</td>
4345
    </tr>
4346
4347
    <tr>
4348
      <td><code>set&nbsp;kbd_code_kana_host_key&nbsp;MENU</code></td>
4349
4350
      <td>Binds the <a class="external" href="http://en.wikipedia.org/wiki/Menu_key">MENU key</a> on the host keyboard to the MSX CODE/KANA key</td>
4351
    </tr>
4352
4353
    <tr>
4354
      <td><code>set&nbsp;kbd_code_kana_host_key&nbsp;HENKAN_MODE</code></td>
4355
4356
      <td>Binds the HENKAN_MODE key on the host keyboard to the MSX CODE/KANA key</td>
4357
    </tr>
4358
  </table>
4359
4360
4361
  <h3><a id="kbd_deadkey1_host_key">kbd_deadkey1_host_key</a></h3>
4362
4363
  <p>Host key that maps to the (1st) dead key. By default right-CTRL (RCTRL) key.</p>
4364
  <p>Some MSX models have one dead key that can be used to enter accented characters. For example the MSX
4365
  models sold in the Netherlands have a dead key that has following four accents printed on it: ` &#xb4; ^ &#xa8;.
4366
  On the other hand, the Brazilian Gradiente Expert XP-800 has following four accents on its
4367
  dead key: ` &#xb4; ^ <sup>~</sup>.</p>
4368
  <p>There are also some MSX models with multiple dead keys like for example the Brazilian Gradiente Expert Plus,
4369
  which has two dead keys and the different Sharp Hotbit models that have three dead keys. On such machines,
4370
  this setting is for the first dead key which can be used to enter following two accents: &#xb4; `.</p>
4371
  <p>In order to enter an accented character on the MSX, you first have to press and release the dead key, optionally
4372
  together with SHIFT, CODE or CODE+SHIFT and then the correct character. The combination with CODE or CODE+SHIFT is
4373
  only relevant for the MSX models with a single dead key that can be used to enter four different accents.</p>
4374
  <p>Following table shows for example how to
4375
  enter respectively &#xf9;, &#xfa;, &#xfb; or &#xfc; on the MSX models sold in the Netherlands:</p>
4376
  <table>
4377
	  <tr><th>Key presses</th><th>Character</th></tr>
4378
	  <tr><td>DEAD_KEY1 followed by u</td><td>&#xf9;</td></tr>
4379
	  <tr><td>DEAD_KEY1+SHIFT followed by u</td><td>&#xfa;</td></tr>
4380
	  <tr><td>DEAD_KEY1+CODE followed by u</td><td>&#xfb;</td></tr>
4381
	  <tr><td>DEAD_KEY1+SHIFT+CODE followed by u</td><td>&#xfc;</td></tr>
4382
  </table>
4383
  <p>In order to use the dead key in openMSX, you must map an appropriate host key to the DEAD_KEY1 of the MSX and
4384
  another one to the CODE key of the MSX with respectively this <code>kbd_deadkey1_host_key</code> setting and the above
4385
  documented <code><a class="internal" href="#kbd_code_kana_host_key">kbd_code_kana_host_key</a></code> setting.</p>
4386
  <p>Note that especially the last key combination (DEAD_KEY1+SHIFT+CODE) can be impossible to enter on some
4387
  host systems; depending on the host operating system, keyboard type and keyboard driver it may be impossible
4388
  for the host system to send a combination of three keys at once to an application like openMSX. Unfortunately
4389
  openMSX or its developers can't do anything about that.</p>
4390
4391
  <div class="subsectiontitle">
4392
    usage:
4393
  </div>
4394
4395
  <table>
4396
    <tr>
4397
      <td><code>set&nbsp;kbd_deadkey1_host_key</code></td>
4398
4399
      <td>Shows the current setting</td>
4400
    </tr>
4401
4402
    <tr>
4403
      <td><code>set&nbsp;kbd_deadkey1_host_key&nbsp;PAGEUP</code></td>
4404
4405
      <td>Binds the PAGEUP key on the host keyboard to the 1st dead key</td>
4406
    </tr>
4407
  </table>
4408
  <p>Note that to use for example PAGEUP as 1st dead key you will have to unbind it from the <code>go_back_one_step</code>
4409
   command in the console; by default openMSX has bound the PAGEUP key to the <code>go_back_one_step</code> command and such
4410
   a binding takes precedence over keyboard mappings, so if you want to use PAGEUP as the 1st dead key you will have
4411
   to enter following additional command in the console: <code>unbind PAGEUP</code>.</p>
4412
4413
4414
  <h3><a id="kbd_deadkey2_host_key">kbd_deadkey2_host_key</a></h3>
4415
4416
  <p>Host key that maps to the 2nd dead key. By default Page Up (PAGEUP) key.</p>
4417
  <p>This is only applicable to MSX models that have at least two dead keys, like the Brazilian Hotbit models
4418
  or the Brazilian Gradiente Expert Plus or other Gradiente models with Gradiente basic version 1.1.</p>
4419
  <p>On the Hotbit models, the second dead key can be used to enter accent &#xa8; while on the Gradiente 1.1
4420
  models, the second dead key can be used to enter following accents: <sup>~</sup> ^.</p>
4421
  <p>It can be used in the same manner as the first dead key, explained in previous section.</p>
4422
4423
  <div class="subsectiontitle">
4424
    usage:
4425
  </div>
4426
4427
  <table>
4428
    <tr>
4429
      <td><code>set&nbsp;kbd_deadkey2_host_key</code></td>
4430
4431
      <td>Shows the current setting</td>
4432
    </tr>
4433
4434
    <tr>
4435
      <td><code>set&nbsp;kbd_deadkey2_host_key&nbsp;PAGEDOWN</code></td>
4436
4437
      <td>Binds the PAGEDOWN key on the host keyboard to the 2nd dead key</td>
4438
    </tr>
4439
  </table>
4440
  <p>Note that to use for example PAGEUP or PAGEDOWN as a dead key you will have to unbind them from the
4441
   default functions in openMSX using the console; by default openMSX has bound the PAGEUP key to the
4442
   <code>go_back_one_step</code> command and the PAGEDOWN key to the <code>go_forward_one_step</code> command. Such a binding
4443
   takes precedence over keyboard mappings, so if you want to use PAGEUP or PAGEDOWN as the second dead key
4444
   you will have to enter following additional commands in the console: <code>unbind PAGEUP</code> or
4445
  <code>unbind PAGEDOWN</code>.</p>
4446
4447
4448
  <h3><a id="kbd_deadkey3_host_key">kbd_deadkey3_host_key</a></h3>
4449
4450
  <p>Host key that maps to the 3rd dead key. By default Page Down (PAGEDOWN) key.</p>
4451
  <p>This is only applicable to MSX models with at least three dead keys, like the Sharp Hotbit models.</p>
4452
  <p>On the Hotbit models, the third dead key can be used to enter following two accents: <sup>~</sup> ^.</p>
4453
4454
  <div class="subsectiontitle">
4455
    usage:
4456
  </div>
4457
4458
  <table>
4459
    <tr>
4460
      <td><code>set&nbsp;kbd_deadkey3_host_key</code></td>
4461
4462
      <td>Shows the current setting</td>
4463
    </tr>
4464
4465
    <tr>
4466
      <td><code>set&nbsp;kbd_deadkey3_host_key&nbsp;RCTRL</code></td>
4467
4468
      <td>Binds the Right CTRL (RCTRL) key on the host keyboard to the 3rd dead key</td>
4469
    </tr>
4470
  </table>
4471
  <p>Note that to use for example PAGEDOWN (default setting!) as the 3rd dead key you will have to unbind
4472
   it from the <code>go_forward_one_step</code> command in openMSX using the console; by default openMSX has bound
4473
   the PAGEUP key to the <code>go_back_one_step</code> command. It is a very useful setting for many openMSX users when
4474
   playing games but unfortunately it conflicts with the default set-up for the third dead key. Such a command
4475
   binding takes precedence over keyboard mappings, so if you want to use PAGEDOWN as the third dead key you
4476
   will have to enter following additional command in the console: <code>unbind PAGEDOWN</code>.</p>
4477
4478
4479
  <h3><a id="kbd_mapping_mode">kbd_mapping_mode</a></h3>
4480
4481
  <p>The keyboard driver can work in several mapping modes: CHARACTER, POSITIONAL or KEY.</p>
4482
4483
  <dl>
4484
    <dt>CHARACTER mapping:</dt>
4485
    <dd>A character entered by the user on the host keyboard is mapped to the correct key combination on the MSX keyboard to
4486
  enter that same character. For example, when the user enters an '!' character and openMSX is emulating an 'international'
4487
  MSX model, the keyboard driver will press SHIFT and '1' on the MSX keyboard. This will be done regardless of the key
4488
  or keys that the user pressed on the host keyboard to enter that '!' character.<br/>
4489
  This is especially useful when the user has an AZERTY host keyboard and is working on a QWERTY style MSX or
4490
  when he has a US-QWERTY keyboard and is working on a Japanese MSX.<br/>
4491
  In other words: in this mode openMSX is aware of both the host and the MSX keyboard layout and tries to remap host key-combinations to the corresponding MSX key-combinations that produce the same character.<br/>
4492
  Special host keys (like CURSOR keys or CAPSLOCK) are mapped directly to the corresponding MSX keys.<br/>
4493
  Note that CHARACTER mode isn't perfect (help to improve it is always appreciated). In some cases it may be more convenient or even required to use one of the other mapping modes.</dd>
4494
4495
    <dt>POSITIONAL mapping:</dt>
4496
    <dd>In this mode both the host and the MSX keyboard layout are ignored. Host keys get mapped to MSX keys that are (approximately) in the same position on both keyboards. (More technically, host 'scan-codes' get mapped to MSX 'keyboard-matrix positions'.)</dd>
4497
4498
    <dt>KEY mapping:</dt>
4499
    <dd>This mode is deprecated, it's superseded by the previous two modes and may get removed in a future openMSX release.<br/>
4500
    This mode has rudimentary knowledge about the host keyboard layout, but no knowledge about the MSX keyboard layout. It remaps individual keys, not key combinations. Take for example a French AZERTY host keyboard and an emulated MSX with 'international' keyboard layout. Pressing the 'A' host key correctly maps to the 'A' MSX key. But pressing SHIFT+'3' on the host (which produces '3'), maps to SHIFT+'3' on the MSX keyboard (which produces '#').</dd>
4501
  </dl>
4502
4503
  <div class="subsectiontitle">
4504
    usage:
4505
  </div>
4506
4507
  <table>
4508
    <tr>
4509
      <td><code>set&nbsp;kbd_mapping_mode</code></td>
4510
4511
      <td>Shows the current mode</td>
4512
    </tr>
4513
4514
    <tr>
4515
      <td><code>set&nbsp;kbd_mapping_mode&nbsp;CHARACTER</code></td>
4516
4517
      <td>Set the CHARACTER mapping mode</td>
4518
    </tr>
4519
4520
    <tr>
4521
      <td><code>set&nbsp;kbd_mapping_mode&nbsp;POSITIONAL</code></td>
4522
4523
      <td>Set the POSITIONAL mapping mode</td>
4524
    </tr>
4525
4526
  </table>
4527
4528
4529
  <h3><a id="kbd_numkeypad_always_enabled">kbd_numkeypad_always_enabled</a></h3>
4530
4531
  <p>Some real MSX computers do not have a numeric keypad. openMSX will ignore
4532
  key presses on the host numeric keypad when emulating such an MSX model.
4533
  With this parameter, you can indicate that even on such MSX models, presses
4534
  on the host numeric keypad must be mapped to the MSX numeric keypad. So, you
4535
  can override accurate behaviour with it, which is the reason that by default,
4536
  this setting is set to 'off'.</p>
4537
4538
  <div class="subsectiontitle">
4539
    usage:
4540
  </div>
4541
4542
  <table>
4543
    <tr>
4544
      <td><code>set kbd_numkeypad_always_enabled</code></td>
4545
4546
      <td>Shows the current setting</td>
4547
    </tr>
4548
4549
    <tr>
4550
      <td><code>set kbd_numkeypad_always_enabled on</code></td>
4551
4552
      <td>Enables numeric keypad, even if the emulated MSX does not have one</td>
4553
    </tr>
4554
  </table>
4555
4556
4557
  <h3><a id="kbd_numkeypad_enter_key">kbd_numkeypad_enter_key</a></h3>
4558
4559
  <p>There is a subtle difference between numeric keypad of MSX computers and
4560
  of most host computers; the MSX computers have a '.' and a ',' on the numeric
4561
  keypad. On the other hand, the host computers have a '.' and an 'ENTER' key
4562
  on the keypad.</p>
4563
4564
  <p>In some respect it is logical that the 'ENTER' key on the host numeric
4565
  keypad is mapped to the 'normal' MSX 'ENTER' key. On the other hand, that
4566
  would make it impossible to enter the ',' on the MSX numeric keypad.
4567
  Therefore, the user can choose whether the host numeric keypad ENTER key
4568
  should be mapped to the MSX numeric keypad ',' (which is the default) or to
4569
  the main 'ENTER' key.</p>
4570
4571
  <div class="subsectiontitle">
4572
    usage:
4573
  </div>
4574
4575
  <table>
4576
    <tr>
4577
      <td><code>set&nbsp;kbd_numkeypad_enter_key</code></td>
4578
4579
      <td>Shows the current value</td>
4580
    </tr>
4581
4582
    <tr>
4583
      <td><code>set&nbsp;kbd_numkeypad_enter_key&nbsp;ENTER</code></td>
4584
4585
      <td>Maps the keypad enter key to the main 'ENTER' key, instead of the comma key on the MSX keypad</td>
4586
    </tr>
4587
  </table>
4588
4589
4590
  <h3><a id="kbd_trace_key_presses">kbd_trace_key_presses</a></h3>
4591
4592
  <p>Log SDL key code, SDL modifiers and Unicode value for each key that gets
4593
  pressed on the host keyboard on stderr.  Also show Unicode value and
4594
  corresponding MSX key-presses for characters that get 'pasted' into the MSX
4595
  by the console <code><a class="internal" href="#type">type</a></code>
4596
  command. This setting is especially useful when defining Unicode keymap
4597
  files, so that you can find out the Unicode values belonging to certain
4598
  keys/characters.</p>
4599
4600
  <div class="subsectiontitle">
4601
    usage:
4602
  </div>
4603
4604
  <table>
4605
    <tr>
4606
      <td><code>set kbd_trace_key_presses</code></td>
4607
4608
      <td>Shows the current setting</td>
4609
    </tr>
4610
4611
    <tr>
4612
      <td><code>set kbd_trace_key_presses on</code></td>
4613
4614
      <td>Turn logging of key presses on</td>
4615
    </tr>
4616
4617
  </table>
4618
4619
4620
  <h3><a id="led">led_&lt;name&gt;</a></h3>
4621
4622
  <p>These are read-only settings. Their value reflects the current status of the corresponding LED on the emulated MSX machine. The currently supported LED names are: <code>power</code>, <code>caps</code>, <code>kana</code>, <code>pause</code>, <code>turbo</code> and <code>FDD</code>.</p>
4623
4624
  <p>As for any setting you can use the native <code>trace</code> Tcl command to trigger a callback when the value of these settings changes. (In fact this possibility was the main motivation to make these read-only settings instead of topics of the <code><a class="internal" href="#machine_info">machine_info</a></code> command.)</p>
4625
4626
4627
  <h3><a id="limitsprites">limitsprites</a></h3>
4628
4629
  <p>Controls whether the VDP has a limit on the number of sprites it can display per line. The default is on, because the real VDP has such a limit. You can turn off the limit to reduce sprite flashing in games such as Aleste. Note that some games (Penguin Adventure, among others) make use of this limitation, so they will display incorrectly if the limit is turned off.</p>
4630
4631
  <p>The 5th/9th sprite status flag of the VDP is not influenced by the <code>limitsprites</code> setting: the flag always takes the limit into account.</p>
4632
4633
  <div class="subsectiontitle">
4634
    usage:
4635
  </div>
4636
4637
  <table>
4638
    <tr>
4639
      <td><code>set limitsprites</code></td>
4640
4641
      <td>Shows the current value</td>
4642
    </tr>
4643
4644
    <tr>
4645
      <td><code>set limitsprites on</code></td>
4646
4647
      <td>Limits number of sprites per line</td>
4648
    </tr>
4649
4650
    <tr>
4651
      <td><code>set limitsprites off</code></td>
4652
4653
      <td>Turns off number of sprites per line limit</td>
4654
    </tr>
4655
  </table>
4656
4657
4658
  <h3><a id="master_volume">master_volume</a></h3>
4659
4660
  <p>Controls the overall openMSX volume. The volume of individual sound devices can be controlled with the <code><a class="internal" href="#soundchip_volume">&lt;soundchip&gt;_volume</a></code> settings.</p>
4661
4662
  <div class="subsectiontitle">
4663
    usage:
4664
  </div>
4665
4666
  <table>
4667
    <tr>
4668
      <td><code>set master_volume</code></td>
4669
4670
      <td>Shows current setting</td>
4671
    </tr>
4672
4673
    <tr>
4674
      <td><code>set master_volume 50</code></td>
4675
4676
      <td>Sets master volume to 50%</td>
4677
    </tr>
4678
  </table>
4679
4680
4681
  <h3><a id="maxframeskip">maxframeskip</a></h3>
4682
4683
  <p>Sets the maximum amount of frames to skip: show a frame and then skip at most &lt;number&gt; frames. So 0 means show everything (no frame skipping), 1 means show at least every second frame etc.</p>
4684
4685
  <p>Frame skipping is done on demand, as a way to keep the flow of time for the emulated MSX in sync with the flow of real time. You can set limits on the amount of frame skipping with the <code><a class="internal" href="#minframeskip">minframeskip</a></code> and <code>maxframeskip</code> setting.</p>
4686
4687
  <p>In a situation where the number of consecutive frames specified by <code>maxframeskip</code> has been skipped, openMSX will display the next frame, even if that means emulation will start lagging behind real time.</p>
4688
4689
  <div class="subsectiontitle">
4690
    usage:
4691
  </div>
4692
4693
  <table>
4694
    <tr>
4695
      <td><code>set maxframeskip</code></td>
4696
4697
      <td>Shows the current setting</td>
4698
    </tr>
4699
4700
    <tr>
4701
      <td><code>set maxframeskip &lt;number&gt;</code></td>
4702
4703
      <td>Sets the maximum number of consecutive frame skips</td>
4704
    </tr>
4705
  </table>
4706
4707
4708
  <h3><a id="midi-in-readfilename">midi-in-readfilename</a></h3>
4709
4710
  <p>Sets the file from which the MIDI input is read. By default, it is set to <code>/dev/midi</code> when available.</p>
4711
4712
  <div class="subsectiontitle">
4713
    usage:
4714
  </div>
4715
4716
  <table>
4717
    <tr>
4718
      <td><code>set midi-in-readfilename</code></td>
4719
4720
      <td>Shows the current setting</td>
4721
    </tr>
4722
4723
    <tr>
4724
      <td><code>set midi-in-readfilename mymidilog.dat</code></td>
4725
4726
      <td>Read MIDI events from "mymidilog.dat"</td>
4727
    </tr>
4728
  </table>
4729
4730
4731
  <h3><a id="midi-out-logfilename">midi-out-logfilename</a></h3>
4732
4733
  <p>Sets the file to which the MIDI output is logged. By default, it logs to <code>/dev/midi</code> when available.</p>
4734
4735
  <div class="subsectiontitle">
4736
    usage:
4737
  </div>
4738
4739
  <table>
4740
    <tr>
4741
      <td><code>set midi-out-logfilename</code></td>
4742
4743
      <td>Shows the current setting</td>
4744
    </tr>
4745
4746
    <tr>
4747
      <td><code>set midi-out-logfilename mymidilog.dat</code></td>
4748
4749
      <td>Log MIDI events to "mymidilog.dat"</td>
4750
    </tr>
4751
  </table>
4752
4753
4754
  <h3><a id="minframeskip">minframeskip</a></h3>
4755
4756
  <p>Sets the minimum amount of frames to skip: show a frame and then skip at least &lt;number&gt; frames.
4757
  So 0 means no forced frame skipping, 1 means skip at least every second frame etc.</p>
4758
4759
  <p>Frame skipping is done on demand, as a way to keep the flow of time for the emulated MSX in sync with the flow of real time. You can set limits on the amount of frame skipping with the <code>minframeskip</code> and <code><a class="internal" href="#maxframeskip">maxframeskip</a></code> setting.</p>
4760
4761
  <p>The <code>minframeskip</code> setting can be useful if you want to ease the burden on your PC processor, for example for longer battery life on a laptop. It can also be useful if your PC is consistently too slow to run without frame skipping: in such cases video might be smoother with a low but constant frame rate than with a fluctuating frame rate.</p>
4762
4763
  <div class="subsectiontitle">
4764
    usage:
4765
  </div>
4766
4767
  <table>
4768
    <tr>
4769
      <td><code>set minframeskip</code></td>
4770
4771
      <td>Shows the current setting</td>
4772
    </tr>
4773
4774
    <tr>
4775
      <td><code>set minframeskip &lt;number&gt;</code></td>
4776
4777
      <td>Sets the number of frame skips</td>
4778
    </tr>
4779
  </table>
4780
4781
4782
  <h3><a id="mode">mode</a></h3>
4783
4784
  <p>Sets the active mode. A mode is a set of settings (mostly key bindings, but also OSD widgets that are activated) that are most suitable for a certain task. Currently only mode 'normal' and 'tas' exist.</p>
4785
4786
  <div class="subsectiontitle">
4787
    usage:
4788
  </div>
4789
4790
  <table>
4791
    <tr>
4792
      <td><code>set mode</code></td>
4793
4794
      <td>Shows the current setting</td>
4795
    </tr>
4796
4797
    <tr>
4798
      <td><code>set mode tas</code></td>
4799
4800
      <td>Change mode to TAS mode</td>
4801
    </tr>
4802
4803
    <tr>
4804
      <td><code>set mode normal</code></td>
4805
4806
      <td>Set mode back to normal, which is the default (all purpose) mode</td>
4807
    </tr>
4808
  </table>
4809
4810
  <h4>TAS mode</h4>
4811
4812
  <p>So far, the only special mode is the TAS mode, which is made for doing Tool Assisted Speedruns, with TAS widgets and easier ways to save replays. It is still experimental, but already very useful for doing a TAS. This mode enables the following widgets:</p>
4813
  <ul>
4814
    <li>frame counter (can also be toggled with <code>toggle_frame_counter</code>), which shows the VDP (not V9990) frame number on screen</li>
4815
    <li>cursors (can also be toggled with <code>toggle_cursors</code>), shows which keys (important for games) are pressed</li>
4816
  </ul>
4817
  <p>The mode configures the following key bindings, overriding any existing key bindings (note: Mac key bindings are not proper yet...):</p>
4818
  <table>
4819
    <tr> <th>keys (PC)</th>  <th>keys (Mac)</th>         <th>function</th> </tr>
4820
    <tr> <td>F6</td>      <td>(F6)</td>      <td>Load replay from current slot</td></tr>
4821
    <tr> <td>F7</td>      <td>(F7)</td>      <td>Open slot select menu</td></tr>
4822
    <tr> <td>F8</td>      <td>(F8)</td>      <td>Save replay to current slot</td></tr>
4823
    <tr> <td>End</td>     <td>(End)</td>     <td>Advance one frame (<code>advance_frame</code>)</td></tr>
4824
    <tr> <td>ScrollLock</td><td>(ScrollLock)</td><td>Reverse one frame (<code>reverse_frame</code>)</td></tr>
4825
  </table>
4826
4827
  <p>Note that this mode may change in future releases!</p>
4828
4829
4830
  <h3><a id="mute">mute</a></h3>
4831
4832
  <p>Mute/unmute all sound output.</p>
4833
4834
  <div class="subsectiontitle">
4835
    usage:
4836
  </div>
4837
4838
  <table>
4839
    <tr>
4840
      <td><code>set mute</code></td>
4841
4842
      <td>Shows the current setting</td>
4843
    </tr>
4844
4845
    <tr>
4846
      <td><code>set mute on</code></td>
4847
4848
      <td>Mute sound</td>
4849
    </tr>
4850
4851
    <tr>
4852
      <td><code>set mute off</code></td>
4853
4854
      <td>Unmute sound</td>
4855
    </tr>
4856
  </table>
4857
4858
4859
  <h3><a id="noise">noise</a></h3>
4860
4861
  <p>Controls the amount of Gaussian noise that is added to the video output. A small amount of noise can give a more authentic look to the video output on TFTs. Values can be between 0 and 100, where 0 is no noise and 100 is lots of noise.</p>
4862
4863
  <p>This setting is best combined with <code><a class="internal" href="#brightness">brightness</a></code> and <code><a class="internal" href="#contrast">contrast</a></code>: noise creates small random fluctuations in the brightness of pixels. When noise is applied to pure black, it is not possible to make it any darker, so half of the time the noise is ineffective. The same happens with pure white. By setting the <code><a class="internal" href="#brightness">brightness</a></code> slightly above 0 and <code><a class="internal" href="#contrast">contrast</a></code> slightly below 0, you will get a better looking noise effect.</p>
4864
4865
  <div class="subsectiontitle">
4866
    usage:
4867
  </div>
4868
4869
  <table>
4870
    <tr>
4871
      <td><code>set noise</code></td>
4872
4873
      <td>Shows the current setting</td>
4874
    </tr>
4875
4876
    <tr>
4877
      <td><code>set noise 7</code></td>
4878
4879
      <td>Add a moderate amount of noise</td>
4880
    </tr>
4881
  </table>
4882
4883
4884
  <h3><a id="pause">pause</a></h3>
4885
4886
  <p>Pauses the emulation.</p>
4887
4888
  <div class="subsectiontitle">
4889
    usage:
4890
  </div>
4891
4892
  <table>
4893
    <tr>
4894
      <td><code>set pause</code></td>
4895
4896
      <td>Shows the current setting</td>
4897
    </tr>
4898
4899
    <tr>
4900
      <td><code>set pause on</code></td>
4901
4902
      <td>Pauses emulation</td>
4903
    </tr>
4904
4905
    <tr>
4906
      <td><code>set pause off</code></td>
4907
4908
      <td>Unpauses emulation</td>
4909
    </tr>
4910
  </table>
4911
4912
  <div class="note">
4913
    Note: Some video settings cannot be applied to an already rendered frame and will therefore not take effect until openMSX is unpaused.
4914
  </div>
4915
4916
4917
  <h3><a id="pause_on_lost_focus">pause_on_lost_focus</a></h3>
4918
4919
  <p>When this setting is enabled, the emulation will be paused when the
4920
  openMSX window loses focus.</p>
4921
4922
  <div class="subsectiontitle">
4923
    usage:
4924
  </div>
4925
4926
  <table>
4927
    <tr>
4928
      <td><code>set pause_on_lost_focus</code></td>
4929
4930
      <td>Shows the current setting</td>
4931
    </tr>
4932
4933
    <tr>
4934
      <td><code>set pause_on_lost_focus on</code></td>
4935
4936
      <td>Emulation will be paused when the openMSX window loses focus</td>
4937
    </tr>
4938
4939
    <tr>
4940
      <td><code>set pause_on_lost_focus off</code></td>
4941
4942
      <td>Emulation will continue when the openMSX window loses focus (default)</td>
4943
    </tr>
4944
  </table>
4945
4946
4947
  <h3><a id="pointer_hide_delay">pointer_hide_delay</a></h3>
4948
4949
  <p>The amount of seconds before the mouse pointer will be automatically
4950
  hidden after it got shown due to mouse activity. A negative amount means that
4951
  it will never be hidden, an amount of 0 means that it will be always hidden.
4952
  By default the pointer is hidden 1 second after the last mouse activity.</p>
4953
4954
  <div class="subsectiontitle">
4955
    usage:
4956
  </div>
4957
4958
  <table>
4959
    <tr>
4960
      <td><code>set pointer_hide_delay</code></td>
4961
4962
      <td>Shows the current setting</td>
4963
    </tr>
4964
4965
    <tr>
4966
      <td><code>set pointer_hide_delay -1</code></td>
4967
4968
      <td>Never hide the mouse pointer</td>
4969
    </tr>
4970
4971
    <tr>
4972
      <td><code>set pointer_hide_delay 0</code></td>
4973
4974
      <td>Always hide the mouse pointer</td>
4975
    </tr>
4976
4977
    <tr>
4978
      <td><code>set pointer_hide_delay 3.4</code></td>
4979
4980
      <td>Hide the mouse pointer after 3.4 seconds of inactivity</td>
4981
    </tr>
4982
  </table>
4983
4984
4985
  <h3><a id="power">power</a></h3>
4986
4987
  <p>Turn the power of the emulated MSX machine on or off.</p>
4988
4989
  <div class="subsectiontitle">
4990
    usage:
4991
  </div>
4992
4993
  <table>
4994
    <tr>
4995
      <td><code>set power</code></td>
4996
4997
      <td>Shows the current setting</td>
4998
    </tr>
4999
5000
    <tr>
5001
      <td><code>set power on</code></td>
5002
5003
      <td>Turns the MSX machine on (the default)</td>
5004
    </tr>
5005
5006
    <tr>
5007
      <td><code>set power off</code></td>
5008
5009
      <td>Turns the MSX machine off</td>
5010
    </tr>
5011
  </table>
5012
5013
5014
  <h3><a id="printerlogfilename">printerlogfilename</a></h3>
5015
5016
  <p>Sets the file to which the printer logger writes.</p>
5017
5018
  <div class="subsectiontitle">
5019
    usage:
5020
  </div>
5021
5022
  <table>
5023
    <tr>
5024
      <td><code>set printerlogfilename</code></td>
5025
5026
      <td>Shows the current setting</td>
5027
    </tr>
5028
5029
    <tr>
5030
      <td><code>set printerlogfilename myprinterlog.txt</code></td>
5031
5032
      <td>Log to "myprinterlog.txt"</td>
5033
    </tr>
5034
  </table>
5035
5036
5037
  <h3><a id="print-resolution">print-resolution</a></h3>
5038
5039
  <p>Sets the resolution (in dpi) for the emulated dot-matrix printer.</p>
5040
5041
  <p>The emulated printer 'prints' pages as PNG files. This settings determines the resolution of those images.</p>
5042
5043
  <div class="subsectiontitle">
5044
    usage:
5045
  </div>
5046
5047
  <table>
5048
    <tr>
5049
      <td><code>set print-resolution</code></td>
5050
5051
      <td>Shows the current setting</td>
5052
    </tr>
5053
5054
    <tr>
5055
      <td><code>set print-resolution 600</code></td>
5056
5057
      <td>Sets resolution to 600 dpi</td>
5058
    </tr>
5059
  </table>
5060
5061
5062
  <h3><a id="psg_detune_frequency">PSG_detune_frequency</a></h3>
5063
5064
  <p>Sets the frequency of the detune (a random variation in a sound's frequency) effect. It makes a sound fatter and more natural, as if played by a human being.
5065
  </p>
5066
5067
  <div class="subsectiontitle">
5068
    usage:
5069
  </div>
5070
5071
  <table>
5072
    <tr>
5073
      <td><code>set PSG_detune_frequency</code></td>
5074
5075
      <td>Shows the current setting</td>
5076
    </tr>
5077
5078
    <tr>
5079
      <td><code>set PSG_detune_frequency &lt;num&gt;</code></td>
5080
5081
      <td>Sets new detune frequency in Hz; 1 is minimum, 100 is maximum</td>
5082
    </tr>
5083
  </table>
5084
5085
  <div class="subsectiontitle">
5086
    examples:
5087
  </div>
5088
5089
  <div class="examples">
5090
    <code>set PSG_detune_frequency</code><br />
5091
    <code>set PSG_detune_frequency 5</code> (default)<br />
5092
  </div>
5093
5094
  <div class="note">
5095
    Note: It is often more convenient to use the <code><a class="internal" href="#psg_profile">psg_profile</a></code> command.
5096
  </div>
5097
5098
5099
  <h3><a id="psg_detune_percent">psg_detune_percent</a></h3>
5100
5101
  <p>Sets the strength of the detune effect. By default it is 0, which means the effect is switched off.
5102
  </p>
5103
5104
  <div class="subsectiontitle">
5105
    usage:
5106
  </div>
5107
5108
  <table>
5109
    <tr>
5110
      <td><code>set PSG_detune_percent</code></td>
5111
5112
      <td>Shows the current setting</td>
5113
    </tr>
5114
5115
    <tr>
5116
      <td><code>set PSG_detune_percent &lt;num&gt;</code></td>
5117
5118
      <td>Sets new detune strength; 0 is minimum, 10 is maximum</td>
5119
    </tr>
5120
  </table>
5121
5122
  <div class="subsectiontitle">
5123
    examples:
5124
  </div>
5125
5126
  <div class="examples">
5127
    <code>set PSG_detune_percent</code><br />
5128
    <code>set PSG_detune_percent 0</code> (switched off, default)<br />
5129
    <code>set PSG_detune_percent 0.5</code> (recommended)<br />
5130
  </div>
5131
5132
  <div class="note">
5133
    Note: It is often more convenient to use the <code><a class="internal" href="#psg_profile">psg_profile</a></code> command.
5134
  </div>
5135
5136
5137
  <h3><a id="psg_vibrato_frequency">PSG_vibrato_frequency</a></h3>
5138
5139
  <p>Sets the frequency of the vibrato (a periodic variation in a sound's frequency) effect.
5140
  </p>
5141
5142
  <div class="subsectiontitle">
5143
    usage:
5144
  </div>
5145
5146
  <table>
5147
    <tr>
5148
      <td><code>set PSG_vibrato_frequency</code></td>
5149
5150
      <td>Shows the current setting</td>
5151
    </tr>
5152
5153
    <tr>
5154
      <td><code>set PSG_vibrato_frequency &lt;num&gt;</code></td>
5155
5156
      <td>Sets new vibrato frequency in Hz; 1 is minimum, 10 is maximum</td>
5157
    </tr>
5158
  </table>
5159
5160
  <div class="subsectiontitle">
5161
    examples:
5162
  </div>
5163
5164
  <div class="examples">
5165
    <code>set PSG_vibrato_frequency</code><br />
5166
    <code>set PSG_vibrato_frequency 5</code> (default)<br />
5167
  </div>
5168
5169
  <div class="note">
5170
    Note: It is often more convenient to use the <code><a class="internal" href="#psg_profile">psg_profile</a></code> command.
5171
  </div>
5172
5173
5174
  <h3><a id="psg_vibrato_percent">PSG_vibrato_percent</a></h3>
5175
5176
  <p>Sets the strength of the vibrato effect. By default it is 0, which means the effect is switched off.
5177
  </p>
5178
5179
  <div class="subsectiontitle">
5180
    usage:
5181
  </div>
5182
5183
  <table>
5184
    <tr>
5185
      <td><code>set PSG_vibrato_percent</code></td>
5186
5187
      <td>Shows the current setting</td>
5188
    </tr>
5189
5190
    <tr>
5191
      <td><code>set PSG_vibrato_percent &lt;num&gt;</code></td>
5192
5193
      <td>Sets new vibrato strength; 0 is minimum, 10 is maximum</td>
5194
    </tr>
5195
  </table>
5196
5197
  <div class="subsectiontitle">
5198
    examples:
5199
  </div>
5200
5201
  <div class="examples">
5202
    <code>set PSG_vibrato_percent</code><br />
5203
    <code>set PSG_vibrato_percent 0</code> (switched off, default)<br />
5204
    <code>set PSG_vibrato_percent 1</code> (recommended)<br />
5205
  </div>
5206
5207
  <div class="note">
5208
    Note: It is often more convenient to use the <code><a class="internal" href="#psg_profile">psg_profile</a></code> command.
5209
  </div>
5210
5211
5212
  <h3><a id="r800_freq">r800_freq / r800_freq_locked</a></h3>
5213
5214
  <p>These two settings control the R800 clock frequency. See <code><a class="internal" href="#z80_freq">z80_freq / z80_freq_locked</a></code> for details.</p>
5215
5216
5217
  <h3><a id="renderer">renderer</a></h3>
5218
5219
  <p>Switch to a different video renderer. However, currently there is only one alternative: <code>none</code>, and that is useful only for disabling rendering in scripts completely.</p>
5220
5221
  <div class="subsectiontitle">
5222
    usage:
5223
  </div>
5224
5225
  <table>
5226
    <tr>
5227
      <td><code>set renderer</code></td>
5228
5229
      <td>Shows the current setting</td>
5230
    </tr>
5231
5232
    <tr>
5233
      <td><code>set renderer none</code></td>
5234
5235
      <td>Disable rendering completely</td>
5236
    </tr>
5237
  </table>
5238
5239
5240
  <h3><a id="renshaturbo">renshaturbo</a></h3>
5241
5242
  <p>Sets the speed of the built-in auto fire on some Japanese MSX models, for example the turboR machines. A value of 0 turns off auto fire, while 100 selects the most rapid auto fire.</p>
5243
5244
  <div class="subsectiontitle">
5245
    usage:
5246
  </div>
5247
5248
  <table>
5249
    <tr>
5250
      <td><code>set renshaturbo</code></td>
5251
5252
      <td>Shows the current renshaturbo value</td>
5253
    </tr>
5254
5255
    <tr>
5256
      <td><code>set renshaturbo &lt;num&gt;</code></td>
5257
5258
      <td>Sets speed to value &lt;num&gt;</td>
5259
    </tr>
5260
  </table>
5261
5262
  <div class="note">
5263
    Note: This setting is only available if the current MSX machine has hardware Ren-Sha Turbo support.
5264
  </div>
5265
5266
5267
  <h3><a id="resampler">resampler</a></h3>
5268
5269
  <p>Sets the method to resample the sound of sound chips from their native frequency to the <a class="internal" href="#frequency">desired output frequency</a>.</p>
5270
5271
  <div class="subsectiontitle">
5272
    usage:
5273
  </div>
5274
5275
  <table>
5276
    <tr>
5277
      <td><code>set resampler</code></td>
5278
5279
      <td>Shows the currently active resampler</td>
5280
    </tr>
5281
5282
    <tr>
5283
      <td><code>set resampler blip</code></td>
5284
5285
      <td>Sets the <a href="http://slack.net/~ant/libs/audio.html#Blip_Buffer">Blip_Buffer</a> based resampler, which has the best quality per CPU usage ratio.</td>
5286
    </tr>
5287
5288
    <tr>
5289
      <td><code>set resampler hq</code></td>
5290
5291
      <td>Sets the highest quality resampler, but it also takes the most CPU time. It's based on the <a href="http://www.mega-nerd.com/SRC/">libsamplerate</a> algorithm. This is the default value on most platforms, as it gives the best quality.</td>
5292
    </tr>
5293
  </table>
5294
5295
5296
  <h3><a id="rs232-inputfilename">rs232-inputfilename</a></h3>
5297
5298
  <p>Sets the file from which the RS232-tester reads data. Note that the
5299
  <code>rs232-tester</code> has to be plugged in the <code>msx-rs232</code>
5300
  connector for this to become useful. When plugging the tester, this setting
5301
  needs to point to a valid file.</p>
5302
5303
  <div class="subsectiontitle">
5304
    usage:
5305
  </div>
5306
5307
  <table>
5308
    <tr>
5309
      <td><code>set rs232-inputfilename</code></td>
5310
5311
      <td>Shows the current setting</td>
5312
    </tr>
5313
5314
    <tr>
5315
      <td><code>set rs232-inputfilename myrs232input.txt</code></td>
5316
5317
      <td>Reads from "myrs232input.txt"</td>
5318
    </tr>
5319
  </table>
5320
5321
5322
  <h3><a id="rs232-outputfilename">rs232-outputfilename</a></h3>
5323
5324
  <p>Sets the file to which the RS232-tester writes the data. Note that the
5325
  <code>rs232-tester</code> has to be plugged in the <code>msx-rs232</code>
5326
  connector for this to become useful. When plugging the tester, this setting
5327
  needs to point to a valid file.</p>
5328
5329
  <div class="subsectiontitle">
5330
    usage:
5331
  </div>
5332
5333
  <table>
5334
    <tr>
5335
      <td><code>set rs232-outputfilename</code></td>
5336
5337
      <td>Shows the current setting</td>
5338
    </tr>
5339
5340
    <tr>
5341
      <td><code>set rs232-outputfilename myrs232output.txt</code></td>
5342
5343
      <td>Write to "myrs232output.txt"</td>
5344
    </tr>
5345
  </table>
5346
5347
5348
  <h3><a id="rs232-net-address">rs232-net-address</a></h3>
5349
5350
  <p>Sets the ip address (or hostname) and port for the RS232-Net pluggable. Note that
5351
  <code>rs232-net</code> has to be plugged in the <code>msx-rs232</code>
5352
  connector for this to become useful. This setting
5353
  needs to point to a valid host at the moment of plugging it.</p>
5354
  <p>The address must follow one of the following syntaxes:</p>
5355
  <ul>
5356
    <li><strong>hostname</strong> e.g.: abc.com</li>
5357
    <li><strong>hostname:port</strong> e.g.: abc.com:23</li>
5358
    <li><strong>ipv4</strong> e.g.: 127.0.0.1</li>
5359
    <li><strong>ipv4:port</strong> e.g.: 127.0.0.1:2323</li>
5360
    <li><strong>ipv6</strong> e.g.: ::1</li>
5361
    <li><strong>[ipv6]:port</strong> e.g.: [::1]:8080</li>
5362
  </ul>
5363
5364
  <div class="subsectiontitle">
5365
    usage:
5366
  </div>
5367
5368
  <table>
5369
    <tr>
5370
      <td><code>set rs232-net-address</code></td>
5371
5372
      <td>Shows the current setting</td>
5373
    </tr>
5374
5375
    <tr>
5376
      <td><code>set rs232-net-address mytelnetbbs.net:23</code></td>
5377
5378
      <td>Connects to "mytelnetbbs.net" on port 23</td>
5379
    </tr>
5380
  </table>
5381
5382
5383
  <h3><a id="rs232-net-ip232">rs232-net-ip232</a></h3>
5384
5385
  <p>Enable the use of the IP232 protocol when used in conjunction with the <code>TCPSer</code> software modem. Note that
5386
  <code>rs232-net</code> has to be plugged in the <code>msx-rs232</code>
5387
  connector and <code>rs232-net-address</code> must point to the ip address and port of a running TCPSer instance.</p>
5388
  <p>The IP232 protocol permits the correct emulation of some of the RS-232 port control lines.</p>
5389
  <p>This setting must be disabled when using <code>rs232net</code> without <code>TCPSer</code>.</p>
5390
5391
  <div class="subsectiontitle">
5392
    usage:
5393
  </div>
5394
5395
  <table>
5396
    <tr>
5397
      <td><code>set rs232-net-ip232</code></td>
5398
5399
      <td>Shows the current setting</td>
5400
    </tr>
5401
5402
    <tr>
5403
      <td><code>set rs232-net-ip232 on</code></td>
5404
5405
      <td>Enable the IP232 protocol</td>
5406
    </tr>
5407
5408
    <tr>
5409
      <td><code>set rs232-net-ip232 off</code></td>
5410
5411
      <td>Disable the IP232 protocol</td>
5412
    </tr>
5413
5414
  </table>
5415
5416
5417
  <h3><a id="rtcmode">rtcmode</a></h3>
5418
5419
  <p>Sets the Real Time Clock mode. Can be either <code>RealTime</code> or <code>EmuTime</code>.</p>
5420
5421
  <p>In <code>RealTime</code> mode the MSX clock is always synchronized with the host clock, even when for example emulation is paused for a while or when emulation is run at 200% of real speed.</p>
5422
5423
  <p>In <code>EmuTime</code> mode the time is only synchronized with the host clock when openMSX starts. From then on the clock ticks at the same pace as the emulated machine. So when emulation is paused, the clock is paused as well. If emulation is run at 200% speed, the clock also ticks twice as fast.</p>
5424
5425
  <p>In <code>EmuTime</code> mode it's not possible for an MSX program to detect whether it's running on a real or on an emulated machine. That's why this is the default mode. On the other hand the <code>RealTime</code> mode might be better if for example you care that timestamps of files written by the emulated MSX machine are in sync with the host machine time.</p>
5426
5427
  <div class="subsectiontitle">
5428
    usage:
5429
  </div>
5430
5431
  <table>
5432
    <tr>
5433
      <td><code>set rtcmode</code></td>
5434
5435
      <td>Shows the current mode</td>
5436
    </tr>
5437
5438
    <tr>
5439
      <td><code>set rtcmode EmuTime</code></td>
5440
5441
      <td>Set EmuTime mode (the default)</td>
5442
    </tr>
5443
5444
    <tr>
5445
      <td><code>set rtcmode RealTime</code></td>
5446
5447
      <td>Set RealTime mode</td>
5448
    </tr>
5449
  </table>
5450
5451
5452
  <h3><a id="samples">samples</a></h3>
5453
5454
  <p>Sets the size of the sound mixer buffer. Higher values help against buffer underruns (hickups), but increase the latency of the sound output.</p>
5455
5456
  <div class="subsectiontitle">
5457
    usage:
5458
  </div>
5459
5460
  <table>
5461
    <tr>
5462
      <td><code>set samples</code></td>
5463
5464
      <td>Shows the current setting</td>
5465
    </tr>
5466
5467
    <tr>
5468
      <td><code>set samples 1024</code></td>
5469
5470
      <td>Use a mixing buffer of 1024 samples</td>
5471
    </tr>
5472
  </table>
5473
5474
5475
  <h3><a id="save_settings_on_exit">save_settings_on_exit</a></h3>
5476
5477
  <p>Automatically save the current settings when openMSX exits: execute a <code><a class="internal" href="#save_settings">save_settings</a></code> command on exit.</p>
5478
5479
  <div class="subsectiontitle">
5480
    usage:
5481
  </div>
5482
5483
  <table>
5484
    <tr>
5485
      <td><code>set save_settings_on_exit</code></td>
5486
5487
      <td>Show current setting</td>
5488
    </tr>
5489
5490
    <tr>
5491
      <td><code>set save_settings_on_exit on</code></td>
5492
5493
      <td>Enable auto save</td>
5494
    </tr>
5495
5496
    <tr>
5497
      <td><code>set save_settings_on_exit off</code></td>
5498
5499
      <td>Disable auto save</td>
5500
    </tr>
5501
  </table>
5502
5503
5504
  <h3><a id="save_setup_at_exit_name">save_setup_at_exit_name</a></h3>
5505
5506
  <p>Specify the setup name to use when automatically saving the setup when exiting openMSX is active. See also the <code><a class="internal" href="#save_setup_at_exit_depth">save_setup_at_exit_depth</a></code> setting.</p>
5507
5508
  <p>In the GUI, under <span class="menu-reference">Main menu bar &rarr; Machine
5509
  &rarr; Setup settings</span> you can also configure what openMSX must do at startup, configuring this setting there.</p>
5510
5511
  <div class="subsectiontitle">
5512
    usage:
5513
  </div>
5514
5515
  <table>
5516
    <tr>
5517
      <td><code>set save_setup_at_exit_name</code></td>
5518
5519
      <td>Show current setting</td>
5520
    </tr>
5521
5522
    <tr>
5523
      <td><code>set save_setup_at_exit_name last_used</code></td>
5524
5525
      <td>Set the setup name to be used for auto-save at exit to <code>last_used</code></td>
5526
    </tr>
5527
5528
  </table>
5529
5530
5531
  <h3><a id="save_setup_at_exit_depth">save_setup_at_exit_depth</a></h3>
5532
5533
  <p>Specify the depth to use when automatically saving the setup when exiting openMSX. If the depth is set to <code>none</code> (which is the default), the auto-save is not active, but otherwise the setup will be saved under the name specified by the <code><a class="internal" href="#save_setup_at_exit_name">save_setup_at_exit_name</a></code> setting. See also the <code><a class="internal" href="#store_setup">store_setup</a></code> command to find out about other depths that can be specified.</p>
5534
5535
  <p>In the GUI, under <span class="menu-reference">Main menu bar &rarr; Machine
5536
  &rarr; Setup settings</span> you can also configure what openMSX must do at startup, configuring this setting there.</p>
5537
5538
  <div class="subsectiontitle">
5539
    usage:
5540
  </div>
5541
5542
  <table>
5543
    <tr>
5544
      <td><code>set save_setup_at_exit_depth</code></td>
5545
5546
      <td>Show current setting</td>
5547
    </tr>
5548
5549
    <tr>
5550
      <td><code>set save_setup_at_exit_depth extensions</code></td>
5551
5552
      <td>When openMSX exits, the current setup is saved including all extensions in the machine.</td>
5553
    </tr>
5554
5555
    <tr>
5556
      <td><code>set save_setup_at_exit_depth complete_state</code></td>
5557
5558
      <td>When openMSX exits, the complete state is saved into the setup.</td>
5559
    </tr>
5560
5561
  </table>
5562
5563
  <div class="note">
5564
    If you enable this auto save of the setup and use the same name as for the <code><a class="internal" href="#default_setup">default_setup</a></code> setting, openMSX will automatically continue with the last setup when being started up again (and no other machine or setup is specified).
5565
  </div>
5566
5567
5568
  <h3><a id="scale_algorithm">scale_algorithm</a></h3>
5569
5570
  <p>Selects the algorithm used to transform MSX pixels to host pixels. The User's Manual contains <a class="external" href="user.html#scalers">more information about scalers</a>.
5571
  </p>
5572
5573
  <div class="subsectiontitle">
5574
    usage:
5575
  </div>
5576
5577
  <table>
5578
    <tr>
5579
      <td><code>set scale_algorithm</code></td>
5580
5581
      <td>Shows the current setting</td>
5582
    </tr>
5583
5584
    <tr>
5585
      <td><code>set scale_algorithm simple</code></td>
5586
5587
      <td>Selects the default scale algorithm</td>
5588
    </tr>
5589
5590
    <tr>
5591
      <td><code>set scale_algorithm hq</code></td>
5592
5593
      <td>Selects the HQ2x/3x/4x scale algorithm</td>
5594
    </tr>
5595
  </table>
5596
5597
5598
  <h3><a id="scale_factor">scale_factor</a></h3>
5599
5600
  <p>Selects the scale factor. Scale factor &lt;n&gt; means the typical MSX pixel (MSX resolution 256&times;212) is mapped on &lt;n&gt; by &lt;n&gt; host pixels. For the moment the possible values are 2 to 4. In the future we may support a wider range or even non-integer values. The User's Manual contains <a class="external" href="user.html#scalers">more information about scalers</a>.</p>
5601
5602
  <div class="subsectiontitle">
5603
    usage:
5604
  </div>
5605
5606
  <table>
5607
    <tr>
5608
      <td><code>set scale_factor</code></td>
5609
5610
      <td>Shows the current setting</td>
5611
    </tr>
5612
5613
    <tr>
5614
      <td><code>set scale_factor &lt;n&gt;</code></td>
5615
5616
      <td>Sets a new scale factor</td>
5617
    </tr>
5618
  </table>
5619
5620
5621
  <h3><a id="scanline">scanline</a></h3>
5622
5623
  <p>Sets the amount of scanline effect.</p>
5624
5625
  <div class="subsectiontitle">
5626
    usage:
5627
  </div>
5628
5629
  <table>
5630
    <tr>
5631
      <td><code>set scanline</code></td>
5632
5633
      <td>Shows the current setting</td>
5634
    </tr>
5635
5636
    <tr>
5637
      <td><code>set scanline &lt;value&gt;</code></td>
5638
5639
      <td>Changes the value</td>
5640
    </tr>
5641
  </table>
5642
5643
  <div class="note">
5644
    Note: Some scalers will not render scanlines at all.
5645
  </div>
5646
5647
5648
  <h3><a id="sound_driver">sound_driver</a></h3>
5649
5650
  <p>Select the sound output driver.</p>
5651
5652
  <div class="subsectiontitle">
5653
    usage:
5654
  </div>
5655
5656
  <table>
5657
    <tr>
5658
      <td><code>set sound_driver sdl</code></td>
5659
5660
      <td>Selects the SDL sound driver</td>
5661
    </tr>
5662
5663
    <tr>
5664
      <td><code>set sound_driver null</code></td>
5665
5666
      <td>Selects the null sound driver (no sound)</td>
5667
    </tr>
5668
  </table>
5669
5670
5671
  <h3><a id="speed">speed</a></h3>
5672
5673
  <p>Sets the emulation speed relative to the speed of a real MSX. Speed 100 means as fast as a real MSX, lower values are slower than real MSX, higher values are faster than real MSX.</p>
5674
5675
  <div class="subsectiontitle">
5676
    usage:
5677
  </div>
5678
5679
  <table>
5680
    <tr>
5681
      <td><code>set speed</code></td>
5682
5683
      <td>Shows current emulation speed</td>
5684
    </tr>
5685
5686
    <tr>
5687
      <td><code>set speed &lt;num&gt;</code></td>
5688
5689
      <td>Sets new emulation speed to &lt;num&gt;% of real time</td>
5690
    </tr>
5691
  </table>
5692
5693
5694
  <h3><a id="soundchip_balance">&lt;soundchip&gt;_balance</a></h3>
5695
5696
  <p>Sets the balance (distribution over the left and right channel) for individual sound chips. It replaces the previously available <code>&lt;soundchip&gt;_mode</code> setting. The range is between -100 (totally left) and 100 (totally right).</p>
5697
5698
  <div class="subsectiontitle">
5699
    usage:
5700
  </div>
5701
5702
  <table>
5703
    <tr>
5704
      <td><code>set &lt;soundchip&gt;_balance</code></td>
5705
5706
      <td>Shows the current setting</td>
5707
    </tr>
5708
5709
    <tr>
5710
      <td><code>set &lt;soundchip&gt;_balance 0</code></td>
5711
5712
      <td>Plays the output of this chip on both the left and right channel</td>
5713
    </tr>
5714
5715
    <tr>
5716
      <td><code>set &lt;soundchip&gt;_balance -100</code></td>
5717
5718
      <td>Plays the output of this chip on only the left channel</td>
5719
    </tr>
5720
5721
    <tr>
5722
      <td><code>set &lt;soundchip&gt;_balance 75</code></td>
5723
5724
      <td>Plays the output of this chip mostly on the right channel, but also a bit on the left channel</td>
5725
    </tr>
5726
  </table>
5727
5728
  <div class="subsectiontitle">
5729
    examples:
5730
  </div>
5731
5732
  <div class="examples">
5733
    <code>set PSG_balance</code><br />
5734
    <code>set PSG_balance -100</code><br />
5735
    <code>set FMPAC_balance 0</code>
5736
  </div>
5737
5738
5739
  <h3><a id="soundchip_channel_record">&lt;soundchip&gt;_ch&lt;channel&gt;_record</a></h3>
5740
5741
  <p>Sets the filename to which the sound of an individual channel of
5742
  individual sound chips should be recorded. When this setting is not set, no
5743
  recording takes place and recording starts as soon as the setting is set.
5744
  Normally, you would probably prefer to use the <code><a class="internal"
5745
  href="#record_channels">record_channels</a></code> command to set up channel
5746
  recording instead of this low level setting.</p>
5747
5748
  <div class="subsectiontitle">
5749
    usage:
5750
  </div>
5751
5752
  <table>
5753
    <tr>
5754
      <td><code>set &lt;soundchip&gt;_ch&lt;channel&gt;_record</code></td>
5755
5756
      <td>Shows the current setting</td>
5757
    </tr>
5758
5759
    <tr>
5760
      <td><code>set &lt;soundchip&gt;_ch&lt;channel&gt;_record filename</code></td>
5761
5762
      <td>Starts recording the sound of the specified chip and channel to the file with name &lt;filename&gt;</td>
5763
    </tr>
5764
5765
  </table>
5766
5767
  <div class="subsectiontitle">
5768
    examples:
5769
  </div>
5770
5771
  <div class="examples">
5772
    <code>set SCC_ch1_record</code><br />
5773
    <code>set PSG_ch3_record /tmp/PSG_ch3.wav</code>
5774
  </div>
5775
5776
5777
  <h3><a id="soundchip_channel_mute">&lt;soundchip&gt;_ch&lt;channel&gt;_mute</a></h3>
5778
5779
  <p>Use to mute a specific channel of an individual sound chip.
5780
  Normally, you would probably prefer to use the <code><a class="internal"
5781
  href="#mute_channels">mute_channels</a></code> command to set up channel
5782
  muting instead of this low level setting.</p>
5783
5784
  <div class="subsectiontitle">
5785
    usage:
5786
  </div>
5787
5788
  <table>
5789
    <tr>
5790
      <td><code>set &lt;soundchip&gt;_ch&lt;channel&gt;_mute</code></td>
5791
5792
      <td>Shows the current setting</td>
5793
    </tr>
5794
5795
    <tr>
5796
      <td><code>set &lt;soundchip&gt;_ch&lt;channel&gt;_mute on</code></td>
5797
5798
      <td>Mutes the sound of the specified channel of the specified chip</td>
5799
    </tr>
5800
5801
    <tr>
5802
      <td><code>set &lt;soundchip&gt;_ch&lt;channel&gt;_mute off</code></td>
5803
5804
      <td>Unmutes the sound of the specified channel of the specified chip</td>
5805
    </tr>
5806
5807
  </table>
5808
5809
  <div class="subsectiontitle">
5810
    examples:
5811
  </div>
5812
5813
  <div class="examples">
5814
    <code>set SCC_ch1_mute</code><br />
5815
    <code>set PSG_ch3_mute on</code><br />
5816
    <code>set SCC_ch5_mute off</code>
5817
  </div>
5818
5819
5820
  <h3><a id="soundchip_volume">&lt;soundchip&gt;_volume</a></h3>
5821
5822
  <p>Sets the volume for individual sound chips. The overall volume is controlled by the <code><a class="internal" href="#master_volume">master_volume</a></code> setting.
5823
  </p>
5824
5825
  <div class="subsectiontitle">
5826
    usage:
5827
  </div>
5828
5829
  <table>
5830
    <tr>
5831
      <td><code>set &lt;soundchip&gt;_volume</code></td>
5832
5833
      <td>Shows the current setting</td>
5834
    </tr>
5835
5836
    <tr>
5837
      <td><code>set &lt;soundchip&gt;_volume &lt;num&gt;</code></td>
5838
5839
      <td>Sets new volume; 0 is off, 100 is maximum</td>
5840
    </tr>
5841
  </table>
5842
5843
  <div class="subsectiontitle">
5844
    examples:
5845
  </div>
5846
5847
  <div class="examples">
5848
    <code>set PSG_volume</code><br />
5849
    <code>set PSG_volume 60</code><br />
5850
    <code>set "FMPAC_volume" 50</code>
5851
  </div>
5852
5853
5854
  <h3><a id="throttle">throttle</a></h3>
5855
5856
  <p>Sets throttle mode. In throttle mode the emulator tries to run at the specified speed relative to a real MSX (see <a class="internal" href="#speed">speed</a> command). When throttling is turned off the emulator runs as fast as possible.</p>
5857
5858
  <div class="subsectiontitle">
5859
    usage:
5860
  </div>
5861
5862
  <table>
5863
    <tr>
5864
      <td><code>set throttle</code></td>
5865
5866
      <td>Shows the current setting</td>
5867
    </tr>
5868
5869
    <tr>
5870
      <td><code>set throttle on</code></td>
5871
5872
      <td>Turn throttle mode on (normal operation)</td>
5873
    </tr>
5874
5875
    <tr>
5876
      <td><code>set throttle off</code></td>
5877
5878
      <td>Turn throttle mode off (fast forward)</td>
5879
    </tr>
5880
  </table>
5881
5882
5883
  <h3><a id="too_fast_vram_access">too_fast_vram_access</a></h3>
5884
5885
  <p>How should software that accesses the VDP-VRAM too fast be emulated?
5886
  Most existing MSX software should not access VRAM too fast, and in that case
5887
  this setting has no effect. But you may want to change it when you e.g.
5888
  emulate an overclocked Z80 (see <a class="internal" href="#z80_freq">
5889
  z80_freq</a>).</p>
5890
5891
  <div class="subsectiontitle">
5892
    usage:
5893
  </div>
5894
5895
  <table>
5896
    <tr>
5897
      <td><code>set too_fast_vram_access</code></td>
5898
      <td>Shows the current setting</td>
5899
    </tr>
5900
    <tr>
5901
      <td><code>set too_fast_vram_access real</code></td>
5902
      <td>Accessing the VRAM too fast results in dropped VRAM accesses, just like on a real machine.</td>
5903
    </tr>
5904
    <tr>
5905
      <td><code>set too_fast_vram_access ignore</code></td>
5906
      <td>All VRAM accesses are executed, so timing of VRAM access is ignored.</td>
5907
    </tr>
5908
  </table>
5909
5910
5911
  <h3><a id="too_fast_vram_access_callback">VDP.too_fast_vram_access_callback</a></h3>
5912
5913
  <p>Selects the Tcl procedure to be called when a too-fast-VRAM-access (read
5914
  or write) has been detected. This is useful for debugging MSX programs that
5915
  show certain kinds of VRAM corruption, especially on MSX1.</p>
5916
5917
  <p>By default this setting is empty, which means that nothing is done when a
5918
  too-fast-VRAM-access is detected. We ship a few example procedures called
5919
  <code>warn_too_fast_vram_access</code> and
5920
  <code>debug_too_fast_vram_access</code> which respectively print a warning or
5921
  break CPU emulation when this condition occurs. You can find the source code
5922
  for these procedures in <code>scripts/callbackprocs.tcl</code>. Feel free to
5923
  write your own procedure that does exactly what you need.</p>
5924
5925
  <div class="subsectiontitle">
5926
    usage:
5927
  </div>
5928
  <table>
5929
    <tr>
5930
      <td><code>set VDP.too_fast_vram_access_callback</code></td>
5931
      <td>Shows the currently installed callback</td>
5932
    </tr>
5933
    <tr>
5934
      <td><code>set VDP.too_fast_vram_access_callback warn_too_fast_vram_access</code></td>
5935
      <td>Print warning when too fast VRAM access is detected</td>
5936
    </tr>
5937
    <tr>
5938
      <td><code>set VDP.too_fast_vram_access_callback debug_too_fast_vram_access</code></td>
5939
      <td>Print warning and also break emulation right after the Z80 instruction that triggered this callback</td>
5940
    </tr>
5941
    <tr>
5942
      <td><code>set VDP.too_fast_vram_access_callback my_custom_callback_handler</code></td>
5943
      <td>Install a custom callback handler</td>
5944
    </tr>
5945
    <tr>
5946
      <td><code>set VDP.too_fast_vram_access_callback ""</code></td>
5947
      <td>Remove any installed callback handler</td>
5948
    </tr>
5949
  </table>
5950
5951
5952
  <h3><a id="touchpad_transform_matrix">touchpad_transform_matrix</a></h3>
5953
5954
  <p>Specify a 2&times;3 transformation matrix that maps host mouse coordinates
5955
  to MSX touchpad coordinates.
5956
  To get the following coordinate transformation:</p>
5957
  <pre>
5958
        | a b c |   | host-X |   | touchpad-X |
5959
        | d e f | &times; | host-Y | = | touchpad-Y |
5960
                    |    1   |
5961
  </pre>
5962
  <p>Use this command:</p>
5963
  <pre>
5964
        set touchpad_transform_matrix {{a b c} {d e f}}
5965
  </pre>
5966
5967
  <div class="subsectiontitle">
5968
    usage:
5969
  </div>
5970
  <table>
5971
    <tr>
5972
      <td><code>set touchpad_transform_matrix</code></td>
5973
      <td>Shows the current value</td>
5974
    </tr>
5975
    <tr>
5976
      <td><code>set touchpad_transform_matrix {{256 0 0} {0 256 0}}</code></td>
5977
      <td>This is the default, map the full host window to 256&times;256 touchpad input</td>
5978
    </tr>
5979
    <tr>
5980
      <td><code>set touchpad_transform_matrix {{320 0 -64} {0 240 -14}}</code></td>
5981
      <td>Attempt to map touch coordinates to corresponding MSX pixel coordinates.</td>
5982
    </tr>
5983
  </table>
5984
5985
<!-- TODO write Tcl scripts to setup this matrix
5986
  <div class="note">
5987
    Note: It is often more convenient to use the <code><a class="internal" href="#monitor_type">monitor_type</a></code> command.
5988
  </div>
5989
-->
5990
5991
  <h3><a id="turborpause">turborpause</a></h3>
5992
5993
  <p>Controls the pause key on an MSX turboR machine.</p>
5994
5995
  <div class="subsectiontitle">
5996
    usage:
5997
  </div>
5998
5999
  <table>
6000
    <tr>
6001
      <td><code>set turborpause</code></td>
6002
6003
      <td>Shows the current setting</td>
6004
    </tr>
6005
6006
    <tr>
6007
      <td><code>set turborpause on</code></td>
6008
6009
      <td>Activate the pause key</td>
6010
    </tr>
6011
6012
    <tr>
6013
      <td><code>set turborpause off</code></td>
6014
6015
      <td>Deactivate the pause key</td>
6016
    </tr>
6017
  </table>
6018
6019
  <div class="note">
6020
    Note: If you use this setting often, it may be useful to bind it to a key on your PC keyboard. See the <code><a class="internal" href="#bind">bind</a></code> and <code><a class="internal" href="#toggle">toggle</a></code> commands.
6021
  </div>
6022
6023
6024
  <h3><a id="umr_callback">umr_callback</a></h3>
6025
6026
  <p>Selects the Tcl procedure to be called when an Uninitialized Memory Read has been detected. This is useful for debugging MSX programs: uninitialized memory is not guaranteed to have any particular value, so reading it is most likely a bug.</p>
6027
6028
  <p>By default this setting is empty, which means that nothing is done when an Uninitialized Memory Read is detected. We ship a useful procedure called <code>umrcallback</code> which logs all UMRs. You can activate it with <code>set umr_callback umrcallback</code>. You can find the source code for this procedure in <code>scripts/callbackprocs.tcl</code>.</p>
6029
6030
  <div class="subsectiontitle">
6031
    usage:
6032
  </div>
6033
  <table>
6034
    <tr>
6035
      <td><code>set umr_callback</code></td>
6036
      <td>Shows the current UMR callback setting</td>
6037
    </tr>
6038
    <tr>
6039
      <td><code>set umr_callback umrcallback</code></td>
6040
      <td>Sets callback proc to <code>umrcallback</code></td>
6041
    </tr>
6042
  </table>
6043
6044
6045
  <h3><a id="vdpcmdinprogress_callback">vdpcmdinprogress_callback</a></h3>
6046
6047
  <p>Selects the Tcl procedure to be called when a write to a VDP command engine register is detected while there is still a VDP command in progress. Often this is an indication of a bug in the running MSX program. Note that writes to VDP register R#44 with a command in progress are normal behaviour, so the callback is not triggered for such writes.</p>
6048
6049
  <p>By default this setting is empty, which means that nothing is done when a suspicious VDP command engine write is detected. We ship an example proc called <code>vdpcmdinprogresscallback</code> which simply logs all occurrences. You can activate it with <code>set vdpcmdinprogress_callback vdpcmdinprogresscallback</code>. You can find the source code for this proc in <code>scripts/callbackprocs.tcl</code>. Feel free to write your own proc that does exactly what you need. For example it might be a good idea to execute <code>debug break</code> in your callback, so that you can easily examine what code triggered this write.</p>
6050
6051
  <div class="subsectiontitle">
6052
    usage:
6053
  </div>
6054
  <table>
6055
    <tr>
6056
      <td><code>set vdpcmdinprogress_callback</code></td>
6057
      <td>Shows the current value. Default is "" (meaning no action)</td>
6058
    </tr>
6059
    <tr>
6060
      <td><code>set vdpcmdinprogress_callback vdpcmdinprogresscallback</code></td>
6061
      <td>Sets callback to <code>vdpcmdinprogresscallback</code></td>
6062
    </tr>
6063
  </table>
6064
6065
6066
  <h3><a id="vdpcmdtrace">vdpcmdtrace</a></h3>
6067
6068
  <p>Enable/disable VDP command tracing. When enabled, every VDP command is logged on stdout. This is useful when debugging MSX programs that use the VDP command engine.</p>
6069
6070
  <div class="subsectiontitle">
6071
    usage:
6072
  </div>
6073
6074
  <table>
6075
    <tr>
6076
      <td><code>set vdpcmdtrace</code></td>
6077
6078
      <td>Shows the current setting</td>
6079
    </tr>
6080
6081
    <tr>
6082
      <td><code>set vdpcmdtrace on</code></td>
6083
6084
      <td>Enables VDP command tracing</td>
6085
    </tr>
6086
6087
    <tr>
6088
      <td><code>set vdpcmdtrace off</code></td>
6089
6090
      <td>Disables VDP command tracing</td>
6091
    </tr>
6092
  </table>
6093
6094
6095
  <h3><a id="videosource">videosource</a></h3>
6096
6097
  <p>Switch between video sources: <code>MSX</code> (V99x8, default when no
6098
    Video 9000 is available), <code>GFX9000</code> (V9990),
6099
    <code>Video9000</code> (V9990 superimposed on top of V99x8, default if
6100
    available) and <code>Laserdisc</code> (for Palcom machines). There can be
6101
    even more video sources, e.g. offered by cartridges with a built-in VDP such as the Neos MA-20(V).
6102
  </p>
6103
6104
  <div class="subsectiontitle">
6105
    usage:
6106
  </div>
6107
6108
  <table>
6109
    <tr>
6110
      <td><code>set videosource</code></td>
6111
6112
      <td>Shows the current setting</td>
6113
    </tr>
6114
6115
    <tr>
6116
      <td><code>set videosource MSX</code></td>
6117
6118
      <td>Switch to normal MSX screen</td>
6119
    </tr>
6120
6121
    <tr>
6122
      <td><code>set videosource GFX9000</code></td>
6123
6124
      <td>Switch to GFX9000 screen</td>
6125
    </tr>
6126
  </table>
6127
6128
  <div class="note">
6129
    Note: This setting is only available if multiple video sources are present.
6130
  </div>
6131
6132
6133
  <h3><a id="vsync">vsync</a></h3>
6134
6135
  <p>Enables or disables vsync. This setting determines whether MSX frame rendering should be synchronized to your host monitors frame rate (e.g. 60fps).</p>
6136
  <p>The default value is not to synchronize ("<code>off</code>"). When enabled, adaptive vsync is attempted if your hardware and driver support it, which means that if a frame is too late, it will be output immediately anyway. If not supported, normal vsync will be used, which may mean a frame is output later, when the sync is missed.</p>
6137
  <p>Enable this if your MSX is running at about the same frame rate as your monitor (e.g. 60Hz MSX output on a 60Hz host monitor) and you want to avoid (or reduce) tearing, which can be quite visible in smooth horizontal scrolling demos. Keep in mind <a class="internal" href="#throttle">throttle mode</a> off works a bit differently if vsync is enabled (see there).</p>
6138
6139
  <div class="subsectiontitle">
6140
    usage:
6141
  </div>
6142
6143
  <table>
6144
    <tr>
6145
      <td><code>set vsync</code></td>
6146
6147
      <td>Shows the current setting</td>
6148
    </tr>
6149
6150
    <tr>
6151
      <td><code>set vsync off</code></td>
6152
6153
      <td>No synchronization to monitor frame rate: draw immediately</td>
6154
    </tr>
6155
6156
    <tr>
6157
      <td><code>set vsync on</code></td>
6158
6159
      <td>Synchronize to monitor frame rate when possible, otherwise draw immediately. Or, when this is not available on the host hardware/driver, synchronize to monitor frame rate always (default)</td>
6160
    </tr>
6161
6162
  </table>
6163
6164
6165
  <h3><a id="v9990cmdtrace">v9990cmdtrace</a></h3>
6166
6167
  <p>Enable/disable V9990 command tracing. This is the V9990 equivalent of <code><a class="internal" href="#vdpcmdtrace">vdpcmdtrace</a></code>.</p>
6168
6169
  <div class="subsectiontitle">
6170
    usage:
6171
  </div>
6172
6173
  <table>
6174
    <tr>
6175
      <td><code>set v9990cmdtrace</code></td>
6176
6177
      <td>Shows the current setting</td>
6178
    </tr>
6179
6180
    <tr>
6181
      <td><code>set v9990cmdtrace on</code></td>
6182
6183
      <td>Enables V9990 command tracing</td>
6184
    </tr>
6185
6186
    <tr>
6187
      <td><code>set v9990cmdtrace off</code></td>
6188
6189
      <td>Disables V9990 command tracing</td>
6190
    </tr>
6191
  </table>
6192
6193
  <div class="note">
6194
   Note: This setting is only available if the <code>gfx9000</code> or
6195
   <code>video9000</code> extension is present.
6196
  </div>
6197
6198
6199
  <h3><a id="z80_freq">z80_freq / z80_freq_locked</a></h3>
6200
6201
  <p>These two settings control the Z80 clock frequency. When <code>z80_freq_locked</code> is true the emulated Z80 runs at the normal 3.579545 MHz (or possibly 5.369318 MHz on machines that are able to switch the CPU to 'turbo' mode, e.g. the Panasonic MSX2+ models). When <code>z80_freq_locked</code> is false the value of <code>z80_freq</code> is taken as the Z80 clock frequency. Note: the value of  <code>z80_freq</code> is by default the MSX Z80 standard of 3579545, so when <code>z80_freq</code> is untouched, setting <code>z80_freq_locked</code> to false will set the clock frequency of a CPU in 5.37 Mhz turbo mode back to 3.58 Mhz.</p>
6202
6203
  <p>WARNING: be careful when changing these settings. When saving the settings in which a different clock is activated, this will be applied for all machines, as these are global settings. Some software (like demos) may stop working properly with a changed CPU clock frequency. Specifically, using a value (just) below the normal value may cause problems loading CAS images, as these are converted to a high baud rate WAV file internally and when the MSX becomes slower it cannot handle that high baud rate.</p>
6204
6205
  <div class="subsectiontitle">
6206
    examples:
6207
  </div>
6208
6209
  <div class="examples">
6210
    Overclock Z80 to 14 MHz:<br />
6211
    <code>set z80_freq 14318180</code><br />
6212
    <code>set z80_freq_locked false</code><br />
6213
    <br />
6214
    F8 switches between 3.5 MHz and 7 MHz:<br />
6215
    <code>set z80_freq 7159090</code><br />
6216
    <code>bind F8 "toggle z80_freq_locked"</code><br />
6217
  </div>
6218
6219
6220
  <h3><a id="othersettings">other settings</a></h3>
6221
6222
  <p>Like with the commands, there are also some specialized settings, for which we only list a very brief overview. As always execute "<code>help setting &lt;setting-name&gt;</code>" to get a more detailed description of the setting.</p>
6223
6224
  <table>
6225
    <tr>
6226
      <td><code>fast_cas_load_hack_enabled</code></td>
6227
      <td>Enable a hack that lets you quickly load CAS files, without having openMSX convert them to WAV</td>
6228
    </tr>
6229
  </table>
6230
6231
  <p>The source code of all these scripts is located in <code>share/scripts</code> directory. Feel free to inspect these scripts and modify them to suit your needs.</p>
6232
6233
 </body>
6234
</html>