• R/O
  • HTTP
  • SSH
  • HTTPS

common_source_project-fm7: Commit

Common Source Code Project for Qt (a.k.a for FM-7).


Commit MetaInfo

Revisiona3c2626fdfbf42177da06e66695636b84fc5cecf (tree)
Time2018-12-17 19:25:20
AuthorK.Ohta <whatisthis.sowhat@gmai...>
CommiterK.Ohta

Log Message

[VM] Merge Upstream 2018-12-09.

Change Summary

Incremental Difference

--- a/source/src/vm/bmjr/bmjr.cpp
+++ b/source/src/vm/bmjr/bmjr.cpp
@@ -207,14 +207,22 @@ void VM::key_up(int code)
207207
208208 void VM::play_tape(int drv, const _TCHAR* file_path)
209209 {
210- drec->play_tape(file_path);
211-// drec->set_remote(true);
210+ bool remote = drec->get_remote();
211+
212+ if(drec->play_tape(file_path) && remote) {
213+ // if machine already sets remote on, start playing now
214+ push_play(drv);
215+ }
212216 }
213217
214218 void VM::rec_tape(int drv, const _TCHAR* file_path)
215219 {
216- drec->rec_tape(file_path);
217-// drec->set_remote(true);
220+ bool remote = drec->get_remote();
221+
222+ if(drec->rec_tape(file_path) && remote) {
223+ // if machine already sets remote on, start recording now
224+ push_play(drv);
225+ }
218226 }
219227
220228 void VM::close_tape(int drv)
@@ -222,7 +230,7 @@ void VM::close_tape(int drv)
222230 emu->lock_vm();
223231 drec->close_tape();
224232 emu->unlock_vm();
225-// drec->set_remote(false);
233+ drec->set_remote(false);
226234 }
227235
228236 bool VM::is_tape_inserted(int drv)
@@ -252,6 +260,7 @@ const _TCHAR* VM::get_tape_message(int drv)
252260
253261 void VM::push_play(int drv)
254262 {
263+ drec->set_remote(false);
255264 drec->set_ff_rew(0);
256265 drec->set_remote(true);
257266 }
@@ -263,12 +272,14 @@ void VM::push_stop(int drv)
263272
264273 void VM::push_fast_forward(int drv)
265274 {
275+ drec->set_remote(false);
266276 drec->set_ff_rew(1);
267277 drec->set_remote(true);
268278 }
269279
270280 void VM::push_fast_rewind(int drv)
271281 {
282+ drec->set_remote(false);
272283 drec->set_ff_rew(-1);
273284 drec->set_remote(true);
274285 }
--- a/source/src/vm/familybasic/familybasic.cpp
+++ b/source/src/vm/familybasic/familybasic.cpp
@@ -231,14 +231,22 @@ void VM::set_sound_device_volume(int ch, int decibel_l, int decibel_r)
231231
232232 void VM::play_tape(int drv, const _TCHAR* file_path)
233233 {
234- drec->play_tape(file_path);
235-// drec->set_remote(true);
234+ bool remote = drec->get_remote();
235+
236+ if(drec->play_tape(file_path) && remote) {
237+ // if machine already sets remote on, start playing now
238+ push_play(drv);
239+ }
236240 }
237241
238242 void VM::rec_tape(int drv, const _TCHAR* file_path)
239243 {
240- drec->rec_tape(file_path);
241-// drec->set_remote(true);
244+ bool remote = drec->get_remote();
245+
246+ if(drec->rec_tape(file_path) && remote) {
247+ // if machine already sets remote on, start recording now
248+ push_play(drv);
249+ }
242250 }
243251
244252 void VM::close_tape(int drv)
@@ -246,7 +254,7 @@ void VM::close_tape(int drv)
246254 emu->lock_vm();
247255 drec->close_tape();
248256 emu->unlock_vm();
249-// drec->set_remote(false);
257+ drec->set_remote(false);
250258 }
251259
252260 bool VM::is_tape_inserted(int drv)
@@ -276,6 +284,7 @@ const _TCHAR* VM::get_tape_message(int drv)
276284
277285 void VM::push_play(int drv)
278286 {
287+ drec->set_remote(false);
279288 drec->set_ff_rew(0);
280289 drec->set_remote(true);
281290 }
@@ -287,12 +296,14 @@ void VM::push_stop(int drv)
287296
288297 void VM::push_fast_forward(int drv)
289298 {
299+ drec->set_remote(false);
290300 drec->set_ff_rew(1);
291301 drec->set_remote(true);
292302 }
293303
294304 void VM::push_fast_rewind(int drv)
295305 {
306+ drec->set_remote(false);
296307 drec->set_ff_rew(-1);
297308 drec->set_remote(true);
298309 }
--- a/source/src/vm/fm7/fm7.cpp
+++ b/source/src/vm/fm7/fm7.cpp
@@ -1092,17 +1092,36 @@ uint32_t VM::is_floppy_disk_accessed()
10921092
10931093 void VM::play_tape(int drv, const _TCHAR* file_path)
10941094 {
1095- if(drec != NULL) drec->play_tape(file_path);
1095+ if(drec != NULL) {
1096+ bool remote = drec->get_remote();
1097+
1098+ if(drec->play_tape(file_path) && remote) {
1099+ // if machine already sets remote on, start playing now
1100+ push_play(drv);
1101+ }
1102+ }
10961103 }
10971104
10981105 void VM::rec_tape(int drv, const _TCHAR* file_path)
10991106 {
1100- if(drec != NULL) drec->rec_tape(file_path);
1107+ if(drec != NULL) {
1108+ bool remote = drec->get_remote();
1109+
1110+ if(drec->rec_tape(file_path) && remote) {
1111+ // if machine already sets remote on, start recording now
1112+ push_play(drv);
1113+ }
1114+ }
11011115 }
11021116
11031117 void VM::close_tape(int drv)
11041118 {
1105- if(drec != NULL) drec->close_tape();
1119+ if(drec != NULL) {
1120+ emu->lock_vm();
1121+ drec->close_tape();
1122+ emu->unlock_vm();
1123+ drec->set_remote(false);
1124+ }
11061125 }
11071126
11081127 bool VM::is_tape_inserted(int drv)
@@ -1148,6 +1167,7 @@ const _TCHAR* VM::get_tape_message(int drv)
11481167 void VM::push_play(int drv)
11491168 {
11501169 if(drec != NULL) {
1170+ drec->set_remote(false);
11511171 drec->set_ff_rew(0);
11521172 drec->set_remote(true);
11531173 }
@@ -1164,6 +1184,7 @@ void VM::push_stop(int drv)
11641184 void VM::push_fast_forward(int drv)
11651185 {
11661186 if(drec != NULL) {
1187+ drec->set_remote(false);
11671188 drec->set_ff_rew(1);
11681189 drec->set_remote(true);
11691190 }
@@ -1172,6 +1193,7 @@ void VM::push_fast_forward(int drv)
11721193 void VM::push_fast_rewind(int drv)
11731194 {
11741195 if(drec != NULL) {
1196+ drec->set_remote(false);
11751197 drec->set_ff_rew(-1);
11761198 drec->set_remote(true);
11771199 }
--- a/source/src/vm/fp1100/fp1100.cpp
+++ b/source/src/vm/fp1100/fp1100.cpp
@@ -307,14 +307,22 @@ uint32_t VM::is_floppy_disk_accessed()
307307
308308 void VM::play_tape(int drv, const _TCHAR* file_path)
309309 {
310- drec->play_tape(file_path);
311-// drec->set_remote(true);
310+ bool remote = drec->get_remote();
311+
312+ if(drec->play_tape(file_path) && remote) {
313+ // if machine already sets remote on, start playing now
314+ push_play(drv);
315+ }
312316 }
313317
314318 void VM::rec_tape(int drv, const _TCHAR* file_path)
315319 {
316- drec->rec_tape(file_path);
317-// drec->set_remote(true);
320+ bool remote = drec->get_remote();
321+
322+ if(drec->rec_tape(file_path) && remote) {
323+ // if machine already sets remote on, start recording now
324+ push_play(drv);
325+ }
318326 }
319327
320328 void VM::close_tape(int drv)
@@ -322,7 +330,7 @@ void VM::close_tape(int drv)
322330 emu->lock_vm();
323331 drec->close_tape();
324332 emu->unlock_vm();
325-// drec->set_remote(false);
333+ drec->set_remote(false);
326334 }
327335
328336 bool VM::is_tape_inserted(int drv)
@@ -352,6 +360,7 @@ const _TCHAR* VM::get_tape_message(int drv)
352360
353361 void VM::push_play(int drv)
354362 {
363+ drec->set_remote(false);
355364 drec->set_ff_rew(0);
356365 drec->set_remote(true);
357366 }
@@ -363,12 +372,14 @@ void VM::push_stop(int drv)
363372
364373 void VM::push_fast_forward(int drv)
365374 {
375+ drec->set_remote(false);
366376 drec->set_ff_rew(1);
367377 drec->set_remote(true);
368378 }
369379
370380 void VM::push_fast_rewind(int drv)
371381 {
382+ drec->set_remote(false);
372383 drec->set_ff_rew(-1);
373384 drec->set_remote(true);
374385 }
--- a/source/src/vm/fp200/fp200.cpp
+++ b/source/src/vm/fp200/fp200.cpp
@@ -218,8 +218,13 @@ void VM::key_up(int code)
218218 void VM::play_tape(int drv, const _TCHAR* file_path)
219219 {
220220 io->close_tape();
221- drec->play_tape(file_path);
222-// drec->set_remote(true);
221+
222+ bool remote = drec->get_remote();
223+
224+ if(drec->play_tape(file_path) && remote) {
225+ // if machine already sets remote on, start playing now
226+ push_play(drv);
227+ }
223228 }
224229
225230 void VM::rec_tape(int drv, const _TCHAR* file_path)
@@ -227,7 +232,7 @@ void VM::rec_tape(int drv, const _TCHAR* file_path)
227232 emu->lock_vm();
228233 drec->close_tape();
229234 emu->unlock_vm();
230-// drec->set_remote(false);
235+ drec->set_remote(false);
231236 io->rec_tape(file_path);
232237 }
233238
@@ -236,7 +241,8 @@ void VM::close_tape(int drv)
236241 emu->lock_vm();
237242 drec->close_tape();
238243 emu->unlock_vm();
239-// drec->set_remote(false);
244+ drec->set_remote(false);
245+
240246 io->close_tape();
241247 }
242248
@@ -284,6 +290,7 @@ const _TCHAR* VM::get_tape_message(int drv)
284290 void VM::push_play(int drv)
285291 {
286292 if(drec->is_tape_inserted()) {
293+ drec->set_remote(false);
287294 drec->set_ff_rew(0);
288295 drec->set_remote(true);
289296 }
@@ -299,6 +306,7 @@ void VM::push_stop(int drv)
299306 void VM::push_fast_forward(int drv)
300307 {
301308 if(drec->is_tape_inserted()) {
309+ drec->set_remote(false);
302310 drec->set_ff_rew(1);
303311 drec->set_remote(true);
304312 }
@@ -307,6 +315,7 @@ void VM::push_fast_forward(int drv)
307315 void VM::push_fast_rewind(int drv)
308316 {
309317 if(drec->is_tape_inserted()) {
318+ drec->set_remote(false);
310319 drec->set_ff_rew(-1);
311320 drec->set_remote(true);
312321 }
--- a/source/src/vm/fp200/fp200.h
+++ b/source/src/vm/fp200/fp200.h
@@ -25,7 +25,7 @@
2525 #define MEMORY_BANK_SIZE 0x2000
2626
2727 // device informations for win32
28-#define WINDOW_MODE_BASE 2
28+#define WINDOW_MODE_BASE 3
2929 #define USE_BOOT_MODE 2
3030 #define USE_TAPE 1
3131 #define USE_AUTO_KEY 5
--- a/source/src/vm/gamegear/gamegear.cpp
+++ b/source/src/vm/gamegear/gamegear.cpp
@@ -309,14 +309,22 @@ uint32_t VM::is_floppy_disk_accessed()
309309
310310 void VM::play_tape(int drv, const _TCHAR* file_path)
311311 {
312- drec->play_tape(file_path);
313-// drec->set_remote(true);
312+ bool remote = drec->get_remote();
313+
314+ if(drec->play_tape(file_path) && remote) {
315+ // if machine already sets remote on, start playing now
316+ push_play(drv);
317+ }
314318 }
315319
316320 void VM::rec_tape(int drv, const _TCHAR* file_path)
317321 {
318- drec->rec_tape(file_path);
319-// drec->set_remote(true);
322+ bool remote = drec->get_remote();
323+
324+ if(drec->rec_tape(file_path) && remote) {
325+ // if machine already sets remote on, start recording now
326+ push_play(drv);
327+ }
320328 }
321329
322330 void VM::close_tape(int drv)
@@ -324,7 +332,7 @@ void VM::close_tape(int drv)
324332 emu->lock_vm();
325333 drec->close_tape();
326334 emu->unlock_vm();
327-// drec->set_remote(false);
335+ drec->set_remote(false);
328336 }
329337
330338 bool VM::is_tape_inserted(int drv)
@@ -354,6 +362,7 @@ const _TCHAR* VM::get_tape_message(int drv)
354362
355363 void VM::push_play(int drv)
356364 {
365+ drec->set_remote(false);
357366 drec->set_ff_rew(0);
358367 drec->set_remote(true);
359368 }
@@ -365,12 +374,14 @@ void VM::push_stop(int drv)
365374
366375 void VM::push_fast_forward(int drv)
367376 {
377+ drec->set_remote(false);
368378 drec->set_ff_rew(1);
369379 drec->set_remote(true);
370380 }
371381
372382 void VM::push_fast_rewind(int drv)
373383 {
384+ drec->set_remote(false);
374385 drec->set_ff_rew(-1);
375386 drec->set_remote(true);
376387 }
--- a/source/src/vm/gamegear/mastersystem.cpp
+++ b/source/src/vm/gamegear/mastersystem.cpp
@@ -314,16 +314,24 @@ bool VM::is_cart_inserted(int drv)
314314 /// return fdc->read_signal(0);
315315 ///}
316316
317-///void VM::play_tape(int drv, const _TCHAR* file_path)
317+//void VM::play_tape(int drv, const _TCHAR* file_path)
318318 ///{
319-/// drec->play_tape(file_path);
320-/// drec->set_remote(true);
319+/// bool remote = drec->get_remote();
320+///
321+/// if(drec->play_tape(file_path) && remote) {
322+/// // if machine already sets remote on, start playing now
323+/// push_play(drv);
324+/// }
321325 ///}
322326
323327 ///void VM::rec_tape(int drv, const _TCHAR* file_path)
324328 ///{
325-/// drec->rec_tape(file_path);
326-/// drec->set_remote(true);
329+/// bool remote = drec->get_remote();
330+///
331+/// if(drec->rec_tape(file_path) && remote) {
332+/// // if machine already sets remote on, start recording now
333+/// push_play(drv);
334+/// }
327335 ///}
328336
329337 ///void VM::close_tape(int drv)
@@ -361,6 +369,7 @@ bool VM::is_cart_inserted(int drv)
361369
362370 ///void VM::push_play(int drv)
363371 ///{
372+/// drec->set_remote(false);
364373 /// drec->set_ff_rew(0);
365374 /// drec->set_remote(true);
366375 ///}
@@ -372,12 +381,14 @@ bool VM::is_cart_inserted(int drv)
372381
373382 ///void VM::push_fast_forward(int drv)
374383 ///{
384+/// drec->set_remote(false);
375385 /// drec->set_ff_rew(1);
376386 /// drec->set_remote(true);
377387 ///}
378388
379389 ///void VM::push_fast_rewind(int drv)
380390 ///{
391+/// drec->set_remote(false);
381392 /// drec->set_ff_rew(-1);
382393 /// drec->set_remote(true);
383394 ///}
--- a/source/src/vm/hc20/hc20.h
+++ b/source/src/vm/hc20/hc20.h
@@ -24,7 +24,7 @@
2424 #define HAS_UPD7201
2525
2626 // device informations for win32
27-#define WINDOW_MODE_BASE 3
27+#define WINDOW_MODE_BASE 4
2828 #define USE_DIPSWITCH
2929 #define DIPSWITCH_DEFAULT 0x0f
3030 #define USE_FLOPPY_DISK 2
--- a/source/src/vm/hc40/hc40.cpp
+++ b/source/src/vm/hc40/hc40.cpp
@@ -242,14 +242,22 @@ uint32_t VM::is_floppy_disk_accessed()
242242
243243 void VM::play_tape(int drv, const _TCHAR* file_path)
244244 {
245- drec->play_tape(file_path);
246-// drec->set_remote(true);
245+ bool remote = drec->get_remote();
246+
247+ if(drec->play_tape(file_path) && remote) {
248+ // if machine already sets remote on, start playing now
249+ push_play(drv);
250+ }
247251 }
248252
249253 void VM::rec_tape(int drv, const _TCHAR* file_path)
250254 {
251- drec->rec_tape(file_path);
252-// drec->set_remote(true);
255+ bool remote = drec->get_remote();
256+
257+ if(drec->rec_tape(file_path) && remote) {
258+ // if machine already sets remote on, start recording now
259+ push_play(drv);
260+ }
253261 }
254262
255263 void VM::close_tape(int drv)
@@ -257,7 +265,7 @@ void VM::close_tape(int drv)
257265 emu->lock_vm();
258266 drec->close_tape();
259267 emu->unlock_vm();
260-// drec->set_remote(false);
268+ drec->set_remote(false);
261269 }
262270
263271 bool VM::is_tape_inserted(int drv)
@@ -287,6 +295,7 @@ const _TCHAR* VM::get_tape_message(int drv)
287295
288296 void VM::push_play(int drv)
289297 {
298+ drec->set_remote(false);
290299 drec->set_ff_rew(0);
291300 drec->set_remote(true);
292301 }
@@ -298,12 +307,14 @@ void VM::push_stop(int drv)
298307
299308 void VM::push_fast_forward(int drv)
300309 {
310+ drec->set_remote(false);
301311 drec->set_ff_rew(1);
302312 drec->set_remote(true);
303313 }
304314
305315 void VM::push_fast_rewind(int drv)
306316 {
317+ drec->set_remote(false);
307318 drec->set_ff_rew(-1);
308319 drec->set_remote(true);
309320 }
--- a/source/src/vm/hc40/hc40.h
+++ b/source/src/vm/hc40/hc40.h
@@ -22,7 +22,7 @@
2222 #define MAX_DRIVE 4
2323
2424 // device informations for win32
25-#define WINDOW_MODE_BASE 2
25+#define WINDOW_MODE_BASE 3
2626 #define USE_SPECIAL_RESET
2727 #define USE_FLOPPY_DISK 4
2828 #define USE_TAPE 1
--- a/source/src/vm/jr100/jr100.cpp
+++ b/source/src/vm/jr100/jr100.cpp
@@ -209,14 +209,22 @@ void VM::set_sound_device_volume(int ch, int decibel_l, int decibel_r)
209209
210210 void VM::play_tape(int drv, const _TCHAR* file_path)
211211 {
212- drec->play_tape(file_path);
213-// drec->set_remote(true);
212+ bool remote = drec->get_remote();
213+
214+ if(drec->play_tape(file_path) && remote) {
215+ // if machine already sets remote on, start playing now
216+ push_play(drv);
217+ }
214218 }
215219
216220 void VM::rec_tape(int drv, const _TCHAR* file_path)
217221 {
218- drec->rec_tape(file_path);
219-// drec->set_remote(true);
222+ bool remote = drec->get_remote();
223+
224+ if(drec->rec_tape(file_path) && remote) {
225+ // if machine already sets remote on, start recording now
226+ push_play(drv);
227+ }
220228 }
221229
222230 void VM::close_tape(int drv)
@@ -224,7 +232,7 @@ void VM::close_tape(int drv)
224232 emu->lock_vm();
225233 drec->close_tape();
226234 emu->unlock_vm();
227-// drec->set_remote(false);
235+ drec->set_remote(false);
228236 }
229237
230238 bool VM::is_tape_inserted(int drv)
@@ -254,6 +262,7 @@ const _TCHAR* VM::get_tape_message(int drv)
254262
255263 void VM::push_play(int drv)
256264 {
265+ drec->set_remote(false);
257266 drec->set_ff_rew(0);
258267 drec->set_remote(true);
259268 }
@@ -265,12 +274,14 @@ void VM::push_stop(int drv)
265274
266275 void VM::push_fast_forward(int drv)
267276 {
277+ drec->set_remote(false);
268278 drec->set_ff_rew(1);
269279 drec->set_remote(true);
270280 }
271281
272282 void VM::push_fast_rewind(int drv)
273283 {
284+ drec->set_remote(false);
274285 drec->set_ff_rew(-1);
275286 drec->set_remote(true);
276287 }
--- a/source/src/vm/jr800/jr800.cpp
+++ b/source/src/vm/jr800/jr800.cpp
@@ -207,14 +207,22 @@ void VM::set_sound_device_volume(int ch, int decibel_l, int decibel_r)
207207
208208 void VM::play_tape(int drv, const _TCHAR* file_path)
209209 {
210- drec->play_tape(file_path);
211-// drec->set_remote(true);
210+ bool remote = drec->get_remote();
211+
212+ if(drec->play_tape(file_path) && remote) {
213+ // if machine already sets remote on, start playing now
214+ push_play(drv);
215+ }
212216 }
213217
214218 void VM::rec_tape(int drv, const _TCHAR* file_path)
215219 {
216- drec->rec_tape(file_path);
217-// drec->set_remote(true);
220+ bool remote = drec->get_remote();
221+
222+ if(drec->rec_tape(file_path) && remote) {
223+ // if machine already sets remote on, start recording now
224+ push_play(drv);
225+ }
218226 }
219227
220228 void VM::close_tape(int drv)
@@ -222,7 +230,7 @@ void VM::close_tape(int drv)
222230 emu->lock_vm();
223231 drec->close_tape();
224232 emu->unlock_vm();
225-// drec->set_remote(false);
233+ drec->set_remote(false);
226234 }
227235
228236 bool VM::is_tape_inserted(int drv)
@@ -252,6 +260,7 @@ const _TCHAR* VM::get_tape_message(int drv)
252260
253261 void VM::push_play(int drv)
254262 {
263+ drec->set_remote(false);
255264 drec->set_ff_rew(0);
256265 drec->set_remote(true);
257266 }
@@ -263,12 +272,14 @@ void VM::push_stop(int drv)
263272
264273 void VM::push_fast_forward(int drv)
265274 {
275+ drec->set_remote(false);
266276 drec->set_ff_rew(1);
267277 drec->set_remote(true);
268278 }
269279
270280 void VM::push_fast_rewind(int drv)
271281 {
282+ drec->set_remote(false);
272283 drec->set_ff_rew(-1);
273284 drec->set_remote(true);
274285 }
--- a/source/src/vm/jr800/jr800.h
+++ b/source/src/vm/jr800/jr800.h
@@ -24,7 +24,7 @@
2424 #define MEMORY_BANK_SIZE 0x100
2525
2626 // device informations for win32
27-#define WINDOW_MODE_BASE 2
27+#define WINDOW_MODE_BASE 3
2828 #define USE_TAPE 1
2929 #define USE_AUTO_KEY 6
3030 #define USE_AUTO_KEY_RELEASE 10
--- a/source/src/vm/m5/m5.cpp
+++ b/source/src/vm/m5/m5.cpp
@@ -251,14 +251,22 @@ bool VM::is_cart_inserted(int drv)
251251
252252 void VM::play_tape(int drv, const _TCHAR* file_path)
253253 {
254- drec->play_tape(file_path);
255-// drec->set_remote(true);
254+ bool remote = drec->get_remote();
255+
256+ if(drec->play_tape(file_path) && remote) {
257+ // if machine already sets remote on, start playing now
258+ push_play(drv);
259+ }
256260 }
257261
258262 void VM::rec_tape(int drv, const _TCHAR* file_path)
259263 {
260- drec->rec_tape(file_path);
261-// drec->set_remote(true);
264+ bool remote = drec->get_remote();
265+
266+ if(drec->rec_tape(file_path) && remote) {
267+ // if machine already sets remote on, start recording now
268+ push_play(drv);
269+ }
262270 }
263271
264272 void VM::close_tape(int drv)
@@ -266,7 +274,7 @@ void VM::close_tape(int drv)
266274 emu->lock_vm();
267275 drec->close_tape();
268276 emu->unlock_vm();
269-// drec->set_remote(false);
277+ drec->set_remote(false);
270278 }
271279
272280 bool VM::is_tape_inserted(int drv)
@@ -296,6 +304,7 @@ const _TCHAR* VM::get_tape_message(int drv)
296304
297305 void VM::push_play(int drv)
298306 {
307+ drec->set_remote(false);
299308 drec->set_ff_rew(0);
300309 drec->set_remote(true);
301310 }
@@ -307,12 +316,14 @@ void VM::push_stop(int drv)
307316
308317 void VM::push_fast_forward(int drv)
309318 {
319+ drec->set_remote(false);
310320 drec->set_ff_rew(1);
311321 drec->set_remote(true);
312322 }
313323
314324 void VM::push_fast_rewind(int drv)
315325 {
326+ drec->set_remote(false);
316327 drec->set_ff_rew(-1);
317328 drec->set_remote(true);
318329 }
--- a/source/src/vm/msx/msx.cpp
+++ b/source/src/vm/msx/msx.cpp
@@ -337,14 +337,22 @@ bool VM::is_cart_inserted(int drv)
337337
338338 void VM::play_tape(int drv, const _TCHAR* file_path)
339339 {
340- drec->play_tape(file_path);
341-// drec->set_remote(true);
340+ bool remote = drec->get_remote();
341+
342+ if(drec->play_tape(file_path) && remote) {
343+ // if machine already sets remote on, start playing now
344+ push_play(drv);
345+ }
342346 }
343347
344348 void VM::rec_tape(int drv, const _TCHAR* file_path)
345349 {
346- drec->rec_tape(file_path);
347-// drec->set_remote(true);
350+ bool remote = drec->get_remote();
351+
352+ if(drec->rec_tape(file_path) && remote) {
353+ // if machine already sets remote on, start recording now
354+ push_play(drv);
355+ }
348356 }
349357
350358 void VM::close_tape(int drv)
@@ -352,7 +360,7 @@ void VM::close_tape(int drv)
352360 emu->lock_vm();
353361 drec->close_tape();
354362 emu->unlock_vm();
355-// drec->set_remote(false);
363+ drec->set_remote(false);
356364 }
357365
358366 bool VM::is_tape_inserted(int drv)
@@ -382,6 +390,7 @@ const _TCHAR* VM::get_tape_message(int drv)
382390
383391 void VM::push_play(int drv)
384392 {
393+ drec->set_remote(false);
385394 drec->set_ff_rew(0);
386395 drec->set_remote(true);
387396 }
@@ -393,12 +402,14 @@ void VM::push_stop(int drv)
393402
394403 void VM::push_fast_forward(int drv)
395404 {
405+ drec->set_remote(false);
396406 drec->set_ff_rew(1);
397407 drec->set_remote(true);
398408 }
399409
400410 void VM::push_fast_rewind(int drv)
401411 {
412+ drec->set_remote(false);
402413 drec->set_ff_rew(-1);
403414 drec->set_remote(true);
404415 }
--- a/source/src/vm/msx/msx_ex.cpp
+++ b/source/src/vm/msx/msx_ex.cpp
@@ -554,14 +554,22 @@ bool VM::is_cart_inserted(int drv)
554554
555555 void VM::play_tape(int drv, const _TCHAR* file_path)
556556 {
557- drec->play_tape(file_path);
558-// drec->set_remote(true);
557+ bool remote = drec->get_remote();
558+
559+ if(drec->play_tape(file_path) && remote) {
560+ // if machine already sets remote on, start playing now
561+ push_play(drv);
562+ }
559563 }
560564
561565 void VM::rec_tape(int drv, const _TCHAR* file_path)
562566 {
563- drec->rec_tape(file_path);
564-// drec->set_remote(true);
567+ bool remote = drec->get_remote();
568+
569+ if(drec->rec_tape(file_path) && remote) {
570+ // if machine already sets remote on, start recording now
571+ push_play(drv);
572+ }
565573 }
566574
567575 void VM::close_tape(int drv)
@@ -569,7 +577,7 @@ void VM::close_tape(int drv)
569577 emu->lock_vm();
570578 drec->close_tape();
571579 emu->unlock_vm();
572-// drec->set_remote(false);
580+ drec->set_remote(false);
573581 }
574582
575583 bool VM::is_tape_inserted(int drv)
@@ -599,6 +607,7 @@ const _TCHAR* VM::get_tape_message(int drv)
599607
600608 void VM::push_play(int drv)
601609 {
610+ drec->set_remote(false);
602611 drec->set_ff_rew(0);
603612 drec->set_remote(true);
604613 }
@@ -610,12 +619,14 @@ void VM::push_stop(int drv)
610619
611620 void VM::push_fast_forward(int drv)
612621 {
622+ drec->set_remote(false);
613623 drec->set_ff_rew(1);
614624 drec->set_remote(true);
615625 }
616626
617627 void VM::push_fast_rewind(int drv)
618628 {
629+ drec->set_remote(false);
619630 drec->set_ff_rew(-1);
620631 drec->set_remote(true);
621632 }
--- a/source/src/vm/mycomz80a/mycomz80a.cpp
+++ b/source/src/vm/mycomz80a/mycomz80a.cpp
@@ -292,14 +292,22 @@ bool VM::get_kana_locked()
292292
293293 void VM::play_tape(int drv, const _TCHAR* file_path)
294294 {
295- drec->play_tape(file_path);
296-// drec->set_remote(true);
295+ bool remote = drec->get_remote();
296+
297+ if(drec->play_tape(file_path) && remote) {
298+ // if machine already sets remote on, start playing now
299+ push_play(drv);
300+ }
297301 }
298302
299303 void VM::rec_tape(int drv, const _TCHAR* file_path)
300304 {
301- drec->rec_tape(file_path);
302-// drec->set_remote(true);
305+ bool remote = drec->get_remote();
306+
307+ if(drec->rec_tape(file_path) && remote) {
308+ // if machine already sets remote on, start recording now
309+ push_play(drv);
310+ }
303311 }
304312
305313 void VM::close_tape(int drv)
@@ -307,7 +315,7 @@ void VM::close_tape(int drv)
307315 emu->lock_vm();
308316 drec->close_tape();
309317 emu->unlock_vm();
310-// drec->set_remote(false);
318+ drec->set_remote(false);
311319 }
312320
313321 bool VM::is_tape_inserted(int drv)
@@ -337,6 +345,7 @@ const _TCHAR* VM::get_tape_message(int drv)
337345
338346 void VM::push_play(int drv)
339347 {
348+ drec->set_remote(false);
340349 drec->set_ff_rew(0);
341350 drec->set_remote(true);
342351 }
@@ -348,12 +357,14 @@ void VM::push_stop(int drv)
348357
349358 void VM::push_fast_forward(int drv)
350359 {
360+ drec->set_remote(false);
351361 drec->set_ff_rew(1);
352362 drec->set_remote(true);
353363 }
354364
355365 void VM::push_fast_rewind(int drv)
356366 {
367+ drec->set_remote(false);
357368 drec->set_ff_rew(-1);
358369 drec->set_remote(true);
359370 }
--- a/source/src/vm/mz2500/cmt.cpp
+++ b/source/src/vm/mz2500/cmt.cpp
@@ -52,6 +52,7 @@ void CMT::reset()
5252 void CMT::fast_forward()
5353 {
5454 if(play) {
55+ d_drec->set_remote(false);
5556 d_drec->set_ff_rew(1);
5657 d_drec->set_remote(true);
5758 }
@@ -61,6 +62,7 @@ void CMT::fast_forward()
6162 void CMT::fast_rewind()
6263 {
6364 if(play) {
65+ d_drec->set_remote(false);
6466 d_drec->set_ff_rew(-1);
6567 d_drec->set_remote(true);
6668 }
@@ -71,6 +73,7 @@ void CMT::fast_rewind()
7173 void CMT::forward()
7274 {
7375 if(play || rec) {
76+ d_drec->set_remote(false);
7477 d_drec->set_ff_rew(0);
7578 d_drec->set_remote(true);
7679 }
@@ -84,7 +87,7 @@ void CMT::stop()
8487 d_drec->set_remote(false);
8588 }
8689 now_play = now_rewind = false;
87- d_pio->write_signal(SIG_I8255_PORT_B, 0, 0x40);
90+ d_pio->write_signal(SIG_I8255_PORT_B, 0x00, 0x40);
8891 }
8992
9093 void CMT::write_signal(int id, uint32_t data, uint32_t mask)
@@ -215,10 +218,10 @@ void CMT::write_signal(int id, uint32_t data, uint32_t mask)
215218 } else
216219 #endif
217220 if(now_play) {
218- d_pio->write_signal(SIG_I8255_PORT_B, (data & mask) ? 0x40 : 0, 0x40);
221+ d_pio->write_signal(SIG_I8255_PORT_B, (data & mask) ? 0x40 : 0x00, 0x40);
219222 }
220223 } else if(id == SIG_CMT_REMOTE) {
221- d_pio->write_signal(SIG_I8255_PORT_B, (data & mask) ? 0 : 8, 8);
224+ d_pio->write_signal(SIG_I8255_PORT_B, (data & mask) ? 0x00 : 0x08, 0x08);
222225 } else if(id == SIG_CMT_END) {
223226 if((data & mask) && now_play) {
224227 #ifndef _MZ80B
@@ -279,7 +282,7 @@ void CMT::event_callback(int event_id, int err)
279282 register_id_eject = -1;
280283 #ifndef _MZ80B
281284 } else if(event_id == EVENT_APSS) {
282- d_pio->write_signal(SIG_I8255_PORT_B, 0, 0x40);
285+ d_pio->write_signal(SIG_I8255_PORT_B, 0x00, 0x40);
283286 register_id_apss = -1;
284287 #endif
285288 } else if(event_id == EVENT_IPL) {
@@ -299,7 +302,7 @@ void CMT::rec_tape(bool value)
299302 {
300303 play = false;
301304 rec = value;
302- d_pio->write_signal(SIG_I8255_PORT_B, rec ? 0 : 0x30, 0x30);
305+ d_pio->write_signal(SIG_I8255_PORT_B, rec ? 0x00 : 0x30, 0x30);
303306 }
304307
305308 void CMT::close_tape()
@@ -307,7 +310,7 @@ void CMT::close_tape()
307310 play = rec = false;
308311 now_play = now_rewind = false;
309312 d_pio->write_signal(SIG_I8255_PORT_B, 0x30, 0x30);
310- d_pio->write_signal(SIG_I8255_PORT_B, 0, 0x40);
313+ d_pio->write_signal(SIG_I8255_PORT_B, 0x00, 0x40);
311314
312315 #ifndef _MZ80B
313316 if(register_id_apss != -1) {
--- a/source/src/vm/mz2500/mz2500.cpp
+++ b/source/src/vm/mz2500/mz2500.cpp
@@ -521,16 +521,28 @@ uint32_t VM::is_hard_disk_accessed()
521521
522522 void VM::play_tape(int drv, const _TCHAR* file_path)
523523 {
524- bool value = drec->play_tape(file_path);
524+ bool remote = drec->get_remote();
525+ bool opened = drec->play_tape(file_path);
526+
527+ if(opened && remote) {
528+ // if machine already sets remote on, start playing now
529+ push_play(drv);
530+ }
525531 cmt->close_tape();
526- cmt->play_tape(value);
532+ cmt->play_tape(opened);
527533 }
528534
529535 void VM::rec_tape(int drv, const _TCHAR* file_path)
530536 {
531- bool value = drec->rec_tape(file_path);
537+ bool remote = drec->get_remote();
538+ bool opened = drec->rec_tape(file_path);
539+
540+ if(opened && remote) {
541+ // if machine already sets remote on, start recording now
542+ push_play(drv);
543+ }
532544 cmt->close_tape();
533- cmt->rec_tape(value);
545+ cmt->rec_tape(opened);
534546 }
535547
536548 void VM::close_tape(int drv)
@@ -538,6 +550,7 @@ void VM::close_tape(int drv)
538550 emu->lock_vm();
539551 drec->close_tape();
540552 emu->unlock_vm();
553+ drec->set_remote(false);
541554 cmt->close_tape();
542555 }
543556
@@ -568,6 +581,7 @@ const _TCHAR* VM::get_tape_message(int drv)
568581
569582 void VM::push_play(int drv)
570583 {
584+ drec->set_remote(false);
571585 drec->set_ff_rew(0);
572586 drec->set_remote(true);
573587 }
@@ -579,12 +593,14 @@ void VM::push_stop(int drv)
579593
580594 void VM::push_fast_forward(int drv)
581595 {
596+ drec->set_remote(false);
582597 drec->set_ff_rew(1);
583598 drec->set_remote(true);
584599 }
585600
586601 void VM::push_fast_rewind(int drv)
587602 {
603+ drec->set_remote(false);
588604 drec->set_ff_rew(-1);
589605 drec->set_remote(true);
590606 }
--- a/source/src/vm/mz2500/mz80b.cpp
+++ b/source/src/vm/mz2500/mz80b.cpp
@@ -491,24 +491,37 @@ void VM::play_tape(int drv, const _TCHAR* file_path)
491491 } else if(check_file_extension(file_path, _T(".mtw"))) {
492492 memory->load_mzt_image(file_path);
493493 }
494- bool value = drec->play_tape(file_path);
494+ bool remote = drec->get_remote();
495+ bool opened = drec->play_tape(file_path);
496+
497+ if(opened && remote) {
498+ // if machine already sets remote on, start playing now
499+ push_play(drv);
500+ }
495501 cmt->close_tape();
496- cmt->play_tape(value);
502+ cmt->play_tape(opened);
497503 }
498504
499505 void VM::rec_tape(int drv, const _TCHAR* file_path)
500506 {
501- bool value = drec->rec_tape(file_path);
507+ bool remote = drec->get_remote();
508+ bool opened = drec->rec_tape(file_path);
509+
510+ if(opened && remote) {
511+ // if machine already sets remote on, start recording now
512+ push_play(drv);
513+ }
502514 cmt->close_tape();
503- cmt->rec_tape(value);
515+ cmt->rec_tape(opened);
504516 }
505517
506518 void VM::close_tape(int drv)
507519 {
508520 emu->lock_vm();
509521 drec->close_tape();
510- cmt->close_tape();
511522 emu->unlock_vm();
523+ drec->set_remote(false);
524+ cmt->close_tape();
512525 }
513526
514527 bool VM::is_tape_inserted(int drv)
@@ -538,6 +551,7 @@ const _TCHAR* VM::get_tape_message(int drv)
538551
539552 void VM::push_play(int drv)
540553 {
554+ drec->set_remote(false);
541555 drec->set_ff_rew(0);
542556 drec->set_remote(true);
543557 }
@@ -549,12 +563,14 @@ void VM::push_stop(int drv)
549563
550564 void VM::push_fast_forward(int drv)
551565 {
566+ drec->set_remote(false);
552567 drec->set_ff_rew(1);
553568 drec->set_remote(true);
554569 }
555570
556571 void VM::push_fast_rewind(int drv)
557572 {
573+ drec->set_remote(false);
558574 drec->set_ff_rew(-1);
559575 drec->set_remote(true);
560576 }
--- a/source/src/vm/mz3500/sub.cpp
+++ b/source/src/vm/mz3500/sub.cpp
@@ -127,7 +127,7 @@ uint32_t SUB::read_io8(uint32_t addr)
127127
128128 void SUB::event_frame()
129129 {
130- cblink++;
130+ cblink = (cblink + 1) & 0x1f;
131131 }
132132
133133 // display
--- a/source/src/vm/mz700/mz700.cpp
+++ b/source/src/vm/mz700/mz700.cpp
@@ -550,14 +550,22 @@ void VM::set_sound_device_volume(int ch, int decibel_l, int decibel_r)
550550
551551 void VM::play_tape(int drv, const _TCHAR* file_path)
552552 {
553- drec->play_tape(file_path);
554-// drec->set_remote(true);
553+ bool remote = drec->get_remote();
554+
555+ if(drec->play_tape(file_path) && remote) {
556+ // if machine already sets remote on, start playing now
557+ push_play(drv);
558+ }
555559 }
556560
557561 void VM::rec_tape(int drv, const _TCHAR* file_path)
558562 {
559- drec->rec_tape(file_path);
560-// drec->set_remote(true);
563+ bool remote = drec->get_remote();
564+
565+ if(drec->rec_tape(file_path) && remote) {
566+ // if machine already sets remote on, start recording now
567+ push_play(drv);
568+ }
561569 }
562570
563571 void VM::close_tape(int drv)
@@ -565,8 +573,7 @@ void VM::close_tape(int drv)
565573 emu->lock_vm();
566574 drec->close_tape();
567575 emu->unlock_vm();
568-
569- //drec->set_remote(false);
576+ drec->set_remote(false);
570577 }
571578
572579 bool VM::is_tape_inserted(int drv)
@@ -596,6 +603,7 @@ const _TCHAR* VM::get_tape_message(int drv)
596603
597604 void VM::push_play(int drv)
598605 {
606+ drec->set_remote(false);
599607 drec->set_ff_rew(0);
600608 drec->set_remote(true);
601609 }
@@ -607,12 +615,14 @@ void VM::push_stop(int drv)
607615
608616 void VM::push_fast_forward(int drv)
609617 {
618+ drec->set_remote(false);
610619 drec->set_ff_rew(1);
611620 drec->set_remote(true);
612621 }
613622
614623 void VM::push_fast_rewind(int drv)
615624 {
625+ drec->set_remote(false);
616626 drec->set_ff_rew(-1);
617627 drec->set_remote(true);
618628 }
--- a/source/src/vm/mz80k/mz80k.cpp
+++ b/source/src/vm/mz80k/mz80k.cpp
@@ -396,14 +396,22 @@ uint32_t VM::is_floppy_disk_accessed()
396396
397397 void VM::play_tape(int drv, const _TCHAR* file_path)
398398 {
399- drec->play_tape(file_path);
400-// drec->set_remote(true);
399+ bool remote = drec->get_remote();
400+
401+ if(drec->play_tape(file_path) && remote) {
402+ // if machine already sets remote on, start playing now
403+ push_play(drv);
404+ }
401405 }
402406
403407 void VM::rec_tape(int drv, const _TCHAR* file_path)
404408 {
405- drec->rec_tape(file_path);
406-// drec->set_remote(true);
409+ bool remote = drec->get_remote();
410+
411+ if(drec->rec_tape(file_path) && remote) {
412+ // if machine already sets remote on, start recording now
413+ push_play(drv);
414+ }
407415 }
408416
409417 void VM::close_tape(int drv)
@@ -411,7 +419,7 @@ void VM::close_tape(int drv)
411419 emu->lock_vm();
412420 drec->close_tape();
413421 emu->unlock_vm();
414-// drec->set_remote(false);
422+ drec->set_remote(false);
415423 }
416424
417425 bool VM::is_tape_inserted(int drv)
@@ -441,6 +449,7 @@ const _TCHAR* VM::get_tape_message(int drv)
441449
442450 void VM::push_play(int drv)
443451 {
452+ drec->set_remote(false);
444453 drec->set_ff_rew(0);
445454 drec->set_remote(true);
446455 }
@@ -452,12 +461,14 @@ void VM::push_stop(int drv)
452461
453462 void VM::push_fast_forward(int drv)
454463 {
464+ drec->set_remote(false);
455465 drec->set_ff_rew(1);
456466 drec->set_remote(true);
457467 }
458468
459469 void VM::push_fast_rewind(int drv)
460470 {
471+ drec->set_remote(false);
461472 drec->set_ff_rew(-1);
462473 drec->set_remote(true);
463474 }
--- a/source/src/vm/pasopia/pasopia.cpp
+++ b/source/src/vm/pasopia/pasopia.cpp
@@ -353,14 +353,22 @@ uint32_t VM::is_floppy_disk_accessed()
353353
354354 void VM::play_tape(int drv, const _TCHAR* file_path)
355355 {
356- drec->play_tape(file_path);
357-// drec->set_remote(true);
356+ bool remote = drec->get_remote();
357+
358+ if(drec->play_tape(file_path) && remote) {
359+ // if machine already sets remote on, start playing now
360+ push_play(drv);
361+ }
358362 }
359363
360364 void VM::rec_tape(int drv, const _TCHAR* file_path)
361365 {
362- drec->rec_tape(file_path);
363-// drec->set_remote(true);
366+ bool remote = drec->get_remote();
367+
368+ if(drec->rec_tape(file_path) && remote) {
369+ // if machine already sets remote on, start recording now
370+ push_play(drv);
371+ }
364372 }
365373
366374 void VM::close_tape(int drv)
@@ -368,7 +376,7 @@ void VM::close_tape(int drv)
368376 emu->lock_vm();
369377 drec->close_tape();
370378 emu->unlock_vm();
371-// drec->set_remote(false);
379+ drec->set_remote(false);
372380 }
373381
374382 bool VM::is_tape_inserted(int drv)
@@ -398,6 +406,7 @@ const _TCHAR* VM::get_tape_message(int drv)
398406
399407 void VM::push_play(int drv)
400408 {
409+ drec->set_remote(false);
401410 drec->set_ff_rew(0);
402411 drec->set_remote(true);
403412 }
@@ -409,12 +418,14 @@ void VM::push_stop(int drv)
409418
410419 void VM::push_fast_forward(int drv)
411420 {
421+ drec->set_remote(false);
412422 drec->set_ff_rew(1);
413423 drec->set_remote(true);
414424 }
415425
416426 void VM::push_fast_rewind(int drv)
417427 {
428+ drec->set_remote(false);
418429 drec->set_ff_rew(-1);
419430 drec->set_remote(true);
420431 }
--- a/source/src/vm/pasopia7/pasopia7.cpp
+++ b/source/src/vm/pasopia7/pasopia7.cpp
@@ -356,14 +356,22 @@ uint32_t VM::is_floppy_disk_accessed()
356356
357357 void VM::play_tape(int drv, const _TCHAR* file_path)
358358 {
359- drec->play_tape(file_path);
360-// drec->set_remote(true);
359+ bool remote = drec->get_remote();
360+
361+ if(drec->play_tape(file_path) && remote) {
362+ // if machine already sets remote on, start playing now
363+ push_play(drv);
364+ }
361365 }
362366
363367 void VM::rec_tape(int drv, const _TCHAR* file_path)
364368 {
365- drec->rec_tape(file_path);
366-// drec->set_remote(true);
369+ bool remote = drec->get_remote();
370+
371+ if(drec->rec_tape(file_path) && remote) {
372+ // if machine already sets remote on, start recording now
373+ push_play(drv);
374+ }
367375 }
368376
369377 void VM::close_tape(int drv)
@@ -371,7 +379,7 @@ void VM::close_tape(int drv)
371379 emu->lock_vm();
372380 drec->close_tape();
373381 emu->unlock_vm();
374-// drec->set_remote(false);
382+ drec->set_remote(false);
375383 }
376384
377385 bool VM::is_tape_inserted(int drv)
@@ -401,6 +409,7 @@ const _TCHAR* VM::get_tape_message(int drv)
401409
402410 void VM::push_play(int drv)
403411 {
412+ drec->set_remote(false);
404413 drec->set_ff_rew(0);
405414 drec->set_remote(true);
406415 }
@@ -412,12 +421,14 @@ void VM::push_stop(int drv)
412421
413422 void VM::push_fast_forward(int drv)
414423 {
424+ drec->set_remote(false);
415425 drec->set_ff_rew(1);
416426 drec->set_remote(true);
417427 }
418428
419429 void VM::push_fast_rewind(int drv)
420430 {
431+ drec->set_remote(false);
421432 drec->set_ff_rew(-1);
422433 drec->set_remote(true);
423434 }
--- a/source/src/vm/pc2001/pc2001.cpp
+++ b/source/src/vm/pc2001/pc2001.cpp
@@ -215,14 +215,22 @@ void VM::set_sound_device_volume(int ch, int decibel_l, int decibel_r)
215215
216216 void VM::play_tape(int drv, const _TCHAR* file_path)
217217 {
218- drec->play_tape(file_path);
219-// drec->set_remote(true);
218+ bool remote = drec->get_remote();
219+
220+ if(drec->play_tape(file_path) && remote) {
221+ // if machine already sets remote on, start playing now
222+ push_play(drv);
223+ }
220224 }
221225
222226 void VM::rec_tape(int drv, const _TCHAR* file_path)
223227 {
224- drec->rec_tape(file_path);
225-// drec->set_remote(true);
228+ bool remote = drec->get_remote();
229+
230+ if(drec->rec_tape(file_path) && remote) {
231+ // if machine already sets remote on, start recording now
232+ push_play(drv);
233+ }
226234 }
227235
228236 void VM::close_tape(int drv)
@@ -230,7 +238,7 @@ void VM::close_tape(int drv)
230238 emu->lock_vm();
231239 drec->close_tape();
232240 emu->unlock_vm();
233-// drec->set_remote(false);
241+ drec->set_remote(false);
234242 }
235243
236244 bool VM::is_tape_inserted(int drv)
@@ -260,6 +268,7 @@ const _TCHAR* VM::get_tape_message(int drv)
260268
261269 void VM::push_play(int drv)
262270 {
271+ drec->set_remote(false);
263272 drec->set_ff_rew(0);
264273 drec->set_remote(true);
265274 }
@@ -271,12 +280,14 @@ void VM::push_stop(int drv)
271280
272281 void VM::push_fast_forward(int drv)
273282 {
283+ drec->set_remote(false);
274284 drec->set_ff_rew(1);
275285 drec->set_remote(true);
276286 }
277287
278288 void VM::push_fast_rewind(int drv)
279289 {
290+ drec->set_remote(false);
280291 drec->set_ff_rew(-1);
281292 drec->set_remote(true);
282293 }
--- a/source/src/vm/pc2001/pc2001.h
+++ b/source/src/vm/pc2001/pc2001.h
@@ -25,7 +25,7 @@
2525 #define MEMORY_BANK_SIZE 0x1000
2626
2727 // device informations for win32
28-#define WINDOW_MODE_BASE 2
28+#define WINDOW_MODE_BASE 3
2929 #define USE_TAPE 1
3030 #define USE_AUTO_KEY 6
3131 #define USE_AUTO_KEY_RELEASE 10
--- a/source/src/vm/pc6001/pc6001.cpp
+++ b/source/src/vm/pc6001/pc6001.cpp
@@ -585,8 +585,16 @@ void VM::play_tape(int drv, const _TCHAR* file_path)
585585 {
586586 if(support_sub_cpu) {
587587 // support both p6/p6t and wav
588- drec->play_tape(file_path);
589-// drec->set_remote(true);
588+#if 1
589+ bool remote = drec->get_remote();
590+
591+ if(drec->play_tape(file_path) && remote) {
592+ // if machine already sets remote on, start playing now
593+ push_play(drv);
594+ }
595+#else
596+ sub->play_tape(file_path); // temporary
597+#endif
590598 } else {
591599 // support only p6/p6t
592600 psub->play_tape(file_path);
@@ -597,9 +605,16 @@ void VM::rec_tape(int drv, const _TCHAR* file_path)
597605 {
598606 if(support_sub_cpu) {
599607 // support both p6/p6t and wav
608+#if 0
609+ bool remote = drec->get_remote();
610+
611+ if(drec->rec_tape(file_path) && remote) {
612+ // if machine already sets remote on, start recording now
613+ push_play(drv);
614+ }
615+#else
600616 sub->rec_tape(file_path); // temporary
601-// drec->rec_tape(file_path);
602-// drec->set_remote(true);
617+#endif
603618 } else {
604619 // support both p6/p6t and wav
605620 psub->rec_tape(file_path);
@@ -615,7 +630,7 @@ void VM::close_tape(int drv)
615630 emu->lock_vm();
616631 drec->close_tape();
617632 emu->unlock_vm();
618-// drec->set_remote(false);
633+ drec->set_remote(false);
619634 }
620635 } else {
621636 psub->close_tape();
@@ -670,6 +685,7 @@ const _TCHAR* VM::get_tape_message(int drv)
670685 void VM::push_play(int drv)
671686 {
672687 if(support_sub_cpu) {
688+ drec->set_remote(false);
673689 drec->set_ff_rew(0);
674690 drec->set_remote(true);
675691 }
@@ -685,6 +701,7 @@ void VM::push_stop(int drv)
685701 void VM::push_fast_forward(int drv)
686702 {
687703 if(support_sub_cpu) {
704+ drec->set_remote(false);
688705 drec->set_ff_rew(1);
689706 drec->set_remote(true);
690707 }
@@ -693,6 +710,7 @@ void VM::push_fast_forward(int drv)
693710 void VM::push_fast_rewind(int drv)
694711 {
695712 if(support_sub_cpu) {
713+ drec->set_remote(false);
696714 drec->set_ff_rew(-1);
697715 drec->set_remote(true);
698716 }
--- a/source/src/vm/pc6001/sub.h
+++ b/source/src/vm/pc6001/sub.h
@@ -73,6 +73,10 @@ public:
7373 {
7474 d_timer = device;
7575 }
76+ bool play_tape(const _TCHAR* file_path)
77+ {
78+ return false;
79+ }
7680 bool rec_tape(const _TCHAR* file_path);
7781 void close_tape();
7882 bool is_tape_inserted()
--- a/source/src/vm/pc8201/pc8201.cpp
+++ b/source/src/vm/pc8201/pc8201.cpp
@@ -243,8 +243,13 @@ bool VM::get_kana_locked()
243243 void VM::play_tape(int drv, const _TCHAR* file_path)
244244 {
245245 cmt->close_tape();
246- drec->play_tape(file_path);
247-// drec->set_remote(true);
246+
247+ bool remote = drec->get_remote();
248+
249+ if(drec->play_tape(file_path) && remote) {
250+ // if machine already sets remote on, start playing now
251+ push_play(drv);
252+ }
248253 }
249254
250255 void VM::rec_tape(int drv, const _TCHAR* file_path)
@@ -252,7 +257,8 @@ void VM::rec_tape(int drv, const _TCHAR* file_path)
252257 emu->lock_vm();
253258 drec->close_tape();
254259 emu->unlock_vm();
255-// drec->set_remote(false);
260+ drec->set_remote(false);
261+
256262 cmt->rec_tape(file_path);
257263 }
258264
@@ -261,7 +267,8 @@ void VM::close_tape(int drv)
261267 emu->lock_vm();
262268 drec->close_tape();
263269 emu->unlock_vm();
264-// drec->set_remote(false);
270+ drec->set_remote(false);
271+
265272 cmt->close_tape();
266273 }
267274
@@ -309,6 +316,7 @@ const _TCHAR* VM::get_tape_message(int drv)
309316 void VM::push_play(int drv)
310317 {
311318 if(drec->is_tape_inserted()) {
319+ drec->set_remote(false);
312320 drec->set_ff_rew(0);
313321 drec->set_remote(true);
314322 }
@@ -324,6 +332,7 @@ void VM::push_stop(int drv)
324332 void VM::push_fast_forward(int drv)
325333 {
326334 if(drec->is_tape_inserted()) {
335+ drec->set_remote(false);
327336 drec->set_ff_rew(1);
328337 drec->set_remote(true);
329338 }
@@ -332,6 +341,7 @@ void VM::push_fast_forward(int drv)
332341 void VM::push_fast_rewind(int drv)
333342 {
334343 if(drec->is_tape_inserted()) {
344+ drec->set_remote(false);
335345 drec->set_ff_rew(-1);
336346 drec->set_remote(true);
337347 }
--- a/source/src/vm/pc9801/pc9801.cpp
+++ b/source/src/vm/pc9801/pc9801.cpp
@@ -279,7 +279,11 @@ VM::VM(EMU* parent_emu) : VM_TEMPLATE(parent_emu)
279279 if(sound_type == 0 || sound_type == 1) {
280280 opn = new YM2203(this, emu);
281281 #ifdef SUPPORT_PC98_OPNA
282+ opn->set_device_name(_T("YM2608 OPNA (PC-9801-86)"));
282283 opn->is_ym2608 = true;
284+#else
285+ opn->set_device_name(_T("YM2203 OPN (PC-9801-26)"));
286+ opn->is_ym2608 = false;
283287 #endif
284288 fmsound = new FMSOUND(this, emu);
285289 joystick = new JOYSTICK(this, emu);
@@ -853,6 +857,7 @@ VM::VM(EMU* parent_emu) : VM_TEMPLATE(parent_emu)
853857 pc88opn->is_ym2608 = true;
854858 #else
855859 pc88opn->set_device_name(_T("YM2203 OPN (PC-8801)"));
860+ pc88opn->is_ym2608 = false;
856861 #endif
857862 pc88opn->set_context_event_manager(pc88event);
858863 pc88cpu = new Z80(this, emu);
@@ -1227,11 +1232,11 @@ void VM::initialize_sound(int rate, int samples)
12271232 beep->initialize_sound(rate, 8000);
12281233 #endif
12291234 if(sound_type == 0 || sound_type == 1) {
1230-#ifdef HAS_YM2608
1231- opn->initialize_sound(rate, 7987248, samples, 0, 0);
1232-#else
1233- opn->initialize_sound(rate, 3993624, samples, 0, 0);
1234-#endif
1235+ if(opn->is_ym2608) {
1236+ opn->initialize_sound(rate, 7987248, samples, 0, 0);
1237+ } else {
1238+ opn->initialize_sound(rate, 3993624, samples, 0, 0);
1239+ }
12351240 } else if(sound_type == 2 || sound_type == 3) {
12361241 tms3631->initialize_sound(rate, 8000);
12371242 }
@@ -1241,11 +1246,11 @@ void VM::initialize_sound(int rate, int samples)
12411246 pc88event->initialize_sound(rate, samples);
12421247
12431248 // init sound gen
1244-#ifdef HAS_YM2608
1245- pc88opn->initialize_sound(rate, 7987248, samples, 0, 0);
1246-#else
1247- pc88opn->initialize_sound(rate, 3993624, samples, 0, 0);
1248-#endif
1249+ if(pc88opn->is_ym2608) {
1250+ pc88opn->initialize_sound(rate, 7987248, samples, 0, 0);
1251+ } else {
1252+ pc88opn->initialize_sound(rate, 3993624, samples, 0, 0);
1253+ }
12491254 pc88pcm->initialize_sound(rate, 8000);
12501255 #endif
12511256 }
--- a/source/src/vm/pc9801/pc9801.h
+++ b/source/src/vm/pc9801/pc9801.h
@@ -226,9 +226,6 @@
226226 #if defined(_PC98DO) || defined(_PC98DOPLUS)
227227 #define Z80_MEMORY_WAIT
228228 #endif
229-#if defined(SUPPORT_PC98_OPNA) || defined(SUPPORT_PC88_OPNA)
230-#define HAS_YM2608
231-#endif
232229 #define I8259_MAX_CHIPS 2
233230 #define SINGLE_MODE_DMA
234231 #define OVERRIDE_SOUND_FREQ_48000HZ 55467
--- a/source/src/vm/phc20/phc20.cpp
+++ b/source/src/vm/phc20/phc20.cpp
@@ -181,14 +181,22 @@ void VM::set_sound_device_volume(int ch, int decibel_l, int decibel_r)
181181
182182 void VM::play_tape(int drv, const _TCHAR* file_path)
183183 {
184- drec->play_tape(file_path);
185-// drec->set_remote(true);
184+ bool remote = drec->get_remote();
185+
186+ if(drec->play_tape(file_path) && remote) {
187+ // if machine already sets remote on, start playing now
188+ push_play(drv);
189+ }
186190 }
187191
188192 void VM::rec_tape(int drv, const _TCHAR* file_path)
189193 {
190- drec->rec_tape(file_path);
191-// drec->set_remote(true);
194+ bool remote = drec->get_remote();
195+
196+ if(drec->rec_tape(file_path) && remote) {
197+ // if machine already sets remote on, start recording now
198+ push_play(drv);
199+ }
192200 }
193201
194202 void VM::close_tape(int drv)
@@ -196,7 +204,7 @@ void VM::close_tape(int drv)
196204 emu->lock_vm();
197205 drec->close_tape();
198206 emu->unlock_vm();
199-// drec->set_remote(false);
207+ drec->set_remote(false);
200208 }
201209
202210 bool VM::is_tape_inserted(int drv)
@@ -226,6 +234,7 @@ const _TCHAR* VM::get_tape_message(int drv)
226234
227235 void VM::push_play(int drv)
228236 {
237+ drec->set_remote(false);
229238 drec->set_ff_rew(0);
230239 drec->set_remote(true);
231240 }
@@ -237,12 +246,14 @@ void VM::push_stop(int drv)
237246
238247 void VM::push_fast_forward(int drv)
239248 {
249+ drec->set_remote(false);
240250 drec->set_ff_rew(1);
241251 drec->set_remote(true);
242252 }
243253
244254 void VM::push_fast_rewind(int drv)
245255 {
256+ drec->set_remote(false);
246257 drec->set_ff_rew(-1);
247258 drec->set_remote(true);
248259 }
--- a/source/src/vm/phc25/phc25.cpp
+++ b/source/src/vm/phc25/phc25.cpp
@@ -222,14 +222,22 @@ void VM::set_sound_device_volume(int ch, int decibel_l, int decibel_r)
222222
223223 void VM::play_tape(int drv, const _TCHAR* file_path)
224224 {
225- drec->play_tape(file_path);
226-// drec->set_remote(true);
225+ bool remote = drec->get_remote();
226+
227+ if(drec->play_tape(file_path) && remote) {
228+ // if machine already sets remote on, start playing now
229+ push_play(drv);
230+ }
227231 }
228232
229233 void VM::rec_tape(int drv, const _TCHAR* file_path)
230234 {
231- drec->rec_tape(file_path);
232-// drec->set_remote(true);
235+ bool remote = drec->get_remote();
236+
237+ if(drec->rec_tape(file_path) && remote) {
238+ // if machine already sets remote on, start recording now
239+ push_play(drv);
240+ }
233241 }
234242
235243 void VM::close_tape(int drv)
@@ -237,7 +245,7 @@ void VM::close_tape(int drv)
237245 emu->lock_vm();
238246 drec->close_tape();
239247 emu->unlock_vm();
240-// drec->set_remote(false);
248+ drec->set_remote(false);
241249 }
242250
243251 bool VM::is_tape_inserted(int drv)
@@ -267,6 +275,7 @@ const _TCHAR* VM::get_tape_message(int drv)
267275
268276 void VM::push_play(int drv)
269277 {
278+ drec->set_remote(false);
270279 drec->set_ff_rew(0);
271280 drec->set_remote(true);
272281 }
@@ -278,12 +287,14 @@ void VM::push_stop(int drv)
278287
279288 void VM::push_fast_forward(int drv)
280289 {
290+ drec->set_remote(false);
281291 drec->set_ff_rew(1);
282292 drec->set_remote(true);
283293 }
284294
285295 void VM::push_fast_rewind(int drv)
286296 {
297+ drec->set_remote(false);
287298 drec->set_ff_rew(-1);
288299 drec->set_remote(true);
289300 }
--- a/source/src/vm/pyuta/pyuta.cpp
+++ b/source/src/vm/pyuta/pyuta.cpp
@@ -207,14 +207,22 @@ bool VM::is_cart_inserted(int drv)
207207
208208 void VM::play_tape(int drv, const _TCHAR* file_path)
209209 {
210- drec->play_tape(file_path);
211-// drec->set_remote(true);
210+ bool remote = drec->get_remote();
211+
212+ if(drec->play_tape(file_path) && remote) {
213+ // if machine already sets remote on, start playing now
214+ push_play(drv);
215+ }
212216 }
213217
214218 void VM::rec_tape(int drv, const _TCHAR* file_path)
215219 {
216- drec->rec_tape(file_path);
217-// drec->set_remote(true);
220+ bool remote = drec->get_remote();
221+
222+ if(drec->rec_tape(file_path) && remote) {
223+ // if machine already sets remote on, start recording now
224+ push_play(drv);
225+ }
218226 }
219227
220228 void VM::close_tape(int drv)
@@ -222,7 +230,7 @@ void VM::close_tape(int drv)
222230 emu->lock_vm();
223231 drec->close_tape();
224232 emu->unlock_vm();
225-// drec->set_remote(false);
233+ drec->set_remote(false);
226234 }
227235
228236 bool VM::is_tape_inserted(int drv)
@@ -252,6 +260,7 @@ const _TCHAR* VM::get_tape_message(int drv)
252260
253261 void VM::push_play(int drv)
254262 {
263+ drec->set_remote(false);
255264 drec->set_ff_rew(0);
256265 drec->set_remote(true);
257266 }
@@ -263,12 +272,14 @@ void VM::push_stop(int drv)
263272
264273 void VM::push_fast_forward(int drv)
265274 {
275+ drec->set_remote(false);
266276 drec->set_ff_rew(1);
267277 drec->set_remote(true);
268278 }
269279
270280 void VM::push_fast_rewind(int drv)
271281 {
282+ drec->set_remote(false);
272283 drec->set_ff_rew(-1);
273284 drec->set_remote(true);
274285 }
--- a/source/src/vm/rx78/rx78.cpp
+++ b/source/src/vm/rx78/rx78.cpp
@@ -229,14 +229,22 @@ bool VM::is_cart_inserted(int drv)
229229
230230 void VM::play_tape(int drv, const _TCHAR* file_path)
231231 {
232- drec->play_tape(file_path);
233-// drec->set_remote(true);
232+ bool remote = drec->get_remote();
233+
234+ if(drec->play_tape(file_path) && remote) {
235+ // if machine already sets remote on, start playing now
236+ push_play(drv);
237+ }
234238 }
235239
236240 void VM::rec_tape(int drv, const _TCHAR* file_path)
237241 {
238- drec->rec_tape(file_path);
239-// drec->set_remote(true);
242+ bool remote = drec->get_remote();
243+
244+ if(drec->rec_tape(file_path) && remote) {
245+ // if machine already sets remote on, start recording now
246+ push_play(drv);
247+ }
240248 }
241249
242250 void VM::close_tape(int drv)
@@ -244,7 +252,7 @@ void VM::close_tape(int drv)
244252 emu->lock_vm();
245253 drec->close_tape();
246254 emu->unlock_vm();
247-// drec->set_remote(false);
255+ drec->set_remote(false);
248256 }
249257
250258 bool VM::is_tape_inserted(int drv)
@@ -274,6 +282,7 @@ const _TCHAR* VM::get_tape_message(int drv)
274282
275283 void VM::push_play(int drv)
276284 {
285+ drec->set_remote(false);
277286 drec->set_ff_rew(0);
278287 drec->set_remote(true);
279288 }
@@ -285,12 +294,14 @@ void VM::push_stop(int drv)
285294
286295 void VM::push_fast_forward(int drv)
287296 {
297+ drec->set_remote(false);
288298 drec->set_ff_rew(1);
289299 drec->set_remote(true);
290300 }
291301
292302 void VM::push_fast_rewind(int drv)
293303 {
304+ drec->set_remote(false);
294305 drec->set_ff_rew(-1);
295306 drec->set_remote(true);
296307 }
--- a/source/src/vm/sc3000/sc3000.cpp
+++ b/source/src/vm/sc3000/sc3000.cpp
@@ -284,14 +284,22 @@ uint32_t VM::is_floppy_disk_accessed()
284284
285285 void VM::play_tape(int drv, const _TCHAR* file_path)
286286 {
287- drec->play_tape(file_path);
288-// drec->set_remote(true);
287+ bool remote = drec->get_remote();
288+
289+ if(drec->play_tape(file_path) && remote) {
290+ // if machine already sets remote on, start playing now
291+ push_play(drv);
292+ }
289293 }
290294
291295 void VM::rec_tape(int drv, const _TCHAR* file_path)
292296 {
293- drec->rec_tape(file_path);
294-// drec->set_remote(true);
297+ bool remote = drec->get_remote();
298+
299+ if(drec->rec_tape(file_path) && remote) {
300+ // if machine already sets remote on, start recording now
301+ push_play(drv);
302+ }
295303 }
296304
297305 void VM::close_tape(int drv)
@@ -299,7 +307,7 @@ void VM::close_tape(int drv)
299307 emu->lock_vm();
300308 drec->close_tape();
301309 emu->unlock_vm();
302-// drec->set_remote(false);
310+ drec->set_remote(false);
303311 }
304312
305313 bool VM::is_tape_inserted(int drv)
@@ -329,6 +337,7 @@ const _TCHAR* VM::get_tape_message(int drv)
329337
330338 void VM::push_play(int drv)
331339 {
340+ drec->set_remote(false);
332341 drec->set_ff_rew(0);
333342 drec->set_remote(true);
334343 }
@@ -340,12 +349,14 @@ void VM::push_stop(int drv)
340349
341350 void VM::push_fast_forward(int drv)
342351 {
352+ drec->set_remote(false);
343353 drec->set_ff_rew(1);
344354 drec->set_remote(true);
345355 }
346356
347357 void VM::push_fast_rewind(int drv)
348358 {
359+ drec->set_remote(false);
349360 drec->set_ff_rew(-1);
350361 drec->set_remote(true);
351362 }
--- a/source/src/vm/smb80te/smb80te.cpp
+++ b/source/src/vm/smb80te/smb80te.cpp
@@ -221,14 +221,22 @@ void VM::key_up(int code)
221221
222222 void VM::play_tape(int drv, const _TCHAR* file_path)
223223 {
224- drec->play_tape(file_path);
225-// drec->set_remote(true);
224+ bool remote = drec->get_remote();
225+
226+ if(drec->play_tape(file_path) && remote) {
227+ // if machine already sets remote on, start playing now
228+ push_play(drv);
229+ }
226230 }
227231
228232 void VM::rec_tape(int drv, const _TCHAR* file_path)
229233 {
230- drec->rec_tape(file_path);
231-// drec->set_remote(true);
234+ bool remote = drec->get_remote();
235+
236+ if(drec->rec_tape(file_path) && remote) {
237+ // if machine already sets remote on, start recording now
238+ push_play(drv);
239+ }
232240 }
233241
234242 void VM::close_tape(int drv)
@@ -236,7 +244,7 @@ void VM::close_tape(int drv)
236244 emu->lock_vm();
237245 drec->close_tape();
238246 emu->unlock_vm();
239-// drec->set_remote(false);
247+ drec->set_remote(false);
240248 }
241249
242250 bool VM::is_tape_inserted(int drv)
@@ -266,6 +274,7 @@ const _TCHAR* VM::get_tape_message(int drv)
266274
267275 void VM::push_play(int drv)
268276 {
277+ drec->set_remote(false);
269278 drec->set_ff_rew(0);
270279 drec->set_remote(true);
271280 }
@@ -277,12 +286,14 @@ void VM::push_stop(int drv)
277286
278287 void VM::push_fast_forward(int drv)
279288 {
289+ drec->set_remote(false);
280290 drec->set_ff_rew(1);
281291 drec->set_remote(true);
282292 }
283293
284294 void VM::push_fast_rewind(int drv)
285295 {
296+ drec->set_remote(false);
286297 drec->set_ff_rew(-1);
287298 drec->set_remote(true);
288299 }
--- a/source/src/vm/smc777/memory.cpp
+++ b/source/src/vm/smc777/memory.cpp
@@ -17,6 +17,10 @@
1717 #include "../pcm1bit.h"
1818
1919 #define EVENT_KEY_REPEAT 0
20+#define EVENT_TEXT_BLINK 1
21+
22+#define IRQ_BIT_VSYNC 1
23+#define IRQ_BIT_KEYIN 2
2024
2125 namespace SMC777 {
2226
@@ -149,9 +153,6 @@ void MEMORY::initialize()
149153 }
150154 #endif
151155 delete fio;
152-
153-
154-
155156
156157 // initialize inputs
157158 initialize_key();
@@ -168,14 +169,21 @@ void MEMORY::initialize()
168169 for(int i = 0; i < 16 + 16; i++) {
169170 palette_pc[i] = RGB_COLOR(color_table[i & 15][0], color_table[i & 15][1], color_table[i & 15][2]);
170171 }
172+#if defined(_SMC70)
173+ palette_bw_pc[0] = RGB_COLOR( 0, 0, 0);
174+ palette_bw_pc[1] = RGB_COLOR(255, 255, 255);
175+#endif
176+
171177 vsup = false;
172178 #if defined(_SMC777)
173179 use_palette_text = use_palette_graph = false;
174180 memset(pal, 0, sizeof(pal));
175181 #endif
182+ vsync_irq = false;
176183
177184 // register event
178185 register_frame_event(this);
186+ register_event(this, EVENT_TEXT_BLINK, 1000000.0 / 8.0, true, NULL); // 2.6Hz-4.4Hz
179187 }
180188
181189 void MEMORY::reset()
@@ -189,10 +197,11 @@ void MEMORY::reset()
189197 key_repeat_event = -1;
190198
191199 gcw = 0x80;
192- vsync = disp = false;
200+ vsync = disp = blink = false;
193201 cblink = 0;
194202
195203 ief_key = ief_vsync = false;//true;
204+// vsync_irq = false;
196205 fdc_irq = fdc_drq = false;
197206 drec_in = false;
198207 }
@@ -557,7 +566,13 @@ uint32_t MEMORY::read_io8_debug(uint32_t addr)
557566 return gcw;
558567 case 0x21:
559568 // is this okay???
560- return ief_vsync ? 1 : 0;
569+ {
570+ uint32_t value = vsync_irq ? 1 : 0;
571+ if(!(d_cpu->read_signal(SIG_CPU_IRQ) & IRQ_BIT_VSYNC)) {
572+ vsync_irq = false;
573+ }
574+ return value;
575+ }
561576 #if defined(_SMC70)
562577 case 0x25:
563578 return (rtc_busy ? 0x80 : 0) | (rtc_data & 0x0f);
@@ -584,6 +599,13 @@ uint32_t MEMORY::read_io8_debug(uint32_t addr)
584599 // bit0: ~F 0 = joystick forward on
585600 {
586601 uint32_t stat = joy_stat[(addr & 0x100) ? 0 : 1];
602+ if(addr & 0x100) {
603+ if(key_stat[0x26]) stat |= 0x01; // up
604+ if(key_stat[0x28]) stat |= 0x02; // down
605+ if(key_stat[0x25]) stat |= 0x04; // left
606+ if(key_stat[0x27]) stat |= 0x08; // right
607+ if(key_stat[0x20]) stat |= 0x10; // space
608+ }
587609 return (~stat & 0x1f) | (disp ? 0x80 : 0);
588610 }
589611 #endif
@@ -616,9 +638,11 @@ void MEMORY::write_signal(int id, uint32_t data, uint32_t mask)
616638 } else if(id == SIG_MEMORY_CRTC_DISP) {
617639 disp = ((data & mask) != 0);
618640 } else if(id == SIG_MEMORY_CRTC_VSYNC) {
641+ bool prev = vsync;
619642 vsync = ((data & mask) != 0);
620- if((data & mask) && ief_vsync) {
621- d_cpu->write_signal(SIG_CPU_IRQ, 1, 1);
643+ if(prev && !vsync && ief_vsync) {
644+ vsync_irq = true;
645+ d_cpu->write_signal(SIG_CPU_IRQ, IRQ_BIT_VSYNC, IRQ_BIT_VSYNC);
622646 }
623647 } else if(id == SIG_MEMORY_DATAREC_IN) {
624648 drec_in = ((data & mask) != 0);
@@ -686,7 +710,7 @@ void MEMORY::key_down_up(int code, bool down)
686710 }
687711 if(down && key_code != code) {
688712 if(ief_key) {
689- d_cpu->write_signal(SIG_CPU_IRQ, 1, 1);
713+ d_cpu->write_signal(SIG_CPU_IRQ, IRQ_BIT_KEYIN, IRQ_BIT_KEYIN);
690714 }
691715 if(key_repeat_event != -1) {
692716 cancel_event(this, key_repeat_event);
@@ -709,10 +733,12 @@ void MEMORY::event_callback(int event_id, int err)
709733 {
710734 if(event_id == EVENT_KEY_REPEAT) {
711735 if(ief_key) {
712- d_cpu->write_signal(SIG_CPU_IRQ, 1, 1);
736+ d_cpu->write_signal(SIG_CPU_IRQ, IRQ_BIT_KEYIN, IRQ_BIT_KEYIN);
713737 }
714738 key_status |= 5;
715739 register_event(this, EVENT_KEY_REPEAT, key_repeat_interval * 1000, false, &key_repeat_event);
740+ } else if(event_id == EVENT_TEXT_BLINK) {
741+ blink = !blink;
716742 }
717743 }
718744
@@ -723,6 +749,11 @@ void MEMORY::event_frame()
723749
724750 void MEMORY::draw_screen()
725751 {
752+#if defined(_SMC70)
753+ if((gcw & 0x0c) == 0x0c) {
754+ emu->screen_skip_line(false);
755+ } else
756+#endif
726757 emu->screen_skip_line(true);
727758
728759 if(vsup) {
@@ -742,21 +773,43 @@ void MEMORY::draw_screen()
742773 } else {
743774 draw_text_80x25();
744775 }
776+#if defined(_SMC777)
745777 if(gcw & 0x08) {
746778 draw_graph_640x200();
747779 } else {
748780 draw_graph_320x200();
749781 }
782+#else
783+ switch(gcw & 0x0c) {
784+ case 0x00: draw_graph_160x100(); break;
785+ case 0x04: draw_graph_320x200(); break;
786+ case 0x08: draw_graph_640x200(); break;
787+ case 0x0c: draw_graph_640x400(); break;
788+ }
789+#endif
750790
751791 // copy to screen buffer
752792 #if defined(_SMC777)
753- scrntype_t *palette_pc_text = &palette_pc[use_palette_text ? 16 : 0];
754- scrntype_t *palette_pc_graph = &palette_pc[use_palette_graph ? 16 : 0];
793+ scrntype_t *palette_text_pc = &palette_pc[use_palette_text ? 16 : 0];
794+ scrntype_t *palette_graph_pc = &palette_pc[use_palette_graph ? 16 : 0];
755795 #else
756- #define palette_pc_text palette_pc
757- #define palette_pc_graph palette_pc
758-#endif
796+ #define palette_text_pc palette_pc
797+// #define palette_graph_pc palette_pc
798+ scrntype_t *palette_graph_pc = ((gcw & 0x0c) == 0x0c) ? palette_bw_pc : palette_pc;
759799
800+ if((gcw & 0x0c) == 0x0c) {
801+ for(int y = 0; y < 400; y++) {
802+ scrntype_t* dest = emu->get_screen_buffer(y);
803+ uint8_t* src_t = text[y >> 1];
804+ uint8_t* src_g = graph[y];
805+
806+ for(int x = 0; x < 640; x++) {
807+ uint8_t t = src_t[x];
808+ dest[x] = t ? palette_text_pc[t & 15] : palette_graph_pc[src_g[x]];
809+ }
810+ }
811+ } else
812+#endif
760813 for(int y = 0; y < 200; y++) {
761814 scrntype_t* dest0 = emu->get_screen_buffer(y * 2);
762815 scrntype_t* dest1 = emu->get_screen_buffer(y * 2 + 1);
@@ -765,7 +818,7 @@ void MEMORY::draw_screen()
765818
766819 for(int x = 0; x < 640; x++) {
767820 uint8_t t = src_t[x];
768- dest0[x] = t ? palette_pc_text[t & 15] : palette_pc_graph[src_g[x]];
821+ dest0[x] = t ? palette_text_pc[t & 15] : palette_graph_pc[src_g[x]];
769822 }
770823 if(config.scan_line) {
771824 memset(dest1, 0, 640 * sizeof(scrntype_t));
@@ -779,7 +832,7 @@ void MEMORY::draw_text_80x25()
779832 {
780833 int hz = crtc_regs[1];
781834 int vt = crtc_regs[6] & 0x7f;
782- int ht = (crtc_regs[9] & 0x1f) + 1;
835+ int ht = 8;// (crtc_regs[9] & 0x1f) + 1;
783836 uint8_t bp = crtc_regs[10] & 0x60;
784837 uint16_t src = (crtc_regs[12] << 8) | crtc_regs[13];
785838 uint16_t cursor = (crtc_regs[14] << 8) | crtc_regs[15];
@@ -795,8 +848,8 @@ void MEMORY::draw_text_80x25()
795848 if(attr & 0x80) {
796849 attr = 7;
797850 }
798- bool blink = ((attr & 0x40) && (cblink & 0x20));
799- bool reverse = (((attr & 0x20) != 0) != blink);
851+ bool blink_tmp = ((attr & 0x40) && blink);
852+ bool reverse = (((attr & 0x20) != 0) != blink_tmp);
800853
801854 uint8_t front = (attr & 7) | 16, back;
802855 switch((attr >> 3) & 3) {
@@ -848,7 +901,7 @@ void MEMORY::draw_text_40x25()
848901 {
849902 int hz = crtc_regs[1];
850903 int vt = crtc_regs[6] & 0x7f;
851- int ht = (crtc_regs[9] & 0x1f) + 1;
904+ int ht = 8;// (crtc_regs[9] & 0x1f) + 1;
852905 uint8_t bp = crtc_regs[10] & 0x60;
853906 uint16_t src = (crtc_regs[12] << 8) | crtc_regs[13];
854907 uint16_t cursor = (crtc_regs[14] << 8) | crtc_regs[15];
@@ -865,8 +918,8 @@ void MEMORY::draw_text_40x25()
865918 if(attr & 0x80) {
866919 attr = 7;
867920 }
868- bool blink = ((attr & 0x40) && (cblink & 0x20));
869- bool reverse = (((attr & 0x20) != 0) != blink);
921+ bool blink_tmp = ((attr & 0x40) && blink);
922+ bool reverse = (((attr & 0x20) != 0) != blink_tmp);
870923
871924 uint8_t front = (attr & 7) | 16, back;
872925 switch((attr >> 3) & 3) {
@@ -914,6 +967,47 @@ void MEMORY::draw_text_40x25()
914967 }
915968 }
916969
970+void MEMORY::draw_graph_640x400()
971+{
972+ int hz = crtc_regs[1];
973+ int vt = crtc_regs[6] & 0x7f;
974+ int ht = 8;// (crtc_regs[9] & 0x1f) + 1;
975+ uint16_t src = (crtc_regs[12] << 8) | crtc_regs[13];
976+
977+ for(int y = 0; y < vt && y < 25; y++) {
978+ for(int x = 0; x < hz && x < 80; x++) {
979+ for(int l = 0; l < ht; l++) {
980+ uint8_t pat0 = gram[(src + 0x1000 * l ) & 0x7fff];
981+ uint8_t pat1 = gram[(src + 0x1000 * l + 1) & 0x7fff];
982+ int yy = y * ht + l;
983+ if(yy >= 200) {
984+ break;
985+ }
986+ uint8_t* d0 = &graph[2 * yy ][x << 3];
987+ uint8_t* d1 = &graph[2 * yy + 1][x << 3];
988+ // FIXME: is this correct?
989+ d0[0] = (pat0 >> 7) ;
990+ d0[1] = (pat0 >> 6) & 1;
991+ d0[2] = (pat0 >> 5) & 1;
992+ d0[3] = (pat0 >> 4) & 1;
993+ d0[4] = (pat0 >> 3) & 1;
994+ d0[5] = (pat0 >> 2) & 1;
995+ d0[6] = (pat0 >> 1) & 1;
996+ d0[7] = (pat0 ) & 1;
997+ d1[0] = (pat1 >> 7) ;
998+ d1[1] = (pat1 >> 6) & 1;
999+ d1[2] = (pat1 >> 5) & 1;
1000+ d1[3] = (pat1 >> 4) & 1;
1001+ d1[4] = (pat1 >> 3) & 1;
1002+ d1[5] = (pat1 >> 2) & 1;
1003+ d1[6] = (pat1 >> 1) & 1;
1004+ d1[7] = (pat1 ) & 1;
1005+ }
1006+ src += 2;
1007+ }
1008+ }
1009+}
1010+
9171011 void MEMORY::draw_graph_640x200()
9181012 {
9191013 static const uint8_t color_table[2][4] = {{0, 4, 2, 1}, {0, 4, 2, 7}};
@@ -921,7 +1015,7 @@ void MEMORY::draw_graph_640x200()
9211015
9221016 int hz = crtc_regs[1];
9231017 int vt = crtc_regs[6] & 0x7f;
924- int ht = (crtc_regs[9] & 0x1f) + 1;
1018+ int ht = 8;// (crtc_regs[9] & 0x1f) + 1;
9251019 uint16_t src = (crtc_regs[12] << 8) | crtc_regs[13];
9261020
9271021 for(int y = 0; y < vt && y < 25; y++) {
@@ -952,7 +1046,7 @@ void MEMORY::draw_graph_320x200()
9521046 {
9531047 int hz = crtc_regs[1];
9541048 int vt = crtc_regs[6] & 0x7f;
955- int ht = (crtc_regs[9] & 0x1f) + 1;
1049+ int ht = 8;// (crtc_regs[9] & 0x1f) + 1;
9561050 uint16_t src = (crtc_regs[12] << 8) | crtc_regs[13];
9571051
9581052 for(int y = 0; y < vt && y < 25; y++) {
@@ -975,7 +1069,36 @@ void MEMORY::draw_graph_320x200()
9751069 }
9761070 }
9771071
978-#define STATE_VERSION 3
1072+void MEMORY::draw_graph_160x100()
1073+{
1074+ int hz = crtc_regs[1];
1075+ int vt = crtc_regs[6] & 0x7f;
1076+ int ht = 8;// (crtc_regs[9] & 0x1f) + 1;
1077+ uint16_t src = (crtc_regs[12] << 8) | crtc_regs[13];
1078+
1079+ src += 0x1000 * ((gcw >> 1) & 1) + (gcw & 1);
1080+
1081+ for(int y = 0; y < vt && y < 25; y++) {
1082+ for(int x = 0; x < hz && x < 80; x++) {
1083+ for(int l = 0; l < ht; l += 2) {
1084+ uint8_t pat = gram[(src + 0x1000 * l) & 0x7fff];
1085+ int yy = y * ht + l;
1086+ if(yy >= 200) {
1087+ break;
1088+ }
1089+ uint8_t* d0 = &graph[yy ][x << 3];
1090+ uint8_t* d1 = &graph[yy + 1][x << 3];
1091+ d0[0] = d0[1] = d0[2] = d0[3] =
1092+ d1[0] = d1[1] = d1[2] = d1[3] = pat >> 4;
1093+ d0[4] = d0[5] = d0[6] = d0[7] =
1094+ d1[4] = d1[5] = d1[6] = d1[7] = pat & 15;
1095+ }
1096+ src += 2;
1097+ }
1098+ }
1099+}
1100+
1101+#define STATE_VERSION 4
9791102
9801103 bool MEMORY::process_state(FILEIO* state_fio, bool loading)
9811104 {
@@ -1027,6 +1150,7 @@ bool MEMORY::process_state(FILEIO* state_fio, bool loading)
10271150 state_fio->StateValue(kanji_lo);
10281151 state_fio->StateValue(ief_key);
10291152 state_fio->StateValue(ief_vsync);
1153+ state_fio->StateValue(vsync_irq);
10301154 state_fio->StateValue(fdc_irq);
10311155 state_fio->StateValue(fdc_drq);
10321156 state_fio->StateValue(drec_in);
--- a/source/src/vm/smc777/memory.h
+++ b/source/src/vm/smc777/memory.h
@@ -83,7 +83,7 @@ private:
8383 // display
8484 uint8_t gcw;
8585 bool vsup;
86- bool vsync, disp;
86+ bool vsync, disp, blink;
8787 int cblink;
8888 #if defined(_SMC777)
8989 bool use_palette_text;
@@ -93,13 +93,18 @@ private:
9393 } pal[16];
9494 #endif
9595 uint8_t text[200][640];
96- uint8_t graph[200][640];
96+ uint8_t graph[400][640];
9797 scrntype_t palette_pc[16 + 16]; // color generator + palette board
98+#if defined(_SMC70)
99+ scrntype_t palette_bw_pc[2];
100+#endif
98101
99102 void draw_text_80x25();
100103 void draw_text_40x25();
104+ void draw_graph_640x400();
101105 void draw_graph_640x200();
102106 void draw_graph_320x200();
107+ void draw_graph_160x100();
103108
104109 // kanji rom
105110 uint8_t kanji[0x23400];
@@ -110,6 +115,7 @@ private:
110115
111116 // misc
112117 bool ief_key, ief_vsync;
118+ bool vsync_irq;
113119 bool fdc_irq, fdc_drq;
114120 bool drec_in;
115121 #if defined(_SMC70)
--- a/source/src/vm/smc777/smc777.cpp
+++ b/source/src/vm/smc777/smc777.cpp
@@ -315,14 +315,22 @@ uint32_t VM::is_floppy_disk_accessed()
315315
316316 void VM::play_tape(int drv, const _TCHAR* file_path)
317317 {
318- drec->play_tape(file_path);
319-// drec->set_remote(true);
318+ bool remote = drec->get_remote();
319+
320+ if(drec->play_tape(file_path) && remote) {
321+ // if machine already sets remote on, start playing now
322+ push_play(drv);
323+ }
320324 }
321325
322326 void VM::rec_tape(int drv, const _TCHAR* file_path)
323327 {
324- drec->rec_tape(file_path);
325-// drec->set_remote(true);
328+ bool remote = drec->get_remote();
329+
330+ if(drec->rec_tape(file_path) && remote) {
331+ // if machine already sets remote on, start recording now
332+ push_play(drv);
333+ }
326334 }
327335
328336 void VM::close_tape(int drv)
@@ -330,7 +338,7 @@ void VM::close_tape(int drv)
330338 emu->lock_vm();
331339 drec->close_tape();
332340 emu->unlock_vm();
333-// drec->set_remote(false);
341+ drec->set_remote(false);
334342 }
335343
336344 bool VM::is_tape_inserted(int drv)
@@ -360,6 +368,7 @@ const _TCHAR* VM::get_tape_message(int drv)
360368
361369 void VM::push_play(int drv)
362370 {
371+ drec->set_remote(false);
363372 drec->set_ff_rew(0);
364373 drec->set_remote(true);
365374 }
@@ -371,12 +380,14 @@ void VM::push_stop(int drv)
371380
372381 void VM::push_fast_forward(int drv)
373382 {
383+ drec->set_remote(false);
374384 drec->set_ff_rew(1);
375385 drec->set_remote(true);
376386 }
377387
378388 void VM::push_fast_rewind(int drv)
379389 {
390+ drec->set_remote(false);
380391 drec->set_ff_rew(-1);
381392 drec->set_remote(true);
382393 }
--- a/source/src/vm/tk80bs/tk80bs.cpp
+++ b/source/src/vm/tk80bs/tk80bs.cpp
@@ -406,8 +406,12 @@ void VM::save_binary(int drv, const _TCHAR* file_path)
406406 void VM::play_tape(int drv, const _TCHAR* file_path)
407407 {
408408 if(drv == 0) {
409- drec->play_tape(file_path);
410-// drec->set_remote(true);
409+ bool remote = drec->get_remote();
410+
411+ if(drec->play_tape(file_path) && remote) {
412+ // if machine already sets remote on, start playing now
413+ push_play(drv);
414+ }
411415 #if defined(_TK80BS)
412416 } else if(drv == 1) {
413417 cmt->play_tape(file_path);
@@ -418,8 +422,12 @@ void VM::play_tape(int drv, const _TCHAR* file_path)
418422 void VM::rec_tape(int drv, const _TCHAR* file_path)
419423 {
420424 if(drv == 0) {
421- drec->rec_tape(file_path);
422-// drec->set_remote(true);
425+ bool remote = drec->get_remote();
426+
427+ if(drec->rec_tape(file_path) && remote) {
428+ // if machine already sets remote on, start recording now
429+ push_play(drv);
430+ }
423431 #if defined(_TK80BS)
424432 } else if(drv == 1) {
425433 cmt->rec_tape(file_path);
@@ -433,7 +441,7 @@ void VM::close_tape(int drv)
433441 emu->lock_vm();
434442 drec->close_tape();
435443 emu->unlock_vm();
436-// drec->set_remote(false);
444+ drec->set_remote(false);
437445 #if defined(_TK80BS)
438446 } else if(drv == 1) {
439447 cmt->close_tape();
@@ -500,6 +508,7 @@ const _TCHAR* VM::get_tape_message(int drv)
500508 void VM::push_play(int drv)
501509 {
502510 if(drv == 0) {
511+ drec->set_remote(false);
503512 drec->set_ff_rew(0);
504513 drec->set_remote(true);
505514 }
@@ -515,6 +524,7 @@ void VM::push_stop(int drv)
515524 void VM::push_fast_forward(int drv)
516525 {
517526 if(drv == 0) {
527+ drec->set_remote(false);
518528 drec->set_ff_rew(1);
519529 drec->set_remote(true);
520530 }
@@ -523,6 +533,7 @@ void VM::push_fast_forward(int drv)
523533 void VM::push_fast_rewind(int drv)
524534 {
525535 if(drv == 0) {
536+ drec->set_remote(false);
526537 drec->set_ff_rew(-1);
527538 drec->set_remote(true);
528539 }
--- a/source/src/vm/x07/x07.h
+++ b/source/src/vm/x07/x07.h
@@ -30,7 +30,7 @@
3030 #define TV_WINDOW_WIDTH TV_SCREEN_WIDTH
3131 #define TV_WINDOW_HEIGHT TV_SCREEN_HEIGHT
3232
33-#define WINDOW_MODE_BASE 2
33+#define WINDOW_MODE_BASE 3
3434 #define USE_TAPE 1
3535 #define TAPE_BINARY_ONLY
3636 #define USE_KEY_LOCKED
--- a/source/src/vm/x1/x1.cpp
+++ b/source/src/vm/x1/x1.cpp
@@ -812,25 +812,37 @@ uint32_t VM::is_hard_disk_accessed()
812812
813813 void VM::play_tape(int drv, const _TCHAR* file_path)
814814 {
815- bool value = drec->play_tape(file_path);
815+ bool remote = drec->get_remote();
816+ bool opened = drec->play_tape(file_path);
817+
818+ if(opened && remote) {
819+ // if machine already sets remote on, start playing now
820+ push_play(drv);
821+ }
816822 if(pseudo_sub_cpu) {
817823 psub->close_tape();
818- psub->play_tape(value);
824+ psub->play_tape(opened);
819825 } else {
820826 sub->close_tape();
821- sub->play_tape(value);
827+ sub->play_tape(opened);
822828 }
823829 }
824830
825831 void VM::rec_tape(int drv, const _TCHAR* file_path)
826832 {
827- bool value = drec->rec_tape(file_path);
833+ bool remote = drec->get_remote();
834+ bool opened = drec->rec_tape(file_path);
835+
836+ if(opened && remote) {
837+ // if machine already sets remote on, start recording now
838+ push_play(drv);
839+ }
828840 if(pseudo_sub_cpu) {
829841 psub->close_tape();
830- psub->rec_tape(value);
842+ psub->rec_tape(opened);
831843 } else {
832844 sub->close_tape();
833- sub->rec_tape(value);
845+ sub->rec_tape(opened);
834846 }
835847 }
836848
@@ -839,6 +851,8 @@ void VM::close_tape(int drv)
839851 emu->lock_vm();
840852 drec->close_tape();
841853 emu->unlock_vm();
854+ drec->set_remote(false);
855+
842856 if(pseudo_sub_cpu) {
843857 psub->close_tape();
844858 } else {
@@ -873,6 +887,7 @@ const _TCHAR* VM::get_tape_message(int drv)
873887
874888 void VM::push_play(int drv)
875889 {
890+ drec->set_remote(false);
876891 drec->set_ff_rew(0);
877892 drec->set_remote(true);
878893 }
@@ -884,12 +899,14 @@ void VM::push_stop(int drv)
884899
885900 void VM::push_fast_forward(int drv)
886901 {
902+ drec->set_remote(false);
887903 drec->set_ff_rew(1);
888904 drec->set_remote(true);
889905 }
890906
891907 void VM::push_fast_rewind(int drv)
892908 {
909+ drec->set_remote(false);
893910 drec->set_ff_rew(-1);
894911 drec->set_remote(true);
895912 }
--- a/source/src/vm/yalky/yalky.cpp
+++ b/source/src/vm/yalky/yalky.cpp
@@ -203,16 +203,26 @@ void VM::set_sound_device_volume(int ch, int decibel_l, int decibel_r)
203203
204204 void VM::play_tape(int drv, const _TCHAR* file_path)
205205 {
206+ bool remote = drec->get_remote();
207+
206208 if(drec->play_tape(file_path)) {
207- drec->set_remote(true);
209+ if(remote) {
210+ // if machine already sets remote on, start playing now
211+ push_play(drv);
212+ }
208213 io->open_tape();
209214 }
210215 }
211216
212217 void VM::rec_tape(int drv, const _TCHAR* file_path)
213218 {
219+ bool remote = drec->get_remote();
220+
214221 if(drec->rec_tape(file_path)) {
215- drec->set_remote(true);
222+ if(remote) {
223+ // if machine already sets remote on, start recording now
224+ push_play(drv);
225+ }
216226 io->open_tape();
217227 }
218228 }
@@ -252,6 +262,7 @@ const _TCHAR* VM::get_tape_message(int drv)
252262
253263 void VM::push_play(int drv)
254264 {
265+ drec->set_remote(false);
255266 drec->set_ff_rew(0);
256267 drec->set_remote(true);
257268 }
@@ -263,12 +274,14 @@ void VM::push_stop(int drv)
263274
264275 void VM::push_fast_forward(int drv)
265276 {
277+ drec->set_remote(false);
266278 drec->set_ff_rew(1);
267279 drec->set_remote(true);
268280 }
269281
270282 void VM::push_fast_rewind(int drv)
271283 {
284+ drec->set_remote(false);
272285 drec->set_ff_rew(-1);
273286 drec->set_remote(true);
274287 }
Show on old repository browser