• R/O
  • HTTP
  • SSH
  • HTTPS

common_source_project-fm7: Commit

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


Commit MetaInfo

Revision876abe285d288971e70d4ca8267cf5bf13d2a498 (tree)
Zeit2017-05-30 16:49:25
AutorK.Ohta <whatisthis.sowhat@gmai...>
CommiterK.Ohta

Log Message

[General][VM] Re-factoring VMs, sync to Upstream.

Ändern Zusammenfassung

Diff

--- a/source/src/vm/babbage2nd/babbage2nd.cpp
+++ b/source/src/vm/babbage2nd/babbage2nd.cpp
@@ -51,13 +51,8 @@ VM::VM(EMU* parent_emu) : emu(parent_emu)
5151 // Set names
5252 #if defined(_USE_QT)
5353 dummy->set_device_name(_T("1st Dummy"));
54- event->set_device_name(_T("EVENT"));
55- cpu->set_device_name(_T("CPU(Z80)"));
56- ctc->set_device_name(_T("Z80 CTC"));
5754 pio1->set_device_name(_T("Z80 PIO(LEDs)"));
5855 pio2->set_device_name(_T("Z80 PIO(7SEG/KEYBOARD)"));
59- display->set_device_name(_T("7SEG/LEDs"));
60- keyboard->set_device_name(_T("KEYBOARD"));
6156 #endif
6257 // set contexts
6358 event->set_context_cpu(cpu);
--- a/source/src/vm/bmjr/bmjr.cpp
+++ b/source/src/vm/bmjr/bmjr.cpp
@@ -46,10 +46,6 @@ VM::VM(EMU* parent_emu) : emu(parent_emu)
4646 // Set names
4747 #if defined(_USE_QT)
4848 dummy->set_device_name(_T("1st Dummy"));
49- event->set_device_name(_T("EVENT"));
50- cpu->set_device_name(_T("CPU(MC6800)"));
51- pia->set_device_name(_T("MC6820 PIA"));
52- memory->set_device_name(_T("MEMORY"));
5349 #endif
5450 // set contexts
5551 event->set_context_cpu(cpu);
@@ -183,7 +179,6 @@ void VM::set_sound_device_volume(int ch, int decibel_l, int decibel_r)
183179 drec->get_context_noise_stop()->set_volume(0, decibel_l, decibel_r);
184180 drec->get_context_noise_fast()->set_volume(0, decibel_l, decibel_r);
185181 }
186-
187182 }
188183 #endif
189184
--- a/source/src/vm/bmjr/memory.cpp
+++ b/source/src/vm/bmjr/memory.cpp
@@ -263,16 +263,16 @@ void MEMORY::event_frame()
263263 #if defined(_USE_QT)
264264 // If same as bm2, not effect below keys at Qt version.
265265 if(key_stat[VK_LCONTROL]) key_data &= ~0x10; // 英数 -> LCTRL
266- if(key_stat[VK_LSHIFT]) key_data &= ~0x20; // 英記号 -> L-SHIFT
267- if(key_stat[VK_RWIN]) key_data &= ~0x40; // カナ記号 -> R-Win
268- if(key_stat[VK_KANA]) key_data &= ~0x80; // カナ -> カタカナひらがな
266+ if(key_stat[VK_LSHIFT ]) key_data &= ~0x20; // 英記号 -> L-SHIFT
267+- if(key_stat[VK_RWIN ]) key_data &= ~0x40; // カナ記号 -> R-Win
268+ if(key_stat[VK_KANA ]) key_data &= ~0x80; // カナ -> カタカナひらがな
269269 #else
270270 // this is same as "日立ベーシックマスターJr.(MB-6885)エミュレータ bm2"
271271 if(key_stat[0xa2]) key_data &= ~0x10; // 英数 -> L-CTRL
272272 if(key_stat[0xa0]) key_data &= ~0x20; // 英記号 -> L-SHIFT
273273 if(key_stat[0xa1]) key_data &= ~0x40; // カナ記号 -> R-SHIFT
274274 if(key_stat[0xa3]) key_data &= ~0x80; // カナ -> R-CTRL
275-#endif
275+#endif
276276 }
277277
278278 void MEMORY::key_down(int code)
--- a/source/src/vm/ex80/ex80.cpp
+++ b/source/src/vm/ex80/ex80.cpp
@@ -51,18 +51,10 @@ VM::VM(EMU* parent_emu) : emu(parent_emu)
5151 // Set names
5252 #if defined(_USE_QT)
5353 dummy->set_device_name(_T("1st Dummy"));
54- event->set_device_name(_T("EVENT"));
55- cpu->set_device_name(_T("CPU(i8080)"));
5654
5755 pio->set_device_name(_T("i8255(SOUND/KEY/DISPLAY)"));
5856 sio->set_device_name(_T("i8251(CMT)"));
59- io->set_device_name(_T("I/O PORT"));
6057 pcm->set_device_name(_T("SOUND OUT"));
61-
62- cmt->set_device_name(_T("CMT Unit"));
63- display->set_device_name(_T("DISPLAY"));
64- keyboard->set_device_name(_T("KEYBOARD"));
65- memory->set_device_name(_T("MEMORY"));
6658 #endif
6759
6860 // set contexts
@@ -74,7 +66,7 @@ VM::VM(EMU* parent_emu) : emu(parent_emu)
7466 pio->set_context_port_c(keyboard, SIG_KEYBOARD_COLUMN, 0x70, 0);
7567 pio->set_context_port_c(display, SIG_DISPLAY_DMA, 0x80, 0);
7668 // Sound:: Force realtime rendering. This is temporally fix. 20161024 K.O
77- pcm->set_realtime_render(true);
69+ //pcm->set_realtime_render(true);
7870
7971 cmt->set_context_sio(sio);
8072 display->set_context_cpu(cpu);
--- a/source/src/vm/familybasic/familybasic.cpp
+++ b/source/src/vm/familybasic/familybasic.cpp
@@ -51,14 +51,10 @@ VM::VM(EMU* parent_emu) : emu(parent_emu)
5151 memory = new MEMORY(this, emu);
5252 apu = new APU(this, emu);
5353 ppu = new PPU(this, emu);
54-
5554 cpu = new N2A03(this, emu); // cpu shoud be reset after other device
5655
5756 dummy->set_device_name(_T("1st Dummy"));
5857
59- apu->set_device_name(_T("APU"));
60- ppu->set_device_name(_T("PPU"));
61- memory->set_device_name(_T("MEMORY"));
6258 // set contexts
6359 event->set_context_cpu(cpu);
6460 event->set_context_sound(apu);
--- a/source/src/vm/fm16pi/fm16pi.cpp
+++ b/source/src/vm/fm16pi/fm16pi.cpp
@@ -66,11 +66,6 @@ VM::VM(EMU* parent_emu) : emu(parent_emu)
6666
6767 sio->set_device_name(_T("i8251(RS-232C)"));
6868 pio->set_device_name(_T("i8259(SYSTEM PORT)"));
69-
70- rtc->set_device_name(_T("MSM58321(RTC)"));
71- memory->set_device_name(_T("MEMORY"));
72-
73- sub->set_device_name(_T("SUB SYSTEM"));
7469 #endif
7570
7671 // set contexts
@@ -79,6 +74,7 @@ VM::VM(EMU* parent_emu) : emu(parent_emu)
7974 event->set_context_sound(fdc->get_context_noise_seek());
8075 event->set_context_sound(fdc->get_context_noise_head_down());
8176 event->set_context_sound(fdc->get_context_noise_head_up());
77+
8278 /*
8379 IRQ 0 PIT CH.0
8480 IRQ 1 SIO RXRDY
@@ -241,7 +237,7 @@ VM::VM(EMU* parent_emu) : emu(parent_emu)
241237 for(DEVICE* device = first_device; device; device = device->next_device) {
242238 device->initialize();
243239 }
244- pcm->set_realtime_render(true);
240+ //pcm->set_realtime_render(true);
245241 }
246242
247243 VM::~VM()
--- a/source/src/vm/fmr30/fmr30.cpp
+++ b/source/src/vm/fmr30/fmr30.cpp
@@ -52,6 +52,7 @@ VM::VM(EMU* parent_emu) : emu(parent_emu)
5252 // create devices
5353 first_device = last_device = NULL;
5454 dummy = new DEVICE(this, emu); // must be 1st device
55+ sio_kb->set_device_name(_T("1st dummy"));
5556 event = new EVENT(this, emu); // must be 2nd device
5657
5758 dma = new I8237(this, emu);
@@ -75,7 +76,6 @@ VM::VM(EMU* parent_emu) : emu(parent_emu)
7576 fdc->set_context_noise_seek(new NOISE(this, emu));
7677 fdc->set_context_noise_head_down(new NOISE(this, emu));
7778 fdc->set_context_noise_head_up(new NOISE(this, emu));
78- dummy->set_device_name(_T("1st Dummy"));
7979 cpu->set_device_name(_T("CPU(80C86)"));
8080
8181 scsi_host = new SCSI_HOST(this, emu);
--- a/source/src/vm/fmr50/bios.cpp
+++ b/source/src/vm/fmr50/bios.cpp
@@ -1080,7 +1080,6 @@ bool BIOS::bios_int_i86(int intnum, uint16_t regs[], uint16_t sregs[], int32_t*
10801080
10811081 if(intnum == 0x93) {
10821082 // disk bios
1083- printf("INT 93H\n");
10841083 return bios_call_i86(0xfffc4, regs, sregs, ZeroFlag, CarryFlag);
10851084 }
10861085 return false;
--- a/source/src/vm/fmr50/fmr50.cpp
+++ b/source/src/vm/fmr50/fmr50.cpp
@@ -108,7 +108,6 @@ VM::VM(EMU* parent_emu) : emu(parent_emu)
108108 dummy = new DEVICE(this, emu); // must be 1st device
109109 event = new EVENT(this, emu); // must be 2nd device
110110 dummy->set_device_name(_T("1st Dummy"));
111- event->set_device_name(_T("EVENT"));
112111
113112 #if defined(HAS_I286)
114113 cpu = new I286(this, emu);
@@ -142,8 +141,6 @@ VM::VM(EMU* parent_emu) : emu(parent_emu)
142141 fdc->set_context_noise_head_up(new NOISE(this, emu));
143142 rtc = new MSM58321(this, emu);
144143 pcm = new PCM1BIT(this, emu);
145- pit0->set_device_name(_T("i8253 PIT #0"));
146- pit1->set_device_name(_T("i8253 PIT #1"));
147144
148145 scsi_host = new SCSI_HOST(this, emu);
149146 for(int i = 0; i < 7; i++) {
--- a/source/src/vm/fp200/io.cpp
+++ b/source/src/vm/fp200/io.cpp
@@ -272,13 +272,8 @@ void IO::write_io8(uint32_t addr, uint32_t data)
272272 lcd_addr = (lcd_addr & 0xff00) | data;
273273 break;
274274 case 0x10:
275-
276- {
277- bool cmt_selected_old = cmt_selected;;
278- cmt_selected = ((data & 2) == 0);
279- bool tmp_val = (CMT_PLAYING || CMT_RECORDING);
280- d_drec->write_signal(SIG_DATAREC_REMOTE, tmp_val ? 1 : 0, 1);
281- }
275+ cmt_selected = ((data & 2) == 0);
276+ d_drec->write_signal(SIG_DATAREC_REMOTE, CMT_MODE_PLAY ? 1 : 0, 1);
282277 break;
283278 case 0x21:
284279 key_column = data & 0x0f;
@@ -302,12 +297,8 @@ void IO::write_io8(uint32_t addr, uint32_t data)
302297 }
303298 break;
304299 case 0x43:
305- {
306- uint8_t cmt_mode_old = cmt_mode & 7;
307- cmt_mode = data & 7;
308- int tmp_val = (CMT_PLAYING || CMT_RECORDING);
309- d_drec->write_signal(SIG_DATAREC_REMOTE, tmp_val ? 1 : 0, 1);
310- }
300+ cmt_mode = data & 7;
301+ d_drec->write_signal(SIG_DATAREC_REMOTE, CMT_MODE_PLAY ? 1 : 0, 1);
311302 break;
312303 }
313304 } else {
--- a/source/src/vm/gamegear/mastersystem.cpp
+++ b/source/src/vm/gamegear/mastersystem.cpp
@@ -224,6 +224,14 @@ void VM::set_sound_device_volume(int ch, int decibel_l, int decibel_r)
224224 psg->set_volume(0, decibel_l, decibel_r);
225225 } else if(ch == 1) {
226226 fm->set_volume(0, decibel_l, decibel_r);
227+/// } else if(ch == 2) {
228+/// fdc->get_context_noise_seek()->set_volume(0, decibel_l, decibel_r);
229+/// fdc->get_context_noise_head_down()->set_volume(0, decibel_l, decibel_r);
230+/// fdc->get_context_noise_head_up()->set_volume(0, decibel_l, decibel_r);
231+/// } else if(ch == 3) {
232+/// drec->get_context_noise_play()->set_volume(0, decibel_l, decibel_r);
233+/// drec->get_context_noise_stop()->set_volume(0, decibel_l, decibel_r);
234+/// drec->get_context_noise_fast()->set_volume(0, decibel_l, decibel_r);
227235 }
228236 }
229237 #endif
--- a/source/src/vm/j3100/j3100.cpp
+++ b/source/src/vm/j3100/j3100.cpp
@@ -242,6 +242,10 @@ VM::VM(EMU* parent_emu) : emu(parent_emu)
242242 io->set_flipflop_single_rw(i, iovalues[i & 0x1f]);
243243 }
244244 #endif
245+
246+
247+
248+
245249 // initialize all devices
246250 for(DEVICE* device = first_device; device; device = device->next_device) {
247251 device->initialize();
--- a/source/src/vm/mz2500/mz2500.cpp
+++ b/source/src/vm/mz2500/mz2500.cpp
@@ -129,7 +129,7 @@ VM::VM(EMU* parent_emu) : emu(parent_emu)
129129 pio_i->set_context_port_c(crtc, SIG_CRTC_MASK, 0x01, 0);
130130 pio_i->set_context_port_c(pcm, SIG_PCM1BIT_SIGNAL, 0x04, 0);
131131 // Sound:: Force realtime rendering. This is temporally fix. 20161024 K.O
132- pcm->set_realtime_render(true);
132+ //pcm->set_realtime_render(true);
133133
134134
135135 rtc->set_context_alarm(interrupt, SIG_INTERRUPT_RP5C15, 1);
@@ -452,8 +452,8 @@ void VM::close_tape(int drv)
452452 {
453453 emu->lock_vm();
454454 drec->close_tape();
455- cmt->close_tape();
456455 emu->unlock_vm();
456+ cmt->close_tape();
457457 }
458458
459459 bool VM::is_tape_inserted(int drv)
--- a/source/src/vm/mz2500/mz80b.cpp
+++ b/source/src/vm/mz2500/mz80b.cpp
@@ -132,7 +132,7 @@ VM::VM(EMU* parent_emu) : emu(parent_emu)
132132 pio_i->set_context_port_c(cmt, SIG_CMT_PIO_PC, 0xff, 0);
133133 pio_i->set_context_port_c(pcm, SIG_PCM1BIT_SIGNAL, 0x04, 0);
134134 // Sound:: Force realtime rendering. This is temporally fix. 20161024 K.O
135- pcm->set_realtime_render(true);
135+ //pcm->set_realtime_render(true);
136136
137137 pio->set_context_port_a(memory, SIG_MEMORY_VRAM_SEL, 0xc0, 0);
138138 pio->set_context_port_a(memory, SIG_CRTC_WIDTH80, 0x20, 0);
--- a/source/src/vm/mz2800/mz2800.cpp
+++ b/source/src/vm/mz2800/mz2800.cpp
@@ -107,7 +107,7 @@ VM::VM(EMU* parent_emu) : emu(parent_emu)
107107 pio0->set_context_port_c(crtc, SIG_CRTC_MASK, 0x01, 0);
108108 pio0->set_context_port_c(pcm, SIG_PCM1BIT_SIGNAL, 0x04, 0);
109109 // Sound:: Force realtime rendering. This is temporally fix. 20161024 K.O
110- pcm->set_realtime_render(true);
110+ //pcm->set_realtime_render(true);
111111
112112
113113 pic->set_context_cpu(cpu);
@@ -141,7 +141,7 @@ VM::VM(EMU* parent_emu) : emu(parent_emu)
141141 keyboard->set_context_pio1(pio1);
142142 memory->set_context_crtc(crtc);
143143 mouse->set_context_sio(sio);
144- if(config.printer_type == 0) {
144+ if(config.printer_type == 0) {
145145 PRNFILE *prnfile = new PRNFILE(this, emu);
146146 prnfile->set_context_busy(not_busy, SIG_NOT_INPUT, 1);
147147 printer->set_context_prn(prnfile);
--- a/source/src/vm/mz3500/mz3500.cpp
+++ b/source/src/vm/mz3500/mz3500.cpp
@@ -158,7 +158,7 @@ VM::VM(EMU* parent_emu) : emu(parent_emu)
158158 pio->set_context_port_b(rtc, SIG_UPD1990A_DIN, 0x10, 0);
159159 pio->set_context_port_b(rtc, SIG_UPD1990A_CLK, 0x20, 0);
160160 pio->set_context_port_b(mainbus, SIG_MAIN_SRDY, 0x40, 0);
161-// pio->set_context_port_b(sub, SIG_SUB_PIO_PM, 0x80, 0); // P/M: CG Selection
161+// pio->set_context_port_b(subbus, SIG_SUB_PIO_PM, 0x80, 0); // P/M: CG Selection
162162 pio->set_context_port_c(kbd, SIG_KEYBOARD_DC, 0x01, 0);
163163 pio->set_context_port_c(kbd, SIG_KEYBOARD_STC, 0x02, 0);
164164 pio->set_context_port_c(kbd, SIG_KEYBOARD_ACKC, 0x04, 0);
@@ -210,17 +210,17 @@ VM::VM(EMU* parent_emu) : emu(parent_emu)
210210
211211 // mz3500sm p.17
212212 mainio->set_iomap_range_rw(0xec, 0xef, mainbus); // reset int0
213- mainio->set_iomap_range_rw(0xf4, 0xf7, fdc); // fdc: f4h,f6h = status, f5h,f7h = data
213+ mainio->set_iomap_range_rw(0xf4, 0xf7, fdc); // fdc: f4h,f6h = status, f5h,f7h = data
214214 mainio->set_iomap_range_rw(0xf8, 0xfb, mainbus); // mfd interface
215215 mainio->set_iomap_range_rw(0xfc, 0xff, mainbus); // memory mpaper
216216
217217 // mz3500sm p.18
218- subio->set_iomap_range_w(0x00, 0x0f, subbus); // int0 to main (set flipflop)
218+ subio->set_iomap_range_w(0x00, 0x0f, subbus); // int0 to main (set flipflop)
219219 subio->set_iomap_range_rw(0x10, 0x1f, sio);
220220 subio->set_iomap_range_rw(0x20, 0x2f, pit);
221221 subio->set_iomap_range_rw(0x30, 0x3f, pio);
222- subio->set_iomap_range_r(0x40, 0x4f, ls244); // input port
223- subio->set_iomap_range_rw(0x50, 0x5f, subbus); // crt control i/o
222+ subio->set_iomap_range_r(0x40, 0x4f, ls244); // input port
223+ subio->set_iomap_range_rw(0x50, 0x5f, subbus); // crt control i/o
224224 subio->set_iomap_range_rw(0x60, 0x6f, gdc_gfx);
225225 subio->set_iomap_range_rw(0x70, 0x7f, gdc_chr);
226226 #ifdef _IO_DEBUG_LOG
--- a/source/src/vm/mz700/mz700.cpp
+++ b/source/src/vm/mz700/mz700.cpp
@@ -80,7 +80,6 @@ VM::VM(EMU* parent_emu) : emu(parent_emu)
8080 pcm = new PCM1BIT(this, emu);
8181 cpu = new Z80(this, emu);
8282
83- cpu->set_device_name(_T("CPU(Z80)"));
8483 // cmos = new CMOS(this, emu);
8584 emm = new EMM(this, emu);
8685 kanji = new KANJI(this, emu);
@@ -108,19 +107,20 @@ VM::VM(EMU* parent_emu) : emu(parent_emu)
108107 printer = dummy;
109108 }
110109 not_reset = new NOT(this, emu);
111- not_strobe = new NOT(this, emu);
112- psg_l = new SN76489AN(this, emu);
113- psg_r = new SN76489AN(this, emu);
114-
115110 not_reset->set_device_name(_T("NOT Gate (Reset)"));
111+ not_strobe = new NOT(this, emu);
116112 not_strobe->set_device_name(_T("NOT Gate (Prinet Strobe)"));
113+ psg_l = new SN76489AN(this, emu);
117114 psg_l->set_device_name(_T("SN76489AN PSG (Left)"));
115+ psg_r = new SN76489AN(this, emu);
118116 psg_r->set_device_name(_T("SN76489AN PSG (Right)"));
119-
120117 #endif
121118 pio_int = new Z80PIO(this, emu);
119+ pio_int->set_device_name(_T("Z80 PIO(Interrupt)"));
122120 sio_rs = new Z80SIO(this, emu);
121+ sio_rs->set_device_name(_T("Z80 SIO(RS-232C)"));
123122 sio_qd = new Z80SIO(this, emu);
123+ sio_qd->set_device_name(_T("Z80 SIO(Quick Disk)"));
124124
125125 floppy = new FLOPPY(this, emu);
126126 #if defined(_MZ1500)
@@ -387,7 +387,7 @@ VM::VM(EMU* parent_emu) : emu(parent_emu)
387387 for(DEVICE* device = first_device; device; device = device->next_device) {
388388 device->initialize();
389389 }
390- pcm->set_realtime_render(true);
390+ //pcm->set_realtime_render(true);
391391 #if defined(_MZ800) || defined(_MZ1500)
392392 for(int i = 0; i < MAX_DRIVE; i++) {
393393 fdc->set_drive_type(i, DRIVE_TYPE_2DD);
--- a/source/src/vm/mz80k/mz80k.cpp
+++ b/source/src/vm/mz80k/mz80k.cpp
@@ -133,7 +133,7 @@ VM::VM(EMU* parent_emu) : emu(parent_emu)
133133 pio->set_context_port_c(drec, SIG_DATAREC_TRIG, 8, 0);
134134 counter->set_context_1qa(pcm, SIG_PCM1BIT_SIGNAL, 1);
135135 // Sound:: Force realtime rendering. This is temporally fix. 20161024 K.O
136- pcm->set_realtime_render(true);
136+ //pcm->set_realtime_render(true);
137137
138138 keyboard->set_context_pio(pio);
139139 memory->set_context_ctc(ctc);
--- a/source/src/vm/mz80k/mz80k.h
+++ b/source/src/vm/mz80k/mz80k.h
@@ -58,6 +58,11 @@
5858 #define USE_AUTO_KEY 5
5959 #define USE_AUTO_KEY_RELEASE 6
6060 #define USE_AUTO_KEY_NO_CAPS
61+#if defined(SUPPORT_MZ80AIF) || defined(SUPPORT_MZ80FIO)
62+#define USE_SOUND_VOLUME 4
63+#else
64+#define USE_SOUND_VOLUME 3
65+#endif
6166 #define USE_PRINTER
6267 #define USE_PRINTER_TYPE 4
6368 #define USE_DEBUGGER
@@ -67,9 +72,6 @@
6772 #define USE_FD2
6873 #define USE_FD3
6974 #define USE_FD4
70-#define USE_SOUND_VOLUME 4
71-#else
72-#define USE_SOUND_VOLUME 3
7375 #endif
7476 #if defined(_MZ80K)
7577 #define USE_MONITOR_TYPE 2
--- a/source/src/vm/pc8801/pc88.cpp
+++ b/source/src/vm/pc8801/pc88.cpp
@@ -176,7 +176,7 @@ static const int key_conv_table[9][3] = {
176176 {0x1d, 0x20, 0}, // 決定-> SPACE
177177 };
178178
179-static const int8_t intr_mask2_table[8] = {
179+static const uint8_t intr_mask2_table[8] = {
180180 ~7, ~3, ~5, ~1, ~6, ~2, ~4, ~0
181181 };
182182
@@ -786,31 +786,24 @@ void PC88::write_io8(uint32_t addr, uint32_t data)
786786 if(mod & 0x10) {
787787 update_gvram_wait();
788788 }
789- {
790- bool ff = beep_on;
791- bool fy = sing_signal;
792- beep_on = ((data & 0x20) != 0);
789+ beep_on = ((data & 0x20) != 0);
793790 #ifdef SUPPORT_PC88_JOYSTICK
794- if(mod & 0x40) {
795- if(Port40_JOP1 && (mouse_phase == -1 || get_passed_clock(mouse_strobe_clock) > mouse_strobe_clock_lim)) {
796- mouse_phase = 0;//mouse_dx = mouse_dy = 0;
797- } else {
798- mouse_phase = (mouse_phase + 1) & 3;
799- }
800- if(mouse_phase == 0) {
801- // latch position
802- mouse_lx = -((mouse_dx > 127) ? 127 : (mouse_dx < -127) ? -127 : mouse_dx);
803- mouse_ly = -((mouse_dy > 127) ? 127 : (mouse_dy < -127) ? -127 : mouse_dy);
804- mouse_dx = mouse_dy = 0;
805- }
806- mouse_strobe_clock = get_current_clock();
791+ if(mod & 0x40) {
792+ if(Port40_JOP1 && (mouse_phase == -1 || get_passed_clock(mouse_strobe_clock) > mouse_strobe_clock_lim)) {
793+ mouse_phase = 0;//mouse_dx = mouse_dy = 0;
794+ } else {
795+ mouse_phase = (mouse_phase + 1) & 3;
807796 }
808-#endif
809- sing_signal = ((data & 0x80) != 0);
810- if((ff != beep_on) || (sing_signal != fy)) {
811- d_pcm->set_realtime_render(beep_on | sing_signal);
797+ if(mouse_phase == 0) {
798+ // latch position
799+ mouse_lx = -((mouse_dx > 127) ? 127 : (mouse_dx < -127) ? -127 : mouse_dx);
800+ mouse_ly = -((mouse_dy > 127) ? 127 : (mouse_dy < -127) ? -127 : mouse_dy);
801+ mouse_dx = mouse_dy = 0;
812802 }
803+ mouse_strobe_clock = get_current_clock();
813804 }
805+#endif
806+ sing_signal = ((data & 0x80) != 0);
814807 d_pcm->write_signal(SIG_PCM1BIT_SIGNAL, ((beep_on && beep_signal) || sing_signal) ? 1 : 0, 1);
815808 break;
816809 case 0x44:
@@ -973,10 +966,10 @@ void PC88::write_io8(uint32_t addr, uint32_t data)
973966 break;
974967 case 0xe6:
975968 // for Romancia (XM8 version 1.00)
976- if((uint8_t)intr_mask2_table[data & 7] != intr_mask2) {
977- intr_req &= ((uint8_t)intr_mask2_table[data & 7] & intr_mask2);
969+ if(intr_mask2_table[data & 7] != intr_mask2) {
970+ intr_req &= (intr_mask2_table[data & 7] & intr_mask2);
978971 }
979- intr_mask2 = (uint8_t)intr_mask2_table[data & 7];
972+ intr_mask2 = intr_mask2_table[data & 7];
980973 intr_req &= intr_mask2;
981974 update_intr();
982975 break;
--- a/source/src/vm/pc8801/pc8801.cpp
+++ b/source/src/vm/pc8801/pc8801.cpp
@@ -75,7 +75,7 @@ VM::VM(EMU* parent_emu) : emu(parent_emu)
7575 pc88rtc = new UPD1990A(this, emu);
7676 // pc88rtc->set_device_name(_T("uPD1990A RTC (PC-8801)"));
7777 // pc88rtc->set_context_event_manager(pc88event);
78- // config.sound_device_type
78+ // config.sound_type
7979 // 0: 44h:OPNA A4h:None PC-8801FH/MH or later
8080 // 1: 44h:OPN A4h:None PC-8801mkIISR/TR/MR/FR
8181 // 2: 44h:OPN A4h:OPNA PC-8801mkIISR/TR/MR/FR + PC-8801-23
@@ -83,19 +83,22 @@ VM::VM(EMU* parent_emu) : emu(parent_emu)
8383 // pc88opn->set_context_event_manager(pc88event);
8484 #ifdef USE_SOUND_TYPE
8585 #ifdef SUPPORT_PC88_OPNA
86+ if(config.sound_type == 0) {
87+ pc88opn->set_device_name(_T("YM2608 OPNA"));
88+ } else {
89+ pc88opn->set_device_name(_T("YM2203 OPN"));
90+ }
8691 pc88opn->is_ym2608 = (config.sound_type == 0);
8792 #endif
8893 #ifdef SUPPORT_PC88_SB2
8994 if(config.sound_type == 2) {
9095 pc88sb2 = new YM2203(this, emu);
9196 #ifdef SUPPORT_PC88_OPNA
97+ pc88sb2->set_device_name(_T("YM2608 OPNA (SB2)"));
9298 pc88sb2->is_ym2608 = true;
99+#else
100+ pc88sb2->set_device_name(_T("YM2203 OPN (SB2)"));
93101 #endif
94- #ifdef SUPPORT_PC88_OPNA
95- pc88sb2->set_device_name(_T("YM2608 OPNA(SB2)"));
96- #else
97- pc88sb2->set_device_name(_T("YM2203 OPN(SB2)"));
98- #endif
99102 // pc88sb2->set_context_event_manager(pc88event);
100103 } else {
101104 pc88sb2 = NULL;
@@ -119,10 +122,13 @@ VM::VM(EMU* parent_emu) : emu(parent_emu)
119122 pc88cpu->set_device_name(_T("MAIN CPU(Z80)"));
120123
121124 pc88sub = new PC80S31K(this, emu);
125+ pc88sub->set_device_name(_T("PC-80S31K (Sub)"));
122126 // pc88sub->set_context_event_manager(pc88event);
123127 pc88pio_sub = new I8255(this, emu);
128+ pc88pio_sub->set_device_name(_T("8255 PIO (Sub)"));
124129 // pc88pio_sub->set_context_event_manager(pc88event);
125130 pc88fdc_sub = new UPD765A(this, emu);
131+ pc88fdc_sub->set_device_name(_T("uPD765A FDC (Sub)"));
126132 // pc88fdc_sub->set_context_event_manager(pc88event);
127133 pc88noise_seek = new NOISE(this, emu);
128134 // pc88noise_seek->set_context_event_manager(pc88event);
@@ -131,29 +137,23 @@ VM::VM(EMU* parent_emu) : emu(parent_emu)
131137 pc88noise_head_up = new NOISE(this, emu);
132138 // pc88noise_head_up->set_context_event_manager(pc88event);
133139 pc88cpu_sub = new Z80(this, emu);
140+ pc88cpu_sub->set_device_name(_T("Z80 CPU (Sub)"));
134141 // pc88cpu_sub->set_context_event_manager(pc88event);
135142
136- pc88sub->set_device_name(_T("PC-80S31K FDD I/F"));
137- pc88pio_sub->set_device_name(_T("i8255 PIO(FDD)"));
138- pc88fdc_sub->set_device_name(_T("uPD765A FDC(FDD)"));
139- pc88cpu_sub->set_device_name(_T("Z80 CPU(FDD)"));
140143 #ifdef SUPPORT_PC88_PCG8100
141144 pc88pit = new I8253(this, emu);
142145 // pc88pit->set_context_event_manager(pc88event);
143146 pc88pcm0 = new PCM1BIT(this, emu);
144-// pc88pcm->set_context_event_manager(pc88event);
147+// pc88pcm0->set_context_event_manager(pc88event);
145148 pc88pcm1 = new PCM1BIT(this, emu);
146-// pc88pcm->set_context_event_manager(pc88event);
149+// pc88pcm1->set_context_event_manager(pc88event);
147150 pc88pcm2 = new PCM1BIT(this, emu);
148-// pc88pcm->set_context_event_manager(pc88event);
151+// pc88pcm2->set_context_event_manager(pc88event);
149152 pc88pit->set_device_name(_T("i8253 PIT (PCG8100)"));
150153 pc88pcm0->set_device_name(_T("SOUND #1 (PCG8100)"));
151154 pc88pcm1->set_device_name(_T("SOUND #2 (PCG8100)"));
152155 pc88pcm2->set_device_name(_T("SOUND #3 (PCG8100)"));
153156 #endif
154- pc88event->set_context_sound(pc88noise_seek);
155- pc88event->set_context_sound(pc88noise_head_down);
156- pc88event->set_context_sound(pc88noise_head_up);
157157
158158 pc88event->set_context_cpu(dummycpu, 3993624 / 4);
159159 #ifdef SUPPORT_PC88_HIGH_CLOCK
@@ -174,6 +174,9 @@ VM::VM(EMU* parent_emu) : emu(parent_emu)
174174 pc88event->set_context_sound(pc88pcm1);
175175 pc88event->set_context_sound(pc88pcm2);
176176 #endif
177+ pc88event->set_context_sound(pc88noise_seek);
178+ pc88event->set_context_sound(pc88noise_head_down);
179+ pc88event->set_context_sound(pc88noise_head_up);
177180 pc88->set_context_cpu(pc88cpu);
178181 pc88->set_context_opn(pc88opn);
179182 #ifdef SUPPORT_PC88_SB2
--- a/source/src/vm/pc98ha/pc98ha.cpp
+++ b/source/src/vm/pc98ha/pc98ha.cpp
@@ -89,7 +89,6 @@ VM::VM(EMU* parent_emu) : emu(parent_emu)
8989 fdc->set_context_noise_head_up(new NOISE(this, emu));
9090 pic->set_device_name(_T("V50 PIC(i8259 COMPATIBLE)"));
9191 cpu->set_device_name(_T("CPU (V50)"));
92- io->set_device_name(_T("I/O BUS"));
9392 not_busy->set_device_name(_T("NOT GATE(PRINTER BUSY)"));
9493
9594 if(config.printer_type == 0) {
--- a/source/src/vm/pcengine/pcengine.cpp
+++ b/source/src/vm/pcengine/pcengine.cpp
@@ -36,15 +36,11 @@ VM::VM(EMU* parent_emu) : emu(parent_emu)
3636 pceevent = new EVENT(this, emu);
3737 // pceevent->set_frames_per_sec(FRAMES_PER_SEC);
3838 // pceevent->set_lines_per_frame(LINES_PER_FRAME);
39-#if defined(_USE_QT)
4039 dummy->set_device_name(_T("1st Dummy"));
4140 pceevent->set_device_name(_T("PC-ENGINE EVENT"));
42-#endif
4341
4442 pcecpu = new HUC6280(this, emu);
45-#if defined(_USE_QT)
4643 pcecpu->set_device_name(_T("PC-ENGINE CPU(HuC6280)"));
47-#endif
4844 // pcecpu->set_context_event_manager(pceevent);
4945 adpcm = new MSM5205(this, emu);
5046 // adpcm->set_context_event_manager(pceevent);
--- a/source/src/vm/pcengine/pcengine.h
+++ b/source/src/vm/pcengine/pcengine.h
@@ -29,13 +29,13 @@
2929
3030 // device informations for win32
3131 #define SOUND_RATE_DEFAULT 5 // 44100Hz
32-#define USE_DEVICE_TYPE 4
33-#define DEVICE_TYPE_DEFAULT 0
3432 #define SUPPORT_TV_RENDER
3533 #define USE_CART1
3634 #define USE_COMPACT_DISC
3735 #define USE_SOUND_VOLUME 3
3836 #define USE_JOYSTICK
37+#define USE_JOYSTICK_TYPE 4
38+#define JOYSTICK_TYPE_DEFAULT 0
3939 #define USE_JOY_BUTTON_CAPTIONS
4040 #define USE_DEBUGGER
4141 #define USE_STATE
--- a/source/src/vm/pv1000/pv1000.cpp
+++ b/source/src/vm/pv1000/pv1000.cpp
@@ -34,25 +34,15 @@ VM::VM(EMU* parent_emu) : emu(parent_emu)
3434 first_device = last_device = NULL;
3535 dummy = new DEVICE(this, emu); // must be 1st device
3636 event = new EVENT(this, emu); // must be 2nd device
37-#if defined(_USE_QT)
3837 dummy->set_device_name(_T("1st Dummy"));
39-#endif
4038
4139 io = new IO(this, emu);
4240 memory = new MEMORY(this, emu);
4341 cpu = new Z80(this, emu);
44-#if defined(_USE_QT)
45- cpu->set_device_name(_T("CPU(Z80)"));
46-#endif
4742
4843 joystick = new JOYSTICK(this, emu);
4944 psg = new PSG(this, emu);
5045 vdp = new VDP(this, emu);
51-#if defined(_USE_QT)
52- joystick->set_device_name(_T("JOYSTICK I/F"));
53- psg->set_device_name(_T("SOUND"));
54- vdp->set_device_name(_T("VIDEO PROCESSOR"));
55-#endif
5646
5747 // set contexts
5848 event->set_context_cpu(cpu);
--- a/source/src/vm/pv2000/pv2000.cpp
+++ b/source/src/vm/pv2000/pv2000.cpp
@@ -36,27 +36,16 @@ VM::VM(EMU* parent_emu) : emu(parent_emu)
3636 first_device = last_device = NULL;
3737 dummy = new DEVICE(this, emu); // must be 1st device
3838 event = new EVENT(this, emu); // must be 2nd device
39-#if defined(_USE_QT)
4039 dummy->set_device_name(_T("1st Dummy"));
41-#endif
4240
4341 io = new IO(this, emu);
4442 memory = new MEMORY(this, emu);
4543 psg = new SN76489AN(this, emu);
4644 vdp = new TMS9918A(this, emu);
4745 cpu = new Z80(this, emu);
48-#if defined(_USE_QT)
49- cpu->set_device_name(_T("CPU(Z80)"));
50-#endif
51-
5246 cmt = new CMT(this, emu);
5347 key = new KEYBOARD(this, emu);
5448 prt = new PRINTER(this, emu);
55-#if defined(_USE_QT)
56- cmt->set_device_name(_T("CMT I/F"));
57- key->set_device_name(_T("KEYBOARD I/F"));
58- prt->set_device_name(_T("PRINTER I/F"));
59-#endif
6049 // set contexts
6150 event->set_context_cpu(cpu);
6251 event->set_context_sound(psg);
--- a/source/src/vm/pv2000/pv2000.h
+++ b/source/src/vm/pv2000/pv2000.h
@@ -34,7 +34,7 @@
3434 #define USE_AUTO_KEY 5
3535 #define USE_AUTO_KEY_RELEASE 6
3636 #define USE_AUTO_KEY_CAPS
37-#define USE_SOUND_VOLUME 2
37+#define USE_SOUND_VOLUME 1
3838 #define USE_JOYSTICK
3939 #define USE_DEBUGGER
4040 #define USE_STATE
--- a/source/src/vm/qc10/qc10.cpp
+++ b/source/src/vm/qc10/qc10.cpp
@@ -171,7 +171,7 @@ VM::VM(EMU* parent_emu) : emu(parent_emu)
171171 for(DEVICE* device = first_device; device; device = device->next_device) {
172172 device->initialize();
173173 }
174- pcm->set_realtime_render(true);
174+ //pcm->set_realtime_render(true);
175175 for(int i = 0; i < 4; i++) {
176176 fdc->set_drive_type(i, DRIVE_TYPE_2D);
177177 }
--- a/source/src/vm/scv/scv.cpp
+++ b/source/src/vm/scv/scv.cpp
@@ -33,25 +33,13 @@ VM::VM(EMU* parent_emu) : emu(parent_emu)
3333 first_device = last_device = NULL;
3434 dummy = new DEVICE(this, emu); // must be 1st device
3535 event = new EVENT(this, emu); // must be 2nd device
36-#if defined(_USE_QT)
3736 dummy->set_device_name(_T("1st Dummy"));
38-#endif
39-
4037 cpu = new UPD7801(this, emu);
41-#if defined(_USE_QT)
42- cpu->set_device_name(_T("CPU(uPD7801)"));
43-#endif
4438
4539 io = new IO(this, emu);
4640 memory = new MEMORY(this, emu);
4741 sound = new SOUND(this, emu);
4842 vdp = new VDP(this, emu);
49-#if defined(_USE_QT)
50- io->set_device_name(_T("I/O BUS"));
51- memory->set_device_name(_T("MEMORY"));
52- sound->set_device_name(_T("SOUND"));
53- vdp->set_device_name(_T("VIDEO"));
54-#endif
5543
5644 // set contexts
5745 event->set_context_cpu(cpu);
--- a/source/src/vm/smc777/smc777.cpp
+++ b/source/src/vm/smc777/smc777.cpp
@@ -80,7 +80,7 @@ VM::VM(EMU* parent_emu) : emu(parent_emu)
8080 event->set_context_sound(drec->get_context_noise_fast());
8181
8282 // Sound:: Force realtime rendering. This is temporally fix. 20161024 K.O
83- pcm->set_realtime_render(true);
83+ //pcm->set_realtime_render(true);
8484
8585 drec->set_context_ear(memory, SIG_MEMORY_DATAREC_IN, 1);
8686 crtc->set_context_disp(memory, SIG_MEMORY_CRTC_DISP, 1);
--- a/source/src/vm/smc777/smc777.h
+++ b/source/src/vm/smc777/smc777.h
@@ -53,10 +53,10 @@
5353 #define USE_VM_AUTO_KEY_TABLE
5454 #define USE_SCREEN_FILTER
5555 #define USE_SCANLINE
56-#if defined(_SMC70)
57-#define USE_SOUND_VOLUME 4
58-#else
56+#if defined(_SMC777)
5957 #define USE_SOUND_VOLUME 5
58+#else
59+#define USE_SOUND_VOLUME 4
6060 #endif
6161 #define USE_JOYSTICK
6262 #define USE_DEBUGGER
--- a/source/src/vm/tk80bs/tk80bs.cpp
+++ b/source/src/vm/tk80bs/tk80bs.cpp
@@ -46,16 +46,22 @@ VM::VM(EMU* parent_emu) : emu(parent_emu)
4646 // check configs
4747 // boot_mode = config.boot_mode;
4848 boot_mode = -1;
49-#endif
49+#endif
50+#if defined(_TK80BS) || defined(_TK80)
51+ config.wave_shaper[0] = false;
52+#endif
53+
5054 // create devices
5155 first_device = last_device = NULL;
5256 dummy = new DEVICE(this, emu); // must be 1st device
57+ dummy->set_device_name(_T("1st Dummy"));
5358 event = new EVENT(this, emu); // must be 2nd device
5459
60+ cpu = new I8080(this, emu);
5561 #if defined(_TK80BS)
5662 sio_b = new I8251(this, emu); // on TK-80BS
57- pio_b = new I8255(this, emu);
5863 sio_b->set_device_name(_T("i8251 SIO (TK-80BS/CMT)"));
64+ pio_b = new I8255(this, emu);
5965 pio_b->set_device_name(_T("i8255 PIO (TK-80BS/DISPLAY)"));
6066 memio = new IO(this, emu);
6167 memio->set_device_name(_T("Memory Mapped I/O (TK-80BS)"));
@@ -68,7 +74,9 @@ VM::VM(EMU* parent_emu) : emu(parent_emu)
6874 // memory = new MEMORY(this, emu);
6975
7076 pcm0 = new PCM1BIT(this, emu);
77+ pcm0->set_device_name(_T("1-Bit PCM Sound #1"));
7178 pcm1 = new PCM1BIT(this, emu);
79+ pcm1->set_device_name(_T("1-Bit PCM Sound #2"));
7280
7381 #if defined(_TK80BS) || defined(_TK80)
7482 cmt = new CMT(this, emu);
@@ -76,16 +84,11 @@ VM::VM(EMU* parent_emu) : emu(parent_emu)
7684 display = new DISPLAY(this, emu);
7785 keyboard = new KEYBOARD(this, emu);
7886 memory = new MEMBUS(this, emu);
79- cpu = new I8080(this, emu);
80-
81- dummy->set_device_name(_T("1st Dummy"));
8287 #if defined(_TK80BS)
8388 pio_t->set_device_name(_T("i8255 PIO (TK-80/SOUND/KEYBOARD/DISPLAY)"));
8489 #else
8590 pio_t->set_device_name(_T("i8255 PIO (TK-80/SOUND/KEYBOARD)"));
8691 #endif
87- pcm0->set_device_name(_T("1-Bit PCM Sound #1"));
88- pcm1->set_device_name(_T("1-Bit PCM Sound #2"));
8992
9093 // set contexts
9194 event->set_context_cpu(cpu);
@@ -95,10 +98,6 @@ VM::VM(EMU* parent_emu) : emu(parent_emu)
9598 event->set_context_sound(drec->get_context_noise_play());
9699 event->set_context_sound(drec->get_context_noise_stop());
97100 event->set_context_sound(drec->get_context_noise_fast());
98-
99-#if defined(_TK80BS) || defined(_TK80)
100- config.wave_shaper[0] = false;
101-#endif
102101
103102 /* 8255 on TK-80
104103
@@ -130,8 +129,8 @@ VM::VM(EMU* parent_emu) : emu(parent_emu)
130129 pio_t->set_context_port_c(memory, SIG_MEMBUS_PC7, 0x80, 0);
131130 #endif
132131 // Sound:: Force realtime rendering. This is temporally fix. 20161024 K.O
133- pcm0->set_realtime_render(true);
134- pcm1->set_realtime_render(true);
132+ //pcm0->set_realtime_render(true);
133+ //pcm1->set_realtime_render(true);
135134
136135 #if defined(_TK80BS) || defined(_TK80)
137136 cmt->set_context_drec(drec);
--- a/source/src/vm/x1/x1.cpp
+++ b/source/src/vm/x1/x1.cpp
@@ -87,21 +87,21 @@ VM::VM(EMU* parent_emu) : emu(parent_emu)
8787 fdc->set_context_noise_seek(new NOISE(this, emu));
8888 fdc->set_context_noise_head_down(new NOISE(this, emu));
8989 fdc->set_context_noise_head_up(new NOISE(this, emu));
90- //psg = new YM2203(this, emu);
90+// psg = new YM2203(this, emu);
9191 psg = new AY_3_891X(this, emu);
9292 cpu = new Z80(this, emu);
9393 ctc = new Z80CTC(this, emu);
9494 sio = new Z80SIO(this, emu);
9595 if(sound_type >= 1) {
9696 opm1 = new YM2151(this, emu);
97- ctc1 = new Z80CTC(this, emu);
9897 opm1->set_device_name(_T("YM2151 OPM (CZ-8BS1 #1)"));
98+ ctc1 = new Z80CTC(this, emu);
9999 ctc1->set_device_name(_T("Z80 CTC (CZ-8BS1 #1)"));
100100 }
101101 if(sound_type == 2) {
102102 opm2 = new YM2151(this, emu);
103- ctc2 = new Z80CTC(this, emu);
104103 opm2->set_device_name(_T("YM2151 OPM (CZ-8BS1 #2)"));
104+ ctc2 = new Z80CTC(this, emu);
105105 ctc2->set_device_name(_T("Z80 CTC (CZ-8BS1 #2)"));
106106 }
107107 if(config.printer_type == 0) {
@@ -124,6 +124,7 @@ VM::VM(EMU* parent_emu) : emu(parent_emu)
124124 joy = new JOYSTICK(this, emu);
125125 memory = new MEMORY(this, emu);
126126 mouse = new MOUSE(this, emu);
127+
127128 if(pseudo_sub_cpu) {
128129 psub = new PSUB(this, emu);
129130 cpu_sub = NULL;
@@ -131,18 +132,17 @@ VM::VM(EMU* parent_emu) : emu(parent_emu)
131132 } else {
132133 // sub cpu
133134 cpu_sub = new MCS48(this, emu);
135+ cpu_sub->set_device_name(_T("MCS48 MCU (Sub)"));
134136 pio_sub = new I8255(this, emu);
137+ pio_sub->set_device_name(_T("i8255 PIO (Sub)"));
135138 rtc_sub = new UPD1990A(this, emu);
139+ rtc_sub->set_device_name(_T("uPD1990A RTC (Sub)"));
136140 sub = new SUB(this, emu);
137141
138- cpu_sub->set_device_name(_T("MCS48 MCU (Sub)"));
139- pio_sub->set_device_name(_T("i8255 PIO (Sub)"));
140- rtc_sub->set_device_name(_T("uPD1990A RTC (Sub)"));
141142 // keyboard
142143 cpu_kbd = new MCS48(this, emu);
143- kbd = new KEYBOARD(this, emu);
144-
145144 cpu_kbd->set_device_name(_T("MCS48 MCU (Keyboard)"));
145+ kbd = new KEYBOARD(this, emu);
146146 }
147147
148148 // set contexts
@@ -391,11 +391,11 @@ VM::VM(EMU* parent_emu) : emu(parent_emu)
391391 pceevent->set_lines_per_frame(PCE_LINES_PER_FRAME);
392392 pceevent->set_device_name(_T("EVENT (PC-ENGINE)"));
393393 pcecpu = new HUC6280(this, emu);
394+ pcecpu->set_device_name(_T("HuC6820 CPU (PC-ENGINE)"));
394395 pcecpu->set_context_event_manager(pceevent);
395396 pce = new PCE(this, emu);
396- pce->set_context_event_manager(pceevent);
397- pcecpu->set_device_name(_T("HuC6820 CPU (PC-ENGINE)"));
398397 pce->set_device_name(_T("SUB SYSTEM (PC-ENGINE)"));
398+ pce->set_context_event_manager(pceevent);
399399
400400 pceevent->set_context_cpu(pcecpu, PCE_CPU_CLOCKS);
401401 pceevent->set_context_sound(pce);
@@ -470,7 +470,7 @@ void VM::reset()
470470 device->reset();
471471 }
472472 pio->write_signal(SIG_I8255_PORT_B, 0x00, 0x08); // busy = low
473- //psg->set_reg(0x2e, 0); // set prescaler
473+ psg->set_reg(0x2e, 0); // set prescaler
474474 }
475475
476476 void VM::special_reset()
@@ -711,12 +711,12 @@ void VM::close_tape(int drv)
711711 {
712712 emu->lock_vm();
713713 drec->close_tape();
714+ emu->unlock_vm();
714715 if(pseudo_sub_cpu) {
715716 psub->close_tape();
716717 } else {
717718 sub->close_tape();
718719 }
719- emu->unlock_vm();
720720 }
721721
722722 bool VM::is_tape_inserted(int drv)
--- a/source/src/vm/x1/x1.h
+++ b/source/src/vm/x1/x1.h
@@ -108,7 +108,7 @@
108108 #define USE_SCANLINE
109109 #define USE_SOUND_TYPE 3
110110 // ToDo
111-#define DATAREC_SOUND
111+//#define DATAREC_SOUND
112112 #define SUPPORT_ROMA_KANA_CONVERSION
113113 // CZ-8BS1 x1
114114 #define SOUND_TYPE_DEFAULT 1
@@ -119,6 +119,10 @@
119119 # endif
120120 #define SUPPORT_TV_RENDER
121121 #define USE_JOYSTICK
122+#ifdef _X1TWIN
123+#define USE_JOYSTICK_TYPE 4
124+#define JOYSTICK_TYPE_DEFAULT 0
125+#endif
122126 #define USE_JOY_BUTTON_CAPTIONS
123127 #define USE_MOUSE
124128 #define USE_PRINTER
@@ -294,7 +298,7 @@ protected:
294298 MB8877* fdc;
295299 YM2151* opm1;
296300 YM2151* opm2;
297- //YM2203* psg;
301+// YM2203* psg;
298302 AY_3_891X* psg;
299303 Z80* cpu;
300304 Z80CTC* ctc;
--- a/source/src/vm/yalky/yalky.h
+++ b/source/src/vm/yalky/yalky.h
@@ -45,8 +45,7 @@
4545
4646 #ifdef USE_SOUND_VOLUME
4747 static const _TCHAR *sound_device_caption[] = {
48- _T("CMT (Voice)"),
49- _T("Noise (CMT)"),
48+ _T("CMT (Voice)"), _T("Noise (CMT)"),
5049 };
5150 #endif
5251
--- a/source/src/vm/z80tvgame/z80tvgame.cpp
+++ b/source/src/vm/z80tvgame/z80tvgame.cpp
@@ -57,7 +57,7 @@ VM::VM(EMU* parent_emu) : emu(parent_emu)
5757 event->set_context_sound(pcm);
5858
5959 // Sound:: Force realtime rendering. This is temporally fix. 20161024 K.O
60- pcm->set_realtime_render(true);
60+ //pcm->set_realtime_render(true);
6161
6262 #ifdef _USE_I8255
6363 pio->set_context_port_c(pcm, SIG_PCM1BIT_SIGNAL, 1, 0);
Show on old repository browser