set(WITH_MOUSE ON)
set(VMFILES
-# i286.cpp
+ i286.cpp
i8237.cpp
mz1p17.cpp
if(BUILD_MZ5500)
add_definitions(-D_MZ5500)
set(EXEC_TARGET emumz5500)
- set(FLAG_USE_I86 ON)
+ set(FLAG_USE_I86 OFF)
set(RESOURCE ${CMAKE_SOURCE_DIR}/../../src/qt/common/qrc/mz5500.qrc)
elseif(BUILD_MZ6500)
add_definitions(-D_MZ6500)
set(EXEC_TARGET emumz6500)
- set(FLAG_USE_I86 ON)
+ set(FLAG_USE_I86 OFF)
set(RESOURCE ${CMAKE_SOURCE_DIR}/../../src/qt/common/qrc/mz6500.qrc)
else()
add_definitions(-D_MZ6550)
set(WITH_MOUSE ON)
set(VMFILES
+ i286.cpp
event.cpp
io.cpp
memory.cpp
set(VMFILES_LIB ${VMFILES_LIB}
upd4991a.cpp
)
- set(FLAG_USE_I86 ON)
+ set(FLAG_USE_I86 OFF)
set(RESOURCE ${CMAKE_SOURCE_DIR}/../../src/qt/common/qrc/pc98ha.qrc)
elseif(BUILD_PC98LT)
add_definitions(-D_PC98LT)
set(VMFILES ${VMFILES}
upd1990a.cpp
)
- set(FLAG_USE_I86 ON)
+ set(FLAG_USE_I86 OFF)
set(RESOURCE ${CMAKE_SOURCE_DIR}/../../src/qt/common/qrc/pc98lt.qrc)
endif()
set(WITH_MOUSE ON)
set(VMFILES
-# i286.cpp
+ i286.cpp
msm58321.cpp
event.cpp
io.cpp
ym2203.cpp
)
-set(FLAG_USE_I86 ON)
+#set(FLAG_USE_I86 ON)
set(BUILD_SHARED_LIBS OFF)
set(USE_OPENMP ON CACHE BOOL "Build using OpenMP")
set(USE_OPENGL ON CACHE BOOL "Build using OpenGL")
set(BUILD_FMR30_286 ON CACHE BOOL "Build for FM-R30, i286 version")
if(BUILD_FMR30_86)
set(EXEC_TARGET emufmr30_i86)
- set(FLAG_USE_I86 ON)
+ set(FLAG_USE_I86 OFF)
+ set(VMFILES ${VMFILES}
+ i286.cpp
+ )
add_definitions(-DHAS_I86)
elseif(BUILD_FMR30_286)
set(EXEC_TARGET emufmr30_i286)
set(BUILD_FMR30_286 OFF CACHE BOOL "Build for FM-R30, i286 version")
if(BUILD_FMR30_86)
set(EXEC_TARGET emufmr30_i86)
- set(FLAG_USE_I86 ON)
+ set(FLAG_USE_I86 OFF)
+ set(VMFILES ${VMFILES}
+ i286.cpp
+ )
add_definitions(-DHAS_I86)
elseif(BUILD_FMR30_286)
set(EXEC_TARGET emufmr30_i286)
set(WITH_MOUSE ON)
set(VMFILES
-# i286.cpp
+ i286.cpp
msm58321.cpp
memory.cpp
upd765a.cpp
disk.cpp
)
-set(FLAG_USE_I86 ON)
+set(FLAG_USE_I86 OFF)
set(BUILD_SHARED_LIBS OFF)
set(USE_OPENMP ON CACHE BOOL "Build using OpenMP")
+11/28/2017
+
+[EMU/DEBUGGER] fix ut command to show correct range of cpu trace
+
+[VM/DEVICE] rename bios_call_i86() to bios_call_far_i86()
+[VM/HUC6280] support to show total cpu clocks in debugger
+[VM/HUC6280] support cpu trace
+[VM/I286] support to show total cpu clocks in debugger
+[VM/I286] support cpu trace
+[VM/I386] support to show total cpu clocks in debugger
+[VM/I386] support cpu trace
+[VM/M6502] support to show total cpu clocks in debugger
+[VM/M6502] support cpu trace
+[VM/MC6800] support to show total cpu clocks in debugger
+[VM/MC6800] support cpu trace
+[VM/MC6800] fix issue that can not break at instruction following tap/cli/sei
+[VM/MC6809] support to show total cpu clocks in debugger
+[VM/MC6809] support cpu trace
+[VM/MCS48] fix to add clocks for interrupt to total cpu clocks
+[VM/TMS9995] support to show total cpu clocks in debugger
+[VM/TMS9995] support cpu trace
+[VM/UPD7801] support to show total cpu clocks in debugger
+[VM/UPD7801] support cpu trace
+[VM/UPD7810] support to show total cpu clocks in debugger
+[VM/UPD7810] support cpu trace
+[VM/Z80] fix to add clocks for interrupt to total cpu clocks
+
+
+11/26/2017
+
+[PC8801MA] fix text attribute when dma underrun occurs
+
+
11/25/2017
[EMU/DEBUGGER] support command history
-<B><FONT SIZE=-1>Upstream 2017-11-25<BR>
-Qt Port and FM7 series 2017-10-18<BR>
+<B><FONT SIZE=-1>Upstream 2017-11-28<BR>
+Qt Port and FM7 series 2017-12-03(TMP)<BR>
</FONT></B>
if(num >= 2) {
steps = min(my_hexatoi(debugger->first_symbol, params[1]), (uint32_t)MAX_CPU_TRACE);
}
- for(int i = 0; i < steps; i++) {
+ for(int i = MAX_CPU_TRACE - steps; i < MAX_CPU_TRACE; i++) {
int index = (debugger->cpu_trace_ptr + i) & (MAX_CPU_TRACE - 1);
if(!(debugger->cpu_trace[index] & ~prog_addr_mask)) {
const _TCHAR *name = get_symbol(debugger->first_symbol, debugger->cpu_trace[index] & prog_addr_mask);
<body>
<h1>Common Source Code Project</h1>
<DIV ALIGN=RIGHT><FONT SIZE=2>
-Upstream Version: 2017-11-25<BR>
-Qt Port and FM7 series 2017-10-18<BR>
+Upstream Version: 2017-11-28<BR>
+Qt Port and FM7 series 2017-12-03(TMP)<BR>
libCSPavio 2.6.10<BR>
libCSPgui 2.10.4<BR>
-libCSPosd 2.9.10<BR>
+libCSPosd 2.9.11<BR>
libCSPemu_utils 2.6.1<BR>
-libCSPcommon_vm 1.1.18<BR>
+libCSPcommon_vm 1.1.20<BR>
libCSPfmgen 1.1.0<BR>
FFMPEG 3.2.2 + liblame 3.99 + libx264-152<BR>
Build Version: <BR>
</FONT>
<hr>
<address></address>
-<!-- hhmts start -->Last modified: Wed 18, Oct 2017 16:49:12<!-- hhmts end -->
+<!-- hhmts start -->Last modified: Sun 03, Dec 2017 16:35:35<!-- hhmts end -->
</body> </html>
MENUITEM "Stop", ID_AUTOKEY_STOP
MENUITEM "Romaji to Kana", ID_ROMAJI_TO_KANA
MENUITEM SEPARATOR
+ MENUITEM "Debug Main CPU", ID_OPEN_DEBUGGER0
+ MENUITEM "Close Debugger", ID_CLOSE_DEBUGGER
+ MENUITEM SEPARATOR
MENUITEM "Exit", ID_EXIT
END
POPUP "FD1"
MENUITEM "Stop", ID_AUTOKEY_STOP
MENUITEM "Romaji to Kana", ID_ROMAJI_TO_KANA
MENUITEM SEPARATOR
+ MENUITEM "Debug Main CPU", ID_OPEN_DEBUGGER0
+ MENUITEM "Close Debugger", ID_CLOSE_DEBUGGER
+ MENUITEM SEPARATOR
MENUITEM "Exit", ID_EXIT
END
POPUP "FD1"
message("* vm/common_vm")
-SET(THIS_LIB_VERSION 1.1.19)
+SET(THIS_LIB_VERSION 1.1.20)
set(s_vm_common_vm_srcs
../315-5124.cpp
../am9511.cpp
../z80pio.cpp
../z80sio.cpp
- ../libcpu_newdev/i86_base.cpp
+# ../libcpu_newdev/i86_base.cpp
../libcpu_newdev/libcpu_i386/i386_opdef.cpp
../libcpu_newdev/libcpu_i386/i386_base_ext.cpp
}
// bios
- virtual bool bios_call_i86(uint32_t PC, uint16_t regs[], uint16_t sregs[], int32_t* ZeroFlag, int32_t* CarryFlag)
+ virtual bool bios_call_far_i86(uint32_t PC, uint16_t regs[], uint16_t sregs[], int32_t* ZeroFlag, int32_t* CarryFlag)
{
return false;
}
class I8253;
class I8255;
class I8259;
-class I86;
+class I286;
class IO;
class MB8877;
class MEMORY;
I8253* pit;
I8255* pio;
I8259* pic;
- I86* cpu;
+ I286* cpu;
IO* io;
MB8877* fdc;
MEMORY* memory;
#include "../i8251.h"
#include "../i8253.h"
#include "../i8259.h"
-#if defined(HAS_I86)
-#include "../i86.h"
-#else
+//#if defined(HAS_I86)
+//#include "../i86.h"
+//#else
#include "../i286.h"
-#endif
+//#endif
#include "../io.h"
#include "../mb8877.h"
#include "../noise.h"
sio_ch2->set_device_name(_T("8251 SIO (RS-232C #2)"));
pit = new I8253(this, emu);
pic = new I8259(this, emu);
-#if defined(HAS_I86)
- cpu = new I86(this, emu);
-#else
+//#if defined(HAS_I86)
+// cpu = new I86(this, emu);
+//#else
cpu = new I286(this, emu);
-#endif
+//#endif
io = new IO(this, emu);
fdc = new MB8877(this, emu);
fdc->set_context_noise_seek(new NOISE(this, emu));
class I8251;
class I8253;
class I8259;
-#if defined(HAS_I86)
-class I86;
-#else
+//#if defined(HAS_I86)
+//class I86;
+//#else
class I286;
-#endif
+//#endif
class IO;
class MB8877;
class SCSI_HDD;
I8251* sio_ch2;
I8253* pit;
I8259* pic;
-#if defined(HAS_I86)
- I86* cpu;
-#else
+//#if defined(HAS_I86)
+// I86* cpu;
+//#else
I286* cpu;
-#endif
+//#endif
IO* io;
MB8877* fdc;
SCSI_HDD* scsi_hdd[7];
timeout++;
}
-bool BIOS::bios_call_i86(uint32_t PC, uint16_t regs[], uint16_t sregs[], int32_t* ZeroFlag, int32_t* CarryFlag)
+bool BIOS::bios_call_far_i86(uint32_t PC, uint16_t regs[], uint16_t sregs[], int32_t* ZeroFlag, int32_t* CarryFlag)
{
uint8_t *regs8 = (uint8_t *)regs;
int drv = AL & 0xf;
if(intnum == 0x93) {
// disk bios
- return bios_call_i86(0xfffc4, regs, sregs, ZeroFlag, CarryFlag);
+ return bios_call_far_i86(0xfffc4, regs, sregs, ZeroFlag, CarryFlag);
}
return false;
}
void initialize();
void reset();
void event_frame();
- bool bios_call_i86(uint32_t PC, uint16_t regs[], uint16_t sregs[], int32_t* ZeroFlag, int32_t* CarryFlag);
+ bool bios_call_far_i86(uint32_t PC, uint16_t regs[], uint16_t sregs[], int32_t* ZeroFlag, int32_t* CarryFlag);
bool bios_int_i86(int intnum, uint16_t regs[], uint16_t sregs[], int32_t* ZeroFlag, int32_t* CarryFlag);
uint32_t read_signal(int ch);
void save_state(FILEIO* state_fio);
return 0;
}
-#define STATE_VERSION 1
+#define STATE_VERSION 2
void HD6301::save_state(FILEIO* state_fio)
{
state_fio->FputUint8(cc);
state_fio->FputInt32(wai_state);
state_fio->FputInt32(int_state);
+ if(__USE_DEBUGGER) state_fio->FputUint64(total_icount);
state_fio->FputInt32(icount);
//#if defined(HAS_MC6801) || defined(HAS_HD6301)
for(int i = 0; i < 4; i++) {
cc = state_fio->FgetUint8();
wai_state = state_fio->FgetInt32();
int_state = state_fio->FgetInt32();
+ if(__USE_DEBUGGER) { total_icount = prev_total_icount = state_fio->FgetUint64(); }
icount = state_fio->FgetInt32();
//#if defined(HAS_MC6801) || defined(HAS_HD6301)
for(int i = 0; i < 4; i++) {
if(clock == -1) {
if(busreq) {
// don't run cpu!
+#ifdef USE_DEBUGGER
+ total_icount += 1;
+#endif
return 1;
} else {
// run only one opcode
-#ifdef USE_DEBUGGER
- return exec_call_debug();
-#else
- return exec_call();
-#endif
+ return run_one_opecode();
}
} else {
icount += clock;
// run cpu while given clocks
while(icount > 0 && !busreq) {
-#ifdef USE_DEBUGGER
- icount -= exec_call_debug();
-#else
- icount -= exec_call();
-#endif
+ icount -= run_one_opecode();
}
// if busreq is raised, spin cpu while remained clock
if(icount > 0 && busreq) {
+#ifdef USE_DEBUGGER
+ total_icount += icount;
+#endif
icount = 0;
}
return first_icount - icount;
}
}
-#define STATE_VERSION 4
+int HUC6280::run_one_opecode()
+{
+ h6280_Regs *cpustate = (h6280_Regs *)opaque;
+#ifdef USE_DEBUGGER
+ d_debugger->add_cpu_trace(cpustate->pc.w.l);
+#endif
+ int passed_icount = CPU_EXECUTE_CALL(h6280);
+#ifdef USE_DEBUGGER
+ total_icount += passed_icount;
+#endif
+ return passed_icount;
+}
+
+#define STATE_VERSION 5
void HUC6280::save_state(FILEIO* state_fio)
{
state_fio->FputUint32(STATE_VERSION);
state_fio->FputInt32(this_device_id);
- //state_fio->Fwrite(opaque, sizeof(h6280_Regs), 1);
+
save_state_registers(state_fio);
+#ifdef USE_DEBUGGER
+ state_fio->FputUint64(total_icount);
+#endif
state_fio->FputInt32(icount);
state_fio->FputBool(busreq);
}
if(state_fio->FgetInt32() != this_device_id) {
return false;
}
- //state_fio->Fread(opaque, sizeof(h6280_Regs), 1);
+#ifdef USE_DEBUGGER
+ total_icount = prev_total_icount = state_fio->FgetUint64();
+#endif
load_state_registers(state_fio);
icount = state_fio->FgetInt32();
busreq = state_fio->FgetBool();
bool busreq;
int exec_call(void);
int exec_call_debug(void);
+ uint64_t total_icount;
+ uint64_t prev_total_icount;
+
+ virtual int run_one_opecode();
public:
HUC6280_BASE(VM* parent_vm, EMU* parent_emu) : DEVICE(parent_vm, parent_emu) {
+ total_icount = prev_total_icount = 0;
set_device_name(_T("HuC6280 CPU"));
}
~HUC6280_BASE() {}
class HUC6280 : public HUC6280_BASE
{
private:
-
+protected:
+ int run_one_opecode() override;
public:
HUC6280(VM* parent_vm, EMU* parent_emu) : HUC6280_BASE(parent_vm, parent_emu) {
set_device_name(_T("HuC6280 CPU"));
return 0;
}
-int HUC6280_BASE::exec_call(void)
+int HUC6280_BASE::run_one_opecode()
{
h6280_Regs *cpustate = (h6280_Regs *)opaque;
- return CPU_EXECUTE_CALL(h6280);
+ int passed_icount = CPU_EXECUTE_CALL(h6280);
+ return passed_icount;
}
-int HUC6280_BASE::exec_call_debug(void)
-{
- h6280_Regs *cpustate = (h6280_Regs *)opaque;
- return CPU_EXECUTE_CALL(h6280_debug);
-}
void HUC6280_BASE::write_signal(int id, uint32_t data, uint32_t mask)
{
{
h6280_Regs *cpustate = (h6280_Regs *)opaque;
my_stprintf_s(buffer, buffer_len,
- _T("PC = %04X SP = %04X ZP = %04X EA = %04X A = %02X X = %02X Y = %02X P = %02X"),
- cpustate->pc.w.l, cpustate->sp.w.l, cpustate->zp.w.l, cpustate->ea.w.l, cpustate->a, cpustate->x, cpustate->y, cpustate->p);
+ _T("PC = %04X SP = %04X ZP = %04X EA = %04X A = %02X X = %02X Y = %02X P = %02X\nTotal CPU Clocks = %llu (%llu)"),
+ cpustate->pc.w.l, cpustate->sp.w.l, cpustate->zp.w.l, cpustate->ea.w.l, cpustate->a, cpustate->x, cpustate->y, cpustate->p,
+ total_icount, total_icount - prev_total_icount);
+ prev_total_icount = total_icount;
}
// disassembler
{
cpu_state *cpustate = (cpu_state *)opaque;
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]"),
+ _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]\nTotal CPU Clocks = %llu (%llu)"),
cpustate->regs.w[AX], cpustate->regs.w[BX], cpustate->regs.w[CX], cpustate->regs.w[DX], cpustate->regs.w[SP], cpustate->regs.w[BP], cpustate->regs.w[SI], cpustate->regs.w[DI],
cpustate->sregs[DS], cpustate->sregs[ES], cpustate->sregs[SS], cpustate->sregs[CS], cpustate->pc - cpustate->base[CS],
OF ? _T('O') : _T('-'), DF ? _T('D') : _T('-'), cpustate->IF ? _T('I') : _T('-'), cpustate->TF ? _T('T') : _T('-'),
- SF ? _T('S') : _T('-'), ZF ? _T('Z') : _T('-'), AF ? _T('A') : _T('-'), PF ? _T('P') : _T('-'), CF ? _T('C') : _T('-'));
+ SF ? _T('S') : _T('-'), ZF ? _T('Z') : _T('-'), AF ? _T('A') : _T('-'), PF ? _T('P') : _T('-'), CF ? _T('C') : _T('-'),
+ cpustate->total_icount, cpustate->total_icount - cpustate->prev_total_icount);
+ cpustate->prev_total_icount = cpustate->total_icount;
}
int I286::debug_dasm(uint32_t pc, _TCHAR *buffer, size_t buffer_len)
}
-#define STATE_VERSION 3
+#define STATE_VERSION 4
void I286::save_state(FILEIO* state_fio)
{
REG16(AX) = regs[0]; REG16(CX) = regs[1]; REG16(DX) = regs[2]; REG16(BX) = regs[3]; \
REG16(SP) = regs[4]; REG16(BP) = regs[5]; REG16(SI) = regs[6]; REG16(DI) = regs[7]; \
cpustate->ZF = (UINT8)ZeroFlag; cpustate->CF = (UINT8)CarryFlag; \
+ CYCLES(cpustate,CYCLES_IRET); \
return; \
} \
}
-#define BIOS_CALL(address) if(cpustate->bios != NULL) { \
+#define BIOS_CALL_FAR(address) if(cpustate->bios != NULL) { \
uint16_t regs[8], sregs[4]; \
regs[0] = REG16(AX); regs[1] = REG16(CX); regs[2] = REG16(DX); regs[3] = REG16(BX); \
regs[4] = REG16(SP); regs[5] = REG16(BP); regs[6] = REG16(SI); regs[7] = REG16(DI); \
sregs[0] = cpustate->sreg[ES].selector; sregs[1] = cpustate->sreg[CS].selector; \
sregs[2] = cpustate->sreg[SS].selector; sregs[3] = cpustate->sreg[DS].selector; \
int32_t ZeroFlag = cpustate->ZF, CarryFlag = cpustate->CF; \
- if(cpustate->bios->bios_call_i86(address, regs, sregs, &ZeroFlag, &CarryFlag)) { \
+ if(cpustate->bios->bios_call_far_i86(address, regs, sregs, &ZeroFlag, &CarryFlag)) { \
REG16(AX) = regs[0]; REG16(CX) = regs[1]; REG16(DX) = regs[2]; REG16(BX) = regs[3]; \
REG16(SP) = regs[4]; REG16(BP) = regs[5]; REG16(SI) = regs[6]; REG16(DI) = regs[7]; \
cpustate->ZF = (UINT8)ZeroFlag; cpustate->CF = (UINT8)CarryFlag; \
+ CYCLES(cpustate,CYCLES_RET_INTERSEG); \
return; \
} \
}
{
i386_state *cpustate = (i386_state *)opaque;
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]"),
+ _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]\nTotal CPU Clocks = %llu (%llu)"),
REG16(AX), REG16(BX), REG16(CX), REG16(DX), REG16(SP), REG16(BP), REG16(SI), REG16(DI),
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->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);
+ cpustate->prev_total_cycles = cpustate->total_cycles;
}
int I386::debug_dasm(uint32_t pc, _TCHAR *buffer, size_t buffer_len)
return cpustate->shutdown;
}
-#define STATE_VERSION 1
+#define STATE_VERSION 2
void I386::save_state(FILEIO* state_fio)
{
if(clock == -1) {
if(BUSREQ) {
// don't run cpu!
+#ifdef USE_DEBUGGER
+ total_count += 1;
+#endif
return 1;
} else {
// run only one opcode
}
// if busreq is raised, spin cpu while remained clock
if(count > 0 && BUSREQ) {
+#ifdef USE_DEBUGGER
+ total_count += count;
+#endif
count = 0;
}
return first_count - count;
}
afterHALT = afterEI = false;
+ d_debugger->add_cpu_trace(PC);
+ int first_count = count;
OP(FETCHOP());
+ total_count += first_count - count;
if(!afterEI) {
check_interrupt();
}
} else {
#endif
afterHALT = afterEI = false;
+#ifdef USE_DEBUGGER
+ d_debugger->add_cpu_trace(PC);
+ int first_count = count;
+#endif
OP(FETCHOP());
+#ifdef USE_DEBUGGER
+ total_count += first_count - count;
+#endif
if(!afterEI) {
check_interrupt();
}
}
afterHALT = false;
+ d_debugger->add_cpu_trace(PC);
+ int first_count = count;
OP(FETCHOP());
+ total_count += first_count - count;
d_pic->notify_intr_ei();
check_interrupt();
} else {
#endif
afterHALT = false;
+#ifdef USE_DEBUGGER
+ d_debugger->add_cpu_trace(PC);
+ int first_count = count;
+#endif
OP(FETCHOP());
+#ifdef USE_DEBUGGER
+ total_count += first_count - count;
+#endif
d_pic->notify_intr_ei();
check_interrupt();
#ifdef USE_DEBUGGER
void I8080::check_interrupt()
{
+#ifdef USE_DEBUGGER
+ int first_count = count;
+#endif
// check interrupt
if(IM & IM_REQ) {
if(IM & IM_NMI) {
}
}
}
+#ifdef USE_DEBUGGER
+ total_count += first_count - count;
+#endif
}
-#define STATE_VERSION 1
+#define STATE_VERSION 2
void I8080::save_state(FILEIO* state_fio)
{
state_fio->FputUint32(STATE_VERSION);
state_fio->FputInt32(this_device_id);
+#ifdef USE_DEBUGGER
+ state_fio->FputUint64(total_count);
+#endif
state_fio->FputInt32(count);
state_fio->Fwrite(regs, sizeof(regs), 1);
state_fio->FputUint16(SP);
if(state_fio->FgetInt32() != this_device_id) {
return false;
}
+#ifdef USE_DEBUGGER
+ total_count = prev_total_count = state_fio->FgetUint64();
+#endif
count = state_fio->FgetInt32();
state_fio->Fread(regs, sizeof(regs), 1);
SP = state_fio->FgetUint16();
/*
F = [--------] A = 00 BC = 0000 DE = 0000 HL = 0000 SP = 0000 PC = 0000
IM= [--------] (BC)= 0000 (DE)= 0000 (HL)= 0000 (SP)= 0000
+Total CPU Clocks = 0 (0)
*/
int wait;
my_stprintf_s(buffer, buffer_len,
- _T("F = [%c%c%c%c%c%c%c%c] A = %02X BC = %04X DE = %04X HL = %04X SP = %04X PC = %04X\nIM= [%c%c%c%c%c%c%c%c] (BC)= %04X (DE)= %04X (HL)= %04X (SP)= %04X"),
- (_F & CF) ? _T('C') : _T('-'), (_F & NF) ? _T('N') : _T('-'), (_F & VF) ? _T('V') : _T('-'), (_F & XF) ? _T('X') : _T('-'),
- (_F & HF) ? _T('H') : _T('-'), (_F & YF) ? _T('Y') : _T('-'), (_F & ZF) ? _T('Z') : _T('-'), (_F & SF) ? _T('S') : _T('-'),
- _A, BC, DE, HL, SP, PC,
- (IM & 0x80) ? _T('S') : _T('-'), (IM & 0x40) ? _T('7') : _T('-'), (IM & 0x20) ? _T('6') : _T('-'), (IM & 0x10) ? _T('5') : _T('-'),
- (IM & 0x08) ? _T('E') : _T('-'), (IM & 0x04) ? _T('7') : _T('-'), (IM & 0x02) ? _T('6') : _T('-'), (IM & 0x01) ? _T('5') : _T('-'),
- d_mem_stored->read_data16w(BC, &wait), d_mem_stored->read_data16w(DE, &wait), d_mem_stored->read_data16w(HL, &wait), d_mem_stored->read_data16w(SP, &wait));
+ _T("F = [%c%c%c%c%c%c%c%c] A = %02X BC = %04X DE = %04X HL = %04X SP = %04X PC = %04X\nIM= [%c%c%c%c%c%c%c%c] (BC)= %04X (DE)= %04X (HL)= %04X (SP)= %04X\nTotal CPU Clocks = %llu (%llu)"),
+ (_F & CF) ? _T('C') : _T('-'), (_F & NF) ? _T('N') : _T('-'), (_F & VF) ? _T('V') : _T('-'), (_F & XF) ? _T('X') : _T('-'),
+ (_F & HF) ? _T('H') : _T('-'), (_F & YF) ? _T('Y') : _T('-'), (_F & ZF) ? _T('Z') : _T('-'), (_F & SF) ? _T('S') : _T('-'),
+ _A, BC, DE, HL, SP, PC,
+ (IM & 0x80) ? _T('S') : _T('-'), (IM & 0x40) ? _T('7') : _T('-'), (IM & 0x20) ? _T('6') : _T('-'), (IM & 0x10) ? _T('5') : _T('-'),
+ (IM & 0x08) ? _T('E') : _T('-'), (IM & 0x04) ? _T('7') : _T('-'), (IM & 0x02) ? _T('6') : _T('-'), (IM & 0x01) ? _T('5') : _T('-'),
+ d_mem_stored->read_data16w(BC, &wait), d_mem_stored->read_data16w(DE, &wait), d_mem_stored->read_data16w(HL, &wait), d_mem_stored->read_data16w(SP, &wait),
+ total_count, total_count - prev_total_count);
+ prev_total_count = total_count;
}
// disassembler
inline void RST(uint16_t n);
void OP(uint8_t code);
+
+ uint64_t total_count;
+ uint64_t prev_total_count;
public:
I8080_BASE(VM* parent_vm, EMU* parent_emu) : DEVICE(parent_vm, parent_emu)
{
d_mem = d_pic = d_io = NULL;
d_mem_stored = d_io_stored = NULL;
d_debugger = NULL;
+ total_count = prev_total_count = 0;
set_device_name(_T("i8080 CPU"));
}
~I8080_BASE() {}
//#include "../i8250.h"
#include "../i8253.h"
#include "../i8259.h"
-#if defined(HAS_I286)
+//#if defined(HAS_I286)
#include "../i286.h"
-#else
-#include "../i86.h"
-#endif
+//#else
+//#include "../i86.h"
+//#endif
#include "../io.h"
#include "../noise.h"
#include "../pcm1bit.h"
#include "../hd146818p.h"
#endif
+#ifdef USE_DEBUGGER
+#include "../debugger.h"
+#endif
+
#include "display.h"
#include "dmareg.h"
#include "floppy.h"
// sio = new I8250(this, emu);
pit = new I8253(this, emu); // i8254
pic = new I8259(this, emu);
-#if defined(HAS_I286)
+//#if defined(HAS_I286)
cpu = new I286(this, emu);
-#else
- cpu = new I86(this, emu);
-#endif
+//#else
+// cpu = new I86(this, emu);
+//#endif
io = new IO(this, emu);
pcm = new PCM1BIT(this, emu);
fdc = new UPD765A(this, emu);
cpu->set_context_mem(memory);
cpu->set_context_io(io);
cpu->set_context_intr(pic);
+#ifdef USE_DEBUGGER
+ cpu->set_context_debugger(new DEBUGGER(this, emu));
+#endif
// dmac
io->set_iomap_range_rw(0x00, 0x0f, dma);
}
// ----------------------------------------------------------------------------
+// debugger
+// ----------------------------------------------------------------------------
+
+#ifdef USE_DEBUGGER
+DEVICE *VM::get_cpu(int index)
+{
+ if(index == 0) {
+ return cpu;
+ }
+ return NULL;
+}
+#endif
+
+// ----------------------------------------------------------------------------
// draw screen
// ----------------------------------------------------------------------------
//class I8250;
class I8253;
class I8259;
-#if defined(HAS_I286)
+//#if defined(HAS_I286)
class I286;
-#else
-class I86;
-#endif
+//#else
+//class I86;
+//#endif
class IO;
class PCM1BIT;
class UPD765A;
// I8250* sio;
I8253* pit;
I8259* pic;
-#if defined(HAS_I286)
+//#if defined(HAS_I286)
I286* cpu;
-#else
- I86* cpu;
-#endif
+//#else
+// I86* cpu;
+//#endif
IO* io;
PCM1BIT* pcm;
UPD765A* fdc;
void notify_power_off();
void run();
+#ifdef USE_DEBUGGER
+ // debugger
+ DEVICE *get_cpu(int index);
+#endif
+
// draw screen
void draw_screen();
--- /dev/null
+/*
+ Skelton for retropc emulator
+
+ Author : Takeda.Toshiya
+ Date : 2012.10.18-
+
+ [ i286 ]
+*/
+
+#include "i286.h"
+#ifdef USE_DEBUGGER
+#include "../debugger.h"
+#endif
+
+/* ----------------------------------------------------------------------------
+ MAME i286
+---------------------------------------------------------------------------- */
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1400)
+#pragma warning( disable : 4018 )
+#pragma warning( disable : 4146 )
+#pragma warning( disable : 4244 )
+#pragma warning( disable : 4996 )
+#endif
+
+#if defined(HAS_I86)
+ #define CPU_MODEL i8086
+#elif defined(HAS_I88)
+ #define CPU_MODEL i8088
+#elif defined(HAS_I186)
+ #define CPU_MODEL i80186
+#elif defined(HAS_V30)
+ #define CPU_MODEL v30
+#elif defined(HAS_I286)
+ #define CPU_MODEL i80286
+#endif
+
+#ifndef __BIG_ENDIAN__
+#define LSB_FIRST
+#endif
+
+#ifndef INLINE
+#define INLINE inline
+#endif
+
+#define logerror(...)
+
+/*****************************************************************************/
+/* src/emu/devcpu.h */
+
+// CPU interface functions
+#define CPU_INIT_NAME(name) cpu_init_##name
+#define CPU_INIT(name) void* CPU_INIT_NAME(name)()
+#define CPU_INIT_CALL(name) CPU_INIT_NAME(name)()
+
+#define CPU_RESET_NAME(name) cpu_reset_##name
+#define CPU_RESET(name) void CPU_RESET_NAME(name)(cpu_state *cpustate)
+#define CPU_RESET_CALL(name) CPU_RESET_NAME(name)(cpustate)
+
+#define CPU_EXECUTE_NAME(name) cpu_execute_##name
+#define CPU_EXECUTE(name) int CPU_EXECUTE_NAME(name)(cpu_state *cpustate, int icount)
+#define CPU_EXECUTE_CALL(name) CPU_EXECUTE_NAME(name)(cpustate, icount)
+
+#define CPU_DISASSEMBLE_NAME(name) cpu_disassemble_##name
+#define CPU_DISASSEMBLE(name) int CPU_DISASSEMBLE_NAME(name)(_TCHAR *buffer, offs_t eip, const UINT8 *oprom)
+#define CPU_DISASSEMBLE_CALL(name) CPU_DISASSEMBLE_NAME(name)(buffer, eip, oprom)
+
+/*****************************************************************************/
+/* src/emu/didisasm.h */
+
+// Disassembler constants
+const UINT32 DASMFLAG_SUPPORTED = 0x80000000; // are disassembly flags supported?
+const UINT32 DASMFLAG_STEP_OUT = 0x40000000; // this instruction should be the end of a step out sequence
+const UINT32 DASMFLAG_STEP_OVER = 0x20000000; // this instruction should be stepped over by setting a breakpoint afterwards
+const UINT32 DASMFLAG_OVERINSTMASK = 0x18000000; // number of extra instructions to skip when stepping over
+const UINT32 DASMFLAG_OVERINSTSHIFT = 27; // bits to shift after masking to get the value
+const UINT32 DASMFLAG_LENGTHMASK = 0x0000ffff; // the low 16-bits contain the actual length
+
+/*****************************************************************************/
+/* src/emu/diexec.h */
+
+// I/O line states
+enum line_state
+{
+ CLEAR_LINE = 0, // clear (a fired or held) line
+ ASSERT_LINE, // assert an interrupt immediately
+ HOLD_LINE, // hold interrupt line until acknowledged
+ PULSE_LINE // pulse interrupt line instantaneously (only for NMI, RESET)
+};
+
+enum
+{
+ INPUT_LINE_IRQ = 0,
+ INPUT_LINE_NMI
+};
+
+/*****************************************************************************/
+/* src/emu/emucore.h */
+
+// constants for expression endianness
+enum endianness_t
+{
+ ENDIANNESS_LITTLE,
+ ENDIANNESS_BIG
+};
+
+// declare native endianness to be one or the other
+#ifdef LSB_FIRST
+const endianness_t ENDIANNESS_NATIVE = ENDIANNESS_LITTLE;
+#else
+const endianness_t ENDIANNESS_NATIVE = ENDIANNESS_BIG;
+#endif
+// endian-based value: first value is if 'endian' is little-endian, second is if 'endian' is big-endian
+#define ENDIAN_VALUE_LE_BE(endian,leval,beval) (((endian) == ENDIANNESS_LITTLE) ? (leval) : (beval))
+// endian-based value: first value is if native endianness is little-endian, second is if native is big-endian
+#define NATIVE_ENDIAN_VALUE_LE_BE(leval,beval) ENDIAN_VALUE_LE_BE(ENDIANNESS_NATIVE, leval, beval)
+// endian-based value: first value is if 'endian' matches native, second is if 'endian' doesn't match native
+#define ENDIAN_VALUE_NE_NNE(endian,leval,beval) (((endian) == ENDIANNESS_NATIVE) ? (neval) : (nneval))
+
+/*****************************************************************************/
+/* src/emu/memory.h */
+
+// offsets and addresses are 32-bit (for now...)
+typedef UINT32 offs_t;
+
+/*****************************************************************************/
+/* src/osd/osdcomm.h */
+
+/* Highly useful macro for compile-time knowledge of an array size */
+#define ARRAY_LENGTH(x) (sizeof(x) / sizeof(x[0]))
+
+#if defined(HAS_I86) || defined(HAS_I88) || defined(HAS_I186) || defined(HAS_V30)
+#define cpu_state i8086_state
+#include "../mame/emu/cpu/i86/i86.c"
+#elif defined(HAS_I286)
+#define cpu_state i80286_state
+#include "../mame/emu/cpu/i86/i286.c"
+#endif
+#ifdef USE_DEBUGGER
+#ifdef HAS_V30
+#include "../mame/emu/cpu/nec/necdasm.c"
+#else
+#include "../mame/emu/cpu/i386/i386dasm.c"
+#endif
+#endif
+
+void I286::initialize()
+{
+ opaque = CPU_INIT_CALL(CPU_MODEL);
+
+ cpu_state *cpustate = (cpu_state *)opaque;
+ cpustate->pic = d_pic;
+ cpustate->program = d_mem;
+ cpustate->io = d_io;
+#ifdef I86_PSEUDO_BIOS
+ cpustate->bios = d_bios;
+#endif
+#ifdef SINGLE_MODE_DMA
+ cpustate->dma = d_dma;
+#endif
+#ifdef USE_DEBUGGER
+ cpustate->emu = emu;
+ cpustate->debugger = d_debugger;
+ cpustate->program_stored = d_mem;
+ cpustate->io_stored = d_io;
+
+ d_debugger->set_context_mem(d_mem);
+ d_debugger->set_context_io(d_io);
+#endif
+}
+
+void I286::release()
+{
+ free(opaque);
+}
+
+void I286::reset()
+{
+ cpu_state *cpustate = (cpu_state *)opaque;
+ int busreq = cpustate->busreq;
+
+ CPU_RESET_CALL(CPU_MODEL);
+
+ cpustate->pic = d_pic;
+ cpustate->program = d_mem;
+ cpustate->io = d_io;
+#ifdef I86_PSEUDO_BIOS
+ cpustate->bios = d_bios;
+#endif
+#ifdef SINGLE_MODE_DMA
+ cpustate->dma = d_dma;
+#endif
+#ifdef USE_DEBUGGER
+ cpustate->emu = emu;
+ cpustate->debugger = d_debugger;
+ cpustate->program_stored = d_mem;
+ cpustate->io_stored = d_io;
+#endif
+ cpustate->busreq = busreq;
+}
+
+int I286::run(int icount)
+{
+ cpu_state *cpustate = (cpu_state *)opaque;
+#ifdef _JX
+ // ugly patch for PC/JX hardware diagnostics :-(
+#ifdef TIMER_HACK
+ if(cpustate->pc == 0xff040) cpustate->pc = 0xff04a;
+ if(cpustate->pc == 0xff17d) cpustate->pc = 0xff18f;
+#endif
+#ifdef KEYBOARD_HACK
+ if(cpustate->pc == 0xfa909) { cpustate->regs.b[BH] = read_port_byte(0xa1); cpustate->pc = 0xfa97c; }
+ if(cpustate->pc == 0xff6e1) { cpustate->regs.b[AL] = 0x0d; cpustate->pc += 2; }
+#endif
+#endif
+ return CPU_EXECUTE_CALL(CPU_MODEL);
+}
+
+void I286::write_signal(int id, uint32_t data, uint32_t mask)
+{
+ cpu_state *cpustate = (cpu_state *)opaque;
+
+ if(id == SIG_CPU_NMI) {
+ set_irq_line(cpustate, INPUT_LINE_NMI, (data & mask) ? HOLD_LINE : CLEAR_LINE);
+ } else if(id == SIG_CPU_IRQ) {
+ set_irq_line(cpustate, INPUT_LINE_IRQ, (data & mask) ? HOLD_LINE : CLEAR_LINE);
+ } else if(id == SIG_CPU_BUSREQ) {
+ cpustate->busreq = (data & mask) ? 1 : 0;
+ } else if(id == SIG_I86_TEST) {
+ cpustate->test_state = (data & mask) ? 1 : 0;
+#ifdef HAS_I286
+ } else if(id == SIG_I286_A20) {
+ i80286_set_a20_line(cpustate, data & mask);
+#endif
+ }
+}
+
+void I286::set_intr_line(bool line, bool pending, uint32_t bit)
+{
+ cpu_state *cpustate = (cpu_state *)opaque;
+ set_irq_line(cpustate, INPUT_LINE_IRQ, line ? HOLD_LINE : CLEAR_LINE);
+}
+
+void I286::set_extra_clock(int icount)
+{
+ cpu_state *cpustate = (cpu_state *)opaque;
+ cpustate->extra_cycles += icount;
+}
+
+int I286::get_extra_clock()
+{
+ cpu_state *cpustate = (cpu_state *)opaque;
+ return cpustate->extra_cycles;
+}
+
+uint32_t I286::get_pc()
+{
+ cpu_state *cpustate = (cpu_state *)opaque;
+ return cpustate->prevpc;
+}
+
+uint32_t I286::get_next_pc()
+{
+ cpu_state *cpustate = (cpu_state *)opaque;
+ return cpustate->pc;
+}
+
+#ifdef USE_DEBUGGER
+void I286::write_debug_data8(uint32_t addr, uint32_t data)
+{
+ int wait;
+ d_mem->write_data8w(addr, data, &wait);
+}
+
+uint32_t I286::read_debug_data8(uint32_t addr)
+{
+ int wait;
+ return d_mem->read_data8w(addr, &wait);
+}
+
+void I286::write_debug_data16(uint32_t addr, uint32_t data)
+{
+ int wait;
+ d_mem->write_data16w(addr, data, &wait);
+}
+
+uint32_t I286::read_debug_data16(uint32_t addr)
+{
+ int wait;
+ return d_mem->read_data16w(addr, &wait);
+}
+
+void I286::write_debug_io8(uint32_t addr, uint32_t data)
+{
+ int wait;
+ d_io->write_io8w(addr, data, &wait);
+}
+
+uint32_t I286::read_debug_io8(uint32_t addr) {
+ int wait;
+ return d_io->read_io8w(addr, &wait);
+}
+
+void I286::write_debug_io16(uint32_t addr, uint32_t data)
+{
+ int wait;
+ d_io->write_io16w(addr, data, &wait);
+}
+
+uint32_t I286::read_debug_io16(uint32_t addr) {
+ int wait;
+ return d_io->read_io16w(addr, &wait);
+}
+
+bool I286::write_debug_reg(const _TCHAR *reg, uint32_t data)
+{
+ cpu_state *cpustate = (cpu_state *)opaque;
+ if(_tcsicmp(reg, _T("IP")) == 0) {
+ cpustate->pc = ((data & 0xffff) + cpustate->base[CS]) & AMASK;
+ CHANGE_PC(cpustate->pc);
+ } else if(_tcsicmp(reg, _T("AX")) == 0) {
+ cpustate->regs.w[AX] = data;
+ } else if(_tcsicmp(reg, _T("BX")) == 0) {
+ cpustate->regs.w[BX] = data;
+ } else if(_tcsicmp(reg, _T("CX")) == 0) {
+ cpustate->regs.w[CX] = data;
+ } else if(_tcsicmp(reg, _T("DX")) == 0) {
+ cpustate->regs.w[DX] = data;
+ } else if(_tcsicmp(reg, _T("SP")) == 0) {
+ cpustate->regs.w[SP] = data;
+ } else if(_tcsicmp(reg, _T("BP")) == 0) {
+ cpustate->regs.w[BP] = data;
+ } else if(_tcsicmp(reg, _T("SI")) == 0) {
+ cpustate->regs.w[SI] = data;
+ } else if(_tcsicmp(reg, _T("DI")) == 0) {
+ cpustate->regs.w[DI] = data;
+ } else if(_tcsicmp(reg, _T("AL")) == 0) {
+ cpustate->regs.b[AL] = data;
+ } else if(_tcsicmp(reg, _T("AH")) == 0) {
+ cpustate->regs.b[AH] = data;
+ } else if(_tcsicmp(reg, _T("BL")) == 0) {
+ cpustate->regs.b[BL] = data;
+ } else if(_tcsicmp(reg, _T("BH")) == 0) {
+ cpustate->regs.b[BH] = data;
+ } else if(_tcsicmp(reg, _T("CL")) == 0) {
+ cpustate->regs.b[CL] = data;
+ } else if(_tcsicmp(reg, _T("CH")) == 0) {
+ cpustate->regs.b[CH] = data;
+ } else if(_tcsicmp(reg, _T("DL")) == 0) {
+ cpustate->regs.b[DL] = data;
+ } else if(_tcsicmp(reg, _T("DH")) == 0) {
+ cpustate->regs.b[DH] = data;
+ } else {
+ return false;
+ }
+ return true;
+}
+
+void I286::get_debug_regs_info(_TCHAR *buffer, size_t buffer_len)
+{
+ cpu_state *cpustate = (cpu_state *)opaque;
+ 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]\nTotal CPU Clocks = %llu (%llu)"),
+ cpustate->regs.w[AX], cpustate->regs.w[BX], cpustate->regs.w[CX], cpustate->regs.w[DX], cpustate->regs.w[SP], cpustate->regs.w[BP], cpustate->regs.w[SI], cpustate->regs.w[DI],
+ cpustate->sregs[DS], cpustate->sregs[ES], cpustate->sregs[SS], cpustate->sregs[CS], cpustate->pc - cpustate->base[CS],
+ OF ? _T('O') : _T('-'), DF ? _T('D') : _T('-'), cpustate->IF ? _T('I') : _T('-'), cpustate->TF ? _T('T') : _T('-'),
+ SF ? _T('S') : _T('-'), ZF ? _T('Z') : _T('-'), AF ? _T('A') : _T('-'), PF ? _T('P') : _T('-'), CF ? _T('C') : _T('-'),
+ cpustate->total_icount, cpustate->total_icount - cpustate->prev_total_icount);
+ cpustate->prev_total_icount = cpustate->total_icount;
+}
+
+int I286::debug_dasm(uint32_t pc, _TCHAR *buffer, size_t buffer_len)
+{
+ cpu_state *cpustate = (cpu_state *)opaque;
+ UINT64 eip = pc - cpustate->base[CS];
+ UINT8 ops[16];
+ for(int i = 0; i < 16; i++) {
+ int wait;
+ ops[i] = d_mem->read_data8w(pc + i, &wait);
+ }
+ UINT8 *oprom = ops;
+
+#ifdef HAS_V30
+ return CPU_DISASSEMBLE_CALL(nec_generic) & DASMFLAG_LENGTHMASK;
+#else
+ return CPU_DISASSEMBLE_CALL(x86_16) & DASMFLAG_LENGTHMASK;
+#endif
+}
+#endif
+
+#ifdef HAS_I286
+void I286::set_address_mask(uint32_t mask)
+{
+ cpu_state *cpustate = (cpu_state *)opaque;
+ cpustate->amask = mask;
+}
+
+uint32_t I286::get_address_mask()
+{
+ cpu_state *cpustate = (cpu_state *)opaque;
+ return cpustate->amask;
+}
+
+void I286::set_shutdown_flag(int shutdown)
+{
+ cpu_state *cpustate = (cpu_state *)opaque;
+ cpustate->shutdown = shutdown;
+}
+
+int I286::get_shutdown_flag()
+{
+ cpu_state *cpustate = (cpu_state *)opaque;
+ return cpustate->shutdown;
+}
+#endif
+
+#define STATE_VERSION 4
+
+void I286::save_state(FILEIO* state_fio)
+{
+ state_fio->FputUint32(STATE_VERSION);
+ state_fio->FputInt32(this_device_id);
+
+ state_fio->Fwrite(opaque, sizeof(cpu_state), 1);
+}
+
+bool I286::load_state(FILEIO* state_fio)
+{
+ if(state_fio->FgetUint32() != STATE_VERSION) {
+ return false;
+ }
+ if(state_fio->FgetInt32() != this_device_id) {
+ return false;
+ }
+ state_fio->Fread(opaque, sizeof(cpu_state), 1);
+
+ // post process
+ cpu_state *cpustate = (cpu_state *)opaque;
+ cpustate->pic = d_pic;
+ cpustate->program = d_mem;
+ cpustate->io = d_io;
+#ifdef I86_PSEUDO_BIOS
+ cpustate->bios = d_bios;
+#endif
+#ifdef SINGLE_MODE_DMA
+ cpustate->dma = d_dma;
+#endif
+#ifdef USE_DEBUGGER
+ cpustate->emu = emu;
+ cpustate->debugger = d_debugger;
+ cpustate->program_stored = d_mem;
+ cpustate->io_stored = d_io;
+#endif
+ return true;
+}
+
--- /dev/null
+/*
+ Skelton for retropc emulator
+
+ Author : Takeda.Toshiya
+ Date : 2012.10.18-
+
+ [ i286 ]
+*/
+
+#ifndef _I286_H_
+#define _I286_H_
+
+#include "../vm.h"
+#include "../../emu.h"
+#include "../device.h"
+
+#define SIG_I86_TEST 0
+#define SIG_I286_A20 1
+
+#ifdef USE_DEBUGGER
+class DEBUGGER;
+#endif
+
+class I286 : public DEVICE
+{
+private:
+ DEVICE *d_mem, *d_io, *d_pic;
+#ifdef I86_PSEUDO_BIOS
+ DEVICE *d_bios;
+#endif
+#ifdef SINGLE_MODE_DMA
+ DEVICE *d_dma;
+#endif
+#ifdef USE_DEBUGGER
+ DEBUGGER *d_debugger;
+#endif
+ void *opaque;
+
+public:
+ I286(VM* parent_vm, EMU* parent_emu) : DEVICE(parent_vm, parent_emu)
+ {
+#ifdef I86_PSEUDO_BIOS
+ d_bios = NULL;
+#endif
+#ifdef SINGLE_MODE_DMA
+ d_dma = NULL;
+#endif
+#if defined(HAS_I86)
+ set_device_name(_T("8086 CPU"));
+#elif defined(HAS_I88)
+ set_device_name(_T("8088 CPU"));
+#elif defined(HAS_I186)
+ set_device_name(_T("80186 CPU"));
+#elif defined(HAS_V30)
+ set_device_name(_T("V30 CPU"));
+#elif defined(HAS_I286)
+ set_device_name(_T("80286 CPU"));
+#endif
+ }
+ ~I286() {}
+
+ // common functions
+ void initialize();
+ void release();
+ void reset();
+ int run(int icount);
+ void write_signal(int id, uint32_t data, uint32_t mask);
+ void set_intr_line(bool line, bool pending, uint32_t bit);
+ void set_extra_clock(int icount);
+ int get_extra_clock();
+ uint32_t get_pc();
+ uint32_t get_next_pc();
+#ifdef USE_DEBUGGER
+ void *get_debugger()
+ {
+ return d_debugger;
+ }
+ uint32_t get_debug_prog_addr_mask()
+ {
+#ifdef HAS_I286
+ return 0xffffff;
+#else
+ return 0xfffff;
+#endif
+ }
+ uint32_t get_debug_data_addr_mask()
+ {
+#ifdef HAS_I286
+ return 0xffffff;
+#else
+ return 0xfffff;
+#endif
+ }
+ void write_debug_data8(uint32_t addr, uint32_t data);
+ uint32_t read_debug_data8(uint32_t addr);
+ void write_debug_data16(uint32_t addr, uint32_t data);
+ uint32_t read_debug_data16(uint32_t addr);
+ void write_debug_io8(uint32_t addr, uint32_t data);
+ uint32_t read_debug_io8(uint32_t addr);
+ void write_debug_io16(uint32_t addr, uint32_t data);
+ uint32_t read_debug_io16(uint32_t addr);
+ 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);
+#endif
+ void save_state(FILEIO* state_fio);
+ bool load_state(FILEIO* state_fio);
+
+ // unique function
+ void set_context_mem(DEVICE* device)
+ {
+ d_mem = device;
+ }
+ void set_context_io(DEVICE* device)
+ {
+ d_io = device;
+ }
+ void set_context_intr(DEVICE* device)
+ {
+ d_pic = device;
+ }
+#ifdef I86_PSEUDO_BIOS
+ void set_context_bios(DEVICE* device)
+ {
+ d_bios = device;
+ }
+#endif
+#ifdef SINGLE_MODE_DMA
+ void set_context_dma(DEVICE* device)
+ {
+ d_dma = device;
+ }
+#endif
+#ifdef USE_DEBUGGER
+ void set_context_debugger(DEBUGGER* device)
+ {
+ d_debugger = device;
+ }
+#endif
+#ifdef HAS_I286
+ void set_address_mask(uint32_t mask);
+ uint32_t get_address_mask();
+ void set_shutdown_flag(int shutdown);
+ int get_shutdown_flag();
+#endif
+};
+
+#endif
#include "../i8253.h"
#include "../i8255.h"
#include "../i8259.h"
-#include "../i86.h"
+//#include "../i286.h"
+#include "./i286.h"
#include "../io.h"
#include "../memory.h"
#include "../noise.h"
pit = new I8253(this, emu);
pio = new I8255(this, emu);
pic = new I8259(this, emu);
- cpu = new I86(this, emu); // 8088
+ cpu = new I286(this, emu); // 8088
io = new IO(this, emu);
mem = new MEMORY(this, emu);
pcm = new PCM1BIT(this, emu);
class I8253;
class I8255;
class I8259;
-class I86;
+class I286;
class IO;
class MEMORY;
class PCM1BIT;
I8253* pit;
I8255* pio;
I8259* pic;
- I86* cpu;
+ I286* cpu;
IO* io;
MEMORY* mem;
PCM1BIT* pcm;
}
// bios
- virtual bool bios_call_i86(uint32_t PC, uint16_t regs[], uint16_t sregs[], int32_t* ZeroFlag, int32_t* CarryFlag)
+ virtual bool bios_call_far_i86(uint32_t PC, uint16_t regs[], uint16_t sregs[], int32_t* ZeroFlag, int32_t* CarryFlag)
{
return false;
}
{
memset( &cpustate->reg, 0, sizeof(cpustate->reg) );
memset( cpustate->sreg, 0, sizeof(cpustate->sreg) );
+
+ cpustate->total_cycles = 0;
+ cpustate->prev_total_cycles = 0;
+
cpustate->eip = 0;
cpustate->pc = 0;
cpustate->prev_eip = 0;
void I386_OPS_BASE::i386_set_irq_line(int irqline, int state)
{
+ int first_cycles = cpustate->cycles;
+
if (state != CLEAR_LINE && cpustate->halted)
{
cpustate->halted = 0;
{
cpustate->irq_state = state;
}
+ cpustate->extra_cycles += first_cycles - cpustate->cycles;
+ cpustate->cycles = first_cycles;
}
void I386_OPS_BASE::i386_set_a20_line(int state)
}
// BASE execution : EXECUTE without DMA, BIOS and debugger.
+#include "../../debugger.h"
int I386_OPS_BASE::cpu_execute_i386(int cycles)
{
CHANGE_PC(cpustate->eip);
// this is main cpu, cpustate->cycles is not used
/*cpustate->cycles = */cpustate->extra_cycles = 0;
cpustate->tsc += passed_cycles;
+ cpustate->total_cycles += passed_cycles;
return passed_cycles;
} else {
cpustate->cycles += cycles;
}
int passed_cycles = cpustate->base_cycles - cpustate->cycles;
cpustate->tsc += passed_cycles;
+ cpustate->total_cycles += passed_cycles;
return passed_cycles;
}
}
while( cpustate->cycles > 0 && !cpustate->busreq )
{
+ int first_cycles = cpustate->cycles;
i386_check_irq_line();
cpustate->operand_size = cpustate->sreg[CS].d;
cpustate->xmm_operand_size = 0;
cpustate->ext = 1;
int old_tf = cpustate->TF;
+ cpustate->debugger->add_cpu_trace(cpustate->pc);
cpustate->segment_prefix = 0;
cpustate->prev_eip = cpustate->eip;
cpustate->prev_pc = cpustate->pc;
/* adjust for any interrupts that came in */
cpustate->cycles -= cpustate->extra_cycles;
cpustate->extra_cycles = 0;
+ cpustate->total_cycles += first_cycles - cpustate->cycles;
}
/* if busreq is raised, spin cpu while remained clock */
if (cpustate->cycles > 0 && cpustate->busreq) {
+ cpustate->total_cycles += cpustate->cycles;
cpustate->cycles = 0;
}
int passed_cycles = cpustate->base_cycles - cpustate->cycles;
cpustate->tsc += passed_cycles;
+ cpustate->total_cycles += passed_cycles;
return passed_cycles;
}
{
#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]"),
- REG16(AX), REG16(BX), REG16(CX), REG16(DX), REG16(SP), REG16(BP), REG16(SI), REG16(DI),
- 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('-'));
+ _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]\nTotal CPU Clocks = %llu (%llu)"),
+ 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);
+ cpustate->prev_total_cycles = cpustate->total_cycles;
#endif
}
UINT16 offset = FETCH16();
UINT16 ptr = FETCH16();
+ CYCLES(CYCLES_CALL_INTERSEG); /* TODO: Timing = 17 + m */
if( PROTECTED_MODE && !V8086_MODE)
{
i386_protected_mode_call(ptr,offset,0,0);
cpustate->eip = offset;
i386_load_segment_descriptor(CS);
}
- CYCLES(CYCLES_CALL_INTERSEG); /* TODO: Timing = 17 + m */
CHANGE_PC(cpustate->eip);
}
return; \
} \
}
-#define BIOS_CALL(address) if(cpustate->bios != NULL) { \
+
+#define BIOS_CALL_FAR(address) if(cpustate->bios != NULL) { \
uint16_t regs[8], sregs[4]; \
regs[0] = REG16(AX); regs[1] = REG16(CX); regs[2] = REG16(DX); regs[3] = REG16(BX); \
regs[4] = REG16(SP); regs[5] = REG16(BP); regs[6] = REG16(SI); regs[7] = REG16(DI); \
sregs[0] = cpustate->sreg[ES].selector; sregs[1] = cpustate->sreg[CS].selector; \
sregs[2] = cpustate->sreg[SS].selector; sregs[3] = cpustate->sreg[DS].selector; \
int32_t ZeroFlag = cpustate->ZF, CarryFlag = cpustate->CF; \
- if(cpustate->bios->bios_call_i86(address, regs, sregs, &ZeroFlag, &CarryFlag)) { \
+ if(cpustate->bios->bios_call_far_i86(address, regs, sregs, &ZeroFlag, &CarryFlag)) { \
REG16(AX) = regs[0]; REG16(CX) = regs[1]; REG16(DX) = regs[2]; REG16(BX) = regs[3]; \
REG16(SP) = regs[4]; REG16(BP) = regs[5]; REG16(SI) = regs[6]; REG16(DI) = regs[7]; \
cpustate->ZF = (UINT8)ZeroFlag; cpustate->CF = (UINT8)CarryFlag; \
- return; \
+ CYCLES(cpustate,CYCLES_RET_INTERSEG); \
+ return; \
} \
}
#endif
{
UINT16 offset = FETCH16();
UINT16 ptr = FETCH16();
+ CYCLES(cpustate,CYCLES_CALL_INTERSEG); /* TODO: Timing = 17 + m */
+
#ifdef I386_PSEUDO_BIOS
- BIOS_CALL(((ptr << 4) + offset) & cpustate->a20_mask)
+ BIOS_CALL_FAR(((ptr << 4) + offset) & cpustate->a20_mask)
#endif
//printf(" \n");
cpustate->eip = offset;
i386_load_segment_descriptor(CS);
}
- CYCLES(CYCLES_CALL_INTERSEG); /* TODO: Timing = 17 + m */
CHANGE_PC(cpustate->eip);
}
{
INT16 disp = FETCH16();
-#ifdef I386_PSEUDO_BIOS
- BIOS_CALL((cpustate->pc + disp) & cpustate->a20_mask)
-#endif
-
PUSH16( cpustate->eip );
if (cpustate->sreg[CS].d)
{
address = READ16(ea);
CYCLES(CYCLES_CALL_MEM); /* TODO: Timing = 10 + m */
}
-#ifdef I386_PSEUDO_BIOS
- BIOS_CALL(((cpustate->sreg[CS].selector << 4) + address) & cpustate->a20_mask)
-#endif
PUSH16( cpustate->eip );
cpustate->eip = address;
CHANGE_PC(cpustate->eip);
selector = READ16(ea + 2);
CYCLES(CYCLES_CALL_MEM_INTERSEG); /* TODO: Timing = 10 + m */
#ifdef I386_PSEUDO_BIOS
- BIOS_CALL(((selector << 4) + address) & cpustate->a20_mask)
+ BIOS_CALL_FAR(((selector << 4) + address) & cpustate->a20_mask)
#endif
if(PROTECTED_MODE && !V8086_MODE)
{
int segment_prefix;
int segment_override;
+ uint64_t total_cycles;
+ uint64_t prev_total_cycles;
+
int cycles;
int extra_cycles;
int base_cycles;
if(clock == -1) {
if (busreq) {
// don't run cpu!
+#ifdef USE_DEBUGGER
+ total_icount += 1;
+#endif
return 1;
} else {
// run only one opcode
}
// if busreq is raised, spin cpu while remained clock
if(icount > 0 && busreq) {
+#ifdef USE_DEBUGGER
+ total_icount += icount;
+#endif
icount = 0;
}
return first_icount - icount;
}
+#ifdef USE_DEBUGGER
+ total_icount += first_icount - icount;
+#endif
}
#define offs_t UINT16
return (int)(pc & DASMFLAG_LENGTHMASK);
#endif
}
+
+#define STATE_VERSION 2
+
+void M6502::save_state(FILEIO* state_fio)
+{
+ state_fio->FputUint32(STATE_VERSION);
+ state_fio->FputInt32(this_device_id);
+
+ save_state_regs(state_fio);
+#ifdef USE_DEBUGGER
+ state_fio->FputUint64(total_icount);
+#endif
+ state_fio->FputInt32(icount);
+ state_fio->FputBool(busreq);
+}
+
+bool M6502::load_state(FILEIO* state_fio)
+{
+ if(state_fio->FgetUint32() != STATE_VERSION) {
+ return false;
+ }
+ if(state_fio->FgetInt32() != this_device_id) {
+ return false;
+ }
+
+ load_state_regs(state_fio);
+#ifdef USE_DEBUGGER
+ total_icount = prev_total_icount = state_fio->FgetUint64();
+#endif
+ icount = state_fio->FgetInt32();
+ busreq = state_fio->FgetBool();
+ return true;
+}
+
uint8_t a, x, y, p;
bool pending_irq, after_cli;
bool nmi_state, irq_state, so_state;
+
+ uint64_t total_icount;
+ uint64_t prev_total_icount;
+
int icount;
bool busreq;
virtual void OP(uint8_t code);
void update_irq();
+ void save_state_regs(FILEIO* state_fio);
+ void load_state_regs(FILEIO* state_fio);
public:
M6502_BASE(VM* parent_vm, EMU* parent_emu) : DEVICE(parent_vm, parent_emu)
{
+ total_icount = prev_total_icount = 0;
busreq = false;
set_device_name(_T("M6502 CPU"));
}
void get_debug_regs_info(_TCHAR *buffer, size_t buffer_len);
virtual int debug_dasm(uint32_t pc, _TCHAR *buffer, size_t buffer_len);
//#endif
- void save_state(FILEIO* state_fio);
- bool load_state(FILEIO* state_fio);
// unique functions
void set_context_mem(DEVICE* device)
void reset();
int run(int clock);
int debug_dasm(uint32_t pc, _TCHAR *buffer, size_t buffer_len);
+ void save_state(FILEIO* state_fio);
+ bool load_state(FILEIO* state_fio);
};
class N2A03 : public M6502_BASE
void reset();
int run(int clock);
int debug_dasm(uint32_t pc, _TCHAR *buffer, size_t buffer_len);
+ void save_state(FILEIO* state_fio);
+ bool load_state(FILEIO* state_fio);
};
#endif
*/
#include "m6502.h"
+#include "debugger.h"
// vectors
#define NMI_VEC 0xfffa
void M6502_BASE::run_one_opecode()
{
+ int first_icount = icount;
// if an irq is pending, take it now
if(nmi_state) {
EAD = NMI_VEC;
PCH = RDMEM(EAD + 1);
nmi_state = false;
} else if(pending_irq) {
+ if(d_debugger != NULL) d_debugger->add_cpu_trace(PCW);
update_irq();
}
prev_pc = PCW;
void M6502_BASE::get_debug_regs_info(_TCHAR *buffer, size_t buffer_len)
{
my_stprintf_s(buffer, buffer_len,
- _T("PC = %04X A = %02X X = %02X Y = %02X S = %02X P = %02X [%c%c%c%c%c%c%c%c]"),
- PCW, A, X, Y, S, P,
- (P & F_N) ? _T('N') : _T('-'), (P & F_V) ? _T('V') : _T('-'), (P & F_T) ? _T('T') : _T('-'), (P & F_B) ? _T('B') : _T('-'),
- (P & F_D) ? _T('D') : _T('-'), (P & F_I) ? _T('I') : _T('-'), (P & F_Z) ? _T('Z') : _T('-'), (P & F_C) ? _T('C') : _T('-'));
+ _T("PC = %04X A = %02X X = %02X Y = %02X S = %02X P = %02X [%c%c%c%c%c%c%c%c]\nTotal CPU Clocks = %llu (%llu)"),
+ PCW, A, X, Y, S, P,
+ (P & F_N) ? _T('N') : _T('-'), (P & F_V) ? _T('V') : _T('-'), (P & F_T) ? _T('T') : _T('-'), (P & F_B) ? _T('B') : _T('-'),
+ (P & F_D) ? _T('D') : _T('-'), (P & F_I) ? _T('I') : _T('-'), (P & F_Z) ? _T('Z') : _T('-'), (P & F_C) ? _T('C') : _T('-'),
+ total_icount, total_icount - prev_total_icount);
+ prev_total_icount = total_icount;
}
// disassembler
}
//#endif
-#define STATE_VERSION 1
-
-void M6502_BASE::save_state(FILEIO* state_fio)
+void M6502_BASE::save_state_regs(FILEIO* state_fio)
{
- state_fio->FputUint32(STATE_VERSION);
- state_fio->FputInt32(this_device_id);
-
state_fio->FputUint32(pc.d);
state_fio->FputUint32(sp.d);
state_fio->FputUint32(zp.d);
state_fio->FputBool(nmi_state);
state_fio->FputBool(irq_state);
state_fio->FputBool(so_state);
- state_fio->FputInt32(icount);
- state_fio->FputBool(busreq);
}
-bool M6502_BASE::load_state(FILEIO* state_fio)
+void M6502_BASE::load_state_regs(FILEIO* state_fio)
{
- if(state_fio->FgetUint32() != STATE_VERSION) {
- return false;
- }
- if(state_fio->FgetInt32() != this_device_id) {
- return false;
- }
pc.d = state_fio->FgetUint32();
sp.d = state_fio->FgetUint32();
zp.d = state_fio->FgetUint32();
so_state = state_fio->FgetBool();
icount = state_fio->FgetInt32();
busreq = state_fio->FgetBool();
- return true;
}
static void i386_set_irq_line(i386_state *cpustate,int irqline, int state)
{
+ int first_cycles = cpustate->cycles;
+
if (state != CLEAR_LINE && cpustate->halted)
{
cpustate->halted = 0;
{
cpustate->irq_state = state;
}
+ cpustate->extra_cycles += first_cycles - cpustate->cycles;
+ cpustate->cycles = first_cycles;
}
static void i386_set_a20_line(i386_state *cpustate,int state)
// this is main cpu, cpustate->cycles is not used
/*cpustate->cycles = */cpustate->extra_cycles = 0;
cpustate->tsc += passed_cycles;
+#ifdef USE_DEBUGGER
+ cpustate->total_cycles += passed_cycles;
+#endif
return passed_cycles;
} else {
cpustate->cycles += cycles;
}
int passed_cycles = cpustate->base_cycles - cpustate->cycles;
cpustate->tsc += passed_cycles;
+#ifdef USE_DEBUGGER
+ cpustate->total_cycles += passed_cycles;
+#endif
return passed_cycles;
}
}
cpustate->base_cycles = cpustate->cycles;
/* adjust for any interrupts that came in */
+#ifdef USE_DEBUGGER
+ cpustate->total_cycles += cpustate->extra_cycles;
+#endif
cpustate->cycles -= cpustate->extra_cycles;
cpustate->extra_cycles = 0;
} else {
now_debugging = false;
}
+ int first_cycles = cpustate->cycles;
i386_check_irq_line(cpustate);
cpustate->operand_size = cpustate->sreg[CS].d;
cpustate->xmm_operand_size = 0;
cpustate->ext = 1;
int old_tf = cpustate->TF;
+ cpustate->debugger->add_cpu_trace(cpustate->pc);
cpustate->segment_prefix = 0;
cpustate->prev_eip = cpustate->eip;
cpustate->prev_pc = cpustate->pc;
/* adjust for any interrupts that came in */
cpustate->cycles -= cpustate->extra_cycles;
cpustate->extra_cycles = 0;
+ cpustate->total_cycles += first_cycles - cpustate->cycles;
if(now_debugging) {
if(!cpustate->debugger->now_going) {
cpustate->io = cpustate->io_stored;
}
} else {
+ int first_cycles = cpustate->cycles;
#endif
i386_check_irq_line(cpustate);
cpustate->operand_size = cpustate->sreg[CS].d;
cpustate->ext = 1;
int old_tf = cpustate->TF;
+#ifdef USE_DEBUGGER
+ cpustate->debugger->add_cpu_trace(cpustate->pc);
+#endif
cpustate->segment_prefix = 0;
cpustate->prev_eip = cpustate->eip;
cpustate->prev_pc = cpustate->pc;
cpustate->cycles -= cpustate->extra_cycles;
cpustate->extra_cycles = 0;
#ifdef USE_DEBUGGER
+ cpustate->total_cycles += first_cycles - cpustate->cycles;
}
#endif
}
/* if busreq is raised, spin cpu while remained clock */
if (cpustate->cycles > 0 && cpustate->busreq) {
+#ifdef USE_DEBUGGER
+ cpustate->total_cycles += cpustate->cycles;
+#endif
cpustate->cycles = 0;
}
int passed_cycles = cpustate->base_cycles - cpustate->cycles;
UINT16 offset = FETCH16(cpustate);
UINT16 ptr = FETCH16(cpustate);
+ CYCLES(cpustate,CYCLES_CALL_INTERSEG); /* TODO: Timing = 17 + m */
+
#ifdef I386_PSEUDO_BIOS
- BIOS_CALL(((ptr << 4) + offset) & cpustate->a20_mask)
+ BIOS_CALL_FAR(((ptr << 4) + offset) & cpustate->a20_mask)
#endif
if( PROTECTED_MODE && !V8086_MODE)
cpustate->eip = offset;
i386_load_segment_descriptor(cpustate,CS);
}
- CYCLES(cpustate,CYCLES_CALL_INTERSEG); /* TODO: Timing = 17 + m */
CHANGE_PC(cpustate,cpustate->eip);
}
{
INT16 disp = FETCH16(cpustate);
-#ifdef I386_PSEUDO_BIOS
- BIOS_CALL((cpustate->pc + disp) & cpustate->a20_mask)
-#endif
-
PUSH16(cpustate, cpustate->eip );
if (cpustate->sreg[CS].d)
{
address = READ16(cpustate,ea);
CYCLES(cpustate,CYCLES_CALL_MEM); /* TODO: Timing = 10 + m */
}
-#ifdef I386_PSEUDO_BIOS
- BIOS_CALL(((cpustate->sreg[CS].selector << 4) + address) & cpustate->a20_mask)
-#endif
PUSH16(cpustate, cpustate->eip );
cpustate->eip = address;
CHANGE_PC(cpustate,cpustate->eip);
selector = READ16(cpustate,ea + 2);
CYCLES(cpustate,CYCLES_CALL_MEM_INTERSEG); /* TODO: Timing = 10 + m */
#ifdef I386_PSEUDO_BIOS
- BIOS_CALL(((selector << 4) + address) & cpustate->a20_mask)
+ BIOS_CALL_FAR(((selector << 4) + address) & cpustate->a20_mask)
#endif
if(PROTECTED_MODE && !V8086_MODE)
{
int segment_prefix;
int segment_override;
+#ifdef USE_DEBUGGER
+ uint64_t total_cycles;
+ uint64_t prev_total_cycles;
+#endif
int cycles;
int extra_cycles;
int base_cycles;
int trap_level;
int shutdown;
+#ifdef USE_DEBUGGER
+ uint64_t total_icount;
+ uint64_t prev_total_icount;
+#endif
int icount;
char seg_prefix;
UINT8 prefix_seg;
bool i286_call_pseudo_bios(i80286_state *cpustate, uint32_t PC)
{
#ifdef I86_PSEUDO_BIOS
+ if(cpustate->bios != NULL) {
+ if(cpustate->bios->bios_call_far_i86(PC & AMASK, cpustate->regs.w, cpustate->sregs, &cpustate->ZeroVal, &cpustate->CarryVal)) return true;
+ }
if(cpustate->bios != NULL) return cpustate->bios->bios_call_i86(PC, cpustate->regs.w, cpustate->sregs, &cpustate->ZeroVal, &cpustate->CarryVal);
#endif
return false;
static void set_irq_line(i80286_state *cpustate, int irqline, int state)
{
+ int first_icount = cpustate->icount;
+
if (state != CLEAR_LINE && cpustate->halted)
{
cpustate->halted = 0;
{
i80286_trap2(cpustate, e);
}
+ cpustate->extra_cycles += first_icount - cpustate->icount;
+ cpustate->icount = first_icount;
}
static CPU_EXECUTE( i80286 )
int passed_icount = max(1, cpustate->extra_cycles);
// this is main cpu, cpustate->icount is not used
/*cpustate->icount = */cpustate->extra_cycles = 0;
+#ifdef USE_DEBUGGER
+ cpustate->total_icount += passed_icount;
+#endif
return passed_icount;
} else {
cpustate->icount += icount;
if (cpustate->icount > 0) {
cpustate->icount = 0;
}
+#ifdef USE_DEBUGGER
+ cpustate->total_icount += base_icount - cpustate->icount;
+#endif
return base_icount - cpustate->icount;
}
}
timing = i80286_cycles;
/* adjust for any interrupts that came in */
+#ifdef USE_DEBUGGER
+ cpustate->total_icount += cpustate->extra_cycles;
+#endif
cpustate->icount -= cpustate->extra_cycles;
cpustate->extra_cycles = 0;
} else {
now_debugging = false;
}
+ cpustate->debugger->add_cpu_trace(cpustate->pc);
+ int first_icount = cpustate->icount;
cpustate->seg_prefix=FALSE;
try
{
{
i80286_trap2(cpustate,e);
}
+ cpustate->total_icount += first_icount - cpustate->icount;
#ifdef SINGLE_MODE_DMA
if (cpustate->dma != NULL) {
cpustate->dma->do_dma();
cpustate->io = cpustate->io_stored;
}
} else {
+ cpustate->debugger->add_cpu_trace(cpustate->pc);
+ int first_icount = cpustate->icount;
#endif
cpustate->seg_prefix=FALSE;
try
{
i80286_trap2(cpustate,e);
}
+#ifdef USE_DEBUGGER
+ cpustate->total_icount += first_icount - cpustate->icount;
+#endif
#ifdef SINGLE_MODE_DMA
if (cpustate->dma != NULL) {
cpustate->dma->do_dma();
}
#endif
/* adjust for any interrupts that came in */
+#ifdef USE_DEBUGGER
+ cpustate->total_icount += cpustate->extra_cycles;
+#endif
cpustate->icount -= cpustate->extra_cycles;
cpustate->extra_cycles = 0;
}
/* if busreq is raised, spin cpu while remained clock */
if (cpustate->icount > 0 && cpustate->busreq) {
+#ifdef USE_DEBUGGER
+ cpustate->total_icount += cpustate->icount;
+#endif
cpustate->icount = 0;
}
return base_icount - cpustate->icount;
DEBUGGER *debugger;
DEVICE *program_stored;
DEVICE *io_stored;
+ uint64_t total_icount;
+ uint64_t prev_total_icount;
#endif
int icount;
bool i86_call_pseudo_bios(i8086_state *cpustate, uint32_t PC)
{
#ifdef I86_PSEUDO_BIOS
- if(cpustate->bios != NULL) return cpustate->bios->bios_call_i86(PC, cpustate->regs.w, cpustate->sregs, &cpustate->ZeroVal, &cpustate->CarryVal);
+ if(cpustate->bios != NULL) {
+ if(cpustate->bios->bios_call_far_i86(PC, cpustate->regs.w, cpustate->sregs, &cpustate->ZeroVal, &cpustate->CarryVal)) return true;
+ }
#endif
return false;
}
static void set_irq_line(i8086_state *cpustate, int irqline, int state)
{
+ int first_icount = cpustate->icount;
+
if (state != CLEAR_LINE && cpustate->halted)
{
cpustate->halted = 0;
cpustate->irq_state = CLEAR_LINE;
}
}
+ cpustate->extra_cycles += first_icount - cpustate->icount;
+ cpustate->icount = first_icount;
}
static void set_drq_line(i8086_state *cpustate, int irqline, int state)
int passed_icount = max(1, cpustate->extra_cycles);
// this is main cpu, cpustate->icount is not used
/*cpustate->icount = */cpustate->extra_cycles = 0;
+#ifdef USE_DEBUGGER
+ cpustate->total_icount += passed_icount;
+#endif
return passed_icount;
} else {
cpustate->icount += icount;
if (cpustate->icount > 0) {
cpustate->icount = 0;
}
+#ifdef USE_DEBUGGER
+ cpustate->total_icount += base_icount - cpustate->icount;
+#endif
return base_icount - cpustate->icount;
}
}
timing = i8086_cycles;
/* adjust for any interrupts that came in */
+#ifdef USE_DEBUGGER
+ cpustate->total_icount += cpustate->extra_cycles;
+#endif
cpustate->icount -= cpustate->extra_cycles;
cpustate->extra_cycles = 0;
} else {
now_debugging = false;
}
+ cpustate->debugger->add_cpu_trace(cpustate->pc);
+ int first_icount = cpustate->icount;
cpustate->seg_prefix = FALSE;
cpustate->prevpc = cpustate->pc;
TABLE86;
+ cpustate->total_icount += first_icount - cpustate->icount;
#ifdef SINGLE_MODE_DMA
if(cpustate->dma != NULL) {
cpustate->dma->do_dma();
cpustate->io = cpustate->io_stored;
}
} else {
+ cpustate->debugger->add_cpu_trace(cpustate->pc);
+ int first_icount = cpustate->icount;
#endif
cpustate->seg_prefix = FALSE;
cpustate->prevpc = cpustate->pc;
TABLE86;
+#ifdef USE_DEBUGGER
+ cpustate->total_icount += first_icount - cpustate->icount;
+#endif
#ifdef SINGLE_MODE_DMA
if(cpustate->dma != NULL) {
cpustate->dma->do_dma();
}
#endif
/* adjust for any interrupts that came in */
+#ifdef USE_DEBUGGER
+ cpustate->total_icount += cpustate->extra_cycles;
+#endif
cpustate->icount -= cpustate->extra_cycles;
cpustate->extra_cycles = 0;
}
/* if busreq is raised, spin cpu while remained clock */
if (cpustate->icount > 0 && cpustate->busreq) {
+#ifdef USE_DEBUGGER
+ cpustate->total_icount += cpustate->icount;
+#endif
cpustate->icount = 0;
}
return base_icount - cpustate->icount;
int passed_icount = max(1, cpustate->extra_cycles);
// this is main cpu, cpustate->icount is not used
/*cpustate->icount = */cpustate->extra_cycles = 0;
+#ifdef USE_DEBUGGER
+ cpustate->total_icount += passed_icount;
+#endif
return passed_icount;
} else {
cpustate->icount += icount;
if (cpustate->icount > 0) {
cpustate->icount = 0;
}
+#ifdef USE_DEBUGGER
+ cpustate->total_icount += base_icount - cpustate->icount;
+#endif
return base_icount - cpustate->icount;
}
}
timing = i80186_cycles;
/* adjust for any interrupts that came in */
+#ifdef USE_DEBUGGER
+ cpustate->total_icount += cpustate->extra_cycles;
+#endif
cpustate->icount -= cpustate->extra_cycles;
cpustate->extra_cycles = 0;
} else {
now_debugging = false;
}
+ cpustate->debugger->add_cpu_trace(cpustate->pc);
+ int first_icount = cpustate->icount;
cpustate->seg_prefix = FALSE;
cpustate->prevpc = cpustate->pc;
TABLE186;
+ cpustate->total_icount += first_icount - cpustate->icount;
#ifdef SINGLE_MODE_DMA
if (cpustate->dma != NULL) {
cpustate->dma->do_dma();
cpustate->io = cpustate->io_stored;
}
} else {
+ cpustate->debugger->add_cpu_trace(cpustate->pc);
+ int first_icount = cpustate->icount;
#endif
cpustate->seg_prefix = FALSE;
cpustate->prevpc = cpustate->pc;
TABLE186;
+#ifdef USE_DEBUGGER
+ cpustate->total_icount += first_icount - cpustate->icount;
+#endif
#ifdef SINGLE_MODE_DMA
if (cpustate->dma != NULL) {
cpustate->dma->do_dma();
}
#endif
/* adjust for any interrupts that came in */
+#ifdef USE_DEBUGGER
+ cpustate->total_icount += cpustate->extra_cycles;
+#endif
cpustate->icount -= cpustate->extra_cycles;
cpustate->extra_cycles = 0;
}
/* if busreq is raised, spin cpu while remained clock */
if (cpustate->icount > 0 && cpustate->busreq) {
+#ifdef USE_DEBUGGER
+ cpustate->total_icount += cpustate->icount;
+#endif
cpustate->icount = 0;
}
return base_icount - cpustate->icount;
int passed_icount = max(1, cpustate->extra_cycles);
// this is main cpu, cpustate->icount is not used
/*cpustate->icount = */cpustate->extra_cycles = 0;
+#ifdef USE_DEBUGGER
+ cpustate->total_icount += passed_icount;
+#endif
return passed_icount;
} else {
cpustate->icount += icount;
if (cpustate->icount > 0) {
cpustate->icount = 0;
}
+#ifdef USE_DEBUGGER
+ cpustate->total_icount += base_icount - cpustate->icount;
+#endif
return base_icount - cpustate->icount;
}
}
timing = i80186_cycles;
/* adjust for any interrupts that came in */
+#ifdef USE_DEBUGGER
+ cpustate->total_icount += cpustate->extra_cycles;
+#endif
cpustate->icount -= cpustate->extra_cycles;
cpustate->extra_cycles = 0;
} else {
now_debugging = false;
}
+ cpustate->debugger->add_cpu_trace(cpustate->pc);
+ int first_icount = cpustate->icount;
cpustate->seg_prefix = FALSE;
cpustate->prevpc = cpustate->pc;
TABLEV30;
+ cpustate->total_icount += first_icount - cpustate->icount;
#ifdef SINGLE_MODE_DMA
if (cpustate->dma != NULL) {
cpustate->dma->do_dma();
cpustate->io = cpustate->io_stored;
}
} else {
+ cpustate->debugger->add_cpu_trace(cpustate->pc);
+ int first_icount = cpustate->icount;
#endif
cpustate->seg_prefix = FALSE;
cpustate->prevpc = cpustate->pc;
TABLEV30;
+#ifdef USE_DEBUGGER
+ cpustate->total_icount += first_icount - cpustate->icount;
+#endif
#ifdef SINGLE_MODE_DMA
if (cpustate->dma != NULL) {
cpustate->dma->do_dma();
}
#endif
/* adjust for any interrupts that came in */
+#ifdef USE_DEBUGGER
+ cpustate->total_icount += cpustate->extra_cycles;
+#endif
cpustate->icount -= cpustate->extra_cycles;
cpustate->extra_cycles = 0;
}
/* if busreq is raised, spin cpu while remained clock */
if (cpustate->icount > 0 && cpustate->busreq) {
+#ifdef USE_DEBUGGER
+ cpustate->total_icount += cpustate->icount;
+#endif
cpustate->icount = 0;
}
return base_icount - cpustate->icount;
tmp2 = FETCH;
tmp2 += FETCH << 8;
-//#ifdef I86_PSEUDO_BIOS
- //if(cpustate->bios != NULL && cpustate->bios->bios_call_i86(((tmp2 << 4) + tmp) & AMASK, cpustate->regs.w, cpustate->sregs, &cpustate->ZeroVal, &cpustate->CarryVal)) {
+ ICOUNT -= timing.call_far;
if(BIOS_CALL_86(cpustate, ((tmp2 << 4) + tmp) & AMASK)) {
- ICOUNT -= timing.call_far;
+ ICOUNT -= timing.ret_far;
return;
}
-//#endif
ip = cpustate->pc - cpustate->base[CS];
cs = cpustate->sregs[CS];
#endif
PUSH(cs);
PUSH(ip);
- ICOUNT -= timing.call_far;
CHANGE_PC(cpustate->pc);
}
{
unsigned int_num = FETCH;
ICOUNT -= timing.int_imm;
+
#ifdef I86_PSEUDO_BIOS
if(cpustate->bios != NULL && cpustate->bios->bios_int_i86(int_num, cpustate->regs.w, cpustate->sregs, &cpustate->ZeroVal, &cpustate->CarryVal)) {
+ ICOUNT -= timing.iret;
return;
}
#endif
WORD ip, tmp;
FETCHWORD(tmp);
-//#ifdef I86_PSEUDO_BIOS
- //if(cpustate->bios != NULL && cpustate->bios->bios_call_i86((cpustate->pc + tmp) & AMASK, cpustate->regs.w, cpustate->sregs, &cpustate->ZeroVal, &cpustate->CarryVal)) {
- if(BIOS_CALL_86(cpustate, (cpustate->pc + tmp) & AMASK)) {
- ICOUNT -= timing.call_near;
- return;
- }
-//#endif
ip = cpustate->pc - cpustate->base[CS];
PUSH(ip);
ip += tmp;
case 0x10: /* CALL ew */
ICOUNT -= (ModRM >= 0xc0) ? timing.call_r16 : timing.call_m16;
tmp = GetRMWord(ModRM);
-//#ifdef I86_PSEUDO_BIOS
- //if(cpustate->bios != NULL && cpustate->bios->bios_call_i86((cpustate->base[CS] + (WORD)tmp) & AMASK, cpustate->regs.w, cpustate->sregs, &cpustate->ZeroVal, &cpustate->CarryVal)) {
- if(BIOS_CALL_86(cpustate, (cpustate->base[CS] + (WORD)tmp) & AMASK)) {
- ICOUNT -= timing.call_far;
- return;
- }
-//#endif
ip = cpustate->pc - cpustate->base[CS];
PUSH(ip);
cpustate->pc = (cpustate->base[CS] + (WORD)tmp) & AMASK;
tmp = cpustate->sregs[CS]; /* HJB 12/13/98 need to skip displacements of cpustate->ea */
tmp1 = GetRMWord(ModRM);
tmp2 = GetnextRMWord;
-//#ifdef I86_PSEUDO_BIOS
- // if(cpustate->bios != NULL && cpustate->bios->bios_call_i86(((tmp2 << 4) + tmp1) & AMASK, cpustate->regs.w, cpustate->sregs, &cpustate->ZeroVal, &cpustate->CarryVal)) {
if(BIOS_CALL_86(cpustate, ((tmp2 << 4) + tmp1) & AMASK)) {
+ ICOUNT -= timing.ret_far;
return;
}
//#endif
WM((Addr + 1) & 0xffff, p->b.l);
}
-//#if defined(HAS_MC6801) || defined(HAS_HD6301)
-//#else
+void MC6800::increment_counter(int amount)
+{
+ total_icount += amount;
+ icount -= amount;
+}
-#define increment_counter(amount) icount -= amount
-//#endif
-static const uint8_t MC6800::flags8i[256] = {
+const uint8_t MC6800::flags8i[256] = {
/* increment */
0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08,0x08
};
-static const uint8_t MC6800::flags8d[256] = {
+const uint8_t MC6800::flags8d[256] = {
/* decrement */
0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
// run cpu
if(clock == -1) {
// run only one opcode
-//#if defined(HAS_MC6801) || defined(HAS_HD6301)
-// CLEANUP_COUNTERS();
-//#endif
icount = 0;
-//#ifdef USE_DEBUGGER
- if(__USE_DEBUGGER) {
- bool now_debugging = d_debugger->now_debugging;
- if(now_debugging) {
- d_debugger->check_break_points(PC);
- if(d_debugger->now_suspended) {
- emu->mute_sound();
- d_debugger->now_waiting = true;
- while(d_debugger->now_debugging && d_debugger->now_suspended) {
- emu->sleep(10);
- }
- d_debugger->now_waiting = false;
- }
- if(d_debugger->now_debugging) {
- d_mem = d_debugger;
- } else {
- now_debugging = false;
- }
-
- run_one_opecode();
-
- if(now_debugging) {
- if(!d_debugger->now_going) {
- d_debugger->now_suspended = true;
- }
- d_mem = d_mem_stored;
- }
-
- } else {
-//#endif
- run_one_opecode();
- }
- } else {
- run_one_opecode();
-//#ifdef USE_DEBUGGER
- }
-//#endif
+ run_one_opecode();
return -icount;
- }
- /* run cpu while given clocks */
-//#if defined(HAS_MC6801) || defined(HAS_HD6301)
-// CLEANUP_COUNTERS();
-//#endif
+ } else {
+ /* run cpu while given clocks */
icount += clock;
int first_icount = icount;
-
+
while(icount > 0) {
-//#ifdef USE_DEBUGGER
+ run_one_opecode();
+ }
+ return first_icount - icount;
+ }
+ return 1;
+}
+
+
+void MC6800::run_one_opecode()
+{
+ if(wai_state & (MC6800_WAI | HD6301_SLP)) {
+ increment_counter(1);
+ } else {
+ do {
+ one_more_insn = false;
if(__USE_DEBUGGER) {
bool now_debugging = d_debugger->now_debugging;
if(now_debugging) {
now_debugging = false;
}
- run_one_opecode();
+ d_debugger->add_cpu_trace(PC);
+ uint8_t ireg = M_RDOP(PCD);
+ prevpc = PC;
+ PC++;
+ insn(ireg);
+ increment_counter(cycles[ireg]);
if(now_debugging) {
if(!d_debugger->now_going) {
d_mem = d_mem_stored;
}
} else {
-//#endif
- run_one_opecode();
+ if(__USE_DEBUGGER) d_debugger->add_cpu_trace(PC);
+ uint8_t ireg = M_RDOP(PCD);
+ prevpc = PC;
+ PC++;
+ insn(ireg);
+ increment_counter(cycles[ireg]);
}
} else {
- run_one_opecode();
-//#ifdef USE_DEBUGGER
+ uint8_t ireg = M_RDOP(PCD);
+ prevpc = PC;
+ PC++;
+ insn(ireg);
+ increment_counter(cycles[ireg]);
}
-//#endif
- }
- return first_icount - icount;
-}
-
-
-void MC6800::run_one_opecode()
-{
- if(wai_state & (MC6800_WAI | HD6301_SLP)) {
- increment_counter(1);
- } else {
- uint8_t ireg = M_RDOP(PCD);
- prevpc = PC;
- PC++;
- insn(ireg);
- increment_counter(cycles[ireg]);
+ } while(one_more_insn);
}
// check interrupt
void MC6800::get_debug_regs_info(_TCHAR *buffer, size_t buffer_len)
{
my_stprintf_s(buffer, buffer_len,
- _T("CCR = [%c%c%c%c%c%c] A = %02X B = %02X IX = %04X PC = %04X SP = %04X"),
- (CC & 0x01) ? _T('C') : _T('-'), (CC & 0x02) ? _T('V') : _T('-'), (CC & 0x04) ? _T('Z') : _T('-'), (CC & 0x08) ? _T('N') : _T('-'),
- (CC & 0x10) ? _T('I') : _T('-'), (CC & 0x20) ? _T('X') : _T('-'), A, B, X, PC, S);
+ _T("CCR = [%c%c%c%c%c%c] A = %02X B = %02X IX = %04X PC = %04X SP = %04X\nTotal CPU Clocks = %llu (%llu)"),
+ (CC & 0x01) ? _T('C') : _T('-'), (CC & 0x02) ? _T('V') : _T('-'), (CC & 0x04) ? _T('Z') : _T('-'), (CC & 0x08) ? _T('N') : _T('-'
+),
+ (CC & 0x10) ? _T('I') : _T('-'), (CC & 0x20) ? _T('X') : _T('-'), A, B, X, PC, S,
+ total_icount, total_icount - prev_total_icount);
+ prev_total_icount = total_icount;
}
/*
void MC6800::enter_interrupt(uint16_t irq_vector)
{
if(wai_state & MC6800_WAI) {
+ total_icount += 4;
icount -= 4;
wai_state &= ~MC6800_WAI;
} else {
PUSHBYTE(A);
PUSHBYTE(B);
PUSHBYTE(CC);
+ total_icount += 12;
icount -= 12;
}
SEI;
void MC6800::tap()
{
CC = A;
- ONE_MORE_INSN();
+// ONE_MORE_INSN();
+ one_more_insn = true;
}
/* $07 TPA inherent ----- */
void MC6800::cli()
{
CLI;
- ONE_MORE_INSN();
+// ONE_MORE_INSN();
+ one_more_insn = true;
}
/* $0f SEI */
void MC6800::sei()
{
SEI;
- ONE_MORE_INSN();
+// ONE_MORE_INSN();
+ one_more_insn = true;
}
/* $10 SBA inherent -**** */
WM16(EAD, &pX);
}
-#define STATE_VERSION 1
+#define STATE_VERSION 2
void MC6800::save_state(FILEIO* state_fio)
{
state_fio->FputUint8(cc);
state_fio->FputInt32(wai_state);
state_fio->FputInt32(int_state);
+//#ifdef USE_DEBUGGER
+ if(__USE_DEBUGGER) state_fio->FputUint64(total_icount);
+//#endif
state_fio->FputInt32(icount);
}
cc = state_fio->FgetUint8();
wai_state = state_fio->FgetInt32();
int_state = state_fio->FgetInt32();
+//#ifdef USE_DEBUGGER
+ if(__USE_DEBUGGER) { total_icount = prev_total_icount = state_fio->FgetUint64(); }
+//#endif
icount = state_fio->FgetInt32();
return true;
}
int wai_state;
int int_state;
+
+ uint64_t total_icount;
+ uint64_t prev_total_icount;
+
int icount;
+ bool one_more_insn;
virtual uint32_t RM(uint32_t Addr);
virtual void WM(uint32_t Addr, uint32_t Value);
void WM16(uint32_t Addr, pair_t *p);
+ virtual void increment_counter(int amount);
virtual void run_one_opecode();
void enter_interrupt(uint16_t irq_vector);
virtual void insn(uint8_t code);
void MC6801::increment_counter(int amount)
{
+ total_icount += amount;
icount -= amount;
// timer
int MC6801::run(int clock)
{
- // run cpu
- if(clock == -1) {
- // run only one opcode
-//#if defined(HAS_MC6801) || defined(HAS_HD6301)
- CLEANUP_COUNTERS();
-//#endif
- icount = 0;
- if(__USE_DEBUGGER) {
-//#ifdef USE_DEBUGGER
- bool now_debugging = d_debugger->now_debugging;
- if(now_debugging) {
- d_debugger->check_break_points(PC);
- if(d_debugger->now_suspended) {
- emu->mute_sound();
- d_debugger->now_waiting = true;
- while(d_debugger->now_debugging && d_debugger->now_suspended) {
- emu->sleep(10);
- }
- d_debugger->now_waiting = false;
- }
- if(d_debugger->now_debugging) {
- d_mem = d_debugger;
- } else {
- now_debugging = false;
- }
-
- run_one_opecode();
-
- if(now_debugging) {
- if(!d_debugger->now_going) {
- d_debugger->now_suspended = true;
- }
- d_mem = d_mem_stored;
- }
- } else {
-//#endif
- run_one_opecode();
- }
- } else {
- run_one_opecode();
-//#ifdef USE_DEBUGGER
- }
-//#endif
- return -icount;
+ // run cpu
+ if(clock == -1) {
+ // run only one opcode
+
+ CLEANUP_COUNTERS();
+
+ icount = 0;
+ run_one_opecode();
+ return -icount;
+ } else {
+ /* run cpu while given clocks */
+
+ CLEANUP_COUNTERS();
+
+ icount += clock;
+ int first_icount = icount;
+
+ while(icount > 0) {
+ run_one_opecode();
+ }
+ return first_icount - icount;
+ }
+}
+
+void MC6801::run_one_opecode()
+{
+ if(wai_state & (MC6800_WAI | HD6301_SLP)) {
+ increment_counter(1);
} else {
- /* run cpu while given clocks */
-//#if defined(HAS_MC6801) || defined(HAS_HD6301)
- CLEANUP_COUNTERS();
-//#endif
- icount += clock;
- int first_icount = icount;
-
- while(icount > 0) {
-//#ifdef USE_DEBUGGER
+ do {
+ one_more_insn = false;
if(__USE_DEBUGGER) {
bool now_debugging = d_debugger->now_debugging;
if(now_debugging) {
if(d_debugger->now_debugging) {
d_mem = d_debugger;
} else {
- now_debugging = false;
+ now_debugging = false;
}
- run_one_opecode();
+ d_debugger->add_cpu_trace(PC);
+ uint8_t ireg = M_RDOP(PCD);
+ prevpc = PC;
+ PC++;
+ insn(ireg);
+ increment_counter(cycles[ireg]);
if(now_debugging) {
if(!d_debugger->now_going) {
d_mem = d_mem_stored;
}
} else {
-//#endif
- run_one_opecode();
-//#ifdef USE_DEBUGGER
+ if(__USE_DEBUGGER) d_debugger->add_cpu_trace(PC);
+ uint8_t ireg = M_RDOP(PCD);
+ prevpc = PC;
+ PC++;
+ insn(ireg);
+ increment_counter(cycles[ireg]);
}
} else {
- run_one_opecode();
+ uint8_t ireg = M_RDOP(PCD);
+ prevpc = PC;
+ PC++;
+ insn(ireg);
+ increment_counter(cycles[ireg]);
}
-//#endif
- }
- return first_icount - icount;
- }
-}
-
-void MC6801::run_one_opecode()
-{
- if(wai_state & (MC6800_WAI | HD6301_SLP)) {
- increment_counter(1);
- } else {
- uint8_t ireg = M_RDOP(PCD);
- prevpc = PC;
- PC++;
- insn(ireg);
- increment_counter(cycles[ireg]);
+ } while(one_more_insn);
}
// check interrupt
WM16(EAD, &pD);
}
-#define STATE_VERSION 1
+#define STATE_VERSION 2
void MC6801::save_state(FILEIO* state_fio)
{
state_fio->FputUint8(cc);
state_fio->FputInt32(wai_state);
state_fio->FputInt32(int_state);
+ if(__USE_DEBUGGER) state_fio->FputUint64(total_icount);
state_fio->FputInt32(icount);
//#if defined(HAS_MC6801) || defined(HAS_HD6301)
for(int i = 0; i < 4; i++) {
cc = state_fio->FgetUint8();
wai_state = state_fio->FgetInt32();
int_state = state_fio->FgetInt32();
+ if(__USE_DEBUGGER) { total_icount = prev_total_icount = state_fio->FgetUint64(); }
icount = state_fio->FgetInt32();
//#if defined(HAS_MC6801) || defined(HAS_HD6301)
for(int i = 0; i < 4; i++) {
#include "../i8237.h"
#include "../i8255.h"
#include "../i8259.h"
-#if defined(HAS_I286) || defined(HAS_I186)
+//#if defined(HAS_I286) || defined(HAS_I186)
#include "../i286.h"
-#else
-#include "../i86.h"
-#endif
+//#else
+//#include "../i86.h"
+//#endif
#include "../io.h"
#include "../ls393.h"
#include "../mz1p17.h"
dma = new I8237(this, emu);
pio = new I8255(this, emu);
pic = new I8259(this, emu);
-#if defined(HAS_I286) || defined(HAS_I186)
+//#if defined(HAS_I286) || defined(HAS_I186)
cpu = new I286(this, emu);
-#else
- cpu = new I86(this, emu);
-#endif
+//#else
+// cpu = new I86(this, emu);
+//#endif
io = new IO(this, emu);
div = new LS393(this, emu);
not_data0 = new NOT(this, emu);
class I8237;
class I8255;
class I8259;
-#if defined(HAS_I286) || defined(HAS_I186)
+//#if defined(HAS_I286) || defined(HAS_I186)
class I286;
-#else
-class I86;
-#endif
+//#else
+//class I86;
+//#endif
class IO;
class LS393;
class NOT;
I8237* dma;
I8255* pio;
I8259* pic; // includes 2chips
-#if defined(HAS_I286) || defined(HAS_I186)
+//#if defined(HAS_I286) || defined(HAS_I186)
I286* cpu;
-#else
- I86* cpu;
-#endif
+//#else
+// I86* cpu;
+//#endif
IO* io;
LS393* div;
NOT* not_data0;
#include "../upd7220.h"
#include "../upd765a.h"
+#ifdef USE_DEBUGGER
+#include "../debugger.h"
+#endif
+
#include "display.h"
#include "floppy.h"
#include "keyboard.h"
cpu->set_context_mem(memory);
cpu->set_context_io(io);
cpu->set_context_intr(pic);
+#ifdef USE_DEBUGGER
+ cpu->set_context_debugger(new DEBUGGER(this, emu));
+#endif
// i/o bus
io->set_iomap_alias_w(0x00, pic, 0);
}
// ----------------------------------------------------------------------------
+// debugger
+// ----------------------------------------------------------------------------
+
+#ifdef USE_DEBUGGER
+DEVICE *VM::get_cpu(int index)
+{
+ if(index == 0) {
+ return cpu;
+ }
+ return NULL;
+}
+#endif
+
+// ----------------------------------------------------------------------------
// draw screen
// ----------------------------------------------------------------------------
#define USE_AUTO_KEY_NUMPAD
#define USE_SCREEN_FILTER
#define USE_SOUND_VOLUME 2
+#define USE_DEBUGGER
+
#include "../../common.h"
#include "../../fileio.h"
void reset();
void run();
+#ifdef USE_DEBUGGER
+ // debugger
+ DEVICE *get_cpu(int index);
+#endif
+
// draw screen
void draw_screen();
#include "../i8251.h"
#include "../i8255.h"
#include "../i8259.h"
-#include "../i86.h"
+#include "../i286.h"
#include "../io.h"
#include "../memory.h"
#include "../msm58321.h"
pio1 = new I8255(this, emu);
pio1->set_device_name(_T("8255 PIO (CRTC)"));
pic = new I8259(this, emu);
- cpu = new I86(this, emu);
+ cpu = new I286(this, emu);
io = new IO(this, emu);
memory = new MEMORY(this, emu);
rtc = new MSM58321(this, emu);
class I8251;
class I8255;
class I8259;
-class I86;
+class I286;
class IO;
class MEMORY;
class MSM58321;
I8255* pio0;
I8255* pio1;
I8259* pic; // includes 2chips
- I86* cpu;
+ I286* cpu;
IO* io;
MEMORY* memory;
MSM58321* rtc;
if(exitline != -1) {
for(int cy = exitline; cy < 200; cy++) {
memset(&text.expand[cy][0], 0, width);
- memset(&attrib.expand[cy][0], 0, width);
+ memset(&attrib.expand[cy][0], 0xe0, width); // color=7
}
}
}
#include "../i8253.h"
#include "../i8255.h"
#include "../i8259.h"
-#if defined(HAS_V30) || defined(HAS_I86)
-# include "../i86.h"
-#else
+//#if defined(HAS_V30) || defined(HAS_I86)
+//# include "../i86.h"
+//#else
# include "../i286.h"
-#endif
+//#endif
#include "../io.h"
#include "../noise.h"
#include "../not.h"
pio_prn = new I8255(this, emu); // for printer
pio_prn->set_device_name(_T("8251 PIO (Printer)"));
pic = new I8259(this, emu); // V50 internal
-#if defined(HAS_V30) || defined(HAS_I86)
- cpu = new I86(this, emu); // V50
-#else
+//#if defined(HAS_V30) || defined(HAS_I86)
+// cpu = new I86(this, emu); // V50
+//#else
cpu = new I286(this, emu); // V50
-#endif
+//#endif
io = new IO(this, emu);
not_busy = new NOT(this, emu);
#ifdef _PC98HA
class I8253;
class I8255;
class I8259;
-#if defined(HAS_V30) || defined(HAS_I86)
-class I86;
-#else
+//#if defined(HAS_V30) || defined(HAS_I86)
+//class I86;
+//#else
class I286;
-#endif
+//#endif
class IO;
class NOT;
#ifdef _PC98HA
I8255* pio_sys;
I8255* pio_prn;
I8259* pic;
-#if defined(HAS_V30) || defined(HAS_I86)
- I86* cpu;
-#else
+//#if defined(HAS_V30) || defined(HAS_I86)
+// I86* cpu;
+//#else
I286* cpu;
-#endif
+//#endif
IO* io;
NOT* not_busy;
#ifdef _PC98HA
now_debugging = false;
}
+ int first_count = count;
run_one_opecode_tmp();
+ total_count += first_count - count;
if(now_debugging) {
if(!d_debugger->now_going) {
d_mem_tmp = d_io_tmp = this;
}
} else {
+ int first_count = count;
run_one_opecode_tmp();
+ total_count += first_count - count;
}
}
void TMS9995::run_one_opecode_tmp()
period += 8;
} else {
int_enabled = true;
+#ifdef USE_DEBUGGER
+ d_debugger->add_cpu_trace(PC);
+#endif
prevPC = PC;
uint16_t op = FETCH16();
execute(op);
PC = 0000 WP = 0000
R0 = 0000 R1 = 0000 R2 = 0000 R3 = 0000 R4 = 0000 R5 = 0000 R6 = 0000 R7 = 0000
R8 = 0000 R9 = 0000 R10= 0000 R11= 0000 R12= 0000 R13= 0000 R14= 0000 R15= 0000
+Total CPU Clocks = 0 (0)
*/
my_stprintf_s(buffer, buffer_len,
- _T("ST = %04X [LGT:%01X AGT:%01X EQ:%01X C:%01X OV:%01X OP:%01X X:%01X OVIE:%01X IM:%01X]\nPC = %04X WP = %04X\nR0 = %04X R1 = %04X R2 = %04X R3 = %04X R4 = %04X R5 = %04X R6 = %04X R7 = %04X\nR8 = %04X R9 = %04X R10= %04X R11= %04X R12= %04X R13= %04X R14= %04X R15= %04X"),
+ _T("ST = %04X [LGT:%01X AGT:%01X EQ:%01X C:%01X OV:%01X OP:%01X X:%01X OVIE:%01X IM:%01X]\nPC = %04X WP = %04X\nR0 = %04X R1 = %04X R2 = %04X R3 = %04X R4 = %04X R5 = %04X R6 = %04X R7 = %04X\nR8 = %04X R9 = %04X R10= %04X R11= %04X R12= %04X R13= %04X R14= %04X R15= %04X\nTotal CPU Clocks = %llu (%llu)"),
ST,
(ST & ST_LGT ) ? 1 : 0,
(ST & ST_AGT ) ? 1 : 0,
this->read_data16((WP + R12) & 0xffff),
this->read_data16((WP + R13) & 0xffff),
this->read_data16((WP + R14) & 0xffff),
- this->read_data16((WP + R15) & 0xffff));
+ this->read_data16((WP + R15) & 0xffff),
+ total_count, total_count - prev_total_count);
+ prev_total_count = total_count;
}
// disassembler
}
#endif
-#define STATE_VERSION 1
+#define STATE_VERSION 2
void TMS9995::save_state(FILEIO* state_fio)
{
state_fio->FputUint32(STATE_VERSION);
state_fio->FputInt32(this_device_id);
+#ifdef USE_DEBUGGER
+ state_fio->FputUint64(total_count);
+#endif
state_fio->FputInt32(count);
state_fio->FputInt32(period);
state_fio->FputUint16(WP);
if(state_fio->FgetInt32() != this_device_id) {
return false;
}
+#ifdef USE_DEBUGGER
+ total_count = prev_total_count = state_fio->FgetUint64();
+#endif
count = state_fio->FgetInt32();
period = state_fio->FgetInt32();
WP = state_fio->FgetUint16();
#endif
// clocks
+#ifdef USE_DEBUGGER
+ uint64_t total_count;
+ uint64_t prev_total_count;
+#endif
int count, period;
// register
uint16_t WP, PC, prevPC, ST;
TMS9995(VM* parent_vm, EMU* parent_emu) : DEVICE(parent_vm, parent_emu)
{
// init registers
+#ifdef USE_DEBUGGER
+ total_count = prev_total_count = 0;
+#endif
WP = PC = ST = 0;
memset(RAM, 0, sizeof(RAM));
irq_level = int_state = int_latch = 0;
}
// run 1 opecode
+#ifdef USE_DEBUGGER
+ d_debugger->add_cpu_trace(PC);
+#endif
period = 0;
prevPC = PC;
OP();
}
+
+ total_count += period;
+
count -= period;
// update serial count
VA = 0000 BC = 0000 DE = 0000 HL = 0000 PSW= 00 [Z SK HC L1 L0 CY]
VA'= 0000 BC'= 0000 DE'= 0000 HL'= 0000 SP = 0000 PC = 0000
(BC)= 0000 (DE)=0000 (HL)= 0000 (SP)= 0000 <DI>
+Total CPU Clocks = 0 (0)
*/
int wait;
my_stprintf_s(buffer, buffer_len,
- _T("VA = %04X BC = %04X DE = %04X HL = %04X PSW= %02x [%s %s %s %s %s %s]\nVA'= %04X BC'= %04X DE'= %04X HL'= %04X SP = %04X PC = %04X\n (BC)= %04X (DE)=%04X (HL)= %04X (SP)= %04X <%s>"),
+ _T("VA = %04X BC = %04X DE = %04X HL = %04X PSW= %02x [%s %s %s %s %s %s]\nVA'= %04X BC'= %04X DE'= %04X HL'= %04X SP = %04X PC = %04X\n (BC)= %04X (DE)=%04X (HL)= %04X (SP)= %04X <%s>\nTotal CPU Clocks = %llu (%llu)"),
VA, BC, DE, HL, PSW,
(PSW & F_Z) ? _T("Z") : _T("-"), (PSW & F_SK) ? _T("SK") : _T("--"), (PSW & F_HC) ? _T("HC") : _T("--"), (PSW & F_L1) ? _T("L1") : _T("--"), (PSW & F_L0) ? _T("L0") : _T("--"), (PSW & F_CY) ? _T("CY") : _T("--"),
altVA, altBC, altDE, altHL, SP, PC,
d_mem_stored->read_data16w(BC, &wait), d_mem_stored->read_data16w(DE, &wait), d_mem_stored->read_data16w(HL, &wait), d_mem_stored->read_data16w(SP, &wait),
- IFF ? _T("EI") : _T("DI"));
+ IFF ? _T("EI") : _T("DI"),
+ total_count, total_count - prev_total_count);
+ prev_total_count = total_count;
}
// disassembler
}
}
-#define STATE_VERSION 3
+#define STATE_VERSION 4
void UPD7801::save_state(FILEIO* state_fio)
{
state_fio->FputUint32(STATE_VERSION);
state_fio->FputInt32(this_device_id);
+#ifdef USE_DEBUGGER
+ state_fio->FputUint64(total_count);
+#endif
state_fio->FputInt32(count);
state_fio->FputInt32(period);
state_fio->FputInt32(scount);
if(state_fio->FgetInt32() != this_device_id) {
return false;
}
+#ifdef USE_DEBUGGER
+ total_count = prev_total_count = state_fio->FgetUint64();
+#endif
count = state_fio->FgetInt32();
period = state_fio->FgetInt32();
scount = state_fio->FgetInt32();
registers
--------------------------------------------------------------------------- */
+
+ uint64_t total_count;
+ uint64_t prev_total_count;
+
int count, period, scount, tcount;
bool wait;
public:
UPD7801(VM* parent_vm, EMU* parent_emu) : DEVICE(parent_vm, parent_emu)
{
+
+ total_count = prev_total_count = 0;
+
initialize_output_signals(&outputs_so);
SI = SCK = false;
d_debugger = NULL;
if(clock == -1) {
if(busreq) {
// don't run cpu!
+#ifdef USE_DEBUGGER
+ total_icount += 1;
+#endif
return 1;
} else {
// run only one opcode
- return CPU_EXECUTE_CALL(upd7810);
+ return run_one_opecode();
}
} else {
icount += clock;
// run cpu while given clocks
while(icount > 0 && !busreq) {
- icount -= CPU_EXECUTE_CALL(upd7810);
+ icount -= run_one_opecode();
}
// if busreq is raised, spin cpu while remained clock
if(icount > 0 && busreq) {
+#ifdef USE_DEBUGGER
+ total_icount += icount;
+#endif
icount = 0;
}
return first_icount - icount;
}
}
+int UPD7810::run_one_opecode()
+{
+#ifdef USE_DEBUGGER
+ upd7810_state *cpustate = (upd7810_state *)opaque;
+ d_debugger->add_cpu_trace(cpustate->pc.w.l);
+#endif
+ int passed_icount = CPU_EXECUTE_CALL(upd7810);
+#ifdef USE_DEBUGGER
+ total_icount += passed_icount;
+#endif
+ return passed_icount;
+}
+
void UPD7810::write_signal(int id, uint32_t data, uint32_t mask)
{
upd7810_state *cpustate = (upd7810_state *)opaque;
VA = 0000 BC = 0000 DE = 0000 HL = 0000 PSW= 00 [Z SK HC L1 L0 CY]
VA'= 0000 BC'= 0000 DE'= 0000 HL'= 0000 SP = 0000 PC = 0000
(BC)= 0000 (DE)=0000 (HL)= 0000 (SP)= 0000 <DI>
+Total CPU Clocks = 0 (0)
*/
upd7810_state *cpustate = (upd7810_state *)opaque;
int wait;
my_stprintf_s(buffer, buffer_len,
- _T("VA = %04X BC = %04X DE = %04X HL = %04X PSW= %02x [%s %s %s %s %s %s]\nVA'= %04X BC'= %04X DE'= %04X HL'= %04X SP = %04X PC = %04X\n (BC)= %04X (DE)=%04X (HL)= %04X (SP)= %04X <%s>"),
+ _T("VA = %04X BC = %04X DE = %04X HL = %04X PSW= %02x [%s %s %s %s %s %s]\nVA'= %04X BC'= %04X DE'= %04X HL'= %04X SP = %04X PC = %04X\n (BC)= %04X (DE)=%04X (HL)= %04X (SP)= %04X <%s>\nTotal CPU Clocks = %llu (%llu)"),
VA, BC, DE, HL, PSW,
(PSW & Z) ? _T("Z") : _T("-"), (PSW & SK) ? _T("SK") : _T("--"), (PSW & HC) ? _T("HC") : _T("--"), (PSW & L1) ? _T("L1") : _T("--"), (PSW & L0) ? _T("L0") : _T("--"), (PSW & CY) ? _T("CY") : _T("--"),
VA2, BC2, DE2, HL2, SP, PC,
d_mem->read_data16w(BC, &wait), d_mem->read_data16w(DE, &wait), d_mem->read_data16w(HL, &wait), d_mem->read_data16w(SP, &wait),
- IFF ? _T("EI") : _T("DI"));
+ IFF ? _T("EI") : _T("DI"),
+ total_icount, total_icount - prev_total_icount);
+ prev_total_icount = total_icount;
}
// disassembler
}
#endif
-#define STATE_VERSION 3
+#define STATE_VERSION 4
void UPD7810::save_state(FILEIO* state_fio)
{
state_fio->FputInt32(this_device_id);
state_fio->Fwrite(opaque, sizeof(upd7810_state), 1);
+#ifdef USE_DEBUGGER
+ state_fio->FputUint64(total_icount);
+#endif
state_fio->FputInt32(icount);
state_fio->FputBool(busreq);
}
return false;
}
state_fio->Fread(opaque, sizeof(upd7810_state), 1);
+#ifdef USE_DEBUGGER
+ total_icount = prev_total_icount = state_fio->FgetUint64();
+#endif
icount = state_fio->FgetInt32();
busreq = state_fio->FgetBool();
outputs_t outputs_to;
outputs_t outputs_txd;
void *opaque;
+#ifdef USE_DEBUGGER
+ uint64_t total_icount;
+ uint64_t prev_total_icount;
+#endif
int icount;
bool busreq, rxd_status;
+ int run_one_opecode();
+
public:
UPD7810(VM* parent_vm, EMU* parent_emu) : DEVICE(parent_vm, parent_emu)
{
+#ifdef USE_DEBUGGER
+ total_icount = prev_total_icount = 0;
+#endif
initialize_output_signals(&outputs_to);
initialize_output_signals(&outputs_txd);
set_device_name(_T("uPD7810/7811 MCU"));
void Z80::check_interrupt()
{
+#ifdef USE_DEBUGGER
+ int first_icount = icount;
+#endif
// check interrupt
if(intr_req_bit) {
if(intr_req_bit & NMI_REQ_BIT) {
//#else
}
}
+#ifdef USE_DEBUGGER
+ total_icount += first_icount - icount;
+#endif
}
#ifdef USE_DEBUGGER
</FileConfiguration>
</File>
<File
- RelativePath="..\src\vm\i86.cpp"
+ RelativePath="..\src\vm\i286.cpp"
>
<FileConfiguration
Name="Debug|Win32"
Filter="h"
>
<File
+ RelativePath="..\src\vm\debugger.h"
+ >
+ </File>
+ <File
RelativePath="..\src\vm\device.h"
>
</File>
>
</File>
<File
- RelativePath="..\src\vm\i86.h"
+ RelativePath="..\src\vm\i286.h"
>
</File>
<File
</FileConfiguration>
</File>
<File
- RelativePath="..\src\vm\i86.cpp"
+ RelativePath="..\src\vm\i286.cpp"
>
<FileConfiguration
Name="Debug|Win32"
Filter="h"
>
<File
+ RelativePath="..\src\vm\debugger.h"
+ >
+ </File>
+ <File
RelativePath="..\src\vm\device.h"
>
</File>
>
</File>
<File
- RelativePath="..\src\vm\i86.h"
+ RelativePath="..\src\vm\i286.h"
>
</File>
<File
</FileConfiguration>
</File>
<File
- RelativePath="..\src\vm\i86.cpp"
+ RelativePath="..\src\vm\jx\i286.cpp"
>
<FileConfiguration
Name="Debug|Win32"
>
</File>
<File
- RelativePath="..\src\vm\i86.h"
+ RelativePath="..\src\vm\jx\i286.h"
>
</File>
<File
>
</File>
<File
+ RelativePath="..\src\vm\debugger.h"
+ >
+ </File>
+ <File
RelativePath="..\src\vm\device.h"
>
</File>
>
</File>
<File
+ RelativePath="..\src\vm\debugger.h"
+ >
+ </File>
+ <File
RelativePath="..\src\vm\device.h"
>
</File>
<ClInclude Include="..\src\vm\datarec.h">
<Filter>Header Files\VM Common Header Files</Filter>
</ClInclude>
+ <ClInclude Include="..\src\vm\debugger.h">
+ <Filter>Header Files\VM Common Header Files</Filter>
+ </ClInclude>
<ClInclude Include="..\src\vm\device.h">
<Filter>Header Files\VM Common Header Files</Filter>
</ClInclude>
<ClCompile Include="..\src\vm\i8237.cpp" />
<ClCompile Include="..\src\vm\i8253.cpp" />
<ClCompile Include="..\src\vm\i8259.cpp" />
- <ClCompile Include="..\src\vm\i86.cpp" />
+ <ClCompile Include="..\src\vm\i286.cpp" />
<ClCompile Include="..\src\vm\io.cpp" />
<ClCompile Include="..\src\vm\noise.cpp" />
<ClCompile Include="..\src\vm\pcm1bit.cpp" />
<ClInclude Include="..\src\fileio.h" />
<ClInclude Include="..\src\emu.h" />
<ClInclude Include="..\src\win32\osd.h" />
+ <ClInclude Include="..\src\vm\debugger.h" />
<ClInclude Include="..\src\vm\device.h" />
<ClInclude Include="..\src\vm\disk.h" />
<ClInclude Include="..\src\vm\event.h" />
<ClInclude Include="..\src\vm\i8237.h" />
<ClInclude Include="..\src\vm\i8253.h" />
<ClInclude Include="..\src\vm\i8259.h" />
- <ClInclude Include="..\src\vm\i86.h" />
+ <ClInclude Include="..\src\vm\i286.h" />
<ClInclude Include="..\src\vm\io.h" />
<ClInclude Include="..\src\vm\noise.h" />
<ClInclude Include="..\src\vm\pcm1bit.h" />
<ClCompile Include="..\src\vm\i8259.cpp">
<Filter>Source Files\VM Common Source Files</Filter>
</ClCompile>
- <ClCompile Include="..\src\vm\i86.cpp">
+ <ClCompile Include="..\src\vm\i286.cpp">
<Filter>Source Files\VM Common Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\vm\io.cpp">
<ClInclude Include="..\src\win32\osd.h">
<Filter>Header Files\OSD Header Files</Filter>
</ClInclude>
+ <ClInclude Include="..\src\vm\debugger.h">
+ <Filter>Header Files\VM Common Header Files</Filter>
+ </ClInclude>
<ClInclude Include="..\src\vm\device.h">
<Filter>Header Files\VM Common Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\vm\i8259.h">
<Filter>Header Files\VM Common Header Files</Filter>
</ClInclude>
- <ClInclude Include="..\src\vm\i86.h">
+ <ClInclude Include="..\src\vm\i286.h">
<Filter>Header Files\VM Common Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\vm\io.h">
<ClCompile Include="..\src\vm\i8237.cpp" />
<ClCompile Include="..\src\vm\i8253.cpp" />
<ClCompile Include="..\src\vm\i8259.cpp" />
- <ClCompile Include="..\src\vm\i86.cpp" />
+ <ClCompile Include="..\src\vm\i286.cpp" />
<ClCompile Include="..\src\vm\io.cpp" />
<ClCompile Include="..\src\vm\noise.cpp" />
<ClCompile Include="..\src\vm\pcm1bit.cpp" />
<ClInclude Include="..\src\fileio.h" />
<ClInclude Include="..\src\emu.h" />
<ClInclude Include="..\src\win32\osd.h" />
+ <ClInclude Include="..\src\vm\debugger.h" />
<ClInclude Include="..\src\vm\device.h" />
<ClInclude Include="..\src\vm\disk.h" />
<ClInclude Include="..\src\vm\event.h" />
<ClInclude Include="..\src\vm\i8237.h" />
<ClInclude Include="..\src\vm\i8253.h" />
<ClInclude Include="..\src\vm\i8259.h" />
- <ClInclude Include="..\src\vm\i86.h" />
+ <ClInclude Include="..\src\vm\i286.h" />
<ClInclude Include="..\src\vm\io.h" />
<ClInclude Include="..\src\vm\noise.h" />
<ClInclude Include="..\src\vm\pcm1bit.h" />
<ClCompile Include="..\src\vm\i8259.cpp">
<Filter>Source Files\VM Common Source Files</Filter>
</ClCompile>
- <ClCompile Include="..\src\vm\i86.cpp">
+ <ClCompile Include="..\src\vm\i286.cpp">
<Filter>Source Files\VM Common Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\vm\io.cpp">
<ClInclude Include="..\src\win32\osd.h">
<Filter>Header Files\OSD Header Files</Filter>
</ClInclude>
+ <ClInclude Include="..\src\vm\debugger.h">
+ <Filter>Header Files\VM Common Header Files</Filter>
+ </ClInclude>
<ClInclude Include="..\src\vm\device.h">
<Filter>Header Files\VM Common Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\vm\i8259.h">
<Filter>Header Files\VM Common Header Files</Filter>
</ClInclude>
- <ClInclude Include="..\src\vm\i86.h">
+ <ClInclude Include="..\src\vm\i286.h">
<Filter>Header Files\VM Common Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\vm\io.h">
<ClCompile Include="..\src\vm\i8253.cpp" />
<ClCompile Include="..\src\vm\i8255.cpp" />
<ClCompile Include="..\src\vm\i8259.cpp" />
- <ClCompile Include="..\src\vm\i86.cpp" />
+ <ClCompile Include="..\src\vm\jx\i286.cpp" />
<ClCompile Include="..\src\vm\io.cpp" />
<ClCompile Include="..\src\vm\memory.cpp" />
<ClCompile Include="..\src\vm\noise.cpp" />
<ClInclude Include="..\src\vm\i8253.h" />
<ClInclude Include="..\src\vm\i8255.h" />
<ClInclude Include="..\src\vm\i8259.h" />
- <ClInclude Include="..\src\vm\i86.h" />
+ <ClInclude Include="..\src\vm\jx\i286.h" />
<ClInclude Include="..\src\vm\io.h" />
<ClInclude Include="..\src\vm\memory.h" />
<ClInclude Include="..\src\vm\noise.h" />
<ClCompile Include="..\src\vm\i8259.cpp">
<Filter>Source Files\VM Common Source Files</Filter>
</ClCompile>
- <ClCompile Include="..\src\vm\i86.cpp">
+ <ClCompile Include="..\src\vm\jx\i286.cpp">
<Filter>Source Files\VM Common Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\vm\io.cpp">
<ClInclude Include="..\src\vm\i8259.h">
<Filter>Header Files\VM Common Header Files</Filter>
</ClInclude>
- <ClInclude Include="..\src\vm\i86.h">
+ <ClInclude Include="..\src\vm\jx\i286.h">
<Filter>Header Files\VM Common Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\vm\io.h">
<ClInclude Include="..\src\emu.h" />
<ClInclude Include="..\src\win32\osd.h" />
<ClInclude Include="..\src\vm\beep.h" />
+ <ClInclude Include="..\src\vm\debugger.h" />
<ClInclude Include="..\src\vm\device.h" />
<ClInclude Include="..\src\vm\disk.h" />
<ClInclude Include="..\src\vm\event.h" />
<ClInclude Include="..\src\vm\beep.h">
<Filter>Header Files\VM Common Header Files</Filter>
</ClInclude>
+ <ClInclude Include="..\src\vm\debugger.h">
+ <Filter>Header Files\VM Common Header Files</Filter>
+ </ClInclude>
<ClInclude Include="..\src\vm\device.h">
<Filter>Header Files\VM Common Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\emu.h" />
<ClInclude Include="..\src\win32\osd.h" />
<ClInclude Include="..\src\vm\datarec.h" />
+ <ClInclude Include="..\src\vm\debugger.h" />
<ClInclude Include="..\src\vm\device.h" />
<ClInclude Include="..\src\vm\event.h" />
<ClInclude Include="..\src\vm\io.h" />
<ClInclude Include="..\src\vm\datarec.h">
<Filter>Header Files\VM Common Header Files</Filter>
</ClInclude>
+ <ClInclude Include="..\src\vm\debugger.h">
+ <Filter>Header Files\VM Common Header Files</Filter>
+ </ClInclude>
<ClInclude Include="..\src\vm\device.h">
<Filter>Header Files\VM Common Header Files</Filter>
</ClInclude>
<ClInclude Include="..\src\vm\disk.h">
<Filter>Header Files\VM Common Header Files</Filter>
</ClInclude>
+ <ClInclude Include="..\src\vm\debugger.h">
+ <Filter>Header Files\VM Common Header Files</Filter>
+ </ClInclude>
<ClInclude Include="..\src\vm\device.h">
<Filter>Header Files\VM Common Header Files</Filter>
</ClInclude>