[VM][BEEP][PCM1BIT] Add get_debug_regs().
[VM] Apply aboves to some VMs.
diff = (int)(1024.0 * gen_rate / frequency / 2.0 + 0.5);
}
+bool BEEP::get_debug_regs_info(_TCHAR *buffer, size_t buffer_len)
+{
+ my_stprintf_s(buffer, buffer_len - 1, _T("ON=%s SIGNAL=%s VOLUME=%d\nGEN RATE=%d DIFF=%d COUNT=%d\n "),
+ (on) ? ((mute) ? _T("ON(MUTE) ") : _T("ON ")) : ((mute) ? _T("OFF(MUTE)") : _T("OFF ")),
+ (signal) ? _T("ON") : _T("OFF"),
+ gen_vol,
+ gen_rate, diff, count
+ );
+ return true;
+}
+
#define STATE_VERSION 1
bool BEEP::process_state(FILEIO* state_fio, bool loading)
void __FASTCALL write_signal(int id, uint32_t data, uint32_t mask);
void mix(int32_t* buffer, int cnt);
void set_volume(int ch, int decibel_l, int decibel_r);
+ bool get_debug_regs_info(_TCHAR *buffer, size_t buffer_len);
+
bool process_state(FILEIO* state_fio, bool loading);
// unique function
void initialize_sound(int rate, double frequency, int volume);
io = new IO(this, emu);
flipflop = new LS393(this, emu);
fdc = new MB8877(this, emu);
+#ifdef USE_DEBUGGER
+ fdc->set_context_debugger(new DEBUGGER(this, emu));
+#endif
fdc->set_context_noise_seek(new NOISE(this, emu));
fdc->set_context_noise_head_down(new NOISE(this, emu));
fdc->set_context_noise_head_up(new NOISE(this, emu));
sio_cmt = new MC6850(this, emu);
// sio_key = new MC6850(this, emu);
pcm = new PCM1BIT(this, emu);
+#ifdef USE_DEBUGGER
+ pcm->set_context_debugger(new DEBUGGER(this, emu));
+#endif
cpu = new Z80(this, emu);
ctc = new Z80CTC(this, emu);
io = new IO(this, emu);
psg = new SN76489AN(this, emu);
+#ifdef USE_DEBUGGER
+ psg->set_context_debugger(new DEBUGGER(this, emu));
+#endif
vdp = new TMS9918A(this, emu);
#ifdef USE_DEBUGGER
vdp->set_context_debugger(new DEBUGGER(this, emu));
pio = new I8255(this, emu);
io = new IO(this, emu);
pcm = new PCM1BIT(this, emu);
+#ifdef USE_DEBUGGER
+ pcm->set_context_debugger(new DEBUGGER(this, emu));
+#endif
cpu = new I8080(this, emu);
cmt = new CMT(this, emu);
fdc_2hd->set_context_noise_seek(new NOISE(this, emu));
fdc_2hd->set_context_noise_head_down(new NOISE(this, emu));
fdc_2hd->set_context_noise_head_up(new NOISE(this, emu));
+#ifdef USE_DEBUGGER
+ fdc_2hd->set_context_debugger(new DEBUGGER(this, emu));
+#endif
fdc_2d = new MB8877(this, emu);
fdc_2d->set_context_noise_seek(new NOISE(this, emu));
fdc_2d->set_context_noise_head_down(new NOISE(this, emu));
fdc_2d->set_context_noise_head_up(new NOISE(this, emu));
+#ifdef USE_DEBUGGER
+ fdc_2d->set_context_debugger(new DEBUGGER(this, emu));
+#endif
subcpu = new MC6809(this, emu);
ptm = new MC6840(this, emu);
rtc = new MSM58321(this, emu);
pcm = new PCM1BIT(this, emu);
+#ifdef USE_DEBUGGER
+ pcm->set_context_debugger(new DEBUGGER(this, emu));
+#endif
cmos = new CMOS(this, emu);
keyboard = new KEYBOARD(this, emu);
#if defined(_FM77AV_VARIANTS)
alu = new MB61VH010(this, emu);
keyboard_beep = new BEEP(this, emu);
+#ifdef USE_DEBUGGER
+ keyboard_beep->set_context_debugger(new DEBUGGER(this, emu));
+#endif
#endif
// basic devices
drec->set_context_noise_stop(new NOISE(this, emu));
drec->set_context_noise_fast(new NOISE(this, emu));
pcm1bit = new PCM1BIT(this, emu);
+#ifdef USE_DEBUGGER
+ pcm1bit->set_context_debugger(new DEBUGGER(this, emu));
+#endif
connect_320kfdc = connect_1Mfdc = false;
fdc = NULL;
scsi_host->set_context_target(scsi_hdd[i]);
}
psg = new SN76489AN(this, emu);
+#ifdef USE_DEBUGGER
+ psg->set_context_debugger(new DEBUGGER(this, emu));
+#endif
if(FILEIO::IsFileExisting(create_local_path(_T("IPL.ROM")))) {
bios = NULL;
} else {
dummy->set_device_name(_T("1st Dummy"));
beep = new BEEP(this, emu);
+#ifdef USE_DEBUGGER
+ beep->set_context_debugger(new DEBUGGER(this, emu));
+#endif
drec = new DATAREC(this, emu);
drec->set_context_noise_play(new NOISE(this, emu));
drec->set_context_noise_stop(new NOISE(this, emu));
fdc->set_context_noise_seek(new NOISE(this, emu));
fdc->set_context_noise_head_down(new NOISE(this, emu));
fdc->set_context_noise_head_up(new NOISE(this, emu));
+#ifdef USE_DEBUGGER
+ fdc->set_context_debugger(new DEBUGGER(this, emu));
+#endif
subcpu = new UPD7801(this, emu);
maincpu = new Z80(this, emu);
subcpu->set_device_name(_T("SUB CPU (uPD7801)"));
pio_f->set_device_name(_T("8255 PIO (Floppy I/F)"));
io = new IO(this, emu);
psg = new SN76489AN(this, emu);
+#ifdef USE_DEBUGGER
+ psg->set_context_debugger(new DEBUGGER(this, emu));
+#endif
vdp = new _315_5124(this, emu);
fdc = new UPD765A(this, emu);
+#ifdef USE_DEBUGGER
+ fdc->set_context_debugger(new DEBUGGER(this, emu));
+#endif
fdc->set_context_noise_seek(new NOISE(this, emu));
fdc->set_context_noise_head_down(new NOISE(this, emu));
fdc->set_context_noise_head_up(new NOISE(this, emu));
cpu = new Z80(this, emu);
+#ifdef USE_DEBUGGER
+ cpu->set_context_debugger(new DEBUGGER(this, emu));
+#endif
key = new KEYBOARD(this, emu);
memory = new MEMORY(this, emu);
pio_f->set_device_name(_T("8255 PIO (Floppy I/F)"));
io = new IO(this, emu);
psg = new SN76489AN(this, emu);
+#ifdef USE_DEBUGGER
+ psg->set_context_debugger(new DEBUGGER(this, emu));
+#endif
fm = new YM2413(this, emu);
vdp = new _315_5124(this, emu);
/// fdc = new UPD765A(this, emu);
/// fdc->set_context_noise_head_down(new NOISE(this, emu));
// fdc->set_context_noise_head_up(new NOISE(this, emu));
cpu = new Z80(this, emu);
+#ifdef USE_DEBUGGER
+ cpu->set_context_debugger(new DEBUGGER(this, emu));
+#endif
key = new KEYBOARD(this, emu);
memory = new MEMORY(this, emu);
cpu_tf20->set_context_intr(tf20);
#ifdef USE_DEBUGGER
cpu_tf20->set_context_debugger(new DEBUGGER(this, emu));
+ beep->set_context_debugger(new DEBUGGER(this, emu));
+ fdc_tf20->set_context_debugger(new DEBUGGER(this, emu));
#endif
+
fdc_tf20->set_context_irq(cpu_tf20, SIG_CPU_IRQ, 1);
sio_tf20->set_context_send(0, memory, SIG_MEMORY_SIO_TF20);
sio_tf20->set_tx_clock(0, 4915200 / 8); // 4.9152MHz / 8 (38.4kbps)
dummy->set_device_name(_T("1st Dummy"));
beep = new BEEP(this, emu);
+#ifdef USE_DEBUGGER
+ beep->set_context_debugger(new DEBUGGER(this, emu));
+#endif
drec = new DATAREC(this, emu);
drec->set_context_noise_play(new NOISE(this, emu));
drec->set_context_noise_stop(new NOISE(this, emu));
dummy->set_device_name(_T("1st Dummy"));
beep = new BEEP(this, emu);
+#ifdef USE_DEBUGGER
+ beep->set_context_debugger(new DEBUGGER(this, emu));
+#endif
sio = new I8251(this, emu);
tf20 = new PTF20(this, emu);
cpu = new Z80(this, emu);
cpu->set_context_intr(pic);
#ifdef USE_DEBUGGER
cpu->set_context_debugger(new DEBUGGER(this, emu));
+ pcm->set_context_debugger(new DEBUGGER(this, emu));
+ fdc->set_context_debugger(new DEBUGGER(this, emu));
#endif
// dmac
cpu->set_context_mem(memory);
#ifdef USE_DEBUGGER
cpu->set_context_debugger(new DEBUGGER(this, emu));
+ pcm->set_context_debugger(new DEBUGGER(this, emu));
#endif
// initialize all devices
cpu->set_context_mem(memory);
#ifdef USE_DEBUGGER
cpu->set_context_debugger(new DEBUGGER(this, emu));
+ pcm->set_context_debugger(new DEBUGGER(this, emu));
#endif
// memory bus
cpu->set_context_intr(pic);
#ifdef USE_DEBUGGER
cpu->set_context_debugger(new DEBUGGER(this, emu));
+ pcm->set_context_debugger(new DEBUGGER(this, emu));
+ psg->set_context_debugger(new DEBUGGER(this, emu));
#endif
crtc->set_context_disp(display, SIG_DISPLAY_ENABLE, 1);
vdp = new TMS9918A(this, emu);
#ifdef USE_DEBUGGER
vdp->set_context_debugger(new DEBUGGER(this, emu));
+ psg->set_context_debugger(new DEBUGGER(this, emu));
#endif
cpu = new Z80(this, emu);
ctc = new Z80CTC(this, emu);
psg->set_context_debugger(new DEBUGGER(this, emu));
#endif
pcm = new PCM1BIT(this, emu);
+#ifdef USE_DEBUGGER
+ pcm->set_context_debugger(new DEBUGGER(this, emu));
+#endif
#if !defined(_MSX1_VARIANTS)
rtc = new RP5C01(this, emu);
vdp = new V99X8(this, emu);
fdc->set_context_noise_head_up(new NOISE(this, emu));
psg = new AY_3_891X(this, emu);
#ifdef USE_DEBUGGER
+ fdc->set_context_debugger(new DEBUGGER(this, emu));
+ beep->set_context_debugger(new DEBUGGER(this, emu));
psg->set_context_debugger(new DEBUGGER(this, emu));
#endif
cpu = new Z80(this, emu);
cpu->set_context_intr(dummy);
#ifdef USE_DEBUGGER
cpu->set_context_debugger(new DEBUGGER(this, emu));
+ psg->set_context_debugger(new DEBUGGER(this, emu));
#endif
// i/o bus
fdc->set_context_noise_seek(new NOISE(this, emu));
fdc->set_context_noise_head_down(new NOISE(this, emu));
fdc->set_context_noise_head_up(new NOISE(this, emu));
+#ifdef USE_DEBUGGER
+ fdc->set_context_debugger(new DEBUGGER(this, emu));
+#endif
pcm = new PCM1BIT(this, emu);
+#ifdef USE_DEBUGGER
+ pcm->set_context_debugger(new DEBUGGER(this, emu));
+#endif
rtc = new RP5C01(this, emu); // RP-5C15
sasi_host = new SCSI_HOST(this, emu);
sasi_hdd = new SASI_HDD(this, emu);
fdc->set_context_noise_seek(new NOISE(this, emu));
fdc->set_context_noise_head_down(new NOISE(this, emu));
fdc->set_context_noise_head_up(new NOISE(this, emu));
+#ifdef USE_DEBUGGER
+ fdc->set_context_debugger(new DEBUGGER(this, emu));
+#endif
pcm = new PCM1BIT(this, emu);
+#ifdef USE_DEBUGGER
+ pcm->set_context_debugger(new DEBUGGER(this, emu));
+#endif
cpu = new Z80(this, emu);
pio = new Z80PIO(this, emu);
pio_i->set_device_name(_T("i8255 PIO(CMT/CRTC)"));
fdc->set_context_noise_seek(new NOISE(this, emu));
fdc->set_context_noise_head_down(new NOISE(this, emu));
fdc->set_context_noise_head_up(new NOISE(this, emu));
+#ifdef USE_DEBUGGER
+ fdc->set_context_debugger(new DEBUGGER(this, emu));
+#endif
not_busy = new NOT(this, emu);
not_busy->set_device_name(_T("NOT GATE(PRINTER BUSY)"));
pcm = new PCM1BIT(this, emu);
+#ifdef USE_DEBUGGER
+ pcm->set_context_debugger(new DEBUGGER(this, emu));
+#endif
rtc = new RP5C01(this, emu); // RP-5C15
sasi_host = new SCSI_HOST(this, emu);
for(int i = 0; i < array_length(sasi_hdd); i++) {
fdc->set_context_noise_seek(new NOISE(this, emu));
fdc->set_context_noise_head_down(new NOISE(this, emu));
fdc->set_context_noise_head_up(new NOISE(this, emu));
+#ifdef USE_DEBUGGER
+ fdc->set_context_debugger(new DEBUGGER(this, emu));
+#endif
maincpu = new Z80(this, emu);
mainbus= new MAIN(this, emu);
mainio->set_device_name(_T("I/O Bus (Main)"));
not_busy = new NOT(this, emu);
not_busy->set_device_name(_T("NOT Gate (Printer Busy)"));
pcm = new PCM1BIT(this, emu);
+#ifdef USE_DEBUGGER
+ pcm->set_context_debugger(new DEBUGGER(this, emu));
+#endif
rtc = new UPD1990A(this, emu);
gdc_chr = new UPD7220(this, emu);
gdc_chr->set_device_name(_T("uPD7220 GDC (Character)"));
rtc = new RP5C01(this, emu);
gdc = new UPD7220(this, emu);
fdc = new UPD765A(this, emu);
+#ifdef USE_DEBUGGER
+ fdc->set_context_debugger(new DEBUGGER(this, emu));
+#endif
fdc->set_context_noise_seek(new NOISE(this, emu));
fdc->set_context_noise_head_down(new NOISE(this, emu));
fdc->set_context_noise_head_up(new NOISE(this, emu));
#endif
#ifdef USE_DEBUGGER
cpu->set_context_debugger(new DEBUGGER(this, emu));
+ fdc->set_context_debugger(new DEBUGGER(this, emu));
+ pcm->set_context_debugger(new DEBUGGER(this, emu));
+#if defined(_MZ800)
+ psg->set_context_debugger(new DEBUGGER(this, emu));
+#elif defined(_MZ1500)
+ psg_l->set_context_debugger(new DEBUGGER(this, emu));
+ psg_r->set_context_debugger(new DEBUGGER(this, emu));
#endif
-
+#endif
// emm
io->set_iomap_range_rw(0x00, 0x03, emm);
// kanji
dummy->set_device_name(_T("1st Dummy"));
beep = new BEEP(this, emu);
+#ifdef USE_DEBUGGER
+ beep->set_context_debugger(new DEBUGGER(this, emu));
+#endif
cpu = new I386(this, emu);
dma = new I8237(this, emu);
#ifdef USE_DEBUGGER
fdc->set_context_noise_seek(new NOISE(this, emu));
fdc->set_context_noise_head_down(new NOISE(this, emu));
fdc->set_context_noise_head_up(new NOISE(this, emu));
+#ifdef USE_DEBUGGER
+ fdc->set_context_debugger(new DEBUGGER(this, emu));
+#endif
display = new DISPLAY(this, emu);
floppy = new FLOPPY(this, emu);
flipflop = new LS393(this, emu); // LS74
not_remote = new NOT(this, emu);
pcm = new PCM1BIT(this, emu);
+#ifdef USE_DEBUGGER
+ pcm->set_context_debugger(new DEBUGGER(this, emu));
+#endif
fdc = new UPD765A(this, emu);
+#ifdef USE_DEBUGGER
+ fdc->set_context_debugger(new DEBUGGER(this, emu));
+#endif
fdc->set_context_noise_seek(new NOISE(this, emu));
fdc->set_context_noise_head_down(new NOISE(this, emu));
fdc->set_context_noise_head_up(new NOISE(this, emu));
psg0->set_device_name(_T("SN76489AN PSG #1"));
psg1 = new SN76489AN(this, emu);
psg1->set_device_name(_T("SN76489AN PSG #2"));
+#ifdef USE_DEBUGGER
+ pcm->set_context_debugger(new DEBUGGER(this, emu));
+ psg0->set_context_debugger(new DEBUGGER(this, emu));
+ psg1->set_context_debugger(new DEBUGGER(this, emu));
+#endif
fdc = new UPD765A(this, emu);
fdc->set_context_noise_seek(new NOISE(this, emu));
fdc->set_context_noise_head_down(new NOISE(this, emu));
fdc->set_context_noise_head_up(new NOISE(this, emu));
+#ifdef USE_DEBUGGER
+ fdc->set_context_debugger(new DEBUGGER(this, emu));
+#endif
cpu = new Z80(this, emu);
ctc = new Z80CTC(this, emu);
pio = new Z80PIO(this, emu);
and_drq = new AND(this, emu);
beep = new BEEP(this, emu);
+#ifdef USE_DEBUGGER
+ beep->set_context_debugger(new DEBUGGER(this, emu));
+#endif
sio = new I8251(this, emu);
pio0 = new I8255(this, emu);
pio0->set_device_name(_T("8255 PIO (RTC)"));
rtc = new MSM58321(this, emu);
pcm = new PCM1BIT(this, emu);
fdc = new UPD765A(this, emu);
+#ifdef USE_DEBUGGER
+ fdc->set_context_debugger(new DEBUGGER(this, emu));
+#endif
fdc->set_context_noise_seek(new NOISE(this, emu));
fdc->set_context_noise_head_down(new NOISE(this, emu));
fdc->set_context_noise_head_up(new NOISE(this, emu));
drec->set_context_noise_fast(new NOISE(this, emu));
memory = new MEMORY(this, emu);
pcm = new PCM1BIT(this, emu);
+#ifdef USE_DEBUGGER
+ pcm->set_context_debugger(new DEBUGGER(this, emu));
+#endif
lcd[0] = new UPD16434(this, emu);
lcd[0]->set_device_name(_T("uPD16434 LCD Controller #0"));
lcd[1] = new UPD16434(this, emu);
io = new IO(this, emu);
pcm = new PCM1BIT(this, emu);
rtc = new UPD1990A(this, emu);
+#ifdef USE_DEBUGGER
+ pcm->set_context_debugger(new DEBUGGER(this, emu));
+#endif
cmt = new CMT(this, emu);
keyboard = new KEYBOARD(this, emu);
// pc88pio->set_device_name(_T("8255 PIO (PC-8801)"));
// pc88pio->set_context_event_manager(pc88event);
pc88pcm = new PCM1BIT(this, emu);
+#ifdef USE_DEBUGGER
+ pc88pcm->set_context_debugger(new DEBUGGER(this, emu));
+#endif
// pc88pcm->set_device_name(_T("1-Bit PCM Sound (PC-8801)"));
// pc88pcm->set_context_event_manager(pc88event);
pc88rtc = new UPD1990A(this, emu);
// 4: 44h:OPNA A4h:OPNA PC-8801FH/MH or later + PC-8801-24
// 5: 44h:OPNA A4h:OPN PC-8801FH/MH or later + PC-8801-11
pc88opn1 = new YM2203(this, emu);
+#ifdef USE_DEBUGGER
+ pc88opn1->set_context_debugger(new DEBUGGER(this, emu));
+#endif
// pc88opn1->set_context_event_manager(pc88event);
if(config.sound_type == 0 || config.sound_type == 4 || config.sound_type == 5) {
pc88opn1->is_ym2608 = true;
if(config.sound_type >= 2) {
pc88opn2 = new YM2203(this, emu);
// pc88opn2->set_context_event_manager(pc88event);
+ #ifdef USE_DEBUGGER
+ pc88opn2->set_context_debugger(new DEBUGGER(this, emu));
+ #endif
if(config.sound_type == 2 || config.sound_type == 4) {
pc88opn2->is_ym2608 = true;
pc88opn2->set_device_name(_T("YM2608 OPNA #2"));
// pc88opn1->set_context_event_manager(pc88event);
pc88opn1->is_ym2608 = false;
pc88opn1->set_device_name(_T("YM2203 OPN #1"));
+#ifdef USE_DEBUGGER
+ pc88opn1->set_context_debugger(new DEBUGGER(this, emu));
+#endif
if(config.sound_type == 1) {
pc88opn2 = new YM2203(this, emu);
// pc88opn2->set_context_event_manager(pc88event);
pc88opn2->is_ym2608 = false;
pc88opn2->set_device_name(_T("YM2203 OPN #2"));
+ #ifdef USE_DEBUGGER
+ pc88opn2->set_context_debugger(new DEBUGGER(this, emu));
+ #endif
} else {
pc88opn2 = NULL;
}
// pc88opn2->set_context_event_manager(pc88event);
pc88opn2->is_ym2608 = false;
pc88opn2->set_device_name(_T("YM2203 OPN #2"));
+ #ifdef USE_DEBUGGER
+ pc88opn2->set_context_debugger(new DEBUGGER(this, emu));
+ #endif
} else {
pc88opn2 = NULL;
}
pc88opn1->is_ym2608 = false;
pc88opn1->set_device_name(_T("YM2203 OPN #1"));
#endif
+ #ifdef USE_DEBUGGER
+ pc88opn1->set_context_debugger(new DEBUGGER(this, emu));
+ #endif
#endif
#if defined(SUPPORT_PC88_OPN2)
pc88opn2 = new YM2203(this, emu);
pc88opn2->is_ym2608 = false;
pc88opn2->set_device_name(_T("YM2203 OPN #2"));
#endif
+ #ifdef USE_DEBUGGER
+ pc88opn2->set_context_debugger(new DEBUGGER(this, emu));
+ #endif
#endif
#endif
#ifdef USE_DEBUGGER
// pc88pio_sub->set_context_event_manager(pc88event);
pc88fdc_sub = new UPD765A(this, emu);
pc88fdc_sub->set_device_name(_T("uPD765A FDC (Sub)"));
+#ifdef USE_DEBUGGER
+ pc88fdc_sub->set_context_debugger(new DEBUGGER(this, emu));
+#endif
// pc88fdc_sub->set_context_event_manager(pc88event);
pc88noise_seek = new NOISE(this, emu);
// pc88noise_seek->set_context_event_manager(pc88event);
#else
beep = new PCM1BIT(this, emu);
#endif
+#ifdef USE_DEBUGGER
+ beep->set_context_debugger(new DEBUGGER(this, emu));
+#endif
dma = new I8237(this, emu);
#ifdef USE_DEBUGGER
dma->set_context_debugger(new DEBUGGER(this, emu));
pc88fdc_sub = new UPD765A(this, emu);
pc88fdc_sub->set_device_name(_T("uPD765A FDC (PC-8801 Sub)"));
pc88fdc_sub->set_context_event_manager(pc88event);
+ #ifdef USE_DEBUGGER
+ pc88fdc_sub->set_context_debugger(new DEBUGGER(this, emu));
+ #endif
pc88noise_seek = new NOISE(this, emu);
pc88noise_seek->set_context_event_manager(pc88event);
pc88noise_head_down = new NOISE(this, emu);
dummy->set_device_name(_T("1st Dummy"));
beep = new BEEP(this, emu);
+#ifdef USE_DEBUGGER
+ beep->set_context_debugger(new DEBUGGER(this, emu));
+#endif
sio_rs = new I8251(this, emu); // for rs232c
sio_rs->set_device_name(_T("8251 SIO (RS-232C)"));
sio_kbd = new I8251(this, emu); // for keyboard
dma->set_context_debugger(new DEBUGGER(this, emu));
#endif
fdc = new UPD765A(this, emu);
+#ifdef USE_DEBUGGER
+ fdc->set_context_debugger(new DEBUGGER(this, emu));
+#endif
fdc->set_context_noise_seek(new NOISE(this, emu));
fdc->set_context_noise_head_down(new NOISE(this, emu));
fdc->set_context_noise_head_up(new NOISE(this, emu));
}
}
+bool PCM1BIT::get_debug_regs_info(_TCHAR *buffer, size_t buffer_len)
+{
+ my_stprintf_s(buffer, buffer_len - 1, _T("OUTPUT=%s SIGNAL=%s POSITIVE CLOCK=%d NEGATIVE CLOCK=%d\nLAST VOLUME(L)=%d LAST_VOLUME(R)=%d\Low pass filter=%s FREQ=%d\nHigh pass filter=%s FREQ=%d\n"),
+ (on) ? ((mute) ? _T("ON(MUTE) ") : _T("ON ")) : ((mute) ? _T("OFF(MUTE)") : _T("OFF ")),
+ (signal) ? _T("ON") : _T("OFF"),
+ positive_clocks, negative_clocks,
+ last_vol_l, last_vol_r,
+ (use_lpf) ? _T("ON ") : _T("OFF"), lpf_freq,
+ (use_hpf) ? _T("ON ") : _T("OFF"), hpf_freq
+ );
+ return true;
+}
+
#define STATE_VERSION 4
bool PCM1BIT::process_state(FILEIO* state_fio, bool loading)
void set_volume(int ch, int decibel_l, int decibel_r);
void set_high_pass_filter_freq(int freq, double quality = 1.0);
void set_low_pass_filter_freq(int freq, double quality = 1.0);
+ bool get_debug_regs_info(_TCHAR *buffer, size_t buffer_len);
bool process_state(FILEIO* state_fio, bool loading);
psg = new SN76489AN(this, emu);
vdp = new TMS9918A(this, emu);
#ifdef USE_DEBUGGER
+ psg->set_context_debugger(new DEBUGGER(this, emu));
vdp->set_context_debugger(new DEBUGGER(this, emu));
#endif
cpu = new Z80(this, emu);
psg = new SN76489AN(this, emu);
vdp = new TMS9918A(this, emu);
#ifdef USE_DEBUGGER
+ psg->set_context_debugger(new DEBUGGER(this, emu));
vdp->set_context_debugger(new DEBUGGER(this, emu));
#endif
cpu = new TMS9995(this, emu);
pic = new I8259(this, emu);
io = new IO(this, emu);
pcm = new PCM1BIT(this, emu);
+#ifdef USE_DEBUGGER
+ pcm->set_context_debugger(new DEBUGGER(this, emu));
+#endif
gdc = new UPD7220(this, emu);
fdc = new UPD765A(this, emu);
+#ifdef USE_DEBUGGER
+ fdc->set_context_debugger(new DEBUGGER(this, emu));
+#endif
fdc->set_context_noise_seek(new NOISE(this, emu));
fdc->set_context_noise_head_down(new NOISE(this, emu));
fdc->set_context_noise_head_up(new NOISE(this, emu));
io = new IO(this, emu);
psg = new SN76489AN(this, emu);
cpu = new Z80(this, emu);
+#ifdef USE_DEBUGGER
+ psg->set_context_debugger(new DEBUGGER(this, emu));
+#endif
cmt = new CMT(this, emu);
key = new KEYBOARD(this, emu);
psg = new SN76489AN(this, emu);
vdp = new TMS9918A(this, emu);
#ifdef USE_DEBUGGER
+ psg->set_context_debugger(new DEBUGGER(this, emu));
vdp->set_context_debugger(new DEBUGGER(this, emu));
#endif
fdc = new UPD765A(this, emu);
+#ifdef USE_DEBUGGER
+ fdc->set_context_debugger(new DEBUGGER(this, emu));
+#endif
fdc->set_context_noise_seek(new NOISE(this, emu));
fdc->set_context_noise_head_down(new NOISE(this, emu));
fdc->set_context_noise_head_up(new NOISE(this, emu));
fdc->set_context_noise_seek(new NOISE(this, emu));
fdc->set_context_noise_head_down(new NOISE(this, emu));
fdc->set_context_noise_head_up(new NOISE(this, emu));
+#ifdef USE_DEBUGGER
+ fdc->set_context_debugger(new DEBUGGER(this, emu));
+#endif
#if defined(_SMC70)
rtc = new MSM58321(this, emu);
#endif
pcm = new PCM1BIT(this, emu);
+#ifdef USE_DEBUGGER
+ pcm->set_context_debugger(new DEBUGGER(this, emu));
+#endif
#if defined(_SMC777)
psg = new SN76489AN(this, emu);
+#ifdef USE_DEBUGGER
+ psg->set_context_debugger(new DEBUGGER(this, emu));
+#endif
#endif
cpu = new Z80(this, emu);
diff = (int)(16.0 * (double)clock / (double)rate + 0.5);
}
+bool SN76489AN::get_debug_regs_info(_TCHAR *buffer, size_t buffer_len)
+{
+ _TCHAR tmps1[512] = {0};
+ for(int i = 0; i < 8; i++) {
+ _TCHAR tmps2[16] = {0};
+ my_stprintf_s(tmps2, 15, _T("%04X "));
+ _tcsncat(tmps1, tmps2, sizeof(tmps1) - 1);
+ }
+ _TCHAR tmps3[1024] = {0};
+ for(int i = 0; i < 4; i++) {
+ _TCHAR tmps2[256] = {0};
+ my_stprintf_s(tmps2, sizeof(tmps2) - 1, _T("CH%d: SIGNAL=%s PERIOD=%d COUNT=%d VOLUME=%d\n"),
+ i + 1, (ch[i].signal) ? _T("ON") : _T("OFF"), ch[i].period, ch[i].count, ch[i].volume);
+ _tcsncat(tmps3, tmps2, sizeof(tmps3) - 1);
+ }
+ _TCHAR tmps4[1024] = {0};
+ for(int i = 0; i < 16; i += 4) {
+ _TCHAR tmps2[256] = {0};
+ my_stprintf_s(tmps2, sizeof(tmps2) - 1, _T("VOLUME #%d-#%d: %d %d %d %d\n"),
+ i + 1, i + 4,
+ volume_table[i + 0], volume_table[i + 1], volume_table[i + 2], volume_table[i + 3]);
+ _tcsncat(tmps4, tmps2, sizeof(tmps4) - 1);
+ }
+ my_stprintf_s(buffer, buffer_len - 1,_T("MUTE=%s CS=%s WE=%s INDEX=%d NOISE GEN=%d\nVAL=%02X\n%s%sREGS: +0 +1 +2 +3 +4 +5 +6 +7\n %s\n "),
+ (mute) ? _T("ON") : _T("OFF"),
+ (cs) ? _T("ON") : _T("OFF"),
+ (we) ? _T("ON") : _T("OFF"),
+ index, noise_gen,
+ tmps3, tmps4,
+ tmps1);
+ return true;
+}
+
#define STATE_VERSION 2
bool SN76489AN::process_state(FILEIO* state_fio, bool loading)
void __FASTCALL write_signal(int id, uint32_t data, uint32_t mask);
void mix(int32_t* buffer, int cnt);
void set_volume(int ch, int decibel_l, int decibel_r);
+ bool get_debug_regs_info(_TCHAR *buffer, size_t buffer_len);
bool process_state(FILEIO* state_fio, bool loading);
// unique function
pcm0->set_device_name(_T("1-Bit PCM Sound #1"));
pcm1 = new PCM1BIT(this, emu);
pcm1->set_device_name(_T("1-Bit PCM Sound #2"));
+#ifdef USE_DEBUGGER
+ pcm0->set_context_debugger(new DEBUGGER(this, emu));
+ pcm1->set_context_debugger(new DEBUGGER(this, emu));
+#endif
#if defined(_TK80BS) || defined(_TK80)
cmt = new CMT(this, emu);
cpu->set_context_io(io);
cpu->set_context_intr(io);
#ifdef USE_DEBUGGER
+ beep->set_context_debugger(new DEBUGGER(this, emu));
cpu->set_context_debugger(new DEBUGGER(this, emu));
#endif
memory = new MEMORY(this, emu);
apu = new AM9511(this, emu);
beep = new BEEP(this, emu);
+#ifdef USE_DEBUGGER
+ beep->set_context_debugger(new DEBUGGER(this, emu));
+#endif
fdc = new MB8877(this, emu);
+#ifdef USE_DEBUGGER
+ fdc->set_context_debugger(new DEBUGGER(this, emu));
+#endif
fdc->set_context_noise_seek(new NOISE(this, emu));
fdc->set_context_noise_head_down(new NOISE(this, emu));
fdc->set_context_noise_head_up(new NOISE(this, emu));
clock_const = (uint32_t)((double)chip_clock * 1024.0 * 1024.0 / (double)new_clocks + 0.5);
}
+bool YM2151::write_debug_reg(const _TCHAR *reg, uint32_t data)
+{
+ if((reg[0] == 'R') || (reg[0] == 'r')) {
+ if(strlen(reg) >= 2) {
+ _TCHAR *eptr;
+ int regnum = _tcstol(&(reg[1]), &eptr, 16);
+ if(regnum < 0x100) {
+ set_reg((uint32_t)regnum, data);
+ } else {
+ return false;
+ }
+ return true;
+ }
+ return false;
+ } else if(_tcsicmp(reg, _T("CH")) == 0) {
+ ch = data;
+ return true;
+ }
+ return false;
+}
+// ToDo: Will improve.
+bool YM2151::get_debug_regs_info(_TCHAR *buffer, size_t buffer_len)
+{
+ _TCHAR tmps2[32 * 0x100] = {0};
+ _TCHAR tmps3[16];
+ int rows = 0x100 / 16;
+ for(uint32_t i = 0; i < rows; i++) {
+ memset(tmps3, 0x00, sizeof(tmps3));
+ my_stprintf_s(tmps3, 15, _T("+%02X :"), i * 16);
+ _tcsncat(tmps2, tmps3, sizeof(tmps2) - 1);
+ for(uint32_t j = 0; j < 16; j++) {
+ memset(tmps3, 0x00, sizeof(tmps3));
+ my_stprintf_s(tmps3, 7, _T(" %02X"), port_log[i * 16 + j].data);
+ _tcsncat(tmps2, tmps3, sizeof(tmps2) - 1);
+ }
+ _tcsncat(tmps2, "\n", sizeof(tmps2) - 1);
+ }
+ my_stprintf_s(buffer, buffer_len - 1, _T("CH=%02X IRQ=%s BUSY=%s CHIP_CLOCK=%d\nREG : +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +A +B +C +D +E +F\n%s"),
+ ch, (opm->ReadIRQ()) ? _T("Y") : _T("N"),
+ (busy) ? _T("Y") : _T("N"), chip_clock, tmps2);
+ return true;
+}
+
#define STATE_VERSION 4
bool YM2151::process_state(FILEIO* state_fio, bool loading)
}
return 0;
}
+ bool write_debug_reg(const _TCHAR *reg, uint32_t data);
+ bool get_debug_regs_info(_TCHAR *buffer, size_t buffer_len);
bool process_state(FILEIO* state_fio, bool loading);
// unique functions
_tcsncat(tmps2, tmps3, sizeof(tmps2) - 1);
}
_tcsncat(tmps2, "\n", sizeof(tmps2) - 1);
- }
- my_stprintf_s(buffer, buffer_len - 1, _T("%sCH=%02X FNUM2=%02X CH1=%02X DATA1=%02X FNUM21=%02X\nBUSY=%s CHIP_CLOCK=%d\nREG : +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +A +B +C +D +E +F\n%s"),
+ }
+ bool irqflag;
+ if(is_ym2608) {
+ irqflag = opna->ReadIRQ();
+ } else {
+ irqflag = opn->ReadIRQ();
+ }
+ my_stprintf_s(buffer, buffer_len - 1, _T("%sCH=%02X FNUM2=%02X CH1=%02X DATA1=%02X FNUM21=%02X\nIRQ=%s BUSY=%s CHIP_CLOCK=%d\nREG : +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +A +B +C +D +E +F\n%s"),
tmps, ch, fnum2, ch1, data1, fnum21,
- (busy) ? _T("Y") : _T("N"), chip_clock, tmps2);
+ (irqflag) ? _T("Y") : _T("N"), (busy) ? _T("Y") : _T("N"), chip_clock, tmps2);
return true;
}
cpu->set_context_io(pio);
cpu->set_context_intr(dummy);
#ifdef USE_DEBUGGER
+ pcm->set_context_debugger(new DEBUGGER(this, emu));
cpu->set_context_debugger(new DEBUGGER(this, emu));
#endif