Common Source Code Project for Qt (a.k.a for FM-7).
Revision | 876abe285d288971e70d4ca8267cf5bf13d2a498 (tree) |
---|---|
Zeit | 2017-05-30 16:49:25 |
Autor | K.Ohta <whatisthis.sowhat@gmai...> |
Commiter | K.Ohta |
[General][VM] Re-factoring VMs, sync to Upstream.
@@ -51,13 +51,8 @@ VM::VM(EMU* parent_emu) : emu(parent_emu) | ||
51 | 51 | // Set names |
52 | 52 | #if defined(_USE_QT) |
53 | 53 | 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")); | |
57 | 54 | pio1->set_device_name(_T("Z80 PIO(LEDs)")); |
58 | 55 | pio2->set_device_name(_T("Z80 PIO(7SEG/KEYBOARD)")); |
59 | - display->set_device_name(_T("7SEG/LEDs")); | |
60 | - keyboard->set_device_name(_T("KEYBOARD")); | |
61 | 56 | #endif |
62 | 57 | // set contexts |
63 | 58 | event->set_context_cpu(cpu); |
@@ -46,10 +46,6 @@ VM::VM(EMU* parent_emu) : emu(parent_emu) | ||
46 | 46 | // Set names |
47 | 47 | #if defined(_USE_QT) |
48 | 48 | 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")); | |
53 | 49 | #endif |
54 | 50 | // set contexts |
55 | 51 | event->set_context_cpu(cpu); |
@@ -183,7 +179,6 @@ void VM::set_sound_device_volume(int ch, int decibel_l, int decibel_r) | ||
183 | 179 | drec->get_context_noise_stop()->set_volume(0, decibel_l, decibel_r); |
184 | 180 | drec->get_context_noise_fast()->set_volume(0, decibel_l, decibel_r); |
185 | 181 | } |
186 | - | |
187 | 182 | } |
188 | 183 | #endif |
189 | 184 |
@@ -263,16 +263,16 @@ void MEMORY::event_frame() | ||
263 | 263 | #if defined(_USE_QT) |
264 | 264 | // If same as bm2, not effect below keys at Qt version. |
265 | 265 | 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; // カナ -> カタカナひらがな | |
269 | 269 | #else |
270 | 270 | // this is same as "日立ベーシックマスターJr.(MB-6885)エミュレータ bm2" |
271 | 271 | if(key_stat[0xa2]) key_data &= ~0x10; // 英数 -> L-CTRL |
272 | 272 | if(key_stat[0xa0]) key_data &= ~0x20; // 英記号 -> L-SHIFT |
273 | 273 | if(key_stat[0xa1]) key_data &= ~0x40; // カナ記号 -> R-SHIFT |
274 | 274 | if(key_stat[0xa3]) key_data &= ~0x80; // カナ -> R-CTRL |
275 | -#endif | |
275 | +#endif | |
276 | 276 | } |
277 | 277 | |
278 | 278 | void MEMORY::key_down(int code) |
@@ -51,18 +51,10 @@ VM::VM(EMU* parent_emu) : emu(parent_emu) | ||
51 | 51 | // Set names |
52 | 52 | #if defined(_USE_QT) |
53 | 53 | dummy->set_device_name(_T("1st Dummy")); |
54 | - event->set_device_name(_T("EVENT")); | |
55 | - cpu->set_device_name(_T("CPU(i8080)")); | |
56 | 54 | |
57 | 55 | pio->set_device_name(_T("i8255(SOUND/KEY/DISPLAY)")); |
58 | 56 | sio->set_device_name(_T("i8251(CMT)")); |
59 | - io->set_device_name(_T("I/O PORT")); | |
60 | 57 | 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")); | |
66 | 58 | #endif |
67 | 59 | |
68 | 60 | // set contexts |
@@ -74,7 +66,7 @@ VM::VM(EMU* parent_emu) : emu(parent_emu) | ||
74 | 66 | pio->set_context_port_c(keyboard, SIG_KEYBOARD_COLUMN, 0x70, 0); |
75 | 67 | pio->set_context_port_c(display, SIG_DISPLAY_DMA, 0x80, 0); |
76 | 68 | // Sound:: Force realtime rendering. This is temporally fix. 20161024 K.O |
77 | - pcm->set_realtime_render(true); | |
69 | + //pcm->set_realtime_render(true); | |
78 | 70 | |
79 | 71 | cmt->set_context_sio(sio); |
80 | 72 | display->set_context_cpu(cpu); |
@@ -51,14 +51,10 @@ VM::VM(EMU* parent_emu) : emu(parent_emu) | ||
51 | 51 | memory = new MEMORY(this, emu); |
52 | 52 | apu = new APU(this, emu); |
53 | 53 | ppu = new PPU(this, emu); |
54 | - | |
55 | 54 | cpu = new N2A03(this, emu); // cpu shoud be reset after other device |
56 | 55 | |
57 | 56 | dummy->set_device_name(_T("1st Dummy")); |
58 | 57 | |
59 | - apu->set_device_name(_T("APU")); | |
60 | - ppu->set_device_name(_T("PPU")); | |
61 | - memory->set_device_name(_T("MEMORY")); | |
62 | 58 | // set contexts |
63 | 59 | event->set_context_cpu(cpu); |
64 | 60 | event->set_context_sound(apu); |
@@ -66,11 +66,6 @@ VM::VM(EMU* parent_emu) : emu(parent_emu) | ||
66 | 66 | |
67 | 67 | sio->set_device_name(_T("i8251(RS-232C)")); |
68 | 68 | 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")); | |
74 | 69 | #endif |
75 | 70 | |
76 | 71 | // set contexts |
@@ -79,6 +74,7 @@ VM::VM(EMU* parent_emu) : emu(parent_emu) | ||
79 | 74 | event->set_context_sound(fdc->get_context_noise_seek()); |
80 | 75 | event->set_context_sound(fdc->get_context_noise_head_down()); |
81 | 76 | event->set_context_sound(fdc->get_context_noise_head_up()); |
77 | + | |
82 | 78 | /* |
83 | 79 | IRQ 0 PIT CH.0 |
84 | 80 | IRQ 1 SIO RXRDY |
@@ -241,7 +237,7 @@ VM::VM(EMU* parent_emu) : emu(parent_emu) | ||
241 | 237 | for(DEVICE* device = first_device; device; device = device->next_device) { |
242 | 238 | device->initialize(); |
243 | 239 | } |
244 | - pcm->set_realtime_render(true); | |
240 | + //pcm->set_realtime_render(true); | |
245 | 241 | } |
246 | 242 | |
247 | 243 | VM::~VM() |
@@ -52,6 +52,7 @@ VM::VM(EMU* parent_emu) : emu(parent_emu) | ||
52 | 52 | // create devices |
53 | 53 | first_device = last_device = NULL; |
54 | 54 | dummy = new DEVICE(this, emu); // must be 1st device |
55 | + sio_kb->set_device_name(_T("1st dummy")); | |
55 | 56 | event = new EVENT(this, emu); // must be 2nd device |
56 | 57 | |
57 | 58 | dma = new I8237(this, emu); |
@@ -75,7 +76,6 @@ VM::VM(EMU* parent_emu) : emu(parent_emu) | ||
75 | 76 | fdc->set_context_noise_seek(new NOISE(this, emu)); |
76 | 77 | fdc->set_context_noise_head_down(new NOISE(this, emu)); |
77 | 78 | fdc->set_context_noise_head_up(new NOISE(this, emu)); |
78 | - dummy->set_device_name(_T("1st Dummy")); | |
79 | 79 | cpu->set_device_name(_T("CPU(80C86)")); |
80 | 80 | |
81 | 81 | scsi_host = new SCSI_HOST(this, emu); |
@@ -1080,7 +1080,6 @@ bool BIOS::bios_int_i86(int intnum, uint16_t regs[], uint16_t sregs[], int32_t* | ||
1080 | 1080 | |
1081 | 1081 | if(intnum == 0x93) { |
1082 | 1082 | // disk bios |
1083 | - printf("INT 93H\n"); | |
1084 | 1083 | return bios_call_i86(0xfffc4, regs, sregs, ZeroFlag, CarryFlag); |
1085 | 1084 | } |
1086 | 1085 | return false; |
@@ -108,7 +108,6 @@ VM::VM(EMU* parent_emu) : emu(parent_emu) | ||
108 | 108 | dummy = new DEVICE(this, emu); // must be 1st device |
109 | 109 | event = new EVENT(this, emu); // must be 2nd device |
110 | 110 | dummy->set_device_name(_T("1st Dummy")); |
111 | - event->set_device_name(_T("EVENT")); | |
112 | 111 | |
113 | 112 | #if defined(HAS_I286) |
114 | 113 | cpu = new I286(this, emu); |
@@ -142,8 +141,6 @@ VM::VM(EMU* parent_emu) : emu(parent_emu) | ||
142 | 141 | fdc->set_context_noise_head_up(new NOISE(this, emu)); |
143 | 142 | rtc = new MSM58321(this, emu); |
144 | 143 | pcm = new PCM1BIT(this, emu); |
145 | - pit0->set_device_name(_T("i8253 PIT #0")); | |
146 | - pit1->set_device_name(_T("i8253 PIT #1")); | |
147 | 144 | |
148 | 145 | scsi_host = new SCSI_HOST(this, emu); |
149 | 146 | for(int i = 0; i < 7; i++) { |
@@ -272,13 +272,8 @@ void IO::write_io8(uint32_t addr, uint32_t data) | ||
272 | 272 | lcd_addr = (lcd_addr & 0xff00) | data; |
273 | 273 | break; |
274 | 274 | 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); | |
282 | 277 | break; |
283 | 278 | case 0x21: |
284 | 279 | key_column = data & 0x0f; |
@@ -302,12 +297,8 @@ void IO::write_io8(uint32_t addr, uint32_t data) | ||
302 | 297 | } |
303 | 298 | break; |
304 | 299 | 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); | |
311 | 302 | break; |
312 | 303 | } |
313 | 304 | } else { |
@@ -224,6 +224,14 @@ void VM::set_sound_device_volume(int ch, int decibel_l, int decibel_r) | ||
224 | 224 | psg->set_volume(0, decibel_l, decibel_r); |
225 | 225 | } else if(ch == 1) { |
226 | 226 | 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); | |
227 | 235 | } |
228 | 236 | } |
229 | 237 | #endif |
@@ -242,6 +242,10 @@ VM::VM(EMU* parent_emu) : emu(parent_emu) | ||
242 | 242 | io->set_flipflop_single_rw(i, iovalues[i & 0x1f]); |
243 | 243 | } |
244 | 244 | #endif |
245 | + | |
246 | + | |
247 | + | |
248 | + | |
245 | 249 | // initialize all devices |
246 | 250 | for(DEVICE* device = first_device; device; device = device->next_device) { |
247 | 251 | device->initialize(); |
@@ -129,7 +129,7 @@ VM::VM(EMU* parent_emu) : emu(parent_emu) | ||
129 | 129 | pio_i->set_context_port_c(crtc, SIG_CRTC_MASK, 0x01, 0); |
130 | 130 | pio_i->set_context_port_c(pcm, SIG_PCM1BIT_SIGNAL, 0x04, 0); |
131 | 131 | // Sound:: Force realtime rendering. This is temporally fix. 20161024 K.O |
132 | - pcm->set_realtime_render(true); | |
132 | + //pcm->set_realtime_render(true); | |
133 | 133 | |
134 | 134 | |
135 | 135 | rtc->set_context_alarm(interrupt, SIG_INTERRUPT_RP5C15, 1); |
@@ -452,8 +452,8 @@ void VM::close_tape(int drv) | ||
452 | 452 | { |
453 | 453 | emu->lock_vm(); |
454 | 454 | drec->close_tape(); |
455 | - cmt->close_tape(); | |
456 | 455 | emu->unlock_vm(); |
456 | + cmt->close_tape(); | |
457 | 457 | } |
458 | 458 | |
459 | 459 | bool VM::is_tape_inserted(int drv) |
@@ -132,7 +132,7 @@ VM::VM(EMU* parent_emu) : emu(parent_emu) | ||
132 | 132 | pio_i->set_context_port_c(cmt, SIG_CMT_PIO_PC, 0xff, 0); |
133 | 133 | pio_i->set_context_port_c(pcm, SIG_PCM1BIT_SIGNAL, 0x04, 0); |
134 | 134 | // Sound:: Force realtime rendering. This is temporally fix. 20161024 K.O |
135 | - pcm->set_realtime_render(true); | |
135 | + //pcm->set_realtime_render(true); | |
136 | 136 | |
137 | 137 | pio->set_context_port_a(memory, SIG_MEMORY_VRAM_SEL, 0xc0, 0); |
138 | 138 | pio->set_context_port_a(memory, SIG_CRTC_WIDTH80, 0x20, 0); |
@@ -107,7 +107,7 @@ VM::VM(EMU* parent_emu) : emu(parent_emu) | ||
107 | 107 | pio0->set_context_port_c(crtc, SIG_CRTC_MASK, 0x01, 0); |
108 | 108 | pio0->set_context_port_c(pcm, SIG_PCM1BIT_SIGNAL, 0x04, 0); |
109 | 109 | // Sound:: Force realtime rendering. This is temporally fix. 20161024 K.O |
110 | - pcm->set_realtime_render(true); | |
110 | + //pcm->set_realtime_render(true); | |
111 | 111 | |
112 | 112 | |
113 | 113 | pic->set_context_cpu(cpu); |
@@ -141,7 +141,7 @@ VM::VM(EMU* parent_emu) : emu(parent_emu) | ||
141 | 141 | keyboard->set_context_pio1(pio1); |
142 | 142 | memory->set_context_crtc(crtc); |
143 | 143 | mouse->set_context_sio(sio); |
144 | - if(config.printer_type == 0) { | |
144 | + if(config.printer_type == 0) { | |
145 | 145 | PRNFILE *prnfile = new PRNFILE(this, emu); |
146 | 146 | prnfile->set_context_busy(not_busy, SIG_NOT_INPUT, 1); |
147 | 147 | printer->set_context_prn(prnfile); |
@@ -158,7 +158,7 @@ VM::VM(EMU* parent_emu) : emu(parent_emu) | ||
158 | 158 | pio->set_context_port_b(rtc, SIG_UPD1990A_DIN, 0x10, 0); |
159 | 159 | pio->set_context_port_b(rtc, SIG_UPD1990A_CLK, 0x20, 0); |
160 | 160 | 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 | |
162 | 162 | pio->set_context_port_c(kbd, SIG_KEYBOARD_DC, 0x01, 0); |
163 | 163 | pio->set_context_port_c(kbd, SIG_KEYBOARD_STC, 0x02, 0); |
164 | 164 | pio->set_context_port_c(kbd, SIG_KEYBOARD_ACKC, 0x04, 0); |
@@ -210,17 +210,17 @@ VM::VM(EMU* parent_emu) : emu(parent_emu) | ||
210 | 210 | |
211 | 211 | // mz3500sm p.17 |
212 | 212 | 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 | |
214 | 214 | mainio->set_iomap_range_rw(0xf8, 0xfb, mainbus); // mfd interface |
215 | 215 | mainio->set_iomap_range_rw(0xfc, 0xff, mainbus); // memory mpaper |
216 | 216 | |
217 | 217 | // 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) | |
219 | 219 | subio->set_iomap_range_rw(0x10, 0x1f, sio); |
220 | 220 | subio->set_iomap_range_rw(0x20, 0x2f, pit); |
221 | 221 | 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 | |
224 | 224 | subio->set_iomap_range_rw(0x60, 0x6f, gdc_gfx); |
225 | 225 | subio->set_iomap_range_rw(0x70, 0x7f, gdc_chr); |
226 | 226 | #ifdef _IO_DEBUG_LOG |
@@ -80,7 +80,6 @@ VM::VM(EMU* parent_emu) : emu(parent_emu) | ||
80 | 80 | pcm = new PCM1BIT(this, emu); |
81 | 81 | cpu = new Z80(this, emu); |
82 | 82 | |
83 | - cpu->set_device_name(_T("CPU(Z80)")); | |
84 | 83 | // cmos = new CMOS(this, emu); |
85 | 84 | emm = new EMM(this, emu); |
86 | 85 | kanji = new KANJI(this, emu); |
@@ -108,19 +107,20 @@ VM::VM(EMU* parent_emu) : emu(parent_emu) | ||
108 | 107 | printer = dummy; |
109 | 108 | } |
110 | 109 | 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 | - | |
115 | 110 | not_reset->set_device_name(_T("NOT Gate (Reset)")); |
111 | + not_strobe = new NOT(this, emu); | |
116 | 112 | not_strobe->set_device_name(_T("NOT Gate (Prinet Strobe)")); |
113 | + psg_l = new SN76489AN(this, emu); | |
117 | 114 | psg_l->set_device_name(_T("SN76489AN PSG (Left)")); |
115 | + psg_r = new SN76489AN(this, emu); | |
118 | 116 | psg_r->set_device_name(_T("SN76489AN PSG (Right)")); |
119 | - | |
120 | 117 | #endif |
121 | 118 | pio_int = new Z80PIO(this, emu); |
119 | + pio_int->set_device_name(_T("Z80 PIO(Interrupt)")); | |
122 | 120 | sio_rs = new Z80SIO(this, emu); |
121 | + sio_rs->set_device_name(_T("Z80 SIO(RS-232C)")); | |
123 | 122 | sio_qd = new Z80SIO(this, emu); |
123 | + sio_qd->set_device_name(_T("Z80 SIO(Quick Disk)")); | |
124 | 124 | |
125 | 125 | floppy = new FLOPPY(this, emu); |
126 | 126 | #if defined(_MZ1500) |
@@ -387,7 +387,7 @@ VM::VM(EMU* parent_emu) : emu(parent_emu) | ||
387 | 387 | for(DEVICE* device = first_device; device; device = device->next_device) { |
388 | 388 | device->initialize(); |
389 | 389 | } |
390 | - pcm->set_realtime_render(true); | |
390 | + //pcm->set_realtime_render(true); | |
391 | 391 | #if defined(_MZ800) || defined(_MZ1500) |
392 | 392 | for(int i = 0; i < MAX_DRIVE; i++) { |
393 | 393 | fdc->set_drive_type(i, DRIVE_TYPE_2DD); |
@@ -133,7 +133,7 @@ VM::VM(EMU* parent_emu) : emu(parent_emu) | ||
133 | 133 | pio->set_context_port_c(drec, SIG_DATAREC_TRIG, 8, 0); |
134 | 134 | counter->set_context_1qa(pcm, SIG_PCM1BIT_SIGNAL, 1); |
135 | 135 | // Sound:: Force realtime rendering. This is temporally fix. 20161024 K.O |
136 | - pcm->set_realtime_render(true); | |
136 | + //pcm->set_realtime_render(true); | |
137 | 137 | |
138 | 138 | keyboard->set_context_pio(pio); |
139 | 139 | memory->set_context_ctc(ctc); |
@@ -58,6 +58,11 @@ | ||
58 | 58 | #define USE_AUTO_KEY 5 |
59 | 59 | #define USE_AUTO_KEY_RELEASE 6 |
60 | 60 | #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 | |
61 | 66 | #define USE_PRINTER |
62 | 67 | #define USE_PRINTER_TYPE 4 |
63 | 68 | #define USE_DEBUGGER |
@@ -67,9 +72,6 @@ | ||
67 | 72 | #define USE_FD2 |
68 | 73 | #define USE_FD3 |
69 | 74 | #define USE_FD4 |
70 | -#define USE_SOUND_VOLUME 4 | |
71 | -#else | |
72 | -#define USE_SOUND_VOLUME 3 | |
73 | 75 | #endif |
74 | 76 | #if defined(_MZ80K) |
75 | 77 | #define USE_MONITOR_TYPE 2 |
@@ -176,7 +176,7 @@ static const int key_conv_table[9][3] = { | ||
176 | 176 | {0x1d, 0x20, 0}, // 決定-> SPACE |
177 | 177 | }; |
178 | 178 | |
179 | -static const int8_t intr_mask2_table[8] = { | |
179 | +static const uint8_t intr_mask2_table[8] = { | |
180 | 180 | ~7, ~3, ~5, ~1, ~6, ~2, ~4, ~0 |
181 | 181 | }; |
182 | 182 |
@@ -786,31 +786,24 @@ void PC88::write_io8(uint32_t addr, uint32_t data) | ||
786 | 786 | if(mod & 0x10) { |
787 | 787 | update_gvram_wait(); |
788 | 788 | } |
789 | - { | |
790 | - bool ff = beep_on; | |
791 | - bool fy = sing_signal; | |
792 | - beep_on = ((data & 0x20) != 0); | |
789 | + beep_on = ((data & 0x20) != 0); | |
793 | 790 | #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; | |
807 | 796 | } |
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; | |
812 | 802 | } |
803 | + mouse_strobe_clock = get_current_clock(); | |
813 | 804 | } |
805 | +#endif | |
806 | + sing_signal = ((data & 0x80) != 0); | |
814 | 807 | d_pcm->write_signal(SIG_PCM1BIT_SIGNAL, ((beep_on && beep_signal) || sing_signal) ? 1 : 0, 1); |
815 | 808 | break; |
816 | 809 | case 0x44: |
@@ -973,10 +966,10 @@ void PC88::write_io8(uint32_t addr, uint32_t data) | ||
973 | 966 | break; |
974 | 967 | case 0xe6: |
975 | 968 | // 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); | |
978 | 971 | } |
979 | - intr_mask2 = (uint8_t)intr_mask2_table[data & 7]; | |
972 | + intr_mask2 = intr_mask2_table[data & 7]; | |
980 | 973 | intr_req &= intr_mask2; |
981 | 974 | update_intr(); |
982 | 975 | break; |
@@ -75,7 +75,7 @@ VM::VM(EMU* parent_emu) : emu(parent_emu) | ||
75 | 75 | pc88rtc = new UPD1990A(this, emu); |
76 | 76 | // pc88rtc->set_device_name(_T("uPD1990A RTC (PC-8801)")); |
77 | 77 | // pc88rtc->set_context_event_manager(pc88event); |
78 | - // config.sound_device_type | |
78 | + // config.sound_type | |
79 | 79 | // 0: 44h:OPNA A4h:None PC-8801FH/MH or later |
80 | 80 | // 1: 44h:OPN A4h:None PC-8801mkIISR/TR/MR/FR |
81 | 81 | // 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) | ||
83 | 83 | // pc88opn->set_context_event_manager(pc88event); |
84 | 84 | #ifdef USE_SOUND_TYPE |
85 | 85 | #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 | + } | |
86 | 91 | pc88opn->is_ym2608 = (config.sound_type == 0); |
87 | 92 | #endif |
88 | 93 | #ifdef SUPPORT_PC88_SB2 |
89 | 94 | if(config.sound_type == 2) { |
90 | 95 | pc88sb2 = new YM2203(this, emu); |
91 | 96 | #ifdef SUPPORT_PC88_OPNA |
97 | + pc88sb2->set_device_name(_T("YM2608 OPNA (SB2)")); | |
92 | 98 | pc88sb2->is_ym2608 = true; |
99 | +#else | |
100 | + pc88sb2->set_device_name(_T("YM2203 OPN (SB2)")); | |
93 | 101 | #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 | |
99 | 102 | // pc88sb2->set_context_event_manager(pc88event); |
100 | 103 | } else { |
101 | 104 | pc88sb2 = NULL; |
@@ -119,10 +122,13 @@ VM::VM(EMU* parent_emu) : emu(parent_emu) | ||
119 | 122 | pc88cpu->set_device_name(_T("MAIN CPU(Z80)")); |
120 | 123 | |
121 | 124 | pc88sub = new PC80S31K(this, emu); |
125 | + pc88sub->set_device_name(_T("PC-80S31K (Sub)")); | |
122 | 126 | // pc88sub->set_context_event_manager(pc88event); |
123 | 127 | pc88pio_sub = new I8255(this, emu); |
128 | + pc88pio_sub->set_device_name(_T("8255 PIO (Sub)")); | |
124 | 129 | // pc88pio_sub->set_context_event_manager(pc88event); |
125 | 130 | pc88fdc_sub = new UPD765A(this, emu); |
131 | + pc88fdc_sub->set_device_name(_T("uPD765A FDC (Sub)")); | |
126 | 132 | // pc88fdc_sub->set_context_event_manager(pc88event); |
127 | 133 | pc88noise_seek = new NOISE(this, emu); |
128 | 134 | // pc88noise_seek->set_context_event_manager(pc88event); |
@@ -131,29 +137,23 @@ VM::VM(EMU* parent_emu) : emu(parent_emu) | ||
131 | 137 | pc88noise_head_up = new NOISE(this, emu); |
132 | 138 | // pc88noise_head_up->set_context_event_manager(pc88event); |
133 | 139 | pc88cpu_sub = new Z80(this, emu); |
140 | + pc88cpu_sub->set_device_name(_T("Z80 CPU (Sub)")); | |
134 | 141 | // pc88cpu_sub->set_context_event_manager(pc88event); |
135 | 142 | |
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)")); | |
140 | 143 | #ifdef SUPPORT_PC88_PCG8100 |
141 | 144 | pc88pit = new I8253(this, emu); |
142 | 145 | // pc88pit->set_context_event_manager(pc88event); |
143 | 146 | pc88pcm0 = new PCM1BIT(this, emu); |
144 | -// pc88pcm->set_context_event_manager(pc88event); | |
147 | +// pc88pcm0->set_context_event_manager(pc88event); | |
145 | 148 | pc88pcm1 = new PCM1BIT(this, emu); |
146 | -// pc88pcm->set_context_event_manager(pc88event); | |
149 | +// pc88pcm1->set_context_event_manager(pc88event); | |
147 | 150 | pc88pcm2 = new PCM1BIT(this, emu); |
148 | -// pc88pcm->set_context_event_manager(pc88event); | |
151 | +// pc88pcm2->set_context_event_manager(pc88event); | |
149 | 152 | pc88pit->set_device_name(_T("i8253 PIT (PCG8100)")); |
150 | 153 | pc88pcm0->set_device_name(_T("SOUND #1 (PCG8100)")); |
151 | 154 | pc88pcm1->set_device_name(_T("SOUND #2 (PCG8100)")); |
152 | 155 | pc88pcm2->set_device_name(_T("SOUND #3 (PCG8100)")); |
153 | 156 | #endif |
154 | - pc88event->set_context_sound(pc88noise_seek); | |
155 | - pc88event->set_context_sound(pc88noise_head_down); | |
156 | - pc88event->set_context_sound(pc88noise_head_up); | |
157 | 157 | |
158 | 158 | pc88event->set_context_cpu(dummycpu, 3993624 / 4); |
159 | 159 | #ifdef SUPPORT_PC88_HIGH_CLOCK |
@@ -174,6 +174,9 @@ VM::VM(EMU* parent_emu) : emu(parent_emu) | ||
174 | 174 | pc88event->set_context_sound(pc88pcm1); |
175 | 175 | pc88event->set_context_sound(pc88pcm2); |
176 | 176 | #endif |
177 | + pc88event->set_context_sound(pc88noise_seek); | |
178 | + pc88event->set_context_sound(pc88noise_head_down); | |
179 | + pc88event->set_context_sound(pc88noise_head_up); | |
177 | 180 | pc88->set_context_cpu(pc88cpu); |
178 | 181 | pc88->set_context_opn(pc88opn); |
179 | 182 | #ifdef SUPPORT_PC88_SB2 |
@@ -89,7 +89,6 @@ VM::VM(EMU* parent_emu) : emu(parent_emu) | ||
89 | 89 | fdc->set_context_noise_head_up(new NOISE(this, emu)); |
90 | 90 | pic->set_device_name(_T("V50 PIC(i8259 COMPATIBLE)")); |
91 | 91 | cpu->set_device_name(_T("CPU (V50)")); |
92 | - io->set_device_name(_T("I/O BUS")); | |
93 | 92 | not_busy->set_device_name(_T("NOT GATE(PRINTER BUSY)")); |
94 | 93 | |
95 | 94 | if(config.printer_type == 0) { |
@@ -36,15 +36,11 @@ VM::VM(EMU* parent_emu) : emu(parent_emu) | ||
36 | 36 | pceevent = new EVENT(this, emu); |
37 | 37 | // pceevent->set_frames_per_sec(FRAMES_PER_SEC); |
38 | 38 | // pceevent->set_lines_per_frame(LINES_PER_FRAME); |
39 | -#if defined(_USE_QT) | |
40 | 39 | dummy->set_device_name(_T("1st Dummy")); |
41 | 40 | pceevent->set_device_name(_T("PC-ENGINE EVENT")); |
42 | -#endif | |
43 | 41 | |
44 | 42 | pcecpu = new HUC6280(this, emu); |
45 | -#if defined(_USE_QT) | |
46 | 43 | pcecpu->set_device_name(_T("PC-ENGINE CPU(HuC6280)")); |
47 | -#endif | |
48 | 44 | // pcecpu->set_context_event_manager(pceevent); |
49 | 45 | adpcm = new MSM5205(this, emu); |
50 | 46 | // adpcm->set_context_event_manager(pceevent); |
@@ -29,13 +29,13 @@ | ||
29 | 29 | |
30 | 30 | // device informations for win32 |
31 | 31 | #define SOUND_RATE_DEFAULT 5 // 44100Hz |
32 | -#define USE_DEVICE_TYPE 4 | |
33 | -#define DEVICE_TYPE_DEFAULT 0 | |
34 | 32 | #define SUPPORT_TV_RENDER |
35 | 33 | #define USE_CART1 |
36 | 34 | #define USE_COMPACT_DISC |
37 | 35 | #define USE_SOUND_VOLUME 3 |
38 | 36 | #define USE_JOYSTICK |
37 | +#define USE_JOYSTICK_TYPE 4 | |
38 | +#define JOYSTICK_TYPE_DEFAULT 0 | |
39 | 39 | #define USE_JOY_BUTTON_CAPTIONS |
40 | 40 | #define USE_DEBUGGER |
41 | 41 | #define USE_STATE |
@@ -34,25 +34,15 @@ VM::VM(EMU* parent_emu) : emu(parent_emu) | ||
34 | 34 | first_device = last_device = NULL; |
35 | 35 | dummy = new DEVICE(this, emu); // must be 1st device |
36 | 36 | event = new EVENT(this, emu); // must be 2nd device |
37 | -#if defined(_USE_QT) | |
38 | 37 | dummy->set_device_name(_T("1st Dummy")); |
39 | -#endif | |
40 | 38 | |
41 | 39 | io = new IO(this, emu); |
42 | 40 | memory = new MEMORY(this, emu); |
43 | 41 | cpu = new Z80(this, emu); |
44 | -#if defined(_USE_QT) | |
45 | - cpu->set_device_name(_T("CPU(Z80)")); | |
46 | -#endif | |
47 | 42 | |
48 | 43 | joystick = new JOYSTICK(this, emu); |
49 | 44 | psg = new PSG(this, emu); |
50 | 45 | 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 | |
56 | 46 | |
57 | 47 | // set contexts |
58 | 48 | event->set_context_cpu(cpu); |
@@ -36,27 +36,16 @@ VM::VM(EMU* parent_emu) : emu(parent_emu) | ||
36 | 36 | first_device = last_device = NULL; |
37 | 37 | dummy = new DEVICE(this, emu); // must be 1st device |
38 | 38 | event = new EVENT(this, emu); // must be 2nd device |
39 | -#if defined(_USE_QT) | |
40 | 39 | dummy->set_device_name(_T("1st Dummy")); |
41 | -#endif | |
42 | 40 | |
43 | 41 | io = new IO(this, emu); |
44 | 42 | memory = new MEMORY(this, emu); |
45 | 43 | psg = new SN76489AN(this, emu); |
46 | 44 | vdp = new TMS9918A(this, emu); |
47 | 45 | cpu = new Z80(this, emu); |
48 | -#if defined(_USE_QT) | |
49 | - cpu->set_device_name(_T("CPU(Z80)")); | |
50 | -#endif | |
51 | - | |
52 | 46 | cmt = new CMT(this, emu); |
53 | 47 | key = new KEYBOARD(this, emu); |
54 | 48 | 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 | |
60 | 49 | // set contexts |
61 | 50 | event->set_context_cpu(cpu); |
62 | 51 | event->set_context_sound(psg); |
@@ -34,7 +34,7 @@ | ||
34 | 34 | #define USE_AUTO_KEY 5 |
35 | 35 | #define USE_AUTO_KEY_RELEASE 6 |
36 | 36 | #define USE_AUTO_KEY_CAPS |
37 | -#define USE_SOUND_VOLUME 2 | |
37 | +#define USE_SOUND_VOLUME 1 | |
38 | 38 | #define USE_JOYSTICK |
39 | 39 | #define USE_DEBUGGER |
40 | 40 | #define USE_STATE |
@@ -171,7 +171,7 @@ VM::VM(EMU* parent_emu) : emu(parent_emu) | ||
171 | 171 | for(DEVICE* device = first_device; device; device = device->next_device) { |
172 | 172 | device->initialize(); |
173 | 173 | } |
174 | - pcm->set_realtime_render(true); | |
174 | + //pcm->set_realtime_render(true); | |
175 | 175 | for(int i = 0; i < 4; i++) { |
176 | 176 | fdc->set_drive_type(i, DRIVE_TYPE_2D); |
177 | 177 | } |
@@ -33,25 +33,13 @@ VM::VM(EMU* parent_emu) : emu(parent_emu) | ||
33 | 33 | first_device = last_device = NULL; |
34 | 34 | dummy = new DEVICE(this, emu); // must be 1st device |
35 | 35 | event = new EVENT(this, emu); // must be 2nd device |
36 | -#if defined(_USE_QT) | |
37 | 36 | dummy->set_device_name(_T("1st Dummy")); |
38 | -#endif | |
39 | - | |
40 | 37 | cpu = new UPD7801(this, emu); |
41 | -#if defined(_USE_QT) | |
42 | - cpu->set_device_name(_T("CPU(uPD7801)")); | |
43 | -#endif | |
44 | 38 | |
45 | 39 | io = new IO(this, emu); |
46 | 40 | memory = new MEMORY(this, emu); |
47 | 41 | sound = new SOUND(this, emu); |
48 | 42 | 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 | |
55 | 43 | |
56 | 44 | // set contexts |
57 | 45 | event->set_context_cpu(cpu); |
@@ -80,7 +80,7 @@ VM::VM(EMU* parent_emu) : emu(parent_emu) | ||
80 | 80 | event->set_context_sound(drec->get_context_noise_fast()); |
81 | 81 | |
82 | 82 | // Sound:: Force realtime rendering. This is temporally fix. 20161024 K.O |
83 | - pcm->set_realtime_render(true); | |
83 | + //pcm->set_realtime_render(true); | |
84 | 84 | |
85 | 85 | drec->set_context_ear(memory, SIG_MEMORY_DATAREC_IN, 1); |
86 | 86 | crtc->set_context_disp(memory, SIG_MEMORY_CRTC_DISP, 1); |
@@ -53,10 +53,10 @@ | ||
53 | 53 | #define USE_VM_AUTO_KEY_TABLE |
54 | 54 | #define USE_SCREEN_FILTER |
55 | 55 | #define USE_SCANLINE |
56 | -#if defined(_SMC70) | |
57 | -#define USE_SOUND_VOLUME 4 | |
58 | -#else | |
56 | +#if defined(_SMC777) | |
59 | 57 | #define USE_SOUND_VOLUME 5 |
58 | +#else | |
59 | +#define USE_SOUND_VOLUME 4 | |
60 | 60 | #endif |
61 | 61 | #define USE_JOYSTICK |
62 | 62 | #define USE_DEBUGGER |
@@ -46,16 +46,22 @@ VM::VM(EMU* parent_emu) : emu(parent_emu) | ||
46 | 46 | // check configs |
47 | 47 | // boot_mode = config.boot_mode; |
48 | 48 | boot_mode = -1; |
49 | -#endif | |
49 | +#endif | |
50 | +#if defined(_TK80BS) || defined(_TK80) | |
51 | + config.wave_shaper[0] = false; | |
52 | +#endif | |
53 | + | |
50 | 54 | // create devices |
51 | 55 | first_device = last_device = NULL; |
52 | 56 | dummy = new DEVICE(this, emu); // must be 1st device |
57 | + dummy->set_device_name(_T("1st Dummy")); | |
53 | 58 | event = new EVENT(this, emu); // must be 2nd device |
54 | 59 | |
60 | + cpu = new I8080(this, emu); | |
55 | 61 | #if defined(_TK80BS) |
56 | 62 | sio_b = new I8251(this, emu); // on TK-80BS |
57 | - pio_b = new I8255(this, emu); | |
58 | 63 | sio_b->set_device_name(_T("i8251 SIO (TK-80BS/CMT)")); |
64 | + pio_b = new I8255(this, emu); | |
59 | 65 | pio_b->set_device_name(_T("i8255 PIO (TK-80BS/DISPLAY)")); |
60 | 66 | memio = new IO(this, emu); |
61 | 67 | memio->set_device_name(_T("Memory Mapped I/O (TK-80BS)")); |
@@ -68,7 +74,9 @@ VM::VM(EMU* parent_emu) : emu(parent_emu) | ||
68 | 74 | // memory = new MEMORY(this, emu); |
69 | 75 | |
70 | 76 | pcm0 = new PCM1BIT(this, emu); |
77 | + pcm0->set_device_name(_T("1-Bit PCM Sound #1")); | |
71 | 78 | pcm1 = new PCM1BIT(this, emu); |
79 | + pcm1->set_device_name(_T("1-Bit PCM Sound #2")); | |
72 | 80 | |
73 | 81 | #if defined(_TK80BS) || defined(_TK80) |
74 | 82 | cmt = new CMT(this, emu); |
@@ -76,16 +84,11 @@ VM::VM(EMU* parent_emu) : emu(parent_emu) | ||
76 | 84 | display = new DISPLAY(this, emu); |
77 | 85 | keyboard = new KEYBOARD(this, emu); |
78 | 86 | memory = new MEMBUS(this, emu); |
79 | - cpu = new I8080(this, emu); | |
80 | - | |
81 | - dummy->set_device_name(_T("1st Dummy")); | |
82 | 87 | #if defined(_TK80BS) |
83 | 88 | pio_t->set_device_name(_T("i8255 PIO (TK-80/SOUND/KEYBOARD/DISPLAY)")); |
84 | 89 | #else |
85 | 90 | pio_t->set_device_name(_T("i8255 PIO (TK-80/SOUND/KEYBOARD)")); |
86 | 91 | #endif |
87 | - pcm0->set_device_name(_T("1-Bit PCM Sound #1")); | |
88 | - pcm1->set_device_name(_T("1-Bit PCM Sound #2")); | |
89 | 92 | |
90 | 93 | // set contexts |
91 | 94 | event->set_context_cpu(cpu); |
@@ -95,10 +98,6 @@ VM::VM(EMU* parent_emu) : emu(parent_emu) | ||
95 | 98 | event->set_context_sound(drec->get_context_noise_play()); |
96 | 99 | event->set_context_sound(drec->get_context_noise_stop()); |
97 | 100 | event->set_context_sound(drec->get_context_noise_fast()); |
98 | - | |
99 | -#if defined(_TK80BS) || defined(_TK80) | |
100 | - config.wave_shaper[0] = false; | |
101 | -#endif | |
102 | 101 | |
103 | 102 | /* 8255 on TK-80 |
104 | 103 |
@@ -130,8 +129,8 @@ VM::VM(EMU* parent_emu) : emu(parent_emu) | ||
130 | 129 | pio_t->set_context_port_c(memory, SIG_MEMBUS_PC7, 0x80, 0); |
131 | 130 | #endif |
132 | 131 | // 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); | |
135 | 134 | |
136 | 135 | #if defined(_TK80BS) || defined(_TK80) |
137 | 136 | cmt->set_context_drec(drec); |
@@ -87,21 +87,21 @@ VM::VM(EMU* parent_emu) : emu(parent_emu) | ||
87 | 87 | fdc->set_context_noise_seek(new NOISE(this, emu)); |
88 | 88 | fdc->set_context_noise_head_down(new NOISE(this, emu)); |
89 | 89 | fdc->set_context_noise_head_up(new NOISE(this, emu)); |
90 | - //psg = new YM2203(this, emu); | |
90 | +// psg = new YM2203(this, emu); | |
91 | 91 | psg = new AY_3_891X(this, emu); |
92 | 92 | cpu = new Z80(this, emu); |
93 | 93 | ctc = new Z80CTC(this, emu); |
94 | 94 | sio = new Z80SIO(this, emu); |
95 | 95 | if(sound_type >= 1) { |
96 | 96 | opm1 = new YM2151(this, emu); |
97 | - ctc1 = new Z80CTC(this, emu); | |
98 | 97 | opm1->set_device_name(_T("YM2151 OPM (CZ-8BS1 #1)")); |
98 | + ctc1 = new Z80CTC(this, emu); | |
99 | 99 | ctc1->set_device_name(_T("Z80 CTC (CZ-8BS1 #1)")); |
100 | 100 | } |
101 | 101 | if(sound_type == 2) { |
102 | 102 | opm2 = new YM2151(this, emu); |
103 | - ctc2 = new Z80CTC(this, emu); | |
104 | 103 | opm2->set_device_name(_T("YM2151 OPM (CZ-8BS1 #2)")); |
104 | + ctc2 = new Z80CTC(this, emu); | |
105 | 105 | ctc2->set_device_name(_T("Z80 CTC (CZ-8BS1 #2)")); |
106 | 106 | } |
107 | 107 | if(config.printer_type == 0) { |
@@ -124,6 +124,7 @@ VM::VM(EMU* parent_emu) : emu(parent_emu) | ||
124 | 124 | joy = new JOYSTICK(this, emu); |
125 | 125 | memory = new MEMORY(this, emu); |
126 | 126 | mouse = new MOUSE(this, emu); |
127 | + | |
127 | 128 | if(pseudo_sub_cpu) { |
128 | 129 | psub = new PSUB(this, emu); |
129 | 130 | cpu_sub = NULL; |
@@ -131,18 +132,17 @@ VM::VM(EMU* parent_emu) : emu(parent_emu) | ||
131 | 132 | } else { |
132 | 133 | // sub cpu |
133 | 134 | cpu_sub = new MCS48(this, emu); |
135 | + cpu_sub->set_device_name(_T("MCS48 MCU (Sub)")); | |
134 | 136 | pio_sub = new I8255(this, emu); |
137 | + pio_sub->set_device_name(_T("i8255 PIO (Sub)")); | |
135 | 138 | rtc_sub = new UPD1990A(this, emu); |
139 | + rtc_sub->set_device_name(_T("uPD1990A RTC (Sub)")); | |
136 | 140 | sub = new SUB(this, emu); |
137 | 141 | |
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)")); | |
141 | 142 | // keyboard |
142 | 143 | cpu_kbd = new MCS48(this, emu); |
143 | - kbd = new KEYBOARD(this, emu); | |
144 | - | |
145 | 144 | cpu_kbd->set_device_name(_T("MCS48 MCU (Keyboard)")); |
145 | + kbd = new KEYBOARD(this, emu); | |
146 | 146 | } |
147 | 147 | |
148 | 148 | // set contexts |
@@ -391,11 +391,11 @@ VM::VM(EMU* parent_emu) : emu(parent_emu) | ||
391 | 391 | pceevent->set_lines_per_frame(PCE_LINES_PER_FRAME); |
392 | 392 | pceevent->set_device_name(_T("EVENT (PC-ENGINE)")); |
393 | 393 | pcecpu = new HUC6280(this, emu); |
394 | + pcecpu->set_device_name(_T("HuC6820 CPU (PC-ENGINE)")); | |
394 | 395 | pcecpu->set_context_event_manager(pceevent); |
395 | 396 | pce = new PCE(this, emu); |
396 | - pce->set_context_event_manager(pceevent); | |
397 | - pcecpu->set_device_name(_T("HuC6820 CPU (PC-ENGINE)")); | |
398 | 397 | pce->set_device_name(_T("SUB SYSTEM (PC-ENGINE)")); |
398 | + pce->set_context_event_manager(pceevent); | |
399 | 399 | |
400 | 400 | pceevent->set_context_cpu(pcecpu, PCE_CPU_CLOCKS); |
401 | 401 | pceevent->set_context_sound(pce); |
@@ -470,7 +470,7 @@ void VM::reset() | ||
470 | 470 | device->reset(); |
471 | 471 | } |
472 | 472 | 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 | |
474 | 474 | } |
475 | 475 | |
476 | 476 | void VM::special_reset() |
@@ -711,12 +711,12 @@ void VM::close_tape(int drv) | ||
711 | 711 | { |
712 | 712 | emu->lock_vm(); |
713 | 713 | drec->close_tape(); |
714 | + emu->unlock_vm(); | |
714 | 715 | if(pseudo_sub_cpu) { |
715 | 716 | psub->close_tape(); |
716 | 717 | } else { |
717 | 718 | sub->close_tape(); |
718 | 719 | } |
719 | - emu->unlock_vm(); | |
720 | 720 | } |
721 | 721 | |
722 | 722 | bool VM::is_tape_inserted(int drv) |
@@ -108,7 +108,7 @@ | ||
108 | 108 | #define USE_SCANLINE |
109 | 109 | #define USE_SOUND_TYPE 3 |
110 | 110 | // ToDo |
111 | -#define DATAREC_SOUND | |
111 | +//#define DATAREC_SOUND | |
112 | 112 | #define SUPPORT_ROMA_KANA_CONVERSION |
113 | 113 | // CZ-8BS1 x1 |
114 | 114 | #define SOUND_TYPE_DEFAULT 1 |
@@ -119,6 +119,10 @@ | ||
119 | 119 | # endif |
120 | 120 | #define SUPPORT_TV_RENDER |
121 | 121 | #define USE_JOYSTICK |
122 | +#ifdef _X1TWIN | |
123 | +#define USE_JOYSTICK_TYPE 4 | |
124 | +#define JOYSTICK_TYPE_DEFAULT 0 | |
125 | +#endif | |
122 | 126 | #define USE_JOY_BUTTON_CAPTIONS |
123 | 127 | #define USE_MOUSE |
124 | 128 | #define USE_PRINTER |
@@ -294,7 +298,7 @@ protected: | ||
294 | 298 | MB8877* fdc; |
295 | 299 | YM2151* opm1; |
296 | 300 | YM2151* opm2; |
297 | - //YM2203* psg; | |
301 | +// YM2203* psg; | |
298 | 302 | AY_3_891X* psg; |
299 | 303 | Z80* cpu; |
300 | 304 | Z80CTC* ctc; |
@@ -45,8 +45,7 @@ | ||
45 | 45 | |
46 | 46 | #ifdef USE_SOUND_VOLUME |
47 | 47 | static const _TCHAR *sound_device_caption[] = { |
48 | - _T("CMT (Voice)"), | |
49 | - _T("Noise (CMT)"), | |
48 | + _T("CMT (Voice)"), _T("Noise (CMT)"), | |
50 | 49 | }; |
51 | 50 | #endif |
52 | 51 |
@@ -57,7 +57,7 @@ VM::VM(EMU* parent_emu) : emu(parent_emu) | ||
57 | 57 | event->set_context_sound(pcm); |
58 | 58 | |
59 | 59 | // Sound:: Force realtime rendering. This is temporally fix. 20161024 K.O |
60 | - pcm->set_realtime_render(true); | |
60 | + //pcm->set_realtime_render(true); | |
61 | 61 | |
62 | 62 | #ifdef _USE_I8255 |
63 | 63 | pio->set_context_port_c(pcm, SIG_PCM1BIT_SIGNAL, 1, 0); |