{Records videos as with the normal record command, but starts recording to a
152
new video file if the framerate of the VDP changes.
153
Note that this will only work if you use either use the -prefix option for the
154
command, or the automatic file name generation. If you specify an exact
155
filename without the -prefix option, openMSX will record all chunks to the same
156
file.
157
158
Stop recording with the "record_chunks_on_framerate_changes stop" command.
159
160
Examples:
161
record_chunks_on_framerate_changes start -triplesize -prefix UR
162
Records a movie in triplesize in files UR0001.avi, UR0002.avi etc.
163
Each subsequent AVI has a different frame rate.
164
record_chunks_on_framerate_changes stop
165
Stop recording and clean up frame rate detection stuff internally.
166
}
167
168
169
variable vdp_write_watchpoint ""
170
variable after_reset_id ""
171
variable prev_was_ntsc_mode true
172
variable record_args ""
173
174
procvdp_write_check{}{
175
variable prev_was_ntsc_mode
176
177
set safety_check_output [safety_check]
178
if{$safety_check_outputne""}{
179
puts$safety_check_output
180
return
181
}
182
183
set ntsc_mode [expr{([vdpreg9]& 2) ==0}]
184
if{$ntsc_mode!=$prev_was_ntsc_mode}{
185
restart_recording"from [expr{$prev_was_ntsc_mode?60:50}] to [expr{$ntsc_mode?60:50}] Hz"
186
set prev_was_ntsc_mode $ntsc_mode
187
}
188
}
189
190
procsafety_check{}{
191
if{[dict get [record status] status]eq"idle"}{
192
# oh, we weren't even recording... let's shut down
193
disable_monitoring
194
return"Stopped recording chunks on frame rate changes. I found out late, please use record_chunks_on_framerate_changes stop next time, so I'll find out sooner..."
195
}
196
return""
197
}
198
199
procrestart_recording{reason}{
200
variable record_args
201
puts"Frame rate change detected $reason. Starting recording to next video file."
202
record stop
203
puts[eval[linsert$record_args0 record]]
204
}
205
206
procon_reset{}{
207
variable after_reset_id
208
set after_reset_id [after boot [namespace code on_reset]]
209
set safety_check_output [safety_check]
210
if{$safety_check_outputne""}{
211
puts$safety_check_output
212
return
213
}
214
restart_recording"due to a reset"
215
}
216
217
procdisable_monitoring{}{
218
variable vdp_write_watchpoint
219
variable after_reset_id
220
debug remove_watchpoint $vdp_write_watchpoint
221
set vdp_write_watchpoint ""
222
after cancel $after_reset_id
223
set after_reset_id ""
224
}
225
226
procrecord_chunks_on_framerate_changes{args}{
227
variable record_args
228
variable vdp_write_watchpoint
229
variable after_reset_id
230
variable prev_was_ntsc_mode
231
232
if{$argseq"stop"&&$vdp_write_watchpointne""}{
233
disable_monitoring
234
record stop
235
return"Stopped recording chunks on framerate changes."
236
}
237
238
set record_args $args
239
set response [eval[linsert$record_args0 record]]
240
if{$vdp_write_watchpointeq""&&[dict get [record status] status]eq"recording"}{
241
set prev_was_ntsc_mode [expr{([vdpreg9]& 2) ==0}]
242
set vdp_write_watchpoint [debug set_watchpoint write_io 0x991{
243
record_chunks::vdp_write_check
244
}]
245
set after_reset_id [after boot [namespace code on_reset]]
246
return"Started recording chunks on framerate changes...\n$response"