OSDN Git Service

[VM][SN76489AN][YM2151][YM2203] Add write_debug_reg() and get_debug_regs().
authorK.Ohta <whatisthis.sowhat@gmail.com>
Fri, 16 Aug 2019 10:10:23 +0000 (19:10 +0900)
committerK.Ohta <whatisthis.sowhat@gmail.com>
Fri, 16 Aug 2019 10:10:23 +0000 (19:10 +0900)
[VM][BEEP][PCM1BIT] Add get_debug_regs().
[VM] Apply aboves to some VMs.

54 files changed:
source/src/vm/beep.cpp
source/src/vm/beep.h
source/src/vm/bubcom80/bubcom80.cpp
source/src/vm/colecovision/colecovision.cpp
source/src/vm/ex80/ex80.cpp
source/src/vm/fm16beta/fm16beta.cpp
source/src/vm/fm7/fm7.cpp
source/src/vm/fmr30/fmr30.cpp
source/src/vm/fp1100/fp1100.cpp
source/src/vm/gamegear/gamegear.cpp
source/src/vm/gamegear/mastersystem.cpp
source/src/vm/hc20/hc20.cpp
source/src/vm/hc40/hc40.cpp
source/src/vm/hc80/hc80.cpp
source/src/vm/j3100/j3100.cpp
source/src/vm/jr100/jr100.cpp
source/src/vm/jr800/jr800.cpp
source/src/vm/jx/jx.cpp
source/src/vm/m5/m5.cpp
source/src/vm/msx/msx_ex.cpp
source/src/vm/multi8/multi8.cpp
source/src/vm/mycomz80a/mycomz80a.cpp
source/src/vm/mz2500/mz2500.cpp
source/src/vm/mz2500/mz80b.cpp
source/src/vm/mz2800/mz2800.cpp
source/src/vm/mz3500/mz3500.cpp
source/src/vm/mz5500/mz5500.cpp
source/src/vm/mz700/mz700.cpp
source/src/vm/n5200/n5200.cpp
source/src/vm/pasopia/pasopia.cpp
source/src/vm/pasopia7/pasopia7.cpp
source/src/vm/pc100/pc100.cpp
source/src/vm/pc2001/pc2001.cpp
source/src/vm/pc8201/pc8201.cpp
source/src/vm/pc8801/pc8801.cpp
source/src/vm/pc9801/pc9801.cpp
source/src/vm/pc98ha/pc98ha.cpp
source/src/vm/pcm1bit.cpp
source/src/vm/pcm1bit.h
source/src/vm/pv2000/pv2000.cpp
source/src/vm/pyuta/pyuta.cpp
source/src/vm/qc10/qc10.cpp
source/src/vm/rx78/rx78.cpp
source/src/vm/sc3000/sc3000.cpp
source/src/vm/smc777/smc777.cpp
source/src/vm/sn76489an.cpp
source/src/vm/sn76489an.h
source/src/vm/tk80bs/tk80bs.cpp
source/src/vm/x07/x07.cpp
source/src/vm/yis/yis.cpp
source/src/vm/ym2151.cpp
source/src/vm/ym2151.h
source/src/vm/ym2203.cpp
source/src/vm/z80tvgame/z80tvgame.cpp

index fabb2fc..f6a52ca 100644 (file)
@@ -63,6 +63,17 @@ void BEEP::set_frequency(double frequency)
        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)
index ed04f9b..f5239a5 100644 (file)
@@ -46,6 +46,8 @@ public:
        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);
index 1234940..7c245f0 100644 (file)
@@ -57,6 +57,9 @@ VM::VM(EMU* parent_emu) : VM_TEMPLATE(parent_emu)
        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));
@@ -64,6 +67,9 @@ VM::VM(EMU* parent_emu) : VM_TEMPLATE(parent_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);
        
index a474a0a..63dcaff 100644 (file)
@@ -39,6 +39,9 @@ VM::VM(EMU* parent_emu) : VM_TEMPLATE(parent_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));
index f4b65d7..b689ac3 100644 (file)
@@ -47,6 +47,9 @@ VM::VM(EMU* parent_emu) : VM_TEMPLATE(parent_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);
index 7fc68e0..a4a0819 100644 (file)
@@ -72,14 +72,23 @@ VM::VM(EMU* parent_emu) : VM_TEMPLATE(parent_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);
index b5e2079..f691a85 100644 (file)
@@ -154,6 +154,9 @@ VM::VM(EMU* parent_emu): VM_TEMPLATE(parent_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
@@ -200,6 +203,9 @@ VM::VM(EMU* parent_emu): VM_TEMPLATE(parent_emu)
        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;
index 7e25426..53add4d 100644 (file)
@@ -104,6 +104,9 @@ VM::VM(EMU* parent_emu) : VM_TEMPLATE(parent_emu)
                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 {
index 900b424..11100fb 100644 (file)
@@ -50,6 +50,9 @@ VM::VM(EMU* parent_emu) : VM_TEMPLATE(parent_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
        drec = new DATAREC(this, emu);
        drec->set_context_noise_play(new NOISE(this, emu));
        drec->set_context_noise_stop(new NOISE(this, emu));
@@ -59,6 +62,9 @@ VM::VM(EMU* parent_emu) : VM_TEMPLATE(parent_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)"));
index c193262..716ae98 100644 (file)
@@ -57,12 +57,21 @@ VM::VM(EMU* parent_emu) : VM_TEMPLATE(parent_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
        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);
index 4ccadb6..9c75217 100644 (file)
@@ -58,6 +58,9 @@ VM::VM(EMU* parent_emu) : VM_TEMPLATE(parent_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);
@@ -65,6 +68,9 @@ VM::VM(EMU* parent_emu) : VM_TEMPLATE(parent_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);
index 4a9a7cc..1a16b48 100644 (file)
@@ -137,7 +137,10 @@ VM::VM(EMU* parent_emu) : VM_TEMPLATE(parent_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)
index 3342319..8a3e516 100644 (file)
@@ -41,6 +41,9 @@ VM::VM(EMU* parent_emu) : VM_TEMPLATE(parent_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
        drec = new DATAREC(this, emu);
        drec->set_context_noise_play(new NOISE(this, emu));
        drec->set_context_noise_stop(new NOISE(this, emu));
index dad6392..6f3b689 100644 (file)
@@ -40,6 +40,9 @@ VM::VM(EMU* parent_emu) : VM_TEMPLATE(parent_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);
index 996251d..43fd974 100644 (file)
@@ -133,6 +133,8 @@ VM::VM(EMU* parent_emu) : VM_TEMPLATE(parent_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
index a064eb1..e804823 100644 (file)
@@ -80,6 +80,7 @@ VM::VM(EMU* parent_emu) : VM_TEMPLATE(parent_emu)
        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
index fc124c8..e18c9be 100644 (file)
@@ -72,6 +72,7 @@ VM::VM(EMU* parent_emu) : VM_TEMPLATE(parent_emu)
        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
index 94b2509..2685ba8 100644 (file)
@@ -95,6 +95,8 @@ VM::VM(EMU* parent_emu) : VM_TEMPLATE(parent_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));
+       psg->set_context_debugger(new DEBUGGER(this, emu));
 #endif
        
        crtc->set_context_disp(display, SIG_DISPLAY_ENABLE, 1);
index d37efc7..acffcb0 100644 (file)
@@ -53,6 +53,7 @@ VM::VM(EMU* parent_emu) : VM_TEMPLATE(parent_emu)
        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);
index 4d42e7b..0f8674c 100644 (file)
@@ -163,6 +163,9 @@ VM::VM(EMU* parent_emu) : VM_TEMPLATE(parent_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);
index 3745017..a105ef8 100644 (file)
@@ -69,6 +69,8 @@ VM::VM(EMU* parent_emu) : VM_TEMPLATE(parent_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);
index 7b4304f..0dcfad0 100644 (file)
@@ -139,6 +139,7 @@ VM::VM(EMU* parent_emu) : VM_TEMPLATE(parent_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
index edb6bfd..34ac4d0 100644 (file)
@@ -94,7 +94,13 @@ VM::VM(EMU* parent_emu) : VM_TEMPLATE(parent_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
        rtc = new RP5C01(this, emu);    // RP-5C15
        sasi_host = new SCSI_HOST(this, emu);
        sasi_hdd = new SASI_HDD(this, emu);
index b8d6392..d1d6536 100644 (file)
@@ -88,7 +88,13 @@ VM::VM(EMU* parent_emu) : VM_TEMPLATE(parent_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)"));
index 1f88713..88c7a08 100644 (file)
@@ -83,10 +83,16 @@ VM::VM(EMU* parent_emu) : VM_TEMPLATE(parent_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
        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++) {
index aa7bb49..8abe0a8 100644 (file)
@@ -58,6 +58,9 @@ VM::VM(EMU* parent_emu) : VM_TEMPLATE(parent_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
        maincpu = new Z80(this, emu);
        mainbus= new MAIN(this, emu);
        mainio->set_device_name(_T("I/O Bus (Main)"));
@@ -96,6 +99,9 @@ VM::VM(EMU* parent_emu) : VM_TEMPLATE(parent_emu)
        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)"));
index 5298520..56dafea 100644 (file)
@@ -102,6 +102,9 @@ VM::VM(EMU* parent_emu) : VM_TEMPLATE(parent_emu)
        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));
index 4d29643..079c0c2 100644 (file)
@@ -323,8 +323,15 @@ VM::VM(EMU* parent_emu) : VM_TEMPLATE(parent_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
index 402a56c..6e57dde 100644 (file)
@@ -54,6 +54,9 @@ VM::VM(EMU* parent_emu) : VM_TEMPLATE(parent_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
        cpu = new I386(this, emu);
        dma = new I8237(this, emu);
 #ifdef USE_DEBUGGER
@@ -79,6 +82,9 @@ VM::VM(EMU* parent_emu) : VM_TEMPLATE(parent_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
        
        display = new DISPLAY(this, emu);
        floppy = new FLOPPY(this, emu);
index 195c9e9..9586633 100644 (file)
@@ -72,7 +72,13 @@ VM::VM(EMU* parent_emu) : VM_TEMPLATE(parent_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));
index e261d09..e87dba3 100644 (file)
@@ -77,10 +77,18 @@ VM::VM(EMU* parent_emu) : VM_TEMPLATE(parent_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);
index 36764c1..2668d19 100644 (file)
@@ -51,6 +51,9 @@ VM::VM(EMU* parent_emu) : VM_TEMPLATE(parent_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)"));
@@ -63,6 +66,9 @@ VM::VM(EMU* parent_emu) : VM_TEMPLATE(parent_emu)
        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));
index 5e7591d..48a210e 100644 (file)
@@ -46,6 +46,9 @@ VM::VM(EMU* parent_emu) : VM_TEMPLATE(parent_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);
index a605261..3bf26b0 100644 (file)
@@ -54,6 +54,9 @@ VM::VM(EMU* parent_emu) : VM_TEMPLATE(parent_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);
index 98cfff3..df1cacc 100644 (file)
@@ -102,6 +102,9 @@ VM::VM(EMU* parent_emu) : VM_TEMPLATE(parent_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);
@@ -116,6 +119,9 @@ VM::VM(EMU* parent_emu) : VM_TEMPLATE(parent_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;
@@ -127,6 +133,9 @@ VM::VM(EMU* parent_emu) : VM_TEMPLATE(parent_emu)
        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"));
@@ -145,11 +154,17 @@ VM::VM(EMU* parent_emu) : VM_TEMPLATE(parent_emu)
 //     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;
        }
@@ -161,6 +176,9 @@ VM::VM(EMU* parent_emu) : VM_TEMPLATE(parent_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;
        }
@@ -175,6 +193,9 @@ VM::VM(EMU* parent_emu) : VM_TEMPLATE(parent_emu)
                        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);
@@ -186,6 +207,9 @@ VM::VM(EMU* parent_emu) : VM_TEMPLATE(parent_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
@@ -220,6 +244,9 @@ VM::VM(EMU* parent_emu) : VM_TEMPLATE(parent_emu)
 //     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);
index 08aaa89..1fb9848 100644 (file)
@@ -167,6 +167,9 @@ VM::VM(EMU* parent_emu) : VM_TEMPLATE(parent_emu)
 #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));
@@ -962,6 +965,9 @@ VM::VM(EMU* parent_emu) : VM_TEMPLATE(parent_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);
index 020649b..6b005a5 100644 (file)
@@ -69,6 +69,9 @@ VM::VM(EMU* parent_emu) : VM_TEMPLATE(parent_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
@@ -98,6 +101,9 @@ VM::VM(EMU* parent_emu) : VM_TEMPLATE(parent_emu)
        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));
index f494cfb..66da3cd 100644 (file)
@@ -273,6 +273,19 @@ void PCM1BIT::initialize_sound(int rate, int volume)
        }
 }
 
+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)
index c20cc4b..d497e3e 100644 (file)
@@ -64,6 +64,7 @@ public:
        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);
        
