OSDN Git Service

[VM][I386][OOPS] Fix OOPS.
authorK.Ohta <whatisthis.sowhat@gmail.com>
Thu, 4 Jan 2018 01:29:24 +0000 (10:29 +0900)
committerK.Ohta <whatisthis.sowhat@gmail.com>
Thu, 4 Jan 2018 01:29:24 +0000 (10:29 +0900)
source/src/vm/libcpu_newdev/i386.cpp
source/src/vm/libcpu_newdev/i386_base.cpp
source/src/vm/libcpu_newdev/libcpu_i386/i386_opdef.h
source/src/vm/libcpu_newdev/libcpu_i386/i386_real.cpp
source/src/vm/libcpu_newdev/libcpu_i386/i386_real.h

index c3ad438..b37b1f1 100644 (file)
@@ -187,7 +187,18 @@ bool I386::write_debug_reg(const _TCHAR *reg, uint32_t data)
 
 void I386::get_debug_regs_info(_TCHAR *buffer, size_t buffer_len)
 {
-       cpucore->get_debug_regs_info(buffer, buffer_len);
+       i386_state *cpustate = cpucore->get_cpu_state();
+//#if defined(USE_DEBUGGER)
+       my_stprintf_s(buffer, buffer_len,
+       _T("AX=%04X  BX=%04X CX=%04X DX=%04X SP=%04X  BP=%04X  SI=%04X  DI=%04X\nDS=%04X  ES=%04X SS=%04X CS=%04X IP=%04X  FLAG=[%c%c%c%c%c%c%c%c%c]\nClocks = %llu (%llu) Since Scanline = %d/%d (%d/%d)"),
+         cpustate->sreg[DS].selector, cpustate->sreg[ES].selector, cpustate->sreg[SS].selector, cpustate->sreg[CS].selector, cpustate->eip,
+         cpustate->OF ? _T('O') : _T('-'), cpustate->DF ? _T('D') : _T('-'), cpustate->IF ? _T('I') : _T('-'), cpustate->TF ? _T('T') : _T('-'),
+         cpustate->SF ? _T('S') : _T('-'), cpustate->ZF ? _T('Z') : _T('-'), cpustate->AF ? _T('A') : _T('-'), cpustate->PF ? _T('P') : _T('-'),
+       cpustate->CF ? _T('C') : _T('-'),
+       cpustate->total_cycles, cpustate->total_cycles - cpustate->prev_total_cycles,
+       get_passed_clock_since_vline(), get_cur_vline_clocks(), get_cur_vline(), get_lines_per_frame());
+       cpustate->prev_total_cycles = cpustate->total_cycles;
+//#endif
 }
 
 int I386::debug_dasm(uint32_t pc, _TCHAR *buffer, size_t buffer_len)
index cd1dad2..77af124 100644 (file)
@@ -120,7 +120,7 @@ void I386_BASE::set_context_intr(DEVICE* device)
 
 #include "../../fileio.h"
 
-#define STATE_VERSION  1
+#define STATE_VERSION  2
 
 void I386_BASE::save_state(FILEIO* state_fio)
 {
index 566684f..a5fcbda 100644 (file)
@@ -554,6 +554,7 @@ public:
        void i386_vtlb_free(void);
        void i386_free_state(void);
 
+       i386_state *get_cpu_state(void) { return cpustate; }
        int get_extra_clock() { return cpustate->extra_cycles; }
        void set_extra_clock(int n) { cpustate->extra_cycles += n; }
 
@@ -609,7 +610,7 @@ public:
        }
        
        virtual bool write_debug_reg(const _TCHAR *reg, uint32_t data) { return false; }
-       virtual void get_debug_regs_info(_TCHAR *buffer, size_t buffer_len) {};
+
        virtual int debug_dasm(uint32_t pc, _TCHAR *buffer, size_t buffer_len) { return 0;}
        void vtlb_flush_dynamic(void) { vtlb_flush_dynamic(cpustate->vtlb); }
 
index 173267c..0210ae2 100644 (file)
@@ -770,21 +770,6 @@ bool I386_OPS::write_debug_reg(const _TCHAR *reg, uint32_t data)
        return true;
 }
 
-void I386_OPS::get_debug_regs_info(_TCHAR *buffer, size_t buffer_len)
-{
-#if defined(USE_DEBUGGER)
-       my_stprintf_s(buffer, buffer_len,
-       _T("AX=%04X  BX=%04X CX=%04X DX=%04X SP=%04X  BP=%04X  SI=%04X  DI=%04X\nDS=%04X  ES=%04X SS=%04X CS=%04X IP=%04X  FLAG=[%c%c%c%c%c%c%c%c%c]\nClocks = %llu (%llu) Since Scanline = %d/%d (%d/%d)"),
-         cpustate->sreg[DS].selector, cpustate->sreg[ES].selector, cpustate->sreg[SS].selector, cpustate->sreg[CS].selector, cpustate->eip,
-         cpustate->OF ? _T('O') : _T('-'), cpustate->DF ? _T('D') : _T('-'), cpustate->IF ? _T('I') : _T('-'), cpustate->TF ? _T('T') : _T('-'),
-         cpustate->SF ? _T('S') : _T('-'), cpustate->ZF ? _T('Z') : _T('-'), cpustate->AF ? _T('A') : _T('-'), cpustate->PF ? _T('P') : _T('-'),
-       cpustate->CF ? _T('C') : _T('-'),
-       cpustate->total_cycles, cpustate->total_cycles - cpustate->prev_total_cycles,
-       get_passed_clock_since_vline(), get_cur_vline_clocks(), get_cur_vline(), get_lines_per_frame());
-       cpustate->prev_total_cycles = cpustate->total_cycles;
-#endif
-}
-
 int I386_OPS::debug_dasm(uint32_t pc, _TCHAR *buffer, size_t buffer_len)
 {
 #if defined(USE_DEBUGGER)
index 48faeb8..8c7070b 100644 (file)
@@ -60,7 +60,6 @@ public:
 #endif
        }
        bool write_debug_reg(const _TCHAR *reg, uint32_t data);
-       void get_debug_regs_info(_TCHAR *buffer, size_t buffer_len);
        int debug_dasm(uint32_t pc, _TCHAR *buffer, size_t buffer_len);
 
 protected: