OSDN Git Service

[VM][COMMON_VM][DEBUGGER] Fix FTBFSs with LLVM CLANG.
authorK.Ohta <whatisthis.sowhat@gmail.com>
Sun, 25 Aug 2019 08:30:32 +0000 (17:30 +0900)
committerK.Ohta <whatisthis.sowhat@gmail.com>
Sun, 25 Aug 2019 08:30:32 +0000 (17:30 +0900)
[VM][MC6809] Fix duplicate signal; SIG_CPU_HALT.

source/src/vm/ay_3_891x.cpp
source/src/vm/common_vm/CMakeLists.txt
source/src/vm/debugger.h
source/src/vm/event.cpp
source/src/vm/event.h
source/src/vm/i386.h
source/src/vm/i86.h
source/src/vm/mc6809.h
source/src/vm/scsi_cdrom.cpp
source/src/vm/vm_template.h

index e40d4ac..cfd5939 100644 (file)
@@ -230,7 +230,9 @@ void AY_3_891X::mix(int32_t* buffer, int cnt)
                if((use_lpf) || (use_hpf)) {
                        int32_t* p;
                        int32_t p_h[cnt * 2];
-                       int32_t p_l[cnt * 2] = {0};
+                       int32_t p_l[cnt * 2];
+//                     memset(p_h, 0x00, sizeof(int32_t) * cnt * 2);
+//                     memset(p_l, 0x00, sizeof(int32_t) * cnt * 2);
                        p = p_l;
                        opn->Mix(p, cnt);
                        if(use_lpf) {
index 98a4064..bbd3536 100644 (file)
@@ -1,6 +1,6 @@
 message("* vm/common_vm")
 
-SET(THIS_LIB_VERSION 2.18.3)
+SET(THIS_LIB_VERSION 2.18.4)
 
 #include(cotire)
 set(s_vm_common_vm_srcs
index 517c08e..bf9ac85 100644 (file)
@@ -408,9 +408,9 @@ public:
        {
                d_io = device;
        }
-       void set_context_child(DEBUGGER* device)
+       void set_context_child(DEVICE* device)
        {
-               d_child = device;
+               d_child = (DEBUGGER *)device;
        }
        void check_break_points(uint32_t addr)
        {
index 26246e6..6e06c20 100644 (file)
@@ -255,6 +255,7 @@ void EVENT::reset()
 
 int __FASTCALL EVENT::run_cpu(uint32_t num, int cycles)
 {
+#if defined(USE_SUPRESS_VTABLE)
        if(num < MAX_CPU) {
                uint32_t dom_num = cpu_type[num];
                switch(dom_num) {
@@ -363,11 +364,14 @@ int __FASTCALL EVENT::run_cpu(uint32_t num, int cycles)
                        break;
                }
        }
+#endif 
        if(cycles <= 0) {
                return 1;
        } else {
                return cycles;
        }
+
+   
 }
 
 //#define USE_SUPRESS_VTABLE
@@ -1163,8 +1167,9 @@ int EVENT::get_sound_in_data(int bank, int32_t* dst, int expect_samples, int exp
        if(in_count <= 0) return 0;
 
        int16_t tmpbuf_in[(in_count + 1) * sound_in_channels[bank]];
-       int32_t tmpbuf[(in_count + 1) * expect_channels] = {0};
-
+       int32_t tmpbuf[(in_count + 1) * expect_channels];
+       memset(tmpbuf, 0x00, sizeof(int32_t) * (in_count + 1) * expect_channels);
+       
        int mp = 0;
        for(int i = 0; i < in_count; i++) {
                int tmpr = readptr * sound_in_channels[bank];
@@ -1234,7 +1239,8 @@ int EVENT::get_sound_in_data(int bank, int32_t* dst, int expect_samples, int exp
                int s_count = 0;
                // ToDo: Interpollate
                int n_samples = (int)((double)gave_samples * ((double)expect_rate / (double)sound_in_rate[bank]));
-               int32_t tmpdata[expect_channels] = {0};
+               int32_t tmpdata[expect_channels];
+               memset(tmpdata, 0x00, sizeof(int32_t) * expect_channels);;
                for(int i = 0; i < gave_samples; i++) {
                        for(int ch = 0; ch < expect_channels; ch++) {
                                tmpdata[ch] += p[ch];
index 1d116ed..dd10d94 100644 (file)
@@ -144,6 +144,7 @@ private:
        template <class T>
                void set_cpu_type(T *p, int num)
        {
+#if defined(USE_SUPRESS_VTABLE)
                if((num < 0) || (num >= MAX_CPU)) return;
 #if defined(USE_CPU_HD6301)
                if(typeid(T) == typeid(HD6301)) {
@@ -250,6 +251,7 @@ private:
                {
                        cpu_type[num] = EVENT_CPUTYPE_GENERIC;
                }
+#endif
        }
 public:
        EVENT(VM_TEMPLATE* parent_vm, EMU* parent_emu) : DEVICE(parent_vm, parent_emu)
index 882ac24..91db02a 100644 (file)
@@ -142,7 +142,7 @@ public:
        {
                d_io = device;
        }
-       void set_context_intr(DEVICE* device)
+       void set_context_intr(DEVICE* device, uint32_t bit = 0xffffffff)
        {
                d_pic = device;
        }
index 38639c3..821b670 100644 (file)
@@ -109,7 +109,7 @@ public:
        {
                d_io = device;
        }
-       void set_context_intr(DEVICE* device)
+       void set_context_intr(DEVICE* device, uint32_t bit = 0xffffffff)
        {
                d_pic = device;
        }
index 9ab1d72..8c7f6eb 100644 (file)
@@ -31,7 +31,6 @@ enum {
 };
 
 
-#define SIG_CPU_HALTREQ 0x8000 + SIG_CPU_BUSREQ
 // Note: Below is ugly hack cause of CPU#0 cannot modify clock.
 class VM;
 class EMU;
index 7e6fe0d..141256f 100644 (file)
@@ -955,7 +955,7 @@ bool SCSI_CDROM::open_cue_file(const _TCHAR* file_path)
 
        get_long_full_path_name(file_path, full_path_cue, sizeof(full_path_cue));
        
-       _TCHAR *parent_dir = get_parent_dir(full_path_cue);
+       const _TCHAR *parent_dir = get_parent_dir((const _TCHAR *)full_path_cue);
 
        size_t _arg1_ptr;
        size_t _arg2_ptr;
index 35b6f93..6385295 100644 (file)
@@ -78,17 +78,17 @@ public:
 
        
        // user interface
-       virtual void open_floppy_disk(int drv, _TCHAR *file_path, int bank) { }
-       virtual void open_quick_disk(int drv, _TCHAR *file_path) { }
-       virtual void open_hard_disk(int drv, _TCHAR *file_path) { }
-       virtual void open_compact_disc(int drv, _TCHAR *file_path) { }
-       virtual void open_laser_disc(int drv, _TCHAR *file_path) { }
-       virtual void open_bubble_casette(int drv, _TCHAR *file_path, int bank) { }
-       virtual void open_cart(int drv, _TCHAR *file_path) { }
-       virtual void play_tape(int drv, _TCHAR *file_path) { }
-       virtual void rec_tape(int drv, _TCHAR *file_path) { }
-       virtual void load_binary(int drv, _TCHAR *file_path) { }
-       virtual void save_binary(int drv, _TCHAR *file_path) { }
+       virtual void open_floppy_disk(int drv, const _TCHAR *file_path, int bank) { }
+       virtual void open_quick_disk(int drv, const _TCHAR *file_path) { }
+       virtual void open_hard_disk(int drv, const _TCHAR *file_path) { }
+       virtual void open_compact_disc(int drv, const _TCHAR *file_path) { }
+       virtual void open_laser_disc(int drv, const _TCHAR *file_path) { }
+       virtual void open_bubble_casette(int drv, const _TCHAR *file_path, int bank) { }
+       virtual void open_cart(int drv, const _TCHAR *file_path) { }
+       virtual void play_tape(int drv, const _TCHAR *file_path) { }
+       virtual void rec_tape(int drv, const _TCHAR *file_path) { }
+       virtual void load_binary(int drv, const _TCHAR *file_path) { }
+       virtual void save_binary(int drv, const _TCHAR *file_path) { }
        
        virtual void close_floppy_disk(int drv) { }
        virtual void close_quick_disk(int drv) { }