diff --git a/desmume/src/NDSSystem.cpp b/desmume/src/NDSSystem.cpp index 690279e2b..cacacccec 100644 --- a/desmume/src/NDSSystem.cpp +++ b/desmume/src/NDSSystem.cpp @@ -1988,24 +1988,25 @@ void execHardware_interrupts() { if((MMU.reg_IF[0]&MMU.reg_IE[0]) && (MMU.reg_IME[0])) { -//#ifdef GDB_STUB -// if ( armcpu_flagIrq( &NDS_ARM9)) -//#else + //TODO - remove GDB specific code +#ifdef GDB_STUB + if ( armcpu_flagIrq( &NDS_ARM9)) +#else if ( armcpu_irqException(&NDS_ARM9)) -//#endif +#endif { //printf("ARM9 interrupt! flags: %08X ; mask: %08X ; result: %08X\n",MMU.reg_IF[0],MMU.reg_IE[0],MMU.reg_IF[0]&MMU.reg_IE[0]); //nds.ARM9Cycle = nds.cycles; } } - +//TODO - remove GDB specific code if((MMU.reg_IF[1]&MMU.reg_IE[1]) && (MMU.reg_IME[1])) { -//#ifdef GDB_STUB -// if ( armcpu_flagIrq( &NDS_ARM7)) -//#else +#ifdef GDB_STUB + if ( armcpu_flagIrq( &NDS_ARM7)) +#else if ( armcpu_irqException(&NDS_ARM7)) -//#endif +#endif { //nds.ARM7Cycle = nds.cycles; } diff --git a/desmume/src/armcpu.cpp b/desmume/src/armcpu.cpp index 0f82b696e..99b311e20 100644 --- a/desmume/src/armcpu.cpp +++ b/desmume/src/armcpu.cpp @@ -111,14 +111,14 @@ armcpu_t NDS_ARM9; static void stall_cpu( void *instance) { armcpu_t *armcpu = (armcpu_t *)instance; - printf("UNSTALL\n"); + //printf("UNSTALL\n"); armcpu->stalled = 1; } static void unstall_cpu( void *instance) { armcpu_t *armcpu = (armcpu_t *)instance; - printf("UNSTALL\n"); + //printf("UNSTALL\n"); armcpu->stalled = 0; } @@ -507,32 +507,49 @@ BOOL armcpu_irqException(armcpu_t *armcpu) if(armcpu->CPSR.bits.I) return FALSE; -//#ifdef GDB_STUB -// armcpu->irq_flag = 0; -//#endif + //TODO - remove GDB specific code +#ifdef GDB_STUB + armcpu->irq_flag = 0; +#endif tmp = armcpu->CPSR; armcpu_switchMode(armcpu, IRQ); -//#ifdef GDB_STUB -// armcpu->R[14] = armcpu->next_instruction + 4; -//#else + //TODO - remove GDB specific code +#ifdef GDB_STUB + armcpu->R[14] = armcpu->next_instruction + 4; +#else armcpu->R[14] = armcpu->instruct_adr + 4; -//#endif +#endif armcpu->SPSR = tmp; armcpu->CPSR.bits.T = 0; armcpu->CPSR.bits.I = 1; armcpu->next_instruction = armcpu->intVector + 0x18; armcpu->waitIRQ = 0; -//#ifndef GDB_STUB + //TODO - remove GDB specific code +#ifndef GDB_STUB armcpu->R[15] = armcpu->next_instruction + 8; armcpu_prefetch(armcpu); -//#endif +#endif return TRUE; } +//TODO - remove GDB specific code +BOOL +armcpu_flagIrq( armcpu_t *armcpu) { + if(armcpu->CPSR.bits.I) return FALSE; + + armcpu->waitIRQ = 0; + +#ifdef GDB_STUB + armcpu->irq_flag = 1; +#endif + + return TRUE; +} + u32 TRAPUNDEF(armcpu_t* cpu) { LOG("Undefined instruction: %#08X PC = %#08X \n", cpu->instruction, cpu->instruct_adr); diff --git a/desmume/src/windows/DeSmuME_2005.vcproj b/desmume/src/windows/DeSmuME_2005.vcproj index fec748744..f2dd08a54 100644 --- a/desmume/src/windows/DeSmuME_2005.vcproj +++ b/desmume/src/windows/DeSmuME_2005.vcproj @@ -115,6 +115,204 @@ Name="VCPostBuildEventTool" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -995,7 +985,7 @@ /> + + + - - - @@ -1059,7 +1049,7 @@ /> + + + - - - @@ -1123,7 +1113,7 @@ /> + + + + + + + + + @@ -1176,16 +1196,6 @@ Outputs=".libs\libelf_libdwarf.tag" /> - - - @@ -1196,16 +1206,6 @@ Outputs=".libs\libelf_libdwarf.tag" /> - - - @@ -1230,16 +1230,6 @@ Outputs=".libs\lua.tag" /> - - - @@ -1251,7 +1241,7 @@ /> + + + - - - @@ -1315,7 +1305,7 @@ /> + + + - - - @@ -1444,7 +1435,7 @@ /> + + + +#include +#include #include #include #include diff --git a/desmume/src/windows/winpcap.h b/desmume/src/windows/winpcap.h index cd3b62384..6b7297072 100644 --- a/desmume/src/windows/winpcap.h +++ b/desmume/src/windows/winpcap.h @@ -34,7 +34,7 @@ typedef void (__cdecl *T_pcap_freealldevs)(pcap_if_t* alldevs); typedef pcap_t* (__cdecl *T_pcap_open_live)(const char* source, int snaplen, int flags, int readtimeout, char* errbuf); typedef void (__cdecl *T_pcap_close)(pcap_t* dev); typedef int (__cdecl *T_pcap_setnonblock)(pcap_t* dev, int nonblock, char* errbuf); -typedef int (__cdecl *T_pcap_sendpacket)(pcap_t* dev, const u_char* data, int len); +typedef int (__cdecl *T_pcap_send)(pcap_t* dev, const u_char* data, int len); typedef int (__cdecl *T_pcap_dispatch)(pcap_t* dev, int num, pcap_handler callback, u_char* userdata); T_pcap_findalldevs _pcap_findalldevs = NULL; @@ -42,7 +42,7 @@ T_pcap_freealldevs _pcap_freealldevs = NULL; T_pcap_open_live _pcap_open_live = NULL; T_pcap_close _pcap_close = NULL; T_pcap_setnonblock _pcap_setnonblock = NULL; -T_pcap_sendpacket _pcap_sendpacket = NULL; +T_pcap_send _pcap_send = NULL; T_pcap_dispatch _pcap_dispatch = NULL; @@ -62,7 +62,7 @@ static void LoadWinPCap() LOADSYMBOL(pcap_open_live); LOADSYMBOL(pcap_close); LOADSYMBOL(pcap_setnonblock); - LOADSYMBOL(pcap_sendpacket); + LOADSYMBOL(pcap_send); LOADSYMBOL(pcap_dispatch); bWinPCapAvailable = true;