diff options
author | Michael Pavone <pavone@retrodev.com> | 2017-01-22 19:40:32 -0800 |
---|---|---|
committer | Michael Pavone <pavone@retrodev.com> | 2017-01-22 19:40:32 -0800 |
commit | 95bad3f04ee801f5337e6c10e566085fd4d48bd2 (patch) | |
tree | 1a69ddf50fa56f6d2e856c0bbe882e6b948e62cf | |
parent | 329be930106842ee60e0d9335b2f585c90a6c337 (diff) |
Force IPV4 for GDB remote debugging on Windows. Bind to localhost instead of unspecified address since listening on external ports probably isn't a good idea in the general case
-rw-r--r-- | gdb_remote.c | 4 | ||||
-rw-r--r-- | vdp.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/gdb_remote.c b/gdb_remote.c index 2742d34..73aa81f 100644 --- a/gdb_remote.c +++ b/gdb_remote.c @@ -577,10 +577,10 @@ void gdb_remote_init(void) struct addrinfo request, *result; memset(&request, 0, sizeof(request)); - request.ai_family = AF_UNSPEC; + request.ai_family = AF_INET; request.ai_socktype = SOCK_STREAM; request.ai_flags = AI_PASSIVE; - getaddrinfo(NULL, "1234", &request, &result); + getaddrinfo("localhost", "1234", &request, &result); int listen_sock = socket(result->ai_family, result->ai_socktype, result->ai_protocol); if (listen_sock < 0) { @@ -2432,8 +2432,8 @@ int vdp_control_port_write(vdp_context * context, uint16_t value) context->flags |= FLAG_DMA_RUN; context->dma_cd = context->cd; //printf("DMA start (length: %X) at cycle %d, frame: %d, vcounter: %d, hslot: %d\n", (context->regs[REG_DMALEN_H] << 8) | context->regs[REG_DMALEN_L], context->cycles, context->frame, context->vcounter, context->hslot); - if (!(context->regs[REG_DMASRC_H] & 0x80)) { - //printf("DMA Address: %X, New CD: %X, Source: %X, Length: %X\n", context->address, context->cd, (context->regs[REG_DMASRC_H] << 17) | (context->regs[REG_DMASRC_M] << 9) | (context->regs[REG_DMASRC_L] << 1), context->regs[REG_DMALEN_H] << 8 | context->regs[REG_DMALEN_L]); + if (!(context->regs[REG_DMASRC_H] & 0x80) && ((context->cd & 0xF) == CRAM_WRITE)) { + printf("DMA Address: %X, New CD: %X, Source: %X, Length: %X\n", context->address, context->cd, (context->regs[REG_DMASRC_H] << 17) | (context->regs[REG_DMASRC_M] << 9) | (context->regs[REG_DMASRC_L] << 1), context->regs[REG_DMALEN_H] << 8 | context->regs[REG_DMALEN_L]); return 1; } else { //printf("DMA Copy Address: %X, New CD: %X, Source: %X\n", context->address, context->cd, (context->regs[REG_DMASRC_M] << 8) | context->regs[REG_DMASRC_L]); |