index 9cfc00a..8a0aabf 100644 (file)
@@ -47,6 +47,7 @@ VM::VM(EMU* parent_emu) : VM_TEMPLATE(parent_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 Z80(this, emu);
index 0e6fd23..3f2ac86 100644 (file)
@@ -44,6 +44,7 @@ VM::VM(EMU* parent_emu) : VM_TEMPLATE(parent_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);
index 3802fac..51a3ba2 100644 (file)
@@ -73,8 +73,14 @@ VM::VM(EMU* parent_emu) : VM_TEMPLATE(parent_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));
index 704cc3b..fcc4faa 100644 (file)
@@ -53,6 +53,9 @@ VM::VM(EMU* parent_emu) : VM_TEMPLATE(parent_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);
index 9662176..6f9a99c 100644 (file)
@@ -58,9 +58,13 @@ VM::VM(EMU* parent_emu) : VM_TEMPLATE(parent_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));
index 716ef50..8e6edf4 100644 (file)
@@ -56,12 +56,21 @@ VM::VM(EMU* parent_emu) : VM_TEMPLATE(parent_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);
 
index f050352..db6ea74 100644 (file)
@@ -198,6 +198,39 @@ void SN76489AN::initialize_sound(int rate, int clock, int volume)
        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)
index 0bd5250..57ec616 100644 (file)
@@ -62,6 +62,7 @@ public:
        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
index 96b5a0b..426a7ca 100644 (file)
@@ -84,6 +84,10 @@ VM::VM(EMU* parent_emu) : VM_TEMPLATE(parent_emu)
        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);
index 085e563..5db5814 100644 (file)
@@ -69,6 +69,7 @@ VM::VM(EMU* parent_emu) : VM_TEMPLATE(parent_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
        
index aabef66..ceaa751 100644 (file)
@@ -58,7 +58,13 @@ VM::VM(EMU* parent_emu) : VM_TEMPLATE(parent_emu)
        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));
index 174eaf1..ed5a4fd 100644 (file)
@@ -259,6 +259,49 @@ void YM2151::update_timing(int new_clocks, double new_frames_per_sec, int new_li
        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)
index 5510c42..6455c7c 100644 (file)
@@ -109,6 +109,8 @@ public:
                }
                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
index 6815d4c..addaa43 100644 (file)
@@ -729,10 +729,16 @@ bool YM2203::get_debug_regs_info(_TCHAR *buffer, size_t buffer_len)
                        _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;
 }
 
index 64241dd..76f1e07 100644 (file)
@@ -73,6 +73,7 @@ VM::VM(EMU* parent_emu) : VM_TEMPLATE(parent_emu)
        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