From: Toni Wilen Date: Thu, 29 Mar 2012 15:44:25 +0000 (+0300) Subject: L -> _T() X-Git-Tag: 2410~14 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=528113cea10ca80485f8da889b8f93ba17daf55e;p=francis%2Fwinuae.git L -> _T() --- diff --git a/a2065.cpp b/a2065.cpp index 0964cba1..91ea0be3 100644 --- a/a2065.cpp +++ b/a2065.cpp @@ -141,11 +141,11 @@ static void dumppacket (const TCHAR *n, uae_u8 *packet, int len) TCHAR buf[10000]; for (i = 0; i < len; i++) { - _stprintf (buf + i * 3, L".%02X", packet[i]); + _stprintf (buf + i * 3, _T(".%02X"), packet[i]); } - write_log (L"%s %d: ", n, len); + write_log (_T("%s %d: "), n, len); write_log (buf); - write_log (L"\n\n"); + write_log (_T("\n\n")); } #endif @@ -179,7 +179,7 @@ static int mungepacket (uae_u8 *packet, int len) if (len < 20) return 0; #if DUMPPACKET - dumppacket (L"pre:", packet, len); + dumppacket (_T("pre:"), packet, len); #endif data = packet + 14; type = (packet[12] << 8) | packet[13]; @@ -233,7 +233,7 @@ static int mungepacket (uae_u8 *packet, int len) } } #if DUMPPACKET - dumppacket (L"post:", packet, len); + dumppacket (_T("post:"), packet, len); #endif return ret; } @@ -259,7 +259,7 @@ static void gotfunc (struct s2devstruct *dev, const uae_u8 *databuf, int len) if (log_a2065 > 1 && log_receive) { dstmac = databuf; srcmac = databuf + 6; - write_log (L"A2065 1) - write_log (L"mc filtered\n"); + write_log (_T("mc filtered\n")); return; } } else { // !promiscuous and dst != me and dst != broadcast if (!prom && (memcmp (dstmac, realmac, sizeof realmac) != 0 && memcmp (dstmac, broadcast, sizeof broadcast) != 0)) { if (log_a2065 > 1) - write_log (L"not for me1\n"); + write_log (_T("not for me1\n")); return; } } @@ -295,13 +295,13 @@ static void gotfunc (struct s2devstruct *dev, const uae_u8 *databuf, int len) // src and dst = me? right, better drop it. if (memcmp (dstmac, realmac, sizeof realmac) == 0 && memcmp (srcmac, realmac, sizeof realmac) == 0) { if (log_a2065 > 1) - write_log (L"not for me2\n"); + write_log (_T("not for me2\n")); return; } // dst = broadcast and src = me? no thanks. if (memcmp (dstmac, broadcast, sizeof broadcast) == 0 && memcmp (srcmac, realmac, sizeof realmac) == 0) { if (log_a2065 > 1) - write_log (L"not for me3\n"); + write_log (_T("not for me3\n")); return; } @@ -326,7 +326,7 @@ static void gotfunc (struct s2devstruct *dev, const uae_u8 *databuf, int len) srcmac = d + 6; if (log_a2065 && log_receive) { if (memcmp (dstmac, realmac, sizeof realmac) == 0) { - write_log (L"A2065<-DST:%02X.%02X.%02X.%02X.%02X.%02X SRC:%02X.%02X.%02X.%02X.%02X.%02X E=%04X S=%d\n", + write_log (_T("A2065<-DST:%02X.%02X.%02X.%02X.%02X.%02X SRC:%02X.%02X.%02X.%02X.%02X.%02X E=%04X S=%d\n"), dstmac[0], dstmac[1], dstmac[2], dstmac[3], dstmac[4], dstmac[5], srcmac[6], srcmac[7], srcmac[8], srcmac[9], srcmac[10], srcmac[11], (d[12] << 8) | d[13], len); @@ -334,7 +334,7 @@ static void gotfunc (struct s2devstruct *dev, const uae_u8 *databuf, int len) } if (mungepacket (d, len)) { if (log_a2065 && log_receive) { - write_log (L"A2065<*DST:%02X.%02X.%02X.%02X.%02X.%02X SRC:%02X.%02X.%02X.%02X.%02X.%02X E=%04X S=%d\n", + write_log (_T("A2065<*DST:%02X.%02X.%02X.%02X.%02X.%02X SRC:%02X.%02X.%02X.%02X.%02X.%02X E=%04X S=%d\n"), dstmac[0], dstmac[1], dstmac[2], dstmac[3], dstmac[4], dstmac[5], srcmac[6], srcmac[7], srcmac[8], srcmac[9], srcmac[10], srcmac[11], (d[12] << 8) | d[13], len); @@ -364,7 +364,7 @@ static void gotfunc (struct s2devstruct *dev, const uae_u8 *databuf, int len) addr &= RAM_MASK; if (!(rmd1 & RX_OWN)) { - write_log (L"A2065: RECEIVE BUFFER ERROR\n"); + write_log (_T("A2065: RECEIVE BUFFER ERROR\n")); if (!first) { rmd1 |= RX_BUFF | RX_OFLO; csr[0] &= ~CSR0_RXON; @@ -411,7 +411,7 @@ static int getfunc (struct s2devstruct *dev, uae_u8 *d, int *len) if (transmitlen <= 0) return 0; if (transmitlen > *len) { - write_log (L"A2065: too large packet transmission attempt %d > %d\n", transmitlen, *len); + write_log (_T("A2065: too large packet transmission attempt %d > %d\n"), transmitlen, *len); transmitlen = 0; return 0; } @@ -443,7 +443,7 @@ static void do_transmit (void) return; } if (!(tmd1 & TX_ENP) && log_a2065 > 0) - write_log (L"A2065: chained transmit!?\n"); + write_log (_T("A2065: chained transmit!?\n")); add_fcs = tmd1 & TX_ADD_FCS; @@ -461,7 +461,7 @@ static void do_transmit (void) tmd3 |= TX_BUFF | TX_UFLO; tmd1 |= TX_ERR; csr[0] &= ~CSR0_TXON; - write_log (L"A2065: TRANSMIT OWN NOT SET\n"); + write_log (_T("A2065: TRANSMIT OWN NOT SET\n")); err = 1; } else { tmd1 &= ~TX_OWN; @@ -483,7 +483,7 @@ static void do_transmit (void) tmd3 |= TX_BUFF | TX_UFLO; tmd1 |= TX_ERR; csr[0] &= ~CSR0_TXON; - write_log (L"A2065: TRANSMIT UNDERFLOW %d\n", outsize); + write_log (_T("A2065: TRANSMIT UNDERFLOW %d\n"), outsize); err = 1; p[3] = tmd1 >> 8; p[2] = tmd1 >> 0; @@ -496,7 +496,7 @@ static void do_transmit (void) if ((am_mode & MODE_DTCR) && !add_fcs) outsize -= 4; // do not include checksum bytes if (log_a2065 && log_transmit) { - write_log (L"A2065->DST:%02X.%02X.%02X.%02X.%02X.%02X SRC:%02X.%02X.%02X.%02X.%02X.%02X E=%04X S=%d\n", + write_log (_T("A2065->DST:%02X.%02X.%02X.%02X.%02X.%02X SRC:%02X.%02X.%02X.%02X.%02X.%02X E=%04X S=%d\n"), d[0], d[1], d[2], d[3], d[4], d[5], d[6], d[7], d[8], d[9], d[10], d[11], (d[12] << 8) | d[13], outsize); @@ -504,7 +504,7 @@ static void do_transmit (void) transmitlen = outsize; if (mungepacket (d, transmitlen)) { if (log_a2065 && log_transmit) { - write_log (L"A2065*>DST:%02X.%02X.%02X.%02X.%02X.%02X SRC:%02X.%02X.%02X.%02X.%02X.%02X E=%04X S=%d\n", + write_log (_T("A2065*>DST:%02X.%02X.%02X.%02X.%02X.%02X SRC:%02X.%02X.%02X.%02X.%02X.%02X E=%04X S=%d\n"), d[0], d[1], d[2], d[3], d[4], d[5], d[6], d[7], d[8], d[9], d[10], d[11], (d[12] << 8) | d[13], outsize); @@ -554,10 +554,10 @@ static void chip_init (void) uae_u32 iaddr = ((csr[2] & 0xff) << 16) | csr[1]; uae_u8 *p = boardram + (iaddr & RAM_MASK); - write_log (L"A2065: Initialization block2:\n"); + write_log (_T("A2065: Initialization block2:\n")); for (int i = 0; i < 24; i++) - write_log (L".%02X", p[i]); - write_log (L"\n"); + write_log (_T(".%02X"), p[i]); + write_log (_T("\n")); am_mode = (p[0] << 8) | (p[1] << 0); am_ladrf = ((uae_u64)p[15] << 56) | ((uae_u64)p[14] << 48) | ((uae_u64)p[13] << 40) | ((uae_u64)p[12] << 32) | (p[11] << 24) | (p[10] << 16) | (p[9] << 8) | (p[8] << 0); @@ -579,7 +579,7 @@ static void chip_init (void) fakemac[4] = p[6]; fakemac[5] = p[7]; - write_log (L"A2065: %04X %06X %d %d %d %d %06X %06X %02X:%02X:%02X:%02X:%02X:%02X\n", + write_log (_T("A2065: %04X %06X %d %d %d %d %06X %06X %02X:%02X:%02X:%02X:%02X:%02X\n"), am_mode, iaddr, prom, fakeprom, am_rdr_rlen, am_tdr_tlen, am_rdr_rdra, am_tdr_tdra, fakemac[0], fakemac[1], fakemac[2], fakemac[3], fakemac[4], fakemac[5]); @@ -593,7 +593,7 @@ static void chip_init (void) if (!sysdata) sysdata = xcalloc (uae_u8, uaenet_getdatalenght()); if (!uaenet_open (sysdata, td, NULL, gotfunc, getfunc, prom || fakeprom)) { - write_log (L"A2065: failed to initialize winpcap driver\n"); + write_log (_T("A2065: failed to initialize winpcap driver\n")); } } } @@ -609,7 +609,7 @@ static uae_u16 chip_wget (uaecptr addr) v |= CSR0_ERR; } if (log_a2065 > 2) - write_log (L"A2065_CHIPWGET: CSR%d=%04X PC=%08X\n", rap, v, M68K_GETPC); + write_log (_T("A2065_CHIPWGET: CSR%d=%04X PC=%08X\n"), rap, v, M68K_GETPC); return v; } return 0xffff; @@ -628,7 +628,7 @@ static void chip_wput (uaecptr addr, uae_u16 v) uae_u16 t; if (log_a2065 > 2) - write_log (L"A2065_CHIPWPUT: CSR%d=%04X PC=%08X\n", rap, v & 0xffff, M68K_GETPC); + write_log (_T("A2065_CHIPWPUT: CSR%d=%04X PC=%08X\n"), rap, v & 0xffff, M68K_GETPC); switch (rap) { @@ -654,20 +654,20 @@ static void chip_wput (uaecptr addr, uae_u16 v) if (!(am_mode & MODE_DRX)) csr[0] |= CSR0_RXON; if (log_a2065) - write_log (L"A2065: START.\n"); + write_log (_T("A2065: START.\n")); } if ((csr[0] & CSR0_STOP) && !(oreg & CSR0_STOP)) { csr[0] = CSR0_STOP; if (log_a2065) - write_log (L"A2065: STOP.\n"); + write_log (_T("A2065: STOP.\n")); csr[3] = 0; am_initialized = 0; } if ((csr[0] & CSR0_INIT) && am_initialized == 0) { if (log_a2065) - write_log (L"A2065: INIT.\n"); + write_log (_T("A2065: INIT.\n")); chip_init (); csr[0] |= CSR0_IDON; am_initialized = 1; @@ -716,7 +716,7 @@ static uae_u32 a2065_bget2 (uaecptr addr) v = boardram[(addr & RAM_MASK) ^ 1]; } if (log_a2065 > 2) - write_log (L"A2065_BGET: %08X -> %02X PC=%08X\n", addr, v & 0xff, M68K_GETPC); + write_log (_T("A2065_BGET: %08X -> %02X PC=%08X\n"), addr, v & 0xff, M68K_GETPC); return v; } @@ -726,7 +726,7 @@ static void a2065_bput2 (uaecptr addr, uae_u32 v) boardram[(addr & RAM_MASK) ^ 1] = v; } if (log_a2065 > 2) - write_log (L"A2065_BPUT: %08X <- %02X PC=%08X\n", addr, v & 0xff, M68K_GETPC); + write_log (_T("A2065_BPUT: %08X <- %02X PC=%08X\n"), addr, v & 0xff, M68K_GETPC); } static uae_u32 REGPARAM2 a2065_wget (uaecptr addr) @@ -805,13 +805,13 @@ static void REGPARAM2 a2065_bput (uaecptr addr, uae_u32 b) addr &= 65535; if (addr == 0x48 && !configured) { map_banks (&a2065_bank, b, 0x10000 >> 16, 0x10000); - write_log (L"A2065 Z2 autoconfigured at %02X0000\n", b); + write_log (_T("A2065 Z2 autoconfigured at %02X0000\n"), b); configured = b; expamem_next (); return; } if (addr == 0x4c && !configured) { - write_log (L"A2065 DMAC AUTOCONFIG SHUT-UP!\n"); + write_log (_T("A2065 DMAC AUTOCONFIG SHUT-UP!\n")); configured = 0xff; expamem_next (); return; @@ -844,7 +844,7 @@ static uae_u32 REGPARAM2 a2065_lgeti (uaecptr addr) static addrbank a2065_bank = { a2065_lget, a2065_wget, a2065_bget, a2065_lput, a2065_wput, a2065_bput, - default_xlate, default_check, NULL, L"A2065 Z2 Ethernet", + default_xlate, default_check, NULL, _T("A2065 Z2 Ethernet"), a2065_lgeti, a2065_wgeti, ABFLAG_IO }; @@ -861,7 +861,7 @@ static void a2065_config (void) td = NULL; if ((td = uaenet_enumerate (NULL, currprefs.a2065name))) { memcpy (realmac, td->mac, sizeof realmac); - write_log (L"A2065: '%s' %02X:%02X:%02X:%02X:%02X:%02X\n", + write_log (_T("A2065: '%s' %02X:%02X:%02X:%02X:%02X:%02X\n"), td->name, td->mac[0], td->mac[1], td->mac[2], td->mac[3], td->mac[4], td->mac[5]); } else { realmac[0] = 0x00; @@ -870,7 +870,7 @@ static void a2065_config (void) realmac[3] = 4; realmac[4] = 3; realmac[5] = 2; - write_log (L"A2065: Disconnected mode %02X:%02X:%02X:%02X:%02X:%02X\n", + write_log (_T("A2065: Disconnected mode %02X:%02X:%02X:%02X:%02X:%02X\n"), realmac[0], realmac[1], realmac[2], realmac[3], realmac[4], realmac[5]); } diff --git a/a2091.cpp b/a2091.cpp index 873027ca..d8225baa 100644 --- a/a2091.cpp +++ b/a2091.cpp @@ -184,7 +184,7 @@ void rethink_a2091 (void) if (isirq()) { uae_int_requested |= 2; #if A2091_DEBUG > 2 || A3000_DEBUG > 2 - write_log (L"Interrupt_RETHINK\n"); + write_log (_T("Interrupt_RETHINK\n")); #endif } else { uae_int_requested &= ~2; @@ -207,7 +207,7 @@ static void INT2 (void) static void dmac_start_dma (void) { #if A3000_DEBUG > 0 || A2091_DEBUG > 0 - write_log (L"DMAC DMA started, ADDR=%08X, LEN=%08X words\n", dmac_acr, dmac_wtc); + write_log (_T("DMAC DMA started, ADDR=%08X, LEN=%08X words\n"), dmac_acr, dmac_wtc); #endif dmac_dma = 1; } @@ -221,9 +221,9 @@ static void dmac_reset (void) { #if WD33C93_DEBUG > 0 if (superdmac) - write_log (L"A3000 %s SCSI reset\n", WD33C93); + write_log (_T("A3000 %s SCSI reset\n"), WD33C93); else - write_log (L"A2091 %s SCSI reset\n", WD33C93); + write_log (_T("A2091 %s SCSI reset\n"), WD33C93); #endif } @@ -248,7 +248,7 @@ static void doscsistatus (void) wdregs[WD_SCSI_STATUS] = scsidelay_status; auxstatus |= 0x80; #if WD33C93_DEBUG > 0 - write_log (L"%s STATUS=%02X\n", WD33C93, scsidelay_status); + write_log (_T("%s STATUS=%02X\n"), WD33C93, scsidelay_status); #endif if (currprefs.cs_cdtvscsi) { cdtv_scsi_int (); @@ -258,7 +258,7 @@ static void doscsistatus (void) return; INT2(); #if A2091_DEBUG > 2 || A3000_DEBUG > 2 - write_log (L"Interrupt\n"); + write_log (_T("Interrupt\n")); #endif } @@ -289,10 +289,10 @@ static TCHAR *scsitostring (void) p[0] = 0; for (i = 0; i < wd_tc && i < sizeof wd_data; i++) { if (i > 0) { - _tcscat (p, L"."); + _tcscat (p, _T(".")); p++; } - _stprintf (p, L"%02X", wd_data[i]); + _stprintf (p, _T("%02X"), wd_data[i]); p += _tcslen (p); } return buf; @@ -302,7 +302,7 @@ static void wd_cmd_sel_xfer (void) { int phase = wdregs[WD_COMMAND_PHASE]; #if WD33C93_DEBUG > 0 - write_log (L"* %s select and transfer, ID=%d phase=%02X\n", WD33C93, wdregs[WD_DESTINATION_ID] & 0x7, phase); + write_log (_T("* %s select and transfer, ID=%d phase=%02X\n"), WD33C93, wdregs[WD_DESTINATION_ID] & 0x7, phase); #endif if (!SCSIID) { set_status (CSR_TIMEOUT, 0); @@ -335,7 +335,7 @@ static void do_dma (void) if (currprefs.cs_cdtvscsi) cdtv_getdmadata (&dmac_acr); if (SCSIID->direction == 0) { - write_log (L"%s DMA but no data!?\n", WD33C93); + write_log (_T("%s DMA but no data!?\n"), WD33C93); } else if (SCSIID->direction < 0) { for (;;) { uae_u8 v; @@ -364,7 +364,7 @@ static void do_dma (void) static void wd_do_transfer_out (void) { #if WD33C93_DEBUG > 0 - write_log (L"%s SCSI O [%02X] %d/%d %s\n", WD33C93, wdregs[WD_COMMAND_PHASE], wd_dataoffset, wd_tc, scsitostring ()); + write_log (_T("%s SCSI O [%02X] %d/%d %s\n"), WD33C93, wdregs[WD_COMMAND_PHASE], wd_dataoffset, wd_tc, scsitostring ()); #endif if (wdregs[WD_COMMAND_PHASE] == 0x11) { wdregs[WD_COMMAND_PHASE] = 0x20; @@ -402,7 +402,7 @@ static void wd_do_transfer_out (void) static void wd_do_transfer_in (void) { #if WD33C93_DEBUG > 0 - write_log (L"%s SCSI I [%02X] %d/%d %s\n", WD33C93, wdregs[WD_COMMAND_PHASE], wd_dataoffset, wd_tc, scsitostring ()); + write_log (_T("%s SCSI I [%02X] %d/%d %s\n"), WD33C93, wdregs[WD_COMMAND_PHASE], wd_dataoffset, wd_tc, scsitostring ()); #endif wd_dataoffset = 0; if (wdregs[WD_COMMAND_PHASE] >= 0x36 && wdregs[WD_COMMAND_PHASE] < 0x47) { @@ -426,7 +426,7 @@ static void wd_cmd_sel_xfer_atn (void) tmp_tc = wdregs[WD_TRANSFER_COUNT_LSB] | (wdregs[WD_TRANSFER_COUNT] << 8) | (wdregs[WD_TRANSFER_COUNT_MSB] << 16); #if WD33C93_DEBUG > 0 - write_log (L"* %s select and transfer with atn, ID=%d PHASE=%02X TC=%d\n", + write_log (_T("* %s select and transfer with atn, ID=%d PHASE=%02X TC=%d\n"), WD33C93, wdregs[WD_DESTINATION_ID] & 0x7, wdregs[WD_COMMAND_PHASE], tmp_tc); #endif if (wdregs[WD_COMMAND] & 0x80) @@ -496,7 +496,7 @@ static void wd_cmd_trans_info (void) wd_tc = 1; wd_dataoffset = 0; #if WD33C93_DEBUG > 0 - write_log (L"* %s transfer info phase=%02x len=%d dma=%d\n", WD33C93, wdregs[WD_COMMAND_PHASE], wd_tc, wdregs[WD_CONTROL] >> 5); + write_log (_T("* %s transfer info phase=%02x len=%d dma=%d\n"), WD33C93, wdregs[WD_COMMAND_PHASE], wd_tc, wdregs[WD_CONTROL] >> 5); #endif scsi_start_transfer (SCSIID, wd_tc); if (wdregs[WD_COMMAND_PHASE] >= 0x36 && wdregs[WD_COMMAND_PHASE] <= 0x3f) @@ -515,7 +515,7 @@ static void wd_cmd_trans_info (void) static void wd_cmd_sel_atn (void) { #if WD33C93_DEBUG > 0 - write_log (L"* %s select with atn, ID=%d\n", WD33C93, wdregs[WD_DESTINATION_ID] & 0x7); + write_log (_T("* %s select with atn, ID=%d\n"), WD33C93, wdregs[WD_DESTINATION_ID] & 0x7); #endif wd_phase = 0; wdregs[WD_COMMAND_PHASE] = 0; @@ -533,7 +533,7 @@ static void wd_cmd_reset (void) int i; #if WD33C93_DEBUG > 0 - write_log (L"%s reset\n", WD33C93); + write_log (_T("%s reset\n"), WD33C93); #endif for (i = 1; i < 0x16; i++) wdregs[i] = 0; @@ -546,7 +546,7 @@ static void wd_cmd_reset (void) static void wd_cmd_abort (void) { #if WD33C93_DEBUG > 0 - write_log (L"%s abort\n", WD33C93); + write_log (_T("%s abort\n"), WD33C93); #endif set_status (CSR_SEL_ABORT, 0); } @@ -562,17 +562,17 @@ void wdscsi_put (uae_u8 d) { #if WD33C93_DEBUG > 1 if (WD33C93_DEBUG > 3 || sasr != WD_DATA) - write_log (L"W %s REG %02X (%d) = %02X (%d) PC=%08X\n", WD33C93, sasr, sasr, d, d, M68K_GETPC); + write_log (_T("W %s REG %02X (%d) = %02X (%d) PC=%08X\n"), WD33C93, sasr, sasr, d, d, M68K_GETPC); #endif if (!writeonlyreg (sasr)) wdregs[sasr] = d; if (!wd_used) { wd_used = 1; - write_log (L"%s in use\n", WD33C93); + write_log (_T("%s in use\n"), WD33C93); } if (sasr == WD_COMMAND_PHASE) { #if WD33C93_DEBUG > 0 - write_log (L"%s PHASE=%02X\n", WD33C93, d); + write_log (_T("%s PHASE=%02X\n"), WD33C93, d); #endif } else if (sasr == WD_DATA) { if (wd_dataoffset < sizeof wd_data) @@ -600,7 +600,7 @@ void wdscsi_put (uae_u8 d) wd_cmd_trans_info (); break; default: - write_log (L"%s unimplemented/unknown command %02X\n", WD33C93, d); + write_log (_T("%s unimplemented/unknown command %02X\n"), WD33C93, d); break; } } @@ -643,7 +643,7 @@ uae_u8 wdscsi_get (void) incsasr (0); #if WD33C93_DEBUG > 1 if (WD33C93_DEBUG > 3 || osasr != WD_DATA) - write_log (L"R %s REG %02X (%d) = %02X (%d) PC=%08X\n", WD33C93, osasr, osasr, v, v, M68K_GETPC); + write_log (_T("R %s REG %02X (%d) = %02X (%d) PC=%08X\n"), WD33C93, osasr, osasr, v, v, M68K_GETPC); #endif return v; } @@ -732,7 +732,7 @@ static uae_u32 dmac_bget2 (uaecptr addr) break; } #if A2091_DEBUG > 0 - write_log (L"dmac_bget %04X=%02X PC=%08X\n", addr, v, M68K_GETPC); + write_log (_T("dmac_bget %04X=%02X PC=%08X\n"), addr, v, M68K_GETPC); #endif return v; } @@ -820,7 +820,7 @@ static void dmac_bput2 (uaecptr addr, uae_u32 b) break; } #if A2091_DEBUG > 0 - write_log (L"dmac_bput %04X=%02X PC=%08X\n", addr, b & 255, M68K_GETPC); + write_log (_T("dmac_bput %04X=%02X PC=%08X\n"), addr, b & 255, M68K_GETPC); #endif } @@ -839,7 +839,7 @@ static uae_u32 REGPARAM2 dmac_lget (uaecptr addr) v |= dmac_bget2 (addr + 3); #if A2091_DEBUG > 0 if (addr >= 0x40 && addr < ROM_OFFSET) - write_log (L"dmac_lget %08X=%08X PC=%08X\n", addr, v, M68K_GETPC); + write_log (_T("dmac_lget %08X=%08X PC=%08X\n"), addr, v, M68K_GETPC); #endif return v; } @@ -855,7 +855,7 @@ static uae_u32 REGPARAM2 dmac_wget (uaecptr addr) v |= dmac_bget2 (addr + 1); #if A2091_DEBUG > 0 if (addr >= 0x40 && addr < ROM_OFFSET) - write_log (L"dmac_wget %08X=%04X PC=%08X\n", addr, v, M68K_GETPC); + write_log (_T("dmac_wget %08X=%04X PC=%08X\n"), addr, v, M68K_GETPC); #endif return v; } @@ -881,7 +881,7 @@ static void REGPARAM2 dmac_lput (uaecptr addr, uae_u32 l) addr &= 65535; #if A2091_DEBUG > 0 if (addr >= 0x40 && addr < ROM_OFFSET) - write_log (L"dmac_lput %08X=%08X PC=%08X\n", addr, l, M68K_GETPC); + write_log (_T("dmac_lput %08X=%08X PC=%08X\n"), addr, l, M68K_GETPC); #endif dmac_bput2 (addr, l >> 24); dmac_bput2 (addr + 1, l >> 16); @@ -897,7 +897,7 @@ static void REGPARAM2 dmac_wput (uaecptr addr, uae_u32 w) addr &= 65535; #if A2091_DEBUG > 0 if (addr >= 0x40 && addr < ROM_OFFSET) - write_log (L"dmac_wput %04X=%04X PC=%08X\n", addr, w & 65535, M68K_GETPC); + write_log (_T("dmac_wput %04X=%04X PC=%08X\n"), addr, w & 65535, M68K_GETPC); #endif dmac_bput2 (addr, w >> 8); dmac_bput2 (addr + 1, w); @@ -912,13 +912,13 @@ static void REGPARAM2 dmac_bput (uaecptr addr, uae_u32 b) addr &= 65535; if (addr == 0x48 && !configured) { map_banks (&dmaca2091_bank, b, 0x10000 >> 16, 0x10000); - write_log (L"A590/A2091 Z2 autoconfigured at %02X0000\n", b); + write_log (_T("A590/A2091 Z2 autoconfigured at %02X0000\n"), b); configured = 1; expamem_next (); return; } if (addr == 0x4c && !configured) { - write_log (L"A590/A2091 DMAC AUTOCONFIG SHUT-UP!\n"); + write_log (_T("A590/A2091 DMAC AUTOCONFIG SHUT-UP!\n")); configured = 1; expamem_next (); return; @@ -965,7 +965,7 @@ static uae_u8 *REGPARAM2 dmac_xlate (uaecptr addr) addrbank dmaca2091_bank = { dmac_lget, dmac_wget, dmac_bget, dmac_lput, dmac_wput, dmac_bput, - dmac_xlate, dmac_check, NULL, L"A2091/A590", + dmac_xlate, dmac_check, NULL, _T("A2091/A590"), dmac_lgeti, dmac_wgeti, ABFLAG_IO }; @@ -986,7 +986,7 @@ static void mbdmac_write (uae_u32 addr, uae_u32 val, int mode) if (currprefs.cs_mbdmac > 1) return; #if A3000_DEBUG > 1 - write_log (L"DMAC_WRITE %08X=%02X PC=%08X\n", addr, val & 0xff, M68K_GETPC); + write_log (_T("DMAC_WRITE %08X=%02X PC=%08X\n"), addr, val & 0xff, M68K_GETPC); #endif addr &= 0xffff; switch (addr) @@ -1114,7 +1114,7 @@ static uae_u32 mbdmac_read (uae_u32 addr, int mode) break; } #if A3000_DEBUG > 1 - write_log (L"DMAC_READ %08X=%02X PC=%X\n", vaddr, v & 0xff, M68K_GETPC); + write_log (_T("DMAC_READ %08X=%02X PC=%X\n"), vaddr, v & 0xff, M68K_GETPC); #endif return v; } @@ -1185,7 +1185,7 @@ static void REGPARAM2 mbdmac_bput (uaecptr addr, uae_u32 b) addrbank mbdmac_a3000_bank = { mbdmac_lget, mbdmac_wget, mbdmac_bget, mbdmac_lput, mbdmac_wput, mbdmac_bput, - default_xlate, default_check, NULL, L"A3000 DMAC", + default_xlate, default_check, NULL, _T("A3000 DMAC"), dummy_lgeti, dummy_wgeti, ABFLAG_IO }; @@ -1274,7 +1274,7 @@ static void addnativescsi (void) while (devices[i] >= 0 && j < 7) { if (scsis[j] == NULL) { scsis[j] = scsi_alloc_native(j, devices[i]); - write_log (L"SCSI: %d:'%s'\n", j, dis[i].label); + write_log (_T("SCSI: %d:'%s'\n"), j, dis[i].label); i++; } j++; @@ -1361,7 +1361,7 @@ void a2091_init (void) z = read_rom (&rd); if (z) { int slotsize = 65536; - write_log (L"A590/A2091 BOOT ROM %d.%d ", rd->ver, rd->rev); + write_log (_T("A590/A2091 BOOT ROM %d.%d "), rd->ver, rd->rev); rom_size = rd->size; rom = xmalloc (uae_u8, slotsize); if (rl->rd->id == 56) diff --git a/adide.cpp b/adide.cpp index 29f97599..ad5c76ff 100644 --- a/adide.cpp +++ b/adide.cpp @@ -27,7 +27,7 @@ int adide_add_ide_unit (int ch, TCHAR *path, int blocksize, int readonly, if (!hdf_hd_open (&ide->hdhfd, path, blocksize, readonly, devname, sectors, surfaces, reserved, bootpri, filesys)) return -1; ide->lba48 = ide->hdhfd.size >= 128 * (uae_u64)0x40000000 ? 1 : 0; - write_log (L"IDE%d '%s', CHS=%d,%d,%d. %uM. LBA48=%d\n", + write_log (_T("IDE%d '%s', CHS=%d,%d,%d. %uM. LBA48=%d\n"), ch, path, ide->hdhfd.cyls, ide->hdhfd.heads, ide->hdhfd.secspertrack, (int)(ide->hdhfd.size / (1024 * 1024)), ide->lba48); ide->status = 0; ide->data_offset = 0; diff --git a/akiko.cpp b/akiko.cpp index b75328cd..ab1421e3 100644 --- a/akiko.cpp +++ b/akiko.cpp @@ -38,7 +38,7 @@ static void irq (void) { #if AKIKO_DEBUG_IO > 1 - write_log (L"Akiko Interrupt\n"); + write_log (_T("Akiko Interrupt\n")); #endif if (!(intreq & 8)) { INTREQ_0 (0x8000 | 0x0008); @@ -82,9 +82,9 @@ static void nvram_write (int offset, int len) if (!currprefs.cs_cd32nvram) return; - f = zfile_fopen (currprefs.flashfile, L"rb+", ZFD_NORMAL); + f = zfile_fopen (currprefs.flashfile, _T("rb+"), ZFD_NORMAL); if (!f) { - f = zfile_fopen (currprefs.flashfile, L"wb", 0); + f = zfile_fopen (currprefs.flashfile, _T("wb"), 0); if (!f) return; zfile_fwrite (cd32_nvram, NVRAM_SIZE, 1, f); } @@ -99,7 +99,7 @@ static void nvram_read (void) if (!currprefs.cs_cd32nvram) return; - f = zfile_fopen (currprefs.flashfile, L"rb", ZFD_NORMAL); + f = zfile_fopen (currprefs.flashfile, _T("rb"), ZFD_NORMAL); memset (cd32_nvram, 0, NVRAM_SIZE); if (!f) return; zfile_fread (cd32_nvram, NVRAM_SIZE, 1, f); @@ -118,14 +118,14 @@ static void i2c_do (void) bitcounter = 0; direction = -1; #if AKIKO_DEBUG_NVRAM - write_log (L"START\n"); + write_log (_T("START\n")); #endif return; } else if(sda_out && !osda) { /* STOP-condition? */ state = I2C_WAIT; bitcounter = -1; #if AKIKO_DEBUG_NVRAM - write_log (L"STOP\n"); + write_log (_T("STOP\n")); #endif if (direction > 0) { memcpy (cd32_nvram + (nvram_address & ~(NVRAM_PAGE_SIZE - 1)), nvram_writetmp, NVRAM_PAGE_SIZE); @@ -133,10 +133,10 @@ static void i2c_do (void) direction = -1; gui_flicker_led (LED_MD, 0, 2); #if AKIKO_DEBUG_NVRAM - write_log (L"NVRAM write address %04X:", nvram_address & ~(NVRAM_PAGE_SIZE - 1)); + write_log (_T("NVRAM write address %04X:"), nvram_address & ~(NVRAM_PAGE_SIZE - 1)); for (i = 0; i < NVRAM_PAGE_SIZE; i++) - write_log (L"%02X", nvram_writetmp[i]); - write_log (L"\n"); + write_log (_T("%02X"), nvram_writetmp[i]); + write_log (_T("\n")); #endif } @@ -149,7 +149,7 @@ static void i2c_do (void) if (scl_out && !oscl) { if (bitcounter == 8) { #if AKIKO_DEBUG_NVRAM - write_log (L"RB %02X ", nvram_byte, M68K_GETPC); + write_log (_T("RB %02X "), nvram_byte, M68K_GETPC); #endif sda_in = 0; /* ACK */ if (direction > 0) { @@ -160,7 +160,7 @@ static void i2c_do (void) bitcounter = -1; } } else { - //write_log (L"NVRAM received bit %d, offset %d\n", sda_out, bitcounter); + //write_log (_T("NVRAM received bit %d, offset %d\n"), sda_out, bitcounter); nvram_byte <<= 1; nvram_byte |= sda_out; bitcounter++; @@ -173,12 +173,12 @@ static void i2c_do (void) nvram_byte = cd32_nvram[nvram_address]; sda_dir_nvram = 1; sda_in = (nvram_byte & 0x80) ? 1 : 0; - //write_log (L"NVRAM sent bit %d, offset %d\n", sda_in, bitcounter); + //write_log (_T("NVRAM sent bit %d, offset %d\n"), sda_in, bitcounter); nvram_byte <<= 1; bitcounter++; if (bitcounter == 8) { #if AKIKO_DEBUG_NVRAM - write_log (L"NVRAM sent byte %02X address %04X PC=%08X\n", cd32_nvram[nvram_address], nvram_address, M68K_GETPC); + write_log (_T("NVRAM sent byte %02X address %04X PC=%08X\n"), cd32_nvram[nvram_address], nvram_address, M68K_GETPC); #endif nvram_address++; nvram_address &= NVRAM_SIZE - 1; @@ -194,7 +194,7 @@ static void i2c_do (void) { case I2C_DEVICEADDR: if ((nvram_byte & 0xf0) != 0xa0) { - write_log (L"WARNING: I2C_DEVICEADDR: device address != 0xA0\n"); + write_log (_T("WARNING: I2C_DEVICEADDR: device address != 0xA0\n")); state = I2C_WAIT; return; } @@ -212,14 +212,14 @@ static void i2c_do (void) } bitcounter = 0; #if AKIKO_DEBUG_NVRAM - write_log (L"I2C_DEVICEADDR: rw %d, address %02Xxx PC=%08X\n", nvram_rw, nvram_address >> 8, M68K_GETPC); + write_log (_T("I2C_DEVICEADDR: rw %d, address %02Xxx PC=%08X\n"), nvram_rw, nvram_address >> 8, M68K_GETPC); #endif break; case I2C_WORDADDR: nvram_address &= 0x300; nvram_address |= nvram_byte; #if AKIKO_DEBUG_NVRAM - write_log (L"I2C_WORDADDR: address %04X PC=%08X\n", nvram_address, M68K_GETPC); + write_log (_T("I2C_WORDADDR: address %04X PC=%08X\n"), nvram_address, M68K_GETPC); #endif if (direction < 0) { memcpy (nvram_writetmp, cd32_nvram + (nvram_address & ~(NVRAM_PAGE_SIZE - 1)), NVRAM_PAGE_SIZE); @@ -493,7 +493,7 @@ static void set_status (uae_u32 status) { #if AKIKO_DEBUG_IO if (!(cdrom_intreq & status)) - write_log (L"Akiko INTREQ %08x (%08x)\n", status, cdrom_intreq | status); + write_log (_T("Akiko INTREQ %08x (%08x)\n"), status, cdrom_intreq | status); #endif cdrom_intreq |= status; checkint (); @@ -534,19 +534,19 @@ static void subfunc (uae_u8 *data, int cnt) if (subcodebufferinuse[i]) total++; } - write_log (L"%d ", total); + write_log (_T("%d "), total); #endif if (subcodebufferinuse[subcodebufferoffsetw]) { memset (subcodebufferinuse, 0,sizeof (subcodebufferinuse)); subcodebufferoffsetw = subcodebufferoffset = 0; uae_sem_post (&sub_sem); - write_log (L"CD32: subcode buffer overflow 1\n"); + write_log (_T("CD32: subcode buffer overflow 1\n")); return; } int offset = subcodebufferoffsetw; while (cnt > 0) { if (subcodebufferinuse[offset]) { - write_log (L"CD32: subcode buffer overflow 2\n"); + write_log (_T("CD32: subcode buffer overflow 2\n")); break; } subcodebufferinuse[offset] = 1; @@ -608,7 +608,7 @@ static bool isaudiotrack (int startlsn) s++; } if (s && (s->control & 0x0c) == 0x04) { - write_log (L"tried to play data track %d!\n", s->track); + write_log (_T("tried to play data track %d!\n"), s->track); return false; } return true; @@ -636,7 +636,7 @@ static int cd_play_audio (int startlsn, int endlsn, int scan) if (s && (s->control & 0x0c) == 0x04) { s = get_track (startlsn + 150); if (s && (s->control & 0x0c) == 0x04) { - write_log (L"tried to play data track %d!\n", s->track); + write_log (_T("tried to play data track %d!\n"), s->track); s++; startlsn = s->paddress; s++; @@ -704,7 +704,7 @@ static int cd_qcode (uae_u8 *d) d[10] = tobcd ((uae_u8)(msf >> 0)); } } -// write_log (L"%02X.%02X.%02X.%02X.%02X.%02X.%02X.%02X.%02X.%02X.%02X.%02X\n", +// write_log (_T("%02X.%02X.%02X.%02X.%02X.%02X.%02X.%02X.%02X.%02X.%02X.%02X\n"), // d[0], d[1], d[2], d[3], d[4], d[5], d[6], d[7], d[8], d[9], d[10], d[11]); return 0; } @@ -753,7 +753,7 @@ static int sys_cddev_open (void) struct device_info di; unitnum = get_standard_cd_unit (CD_STANDARD_UNIT_CD32); sys_command_info (unitnum, &di, 0); - write_log (L"using drive %s (unit %d, media %d)\n", di.label, unitnum, di.media_inserted); + write_log (_T("using drive %s (unit %d, media %d)\n"), di.label, unitnum, di.media_inserted); /* make sure CD audio is not playing */ cdaudiostop_do (); return 0; @@ -794,19 +794,19 @@ static void cdrom_return_data (void) if (!(cdrom_flags & CDFLAG_RXD)) return; #if AKIKO_DEBUG_IO_CMD - write_log (L"OUT:"); + write_log (_T("OUT:")); #endif checksum = 0xff; for (i = 0; i < len; i++) { checksum -= cdrom_result_buffer[i]; put_byte (cmd_buf + ((cdcomrxinx + i) & 0xff), cdrom_result_buffer[i]); #if AKIKO_DEBUG_IO_CMD - write_log (L"%02X ", cdrom_result_buffer[i]); + write_log (_T("%02X "), cdrom_result_buffer[i]); #endif } put_byte (cmd_buf + ((cdcomrxinx + len) & 0xff), checksum); #if AKIKO_DEBUG_IO_CMD - write_log (L"(%02X)\n", checksum); + write_log (_T("(%02X)\n"), checksum); #endif cdcomrxinx += len + 1; cdcomrxinx &= 0xff; @@ -957,7 +957,7 @@ static int cdrom_command_multi (void) cdrom_seek_delay = 100; } #if AKIKO_DEBUG_IO_CMD - write_log (L"READ DATA %06X (%d) - %06X (%d) SPD=%dx PC=%08X\n", + write_log (_T("READ DATA %06X (%d) - %06X (%d) SPD=%dx PC=%08X\n"), seekpos, cdrom_data_offset, endpos, cdrom_data_offset_end, cdrom_speed, M68K_GETPC); #endif cdrom_result_buffer[1] |= 0x02; @@ -968,7 +968,7 @@ static int cdrom_command_multi (void) else if (cdrom_command_buffer[7] & 0x08) scan = -1; #if AKIKO_DEBUG_IO_CMD - write_log (L"PLAY FROM %06X (%d) to %06X (%d) SCAN=%d\n", + write_log (_T("PLAY FROM %06X (%d) to %06X (%d) SCAN=%d\n"), seekpos, msf2lsn (seekpos), endpos, msf2lsn (endpos), scan); #endif cdrom_playing = 1; @@ -979,7 +979,7 @@ static int cdrom_command_multi (void) cdrom_result_buffer[1] |= CDS_PLAYING; } else { #if AKIKO_DEBUG_IO_CMD - write_log (L"SEEKTO %06X\n",seekpos); + write_log (_T("SEEKTO %06X\n"),seekpos); #endif if (seekpos < 150) cdrom_toc_counter = 0; @@ -1038,7 +1038,7 @@ static void cdrom_run_command (void) cmd_len = command_lengths[cdrom_command & 0x0f]; if (cmd_len < 0) { #if AKIKO_DEBUG_IO_CMD - write_log (L"unknown command %x\n", cdrom_command & 0x0f); + write_log (_T("unknown command %x\n"), cdrom_command & 0x0f); #endif cdrom_unknown_command = 1; cdrom_command_active = 1; @@ -1048,7 +1048,7 @@ static void cdrom_run_command (void) } #if AKIKO_DEBUG_IO_CMD - write_log (L"IN:"); + write_log (_T("IN:")); #endif checksum = 0; for (i = 0; i < cmd_len + 1; i++) { @@ -1056,19 +1056,19 @@ static void cdrom_run_command (void) checksum += cdrom_command_buffer[i]; #if AKIKO_DEBUG_IO_CMD if (i == cmd_len) - write_log (L"(%02X) ", cdrom_command_buffer[i]); // checksum + write_log (_T("(%02X) "), cdrom_command_buffer[i]); // checksum else - write_log (L"%02X ", cdrom_command_buffer[i]); + write_log (_T("%02X "), cdrom_command_buffer[i]); #endif } if (checksum != 0xff) { #if AKIKO_DEBUG_IO_CMD - write_log (L" checksum error"); + write_log (_T(" checksum error")); #endif cdrom_checksum_error = 1; } #if AKIKO_DEBUG_IO_CMD - write_log (L"\n"); + write_log (_T("\n")); #endif cdrom_command_active = 1; cdrom_command_length = cmd_len; @@ -1168,7 +1168,7 @@ static void cdrom_run_read (void) if (sector_buffer_info_1[sec] != 0xff) sector_buffer_info_1[sec]--; #if AKIKO_DEBUG_IO_CMD - write_log (L"read sector=%d, scnt=%d -> %d. %d %08X\n", + write_log (_T("read sector=%d, scnt=%d -> %d. %d %08X\n"), cdrom_data_offset, cdrom_sector_counter, sector, seccnt, cdrom_addressdata + seccnt * 4096); #endif } else { @@ -1290,7 +1290,7 @@ void AKIKO_hsync_handler (void) if (subcodebufferoffset >= MAX_SUBCODEBUFFER) subcodebufferoffset -= MAX_SUBCODEBUFFER; set_status (CDINTERRUPT_SUBCODE); - write_log (L"*"); + write_log (_T("*")); } uae_sem_post (&sub_sem); } @@ -1353,12 +1353,12 @@ static void *akiko_thread (void *null) mediacheckcounter = 312 * 50 * 2; int media = sys_command_ismedia (unitnum, 1); if (media < 0) { - write_log (L"CD32: device unit %d lost\n", unitnum); + write_log (_T("CD32: device unit %d lost\n"), unitnum); media = lastmediastate = cdrom_disk = 0; mediachanged = 1; cdaudiostop_do (); } else if (media != lastmediastate) { - write_log (L"CD32: media changed = %d\n", media); + write_log (_T("CD32: media changed = %d\n"), media); lastmediastate = cdrom_disk = media; mediachanged = 1; cdaudiostop_do (); @@ -1375,7 +1375,7 @@ static void *akiko_thread (void *null) (sector_buffer_sector_1 < 0 || sector < sector_buffer_sector_1 || sector >= sector_buffer_sector_1 + SECTOR_BUFFER_SIZE * 2 / 3 || i != SECTOR_BUFFER_SIZE)) { memset (sector_buffer_info_2, 0, SECTOR_BUFFER_SIZE); #if AKIKO_DEBUG_IO_CMD - write_log (L"filling buffer sector=%d (max=%d)\n", sector, cdrom_data_end); + write_log (_T("filling buffer sector=%d (max=%d)\n"), sector, cdrom_data_end); #endif sector_buffer_sector_2 = sector; offset = 0; @@ -1511,14 +1511,14 @@ static uae_u32 akiko_bget2 (uaecptr addr, int msg) } default: - write_log (L"akiko_bget: unknown address %08X PC=%08X\n", addr, M68K_GETPC); + write_log (_T("akiko_bget: unknown address %08X PC=%08X\n"), addr, M68K_GETPC); v = 0; break; } akiko_internal (); uae_sem_post (&akiko_sem); if (msg && addr < 0x30 && AKIKO_DEBUG_IO) - write_log (L"akiko_bget %08X: %08X %02X\n", M68K_GETPC, addr, v & 0xff); + write_log (_T("akiko_bget %08X: %08X %02X\n"), M68K_GETPC, addr, v & 0xff); return v; } @@ -1540,7 +1540,7 @@ static uae_u32 REGPARAM2 akiko_wget (uaecptr addr) v = akiko_bget2 (addr + 1, 0); v |= akiko_bget2 (addr + 0, 0) << 8; if (addr < 0x30 && AKIKO_DEBUG_IO) - write_log (L"akiko_wget %08X: %08X %04X\n", M68K_GETPC, addr, v & 0xffff); + write_log (_T("akiko_wget %08X: %08X %04X\n"), M68K_GETPC, addr, v & 0xffff); return v; } @@ -1557,7 +1557,7 @@ static uae_u32 REGPARAM2 akiko_lget (uaecptr addr) v |= akiko_bget2 (addr + 1, 0) << 16; v |= akiko_bget2 (addr + 0, 0) << 24; if (addr < 0x30 && (addr != 4 && addr != 8) && AKIKO_DEBUG_IO) - write_log (L"akiko_lget %08X: %08X %08X\n", M68K_GETPC, addr, v); + write_log (_T("akiko_lget %08X: %08X %08X\n"), M68K_GETPC, addr, v); return v; } @@ -1569,7 +1569,7 @@ static void akiko_bput2 (uaecptr addr, uae_u32 v, int msg) v &= 0xff; if(msg && addr < 0x30 && AKIKO_DEBUG_IO) - write_log (L"akiko_bput %08X: %08X=%02X\n", M68K_GETPC, addr, v & 0xff); + write_log (_T("akiko_bput %08X: %08X=%02X\n"), M68K_GETPC, addr, v & 0xff); switch (addr) { @@ -1667,7 +1667,7 @@ static void akiko_bput2 (uaecptr addr, uae_u32 v, int msg) } default: - write_log (L"akiko_bput: unknown address %08X=%02X PC=%08X\n", addr, v & 0xff, M68K_GETPC); + write_log (_T("akiko_bput: unknown address %08X=%02X PC=%08X\n"), addr, v & 0xff, M68K_GETPC); break; } akiko_internal (); @@ -1689,7 +1689,7 @@ static void REGPARAM2 akiko_wput (uaecptr addr, uae_u32 v) #endif addr &= 0xfff; if((addr < 0x30 && AKIKO_DEBUG_IO)) - write_log (L"akiko_wput %08X: %08X=%04X\n", M68K_GETPC, addr, v & 0xffff); + write_log (_T("akiko_wput %08X: %08X=%04X\n"), M68K_GETPC, addr, v & 0xffff); akiko_bput2 (addr + 1, v & 0xff, 0); akiko_bput2 (addr + 0, v >> 8, 0); } @@ -1701,7 +1701,7 @@ static void REGPARAM2 akiko_lput (uaecptr addr, uae_u32 v) #endif addr &= 0xffff; if(addr < 0x30 && AKIKO_DEBUG_IO) - write_log (L"akiko_lput %08X: %08X=%08X\n", M68K_GETPC, addr, v); + write_log (_T("akiko_lput %08X: %08X=%08X\n"), M68K_GETPC, addr, v); akiko_bput2 (addr + 3, (v >> 0) & 0xff, 0); akiko_bput2 (addr + 2, (v >> 8) & 0xff, 0); akiko_bput2 (addr + 1, (v >> 16) & 0xff, 0); @@ -1711,7 +1711,7 @@ static void REGPARAM2 akiko_lput (uaecptr addr, uae_u32 v) addrbank akiko_bank = { akiko_lget, akiko_wget, akiko_bget, akiko_lput, akiko_wput, akiko_bput, - default_xlate, default_check, NULL, L"Akiko", + default_xlate, default_check, NULL, _T("Akiko"), dummy_lgeti, dummy_wgeti, ABFLAG_IO }; @@ -1790,7 +1790,7 @@ int akiko_init (void) if (!akiko_thread_running) { akiko_thread_running = 1; init_comm_pipe (&requests, 100, 1); - uae_start_thread (L"akiko", akiko_thread, 0, NULL); + uae_start_thread (_T("akiko"), akiko_thread, 0, NULL); } akiko_inited = true; return 1; diff --git a/amax.cpp b/amax.cpp index c593c23d..0a5ba780 100644 --- a/amax.cpp +++ b/amax.cpp @@ -44,7 +44,7 @@ static void load_byte (void) } data = val; if (AMAX_LOG > 0) - write_log (L"AMAX: load byte, rom=%d addr=%06x (%06x) data=%02x (%02x) PC=%08X\n", rom_oddeven, romptr, addr, v, val, M68K_GETPC); + write_log (_T("AMAX: load byte, rom=%d addr=%06x (%06x) data=%02x (%02x) PC=%08X\n"), rom_oddeven, romptr, addr, v, val, M68K_GETPC); } static void amax_check (void) @@ -52,7 +52,7 @@ static void amax_check (void) /* DIR low = reset address counter */ if ((bfd100 & 2)) { if (romptr && AMAX_LOG > 0) - write_log (L"AMAX: counter reset PC=%08X\n", M68K_GETPC); + write_log (_T("AMAX: counter reset PC=%08X\n"), M68K_GETPC); romptr = 0; } } @@ -68,7 +68,7 @@ void amax_diskwrite (uae_u16 w) if (dwlastbit && !(w & 0x8000)) { romptr++; if (AMAX_LOG > 0) - write_log (L"AMAX: counter increase %d PC=%08X\n", romptr, M68K_GETPC); + write_log (_T("AMAX: counter increase %d PC=%08X\n"), romptr, M68K_GETPC); } dwlastbit = (w & 0x8000) ? 1 : 0; w <<= 1; @@ -89,7 +89,7 @@ void amax_bfe001_write (uae_u8 pra, uae_u8 dra) data <<= 1; data |= 1; if (AMAX_LOG > 0) - write_log (L"AMAX: data shifted\n"); + write_log (_T("AMAX: data shifted\n")); } /* TK0 = even, WPRO = odd */ rom_oddeven = -1; @@ -139,9 +139,9 @@ void amax_init (void) if (!currprefs.amaxromfile[0]) return; amax_reset (); - z = zfile_fopen (currprefs.amaxromfile, L"rb", ZFD_NORMAL); + z = zfile_fopen (currprefs.amaxromfile, _T("rb"), ZFD_NORMAL); if (!z) { - write_log (L"AMAX: failed to load rom '%s'\n", currprefs.amaxromfile); + write_log (_T("AMAX: failed to load rom '%s'\n"), currprefs.amaxromfile); return; } zfile_fseek (z, 0, SEEK_END); @@ -150,7 +150,7 @@ void amax_init (void) rom = xmalloc (uae_u8, rom_size); zfile_fread (rom, rom_size, 1, z); zfile_fclose (z); - write_log (L"AMAX: '%s' loaded, %d bytes\n", currprefs.amaxromfile, rom_size); + write_log (_T("AMAX: '%s' loaded, %d bytes\n"), currprefs.amaxromfile, rom_size); dselect = 0x20; } diff --git a/ar.cpp b/ar.cpp index e2a943d3..bded36a6 100644 --- a/ar.cpp +++ b/ar.cpp @@ -217,7 +217,7 @@ #define write_log_debug #endif -static TCHAR *cart_memnames[] = { NULL, L"hrtmon", L"arhrtmon", L"superiv" }; +static TCHAR *cart_memnames[] = { NULL, _T("hrtmon"), _T("arhrtmon"), _T("superiv") }; #define ARMODE_FREEZE 0 /* AR2/3 The action replay 'freeze' button has been pressed. */ #define ARMODE_BREAKPOINT_AR2 2 /* AR2: The action replay is activated via a breakpoint. */ @@ -458,19 +458,19 @@ static uae_u8 *REGPARAM2 hrtmem_xlate (uaecptr addr) static addrbank hrtmem_bank = { hrtmem_lget, hrtmem_wget, hrtmem_bget, hrtmem_lput, hrtmem_wput, hrtmem_bput, - hrtmem_xlate, hrtmem_check, NULL, L"Cartridge Bank", + hrtmem_xlate, hrtmem_check, NULL, _T("Cartridge Bank"), hrtmem_lget, hrtmem_wget, ABFLAG_RAM }; static addrbank hrtmem2_bank = { hrtmem2_lget, hrtmem2_wget, hrtmem2_bget, hrtmem2_lput, hrtmem2_wput, hrtmem2_bput, - hrtmem2_xlate, hrtmem2_check, NULL, L"Cartridge Bank 2", + hrtmem2_xlate, hrtmem2_check, NULL, _T("Cartridge Bank 2"), hrtmem2_lget, hrtmem2_wget, ABFLAG_RAM }; static addrbank hrtmem3_bank = { hrtmem3_lget, hrtmem3_wget, hrtmem3_bget, hrtmem3_lput, hrtmem3_wput, hrtmem3_bput, - hrtmem3_xlate, hrtmem3_check, NULL, L"Cartridge Bank 3", + hrtmem3_xlate, hrtmem3_check, NULL, _T("Cartridge Bank 3"), hrtmem3_lget, hrtmem3_wget, ABFLAG_RAM }; @@ -585,19 +585,19 @@ STATIC_INLINE int ar3a (uaecptr addr, uae_u8 b, int writing) armode = b; if (armode >= 2) { if (armode == ARMODE_BREAKPOINT_AR2) { - write_log (L"AR2: exit with breakpoint(s) active\n"); /* Correct for AR2 */ + write_log (_T("AR2: exit with breakpoint(s) active\n")); /* Correct for AR2 */ } else if (armode == ARMODE_BREAKPOINT_AR3_RESET_AR2 ) - write_log (L"AR3: exit waiting for breakpoint.\n"); /* Correct for AR3 (waiting for breakpoint)*/ + write_log (_T("AR3: exit waiting for breakpoint.\n")); /* Correct for AR3 (waiting for breakpoint)*/ else - write_log (L"AR2/3: mode(%d) > 3 this shouldn't happen.\n", armode); + write_log (_T("AR2/3: mode(%d) > 3 this shouldn't happen.\n"), armode); } else - write_log (L"AR: exit with armode(%d)\n", armode); + write_log (_T("AR: exit with armode(%d)\n"), armode); set_special (SPCFLAG_ACTION_REPLAY); action_replay_flag = ACTION_REPLAY_HIDE; } else if (addr == 6) { copytoamiga (regs.vbr + 0x7c, artemp, 4); - write_log (L"AR: chipmem returned\n"); + write_log (_T("AR: chipmem returned\n")); } return 0; } @@ -689,19 +689,19 @@ static uae_u32 REGPARAM2 arram_lget (uaecptr addr) addr &= arram_mask; m = (uae_u32 *)(armemory_ram + addr); if (strncmp ("T8", (char*)m, 2) == 0) - write_log_debug (L"Reading T8 from addr %08x PC=%p\n", addr, m68k_getpc ()); + write_log_debug (_T("Reading T8 from addr %08x PC=%p\n"), addr, m68k_getpc ()); if (strncmp ("LAME", (char*)m, 4) == 0) - write_log_debug (L"Reading LAME from addr %08x PC=%p\n", addr, m68k_getpc ()); + write_log_debug (_T("Reading LAME from addr %08x PC=%p\n"), addr, m68k_getpc ()); if (strncmp ("RES1", (char*)m, 4) == 0) - write_log_debug (L"Reading RES1 from addr %08x PC=%p\n", addr, m68k_getpc ()); + write_log_debug (_T("Reading RES1 from addr %08x PC=%p\n"), addr, m68k_getpc ()); if (strncmp ("ARON", (char*)m, 4) == 0) - write_log_debug (L"Reading ARON from addr %08x PC=%p\n", addr, m68k_getpc ()); + write_log_debug (_T("Reading ARON from addr %08x PC=%p\n"), addr, m68k_getpc ()); if (strncmp ("KILL", (char*)m, 4) == 0) - write_log_debug (L"Reading KILL from addr %08x PC=%p\n", addr, m68k_getpc ()); + write_log_debug (_T("Reading KILL from addr %08x PC=%p\n"), addr, m68k_getpc ()); if (strncmp ("BRON", (char*)m, 4) == 0) - write_log_debug (L"Reading BRON from addr %08x PC=%p\n", addr, m68k_getpc ()); + write_log_debug (_T("Reading BRON from addr %08x PC=%p\n"), addr, m68k_getpc ()); if (strncmp ("PRIN", (char*)m, 4) == 0) - write_log_debug (L"Reading PRIN from addr %08x PC=%p\n", addr, m68k_getpc ()); + write_log_debug (_T("Reading PRIN from addr %08x PC=%p\n"), addr, m68k_getpc ()); return do_get_mem_long (m); } @@ -738,19 +738,19 @@ void REGPARAM2 arram_lput (uaecptr addr, uae_u32 l) addr &= arram_mask; m = (uae_u32 *)(armemory_ram + addr); if (strncmp ("T8", (char*)m, 2) == 0) - write_log_debug (L"Writing T8 to addr %08x PC=%p\n", addr, m68k_getpc ()); + write_log_debug (_T("Writing T8 to addr %08x PC=%p\n"), addr, m68k_getpc ()); if (strncmp ("LAME", (char*)m, 4) == 0) - write_log_debug (L"Writing LAME to addr %08x PC=%p\n", addr, m68k_getpc ()); + write_log_debug (_T("Writing LAME to addr %08x PC=%p\n"), addr, m68k_getpc ()); if (strncmp ("RES1", (char*)m, 4) == 0) - write_log_debug (L"Writing RES1 to addr %08x PC=%p\n", addr, m68k_getpc ()); + write_log_debug (_T("Writing RES1 to addr %08x PC=%p\n"), addr, m68k_getpc ()); if (strncmp ("ARON", (char*)m, 4) == 0) - write_log_debug (L"Writing ARON to addr %08x PC=%p\n", addr, m68k_getpc ()); + write_log_debug (_T("Writing ARON to addr %08x PC=%p\n"), addr, m68k_getpc ()); if (strncmp ("KILL", (char*)m, 4) == 0) - write_log_debug (L"Writing KILL to addr %08x PC=%p\n", addr, m68k_getpc ()); + write_log_debug (_T("Writing KILL to addr %08x PC=%p\n"), addr, m68k_getpc ()); if (strncmp ("BRON", (char*)m, 4) == 0) - write_log_debug (L"Writing BRON to addr %08x PC=%p\n", addr, m68k_getpc ()); + write_log_debug (_T("Writing BRON to addr %08x PC=%p\n"), addr, m68k_getpc ()); if (strncmp ("PRIN", (char*)m, 4) == 0) - write_log_debug (L"Writing PRIN to addr %08x PC=%p\n", addr, m68k_getpc ()); + write_log_debug (_T("Writing PRIN to addr %08x PC=%p\n"), addr, m68k_getpc ()); do_put_mem_long (m, l); } @@ -872,13 +872,13 @@ static uae_u8 *REGPARAM2 arrom_xlate (uaecptr addr) static addrbank arrom_bank = { arrom_lget, arrom_wget, arrom_bget, arrom_lput, arrom_wput, arrom_bput, - arrom_xlate, arrom_check, NULL, L"Action Replay ROM", + arrom_xlate, arrom_check, NULL, _T("Action Replay ROM"), arrom_lget, arrom_wget, ABFLAG_ROM }; static addrbank arram_bank = { arram_lget, arram_wget, arram_bget, arram_lput, arram_wput, arram_bput, - arram_xlate, arram_check, NULL, L"Action Replay RAM", + arram_xlate, arram_check, NULL, _T("Action Replay RAM"), arram_lget, arram_wget, ABFLAG_RAM }; @@ -1020,7 +1020,7 @@ void hrtmon_enter (void) if (!hrtmemory) return; hrtmon_map_banks (); - write_log (L"%s: freeze\n", cart_memnames[cart_type]); + write_log (_T("%s: freeze\n"), cart_memnames[cart_type]); hrtmon_go(); } @@ -1030,23 +1030,23 @@ void action_replay_enter (void) return; triggered_once = 1; if (armodel == 1) { - write_log (L"AR1: Enter PC:%p\n", m68k_getpc ()); + write_log (_T("AR1: Enter PC:%p\n"), m68k_getpc ()); action_replay_go1 (7); unset_special (SPCFLAG_ACTION_REPLAY); return; } if (action_replay_flag == ACTION_REPLAY_DORESET) { - write_log (L"AR2/3: reset\n"); + write_log (_T("AR2/3: reset\n")); armode = ARMODE_BREAKPOINT_AR3_RESET_AR2; } else if (armode == ARMODE_FREEZE) { - write_log (L"AR2/3: activated (freeze)\n"); + write_log (_T("AR2/3: activated (freeze)\n")); } else if (armode >= 2) { if (armode == ARMODE_BREAKPOINT_AR2) - write_log (L"AR2: activated (breakpoint)\n"); + write_log (_T("AR2: activated (breakpoint)\n")); else if (armode == ARMODE_BREAKPOINT_AR3_RESET_AR2) - write_log (L"AR3: activated (breakpoint)\n"); + write_log (_T("AR3: activated (breakpoint)\n")); else - write_log (L"AR2/3: mode(%d) > 3 this shouldn't happen.\n", armode); + write_log (_T("AR2/3: mode(%d) > 3 this shouldn't happen.\n"), armode); armode = ARMODE_BREAKPOINT_ACTIVATED; } action_replay_go(); @@ -1059,7 +1059,7 @@ void check_prefs_changed_carts (int in_memory_reset) if (currprefs.cart_internal != changed_prefs.cart_internal) currprefs.cart_internal = changed_prefs.cart_internal; if (_tcscmp (currprefs.cartfile, changed_prefs.cartfile) != 0) { - write_log (L"Cartridge ROM Prefs changed.\n"); + write_log (_T("Cartridge ROM Prefs changed.\n")); if (action_replay_unload (in_memory_reset)) { memcpy (currprefs.cartfile, changed_prefs.cartfile, sizeof currprefs.cartfile); #ifdef ACTION_REPLAY @@ -1101,8 +1101,8 @@ void action_replay_reset (void) action_replay_flag = ACTION_REPLAY_ACTIVE; hide_cart (0); } else { - write_log_debug (L"Setting flag to ACTION_REPLAY_WAITRESET\n"); - write_log_debug (L"armode == %d\n", armode); + write_log_debug (_T("Setting flag to ACTION_REPLAY_WAITRESET\n")); + write_log_debug (_T("armode == %d\n"), armode); action_replay_flag = ACTION_REPLAY_WAITRESET; hide_cart (0); } @@ -1176,7 +1176,7 @@ void hrtmon_hide(void) cartridge_exit(); hrtmon_flag = ACTION_REPLAY_IDLE; unset_special (SPCFLAG_ACTION_REPLAY); - //write_log (L"HRTMON: Exit\n"); + //write_log (_T("HRTMON: Exit\n")); } void hrtmon_breakenter(void) @@ -1222,7 +1222,7 @@ static void action_replay_patch (void) armemory_rom[off2 + 1] = (uae_u8)((off1 + kickmem_start + 2) >> 16); armemory_rom[off2 + 2] = (uae_u8)((off1 + kickmem_start + 2) >> 8); armemory_rom[off2 + 3] = (uae_u8)((off1 + kickmem_start + 2) >> 0); - write_log (L"AR ROM patched for KS2.0+\n"); + write_log (_T("AR ROM patched for KS2.0+\n")); } /* Returns 0 if the checksum is OK. @@ -1322,7 +1322,7 @@ static void action_replay_fixup_checksum (uae_u32 new_checksum) if (checksum) do_put_mem_long (checksum, new_checksum); else - write_log (L"Unable to locate Checksum in ROM.\n"); + write_log (_T("Unable to locate Checksum in ROM.\n")); return; } @@ -1397,7 +1397,7 @@ static void disable_rom_test (void) if (do_get_mem_word((uae_u16*)(addr-6)) == 0x6100 && /* bsr.w */ do_get_mem_word((uae_u16*)(addr-2)) == 0x41fa) /* lea relative */ { - write_log (L"Patching to disable ROM TEST.\n"); + write_log (_T("Patching to disable ROM TEST.\n")); do_put_mem_word((uae_u16*)(addr-6), 0x4e75); /* rts */ } } @@ -1409,7 +1409,7 @@ static void disable_rom_test (void) if (do_get_mem_word((uae_u16*)(addr-6)) == 0x6100 && /* bsr.w */ do_get_mem_word((uae_u16*)(addr-2)) == 0x41f9) /* lea absolute */ { - write_log (L"Patching to disable ROM TEST.\n"); + write_log (_T("Patching to disable ROM TEST.\n")); do_put_mem_word((uae_u16*)(addr-6), 0x4e75); /* rts */ } } @@ -1427,9 +1427,9 @@ static void action_replay_checksum_info (void) if (!armemory_rom) return; if (action_replay_calculate_checksum() == 0) - write_log (L"Action Replay Checksum is OK.\n"); + write_log (_T("Action Replay Checksum is OK.\n")); else - write_log (L"Action Replay Checksum is INVALID.\n"); + write_log (_T("Action Replay Checksum is INVALID.\n")); disable_rom_test(); } @@ -1465,32 +1465,32 @@ static void action_replay_unsetbanks (void) int action_replay_unload (int in_memory_reset) { static const TCHAR *state[] = { - L"ACTION_REPLAY_WAIT_PC", - L"ACTION_REPLAY_INACTIVE", - L"ACTION_REPLAY_WAITRESET", - L"0", - L"ACTION_REPLAY_IDLE", - L"ACTION_REPLAY_ACTIVATE", - L"ACTION_REPLAY_ACTIVE", - L"ACTION_REPLAY_DORESET", - L"ACTION_REPLAY_HIDE", + _T("ACTION_REPLAY_WAIT_PC"), + _T("ACTION_REPLAY_INACTIVE"), + _T("ACTION_REPLAY_WAITRESET"), + _T("0"), + _T("ACTION_REPLAY_IDLE"), + _T("ACTION_REPLAY_ACTIVATE"), + _T("ACTION_REPLAY_ACTIVE"), + _T("ACTION_REPLAY_DORESET"), + _T("ACTION_REPLAY_HIDE"), }; - write_log_debug (L"Action Replay State:(%s)\nHrtmon State:(%s)\n", + write_log_debug (_T("Action Replay State:(%s)\nHrtmon State:(%s)\n"), state[action_replay_flag + 3], state[hrtmon_flag + 3]); if (armemory_rom && armodel == 1) { if (is_ar_pc_in_ram() || is_ar_pc_in_rom() || action_replay_flag == ACTION_REPLAY_WAIT_PC) { - write_log (L"Can't Unload Action Replay 1. It is Active.\n"); + write_log (_T("Can't Unload Action Replay 1. It is Active.\n")); return 0; } } else { if (action_replay_flag != ACTION_REPLAY_IDLE && action_replay_flag != ACTION_REPLAY_INACTIVE) { - write_log (L"Can't Unload Action Replay. It is Active.\n"); + write_log (_T("Can't Unload Action Replay. It is Active.\n")); return 0; /* Don't unload it whilst it's active, or it will crash the amiga if not the emulator */ } if (hrtmon_flag != ACTION_REPLAY_IDLE && hrtmon_flag != ACTION_REPLAY_INACTIVE) { - write_log (L"Can't Unload Hrtmon. It is Active.\n"); + write_log (_T("Can't Unload Hrtmon. It is Active.\n")); return 0; /* Don't unload it whilst it's active, or it will crash the amiga if not the emulator */ } } @@ -1527,8 +1527,8 @@ static int superiv_init (struct romdata *rd, struct zfile *f) hrtmem2_start = 0xf20000; hrtmem2_size = 0x10000; hrtmem_rom = 1; - memname1 = L"xpower_e2"; - memname2 = L"xpower_f2"; + memname1 = _T("xpower_e2"); + memname2 = _T("xpower_f2"); } else if (flags & ROMTYPE_NORDIC) { /* nordic */ hrtmem_start = 0xf00000; hrtmem_size = 0x10000; @@ -1537,12 +1537,12 @@ static int superiv_init (struct romdata *rd, struct zfile *f) hrtmem2_end = 0xf60000; hrtmem2_size = 0x10000; hrtmem_rom = 1; - memname1 = L"nordic_f0"; - memname2 = L"nordic_f4"; + memname1 = _T("nordic_f0"); + memname2 = _T("nordic_f4"); if (subtype == 70) { hrtmem_start += 0x60000; hrtmem_end += 0x60000; - memname1 = L"nordic_f6"; + memname1 = _T("nordic_f6"); } } else { /* super4 */ hrtmem_start = 0xd00000; @@ -1552,9 +1552,9 @@ static int superiv_init (struct romdata *rd, struct zfile *f) hrtmem2_size2 = 0x0c0000; hrtmem3_start = 0xe00000; hrtmem3_size = 0x80000; - memname1 = L"superiv_d0"; - memname2 = L"superiv_b0"; - memname3 = L"superiv_e0"; + memname1 = _T("superiv_d0"); + memname2 = _T("superiv_b0"); + memname3 = _T("superiv_e0"); } if (hrtmem2_size && !hrtmem2_size2) hrtmem2_size2 = hrtmem2_size; @@ -1610,7 +1610,7 @@ static int superiv_init (struct romdata *rd, struct zfile *f) } hrtmon_flag = ACTION_REPLAY_IDLE; - write_log (L"%s installed at %08X\n", cart_memnames[cart_type], hrtmem_start); + write_log (_T("%s installed at %08X\n"), cart_memnames[cart_type], hrtmem_start); return 1; } @@ -1622,10 +1622,10 @@ int action_replay_load (void) armodel = 0; action_replay_flag = ACTION_REPLAY_INACTIVE; - write_log_debug (L"Entered action_replay_load ()\n"); + write_log_debug (_T("Entered action_replay_load ()\n")); /* Don't load a rom if one is already loaded. Use action_replay_unload () first. */ if (armemory_rom || hrtmemory) { - write_log (L"action_replay_load () ROM already loaded.\n"); + write_log (_T("action_replay_load () ROM already loaded.\n")); return 0; } @@ -1640,12 +1640,12 @@ int action_replay_load (void) } f = read_rom_name (currprefs.cartfile); if (!f) { - write_log (L"failed to load '%s' cartridge ROM\n", currprefs.cartfile); + write_log (_T("failed to load '%s' cartridge ROM\n"), currprefs.cartfile); return 0; } rd = getromdatabyzfile(f); if (!rd) { - write_log (L"Unknown cartridge ROM\n"); + write_log (_T("Unknown cartridge ROM\n")); } else { if (rd->type & (ROMTYPE_SUPERIV | ROMTYPE_NORDIC | ROMTYPE_XPOWER)) { return superiv_init (rd, f); @@ -1661,7 +1661,7 @@ int action_replay_load (void) return 0; } if (ar_rom_file_size != 65536 && ar_rom_file_size != 131072 && ar_rom_file_size != 262144) { - write_log (L"rom size must be 64KB (AR1), 128KB (AR2) or 256KB (AR3)\n"); + write_log (_T("rom size must be 64KB (AR1), 128KB (AR2) or 256KB (AR3)\n")); zfile_fclose(f); return 0; } @@ -1686,7 +1686,7 @@ int action_replay_load (void) arram_mask = arram_size - 1; arrom_mask = arrom_size - 1; armemory_ram = xcalloc (uae_u8, arram_size); - write_log (L"Action Replay %d installed at %08X, size %08X\n", armodel, arrom_start, arrom_size); + write_log (_T("Action Replay %d installed at %08X, size %08X\n"), armodel, arrom_start, arrom_size); action_replay_version(); return armodel; } @@ -1794,7 +1794,7 @@ int hrtmon_load (void) return 0; f = read_rom_name (currprefs.cartfile); if(!f) { - write_log (L"failed to load '%s' cartridge ROM\n", currprefs.cartfile); + write_log (_T("failed to load '%s' cartridge ROM\n"), currprefs.cartfile); return 0; } zfile_fread(header, sizeof header, 1, f); @@ -1816,15 +1816,15 @@ int hrtmon_load (void) extern unsigned char hrtrom[]; extern unsigned int hrtrom_len; struct zfile *zf; - zf = zfile_fopen_data (L"hrtrom.gz", hrtrom_len, hrtrom); - // f = zfile_fopen (L"d:\\amiga\\amiga\\hrtmon\\src\\hrtmon.rom", L"rb", 0); + zf = zfile_fopen_data (_T("hrtrom.gz"), hrtrom_len, hrtrom); + // f = zfile_fopen (_T("d:\\amiga\\amiga\\hrtmon\\src\\hrtmon.rom"), _T("rb"), 0); f = zfile_gunzip (zf); #else return 0; #endif cart_type = CART_HRTMON; } - hrtmemory = mapped_malloc (hrtmem_size, L"hrtmem"); + hrtmemory = mapped_malloc (hrtmem_size, _T("hrtmem")); memset (hrtmemory, 0xff, 0x80000); zfile_fseek (f, 0, SEEK_SET); zfile_fread (hrtmemory, 1, 524288, f); @@ -1843,7 +1843,7 @@ int hrtmon_load (void) #endif hrtmem_bank.baseaddr = hrtmemory; hrtmon_flag = ACTION_REPLAY_IDLE; - write_log (L"%s installed at %08X\n", cart_memnames[cart_type], hrtmem_start); + write_log (_T("%s installed at %08X\n"), cart_memnames[cart_type], hrtmem_start); return 1; } @@ -1959,7 +1959,7 @@ void action_replay_version(void) if (iArVersionMajor > 0) { TCHAR *s = au (sArDate); - write_log (L"Version of cart is '%d.%.02d', date is '%s'\n", iArVersionMajor, iArVersionMinor, s); + write_log (_T("Version of cart is '%d.%.02d', date is '%s'\n"), iArVersionMajor, iArVersionMinor, s); xfree (s); } } diff --git a/arcadia.cpp b/arcadia.cpp index 8b05fe7b..f1c49e62 100644 --- a/arcadia.cpp +++ b/arcadia.cpp @@ -48,23 +48,23 @@ struct arcadiarom *arcadia_bios, *arcadia_game; static struct arcadiarom roms[] = { - { 49, L"ar_bios.zip", L"scpa21", ARCADIA_BIOS, 0, 6, 1, 0, 2, 3, 4, 5, 7 }, - { 50, L"ar_bios.zip", L"gcp-", ARCADIA_BIOS, 3, 7, 6, 5, 4, 3, 2, 1, 0 }, - { 51, L"ar_bios.zip", L"scpav3_0.", ARCADIA_BIOS, 0, 6, 1, 0, 2, 3, 4, 5, 7 }, - - { 33, L"ar_airh.zip", L"airh_", ARCADIA_GAME, 1, 5, 0, 2, 4, 7, 6, 1, 3 }, - { 34, L"ar_bowl.zip", L"bowl_", ARCADIA_GAME, 1, 7, 6, 0, 1, 2, 3, 4, 5 }, - { 35, L"ar_dart.zip", L"dart_", ARCADIA_GAME, 1, 4, 0, 7, 6, 3, 1, 2, 5 }, - { 36, L"ar_fast.zip", L"fastv28.", ARCADIA_GAME, 0, 7, 6, 5, 4, 3, 2, 1, 0 }, - { 37, L"ar_ldrb.zip", L"lbg240", ARCADIA_GAME, 0, 7, 6, 5, 4, 3, 2, 1, 0 }, - { 38, L"ar_ldrba.zip",L"ldrb_", ARCADIA_GAME, 1, 2, 3, 4, 1, 0, 7, 5, 6 }, - { 39, L"ar_ninj.zip", L"ninj_", ARCADIA_GAME, 1, 1, 6, 5, 7, 4, 2, 0, 3 }, - { 40, L"ar_rdwr.zip", L"rdwr_", ARCADIA_GAME, 1, 3, 1, 6, 4, 0, 5, 2, 7 }, - { 41, L"ar_sdwr.zip", L"sdwr_", ARCADIA_GAME, 1, 6, 3, 4, 5, 2, 1, 0, 7 }, - { 42, L"ar_spot.zip", L"spotv2.", ARCADIA_GAME, 0, 7, 6, 5, 4, 3, 2, 1, 0 }, - { 43, L"ar_sprg.zip", L"sprg_", ARCADIA_GAME, 1, 4, 7, 3, 0, 6, 5, 2, 1 }, - { 44, L"ar_xeon.zip", L"xeon_", ARCADIA_GAME, 1, 3, 1, 2, 4, 0, 5, 6, 7 }, - { 45, L"ar_socc.zip", L"socc30.", ARCADIA_GAME, 2, 0, 7, 1, 6, 5, 4, 3, 2 }, + { 49, _T("ar_bios.zip"), _T("scpa21"), ARCADIA_BIOS, 0, 6, 1, 0, 2, 3, 4, 5, 7 }, + { 50, _T("ar_bios.zip"), _T("gcp-"), ARCADIA_BIOS, 3, 7, 6, 5, 4, 3, 2, 1, 0 }, + { 51, _T("ar_bios.zip"), _T("scpav3_0."), ARCADIA_BIOS, 0, 6, 1, 0, 2, 3, 4, 5, 7 }, + + { 33, _T("ar_airh.zip"), _T("airh_"), ARCADIA_GAME, 1, 5, 0, 2, 4, 7, 6, 1, 3 }, + { 34, _T("ar_bowl.zip"), _T("bowl_"), ARCADIA_GAME, 1, 7, 6, 0, 1, 2, 3, 4, 5 }, + { 35, _T("ar_dart.zip"), _T("dart_"), ARCADIA_GAME, 1, 4, 0, 7, 6, 3, 1, 2, 5 }, + { 36, _T("ar_fast.zip"), _T("fastv28."), ARCADIA_GAME, 0, 7, 6, 5, 4, 3, 2, 1, 0 }, + { 37, _T("ar_ldrb.zip"), _T("lbg240"), ARCADIA_GAME, 0, 7, 6, 5, 4, 3, 2, 1, 0 }, + { 38, _T("ar_ldrba.zip"),_T("ldrb_"), ARCADIA_GAME, 1, 2, 3, 4, 1, 0, 7, 5, 6 }, + { 39, _T("ar_ninj.zip"), _T("ninj_"), ARCADIA_GAME, 1, 1, 6, 5, 7, 4, 2, 0, 3 }, + { 40, _T("ar_rdwr.zip"), _T("rdwr_"), ARCADIA_GAME, 1, 3, 1, 6, 4, 0, 5, 2, 7 }, + { 41, _T("ar_sdwr.zip"), _T("sdwr_"), ARCADIA_GAME, 1, 6, 3, 4, 5, 2, 1, 0, 7 }, + { 42, _T("ar_spot.zip"), _T("spotv2."), ARCADIA_GAME, 0, 7, 6, 5, 4, 3, 2, 1, 0 }, + { 43, _T("ar_sprg.zip"), _T("sprg_"), ARCADIA_GAME, 1, 4, 7, 3, 0, 6, 5, 2, 1 }, + { 44, _T("ar_xeon.zip"), _T("xeon_"), ARCADIA_GAME, 1, 3, 1, 2, 4, 0, 5, 6, 7 }, + { 45, _T("ar_socc.zip"), _T("socc30."), ARCADIA_GAME, 2, 0, 7, 1, 6, 5, 4, 3, 2 }, { -1 } }; @@ -92,18 +92,18 @@ static int load_rom8 (TCHAR *xpath, uae_u8 *mem, int extra) TCHAR path[MAX_DPATH]; int i; uae_u8 *tmp = xmalloc (uae_u8, 131072); - TCHAR *bin = extra == 1 ? L".bin" : L""; + TCHAR *bin = extra == 1 ? _T(".bin") : _T(""); memset (tmp, 0, 131072); - _stprintf (path, L"%s%s%s", xpath, extra == 3 ? L"-hi" : (extra == 2 ? L"hi" : L"h"), bin); - zf = zfile_fopen (path, L"rb", ZFD_NORMAL); + _stprintf (path, _T("%s%s%s"), xpath, extra == 3 ? _T("-hi") : (extra == 2 ? _T("hi") : _T("h")), bin); + zf = zfile_fopen (path, _T("rb"), ZFD_NORMAL); if (!zf) goto end; if (zfile_fread (tmp, 65536, 1, zf) == 0) goto end; zfile_fclose (zf); - _stprintf (path, L"%s%s%s", xpath, extra == 3 ? L"-lo" : (extra == 2 ? L"lo" : L"l"), bin); - zf = zfile_fopen (path, L"rb", ZFD_NORMAL); + _stprintf (path, _T("%s%s%s"), xpath, extra == 3 ? _T("-lo") : (extra == 2 ? _T("lo") : _T("l")), bin); + zf = zfile_fopen (path, _T("rb"), ZFD_NORMAL); if (!zf) goto end; if (zfile_fread (tmp + 65536, 65536, 1, zf) == 0) @@ -179,17 +179,17 @@ static int load_roms (struct arcadiarom *rom) offset = bios_offset; i = 0; for (;;) { - _stprintf (path, L"%s%d", xpath, i + 1); + _stprintf (path, _T("%s%d"), xpath, i + 1); if (!load_rom8 (path, arbmemory + 2 * 65536 * i + offset, rom->extra)) { if (i == 0) - write_log (L"Arcadia: %s rom load failed ('%s')\n", rom->type == ARCADIA_BIOS ? L"bios" : L"game", path); + write_log (_T("Arcadia: %s rom load failed ('%s')\n"), rom->type == ARCADIA_BIOS ? _T("bios") : _T("game"), path); break; } i++; } if (i == 0) return 0; - write_log (L"Arcadia: %s rom %s loaded\n", rom->type == ARCADIA_BIOS ? L"bios" : L"game", xpath); + write_log (_T("Arcadia: %s rom %s loaded\n"), rom->type == ARCADIA_BIOS ? _T("bios") : _T("game"), xpath); return 1; } @@ -264,7 +264,7 @@ static void REGPARAM2 arbb_bput (uaecptr addr, uae_u32 b) static addrbank arcadia_boot_bank = { arbb_lget, arbb_wget, arbb_bget, arbb_lput, arbb_wput, arbb_bput, - default_xlate, default_check, NULL, L"Arcadia BIOS", + default_xlate, default_check, NULL, _T("Arcadia BIOS"), arbb_lget, arbb_wget, ABFLAG_ROM }; @@ -331,7 +331,7 @@ static void REGPARAM2 arb_bput (uaecptr addr, uae_u32 b) static addrbank arcadia_rom_bank = { arb_lget, arb_wget, arb_bget, arb_lput, arb_wput, arb_bput, - default_xlate, default_check, NULL, L"Arcadia Game ROM", + default_xlate, default_check, NULL, _T("Arcadia Game ROM"), arb_lget, arb_wget, ABFLAG_ROM }; @@ -363,9 +363,9 @@ int is_arcadia_rom (const TCHAR *path) static void nvram_write (void) { - struct zfile *f = zfile_fopen (currprefs.flashfile, L"rb+", ZFD_NORMAL); + struct zfile *f = zfile_fopen (currprefs.flashfile, _T("rb+"), ZFD_NORMAL); if (!f) { - f = zfile_fopen (currprefs.flashfile, L"wb", 0); + f = zfile_fopen (currprefs.flashfile, _T("wb"), 0); if (!f) return; } @@ -377,7 +377,7 @@ static void nvram_read (void) { struct zfile *f; - f = zfile_fopen (currprefs.flashfile, L"rb", ZFD_NORMAL); + f = zfile_fopen (currprefs.flashfile, _T("rb"), ZFD_NORMAL); memset (arbmemory + nvram_offset, 0, NVRAM_SIZE); if (!f) return; @@ -462,7 +462,7 @@ struct romdata *scan_arcadia_rom (TCHAR *path, int cnt) for (i = 0; arc_rl[i]; i++) { if (arc_rl[i]->rd->id == arcadia_rom->romid) { rd = arc_rl[i]->rd; - _tcscat (path, L"/"); + _tcscat (path, _T("/")); _tcscat (path, arcadia_rom->rom); break; } diff --git a/archivers/dms/pfile.cpp b/archivers/dms/pfile.cpp index d02cd9c3..ef064746 100644 --- a/archivers/dms/pfile.cpp +++ b/archivers/dms/pfile.cpp @@ -44,14 +44,14 @@ static void printbandiz(UCHAR *, USHORT); static int passfound, passretries; -static TCHAR modes[7][7]={L"NOCOMP",L"SIMPLE",L"QUICK ",L"MEDIUM",L"DEEP ",L"HEAVY1",L"HEAVY2"}; +static TCHAR modes[7][7]={_T("NOCOMP"),_T("SIMPLE"),_T("QUICK "),_T("MEDIUM"),_T("DEEP "),_T("HEAVY1"),_T("HEAVY2")}; static USHORT PWDCRC; UCHAR *dms_text; static void log_error(int track) { - write_log (L"DMS: Ignored error on track %d!\n", track); + write_log (_T("DMS: Ignored error on track %d!\n"), track); } static void addextra(TCHAR *name, struct zfile **extra, uae_u8 *p, int size) @@ -149,18 +149,18 @@ USHORT DMS_Process_File(struct zfile *fi, struct zfile *fo, USHORT cmd, USHORT o if (dolog) { pv = (USHORT)(c_version/100); - write_log (L" Created with DMS version %d.%02d ",pv,c_version-pv*100); + write_log (_T(" Created with DMS version %d.%02d "),pv,c_version-pv*100); if (geninfo & 0x80) - write_log (L"Registered\n"); + write_log (_T("Registered\n")); else - write_log (L"Evaluation\n"); + write_log (_T("Evaluation\n")); - write_log (L" Creation date : %s",ctime(&date)); - write_log (L" Lowest track in archive : %d\n",from); - write_log (L" Highest track in archive : %d\n",to); - write_log (L" Packed data size : %lu\n",pkfsize); - write_log (L" Unpacked data size : %lu\n",unpkfsize); - write_log (L" Disk type of archive : "); + write_log (_T(" Creation date : %s"),ctime(&date)); + write_log (_T(" Lowest track in archive : %d\n"),from); + write_log (_T(" Highest track in archive : %d\n"),to); + write_log (_T(" Packed data size : %lu\n"),pkfsize); + write_log (_T(" Unpacked data size : %lu\n"),unpkfsize); + write_log (_T(" Disk type of archive : ")); /* The original DMS from SDS software (DMS up to 1.11) used other values */ /* in disk type to indicate formats as MS-DOS, AMax and Mac, but it was */ @@ -171,49 +171,49 @@ USHORT DMS_Process_File(struct zfile *fi, struct zfile *fo, USHORT cmd, USHORT o case 0: case 1: /* Can also be a non-dos disk */ - write_log (L"AmigaOS 1.0 OFS\n"); + write_log (_T("AmigaOS 1.0 OFS\n")); break; case 2: - write_log (L"AmigaOS 2.0 FFS\n"); + write_log (_T("AmigaOS 2.0 FFS\n")); break; case 3: - write_log (L"AmigaOS 3.0 OFS / International\n"); + write_log (_T("AmigaOS 3.0 OFS / International\n")); break; case 4: - write_log (L"AmigaOS 3.0 FFS / International\n"); + write_log (_T("AmigaOS 3.0 FFS / International\n")); break; case 5: - write_log (L"AmigaOS 3.0 OFS / Dir Cache\n"); + write_log (_T("AmigaOS 3.0 OFS / Dir Cache\n")); break; case 6: - write_log (L"AmigaOS 3.0 FFS / Dir Cache\n"); + write_log (_T("AmigaOS 3.0 FFS / Dir Cache\n")); break; case 7: - write_log (L"FMS Amiga System File\n"); + write_log (_T("FMS Amiga System File\n")); break; default: - write_log (L"Unknown\n"); + write_log (_T("Unknown\n")); } - write_log (L" Compression mode used : "); + write_log (_T(" Compression mode used : ")); if (cmode>6) - write_log (L"Unknown !\n"); + write_log (_T("Unknown !\n")); else - write_log (L"%s\n",modes[cmode]); - - write_log (L" General info : "); - if ((geninfo==0)||(geninfo==0x80)) write_log (L"None"); - if (geninfo & 1) write_log (L"NoZero "); - if (geninfo & 2) write_log (L"Encrypted "); - if (geninfo & 4) write_log (L"Appends "); - if (geninfo & 8) write_log (L"Banner "); - if (geninfo & 16) write_log (L"HD "); - if (geninfo & 32) write_log (L"MS-DOS "); - if (geninfo & 64) write_log (L"DMS_DEV_Fixed "); - if (geninfo & 256) write_log (L"FILEID.DIZ"); - write_log (L"\n"); - - write_log (L" Info Header CRC : %04X\n\n",hcrc); + write_log (_T("%s\n"),modes[cmode]); + + write_log (_T(" General info : ")); + if ((geninfo==0)||(geninfo==0x80)) write_log (_T("None")); + if (geninfo & 1) write_log (_T("NoZero ")); + if (geninfo & 2) write_log (_T("Encrypted ")); + if (geninfo & 4) write_log (_T("Appends ")); + if (geninfo & 8) write_log (_T("Banner ")); + if (geninfo & 16) write_log (_T("HD ")); + if (geninfo & 32) write_log (_T("MS-DOS ")); + if (geninfo & 64) write_log (_T("DMS_DEV_Fixed ")); + if (geninfo & 256) write_log (_T("FILEID.DIZ")); + write_log (_T("\n")); + + write_log (_T(" Info Header CRC : %04X\n\n"),hcrc); } @@ -227,8 +227,8 @@ USHORT DMS_Process_File(struct zfile *fi, struct zfile *fo, USHORT cmd, USHORT o if (dolog) { - write_log (L" Track Plength Ulength Cmode USUM HCRC DCRC Cflag\n"); - write_log (L" ------ ------- ------- ------ ---- ---- ---- -----\n"); + write_log (_T(" Track Plength Ulength Cmode USUM HCRC DCRC Cflag\n")); + write_log (_T(" ------ ------- ------- ------ ---- ---- ---- -----\n")); } // if (((cmd==CMD_UNPACK) || (cmd==CMD_SHOWBANNER)) && (geninfo & 2) && (!pwd)) @@ -256,14 +256,14 @@ USHORT DMS_Process_File(struct zfile *fi, struct zfile *fo, USHORT cmd, USHORT o uae_u8 b1[THLEN]; if (zfile_fread(b1,1,THLEN,fi) != 1) { - write_log (L"DMS: unexpected end of file\n"); + write_log (_T("DMS: unexpected end of file\n")); break; } - write_log (L"DMS: corrupted track, searching for next track header..\n"); + write_log (_T("DMS: corrupted track, searching for next track header..\n")); if (b1[0] == 'T' && b1[1] == 'R') { USHORT hcrc = (USHORT)((b1[THLEN-2] << 8) | b1[THLEN-1]); if (CreateCRC(b1,(ULONG)(THLEN-2)) == hcrc) { - write_log (L"DMS: found checksum correct track header, retrying..\n"); + write_log (_T("DMS: found checksum correct track header, retrying..\n")); zfile_fseek (fi, SEEK_CUR, -THLEN); ok = 1; break; @@ -277,7 +277,7 @@ USHORT DMS_Process_File(struct zfile *fi, struct zfile *fo, USHORT cmd, USHORT o } } - if ((cmd == CMD_VIEWFULL) || (cmd == CMD_SHOWDIZ) || (cmd == CMD_SHOWBANNER)) write_log (L"\n"); + if ((cmd == CMD_VIEWFULL) || (cmd == CMD_SHOWDIZ) || (cmd == CMD_SHOWBANNER)) write_log (_T("\n")); if (ret == DMS_FILE_END) ret = NO_PROBLEM; @@ -330,19 +330,19 @@ static USHORT Process_Track(struct zfile *fi, struct zfile *fo, UCHAR *b1, UCHAR dcrc = (USHORT)((b1[16] << 8) | b1[17]); /* Track Data CRC BEFORE unpacking */ if (dolog) - write_log (L"DMS: track=%d\n", number); + write_log (_T("DMS: track=%d\n"), number); if (dolog) { if (number==80) - write_log (L" FileID "); + write_log (_T(" FileID ")); else if (number==0xffff) - write_log (L" Banner "); + write_log (_T(" Banner ")); else if ((number==0) && (unpklen==1024)) - write_log (L" FakeBB "); + write_log (_T(" FakeBB ")); else - write_log (L" %2d ",(short)number); + write_log (_T(" %2d "),(short)number); - write_log (L"%5d %5d %s %04X %04X %04X %0d\n", pklen1, unpklen, modes[cmode], usum, hcrc, dcrc, flags); + write_log (_T("%5d %5d %s %04X %04X %04X %0d\n"), pklen1, unpklen, modes[cmode], usum, hcrc, dcrc, flags); } if ((pklen1 > TRACK_BUFFER_LEN) || (pklen2 >TRACK_BUFFER_LEN) || (unpklen > TRACK_BUFFER_LEN)) return ERR_BIGTRACK; @@ -371,7 +371,7 @@ static USHORT Process_Track(struct zfile *fi, struct zfile *fo, UCHAR *b1, UCHAR zfile_fseek (fo, 0, SEEK_SET); p = xcalloc (uae_u8, 512 * 22); zfile_fread (p, 512 * 22, 1, fo); - addextra(L"BigFakeBootBlock", extra, p, 512 * 22); + addextra(_T("BigFakeBootBlock"), extra, p, 512 * 22); xfree (p); } zfile_fseek (fo, number * 512 * 22 * ((dmsflags & DMSFLAG_HD) ? 2 : 1), SEEK_SET); @@ -382,7 +382,7 @@ static USHORT Process_Track(struct zfile *fi, struct zfile *fo, UCHAR *b1, UCHAR memset(b2, 0, unpklen); if (!crcerr) Unpack_Track(b1, b2, pklen2, unpklen, cmode, flags, number, pklen1, usum, dmsflags & DMSFLAG_ENCRYPTED); - addextra(L"FakeBootBlock", extra, b2, unpklen); + addextra(_T("FakeBootBlock"), extra, b2, unpklen); } if (crcerr) @@ -391,7 +391,7 @@ static USHORT Process_Track(struct zfile *fi, struct zfile *fo, UCHAR *b1, UCHAR if (number == 0xffff) { if (extra){ Unpack_Track(b1, b2, pklen2, unpklen, cmode, flags, number, pklen1, usum, dmsflags & DMSFLAG_ENCRYPTED); - addextra(L"Banner", extra, b2, unpklen); + addextra(_T("Banner"), extra, b2, unpklen); } //printbandiz(b2,unpklen); } @@ -399,7 +399,7 @@ static USHORT Process_Track(struct zfile *fi, struct zfile *fo, UCHAR *b1, UCHAR if (number == 80) { if (extra) { Unpack_Track(b1, b2, pklen2, unpklen, cmode, flags, number, pklen1, usum, dmsflags & DMSFLAG_ENCRYPTED); - addextra(L"FILEID.DIZ", extra, b2, unpklen); + addextra(_T("FILEID.DIZ"), extra, b2, unpklen); } //printbandiz(b2,unpklen); } @@ -513,7 +513,7 @@ static USHORT Unpack_Track(UCHAR *b1, UCHAR *b2, USHORT pklen2, USHORT unpklen, if (usum1 == dms_Calc_CheckSum(b2,(ULONG)unpklen)) { passfound = maybeencrypted; if (passfound) - write_log (L"DMS: decryption key = 0x%04X\n", prevpass); + write_log (_T("DMS: decryption key = 0x%04X\n"), prevpass); err = NO_PROBLEM; pass = prevpass; break; @@ -549,7 +549,7 @@ static void printbandiz(UCHAR *m, USHORT len){ TCHAR *u; *i=0; u = au ((char*)j); - write_log (L"%s\n",u); + write_log (_T("%s\n"),u); xfree (u); j=i+1; } diff --git a/archivers/lha/header.cpp b/archivers/lha/header.cpp index 30d5b7ea..69def200 100644 --- a/archivers/lha/header.cpp +++ b/archivers/lha/header.cpp @@ -392,19 +392,19 @@ boolean get_header(struct zfile *fp, LzHeader *hdr) if (zfile_fread(data + I_HEADER_CHECKSUM, sizeof(char), header_size - 1, fp) < header_size - 1) { - fatal_error(L"Invalid header (LHarc file ?)"); + fatal_error(_T("Invalid header (LHarc file ?)")); return FALSE; /* finish */ } setup_get(data + I_HEADER_LEVEL); hdr->header_level = get_byte (); if (hdr->header_level != 2 && zfile_fread(data + header_size, sizeof(char), 2, fp) < 2) { - fatal_error(L"Invalid header (LHarc file ?)"); + fatal_error(_T("Invalid header (LHarc file ?)")); return FALSE; /* finish */ } if (hdr->header_level >= 3) { - fatal_error(L"Unknown level header"); + fatal_error(_T("Unknown level header")); return FALSE; } @@ -425,7 +425,7 @@ boolean get_header(struct zfile *fp, LzHeader *hdr) if ((hdr->header_level = get_byte ()) != 2) { if (calc_sum(data + I_METHOD, header_size) != checksum) - warning(L"Checksum error (LHarc file?)", L""); + warning(_T("Checksum error (LHarc file?)"), _T("")); name_length = get_byte (); for (i = 0; i < name_length; i++) hdr->name[i] = (char) get_byte (); @@ -448,7 +448,7 @@ boolean get_header(struct zfile *fp, LzHeader *hdr) hdr->extend_type = EXTEND_GENERIC; hdr->has_crc = FALSE; } else { - fatal_error(L"Unkonwn header (lha file?)"); + fatal_error(_T("Unkonwn header (lha file?)")); return FALSE; } } else { @@ -498,7 +498,7 @@ boolean get_header(struct zfile *fp, LzHeader *hdr) if (hdr->header_level != 2 && ((data + LZHEADER_STRAGE - get_ptr < header_size) || zfile_fread(get_ptr, sizeof(char), header_size, fp) < header_size)) { - fatal_error(L"Invalid header (LHa file ?)"); + fatal_error(_T("Invalid header (LHa file ?)")); return FALSE; } switch (get_byte ()) { diff --git a/archivers/lha/lhamaketbl.cpp b/archivers/lha/lhamaketbl.cpp index f32b42e0..ac4d2b70 100644 --- a/archivers/lha/lhamaketbl.cpp +++ b/archivers/lha/lhamaketbl.cpp @@ -37,7 +37,7 @@ void lha_make_table(short nchar, unsigned char bitlen[], short tablebits, unsign total += weight[i] * count[i]; } if ((total & 0xffff) != 0) - error(L"make_table()", L"Bad table (5)\n"); + error(_T("make_table()"), _T("Bad table (5)\n")); /* shift data for make table. */ m = 16 - tablebits; diff --git a/archivers/lha/lharc.cpp b/archivers/lha/lharc.cpp index 6d006cb4..05966b0a 100644 --- a/archivers/lha/lharc.cpp +++ b/archivers/lha/lharc.cpp @@ -161,7 +161,7 @@ char *xxrealloc(char *old, int size) { char *p = (char *) xrealloc(char, old, size); if (!p) - fatal_error(L"Not enough memory"); + fatal_error(_T("Not enough memory")); return p; } diff --git a/archivers/lzx/unlzx.cpp b/archivers/lzx/unlzx.cpp index a7b6d6e8..997c1e3b 100644 --- a/archivers/lzx/unlzx.cpp +++ b/archivers/lzx/unlzx.cpp @@ -667,7 +667,7 @@ struct zfile *archive_access_lzx (struct znode *zn) unpsize -= decrunch_length; crc_calc (pdest, decrunch_length); } else { - write_log (L"LZX corrupt compressed data %s\n", zn->name); + write_log (_T("LZX corrupt compressed data %s\n"), zn->name); goto end; } } @@ -812,7 +812,7 @@ struct zvolume *archive_directory_lzx (struct zfile *in_file) else abort = 0; /* continue */ - //write_log (L"unp=%6d mrg=%6d pack=%6d off=%6d %s\n", unpack_size, merge_size, pack_size, zn->offset, zai.name); + //write_log (_T("unp=%6d mrg=%6d pack=%6d off=%6d %s\n"), unpack_size, merge_size, pack_size, zn->offset, zai.name); } diff --git a/archivers/wrp/warp.cpp b/archivers/wrp/warp.cpp index 529a6e41..6fe49f08 100644 --- a/archivers/wrp/warp.cpp +++ b/archivers/wrp/warp.cpp @@ -403,8 +403,8 @@ struct zfile *unwarp(struct zfile *zf) if (!iswrp (buf)) break; if (!nf) { - nf = zfile_fopen_empty (zf, L"zipped.wrp", 1760 * 512); - tmpf = zfile_fopen_empty (zf, L"tmp", outsize2); + nf = zfile_fopen_empty (zf, _T("zipped.wrp"), 1760 * 512); + tmpf = zfile_fopen_empty (zf, _T("tmp"), outsize2); } track = (buf[10] << 8) | buf[11]; algo = buf[19]; @@ -447,19 +447,19 @@ struct zfile *unwarp(struct zfile *zf) } break; default: - write_log (L"WRP unknown compression method %d, track=%d,size=%d\n", algo, track, side); + write_log (_T("WRP unknown compression method %d, track=%d,size=%d\n"), algo, track, side); goto end; break; } if (err) { - write_log (L"WRP corrupt data, track=%d,side=%d,err=%d\n", track, side, err); + write_log (_T("WRP corrupt data, track=%d,side=%d,err=%d\n"), track, side, err); } else { uae_u16 crc2; int os = zfile_ftell (tmpf); data = zfile_getdata (tmpf, 0, os); crc2 = wrpcrc16 (wrpcrc16table, data, os); if (crc != crc2) - write_log (L"WRP crc error %04x<>%04x, track=%d,side=%d\n", crc, crc2, track, side); + write_log (_T("WRP crc error %04x<>%04x, track=%d,side=%d\n"), crc, crc2, track, side); xfree (data); } if (dstpos >= 0) { diff --git a/archivers/zip/unzip.cpp b/archivers/zip/unzip.cpp index c85ed4c5..c86c7a02 100644 --- a/archivers/zip/unzip.cpp +++ b/archivers/zip/unzip.cpp @@ -886,7 +886,7 @@ extern int ZEXPORT unzOpenCurrentFile (unzFile file) if ((s->cur_file_info.compression_method!=0) && (s->cur_file_info.compression_method!=Z_DEFLATED)) { - write_log (L"ZIP: unknown compression method %d\n", s->cur_file_info.compression_method); + write_log (_T("ZIP: unknown compression method %d\n"), s->cur_file_info.compression_method); err=UNZ_BADZIPFILE; } Store = s->cur_file_info.compression_method==0; diff --git a/audio.cpp b/audio.cpp index 5989dfb7..2a62900a 100644 --- a/audio.cpp +++ b/audio.cpp @@ -199,7 +199,7 @@ void audio_sampleripper (int mode) struct ripped_sample *rs = ripped_samples; int cnt = 1; TCHAR path[MAX_DPATH], name[MAX_DPATH], filename[MAX_DPATH]; - TCHAR underline[] = L"_"; + TCHAR underline[] = _T("_"); TCHAR extension[4]; struct zfile *wavfile; @@ -225,9 +225,9 @@ void audio_sampleripper (int mode) if (!name[0]) underline[0] = 0; namesplit (name); - _tcscpy (extension, L"wav"); - _stprintf (filename, L"%s%s%s%03.3d.%s", path, name, underline, cnt, extension); - wavfile = zfile_fopen (filename, L"wb", 0); + _tcscpy (extension, _T("wav")); + _stprintf (filename, _T("%s%s%s%03.3d.%s"), path, name, underline, cnt, extension); + wavfile = zfile_fopen (filename, _T("wb"), 0); if (wavfile) { int freq = rs->per > 0 ? (currprefs.ntscmode ? 3579545 : 3546895 / rs->per) : 8000; write_wavheader (wavfile, 0, 0); @@ -236,9 +236,9 @@ void audio_sampleripper (int mode) convertsample (rs->sample, rs->len); write_wavheader (wavfile, zfile_ftell(wavfile), freq); zfile_fclose (wavfile); - write_log (L"SAMPLERIPPER: %d: %dHz %d bytes\n", cnt, freq, rs->len); + write_log (_T("SAMPLERIPPER: %d: %dHz %d bytes\n"), cnt, freq, rs->len); } else { - write_log (L"SAMPLERIPPER: failed to open '%s'\n", filename); + write_log (_T("SAMPLERIPPER: failed to open '%s'\n"), filename); } } cnt++; @@ -271,7 +271,7 @@ static void do_samplerip (struct audio_channel_data *adp) xfree (rs->sample); rs->sample = xmalloc (uae_u8, len); memcpy (rs->sample, smp, len); - write_log (L"SAMPLERIPPER: replaced sample %d (%d -> %d)\n", cnt, rs->len, len); + write_log (_T("SAMPLERIPPER: replaced sample %d (%d -> %d)\n"), cnt, rs->len, len); rs->len = len; rs->per = adp->per / CYCLE_UNIT; rs->changed = 1; @@ -296,7 +296,7 @@ static void do_samplerip (struct audio_channel_data *adp) memcpy (rs->sample, smp, len); rs->next = NULL; rs->changed = 1; - write_log (L"SAMPLERIPPER: sample added (%06X, %d bytes), total %d samples\n", adp->pt, len, ++cnt); + write_log (_T("SAMPLERIPPER: sample added (%06X, %d bytes), total %d samples\n"), adp->pt, len, ++cnt); audio_sampleripper (0); } @@ -540,7 +540,7 @@ static void sinc_prehandler (unsigned long best_evtime) * write data into sinc queue for mixing in the BLEP */ if (acd->sinc_output_state != output) { if (acd->sinc_queue_length > SINC_QUEUE_LENGTH - 1) { - //write_log (L"warning: sinc queue truncated. Last age: %d.\n", acd->sinc_queue[SINC_QUEUE_LENGTH-1].age); + //write_log (_T("warning: sinc queue truncated. Last age: %d.\n"), acd->sinc_queue[SINC_QUEUE_LENGTH-1].age); acd->sinc_queue_length = SINC_QUEUE_LENGTH - 1; } /* make room for new and add the new value */ @@ -1054,7 +1054,7 @@ static void zerostate (int nr) struct audio_channel_data *cdp = audio_channel + nr; #if DEBUG_AUDIO > 0 if (debugchannel (nr)) - write_log (L"%d: ZEROSTATE\n", nr); + write_log (_T("%d: ZEROSTATE\n"), nr); #endif cdp->state = 0; cdp->evtime = MAX_EV; @@ -1156,7 +1156,7 @@ static void setirq (int nr, int which) struct audio_channel_data *cdp = audio_channel + nr; #if DEBUG_AUDIO > 0 if (debugchannel (nr) && cdp->wlen > 1) - write_log (L"SETIRQ%d (%d,%d) PC=%08X\n", nr, which, isirq (nr) ? 1 : 0, M68K_GETPC); + write_log (_T("SETIRQ%d (%d,%d) PC=%08X\n"), nr, which, isirq (nr) ? 1 : 0, M68K_GETPC); #endif INTREQ_0 (0x8000 | (0x80 << nr)); } @@ -1170,7 +1170,7 @@ static void newsample (int nr, sample8_t sample) #endif #if DEBUG_AUDIO > 2 if (debugchannel (nr)) - write_log (L"SAMPLE%d: %02x\n", nr, sample & 0xff); + write_log (_T("SAMPLE%d: %02x\n"), nr, sample & 0xff); #endif if (!(audio_channel_mask & (1 << nr))) sample = 0; @@ -1183,7 +1183,7 @@ STATIC_INLINE void setdr (int nr) struct audio_channel_data *cdp = audio_channel + nr; #if TEST_AUDIO > 0 if (debugchannel (nr) && cdp->dr) - write_log (L"%d: DR already active (STATE=%d)\n", nr, cdp->state); + write_log (_T("%d: DR already active (STATE=%d)\n"), nr, cdp->state); #endif cdp->drhpos = current_hpos (); cdp->dr = true; @@ -1191,7 +1191,7 @@ STATIC_INLINE void setdr (int nr) cdp->dsr = true; #if DEBUG_AUDIO > 0 if (debugchannel (nr) && cdp->wlen > 1) - write_log (L"DSR%d PT=%08X PC=%08X\n", nr, cdp->pt, M68K_GETPC); + write_log (_T("DSR%d PT=%08X PC=%08X\n"), nr, cdp->pt, M68K_GETPC); #endif } } @@ -1218,16 +1218,16 @@ static void loaddat (int nr, bool modper) #if TEST_AUDIO > 0 if (debugchannel (nr)) { if (cdp->hisample || cdp->losample) - write_log (L"%d: high or low sample not used\n", nr); + write_log (_T("%d: high or low sample not used\n"), nr); if (!cdp->have_dat) - write_log (L"%d: dat not updated. STATE=%d 1=%04x 2=%04x\n", nr, cdp->state, cdp->dat, cdp->dat2); + write_log (_T("%d: dat not updated. STATE=%d 1=%04x 2=%04x\n"), nr, cdp->state, cdp->dat, cdp->dat2); } cdp->hisample = cdp->losample = true; cdp->have_dat = false; #endif #if DEBUG_AUDIO > 2 if (debugchannel (nr)) - write_log (L"LOAD%dDAT: New:%04x, Old:%04x\n", nr, cdp->dat, cdp->dat2); + write_log (_T("LOAD%dDAT: New:%04x, Old:%04x\n"), nr, cdp->dat, cdp->dat2); #endif cdp->dat2 = cdp->dat; } @@ -1243,7 +1243,7 @@ STATIC_INLINE void loadper (int nr) cdp->evtime = cdp->per; if (cdp->evtime < CYCLE_UNIT) - write_log (L"LOADPER%d bug %d\n", nr, cdp->evtime); + write_log (_T("LOADPER%d bug %d\n"), nr, cdp->evtime); } @@ -1270,7 +1270,7 @@ static void audio_state_channel2 (int nr, bool perfin) // or CPU timed DMA wait routines in common tracker players will lose notes #if DEBUG_AUDIO > 0 if (debugchannel (nr)) - write_log (L"%d: INSTADMAOFF\n", nr, M68K_GETPC); + write_log (_T("%d: INSTADMAOFF\n"), nr, M68K_GETPC); #endif newsample (nr, (cdp->dat2 >> 0) & 0xff); if (napnav) @@ -1281,7 +1281,7 @@ static void audio_state_channel2 (int nr, bool perfin) #if DEBUG_AUDIO > 0 if (debugchannel (nr) && old_dma != chan_ena) { - write_log (L"%d:DMA=%d IRQ=%d PC=%08x\n", nr, chan_ena, isirq (nr) ? 1 : 0, M68K_GETPC); + write_log (_T("%d:DMA=%d IRQ=%d PC=%08x\n"), nr, chan_ena, isirq (nr) ? 1 : 0, M68K_GETPC); } #endif switch (cdp->state) @@ -1305,7 +1305,7 @@ static void audio_state_channel2 (int nr, bool perfin) #endif #if DEBUG_AUDIO > 0 if (debugchannel (nr)) { - write_log (L"%d:0>1: LEN=%d PC=%08x\n", nr, cdp->wlen, M68K_GETPC); + write_log (_T("%d:0>1: LEN=%d PC=%08x\n"), nr, cdp->wlen, M68K_GETPC); } #endif } else if (cdp->dat_written && !isirq (nr)) { @@ -1335,7 +1335,7 @@ static void audio_state_channel2 (int nr, bool perfin) return; #if TEST_AUDIO > 0 if (debugchannel (nr) && !cdp->have_dat) - write_log (L"%d: state 1 but no have_dat\n", nr); + write_log (_T("%d: state 1 but no have_dat\n"), nr); cdp->have_dat = false; cdp->losample = cdp->hisample = false; #endif @@ -1357,7 +1357,7 @@ static void audio_state_channel2 (int nr, bool perfin) return; #if DEBUG_AUDIO > 0 if (debugchannel (nr)) - write_log (L"%d:>5: LEN=%d PT=%08X PC=%08X\n", nr, cdp->wlen, cdp->pt, M68K_GETPC); + write_log (_T("%d:>5: LEN=%d PT=%08X PC=%08X\n"), nr, cdp->wlen, cdp->pt, M68K_GETPC); #endif if (cdp->ptx_written) { cdp->ptx_written = 0; @@ -1376,7 +1376,7 @@ static void audio_state_channel2 (int nr, bool perfin) if (cdp->pbufldl) { #if TEST_AUDIO > 0 if (debugchannel (nr) && cdp->hisample == false) - write_log (L"%d: high sample used twice\n", nr); + write_log (_T("%d: high sample used twice\n"), nr); cdp->hisample = false; #endif newsample (nr, (cdp->dat2 >> 8) & 0xff); @@ -1404,7 +1404,7 @@ static void audio_state_channel2 (int nr, bool perfin) if (cdp->pbufldl) { #if TEST_AUDIO > 0 if (debugchannel (nr) && cdp->losample == false) - write_log (L"%d: low sample used twice\n", nr); + write_log (_T("%d: low sample used twice\n"), nr); cdp->losample = false; #endif newsample (nr, (cdp->dat2 >> 0) & 0xff); @@ -1422,7 +1422,7 @@ static void audio_state_channel2 (int nr, bool perfin) if (isirq (nr)) { #if DEBUG_AUDIO > 0 if (debugchannel (nr)) - write_log (L"%d: IDLE\n", nr); + write_log (_T("%d: IDLE\n"), nr); #endif zerostate (nr); return; @@ -1583,9 +1583,9 @@ void set_audio (void) if (currprefs.produce_sound >= 2) { if (!init_audio ()) { if (! sound_available) { - write_log (L"Sound is not supported.\n"); + write_log (_T("Sound is not supported.\n")); } else { - write_log (L"Sorry, can't initialize sound.\n"); + write_log (_T("Sorry, can't initialize sound.\n")); currprefs.produce_sound = 1; /* So we don't do this every frame */ changed_prefs.produce_sound = 1; @@ -1766,7 +1766,7 @@ void update_audio (void) if (audio_channel[i].evtime == 0) { audio_state_channel (i, true); if (audio_channel[i].evtime == 0) { - write_log (L"evtime==0 sound bug channel %d\n"); + write_log (_T("evtime==0 sound bug channel %d\n")); audio_channel[i].evtime = MAX_EV; } } @@ -1801,7 +1801,7 @@ void AUDxDAT (int nr, uae_u16 v, uaecptr addr) #if DEBUG_AUDIO > 0 if (debugchannel (nr) && (DEBUG_AUDIO > 1 || (!chan_ena || addr == 0xffffffff || (cdp->state != 2 && cdp->state != 3)))) { - write_log (L"AUD%dDAT: %04X ADDR=%08X LEN=%d/%d %d,%d,%d %06X\n", nr, + write_log (_T("AUD%dDAT: %04X ADDR=%08X LEN=%d/%d %d,%d,%d %06X\n"), nr, v, addr, cdp->wlen, cdp->len, cdp->state, chan_ena, isirq (nr) ? 1 : 0, M68K_GETPC); } #endif @@ -1809,7 +1809,7 @@ void AUDxDAT (int nr, uae_u16 v, uaecptr addr) cdp->dat_written = true; #if TEST_AUDIO > 0 if (debugchannel (nr) && cdp->have_dat) - write_log (L"%d: audxdat 1=%04x 2=%04x but old dat not yet used\n", nr, cdp->dat, cdp->dat2); + write_log (_T("%d: audxdat 1=%04x 2=%04x but old dat not yet used\n"), nr, cdp->dat, cdp->dat2); cdp->have_dat = true; #endif if (cdp->state == 2 || cdp->state == 3) { @@ -1821,7 +1821,7 @@ void AUDxDAT (int nr, uae_u16 v, uaecptr addr) do_samplerip (cdp); #if DEBUG_AUDIO > 0 if (debugchannel (nr) && cdp->wlen > 1) - write_log (L"AUD%d looped, IRQ=%d, LC=%08X LEN=%d\n", nr, isirq (nr) ? 1 : 0, cdp->pt, cdp->wlen); + write_log (_T("AUD%d looped, IRQ=%d, LC=%08X LEN=%d\n"), nr, isirq (nr) ? 1 : 0, cdp->pt, cdp->wlen); #endif } else { cdp->wlen = (cdp->wlen - 1) & 0xffff; @@ -1868,7 +1868,7 @@ void AUDxLCH (int nr, uae_u16 v) } #if DEBUG_AUDIO > 0 if (debugchannel (nr)) - write_log (L"AUD%dLCH: %04X %08X (%d) (%d %d %08x)\n", nr, v, M68K_GETPC, cdp->state, cdp->dsr, cdp->ptx_written, cdp->ptx); + write_log (_T("AUD%dLCH: %04X %08X (%d) (%d %d %08x)\n"), nr, v, M68K_GETPC, cdp->state, cdp->dsr, cdp->ptx_written, cdp->ptx); #endif } @@ -1885,7 +1885,7 @@ void AUDxLCL (int nr, uae_u16 v) } #if DEBUG_AUDIO > 0 if (debugchannel (nr)) - write_log (L"AUD%dLCL: %04X %08X (%d) (%d %d %08x)\n", nr, v, M68K_GETPC, cdp->state, cdp->dsr, cdp->ptx_written, cdp->ptx); + write_log (_T("AUD%dLCL: %04X %08X (%d) (%d %d %08x)\n"), nr, v, M68K_GETPC, cdp->state, cdp->dsr, cdp->ptx_written, cdp->ptx); #endif } @@ -1923,7 +1923,7 @@ void AUDxPER (int nr, uae_u16 v) cdp->per = per; #if DEBUG_AUDIO > 0 if (debugchannel (nr)) - write_log (L"AUD%dPER: %d %08X\n", nr, v, M68K_GETPC); + write_log (_T("AUD%dPER: %d %08X\n"), nr, v, M68K_GETPC); #endif } @@ -1935,7 +1935,7 @@ void AUDxLEN (int nr, uae_u16 v) cdp->len = v; #if DEBUG_AUDIO > 0 if (debugchannel (nr)) - write_log (L"AUD%dLEN: %d %08X\n", nr, v, M68K_GETPC); + write_log (_T("AUD%dLEN: %d %08X\n"), nr, v, M68K_GETPC); #endif } @@ -1948,7 +1948,7 @@ void AUDxVOL (int nr, uae_u16 v) cdp->vol = v2; #if DEBUG_AUDIO > 0 if (debugchannel (nr)) - write_log (L"AUD%dVOL: %d %08X\n", nr, v2, M68K_GETPC); + write_log (_T("AUD%dVOL: %d %08X\n"), nr, v2, M68K_GETPC); #endif } @@ -1964,7 +1964,7 @@ void audio_update_adkmasks (void) if ((prevcon & 0xff) != (adkcon & 0xff)) { audio_activate (); #if DEBUG_AUDIO > 0 - write_log (L"ADKCON=%02x %08X\n", adkcon & 0xff, M68K_GETPC); + write_log (_T("ADKCON=%02x %08X\n"), adkcon & 0xff, M68K_GETPC); #endif prevcon = adkcon; } diff --git a/autoconf.cpp b/autoconf.cpp index 3a2618b6..c34dde6c 100644 --- a/autoconf.cpp +++ b/autoconf.cpp @@ -42,7 +42,7 @@ static int REGPARAM3 rtarea_check (uaecptr addr, uae_u32 size) REGPARAM; addrbank rtarea_bank = { rtarea_lget, rtarea_wget, rtarea_bget, rtarea_lput, rtarea_wput, rtarea_bput, - rtarea_xlate, rtarea_check, NULL, L"UAE Boot ROM", + rtarea_xlate, rtarea_check, NULL, _T("UAE Boot ROM"), rtarea_lget, rtarea_wget, ABFLAG_ROMIN }; @@ -188,7 +188,7 @@ void calltrap (uae_u32 n) void org (uae_u32 a) { if ( ((a & 0xffff0000) != 0x00f00000) && ((a & 0xffff0000) != rtarea_base) ) - write_log (L"ORG: corrupt address! %08X", a); + write_log (_T("ORG: corrupt address! %08X"), a); rt_addr = a & 0xffff; } @@ -204,7 +204,7 @@ void align (int b) static uae_u32 REGPARAM2 nullfunc (TrapContext *context) { - write_log (L"Null function called\n"); + write_log (_T("Null function called\n")); return 0; } @@ -223,9 +223,9 @@ static uae_u32 REGPARAM2 uae_puts (TrapContext *context) void rtarea_init_mem (void) { - rtarea = mapped_malloc (0x10000, L"rtarea"); + rtarea = mapped_malloc (0x10000, _T("rtarea")); if (!rtarea) { - write_log (L"virtual memory exhausted (rtarea)!\n"); + write_log (_T("virtual memory exhausted (rtarea)!\n")); abort (); } rtarea_bank.baseaddr = rtarea; @@ -244,12 +244,12 @@ void rtarea_init (void) rtarea_init_mem (); memset (rtarea, 0, 0x10000); - _stprintf (uaever, L"uae-%d.%d.%d", UAEMAJOR, UAEMINOR, UAESUBREV); + _stprintf (uaever, _T("uae-%d.%d.%d"), UAEMAJOR, UAEMINOR, UAESUBREV); EXPANSION_uaeversion = ds (uaever); - EXPANSION_explibname = ds (L"expansion.library"); - EXPANSION_doslibname = ds (L"dos.library"); - EXPANSION_uaedevname = ds (L"uae.device"); + EXPANSION_explibname = ds (_T("expansion.library")); + EXPANSION_doslibname = ds (_T("dos.library")); + EXPANSION_uaedevname = ds (_T("uae.device")); deftrap (NULL); /* Generic emulator trap */ @@ -259,13 +259,13 @@ void rtarea_init (void) a = here(); /* Dummy trap - removing this breaks the filesys emulation. */ org (rtarea_base + 0xFF00); - calltrap (deftrap2 (nullfunc, TRAPFLAG_NO_RETVAL, L"")); + calltrap (deftrap2 (nullfunc, TRAPFLAG_NO_RETVAL, _T(""))); org (rtarea_base + 0xFF80); - calltrap (deftrapres (getchipmemsize, TRAPFLAG_DORET, L"getchipmemsize")); + calltrap (deftrapres (getchipmemsize, TRAPFLAG_DORET, _T("getchipmemsize"))); org (rtarea_base + 0xFF10); - calltrap (deftrapres (uae_puts, TRAPFLAG_NO_RETVAL, L"uae_puts")); + calltrap (deftrapres (uae_puts, TRAPFLAG_NO_RETVAL, _T("uae_puts"))); dw (RTS); org (a); @@ -292,7 +292,7 @@ void rtarea_setup (void) { uaecptr base = need_uae_boot_rom (); if (base) { - write_log (L"RTAREA located at %08X\n", base); + write_log (_T("RTAREA located at %08X\n"), base); rtarea_base = base; } } diff --git a/blitter.cpp b/blitter.cpp index c6f85ed9..700c382f 100644 --- a/blitter.cpp +++ b/blitter.cpp @@ -265,10 +265,10 @@ STATIC_INLINE void record_dma_blit (uae_u16 reg, uae_u16 dat, uae_u32 addr, int static void blitter_dump (void) { - write_log (L"PT A=%08X B=%08X C=%08X D=%08X\n", bltapt, bltbpt, bltcpt, bltdpt); - write_log (L"CON0=%04X CON1=%04X DAT A=%04X B=%04X C=%04X\n", + write_log (_T("PT A=%08X B=%08X C=%08X D=%08X\n"), bltapt, bltbpt, bltcpt, bltdpt); + write_log (_T("CON0=%04X CON1=%04X DAT A=%04X B=%04X C=%04X\n"), bltcon0, bltcon1, blt_info.bltadat, blt_info.bltbdat, blt_info.bltcdat); - write_log (L"AFWM=%04X ALWM=%04X MOD A=%04X B=%04X C=%04X D=%04X\n", + write_log (_T("AFWM=%04X ALWM=%04X MOD A=%04X B=%04X C=%04X D=%04X\n"), blt_info.bltafwm, blt_info.bltalwm, blt_info.bltamod & 0xffff, blt_info.bltbmod & 0xffff, blt_info.bltcmod & 0xffff, blt_info.bltdmod & 0xffff); } @@ -348,7 +348,7 @@ static void blitter_done (int hpos) event2_remevent (ev2_blitter); unset_special (SPCFLAG_BLTNASTY); #ifdef BLITTER_DEBUG - write_log (L"cycles %d, missed %d, total %d\n", + write_log (_T("cycles %d, missed %d, total %d\n"), blit_totalcyclecounter, blit_misscyclecounter, blit_totalcyclecounter + blit_misscyclecounter); #endif } @@ -814,7 +814,7 @@ void blitter_handler (uae_u32 data) /* "free" blitter in immediate mode if it has been "stuck" ~3 frames * fixes some JIT game incompatibilities */ - debugtest (DEBUGTEST_BLITTER, L"force-unstuck!\n"); + debugtest (DEBUGTEST_BLITTER, _T("force-unstuck!\n")); } blitter_stuck = 0; if (blit_slowdown > 0 && !currprefs.immediate_blits) { @@ -884,7 +884,7 @@ STATIC_INLINE void blitter_doddma (int hpos) static int warn = 10; if (warn > 0) { warn--; - write_log (L"BLITTER: D-channel without nothing to do?\n"); + write_log (_T("BLITTER: D-channel without nothing to do?\n")); } blitter_vcounter2 = blitter_vcounter1 = blt_info.vblitsize; return; @@ -1134,7 +1134,7 @@ static void blitter_force_finish (void) */ odmacon = dmacon; dmacon |= DMA_MASTER | DMA_BLITTER; - write_log (L"forcing blitter finish\n"); + write_log (_T("forcing blitter finish\n")); if (blitter_cycle_exact) { int rounds = 10000; while (bltstate != BLT_done && rounds > 0) { @@ -1143,7 +1143,7 @@ static void blitter_force_finish (void) rounds--; } if (rounds == 0) - write_log (L"blitter froze!?\n"); + write_log (_T("blitter froze!?\n")); blit_startcycles = 0; } else { actually_do_blit (); @@ -1178,12 +1178,12 @@ static void blit_bltset (int con) blitline = 0; bltstate = BLT_done; blit_interrupt = 1; - write_log (L"BLITTER: register modification during linedraw!\n"); + write_log (_T("BLITTER: register modification during linedraw!\n")); } if (blitline) { if (blt_info.hblitsize != 2) - debugtest (DEBUGTEST_BLITTER, L"weird blt_info.hblitsize in linemode: %d vsize=%d\n", + debugtest (DEBUGTEST_BLITTER, _T("weird blt_info.hblitsize in linemode: %d vsize=%d\n"), blt_info.hblitsize, blt_info.vblitsize); blit_diag = blit_cycle_diagram_line; } else { @@ -1191,16 +1191,16 @@ static void blit_bltset (int con) blitfc = !!(bltcon1 & 0x4); blitife = !!(bltcon1 & 0x8); if ((bltcon1 & 0x18) == 0x18) { - debugtest (DEBUGTEST_BLITTER, L"weird fill mode\n"); + debugtest (DEBUGTEST_BLITTER, _T("weird fill mode\n")); blitife = 0; } } if (blitfill && !blitdesc) - debugtest (DEBUGTEST_BLITTER, L"fill without desc\n"); + debugtest (DEBUGTEST_BLITTER, _T("fill without desc\n")); blit_diag = blitfill && blit_cycle_diagram_fill[blit_ch][0] ? blit_cycle_diagram_fill[blit_ch] : blit_cycle_diagram[blit_ch]; } if ((bltcon1 & 0x80) && (currprefs.chipset_mask & CSMASK_ECS_AGNUS)) - debugtest (DEBUGTEST_BLITTER, L"ECS BLTCON1 DOFF-bit set\n"); + debugtest (DEBUGTEST_BLITTER, _T("ECS BLTCON1 DOFF-bit set\n")); // on the fly switching fillmode from extra cycle to non-extra: blitter freezes // non-extra cycle to extra cycle: does not freeze but cycle diagram goes weird, @@ -1212,7 +1212,7 @@ static void blit_bltset (int con) int iseo = olddiag >= &blit_cycle_diagram_fill[0][0] && olddiag <= &blit_cycle_diagram_fill[15][0]; if (iseo != isen) { if (freezes > 0) { - write_log (L"BLITTER: on the fly %d (%d) -> %d (%d) switch! PC=%08x\n", original_ch, iseo, blit_ch, isen, M68K_GETPC); + write_log (_T("BLITTER: on the fly %d (%d) -> %d (%d) switch! PC=%08x\n"), original_ch, iseo, blit_ch, isen, M68K_GETPC); freezes--; } } @@ -1220,10 +1220,10 @@ static void blit_bltset (int con) blit_frozen = 0; // switched back to original fill mode? unfreeze } else if (iseo && !isen) { blit_frozen = 1; - write_log (L"BLITTER: frozen! %d (%d) -> %d (%d) %08X\n", original_ch, iseo, blit_ch, isen, M68K_GETPC); + write_log (_T("BLITTER: frozen! %d (%d) -> %d (%d) %08X\n"), original_ch, iseo, blit_ch, isen, M68K_GETPC); } else if (!iseo && isen) { #ifdef BLITTER_DEBUG_NOWAIT - write_log (L"BLITTER: on the fly %d (%d) -> %d (%d) switch\n", original_ch, iseo, blit_ch, isen); + write_log (_T("BLITTER: on the fly %d (%d) -> %d (%d) switch\n"), original_ch, iseo, blit_ch, isen); #endif } } @@ -1237,7 +1237,7 @@ static void blit_bltset (int con) if (o != n) { if (changetable[o * 32 + n] < 10) { changetable[o * 32 + n]++; - write_log (L"BLITTER: channel mode changed while active (%02X->%02X) PC=%08x\n", o, n, M68K_GETPC); + write_log (_T("BLITTER: channel mode changed while active (%02X->%02X) PC=%08x\n"), o, n, M68K_GETPC); } } if (blit_ch == 13 && original_ch == 1) { @@ -1297,7 +1297,7 @@ static void do_blitter2 (int hpos, int copper) #ifdef BLITTER_DEBUG_NOWAIT if (bltstate != BLT_done) { if (blit_final) { - write_log (L"blitter was already active! PC=%08x\n", M68K_GETPC); + write_log (_T("blitter was already active! PC=%08x\n"), M68K_GETPC); //activate_debugger(); } } @@ -1361,10 +1361,10 @@ static void do_blitter2 (int hpos, int copper) ch++; if (blit_ch & 8) ch++; - write_log (L"blitstart: %dx%d ch=%d %d*%d=%d d=%d f=%02X n=%d pc=%p l=%d dma=%04X %s\n", + write_log (_T("blitstart: %dx%d ch=%d %d*%d=%d d=%d f=%02X n=%d pc=%p l=%d dma=%04X %s\n"), blt_info.hblitsize, blt_info.vblitsize, ch, blit_diag[0], cycles, blit_diag[0] * cycles, blitdesc ? 1 : 0, blitfill, dmaen (DMA_BLITPRI) ? 1 : 0, M68K_GETPC, blitline, - dmacon, ((dmacon & (DMA_MASTER | DMA_BLITTER)) == (DMA_MASTER | DMA_BLITTER)) ? L"" : L" off!"); + dmacon, ((dmacon & (DMA_MASTER | DMA_BLITTER)) == (DMA_MASTER | DMA_BLITTER)) ? _T("") : _T(" off!")); blitter_dump (); } #endif @@ -1454,14 +1454,14 @@ void maybe_blit (int hpos, int hack) if (warned && dmaen (DMA_BLITTER) && blt_info.got_cycle) { warned--; - debugtest (DEBUGTEST_BLITTER, L"program does not wait for blitter tc=%d\n", + debugtest (DEBUGTEST_BLITTER, _T("program does not wait for blitter tc=%d\n"), blit_cyclecounter); #ifdef BLITTER_DEBUG warned = 0; #endif #ifdef BLITTER_DEBUG_NOWAIT warned = 10; - write_log (L"program does not wait for blitter PC=%08x\n", M68K_GETPC); + write_log (_T("program does not wait for blitter PC=%08x\n"), M68K_GETPC); //activate_debugger (); //blitter_done (hpos); #endif @@ -1540,7 +1540,7 @@ void restore_blitter_finish (void) if (blt_statefile_type == 0) { blit_interrupt = 1; if (bltstate == BLT_init) { - write_log (L"blitter was started but DMA was inactive during save\n"); + write_log (_T("blitter was started but DMA was inactive during save\n")); //do_blitter (0); } if (blt_delayed_irq < 0) { @@ -1565,8 +1565,8 @@ uae_u8 *restore_blitter (uae_u8 *src) bltstate = (flags & 1) ? BLT_done : BLT_init; } if (flags & 2) { - write_log (L"blitter was force-finished when this statefile was saved\n"); - write_log (L"contact the author if restored program freezes\n"); + write_log (_T("blitter was force-finished when this statefile was saved\n")); + write_log (_T("contact the author if restored program freezes\n")); // there is a problem. if system ks vblank is active, we must not activate // "old" blit's intreq until vblank is handled or ks 1.x thinks it was blitter // interrupt.. @@ -1582,7 +1582,7 @@ uae_u8 *save_blitter (int *len, uae_u8 *dstptr) forced = 0; if (bltstate != BLT_done && bltstate != BLT_init) { - write_log (L"blitter is active, forcing immediate finish\n"); + write_log (_T("blitter is active, forcing immediate finish\n")); /* blitter is active just now but we don't have blitter state support yet */ blitter_force_finish (); forced = 2; @@ -1661,7 +1661,7 @@ uae_u8 *restore_blitter_new (uae_u8 *src) blit_diag = set_cycle_diagram_type (restore_u8 ()); if (restore_u16 () != 0x1234) - write_log (L"error\n"); + write_log (_T("error\n")); blitter_nasty = restore_u8 (); @@ -1697,7 +1697,7 @@ uae_u8 *save_blitter_new (int *len, uae_u8 *dstptr) save_u8 (state); if (bltstate != BLT_done) { - write_log (L"BLITTER active while saving state\n"); + write_log (_T("BLITTER active while saving state\n")); blitter_dump (); } diff --git a/blkdev.cpp b/blkdev.cpp index d89e3755..766bc5e9 100644 --- a/blkdev.cpp +++ b/blkdev.cpp @@ -172,7 +172,7 @@ static void install_driver (int flags) if (device_func[i] == devicetable[j]) { int ok = device_func[i]->openbus (0); driver_installed[j] = 1; - write_log (L"%s driver installed, ok=%d\n", device_func[i]->name, ok); + write_log (_T("%s driver installed, ok=%d\n"), device_func[i]->name, ok); break; } } @@ -250,7 +250,7 @@ static bool getsem (int unitnum, bool dowait) if (gotit) unitsem_cnt[unitnum]++; if (unitsem_cnt[unitnum] > 1) - write_log (L"CD: unitsem%d acquire mismatch! cnt=%d\n", unitnum, unitsem_cnt[unitnum]); + write_log (_T("CD: unitsem%d acquire mismatch! cnt=%d\n"), unitnum, unitsem_cnt[unitnum]); return gotit; } static bool getsem (int unitnum) @@ -261,7 +261,7 @@ static void freesem (int unitnum) { unitsem_cnt[unitnum]--; if (unitsem_cnt[unitnum] < 0) - write_log (L"CD: unitsem%d release mismatch! cnt=%d\n", unitnum, unitsem_cnt[unitnum]); + write_log (_T("CD: unitsem%d release mismatch! cnt=%d\n"), unitnum, unitsem_cnt[unitnum]); uae_sem_post (&unitsem[unitnum]); } static void sys_command_close_internal (int unitnum) @@ -269,7 +269,7 @@ static void sys_command_close_internal (int unitnum) getsem (unitnum, true); waspaused[unitnum] = 0; if (openlist[unitnum] <= 0) - write_log (L"BUG unit %d close: opencnt=%d!\n", unitnum, openlist[unitnum]); + write_log (_T("BUG unit %d close: opencnt=%d!\n"), unitnum, openlist[unitnum]); if (device_func[unitnum]) { device_func[unitnum]->closedev (unitnum); if (openlist[unitnum] > 0) @@ -289,7 +289,7 @@ static int sys_command_open_internal (int unitnum, const TCHAR *ident, cd_standa uae_sem_init (&unitsem[unitnum], 0, 1); getsem (unitnum, true); if (openlist[unitnum]) - write_log (L"BUG unit %d open: opencnt=%d!\n", unitnum, openlist[unitnum]); + write_log (_T("BUG unit %d open: opencnt=%d!\n"), unitnum, openlist[unitnum]); if (device_func[unitnum]) { ret = device_func[unitnum]->opendev (unitnum, ident, csu != CD_STANDARD_UNIT_DEFAULT); if (ret) @@ -303,39 +303,39 @@ static int getunitinfo (int unitnum, int drive, cd_standard_unit csu, int *isaud { struct device_info di; if (sys_command_info (unitnum, &di, 0)) { - write_log (L"Scanning drive %s: ", di.label); + write_log (_T("Scanning drive %s: "), di.label); if (di.media_inserted) { if (isaudiotrack (&di.toc, 0)) { if (*isaudio == 0) *isaudio = drive; - write_log (L"CDA"); + write_log (_T("CDA")); } uae_u8 buffer[2048]; if (sys_command_cd_read (unitnum, buffer, 16, 1)) { if (!memcmp (buffer + 8, "CDTV", 4) || !memcmp (buffer + 8, "CD32", 4) || !memcmp (buffer + 8, "COMM", 4)) { uae_u32 crc; - write_log (L"CD32 or CDTV"); + write_log (_T("CD32 or CDTV")); if (sys_command_cd_read (unitnum, buffer, 21, 1)) { crc = get_crc32 (buffer, sizeof buffer); if (crc == 0xe56c340f) { - write_log (L" [CD32.TM]"); + write_log (_T(" [CD32.TM]")); if (csu == CD_STANDARD_UNIT_CD32) { - write_log (L"\n"); + write_log (_T("\n")); return 1; } } } if (csu == CD_STANDARD_UNIT_CDTV || csu == CD_STANDARD_UNIT_CD32) { - write_log (L"\n"); + write_log (_T("\n")); return 1; } } } } else { - write_log (L"no media"); + write_log (_T("no media")); } } - write_log (L"\n"); + write_log (_T("\n")); return 0; } @@ -359,7 +359,7 @@ static int get_standard_cd_unit2 (cd_standard_unit csu) device_func_init (SCSI_UNIT_IOCTL); for (int drive = 'C'; drive <= 'Z'; ++drive) { TCHAR vol[100]; - _stprintf (vol, L"%c:\\", drive); + _stprintf (vol, _T("%c:\\"), drive); int drivetype = GetDriveType (vol); if (drivetype == DRIVE_CDROM) { if (sys_command_open_internal (unitnum, vol, csu)) { @@ -371,14 +371,14 @@ static int get_standard_cd_unit2 (cd_standard_unit csu) } if (isaudio) { TCHAR vol[100]; - _stprintf (vol, L"%c:\\", isaudio); + _stprintf (vol, _T("%c:\\"), isaudio); if (sys_command_open_internal (unitnum, vol, csu)) return unitnum; } fallback: device_func_init (SCSI_UNIT_IMAGE); - if (!sys_command_open_internal (unitnum, L"", csu)) { - write_log (L"image mounter failed to open as empty!?\n"); + if (!sys_command_open_internal (unitnum, _T(""), csu)) { + write_log (_T("image mounter failed to open as empty!?\n")); return -1; } return unitnum; @@ -499,7 +499,7 @@ static void check_changes (int unitnum) if (delayed[unitnum]) { delayed[unitnum]--; if (delayed[unitnum] == 0) - write_log (L"CD: startup delayed insert '%s'\n", currprefs.cdslots[unitnum].name[0] ? currprefs.cdslots[unitnum].name : L""); + write_log (_T("CD: startup delayed insert '%s'\n"), currprefs.cdslots[unitnum].name[0] ? currprefs.cdslots[unitnum].name : _T("")); return; } @@ -529,7 +529,7 @@ static void check_changes (int unitnum) filesys_do_disk_change (unitnum, 0); } } - write_log (L"CD: eject (%s) open=%d\n", pollmode ? L"slow" : L"fast", wasopen[unitnum] ? 1 : 0); + write_log (_T("CD: eject (%s) open=%d\n"), pollmode ? _T("slow") : _T("fast"), wasopen[unitnum] ? 1 : 0); #ifdef RETROPLATFORM rp_cd_image_change (unitnum, NULL); #endif @@ -549,14 +549,14 @@ static void check_changes (int unitnum) _tcscpy (changed_prefs.cdslots[unitnum].name, newimagefiles[unitnum]); currprefs.cdslots[unitnum].inuse = changed_prefs.cdslots[unitnum].inuse = cdimagefileinuse[unitnum]; newimagefiles[unitnum][0] = 0; - write_log (L"CD: delayed insert '%s' (open=%d,unit=%d)\n", currprefs.cdslots[unitnum].name[0] ? currprefs.cdslots[unitnum].name : L"", wasopen[unitnum] ? 1 : 0, unitnum); + write_log (_T("CD: delayed insert '%s' (open=%d,unit=%d)\n"), currprefs.cdslots[unitnum].name[0] ? currprefs.cdslots[unitnum].name : _T(""), wasopen[unitnum] ? 1 : 0, unitnum); device_func_init (0); if (wasopen[unitnum]) { if (!device_func[unitnum]->opendev (unitnum, currprefs.cdslots[unitnum].name, 0)) { - write_log (L"-> device open failed\n"); + write_log (_T("-> device open failed\n")); wasopen[unitnum] = 0; } else { - write_log (L"-> device reopened\n"); + write_log (_T("-> device reopened\n")); } } if (currprefs.scsi && wasopen[unitnum]) { @@ -975,32 +975,32 @@ void scsi_log_before (uae_u8 *cdb, int cdblen, uae_u8 *data, int datalen) { int i; for (i = 0; i < cdblen; i++) { - write_log (L"%s%02X", i > 0 ? L"." : L"", cdb[i]); + write_log (_T("%s%02X"), i > 0 ? _T(".") : _T(""), cdb[i]); } - write_log (L"\n"); + write_log (_T("\n")); if (data) { - write_log (L"DATAOUT: %d\n", datalen); + write_log (_T("DATAOUT: %d\n"), datalen); for (i = 0; i < datalen && i < 100; i++) - write_log (L"%s%02X", i > 0 ? L"." : L"", data[i]); + write_log (_T("%s%02X"), i > 0 ? _T(".") : _T(""), data[i]); if (datalen > 0) - write_log (L"\n"); + write_log (_T("\n")); } } void scsi_log_after (uae_u8 *data, int datalen, uae_u8 *sense, int senselen) { int i; - write_log (L"DATAIN: %d\n", datalen); + write_log (_T("DATAIN: %d\n"), datalen); for (i = 0; i < datalen && i < 100 && data; i++) - write_log (L"%s%02X", i > 0 ? L"." : L"", data[i]); + write_log (_T("%s%02X"), i > 0 ? _T(".") : _T(""), data[i]); if (data && datalen > 0) - write_log (L"\n"); + write_log (_T("\n")); if (senselen > 0) { - write_log (L"SENSE: %d,", senselen); + write_log (_T("SENSE: %d,"), senselen); for (i = 0; i < senselen && i < 32; i++) { - write_log (L"%s%02X", i > 0 ? L"." : L"", sense[i]); + write_log (_T("%s%02X"), i > 0 ? _T(".") : _T(""), sense[i]); } - write_log (L"\n"); + write_log (_T("\n")); } } @@ -1133,7 +1133,7 @@ static int scsi_emulate (int unitnum, uae_u8 *cmdbuf, int scsi_cmd_len, goto end; } if (log_scsiemu) - write_log (L"SCSIEMU %d: %02X.%02X.%02X.%02X.%02X.%02X.%02X.%02X.%02X.%02X.%02X.%02X CMDLEN=%d DATA=%08X LEN=%d\n", unitnum, + write_log (_T("SCSIEMU %d: %02X.%02X.%02X.%02X.%02X.%02X.%02X.%02X.%02X.%02X.%02X.%02X CMDLEN=%d DATA=%08X LEN=%d\n"), unitnum, cmdbuf[0], cmdbuf[1], cmdbuf[2], cmdbuf[3], cmdbuf[4], cmdbuf[5], cmdbuf[6], cmdbuf[7], cmdbuf[8], cmdbuf[9], cmdbuf[10], cmdbuf[11], scsi_cmd_len, scsi_data, *data_len); @@ -1208,7 +1208,7 @@ static int scsi_emulate (int unitnum, uae_u8 *cmdbuf, int scsi_cmd_len, if (cmdbuf[0] == 0x5a) dbd = 1; if (log_scsiemu) - write_log (L"MODE SENSE PC=%d CODE=%d DBD=%d\n", pc, pcode, dbd); + write_log (_T("MODE SENSE PC=%d CODE=%d DBD=%d\n"), pc, pcode, dbd); p = r; if (cmdbuf[0] == 0x5a) { p[0] = 8 - 1; @@ -1676,7 +1676,7 @@ notdatatrack: default: err: - write_log (L"CDEMU: unsupported scsi command 0x%02X\n", cmdbuf[0]); + write_log (_T("CDEMU: unsupported scsi command 0x%02X\n"), cmdbuf[0]); errreq: lr = -1; status = 2; /* CHECK CONDITION */ @@ -1691,7 +1691,7 @@ end: *reply_len = lr; *sense_len = ls; if (cmdbuf[0] && log_scsiemu) - write_log (L"-> DATAOUT=%d ST=%d SENSELEN=%d\n", scsi_len, status, ls); + write_log (_T("-> DATAOUT=%d ST=%d SENSELEN=%d\n"), scsi_len, status, ls); return status; } diff --git a/blkdev_cdimage.cpp b/blkdev_cdimage.cpp index 7384957c..6770989f 100644 --- a/blkdev_cdimage.cpp +++ b/blkdev_cdimage.cpp @@ -195,7 +195,7 @@ static void flac_get_size (struct cdtoc *t) } static uae_u8 *flac_get_data (struct cdtoc *t) { - write_log (L"FLAC: unpacking '%s'..\n", zfile_getname (t->handle)); + write_log (_T("FLAC: unpacking '%s'..\n"), zfile_getname (t->handle)); t->writeoffset = 0; FLAC__StreamDecoder *decoder = FLAC__stream_decoder_new (); if (decoder) { @@ -206,7 +206,7 @@ static uae_u8 *flac_get_data (struct cdtoc *t) &flac_write_callback, &flac_metadata_callback, &flac_error_callback, t); FLAC__stream_decoder_process_until_end_of_stream (decoder); FLAC__stream_decoder_delete (decoder); - write_log (L"FLAC: %s unpacked\n", zfile_getname (t->handle)); + write_log (_T("FLAC: %s unpacked\n"), zfile_getname (t->handle)); } return t->data; } @@ -385,10 +385,10 @@ static void *cdda_play_func (void *v) sector = cdu->cd_last_pos = cdda_pos; t = findtoc (cdu, §or); if (!t) { - write_log (L"IMAGE CDDA: illegal sector number %d\n", cdu->cdda_start); + write_log (_T("IMAGE CDDA: illegal sector number %d\n"), cdu->cdda_start); setstate (cdu, AUDIO_STATUS_PLAY_ERROR); } else { - write_log (L"IMAGE CDDA: playing from %d to %d, track %d ('%s', offset %d, secoffset %d)\n", + write_log (_T("IMAGE CDDA: playing from %d to %d, track %d ('%s', offset %d, secoffset %d)\n"), cdu->cdda_start, cdu->cdda_end, t->track, t->fname, t->offset, sector); // do this even if audio is not compressed, t->handle also could be // compressed and we want to unpack it in background too @@ -420,7 +420,7 @@ static void *cdda_play_func (void *v) for (int i = 2 * SUB_ENTRY_SIZE; i < SUB_CHANNEL_SIZE; i++) { if (subbuf[i]) { // non-zero R-W subchannels int diff = cdda_pos - sector + 2; - write_log (L"-> CD+G start pos fudge -> %d (%d)\n", sector, -diff); + write_log (_T("-> CD+G start pos fudge -> %d (%d)\n"), sector, -diff); idleframes -= diff; cdda_pos = sector; break; @@ -449,7 +449,7 @@ static void *cdda_play_func (void *v) if (idleframes <= 0 && cdda_pos >= cdu->cdda_start && !isaudiotrack (&cdu->di.toc, cdda_pos)) { setstate (cdu, AUDIO_STATUS_PLAY_ERROR); - write_log (L"IMAGE CDDA: attempted to play data track %d\n", cdda_pos); + write_log (_T("IMAGE CDDA: attempted to play data track %d\n"), cdda_pos); goto end; // data track? } @@ -546,7 +546,7 @@ end: delete cda; cdu->cdda_play = 0; - write_log (L"IMAGE CDDA: thread killed\n"); + write_log (_T("IMAGE CDDA: thread killed\n")); return NULL; } @@ -602,7 +602,7 @@ static int command_play (int unitnum, int startlsn, int endlsn, int scan, play_s return 0; } if (!cdu->cdda_play) - uae_start_thread (L"cdimage_cdda_play", cdda_play_func, cdu, NULL); + uae_start_thread (_T("cdimage_cdda_play"), cdda_play_func, cdu, NULL); cdu->cdda_play++; return 1; } @@ -651,7 +651,7 @@ static int command_qcode (int unitnum, uae_u8 *buf, int sector) return 0; getsub_deinterleaved (subbuf, cdu, td, pos); memcpy (p, subbuf + 12, 12); -// write_log (L"%6d %02x.%02x.%02x.%02x.%02x.%02x.%02x.%02x.%02x.%02x.%02x.%02x\n", +// write_log (_T("%6d %02x.%02x.%02x.%02x.%02x.%02x.%02x.%02x.%02x.%02x.%02x.%02x\n"), // pos, p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7], p[8], p[9], p[10], p[11]); return 1; } @@ -1002,7 +1002,7 @@ static int parsemds (struct cdunit *cdu, struct zfile *zmds, const TCHAR *img) struct cdtoc *t; uae_u8 *mds = NULL; - write_log (L"MDS TOC: '%s'\n", img); + write_log (_T("MDS TOC: '%s'\n"), img); int size = zfile_size (zmds); mds = xmalloc (uae_u8, size); if (!mds) @@ -1014,7 +1014,7 @@ static int parsemds (struct cdunit *cdu, struct zfile *zmds, const TCHAR *img) if (!memcmp (&head, MEDIA_DESCRIPTOR, strlen (MEDIA_DESCRIPTOR))) goto end; if (head->version[0] != 1) { - write_log (L"unsupported MDS version %d, only v.1 supported\n", head->version[0]); + write_log (_T("unsupported MDS version %d, only v.1 supported\n"), head->version[0]); goto end; } @@ -1058,7 +1058,7 @@ static int parsemds (struct cdunit *cdu, struct zfile *zmds, const TCHAR *img) fname = my_strdup (newname); } - t->handle = zfile_fopen (fname, L"rb", ZFD_NORMAL); + t->handle = zfile_fopen (fname, _T("rb"), ZFD_NORMAL); t->fname = my_strdup (fname); if (t->handle) t->filesize = zfile_size (t->handle); @@ -1093,24 +1093,24 @@ static int parseccd (struct cdunit *cdu, struct zfile *zcue, const TCHAR *img) struct zfile *zimg, *zsub; TCHAR fname[MAX_DPATH]; - write_log (L"CCD TOC: '%s'\n", img); + write_log (_T("CCD TOC: '%s'\n"), img); _tcscpy (fname, img); TCHAR *ext = _tcsrchr (fname, '.'); if (ext) *ext = 0; - _tcscat (fname, L".img"); - zimg = zfile_fopen (fname, L"rb", ZFD_NORMAL); + _tcscat (fname, _T(".img")); + zimg = zfile_fopen (fname, _T("rb"), ZFD_NORMAL); if (!zimg) { - write_log (L"CCD: can't open '%s'\n", fname); + write_log (_T("CCD: can't open '%s'\n"), fname); return 0; } ext = _tcsrchr (fname, '.'); if (ext) *ext = 0; - _tcscat (fname, L".sub"); - zsub = zfile_fopen (fname, L"rb", ZFD_NORMAL); + _tcscat (fname, _T(".sub")); + zsub = zfile_fopen (fname, _T("rb"), ZFD_NORMAL); if (zsub) - write_log (L"CCD: '%s' detected\n", fname); + write_log (_T("CCD: '%s' detected\n"), fname); num = -1; mode = -1; @@ -1120,9 +1120,9 @@ static int parseccd (struct cdunit *cdu, struct zfile *zcue, const TCHAR *img) break; p = buf; skipspace (&p); - if (!_tcsnicmp (p, L"[DISC]", 6)) { + if (!_tcsnicmp (p, _T("[DISC]"), 6)) { mode = 1; - } else if (!_tcsnicmp (p, L"[ENTRY ", 7)) { + } else if (!_tcsnicmp (p, _T("[ENTRY "), 7)) { t = NULL; mode = 2; num = readval (p + 7); @@ -1130,7 +1130,7 @@ static int parseccd (struct cdunit *cdu, struct zfile *zcue, const TCHAR *img) break; adr = control = -1; gotlba = false; - } else if (!_tcsnicmp (p, L"[TRACK ", 7)) { + } else if (!_tcsnicmp (p, _T("[TRACK "), 7)) { mode = 3; tracknum = readval (p + 7); trackmode = -1; @@ -1141,7 +1141,7 @@ static int parseccd (struct cdunit *cdu, struct zfile *zcue, const TCHAR *img) if (mode < 0) continue; if (mode == 1) { - if (!_tcsnicmp (p, L"TocEntries=", 11)) { + if (!_tcsnicmp (p, _T("TocEntries="), 11)) { cdu->tracks = readval (p + 11) - 3; if (cdu->tracks <= 0 || cdu->tracks > 99) break; @@ -1153,11 +1153,11 @@ static int parseccd (struct cdunit *cdu, struct zfile *zcue, const TCHAR *img) if (mode == 2) { - if (!_tcsnicmp (p, L"SESSION=", 8)) { + if (!_tcsnicmp (p, _T("SESSION="), 8)) { if (readval (p + 8) != 1) mode = -1; continue; - } else if (!_tcsnicmp (p, L"POINT=", 6)) { + } else if (!_tcsnicmp (p, _T("POINT="), 6)) { tracknum = readval (p + 6); if (tracknum <= 0) break; @@ -1170,11 +1170,11 @@ static int parseccd (struct cdunit *cdu, struct zfile *zcue, const TCHAR *img) t = &cdu->toc[tracknum - 1]; continue; } - if (!_tcsnicmp (p, L"ADR=", 4)) + if (!_tcsnicmp (p, _T("ADR="), 4)) adr = readval (p + 4); - if (!_tcsnicmp (p, L"CONTROL=", 8)) + if (!_tcsnicmp (p, _T("CONTROL="), 8)) control = readval (p + 8); - if (!_tcsnicmp (p, L"PLBA=", 5)) { + if (!_tcsnicmp (p, _T("PLBA="), 5)) { lba = readval (p + 5); gotlba = true; } @@ -1202,7 +1202,7 @@ static int parseccd (struct cdunit *cdu, struct zfile *zcue, const TCHAR *img) } else if (mode == 3) { - if (!_tcsnicmp (p, L"MODE=", 5)) + if (!_tcsnicmp (p, _T("MODE="), 5)) trackmode = _tstol (p + 5); if (trackmode < 0 || trackmode > 2) continue; @@ -1235,7 +1235,7 @@ static int parsecue (struct cdunit *cdu, struct zfile *zcue, const TCHAR *img) pregap = 0; fnametypeid = AUDENC_NONE; - write_log (L"CUE TOC: '%s'\n", img); + write_log (_T("CUE TOC: '%s'\n"), img); for (;;) { TCHAR buf[MAX_DPATH], *p; if (!zfile_fgets (buf, sizeof buf / sizeof (TCHAR), zcue)) @@ -1244,7 +1244,7 @@ static int parsecue (struct cdunit *cdu, struct zfile *zcue, const TCHAR *img) p = buf; skipspace (&p); - if (!_tcsnicmp (p, L"FILE", 4)) { + if (!_tcsnicmp (p, _T("FILE"), 4)) { p += 4; xfree (fname); fname = my_strdup (nextstring (&p)); @@ -1252,31 +1252,31 @@ static int parsecue (struct cdunit *cdu, struct zfile *zcue, const TCHAR *img) fnametypeid = AUDENC_NONE; if (!fnametype) break; - if (_tcsicmp (fnametype, L"BINARY") && _tcsicmp (fnametype, L"WAVE") && _tcsicmp (fnametype, L"MP3") && _tcsicmp (fnametype, L"FLAC")) { - write_log (L"CUE: unknown file type '%s' ('%s')\n", fnametype, fname); + if (_tcsicmp (fnametype, _T("BINARY")) && _tcsicmp (fnametype, _T("WAVE")) && _tcsicmp (fnametype, _T("MP3")) && _tcsicmp (fnametype, _T("FLAC"))) { + write_log (_T("CUE: unknown file type '%s' ('%s')\n"), fnametype, fname); } fnametypeid = AUDENC_PCM; - if (!_tcsicmp (fnametype, L"MP3")) + if (!_tcsicmp (fnametype, _T("MP3"))) fnametypeid = AUDENC_MP3; - else if (!_tcsicmp (fnametype, L"FLAC")) + else if (!_tcsicmp (fnametype, _T("FLAC"))) fnametypeid = AUDENC_FLAC; offset = 0; newfile = 1; ctrl = 0; - } else if (!_tcsnicmp (p, L"FLAGS", 5)) { + } else if (!_tcsnicmp (p, _T("FLAGS"), 5)) { ctrl &= ~(1 | 2 | 8); for (;;) { TCHAR *f = nextstring (&p); if (!f) break; - if (!_tcsicmp (f, L"PRE")) + if (!_tcsicmp (f, _T("PRE"))) ctrl |= 1; - if (!_tcsicmp (f, L"DCP")) + if (!_tcsicmp (f, _T("DCP"))) ctrl |= 2; - if (!_tcsicmp (f, L"4CH")) + if (!_tcsicmp (f, _T("4CH"))) ctrl |= 8; } - } else if (!_tcsnicmp (p, L"TRACK", 5)) { + } else if (!_tcsnicmp (p, _T("TRACK"), 5)) { int size; TCHAR *tracktype; @@ -1288,20 +1288,20 @@ static int parsecue (struct cdunit *cdu, struct zfile *zcue, const TCHAR *img) if (!tracktype) break; size = 2352; - if (!_tcsicmp (tracktype, L"AUDIO")) { + if (!_tcsicmp (tracktype, _T("AUDIO"))) { ctrl &= ~4; } else { ctrl |= 4; - if (!_tcsicmp (tracktype, L"MODE1/2048")) + if (!_tcsicmp (tracktype, _T("MODE1/2048"))) size = 2048; - else if (!_tcsicmp (tracktype, L"MODE1/2352")) + else if (!_tcsicmp (tracktype, _T("MODE1/2352"))) size = 2352; - else if (!_tcsicmp (tracktype, L"MODE2/2336") || !_tcsicmp (tracktype, L"CDI/2336")) + else if (!_tcsicmp (tracktype, _T("MODE2/2336")) || !_tcsicmp (tracktype, _T("CDI/2336"))) size = 2336; - else if (!_tcsicmp (tracktype, L"MODE2/2352") || !_tcsicmp (tracktype, L"CDI/2352")) + else if (!_tcsicmp (tracktype, _T("MODE2/2352")) || !_tcsicmp (tracktype, _T("CDI/2352"))) size = 2352; else { - write_log (L"CUE: unknown tracktype '%s' ('%s')\n", tracktype, fname); + write_log (_T("CUE: unknown tracktype '%s' ('%s')\n"), tracktype, fname); } } if (tracknum >= 1 && tracknum <= 99) { @@ -1315,14 +1315,14 @@ static int parsecue (struct cdunit *cdu, struct zfile *zcue, const TCHAR *img) } newfile = 0; - ztrack = zfile_fopen (fname, L"rb", ZFD_ARCHIVE | ZFD_DELAYEDOPEN); + ztrack = zfile_fopen (fname, _T("rb"), ZFD_ARCHIVE | ZFD_DELAYEDOPEN); if (!ztrack) { TCHAR tmp[MAX_DPATH]; _tcscpy (tmp, fname); p = tmp + _tcslen (tmp); while (p > tmp) { if (*p == '/' || *p == '\\') { - ztrack = zfile_fopen (p + 1, L"rb", ZFD_ARCHIVE | ZFD_DELAYEDOPEN); + ztrack = zfile_fopen (p + 1, _T("rb"), ZFD_ARCHIVE | ZFD_DELAYEDOPEN); if (ztrack) { xfree (fname); fname = my_strdup (p + 1); @@ -1341,9 +1341,9 @@ static int parsecue (struct cdunit *cdu, struct zfile *zcue, const TCHAR *img) s2 = _tcsrchr (tmp, '/'); if (s2) { s2[0] = 0; - _tcscat (tmp, L"\\"); + _tcscat (tmp, _T("\\")); _tcscat (tmp, fname); - ztrack = zfile_fopen (tmp, L"rb", ZFD_ARCHIVE | ZFD_DELAYEDOPEN); + ztrack = zfile_fopen (tmp, _T("rb"), ZFD_ARCHIVE | ZFD_DELAYEDOPEN); } } t->track = tracknum; @@ -1357,7 +1357,7 @@ static int parsecue (struct cdunit *cdu, struct zfile *zcue, const TCHAR *img) if (t->handle) t->filesize = zfile_size (t->handle); } - } else if (!_tcsnicmp (p, L"PREGAP", 6)) { + } else if (!_tcsnicmp (p, _T("PREGAP"), 6)) { TCHAR *tt; int tn; p += 6; @@ -1366,7 +1366,7 @@ static int parsecue (struct cdunit *cdu, struct zfile *zcue, const TCHAR *img) tn += _tstoi (tt + 3) * 75; tn += _tstoi (tt + 6); pregap += tn; - } else if (!_tcsnicmp (p, L"INDEX", 5)) { + } else if (!_tcsnicmp (p, _T("INDEX"), 5)) { int idxnum; int tn = 0; TCHAR *tt; @@ -1459,7 +1459,7 @@ static int parse_image (struct cdunit *cdu, const TCHAR *img) cdu->tracks = 0; if (!img) return 0; - zcue = zfile_fopen (img, L"rb", ZFD_ARCHIVE | ZFD_CD | ZFD_DELAYEDOPEN); + zcue = zfile_fopen (img, _T("rb"), ZFD_ARCHIVE | ZFD_CD | ZFD_DELAYEDOPEN); if (!zcue) return 0; @@ -1481,11 +1481,11 @@ static int parse_image (struct cdunit *cdu, const TCHAR *img) if (p > curdir) my_setcurrentdir (curdir, oldcurdir); - if (!_tcsicmp (ext, L"cue")) + if (!_tcsicmp (ext, _T("cue"))) parsecue (cdu, zcue, img); - else if (!_tcsicmp (ext, L"ccd")) + else if (!_tcsicmp (ext, _T("ccd"))) parseccd (cdu, zcue, img); - else if (!_tcsicmp (ext, L"mds")) + else if (!_tcsicmp (ext, _T("mds"))) parsemds (cdu, zcue, img); if (oldcurdir[0]) @@ -1502,30 +1502,30 @@ static int parse_image (struct cdunit *cdu, const TCHAR *img) t->handle = zcue; t->size = (siz % 2048) == 0 ? 2048 : 2352; t->filesize = siz; - write_log (L"CD: plain CD image mounted!\n"); + write_log (_T("CD: plain CD image mounted!\n")); cdu->toc[1].address = t->address + t->filesize / t->size; zcue = NULL; } } if (!cdu->tracks) - write_log (L"CD: couldn't mount '%s'!\n", img); + write_log (_T("CD: couldn't mount '%s'!\n"), img); for (i = 0; i <= cdu->tracks; i++) { struct cdtoc *t = &cdu->toc[i]; uae_u32 msf = lsn2msf (t->address); if (i < cdu->tracks) - write_log (L"%2d: ", i + 1); + write_log (_T("%2d: "), i + 1); else - write_log (L" "); - write_log (L"%7d %02d:%02d:%02d", + write_log (_T(" ")); + write_log (_T("%7d %02d:%02d:%02d"), t->address, (msf >> 16) & 0xff, (msf >> 8) & 0xff, (msf >> 0) & 0xff); if (i < cdu->tracks) - write_log (L" %s %x %10d %10d %s", (t->ctrl & 4) ? L"DATA " : (t->subcode ? L"CDA+SUB" : L"CDA "), - t->ctrl, t->offset, t->filesize, t->handle == NULL ? L"[FILE ERROR]" : L""); - write_log (L"\n"); + write_log (_T(" %s %x %10d %10d %s"), (t->ctrl & 4) ? _T("DATA ") : (t->subcode ? _T("CDA+SUB") : _T("CDA ")), + t->ctrl, t->offset, t->filesize, t->handle == NULL ? _T("[FILE ERROR]") : _T("")); + write_log (_T("\n")); if (i < cdu->tracks) - write_log (L" - %s\n", t->fname); + write_log (_T(" - %s\n"), t->fname); if (t->handle && !t->filesize) t->filesize = zfile_size (t->handle); } @@ -1573,12 +1573,12 @@ static struct device_info *info_device (int unitnum, struct device_info *di, int di->type = INQ_ROMD; di->unitnum = unitnum + 1; if (di->mediapath[0]) { - _tcscpy (di->label, L"IMG:"); + _tcscpy (di->label, _T("IMG:")); _tcscat (di->label, di->mediapath); } else { - _tcscpy (di->label, L"IMG:"); + _tcscpy (di->label, _T("IMG:")); } - di->backend = L"IMAGE"; + di->backend = _T("IMAGE"); return di; } @@ -1615,7 +1615,7 @@ static int open_device (int unitnum, const TCHAR *ident, int flags) cdu->cdda_volume[1] = 0x7fff; if (cdimage_unpack_thread == 0) { init_comm_pipe (&unpack_pipe, 10, 1); - uae_start_thread (L"cdimage_unpack", cdda_unpack_func, NULL, NULL); + uae_start_thread (_T("cdimage_unpack"), cdda_unpack_func, NULL, NULL); while (cdimage_unpack_thread == 0) Sleep (10); } @@ -1649,7 +1649,7 @@ static void close_device (int unitnum) static void close_bus (void) { if (!bus_open) { - write_log (L"IMAGE close_bus() when already closed!\n"); + write_log (_T("IMAGE close_bus() when already closed!\n")); return; } for (int i = 0; i < MAX_TOTAL_SCSI_DEVICES; i++) { @@ -1659,22 +1659,22 @@ static void close_bus (void) cdu->enabled = false; } bus_open = 0; - write_log (L"IMAGE driver closed.\n"); + write_log (_T("IMAGE driver closed.\n")); } static int open_bus (int flags) { if (bus_open) { - write_log (L"IOCTL open_bus() more than once!\n"); + write_log (_T("IOCTL open_bus() more than once!\n")); return 1; } bus_open = 1; - write_log (L"Image driver open.\n"); + write_log (_T("Image driver open.\n")); return 1; } struct device_functions devicefunc_cdimage = { - L"IMAGE", + _T("IMAGE"), open_bus, close_bus, open_device, close_device, info_device, 0, 0, 0, command_pause, command_stop, command_play, command_volume, command_qcode, diff --git a/bsdsocket.cpp b/bsdsocket.cpp index 70349bd2..ca3a7604 100644 --- a/bsdsocket.cpp +++ b/bsdsocket.cpp @@ -45,7 +45,7 @@ static struct sockd *sockdata; uae_u32 strncpyha (uae_u32 dst, const uae_char *src, int size) { uae_u32 res = dst; - if (!addr_valid (L"strncpyha", dst, size)) + if (!addr_valid (_T("strncpyha"), dst, size)) return res; while (size--) { put_byte (dst++, *src); @@ -101,7 +101,7 @@ static uae_u32 gettask (TrapContext *context) m68k_areg (regs, 1) = a1; tskname = au((char*)get_real_address (get_long (currtask + 10))); - BSDTRACE ((L"[%s] ", tskname)); + BSDTRACE ((_T("[%s] "), tskname)); xfree (tskname); return currtask; } @@ -149,11 +149,11 @@ uae_u32 callfdcallback (TrapContext *context, SB, uae_u32 fd, uae_u32 action) uae_u32 v; if (!sb->fdcallback) return 0; - BSDTRACE((L"FD_CALLBACK(%d,%d) ", fd, action)); + BSDTRACE((_T("FD_CALLBACK(%d,%d) "), fd, action)); m68k_dreg (regs, 0) = fd; m68k_dreg (regs, 1) = action; v = CallFunc (context, sb->fdcallback); - BSDTRACE((L"-> %d\n", v)); + BSDTRACE((_T("-> %d\n"), v)); return v; } @@ -177,7 +177,7 @@ BOOL checksd(TrapContext *context, SB, int sd) return TRUE; } } - BSDTRACE((L"checksd FALSE s 0x%x sd %d\n",s,sd)); + BSDTRACE((_T("checksd FALSE s 0x%x sd %d\n"),s,sd)); return FALSE; } @@ -237,25 +237,25 @@ int getsd (TrapContext *context, SB, SOCKET_TYPE s) SOCKET_TYPE getsock (SB, int sd) { if ((unsigned int) (sd - 1) >= (unsigned int) sb->dtablesize) { - BSDTRACE ((L"Invalid Socket Descriptor (%d)\n", sd)); + BSDTRACE ((_T("Invalid Socket Descriptor (%d)\n"), sd)); bsdsocklib_seterrno (sb, 38); /* ENOTSOCK */ return -1; } if (sb->dtable[sd - 1] == INVALID_SOCKET) { struct socketbase *sb1, *nsb; uaecptr ot; - if (!addr_valid (L"getsock1", sb->ownertask + 10, 4)) + if (!addr_valid (_T("getsock1"), sb->ownertask + 10, 4)) return -1; ot = get_long (sb->ownertask + 10); - if (!addr_valid (L"getsock2", ot, 1)) + if (!addr_valid (_T("getsock2"), ot, 1)) return -1; // Fix for Newsrog (All Tasks of Newsrog using the same dtable) for (sb1 = socketbases; sb1; sb1 = nsb) { uaecptr ot1; - if (!addr_valid (L"getsock3", sb1->ownertask + 10, 4)) + if (!addr_valid (_T("getsock3"), sb1->ownertask + 10, 4)) break; ot1 = get_long (sb1->ownertask + 10); - if (!addr_valid (L"getsock4", ot1, 1)) + if (!addr_valid (_T("getsock4"), ot1, 1)) break; if (strcmp((char*)get_real_address (ot1), (char*)get_real_address (ot)) == 0) { // Task with same name already exists -> use same dtable @@ -371,7 +371,7 @@ static struct socketbase *alloc_socketbase (TrapContext *context) sb->signal = CallLib (context, sb->sysbase, -0x14A); /* AllocSignal */ if (sb->signal == -1) { - write_log (L"bsdsocket: ERROR: Couldn't allocate signal for task 0x%lx.\n", sb->ownertask); + write_log (_T("bsdsocket: ERROR: Couldn't allocate signal for task 0x%lx.\n"), sb->ownertask); free (sb); return NULL; } @@ -478,7 +478,7 @@ static void free_socketbase (TrapContext *context) static uae_u32 REGPARAM2 bsdsocklib_Expunge (TrapContext *context) { - BSDTRACE ((L"Expunge() -> [ignored]\n")); + BSDTRACE ((_T("Expunge() -> [ignored]\n"))); return 0; } @@ -490,7 +490,7 @@ static uae_u32 REGPARAM2 bsdsocklib_Open (TrapContext *context) int opencount; SB; - BSDTRACE ((L"OpenLibrary() -> ")); + BSDTRACE ((_T("OpenLibrary() -> "))); if ((sb = alloc_socketbase (context)) != NULL) { put_word (SockLibBase + 32, opencount = get_word (SockLibBase + 32) + 1); @@ -504,9 +504,9 @@ static uae_u32 REGPARAM2 bsdsocklib_Open (TrapContext *context) put_pointer (result + offsetof (struct UAEBSDBase, sb), sb); - BSDTRACE ((L"%0x [%d]\n", result, opencount)); + BSDTRACE ((_T("%0x [%d]\n"), result, opencount)); } else - BSDTRACE ((L"failed (out of memory)\n")); + BSDTRACE ((_T("failed (out of memory)\n"))); return result; } @@ -526,7 +526,7 @@ static uae_u32 REGPARAM2 bsdsocklib_Close (TrapContext *context) m68k_dreg (regs, 0) = negsize + get_word (base + 18); CallLib (context, get_long (4), -0xD2); /* FreeMem */ - BSDTRACE ((L"CloseLibrary() -> [%d]\n", opencount)); + BSDTRACE ((_T("CloseLibrary() -> [%d]\n"), opencount)); return 0; } @@ -674,7 +674,7 @@ static uae_u32 REGPARAM2 bsdsocklib_SetSocketSignals (TrapContext *context) { struct socketbase *sb = get_socketbase (context); - BSDTRACE ((L"SetSocketSignals(0x%08lx,0x%08lx,0x%08lx) -> ", m68k_dreg (regs, 0), m68k_dreg (regs, 1), m68k_dreg (regs, 2))); + BSDTRACE ((_T("SetSocketSignals(0x%08lx,0x%08lx,0x%08lx) -> "), m68k_dreg (regs, 0), m68k_dreg (regs, 1), m68k_dreg (regs, 2))); sb->eintrsigs = m68k_dreg (regs, 0); sb->eventsigs = m68k_dreg (regs, 1); @@ -746,19 +746,19 @@ static uae_u32 REGPARAM2 bsdsocklib_ObtainSocket (TrapContext *context) id = m68k_dreg (regs, 0); - BSDTRACE ((L"ObtainSocket(%d,%d,%d,%d) -> ", id, m68k_dreg (regs, 1), m68k_dreg (regs, 2), m68k_dreg (regs, 3))); + BSDTRACE ((_T("ObtainSocket(%d,%d,%d,%d) -> "), id, m68k_dreg (regs, 1), m68k_dreg (regs, 2), m68k_dreg (regs, 3))); i = sockpoolindex (id); if (i == -1) { - BSDTRACE ((L"[invalid key]\n")); + BSDTRACE ((_T("[invalid key]\n"))); return -1; } s = sockdata->sockpoolsocks[i]; sd = getsd (context, sb, s); - BSDTRACE ((L" -> Socket=%d\n", sd)); + BSDTRACE ((_T(" -> Socket=%d\n"), sd)); if (sd != -1) { sb->ftable[sd - 1] = sockdata->sockpoolflags[i]; @@ -784,7 +784,7 @@ static uae_u32 REGPARAM2 bsdsocklib_ReleaseSocket (TrapContext *context) id = m68k_dreg (regs, 1); sd++; - BSDTRACE ((L"ReleaseSocket(%d,%d) -> ", sd, id)); + BSDTRACE ((_T("ReleaseSocket(%d,%d) -> "), sd, id)); s = getsock (sb, sd); @@ -792,7 +792,7 @@ static uae_u32 REGPARAM2 bsdsocklib_ReleaseSocket (TrapContext *context) flags = sb->ftable[sd - 1]; if (flags & REP_ALL) { - write_log (L"bsdsocket: ERROR: ReleaseSocket() is not supported for sockets with async event notification enabled!\n"); + write_log (_T("bsdsocket: ERROR: ReleaseSocket() is not supported for sockets with async event notification enabled!\n")); return -1; } releasesock (context, sb, sd); @@ -809,24 +809,24 @@ static uae_u32 REGPARAM2 bsdsocklib_ReleaseSocket (TrapContext *context) id = curruniqid; } else if (id < 0 && id > 65535) { if (sockpoolindex (id) != -1) { - BSDTRACE ((L"[unique ID already exists]\n")); + BSDTRACE ((_T("[unique ID already exists]\n"))); return -1; } } i = sockpoolindex (-1); if (i == -1) { - BSDTRACE ((L"-1\n")); - write_log (L"bsdsocket: ERROR: Global socket pool overflow\n"); + BSDTRACE ((_T("-1\n"))); + write_log (_T("bsdsocket: ERROR: Global socket pool overflow\n")); return -1; } sockdata->sockpoolids[i] = id; sockdata->sockpoolsocks[i] = s; sockdata->sockpoolflags[i] = flags; - BSDTRACE ((L"id %d s 0x%x\n", id,s)); + BSDTRACE ((_T("id %d s 0x%x\n"), id,s)); } else { - BSDTRACE ((L"[invalid socket descriptor]\n")); + BSDTRACE ((_T("[invalid socket descriptor]\n"))); return -1; } @@ -847,7 +847,7 @@ static uae_u32 REGPARAM2 bsdsocklib_ReleaseCopyOfSocket (TrapContext *context) id = m68k_dreg (regs, 1); sd++; - BSDTRACE ((L"ReleaseSocket(%d,%d) -> ", sd, id)); + BSDTRACE ((_T("ReleaseSocket(%d,%d) -> "), sd, id)); s = getsock (sb, sd); @@ -855,7 +855,7 @@ static uae_u32 REGPARAM2 bsdsocklib_ReleaseCopyOfSocket (TrapContext *context) flags = sb->ftable[sd - 1]; if (flags & REP_ALL) { - write_log (L"bsdsocket: ERROR: ReleaseCopyOfSocket() is not supported for sockets with async event notification enabled!\n"); + write_log (_T("bsdsocket: ERROR: ReleaseCopyOfSocket() is not supported for sockets with async event notification enabled!\n")); return -1; } if (id == UNIQUE_ID) { @@ -869,26 +869,26 @@ static uae_u32 REGPARAM2 bsdsocklib_ReleaseCopyOfSocket (TrapContext *context) id = curruniqid; } else if (id < 0 && id > 65535) { if (sockpoolindex (id) != -1) { - BSDTRACE ((L"[unique ID already exists]\n")); + BSDTRACE ((_T("[unique ID already exists]\n"))); return -1; } } i = sockpoolindex (-1); if (i == -1) { - BSDTRACE ((L"-1\n")); - write_log (L"bsdsocket: ERROR: Global socket pool overflow\n"); + BSDTRACE ((_T("-1\n"))); + write_log (_T("bsdsocket: ERROR: Global socket pool overflow\n")); return -1; } sockdata->sockpoolids[i] = id; sockdata->sockpoolsocks[i] = s; sockdata->sockpoolflags[i] = flags; - BSDTRACE ((L"id %d s 0x%x\n", id,s)); + BSDTRACE ((_T("id %d s 0x%x\n"), id,s)); } else { - BSDTRACE ((L"[invalid socket descriptor]\n")); + BSDTRACE ((_T("[invalid socket descriptor]\n"))); return -1; } @@ -899,7 +899,7 @@ static uae_u32 REGPARAM2 bsdsocklib_ReleaseCopyOfSocket (TrapContext *context) static uae_u32 REGPARAM2 bsdsocklib_Errno (TrapContext *context) { struct socketbase *sb = get_socketbase (context); - BSDTRACE ((L"Errno() -> %d\n", sb->sb_errno)); + BSDTRACE ((_T("Errno() -> %d\n"), sb->sb_errno)); return sb->sb_errno; } @@ -909,12 +909,12 @@ static uae_u32 REGPARAM2 bsdsocklib_SetErrnoPtr (TrapContext *context) struct socketbase *sb = get_socketbase (context); uae_u32 errnoptr = m68k_areg (regs, 0), size = m68k_dreg (regs, 0); - BSDTRACE ((L"SetErrnoPtr(0x%lx,%d) -> ", errnoptr, size)); + BSDTRACE ((_T("SetErrnoPtr(0x%lx,%d) -> "), errnoptr, size)); if (size == 1 || size == 2 || size == 4) { sb->errnoptr = errnoptr; sb->errnosize = size; - BSDTRACE ((L"OK\n")); + BSDTRACE ((_T("OK\n"))); return 0; } bsdsocklib_seterrno (sb, 22); /* EINVAL */ @@ -939,21 +939,21 @@ static uae_u32 REGPARAM2 bsdsocklib_inet_addr (TrapContext *context) /* Inet_LnaOf(in)(d0) */ static uae_u32 REGPARAM2 bsdsocklib_Inet_LnaOf (TrapContext *context) { - write_log (L"bsdsocket: UNSUPPORTED: Inet_LnaOf()\n"); + write_log (_T("bsdsocket: UNSUPPORTED: Inet_LnaOf()\n")); return 0; } /* Inet_NetOf(in)(d0) */ static uae_u32 REGPARAM2 bsdsocklib_Inet_NetOf (TrapContext *context) { - write_log (L"bsdsocket: UNSUPPORTED: Inet_NetOf()\n"); + write_log (_T("bsdsocket: UNSUPPORTED: Inet_NetOf()\n")); return 0; } /* Inet_MakeAddr(net, host)(d0/d1) */ static uae_u32 REGPARAM2 bsdsocklib_Inet_MakeAddr (TrapContext *context) { - write_log (L"bsdsocket: UNSUPPORTED: Inet_MakeAddr()\n"); + write_log (_T("bsdsocket: UNSUPPORTED: Inet_MakeAddr()\n")); return 0; } @@ -983,14 +983,14 @@ static uae_u32 REGPARAM2 bsdsocklib_gethostbyaddr (TrapContext *context) /* getnetbyname(name)(a0) */ static uae_u32 REGPARAM2 bsdsocklib_getnetbyname (TrapContext *context) { - write_log (L"bsdsocket: UNSUPPORTED: getnetbyname()\n"); + write_log (_T("bsdsocket: UNSUPPORTED: getnetbyname()\n")); return 0; } /* getnetbyaddr(net, type)(d0/d1) */ static uae_u32 REGPARAM2 bsdsocklib_getnetbyaddr (TrapContext *context) { - write_log (L"bsdsocket: UNSUPPORTED: getnetbyaddr()\n"); + write_log (_T("bsdsocket: UNSUPPORTED: getnetbyaddr()\n")); return 0; } @@ -1030,7 +1030,7 @@ static uae_u32 REGPARAM2 bsdsocklib_getprotobynumber (TrapContext *context) /* Syslog(level, format, ap)(d0/a0/a1) */ static uae_u32 REGPARAM2 bsdsocklib_vsyslog (TrapContext *context) { - write_log (L"bsdsocket: UNSUPPORTED: vsyslog()\n"); + write_log (_T("bsdsocket: UNSUPPORTED: vsyslog()\n")); return 0; } @@ -1044,13 +1044,13 @@ static uae_u32 REGPARAM2 bsdsocklib_Dup2Socket (TrapContext *context) static uae_u32 REGPARAM2 bsdsocklib_sendmsg (TrapContext *context) { - write_log (L"bsdsocket: UNSUPPORTED: sendmsg()\n"); + write_log (_T("bsdsocket: UNSUPPORTED: sendmsg()\n")); return 0; } static uae_u32 REGPARAM2 bsdsocklib_recvmsg (TrapContext *context) { - write_log (L"bsdsocket: UNSUPPORTED: recvmsg()\n"); + write_log (_T("bsdsocket: UNSUPPORTED: recvmsg()\n")); return 0; } @@ -1061,44 +1061,44 @@ static uae_u32 REGPARAM2 bsdsocklib_gethostname (TrapContext *context) static uae_u32 REGPARAM2 bsdsocklib_gethostid (TrapContext *context) { - write_log (L"bsdsocket: WARNING: Process '%s' calls deprecated function gethostid() - returning 127.0.0.1\n", + write_log (_T("bsdsocket: WARNING: Process '%s' calls deprecated function gethostid() - returning 127.0.0.1\n"), get_real_address (get_long (gettask (context) + 10))); return 0x7f000001; } static const TCHAR *errortexts[] = -{L"No error", L"Operation not permitted", L"No such file or directory", -L"No such process", L"Interrupted system call", L"Input/output error", L"Device not configured", -L"Argument list too long", L"Exec format error", L"Bad file descriptor", L"No child processes", -L"Resource deadlock avoided", L"Cannot allocate memory", L"Permission denied", L"Bad address", -L"Block device required", L"Device busy", L"Object exists", L"Cross-device link", -L"Operation not supported by device", L"Not a directory", L"Is a directory", L"Invalid argument", -L"Too many open files in system", L"Too many open files", L"Inappropriate ioctl for device", -L"Text file busy", L"File too large", L"No space left on device", L"Illegal seek", -L"Read-only file system", L"Too many links", L"Broken pipe", L"Numerical argument out of domain", -L"Result too large", L"Resource temporarily unavailable", L"Operation now in progress", -L"Operation already in progress", L"Socket operation on non-socket", L"Destination address required", -L"Message too long", L"Protocol wrong type for socket", L"Protocol not available", -L"Protocol not supported", L"Socket type not supported", L"Operation not supported", -L"Protocol family not supported", L"Address family not supported by protocol family", -L"Address already in use", L"Can't assign requested address", L"Network is down", -L"Network is unreachable", L"Network dropped connection on reset", L"Software caused connection abort", -L"Connection reset by peer", L"No buffer space available", L"Socket is already connected", -L"Socket is not connected", L"Can't send after socket shutdown", L"Too many references: can't splice", -L"Connection timed out", L"Connection refused", L"Too many levels of symbolic links", -L"File name too long", L"Host is down", L"No route to host", L"Directory not empty", -L"Too many processes", L"Too many users", L"Disc quota exceeded", L"Stale NFS file handle", -L"Too many levels of remote in path", L"RPC struct is bad", L"RPC version wrong", -L"RPC prog. not avail", L"Program version wrong", L"Bad procedure for program", L"No locks available", -L"Function not implemented", L"Inappropriate file type or format", L"PError 0"}; +{_T("No error"), _T("Operation not permitted"), _T("No such file or directory"), +_T("No such process"), _T("Interrupted system call"), _T("Input/output error"), _T("Device not configured"), +_T("Argument list too long"), _T("Exec format error"), _T("Bad file descriptor"), _T("No child processes"), +_T("Resource deadlock avoided"), _T("Cannot allocate memory"), _T("Permission denied"), _T("Bad address"), +_T("Block device required"), _T("Device busy"), _T("Object exists"), _T("Cross-device link"), +_T("Operation not supported by device"), _T("Not a directory"), _T("Is a directory"), _T("Invalid argument"), +_T("Too many open files in system"), _T("Too many open files"), _T("Inappropriate ioctl for device"), +_T("Text file busy"), _T("File too large"), _T("No space left on device"), _T("Illegal seek"), +_T("Read-only file system"), _T("Too many links"), _T("Broken pipe"), _T("Numerical argument out of domain"), +_T("Result too large"), _T("Resource temporarily unavailable"), _T("Operation now in progress"), +_T("Operation already in progress"), _T("Socket operation on non-socket"), _T("Destination address required"), +_T("Message too long"), _T("Protocol wrong type for socket"), _T("Protocol not available"), +_T("Protocol not supported"), _T("Socket type not supported"), _T("Operation not supported"), +_T("Protocol family not supported"), _T("Address family not supported by protocol family"), +_T("Address already in use"), _T("Can't assign requested address"), _T("Network is down"), +_T("Network is unreachable"), _T("Network dropped connection on reset"), _T("Software caused connection abort"), +_T("Connection reset by peer"), _T("No buffer space available"), _T("Socket is already connected"), +_T("Socket is not connected"), _T("Can't send after socket shutdown"), _T("Too many references: can't splice"), +_T("Connection timed out"), _T("Connection refused"), _T("Too many levels of symbolic links"), +_T("File name too long"), _T("Host is down"), _T("No route to host"), _T("Directory not empty"), +_T("Too many processes"), _T("Too many users"), _T("Disc quota exceeded"), _T("Stale NFS file handle"), +_T("Too many levels of remote in path"), _T("RPC struct is bad"), _T("RPC version wrong"), +_T("RPC prog. not avail"), _T("Program version wrong"), _T("Bad procedure for program"), _T("No locks available"), +_T("Function not implemented"), _T("Inappropriate file type or format"), _T("PError 0")}; static uae_u32 errnotextptrs[sizeof (errortexts) / sizeof (*errortexts)]; static const uae_u32 number_sys_error = sizeof (errortexts) / sizeof (*errortexts); static const TCHAR *herrortexts[] = -{L"No error", L"Unknown host", L"Host name lookup failure", L"Unknown server error", -L"No address associated with name"}; +{_T("No error"), _T("Unknown host"), _T("Host name lookup failure"), _T("Unknown server error"), +_T("No address associated with name")}; static uae_u32 herrnotextptrs[sizeof (herrortexts) / sizeof (*herrortexts)]; static const uae_u32 number_host_error = sizeof (herrortexts) / sizeof (*herrortexts); @@ -1106,18 +1106,18 @@ static const uae_u32 number_host_error = sizeof (herrortexts) / sizeof (*herrort static const TCHAR *sana2io_errlist[] = { - L"No error", /* S2ERR_NO_ERROR */ - L"Resource allocation failure", /* S2ERR_NO_RESOURCES */ - L"Unknown error code (2)", - L"Invalid argument", /* S2ERR_BAD_ARGUMENT */ - L"Inappropriate state", /* S2ERR_BAD_STATE */ - L"Invalid address", /* S2ERR_BAD_ADDRESS */ - L"Requested packet too large", /* S2ERR_MTU_EXCEEDED */ - L"Unknown error (7)", - L"Command is not supporter", /* S2ERR_NOT_SUPPORTED */ - L"Driver software error detected", /* S2ERR_SOFTWARE */ - L"Device driver is offline", /* S2ERR_OUTOFSERVICE */ - L"Transmission attempt failed" /* S2ERR_TX_FAILURE */ + _T("No error"), /* S2ERR_NO_ERROR */ + _T("Resource allocation failure"), /* S2ERR_NO_RESOURCES */ + _T("Unknown error code (2)"), + _T("Invalid argument"), /* S2ERR_BAD_ARGUMENT */ + _T("Inappropriate state"), /* S2ERR_BAD_STATE */ + _T("Invalid address"), /* S2ERR_BAD_ADDRESS */ + _T("Requested packet too large"), /* S2ERR_MTU_EXCEEDED */ + _T("Unknown error (7)"), + _T("Command is not supporter"), /* S2ERR_NOT_SUPPORTED */ + _T("Driver software error detected"), /* S2ERR_SOFTWARE */ + _T("Device driver is offline"), /* S2ERR_OUTOFSERVICE */ + _T("Transmission attempt failed") /* S2ERR_TX_FAILURE */ }; static uae_u32 sana2iotextptrs[sizeof (sana2io_errlist) / sizeof (*sana2io_errlist)]; @@ -1126,25 +1126,25 @@ static const uae_u32 number_sana2io_error = sizeof (sana2io_errlist) / sizeof (* static const TCHAR *sana2wire_errlist[] = { - L"Generic error: 0", /* S2WERR_GENERIC_ERROR */ - L"Unit not configured", /* S2WERR_NOT_CONFIGURED */ - L"Unit is currently online", /* S2WERR_UNIT_ONLINE */ - L"Unit is currently offline", /* S2WERR_UNIT_OFFLINE */ - L"Protocol already tracked", /* S2WERR_ALREADY_TRACKED */ - L"Protocol not tracked", /* S2WERR_NOT_TRACKED */ - L"Buff management function error", /* S2WERR_BUFF_ERROR */ - L"Source address error", /* S2WERR_SRC_ADDRESS */ - L"Destination address error", /* S2WERR_DST_ADDRESS */ - L"Broadcast address error", /* S2WERR_BAD_BROADCAST */ - L"Multicast address error", /* S2WERR_BAD_MULTICAST */ - L"Multicast address list full", /* S2WERR_MULTICAST_FULL */ - L"Unsupported event class", /* S2WERR_BAD_EVENT */ - L"Statdata failed sanity check", /* S2WERR_BAD_STATDATA */ - L"Unknown wire error (14)", - L"Attempt to config twice", /* S2WERR_IS_CONFIGURED */ - L"Null pointer detected", /* S2WERR_NULL_POINTER */ - L"tx failed - too many retries", /* S2WERR_TOO_MANY_RETIRES */ - L"Driver fixable HW error" /* S2WERR_RCVREL_HDW_ERR */ + _T("Generic error: 0"), /* S2WERR_GENERIC_ERROR */ + _T("Unit not configured"), /* S2WERR_NOT_CONFIGURED */ + _T("Unit is currently online"), /* S2WERR_UNIT_ONLINE */ + _T("Unit is currently offline"), /* S2WERR_UNIT_OFFLINE */ + _T("Protocol already tracked"), /* S2WERR_ALREADY_TRACKED */ + _T("Protocol not tracked"), /* S2WERR_NOT_TRACKED */ + _T("Buff management function error"), /* S2WERR_BUFF_ERROR */ + _T("Source address error"), /* S2WERR_SRC_ADDRESS */ + _T("Destination address error"), /* S2WERR_DST_ADDRESS */ + _T("Broadcast address error"), /* S2WERR_BAD_BROADCAST */ + _T("Multicast address error"), /* S2WERR_BAD_MULTICAST */ + _T("Multicast address list full"), /* S2WERR_MULTICAST_FULL */ + _T("Unsupported event class"), /* S2WERR_BAD_EVENT */ + _T("Statdata failed sanity check"), /* S2WERR_BAD_STATDATA */ + _T("Unknown wire error (14)"), + _T("Attempt to config twice"), /* S2WERR_IS_CONFIGURED */ + _T("Null pointer detected"), /* S2WERR_NULL_POINTER */ + _T("tx failed - too many retries"), /* S2WERR_TOO_MANY_RETIRES */ + _T("Driver fixable HW error") /* S2WERR_RCVREL_HDW_ERR */ }; static uae_u32 sana2wiretextptrs[sizeof (sana2wire_errlist) / sizeof (*sana2wire_errlist)]; @@ -1153,21 +1153,21 @@ static const uae_u32 number_sana2wire_error = sizeof (sana2wire_errlist) / sizeo static const TCHAR *io_errlist[] = { - L"Unknown error", /* 0 */ - L"Device or unit failed to open", /* IOERR_OPENFAIL */ - L"Request aborted", /* IOERR_ABORTED */ - L"Command not supported by device", /* IOERR_NOCMD */ - L"Invalid length", /* IOERR_BADLENGTH */ - L"Invalid address", /* IOERR_BADADDRESS */ - L"Requested unit is busy", /* IOERR_UNITBUSY */ - L"Hardware self-test failed" /* IOERR_SELFTEST */ + _T("Unknown error"), /* 0 */ + _T("Device or unit failed to open"), /* IOERR_OPENFAIL */ + _T("Request aborted"), /* IOERR_ABORTED */ + _T("Command not supported by device"), /* IOERR_NOCMD */ + _T("Invalid length"), /* IOERR_BADLENGTH */ + _T("Invalid address"), /* IOERR_BADADDRESS */ + _T("Requested unit is busy"), /* IOERR_UNITBUSY */ + _T("Hardware self-test failed") /* IOERR_SELFTEST */ }; static uae_u32 iotextptrs[sizeof (io_errlist) / sizeof (*io_errlist)]; static const uae_u32 number_io_error = sizeof (io_errlist) / sizeof (*io_errlist); -static const TCHAR * const strErr = L"Errlist lookup error"; +static const TCHAR * const strErr = _T("Errlist lookup error"); static uae_u32 strErrptr; @@ -1245,7 +1245,7 @@ static uae_u32 REGPARAM2 bsdsocklib_SocketBaseTagList (TrapContext *context) uae_u32 currtag; uae_u32 currval; - BSDTRACE ((L"SocketBaseTagList(")); + BSDTRACE ((_T("SocketBaseTagList("))); for (;;) { currtag = get_long (tagptr); @@ -1257,59 +1257,59 @@ static uae_u32 REGPARAM2 bsdsocklib_SocketBaseTagList (TrapContext *context) switch (currtag) { case TAG_DONE: - BSDTRACE ((L"TAG_DONE")); + BSDTRACE ((_T("TAG_DONE"))); tagsprocessed = 0; goto done; case TAG_IGNORE: - BSDTRACE ((L"TAG_IGNORE")); + BSDTRACE ((_T("TAG_IGNORE"))); break; case TAG_MORE: - BSDTRACE ((L"TAG_MORE(0x%lx)", currval)); + BSDTRACE ((_T("TAG_MORE(0x%lx)"), currval)); tagptr = currval; break; case TAG_SKIP: - BSDTRACE ((L"TAG_SKIP(%d)", currval)); + BSDTRACE ((_T("TAG_SKIP(%d)"), currval)); tagptr += currval * 8; break; default: - write_log (L"bsdsocket: WARNING: Unsupported tag type (%08x) in SocketBaseTagList(%x)\n", + write_log (_T("bsdsocket: WARNING: Unsupported tag type (%08x) in SocketBaseTagList(%x)\n"), currtag, m68k_areg (regs, 0)); goto done; } } else { - BSDTRACE ((L"SBTM_")); - BSDTRACE ((currtag & 0x0001 ? L"SET" : L"GET")); - BSDTRACE ((currtag & 0x8000 ? L"REF(" : L"VAL(")); + BSDTRACE ((_T("SBTM_"))); + BSDTRACE ((currtag & 0x0001 ? _T("SET") : _T("GET"))); + BSDTRACE ((currtag & 0x8000 ? _T("REF(") : _T("VAL("))); switch ((currtag >> 1) & SBTS_CODE) { case SBTC_BREAKMASK: - BSDTRACE ((L"SBTC_BREAKMASK),0x%x,0x%x", currval, sb->eintrsigs)); + BSDTRACE ((_T("SBTC_BREAKMASK),0x%x,0x%x"), currval, sb->eintrsigs)); tagcopy (currtag, currval, tagptr, &sb->eintrsigs); break; case SBTC_SIGIOMASK: - BSDTRACE ((L"SBTC_SIGIOMASK),0x%x,0x%x", currval, sb->eventsigs)); + BSDTRACE ((_T("SBTC_SIGIOMASK),0x%x,0x%x"), currval, sb->eventsigs)); tagcopy (currtag, currval, tagptr, &sb->eventsigs); break; case SBTC_SIGURGMASK: - BSDTRACE ((L"SBTC_SIGURGMASK),0x%x", currval)); + BSDTRACE ((_T("SBTC_SIGURGMASK),0x%x"), currval)); break; case SBTC_SIGEVENTMASK: - BSDTRACE ((L"SBTC_SIGEVENTMASK),0x%x,0x%x", currval, sb->eventsigs)); + BSDTRACE ((_T("SBTC_SIGEVENTMASK),0x%x,0x%x"), currval, sb->eventsigs)); tagcopy (currtag, currval, tagptr, &sb->eventsigs); break; case SBTC_ERRNO: - BSDTRACE ((L"SBTC_ERRNO),%x,%d", currval, sb->sb_errno)); + BSDTRACE ((_T("SBTC_ERRNO),%x,%d"), currval, sb->sb_errno)); tagcopy (currtag, currval, tagptr, (uae_u32*)&sb->sb_errno); break; case SBTC_HERRNO: - BSDTRACE ((L"SBTC_HERRNO),%x,%d", currval, sb->sb_herrno)); + BSDTRACE ((_T("SBTC_HERRNO),%x,%d"), currval, sb->sb_herrno)); tagcopy (currtag, currval, tagptr, (uae_u32*)&sb->sb_herrno); break; case SBTC_DTABLESIZE: - BSDTRACE ((L"SBTC_DTABLESIZE),0x%lx", currval)); + BSDTRACE ((_T("SBTC_DTABLESIZE),0x%lx"), currval)); if (currtag & 1) { bsdsocklib_SetDTableSize(sb, currval); } else { @@ -1318,33 +1318,33 @@ static uae_u32 REGPARAM2 bsdsocklib_SocketBaseTagList (TrapContext *context) break; case SBTC_FDCALLBACK: - BSDTRACE ((L"SBTC_FDCALLBACK),%08x", currval)); + BSDTRACE ((_T("SBTC_FDCALLBACK),%08x"), currval)); tagcopy (currtag, currval, tagptr, &sb->fdcallback); break; case SBTC_LOGSTAT: - BSDTRACE ((L"SBTC_LOGSTAT),%08x", currval)); + BSDTRACE ((_T("SBTC_LOGSTAT),%08x"), currval)); tagcopy (currtag, currval, tagptr, &sb->logstat); sb->logstat &= 0xff; break; case SBTC_LOGTAGPTR: - BSDTRACE ((L"SBTC_LOGTAGPTR),%08x", currval)); + BSDTRACE ((_T("SBTC_LOGTAGPTR),%08x"), currval)); tagcopy (currtag, currval, tagptr, &sb->logptr); break; case SBTC_LOGFACILITY: - BSDTRACE ((L"SBTC_LOGFACILITY),%08x", currval)); + BSDTRACE ((_T("SBTC_LOGFACILITY),%08x"), currval)); if (((currtag & 1) && currval != 0 && (currval & ~LOG_FACMASK)) || !(currtag & 1)) tagcopy (currtag, currval, tagptr, &sb->logfacility); break; case SBTC_LOGMASK: - BSDTRACE ((L"SBTC_LOGMASK),%08x", currval)); + BSDTRACE ((_T("SBTC_LOGMASK),%08x"), currval)); tagcopy (currtag, currval, tagptr, &sb->logmask); sb->logmask &= 0xff; break; case SBTC_IOERRNOSTRPTR: if (currtag & 1) { - BSDTRACE ((L"IOERRNOSTRPTR),invalid")); + BSDTRACE ((_T("IOERRNOSTRPTR),invalid"))); goto done; } else { unsigned long ulTmp; @@ -1353,7 +1353,7 @@ static uae_u32 REGPARAM2 bsdsocklib_SocketBaseTagList (TrapContext *context) } else { /* SBTM_GETVAL */ ulTmp = currval; } - BSDTRACE ((L"IOERRNOSTRPTR),%d", ulTmp)); + BSDTRACE ((_T("IOERRNOSTRPTR),%d"), ulTmp)); if (ulTmp < number_sys_error) { tagcopy (currtag, currval, tagptr, &iotextptrs[ulTmp]); } else { @@ -1363,7 +1363,7 @@ static uae_u32 REGPARAM2 bsdsocklib_SocketBaseTagList (TrapContext *context) break; case SBTC_S2ERRNOSTRPTR: if (currtag & 1) { - BSDTRACE ((L"S2ERRNOSTRPTR),invalid")); + BSDTRACE ((_T("S2ERRNOSTRPTR),invalid"))); goto done; } else { unsigned long ulTmp; @@ -1372,7 +1372,7 @@ static uae_u32 REGPARAM2 bsdsocklib_SocketBaseTagList (TrapContext *context) } else { /* SBTM_GETVAL */ ulTmp = currval; } - BSDTRACE ((L"S2ERRNOSTRPTR),%d", ulTmp)); + BSDTRACE ((_T("S2ERRNOSTRPTR),%d"), ulTmp)); if (ulTmp < number_sys_error) { tagcopy (currtag, currval, tagptr, &sana2iotextptrs[ulTmp]); } else { @@ -1382,7 +1382,7 @@ static uae_u32 REGPARAM2 bsdsocklib_SocketBaseTagList (TrapContext *context) break; case SBTC_S2WERRNOSTRPTR: if (currtag & 1) { - BSDTRACE ((L"S2WERRNOSTRPTR),invalid")); + BSDTRACE ((_T("S2WERRNOSTRPTR),invalid"))); goto done; } else { unsigned long ulTmp; @@ -1391,7 +1391,7 @@ static uae_u32 REGPARAM2 bsdsocklib_SocketBaseTagList (TrapContext *context) } else { /* SBTM_GETVAL */ ulTmp = currval; } - BSDTRACE ((L"S2WERRNOSTRPTR),%d", ulTmp)); + BSDTRACE ((_T("S2WERRNOSTRPTR),%d"), ulTmp)); if (ulTmp < number_sys_error) { tagcopy (currtag, currval, tagptr, &sana2wiretextptrs[ulTmp]); } else { @@ -1401,7 +1401,7 @@ static uae_u32 REGPARAM2 bsdsocklib_SocketBaseTagList (TrapContext *context) break; case SBTC_ERRNOSTRPTR: if (currtag & 1) { - BSDTRACE ((L"ERRNOSTRPTR),invalid")); + BSDTRACE ((_T("ERRNOSTRPTR),invalid"))); goto done; } else { unsigned long ulTmp; @@ -1410,7 +1410,7 @@ static uae_u32 REGPARAM2 bsdsocklib_SocketBaseTagList (TrapContext *context) } else { /* SBTM_GETVAL */ ulTmp = currval; } - BSDTRACE ((L"ERRNOSTRPTR),%d", ulTmp)); + BSDTRACE ((_T("ERRNOSTRPTR),%d"), ulTmp)); if (ulTmp < number_sys_error) { tagcopy (currtag, currval, tagptr, &errnotextptrs[ulTmp]); } else { @@ -1420,7 +1420,7 @@ static uae_u32 REGPARAM2 bsdsocklib_SocketBaseTagList (TrapContext *context) break; case SBTC_HERRNOSTRPTR: if (currtag & 1) { - BSDTRACE ((L"HERRNOSTRPTR),invalid")); + BSDTRACE ((_T("HERRNOSTRPTR),invalid"))); goto done; } else { unsigned long ulTmp; @@ -1429,7 +1429,7 @@ static uae_u32 REGPARAM2 bsdsocklib_SocketBaseTagList (TrapContext *context) } else { /* SBTM_GETVAL */ ulTmp = currval; } - BSDTRACE ((L"HERRNOSTRPTR),%d", ulTmp)); + BSDTRACE ((_T("HERRNOSTRPTR),%d"), ulTmp)); if (ulTmp < number_host_error) { tagcopy (currtag, currval, tagptr, &herrnotextptrs[ulTmp]); } else { @@ -1439,38 +1439,38 @@ static uae_u32 REGPARAM2 bsdsocklib_SocketBaseTagList (TrapContext *context) break; case SBTC_ERRNOBYTEPTR: - BSDTRACE ((L"SBTC_ERRNOBYTEPTR),0x%lx", currval)); + BSDTRACE ((_T("SBTC_ERRNOBYTEPTR),0x%lx"), currval)); tagcopy (currtag, currval, tagptr, &sb->errnoptr); sb->errnosize = 1; break; case SBTC_ERRNOWORDPTR: - BSDTRACE ((L"SBTC_ERRNOWORDPTR),0x%lx", currval)); + BSDTRACE ((_T("SBTC_ERRNOWORDPTR),0x%lx"), currval)); tagcopy (currtag, currval, tagptr, &sb->errnoptr); sb->errnosize = 2; break; case SBTC_ERRNOLONGPTR: - BSDTRACE ((L"SBTC_ERRNOLONGPTR),0x%lx", currval)); + BSDTRACE ((_T("SBTC_ERRNOLONGPTR),0x%lx"), currval)); tagcopy (currtag, currval, tagptr, &sb->errnoptr); sb->errnosize = 4; break; case SBTC_HERRNOLONGPTR: - BSDTRACE ((L"SBTC_HERRNOLONGPTR),0x%lx", currval)); + BSDTRACE ((_T("SBTC_HERRNOLONGPTR),0x%lx"), currval)); tagcopy (currtag, currval, tagptr, &sb->herrnoptr); sb->herrnosize = 4; break; default: - write_log (L"bsdsocket: WARNING: Unsupported tag type (%08x=%d) in SocketBaseTagList(%x)\n", + write_log (_T("bsdsocket: WARNING: Unsupported tag type (%08x=%d) in SocketBaseTagList(%x)\n"), currtag, (currtag / 2) & SBTS_CODE, m68k_areg (regs, 0)); goto done; } } - BSDTRACE ((L",")); + BSDTRACE ((_T(","))); tagptr += 8; } done: - BSDTRACE ((L") -> %d\n", tagsprocessed)); + BSDTRACE ((_T(") -> %d\n"), tagsprocessed)); return tagsprocessed; } @@ -1483,7 +1483,7 @@ static uae_u32 REGPARAM2 bsdsocklib_GetSocketEvents (TrapContext *context) int flags; uae_u32 ptr = m68k_areg (regs, 0); - BSDTRACE ((L"GetSocketEvents(0x%x) -> ", ptr)); + BSDTRACE ((_T("GetSocketEvents(0x%x) -> "), ptr)); for (i = sb->dtablesize; i--; sb->eventindex++) { if (sb->eventindex >= sb->dtablesize) @@ -1494,13 +1494,13 @@ static uae_u32 REGPARAM2 bsdsocklib_GetSocketEvents (TrapContext *context) if (flags) { sb->ftable[sb->eventindex] &= ~SET_ALL; put_long (m68k_areg (regs, 0), flags >> 8); - BSDTRACE ((L"%d (0x%x)\n", sb->eventindex + 1, flags >> 8)); + BSDTRACE ((_T("%d (0x%x)\n"), sb->eventindex + 1, flags >> 8)); return sb->eventindex; // xxx } } } #endif - BSDTRACE ((L"-1\n")); + BSDTRACE ((_T("-1\n"))); return -1; } @@ -1519,7 +1519,7 @@ static uae_u32 REGPARAM2 bsdsocklib_init (TrapContext *context) uae_u32 tmp1; int i; - write_log (L"Creating UAE bsdsocket.library 4.1\n"); + write_log (_T("Creating UAE bsdsocket.library 4.1\n")); if (SockLibBase) bsdlib_reset (); @@ -1531,7 +1531,7 @@ static uae_u32 REGPARAM2 bsdsocklib_init (TrapContext *context) tmp1 = CallLib (context, m68k_areg (regs, 6), -0x54); /* MakeLibrary */ if (!tmp1) { - write_log (L"bsdoscket: FATAL: Cannot create bsdsocket.library!\n"); + write_log (_T("bsdoscket: FATAL: Cannot create bsdsocket.library!\n")); return 0; } m68k_areg (regs, 1) = tmp1; @@ -1555,7 +1555,7 @@ static uae_u32 REGPARAM2 bsdsocklib_init (TrapContext *context) tmp1 = CallLib (context, m68k_areg (regs, 6), -0xC6); /* AllocMem */ if (!tmp1) { - write_log (L"bsdsocket: FATAL: Ran out of memory while creating bsdsocket.library!\n"); + write_log (_T("bsdsocket: FATAL: Ran out of memory while creating bsdsocket.library!\n")); return 0; } @@ -1592,12 +1592,12 @@ void bsdlib_reset (void) SockLibBase = 0; - write_log (L"BSDSOCK: cleanup start..\n"); + write_log (_T("BSDSOCK: cleanup start..\n")); host_sbcleanup (NULL); for (sb = socketbases; sb; sb = nsb) { nsb = sb->next; - write_log (L"BSDSOCK: cleanup start socket %x\n", sb); + write_log (_T("BSDSOCK: cleanup start socket %x\n"), sb); host_sbcleanup (sb); free (sb->dtable); @@ -1605,7 +1605,7 @@ void bsdlib_reset (void) free (sb); } - write_log (L"BSDSOCK: cleanup end\n"); + write_log (_T("BSDSOCK: cleanup end\n")); socketbases = NULL; #if 1 @@ -1620,7 +1620,7 @@ void bsdlib_reset (void) } host_sbreset (); - write_log (L"BSDSOCK: cleanup finished\n"); + write_log (_T("BSDSOCK: cleanup finished\n")); } static const TrapHandler sockfuncs[] = { @@ -1640,19 +1640,19 @@ static const TrapHandler sockfuncs[] = { }; static const TCHAR * const funcnames[] = { - L"bsdsocklib_init", L"bsdsocklib_Open", L"bsdsocklib_Close", L"bsdsocklib_Expunge", - L"bsdsocklib_socket", L"bsdsocklib_bind", L"bsdsocklib_listen", L"bsdsocklib_accept", - L"bsdsocklib_connect", L"bsdsocklib_sendto", L"bsdsocklib_send", L"bsdsocklib_recvfrom", L"bsdsocklib_recv", - L"bsdsocklib_shutdown", L"bsdsocklib_setsockopt", L"bsdsocklib_getsockopt", L"bsdsocklib_getsockname", - L"bsdsocklib_getpeername", L"bsdsocklib_IoctlSocket", L"bsdsocklib_CloseSocket", L"bsdsocklib_WaitSelect", - L"bsdsocklib_SetSocketSignals", L"bsdsocklib_getdtablesize", L"bsdsocklib_ObtainSocket", L"bsdsocklib_ReleaseSocket", - L"bsdsocklib_ReleaseCopyOfSocket", L"bsdsocklib_Errno", L"bsdsocklib_SetErrnoPtr", L"bsdsocklib_Inet_NtoA", - L"bsdsocklib_inet_addr", L"bsdsocklib_Inet_LnaOf", L"bsdsocklib_Inet_NetOf", L"bsdsocklib_Inet_MakeAddr", - L"bsdsocklib_inet_network", L"bsdsocklib_gethostbyname", L"bsdsocklib_gethostbyaddr", L"bsdsocklib_getnetbyname", - L"bsdsocklib_getnetbyaddr", L"bsdsocklib_getservbyname", L"bsdsocklib_getservbyport", L"bsdsocklib_getprotobyname", - L"bsdsocklib_getprotobynumber", L"bsdsocklib_vsyslog", L"bsdsocklib_Dup2Socket", L"bsdsocklib_sendmsg", - L"bsdsocklib_recvmsg", L"bsdsocklib_gethostname", L"bsdsocklib_gethostid", L"bsdsocklib_SocketBaseTagList", - L"bsdsocklib_GetSocketEvents" + _T("bsdsocklib_init"), _T("bsdsocklib_Open"), _T("bsdsocklib_Close"), _T("bsdsocklib_Expunge"), + _T("bsdsocklib_socket"), _T("bsdsocklib_bind"), _T("bsdsocklib_listen"), _T("bsdsocklib_accept"), + _T("bsdsocklib_connect"), _T("bsdsocklib_sendto"), _T("bsdsocklib_send"), _T("bsdsocklib_recvfrom"), _T("bsdsocklib_recv"), + _T("bsdsocklib_shutdown"), _T("bsdsocklib_setsockopt"), _T("bsdsocklib_getsockopt"), _T("bsdsocklib_getsockname"), + _T("bsdsocklib_getpeername"), _T("bsdsocklib_IoctlSocket"), _T("bsdsocklib_CloseSocket"), _T("bsdsocklib_WaitSelect"), + _T("bsdsocklib_SetSocketSignals"), _T("bsdsocklib_getdtablesize"), _T("bsdsocklib_ObtainSocket"), _T("bsdsocklib_ReleaseSocket"), + _T("bsdsocklib_ReleaseCopyOfSocket"), _T("bsdsocklib_Errno"), _T("bsdsocklib_SetErrnoPtr"), _T("bsdsocklib_Inet_NtoA"), + _T("bsdsocklib_inet_addr"), _T("bsdsocklib_Inet_LnaOf"), _T("bsdsocklib_Inet_NetOf"), _T("bsdsocklib_Inet_MakeAddr"), + _T("bsdsocklib_inet_network"), _T("bsdsocklib_gethostbyname"), _T("bsdsocklib_gethostbyaddr"), _T("bsdsocklib_getnetbyname"), + _T("bsdsocklib_getnetbyaddr"), _T("bsdsocklib_getservbyname"), _T("bsdsocklib_getservbyport"), _T("bsdsocklib_getprotobyname"), + _T("bsdsocklib_getprotobynumber"), _T("bsdsocklib_vsyslog"), _T("bsdsocklib_Dup2Socket"), _T("bsdsocklib_sendmsg"), + _T("bsdsocklib_recvmsg"), _T("bsdsocklib_gethostname"), _T("bsdsocklib_gethostid"), _T("bsdsocklib_SocketBaseTagList"), + _T("bsdsocklib_GetSocketEvents") }; static uae_u32 sockfuncvecs[sizeof (sockfuncs) / sizeof (*sockfuncs)]; @@ -1688,8 +1688,8 @@ void bsdlib_install (void) if (!init_socket_layer ()) return; - res_name = ds (L"bsdsocket.library"); - res_id = ds (L"UAE bsdsocket.library 4.1"); + res_name = ds (_T("bsdsocket.library")); + res_id = ds (_T("UAE bsdsocket.library 4.1")); for (i = 0; i < (int) (sizeof (sockfuncs) / sizeof (sockfuncs[0])); i++) { sockfuncvecs[i] = here (); @@ -1737,7 +1737,7 @@ void bsdlib_install (void) dl (datatable); dl (*sockfuncvecs); - write_log (L"bsdsocked.library installed\n"); + write_log (_T("bsdsocked.library installed\n")); } #endif /* ! BSDSOCKET */ diff --git a/calc.cpp b/calc.cpp index f921ad5b..20963764 100644 --- a/calc.cpp +++ b/calc.cpp @@ -130,7 +130,7 @@ static bool shunting_yard(const TCHAR *input, TCHAR *output) // If no left parentheses are encountered, either the separator was misplaced // or parentheses were mismatched. if(!pe) { - calc_log ((L"Error: separator or parentheses mismatched\n")); + calc_log ((_T("Error: separator or parentheses mismatched\n"))); return false; } } @@ -181,7 +181,7 @@ static bool shunting_yard(const TCHAR *input, TCHAR *output) } // If the stack runs out without finding a left parenthesis, then there are mismatched parentheses. if(!pe) { - calc_log ((L"Error: parentheses mismatched\n")); + calc_log ((_T("Error: parentheses mismatched\n"))); return false; } // Pop the left parenthesis from the stack, but not onto the output queue. @@ -197,7 +197,7 @@ static bool shunting_yard(const TCHAR *input, TCHAR *output) } } else { - calc_log ((L"Unknown token %c\n", c)); + calc_log ((_T("Unknown token %c\n"), c)); return false; // Unknown token } } @@ -277,7 +277,7 @@ static TCHAR *stacktostr (struct calcstack *st) static TCHAR out[256]; if (st->s) return st->s; - _stprintf(out, L"%f", st->val); + _stprintf(out, _T("%f"), st->val); return out; } @@ -315,8 +315,8 @@ static bool execution_order(const TCHAR *input, double *outval) } // Otherwise, the token is an operator (operator here includes both operators, and functions). else if(is_operator(c) || is_function(c)) { - _stprintf(res, L"_%02d", rn); - calc_log ((L"%s = ", res)); + _stprintf(res, _T("_%02d"), rn); + calc_log ((_T("%s = "), res)); ++rn; // It is known a priori that the operator takes n arguments. unsigned int nargs = op_arg_count(c); @@ -328,14 +328,14 @@ static bool execution_order(const TCHAR *input, double *outval) // Else, Pop the top n values from the stack. // Evaluate the operator, with the values as arguments. if(is_function(c)) { - calc_log ((L"%c(", c)); + calc_log ((_T("%c("), c)); while(nargs > 0){ sc = &stack[sl - nargs]; // to remove reverse order of arguments if(nargs > 1) { - calc_log ((L"%s, ", sc)); + calc_log ((_T("%s, "), sc)); } else { - calc_log ((L"%s)\n", sc)); + calc_log ((_T("%s)\n"), sc)); } --nargs; } @@ -346,15 +346,15 @@ static bool execution_order(const TCHAR *input, double *outval) sc = &stack[sl - 1]; sl--; val = docalc1 (c, sc, val); - calc_log ((L"%c %s = %f;\n", c, stacktostr(sc), val)); + calc_log ((_T("%c %s = %f;\n"), c, stacktostr(sc), val)); } else { sc = &stack[sl - 2]; - calc_log ((L"%s %c ", stacktostr(sc), c)); + calc_log ((_T("%s %c "), stacktostr(sc), c)); sc2 = &stack[sl - 1]; val = docalc2 (c, sc, sc2); sl--;sl--; - calc_log ((L"%s = %f;\n", stacktostr(sc2), val)); + calc_log ((_T("%s = %f;\n"), stacktostr(sc2), val)); } } // Push the returned results, if any, back onto the stack. @@ -369,7 +369,7 @@ static bool execution_order(const TCHAR *input, double *outval) if(sl == 1) { sc = &stack[sl - 1]; sl--; - calc_log ((L"result = %f\n", val)); + calc_log ((_T("result = %f\n"), val)); if (outval) *outval = val; ok = true; @@ -424,12 +424,12 @@ static bool parse_values(const TCHAR *ins, TCHAR *out) bool calc(const TCHAR *input, double *outval) { TCHAR output[IOBUFFERS], output2[IOBUFFERS]; - calc_log ((L"IN: '%s'\n", input)); + calc_log ((_T("IN: '%s'\n"), input)); if (parse_values(input, output2)) { if(shunting_yard(output2, output)) { - calc_log ((L"RPN OUT: %s\n", output)); + calc_log ((_T("RPN OUT: %s\n"), output)); if(!execution_order(output, outval)) { - calc_log ((L"PARSE ERROR!\n")); + calc_log ((_T("PARSE ERROR!\n"))); } else { return true; } diff --git a/catweasel.cpp b/catweasel.cpp index a4433e48..e154d80c 100644 --- a/catweasel.cpp +++ b/catweasel.cpp @@ -286,11 +286,11 @@ uae_u32 catweasel_do_bget (uaecptr addr) buf1[0] = (uae_u8)addr; if (handle != INVALID_HANDLE_VALUE) { if (!DeviceIoControl (handle, CW_PEEKREG_FULL, buf1, 1, buf2, 1, &did_read, 0)) - write_log (L"catweasel_do_bget %02x fail err=%d\n", buf1[0], GetLastError ()); + write_log (_T("catweasel_do_bget %02x fail err=%d\n"), buf1[0], GetLastError ()); } else { buf2[0] = ioport_read (cwc.iobase + addr); } - //write_log (L"G %02X %02X %d\n", buf1[0], buf2[0], did_read); + //write_log (_T("G %02X %02X %d\n"), buf1[0], buf2[0], did_read); return buf2[0]; } @@ -305,11 +305,11 @@ void catweasel_do_bput (uaecptr addr, uae_u32 b) buf[1] = b; if (handle != INVALID_HANDLE_VALUE) { if (!DeviceIoControl (handle, CW_POKEREG_FULL, buf, 2, 0, 0, &did_read, 0)) - write_log (L"catweasel_do_bput %02x=%02x fail err=%d\n", buf[0], buf[1], GetLastError ()); + write_log (_T("catweasel_do_bput %02x=%02x fail err=%d\n"), buf[0], buf[1], GetLastError ()); } else { ioport_write (cwc.iobase + addr, b); } - //write_log (L"P %02X %02X %d\n", (uae_u8)addr, (uae_u8)b, did_read); + //write_log (_T("P %02X %02X %d\n"), (uae_u8)addr, (uae_u8)b, did_read); } #include "core.cw4.cpp" @@ -358,21 +358,21 @@ static int catweasel4_configure (void) sleep_millis(10); if (cw_config_done()) { - write_log (L"CW: FPGA already configured, skipping core upload\n"); + write_log (_T("CW: FPGA already configured, skipping core upload\n")); return 1; } cw_resetFPGA(); sleep_millis(10); if (cw_config_done()) { - write_log (L"CW: FPGA failed to reset!\n"); + write_log (_T("CW: FPGA failed to reset!\n")); return 0; } - f = zfile_fopen(L"core.cw4", L"rb", ZFD_NORMAL); + f = zfile_fopen(_T("core.cw4"), _T("rb"), ZFD_NORMAL); if (!f) { - f = zfile_fopen_data (L"core.cw4.gz", core_len, core); + f = zfile_fopen_data (_T("core.cw4.gz"), core_len, core); f = zfile_gunzip (f); } - write_log (L"CW: starting core upload, this will take few seconds\n"); + write_log (_T("CW: starting core upload, this will take few seconds\n")); t = time(NULL) + 10; // give up if upload takes more than 10s for (;;) { uae_u8 b; @@ -381,7 +381,7 @@ static int catweasel4_configure (void) ioport_write (cwc.iobase + 3, (b & 1) ? 67 : 65); while (!cw_fpga_ready()) { if (time(NULL) >= t) { - write_log (L"CW: FPGA core upload got stuck!?\n"); + write_log (_T("CW: FPGA core upload got stuck!?\n")); cw_resetFPGA(); return 0; } @@ -389,21 +389,21 @@ static int catweasel4_configure (void) ioport_write (cwc.iobase + 192, b); } if (!cw_config_done()) { - write_log (L"CW: FPGA didn't accept the core!\n"); + write_log (_T("CW: FPGA didn't accept the core!\n")); cw_resetFPGA(); return 0; } sleep_millis(10); - write_log (L"CW: core uploaded successfully\n"); + write_log (_T("CW: core uploaded successfully\n")); return 1; } #include #include -#define PCI_CW_MK3 L"PCI\\VEN_E159&DEV_0001&SUBSYS_00021212" -#define PCI_CW_MK4 L"PCI\\VEN_E159&DEV_0001&SUBSYS_00035213" -#define PCI_CW_MK4_BUG L"PCI\\VEN_E159&DEV_0001&SUBSYS_00025213" +#define PCI_CW_MK3 _T("PCI\\VEN_E159&DEV_0001&SUBSYS_00021212") +#define PCI_CW_MK4 _T("PCI\\VEN_E159&DEV_0001&SUBSYS_00035213") +#define PCI_CW_MK4_BUG _T("PCI\\VEN_E159&DEV_0001&SUBSYS_00025213") extern int os_winnt; int force_direct_catweasel; @@ -496,7 +496,7 @@ static int direct_detect(void) if (resId == ResType_IO) { PIO_RESOURCE pIoData = (PIO_RESOURCE)resDesData; if(pIoData->IO_Header.IOD_Alloc_End-pIoData->IO_Header.IOD_Alloc_Base+1) { - write_log (L"CW: PCI SCAN: CWMK%d @%I64X - %I64X\n", cw, + write_log (_T("CW: PCI SCAN: CWMK%d @%I64X - %I64X\n"), cw, pIoData->IO_Header.IOD_Alloc_Base,pIoData->IO_Header.IOD_Alloc_End); cwc.iobase = (int)pIoData->IO_Header.IOD_Alloc_Base; cwc.direct_type = cw; @@ -549,7 +549,7 @@ int catweasel_init(void) i = currprefs.catweasel; if (currprefs.catweasel < 0) i = -currprefs.catweasel + 1; - _stprintf (name, L"\\\\.\\CAT%d_F0", i); + _stprintf (name, _T("\\\\.\\CAT%d_F0"), i); handle = CreateFile (name, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_WRITE|FILE_SHARE_READ, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0); if (handle != INVALID_HANDLE_VALUE || currprefs.catweasel > 0) @@ -563,7 +563,7 @@ int catweasel_init(void) } if (handle == INVALID_HANDLE_VALUE) { - _tcscpy (name, L"[DIRECT]"); + _tcscpy (name, _T("[DIRECT]")); if (cwc.direct_type && ioport_init()) { cwc.direct_access = 1; if (cwc.direct_type == 4 && catweasel4_configure()) { @@ -581,24 +581,24 @@ int catweasel_init(void) } } if (cwc.type == 0) { - write_log (L"CW: No Catweasel detected\n"); + write_log (_T("CW: No Catweasel detected\n")); goto fail; } } if (!cwc.direct_type) { if (!DeviceIoControl (handle, CW_GET_VERSION, 0, 0, buffer, sizeof (buffer), &len, 0)) { - write_log (L"CW: CW_GET_VERSION failed %d\n", GetLastError ()); + write_log (_T("CW: CW_GET_VERSION failed %d\n"), GetLastError ()); goto fail; } s = au ((char*)buffer); - write_log (L"CW driver version string '%s'\n", s); + write_log (_T("CW driver version string '%s'\n"), s); xfree (s); if (!DeviceIoControl (handle, CW_GET_HWVERSION, 0, 0, buffer, sizeof (buffer), &len, 0)) { - write_log (L"CW: CW_GET_HWVERSION failed %d\n", GetLastError ()); + write_log (_T("CW: CW_GET_HWVERSION failed %d\n"), GetLastError ()); goto fail; } - write_log (L"CW: v=%d 14=%d 28=%d 56=%d joy=%d dpm=%d sid=%d kb=%d sidfifo=%d\n", + write_log (_T("CW: v=%d 14=%d 28=%d 56=%d joy=%d dpm=%d sid=%d kb=%d sidfifo=%d\n"), buffer[0], buffer[1], buffer[2], buffer[3], buffer[4], buffer[5], buffer[6], buffer[7], ((uae_u32*)(buffer + 8))[0]); cwc.can_joy = (buffer[4] & 1) ? 2 : 0; @@ -606,7 +606,7 @@ int catweasel_init(void) cwc.can_kb = buffer[7] & 1; cwc.can_mouse = (buffer[4] & 2) ? 2 : 0; if (!DeviceIoControl (handle, CW_LOCK_EXCLUSIVE, 0, 0, buffer, sizeof (buffer), &len, 0)) { - write_log (L"CW: CW_LOCK_EXCLUSIVE failed %d\n", GetLastError ()); + write_log (_T("CW: CW_LOCK_EXCLUSIVE failed %d\n"), GetLastError ()); goto fail; } model = *((uae_u32*)(buffer + 4)); @@ -615,7 +615,7 @@ int catweasel_init(void) cwc.iobase = base; if (!cwc.direct_access) { if (!DeviceIoControl (handle, CW_UNLOCK_EXCLUSIVE, 0, 0, 0, 0, &len, 0)) { - write_log (L"CW: CW_UNLOCK_EXCLUSIVE failed %d\n", GetLastError ()); + write_log (_T("CW: CW_UNLOCK_EXCLUSIVE failed %d\n"), GetLastError ()); } } if (cwc.type == CATWEASEL_TYPE_MK4 && cwc.can_sid) @@ -641,20 +641,20 @@ int catweasel_init(void) } //catweasel_init_controller(&cwc); - _stprintf (tmp, L"CW: Catweasel MK%d @%08x (%s) enabled. %s.", - cwc.type, (int)cwc.iobase, name, cwc.direct_access ? L"DIRECTIO": L"API"); + _stprintf (tmp, _T("CW: Catweasel MK%d @%08x (%s) enabled. %s."), + cwc.type, (int)cwc.iobase, name, cwc.direct_access ? _T("DIRECTIO"): _T("API")); if (cwc.direct_access) { if (cwc.can_sid) { TCHAR *p = tmp + _tcslen (tmp); catweasel_detect_sid (); - _stprintf (p, L" SID0=%d", cwc.sid[0]); + _stprintf (p, _T(" SID0=%d"), cwc.sid[0]); if (cwc.can_sid > 1) { p += _tcslen (p); - _stprintf (p, L" SID1=%d", cwc.sid[1]); + _stprintf (p, _T(" SID1=%d"), cwc.sid[1]); } } } - write_log (L"%s\n", tmp); + write_log (_T("%s\n"), tmp); detected = 1; return 1; @@ -692,12 +692,12 @@ int catweasel_detect (void) detected = -1; for (i = 0; i < 4; i++) { - _stprintf (name, L"\\\\.\\CAT%u_F0", i); + _stprintf (name, _T("\\\\.\\CAT%u_F0"), i); h = CreateFile (name, GENERIC_READ, FILE_SHARE_WRITE|FILE_SHARE_READ, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0); if (h != INVALID_HANDLE_VALUE) { CloseHandle (h); - write_log (L"CW: Windows driver device detected '%s'\n", name); + write_log (_T("CW: Windows driver device detected '%s'\n"), name); detected = 1; return TRUE; } diff --git a/cd32_fmv.cpp b/cd32_fmv.cpp index 0eccb82c..725a0d33 100644 --- a/cd32_fmv.cpp +++ b/cd32_fmv.cpp @@ -90,7 +90,7 @@ static int isdebug (uaecptr addr) static uae_u8 io_bget (uaecptr addr) { addr &= 0xffff; - write_log (L"FMV: IO byte read access %08x!\n", addr); + write_log (_T("FMV: IO byte read access %08x!\n"), addr); return 0; } static uae_u16 io_wget (uaecptr addr) @@ -103,25 +103,25 @@ static uae_u16 io_wget (uaecptr addr) static void io_bput (uaecptr addr, uae_u8 v) { addr &= 0xffff; - write_log (L"FMV: IO byte write access %08x!\n", addr); + write_log (_T("FMV: IO byte write access %08x!\n"), addr); } static void io_wput (uaecptr addr, uae_u16 v) { addr &= 0xffff; if (addr != 0) return; - write_log (L"FMV: IO=%04x\n", v); + write_log (_T("FMV: IO=%04x\n"), v); io_reg = v; } static uae_u8 l64111_bget (uaecptr addr) { - write_log (L"FMV: L64111 byte read access %08x!\n", addr); + write_log (_T("FMV: L64111 byte read access %08x!\n"), addr); return 0; } static void l64111_bput (uaecptr addr, uae_u8 v) { - write_log (L"FMV: L64111 byte write access %08x!\n", addr); + write_log (_T("FMV: L64111 byte write access %08x!\n"), addr); } static uae_u16 l64111_wget (uaecptr addr) @@ -129,7 +129,7 @@ static uae_u16 l64111_wget (uaecptr addr) addr >>= 1; addr &= 31; #if FMV_DEBUG > 0 - write_log (L"FMV: L64111 read reg %d -> %04x\n", addr, l64111regs[addr]); + write_log (_T("FMV: L64111 read reg %d -> %04x\n"), addr, l64111regs[addr]); #endif if (addr == 4) return l64111intstatus1; @@ -144,7 +144,7 @@ static void l64111_wput (uaecptr addr, uae_u16 v) addr &= 31; #if FMV_DEBUG > 0 - write_log (L"FMV: L64111 write reg %d = %04x\n", addr, v); + write_log (_T("FMV: L64111 write reg %d = %04x\n"), addr, v); #endif if (addr == 4) { @@ -163,32 +163,32 @@ static void l64111_wput (uaecptr addr, uae_u16 v) static uae_u8 cl450_bget (uaecptr addr) { addr &= 0xff; - write_log (L"FMV: CL450 byte read access %08x!\n", addr); + write_log (_T("FMV: CL450 byte read access %08x!\n"), addr); return 0; } static uae_u16 cl450_wget (uaecptr addr) { addr &= 0xff; addr >>= 1; - write_log (L"FMV: CL450 read reg %d\n", addr); + write_log (_T("FMV: CL450 read reg %d\n"), addr); return 0; } static void cl450_bput (uaecptr addr, uae_u8 v) { addr &= 0xff; - write_log (L"FMV: CL450 byte write access %08x!\n", addr); + write_log (_T("FMV: CL450 byte write access %08x!\n"), addr); } static void cl450_wput (uaecptr addr, uae_u16 v) { addr &= 0xff; - write_log (L"FMV: CL450 write reg %d = %04x\n", addr, v); + write_log (_T("FMV: CL450 write reg %d = %04x\n"), addr, v); } static uae_u8 romram_bget (uaecptr addr) { #ifdef FMV_DEBUG if (isdebug (addr)) - write_log (L"romram_bget %08X PC=%08X\n", addr, M68K_GETPC); + write_log (_T("romram_bget %08X PC=%08X\n"), addr, M68K_GETPC); #endif if (addr >= IO_BASE && addr < VRAM_BASE) return 0; @@ -198,7 +198,7 @@ static uae_u16 romram_wget (uaecptr addr) { #ifdef FMV_DEBUG if (isdebug (addr)) - write_log (L"romram_wget %08X PC=%08X\n", addr, M68K_GETPC); + write_log (_T("romram_wget %08X PC=%08X\n"), addr, M68K_GETPC); #endif if (addr >= IO_BASE && addr < VRAM_BASE) return 0; @@ -210,7 +210,7 @@ static void ram_bput (uaecptr addr, uae_u8 v) return; rom[addr] = v; if (isdebug (addr)) { - write_log (L"ram_bput %08X=%02X PC=%08X\n", addr, v & 0xff, M68K_GETPC); + write_log (_T("ram_bput %08X=%02X PC=%08X\n"), addr, v & 0xff, M68K_GETPC); } } static void ram_wput (uaecptr addr, uae_u16 v) @@ -220,7 +220,7 @@ static void ram_wput (uaecptr addr, uae_u16 v) rom[addr + 0] = v >> 8; rom[addr + 1] = v >> 0; if (isdebug (addr)) { - write_log (L"ram_wput %08X=%04X PC=%08X\n", addr, v & 0xffff, M68K_GETPC); + write_log (_T("ram_wput %08X=%04X PC=%08X\n"), addr, v & 0xffff, M68K_GETPC); } } @@ -241,7 +241,7 @@ static uae_u32 REGPARAM2 fmv_wget (uaecptr addr) #ifdef FMV_DEBUG if (isdebug (addr)) - write_log (L"fmv_wget %08X=%04X PC=%08X\n", addr, v, M68K_GETPC); + write_log (_T("fmv_wget %08X=%04X PC=%08X\n"), addr, v, M68K_GETPC); #endif return v; } @@ -252,7 +252,7 @@ static uae_u32 REGPARAM2 fmv_lget (uaecptr addr) v = (fmv_wget (addr) << 16) | (fmv_wget (addr + 2) << 0); #ifdef FMV_DEBUG if (isdebug (addr)) - write_log (L"fmv_lget %08X=%08X PC=%08X\n", addr, v, M68K_GETPC); + write_log (_T("fmv_lget %08X=%08X PC=%08X\n"), addr, v, M68K_GETPC); #endif return v; } @@ -280,7 +280,7 @@ static void REGPARAM2 fmv_wput (uaecptr addr, uae_u32 w) addr &= fmv_mask; #ifdef FMV_DEBUG if (isdebug (addr)) - write_log (L"fmv_wput %04X=%04X PC=%08X\n", addr, w & 65535, M68K_GETPC); + write_log (_T("fmv_wput %04X=%04X PC=%08X\n"), addr, w & 65535, M68K_GETPC); #endif int mask = addr & BANK_MASK; if (mask == L64111_BASE) @@ -297,7 +297,7 @@ static void REGPARAM2 fmv_lput (uaecptr addr, uae_u32 w) { #ifdef FMV_DEBUG if (isdebug (addr)) - write_log (L"fmv_lput %08X=%08X PC=%08X\n", addr, w, M68K_GETPC); + write_log (_T("fmv_lput %08X=%08X PC=%08X\n"), addr, w, M68K_GETPC); #endif fmv_wput (addr + 0, w >> 16); fmv_wput (addr + 2, w >> 0); @@ -333,7 +333,7 @@ static uae_u32 REGPARAM2 fmv_wgeti (uaecptr addr) if (addr < rom_size) return do_get_mem_word ((uae_u16 *)m); #ifdef FMV_DEBUG - write_log (L"fmv_wgeti %08X %08X PC=%08X\n", addr, v, M68K_GETPC); + write_log (_T("fmv_wgeti %08X %08X PC=%08X\n"), addr, v, M68K_GETPC); #endif return v; } @@ -351,7 +351,7 @@ static uae_u32 REGPARAM2 fmv_lgeti (uaecptr addr) if (addr < rom_size) return do_get_mem_long ((uae_u32 *)m); #ifdef FMV_DEBUG - write_log (L"fmv_lgeti %08X %08X PC=%08X\n", addr, v, M68K_GETPC); + write_log (_T("fmv_lgeti %08X %08X PC=%08X\n"), addr, v, M68K_GETPC); #endif return v; } @@ -373,7 +373,7 @@ static uae_u8 *REGPARAM2 fmv_xlate (uaecptr addr) static addrbank fmv_bank = { fmv_lget, fmv_wget, fmv_bget, fmv_lput, fmv_wput, fmv_bput, - fmv_xlate, fmv_check, NULL, L"CD32 FMV module", + fmv_xlate, fmv_check, NULL, _T("CD32 FMV module"), fmv_lgeti, fmv_wgeti, ABFLAG_ROM | ABFLAG_IO }; @@ -386,7 +386,7 @@ void cd32_fmv_init (uaecptr start) struct romdata *rd; struct zfile *z; - write_log (L"CD32 FMV mapped @$%lx\n", start); + write_log (_T("CD32 FMV mapped @$%lx\n"), start); if (start != fmv_start) return; if (!rl) @@ -394,8 +394,8 @@ void cd32_fmv_init (uaecptr start) rd = rl->rd; z = read_rom (&rd); if (z) { - write_log (L"CD32 FMV ROM %d.%d\n", rd->ver, rd->rev); - rom = mapped_malloc (fmv_size, L"fast"); + write_log (_T("CD32 FMV ROM %d.%d\n"), rd->ver, rd->rev); + rom = mapped_malloc (fmv_size, _T("fast")); if (rom) zfile_fread (rom, rd->size, 1, z); zfile_fclose (z); diff --git a/cdtv.cpp b/cdtv.cpp index 211ec5ad..e6c7755b 100644 --- a/cdtv.cpp +++ b/cdtv.cpp @@ -201,7 +201,7 @@ static int read_sectors (int start, int length) if (cd_playing) cdaudiostop (); #ifdef CDTV_DEBUG_CMD - write_log (L"READ DATA sector %d, %d sectors (blocksize=%d)\n", start, length, cdtv_sectorsize); + write_log (_T("READ DATA sector %d, %d sectors (blocksize=%d)\n"), start, length, cdtv_sectorsize); #endif cdrom_sector = start; cdrom_sectors = length; @@ -235,7 +235,7 @@ static void subfunc (uae_u8 *data, int cnt) if (subcodebufferinuse[i]) total++; } - write_log (L"%d ", total); + write_log (_T("%d "), total); #endif if (subcodebufferinuse[subcodebufferoffsetw]) { memset (subcodebufferinuse, 0, sizeof subcodebufferinuse); @@ -243,7 +243,7 @@ static void subfunc (uae_u8 *data, int cnt) subcodeoffset = -1; uae_sem_post (&sub_sem); #ifdef CDTV_SUB_DEBUG - write_log (L"CDTV: subcode buffer overflow 1\n"); + write_log (_T("CDTV: subcode buffer overflow 1\n")); #endif return; } @@ -251,7 +251,7 @@ static void subfunc (uae_u8 *data, int cnt) while (cnt > 0) { if (subcodebufferinuse[offset]) { #ifdef CDTV_SUB_DEBUG - write_log (L"CDTV: subcode buffer overflow 2\n"); + write_log (_T("CDTV: subcode buffer overflow 2\n")); #endif break; } @@ -339,7 +339,7 @@ static int play_cdtrack (uae_u8 *p) cdaudiostop (); cd_error = 1; activate_stch = 1; - write_log (L"PLAY CD AUDIO: illegal start track %d\n", track_start); + write_log (_T("PLAY CD AUDIO: illegal start track %d\n"), track_start); return 0; } play_end = end; @@ -347,7 +347,7 @@ static int play_cdtrack (uae_u8 *p) last_play_pos = start; last_play_end = end; #ifdef CDTV_DEBUG_CMD - write_log (L"PLAY CD AUDIO from %d-%d, %06X (%d) to %06X (%d)\n", + write_log (_T("PLAY CD AUDIO from %d-%d, %06X (%d) to %06X (%d)\n"), track_start, track_end, start, start, end, end); #endif startplay (); @@ -388,7 +388,7 @@ static int play_cd (uae_u8 *p) last_play_pos = start; last_play_end = end; #ifdef CDTV_DEBUG_CMD - write_log (L"PLAY CD AUDIO from %06X (%d) to %06X (%d)\n", + write_log (_T("PLAY CD AUDIO from %06X (%d) to %06X (%d)\n"), lsn2msf (start), start, lsn2msf (end), end); #endif startplay (); @@ -473,7 +473,7 @@ static int cdrom_modeset (uae_u8 *cmd) { cdtv_sectorsize = (cmd[2] << 8) | cmd[3]; if (cdtv_sectorsize != 2048 && cdtv_sectorsize != 2336 && cdtv_sectorsize != 2352 && cdtv_sectorsize != 2328) { - write_log (L"CDTV: tried to set unknown sector size %d\n", cdtv_sectorsize); + write_log (_T("CDTV: tried to set unknown sector size %d\n"), cdtv_sectorsize); cdtv_sectorsize = 2048; } return 0; @@ -489,13 +489,13 @@ static void cdrom_command_accepted (int size, uae_u8 *cdrom_command_input, int * #ifdef CDTV_DEBUG_CMD tmp[0] = 0; for (i = 0; i < *cdrom_command_cnt_in; i++) - _stprintf (tmp + i * 3, L"%02X%c", cdrom_command_input[i], i < *cdrom_command_cnt_in - 1 ? '.' : ' '); - write_log (L"CD<-: %s\n", tmp); + _stprintf (tmp + i * 3, _T("%02X%c"), cdrom_command_input[i], i < *cdrom_command_cnt_in - 1 ? '.' : ' '); + write_log (_T("CD<-: %s\n"), tmp); if (size > 0) { tmp[0] = 0; for (i = 0; i < size; i++) - _stprintf (tmp + i * 3, L"%02X%c", cdrom_command_output[i], i < size - 1 ? '.' : ' '); - write_log (L"CD->: %s\n", tmp); + _stprintf (tmp + i * 3, _T("%02X%c"), cdrom_command_output[i], i < size - 1 ? '.' : ' '); + write_log (_T("CD->: %s\n"), tmp); } #endif *cdrom_command_cnt_in = 0; @@ -624,7 +624,7 @@ static void cdrom_command_thread (uae_u8 b) } break; default: - write_log (L"unknown CDROM command %02X!\n", s[0]); + write_log (_T("unknown CDROM command %02X!\n"), s[0]); cd_error = 1; cdrom_command_accepted (0, s, &cdrom_command_cnt_in); break; @@ -644,7 +644,7 @@ static void dma_do_thread (void) return; cnt = dmac_wtc; #ifdef CDTV_DEBUG_CMD - write_log (L"DMAC DMA: sector=%d, addr=%08X, words=%d (of %d)\n", + write_log (_T("DMAC DMA: sector=%d, addr=%08X, words=%d (of %d)\n"), cdrom_offset / cdtv_sectorsize, dmac_acr, cnt, cdrom_length / 2); #endif dma_wait += cnt * (uae_u64)312 * 50 / 75 + 1; @@ -659,7 +659,7 @@ static void dma_do_thread (void) if (!didread) { cd_error = 1; activate_stch = 1; - write_log (L"CDTV: CD read error!\n"); + write_log (_T("CDTV: CD read error!\n")); break; } @@ -679,7 +679,7 @@ static void dma_do_thread (void) static void *dev_thread (void *p) { - write_log (L"CDTV: CD thread started\n"); + write_log (_T("CDTV: CD thread started\n")); thread_alive = 1; for (;;) { @@ -700,7 +700,7 @@ static void *dev_thread (void *p) { int m = ismedia (); if (m < 0) { - write_log (L"CDTV: device %d lost\n", unitnum); + write_log (_T("CDTV: device %d lost\n"), unitnum); activate_stch = 1; cd_media = 0; } else if (m != cd_media) { @@ -755,7 +755,7 @@ static void init_play (int start, int end) last_play_pos = start; last_play_end = end; #ifdef CDTV_DEBUG_CMD - write_log (L"PLAY CD AUDIO from %06X (%d) to %06X (%d)\n", + write_log (_T("PLAY CD AUDIO from %06X (%d) to %06X (%d)\n"), lsn2msf (start), start, lsn2msf (end), end); #endif startplay (); @@ -856,7 +856,7 @@ static void tp_bput (int addr, uae_u8 v) static int volstrobe1, volstrobe2; #ifdef CDTV_DEBUG_6525 if (addr != 1) - write_log (L"6525 write %x=%02X PC=%x %d\n", addr, v, M68K_GETPC, regs.s); + write_log (_T("6525 write %x=%02X PC=%x %d\n"), addr, v, M68K_GETPC, regs.s); #endif switch (addr) { @@ -912,7 +912,7 @@ static void tp_bput (int addr, uae_u8 v) } if (!volstrobe2 && ((tp_b >> 7) & 1)) { #ifdef CDTV_DEBUG_CMD - write_log (L"CDTV CD volume = %d\n", cd_volume); + write_log (_T("CDTV CD volume = %d\n"), cd_volume); #endif if (cd_volume > 1023) cd_volume = 1023; @@ -972,7 +972,7 @@ static uae_u8 tp_bget (int addr) // A = subchannel byte input from serial to parallel converter if (subcodeoffset < 0 || subcodeoffset >= SUB_CHANNEL_SIZE) { #ifdef CDTV_SUB_DEBUG - write_log (L"CDTV: requested non-existing subchannel data!? %d\n", subcodeoffset); + write_log (_T("CDTV: requested non-existing subchannel data!? %d\n"), subcodeoffset); #endif v = 0; } else { @@ -1033,7 +1033,7 @@ static uae_u8 tp_bget (int addr) #ifdef CDTV_DEBUG_6525 if (addr < 7 && addr != 1) - write_log (L"6525 read %x=%02X PC=%x %d\n", addr, v, M68K_GETPC, regs.s); + write_log (_T("6525 read %x=%02X PC=%x %d\n"), addr, v, M68K_GETPC, regs.s); #endif return v; } @@ -1103,7 +1103,7 @@ void CDTV_hsync_handler (void) if ((dmac_cntr & (CNTR_INTEN | CNTR_TCEN)) == (CNTR_INTEN | CNTR_TCEN)) { dmac_istr |= ISTR_INT_P | ISTR_E_INT; #ifdef CDTV_DEBUG_CMD - write_log (L"DMA finished\n"); + write_log (_T("DMA finished\n")); #endif } dma_finished = 0; @@ -1143,7 +1143,7 @@ void CDTV_hsync_handler (void) uae_sem_wait (&sub_sem); #ifdef CDTV_SUB_DEBUG if (subcodeoffset >= 0) - write_log (L"CDTV: frame interrupt, subchannel not empty! %d\n", subcodeoffset); + write_log (_T("CDTV: frame interrupt, subchannel not empty! %d\n"), subcodeoffset); #endif subcodeoffset = -1; if (subcodebufferinuse[subcodebufferoffset]) { @@ -1210,7 +1210,7 @@ static void do_stch (void) activate_stch = 0; tp_check_interrupts (); #ifdef CDTV_DEBUG - write_log (L"STCH %d\n", stch_cnt++); + write_log (_T("STCH %d\n"), stch_cnt++); #endif } } @@ -1227,7 +1227,7 @@ void bleh (void) static void cdtv_reset_int (void) { - write_log (L"CDTV: reset\n"); + write_log (_T("CDTV: reset\n")); cdaudiostop (); cd_playing = cd_paused = 0; cd_motor = 0; @@ -1295,7 +1295,7 @@ static uae_u32 dmac_bget2 (uaecptr addr) tp_check_interrupts (); } } else { - write_log (L"CDTV: command register read while empty\n"); + write_log (_T("CDTV: command register read while empty\n")); v = last_out; } break; @@ -1313,7 +1313,7 @@ static uae_u32 dmac_bget2 (uaecptr addr) #ifdef CDTV_DEBUG if (addr != 0x41) - write_log (L"dmac_bget %04X=%02X PC=%08X\n", addr, v, M68K_GETPC); + write_log (_T("dmac_bget %04X=%02X PC=%08X\n"), addr, v, M68K_GETPC); #endif return v; @@ -1327,7 +1327,7 @@ static void dmac_bput2 (uaecptr addr, uae_u32 b) } #ifdef CDTV_DEBUG - write_log (L"dmac_bput %04X=%02X PC=%08X\n", addr, b & 255, M68K_GETPC); + write_log (_T("dmac_bput %04X=%02X PC=%08X\n"), addr, b & 255, M68K_GETPC); #endif switch (addr) @@ -1428,7 +1428,7 @@ static uae_u32 REGPARAM2 dmac_lget (uaecptr addr) v = (dmac_bget2 (addr) << 24) | (dmac_bget2 (addr + 1) << 16) | (dmac_bget2 (addr + 2) << 8) | (dmac_bget2 (addr + 3)); #ifdef CDTV_DEBUG - write_log (L"dmac_lget %08X=%08X PC=%08X\n", addr, v, M68K_GETPC); + write_log (_T("dmac_lget %08X=%08X PC=%08X\n"), addr, v, M68K_GETPC); #endif return v; } @@ -1442,7 +1442,7 @@ static uae_u32 REGPARAM2 dmac_wget (uaecptr addr) addr &= 65535; v = (dmac_bget2 (addr) << 8) | dmac_bget2 (addr + 1); #ifdef CDTV_DEBUG - write_log (L"dmac_wget %08X=%04X PC=%08X\n", addr, v, M68K_GETPC); + write_log (_T("dmac_wget %08X=%04X PC=%08X\n"), addr, v, M68K_GETPC); #endif return v; } @@ -1467,7 +1467,7 @@ static void REGPARAM2 dmac_lput (uaecptr addr, uae_u32 l) #endif addr &= 65535; #ifdef CDTV_DEBUG - write_log (L"dmac_lput %08X=%08X PC=%08X\n", addr, l, M68K_GETPC); + write_log (_T("dmac_lput %08X=%08X PC=%08X\n"), addr, l, M68K_GETPC); #endif dmac_bput2 (addr, l >> 24); dmac_bput2 (addr + 1, l >> 16); @@ -1482,7 +1482,7 @@ static void REGPARAM2 dmac_wput (uaecptr addr, uae_u32 w) #endif addr &= 65535; #ifdef CDTV_DEBUG - write_log (L"dmac_wput %04X=%04X PC=%08X\n", addr, w & 65535, M68K_GETPC); + write_log (_T("dmac_wput %04X=%04X PC=%08X\n"), addr, w & 65535, M68K_GETPC); #endif dmac_bput2 (addr, w >> 8); dmac_bput2 (addr + 1, w); @@ -1497,13 +1497,13 @@ static void REGPARAM2 dmac_bput (uaecptr addr, uae_u32 b) b &= 0xff; if (addr == 0x48) { map_banks (&dmac_bank, b, 0x10000 >> 16, 0x10000); - write_log (L"CDTV DMAC autoconfigured at %02X0000\n", b); + write_log (_T("CDTV DMAC autoconfigured at %02X0000\n"), b); configured = b; expamem_next (); return; } if (addr == 0x4c) { - write_log (L"CDTV DMAC AUTOCONFIG SHUT-UP!\n"); + write_log (_T("CDTV DMAC AUTOCONFIG SHUT-UP!\n")); configured = -1; expamem_next (); return; @@ -1518,7 +1518,7 @@ static void open_unit (void) struct device_info di; unitnum = get_standard_cd_unit (CD_STANDARD_UNIT_CDTV); sys_command_info (unitnum, &di, 0); - write_log (L"using drive %s (unit %d, media %d)\n", di.label, unitnum, di.media_inserted); + write_log (_T("using drive %s (unit %d, media %d)\n"), di.label, unitnum, di.media_inserted); } static void close_unit (void) { @@ -1569,7 +1569,7 @@ static uae_u32 REGPARAM2 dmac_lgeti (uaecptr addr) addrbank dmac_bank = { dmac_lget, dmac_wget, dmac_bget, dmac_lput, dmac_wput, dmac_bput, - default_xlate, default_check, NULL, L"CDTV DMAC/CD Controller", + default_xlate, default_check, NULL, _T("CDTV DMAC/CD Controller"), dmac_lgeti, dmac_wgeti, ABFLAG_IO }; @@ -1584,7 +1584,7 @@ void cdtv_loadcardmem (uae_u8 *p, int size) struct zfile *f; memset (p, 0, size); - f = zfile_fopen (currprefs.flashfile, L"rb", ZFD_NORMAL); + f = zfile_fopen (currprefs.flashfile, _T("rb"), ZFD_NORMAL); if (!f) return; zfile_fseek (f, CDTV_NVRAM_SIZE, SEEK_SET); @@ -1596,7 +1596,7 @@ void cdtv_savecardmem (uae_u8 *p, int size) { struct zfile *f; - f = zfile_fopen (currprefs.flashfile, L"rb+", ZFD_NORMAL); + f = zfile_fopen (currprefs.flashfile, _T("rb+"), ZFD_NORMAL); if (!f) return; zfile_fseek (f, CDTV_NVRAM_SIZE, SEEK_SET); @@ -1610,9 +1610,9 @@ static void cdtv_battram_reset (void) int v; memset (cdtv_battram, 0, CDTV_NVRAM_SIZE); - f = zfile_fopen (currprefs.flashfile, L"rb+", ZFD_NORMAL); + f = zfile_fopen (currprefs.flashfile, _T("rb+"), ZFD_NORMAL); if (!f) { - f = zfile_fopen (currprefs.flashfile, L"wb", 0); + f = zfile_fopen (currprefs.flashfile, _T("wb"), 0); if (f) { zfile_fwrite (cdtv_battram, CDTV_NVRAM_SIZE, 1, f); zfile_fclose (f); @@ -1636,7 +1636,7 @@ void cdtv_battram_write (int addr, int v) if (cdtv_battram[offset] == v) return; cdtv_battram[offset] = v; - f = zfile_fopen (currprefs.flashfile, L"rb+", ZFD_NORMAL); + f = zfile_fopen (currprefs.flashfile, _T("rb+"), ZFD_NORMAL); if (!f) return; zfile_fseek (f, offset, SEEK_SET); @@ -1699,7 +1699,7 @@ static void romhack (void) rl = getromlistbyids(roms); if (rl) { - write_log (L"A590/A2091 BOOT ROM '%s' %d.%d\n", rl->path, rl->rd->ver, rl->rd->rev); + write_log (_T("A590/A2091 BOOT ROM '%s' %d.%d\n"), rl->path, rl->rd->ver, rl->rd->rev); z = zfile_fopen(rl->path, "rb", ZFD_NORMAL); if (z) { rom_size = 16384; @@ -1726,7 +1726,7 @@ void cdtv_init (void) close_unit (); if (!thread_alive) { init_comm_pipe (&requests, 100, 1); - uae_start_thread (L"cdtv", dev_thread, NULL, NULL); + uae_start_thread (_T("cdtv"), dev_thread, NULL, NULL); while (!thread_alive) sleep_millis (10); uae_sem_init (&sub_sem, 0, 1); diff --git a/cfgfile.cpp b/cfgfile.cpp index dccadbd7..a2c9afc2 100644 --- a/cfgfile.cpp +++ b/cfgfile.cpp @@ -49,159 +49,159 @@ struct cfg_lines static const struct cfg_lines opttable[] = { - {L"help", L"Prints this help" }, - {L"config_description", L"" }, - {L"config_info", L"" }, - {L"use_gui", L"Enable the GUI? If no, then goes straight to emulator" }, - {L"use_debugger", L"Enable the debugger?" }, - {L"cpu_speed", L"can be max, real, or a number between 1 and 20" }, - {L"cpu_model", L"Can be 68000, 68010, 68020, 68030, 68040, 68060" }, - {L"fpu_model", L"Can be 68881, 68882, 68040, 68060" }, - {L"cpu_compatible", L"yes enables compatibility-mode" }, - {L"cpu_24bit_addressing", L"must be set to 'no' in order for Z3mem or P96mem to work" }, - {L"autoconfig", L"yes = add filesystems and extra ram" }, - {L"log_illegal_mem", L"print illegal memory access by Amiga software?" }, - {L"fastmem_size", L"Size in megabytes of fast-memory" }, - {L"chipmem_size", L"Size in megabytes of chip-memory" }, - {L"bogomem_size", L"Size in megabytes of bogo-memory at 0xC00000" }, - {L"a3000mem_size", L"Size in megabytes of A3000 memory" }, - {L"gfxcard_size", L"Size in megabytes of Picasso96 graphics-card memory" }, - {L"z3mem_size", L"Size in megabytes of Zorro-III expansion memory" }, - {L"gfx_test_speed", L"Test graphics speed?" }, - {L"gfx_framerate", L"Print every nth frame" }, - {L"gfx_width", L"Screen width" }, - {L"gfx_height", L"Screen height" }, - {L"gfx_refreshrate", L"Fullscreen refresh rate" }, - {L"gfx_vsync", L"Sync screen refresh to refresh rate" }, - {L"gfx_lores", L"Treat display as lo-res?" }, - {L"gfx_linemode", L"Can be none, double, or scanlines" }, - {L"gfx_fullscreen_amiga", L"Amiga screens are fullscreen?" }, - {L"gfx_fullscreen_picasso", L"Picasso screens are fullscreen?" }, - {L"gfx_center_horizontal", L"Center display horizontally?" }, - {L"gfx_center_vertical", L"Center display vertically?" }, - {L"gfx_colour_mode", L"" }, - {L"32bit_blits", L"Enable 32 bit blitter emulation" }, - {L"immediate_blits", L"Perform blits immediately" }, - {L"show_leds", L"LED display" }, - {L"keyboard_leds", L"Keyboard LEDs" }, - {L"gfxlib_replacement", L"Use graphics.library replacement?" }, - {L"sound_output", L"" }, - {L"sound_frequency", L"" }, - {L"sound_bits", L"" }, - {L"sound_channels", L"" }, - {L"sound_max_buff", L"" }, - {L"comp_trustbyte", L"How to access bytes in compiler (direct/indirect/indirectKS/afterPic" }, - {L"comp_trustword", L"How to access words in compiler (direct/indirect/indirectKS/afterPic" }, - {L"comp_trustlong", L"How to access longs in compiler (direct/indirect/indirectKS/afterPic" }, - {L"comp_nf", L"Whether to optimize away flag generation where possible" }, - {L"comp_fpu", L"Whether to provide JIT FPU emulation" }, - {L"compforcesettings", L"Whether to force the JIT compiler settings" }, - {L"cachesize", L"How many MB to use to buffer translated instructions"}, - {L"override_dga_address",L"Address from which to map the frame buffer (upper 16 bits) (DANGEROUS!)"}, - {L"avoid_cmov", L"Set to yes on machines that lack the CMOV instruction" }, - {L"avoid_dga", L"Set to yes if the use of DGA extension creates problems" }, - {L"avoid_vid", L"Set to yes if the use of the Vidmode extension creates problems" }, - {L"parallel_on_demand", L"" }, - {L"serial_on_demand", L"" }, - {L"scsi", L"scsi.device emulation" }, - {L"joyport0", L"" }, - {L"joyport1", L"" }, - {L"pci_devices", L"List of PCI devices to make visible to the emulated Amiga" }, - {L"kickstart_rom_file", L"Kickstart ROM image, (C) Copyright Amiga, Inc." }, - {L"kickstart_ext_rom_file", L"Extended Kickstart ROM image, (C) Copyright Amiga, Inc." }, - {L"kickstart_key_file", L"Key-file for encrypted ROM images (from Cloanto's Amiga Forever)" }, - {L"flash_ram_file", L"Flash/battery backed RAM image file." }, - {L"cart_file", L"Freezer cartridge ROM image file." }, - {L"floppy0", L"Diskfile for drive 0" }, - {L"floppy1", L"Diskfile for drive 1" }, - {L"floppy2", L"Diskfile for drive 2" }, - {L"floppy3", L"Diskfile for drive 3" }, - {L"hardfile", L"access,sectors, surfaces, reserved, blocksize, path format" }, - {L"filesystem", L"access,'Amiga volume-name':'host directory path' - where 'access' can be 'read-only' or 'read-write'" }, - {L"catweasel", L"Catweasel board io base address" } + {_T("help"), _T("Prints this help") }, + {_T("config_description"), _T("") }, + {_T("config_info"), _T("") }, + {_T("use_gui"), _T("Enable the GUI? If no, then goes straight to emulator") }, + {_T("use_debugger"), _T("Enable the debugger?") }, + {_T("cpu_speed"), _T("can be max, real, or a number between 1 and 20") }, + {_T("cpu_model"), _T("Can be 68000, 68010, 68020, 68030, 68040, 68060") }, + {_T("fpu_model"), _T("Can be 68881, 68882, 68040, 68060") }, + {_T("cpu_compatible"), _T("yes enables compatibility-mode") }, + {_T("cpu_24bit_addressing"), _T("must be set to 'no' in order for Z3mem or P96mem to work") }, + {_T("autoconfig"), _T("yes = add filesystems and extra ram") }, + {_T("log_illegal_mem"), _T("print illegal memory access by Amiga software?") }, + {_T("fastmem_size"), _T("Size in megabytes of fast-memory") }, + {_T("chipmem_size"), _T("Size in megabytes of chip-memory") }, + {_T("bogomem_size"), _T("Size in megabytes of bogo-memory at 0xC00000") }, + {_T("a3000mem_size"), _T("Size in megabytes of A3000 memory") }, + {_T("gfxcard_size"), _T("Size in megabytes of Picasso96 graphics-card memory") }, + {_T("z3mem_size"), _T("Size in megabytes of Zorro-III expansion memory") }, + {_T("gfx_test_speed"), _T("Test graphics speed?") }, + {_T("gfx_framerate"), _T("Print every nth frame") }, + {_T("gfx_width"), _T("Screen width") }, + {_T("gfx_height"), _T("Screen height") }, + {_T("gfx_refreshrate"), _T("Fullscreen refresh rate") }, + {_T("gfx_vsync"), _T("Sync screen refresh to refresh rate") }, + {_T("gfx_lores"), _T("Treat display as lo-res?") }, + {_T("gfx_linemode"), _T("Can be none, double, or scanlines") }, + {_T("gfx_fullscreen_amiga"), _T("Amiga screens are fullscreen?") }, + {_T("gfx_fullscreen_picasso"), _T("Picasso screens are fullscreen?") }, + {_T("gfx_center_horizontal"), _T("Center display horizontally?") }, + {_T("gfx_center_vertical"), _T("Center display vertically?") }, + {_T("gfx_colour_mode"), _T("") }, + {_T("32bit_blits"), _T("Enable 32 bit blitter emulation") }, + {_T("immediate_blits"), _T("Perform blits immediately") }, + {_T("show_leds"), _T("LED display") }, + {_T("keyboard_leds"), _T("Keyboard LEDs") }, + {_T("gfxlib_replacement"), _T("Use graphics.library replacement?") }, + {_T("sound_output"), _T("") }, + {_T("sound_frequency"), _T("") }, + {_T("sound_bits"), _T("") }, + {_T("sound_channels"), _T("") }, + {_T("sound_max_buff"), _T("") }, + {_T("comp_trustbyte"), _T("How to access bytes in compiler (direct/indirect/indirectKS/afterPic") }, + {_T("comp_trustword"), _T("How to access words in compiler (direct/indirect/indirectKS/afterPic") }, + {_T("comp_trustlong"), _T("How to access longs in compiler (direct/indirect/indirectKS/afterPic") }, + {_T("comp_nf"), _T("Whether to optimize away flag generation where possible") }, + {_T("comp_fpu"), _T("Whether to provide JIT FPU emulation") }, + {_T("compforcesettings"), _T("Whether to force the JIT compiler settings") }, + {_T("cachesize"), _T("How many MB to use to buffer translated instructions")}, + {_T("override_dga_address"),_T("Address from which to map the frame buffer (upper 16 bits) (DANGEROUS!)")}, + {_T("avoid_cmov"), _T("Set to yes on machines that lack the CMOV instruction") }, + {_T("avoid_dga"), _T("Set to yes if the use of DGA extension creates problems") }, + {_T("avoid_vid"), _T("Set to yes if the use of the Vidmode extension creates problems") }, + {_T("parallel_on_demand"), _T("") }, + {_T("serial_on_demand"), _T("") }, + {_T("scsi"), _T("scsi.device emulation") }, + {_T("joyport0"), _T("") }, + {_T("joyport1"), _T("") }, + {_T("pci_devices"), _T("List of PCI devices to make visible to the emulated Amiga") }, + {_T("kickstart_rom_file"), _T("Kickstart ROM image, (C) Copyright Amiga, Inc.") }, + {_T("kickstart_ext_rom_file"), _T("Extended Kickstart ROM image, (C) Copyright Amiga, Inc.") }, + {_T("kickstart_key_file"), _T("Key-file for encrypted ROM images (from Cloanto's Amiga Forever)") }, + {_T("flash_ram_file"), _T("Flash/battery backed RAM image file.") }, + {_T("cart_file"), _T("Freezer cartridge ROM image file.") }, + {_T("floppy0"), _T("Diskfile for drive 0") }, + {_T("floppy1"), _T("Diskfile for drive 1") }, + {_T("floppy2"), _T("Diskfile for drive 2") }, + {_T("floppy3"), _T("Diskfile for drive 3") }, + {_T("hardfile"), _T("access,sectors, surfaces, reserved, blocksize, path format") }, + {_T("filesystem"), _T("access,'Amiga volume-name':'host directory path' - where 'access' can be 'read-only' or 'read-write'") }, + {_T("catweasel"), _T("Catweasel board io base address") } }; -static const TCHAR *guimode1[] = { L"no", L"yes", L"nowait", 0 }; -static const TCHAR *guimode2[] = { L"false", L"true", L"nowait", 0 }; -static const TCHAR *guimode3[] = { L"0", L"1", L"nowait", 0 }; -static const TCHAR *csmode[] = { L"ocs", L"ecs_agnus", L"ecs_denise", L"ecs", L"aga", 0 }; -static const TCHAR *linemode[] = { L"none", L"none", L"double", L"scanlines", 0 }; -static const TCHAR *speedmode[] = { L"max", L"real", 0 }; -static const TCHAR *colormode1[] = { L"8bit", L"15bit", L"16bit", L"8bit_dither", L"4bit_dither", L"32bit", 0 }; -static const TCHAR *colormode2[] = { L"8", L"15", L"16", L"8d", L"4d", L"32", 0 }; -static const TCHAR *soundmode1[] = { L"none", L"interrupts", L"normal", L"exact", 0 }; -static const TCHAR *soundmode2[] = { L"none", L"interrupts", L"good", L"best", 0 }; -static const TCHAR *centermode1[] = { L"none", L"simple", L"smart", 0 }; -static const TCHAR *centermode2[] = { L"false", L"true", L"smart", 0 }; -static const TCHAR *stereomode[] = { L"mono", L"stereo", L"clonedstereo", L"4ch", L"clonedstereo6ch", L"6ch", L"mixed", 0 }; -static const TCHAR *interpolmode[] = { L"none", L"anti", L"sinc", L"rh", L"crux", 0 }; -static const TCHAR *collmode[] = { L"none", L"sprites", L"playfields", L"full", 0 }; -static const TCHAR *compmode[] = { L"direct", L"indirect", L"indirectKS", L"afterPic", 0 }; -static const TCHAR *flushmode[] = { L"soft", L"hard", 0 }; -static const TCHAR *kbleds[] = { L"none", L"POWER", L"DF0", L"DF1", L"DF2", L"DF3", L"HD", L"CD", 0 }; -static const TCHAR *onscreenleds[] = { L"false", L"true", L"rtg", L"both", 0 }; -static const TCHAR *soundfiltermode1[] = { L"off", L"emulated", L"on", 0 }; -static const TCHAR *soundfiltermode2[] = { L"standard", L"enhanced", 0 }; -static const TCHAR *lorestype1[] = { L"lores", L"hires", L"superhires", 0 }; -static const TCHAR *lorestype2[] = { L"true", L"false", 0 }; -static const TCHAR *loresmode[] = { L"normal", L"filtered", 0 }; -static const TCHAR *horizmode[] = { L"vertical", L"lores", L"hires", L"superhires", 0 }; -static const TCHAR *vertmode[] = { L"horizontal", L"single", L"double", L"quadruple", 0 }; +static const TCHAR *guimode1[] = { _T("no"), _T("yes"), _T("nowait"), 0 }; +static const TCHAR *guimode2[] = { _T("false"), _T("true"), _T("nowait"), 0 }; +static const TCHAR *guimode3[] = { _T("0"), _T("1"), _T("nowait"), 0 }; +static const TCHAR *csmode[] = { _T("ocs"), _T("ecs_agnus"), _T("ecs_denise"), _T("ecs"), _T("aga"), 0 }; +static const TCHAR *linemode[] = { _T("none"), _T("none"), _T("double"), _T("scanlines"), 0 }; +static const TCHAR *speedmode[] = { _T("max"), _T("real"), 0 }; +static const TCHAR *colormode1[] = { _T("8bit"), _T("15bit"), _T("16bit"), _T("8bit_dither"), _T("4bit_dither"), _T("32bit"), 0 }; +static const TCHAR *colormode2[] = { _T("8"), _T("15"), _T("16"), _T("8d"), _T("4d"), _T("32"), 0 }; +static const TCHAR *soundmode1[] = { _T("none"), _T("interrupts"), _T("normal"), _T("exact"), 0 }; +static const TCHAR *soundmode2[] = { _T("none"), _T("interrupts"), _T("good"), _T("best"), 0 }; +static const TCHAR *centermode1[] = { _T("none"), _T("simple"), _T("smart"), 0 }; +static const TCHAR *centermode2[] = { _T("false"), _T("true"), _T("smart"), 0 }; +static const TCHAR *stereomode[] = { _T("mono"), _T("stereo"), _T("clonedstereo"), _T("4ch"), _T("clonedstereo6ch"), _T("6ch"), _T("mixed"), 0 }; +static const TCHAR *interpolmode[] = { _T("none"), _T("anti"), _T("sinc"), _T("rh"), _T("crux"), 0 }; +static const TCHAR *collmode[] = { _T("none"), _T("sprites"), _T("playfields"), _T("full"), 0 }; +static const TCHAR *compmode[] = { _T("direct"), _T("indirect"), _T("indirectKS"), _T("afterPic"), 0 }; +static const TCHAR *flushmode[] = { _T("soft"), _T("hard"), 0 }; +static const TCHAR *kbleds[] = { _T("none"), _T("POWER"), _T("DF0"), _T("DF1"), _T("DF2"), _T("DF3"), _T("HD"), _T("CD"), 0 }; +static const TCHAR *onscreenleds[] = { _T("false"), _T("true"), _T("rtg"), _T("both"), 0 }; +static const TCHAR *soundfiltermode1[] = { _T("off"), _T("emulated"), _T("on"), 0 }; +static const TCHAR *soundfiltermode2[] = { _T("standard"), _T("enhanced"), 0 }; +static const TCHAR *lorestype1[] = { _T("lores"), _T("hires"), _T("superhires"), 0 }; +static const TCHAR *lorestype2[] = { _T("true"), _T("false"), 0 }; +static const TCHAR *loresmode[] = { _T("normal"), _T("filtered"), 0 }; +static const TCHAR *horizmode[] = { _T("vertical"), _T("lores"), _T("hires"), _T("superhires"), 0 }; +static const TCHAR *vertmode[] = { _T("horizontal"), _T("single"), _T("double"), _T("quadruple"), 0 }; #ifdef GFXFILTER -static const TCHAR *filtermode2[] = { L"1x", L"2x", L"3x", L"4x", 0 }; +static const TCHAR *filtermode2[] = { _T("1x"), _T("2x"), _T("3x"), _T("4x"), 0 }; #endif -static const TCHAR *cartsmode[] = { L"none", L"hrtmon", 0 }; -static const TCHAR *idemode[] = { L"none", L"a600/a1200", L"a4000", 0 }; -static const TCHAR *rtctype[] = { L"none", L"MSM6242B", L"RP5C01A", 0 }; -static const TCHAR *ciaatodmode[] = { L"vblank", L"50hz", L"60hz", 0 }; -static const TCHAR *ksmirrortype[] = { L"none", L"e0", L"a8+e0", 0 }; +static const TCHAR *cartsmode[] = { _T("none"), _T("hrtmon"), 0 }; +static const TCHAR *idemode[] = { _T("none"), _T("a600/a1200"), _T("a4000"), 0 }; +static const TCHAR *rtctype[] = { _T("none"), _T("MSM6242B"), _T("RP5C01A"), 0 }; +static const TCHAR *ciaatodmode[] = { _T("vblank"), _T("50hz"), _T("60hz"), 0 }; +static const TCHAR *ksmirrortype[] = { _T("none"), _T("e0"), _T("a8+e0"), 0 }; static const TCHAR *cscompa[] = { - L"-", L"Generic", L"CDTV", L"CD32", L"A500", L"A500+", L"A600", - L"A1000", L"A1200", L"A2000", L"A3000", L"A3000T", L"A4000", L"A4000T", 0 + _T("-"), _T("Generic"), _T("CDTV"), _T("CD32"), _T("A500"), _T("A500+"), _T("A600"), + _T("A1000"), _T("A1200"), _T("A2000"), _T("A3000"), _T("A3000T"), _T("A4000"), _T("A4000T"), 0 }; static const TCHAR *qsmodes[] = { - L"A500", L"A500+", L"A600", L"A1000", L"A1200", L"A3000", L"A4000", L"", L"CD32", L"CDTV", L"ARCADIA", NULL }; + _T("A500"), _T("A500+"), _T("A600"), _T("A1000"), _T("A1200"), _T("A3000"), _T("A4000"), _T(""), _T("CD32"), _T("CDTV"), _T("ARCADIA"), NULL }; /* 3-state boolean! */ -static const TCHAR *fullmodes[] = { L"false", L"true", /* "FILE_NOT_FOUND", */ L"fullwindow", 0 }; +static const TCHAR *fullmodes[] = { _T("false"), _T("true"), /* "FILE_NOT_FOUND", */ _T("fullwindow"), 0 }; /* bleh for compatibility */ -static const TCHAR *scsimode[] = { L"false", L"true", L"scsi", 0 }; -static const TCHAR *maxhoriz[] = { L"lores", L"hires", L"superhires", 0 }; -static const TCHAR *maxvert[] = { L"nointerlace", L"interlace", 0 }; -static const TCHAR *abspointers[] = { L"none", L"mousehack", L"tablet", 0 }; -static const TCHAR *magiccursors[] = { L"both", L"native", L"host", 0 }; -static const TCHAR *autoscale[] = { L"none", L"auto", L"standard", L"max", L"scale", L"resize", L"center", L"manual", L"integer", 0 }; -static const TCHAR *joyportmodes[] = { L"", L"mouse", L"djoy", L"gamepad", L"ajoy", L"cdtvjoy", L"cd32joy", L"lightpen", 0 }; -static const TCHAR *joyaf[] = { L"none", L"normal", L"toggle", 0 }; -static const TCHAR *epsonprinter[] = { L"none", L"ascii", L"epson_matrix_9pin", L"epson_matrix_24pin", L"epson_matrix_48pin", 0 }; -static const TCHAR *aspects[] = { L"none", L"vga", L"tv", 0 }; -static const TCHAR *vsyncmodes[] = { L"false", L"true", L"autoswitch", 0 }; -static const TCHAR *vsyncmodes2[] = { L"normal", L"busywait", 0 }; -static const TCHAR *filterapi[] = { L"directdraw", L"direct3d", 0 }; +static const TCHAR *scsimode[] = { _T("false"), _T("true"), _T("scsi"), 0 }; +static const TCHAR *maxhoriz[] = { _T("lores"), _T("hires"), _T("superhires"), 0 }; +static const TCHAR *maxvert[] = { _T("nointerlace"), _T("interlace"), 0 }; +static const TCHAR *abspointers[] = { _T("none"), _T("mousehack"), _T("tablet"), 0 }; +static const TCHAR *magiccursors[] = { _T("both"), _T("native"), _T("host"), 0 }; +static const TCHAR *autoscale[] = { _T("none"), _T("auto"), _T("standard"), _T("max"), _T("scale"), _T("resize"), _T("center"), _T("manual"), _T("integer"), 0 }; +static const TCHAR *joyportmodes[] = { _T(""), _T("mouse"), _T("djoy"), _T("gamepad"), _T("ajoy"), _T("cdtvjoy"), _T("cd32joy"), _T("lightpen"), 0 }; +static const TCHAR *joyaf[] = { _T("none"), _T("normal"), _T("toggle"), 0 }; +static const TCHAR *epsonprinter[] = { _T("none"), _T("ascii"), _T("epson_matrix_9pin"), _T("epson_matrix_24pin"), _T("epson_matrix_48pin"), 0 }; +static const TCHAR *aspects[] = { _T("none"), _T("vga"), _T("tv"), 0 }; +static const TCHAR *vsyncmodes[] = { _T("false"), _T("true"), _T("autoswitch"), 0 }; +static const TCHAR *vsyncmodes2[] = { _T("normal"), _T("busywait"), 0 }; +static const TCHAR *filterapi[] = { _T("directdraw"), _T("direct3d"), 0 }; static const TCHAR *dongles[] = { - L"none", - L"robocop 3", L"leaderboard", L"b.a.t. ii", L"italy'90 soccer", L"dames grand maitre", - L"rugby coach", L"cricket captain", L"leviathan", + _T("none"), + _T("robocop 3"), _T("leaderboard"), _T("b.a.t. ii"), _T("italy'90 soccer"), _T("dames grand maitre"), + _T("rugby coach"), _T("cricket captain"), _T("leviathan"), NULL }; -static const TCHAR *cdmodes[] = { L"disabled", L"", L"image", L"ioctl", L"spti", L"aspi", 0 }; -static const TCHAR *cdconmodes[] = { L"", L"uae", L"ide", L"scsi", L"cdtv", L"cd32", 0 }; -static const TCHAR *specialmonitors[] = { L"none", L"autodetect", L"a2024", L"graffiti", 0 }; -static const TCHAR *rtgtype[] = { L"ZorroII", L"ZorroIII", 0 }; +static const TCHAR *cdmodes[] = { _T("disabled"), _T(""), _T("image"), _T("ioctl"), _T("spti"), _T("aspi"), 0 }; +static const TCHAR *cdconmodes[] = { _T(""), _T("uae"), _T("ide"), _T("scsi"), _T("cdtv"), _T("cd32"), 0 }; +static const TCHAR *specialmonitors[] = { _T("none"), _T("autodetect"), _T("a2024"), _T("graffiti"), 0 }; +static const TCHAR *rtgtype[] = { _T("ZorroII"), _T("ZorroIII"), 0 }; static const TCHAR *obsolete[] = { - L"accuracy", L"gfx_opengl", L"gfx_32bit_blits", L"32bit_blits", - L"gfx_immediate_blits", L"gfx_ntsc", L"win32", L"gfx_filter_bits", - L"sound_pri_cutoff", L"sound_pri_time", L"sound_min_buff", L"sound_bits", - L"gfx_test_speed", L"gfxlib_replacement", L"enforcer", L"catweasel_io", - L"kickstart_key_file", L"fast_copper", L"sound_adjust", L"sound_latency", - L"serial_hardware_dtrdsr", L"gfx_filter_upscale", - L"gfx_correct_aspect", L"gfx_autoscale", L"parallel_sampler", L"parallel_ascii_emulation", - L"avoid_vid", L"avoid_dga", L"z3chipmem_size", L"state_replay_buffer", L"state_replay", + _T("accuracy"), _T("gfx_opengl"), _T("gfx_32bit_blits"), _T("32bit_blits"), + _T("gfx_immediate_blits"), _T("gfx_ntsc"), _T("win32"), _T("gfx_filter_bits"), + _T("sound_pri_cutoff"), _T("sound_pri_time"), _T("sound_min_buff"), _T("sound_bits"), + _T("gfx_test_speed"), _T("gfxlib_replacement"), _T("enforcer"), _T("catweasel_io"), + _T("kickstart_key_file"), _T("fast_copper"), _T("sound_adjust"), _T("sound_latency"), + _T("serial_hardware_dtrdsr"), _T("gfx_filter_upscale"), + _T("gfx_correct_aspect"), _T("gfx_autoscale"), _T("parallel_sampler"), _T("parallel_ascii_emulation"), + _T("avoid_vid"), _T("avoid_dga"), _T("z3chipmem_size"), _T("state_replay_buffer"), _T("state_replay"), NULL }; -#define UNEXPANDED L"$(FILE_PATH)" +#define UNEXPANDED _T("$(FILE_PATH)") static void trimwsa (char *s) @@ -234,7 +234,7 @@ static TCHAR *cfgfile_subst_path2 (const TCHAR *path, const TCHAR *subst, const l = _tcslen (path); while (file[l] == '/') l++; - _tcscat (p, L"/"); + _tcscat (p, _T("/")); _tcscat (p, file + l); p2 = target_expand_environment (p); xfree (p); @@ -262,7 +262,7 @@ TCHAR *cfgfile_subst_path (const TCHAR *path, const TCHAR *subst, const TCHAR *f static TCHAR *cfgfile_get_multipath2 (struct multipath *mp, const TCHAR *path, const TCHAR *file, bool dir) { for (int i = 0; i < MAX_PATHS; i++) { - if (mp->path[i][0] && _tcscmp (mp->path[i], L".\\") != 0 && _tcscmp (mp->path[i], L"./") != 0 && (file[0] != '/' && file[0] != '\\' && !_tcschr(file, ':'))) { + if (mp->path[i][0] && _tcscmp (mp->path[i], _T(".\\")) != 0 && _tcscmp (mp->path[i], _T("./")) != 0 && (file[0] != '/' && file[0] != '\\' && !_tcschr(file, ':'))) { TCHAR *s = NULL; if (path) s = cfgfile_subst_path2 (path, mp->path[i], file); @@ -298,7 +298,7 @@ static TCHAR *cfgfile_get_multipath (struct multipath *mp, const TCHAR *path, co static TCHAR *cfgfile_put_multipath (struct multipath *mp, const TCHAR *s) { for (int i = 0; i < MAX_PATHS; i++) { - if (mp->path[i][0] && _tcscmp (mp->path[i], L".\\") != 0 && _tcscmp (mp->path[i], L"./") != 0) { + if (mp->path[i][0] && _tcscmp (mp->path[i], _T(".\\")) != 0 && _tcscmp (mp->path[i], _T("./")) != 0) { if (_tcsnicmp (mp->path[i], s, _tcslen (mp->path[i])) == 0) { return my_strdup (s + _tcslen (mp->path[i])); } @@ -347,7 +347,7 @@ static size_t cfg_write (void *b, struct zfile *z) return v; } -#define UTF8NAME L".utf8" +#define UTF8NAME _T(".utf8") static void cfg_dowrite (struct zfile *f, const TCHAR *option, const TCHAR *value, int d, int target) { @@ -364,9 +364,9 @@ static void cfg_dowrite (struct zfile *f, const TCHAR *option, const TCHAR *valu utf8 = 1; if (target) - _stprintf (tmp, L"%s.%s=%s", TARGET_NAME, option, value); + _stprintf (tmp, _T("%s.%s=%s"), TARGET_NAME, option, value); else - _stprintf (tmp, L"%s=%s", option, value); + _stprintf (tmp, _T("%s=%s"), option, value); if (d && isdefault (tmp)) goto end; cfg_write (tmp, f); @@ -390,11 +390,11 @@ end: void cfgfile_write_bool (struct zfile *f, const TCHAR *option, bool b) { - cfg_dowrite (f, option, b ? L"true" : L"false", 0, 0); + cfg_dowrite (f, option, b ? _T("true") : _T("false"), 0, 0); } void cfgfile_dwrite_bool (struct zfile *f, const TCHAR *option, bool b) { - cfg_dowrite (f, option, b ? L"true" : L"false", 1, 0); + cfg_dowrite (f, option, b ? _T("true") : _T("false"), 1, 0); } void cfgfile_dwrite_bool (struct zfile *f, const TCHAR *option, int b) { @@ -411,11 +411,11 @@ void cfgfile_dwrite_str (struct zfile *f, const TCHAR *option, const TCHAR *valu void cfgfile_target_write_bool (struct zfile *f, const TCHAR *option, bool b) { - cfg_dowrite (f, option, b ? L"true" : L"false", 0, 1); + cfg_dowrite (f, option, b ? _T("true") : _T("false"), 0, 1); } void cfgfile_target_dwrite_bool (struct zfile *f, const TCHAR *option, bool b) { - cfg_dowrite (f, option, b ? L"true" : L"false", 1, 1); + cfg_dowrite (f, option, b ? _T("true") : _T("false"), 1, 1); } void cfgfile_target_write_str (struct zfile *f, const TCHAR *option, const TCHAR *value) { @@ -472,14 +472,14 @@ static void cfgfile_write_rom (struct zfile *f, struct multipath *mp, const TCHA TCHAR *str = cfgfile_subst_path (mp->path[0], UNEXPANDED, romfile); str = cfgfile_put_multipath (mp, str); cfgfile_write_str (f, name, str); - struct zfile *zf = zfile_fopen (str, L"rb", ZFD_ALL); + struct zfile *zf = zfile_fopen (str, _T("rb"), ZFD_ALL); if (zf) { struct romdata *rd = getromdatabyzfile (zf); if (rd) { TCHAR name2[MAX_DPATH], str2[MAX_DPATH]; _tcscpy (name2, name); - _tcscat (name2, L"_id"); - _stprintf (str2, L"%08X,%s", rd->crc32, rd->name); + _tcscat (name2, _T("_id")); + _stprintf (str2, _T("%08X,%s"), rd->crc32, rd->name); cfgfile_write_str (f, name2, str2); } zfile_fclose (zf); @@ -505,10 +505,10 @@ static void write_filesys_config (struct uae_prefs *p, struct zfile *f) { int i; TCHAR tmp[MAX_DPATH], tmp2[MAX_DPATH]; - TCHAR *hdcontrollers[] = { L"uae", - L"ide0", L"ide1", L"ide2", L"ide3", - L"scsi0", L"scsi1", L"scsi2", L"scsi3", L"scsi4", L"scsi5", L"scsi6", - L"scsram", L"scide" }; /* scsram = smart card sram = pcmcia sram card */ + TCHAR *hdcontrollers[] = { _T("uae"), + _T("ide0"), _T("ide1"), _T("ide2"), _T("ide3"), + _T("scsi0"), _T("scsi1"), _T("scsi2"), _T("scsi3"), _T("scsi4"), _T("scsi5"), _T("scsi6"), + _T("scsram"), _T("scide") }; /* scsram = smart card sram = pcmcia sram card */ for (i = 0; i < p->mountitems; i++) { struct uaedev_config_info *uci = &p->mountconfig[i]; @@ -521,30 +521,30 @@ static void write_filesys_config (struct uae_prefs *p, struct zfile *f) bp = -129; str = cfgfile_put_multipath (&p->path_hardfile, uci->rootdir); if (!uci->ishdf) { - _stprintf (tmp, L"%s,%s:%s:%s,%d", uci->readonly ? L"ro" : L"rw", - uci->devname ? uci->devname : L"", uci->volname, str, bp); - cfgfile_write_str (f, L"filesystem2", tmp); + _stprintf (tmp, _T("%s,%s:%s:%s,%d"), uci->readonly ? _T("ro") : _T("rw"), + uci->devname ? uci->devname : _T(""), uci->volname, str, bp); + cfgfile_write_str (f, _T("filesystem2"), tmp); #if 0 - _stprintf (tmp2, L"filesystem=%s,%s:%s", uci->readonly ? L"ro" : L"rw", + _stprintf (tmp2, _T("filesystem=%s,%s:%s"), uci->readonly ? _T("ro") : _T("rw"), uci->volname, str); zfile_fputs (f, tmp2); #endif } else { - _stprintf (tmp, L"%s,%s:%s,%d,%d,%d,%d,%d,%s,%s", - uci->readonly ? L"ro" : L"rw", - uci->devname ? uci->devname : L"", str, + _stprintf (tmp, _T("%s,%s:%s,%d,%d,%d,%d,%d,%s,%s"), + uci->readonly ? _T("ro") : _T("rw"), + uci->devname ? uci->devname : _T(""), str, uci->sectors, uci->surfaces, uci->reserved, uci->blocksize, - bp, uci->filesys ? uci->filesys : L"", hdcontrollers[uci->controller]); - cfgfile_write_str (f, L"hardfile2", tmp); + bp, uci->filesys ? uci->filesys : _T(""), hdcontrollers[uci->controller]); + cfgfile_write_str (f, _T("hardfile2"), tmp); #if 0 - _stprintf (tmp2, L"hardfile=%s,%d,%d,%d,%d,%s", + _stprintf (tmp2, _T("hardfile=%s,%d,%d,%d,%d,%s"), uci->readonly ? "ro" : "rw", uci->sectors, uci->surfaces, uci->reserved, uci->blocksize, str); zfile_fputs (f, tmp2); #endif } - _stprintf (tmp2, L"uaehf%d", i); - cfgfile_write (f, tmp2, L"%s,%s", uci->ishdf ? L"hdf" : L"dir", tmp); + _stprintf (tmp2, _T("uaehf%d"), i); + cfgfile_write (f, tmp2, _T("%s,%s"), uci->ishdf ? _T("hdf") : _T("dir"), tmp); xfree (str); } } @@ -560,12 +560,12 @@ static void write_compatibility_cpu (struct zfile *f, struct uae_prefs *p) if (model == 68060) model = 68040; if (p->address_space_24 && model == 68020) - _tcscpy (tmp, L"68ec020"); + _tcscpy (tmp, _T("68ec020")); else - _stprintf (tmp, L"%d", model); + _stprintf (tmp, _T("%d"), model); if (model == 68020 && (p->fpu_model == 68881 || p->fpu_model == 68882)) - _tcscat (tmp, L"/68881"); - cfgfile_write (f, L"cpu_type", tmp); + _tcscat (tmp, _T("/68881")); + cfgfile_write (f, _T("cpu_type"), tmp); } void cfgfile_save_options (struct zfile *f, struct uae_prefs *p, int type) @@ -574,15 +574,15 @@ void cfgfile_save_options (struct zfile *f, struct uae_prefs *p, int type) TCHAR tmp[MAX_DPATH]; int i; - cfgfile_write_str (f, L"config_description", p->description); - cfgfile_write_bool (f, L"config_hardware", type & CONFIG_TYPE_HARDWARE); - cfgfile_write_bool (f, L"config_host", !!(type & CONFIG_TYPE_HOST)); + cfgfile_write_str (f, _T("config_description"), p->description); + cfgfile_write_bool (f, _T("config_hardware"), type & CONFIG_TYPE_HARDWARE); + cfgfile_write_bool (f, _T("config_host"), !!(type & CONFIG_TYPE_HOST)); if (p->info[0]) - cfgfile_write (f, L"config_info", p->info); - cfgfile_write (f, L"config_version", L"%d.%d.%d", UAEMAJOR, UAEMINOR, UAESUBREV); - cfgfile_write_str (f, L"config_hardware_path", p->config_hardware_path); - cfgfile_write_str (f, L"config_host_path", p->config_host_path); - cfgfile_write_str (f, L"config_window_title", p->config_window_title); + cfgfile_write (f, _T("config_info"), p->info); + cfgfile_write (f, _T("config_version"), _T("%d.%d.%d"), UAEMAJOR, UAEMINOR, UAESUBREV); + cfgfile_write_str (f, _T("config_hardware_path"), p->config_hardware_path); + cfgfile_write_str (f, _T("config_host_path"), p->config_host_path); + cfgfile_write_str (f, _T("config_window_title"), p->config_window_title); for (sl = p->all_lines; sl; sl = sl->next) { if (sl->unknown) { @@ -593,66 +593,66 @@ void cfgfile_save_options (struct zfile *f, struct uae_prefs *p, int type) for (i = 0; i < MAX_PATHS; i++) { if (p->path_rom.path[i][0]) { - _stprintf (tmp, L"%s.rom_path", TARGET_NAME); + _stprintf (tmp, _T("%s.rom_path"), TARGET_NAME); cfgfile_write_str (f, tmp, p->path_rom.path[i]); } } for (i = 0; i < MAX_PATHS; i++) { if (p->path_floppy.path[i][0]) { - _stprintf (tmp, L"%s.floppy_path", TARGET_NAME); + _stprintf (tmp, _T("%s.floppy_path"), TARGET_NAME); cfgfile_write_str (f, tmp, p->path_floppy.path[i]); } } for (i = 0; i < MAX_PATHS; i++) { if (p->path_hardfile.path[i][0]) { - _stprintf (tmp, L"%s.hardfile_path", TARGET_NAME); + _stprintf (tmp, _T("%s.hardfile_path"), TARGET_NAME); cfgfile_write_str (f, tmp, p->path_hardfile.path[i]); } } for (i = 0; i < MAX_PATHS; i++) { if (p->path_cd.path[i][0]) { - _stprintf (tmp, L"%s.cd_path", TARGET_NAME); + _stprintf (tmp, _T("%s.cd_path"), TARGET_NAME); cfgfile_write_str (f, tmp, p->path_cd.path[i]); } } - cfg_write (L"; host-specific", f); + cfg_write (_T("; host-specific"), f); target_save_options (f, p); - cfg_write (L"; common", f); + cfg_write (_T("; common"), f); - cfgfile_write_str (f, L"use_gui", guimode1[p->start_gui]); - cfgfile_write_bool (f, L"use_debugger", p->start_debugger); - cfgfile_write_rom (f, &p->path_rom, p->romfile, L"kickstart_rom_file"); - cfgfile_write_rom (f, &p->path_rom, p->romextfile, L"kickstart_ext_rom_file"); + cfgfile_write_str (f, _T("use_gui"), guimode1[p->start_gui]); + cfgfile_write_bool (f, _T("use_debugger"), p->start_debugger); + cfgfile_write_rom (f, &p->path_rom, p->romfile, _T("kickstart_rom_file")); + cfgfile_write_rom (f, &p->path_rom, p->romextfile, _T("kickstart_ext_rom_file")); if (p->romextfile2addr) { - cfgfile_write (f, L"kickstart_ext_rom_file2_address", L"%x", p->romextfile2addr); - cfgfile_write_rom (f, &p->path_rom, p->romextfile2, L"kickstart_ext_rom_file2"); + cfgfile_write (f, _T("kickstart_ext_rom_file2_address"), _T("%x"), p->romextfile2addr); + cfgfile_write_rom (f, &p->path_rom, p->romextfile2, _T("kickstart_ext_rom_file2")); } if (p->romident[0]) - cfgfile_dwrite_str (f, L"kickstart_rom", p->romident); + cfgfile_dwrite_str (f, _T("kickstart_rom"), p->romident); if (p->romextident[0]) - cfgfile_write_str (f, L"kickstart_ext_rom=", p->romextident); - cfgfile_write_path (f, &p->path_rom, L"flash_file", p->flashfile); - cfgfile_write_path (f, &p->path_rom, L"cart_file", p->cartfile); + cfgfile_write_str (f, _T("kickstart_ext_rom="), p->romextident); + cfgfile_write_path (f, &p->path_rom, _T("flash_file"), p->flashfile); + cfgfile_write_path (f, &p->path_rom, _T("cart_file"), p->cartfile); if (p->cartident[0]) - cfgfile_write_str (f, L"cart", p->cartident); + cfgfile_write_str (f, _T("cart"), p->cartident); if (p->amaxromfile[0]) - cfgfile_write_path (f, &p->path_rom, L"amax_rom_file", p->amaxromfile); + cfgfile_write_path (f, &p->path_rom, _T("amax_rom_file"), p->amaxromfile); - cfgfile_write_bool (f, L"kickshifter", p->kickshifter); + cfgfile_write_bool (f, _T("kickshifter"), p->kickshifter); p->nr_floppies = 4; for (i = 0; i < 4; i++) { - _stprintf (tmp, L"floppy%d", i); + _stprintf (tmp, _T("floppy%d"), i); cfgfile_write_path (f, &p->path_floppy, tmp, p->floppyslots[i].df); - _stprintf (tmp, L"floppy%dtype", i); - cfgfile_dwrite (f, tmp, L"%d", p->floppyslots[i].dfxtype); - _stprintf (tmp, L"floppy%dsound", i); - cfgfile_dwrite (f, tmp, L"%d", p->floppyslots[i].dfxclick); + _stprintf (tmp, _T("floppy%dtype"), i); + cfgfile_dwrite (f, tmp, _T("%d"), p->floppyslots[i].dfxtype); + _stprintf (tmp, _T("floppy%dsound"), i); + cfgfile_dwrite (f, tmp, _T("%d"), p->floppyslots[i].dfxclick); if (p->floppyslots[i].dfxclick < 0 && p->floppyslots[i].dfxclickexternal[0]) { - _stprintf (tmp, L"floppy%dsoundext", i); + _stprintf (tmp, _T("floppy%dsoundext"), i); cfgfile_dwrite (f, tmp, p->floppyslots[i].dfxclickexternal); } if (p->floppyslots[i].dfxtype < 0 && p->nr_floppies > i) @@ -660,7 +660,7 @@ void cfgfile_save_options (struct zfile *f, struct uae_prefs *p, int type) } for (i = 0; i < MAX_SPARE_DRIVES; i++) { if (p->dfxlist[i][0]) { - _stprintf (tmp, L"diskimage%d", i); + _stprintf (tmp, _T("diskimage%d"), i); cfgfile_dwrite_path (f, &p->path_floppy, tmp, p->dfxlist[i]); } } @@ -668,15 +668,15 @@ void cfgfile_save_options (struct zfile *f, struct uae_prefs *p, int type) for (i = 0; i < MAX_TOTAL_SCSI_DEVICES; i++) { if (p->cdslots[i].name[0] || p->cdslots[i].inuse) { TCHAR tmp2[MAX_DPATH]; - _stprintf (tmp, L"cdimage%d", i); + _stprintf (tmp, _T("cdimage%d"), i); TCHAR *s = cfgfile_put_multipath (&p->path_cd, p->cdslots[i].name); _tcscpy (tmp2, s); xfree (s); if (p->cdslots[i].type != SCSI_UNIT_DEFAULT || _tcschr (p->cdslots[i].name, ',') || p->cdslots[i].delayed) { - _tcscat (tmp2, L","); + _tcscat (tmp2, _T(",")); if (p->cdslots[i].delayed) { - _tcscat (tmp2, L"delay"); - _tcscat (tmp2, L":"); + _tcscat (tmp2, _T("delay")); + _tcscat (tmp2, _T(":")); } if (p->cdslots[i].type != SCSI_UNIT_DEFAULT) { _tcscat (tmp2, cdmodes[p->cdslots[i].type + 1]); @@ -687,286 +687,286 @@ void cfgfile_save_options (struct zfile *f, struct uae_prefs *p, int type) } if (p->statefile[0]) - cfgfile_write_str (f, L"statefile", p->statefile); + cfgfile_write_str (f, _T("statefile"), p->statefile); if (p->quitstatefile[0]) - cfgfile_write_str (f, L"statefile_quit", p->quitstatefile); - - cfgfile_write (f, L"nr_floppies", L"%d", p->nr_floppies); - cfgfile_dwrite_bool (f, L"floppy_write_protect", p->floppy_read_only); - cfgfile_write (f, L"floppy_speed", L"%d", p->floppy_speed); - cfgfile_write (f, L"floppy_volume", L"%d", p->dfxclickvolume); - cfgfile_dwrite (f, L"floppy_channel_mask", L"0x%x", p->dfxclickchannelmask); - cfgfile_write_bool (f, L"parallel_on_demand", p->parallel_demand); - cfgfile_write_bool (f, L"serial_on_demand", p->serial_demand); - cfgfile_write_bool (f, L"serial_hardware_ctsrts", p->serial_hwctsrts); - cfgfile_write_bool (f, L"serial_direct", p->serial_direct); - cfgfile_dwrite (f, L"serial_stopbits", L"%d", p->serial_stopbits); - cfgfile_write_str (f, L"scsi", scsimode[p->scsi]); - cfgfile_write_bool (f, L"uaeserial", p->uaeserial); - cfgfile_write_bool (f, L"sana2", p->sana2); - - cfgfile_write_str (f, L"sound_output", soundmode1[p->produce_sound]); - cfgfile_write_str (f, L"sound_channels", stereomode[p->sound_stereo]); - cfgfile_write (f, L"sound_stereo_separation", L"%d", p->sound_stereo_separation); - cfgfile_write (f, L"sound_stereo_mixing_delay", L"%d", p->sound_mixed_stereo_delay >= 0 ? p->sound_mixed_stereo_delay : 0); - cfgfile_write (f, L"sound_max_buff", L"%d", p->sound_maxbsiz); - cfgfile_write (f, L"sound_frequency", L"%d", p->sound_freq); - cfgfile_write_str (f, L"sound_interpol", interpolmode[p->sound_interpol]); - cfgfile_write_str (f, L"sound_filter", soundfiltermode1[p->sound_filter]); - cfgfile_write_str (f, L"sound_filter_type", soundfiltermode2[p->sound_filter_type]); - cfgfile_write (f, L"sound_volume", L"%d", p->sound_volume); + cfgfile_write_str (f, _T("statefile_quit"), p->quitstatefile); + + cfgfile_write (f, _T("nr_floppies"), _T("%d"), p->nr_floppies); + cfgfile_dwrite_bool (f, _T("floppy_write_protect"), p->floppy_read_only); + cfgfile_write (f, _T("floppy_speed"), _T("%d"), p->floppy_speed); + cfgfile_write (f, _T("floppy_volume"), _T("%d"), p->dfxclickvolume); + cfgfile_dwrite (f, _T("floppy_channel_mask"), _T("0x%x"), p->dfxclickchannelmask); + cfgfile_write_bool (f, _T("parallel_on_demand"), p->parallel_demand); + cfgfile_write_bool (f, _T("serial_on_demand"), p->serial_demand); + cfgfile_write_bool (f, _T("serial_hardware_ctsrts"), p->serial_hwctsrts); + cfgfile_write_bool (f, _T("serial_direct"), p->serial_direct); + cfgfile_dwrite (f, _T("serial_stopbits"), _T("%d"), p->serial_stopbits); + cfgfile_write_str (f, _T("scsi"), scsimode[p->scsi]); + cfgfile_write_bool (f, _T("uaeserial"), p->uaeserial); + cfgfile_write_bool (f, _T("sana2"), p->sana2); + + cfgfile_write_str (f, _T("sound_output"), soundmode1[p->produce_sound]); + cfgfile_write_str (f, _T("sound_channels"), stereomode[p->sound_stereo]); + cfgfile_write (f, _T("sound_stereo_separation"), _T("%d"), p->sound_stereo_separation); + cfgfile_write (f, _T("sound_stereo_mixing_delay"), _T("%d"), p->sound_mixed_stereo_delay >= 0 ? p->sound_mixed_stereo_delay : 0); + cfgfile_write (f, _T("sound_max_buff"), _T("%d"), p->sound_maxbsiz); + cfgfile_write (f, _T("sound_frequency"), _T("%d"), p->sound_freq); + cfgfile_write_str (f, _T("sound_interpol"), interpolmode[p->sound_interpol]); + cfgfile_write_str (f, _T("sound_filter"), soundfiltermode1[p->sound_filter]); + cfgfile_write_str (f, _T("sound_filter_type"), soundfiltermode2[p->sound_filter_type]); + cfgfile_write (f, _T("sound_volume"), _T("%d"), p->sound_volume); if (p->sound_volume_cd >= 0) - cfgfile_write (f, L"sound_volume_cd", L"%d", p->sound_volume_cd); - cfgfile_write_bool (f, L"sound_auto", p->sound_auto); - cfgfile_write_bool (f, L"sound_stereo_swap_paula", p->sound_stereo_swap_paula); - cfgfile_write_bool (f, L"sound_stereo_swap_ahi", p->sound_stereo_swap_ahi); - - cfgfile_write_str (f, L"comp_trustbyte", compmode[p->comptrustbyte]); - cfgfile_write_str (f, L"comp_trustword", compmode[p->comptrustword]); - cfgfile_write_str (f, L"comp_trustlong", compmode[p->comptrustlong]); - cfgfile_write_str (f, L"comp_trustnaddr", compmode[p->comptrustnaddr]); - cfgfile_write_bool (f, L"comp_nf", p->compnf); - cfgfile_write_bool (f, L"comp_constjump", p->comp_constjump); - cfgfile_write_bool (f, L"comp_oldsegv", p->comp_oldsegv); - - cfgfile_write_str (f, L"comp_flushmode", flushmode[p->comp_hardflush]); - cfgfile_write_bool (f, L"compfpu", p->compfpu); - cfgfile_write_bool (f, L"fpu_strict", p->fpu_strict); - cfgfile_write_bool (f, L"comp_midopt", p->comp_midopt); - cfgfile_write_bool (f, L"comp_lowopt", p->comp_lowopt); - cfgfile_write_bool (f, L"avoid_cmov", p->avoid_cmov); - cfgfile_write (f, L"cachesize", L"%d", p->cachesize); + cfgfile_write (f, _T("sound_volume_cd"), _T("%d"), p->sound_volume_cd); + cfgfile_write_bool (f, _T("sound_auto"), p->sound_auto); + cfgfile_write_bool (f, _T("sound_stereo_swap_paula"), p->sound_stereo_swap_paula); + cfgfile_write_bool (f, _T("sound_stereo_swap_ahi"), p->sound_stereo_swap_ahi); + + cfgfile_write_str (f, _T("comp_trustbyte"), compmode[p->comptrustbyte]); + cfgfile_write_str (f, _T("comp_trustword"), compmode[p->comptrustword]); + cfgfile_write_str (f, _T("comp_trustlong"), compmode[p->comptrustlong]); + cfgfile_write_str (f, _T("comp_trustnaddr"), compmode[p->comptrustnaddr]); + cfgfile_write_bool (f, _T("comp_nf"), p->compnf); + cfgfile_write_bool (f, _T("comp_constjump"), p->comp_constjump); + cfgfile_write_bool (f, _T("comp_oldsegv"), p->comp_oldsegv); + + cfgfile_write_str (f, _T("comp_flushmode"), flushmode[p->comp_hardflush]); + cfgfile_write_bool (f, _T("compfpu"), p->compfpu); + cfgfile_write_bool (f, _T("fpu_strict"), p->fpu_strict); + cfgfile_write_bool (f, _T("comp_midopt"), p->comp_midopt); + cfgfile_write_bool (f, _T("comp_lowopt"), p->comp_lowopt); + cfgfile_write_bool (f, _T("avoid_cmov"), p->avoid_cmov); + cfgfile_write (f, _T("cachesize"), _T("%d"), p->cachesize); for (i = 0; i < MAX_JPORTS; i++) { struct jport *jp = &p->jports[i]; int v = jp->id; TCHAR tmp1[MAX_DPATH], tmp2[MAX_DPATH]; if (v == JPORT_CUSTOM) { - _tcscpy (tmp2, L"custom"); + _tcscpy (tmp2, _T("custom")); } else if (v == JPORT_NONE) { - _tcscpy (tmp2, L"none"); + _tcscpy (tmp2, _T("none")); } else if (v < JSEM_JOYS) { - _stprintf (tmp2, L"kbd%d", v + 1); + _stprintf (tmp2, _T("kbd%d"), v + 1); } else if (v < JSEM_MICE) { - _stprintf (tmp2, L"joy%d", v - JSEM_JOYS); + _stprintf (tmp2, _T("joy%d"), v - JSEM_JOYS); } else { - _tcscpy (tmp2, L"mouse"); + _tcscpy (tmp2, _T("mouse")); if (v - JSEM_MICE > 0) - _stprintf (tmp2, L"mouse%d", v - JSEM_MICE); + _stprintf (tmp2, _T("mouse%d"), v - JSEM_MICE); } if (i < 2 || jp->id >= 0) { - _stprintf (tmp1, L"joyport%d", i); + _stprintf (tmp1, _T("joyport%d"), i); cfgfile_write (f, tmp1, tmp2); - _stprintf (tmp1, L"joyport%dautofire", i); + _stprintf (tmp1, _T("joyport%dautofire"), i); cfgfile_write (f, tmp1, joyaf[jp->autofire]); if (i < 2 && jp->mode > 0) { - _stprintf (tmp1, L"joyport%dmode", i); + _stprintf (tmp1, _T("joyport%dmode"), i); cfgfile_write (f, tmp1, joyportmodes[jp->mode]); } if (jp->name[0]) { - _stprintf (tmp1, L"joyportfriendlyname%d", i); + _stprintf (tmp1, _T("joyportfriendlyname%d"), i); cfgfile_write (f, tmp1, jp->name); } if (jp->configname[0]) { - _stprintf (tmp1, L"joyportname%d", i); + _stprintf (tmp1, _T("joyportname%d"), i); cfgfile_write (f, tmp1, jp->configname); } } } if (p->dongle) { if (p->dongle + 1 >= sizeof (dongles) / sizeof (TCHAR*)) - cfgfile_write (f, L"dongle", L"%d", p->dongle); + cfgfile_write (f, _T("dongle"), _T("%d"), p->dongle); else - cfgfile_write_str (f, L"dongle", dongles[p->dongle]); + cfgfile_write_str (f, _T("dongle"), dongles[p->dongle]); } - cfgfile_write_bool (f, L"bsdsocket_emu", p->socket_emu); + cfgfile_write_bool (f, _T("bsdsocket_emu"), p->socket_emu); if (p->a2065name[0]) - cfgfile_write_str (f, L"a2065", p->a2065name); - - cfgfile_write_bool (f, L"synchronize_clock", p->tod_hack); - cfgfile_write (f, L"maprom", L"0x%x", p->maprom); - cfgfile_dwrite_str (f, L"parallel_matrix_emulation", epsonprinter[p->parallel_matrix_emulation]); - cfgfile_write_bool (f, L"parallel_postscript_emulation", p->parallel_postscript_emulation); - cfgfile_write_bool (f, L"parallel_postscript_detection", p->parallel_postscript_detection); - cfgfile_write_str (f, L"ghostscript_parameters", p->ghostscript_parameters); - cfgfile_write (f, L"parallel_autoflush", L"%d", p->parallel_autoflush_time); - cfgfile_dwrite (f, L"uae_hide", L"%d", p->uae_hide); - cfgfile_dwrite_bool (f, L"magic_mouse", p->input_magic_mouse); - cfgfile_dwrite_str (f, L"magic_mousecursor", magiccursors[p->input_magic_mouse_cursor]); - cfgfile_dwrite_str (f, L"absolute_mouse", abspointers[p->input_tablet]); - cfgfile_dwrite_bool (f, L"clipboard_sharing", p->clipboard_sharing); - cfgfile_dwrite_bool (f, L"native_code", p->native_code); - - cfgfile_write (f, L"gfx_display", L"%d", p->gfx_display); - cfgfile_dwrite_str (f, L"gfx_display_name", p->gfx_display_name); - cfgfile_write (f, L"gfx_framerate", L"%d", p->gfx_framerate); - cfgfile_write (f, L"gfx_width", L"%d", p->gfx_size_win.width); /* compatibility with old versions */ - cfgfile_write (f, L"gfx_height", L"%d", p->gfx_size_win.height); /* compatibility with old versions */ - cfgfile_write (f, L"gfx_top_windowed", L"%d", p->gfx_size_win.x); - cfgfile_write (f, L"gfx_left_windowed", L"%d", p->gfx_size_win.y); - cfgfile_write (f, L"gfx_width_windowed", L"%d", p->gfx_size_win.width); - cfgfile_write (f, L"gfx_height_windowed", L"%d", p->gfx_size_win.height); - cfgfile_write (f, L"gfx_width_fullscreen", L"%d", p->gfx_size_fs.width); - cfgfile_write (f, L"gfx_height_fullscreen", L"%d", p->gfx_size_fs.height); - cfgfile_write (f, L"gfx_refreshrate", L"%d", p->gfx_apmode[0].gfx_refreshrate); - cfgfile_dwrite (f, L"gfx_refreshrate_rtg", L"%d", p->gfx_apmode[1].gfx_refreshrate); - cfgfile_write_bool (f, L"gfx_autoresolution", p->gfx_autoresolution); - cfgfile_dwrite (f, L"gfx_autoresolution_min_vertical", vertmode[p->gfx_autoresolution_minv + 1]); - cfgfile_dwrite (f, L"gfx_autoresolution_min_horizontal", horizmode[p->gfx_autoresolution_minh + 1]); - - cfgfile_write (f, L"gfx_backbuffers", L"%d", p->gfx_apmode[0].gfx_backbuffers); - cfgfile_write (f, L"gfx_backbuffers_rtg", L"%d", p->gfx_apmode[1].gfx_backbuffers); + cfgfile_write_str (f, _T("a2065"), p->a2065name); + + cfgfile_write_bool (f, _T("synchronize_clock"), p->tod_hack); + cfgfile_write (f, _T("maprom"), _T("0x%x"), p->maprom); + cfgfile_dwrite_str (f, _T("parallel_matrix_emulation"), epsonprinter[p->parallel_matrix_emulation]); + cfgfile_write_bool (f, _T("parallel_postscript_emulation"), p->parallel_postscript_emulation); + cfgfile_write_bool (f, _T("parallel_postscript_detection"), p->parallel_postscript_detection); + cfgfile_write_str (f, _T("ghostscript_parameters"), p->ghostscript_parameters); + cfgfile_write (f, _T("parallel_autoflush"), _T("%d"), p->parallel_autoflush_time); + cfgfile_dwrite (f, _T("uae_hide"), _T("%d"), p->uae_hide); + cfgfile_dwrite_bool (f, _T("magic_mouse"), p->input_magic_mouse); + cfgfile_dwrite_str (f, _T("magic_mousecursor"), magiccursors[p->input_magic_mouse_cursor]); + cfgfile_dwrite_str (f, _T("absolute_mouse"), abspointers[p->input_tablet]); + cfgfile_dwrite_bool (f, _T("clipboard_sharing"), p->clipboard_sharing); + cfgfile_dwrite_bool (f, _T("native_code"), p->native_code); + + cfgfile_write (f, _T("gfx_display"), _T("%d"), p->gfx_display); + cfgfile_dwrite_str (f, _T("gfx_display_name"), p->gfx_display_name); + cfgfile_write (f, _T("gfx_framerate"), _T("%d"), p->gfx_framerate); + cfgfile_write (f, _T("gfx_width"), _T("%d"), p->gfx_size_win.width); /* compatibility with old versions */ + cfgfile_write (f, _T("gfx_height"), _T("%d"), p->gfx_size_win.height); /* compatibility with old versions */ + cfgfile_write (f, _T("gfx_top_windowed"), _T("%d"), p->gfx_size_win.x); + cfgfile_write (f, _T("gfx_left_windowed"), _T("%d"), p->gfx_size_win.y); + cfgfile_write (f, _T("gfx_width_windowed"), _T("%d"), p->gfx_size_win.width); + cfgfile_write (f, _T("gfx_height_windowed"), _T("%d"), p->gfx_size_win.height); + cfgfile_write (f, _T("gfx_width_fullscreen"), _T("%d"), p->gfx_size_fs.width); + cfgfile_write (f, _T("gfx_height_fullscreen"), _T("%d"), p->gfx_size_fs.height); + cfgfile_write (f, _T("gfx_refreshrate"), _T("%d"), p->gfx_apmode[0].gfx_refreshrate); + cfgfile_dwrite (f, _T("gfx_refreshrate_rtg"), _T("%d"), p->gfx_apmode[1].gfx_refreshrate); + cfgfile_write_bool (f, _T("gfx_autoresolution"), p->gfx_autoresolution); + cfgfile_dwrite (f, _T("gfx_autoresolution_min_vertical"), vertmode[p->gfx_autoresolution_minv + 1]); + cfgfile_dwrite (f, _T("gfx_autoresolution_min_horizontal"), horizmode[p->gfx_autoresolution_minh + 1]); + + cfgfile_write (f, _T("gfx_backbuffers"), _T("%d"), p->gfx_apmode[0].gfx_backbuffers); + cfgfile_write (f, _T("gfx_backbuffers_rtg"), _T("%d"), p->gfx_apmode[1].gfx_backbuffers); if (p->gfx_apmode[0].gfx_interlaced) - cfgfile_write_bool (f, L"gfx_interlace", p->gfx_apmode[0].gfx_interlaced); - cfgfile_write_str (f, L"gfx_vsync", vsyncmodes[p->gfx_apmode[0].gfx_vsync]); - cfgfile_write_str (f, L"gfx_vsyncmode", vsyncmodes2[p->gfx_apmode[0].gfx_vsyncmode]); - cfgfile_write_str (f, L"gfx_vsync_picasso", vsyncmodes[p->gfx_apmode[1].gfx_vsync]); - cfgfile_write_str (f, L"gfx_vsyncmode_picasso", vsyncmodes2[p->gfx_apmode[1].gfx_vsyncmode]); - cfgfile_write_bool (f, L"gfx_lores", p->gfx_resolution == 0); - cfgfile_write_str (f, L"gfx_resolution", lorestype1[p->gfx_resolution]); - cfgfile_write_str (f, L"gfx_lores_mode", loresmode[p->gfx_lores_mode]); - cfgfile_write_bool (f, L"gfx_flickerfixer", p->gfx_scandoubler); - cfgfile_write_str (f, L"gfx_linemode", linemode[p->gfx_vresolution * 2 + p->gfx_scanlines]); - cfgfile_write_str (f, L"gfx_fullscreen_amiga", fullmodes[p->gfx_apmode[0].gfx_fullscreen]); - cfgfile_write_str (f, L"gfx_fullscreen_picasso", fullmodes[p->gfx_apmode[1].gfx_fullscreen]); - cfgfile_write_str (f, L"gfx_center_horizontal", centermode1[p->gfx_xcenter]); - cfgfile_write_str (f, L"gfx_center_vertical", centermode1[p->gfx_ycenter]); - cfgfile_write_str (f, L"gfx_colour_mode", colormode1[p->color_mode]); - cfgfile_write_bool (f, L"gfx_blacker_than_black", p->gfx_blackerthanblack); - cfgfile_write_str (f, L"gfx_api", filterapi[p->gfx_api]); + cfgfile_write_bool (f, _T("gfx_interlace"), p->gfx_apmode[0].gfx_interlaced); + cfgfile_write_str (f, _T("gfx_vsync"), vsyncmodes[p->gfx_apmode[0].gfx_vsync]); + cfgfile_write_str (f, _T("gfx_vsyncmode"), vsyncmodes2[p->gfx_apmode[0].gfx_vsyncmode]); + cfgfile_write_str (f, _T("gfx_vsync_picasso"), vsyncmodes[p->gfx_apmode[1].gfx_vsync]); + cfgfile_write_str (f, _T("gfx_vsyncmode_picasso"), vsyncmodes2[p->gfx_apmode[1].gfx_vsyncmode]); + cfgfile_write_bool (f, _T("gfx_lores"), p->gfx_resolution == 0); + cfgfile_write_str (f, _T("gfx_resolution"), lorestype1[p->gfx_resolution]); + cfgfile_write_str (f, _T("gfx_lores_mode"), loresmode[p->gfx_lores_mode]); + cfgfile_write_bool (f, _T("gfx_flickerfixer"), p->gfx_scandoubler); + cfgfile_write_str (f, _T("gfx_linemode"), linemode[p->gfx_vresolution * 2 + p->gfx_scanlines]); + cfgfile_write_str (f, _T("gfx_fullscreen_amiga"), fullmodes[p->gfx_apmode[0].gfx_fullscreen]); + cfgfile_write_str (f, _T("gfx_fullscreen_picasso"), fullmodes[p->gfx_apmode[1].gfx_fullscreen]); + cfgfile_write_str (f, _T("gfx_center_horizontal"), centermode1[p->gfx_xcenter]); + cfgfile_write_str (f, _T("gfx_center_vertical"), centermode1[p->gfx_ycenter]); + cfgfile_write_str (f, _T("gfx_colour_mode"), colormode1[p->color_mode]); + cfgfile_write_bool (f, _T("gfx_blacker_than_black"), p->gfx_blackerthanblack); + cfgfile_write_str (f, _T("gfx_api"), filterapi[p->gfx_api]); #ifdef GFXFILTER if (p->gfx_filtershader[0] && p->gfx_api) { - cfgfile_dwrite (f, L"gfx_filter", L"D3D:%s", p->gfx_filtershader); + cfgfile_dwrite (f, _T("gfx_filter"), _T("D3D:%s"), p->gfx_filtershader); } else if (p->gfx_filter > 0) { int i = 0; struct uae_filter *uf; while (uaefilters[i].name) { uf = &uaefilters[i]; if (uf->type == p->gfx_filter) { - cfgfile_dwrite_str (f, L"gfx_filter", uf->cfgname); + cfgfile_dwrite_str (f, _T("gfx_filter"), uf->cfgname); } i++; } } else { - cfgfile_dwrite (f, L"gfx_filter", L"no"); - } - cfgfile_dwrite_str (f, L"gfx_filter_mode", filtermode2[p->gfx_filter_filtermode]); - cfgfile_dwrite (f, L"gfx_filter_vert_zoom", L"%d", p->gfx_filter_vert_zoom); - cfgfile_dwrite (f, L"gfx_filter_horiz_zoom", L"%d", p->gfx_filter_horiz_zoom); - cfgfile_dwrite (f, L"gfx_filter_vert_zoom_mult", L"%d", p->gfx_filter_vert_zoom_mult); - cfgfile_dwrite (f, L"gfx_filter_horiz_zoom_mult", L"%d", p->gfx_filter_horiz_zoom_mult); - cfgfile_dwrite (f, L"gfx_filter_vert_offset", L"%d", p->gfx_filter_vert_offset); - cfgfile_dwrite (f, L"gfx_filter_horiz_offset", L"%d", p->gfx_filter_horiz_offset); - cfgfile_dwrite (f, L"gfx_filter_scanlines", L"%d", p->gfx_filter_scanlines); - cfgfile_dwrite (f, L"gfx_filter_scanlinelevel", L"%d", p->gfx_filter_scanlinelevel); - cfgfile_dwrite (f, L"gfx_filter_scanlineratio", L"%d", p->gfx_filter_scanlineratio); - cfgfile_dwrite (f, L"gfx_filter_luminance", L"%d", p->gfx_filter_luminance); - cfgfile_dwrite (f, L"gfx_filter_contrast", L"%d", p->gfx_filter_contrast); - cfgfile_dwrite (f, L"gfx_filter_saturation", L"%d", p->gfx_filter_saturation); - cfgfile_dwrite (f, L"gfx_filter_gamma", L"%d", p->gfx_filter_gamma); - cfgfile_dwrite (f, L"gfx_filter_blur", L"%d", p->gfx_filter_blur); - cfgfile_dwrite (f, L"gfx_filter_noise", L"%d", p->gfx_filter_noise); - cfgfile_dwrite_bool (f, L"gfx_filter_bilinear", p->gfx_filter_bilinear != 0); - cfgfile_dwrite_str (f, L"gfx_filter_keep_aspect", aspects[p->gfx_filter_keep_aspect]); - cfgfile_dwrite_str (f, L"gfx_filter_autoscale", autoscale[p->gfx_filter_autoscale]); - cfgfile_dwrite (f, L"gfx_filter_aspect_ratio", L"%d:%d", + cfgfile_dwrite (f, _T("gfx_filter"), _T("no")); + } + cfgfile_dwrite_str (f, _T("gfx_filter_mode"), filtermode2[p->gfx_filter_filtermode]); + cfgfile_dwrite (f, _T("gfx_filter_vert_zoom"), _T("%d"), p->gfx_filter_vert_zoom); + cfgfile_dwrite (f, _T("gfx_filter_horiz_zoom"), _T("%d"), p->gfx_filter_horiz_zoom); + cfgfile_dwrite (f, _T("gfx_filter_vert_zoom_mult"), _T("%d"), p->gfx_filter_vert_zoom_mult); + cfgfile_dwrite (f, _T("gfx_filter_horiz_zoom_mult"), _T("%d"), p->gfx_filter_horiz_zoom_mult); + cfgfile_dwrite (f, _T("gfx_filter_vert_offset"), _T("%d"), p->gfx_filter_vert_offset); + cfgfile_dwrite (f, _T("gfx_filter_horiz_offset"), _T("%d"), p->gfx_filter_horiz_offset); + cfgfile_dwrite (f, _T("gfx_filter_scanlines"), _T("%d"), p->gfx_filter_scanlines); + cfgfile_dwrite (f, _T("gfx_filter_scanlinelevel"), _T("%d"), p->gfx_filter_scanlinelevel); + cfgfile_dwrite (f, _T("gfx_filter_scanlineratio"), _T("%d"), p->gfx_filter_scanlineratio); + cfgfile_dwrite (f, _T("gfx_filter_luminance"), _T("%d"), p->gfx_filter_luminance); + cfgfile_dwrite (f, _T("gfx_filter_contrast"), _T("%d"), p->gfx_filter_contrast); + cfgfile_dwrite (f, _T("gfx_filter_saturation"), _T("%d"), p->gfx_filter_saturation); + cfgfile_dwrite (f, _T("gfx_filter_gamma"), _T("%d"), p->gfx_filter_gamma); + cfgfile_dwrite (f, _T("gfx_filter_blur"), _T("%d"), p->gfx_filter_blur); + cfgfile_dwrite (f, _T("gfx_filter_noise"), _T("%d"), p->gfx_filter_noise); + cfgfile_dwrite_bool (f, _T("gfx_filter_bilinear"), p->gfx_filter_bilinear != 0); + cfgfile_dwrite_str (f, _T("gfx_filter_keep_aspect"), aspects[p->gfx_filter_keep_aspect]); + cfgfile_dwrite_str (f, _T("gfx_filter_autoscale"), autoscale[p->gfx_filter_autoscale]); + cfgfile_dwrite (f, _T("gfx_filter_aspect_ratio"), _T("%d:%d"), p->gfx_filter_aspect >= 0 ? (p->gfx_filter_aspect >> 8) : -1, p->gfx_filter_aspect >= 0 ? (p->gfx_filter_aspect & 0xff) : -1); - cfgfile_dwrite (f, L"gfx_luminance", L"%d", p->gfx_luminance); - cfgfile_dwrite (f, L"gfx_contrast", L"%d", p->gfx_contrast); - cfgfile_dwrite (f, L"gfx_gamma", L"%d", p->gfx_gamma); - cfgfile_dwrite_str (f, L"gfx_filter_mask", p->gfx_filtermask); + cfgfile_dwrite (f, _T("gfx_luminance"), _T("%d"), p->gfx_luminance); + cfgfile_dwrite (f, _T("gfx_contrast"), _T("%d"), p->gfx_contrast); + cfgfile_dwrite (f, _T("gfx_gamma"), _T("%d"), p->gfx_gamma); + cfgfile_dwrite_str (f, _T("gfx_filter_mask"), p->gfx_filtermask); if (p->gfx_filteroverlay[0]) { - cfgfile_dwrite (f, L"gfx_filter_overlay", L"%s%s", - p->gfx_filteroverlay, _tcschr (p->gfx_filteroverlay, ',') ? L"," : L""); + cfgfile_dwrite (f, _T("gfx_filter_overlay"), _T("%s%s"), + p->gfx_filteroverlay, _tcschr (p->gfx_filteroverlay, ',') ? _T(",") : _T("")); #if 0 - cfgfile_dwrite (f, L"gfx_filter_overlay", L"%s,%d%s:%d%s:%d%s:%d%s:%d%%", + cfgfile_dwrite (f, _T("gfx_filter_overlay"), _T("%s,%d%s:%d%s:%d%s:%d%s:%d%%"), p->gfx_filteroverlay, p->gfx_filteroverlay_pos.x >= -24000 ? p->gfx_filteroverlay_pos.x : -p->gfx_filteroverlay_pos.x - 30000, - p->gfx_filteroverlay_pos.x >= -24000 ? L"" : L"%", + p->gfx_filteroverlay_pos.x >= -24000 ? _T("") : _T("%"), p->gfx_filteroverlay_pos.y >= -24000 ? p->gfx_filteroverlay_pos.y : -p->gfx_filteroverlay_pos.y - 30000, - p->gfx_filteroverlay_pos.y >= -24000 ? L"" : L"%", + p->gfx_filteroverlay_pos.y >= -24000 ? _T("") : _T("%"), p->gfx_filteroverlay_pos.width >= -24000 ? p->gfx_filteroverlay_pos.width : -p->gfx_filteroverlay_pos.width - 30000, - p->gfx_filteroverlay_pos.width >= -24000 ? L"" : L"%", + p->gfx_filteroverlay_pos.width >= -24000 ? _T("") : _T("%"), p->gfx_filteroverlay_pos.height >= -24000 ? p->gfx_filteroverlay_pos.height : -p->gfx_filteroverlay_pos.height - 30000, - p->gfx_filteroverlay_pos.height >= -24000 ? L"" : L"%", + p->gfx_filteroverlay_pos.height >= -24000 ? _T("") : _T("%"), p->gfx_filteroverlay_overscan ); #endif } - cfgfile_dwrite (f, L"gfx_center_horizontal_position", L"%d", p->gfx_xcenter_pos); - cfgfile_dwrite (f, L"gfx_center_vertical_position", L"%d", p->gfx_ycenter_pos); - cfgfile_dwrite (f, L"gfx_center_horizontal_size", L"%d", p->gfx_xcenter_size); - cfgfile_dwrite (f, L"gfx_center_vertical_size", L"%d", p->gfx_ycenter_size); + cfgfile_dwrite (f, _T("gfx_center_horizontal_position"), _T("%d"), p->gfx_xcenter_pos); + cfgfile_dwrite (f, _T("gfx_center_vertical_position"), _T("%d"), p->gfx_ycenter_pos); + cfgfile_dwrite (f, _T("gfx_center_horizontal_size"), _T("%d"), p->gfx_xcenter_size); + cfgfile_dwrite (f, _T("gfx_center_vertical_size"), _T("%d"), p->gfx_ycenter_size); #endif - cfgfile_write_bool (f, L"immediate_blits", p->immediate_blits); - cfgfile_write_bool (f, L"waiting_blits", p->waiting_blits); - cfgfile_write_bool (f, L"ntsc", p->ntscmode); - cfgfile_write_bool (f, L"genlock", p->genlock); - cfgfile_dwrite_str (f, L"monitoremu", specialmonitors[p->monitoremu]); - cfgfile_dwrite_bool (f, L"show_leds", !!(p->leds_on_screen & STATUSLINE_CHIPSET)); + cfgfile_write_bool (f, _T("immediate_blits"), p->immediate_blits); + cfgfile_write_bool (f, _T("waiting_blits"), p->waiting_blits); + cfgfile_write_bool (f, _T("ntsc"), p->ntscmode); + cfgfile_write_bool (f, _T("genlock"), p->genlock); + cfgfile_dwrite_str (f, _T("monitoremu"), specialmonitors[p->monitoremu]); + cfgfile_dwrite_bool (f, _T("show_leds"), !!(p->leds_on_screen & STATUSLINE_CHIPSET)); if (p->osd_pos.y || p->osd_pos.x) { - cfgfile_dwrite (f, L"osd_position", L"%.1f%s:%.1f%s", - p->osd_pos.x >= 20000 ? (p->osd_pos.x - 30000) / 10.0 : (float)p->osd_pos.x, p->osd_pos.x >= 20000 ? L"%" : L"", - p->osd_pos.y >= 20000 ? (p->osd_pos.y - 30000) / 10.0 : (float)p->osd_pos.y, p->osd_pos.y >= 20000 ? L"%" : L""); + cfgfile_dwrite (f, _T("osd_position"), _T("%.1f%s:%.1f%s"), + p->osd_pos.x >= 20000 ? (p->osd_pos.x - 30000) / 10.0 : (float)p->osd_pos.x, p->osd_pos.x >= 20000 ? _T("%") : _T(""), + p->osd_pos.y >= 20000 ? (p->osd_pos.y - 30000) / 10.0 : (float)p->osd_pos.y, p->osd_pos.y >= 20000 ? _T("%") : _T("")); } - cfgfile_dwrite_bool (f, L"show_leds_rtg", !!(p->leds_on_screen & STATUSLINE_RTG)); - cfgfile_dwrite (f, L"keyboard_leds", L"numlock:%s,capslock:%s,scrolllock:%s", + cfgfile_dwrite_bool (f, _T("show_leds_rtg"), !!(p->leds_on_screen & STATUSLINE_RTG)); + cfgfile_dwrite (f, _T("keyboard_leds"), _T("numlock:%s,capslock:%s,scrolllock:%s"), kbleds[p->keyboard_leds[0]], kbleds[p->keyboard_leds[1]], kbleds[p->keyboard_leds[2]]); if (p->chipset_mask & CSMASK_AGA) - cfgfile_dwrite (f, L"chipset",L"aga"); + cfgfile_dwrite (f, _T("chipset"),_T("aga")); else if ((p->chipset_mask & CSMASK_ECS_AGNUS) && (p->chipset_mask & CSMASK_ECS_DENISE)) - cfgfile_dwrite (f, L"chipset",L"ecs"); + cfgfile_dwrite (f, _T("chipset"),_T("ecs")); else if (p->chipset_mask & CSMASK_ECS_AGNUS) - cfgfile_dwrite (f, L"chipset",L"ecs_agnus"); + cfgfile_dwrite (f, _T("chipset"),_T("ecs_agnus")); else if (p->chipset_mask & CSMASK_ECS_DENISE) - cfgfile_dwrite (f, L"chipset",L"ecs_denise"); + cfgfile_dwrite (f, _T("chipset"),_T("ecs_denise")); else - cfgfile_dwrite (f, L"chipset", L"ocs"); + cfgfile_dwrite (f, _T("chipset"), _T("ocs")); if (p->chipset_refreshrate > 0) - cfgfile_write (f, L"chipset_refreshrate", L"%f", p->chipset_refreshrate); + cfgfile_write (f, _T("chipset_refreshrate"), _T("%f"), p->chipset_refreshrate); for (int i = 0; i < MAX_CHIPSET_REFRESH_TOTAL; i++) { if (p->cr[i].rate <= 0) continue; struct chipset_refresh *cr = &p->cr[i]; cr->index = i; - _stprintf (tmp, L"%f", cr->rate); + _stprintf (tmp, _T("%f"), cr->rate); TCHAR *s = tmp + _tcslen (tmp); if (cr->label[0] > 0 && i < MAX_CHIPSET_REFRESH) - s += _stprintf (s, L",t=%s", cr->label); + s += _stprintf (s, _T(",t=%s"), cr->label); if (cr->horiz > 0) - s += _stprintf (s, L",h=%d", cr->horiz); + s += _stprintf (s, _T(",h=%d"), cr->horiz); if (cr->vert > 0) - s += _stprintf (s, L",v=%d", cr->vert); + s += _stprintf (s, _T(",v=%d"), cr->vert); if (cr->locked) - _tcscat (s, L",locked"); + _tcscat (s, _T(",locked")); if (cr->ntsc > 0) - _tcscat (s, L",ntsc"); + _tcscat (s, _T(",ntsc")); else if (cr->ntsc == 0) - _tcscat (s, L",pal"); + _tcscat (s, _T(",pal")); if (cr->lace > 0) - _tcscat (s, L",lace"); + _tcscat (s, _T(",lace")); else if (cr->lace == 0) - _tcscat (s, L",nlace"); + _tcscat (s, _T(",nlace")); if (cr->framelength > 0) - _tcscat (s, L",lof"); + _tcscat (s, _T(",lof")); else if (cr->framelength == 0) - _tcscat (s, L",shf"); + _tcscat (s, _T(",shf")); if (cr->vsync > 0) - _tcscat (s, L",vsync"); + _tcscat (s, _T(",vsync")); else if (cr->vsync == 0) - _tcscat (s, L",nvsync"); + _tcscat (s, _T(",nvsync")); if (cr->rtg) - _tcscat (s, L",rtg"); + _tcscat (s, _T(",rtg")); if (cr->commands[0]) { - _tcscat (s, L","); + _tcscat (s, _T(",")); _tcscat (s, cr->commands); for (int j = 0; j < _tcslen (s); j++) { if (s[j] == '\n') @@ -975,112 +975,112 @@ void cfgfile_save_options (struct zfile *f, struct uae_prefs *p, int type) s[_tcslen (s) - 1] = 0; } if (i == CHIPSET_REFRESH_PAL) - cfgfile_dwrite (f, L"displaydata_pal", tmp); + cfgfile_dwrite (f, _T("displaydata_pal"), tmp); else if (i == CHIPSET_REFRESH_NTSC) - cfgfile_dwrite (f, L"displaydata_ntsc", tmp); + cfgfile_dwrite (f, _T("displaydata_ntsc"), tmp); else - cfgfile_dwrite (f, L"displaydata", tmp); - } - - cfgfile_write_str (f, L"collision_level", collmode[p->collision_level]); - - cfgfile_write_str(f, L"chipset_compatible", cscompa[p->cs_compatible]); - cfgfile_dwrite_str (f, L"ciaatod", ciaatodmode[p->cs_ciaatod]); - cfgfile_dwrite_str (f, L"rtc", rtctype[p->cs_rtc]); - //cfgfile_dwrite (f, L"chipset_rtc_adjust", L"%d", p->cs_rtc_adjust); - cfgfile_dwrite_bool (f, L"ksmirror_e0", p->cs_ksmirror_e0); - cfgfile_dwrite_bool (f, L"ksmirror_a8", p->cs_ksmirror_a8); - cfgfile_dwrite_bool (f, L"cd32cd", p->cs_cd32cd); - cfgfile_dwrite_bool (f, L"cd32c2p", p->cs_cd32c2p); - cfgfile_dwrite_bool (f, L"cd32nvram", p->cs_cd32nvram); - cfgfile_dwrite_bool (f, L"cdtvcd", p->cs_cdtvcd); - cfgfile_dwrite_bool (f, L"cdtvram", p->cs_cdtvram); - cfgfile_dwrite (f, L"cdtvramcard", L"%d", p->cs_cdtvcard); - cfgfile_dwrite_str (f, L"ide", p->cs_ide == IDE_A600A1200 ? L"a600/a1200" : (p->cs_ide == IDE_A4000 ? L"a4000" : L"none")); - cfgfile_dwrite_bool (f, L"a1000ram", p->cs_a1000ram); - cfgfile_dwrite (f, L"fatgary", L"%d", p->cs_fatgaryrev); - cfgfile_dwrite (f, L"ramsey", L"%d", p->cs_ramseyrev); - cfgfile_dwrite_bool (f, L"pcmcia", p->cs_pcmcia); - cfgfile_dwrite_bool (f, L"scsi_cdtv", p->cs_cdtvscsi); - cfgfile_dwrite_bool (f, L"scsi_a2091", p->cs_a2091); - cfgfile_dwrite_bool (f, L"scsi_a4091", p->cs_a4091); - cfgfile_dwrite_bool (f, L"scsi_a3000", p->cs_mbdmac == 1); - cfgfile_dwrite_bool (f, L"scsi_a4000t", p->cs_mbdmac == 2); - cfgfile_dwrite_bool (f, L"bogomem_fast", p->cs_slowmemisfast); - cfgfile_dwrite_bool (f, L"resetwarning", p->cs_resetwarning); - cfgfile_dwrite_bool (f, L"denise_noehb", p->cs_denisenoehb); - cfgfile_dwrite_bool (f, L"agnus_bltbusybug", p->cs_agnusbltbusybug); - cfgfile_dwrite_bool (f, L"ics_agnus", p->cs_dipagnus); - - cfgfile_dwrite_bool (f, L"fastmem_autoconfig", p->fastmem_autoconfig); - cfgfile_write (f, L"fastmem_size", L"%d", p->fastmem_size / 0x100000); - cfgfile_dwrite (f, L"fastmem2_size", L"%d", p->fastmem2_size / 0x100000); - cfgfile_write (f, L"a3000mem_size", L"%d", p->mbresmem_low_size / 0x100000); - cfgfile_write (f, L"mbresmem_size", L"%d", p->mbresmem_high_size / 0x100000); - cfgfile_write (f, L"z3mem_size", L"%d", p->z3fastmem_size / 0x100000); - cfgfile_dwrite (f, L"z3mem2_size", L"%d", p->z3fastmem2_size / 0x100000); - cfgfile_write (f, L"z3mem_start", L"0x%x", p->z3fastmem_start); - cfgfile_write (f, L"bogomem_size", L"%d", p->bogomem_size / 0x40000); - cfgfile_write (f, L"gfxcard_size", L"%d", p->rtgmem_size / 0x100000); - cfgfile_write_str (f, L"gfxcard_type", rtgtype[p->rtgmem_type]); - cfgfile_write (f, L"chipmem_size", L"%d", p->chipmem_size == 0x20000 ? -1 : (p->chipmem_size == 0x40000 ? 0 : p->chipmem_size / 0x80000)); - cfgfile_dwrite (f, L"megachipmem_size", L"%d", p->z3chipmem_size / 0x100000); + cfgfile_dwrite (f, _T("displaydata"), tmp); + } + + cfgfile_write_str (f, _T("collision_level"), collmode[p->collision_level]); + + cfgfile_write_str(f, _T("chipset_compatible"), cscompa[p->cs_compatible]); + cfgfile_dwrite_str (f, _T("ciaatod"), ciaatodmode[p->cs_ciaatod]); + cfgfile_dwrite_str (f, _T("rtc"), rtctype[p->cs_rtc]); + //cfgfile_dwrite (f, _T("chipset_rtc_adjust"), _T("%d"), p->cs_rtc_adjust); + cfgfile_dwrite_bool (f, _T("ksmirror_e0"), p->cs_ksmirror_e0); + cfgfile_dwrite_bool (f, _T("ksmirror_a8"), p->cs_ksmirror_a8); + cfgfile_dwrite_bool (f, _T("cd32cd"), p->cs_cd32cd); + cfgfile_dwrite_bool (f, _T("cd32c2p"), p->cs_cd32c2p); + cfgfile_dwrite_bool (f, _T("cd32nvram"), p->cs_cd32nvram); + cfgfile_dwrite_bool (f, _T("cdtvcd"), p->cs_cdtvcd); + cfgfile_dwrite_bool (f, _T("cdtvram"), p->cs_cdtvram); + cfgfile_dwrite (f, _T("cdtvramcard"), _T("%d"), p->cs_cdtvcard); + cfgfile_dwrite_str (f, _T("ide"), p->cs_ide == IDE_A600A1200 ? _T("a600/a1200") : (p->cs_ide == IDE_A4000 ? _T("a4000") : _T("none"))); + cfgfile_dwrite_bool (f, _T("a1000ram"), p->cs_a1000ram); + cfgfile_dwrite (f, _T("fatgary"), _T("%d"), p->cs_fatgaryrev); + cfgfile_dwrite (f, _T("ramsey"), _T("%d"), p->cs_ramseyrev); + cfgfile_dwrite_bool (f, _T("pcmcia"), p->cs_pcmcia); + cfgfile_dwrite_bool (f, _T("scsi_cdtv"), p->cs_cdtvscsi); + cfgfile_dwrite_bool (f, _T("scsi_a2091"), p->cs_a2091); + cfgfile_dwrite_bool (f, _T("scsi_a4091"), p->cs_a4091); + cfgfile_dwrite_bool (f, _T("scsi_a3000"), p->cs_mbdmac == 1); + cfgfile_dwrite_bool (f, _T("scsi_a4000t"), p->cs_mbdmac == 2); + cfgfile_dwrite_bool (f, _T("bogomem_fast"), p->cs_slowmemisfast); + cfgfile_dwrite_bool (f, _T("resetwarning"), p->cs_resetwarning); + cfgfile_dwrite_bool (f, _T("denise_noehb"), p->cs_denisenoehb); + cfgfile_dwrite_bool (f, _T("agnus_bltbusybug"), p->cs_agnusbltbusybug); + cfgfile_dwrite_bool (f, _T("ics_agnus"), p->cs_dipagnus); + + cfgfile_dwrite_bool (f, _T("fastmem_autoconfig"), p->fastmem_autoconfig); + cfgfile_write (f, _T("fastmem_size"), _T("%d"), p->fastmem_size / 0x100000); + cfgfile_dwrite (f, _T("fastmem2_size"), _T("%d"), p->fastmem2_size / 0x100000); + cfgfile_write (f, _T("a3000mem_size"), _T("%d"), p->mbresmem_low_size / 0x100000); + cfgfile_write (f, _T("mbresmem_size"), _T("%d"), p->mbresmem_high_size / 0x100000); + cfgfile_write (f, _T("z3mem_size"), _T("%d"), p->z3fastmem_size / 0x100000); + cfgfile_dwrite (f, _T("z3mem2_size"), _T("%d"), p->z3fastmem2_size / 0x100000); + cfgfile_write (f, _T("z3mem_start"), _T("0x%x"), p->z3fastmem_start); + cfgfile_write (f, _T("bogomem_size"), _T("%d"), p->bogomem_size / 0x40000); + cfgfile_write (f, _T("gfxcard_size"), _T("%d"), p->rtgmem_size / 0x100000); + cfgfile_write_str (f, _T("gfxcard_type"), rtgtype[p->rtgmem_type]); + cfgfile_write (f, _T("chipmem_size"), _T("%d"), p->chipmem_size == 0x20000 ? -1 : (p->chipmem_size == 0x40000 ? 0 : p->chipmem_size / 0x80000)); + cfgfile_dwrite (f, _T("megachipmem_size"), _T("%d"), p->z3chipmem_size / 0x100000); if (p->m68k_speed > 0) - cfgfile_write (f, L"finegrain_cpu_speed", L"%d", p->m68k_speed); + cfgfile_write (f, _T("finegrain_cpu_speed"), _T("%d"), p->m68k_speed); else - cfgfile_write_str (f, L"cpu_speed", p->m68k_speed < 0 ? L"max" : L"real"); + cfgfile_write_str (f, _T("cpu_speed"), p->m68k_speed < 0 ? _T("max") : _T("real")); /* do not reorder start */ write_compatibility_cpu(f, p); - cfgfile_write (f, L"cpu_model", L"%d", p->cpu_model); + cfgfile_write (f, _T("cpu_model"), _T("%d"), p->cpu_model); if (p->fpu_model) - cfgfile_write (f, L"fpu_model", L"%d", p->fpu_model); + cfgfile_write (f, _T("fpu_model"), _T("%d"), p->fpu_model); if (p->mmu_model) - cfgfile_write (f, L"mmu_model", L"%d", p->mmu_model); - cfgfile_write_bool (f, L"cpu_compatible", p->cpu_compatible); - cfgfile_write_bool (f, L"cpu_24bit_addressing", p->address_space_24); + cfgfile_write (f, _T("mmu_model"), _T("%d"), p->mmu_model); + cfgfile_write_bool (f, _T("cpu_compatible"), p->cpu_compatible); + cfgfile_write_bool (f, _T("cpu_24bit_addressing"), p->address_space_24); /* do not reorder end */ if (p->cpu_cycle_exact) { if (p->cpu_frequency) - cfgfile_write (f, L"cpu_frequency", L"%d", p->cpu_frequency); + cfgfile_write (f, _T("cpu_frequency"), _T("%d"), p->cpu_frequency); if (p->cpu_clock_multiplier) { if (p->cpu_clock_multiplier >= 256) - cfgfile_write (f, L"cpu_multiplier", L"%d", p->cpu_clock_multiplier >> 8); + cfgfile_write (f, _T("cpu_multiplier"), _T("%d"), p->cpu_clock_multiplier >> 8); } } - cfgfile_write_bool (f, L"cpu_cycle_exact", p->cpu_cycle_exact); - cfgfile_write_bool (f, L"blitter_cycle_exact", p->blitter_cycle_exact); - cfgfile_write_bool (f, L"cycle_exact", p->cpu_cycle_exact && p->blitter_cycle_exact ? 1 : 0); - cfgfile_write_bool (f, L"rtg_nocustom", p->picasso96_nocustom); - cfgfile_write (f, L"rtg_modes", L"0x%x", p->picasso96_modeflags); + cfgfile_write_bool (f, _T("cpu_cycle_exact"), p->cpu_cycle_exact); + cfgfile_write_bool (f, _T("blitter_cycle_exact"), p->blitter_cycle_exact); + cfgfile_write_bool (f, _T("cycle_exact"), p->cpu_cycle_exact && p->blitter_cycle_exact ? 1 : 0); + cfgfile_write_bool (f, _T("rtg_nocustom"), p->picasso96_nocustom); + cfgfile_write (f, _T("rtg_modes"), _T("0x%x"), p->picasso96_modeflags); - cfgfile_write_bool (f, L"log_illegal_mem", p->illegal_mem); + cfgfile_write_bool (f, _T("log_illegal_mem"), p->illegal_mem); if (p->catweasel >= 100) - cfgfile_dwrite (f, L"catweasel", L"0x%x", p->catweasel); + cfgfile_dwrite (f, _T("catweasel"), _T("0x%x"), p->catweasel); else - cfgfile_dwrite (f, L"catweasel", L"%d", p->catweasel); - - cfgfile_write_str (f, L"kbd_lang", (p->keyboard_lang == KBD_LANG_DE ? L"de" - : p->keyboard_lang == KBD_LANG_DK ? L"dk" - : p->keyboard_lang == KBD_LANG_ES ? L"es" - : p->keyboard_lang == KBD_LANG_US ? L"us" - : p->keyboard_lang == KBD_LANG_SE ? L"se" - : p->keyboard_lang == KBD_LANG_FR ? L"fr" - : p->keyboard_lang == KBD_LANG_IT ? L"it" - : L"FOO")); - - cfgfile_dwrite (f, L"state_replay_rate", L"%d", p->statecapturerate); - cfgfile_dwrite (f, L"state_replay_buffers", L"%d", p->statecapturebuffersize); - cfgfile_dwrite_bool (f, L"state_replay_autoplay", p->inprec_autoplay); - cfgfile_dwrite_bool (f, L"warp", p->turbo_emulation); + cfgfile_dwrite (f, _T("catweasel"), _T("%d"), p->catweasel); + + cfgfile_write_str (f, _T("kbd_lang"), (p->keyboard_lang == KBD_LANG_DE ? _T("de") + : p->keyboard_lang == KBD_LANG_DK ? _T("dk") + : p->keyboard_lang == KBD_LANG_ES ? _T("es") + : p->keyboard_lang == KBD_LANG_US ? _T("us") + : p->keyboard_lang == KBD_LANG_SE ? _T("se") + : p->keyboard_lang == KBD_LANG_FR ? _T("fr") + : p->keyboard_lang == KBD_LANG_IT ? _T("it") + : _T("FOO"))); + + cfgfile_dwrite (f, _T("state_replay_rate"), _T("%d"), p->statecapturerate); + cfgfile_dwrite (f, _T("state_replay_buffers"), _T("%d"), p->statecapturebuffersize); + cfgfile_dwrite_bool (f, _T("state_replay_autoplay"), p->inprec_autoplay); + cfgfile_dwrite_bool (f, _T("warp"), p->turbo_emulation); #ifdef FILESYS write_filesys_config (p, f); if (p->filesys_no_uaefsdb) - cfgfile_write_bool (f, L"filesys_no_fsdb", p->filesys_no_uaefsdb); + cfgfile_write_bool (f, _T("filesys_no_fsdb"), p->filesys_no_uaefsdb); #endif write_inputdevice_config (p, f); } @@ -1089,15 +1089,15 @@ int cfgfile_yesno (const TCHAR *option, const TCHAR *value, const TCHAR *name, i { if (name != NULL && _tcscmp (option, name) != 0) return 0; - if (strcasecmp (value, L"yes") == 0 || strcasecmp (value, L"y") == 0 - || strcasecmp (value, L"true") == 0 || strcasecmp (value, L"t") == 0) + if (strcasecmp (value, _T("yes")) == 0 || strcasecmp (value, _T("y")) == 0 + || strcasecmp (value, _T("true")) == 0 || strcasecmp (value, _T("t")) == 0) *location = 1; - else if (strcasecmp (value, L"no") == 0 || strcasecmp (value, L"n") == 0 - || strcasecmp (value, L"false") == 0 || strcasecmp (value, L"f") == 0 - || strcasecmp (value, L"0") == 0) + else if (strcasecmp (value, _T("no")) == 0 || strcasecmp (value, _T("n")) == 0 + || strcasecmp (value, _T("false")) == 0 || strcasecmp (value, _T("f")) == 0 + || strcasecmp (value, _T("0")) == 0) *location = 0; else { - write_log (L"Option `%s' requires a value of either `yes' or `no' (was '%s').\n", option, value); + write_log (_T("Option `%s' requires a value of either `yes' or `no' (was '%s').\n"), option, value); return -1; } return 1; @@ -1138,15 +1138,15 @@ int cfgfile_intval (const TCHAR *option, const TCHAR *value, const TCHAR *name, *location = _tcstol (value, &endptr, base) * scale; if (*endptr != '\0' || *value == '\0') { - if (strcasecmp (value, L"false") == 0 || strcasecmp (value, L"no") == 0) { + if (strcasecmp (value, _T("false")) == 0 || strcasecmp (value, _T("no")) == 0) { *location = 0; return 1; } - if (strcasecmp (value, L"true") == 0 || strcasecmp (value, L"yes") == 0) { + if (strcasecmp (value, _T("true")) == 0 || strcasecmp (value, _T("yes")) == 0) { *location = 1; return 1; } - write_log (L"Option '%s' requires a numeric argument but got '%s'\n", option, value); + write_log (_T("Option '%s' requires a numeric argument but got '%s'\n"), option, value); return -1; } return 1; @@ -1172,7 +1172,7 @@ int cfgfile_strval (const TCHAR *option, const TCHAR *value, const TCHAR *name, if (more) return 0; - write_log (L"Unknown value ('%s') for option '%s'.\n", value, option); + write_log (_T("Unknown value ('%s') for option '%s'.\n"), value, option); return -1; } *location = val; @@ -1206,7 +1206,7 @@ int cfgfile_path (const TCHAR *option, const TCHAR *value, const TCHAR *name, TC location[maxsz - 1] = 0; if (mp) { for (int i = 0; i < MAX_PATHS; i++) { - if (mp->path[i][0] && _tcscmp (mp->path[i], L".\\") != 0 && _tcscmp (mp->path[i], L"./") != 0 && (location[0] != '/' && location[0] != '\\' && !_tcschr(location, ':'))) { + if (mp->path[i][0] && _tcscmp (mp->path[i], _T(".\\")) != 0 && _tcscmp (mp->path[i], _T("./")) != 0 && (location[0] != '/' && location[0] != '\\' && !_tcschr(location, ':'))) { TCHAR np[MAX_DPATH]; _tcscpy (np, mp->path[i]); fixtrailing (np); @@ -1234,7 +1234,7 @@ int cfgfile_multipath (const TCHAR *option, const TCHAR *value, const TCHAR *nam if (!cfgfile_string (option, value, name, tmploc, 256)) return 0; for (int i = 0; i < MAX_PATHS; i++) { - if (mp->path[i][0] == 0 || (i == 0 && (!_tcscmp (mp->path[i], L".\\") || !_tcscmp (mp->path[i], L"./")))) { + if (mp->path[i][0] == 0 || (i == 0 && (!_tcscmp (mp->path[i], _T(".\\")) || !_tcscmp (mp->path[i], _T("./"))))) { TCHAR *s = target_expand_environment (tmploc); _tcsncpy (mp->path[i], s, 256 - 1); mp->path[i][256 - 1] = 0; @@ -1266,7 +1266,7 @@ int cfgfile_rom (const TCHAR *option, const TCHAR *value, const TCHAR *name, TCH if (rd) { struct romlist *rl = getromlistbyromdata (rd); if (rl) { - write_log (L"%s: %s -> %s\n", name, location, rl->path); + write_log (_T("%s: %s -> %s\n"), name, location, rl->path); _tcsncpy (location, rl->path, maxsz); } } @@ -1344,7 +1344,7 @@ static int cfgfile_parse_host (struct uae_prefs *p, TCHAR *option, TCHAR *value) TCHAR *tmpp; TCHAR tmpbuf[CONFIG_BLEN]; - if (_tcsncmp (option, L"input.", 6) == 0) { + if (_tcsncmp (option, _T("input."), 6) == 0) { read_inputdevice_config (p, option, value); return 1; } @@ -1359,17 +1359,17 @@ static int cfgfile_parse_host (struct uae_prefs *p, TCHAR *option, TCHAR *value) *tmpp = '\0'; if (_tcscmp (section, TARGET_NAME) == 0) { /* We special case the various path options here. */ - if (cfgfile_multipath (option, value, L"rom_path", &p->path_rom) - || cfgfile_multipath (option, value, L"floppy_path", &p->path_floppy) - || cfgfile_multipath (option, value, L"cd_path", &p->path_cd) - || cfgfile_multipath (option, value, L"hardfile_path", &p->path_hardfile)) + if (cfgfile_multipath (option, value, _T("rom_path"), &p->path_rom) + || cfgfile_multipath (option, value, _T("floppy_path"), &p->path_floppy) + || cfgfile_multipath (option, value, _T("cd_path"), &p->path_cd) + || cfgfile_multipath (option, value, _T("hardfile_path"), &p->path_hardfile)) return 1; return target_parse_option (p, option, value); } return 0; } for (i = 0; i < MAX_SPARE_DRIVES; i++) { - _stprintf (tmpbuf, L"diskimage%d", i); + _stprintf (tmpbuf, _T("diskimage%d"), i); if (cfgfile_path (option, value, tmpbuf, p->dfxlist[i], sizeof p->dfxlist[i] / sizeof (TCHAR), &p->path_floppy)) { #if 0 if (i < 4 && !p->df[i][0]) @@ -1381,9 +1381,9 @@ static int cfgfile_parse_host (struct uae_prefs *p, TCHAR *option, TCHAR *value) for (i = 0; i < MAX_TOTAL_SCSI_DEVICES; i++) { TCHAR tmp[20]; - _stprintf (tmp, L"cdimage%d", i); + _stprintf (tmp, _T("cdimage%d"), i); if (!_tcsicmp (option, tmp)) { - if (!_tcsicmp (value, L"autodetect")) { + if (!_tcsicmp (value, _T("autodetect"))) { p->cdslots[i].type = SCSI_UNIT_DEFAULT; p->cdslots[i].inuse = true; p->cdslots[i].name[0] = 0; @@ -1401,7 +1401,7 @@ static int cfgfile_parse_host (struct uae_prefs *p, TCHAR *option, TCHAR *value) if (next2) *next2++ = 0; int tmpval = 0; - if (!_tcsicmp (next, L"delay")) { + if (!_tcsicmp (next, _T("delay"))) { p->cdslots[i].delayed = true; next = next2; if (!next) @@ -1451,168 +1451,168 @@ static int cfgfile_parse_host (struct uae_prefs *p, TCHAR *option, TCHAR *value) } } - if (cfgfile_strval (option, value, L"gfx_autoresolution_min_vertical", &p->gfx_autoresolution_minv, vertmode, 0)) { + if (cfgfile_strval (option, value, _T("gfx_autoresolution_min_vertical"), &p->gfx_autoresolution_minv, vertmode, 0)) { p->gfx_autoresolution_minv--; return 1; } - if (cfgfile_strval (option, value, L"gfx_autoresolution_min_horizontal", &p->gfx_autoresolution_minh, horizmode, 0)) { + if (cfgfile_strval (option, value, _T("gfx_autoresolution_min_horizontal"), &p->gfx_autoresolution_minh, horizmode, 0)) { p->gfx_autoresolution_minh--; return 1; } - if (cfgfile_intval (option, value, L"sound_frequency", &p->sound_freq, 1) - || cfgfile_intval (option, value, L"sound_max_buff", &p->sound_maxbsiz, 1) - || cfgfile_intval (option, value, L"state_replay_rate", &p->statecapturerate, 1) - || cfgfile_intval (option, value, L"state_replay_buffers", &p->statecapturebuffersize, 1) - || cfgfile_yesno (option, value, L"state_replay_autoplay", &p->inprec_autoplay) - || cfgfile_intval (option, value, L"sound_frequency", &p->sound_freq, 1) - || cfgfile_intval (option, value, L"sound_volume", &p->sound_volume, 1) - || cfgfile_intval (option, value, L"sound_volume_cd", &p->sound_volume_cd, 1) - || cfgfile_intval (option, value, L"sound_stereo_separation", &p->sound_stereo_separation, 1) - || cfgfile_intval (option, value, L"sound_stereo_mixing_delay", &p->sound_mixed_stereo_delay, 1) - - || cfgfile_intval (option, value, L"gfx_display", &p->gfx_display, 1) - || cfgfile_intval (option, value, L"gfx_framerate", &p->gfx_framerate, 1) - || cfgfile_intval (option, value, L"gfx_width_windowed", &p->gfx_size_win.width, 1) - || cfgfile_intval (option, value, L"gfx_height_windowed", &p->gfx_size_win.height, 1) - || cfgfile_intval (option, value, L"gfx_top_windowed", &p->gfx_size_win.x, 1) - || cfgfile_intval (option, value, L"gfx_left_windowed", &p->gfx_size_win.y, 1) - || cfgfile_intval (option, value, L"gfx_width_fullscreen", &p->gfx_size_fs.width, 1) - || cfgfile_intval (option, value, L"gfx_height_fullscreen", &p->gfx_size_fs.height, 1) - || cfgfile_intval (option, value, L"gfx_refreshrate", &p->gfx_apmode[0].gfx_refreshrate, 1) - || cfgfile_intval (option, value, L"gfx_refreshrate_rtg", &p->gfx_apmode[1].gfx_refreshrate, 1) - || cfgfile_yesno (option, value, L"gfx_autoresolution", &p->gfx_autoresolution) - || cfgfile_intval (option, value, L"gfx_backbuffers", &p->gfx_apmode[0].gfx_backbuffers, 1) - || cfgfile_intval (option, value, L"gfx_backbuffers_rtg", &p->gfx_apmode[1].gfx_backbuffers, 1) - || cfgfile_yesno (option, value, L"gfx_interlace", &p->gfx_apmode[0].gfx_interlaced) + if (cfgfile_intval (option, value, _T("sound_frequency"), &p->sound_freq, 1) + || cfgfile_intval (option, value, _T("sound_max_buff"), &p->sound_maxbsiz, 1) + || cfgfile_intval (option, value, _T("state_replay_rate"), &p->statecapturerate, 1) + || cfgfile_intval (option, value, _T("state_replay_buffers"), &p->statecapturebuffersize, 1) + || cfgfile_yesno (option, value, _T("state_replay_autoplay"), &p->inprec_autoplay) + || cfgfile_intval (option, value, _T("sound_frequency"), &p->sound_freq, 1) + || cfgfile_intval (option, value, _T("sound_volume"), &p->sound_volume, 1) + || cfgfile_intval (option, value, _T("sound_volume_cd"), &p->sound_volume_cd, 1) + || cfgfile_intval (option, value, _T("sound_stereo_separation"), &p->sound_stereo_separation, 1) + || cfgfile_intval (option, value, _T("sound_stereo_mixing_delay"), &p->sound_mixed_stereo_delay, 1) + + || cfgfile_intval (option, value, _T("gfx_display"), &p->gfx_display, 1) + || cfgfile_intval (option, value, _T("gfx_framerate"), &p->gfx_framerate, 1) + || cfgfile_intval (option, value, _T("gfx_width_windowed"), &p->gfx_size_win.width, 1) + || cfgfile_intval (option, value, _T("gfx_height_windowed"), &p->gfx_size_win.height, 1) + || cfgfile_intval (option, value, _T("gfx_top_windowed"), &p->gfx_size_win.x, 1) + || cfgfile_intval (option, value, _T("gfx_left_windowed"), &p->gfx_size_win.y, 1) + || cfgfile_intval (option, value, _T("gfx_width_fullscreen"), &p->gfx_size_fs.width, 1) + || cfgfile_intval (option, value, _T("gfx_height_fullscreen"), &p->gfx_size_fs.height, 1) + || cfgfile_intval (option, value, _T("gfx_refreshrate"), &p->gfx_apmode[0].gfx_refreshrate, 1) + || cfgfile_intval (option, value, _T("gfx_refreshrate_rtg"), &p->gfx_apmode[1].gfx_refreshrate, 1) + || cfgfile_yesno (option, value, _T("gfx_autoresolution"), &p->gfx_autoresolution) + || cfgfile_intval (option, value, _T("gfx_backbuffers"), &p->gfx_apmode[0].gfx_backbuffers, 1) + || cfgfile_intval (option, value, _T("gfx_backbuffers_rtg"), &p->gfx_apmode[1].gfx_backbuffers, 1) + || cfgfile_yesno (option, value, _T("gfx_interlace"), &p->gfx_apmode[0].gfx_interlaced) - || cfgfile_intval (option, value, L"gfx_center_horizontal_position", &p->gfx_xcenter_pos, 1) - || cfgfile_intval (option, value, L"gfx_center_vertical_position", &p->gfx_ycenter_pos, 1) - || cfgfile_intval (option, value, L"gfx_center_horizontal_size", &p->gfx_xcenter_size, 1) - || cfgfile_intval (option, value, L"gfx_center_vertical_size", &p->gfx_ycenter_size, 1) + || cfgfile_intval (option, value, _T("gfx_center_horizontal_position"), &p->gfx_xcenter_pos, 1) + || cfgfile_intval (option, value, _T("gfx_center_vertical_position"), &p->gfx_ycenter_pos, 1) + || cfgfile_intval (option, value, _T("gfx_center_horizontal_size"), &p->gfx_xcenter_size, 1) + || cfgfile_intval (option, value, _T("gfx_center_vertical_size"), &p->gfx_ycenter_size, 1) #ifdef GFXFILTER - || cfgfile_intval (option, value, L"gfx_filter_vert_zoom", &p->gfx_filter_vert_zoom, 1) - || cfgfile_intval (option, value, L"gfx_filter_horiz_zoom", &p->gfx_filter_horiz_zoom, 1) - || cfgfile_intval (option, value, L"gfx_filter_vert_zoom_mult", &p->gfx_filter_vert_zoom_mult, 1) - || cfgfile_intval (option, value, L"gfx_filter_horiz_zoom_mult", &p->gfx_filter_horiz_zoom_mult, 1) - || cfgfile_intval (option, value, L"gfx_filter_vert_offset", &p->gfx_filter_vert_offset, 1) - || cfgfile_intval (option, value, L"gfx_filter_horiz_offset", &p->gfx_filter_horiz_offset, 1) - || cfgfile_intval (option, value, L"gfx_filter_scanlines", &p->gfx_filter_scanlines, 1) - || cfgfile_intval (option, value, L"gfx_filter_scanlinelevel", &p->gfx_filter_scanlinelevel, 1) - || cfgfile_intval (option, value, L"gfx_filter_scanlineratio", &p->gfx_filter_scanlineratio, 1) - || cfgfile_intval (option, value, L"gfx_filter_luminance", &p->gfx_filter_luminance, 1) - || cfgfile_intval (option, value, L"gfx_filter_contrast", &p->gfx_filter_contrast, 1) - || cfgfile_intval (option, value, L"gfx_filter_saturation", &p->gfx_filter_saturation, 1) - || cfgfile_intval (option, value, L"gfx_filter_gamma", &p->gfx_filter_gamma, 1) - || cfgfile_intval (option, value, L"gfx_filter_blur", &p->gfx_filter_blur, 1) - || cfgfile_intval (option, value, L"gfx_filter_noise", &p->gfx_filter_noise, 1) - || cfgfile_intval (option, value, L"gfx_filter_bilinear", &p->gfx_filter_bilinear, 1) - || cfgfile_intval (option, value, L"gfx_luminance", &p->gfx_luminance, 1) - || cfgfile_intval (option, value, L"gfx_contrast", &p->gfx_contrast, 1) - || cfgfile_intval (option, value, L"gfx_gamma", &p->gfx_gamma, 1) - || cfgfile_string (option, value, L"gfx_filter_mask", p->gfx_filtermask, sizeof p->gfx_filtermask / sizeof (TCHAR)) + || cfgfile_intval (option, value, _T("gfx_filter_vert_zoom"), &p->gfx_filter_vert_zoom, 1) + || cfgfile_intval (option, value, _T("gfx_filter_horiz_zoom"), &p->gfx_filter_horiz_zoom, 1) + || cfgfile_intval (option, value, _T("gfx_filter_vert_zoom_mult"), &p->gfx_filter_vert_zoom_mult, 1) + || cfgfile_intval (option, value, _T("gfx_filter_horiz_zoom_mult"), &p->gfx_filter_horiz_zoom_mult, 1) + || cfgfile_intval (option, value, _T("gfx_filter_vert_offset"), &p->gfx_filter_vert_offset, 1) + || cfgfile_intval (option, value, _T("gfx_filter_horiz_offset"), &p->gfx_filter_horiz_offset, 1) + || cfgfile_intval (option, value, _T("gfx_filter_scanlines"), &p->gfx_filter_scanlines, 1) + || cfgfile_intval (option, value, _T("gfx_filter_scanlinelevel"), &p->gfx_filter_scanlinelevel, 1) + || cfgfile_intval (option, value, _T("gfx_filter_scanlineratio"), &p->gfx_filter_scanlineratio, 1) + || cfgfile_intval (option, value, _T("gfx_filter_luminance"), &p->gfx_filter_luminance, 1) + || cfgfile_intval (option, value, _T("gfx_filter_contrast"), &p->gfx_filter_contrast, 1) + || cfgfile_intval (option, value, _T("gfx_filter_saturation"), &p->gfx_filter_saturation, 1) + || cfgfile_intval (option, value, _T("gfx_filter_gamma"), &p->gfx_filter_gamma, 1) + || cfgfile_intval (option, value, _T("gfx_filter_blur"), &p->gfx_filter_blur, 1) + || cfgfile_intval (option, value, _T("gfx_filter_noise"), &p->gfx_filter_noise, 1) + || cfgfile_intval (option, value, _T("gfx_filter_bilinear"), &p->gfx_filter_bilinear, 1) + || cfgfile_intval (option, value, _T("gfx_luminance"), &p->gfx_luminance, 1) + || cfgfile_intval (option, value, _T("gfx_contrast"), &p->gfx_contrast, 1) + || cfgfile_intval (option, value, _T("gfx_gamma"), &p->gfx_gamma, 1) + || cfgfile_string (option, value, _T("gfx_filter_mask"), p->gfx_filtermask, sizeof p->gfx_filtermask / sizeof (TCHAR)) #endif - || cfgfile_intval (option, value, L"floppy0sound", &p->floppyslots[0].dfxclick, 1) - || cfgfile_intval (option, value, L"floppy1sound", &p->floppyslots[1].dfxclick, 1) - || cfgfile_intval (option, value, L"floppy2sound", &p->floppyslots[2].dfxclick, 1) - || cfgfile_intval (option, value, L"floppy3sound", &p->floppyslots[3].dfxclick, 1) - || cfgfile_intval (option, value, L"floppy_channel_mask", &p->dfxclickchannelmask, 1) - || cfgfile_intval (option, value, L"floppy_volume", &p->dfxclickvolume, 1)) + || cfgfile_intval (option, value, _T("floppy0sound"), &p->floppyslots[0].dfxclick, 1) + || cfgfile_intval (option, value, _T("floppy1sound"), &p->floppyslots[1].dfxclick, 1) + || cfgfile_intval (option, value, _T("floppy2sound"), &p->floppyslots[2].dfxclick, 1) + || cfgfile_intval (option, value, _T("floppy3sound"), &p->floppyslots[3].dfxclick, 1) + || cfgfile_intval (option, value, _T("floppy_channel_mask"), &p->dfxclickchannelmask, 1) + || cfgfile_intval (option, value, _T("floppy_volume"), &p->dfxclickvolume, 1)) return 1; - if (cfgfile_path (option, value, L"floppy0soundext", p->floppyslots[0].dfxclickexternal, sizeof p->floppyslots[0].dfxclickexternal / sizeof (TCHAR)) - || cfgfile_path (option, value, L"floppy1soundext", p->floppyslots[1].dfxclickexternal, sizeof p->floppyslots[1].dfxclickexternal / sizeof (TCHAR)) - || cfgfile_path (option, value, L"floppy2soundext", p->floppyslots[2].dfxclickexternal, sizeof p->floppyslots[2].dfxclickexternal / sizeof (TCHAR)) - || cfgfile_path (option, value, L"floppy3soundext", p->floppyslots[3].dfxclickexternal, sizeof p->floppyslots[3].dfxclickexternal / sizeof (TCHAR)) - || cfgfile_string (option, value, L"gfx_display_name", p->gfx_display_name, sizeof p->gfx_display_name / sizeof (TCHAR)) - || cfgfile_string (option, value, L"config_window_title", p->config_window_title, sizeof p->config_window_title / sizeof (TCHAR)) - || cfgfile_string (option, value, L"config_info", p->info, sizeof p->info / sizeof (TCHAR)) - || cfgfile_string (option, value, L"config_description", p->description, sizeof p->description / sizeof (TCHAR))) + if (cfgfile_path (option, value, _T("floppy0soundext"), p->floppyslots[0].dfxclickexternal, sizeof p->floppyslots[0].dfxclickexternal / sizeof (TCHAR)) + || cfgfile_path (option, value, _T("floppy1soundext"), p->floppyslots[1].dfxclickexternal, sizeof p->floppyslots[1].dfxclickexternal / sizeof (TCHAR)) + || cfgfile_path (option, value, _T("floppy2soundext"), p->floppyslots[2].dfxclickexternal, sizeof p->floppyslots[2].dfxclickexternal / sizeof (TCHAR)) + || cfgfile_path (option, value, _T("floppy3soundext"), p->floppyslots[3].dfxclickexternal, sizeof p->floppyslots[3].dfxclickexternal / sizeof (TCHAR)) + || cfgfile_string (option, value, _T("gfx_display_name"), p->gfx_display_name, sizeof p->gfx_display_name / sizeof (TCHAR)) + || cfgfile_string (option, value, _T("config_window_title"), p->config_window_title, sizeof p->config_window_title / sizeof (TCHAR)) + || cfgfile_string (option, value, _T("config_info"), p->info, sizeof p->info / sizeof (TCHAR)) + || cfgfile_string (option, value, _T("config_description"), p->description, sizeof p->description / sizeof (TCHAR))) return 1; - if (cfgfile_yesno (option, value, L"use_debugger", &p->start_debugger) - || cfgfile_yesno (option, value, L"sound_auto", &p->sound_auto) - || cfgfile_yesno (option, value, L"sound_stereo_swap_paula", &p->sound_stereo_swap_paula) - || cfgfile_yesno (option, value, L"sound_stereo_swap_ahi", &p->sound_stereo_swap_ahi) - || cfgfile_yesno (option, value, L"avoid_cmov", &p->avoid_cmov) - || cfgfile_yesno (option, value, L"log_illegal_mem", &p->illegal_mem) - || cfgfile_yesno (option, value, L"filesys_no_fsdb", &p->filesys_no_uaefsdb) - || cfgfile_yesno (option, value, L"gfx_blacker_than_black", &p->gfx_blackerthanblack) - || cfgfile_yesno (option, value, L"gfx_flickerfixer", &p->gfx_scandoubler) - || cfgfile_yesno (option, value, L"synchronize_clock", &p->tod_hack) - || cfgfile_yesno (option, value, L"magic_mouse", &p->input_magic_mouse) - || cfgfile_yesno (option, value, L"warp", &p->turbo_emulation) - || cfgfile_yesno (option, value, L"headless", &p->headless) - || cfgfile_yesno (option, value, L"clipboard_sharing", &p->clipboard_sharing) - || cfgfile_yesno (option, value, L"native_code", &p->native_code) - || cfgfile_yesno (option, value, L"bsdsocket_emu", &p->socket_emu)) + if (cfgfile_yesno (option, value, _T("use_debugger"), &p->start_debugger) + || cfgfile_yesno (option, value, _T("sound_auto"), &p->sound_auto) + || cfgfile_yesno (option, value, _T("sound_stereo_swap_paula"), &p->sound_stereo_swap_paula) + || cfgfile_yesno (option, value, _T("sound_stereo_swap_ahi"), &p->sound_stereo_swap_ahi) + || cfgfile_yesno (option, value, _T("avoid_cmov"), &p->avoid_cmov) + || cfgfile_yesno (option, value, _T("log_illegal_mem"), &p->illegal_mem) + || cfgfile_yesno (option, value, _T("filesys_no_fsdb"), &p->filesys_no_uaefsdb) + || cfgfile_yesno (option, value, _T("gfx_blacker_than_black"), &p->gfx_blackerthanblack) + || cfgfile_yesno (option, value, _T("gfx_flickerfixer"), &p->gfx_scandoubler) + || cfgfile_yesno (option, value, _T("synchronize_clock"), &p->tod_hack) + || cfgfile_yesno (option, value, _T("magic_mouse"), &p->input_magic_mouse) + || cfgfile_yesno (option, value, _T("warp"), &p->turbo_emulation) + || cfgfile_yesno (option, value, _T("headless"), &p->headless) + || cfgfile_yesno (option, value, _T("clipboard_sharing"), &p->clipboard_sharing) + || cfgfile_yesno (option, value, _T("native_code"), &p->native_code) + || cfgfile_yesno (option, value, _T("bsdsocket_emu"), &p->socket_emu)) return 1; - if (cfgfile_strval (option, value, L"sound_output", &p->produce_sound, soundmode1, 1) - || cfgfile_strval (option, value, L"sound_output", &p->produce_sound, soundmode2, 0) - || cfgfile_strval (option, value, L"sound_interpol", &p->sound_interpol, interpolmode, 0) - || cfgfile_strval (option, value, L"sound_filter", &p->sound_filter, soundfiltermode1, 0) - || cfgfile_strval (option, value, L"sound_filter_type", &p->sound_filter_type, soundfiltermode2, 0) - || cfgfile_strboolval (option, value, L"use_gui", &p->start_gui, guimode1, 1) - || cfgfile_strboolval (option, value, L"use_gui", &p->start_gui, guimode2, 1) - || cfgfile_strboolval (option, value, L"use_gui", &p->start_gui, guimode3, 0) - || cfgfile_strval (option, value, L"gfx_resolution", &p->gfx_resolution, lorestype1, 0) - || cfgfile_strval (option, value, L"gfx_lores", &p->gfx_resolution, lorestype2, 0) - || cfgfile_strval (option, value, L"gfx_lores_mode", &p->gfx_lores_mode, loresmode, 0) - || cfgfile_strval (option, value, L"gfx_fullscreen_amiga", &p->gfx_apmode[0].gfx_fullscreen, fullmodes, 0) - || cfgfile_strval (option, value, L"gfx_fullscreen_picasso", &p->gfx_apmode[1].gfx_fullscreen, fullmodes, 0) - || cfgfile_strval (option, value, L"gfx_center_horizontal", &p->gfx_xcenter, centermode1, 1) - || cfgfile_strval (option, value, L"gfx_center_vertical", &p->gfx_ycenter, centermode1, 1) - || cfgfile_strval (option, value, L"gfx_center_horizontal", &p->gfx_xcenter, centermode2, 0) - || cfgfile_strval (option, value, L"gfx_center_vertical", &p->gfx_ycenter, centermode2, 0) - || cfgfile_strval (option, value, L"gfx_colour_mode", &p->color_mode, colormode1, 1) - || cfgfile_strval (option, value, L"gfx_colour_mode", &p->color_mode, colormode2, 0) - || cfgfile_strval (option, value, L"gfx_color_mode", &p->color_mode, colormode1, 1) - || cfgfile_strval (option, value, L"gfx_color_mode", &p->color_mode, colormode2, 0) - || cfgfile_strval (option, value, L"gfx_max_horizontal", &p->gfx_max_horizontal, maxhoriz, 0) - || cfgfile_strval (option, value, L"gfx_max_vertical", &p->gfx_max_vertical, maxvert, 0) - || cfgfile_strval (option, value, L"gfx_filter_autoscale", &p->gfx_filter_autoscale, autoscale, 0) - || cfgfile_strval (option, value, L"gfx_api", &p->gfx_api, filterapi, 0) - || cfgfile_strval (option, value, L"magic_mousecursor", &p->input_magic_mouse_cursor, magiccursors, 0) - || cfgfile_strval (option, value, L"gfx_filter_keep_aspect", &p->gfx_filter_keep_aspect, aspects, 0) - || cfgfile_strval (option, value, L"absolute_mouse", &p->input_tablet, abspointers, 0)) + if (cfgfile_strval (option, value, _T("sound_output"), &p->produce_sound, soundmode1, 1) + || cfgfile_strval (option, value, _T("sound_output"), &p->produce_sound, soundmode2, 0) + || cfgfile_strval (option, value, _T("sound_interpol"), &p->sound_interpol, interpolmode, 0) + || cfgfile_strval (option, value, _T("sound_filter"), &p->sound_filter, soundfiltermode1, 0) + || cfgfile_strval (option, value, _T("sound_filter_type"), &p->sound_filter_type, soundfiltermode2, 0) + || cfgfile_strboolval (option, value, _T("use_gui"), &p->start_gui, guimode1, 1) + || cfgfile_strboolval (option, value, _T("use_gui"), &p->start_gui, guimode2, 1) + || cfgfile_strboolval (option, value, _T("use_gui"), &p->start_gui, guimode3, 0) + || cfgfile_strval (option, value, _T("gfx_resolution"), &p->gfx_resolution, lorestype1, 0) + || cfgfile_strval (option, value, _T("gfx_lores"), &p->gfx_resolution, lorestype2, 0) + || cfgfile_strval (option, value, _T("gfx_lores_mode"), &p->gfx_lores_mode, loresmode, 0) + || cfgfile_strval (option, value, _T("gfx_fullscreen_amiga"), &p->gfx_apmode[0].gfx_fullscreen, fullmodes, 0) + || cfgfile_strval (option, value, _T("gfx_fullscreen_picasso"), &p->gfx_apmode[1].gfx_fullscreen, fullmodes, 0) + || cfgfile_strval (option, value, _T("gfx_center_horizontal"), &p->gfx_xcenter, centermode1, 1) + || cfgfile_strval (option, value, _T("gfx_center_vertical"), &p->gfx_ycenter, centermode1, 1) + || cfgfile_strval (option, value, _T("gfx_center_horizontal"), &p->gfx_xcenter, centermode2, 0) + || cfgfile_strval (option, value, _T("gfx_center_vertical"), &p->gfx_ycenter, centermode2, 0) + || cfgfile_strval (option, value, _T("gfx_colour_mode"), &p->color_mode, colormode1, 1) + || cfgfile_strval (option, value, _T("gfx_colour_mode"), &p->color_mode, colormode2, 0) + || cfgfile_strval (option, value, _T("gfx_color_mode"), &p->color_mode, colormode1, 1) + || cfgfile_strval (option, value, _T("gfx_color_mode"), &p->color_mode, colormode2, 0) + || cfgfile_strval (option, value, _T("gfx_max_horizontal"), &p->gfx_max_horizontal, maxhoriz, 0) + || cfgfile_strval (option, value, _T("gfx_max_vertical"), &p->gfx_max_vertical, maxvert, 0) + || cfgfile_strval (option, value, _T("gfx_filter_autoscale"), &p->gfx_filter_autoscale, autoscale, 0) + || cfgfile_strval (option, value, _T("gfx_api"), &p->gfx_api, filterapi, 0) + || cfgfile_strval (option, value, _T("magic_mousecursor"), &p->input_magic_mouse_cursor, magiccursors, 0) + || cfgfile_strval (option, value, _T("gfx_filter_keep_aspect"), &p->gfx_filter_keep_aspect, aspects, 0) + || cfgfile_strval (option, value, _T("absolute_mouse"), &p->input_tablet, abspointers, 0)) return 1; - if (_tcscmp (option, L"gfx_linemode") == 0) { + if (_tcscmp (option, _T("gfx_linemode")) == 0) { int v; p->gfx_vresolution = VRES_DOUBLE; p->gfx_scanlines = false; - if (cfgfile_strval (option, value, L"gfx_linemode", &v, linemode, 0)) { + if (cfgfile_strval (option, value, _T("gfx_linemode"), &v, linemode, 0)) { p->gfx_scanlines = v & 1; p->gfx_vresolution = v / 2; } return 1; } - if (_tcscmp (option, L"gfx_vsync") == 0) { - if (cfgfile_strval (option, value, L"gfx_vsync", &p->gfx_apmode[0].gfx_vsync, vsyncmodes, 0) >= 0) + if (_tcscmp (option, _T("gfx_vsync")) == 0) { + if (cfgfile_strval (option, value, _T("gfx_vsync"), &p->gfx_apmode[0].gfx_vsync, vsyncmodes, 0) >= 0) return 1; - return cfgfile_yesno (option, value, L"gfx_vsync", &p->gfx_apmode[0].gfx_vsync); + return cfgfile_yesno (option, value, _T("gfx_vsync"), &p->gfx_apmode[0].gfx_vsync); } - if (_tcscmp (option, L"gfx_vsync_picasso") == 0) { - if (cfgfile_strval (option, value, L"gfx_vsync_picasso", &p->gfx_apmode[1].gfx_vsync, vsyncmodes, 0) >= 0) + if (_tcscmp (option, _T("gfx_vsync_picasso")) == 0) { + if (cfgfile_strval (option, value, _T("gfx_vsync_picasso"), &p->gfx_apmode[1].gfx_vsync, vsyncmodes, 0) >= 0) return 1; - return cfgfile_yesno (option, value, L"gfx_vsync_picasso", &p->gfx_apmode[1].gfx_vsync); + return cfgfile_yesno (option, value, _T("gfx_vsync_picasso"), &p->gfx_apmode[1].gfx_vsync); } - if (cfgfile_strval (option, value, L"gfx_vsyncmode", &p->gfx_apmode[0].gfx_vsyncmode, vsyncmodes2, 0)) + if (cfgfile_strval (option, value, _T("gfx_vsyncmode"), &p->gfx_apmode[0].gfx_vsyncmode, vsyncmodes2, 0)) return 1; - if (cfgfile_strval (option, value, L"gfx_vsyncmode_picasso", &p->gfx_apmode[1].gfx_vsyncmode, vsyncmodes2, 0)) + if (cfgfile_strval (option, value, _T("gfx_vsyncmode_picasso"), &p->gfx_apmode[1].gfx_vsyncmode, vsyncmodes2, 0)) return 1; - if (cfgfile_yesno (option, value, L"show_leds", &vb)) { + if (cfgfile_yesno (option, value, _T("show_leds"), &vb)) { if (vb) p->leds_on_screen |= STATUSLINE_CHIPSET; else p->leds_on_screen &= ~STATUSLINE_CHIPSET; return 1; } - if (cfgfile_yesno (option, value, L"show_leds_rtg", &vb)) { + if (cfgfile_yesno (option, value, _T("show_leds_rtg"), &vb)) { if (vb) p->leds_on_screen |= STATUSLINE_RTG; else @@ -1620,7 +1620,7 @@ static int cfgfile_parse_host (struct uae_prefs *p, TCHAR *option, TCHAR *value) return 1; } - if (!_tcscmp (option, L"osd_position")) { + if (!_tcscmp (option, _T("osd_position"))) { TCHAR *s = value; p->osd_pos.x = 0; p->osd_pos.y = 0; @@ -1644,7 +1644,7 @@ static int cfgfile_parse_host (struct uae_prefs *p, TCHAR *option, TCHAR *value) } #ifdef GFXFILTER - if (_tcscmp (option, L"gfx_filter_overlay") == 0) { + if (_tcscmp (option, _T("gfx_filter_overlay")) == 0) { TCHAR *s = _tcschr (value, ','); p->gfx_filteroverlay_overscan = 0; p->gfx_filteroverlay_pos.x = 0; @@ -1700,19 +1700,19 @@ static int cfgfile_parse_host (struct uae_prefs *p, TCHAR *option, TCHAR *value) return 1; } - if (_tcscmp (option, L"gfx_filter") == 0) { + if (_tcscmp (option, _T("gfx_filter")) == 0) { int i = 0; TCHAR *s = _tcschr (value, ':'); p->gfx_filtershader[0] = 0; p->gfx_filter = 0; if (s) { *s++ = 0; - if (!_tcscmp (value, L"D3D")) { + if (!_tcscmp (value, _T("D3D"))) { p->gfx_api = 1; _tcscpy (p->gfx_filtershader, s); } } - if (!_tcscmp (value, L"direct3d")) { + if (!_tcscmp (value, _T("direct3d"))) { p->gfx_api = 1; // forwards compatibiity } else { while(uaefilters[i].name) { @@ -1725,12 +1725,12 @@ static int cfgfile_parse_host (struct uae_prefs *p, TCHAR *option, TCHAR *value) } return 1; } - if (_tcscmp (option, L"gfx_filter_mode") == 0) { - cfgfile_strval (option, value, L"gfx_filter_mode", &p->gfx_filter_filtermode, filtermode2, 0); + if (_tcscmp (option, _T("gfx_filter_mode")) == 0) { + cfgfile_strval (option, value, _T("gfx_filter_mode"), &p->gfx_filter_filtermode, filtermode2, 0); return 1; } - if (cfgfile_string (option, value, L"gfx_filter_aspect_ratio", tmpbuf, sizeof tmpbuf / sizeof (TCHAR))) { + if (cfgfile_string (option, value, _T("gfx_filter_aspect_ratio"), tmpbuf, sizeof tmpbuf / sizeof (TCHAR))) { int v1, v2; TCHAR *s; @@ -1750,20 +1750,20 @@ static int cfgfile_parse_host (struct uae_prefs *p, TCHAR *option, TCHAR *value) } #endif - if (_tcscmp (option, L"gfx_width") == 0 || _tcscmp (option, L"gfx_height") == 0) { - cfgfile_intval (option, value, L"gfx_width", &p->gfx_size_win.width, 1); - cfgfile_intval (option, value, L"gfx_height", &p->gfx_size_win.height, 1); + if (_tcscmp (option, _T("gfx_width")) == 0 || _tcscmp (option, _T("gfx_height")) == 0) { + cfgfile_intval (option, value, _T("gfx_width"), &p->gfx_size_win.width, 1); + cfgfile_intval (option, value, _T("gfx_height"), &p->gfx_size_win.height, 1); p->gfx_size_fs.width = p->gfx_size_win.width; p->gfx_size_fs.height = p->gfx_size_win.height; return 1; } - if (_tcscmp (option, L"gfx_fullscreen_multi") == 0 || _tcscmp (option, L"gfx_windowed_multi") == 0) { + if (_tcscmp (option, _T("gfx_fullscreen_multi")) == 0 || _tcscmp (option, _T("gfx_windowed_multi")) == 0) { TCHAR tmp[256], *tmpp, *tmpp2; struct wh *wh = p->gfx_size_win_xtra; - if (_tcscmp (option, L"gfx_fullscreen_multi") == 0) + if (_tcscmp (option, _T("gfx_fullscreen_multi")) == 0) wh = p->gfx_size_fs_xtra; - _stprintf (tmp, L",%s,", value); + _stprintf (tmp, _T(",%s,"), value); tmpp2 = tmp; for (i = 0; i < 4; i++) { tmpp = _tcschr (tmpp2, ','); @@ -1777,59 +1777,59 @@ static int cfgfile_parse_host (struct uae_prefs *p, TCHAR *option, TCHAR *value) return 1; } - if (_tcscmp (option, L"joyportfriendlyname0") == 0 || _tcscmp (option, L"joyportfriendlyname1") == 0) { - inputdevice_joyport_config (p, value, _tcscmp (option, L"joyportfriendlyname0") == 0 ? 0 : 1, -1, 2); + if (_tcscmp (option, _T("joyportfriendlyname0")) == 0 || _tcscmp (option, _T("joyportfriendlyname1")) == 0) { + inputdevice_joyport_config (p, value, _tcscmp (option, _T("joyportfriendlyname0")) == 0 ? 0 : 1, -1, 2); return 1; } - if (_tcscmp (option, L"joyportfriendlyname2") == 0 || _tcscmp (option, L"joyportfriendlyname3") == 0) { - inputdevice_joyport_config (p, value, _tcscmp (option, L"joyportfriendlyname2") == 0 ? 2 : 3, -1, 2); + if (_tcscmp (option, _T("joyportfriendlyname2")) == 0 || _tcscmp (option, _T("joyportfriendlyname3")) == 0) { + inputdevice_joyport_config (p, value, _tcscmp (option, _T("joyportfriendlyname2")) == 0 ? 2 : 3, -1, 2); return 1; } - if (_tcscmp (option, L"joyportname0") == 0 || _tcscmp (option, L"joyportname1") == 0) { - inputdevice_joyport_config (p, value, _tcscmp (option, L"joyportname0") == 0 ? 0 : 1, -1, 1); + if (_tcscmp (option, _T("joyportname0")) == 0 || _tcscmp (option, _T("joyportname1")) == 0) { + inputdevice_joyport_config (p, value, _tcscmp (option, _T("joyportname0")) == 0 ? 0 : 1, -1, 1); return 1; } - if (_tcscmp (option, L"joyportname2") == 0 || _tcscmp (option, L"joyportname3") == 0) { - inputdevice_joyport_config (p, value, _tcscmp (option, L"joyportname2") == 0 ? 2 : 3, -1, 1); + if (_tcscmp (option, _T("joyportname2")) == 0 || _tcscmp (option, _T("joyportname3")) == 0) { + inputdevice_joyport_config (p, value, _tcscmp (option, _T("joyportname2")) == 0 ? 2 : 3, -1, 1); return 1; } - if (_tcscmp (option, L"joyport0") == 0 || _tcscmp (option, L"joyport1") == 0) { - inputdevice_joyport_config (p, value, _tcscmp (option, L"joyport0") == 0 ? 0 : 1, -1, 0); + if (_tcscmp (option, _T("joyport0")) == 0 || _tcscmp (option, _T("joyport1")) == 0) { + inputdevice_joyport_config (p, value, _tcscmp (option, _T("joyport0")) == 0 ? 0 : 1, -1, 0); return 1; } - if (_tcscmp (option, L"joyport2") == 0 || _tcscmp (option, L"joyport3") == 0) { - inputdevice_joyport_config (p, value, _tcscmp (option, L"joyport2") == 0 ? 2 : 3, -1, 0); + if (_tcscmp (option, _T("joyport2")) == 0 || _tcscmp (option, _T("joyport3")) == 0) { + inputdevice_joyport_config (p, value, _tcscmp (option, _T("joyport2")) == 0 ? 2 : 3, -1, 0); return 1; } - if (cfgfile_strval (option, value, L"joyport0mode", &p->jports[0].mode, joyportmodes, 0)) + if (cfgfile_strval (option, value, _T("joyport0mode"), &p->jports[0].mode, joyportmodes, 0)) return 1; - if (cfgfile_strval (option, value, L"joyport1mode", &p->jports[1].mode, joyportmodes, 0)) + if (cfgfile_strval (option, value, _T("joyport1mode"), &p->jports[1].mode, joyportmodes, 0)) return 1; - if (cfgfile_strval (option, value, L"joyport2mode", &p->jports[2].mode, joyportmodes, 0)) + if (cfgfile_strval (option, value, _T("joyport2mode"), &p->jports[2].mode, joyportmodes, 0)) return 1; - if (cfgfile_strval (option, value, L"joyport3mode", &p->jports[3].mode, joyportmodes, 0)) + if (cfgfile_strval (option, value, _T("joyport3mode"), &p->jports[3].mode, joyportmodes, 0)) return 1; - if (cfgfile_strval (option, value, L"joyport0autofire", &p->jports[0].autofire, joyaf, 0)) + if (cfgfile_strval (option, value, _T("joyport0autofire"), &p->jports[0].autofire, joyaf, 0)) return 1; - if (cfgfile_strval (option, value, L"joyport1autofire", &p->jports[1].autofire, joyaf, 0)) + if (cfgfile_strval (option, value, _T("joyport1autofire"), &p->jports[1].autofire, joyaf, 0)) return 1; - if (cfgfile_strval (option, value, L"joyport2autofire", &p->jports[2].autofire, joyaf, 0)) + if (cfgfile_strval (option, value, _T("joyport2autofire"), &p->jports[2].autofire, joyaf, 0)) return 1; - if (cfgfile_strval (option, value, L"joyport3autofire", &p->jports[3].autofire, joyaf, 0)) + if (cfgfile_strval (option, value, _T("joyport3autofire"), &p->jports[3].autofire, joyaf, 0)) return 1; - if (cfgfile_path (option, value, L"statefile_quit", p->quitstatefile, sizeof p->quitstatefile / sizeof (TCHAR))) + if (cfgfile_path (option, value, _T("statefile_quit"), p->quitstatefile, sizeof p->quitstatefile / sizeof (TCHAR))) return 1; - if (cfgfile_string (option, value, L"statefile_name", tmpbuf, sizeof tmpbuf / sizeof (TCHAR))) { + if (cfgfile_string (option, value, _T("statefile_name"), tmpbuf, sizeof tmpbuf / sizeof (TCHAR))) { fetch_statefilepath (savestate_fname, sizeof savestate_fname / sizeof (TCHAR)); _tcscat (savestate_fname, tmpbuf); - if (_tcslen (savestate_fname) >= 4 && _tcsicmp (savestate_fname + _tcslen (savestate_fname) - 4, L".uss")) - _tcscat (savestate_fname, L".uss"); + if (_tcslen (savestate_fname) >= 4 && _tcsicmp (savestate_fname + _tcslen (savestate_fname) - 4, _T(".uss"))) + _tcscat (savestate_fname, _T(".uss")); return 1; } - if (cfgfile_path (option, value, L"statefile", tmpbuf, sizeof tmpbuf / sizeof (TCHAR))) { + if (cfgfile_path (option, value, _T("statefile"), tmpbuf, sizeof tmpbuf / sizeof (TCHAR))) { _tcscpy (p->statefile, tmpbuf); _tcscpy (savestate_fname, tmpbuf); if (zfile_exists (savestate_fname)) { @@ -1866,7 +1866,7 @@ static int cfgfile_parse_host (struct uae_prefs *p, TCHAR *option, TCHAR *value) return 1; } - if (cfgfile_strval (option, value, L"sound_channels", &p->sound_stereo, stereomode, 1)) { + if (cfgfile_strval (option, value, _T("sound_channels"), &p->sound_stereo, stereomode, 1)) { if (p->sound_stereo == SND_NONE) { /* "mixed stereo" compatibility hack */ p->sound_stereo = SND_STEREO; p->sound_mixed_stereo_delay = 5; @@ -1875,22 +1875,22 @@ static int cfgfile_parse_host (struct uae_prefs *p, TCHAR *option, TCHAR *value) return 1; } - if (_tcscmp (option, L"kbd_lang") == 0) { + if (_tcscmp (option, _T("kbd_lang")) == 0) { KbdLang l; - if ((l = KBD_LANG_DE, strcasecmp (value, L"de") == 0) - || (l = KBD_LANG_DK, strcasecmp (value, L"dk") == 0) - || (l = KBD_LANG_SE, strcasecmp (value, L"se") == 0) - || (l = KBD_LANG_US, strcasecmp (value, L"us") == 0) - || (l = KBD_LANG_FR, strcasecmp (value, L"fr") == 0) - || (l = KBD_LANG_IT, strcasecmp (value, L"it") == 0) - || (l = KBD_LANG_ES, strcasecmp (value, L"es") == 0)) + if ((l = KBD_LANG_DE, strcasecmp (value, _T("de")) == 0) + || (l = KBD_LANG_DK, strcasecmp (value, _T("dk")) == 0) + || (l = KBD_LANG_SE, strcasecmp (value, _T("se")) == 0) + || (l = KBD_LANG_US, strcasecmp (value, _T("us")) == 0) + || (l = KBD_LANG_FR, strcasecmp (value, _T("fr")) == 0) + || (l = KBD_LANG_IT, strcasecmp (value, _T("it")) == 0) + || (l = KBD_LANG_ES, strcasecmp (value, _T("es")) == 0)) p->keyboard_lang = l; else - write_log (L"Unknown keyboard language\n"); + write_log (_T("Unknown keyboard language\n")); return 1; } - if (cfgfile_string (option, value, L"config_version", tmpbuf, sizeof (tmpbuf) / sizeof (TCHAR))) { + if (cfgfile_string (option, value, _T("config_version"), tmpbuf, sizeof (tmpbuf) / sizeof (TCHAR))) { TCHAR *tmpp2; tmpp = _tcschr (value, '.'); if (tmpp) { @@ -1907,23 +1907,23 @@ static int cfgfile_parse_host (struct uae_prefs *p, TCHAR *option, TCHAR *value) return 1; } - if (cfgfile_string (option, value, L"keyboard_leds", tmpbuf, sizeof (tmpbuf) / sizeof (TCHAR))) { + if (cfgfile_string (option, value, _T("keyboard_leds"), tmpbuf, sizeof (tmpbuf) / sizeof (TCHAR))) { TCHAR *tmpp2 = tmpbuf; int i, num; p->keyboard_leds[0] = p->keyboard_leds[1] = p->keyboard_leds[2] = 0; p->keyboard_leds_in_use = 0; - _tcscat (tmpbuf, L","); + _tcscat (tmpbuf, _T(",")); for (i = 0; i < 3; i++) { tmpp = _tcschr (tmpp2, ':'); if (!tmpp) break; *tmpp++= 0; num = -1; - if (!strcasecmp (tmpp2, L"numlock")) + if (!strcasecmp (tmpp2, _T("numlock"))) num = 0; - if (!strcasecmp (tmpp2, L"capslock")) + if (!strcasecmp (tmpp2, _T("capslock"))) num = 1; - if (!strcasecmp (tmpp2, L"scrolllock")) + if (!strcasecmp (tmpp2, _T("scrolllock"))) num = 2; tmpp2 = tmpp; tmpp = _tcschr (tmpp2, ','); @@ -1940,7 +1940,7 @@ static int cfgfile_parse_host (struct uae_prefs *p, TCHAR *option, TCHAR *value) return 1; } - if (_tcscmp (option, L"displaydata") == 0 || _tcscmp (option, L"displaydata_pal") == 0 || _tcscmp (option, L"displaydata_ntsc") == 0) { + if (_tcscmp (option, _T("displaydata")) == 0 || _tcscmp (option, _T("displaydata_pal")) == 0 || _tcscmp (option, _T("displaydata_ntsc")) == 0) { _tcsncpy (tmpbuf, value, sizeof tmpbuf / sizeof (TCHAR) - 1); tmpbuf[sizeof tmpbuf / sizeof (TCHAR) - 1] = '\0'; @@ -1966,37 +1966,37 @@ static int cfgfile_parse_host (struct uae_prefs *p, TCHAR *option, TCHAR *value) if (rate < 0) rate = _tstof (tmpp); - else if (!_tcsnicmp (tmpp, L"v=", 2)) + else if (!_tcsnicmp (tmpp, _T("v="), 2)) vert = _tstol (equals); - else if (!_tcsnicmp (tmpp, L"h=", 2)) + else if (!_tcsnicmp (tmpp, _T("h="), 2)) horiz = _tstol (equals); - else if (!_tcsnicmp (tmpp, L"t=", 2)) + else if (!_tcsnicmp (tmpp, _T("t="), 2)) _tcsncpy (label, equals, sizeof label / sizeof (TCHAR) - 1); else if (equals) { if (_tcslen (cmd) + _tcslen (tmpp) + 2 < sizeof (cmd) / sizeof(TCHAR)) { _tcscat (cmd, tmpp); - _tcscat (cmd, L"\n"); + _tcscat (cmd, _T("\n")); } } - if (!_tcsnicmp (tmpp, L"locked", 4)) + if (!_tcsnicmp (tmpp, _T("locked"), 4)) locked = true; - if (!_tcsnicmp (tmpp, L"nlace", 5)) + if (!_tcsnicmp (tmpp, _T("nlace"), 5)) lace = 0; - if (!_tcsnicmp (tmpp, L"lace", 4)) + if (!_tcsnicmp (tmpp, _T("lace"), 4)) lace = 1; - if (!_tcsnicmp (tmpp, L"nvsync", 5)) + if (!_tcsnicmp (tmpp, _T("nvsync"), 5)) vsync = 0; - if (!_tcsnicmp (tmpp, L"vsync", 4)) + if (!_tcsnicmp (tmpp, _T("vsync"), 4)) vsync = 1; - if (!_tcsnicmp (tmpp, L"ntsc", 4)) + if (!_tcsnicmp (tmpp, _T("ntsc"), 4)) ntsc = 1; - if (!_tcsnicmp (tmpp, L"pal", 3)) + if (!_tcsnicmp (tmpp, _T("pal"), 3)) ntsc = 0; - if (!_tcsnicmp (tmpp, L"lof", 3)) + if (!_tcsnicmp (tmpp, _T("lof"), 3)) framelength = 1; - if (!_tcsnicmp (tmpp, L"shf", 3)) + if (!_tcsnicmp (tmpp, _T("shf"), 3)) framelength = 0; - if (!_tcsnicmp (tmpp, L"rtg", 3)) + if (!_tcsnicmp (tmpp, _T("rtg"), 3)) rtg = true; tmpp = next; if (tmpp >= end) @@ -2005,14 +2005,14 @@ static int cfgfile_parse_host (struct uae_prefs *p, TCHAR *option, TCHAR *value) } if (rate > 0) { for (int i = 0; i < MAX_CHIPSET_REFRESH; i++) { - if (_tcscmp (option, L"displaydata_pal") == 0) { + if (_tcscmp (option, _T("displaydata_pal")) == 0) { i = CHIPSET_REFRESH_PAL; p->cr[i].rate = -1; - _tcscpy (label, L"PAL"); - } else if (_tcscmp (option, L"displaydata_ntsc") == 0) { + _tcscpy (label, _T("PAL")); + } else if (_tcscmp (option, _T("displaydata_ntsc")) == 0) { i = CHIPSET_REFRESH_NTSC; p->cr[i].rate = -1; - _tcscpy (label, L"NTSC"); + _tcscpy (label, _T("NTSC")); } if (p->cr[i].rate <= 0) { p->cr[i].horiz = horiz; @@ -2085,7 +2085,7 @@ static void decode_rom_ident (TCHAR *romfile, int maxlen, const TCHAR *ident, in TCHAR romname[MAX_DPATH]; getromname(rl[i]->rd, romname); _tcscat (romtxt, romname); - _tcscat (romtxt, L"\n"); + _tcscat (romtxt, _T("\n")); } else { _tcsncpy (romfile, rl[i]->path, maxlen); goto end; @@ -2137,9 +2137,9 @@ struct uaedev_config_info *add_filesys_config (struct uae_prefs *p, int index, return 0; uci->ishdf = volname == NULL ? 1 : 0; - _tcscpy (uci->devname, devname ? devname : L""); - _tcscpy (uci->volname, volname ? volname : L""); - _tcscpy (uci->rootdir, rootdir ? rootdir : L""); + _tcscpy (uci->devname, devname ? devname : _T("")); + _tcscpy (uci->volname, volname ? volname : _T("")); + _tcscpy (uci->rootdir, rootdir ? rootdir : _T("")); validatedevicename (uci->devname); validatevolumename (uci->volname); uci->readonly = readonly; @@ -2155,18 +2155,18 @@ struct uaedev_config_info *add_filesys_config (struct uae_prefs *p, int index, else if (bootpri >= -127) uci->autoboot = 1; uci->controller = hdc; - _tcscpy (uci->filesys, filesysdir ? filesysdir : L""); + _tcscpy (uci->filesys, filesysdir ? filesysdir : _T("")); if (!uci->devname[0]) { TCHAR base[32]; TCHAR base2[32]; int num = 0; if (uci->rootdir[0] == 0 && !uci->ishdf) - _tcscpy (base, L"RDH"); + _tcscpy (base, _T("RDH")); else - _tcscpy (base, L"DH"); + _tcscpy (base, _T("DH")); _tcscpy (base2, base); for (i = 0; i < p->mountitems; i++) { - _stprintf (base2, L"%s%d", base, num); + _stprintf (base2, _T("%s%d"), base, num); if (!_tcscmp(base2, p->mountconfig[i].devname)) { num++; i = -1; @@ -2176,7 +2176,7 @@ struct uaedev_config_info *add_filesys_config (struct uae_prefs *p, int index, _tcscpy (uci->devname, base2); validatedevicename (uci->devname); } - s = filesys_createvolname (volname, rootdir, L"Harddrive"); + s = filesys_createvolname (volname, rootdir, _T("Harddrive")); _tcscpy (uci->volname, s); xfree (s); return uci; @@ -2205,179 +2205,179 @@ static int cfgfile_parse_hardware (struct uae_prefs *p, const TCHAR *option, TCH TCHAR *section = 0; TCHAR tmpbuf[CONFIG_BLEN]; - if (cfgfile_yesno (option, value, L"cpu_cycle_exact", &p->cpu_cycle_exact) - || cfgfile_yesno (option, value, L"blitter_cycle_exact", &p->blitter_cycle_exact)) { + if (cfgfile_yesno (option, value, _T("cpu_cycle_exact"), &p->cpu_cycle_exact) + || cfgfile_yesno (option, value, _T("blitter_cycle_exact"), &p->blitter_cycle_exact)) { if (p->cpu_model >= 68020 && p->cachesize > 0) p->cpu_cycle_exact = p->blitter_cycle_exact = 0; /* we don't want cycle-exact in 68020/40+JIT modes */ return 1; } - if (cfgfile_yesno (option, value, L"cycle_exact", &tmpbool)) { + if (cfgfile_yesno (option, value, _T("cycle_exact"), &tmpbool)) { p->cpu_cycle_exact = p->blitter_cycle_exact = tmpbool; if (p->cpu_model >= 68020 && p->cachesize > 0) p->cpu_cycle_exact = p->blitter_cycle_exact = false; return 1; } - if (cfgfile_string (option, value, L"cpu_multiplier", tmpbuf, sizeof tmpbuf / sizeof (TCHAR))) { + if (cfgfile_string (option, value, _T("cpu_multiplier"), tmpbuf, sizeof tmpbuf / sizeof (TCHAR))) { p->cpu_clock_multiplier = (int)(_tstof (tmpbuf) * 256.0); return 1; } - if (cfgfile_yesno (option, value, L"scsi_a3000", &dummybool)) { + if (cfgfile_yesno (option, value, _T("scsi_a3000"), &dummybool)) { if (dummybool) p->cs_mbdmac = 1; return 1; } - if (cfgfile_yesno (option, value, L"scsi_a4000t", &dummybool)) { + if (cfgfile_yesno (option, value, _T("scsi_a4000t"), &dummybool)) { if (dummybool) p->cs_mbdmac = 2; return 1; } - if (cfgfile_string (option, value, L"a2065", p->a2065name, sizeof p->a2065name / sizeof (TCHAR))) + if (cfgfile_string (option, value, _T("a2065"), p->a2065name, sizeof p->a2065name / sizeof (TCHAR))) return 1; - if (cfgfile_yesno (option, value, L"immediate_blits", &p->immediate_blits) - || cfgfile_yesno (option, value, L"waiting_blits", &p->waiting_blits) - || cfgfile_yesno (option, value, L"cd32cd", &p->cs_cd32cd) - || cfgfile_yesno (option, value, L"cd32c2p", &p->cs_cd32c2p) - || cfgfile_yesno (option, value, L"cd32nvram", &p->cs_cd32nvram) - || cfgfile_yesno (option, value, L"cdtvcd", &p->cs_cdtvcd) - || cfgfile_yesno (option, value, L"cdtvram", &p->cs_cdtvram) - || cfgfile_yesno (option, value, L"a1000ram", &p->cs_a1000ram) - || cfgfile_yesno (option, value, L"pcmcia", &p->cs_pcmcia) - || cfgfile_yesno (option, value, L"scsi_cdtv", &p->cs_cdtvscsi) - || cfgfile_yesno (option, value, L"scsi_a4091", &p->cs_a4091) - || cfgfile_yesno (option, value, L"scsi_a2091", &p->cs_a2091) - || cfgfile_yesno (option, value, L"cia_overlay", &p->cs_ciaoverlay) - || cfgfile_yesno (option, value, L"bogomem_fast", &p->cs_slowmemisfast) - || cfgfile_yesno (option, value, L"ksmirror_e0", &p->cs_ksmirror_e0) - || cfgfile_yesno (option, value, L"ksmirror_a8", &p->cs_ksmirror_a8) - || cfgfile_yesno (option, value, L"resetwarning", &p->cs_resetwarning) - || cfgfile_yesno (option, value, L"denise_noehb", &p->cs_denisenoehb) - || cfgfile_yesno (option, value, L"ics_agnus", &p->cs_dipagnus) - || cfgfile_yesno (option, value, L"agnus_bltbusybug", &p->cs_agnusbltbusybug) - || cfgfile_yesno (option, value, L"fastmem_autoconfig", &p->fastmem_autoconfig) - - || cfgfile_yesno (option, value, L"kickshifter", &p->kickshifter) - || cfgfile_yesno (option, value, L"ntsc", &p->ntscmode) - || cfgfile_yesno (option, value, L"sana2", &p->sana2) - || cfgfile_yesno (option, value, L"genlock", &p->genlock) - || cfgfile_yesno (option, value, L"cpu_compatible", &p->cpu_compatible) - || cfgfile_yesno (option, value, L"cpu_24bit_addressing", &p->address_space_24) - || cfgfile_yesno (option, value, L"parallel_on_demand", &p->parallel_demand) - || cfgfile_yesno (option, value, L"parallel_postscript_emulation", &p->parallel_postscript_emulation) - || cfgfile_yesno (option, value, L"parallel_postscript_detection", &p->parallel_postscript_detection) - || cfgfile_yesno (option, value, L"serial_on_demand", &p->serial_demand) - || cfgfile_yesno (option, value, L"serial_hardware_ctsrts", &p->serial_hwctsrts) - || cfgfile_yesno (option, value, L"serial_direct", &p->serial_direct) - || cfgfile_yesno (option, value, L"comp_nf", &p->compnf) - || cfgfile_yesno (option, value, L"comp_constjump", &p->comp_constjump) - || cfgfile_yesno (option, value, L"comp_oldsegv", &p->comp_oldsegv) - || cfgfile_yesno (option, value, L"compforcesettings", &dummybool) - || cfgfile_yesno (option, value, L"compfpu", &p->compfpu) - || cfgfile_yesno (option, value, L"fpu_strict", &p->fpu_strict) - || cfgfile_yesno (option, value, L"comp_midopt", &p->comp_midopt) - || cfgfile_yesno (option, value, L"comp_lowopt", &p->comp_lowopt) - || cfgfile_yesno (option, value, L"rtg_nocustom", &p->picasso96_nocustom) - || cfgfile_yesno (option, value, L"floppy_write_protected", &p->floppy_read_only) - || cfgfile_yesno (option, value, L"uaeserial", &p->uaeserial)) + if (cfgfile_yesno (option, value, _T("immediate_blits"), &p->immediate_blits) + || cfgfile_yesno (option, value, _T("waiting_blits"), &p->waiting_blits) + || cfgfile_yesno (option, value, _T("cd32cd"), &p->cs_cd32cd) + || cfgfile_yesno (option, value, _T("cd32c2p"), &p->cs_cd32c2p) + || cfgfile_yesno (option, value, _T("cd32nvram"), &p->cs_cd32nvram) + || cfgfile_yesno (option, value, _T("cdtvcd"), &p->cs_cdtvcd) + || cfgfile_yesno (option, value, _T("cdtvram"), &p->cs_cdtvram) + || cfgfile_yesno (option, value, _T("a1000ram"), &p->cs_a1000ram) + || cfgfile_yesno (option, value, _T("pcmcia"), &p->cs_pcmcia) + || cfgfile_yesno (option, value, _T("scsi_cdtv"), &p->cs_cdtvscsi) + || cfgfile_yesno (option, value, _T("scsi_a4091"), &p->cs_a4091) + || cfgfile_yesno (option, value, _T("scsi_a2091"), &p->cs_a2091) + || cfgfile_yesno (option, value, _T("cia_overlay"), &p->cs_ciaoverlay) + || cfgfile_yesno (option, value, _T("bogomem_fast"), &p->cs_slowmemisfast) + || cfgfile_yesno (option, value, _T("ksmirror_e0"), &p->cs_ksmirror_e0) + || cfgfile_yesno (option, value, _T("ksmirror_a8"), &p->cs_ksmirror_a8) + || cfgfile_yesno (option, value, _T("resetwarning"), &p->cs_resetwarning) + || cfgfile_yesno (option, value, _T("denise_noehb"), &p->cs_denisenoehb) + || cfgfile_yesno (option, value, _T("ics_agnus"), &p->cs_dipagnus) + || cfgfile_yesno (option, value, _T("agnus_bltbusybug"), &p->cs_agnusbltbusybug) + || cfgfile_yesno (option, value, _T("fastmem_autoconfig"), &p->fastmem_autoconfig) + + || cfgfile_yesno (option, value, _T("kickshifter"), &p->kickshifter) + || cfgfile_yesno (option, value, _T("ntsc"), &p->ntscmode) + || cfgfile_yesno (option, value, _T("sana2"), &p->sana2) + || cfgfile_yesno (option, value, _T("genlock"), &p->genlock) + || cfgfile_yesno (option, value, _T("cpu_compatible"), &p->cpu_compatible) + || cfgfile_yesno (option, value, _T("cpu_24bit_addressing"), &p->address_space_24) + || cfgfile_yesno (option, value, _T("parallel_on_demand"), &p->parallel_demand) + || cfgfile_yesno (option, value, _T("parallel_postscript_emulation"), &p->parallel_postscript_emulation) + || cfgfile_yesno (option, value, _T("parallel_postscript_detection"), &p->parallel_postscript_detection) + || cfgfile_yesno (option, value, _T("serial_on_demand"), &p->serial_demand) + || cfgfile_yesno (option, value, _T("serial_hardware_ctsrts"), &p->serial_hwctsrts) + || cfgfile_yesno (option, value, _T("serial_direct"), &p->serial_direct) + || cfgfile_yesno (option, value, _T("comp_nf"), &p->compnf) + || cfgfile_yesno (option, value, _T("comp_constjump"), &p->comp_constjump) + || cfgfile_yesno (option, value, _T("comp_oldsegv"), &p->comp_oldsegv) + || cfgfile_yesno (option, value, _T("compforcesettings"), &dummybool) + || cfgfile_yesno (option, value, _T("compfpu"), &p->compfpu) + || cfgfile_yesno (option, value, _T("fpu_strict"), &p->fpu_strict) + || cfgfile_yesno (option, value, _T("comp_midopt"), &p->comp_midopt) + || cfgfile_yesno (option, value, _T("comp_lowopt"), &p->comp_lowopt) + || cfgfile_yesno (option, value, _T("rtg_nocustom"), &p->picasso96_nocustom) + || cfgfile_yesno (option, value, _T("floppy_write_protected"), &p->floppy_read_only) + || cfgfile_yesno (option, value, _T("uaeserial"), &p->uaeserial)) return 1; - if (cfgfile_intval (option, value, L"cachesize", &p->cachesize, 1) - || cfgfile_intval (option, value, L"serial_stopbits", &p->serial_stopbits, 1) - || cfgfile_intval (option, value, L"cpu060_revision", &p->cpu060_revision, 1) - || cfgfile_intval (option, value, L"fpu_revision", &p->fpu_revision, 1) - || cfgfile_intval (option, value, L"cdtvramcard", &p->cs_cdtvcard, 1) - || cfgfile_intval (option, value, L"fatgary", &p->cs_fatgaryrev, 1) - || cfgfile_intval (option, value, L"ramsey", &p->cs_ramseyrev, 1) - || cfgfile_doubleval (option, value, L"chipset_refreshrate", &p->chipset_refreshrate) - || cfgfile_intval (option, value, L"fastmem_size", &p->fastmem_size, 0x100000) - || cfgfile_intval (option, value, L"fastmem2_size", &p->fastmem2_size, 0x100000) - || cfgfile_intval (option, value, L"a3000mem_size", &p->mbresmem_low_size, 0x100000) - || cfgfile_intval (option, value, L"mbresmem_size", &p->mbresmem_high_size, 0x100000) - || cfgfile_intval (option, value, L"z3mem_size", &p->z3fastmem_size, 0x100000) - || cfgfile_intval (option, value, L"z3mem2_size", &p->z3fastmem2_size, 0x100000) - || cfgfile_intval (option, value, L"megachipmem_size", &p->z3chipmem_size, 0x100000) - || cfgfile_intval (option, value, L"z3mem_start", &p->z3fastmem_start, 1) - || cfgfile_intval (option, value, L"bogomem_size", &p->bogomem_size, 0x40000) - || cfgfile_intval (option, value, L"gfxcard_size", &p->rtgmem_size, 0x100000) - || cfgfile_strval (option, value, L"gfxcard_type", &p->rtgmem_type, rtgtype, 0) - || cfgfile_intval (option, value, L"rtg_modes", &p->picasso96_modeflags, 1) - || cfgfile_intval (option, value, L"floppy_speed", &p->floppy_speed, 1) - || cfgfile_intval (option, value, L"floppy_write_length", &p->floppy_write_length, 1) - || cfgfile_intval (option, value, L"floppy_random_bits_min", &p->floppy_random_bits_min, 1) - || cfgfile_intval (option, value, L"floppy_random_bits_max", &p->floppy_random_bits_max, 1) - || cfgfile_intval (option, value, L"nr_floppies", &p->nr_floppies, 1) - || cfgfile_intval (option, value, L"floppy0type", &p->floppyslots[0].dfxtype, 1) - || cfgfile_intval (option, value, L"floppy1type", &p->floppyslots[1].dfxtype, 1) - || cfgfile_intval (option, value, L"floppy2type", &p->floppyslots[2].dfxtype, 1) - || cfgfile_intval (option, value, L"floppy3type", &p->floppyslots[3].dfxtype, 1) - || cfgfile_intval (option, value, L"maprom", &p->maprom, 1) - || cfgfile_intval (option, value, L"parallel_autoflush", &p->parallel_autoflush_time, 1) - || cfgfile_intval (option, value, L"uae_hide", &p->uae_hide, 1) - || cfgfile_intval (option, value, L"cpu_frequency", &p->cpu_frequency, 1) - || cfgfile_intval (option, value, L"kickstart_ext_rom_file2addr", &p->romextfile2addr, 1) - || cfgfile_intval (option, value, L"catweasel", &p->catweasel, 1)) + if (cfgfile_intval (option, value, _T("cachesize"), &p->cachesize, 1) + || cfgfile_intval (option, value, _T("serial_stopbits"), &p->serial_stopbits, 1) + || cfgfile_intval (option, value, _T("cpu060_revision"), &p->cpu060_revision, 1) + || cfgfile_intval (option, value, _T("fpu_revision"), &p->fpu_revision, 1) + || cfgfile_intval (option, value, _T("cdtvramcard"), &p->cs_cdtvcard, 1) + || cfgfile_intval (option, value, _T("fatgary"), &p->cs_fatgaryrev, 1) + || cfgfile_intval (option, value, _T("ramsey"), &p->cs_ramseyrev, 1) + || cfgfile_doubleval (option, value, _T("chipset_refreshrate"), &p->chipset_refreshrate) + || cfgfile_intval (option, value, _T("fastmem_size"), &p->fastmem_size, 0x100000) + || cfgfile_intval (option, value, _T("fastmem2_size"), &p->fastmem2_size, 0x100000) + || cfgfile_intval (option, value, _T("a3000mem_size"), &p->mbresmem_low_size, 0x100000) + || cfgfile_intval (option, value, _T("mbresmem_size"), &p->mbresmem_high_size, 0x100000) + || cfgfile_intval (option, value, _T("z3mem_size"), &p->z3fastmem_size, 0x100000) + || cfgfile_intval (option, value, _T("z3mem2_size"), &p->z3fastmem2_size, 0x100000) + || cfgfile_intval (option, value, _T("megachipmem_size"), &p->z3chipmem_size, 0x100000) + || cfgfile_intval (option, value, _T("z3mem_start"), &p->z3fastmem_start, 1) + || cfgfile_intval (option, value, _T("bogomem_size"), &p->bogomem_size, 0x40000) + || cfgfile_intval (option, value, _T("gfxcard_size"), &p->rtgmem_size, 0x100000) + || cfgfile_strval (option, value, _T("gfxcard_type"), &p->rtgmem_type, rtgtype, 0) + || cfgfile_intval (option, value, _T("rtg_modes"), &p->picasso96_modeflags, 1) + || cfgfile_intval (option, value, _T("floppy_speed"), &p->floppy_speed, 1) + || cfgfile_intval (option, value, _T("floppy_write_length"), &p->floppy_write_length, 1) + || cfgfile_intval (option, value, _T("floppy_random_bits_min"), &p->floppy_random_bits_min, 1) + || cfgfile_intval (option, value, _T("floppy_random_bits_max"), &p->floppy_random_bits_max, 1) + || cfgfile_intval (option, value, _T("nr_floppies"), &p->nr_floppies, 1) + || cfgfile_intval (option, value, _T("floppy0type"), &p->floppyslots[0].dfxtype, 1) + || cfgfile_intval (option, value, _T("floppy1type"), &p->floppyslots[1].dfxtype, 1) + || cfgfile_intval (option, value, _T("floppy2type"), &p->floppyslots[2].dfxtype, 1) + || cfgfile_intval (option, value, _T("floppy3type"), &p->floppyslots[3].dfxtype, 1) + || cfgfile_intval (option, value, _T("maprom"), &p->maprom, 1) + || cfgfile_intval (option, value, _T("parallel_autoflush"), &p->parallel_autoflush_time, 1) + || cfgfile_intval (option, value, _T("uae_hide"), &p->uae_hide, 1) + || cfgfile_intval (option, value, _T("cpu_frequency"), &p->cpu_frequency, 1) + || cfgfile_intval (option, value, _T("kickstart_ext_rom_file2addr"), &p->romextfile2addr, 1) + || cfgfile_intval (option, value, _T("catweasel"), &p->catweasel, 1)) return 1; - if (cfgfile_strval (option, value, L"comp_trustbyte", &p->comptrustbyte, compmode, 0) - || cfgfile_strval (option, value, L"chipset_compatible", &p->cs_compatible, cscompa, 0) - || cfgfile_strval (option, value, L"rtc", &p->cs_rtc, rtctype, 0) - || cfgfile_strval (option, value, L"ciaatod", &p->cs_ciaatod, ciaatodmode, 0) - || cfgfile_strval (option, value, L"ide", &p->cs_ide, idemode, 0) - || cfgfile_strval (option, value, L"scsi", &p->scsi, scsimode, 0) - || cfgfile_strval (option, value, L"comp_trustword", &p->comptrustword, compmode, 0) - || cfgfile_strval (option, value, L"comp_trustlong", &p->comptrustlong, compmode, 0) - || cfgfile_strval (option, value, L"comp_trustnaddr", &p->comptrustnaddr, compmode, 0) - || cfgfile_strval (option, value, L"collision_level", &p->collision_level, collmode, 0) - || cfgfile_strval (option, value, L"parallel_matrix_emulation", &p->parallel_matrix_emulation, epsonprinter, 0) - || cfgfile_strval (option, value, L"monitoremu", &p->monitoremu, specialmonitors, 0) - || cfgfile_strboolval (option, value, L"comp_flushmode", &p->comp_hardflush, flushmode, 0)) + if (cfgfile_strval (option, value, _T("comp_trustbyte"), &p->comptrustbyte, compmode, 0) + || cfgfile_strval (option, value, _T("chipset_compatible"), &p->cs_compatible, cscompa, 0) + || cfgfile_strval (option, value, _T("rtc"), &p->cs_rtc, rtctype, 0) + || cfgfile_strval (option, value, _T("ciaatod"), &p->cs_ciaatod, ciaatodmode, 0) + || cfgfile_strval (option, value, _T("ide"), &p->cs_ide, idemode, 0) + || cfgfile_strval (option, value, _T("scsi"), &p->scsi, scsimode, 0) + || cfgfile_strval (option, value, _T("comp_trustword"), &p->comptrustword, compmode, 0) + || cfgfile_strval (option, value, _T("comp_trustlong"), &p->comptrustlong, compmode, 0) + || cfgfile_strval (option, value, _T("comp_trustnaddr"), &p->comptrustnaddr, compmode, 0) + || cfgfile_strval (option, value, _T("collision_level"), &p->collision_level, collmode, 0) + || cfgfile_strval (option, value, _T("parallel_matrix_emulation"), &p->parallel_matrix_emulation, epsonprinter, 0) + || cfgfile_strval (option, value, _T("monitoremu"), &p->monitoremu, specialmonitors, 0) + || cfgfile_strboolval (option, value, _T("comp_flushmode"), &p->comp_hardflush, flushmode, 0)) return 1; - if (cfgfile_path (option, value, L"kickstart_rom_file", p->romfile, sizeof p->romfile / sizeof (TCHAR), &p->path_rom) - || cfgfile_path (option, value, L"kickstart_ext_rom_file", p->romextfile, sizeof p->romextfile / sizeof (TCHAR), &p->path_rom) - || cfgfile_path (option, value, L"kickstart_ext_rom_file2", p->romextfile2, sizeof p->romextfile2 / sizeof (TCHAR), &p->path_rom) - || cfgfile_rom (option, value, L"kickstart_rom_file_id", p->romfile, sizeof p->romfile / sizeof (TCHAR)) - || cfgfile_rom (option, value, L"kickstart_ext_rom_file_id", p->romextfile, sizeof p->romextfile / sizeof (TCHAR)) - || cfgfile_path (option, value, L"amax_rom_file", p->amaxromfile, sizeof p->amaxromfile / sizeof (TCHAR)) - || cfgfile_path (option, value, L"flash_file", p->flashfile, sizeof p->flashfile / sizeof (TCHAR), &p->path_rom) - || cfgfile_path (option, value, L"cart_file", p->cartfile, sizeof p->cartfile / sizeof (TCHAR), &p->path_rom) - || cfgfile_string (option, value, L"pci_devices", p->pci_devices, sizeof p->pci_devices / sizeof (TCHAR)) - || cfgfile_string (option, value, L"ghostscript_parameters", p->ghostscript_parameters, sizeof p->ghostscript_parameters / sizeof (TCHAR))) + if (cfgfile_path (option, value, _T("kickstart_rom_file"), p->romfile, sizeof p->romfile / sizeof (TCHAR), &p->path_rom) + || cfgfile_path (option, value, _T("kickstart_ext_rom_file"), p->romextfile, sizeof p->romextfile / sizeof (TCHAR), &p->path_rom) + || cfgfile_path (option, value, _T("kickstart_ext_rom_file2"), p->romextfile2, sizeof p->romextfile2 / sizeof (TCHAR), &p->path_rom) + || cfgfile_rom (option, value, _T("kickstart_rom_file_id"), p->romfile, sizeof p->romfile / sizeof (TCHAR)) + || cfgfile_rom (option, value, _T("kickstart_ext_rom_file_id"), p->romextfile, sizeof p->romextfile / sizeof (TCHAR)) + || cfgfile_path (option, value, _T("amax_rom_file"), p->amaxromfile, sizeof p->amaxromfile / sizeof (TCHAR)) + || cfgfile_path (option, value, _T("flash_file"), p->flashfile, sizeof p->flashfile / sizeof (TCHAR), &p->path_rom) + || cfgfile_path (option, value, _T("cart_file"), p->cartfile, sizeof p->cartfile / sizeof (TCHAR), &p->path_rom) + || cfgfile_string (option, value, _T("pci_devices"), p->pci_devices, sizeof p->pci_devices / sizeof (TCHAR)) + || cfgfile_string (option, value, _T("ghostscript_parameters"), p->ghostscript_parameters, sizeof p->ghostscript_parameters / sizeof (TCHAR))) return 1; - if (cfgfile_strval (option, value, L"cart_internal", &p->cart_internal, cartsmode, 0)) { + if (cfgfile_strval (option, value, _T("cart_internal"), &p->cart_internal, cartsmode, 0)) { if (p->cart_internal) { struct romdata *rd = getromdatabyid (63); if (rd) - _stprintf (p->cartfile, L":%s", rd->configname); + _stprintf (p->cartfile, _T(":%s"), rd->configname); } return 1; } - if (cfgfile_string (option, value, L"kickstart_rom", p->romident, sizeof p->romident / sizeof (TCHAR))) { + if (cfgfile_string (option, value, _T("kickstart_rom"), p->romident, sizeof p->romident / sizeof (TCHAR))) { decode_rom_ident (p->romfile, sizeof p->romfile / sizeof (TCHAR), p->romident, ROMTYPE_ALL_KICK); return 1; } - if (cfgfile_string (option, value, L"kickstart_ext_rom", p->romextident, sizeof p->romextident / sizeof (TCHAR))) { + if (cfgfile_string (option, value, _T("kickstart_ext_rom"), p->romextident, sizeof p->romextident / sizeof (TCHAR))) { decode_rom_ident (p->romextfile, sizeof p->romextfile / sizeof (TCHAR), p->romextident, ROMTYPE_ALL_EXT); return 1; } - if (cfgfile_string (option, value, L"cart", p->cartident, sizeof p->cartident / sizeof (TCHAR))) { + if (cfgfile_string (option, value, _T("cart"), p->cartident, sizeof p->cartident / sizeof (TCHAR))) { decode_rom_ident (p->cartfile, sizeof p->cartfile / sizeof (TCHAR), p->cartident, ROMTYPE_ALL_CART); return 1; } for (i = 0; i < 4; i++) { - _stprintf (tmpbuf, L"floppy%d", i); + _stprintf (tmpbuf, _T("floppy%d"), i); if (cfgfile_path (option, value, tmpbuf, p->floppyslots[i].df, sizeof p->floppyslots[i].df / sizeof (TCHAR), &p->path_floppy)) return 1; } - if (cfgfile_intval (option, value, L"chipmem_size", &dummyint, 1)) { + if (cfgfile_intval (option, value, _T("chipmem_size"), &dummyint, 1)) { if (dummyint < 0) p->chipmem_size = 0x20000; /* 128k, prototype support */ else if (dummyint == 0) @@ -2387,61 +2387,61 @@ static int cfgfile_parse_hardware (struct uae_prefs *p, const TCHAR *option, TCH return 1; } - if (cfgfile_string (option, value, L"addmem1", tmpbuf, sizeof tmpbuf / sizeof (TCHAR))) { + if (cfgfile_string (option, value, _T("addmem1"), tmpbuf, sizeof tmpbuf / sizeof (TCHAR))) { parse_addmem (p, tmpbuf, 0); return 1; } - if (cfgfile_string (option, value, L"addmem2", tmpbuf, sizeof tmpbuf / sizeof (TCHAR))) { + if (cfgfile_string (option, value, _T("addmem2"), tmpbuf, sizeof tmpbuf / sizeof (TCHAR))) { parse_addmem (p, tmpbuf, 1); return 1; } - if (cfgfile_strval (option, value, L"chipset", &tmpval, csmode, 0)) { + if (cfgfile_strval (option, value, _T("chipset"), &tmpval, csmode, 0)) { set_chipset_mask (p, tmpval); return 1; } - if (cfgfile_string (option, value, L"mmu_model", tmpbuf, sizeof tmpbuf / sizeof (TCHAR))) { + if (cfgfile_string (option, value, _T("mmu_model"), tmpbuf, sizeof tmpbuf / sizeof (TCHAR))) { p->mmu_model = _tstol (tmpbuf); return 1; } - if (cfgfile_string (option, value, L"fpu_model", tmpbuf, sizeof tmpbuf / sizeof (TCHAR))) { + if (cfgfile_string (option, value, _T("fpu_model"), tmpbuf, sizeof tmpbuf / sizeof (TCHAR))) { p->fpu_model = _tstol (tmpbuf); return 1; } - if (cfgfile_string (option, value, L"cpu_model", tmpbuf, sizeof tmpbuf / sizeof (TCHAR))) { + if (cfgfile_string (option, value, _T("cpu_model"), tmpbuf, sizeof tmpbuf / sizeof (TCHAR))) { p->cpu_model = _tstol (tmpbuf); p->fpu_model = 0; return 1; } /* old-style CPU configuration */ - if (cfgfile_string (option, value, L"cpu_type", tmpbuf, sizeof tmpbuf / sizeof (TCHAR))) { + if (cfgfile_string (option, value, _T("cpu_type"), tmpbuf, sizeof tmpbuf / sizeof (TCHAR))) { p->fpu_model = 0; p->address_space_24 = 0; p->cpu_model = 680000; - if (!_tcscmp (tmpbuf, L"68000")) { + if (!_tcscmp (tmpbuf, _T("68000"))) { p->cpu_model = 68000; - } else if (!_tcscmp (tmpbuf, L"68010")) { + } else if (!_tcscmp (tmpbuf, _T("68010"))) { p->cpu_model = 68010; - } else if (!_tcscmp (tmpbuf, L"68ec020")) { + } else if (!_tcscmp (tmpbuf, _T("68ec020"))) { p->cpu_model = 68020; p->address_space_24 = 1; - } else if (!_tcscmp (tmpbuf, L"68020")) { + } else if (!_tcscmp (tmpbuf, _T("68020"))) { p->cpu_model = 68020; - } else if (!_tcscmp (tmpbuf, L"68ec020/68881")) { + } else if (!_tcscmp (tmpbuf, _T("68ec020/68881"))) { p->cpu_model = 68020; p->fpu_model = 68881; p->address_space_24 = 1; - } else if (!_tcscmp (tmpbuf, L"68020/68881")) { + } else if (!_tcscmp (tmpbuf, _T("68020/68881"))) { p->cpu_model = 68020; p->fpu_model = 68881; - } else if (!_tcscmp (tmpbuf, L"68040")) { + } else if (!_tcscmp (tmpbuf, _T("68040"))) { p->cpu_model = 68040; p->fpu_model = 68040; - } else if (!_tcscmp (tmpbuf, L"68060")) { + } else if (!_tcscmp (tmpbuf, _T("68060"))) { p->cpu_model = 68060; p->fpu_model = 68060; } @@ -2449,37 +2449,37 @@ static int cfgfile_parse_hardware (struct uae_prefs *p, const TCHAR *option, TCH } if (p->config_version < (21 << 16)) { - if (cfgfile_strval (option, value, L"cpu_speed", &p->m68k_speed, speedmode, 1) + if (cfgfile_strval (option, value, _T("cpu_speed"), &p->m68k_speed, speedmode, 1) /* Broken earlier versions used to write this out as a string. */ - || cfgfile_strval (option, value, L"finegraincpu_speed", &p->m68k_speed, speedmode, 1)) + || cfgfile_strval (option, value, _T("finegraincpu_speed"), &p->m68k_speed, speedmode, 1)) { p->m68k_speed--; return 1; } } - if (cfgfile_intval (option, value, L"cpu_speed", &p->m68k_speed, 1)) { + if (cfgfile_intval (option, value, _T("cpu_speed"), &p->m68k_speed, 1)) { p->m68k_speed *= CYCLE_UNIT; return 1; } - if (cfgfile_intval (option, value, L"finegrain_cpu_speed", &p->m68k_speed, 1)) { + if (cfgfile_intval (option, value, _T("finegrain_cpu_speed"), &p->m68k_speed, 1)) { if (OFFICIAL_CYCLE_UNIT > CYCLE_UNIT) { int factor = OFFICIAL_CYCLE_UNIT / CYCLE_UNIT; p->m68k_speed = (p->m68k_speed + factor - 1) / factor; } - if (strcasecmp (value, L"max") == 0) + if (strcasecmp (value, _T("max")) == 0) p->m68k_speed = -1; return 1; } - if (cfgfile_intval (option, value, L"dongle", &p->dongle, 1)) { + if (cfgfile_intval (option, value, _T("dongle"), &p->dongle, 1)) { if (p->dongle == 0) - cfgfile_strval (option, value, L"dongle", &p->dongle, dongles, 0); + cfgfile_strval (option, value, _T("dongle"), &p->dongle, dongles, 0); return 1; } - if (strcasecmp (option, L"quickstart") == 0) { + if (strcasecmp (option, _T("quickstart")) == 0) { int model = 0; TCHAR *tmpp = _tcschr (value, ','); if (tmpp) { @@ -2498,13 +2498,13 @@ static int cfgfile_parse_hardware (struct uae_prefs *p, const TCHAR *option, TCH for (i = 0; i < MAX_FILESYSTEM_UNITS; i++) { TCHAR tmp[100]; - _stprintf (tmp, L"uaehf%d", i); + _stprintf (tmp, _T("uaehf%d"), i); if (_tcscmp (option, tmp) == 0) return 1; } - if (_tcscmp (option, L"filesystem") == 0 - || _tcscmp (option, L"hardfile") == 0) + if (_tcscmp (option, _T("filesystem")) == 0 + || _tcscmp (option, _T("hardfile")) == 0) { int secs, heads, reserved, bs; bool ro; @@ -2519,20 +2519,20 @@ static int cfgfile_parse_hardware (struct uae_prefs *p, const TCHAR *option, TCH goto invalid_fs; *tmpp++ = '\0'; - if (_tcscmp (value, L"1") == 0 || strcasecmp (value, L"ro") == 0 - || strcasecmp (value, L"readonly") == 0 - || strcasecmp (value, L"read-only") == 0) + if (_tcscmp (value, _T("1")) == 0 || strcasecmp (value, _T("ro")) == 0 + || strcasecmp (value, _T("readonly")) == 0 + || strcasecmp (value, _T("read-only")) == 0) ro = true; - else if (_tcscmp (value, L"0") == 0 || strcasecmp (value, L"rw") == 0 - || strcasecmp (value, L"readwrite") == 0 - || strcasecmp (value, L"read-write") == 0) + else if (_tcscmp (value, _T("0")) == 0 || strcasecmp (value, _T("rw")) == 0 + || strcasecmp (value, _T("readwrite")) == 0 + || strcasecmp (value, _T("read-write")) == 0) ro = false; else goto invalid_fs; secs = 0; heads = 0; reserved = 0; bs = 0; value = tmpp; - if (_tcscmp (option, L"filesystem") == 0) { + if (_tcscmp (option, _T("filesystem")) == 0) { tmpp = _tcschr (value, ':'); if (tmpp == 0) goto invalid_fs; @@ -2557,12 +2557,12 @@ static int cfgfile_parse_hardware (struct uae_prefs *p, const TCHAR *option, TCH } - if (_tcscmp (option, L"filesystem2") == 0 - || _tcscmp (option, L"hardfile2") == 0) + if (_tcscmp (option, _T("filesystem2")) == 0 + || _tcscmp (option, _T("hardfile2")) == 0) { int secs, heads, reserved, bs, bp, hdcv; bool ro; - TCHAR *dname = NULL, *aname = L"", *root = NULL, *fs = NULL, *hdc; + TCHAR *dname = NULL, *aname = _T(""), *root = NULL, *fs = NULL, *hdc; TCHAR *tmpp = _tcschr (value, ','); TCHAR *str = NULL; @@ -2571,9 +2571,9 @@ static int cfgfile_parse_hardware (struct uae_prefs *p, const TCHAR *option, TCH goto invalid_fs; *tmpp++ = '\0'; - if (strcasecmp (value, L"ro") == 0) + if (strcasecmp (value, _T("ro")) == 0) ro = true; - else if (strcasecmp (value, L"rw") == 0) + else if (strcasecmp (value, _T("rw")) == 0) ro = false; else goto invalid_fs; @@ -2581,7 +2581,7 @@ static int cfgfile_parse_hardware (struct uae_prefs *p, const TCHAR *option, TCH fs = 0; hdc = 0; hdcv = 0; value = tmpp; - if (_tcscmp (option, L"filesystem2") == 0) { + if (_tcscmp (option, _T("filesystem2")) == 0) { tmpp = _tcschr (value, ':'); if (tmpp == 0) goto empty_fs; @@ -2622,19 +2622,19 @@ static int cfgfile_parse_hardware (struct uae_prefs *p, const TCHAR *option, TCH if (tmpp != 0) { *tmpp++ = 0; hdc = tmpp; - if(_tcslen (hdc) >= 4 && !_tcsncmp (hdc, L"ide", 3)) { + if(_tcslen (hdc) >= 4 && !_tcsncmp (hdc, _T("ide"), 3)) { hdcv = hdc[3] - '0' + HD_CONTROLLER_IDE0; if (hdcv < HD_CONTROLLER_IDE0 || hdcv > HD_CONTROLLER_IDE3) hdcv = 0; } - if(_tcslen (hdc) >= 5 && !_tcsncmp (hdc, L"scsi", 4)) { + if(_tcslen (hdc) >= 5 && !_tcsncmp (hdc, _T("scsi"), 4)) { hdcv = hdc[4] - '0' + HD_CONTROLLER_SCSI0; if (hdcv < HD_CONTROLLER_SCSI0 || hdcv > HD_CONTROLLER_SCSI6) hdcv = 0; } - if (_tcslen (hdc) >= 6 && !_tcsncmp (hdc, L"scsram", 6)) + if (_tcslen (hdc) >= 6 && !_tcsncmp (hdc, _T("scsram"), 6)) hdcv = HD_CONTROLLER_PCMCIA_SRAM; - if (_tcslen (hdc) >= 5 && !_tcsncmp (hdc, L"scide", 6)) + if (_tcslen (hdc) >= 5 && !_tcsncmp (hdc, _T("scide"), 6)) hdcv = HD_CONTROLLER_PCMCIA_IDE; } } @@ -2654,7 +2654,7 @@ empty_fs: return 1; invalid_fs: - write_log (L"Invalid filesystem/hardfile specification.\n"); + write_log (_T("Invalid filesystem/hardfile specification.\n")); return 1; } @@ -2691,7 +2691,7 @@ static void calcformula (struct uae_prefs *prefs, TCHAR *in) } TCHAR store = in[i]; in[i] = 0; - //write_log (L"'%s'\n", start); + //write_log (_T("'%s'\n"), start); if (!getconfigstoreline (start, configvalue)) return; _tcscpy (p, configvalue); @@ -2714,7 +2714,7 @@ static void calcformula (struct uae_prefs *prefs, TCHAR *in) return; } if (calc (out, &val)) { - _stprintf (in, L"%d", (int)val); + _stprintf (in, _T("%d"), (int)val); updatestore = true; return; } @@ -2724,17 +2724,17 @@ int cfgfile_parse_option (struct uae_prefs *p, TCHAR *option, TCHAR *value, int { calcformula (p, value); - if (!_tcscmp (option, L"debug")) { - write_log (L"CONFIG DEBUG: '%s'\n", value); + if (!_tcscmp (option, _T("debug"))) { + write_log (_T("CONFIG DEBUG: '%s'\n"), value); return 1; } - if (!_tcscmp (option, L"config_hardware")) + if (!_tcscmp (option, _T("config_hardware"))) return 1; - if (!_tcscmp (option, L"config_host")) + if (!_tcscmp (option, _T("config_host"))) return 1; - if (cfgfile_path (option, value, L"config_hardware_path", p->config_hardware_path, sizeof p->config_hardware_path / sizeof (TCHAR))) + if (cfgfile_path (option, value, _T("config_hardware_path"), p->config_hardware_path, sizeof p->config_hardware_path / sizeof (TCHAR))) return 1; - if (cfgfile_path (option, value, L"config_host_path", p->config_host_path, sizeof p->config_host_path / sizeof (TCHAR))) + if (cfgfile_path (option, value, _T("config_host_path"), p->config_host_path, sizeof p->config_host_path / sizeof (TCHAR))) return 1; if (type == 0 || (type & CONFIG_TYPE_HARDWARE)) { if (cfgfile_parse_hardware (p, option, value)) @@ -2770,7 +2770,7 @@ static int cfgfile_separate_linea (const TCHAR *filename, char *line, TCHAR *lin line2 = strchr (line, '='); if (! line2) { TCHAR *s = au (line1); - write_log (L"CFGFILE: '%s', linea was incomplete with only %s\n", filename, s); + write_log (_T("CFGFILE: '%s', linea was incomplete with only %s\n"), filename, s); xfree (s); return 0; } @@ -2807,12 +2807,12 @@ static int cfgfile_separate_line (TCHAR *line, TCHAR *line1b, TCHAR *line2b) int i; line1 = line; - line1 += _tcsspn (line1, L"\t \r\n"); + line1 += _tcsspn (line1, _T("\t \r\n")); if (*line1 == ';') return 0; line2 = _tcschr (line, '='); if (! line2) { - write_log (L"CFGFILE: line was incomplete with only %s\n", line1); + write_log (_T("CFGFILE: line was incomplete with only %s\n"), line1); return 0; } *line2++ = '\0'; @@ -2822,13 +2822,13 @@ static int cfgfile_separate_line (TCHAR *line, TCHAR *line1b, TCHAR *line2b) while (i > 0 && (line2[i - 1] == '\t' || line2[i - 1] == ' ' || line2[i - 1] == '\r' || line2[i - 1] == '\n')) line2[--i] = '\0'; - line2 += _tcsspn (line2, L"\t \r\n"); + line2 += _tcsspn (line2, _T("\t \r\n")); _tcscpy (line2b, line2); i = _tcslen (line); while (i > 0 && (line[i - 1] == '\t' || line[i - 1] == ' ' || line[i - 1] == '\r' || line[i - 1] == '\n')) line[--i] = '\0'; - line += _tcsspn (line, L"\t \r\n"); + line += _tcsspn (line, _T("\t \r\n")); _tcscpy (line1b, line); if (line2b[0] == '"' || line2b[0] == '\"') { @@ -2850,19 +2850,19 @@ static int isobsolete (TCHAR *s) int i = 0; while (obsolete[i]) { if (!strcasecmp (s, obsolete[i])) { - write_log (L"obsolete config entry '%s'\n", s); + write_log (_T("obsolete config entry '%s'\n"), s); return 1; } i++; } - if (_tcslen (s) > 2 && !_tcsncmp (s, L"w.", 2)) + if (_tcslen (s) > 2 && !_tcsncmp (s, _T("w."), 2)) return 1; - if (_tcslen (s) >= 10 && !_tcsncmp (s, L"gfx_opengl", 10)) { - write_log (L"obsolete config entry '%s\n", s); + if (_tcslen (s) >= 10 && !_tcsncmp (s, _T("gfx_opengl"), 10)) { + write_log (_T("obsolete config entry '%s\n"), s); return 1; } - if (_tcslen (s) >= 6 && !_tcsncmp (s, L"gfx_3d", 6)) { - write_log (L"obsolete config entry '%s\n", s); + if (_tcslen (s) >= 6 && !_tcsncmp (s, _T("gfx_3d"), 6)) { + write_log (_T("obsolete config entry '%s\n"), s); return 1; } return 0; @@ -2889,7 +2889,7 @@ static void cfgfile_parse_separated_line (struct uae_prefs *p, TCHAR *line1b, TC p->all_lines = u; if (!ret) { u->unknown = 1; - write_log (L"unknown config entry: '%s=%s'\n", u->option, u->value); + write_log (_T("unknown config entry: '%s=%s'\n"), u->option, u->value); } } } @@ -2952,7 +2952,7 @@ static bool createconfigstore (struct uae_prefs *p) { uae_u8 zero = 0; zfile_fclose (configstore); - configstore = zfile_fopen_empty (NULL, L"configstore", 50000); + configstore = zfile_fopen_empty (NULL, _T("configstore"), 50000); if (!configstore) return false; zfile_fseek (configstore, 0, SEEK_SET); @@ -2978,7 +2978,7 @@ static char *cfg_fgets (char *line, int max, struct zfile *fh) if (sfile_ptr == 0) { sfile_ptr = singlefile_config; if (*sfile_ptr) { - write_log (L"singlefile config found\n"); + write_log (_T("singlefile config found\n")); while (*sfile_ptr++); } } @@ -3020,7 +3020,7 @@ static int cfgfile_load_2 (struct uae_prefs *p, const TCHAR *filename, bool real //reset_inputdevice_config (p); } - fh = zfile_fopen (filename, L"r", ZFD_NORMAL); + fh = zfile_fopen (filename, _T("r"), ZFD_NORMAL); #ifndef SINGLEFILE if (! fh) return 0; @@ -3043,8 +3043,8 @@ static int cfgfile_load_2 (struct uae_prefs *p, const TCHAR *filename, bool real if (!cfgfile_separate_linea (filename, linea, line1b, line2b)) continue; type1 = type2 = 0; - if (cfgfile_yesno (line1b, line2b, L"config_hardware", &type1) || - cfgfile_yesno (line1b, line2b, L"config_host", &type2)) { + if (cfgfile_yesno (line1b, line2b, _T("config_hardware"), &type1) || + cfgfile_yesno (line1b, line2b, _T("config_host"), &type2)) { if (type1 && type) *type |= CONFIG_TYPE_HARDWARE; if (type2 && type) @@ -3054,10 +3054,10 @@ static int cfgfile_load_2 (struct uae_prefs *p, const TCHAR *filename, bool real if (real) { cfgfile_parse_separated_line (p, line1b, line2b, askedtype); } else { - cfgfile_string (line1b, line2b, L"config_description", p->description, sizeof p->description / sizeof (TCHAR)); - cfgfile_path (line1b, line2b, L"config_hardware_path", p->config_hardware_path, sizeof p->config_hardware_path / sizeof (TCHAR)); - cfgfile_path (line1b, line2b, L"config_host_path", p->config_host_path, sizeof p->config_host_path / sizeof (TCHAR)); - cfgfile_string (line1b, line2b, L"config_window_title", p->config_window_title, sizeof p->config_window_title / sizeof (TCHAR)); + cfgfile_string (line1b, line2b, _T("config_description"), p->description, sizeof p->description / sizeof (TCHAR)); + cfgfile_path (line1b, line2b, _T("config_hardware_path"), p->config_hardware_path, sizeof p->config_hardware_path / sizeof (TCHAR)); + cfgfile_path (line1b, line2b, _T("config_host_path"), p->config_host_path, sizeof p->config_host_path / sizeof (TCHAR)); + cfgfile_string (line1b, line2b, _T("config_window_title"), p->config_window_title, sizeof p->config_window_title / sizeof (TCHAR)); } } } @@ -3070,7 +3070,7 @@ static int cfgfile_load_2 (struct uae_prefs *p, const TCHAR *filename, bool real return 1; for (sl = temp_lines; sl; sl = sl->next) { - _stprintf (line, L"%s=%s", sl->option, sl->value); + _stprintf (line, _T("%s=%s"), sl->option, sl->value); cfgfile_parse_line (p, line, 0); } @@ -3093,10 +3093,10 @@ int cfgfile_load (struct uae_prefs *p, const TCHAR *filename, int *type, int ign if (recursive > 1) return 0; recursive++; - write_log (L"load config '%s':%d\n", filename, type ? *type : -1); + write_log (_T("load config '%s':%d\n"), filename, type ? *type : -1); v = cfgfile_load_2 (p, filename, 1, type); if (!v) { - write_log (L"load failed\n"); + write_log (_T("load failed\n")); goto end; } if (userconfig) @@ -3126,7 +3126,7 @@ void cfgfile_backup (const TCHAR *path) TCHAR dpath[MAX_DPATH]; fetch_configurationpath (dpath, sizeof (dpath) / sizeof (TCHAR)); - _tcscat (dpath, L"configuration.backup"); + _tcscat (dpath, _T("configuration.backup")); bool hidden = my_isfilehidden (dpath); my_unlink (dpath); my_rename (path, dpath); @@ -3139,7 +3139,7 @@ int cfgfile_save (struct uae_prefs *p, const TCHAR *filename, int type) struct zfile *fh; cfgfile_backup (filename); - fh = zfile_fopen (filename, unicode_config ? L"w, ccs=UTF-8" : L"w", ZFD_NORMAL); + fh = zfile_fopen (filename, unicode_config ? _T("w, ccs=UTF-8") : _T("w"), ZFD_NORMAL); if (! fh) return 0; @@ -3182,10 +3182,10 @@ int cfgfile_configuration_change (int v) void cfgfile_show_usage (void) { int i; - write_log (L"UAE Configuration Help:\n" \ - L"=======================\n"); + write_log (_T("UAE Configuration Help:\n") \ + _T("=======================\n")); for (i = 0; i < sizeof opttable / sizeof *opttable; i++) - write_log (L"%s: %s\n", opttable[i].config_label, opttable[i].config_help); + write_log (_T("%s: %s\n"), opttable[i].config_label, opttable[i].config_help); } /* This implements the old commandline option parsing. I've re-added this @@ -3221,9 +3221,9 @@ static void parse_gfx_specs (struct uae_prefs *p, const TCHAR *spec) return; argh: - write_log (L"Bad display mode specification.\n"); - write_log (L"The format to use is: \"width:height:modifiers\"\n"); - write_log (L"Type \"uae -h\" for detailed help.\n"); + write_log (_T("Bad display mode specification.\n")); + write_log (_T("The format to use is: \"width:height:modifiers\"\n")); + write_log (_T("Type \"uae -h\" for detailed help.\n")); free (x0); } @@ -3298,9 +3298,9 @@ static void parse_joy_spec (struct uae_prefs *p, const TCHAR *spec) /* Let's scare Pascal programmers */ if (0) bad: - write_log (L"Bad joystick mode specification. Use -J xy, where x and y\n" - L"can be 0 for joystick 0, 1 for joystick 1, M for mouse, and\n" - L"a, b or c for different keyboard settings.\n"); + write_log (_T("Bad joystick mode specification. Use -J xy, where x and y\n") + _T("can be 0 for joystick 0, 1 for joystick 1, M for mouse, and\n") + _T("a, b or c for different keyboard settings.\n")); p->jports[0].id = v0; p->jports[1].id = v1; @@ -3327,7 +3327,7 @@ static void parse_filesys_spec (struct uae_prefs *p, bool readonly, const TCHAR add_filesys_config (p, -1, NULL, buf, s2, readonly, 0, 0, 0, 0, 0, 0, 0, 0); #endif } else { - write_log (L"Usage: [-m | -M] VOLNAME:mount_point\n"); + write_log (_T("Usage: [-m | -M] VOLNAME:mount_point\n")); } } @@ -3360,14 +3360,14 @@ static void parse_hardfile_spec (struct uae_prefs *p, const TCHAR *spec) argh: free (x0); - write_log (L"Bad hardfile parameter specified - type \"uae -h\" for help.\n"); + write_log (_T("Bad hardfile parameter specified - type \"uae -h\" for help.\n")); return; } static void parse_cpu_specs (struct uae_prefs *p, const TCHAR *spec) { if (*spec < '0' || *spec > '4') { - write_log (L"CPU parameter string must begin with '0', '1', '2', '3' or '4'.\n"); + write_log (_T("CPU parameter string must begin with '0', '1', '2', '3' or '4'.\n")); return; } @@ -3378,21 +3378,21 @@ static void parse_cpu_specs (struct uae_prefs *p, const TCHAR *spec) switch (*spec) { case 'a': if (p->cpu_model < 68020) - write_log (L"In 68000/68010 emulation, the address space is always 24 bit.\n"); + write_log (_T("In 68000/68010 emulation, the address space is always 24 bit.\n")); else if (p->cpu_model >= 68040) - write_log (L"In 68040/060 emulation, the address space is always 32 bit.\n"); + write_log (_T("In 68040/060 emulation, the address space is always 32 bit.\n")); else p->address_space_24 = 1; break; case 'c': if (p->cpu_model != 68000) - write_log (L"The more compatible CPU emulation is only available for 68000\n" - L"emulation, not for 68010 upwards.\n"); + write_log (_T("The more compatible CPU emulation is only available for 68000\n") + _T("emulation, not for 68010 upwards.\n")); else p->cpu_compatible = 1; break; default: - write_log (L"Bad CPU parameter specified - type \"uae -h\" for help.\n"); + write_log (_T("Bad CPU parameter specified - type \"uae -h\" for help.\n")); break; } spec++; @@ -3411,10 +3411,10 @@ static void cmdpath (TCHAR *dst, const TCHAR *src, int maxsz) int parse_cmdline_option (struct uae_prefs *p, TCHAR c, const TCHAR *arg) { struct strlist *u = xcalloc (struct strlist, 1); - const TCHAR arg_required[] = L"0123rKpImWSAJwNCZUFcblOdHRv"; + const TCHAR arg_required[] = _T("0123rKpImWSAJwNCZUFcblOdHRv"); if (_tcschr (arg_required, c) && ! arg) { - write_log (L"Missing argument for option `-%c'!\n", c); + write_log (_T("Missing argument for option `-%c'!\n"), c); return 0; } @@ -3483,30 +3483,30 @@ int parse_cmdline_option (struct uae_prefs *p, TCHAR c, const TCHAR *arg) break; case 'l': - if (0 == strcasecmp(arg, L"de")) + if (0 == strcasecmp(arg, _T("de"))) p->keyboard_lang = KBD_LANG_DE; - else if (0 == strcasecmp(arg, L"dk")) + else if (0 == strcasecmp(arg, _T("dk"))) p->keyboard_lang = KBD_LANG_DK; - else if (0 == strcasecmp(arg, L"us")) + else if (0 == strcasecmp(arg, _T("us"))) p->keyboard_lang = KBD_LANG_US; - else if (0 == strcasecmp(arg, L"se")) + else if (0 == strcasecmp(arg, _T("se"))) p->keyboard_lang = KBD_LANG_SE; - else if (0 == strcasecmp(arg, L"fr")) + else if (0 == strcasecmp(arg, _T("fr"))) p->keyboard_lang = KBD_LANG_FR; - else if (0 == strcasecmp(arg, L"it")) + else if (0 == strcasecmp(arg, _T("it"))) p->keyboard_lang = KBD_LANG_IT; - else if (0 == strcasecmp(arg, L"es")) + else if (0 == strcasecmp(arg, _T("es"))) p->keyboard_lang = KBD_LANG_ES; break; case 'O': parse_gfx_specs (p, arg); break; case 'd': if (_tcschr (arg, 'S') != NULL || _tcschr (arg, 's')) { - write_log (L" Serial on demand.\n"); + write_log (_T(" Serial on demand.\n")); p->serial_demand = 1; } if (_tcschr (arg, 'P') != NULL || _tcschr (arg, 'p')) { - write_log (L" Parallel on demand.\n"); + write_log (_T(" Parallel on demand.\n")); p->parallel_demand = 1; } @@ -3515,12 +3515,12 @@ int parse_cmdline_option (struct uae_prefs *p, TCHAR c, const TCHAR *arg) case 'H': p->color_mode = _tstoi (arg); if (p->color_mode < 0) { - write_log (L"Bad color mode selected. Using default.\n"); + write_log (_T("Bad color mode selected. Using default.\n")); p->color_mode = 0; } break; default: - write_log (L"Unknown option `-%c'!\n", c); + write_log (_T("Unknown option `-%c'!\n"), c); break; } return !! _tcschr (arg_required, c); @@ -3789,7 +3789,7 @@ uae_u32 cfgfile_modify (uae_u32 index, TCHAR *parms, uae_u32 size, TCHAR *out, u for (i = 0; i < argv; i++) { if (i + 2 <= argv) { - if (!_tcsicmp (argc[i], L"dbg")) { + if (!_tcsicmp (argc[i], _T("dbg"))) { debug_parser (argc[i + 1], out, outsize); } else if (!inputdevice_uaelib (argc[i], argc[i + 1])) { if (!cfgfile_parse_option (&changed_prefs, argc[i], argc[i + 1], 0)) { @@ -3917,11 +3917,11 @@ uae_u8 *save_configuration (int *len) TCHAR tmpout[256]; int ret; tmpout[0] = 0; - ret = cfgfile_modify (index, L"*", 1, tmpout, sizeof (tmpout) / sizeof (TCHAR)); + ret = cfgfile_modify (index, _T("*"), 1, tmpout, sizeof (tmpout) / sizeof (TCHAR)); index++; if (_tcslen (tmpout) > 0) { char *out; - if (!_tcsncmp (tmpout, L"input.", 6)) + if (!_tcsncmp (tmpout, _T("input."), 6)) continue; out = ua (tmpout); strcpy ((char*)p, out); @@ -3940,7 +3940,7 @@ uae_u8 *save_configuration (int *len) static void default_prefs_mini (struct uae_prefs *p, int type) { - _tcscpy (p->description, L"UAE default A500 configuration"); + _tcscpy (p->description, _T("UAE default A500 configuration")); p->nr_floppies = 1; p->floppyslots[0].dfxtype = DRV_35_DD; @@ -3962,7 +3962,7 @@ void default_prefs (struct uae_prefs *p, int type) reset_inputdevice_config (p); memset (p, 0, sizeof (*p)); - _tcscpy (p->description, L"UAE default configuration"); + _tcscpy (p->description, _T("UAE default configuration")); p->config_hardware_path[0] = 0; p->config_host_path[0] = 0; @@ -4119,21 +4119,21 @@ void default_prefs (struct uae_prefs *p, int type) p->gfx_filter_autoscale = AUTOSCALE_STATIC_AUTO; p->gfx_filteroverlay_overscan = 0; - _tcscpy (p->floppyslots[0].df, L"df0.adf"); - _tcscpy (p->floppyslots[1].df, L"df1.adf"); - _tcscpy (p->floppyslots[2].df, L"df2.adf"); - _tcscpy (p->floppyslots[3].df, L"df3.adf"); + _tcscpy (p->floppyslots[0].df, _T("df0.adf")); + _tcscpy (p->floppyslots[1].df, _T("df1.adf")); + _tcscpy (p->floppyslots[2].df, _T("df2.adf")); + _tcscpy (p->floppyslots[3].df, _T("df3.adf")); configure_rom (p, roms, 0); - _tcscpy (p->romextfile, L""); - _tcscpy (p->romextfile2, L""); + _tcscpy (p->romextfile, _T("")); + _tcscpy (p->romextfile2, _T("")); p->romextfile2addr = 0; - _tcscpy (p->flashfile, L""); - _tcscpy (p->cartfile, L""); + _tcscpy (p->flashfile, _T("")); + _tcscpy (p->cartfile, _T("")); - _tcscpy (p->path_rom.path[0], L"./"); - _tcscpy (p->path_floppy.path[0], L"./"); - _tcscpy (p->path_hardfile.path[0], L"./"); + _tcscpy (p->path_rom.path[0], _T("./")); + _tcscpy (p->path_floppy.path[0], _T("./")); + _tcscpy (p->path_hardfile.path[0], _T("./")); p->prtname[0] = 0; p->sername[0] = 0; @@ -4218,7 +4218,7 @@ void default_prefs (struct uae_prefs *p, int type) cr->rate = 50.0; cr->ntsc = 0; cr->locked = false; - _tcscpy (cr->label, L"PAL"); + _tcscpy (cr->label, _T("PAL")); cr = &p->cr[CHIPSET_REFRESH_NTSC]; cr->index = CHIPSET_REFRESH_NTSC; cr->horiz = -1; @@ -4229,13 +4229,13 @@ void default_prefs (struct uae_prefs *p, int type) cr->rate = 60.0; cr->ntsc = 1; cr->locked = false; - _tcscpy (cr->label, L"NTSC"); + _tcscpy (cr->label, _T("NTSC")); target_default_options (p, type); zfile_fclose (default_file); default_file = NULL; - f = zfile_fopen_empty (NULL, L"configstore"); + f = zfile_fopen_empty (NULL, _T("configstore")); if (f) { uaeconfig++; cfgfile_save_options (f, p, 0); @@ -4339,11 +4339,11 @@ static void buildin_default_prefs (struct uae_prefs *p) p->cs_df0idhw = 1; p->cs_resetwarning = 0; - _tcscpy (p->romfile, L""); - _tcscpy (p->romextfile, L""); - _tcscpy (p->flashfile, L""); - _tcscpy (p->cartfile, L""); - _tcscpy (p->amaxromfile, L""); + _tcscpy (p->romfile, _T("")); + _tcscpy (p->romextfile, _T("")); + _tcscpy (p->flashfile, _T("")); + _tcscpy (p->cartfile, _T("")); + _tcscpy (p->amaxromfile, _T("")); p->prtname[0] = 0; p->sername[0] = 0; @@ -4546,7 +4546,7 @@ static int bip_cdtv (struct uae_prefs *p, int config, int compa, int romcheck) p->cs_compatible = CP_CDTV; built_in_chipset_prefs (p); fetch_datapath (p->flashfile, sizeof (p->flashfile) / sizeof (TCHAR)); - _tcscat (p->flashfile, L"cdtv.nvr"); + _tcscat (p->flashfile, _T("cdtv.nvr")); return 1; } @@ -4579,7 +4579,7 @@ static int bip_cd32 (struct uae_prefs *p, int config, int compa, int romcheck) p->cs_compatible = CP_CD32; built_in_chipset_prefs (p); fetch_datapath (p->flashfile, sizeof (p->flashfile) / sizeof (TCHAR)); - _tcscat (p->flashfile, L"cd32.nvr"); + _tcscat (p->flashfile, _T("cd32.nvr")); return 1; } @@ -4735,7 +4735,7 @@ static int bip_super (struct uae_prefs *p, int config, int compa, int romcheck) built_in_chipset_prefs (p); p->cs_ide = -1; p->cs_ciaatod = p->ntscmode ? 2 : 1; - //_tcscat(p->flashfile, L"battclock.nvr"); + //_tcscat(p->flashfile, _T("battclock.nvr")); return configure_rom (p, roms, romcheck); } @@ -4754,7 +4754,7 @@ static int bip_arcadia (struct uae_prefs *p, int config, int compa, int romcheck p->cs_compatible = CP_A500; built_in_chipset_prefs (p); fetch_datapath (p->flashfile, sizeof (p->flashfile) / sizeof (TCHAR)); - _tcscat (p->flashfile, L"arcadia.nvr"); + _tcscat (p->flashfile, _T("arcadia.nvr")); roms[0] = 5; roms[1] = 4; roms[2] = -1; @@ -4958,7 +4958,7 @@ void config_check_vsync (void) { if (config_changed) { // if (config_changed == 1) -// write_log (L"* configuration check trigger\n"); +// write_log (_T("* configuration check trigger\n")); config_changed++; if (config_changed > 10) config_changed = 0; diff --git a/cia.cpp b/cia.cpp index 793e8676..c7e48f5d 100644 --- a/cia.cpp +++ b/cia.cpp @@ -490,7 +490,7 @@ static void do_tod_hack (int dotod) if (tod_hack_enabled > 1) { tod_hack_enabled--; if (tod_hack_enabled == 1) { - write_log (L"TOD HACK enabled\n"); + write_log (_T("TOD HACK enabled\n")); tod_hack_reset (); } return; @@ -506,7 +506,7 @@ static void do_tod_hack (int dotod) return; if (rate != oldrate || ciaatod != tod_hack_tod_last) { if (ciaatod != 0) - write_log (L"TOD HACK reset %d,%d %d,%d\n", + write_log (_T("TOD HACK reset %d,%d %d,%d\n"), rate, oldrate, ciaatod, tod_hack_tod_last); tod_hack_reset (); oldrate = rate; @@ -541,7 +541,7 @@ static void sendrw (void) kblostsynccnt = 8 * maxvpos * 8; // 8 frames * 8 bits. ciaaicr |= 8; RethinkICRA (); - write_log (L"KB: sent reset warning code (phase=%d)\n", resetwarning_phase); + write_log (_T("KB: sent reset warning code (phase=%d)\n"), resetwarning_phase); } int resetwarning_do (int canreset) @@ -556,7 +556,7 @@ int resetwarning_do (int canreset) } resetwarning_phase = 1; resetwarning_timer = maxvpos_nom * 5; - write_log (L"KB: reset warning triggered\n"); + write_log (_T("KB: reset warning triggered\n")); sendrw (); return 1; } @@ -566,7 +566,7 @@ static void resetwarning_check (void) if (resetwarning_timer > 0) { resetwarning_timer--; if (resetwarning_timer <= 0) { - write_log (L"KB: reset warning forced reset. Phase=%d\n", resetwarning_phase); + write_log (_T("KB: reset warning forced reset. Phase=%d\n"), resetwarning_phase); resetwarning_phase = -1; kblostsynccnt = 0; uae_reset (0); @@ -574,7 +574,7 @@ static void resetwarning_check (void) } if (resetwarning_phase == 1) { if (!kblostsynccnt) { /* first AK_RESETWARNING handshake received */ - write_log (L"KB: reset warning second phase..\n"); + write_log (_T("KB: reset warning second phase..\n")); resetwarning_phase = 2; resetwarning_timer = maxvpos_nom * 5; sendrw (); @@ -582,13 +582,13 @@ static void resetwarning_check (void) } else if (resetwarning_phase == 2) { if (ciaacra & 0x40) { /* second AK_RESETWARNING handshake active */ resetwarning_phase = 3; - write_log (L"KB: reset warning SP = output\n"); + write_log (_T("KB: reset warning SP = output\n")); /* System won't reset until handshake signal becomes inactive or 10s has passed */ resetwarning_timer = 10 * maxvpos_nom * vblank_hz; } } else if (resetwarning_phase == 3) { if (!(ciaacra & 0x40)) { /* second AK_RESETWARNING handshake disabled */ - write_log (L"KB: reset warning end by software. reset.\n"); + write_log (_T("KB: reset warning end by software. reset.\n")); resetwarning_phase = -1; kblostsynccnt = 0; uae_reset (0); @@ -603,7 +603,7 @@ void CIA_hsync_prehandler (void) static void keyreq (void) { #if KB_DEBUG - write_log (L"code=%x\n", kbcode); + write_log (_T("code=%x\n"), kbcode); #endif ciaasdr = kbcode; kblostsynccnt = 8 * maxvpos * 8; // 8 frames * 8 bits. @@ -700,7 +700,7 @@ void CIA_vsync_prehandler (void) kblostsynccnt = 0; keyreq (); #if KB_DEBUG - write_log (L"lostsync\n"); + write_log (_T("lostsync\n")); #endif } } @@ -719,7 +719,7 @@ void CIA_vsync_posthandler (bool dotod) } #if 0 if (vpos == 0) { - write_log (L"%d\n", vsync_counter); + write_log (_T("%d\n"), vsync_counter); dumpcia (); } #endif @@ -760,7 +760,7 @@ static uae_u8 ReadCIAA (unsigned int addr) compute_passed_time (); #if CIAA_DEBUG_R > 0 - write_log (L"R_CIAA: bfe%x01 %08X\n", reg, M68K_GETPC); + write_log (_T("R_CIAA: bfe%x01 %08X\n"), reg, M68K_GETPC); #endif switch (reg) { @@ -774,7 +774,7 @@ static uae_u8 ReadCIAA (unsigned int addr) tmp = dongle_cia_read (0, reg, tmp); #if DONGLE_DEBUG > 0 if (notinrom()) - write_log (L"BFE001 R %02X %s\n", tmp, debuginfo(0)); + write_log (_T("BFE001 R %02X %s\n"), tmp, debuginfo(0)); #endif if (inputrecord_debug & 2) { @@ -809,7 +809,7 @@ static uae_u8 ReadCIAA (unsigned int addr) tmp = dongle_cia_read (1, reg, tmp); #if DONGLE_DEBUG > 0 if (notinrom()) - write_log (L"BFE101 R %02X %s\n", tmp, debuginfo(0)); + write_log (_T("BFE101 R %02X %s\n"), tmp, debuginfo(0)); #endif } if (ciaacrb & 2) { @@ -830,13 +830,13 @@ static uae_u8 ReadCIAA (unsigned int addr) case 2: #if DONGLE_DEBUG > 0 if (notinrom ()) - write_log (L"BFE201 R %02X %s\n", ciaadra, debuginfo(0)); + write_log (_T("BFE201 R %02X %s\n"), ciaadra, debuginfo(0)); #endif return ciaadra; case 3: #if DONGLE_DEBUG > 0 if (notinrom ()) - write_log (L"BFE301 R %02X %s\n", ciaadrb, debuginfo(0)); + write_log (_T("BFE301 R %02X %s\n"), ciaadrb, debuginfo(0)); #endif return ciaadrb; case 4: @@ -889,7 +889,7 @@ static uae_u8 ReadCIAB (unsigned int addr) #if CIAB_DEBUG_R > 0 if ((addr >= 8 && addr <= 10) || CIAB_DEBUG_R > 1) - write_log (L"R_CIAB: bfd%x00 %08X\n", reg, M68K_GETPC); + write_log (_T("R_CIAB: bfd%x00 %08X\n"), reg, M68K_GETPC); #endif compute_passed_time (); @@ -917,13 +917,13 @@ static uae_u8 ReadCIAB (unsigned int addr) tmp = dongle_cia_read (1, reg, tmp); #if DONGLE_DEBUG > 0 if (notinrom ()) - write_log (L"BFD000 R %02X %s\n", tmp, debuginfo(0)); + write_log (_T("BFD000 R %02X %s\n"), tmp, debuginfo(0)); #endif return tmp; case 1: #if DONGLE_DEBUG > 0 if (notinrom ()) - write_log (L"BFD100 R %02X %s\n", ciabprb, debuginfo(0)); + write_log (_T("BFD100 R %02X %s\n"), ciabprb, debuginfo(0)); #endif tmp = ciabprb; tmp = dongle_cia_read (1, reg, tmp); @@ -982,7 +982,7 @@ static uae_u8 ReadCIAB (unsigned int addr) RethinkICRB (); return tmp; case 14: - //write_log (L"CIABCRA READ %d %x\n", ciabcra, M68K_GETPC); + //write_log (_T("CIABCRA READ %d %x\n"), ciabcra, M68K_GETPC); return ciabcra; case 15: return ciabcrb; @@ -995,7 +995,7 @@ static void WriteCIAA (uae_u16 addr, uae_u8 val) int reg = addr & 15; #if CIAA_DEBUG_W > 0 - write_log (L"W_CIAA: bfe%x01 %02X %08X\n", reg, val, M68K_GETPC); + write_log (_T("W_CIAA: bfe%x01 %02X %08X\n"), reg, val, M68K_GETPC); #endif #ifdef ACTION_REPLAY ar_ciaa[reg] = val; @@ -1008,7 +1008,7 @@ static void WriteCIAA (uae_u16 addr, uae_u8 val) case 0: #if DONGLE_DEBUG > 0 if (notinrom ()) - write_log (L"BFE001 W %02X %s\n", val, debuginfo(0)); + write_log (_T("BFE001 W %02X %s\n"), val, debuginfo(0)); #endif ciaapra = (ciaapra & ~0xc3) | (val & 0xc3); bfe001_change (); @@ -1022,7 +1022,7 @@ static void WriteCIAA (uae_u16 addr, uae_u8 val) case 1: #if DONGLE_DEBUG > 0 if (notinrom ()) - write_log (L"BFE101 W %02X %s\n", val, debuginfo(0)); + write_log (_T("BFE101 W %02X %s\n"), val, debuginfo(0)); #endif ciaaprb = val; dongle_cia_write (0, reg, val); @@ -1043,7 +1043,7 @@ static void WriteCIAA (uae_u16 addr, uae_u8 val) case 2: #if DONGLE_DEBUG > 0 if (notinrom ()) - write_log (L"BFE201 W %02X %s\n", val, debuginfo(0)); + write_log (_T("BFE201 W %02X %s\n"), val, debuginfo(0)); #endif ciaadra = val; dongle_cia_write (0, reg, val); @@ -1054,7 +1054,7 @@ static void WriteCIAA (uae_u16 addr, uae_u8 val) dongle_cia_write (0, reg, val); #if DONGLE_DEBUG > 0 if (notinrom ()) - write_log (L"BFE301 W %02X %s\n", val, debuginfo(0)); + write_log (_T("BFE301 W %02X %s\n"), val, debuginfo(0)); #endif #ifdef ARCADIA if (arcadia_bios) @@ -1138,7 +1138,7 @@ static void WriteCIAA (uae_u16 addr, uae_u8 val) /* todo: check if low to high or high to low only */ kblostsynccnt = 0; #if KB_DEBUG - write_log (L"KB_ACK %02x->%02x\n", val, ciaacra); + write_log (_T("KB_ACK %02x->%02x\n"), val, ciaacra); #endif } ciaacra = val; @@ -1168,7 +1168,7 @@ static void WriteCIAB (uae_u16 addr, uae_u8 val) #if CIAB_DEBUG_W > 0 if ((addr >= 8 && addr <= 10) || CIAB_DEBUG_W > 1) - write_log (L"W_CIAB: bfd%x00 %02X %08X\n", reg, val, M68K_GETPC); + write_log (_T("W_CIAB: bfd%x00 %02X %08X\n"), reg, val, M68K_GETPC); #endif #ifdef ACTION_REPLAY ar_ciab[reg] = val; @@ -1177,7 +1177,7 @@ static void WriteCIAB (uae_u16 addr, uae_u8 val) case 0: #if DONGLE_DEBUG > 0 if (notinrom ()) - write_log (L"BFD000 W %02X %s\n", val, debuginfo(0)); + write_log (_T("BFD000 W %02X %s\n"), val, debuginfo(0)); #endif dongle_cia_write (1, reg, val); ciabpra = val; @@ -1193,7 +1193,7 @@ static void WriteCIAB (uae_u16 addr, uae_u8 val) case 1: #if DONGLE_DEBUG > 0 if (notinrom ()) - write_log (L"BFD100 W %02X %s\n", val, debuginfo(0)); + write_log (_T("BFD100 W %02X %s\n"), val, debuginfo(0)); #endif dongle_cia_write (1, reg, val); ciabprb = val; @@ -1202,7 +1202,7 @@ static void WriteCIAB (uae_u16 addr, uae_u8 val) case 2: #if DONGLE_DEBUG > 0 if (notinrom ()) - write_log (L"BFD200 W %02X %s\n", val, debuginfo(0)); + write_log (_T("BFD200 W %02X %s\n"), val, debuginfo(0)); #endif dongle_cia_write (1, reg, val); ciabdra = val; @@ -1214,7 +1214,7 @@ static void WriteCIAB (uae_u16 addr, uae_u8 val) case 3: #if DONGLE_DEBUG > 0 if (notinrom ()) - write_log (L"BFD300 W %02X %s\n", val, debuginfo(0)); + write_log (_T("BFD300 W %02X %s\n"), val, debuginfo(0)); #endif dongle_cia_write (1, reg, val); ciabdrb = val; @@ -1372,13 +1372,13 @@ void CIA_reset (void) void dumpcia (void) { - console_out_f (L"A: CRA %02x CRB %02x ICR %02x IM %02x TA %04x (%04x) TB %04x (%04x)\n", + console_out_f (_T("A: CRA %02x CRB %02x ICR %02x IM %02x TA %04x (%04x) TB %04x (%04x)\n"), ciaacra, ciaacrb, ciaaicr, ciaaimask, ciaata, ciaala, ciaatb, ciaalb); - console_out_f (L"TOD %06x (%06x) ALARM %06x %c%c CYC=%08X\n", + console_out_f (_T("TOD %06x (%06x) ALARM %06x %c%c CYC=%08X\n"), ciaatod, ciaatol, ciaaalarm, ciaatlatch ? 'L' : ' ', ciaatodon ? ' ' : 'S', get_cycles ()); - console_out_f (L"B: CRA %02x CRB %02x ICR %02x IM %02x TA %04x (%04x) TB %04x (%04x)\n", + console_out_f (_T("B: CRA %02x CRB %02x ICR %02x IM %02x TA %04x (%04x) TB %04x (%04x)\n"), ciabcra, ciabcrb, ciabicr, ciabimask, ciabta, ciabla, ciabtb, ciablb); - console_out_f (L"TOD %06x (%06x) ALARM %06x %c%c CLK=%d\n", + console_out_f (_T("TOD %06x (%06x) ALARM %06x %c%c CLK=%d\n"), ciabtod, ciabtol, ciabalarm, ciabtlatch ? 'L' : ' ', ciabtodon ? ' ' : 'S', div10 / CYCLE_UNIT); } @@ -1396,7 +1396,7 @@ static void REGPARAM3 cia_bput (uaecptr, uae_u32) REGPARAM; addrbank cia_bank = { cia_lget, cia_wget, cia_bget, cia_lput, cia_wput, cia_bput, - default_xlate, default_check, NULL, L"CIA", + default_xlate, default_check, NULL, _T("CIA"), cia_lgeti, cia_wgeti, ABFLAG_IO }; @@ -1474,7 +1474,7 @@ static uae_u32 REGPARAM2 cia_bget (uaecptr addr) if (currprefs.cpu_model == 68000 && currprefs.cpu_compatible) v = (addr & 1) ? regs.irc : regs.irc >> 8; if (warned > 0) { - write_log (L"cia_bget: unknown CIA address %x PC=%x\n", addr, M68K_GETPC); + write_log (_T("cia_bget: unknown CIA address %x PC=%x\n"), addr, M68K_GETPC); warned--; } break; @@ -1510,7 +1510,7 @@ static uae_u32 REGPARAM2 cia_wget (uaecptr addr) if (currprefs.cpu_model == 68000 && currprefs.cpu_compatible) v = regs.irc; if (warned > 0) { - write_log (L"cia_wget: unknown CIA address %x PC=%x\n", addr, M68K_GETPC); + write_log (_T("cia_wget: unknown CIA address %x PC=%x\n"), addr, M68K_GETPC); warned--; } break; @@ -1554,7 +1554,7 @@ static void REGPARAM2 cia_bput (uaecptr addr, uae_u32 value) if ((addr & 0x1000) == 0) WriteCIAA (r, value); if (((addr & 0x3000) == 0x3000) && warned > 0) { - write_log (L"cia_bput: unknown CIA address %x %x\n", addr, value); + write_log (_T("cia_bput: unknown CIA address %x %x\n"), addr, value); warned--; } } @@ -1575,7 +1575,7 @@ static void REGPARAM2 cia_wput (uaecptr addr, uae_u32 value) if ((addr & 0x1000) == 0) WriteCIAA (r, value & 0xff); if (((addr & 0x3000) == 0x3000) && warned > 0) { - write_log (L"cia_wput: unknown CIA address %x %x\n", addr, value); + write_log (_T("cia_wput: unknown CIA address %x %x\n"), addr, value); warned--; } } @@ -1600,7 +1600,7 @@ static void REGPARAM3 clock_bput (uaecptr, uae_u32) REGPARAM; addrbank clock_bank = { clock_lget, clock_wget, clock_bget, clock_lput, clock_wput, clock_bput, - default_xlate, default_check, NULL, L"Battery backed up clock (none)", + default_xlate, default_check, NULL, _T("Battery backed up clock (none)"), dummy_lgeti, dummy_wgeti, ABFLAG_IO }; @@ -1613,9 +1613,9 @@ static uae_u8 rtc_memory[RF5C01A_RAM_SIZE], rtc_alarm[RF5C01A_RAM_SIZE]; static void write_battclock (void) { - struct zfile *f = zfile_fopen (currprefs.flashfile, L"rb+", ZFD_NORMAL); + struct zfile *f = zfile_fopen (currprefs.flashfile, _T("rb+"), ZFD_NORMAL); if (!f) { - f = zfile_fopen (currprefs.flashfile, L"wb", 0); + f = zfile_fopen (currprefs.flashfile, _T("wb"), 0); if (f) { zfile_fwrite (rtc_memory, RF5C01A_RAM_SIZE, 1, f); zfile_fwrite (rtc_alarm, RF5C01A_RAM_SIZE, 1, f); @@ -1635,12 +1635,12 @@ static void write_battclock (void) void rtc_hardreset (void) { if (currprefs.cs_rtc == 1) { /* MSM6242B */ - clock_bank.name = L"Battery backed up clock (MSM6242B)"; + clock_bank.name = _T("Battery backed up clock (MSM6242B)"); clock_control_d = 0x1; clock_control_e = 0; clock_control_f = 0x4; /* 24/12 */ } else if (currprefs.cs_rtc == 2) { /* RF5C01A */ - clock_bank.name = L"Battery backed up clock (RF5C01A)"; + clock_bank.name = _T("Battery backed up clock (RF5C01A)"); clock_control_d = 0x4; /* Timer EN */ clock_control_e = 0; clock_control_f = 0; @@ -1676,7 +1676,7 @@ static uae_u32 REGPARAM2 clock_bget (uaecptr addr) #ifdef JIT special_mem |= S_READ; #endif -// write_log(L"R: %x (%x), PC=%08x\n", addr, (addr & 0xff) >> 2, M68K_GETPC); +// write_log(_T("R: %x (%x), PC=%08x\n"), addr, (addr & 0xff) >> 2, M68K_GETPC); #ifdef CDTV if (currprefs.cs_cdtvram && addr >= 0xdc8000) return cdtv_battram_read (addr); @@ -1757,7 +1757,7 @@ static void REGPARAM2 clock_bput (uaecptr addr, uae_u32 value) #ifdef JIT special_mem |= S_WRITE; #endif -// write_log(L"W: %x (%x): %x, PC=%08x\n", addr, (addr & 0xff) >> 2, value & 0xff, M68K_GETPC); +// write_log(_T("W: %x (%x): %x, PC=%08x\n"), addr, (addr & 0xff) >> 2, value & 0xff, M68K_GETPC); #ifdef CDTV if (currprefs.cs_cdtvram && addr >= 0xdc8000) { cdtv_battram_write (addr, value); diff --git a/consolehook.cpp b/consolehook.cpp index a492556f..b5e3e7a2 100644 --- a/consolehook.cpp +++ b/consolehook.cpp @@ -49,7 +49,7 @@ void consolehook_config (struct uae_prefs *p) //p->win32_automount_drives = 2; //p->win32_automount_cddrives = 2; - add_filesys_config (p, -1, L"DH0", L"CLIBOOT", L".", 1, 0, 0, 0, 0, 15, NULL, 0, 0); + add_filesys_config (p, -1, _T("DH0"), _T("CLIBOOT"), _T("."), 1, 0, 0, 0, 0, 15, NULL, 0, 0); } static void *console_thread (void *v) @@ -59,7 +59,7 @@ static void *console_thread (void *v) TCHAR wc = console_getch (); char c[2]; - write_log (L"*"); + write_log (_T("*")); c[0] = 0; c[1] = 0; ua_copy (c, 1, &wc); @@ -76,9 +76,9 @@ int consolehook_activate (void) void consolehook_ret (uaecptr condev, uaecptr oldbeginio) { beginio = oldbeginio; - write_log (L"console.device at %08X\n", condev); + write_log (_T("console.device at %08X\n"), condev); - uae_start_thread (L"consolereader", console_thread, NULL, NULL); + uae_start_thread (_T("consolereader"), console_thread, NULL, NULL); } uaecptr consolehook_beginio (uaecptr request) @@ -98,11 +98,11 @@ uaecptr consolehook_beginio (uaecptr request) buf = xmalloc (TCHAR, len + 1); au_copy (buf, len, src); buf[len] = 0; - f_out (L"%s", buf); + f_out (_T("%s"), buf); xfree (buf); } else if (cmd == CMD_READ) { - write_log (L"%08x: CMD=%d LEN=%d OFF=%d ACT=%d\n", request, cmd, io_length, io_offset, io_actual); + write_log (_T("%08x: CMD=%d LEN=%d OFF=%d ACT=%d\n"), request, cmd, io_length, io_offset, io_actual); } return beginio; } diff --git a/cpummu.cpp b/cpummu.cpp index ac1c9551..2337eedb 100644 --- a/cpummu.cpp +++ b/cpummu.cpp @@ -57,7 +57,7 @@ static void mmu_dump_ttr(const TCHAR * label, uae_u32 ttr) from_addr = ttr & MMU_TTR_LOGICAL_BASE; to_addr = (ttr & MMU_TTR_LOGICAL_MASK) << 8; - D(bug(L"%s: [%08lx] %08lx - %08lx enabled=%d supervisor=%d wp=%d cm=%02d\n", + D(bug(_T("%s: [%08lx] %08lx - %08lx enabled=%d supervisor=%d wp=%d cm=%02d\n"), label, ttr, from_addr, to_addr, ttr & MMU_TTR_BIT_ENABLED ? 1 : 0, @@ -84,7 +84,7 @@ void mmu_make_transparent_region(uaecptr baseaddr, uae_u32 size, int datamode) *ttr |= ((baseaddr + size - 1) & MMU_TTR_LOGICAL_BASE) >> 8; *ttr |= MMU_TTR_BIT_ENABLED; - D(bug(L"MMU: map transparent mapping of %08x\n", *ttr)); + D(bug(_T("MMU: map transparent mapping of %08x\n"), *ttr)); } /* check if an address matches a ttr */ @@ -142,7 +142,7 @@ static void mmu_dump_table(const char * label, uaecptr root_ptr) uaecptr ptr_des_addr, page_addr, root_log, ptr_log, page_log; - D(bug(L"%s: root=%lx\n", label, root_ptr)); + D(bug(_T("%s: root=%lx\n"), label, root_ptr)); for (root_idx = 0; root_idx < ROOT_TABLE_SIZE; root_idx++) { root_des = phys_get_long(root_ptr + root_idx); @@ -150,7 +150,7 @@ static void mmu_dump_table(const char * label, uaecptr root_ptr) if ((root_des & 2) == 0) continue; /* invalid */ - D(bug(L"ROOT: %03d U=%d W=%d UDT=%02d\n", root_idx, + D(bug(_T("ROOT: %03d U=%d W=%d UDT=%02d\n"), root_idx, root_des & 8 ? 1 : 0, root_des & 4 ? 1 : 0, root_des & 3 @@ -205,7 +205,7 @@ static void mmu_dump_table(const char * label, uaecptr root_ptr) if (n_pages_used == -1) continue; - D(bug(L" PTR: %03d U=%d W=%d UDT=%02d\n", ptr_idx, + D(bug(_T(" PTR: %03d U=%d W=%d UDT=%02d\n"), ptr_idx, ptr_des & 8 ? 1 : 0, ptr_des & 4 ? 1 : 0, ptr_des & 3 @@ -216,7 +216,7 @@ static void mmu_dump_table(const char * label, uaecptr root_ptr) page_des = page_info[page_idx].match; if ((page_des & MMU_PDT_MASK) == 2) { - D(bug(L" PAGE: %03d-%03d log=%08lx INDIRECT --> addr=%08lx\n", + D(bug(_T(" PAGE: %03d-%03d log=%08lx INDIRECT --> addr=%08lx\n"), page_info[page_idx].start_idx, page_info[page_idx].start_idx + page_info[page_idx].n_pages - 1, page_info[page_idx].log, @@ -224,7 +224,7 @@ static void mmu_dump_table(const char * label, uaecptr root_ptr) )); } else { - D(bug(L" PAGE: %03d-%03d log=%08lx addr=%08lx UR=%02d G=%d U1/0=%d S=%d CM=%d M=%d U=%d W=%d\n", + D(bug(_T(" PAGE: %03d-%03d log=%08lx addr=%08lx UR=%02d G=%d U1/0=%d S=%d CM=%d M=%d U=%d W=%d\n"), page_info[page_idx].start_idx, page_info[page_idx].start_idx + page_info[page_idx].n_pages - 1, page_info[page_idx].log, @@ -255,7 +255,7 @@ void mmu_dump_atc(void) for (j = 0; j < ATC_L2_SIZE; j++) { if (atc_l2[i][j].tag == 0x8000) continue; - D(bug(L"ATC[%02d] G=%d TT=%d M=%d WP=%d VD=%d VI=%d tag=%08x --> phys=%08x\n", + D(bug(_T("ATC[%02d] G=%d TT=%d M=%d WP=%d VD=%d VI=%d tag=%08x --> phys=%08x\n"), j, atc_l2[i][j].global, atc_l2[i][j].tt, atc_l2[i][j].modified, atc_l2[i][j].write_protect, atc_l2[i][j].valid_data, atc_l2[i][j].valid_inst, atc_l2[i][j].tag, atc_l2[i][j].phys)); @@ -267,11 +267,11 @@ void mmu_dump_atc(void) /* {{{ mmu_dump_tables */ void mmu_dump_tables(void) { - D(bug(L"URP: %08x SRP: %08x MMUSR: %x TC: %x\n", regs.urp, regs.srp, regs.mmusr, regs.tcr)); - mmu_dump_ttr(L"DTT0", regs.dtt0); - mmu_dump_ttr(L"DTT1", regs.dtt1); - mmu_dump_ttr(L"ITT0", regs.itt0); - mmu_dump_ttr(L"ITT1", regs.itt1); + D(bug(_T("URP: %08x SRP: %08x MMUSR: %x TC: %x\n"), regs.urp, regs.srp, regs.mmusr, regs.tcr)); + mmu_dump_ttr(_T("DTT0"), regs.dtt0); + mmu_dump_ttr(_T("DTT1"), regs.dtt1); + mmu_dump_ttr(_T("ITT0"), regs.itt0); + mmu_dump_ttr(_T("ITT1"), regs.itt1); mmu_dump_atc(); #if DEBUG mmu_dump_table("SRP", regs.srp); @@ -310,9 +310,9 @@ static void mmu_bus_error(uaecptr addr, int fc, bool write, int size) regs.mmu_fault_addr = addr; regs.mmu_ssw = ssw | MMU_SSW_ATC; - D(bug(L"BUS ERROR: fc=%d w=%d log=%08x ssw=%04x PC=%08x\n", fc, write, addr, ssw, m68k_getpc())); + D(bug(_T("BUS ERROR: fc=%d w=%d log=%08x ssw=%04x PC=%08x\n"), fc, write, addr, ssw, m68k_getpc())); - //write_log(L"BUS ERROR: fc=%d w=%d log=%08x ssw=%04x PC=%08x\n", fc, write, addr, ssw, m68k_getpc()); + //write_log(_T("BUS ERROR: fc=%d w=%d log=%08x ssw=%04x PC=%08x\n"), fc, write, addr, ssw, m68k_getpc()); //activate_debugger(); THROW(2); @@ -362,7 +362,7 @@ static uaecptr mmu_fill_atc_l2(uaecptr addr, bool super, bool data, bool write, TRY(prb) { desc = mmu_lookup_pagetable(addr, super, write); #if DEBUG > 2 - D(bug(L"translate: %x,%u,%u,%u -> %x\n", addr, super, write, data, desc)); + D(bug(_T("translate: %x,%u,%u,%u -> %x\n"), addr, super, write, data, desc)); #endif RESTORE_EXCEPTION; } @@ -402,12 +402,12 @@ static ALWAYS_INLINE bool mmu_fill_atc_l1(uaecptr addr, bool super, bool data, b mmu_fill_atc_l2(addr, super, data, write, l); } if (!(data ? l->valid_data : l->valid_inst)) { - D(bug(L"MMU: non-resident page (%x,%x,%x)!\n", addr, regs.pc, regs.instruction_pc)); + D(bug(_T("MMU: non-resident page (%x,%x,%x)!\n"), addr, regs.pc, regs.instruction_pc)); goto fail; } if (write) { if (l->write_protect) { - D(bug(L"MMU: write protected (via %s) %lx\n", l->tt ? "ttr" : "atc", addr)); + D(bug(_T("MMU: write protected (via %s) %lx\n"), l->tt ? "ttr" : "atc", addr)); goto fail; } if (!l->modified) @@ -468,7 +468,7 @@ static uaecptr REGPARAM2 mmu_lookup_pagetable(uaecptr addr, bool super, bool wri desc_addr = (desc & MMU_ROOT_PTR_ADDR_MASK) | i; desc = phys_get_long(desc_addr); if ((desc & 2) == 0) { - D(bug(L"MMU: invalid root descriptor for %lx\n", addr)); + D(bug(_T("MMU: invalid root descriptor for %lx\n"), addr)); return 0; } @@ -481,7 +481,7 @@ static uaecptr REGPARAM2 mmu_lookup_pagetable(uaecptr addr, bool super, bool wri desc_addr = (desc & MMU_ROOT_PTR_ADDR_MASK) | i; desc = phys_get_long(desc_addr); if ((desc & 2) == 0) { - D(bug(L"MMU: invalid ptr descriptor for %lx\n", addr)); + D(bug(_T("MMU: invalid ptr descriptor for %lx\n"), addr)); return 0; } wp |= desc; @@ -504,7 +504,7 @@ static uaecptr REGPARAM2 mmu_lookup_pagetable(uaecptr addr, bool super, bool wri desc = phys_get_long(desc_addr); } if ((desc & 1) == 0) { - D(bug(L"MMU: invalid page descriptor log=%08lx desc=%08lx @%08lx\n", addr, desc, desc_addr)); + D(bug(_T("MMU: invalid page descriptor log=%08lx desc=%08lx @%08lx\n"), addr, desc, desc_addr)); return desc; } @@ -913,11 +913,11 @@ void REGPARAM2 mmu_op_real(uae_u32 opcode, uae_u16 extra) glob = (opcode & 8) != 0; if (opcode & 16) { - D(bug(L"pflusha(%u,%u)\n", glob, regs.dfc)); + D(bug(_T("pflusha(%u,%u)\n"), glob, regs.dfc)); mmu_flush_atc_all(glob); } else { addr = m68k_areg(regs, regno); - D(bug(L"pflush(%u,%u,%x)\n", glob, regs.dfc, addr)); + D(bug(_T("pflush(%u,%u,%x)\n"), glob, regs.dfc, addr)); mmu_flush_atc(addr, super, glob); } flush_internals(); @@ -932,7 +932,7 @@ void REGPARAM2 mmu_op_real(uae_u32 opcode, uae_u16 extra) regno = opcode & 7; write = (opcode & 32) == 0; addr = m68k_areg(regs, regno); - D(bug(L"PTEST%c (A%d) %08x DFC=%d\n", write ? 'W' : 'R', regno, addr, regs.dfc)); + D(bug(_T("PTEST%c (A%d) %08x DFC=%d\n"), write ? 'W' : 'R', regno, addr, regs.dfc)); mmu_flush_atc(addr, super, true); SAVE_EXCEPTION; TRY(prb) { @@ -956,7 +956,7 @@ void REGPARAM2 mmu_op_real(uae_u32 opcode, uae_u16 extra) regs.mmusr = MMU_MMUSR_B; } RESTORE_EXCEPTION; - D(bug(L"PTEST result: mmusr %08x\n", regs.mmusr)); + D(bug(_T("PTEST result: mmusr %08x\n"), regs.mmusr)); } else op_illg (opcode); } @@ -1033,7 +1033,7 @@ void REGPARAM2 mmu_set_tc(uae_u16 tc) regs.mmu_pagesize_8k = tc & 0x4000 ? 1 : 0; mmu_flush_atc_all(true); - write_log(L"MMU: enabled=%d page8k=%d\n", regs.mmu_enabled, regs.mmu_pagesize_8k); + write_log(_T("MMU: enabled=%d page8k=%d\n"), regs.mmu_enabled, regs.mmu_pagesize_8k); } void REGPARAM2 mmu_set_super(bool super) diff --git a/crc32.cpp b/crc32.cpp index f0c68164..29cd3769 100644 --- a/crc32.cpp +++ b/crc32.cpp @@ -350,7 +350,7 @@ const TCHAR *get_sha1_txt (void *vinput, int len) p = outtxt; get_sha1 (input, len, out); for (i = 0; i < SHA1_SIZE; i++) { - _stprintf (p, L"%02X", out[i]); + _stprintf (p, _T("%02X"), out[i]); p += 2; } *p = 0; diff --git a/custom.cpp b/custom.cpp index 2010a46d..872c885f 100644 --- a/custom.cpp +++ b/custom.cpp @@ -88,7 +88,7 @@ void uae_abort (const TCHAR *format,...) _vsntprintf (buffer, sizeof (buffer) - 1, format, parms ); va_end (parms); if (nomore) { - write_log (L"%s\n", buffer); + write_log (_T("%s\n"), buffer); return; } gui_message (buffer); @@ -422,7 +422,7 @@ void reset_frame_rate_hack (void) rpt_did_reset = 1; is_syncline = 0; vsyncmintime = read_processor_time () + vsynctimebase; - write_log (L"Resetting frame rate hack\n"); + write_log (_T("Resetting frame rate hack\n")); } STATIC_INLINE void setclr (uae_u16 *p, uae_u16 val) @@ -438,11 +438,11 @@ STATIC_INLINE void alloc_cycle (int hpos, int type) #ifdef CPUEMU_12 #if 0 if (cycle_line[hpos]) - write_log (L"hpos=%d, old=%d, new=%d\n", hpos, cycle_line[hpos], type); + write_log (_T("hpos=%d, old=%d, new=%d\n"), hpos, cycle_line[hpos], type); if ((type == CYCLE_CPU || type == CYCLE_COPPER) && (hpos & 1)) - write_log (L"odd %d cycle %d\n", hpos); + write_log (_T("odd %d cycle %d\n"), hpos); if (!(hpos & 1) && (type == CYCLE_SPRITE || type == CYCLE_REFRESH || type == CYCLE_MISC)) - write_log (L"even %d cycle %d\n", type, hpos); + write_log (_T("even %d cycle %d\n"), type, hpos); #endif cycle_line[hpos] = type; #endif @@ -479,7 +479,7 @@ STATIC_INLINE uae_u8 *pfield_xlateptr (uaecptr plpt, int bytecount) if (!chipmem_check_indirect (plpt, bytecount)) { static int count = 0; if (!count) - count++, write_log (L"Warning: Bad playfield pointer\n"); + count++, write_log (_T("Warning: Bad playfield pointer\n")); return NULL; } return chipmem_xlate_indirect (plpt); @@ -708,19 +708,19 @@ static void debug_cycle_diagram (void) TCHAR aa; for (fm = 0; fm <= 2; fm++) { - write_log (L"FMODE %d\n=======\n", fm); + write_log (_T("FMODE %d\n=======\n"), fm); for (res = 0; res <= 2; res++) { for (planes = 0; planes <= 8; planes++) { - write_log (L"%d: ",planes); + write_log (_T("%d: "),planes); for (cycle = 0; cycle < 32; cycle++) { v=cycle_diagram_table[fm][res][planes][cycle]; if (v==0) aa='-'; else if(v>0) aa='1'; else aa='X'; - write_log (L"%c",aa); + write_log (_T("%c"),aa); } - write_log (L" %d:%d\n", + write_log (_T(" %d:%d\n"), cycle_diagram_free_cycles[fm][res][planes], cycle_diagram_total_cycles[fm][res][planes]); } - write_log (L"\n"); + write_log (_T("\n")); } } fm=0; @@ -839,7 +839,7 @@ STATIC_INLINE void compute_delay_offset (void) delayoffset = 16; else /* what about 40 and 56? */ delayoffset = 0; - //write_log (L"%d:%d ", vpos, delayoffset); + //write_log (_T("%d:%d "), vpos, delayoffset); #endif } @@ -1639,7 +1639,7 @@ STATIC_INLINE int one_fetch_cycle_0 (int pos, int ddfstop_to_test, int dma, int toscr_nbits += 2 << toscr_res; if (toscr_nbits > 16) { - uae_abort (L"toscr_nbits > 16 (%d)", toscr_nbits); + uae_abort (_T("toscr_nbits > 16 (%d)"), toscr_nbits); toscr_nbits = 0; } if (toscr_nbits == 16) @@ -1660,7 +1660,7 @@ STATIC_INLINE int one_fetch_cycle (int pos, int ddfstop_to_test, int dma, int fm case 1: return one_fetch_cycle_fm1 (pos, ddfstop_to_test, dma); case 2: return one_fetch_cycle_fm2 (pos, ddfstop_to_test, dma); #endif - default: uae_abort (L"fm corrupt"); return 0; + default: uae_abort (_T("fm corrupt")); return 0; } } @@ -1681,7 +1681,7 @@ static void update_fetch_x (int hpos, int fm) toscr_nbits += 2 << toscr_res; if (toscr_nbits > 16) { - uae_abort (L"toscr_nbits > 16 (%d)", toscr_nbits); + uae_abort (_T("toscr_nbits > 16 (%d)"), toscr_nbits); toscr_nbits = 0; } if (toscr_nbits == 16) @@ -1817,7 +1817,7 @@ STATIC_INLINE void decide_fetch (int hpos) case 1: update_fetch_1 (hpos); break; case 2: update_fetch_2 (hpos); break; #endif - default: uae_abort (L"fetchmode corrupt"); + default: uae_abort (_T("fetchmode corrupt")); } } else if (0 && bpl1dat_written) { // "pio" mode display @@ -2195,7 +2195,7 @@ static void do_sprite_collisions (void) { static int olx; if (clxdat != olx) - write_log (L"%d: %04X\n", vpos, clxdat); + write_log (_T("%d: %04X\n"), vpos, clxdat); olx = clxdat; } #endif @@ -2293,7 +2293,7 @@ static void record_sprite (int line, int num, int sprxp, uae_u16 *data, uae_u16 } if (sprxp < e->pos) - uae_abort (L"sprxp < e->pos"); + uae_abort (_T("sprxp < e->pos")); e->max = sprxp + width; e[1].first_pixel = e->first_pixel + ((e->max - e->pos + 3) & ~3); @@ -2540,10 +2540,10 @@ static void finish_decisions (void) record_color_change2 (hsyncstartpos, 0xffff, 0); if (thisline_decision.plfleft != -1 && thisline_decision.plflinelen == -1) { if (fetch_state != fetch_not_started) { - write_log (L"fetch_state=%d plfleft=%d,len=%d,vpos=%d,hpos=%d\n", + write_log (_T("fetch_state=%d plfleft=%d,len=%d,vpos=%d,hpos=%d\n"), fetch_state, thisline_decision.plfleft, thisline_decision.plflinelen, vpos, hpos); - uae_abort (L"fetch_state != fetch_not_started"); + uae_abort (_T("fetch_state != fetch_not_started")); } thisline_decision.plfright = thisline_decision.plfleft; thisline_decision.plflinelen = 0; @@ -2616,7 +2616,7 @@ static void finish_decisions (void) } if (next_color_change >= MAX_REG_CHANGE - 30) { - write_log (L"color_change buffer overflow!\n"); + write_log (_T("color_change buffer overflow!\n")); next_color_change = 0; dip->nr_color_changes = 0; dip->first_color_change = 0; @@ -2752,10 +2752,10 @@ static void dumpsync (void) if (cnt < 0) return; cnt--; - write_log (L"BEAMCON0=%04X VTOTAL=%04X HTOTAL=%04X\n", new_beamcon0, vtotal, htotal); - write_log (L" HSSTOP=%04X HBSTRT=%04X HBSTOP=%04X\n", hsstop, hbstrt, hbstop); - write_log (L" VSSTOP=%04X VBSTRT=%04X VBSTOP=%04X\n", vsstop, vbstrt, vbstop); - write_log (L" HSSTRT=%04X VSSTRT=%04X HCENTER=%04X\n", hsstrt, vsstrt, hcenter); + write_log (_T("BEAMCON0=%04X VTOTAL=%04X HTOTAL=%04X\n"), new_beamcon0, vtotal, htotal); + write_log (_T(" HSSTOP=%04X HBSTRT=%04X HBSTOP=%04X\n"), hsstop, hbstrt, hbstop); + write_log (_T(" VSSTOP=%04X VBSTRT=%04X VBSTOP=%04X\n"), vsstop, vbstrt, vbstop); + write_log (_T(" HSSTRT=%04X VSSTRT=%04X HCENTER=%04X\n"), hsstrt, vsstrt, hcenter); } int current_maxvpos (void) @@ -2769,12 +2769,12 @@ static void checklacecount (bool lace) if (nlace_cnt >= NLACE_CNT_NEEDED && lace) { lof_togglecnt_lace = LOF_TOGGLES_NEEDED; lof_togglecnt_nlace = 0; - //write_log (L"immediate lace\n"); + //write_log (_T("immediate lace\n")); nlace_cnt = 0; } else if (nlace_cnt <= -NLACE_CNT_NEEDED && !lace) { lof_togglecnt_nlace = LOF_TOGGLES_NEEDED; lof_togglecnt_lace = 0; - //write_log (L"immediate nlace\n"); + //write_log (_T("immediate nlace\n")); nlace_cnt = 0; } } @@ -2924,14 +2924,14 @@ static void compute_framesync (void) compute_vsynctime (); - write_log (L"%s mode%s%s V=%.4fHz H=%0.4fHz (%dx%d+%d) IDX=%d (%s)\n", - isntsc ? L"NTSC" : L"PAL", - islace ? L" laced" : L"", - doublescan > 0 ? L" dblscan" : L"", + write_log (_T("%s mode%s%s V=%.4fHz H=%0.4fHz (%dx%d+%d) IDX=%d (%s)\n"), + isntsc ? _T("NTSC") : _T("PAL"), + islace ? _T(" laced") : _T(""), + doublescan > 0 ? _T(" dblscan") : _T(""), vblank_hz, vblank_hz * maxvpos_nom, maxhpos, maxvpos, lof_store ? 1 : 0, cr ? cr->index : -1, - cr != NULL && cr->label != NULL ? cr->label : L"" + cr != NULL && cr->label != NULL ? cr->label : _T("") ); config_changed = 1; @@ -2953,7 +2953,7 @@ void init_hz (bool fullinit) if ((beamcon0 & 0xA0) != (new_beamcon0 & 0xA0)) hzc = 1; if (beamcon0 != new_beamcon0) { - write_log (L"BEAMCON0 %04x -> %04x PC%=%08x\n", beamcon0, new_beamcon0, M68K_GETPC); + write_log (_T("BEAMCON0 %04x -> %04x PC%=%08x\n"), beamcon0, new_beamcon0, M68K_GETPC); vpos_count = vpos_count_prev = 0; } beamcon0 = new_beamcon0; @@ -3254,7 +3254,7 @@ STATIC_INLINE uae_u16 VPOSR (void) vp |= lol ? 0x80 : 0; #if 0 if (M68K_GETPC < 0x00f00000 || M68K_GETPC >= 0x10000000) - write_log (L"VPOSR %04x at %08x\n", vp, M68K_GETPC); + write_log (_T("VPOSR %04x at %08x\n"), vp, M68K_GETPC); #endif if (currprefs.cpu_model >= 68020) hsyncdelay (); @@ -3265,7 +3265,7 @@ static void VPOSW (uae_u16 v) { #if 0 if (M68K_GETPC < 0xf00000 || 1) - write_log (L"VPOSW %04X PC=%08x\n", v, M68K_GETPC); + write_log (_T("VPOSW %04X PC=%08x\n"), v, M68K_GETPC); #endif if (lof_store != ((v & 0x8000) ? 1 : 0)) { lof_store = (v & 0x8000) ? 1 : 0; @@ -3289,7 +3289,7 @@ static void VHPOSW (uae_u16 v) { #if 0 if (M68K_GETPC < 0xf00000 || 1) - write_log (L"VHPOSW %04X PC=%08x\n", v, M68K_GETPC); + write_log (_T("VHPOSW %04X PC=%08x\n"), v, M68K_GETPC); #endif v >>= 8; // lets ignore hpos for now vpos &= 0xff00; @@ -3320,7 +3320,7 @@ STATIC_INLINE uae_u16 VHPOSR (void) hsyncdelay (); #if 0 if (M68K_GETPC < 0x00f00000 || M68K_GETPC >= 0x10000000) - write_log (L"VPOS %04x %04x at %08x\n", VPOSR (), vp, M68K_GETPC); + write_log (_T("VPOS %04x %04x at %08x\n"), VPOSR (), vp, M68K_GETPC); #endif return vp; } @@ -3410,7 +3410,7 @@ static void COPJMP (int num, int vblank) #if CUSTOM_DEBUG > 0 if (dmaen (DMA_COPPER) && (cop_state.saved_i1 != 0xffff || cop_state.saved_i2 != 0xfffe)) - write_log (L"vblank without copper ending %08x (%08x %08x)\n", cop_state.ip, cop1lc, cop2lc); + write_log (_T("vblank without copper ending %08x (%08x %08x)\n"), cop_state.ip, cop1lc, cop2lc); #endif unset_special (SPCFLAG_COPPER); @@ -3576,7 +3576,7 @@ static void INTENA (uae_u16 v) } #if 0 if (v & 0x40) - write_log (L"INTENA %04X (%04X) %p\n", intena, v, M68K_GETPC); + write_log (_T("INTENA %04X (%04X) %p\n"), intena, v, M68K_GETPC); #endif } @@ -3602,7 +3602,7 @@ void INTREQ_0 (uae_u16 v) { #if 0 if (!(v & 0x8000) && (v & (0x80 | 0x100 | 0x200 | 0x400))) - write_log (L"audirq clear %d\n", v); + write_log (_T("audirq clear %d\n"), v); #endif uae_u16 old = intreq; @@ -3662,7 +3662,7 @@ static void BEAMCON0 (uae_u16 v) if (v != new_beamcon0) { new_beamcon0 = v; if (v & ~0x20) - write_log (L"warning: %04X written to BEAMCON0 PC=%08X\n", v, M68K_GETPC); + write_log (_T("warning: %04X written to BEAMCON0 PC=%08X\n"), v, M68K_GETPC); } } } @@ -3708,7 +3708,7 @@ static void BPLxPTH (int hpos, uae_u16 v, int num) decide_fetch (hpos); bplpt[num] = (bplpt[num] & 0x0000ffff) | ((uae_u32)v << 16); bplptx[num] = (bplptx[num] & 0x0000ffff) | ((uae_u32)v << 16); - //write_log (L"%d:%d:BPL%dPTH %08X COP=%08x\n", hpos, vpos, num, bplpt[num], cop_state.ip); + //write_log (_T("%d:%d:BPL%dPTH %08X COP=%08x\n"), hpos, vpos, num, bplpt[num], cop_state.ip); } static void BPLxPTL (int hpos, uae_u16 v, int num) { @@ -3723,7 +3723,7 @@ static void BPLxPTL (int hpos, uae_u16 v, int num) return; bplpt[num] = (bplpt[num] & 0xffff0000) | (v & 0x0000fffe); bplptx[num] = (bplptx[num] & 0xffff0000) | (v & 0x0000fffe); - //write_log (L"%d:%d:BPL%dPTL %08X COP=%08x\n", hpos, vpos, num, bplpt[num], cop_state.ip); + //write_log (_T("%d:%d:BPL%dPTL %08X COP=%08x\n"), hpos, vpos, num, bplpt[num], cop_state.ip); } static void BPLCON0_Denise (int hpos, uae_u16 v) @@ -3936,7 +3936,7 @@ static void DDFSTRT (int hpos, uae_u16 v) static int last_warned; last_warned = (last_warned + 1) & 4095; if (last_warned == 0) - write_log (L"WARNING! Very strange DDF values (%x %x).\n", ddfstrt, ddfstop); + write_log (_T("WARNING! Very strange DDF values (%x %x).\n"), ddfstrt, ddfstop); } } @@ -3958,7 +3958,7 @@ static void DDFSTOP (int hpos, uae_u16 v) if (ddfstop > 0xD4 && (ddfstrt & 4) == 4) { static int last_warned; if (last_warned == 0) - write_log (L"WARNING! Very strange DDF values (%x).\n", ddfstop); + write_log (_T("WARNING! Very strange DDF values (%x).\n"), ddfstop); last_warned = (last_warned + 1) & 4095; } } @@ -4129,7 +4129,7 @@ STATIC_INLINE void SPRxCTL_1 (uae_u16 v, int num, int hpos) SPRxCTLPOS (num); #if SPRITE_DEBUG > 0 if (vpos >= SPRITE_DEBUG_MINY && vpos <= SPRITE_DEBUG_MAXY) { - write_log (L"%d:%d:SPR%dCTL %04X P=%06X VSTRT=%d VSTOP=%d HSTRT=%d D=%d A=%d CP=%x PC=%x\n", + write_log (_T("%d:%d:SPR%dCTL %04X P=%06X VSTRT=%d VSTOP=%d HSTRT=%d D=%d A=%d CP=%x PC=%x\n"), vpos, hpos, num, v, s->pt, s->vstart, s->vstop, s->xpos, spr[num].dmastate, spr[num].armed, cop_state.ip, M68K_GETPC); } #endif @@ -4142,7 +4142,7 @@ STATIC_INLINE void SPRxPOS_1 (uae_u16 v, int num, int hpos) SPRxCTLPOS (num); #if SPRITE_DEBUG > 0 if (vpos >= SPRITE_DEBUG_MINY && vpos <= SPRITE_DEBUG_MAXY) { - write_log (L"%d:%d:SPR%dPOS %04X P=%06X VSTRT=%d VSTOP=%d HSTRT=%d D=%d A=%d CP=%x PC=%x\n", + write_log (_T("%d:%d:SPR%dPOS %04X P=%06X VSTRT=%d VSTOP=%d HSTRT=%d D=%d A=%d CP=%x PC=%x\n"), vpos, hpos, num, v, s->pt, s->vstart, s->vstop, s->xpos, spr[num].dmastate, spr[num].armed, cop_state.ip, M68K_GETPC); } #endif @@ -4158,7 +4158,7 @@ STATIC_INLINE void SPRxDATA_1 (uae_u16 v, int num, int hpos) spr_arm (num, 1); #if SPRITE_DEBUG > 1 if (vpos >= SPRITE_DEBUG_MINY && vpos <= SPRITE_DEBUG_MAXY) { - write_log (L"%d:%d:SPR%dDATA %04X P=%06X D=%d A=%d PC=%x\n", + write_log (_T("%d:%d:SPR%dDATA %04X P=%06X D=%d A=%d PC=%x\n"), vpos, hpos, num, v, spr[num].pt, spr[num].dmastate, spr[num].armed, M68K_GETPC); } #endif @@ -4173,7 +4173,7 @@ STATIC_INLINE void SPRxDATB_1 (uae_u16 v, int num, int hpos) #endif #if SPRITE_DEBUG > 1 if (vpos >= SPRITE_DEBUG_MINY && vpos <= SPRITE_DEBUG_MAXY) { - write_log (L"%d:%d:SPR%dDATB %04X P=%06X D=%d A=%d PC=%x\n", + write_log (_T("%d:%d:SPR%dDATB %04X P=%06X D=%d A=%d PC=%x\n"), vpos, hpos, num, v, spr[num].pt, spr[num].dmastate, spr[num].armed, M68K_GETPC); } #endif @@ -4191,7 +4191,7 @@ static void SPRxPTH (int hpos, uae_u16 v, int num) } #if SPRITE_DEBUG > 0 if (vpos >= SPRITE_DEBUG_MINY && vpos <= SPRITE_DEBUG_MAXY) { - write_log (L"%d:%d:SPR%dPTH %06X\n", vpos, hpos, num, spr[num].pt); + write_log (_T("%d:%d:SPR%dPTH %06X\n"), vpos, hpos, num, spr[num].pt); } #endif } @@ -4204,7 +4204,7 @@ static void SPRxPTL (int hpos, uae_u16 v, int num) } #if SPRITE_DEBUG > 0 if (vpos >= SPRITE_DEBUG_MINY && vpos <= SPRITE_DEBUG_MAXY) { - write_log (L"%d:%d:SPR%dPTL %06X\n", vpos, hpos, num, spr[num].pt); + write_log (_T("%d:%d:SPR%dPTL %06X\n"), vpos, hpos, num, spr[num].pt); } #endif } @@ -4247,7 +4247,7 @@ void dump_aga_custom (void) rgb2 = current_colors.color_regs_aga[c2] | (color_regs_aga_genlock[c2] << 31); rgb3 = current_colors.color_regs_aga[c3] | (color_regs_aga_genlock[c3] << 31); rgb4 = current_colors.color_regs_aga[c4] | (color_regs_aga_genlock[c4] << 31); - console_out_f (L"%3d %08X %3d %08X %3d %08X %3d %08X\n", + console_out_f (_T("%3d %08X %3d %08X %3d %08X %3d %08X\n"), c1, rgb1, c2, rgb2, c3, rgb3, c4, rgb4); } } @@ -4417,11 +4417,11 @@ static int custom_wput_copper (int hpos, uaecptr addr, uae_u32 value, int noget) static void dump_copper (TCHAR *error, int until_hpos) { - write_log (L"%s: vpos=%d until_hpos=%d\n", + write_log (_T("%s: vpos=%d until_hpos=%d\n"), error, vpos, until_hpos); - write_log (L"cvcmp=%d chcmp=%d chpos=%d cvpos=%d ci1=%04X ci2=%04X\n", + write_log (_T("cvcmp=%d chcmp=%d chpos=%d cvpos=%d ci1=%04X ci2=%04X\n"), cop_state.vcmp,cop_state.hcmp,cop_state.hpos,cop_state.vpos,cop_state.saved_i1,cop_state.saved_i2); - write_log (L"cstate=%d ip=%x SPCFLAGS=%x\n", + write_log (_T("cstate=%d ip=%x SPCFLAGS=%x\n"), cop_state.state, cop_state.ip, regs.spcflags); } @@ -4462,7 +4462,7 @@ static void update_copper (int until_hpos) return; if (cop_state.state == COP_wait && vp < cop_state.vcmp) { - dump_copper (L"error2", until_hpos); + dump_copper (_T("error2"), until_hpos); copper_enabled_thisline = 0; cop_state.state = COP_stop; unset_special (SPCFLAG_COPPER); @@ -4892,12 +4892,12 @@ STATIC_INLINE void do_sprites_1 (int num, int cycle, int hpos) #endif #if SPRITE_DEBUG > 3 if (vpos >= SPRITE_DEBUG_MINY && vpos <= SPRITE_DEBUG_MAXY) - write_log (L"%d:%d:slot%d:%d\n", vpos, hpos, num, cycle); + write_log (_T("%d:%d:slot%d:%d\n"), vpos, hpos, num, cycle); #endif if (vpos == s->vstart) { #if SPRITE_DEBUG > 0 if (!s->dmastate && vpos >= SPRITE_DEBUG_MINY && vpos <= SPRITE_DEBUG_MAXY) - write_log (L"%d:%d:SPR%d START\n", vpos, hpos, num); + write_log (_T("%d:%d:SPR%d START\n"), vpos, hpos, num); #endif s->dmastate = 1; if (num == 0 && cycle == 0) @@ -4906,7 +4906,7 @@ STATIC_INLINE void do_sprites_1 (int num, int cycle, int hpos) if (vpos == s->vstop || vpos == sprite_vblank_endline) { #if SPRITE_DEBUG > 0 if (s->dmastate && vpos >= SPRITE_DEBUG_MINY && vpos <= SPRITE_DEBUG_MAXY) - write_log (L"%d:%d:SPR%d STOP\n", vpos, hpos, num); + write_log (_T("%d:%d:SPR%d STOP\n"), vpos, hpos, num); #endif s->dmastate = 0; #if 0 @@ -4938,7 +4938,7 @@ STATIC_INLINE void do_sprites_1 (int num, int cycle, int hpos) sprite_fetch2 (s, hpos, cycle, 0); break; } - //write_log (L"%d:%d: %04X=%04X\n", vpos, hpos, 0x140 + cycle * 2 + num * 8, data); + //write_log (_T("%d:%d: %04X=%04X\n"), vpos, hpos, 0x140 + cycle * 2 + num * 8, data); if (cycle == 0) { SPRxPOS_1 (data, num, hpos); s->dmacycle = 1; @@ -4950,7 +4950,7 @@ STATIC_INLINE void do_sprites_1 (int num, int cycle, int hpos) } #if SPRITE_DEBUG > 1 if (vpos >= SPRITE_DEBUG_MINY && vpos <= SPRITE_DEBUG_MAXY) { - write_log (L"%d:%d:dma:P=%06X ", vpos, hpos, s->pt); + write_log (_T("%d:%d:dma:P=%06X "), vpos, hpos, s->pt); } #endif } @@ -4960,7 +4960,7 @@ STATIC_INLINE void do_sprites_1 (int num, int cycle, int hpos) data = sprite_fetch (s, dma, hpos, cycle, 1); #if SPRITE_DEBUG > 1 if (vpos >= SPRITE_DEBUG_MINY && vpos <= SPRITE_DEBUG_MAXY) { - write_log (L"%d:%d:dma:P=%06X ", vpos, hpos, s->pt); + write_log (_T("%d:%d:dma:P=%06X "), vpos, hpos, s->pt); } #endif if (cycle == 0) { @@ -5128,9 +5128,9 @@ static void do_savestate(void); static int rpt_vsync (void) { - int v = read_processor_time () - vsyncmintime; + int v = read_processor_time () - vsyncmaxtime; if (v > (int)syncbase || v < -((int)syncbase)) { - vsyncmintime = read_processor_time (); + vsyncmintime = vsyncmaxtime = read_processor_time (); v = 0; } return v; @@ -5183,7 +5183,8 @@ static void framewait (void) bool show = show_screen_maybe (false); vsync_busywait_do (&freetime, (bplcon0 & 4) != 0 && !lof_changed && !lof_changing, lof_store != 0); curr_time = read_processor_time (); - vsyncmintime = curr_time + vsynctimebase; + vsyncmintime = curr_time; + vsyncmaxtime = curr_time + vsynctimebase; if (!show) { show_screen (); if (extraframewait) @@ -5220,7 +5221,8 @@ static void framewait (void) rtg_vsynccheck (); idletime += read_processor_time() - start; curr_time = read_processor_time (); - vsyncmintime = vsyncmaxtime = curr_time + vsynctimebase; + vsyncmintime = curr_time; + vsyncmaxtime = curr_time + vsynctimebase; if (didrender) show_screen (); frame_shown = true; @@ -5337,7 +5339,7 @@ static void vsync_handler_post (void) vsync_rendered = false; frame_shown = false; - //write_log (L"%d %d %d\n", vsynctimebase, read_processor_time () - vsyncmintime, read_processor_time () - prevtime); + //write_log (_T("%d %d %d\n"), vsynctimebase, read_processor_time () - vsyncmintime, read_processor_time () - prevtime); prevtime = read_processor_time (); fpscounter (); @@ -5346,7 +5348,7 @@ static void vsync_handler_post (void) #if CUSTOM_DEBUG > 1 if ((intreq & 0x0020) && (intena & 0x0020)) - write_log (L"vblank interrupt not cleared\n"); + write_log (_T("vblank interrupt not cleared\n")); #endif DISK_vsync (); @@ -5404,7 +5406,7 @@ static void copper_check (int n) int vp = vpos & (((cop_state.saved_i2 >> 8) & 0x7F) | 0x80); if (vp < cop_state.vcmp) { if (copper_enabled_thisline) - write_log (L"COPPER BUG %d: vp=%d vpos=%d vcmp=%d act=%d thisline=%d\n", n, vp, vpos, cop_state.vcmp, copper_enabled_thisline); + write_log (_T("COPPER BUG %d: vp=%d vpos=%d vcmp=%d act=%d thisline=%d\n"), n, vp, vpos, cop_state.vcmp, copper_enabled_thisline); } } } @@ -5579,7 +5581,7 @@ static void events_dmal (int hp) static void events_dmal_hsync (void) { if (dmal) - write_log (L"DMAL error!? %04x\n", dmal); + write_log (_T("DMAL error!? %04x\n"), dmal); dmal = audio_dmal (); dmal <<= 6; dmal |= disk_dmal (); @@ -5820,8 +5822,23 @@ static void hsync_handler_post (bool onvsync) is_syncline = 0; } } + } else { +#if 0 + if (vpos + 1 < maxvpos + lof_store) { + int mult = 90; + frame_time_t rpt = read_processor_time (); + vsyncmintime += (vsynctimebase * mult) / (maxvpos_nom * 100); + if ((int)vsyncmintime - (int)vsyncmaxtime > 0) + vsyncmintime = vsyncmaxtime; + // sleep if more than 2ms "free" time + if (!vblank_found_chipset && (int)vsyncmintime - (int)(rpt + vsynctimebase / 10) > 0) { + sleep_millis_main (1); + } + } +#endif } + if (!nocustom ()) { int lineno = vpos; if (lineno >= MAXVPOS) @@ -5999,7 +6016,7 @@ void custom_reset (int hardreset) target_reset (); reset_all_systems (); - write_log (L"Reset at %08X\n", M68K_GETPC); + write_log (_T("Reset at %08X\n"), M68K_GETPC); memory_map_dump (); lightpen_x = lightpen_y = -1; @@ -6155,14 +6172,14 @@ void custom_reset (int hardreset) CLXCON (clxcon); CLXCON2 (clxcon2); calcdiw (); - write_log (L"CPU=%d Chipset=%s %s\n", + write_log (_T("CPU=%d Chipset=%s %s\n"), currprefs.cpu_model, - (currprefs.chipset_mask & CSMASK_AGA) ? L"AGA" : - (currprefs.chipset_mask & CSMASK_ECS_AGNUS | CSMASK_ECS_DENISE) == (CSMASK_ECS_AGNUS | CSMASK_ECS_DENISE) ? L"Full ECS" : - (currprefs.chipset_mask & CSMASK_ECS_DENISE) ? L"ECS Denise" : - (currprefs.chipset_mask & CSMASK_ECS_AGNUS) ? L"ECS" : - L"OCS", currprefs.ntscmode ? L"NTSC" : L"PAL"); - write_log (L"State restored\n"); + (currprefs.chipset_mask & CSMASK_AGA) ? _T("AGA") : + (currprefs.chipset_mask & CSMASK_ECS_AGNUS | CSMASK_ECS_DENISE) == (CSMASK_ECS_AGNUS | CSMASK_ECS_DENISE) ? _T("Full ECS") : + (currprefs.chipset_mask & CSMASK_ECS_DENISE) ? _T("ECS Denise") : + (currprefs.chipset_mask & CSMASK_ECS_AGNUS) ? _T("ECS") : + _T("OCS"), currprefs.ntscmode ? _T("NTSC") : _T("PAL")); + write_log (_T("State restored\n")); for (i = 0; i < 8; i++) nr_armed += spr[i].armed != 0; if (! currprefs.produce_sound) { @@ -6190,20 +6207,20 @@ void custom_reset (int hardreset) void dumpcustom (void) { - console_out_f (L"DMACON: %04x INTENA: %04x (%04x) INTREQ: %04x (%04x) VPOS: %x HPOS: %x\n", DMACONR (current_hpos ()), + console_out_f (_T("DMACON: %04x INTENA: %04x (%04x) INTREQ: %04x (%04x) VPOS: %x HPOS: %x\n"), DMACONR (current_hpos ()), intena, intena_internal, intreq, intreq_internal, vpos, current_hpos ()); - console_out_f (L"COP1LC: %08lx, COP2LC: %08lx COPPTR: %08lx\n", (unsigned long)cop1lc, (unsigned long)cop2lc, cop_state.ip); - console_out_f (L"DIWSTRT: %04x DIWSTOP: %04x DDFSTRT: %04x DDFSTOP: %04x\n", + console_out_f (_T("COP1LC: %08lx, COP2LC: %08lx COPPTR: %08lx\n"), (unsigned long)cop1lc, (unsigned long)cop2lc, cop_state.ip); + console_out_f (_T("DIWSTRT: %04x DIWSTOP: %04x DDFSTRT: %04x DDFSTOP: %04x\n"), (unsigned int)diwstrt, (unsigned int)diwstop, (unsigned int)ddfstrt, (unsigned int)ddfstop); - console_out_f (L"BPLCON 0: %04x 1: %04x 2: %04x 3: %04x 4: %04x LOF=%d/%d HDIW=%d VDIW=%d\n", + console_out_f (_T("BPLCON 0: %04x 1: %04x 2: %04x 3: %04x 4: %04x LOF=%d/%d HDIW=%d VDIW=%d\n"), bplcon0, bplcon1, bplcon2, bplcon3, bplcon4, lof_current, lof_store, hdiwstate == DIW_waiting_start ? 0 : 1, diwstate == DIW_waiting_start ? 0 : 1); if (timeframes) { - console_out_f (L"Average frame time: %.2f ms [frames: %d time: %d]\n", + console_out_f (_T("Average frame time: %.2f ms [frames: %d time: %d]\n"), (double)frametime / timeframes, timeframes, frametime); if (total_skipped) - console_out_f (L"Skipped frames: %d\n", total_skipped); + console_out_f (_T("Skipped frames: %d\n"), total_skipped); } } @@ -6287,7 +6304,7 @@ static void REGPARAM3 custom_bput (uaecptr, uae_u32) REGPARAM; addrbank custom_bank = { custom_lget, custom_wget, custom_bget, custom_lput, custom_wput, custom_bput, - default_xlate, default_check, NULL, L"Custom chipset", + default_xlate, default_check, NULL, _T("Custom chipset"), custom_lgeti, custom_wgeti, ABFLAG_IO }; @@ -6312,7 +6329,7 @@ STATIC_INLINE uae_u32 REGPARAM2 custom_wget_1 (int hpos, uaecptr addr, int noput #endif addr &= 0xfff; #if CUSTOM_DEBUG > 2 - write_log (L"%d:%d:wget: %04X=%04X pc=%p\n", current_hpos(), vpos, addr, addr & 0x1fe, m68k_getpc ()); + write_log (_T("%d:%d:wget: %04X=%04X pc=%p\n"), current_hpos(), vpos, addr, addr & 0x1fe, m68k_getpc ()); #endif switch (addr & 0x1fe) { case 0x002: v = DMACONR (hpos); break; @@ -6383,7 +6400,7 @@ STATIC_INLINE uae_u32 REGPARAM2 custom_wget_1 (int hpos, uaecptr addr, int noput v = 0xffff; } #if CUSTOM_DEBUG > 0 - write_log (L"%08X read = %04X. Value written=%04X PC=%08x\n", 0xdff000 | addr, v, l, M68K_GETPC); + write_log (_T("%08X read = %04X. Value written=%04X PC=%08x\n"), 0xdff000 | addr, v, l, M68K_GETPC); #endif return v; } @@ -6650,7 +6667,7 @@ static int REGPARAM2 custom_wput_1 (int hpos, uaecptr addr, uae_u32 value, int n default: if (!noget) { #if CUSTOM_DEBUG > 0 - write_log (L"%04X written %08x\n", addr, M68K_GETPC); + write_log (_T("%04X written %08x\n"), addr, M68K_GETPC); #endif custom_wget_1 (hpos, addr, 1); } @@ -6666,7 +6683,7 @@ static void REGPARAM2 custom_wput (uaecptr addr, uae_u32 value) special_mem |= S_WRITE; #endif #if CUSTOM_DEBUG > 2 - write_log (L"%d:%d:wput: %04X %04X pc=%p\n", hpos, vpos, addr & 0x01fe, value & 0xffff, m68k_getpc ()); + write_log (_T("%d:%d:wput: %04X %04X pc=%p\n"), hpos, vpos, addr & 0x01fe, value & 0xffff, m68k_getpc ()); #endif sync_copper_with_cpu (hpos, 1); if (addr & 1) { @@ -7293,7 +7310,7 @@ uae_u8 *save_cycles (int *len, uae_u8 *dstptr) save_u32 (CYCLE_UNIT); save_u64 (get_cycles ()); save_u32 (extra_cycle); - write_log (L"SAVECYCLES %08X\n", get_cycles ()); + write_log (_T("SAVECYCLES %08X\n"), get_cycles ()); *len = dst - dstbak; return dstbak; } @@ -7305,7 +7322,7 @@ uae_u8 *restore_cycles (uae_u8 *src) restore_u32 (); start_cycles = restore_u64 (); extra_cycle = restore_u32 (); - write_log (L"RESTORECYCLES %08X\n", start_cycles); + write_log (_T("RESTORECYCLES %08X\n"), start_cycles); return src; } diff --git a/custom2.cpp b/custom2.cpp index 72e15a81..2e5df277 100644 --- a/custom2.cpp +++ b/custom2.cpp @@ -84,7 +84,7 @@ void uae_abort (const TCHAR *format,...) _vsntprintf (buffer, sizeof (buffer) - 1, format, parms ); va_end (parms); if (nomore) { - write_log (L"%s\n", buffer); + write_log (_T("%s\n"), buffer); return; } gui_message (buffer); @@ -421,7 +421,7 @@ void reset_frame_rate_hack (void) rpt_did_reset = 1; is_lastline = 0; vsyncmintime = read_processor_time () + vsynctime; - write_log (L"Resetting frame rate hack\n"); + write_log (_T("Resetting frame rate hack\n")); } STATIC_INLINE void setclr (uae_u16 *p, uae_u16 val) @@ -437,11 +437,11 @@ STATIC_INLINE void alloc_cycle (int hpos, int type) #ifdef CPUEMU_12 #if 0 if (cycle_line[hpos]) - write_log (L"hpos=%d, old=%d, new=%d\n", hpos, cycle_line[hpos], type); + write_log (_T("hpos=%d, old=%d, new=%d\n"), hpos, cycle_line[hpos], type); if ((type == CYCLE_CPU || type == CYCLE_COPPER) && (hpos & 1)) - write_log (L"odd %d cycle %d\n", hpos); + write_log (_T("odd %d cycle %d\n"), hpos); if (!(hpos & 1) && (type == CYCLE_SPRITE || type == CYCLE_REFRESH || type == CYCLE_MISC)) - write_log (L"even %d cycle %d\n", type, hpos); + write_log (_T("even %d cycle %d\n"), type, hpos); #endif cycle_line[hpos] = type; #endif @@ -478,7 +478,7 @@ STATIC_INLINE uae_u8 *pfield_xlateptr (uaecptr plpt, int bytecount) if (!chipmem_check_indirect (plpt, bytecount)) { static int count = 0; if (!count) - count++, write_log (L"Warning: Bad playfield pointer\n"); + count++, write_log (_T("Warning: Bad playfield pointer\n")); return NULL; } return chipmem_xlate_indirect (plpt); @@ -707,19 +707,19 @@ static void debug_cycle_diagram (void) TCHAR aa; for (fm = 0; fm <= 2; fm++) { - write_log (L"FMODE %d\n=======\n", fm); + write_log (_T("FMODE %d\n=======\n"), fm); for (res = 0; res <= 2; res++) { for (planes = 0; planes <= 8; planes++) { - write_log (L"%d: ",planes); + write_log (_T("%d: "),planes); for (cycle = 0; cycle < 32; cycle++) { v=cycle_diagram_table[fm][res][planes][cycle]; if (v==0) aa='-'; else if(v>0) aa='1'; else aa='X'; - write_log (L"%c",aa); + write_log (_T("%c"),aa); } - write_log (L" %d:%d\n", + write_log (_T(" %d:%d\n"), cycle_diagram_free_cycles[fm][res][planes], cycle_diagram_total_cycles[fm][res][planes]); } - write_log (L"\n"); + write_log (_T("\n")); } } fm=0; @@ -838,7 +838,7 @@ STATIC_INLINE void compute_delay_offset (void) delayoffset = 16; else /* what about 40 and 56? */ delayoffset = 0; - //write_log (L"%d:%d ", vpos, delayoffset); + //write_log (_T("%d:%d "), vpos, delayoffset); #endif } @@ -1638,7 +1638,7 @@ STATIC_INLINE int one_fetch_cycle_0 (int pos, int ddfstop_to_test, int dma, int toscr_nbits += 2 << toscr_res; if (toscr_nbits > 16) { - uae_abort (L"toscr_nbits > 16 (%d)", toscr_nbits); + uae_abort (_T("toscr_nbits > 16 (%d)"), toscr_nbits); toscr_nbits = 0; } if (toscr_nbits == 16) @@ -1659,7 +1659,7 @@ STATIC_INLINE int one_fetch_cycle (int pos, int ddfstop_to_test, int dma, int fm case 1: return one_fetch_cycle_fm1 (pos, ddfstop_to_test, dma); case 2: return one_fetch_cycle_fm2 (pos, ddfstop_to_test, dma); #endif - default: uae_abort (L"fm corrupt"); return 0; + default: uae_abort (_T("fm corrupt")); return 0; } } @@ -1686,7 +1686,7 @@ static void update_fetch_x (int hpos, int fm) toscr_nbits += 2 << toscr_res; if (toscr_nbits > 16) { - uae_abort (L"toscr_nbits > 16 (%d)", toscr_nbits); + uae_abort (_T("toscr_nbits > 16 (%d)"), toscr_nbits); toscr_nbits = 0; } if (toscr_nbits == 16) @@ -1822,7 +1822,7 @@ STATIC_INLINE void decide_fetch (int hpos) case 1: update_fetch_1 (hpos); break; case 2: update_fetch_2 (hpos); break; #endif - default: uae_abort (L"fetchmode corrupt"); + default: uae_abort (_T("fetchmode corrupt")); } } else if (bpl1dat_written) { // "PIO" mode display @@ -2223,7 +2223,7 @@ static void do_sprite_collisions (void) { static int olx; if (clxdat != olx) - write_log (L"%d: %04X\n", vpos, clxdat); + write_log (_T("%d: %04X\n"), vpos, clxdat); olx = clxdat; } #endif @@ -2321,7 +2321,7 @@ static void record_sprite (int line, int num, int sprxp, uae_u16 *data, uae_u16 } if (sprxp < e->pos) - uae_abort (L"sprxp < e->pos"); + uae_abort (_T("sprxp < e->pos")); e->max = sprxp + width; e[1].first_pixel = e->first_pixel + ((e->max - e->pos + 3) & ~3); @@ -2571,10 +2571,10 @@ static void finish_decisions (void) record_color_change2 (hsyncstartpos, 0xffff, 0); if (thisline_decision.plfleft != -1 && thisline_decision.plflinelen == -1) { if (fetch_state != fetch_not_started) { - write_log (L"fetch_state=%d plfleft=%d,len=%d,vpos=%d,hpos=%d\n", + write_log (_T("fetch_state=%d plfleft=%d,len=%d,vpos=%d,hpos=%d\n"), fetch_state, thisline_decision.plfleft, thisline_decision.plflinelen, vpos, hpos); - uae_abort (L"fetch_state != fetch_not_started"); + uae_abort (_T("fetch_state != fetch_not_started")); } thisline_decision.plfright = thisline_decision.plfleft; thisline_decision.plflinelen = 0; @@ -2643,7 +2643,7 @@ static void finish_decisions (void) } if (next_color_change >= MAX_REG_CHANGE - 30) { - write_log (L"color_change buffer overflow!\n"); + write_log (_T("color_change buffer overflow!\n")); next_color_change = 0; dip->nr_color_changes = 0; dip->first_color_change = 0; @@ -2780,10 +2780,10 @@ static void dumpsync (void) if (cnt < 0) return; cnt--; - write_log (L"BEAMCON0=%04X VTOTAL=%04X HTOTAL=%04X\n", new_beamcon0, vtotal, htotal); - write_log (L" HSSTOP=%04X HBSTRT=%04X HBSTOP=%04X\n", hsstop, hbstrt, hbstop); - write_log (L" VSSTOP=%04X VBSTRT=%04X VBSTOP=%04X\n", vsstop, vbstrt, vbstop); - write_log (L" HSSTRT=%04X VSSTRT=%04X HCENTER=%04X\n", hsstrt, vsstrt, hcenter); + write_log (_T("BEAMCON0=%04X VTOTAL=%04X HTOTAL=%04X\n"), new_beamcon0, vtotal, htotal); + write_log (_T(" HSSTOP=%04X HBSTRT=%04X HBSTOP=%04X\n"), hsstop, hbstrt, hbstop); + write_log (_T(" VSSTOP=%04X VBSTRT=%04X VBSTOP=%04X\n"), vsstop, vbstrt, vbstop); + write_log (_T(" HSSTRT=%04X VSSTRT=%04X HCENTER=%04X\n"), hsstrt, vsstrt, hcenter); } int current_maxvpos (void) @@ -2814,7 +2814,7 @@ void init_hz (bool fullinit) if ((beamcon0 & 0xA0) != (new_beamcon0 & 0xA0)) hzc = 1; if (beamcon0 != new_beamcon0) { - write_log (L"BEAMCON0 %04x -> %04x PC%=%08x\n", beamcon0, new_beamcon0, M68K_GETPC); + write_log (_T("BEAMCON0 %04x -> %04x PC%=%08x\n"), beamcon0, new_beamcon0, M68K_GETPC); vpos_count = vpos_count_prev = 0; } beamcon0 = new_beamcon0; @@ -2921,10 +2921,10 @@ void init_hz (bool fullinit) if (vblank_hz != ovblank) updatedisplayarea (); inputdevice_tablet_strobe (); - write_log (L"%s mode%s%s V=%.4fHz H=%0.4fHz (%dx%d+%d)\n", - isntsc ? L"NTSC" : L"PAL", - (bplcon0 & 4) ? L" interlaced" : L"", - doublescan > 0 ? L" dblscan" : L"", + write_log (_T("%s mode%s%s V=%.4fHz H=%0.4fHz (%dx%d+%d)\n"), + isntsc ? _T("NTSC") : _T("PAL"), + (bplcon0 & 4) ? _T(" interlaced") : _T(""), + doublescan > 0 ? _T(" dblscan") : _T(""), vblank_hz, vblank_hz * maxvpos_nom, maxhpos, maxvpos, lof_store ? 1 : 0); config_changed = 1; @@ -3125,7 +3125,7 @@ STATIC_INLINE uae_u16 VPOSR (void) vp |= lol ? 0x80 : 0; #if 0 if (M68K_GETPC < 0x00f00000 || M68K_GETPC >= 0x10000000) - write_log (L"VPOSR %04x at %08x\n", vp, M68K_GETPC); + write_log (_T("VPOSR %04x at %08x\n"), vp, M68K_GETPC); #endif if (currprefs.cpu_model >= 68020) hsyncdelay (); @@ -3136,7 +3136,7 @@ static void VPOSW (uae_u16 v) { #if 0 if (M68K_GETPC < 0xf00000 || 1) - write_log (L"VPOSW %04X PC=%08x\n", v, M68K_GETPC); + write_log (_T("VPOSW %04X PC=%08x\n"), v, M68K_GETPC); #endif if (lof_store != ((v & 0x8000) ? 1 : 0)) { lof_changed = 1; @@ -3160,7 +3160,7 @@ static void VHPOSW (uae_u16 v) { #if 0 if (M68K_GETPC < 0xf00000 || 1) - write_log (L"VHPOSW %04X PC=%08x\n", v, M68K_GETPC); + write_log (_T("VHPOSW %04X PC=%08x\n"), v, M68K_GETPC); #endif v >>= 8; // lets ignore hpos for now vpos &= 0xff00; @@ -3191,7 +3191,7 @@ STATIC_INLINE uae_u16 VHPOSR (void) hsyncdelay (); #if 0 if (M68K_GETPC < 0x00f00000 || M68K_GETPC >= 0x10000000) - write_log (L"VPOS %04x %04x at %08x\n", VPOSR (), vp, M68K_GETPC); + write_log (_T("VPOS %04x %04x at %08x\n"), VPOSR (), vp, M68K_GETPC); #endif return vp; } @@ -3281,7 +3281,7 @@ static void COPJMP (int num, int vblank) #if CUSTOM_DEBUG > 0 if (dmaen (DMA_COPPER) && (cop_state.saved_i1 != 0xffff || cop_state.saved_i2 != 0xfffe)) - write_log (L"vblank without copper ending %08x (%08x %08x)\n", cop_state.ip, cop1lc, cop2lc); + write_log (_T("vblank without copper ending %08x (%08x %08x)\n"), cop_state.ip, cop1lc, cop2lc); #endif unset_special (SPCFLAG_COPPER); @@ -3493,7 +3493,7 @@ static void INTENA (uae_u16 v) } #if 0 if (v & 0x40) - write_log (L"INTENA %04X (%04X) %p\n", intena, v, M68K_GETPC); + write_log (_T("INTENA %04X (%04X) %p\n"), intena, v, M68K_GETPC); #endif } @@ -3518,7 +3518,7 @@ void INTREQ_0 (uae_u16 v) { #if 0 if (!(v & 0x8000) && (v & (0x80 | 0x100 | 0x200 | 0x400))) - write_log (L"audirq clear %d\n", v); + write_log (_T("audirq clear %d\n"), v); #endif uae_u16 old = intreq; @@ -3576,7 +3576,7 @@ static void BEAMCON0 (uae_u16 v) if (v != new_beamcon0) { new_beamcon0 = v; if (v & ~0x20) - write_log (L"warning: %04X written to BEAMCON0 PC=%08X\n", v, M68K_GETPC); + write_log (_T("warning: %04X written to BEAMCON0 PC=%08X\n"), v, M68K_GETPC); } } } @@ -3622,7 +3622,7 @@ static void BPLxPTH (int hpos, uae_u16 v, int num) decide_fetch (hpos); bplpt[num] = (bplpt[num] & 0x0000ffff) | ((uae_u32)v << 16); bplptx[num] = (bplptx[num] & 0x0000ffff) | ((uae_u32)v << 16); - //write_log (L"%d:%d:BPL%dPTH %08X COP=%08x\n", hpos, vpos, num, bplpt[num], cop_state.ip); + //write_log (_T("%d:%d:BPL%dPTH %08X COP=%08x\n"), hpos, vpos, num, bplpt[num], cop_state.ip); } static void BPLxPTL (int hpos, uae_u16 v, int num) { @@ -3637,7 +3637,7 @@ static void BPLxPTL (int hpos, uae_u16 v, int num) return; bplpt[num] = (bplpt[num] & 0xffff0000) | (v & 0x0000fffe); bplptx[num] = (bplptx[num] & 0xffff0000) | (v & 0x0000fffe); - //write_log (L"%d:%d:BPL%dPTL %08X COP=%08x\n", hpos, vpos, num, bplpt[num], cop_state.ip); + //write_log (_T("%d:%d:BPL%dPTL %08X COP=%08x\n"), hpos, vpos, num, bplpt[num], cop_state.ip); } static void BPLCON0_Denise (int hpos, uae_u16 v) @@ -3848,7 +3848,7 @@ static void DDFSTRT (int hpos, uae_u16 v) static int last_warned; last_warned = (last_warned + 1) & 4095; if (last_warned == 0) - write_log (L"WARNING! Very strange DDF values (%x %x).\n", ddfstrt, ddfstop); + write_log (_T("WARNING! Very strange DDF values (%x %x).\n"), ddfstrt, ddfstop); } } @@ -3870,7 +3870,7 @@ static void DDFSTOP (int hpos, uae_u16 v) if (ddfstop > 0xD4 && (ddfstrt & 4) == 4) { static int last_warned; if (last_warned == 0) - write_log (L"WARNING! Very strange DDF values (%x).\n", ddfstop); + write_log (_T("WARNING! Very strange DDF values (%x).\n"), ddfstop); last_warned = (last_warned + 1) & 4095; } } @@ -4041,7 +4041,7 @@ STATIC_INLINE void SPRxCTL_1 (uae_u16 v, int num, int hpos) SPRxCTLPOS (num); #if SPRITE_DEBUG > 0 if (vpos >= SPRITE_DEBUG_MINY && vpos <= SPRITE_DEBUG_MAXY) { - write_log (L"%d:%d:SPR%dCTL %04X P=%06X VSTRT=%d VSTOP=%d HSTRT=%d D=%d A=%d CP=%x PC=%x\n", + write_log (_T("%d:%d:SPR%dCTL %04X P=%06X VSTRT=%d VSTOP=%d HSTRT=%d D=%d A=%d CP=%x PC=%x\n"), vpos, hpos, num, v, s->pt, s->vstart, s->vstop, s->xpos, spr[num].dmastate, spr[num].armed, cop_state.ip, M68K_GETPC); } #endif @@ -4054,7 +4054,7 @@ STATIC_INLINE void SPRxPOS_1 (uae_u16 v, int num, int hpos) SPRxCTLPOS (num); #if SPRITE_DEBUG > 0 if (vpos >= SPRITE_DEBUG_MINY && vpos <= SPRITE_DEBUG_MAXY) { - write_log (L"%d:%d:SPR%dPOS %04X P=%06X VSTRT=%d VSTOP=%d HSTRT=%d D=%d A=%d CP=%x PC=%x\n", + write_log (_T("%d:%d:SPR%dPOS %04X P=%06X VSTRT=%d VSTOP=%d HSTRT=%d D=%d A=%d CP=%x PC=%x\n"), vpos, hpos, num, v, s->pt, s->vstart, s->vstop, s->xpos, spr[num].dmastate, spr[num].armed, cop_state.ip, M68K_GETPC); } #endif @@ -4070,7 +4070,7 @@ STATIC_INLINE void SPRxDATA_1 (uae_u16 v, int num, int hpos) spr_arm (num, 1); #if SPRITE_DEBUG > 1 if (vpos >= SPRITE_DEBUG_MINY && vpos <= SPRITE_DEBUG_MAXY) { - write_log (L"%d:%d:SPR%dDATA %04X P=%06X D=%d A=%d PC=%x\n", + write_log (_T("%d:%d:SPR%dDATA %04X P=%06X D=%d A=%d PC=%x\n"), vpos, hpos, num, v, spr[num].pt, spr[num].dmastate, spr[num].armed, M68K_GETPC); } #endif @@ -4085,7 +4085,7 @@ STATIC_INLINE void SPRxDATB_1 (uae_u16 v, int num, int hpos) #endif #if SPRITE_DEBUG > 1 if (vpos >= SPRITE_DEBUG_MINY && vpos <= SPRITE_DEBUG_MAXY) { - write_log (L"%d:%d:SPR%dDATB %04X P=%06X D=%d A=%d PC=%x\n", + write_log (_T("%d:%d:SPR%dDATB %04X P=%06X D=%d A=%d PC=%x\n"), vpos, hpos, num, v, spr[num].pt, spr[num].dmastate, spr[num].armed, M68K_GETPC); } #endif @@ -4103,7 +4103,7 @@ static void SPRxPTH (int hpos, uae_u16 v, int num) } #if SPRITE_DEBUG > 0 if (vpos >= SPRITE_DEBUG_MINY && vpos <= SPRITE_DEBUG_MAXY) { - write_log (L"%d:%d:SPR%dPTH %06X\n", vpos, hpos, num, spr[num].pt); + write_log (_T("%d:%d:SPR%dPTH %06X\n"), vpos, hpos, num, spr[num].pt); } #endif } @@ -4116,7 +4116,7 @@ static void SPRxPTL (int hpos, uae_u16 v, int num) } #if SPRITE_DEBUG > 0 if (vpos >= SPRITE_DEBUG_MINY && vpos <= SPRITE_DEBUG_MAXY) { - write_log (L"%d:%d:SPR%dPTL %06X\n", vpos, hpos, num, spr[num].pt); + write_log (_T("%d:%d:SPR%dPTL %06X\n"), vpos, hpos, num, spr[num].pt); } #endif } @@ -4159,7 +4159,7 @@ void dump_aga_custom (void) rgb2 = current_colors.color_regs_aga[c2] | (color_regs_aga_genlock[c2] << 31); rgb3 = current_colors.color_regs_aga[c3] | (color_regs_aga_genlock[c3] << 31); rgb4 = current_colors.color_regs_aga[c4] | (color_regs_aga_genlock[c4] << 31); - console_out_f (L"%3d %08X %3d %08X %3d %08X %3d %08X\n", + console_out_f (_T("%3d %08X %3d %08X %3d %08X %3d %08X\n"), c1, rgb1, c2, rgb2, c3, rgb3, c4, rgb4); } } @@ -4306,11 +4306,11 @@ static int custom_wput_copper (int hpos, uaecptr addr, uae_u32 value, int noget) static void dump_copper (TCHAR *error, int until_hpos) { - write_log (L"%s: vpos=%d until_hpos=%d\n", + write_log (_T("%s: vpos=%d until_hpos=%d\n"), error, vpos, until_hpos); - write_log (L"cvcmp=%d chcmp=%d chpos=%d cvpos=%d ci1=%04X ci2=%04X\n", + write_log (_T("cvcmp=%d chcmp=%d chpos=%d cvpos=%d ci1=%04X ci2=%04X\n"), cop_state.vcmp,cop_state.hcmp,cop_state.hpos,cop_state.vpos,cop_state.saved_i1,cop_state.saved_i2); - write_log (L"cstate=%d ip=%x SPCFLAGS=%x\n", + write_log (_T("cstate=%d ip=%x SPCFLAGS=%x\n"), cop_state.state, cop_state.ip, regs.spcflags); } @@ -4351,7 +4351,7 @@ static void update_copper (int until_hpos) return; if (cop_state.state == COP_wait && vp < cop_state.vcmp) { - dump_copper (L"error2", until_hpos); + dump_copper (_T("error2"), until_hpos); copper_enabled_thisline = 0; cop_state.state = COP_stop; unset_special (SPCFLAG_COPPER); @@ -4781,12 +4781,12 @@ STATIC_INLINE void do_sprites_1 (int num, int cycle, int hpos) #endif #if SPRITE_DEBUG > 3 if (vpos >= SPRITE_DEBUG_MINY && vpos <= SPRITE_DEBUG_MAXY) - write_log (L"%d:%d:slot%d:%d\n", vpos, hpos, num, cycle); + write_log (_T("%d:%d:slot%d:%d\n"), vpos, hpos, num, cycle); #endif if (vpos == s->vstart) { #if SPRITE_DEBUG > 0 if (!s->dmastate && vpos >= SPRITE_DEBUG_MINY && vpos <= SPRITE_DEBUG_MAXY) - write_log (L"%d:%d:SPR%d START\n", vpos, hpos, num); + write_log (_T("%d:%d:SPR%d START\n"), vpos, hpos, num); #endif s->dmastate = 1; if (num == 0 && cycle == 0) @@ -4795,7 +4795,7 @@ STATIC_INLINE void do_sprites_1 (int num, int cycle, int hpos) if (vpos == s->vstop || vpos == sprite_vblank_endline) { #if SPRITE_DEBUG > 0 if (s->dmastate && vpos >= SPRITE_DEBUG_MINY && vpos <= SPRITE_DEBUG_MAXY) - write_log (L"%d:%d:SPR%d STOP\n", vpos, hpos, num); + write_log (_T("%d:%d:SPR%d STOP\n"), vpos, hpos, num); #endif s->dmastate = 0; #if 0 @@ -4827,7 +4827,7 @@ STATIC_INLINE void do_sprites_1 (int num, int cycle, int hpos) sprite_fetch2 (s, hpos, cycle, 0); break; } - //write_log (L"%d:%d: %04X=%04X\n", vpos, hpos, 0x140 + cycle * 2 + num * 8, data); + //write_log (_T("%d:%d: %04X=%04X\n"), vpos, hpos, 0x140 + cycle * 2 + num * 8, data); if (cycle == 0) { SPRxPOS_1 (data, num, hpos); s->dmacycle = 1; @@ -4839,7 +4839,7 @@ STATIC_INLINE void do_sprites_1 (int num, int cycle, int hpos) } #if SPRITE_DEBUG > 1 if (vpos >= SPRITE_DEBUG_MINY && vpos <= SPRITE_DEBUG_MAXY) { - write_log (L"%d:%d:dma:P=%06X ", vpos, hpos, s->pt); + write_log (_T("%d:%d:dma:P=%06X "), vpos, hpos, s->pt); } #endif } @@ -4849,7 +4849,7 @@ STATIC_INLINE void do_sprites_1 (int num, int cycle, int hpos) data = sprite_fetch (s, dma, hpos, cycle, 1); #if SPRITE_DEBUG > 1 if (vpos >= SPRITE_DEBUG_MINY && vpos <= SPRITE_DEBUG_MAXY) { - write_log (L"%d:%d:dma:P=%06X ", vpos, hpos, s->pt); + write_log (_T("%d:%d:dma:P=%06X "), vpos, hpos, s->pt); } #endif if (cycle == 0) { @@ -5180,7 +5180,7 @@ static void vsync_handler_post (void) #if CUSTOM_DEBUG > 1 if ((intreq & 0x0020) && (intena & 0x0020)) - write_log (L"vblank interrupt not cleared\n"); + write_log (_T("vblank interrupt not cleared\n")); #endif DISK_vsync (); if (bplcon0 & 4) @@ -5252,7 +5252,7 @@ static void copper_check (int n) int vp = vpos & (((cop_state.saved_i2 >> 8) & 0x7F) | 0x80); if (vp < cop_state.vcmp) { if (copper_enabled_thisline) - write_log (L"COPPER BUG %d: vp=%d vpos=%d vcmp=%d act=%d thisline=%d\n", n, vp, vpos, cop_state.vcmp, copper_enabled_thisline); + write_log (_T("COPPER BUG %d: vp=%d vpos=%d vcmp=%d act=%d thisline=%d\n"), n, vp, vpos, cop_state.vcmp, copper_enabled_thisline); } } } @@ -5425,7 +5425,7 @@ static void events_dmal (int hp) static void events_dmal_hsync (void) { if (dmal) - write_log (L"DMAL error!? %04x\n", dmal); + write_log (_T("DMAL error!? %04x\n"), dmal); dmal = audio_dmal (); dmal <<= 6; dmal |= disk_dmal (); @@ -5820,7 +5820,7 @@ void custom_reset (int hardreset) target_reset (); reset_all_systems (); - write_log (L"Reset at %08X\n", M68K_GETPC); + write_log (_T("Reset at %08X\n"), M68K_GETPC); memory_map_dump (); lightpen_x = lightpen_y = -1; @@ -5971,14 +5971,14 @@ void custom_reset (int hardreset) CLXCON (clxcon); CLXCON2 (clxcon2); calcdiw (); - write_log (L"CPU=%d Chipset=%s %s\n", + write_log (_T("CPU=%d Chipset=%s %s\n"), currprefs.cpu_model, - (currprefs.chipset_mask & CSMASK_AGA) ? L"AGA" : - (currprefs.chipset_mask & CSMASK_ECS_AGNUS | CSMASK_ECS_DENISE) == (CSMASK_ECS_AGNUS | CSMASK_ECS_DENISE) ? L"Full ECS" : - (currprefs.chipset_mask & CSMASK_ECS_DENISE) ? L"ECS Denise" : - (currprefs.chipset_mask & CSMASK_ECS_AGNUS) ? L"ECS" : - L"OCS", currprefs.ntscmode ? L"NTSC" : L"PAL"); - write_log (L"State restored\n"); + (currprefs.chipset_mask & CSMASK_AGA) ? _T("AGA") : + (currprefs.chipset_mask & CSMASK_ECS_AGNUS | CSMASK_ECS_DENISE) == (CSMASK_ECS_AGNUS | CSMASK_ECS_DENISE) ? _T("Full ECS") : + (currprefs.chipset_mask & CSMASK_ECS_DENISE) ? _T("ECS Denise") : + (currprefs.chipset_mask & CSMASK_ECS_AGNUS) ? _T("ECS") : + _T("OCS"), currprefs.ntscmode ? _T("NTSC") : _T("PAL")); + write_log (_T("State restored\n")); for (i = 0; i < 8; i++) nr_armed += spr[i].armed != 0; if (! currprefs.produce_sound) { @@ -6006,20 +6006,20 @@ void custom_reset (int hardreset) void dumpcustom (void) { - console_out_f (L"DMACON: %04x INTENA: %04x (%04x) INTREQ: %04x (%04x) VPOS: %x HPOS: %x\n", DMACONR (current_hpos ()), + console_out_f (_T("DMACON: %04x INTENA: %04x (%04x) INTREQ: %04x (%04x) VPOS: %x HPOS: %x\n"), DMACONR (current_hpos ()), intena, intena_internal, intreq, intreq_internal, vpos, current_hpos ()); - console_out_f (L"COP1LC: %08lx, COP2LC: %08lx COPPTR: %08lx\n", (unsigned long)cop1lc, (unsigned long)cop2lc, cop_state.ip); - console_out_f (L"DIWSTRT: %04x DIWSTOP: %04x DDFSTRT: %04x DDFSTOP: %04x\n", + console_out_f (_T("COP1LC: %08lx, COP2LC: %08lx COPPTR: %08lx\n"), (unsigned long)cop1lc, (unsigned long)cop2lc, cop_state.ip); + console_out_f (_T("DIWSTRT: %04x DIWSTOP: %04x DDFSTRT: %04x DDFSTOP: %04x\n"), (unsigned int)diwstrt, (unsigned int)diwstop, (unsigned int)ddfstrt, (unsigned int)ddfstop); - console_out_f (L"BPLCON 0: %04x 1: %04x 2: %04x 3: %04x 4: %04x LOF=%d/%d HDIW=%d VDIW=%d\n", + console_out_f (_T("BPLCON 0: %04x 1: %04x 2: %04x 3: %04x 4: %04x LOF=%d/%d HDIW=%d VDIW=%d\n"), bplcon0, bplcon1, bplcon2, bplcon3, bplcon4, lof_current, lof_store, hdiwstate == DIW_waiting_start ? 0 : 1, diwstate == DIW_waiting_start ? 0 : 1); if (timeframes) { - console_out_f (L"Average frame time: %.2f ms [frames: %d time: %d]\n", + console_out_f (_T("Average frame time: %.2f ms [frames: %d time: %d]\n"), (double)frametime / timeframes, timeframes, frametime); if (total_skipped) - console_out_f (L"Skipped frames: %d\n", total_skipped); + console_out_f (_T("Skipped frames: %d\n"), total_skipped); } } @@ -6103,7 +6103,7 @@ static void REGPARAM3 custom_bput (uaecptr, uae_u32) REGPARAM; addrbank custom_bank = { custom_lget, custom_wget, custom_bget, custom_lput, custom_wput, custom_bput, - default_xlate, default_check, NULL, L"Custom chipset", + default_xlate, default_check, NULL, _T("Custom chipset"), custom_lgeti, custom_wgeti, ABFLAG_IO }; @@ -6128,7 +6128,7 @@ STATIC_INLINE uae_u32 REGPARAM2 custom_wget_1 (int hpos, uaecptr addr, int noput #endif addr &= 0xfff; #if CUSTOM_DEBUG > 2 - write_log (L"%d:%d:wget: %04X=%04X pc=%p\n", current_hpos(), vpos, addr, addr & 0x1fe, m68k_getpc ()); + write_log (_T("%d:%d:wget: %04X=%04X pc=%p\n"), current_hpos(), vpos, addr, addr & 0x1fe, m68k_getpc ()); #endif switch (addr & 0x1fe) { case 0x002: v = DMACONR (hpos); break; @@ -6199,7 +6199,7 @@ STATIC_INLINE uae_u32 REGPARAM2 custom_wget_1 (int hpos, uaecptr addr, int noput v = 0xffff; } #if CUSTOM_DEBUG > 0 - write_log (L"%08X read = %04X. Value written=%04X PC=%08x\n", 0xdff000 | addr, v, l, M68K_GETPC); + write_log (_T("%08X read = %04X. Value written=%04X PC=%08x\n"), 0xdff000 | addr, v, l, M68K_GETPC); #endif return v; } @@ -6466,7 +6466,7 @@ static int REGPARAM2 custom_wput_1 (int hpos, uaecptr addr, uae_u32 value, int n default: if (!noget) { #if CUSTOM_DEBUG > 0 - write_log (L"%04X written %08x\n", addr, M68K_GETPC); + write_log (_T("%04X written %08x\n"), addr, M68K_GETPC); #endif custom_wget_1 (hpos, addr, 1); } @@ -6482,7 +6482,7 @@ static void REGPARAM2 custom_wput (uaecptr addr, uae_u32 value) special_mem |= S_WRITE; #endif #if CUSTOM_DEBUG > 2 - write_log (L"%d:%d:wput: %04X %04X pc=%p\n", hpos, vpos, addr & 0x01fe, value & 0xffff, m68k_getpc ()); + write_log (_T("%d:%d:wput: %04X %04X pc=%p\n"), hpos, vpos, addr & 0x01fe, value & 0xffff, m68k_getpc ()); #endif sync_copper_with_cpu (hpos, 1); if (addr & 1) { @@ -7109,7 +7109,7 @@ uae_u8 *save_cycles (int *len, uae_u8 *dstptr) save_u32 (CYCLE_UNIT); save_u64 (get_cycles ()); save_u32 (extra_cycle); - write_log (L"SAVECYCLES %08X\n", get_cycles ()); + write_log (_T("SAVECYCLES %08X\n"), get_cycles ()); *len = dst - dstbak; return dstbak; } @@ -7121,7 +7121,7 @@ uae_u8 *restore_cycles (uae_u8 *src) restore_u32 (); start_cycles = restore_u64 (); extra_cycle = restore_u32 (); - write_log (L"RESTORECYCLES %08X\n", start_cycles); + write_log (_T("RESTORECYCLES %08X\n"), start_cycles); return src; } diff --git a/debug.cpp b/debug.cpp index 32b83de1..6ae6c9fc 100644 --- a/debug.cpp +++ b/debug.cpp @@ -87,67 +87,67 @@ int lasthist = 0; static struct regstruct history[MAX_HIST]; static TCHAR help[] = { - L" HELP for UAE Debugger\n" - L" -----------------------\n\n" - L" g [
] Start execution at the current address or
.\n" - L" c Dump state of the CIA, disk drives and custom registers.\n" - L" r Dump state of the CPU.\n" - L" r Modify CPU registers (Dx,Ax,USP,ISP,VBR,...).\n" - L" m
[] Memory dump starting at
.\n" - L" d
[] Disassembly starting at
.\n" - L" t [instructions] Step one or more instructions.\n" - L" z Step through one instruction - useful for JSR, DBRA etc.\n" - L" f Step forward until PC in RAM (\"boot block finder\").\n" - L" f
Add/remove breakpoint.\n" - L" fa
[] []\n" - L" Find effective address
.\n" - L" fi Step forward until PC points to RTS, RTD or RTE.\n" - L" fi Step forward until PC points to .\n" - L" fp \"\"/ Step forward until process or is active.\n" - L" fl List breakpoints.\n" - L" fd Remove all breakpoints.\n" - L" fs Break when (SR & mask) = val.\n" - L" f Step forward until <= PC <= .\n" - L" e Dump contents of all custom registers, ea = AGA colors.\n" - L" i [] Dump contents of interrupt and trap vectors.\n" - L" il [] Exception breakpoint.\n" - L" o <0-2|addr> []View memory as Copper instructions.\n" - L" od Enable/disable Copper vpos/hpos tracing.\n" - L" ot Copper single step trace.\n" - L" ob Copper breakpoint.\n" - L" H[H] Show PC history (HH=full CPU info) instructions.\n" - L" C Search for values like energy or lifes in games.\n" - L" Cl List currently found trainer addresses.\n" - L" D[idxzs <[max diff]>] Deep trainer. i=new value must be larger, d=smaller,\n" - L" x = must be same, z = must be different, s = restart.\n" - L" W
Write into Amiga memory.\n" - L" w
[[.x]] (read/write/opcode/freeze/mustchange).\n" - L" Add/remove memory watchpoints.\n" - L" wd [<0-1>] Enable illegal access logger. 1 = enable break.\n" - L" S Save a block of Amiga memory.\n" - L" s \"\"/ [] []\n" - L" Search for string/bytes.\n" - L" T or Tt Show exec tasks and their PCs.\n" - L" Td,Tl,Tr Show devices, libraries or resources.\n" - L" b Step to previous state capture position.\n" - L" M Enable or disable audio channels, bitplanes or sprites.\n" - L" sp [] Dump sprite information.\n" - L" di [] Break on disk access. R=DMA read,W=write,RW=both,P=PIO.\n" - L" Also enables level 1 disk logging.\n" - L" did Enable disk logging.\n" - L" dj [] Enable joystick/mouse input debugging.\n" - L" smc [<0-1>] Enable self-modifying code detector. 1 = enable break.\n" - L" dm Dump current address space map.\n" - L" v [] Show DMA data (accurate only in cycle-exact mode).\n" - L" v [-1 to -4] = enable visual DMA debugger.\n" - L" ? Hex/Bin/Dec converter.\n" + _T(" HELP for UAE Debugger\n") + _T(" -----------------------\n\n") + _T(" g [
] Start execution at the current address or
.\n") + _T(" c Dump state of the CIA, disk drives and custom registers.\n") + _T(" r Dump state of the CPU.\n") + _T(" r Modify CPU registers (Dx,Ax,USP,ISP,VBR,...).\n") + _T(" m
[] Memory dump starting at
.\n") + _T(" d
[] Disassembly starting at
.\n") + _T(" t [instructions] Step one or more instructions.\n") + _T(" z Step through one instruction - useful for JSR, DBRA etc.\n") + _T(" f Step forward until PC in RAM (\"boot block finder\").\n") + _T(" f
Add/remove breakpoint.\n") + _T(" fa
[] []\n") + _T(" Find effective address
.\n") + _T(" fi Step forward until PC points to RTS, RTD or RTE.\n") + _T(" fi Step forward until PC points to .\n") + _T(" fp \"\"/ Step forward until process or is active.\n") + _T(" fl List breakpoints.\n") + _T(" fd Remove all breakpoints.\n") + _T(" fs Break when (SR & mask) = val.\n") + _T(" f Step forward until <= PC <= .\n") + _T(" e Dump contents of all custom registers, ea = AGA colors.\n") + _T(" i [] Dump contents of interrupt and trap vectors.\n") + _T(" il [] Exception breakpoint.\n") + _T(" o <0-2|addr> []View memory as Copper instructions.\n") + _T(" od Enable/disable Copper vpos/hpos tracing.\n") + _T(" ot Copper single step trace.\n") + _T(" ob Copper breakpoint.\n") + _T(" H[H] Show PC history (HH=full CPU info) instructions.\n") + _T(" C Search for values like energy or lifes in games.\n") + _T(" Cl List currently found trainer addresses.\n") + _T(" D[idxzs <[max diff]>] Deep trainer. i=new value must be larger, d=smaller,\n") + _T(" x = must be same, z = must be different, s = restart.\n") + _T(" W
Write into Amiga memory.\n") + _T(" w
[[.x]] (read/write/opcode/freeze/mustchange).\n") + _T(" Add/remove memory watchpoints.\n") + _T(" wd [<0-1>] Enable illegal access logger. 1 = enable break.\n") + _T(" S Save a block of Amiga memory.\n") + _T(" s \"\"/ [] []\n") + _T(" Search for string/bytes.\n") + _T(" T or Tt Show exec tasks and their PCs.\n") + _T(" Td,Tl,Tr Show devices, libraries or resources.\n") + _T(" b Step to previous state capture position.\n") + _T(" M Enable or disable audio channels, bitplanes or sprites.\n") + _T(" sp [] Dump sprite information.\n") + _T(" di [] Break on disk access. R=DMA read,W=write,RW=both,P=PIO.\n") + _T(" Also enables level 1 disk logging.\n") + _T(" did Enable disk logging.\n") + _T(" dj [] Enable joystick/mouse input debugging.\n") + _T(" smc [<0-1>] Enable self-modifying code detector. 1 = enable break.\n") + _T(" dm Dump current address space map.\n") + _T(" v [] Show DMA data (accurate only in cycle-exact mode).\n") + _T(" v [-1 to -4] = enable visual DMA debugger.\n") + _T(" ? Hex/Bin/Dec converter.\n") #ifdef _WIN32 - L" x Close debugger.\n" - L" xx Switch between console and GUI debugger.\n" - L" mg
Memory dump starting at
in GUI.\n" - L" dg
Disassembly starting at
in GUI.\n" + _T(" x Close debugger.\n") + _T(" xx Switch between console and GUI debugger.\n") + _T(" mg
Memory dump starting at
in GUI.\n") + _T(" dg
Disassembly starting at
in GUI.\n") #endif - L" q Quit the emulator. You don't want to use this command.\n\n" + _T(" q Quit the emulator. You don't want to use this command.\n\n") }; void debug_help (void) @@ -206,19 +206,19 @@ static int readregx (TCHAR **c, uae_u32 *valp) memmove (tmp, tmp + 1, sizeof (tmp) - sizeof (TCHAR)); extra = 1; } - if (!_tcscmp (tmp, L"USP")) { + if (!_tcscmp (tmp, _T("USP"))) { addr = regs.usp; (*c) += 3; - } else if (!_tcscmp (tmp, L"VBR")) { + } else if (!_tcscmp (tmp, _T("VBR"))) { addr = regs.vbr; (*c) += 3; - } else if (!_tcscmp (tmp, L"MSP")) { + } else if (!_tcscmp (tmp, _T("MSP"))) { addr = regs.msp; (*c) += 3; - } else if (!_tcscmp (tmp, L"ISP")) { + } else if (!_tcscmp (tmp, _T("ISP"))) { addr = regs.isp; (*c) += 3; - } else if (!_tcscmp (tmp, L"PC")) { + } else if (!_tcscmp (tmp, _T("PC"))) { addr = regs.pc; (*c) += 2; } else if (tmp[0] == 'A' || tmp[0] == 'D') { @@ -437,7 +437,7 @@ static void converter (TCHAR **c) for (i = 0; i < 32; i++) s[i] = (v & (1 << (31 - i))) ? '1' : '0'; s[i] = 0; - console_out_f (L"0x%08X = %%%s = %u = %d\n", v, s, v, (uae_s32)v); + console_out_f (_T("0x%08X = %%%s = %u = %d\n"), v, s, v, (uae_s32)v); } int notinrom (void) @@ -578,19 +578,19 @@ uaecptr dumpmem2 (uaecptr addr, TCHAR *out, int osize) if (osize <= (9 + cols * 5 + 1 + 2 * cols)) return addr; - _stprintf (out, L"%08lX ", addr); + _stprintf (out, _T("%08lX "), addr); for (i = 0; i < cols; i++) { uae_u8 b1, b2; b1 = b2 = 0; if (safe_addr(addr, 2)) { b1 = get_byte (addr + 0); b2 = get_byte (addr + 1); - _stprintf (out + 9 + i * 5, L"%02X%02X ", b1, b2); + _stprintf (out + 9 + i * 5, _T("%02X%02X "), b1, b2); out[9 + cols * 5 + 1 + i * 2 + 0] = b1 >= 32 && b1 < 127 ? b1 : '.'; out[9 + cols * 5 + 1 + i * 2 + 1] = b2 >= 32 && b2 < 127 ? b2 : '.'; } else { nonsafe++; - _tcscpy (out + 9 + i * 5, L"**** "); + _tcscpy (out + 9 + i * 5, _T("**** ")); out[9 + cols * 5 + 1 + i * 2 + 0] = '*'; out[9 + cols * 5 + 1 + i * 2 + 1] = '*'; } @@ -611,8 +611,8 @@ static void dumpmem (uaecptr addr, uaecptr *nxmem, int lines) TCHAR line[MAX_LINEWIDTH + 1]; for (;lines--;) { addr = dumpmem2 (addr, line, sizeof(line)); - debug_out (L"%s", line); - if (!debug_out (L"\n")) + debug_out (_T("%s"), line); + if (!debug_out (_T("\n"))) break; } *nxmem = addr; @@ -660,7 +660,7 @@ static void dump_custom_regs (int aga) addr2 = custd[j].adr & 0x1ff; v1 = (p1[addr1 + 0] << 8) | p1[addr1 + 1]; v2 = (p1[addr2 + 0] << 8) | p1[addr2 + 1]; - console_out_f (L"%03X %s\t%04X\t%03X %s\t%04X\n", + console_out_f (_T("%03X %s\t%04X\t%03X %s\t%04X\n"), addr1, custd[i].name, v1, addr2, custd[j].name, v2); } @@ -676,16 +676,16 @@ static void dump_vectors (uaecptr addr) while (int_labels[i].name || trap_labels[j].name) { if (int_labels[i].name) { - console_out_f (L"$%08X %02d: %12s $%08X ", int_labels[i].adr + addr, int_labels[i].adr / 4, + console_out_f (_T("$%08X %02d: %12s $%08X "), int_labels[i].adr + addr, int_labels[i].adr / 4, int_labels[i].name, get_long (int_labels[i].adr + addr)); i++; } if (trap_labels[j].name) { - console_out_f (L"$%08X %02d: %12s $%08X", trap_labels[j].adr + addr, trap_labels[j].adr / 4, + console_out_f (_T("$%08X %02d: %12s $%08X"), trap_labels[j].adr + addr, trap_labels[j].adr / 4, trap_labels[j].name, get_long (trap_labels[j].adr + addr)); j++; } - console_out (L"\n"); + console_out (_T("\n")); } } @@ -705,28 +705,28 @@ static void disassemble_wait (FILE *file, unsigned long insn) h_mask = hp & he; if (v_mask > 0) { doout = 1; - console_out (L"vpos "); + console_out (_T("vpos ")); if (ve != 0x7f) { - console_out_f (L"& 0x%02x ", ve); + console_out_f (_T("& 0x%02x "), ve); } - console_out_f (L">= 0x%02x", v_mask); + console_out_f (_T(">= 0x%02x"), v_mask); } if (he > 0) { if (v_mask > 0) { - console_out (L" and"); + console_out (_T(" and")); } - console_out (L" hpos "); + console_out (_T(" hpos ")); if (he != 0xfe) { - console_out_f (L"& 0x%02x ", he); + console_out_f (_T("& 0x%02x "), he); } - console_out_f (L">= 0x%02x", h_mask); + console_out_f (_T(">= 0x%02x"), h_mask); } else { if (doout) - console_out (L", "); - console_out (L", ignore horizontal"); + console_out (_T(", ")); + console_out (_T(", ignore horizontal")); } - console_out_f (L"\n \t; VP %02x, VE %02x; HP %02x, HE %02x; BFD %d\n", + console_out_f (_T("\n \t; VP %02x, VE %02x; HP %02x, HE %02x; BFD %d\n"), vp, ve, hp, he, bfd); } @@ -888,7 +888,7 @@ struct dma_rec *record_dma (uae_u16 reg, uae_u16 dat, uae_u32 addr, int hpos, in return NULL; dr = &dma_record[dma_record_toggle][vpos * NR_DMA_REC_HPOS + hpos]; if (dr->reg != 0xffff) { - write_log (L"DMA conflict: v=%d h=%d OREG=%04X NREG=%04X\n", vpos, hpos, dr->reg, reg); + write_log (_T("DMA conflict: v=%d h=%d OREG=%04X NREG=%04X\n"), vpos, hpos, dr->reg, reg); return dr; } dr->reg = reg; @@ -908,9 +908,9 @@ static void decode_dma_record (int hpos, int vpos, int toggle, bool logfile) return; dr = &dma_record[dma_record_toggle ^ toggle][vpos * NR_DMA_REC_HPOS]; if (logfile) - write_dlog (L"Line: %02X %3d HPOS %02X %3d:\n", vpos, vpos, hpos, hpos); + write_dlog (_T("Line: %02X %3d HPOS %02X %3d:\n"), vpos, vpos, hpos, hpos); else - console_out_f (L"Line: %02X %3d HPOS %02X %3d:\n", vpos, vpos, hpos, hpos); + console_out_f (_T("Line: %02X %3d HPOS %02X %3d:\n"), vpos, vpos, hpos, hpos); h = hpos; dr += hpos; maxh = hpos + 80; @@ -933,27 +933,27 @@ static void decode_dma_record (int hpos, int vpos, int toggle, bool logfile) int r = dr->reg; TCHAR *sr; - sr = L" "; + sr = _T(" "); if (dr->type == DMARECORD_COPPER) - sr = L"COP "; + sr = _T("COP "); else if (dr->type == DMARECORD_BLITTER) - sr = L"BLT "; + sr = _T("BLT "); else if (dr->type == DMARECORD_REFRESH) - sr = L"RFS "; + sr = _T("RFS "); else if (dr->type == DMARECORD_AUDIO) - sr = L"AUD "; + sr = _T("AUD "); else if (dr->type == DMARECORD_DISK) - sr = L"DSK "; + sr = _T("DSK "); else if (dr->type == DMARECORD_SPRITE) - sr = L"SPR "; - _stprintf (l1 + cl, L"[%02X %3d]", h, h); - _tcscpy (l4 + cl, L" "); + sr = _T("SPR "); + _stprintf (l1 + cl, _T("[%02X %3d]"), h, h); + _tcscpy (l4 + cl, _T(" ")); if (r != 0xffff) { if (r & 0x1000) { if ((r & 0x0100) == 0x0000) - _tcscpy (l2 + cl, L" CPU-R "); + _tcscpy (l2 + cl, _T(" CPU-R ")); else if ((r & 0x0100) == 0x0100) - _tcscpy (l2 + cl, L" CPU-W "); + _tcscpy (l2 + cl, _T(" CPU-W ")); if ((r & 0xff) == 4) l2[cl + 7] = 'L'; if ((r & 0xff) == 2) @@ -961,14 +961,14 @@ static void decode_dma_record (int hpos, int vpos, int toggle, bool logfile) if ((r & 0xff) == 1) l2[cl + 7] = 'B'; } else { - _stprintf (l2 + cl, L"%4s %03X", sr, r); + _stprintf (l2 + cl, _T("%4s %03X"), sr, r); } - _stprintf (l3 + cl, L" %04X", dr->dat); + _stprintf (l3 + cl, _T(" %04X"), dr->dat); if (dr->addr != 0xffffffff) - _stprintf (l4 + cl, L"%08X", dr->addr & 0x00ffffff); + _stprintf (l4 + cl, _T("%08X"), dr->addr & 0x00ffffff); } else { - _tcscpy (l2 + cl, L" "); - _tcscpy (l3 + cl, L" "); + _tcscpy (l2 + cl, _T(" ")); + _tcscpy (l3 + cl, _T(" ")); } cl2 = cl; if (dr->evt & DMA_EVENT_BLITNASTY) @@ -985,7 +985,7 @@ static void decode_dma_record (int hpos, int vpos, int toggle, bool logfile) l3[cl2++] = 'I'; if (dr->evt & DMA_EVENT_INTREQ) l3[cl2++] = 'i'; - _stprintf (l5 + cl, L"%08X", cycles + (vpos * maxhpos + (hpos + cnt)) * CYCLE_UNIT); + _stprintf (l5 + cl, _T("%08X"), cycles + (vpos * maxhpos + (hpos + cnt)) * CYCLE_UNIT); if (i < cols - 1 && h < maxh - 1) { l1[cl + col - 1] = 32; l2[cl + col - 1] = 32; @@ -996,19 +996,19 @@ static void decode_dma_record (int hpos, int vpos, int toggle, bool logfile) cnt++; } if (logfile) { - write_dlog (L"%s\n", l1); - write_dlog (L"%s\n", l2); - write_dlog (L"%s\n", l3); - write_dlog (L"%s\n", l4); - write_dlog (L"%s\n", l5); - write_dlog (L"\n"); + write_dlog (_T("%s\n"), l1); + write_dlog (_T("%s\n"), l2); + write_dlog (_T("%s\n"), l3); + write_dlog (_T("%s\n"), l4); + write_dlog (_T("%s\n"), l5); + write_dlog (_T("\n")); } else { - console_out_f (L"%s\n", l1); - console_out_f (L"%s\n", l2); - console_out_f (L"%s\n", l3); - console_out_f (L"%s\n", l4); - console_out_f (L"%s\n", l5); - console_out_f (L"\n"); + console_out_f (_T("%s\n"), l1); + console_out_f (_T("%s\n"), l2); + console_out_f (_T("%s\n"), l3); + console_out_f (_T("%s\n"), l4); + console_out_f (_T("%s\n"), l5); + console_out_f (_T("\n")); } } } @@ -1062,29 +1062,29 @@ static void decode_copper_insn (FILE* file, unsigned long insn, unsigned long ad struct cop_rec *cr = NULL; uae_u32 insn_type = insn & 0x00010001; TCHAR here = ' '; - TCHAR record[] = L" "; + TCHAR record[] = _T(" "); if ((cr = find_copper_records (addr))) { - _stprintf (record, L" [%03x %03x]", cr->vpos, cr->hpos); + _stprintf (record, _T(" [%03x %03x]"), cr->vpos, cr->hpos); } if (get_copper_address (-1) >= addr && get_copper_address(-1) <= addr + 3) here = '*'; - console_out_f (L"%c%08lx: %04lx %04lx%s\t; ", here, addr, insn >> 16, insn & 0xFFFF, record); + console_out_f (_T("%c%08lx: %04lx %04lx%s\t; "), here, addr, insn >> 16, insn & 0xFFFF, record); switch (insn_type) { case 0x00010000: /* WAIT insn */ - console_out (L"Wait for "); + console_out (_T("Wait for ")); disassemble_wait (file, insn); if (insn == 0xfffffffe) - console_out (L" \t; End of Copperlist\n"); + console_out (_T(" \t; End of Copperlist\n")); break; case 0x00010001: /* SKIP insn */ - console_out (L"Skip if "); + console_out (_T("Skip if ")); disassemble_wait (file, insn); break; @@ -1099,9 +1099,9 @@ static void decode_copper_insn (FILE* file, unsigned long insn, unsigned long ad i++; } if (custd[i].name) - console_out_f (L"%s := 0x%04lx\n", custd[i].name, insn & 0xffff); + console_out_f (_T("%s := 0x%04lx\n"), custd[i].name, insn & 0xffff); else - console_out_f (L"%04x := 0x%04lx\n", addr, insn & 0xffff); + console_out_f (_T("%04x := 0x%04lx\n"), addr, insn & 0xffff); } break; @@ -1137,7 +1137,7 @@ static int copper_debugger (TCHAR **c) debug_copper = 0; else debug_copper = 1; - console_out_f (L"Copper debugger %s.\n", debug_copper ? L"enabled" : L"disabled"); + console_out_f (_T("Copper debugger %s.\n"), debug_copper ? _T("enabled") : _T("disabled")); } else if (**c == 't') { debug_copper = 1|2; return 1; @@ -1146,7 +1146,7 @@ static int copper_debugger (TCHAR **c) debug_copper = 1|4; if (more_params (c)) { debug_copper_pc = readhex (c); - console_out_f (L"Copper breakpoint @0x%08x\n", debug_copper_pc); + console_out_f (_T("Copper breakpoint @0x%08x\n"), debug_copper_pc); } else { debug_copper &= ~4; } @@ -1215,11 +1215,11 @@ static void listcheater(int mode, int size) b = get_word (ts->addr); } if (mode) - console_out_f (L"%08X=%04X ", ts->addr, b); + console_out_f (_T("%08X=%04X "), ts->addr, b); else - console_out_f (L"%08X ", ts->addr); + console_out_f (_T("%08X "), ts->addr); if ((i % skip) == skip) - console_out (L"\n"); + console_out (_T("\n")); } } @@ -1276,7 +1276,7 @@ static void deepcheatsearch (TCHAR **c) *p1++ = get_byte (i); addr = end - 1; } - console_out (L"Deep trainer first pass complete.\n"); + console_out (_T("Deep trainer first pass complete.\n")); return; } inconly = deconly = 0; @@ -1341,7 +1341,7 @@ static void deepcheatsearch (TCHAR **c) } } - console_out_f (L"%d addresses found\n", cnt); + console_out_f (_T("%d addresses found\n"), cnt); if (cnt <= MAX_CHEAT_VIEW) { clearcheater (); cnt = 0; @@ -1356,10 +1356,10 @@ static void deepcheatsearch (TCHAR **c) cnt++; } if (cnt > 0) - console_out (L"\n"); + console_out (_T("\n")); listcheater (1, size); } else { - console_out (L"Now continue with 'g' and use 'D' again after you have lost another life\n"); + console_out (_T("Now continue with 'g' and use 'D' again after you have lost another life\n")); } } @@ -1388,7 +1388,7 @@ static void cheatsearch (TCHAR **c) ignore_ws (c); if (!more_params (c)) { first = 1; - console_out (L"Search reset\n"); + console_out (_T("Search reset\n")); xfree (vlist); listsize = memsize; vlist = xcalloc (uae_u8, listsize >> 3); @@ -1447,9 +1447,9 @@ static void cheatsearch (TCHAR **c) } listcheater (0, size); } - console_out_f (L"Found %d possible addresses with 0x%X (%u) (%d bytes)\n", count, val, val, size); + console_out_f (_T("Found %d possible addresses with 0x%X (%u) (%d bytes)\n"), count, val, val, size); if (count > 0) - console_out (L"Now continue with 'g' and use 'C' with a different value\n"); + console_out (_T("Now continue with 'g' and use 'C' with a different value\n")); first = 0; } @@ -1560,17 +1560,17 @@ static void illg_debug_do (uaecptr addr, int rwi, int size, uae_u32 val) illg_debug_check (ad, rwi, size, val); } else if ((mask & 3) == 0) { if (rwi & 2) - console_out_f (L"W: %08X=%02X PC=%08X\n", ad, v, pc); + console_out_f (_T("W: %08X=%02X PC=%08X\n"), ad, v, pc); else if (rwi & 1) - console_out_f (L"R: %08X PC=%08X\n", ad, pc); + console_out_f (_T("R: %08X PC=%08X\n"), ad, pc); if (illgdebug_break) activate_debugger (); } else if (!(mask & 1) && (rwi & 1)) { - console_out_f (L"RO: %08X=%02X PC=%08X\n", ad, v, pc); + console_out_f (_T("RO: %08X=%02X PC=%08X\n"), ad, v, pc); if (illgdebug_break) activate_debugger (); } else if (!(mask & 2) && (rwi & 2)) { - console_out_f (L"WO: %08X PC=%08X\n", ad, pc); + console_out_f (_T("WO: %08X PC=%08X\n"), ad, pc); if (illgdebug_break) activate_debugger (); } @@ -1593,7 +1593,7 @@ static struct smc_item *smc_table; static void smc_free (void) { if (smc_table) - console_out (L"SMCD disabled\n"); + console_out (_T("SMCD disabled\n")); xfree(smc_table); smc_mode = 0; smc_table = NULL; @@ -1622,7 +1622,7 @@ static void smc_detect_init (TCHAR **c) initialize_memwatch (0); if (v) smc_mode = 1; - console_out_f (L"SMCD enabled. Break=%d\n", smc_mode); + console_out_f (_T("SMCD enabled. Break=%d\n"), smc_mode); } #define SMC_MAXHITS 8 @@ -1664,12 +1664,12 @@ static void smc_detector (uaecptr addr, int rwi, int size, uae_u32 *valp) } if (hitcnt < 100) { smc_table[hitaddr].cnt++; - console_out_f (L"SMC at %08X - %08X (%d) from %08X\n", + console_out_f (_T("SMC at %08X - %08X (%d) from %08X\n"), hitaddr, hitaddr + hitcnt, hitcnt, hitpc); if (smc_mode) activate_debugger (); if (smc_table[hitaddr].cnt >= SMC_MAXHITS) - console_out_f (L"* hit count >= %d, future hits ignored\n", SMC_MAXHITS); + console_out_f (_T("* hit count >= %d, future hits ignored\n"), SMC_MAXHITS); } } @@ -1859,7 +1859,7 @@ static int memwatch_func (uaecptr addr, int rwi, int size, uae_u32 *valp) mask <<= shift; } *valp = (sval & mask) | ((*valp) & ~mask); - write_log (L"%p %p %08x %08x %d\n", addr, m->addr, *valp, mask, shift); + write_log (_T("%p %p %08x %08x %d\n"), addr, m->addr, *valp, mask, shift); return 1; } return 0; @@ -2158,14 +2158,14 @@ int debug_bankchange (int mode) static TCHAR *getsizechar (int size) { if (size == 4) - return L".l"; + return _T(".l"); if (size == 3) - return L".3"; + return _T(".3"); if (size == 2) - return L".w"; + return _T(".w"); if (size == 1) - return L".b"; - return L""; + return _T(".b"); + return _T(""); } void memwatch_dump2 (TCHAR *buf, int bufsize, int num) @@ -2180,18 +2180,18 @@ void memwatch_dump2 (TCHAR *buf, int bufsize, int num) mwn = &mwnodes[i]; if (mwn->size == 0) continue; - buf = buf_out (buf, &bufsize, L"%2d: %08X - %08X (%d) %c%c%c", + buf = buf_out (buf, &bufsize, _T("%2d: %08X - %08X (%d) %c%c%c"), i, mwn->addr, mwn->addr + (mwn->size - 1), mwn->size, (mwn->rwi & 1) ? 'R' : ' ', (mwn->rwi & 2) ? 'W' : ' ', (mwn->rwi & 4) ? 'I' : ' '); if (mwn->frozen) - buf = buf_out (buf, &bufsize, L"F"); + buf = buf_out (buf, &bufsize, _T("F")); if (mwn->val_enabled) - buf = buf_out (buf, &bufsize, L" =%X%s", mwn->val, getsizechar (mwn->val_size)); + buf = buf_out (buf, &bufsize, _T(" =%X%s"), mwn->val, getsizechar (mwn->val_size)); if (mwn->modval_written) - buf = buf_out (buf, &bufsize, L" =M"); + buf = buf_out (buf, &bufsize, _T(" =M")); if (mwn->mustchange) - buf = buf_out (buf, &bufsize, L" C"); - buf = buf_out (buf, &bufsize, L"\n"); + buf = buf_out (buf, &bufsize, _T(" C")); + buf = buf_out (buf, &bufsize, _T("\n")); } } } @@ -2205,7 +2205,7 @@ static void memwatch_dump (int num) if (!buf) return; memwatch_dump2 (buf, 50 * multiplier, num); - f_out (stdout, L"%s", buf); + f_out (stdout, _T("%s"), buf); xfree (buf); } @@ -2217,7 +2217,7 @@ static void memwatch (TCHAR **c) if (!memwatch_enabled) { initialize_memwatch (0); - console_out (L"Memwatch breakpoints enabled\n"); + console_out (_T("Memwatch breakpoints enabled\n")); } cp = *c; @@ -2229,7 +2229,7 @@ static void memwatch (TCHAR **c) nc = next_char (c); if (nc == '-') { deinitialize_memwatch (); - console_out (L"Memwatch breakpoints disabled\n"); + console_out (_T("Memwatch breakpoints disabled\n")); return; } if (nc == 'd') { @@ -2240,7 +2240,7 @@ static void memwatch (TCHAR **c) uae_u32 len = 1; if (more_params (c)) len = readhex (c); - console_out_f (L"Cleared logging addresses %08X - %08X\n", addr, addr + len); + console_out_f (_T("Cleared logging addresses %08X - %08X\n"), addr, addr + len); while (len > 0) { addr &= 0xffffff; illgdebug[addr] = 7; @@ -2249,7 +2249,7 @@ static void memwatch (TCHAR **c) } } else { illg_free(); - console_out (L"Illegal memory access logging disabled\n"); + console_out (_T("Illegal memory access logging disabled\n")); } } else { illg_init (); @@ -2257,7 +2257,7 @@ static void memwatch (TCHAR **c) illgdebug_break = 0; if (more_params (c)) illgdebug_break = 1; - console_out_f (L"Illegal memory access logging enabled. Break=%d\n", illgdebug_break); + console_out_f (_T("Illegal memory access logging enabled. Break=%d\n"), illgdebug_break); } return; } @@ -2269,7 +2269,7 @@ static void memwatch (TCHAR **c) mwn->size = 0; ignore_ws (c); if (!more_params (c)) { - console_out_f (L"Memwatch %d removed\n", num); + console_out_f (_T("Memwatch %d removed\n"), num); return; } mwn->addr = readhex (c); @@ -2342,7 +2342,7 @@ static void writeintomem (TCHAR **c) put_byte (addr, val); cc = 'B'; } - console_out_f (L"Wrote %X (%u) at %08X.%c\n", val, val, addr, cc); + console_out_f (_T("Wrote %X (%u) at %08X.%c\n"), val, val, addr, cc); } static uae_u8 *dump_xlate (uae_u32 addr) @@ -2376,7 +2376,7 @@ static void memory_map_dump_2 (int log) name = a1->name; if (name == NULL) - name = L""; + name = _T(""); k = j; caddr = dump_xlate (k << 16); @@ -2394,7 +2394,7 @@ static void memory_map_dump_2 (int log) size_out /= 1024; size_ext = 'M'; } - _stprintf (txt, L"%08X %7d%c/%d = %7d%c %s", j << 16, size_out, size_ext, + _stprintf (txt, _T("%08X %7d%c/%d = %7d%c %s"), j << 16, size_out, size_ext, mirrored, mirrored ? size_out / mirrored : size_out, size_ext, name); tmp[0] = 0; @@ -2402,14 +2402,14 @@ static void memory_map_dump_2 (int log) TCHAR *p = txt + _tcslen (txt); uae_u32 crc = get_crc32 (a1->xlateaddr(j << 16), (size * 1024) / mirrored); struct romdata *rd = getromdatabycrc (crc); - _stprintf (p, L" (%08X)", crc); + _stprintf (p, _T(" (%08X)"), crc); if (rd) { tmp[0] = '='; getromname (rd, tmp + 1); - _tcscat (tmp, L"\n"); + _tcscat (tmp, _T("\n")); } } - _tcscat (txt, L"\n"); + _tcscat (txt, _T("\n")); if (log) write_log (txt); else @@ -2453,9 +2453,9 @@ static void print_task_info (uaecptr node) TCHAR *s; int process = get_byte (node + 8) == 13 ? 1 : 0; - console_out_f (L"%08X: ", node); + console_out_f (_T("%08X: "), node); s = au ((char*)get_real_address (get_long (node + 10))); - console_out_f (process ? L" PROCESS '%s'\n" : L" TASK '%s'\n", s); + console_out_f (process ? _T(" PROCESS '%s'\n") : _T(" TASK '%s'\n"), s); xfree (s); if (process) { uaecptr cli = BPTR2APTR (get_long (node + 172)); @@ -2463,10 +2463,10 @@ static void print_task_info (uaecptr node) if (cli && tasknum) { uae_u8 *command_bstr = get_real_address (BPTR2APTR (get_long (cli + 16))); TCHAR *command = BSTR2CSTR (command_bstr); - console_out_f (L" [%d, '%s']\n", tasknum, command); + console_out_f (_T(" [%d, '%s']\n"), tasknum, command); xfree (command); } else { - console_out (L"\n"); + console_out (_T("\n")); } } } @@ -2477,18 +2477,18 @@ static void show_exec_tasks (void) uaecptr taskready = get_long (execbase + 406); uaecptr taskwait = get_long (execbase + 420); uaecptr node, end; - console_out_f (L"Execbase at 0x%08X\n", execbase); - console_out (L"Current:\n"); + console_out_f (_T("Execbase at 0x%08X\n"), execbase); + console_out (_T("Current:\n")); node = get_long (execbase + 276); print_task_info (node); - console_out_f (L"Ready:\n"); + console_out_f (_T("Ready:\n")); node = get_long (taskready); end = get_long (taskready + 4); while (node) { print_task_info (node); node = get_long (node); } - console_out (L"Waiting:\n"); + console_out (_T("Waiting:\n")); node = get_long (taskwait); end = get_long (taskwait + 4); while (node) { @@ -2543,15 +2543,15 @@ static void show_exec_lists (TCHAR t) if (dosbase) { uaecptr rootnode = get_long (dosbase + 34); uaecptr dosinfo = get_long (rootnode + 24) << 2; - console_out_f (L"ROOTNODE: %08x DOSINFO: %08x\n", rootnode, dosinfo); + console_out_f (_T("ROOTNODE: %08x DOSINFO: %08x\n"), rootnode, dosinfo); uaecptr doslist = get_long (dosinfo + 4) << 2; while (doslist) { int type = get_long (doslist + 4); uaecptr msgport = get_long (doslist + 8); TCHAR *name = getfrombstr (get_long (doslist + 40)); - console_out_f (L"%08x: %d %08x '%s'\n", doslist, type, msgport, name); + console_out_f (_T("%08x: %d %08x '%s'\n"), doslist, type, msgport, name); if (type == 0) { - console_out_f (L" - H=%08x Stack=%5d Pri=%2d Start=%08x Seg=%08x GV=%08x\n", + console_out_f (_T(" - H=%08x Stack=%5d Pri=%2d Start=%08x Seg=%08x GV=%08x\n"), get_long (doslist + 16) << 2, get_long (doslist + 20), get_long (doslist + 24), get_long (doslist + 28), get_long (doslist + 32) << 2, get_long (doslist + 36)); @@ -2560,7 +2560,7 @@ static void show_exec_lists (TCHAR t) doslist = get_long (doslist) << 2; } } else { - console_out_f (L"can't find dos.library\n"); + console_out_f (_T("can't find dos.library\n")); } return; } else if (_totupper (t) == 'I') { // interrupts @@ -2568,14 +2568,14 @@ static void show_exec_lists (TCHAR t) static const int it2[] = { 1, 1, 1, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 6, 6, 7 }; list = execbase + 84; for (int i = 0; i < 16; i++) { - console_out_f (L"%2d %d: %08x\n", i + 1, it2[i], list); + console_out_f (_T("%2d %d: %08x\n"), i + 1, it2[i], list); if (it[i]) { - console_out_f (L" [H] %08x\n", get_long (list)); + console_out_f (_T(" [H] %08x\n"), get_long (list)); node = get_long (list + 8); if (node) { uae_u8 *addr = get_real_address (get_long (node + 10)); TCHAR *name = addr ? au ((char*)addr) : au(""); - console_out_f (L" %08x (C=%08X D=%08X) '%s'\n", node, get_long (list + 4), get_long (list), name); + console_out_f (_T(" %08x (C=%08X D=%08X) '%s'\n"), node, get_long (list + 4), get_long (list), name); xfree (name); } } else { @@ -2585,21 +2585,21 @@ static void show_exec_lists (TCHAR t) while (get_long (node)) { uae_u8 *addr = get_real_address (get_long (node + 10)); TCHAR *name = addr ? au ((char*)addr) : au(""); - console_out_f (L" [S] %08x (C=%08x D=%08X) '%s'\n", node, get_long (node + 18), get_long (node + 14), name); + console_out_f (_T(" [S] %08x (C=%08x D=%08X) '%s'\n"), node, get_long (node + 18), get_long (node + 14), name); if (i == 4 - 1 || i == 14 - 1) { - if (!_tcsicmp (name, L"cia-a") || !_tcsicmp (name, L"cia-b")) { - static const TCHAR *ciai[] = { L"A", L"B", L"ALRM", L"SP", L"FLG" }; + if (!_tcsicmp (name, _T("cia-a")) || !_tcsicmp (name, _T("cia-b"))) { + static const TCHAR *ciai[] = { _T("A"), _T("B"), _T("ALRM"), _T("SP"), _T("FLG") }; uaecptr cia = node + 22; for (int j = 0; j < 5; j++) { uaecptr ciap = get_long (cia); - console_out_f (L" %5s: %08x", ciai[j], ciap); + console_out_f (_T(" %5s: %08x"), ciai[j], ciap); if (ciap) { uae_u8 *addr2 = get_real_address (get_long (ciap + 10)); TCHAR *name2 = addr ? au ((char*)addr2) : au(""); - console_out_f (L" (C=%08x D=%08X) '%s'", get_long (ciap + 18), get_long (ciap + 14), name2); + console_out_f (_T(" (C=%08x D=%08X) '%s'"), get_long (ciap + 18), get_long (ciap + 14), name2); xfree (name2); } - console_out_f (L"\n"); + console_out_f (_T("\n")); cia += 4; } } @@ -2609,7 +2609,7 @@ static void show_exec_lists (TCHAR t) cnt++; } if (!cnt) - console_out_f (L" [S] \n"); + console_out_f (_T(" [S] \n")); } list += 12; } @@ -2633,7 +2633,7 @@ static void show_exec_lists (TCHAR t) node = get_long (list); while (get_long (node)) { TCHAR *name = au ((char*)get_real_address (get_long (node + 10))); - console_out_f (L"%08x %s\n", node, name); + console_out_f (_T("%08x %s\n"), node, name); xfree (name); node = get_long (node); } @@ -2662,7 +2662,7 @@ int instruction_breakpoint (TCHAR **c) if (more_params (c)) sr_bpmask = readhex (c); } - console_out_f (L"SR breakpoint, value=%04X, mask=%04X\n", sr_bpvalue, sr_bpmask); + console_out_f (_T("SR breakpoint, value=%04X, mask=%04X\n"), sr_bpvalue, sr_bpmask); return 0; } else if (nc == 'I') { next_char (c); @@ -2676,7 +2676,7 @@ int instruction_breakpoint (TCHAR **c) } else if (nc == 'D' && (*c)[1] == 0) { for (i = 0; i < BREAKPOINT_TOTAL; i++) bpnodes[i].enabled = 0; - console_out (L"All breakpoints removed\n"); + console_out (_T("All breakpoints removed\n")); return 0; } else if (nc == 'L') { int got = 0; @@ -2684,13 +2684,13 @@ int instruction_breakpoint (TCHAR **c) bpn = &bpnodes[i]; if (!bpn->enabled) continue; - console_out_f (L"%8X ", bpn->addr); + console_out_f (_T("%8X "), bpn->addr); got = 1; } if (!got) - console_out (L"No breakpoints\n"); + console_out (_T("No breakpoints\n")); else - console_out (L"\n"); + console_out (_T("\n")); return 0; } skipaddr_doskip = 1; @@ -2702,7 +2702,7 @@ int instruction_breakpoint (TCHAR **c) bpn = &bpnodes[i]; if (bpn->enabled && bpn->addr == skipaddr_start) { bpn->enabled = 0; - console_out (L"Breakpoint removed\n"); + console_out (_T("Breakpoint removed\n")); skipaddr_start = 0xffffffff; skipaddr_doskip = 0; return 0; @@ -2714,7 +2714,7 @@ int instruction_breakpoint (TCHAR **c) continue; bpn->addr = skipaddr_start; bpn->enabled = 1; - console_out (L"Breakpoint added\n"); + console_out (_T("Breakpoint added\n")); skipaddr_start = 0xffffffff; skipaddr_doskip = 0; break; @@ -2779,9 +2779,9 @@ static void savemem (TCHAR **cc) if (!more_params (cc)) goto S_argh; len2 = len = readhex (cc); - fp = _tfopen (name, L"wb"); + fp = _tfopen (name, _T("wb")); if (fp == NULL) { - console_out_f (L"Couldn't open file '%s'\n", name); + console_out_f (_T("Couldn't open file '%s'\n"), name); return; } while (len > 0) { @@ -2789,17 +2789,17 @@ static void savemem (TCHAR **cc) src++; len--; if (fwrite (&b, 1, 1, fp) != 1) { - console_out (L"Error writing file\n"); + console_out (_T("Error writing file\n")); break; } } fclose (fp); if (len == 0) - console_out_f (L"Wrote %08X - %08X (%d bytes) to '%s'\n", + console_out_f (_T("Wrote %08X - %08X (%d bytes) to '%s'\n"), src2, src2 + len2, len2, name); return; S_argh: - console_out (L"S-command needs more arguments!\n"); + console_out (_T("S-command needs more arguments!\n")); } static void searchmem (TCHAR **cc) @@ -2860,7 +2860,7 @@ static void searchmem (TCHAR **cc) if (more_params (cc)) endaddr = readhex (cc); } - console_out_f (L"Searching from %08X to %08X..\n", addr, endaddr); + console_out_f (_T("Searching from %08X to %08X..\n"), addr, endaddr); while ((addr = nextaddr (addr, endaddr, NULL)) != 0xffffffff) { if (addr == endaddr) break; @@ -2876,16 +2876,16 @@ static void searchmem (TCHAR **cc) } if (i == sslen) { got++; - console_out_f (L" %08X", addr); + console_out_f (_T(" %08X"), addr); if (got > 100) { - console_out (L"\nMore than 100 results, aborting.."); + console_out (_T("\nMore than 100 results, aborting..")); break; } } } if (!got) - console_out (L"nothing found"); - console_out (L"\n"); + console_out (_T("nothing found")); + console_out (_T("\n")); } static int staterecorder (TCHAR **cc) @@ -2911,7 +2911,7 @@ static int staterecorder (TCHAR **cc) static int debugtest_modes[DEBUGTEST_MAX]; static const TCHAR *debugtest_names[] = { - L"Blitter", L"Keyboard", L"Floppy" + _T("Blitter"), _T("Keyboard"), _T("Floppy") }; void debugtest (enum debugtest_item di, const TCHAR *format, ...) @@ -2924,7 +2924,7 @@ void debugtest (enum debugtest_item di, const TCHAR *format, ...) va_start (parms, format); _vsntprintf (buffer, 1000 - 1, format, parms); va_end (parms); - write_log (L"%s PC=%08X: %s\n", debugtest_names[di], M68K_GETPC, buffer); + write_log (_T("%s PC=%08X: %s\n"), debugtest_names[di], M68K_GETPC, buffer); if (debugtest_modes[di] == 2) activate_debugger (); } @@ -2938,7 +2938,7 @@ static void debugtest_set (TCHAR **inptr) if (!more_params (inptr)) { for (i = 0; i < DEBUGTEST_MAX; i++) debugtest_modes[i] = 0; - console_out (L"All debugtests disabled\n"); + console_out (_T("All debugtests disabled\n")); return; } val = readint (inptr); @@ -2950,7 +2950,7 @@ static void debugtest_set (TCHAR **inptr) if (val < 0) { for (i = 0; i < DEBUGTEST_MAX; i++) debugtest_modes[i] = val2; - console_out (L"All debugtests enabled\n"); + console_out (_T("All debugtests enabled\n")); return; } if (val >= 0 && val < DEBUGTEST_MAX) { @@ -2958,8 +2958,8 @@ static void debugtest_set (TCHAR **inptr) debugtest_modes[val] = 0; else debugtest_modes[val] = val2; - console_out_f (L"Debugtest '%s': %s. break = %s\n", - debugtest_names[val], debugtest_modes[val] ? L"on" :L"off", val2 == 2 ? L"on" : L"off"); + console_out_f (_T("Debugtest '%s': %s. break = %s\n"), + debugtest_names[val], debugtest_modes[val] ? _T("on") :_T("off"), val2 == 2 ? _T("on") : _T("off")); } } @@ -2998,10 +2998,10 @@ static void debug_sprite (TCHAR **inptr) width = size * 16; w1 = get_word (addr); w2 = get_word (addr + size * 2); - console_out_f (L" %06X ", addr); + console_out_f (_T(" %06X "), addr); for (i = 0; i < size * 2; i++) - console_out_f (L"%04X ", get_word (addr + i * 2)); - console_out_f (L"\n"); + console_out_f (_T("%04X "), get_word (addr + i * 2)); + console_out_f (_T("\n")); ypos = w1 >> 8; xpos = w1 & 255; @@ -3088,13 +3088,13 @@ static void debug_sprite (TCHAR **inptr) } } tmp[width] = 0; - console_out_f (L"%3d %06X %s\n", y, addr, tmp); + console_out_f (_T("%3d %06X %s\n"), y, addr, tmp); } - console_out_f (L"Sprite address %08X, width = %d\n", saddr, size * 16); - console_out_f (L"OCS: StartX=%d StartY=%d EndY=%d\n", xpos, ypos, ypose); - console_out_f (L"ECS: StartX=%d (%d.%d) StartY=%d EndY=%d%s\n", xpos_ecs, xpos_ecs / 4, xpos_ecs & 3, ypos_ecs, ypose_ecs, ecs ? L" (*)" : L""); - console_out_f (L"Attach: %d. AGA SSCAN/SH10 bit: %d\n", attach, sh10); + console_out_f (_T("Sprite address %08X, width = %d\n"), saddr, size * 16); + console_out_f (_T("OCS: StartX=%d StartY=%d EndY=%d\n"), xpos, ypos, ypose); + console_out_f (_T("ECS: StartX=%d (%d.%d) StartY=%d EndY=%d%s\n"), xpos_ecs, xpos_ecs / 4, xpos_ecs & 3, ypos_ecs, ypose_ecs, ecs ? _T(" (*)") : _T("")); + console_out_f (_T("Attach: %d. AGA SSCAN/SH10 bit: %d\n"), attach, sh10); addr += size * 4; if (get_word (addr) == 0 && get_word (addr + size * 4) == 0) @@ -3115,7 +3115,7 @@ static void disk_debug (TCHAR **inptr) (*inptr)++; ignore_ws (inptr); disk_debug_logging = readint (inptr); - console_out_f (L"Disk logging level %d\n", disk_debug_logging); + console_out_f (_T("Disk logging level %d\n"), disk_debug_logging); return; } disk_debug_mode = 0; @@ -3138,7 +3138,7 @@ static void disk_debug (TCHAR **inptr) if (disk_debug_logging == 0) disk_debug_logging = 1; end: - console_out_f (L"Disk breakpoint mode %c%c%c track %d\n", + console_out_f (_T("Disk breakpoint mode %c%c%c track %d\n"), disk_debug_mode & DISK_DEBUG_DMA_READ ? 'R' : '-', disk_debug_mode & DISK_DEBUG_DMA_WRITE ? 'W' : '-', disk_debug_mode & DISK_DEBUG_PIO ? 'P' : '-', @@ -3159,7 +3159,7 @@ static void find_ea (TCHAR **inptr) if (more_params(inptr)) end = readhex (inptr); } - console_out_f (L"Searching from %08X to %08X\n", addr, end); + console_out_f (_T("Searching from %08X to %08X\n"), addr, end); while((addr = nextaddr(addr, end, &end)) != 0xffffffff) { if ((addr & 1) == 0 && addr + 6 <= end) { sea = 0xffffffff; @@ -3169,7 +3169,7 @@ static void find_ea (TCHAR **inptr) m68k_disasm (stdout, addr, NULL, 1); hits++; if (hits > 100) { - console_out_f (L"Too many hits. End addr = %08X\n", addr); + console_out_f (_T("Too many hits. End addr = %08X\n"), addr); break; } } @@ -3204,17 +3204,17 @@ static void m68k_modify (TCHAR **inptr) regs.irc = v; else if (c1 == 'P' && c2 == 1) regs.ir = v; - else if (!_tcscmp (parm, L"SR")) { + else if (!_tcscmp (parm, _T("SR"))) { regs.sr = v; MakeFromSR (); - } else if (!_tcscmp (parm, L"CCR")) { + } else if (!_tcscmp (parm, _T("CCR"))) { regs.sr = (regs.sr & ~31) | (v & 31); MakeFromSR (); - } else if (!_tcscmp (parm, L"USP")) { + } else if (!_tcscmp (parm, _T("USP"))) { regs.usp = v; - } else if (!_tcscmp (parm, L"ISP")) { + } else if (!_tcscmp (parm, _T("ISP"))) { regs.isp = v; - } else if (!_tcscmp (parm, L"PC")) { + } else if (!_tcscmp (parm, _T("PC"))) { m68k_setpc (v); fill_prefetch (); } else { @@ -3248,7 +3248,7 @@ static BOOL debug_line (TCHAR *input) debug_illegal_mask = debug_illegal ? 0 : -1; debug_illegal_mask &= ~((uae_u64)255 << 24); // mask interrupts } - console_out_f (L"Exception breakpoint mask: %0I64X\n", debug_illegal_mask); + console_out_f (_T("Exception breakpoint mask: %0I64X\n"), debug_illegal_mask); debug_illegal = debug_illegal_mask ? 1 : 0; } else { addr = 0xffffffff; @@ -3301,7 +3301,7 @@ static BOOL debug_line (TCHAR *input) inputdevice_logging = 1 | 2; if (more_params (&inptr)) inputdevice_logging = readint (&inptr); - console_out_f (L"Input logging level %d\n", inputdevice_logging); + console_out_f (_T("Input logging level %d\n"), inputdevice_logging); } else if (*inptr == 'm') { memory_map_dump_2 (0); } else if (*inptr == 't') { @@ -3453,12 +3453,12 @@ static BOOL debug_line (TCHAR *input) case 'a': if (more_params (&inptr)) audio_channel_mask = readhex (&inptr); - console_out_f (L"Audio mask = %02X\n", audio_channel_mask); + console_out_f (_T("Audio mask = %02X\n"), audio_channel_mask); break; case 's': if (more_params (&inptr)) debug_sprite_mask = readhex (&inptr); - console_out_f (L"Sprite mask: %02X\n", debug_sprite_mask); + console_out_f (_T("Sprite mask: %02X\n"), debug_sprite_mask); break; case 'b': if (more_params (&inptr)) { @@ -3467,7 +3467,7 @@ static BOOL debug_line (TCHAR *input) debug_bpl_mask_one = readhex (&inptr) & 0xff; notice_screen_contents_lost (); } - console_out_f (L"Bitplane mask: %02X (%02X)\n", debug_bpl_mask, debug_bpl_mask_one); + console_out_f (_T("Bitplane mask: %02X (%02X)\n"), debug_bpl_mask, debug_bpl_mask_one); break; } } @@ -3509,7 +3509,7 @@ static BOOL debug_line (TCHAR *input) decode_dma_record (v2, v1, cmd == 'v', false); } else { debug_dma = v1 < 0 ? -v1 : 1; - console_out_f (L"DMA debugger enabled, mode=%d.\n", debug_dma); + console_out_f (_T("DMA debugger enabled, mode=%d.\n"), debug_dma); } } break; @@ -3533,26 +3533,26 @@ static BOOL debug_line (TCHAR *input) int i; uaecptr addrl = readhex (&inptr); uaecptr addrp; - console_out_f (L"%08X translates to:\n", addrl); + console_out_f (_T("%08X translates to:\n"), addrl); for (i = 0; i < 4; i++) { bool super = (i & 2) != 0; bool data = (i & 1) != 0; - console_out_f (L"S%dD%d=", super, data); + console_out_f (_T("S%dD%d="), super, data); TRY(prb) { addrp = mmu_translate (addrl, super, data, false); - console_out_f (L"%08X", addrp); + console_out_f (_T("%08X"), addrp); TRY(prb2) { addrp = mmu_translate (addrl, super, data, true); - console_out_f (L" RW"); + console_out_f (_T(" RW")); } CATCH(prb2) { - console_out_f (L" RO"); + console_out_f (_T(" RO")); } } CATCH(prb) { - console_out_f (L"***********"); + console_out_f (_T("***********")); } - console_out_f (L" "); + console_out_f (_T(" ")); } - console_out_f (L"\n"); + console_out_f (_T("\n")); } break; case 'h': @@ -3580,7 +3580,7 @@ static void debug_1 (void) if (!debugger_active) return; update_debug_info (); - console_out (L">"); + console_out (_T(">")); console_flush (); debug_linecounter = 0; v = console_get (input, MAX_LINEWIDTH); @@ -3650,7 +3650,7 @@ void debug (void) continue; if (bpnodes[i].addr == pc) { bp = 1; - console_out_f (L"Breakpoint at %08X\n", pc); + console_out_f (_T("Breakpoint at %08X\n"), pc); break; } } @@ -3706,7 +3706,7 @@ void debug (void) if (sr_bpmask || sr_bpvalue) { MakeSR (); if ((regs.sr & sr_bpmask) == sr_bpvalue) { - console_out (L"SR breakpoint\n"); + console_out (_T("SR breakpoint\n")); bp = 1; } } @@ -3716,7 +3716,7 @@ void debug (void) } } } else { - console_out_f (L"Memwatch %d: break at %08X.%c %c%c%c %08X PC=%08X\n", memwatch_triggered - 1, mwhit.addr, + console_out_f (_T("Memwatch %d: break at %08X.%c %c%c%c %08X PC=%08X\n"), memwatch_triggered - 1, mwhit.addr, mwhit.size == 1 ? 'B' : (mwhit.size == 2 ? 'W' : 'L'), (mwhit.rwi & 1) ? 'R' : ' ', (mwhit.rwi & 2) ? 'W' : ' ', (mwhit.rwi & 4) ? 'I' : ' ', mwhit.val, mwhit.pc); @@ -3773,7 +3773,7 @@ const TCHAR *debuginfo (int mode) { static TCHAR txt[100]; uae_u32 pc = M68K_GETPC; - _stprintf (txt, L"PC=%08X INS=%04X %04X %04X", + _stprintf (txt, _T("PC=%08X INS=%04X %04X %04X"), pc, get_word (pc), get_word (pc + 2), get_word (pc + 4)); return txt; } @@ -3881,7 +3881,7 @@ static void mmu_do_hit_pre (struct mmudata *md, uaecptr addr, int size, int rwi, mmur = regs; pc = m68k_getpc (); if (mmu_logging) - console_out_f (L"MMU: hit %08X SZ=%d RW=%d V=%08X PC=%08X\n", addr, size, rwi, v, pc); + console_out_f (_T("MMU: hit %08X SZ=%d RW=%d V=%08X PC=%08X\n"), addr, size, rwi, v, pc); p = mmu_regs; put_long (p, 0); p += 4; @@ -3944,7 +3944,7 @@ static int mmu_hit (uaecptr addr, int size, int rwi, uae_u32 *v) if (maddr == addr) /* infinite mmu hit loop? no thanks.. */ return 1; if (mmu_logging) - console_out_f (L"MMU: remap %08X -> %08X SZ=%d RW=%d\n", addr, maddr, size, rwi); + console_out_f (_T("MMU: remap %08X -> %08X SZ=%d RW=%d\n"), addr, maddr, size, rwi); if ((rwi & 2)) { switch (size) { @@ -4046,14 +4046,14 @@ int mmu_init(int mode, uaecptr parm, uaecptr parm2) if (currprefs.cachesize) { wasjit = currprefs.cachesize; changed_prefs.cachesize = 0; - console_out (L"MMU: JIT disabled\n"); + console_out (_T("MMU: JIT disabled\n")); check_prefs_changed_comp (); } if (mode == 0) { if (mmu_enabled) { mmu_free (); deinitialize_memwatch (); - console_out (L"MMU: disabled\n"); + console_out (_T("MMU: disabled\n")); changed_prefs.cachesize = wasjit; } mmu_logging = 0; @@ -4070,7 +4070,7 @@ int mmu_init(int mode, uaecptr parm, uaecptr parm2) p = parm; mmu_struct = p; if (get_long (p) != 1) { - console_out_f (L"MMU: version mismatch %d <> %d\n", get_long (p), 1); + console_out_f (_T("MMU: version mismatch %d <> %d\n"), get_long (p), 1); return 0; } p += 4; @@ -4092,7 +4092,7 @@ int mmu_init(int mode, uaecptr parm, uaecptr parm2) if (mn->mmubank->p_addr == parm2) { getmmubank(mn->mmubank, parm2); if (mmu_logging) - console_out_f (L"MMU: bank update %08X: %08X - %08X %08X\n", + console_out_f (_T("MMU: bank update %08X: %08X - %08X %08X\n"), mn->mmubank->flags, mn->mmubank->addr, mn->mmubank->len + mn->mmubank->addr, mn->mmubank->remap); } @@ -4130,7 +4130,7 @@ int mmu_init(int mode, uaecptr parm, uaecptr parm2) } initialize_memwatch (1); - console_out_f (L"MMU: enabled, %d banks, CB=%08X S=%08X BNK=%08X SF=%08X, %d*%d\n", + console_out_f (_T("MMU: enabled, %d banks, CB=%08X S=%08X BNK=%08X SF=%08X, %d*%d\n"), size - 1, mmu_callback, parm, banks, mmu_regs, mmu_slots, 1 << MMU_PAGE_SHIFT); set_special (SPCFLAG_BRK); return 1; diff --git a/disk.cpp b/disk.cpp index 1f6731e8..1a9a4234 100644 --- a/disk.cpp +++ b/disk.cpp @@ -266,15 +266,15 @@ static void disk_date (uae_u8 *p) time (&t); today = localtime( &t ); - _tcsftime (tmp, sizeof tmp / sizeof (TCHAR), L"%Y", today); + _tcsftime (tmp, sizeof tmp / sizeof (TCHAR), _T("%Y"), today); year = _tstoi (tmp); - _tcsftime (tmp, sizeof tmp / sizeof (TCHAR), L"%j", today); + _tcsftime (tmp, sizeof tmp / sizeof (TCHAR), _T("%j"), today); days = _tstoi (tmp) - 1; - _tcsftime (tmp, sizeof tmp / sizeof (TCHAR), L"%H", today); + _tcsftime (tmp, sizeof tmp / sizeof (TCHAR), _T("%H"), today); minutes = _tstoi (tmp) * 60; - _tcsftime (tmp, sizeof tmp / sizeof (TCHAR), L"%M", today); + _tcsftime (tmp, sizeof tmp / sizeof (TCHAR), _T("%M"), today); minutes += _tstoi (tmp); - _tcsftime (tmp, sizeof tmp / sizeof (TCHAR), L"%S", today); + _tcsftime (tmp, sizeof tmp / sizeof (TCHAR), _T("%S"), today); ticks = _tstoi (tmp) * 50; while (year > 1978) { if ( !(year % 100) ? !(year % 400) : !(year % 4) ) days++; @@ -448,7 +448,7 @@ static int createimagefromexe (struct zfile *src, struct zfile *dst) int totalblocks; int fblock1, dblock1; char *fname1 = "runme.exe"; - TCHAR *fname1b = L"runme.adf"; + TCHAR *fname1b = _T("runme.adf"); char *fname2 = "startup-sequence"; char *dirname1 = "s"; struct zfile *ss; @@ -515,12 +515,12 @@ static TCHAR *drive_id_name(drive *drv) { switch(drv->drive_id) { - case DRIVE_ID_35HD : return L"3.5HD"; - case DRIVE_ID_525SD: return L"5.25SD"; - case DRIVE_ID_35DD : return L"3.5DD"; - case DRIVE_ID_NONE : return L"NONE"; + case DRIVE_ID_35HD : return _T("3.5HD"); + case DRIVE_ID_525SD: return _T("5.25SD"); + case DRIVE_ID_35DD : return _T("3.5DD"); + case DRIVE_ID_NONE : return _T("NONE"); } - return L"UNKNOWN"; + return _T("UNKNOWN"); } /* Simulate exact behaviour of an A3000T 3.5 HD disk drive. @@ -557,7 +557,7 @@ static void drive_settype_id (drive *drv) break; } #ifdef DEBUG_DRIVE_ID - write_log (L"drive_settype_id: DF%d: set to %s\n", drv-floppy, drive_id_name(drv)); + write_log (_T("drive_settype_id: DF%d: set to %s\n"), drv-floppy, drive_id_name(drv)); #endif } @@ -607,7 +607,7 @@ static void setamax (void) for (j = 0; j < MAX_FLOPPY_DRIVES; j++) { if ((1 << j) & disabled) { floppy[j].amax = 1; - write_log (L"AMAX: drive %d\n", j); + write_log (_T("AMAX: drive %d\n"), j); return; } } @@ -683,11 +683,11 @@ int DISK_validate_filename (struct uae_prefs *p, const TCHAR *fname, int leave_o if (wrprot) *wrprot = p->floppy_read_only ? 1 : 0; if (leave_open || !zf) { - struct zfile *f = zfile_fopen (fname, L"r+b", ZFD_NORMAL | ZFD_DISKHISTORY); + struct zfile *f = zfile_fopen (fname, _T("r+b"), ZFD_NORMAL | ZFD_DISKHISTORY); if (!f) { if (wrprot) *wrprot = 1; - f = zfile_fopen (fname, L"rb", ZFD_NORMAL | ZFD_DISKHISTORY); + f = zfile_fopen (fname, _T("rb"), ZFD_NORMAL | ZFD_DISKHISTORY); } if (f && crc32) *crc32 = zfile_crc32 (f); @@ -701,7 +701,7 @@ int DISK_validate_filename (struct uae_prefs *p, const TCHAR *fname, int leave_o if (wrprot) *wrprot = 0; if (crc32) { - struct zfile *f = zfile_fopen (fname, L"rb", ZFD_NORMAL | ZFD_DISKHISTORY); + struct zfile *f = zfile_fopen (fname, _T("rb"), ZFD_NORMAL | ZFD_DISKHISTORY); if (f) *crc32 = zfile_crc32 (f); zfile_fclose (f); @@ -790,7 +790,7 @@ TCHAR *DISK_get_saveimagepath (const TCHAR *name) i--; } fetch_saveimagepath (path, sizeof path / sizeof (TCHAR), 1); - _stprintf (name1, L"%s%s_save.adf", path, name2 + i); + _stprintf (name1, _T("%s%s_save.adf"), path, name2 + i); return name1; } @@ -910,7 +910,7 @@ static int drive_insert (drive * drv, struct uae_prefs *p, int dnum, const TCHAR canauto = 0; ext = _tcsrchr (fname, '.'); if (ext) { - if (!_tcsicmp (ext + 1, L"adf") || !_tcsicmp (ext + 1, L"adz") || !_tcsicmp (ext + 1, L"st") || !_tcsicmp (ext + 1, L"ima") || !_tcsicmp (ext + 1, L"img")) + if (!_tcsicmp (ext + 1, _T("adf")) || !_tcsicmp (ext + 1, _T("adz")) || !_tcsicmp (ext + 1, _T("st")) || !_tcsicmp (ext + 1, _T("ima")) || !_tcsicmp (ext + 1, _T("img"))) canauto = 1; } @@ -1007,7 +1007,7 @@ static int drive_insert (drive * drv, struct uae_prefs *p, int dnum, const TCHAR } else if (memcmp (exeheader, buffer, sizeof exeheader) == 0) { int i; - struct zfile *z = zfile_fopen_empty (NULL, L"", 512 * 1760); + struct zfile *z = zfile_fopen_empty (NULL, _T(""), 512 * 1760); createimagefromexe (drv->diskfile, z); drv->filetype = ADF_NORMAL; zfile_fclose (drv->diskfile); @@ -1117,7 +1117,7 @@ static int drive_insert (drive * drv, struct uae_prefs *p, int dnum, const TCHAR } if (!ds && drv->num_tracks > MAX_TRACKS) - write_log (L"Your diskfile is too big, %d bytes!\n", size); + write_log (_T("Your diskfile is too big, %d bytes!\n"), size); for (i = 0; i < drv->num_tracks; i++) { tid = &drv->trackdata[i]; tid->type = ds ? TRACK_DISKSPARE : TRACK_AMIGADOS; @@ -1176,7 +1176,7 @@ static void drive_step (drive * drv, int step_direction) drv->cyl += dir; if (drv->cyl < 0) drv->cyl = 0; - write_log (L"%d -> %d\n", dir, drv->cyl); + write_log (_T("%d -> %d\n"), dir, drv->cyl); return; } #endif @@ -1184,7 +1184,7 @@ static void drive_step (drive * drv, int step_direction) drv->dskchange = 0; if (drv->steplimit && get_cycles() - drv->steplimitcycle < MIN_STEPLIMIT_CYCLE) { if (disk_debug_logging > 1) - write_log (L" step ignored drive %d, %d", + write_log (_T(" step ignored drive %d, %d"), drv - floppy, (get_cycles() - drv->steplimitcycle) / CYCLE_UNIT); return; } @@ -1201,7 +1201,7 @@ static void drive_step (drive * drv, int step_direction) #endif } /* else - write_log (L"program tried to step beyond track zero\n"); + write_log (_T("program tried to step beyond track zero\n")); "no-click" programs does that */ } else { @@ -1214,14 +1214,14 @@ static void drive_step (drive * drv, int step_direction) #endif } if (drv->cyl >= maxtrack) - write_log (L"program tried to step over track %d\n", maxtrack); + write_log (_T("program tried to step over track %d\n"), maxtrack); #ifdef DRIVESOUND driveclick_click (drv - floppy, drv->cyl); #endif } rand_shifter (drv); if (disk_debug_logging > 1) - write_log (L" ->step %d", drv->cyl); + write_log (_T(" ->step %d"), drv->cyl); } static int drive_track0 (drive * drv) @@ -1261,7 +1261,7 @@ static void drive_motor (drive * drv, bool off) driveclick_motor (drv - floppy, drv->dskready_down_time == 0 ? 2 : 1); #endif if (disk_debug_logging > 1) - write_log (L" ->motor on"); + write_log (_T(" ->motor on")); } if (!drv->motoroff && off) { drv->drive_id_scnt = 0; /* Reset id shift reg counter */ @@ -1270,10 +1270,10 @@ static void drive_motor (drive * drv, bool off) driveclick_motor (drv - floppy, 0); #endif #ifdef DEBUG_DRIVE_ID - write_log (L"drive_motor: Selected DF%d: reset id shift reg.\n",drv-floppy); + write_log (_T("drive_motor: Selected DF%d: reset id shift reg.\n"),drv-floppy); #endif if (disk_debug_logging > 1) - write_log (L" ->motor off"); + write_log (_T(" ->motor off")); if (currprefs.cpu_model <= 68010 && currprefs.m68k_speed == 0) { drv->motordelay = 1; event2_newevent2 (30, drv - floppy, motordelay_func); @@ -1407,7 +1407,7 @@ static void decode_pcdos (drive *drv) drv->skipoffset = 0; drv->tracklen = (dstmfmbuf - drv->bigmfmbuf) * 16; if (disk_debug_logging > 0) - write_log (L"pcdos read track %d\n", tr); + write_log (_T("pcdos read track %d\n"), tr); } static void decode_amigados (drive *drv) @@ -1500,7 +1500,7 @@ static void decode_amigados (drive *drv) } if (disk_debug_logging > 0) - write_log (L"amigados read track %d\n", tr); + write_log (_T("amigados read track %d\n"), tr); } /* @@ -1587,7 +1587,7 @@ static void decode_diskspare (drive *drv) } if (disk_debug_logging > 0) - write_log (L"diskspare read track %d\n", tr); + write_log (_T("diskspare read track %d\n"), tr); } static void drive_fill_bigbuf (drive * drv, int force) @@ -1625,7 +1625,7 @@ static void drive_fill_bigbuf (drive * drv, int force) *mfm = 256 * *data + *(data + 1); } if (disk_debug_logging > 0) - write_log (L"track %d, length %d read from \"saveimage\"\n", tr, drv->tracklen); + write_log (_T("track %d, length %d read from \"saveimage\"\n"), tr, drv->tracklen); } else if (drv->filetype == ADF_CATWEASEL) { #ifdef CATWEASEL drv->tracklen = 0; @@ -1678,7 +1678,7 @@ static void drive_fill_bigbuf (drive * drv, int force) *mfm = 256 * *data + *(data + 1); } if (disk_debug_logging > 1) - write_log (L"rawtrack %d image offset=%x\n", tr, ti->offs); + write_log (_T("rawtrack %d image offset=%x\n"), tr, ti->offs); } drv->buffered_side = side; drv->buffered_cyl = drv->cyl; @@ -1714,7 +1714,7 @@ static void diskfile_update (struct zfile *diskfile, trackid *ti, int len, image free (zerobuf); } if (disk_debug_logging > 0) - write_log (L"track %d, raw track length %d written (total size %d)\n", ti->track, (ti->bitlen + 7) / 8, ti->len); + write_log (_T("track %d, raw track length %d written (total size %d)\n"), ti->track, (ti->bitlen + 7) / 8, ti->len); } #define MFMMASK 0x55555555 @@ -1768,7 +1768,7 @@ static int decode_buffer (uae_u16 *mbuf, int cyl, int drvsec, int ddhd, int file trackoffs = (id & 0xff00) >> 8; if (trackoffs + 1 > drvsec) { - write_log (L"Disk decode: weird sector number %d (%08X, %d)\n", trackoffs, id, mbuf - mstart); + write_log (_T("Disk decode: weird sector number %d (%08X, %d)\n"), trackoffs, id, mbuf - mstart); if (filetype == ADF_EXT2) return 2; continue; @@ -1792,7 +1792,7 @@ static int decode_buffer (uae_u16 *mbuf, int cyl, int drvsec, int ddhd, int file even = getmfmlong (mbuf + 2, shift); mbuf += 4; if (((odd << 1) | even) != chksum || ((id & 0x00ff0000) >> 16) != cyl * 2 + side) { - write_log (L"Disk decode: checksum error on sector %d header\n", trackoffs); + write_log (_T("Disk decode: checksum error on sector %d header\n"), trackoffs); if (filetype == ADF_EXT2) return 3; continue; @@ -1814,7 +1814,7 @@ static int decode_buffer (uae_u16 *mbuf, int cyl, int drvsec, int ddhd, int file chksum ^= odd ^ even; } if (chksum) { - write_log (L"Disk decode: sector %d, data checksum error\n", trackoffs); + write_log (_T("Disk decode: sector %d, data checksum error\n"), trackoffs); if (filetype == ADF_EXT2) return 4; continue; @@ -1827,9 +1827,9 @@ static int decode_buffer (uae_u16 *mbuf, int cyl, int drvsec, int ddhd, int file if (filetype == ADF_EXT2 && (secwritten == 0 || secwritten < 0)) return 5; if (secwritten == 0) - write_log (L"Disk decode: unsupported format\n"); + write_log (_T("Disk decode: unsupported format\n")); if (secwritten < 0) - write_log (L"Disk decode: sector labels ignored\n"); + write_log (_T("Disk decode: sector labels ignored\n")); *drvsecp = drvsec; return 0; } @@ -1900,14 +1900,14 @@ static int drive_write_pcdos (drive *drv) tmp[0] = 0xa1; tmp[1] = 0xa1; tmp[2] = 0xa1; tmp[3] = mark; tmp[4] = cyl; tmp[5] = head; tmp[6] = sector; tmp[7] = size; if (get_crc16 (tmp, 8) != crc || cyl != drv->cyl || head != side || size != 2 || sector < 1 || sector > drv->num_secs) { - write_log (L"PCDOS: track %d, corrupted sector header\n", drv->cyl * 2 + side); + write_log (_T("PCDOS: track %d, corrupted sector header\n"), drv->cyl * 2 + side); return 1; } sector--; continue; } if (mark != 0xfb) { - write_log (L"PCDOS: track %d: unknown address mark %02X\n", drv->cyl * 2 + side, mark); + write_log (_T("PCDOS: track %d: unknown address mark %02X\n"), drv->cyl * 2 + side, mark); continue; } if (sector < 0) @@ -1916,7 +1916,7 @@ static int drive_write_pcdos (drive *drv) secbuf[i + 4] = mfmdecode (&mbuf, shift); crc = (mfmdecode (&mbuf, shift) << 8) | mfmdecode (&mbuf, shift); if (get_crc16 (secbuf, 3 + 1 + 512) != crc) { - write_log (L"PCDOS: track %d, sector %d data checksum error\n", + write_log (_T("PCDOS: track %d, sector %d data checksum error\n"), drv->cyl * 2 + side, sector + 1); continue; } @@ -1924,11 +1924,11 @@ static int drive_write_pcdos (drive *drv) secwritten++; zfile_fseek (drv->diskfile, drv->trackdata[drv->cyl * 2 + side].offs + sector * 512, SEEK_SET); zfile_fwrite (secbuf + 4, sizeof (uae_u8), 512, drv->diskfile); - write_log (L"PCDOS: track %d sector %d written\n", drv->cyl * 2 + side, sector + 1); + write_log (_T("PCDOS: track %d sector %d written\n"), drv->cyl * 2 + side, sector + 1); sector = -1; } if (secwritten != drv->num_secs) - write_log (L"PCDOS: track %d, %d corrupted sectors ignored\n", + write_log (_T("PCDOS: track %d, %d corrupted sectors ignored\n"), drv->cyl * 2 + side, drv->num_secs - secwritten); return 0; } @@ -1960,7 +1960,7 @@ static int drive_write_ext2 (uae_u16 *bigmfmbuf, struct zfile *diskfile, trackid len = (tracklen + 7) / 8; if (len > ti->len) { - write_log (L"disk raw write: image file's track %d is too small (%d < %d)!\n", ti->track, ti->len, len); + write_log (_T("disk raw write: image file's track %d is too small (%d < %d)!\n"), ti->track, ti->len, len); len = ti->len; } diskfile_update (diskfile, ti, tracklen, TRACK_RAW); @@ -2004,7 +2004,7 @@ static void drive_write_data (drive * drv) if (!longwritemode) ret = drive_write_adf_amigados (drv); if (ret) { - write_log (L"not an amigados track %d (error %d), writing as raw track\n", drv->cyl * 2 + side, ret); + write_log (_T("not an amigados track %d (error %d), writing as raw track\n"), drv->cyl * 2 + side, ret); drive_write_ext2 (drv->bigmfmbuf, drv->diskfile, &drv->trackdata[drv->cyl * 2 + side], longwritemode ? dsklength2 * 8 : drv->tracklen); } @@ -2014,7 +2014,7 @@ static void drive_write_data (drive * drv) case ADF_PCDOS: ret = drive_write_pcdos (drv); if (ret) - write_log (L"not a PC formatted track %d (error %d)\n", drv->cyl * 2 + side, ret); + write_log (_T("not a PC formatted track %d (error %d)\n"), drv->cyl * 2 + side, ret); break; } drv->tracktiming[0] = 0; @@ -2036,7 +2036,7 @@ static void drive_eject (drive * drv) drv->crc32 = 0; drive_settype_id (drv); /* Back to 35 DD */ if (disk_debug_logging > 0) - write_log (L"eject drive %d\n", drv - &floppy[0]); + write_log (_T("eject drive %d\n"), drv - &floppy[0]); inprec_recorddiskchange (drv - floppy, NULL, false); } @@ -2062,7 +2062,7 @@ static void floppy_get_rootblock (uae_u8 *dst, int block, const TCHAR *disk_name dst[12+3] = 0x48; dst[312] = dst[313] = dst[314] = dst[315] = (uae_u8)0xff; dst[316+2] = (block + 1) >> 8; dst[316+3] = (block + 1) & 255; - char *s = ua ((disk_name && _tcslen (disk_name) > 0) ? disk_name : L"empty"); + char *s = ua ((disk_name && _tcslen (disk_name) > 0) ? disk_name : _T("empty")); dst[432] = strlen (s); strcpy ((char*)dst + 433, s); xfree (s); @@ -2110,7 +2110,7 @@ void disk_creatediskfile (const TCHAR *name, int type, drive_type adftype, const tracks /= 2; } - f = zfile_fopen (name, L"wb", 0); + f = zfile_fopen (name, _T("wb"), 0); chunk = xmalloc (uae_u8, size); if (f && chunk) { int cylsize = sectors * 2 * 512; @@ -2206,7 +2206,7 @@ static void setdskchangetime (drive *drv, int dsktime) } drv->dskchange_time = dsktime; if (disk_debug_logging > 0) - write_log (L"delayed insert enable %d\n", dsktime); + write_log (_T("delayed insert enable %d\n"), dsktime); } void DISK_reinsert (int num) @@ -2257,7 +2257,7 @@ int disk_setwriteprotect (struct uae_prefs *p, int num, const TCHAR *name, bool void disk_eject (int num) { config_changed = 1; - gui_filename (num, L""); + gui_filename (num, _T("")); drive_eject (floppy + num); *currprefs.floppyslots[num].df = *changed_prefs.floppyslots[num].df = 0; floppy[num].newname[0] = 0; @@ -2400,7 +2400,7 @@ void DISK_vsync (void) if (drv->dskchange_time == 0) { drive_insert (drv, &currprefs, i, drv->newname, false); if (disk_debug_logging > 0) - write_log (L"delayed insert, drive %d, image '%s'\n", i, drv->newname); + write_log (_T("delayed insert, drive %d, image '%s'\n"), i, drv->newname); update_drive_gui (i); } } @@ -2447,7 +2447,7 @@ void DISK_select (uae_u8 data) step_pulse = data & 1; if (disk_debug_logging > 1) - write_log (L"%08X %02X->%02X %s drvmask=%x", M68K_GETPC, prev_data, data, tobin(data), selected ^ 15); + write_log (_T("%08X %02X->%02X %s drvmask=%x"), M68K_GETPC, prev_data, data, tobin(data), selected ^ 15); #ifdef AMAX if (currprefs.amaxromfile[0]) @@ -2459,25 +2459,25 @@ void DISK_select (uae_u8 data) if (floppy[dr].indexhackmode > 1 && !(selected & (1 << dr))) { floppy[dr].indexhack = 1; if (disk_debug_logging > 1) - write_log (L" indexhack!"); + write_log (_T(" indexhack!")); } } } if (disk_debug_logging > 1) { - write_log (L" %d%d%d%d% ", (selected & 1) ? 0 : 1, (selected & 2) ? 0 : 1, (selected & 4) ? 0 : 1, (selected & 8) ? 0 : 1); + write_log (_T(" %d%d%d%d% "), (selected & 1) ? 0 : 1, (selected & 2) ? 0 : 1, (selected & 4) ? 0 : 1, (selected & 8) ? 0 : 1); if ((prev_data & 0x80) != (data & 0x80)) - write_log (L" dskmotor %d ", (data & 0x80) ? 1 : 0); + write_log (_T(" dskmotor %d "), (data & 0x80) ? 1 : 0); if ((prev_data & 0x02) != (data & 0x02)) - write_log (L" direct %d ", (data & 0x02) ? 1 : 0); + write_log (_T(" direct %d "), (data & 0x02) ? 1 : 0); if ((prev_data & 0x04) != (data & 0x04)) - write_log (L" side %d ", (data & 0x04) ? 1 : 0); + write_log (_T(" side %d "), (data & 0x04) ? 1 : 0); } // step goes high and drive was selected when step pulse changes: step if (prev_step != step_pulse) { if (disk_debug_logging > 1) - write_log (L" dskstep %d ", step_pulse); + write_log (_T(" dskstep %d "), step_pulse); prev_step = step_pulse; if (prev_step && !savestate_state) { for (dr = 0; dr < MAX_FLOPPY_DRIVES; dr++) { @@ -2512,7 +2512,7 @@ void DISK_select (uae_u8 data) if (!currprefs.cs_df0idhw && dr == 0) drv->idbit = 0; #ifdef DEBUG_DRIVE_ID - write_log (L"DISK_status: sel %d id %s (%08X) [0x%08lx, bit #%02d: %d]\n", + write_log (_T("DISK_status: sel %d id %s (%08X) [0x%08lx, bit #%02d: %d]\n"), dr, drive_id_name(drv), drv->drive_id, drv->drive_id << drv->drive_id_scnt, 31 - drv->drive_id_scnt, drv->idbit); #endif } @@ -2525,7 +2525,7 @@ void DISK_select (uae_u8 data) } prev_data = data; if (disk_debug_logging > 1) - write_log (L"\n"); + write_log (_T("\n")); } uae_u8 DISK_status (void) @@ -2611,23 +2611,23 @@ void dumpdisk (void) for (i = 0; i < MAX_FLOPPY_DRIVES; i++) { drive *drv = &floppy[i]; if (!(disabled & (1 << i))) { - console_out_f (L"Drive %d: motor %s cylinder %2d sel %s %s mfmpos %d/%d\n", - i, drv->motoroff ? L"off" : L" on", drv->cyl, (selected & (1 << i)) ? L"no" : L"yes", - drive_writeprotected (drv) ? L"ro" : L"rw", drv->mfmpos, drv->tracklen); + console_out_f (_T("Drive %d: motor %s cylinder %2d sel %s %s mfmpos %d/%d\n"), + i, drv->motoroff ? _T("off") : _T(" on"), drv->cyl, (selected & (1 << i)) ? _T("no") : _T("yes"), + drive_writeprotected (drv) ? _T("ro") : _T("rw"), drv->mfmpos, drv->tracklen); if (drv->motoroff == 0) { w = word; for (j = 0; j < 15; j++) { - console_out_f (L"%04X ", w); + console_out_f (_T("%04X "), w); for (k = 0; k < 16; k++) { w <<= 1; w |= getonebit (drv->bigmfmbuf, drv->mfmpos + j * 16 + k); } } - console_out (L"\n"); + console_out (_T("\n")); } } } - console_out_f (L"side %d dma %d off %d word %04X pt %08X len %04X bytr %04X adk %04X sync %04X\n", + console_out_f (_T("side %d dma %d off %d word %04X pt %08X len %04X bytr %04X adk %04X sync %04X\n"), side, dskdmaen, bitoffset, word, dskpt, dsklen, dskbytr_val, adkcon, dsksync); } @@ -2639,10 +2639,10 @@ static void disk_dmafinished (void) dsklength = 0; if (disk_debug_logging > 0) { int dr, mfmpos = -1; - write_log (L"disk dma finished %08X MFMpos=", dskpt); + write_log (_T("disk dma finished %08X MFMpos="), dskpt); for (dr = 0; dr < MAX_FLOPPY_DRIVES; dr++) - write_log (L"%d%s", floppy[dr].mfmpos, dr < MAX_FLOPPY_DRIVES - 1 ? L"," : L""); - write_log (L"\n"); + write_log (_T("%d%s"), floppy[dr].mfmpos, dr < MAX_FLOPPY_DRIVES - 1 ? _T(",") : _T("")); + write_log (_T("\n")); } } @@ -2777,7 +2777,7 @@ static void updatetrackspeed (drive *drv, int mfmpos) static int warned; warned++; if (warned < 50) - write_log (L"corrupted trackspeed value %d\n", drv->trackspeed); + write_log (_T("corrupted trackspeed value %d\n"), drv->trackspeed); drv->trackspeed = 1000; } } @@ -2875,7 +2875,7 @@ static int doreaddma (void) } } if (disk_fifostatus () > 0) { - write_log (L"doreaddma() fifo overflow detected, retrying..\n"); + write_log (_T("doreaddma() fifo overflow detected, retrying..\n")); return -1; } else { DSKDAT (word); @@ -2937,12 +2937,12 @@ static void disk_doupdate_read (drive * drv, int floppybits) else word |= getonebit (drv->bigmfmbuf, drv->mfmpos); } - //write_log (L"%08X bo=%d so=%d mfmpos=%d dma=%d\n", (word & 0xffffff), bitoffset, syncoffset, drv->mfmpos, dma_enable); + //write_log (_T("%08X bo=%d so=%d mfmpos=%d dma=%d\n"), (word & 0xffffff), bitoffset, syncoffset, drv->mfmpos, dma_enable); drv->mfmpos++; drv->mfmpos %= drv->tracklen; if (drv->mfmpos == drv->indexoffset) { if (disk_debug_logging > 1 && drv->indexhack) - write_log (L"indexhack cleared\n"); + write_log (_T("indexhack cleared\n")); drv->indexhack = 0; } if (drv->mfmpos == drv->skipoffset) { @@ -2962,7 +2962,7 @@ static void disk_doupdate_read (drive * drv, int floppybits) dsksync_cycles = get_cycles () + WORDSYNC_TIME * CYCLE_UNIT; if (dskdmaen != DSKDMA_OFF) { if (disk_debug_logging && dma_enable == 0) - write_log (L"Sync match, DMA started at %d PC=%08x\n", drv->mfmpos, M68K_GETPC); + write_log (_T("Sync match, DMA started at %d PC=%08x\n"), drv->mfmpos, M68K_GETPC); dma_enable = 1; } if (adkcon & 0x400) { @@ -2978,7 +2978,7 @@ static void disk_doupdate_read (drive * drv, int floppybits) static void disk_dma_debugmsg (void) { - write_log (L"LEN=%04X (%d) SYNC=%04X PT=%08X ADKCON=%04X PC=%08X\n", + write_log (_T("LEN=%04X (%d) SYNC=%04X PT=%08X ADKCON=%04X PC=%08X\n"), dsklength, dsklength, (adkcon & 0x400) ? dsksync : 0xffff, dskpt, adkcon, M68K_GETPC); } @@ -2998,7 +2998,7 @@ uae_u16 DSKBYTR (int hpos) if (dsklen & 0x4000) v |= 0x2000; if (disk_debug_logging > 1) - write_log (L"DSKBYTR=%04X hpos=%d\n", v, hpos); + write_log (_T("DSKBYTR=%04X hpos=%d\n"), v, hpos); if (disk_debug_mode & DISK_DEBUG_PIO) { int dr; for (dr = 0; dr < MAX_FLOPPY_DRIVES; dr++) { @@ -3008,7 +3008,7 @@ uae_u16 DSKBYTR (int hpos) if (!(selected & (1 << dr))) { if (disk_debug_track < 0 || disk_debug_track == 2 * drv->cyl + side) { disk_dma_debugmsg (); - write_log (L"DSKBYTR=%04X\n", v); + write_log (_T("DSKBYTR=%04X\n"), v); activate_debugger (); break; } @@ -3087,9 +3087,9 @@ void DISK_update (int tohpos) cycles = (tohpos << 8) - disk_hpos; #if 0 if (tohpos == 228) - write_log (L"x"); + write_log (_T("x")); if (tohpos != maxhpos || cycles / 256 != maxhpos) - write_log (L"%d %d %d\n", tohpos, cycles / 256, disk_hpos / 256); + write_log (_T("%d %d %d\n"), tohpos, cycles / 256, disk_hpos / 256); #endif if (cycles <= 0) return; @@ -3157,9 +3157,9 @@ void DSKLEN (uae_u16 v, int hpos) if (dskdmaen != DSKDMA_OFF) { /* Megalomania and Knightmare does this */ if (disk_debug_logging > 0 && dskdmaen == DSKDMA_READ) - write_log (L"warning: Disk read DMA aborted, %d words left PC=%x\n", dsklength, M68K_GETPC); + write_log (_T("warning: Disk read DMA aborted, %d words left PC=%x\n"), dsklength, M68K_GETPC); if (dskdmaen == DSKDMA_WRITE) { - write_log (L"warning: Disk write DMA aborted, %d words left PC=%x\n", dsklength, M68K_GETPC); + write_log (_T("warning: Disk write DMA aborted, %d words left PC=%x\n"), dsklength, M68K_GETPC); // did program write something that needs to be stored to file? for (dr = 0; dr < MAX_FLOPPY_DRIVES; dr++) { drive *drv2 = &floppy[dr]; @@ -3221,13 +3221,13 @@ void DSKLEN (uae_u16 v, int hpos) break; } if (dr == 4) { - write_log (L"disk %s DMA started, drvmask=%x motormask=%x PC=%08x\n", - dskdmaen == DSKDMA_WRITE ? L"write" : L"read", selected ^ 15, motormask, M68K_GETPC); + write_log (_T("disk %s DMA started, drvmask=%x motormask=%x PC=%08x\n"), + dskdmaen == DSKDMA_WRITE ? _T("write") : _T("read"), selected ^ 15, motormask, M68K_GETPC); noselected = 1; } else { if (disk_debug_logging > 0) { - write_log (L"disk %s DMA started, drvmask=%x track %d mfmpos %d dmaen=%d PC=%08X\n", - dskdmaen == DSKDMA_WRITE ? L"write" : L"read", selected ^ 15, + write_log (_T("disk %s DMA started, drvmask=%x track %d mfmpos %d dmaen=%d PC=%08X\n"), + dskdmaen == DSKDMA_WRITE ? _T("write") : _T("read"), selected ^ 15, floppy[dr].cyl * 2 + side, floppy[dr].mfmpos, dma_enable, M68K_GETPC); disk_dma_debugmsg (); } @@ -3359,7 +3359,7 @@ STATIC_INLINE bool iswrite (void) void DSKDAT (uae_u16 v) { if (fifo_inuse[2]) { - write_log (L"DSKDAT: FIFO overflow!\n"); + write_log (_T("DSKDAT: FIFO overflow!\n")); return; } fifo_inuse[2] = fifo_inuse[1]; @@ -3382,7 +3382,7 @@ uae_u16 DSKDATR (void) } } if (i < 0) { - write_log (L"DSKDATR: FIFO underflow!\n"); + write_log (_T("DSKDATR: FIFO underflow!\n")); } else if (dskdmaen > 0 && dskdmaen < 3 && dsklength <= 0 && disk_fifostatus () < 0) { disk_dmafinished (); } @@ -3443,7 +3443,7 @@ void DISK_init (void) disk_eject (dr); } if (disk_empty (0)) - write_log (L"No disk in drive 0.\n"); + write_log (_T("No disk in drive 0.\n")); amax_init (); } @@ -3714,7 +3714,7 @@ uae_u8 *save_disk (int num, int *len, uae_u8 *dstptr, bool usepath) save_u8 (drv->drive_id_scnt); /* id mode position */ save_u32 (drv->mfmpos); /* disk position */ save_u32 (getadfcrc (drv)); /* CRC of disk image */ - save_path (usepath ? currprefs.floppyslots[num].df : L"", SAVESTATE_PATH_FLOPPY);/* image name */ + save_path (usepath ? currprefs.floppyslots[num].df : _T(""), SAVESTATE_PATH_FLOPPY);/* image name */ save_u16 (drv->dskready_up_time); save_u16 (drv->dskready_down_time); *len = dst - dstbak; @@ -3815,11 +3815,11 @@ int disk_prevnext_name (TCHAR *imgp, int dir) old = my_strdup (imgp); - struct zfile *zf = zfile_fopen (imgp, L"rb", ZFD_NORMAL); + struct zfile *zf = zfile_fopen (imgp, _T("rb"), ZFD_NORMAL); if (zf) { _tcscpy (img, zfile_getname (zf)); zfile_fclose (zf); - zf = zfile_fopen (img, L"rb", ZFD_NORMAL); + zf = zfile_fopen (img, _T("rb"), ZFD_NORMAL); if (!zf) // oops, no directory support in this archive type _tcscpy (img, imgp); zfile_fclose (zf); @@ -3838,7 +3838,7 @@ retry: dst[cnt] = NULL; for (;;) { // disk x of y - p = _tcsstr (ps, L"(disk "); + p = _tcsstr (ps, _T("(disk ")); if (p && _istdigit (p[6])) { p2 = p - imgl + img; num = _tstoi (p + 6); @@ -3851,7 +3851,7 @@ retry: } if (gotone) break; - p = _tcsstr (ps, L"disk"); + p = _tcsstr (ps, _T("disk")); if (p && _istdigit (p[4])) { p2 = p - imgl + img; num = _tstoi (p + 4); diff --git a/diskutil.cpp b/diskutil.cpp index e872bd9c..c0a2af1f 100644 --- a/diskutil.cpp +++ b/diskutil.cpp @@ -34,7 +34,7 @@ static int drive_write_adf_amigados (uae_u16 *mbuf, uae_u16 *mend, uae_u8 *write do { while (*mbuf++ != 0x4489) { if (mbuf >= mend) { - write_log (L"* track %d, unexpected end of data\n", track); + write_log (_T("* track %d, unexpected end of data\n"), track); return 1; } } @@ -47,7 +47,7 @@ static int drive_write_adf_amigados (uae_u16 *mbuf, uae_u16 *mend, uae_u8 *write trackoffs = (id & 0xff00) >> 8; if (trackoffs > 10) { - write_log (L"* track %d, corrupt sector number %d\n", track, trackoffs); + write_log (_T("* track %d, corrupt sector number %d\n"), track, trackoffs); goto next; } /* this sector is already ok? */ @@ -62,7 +62,7 @@ static int drive_write_adf_amigados (uae_u16 *mbuf, uae_u16 *mend, uae_u8 *write dlong = (odd << 1) | even; if (dlong) { - write_log (L"* track %d, sector %d header crc error\n", track, trackoffs); + write_log (_T("* track %d, sector %d header crc error\n"), track, trackoffs); goto next; } chksum ^= odd ^ even; @@ -90,7 +90,7 @@ static int drive_write_adf_amigados (uae_u16 *mbuf, uae_u16 *mend, uae_u8 *write } mbuf += 256; if (chksum) { - write_log (L"* track %d, sector %d data crc error\n", track, trackoffs); + write_log (_T("* track %d, sector %d data crc error\n"), track, trackoffs); goto next; } memcpy (writebuffer + trackoffs * 512, secbuf + 32, 512); @@ -181,7 +181,7 @@ static int drive_write_adf_pc (uae_u16 *mbuf, uae_u16 *mend, uae_u8 *writebuffer *outsize = sectors * 512; return 0; } - write_log (L"* track %d, unexpected end of data\n", track); + write_log (_T("* track %d, unexpected end of data\n"), track); return 1; } shift++; @@ -217,14 +217,14 @@ static int drive_write_adf_pc (uae_u16 *mbuf, uae_u16 *mend, uae_u8 *writebuffer tmp[0] = 0xa1; tmp[1] = 0xa1; tmp[2] = 0xa1; tmp[3] = mark; tmp[4] = cyl; tmp[5] = head; tmp[6] = sector; tmp[7] = size; if (get_crc16 (tmp, 8) != crc || cyl != track / 2 || head != (track & 1) || size != 2 || sector < 1 || sector > 20) { - write_log (L"PCDOS: track %d, corrupted sector header\n", track); + write_log (_T("PCDOS: track %d, corrupted sector header\n"), track); continue; } sector--; continue; } if (mark != 0xfb) { - write_log (L"PCDOS: track %d: unknown address mark %02X\n", track, mark); + write_log (_T("PCDOS: track %d: unknown address mark %02X\n"), track, mark); continue; } if (sector < 0) @@ -236,7 +236,7 @@ static int drive_write_adf_pc (uae_u16 *mbuf, uae_u16 *mend, uae_u8 *writebuffer sector = 0; crc = (mfmdecode (&mbuf, shift) << 8) | mfmdecode (&mbuf, shift); if (get_crc16 (secbuf, 3 + 1 + 512) != crc) { - write_log (L"PCDOS: track %d, sector %d data checksum error\n", + write_log (_T("PCDOS: track %d, sector %d data checksum error\n"), track, sector + 1); continue; } diff --git a/drawing.cpp b/drawing.cpp index 590d5138..7df667dd 100644 --- a/drawing.cpp +++ b/drawing.cpp @@ -255,7 +255,7 @@ static void xlinecheck (unsigned int start, unsigned int end) ok = 0; if (!ok) { - write_log (L"*** %d-%d (%dx%dx%d %d) %p\n", + write_log (_T("*** %d-%d (%dx%dx%d %d) %p\n"), start - min, end - min, gfxvidinfo.drawbuffer.width, gfxvidinfo.drawbuffer.height, gfxvidinfo.drawbuffer.pixbytes, gfxvidinfo.drawbuffer.rowbytes, xlinebuffer); @@ -490,8 +490,8 @@ int get_custom_limits (int *pw, int *ph, int *pdx, int *pdy) *pdx = dx; *pdy = dy; #if 1 - write_log (L"Display Size: %dx%d Offset: %dx%d\n", w, h, dx, dy); - write_log (L"First: %d Last: %d MinV: %d MaxV: %d Min: %d\n", + write_log (_T("Display Size: %dx%d Offset: %dx%d\n"), w, h, dx, dy); + write_log (_T("First: %d Last: %d MinV: %d MaxV: %d Min: %d\n"), plffirstline_total, plflastline_total, first_planes_vpos, last_planes_vpos, minfirstline); #endif @@ -1722,7 +1722,7 @@ void init_row_map (void) { int i, j; if (gfxvidinfo.drawbuffer.height > MAX_VIDHEIGHT) { - write_log (L"Resolution too high, aborting\n"); + write_log (_T("Resolution too high, aborting\n")); abort (); } j = 0; @@ -2042,7 +2042,7 @@ static void pfield_draw_line (struct vidbuffer *vb, int lineno, int gfx_ypos, in { case LINE_REMEMBERED_AS_PREVIOUS: // if (!warned) // happens when program messes up with VPOSW -// write_log (L"Shouldn't get here... this is a bug.\n"), warned++; +// write_log (_T("Shouldn't get here... this is a bug.\n")), warned++; return; case LINE_BLACK: @@ -2254,7 +2254,7 @@ static void center_image (void) visible_left_border = 0; visible_left_border &= ~((xshift (1, lores_shift)) - 1); - //write_log (L"%d %d %d %d %d\n", max_diwlastword, gfxvidinfo.drawbuffer.width, lores_shift, currprefs.gfx_resolution, visible_left_border); + //write_log (_T("%d %d %d %d %d\n"), max_diwlastword, gfxvidinfo.drawbuffer.width, lores_shift, currprefs.gfx_resolution, visible_left_border); linetoscr_x_adjust_bytes = visible_left_border * gfxvidinfo.drawbuffer.pixbytes; @@ -2348,7 +2348,7 @@ static void init_drawing_frame (void) if (changed_prefs.gfx_resolution != nr || changed_prefs.gfx_vresolution != nl) { changed_prefs.gfx_resolution = nr; changed_prefs.gfx_vresolution = nl; - write_log (L"RES -> %d LINE -> %d\n", nr, nl); + write_log (_T("RES -> %d LINE -> %d\n"), nr, nl); config_changed = 1; } if (src->width > 0 && src->height > 0) { @@ -2770,7 +2770,7 @@ void vsync_handle_redraw (int long_frame, int lof_changed) if (!savestate_state) { if (currprefs.quitstatefile[0]) { savestate_initsave (currprefs.quitstatefile, 1, 1, true); - save_state (currprefs.quitstatefile, L""); + save_state (currprefs.quitstatefile, _T("")); } } #endif @@ -2877,13 +2877,13 @@ bool notice_interlace_seen (bool lace) if (lace) { if (interlace_seen == 0) { changed = true; - //write_log (L"->lace PC=%x\n", m68k_getpc ()); + //write_log (_T("->lace PC=%x\n"), m68k_getpc ()); } interlace_seen = currprefs.gfx_vresolution ? 1 : -1; } else { if (interlace_seen) { changed = true; - //write_log (L"->non-lace PC=%x\n", m68k_getpc ()); + //write_log (_T("->non-lace PC=%x\n"), m68k_getpc ()); } interlace_seen = 0; } diff --git a/driveclick.cpp b/driveclick.cpp index ad7da8b1..b2e52d53 100644 --- a/driveclick.cpp +++ b/driveclick.cpp @@ -66,13 +66,13 @@ static int loadsample (TCHAR *path, struct drvsample *ds) int size; TCHAR name[MAX_DPATH]; - f = zfile_fopen (path, L"rb", ZFD_NORMAL); + f = zfile_fopen (path, _T("rb"), ZFD_NORMAL); if (!f) { _tcscpy (name, path); - _tcscat (name, L".wav"); - f = zfile_fopen (name, L"rb", ZFD_NORMAL); + _tcscat (name, _T(".wav")); + f = zfile_fopen (name, _T("rb"), ZFD_NORMAL); if (!f) { - write_log (L"driveclick: can't open '%s' (or '%s')\n", path, name); + write_log (_T("driveclick: can't open '%s' (or '%s')\n"), path, name); return 0; } } @@ -168,22 +168,22 @@ void driveclick_init (void) wave_initialized = 1; for (j = 0; j < CLICK_TRACKS; j++) drvs[i][DS_CLICK].lengths[j] = drvs[i][DS_CLICK].len; - get_plugin_path (path2, sizeof path2 / sizeof (TCHAR), L"floppysounds"); - _stprintf (tmp, L"%sdrive_click_%s", + get_plugin_path (path2, sizeof path2 / sizeof (TCHAR), _T("floppysounds")); + _stprintf (tmp, _T("%sdrive_click_%s"), path2, fs->dfxclickexternal); v = loadsample (tmp, &drvs[i][DS_CLICK]); if (v) processclicks (&drvs[i][DS_CLICK]); - _stprintf (tmp, L"%sdrive_spin_%s", + _stprintf (tmp, _T("%sdrive_spin_%s"), path2, fs->dfxclickexternal); v += loadsample (tmp, &drvs[i][DS_SPIN]); - _stprintf (tmp, L"%sdrive_spinnd_%s", + _stprintf (tmp, _T("%sdrive_spinnd_%s"), path2, fs->dfxclickexternal); v += loadsample (tmp, &drvs[i][DS_SPINND]); - _stprintf (tmp, L"%sdrive_startup_%s", + _stprintf (tmp, _T("%sdrive_startup_%s"), path2, fs->dfxclickexternal); v += loadsample (tmp, &drvs[i][DS_START]); - _stprintf (tmp, L"%sdrive_snatch_%s", + _stprintf (tmp, _T("%sdrive_snatch_%s"), path2, fs->dfxclickexternal); v += loadsample (tmp, &drvs[i][DS_SNATCH]); } diff --git a/enforcer.cpp b/enforcer.cpp index c24e80f7..945c94d7 100644 --- a/enforcer.cpp +++ b/enforcer.cpp @@ -164,11 +164,11 @@ static int enforcer_decode_hunk_and_offset (TCHAR *buf, uae_u32 pc) if (name) { native_name = au ((char*)amiga2native(name,100)); if (!native_name) - native_name = my_strdup (L"Unknown"); + native_name = my_strdup (_T("Unknown")); } else { - native_name = my_strdup (L"Unknown"); + native_name = my_strdup (_T("Unknown")); } - _stprintf (buf, L"----> %08lx - \"%s\" Hunk %04lx Offset %08lx\n", pc, native_name, hunk, offset); + _stprintf (buf, _T("----> %08lx - \"%s\" Hunk %04lx Offset %08lx\n"), pc, native_name, hunk, offset); xfree (native_name); return 1; } @@ -220,21 +220,21 @@ static void enforcer_display_hit (const TCHAR *addressmode, uae_u32 pc, uaecptr { Exception (0x2d,0); }*/ - _tcscpy (enforcer_buf_ptr, L"Enforcer Hit! Bad program\n"); + _tcscpy (enforcer_buf_ptr, _T("Enforcer Hit! Bad program\n")); enforcer_buf_ptr += _tcslen (enforcer_buf_ptr); - _stprintf (buf, L"Illegal %s: %08lx", addressmode, addr); - _stprintf (enforcer_buf_ptr, L"%-48sPC: %0lx\n", buf, pc); + _stprintf (buf, _T("Illegal %s: %08lx"), addressmode, addr); + _stprintf (enforcer_buf_ptr, _T("%-48sPC: %0lx\n"), buf, pc); enforcer_buf_ptr += _tcslen (enforcer_buf_ptr); /* Data registers */ - _stprintf (enforcer_buf_ptr, L"Data: %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", + _stprintf (enforcer_buf_ptr, _T("Data: %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n"), m68k_dreg (regs, 0), m68k_dreg (regs, 1), m68k_dreg (regs, 2), m68k_dreg (regs, 3), m68k_dreg (regs, 4), m68k_dreg (regs, 5), m68k_dreg (regs, 6), m68k_dreg (regs, 7)); enforcer_buf_ptr += _tcslen (enforcer_buf_ptr); /* Address registers */ - _stprintf (enforcer_buf_ptr, L"Addr: %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n", + _stprintf (enforcer_buf_ptr, _T("Addr: %08lx %08lx %08lx %08lx %08lx %08lx %08lx %08lx\n"), m68k_areg (regs, 0), m68k_areg (regs, 1), m68k_areg (regs, 2), m68k_areg (regs, 3), m68k_areg (regs, 4), m68k_areg (regs, 5), m68k_areg (regs, 6), m68k_areg (regs, 7)); enforcer_buf_ptr += _tcslen (enforcer_buf_ptr); @@ -244,10 +244,10 @@ static void enforcer_display_hit (const TCHAR *addressmode, uae_u32 pc, uaecptr for (i = 0; i < 8 * STACKLINES; i++) { a7 += 4; if (!(i % 8)) { - _tcscpy (enforcer_buf_ptr, L"Stck:"); + _tcscpy (enforcer_buf_ptr, _T("Stck:")); enforcer_buf_ptr += _tcslen (enforcer_buf_ptr); } - _stprintf (enforcer_buf_ptr, L" %08lx",get_long (a7)); + _stprintf (enforcer_buf_ptr, _T(" %08lx"),get_long (a7)); enforcer_buf_ptr += _tcslen (enforcer_buf_ptr); if (i%8 == 7) @@ -340,7 +340,7 @@ static void enforcer_display_hit (const TCHAR *addressmode, uae_u32 pc, uaecptr } sm68k_disasm (buf, instrcode, bestpc, NULL); - _stprintf (lines[i], L"%08lx : %-20s %s\n", bestpc, instrcode, buf); + _stprintf (lines[i], _T("%08lx : %-20s %s\n"), bestpc, instrcode, buf); temppc = bestpc; } @@ -354,15 +354,15 @@ static void enforcer_display_hit (const TCHAR *addressmode, uae_u32 pc, uaecptr temppc = pc; for (i = 0; i < (INSTRUCTIONLINES + 1) / 2; i++) { sm68k_disasm (buf, instrcode, temppc, &nextpc); - _stprintf (enforcer_buf_ptr, L"%08lx : %s %-20s %s\n", temppc, - (i == 0 ? L"*" : L" "), instrcode, buf); + _stprintf (enforcer_buf_ptr, _T("%08lx : %s %-20s %s\n"), temppc, + (i == 0 ? _T("*") : _T(" ")), instrcode, buf); enforcer_buf_ptr += _tcslen (enforcer_buf_ptr); temppc = nextpc; } if (!native_task_name) - native_task_name = L"Unknown"; - _stprintf (enforcer_buf_ptr, L"Name: \"%s\"\n\n", native_task_name); + native_task_name = _T("Unknown"); + _stprintf (enforcer_buf_ptr, _T("Name: \"%s\"\n\n"), native_task_name); enforcer_buf_ptr += _tcslen (enforcer_buf_ptr); console_out (enforcer_buf); @@ -385,7 +385,7 @@ uae_u32 REGPARAM2 chipmem_lget2 (uaecptr addr) if (ISILLEGAL_LONG (addr)) { - enforcer_display_hit (L"LONG READ from",(uae_u32)(regs.pc_p - NMEM_OFFSET),addr); + enforcer_display_hit (_T("LONG READ from"),(uae_u32)(regs.pc_p - NMEM_OFFSET),addr); if (enforcermode & 1) set_special (SPCFLAG_TRAP); } @@ -402,7 +402,7 @@ uae_u32 REGPARAM2 chipmem_wget2(uaecptr addr) if (ISILLEGAL_WORD (addr)) { - enforcer_display_hit (L"WORD READ from",(uae_u32)(regs.pc_p - NMEM_OFFSET),addr); + enforcer_display_hit (_T("WORD READ from"),(uae_u32)(regs.pc_p - NMEM_OFFSET),addr); if (enforcermode & 1) set_special (SPCFLAG_TRAP); } @@ -416,7 +416,7 @@ uae_u32 REGPARAM2 chipmem_bget2 (uaecptr addr) if (ISILLEGAL_BYTE (addr)) { - enforcer_display_hit (L"BYTE READ from",(uae_u32)(regs.pc_p - NMEM_OFFSET),addr); + enforcer_display_hit (_T("BYTE READ from"),(uae_u32)(regs.pc_p - NMEM_OFFSET),addr); if (enforcermode & 1) set_special (SPCFLAG_TRAP); } @@ -434,7 +434,7 @@ void REGPARAM2 chipmem_lput2 (uaecptr addr, uae_u32 l) if (ISILLEGAL_LONG (addr)) { - enforcer_display_hit (L"LONG WRITE to",(uae_u32)(regs.pc_p - NMEM_OFFSET),addr); + enforcer_display_hit (_T("LONG WRITE to"),(uae_u32)(regs.pc_p - NMEM_OFFSET),addr); if (enforcermode & 1) if (addr != 0x100) set_special (SPCFLAG_TRAP); @@ -454,7 +454,7 @@ void REGPARAM2 chipmem_wput2 (uaecptr addr, uae_u32 w) if (ISILLEGAL_WORD (addr)) { - enforcer_display_hit (L"WORD WRITE to",(uae_u32)(regs.pc_p - NMEM_OFFSET),addr); + enforcer_display_hit (_T("WORD WRITE to"),(uae_u32)(regs.pc_p - NMEM_OFFSET),addr); if (enforcermode & 1) set_special (SPCFLAG_TRAP); } @@ -470,7 +470,7 @@ void REGPARAM2 chipmem_bput2 (uaecptr addr, uae_u32 b) if (ISILLEGAL_BYTE (addr)) { - enforcer_display_hit (L"BYTE WRITE to",(uae_u32)(regs.pc_p - NMEM_OFFSET),addr); + enforcer_display_hit (_T("BYTE WRITE to"),(uae_u32)(regs.pc_p - NMEM_OFFSET),addr); if (enforcermode & 1) set_special (SPCFLAG_TRAP); } @@ -496,7 +496,7 @@ uae_u8 * REGPARAM2 chipmem_xlate2 (uaecptr addr) uae_u32 REGPARAM2 dummy_lget2 (uaecptr addr) { special_mem_r; - enforcer_display_hit (L"LONG READ from",(uae_u32)(regs.pc_p - NMEM_OFFSET), addr); + enforcer_display_hit (_T("LONG READ from"),(uae_u32)(regs.pc_p - NMEM_OFFSET), addr); if (enforcermode & 1) { set_special (SPCFLAG_TRAP); return 0; @@ -516,12 +516,12 @@ uae_u32 REGPARAM2 dummy_wget2 (uaecptr addr) if (addr >= 0x00F10000 && addr <= 0x00F7FFFF) { if (!warned_JIT_0xF10000) { warned_JIT_0xF10000 = 1; - enforcer_display_hit (L"LONG READ from",(uae_u32)(regs.pc_p - NMEM_OFFSET),addr); + enforcer_display_hit (_T("LONG READ from"),(uae_u32)(regs.pc_p - NMEM_OFFSET),addr); } return 0; } #endif - enforcer_display_hit (L"WORD READ from",(uae_u32)(regs.pc_p - NMEM_OFFSET),addr); + enforcer_display_hit (_T("WORD READ from"),(uae_u32)(regs.pc_p - NMEM_OFFSET),addr); if (enforcermode & 1) { set_special (SPCFLAG_TRAP); return 0; @@ -532,7 +532,7 @@ uae_u32 REGPARAM2 dummy_wget2 (uaecptr addr) uae_u32 REGPARAM2 dummy_bget2 (uaecptr addr) { special_mem_r; - enforcer_display_hit (L"BYTE READ from",(uae_u32)(regs.pc_p - NMEM_OFFSET),addr); + enforcer_display_hit (_T("BYTE READ from"),(uae_u32)(regs.pc_p - NMEM_OFFSET),addr); if (enforcermode & 1) { set_special (SPCFLAG_TRAP); return 0; @@ -543,7 +543,7 @@ uae_u32 REGPARAM2 dummy_bget2 (uaecptr addr) void REGPARAM2 dummy_lput2 (uaecptr addr, uae_u32 l) { special_mem_w; - enforcer_display_hit (L"LONG WRITE to",(uae_u32)(regs.pc_p - NMEM_OFFSET),addr); + enforcer_display_hit (_T("LONG WRITE to"),(uae_u32)(regs.pc_p - NMEM_OFFSET),addr); if (enforcermode & 1) { set_special (SPCFLAG_TRAP); return; @@ -553,7 +553,7 @@ void REGPARAM2 dummy_lput2 (uaecptr addr, uae_u32 l) void REGPARAM2 dummy_wput2 (uaecptr addr, uae_u32 w) { special_mem_w; - enforcer_display_hit (L"WORD WRITE to",(uae_u32)(regs.pc_p - NMEM_OFFSET),addr); + enforcer_display_hit (_T("WORD WRITE to"),(uae_u32)(regs.pc_p - NMEM_OFFSET),addr); if (enforcermode & 1) { set_special (SPCFLAG_TRAP); return; @@ -563,7 +563,7 @@ void REGPARAM2 dummy_wput2 (uaecptr addr, uae_u32 w) void REGPARAM2 dummy_bput2 (uaecptr addr, uae_u32 b) { special_mem_w; - enforcer_display_hit (L"BYTE WRITE to",(uae_u32)(regs.pc_p - NMEM_OFFSET),addr); + enforcer_display_hit (_T("BYTE WRITE to"),(uae_u32)(regs.pc_p - NMEM_OFFSET),addr); if (enforcermode & 1) { set_special (SPCFLAG_TRAP); return; @@ -573,7 +573,7 @@ void REGPARAM2 dummy_bput2 (uaecptr addr, uae_u32 b) int REGPARAM2 dummy_check2 (uaecptr addr, uae_u32 size) { special_mem_r; - enforcer_display_hit (L"CHECK from ",(uae_u32)(regs.pc_p - NMEM_OFFSET),addr); + enforcer_display_hit (_T("CHECK from "),(uae_u32)(regs.pc_p - NMEM_OFFSET),addr); return 0; } diff --git a/epsonprinter.cpp b/epsonprinter.cpp index a73516cf..afd45ec0 100644 --- a/epsonprinter.cpp +++ b/epsonprinter.cpp @@ -36,7 +36,7 @@ #include -//#define DEBUGPRINT L"C:\\Users\\twilen\\Desktop\\CMD_file.1" +//#define DEBUGPRINT _T("C:\\Users\\twilen\\Desktop\\CMD_file.1") int pngprint = 0; #ifdef C_LIBPNG @@ -460,7 +460,7 @@ static void selectCodepage(Bit16u cp) mapToUse = cp866Map; break; default: - write_log(L"Unsupported codepage %i. Using CP437 instead.\n", cp); + write_log(_T("Unsupported codepage %i. Using CP437 instead.\n"), cp); mapToUse = cp437Map; } @@ -520,9 +520,9 @@ static int selectfont(Bit16u style) break; rounds++; if (style & STYLE_PROP) - thisFontName = curFontName = L"Times New Roman"; + thisFontName = curFontName = _T("Times New Roman"); else - thisFontName = curFontName = L"Courier New"; + thisFontName = curFontName = _T("Courier New"); } if (curFont) { SelectObject (memHDC, curFont); @@ -555,15 +555,15 @@ static void updateFont(void) case roman: default: if (prop) - fontName = L"Times New Roman"; + fontName = _T("Times New Roman"); else - fontName = L"Courier New"; + fontName = _T("Courier New"); break; case sansserif: if (prop) - fontName = L"Arial"; + fontName = _T("Arial"); else - fontName = L"Lucida Console"; + fontName = _T("Lucida Console"); break; } @@ -571,7 +571,7 @@ static void updateFont(void) curFontName = fontName; #else if (!ft) { - write_log(L"EPSONPRINTER: No freetype6.dll, unable to load font %s\n", fontName); + write_log(_T("EPSONPRINTER: No freetype6.dll, unable to load font %s\n"), fontName); curFont = NULL; } else if (FT_New_Face(FTlib, fontName, 0, &curFont)) { char windowsdir[MAX_DPATH]; @@ -584,7 +584,7 @@ static void updateFont(void) strcat (windowsdir, "\\Fonts\\"); strcat (windowsdir, "times.ttf"); if (FT_New_Face(FTlib, windowsdir, 0, &curFont)) { - write_log(L"Unable to load font %s\n", fontName); + write_log(_T("Unable to load font %s\n"), fontName); curFont = NULL; } } @@ -675,8 +675,8 @@ static void getfname (TCHAR *fname) fetch_screenshotpath (tmp, sizeof tmp / sizeof (TCHAR)); for (;;) { FILE *fp; - _stprintf (fname, L"%sPRINT_%03d.png", tmp, number); - if ((fp = _tfopen (fname, L"rb")) == NULL) + _stprintf (fname, _T("%sPRINT_%03d.png"), tmp, number); + if ((fp = _tfopen (fname, _T("rb"))) == NULL) return; number++; fclose (fp); @@ -720,7 +720,7 @@ static void *prt_thread (void *p) uae_u8 *Tcpage = cpage; int TcolorPrinter = colorPrinted; - write_log (L"EPSONPRINTER: background print thread started\n"); + write_log (_T("EPSONPRINTER: background print thread started\n")); prt_thread_mode = 1; SetThreadPriority (GetCurrentThread (), THREAD_PRIORITY_BELOW_NORMAL); @@ -732,7 +732,7 @@ static void *prt_thread (void *p) int leftmargin = GetDeviceCaps (TprinterDC, PHYSICALOFFSETY); HDC dc = NULL; - write_log (L"EPSONPRINTER: HP=%d WP=%d TM=%d LM=%d W=%d H=%d\n", + write_log (_T("EPSONPRINTER: HP=%d WP=%d TM=%d LM=%d W=%d H=%d\n"), hz, vz, topmargin, leftmargin, Tpage_w, Tpage_h); if (TcolorPrinter) @@ -746,7 +746,7 @@ static void *prt_thread (void *p) { DOCINFO docinfo; docinfo.cbSize = sizeof (docinfo); - docinfo.lpszDocName = L"WinUAE Epson Printer"; + docinfo.lpszDocName = _T("WinUAE Epson Printer"); docinfo.lpszOutput = NULL; docinfo.lpszDatatype = NULL; docinfo.fwType = 0; @@ -793,10 +793,10 @@ static void *prt_thread (void *p) getfname (fname); /* Open the actual file */ - fp=_tfopen(fname,L"wb"); + fp=_tfopen(fname,_T("wb")); if (!fp) { - write_log(L"EPSONPRINTER: Can't open file %s for printer output\n", fname); + write_log(_T("EPSONPRINTER: Can't open file %s for printer output\n"), fname); goto end; } @@ -870,7 +870,7 @@ static void *prt_thread (void *p) /*clean up dynamically allocated RAM.*/ xfree (row_pointers); xfree (bm); - ShellExecute (NULL, L"open", fname, NULL, NULL, SW_SHOWNORMAL); + ShellExecute (NULL, _T("open"), fname, NULL, NULL, SW_SHOWNORMAL); } #endif end: @@ -879,14 +879,14 @@ end: if (TprinterDC) DeleteObject (TprinterDC); DeleteObject (TmemHDC); - write_log (L"EPSONPRINTER: background thread finished\n"); + write_log (_T("EPSONPRINTER: background thread finished\n")); return 0; } static void outputPage(void) { prt_thread_mode = 0; - if (uae_start_thread (L"epson", prt_thread, NULL, NULL)) { + if (uae_start_thread (_T("epson"), prt_thread, NULL, NULL)) { while (prt_thread_mode == 0) Sleep(5); memHDC = NULL; @@ -976,7 +976,7 @@ static int printer_init(Bit16u dpi2, Bit16u width, Bit16u height, const TCHAR *p #ifndef WINFONT if (ft == NULL || FT_Init_FreeType(&FTlib)) { - write_log(L"EPSONPRINTER: Unable to init Freetype2. ASCII printing disabled\n"); + write_log(_T("EPSONPRINTER: Unable to init Freetype2. ASCII printing disabled\n")); return 0; } #endif @@ -1035,7 +1035,7 @@ static int printer_init(Bit16u dpi2, Bit16u width, Bit16u height, const TCHAR *p charRead = false; autoFeed = false; outputHandle = NULL; - write_log (L"EPSONPRINTER: Page size: %dx%d DPI: %dx%d\n", + write_log (_T("EPSONPRINTER: Page size: %dx%d DPI: %dx%d\n"), page_w, page_h, dpiX, dpiY); initPrinter(); @@ -1057,7 +1057,7 @@ static void printer_close(void) if (ft) FT_Done_FreeType(FTlib); #endif - write_log (L"EPSONPRINTER: end\n"); + write_log (_T("EPSONPRINTER: end\n")); } xfree (otm); otm = NULL; @@ -1192,7 +1192,7 @@ static void setupBitImage(Bit8u dens, Bit16u numCols, int pin9) bitGraph.bytesColumn = 6; break; default: - write_log(L"EPSONPRINTER: Unsupported bit image density %i\n", dens); + write_log(_T("EPSONPRINTER: Unsupported bit image density %i\n"), dens); } bitGraph.pin9 = false; if (pins == 9) { @@ -1297,12 +1297,12 @@ static int processCommandChar(Bit8u ch) case 0x25: // Select user-defined set (ESC %) case 0x26: // Define user-defined characters (ESC &) case 0x3a: // Copy ROM to RAM (ESC :) - write_log(L"User-defined characters not supported!\n"); + write_log(_T("User-defined characters not supported!\n")); return true; case 0x28: // Two bytes sequence return true; default: - write_log(L"EPSONPRINTER: Unknown command ESC %c (%02X). Unable to skip parameters.\n", ESCCmd, ESCCmd); + write_log(_T("EPSONPRINTER: Unknown command ESC %c (%02X). Unable to skip parameters.\n"), ESCCmd, ESCCmd); neededParam = 0; ESCCmd = 0; return true; @@ -1340,7 +1340,7 @@ static int processCommandChar(Bit8u ch) break; default: // ESC ( commands are always followed by a "number of parameters" word parameter - write_log(L"EPSONPRINTER: Skipping unsupported command ESC ( %c (%02X).\n", ESCCmd, ESCCmd); + write_log(_T("EPSONPRINTER: Skipping unsupported command ESC ( %c (%02X).\n"), ESCCmd, ESCCmd); neededParam = 2; ESCCmd = 0x101; return true; @@ -1785,7 +1785,7 @@ static int processCommandChar(Bit8u ch) updateFont(); break; case 0x242: // Bar code setup and print (ESC (B) - write_log(L"EPSONPRINTER: Barcode printing not supported\n"); + write_log(_T("EPSONPRINTER: Barcode printing not supported\n")); // Find out how many bytes to skip neededParam = PARAM16(0); numParam = 0; @@ -1841,9 +1841,9 @@ static int processCommandChar(Bit8u ch) break; default: if (ESCCmd < 0x100) - write_log(L"EPSONPRINTER: Skipped unsupported command ESC %c (%02X)\n", ESCCmd, ESCCmd); + write_log(_T("EPSONPRINTER: Skipped unsupported command ESC %c (%02X)\n"), ESCCmd, ESCCmd); else - write_log(L"EPSONPRINTER: Skipped unsupported command ESC ( %c (%02X)\n", ESCCmd-0x200, ESCCmd-0x200); + write_log(_T("EPSONPRINTER: Skipped unsupported command ESC ( %c (%02X)\n"), ESCCmd-0x200, ESCCmd-0x200); } ESCCmd = 0; @@ -2336,9 +2336,9 @@ static int epson_ft (void) { #ifndef WINFONT if (!ft) - ft = WIN32_LoadLibrary (L"freetype6.dll"); + ft = WIN32_LoadLibrary (_T("freetype6.dll")); if (!ft) { - write_log (L"EPSONPRINTER: freetype6.dll not found. Text output disabled."); + write_log (_T("EPSONPRINTER: freetype6.dll not found. Text output disabled.")); return 0; } #endif @@ -2356,7 +2356,7 @@ void epson_printchar(uae_u8 c) if (printed) return; printed = 1; - struct zfile *zf = zfile_fopen (DEBUGPRINT, L"rb", ZFD_ALL); + struct zfile *zf = zfile_fopen (DEBUGPRINT, _T("rb"), ZFD_ALL); for (;;) { int v = zfile_getc (zf); if (v < 0) @@ -2375,7 +2375,7 @@ int epson_init(const TCHAR *printername, int type) else pins = 48; epson_ft (); - write_log (L"EPSONPRINTER%d: start\n", pins); + write_log (_T("EPSONPRINTER%d: start\n"), pins); return printer_init(600, 83, 117, pngprint ? NULL : printername, 0, pins); } void epson_close(void) diff --git a/ersatz.cpp b/ersatz.cpp index 471f8e88..0f09cd68 100644 --- a/ersatz.cpp +++ b/ersatz.cpp @@ -104,7 +104,7 @@ static void ersatz_doio (void) break; default: - write_log (L"Only CMD_READ supported in DoIO()\n"); + write_log (_T("Only CMD_READ supported in DoIO()\n")); ersatz_failed (); } { @@ -129,7 +129,7 @@ static void ersatz_init (void) uaecptr a; already_failed = 0; - write_log (L"initializing kickstart replacement\n"); + write_log (_T("initializing kickstart replacement\n")); if (disk_empty (0)) { already_failed = 1; notify_user (NUMSG_KICKREP); @@ -171,9 +171,9 @@ static void ersatz_init (void) /* kickstart disk loader */ if (get_long (0x4000) == 0x4b49434b) { /* a kickstart disk was found in drive 0! */ - write_log (L"Loading Kickstart rom image from Kickstart disk\n"); + write_log (_T("Loading Kickstart rom image from Kickstart disk\n")); /* print some notes... */ - write_log (L"NOTE: if UAE crashes set CPU to 68000 and/or chipmem size to 512KB!\n"); + write_log (_T("NOTE: if UAE crashes set CPU to 68000 and/or chipmem size to 512KB!\n")); /* read rom image from kickstart disk */ put_word (request + 0x1C, 2); @@ -260,7 +260,7 @@ void ersatz_perform (uae_u16 what) break; case EOP_NIMP: - write_log (L"Unimplemented Kickstart function called\n"); + write_log (_T("Unimplemented Kickstart function called\n")); ersatz_failed (); /* fall through */ @@ -270,7 +270,7 @@ void ersatz_perform (uae_u16 what) case EOP_OPENLIB: default: - write_log (L"Internal error. Giving up.\n"); + write_log (_T("Internal error. Giving up.\n")); ersatz_failed (); } } diff --git a/events.cpp b/events.cpp index 2607a617..07c472b1 100644 --- a/events.cpp +++ b/events.cpp @@ -141,7 +141,7 @@ void event2_newevent_xx (int no, evt t, uae_u32 data, evfunc2 func) if (no == ev2_max) no = ev2_misc; if (no == next) { - write_log (L"out of event2's!\n"); + write_log (_T("out of event2's!\n")); return; } } diff --git a/expansion.cpp b/expansion.cpp index 2786eeb4..3f7ac9df 100644 --- a/expansion.cpp +++ b/expansion.cpp @@ -183,13 +183,13 @@ static void REGPARAM3 expamem_bput (uaecptr, uae_u32) REGPARAM; addrbank expamem_bank = { expamem_lget, expamem_wget, expamem_bget, expamem_lput, expamem_wput, expamem_bput, - default_xlate, default_check, NULL, L"Autoconfig", + default_xlate, default_check, NULL, _T("Autoconfig"), dummy_lgeti, dummy_wgeti, ABFLAG_IO | ABFLAG_SAFE }; static void expamem_map_clear (void) { - write_log (L"expamem_map_clear() got called. Shouldn't happen.\n"); + write_log (_T("expamem_map_clear() got called. Shouldn't happen.\n")); } static void expamem_init_clear (void) @@ -204,7 +204,7 @@ static void expamem_init_clear_zero (void) static void expamem_init_clear2 (void) { - expamem_bank.name = L"Autoconfig"; + expamem_bank.name = _T("Autoconfig"); expamem_init_clear_zero (); ecard = cardno; } @@ -212,7 +212,7 @@ static void expamem_init_clear2 (void) static void expamem_init_last (void) { expamem_init_clear2 (); - write_log (L"Memory map after autoconfig:\n"); + write_log (_T("Memory map after autoconfig:\n")); memory_map_dump (); } @@ -222,7 +222,7 @@ void expamem_next (void) map_banks (&expamem_bank, 0xE8, 1, 0); ++ecard; if (ecard < cardno) { - expamem_bank.name = card_name[ecard] ? card_name[ecard] : L"None"; + expamem_bank.name = card_name[ecard] ? card_name[ecard] : _T("None"); (*card_init[ecard]) (); } else { expamem_init_clear2 (); @@ -231,14 +231,14 @@ void expamem_next (void) static uae_u32 REGPARAM2 expamem_lget (uaecptr addr) { - write_log (L"warning: READ.L from address $%lx PC=%x\n", addr, M68K_GETPC); + write_log (_T("warning: READ.L from address $%lx PC=%x\n"), addr, M68K_GETPC); return (expamem_wget (addr) << 16) | expamem_wget (addr + 2); } static uae_u32 REGPARAM2 expamem_wget (uaecptr addr) { uae_u32 v = (expamem_bget (addr) << 8) | expamem_bget (addr + 1); - write_log (L"warning: READ.W from address $%lx=%04x PC=%x\n", addr, v & 0xffff, M68K_GETPC); + write_log (_T("warning: READ.W from address $%lx=%04x PC=%x\n"), addr, v & 0xffff, M68K_GETPC); return v; } @@ -251,7 +251,7 @@ static uae_u32 REGPARAM2 expamem_bget (uaecptr addr) addr &= 0xFFFF; b = expamem[addr]; #ifdef EXP_DEBUG - write_log (L"expamem_bget %x %x\n", addr, b); + write_log (_T("expamem_bget %x %x\n"), addr, b); #endif return b; } @@ -281,13 +281,13 @@ static void REGPARAM2 expamem_lput (uaecptr addr, uae_u32 value) #ifdef JIT special_mem |= S_WRITE; #endif - write_log (L"warning: WRITE.L to address $%lx : value $%lx\n", addr, value); + write_log (_T("warning: WRITE.L to address $%lx : value $%lx\n"), addr, value); } static void REGPARAM2 expamem_wput (uaecptr addr, uae_u32 value) { #ifdef EXP_DEBUG - write_log (L"expamem_wput %x %x\n", addr, value); + write_log (_T("expamem_wput %x %x\n"), addr, value); #endif #ifdef JIT special_mem |= S_WRITE; @@ -296,7 +296,7 @@ static void REGPARAM2 expamem_wput (uaecptr addr, uae_u32 value) if (ecard >= cardno) return; if (expamem_type() != zorroIII) - write_log (L"warning: WRITE.W to address $%lx : value $%x\n", addr, value); + write_log (_T("warning: WRITE.W to address $%lx : value $%x\n"), addr, value); else { switch (addr & 0xff) { case 0x44: @@ -327,13 +327,13 @@ static void REGPARAM2 expamem_wput (uaecptr addr, uae_u32 value) expamem_hi = p2; (*card_map[ecard]) (); if (p1 != p2) - write_log (L" Card %d remapped %04x0000 -> %04x0000\n", ecard + 1, p1, p2); - write_log (L" Card %d (Zorro%s) done.\n", ecard + 1, expamem_type () == 0xc0 ? L"II" : L"III"); + write_log (_T(" Card %d remapped %04x0000 -> %04x0000\n"), ecard + 1, p1, p2); + write_log (_T(" Card %d (Zorro%s) done.\n"), ecard + 1, expamem_type () == 0xc0 ? _T("II") : _T("III")); expamem_next (); } break; case 0x4c: - write_log (L" Card %d (Zorro%s) had no success.\n", ecard + 1, expamem_type () == 0xc0 ? L"II" : L"III"); + write_log (_T(" Card %d (Zorro%s) had no success.\n"), ecard + 1, expamem_type () == 0xc0 ? _T("II") : _T("III")); expamem_hi = expamem_lo = 0; (*card_map[ecard]) (); break; @@ -344,7 +344,7 @@ static void REGPARAM2 expamem_wput (uaecptr addr, uae_u32 value) static void REGPARAM2 expamem_bput (uaecptr addr, uae_u32 value) { #ifdef EXP_DEBUG - write_log (L"expamem_bput %x %x\n", addr, value); + write_log (_T("expamem_bput %x %x\n"), addr, value); #endif #ifdef JIT special_mem |= S_WRITE; @@ -364,7 +364,7 @@ static void REGPARAM2 expamem_bput (uaecptr addr, uae_u32 value) if (expamem_type () == zorroII) { expamem_hi = value; (*card_map[ecard]) (); - write_log (L" Card %d (Zorro%s) done.\n", ecard + 1, expamem_type () == 0xc0 ? L"II" : L"III"); + write_log (_T(" Card %d (Zorro%s) done.\n"), ecard + 1, expamem_type () == 0xc0 ? _T("II") : _T("III")); expamem_next (); } else if (expamem_type() == zorroIII) expamem_lo = value; @@ -378,7 +378,7 @@ static void REGPARAM2 expamem_bput (uaecptr addr, uae_u32 value) case 0x4c: expamem_hi = expamem_lo = 0; (*card_map[ecard]) (); - write_log (L" Card %d (Zorro%s) had no success.\n", ecard + 1, expamem_type () == 0xc0 ? L"II" : L"III"); + write_log (_T(" Card %d (Zorro%s) had no success.\n"), ecard + 1, expamem_type () == 0xc0 ? _T("II") : _T("III")); expamem_next (); break; } @@ -402,7 +402,7 @@ static void expamem_init_cd32fmv (void) expamem_init_clear (); if (!rl) return; - write_log (L"CD32 FMV ROM '%s' %d.%d\n", rl->path, rl->rd->ver, rl->rd->rev); + write_log (_T("CD32 FMV ROM '%s' %d.%d\n"), rl->path, rl->rd->ver, rl->rd->rev); rd = rl->rd; z = read_rom (&rd); if (z) { @@ -500,7 +500,7 @@ static uae_u8 *REGPARAM2 fastmem_xlate (uaecptr addr) addrbank fastmem_bank = { fastmem_lget, fastmem_wget, fastmem_bget, fastmem_lput, fastmem_wput, fastmem_bput, - fastmem_xlate, fastmem_check, NULL, L"Fast memory", + fastmem_xlate, fastmem_check, NULL, _T("Fast memory"), fastmem_lget, fastmem_wget, ABFLAG_RAM }; @@ -528,7 +528,7 @@ static uae_u32 REGPARAM2 catweasel_lget (uaecptr addr) #ifdef JIT special_mem |= S_READ; #endif - write_log (L"catweasel_lget @%08X!\n",addr); + write_log (_T("catweasel_lget @%08X!\n"),addr); return 0; } @@ -537,7 +537,7 @@ static uae_u32 REGPARAM2 catweasel_wget (uaecptr addr) #ifdef JIT special_mem |= S_READ; #endif - write_log (L"catweasel_wget @%08X!\n",addr); + write_log (_T("catweasel_wget @%08X!\n"),addr); return 0; } @@ -556,7 +556,7 @@ static void REGPARAM2 catweasel_lput (uaecptr addr, uae_u32 l) #ifdef JIT special_mem |= S_WRITE; #endif - write_log (L"catweasel_lput @%08X=%08X!\n",addr,l); + write_log (_T("catweasel_lput @%08X=%08X!\n"),addr,l); } static void REGPARAM2 catweasel_wput (uaecptr addr, uae_u32 w) @@ -564,7 +564,7 @@ static void REGPARAM2 catweasel_wput (uaecptr addr, uae_u32 w) #ifdef JIT special_mem |= S_WRITE; #endif - write_log (L"catweasel_wput @%08X=%04X!\n",addr,w); + write_log (_T("catweasel_wput @%08X=%04X!\n"),addr,w); } static void REGPARAM2 catweasel_bput (uaecptr addr, uae_u32 b) @@ -584,14 +584,14 @@ static int REGPARAM2 catweasel_check (uaecptr addr, uae_u32 size) static uae_u8 *REGPARAM2 catweasel_xlate (uaecptr addr) { - write_log (L"catweasel_xlate @%08X size %08X\n", addr); + write_log (_T("catweasel_xlate @%08X size %08X\n"), addr); return 0; } static addrbank catweasel_bank = { catweasel_lget, catweasel_wget, catweasel_bget, catweasel_lput, catweasel_wput, catweasel_bput, - catweasel_xlate, catweasel_check, NULL, L"Catweasel", + catweasel_xlate, catweasel_check, NULL, _T("Catweasel"), dummy_lgeti, dummy_wgeti, ABFLAG_IO }; @@ -600,7 +600,7 @@ static void expamem_map_catweasel (void) catweasel_start = ((expamem_hi | (expamem_lo >> 4)) << 16); if (catweasel_start) { map_banks (&catweasel_bank, catweasel_start >> 16, 1, 0); - write_log (L"Catweasel MK%d: mapped @$%lx\n", cwc.type, catweasel_start); + write_log (_T("Catweasel MK%d: mapped @$%lx\n"), cwc.type, catweasel_start); } } @@ -662,7 +662,7 @@ static uae_u32 REGPARAM2 filesys_lget (uaecptr addr) addr &= 65535; m = filesysory + addr; #ifdef EXP_DEBUG - write_log (L"filesys_lget %x %x\n", addr, do_get_mem_long ((uae_u32 *)m)); + write_log (_T("filesys_lget %x %x\n"), addr, do_get_mem_long ((uae_u32 *)m)); #endif return do_get_mem_long ((uae_u32 *)m); } @@ -677,7 +677,7 @@ static uae_u32 REGPARAM2 filesys_wget (uaecptr addr) addr &= 65535; m = filesysory + addr; #ifdef EXP_DEBUG - write_log (L"filesys_wget %x %x\n", addr, do_get_mem_word ((uae_u16 *)m)); + write_log (_T("filesys_wget %x %x\n"), addr, do_get_mem_word ((uae_u16 *)m)); #endif return do_get_mem_word ((uae_u16 *)m); } @@ -690,7 +690,7 @@ static uae_u32 REGPARAM2 filesys_bget (uaecptr addr) addr -= filesys_start & 65535; addr &= 65535; #ifdef EXP_DEBUG - write_log (L"filesys_bget %x %x\n", addr, filesysory[addr]); + write_log (_T("filesys_bget %x %x\n"), addr, filesysory[addr]); #endif return filesysory[addr]; } @@ -700,7 +700,7 @@ static void REGPARAM2 filesys_lput (uaecptr addr, uae_u32 l) #ifdef JIT special_mem |= S_WRITE; #endif - write_log (L"filesys_lput called PC=%p\n", M68K_GETPC); + write_log (_T("filesys_lput called PC=%p\n"), M68K_GETPC); } static void REGPARAM2 filesys_wput (uaecptr addr, uae_u32 w) @@ -708,7 +708,7 @@ static void REGPARAM2 filesys_wput (uaecptr addr, uae_u32 w) #ifdef JIT special_mem |= S_WRITE; #endif - write_log (L"filesys_wput called PC=%p\n", M68K_GETPC); + write_log (_T("filesys_wput called PC=%p\n"), M68K_GETPC); } static void REGPARAM2 filesys_bput (uaecptr addr, uae_u32 b) @@ -717,14 +717,14 @@ static void REGPARAM2 filesys_bput (uaecptr addr, uae_u32 b) special_mem |= S_WRITE; #endif #ifdef EXP_DEBUG - write_log (L"filesys_bput %x %x\n", addr, b); + write_log (_T("filesys_bput %x %x\n"), addr, b); #endif } static addrbank filesys_bank = { filesys_lget, filesys_wget, filesys_bget, filesys_lput, filesys_wput, filesys_bput, - default_xlate, default_check, NULL, L"Filesystem Autoconfig Area", + default_xlate, default_check, NULL, _T("Filesystem Autoconfig Area"), dummy_lgeti, dummy_wgeti, ABFLAG_IO | ABFLAG_SAFE }; @@ -914,19 +914,19 @@ static uae_u8 *REGPARAM2 z3chipmem_xlate (uaecptr addr) addrbank z3fastmem_bank = { z3fastmem_lget, z3fastmem_wget, z3fastmem_bget, z3fastmem_lput, z3fastmem_wput, z3fastmem_bput, - z3fastmem_xlate, z3fastmem_check, NULL, L"ZorroIII Fast RAM", + z3fastmem_xlate, z3fastmem_check, NULL, _T("ZorroIII Fast RAM"), z3fastmem_lget, z3fastmem_wget, ABFLAG_RAM }; addrbank z3fastmem2_bank = { z3fastmem2_lget, z3fastmem2_wget, z3fastmem2_bget, z3fastmem2_lput, z3fastmem2_wput, z3fastmem2_bput, - z3fastmem2_xlate, z3fastmem2_check, NULL, L"ZorroIII Fast RAM #2", + z3fastmem2_xlate, z3fastmem2_check, NULL, _T("ZorroIII Fast RAM #2"), z3fastmem2_lget, z3fastmem2_wget, ABFLAG_RAM }; addrbank z3chipmem_bank = { z3chipmem_lget, z3chipmem_wget, z3chipmem_bget, z3chipmem_lput, z3chipmem_wput, z3chipmem_bput, - z3chipmem_xlate, z3chipmem_check, NULL, L"MegaChipRAM", + z3chipmem_xlate, z3chipmem_check, NULL, _T("MegaChipRAM"), z3chipmem_lget, z3chipmem_wget, ABFLAG_RAM }; @@ -946,7 +946,7 @@ static void expamem_map_fastcard (void) fastmem_start = ((expamem_hi | (expamem_lo >> 4)) << 16); if (fastmem_start) { map_banks (&fastmem_bank, fastmem_start >> 16, allocated_fastmem >> 16, 0); - write_log (L"Fastcard: mapped @$%lx: %dMB fast memory\n", fastmem_start, allocated_fastmem >> 20); + write_log (_T("Fastcard: mapped @$%lx: %dMB fast memory\n"), fastmem_start, allocated_fastmem >> 20); } } @@ -997,7 +997,7 @@ static void expamem_map_filesys (void) filesys_start = ((expamem_hi | (expamem_lo >> 4)) << 16); map_banks (&filesys_bank, filesys_start >> 16, 1, 0); - write_log (L"Filesystem: mapped memory @$%lx.\n", filesys_start); + write_log (_T("Filesystem: mapped memory @$%lx.\n"), filesys_start); /* 68k code needs to know this. */ a = here (); org (rtarea_base + 0xFFFC); @@ -1061,13 +1061,13 @@ static void expamem_map_z3fastmem_2 (addrbank *bank, uaecptr *startp, uae_u32 si if (z3fs) { if (start != z3fs) { - write_log (L"WARNING: Z3MEM mapping changed from $%08x to $%08x\n", start, z3fs); + write_log (_T("WARNING: Z3MEM mapping changed from $%08x to $%08x\n"), start, z3fs); map_banks (&dummy_bank, start >> 16, size >> 16, allocated); *startp = z3fs; map_banks (bank, start >> 16, size >> 16, allocated); } - write_log (L"Z3MEM (32bit): mapped @$%08x: %d MB Zorro III %s memory \n", - start, allocated / 0x100000, chip ? L"chip" : L"fast"); + write_log (_T("Z3MEM (32bit): mapped @$%08x: %d MB Zorro III %s memory \n"), + start, allocated / 0x100000, chip ? _T("chip") : _T("fast")); } } @@ -1146,7 +1146,7 @@ static void expamem_map_gfxcard (void) gfxmem_start = (expamem_hi | (expamem_lo >> 4)) << 16; if (gfxmem_start) { map_banks (&gfxmem_bank, gfxmem_start >> 16, allocated_gfxmem >> 16, allocated_gfxmem); - write_log (L"%sUAEGFX-card: mapped @$%lx, %d MB RTG RAM\n", currprefs.rtgmem_type ? L"Z3" : L"Z2", gfxmem_start, allocated_gfxmem / 0x100000); + write_log (_T("%sUAEGFX-card: mapped @$%lx, %d MB RTG RAM\n"), currprefs.rtgmem_type ? _T("Z3") : _T("Z2"), gfxmem_start, allocated_gfxmem / 0x100000); } } @@ -1234,9 +1234,9 @@ static void allocate_expamem (void) fastmem_mask = allocated_fastmem - 1; if (allocated_fastmem) { - fastmemory = mapped_malloc (allocated_fastmem, L"fast"); + fastmemory = mapped_malloc (allocated_fastmem, _T("fast")); if (fastmemory == 0) { - write_log (L"Out of memory for fastmem card.\n"); + write_log (_T("Out of memory for fastmem card.\n")); allocated_fastmem = 0; } } @@ -1251,9 +1251,9 @@ static void allocate_expamem (void) z3fastmem_mask = allocated_z3fastmem - 1; if (allocated_z3fastmem) { - z3fastmem = mapped_malloc (allocated_z3fastmem, L"z3"); + z3fastmem = mapped_malloc (allocated_z3fastmem, _T("z3")); if (z3fastmem == 0) { - write_log (L"Out of memory for 32 bit fast memory.\n"); + write_log (_T("Out of memory for 32 bit fast memory.\n")); allocated_z3fastmem = 0; } } @@ -1268,9 +1268,9 @@ static void allocate_expamem (void) z3fastmem2_mask = allocated_z3fastmem2 - 1; if (allocated_z3fastmem2) { - z3fastmem2 = mapped_malloc (allocated_z3fastmem2, L"z3_2"); + z3fastmem2 = mapped_malloc (allocated_z3fastmem2, _T("z3_2")); if (z3fastmem2 == 0) { - write_log (L"Out of memory for 32 bit fast memory #2.\n"); + write_log (_T("Out of memory for 32 bit fast memory #2.\n")); allocated_z3fastmem2 = 0; } } @@ -1285,9 +1285,9 @@ static void allocate_expamem (void) z3chipmem_mask = allocated_z3chipmem - 1; if (allocated_z3chipmem) { - z3chipmem = mapped_malloc (allocated_z3chipmem, L"z3_chip"); + z3chipmem = mapped_malloc (allocated_z3chipmem, _T("z3_chip")); if (z3chipmem == 0) { - write_log (L"Out of memory for 32 bit chip memory.\n"); + write_log (_T("Out of memory for 32 bit chip memory.\n")); allocated_z3chipmem = 0; } } @@ -1304,9 +1304,9 @@ static void allocate_expamem (void) gfxmem_mask = allocated_gfxmem - 1; if (allocated_gfxmem) { - gfxmemory = mapped_malloc (allocated_gfxmem, currprefs.rtgmem_type ? L"z3_gfx" : L"z2_gfx"); + gfxmemory = mapped_malloc (allocated_gfxmem, currprefs.rtgmem_type ? _T("z3_gfx") : _T("z2_gfx")); if (gfxmemory == 0) { - write_log (L"Out of memory for graphics card memory\n"); + write_log (_T("Out of memory for graphics card memory\n")); allocated_gfxmem = 0; } } @@ -1446,7 +1446,7 @@ void expamem_reset (void) uae_id = hackers_id; allocate_expamem (); - expamem_bank.name = L"Autoconfig [reset]"; + expamem_bank.name = _T("Autoconfig [reset]"); /* check if Kickstart version is below 1.3 */ if (kickstart_version && do_mount @@ -1456,26 +1456,26 @@ void expamem_reset (void) || kickstart_version < 34)) { /* warn user */ - write_log (L"Kickstart version is below 1.3! Disabling automount devices.\n"); + write_log (_T("Kickstart version is below 1.3! Disabling automount devices.\n")); do_mount = 0; } if (need_uae_boot_rom () == 0) do_mount = 0; if (fastmemory != NULL && currprefs.chipmem_size <= 2 * 1024 * 1024) { if (currprefs.fastmem_autoconfig) { - fastmem_bank.name = L"Fast memory"; - card_name[cardno] = L"Z2Fast"; + fastmem_bank.name = _T("Fast memory"); + card_name[cardno] = _T("Z2Fast"); card_init[cardno] = expamem_init_fastcard; card_map[cardno++] = expamem_map_fastcard; } else { - fastmem_bank.name = L"Fast memory (non-autoconfig)"; + fastmem_bank.name = _T("Fast memory (non-autoconfig)"); map_banks (&fastmem_bank, 0x00200000 >> 16, allocated_fastmem >> 16, 0); } } #ifdef CDTV if (currprefs.cs_cdtvcd) { - card_name[cardno] = L"CDTV DMAC"; + card_name[cardno] = _T("CDTV DMAC"); card_init[cardno] = expamem_init_cdtv; card_map[cardno++] = NULL; } @@ -1485,7 +1485,7 @@ void expamem_reset (void) int ids[] = { 23, -1 }; struct romlist *rl = getromlistbyids (ids); if (rl && !_tcscmp (rl->path, currprefs.cartfile)) { - card_name[cardno] = L"CD32MPEG"; + card_name[cardno] = _T("CD32MPEG"); card_init[cardno] = expamem_init_cd32fmv; card_map[cardno++] = expamem_map_cd32fmv; } @@ -1493,35 +1493,35 @@ void expamem_reset (void) #endif #ifdef A2091 if (currprefs.cs_a2091) { - card_name[cardno] = L"A2091"; + card_name[cardno] = _T("A2091"); card_init[cardno] = expamem_init_a2091; card_map[cardno++] = NULL; } #endif #ifdef A2065 if (currprefs.a2065name[0]) { - card_name[cardno] = L"A2065"; + card_name[cardno] = _T("A2065"); card_init[cardno] = expamem_init_a2065; card_map[cardno++] = NULL; } #endif #ifdef FILESYS if (do_mount) { - card_name[cardno] = L"UAEFS"; + card_name[cardno] = _T("UAEFS"); card_init[cardno] = expamem_init_filesys; card_map[cardno++] = expamem_map_filesys; } #endif #ifdef CATWEASEL if (currprefs.catweasel && catweasel_init ()) { - card_name[cardno] = L"CWMK2"; + card_name[cardno] = _T("CWMK2"); card_init[cardno] = expamem_init_catweasel; card_map[cardno++] = expamem_map_catweasel; } #endif #ifdef PICASSO96 if (!currprefs.rtgmem_type && gfxmemory != NULL) { - card_name[cardno] = L"Z2RTG"; + card_name[cardno] = _T("Z2RTG"); card_init[cardno] = expamem_init_gfxcard_z2; card_map[cardno++] = expamem_map_gfxcard; } @@ -1531,12 +1531,12 @@ void expamem_reset (void) if (z3fastmem != NULL) { z3num = 0; - card_name[cardno] = L"Z3Fast"; + card_name[cardno] = _T("Z3Fast"); card_init[cardno] = expamem_init_z3fastmem; card_map[cardno++] = expamem_map_z3fastmem; map_banks (&z3fastmem_bank, z3fastmem_start >> 16, currprefs.z3fastmem_size >> 16, allocated_z3fastmem); if (z3fastmem2 != NULL) { - card_name[cardno] = L"Z3Fast2"; + card_name[cardno] = _T("Z3Fast2"); card_init[cardno] = expamem_init_z3fastmem2; card_map[cardno++] = expamem_map_z3fastmem2; map_banks (&z3fastmem2_bank, z3fastmem2_start >> 16, currprefs.z3fastmem2_size >> 16, allocated_z3fastmem2); @@ -1546,14 +1546,14 @@ void expamem_reset (void) map_banks (&z3chipmem_bank, z3chipmem_start >> 16, currprefs.z3chipmem_size >> 16, allocated_z3chipmem); #ifdef NCR if (currprefs.cs_a4091) { - card_name[cardno] = L"A4091"; + card_name[cardno] = _T("A4091"); card_init[cardno] = expamem_init_a4091; card_map[cardno++] = NULL; } #endif #ifdef PICASSO96 if (currprefs.rtgmem_type && gfxmemory != NULL) { - card_name[cardno] = L"Z3RTG"; + card_name[cardno] = _T("Z3RTG"); card_init[cardno] = expamem_init_gfxcard_z3; card_map[cardno++] = expamem_map_gfxcard; } @@ -1561,7 +1561,7 @@ void expamem_reset (void) if (cardno > 0 && cardno < MAX_EXPANSION_BOARDS) { - card_name[cardno] = L"Empty"; + card_name[cardno] = _T("Empty"); card_init[cardno] = expamem_init_last; card_map[cardno++] = expamem_map_clear; } @@ -1606,9 +1606,9 @@ void expansion_init (void) allocate_expamem (); #ifdef FILESYS - filesysory = mapped_malloc (0x10000, L"filesys"); + filesysory = mapped_malloc (0x10000, _T("filesys")); if (!filesysory) { - write_log (L"virtual memory exhausted (filesysory)!\n"); + write_log (_T("virtual memory exhausted (filesysory)!\n")); exit (0); } filesys_bank.baseaddr = filesysory; diff --git a/fdi2raw.cpp b/fdi2raw.cpp index 177ae853..6b480f0f 100644 --- a/fdi2raw.cpp +++ b/fdi2raw.cpp @@ -70,7 +70,7 @@ static TCHAR *datalog (uae_u8 *src, int len) return buf + offset2; } #else -static TCHAR *datalog (uae_u8 *src, int len) { return L""; } +static TCHAR *datalog (uae_u8 *src, int len) { return _T(""); } #endif #ifdef DEBUG @@ -93,7 +93,7 @@ static void fdi_free (void *p) return; size = ((int*)p)[-1]; fdi_allocated -= size; - write_log (L"%d freed (%d)\n", size, fdi_allocated); + write_log (_T("%d freed (%d)\n"), size, fdi_allocated); free ((int*)p - 1); } static void *fdi_malloc (int size) @@ -101,7 +101,7 @@ static void *fdi_malloc (int size) void *p = xmalloc (size + sizeof (int)); ((int*)p)[0] = size; fdi_allocated += size; - write_log (L"%d allocated (%d)\n", size, fdi_allocated); + write_log (_T("%d allocated (%d)\n"), size, fdi_allocated); return (int*)p + 1; } #else @@ -329,13 +329,13 @@ static int decode_raw_track (FDI *fdi) /* unknown track */ static void zxx (FDI *fdi) { - outlog (L"track %d: unknown track type 0x%02X\n", fdi->current_track, fdi->track_type); + outlog (_T("track %d: unknown track type 0x%02X\n"), fdi->current_track, fdi->track_type); // return -1; } /* unsupported track */ static void zyy (FDI *fdi) { - outlog (L"track %d: unsupported track type 0x%02X\n", fdi->current_track, fdi->track_type); + outlog (_T("track %d: unsupported track type 0x%02X\n"), fdi->current_track, fdi->track_type); // return -1; } /* empty track */ @@ -347,13 +347,13 @@ static void track_empty (FDI *fdi) /* unknown sector described type */ static void dxx (FDI *fdi) { - outlog (L"\ntrack %d: unknown sector described type 0x%02X\n", fdi->current_track, fdi->track_type); + outlog (_T("\ntrack %d: unknown sector described type 0x%02X\n"), fdi->current_track, fdi->track_type); fdi->err = 1; } /* unsupported sector described type */ static void dyy (FDI *fdi) { - outlog (L"\ntrack %d: unsupported sector described 0x%02X\n", fdi->current_track, fdi->track_type); + outlog (_T("\ntrack %d: unsupported sector described 0x%02X\n"), fdi->current_track, fdi->track_type); fdi->err = 1; } /* add position of mfm sync bit */ @@ -365,12 +365,12 @@ static void add_mfm_sync_bit (FDI *fdi) } fdi->mfmsync_buffer[fdi->mfmsync_offset++] = fdi->out; if (fdi->out == 0) { - outlog (L"illegal position for mfm sync bit, offset=%d\n",fdi->out); + outlog (_T("illegal position for mfm sync bit, offset=%d\n"),fdi->out); fdi->err = 1; } if (fdi->mfmsync_offset >= MAX_MFM_SYNC_BUFFER) { fdi->mfmsync_offset = 0; - outlog (L"mfmsync buffer overflow\n"); + outlog (_T("mfmsync buffer overflow\n")); fdi->err = 1; } fdi->out++; @@ -391,7 +391,7 @@ static void bit_add (FDI *fdi, int bit) fdi->track_dst[BIT_BYTEOFFSET] |= (1 << BIT_BITOFFSET); fdi->out++; if (fdi->out >= MAX_DST_BUFFER * 8) { - outlog (L"destination buffer overflow\n"); + outlog (_T("destination buffer overflow\n")); fdi->err = 1; fdi->out = 1; } @@ -406,7 +406,7 @@ static void bit_mfm_add (FDI *fdi, int bit) static void bit_drop_next (FDI *fdi) { if (fdi->nextdrop > 0) { - outlog (L"multiple bit_drop_next() called"); + outlog (_T("multiple bit_drop_next() called")); } else if (fdi->nextdrop < 0) { fdi->nextdrop = 0; debuglog (":DNN:"); @@ -420,7 +420,7 @@ static void bit_drop_next (FDI *fdi) static void bit_dedrop (FDI *fdi) { if (fdi->nextdrop) { - outlog (L"bit_drop_next called before bit_dedrop"); + outlog (_T("bit_drop_next called before bit_dedrop")); } fdi->nextdrop = -1; debuglog (":BDD:"); @@ -688,13 +688,13 @@ static int amiga_check_track (FDI *fdi) trackoffs = (id & 0xff00) >> 8; if (trackoffs + 1 > drvsec) { - outlog (L"illegal sector offset %d\n",trackoffs); + outlog (_T("illegal sector offset %d\n"),trackoffs); ok = 0; mbuf = mbuf2; continue; } if ((id >> 24) != 0xff) { - outlog (L"sector %d format type %02X?\n", trackoffs, id >> 24); + outlog (_T("sector %d format type %02X?\n"), trackoffs, id >> 24); ok = 0; } chksum = odd ^ even; @@ -713,14 +713,14 @@ static int amiga_check_track (FDI *fdi) even = getmfmlong (mbuf + 2 * 2); mbuf += 4 * 2; if (((odd << 1) | even) != chksum) { - outlog (L"sector %d header crc error\n", trackoffs); + outlog (_T("sector %d header crc error\n"), trackoffs); ok = 0; mbuf = mbuf2; continue; } - outlog (L"sector %d header crc ok\n", trackoffs); + outlog (_T("sector %d header crc ok\n"), trackoffs); if (((id & 0x00ff0000) >> 16) != (uae_u32)fdi->current_track) { - outlog (L"illegal track number %d <> %d\n",fdi->current_track,(id & 0x00ff0000) >> 16); + outlog (_T("illegal track number %d <> %d\n"),fdi->current_track,(id & 0x00ff0000) >> 16); ok++; mbuf = mbuf2; continue; @@ -743,14 +743,14 @@ static int amiga_check_track (FDI *fdi) } mbuf += 256 * 2; if (chksum) { - outlog (L"sector %d data checksum error\n",trackoffs); + outlog (_T("sector %d data checksum error\n"),trackoffs); ok = 0; } else if (sectable[trackoffs]) { - outlog (L"sector %d already found?\n", trackoffs); + outlog (_T("sector %d already found?\n"), trackoffs); mbuf = mbuf2; } else { - outlog (L"sector %d ok\n",trackoffs); - if (slabel) outlog (L"(non-empty sector header)\n"); + outlog (_T("sector %d ok\n"),trackoffs); + if (slabel) outlog (_T("(non-empty sector header)\n")); sectable[trackoffs] = 1; secwritten++; if (trackoffs == 9) @@ -759,7 +759,7 @@ static int amiga_check_track (FDI *fdi) } for (i = 0; i < drvsec; i++) { if (!sectable[i]) { - outlog (L"sector %d missing\n", i); + outlog (_T("sector %d missing\n"), i); ok = 0; } } @@ -1316,25 +1316,25 @@ static int handle_sectors_described_track (FDI *fdi) fdi->index_offset = get_u32(fdi->track_src); fdi->index_offset >>= 8; fdi->track_src += 3; - outlog (L"sectors_described, index offset: %d\n",fdi->index_offset); + outlog (_T("sectors_described, index offset: %d\n"),fdi->index_offset); do { fdi->track_type = *fdi->track_src++; - outlog (L"%06X %06X %02X:",fdi->track_src - start_src + 0x200, fdi->out/8, fdi->track_type); + outlog (_T("%06X %06X %02X:"),fdi->track_src - start_src + 0x200, fdi->out/8, fdi->track_type); oldout = fdi->out; decode_sectors_described_track[fdi->track_type](fdi); - outlog (L" %d\n", fdi->out - oldout); + outlog (_T(" %d\n"), fdi->out - oldout); oldout = fdi->out; if (fdi->out < 0 || fdi->err) { - outlog (L"\nin %d bytes, out %d bits\n", fdi->track_src - fdi->track_src_buffer, fdi->out); + outlog (_T("\nin %d bytes, out %d bits\n"), fdi->track_src - fdi->track_src_buffer, fdi->out); return -1; } if (fdi->track_src - fdi->track_src_buffer >= fdi->track_src_len) { - outlog (L"source buffer overrun, previous type: %02X\n", fdi->track_type); + outlog (_T("source buffer overrun, previous type: %02X\n"), fdi->track_type); return -1; } } while (fdi->track_type != 0xff); - outlog (L"\n"); + outlog (_T("\n")); fix_mfm_sync (fdi); return fdi->out; } @@ -1438,7 +1438,7 @@ static void fdi2_decode (FDI *fdi, unsigned long totalavg, uae_u32 *avgp, uae_u3 || (avgp[i] < (standard_MFM_2_bit_cell_size - (standard_MFM_2_bit_cell_size / 4))) ) ) i++; if (i == pulses) { - outlog (L"No stable and long-enough pulse in track.\n"); + outlog (_T("No stable and long-enough pulse in track.\n")); return; } i--; @@ -1566,7 +1566,7 @@ static void fdi2_decode (FDI *fdi, unsigned long totalavg, uae_u32 *avgp, uae_u3 || (minp[i] < (standard_MFM_2_bit_cell_size - (standard_MFM_2_bit_cell_size / 4))) ) ) i++; if (i == pulses) { - outlog (L"FDI: No stable and long-enough pulse in track.\n"); + outlog (_T("FDI: No stable and long-enough pulse in track.\n")); return; } nexti = i; @@ -1644,12 +1644,12 @@ static void fdi2_decode (FDI *fdi, unsigned long totalavg, uae_u32 *avgp, uae_u3 } avg_pulse += jitter; if ((avg_pulse < min_pulse) || (avg_pulse > max_pulse)) { - outlog (L"FDI: avg_pulse outside bounds! avg=%u min=%u max=%u\n", avg_pulse, min_pulse, max_pulse); - outlog (L"FDI: avgp=%u (%u) minp=%u (%u) maxp=%u (%u) jitter=%d i=%d ni=%d\n", + outlog (_T("FDI: avg_pulse outside bounds! avg=%u min=%u max=%u\n"), avg_pulse, min_pulse, max_pulse); + outlog (_T("FDI: avgp=%u (%u) minp=%u (%u) maxp=%u (%u) jitter=%d i=%d ni=%d\n"), avgp[i], avgp[nexti], minp[i], minp[nexti], maxp[i], maxp[nexti], jitter, i, nexti); } if (avg_pulse < ref_pulse) - outlog (L"FDI: avg_pulse < ref_pulse! (%u < %u)\n", avg_pulse, ref_pulse); + outlog (_T("FDI: avg_pulse < ref_pulse! (%u < %u)\n"), avg_pulse, ref_pulse); pulse += avg_pulse - ref_pulse; ref_pulse = 0; if (i == eodat) @@ -2035,7 +2035,7 @@ FDI *fdi2raw_header(struct zfile *f) uae_u32 crc = get_crc32(fdi->header, 508); uae_u32 crc2 = (fdi->header[508] << 24) | (fdi->header[509] << 16) | (fdi->header[510] << 8) | fdi->header[511]; if (crc != crc2) { - outlog (L"FDI: header checksum error\n"); + outlog (_T("FDI: header checksum error\n")); fdi_free(fdi); return NULL; } @@ -2049,7 +2049,7 @@ FDI *fdi2raw_header(struct zfile *f) fdi->last_track = ((fdi->header[142] << 8) + fdi->header[143]) + 1; fdi->last_track *= fdi->header[144] + 1; if (fdi->last_track >= MAX_TRACKS) { - write_log (L"FDI: last_track >= MAX_TRACKS (%d >= %d)\n", fdi->last_track, MAX_TRACKS); + write_log (_T("FDI: last_track >= MAX_TRACKS (%d >= %d)\n"), fdi->last_track, MAX_TRACKS); fdi->last_track = MAX_TRACKS - 1; } fdi->last_head = fdi->header[144]; @@ -2057,8 +2057,8 @@ FDI *fdi2raw_header(struct zfile *f) fdi->rotation_speed = fdi->header[146] + 128; fdi->write_protect = fdi->header[147] & 1; fdi->reversed_side = (fdi->header[147] & 4) ? 1 : 0; - outlog (L"FDI version %d.%d\n", fdi->header[140], fdi->header[141]); - outlog (L"last_track=%d rotation_speed=%d\n", fdi->last_track, fdi->rotation_speed); + outlog (_T("FDI version %d.%d\n"), fdi->header[140], fdi->header[141]); + outlog (_T("last_track=%d rotation_speed=%d\n"), fdi->last_track, fdi->rotation_speed); offset = 512; i = fdi->last_track; diff --git a/filesys.cpp b/filesys.cpp index 55521364..e76a3671 100644 --- a/filesys.cpp +++ b/filesys.cpp @@ -86,12 +86,12 @@ static void aino_test (a_inode *aino) if (!aino || !aino->next) return; if ((aino->checksum1 ^ aino->checksum2) != 0xaaaa5555) { - write_log (L"PANIC: corrupted or freed but used aino detected!", aino); + write_log (_T("PANIC: corrupted or freed but used aino detected!"), aino); } aino3 = aino; aino = aino->next; if (aino->prev != aino3) { - write_log (L"PANIC: corrupted aino linking!\n"); + write_log (_T("PANIC: corrupted aino linking!\n")); break; } if (aino == aino2) break; @@ -389,7 +389,7 @@ TCHAR *filesys_createvolname (const TCHAR *volname, const TCHAR *rootdir, const if (c == ':' || c == '/' || c == '\\') { if (i == _tcslen (p) - 1) continue; - if (!_tcscmp (p + i, L":\\")) { + if (!_tcscmp (p + i, _T(":\\"))) { xfree (p); p = xmalloc (TCHAR, 10); p[0] = rootdir[0]; @@ -415,7 +415,7 @@ TCHAR *filesys_createvolname (const TCHAR *volname, const TCHAR *rootdir, const if (volname && _tcslen (volname)) nvol = my_strdup (volname); else - nvol = my_strdup (L""); + nvol = my_strdup (_T("")); } validatevolumename (nvol); xfree (p); @@ -429,7 +429,7 @@ static int set_filesys_volume (const TCHAR *rootdir, int *flags, bool *readonly, struct zvolume *zv; zv = zfile_fopen_archive (rootdir); if (!zv) { - write_log (L"'%s' is not a supported archive file\n", rootdir); + write_log (_T("'%s' is not a supported archive file\n"), rootdir); return -1; } *zvp = zv; @@ -439,11 +439,11 @@ static int set_filesys_volume (const TCHAR *rootdir, int *flags, bool *readonly, *flags = my_getvolumeinfo (rootdir); if (*flags < 0) { if (rootdir && rootdir[0]) - write_log (L"directory '%s' not found, mounting as empty drive\n", rootdir); + write_log (_T("directory '%s' not found, mounting as empty drive\n"), rootdir); *emptydrive = 1; *flags = 0; } else if ((*flags) & MYVOLUMEINFO_READONLY) { - write_log (L"'%s' set to read-only\n", rootdir); + write_log (_T("'%s' set to read-only\n"), rootdir); *readonly = 1; } } @@ -469,7 +469,7 @@ static int set_filesys_unit_1 (int nr, break; } if (nr == MAX_FILESYSTEM_UNITS) { - write_log (L"No slot allocated for this unit\n"); + write_log (_T("No slot allocated for this unit\n")); return -1; } } @@ -480,7 +480,7 @@ static int set_filesys_unit_1 (int nr, if (nr == i || !mountinfo.ui[i].open || mountinfo.ui[i].rootdir == NULL || iscd) continue; if (rootdir && _tcslen (rootdir) > 0 && !_tcsicmp (mountinfo.ui[i].rootdir, rootdir)) { - write_log (L"directory/hardfile '%s' already added\n", rootdir); + write_log (_T("directory/hardfile '%s' already added\n"), rootdir); return -1; } } @@ -500,7 +500,7 @@ static int set_filesys_unit_1 (int nr, if (set_filesys_volume (rootdir, &flags, &readonly, &emptydrive, &ui->zarchive) < 0) return -1; } - ui->volname = filesys_createvolname (volname, rootdir, L"harddrive"); + ui->volname = filesys_createvolname (volname, rootdir, _T("harddrive")); ui->volflags = flags; } else { ui->unit_type = UNIT_FILESYSTEM; @@ -512,28 +512,28 @@ static int set_filesys_unit_1 (int nr, ui->volname = 0; ui->hf.readonly = readonly; if (!hdf_open (&ui->hf, rootdir) && !readonly) { - write_log (L"Attempting to open in read-only mode\n"); + write_log (_T("Attempting to open in read-only mode\n")); ui->hf.readonly = readonly = 1; hdf_open (&ui->hf, rootdir); } ui->hf.readonly = readonly; if (!ui->hf.drive_empty) { if (ui->hf.handle_valid == 0) { - write_log (L"Hardfile %s not found\n", ui->hf.device_name); + write_log (_T("Hardfile %s not found\n"), ui->hf.device_name); goto err; } if ((ui->hf.blocksize & (ui->hf.blocksize - 1)) != 0 || ui->hf.blocksize == 0) { - write_log (L"Hardfile %s bad blocksize\n", ui->hf.device_name); + write_log (_T("Hardfile %s bad blocksize\n"), ui->hf.device_name); goto err; } if ((ui->hf.secspertrack || ui->hf.surfaces || ui->hf.reservedblocks) && (ui->hf.secspertrack < 1 || ui->hf.surfaces < 1 || ui->hf.surfaces > 1023 || ui->hf.reservedblocks < 0 || ui->hf.reservedblocks > 1023) != 0) { - write_log (L"Hardfile %s bad hardfile geometry\n", ui->hf.device_name); + write_log (_T("Hardfile %s bad hardfile geometry\n"), ui->hf.device_name); goto err; } if (ui->hf.blocksize > ui->hf.virtsize || ui->hf.virtsize == 0) { - write_log (L"Hardfile %s too small\n", ui->hf.device_name); + write_log (_T("Hardfile %s too small\n"), ui->hf.device_name); goto err; } ui->hf.nrcyls = (int)(ui->hf.secspertrack * ui->hf.surfaces ? (ui->hf.virtsize / ui->hf.blocksize) / (ui->hf.secspertrack * ui->hf.surfaces) : 0); @@ -686,9 +686,9 @@ static void initialize_mountinfo (void) for (int i = 0; i < 32; i++) { if (mask & (1 << i)) { TCHAR cdname[30]; - _stprintf (cdname, L"CD%d", i); + _stprintf (cdname, _T("CD%d"), i); cd_unit_number++; - int idx = set_filesys_unit_1 (i + cd_unit_offset, cdname, NULL, L"/", true, 1, 1, 0, 2048, 0, false, false, NULL, 0, 0); + int idx = set_filesys_unit_1 (i + cd_unit_offset, cdname, NULL, _T("/"), true, 1, 1, 0, 2048, 0, false, false, NULL, 0, 0); if (idx >= 0) { UnitInfo *ui; uci->configoffset = idx; @@ -707,10 +707,10 @@ int sprintf_filesys_unit (TCHAR *buffer, int num) UnitInfo *uip = mountinfo.ui; if (uip[num].volname != 0) - _stprintf (buffer, L"(DH%d:) Filesystem, %s: %s %s", num, uip[num].volname, + _stprintf (buffer, _T("(DH%d:) Filesystem, %s: %s %s"), num, uip[num].volname, uip[num].rootdir, uip[num].readonly ? "ro" : ""); else - _stprintf (buffer, L"(DH%d:) Hardfile, \"%s\", size %d Mbytes", num, + _stprintf (buffer, _T("(DH%d:) Hardfile, \"%s\", size %d Mbytes"), num, uip[num].rootdir, uip[num].hf.virtsize / (1024 * 1024)); return 0; } @@ -1246,7 +1246,7 @@ static void filesys_delayed_change (Unit *u, int frames, const TCHAR *rootdir, c if (!rootdir || _tcslen (rootdir) == 0) u->reinsertdelay = 0; if (u->reinsertdelay > 0) - write_log (L"FILESYS: delayed insert %d: '%s' ('%s')\n", u->unit, volume ? volume : L"", rootdir); + write_log (_T("FILESYS: delayed insert %d: '%s' ('%s')\n"), u->unit, volume ? volume : _T(""), rootdir); } int filesys_eject (int nr) @@ -1264,7 +1264,7 @@ int filesys_eject (int nr) return 0; u->mount_changed = -1; u->mountcount++; - write_log (L"FILESYS: volume '%s' removal request\n", u->ui.volname); + write_log (_T("FILESYS: volume '%s' removal request\n"), u->ui.volname); // -1 = remove, -2 = remove + remove device node put_byte (u->volume + 172 - 32, ui->unit_type == UNIT_CDFS ? -1 : -2); uae_Signal (get_long (u->volume + 176 - 32), 1 << 13); @@ -1339,14 +1339,14 @@ static uae_u32 filesys_media_change_reply (TrapContext *ctx, int mode) break; } if (nr >= MAX_FILESYSTEM_UNITS) { - write_log (L"FILESYS: filesys_media_change_reply without mount_changed flag!?\n"); + write_log (_T("FILESYS: filesys_media_change_reply without mount_changed flag!?\n")); return 0; } if (u->mount_changed < 0) { // eject if (mode == 0) { - write_log (L"FILESYS: got media change reply, '%s' removal finished\n", u->ui.volname); + write_log (_T("FILESYS: got media change reply, '%s' removal finished\n"), u->ui.volname); flush_cache (u, -1); isofs_unmount (u->ui.cdfs_superblock); ui->cdfs_superblock = u->ui.cdfs_superblock = NULL; @@ -1396,12 +1396,12 @@ static uae_u32 filesys_media_change_reply (TrapContext *ctx, int mode) if (emptydrive) return 0; xfree (u->ui.volname); - ui->volname = u->ui.volname = filesys_createvolname (u->mount_volume, u->mount_rootdir, L"removable"); + ui->volname = u->ui.volname = filesys_createvolname (u->mount_volume, u->mount_rootdir, _T("removable")); } if (u->ui.unknown_media) { - write_log (L"FILESYS: inserted unreadable volume NR=%d RO=%d\n", nr, u->mount_readonly); + write_log (_T("FILESYS: inserted unreadable volume NR=%d RO=%d\n"), nr, u->mount_readonly); } else { - write_log (L"FILESYS: inserted volume NR=%d RO=%d '%s' ('%s')\n", nr, u->mount_readonly, ui->volname, u->mount_rootdir); + write_log (_T("FILESYS: inserted volume NR=%d RO=%d '%s' ('%s')\n"), nr, u->mount_readonly, ui->volname, u->mount_rootdir); set_volume_name (u, ctime); if (u->mount_flags >= 0) ui->volflags = u->volflags = u->ui.volflags = u->mount_flags; @@ -1480,7 +1480,7 @@ int filesys_media_change (const TCHAR *rootdir, int inserted, struct uaedev_conf } } if (!volptr) { - volptr = filesys_createvolname (NULL, rootdir, L"removable"); + volptr = filesys_createvolname (NULL, rootdir, _T("removable")); _tcscpy (volname, volptr); xfree (volptr); volptr = volname; @@ -1506,7 +1506,7 @@ int filesys_media_change (const TCHAR *rootdir, int inserted, struct uaedev_conf if (uci) _tcscpy (devname, uci->devname); else - _stprintf (devname, L"RDH%d", nr_units ()); + _stprintf (devname, _T("RDH%d"), nr_units ()); nr = add_filesys_unit (devname, volptr, rootdir, 0, 0, 0, 0, 0, 0, 0, 1, NULL, 0, MYVOLUMEINFO_REUSABLE); if (nr < 0) return 0; @@ -1541,7 +1541,7 @@ bool filesys_do_disk_change (int cdunitnum, bool insert) if (!mountinfo.ui[nr].cd_open) return false; if (insert) { - filesys_insert (nr, NULL, L"/", true, MYVOLUMEINFO_CDFS | MYVOLUMEINFO_READONLY); + filesys_insert (nr, NULL, _T("/"), true, MYVOLUMEINFO_CDFS | MYVOLUMEINFO_READONLY); return true; } else { filesys_eject (nr); @@ -1626,7 +1626,7 @@ static int flush_cache (Unit *unit, int num) int i = 0; int cnt = 100; - //write_log (L"FILESYS: flushing cache unit %d (max %d items)\n", unit->unit, num); + //write_log (_T("FILESYS: flushing cache unit %d (max %d items)\n"), unit->unit, num); if (num == 0) num = -1; while (i < num || num < 0) { @@ -1649,7 +1649,7 @@ static int flush_cache (Unit *unit, int num) aip = &aino->sibling; } else { if (aino->shlock > 0 || aino->elock) - write_log (L"panic: freeing locked a_inode!\n"); + write_log (_T("panic: freeing locked a_inode!\n")); de_recycle_aino (unit, aino); dispose_aino (unit, aip, aino); i++; @@ -1687,7 +1687,7 @@ static void recycle_aino (Unit *unit, a_inode *new_aino) /* Still in use */ return; - TRACE2((L"Recycling; cache size %d, total_locked %d\n", + TRACE2((_T("Recycling; cache size %d, total_locked %d\n"), unit->aino_cache_size, unit->total_locked_ainos)); if (unit->aino_cache_size > 5000 + unit->total_locked_ainos) { /* Reap a few. */ @@ -1729,7 +1729,7 @@ static void update_child_names (Unit *unit, a_inode *a, a_inode *parent) a->parent = parent; name_start = _tcsrchr (a->nname, FSDB_DIR_SEPARATOR); if (name_start == 0) { - write_log (L"malformed file name"); + write_log (_T("malformed file name")); } name_start++; new_name = xmalloc (TCHAR, _tcslen (name_start) + l0); @@ -1757,7 +1757,7 @@ static void delete_aino (Unit *unit, a_inode *aino) { a_inode **aip; - TRACE((L"deleting aino %x\n", aino->uniq)); + TRACE((_T("deleting aino %x\n"), aino->uniq)); aino_test (aino); aino->dirty = 1; @@ -1767,16 +1767,16 @@ static void delete_aino (Unit *unit, a_inode *aino) /* If any ExKeys are currently pointing at us, advance them. */ if (aino->parent->exnext_count > 0) { int i; - TRACE((L"entering exkey validation\n")); + TRACE((_T("entering exkey validation\n"))); for (i = 0; i < EXKEYS; i++) { ExamineKey *k = unit->examine_keys + i; if (k->uniq == 0) continue; if (k->aino == aino->parent) { - TRACE((L"Same parent found for %d\n", i)); + TRACE((_T("Same parent found for %d\n"), i)); if (k->curr_file == aino) { k->curr_file = aino->sibling; - TRACE((L"Advancing curr_file\n")); + TRACE((_T("Advancing curr_file\n"))); } } } @@ -1786,7 +1786,7 @@ static void delete_aino (Unit *unit, a_inode *aino) while (*aip != aino && *aip != 0) aip = &(*aip)->sibling; if (*aip != aino) { - write_log (L"Couldn't delete aino.\n"); + write_log (_T("Couldn't delete aino.\n")); return; } dispose_aino (unit, aip, aino); @@ -1858,7 +1858,7 @@ TCHAR *build_aname (const TCHAR *d, const TCHAR *n) { TCHAR *p = xmalloc (TCHAR, _tcslen (d) + 1 + _tcslen (n) + 1); _tcscpy (p, d); - _tcscat (p, L"/"); + _tcscat (p, _T("/")); _tcscat (p, n); return p; } @@ -1925,7 +1925,7 @@ static TCHAR *create_nname (Unit *unit, a_inode *base, TCHAR *rel) oh_dear: #endif if (currprefs.filesys_no_uaefsdb && !(base->volflags & MYVOLUMEINFO_STREAMS)) { - write_log (L"illegal filename '%s', no stream supporting filesystem and uaefsdb disabled\n", rel); + write_log (_T("illegal filename '%s', no stream supporting filesystem and uaefsdb disabled\n"), rel); return 0; } p = fsdb_create_unique_nname (base, rel); @@ -1935,7 +1935,7 @@ oh_dear: #if 0 /* Delete this code once we know everything works. */ if (access (p, R_OK) >= 0 || errno != ENOENT) { - write_log (L"Filesystem in trouble... please report.\n"); + write_log (_T("Filesystem in trouble... please report.\n")); xfree (p); goto oh_dear; } @@ -2002,7 +2002,7 @@ static void init_child_aino (Unit *unit, a_inode *base, a_inode *aino) { aino->uniq = ++a_uniq; if (a_uniq == 0xFFFFFFFF) { - write_log (L"Running out of a_inodes (prepare for big trouble)!\n"); + write_log (_T("Running out of a_inodes (prepare for big trouble)!\n")); } aino->shlock = 0; aino->elock = 0; @@ -2032,7 +2032,7 @@ static a_inode *new_child_aino (Unit *unit, a_inode *base, TCHAR *rel) a_inode *aino = NULL; int isvirtual = unit->volflags & (MYVOLUMEINFO_ARCHIVE | MYVOLUMEINFO_CDFS); - TRACE((L"new_child_aino %s, %s\n", base->aname, rel)); + TRACE((_T("new_child_aino %s, %s\n"), base->aname, rel)); if (!isvirtual) aino = fsdb_lookup_aino_aname (base, rel); @@ -2062,7 +2062,7 @@ static a_inode *new_child_aino (Unit *unit, a_inode *base, TCHAR *rel) init_child_aino (unit, base, aino); recycle_aino (unit, aino); - TRACE((L"created aino %x, lookup, amigaos_mode %d\n", aino->uniq, aino->amigaos_mode)); + TRACE((_T("created aino %x, lookup, amigaos_mode %d\n"), aino->uniq, aino->amigaos_mode)); return aino; } @@ -2088,7 +2088,7 @@ static a_inode *create_child_aino (Unit *unit, a_inode *base, TCHAR *rel, int is aino->dirty = 1; recycle_aino (unit, aino); - TRACE((L"created aino %x, create\n", aino->uniq)); + TRACE((_T("created aino %x, create\n"), aino->uniq)); return aino; } @@ -2166,7 +2166,7 @@ static a_inode *lookup_child_aino_for_exnext (Unit *unit, a_inode *base, TCHAR * init_child_aino (unit, base, c); recycle_aino (unit, c); - TRACE((L"created aino %x, exnext\n", c->uniq)); + TRACE((_T("created aino %x, exnext\n"), c->uniq)); return c; } @@ -2181,7 +2181,7 @@ static a_inode *get_aino (Unit *unit, a_inode *base, const TCHAR *rel, int *err) aino_test (base); *err = 0; - TRACE((L"get_path(%s,%s)\n", base->aname, rel)); + TRACE((_T("get_path(%s,%s)\n"), base->aname, rel)); /* root-relative path? */ for (i = 0; rel[i] && rel[i] != '/' && rel[i] != ':'; i++) @@ -2357,7 +2357,7 @@ static void filesys_start_thread (UnitInfo *ui, int nr) ui->back_pipe = xmalloc (smp_comm_pipe, 1); init_comm_pipe (ui->unit_pipe, 100, 3); init_comm_pipe (ui->back_pipe, 100, 1); - uae_start_thread (L"filesys", filesys_thread, (void *)ui, &ui->tid); + uae_start_thread (_T("filesys"), filesys_thread, (void *)ui, &ui->tid); } #endif if (isrestore ()) @@ -2400,7 +2400,7 @@ static uae_u32 REGPARAM2 startup_handler (TrapContext *context) } if (i == MAX_FILESYSTEM_UNITS) { - write_log (L"Failed attempt to mount device '%s'\n", devname); + write_log (_T("Failed attempt to mount device '%s'\n"), devname); put_long (pkt + dp_Res1, DOS_FALSE); put_long (pkt + dp_Res2, ERROR_DEVICE_NOT_MOUNTED); return 0; @@ -2412,7 +2412,7 @@ static uae_u32 REGPARAM2 startup_handler (TrapContext *context) ed = ef = 0; uinfo->cddevno = i - cd_unit_offset; if (!sys_command_open (uinfo->cddevno)) { - write_log (L"Failed attempt to open CD unit %d\n", uinfo->cddevno); + write_log (_T("Failed attempt to open CD unit %d\n"), uinfo->cddevno); put_long (pkt + dp_Res1, DOS_FALSE); put_long (pkt + dp_Res2, ERROR_DEVICE_NOT_MOUNTED); return 0; @@ -2437,7 +2437,7 @@ static uae_u32 REGPARAM2 startup_handler (TrapContext *context) ed = my_existsdir (uinfo->rootdir); ef = my_existsfile (uinfo->rootdir); if (!uinfo->wasisempty && !ef && !ed) { - write_log (L"Failed attempt to mount device '%s'\n", devname); + write_log (_T("Failed attempt to mount device '%s'\n"), devname); put_long (pkt + dp_Res1, DOS_FALSE); put_long (pkt + dp_Res2, ERROR_DEVICE_NOT_MOUNTED); return 0; @@ -2454,7 +2454,7 @@ static uae_u32 REGPARAM2 startup_handler (TrapContext *context) /* write_comm_pipe_int (unit->ui.unit_pipe, -1, 1);*/ - write_log (L"FS: %s (flags=%08X,E=%d,ED=%d,EF=%d,native='%s') starting..\n", + write_log (_T("FS: %s (flags=%08X,E=%d,ED=%d,EF=%d,native='%s') starting..\n"), unit->ui.volname, unit->volflags, uinfo->wasisempty, ed, ef, unit->ui.rootdir); /* fill in our process in the device node */ @@ -2548,14 +2548,14 @@ static void static void action_disk_info (Unit *unit, dpacket packet) { - TRACE((L"ACTION_DISK_INFO\n")); + TRACE((_T("ACTION_DISK_INFO\n"))); do_info (unit, packet, GET_PCK_ARG1 (packet) << 2, true); } static void action_info (Unit *unit, dpacket packet) { - TRACE((L"ACTION_INFO\n")); + TRACE((_T("ACTION_INFO\n"))); do_info (unit, packet, GET_PCK_ARG2 (packet) << 2, false); } @@ -2597,7 +2597,7 @@ static Key *lookup_key (Unit *unit, uae_u32 uniq) if (uniq == k->uniq) return k; } - write_log (L"Error: couldn't find key %u / %u!\n", uniq, total); + write_log (_T("Error: couldn't find key %u / %u!\n"), uniq, total); return 0; } @@ -2617,22 +2617,22 @@ static void dumplock (Unit *unit, uaecptr lock) { a_inode *a; - TRACE((L"LOCK: 0x%lx", lock)); + TRACE((_T("LOCK: 0x%lx"), lock)); if (!lock) { - TRACE((L"\n")); + TRACE((_T("\n"))); return; } - TRACE((L"{ next=0x%lx, mode=%ld, handler=0x%lx, volume=0x%lx, aino %lx ", + TRACE((_T("{ next=0x%lx, mode=%ld, handler=0x%lx, volume=0x%lx, aino %lx "), get_long (lock) << 2, get_long (lock+8), get_long (lock+12), get_long (lock+16), get_long (lock + 4))); a = lookup_aino (unit, get_long (lock + 4)); if (a == 0) { - TRACE((L"not found!")); + TRACE((_T("not found!"))); } else { - TRACE((L"%s", a->nname)); + TRACE((_T("%s"), a->nname)); } - TRACE((L" }\n")); + TRACE((_T(" }\n"))); } static a_inode *find_aino (Unit *unit, uaecptr lock, const TCHAR *name, int *err) @@ -2645,15 +2645,15 @@ static a_inode *find_aino (Unit *unit, uaecptr lock, const TCHAR *name, int *err /* That's the best we can hope to do. */ a = get_aino (unit, &unit->rootnode, name, err); } else { - TRACE((L"aino: 0x%08lx", (unsigned long int)olda->uniq)); - TRACE((L" \"%s\"\n", olda->nname)); + TRACE((_T("aino: 0x%08lx"), (unsigned long int)olda->uniq)); + TRACE((_T(" \"%s\"\n"), olda->nname)); a = get_aino (unit, olda, name, err); } } else { a = get_aino (unit, &unit->rootnode, name, err); } if (a) { - TRACE((L"aino=\"%s\"\n", a->nname)); + TRACE((_T("aino=\"%s\"\n"), a->nname)); } aino_test (a); return a; @@ -2741,7 +2741,7 @@ static void Notify *n; TCHAR *name, *p, *partname; - TRACE((L"ACTION_ADD_NOTIFY\n")); + TRACE((_T("ACTION_ADD_NOTIFY\n"))); name = my_strdup (char1 (get_long (nr + 4))); flags = get_long (nr + 12); @@ -2753,17 +2753,17 @@ static void } #if 0 - write_log (L"Notify:\n"); - write_log (L"nr_Name '%s'\n", char1 (get_long (nr + 0))); - write_log (L"nr_FullName '%s'\n", name); - write_log (L"nr_UserData %08X\n", get_long (nr + 8)); - write_log (L"nr_Flags %08X\n", flags); + write_log (_T("Notify:\n")); + write_log (_T("nr_Name '%s'\n"), char1 (get_long (nr + 0))); + write_log (_T("nr_FullName '%s'\n"), name); + write_log (_T("nr_UserData %08X\n"), get_long (nr + 8)); + write_log (_T("nr_Flags %08X\n"), flags); if (flags & NRF_SEND_MESSAGE) { - write_log (L"Message NotifyRequest, port = %08X\n", get_long (nr + 16)); + write_log (_T("Message NotifyRequest, port = %08X\n"), get_long (nr + 16)); } else if (flags & NRF_SEND_SIGNAL) { - write_log (L"Signal NotifyRequest, Task = %08X signal = %d\n", get_long (nr + 16), get_long (nr + 20)); + write_log (_T("Signal NotifyRequest, Task = %08X signal = %d\n"), get_long (nr + 16), get_long (nr + 20)); } else { - write_log (L"corrupt NotifyRequest\n"); + write_log (_T("corrupt NotifyRequest\n")); } #endif @@ -2793,11 +2793,11 @@ static void Notify *n; int hash; - TRACE((L"ACTION_REMOVE_NOTIFY\n")); + TRACE((_T("ACTION_REMOVE_NOTIFY\n"))); for (hash = 0; hash < NOTIFY_HASH_SIZE; hash++) { for (n = unit->notifyhash[hash]; n; n = n->next) { if (n->notifyrequest == nr) { - //write_log (L"NotifyRequest %08X freed\n", n->notifyrequest); + //write_log (_T("NotifyRequest %08X freed\n"), n->notifyrequest); xfree (n->fullname); xfree (n->partname); free_notify (unit, hash, n); @@ -2806,7 +2806,7 @@ static void } } } - write_log (L"Tried to free non-existing NotifyRequest %08X\n", nr); + write_log (_T("Tried to free non-existing NotifyRequest %08X\n"), nr); PUT_PCK_RES1 (packet, DOS_TRUE); } @@ -2827,7 +2827,7 @@ static void free_lock (Unit *unit, uaecptr lock) current = next; } if (!current) { - write_log (L"tried to unlock non-existing lock %x\n", lock); + write_log (_T("tried to unlock non-existing lock %x\n"), lock); return; } put_long (current << 2, get_long (lock)); @@ -2847,11 +2847,11 @@ static void int err; if (mode != SHARED_LOCK && mode != EXCLUSIVE_LOCK) { - TRACE((L"Bad mode %d (should be %d or %d).\n", mode, SHARED_LOCK, EXCLUSIVE_LOCK)); + TRACE((_T("Bad mode %d (should be %d or %d).\n"), mode, SHARED_LOCK, EXCLUSIVE_LOCK)); mode = SHARED_LOCK; } - TRACE((L"ACTION_LOCK(0x%lx, \"%s\", %d)\n", lock, bstr (unit, name), mode)); + TRACE((_T("ACTION_LOCK(0x%lx, \"%s\", %d)\n"), lock, bstr (unit, name), mode)); DUMPLOCK(unit, lock); a = find_aino (unit, lock, bstr (unit, name), &err); @@ -2876,7 +2876,7 @@ static void action_free_lock (Unit *unit, dpacket packet) { uaecptr lock = GET_PCK_ARG1 (packet) << 2; a_inode *a; - TRACE((L"ACTION_FREE_LOCK(0x%lx)\n", lock)); + TRACE((_T("ACTION_FREE_LOCK(0x%lx)\n"), lock)); DUMPLOCK(unit, lock); a = lookup_aino (unit, get_long (lock + 4)); @@ -2926,7 +2926,7 @@ static void action_dup_lock (Unit *unit, dpacket packet) { uaecptr lock = GET_PCK_ARG1 (packet) << 2; - TRACE((L"ACTION_DUP_LOCK(0x%lx)\n", lock)); + TRACE((_T("ACTION_DUP_LOCK(0x%lx)\n"), lock)); if (!lock) { PUT_PCK_RES1 (packet, 0); return; @@ -2939,7 +2939,7 @@ static void action_lock_from_fh (Unit *unit, dpacket packet) { Key *k = lookup_key (unit, GET_PCK_ARG1 (packet)); - TRACE((L"ACTION_COPY_DIR_FH(0x%lx,'%s')\n", GET_PCK_ARG1 (packet), k ? k->aino->aname : L"")); + TRACE((_T("ACTION_COPY_DIR_FH(0x%lx,'%s')\n"), GET_PCK_ARG1 (packet), k ? k->aino->aname : _T(""))); if (k == 0) { PUT_PCK_RES1 (packet, DOS_FALSE); return; @@ -2994,7 +2994,7 @@ static time_t static void free_exkey (Unit *unit, ExamineKey *ek) { if (--ek->aino->exnext_count == 0) { - TRACE ((L"Freeing ExKey and reducing total_locked from %d by %d\n", + TRACE ((_T("Freeing ExKey and reducing total_locked from %d by %d\n"), unit->total_locked_ainos, ek->aino->locked_children)); unit->total_locked_ainos -= ek->aino->locked_children; ek->aino->locked_children = 0; @@ -3014,7 +3014,7 @@ static ExamineKey *lookup_exkey (Unit *unit, uae_u32 uniq) if (ek->uniq == uniq) return ek; } - write_log (L"Houston, we have a BIG problem.\n"); + write_log (_T("Houston, we have a BIG problem.\n")); return 0; } @@ -3041,7 +3041,7 @@ static ExamineKey *new_exkey (Unit *unit, a_inode *aino) goto found; } /* This message should usually be harmless. */ - write_log (L"Houston, we have a problem (%s).\n", aino->nname); + write_log (_T("Houston, we have a problem (%s).\n"), aino->nname); free_exkey (unit, oldest_ek); ek = oldest_ek; found: @@ -3073,7 +3073,7 @@ static void move_exkeys (Unit *unit, a_inode *from, a_inode *to) } } if (tmp != from->exnext_count) - write_log (L"filesys.c: Bug in ExNext bookkeeping. BAD.\n"); + write_log (_T("filesys.c: Bug in ExNext bookkeeping. BAD.\n")); to->exnext_count = from->exnext_count; to->locked_children = from->locked_children; from->exnext_count = 0; @@ -3113,7 +3113,7 @@ static void /* AmigaOS docs say these have to contain the same value. */ put_long (info + 120, entrytype); - TRACE((L"name=\"%s\"\n", xs)); + TRACE((_T("name=\"%s\"\n"), xs)); x2 = x = ua_fs (xs, -1); n = strlen (x); if (n > 106) @@ -3141,11 +3141,11 @@ static void if (aino->comment == 0 || !fsdb_can) put_long (info + 144, 0); else { - TRACE((L"comment=\"%s\"\n", aino->comment)); + TRACE((_T("comment=\"%s\"\n"), aino->comment)); i = 144; xs = aino->comment; if (!xs) - xs= L""; + xs= _T(""); x2 = x = ua_fs (xs, -1); n = strlen (x); if (n > 78) @@ -3238,7 +3238,7 @@ static void record_timeout (Unit *unit) prev->next = lr->next; else unit->waitingrecords = lr->next; - write_log (L"queued record timed out '%s',%d,%d,%d,%d\n", k ? k->aino->nname : L"NULL", lr->pos, lr->len, lr->mode, lr->timeout); + write_log (_T("queued record timed out '%s',%d,%d,%d,%d\n"), k ? k->aino->nname : _T("NULL"), lr->pos, lr->len, lr->mode, lr->timeout); xfree (lr); retry = true; break; @@ -3261,7 +3261,7 @@ static void record_check_waiting (Unit *unit) prev->next = lr->next; else unit->waitingrecords = lr->next; - write_log (L"queued record released '%s',%d,%d,%d,%d\n", k->aino->nname, lr->pos, lr->len, lr->mode, lr->timeout); + write_log (_T("queued record released '%s',%d,%d,%d,%d\n"), k->aino->nname, lr->pos, lr->len, lr->mode, lr->timeout); // mark packet as complete put_long (lr->msg + 4, 0xffffffff); xfree (lr); @@ -3283,7 +3283,7 @@ static int action_lock_record (Unit *unit, dpacket packet, uae_u32 msg) bool exclusive = mode == REC_EXCLUSIVE || mode == REC_EXCLUSIVE_IMMED; - write_log (L"action_lock_record('%s',%d,%d,%d,%d)\n", k ? k->aino->nname : L"null", pos, len, mode, timeout); + write_log (_T("action_lock_record('%s',%d,%d,%d,%d)\n"), k ? k->aino->nname : _T("null"), pos, len, mode, timeout); if (!k || mode > REC_SHARED_IMMED) { PUT_PCK_RES1 (packet, DOS_FALSE); @@ -3304,12 +3304,12 @@ static int action_lock_record (Unit *unit, dpacket packet, uae_u32 msg) } else { unit->waitingrecords = lr; } - write_log (L"-> collision, timeout queued\n"); + write_log (_T("-> collision, timeout queued\n")); return -1; } PUT_PCK_RES1 (packet, DOS_FALSE); PUT_PCK_RES2 (packet, ERROR_LOCK_COLLISION); - write_log (L"-> ERROR_LOCK_COLLISION\n"); + write_log (_T("-> ERROR_LOCK_COLLISION\n")); return 1; } @@ -3321,7 +3321,7 @@ static int action_lock_record (Unit *unit, dpacket packet, uae_u32 msg) k->record = lr; } PUT_PCK_RES1 (packet, DOS_TRUE); - write_log (L"-> OK\n"); + write_log (_T("-> OK\n")); return 1; } @@ -3331,7 +3331,7 @@ static void action_free_record (Unit *unit, dpacket packet) uae_u32 pos = GET_PCK_ARG2 (packet); uae_u32 len = GET_PCK_ARG3 (packet); - write_log (L"action_free_record('%s',%d,%d)\n", k ? k->aino->nname : L"null", pos, len); + write_log (_T("action_free_record('%s',%d,%d)\n"), k ? k->aino->nname : _T("null"), pos, len); if (!k) { PUT_PCK_RES1 (packet, DOS_FALSE); @@ -3347,13 +3347,13 @@ static void action_free_record (Unit *unit, dpacket packet) else k->record = lr->next; xfree (lr); - write_log (L"->OK\n"); + write_log (_T("->OK\n")); record_check_waiting (unit); PUT_PCK_RES1 (packet, DOS_TRUE); return; } } - write_log (L"-> ERROR_RECORD_NOT_LOCKED\n"); + write_log (_T("-> ERROR_RECORD_NOT_LOCKED\n")); PUT_PCK_RES1 (packet, DOS_FALSE); PUT_PCK_RES2 (packet, ERROR_RECORD_NOT_LOCKED); } @@ -3438,7 +3438,7 @@ static int exalldo (uaecptr exalldata, uae_u32 exalldatasize, uae_u32 type, uaec if (type >= 6) { size2 += 4; if (aino->comment == 0 || !fsdb_can) - commentx = L""; + commentx = _T(""); else commentx = aino->comment; comment = ua_fs (commentx, -1); @@ -3461,8 +3461,8 @@ static int exalldo (uaecptr exalldata, uae_u32 exalldatasize, uae_u32 type, uaec goto end; /* not enough space */ #if EXALL_DEBUG > 0 - write_log (L"ID=%d, %d, %08x: '%s'%s\n", - get_long (control + 4), get_long (control + 0), exp, xs, aino->dir ? L" [DIR]" : L""); + write_log (_T("ID=%d, %d, %08x: '%s'%s\n"), + get_long (control + 4), get_long (control + 0), exp, xs, aino->dir ? _T(" [DIR]") : _T("")); #endif put_long (exp, exp + size + size2); /* ed_Next */ @@ -3562,10 +3562,10 @@ static int action_examine_all_end (Unit *unit, dpacket packet) id = get_long (control + 4); eak = getexall (unit, control, id); #if EXALL_DEBUG > 0 - write_log (L"EXALL_END ID=%d %x\n", id, eak); + write_log (_T("EXALL_END ID=%d %x\n"), id, eak); #endif if (!eak) { - write_log (L"FILESYS: EXALL_END non-existing ID %d\n", id); + write_log (_T("FILESYS: EXALL_END non-existing ID %d\n"), id); doserr = ERROR_OBJECT_WRONG_TYPE; } else { eak->id = 0; @@ -3601,9 +3601,9 @@ static int action_examine_all (Unit *unit, dpacket packet) ok = 0; #if EXALL_DEBUG > 0 - write_log (L"exall: %08x %08x-%08x %d %d %08x\n", + write_log (_T("exall: %08x %08x-%08x %d %d %08x\n"), lock, exalldata, exalldata + exalldatasize, exalldatasize, type, control); - write_log (L"exall: MatchString %08x, MatchFunc %08x\n", + write_log (_T("exall: MatchString %08x, MatchFunc %08x\n"), get_long (control + 8), get_long (control + 12)); #endif @@ -3621,13 +3621,13 @@ static int action_examine_all (Unit *unit, dpacket packet) PUT_PCK_RES1 (packet, DOS_TRUE); id = get_long (control + 4); if (id == EXALL_END) { - write_log (L"FILESYS: EXALL called twice with ERROR_NO_MORE_ENTRIES\n"); + write_log (_T("FILESYS: EXALL called twice with ERROR_NO_MORE_ENTRIES\n")); goto fail; /* already ended exall() */ } if (id) { eak = getexall (unit, control, id); if (!eak) { - write_log (L"FILESYS: EXALL non-existing ID %d\n", id); + write_log (_T("FILESYS: EXALL non-existing ID %d\n"), id); doserr = ERROR_OBJECT_WRONG_TYPE; goto fail; } @@ -3709,7 +3709,7 @@ static uae_u32 exall_helpder(TrapContext *context) uae_u32 id = get_long (control + 4); #if EXALL_DEBUG > 0 - write_log (L"FILESYS: EXALL extra round ID=%d\n", id); + write_log (_T("FILESYS: EXALL extra round ID=%d\n"), id); #endif if (id == EXALL_END) return 1; @@ -3746,7 +3746,7 @@ static void action_examine_object (Unit *unit, dpacket packet) uaecptr info = GET_PCK_ARG2 (packet) << 2; a_inode *aino = 0; - TRACE((L"ACTION_EXAMINE_OBJECT(0x%lx,0x%lx)\n", lock, info)); + TRACE((_T("ACTION_EXAMINE_OBJECT(0x%lx,0x%lx)\n"), lock, info)); DUMPLOCK(unit, lock); if (lock != 0) @@ -3780,7 +3780,7 @@ static void populate_directory (Unit *unit, a_inode *base) base->locked_children++; unit->total_locked_ainos++; } - TRACE2((L"Populating directory, child %p, locked_children %d\n", + TRACE2((_T("Populating directory, child %p, locked_children %d\n"), base->child, base->locked_children)); for (;;) { uae_u64 uniq = 0; @@ -3819,14 +3819,14 @@ static void do_examine (Unit *unit, dpacket packet, ExamineKey *ek, uaecptr info get_fileinfo (unit, packet, info, ek->curr_file); ek->curr_file = ek->curr_file->sibling; if (!(unit->volflags & (MYVOLUMEINFO_ARCHIVE | MYVOLUMEINFO_CDFS)) && !fsdb_exists(name)) { - TRACE ((L"%s orphaned", name)); + TRACE ((_T("%s orphaned"), name)); continue; } - TRACE ((L"curr_file set to %p %s\n", ek->curr_file, - ek->curr_file ? ek->curr_file->aname : L"NULL")); + TRACE ((_T("curr_file set to %p %s\n"), ek->curr_file, + ek->curr_file ? ek->curr_file->aname : _T("NULL"))); return; } - TRACE((L"no more entries\n")); + TRACE((_T("no more entries\n"))); free_exkey (unit, ek); PUT_PCK_RES1 (packet, DOS_FALSE); PUT_PCK_RES2 (packet, ERROR_NO_MORE_ENTRIES); @@ -3840,7 +3840,7 @@ static void action_examine_next (Unit *unit, dpacket packet) ExamineKey *ek; uae_u32 uniq; - TRACE((L"ACTION_EXAMINE_NEXT(0x%lx,0x%lx)\n", lock, info)); + TRACE((_T("ACTION_EXAMINE_NEXT(0x%lx,0x%lx)\n"), lock, info)); gui_flicker_led (LED_HD, unit->unit, 1); DUMPLOCK(unit, lock); @@ -3851,26 +3851,26 @@ static void action_examine_next (Unit *unit, dpacket packet) for(;;) { uniq = get_long (info); if (uniq == 0) { - write_log (L"ExNext called for a file! (Houston?)\n"); + write_log (_T("ExNext called for a file! (Houston?)\n")); goto no_more_entries; } else if (uniq == 0xFFFFFFFE) goto no_more_entries; else if (uniq == 0xFFFFFFFF) { - TRACE((L"Creating new ExKey\n")); + TRACE((_T("Creating new ExKey\n"))); ek = new_exkey (unit, aino); if (ek) { if (aino->exnext_count++ == 0) populate_directory (unit, aino); ek->curr_file = aino->child; - TRACE((L"Initial curr_file: %p %s\n", ek->curr_file, - ek->curr_file ? ek->curr_file->aname : L"NULL")); + TRACE((_T("Initial curr_file: %p %s\n"), ek->curr_file, + ek->curr_file ? ek->curr_file->aname : _T("NULL"))); } } else { - TRACE((L"Looking up ExKey\n")); + TRACE((_T("Looking up ExKey\n"))); ek = lookup_exkey (unit, get_long (info)); } if (ek == 0) { - write_log (L"Couldn't find a matching ExKey. Prepare for trouble.\n"); + write_log (_T("Couldn't find a matching ExKey. Prepare for trouble.\n")); goto no_more_entries; } put_long (info, ek->uniq); @@ -3901,8 +3901,8 @@ static void do_find (Unit *unit, dpacket packet, int mode, int create, int fallb int aino_created = 0; int isvirtual = unit->volflags & (MYVOLUMEINFO_ARCHIVE | MYVOLUMEINFO_CDFS); - TRACE((L"ACTION_FIND_*(0x%lx,0x%lx,\"%s\",%d,%d)\n", fh, lock, bstr (unit, name), mode, create)); - TRACE((L"fh=%x lock=%x name=%x\n", fh, lock, name)); + TRACE((_T("ACTION_FIND_*(0x%lx,0x%lx,\"%s\",%d,%d)\n"), fh, lock, bstr (unit, name), mode, create)); + TRACE((_T("fh=%x lock=%x name=%x\n"), fh, lock, name)); DUMPLOCK(unit, lock); aino = find_aino (unit, lock, bstr (unit, name), &err); @@ -4026,7 +4026,7 @@ static void mode_t openmode; int mode; - TRACE((L"ACTION_FH_FROM_LOCK(0x%lx,0x%lx)\n", fh, lock)); + TRACE((_T("ACTION_FH_FROM_LOCK(0x%lx,0x%lx)\n"), fh, lock)); DUMPLOCK(unit,lock); if (!lock) { @@ -4042,7 +4042,7 @@ static void prepare_for_open (aino->nname); - TRACE ((L" mode is %d\n", mode)); + TRACE ((_T(" mode is %d\n"), mode)); openmode = (((mode & A_FIBF_READ) ? O_WRONLY : (mode & A_FIBF_WRITE) ? O_RDONLY : O_RDWR)); @@ -4124,7 +4124,7 @@ static void action_end (Unit *unit, dpacket packet) { Key *k; - TRACE((L"ACTION_END(0x%lx)\n", GET_PCK_ARG1 (packet))); + TRACE((_T("ACTION_END(0x%lx)\n"), GET_PCK_ARG1 (packet))); k = lookup_key (unit, GET_PCK_ARG1 (packet)); if (k != 0) { @@ -4156,7 +4156,7 @@ static void /* PUT_PCK_RES2 (packet, EINVAL); */ return; } - TRACE((L"ACTION_READ(%s,0x%lx,%ld)\n", k->aino->nname, addr, size)); + TRACE((_T("ACTION_READ(%s,0x%lx,%ld)\n"), k->aino->nname, addr, size)); gui_flicker_led (LED_HD, unit->unit, 1); if (size == 0) { @@ -4178,7 +4178,7 @@ static void /* it really crosses memory boundary */ uae_u8 *buf; - write_log (L"unixfs warning: Bad pointer passed for read: %08x, size %d\n", addr, size); + write_log (_T("unixfs warning: Bad pointer passed for read: %08x, size %d\n"), addr, size); /* ugh this is inefficient but easy */ if (fs_lseek64 (k->fd, k->file_pos, SEEK_SET) < 0) { @@ -4236,7 +4236,7 @@ static void flush_dcache (addr, size); } - TRACE((L"=%d\n", actual)); + TRACE((_T("=%d\n"), actual)); } static void @@ -4256,7 +4256,7 @@ static void } gui_flicker_led (LED_HD, unit->unit, 2); - TRACE((L"ACTION_WRITE(%s,0x%lx,%ld)\n", k->aino->nname, addr, size)); + TRACE((_T("ACTION_WRITE(%s,0x%lx,%ld)\n"), k->aino->nname, addr, size)); if (unit->ui.readonly || unit->ui.locked) { PUT_PCK_RES1 (packet, DOS_FALSE); @@ -4279,7 +4279,7 @@ static void actual = fs_write (k->fd, realpt, size); } else { - write_log (L"unixfs warning: Bad pointer passed for write: %08x, size %d\n", addr, size); + write_log (_T("unixfs warning: Bad pointer passed for write: %08x, size %d\n"), addr, size); /* ugh this is inefficient but easy */ if (fs_lseek64 (k->fd, k->file_pos, SEEK_SET) < 0) { @@ -4302,7 +4302,7 @@ static void xfree (buf); } - TRACE((L"=%d\n", actual)); + TRACE((_T("=%d\n"), actual)); PUT_PCK_RES1 (packet, actual); if (actual != size) PUT_PCK_RES2 (packet, dos_errno ()); @@ -4335,7 +4335,7 @@ static void whence = SEEK_SET; cur = k->file_pos; - TRACE((L"ACTION_SEEK(%s,%d,%d)=%d\n", k->aino->nname, pos, mode, cur)); + TRACE((_T("ACTION_SEEK(%s,%d,%d)=%d\n"), k->aino->nname, pos, mode, cur)); gui_flicker_led (LED_HD, unit->unit, 1); filesize = fs_fsize64 (k->fd); @@ -4371,7 +4371,7 @@ static void a_inode *a; int err; - TRACE((L"ACTION_SET_PROTECT(0x%lx,\"%s\",0x%lx)\n", lock, bstr (unit, name), mask)); + TRACE((_T("ACTION_SET_PROTECT(0x%lx,\"%s\",0x%lx)\n"), lock, bstr (unit, name), mask)); if (unit->ui.readonly || unit->ui.locked) { PUT_PCK_RES1 (packet, DOS_FALSE); @@ -4431,7 +4431,7 @@ static void action_set_comment (Unit * unit, dpacket packet) commented = NULL; } } - TRACE ((L"ACTION_SET_COMMENT(0x%lx,\"%s\")\n", lock, commented)); + TRACE ((_T("ACTION_SET_COMMENT(0x%lx,\"%s\")\n"), lock, commented)); a = find_aino (unit, lock, bstr (unit, name), &err); if (err != 0) { @@ -4463,7 +4463,7 @@ static void uaecptr lock1 = GET_PCK_ARG1 (packet) << 2; uaecptr lock2 = GET_PCK_ARG2 (packet) << 2; - TRACE((L"ACTION_SAME_LOCK(0x%lx,0x%lx)\n", lock1, lock2)); + TRACE((_T("ACTION_SAME_LOCK(0x%lx,0x%lx)\n"), lock1, lock2)); DUMPLOCK(unit, lock1); DUMPLOCK(unit, lock2); if (!lock1 || !lock2) { @@ -4489,7 +4489,7 @@ static void unsigned long uniq; a_inode *a = NULL, *olda = NULL; int err = 0; - TRACE((L"ACTION_CHANGE_MODE(0x%lx,%d,%d)\n", object, type, mode)); + TRACE((_T("ACTION_CHANGE_MODE(0x%lx,%d,%d)\n"), object, type, mode)); if (! object || (type != CHANGE_FH && type != CHANGE_LOCK)) { PUT_PCK_RES1 (packet, DOS_FALSE); @@ -4578,7 +4578,7 @@ static void { uaecptr lock = GET_PCK_ARG1 (packet) << 2; - TRACE((L"ACTION_PARENT(0x%lx)\n",lock)); + TRACE((_T("ACTION_PARENT(0x%lx)\n"),lock)); if (!lock) { PUT_PCK_RES1 (packet, 0); @@ -4586,7 +4586,7 @@ static void } else { action_parent_common (unit, packet, get_long (lock + 4)); } - TRACE((L"=%x %d\n", GET_PCK_RES1 (packet), GET_PCK_RES2 (packet))); + TRACE((_T("=%x %d\n"), GET_PCK_RES1 (packet), GET_PCK_RES2 (packet))); } static void @@ -4597,7 +4597,7 @@ static void a_inode *aino; int err; - TRACE((L"ACTION_CREATE_DIR(0x%lx,\"%s\")\n", lock, bstr (unit, name))); + TRACE((_T("ACTION_CREATE_DIR(0x%lx,\"%s\")\n"), lock, bstr (unit, name))); if (unit->ui.readonly || unit->ui.locked) { PUT_PCK_RES1 (packet, DOS_FALSE); @@ -4646,7 +4646,7 @@ static void a_inode *aino = 0; uaecptr info = GET_PCK_ARG2 (packet) << 2; - TRACE((L"ACTION_EXAMINE_FH(0x%lx,0x%lx)\n", + TRACE((_T("ACTION_EXAMINE_FH(0x%lx,0x%lx)\n"), GET_PCK_ARG1 (packet), GET_PCK_ARG2 (packet) )); k = lookup_key (unit, GET_PCK_ARG1 (packet)); @@ -4679,7 +4679,7 @@ static void if (mode < 0) whence = SEEK_SET; - TRACE((L"ACTION_SET_FILE_SIZE(0x%lx, %d, 0x%x)\n", GET_PCK_ARG1 (packet), offset, mode)); + TRACE((_T("ACTION_SET_FILE_SIZE(0x%lx, %d, 0x%x)\n"), GET_PCK_ARG1 (packet), offset, mode)); k = lookup_key (unit, GET_PCK_ARG1 (packet)); if (k == 0) { @@ -4731,7 +4731,7 @@ static int relock_do(Unit *unit, a_inode *a1) if (k1->aino == a1 && k1->fd) { wehavekeys++; fs_closefile (k1->fd); - write_log (L"handle %p freed\n", k1->fd); + write_log (_T("handle %p freed\n"), k1->fd); } } return wehavekeys; @@ -4749,19 +4749,19 @@ static void relock_re (Unit *unit, a_inode *a1, a_inode *a2, int failed) if (failed) { /* rename still failed, restore fd */ k1->fd = fs_openfile (unit, a1, mode); - write_log (L"restoring old handle '%s' %d\n", a1->nname, k1->dosmode); + write_log (_T("restoring old handle '%s' %d\n"), a1->nname, k1->dosmode); } else { /* transfer fd to new name */ if (a2) { k1->aino = a2; k1->fd = fs_openfile (unit, a2, mode); - write_log (L"restoring new handle '%s' %d\n", a2->nname, k1->dosmode); + write_log (_T("restoring new handle '%s' %d\n"), a2->nname, k1->dosmode); } else { - write_log (L"no new handle, deleting old lock(s).\n"); + write_log (_T("no new handle, deleting old lock(s).\n")); } } if (k1->fd == NULL) { - write_log (L"relocking failed '%s' -> '%s'\n", a1->nname, a2->nname); + write_log (_T("relocking failed '%s' -> '%s'\n"), a1->nname, a2->nname); free_key (unit, k1); } else { fs_lseek64 (k1->fd, k1->file_pos, SEEK_SET); @@ -4778,7 +4778,7 @@ static void a_inode *a; int err; - TRACE((L"ACTION_DELETE_OBJECT(0x%lx,\"%s\")\n", lock, bstr (unit, name))); + TRACE((_T("ACTION_DELETE_OBJECT(0x%lx,\"%s\")\n"), lock, bstr (unit, name))); if (unit->ui.readonly || unit->ui.locked) { PUT_PCK_RES1 (packet, DOS_FALSE); @@ -4821,7 +4821,7 @@ static void notify_check (unit, a); updatedirtime (a, 1); if (a->child != 0) { - write_log (L"Serious error in action_delete_object.\n"); + write_log (_T("Serious error in action_delete_object.\n")); a->deleted = 1; } else { delete_aino (unit, a); @@ -4840,7 +4840,7 @@ static void struct utimbuf ut; int err; - TRACE((L"ACTION_SET_DATE(0x%lx,\"%s\")\n", lock, bstr (unit, name))); + TRACE((_T("ACTION_SET_DATE(0x%lx,\"%s\")\n"), lock, bstr (unit, name))); if (unit->ui.readonly || unit->ui.locked) { PUT_PCK_RES1 (packet, DOS_FALSE); @@ -4875,8 +4875,8 @@ static void Key *k1, *knext; int wehavekeys = 0; - TRACE((L"ACTION_RENAME_OBJECT(0x%lx,\"%s\",", lock1, bstr (unit, name1))); - TRACE((L"0x%lx,\"%s\")\n", lock2, bstr (unit, name2))); + TRACE((_T("ACTION_RENAME_OBJECT(0x%lx,\"%s\","), lock1, bstr (unit, name1))); + TRACE((_T("0x%lx,\"%s\")\n"), lock2, bstr (unit, name2))); if (unit->ui.readonly || unit->ui.locked) { PUT_PCK_RES1 (packet, DOS_FALSE); @@ -4930,7 +4930,7 @@ static void if (-1 == my_rename (a1->nname, a2->nname)) { int ret = -1; /* maybe we have open file handles that caused failure? */ - write_log (L"rename '%s' -> '%s' failed, trying relocking..\n", a1->nname, a2->nname); + write_log (_T("rename '%s' -> '%s' failed, trying relocking..\n"), a1->nname, a2->nname); wehavekeys = relock_do (unit, a1); /* try again... */ ret = my_rename (a1->nname, a2->nname); @@ -4983,7 +4983,7 @@ static void { uaecptr name = GET_PCK_ARG1 (packet) << 2; - TRACE((L"ACTION_RENAME_DISK(\"%s\")\n", bstr (unit, name))); + TRACE((_T("ACTION_RENAME_DISK(\"%s\")\n"), bstr (unit, name))); if (unit->ui.readonly || unit->ui.locked) { PUT_PCK_RES1 (packet, DOS_FALSE); @@ -5002,14 +5002,14 @@ static void static void action_is_filesystem (Unit *unit, dpacket packet) { - TRACE((L"ACTION_IS_FILESYSTEM()\n")); + TRACE((_T("ACTION_IS_FILESYSTEM()\n"))); PUT_PCK_RES1 (packet, DOS_TRUE); } static void action_flush (Unit *unit, dpacket packet) { - TRACE((L"ACTION_FLUSH()\n")); + TRACE((_T("ACTION_FLUSH()\n"))); PUT_PCK_RES1 (packet, DOS_TRUE); flush_cache (unit, 0); } @@ -5017,7 +5017,7 @@ static void static void action_more_cache (Unit *unit, dpacket packet) { - TRACE((L"ACTION_MORE_CACHE()\n")); + TRACE((_T("ACTION_MORE_CACHE()\n"))); PUT_PCK_RES1 (packet, 50); /* bug but AmigaOS expects it */ if (GET_PCK_ARG1 (packet) != 0) flush_cache (unit, 0); @@ -5029,13 +5029,13 @@ static void PUT_PCK_RES1 (packet, DOS_TRUE); flush_cache (unit, 0); unit->inhibited = GET_PCK_ARG1 (packet) != 0; - TRACE((L"ACTION_INHIBIT(%d:%d)\n", unit->unit, unit->inhibited)); + TRACE((_T("ACTION_INHIBIT(%d:%d)\n"), unit->unit, unit->inhibited)); } static void action_write_protect (Unit *unit, dpacket packet) { - TRACE((L"ACTION_WRITE_PROTECT()\n")); + TRACE((_T("ACTION_WRITE_PROTECT()\n"))); PUT_PCK_RES1 (packet, DOS_TRUE); if (GET_PCK_ARG1 (packet)) { if (!unit->ui.locked) { @@ -5075,7 +5075,7 @@ static void action_change_file_position64 (Unit *unit, dpacket packet) if (mode < 0) whence = SEEK_SET; - TRACE((L"ACTION_CHANGE_FILE_POSITION64(%s,%I64d,%d)\n", k->aino->nname, pos, mode)); + TRACE((_T("ACTION_CHANGE_FILE_POSITION64(%s,%I64d,%d)\n"), k->aino->nname, pos, mode)); gui_flicker_led (LED_HD, unit->unit, 1); cur = fs_lseek64 (k->fd, 0, SEEK_CUR); @@ -5120,7 +5120,7 @@ static void action_get_file_position64 (Unit *unit, dpacket packet) PUT_PCK64_RES2 (packet, ERROR_INVALID_LOCK); return; } - TRACE((L"ACTION_GET_FILE_POSITION64(%s)\n", k->aino->nname)); + TRACE((_T("ACTION_GET_FILE_POSITION64(%s)\n"), k->aino->nname)); PUT_PCK64_RES1 (packet, k->file_pos); PUT_PCK64_RES2 (packet, 0); } @@ -5139,7 +5139,7 @@ static void action_change_file_size64 (Unit *unit, dpacket packet) if (mode < 0) whence = SEEK_SET; - TRACE((L"ACTION_CHANGE_FILE_SIZE64(0x%lx, %I64d, 0x%x)\n", GET_PCK64_ARG1 (packet), offset, mode)); + TRACE((_T("ACTION_CHANGE_FILE_SIZE64(0x%lx, %I64d, 0x%x)\n"), GET_PCK64_ARG1 (packet), offset, mode)); k = lookup_key (unit, GET_PCK64_ARG1 (packet)); if (k == 0) { @@ -5190,7 +5190,7 @@ static void action_get_file_size64 (Unit *unit, dpacket packet) PUT_PCK64_RES2 (packet, ERROR_INVALID_LOCK); return; } - TRACE((L"ACTION_GET_FILE_SIZE64(%s)\n", k->aino->nname)); + TRACE((_T("ACTION_GET_FILE_SIZE64(%s)\n"), k->aino->nname)); filesize = fs_fsize64 (k->fd); if (filesize >= 0) { PUT_PCK64_RES1 (packet, filesize); @@ -5248,19 +5248,19 @@ static uae_u32 REGPARAM2 exter_int_helper (TrapContext *context) lockend = locks; while (get_long (lockend) != 0) { if (get_long (lockend) == lockend) { - write_log (L"filesystem lock queue corrupted!\n"); + write_log (_T("filesystem lock queue corrupted!\n")); break; } lockend = get_long (lockend); cnt++; } - TRACE2((L"message_lock: %d %x %x %x\n", cnt, locks, lockend, m68k_areg (regs, 3))); + TRACE2((_T("message_lock: %d %x %x %x\n"), cnt, locks, lockend, m68k_areg (regs, 3))); put_long (lockend, get_long (m68k_areg (regs, 3))); put_long (m68k_areg (regs, 3), locks); } } #else - write_log (L"exter_int_helper should not be called with arg 1!\n"); + write_log (_T("exter_int_helper should not be called with arg 1!\n")); #endif break; case 2: @@ -5302,7 +5302,7 @@ static uae_u32 REGPARAM2 exter_int_helper (TrapContext *context) return 5; default: - write_log (L"exter_int_helper: unknown native action %X\n", cmd); + write_log (_T("exter_int_helper: unknown native action %X\n"), cmd); break; } } @@ -5341,7 +5341,7 @@ static uae_u32 REGPARAM2 exter_int_helper (TrapContext *context) break; default: - write_log (L"Shouldn't happen in exter_int_helper.\n"); + write_log (_T("Shouldn't happen in exter_int_helper.\n")); break; } return 0; @@ -5354,10 +5354,10 @@ static int handle_packet (Unit *unit, dpacket pck, uae_u32 msg) #if 0 if (unit->cdfs_superblock) - write_log(L"unit=%x packet=%d\n", unit, type); + write_log(_T("unit=%x packet=%d\n"), unit, type); #endif #if TRACING_ENABLED > 1 - write_log(L"unit=%x packet=%d\n", unit, type); + write_log(_T("unit=%x packet=%d\n"), unit, type); #endif if (unit->inhibited && filesys_isvolume (unit) && type != ACTION_INHIBIT && type != ACTION_MORE_CACHE @@ -5432,7 +5432,7 @@ static int handle_packet (Unit *unit, dpacket pck, uae_u32 msg) case ACTION_FORMAT: return 0; default: - write_log (L"FILESYS: UNKNOWN PACKET %x\n", type); + write_log (_T("FILESYS: UNKNOWN PACKET %x\n"), type); return 0; } return 1; @@ -5494,13 +5494,13 @@ static uae_u32 REGPARAM2 filesys_handler (TrapContext *context) uaecptr packet_addr = m68k_dreg (regs, 3); uaecptr message_addr = m68k_areg (regs, 4); if (! valid_address (packet_addr, 36) || ! valid_address (message_addr, 14)) { - write_log (L"FILESYS: Bad address %x/%x passed for packet.\n", packet_addr, message_addr); + write_log (_T("FILESYS: Bad address %x/%x passed for packet.\n"), packet_addr, message_addr); goto error2; } put_long (message_addr + 4, 0xffffffff); if (!unit || !unit->volume) { - write_log (L"FILESYS: was not initialized.\n"); + write_log (_T("FILESYS: was not initialized.\n")); goto error; } #ifdef UAE_FILESYS_THREADS @@ -5528,7 +5528,7 @@ error: PUT_PCK_RES1 (packet_addr, DOS_FALSE); PUT_PCK_RES2 (packet_addr, ERROR_ACTION_NOT_KNOWN); } - TRACE((L"reply: %8lx, %ld\n", GET_PCK_RES1 (packet_addr), GET_PCK_RES2 (packet_addr))); + TRACE((_T("reply: %8lx, %ld\n"), GET_PCK_RES1 (packet_addr), GET_PCK_RES2 (packet_addr))); error2: @@ -5668,7 +5668,7 @@ static uae_u32 REGPARAM2 filesys_diagentry (TrapContext *context) uaecptr start = resaddr; uaecptr residents, tmp; - TRACE ((L"filesystem: diagentry called\n")); + TRACE ((_T("filesystem: diagentry called\n"))); filesys_configdev = m68k_areg (regs, 3); init_filesys_diagentry (); @@ -5887,7 +5887,7 @@ int rdb_checksum (uae_char *id, uae_u8 *p, int block) sum = -sum; if (sum) { TCHAR *s = au (id); - write_log (L"RDB: block %d ('%s') checksum error\n", block, s); + write_log (_T("RDB: block %d ('%s') checksum error\n"), block, s); xfree (s); return 0; } @@ -5928,7 +5928,7 @@ static TCHAR *device_dupfix (uaecptr expbase, TCHAR *devname) if (_tcslen (newname) > 2 && newname[_tcslen (newname) - 2] == '_') { newname[_tcslen (newname) - 1]++; } else { - _tcscat (newname, L"_0"); + _tcscat (newname, _T("_0")); } modified = 1; } @@ -5959,24 +5959,24 @@ static void dump_partinfo (struct hardfiledata *hfd, uae_u8 *pp) lowcyl = rl (pp + 36); highcyl = rl (pp + 40); - write_log (L"RDB: '%s' dostype=%08X\n", s, dostype); - write_log (L"BlockSize: %d, Surfaces: %d, SectorsPerBlock %d\n", + write_log (_T("RDB: '%s' dostype=%08X\n"), s, dostype); + write_log (_T("BlockSize: %d, Surfaces: %d, SectorsPerBlock %d\n"), blocksize, surfaces, spb); - write_log (L"SectorsPerTrack: %d, Reserved: %d, LowCyl %d, HighCyl %d, Size %dM\n", + write_log (_T("SectorsPerTrack: %d, Reserved: %d, LowCyl %d, HighCyl %d, Size %dM\n"), spt, reserved, lowcyl, highcyl, (uae_u32)(size >> 20)); - write_log (L"Buffers: %d, BufMemType: %08x, MaxTransfer: %08x, Mask: %08x, BootPri: %d\n", + write_log (_T("Buffers: %d, BufMemType: %08x, MaxTransfer: %08x, Mask: %08x, BootPri: %d\n"), rl (pp + 44), rl (pp + 48), rl (pp + 52), rl (pp + 56), rl (pp + 60)); block = lowcyl * surfaces * spt; if (hdf_read (hfd, buf, (uae_u64)blocksize * block, sizeof buf)) { - write_log (L"First block %d dostype: %08X\n", block, rl (buf)); + write_log (_T("First block %d dostype: %08X\n"), block, rl (buf)); } else { - write_log (L"First block %d read failed!\n", block); + write_log (_T("First block %d read failed!\n"), block); } xfree (s); if ((uae_u64)highcyl * spt * surfaces * blocksize > hfd->virtsize) { - write_log (L"RDB: WARNING: end of partition > size of disk! (%I64u > %I64u)\n", + write_log (_T("RDB: WARNING: end of partition > size of disk! (%I64u > %I64u)\n"), (uae_u64)highcyl * spt * surfaces * blocksize, hfd->virtsize); } @@ -5985,9 +5985,9 @@ static void dump_partinfo (struct hardfiledata *hfd, uae_u8 *pp) static void dump_rdb (UnitInfo *uip, struct hardfiledata *hfd, uae_u8 *bufrdb, uae_u8 *buf, int readblocksize) { - write_log (L"RDB: HostID: %08x Flags: %08x\n", + write_log (_T("RDB: HostID: %08x Flags: %08x\n"), rl (bufrdb + 3 * 4), rl (bufrdb + 5 * 4)); - write_log (L"RDB: BL: %d BH: %d LC: %d HC: %d CB: %d HB: %d\n", + write_log (_T("RDB: BL: %d BH: %d LC: %d HC: %d CB: %d HB: %d\n"), rl (bufrdb + 128), rl (bufrdb + 132), rl (bufrdb + 136), rl (bufrdb + 140), rl (bufrdb + 144), rl (bufrdb + 152)); for (int i = 0; i < 100; i++) { int partblock; @@ -5997,15 +5997,15 @@ static void dump_rdb (UnitInfo *uip, struct hardfiledata *hfd, uae_u8 *bufrdb, u partblock = rl (buf + 4 * 4); if (partblock == 0xffffffff) break; - write_log (L"RDB: PART block %d:\n", partblock); + write_log (_T("RDB: PART block %d:\n"), partblock); if (!legalrdbblock (uip, partblock)) { - write_log (L"RDB: corrupt PART pointer %d\n", partblock); + write_log (_T("RDB: corrupt PART pointer %d\n"), partblock); break; } memset (buf, 0, readblocksize); hdf_read (hfd, buf, partblock * hfd->blocksize, readblocksize); if (!rdb_checksum ("PART", buf, partblock)) { - write_log (L"RDB: checksum error PART block %d\n", partblock); + write_log (_T("RDB: checksum error PART block %d\n"), partblock); break; } dump_partinfo (hfd, buf); @@ -6018,25 +6018,25 @@ static void dump_rdb (UnitInfo *uip, struct hardfiledata *hfd, uae_u8 *bufrdb, u fileblock = rl (buf + 4 * 4); if (fileblock == 0xffffffff) break; - write_log (L"RDB: FSEG block %d:\n", fileblock); + write_log (_T("RDB: FSEG block %d:\n"), fileblock); if (!legalrdbblock (uip, fileblock)) { - write_log (L"RDB: corrupt FSHD pointer %d\n", fileblock); + write_log (_T("RDB: corrupt FSHD pointer %d\n"), fileblock); break; } memset (buf, 0, readblocksize); hdf_read (hfd, buf, fileblock * hfd->blocksize, readblocksize); if (!rdb_checksum ("FSHD", buf, fileblock)) { - write_log (L"RDB: checksum error FSHD block %d\n", fileblock); + write_log (_T("RDB: checksum error FSHD block %d\n"), fileblock); break; } uae_u32 dostype = rl (buf + 32); int version = (buf[36] << 8) | buf[37]; int revision = (buf[38] << 8) | buf[39]; - write_log (L"LSEG: %08x (%d.%d)\n", dostype, version, revision); + write_log (_T("LSEG: %08x (%d.%d)\n"), dostype, version, revision); } } -#define rdbmnt write_log (L"Mounting uaehf.device %d (%d) (size=%I64u):\n", unit_no, partnum, hfd->virtsize); +#define rdbmnt write_log (_T("Mounting uaehf.device %d (%d) (size=%I64u):\n"), unit_no, partnum, hfd->virtsize); static int rdb_mount (UnitInfo *uip, int unit_no, int partnum, uaecptr parmpacket) { @@ -6054,20 +6054,20 @@ static int rdb_mount (UnitInfo *uip, int unit_no, int partnum, uaecptr parmpacke TCHAR *s; bool showdebug = partnum == 0; - write_log (L"%s:\n", uip->rootdir); + write_log (_T("%s:\n"), uip->rootdir); if (hfd->drive_empty) { rdbmnt - write_log (L"ignored, drive is empty\n"); + write_log (_T("ignored, drive is empty\n")); return -2; } if (hfd->blocksize == 0) { rdbmnt - write_log (L"failed, blocksize == 0\n"); + write_log (_T("failed, blocksize == 0\n")); return -1; } if (lastblock * hfd->blocksize > hfd->virtsize) { rdbmnt - write_log (L"failed, too small (%d*%d > %I64u)\n", lastblock, hfd->blocksize, hfd->virtsize); + write_log (_T("failed, too small (%d*%d > %I64u)\n"), lastblock, hfd->blocksize, hfd->virtsize); return -2; } for (rdblock = 0; rdblock < lastblock; rdblock++) { @@ -6081,7 +6081,7 @@ static int rdb_mount (UnitInfo *uip, int unit_no, int partnum, uaecptr parmpacke bufrdb[0xde] = 0; bufrdb[0xdf] = 0; if (rdb_checksum ("RDSK", bufrdb, rdblock)) { - write_log (L"Windows 95/98/ME trashed RDB detected, fixing..\n"); + write_log (_T("Windows 95/98/ME trashed RDB detected, fixing..\n")); hdf_write (hfd, bufrdb, rdblock * hfd->blocksize, hfd->blocksize); break; } @@ -6089,7 +6089,7 @@ static int rdb_mount (UnitInfo *uip, int unit_no, int partnum, uaecptr parmpacke } if (rdblock == lastblock) { rdbmnt - write_log (L"failed, no RDB detected\n"); + write_log (_T("failed, no RDB detected\n")); return -2; } blocksize = rl (bufrdb + 16); @@ -6097,13 +6097,13 @@ static int rdb_mount (UnitInfo *uip, int unit_no, int partnum, uaecptr parmpacke badblock = rl (bufrdb + 24); if (badblock != -1) { rdbmnt - write_log (L"RDB: badblock list is not yet supported. Contact the author.\n"); + write_log (_T("RDB: badblock list is not yet supported. Contact the author.\n")); return -2; } driveinitblock = rl (bufrdb + 36); if (driveinitblock != -1) { rdbmnt - write_log (L"RDB: driveinit is not yet supported. Contact the author.\n"); + write_log (_T("RDB: driveinit is not yet supported. Contact the author.\n")); return -2; } hfd->cylinders = rl (bufrdb + 64); @@ -6115,13 +6115,13 @@ static int rdb_mount (UnitInfo *uip, int unit_no, int partnum, uaecptr parmpacke if (showdebug) { if ((uae_u64)hfd->cylinders * hfd->sectors * hfd->heads * blocksize > hfd->virtsize) - write_log (L"RDB: WARNING: RDSK header disk size > disk size! (%I64u > %I64u)\n", + write_log (_T("RDB: WARNING: RDSK header disk size > disk size! (%I64u > %I64u)\n"), (uae_u64)hfd->cylinders * hfd->sectors * hfd->heads * blocksize, hfd->virtsize); - write_log (L"RDSK dump start\n"); - write_log (L"RDSK at %d, C=%d S=%d H=%d\n", + write_log (_T("RDSK dump start\n")); + write_log (_T("RDSK at %d, C=%d S=%d H=%d\n"), rdblock, hfd->cylinders, hfd->sectors, hfd->heads); dump_rdb (uip, hfd, bufrdb, buf, readblocksize); - write_log (L"RDSK dump end\n"); + write_log (_T("RDSK dump end\n")); } for (i = 0; i <= partnum; i++) { @@ -6145,7 +6145,7 @@ static int rdb_mount (UnitInfo *uip, int unit_no, int partnum, uaecptr parmpacke flags = rl (buf + 20); if ((flags & 2) || uip->bootpri <= -129) { /* do not mount */ err = -1; - write_log (L"RDB: Automount disabled, not mounting\n"); + write_log (_T("RDB: Automount disabled, not mounting\n")); goto error; } @@ -6165,7 +6165,7 @@ static int rdb_mount (UnitInfo *uip, int unit_no, int partnum, uaecptr parmpacke dostype = get_long (parmpacket + 80); if (dostype == 0) { - write_log (L"RDB: mount failed, dostype=0\n"); + write_log (_T("RDB: mount failed, dostype=0\n")); err = -1; goto error; } @@ -6178,7 +6178,7 @@ static int rdb_mount (UnitInfo *uip, int unit_no, int partnum, uaecptr parmpacke fsres = get_long (parmpacket + PP_FSRES); if (!fsres) { - write_log (L"RDB: FileSystem.resource not found, this shouldn't happen!\n"); + write_log (_T("RDB: FileSystem.resource not found, this shouldn't happen!\n")); goto error; } fsnode = get_long (fsres + 18); @@ -6198,17 +6198,17 @@ static int rdb_mount (UnitInfo *uip, int unit_no, int partnum, uaecptr parmpacke for (;;) { if (fileblock == -1) { if (!fsnode) - write_log (L"RDB: FS %08X not in FileSystem.resource or in RDB\n", dostype); + write_log (_T("RDB: FS %08X not in FileSystem.resource or in RDB\n"), dostype); goto error; } if (!legalrdbblock (uip, fileblock)) { - write_log (L"RDB: corrupt FSHD pointer %d\n", fileblock); + write_log (_T("RDB: corrupt FSHD pointer %d\n"), fileblock); goto error; } memset (buf, 0, readblocksize); hdf_read (hfd, buf, fileblock * hfd->blocksize, readblocksize); if (!rdb_checksum ("FSHD", buf, fileblock)) { - write_log (L"RDB: checksum error in FSHD block %d\n", fileblock); + write_log (_T("RDB: checksum error in FSHD block %d\n"), fileblock); goto error; } fileblock = rl (buf + 16); @@ -6219,12 +6219,12 @@ static int rdb_mount (UnitInfo *uip, int unit_no, int partnum, uaecptr parmpacke newversion = (buf[36] << 8) | buf[37]; newrevision = (buf[38] << 8) | buf[39]; - write_log (L"RDB: RDB filesystem %08X version %d.%d\n", dostype, newversion, newrevision); + write_log (_T("RDB: RDB filesystem %08X version %d.%d\n"), dostype, newversion, newrevision); if (fsnode) { - write_log (L"RDB: %08X in FileSystem.resource version %d.%d\n", dostype, oldversion, oldrevision); + write_log (_T("RDB: %08X in FileSystem.resource version %d.%d\n"), dostype, oldversion, oldrevision); } if (newversion * 65536 + newrevision <= oldversion * 65536 + oldrevision && oldversion >= 0) { - write_log (L"RDB: FS in FileSystem.resource is newer or same, ignoring RDB filesystem\n"); + write_log (_T("RDB: FS in FileSystem.resource is newer or same, ignoring RDB filesystem\n")); goto error; } @@ -6253,7 +6253,7 @@ static int rdb_mount (UnitInfo *uip, int unit_no, int partnum, uaecptr parmpacke if (lsegblock == -1) break; } - write_log (L"RDB: Filesystem loaded, %d bytes\n", i * (blocksize - 20)); + write_log (_T("RDB: Filesystem loaded, %d bytes\n"), i * (blocksize - 20)); put_long (parmpacket + PP_FSSIZE, i * (blocksize - 20)); /* RDB filesystem size hack */ uip->rdb_filesysstore = fsmem; uip->rdb_filesyssize = i * (blocksize - 20); @@ -6312,22 +6312,22 @@ static int dofakefilesys (UnitInfo *uip, uaecptr parmpacket) i = _tcslen (tmp); while (i > 0 && tmp[i - 1] != '/' && tmp[i - 1] != '\\') i--; - _tcscpy (tmp + i, L"FastFileSystem"); + _tcscpy (tmp + i, _T("FastFileSystem")); } if (tmp[0] == 0) { - write_log (L"RDB: no filesystem for dostype 0x%08X\n", dostype); + write_log (_T("RDB: no filesystem for dostype 0x%08X\n"), dostype); if ((dostype & 0xffffff00) == 0x444f5300) return FILESYS_HARDFILE; - write_log (L"RDB: mounted without filesys\n"); + write_log (_T("RDB: mounted without filesys\n")); return FILESYS_HARDFILE; } - write_log (L"RDB: fakefilesys, trying to load '%s', dostype 0x%08X\n", tmp, dostype); - zf = zfile_fopen (tmp, L"rb", ZFD_NORMAL); + write_log (_T("RDB: fakefilesys, trying to load '%s', dostype 0x%08X\n"), tmp, dostype); + zf = zfile_fopen (tmp, _T("rb"), ZFD_NORMAL); if (!zf) { - write_log (L"RDB: filesys not found\n"); + write_log (_T("RDB: filesys not found\n")); if ((dostype & 0xffffff00) == 0x444f5300) return FILESYS_HARDFILE; - write_log (L"RDB: mounted without filesys\n"); + write_log (_T("RDB: mounted without filesys\n")); return FILESYS_HARDFILE; } @@ -6342,7 +6342,7 @@ static int dofakefilesys (UnitInfo *uip, uaecptr parmpacket) uip->rdb_filesyssize = size; put_long (parmpacket + PP_FSSIZE, uip->rdb_filesyssize); addfakefilesys (parmpacket, dostype); - write_log (L"HDF: faked RDB filesystem %08X loaded\n", dostype); + write_log (_T("HDF: faked RDB filesystem %08X loaded\n"), dostype); return FILESYS_HARDFILE; } @@ -6354,7 +6354,7 @@ static void get_new_device (int type, uaecptr parmpacket, TCHAR **devname, uaecp if (*devname == 0 || _tcslen (*devname) == 0) { int un = unit_no; for (;;) { - _stprintf (buffer, type == FILESYS_CD ? L"CD%d" : L"DH%d", un++); + _stprintf (buffer, type == FILESYS_CD ? _T("CD%d") : _T("DH%d"), un++); if (type == FILESYS_CD && USE_CDFS == 2) *devname = my_strdup (buffer); if (!device_isdup (expbase, buffer)) @@ -6365,11 +6365,11 @@ static void get_new_device (int type, uaecptr parmpacket, TCHAR **devname, uaecp } *devname_amiga = ds (device_dupfix (expbase, buffer)); if (type == FILESYS_CD) - write_log (L"FS: mounted CD unit %s\n", buffer); + write_log (_T("FS: mounted CD unit %s\n"), buffer); else if (type == FILESYS_VIRTUAL) - write_log (L"FS: mounted virtual unit %s (%s)\n", buffer, mountinfo.ui[unit_no].rootdir); + write_log (_T("FS: mounted virtual unit %s (%s)\n"), buffer, mountinfo.ui[unit_no].rootdir); else - write_log (L"FS: mounted HDF unit %s (%04x-%08x, %s)\n", buffer, + write_log (_T("FS: mounted HDF unit %s (%04x-%08x, %s)\n"), buffer, (uae_u32)(mountinfo.ui[unit_no].hf.virtsize >> 32), (uae_u32)(mountinfo.ui[unit_no].hf.virtsize), mountinfo.ui[unit_no].rootdir); @@ -6404,7 +6404,7 @@ static uae_u32 REGPARAM2 filesys_dev_storeinfo (TrapContext *context) get_new_device (type, parmpacket, &cdname, &cdname_amiga, cd_unit_no); } - write_log (L"Mounting uaescsi.device %d: (%d)\n", cd_unit_no, unit_no); + write_log (_T("Mounting uaescsi.device %d: (%d)\n"), cd_unit_no, unit_no); put_long (parmpacket + 0, cdname_amiga); put_long (parmpacket + 4, cdfs_devname); put_long (parmpacket + 8, cd_unit_no); @@ -6442,7 +6442,7 @@ static uae_u32 REGPARAM2 filesys_dev_storeinfo (TrapContext *context) fsnode = get_long (fsnode); } } else { - write_log (L"CDFS: FileSystem.resource not found, this shouldn't happen!\n"); + write_log (_T("CDFS: FileSystem.resource not found, this shouldn't happen!\n")); cdfs = true; } @@ -6463,7 +6463,7 @@ static uae_u32 REGPARAM2 filesys_dev_storeinfo (TrapContext *context) } if (sub_no) return -2; - write_log (L"Mounting uaehf.device %d (%d):\n", unit_no, sub_no); + write_log (_T("Mounting uaehf.device %d (%d):\n"), unit_no, sub_no); get_new_device (type, parmpacket, &uip[unit_no].devname, &uip[unit_no].devname_amiga, unit_no); uip[unit_no].devno = unit_no; put_long (parmpacket, uip[unit_no].devname_amiga); @@ -6544,7 +6544,7 @@ static uae_u32 REGPARAM2 mousehack_done (TrapContext *context) uaecptr ret = consolehook_beginio (m68k_areg (regs, 1)); put_long (m68k_areg (regs, 7) + 4 * 4, ret); } else { - write_log (L"Unknown mousehack hook %d\n", mode); + write_log (_T("Unknown mousehack hook %d\n"), mode); } return 1; } @@ -6572,7 +6572,7 @@ void filesys_install (void) { uaecptr loop; - TRACE ((L"Installing filesystem\n")); + TRACE ((_T("Installing filesystem\n"))); uae_sem_init (&singlethread_int_sem, 0, 1); uae_sem_init (&test_sem, 0, 1); @@ -6590,46 +6590,46 @@ void filesys_install (void) #endif #endif ROM_filesys_diagentry = here (); - calltrap (deftrap2 (filesys_diagentry, 0, L"filesys_diagentry")); + calltrap (deftrap2 (filesys_diagentry, 0, _T("filesys_diagentry"))); dw(0x4ED0); /* JMP (a0) - jump to code that inits Residents */ loop = here (); org (rtarea_base + 0xFF18); - calltrap (deftrap2 (filesys_dev_bootfilesys, 0, L"filesys_dev_bootfilesys")); + calltrap (deftrap2 (filesys_dev_bootfilesys, 0, _T("filesys_dev_bootfilesys"))); dw (RTS); /* Special trap for the assembly make_dev routine */ org (rtarea_base + 0xFF20); - calltrap (deftrap2 (filesys_dev_remember, 0, L"filesys_dev_remember")); + calltrap (deftrap2 (filesys_dev_remember, 0, _T("filesys_dev_remember"))); dw (RTS); org (rtarea_base + 0xFF28); - calltrap (deftrap2 (filesys_dev_storeinfo, 0, L"filesys_dev_storeinfo")); + calltrap (deftrap2 (filesys_dev_storeinfo, 0, _T("filesys_dev_storeinfo"))); dw (RTS); org (rtarea_base + 0xFF30); - calltrap (deftrap2 (filesys_handler, 0, L"filesys_handler")); + calltrap (deftrap2 (filesys_handler, 0, _T("filesys_handler"))); dw (RTS); org (rtarea_base + 0xFF38); - calltrap (deftrap2 (mousehack_done, 0, L"mousehack_done")); + calltrap (deftrap2 (mousehack_done, 0, _T("mousehack_done"))); dw (RTS); org (rtarea_base + 0xFF40); - calltrap (deftrap2 (startup_handler, 0, L"startup_handler")); + calltrap (deftrap2 (startup_handler, 0, _T("startup_handler"))); dw (RTS); org (rtarea_base + 0xFF48); - calltrap (deftrap2 (filesys_init_storeinfo, TRAPFLAG_EXTRA_STACK, L"filesys_init_storeinfo")); + calltrap (deftrap2 (filesys_init_storeinfo, TRAPFLAG_EXTRA_STACK, _T("filesys_init_storeinfo"))); dw (RTS); org (rtarea_base + 0xFF50); - calltrap (deftrap2 (exter_int_helper, 0, L"exter_int_helper")); + calltrap (deftrap2 (exter_int_helper, 0, _T("exter_int_helper"))); dw (RTS); org (rtarea_base + 0xFF58); - calltrap (deftrap2 (fsmisc_helper, 0, L"fsmisc_helper")); + calltrap (deftrap2 (fsmisc_helper, 0, _T("fsmisc_helper"))); dw (RTS); org (loop); @@ -6654,7 +6654,7 @@ void filesys_install_code (void) filesys_initcode = a + dlg (b) + bootrom_header - 4; #if USE_CDFS == 1 - cdfs_handler = zfile_load_data (L"cdfs.gz", cdfs_rom, cdfs_rom_len, &cdfs_handler_len); + cdfs_handler = zfile_load_data (_T("cdfs.gz"), cdfs_rom, cdfs_rom_len, &cdfs_handler_len); #endif } @@ -6736,7 +6736,7 @@ static a_inode *restore_filesys_get_base (Unit *u, TCHAR *npath) cnt = 1; for (;;) { _tcscpy (path, npath); - _tcscat (path, L"/"); + _tcscat (path, _T("/")); p = path; for (i = 0; i < cnt ;i++) { if (i > 0) @@ -6749,7 +6749,7 @@ static a_inode *restore_filesys_get_base (Unit *u, TCHAR *npath) err = 0; get_aino (u, &u->rootnode, path, &err); if (err) { - write_log (L"*** FS: missing path '%s'!\n", path); + write_log (_T("*** FS: missing path '%s'!\n"), path); return NULL; } cnt++; @@ -6764,7 +6764,7 @@ static a_inode *restore_filesys_get_base (Unit *u, TCHAR *npath) a = u->rootnode.child; for (;;) { if (*p == 0) { - write_log (L"*** FS: base aino NOT found '%s' ('%s')\n", a->nname, npath); + write_log (_T("*** FS: base aino NOT found '%s' ('%s')\n"), a->nname, npath); xfree (path); return NULL; } @@ -6779,7 +6779,7 @@ static a_inode *restore_filesys_get_base (Unit *u, TCHAR *npath) } p = p2 + 1; if (*p == 0) { - write_log (L"FS: base aino found '%s' ('%s')\n", a->nname, npath); + write_log (_T("FS: base aino found '%s' ('%s')\n"), a->nname, npath); xfree (path); return a; } @@ -6787,7 +6787,7 @@ static a_inode *restore_filesys_get_base (Unit *u, TCHAR *npath) break; } if (!a) { - write_log (L"*** FS: path part '%s' not found ('%s')\n", p, npath); + write_log (_T("*** FS: path part '%s' not found ('%s')\n"), p, npath); xfree (path); return NULL; } @@ -6800,7 +6800,7 @@ static TCHAR *makenativepath (UnitInfo *ui, TCHAR *apath) TCHAR *pn; /* create native path. FIXME: handle 'illegal' characters */ pn = xcalloc (TCHAR, _tcslen (apath) + 1 + _tcslen (ui->rootdir) + 1); - _stprintf (pn, L"%s/%s", ui->rootdir, apath); + _stprintf (pn, _T("%s/%s"), ui->rootdir, apath); if (FSDB_DIR_SEPARATOR != '/') { for (i = 0; i < _tcslen (pn); i++) { if (pn[i] == '/') @@ -6834,11 +6834,11 @@ static uae_u8 *restore_aino (UnitInfo *ui, Unit *u, uae_u8 *src) a->aname = p; a->dir = 1; if (ui->volflags < 0) { - write_log (L"FS: Volume '%s' ('%s') missing!\n", a->aname, a->nname); + write_log (_T("FS: Volume '%s' ('%s') missing!\n"), a->aname, a->nname); } else { a->volflags = ui->volflags; recycle_aino (u, a); - write_log (L"FS: Lock (root) '%s' ('%s')\n", a->aname, a->nname); + write_log (_T("FS: Lock (root) '%s' ('%s')\n"), a->aname, a->nname); } return src; } @@ -6858,27 +6858,27 @@ static uae_u8 *restore_aino (UnitInfo *ui, Unit *u, uae_u8 *src) if (flags & 2) { a->dir = 1; if (!my_existsdir(a->nname)) - write_log (L"*** FS: Directory '%s' missing!\n", a->nname); + write_log (_T("*** FS: Directory '%s' missing!\n"), a->nname); else fsdb_clean_dir (a); } else { if (!my_existsfile(a->nname)) - write_log (L"*** FS: File '%s' missing!\n", a->nname); + write_log (_T("*** FS: File '%s' missing!\n"), a->nname); } if (base) { fill_file_attrs (u, base, a); init_child_aino_tree (u, base, a); } else { - write_log (L"*** FS: parent directory missing '%s' ('%s')\n", a->aname, a->nname); + write_log (_T("*** FS: parent directory missing '%s' ('%s')\n"), a->aname, a->nname); missing = 1; } if (missing) { - write_log (L"*** FS: Lock restore failed '%s' ('%s')\n", a->aname, a->nname); + write_log (_T("*** FS: Lock restore failed '%s' ('%s')\n"), a->aname, a->nname); xfree (a->nname); xfree (a->aname); xfree (a); } else { - write_log (L"FS: Lock '%s' ('%s')\n", a->aname, a->nname); + write_log (_T("FS: Lock '%s' ('%s')\n"), a->aname, a->nname); recycle_aino (u, a); } return src; @@ -6909,18 +6909,18 @@ static uae_u8 *restore_key (UnitInfo *ui, Unit *u, uae_u8 *src) openmode = ((k->dosmode & A_FIBF_READ) == 0 ? O_WRONLY : (k->dosmode & A_FIBF_WRITE) == 0 ? O_RDONLY : O_RDWR); - write_log (L"FS: open file '%s' ('%s'), pos=%d\n", p, pn, k->file_pos); + write_log (_T("FS: open file '%s' ('%s'), pos=%d\n"), p, pn, k->file_pos); a = get_aino (u, &u->rootnode, p, &err); if (!a) - write_log (L"*** FS: Open file aino creation failed '%s'\n", p); + write_log (_T("*** FS: Open file aino creation failed '%s'\n"), p); missing = 1; if (a) { missing = 0; k->aino = a; if (a->uniq != uniq) - write_log (L"*** FS: Open file '%s' aino id %d != %d\n", p, uniq, a->uniq); + write_log (_T("*** FS: Open file '%s' aino id %d != %d\n"), p, uniq, a->uniq); if (!my_existsfile (pn)) { - write_log (L"*** FS: Open file '%s' is missing, creating dummy file!\n", p); + write_log (_T("*** FS: Open file '%s' is missing, creating dummy file!\n"), p); k->fd = fs_openfile (u, a, openmode | O_CREAT |O_BINARY); if (k->fd) { uae_u8 *buf = xcalloc (uae_u8, 10000); @@ -6931,23 +6931,23 @@ static uae_u8 *restore_key (UnitInfo *ui, Unit *u, uae_u8 *src) sp -= s; } xfree(buf); - write_log (L"*** FS: dummy file created\n"); + write_log (_T("*** FS: dummy file created\n")); } else { - write_log (L"*** FS: Open file '%s', couldn't create dummy file!\n", p); + write_log (_T("*** FS: Open file '%s', couldn't create dummy file!\n"), p); } } else { k->fd = fs_openfile (u, a, openmode | O_BINARY); } if (!k->fd) { - write_log (L"*** FS: Open file '%s' failed to open!\n", p); + write_log (_T("*** FS: Open file '%s' failed to open!\n"), p); missing = 1; } else { uae_s64 s; s = fs_fsize64 (k->fd); if (s != savedsize) - write_log (L"FS: restored file '%s' size changed! orig=%d, now=%d!!\n", p, savedsize, s); + write_log (_T("FS: restored file '%s' size changed! orig=%d, now=%d!!\n"), p, savedsize, s); if (k->file_pos > s) { - write_log (L"FS: restored filepos larger than size of file '%s'!! %d > %d\n", p, k->file_pos, s); + write_log (_T("FS: restored filepos larger than size of file '%s'!! %d > %d\n"), p, k->file_pos, s); k->file_pos = s; } fs_lseek64 (k->fd, k->file_pos, SEEK_SET); @@ -6972,7 +6972,7 @@ static uae_u8 *restore_notify (UnitInfo *ui, Unit *u, uae_u8 *src) n->notifyrequest = restore_u32 (); s = restore_string (); n->fullname = xmalloc (TCHAR, _tcslen (ui->volname) + 2 + _tcslen (s) + 1); - _stprintf (n->fullname, L"%s:%s", ui->volname, s); + _stprintf (n->fullname, _T("%s:%s"), ui->volname, s); xfree(s); s = _tcsrchr (n->fullname, '/'); if (s) @@ -6983,7 +6983,7 @@ static uae_u8 *restore_notify (UnitInfo *ui, Unit *u, uae_u8 *src) hash = notifyhash (n->fullname); n->next = u->notifyhash[hash]; u->notifyhash[hash] = n; - write_log (L"FS: notify %08X '%s' '%s'\n", n->notifyrequest, n->fullname, n->partname); + write_log (_T("FS: notify %08X '%s' '%s'\n"), n->notifyrequest, n->fullname, n->partname); return src; } @@ -7013,22 +7013,22 @@ static uae_u8 *restore_filesys_virtual (UnitInfo *ui, uae_u8 *src, int num) u->volflags = ui->volflags; cnt = restore_u32 (); - write_log (L"FS: restoring %d locks\n", cnt); + write_log (_T("FS: restoring %d locks\n"), cnt); while (cnt-- > 0) src = restore_aino(ui, u, src); cnt = restore_u32 (); - write_log (L"FS: restoring %d open files\n", cnt); + write_log (_T("FS: restoring %d open files\n"), cnt); while (cnt-- > 0) src = restore_key(ui, u, src); cnt = restore_u32 (); - write_log (L"FS: restoring %d notifications\n", cnt); + write_log (_T("FS: restoring %d notifications\n"), cnt); while (cnt-- > 0) src = restore_notify (ui, u, src); cnt = restore_u32 (); - write_log (L"FS: restoring %d exkeys\n", cnt); + write_log (_T("FS: restoring %d exkeys\n"), cnt); while (cnt-- > 0) src = restore_exkey (ui, u, src); @@ -7069,9 +7069,9 @@ static int recurse_aino (UnitInfo *ui, a_inode *a, int cnt, uae_u8 **dstp) if (a->elock || a->shlock || a->uniq == 0) { if (dst) { TCHAR *fn; - write_log (L"uniq=%d s=%d e=%d d=%d '%s' '%s'\n", a->uniq, a->shlock, a->elock, a->dir, a->aname, a->nname); + write_log (_T("uniq=%d s=%d e=%d d=%d '%s' '%s'\n"), a->uniq, a->shlock, a->elock, a->dir, a->aname, a->nname); fn = getfullaname(a); - write_log (L"->'%s'\n", fn); + write_log (_T("->'%s'\n"), fn); save_u64 (a->uniq); save_u32 (a->locked_children); save_u32 (a->exnext_count); @@ -7109,7 +7109,7 @@ static uae_u8 *save_key (uae_u8 *dst, Key *k) save_string (fn); save_u64 (k->file_pos); save_u64 (size); - write_log (L"'%s' uniq=%d size=%I64d seekpos=%I64d mode=%d dosmode=%d\n", + write_log (_T("'%s' uniq=%d size=%I64d seekpos=%I64d mode=%d dosmode=%d\n"), fn, k->uniq, size, k->file_pos, k->createmode, k->dosmode); xfree (fn); return dst; @@ -7123,7 +7123,7 @@ static uae_u8 *save_notify (UnitInfo *ui, uae_u8 *dst, Notify *n) if (_tcslen (s) >= _tcslen (ui->volname) && !_tcsncmp (n->fullname, ui->volname, _tcslen (ui->volname))) s = n->fullname + _tcslen (ui->volname) + 1; save_string (s); - write_log (L"FS: notify %08X '%s'\n", n->notifyrequest, n->fullname); + write_log (_T("FS: notify %08X '%s'\n"), n->notifyrequest, n->fullname); return dst; } @@ -7141,7 +7141,7 @@ static uae_u8 *save_filesys_virtual (UnitInfo *ui, uae_u8 *dst) Key *k; int cnt, i, j; - write_log (L"FSSAVE: '%s'\n", ui->devname); + write_log (_T("FSSAVE: '%s'\n"), ui->devname); save_u32 (u->dosbase); save_u32 (u->volume); save_u32 (u->port); @@ -7154,13 +7154,13 @@ static uae_u8 *save_filesys_virtual (UnitInfo *ui, uae_u8 *dst) save_u32 (u->total_locked_ainos); cnt = recurse_aino (ui, &u->rootnode, 0, NULL); save_u32 (cnt); - write_log (L"%d open locks\n", cnt); + write_log (_T("%d open locks\n"), cnt); cnt = recurse_aino (ui, &u->rootnode, 0, &dst); cnt = 0; for (k = u->keys; k; k = k->next) cnt++; save_u32 (cnt); - write_log (L"%d open files\n", cnt); + write_log (_T("%d open files\n"), cnt); for (k = u->keys; k; k = k->next) dst = save_key (dst, k); for (j = 0; j < 2; j++) { @@ -7176,7 +7176,7 @@ static uae_u8 *save_filesys_virtual (UnitInfo *ui, uae_u8 *dst) } if (j == 0) { save_u32 (cnt); - write_log (L"%d notify requests\n", cnt); + write_log (_T("%d notify requests\n"), cnt); } } for (j = 0; j < 2; j++) { @@ -7191,10 +7191,10 @@ static uae_u8 *save_filesys_virtual (UnitInfo *ui, uae_u8 *dst) } if (j == 0) { save_u32 (cnt); - write_log (L"%d exkeys\n", cnt); + write_log (_T("%d exkeys\n"), cnt); } } - write_log (L"END\n"); + write_log (_T("END\n")); return dst; } @@ -7234,7 +7234,7 @@ uae_u8 *save_filesys (int num, int *len) /* not initialized yet, do not save */ if (type == FILESYS_VIRTUAL && (ui->self == NULL || ui->volname == NULL)) return NULL; - write_log (L"FS_FILESYS: '%s' '%s'\n", ui->devname, ui->volname); + write_log (_T("FS_FILESYS: '%s' '%s'\n"), ui->devname, ui->volname); dstbak = dst = xmalloc (uae_u8, 100000); save_u32 (2); /* version */ save_u32 (ui->devno); @@ -7299,14 +7299,14 @@ uae_u8 *restore_filesys (uae_u8 *src) if (set_filesys_unit (devno, devname, volname, rootdir, readonly, ui->hf.secspertrack, ui->hf.surfaces, ui->hf.reservedblocks, ui->hf.blocksize, bootpri, false, true, filesysdir[0] ? filesysdir : NULL, 0, 0) < 0) { - write_log (L"filesys '%s' failed to restore\n", rootdir); + write_log (_T("filesys '%s' failed to restore\n"), rootdir); goto end; } ui->devno = devno; ui->startup = startup; if (type == FILESYS_VIRTUAL) src = restore_filesys_virtual (ui, src, devno); - write_log (L"'%s' restored\n", rootdir); + write_log (_T("'%s' restored\n"), rootdir); end: xfree (rootdir); xfree (devname); diff --git a/fpp.cpp b/fpp.cpp index c19dc1a6..b8b03648 100644 --- a/fpp.cpp +++ b/fpp.cpp @@ -186,7 +186,7 @@ static void fpu_op_illg (uae_u32 opcode, int pcoffset) x_put_long (m68k_areg (regs, 7), newpc); m68k_areg (regs, 7) -= 2; x_put_word (m68k_areg (regs, 7), regs.sr); - write_log (L"68040/060 FPU disabled exception PC=%x\n", newpc); + write_log (_T("68040/060 FPU disabled exception PC=%x\n"), newpc); newpc = x_get_long (regs.vbr + 11 * 4); m68k_setpc (newpc); #ifdef JIT @@ -544,7 +544,7 @@ STATIC_INLINE int put_fp_value (fptype value, uae_u32 opcode, uae_u16 extra) #if DEBUG_FPP if (!isinrom ()) - write_log (L"PUTFP: %f %04X %04X\n", value, opcode, extra); + write_log (_T("PUTFP: %f %04X %04X\n"), value, opcode, extra); #endif if (!(extra & 0x4000)) { regs.fp[(extra >> 10) & 7] = value; @@ -810,7 +810,7 @@ void fpuop_dbcc (uae_u32 opcode, uae_u16 extra) #if DEBUG_FPP if (!isinrom ()) - write_log (L"fdbcc_opp at %08lx\n", m68k_getpc ()); + write_log (_T("fdbcc_opp at %08lx\n"), m68k_getpc ()); #endif if (fault_if_no_fpu (opcode, 4)) return; @@ -836,7 +836,7 @@ void fpuop_scc (uae_u32 opcode, uae_u16 extra) #if DEBUG_FPP if (!isinrom ()) - write_log (L"fscc_opp at %08lx\n", m68k_getpc ()); + write_log (_T("fscc_opp at %08lx\n"), m68k_getpc ()); #endif if (fault_if_no_fpu (opcode, 4)) return; @@ -861,7 +861,7 @@ void fpuop_trapcc (uae_u32 opcode, uaecptr oldpc, uae_u16 extra) #if DEBUG_FPP if (!isinrom ()) - write_log (L"ftrapcc_opp at %08lx\n", m68k_getpc ()); + write_log (_T("ftrapcc_opp at %08lx\n"), m68k_getpc ()); #endif if (fault_if_no_fpu (opcode, m68k_getpc() - oldpc)) return; @@ -880,7 +880,7 @@ void fpuop_bcc (uae_u32 opcode, uaecptr pc, uae_u32 extra) #if DEBUG_FPP if (!isinrom ()) - write_log (L"fbcc_opp at %08lx\n", m68k_getpc ()); + write_log (_T("fbcc_opp at %08lx\n"), m68k_getpc ()); #endif if (fault_if_no_fpu (opcode, m68k_getpc () - pc)) return; @@ -904,7 +904,7 @@ void fpuop_save (uae_u32 opcode) #if DEBUG_FPP if (!isinrom ()) - write_log (L"fsave_opp at %08lx\n", m68k_getpc ()); + write_log (_T("fsave_opp at %08lx\n"), m68k_getpc ()); #endif if (fault_if_no_fpu (opcode, 2)) return; @@ -979,7 +979,7 @@ void fpuop_restore (uae_u32 opcode) #if DEBUG_FPP if (!isinrom ()) - write_log (L"frestore_opp at %08lx\n", m68k_getpc ()); + write_log (_T("frestore_opp at %08lx\n"), m68k_getpc ()); #endif if (fault_if_no_fpu (opcode, 2)) return; @@ -1070,7 +1070,7 @@ static void fpuop_arithmetic2 (uae_u32 opcode, uae_u16 extra) #if DEBUG_FPP if (!isinrom ()) - write_log (L"FPP %04lx %04x at %08lx\n", opcode & 0xffff, extra, m68k_getpc () - 4); + write_log (_T("FPP %04lx %04x at %08lx\n"), opcode & 0xffff, extra, m68k_getpc () - 4); #endif if (fault_if_no_fpu (opcode, 4)) return; @@ -1663,7 +1663,7 @@ void fpuop_arithmetic (uae_u32 opcode, uae_u16 extra) regs.fpsr &= 0xffff00ff; regs.fpsr |= regs.fpsr_highbyte; regs.fpsr |= regs.fpsr_highbyte << 8; - write_log (L"FPU exception: %04x\n", regs.fpsr); + write_log (_T("FPU exception: %04x\n"), regs.fpsr); } } @@ -1701,7 +1701,7 @@ uae_u8 *restore_fpu (uae_u8 *src) restore_u32(); restore_u32(); } - write_log (L"FPU: %d\n", currprefs.fpu_model); + write_log (_T("FPU: %d\n"), currprefs.fpu_model); return src; } diff --git a/fsdb.cpp b/fsdb.cpp index d09f6807..fba1cb22 100644 --- a/fsdb.cpp +++ b/fsdb.cpp @@ -108,7 +108,7 @@ static void fsdb_fixup (FILE *f, TCHAR *buf, int size, a_inode *base) xfree (nname); return; } - TRACE ((L"uaefsdb '%s' deleted\n", nname)); + TRACE ((_T("uaefsdb '%s' deleted\n"), nname)); /* someone deleted this file/dir outside of emulation.. */ buf[0] = 0; xfree (nname); @@ -125,7 +125,7 @@ void fsdb_clean_dir (a_inode *dir) if (!dir->nname) return; n = build_nname (dir->nname, FSDB_FILE); - f = _tfopen (n, L"r+b"); + f = _tfopen (n, _T("r+b")); if (f == 0) { xfree (n); return; @@ -176,7 +176,7 @@ a_inode *fsdb_lookup_aino_aname (a_inode *base, const TCHAR *aname) { FILE *f; - f = get_fsdb (base, L"r+b"); + f = get_fsdb (base, _T("r+b")); if (f == 0) { if (currprefs.filesys_custom_uaefsdb && (base->volflags & MYVOLUMEINFO_STREAMS)) return custom_fsdb_lookup_aino_aname (base, aname); @@ -205,7 +205,7 @@ a_inode *fsdb_lookup_aino_nname (a_inode *base, const TCHAR *nname) FILE *f; char *s; - f = get_fsdb (base, L"r+b"); + f = get_fsdb (base, _T("r+b")); if (f == 0) { if (currprefs.filesys_custom_uaefsdb && (base->volflags & MYVOLUMEINFO_STREAMS)) return custom_fsdb_lookup_aino_nname (base, nname); @@ -233,7 +233,7 @@ int fsdb_used_as_nname (a_inode *base, const TCHAR *nname) FILE *f; uae_u8 buf[1 + 4 + 257 + 257 + 81]; - f = get_fsdb (base, L"r+b"); + f = get_fsdb (base, _T("r+b")); if (f == 0) { if (currprefs.filesys_custom_uaefsdb && (base->volflags & MYVOLUMEINFO_STREAMS)) return custom_fsdb_used_as_nname (base, nname); @@ -281,12 +281,12 @@ static void write_aino (FILE *f, a_inode *aino) buf[5 + 256] = '\0'; ua_copy ((char*)buf + 5 + 257, 256, nname_begin (aino->nname)); buf[5 + 257 + 256] = '\0'; - ua_copy ((char*)buf + 5 + 2 * 257, 80, aino->comment ? aino->comment : L""); + ua_copy ((char*)buf + 5 + 2 * 257, 80, aino->comment ? aino->comment : _T("")); buf[5 + 2 * 257 + 80] = '\0'; aino->db_offset = ftell (f); fwrite (buf, 1, sizeof buf, f); aino->has_dbentry = aino->needs_dbentry; - TRACE ((L"%d '%s' '%s' written\n", aino->db_offset, aino->aname, aino->nname)); + TRACE ((_T("%d '%s' '%s' written\n"), aino->db_offset, aino->aname, aino->nname)); } /* Write back the db file for a directory. */ @@ -300,7 +300,7 @@ void fsdb_dir_writeback (a_inode *dir) uae_u8 *tmpbuf; int size, i; - TRACE ((L"fsdb writeback %s\n", dir->aname)); + TRACE ((_T("fsdb writeback %s\n"), dir->aname)); /* First pass: clear dirty bits where unnecessary, and see if any work * needs to be done. */ for (aino = dir->child; aino; aino = aino->sibling) { @@ -322,16 +322,16 @@ void fsdb_dir_writeback (a_inode *dir) } if (! entries_needed) { kill_fsdb (dir); - TRACE ((L"fsdb removed\n")); + TRACE ((_T("fsdb removed\n"))); return; } if (! changes_needed) { - TRACE ((L"not modified\n")); + TRACE ((_T("not modified\n"))); return; } - f = get_fsdb (dir, L"r+b"); + f = get_fsdb (dir, _T("r+b")); if (f == 0) { if ((currprefs.filesys_custom_uaefsdb && (dir->volflags & MYVOLUMEINFO_STREAMS)) || currprefs.filesys_no_uaefsdb) { for (aino = dir->child; aino; aino = aino->sibling) { @@ -341,9 +341,9 @@ void fsdb_dir_writeback (a_inode *dir) } return; } - f = get_fsdb (dir, L"w+b"); + f = get_fsdb (dir, _T("w+b")); if (f == 0) { - TRACE ((L"failed\n")); + TRACE ((_T("failed\n"))); /* This shouldn't happen... */ return; } @@ -356,7 +356,7 @@ void fsdb_dir_writeback (a_inode *dir) tmpbuf = (uae_u8*)malloc (size); fread (tmpbuf, 1, size, f); } - TRACE ((L"**** updating '%s' %d\n", dir->aname, size)); + TRACE ((_T("**** updating '%s' %d\n"), dir->aname, size)); for (aino = dir->child; aino; aino = aino->sibling) { if (! aino->dirty) @@ -382,7 +382,7 @@ void fsdb_dir_writeback (a_inode *dir) } write_aino (f, aino); } - TRACE ((L"end\n")); + TRACE ((_T("end\n"))); fclose (f); xfree (tmpbuf); } diff --git a/fsusage.cpp b/fsusage.cpp index 1d02f84a..13b1db33 100644 --- a/fsusage.cpp +++ b/fsusage.cpp @@ -55,13 +55,13 @@ int get_fs_usage (const TCHAR *path, const TCHAR *disk, struct fs_usage *fsp) ULARGE_INTEGER FreeBytesAvailable, TotalNumberOfBytes, TotalNumberOfFreeBytes; if (!GetFullPathName (path, sizeof buf2 / sizeof (TCHAR), buf2, NULL)) { - write_log (L"GetFullPathName('%s') failed err=%d\n", path, GetLastError ()); + write_log (_T("GetFullPathName('%s') failed err=%d\n"), path, GetLastError ()); return -1; } - if (!_tcsncmp (buf2, L"\\\\", 2)) { + if (!_tcsncmp (buf2, _T("\\\\"), 2)) { TCHAR *p; - _tcscat (buf2, L"\\"); + _tcscat (buf2, _T("\\")); p = _tcschr (buf2 + 2, '\\'); if (!p) return -1; @@ -74,7 +74,7 @@ int get_fs_usage (const TCHAR *path, const TCHAR *disk, struct fs_usage *fsp) } if (!GetDiskFreeSpaceEx (buf2, &FreeBytesAvailable, &TotalNumberOfBytes, &TotalNumberOfFreeBytes)) { - write_log (L"GetDiskFreeSpaceEx('%s') failed err=%d\n", buf2, GetLastError ()); + write_log (_T("GetDiskFreeSpaceEx('%s') failed err=%d\n"), buf2, GetLastError ()); return -1; } diff --git a/gayle.cpp b/gayle.cpp index ca11af81..75e6f7da 100644 --- a/gayle.cpp +++ b/gayle.cpp @@ -236,7 +236,7 @@ static void pcmcia_reset (void) memset (pcmcia_configuration, 0, sizeof pcmcia_configuration); pcmcia_configured = false; if (PCMCIA_LOG > 0) - write_log (L"PCMCIA reset\n"); + write_log (_T("PCMCIA reset\n")); } static uae_u8 checkpcmciaideirq (void) @@ -388,7 +388,7 @@ static void write_gayle_cs (uae_u8 val) /* PCMCIA disable -> enable */ card_trigger (!(gayle_cs & GAYLE_CS_DIS) ? 1 : 0); if (PCMCIA_LOG) - write_log (L"PCMCIA slot: %s PC=%08X\n", !(gayle_cs & 1) ? L"enabled" : L"disabled", M68K_GETPC); + write_log (_T("PCMCIA slot: %s PC=%08X\n"), !(gayle_cs & 1) ? _T("enabled") : _T("disabled"), M68K_GETPC); } } static uae_u8 read_gayle_cs (void) @@ -443,7 +443,7 @@ static void ide_data_ready (void) static void ide_recalibrate (void) { - write_log (L"IDE%d recalibrate\n", ide->num); + write_log (_T("IDE%d recalibrate\n"), ide->num); ide->regs->ide_sector = 0; ide->regs->ide_lcyl = ide->regs->ide_hcyl = 0; ide_interrupt (); @@ -461,7 +461,7 @@ static void ide_identify_drive (void) } memset (buf, 0, ide->blocksize); if (IDE_LOG > 0) - write_log (L"IDE%d identify drive\n", ide->num); + write_log (_T("IDE%d identify drive\n"), ide->num); ide_data_ready (); ide->data_size *= -1; pw (0, 1 << 6); @@ -471,12 +471,12 @@ static void ide_identify_drive (void) pw (4, ide->blocksize * ide->hdhfd.secspertrack_def); pw (5, ide->blocksize); pw (6, ide->hdhfd.secspertrack_def); - ps (10, L"68000", 20); /* serial */ + ps (10, _T("68000"), 20); /* serial */ pw (20, 3); pw (21, ide->blocksize); pw (22, 4); - ps (23, L"0.4", 8); /* firmware revision */ - _stprintf (tmp, L"UAE-IDE %s", ide->hdhfd.hfd.product_id); + ps (23, _T("0.4"), 8); /* firmware revision */ + _stprintf (tmp, _T("UAE-IDE %s"), ide->hdhfd.hfd.product_id); ps (27, tmp, 40); /* model */ pw (47, MAX_IDE_MULTIPLE_SECTORS >> (ide->blocksize / 512 - 1)); /* max sectors in multiple mode */ pw (48, 1); @@ -550,13 +550,13 @@ static void ide_initialize_drive_parameters (void) ide->regs->ide_error |= IDE_ERR_ABRT; ide->status |= IDE_STATUS_ERR; } - write_log (L"IDE%d initialize drive parameters, CYL=%d,SPT=%d,HEAD=%d\n", + write_log (_T("IDE%d initialize drive parameters, CYL=%d,SPT=%d,HEAD=%d\n"), ide->num, ide->hdhfd.cyls, ide->hdhfd.secspertrack, ide->hdhfd.heads); ide_interrupt (); } static void ide_set_multiple_mode (void) { - write_log (L"IDE%d drive multiple mode = %d\n", ide->num, ide->regs->ide_nsector); + write_log (_T("IDE%d drive multiple mode = %d\n"), ide->num, ide->regs->ide_nsector); ide->multiple_mode = ide->regs->ide_nsector; ide_interrupt (); } @@ -565,7 +565,7 @@ static void ide_set_features (void) int type = ide->regs->ide_nsector >> 3; int mode = ide->regs->ide_nsector & 7; - write_log (L"IDE%d set features %02X (%02X)\n", ide->num, ide->regs->ide_feat, ide->regs->ide_nsector); + write_log (_T("IDE%d set features %02X (%02X)\n"), ide->num, ide->regs->ide_feat, ide->regs->ide_nsector); ide_fail (); } @@ -656,7 +656,7 @@ static void check_maxtransfer (int state) ide->maxtransferstate = 1; } else if (ide->maxtransferstate == 2) { // second transfer was started (part of split) - write_log (L"IDE maxtransfer check detected split >256 block transfer\n"); + write_log (_T("IDE maxtransfer check detected split >256 block transfer\n")); ide->maxtransferstate = 0; } else { ide->maxtransferstate = 0; @@ -686,7 +686,7 @@ static void ide_read_sectors (int flags) nsec = get_nsec (lba48); get_lbachs (ide, &lba, &cyl, &head, &sec, lba48); if (IDE_LOG > 0) - write_log (L"IDE%d read off=%d, sec=%d (%d) lba%d\n", ide->num, (uae_u32)lba, nsec, ide->multiple_mode, lba48 ? 48 : 28); + write_log (_T("IDE%d read off=%d, sec=%d (%d) lba%d\n"), ide->num, (uae_u32)lba, nsec, ide->multiple_mode, lba48 ? 48 : 28); if (lba * ide->blocksize >= ide->hdhfd.size) { ide_data_ready (); ide_fail_err (IDE_ERR_IDNF); @@ -720,7 +720,7 @@ static void ide_write_sectors (int flags) return; } if (IDE_LOG > 0) - write_log (L"IDE%d write off=%d, sec=%d (%d) lba%d\n", ide->num, (uae_u32)lba, nsec, ide->multiple_mode, lba48 ? 48 : 28); + write_log (_T("IDE%d write off=%d, sec=%d (%d) lba%d\n"), ide->num, (uae_u32)lba, nsec, ide->multiple_mode, lba48 ? 48 : 28); if (nsec * ide->blocksize > ide->hdhfd.size - lba * ide->blocksize) nsec = (ide->hdhfd.size - lba * ide->blocksize) / ide->blocksize; if (nsec <= 0) { @@ -739,7 +739,7 @@ static void ide_do_command (uae_u8 cmd) int lba48 = ide->lba48; if (IDE_LOG > 1) - write_log (L"**** IDE%d command %02X\n", ide->num, cmd); + write_log (_T("**** IDE%d command %02X\n"), ide->num, cmd); ide->status &= ~ (IDE_STATUS_DRDY | IDE_STATUS_DRQ | IDE_STATUS_ERR); ide->regs->ide_error = 0; @@ -784,7 +784,7 @@ static void ide_do_command (uae_u8 cmd) ide_interrupt (); } else { ide_fail (); - write_log (L"IDE%d: unknown command %x\n", ide->num, cmd); + write_log (_T("IDE%d: unknown command %x\n"), ide->num, cmd); } } @@ -797,10 +797,10 @@ static uae_u16 ide_get_data (void) uae_u16 v; if (IDE_LOG > 4) - write_log (L"IDE%d DATA read\n", ide->num); + write_log (_T("IDE%d DATA read\n"), ide->num); if (ide->data_size == 0) { if (IDE_LOG > 0) - write_log (L"IDE%d DATA read without DRQ!?\n", ide->num); + write_log (_T("IDE%d DATA read without DRQ!?\n"), ide->num); if (ide->hdhfd.size == 0) return 0xffff; return 0; @@ -822,7 +822,7 @@ static uae_u16 ide_get_data (void) if (!dec_nsec (ide->lba48, nsec)) last = true; if (IDE_LOG > 1) - write_log (L"IDE%d read, read %d bytes to buffer\n", ide->num, nsec * ide->blocksize); + write_log (_T("IDE%d read, read %d bytes to buffer\n"), ide->num, nsec * ide->blocksize); } v = ide->secbuf[ide->data_offset + 1] | (ide->secbuf[ide->data_offset + 0] << 8); @@ -839,7 +839,7 @@ static uae_u16 ide_get_data (void) if (ide->data_size == 0) { ide->status &= ~IDE_STATUS_DRQ; if (IDE_LOG > 1) - write_log (L"IDE%d read finished\n", ide->num); + write_log (_T("IDE%d read finished\n"), ide->num); } if (nsec) { put_lbachs (ide, lba, cyl, head, sec, last ? nsec - 1 : nsec, ide->lba48); @@ -863,7 +863,7 @@ static void ide_write_drive (bool last) put_lbachs (ide, lba, cyl, head, sec, last ? nsec - 1 : nsec, ide->lba48); dec_nsec (ide->lba48, nsec); if (IDE_LOG > 1) - write_log (L"IDE%d write interrupt, %d bytes written\n", ide->num, ide->data_offset); + write_log (_T("IDE%d write interrupt, %d bytes written\n"), ide->num, ide->data_offset); ide->data_offset = 0; } @@ -872,10 +872,10 @@ static void ide_put_data (uae_u16 v) int irq = 0; if (IDE_LOG > 4) - write_log (L"IDE%d DATA write %04x %d/%d\n", ide->num, v, ide->data_offset, ide->data_size); + write_log (_T("IDE%d DATA write %04x %d/%d\n"), ide->num, v, ide->data_offset, ide->data_size); if (ide->data_size == 0) { if (IDE_LOG > 0) - write_log (L"IDE%d DATA write without DRQ!?\n", ide->num); + write_log (_T("IDE%d DATA write without DRQ!?\n"), ide->num); return; } ide->secbuf[ide->data_offset + 1] = v & 0xff; @@ -887,7 +887,7 @@ static void ide_put_data (uae_u16 v) ide_write_drive (true); ide->status &= ~IDE_STATUS_DRQ; if (IDE_LOG > 1) - write_log (L"IDE%d write finished\n", ide->num); + write_log (_T("IDE%d write finished\n"), ide->num); } else if (((ide->data_offset % ide->blocksize) == 0) && ((ide->data_offset / ide->blocksize) % ide->data_multi) == 0) { irq = 1; ide_write_drive (false); @@ -973,7 +973,7 @@ static uae_u32 ide_read_reg (int ide_reg) break; } if (IDE_LOG > 2 && ide_reg > 0) - write_log (L"IDE%d register %d->%02X\n", ide->num, ide_reg, (uae_u32)v & 0xff); + write_log (_T("IDE%d register %d->%02X\n"), ide->num, ide_reg, (uae_u32)v & 0xff); return v; } @@ -981,7 +981,7 @@ static void ide_write_reg (int ide_reg, uae_u32 val) { ide->regs->ide_devcon &= ~0x80; /* clear HOB */ if (IDE_LOG > 2 && ide_reg > 0) - write_log (L"IDE%d register %d=%02X\n", ide->num, ide_reg, (uae_u32)val & 0xff); + write_log (_T("IDE%d register %d=%02X\n"), ide->num, ide_reg, (uae_u32)val & 0xff); switch (ide_reg) { case IDE_DRVADDR: @@ -1031,7 +1031,7 @@ static uae_u32 gayle_read2 (uaecptr addr) addr &= 0xffff; if ((IDE_LOG > 2 && (addr != 0x2000 && addr != 0x2001 && addr != 0x2020 && addr != 0x2021 && addr != GAYLE_IRQ_1200)) || IDE_LOG > 4) - write_log (L"IDE_READ %08X PC=%X\n", addr, M68K_GETPC); + write_log (_T("IDE_READ %08X PC=%X\n"), addr, M68K_GETPC); if (currprefs.cs_ide <= 0) { if (addr == 0x201c) // AR1200 IDE detection hack return 0x7f; @@ -1069,7 +1069,7 @@ static void gayle_write2 (uaecptr addr, uae_u32 val) int ide_reg; if ((IDE_LOG > 2 && (addr != 0x2000 && addr != 0x2001 && addr != 0x2020 && addr != 0x2021 && addr != GAYLE_IRQ_1200)) || IDE_LOG > 4) - write_log (L"IDE_WRITE %08X=%02X PC=%X\n", addr, (uae_u32)val & 0xff, M68K_GETPC); + write_log (_T("IDE_WRITE %08X=%02X PC=%X\n"), addr, (uae_u32)val & 0xff, M68K_GETPC); if (currprefs.cs_ide <= 0) return; if (currprefs.cs_ide == IDE_A600A1200) { @@ -1115,18 +1115,18 @@ static int gayle_read (uaecptr addr) v = read_gayle_cs (); got = 1; if (PCMCIA_LOG) - write_log (L"PCMCIA STATUS READ %08X=%02X PC=%08X\n", oaddr, (uae_u32)v & 0xff, M68K_GETPC); + write_log (_T("PCMCIA STATUS READ %08X=%02X PC=%08X\n"), oaddr, (uae_u32)v & 0xff, M68K_GETPC); } else if (addr == GAYLE_CFG_1200) { v = read_gayle_cfg (); got = 1; if (PCMCIA_LOG) - write_log (L"PCMCIA CONFIG READ %08X=%02X PC=%08X\n", oaddr, (uae_u32)v & 0xff, M68K_GETPC); + write_log (_T("PCMCIA CONFIG READ %08X=%02X PC=%08X\n"), oaddr, (uae_u32)v & 0xff, M68K_GETPC); } } if (!got) v = gayle_read2 (addr); if (GAYLE_LOG) - write_log (L"GAYLE_READ %08X=%02X PC=%08X\n", oaddr, (uae_u32)v & 0xff, M68K_GETPC); + write_log (_T("GAYLE_READ %08X=%02X PC=%08X\n"), oaddr, (uae_u32)v & 0xff, M68K_GETPC); return v; } @@ -1156,17 +1156,17 @@ static void gayle_write (uaecptr addr, int val) write_gayle_cs (val); got = 1; if (PCMCIA_LOG > 1) - write_log (L"PCMCIA STATUS WRITE %08X=%02X PC=%08X\n", oaddr, (uae_u32)val & 0xff, M68K_GETPC); + write_log (_T("PCMCIA STATUS WRITE %08X=%02X PC=%08X\n"), oaddr, (uae_u32)val & 0xff, M68K_GETPC); } else if (addr == GAYLE_CFG_1200) { write_gayle_cfg (val); got = 1; if (PCMCIA_LOG > 1) - write_log (L"PCMCIA CONFIG WRITE %08X=%02X PC=%08X\n", oaddr, (uae_u32)val & 0xff, M68K_GETPC); + write_log (_T("PCMCIA CONFIG WRITE %08X=%02X PC=%08X\n"), oaddr, (uae_u32)val & 0xff, M68K_GETPC); } } if (GAYLE_LOG) - write_log (L"GAYLE_WRITE %08X=%02X PC=%08X\n", oaddr, (uae_u32)val & 0xff, M68K_GETPC); + write_log (_T("GAYLE_WRITE %08X=%02X PC=%08X\n"), oaddr, (uae_u32)val & 0xff, M68K_GETPC); if (!got) gayle_write2 (addr, val); } @@ -1181,7 +1181,7 @@ static void REGPARAM3 gayle_bput (uaecptr, uae_u32) REGPARAM; addrbank gayle_bank = { gayle_lget, gayle_wget, gayle_bget, gayle_lput, gayle_wput, gayle_bput, - default_xlate, default_check, NULL, L"Gayle (low)", + default_xlate, default_check, NULL, _T("Gayle (low)"), dummy_lgeti, dummy_wgeti, ABFLAG_IO }; @@ -1307,7 +1307,7 @@ static void REGPARAM3 gayle2_bput (uaecptr, uae_u32) REGPARAM; addrbank gayle2_bank = { gayle2_lget, gayle2_wget, gayle2_bget, gayle2_lput, gayle2_wput, gayle2_bput, - default_xlate, default_check, NULL, L"Gayle (high)", + default_xlate, default_check, NULL, _T("Gayle (high)"), dummy_lgeti, dummy_wgeti, ABFLAG_IO }; @@ -1374,7 +1374,7 @@ static void mbres_write (uaecptr addr, uae_u32 val, int size) addr &= 0xffff; if (MBRES_LOG > 0) - write_log (L"MBRES_WRITE %08X=%08X (%d) PC=%08X S=%d\n", addr, val, size, M68K_GETPC, regs.s); + write_log (_T("MBRES_WRITE %08X=%08X (%d) PC=%08X S=%d\n"), addr, val, size, M68K_GETPC, regs.s); if (1 || regs.s) { /* CPU FC = supervisor only */ uae_u32 addr2 = addr & 3; uae_u32 addr64 = (addr >> 6) & 3; @@ -1439,7 +1439,7 @@ static uae_u32 mbres_read (uaecptr addr, int size) v = 0xff; } if (MBRES_LOG > 0) - write_log (L"MBRES_READ %08X=%08X (%d) PC=%08X S=%d\n", addr, v, size, M68K_GETPC, regs.s); + write_log (_T("MBRES_READ %08X=%08X (%d) PC=%08X S=%d\n"), addr, v, size, M68K_GETPC, regs.s); return v; } @@ -1503,7 +1503,7 @@ static void REGPARAM2 mbres_bput (uaecptr addr, uae_u32 value) addrbank mbres_bank = { mbres_lget, mbres_wget, mbres_bget, mbres_lput, mbres_wput, mbres_bput, - default_xlate, default_check, NULL, L"Motherboard Resources", + default_xlate, default_check, NULL, _T("Motherboard Resources"), dummy_lgeti, dummy_wgeti, ABFLAG_IO }; @@ -1591,11 +1591,11 @@ static uae_u32 gayle_attr_read (uaecptr addr) uae_u8 v = 0; if (PCMCIA_LOG > 1) - write_log (L"PCMCIA ATTR R: %x %x\n", addr, M68K_GETPC); + write_log (_T("PCMCIA ATTR R: %x %x\n"), addr, M68K_GETPC); addr &= 0x80000 - 1; if (addr >= 0x40000) { if (PCMCIA_LOG > 0) - write_log (L"GAYLE: Reset disabled\n"); + write_log (_T("GAYLE: Reset disabled\n")); return v; } if (addr >= pcmcia_attrs_size) @@ -1628,11 +1628,11 @@ static uae_u32 gayle_attr_read (uaecptr addr) static void gayle_attr_write (uaecptr addr, uae_u32 v) { if (PCMCIA_LOG > 1) - write_log (L"PCMCIA ATTR W: %x=%x %x\n", addr, v, M68K_GETPC); + write_log (_T("PCMCIA ATTR W: %x=%x %x\n"), addr, v, M68K_GETPC); addr &= 0x80000 - 1; if (addr >= 0x40000) { if (PCMCIA_LOG > 0) - write_log (L"GAYLE: Reset enabled\n"); + write_log (_T("GAYLE: Reset enabled\n")); pcmcia_reset (); } else if (addr < pcmcia_attrs_size) { if (pcmcia_type == PCMCIA_IDE) { @@ -1643,9 +1643,9 @@ static void gayle_attr_write (uaecptr addr, uae_u32 v) if (v & 0x80) { pcmcia_reset (); } else { - write_log (L"PCMCIA IO configured = %02x\n", v); + write_log (_T("PCMCIA IO configured = %02x\n"), v); if ((v & 0x3f) != 1) - write_log (L"WARNING: Only config index 1 is emulated!\n"); + write_log (_T("WARNING: Only config index 1 is emulated!\n")); pcmcia_configured = true; } } @@ -1923,11 +1923,11 @@ static int initpcmcia (const TCHAR *path, int readonly, int type, int reset) if (!pcmcia_sram->hfd.drive_empty) { pcmcia_common_size = pcmcia_sram->hfd.virtsize; if (pcmcia_sram->hfd.virtsize > 4 * 1024 * 1024) { - write_log (L"PCMCIA SRAM: too large device, %d bytes\n", pcmcia_sram->hfd.virtsize); + write_log (_T("PCMCIA SRAM: too large device, %d bytes\n"), pcmcia_sram->hfd.virtsize); pcmcia_common_size = 4 * 1024 * 1024; } pcmcia_common = xcalloc (uae_u8, pcmcia_common_size); - write_log (L"PCMCIA SRAM: '%s' open, size=%d\n", path, pcmcia_common_size); + write_log (_T("PCMCIA SRAM: '%s' open, size=%d\n"), path, pcmcia_common_size); hdf_read (&pcmcia_sram->hfd, pcmcia_common, 0, pcmcia_common_size); pcmcia_card = 1; initsramattr (pcmcia_common_size, readonly); @@ -1949,7 +1949,7 @@ static int initpcmcia (const TCHAR *path, int readonly, int type, int reset) pcmcia_attrs = xcalloc (uae_u8, pcmcia_attrs_size); pcmcia_type = type; - write_log (L"PCMCIA IDE: '%s' open\n", path); + write_log (_T("PCMCIA IDE: '%s' open\n"), path); pcmcia_card = 1; initscideattr (readonly); if (!(gayle_cs & GAYLE_CS_DIS)) { @@ -1967,7 +1967,7 @@ static uae_u32 gayle_common_read (uaecptr addr) { uae_u8 v = 0; if (PCMCIA_LOG > 2) - write_log (L"PCMCIA COMMON R: %x %x\n", addr, M68K_GETPC); + write_log (_T("PCMCIA COMMON R: %x %x\n"), addr, M68K_GETPC); if (!pcmcia_common_size) return 0; addr -= PCMCIA_COMMON_START & (PCMCIA_COMMON_SIZE - 1); @@ -1980,7 +1980,7 @@ static uae_u32 gayle_common_read (uaecptr addr) static void gayle_common_write (uaecptr addr, uae_u32 v) { if (PCMCIA_LOG > 2) - write_log (L"PCMCIA COMMON W: %x=%x %x\n", addr, v, M68K_GETPC); + write_log (_T("PCMCIA COMMON W: %x=%x %x\n"), addr, v, M68K_GETPC); if (!pcmcia_common_size) return; if (pcmcia_readonly) @@ -2021,7 +2021,7 @@ static uae_u8 *REGPARAM2 gayle_common_xlate (uaecptr addr) static addrbank gayle_common_bank = { gayle_common_lget, gayle_common_wget, gayle_common_bget, gayle_common_lput, gayle_common_wput, gayle_common_bput, - gayle_common_xlate, gayle_common_check, NULL, L"Gayle PCMCIA Common", + gayle_common_xlate, gayle_common_check, NULL, _T("Gayle PCMCIA Common"), gayle_common_lget, gayle_common_wget, ABFLAG_RAM | ABFLAG_SAFE }; @@ -2036,7 +2036,7 @@ static void REGPARAM3 gayle_attr_bput (uaecptr, uae_u32) REGPARAM; addrbank gayle_attr_bank = { gayle_attr_lget, gayle_attr_wget, gayle_attr_bget, gayle_attr_lput, gayle_attr_wput, gayle_attr_bput, - default_xlate, default_check, NULL, L"Gayle PCMCIA Attribute/Misc", + default_xlate, default_check, NULL, _T("Gayle PCMCIA Attribute/Misc"), dummy_lgeti, dummy_wgeti, ABFLAG_IO | ABFLAG_SAFE }; @@ -2227,7 +2227,7 @@ int gayle_add_ide_unit (int ch, TCHAR *path, int blocksize, int readonly, ide = add_ide_unit (ch, path, blocksize, readonly, devname, sectors, surfaces, reserved, bootpri, filesys); if (ide == NULL) return 0; - write_log (L"GAYLE_IDE%d '%s', CHS=%d,%d,%d. %uM. LBA48=%d\n", + write_log (_T("GAYLE_IDE%d '%s', CHS=%d,%d,%d. %uM. LBA48=%d\n"), ch, path, ide->hdhfd.cyls, ide->hdhfd.heads, ide->hdhfd.secspertrack, (int)(ide->hdhfd.size / (1024 * 1024)), ide->lba48); ide->type = IDE_GAYLE; //dumphdf (&ide->hdhfd.hfd); @@ -2278,7 +2278,7 @@ static void initide (void) ide_splitter = 0; if (idedrive[2]->hdhfd.size) { ide_splitter = 1; - write_log (L"IDE splitter enabled\n"); + write_log (_T("IDE splitter enabled\n")); } for (i = 0; i < TOTAL_IDE * 2; i++) idedrive[i]->num = i; @@ -2296,11 +2296,11 @@ void gayle_reset (int hardreset) gary_timeout = 0; gary_toenb = 0; } - _tcscpy (bankname, L"Gayle (low)"); + _tcscpy (bankname, _T("Gayle (low)")); if (currprefs.cs_ide == IDE_A4000) - _tcscpy (bankname, L"A4000 IDE"); + _tcscpy (bankname, _T("A4000 IDE")); if (currprefs.cs_mbdmac == 2) { - _tcscat (bankname, L" + NCR53C710 SCSI"); + _tcscat (bankname, _T(" + NCR53C710 SCSI")); ncr_reset (); } gayle_bank.name = bankname; diff --git a/gfxlib.cpp b/gfxlib.cpp index 29a229c3..684d452c 100644 --- a/gfxlib.cpp +++ b/gfxlib.cpp @@ -65,7 +65,7 @@ static struct uniq_head *find_uniq (uniq_list *a, uae_u32 uniq) while (b && b->uniq != uniq) b = b->next; if (!b) - write_log (L"Couldn't find structure. Bad\n"); + write_log (_T("Couldn't find structure. Bad\n")); return b; } @@ -76,7 +76,7 @@ static struct uniq_head *find_and_rem_uniq (uniq_list *a, uae_u32 uniq) b = &(*b)->next; c = *b; if (!c) - write_log (L"Couldn't find structure. Bad\n"); + write_log (_T("Couldn't find structure. Bad\n")); else *b = c->next; return c; @@ -202,7 +202,7 @@ int GFX_WritePixel(uaecptr rp, int x, int y) int x2, y2; if (bitmap == 0) { - write_log (L"bogus RastPort in WritePixel\n"); + write_log (_T("bogus RastPort in WritePixel\n")); return -1; } @@ -234,7 +234,7 @@ int GFX_WritePixel(uaecptr rp, int x, int y) * suppose if we can't find a ClipRect, we aren't supposed to draw * the dot. */ - /*write_log (L"Weirdness in WritePixel\n");*/ + /*write_log (_T("Weirdness in WritePixel\n"));*/ v = -1; } else if (get_long (cliprect + 8) == 0) { v = GFX_Bitmap_WritePixel(bitmap, x2, y2, rp); @@ -268,7 +268,7 @@ static uae_u32 gfxl_BltClear(void) } if ((mem & 1) != 0 || (count & 1) != 0) - write_log (L"gfx: BltClear called with odd parameters\n"); + write_log (_T("gfx: BltClear called with odd parameters\n")); /* Bit 2 set means use pattern (V36+ only, but we might as well emulate * it always) */ @@ -566,7 +566,7 @@ static void region_splitrects_band(struct RectList *rl, struct BandList *bl) rl->rects[i].MaxY = bl->maxy[j]; break; } - write_log (L"Foo..\n"); + write_log (_T("Foo..\n")); } } qsort(rl->rects, rl->count, sizeof (struct Rectangle), regionrect_cmpfn); @@ -1070,7 +1070,7 @@ static uae_u32 gfxl_perform_regionop(regionop op, int with_rect) rpp = rr; } if (get_long (rpp) != 0) - write_log (L"BUG\n"); + write_log (_T("BUG\n")); } put_word (reg2+0, rl3.bounds.MinX); put_word (reg2+2, rl3.bounds.MinY); @@ -1644,7 +1644,7 @@ void gfxlib_install(void) if (! currprefs.use_gfxlib) return; - write_log (L"Warning: you enabled the graphics.library replacement with -g\n" + write_log (_T("Warning: you enabled the graphics.library replacement with -g\n") "This may be buggy right now, and will not speed things up much.\n"); resname = ds ("UAEgfxlib.resource"); diff --git a/hardfile.cpp b/hardfile.cpp index 1f34e7f7..bd81179e 100644 --- a/hardfile.cpp +++ b/hardfile.cpp @@ -137,7 +137,7 @@ static void getchs2 (struct hardfiledata *hfd, int *cyl, int *cylsec, int *head, static void getchs (struct hardfiledata *hfd, int *cyl, int *cylsec, int *head, int *tracksec) { getchs2 (hfd, cyl, cylsec, head, tracksec); - hf_log (L"CHS: %08X-%08X %d %d %d %d %d\n", + hf_log (_T("CHS: %08X-%08X %d %d %d %d %d\n"), (uae_u32)(hfd->virtsize >> 32),(uae_u32)hfd->virtsize, *cyl, *cylsec, *head, *tracksec); } @@ -317,7 +317,7 @@ static void create_virtual_rdb (struct hardfiledata *hfd, uae_u32 dostype, int b pl(rdb, 39, -1); // res ua_copy ((char*)rdb + 40 * 4, -1, hfd->vendor_id); ua_copy ((char*)rdb + 42 * 4, -1, hfd->product_id); - ua_copy ((char*)rdb + 46 * 4, -1, L"UAE"); + ua_copy ((char*)rdb + 46 * 4, -1, _T("UAE")); rdb_crc (rdb); pl(part, 0, 0x50415254); @@ -387,7 +387,7 @@ int hdf_hd_open (struct hd_hardfiledata *hfd, const TCHAR *path, int blocksize, if (hfd->hfd.heads && hfd->hfd.secspertrack) { uae_u8 buf[512] = { 0 }; hdf_read (&hfd->hfd, buf, 0, 512); - if (buf[0] != 0 && memcmp (buf, L"RDSK", 4)) { + if (buf[0] != 0 && memcmp (buf, _T("RDSK"), 4)) { hfd->hfd.nrcyls = (hfd->hfd.virtsize / blocksize) / (sectors * surfaces); create_virtual_rdb (&hfd->hfd, rl (buf), hfd->bootpri, filesys); while (hfd->hfd.nrcyls * surfaces * sectors > hfd->cyls_def * hfd->secspertrack_def * hfd->heads_def) { @@ -469,8 +469,8 @@ int hdf_open (struct hardfiledata *hfd, const TCHAR *pname) hfd->vhd_sectormapblock = -1; hfd->vhd_bitmapsize = ((hfd->vhd_blocksize / (8 * 512)) + 511) & ~511; } - write_log (L"HDF is VHD %s image, virtual size=%dK\n", - hfd->vhd_type == 2 ? L"fixed" : L"dynamic", + write_log (_T("HDF is VHD %s image, virtual size=%dK\n"), + hfd->vhd_type == 2 ? _T("fixed") : _T("dynamic"), hfd->virtsize / 1024); return 1; nonvhd: @@ -503,7 +503,7 @@ static uae_u64 vhd_read (struct hardfiledata *hfd, void *v, uae_u64 offset, uae_ uae_u64 read; uae_u8 *dataptr = (uae_u8*)v; - //write_log (L"%08x %08x\n", (uae_u32)offset, (uae_u32)len); + //write_log (_T("%08x %08x\n"), (uae_u32)offset, (uae_u32)len); read = 0; if (offset & 511) return read; @@ -525,9 +525,9 @@ static uae_u64 vhd_read (struct hardfiledata *hfd, void *v, uae_u64 offset, uae_ sectormapblock = sectoroffset * (uae_u64)512 + (bitmapoffsetbytes & ~511); if (hfd->vhd_sectormapblock != sectormapblock) { // read sector bitmap - //write_log (L"BM %08x\n", sectormapblock); + //write_log (_T("BM %08x\n"), sectormapblock); if (hdf_read_target (hfd, hfd->vhd_sectormap, sectormapblock, 512) != 512) { - write_log (L"vhd_read: bitmap read error\n"); + write_log (_T("vhd_read: bitmap read error\n")); return read; } hfd->vhd_sectormapblock = sectormapblock; @@ -536,9 +536,9 @@ static uae_u64 vhd_read (struct hardfiledata *hfd, void *v, uae_u64 offset, uae_ if (hfd->vhd_sectormap[bitmapoffsetbytes & 511] & (1 << (7 - (bitmapoffsetbits & 7)))) { // read data block uae_u64 block = sectoroffset * (uae_u64)512 + hfd->vhd_bitmapsize + bitmapoffsetbits * 512; - //write_log (L"DB %08x\n", block); + //write_log (_T("DB %08x\n"), block); if (hdf_read_target (hfd, dataptr, block, 512) != 512) { - write_log (L"vhd_read: data read error\n"); + write_log (_T("vhd_read: data read error\n")); return read; } } else { @@ -563,7 +563,7 @@ static int vhd_write_enlarge (struct hardfiledata *hfd, uae_u32 bamoffset) len = hfd->vhd_blocksize + hfd->vhd_bitmapsize + 512; buf = xcalloc (uae_u8, len); if (!hdf_resize_target (hfd, hfd->physsize + len - 512)) { - write_log (L"vhd_enlarge: failure\n"); + write_log (_T("vhd_enlarge: failure\n")); return 0; } // add footer (same as 512 byte header) @@ -571,7 +571,7 @@ static int vhd_write_enlarge (struct hardfiledata *hfd, uae_u32 bamoffset) v = hdf_write_target (hfd, buf, hfd->vhd_footerblock, len); xfree (buf); if (v != len) { - write_log (L"vhd_enlarge: footer write error\n"); + write_log (_T("vhd_enlarge: footer write error\n")); return 0; } // write new offset to BAM @@ -583,7 +583,7 @@ static int vhd_write_enlarge (struct hardfiledata *hfd, uae_u32 bamoffset) p[3] = block >> 0; // write to disk if (hdf_write_target (hfd, hfd->vhd_header + hfd->vhd_bamoffset, hfd->vhd_bamoffset, hfd->vhd_bamsize) != hfd->vhd_bamsize) { - write_log (L"vhd_enlarge: bam write error\n"); + write_log (_T("vhd_enlarge: bam write error\n")); return 0; } hfd->vhd_footerblock += len - 512; @@ -595,7 +595,7 @@ static uae_u64 vhd_write (struct hardfiledata *hfd, void *v, uae_u64 offset, uae uae_u64 written; uae_u8 *dataptr = (uae_u8*)v; - //write_log (L"%08x %08x\n", (uae_u32)offset, (uae_u32)len); + //write_log (_T("%08x %08x\n"), (uae_u32)offset, (uae_u32)len); written = 0; if (offset & 511) return written; @@ -618,14 +618,14 @@ static uae_u64 vhd_write (struct hardfiledata *hfd, void *v, uae_u64 offset, uae if (hfd->vhd_sectormapblock != sectormapblock) { // read sector bitmap if (hdf_read_target (hfd, hfd->vhd_sectormap, sectormapblock, 512) != 512) { - write_log (L"vhd_write: bitmap read error\n"); + write_log (_T("vhd_write: bitmap read error\n")); return written; } hfd->vhd_sectormapblock = sectormapblock; } // write data if (hdf_write_target (hfd, dataptr, sectoroffset * (uae_u64)512 + hfd->vhd_bitmapsize + bitmapoffsetbits * 512, 512) != 512) { - write_log (L"vhd_write: data write error\n"); + write_log (_T("vhd_write: data write error\n")); return written; } // block already allocated in bitmap? @@ -633,7 +633,7 @@ static uae_u64 vhd_write (struct hardfiledata *hfd, void *v, uae_u64 offset, uae // no, we need to mark it allocated and write the modified bitmap back to the disk hfd->vhd_sectormap[bitmapoffsetbytes & 511] |= (1 << (7 - (bitmapoffsetbits & 7))); if (hdf_write_target (hfd, hfd->vhd_sectormap, sectormapblock, 512) != 512) { - write_log (L"vhd_write: bam write error\n"); + write_log (_T("vhd_write: bam write error\n")); return written; } } @@ -668,7 +668,7 @@ int vhd_create (const TCHAR *name, uae_u64 size, uae_u32 dostype) batsize &= ~511; ret = 0; b = NULL; - zf = zfile_fopen (name, L"wb", 0); + zf = zfile_fopen (name, _T("wb"), 0); if (!zf) goto end; b = xcalloc (uae_u8, 512 + 1024 + batsize + 512); @@ -921,11 +921,11 @@ int hdf_read_rdb (struct hardfiledata *hfd, void *buffer, uae_u64 offset, int le if (buf[0] == 0x39 && buf[1] == 0x10 && buf[2] == 0xd3 && buf[3] == 0x12) { // AdIDE encoded "CPRM" hfd->adide = 1; changed = true; - write_log (L"HDF: adide scrambling detected\n"); + write_log (_T("HDF: adide scrambling detected\n")); } else if (!memcmp (buf, "DRKS", 4)) { hfd->byteswap = 1; changed = true; - write_log (L"HDF: byteswapped RDB detected\n"); + write_log (_T("HDF: byteswapped RDB detected\n")); } if (changed) v = hdf_read (hfd, buffer, offset, len); @@ -981,7 +981,7 @@ int hdf_write (struct hardfiledata *hfd, void *buffer, uae_u64 offset, int len) static uae_u64 cmd_readx (struct hardfiledata *hfd, uae_u8 *dataptr, uae_u64 offset, uae_u64 len) { gui_flicker_led (LED_HD, hfd->unitnum, 1); - hf_log3 (L"cmd_read: %p %04x-%08x (%d) %08x (%d)\n", + hf_log3 (_T("cmd_read: %p %04x-%08x (%d) %08x (%d)\n"), dataptr, (uae_u32)(offset >> 32), (uae_u32)offset, (uae_u32)(offset / hfd->blocksize), (uae_u32)len, (uae_u32)(len / hfd->blocksize)); return hdf_read (hfd, dataptr, offset, len); } @@ -995,7 +995,7 @@ static uae_u64 cmd_read (struct hardfiledata *hfd, uaecptr dataptr, uae_u64 offs static uae_u64 cmd_writex (struct hardfiledata *hfd, uae_u8 *dataptr, uae_u64 offset, uae_u64 len) { gui_flicker_led (LED_HD, hfd->unitnum, 2); - hf_log3 (L"cmd_write: %p %04x-%08x (%d) %08x (%d)\n", + hf_log3 (_T("cmd_write: %p %04x-%08x (%d) %08x (%d)\n"), dataptr, (uae_u32)(offset >> 32), (uae_u32)offset, (uae_u32)(offset / hfd->blocksize), (uae_u32)len, (uae_u32)(len / hfd->blocksize)); return hdf_write (hfd, dataptr, offset, len); } @@ -1138,7 +1138,7 @@ int scsi_emulate (struct hardfiledata *hfd, struct hd_hardfiledata *hdhfd, uae_u } else { getchs (hfd, &cyl, &cylsec, &head, &tracksec); } - //write_log (L"MODE SENSE PC=%d CODE=%d DBD=%d\n", pc, pcode, dbd); + //write_log (_T("MODE SENSE PC=%d CODE=%d DBD=%d\n"), pc, pcode, dbd); p = r; p[0] = 4 - 1; p[1] = 0; @@ -1320,7 +1320,7 @@ nodisk: default: err: - write_log (L"UAEHF: unsupported scsi command 0x%02X\n", cmdbuf[0]); + write_log (_T("UAEHF: unsupported scsi command 0x%02X\n"), cmdbuf[0]); errreq: lr = -1; status = 2; /* CHECK CONDITION */ @@ -1370,28 +1370,28 @@ static int handle_scsi (uaecptr request, struct hardfiledata *hfd) status = 0; memset (reply, 0, sizeof reply); reply_len = 0; sense_len = 0; - scsi_log (L"hdf scsiemu: cmd=%02X,%d flags=%02X sense=%p,%d data=%p,%d\n", + scsi_log (_T("hdf scsiemu: cmd=%02X,%d flags=%02X sense=%p,%d data=%p,%d\n"), cmd, scsi_cmd_len, scsi_flags, scsi_sense, scsi_sense_len, scsi_data, scsi_len); for (i = 0; i < scsi_cmd_len; i++) { cmdbuf[i] = get_byte (scsi_cmd + i); - scsi_log (L"%02X%c", get_byte (scsi_cmd + i), i < scsi_cmd_len - 1 ? '.' : ' '); + scsi_log (_T("%02X%c"), get_byte (scsi_cmd + i), i < scsi_cmd_len - 1 ? '.' : ' '); } - scsi_log (L"\n"); + scsi_log (_T("\n")); status = scsi_emulate (hfd, NULL, cmdbuf, scsi_cmd_len, scsi_data_ptr, &scsi_len, reply, &reply_len, sense, &sense_len); put_word (acmd + 18, status != 0 ? 0 : scsi_cmd_len); /* fake scsi_CmdActual */ put_byte (acmd + 21, status); /* scsi_Status */ if (reply_len > 0) { - scsi_log (L"RD:"); + scsi_log (_T("RD:")); i = 0; while (i < reply_len) { if (i < 24) - scsi_log (L"%02X%c", reply[i], i < reply_len - 1 ? '.' : ' '); + scsi_log (_T("%02X%c"), reply[i], i < reply_len - 1 ? '.' : ' '); put_byte (scsi_data + i, reply[i]); i++; } - scsi_log (L"\n"); + scsi_log (_T("\n")); } i = 0; if (scsi_sense) { @@ -1432,7 +1432,7 @@ void hardfile_do_disk_change (struct uaedev_config_info *uci, int insert) return; uae_sem_wait (&change_sem); hardfpd[fsid].changenum++; - write_log (L"uaehf.device:%d media status=%d changenum=%d\n", fsid, insert, hardfpd[fsid].changenum); + write_log (_T("uaehf.device:%d media status=%d changenum=%d\n"), fsid, insert, hardfpd[fsid].changenum); hfd->drive_empty = newstate; j = 0; while (j < MAX_ASYNC_REQUESTS) { @@ -1455,7 +1455,7 @@ static int add_async_request (struct hardfileprivdata *hfpd, uaecptr request, in if (hfpd->d_request[i] == request) { hfpd->d_request_type[i] = type; hfpd->d_request_data[i] = data; - hf_log (L"old async request %p (%d) added\n", request, type); + hf_log (_T("old async request %p (%d) added\n"), request, type); return 0; } i++; @@ -1466,12 +1466,12 @@ static int add_async_request (struct hardfileprivdata *hfpd, uaecptr request, in hfpd->d_request[i] = request; hfpd->d_request_type[i] = type; hfpd->d_request_data[i] = data; - hf_log (L"async request %p (%d) added (total=%d)\n", request, type, i); + hf_log (_T("async request %p (%d) added (total=%d)\n"), request, type, i); return 0; } i++; } - hf_log (L"async request overflow %p!\n", request); + hf_log (_T("async request overflow %p!\n"), request); return -1; } @@ -1485,19 +1485,19 @@ static int release_async_request (struct hardfileprivdata *hfpd, uaecptr request hfpd->d_request[i] = 0; hfpd->d_request_data[i] = 0; hfpd->d_request_type[i] = 0; - hf_log (L"async request %p removed\n", request); + hf_log (_T("async request %p removed\n"), request); return type; } i++; } - hf_log (L"tried to remove non-existing request %p\n", request); + hf_log (_T("tried to remove non-existing request %p\n"), request); return -1; } static void abort_async (struct hardfileprivdata *hfpd, uaecptr request, int errcode, int type) { int i; - hf_log (L"aborting async request %p\n", request); + hf_log (_T("aborting async request %p\n"), request); i = 0; while (i < MAX_ASYNC_REQUESTS) { if (hfpd->d_request[i] == request && hfpd->d_request_type[i] == ASYNC_REQUEST_TEMP) { @@ -1510,7 +1510,7 @@ static void abort_async (struct hardfileprivdata *hfpd, uaecptr request, int err } i = release_async_request (hfpd, request); if (i >= 0) - hf_log (L"asyncronous request=%08X aborted, error=%d\n", request, errcode); + hf_log (_T("asyncronous request=%08X aborted, error=%d\n"), request, errcode); } static void *hardfile_thread (void *devs); @@ -1524,7 +1524,7 @@ static int start_thread (TrapContext *context, int unit) hfpd->base = m68k_areg (regs, 6); init_comm_pipe (&hfpd->requests, 100, 1); uae_sem_init (&hfpd->sync_sem, 0, 0); - uae_start_thread (L"hardfile", hardfile_thread, hfpd, NULL); + uae_start_thread (_T("hardfile"), hardfile_thread, hfpd, NULL); uae_sem_wait (&hfpd->sync_sem); return hfpd->thread_running; } @@ -1558,7 +1558,7 @@ static uae_u32 REGPARAM2 hardfile_open (TrapContext *context) put_long (ioreq + 24, unit); /* io_Unit */ put_byte (ioreq + 31, 0); /* io_Error */ put_byte (ioreq + 8, 7); /* ln_type = NT_REPLYMSG */ - hf_log (L"hardfile_open, unit %d (%d), OK\n", unit, m68k_dreg (regs, 0)); + hf_log (_T("hardfile_open, unit %d (%d), OK\n"), unit, m68k_dreg (regs, 0)); return 0; } } @@ -1567,7 +1567,7 @@ static uae_u32 REGPARAM2 hardfile_open (TrapContext *context) } else { err = IOERR_BADLENGTH; } - hf_log (L"hardfile_open, unit %d (%d), ERR=%d\n", unit, m68k_dreg (regs, 0), err); + hf_log (_T("hardfile_open, unit %d (%d), ERR=%d\n"), unit, m68k_dreg (regs, 0), err); put_long (ioreq + 20, (uae_u32)err); put_byte (ioreq + 31, (uae_u8)err); return (uae_u32)err; @@ -1594,13 +1594,13 @@ static uae_u32 REGPARAM2 hardfile_expunge (TrapContext *context) static void outofbounds (int cmd, uae_u64 offset, uae_u64 len, uae_u64 max) { - write_log (L"UAEHF: cmd %d: out of bounds, %08X-%08X + %08X-%08X > %08X-%08X\n", cmd, + write_log (_T("UAEHF: cmd %d: out of bounds, %08X-%08X + %08X-%08X > %08X-%08X\n"), cmd, (uae_u32)(offset >> 32),(uae_u32)offset,(uae_u32)(len >> 32),(uae_u32)len, (uae_u32)(max >> 32),(uae_u32)max); } static void unaligned (int cmd, uae_u64 offset, uae_u64 len, int blocksize) { - write_log (L"UAEHF: cmd %d: unaligned access, %08X-%08X, %08X-%08X, %08X\n", cmd, + write_log (_T("UAEHF: cmd %d: unaligned access, %08X-%08X, %08X-%08X, %08X\n"), cmd, (uae_u32)(offset >> 32),(uae_u32)offset,(uae_u32)(len >> 32),(uae_u32)len, blocksize); } @@ -1803,7 +1803,7 @@ no_disk: error = handle_scsi (request, hfd); } else { /* we don't want users trashing their "partition" hardfiles with hdtoolbox */ error = IOERR_NOCMD; - write_log (L"UAEHF: HD_SCSICMD tried on regular HDF, unit %d\n", unit); + write_log (_T("UAEHF: HD_SCSICMD tried on regular HDF, unit %d\n"), unit); } break; @@ -1815,7 +1815,7 @@ no_disk: put_long (request + 32, actual); put_byte (request + 31, error); - hf_log2 (L"hf: unit=%d, request=%p, cmd=%d offset=%u len=%d, actual=%d error%=%d\n", unit, request, + hf_log2 (_T("hf: unit=%d, request=%p, cmd=%d offset=%u len=%d, actual=%d error%=%d\n"), unit, request, get_word (request + 28), get_long (request + 44), get_long (request + 36), actual, error); return async; @@ -1828,15 +1828,15 @@ static uae_u32 REGPARAM2 hardfile_abortio (TrapContext *context) struct hardfiledata *hfd = get_hardfile_data (unit); struct hardfileprivdata *hfpd = &hardfpd[unit]; - hf_log2 (L"uaehf.device abortio "); + hf_log2 (_T("uaehf.device abortio ")); start_thread (context, unit); if (!hfd || !hfpd || !hfpd->thread_running) { put_byte (request + 31, 32); - hf_log2 (L"error\n"); + hf_log2 (_T("error\n")); return get_byte (request + 31); } put_byte (request + 31, -2); - hf_log2 (L"unit=%d, request=%08X\n", unit, request); + hf_log2 (_T("unit=%d, request=%08X\n"), unit, request); abort_async (hfpd, request, -2, 0); return 0; } @@ -1883,12 +1883,12 @@ static uae_u32 REGPARAM2 hardfile_beginio (TrapContext *context) } put_byte (request + 31, 0); if ((flags & 1) && hardfile_canquick (hfd, request)) { - hf_log (L"hf quickio unit=%d request=%p cmd=%d\n", unit, request, cmd); + hf_log (_T("hf quickio unit=%d request=%p cmd=%d\n"), unit, request, cmd); if (hardfile_do_io (hfd, hfpd, request)) - hf_log2 (L"uaehf.device cmd %d bug with IO_QUICK\n", cmd); + hf_log2 (_T("uaehf.device cmd %d bug with IO_QUICK\n"), cmd); return get_byte (request + 31); } else { - hf_log2 (L"hf asyncio unit=%d request=%p cmd=%d\n", unit, request, cmd); + hf_log2 (_T("hf asyncio unit=%d request=%p cmd=%d\n"), unit, request, cmd); add_async_request (hfpd, request, ASYNC_REQUEST_TEMP, 0); put_byte (request + 30, get_byte (request + 30) & ~1); write_comm_pipe_u32 (&hfpd->requests, request, 1); @@ -1916,7 +1916,7 @@ static void *hardfile_thread (void *devs) release_async_request (hfpd, request); uae_ReplyMsg (request); } else { - hf_log2 (L"async request %08X\n", request); + hf_log2 (_T("async request %08X\n"), request); } uae_sem_post (&change_sem); } @@ -1948,8 +1948,8 @@ void hardfile_install (void) uae_sem_init (&change_sem, 0, 1); - ROM_hardfile_resname = ds (L"uaehf.device"); - ROM_hardfile_resid = ds (L"UAE hardfile.device 0.2"); + ROM_hardfile_resname = ds (_T("uaehf.device")); + ROM_hardfile_resid = ds (_T("UAE hardfile.device 0.2")); nscmd_cmd = here (); dw (NSCMD_DEVICEQUERY); diff --git a/identify.cpp b/identify.cpp index 6172bb0d..12886d2b 100644 --- a/identify.cpp +++ b/identify.cpp @@ -15,99 +15,99 @@ const struct mem_labels int_labels[] = { - { L"Reset:SSP", 0x0000 }, - { L"EXECBASE", 0x0004 }, - { L"BUS ERROR", 0x0008 }, - { L"ADR ERROR", 0x000C }, - { L"ILLEG OPC", 0x0010 }, - { L"DIV BY 0", 0x0014 }, - { L"CHK", 0x0018 }, - { L"TRAPV", 0x001C }, - { L"PRIVIL VIO", 0x0020 }, - { L"TRACE", 0x0024 }, - { L"LINEA EMU", 0x0028 }, - { L"LINEF EMU", 0x002C }, - { L"INT Uninit", 0x003C }, - { L"INT Unjust", 0x0060 }, - { L"Lvl 1 Int", 0x0064 }, - { L"Lvl 2 Int", 0x0068 }, - { L"Lvl 3 Int", 0x006C }, - { L"Lvl 4 Int", 0x0070 }, - { L"Lvl 5 Int", 0x0074 }, - { L"Lvl 6 Int", 0x0078 }, - { L"NMI", 0x007C }, + { _T("Reset:SSP"), 0x0000 }, + { _T("EXECBASE"), 0x0004 }, + { _T("BUS ERROR"), 0x0008 }, + { _T("ADR ERROR"), 0x000C }, + { _T("ILLEG OPC"), 0x0010 }, + { _T("DIV BY 0"), 0x0014 }, + { _T("CHK"), 0x0018 }, + { _T("TRAPV"), 0x001C }, + { _T("PRIVIL VIO"), 0x0020 }, + { _T("TRACE"), 0x0024 }, + { _T("LINEA EMU"), 0x0028 }, + { _T("LINEF EMU"), 0x002C }, + { _T("INT Uninit"), 0x003C }, + { _T("INT Unjust"), 0x0060 }, + { _T("Lvl 1 Int"), 0x0064 }, + { _T("Lvl 2 Int"), 0x0068 }, + { _T("Lvl 3 Int"), 0x006C }, + { _T("Lvl 4 Int"), 0x0070 }, + { _T("Lvl 5 Int"), 0x0074 }, + { _T("Lvl 6 Int"), 0x0078 }, + { _T("NMI"), 0x007C }, { 0, 0 } }; const struct mem_labels trap_labels[] = { - { L"TRAP 00", 0x0080 }, - { L"TRAP 01", 0x0084 }, - { L"TRAP 02", 0x0088 }, - { L"TRAP 03", 0x008C }, - { L"TRAP 04", 0x0090 }, - { L"TRAP 05", 0x0094 }, - { L"TRAP 06", 0x0098 }, - { L"TRAP 07", 0x009C }, - { L"TRAP 08", 0x00A0 }, - { L"TRAP 09", 0x00A4 }, - { L"TRAP 10", 0x00A8 }, - { L"TRAP 11", 0x00AC }, - { L"TRAP 12", 0x00B0 }, - { L"TRAP 13", 0x00B4 }, - { L"TRAP 14", 0x00B8 }, - { L"TRAP 15", 0x00BC }, + { _T("TRAP 00"), 0x0080 }, + { _T("TRAP 01"), 0x0084 }, + { _T("TRAP 02"), 0x0088 }, + { _T("TRAP 03"), 0x008C }, + { _T("TRAP 04"), 0x0090 }, + { _T("TRAP 05"), 0x0094 }, + { _T("TRAP 06"), 0x0098 }, + { _T("TRAP 07"), 0x009C }, + { _T("TRAP 08"), 0x00A0 }, + { _T("TRAP 09"), 0x00A4 }, + { _T("TRAP 10"), 0x00A8 }, + { _T("TRAP 11"), 0x00AC }, + { _T("TRAP 12"), 0x00B0 }, + { _T("TRAP 13"), 0x00B4 }, + { _T("TRAP 14"), 0x00B8 }, + { _T("TRAP 15"), 0x00BC }, { 0, 0 } }; const struct mem_labels mem_labels[] = { - { L"CIAB PRA", 0xBFD000 }, - { L"CIAB PRB", 0xBFD100 }, - { L"CIAB DDRA", 0xBFD200 }, - { L"CIAB DDRB", 0xBFD300 }, - { L"CIAB TALO", 0xBFD400 }, - { L"CIAB TAHI", 0xBFD500 }, - { L"CIAB TBLO", 0xBFD600 }, - { L"CIAB TBHI", 0xBFD700 }, - { L"CIAB TDLO", 0xBFD800 }, - { L"CIAB TDMD", 0xBFD900 }, - { L"CIAB TDHI", 0xBFDA00 }, - { L"CIAB SDR", 0xBFDC00 }, - { L"CIAB ICR", 0xBFDD00 }, - { L"CIAB CRA", 0xBFDE00 }, - { L"CIAB CRB", 0xBFDF00 }, - { L"CIAA PRA", 0xBFE001 }, - { L"CIAA PRB", 0xBFE101 }, - { L"CIAA DDRA", 0xBFE201 }, - { L"CIAA DDRB", 0xBFE301 }, - { L"CIAA TALO", 0xBFE401 }, - { L"CIAA TAHI", 0xBFE501 }, - { L"CIAA TBLO", 0xBFE601 }, - { L"CIAA TBHI", 0xBFE701 }, - { L"CIAA TDLO", 0xBFE801 }, - { L"CIAA TDMD", 0xBFE901 }, - { L"CIAA TDHI", 0xBFEA01 }, - { L"CIAA SDR", 0xBFEC01 }, - { L"CIAA ICR", 0xBFED01 }, - { L"CIAA CRA", 0xBFEE01 }, - { L"CIAA CRB", 0xBFEF01 }, - { L"CLK S1", 0xDC0000 }, - { L"CLK S10", 0xDC0004 }, - { L"CLK MI1", 0xDC0008 }, - { L"CLK MI10", 0xDC000C }, - { L"CLK H1", 0xDC0010 }, - { L"CLK H10", 0xDC0014 }, - { L"CLK D1", 0xDC0018 }, - { L"CLK D10", 0xDC001C }, - { L"CLK MO1", 0xDC0020 }, - { L"CLK MO10", 0xDC0024 }, - { L"CLK Y1", 0xDC0028 }, - { L"CLK Y10", 0xDC002E }, - { L"CLK WEEK", 0xDC0030 }, - { L"CLK CD", 0xDC0034 }, - { L"CLK CE", 0xDC0038 }, - { L"CLK CF", 0xDC003C }, + { _T("CIAB PRA"), 0xBFD000 }, + { _T("CIAB PRB"), 0xBFD100 }, + { _T("CIAB DDRA"), 0xBFD200 }, + { _T("CIAB DDRB"), 0xBFD300 }, + { _T("CIAB TALO"), 0xBFD400 }, + { _T("CIAB TAHI"), 0xBFD500 }, + { _T("CIAB TBLO"), 0xBFD600 }, + { _T("CIAB TBHI"), 0xBFD700 }, + { _T("CIAB TDLO"), 0xBFD800 }, + { _T("CIAB TDMD"), 0xBFD900 }, + { _T("CIAB TDHI"), 0xBFDA00 }, + { _T("CIAB SDR"), 0xBFDC00 }, + { _T("CIAB ICR"), 0xBFDD00 }, + { _T("CIAB CRA"), 0xBFDE00 }, + { _T("CIAB CRB"), 0xBFDF00 }, + { _T("CIAA PRA"), 0xBFE001 }, + { _T("CIAA PRB"), 0xBFE101 }, + { _T("CIAA DDRA"), 0xBFE201 }, + { _T("CIAA DDRB"), 0xBFE301 }, + { _T("CIAA TALO"), 0xBFE401 }, + { _T("CIAA TAHI"), 0xBFE501 }, + { _T("CIAA TBLO"), 0xBFE601 }, + { _T("CIAA TBHI"), 0xBFE701 }, + { _T("CIAA TDLO"), 0xBFE801 }, + { _T("CIAA TDMD"), 0xBFE901 }, + { _T("CIAA TDHI"), 0xBFEA01 }, + { _T("CIAA SDR"), 0xBFEC01 }, + { _T("CIAA ICR"), 0xBFED01 }, + { _T("CIAA CRA"), 0xBFEE01 }, + { _T("CIAA CRB"), 0xBFEF01 }, + { _T("CLK S1"), 0xDC0000 }, + { _T("CLK S10"), 0xDC0004 }, + { _T("CLK MI1"), 0xDC0008 }, + { _T("CLK MI10"), 0xDC000C }, + { _T("CLK H1"), 0xDC0010 }, + { _T("CLK H10"), 0xDC0014 }, + { _T("CLK D1"), 0xDC0018 }, + { _T("CLK D10"), 0xDC001C }, + { _T("CLK MO1"), 0xDC0020 }, + { _T("CLK MO10"), 0xDC0024 }, + { _T("CLK Y1"), 0xDC0028 }, + { _T("CLK Y10"), 0xDC002E }, + { _T("CLK WEEK"), 0xDC0030 }, + { _T("CLK CD"), 0xDC0034 }, + { _T("CLK CE"), 0xDC0038 }, + { _T("CLK CF"), 0xDC003C }, { NULL, 0 } }; @@ -117,285 +117,285 @@ const struct mem_labels mem_labels[] = const struct customData custd[] = { #if 0 - { L"BLTDDAT", 0xdff000 }, /* Blitter dest. early read (dummy address) */ + { _T("BLTDDAT"), 0xdff000 }, /* Blitter dest. early read (dummy address) */ #endif - { L"DMACONR", 0xdff002, 1 }, /* Dma control (and blitter status) read */ - { L"VPOSR", 0xdff004, 1 }, /* Read vert most sig. bits (and frame flop */ - { L"VHPOSR", 0xdff006, 1 }, /* Read vert and horiz position of beam */ + { _T("DMACONR"), 0xdff002, 1 }, /* Dma control (and blitter status) read */ + { _T("VPOSR"), 0xdff004, 1 }, /* Read vert most sig. bits (and frame flop */ + { _T("VHPOSR"), 0xdff006, 1 }, /* Read vert and horiz position of beam */ #if 0 - { L"DSKDATR", 0xdff008 }, /* Disk data early read (dummy address) */ + { _T("DSKDATR"), 0xdff008 }, /* Disk data early read (dummy address) */ #endif - { L"JOY0DAT", 0xdff00A, 1 }, /* Joystick-mouse 0 data (vert,horiz) */ - { L"JOT1DAT", 0xdff00C, 1 }, /* Joystick-mouse 1 data (vert,horiz) */ - { L"CLXDAT", 0xdff00E, 1 }, /* Collision data reg. (read and clear) */ - { L"ADKCONR", 0xdff010, 1 }, /* Audio,disk control register read */ - { L"POT0DAT", 0xdff012, 1 }, /* Pot counter pair 0 data (vert,horiz) */ - { L"POT1DAT", 0xdff014, 1 }, /* Pot counter pair 1 data (vert,horiz) */ - { L"POTGOR", 0xdff016, 1 }, /* Pot pin data read */ - { L"SERDATR", 0xdff018, 1 }, /* Serial port data and status read */ - { L"DSKBYTR", 0xdff01A, 1 }, /* Disk data byte and status read */ - { L"INTENAR", 0xdff01C, 1 }, /* Interrupt enable bits read */ - { L"INTREQR", 0xdff01E, 1 }, /* Interrupt request bits read */ - { L"DSKPTH", 0xdff020, 2, 1 }, /* Disk pointer (high 5 bits) */ - { L"DSKPTL", 0xdff022, 2, 2 }, /* Disk pointer (low 15 bits) */ - { L"DSKLEN", 0xdff024, 2, 0 }, /* Disk lentgh */ + { _T("JOY0DAT"), 0xdff00A, 1 }, /* Joystick-mouse 0 data (vert,horiz) */ + { _T("JOT1DAT"), 0xdff00C, 1 }, /* Joystick-mouse 1 data (vert,horiz) */ + { _T("CLXDAT"), 0xdff00E, 1 }, /* Collision data reg. (read and clear) */ + { _T("ADKCONR"), 0xdff010, 1 }, /* Audio,disk control register read */ + { _T("POT0DAT"), 0xdff012, 1 }, /* Pot counter pair 0 data (vert,horiz) */ + { _T("POT1DAT"), 0xdff014, 1 }, /* Pot counter pair 1 data (vert,horiz) */ + { _T("POTGOR"), 0xdff016, 1 }, /* Pot pin data read */ + { _T("SERDATR"), 0xdff018, 1 }, /* Serial port data and status read */ + { _T("DSKBYTR"), 0xdff01A, 1 }, /* Disk data byte and status read */ + { _T("INTENAR"), 0xdff01C, 1 }, /* Interrupt enable bits read */ + { _T("INTREQR"), 0xdff01E, 1 }, /* Interrupt request bits read */ + { _T("DSKPTH"), 0xdff020, 2, 1 }, /* Disk pointer (high 5 bits) */ + { _T("DSKPTL"), 0xdff022, 2, 2 }, /* Disk pointer (low 15 bits) */ + { _T("DSKLEN"), 0xdff024, 2, 0 }, /* Disk lentgh */ #if 0 - { L"DSKDAT", 0xdff026 }, /* Disk DMA data write */ - { L"REFPTR", 0xdff028 }, /* Refresh pointer */ + { _T("DSKDAT"), 0xdff026 }, /* Disk DMA data write */ + { _T("REFPTR"), 0xdff028 }, /* Refresh pointer */ #endif - { L"VPOSW", 0xdff02A, 2, 0 }, /* Write vert most sig. bits(and frame flop) */ - { L"VHPOSW", 0xdff02C, 2, 0 }, /* Write vert and horiz pos of beam */ - { L"COPCON", 0xdff02e, 2, 0 }, /* Coprocessor control reg (CDANG) */ - { L"SERDAT", 0xdff030, 2, 0 }, /* Serial port data and stop bits write */ - { L"SERPER", 0xdff032, 2, 0 }, /* Serial port period and control */ - { L"POTGO", 0xdff034, 2, 0 }, /* Pot count start,pot pin drive enable data */ - { L"JOYTEST", 0xdff036, 2, 0 }, /* Write to all 4 joystick-mouse counters at once */ - { L"STREQU", 0xdff038, 2, 0 }, /* Strobe for horiz sync with VB and EQU */ - { L"STRVBL", 0xdff03A, 2, 0 }, /* Strobe for horiz sync with VB (vert blank) */ - { L"STRHOR", 0xdff03C, 2, 0 }, /* Strobe for horiz sync */ - { L"STRLONG", 0xdff03E, 2, 0 }, /* Strobe for identification of long horiz line */ - { L"BLTCON0", 0xdff040, 2, 0 }, /* Blitter control reg 0 */ - { L"BLTCON1", 0xdff042, 2, 0 }, /* Blitter control reg 1 */ - { L"BLTAFWM", 0xdff044, 2, 0 }, /* Blitter first word mask for source A */ - { L"BLTALWM", 0xdff046, 2, 0 }, /* Blitter last word mask for source A */ - { L"BLTCPTH", 0xdff048, 2, 1 }, /* Blitter pointer to source C (high 5 bits) */ - { L"BLTCPTL", 0xdff04A, 2, 2 }, /* Blitter pointer to source C (low 15 bits) */ - { L"BLTBPTH", 0xdff04C, 2, 1 }, /* Blitter pointer to source B (high 5 bits) */ - { L"BLTBPTL", 0xdff04E, 2, 2 }, /* Blitter pointer to source B (low 15 bits) */ - { L"BLTAPTH", 0xdff050, 2, 1 }, /* Blitter pointer to source A (high 5 bits) */ - { L"BLTAPTL", 0xdff052, 2, 2 }, /* Blitter pointer to source A (low 15 bits) */ - { L"BPTDPTH", 0xdff054, 2, 1 }, /* Blitter pointer to destn D (high 5 bits) */ - { L"BLTDPTL", 0xdff056, 2, 2 }, /* Blitter pointer to destn D (low 15 bits) */ - { L"BLTSIZE", 0xdff058, 2, 0 }, /* Blitter start and size (win/width,height) */ - { L"BLTCON0L", 0xdff05A, 2, 4 }, /* Blitter control 0 lower 8 bits (minterms) */ - { L"BLTSIZV", 0xdff05C, 2, 4 }, /* Blitter V size (for 15 bit vert size) */ - { L"BLTSIZH", 0xdff05E, 2, 4 }, /* Blitter H size & start (for 11 bit H size) */ - { L"BLTCMOD", 0xdff060, 2, 0 }, /* Blitter modulo for source C */ - { L"BLTBMOD", 0xdff062, 2, 0 }, /* Blitter modulo for source B */ - { L"BLTAMOD", 0xdff064, 2, 0 }, /* Blitter modulo for source A */ - { L"BLTDMOD", 0xdff066, 2, 0 }, /* Blitter modulo for destn D */ + { _T("VPOSW"), 0xdff02A, 2, 0 }, /* Write vert most sig. bits(and frame flop) */ + { _T("VHPOSW"), 0xdff02C, 2, 0 }, /* Write vert and horiz pos of beam */ + { _T("COPCON"), 0xdff02e, 2, 0 }, /* Coprocessor control reg (CDANG) */ + { _T("SERDAT"), 0xdff030, 2, 0 }, /* Serial port data and stop bits write */ + { _T("SERPER"), 0xdff032, 2, 0 }, /* Serial port period and control */ + { _T("POTGO"), 0xdff034, 2, 0 }, /* Pot count start,pot pin drive enable data */ + { _T("JOYTEST"), 0xdff036, 2, 0 }, /* Write to all 4 joystick-mouse counters at once */ + { _T("STREQU"), 0xdff038, 2, 0 }, /* Strobe for horiz sync with VB and EQU */ + { _T("STRVBL"), 0xdff03A, 2, 0 }, /* Strobe for horiz sync with VB (vert blank) */ + { _T("STRHOR"), 0xdff03C, 2, 0 }, /* Strobe for horiz sync */ + { _T("STRLONG"), 0xdff03E, 2, 0 }, /* Strobe for identification of long horiz line */ + { _T("BLTCON0"), 0xdff040, 2, 0 }, /* Blitter control reg 0 */ + { _T("BLTCON1"), 0xdff042, 2, 0 }, /* Blitter control reg 1 */ + { _T("BLTAFWM"), 0xdff044, 2, 0 }, /* Blitter first word mask for source A */ + { _T("BLTALWM"), 0xdff046, 2, 0 }, /* Blitter last word mask for source A */ + { _T("BLTCPTH"), 0xdff048, 2, 1 }, /* Blitter pointer to source C (high 5 bits) */ + { _T("BLTCPTL"), 0xdff04A, 2, 2 }, /* Blitter pointer to source C (low 15 bits) */ + { _T("BLTBPTH"), 0xdff04C, 2, 1 }, /* Blitter pointer to source B (high 5 bits) */ + { _T("BLTBPTL"), 0xdff04E, 2, 2 }, /* Blitter pointer to source B (low 15 bits) */ + { _T("BLTAPTH"), 0xdff050, 2, 1 }, /* Blitter pointer to source A (high 5 bits) */ + { _T("BLTAPTL"), 0xdff052, 2, 2 }, /* Blitter pointer to source A (low 15 bits) */ + { _T("BPTDPTH"), 0xdff054, 2, 1 }, /* Blitter pointer to destn D (high 5 bits) */ + { _T("BLTDPTL"), 0xdff056, 2, 2 }, /* Blitter pointer to destn D (low 15 bits) */ + { _T("BLTSIZE"), 0xdff058, 2, 0 }, /* Blitter start and size (win/width,height) */ + { _T("BLTCON0L"), 0xdff05A, 2, 4 }, /* Blitter control 0 lower 8 bits (minterms) */ + { _T("BLTSIZV"), 0xdff05C, 2, 4 }, /* Blitter V size (for 15 bit vert size) */ + { _T("BLTSIZH"), 0xdff05E, 2, 4 }, /* Blitter H size & start (for 11 bit H size) */ + { _T("BLTCMOD"), 0xdff060, 2, 0 }, /* Blitter modulo for source C */ + { _T("BLTBMOD"), 0xdff062, 2, 0 }, /* Blitter modulo for source B */ + { _T("BLTAMOD"), 0xdff064, 2, 0 }, /* Blitter modulo for source A */ + { _T("BLTDMOD"), 0xdff066, 2, 0 }, /* Blitter modulo for destn D */ #if 0 - { L"Unknown", 0xdff068 }, /* Unknown or Unused */ - { L"Unknown", 0xdff06a }, /* Unknown or Unused */ - { L"Unknown", 0xdff06c }, /* Unknown or Unused */ - { L"Unknown", 0xdff06e }, /* Unknown or Unused */ + { _T("Unknown"), 0xdff068 }, /* Unknown or Unused */ + { _T("Unknown"), 0xdff06a }, /* Unknown or Unused */ + { _T("Unknown"), 0xdff06c }, /* Unknown or Unused */ + { _T("Unknown"), 0xdff06e }, /* Unknown or Unused */ #endif - { L"BLTCDAT", 0xdff070, 2, 0 }, /* Blitter source C data reg */ - { L"BLTBDAT", 0xdff072, 2, 0 }, /* Blitter source B data reg */ - { L"BLTADAT", 0xdff074, 2, 0 }, /* Blitter source A data reg */ - { L"BLTDDAT", 0xdff076, 2, 0 }, /* Blitter destination reg */ + { _T("BLTCDAT"), 0xdff070, 2, 0 }, /* Blitter source C data reg */ + { _T("BLTBDAT"), 0xdff072, 2, 0 }, /* Blitter source B data reg */ + { _T("BLTADAT"), 0xdff074, 2, 0 }, /* Blitter source A data reg */ + { _T("BLTDDAT"), 0xdff076, 2, 0 }, /* Blitter destination reg */ #if 0 - { L"SPRHDAT", 0xdff078 }, /* Ext logic UHRES sprite pointer and data identifier */ - { L"BPLHDAT", 0xdff07A }, /* Ext logic UHRES bit plane identifier */ + { _T("SPRHDAT"), 0xdff078 }, /* Ext logic UHRES sprite pointer and data identifier */ + { _T("BPLHDAT"), 0xdff07A }, /* Ext logic UHRES bit plane identifier */ #endif - { L"LISAID", 0xdff07C, 1, 8 }, /* Chip revision level for Denise/Lisa */ - { L"DSKSYNC", 0xdff07E, 2 }, /* Disk sync pattern reg for disk read */ - { L"COP1LCH", 0xdff080, 2, 1 }, /* Coprocessor first location reg (high 5 bits) */ - { L"COP1LCL", 0xdff082, 2, 2 }, /* Coprocessor first location reg (low 15 bits) */ - { L"COP2LCH", 0xdff084, 2, 1 }, /* Coprocessor second reg (high 5 bits) */ - { L"COP2LCL", 0xdff086, 2, 2 }, /* Coprocessor second reg (low 15 bits) */ - { L"COPJMP1", 0xdff088, 2 }, /* Coprocessor restart at first location */ - { L"COPJMP2", 0xdff08A, 2 }, /* Coprocessor restart at second location */ + { _T("LISAID"), 0xdff07C, 1, 8 }, /* Chip revision level for Denise/Lisa */ + { _T("DSKSYNC"), 0xdff07E, 2 }, /* Disk sync pattern reg for disk read */ + { _T("COP1LCH"), 0xdff080, 2, 1 }, /* Coprocessor first location reg (high 5 bits) */ + { _T("COP1LCL"), 0xdff082, 2, 2 }, /* Coprocessor first location reg (low 15 bits) */ + { _T("COP2LCH"), 0xdff084, 2, 1 }, /* Coprocessor second reg (high 5 bits) */ + { _T("COP2LCL"), 0xdff086, 2, 2 }, /* Coprocessor second reg (low 15 bits) */ + { _T("COPJMP1"), 0xdff088, 2 }, /* Coprocessor restart at first location */ + { _T("COPJMP2"), 0xdff08A, 2 }, /* Coprocessor restart at second location */ #if 0 - { L"COPINS", 0xdff08C }, /* Coprocessor inst fetch identify */ + { _T("COPINS"), 0xdff08C }, /* Coprocessor inst fetch identify */ #endif - { L"DIWSTRT", 0xdff08E, 2 }, /* Display window start (upper left vert-hor pos) */ - { L"DIWSTOP", 0xdff090, 2 }, /* Display window stop (lower right vert-hor pos) */ - { L"DDFSTRT", 0xdff092, 2 }, /* Display bit plane data fetch start.hor pos */ - { L"DDFSTOP", 0xdff094, 2 }, /* Display bit plane data fetch stop.hor pos */ - { L"DMACON", 0xdff096, 2 }, /* DMA control write (clear or set) */ - { L"CLXCON", 0xdff098, 2 }, /* Collision control */ - { L"INTENA", 0xdff09A, 2 }, /* Interrupt enable bits (clear or set bits) */ - { L"INTREQ", 0xdff09C, 2 }, /* Interrupt request bits (clear or set bits) */ - { L"ADKCON", 0xdff09E, 2 }, /* Audio,disk,UART,control */ - { L"AUD0LCH", 0xdff0A0, 2, 1 }, /* Audio channel 0 location (high 5 bits) */ - { L"AUD0LCL", 0xdff0A2, 2, 2 }, /* Audio channel 0 location (low 15 bits) */ - { L"AUD0LEN", 0xdff0A4, 2 }, /* Audio channel 0 lentgh */ - { L"AUD0PER", 0xdff0A6, 2 }, /* Audio channel 0 period */ - { L"AUD0VOL", 0xdff0A8, 2 }, /* Audio channel 0 volume */ - { L"AUD0DAT", 0xdff0AA, 2 }, /* Audio channel 0 data */ + { _T("DIWSTRT"), 0xdff08E, 2 }, /* Display window start (upper left vert-hor pos) */ + { _T("DIWSTOP"), 0xdff090, 2 }, /* Display window stop (lower right vert-hor pos) */ + { _T("DDFSTRT"), 0xdff092, 2 }, /* Display bit plane data fetch start.hor pos */ + { _T("DDFSTOP"), 0xdff094, 2 }, /* Display bit plane data fetch stop.hor pos */ + { _T("DMACON"), 0xdff096, 2 }, /* DMA control write (clear or set) */ + { _T("CLXCON"), 0xdff098, 2 }, /* Collision control */ + { _T("INTENA"), 0xdff09A, 2 }, /* Interrupt enable bits (clear or set bits) */ + { _T("INTREQ"), 0xdff09C, 2 }, /* Interrupt request bits (clear or set bits) */ + { _T("ADKCON"), 0xdff09E, 2 }, /* Audio,disk,UART,control */ + { _T("AUD0LCH"), 0xdff0A0, 2, 1 }, /* Audio channel 0 location (high 5 bits) */ + { _T("AUD0LCL"), 0xdff0A2, 2, 2 }, /* Audio channel 0 location (low 15 bits) */ + { _T("AUD0LEN"), 0xdff0A4, 2 }, /* Audio channel 0 lentgh */ + { _T("AUD0PER"), 0xdff0A6, 2 }, /* Audio channel 0 period */ + { _T("AUD0VOL"), 0xdff0A8, 2 }, /* Audio channel 0 volume */ + { _T("AUD0DAT"), 0xdff0AA, 2 }, /* Audio channel 0 data */ #if 0 - { L"Unknown", 0xdff0AC }, /* Unknown or Unused */ - { L"Unknown", 0xdff0AE }, /* Unknown or Unused */ + { _T("Unknown"), 0xdff0AC }, /* Unknown or Unused */ + { _T("Unknown"), 0xdff0AE }, /* Unknown or Unused */ #endif - { L"AUD1LCH", 0xdff0B0, 2, 1 }, /* Audio channel 1 location (high 5 bits) */ - { L"AUD1LCL", 0xdff0B2, 2, 2 }, /* Audio channel 1 location (low 15 bits) */ - { L"AUD1LEN", 0xdff0B4, 2 }, /* Audio channel 1 lentgh */ - { L"AUD1PER", 0xdff0B6, 2 }, /* Audio channel 1 period */ - { L"AUD1VOL", 0xdff0B8, 2 }, /* Audio channel 1 volume */ - { L"AUD1DAT", 0xdff0BA, 2 }, /* Audio channel 1 data */ + { _T("AUD1LCH"), 0xdff0B0, 2, 1 }, /* Audio channel 1 location (high 5 bits) */ + { _T("AUD1LCL"), 0xdff0B2, 2, 2 }, /* Audio channel 1 location (low 15 bits) */ + { _T("AUD1LEN"), 0xdff0B4, 2 }, /* Audio channel 1 lentgh */ + { _T("AUD1PER"), 0xdff0B6, 2 }, /* Audio channel 1 period */ + { _T("AUD1VOL"), 0xdff0B8, 2 }, /* Audio channel 1 volume */ + { _T("AUD1DAT"), 0xdff0BA, 2 }, /* Audio channel 1 data */ #if 0 - { L"Unknown", 0xdff0BC }, /* Unknown or Unused */ - { L"Unknown", 0xdff0BE }, /* Unknown or Unused */ + { _T("Unknown"), 0xdff0BC }, /* Unknown or Unused */ + { _T("Unknown"), 0xdff0BE }, /* Unknown or Unused */ #endif - { L"AUD2LCH", 0xdff0C0, 2, 1 }, /* Audio channel 2 location (high 5 bits) */ - { L"AUD2LCL", 0xdff0C2, 2, 2 }, /* Audio channel 2 location (low 15 bits) */ - { L"AUD2LEN", 0xdff0C4, 2 }, /* Audio channel 2 lentgh */ - { L"AUD2PER", 0xdff0C6, 2 }, /* Audio channel 2 period */ - { L"AUD2VOL", 0xdff0C8, 2 }, /* Audio channel 2 volume */ - { L"AUD2DAT", 0xdff0CA, 2 }, /* Audio channel 2 data */ + { _T("AUD2LCH"), 0xdff0C0, 2, 1 }, /* Audio channel 2 location (high 5 bits) */ + { _T("AUD2LCL"), 0xdff0C2, 2, 2 }, /* Audio channel 2 location (low 15 bits) */ + { _T("AUD2LEN"), 0xdff0C4, 2 }, /* Audio channel 2 lentgh */ + { _T("AUD2PER"), 0xdff0C6, 2 }, /* Audio channel 2 period */ + { _T("AUD2VOL"), 0xdff0C8, 2 }, /* Audio channel 2 volume */ + { _T("AUD2DAT"), 0xdff0CA, 2 }, /* Audio channel 2 data */ #if 0 - { L"Unknown", 0xdff0CC }, /* Unknown or Unused */ - { L"Unknown", 0xdff0CE }, /* Unknown or Unused */ + { _T("Unknown"), 0xdff0CC }, /* Unknown or Unused */ + { _T("Unknown"), 0xdff0CE }, /* Unknown or Unused */ #endif - { L"AUD3LCH", 0xdff0D0, 2, 1 }, /* Audio channel 3 location (high 5 bits) */ - { L"AUD3LCL", 0xdff0D2, 2, 2 }, /* Audio channel 3 location (low 15 bits) */ - { L"AUD3LEN", 0xdff0D4, 2 }, /* Audio channel 3 lentgh */ - { L"AUD3PER", 0xdff0D6, 2 }, /* Audio channel 3 period */ - { L"AUD3VOL", 0xdff0D8, 2 }, /* Audio channel 3 volume */ - { L"AUD3DAT", 0xdff0DA, 2 }, /* Audio channel 3 data */ + { _T("AUD3LCH"), 0xdff0D0, 2, 1 }, /* Audio channel 3 location (high 5 bits) */ + { _T("AUD3LCL"), 0xdff0D2, 2, 2 }, /* Audio channel 3 location (low 15 bits) */ + { _T("AUD3LEN"), 0xdff0D4, 2 }, /* Audio channel 3 lentgh */ + { _T("AUD3PER"), 0xdff0D6, 2 }, /* Audio channel 3 period */ + { _T("AUD3VOL"), 0xdff0D8, 2 }, /* Audio channel 3 volume */ + { _T("AUD3DAT"), 0xdff0DA, 2 }, /* Audio channel 3 data */ #if 0 - { L"Unknown", 0xdff0DC }, /* Unknown or Unused */ - { L"Unknown", 0xdff0DE }, /* Unknown or Unused */ + { _T("Unknown"), 0xdff0DC }, /* Unknown or Unused */ + { _T("Unknown"), 0xdff0DE }, /* Unknown or Unused */ #endif - { L"BPL1PTH", 0xdff0E0, 2, 1 }, /* Bit plane pointer 1 (high 5 bits) */ - { L"BPL1PTL", 0xdff0E2, 2, 2 }, /* Bit plane pointer 1 (low 15 bits) */ - { L"BPL2PTH", 0xdff0E4, 2, 1 }, /* Bit plane pointer 2 (high 5 bits) */ - { L"BPL2PTL", 0xdff0E6, 2, 2 }, /* Bit plane pointer 2 (low 15 bits) */ - { L"BPL3PTH", 0xdff0E8, 2, 1 }, /* Bit plane pointer 3 (high 5 bits) */ - { L"BPL3PTL", 0xdff0EA, 2, 2 }, /* Bit plane pointer 3 (low 15 bits) */ - { L"BPL4PTH", 0xdff0EC, 2, 1 }, /* Bit plane pointer 4 (high 5 bits) */ - { L"BPL4PTL", 0xdff0EE, 2, 2 }, /* Bit plane pointer 4 (low 15 bits) */ - { L"BPL5PTH", 0xdff0F0, 2, 1 }, /* Bit plane pointer 5 (high 5 bits) */ - { L"BPL5PTL", 0xdff0F2, 2, 2 }, /* Bit plane pointer 5 (low 15 bits) */ - { L"BPL6PTH", 0xdff0F4, 2, 1|8 }, /* Bit plane pointer 6 (high 5 bits) */ - { L"BPL6PTL", 0xdff0F6, 2, 2|8 }, /* Bit plane pointer 6 (low 15 bits) */ - { L"BPL7PTH", 0xdff0F8, 2, 1|8 }, /* Bit plane pointer 7 (high 5 bits) */ - { L"BPL7PTL", 0xdff0FA, 2, 2|8 }, /* Bit plane pointer 7 (low 15 bits) */ - { L"BPL8PTH", 0xdff0FC, 2, 1|8 }, /* Bit plane pointer 8 (high 5 bits) */ - { L"BPL8PTL", 0xdff0FE, 2, 2|8 }, /* Bit plane pointer 8 (low 15 bits) */ - { L"BPLCON0", 0xdff100, 2 }, /* Bit plane control reg (misc control bits) */ - { L"BPLCON1", 0xdff102, 2 }, /* Bit plane control reg (scroll val PF1,PF2) */ - { L"BPLCON2", 0xdff104, 2 }, /* Bit plane control reg (priority control) */ - { L"BPLCON3", 0xdff106, 2|8 }, /* Bit plane control reg (enhanced features) */ - { L"BPL1MOD", 0xdff108, 2 }, /* Bit plane modulo (odd planes,or active- fetch lines if bitplane scan-doubling is enabled */ - { L"BPL2MOD", 0xdff10A, 2 }, /* Bit plane modulo (even planes or inactive- fetch lines if bitplane scan-doubling is enabled */ - { L"BPLCON4", 0xdff10C, 2|8 }, /* Bit plane control reg (bitplane and sprite masks) */ - { L"CLXCON2", 0xdff10e, 2|8 }, /* Extended collision control reg */ - { L"BPL1DAT", 0xdff110, 2 }, /* Bit plane 1 data (parallel to serial con- vert) */ - { L"BPL2DAT", 0xdff112, 2 }, /* Bit plane 2 data (parallel to serial con- vert) */ - { L"BPL3DAT", 0xdff114, 2 }, /* Bit plane 3 data (parallel to serial con- vert) */ - { L"BPL4DAT", 0xdff116, 2 }, /* Bit plane 4 data (parallel to serial con- vert) */ - { L"BPL5DAT", 0xdff118, 2 }, /* Bit plane 5 data (parallel to serial con- vert) */ - { L"BPL6DAT", 0xdff11a, 2 }, /* Bit plane 6 data (parallel to serial con- vert) */ - { L"BPL7DAT", 0xdff11c, 2|8 }, /* Bit plane 7 data (parallel to serial con- vert) */ - { L"BPL8DAT", 0xdff11e, 2|8 }, /* Bit plane 8 data (parallel to serial con- vert) */ - { L"SPR0PTH", 0xdff120, 2, 1 }, /* Sprite 0 pointer (high 5 bits) */ - { L"SPR0PTL", 0xdff122, 2, 2 }, /* Sprite 0 pointer (low 15 bits) */ - { L"SPR1PTH", 0xdff124, 2, 1 }, /* Sprite 1 pointer (high 5 bits) */ - { L"SPR1PTL", 0xdff126, 2, 2 }, /* Sprite 1 pointer (low 15 bits) */ - { L"SPR2PTH", 0xdff128, 2, 1 }, /* Sprite 2 pointer (high 5 bits) */ - { L"SPR2PTL", 0xdff12A, 2, 2 }, /* Sprite 2 pointer (low 15 bits) */ - { L"SPR3PTH", 0xdff12C, 2, 1 }, /* Sprite 3 pointer (high 5 bits) */ - { L"SPR3PTL", 0xdff12E, 2, 2 }, /* Sprite 3 pointer (low 15 bits) */ - { L"SPR4PTH", 0xdff130, 2, 1 }, /* Sprite 4 pointer (high 5 bits) */ - { L"SPR4PTL", 0xdff132, 2, 2 }, /* Sprite 4 pointer (low 15 bits) */ - { L"SPR5PTH", 0xdff134, 2, 1 }, /* Sprite 5 pointer (high 5 bits) */ - { L"SPR5PTL", 0xdff136, 2, 2 }, /* Sprite 5 pointer (low 15 bits) */ - { L"SPR6PTH", 0xdff138, 2, 1 }, /* Sprite 6 pointer (high 5 bits) */ - { L"SPR6PTL", 0xdff13A, 2, 2 }, /* Sprite 6 pointer (low 15 bits) */ - { L"SPR7PTH", 0xdff13C, 2, 1 }, /* Sprite 7 pointer (high 5 bits) */ - { L"SPR7PTL", 0xdff13E, 2, 2 }, /* Sprite 7 pointer (low 15 bits) */ - { L"SPR0POS", 0xdff140, 2 }, /* Sprite 0 vert-horiz start pos data */ - { L"SPR0CTL", 0xdff142, 2 }, /* Sprite 0 position and control data */ - { L"SPR0DATA", 0xdff144, 2 }, /* Sprite 0 image data register A */ - { L"SPR0DATB", 0xdff146, 2 }, /* Sprite 0 image data register B */ - { L"SPR1POS", 0xdff148, 2 }, /* Sprite 1 vert-horiz start pos data */ - { L"SPR1CTL", 0xdff14A, 2 }, /* Sprite 1 position and control data */ - { L"SPR1DATA", 0xdff14C, 2 }, /* Sprite 1 image data register A */ - { L"SPR1DATB", 0xdff14E, 2 }, /* Sprite 1 image data register B */ - { L"SPR2POS", 0xdff150, 2 }, /* Sprite 2 vert-horiz start pos data */ - { L"SPR2CTL", 0xdff152, 2 }, /* Sprite 2 position and control data */ - { L"SPR2DATA", 0xdff154, 2 }, /* Sprite 2 image data register A */ - { L"SPR2DATB", 0xdff156, 2 }, /* Sprite 2 image data register B */ - { L"SPR3POS", 0xdff158, 2 }, /* Sprite 3 vert-horiz start pos data */ - { L"SPR3CTL", 0xdff15A, 2 }, /* Sprite 3 position and control data */ - { L"SPR3DATA", 0xdff15C, 2 }, /* Sprite 3 image data register A */ - { L"SPR3DATB", 0xdff15E, 2 }, /* Sprite 3 image data register B */ - { L"SPR4POS", 0xdff160, 2 }, /* Sprite 4 vert-horiz start pos data */ - { L"SPR4CTL", 0xdff162, 2 }, /* Sprite 4 position and control data */ - { L"SPR4DATA", 0xdff164, 2 }, /* Sprite 4 image data register A */ - { L"SPR4DATB", 0xdff166, 2 }, /* Sprite 4 image data register B */ - { L"SPR5POS", 0xdff168, 2 }, /* Sprite 5 vert-horiz start pos data */ - { L"SPR5CTL", 0xdff16A, 2 }, /* Sprite 5 position and control data */ - { L"SPR5DATA", 0xdff16C, 2 }, /* Sprite 5 image data register A */ - { L"SPR5DATB", 0xdff16E, 2 }, /* Sprite 5 image data register B */ - { L"SPR6POS", 0xdff170, 2 }, /* Sprite 6 vert-horiz start pos data */ - { L"SPR6CTL", 0xdff172, 2 }, /* Sprite 6 position and control data */ - { L"SPR6DATA", 0xdff174, 2 }, /* Sprite 6 image data register A */ - { L"SPR6DATB", 0xdff176, 2 }, /* Sprite 6 image data register B */ - { L"SPR7POS", 0xdff178, 2 }, /* Sprite 7 vert-horiz start pos data */ - { L"SPR7CTL", 0xdff17A, 2 }, /* Sprite 7 position and control data */ - { L"SPR7DATA", 0xdff17C, 2 }, /* Sprite 7 image data register A */ - { L"SPR7DATB", 0xdff17E, 2 }, /* Sprite 7 image data register B */ - { L"COLOR00", 0xdff180, 2 }, /* Color table 00 */ - { L"COLOR01", 0xdff182, 2 }, /* Color table 01 */ - { L"COLOR02", 0xdff184, 2 }, /* Color table 02 */ - { L"COLOR03", 0xdff186, 2 }, /* Color table 03 */ - { L"COLOR04", 0xdff188, 2 }, /* Color table 04 */ - { L"COLOR05", 0xdff18A, 2 }, /* Color table 05 */ - { L"COLOR06", 0xdff18C, 2 }, /* Color table 06 */ - { L"COLOR07", 0xdff18E, 2 }, /* Color table 07 */ - { L"COLOR08", 0xdff190, 2 }, /* Color table 08 */ - { L"COLOR09", 0xdff192, 2 }, /* Color table 09 */ - { L"COLOR10", 0xdff194, 2 }, /* Color table 10 */ - { L"COLOR11", 0xdff196, 2 }, /* Color table 11 */ - { L"COLOR12", 0xdff198, 2 }, /* Color table 12 */ - { L"COLOR13", 0xdff19A, 2 }, /* Color table 13 */ - { L"COLOR14", 0xdff19C, 2 }, /* Color table 14 */ - { L"COLOR15", 0xdff19E, 2 }, /* Color table 15 */ - { L"COLOR16", 0xdff1A0, 2 }, /* Color table 16 */ - { L"COLOR17", 0xdff1A2, 2 }, /* Color table 17 */ - { L"COLOR18", 0xdff1A4, 2 }, /* Color table 18 */ - { L"COLOR19", 0xdff1A6, 2 }, /* Color table 19 */ - { L"COLOR20", 0xdff1A8, 2 }, /* Color table 20 */ - { L"COLOR21", 0xdff1AA, 2 }, /* Color table 21 */ - { L"COLOR22", 0xdff1AC, 2 }, /* Color table 22 */ - { L"COLOR23", 0xdff1AE, 2 }, /* Color table 23 */ - { L"COLOR24", 0xdff1B0, 2 }, /* Color table 24 */ - { L"COLOR25", 0xdff1B2, 2 }, /* Color table 25 */ - { L"COLOR26", 0xdff1B4, 2 }, /* Color table 26 */ - { L"COLOR27", 0xdff1B6, 2 }, /* Color table 27 */ - { L"COLOR28", 0xdff1B8, 2 }, /* Color table 28 */ - { L"COLOR29", 0xdff1BA, 2 }, /* Color table 29 */ - { L"COLOR30", 0xdff1BC, 2 }, /* Color table 30 */ - { L"COLOR31", 0xdff1BE, 2 }, /* Color table 31 */ - { L"HTOTAL", 0xdff1C0, 2|4 }, /* Highest number count in horiz line (VARBEAMEN = 1) */ - { L"HSSTOP", 0xdff1C2, 2|4 }, /* Horiz line pos for HSYNC stop */ - { L"HBSTRT", 0xdff1C4, 2|4 }, /* Horiz line pos for HBLANK start */ - { L"HBSTOP", 0xdff1C6, 2|4 }, /* Horiz line pos for HBLANK stop */ - { L"VTOTAL", 0xdff1C8, 2|4 }, /* Highest numbered vertical line (VARBEAMEN = 1) */ - { L"VSSTOP", 0xdff1CA, 2|4 }, /* Vert line for VBLANK start */ - { L"VBSTRT", 0xdff1CC, 2|4 }, /* Vert line for VBLANK start */ - { L"VBSTOP", 0xdff1CE, 2|4 }, /* Vert line for VBLANK stop */ + { _T("BPL1PTH"), 0xdff0E0, 2, 1 }, /* Bit plane pointer 1 (high 5 bits) */ + { _T("BPL1PTL"), 0xdff0E2, 2, 2 }, /* Bit plane pointer 1 (low 15 bits) */ + { _T("BPL2PTH"), 0xdff0E4, 2, 1 }, /* Bit plane pointer 2 (high 5 bits) */ + { _T("BPL2PTL"), 0xdff0E6, 2, 2 }, /* Bit plane pointer 2 (low 15 bits) */ + { _T("BPL3PTH"), 0xdff0E8, 2, 1 }, /* Bit plane pointer 3 (high 5 bits) */ + { _T("BPL3PTL"), 0xdff0EA, 2, 2 }, /* Bit plane pointer 3 (low 15 bits) */ + { _T("BPL4PTH"), 0xdff0EC, 2, 1 }, /* Bit plane pointer 4 (high 5 bits) */ + { _T("BPL4PTL"), 0xdff0EE, 2, 2 }, /* Bit plane pointer 4 (low 15 bits) */ + { _T("BPL5PTH"), 0xdff0F0, 2, 1 }, /* Bit plane pointer 5 (high 5 bits) */ + { _T("BPL5PTL"), 0xdff0F2, 2, 2 }, /* Bit plane pointer 5 (low 15 bits) */ + { _T("BPL6PTH"), 0xdff0F4, 2, 1|8 }, /* Bit plane pointer 6 (high 5 bits) */ + { _T("BPL6PTL"), 0xdff0F6, 2, 2|8 }, /* Bit plane pointer 6 (low 15 bits) */ + { _T("BPL7PTH"), 0xdff0F8, 2, 1|8 }, /* Bit plane pointer 7 (high 5 bits) */ + { _T("BPL7PTL"), 0xdff0FA, 2, 2|8 }, /* Bit plane pointer 7 (low 15 bits) */ + { _T("BPL8PTH"), 0xdff0FC, 2, 1|8 }, /* Bit plane pointer 8 (high 5 bits) */ + { _T("BPL8PTL"), 0xdff0FE, 2, 2|8 }, /* Bit plane pointer 8 (low 15 bits) */ + { _T("BPLCON0"), 0xdff100, 2 }, /* Bit plane control reg (misc control bits) */ + { _T("BPLCON1"), 0xdff102, 2 }, /* Bit plane control reg (scroll val PF1,PF2) */ + { _T("BPLCON2"), 0xdff104, 2 }, /* Bit plane control reg (priority control) */ + { _T("BPLCON3"), 0xdff106, 2|8 }, /* Bit plane control reg (enhanced features) */ + { _T("BPL1MOD"), 0xdff108, 2 }, /* Bit plane modulo (odd planes,or active- fetch lines if bitplane scan-doubling is enabled */ + { _T("BPL2MOD"), 0xdff10A, 2 }, /* Bit plane modulo (even planes or inactive- fetch lines if bitplane scan-doubling is enabled */ + { _T("BPLCON4"), 0xdff10C, 2|8 }, /* Bit plane control reg (bitplane and sprite masks) */ + { _T("CLXCON2"), 0xdff10e, 2|8 }, /* Extended collision control reg */ + { _T("BPL1DAT"), 0xdff110, 2 }, /* Bit plane 1 data (parallel to serial con- vert) */ + { _T("BPL2DAT"), 0xdff112, 2 }, /* Bit plane 2 data (parallel to serial con- vert) */ + { _T("BPL3DAT"), 0xdff114, 2 }, /* Bit plane 3 data (parallel to serial con- vert) */ + { _T("BPL4DAT"), 0xdff116, 2 }, /* Bit plane 4 data (parallel to serial con- vert) */ + { _T("BPL5DAT"), 0xdff118, 2 }, /* Bit plane 5 data (parallel to serial con- vert) */ + { _T("BPL6DAT"), 0xdff11a, 2 }, /* Bit plane 6 data (parallel to serial con- vert) */ + { _T("BPL7DAT"), 0xdff11c, 2|8 }, /* Bit plane 7 data (parallel to serial con- vert) */ + { _T("BPL8DAT"), 0xdff11e, 2|8 }, /* Bit plane 8 data (parallel to serial con- vert) */ + { _T("SPR0PTH"), 0xdff120, 2, 1 }, /* Sprite 0 pointer (high 5 bits) */ + { _T("SPR0PTL"), 0xdff122, 2, 2 }, /* Sprite 0 pointer (low 15 bits) */ + { _T("SPR1PTH"), 0xdff124, 2, 1 }, /* Sprite 1 pointer (high 5 bits) */ + { _T("SPR1PTL"), 0xdff126, 2, 2 }, /* Sprite 1 pointer (low 15 bits) */ + { _T("SPR2PTH"), 0xdff128, 2, 1 }, /* Sprite 2 pointer (high 5 bits) */ + { _T("SPR2PTL"), 0xdff12A, 2, 2 }, /* Sprite 2 pointer (low 15 bits) */ + { _T("SPR3PTH"), 0xdff12C, 2, 1 }, /* Sprite 3 pointer (high 5 bits) */ + { _T("SPR3PTL"), 0xdff12E, 2, 2 }, /* Sprite 3 pointer (low 15 bits) */ + { _T("SPR4PTH"), 0xdff130, 2, 1 }, /* Sprite 4 pointer (high 5 bits) */ + { _T("SPR4PTL"), 0xdff132, 2, 2 }, /* Sprite 4 pointer (low 15 bits) */ + { _T("SPR5PTH"), 0xdff134, 2, 1 }, /* Sprite 5 pointer (high 5 bits) */ + { _T("SPR5PTL"), 0xdff136, 2, 2 }, /* Sprite 5 pointer (low 15 bits) */ + { _T("SPR6PTH"), 0xdff138, 2, 1 }, /* Sprite 6 pointer (high 5 bits) */ + { _T("SPR6PTL"), 0xdff13A, 2, 2 }, /* Sprite 6 pointer (low 15 bits) */ + { _T("SPR7PTH"), 0xdff13C, 2, 1 }, /* Sprite 7 pointer (high 5 bits) */ + { _T("SPR7PTL"), 0xdff13E, 2, 2 }, /* Sprite 7 pointer (low 15 bits) */ + { _T("SPR0POS"), 0xdff140, 2 }, /* Sprite 0 vert-horiz start pos data */ + { _T("SPR0CTL"), 0xdff142, 2 }, /* Sprite 0 position and control data */ + { _T("SPR0DATA"), 0xdff144, 2 }, /* Sprite 0 image data register A */ + { _T("SPR0DATB"), 0xdff146, 2 }, /* Sprite 0 image data register B */ + { _T("SPR1POS"), 0xdff148, 2 }, /* Sprite 1 vert-horiz start pos data */ + { _T("SPR1CTL"), 0xdff14A, 2 }, /* Sprite 1 position and control data */ + { _T("SPR1DATA"), 0xdff14C, 2 }, /* Sprite 1 image data register A */ + { _T("SPR1DATB"), 0xdff14E, 2 }, /* Sprite 1 image data register B */ + { _T("SPR2POS"), 0xdff150, 2 }, /* Sprite 2 vert-horiz start pos data */ + { _T("SPR2CTL"), 0xdff152, 2 }, /* Sprite 2 position and control data */ + { _T("SPR2DATA"), 0xdff154, 2 }, /* Sprite 2 image data register A */ + { _T("SPR2DATB"), 0xdff156, 2 }, /* Sprite 2 image data register B */ + { _T("SPR3POS"), 0xdff158, 2 }, /* Sprite 3 vert-horiz start pos data */ + { _T("SPR3CTL"), 0xdff15A, 2 }, /* Sprite 3 position and control data */ + { _T("SPR3DATA"), 0xdff15C, 2 }, /* Sprite 3 image data register A */ + { _T("SPR3DATB"), 0xdff15E, 2 }, /* Sprite 3 image data register B */ + { _T("SPR4POS"), 0xdff160, 2 }, /* Sprite 4 vert-horiz start pos data */ + { _T("SPR4CTL"), 0xdff162, 2 }, /* Sprite 4 position and control data */ + { _T("SPR4DATA"), 0xdff164, 2 }, /* Sprite 4 image data register A */ + { _T("SPR4DATB"), 0xdff166, 2 }, /* Sprite 4 image data register B */ + { _T("SPR5POS"), 0xdff168, 2 }, /* Sprite 5 vert-horiz start pos data */ + { _T("SPR5CTL"), 0xdff16A, 2 }, /* Sprite 5 position and control data */ + { _T("SPR5DATA"), 0xdff16C, 2 }, /* Sprite 5 image data register A */ + { _T("SPR5DATB"), 0xdff16E, 2 }, /* Sprite 5 image data register B */ + { _T("SPR6POS"), 0xdff170, 2 }, /* Sprite 6 vert-horiz start pos data */ + { _T("SPR6CTL"), 0xdff172, 2 }, /* Sprite 6 position and control data */ + { _T("SPR6DATA"), 0xdff174, 2 }, /* Sprite 6 image data register A */ + { _T("SPR6DATB"), 0xdff176, 2 }, /* Sprite 6 image data register B */ + { _T("SPR7POS"), 0xdff178, 2 }, /* Sprite 7 vert-horiz start pos data */ + { _T("SPR7CTL"), 0xdff17A, 2 }, /* Sprite 7 position and control data */ + { _T("SPR7DATA"), 0xdff17C, 2 }, /* Sprite 7 image data register A */ + { _T("SPR7DATB"), 0xdff17E, 2 }, /* Sprite 7 image data register B */ + { _T("COLOR00"), 0xdff180, 2 }, /* Color table 00 */ + { _T("COLOR01"), 0xdff182, 2 }, /* Color table 01 */ + { _T("COLOR02"), 0xdff184, 2 }, /* Color table 02 */ + { _T("COLOR03"), 0xdff186, 2 }, /* Color table 03 */ + { _T("COLOR04"), 0xdff188, 2 }, /* Color table 04 */ + { _T("COLOR05"), 0xdff18A, 2 }, /* Color table 05 */ + { _T("COLOR06"), 0xdff18C, 2 }, /* Color table 06 */ + { _T("COLOR07"), 0xdff18E, 2 }, /* Color table 07 */ + { _T("COLOR08"), 0xdff190, 2 }, /* Color table 08 */ + { _T("COLOR09"), 0xdff192, 2 }, /* Color table 09 */ + { _T("COLOR10"), 0xdff194, 2 }, /* Color table 10 */ + { _T("COLOR11"), 0xdff196, 2 }, /* Color table 11 */ + { _T("COLOR12"), 0xdff198, 2 }, /* Color table 12 */ + { _T("COLOR13"), 0xdff19A, 2 }, /* Color table 13 */ + { _T("COLOR14"), 0xdff19C, 2 }, /* Color table 14 */ + { _T("COLOR15"), 0xdff19E, 2 }, /* Color table 15 */ + { _T("COLOR16"), 0xdff1A0, 2 }, /* Color table 16 */ + { _T("COLOR17"), 0xdff1A2, 2 }, /* Color table 17 */ + { _T("COLOR18"), 0xdff1A4, 2 }, /* Color table 18 */ + { _T("COLOR19"), 0xdff1A6, 2 }, /* Color table 19 */ + { _T("COLOR20"), 0xdff1A8, 2 }, /* Color table 20 */ + { _T("COLOR21"), 0xdff1AA, 2 }, /* Color table 21 */ + { _T("COLOR22"), 0xdff1AC, 2 }, /* Color table 22 */ + { _T("COLOR23"), 0xdff1AE, 2 }, /* Color table 23 */ + { _T("COLOR24"), 0xdff1B0, 2 }, /* Color table 24 */ + { _T("COLOR25"), 0xdff1B2, 2 }, /* Color table 25 */ + { _T("COLOR26"), 0xdff1B4, 2 }, /* Color table 26 */ + { _T("COLOR27"), 0xdff1B6, 2 }, /* Color table 27 */ + { _T("COLOR28"), 0xdff1B8, 2 }, /* Color table 28 */ + { _T("COLOR29"), 0xdff1BA, 2 }, /* Color table 29 */ + { _T("COLOR30"), 0xdff1BC, 2 }, /* Color table 30 */ + { _T("COLOR31"), 0xdff1BE, 2 }, /* Color table 31 */ + { _T("HTOTAL"), 0xdff1C0, 2|4 }, /* Highest number count in horiz line (VARBEAMEN = 1) */ + { _T("HSSTOP"), 0xdff1C2, 2|4 }, /* Horiz line pos for HSYNC stop */ + { _T("HBSTRT"), 0xdff1C4, 2|4 }, /* Horiz line pos for HBLANK start */ + { _T("HBSTOP"), 0xdff1C6, 2|4 }, /* Horiz line pos for HBLANK stop */ + { _T("VTOTAL"), 0xdff1C8, 2|4 }, /* Highest numbered vertical line (VARBEAMEN = 1) */ + { _T("VSSTOP"), 0xdff1CA, 2|4 }, /* Vert line for VBLANK start */ + { _T("VBSTRT"), 0xdff1CC, 2|4 }, /* Vert line for VBLANK start */ + { _T("VBSTOP"), 0xdff1CE, 2|4 }, /* Vert line for VBLANK stop */ #if 0 - { L"SPRHSTRT", 0xdff1D0 }, /* UHRES sprite vertical start */ - { L"SPRHSTOP", 0xdff1D2 }, /* UHRES sprite vertical stop */ - { L"BPLHSTRT", 0xdff1D4 }, /* UHRES bit plane vertical stop */ - { L"BPLHSTOP", 0xdff1D6 }, /* UHRES bit plane vertical stop */ - { L"HHPOSW", 0xdff1D8 }, /* DUAL mode hires H beam counter write */ - { L"HHPOSR", 0xdff1DA }, /* DUAL mode hires H beam counter read */ + { _T("SPRHSTRT"), 0xdff1D0 }, /* UHRES sprite vertical start */ + { _T("SPRHSTOP"), 0xdff1D2 }, /* UHRES sprite vertical stop */ + { _T("BPLHSTRT"), 0xdff1D4 }, /* UHRES bit plane vertical stop */ + { _T("BPLHSTOP"), 0xdff1D6 }, /* UHRES bit plane vertical stop */ + { _T("HHPOSW"), 0xdff1D8 }, /* DUAL mode hires H beam counter write */ + { _T("HHPOSR"), 0xdff1DA }, /* DUAL mode hires H beam counter read */ #endif - { L"BEAMCON0", 0xdff1DC, 2|4 }, /* Beam counter control register (SHRES,UHRES,PAL) */ - { L"HSSTRT", 0xdff1DE, 2|4 }, /* Horizontal sync start (VARHSY) */ - { L"VSSTRT", 0xdff1E0, 2|4 }, /* Vertical sync start (VARVSY) */ - { L"HCENTER", 0xdff1E2, 2|4 }, /* Horizontal pos for vsync on interlace */ - { L"DIWHIGH", 0xdff1E4, 2|4 }, /* Display window upper bits for start/stop */ + { _T("BEAMCON0"), 0xdff1DC, 2|4 }, /* Beam counter control register (SHRES,UHRES,PAL) */ + { _T("HSSTRT"), 0xdff1DE, 2|4 }, /* Horizontal sync start (VARHSY) */ + { _T("VSSTRT"), 0xdff1E0, 2|4 }, /* Vertical sync start (VARVSY) */ + { _T("HCENTER"), 0xdff1E2, 2|4 }, /* Horizontal pos for vsync on interlace */ + { _T("DIWHIGH"), 0xdff1E4, 2|4 }, /* Display window upper bits for start/stop */ #if 0 - { L"BPLHMOD", 0xdff1E6 }, /* UHRES bit plane modulo */ - { L"SPRHPTH", 0xdff1E8 }, /* UHRES sprite pointer (high 5 bits) */ - { L"SPRHPTL", 0xdff1EA }, /* UHRES sprite pointer (low 15 bits) */ - { L"BPLHPTH", 0xdff1EC }, /* VRam (UHRES) bitplane pointer (hi 5 bits) */ - { L"BPLHPTL", 0xdff1EE }, /* VRam (UHRES) bitplane pointer (lo 15 bits) */ - { L"RESERVED", 0xdff1F0 }, /* Reserved (forever i guess!) */ - { L"RESERVED", 0xdff1F2 }, /* Reserved (forever i guess!) */ - { L"RESERVED", 0xdff1F4 }, /* Reserved (forever i guess!) */ - { L"RESERVED", 0xdff1F6 }, /* Reserved (forever i guess!) */ - { L"RESERVED", 0xdff1F8 }, /* Reserved (forever i guess!) */ - { L"RESERVED", 0xdff1Fa }, /* Reserved (forever i guess!) */ + { _T("BPLHMOD"), 0xdff1E6 }, /* UHRES bit plane modulo */ + { _T("SPRHPTH"), 0xdff1E8 }, /* UHRES sprite pointer (high 5 bits) */ + { _T("SPRHPTL"), 0xdff1EA }, /* UHRES sprite pointer (low 15 bits) */ + { _T("BPLHPTH"), 0xdff1EC }, /* VRam (UHRES) bitplane pointer (hi 5 bits) */ + { _T("BPLHPTL"), 0xdff1EE }, /* VRam (UHRES) bitplane pointer (lo 15 bits) */ + { _T("RESERVED"), 0xdff1F0 }, /* Reserved (forever i guess!) */ + { _T("RESERVED"), 0xdff1F2 }, /* Reserved (forever i guess!) */ + { _T("RESERVED"), 0xdff1F4 }, /* Reserved (forever i guess!) */ + { _T("RESERVED"), 0xdff1F6 }, /* Reserved (forever i guess!) */ + { _T("RESERVED"), 0xdff1F8 }, /* Reserved (forever i guess!) */ + { _T("RESERVED"), 0xdff1Fa }, /* Reserved (forever i guess!) */ #endif - { L"FMODE", 0xdff1FC, 2|8 }, /* Fetch mode register */ - { L"NO-OP(NULL)", 0xdff1FE }, /* Can also indicate last 2 or 3 refresh + { _T("FMODE"), 0xdff1FC, 2|8 }, /* Fetch mode register */ + { _T("NO-OP(NULL)"), 0xdff1FE }, /* Can also indicate last 2 or 3 refresh cycles or the restart of the COPPER after lockup.*/ { NULL } }; diff --git a/include/a2091.h b/include/a2091.h index 70d4f30e..4143c48b 100644 --- a/include/a2091.h +++ b/include/a2091.h @@ -21,7 +21,7 @@ extern void scsi_hsync (void); extern uae_u8 wdregs[32]; extern struct scsi_data *scsis[8]; -#define WD33C93 L"WD33C93" +#define WD33C93 _T("WD33C93") #define SCSIID (scsis[wdregs[WD_DESTINATION_ID] & 7]) extern int a2091_add_scsi_unit (int ch, const TCHAR *path, int blocksize, int readonly, diff --git a/include/driveclick.h b/include/driveclick.h index fabc7b99..9267ea60 100644 --- a/include/driveclick.h +++ b/include/driveclick.h @@ -36,11 +36,11 @@ extern void driveclick_check_prefs (void); extern uae_s16 *decodewav (uae_u8 *s, int *len); #define DS_BUILD_IN_SOUNDS 1 -#define DS_NAME_CLICK L"drive_click_" -#define DS_NAME_SPIN L"drive_spin_" -#define DS_NAME_SPIN_ND L"drive_spinnd_" -#define DS_NAME_START L"drive_start_" -#define DS_NAME_SNATCH L"drive_snatch_" +#define DS_NAME_CLICK _T("drive_click_") +#define DS_NAME_SPIN _T("drive_spin_") +#define DS_NAME_SPIN_ND _T("drive_spinnd_") +#define DS_NAME_START _T("drive_start_") +#define DS_NAME_SNATCH _T("drive_snatch_") extern int driveclick_fdrawcmd_open (int); extern void driveclick_fdrawcmd_close (int); diff --git a/include/events.h b/include/events.h index f8d01173..ecc428f8 100644 --- a/include/events.h +++ b/include/events.h @@ -104,7 +104,7 @@ STATIC_INLINE void set_cycles (unsigned long int x) eventtab[ev_hsync].oldcycles = x; #ifdef EVT_DEBUG if (currcycle & (CYCLE_UNIT - 1)) - write_log (L"%x\n", currcycle); + write_log (_T("%x\n"), currcycle); #endif } diff --git a/include/fsdb.h b/include/fsdb.h index 3766b8cb..921e9be4 100644 --- a/include/fsdb.h +++ b/include/fsdb.h @@ -8,7 +8,7 @@ */ #ifndef FSDB_FILE -#define FSDB_FILE L"_UAEFSDB.___" +#define FSDB_FILE _T("_UAEFSDB.___") #endif #ifndef FSDB_DIR_SEPARATOR diff --git a/include/options.h b/include/options.h index 8aed9888..5702a6cc 100644 --- a/include/options.h +++ b/include/options.h @@ -9,7 +9,7 @@ #define UAEMAJOR 2 #define UAEMINOR 4 -#define UAESUBREV 0 +#define UAESUBREV 1 typedef enum { KBD_LANG_US, KBD_LANG_DK, KBD_LANG_DE, KBD_LANG_SE, KBD_LANG_FR, KBD_LANG_IT, KBD_LANG_ES } KbdLang; diff --git a/include/traps.h b/include/traps.h index fac8354c..e196d96c 100644 --- a/include/traps.h +++ b/include/traps.h @@ -51,7 +51,7 @@ extern uae_u32 CallFunc (TrapContext *context, uaecptr func); void init_traps (void); void init_extended_traps (void); -#define deftrap(f) define_trap((f), 0, L"") +#define deftrap(f) define_trap((f), 0, _T("")) #define deftrap2(f, mode, str) define_trap((f), (mode), (str)) #define deftrapres(f, mode, str) define_trap((f), (mode | TRAPFLAG_UAERES), (str)) diff --git a/include/uaeipc.h b/include/uaeipc.h index 97ac270d..cf8d1f7d 100644 --- a/include/uaeipc.h +++ b/include/uaeipc.h @@ -1,5 +1,5 @@ -#define COMPIPENAME L"WinUAE_COM" +#define COMPIPENAME _T("WinUAE_COM") extern void *createIPC (const TCHAR *name, int); extern void closeIPC (void*); diff --git a/inputdevice.cpp b/inputdevice.cpp index 0623da09..68f2fcf2 100644 --- a/inputdevice.cpp +++ b/inputdevice.cpp @@ -272,7 +272,7 @@ static void copyjport (const struct uae_prefs *src, struct uae_prefs *dst, int n static void out_config (struct zfile *f, int id, int num, TCHAR *s1, TCHAR *s2) { TCHAR tmp[MAX_DPATH]; - _stprintf (tmp, L"input.%d.%s%d", id, s1, num); + _stprintf (tmp, _T("input.%d.%s%d"), id, s1, num); cfgfile_write_str (f, tmp, s2); } @@ -293,7 +293,7 @@ static bool write_config_head (struct zfile *f, int idnum, int devnum, TCHAR *na else if (devnum < idf->get_num ()) s = idf->get_friendlyname (devnum); if (s) { - _stprintf (tmp2, L"input.%d.%s.%d.friendlyname", idnum + 1, name, devnum); + _stprintf (tmp2, _T("input.%d.%s.%d.friendlyname"), idnum + 1, name, devnum); cfgfile_write_str (f, tmp2, s); } @@ -303,27 +303,27 @@ static bool write_config_head (struct zfile *f, int idnum, int devnum, TCHAR *na else if (devnum < idf->get_num ()) s = idf->get_uniquename (devnum); if (s) { - _stprintf (tmp2, L"input.%d.%s.%d.name", idnum + 1, name, devnum); + _stprintf (tmp2, _T("input.%d.%s.%d.name"), idnum + 1, name, devnum); cfgfile_write_str (f, tmp2, s); } if (!isdevice (id)) { - _stprintf (tmp2, L"input.%d.%s.%d.empty", idnum + 1, name, devnum); + _stprintf (tmp2, _T("input.%d.%s.%d.empty"), idnum + 1, name, devnum); cfgfile_write_bool (f, tmp2, true); if (id->enabled) { - _stprintf (tmp2, L"input.%d.%s.%d.disabled", idnum + 1, name, devnum); - cfgfile_write (f, tmp2, L"%d", id->enabled ? 0 : 1); + _stprintf (tmp2, _T("input.%d.%s.%d.disabled"), idnum + 1, name, devnum); + cfgfile_write (f, tmp2, _T("%d"), id->enabled ? 0 : 1); } return false; } if (idnum == GAMEPORT_INPUT_SETTINGS) { - _stprintf (tmp2, L"input.%d.%s.%d.custom", idnum + 1, name, devnum); + _stprintf (tmp2, _T("input.%d.%s.%d.custom"), idnum + 1, name, devnum); cfgfile_write_bool (f, tmp2, true); } else { - _stprintf (tmp2, L"input.%d.%s.%d.empty", idnum + 1, name, devnum); + _stprintf (tmp2, _T("input.%d.%s.%d.empty"), idnum + 1, name, devnum); cfgfile_write_bool (f, tmp2, false); - _stprintf (tmp2, L"input.%d.%s.%d.disabled", idnum + 1, name, devnum); + _stprintf (tmp2, _T("input.%d.%s.%d.disabled"), idnum + 1, name, devnum); cfgfile_write_bool (f, tmp2, id->enabled ? false : true); } return true; @@ -334,20 +334,20 @@ static bool write_slot (TCHAR *p, struct uae_input_device *uid, int i, int j) bool ok = false; int flags = uid->flags[i][j]; if (uid->custom[i][j] && _tcslen (uid->custom[i][j]) > 0) { - _stprintf (p, L"'%s'.%d", uid->custom[i][j], flags & ID_FLAG_SAVE_MASK_CONFIG); + _stprintf (p, _T("'%s'.%d"), uid->custom[i][j], flags & ID_FLAG_SAVE_MASK_CONFIG); ok = true; } else if (uid->eventid[i][j] > 0) { - _stprintf (p, L"%s.%d", events[uid->eventid[i][j]].confname, flags & ID_FLAG_SAVE_MASK_CONFIG); + _stprintf (p, _T("%s.%d"), events[uid->eventid[i][j]].confname, flags & ID_FLAG_SAVE_MASK_CONFIG); ok = true; } else { - _tcscpy (p, L"NULL"); + _tcscpy (p, _T("NULL")); } if (ok && (flags & ID_FLAG_SAVE_MASK_QUALIFIERS)) { TCHAR *p2 = p + _tcslen (p); *p2++ = '.'; for (int i = 0; i < MAX_INPUT_QUALIFIERS; i++) { if ((ID_FLAG_QUALIFIER1 << i) & flags) { - _stprintf (p2, L"%c", 'A' + i); + _stprintf (p2, _T("%c"), 'A' + i); p2++; } } @@ -409,7 +409,7 @@ static void write_config2 (struct zfile *f, int idnum, int i, int offset, const p += _tcslen (p); if (ok) { if (id->port[io][slotorder[j]] > 0) { - _stprintf (p, L".%d", id->port[io][slotorder[j]] - 1); + _stprintf (p, _T(".%d"), id->port[io][slotorder[j]] - 1); p += _tcslen (p); if (idnum != GAMEPORT_INPUT_SETTINGS && j == 0 && id->port[io][SPARE_SUB_EVENT] && slotorder == slotorder1) { *p++ = '.'; @@ -420,7 +420,7 @@ static void write_config2 (struct zfile *f, int idnum, int i, int offset, const } } if (p > tmp2) { - _stprintf (tmp3, L"input.%d.%s%d", idnum + 1, extra, i); + _stprintf (tmp3, _T("input.%d.%s%d"), idnum + 1, extra, i); cfgfile_write_str (f, tmp3, tmp2); } } @@ -434,7 +434,7 @@ static void write_kbr_config (struct zfile *f, int idnum, int devnum, struct uae if (!keyboard_default) return; - if (!write_config_head (f, idnum, devnum, L"keyboard", kbr, idf)) + if (!write_config_head (f, idnum, devnum, _T("keyboard"), kbr, idf)) return; i = 0; @@ -498,7 +498,7 @@ static void write_kbr_config (struct zfile *f, int idnum, int devnum, struct uae if (ok) { // save port number + SPARE SLOT if needed if (kbr->port[i][slotorder[j]] > 0 && (kbr->flags[i][slotorder[j]] & ID_FLAG_GAMEPORTSCUSTOM_MASK)) { - _stprintf (p, L".%d", kbr->port[i][slotorder[j]] - 1); + _stprintf (p, _T(".%d"), kbr->port[i][slotorder[j]] - 1); p += _tcslen (p); if (idnum != GAMEPORT_INPUT_SETTINGS && j == 0 && kbr->port[i][SPARE_SUB_EVENT] && !isdefaultspare && slotorder == slotorder1) { *p++ = '.'; @@ -509,11 +509,11 @@ static void write_kbr_config (struct zfile *f, int idnum, int devnum, struct uae } } idf->get_widget_type (devnum, i, tmp5, NULL); - _stprintf (tmp3, L"%d%s%s", kbr->extra[i], tmp5[0] ? L"." : L"", tmp5[0] ? tmp5 : L""); + _stprintf (tmp3, _T("%d%s%s"), kbr->extra[i], tmp5[0] ? _T(".") : _T(""), tmp5[0] ? tmp5 : _T("")); kbrlabel (tmp3); - _stprintf (tmp1, L"keyboard.%d.button.%s", devnum, tmp3); - _stprintf (tmp4, L"input.%d.%s", idnum + 1, tmp1); - cfgfile_write_str (f, tmp4, tmp2[0] ? tmp2 : L"NULL"); + _stprintf (tmp1, _T("keyboard.%d.button.%s"), devnum, tmp3); + _stprintf (tmp4, _T("input.%d.%s"), idnum + 1, tmp1); + cfgfile_write_str (f, tmp4, tmp2[0] ? tmp2 : _T("NULL")); i++; } } @@ -526,41 +526,41 @@ static void write_config (struct zfile *f, int idnum, int devnum, TCHAR *name, s if (!write_config_head (f, idnum, devnum, name, id, idf)) return; - _stprintf (tmp1, L"%s.%d.axis.", name, devnum); + _stprintf (tmp1, _T("%s.%d.axis."), name, devnum); for (i = 0; i < ID_AXIS_TOTAL; i++) write_config2 (f, idnum, i, ID_AXIS_OFFSET, tmp1, id); - _stprintf (tmp1, L"%s.%d.button." ,name, devnum); + _stprintf (tmp1, _T("%s.%d.button.") ,name, devnum); for (i = 0; i < ID_BUTTON_TOTAL; i++) write_config2 (f, idnum, i, ID_BUTTON_OFFSET, tmp1, id); } -static const TCHAR *kbtypes[] = { L"amiga", L"pc", NULL }; +static const TCHAR *kbtypes[] = { _T("amiga"), _T("pc"), NULL }; void write_inputdevice_config (struct uae_prefs *p, struct zfile *f) { int i, id; - cfgfile_write (f, L"input.config", L"%d", p->input_selected_setting == GAMEPORT_INPUT_SETTINGS ? 0 : p->input_selected_setting + 1); - cfgfile_write (f, L"input.joymouse_speed_analog", L"%d", p->input_joymouse_multiplier); - cfgfile_write (f, L"input.joymouse_speed_digital", L"%d", p->input_joymouse_speed); - cfgfile_write (f, L"input.joymouse_deadzone", L"%d", p->input_joymouse_deadzone); - cfgfile_write (f, L"input.joystick_deadzone", L"%d", p->input_joystick_deadzone); - cfgfile_write (f, L"input.analog_joystick_multiplier", L"%d", p->input_analog_joystick_mult); - cfgfile_write (f, L"input.analog_joystick_offset", L"%d", p->input_analog_joystick_offset); - cfgfile_write (f, L"input.mouse_speed", L"%d", p->input_mouse_speed); - cfgfile_write (f, L"input.autofire_speed", L"%d", p->input_autofire_linecnt); - cfgfile_dwrite_str (f, L"input.keyboard_type", kbtypes[p->input_keyboard_type]); - cfgfile_dwrite (f, L"input.contact_bounce", L"%d", p->input_contact_bounce); + cfgfile_write (f, _T("input.config"), _T("%d"), p->input_selected_setting == GAMEPORT_INPUT_SETTINGS ? 0 : p->input_selected_setting + 1); + cfgfile_write (f, _T("input.joymouse_speed_analog"), _T("%d"), p->input_joymouse_multiplier); + cfgfile_write (f, _T("input.joymouse_speed_digital"), _T("%d"), p->input_joymouse_speed); + cfgfile_write (f, _T("input.joymouse_deadzone"), _T("%d"), p->input_joymouse_deadzone); + cfgfile_write (f, _T("input.joystick_deadzone"), _T("%d"), p->input_joystick_deadzone); + cfgfile_write (f, _T("input.analog_joystick_multiplier"), _T("%d"), p->input_analog_joystick_mult); + cfgfile_write (f, _T("input.analog_joystick_offset"), _T("%d"), p->input_analog_joystick_offset); + cfgfile_write (f, _T("input.mouse_speed"), _T("%d"), p->input_mouse_speed); + cfgfile_write (f, _T("input.autofire_speed"), _T("%d"), p->input_autofire_linecnt); + cfgfile_dwrite_str (f, _T("input.keyboard_type"), kbtypes[p->input_keyboard_type]); + cfgfile_dwrite (f, _T("input.contact_bounce"), _T("%d"), p->input_contact_bounce); for (id = 0; id < MAX_INPUT_SETTINGS; id++) { TCHAR tmp[MAX_DPATH]; if (id < GAMEPORT_INPUT_SETTINGS) { - _stprintf (tmp, L"input.%d.name", id + 1); + _stprintf (tmp, _T("input.%d.name"), id + 1); cfgfile_dwrite_str (f, tmp, p->input_config_name[id]); } for (i = 0; i < MAX_INPUT_DEVICES; i++) - write_config (f, id, i, L"joystick", &p->joystick_settings[id][i], &joysticks2[i], &idev[IDTYPE_JOYSTICK]); + write_config (f, id, i, _T("joystick"), &p->joystick_settings[id][i], &joysticks2[i], &idev[IDTYPE_JOYSTICK]); for (i = 0; i < MAX_INPUT_DEVICES; i++) - write_config (f, id, i, L"mouse", &p->mouse_settings[id][i], &mice2[i], &idev[IDTYPE_MOUSE]); + write_config (f, id, i, _T("mouse"), &p->mouse_settings[id][i], &mice2[i], &idev[IDTYPE_MOUSE]); for (i = 0; i < MAX_INPUT_DEVICES; i++) write_kbr_config (f, id, i, &p->keyboard_settings[id][i], &idev[IDTYPE_KEYBOARD]); } @@ -588,9 +588,9 @@ static int getnum (const TCHAR **pp) const TCHAR *p = *pp; int v; - if (!_tcsnicmp (p, L"false", 5)) + if (!_tcsnicmp (p, _T("false"), 5)) v = 0; - if (!_tcsnicmp (p, L"true", 4)) + if (!_tcsnicmp (p, _T("true"), 4)) v = 1; else v = _tstol (p); @@ -656,14 +656,14 @@ static void set_kbr_default_event (struct uae_input_device *kbr, struct uae_inpu break; } if (k == MAX_INPUT_SUB_EVENT) { - write_log (L"corrupt default keyboard mappings\n"); + write_log (_T("corrupt default keyboard mappings\n")); return; } int l = 0; while (k < MAX_INPUT_SUB_EVENT && trans[i].node[l].evt) { int evt = trans[i].node[l].evt; if (evt < 0 || evt >= INPUTEVENT_SPC_LAST) - gui_message(L"invalid event in default keyboard table!"); + gui_message(_T("invalid event in default keyboard table!")); kbr->eventid[num][k] = evt; kbr->flags[num][k] = trans[i].node[l].flags; l++; @@ -738,7 +738,7 @@ static bool read_slot (TCHAR *parm, int num, int joystick, int button, struct ua int mask; if (custom == NULL && ie->name == NULL) { - if (!_tcscmp (parm, L"NULL")) { + if (!_tcscmp (parm, _T("NULL"))) { if (joystick < 0) { id->eventid[keynum][subnum] = 0; id->flags[keynum][subnum] = 0; @@ -814,36 +814,36 @@ void read_inputdevice_config (struct uae_prefs *pr, const TCHAR *option, TCHAR * option += 6; /* "input." */ p = getstring (&option); - if (!strcasecmp (p, L"config")) { + if (!strcasecmp (p, _T("config"))) { pr->input_selected_setting = _tstol (value) - 1; if (pr->input_selected_setting == -1) pr->input_selected_setting = GAMEPORT_INPUT_SETTINGS; if (pr->input_selected_setting < 0 || pr->input_selected_setting > MAX_INPUT_SETTINGS) pr->input_selected_setting = 0; } - if (!strcasecmp (p, L"joymouse_speed_analog")) + if (!strcasecmp (p, _T("joymouse_speed_analog"))) pr->input_joymouse_multiplier = _tstol (value); - if (!strcasecmp (p, L"joymouse_speed_digital")) + if (!strcasecmp (p, _T("joymouse_speed_digital"))) pr->input_joymouse_speed = _tstol (value); - if (!strcasecmp (p, L"joystick_deadzone")) + if (!strcasecmp (p, _T("joystick_deadzone"))) pr->input_joystick_deadzone = _tstol (value); - if (!strcasecmp (p, L"joymouse_deadzone")) + if (!strcasecmp (p, _T("joymouse_deadzone"))) pr->input_joymouse_deadzone = _tstol (value); - if (!strcasecmp (p, L"mouse_speed")) + if (!strcasecmp (p, _T("mouse_speed"))) pr->input_mouse_speed = _tstol (value); - if (!strcasecmp (p, L"autofire_speed")) + if (!strcasecmp (p, _T("autofire_speed"))) pr->input_autofire_linecnt = _tstol (value); - if (!strcasecmp (p, L"analog_joystick_multiplier")) + if (!strcasecmp (p, _T("analog_joystick_multiplier"))) pr->input_analog_joystick_mult = _tstol (value); - if (!strcasecmp (p, L"analog_joystick_offset")) + if (!strcasecmp (p, _T("analog_joystick_offset"))) pr->input_analog_joystick_offset = _tstol (value); - if (!strcasecmp (p, L"keyboard_type")) { + if (!strcasecmp (p, _T("keyboard_type"))) { cfgfile_strval (option, value, NULL, &pr->input_analog_joystick_offset, kbtypes, 0); keyboard_default = keyboard_default_table[pr->input_keyboard_type]; inputdevice_default_kb_all (pr); } - if (!strcasecmp (p, L"contact_bounce")) + if (!strcasecmp (p, _T("contact_bounce"))) pr->input_contact_bounce = _tstol (value); idnum = _tstol (p); @@ -851,17 +851,17 @@ void read_inputdevice_config (struct uae_prefs *pr, const TCHAR *option, TCHAR * return; idnum--; - if (!_tcscmp (option, L"name")) { + if (!_tcscmp (option, _T("name"))) { if (idnum < GAMEPORT_INPUT_SETTINGS) _tcscpy (pr->input_config_name[idnum], value); return; } - if (_tcsncmp (option, L"mouse.", 6) == 0) { + if (_tcsncmp (option, _T("mouse."), 6) == 0) { p = option + 6; - } else if (_tcsncmp (option, L"joystick.", 9) == 0) { + } else if (_tcsncmp (option, _T("joystick."), 9) == 0) { p = option + 9; - } else if (_tcsncmp (option, L"keyboard.", 9) == 0) { + } else if (_tcsncmp (option, _T("keyboard."), 9) == 0) { p = option + 9; } else return; @@ -874,31 +874,31 @@ void read_inputdevice_config (struct uae_prefs *pr, const TCHAR *option, TCHAR * if (!p2) return; - if (_tcsncmp (option, L"mouse.", 6) == 0) { + if (_tcsncmp (option, _T("mouse."), 6) == 0) { id = &pr->mouse_settings[idnum][devnum]; joystick = 0; - } else if (_tcsncmp (option, L"joystick.", 9) == 0) { + } else if (_tcsncmp (option, _T("joystick."), 9) == 0) { id = &pr->joystick_settings[idnum][devnum]; joystick = 1; - } else if (_tcsncmp (option, L"keyboard.", 9) == 0) { + } else if (_tcsncmp (option, _T("keyboard."), 9) == 0) { id = &pr->keyboard_settings[idnum][devnum]; joystick = -1; } if (!id) return; - if (!_tcscmp (p2, L"name")) { + if (!_tcscmp (p2, _T("name"))) { xfree (id->configname); id->configname = my_strdup (value); return; } - if (!_tcscmp (p2, L"friendlyname")) { + if (!_tcscmp (p2, _T("friendlyname"))) { xfree (id->name); id->name = my_strdup (value); return; } - if (!_tcscmp (p2, L"custom")) { + if (!_tcscmp (p2, _T("custom"))) { int iscustom; p = value; iscustom = getnum (&p); @@ -913,7 +913,7 @@ void read_inputdevice_config (struct uae_prefs *pr, const TCHAR *option, TCHAR * return; } - if (!_tcscmp (p2, L"empty")) { + if (!_tcscmp (p2, _T("empty"))) { int empty; p = value; empty = getnum (&p); @@ -928,7 +928,7 @@ void read_inputdevice_config (struct uae_prefs *pr, const TCHAR *option, TCHAR * return; } - if (!_tcscmp (p2, L"disabled")) { + if (!_tcscmp (p2, _T("disabled"))) { int disabled; p = value; disabled = getnum (&p); @@ -953,9 +953,9 @@ void read_inputdevice_config (struct uae_prefs *pr, const TCHAR *option, TCHAR * return; } else { button = -1; - if (!_tcscmp (p2, L"axis")) + if (!_tcscmp (p2, _T("axis"))) button = 0; - else if(!_tcscmp (p2, L"button")) + else if(!_tcscmp (p2, _T("button"))) button = 1; if (button < 0) return; @@ -1045,7 +1045,7 @@ static uaecptr get_base (const uae_char *name) p = b->xlateaddr (v2); if (!memcmp (p, name, strlen (name) + 1)) { TCHAR *s = au (name); - write_log (L"get_base('%s')=%08x\n", s, v); + write_log (_T("get_base('%s')=%08x\n"), s, v); xfree (s); return v; } @@ -1054,7 +1054,7 @@ static uaecptr get_base (const uae_char *name) fail: { TCHAR *s = au (name); - write_log (L"get_base('%s') failed, invalid library list\n", s); + write_log (_T("get_base('%s') failed, invalid library list\n"), s); xfree (s); } return 0xffffffff; @@ -1157,7 +1157,7 @@ static void mousehack_enable (void) mode |= 1; if (inputdevice_is_tablet () > 0) mode |= 2; - write_log (L"Mouse driver enabled (%s)\n", ((mode & 3) == 3 ? L"tablet+mousehack" : ((mode & 3) == 2) ? L"tablet" : L"mousehack")); + write_log (_T("Mouse driver enabled (%s)\n"), ((mode & 3) == 3 ? _T("tablet+mousehack") : ((mode & 3) == 2) ? _T("tablet") : _T("mousehack"))); rtarea[off + MH_E] = 0x80; } @@ -1173,7 +1173,7 @@ void input_mousehack_status (int mode, uaecptr diminfo, uaecptr dispinfo, uaecpt uae_u8 v = rtarea[getmhoffset ()]; v |= 0x40; rtarea[getmhoffset ()] = v; - write_log (L"Tablet driver running (%02x)\n", v); + write_log (_T("Tablet driver running (%02x)\n"), v); } else if (mode == 1) { int x1 = -1, y1 = -1, x2 = -1, y2 = -1; uae_u32 props = 0; @@ -1196,9 +1196,9 @@ void input_mousehack_status (int mode, uaecptr diminfo, uaecptr dispinfo, uaecpt if (dispinfo) props = get_long (dispinfo + 18); dimensioninfo_dbl = (props & 0x00020000) ? 1 : 0; - write_log (L"%08x %08x %08x (%dx%d)-(%dx%d) d=%dx%d %s\n", + write_log (_T("%08x %08x %08x (%dx%d)-(%dx%d) d=%dx%d %s\n"), diminfo, props, vp, x1, y1, x2, y2, vp_xoffset, vp_yoffset, - (props & 0x00020000) ? L"dbl" : L""); + (props & 0x00020000) ? _T("dbl") : _T("")); } else if (mode == 2) { if (mousehack_alive_cnt == 0) mousehack_alive_cnt = -100; @@ -1233,7 +1233,7 @@ void inputdevice_tablet (int x, int y, int z, int pressure, uae_u32 buttonbits, mousehack_enable (); if (inputdevice_is_tablet () <= 0) return; - //write_log (L"%d %d %d %d %08X %d %d %d %d\n", x, y, z, pressure, buttonbits, inproximity, ax, ay, az); + //write_log (_T("%d %d %d %d %08X %d %d %d %d\n"), x, y, z, pressure, buttonbits, inproximity, ax, ay, az); off = getmhoffset (); p = rtarea + off; @@ -1423,7 +1423,7 @@ static void inputdevice_mh_abs_v36 (int x, int y) uaecptr gb = get_intuitionbase (); maxy = get_word (gb + 1344 + 2); maxx = get_word (gb + 1348 + 2); - write_log (L"%d %d\n", maxx, maxy); + write_log (_T("%d %d\n"), maxx, maxy); } #endif #if 1 @@ -1438,7 +1438,7 @@ static void inputdevice_mh_abs_v36 (int x, int y) h = get_word (vp + 26) * 2; dw = get_word (vp + 28); dh = get_word (vp + 30); - //write_log (L"%d %d %d %d\n", w, h, dw, dh); + //write_log (_T("%d %d %d %d\n"), w, h, dw, dh); if (w < maxx) maxx = w; if (h < maxy) @@ -1447,9 +1447,9 @@ static void inputdevice_mh_abs_v36 (int x, int y) y -= dh; } } - //write_log (L"* %d %d\n", get_word (gb + 218), get_word (gb + 216)); + //write_log (_T("* %d %d\n"), get_word (gb + 218), get_word (gb + 216)); } - //write_log (L"%d %d\n", maxx, maxy); + //write_log (_T("%d %d\n"), maxx, maxy); #endif maxx = maxx * 1000 / fmx; @@ -1472,7 +1472,7 @@ static void inputdevice_mh_abs_v36 (int x, int y) if (y >= maxy) y = maxy - 1; - //write_log (L"%d %d %d %d\n", x, y, maxx, maxy); + //write_log (_T("%d %d %d %d\n"), x, y, maxx, maxy); p[MH_X] = x >> 8; p[MH_X + 1] = x; @@ -1821,10 +1821,10 @@ static uae_u16 getjoystate (int joy) v = (uae_u8)mouse_x[joy] | (mouse_y[joy] << 8); #ifdef DONGLE_DEBUG if (notinrom ()) - write_log (L"JOY%dDAT %04X %s\n", joy, v, debuginfo (0)); + write_log (_T("JOY%dDAT %04X %s\n"), joy, v, debuginfo (0)); #endif if (inputdevice_logging & 2) - write_log (L"JOY%dDAT=%04x %08x\n", joy, v, M68K_GETPC); + write_log (_T("JOY%dDAT=%04x %08x\n"), joy, v, M68K_GETPC); return v; } @@ -1886,7 +1886,7 @@ void JOYTEST (uae_u16 v) mouse_frame_y[1] = mouse_y[1]; dongle_joytest (v); if (inputdevice_logging & 2) - write_log (L"JOYTEST: %04X PC=%x\n", v , M68K_GETPC); + write_log (_T("JOYTEST: %04X PC=%x\n"), v , M68K_GETPC); } static uae_u8 parconvert (uae_u8 v, int jd, int shift) @@ -2088,7 +2088,7 @@ uae_u8 handle_joystick_buttons (uae_u8 pra, uae_u8 dra) if (inputdevice_logging & 4) { static uae_u8 old; if (but != old) - write_log (L"BFE001: %02X:%02X %x\n", dra, but, M68K_GETPC); + write_log (_T("BFE001: %02X:%02X %x\n"), dra, but, M68K_GETPC); old = but; } return but; @@ -2232,7 +2232,7 @@ static uae_u16 POTDAT (int joy) { uae_u16 v = (pot_dat[joy][1] << 8) | pot_dat[joy][0]; if (inputdevice_logging & 16) - write_log (L"POTDAT%d: %04X %08X\n", joy, v, M68K_GETPC); + write_log (_T("POTDAT%d: %04X %08X\n"), joy, v, M68K_GETPC); return v; } @@ -2257,10 +2257,10 @@ void POTGO (uae_u16 v) int i, j; if (inputdevice_logging & 16) - write_log (L"POTGO_W: %04X %08X\n", v, M68K_GETPC); + write_log (_T("POTGO_W: %04X %08X\n"), v, M68K_GETPC); #ifdef DONGLE_DEBUG if (notinrom ()) - write_log (L"POTGO %04X %s\n", v, debuginfo(0)); + write_log (_T("POTGO %04X %s\n"), v, debuginfo(0)); #endif dongle_potgo (v); potgo_value = potgo_value & 0x5500; /* keep state of data bits */ @@ -2299,10 +2299,10 @@ uae_u16 POTGOR (void) v = dongle_potgor (v); #ifdef DONGLE_DEBUG if (notinrom ()) - write_log (L"POTGOR %04X %s\n", v, debuginfo(0)); + write_log (_T("POTGOR %04X %s\n"), v, debuginfo(0)); #endif if (inputdevice_logging & 16) - write_log (L"POTGO_R: %04X %08X %d\n", v, M68K_GETPC, cd32_shifter[1]); + write_log (_T("POTGO_R: %04X %08X %d\n"), v, M68K_GETPC, cd32_shifter[1]); return v; } @@ -2339,7 +2339,7 @@ static void queue_input_event (int event, int state, int max, int linecnt, int a break; } if (i == INPUT_QUEUE_SIZE) { - write_log (L"input queue overflow\n"); + write_log (_T("input queue overflow\n")); return; } iq->event = event; @@ -2398,7 +2398,7 @@ void inputdevice_do_keyboard (int code, int state) } if (record_key ((uae_u8)((key << 1) | (key >> 7)))) { if (inputdevice_logging & 1) - write_log (L"Amiga key %02X %d\n", key & 0x7f, key >> 7); + write_log (_T("Amiga key %02X %d\n"), key & 0x7f, key >> 7); } return; } @@ -2447,7 +2447,7 @@ void inputdevice_handle_inputcode (void) inputcode_pending = 0; if (vpos != 0) - write_log (L"inputcode=%d but vpos = %d", code, vpos); + write_log (_T("inputcode=%d but vpos = %d"), code, vpos); #ifdef ARCADIA switch (code) @@ -2694,7 +2694,7 @@ static int handle_custom_event (TCHAR *custom) if (custom == NULL) return 0; - //write_log (L"%s\n", custom); + //write_log (_T("%s\n"), custom); p = buf = my_strdup (custom); while (p && *p) { TCHAR *p2; @@ -2756,7 +2756,7 @@ static int handle_input_event (int nr, int state, int max, int autofire, bool ca } if ((inputdevice_logging & 1) || input_record || input_play) - write_log (L"STATE=%05d MAX=%05d AF=%d QUAL=%08x '%s' \n", state, max, autofire, qualifiers, ie->name); + write_log (_T("STATE=%05d MAX=%05d AF=%d QUAL=%08x '%s' \n"), state, max, autofire, qualifiers, ie->name); if (autofire) { if (state) queue_input_event (nr, state, max, currprefs.input_autofire_linecnt, 1); @@ -3082,7 +3082,7 @@ static void inputdevice_checkconfig (void) void inputdevice_vsync (void) { if (inputdevice_logging & 32) - write_log (L"*\n"); + write_log (_T("*\n")); input_frame++; mouseupdate (0, 1); @@ -3198,7 +3198,7 @@ static int switchdevice (struct uae_input_device *id, int num, bool buttonmode) if (flags) return 0; if (name) { - write_log (L"inputdevice change '%s':%d->%d\n", name, num, newport); + write_log (_T("inputdevice change '%s':%d->%d\n"), name, num, newport); inputdevice_joyport_config (&changed_prefs, name, newport, -1, 2); inputdevice_copyconfig (&changed_prefs, &currprefs); return 1; @@ -3258,7 +3258,7 @@ static int switchdevice (struct uae_input_device *id, int num, bool buttonmode) } } } - write_log (L"inputdevice change '%s':%d->%d\n", name, num, newport); + write_log (_T("inputdevice change '%s':%d->%d\n"), name, num, newport); inputdevice_copyconfig (&currprefs, &changed_prefs); inputdevice_copyconfig (&changed_prefs, &currprefs); return 1; @@ -4814,7 +4814,7 @@ void inputdevice_devicechange (struct uae_prefs *prefs) xfree (jports[i]); } else if (jportskb[i] >= 0) { TCHAR tmp[10]; - _stprintf (tmp, L"kbd%d", jportskb[i]); + _stprintf (tmp, _T("kbd%d"), jportskb[i]); inputdevice_joyport_config (prefs, tmp, i, jportsmode[i], 0); } } @@ -5309,7 +5309,7 @@ int inputdevice_get_mapping (int devnum, int num, int *pflags, int *pport, TCHAR TCHAR *customp = NULL; if (name) - _tcscpy (name, L""); + _tcscpy (name, _T("")); if (custom) custom[0] = 0; if (pflags) @@ -5609,7 +5609,7 @@ void inputdevice_acquire (int allmode) idev[IDTYPE_MOUSE].acquire (-1, 0); idev[IDTYPE_KEYBOARD].acquire (-1, 0); // if (!input_acquired) - // write_log (L"input devices acquired (%s)\n", allmode ? "all" : "selected only"); + // write_log (_T("input devices acquired (%s)\n"), allmode ? "all" : "selected only"); input_acquired = 1; } @@ -5672,7 +5672,7 @@ void inputdevice_testrecord (int type, int num, int wtype, int wnum, int state) if (!state) return; - //write_log (L"%d %d %d %d %d\n", type, num, wtype, wnum, state); + //write_log (_T("%d %d %d %d %d\n"), type, num, wtype, wnum, state); struct teststore *ts = &testmode_data[testmode_count]; ts->testmode_type = type; ts->testmode_num = num; @@ -6017,24 +6017,24 @@ int inputdevice_joyport_config (struct uae_prefs *p, const TCHAR *value, int por { int start = JPORT_NONE, got = 0, max = -1; const TCHAR *pp = 0; - if (_tcsncmp (value, L"kbd", 3) == 0) { + if (_tcsncmp (value, _T("kbd"), 3) == 0) { start = JSEM_KBDLAYOUT; pp = value + 3; got = 1; max = JSEM_LASTKBD; - } else if (_tcsncmp (value, L"joy", 3) == 0) { + } else if (_tcsncmp (value, _T("joy"), 3) == 0) { start = JSEM_JOYS; pp = value + 3; got = 1; max = idev[IDTYPE_JOYSTICK].get_num (); - } else if (_tcsncmp (value, L"mouse", 5) == 0) { + } else if (_tcsncmp (value, _T("mouse"), 5) == 0) { start = JSEM_MICE; pp = value + 5; got = 1; max = idev[IDTYPE_MOUSE].get_num (); - } else if (_tcscmp (value, L"none") == 0) { + } else if (_tcscmp (value, _T("none")) == 0) { got = 2; - } else if (_tcscmp (value, L"custom") == 0) { + } else if (_tcscmp (value, _T("custom")) == 0) { got = 2; start = JPORT_CUSTOM; } diff --git a/inputevents.def b/inputevents.def index b6607b4b..97e42d67 100644 --- a/inputevents.def +++ b/inputevents.def @@ -1,396 +1,396 @@ /* joystick/mouse port 1 */ -DEFEVENT(JOYPORT1_START,L"Joystick port 1", AM_INFO, 0,1,0) - -DEFEVENT(MOUSE1_FIRST, L"", AM_DUMMY, 0,0,0) - -DEFEVENT(MOUSE1_HORIZ,L"Mouse1 Horizontal",AM_MOUSE_AXIS|AM_JOY_AXIS,8,1,0) -DEFEVENT(MOUSE1_VERT,L"Mouse1 Vertical",AM_MOUSE_AXIS|AM_JOY_AXIS,8,1,1) -DEFEVENT(MOUSE1_HORIZ_INV,L"Mouse1 Horizontal (inverted)",AM_MOUSE_AXIS|AM_JOY_AXIS,8,1,0|IE_INVERT) -DEFEVENT(MOUSE1_VERT_INV,L"Mouse1 Vertical (inverted)",AM_MOUSE_AXIS|AM_JOY_AXIS,8,1,1|IE_INVERT) -DEFEVENT(MOUSE1_UP,L"Mouse1 Up",AM_KEY|AM_JOY_BUT|AM_MOUSE_BUT,32,1,DIR_UP) -DEFEVENT(MOUSE1_DOWN,L"Mouse1 Down",AM_KEY|AM_JOY_BUT|AM_MOUSE_BUT,32,1,DIR_DOWN) -DEFEVENT(MOUSE1_LEFT,L"Mouse1 Left",AM_KEY|AM_JOY_BUT|AM_MOUSE_BUT,64,1,DIR_LEFT) -DEFEVENT(MOUSE1_RIGHT,L"Mouse1 Right",AM_KEY|AM_JOY_BUT|AM_MOUSE_BUT,64,1,DIR_RIGHT) -DEFEVENT(MOUSE1_WHEEL,L"Mouse1 Wheel",AM_MOUSE_AXIS|AM_JOY_AXIS,8,1,2) - -DEFEVENT(MOUSE1_LAST, L"", AM_DUMMY, 0,0,0) - -DEFEVENT(MOUSE_CDTV_HORIZ,L"CDTV Mouse Horizontal",AM_JOY_AXIS,8,1,0|IE_CDTV) -DEFEVENT(MOUSE_CDTV_VERT,L"CDTV Mouse Vertical",AM_JOY_AXIS,8,1,1|IE_CDTV) -DEFEVENT(MOUSE_CDTV_UP,L"CDTV Mouse Up",AM_KEY|AM_JOY_BUT|AM_MOUSE_BUT,32,1,DIR_UP|IE_CDTV) -DEFEVENT(MOUSE_CDTV_DOWN,L"CDTV Mouse Down",AM_KEY|AM_JOY_BUT|AM_MOUSE_BUT,32,1,DIR_DOWN|IE_CDTV) -DEFEVENT(MOUSE_CDTV_LEFT,L"CDTV Mouse Left",AM_KEY|AM_JOY_BUT|AM_MOUSE_BUT,64,1,DIR_LEFT|IE_CDTV) -DEFEVENT(MOUSE_CDTV_RIGHT,L"CDTV Mouse Right",AM_KEY|AM_JOY_BUT|AM_MOUSE_BUT,64,1,DIR_RIGHT|IE_CDTV) - -DEFEVENT(JOY1_HORIZ,L"Joy1 Horizontal",AM_JOY_AXIS,0,1,DIR_LEFT|DIR_RIGHT) -DEFEVENT(JOY1_VERT,L"Joy1 Vertical",AM_JOY_AXIS,0,1,DIR_UP|DIR_DOWN) -DEFEVENT(JOY1_HORIZ_POT,L"Joy1 Horizontal (Analog)",AM_JOY_AXIS,128,1,1) -DEFEVENT(JOY1_VERT_POT,L"Joy1 Vertical (Analog)",AM_JOY_AXIS,128,1,0) -DEFEVENT(JOY1_HORIZ_POT_INV,L"Joy1 Horizontal (Analog, inverted)",AM_JOY_AXIS,128,1,1|IE_INVERT) -DEFEVENT(JOY1_VERT_POT_INV,L"Joy1 Vertical (Analog, inverted)",AM_JOY_AXIS,128,1,0|IE_INVERT) - -DEFEVENT(JOY1_LEFT,L"Joy1 Left",AM_K,16,1,DIR_LEFT) -DEFEVENT(JOY1_RIGHT,L"Joy1 Right",AM_K,16,1,DIR_RIGHT) -DEFEVENT(JOY1_UP,L"Joy1 Up",AM_K,16,1,DIR_UP) -DEFEVENT(JOY1_DOWN,L"Joy1 Down",AM_K,16,1,DIR_DOWN) -DEFEVENT(JOY1_LEFT_UP,L"Joy1 Left+Up",AM_K,16,1,DIR_LEFT|DIR_UP) -DEFEVENT(JOY1_LEFT_DOWN,L"Joy1 Left+Down",AM_K,16,1,DIR_LEFT|DIR_DOWN) -DEFEVENT(JOY1_RIGHT_UP,L"Joy1 Right+Up",AM_K,16,1,DIR_RIGHT|DIR_UP) -DEFEVENT(JOY1_RIGHT_DOWN,L"Joy1 Right+Down",AM_K,16,1,DIR_RIGHT|DIR_DOWN) - -DEFEVENT(JOY1_FIRE_BUTTON,L"Joy1 Fire/Mouse1 Left Button",AM_K,4,1,JOYBUTTON_1) -DEFEVENT(JOY1_2ND_BUTTON,L"Joy1 2nd Button/Mouse1 Right Button",AM_K,4,1,JOYBUTTON_2) -DEFEVENT(JOY1_3RD_BUTTON,L"Joy1 3rd Button/Mouse1 Middle Button",AM_K,4,1,JOYBUTTON_3) -DEFEVENT(JOY1_CD32_PLAY,L"Joy1 CD32 Play",AM_K,4,1,JOYBUTTON_CD32_PLAY) -DEFEVENT(JOY1_CD32_RWD,L"Joy1 CD32 RWD",AM_K,4,1,JOYBUTTON_CD32_RWD) -DEFEVENT(JOY1_CD32_FFW,L"Joy1 CD32 FFW",AM_K,4,1,JOYBUTTON_CD32_FFW) -DEFEVENT(JOY1_CD32_GREEN,L"Joy1 CD32 Green",AM_K,4,1,JOYBUTTON_CD32_GREEN) -DEFEVENT(JOY1_CD32_YELLOW,L"Joy1 CD32 Yellow",AM_K,4,1,JOYBUTTON_CD32_YELLOW) -DEFEVENT(JOY1_CD32_RED,L"Joy1 CD32 Red",AM_K,4,1,JOYBUTTON_CD32_RED) -DEFEVENT(JOY1_CD32_BLUE,L"Joy1 CD32 Blue",AM_K,4,1,JOYBUTTON_CD32_BLUE) +DEFEVENT(JOYPORT1_START,_T("Joystick port 1"), AM_INFO, 0,1,0) + +DEFEVENT(MOUSE1_FIRST, _T(""), AM_DUMMY, 0,0,0) + +DEFEVENT(MOUSE1_HORIZ,_T("Mouse1 Horizontal"),AM_MOUSE_AXIS|AM_JOY_AXIS,8,1,0) +DEFEVENT(MOUSE1_VERT,_T("Mouse1 Vertical"),AM_MOUSE_AXIS|AM_JOY_AXIS,8,1,1) +DEFEVENT(MOUSE1_HORIZ_INV,_T("Mouse1 Horizontal (inverted)"),AM_MOUSE_AXIS|AM_JOY_AXIS,8,1,0|IE_INVERT) +DEFEVENT(MOUSE1_VERT_INV,_T("Mouse1 Vertical (inverted)"),AM_MOUSE_AXIS|AM_JOY_AXIS,8,1,1|IE_INVERT) +DEFEVENT(MOUSE1_UP,_T("Mouse1 Up"),AM_KEY|AM_JOY_BUT|AM_MOUSE_BUT,32,1,DIR_UP) +DEFEVENT(MOUSE1_DOWN,_T("Mouse1 Down"),AM_KEY|AM_JOY_BUT|AM_MOUSE_BUT,32,1,DIR_DOWN) +DEFEVENT(MOUSE1_LEFT,_T("Mouse1 Left"),AM_KEY|AM_JOY_BUT|AM_MOUSE_BUT,64,1,DIR_LEFT) +DEFEVENT(MOUSE1_RIGHT,_T("Mouse1 Right"),AM_KEY|AM_JOY_BUT|AM_MOUSE_BUT,64,1,DIR_RIGHT) +DEFEVENT(MOUSE1_WHEEL,_T("Mouse1 Wheel"),AM_MOUSE_AXIS|AM_JOY_AXIS,8,1,2) + +DEFEVENT(MOUSE1_LAST, _T(""), AM_DUMMY, 0,0,0) + +DEFEVENT(MOUSE_CDTV_HORIZ,_T("CDTV Mouse Horizontal"),AM_JOY_AXIS,8,1,0|IE_CDTV) +DEFEVENT(MOUSE_CDTV_VERT,_T("CDTV Mouse Vertical"),AM_JOY_AXIS,8,1,1|IE_CDTV) +DEFEVENT(MOUSE_CDTV_UP,_T("CDTV Mouse Up"),AM_KEY|AM_JOY_BUT|AM_MOUSE_BUT,32,1,DIR_UP|IE_CDTV) +DEFEVENT(MOUSE_CDTV_DOWN,_T("CDTV Mouse Down"),AM_KEY|AM_JOY_BUT|AM_MOUSE_BUT,32,1,DIR_DOWN|IE_CDTV) +DEFEVENT(MOUSE_CDTV_LEFT,_T("CDTV Mouse Left"),AM_KEY|AM_JOY_BUT|AM_MOUSE_BUT,64,1,DIR_LEFT|IE_CDTV) +DEFEVENT(MOUSE_CDTV_RIGHT,_T("CDTV Mouse Right"),AM_KEY|AM_JOY_BUT|AM_MOUSE_BUT,64,1,DIR_RIGHT|IE_CDTV) + +DEFEVENT(JOY1_HORIZ,_T("Joy1 Horizontal"),AM_JOY_AXIS,0,1,DIR_LEFT|DIR_RIGHT) +DEFEVENT(JOY1_VERT,_T("Joy1 Vertical"),AM_JOY_AXIS,0,1,DIR_UP|DIR_DOWN) +DEFEVENT(JOY1_HORIZ_POT,_T("Joy1 Horizontal (Analog)"),AM_JOY_AXIS,128,1,1) +DEFEVENT(JOY1_VERT_POT,_T("Joy1 Vertical (Analog)"),AM_JOY_AXIS,128,1,0) +DEFEVENT(JOY1_HORIZ_POT_INV,_T("Joy1 Horizontal (Analog, inverted)"),AM_JOY_AXIS,128,1,1|IE_INVERT) +DEFEVENT(JOY1_VERT_POT_INV,_T("Joy1 Vertical (Analog, inverted)"),AM_JOY_AXIS,128,1,0|IE_INVERT) + +DEFEVENT(JOY1_LEFT,_T("Joy1 Left"),AM_K,16,1,DIR_LEFT) +DEFEVENT(JOY1_RIGHT,_T("Joy1 Right"),AM_K,16,1,DIR_RIGHT) +DEFEVENT(JOY1_UP,_T("Joy1 Up"),AM_K,16,1,DIR_UP) +DEFEVENT(JOY1_DOWN,_T("Joy1 Down"),AM_K,16,1,DIR_DOWN) +DEFEVENT(JOY1_LEFT_UP,_T("Joy1 Left+Up"),AM_K,16,1,DIR_LEFT|DIR_UP) +DEFEVENT(JOY1_LEFT_DOWN,_T("Joy1 Left+Down"),AM_K,16,1,DIR_LEFT|DIR_DOWN) +DEFEVENT(JOY1_RIGHT_UP,_T("Joy1 Right+Up"),AM_K,16,1,DIR_RIGHT|DIR_UP) +DEFEVENT(JOY1_RIGHT_DOWN,_T("Joy1 Right+Down"),AM_K,16,1,DIR_RIGHT|DIR_DOWN) + +DEFEVENT(JOY1_FIRE_BUTTON,_T("Joy1 Fire/Mouse1 Left Button"),AM_K,4,1,JOYBUTTON_1) +DEFEVENT(JOY1_2ND_BUTTON,_T("Joy1 2nd Button/Mouse1 Right Button"),AM_K,4,1,JOYBUTTON_2) +DEFEVENT(JOY1_3RD_BUTTON,_T("Joy1 3rd Button/Mouse1 Middle Button"),AM_K,4,1,JOYBUTTON_3) +DEFEVENT(JOY1_CD32_PLAY,_T("Joy1 CD32 Play"),AM_K,4,1,JOYBUTTON_CD32_PLAY) +DEFEVENT(JOY1_CD32_RWD,_T("Joy1 CD32 RWD"),AM_K,4,1,JOYBUTTON_CD32_RWD) +DEFEVENT(JOY1_CD32_FFW,_T("Joy1 CD32 FFW"),AM_K,4,1,JOYBUTTON_CD32_FFW) +DEFEVENT(JOY1_CD32_GREEN,_T("Joy1 CD32 Green"),AM_K,4,1,JOYBUTTON_CD32_GREEN) +DEFEVENT(JOY1_CD32_YELLOW,_T("Joy1 CD32 Yellow"),AM_K,4,1,JOYBUTTON_CD32_YELLOW) +DEFEVENT(JOY1_CD32_RED,_T("Joy1 CD32 Red"),AM_K,4,1,JOYBUTTON_CD32_RED) +DEFEVENT(JOY1_CD32_BLUE,_T("Joy1 CD32 Blue"),AM_K,4,1,JOYBUTTON_CD32_BLUE) /* joystick/mouse port 2 */ -DEFEVENT(JOYPORT2_START,L"Joystick port 2", AM_INFO, 0,2,0) - -DEFEVENT(MOUSE2_FIRST, L"", AM_DUMMY, 0,0,0) - -DEFEVENT(MOUSE2_HORIZ,L"Mouse2 Horizontal",AM_MOUSE_AXIS|AM_JOY_AXIS,8,2,0) -DEFEVENT(MOUSE2_VERT,L"Mouse2 Vertical",AM_MOUSE_AXIS|AM_JOY_AXIS,8,2,1) -DEFEVENT(MOUSE2_HORIZ_INV,L"Mouse2 Horizontal (inverted)",AM_MOUSE_AXIS|AM_JOY_AXIS,8,2,0|IE_INVERT) -DEFEVENT(MOUSE2_VERT_INV,L"Mouse2 Vertical (inverted)",AM_MOUSE_AXIS|AM_JOY_AXIS,8,2,1|IE_INVERT) -DEFEVENT(MOUSE2_UP,L"Mouse2 Up",AM_KEY|AM_JOY_BUT|AM_MOUSE_BUT,32,2,DIR_UP) -DEFEVENT(MOUSE2_DOWN,L"Mouse2 Down",AM_KEY|AM_JOY_BUT|AM_MOUSE_BUT,32,2,DIR_DOWN) -DEFEVENT(MOUSE2_LEFT,L"Mouse2 Left",AM_KEY|AM_JOY_BUT|AM_MOUSE_BUT,64,2,DIR_LEFT) -DEFEVENT(MOUSE2_RIGHT,L"Mouse2 Right",AM_KEY|AM_JOY_BUT|AM_MOUSE_BUT,64,2,DIR_RIGHT) - -DEFEVENT(MOUSE2_LAST, L"", AM_DUMMY, 0,0,0) - -DEFEVENT(JOY2_HORIZ,L"Joy2 Horizontal",AM_JOY_AXIS,0,2,DIR_LEFT|DIR_RIGHT) -DEFEVENT(JOY2_VERT,L"Joy2 Vertical",AM_JOY_AXIS,0,2,DIR_UP|DIR_DOWN) -DEFEVENT(JOY2_HORIZ_POT,L"Joy2 Horizontal (Analog)",AM_JOY_AXIS,128,2,1) -DEFEVENT(JOY2_VERT_POT,L"Joy2 Vertical (Analog)",AM_JOY_AXIS,128,2,0) -DEFEVENT(JOY2_HORIZ_POT_INV,L"Joy2 Horizontal (Analog, inverted)",AM_JOY_AXIS,128,2,1|IE_INVERT) -DEFEVENT(JOY2_VERT_POT_INV,L"Joy2 Vertical (Analog, inverted)",AM_JOY_AXIS,128,2,0|IE_INVERT) - -DEFEVENT(JOY2_LEFT,L"Joy2 Left",AM_K,16,2,DIR_LEFT) -DEFEVENT(JOY2_RIGHT,L"Joy2 Right",AM_K,16,2,DIR_RIGHT) -DEFEVENT(JOY2_UP,L"Joy2 Up",AM_K,16,2,DIR_UP) -DEFEVENT(JOY2_DOWN,L"Joy2 Down",AM_K,16,2,DIR_DOWN) -DEFEVENT(JOY2_LEFT_UP,L"Joy2 Left+Up",AM_K,16,2,DIR_LEFT|DIR_UP) -DEFEVENT(JOY2_LEFT_DOWN,L"Joy2 Left+Down",AM_K,16,2,DIR_LEFT|DIR_DOWN) -DEFEVENT(JOY2_RIGHT_UP,L"Joy2 Right+Up",AM_K,16,2,DIR_RIGHT|DIR_UP) -DEFEVENT(JOY2_RIGHT_DOWN,L"Joy2 Right+Down",AM_K,16,2,DIR_RIGHT|DIR_DOWN) - -DEFEVENT(JOY2_FIRE_BUTTON,L"Joy2 Fire/Mouse2 Left Button",AM_K,4,2,JOYBUTTON_1) -DEFEVENT(JOY2_2ND_BUTTON,L"Joy2 2nd Button/Mouse2 Right Button",AM_K,4,2,JOYBUTTON_2) -DEFEVENT(JOY2_3RD_BUTTON,L"Joy2 3rd Button/Mouse2 Middle Button",AM_K,4,2,JOYBUTTON_3) -DEFEVENT(JOY2_CD32_PLAY,L"Joy2 CD32 Play",AM_K,4,2,JOYBUTTON_CD32_PLAY) -DEFEVENT(JOY2_CD32_RWD,L"Joy2 CD32 RWD",AM_K,4,2,JOYBUTTON_CD32_RWD) -DEFEVENT(JOY2_CD32_FFW,L"Joy2 CD32 FFW",AM_K,4,2,JOYBUTTON_CD32_FFW) -DEFEVENT(JOY2_CD32_GREEN,L"Joy2 CD32 Green",AM_K,4,2,JOYBUTTON_CD32_GREEN) -DEFEVENT(JOY2_CD32_YELLOW,L"Joy2 CD32 Yellow",AM_K,4,2,JOYBUTTON_CD32_YELLOW) -DEFEVENT(JOY2_CD32_RED,L"Joy2 CD32 Red",AM_K,4,2,JOYBUTTON_CD32_RED) -DEFEVENT(JOY2_CD32_BLUE,L"Joy2 CD32 Blue",AM_K,4,2,JOYBUTTON_CD32_BLUE) - -DEFEVENT(LIGHTPEN_HORIZ,L"Lightpen Horizontal",AM_MOUSE_AXIS|AM_JOY_AXIS,0,5,0) -DEFEVENT(LIGHTPEN_VERT,L"Lightpen Vertical",AM_MOUSE_AXIS|AM_JOY_AXIS,0,5,1) -DEFEVENT(LIGHTPEN_LEFT,L"Lightpen Left",AM_K,1,5,DIR_LEFT) -DEFEVENT(LIGHTPEN_RIGHT,L"Lightpen Right",AM_K,1,5,DIR_RIGHT) -DEFEVENT(LIGHTPEN_UP,L"Lightpen Up",AM_K,1,5,DIR_UP) -DEFEVENT(LIGHTPEN_DOWN,L"Lightpen Down",AM_K,1,5,DIR_DOWN) +DEFEVENT(JOYPORT2_START,_T("Joystick port 2"), AM_INFO, 0,2,0) + +DEFEVENT(MOUSE2_FIRST, _T(""), AM_DUMMY, 0,0,0) + +DEFEVENT(MOUSE2_HORIZ,_T("Mouse2 Horizontal"),AM_MOUSE_AXIS|AM_JOY_AXIS,8,2,0) +DEFEVENT(MOUSE2_VERT,_T("Mouse2 Vertical"),AM_MOUSE_AXIS|AM_JOY_AXIS,8,2,1) +DEFEVENT(MOUSE2_HORIZ_INV,_T("Mouse2 Horizontal (inverted)"),AM_MOUSE_AXIS|AM_JOY_AXIS,8,2,0|IE_INVERT) +DEFEVENT(MOUSE2_VERT_INV,_T("Mouse2 Vertical (inverted)"),AM_MOUSE_AXIS|AM_JOY_AXIS,8,2,1|IE_INVERT) +DEFEVENT(MOUSE2_UP,_T("Mouse2 Up"),AM_KEY|AM_JOY_BUT|AM_MOUSE_BUT,32,2,DIR_UP) +DEFEVENT(MOUSE2_DOWN,_T("Mouse2 Down"),AM_KEY|AM_JOY_BUT|AM_MOUSE_BUT,32,2,DIR_DOWN) +DEFEVENT(MOUSE2_LEFT,_T("Mouse2 Left"),AM_KEY|AM_JOY_BUT|AM_MOUSE_BUT,64,2,DIR_LEFT) +DEFEVENT(MOUSE2_RIGHT,_T("Mouse2 Right"),AM_KEY|AM_JOY_BUT|AM_MOUSE_BUT,64,2,DIR_RIGHT) + +DEFEVENT(MOUSE2_LAST, _T(""), AM_DUMMY, 0,0,0) + +DEFEVENT(JOY2_HORIZ,_T("Joy2 Horizontal"),AM_JOY_AXIS,0,2,DIR_LEFT|DIR_RIGHT) +DEFEVENT(JOY2_VERT,_T("Joy2 Vertical"),AM_JOY_AXIS,0,2,DIR_UP|DIR_DOWN) +DEFEVENT(JOY2_HORIZ_POT,_T("Joy2 Horizontal (Analog)"),AM_JOY_AXIS,128,2,1) +DEFEVENT(JOY2_VERT_POT,_T("Joy2 Vertical (Analog)"),AM_JOY_AXIS,128,2,0) +DEFEVENT(JOY2_HORIZ_POT_INV,_T("Joy2 Horizontal (Analog, inverted)"),AM_JOY_AXIS,128,2,1|IE_INVERT) +DEFEVENT(JOY2_VERT_POT_INV,_T("Joy2 Vertical (Analog, inverted)"),AM_JOY_AXIS,128,2,0|IE_INVERT) + +DEFEVENT(JOY2_LEFT,_T("Joy2 Left"),AM_K,16,2,DIR_LEFT) +DEFEVENT(JOY2_RIGHT,_T("Joy2 Right"),AM_K,16,2,DIR_RIGHT) +DEFEVENT(JOY2_UP,_T("Joy2 Up"),AM_K,16,2,DIR_UP) +DEFEVENT(JOY2_DOWN,_T("Joy2 Down"),AM_K,16,2,DIR_DOWN) +DEFEVENT(JOY2_LEFT_UP,_T("Joy2 Left+Up"),AM_K,16,2,DIR_LEFT|DIR_UP) +DEFEVENT(JOY2_LEFT_DOWN,_T("Joy2 Left+Down"),AM_K,16,2,DIR_LEFT|DIR_DOWN) +DEFEVENT(JOY2_RIGHT_UP,_T("Joy2 Right+Up"),AM_K,16,2,DIR_RIGHT|DIR_UP) +DEFEVENT(JOY2_RIGHT_DOWN,_T("Joy2 Right+Down"),AM_K,16,2,DIR_RIGHT|DIR_DOWN) + +DEFEVENT(JOY2_FIRE_BUTTON,_T("Joy2 Fire/Mouse2 Left Button"),AM_K,4,2,JOYBUTTON_1) +DEFEVENT(JOY2_2ND_BUTTON,_T("Joy2 2nd Button/Mouse2 Right Button"),AM_K,4,2,JOYBUTTON_2) +DEFEVENT(JOY2_3RD_BUTTON,_T("Joy2 3rd Button/Mouse2 Middle Button"),AM_K,4,2,JOYBUTTON_3) +DEFEVENT(JOY2_CD32_PLAY,_T("Joy2 CD32 Play"),AM_K,4,2,JOYBUTTON_CD32_PLAY) +DEFEVENT(JOY2_CD32_RWD,_T("Joy2 CD32 RWD"),AM_K,4,2,JOYBUTTON_CD32_RWD) +DEFEVENT(JOY2_CD32_FFW,_T("Joy2 CD32 FFW"),AM_K,4,2,JOYBUTTON_CD32_FFW) +DEFEVENT(JOY2_CD32_GREEN,_T("Joy2 CD32 Green"),AM_K,4,2,JOYBUTTON_CD32_GREEN) +DEFEVENT(JOY2_CD32_YELLOW,_T("Joy2 CD32 Yellow"),AM_K,4,2,JOYBUTTON_CD32_YELLOW) +DEFEVENT(JOY2_CD32_RED,_T("Joy2 CD32 Red"),AM_K,4,2,JOYBUTTON_CD32_RED) +DEFEVENT(JOY2_CD32_BLUE,_T("Joy2 CD32 Blue"),AM_K,4,2,JOYBUTTON_CD32_BLUE) + +DEFEVENT(LIGHTPEN_HORIZ,_T("Lightpen Horizontal"),AM_MOUSE_AXIS|AM_JOY_AXIS,0,5,0) +DEFEVENT(LIGHTPEN_VERT,_T("Lightpen Vertical"),AM_MOUSE_AXIS|AM_JOY_AXIS,0,5,1) +DEFEVENT(LIGHTPEN_LEFT,_T("Lightpen Left"),AM_K,1,5,DIR_LEFT) +DEFEVENT(LIGHTPEN_RIGHT,_T("Lightpen Right"),AM_K,1,5,DIR_RIGHT) +DEFEVENT(LIGHTPEN_UP,_T("Lightpen Up"),AM_K,1,5,DIR_UP) +DEFEVENT(LIGHTPEN_DOWN,_T("Lightpen Down"),AM_K,1,5,DIR_DOWN) /* parallel port joystick adapter */ -DEFEVENT(PAR_JOY1_START, L"Parallel port joystick adapter", AM_INFO, 0,3,0) - -DEFEVENT(PAR_JOY1_HORIZ,L"Parallel Joy1 Horizontal",AM_JOY_AXIS,0,3,DIR_LEFT|DIR_RIGHT) -DEFEVENT(PAR_JOY1_VERT,L"Parallel Joy1 Vertical",AM_JOY_AXIS,0,3,DIR_UP|DIR_DOWN) -DEFEVENT(PAR_JOY1_LEFT,L"Parallel Joy1 Left",AM_K,16,3,DIR_LEFT) -DEFEVENT(PAR_JOY1_RIGHT,L"Parallel Joy1 Right",AM_K,16,3,DIR_RIGHT) -DEFEVENT(PAR_JOY1_UP,L"Parallel Joy1 Up",AM_K,16,3,DIR_UP) -DEFEVENT(PAR_JOY1_DOWN,L"Parallel Joy1 Down",AM_K,16,3,DIR_DOWN) -DEFEVENT(PAR_JOY1_LEFT_UP,L"Parallel Joy1 Left+Up",AM_K,16,3,DIR_LEFT|DIR_UP) -DEFEVENT(PAR_JOY1_LEFT_DOWN,L"Parallel Joy1 Left+Down",AM_K,16,3,DIR_LEFT|DIR_DOWN) -DEFEVENT(PAR_JOY1_RIGHT_UP,L"Parallel Joy1 Right+Up",AM_K,16,3,DIR_RIGHT|DIR_UP) -DEFEVENT(PAR_JOY1_RIGHT_DOWN,L"Parallel Joy1 Right+Down",AM_K,16,3,DIR_RIGHT|DIR_DOWN) -DEFEVENT(PAR_JOY1_FIRE_BUTTON,L"Parallel Joy1 Fire Button",AM_K,4,3,JOYBUTTON_1) -DEFEVENT(PAR_JOY1_2ND_BUTTON,L"Parallel Joy1 Spare/2nd Button",AM_K,4,3,JOYBUTTON_2) - -DEFEVENT(PAR_JOY2_START, L"", AM_DUMMY, 0,4,0) - -DEFEVENT(PAR_JOY2_HORIZ,L"Parallel Joy2 Horizontal",AM_JOY_AXIS,0,4,DIR_LEFT|DIR_RIGHT) -DEFEVENT(PAR_JOY2_VERT,L"Parallel Joy2 Vertical",AM_JOY_AXIS,0,4,DIR_UP|DIR_DOWN) -DEFEVENT(PAR_JOY2_LEFT,L"Parallel Joy2 Left",AM_K,16,4,DIR_LEFT) -DEFEVENT(PAR_JOY2_RIGHT,L"Parallel Joy2 Right",AM_K,16,4,DIR_RIGHT) -DEFEVENT(PAR_JOY2_UP,L"Parallel Joy2 Up",AM_K,16,4,DIR_UP) -DEFEVENT(PAR_JOY2_DOWN,L"Parallel Joy2 Down",AM_K,16,4,DIR_DOWN) -DEFEVENT(PAR_JOY2_LEFT_UP,L"Parallel Joy2 Left+Up",AM_K,16,4,DIR_LEFT|DIR_UP) -DEFEVENT(PAR_JOY2_LEFT_DOWN,L"Parallel Joy2 Left+Down",AM_K,16,4,DIR_LEFT|DIR_DOWN) -DEFEVENT(PAR_JOY2_RIGHT_UP,L"Parallel Joy2 Right+Up",AM_K,16,4,DIR_RIGHT|DIR_UP) -DEFEVENT(PAR_JOY2_RIGHT_DOWN,L"Parallel Joy2 Right+Down",AM_K,16,4,DIR_RIGHT|DIR_DOWN) -DEFEVENT(PAR_JOY2_FIRE_BUTTON,L"Parallel Joy2 Fire Button",AM_K,4,4,JOYBUTTON_1) -DEFEVENT(PAR_JOY2_2ND_BUTTON,L"Parallel Joy2 Spare/2nd Button",AM_K,4,4,JOYBUTTON_2) - -DEFEVENT(PAR_JOY_END, L"", AM_DUMMY, 0,0,0) +DEFEVENT(PAR_JOY1_START, _T("Parallel port joystick adapter"), AM_INFO, 0,3,0) + +DEFEVENT(PAR_JOY1_HORIZ,_T("Parallel Joy1 Horizontal"),AM_JOY_AXIS,0,3,DIR_LEFT|DIR_RIGHT) +DEFEVENT(PAR_JOY1_VERT,_T("Parallel Joy1 Vertical"),AM_JOY_AXIS,0,3,DIR_UP|DIR_DOWN) +DEFEVENT(PAR_JOY1_LEFT,_T("Parallel Joy1 Left"),AM_K,16,3,DIR_LEFT) +DEFEVENT(PAR_JOY1_RIGHT,_T("Parallel Joy1 Right"),AM_K,16,3,DIR_RIGHT) +DEFEVENT(PAR_JOY1_UP,_T("Parallel Joy1 Up"),AM_K,16,3,DIR_UP) +DEFEVENT(PAR_JOY1_DOWN,_T("Parallel Joy1 Down"),AM_K,16,3,DIR_DOWN) +DEFEVENT(PAR_JOY1_LEFT_UP,_T("Parallel Joy1 Left+Up"),AM_K,16,3,DIR_LEFT|DIR_UP) +DEFEVENT(PAR_JOY1_LEFT_DOWN,_T("Parallel Joy1 Left+Down"),AM_K,16,3,DIR_LEFT|DIR_DOWN) +DEFEVENT(PAR_JOY1_RIGHT_UP,_T("Parallel Joy1 Right+Up"),AM_K,16,3,DIR_RIGHT|DIR_UP) +DEFEVENT(PAR_JOY1_RIGHT_DOWN,_T("Parallel Joy1 Right+Down"),AM_K,16,3,DIR_RIGHT|DIR_DOWN) +DEFEVENT(PAR_JOY1_FIRE_BUTTON,_T("Parallel Joy1 Fire Button"),AM_K,4,3,JOYBUTTON_1) +DEFEVENT(PAR_JOY1_2ND_BUTTON,_T("Parallel Joy1 Spare/2nd Button"),AM_K,4,3,JOYBUTTON_2) + +DEFEVENT(PAR_JOY2_START, _T(""), AM_DUMMY, 0,4,0) + +DEFEVENT(PAR_JOY2_HORIZ,_T("Parallel Joy2 Horizontal"),AM_JOY_AXIS,0,4,DIR_LEFT|DIR_RIGHT) +DEFEVENT(PAR_JOY2_VERT,_T("Parallel Joy2 Vertical"),AM_JOY_AXIS,0,4,DIR_UP|DIR_DOWN) +DEFEVENT(PAR_JOY2_LEFT,_T("Parallel Joy2 Left"),AM_K,16,4,DIR_LEFT) +DEFEVENT(PAR_JOY2_RIGHT,_T("Parallel Joy2 Right"),AM_K,16,4,DIR_RIGHT) +DEFEVENT(PAR_JOY2_UP,_T("Parallel Joy2 Up"),AM_K,16,4,DIR_UP) +DEFEVENT(PAR_JOY2_DOWN,_T("Parallel Joy2 Down"),AM_K,16,4,DIR_DOWN) +DEFEVENT(PAR_JOY2_LEFT_UP,_T("Parallel Joy2 Left+Up"),AM_K,16,4,DIR_LEFT|DIR_UP) +DEFEVENT(PAR_JOY2_LEFT_DOWN,_T("Parallel Joy2 Left+Down"),AM_K,16,4,DIR_LEFT|DIR_DOWN) +DEFEVENT(PAR_JOY2_RIGHT_UP,_T("Parallel Joy2 Right+Up"),AM_K,16,4,DIR_RIGHT|DIR_UP) +DEFEVENT(PAR_JOY2_RIGHT_DOWN,_T("Parallel Joy2 Right+Down"),AM_K,16,4,DIR_RIGHT|DIR_DOWN) +DEFEVENT(PAR_JOY2_FIRE_BUTTON,_T("Parallel Joy2 Fire Button"),AM_K,4,4,JOYBUTTON_1) +DEFEVENT(PAR_JOY2_2ND_BUTTON,_T("Parallel Joy2 Spare/2nd Button"),AM_K,4,4,JOYBUTTON_2) + +DEFEVENT(PAR_JOY_END, _T(""), AM_DUMMY, 0,0,0) /* qualifiers */ -DEFEVENT(SPC_QUALIFIER_START,L"Qualifiers",AM_INFO, 0,0,0) +DEFEVENT(SPC_QUALIFIER_START,_T("Qualifiers"),AM_INFO, 0,0,0) -DEFEVENT(SPC_QUALIFIER1,L"Qualifier 1",AM_KK,0,0,AKS_QUALIFIER1) -DEFEVENT(SPC_QUALIFIER2,L"Qualifier 2",AM_KK,0,0,AKS_QUALIFIER2) -DEFEVENT(SPC_QUALIFIER3,L"Qualifier 3",AM_KK,0,0,AKS_QUALIFIER3) -DEFEVENT(SPC_QUALIFIER4,L"Qualifier 4",AM_KK,0,0,AKS_QUALIFIER4) -DEFEVENT(SPC_QUALIFIER5,L"Qualifier 5",AM_KK,0,0,AKS_QUALIFIER5) -DEFEVENT(SPC_QUALIFIER6,L"Qualifier 6",AM_KK,0,0,AKS_QUALIFIER6) -DEFEVENT(SPC_QUALIFIER7,L"Qualifier 7",AM_KK,0,0,AKS_QUALIFIER7) -DEFEVENT(SPC_QUALIFIER8,L"Qualifier 8",AM_KK,0,0,AKS_QUALIFIER8) -DEFEVENT(SPC_QUALIFIER_SPECIAL,L"Qualifier Special",AM_KK,0,0,AKS_QUALIFIER_SPECIAL) -DEFEVENT(SPC_QUALIFIER_SHIFT,L"Qualifier Shift",AM_KK,0,0,AKS_QUALIFIER_SHIFT) -DEFEVENT(SPC_QUALIFIER_CONTROL,L"Qualifier Control",AM_KK,0,0,AKS_QUALIFIER_CONTROL) -DEFEVENT(SPC_QUALIFIER_ALT,L"Qualifier Alt",AM_KK,0,0,AKS_QUALIFIER_ALT) +DEFEVENT(SPC_QUALIFIER1,_T("Qualifier 1"),AM_KK,0,0,AKS_QUALIFIER1) +DEFEVENT(SPC_QUALIFIER2,_T("Qualifier 2"),AM_KK,0,0,AKS_QUALIFIER2) +DEFEVENT(SPC_QUALIFIER3,_T("Qualifier 3"),AM_KK,0,0,AKS_QUALIFIER3) +DEFEVENT(SPC_QUALIFIER4,_T("Qualifier 4"),AM_KK,0,0,AKS_QUALIFIER4) +DEFEVENT(SPC_QUALIFIER5,_T("Qualifier 5"),AM_KK,0,0,AKS_QUALIFIER5) +DEFEVENT(SPC_QUALIFIER6,_T("Qualifier 6"),AM_KK,0,0,AKS_QUALIFIER6) +DEFEVENT(SPC_QUALIFIER7,_T("Qualifier 7"),AM_KK,0,0,AKS_QUALIFIER7) +DEFEVENT(SPC_QUALIFIER8,_T("Qualifier 8"),AM_KK,0,0,AKS_QUALIFIER8) +DEFEVENT(SPC_QUALIFIER_SPECIAL,_T("Qualifier Special"),AM_KK,0,0,AKS_QUALIFIER_SPECIAL) +DEFEVENT(SPC_QUALIFIER_SHIFT,_T("Qualifier Shift"),AM_KK,0,0,AKS_QUALIFIER_SHIFT) +DEFEVENT(SPC_QUALIFIER_CONTROL,_T("Qualifier Control"),AM_KK,0,0,AKS_QUALIFIER_CONTROL) +DEFEVENT(SPC_QUALIFIER_ALT,_T("Qualifier Alt"),AM_KK,0,0,AKS_QUALIFIER_ALT) -DEFEVENT(SPC_QUALIFIER_END, L"", AM_DUMMY, 0,0,0) +DEFEVENT(SPC_QUALIFIER_END, _T(""), AM_DUMMY, 0,0,0) /* keys */ -DEFEVENT(KEY_START,L"Keyboard",AM_INFO, 0,0,0) +DEFEVENT(KEY_START,_T("Keyboard"),AM_INFO, 0,0,0) -DEFEVENT(KEY_F1,L"F1",AM_K,0,0,AK_F1) -DEFEVENT(KEY_F2,L"F2",AM_K,0,0,AK_F2) -DEFEVENT(KEY_F3,L"F3",AM_K,0,0,AK_F3) -DEFEVENT(KEY_F4,L"F4",AM_K,0,0,AK_F4) -DEFEVENT(KEY_F5,L"F5",AM_K,0,0,AK_F5) -DEFEVENT(KEY_F6,L"F6",AM_K,0,0,AK_F6) -DEFEVENT(KEY_F7,L"F7",AM_K,0,0,AK_F7) -DEFEVENT(KEY_F8,L"F8",AM_K,0,0,AK_F8) -DEFEVENT(KEY_F9,L"F9",AM_K,0,0,AK_F9) -DEFEVENT(KEY_F10,L"F10",AM_K,0,0,AK_F10) +DEFEVENT(KEY_F1,_T("F1"),AM_K,0,0,AK_F1) +DEFEVENT(KEY_F2,_T("F2"),AM_K,0,0,AK_F2) +DEFEVENT(KEY_F3,_T("F3"),AM_K,0,0,AK_F3) +DEFEVENT(KEY_F4,_T("F4"),AM_K,0,0,AK_F4) +DEFEVENT(KEY_F5,_T("F5"),AM_K,0,0,AK_F5) +DEFEVENT(KEY_F6,_T("F6"),AM_K,0,0,AK_F6) +DEFEVENT(KEY_F7,_T("F7"),AM_K,0,0,AK_F7) +DEFEVENT(KEY_F8,_T("F8"),AM_K,0,0,AK_F8) +DEFEVENT(KEY_F9,_T("F9"),AM_K,0,0,AK_F9) +DEFEVENT(KEY_F10,_T("F10"),AM_K,0,0,AK_F10) /* "special" keys */ -DEFEVENT(KEY_ESC,L"ESC",AM_K,0,0,AK_ESC) -DEFEVENT(KEY_TAB,L"Tab",AM_K,0,0,AK_TAB) -DEFEVENT(KEY_CTRL,L"CTRL",AM_K,0,0,AK_CTRL) -DEFEVENT(KEY_CAPS_LOCK,L"Caps Lock",AM_K,0,0,AK_CAPSLOCK) -DEFEVENT(KEY_SHIFT_LEFT,L"Left Shift",AM_K,0,0,AK_LSH) -DEFEVENT(KEY_ALT_LEFT,L"Left Alt",AM_K,0,0,AK_LALT) -DEFEVENT(KEY_AMIGA_LEFT,L"Left Amiga",AM_K,0,0,AK_LAMI) -DEFEVENT(KEY_AMIGA_RIGHT,L"Right Amiga",AM_K,0,0,AK_RAMI) -DEFEVENT(KEY_ALT_RIGHT,L"Right Alt",AM_K,0,0,AK_RALT) -DEFEVENT(KEY_SHIFT_RIGHT,L"Right Shift",AM_K,0,0,AK_RSH) -DEFEVENT(KEY_SPACE,L"Space",AM_K,0,0,AK_SPC) -DEFEVENT(KEY_CURSOR_UP,L"Cursor Up",AM_K,0,0,AK_UP) -DEFEVENT(KEY_CURSOR_DOWN,L"Cursor Down",AM_K,0,0,AK_DN) -DEFEVENT(KEY_CURSOR_LEFT,L"Cursor Left",AM_K,0,0,AK_LF) -DEFEVENT(KEY_CURSOR_RIGHT,L"Cursor Right",AM_K,0,0,AK_RT) -DEFEVENT(KEY_HELP,L"Help",AM_K,0,0,AK_HELP) -DEFEVENT(KEY_DEL,L"Del",AM_K,0,0,AK_DEL) -DEFEVENT(KEY_BACKSPACE,L"Backspace",AM_K,0,0,AK_BS) -DEFEVENT(KEY_RETURN,L"Return",AM_K,0,0,AK_RET) - -DEFEVENT(KEY_A,L"A",AM_K,0,0,AK_A) -DEFEVENT(KEY_B,L"B",AM_K,0,0,AK_B) -DEFEVENT(KEY_C,L"C",AM_K,0,0,AK_C) -DEFEVENT(KEY_D,L"D",AM_K,0,0,AK_D) -DEFEVENT(KEY_E,L"E",AM_K,0,0,AK_E) -DEFEVENT(KEY_F,L"F",AM_K,0,0,AK_F) -DEFEVENT(KEY_G,L"G",AM_K,0,0,AK_G) -DEFEVENT(KEY_H,L"H",AM_K,0,0,AK_H) -DEFEVENT(KEY_I,L"I",AM_K,0,0,AK_I) -DEFEVENT(KEY_J,L"J",AM_K,0,0,AK_J) -DEFEVENT(KEY_K,L"K",AM_K,0,0,AK_K) -DEFEVENT(KEY_L,L"L",AM_K,0,0,AK_L) -DEFEVENT(KEY_M,L"M",AM_K,0,0,AK_M) -DEFEVENT(KEY_N,L"N",AM_K,0,0,AK_N) -DEFEVENT(KEY_O,L"O",AM_K,0,0,AK_O) -DEFEVENT(KEY_P,L"P",AM_K,0,0,AK_P) -DEFEVENT(KEY_Q,L"Q",AM_K,0,0,AK_Q) -DEFEVENT(KEY_R,L"R",AM_K,0,0,AK_R) -DEFEVENT(KEY_S,L"S",AM_K,0,0,AK_S) -DEFEVENT(KEY_T,L"T",AM_K,0,0,AK_T) -DEFEVENT(KEY_U,L"U",AM_K,0,0,AK_U) -DEFEVENT(KEY_V,L"V",AM_K,0,0,AK_V) -DEFEVENT(KEY_W,L"W",AM_K,0,0,AK_W) -DEFEVENT(KEY_X,L"X",AM_K,0,0,AK_X) -DEFEVENT(KEY_Y,L"Y",AM_K,0,0,AK_Y) -DEFEVENT(KEY_Z,L"Z",AM_K,0,0,AK_Z) +DEFEVENT(KEY_ESC,_T("ESC"),AM_K,0,0,AK_ESC) +DEFEVENT(KEY_TAB,_T("Tab"),AM_K,0,0,AK_TAB) +DEFEVENT(KEY_CTRL,_T("CTRL"),AM_K,0,0,AK_CTRL) +DEFEVENT(KEY_CAPS_LOCK,_T("Caps Lock"),AM_K,0,0,AK_CAPSLOCK) +DEFEVENT(KEY_SHIFT_LEFT,_T("Left Shift"),AM_K,0,0,AK_LSH) +DEFEVENT(KEY_ALT_LEFT,_T("Left Alt"),AM_K,0,0,AK_LALT) +DEFEVENT(KEY_AMIGA_LEFT,_T("Left Amiga"),AM_K,0,0,AK_LAMI) +DEFEVENT(KEY_AMIGA_RIGHT,_T("Right Amiga"),AM_K,0,0,AK_RAMI) +DEFEVENT(KEY_ALT_RIGHT,_T("Right Alt"),AM_K,0,0,AK_RALT) +DEFEVENT(KEY_SHIFT_RIGHT,_T("Right Shift"),AM_K,0,0,AK_RSH) +DEFEVENT(KEY_SPACE,_T("Space"),AM_K,0,0,AK_SPC) +DEFEVENT(KEY_CURSOR_UP,_T("Cursor Up"),AM_K,0,0,AK_UP) +DEFEVENT(KEY_CURSOR_DOWN,_T("Cursor Down"),AM_K,0,0,AK_DN) +DEFEVENT(KEY_CURSOR_LEFT,_T("Cursor Left"),AM_K,0,0,AK_LF) +DEFEVENT(KEY_CURSOR_RIGHT,_T("Cursor Right"),AM_K,0,0,AK_RT) +DEFEVENT(KEY_HELP,_T("Help"),AM_K,0,0,AK_HELP) +DEFEVENT(KEY_DEL,_T("Del"),AM_K,0,0,AK_DEL) +DEFEVENT(KEY_BACKSPACE,_T("Backspace"),AM_K,0,0,AK_BS) +DEFEVENT(KEY_RETURN,_T("Return"),AM_K,0,0,AK_RET) + +DEFEVENT(KEY_A,_T("A"),AM_K,0,0,AK_A) +DEFEVENT(KEY_B,_T("B"),AM_K,0,0,AK_B) +DEFEVENT(KEY_C,_T("C"),AM_K,0,0,AK_C) +DEFEVENT(KEY_D,_T("D"),AM_K,0,0,AK_D) +DEFEVENT(KEY_E,_T("E"),AM_K,0,0,AK_E) +DEFEVENT(KEY_F,_T("F"),AM_K,0,0,AK_F) +DEFEVENT(KEY_G,_T("G"),AM_K,0,0,AK_G) +DEFEVENT(KEY_H,_T("H"),AM_K,0,0,AK_H) +DEFEVENT(KEY_I,_T("I"),AM_K,0,0,AK_I) +DEFEVENT(KEY_J,_T("J"),AM_K,0,0,AK_J) +DEFEVENT(KEY_K,_T("K"),AM_K,0,0,AK_K) +DEFEVENT(KEY_L,_T("L"),AM_K,0,0,AK_L) +DEFEVENT(KEY_M,_T("M"),AM_K,0,0,AK_M) +DEFEVENT(KEY_N,_T("N"),AM_K,0,0,AK_N) +DEFEVENT(KEY_O,_T("O"),AM_K,0,0,AK_O) +DEFEVENT(KEY_P,_T("P"),AM_K,0,0,AK_P) +DEFEVENT(KEY_Q,_T("Q"),AM_K,0,0,AK_Q) +DEFEVENT(KEY_R,_T("R"),AM_K,0,0,AK_R) +DEFEVENT(KEY_S,_T("S"),AM_K,0,0,AK_S) +DEFEVENT(KEY_T,_T("T"),AM_K,0,0,AK_T) +DEFEVENT(KEY_U,_T("U"),AM_K,0,0,AK_U) +DEFEVENT(KEY_V,_T("V"),AM_K,0,0,AK_V) +DEFEVENT(KEY_W,_T("W"),AM_K,0,0,AK_W) +DEFEVENT(KEY_X,_T("X"),AM_K,0,0,AK_X) +DEFEVENT(KEY_Y,_T("Y"),AM_K,0,0,AK_Y) +DEFEVENT(KEY_Z,_T("Z"),AM_K,0,0,AK_Z) /* numpad */ -DEFEVENT(KEY_ENTER,L"Numpad Enter",AM_K,0,0,AK_ENT) -DEFEVENT(KEY_NP_0,L"Numpad 0",AM_K,0,0,AK_NP0) -DEFEVENT(KEY_NP_1,L"Numpad 1",AM_K,0,0,AK_NP1) -DEFEVENT(KEY_NP_2,L"Numpad 2",AM_K,0,0,AK_NP2) -DEFEVENT(KEY_NP_3,L"Numpad 3",AM_K,0,0,AK_NP3) -DEFEVENT(KEY_NP_4,L"Numpad 4",AM_K,0,0,AK_NP4) -DEFEVENT(KEY_NP_5,L"Numpad 5",AM_K,0,0,AK_NP5) -DEFEVENT(KEY_NP_6,L"Numpad 6",AM_K,0,0,AK_NP6) -DEFEVENT(KEY_NP_7,L"Numpad 7",AM_K,0,0,AK_NP7) -DEFEVENT(KEY_NP_8,L"Numpad 8",AM_K,0,0,AK_NP8) -DEFEVENT(KEY_NP_9,L"Numpad 9",AM_K,0,0,AK_NP9) -DEFEVENT(KEY_NP_PERIOD,L"Numpad Period",AM_K,0,0,AK_NPDEL) -DEFEVENT(KEY_NP_ADD,L"Numpad Plus",AM_K,0,0,AK_NPADD) -DEFEVENT(KEY_NP_SUB,L"Numpad Minus",AM_K,0,0,AK_NPSUB) -DEFEVENT(KEY_NP_MUL,L"Numpad Multiply",AM_K,0,0,AK_NPMUL) -DEFEVENT(KEY_NP_DIV,L"Numpad Divide",AM_K,0,0,AK_NPDIV) -DEFEVENT(KEY_NP_LPAREN,L"Numpad Left Parenthesis",AM_K,0,0,AK_NPLPAREN) -DEFEVENT(KEY_NP_RPAREN,L"Numpad Right Parenthesis",AM_K,0,0,AK_NPRPAREN) -DEFEVENT(KEY_2B,L"Keycode 0x2b",AM_K,0,0,0x2b) -DEFEVENT(KEY_30,L"Keycode 0x30",AM_K,0,0,0x30) - -DEFEVENT(KEY_BACKQUOTE,L"Back Quote",AM_K,0,0,AK_BACKQUOTE) -DEFEVENT(KEY_1,L"1",AM_K,0,0,AK_1) -DEFEVENT(KEY_2,L"2",AM_K,0,0,AK_2) -DEFEVENT(KEY_3,L"3",AM_K,0,0,AK_3) -DEFEVENT(KEY_4,L"4",AM_K,0,0,AK_4) -DEFEVENT(KEY_5,L"5",AM_K,0,0,AK_5) -DEFEVENT(KEY_6,L"6",AM_K,0,0,AK_6) -DEFEVENT(KEY_7,L"7",AM_K,0,0,AK_7) -DEFEVENT(KEY_8,L"8",AM_K,0,0,AK_8) -DEFEVENT(KEY_9,L"9",AM_K,0,0,AK_9) -DEFEVENT(KEY_0,L"0",AM_K,0,0,AK_0) -DEFEVENT(KEY_SUB,L"Minus",AM_K,0,0,AK_MINUS) -DEFEVENT(KEY_EQUALS,L"Equals",AM_K,0,0,AK_EQUAL) -DEFEVENT(KEY_BACKSLASH,L"Backslash",AM_K,0,0,AK_BACKSLASH) - -DEFEVENT(KEY_LEFTBRACKET,L"Left Bracket",AM_K,0,0,AK_LBRACKET) -DEFEVENT(KEY_RIGHTBRACKET,L"Right Bracket",AM_K,0,0,AK_RBRACKET) -DEFEVENT(KEY_SEMICOLON,L"Semicolon",AM_K,0,0,AK_SEMICOLON) -DEFEVENT(KEY_SINGLEQUOTE,L"Single Quote",AM_K,0,0,AK_QUOTE) -DEFEVENT(KEY_COMMA,L"Comma",AM_K,0,0,AK_COMMA) -DEFEVENT(KEY_PERIOD,L"Period",AM_K,0,0,AK_PERIOD) -DEFEVENT(KEY_DIV,L"Slash",AM_K,0,0,AK_SLASH) - -// DEFEVENT(KEY_,L"",AM_K,0,0,0x) +DEFEVENT(KEY_ENTER,_T("Numpad Enter"),AM_K,0,0,AK_ENT) +DEFEVENT(KEY_NP_0,_T("Numpad 0"),AM_K,0,0,AK_NP0) +DEFEVENT(KEY_NP_1,_T("Numpad 1"),AM_K,0,0,AK_NP1) +DEFEVENT(KEY_NP_2,_T("Numpad 2"),AM_K,0,0,AK_NP2) +DEFEVENT(KEY_NP_3,_T("Numpad 3"),AM_K,0,0,AK_NP3) +DEFEVENT(KEY_NP_4,_T("Numpad 4"),AM_K,0,0,AK_NP4) +DEFEVENT(KEY_NP_5,_T("Numpad 5"),AM_K,0,0,AK_NP5) +DEFEVENT(KEY_NP_6,_T("Numpad 6"),AM_K,0,0,AK_NP6) +DEFEVENT(KEY_NP_7,_T("Numpad 7"),AM_K,0,0,AK_NP7) +DEFEVENT(KEY_NP_8,_T("Numpad 8"),AM_K,0,0,AK_NP8) +DEFEVENT(KEY_NP_9,_T("Numpad 9"),AM_K,0,0,AK_NP9) +DEFEVENT(KEY_NP_PERIOD,_T("Numpad Period"),AM_K,0,0,AK_NPDEL) +DEFEVENT(KEY_NP_ADD,_T("Numpad Plus"),AM_K,0,0,AK_NPADD) +DEFEVENT(KEY_NP_SUB,_T("Numpad Minus"),AM_K,0,0,AK_NPSUB) +DEFEVENT(KEY_NP_MUL,_T("Numpad Multiply"),AM_K,0,0,AK_NPMUL) +DEFEVENT(KEY_NP_DIV,_T("Numpad Divide"),AM_K,0,0,AK_NPDIV) +DEFEVENT(KEY_NP_LPAREN,_T("Numpad Left Parenthesis"),AM_K,0,0,AK_NPLPAREN) +DEFEVENT(KEY_NP_RPAREN,_T("Numpad Right Parenthesis"),AM_K,0,0,AK_NPRPAREN) +DEFEVENT(KEY_2B,_T("Keycode 0x2b"),AM_K,0,0,0x2b) +DEFEVENT(KEY_30,_T("Keycode 0x30"),AM_K,0,0,0x30) + +DEFEVENT(KEY_BACKQUOTE,_T("Back Quote"),AM_K,0,0,AK_BACKQUOTE) +DEFEVENT(KEY_1,_T("1"),AM_K,0,0,AK_1) +DEFEVENT(KEY_2,_T("2"),AM_K,0,0,AK_2) +DEFEVENT(KEY_3,_T("3"),AM_K,0,0,AK_3) +DEFEVENT(KEY_4,_T("4"),AM_K,0,0,AK_4) +DEFEVENT(KEY_5,_T("5"),AM_K,0,0,AK_5) +DEFEVENT(KEY_6,_T("6"),AM_K,0,0,AK_6) +DEFEVENT(KEY_7,_T("7"),AM_K,0,0,AK_7) +DEFEVENT(KEY_8,_T("8"),AM_K,0,0,AK_8) +DEFEVENT(KEY_9,_T("9"),AM_K,0,0,AK_9) +DEFEVENT(KEY_0,_T("0"),AM_K,0,0,AK_0) +DEFEVENT(KEY_SUB,_T("Minus"),AM_K,0,0,AK_MINUS) +DEFEVENT(KEY_EQUALS,_T("Equals"),AM_K,0,0,AK_EQUAL) +DEFEVENT(KEY_BACKSLASH,_T("Backslash"),AM_K,0,0,AK_BACKSLASH) + +DEFEVENT(KEY_LEFTBRACKET,_T("Left Bracket"),AM_K,0,0,AK_LBRACKET) +DEFEVENT(KEY_RIGHTBRACKET,_T("Right Bracket"),AM_K,0,0,AK_RBRACKET) +DEFEVENT(KEY_SEMICOLON,_T("Semicolon"),AM_K,0,0,AK_SEMICOLON) +DEFEVENT(KEY_SINGLEQUOTE,_T("Single Quote"),AM_K,0,0,AK_QUOTE) +DEFEVENT(KEY_COMMA,_T("Comma"),AM_K,0,0,AK_COMMA) +DEFEVENT(KEY_PERIOD,_T("Period"),AM_K,0,0,AK_PERIOD) +DEFEVENT(KEY_DIV,_T("Slash"),AM_K,0,0,AK_SLASH) + +// DEFEVENT(KEY_,_T(""),AM_K,0,0,0x) /* mouse wheel "keys" */ -DEFEVENT(MOUSEWHEEL_DOWN,L"Mouse Wheel Down",AM_K,0,0,0x7a) -DEFEVENT(MOUSEWHEEL_UP,L"Mouse Wheel Up",AM_K,0,0,0x7b) +DEFEVENT(MOUSEWHEEL_DOWN,_T("Mouse Wheel Down"),AM_K,0,0,0x7a) +DEFEVENT(MOUSEWHEEL_UP,_T("Mouse Wheel Up"),AM_K,0,0,0x7b) /* misc */ -DEFEVENT(KEY_CDTV_STOP,L"CDTV Stop",AM_K,0,0,0x72) -DEFEVENT(KEY_CDTV_PLAYPAUSE,L"CDTV Play/Pause",AM_K,0,0,0x73) -DEFEVENT(KEY_CDTV_PREV,L"CDTV Previous",AM_K,0,0,0x74) -DEFEVENT(KEY_CDTV_NEXT,L"CDTV Next",AM_K,0,0,0x75) -DEFEVENT(KEY_CDTV_REW,L"CDTV Rewind",AM_K,0,0,0x76) -DEFEVENT(KEY_CDTV_FF,L"CDTV Fast Forward",AM_K,0,0,0x77) - -DEFEVENT(KEY_0E,L"Keycode 0x0E",AM_K,0,0,0x0e) - -DEFEVENT(KEY_1C,L"Keycode 0x1C",AM_K,0,0,0x1c) - -DEFEVENT(KEY_2C,L"Keycode 0x2C",AM_K,0,0,0x2C) - -DEFEVENT(KEY_3B,L"Keycode 0x3B",AM_K,0,0,0x3b) - -DEFEVENT(KEY_68,L"Keycode 0x68",AM_K,0,0,0x68) -DEFEVENT(KEY_69,L"Keycode 0x69",AM_K,0,0,0x69) -DEFEVENT(KEY_6A,L"Keycode 0x6A",AM_K,0,0,0x6a) -DEFEVENT(KEY_6C,L"Keycode 0x6C",AM_K,0,0,0x6c) - -DEFEVENT(KEY_INSERT,L"Insert (PC)",AM_K,0,0,0x47) -DEFEVENT(KEY_PAGEUP,L"Page Up (PC)",AM_K,0,0,0x48) -DEFEVENT(KEY_PAGEDOWN,L"Page Down (PC)",AM_K,0,0,0x49) -DEFEVENT(KEY_F11,L"F11 (PC)",AM_K,0,0,0x4b) -DEFEVENT(KEY_APPS,L"Apps (PC)",AM_K,0,0,0x6b) -DEFEVENT(KEY_SYSRQ,L"PrtScr/SysRq (PC)",AM_K,0,0,0x6d) -DEFEVENT(KEY_PAUSE,L"Pause/Break (PC)",AM_K,0,0,0x6e) -DEFEVENT(KEY_F12,L"F12 (PC)",AM_K,0,0,0x6f) -DEFEVENT(KEY_HOME,L"Home (PC)",AM_K,0,0,0x70) -DEFEVENT(KEY_END,L"End (PC)",AM_K,0,0,0x71) - -DEFEVENT(KEY_78,L"Keycode 0x78 (Reset Warning)",AM_K,0,0,0x78) -DEFEVENT(KEY_79,L"Keycode 0x79",AM_K,0,0,0x79) -DEFEVENT(KEY_7A,L"Keycode 0x7A",AM_K,0,0,0x7a) -DEFEVENT(KEY_7B,L"Keycode 0x7B",AM_K,0,0,0x7b) -DEFEVENT(KEY_7C,L"Keycode 0x7C",AM_K,0,0,0x7c) -DEFEVENT(KEY_7D,L"Keycode 0x7D",AM_K,0,0,0x7d) -DEFEVENT(KEY_7E,L"Keycode 0x7E",AM_K,0,0,0x7e) -DEFEVENT(KEY_7F,L"Keycode 0x7F",AM_K,0,0,0x7f) +DEFEVENT(KEY_CDTV_STOP,_T("CDTV Stop"),AM_K,0,0,0x72) +DEFEVENT(KEY_CDTV_PLAYPAUSE,_T("CDTV Play/Pause"),AM_K,0,0,0x73) +DEFEVENT(KEY_CDTV_PREV,_T("CDTV Previous"),AM_K,0,0,0x74) +DEFEVENT(KEY_CDTV_NEXT,_T("CDTV Next"),AM_K,0,0,0x75) +DEFEVENT(KEY_CDTV_REW,_T("CDTV Rewind"),AM_K,0,0,0x76) +DEFEVENT(KEY_CDTV_FF,_T("CDTV Fast Forward"),AM_K,0,0,0x77) + +DEFEVENT(KEY_0E,_T("Keycode 0x0E"),AM_K,0,0,0x0e) + +DEFEVENT(KEY_1C,_T("Keycode 0x1C"),AM_K,0,0,0x1c) + +DEFEVENT(KEY_2C,_T("Keycode 0x2C"),AM_K,0,0,0x2C) + +DEFEVENT(KEY_3B,_T("Keycode 0x3B"),AM_K,0,0,0x3b) + +DEFEVENT(KEY_68,_T("Keycode 0x68"),AM_K,0,0,0x68) +DEFEVENT(KEY_69,_T("Keycode 0x69"),AM_K,0,0,0x69) +DEFEVENT(KEY_6A,_T("Keycode 0x6A"),AM_K,0,0,0x6a) +DEFEVENT(KEY_6C,_T("Keycode 0x6C"),AM_K,0,0,0x6c) + +DEFEVENT(KEY_INSERT,_T("Insert (PC)"),AM_K,0,0,0x47) +DEFEVENT(KEY_PAGEUP,_T("Page Up (PC)"),AM_K,0,0,0x48) +DEFEVENT(KEY_PAGEDOWN,_T("Page Down (PC)"),AM_K,0,0,0x49) +DEFEVENT(KEY_F11,_T("F11 (PC)"),AM_K,0,0,0x4b) +DEFEVENT(KEY_APPS,_T("Apps (PC)"),AM_K,0,0,0x6b) +DEFEVENT(KEY_SYSRQ,_T("PrtScr/SysRq (PC)"),AM_K,0,0,0x6d) +DEFEVENT(KEY_PAUSE,_T("Pause/Break (PC)"),AM_K,0,0,0x6e) +DEFEVENT(KEY_F12,_T("F12 (PC)"),AM_K,0,0,0x6f) +DEFEVENT(KEY_HOME,_T("Home (PC)"),AM_K,0,0,0x70) +DEFEVENT(KEY_END,_T("End (PC)"),AM_K,0,0,0x71) + +DEFEVENT(KEY_78,_T("Keycode 0x78 (Reset Warning)"),AM_K,0,0,0x78) +DEFEVENT(KEY_79,_T("Keycode 0x79"),AM_K,0,0,0x79) +DEFEVENT(KEY_7A,_T("Keycode 0x7A"),AM_K,0,0,0x7a) +DEFEVENT(KEY_7B,_T("Keycode 0x7B"),AM_K,0,0,0x7b) +DEFEVENT(KEY_7C,_T("Keycode 0x7C"),AM_K,0,0,0x7c) +DEFEVENT(KEY_7D,_T("Keycode 0x7D"),AM_K,0,0,0x7d) +DEFEVENT(KEY_7E,_T("Keycode 0x7E"),AM_K,0,0,0x7e) +DEFEVENT(KEY_7F,_T("Keycode 0x7F"),AM_K,0,0,0x7f) /* special */ -DEFEVENT(SPC_ENTERGUI,L"Enter GUI",AM_K,0,0,AKS_ENTERGUI) -DEFEVENT(SPC_SCREENSHOT,L"Screenshot (file)",AM_K,0,0,AKS_SCREENSHOT_FILE) -DEFEVENT(SPC_SCREENSHOT_CLIPBOARD,L"Screenshot (clipboard)",AM_K,0,0,AKS_SCREENSHOT_CLIPBOARD) -DEFEVENT(SPC_FREEZEBUTTON,L"Activate Cartridge",AM_K,0,0,AKS_FREEZEBUTTON) -DEFEVENT(SPC_FLOPPY0,L"Change disk in DF0:",AM_K,0,0,AKS_FLOPPY0) -DEFEVENT(SPC_FLOPPY1,L"Change disk in DF1:",AM_K,0,0,AKS_FLOPPY1) -DEFEVENT(SPC_FLOPPY2,L"Change disk in DF2:",AM_K,0,0,AKS_FLOPPY2) -DEFEVENT(SPC_FLOPPY3,L"Change disk in DF3:",AM_K,0,0,AKS_FLOPPY3) -DEFEVENT(SPC_EFLOPPY0,L"Eject disk in DF0:",AM_K,0,0,AKS_EFLOPPY0) -DEFEVENT(SPC_EFLOPPY1,L"Eject disk in DF1:",AM_K,0,0,AKS_EFLOPPY1) -DEFEVENT(SPC_EFLOPPY2,L"Eject disk in DF2:",AM_K,0,0,AKS_EFLOPPY2) -DEFEVENT(SPC_EFLOPPY3,L"Eject disk in DF3:",AM_K,0,0,AKS_EFLOPPY3) -DEFEVENT(SPC_PAUSE,L"Pause emulation",AM_K,0,0,AKS_PAUSE) -DEFEVENT(SPC_WARP,L"Warp mode",AM_K,0,0,AKS_WARP) -DEFEVENT(SPC_INHIBITSCREEN,L"Toggle screen updates",AM_K,0,0,AKS_INHIBITSCREEN) -DEFEVENT(SPC_IRQ7,L"Level 7 interrupt",AM_K,0,0,AKS_IRQ7) - -DEFEVENT(SPC_STATEREWIND,L"Load previous state capture checkpoint",AM_K,0,0,AKS_STATEREWIND) -DEFEVENT(SPC_STATECURRENT,L"Load current state capture checkpoint",AM_K,0,0,AKS_STATECURRENT) -DEFEVENT(SPC_STATECAPTURE,L"Save state capture checkpoint",AM_K,0,0,AKS_STATECAPTURE) - -DEFEVENT(SPC_VOLUME_DOWN,L"Decrease volume level",AM_K,0,0,AKS_VOLDOWN) -DEFEVENT(SPC_VOLUME_UP,L"Increase volume level",AM_K,0,0,AKS_VOLUP) -DEFEVENT(SPC_VOLUME_MUTE,L"Mute/unmute volume",AM_K,0,0,AKS_VOLMUTE) -DEFEVENT(SPC_MASTER_VOLUME_DOWN,L"Decrease master volume level",AM_K,0,0,AKS_MVOLDOWN) -DEFEVENT(SPC_MASTER_VOLUME_UP,L"Increase master volume level",AM_K,0,0,AKS_MVOLUP) -DEFEVENT(SPC_MASTER_VOLUME_MUTE,L"Mute/unmute master volume",AM_K,0,0,AKS_MVOLMUTE) -DEFEVENT(SPC_QUIT,L"Quit emulator",AM_K,0,0,AKS_QUIT) -DEFEVENT(SPC_SOFTRESET,L"Reset emulation",AM_K,0,0,AKS_SOFTRESET) -DEFEVENT(SPC_HARDRESET,L"Hard reset emulation",AM_K,0,0,AKS_HARDRESET) -DEFEVENT(SPC_ENTERDEBUGGER,L"Activate the built-in debugger",AM_K,0,0,AKS_ENTERDEBUGGER) -DEFEVENT(SPC_STATESAVE,L"Quick save state",AM_K,0,0,AKS_STATESAVEQUICK) -DEFEVENT(SPC_STATERESTORE,L"Quick restore state",AM_K,0,0,AKS_STATERESTOREQUICK) -DEFEVENT(SPC_STATESAVEDIALOG,L"Save state",AM_K,0,0,AKS_STATESAVEDIALOG) -DEFEVENT(SPC_STATERESTOREDIALOG,L"Restore state",AM_K,0,0,AKS_STATERESTOREDIALOG) -DEFEVENT(SPC_TOGGLEFULLSCREEN,L"Toggle windowed/fullscreen",AM_K,0,0,AKS_TOGGLEWINDOWEDFULLSCREEN) -DEFEVENT(SPC_TOGGLEFULLWINDOWFULLSCREEN,L"Toggle full-window/fullscreen",AM_K,0,0,AKS_TOGGLEFULLWINDOWFULLSCREEN) -DEFEVENT(SPC_TOGGLEWINDOWFULLWINDOW,L"Toggle window/full-window",AM_K,0,0,AKS_TOGGLEWINDOWFULLWINDOW) -DEFEVENT(SPC_TOGGLEDEFAULTSCREEN,L"Toggle window/default screen",AM_K,0,0,AKS_TOGGLEDEFAULTSCREEN) -DEFEVENT(SPC_TOGGLEMOUSEGRAB,L"Toggle between mouse grabbed and un-grabbed",AM_K,0,0,AKS_TOGGLEMOUSEGRAB) -DEFEVENT(SPC_DECREASE_REFRESHRATE,L"Decrease emulation speed",AM_K,0,0,AKS_DECREASEREFRESHRATE) -DEFEVENT(SPC_INCREASE_REFRESHRATE,L"Increase emulation speed",AM_K,0,0,AKS_INCREASEREFRESHRATE) -DEFEVENT(SPC_SWITCHINTERPOL,L"Switch between audio interpolation methods",AM_K,0,0,AKS_SWITCHINTERPOL) - -DEFEVENT(SPC_DISKSWAPPER_NEXT,L"Next slot in Disk Swapper",AM_K,0,0,AKS_DISKSWAPPER_NEXT) -DEFEVENT(SPC_DISKSWAPPER_PREV,L"Previous slot in Disk Swapper",AM_K,0,0,AKS_DISKSWAPPER_PREV) -DEFEVENT(SPC_DISKSWAPPER_INSERT0,L"Insert disk in current Disk Swapper slot in DF0:",AM_K,0,0,AKS_DISKSWAPPER_INSERT0) -DEFEVENT(SPC_DISKSWAPPER_INSERT1,L"Insert disk in current Disk Swapper slot in DF1:",AM_K,0,0,AKS_DISKSWAPPER_INSERT1) -DEFEVENT(SPC_DISKSWAPPER_INSERT2,L"Insert disk in current Disk Swapper slot in DF2:",AM_K,0,0,AKS_DISKSWAPPER_INSERT2) -DEFEVENT(SPC_DISKSWAPPER_INSERT3,L"Insert disk in current Disk Swapper slot in DF3:",AM_K,0,0,AKS_DISKSWAPPER_INSERT3) - -DEFEVENT(SPC_DISK_PREV0,L"Previous disk image in DF0:",AM_K,0,0,AKS_DISK_PREV0) -DEFEVENT(SPC_DISK_PREV1,L"Previous disk image in DF1:",AM_K,0,0,AKS_DISK_PREV1) -DEFEVENT(SPC_DISK_PREV2,L"Previous disk image in DF2:",AM_K,0,0,AKS_DISK_PREV2) -DEFEVENT(SPC_DISK_PREV3,L"Previous disk image in DF3:",AM_K,0,0,AKS_DISK_PREV3) -DEFEVENT(SPC_DISK_NEXT0,L"Next disk image in DF0:",AM_K,0,0,AKS_DISK_NEXT0) -DEFEVENT(SPC_DISK_NEXT1,L"Next disk image in DF1:",AM_K,0,0,AKS_DISK_NEXT1) -DEFEVENT(SPC_DISK_NEXT2,L"Next disk image in DF2:",AM_K,0,0,AKS_DISK_NEXT2) -DEFEVENT(SPC_DISK_NEXT3,L"Next disk image in DF3:",AM_K,0,0,AKS_DISK_NEXT3) - -DEFEVENT(SPC_INPUT_CONFIG1,L"Select Input Configuration #1",AM_K,0,0,AKS_INPUT_CONFIG_1) -DEFEVENT(SPC_INPUT_CONFIG2,L"Select Input Configuration #2",AM_K,0,0,AKS_INPUT_CONFIG_2) -DEFEVENT(SPC_INPUT_CONFIG3,L"Select Input Configuration #3",AM_K,0,0,AKS_INPUT_CONFIG_3) -DEFEVENT(SPC_INPUT_CONFIG4,L"Select GamePorts Input Configuration",AM_K,0,0,AKS_INPUT_CONFIG_4) - -DEFEVENT(SPC_ARCADIA_DIAGNOSTICS,L"Arcadia diagnostics DIP switch",AM_K,0,0,AKS_ARCADIADIAGNOSTICS) -DEFEVENT(SPC_ARCADIA_PLAYER1,L"Arcadia player 1",AM_K,0,0,AKS_ARCADIAPLY1) -DEFEVENT(SPC_ARCADIA_PLAYER2,L"Arcadia player 2",AM_K,0,0,AKS_ARCADIAPLY2) -DEFEVENT(SPC_ARCADIA_COIN1,L"Arcadia coin player 1",AM_K,0,0,AKS_ARCADIACOIN1) -DEFEVENT(SPC_ARCADIA_COIN2,L"Arcadia coin player 2",AM_K,0,0,AKS_ARCADIACOIN2) - -DEFEVENT(SPC_CDTV_FRONT_PANEL_STOP,L"CDTV Front Panel Stop",AM_K,0,0,AKS_CDTV_FRONT_PANEL_STOP) -DEFEVENT(SPC_CDTV_FRONT_PANEL_PLAYPAUSE,L"CDTV Front Panel Play/Pause",AM_K,0,0,AKS_CDTV_FRONT_PANEL_PLAYPAUSE) -DEFEVENT(SPC_CDTV_FRONT_PANEL_PREV,L"CDTV Front Panel Previous",AM_K,0,0,AKS_CDTV_FRONT_PANEL_PREV) -DEFEVENT(SPC_CDTV_FRONT_PANEL_NEXT,L"CDTV Front Panel Next",AM_K,0,0,AKS_CDTV_FRONT_PANEL_NEXT) -DEFEVENT(SPC_CDTV_FRONT_PANEL_REW,L"CDTV Front Panel Rewind",AM_K,0,0,AKS_CDTV_FRONT_PANEL_REW) -DEFEVENT(SPC_CDTV_FRONT_PANEL_FF,L"CDTV Front Panel Fast Forward",AM_K,0,0,AKS_CDTV_FRONT_PANEL_FF) - -DEFEVENT(SPC_LAST, L"", AM_DUMMY, 0,0,0) +DEFEVENT(SPC_ENTERGUI,_T("Enter GUI"),AM_K,0,0,AKS_ENTERGUI) +DEFEVENT(SPC_SCREENSHOT,_T("Screenshot (file)"),AM_K,0,0,AKS_SCREENSHOT_FILE) +DEFEVENT(SPC_SCREENSHOT_CLIPBOARD,_T("Screenshot (clipboard)"),AM_K,0,0,AKS_SCREENSHOT_CLIPBOARD) +DEFEVENT(SPC_FREEZEBUTTON,_T("Activate Cartridge"),AM_K,0,0,AKS_FREEZEBUTTON) +DEFEVENT(SPC_FLOPPY0,_T("Change disk in DF0:"),AM_K,0,0,AKS_FLOPPY0) +DEFEVENT(SPC_FLOPPY1,_T("Change disk in DF1:"),AM_K,0,0,AKS_FLOPPY1) +DEFEVENT(SPC_FLOPPY2,_T("Change disk in DF2:"),AM_K,0,0,AKS_FLOPPY2) +DEFEVENT(SPC_FLOPPY3,_T("Change disk in DF3:"),AM_K,0,0,AKS_FLOPPY3) +DEFEVENT(SPC_EFLOPPY0,_T("Eject disk in DF0:"),AM_K,0,0,AKS_EFLOPPY0) +DEFEVENT(SPC_EFLOPPY1,_T("Eject disk in DF1:"),AM_K,0,0,AKS_EFLOPPY1) +DEFEVENT(SPC_EFLOPPY2,_T("Eject disk in DF2:"),AM_K,0,0,AKS_EFLOPPY2) +DEFEVENT(SPC_EFLOPPY3,_T("Eject disk in DF3:"),AM_K,0,0,AKS_EFLOPPY3) +DEFEVENT(SPC_PAUSE,_T("Pause emulation"),AM_K,0,0,AKS_PAUSE) +DEFEVENT(SPC_WARP,_T("Warp mode"),AM_K,0,0,AKS_WARP) +DEFEVENT(SPC_INHIBITSCREEN,_T("Toggle screen updates"),AM_K,0,0,AKS_INHIBITSCREEN) +DEFEVENT(SPC_IRQ7,_T("Level 7 interrupt"),AM_K,0,0,AKS_IRQ7) + +DEFEVENT(SPC_STATEREWIND,_T("Load previous state capture checkpoint"),AM_K,0,0,AKS_STATEREWIND) +DEFEVENT(SPC_STATECURRENT,_T("Load current state capture checkpoint"),AM_K,0,0,AKS_STATECURRENT) +DEFEVENT(SPC_STATECAPTURE,_T("Save state capture checkpoint"),AM_K,0,0,AKS_STATECAPTURE) + +DEFEVENT(SPC_VOLUME_DOWN,_T("Decrease volume level"),AM_K,0,0,AKS_VOLDOWN) +DEFEVENT(SPC_VOLUME_UP,_T("Increase volume level"),AM_K,0,0,AKS_VOLUP) +DEFEVENT(SPC_VOLUME_MUTE,_T("Mute/unmute volume"),AM_K,0,0,AKS_VOLMUTE) +DEFEVENT(SPC_MASTER_VOLUME_DOWN,_T("Decrease master volume level"),AM_K,0,0,AKS_MVOLDOWN) +DEFEVENT(SPC_MASTER_VOLUME_UP,_T("Increase master volume level"),AM_K,0,0,AKS_MVOLUP) +DEFEVENT(SPC_MASTER_VOLUME_MUTE,_T("Mute/unmute master volume"),AM_K,0,0,AKS_MVOLMUTE) +DEFEVENT(SPC_QUIT,_T("Quit emulator"),AM_K,0,0,AKS_QUIT) +DEFEVENT(SPC_SOFTRESET,_T("Reset emulation"),AM_K,0,0,AKS_SOFTRESET) +DEFEVENT(SPC_HARDRESET,_T("Hard reset emulation"),AM_K,0,0,AKS_HARDRESET) +DEFEVENT(SPC_ENTERDEBUGGER,_T("Activate the built-in debugger"),AM_K,0,0,AKS_ENTERDEBUGGER) +DEFEVENT(SPC_STATESAVE,_T("Quick save state"),AM_K,0,0,AKS_STATESAVEQUICK) +DEFEVENT(SPC_STATERESTORE,_T("Quick restore state"),AM_K,0,0,AKS_STATERESTOREQUICK) +DEFEVENT(SPC_STATESAVEDIALOG,_T("Save state"),AM_K,0,0,AKS_STATESAVEDIALOG) +DEFEVENT(SPC_STATERESTOREDIALOG,_T("Restore state"),AM_K,0,0,AKS_STATERESTOREDIALOG) +DEFEVENT(SPC_TOGGLEFULLSCREEN,_T("Toggle windowed/fullscreen"),AM_K,0,0,AKS_TOGGLEWINDOWEDFULLSCREEN) +DEFEVENT(SPC_TOGGLEFULLWINDOWFULLSCREEN,_T("Toggle full-window/fullscreen"),AM_K,0,0,AKS_TOGGLEFULLWINDOWFULLSCREEN) +DEFEVENT(SPC_TOGGLEWINDOWFULLWINDOW,_T("Toggle window/full-window"),AM_K,0,0,AKS_TOGGLEWINDOWFULLWINDOW) +DEFEVENT(SPC_TOGGLEDEFAULTSCREEN,_T("Toggle window/default screen"),AM_K,0,0,AKS_TOGGLEDEFAULTSCREEN) +DEFEVENT(SPC_TOGGLEMOUSEGRAB,_T("Toggle between mouse grabbed and un-grabbed"),AM_K,0,0,AKS_TOGGLEMOUSEGRAB) +DEFEVENT(SPC_DECREASE_REFRESHRATE,_T("Decrease emulation speed"),AM_K,0,0,AKS_DECREASEREFRESHRATE) +DEFEVENT(SPC_INCREASE_REFRESHRATE,_T("Increase emulation speed"),AM_K,0,0,AKS_INCREASEREFRESHRATE) +DEFEVENT(SPC_SWITCHINTERPOL,_T("Switch between audio interpolation methods"),AM_K,0,0,AKS_SWITCHINTERPOL) + +DEFEVENT(SPC_DISKSWAPPER_NEXT,_T("Next slot in Disk Swapper"),AM_K,0,0,AKS_DISKSWAPPER_NEXT) +DEFEVENT(SPC_DISKSWAPPER_PREV,_T("Previous slot in Disk Swapper"),AM_K,0,0,AKS_DISKSWAPPER_PREV) +DEFEVENT(SPC_DISKSWAPPER_INSERT0,_T("Insert disk in current Disk Swapper slot in DF0:"),AM_K,0,0,AKS_DISKSWAPPER_INSERT0) +DEFEVENT(SPC_DISKSWAPPER_INSERT1,_T("Insert disk in current Disk Swapper slot in DF1:"),AM_K,0,0,AKS_DISKSWAPPER_INSERT1) +DEFEVENT(SPC_DISKSWAPPER_INSERT2,_T("Insert disk in current Disk Swapper slot in DF2:"),AM_K,0,0,AKS_DISKSWAPPER_INSERT2) +DEFEVENT(SPC_DISKSWAPPER_INSERT3,_T("Insert disk in current Disk Swapper slot in DF3:"),AM_K,0,0,AKS_DISKSWAPPER_INSERT3) + +DEFEVENT(SPC_DISK_PREV0,_T("Previous disk image in DF0:"),AM_K,0,0,AKS_DISK_PREV0) +DEFEVENT(SPC_DISK_PREV1,_T("Previous disk image in DF1:"),AM_K,0,0,AKS_DISK_PREV1) +DEFEVENT(SPC_DISK_PREV2,_T("Previous disk image in DF2:"),AM_K,0,0,AKS_DISK_PREV2) +DEFEVENT(SPC_DISK_PREV3,_T("Previous disk image in DF3:"),AM_K,0,0,AKS_DISK_PREV3) +DEFEVENT(SPC_DISK_NEXT0,_T("Next disk image in DF0:"),AM_K,0,0,AKS_DISK_NEXT0) +DEFEVENT(SPC_DISK_NEXT1,_T("Next disk image in DF1:"),AM_K,0,0,AKS_DISK_NEXT1) +DEFEVENT(SPC_DISK_NEXT2,_T("Next disk image in DF2:"),AM_K,0,0,AKS_DISK_NEXT2) +DEFEVENT(SPC_DISK_NEXT3,_T("Next disk image in DF3:"),AM_K,0,0,AKS_DISK_NEXT3) + +DEFEVENT(SPC_INPUT_CONFIG1,_T("Select Input Configuration #1"),AM_K,0,0,AKS_INPUT_CONFIG_1) +DEFEVENT(SPC_INPUT_CONFIG2,_T("Select Input Configuration #2"),AM_K,0,0,AKS_INPUT_CONFIG_2) +DEFEVENT(SPC_INPUT_CONFIG3,_T("Select Input Configuration #3"),AM_K,0,0,AKS_INPUT_CONFIG_3) +DEFEVENT(SPC_INPUT_CONFIG4,_T("Select GamePorts Input Configuration"),AM_K,0,0,AKS_INPUT_CONFIG_4) + +DEFEVENT(SPC_ARCADIA_DIAGNOSTICS,_T("Arcadia diagnostics DIP switch"),AM_K,0,0,AKS_ARCADIADIAGNOSTICS) +DEFEVENT(SPC_ARCADIA_PLAYER1,_T("Arcadia player 1"),AM_K,0,0,AKS_ARCADIAPLY1) +DEFEVENT(SPC_ARCADIA_PLAYER2,_T("Arcadia player 2"),AM_K,0,0,AKS_ARCADIAPLY2) +DEFEVENT(SPC_ARCADIA_COIN1,_T("Arcadia coin player 1"),AM_K,0,0,AKS_ARCADIACOIN1) +DEFEVENT(SPC_ARCADIA_COIN2,_T("Arcadia coin player 2"),AM_K,0,0,AKS_ARCADIACOIN2) + +DEFEVENT(SPC_CDTV_FRONT_PANEL_STOP,_T("CDTV Front Panel Stop"),AM_K,0,0,AKS_CDTV_FRONT_PANEL_STOP) +DEFEVENT(SPC_CDTV_FRONT_PANEL_PLAYPAUSE,_T("CDTV Front Panel Play/Pause"),AM_K,0,0,AKS_CDTV_FRONT_PANEL_PLAYPAUSE) +DEFEVENT(SPC_CDTV_FRONT_PANEL_PREV,_T("CDTV Front Panel Previous"),AM_K,0,0,AKS_CDTV_FRONT_PANEL_PREV) +DEFEVENT(SPC_CDTV_FRONT_PANEL_NEXT,_T("CDTV Front Panel Next"),AM_K,0,0,AKS_CDTV_FRONT_PANEL_NEXT) +DEFEVENT(SPC_CDTV_FRONT_PANEL_REW,_T("CDTV Front Panel Rewind"),AM_K,0,0,AKS_CDTV_FRONT_PANEL_REW) +DEFEVENT(SPC_CDTV_FRONT_PANEL_FF,_T("CDTV Front Panel Fast Forward"),AM_K,0,0,AKS_CDTV_FRONT_PANEL_FF) + +DEFEVENT(SPC_LAST, _T(""), AM_DUMMY, 0,0,0) diff --git a/inputrecord.cpp b/inputrecord.cpp index 40fd54e1..72ff5a5b 100644 --- a/inputrecord.cpp +++ b/inputrecord.cpp @@ -114,7 +114,7 @@ static bool inprec_rstart (uae_u8 type) lastcycle = get_cycles (); int mvp = current_maxvpos (); if ((type != INPREC_DEBUG && type != INPREC_DEBUG2 && type != INPREC_CIADEBUG) || (0 && vsync_counter >= 49 && vsync_counter <= 51)) - write_log (L"INPREC: %010d/%03d: %d (%d/%d) %08x\n", hsync_counter, current_hpos (), type, hsync_counter % mvp, mvp, lastcycle); + write_log (_T("INPREC: %010d/%03d: %d (%d/%d) %08x\n"), hsync_counter, current_hpos (), type, hsync_counter % mvp, mvp, lastcycle); inprec_plast = inprec_p; inprec_ru8 (type); inprec_ru16 (0xffff); @@ -139,8 +139,8 @@ static void inprec_rend (void) static bool inprec_realtime (bool stopstart) { if (input_record == INPREC_RECORD_RERECORD) - gui_message (L"INPREC error"); - write_log (L"INPREC: play -> record\n"); + gui_message (_T("INPREC error")); + write_log (_T("INPREC: play -> record\n")); input_record = INPREC_RECORD_RERECORD; input_play = 0; int offset = inprec_p - inprec_buffer; @@ -168,7 +168,7 @@ static int inprec_pstart (uae_u8 type) if (savestate_state || hsync_counter > 0xffff0000) return 0; if (p == inprec_buffer + inprec_size) { - write_log (L"INPREC: STOP\n"); + write_log (_T("INPREC: STOP\n")); if (input_play == INPREC_PLAY_RERECORD) { input_play = 0; inprec_realtime (true); @@ -177,8 +177,8 @@ static int inprec_pstart (uae_u8 type) } return 0; } else if (p > inprec_buffer + inprec_size) { - write_log (L"INPREC: buffer error\n"); - gui_message (L"INPREC error"); + write_log (_T("INPREC: buffer error\n")); + gui_message (_T("INPREC error")); } if (p[0] == INPREC_END) { inprec_close (true); @@ -199,16 +199,16 @@ static int inprec_pstart (uae_u8 type) break; #if 0 if (p > lastp) { - write_log (L"INPREC: Next %010d/%03d, %010d/%03d (%d/%d): %d (%d)\n", + write_log (_T("INPREC: Next %010d/%03d, %010d/%03d (%d/%d): %d (%d)\n"), hc2, hpos2, hc, hpos, hc2 - hc, hpos2 - hpos, p[5 + 1], p[5]); lastp = p; } #endif hc2_orig = hc2; if (type2 == type && hc > hc2) { - write_log (L"INPREC: %010d/%03d > %010d/%03d: %d missed!\n", hc, hpos, hc2, hpos2, p[0]); + write_log (_T("INPREC: %010d/%03d > %010d/%03d: %d missed!\n"), hc, hpos, hc2, hpos2, p[0]); #if ENABLE_DEBUGGER == 0 - gui_message (L"INPREC missed error"); + gui_message (_T("INPREC missed error")); #else activate_debugger (); #endif @@ -224,17 +224,17 @@ static int inprec_pstart (uae_u8 type) } if (type2 == type) { if (type != INPREC_DEBUG && type != INPREC_DEBUG2 && type != INPREC_CIADEBUG && cycles != cycles2) - write_log (L"INPREC: %010d/%03d: %d (%d/%d) (%d/%d) %08X/%08X\n", hc, hpos, type, hc % mvp, mvp, hc_orig - hc2_orig, hpos - hpos2, cycles, cycles2); + write_log (_T("INPREC: %010d/%03d: %d (%d/%d) (%d/%d) %08X/%08X\n"), hc, hpos, type, hc % mvp, mvp, hc_orig - hc2_orig, hpos - hpos2, cycles, cycles2); if (cycles != cycles2 + cycleoffset) { if (warned > 0) { warned--; for (int i = 0; i < 7; i++) - write_log (L"%08x (%08x) ", pcs[i], pcs2[i]); - write_log (L"\n"); + write_log (_T("%08x (%08x) "), pcs[i], pcs2[i]); + write_log (_T("\n")); } cycleoffset = cycles - cycles2; #if ENABLE_DEBUGGER == 0 - gui_message (L"INPREC OFFSET=%d\n", (int)cycleoffset / CYCLE_UNIT); + gui_message (_T("INPREC OFFSET=%d\n"), (int)cycleoffset / CYCLE_UNIT); #else activate_debugger (); #endif @@ -342,9 +342,9 @@ int inprec_open (const TCHAR *fname, const TCHAR *statefilename) inprec_close (false); if (fname == NULL) - inprec_zf = zfile_fopen_empty (NULL, L"inp"); + inprec_zf = zfile_fopen_empty (NULL, _T("inp")); else - inprec_zf = zfile_fopen (fname, input_record ? L"wb" : L"rb", ZFD_NORMAL); + inprec_zf = zfile_fopen (fname, input_record ? _T("wb") : _T("rb"), ZFD_NORMAL); if (inprec_zf == NULL) return 0; @@ -395,7 +395,7 @@ int inprec_open (const TCHAR *fname, const TCHAR *statefilename) for (;;) { TCHAR tmp[MAX_DPATH]; _tcscpy (tmp, fname); - _tcscat (tmp, L".uss"); + _tcscat (tmp, _T(".uss")); if (zfile_exists (tmp)) { _tcscpy (savestate_fname, tmp); break; @@ -425,7 +425,7 @@ int inprec_open (const TCHAR *fname, const TCHAR *statefilename) _tcscpy (savestate_fname, tmp); break; } - write_log (L"Failed to open linked statefile '%s'\n", savestate_fname); + write_log (_T("Failed to open linked statefile '%s'\n"), savestate_fname); savestate_fname[0] = 0; savestate_state = 0; break; @@ -456,7 +456,7 @@ int inprec_open (const TCHAR *fname, const TCHAR *statefilename) if (disk_debug_logging < 1) disk_debug_logging = 1 | 2; } - write_log (L"inprec initialized '%s', play=%d rec=%d\n", fname ? fname : L"", input_play, input_record); + write_log (_T("inprec initialized '%s', play=%d rec=%d\n"), fname ? fname : _T(""), input_play, input_record); refreshtitle (); return 1; } @@ -483,9 +483,9 @@ bool inprec_prepare_record (const TCHAR *statefilename) } else { _tcscpy (state, changed_prefs.inprecfile); } - _tcscat (state, L".uss"); + _tcscat (state, _T(".uss")); savestate_initsave (state, 1, 1, true); - save_state (state, L"input recording test"); + save_state (state, _T("input recording test")); mode = 2; } input_record = INPREC_RECORD_NORMAL; @@ -510,7 +510,7 @@ void inprec_close (bool clear) xfree (inprec_buffer); inprec_buffer = NULL; input_play = input_record = 0; - write_log (L"inprec finished\n"); + write_log (_T("inprec finished\n")); refreshtitle (); } @@ -535,7 +535,7 @@ void inprec_playdiskchange (void) while (inprec_pstart (INPREC_DISKREMOVE)) { int drv = inprec_pu8 (); inprec_pend (); - write_log (L"INPREC: disk eject drive %d\n", drv); + write_log (_T("INPREC: disk eject drive %d\n"), drv); disk_eject (drv); } while (inprec_pstart (INPREC_DISKINSERT)) { @@ -551,13 +551,13 @@ void inprec_playdiskchange (void) _tcscpy (tmp, tmp3); } if (!zfile_exists (tmp)) { - gui_message (L"INPREC: Disk image\n'%s'\nnot found!\n", tmp2); + gui_message (_T("INPREC: Disk image\n'%s'\nnot found!\n"), tmp2); } _tcscpy (currprefs.floppyslots[drv].df, tmp); _tcscpy (changed_prefs.floppyslots[drv].df, tmp); setwriteprotect (tmp, wp); disk_insert_force (drv, tmp, wp); - write_log (L"INPREC: disk insert drive %d '%s'\n", drv, tmp); + write_log (_T("INPREC: disk insert drive %d '%s'\n"), drv, tmp); inprec_pend (); } } @@ -595,7 +595,7 @@ void inprec_playdebug_cia (uae_u32 v1, uae_u32 v2, uae_u32 v3) uae_u32 vv2 = inprec_pu32 (); uae_u32 vv3 = inprec_pu32 (); if (vv1 != v1 || vv2 != v2 || vv3 != v3) - write_log (L"CIA SYNC ERROR %08x,%08x %08x,%08x %08x,%08x\n", vv1, v1, vv2, v2, vv3, v3); + write_log (_T("CIA SYNC ERROR %08x,%08x %08x,%08x %08x,%08x\n"), vv1, v1, vv2, v2, vv3, v3); inprec_pend (); } #endif @@ -623,10 +623,10 @@ void inprec_playdebug_cpu (int mode) if (pc1 != pc2) { if (warned > 0) { warned--; - write_log (L"SYNC ERROR2 PC %08x != %08x\n", pc1, pc2); + write_log (_T("SYNC ERROR2 PC %08x != %08x\n"), pc1, pc2); for (int i = 0; i < 15; i++) - write_log (L"%08x ", pcs[i]); - write_log (L"\n"); + write_log (_T("%08x "), pcs[i]); + write_log (_T("\n")); } err = 1; @@ -639,10 +639,10 @@ void inprec_playdebug_cpu (int mode) if (v1 != v2) { if (warned > 0) { warned--; - write_log (L"SYNC ERROR2 %08x != %08x\n", v1, v2); + write_log (_T("SYNC ERROR2 %08x != %08x\n"), v1, v2); for (int i = 0; i < 15; i++) - write_log (L"%08x ", pcs[i]); - write_log (L"\n"); + write_log (_T("%08x "), pcs[i]); + write_log (_T("\n")); } err = 1; } @@ -650,7 +650,7 @@ void inprec_playdebug_cpu (int mode) } else if (input_play > 0) { if (warned > 0) { warned--; - write_log (L"SYNC ERROR2 debug event missing!?\n"); + write_log (_T("SYNC ERROR2 debug event missing!?\n")); } } #endif @@ -676,17 +676,17 @@ void inprec_playdebug (uae_u32 val) uae_u32 seed1 = uaerandgetseed (); uae_u32 seed2 = inprec_pu32 (); if (seed1 != seed2) { - write_log (L"SYNC ERROR seed %08x != %08x\n", seed1, seed2); + write_log (_T("SYNC ERROR seed %08x != %08x\n"), seed1, seed2); err = 1; } uae_u32 val2 = inprec_pu32 (); if (val != val2) { - write_log (L"SYNC ERROR val %08x != %08x\n", val, val2); + write_log (_T("SYNC ERROR val %08x != %08x\n"), val, val2); err = 1; } inprec_pend (); } else if (input_play > 0) { - gui_message (L"SYNC ERROR debug event missing!?\n"); + gui_message (_T("SYNC ERROR debug event missing!?\n")); } #endif } @@ -720,13 +720,13 @@ void inprec_recorddiskchange (int nr, const TCHAR *fname, bool writeprotected) inprec_ru8 (nr); inprec_ru8 (writeprotected ? 1 : 0); inprec_rstr (fname); - write_log (L"INPREC: disk insert %d '%s'\n", nr, fname); + write_log (_T("INPREC: disk insert %d '%s'\n"), nr, fname); inprec_rend (); } } else { if (inprec_rstart (INPREC_DISKREMOVE)) { inprec_ru8 (nr); - write_log (L"INPREC: disk eject %d\n", nr); + write_log (_T("INPREC: disk eject %d\n"), nr); inprec_rend (); } } @@ -740,10 +740,10 @@ int inprec_getposition (void) } else if (input_record) { pos = zfile_ftell (inprec_zf); } - write_log (L"INPREC: getpos=%d cycles=%08X\n", pos, lastcycle); + write_log (_T("INPREC: getpos=%d cycles=%08X\n"), pos, lastcycle); if (pos < 0) { - write_log (L"INPREC: getpos failure\n"); - gui_message (L"INPREC error"); + write_log (_T("INPREC: getpos failure\n")); + gui_message (_T("INPREC error")); } return pos; } @@ -751,13 +751,13 @@ int inprec_getposition (void) // normal play to re-record void inprec_playtorecord (void) { - write_log (L"INPREC: PLAY to RE-RECORD\n"); + write_log (_T("INPREC: PLAY to RE-RECORD\n")); replaypos = 0; findlast (); input_play = INPREC_PLAY_RERECORD; input_record = INPREC_RECORD_PLAYING; zfile_fclose (inprec_zf); - inprec_zf = zfile_fopen_empty (NULL, L"inp"); + inprec_zf = zfile_fopen_empty (NULL, _T("inp")); zfile_fwrite (inprec_buffer, header_end2, 1, inprec_zf); uae_u8 *p = inprec_buffer + header_end2; uae_u8 *end = inprec_buffer + inprec_size; @@ -776,10 +776,10 @@ void inprec_setposition (int offset, int replaycounter) if (!inprec_buffer) return; replaypos = replaycounter; - write_log (L"INPREC: setpos=%d\n", offset); + write_log (_T("INPREC: setpos=%d\n"), offset); if (offset < header_end || offset > zfile_size (inprec_zf)) { - write_log (L"INPREC: buffer corruption. offset=%d, size=%d\n", offset, zfile_size (inprec_zf)); - gui_message (L"INPREC error"); + write_log (_T("INPREC: buffer corruption. offset=%d, size=%d\n"), offset, zfile_size (inprec_zf)); + gui_message (_T("INPREC error")); } zfile_fseek (inprec_zf, 0, SEEK_SET); xfree (inprec_buffer); @@ -800,8 +800,8 @@ static void savelog (const TCHAR *path, const TCHAR *file) _tcscpy (tmp, path); _tcscat (tmp, file); - _tcscat (tmp, L".log.txt"); - struct zfile *zfd = zfile_fopen (tmp, L"wb"); + _tcscat (tmp, _T(".log.txt")); + struct zfile *zfd = zfile_fopen (tmp, _T("wb")); if (zfd) { int loglen; uae_u8 *log; @@ -816,7 +816,7 @@ static void savelog (const TCHAR *path, const TCHAR *file) zfile_fwrite (log, loglen, 1, zfd); xfree (log); zfile_fclose (zfd); - write_log (L"log '%s' saved\n", tmp); + write_log (_T("log '%s' saved\n"), tmp); } } @@ -828,21 +828,21 @@ static int savedisk (const TCHAR *path, const TCHAR *file, uae_u8 *data, uae_u8 TCHAR tmp[MAX_DPATH]; TCHAR filename[MAX_DPATH]; filename[0] = 0; - struct zfile *zf = zfile_fopen (fname, L"rb", ZFD_NORMAL); + struct zfile *zf = zfile_fopen (fname, _T("rb"), ZFD_NORMAL); if (!zf) { _tcscpy (tmp, path); _tcscat (tmp, fname); - zf = zfile_fopen (tmp, L"rb", ZFD_NORMAL); + zf = zfile_fopen (tmp, _T("rb"), ZFD_NORMAL); if (!zf) - write_log (L"failed to open '%s'\n", tmp); + write_log (_T("failed to open '%s'\n"), tmp); } if (zf) { _tcscpy (tmp, path); _tcscpy (filename, file); - _tcscat (filename, L"."); + _tcscat (filename, _T(".")); getfilepart (filename + _tcslen (filename), MAX_DPATH, zfile_getname (zf)); _tcscat (tmp, filename); - struct zfile *zfd = zfile_fopen (tmp, L"wb"); + struct zfile *zfd = zfile_fopen (tmp, _T("wb")); if (zfd) { int size = zfile_size (zf); uae_u8 *data = zfile_getdata (zf, 0, size); @@ -872,7 +872,7 @@ void inprec_save (const TCHAR *filename, const TCHAR *statefilename) return; getpathpart (path, sizeof path / sizeof (TCHAR), filename); getfilepart (file, sizeof file / sizeof (TCHAR), filename); - struct zfile *zf = zfile_fopen (filename, L"wb", 0); + struct zfile *zf = zfile_fopen (filename, _T("wb"), 0); if (zf) { TCHAR fn[MAX_DPATH]; uae_u8 *data; @@ -908,9 +908,9 @@ void inprec_save (const TCHAR *filename, const TCHAR *statefilename) xfree (data); zfile_fclose (zf); savelog (path, file); - write_log (L"inputfile '%s' saved\n", filename); + write_log (_T("inputfile '%s' saved\n"), filename); } else { - write_log (L"failed to open '%s'\n", filename); + write_log (_T("failed to open '%s'\n"), filename); } } @@ -927,22 +927,22 @@ void inprec_getstatus (TCHAR *title) TCHAR *p; if (!input_record && !input_play) return; - _tcscat (title, L"["); + _tcscat (title, _T("[")); if (input_record) { if (input_record != INPREC_RECORD_PLAYING) - _tcscat (title, L"-REC-"); + _tcscat (title, _T("-REC-")); else - _tcscat (title, L"REPLAY"); + _tcscat (title, _T("REPLAY")); } else if (input_play) { - _tcscat (title, L"PLAY-"); + _tcscat (title, _T("PLAY-")); } - _tcscat (title, L" "); + _tcscat (title, _T(" ")); p = title + _tcslen (title); int mvp = current_maxvpos (); - _stprintf (p, L"%03d %02d:%02d:%02d/%02d:%02d:%02d", replaypos, + _stprintf (p, _T("%03d %02d:%02d:%02d/%02d:%02d:%02d"), replaypos, lasthsync / (vblank_hz * mvp * 60), ((int)(lasthsync / (vblank_hz * mvp)) % 60), (lasthsync / mvp) % (int)vblank_hz, endhsync / (vblank_hz * mvp * 60), ((int)(endhsync / (vblank_hz * mvp)) % 60), (endhsync / mvp) % (int)vblank_hz); p += _tcslen (p); - _tcscat (p, L"] "); + _tcscat (p, _T("] ")); } diff --git a/isofs.cpp b/isofs.cpp index 96b37a5a..fc35a835 100644 --- a/isofs.cpp +++ b/isofs.cpp @@ -512,12 +512,12 @@ out_nomem: return -ENOMEM; out_noread: - write_log (L"ISOFS: unable to read i-node block %lu\n", block); + write_log (_T("ISOFS: unable to read i-node block %lu\n"), block); xfree(tmpde); return -EIO; out_toomany: - write_log (L"ISOFS: More than 100 file sections ?!?, aborting... isofs_read_level3_size: inode=%lu\n", inode->i_ino); + write_log (_T("ISOFS: More than 100 file sections ?!?, aborting... isofs_read_level3_size: inode=%lu\n"), inode->i_ino); goto out; } @@ -618,20 +618,20 @@ static int isofs_read_inode(struct inode *inode) inode->i_size &= 0x00ffffff; if (de->interleave[0]) { - write_log (L"ISOFS: Interleaved files not (yet) supported.\n"); + write_log (_T("ISOFS: Interleaved files not (yet) supported.\n")); inode->i_size = 0; } /* I have no idea what file_unit_size is used for, so we will flag it for now */ if (de->file_unit_size[0] != 0) { - write_log (L"ISOFS: File unit size != 0 for ISO file (%ld).\n", inode->i_ino); + write_log (_T("ISOFS: File unit size != 0 for ISO file (%ld).\n"), inode->i_ino); } /* I have no idea what other flag bits are used for, so we will flag it for now */ if((de->flags[-high_sierra] & ~2)!= 0){ - write_log (L"ISOFS: Unusual flag settings for ISO file (%ld %x).\n", inode->i_ino, de->flags[-high_sierra]); + write_log (_T("ISOFS: Unusual flag settings for ISO file (%ld %x).\n"), inode->i_ino, de->flags[-high_sierra]); } inode->i_mtime.tv_sec = @@ -700,7 +700,7 @@ out: return ret; out_badread: - write_log(L"ISOFS: unable to read i-node block\n"); + write_log(_T("ISOFS: unable to read i-node block\n")); fail: goto out; } @@ -803,7 +803,7 @@ static int rock_continue(struct rock_state *rs) rs->buffer = NULL; if ((unsigned)rs->cont_offset > blocksize - min_de_size || (unsigned)rs->cont_size > blocksize || (unsigned)(rs->cont_offset + rs->cont_size) > blocksize) { - write_log (L"rock: corrupted directory entry. extent=%d, offset=%d, size=%d\n", rs->cont_extent, rs->cont_offset, rs->cont_size); + write_log (_T("rock: corrupted directory entry. extent=%d, offset=%d, size=%d\n"), rs->cont_extent, rs->cont_offset, rs->cont_size); ret = -EIO; goto out; } @@ -828,7 +828,7 @@ static int rock_continue(struct rock_state *rs) rs->cont_offset = 0; return 0; } - write_log (L"Unable to read rock-ridge attributes\n"); + write_log (_T("Unable to read rock-ridge attributes\n")); } out: xfree(rs->buffer); @@ -890,8 +890,8 @@ static int rock_check_overflow(struct rock_state *rs, int sig) } len += offsetof(struct rock_ridge, u); if (len > rs->len) { - write_log(L"rock: directory entry would overflow storage\n"); - write_log(L"rock: sig=0x%02x, size=%d, remaining=%d\n", sig, len, rs->len); + write_log(_T("rock: directory entry would overflow storage\n")); + write_log(_T("rock: sig=0x%02x, size=%d, remaining=%d\n"), sig, len, rs->len); return -EIO; } return 0; @@ -969,7 +969,7 @@ repeat: break; if (rr->u.NM.flags & ~1) { - write_log(L"Unsupported NM flag settings (%d)\n", rr->u.NM.flags); + write_log(_T("Unsupported NM flag settings (%d)\n"), rr->u.NM.flags); break; } if ((strlen(retname) + rr->len - 5) >= 254) { @@ -1075,13 +1075,13 @@ repeat: break; case SIG('E', 'R'): ISOFS_SB(inode->i_sb)->s_rock = 1; - write_log(L"ISO 9660 Extensions: "); + write_log(_T("ISO 9660 Extensions: ")); { int p; for (p = 0; p < rr->u.ER.len_id; p++) - write_log(L"%c", rr->u.ER.data[p]); + write_log(_T("%c"), rr->u.ER.data[p]); } - write_log(L"\n"); + write_log(_T("\n")); break; case SIG('P', 'X'): inode->i_mode = isonum_733(rr->u.PX.mode); @@ -1174,7 +1174,7 @@ repeat: inode->i_size += 1; break; default: - write_log(L"Symlink component flag not implemented\n"); + write_log(_T("Symlink component flag not implemented\n")); } slen -= slp->len + 2; oldslp = slp; @@ -1204,7 +1204,7 @@ repeat: symlink_len = inode->i_size; break; case SIG('R', 'E'): - write_log(L"Attempt to read inode for relocated directory\n"); + write_log(_T("Attempt to read inode for relocated directory\n")); goto out; case SIG('C', 'L'): ISOFS_I(inode)->i_first_extent = isonum_733(rr->u.CL.location); @@ -1322,7 +1322,7 @@ static char *get_symlink_chunk(char *rpnt, struct rock_ridge *rr, char *plimit) *rpnt++ = '/'; break; default: - write_log(L"Symlink component flag not implemented (%d)\n", slp->flags); + write_log(_T("Symlink component flag not implemented (%d)\n"), slp->flags); } slen -= slp->len + 2; oldslp = slp; @@ -1572,7 +1572,7 @@ static int isofs_get_blocks(struct inode *inode, uae_u32 iblock, struct buffer_h * I/O errors. */ if (b_off > ((inode->i_size) >> ISOFS_BUFFER_BITS(inode))) { - write_log (L"ISOFS: block >= EOF (%lu, %llu)\n", b_off, (unsigned long long)inode->i_size); + write_log (_T("ISOFS: block >= EOF (%lu, %llu)\n"), b_off, (unsigned long long)inode->i_size); goto abort; } @@ -1596,7 +1596,7 @@ static int isofs_get_blocks(struct inode *inode, uae_u32 iblock, struct buffer_h iput(ninode); if (++section > 100) { - write_log (L"ISOFS: More than 100 file sections ?!? aborting...\n"); + write_log (_T("ISOFS: More than 100 file sections ?!? aborting...\n")); goto abort; } } @@ -1735,7 +1735,7 @@ static int isofs_fill_super(struct super_block *s, void *data, int silent, uae_u else if (sec->escape[2] == 0x45) joliet_level = 3; - write_log (L"ISO 9660 Extensions: Microsoft Joliet Level %d\n", joliet_level); + write_log (_T("ISO 9660 Extensions: Microsoft Joliet Level %d\n"), joliet_level); } goto root_found; } else { @@ -1839,16 +1839,16 @@ root_found: first_data_zone = isonum_733(rootp->extent) + isonum_711(rootp->ext_attr_length); sbi->s_firstdatazone = first_data_zone; - write_log (L"ISOFS: Max size:%d Log zone size:%d\n", sbi->s_max_size, 1UL << sbi->s_log_zone_size); - write_log (L"ISOFS: First datazone:%d\n", sbi->s_firstdatazone); + write_log (_T("ISOFS: Max size:%d Log zone size:%d\n"), sbi->s_max_size, 1UL << sbi->s_log_zone_size); + write_log (_T("ISOFS: First datazone:%d\n"), sbi->s_firstdatazone); if(sbi->s_high_sierra) - write_log(L"ISOFS: Disc in High Sierra format.\n"); + write_log(_T("ISOFS: Disc in High Sierra format.\n")); ch = getname(pri->system_id, 4); - write_log (L"ISOFS: System ID: %s", ch); + write_log (_T("ISOFS: System ID: %s"), ch); xfree(ch); volume_name = getname(pri->volume_id, 32); volume_date = iso_ltime(pri->creation_date); - write_log (L" Volume ID: '%s'\n", volume_name); + write_log (_T(" Volume ID: '%s'\n"), volume_name); if (!strncmp(pri->system_id, ISO_SYSTEM_ID_CDTV, strlen(ISO_SYSTEM_ID_CDTV))) sbi->s_cdtv = 1; @@ -1918,7 +1918,7 @@ root_found: * correct Joliet root directory. */ if (sbi->s_rock == 1 && joliet_level && rootdir_empty(s, sbi->s_firstdatazone)) { - write_log(L"ISOFS: primary root directory is empty. Disabling Rock Ridge and switching to Joliet.\n"); + write_log(_T("ISOFS: primary root directory is empty. Disabling Rock Ridge and switching to Joliet.\n")); sbi->s_rock = 0; } @@ -1936,7 +1936,7 @@ root_found: sbi->s_rock = 0; if (sbi->s_firstdatazone != first_data_zone) { sbi->s_firstdatazone = first_data_zone; - write_log (L"ISOFS: changing to secondary root\n"); + write_log (_T("ISOFS: changing to secondary root\n")); iput(inode); inode = isofs_iget(s, sbi->s_firstdatazone, 0, NULL); if (IS_ERR(inode)) @@ -1955,7 +1955,7 @@ root_found: /* Make sure the root inode is a directory */ if (!XS_ISDIR(inode->i_mode)) { - write_log (L"isofs_fill_super: root inode is not a directory. Corrupted media?\n"); + write_log (_T("isofs_fill_super: root inode is not a directory. Corrupted media?\n")); goto out_iput; } @@ -1988,24 +1988,24 @@ out_iput: iput(inode); goto out_no_inode; out_no_root: - write_log (L"ISOFS: get root inode failed\n"); + write_log (_T("ISOFS: get root inode failed\n")); out_no_inode: #ifdef CONFIG_JOLIET unload_nls(sbi->s_nls_iocharset); #endif goto out_freesbi; out_no_read: - write_log (L"ISOFS: bread failed, dev=%d, iso_blknum=%d, block=%d\n", s->unitnum, iso_blknum, block); + write_log (_T("ISOFS: bread failed, dev=%d, iso_blknum=%d, block=%d\n"), s->unitnum, iso_blknum, block); goto out_freebh; out_bad_zone_size: - write_log(L"ISOFS: Bad logical zone size %ld\n", sbi->s_log_zone_size); + write_log(_T("ISOFS: Bad logical zone size %ld\n"), sbi->s_log_zone_size); goto out_freebh; out_bad_size: - write_log (L"ISOFS: Logical zone size(%d) < hardware blocksize(%u)\n", orig_zonesize, opt.blocksize); + write_log (_T("ISOFS: Logical zone size(%d) < hardware blocksize(%u)\n"), orig_zonesize, opt.blocksize); goto out_freebh; out_unknown_format: if (!silent) - write_log (L"ISOFS: Unable to identify CD-ROM format.\n"); + write_log (_T("ISOFS: Unable to identify CD-ROM format.\n")); out_freebh: brelse(bh); brelse(pri_bh); @@ -2134,7 +2134,7 @@ static struct inode *isofs_find_entry(struct inode *dir, char *tmpname, TCHAR *t dpnt = de->name; /* Basic sanity check, whether name doesn't exceed dir entry */ if (de_len < dlen + sizeof(struct iso_directory_record)) { - write_log (L"iso9660: Corrupted directory entry in block %lu of inode %lu\n", block, dir->i_ino); + write_log (_T("iso9660: Corrupted directory entry in block %lu of inode %lu\n"), block, dir->i_ino); return 0; } @@ -2277,7 +2277,7 @@ static int do_isofs_readdir(struct inode *inode, struct file *filp, char *tmpnam } /* Basic sanity check, whether name doesn't exceed dir entry */ if (de_len < de->name_len[0] + sizeof(struct iso_directory_record)) { - write_log (L"iso9660: Corrupted directory entry in block %lu of inode %lu\n", block, inode->i_ino); + write_log (_T("iso9660: Corrupted directory entry in block %lu of inode %lu\n"), block, inode->i_ino); return 0; } @@ -2393,7 +2393,7 @@ void isofs_unmount(void *sbp) if (!sb) return; - write_log (L"miss: %d hit: %d\n", sb->hash_miss, sb->hash_hit); + write_log (_T("miss: %d hit: %d\n"), sb->hash_miss, sb->hash_hit); inode = sb->inodes; while (inode) { struct inode *next = inode->next; diff --git a/jit/compemu_fpp.cpp b/jit/compemu_fpp.cpp index bafe0b69..096b5948 100644 --- a/jit/compemu_fpp.cpp +++ b/jit/compemu_fpp.cpp @@ -151,20 +151,20 @@ STATIC_INLINE int comp_fp_get (uae_u32 opcode, uae_u16 extra, int treg) float si = (float) li; if (li == (int) si) { - //write_log (L"converted immediate LONG constant to SINGLE\n"); + //write_log (_T("converted immediate LONG constant to SINGLE\n")); fmovs_ri(treg,*(uae_u32 *)&si); return 1; } - //write_log (L"immediate LONG constant\n"); + //write_log (_T("immediate LONG constant\n")); fmovl_ri(treg,li); return 2; } case 1: - //write_log (L"immediate SINGLE constant\n"); + //write_log (_T("immediate SINGLE constant\n")); fmovs_ri(treg,comp_get_ilong(m68k_pc_offset-4)); return 1; case 2: - //write_log (L"immediate LONG DOUBLE constant\n"); + //write_log (_T("immediate LONG DOUBLE constant\n")); fmov_ext_ri(treg,comp_get_ilong(m68k_pc_offset-4), comp_get_ilong(m68k_pc_offset-8), (comp_get_ilong(m68k_pc_offset-12)>>16)&0xffff); @@ -173,7 +173,7 @@ STATIC_INLINE int comp_fp_get (uae_u32 opcode, uae_u16 extra, int treg) { float si = (float)(uae_s16)comp_get_iword(m68k_pc_offset-2); - //write_log (L"converted immediate WORD constant to SINGLE\n"); + //write_log (_T("converted immediate WORD constant to SINGLE\n")); fmovs_ri(treg,*(uae_u32 *)&si); return 1; } @@ -184,11 +184,11 @@ STATIC_INLINE int comp_fp_get (uae_u32 opcode, uae_u16 extra, int treg) float si = (float)*(double *)longarray; if (*(double *)longarray == (double)si) { - //write_log (L"SPEED GAIN: converted a DOUBLE constant to SINGLE\n"); + //write_log (_T("SPEED GAIN: converted a DOUBLE constant to SINGLE\n")); fmovs_ri(treg,*(uae_u32 *)&si); return 1; } - //write_log (L"immediate DOUBLE constant\n"); + //write_log (_T("immediate DOUBLE constant\n")); fmov_ri(treg,longarray[0],longarray[1]); return 2; } @@ -196,7 +196,7 @@ STATIC_INLINE int comp_fp_get (uae_u32 opcode, uae_u16 extra, int treg) { float si = (float)(uae_s8)comp_get_ibyte(m68k_pc_offset-2); - //write_log (L"immediate BYTE constant converted to SINGLE\n"); + //write_log (_T("immediate BYTE constant converted to SINGLE\n")); fmovs_ri(treg,*(uae_u32 *)&si); return 1; } @@ -365,7 +365,7 @@ STATIC_INLINE int comp_fp_put (uae_u32 opcode, uae_u16 extra) break; } default: /* All other modes are not allowed for FPx to */ - write_log (L"JIT FMOVE FPx, Mode is not allowed %04x %04x\n",opcode,extra); + write_log (_T("JIT FMOVE FPx, Mode is not allowed %04x %04x\n"),opcode,extra); return -1; } } @@ -467,7 +467,7 @@ void comp_fscc_opp (uae_u32 opcode, uae_u16 extra) } #if DEBUG_FPP - write_log (L"JIT: fscc_opp at %08lx\n", M68K_GETPC); + write_log (_T("JIT: fscc_opp at %08lx\n"), M68K_GETPC); #endif if (extra&0x20) { /* only cc from 00 to 1f are defined */ @@ -990,14 +990,14 @@ void comp_fpp_opp (uae_u32 opcode, uae_u16 extra) mov_l_rr((opcode & 7)+8,ad); return; } /* no break */ - write_log (L"fallback from JIT FMOVEM dynamic register list\n"); + write_log (_T("fallback from JIT FMOVEM dynamic register list\n")); FAIL(1); return; #endif case 2: /* from to FPx */ dont_care_fflags(); if ((extra & 0xfc00) == 0x5c00) { /* FMOVECR */ - //write_log (L"JIT FMOVECR %x\n", opmode); + //write_log (_T("JIT FMOVECR %x\n"), opmode); switch (opmode) { case 0x00: fmov_pi(dreg); @@ -1448,7 +1448,7 @@ void comp_fpp_opp (uae_u32 opcode, uae_u16 extra) fmov_rr(FP_RESULT,dreg); return; default: - write_log (L"Unsupported JIT-FPU instruction: 0x%04x %04x\n",opcode,extra); + write_log (_T("Unsupported JIT-FPU instruction: 0x%04x %04x\n"),opcode,extra); FAIL(1); return; } diff --git a/jit/compemu_raw_x86.cpp b/jit/compemu_raw_x86.cpp index 007d08a8..7fa75d37 100644 --- a/jit/compemu_raw_x86.cpp +++ b/jit/compemu_raw_x86.cpp @@ -641,7 +641,7 @@ LENDFUNC(NONE,NONE,2,raw_imul_32_32,(RW4 d, R4 s)) { #ifdef JIT_DEBUG if (d!=MUL_NREG1 || s!=MUL_NREG2) { - write_log (L"JIT: Bad register in IMUL: d=%d, s=%d\n",d,s); + write_log (_T("JIT: Bad register in IMUL: d=%d, s=%d\n"),d,s); abort(); } #endif @@ -654,7 +654,7 @@ LENDFUNC(NONE,NONE,2,raw_imul_64_32,(RW4 d, RW4 s)) { #ifdef JIT_DEBUG if (d!=MUL_NREG1 || s!=MUL_NREG2) { - write_log (L"JIT: Bad register in MUL: d=%d, s=%d\n",d,s); + write_log (_T("JIT: Bad register in MUL: d=%d, s=%d\n"),d,s); abort(); } #endif @@ -1720,13 +1720,13 @@ int EvalException (LPEXCEPTION_POINTERS blah, int n_except) if (pExceptRecord) addr = (uae_u32)(pExceptRecord->ExceptionInformation[1]); #ifdef JIT_DEBUG - write_log (L"JIT: fault address is 0x%x at 0x%x\n",addr,i); + write_log (_T("JIT: fault address is 0x%x at 0x%x\n"),addr,i); #endif if (!canbang || !currprefs.cachesize) return EXCEPTION_CONTINUE_SEARCH; if (in_handler) - write_log (L"JIT: Argh --- Am already in a handler. Shouldn't happen!\n"); + write_log (_T("JIT: Argh --- Am already in a handler. Shouldn't happen!\n")); if (canbang && i>=compiled_code && i<=current_compile_p) { if (*i==0x66) { @@ -1800,7 +1800,7 @@ int EvalException (LPEXCEPTION_POINTERS blah, int n_except) if (r!=-1) { void* pr=NULL; #ifdef JIT_DEBUG - write_log (L"JIT: register was %d, direction was %d, size was %d\n",r,dir,size); + write_log (_T("JIT: register was %d, direction was %d, size was %d\n"),r,dir,size); #endif switch(r) { @@ -1846,7 +1846,7 @@ int EvalException (LPEXCEPTION_POINTERS blah, int n_except) #ifdef JIT_DEBUG if ((addr>=0x10000000 && addr<0x40000000) || (addr>=0x50000000)) { - write_log (L"JIT: Suspicious address 0x%x in SEGV handler.\n",addr); + write_log (_T("JIT: Suspicious address 0x%x in SEGV handler.\n"),addr); } #endif if (dir==SIG_READ) { @@ -1866,7 +1866,7 @@ int EvalException (LPEXCEPTION_POINTERS blah, int n_except) } } #ifdef JIT_DEBUG - write_log (L"JIT: Handled one access!\n"); + write_log (_T("JIT: Handled one access!\n")); #endif fflush(stdout); segvcount++; @@ -1882,7 +1882,7 @@ int EvalException (LPEXCEPTION_POINTERS blah, int n_except) #ifdef JIT_DEBUG if ((addr>=0x10000000 && addr<0x40000000) || (addr>=0x50000000)) { - write_log (L"JIT: Suspicious address 0x%x in SEGV handler.\n",addr); + write_log (_T("JIT: Suspicious address 0x%x in SEGV handler.\n"),addr); } #endif @@ -1893,8 +1893,8 @@ int EvalException (LPEXCEPTION_POINTERS blah, int n_except) emit_long((uae_u32)veccode-(uae_u32)target-4); #ifdef JIT_DEBUG - write_log (L"JIT: Create jump to %p\n",veccode); - write_log (L"JIT: Handled one access!\n"); + write_log (_T("JIT: Create jump to %p\n"),veccode); + write_log (_T("JIT: Handled one access!\n")); #endif segvcount++; @@ -1930,7 +1930,7 @@ int EvalException (LPEXCEPTION_POINTERS blah, int n_except) (uae_u8*)bi->direct_handler<=i && (uae_u8*)bi->nexthandler>i) { #ifdef JIT_DEBUG - write_log (L"JIT: deleted trigger (%p<%p<%p) %p\n", + write_log (_T("JIT: deleted trigger (%p<%p<%p) %p\n"), bi->handler, i, bi->nexthandler, @@ -1951,7 +1951,7 @@ int EvalException (LPEXCEPTION_POINTERS blah, int n_except) (uae_u8*)bi->direct_handler<=i && (uae_u8*)bi->nexthandler>i) { #ifdef JIT_DEBUG - write_log (L"JIT: deleted trigger (%p<%p<%p) %p\n", + write_log (_T("JIT: deleted trigger (%p<%p<%p) %p\n"), bi->handler, i, bi->nexthandler, @@ -1965,24 +1965,24 @@ int EvalException (LPEXCEPTION_POINTERS blah, int n_except) bi=bi->next; } #ifdef JIT_DEBUG - write_log (L"JIT: Huh? Could not find trigger!\n"); + write_log (_T("JIT: Huh? Could not find trigger!\n")); #endif return EXCEPTION_CONTINUE_EXECUTION; } } - write_log (L"JIT: Can't handle access %08X!\n", i); + write_log (_T("JIT: Can't handle access %08X!\n"), i); #if 0 if (i) { int j; for (j=0;j<10;j++) { - write_log (L"JIT: instruction byte %2d is 0x%02x\n",j,i[j]); + write_log (_T("JIT: instruction byte %2d is 0x%02x\n"),j,i[j]); } } - write_log (L"Please send the above info (starting at \"fault address\") to\n" - L"bmeyer@csse.monash.edu.au\n" - L"This shouldn't happen ;-)\n"); + write_log (_T("Please send the above info (starting at \"fault address\") to\n") + _T("bmeyer@csse.monash.edu.au\n") + _T("This shouldn't happen ;-)\n")); #endif return EXCEPTION_CONTINUE_SEARCH; } @@ -1997,11 +1997,11 @@ static void vec(int x, struct sigcontext sc) int len=0; int j; - write_log (L"JIT: fault address is %08x at %08x\n",sc.cr2,sc.eip); + write_log (_T("JIT: fault address is %08x at %08x\n"),sc.cr2,sc.eip); if (!canbang) - write_log (L"JIT: Not happy! Canbang is 0 in SIGSEGV handler!\n"); + write_log (_T("JIT: Not happy! Canbang is 0 in SIGSEGV handler!\n")); if (in_handler) - write_log (L"JIT: Argh --- Am already in a handler. Shouldn't happen!\n"); + write_log (_T("JIT: Argh --- Am already in a handler. Shouldn't happen!\n")); if (canbang && i>=compiled_code && i<=current_compile_p) { if (*i==0x66) { @@ -2076,7 +2076,7 @@ static void vec(int x, struct sigcontext sc) if (r!=-1) { void* pr=NULL; - write_log (L"JIT: register was %d, direction was %d, size was %d\n",r,dir,size); + write_log (_T("JIT: register was %d, direction was %d, size was %d\n"),r,dir,size); switch(r) { case 0: pr=&(sc.eax); break; @@ -2103,7 +2103,7 @@ static void vec(int x, struct sigcontext sc) if ((addr>=0x10000000 && addr<0x40000000) || (addr>=0x50000000)) { - write_log (L"JIT: Suspicious address in %x SEGV handler.\n",addr); + write_log (_T("JIT: Suspicious address in %x SEGV handler.\n"),addr); } if (dir==SIG_READ) { switch(size) { @@ -2121,7 +2121,7 @@ static void vec(int x, struct sigcontext sc) default: abort(); } } - write_log (L"JIT: Handled one access!\n"); + write_log (_T("JIT: Handled one access!\n")); fflush(stdout); segvcount++; sc.eip+=len; @@ -2135,7 +2135,7 @@ static void vec(int x, struct sigcontext sc) if ((addr>=0x10000000 && addr<0x40000000) || (addr>=0x50000000)) { - write_log (L"JIT: Suspicious address 0x%x in SEGV handler.\n",addr); + write_log (_T("JIT: Suspicious address 0x%x in SEGV handler.\n"),addr); } target=(uae_u8*)sc.eip; @@ -2143,9 +2143,9 @@ static void vec(int x, struct sigcontext sc) vecbuf[i]=target[i]; emit_byte(0xe9); emit_long((uae_u32)veccode-(uae_u32)target-4); - write_log (L"JIT: Create jump to %p\n",veccode); + write_log (_T("JIT: Create jump to %p\n"),veccode); - write_log (L"JIT: Handled one access!\n"); + write_log (_T("JIT: Handled one access!\n")); segvcount++; target=veccode; @@ -2179,7 +2179,7 @@ static void vec(int x, struct sigcontext sc) if (bi->handler && (uae_u8*)bi->direct_handler<=i && (uae_u8*)bi->nexthandler>i) { - write_log (L"JIT: deleted trigger (%p<%p<%p) %p\n", + write_log (_T("JIT: deleted trigger (%p<%p<%p) %p\n"), bi->handler, i, bi->nexthandler, @@ -2198,7 +2198,7 @@ static void vec(int x, struct sigcontext sc) if (bi->handler && (uae_u8*)bi->direct_handler<=i && (uae_u8*)bi->nexthandler>i) { - write_log (L"JIT: deleted trigger (%p<%p<%p) %p\n", + write_log (_T("JIT: deleted trigger (%p<%p<%p) %p\n"), bi->handler, i, bi->nexthandler, @@ -2210,16 +2210,16 @@ static void vec(int x, struct sigcontext sc) } bi=bi->next; } - write_log (L"JIT: Huh? Could not find trigger!\n"); + write_log (_T("JIT: Huh? Could not find trigger!\n")); return; } } - write_log (L"JIT: Can't handle access!\n"); + write_log (_T("JIT: Can't handle access!\n")); for (j=0;j<10;j++) { - write_log (L"JIT: instruction byte %2d is %02x\n",j,i[j]); + write_log (_T("JIT: instruction byte %2d is %02x\n"),j,i[j]); } #if 0 - write_log (L"Please send the above info (starting at \"fault address\") to\n" + write_log (_T("Please send the above info (starting at \"fault address\") to\n") "bmeyer@csse.monash.edu.au\n" "This shouldn't happen ;-)\n"); fflush(stdout); @@ -2464,7 +2464,7 @@ static void raw_init_cpu(void) } { TCHAR *s = au (c->x86_vendor_id); - write_log (L"CPUID level=%d, Family=%d, Model=%d, Mask=%d, Vendor=%s [%d]\n", + write_log (_T("CPUID level=%d, Family=%d, Model=%d, Mask=%d, Vendor=%s [%d]\n"), c->cpuid_level, c->x86, c->x86_model, c->x86_mask, s, c->x86_vendor); xfree (s); } @@ -2493,7 +2493,7 @@ static int target_check_bsf(void) } }}}} if (mismatch) - write_log (L"Target CPU defines all flags on BSF instruction\n"); + write_log (_T("Target CPU defines all flags on BSF instruction\n")); return !mismatch; } #endif @@ -2561,7 +2561,7 @@ static void raw_init_cpu(void) x=cpuid(0); maxlev=x.eax; - write_log (L"Max CPUID level=%d Processor is %c%c%c%c%c%c%c%c%c%c%c%c\n", + write_log (_T("Max CPUID level=%d Processor is %c%c%c%c%c%c%c%c%c%c%c%c\n"), maxlev, x.ebx, x.ebx>>8, @@ -2589,16 +2589,16 @@ static void raw_init_cpu(void) have_rat_stall=0; #endif #if 0 - write_log (L"have_cmov=%d, avoid_cmov=%d, have_rat_stall=%d\n", + write_log (_T("have_cmov=%d, avoid_cmov=%d, have_rat_stall=%d\n"), have_cmov,currprefs.avoid_cmov,have_rat_stall); if (currprefs.avoid_cmov) { - write_log (L"Disabling cmov use despite processor claiming to support it!\n"); + write_log (_T("Disabling cmov use despite processor claiming to support it!\n")); have_cmov=0; } #else /* Dear Bernie, I don't want to keep around options which are useless, and not represented in the GUI anymore... Is this okay? */ - write_log (L"have_cmov=%d, have_rat_stall=%d\n", have_cmov, have_rat_stall); + write_log (_T("have_cmov=%d, have_rat_stall=%d\n"), have_cmov, have_rat_stall); #endif #if 0 /* For testing of non-cmov code! */ have_cmov=0; @@ -2683,7 +2683,7 @@ STATIC_INLINE int stackpos(int r) if (live.spos[r]<0) abort(); if (live.tosdirect_handler_to_use) { dependency* x=bi->deplist; - //write_log (L"JIT: bi->deplist=%p\n",bi->deplist); + //write_log (_T("JIT: bi->deplist=%p\n"),bi->deplist); while (x) { - //write_log (L"JIT: x is %p\n",x); - //write_log (L"JIT: x->next is %p\n",x->next); - //write_log (L"JIT: x->prev_p is %p\n",x->prev_p); + //write_log (_T("JIT: x is %p\n"),x); + //write_log (_T("JIT: x->next is %p\n"),x->next); + //write_log (_T("JIT: x->prev_p is %p\n"),x->prev_p); if (x->jmp_off) { adjust_jmpdep(x,dh); @@ -320,7 +320,7 @@ STATIC_INLINE void create_jmpdep(blockinfo* bi, int i, uae_u32* jmpaddr, uae_u32 blockinfo* tbi=get_blockinfo_addr((void*)target); Dif(!tbi) { - jit_abort (L"JIT: Could not create jmpdep!\n"); + jit_abort (_T("JIT: Could not create jmpdep!\n")); } bi->dep[i].jmp_off=jmpaddr; bi->dep[i].target=tbi; @@ -348,7 +348,7 @@ STATIC_INLINE void big_to_small_state(bigstate* b, smallstate* s) count++; } } - write_log (L"JIT: count=%d\n",count); + write_log (_T("JIT: count=%d\n"),count); for (i=0;inat[i].dirtysize=0; } @@ -388,7 +388,7 @@ STATIC_INLINE blockinfo* get_blockinfo_addr_new(void* addr, int setstate) } } if (!bi) { - jit_abort (L"JIT: Looking for blockinfo, can't find free one\n"); + jit_abort (_T("JIT: Looking for blockinfo, can't find free one\n")); } #if USE_MATCHSTATE @@ -493,11 +493,11 @@ bool check_prefs_changed_comp (void) changed = 1; if (currprefs.cachesize) - write_log (L"JIT: Reverting to \"indirect\" access, because canbang is zero!\n"); + write_log (_T("JIT: Reverting to \"indirect\" access, because canbang is zero!\n")); } if (changed) - write_log (L"JIT: cache=%d. b=%d w=%d l=%d fpu=%d nf=%d const=%d hard=%d\n", + write_log (_T("JIT: cache=%d. b=%d w=%d l=%d fpu=%d nf=%d const=%d hard=%d\n"), currprefs.cachesize, currprefs.comptrustbyte, currprefs.comptrustword, currprefs.comptrustlong, currprefs.compfpu, currprefs.compnf, currprefs.comp_constjump, currprefs.comp_hardflush); @@ -506,21 +506,21 @@ bool check_prefs_changed_comp (void) if (!currprefs.compforcesettings) { int stop=0; if (currprefs.comptrustbyte!=0 && currprefs.comptrustbyte!=3) - stop = 1, write_log (L"JIT: comptrustbyte is not 'direct' or 'afterpic'\n"); + stop = 1, write_log (_T("JIT: comptrustbyte is not 'direct' or 'afterpic'\n")); if (currprefs.comptrustword!=0 && currprefs.comptrustword!=3) - stop = 1, write_log (L"JIT: comptrustword is not 'direct' or 'afterpic'\n"); + stop = 1, write_log (_T("JIT: comptrustword is not 'direct' or 'afterpic'\n")); if (currprefs.comptrustlong!=0 && currprefs.comptrustlong!=3) - stop = 1, write_log (L"JIT: comptrustlong is not 'direct' or 'afterpic'\n"); + stop = 1, write_log (_T("JIT: comptrustlong is not 'direct' or 'afterpic'\n")); if (currprefs.comptrustnaddr!=0 && currprefs.comptrustnaddr!=3) - stop = 1, write_log (L"JIT: comptrustnaddr is not 'direct' or 'afterpic'\n"); + stop = 1, write_log (_T("JIT: comptrustnaddr is not 'direct' or 'afterpic'\n")); if (currprefs.compnf!=1) - stop = 1, write_log (L"JIT: compnf is not 'yes'\n"); + stop = 1, write_log (_T("JIT: compnf is not 'yes'\n")); if (currprefs.cachesize<1024) - stop = 1, write_log (L"JIT: cachesize is less than 1024\n"); + stop = 1, write_log (_T("JIT: cachesize is less than 1024\n")); if (currprefs.comp_hardflush) - stop = 1, write_log (L"JIT: comp_flushmode is 'hard'\n"); + stop = 1, write_log (_T("JIT: comp_flushmode is 'hard'\n")); if (!canbang) - stop = 1, write_log (L"JIT: Cannot use most direct memory access,\n" + stop = 1, write_log (_T("JIT: Cannot use most direct memory access,\n") " and unable to recover from failed guess!\n"); if (stop) { gui_message("JIT: Configuration problems were detected!\n" @@ -614,7 +614,7 @@ static void make_flags_live_internal(void) if (live.flags_in_flags==VALID) return; Dif (live.flags_on_stack==TRASH) { - jit_abort (L"JIT: Want flags, got something on stack, but it is TRASH\n"); + jit_abort (_T("JIT: Want flags, got something on stack, but it is TRASH\n")); } if (live.flags_on_stack==VALID) { int tmp; @@ -625,7 +625,7 @@ static void make_flags_live_internal(void) live.flags_in_flags=VALID; return; } - jit_abort (L"JIT: Huh? live.flags_in_flags=%d, live.flags_on_stack=%d, but need to make live\n", + jit_abort (_T("JIT: Huh? live.flags_in_flags=%d, live.flags_on_stack=%d, but need to make live\n"), live.flags_in_flags,live.flags_on_stack); } @@ -638,7 +638,7 @@ static void flags_to_stack(void) return; } Dif (live.flags_in_flags!=VALID) - jit_abort (L"flags_to_stack != VALID"); + jit_abort (_T("flags_to_stack != VALID")); else { int tmp; tmp=writereg_specific(FLAGTMP,4,FLAG_NREG1); @@ -724,17 +724,17 @@ STATIC_INLINE void log_dump(void) return; - write_log (L"----------------------\n"); + write_log (_T("----------------------\n")); for (i=0;i0) { free_nreg(bestreg); @@ -932,9 +932,9 @@ static int alloc_reg_hinted(int r, int size, int willclobber, int hint) /* This will happen if we read a partially dirty register at a bigger size */ Dif (willclobber || live.state[r].validsize>=size) - jit_abort (L"willclobber || live.state[r].validsize>=size"); + jit_abort (_T("willclobber || live.state[r].validsize>=size")); Dif (live.nat[rr].nholds!=1) - jit_abort (L"live.nat[rr].nholds!=1"); + jit_abort (_T("live.nat[rr].nholds!=1")); if (size==4 && live.state[r].validsize==2) { log_isused(bestreg); raw_mov_l_rm(bestreg,(uae_u32)live.state[r].mem); @@ -1022,7 +1022,7 @@ static int alloc_reg(int r, int size, int willclobber) static void unlock(int r) { Dif (!live.nat[r].locked) - jit_abort (L"unlock %d not locked", r); + jit_abort (_T("unlock %d not locked"), r); live.nat[r].locked--; } @@ -1089,7 +1089,7 @@ STATIC_INLINE void make_exclusive(int r, int size, int spec) } } Dif (live.nat[rr].nholds!=1) { - jit_abort (L"JIT: natreg %d holds %d vregs, %d not exclusive\n", + jit_abort (_T("JIT: natreg %d holds %d vregs, %d not exclusive\n"), rr,live.nat[rr].nholds,r); } return; @@ -1150,7 +1150,7 @@ STATIC_INLINE void remove_offset(int r, int spec) alloc_reg_hinted(r,4,0,spec); Dif (live.state[r].validsize!=4) { - jit_abort (L"JIT: Validsize=%d in remove_offset\n",live.state[r].validsize); + jit_abort (_T("JIT: Validsize=%d in remove_offset\n"),live.state[r].validsize); } make_exclusive(r,0,-1); /* make_exclusive might have done the job already */ @@ -1160,7 +1160,7 @@ STATIC_INLINE void remove_offset(int r, int spec) rr=live.state[r].realreg; if (live.nat[rr].nholds==1) { - //write_log (L"JIT: RemovingB offset %x from reg %d (%d) at %p\n", + //write_log (_T("JIT: RemovingB offset %x from reg %d (%d) at %p\n"), // live.state[r].val,r,rr,target); adjust_nreg(rr,live.state[r].val); live.state[r].dirtysize=4; @@ -1168,7 +1168,7 @@ STATIC_INLINE void remove_offset(int r, int spec) set_status(r,DIRTY); return; } - jit_abort (L"JIT: Failed in remove_offset\n"); + jit_abort (_T("JIT: Failed in remove_offset\n")); } STATIC_INLINE void remove_all_offsets(void) @@ -1185,7 +1185,7 @@ STATIC_INLINE int readreg_general(int r, int size, int spec, int can_offset) int answer=-1; if (live.state[r].status==UNDEF) { - write_log (L"JIT: WARNING: Unexpected read of undefined register %d\n",r); + write_log (_T("JIT: WARNING: Unexpected read of undefined register %d\n"),r); } if (!can_offset) remove_offset(r,spec); @@ -1261,7 +1261,7 @@ STATIC_INLINE int writereg_general(int r, int size, int spec) n=live.state[r].realreg; Dif (live.nat[n].nholds!=1) - jit_abort (L"live.nat[%d].nholds!=1", n); + jit_abort (_T("live.nat[%d].nholds!=1"), n); switch(size) { case 1: if (live.nat[n].canbyte || spec>=0) { @@ -1308,7 +1308,7 @@ STATIC_INLINE int writereg_general(int r, int size, int spec) } else { Dif (live.state[r].val) { - jit_abort (L"JIT: Problem with val\n"); + jit_abort (_T("JIT: Problem with val\n")); } } set_status(r,DIRTY); @@ -1331,18 +1331,18 @@ STATIC_INLINE int rmw_general(int r, int wsize, int rsize, int spec) int answer=-1; if (live.state[r].status==UNDEF) { - write_log (L"JIT: WARNING: Unexpected read of undefined register %d\n",r); + write_log (_T("JIT: WARNING: Unexpected read of undefined register %d\n"),r); } remove_offset(r,spec); make_exclusive(r,0,spec); Dif (wsize=rsize) { n=live.state[r].realreg; Dif (live.nat[n].nholds!=1) - jit_abort (L"live.nat[n].nholds!=1", n); + jit_abort (_T("live.nat[n].nholds!=1"), n); switch(rsize) { case 1: @@ -1384,7 +1384,7 @@ STATIC_INLINE int rmw_general(int r, int wsize, int rsize, int spec) live.nat[answer].touched=touchcnt++; Dif (live.state[r].val) { - jit_abort (L"JIT: Problem with val(rmw)\n"); + jit_abort (_T("JIT: Problem with val(rmw)\n")); } return answer; } @@ -1459,7 +1459,7 @@ static void f_evict(int r) Dif (live.fat[rr].locked && live.fat[rr].nholds==1) { - jit_abort (L"JIT: FPU register %d in nreg %d is locked!\n",r,live.fate[r].realreg); + jit_abort (_T("JIT: FPU register %d in nreg %d is locked!\n"),r,live.fate[r].realreg); } live.fat[rr].nholds--; @@ -1485,7 +1485,7 @@ STATIC_INLINE void f_free_nreg(int r) f_evict(vr); } Dif (live.fat[r].nholds!=0) { - jit_abort (L"JIT: Failed to free nreg %d, nholds is %d\n",r,live.fat[r].nholds); + jit_abort (_T("JIT: Failed to free nreg %d, nholds is %d\n"),r,live.fat[r].nholds); } } @@ -1561,7 +1561,7 @@ static int f_alloc_reg(int r, int willclobber) static void f_unlock(int r) { Dif (!live.fat[r].locked) - jit_abort (L"unlock %d", r); + jit_abort (_T("unlock %d"), r); live.fat[r].locked--; } @@ -1617,14 +1617,14 @@ STATIC_INLINE void f_make_exclusive(int r, int clobber) } } Dif (live.fat[rr].nholds!=1) { - write_log (L"JIT: realreg %d holds %d (",rr,live.fat[rr].nholds); + write_log (_T("JIT: realreg %d holds %d ("),rr,live.fat[rr].nholds); for (i=0;i1) - jit_abort (L"vinton"); + jit_abort (_T("vinton")); if (live.nat[n].nholds && depth0) { - write_log (L"%08x ",*pos); + write_log (_T("%08x "),*pos); pos++; len-=4; } - write_log (L" bla\n"); + write_log (_T(" bla\n")); } } @@ -5478,7 +5478,7 @@ static void recompile_block(void) blockinfo* bi=get_blockinfo_addr(regs.pc_p); Dif (!bi) - jit_abort (L"recompile_block"); + jit_abort (_T("recompile_block")); raise_in_cl_list(bi); execute_normal(); return; @@ -5495,7 +5495,7 @@ static void cache_miss(void) return; } Dif (!bi2 || bi==bi2) { - jit_abort (L"Unexplained cache miss %p %p\n",bi,bi2); + jit_abort (_T("Unexplained cache miss %p %p\n"),bi,bi2); } raise_in_cl_list(bi); return; @@ -5535,7 +5535,7 @@ static void check_checksum(void) bi->handler_to_use=bi->handler; set_dhtu(bi,bi->direct_handler); - /* write_log (L"JIT: reactivate %p/%p (%x %x/%x %x)\n",bi,bi->pc_p, + /* write_log (_T("JIT: reactivate %p/%p (%x %x/%x %x)\n"),bi,bi->pc_p, c1,c2,bi->c1,bi->c2);*/ remove_from_list(bi); add_to_active(bi); @@ -5544,7 +5544,7 @@ static void check_checksum(void) else { /* This block actually changed. We need to invalidate it, and set it up to be recompiled */ - /* write_log (L"JIT: discard %p/%p (%x %x/%x %x)\n",bi,bi->pc_p, + /* write_log (_T("JIT: discard %p/%p (%x %x/%x %x)\n"),bi,bi->pc_p, c1,c2,bi->c1,bi->c2); */ invalidate_block(bi); raise_in_cl_list(bi); @@ -5701,12 +5701,12 @@ void build_comp(void) #endif raw_init_cpu(); #ifdef NATMEM_OFFSET - write_log (L"JIT: Setting signal handler\n"); + write_log (_T("JIT: Setting signal handler\n")); #ifndef _WIN32 signal(SIGSEGV,vec); #endif #endif - write_log (L"JIT: Building Compiler function table\n"); + write_log (_T("JIT: Building Compiler function table\n")); for (opcode = 0; opcode < 65536; opcode++) { #ifdef NOFLAGS_SUPPORT nfcpufunctbl[opcode] = op_illg; @@ -5795,7 +5795,7 @@ void build_comp(void) if (compfunctbl[opcode]) count++; } - write_log (L"JIT: Supposedly %d compileable opcodes!\n",count); + write_log (_T("JIT: Supposedly %d compileable opcodes!\n"),count); /* Initialise state */ alloc_cache(); @@ -5829,7 +5829,7 @@ static void flush_icache_hard(uae_u32 ptr, int n) hard_flush_count++; #if 0 - write_log (L"JIT: Flush Icache_hard(%d/%x/%p), %u instruction bytes\n", + write_log (_T("JIT: Flush Icache_hard(%d/%x/%p), %u instruction bytes\n"), n,regs.pc,regs.pc_p,current_compile_p-compiled_code); #endif bi=active; @@ -5901,7 +5901,7 @@ void flush_icache(uaecptr ptr, int n) static void catastrophe(void) { - jit_abort (L"catastprophe"); + jit_abort (_T("catastprophe")); } int failure; @@ -5938,14 +5938,14 @@ void compile_block(cpu_history* pc_hist, int blocklen, int totcycles) Dif (bi!=bi2) { /* I don't think it can happen anymore. Shouldn't, in any case. So let's make sure... */ - jit_abort (L"JIT: WOOOWOO count=%d, ol=%d %p %p\n", + jit_abort (_T("JIT: WOOOWOO count=%d, ol=%d %p %p\n"), bi->count,bi->optlevel,bi->handler_to_use, cache_tags[cl].handler); } Dif (bi->count!=-1 && bi->status!=BI_TARGETTED) { /* What the heck? We are not supposed to be here! */ - jit_abort (L"BI_TARGETTED"); + jit_abort (_T("BI_TARGETTED")); } } if (bi->count==-1) { diff --git a/keybuf.cpp b/keybuf.cpp index aed89f5f..c06744bd 100644 --- a/keybuf.cpp +++ b/keybuf.cpp @@ -42,7 +42,7 @@ int get_next_key (void) key = keybuf[kpb_last]; if (++kpb_last == 256) kpb_last = 0; - //write_log (L"%02x:%d\n", key >> 1, key & 1); + //write_log (_T("%02x:%d\n"), key >> 1, key & 1); return key; } @@ -60,11 +60,11 @@ int record_key_direct (int kc) int k = kc >> 1; int b = !(kc & 1); - //write_log (L"got kc %02X\n", ((kc << 7) | (kc >> 1)) & 0xff); + //write_log (_T("got kc %02X\n"), ((kc << 7) | (kc >> 1)) & 0xff); if (kpb_next == 256) kpb_next = 0; if (kpb_next == kpb_last) { - write_log (L"Keyboard buffer overrun. Congratulations.\n"); + write_log (_T("Keyboard buffer overrun. Congratulations.\n")); return 0; } #if 0 diff --git a/main.cpp b/main.cpp index e404e104..29fe0e6f 100644 --- a/main.cpp +++ b/main.cpp @@ -84,7 +84,7 @@ uae_u32 uaesrand (uae_u32 seed) oldhcounter = -1; randseed = seed; //randseed = 0x12345678; - //write_log (L"seed=%08x\n", randseed); + //write_log (_T("seed=%08x\n"), randseed); return randseed; } uae_u32 uaerand (void) @@ -94,7 +94,7 @@ uae_u32 uaerand (void) oldhcounter = hsync_counter; } uae_u32 r = rand (); - //write_log (L"rand=%08x\n", r); + //write_log (_T("rand=%08x\n"), r); return r; } uae_u32 uaerandgetseed (void) @@ -224,20 +224,20 @@ void fixup_prefs (struct uae_prefs *p) || p->chipmem_size < 0x20000 || p->chipmem_size > 0x800000) { - write_log (L"Unsupported chipmem size %x!\n", p->chipmem_size); + write_log (_T("Unsupported chipmem size %x!\n"), p->chipmem_size); p->chipmem_size = 0x200000; err = 1; } if ((p->fastmem_size & (p->fastmem_size - 1)) != 0 || (p->fastmem_size != 0 && (p->fastmem_size < 0x100000 || p->fastmem_size > 0x800000))) { - write_log (L"Unsupported fastmem size %x!\n", p->fastmem_size); + write_log (_T("Unsupported fastmem size %x!\n"), p->fastmem_size); err = 1; } if ((p->rtgmem_size & (p->rtgmem_size - 1)) != 0 || (p->rtgmem_size != 0 && (p->rtgmem_size < 0x100000 || p->rtgmem_size > max_z3fastmem / 2))) { - write_log (L"Unsupported graphics card memory size %x (%x)!\n", p->rtgmem_size, max_z3fastmem / 2); + write_log (_T("Unsupported graphics card memory size %x (%x)!\n"), p->rtgmem_size, max_z3fastmem / 2); if (p->rtgmem_size > max_z3fastmem / 2) p->rtgmem_size = max_z3fastmem / 2; else @@ -248,7 +248,7 @@ void fixup_prefs (struct uae_prefs *p) if ((p->z3fastmem_size & (p->z3fastmem_size - 1)) != 0 || (p->z3fastmem_size != 0 && (p->z3fastmem_size < 0x100000 || p->z3fastmem_size > max_z3fastmem))) { - write_log (L"Unsupported Zorro III fastmem size %x (%x)!\n", p->z3fastmem_size, max_z3fastmem); + write_log (_T("Unsupported Zorro III fastmem size %x (%x)!\n"), p->z3fastmem_size, max_z3fastmem); if (p->z3fastmem_size > max_z3fastmem) p->z3fastmem_size = max_z3fastmem; else @@ -258,7 +258,7 @@ void fixup_prefs (struct uae_prefs *p) if ((p->z3fastmem2_size & (p->z3fastmem2_size - 1)) != 0 || (p->z3fastmem2_size != 0 && (p->z3fastmem2_size < 0x100000 || p->z3fastmem2_size > max_z3fastmem))) { - write_log (L"Unsupported Zorro III fastmem size %x (%x)!\n", p->z3fastmem2_size, max_z3fastmem); + write_log (_T("Unsupported Zorro III fastmem size %x (%x)!\n"), p->z3fastmem2_size, max_z3fastmem); if (p->z3fastmem2_size > max_z3fastmem) p->z3fastmem2_size = max_z3fastmem; else @@ -271,7 +271,7 @@ void fixup_prefs (struct uae_prefs *p) if ((p->z3chipmem_size & (p->z3chipmem_size - 1)) != 0 || (p->z3chipmem_size != 0 && (p->z3chipmem_size < 0x100000 || p->z3chipmem_size > max_z3fastmem))) { - write_log (L"Unsupported Zorro III fake chipmem size %x (%x)!\n", p->z3chipmem_size, max_z3fastmem); + write_log (_T("Unsupported Zorro III fake chipmem size %x (%x)!\n"), p->z3chipmem_size, max_z3fastmem); if (p->z3chipmem_size > max_z3fastmem) p->z3chipmem_size = max_z3fastmem; else @@ -281,99 +281,99 @@ void fixup_prefs (struct uae_prefs *p) if (p->address_space_24 && (p->z3fastmem_size != 0 || p->z3fastmem2_size != 0 || p->z3chipmem_size != 0)) { p->z3fastmem_size = p->z3fastmem2_size = p->z3chipmem_size = 0; - write_log (L"Can't use a graphics card or 32-bit memory when using a 24 bit\naddress space.\n"); + write_log (_T("Can't use a graphics card or 32-bit memory when using a 24 bit\naddress space.\n")); } if (p->bogomem_size != 0 && p->bogomem_size != 0x80000 && p->bogomem_size != 0x100000 && p->bogomem_size != 0x180000 && p->bogomem_size != 0x1c0000) { p->bogomem_size = 0; - write_log (L"Unsupported bogomem size!\n"); + write_log (_T("Unsupported bogomem size!\n")); err = 1; } if (p->bogomem_size > 0x180000 && (p->cs_fatgaryrev >= 0 || p->cs_ide || p->cs_ramseyrev >= 0)) { p->bogomem_size = 0x180000; - write_log (L"Possible Gayle bogomem conflict fixed\n"); + write_log (_T("Possible Gayle bogomem conflict fixed\n")); } if (p->chipmem_size > 0x200000 && p->fastmem_size != 0) { - write_log (L"You can't use fastmem and more than 2MB chip at the same time!\n"); + write_log (_T("You can't use fastmem and more than 2MB chip at the same time!\n")); p->fastmem_size = 0; err = 1; } if (p->mbresmem_low_size > 0x04000000 || (p->mbresmem_low_size & 0xfffff)) { p->mbresmem_low_size = 0; - write_log (L"Unsupported A3000 MB RAM size\n"); + write_log (_T("Unsupported A3000 MB RAM size\n")); } if (p->mbresmem_high_size > 0x04000000 || (p->mbresmem_high_size & 0xfffff)) { p->mbresmem_high_size = 0; - write_log (L"Unsupported Motherboard RAM size\n"); + write_log (_T("Unsupported Motherboard RAM size\n")); } if (p->address_space_24 && p->rtgmem_size) p->rtgmem_type = 0; if (!p->rtgmem_type && (p->chipmem_size > 2 * 1024 * 1024 || getz2size (p) > 8 * 1024 * 1024 || getz2size (p) < 0)) { p->rtgmem_size = 0; - write_log (L"Too large Z2 RTG memory size\n"); + write_log (_T("Too large Z2 RTG memory size\n")); } #if 0 if (p->m68k_speed < -1 || p->m68k_speed > 20) { - write_log (L"Bad value for -w parameter: must be -1, 0, or within 1..20.\n"); + write_log (_T("Bad value for -w parameter: must be -1, 0, or within 1..20.\n")); p->m68k_speed = 4; err = 1; } #endif if (p->produce_sound < 0 || p->produce_sound > 3) { - write_log (L"Bad value for -S parameter: enable value must be within 0..3\n"); + write_log (_T("Bad value for -S parameter: enable value must be within 0..3\n")); p->produce_sound = 0; err = 1; } if (p->comptrustbyte < 0 || p->comptrustbyte > 3) { - write_log (L"Bad value for comptrustbyte parameter: value must be within 0..2\n"); + write_log (_T("Bad value for comptrustbyte parameter: value must be within 0..2\n")); p->comptrustbyte = 1; err = 1; } if (p->comptrustword < 0 || p->comptrustword > 3) { - write_log (L"Bad value for comptrustword parameter: value must be within 0..2\n"); + write_log (_T("Bad value for comptrustword parameter: value must be within 0..2\n")); p->comptrustword = 1; err = 1; } if (p->comptrustlong < 0 || p->comptrustlong > 3) { - write_log (L"Bad value for comptrustlong parameter: value must be within 0..2\n"); + write_log (_T("Bad value for comptrustlong parameter: value must be within 0..2\n")); p->comptrustlong = 1; err = 1; } if (p->comptrustnaddr < 0 || p->comptrustnaddr > 3) { - write_log (L"Bad value for comptrustnaddr parameter: value must be within 0..2\n"); + write_log (_T("Bad value for comptrustnaddr parameter: value must be within 0..2\n")); p->comptrustnaddr = 1; err = 1; } if (p->cachesize < 0 || p->cachesize > 16384) { - write_log (L"Bad value for cachesize parameter: value must be within 0..16384\n"); + write_log (_T("Bad value for cachesize parameter: value must be within 0..16384\n")); p->cachesize = 0; err = 1; } if (p->z3fastmem_size > 0 && (p->address_space_24 || p->cpu_model < 68020)) { - write_log (L"Z3 fast memory can't be used with a 68000/68010 emulation. It\n" - L"requires a 68020 emulation. Turning off Z3 fast memory.\n"); + write_log (_T("Z3 fast memory can't be used with a 68000/68010 emulation. It\n") + _T("requires a 68020 emulation. Turning off Z3 fast memory.\n")); p->z3fastmem_size = 0; err = 1; } if (p->rtgmem_size > 0 && p->rtgmem_type && (p->cpu_model < 68020 || p->address_space_24)) { - write_log (L"RTG can't be used with a 68000/68010 or 68EC020 emulation. It\n" - L"requires a 68020 emulation. Turning off RTG.\n"); + write_log (_T("RTG can't be used with a 68000/68010 or 68EC020 emulation. It\n") + _T("requires a 68020 emulation. Turning off RTG.\n")); p->rtgmem_size = 0; err = 1; } #if !defined (BSDSOCKET) if (p->socket_emu) { - write_log (L"Compile-time option of BSDSOCKET_SUPPORTED was not enabled. You can't use bsd-socket emulation.\n"); + write_log (_T("Compile-time option of BSDSOCKET_SUPPORTED was not enabled. You can't use bsd-socket emulation.\n")); p->socket_emu = 0; err = 1; } #endif if (p->nr_floppies < 0 || p->nr_floppies > 4) { - write_log (L"Invalid number of floppies. Using 4.\n"); + write_log (_T("Invalid number of floppies. Using 4.\n")); p->nr_floppies = 4; p->floppyslots[0].dfxtype = 0; p->floppyslots[1].dfxtype = 0; @@ -388,7 +388,7 @@ void fixup_prefs (struct uae_prefs *p) p->input_mouse_speed = 100; } if (p->collision_level < 0 || p->collision_level > 3) { - write_log (L"Invalid collision support level. Using 1.\n"); + write_log (_T("Invalid collision support level. Using 1.\n")); p->collision_level = 1; err = 1; } @@ -527,11 +527,11 @@ static void parse_cmdline_2 (int argc, TCHAR **argv) cfgfile_addcfgparam (0); for (i = 1; i < argc; i++) { - if (_tcsncmp (argv[i], L"-cfgparam=", 10) == 0) { + if (_tcsncmp (argv[i], _T("-cfgparam="), 10) == 0) { cfgfile_addcfgparam (argv[i] + 10); - } else if (_tcscmp (argv[i], L"-cfgparam") == 0) { + } else if (_tcscmp (argv[i], _T("-cfgparam")) == 0) { if (i + 1 == argc) - write_log (L"Missing argument for '-cfgparam' option.\n"); + write_log (_T("Missing argument for '-cfgparam' option.\n")); else cfgfile_addcfgparam (argv[++i]); } @@ -541,7 +541,7 @@ static void parse_cmdline_2 (int argc, TCHAR **argv) static void parse_diskswapper (TCHAR *s) { TCHAR *tmp = my_strdup (s); - TCHAR *delim = L","; + TCHAR *delim = _T(","); TCHAR *p1, *p2; int num = 0; @@ -590,50 +590,50 @@ static void parse_cmdline (int argc, TCHAR **argv) int i; for (i = 1; i < argc; i++) { - if (!_tcsncmp (argv[i], L"-diskswapper=", 13)) { + if (!_tcsncmp (argv[i], _T("-diskswapper="), 13)) { TCHAR *txt = parsetextpath (argv[i] + 13); parse_diskswapper (txt); xfree (txt); - } else if (_tcsncmp (argv[i], L"-cfgparam=", 10) == 0) { + } else if (_tcsncmp (argv[i], _T("-cfgparam="), 10) == 0) { ; - } else if (_tcscmp (argv[i], L"-cfgparam") == 0) { + } else if (_tcscmp (argv[i], _T("-cfgparam")) == 0) { if (i + 1 < argc) i++; - } else if (_tcsncmp (argv[i], L"-config=", 8) == 0) { + } else if (_tcsncmp (argv[i], _T("-config="), 8) == 0) { TCHAR *txt = parsetextpath (argv[i] + 8); currprefs.mountitems = 0; target_cfgfile_load (&currprefs, txt, -1, 0); xfree (txt); - } else if (_tcsncmp (argv[i], L"-statefile=", 11) == 0) { + } else if (_tcsncmp (argv[i], _T("-statefile="), 11) == 0) { TCHAR *txt = parsetextpath (argv[i] + 11); savestate_state = STATE_DORESTORE; _tcscpy (savestate_fname, txt); xfree (txt); - } else if (_tcscmp (argv[i], L"-f") == 0) { + } else if (_tcscmp (argv[i], _T("-f")) == 0) { /* Check for new-style "-f xxx" argument, where xxx is config-file */ if (i + 1 == argc) { - write_log (L"Missing argument for '-f' option.\n"); + write_log (_T("Missing argument for '-f' option.\n")); } else { TCHAR *txt = parsetextpath (argv[++i]); currprefs.mountitems = 0; target_cfgfile_load (&currprefs, txt, -1, 0); xfree (txt); } - } else if (_tcscmp (argv[i], L"-s") == 0) { + } else if (_tcscmp (argv[i], _T("-s")) == 0) { if (i + 1 == argc) - write_log (L"Missing argument for '-s' option.\n"); + write_log (_T("Missing argument for '-s' option.\n")); else cfgfile_parse_line (&currprefs, argv[++i], 0); - } else if (_tcscmp (argv[i], L"-h") == 0 || _tcscmp (argv[i], L"-help") == 0) { + } else if (_tcscmp (argv[i], _T("-h")) == 0 || _tcscmp (argv[i], _T("-help")) == 0) { usage (); exit (0); - } else if (_tcsncmp (argv[i], L"-cdimage=", 9) == 0) { + } else if (_tcsncmp (argv[i], _T("-cdimage="), 9) == 0) { TCHAR *txt = parsetextpath (argv[i] + 9); TCHAR *txt2 = xmalloc(TCHAR, _tcslen(txt) + 2); _tcscpy(txt2, txt); if (_tcsrchr(txt2, ',') != NULL) - _tcscat(txt2, L","); - cfgfile_parse_option (&currprefs, L"cdimage0", txt2, 0); + _tcscat(txt2, _T(",")); + cfgfile_parse_option (&currprefs, _T("cdimage0"), txt2, 0); xfree(txt2); xfree (txt); } else { @@ -653,7 +653,7 @@ static void parse_cmdline (int argc, TCHAR **argv) static void parse_cmdline_and_init_file (int argc, TCHAR **argv) { - _tcscpy (optionsfile, L""); + _tcscpy (optionsfile, _T("")); #ifdef OPTIONS_IN_HOME { @@ -661,7 +661,7 @@ static void parse_cmdline_and_init_file (int argc, TCHAR **argv) if (home != NULL && strlen (home) < 240) { _tcscpy (optionsfile, home); - _tcscat (optionsfile, L"/"); + _tcscat (optionsfile, _T("/")); } } #endif @@ -671,7 +671,7 @@ static void parse_cmdline_and_init_file (int argc, TCHAR **argv) _tcscat (optionsfile, restart_config); if (! target_cfgfile_load (&currprefs, optionsfile, 0, default_config)) { - write_log (L"failed to load config '%s'\n", optionsfile); + write_log (_T("failed to load config '%s'\n"), optionsfile); #ifdef OPTIONS_IN_HOME /* sam: if not found in $HOME then look in current directory */ _tcscpy (optionsfile, restart_config); @@ -864,7 +864,7 @@ static int real_main2 (int argc, TCHAR **argv) } if (! setup_sound ()) { - write_log (L"Sound driver unavailable: Sound output disabled\n"); + write_log (_T("Sound driver unavailable: Sound output disabled\n")); currprefs.produce_sound = 0; } inputdevice_init (); @@ -881,7 +881,7 @@ static int real_main2 (int argc, TCHAR **argv) currprefs = changed_prefs; config_changed = 1; if (err == -1) { - write_log (L"Failed to initialize the GUI\n"); + write_log (_T("Failed to initialize the GUI\n")); return -1; } else if (err == -2) { return 1; @@ -966,7 +966,7 @@ static int real_main2 (int argc, TCHAR **argv) if (!init_audio ()) { if (sound_available && currprefs.produce_sound > 1) { - write_log (L"Sound driver unavailable: Sound output disabled\n"); + write_log (_T("Sound driver unavailable: Sound output disabled\n")); } currprefs.produce_sound = 0; } diff --git a/memory.cpp b/memory.cpp index 03717d6c..de9ae768 100644 --- a/memory.cpp +++ b/memory.cpp @@ -125,7 +125,7 @@ int addr_valid (const TCHAR *txt, uaecptr addr, uae_u32 len) { addrbank *ab = &get_mem_bank(addr); if (ab == 0 || !(ab->flags & (ABFLAG_RAM | ABFLAG_ROM)) || addr < 0x100 || len < 0 || len > 16777215 || !valid_address (addr, len)) { - write_log (L"corrupt %s pointer %x (%d) detected!\n", txt, addr, len); + write_log (_T("corrupt %s pointer %x (%d) detected!\n"), txt, addr, len); return 0; } return 1; @@ -170,13 +170,13 @@ static void dummylog (int rw, uaecptr addr, int size, uae_u32 val, int ins) if (MAX_ILG >= 0) illegal_count++; if (ins) { - write_log (L"WARNING: Illegal opcode %cget at %08lx PC=%x\n", + write_log (_T("WARNING: Illegal opcode %cget at %08lx PC=%x\n"), size == 2 ? 'w' : 'l', addr, M68K_GETPC); } else if (rw) { - write_log (L"Illegal %cput at %08lx=%08lx PC=%x\n", + write_log (_T("Illegal %cput at %08lx=%08lx PC=%x\n"), size == 1 ? 'b' : size == 2 ? 'w' : 'l', addr, val, M68K_GETPC); } else { - write_log (L"Illegal %cget at %08lx PC=%x\n", + write_log (_T("Illegal %cget at %08lx PC=%x\n"), size == 1 ? 'b' : size == 2 ? 'w' : 'l', addr, M68K_GETPC); } } @@ -196,7 +196,7 @@ static uae_u32 dummy_get (uaecptr addr, int size) } #if 0 if (addr >= 0x10000000) - write_log (L"%08X %d = %08x\n", addr, size, v); + write_log (_T("%08X %d = %08x\n"), addr, size, v); #endif return v; } @@ -971,7 +971,7 @@ static void REGPARAM2 kickmem_lput (uaecptr addr, uae_u32 b) } else a1000_handle_kickstart (0); } else if (currprefs.illegal_mem) - write_log (L"Illegal kickmem lput at %08lx\n", addr); + write_log (_T("Illegal kickmem lput at %08lx\n"), addr); } static void REGPARAM2 kickmem_wput (uaecptr addr, uae_u32 b) @@ -989,7 +989,7 @@ static void REGPARAM2 kickmem_wput (uaecptr addr, uae_u32 b) } else a1000_handle_kickstart (0); } else if (currprefs.illegal_mem) - write_log (L"Illegal kickmem wput at %08lx\n", addr); + write_log (_T("Illegal kickmem wput at %08lx\n"), addr); } static void REGPARAM2 kickmem_bput (uaecptr addr, uae_u32 b) @@ -1005,7 +1005,7 @@ static void REGPARAM2 kickmem_bput (uaecptr addr, uae_u32 b) } else a1000_handle_kickstart (0); } else if (currprefs.illegal_mem) - write_log (L"Illegal kickmem bput at %08lx\n", addr); + write_log (_T("Illegal kickmem bput at %08lx\n"), addr); } static void REGPARAM2 kickmem2_lput (uaecptr addr, uae_u32 l) @@ -1099,7 +1099,7 @@ static void REGPARAM2 extendedkickmem_lput (uaecptr addr, uae_u32 b) special_mem |= S_WRITE; #endif if (currprefs.illegal_mem) - write_log (L"Illegal extendedkickmem lput at %08lx\n", addr); + write_log (_T("Illegal extendedkickmem lput at %08lx\n"), addr); } static void REGPARAM2 extendedkickmem_wput (uaecptr addr, uae_u32 b) { @@ -1107,7 +1107,7 @@ static void REGPARAM2 extendedkickmem_wput (uaecptr addr, uae_u32 b) special_mem |= S_WRITE; #endif if (currprefs.illegal_mem) - write_log (L"Illegal extendedkickmem wput at %08lx\n", addr); + write_log (_T("Illegal extendedkickmem wput at %08lx\n"), addr); } static void REGPARAM2 extendedkickmem_bput (uaecptr addr, uae_u32 b) { @@ -1115,7 +1115,7 @@ static void REGPARAM2 extendedkickmem_bput (uaecptr addr, uae_u32 b) special_mem |= S_WRITE; #endif if (currprefs.illegal_mem) - write_log (L"Illegal extendedkickmem lput at %08lx\n", addr); + write_log (_T("Illegal extendedkickmem lput at %08lx\n"), addr); } static int REGPARAM2 extendedkickmem_check (uaecptr addr, uae_u32 size) { @@ -1166,7 +1166,7 @@ static void REGPARAM2 extendedkickmem2_lput (uaecptr addr, uae_u32 b) special_mem |= S_WRITE; #endif if (currprefs.illegal_mem) - write_log (L"Illegal extendedkickmem2 lput at %08lx\n", addr); + write_log (_T("Illegal extendedkickmem2 lput at %08lx\n"), addr); } static void REGPARAM2 extendedkickmem2_wput (uaecptr addr, uae_u32 b) { @@ -1174,7 +1174,7 @@ static void REGPARAM2 extendedkickmem2_wput (uaecptr addr, uae_u32 b) special_mem |= S_WRITE; #endif if (currprefs.illegal_mem) - write_log (L"Illegal extendedkickmem2 wput at %08lx\n", addr); + write_log (_T("Illegal extendedkickmem2 wput at %08lx\n"), addr); } static void REGPARAM2 extendedkickmem2_bput (uaecptr addr, uae_u32 b) { @@ -1182,7 +1182,7 @@ static void REGPARAM2 extendedkickmem2_bput (uaecptr addr, uae_u32 b) special_mem |= S_WRITE; #endif if (currprefs.illegal_mem) - write_log (L"Illegal extendedkickmem2 lput at %08lx\n", addr); + write_log (_T("Illegal extendedkickmem2 lput at %08lx\n"), addr); } static int REGPARAM2 extendedkickmem2_check (uaecptr addr, uae_u32 size) { @@ -1220,18 +1220,18 @@ uae_u8 *REGPARAM2 default_xlate (uaecptr a) int i, j; uaecptr a2 = a - 32; uaecptr a3 = m68k_getpc () - 32; - write_log (L"Your Amiga program just did something terribly stupid %08X PC=%08X\n", a, M68K_GETPC); + write_log (_T("Your Amiga program just did something terribly stupid %08X PC=%08X\n"), a, M68K_GETPC); #if DEBUG_STUPID activate_debugger(); #endif m68k_dumpstate (0, 0); for (i = 0; i < 10; i++) { - write_log (L"%08X ", i >= 5 ? a3 : a2); + write_log (_T("%08X "), i >= 5 ? a3 : a2); for (j = 0; j < 16; j += 2) { - write_log (L" %04X", get_word (i >= 5 ? a3 : a2)); + write_log (_T(" %04X"), get_word (i >= 5 ? a3 : a2)); if (i >= 5) a3 += 2; else a2 += 2; } - write_log (L"\n"); + write_log (_T("\n")); } memory_map_dump (); } @@ -1262,21 +1262,21 @@ addrbank dummy_bank = { addrbank ones_bank = { ones_get, ones_get, ones_get, none_put, none_put, none_put, - default_xlate, dummy_check, NULL, L"Ones", + default_xlate, dummy_check, NULL, _T("Ones"), dummy_lgeti, dummy_wgeti, ABFLAG_NONE }; addrbank chipmem_bank = { chipmem_lget, chipmem_wget, chipmem_bget, chipmem_lput, chipmem_wput, chipmem_bput, - chipmem_xlate, chipmem_check, NULL, L"Chip memory", + chipmem_xlate, chipmem_check, NULL, _T("Chip memory"), chipmem_lget, chipmem_wget, ABFLAG_RAM }; addrbank chipmem_dummy_bank = { chipmem_dummy_lget, chipmem_dummy_wget, chipmem_dummy_bget, chipmem_dummy_lput, chipmem_dummy_wput, chipmem_dummy_bput, - default_xlate, dummy_check, NULL, L"Dummy Chip memory", + default_xlate, dummy_check, NULL, _T("Dummy Chip memory"), dummy_lgeti, dummy_wgeti, ABFLAG_IO }; @@ -1285,7 +1285,7 @@ addrbank chipmem_dummy_bank = { addrbank chipmem_bank_ce2 = { chipmem_lget_ce2, chipmem_wget_ce2, chipmem_bget_ce2, chipmem_lput_ce2, chipmem_wput_ce2, chipmem_bput_ce2, - chipmem_xlate, chipmem_check, NULL, L"Chip memory (68020 'ce')", + chipmem_xlate, chipmem_check, NULL, _T("Chip memory (68020 'ce')"), chipmem_lget_ce2, chipmem_wget_ce2, ABFLAG_RAM }; #endif @@ -1293,55 +1293,55 @@ addrbank chipmem_bank_ce2 = { addrbank bogomem_bank = { bogomem_lget, bogomem_wget, bogomem_bget, bogomem_lput, bogomem_wput, bogomem_bput, - bogomem_xlate, bogomem_check, NULL, L"Slow memory", + bogomem_xlate, bogomem_check, NULL, _T("Slow memory"), bogomem_lget, bogomem_wget, ABFLAG_RAM }; addrbank cardmem_bank = { cardmem_lget, cardmem_wget, cardmem_bget, cardmem_lput, cardmem_wput, cardmem_bput, - cardmem_xlate, cardmem_check, NULL, L"CDTV memory card", + cardmem_xlate, cardmem_check, NULL, _T("CDTV memory card"), cardmem_lget, cardmem_wget, ABFLAG_RAM }; addrbank a3000lmem_bank = { a3000lmem_lget, a3000lmem_wget, a3000lmem_bget, a3000lmem_lput, a3000lmem_wput, a3000lmem_bput, - a3000lmem_xlate, a3000lmem_check, NULL, L"RAMSEY memory (low)", + a3000lmem_xlate, a3000lmem_check, NULL, _T("RAMSEY memory (low)"), a3000lmem_lget, a3000lmem_wget, ABFLAG_RAM }; addrbank a3000hmem_bank = { a3000hmem_lget, a3000hmem_wget, a3000hmem_bget, a3000hmem_lput, a3000hmem_wput, a3000hmem_bput, - a3000hmem_xlate, a3000hmem_check, NULL, L"RAMSEY memory (high)", + a3000hmem_xlate, a3000hmem_check, NULL, _T("RAMSEY memory (high)"), a3000hmem_lget, a3000hmem_wget, ABFLAG_RAM }; addrbank kickmem_bank = { kickmem_lget, kickmem_wget, kickmem_bget, kickmem_lput, kickmem_wput, kickmem_bput, - kickmem_xlate, kickmem_check, NULL, L"Kickstart ROM", + kickmem_xlate, kickmem_check, NULL, _T("Kickstart ROM"), kickmem_lget, kickmem_wget, ABFLAG_ROM }; addrbank kickram_bank = { kickmem_lget, kickmem_wget, kickmem_bget, kickmem2_lput, kickmem2_wput, kickmem2_bput, - kickmem_xlate, kickmem_check, NULL, L"Kickstart Shadow RAM", + kickmem_xlate, kickmem_check, NULL, _T("Kickstart Shadow RAM"), kickmem_lget, kickmem_wget, ABFLAG_UNK | ABFLAG_SAFE }; addrbank extendedkickmem_bank = { extendedkickmem_lget, extendedkickmem_wget, extendedkickmem_bget, extendedkickmem_lput, extendedkickmem_wput, extendedkickmem_bput, - extendedkickmem_xlate, extendedkickmem_check, NULL, L"Extended Kickstart ROM", + extendedkickmem_xlate, extendedkickmem_check, NULL, _T("Extended Kickstart ROM"), extendedkickmem_lget, extendedkickmem_wget, ABFLAG_ROM }; addrbank extendedkickmem2_bank = { extendedkickmem2_lget, extendedkickmem2_wget, extendedkickmem2_bget, extendedkickmem2_lput, extendedkickmem2_wput, extendedkickmem2_bput, - extendedkickmem2_xlate, extendedkickmem2_check, NULL, L"Extended 2nd Kickstart ROM", + extendedkickmem2_xlate, extendedkickmem2_check, NULL, _T("Extended 2nd Kickstart ROM"), extendedkickmem2_lget, extendedkickmem2_wget, ABFLAG_ROM }; @@ -1485,13 +1485,13 @@ static uae_u8 *REGPARAM2 custmem2_xlate (uaecptr addr) addrbank custmem1_bank = { custmem1_lget, custmem1_wget, custmem1_bget, custmem1_lput, custmem1_wput, custmem1_bput, - custmem1_xlate, custmem1_check, NULL, L"Non-autoconfig RAM #1", + custmem1_xlate, custmem1_check, NULL, _T("Non-autoconfig RAM #1"), custmem1_lget, custmem1_wget, ABFLAG_RAM }; addrbank custmem2_bank = { custmem1_lget, custmem1_wget, custmem1_bget, custmem1_lput, custmem1_wput, custmem1_bput, - custmem1_xlate, custmem1_check, NULL, L"Non-autoconfig RAM #2", + custmem1_xlate, custmem1_check, NULL, _T("Non-autoconfig RAM #2"), custmem1_lget, custmem1_wget, ABFLAG_RAM }; @@ -1512,7 +1512,7 @@ void a3000_fakekick (int map) memcpy (kickmemory + fkickmem_size / 2, fkickmemory, fkickmem_size / 2); extendedkickmem_size = 65536; extendedkickmem_mask = extendedkickmem_size - 1; - extendedkickmemory = mapped_malloc (extendedkickmem_size, L"rom_f0"); + extendedkickmemory = mapped_malloc (extendedkickmem_size, _T("rom_f0")); extendedkickmem_bank.baseaddr = extendedkickmemory; memcpy (extendedkickmemory, fkickmemory + fkickmem_size / 2, 65536); map_banks (&extendedkickmem_bank, 0xf0, 1, 1); @@ -1661,11 +1661,11 @@ static bool load_extendedkickstart (const TCHAR *romextfile, int type) zfile_fseek (f, off, SEEK_SET); switch (extendedkickmem_type) { case EXTENDED_ROM_CDTV: - extendedkickmemory = mapped_malloc (extendedkickmem_size, L"rom_f0"); + extendedkickmemory = mapped_malloc (extendedkickmem_size, _T("rom_f0")); extendedkickmem_bank.baseaddr = extendedkickmemory; break; case EXTENDED_ROM_CD32: - extendedkickmemory = mapped_malloc (extendedkickmem_size, L"rom_e0"); + extendedkickmemory = mapped_malloc (extendedkickmem_size, _T("rom_e0")); extendedkickmem_bank.baseaddr = extendedkickmemory; break; } @@ -1695,7 +1695,7 @@ static int patch_shapeshifter (uae_u8 *kickmemory) !memcmp (kickmemory + i, kickshift2, sizeof (kickshift2)) || !memcmp (kickmemory + i, kickshift3, sizeof (kickshift3))) { kickmemory[i + 2] = 0x30; - write_log (L"Kickstart KickShifted @%04X\n", i); + write_log (_T("Kickstart KickShifted @%04X\n"), i); patched++; } } @@ -1724,7 +1724,7 @@ static int patch_residents (uae_u8 *kickmemory, int size) while (residents[j]) { if (!memcmp (residents[j], kickmemory + addr - base, strlen (residents[j]) + 1)) { TCHAR *s = au (residents[j]); - write_log (L"KSPatcher: '%s' at %08X disabled\n", s, i + base); + write_log (_T("KSPatcher: '%s' at %08X disabled\n"), s, i + base); xfree (s); kickmemory[i] = 0x4b; /* destroy RTC_MATCHWORD */ patched++; @@ -1760,7 +1760,7 @@ static bool load_kickstart_replacement (void) { struct zfile *f; - f = zfile_fopen_data (L"aros.gz", arosrom_len, arosrom); + f = zfile_fopen_data (_T("aros.gz"), arosrom_len, arosrom); if (!f) return false; f = zfile_gunzip (f); @@ -1770,7 +1770,7 @@ static bool load_kickstart_replacement (void) kickmem_size = 0x80000; extendedkickmem_size = 0x80000; extendedkickmem_type = EXTENDED_ROM_KS; - extendedkickmemory = mapped_malloc (extendedkickmem_size, L"rom_e0"); + extendedkickmemory = mapped_malloc (extendedkickmem_size, _T("rom_e0")); extendedkickmem_bank.baseaddr = extendedkickmemory; read_kickstart (f, extendedkickmemory, extendedkickmem_size, 0, 1); extendedkickmem_mask = extendedkickmem_size - 1; @@ -1787,25 +1787,25 @@ static int load_kickstart (void) int patched = 0; cloanto_rom = 0; - if (!_tcscmp (currprefs.romfile, L":AROS")) + if (!_tcscmp (currprefs.romfile, _T(":AROS"))) return load_kickstart_replacement (); f = read_rom_name (currprefs.romfile); _tcscpy (tmprom, currprefs.romfile); if (f == NULL) { - _stprintf (tmprom2, L"%s%s", start_path_data, currprefs.romfile); - f = rom_fopen (tmprom2, L"rb", ZFD_NORMAL); + _stprintf (tmprom2, _T("%s%s"), start_path_data, currprefs.romfile); + f = rom_fopen (tmprom2, _T("rb"), ZFD_NORMAL); if (f == NULL) { - _stprintf (currprefs.romfile, L"%sroms/kick.rom", start_path_data); - f = rom_fopen (currprefs.romfile, L"rb", ZFD_NORMAL); + _stprintf (currprefs.romfile, _T("%sroms/kick.rom"), start_path_data); + f = rom_fopen (currprefs.romfile, _T("rb"), ZFD_NORMAL); if (f == NULL) { - _stprintf (currprefs.romfile, L"%skick.rom", start_path_data); - f = rom_fopen (currprefs.romfile, L"rb", ZFD_NORMAL); + _stprintf (currprefs.romfile, _T("%skick.rom"), start_path_data); + f = rom_fopen (currprefs.romfile, _T("rb"), ZFD_NORMAL); if (f == NULL) { - _stprintf (currprefs.romfile, L"%s../shared/rom/kick.rom", start_path_data); - f = rom_fopen (currprefs.romfile, L"rb", ZFD_NORMAL); + _stprintf (currprefs.romfile, _T("%s../shared/rom/kick.rom"), start_path_data); + f = rom_fopen (currprefs.romfile, _T("rb"), ZFD_NORMAL); if (f == NULL) { - _stprintf (currprefs.romfile, L"%s../System/rom/kick.rom", start_path_data); - f = rom_fopen (currprefs.romfile, L"rb", ZFD_NORMAL); + _stprintf (currprefs.romfile, _T("%s../System/rom/kick.rom"), start_path_data); + f = rom_fopen (currprefs.romfile, _T("rb"), ZFD_NORMAL); if (f == NULL) f = read_rom_name_guess (tmprom); } @@ -1855,10 +1855,10 @@ static int load_kickstart (void) if (currprefs.cs_cdtvcd || currprefs.cs_cdtvram) { extendedkickmem_type = EXTENDED_ROM_CDTV; extendedkickmem_size *= 2; - extendedkickmemory = mapped_malloc (extendedkickmem_size, L"rom_f0"); + extendedkickmemory = mapped_malloc (extendedkickmem_size, _T("rom_f0")); } else { extendedkickmem_type = EXTENDED_ROM_KS; - extendedkickmemory = mapped_malloc (extendedkickmem_size, L"rom_e0"); + extendedkickmemory = mapped_malloc (extendedkickmem_size, _T("rom_e0")); } extendedkickmem_bank.baseaddr = extendedkickmemory; zfile_fseek (f, extpos, SEEK_SET); @@ -1867,7 +1867,7 @@ static int load_kickstart (void) } if (filesize > 524288 * 2) { extendedkickmem2_size = 524288 * 2; - extendedkickmemory2 = mapped_malloc (extendedkickmem2_size, L"rom_a8"); + extendedkickmemory2 = mapped_malloc (extendedkickmem2_size, _T("rom_a8")); extendedkickmem2_bank.baseaddr = extendedkickmemory2; zfile_fseek (f, extpos + 524288, SEEK_SET); read_kickstart (f, extendedkickmemory2, 524288, 0, 1); @@ -1916,13 +1916,13 @@ shmpiece *shm_start; static void dumplist (void) { shmpiece *x = shm_start; - write_log (L"Start Dump:\n"); + write_log (_T("Start Dump:\n")); while (x) { - write_log (L"this=%p,Native %p,id %d,prev=%p,next=%p,size=0x%08x\n", + write_log (_T("this=%p,Native %p,id %d,prev=%p,next=%p,size=0x%08x\n"), x, x->native_address, x->id, x->prev, x->next, x->size); x = x->next; } - write_log (L"End Dump:\n"); + write_log (_T("End Dump:\n")); } static shmpiece *find_shmpiece (uae_u8 *base) @@ -1932,7 +1932,7 @@ static shmpiece *find_shmpiece (uae_u8 *base) while (x && x->native_address != base) x = x->next; if (!x) { - write_log (L"NATMEM: Failure to find mapping at %08X, %p\n", base - NATMEM_OFFSET, base); + write_log (_T("NATMEM: Failure to find mapping at %08X, %p\n"), base - NATMEM_OFFSET, base); nocanbang (); return 0; } @@ -1956,7 +1956,7 @@ static void delete_shmmaps (uae_u32 start, uae_u32 size) if (x->size > size) { if (isdirectjit ()) - write_log (L"NATMEM WARNING: size mismatch mapping at %08x (size %08x, delsize %08x)\n",start,x->size,size); + write_log (_T("NATMEM WARNING: size mismatch mapping at %08x (size %08x, delsize %08x)\n"),start,x->size,size); size = x->size; } #if 0 @@ -2001,7 +2001,7 @@ static void add_shmmaps (uae_u32 start, addrbank *what) base = ((uae_u8 *) NATMEM_OFFSET) + start; y->native_address = (uae_u8*)shmat (y->id, base, 0); if (y->native_address == (void *) -1) { - write_log (L"NATMEM: Failure to map existing at %08x (%p)\n", start, base); + write_log (_T("NATMEM: Failure to map existing at %08x (%p)\n"), start, base); dumplist (); nocanbang (); return; @@ -2091,11 +2091,11 @@ static void allocate_memory (void) chipmem_mask = allocated_chipmem - 1; chipmem_full_mask = allocated_chipmem * 2 - 1; chipmem_full_size = 0x80000 * 2; - chipmemory = mapped_malloc (memsize1 + memsize2, L"chip"); + chipmemory = mapped_malloc (memsize1 + memsize2, _T("chip")); bogomemory = chipmemory + memsize1; bogomem_mask = allocated_bogomem - 1; if (chipmemory == 0) { - write_log (L"Fatal error: out of memory for chipmem.\n"); + write_log (_T("Fatal error: out of memory for chipmem.\n")); allocated_chipmem = 0; } else { need_hardreset = 1; @@ -2116,9 +2116,9 @@ static void allocate_memory (void) memsize = 0x100000; if (memsize > 0x100000 && memsize < 0x200000) memsize = 0x200000; - chipmemory = mapped_malloc (memsize, L"chip"); + chipmemory = mapped_malloc (memsize, _T("chip")); if (chipmemory == 0) { - write_log (L"Fatal error: out of memory for chipmem.\n"); + write_log (_T("Fatal error: out of memory for chipmem.\n")); allocated_chipmem = 0; } else { need_hardreset = 1; @@ -2147,9 +2147,9 @@ static void allocate_memory (void) bogomem_mask = allocated_bogomem - 1; if (allocated_bogomem) { - bogomemory = mapped_malloc (allocated_bogomem, L"bogo"); + bogomemory = mapped_malloc (allocated_bogomem, _T("bogo")); if (bogomemory == 0) { - write_log (L"Out of memory for bogomem.\n"); + write_log (_T("Out of memory for bogomem.\n")); allocated_bogomem = 0; } } @@ -2164,9 +2164,9 @@ static void allocate_memory (void) a3000lmem_mask = allocated_a3000lmem - 1; a3000lmem_start = 0x08000000 - allocated_a3000lmem; if (allocated_a3000lmem) { - a3000lmemory = mapped_malloc (allocated_a3000lmem, L"ramsey_low"); + a3000lmemory = mapped_malloc (allocated_a3000lmem, _T("ramsey_low")); if (a3000lmemory == 0) { - write_log (L"Out of memory for a3000lowmem.\n"); + write_log (_T("Out of memory for a3000lowmem.\n")); allocated_a3000lmem = 0; } } @@ -2181,9 +2181,9 @@ static void allocate_memory (void) a3000hmem_mask = allocated_a3000hmem - 1; a3000hmem_start = 0x08000000; if (allocated_a3000hmem) { - a3000hmemory = mapped_malloc (allocated_a3000hmem, L"ramsey_high"); + a3000hmemory = mapped_malloc (allocated_a3000hmem, _T("ramsey_high")); if (a3000hmemory == 0) { - write_log (L"Out of memory for a3000highmem.\n"); + write_log (_T("Out of memory for a3000highmem.\n")); allocated_a3000hmem = 0; } } @@ -2197,9 +2197,9 @@ static void allocate_memory (void) allocated_cardmem = currprefs.cs_cdtvcard * 1024; cardmem_mask = allocated_cardmem - 1; if (allocated_cardmem) { - cardmemory = mapped_malloc (allocated_cardmem, L"rom_e0"); + cardmemory = mapped_malloc (allocated_cardmem, _T("rom_e0")); if (cardmemory == 0) { - write_log (L"Out of memory for cardmem.\n"); + write_log (_T("Out of memory for cardmem.\n")); allocated_cardmem = 0; } } @@ -2212,7 +2212,7 @@ static void allocate_memory (void) allocated_custmem1 = currprefs.custom_memory_sizes[0]; custmem1_mask = allocated_custmem1 - 1; if (allocated_custmem1) { - custmem1 = mapped_malloc (allocated_custmem1, L"custmem1"); + custmem1 = mapped_malloc (allocated_custmem1, _T("custmem1")); if (!custmem1) allocated_custmem1 = 0; } @@ -2224,7 +2224,7 @@ static void allocate_memory (void) allocated_custmem2 = currprefs.custom_memory_sizes[1]; custmem2_mask = allocated_custmem2 - 1; if (allocated_custmem2) { - custmem2 = mapped_malloc (allocated_custmem2, L"custmem2"); + custmem2 = mapped_malloc (allocated_custmem2, _T("custmem2")); if (!custmem2) allocated_custmem2 = 0; } @@ -2413,7 +2413,7 @@ void memory_reset (void) if (_tcscmp (currprefs.romfile, changed_prefs.romfile) != 0 || _tcscmp (currprefs.romextfile, changed_prefs.romextfile) != 0) { - write_log (L"ROM loader.. (%s)\n", currprefs.romfile); + write_log (_T("ROM loader.. (%s)\n"), currprefs.romfile); kickstart_rom = 1; a1000_handle_kickstart (0); xfree (a1000_bootrom); @@ -2434,14 +2434,14 @@ void memory_reset (void) kickmem_mask = 524288 - 1; if (!load_kickstart ()) { if (_tcslen (currprefs.romfile) > 0) { - write_log (L"Failed to open '%s'\n", currprefs.romfile); + write_log (_T("Failed to open '%s'\n"), currprefs.romfile); notify_user (NUMSG_NOROM); } load_kickstart_replacement (); } else { struct romdata *rd = getromdatabydata (kickmemory, kickmem_size); if (rd) { - write_log (L"Known ROM '%s' loaded\n", rd->name); + write_log (_T("Known ROM '%s' loaded\n"), rd->name); if ((rd->cpu & 3) == 3 && changed_prefs.cpu_model != 68030) { notify_user (NUMSG_KS68030); uae_restart (-1, NULL); @@ -2466,11 +2466,11 @@ void memory_reset (void) changed_prefs.cs_ide = currprefs.cs_ide = -1; } } else { - write_log (L"Unknown ROM '%s' loaded\n", currprefs.romfile); + write_log (_T("Unknown ROM '%s' loaded\n"), currprefs.romfile); } } patch_kick (); - write_log (L"ROM loader end\n"); + write_log (_T("ROM loader end\n")); } if (cloanto_rom && currprefs.maprom < 0x01000000) @@ -2637,7 +2637,7 @@ void memory_reset (void) } #endif #endif - write_log (L"memory init end\n"); + write_log (_T("memory init end\n")); } void memory_init (void) @@ -2660,10 +2660,10 @@ void memory_init (void) init_mem_banks (); - kickmemory = mapped_malloc (0x80000, L"kick"); + kickmemory = mapped_malloc (0x80000, _T("kick")); memset (kickmemory, 0, 0x80000); kickmem_bank.baseaddr = kickmemory; - _tcscpy (currprefs.romfile, L""); + _tcscpy (currprefs.romfile, _T("")); currprefs.romextfile[0] = 0; #ifdef ACTION_REPLAY @@ -2738,7 +2738,7 @@ void map_banks (addrbank *bank, int start, int size, int realsize) addrbank *orgbank = bank; uae_u32 realstart = start; - //write_log (L"MAP_BANK %04X0000 %d %s\n", start, size, bank->name); + //write_log (_T("MAP_BANK %04X0000 %d %s\n"), start, size, bank->name); old = debug_bankchange (-1); flush_icache (0, 3); /* Sure don't want to keep any old mappings around! */ @@ -2750,7 +2750,7 @@ void map_banks (addrbank *bank, int start, int size, int realsize) realsize = size << 16; if ((size << 16) < realsize) { - write_log (L"Broken mapping, size=%x, realsize=%x\nStart is %x\n", + write_log (_T("Broken mapping, size=%x, realsize=%x\nStart is %x\n"), size, realsize, start); } @@ -2886,10 +2886,10 @@ uae_u8 *restore_rom (uae_u8 *src) _tcsncpy (changed_prefs.romextfile, rl[i].path, 255); break; } - write_log (L"ROM '%s' = '%s'\n", romn, rl[i].path); + write_log (_T("ROM '%s' = '%s'\n"), romn, rl[i].path); crcdet = 1; } else { - write_log (L"ROM '%s' = '%s' invalid rom scanner path!", romn, rl[i].path); + write_log (_T("ROM '%s' = '%s' invalid rom scanner path!"), romn, rl[i].path); } break; } @@ -2906,13 +2906,13 @@ uae_u8 *restore_rom (uae_u8 *src) _tcsncpy (changed_prefs.romextfile, s, 255); break; } - write_log (L"ROM detected (path) as '%s'\n", s); + write_log (_T("ROM detected (path) as '%s'\n"), s); crcdet = 1; } } xfree (s); if (!crcdet) - write_log (L"WARNING: ROM '%s' not found!\n", romn); + write_log (_T("WARNING: ROM '%s' not found!\n"), romn); xfree (romn); return src; } @@ -2951,7 +2951,7 @@ uae_u8 *save_rom (int first, int *len, uae_u8 *dstptr) mem_start += 262144; } version = longget (mem_start + 12); /* version+revision */ - _stprintf (tmpname, L"Kickstart %d.%d", wordget (mem_start + 12), wordget (mem_start + 14)); + _stprintf (tmpname, _T("Kickstart %d.%d"), wordget (mem_start + 12), wordget (mem_start + 14)); break; case 1: /* Extended ROM */ if (!extendedkickmem_type) @@ -2960,7 +2960,7 @@ uae_u8 *save_rom (int first, int *len, uae_u8 *dstptr) mem_real_start = extendedkickmemory; mem_size = extendedkickmem_size; path = currprefs.romextfile; - _stprintf (tmpname, L"Extended"); + _stprintf (tmpname, _T("Extended")); break; default: return 0; @@ -2994,7 +2994,7 @@ uae_u8 *save_rom (int first, int *len, uae_u8 *dstptr) void memcpyha_safe (uaecptr dst, const uae_u8 *src, int size) { - if (!addr_valid (L"memcpyha", dst, size)) + if (!addr_valid (_T("memcpyha"), dst, size)) return; while (size--) put_byte (dst++, *src++); @@ -3006,7 +3006,7 @@ void memcpyha (uaecptr dst, const uae_u8 *src, int size) } void memcpyah_safe (uae_u8 *dst, uaecptr src, int size) { - if (!addr_valid (L"memcpyah", src, size)) + if (!addr_valid (_T("memcpyah"), src, size)) return; while (size--) *dst++ = get_byte (src++); @@ -3021,7 +3021,7 @@ uae_char *strcpyah_safe (uae_char *dst, uaecptr src, int maxsize) uae_char *res = dst; uae_u8 b; do { - if (!addr_valid (L"_tcscpyah", src, 1)) + if (!addr_valid (_T("_tcscpyah"), src, 1)) return res; b = get_byte (src++); *dst++ = b; @@ -3038,7 +3038,7 @@ uaecptr strcpyha_safe (uaecptr dst, const uae_char *src) uaecptr res = dst; uae_u8 b; do { - if (!addr_valid (L"_tcscpyha", dst, 1)) + if (!addr_valid (_T("_tcscpyha"), dst, 1)) return res; b = *src++; put_byte (dst++, b); diff --git a/moduleripper.cpp b/moduleripper.cpp index 6a7817ef..8406564b 100644 --- a/moduleripper.cpp +++ b/moduleripper.cpp @@ -72,7 +72,7 @@ void moduleripper (void) prowizard_search (buf, size); #ifdef _WIN32 } __except(ExceptionFilter (GetExceptionInformation (), GetExceptionCode ())) { - write_log (L"prowizard scan crashed\n"); + write_log (_T("prowizard scan crashed\n")); } #endif if (!got) @@ -95,7 +95,7 @@ FILE *moduleripper_fopen (const char *aname, const char *amode) fetch_ripperpath (tmp, sizeof tmp); name = au (aname); mode = au (amode); - _stprintf (tmp2, L"%s%s", tmp, name); + _stprintf (tmp2, _T("%s%s"), tmp, name); f = _tfopen (tmp2, mode); xfree (mode); xfree (name); diff --git a/ncr_scsi.cpp b/ncr_scsi.cpp index 14801097..91ffb06f 100644 --- a/ncr_scsi.cpp +++ b/ncr_scsi.cpp @@ -21,7 +21,7 @@ #include "ncr_scsi.h" #include "zfile.h" -#define NCRNAME L"NCR53C710" +#define NCRNAME _T("NCR53C710") #define NCR_REGS 0x40 #define ROM_VECTOR 0x0200 @@ -44,70 +44,70 @@ struct ncrscsi { static struct ncrscsi regsinfo[] = { - L"SCNTL0", 0, 3, - L"SCNTL1", 1, 2, - L"SDID", 2, 1, - L"SIEN", 3, 0, - L"SCID", 4, 7, - L"SXFER", 5, 6, - L"SODL", 6, 5, - L"SOCL", 7, 4, - L"SFBR", 8, 11, - L"SIDL", 9, 10, - L"SBDL", 10, -1, - L"SBCL", 11, 8, - L"DSTAT", 12, 15, - L"SSTAT0", 13, 14, - L"SSTAT1", 14, 13, - L"SSTAT2", 15, 12, - L"DSA0", 16, 19, - L"DSA1", 17, 18, - L"DSA2", 18, 17, - L"DSA3", 19, 16, - L"CTEST0", 20, 23, - L"CTEST1", 21, 22, - L"CTEST2", 22, 21, - L"CTEST3", 23, 20, - L"CTEST4", 24, 27, - L"CTEST5", 25, 26, - L"CTEST6", 26, 25, - L"CTEST7", 27, 24, - L"TEMP0", 28, 31, - L"TEMP1", 29, 30, - L"TEMP2", 30, 29, - L"TEMP3", 31, 28, - L"DFIFO", 32, 35, - L"ISTAT", 33, 34, - L"CTEST8", 34, 33, - L"LCRC", 35, 32, - L"DBC0", 36, 39, - L"DBC1", 37, 38, - L"DBC2", 38, 37, - L"DCMD", 39, 36, - L"DNAD0", 40, 43, - L"DNAD1", 41, 42, - L"DNAD2", 42, 41, - L"DNAD3", 43, 40, - L"DSP0", 44, 47, - L"DSP1", 45, 46, - L"DSP2", 46, 45, - L"DSP3", 47, 44, - L"DSPS0", 48, 51, - L"DSPS1", 49, 50, - L"DSPS2", 50, 49, - L"DSPS3", 51, 48, - L"SCRATCH0", 52, 55, - L"SCRATCH1", 53, 54, - L"SCRATCH2", 54, 53, - L"SCRATCH3", 55, 52, - L"DMODE", 56, 59, - L"DIEN", 57, 58, - L"DWT", 58, 57, - L"DCNTL", 59, 56, - L"ADDER0", 60, 63, - L"ADDER1", 61, 62, - L"ADDER2", 62, 61, - L"ADDER3", 63, 60, + _T("SCNTL0"), 0, 3, + _T("SCNTL1"), 1, 2, + _T("SDID"), 2, 1, + _T("SIEN"), 3, 0, + _T("SCID"), 4, 7, + _T("SXFER"), 5, 6, + _T("SODL"), 6, 5, + _T("SOCL"), 7, 4, + _T("SFBR"), 8, 11, + _T("SIDL"), 9, 10, + _T("SBDL"), 10, -1, + _T("SBCL"), 11, 8, + _T("DSTAT"), 12, 15, + _T("SSTAT0"), 13, 14, + _T("SSTAT1"), 14, 13, + _T("SSTAT2"), 15, 12, + _T("DSA0"), 16, 19, + _T("DSA1"), 17, 18, + _T("DSA2"), 18, 17, + _T("DSA3"), 19, 16, + _T("CTEST0"), 20, 23, + _T("CTEST1"), 21, 22, + _T("CTEST2"), 22, 21, + _T("CTEST3"), 23, 20, + _T("CTEST4"), 24, 27, + _T("CTEST5"), 25, 26, + _T("CTEST6"), 26, 25, + _T("CTEST7"), 27, 24, + _T("TEMP0"), 28, 31, + _T("TEMP1"), 29, 30, + _T("TEMP2"), 30, 29, + _T("TEMP3"), 31, 28, + _T("DFIFO"), 32, 35, + _T("ISTAT"), 33, 34, + _T("CTEST8"), 34, 33, + _T("LCRC"), 35, 32, + _T("DBC0"), 36, 39, + _T("DBC1"), 37, 38, + _T("DBC2"), 38, 37, + _T("DCMD"), 39, 36, + _T("DNAD0"), 40, 43, + _T("DNAD1"), 41, 42, + _T("DNAD2"), 42, 41, + _T("DNAD3"), 43, 40, + _T("DSP0"), 44, 47, + _T("DSP1"), 45, 46, + _T("DSP2"), 46, 45, + _T("DSP3"), 47, 44, + _T("DSPS0"), 48, 51, + _T("DSPS1"), 49, 50, + _T("DSPS2"), 50, 49, + _T("DSPS3"), 51, 48, + _T("SCRATCH0"), 52, 55, + _T("SCRATCH1"), 53, 54, + _T("SCRATCH2"), 54, 53, + _T("SCRATCH3"), 55, 52, + _T("DMODE"), 56, 59, + _T("DIEN"), 57, 58, + _T("DWT"), 58, 57, + _T("DCNTL"), 59, 56, + _T("ADDER0"), 60, 63, + _T("ADDER1"), 61, 62, + _T("ADDER2"), 62, 61, + _T("ADDER3"), 63, 60, NULL }; @@ -119,7 +119,7 @@ static TCHAR *regname (uaecptr addr) if (regsinfo[i].le == addr) return regsinfo[i].name; } - return L"?"; + return _T("?"); } #define SCNTL0_REG 0x03 @@ -253,14 +253,14 @@ static void INT2(void) if (ncrregs[SIEN_REG] == 0) return; INTREQ (0x8000 | 0x0008); - write_log (L"IRQ\n"); + write_log (_T("IRQ\n")); } static uae_u8 read_rombyte (uaecptr addr) { uae_u8 v = rom[addr]; - //write_log (L"%08X = %02X PC=%08X\n", addr, v, M68K_GETPC); + //write_log (_T("%08X = %02X PC=%08X\n"), addr, v, M68K_GETPC); return v; } @@ -279,7 +279,7 @@ void ncr_bput2 (uaecptr addr, uae_u32 val) INT2(); break; } - write_log (L"%s write %04X (%s) = %02X PC=%08X\n", NCRNAME, addr, regname(addr), v & 0xff, M68K_GETPC); + write_log (_T("%s write %04X (%s) = %02X PC=%08X\n"), NCRNAME, addr, regname(addr), v & 0xff, M68K_GETPC); ncrregs[addr] = val; } @@ -306,7 +306,7 @@ uae_u32 ncr_bget2 (uaecptr addr) v &= 0x0f; // revision 0 break; } - write_log (L"%s read %04X (%s) = %02X PC=%08X\n", NCRNAME, addr, regname(addr), v, M68K_GETPC); + write_log (_T("%s read %04X (%s) = %02X PC=%08X\n"), NCRNAME, addr, regname(addr), v, M68K_GETPC); if (v2 != v) ncrregs[addr] = v2; return v; @@ -325,7 +325,7 @@ static uae_u32 REGPARAM2 ncr_lget (uaecptr addr) (ncr_bget2 (addr + 2) << 8) | (ncr_bget2 (addr + 3)); #if NCR_DEBUG > 0 if (addr < ROM_VECTOR) - write_log (L"ncr_lget %08X=%08X PC=%08X\n", addr, v, M68K_GETPC); + write_log (_T("ncr_lget %08X=%08X PC=%08X\n"), addr, v, M68K_GETPC); #endif return v; } @@ -340,7 +340,7 @@ static uae_u32 REGPARAM2 ncr_wget (uaecptr addr) v = (ncr_bget2 (addr) << 8) | ncr_bget2 (addr + 1); #if NCR_DEBUG > 0 if (addr < ROM_VECTOR) - write_log (L"ncr_wget %08X=%04X PC=%08X\n", addr, v, M68K_GETPC); + write_log (_T("ncr_wget %08X=%04X PC=%08X\n"), addr, v, M68K_GETPC); #endif return v; } @@ -369,7 +369,7 @@ static void REGPARAM2 ncr_lput (uaecptr addr, uae_u32 l) addr &= board_mask; #if NCR_DEBUG > 0 if (addr < ROM_VECTOR) - write_log (L"ncr_lput %08X=%08X PC=%08X\n", addr, l, M68K_GETPC); + write_log (_T("ncr_lput %08X=%08X PC=%08X\n"), addr, l, M68K_GETPC); #endif ncr_bput2 (addr, l >> 24); ncr_bput2 (addr + 1, l >> 16); @@ -386,14 +386,14 @@ static void REGPARAM2 ncr_wput (uaecptr addr, uae_u32 w) addr &= board_mask; #if NCR_DEBUG > 0 if (addr < ROM_VECTOR) - write_log (L"ncr_wput %04X=%04X PC=%08X\n", addr, w & 65535, M68K_GETPC); + write_log (_T("ncr_wput %04X=%04X PC=%08X\n"), addr, w & 65535, M68K_GETPC); #endif if (addr == 0x44 && !configured) { uae_u32 value = (p96ram_start + ((currprefs.rtgmem_size + 0xffffff) & ~0xffffff)) >> 16; chipmem_wput (regs.regs[11] + 0x20, value); chipmem_wput (regs.regs[11] + 0x28, value); map_banks (&ncr_bank, value, BOARD_SIZE >> 16, 0); - write_log (L"A4091 Z3 autoconfigured at %04X0000\n", value); + write_log (_T("A4091 Z3 autoconfigured at %04X0000\n"), value); configured = 1; expamem_next(); return; @@ -410,7 +410,7 @@ static void REGPARAM2 ncr_bput (uaecptr addr, uae_u32 b) b &= 0xff; addr &= board_mask; if (addr == 0x4c && !configured) { - write_log (L"A4091 AUTOCONFIG SHUT-UP!\n"); + write_log (_T("A4091 AUTOCONFIG SHUT-UP!\n")); configured = 1; expamem_next(); return; @@ -423,7 +423,7 @@ static void REGPARAM2 ncr_bput (uaecptr addr, uae_u32 b) static addrbank ncr_bank = { ncr_lget, ncr_wget, ncr_bget, ncr_lput, ncr_wput, ncr_bput, - default_xlate, default_check, NULL, L"A4091", + default_xlate, default_check, NULL, _T("A4091"), dummy_lgeti, dummy_wgeti, ABFLAG_IO }; @@ -487,7 +487,7 @@ void ncr_init (void) struct romdata *rd = rl->rd; z = read_rom (&rd); if (z) { - write_log (L"A4091 BOOT ROM %d.%d\n", rd->ver, rd->rev); + write_log (_T("A4091 BOOT ROM %d.%d\n"), rd->ver, rd->rev); rom = xmalloc (uae_u8, ROM_SIZE * 4); for (i = 0; i < ROM_SIZE; i++) { uae_u8 b; diff --git a/newcpu.cpp b/newcpu.cpp index 905964ad..6db55435 100644 --- a/newcpu.cpp +++ b/newcpu.cpp @@ -109,7 +109,7 @@ void dump_counts (void) unsigned long int total; int i; - write_log (L"Writing instruction count file...\n"); + write_log (_T("Writing instruction count file...\n")); for (i = 0; i < 65536; i++) { opcodenums[i] = i; total += instrcount[i]; @@ -219,7 +219,7 @@ static void check_trace2 (void) { if (cputrace.readcounter || cputrace.writecounter || cputrace.cyclecounter || cputrace.cyclecounter_pre || cputrace.cyclecounter_post) - write_log (L"CPU tracer invalid state during playback!\n"); + write_log (_T("CPU tracer invalid state during playback!\n")); } static bool check_trace (void) @@ -228,7 +228,7 @@ static bool check_trace (void) return true; if (!cputrace.readcounter && !cputrace.writecounter && !cputrace.cyclecounter) { if (cpu_tracer != -2) { - write_log (L"CPU trace: dma_cycle() enabled. %08x %08x NOW=%08X\n", + write_log (_T("CPU trace: dma_cycle() enabled. %08x %08x NOW=%08X\n"), cputrace.cyclecounter_pre, cputrace.cyclecounter_post, get_cycles ()); cpu_tracer = -2; // dma_cycle() allowed to work now } @@ -252,7 +252,7 @@ static bool check_trace (void) x_do_cycles = x2_do_cycles; x_do_cycles_pre = x2_do_cycles_pre; x_do_cycles_post = x2_do_cycles_post; - write_log (L"CPU tracer playback complete. STARTCYCLES=%08x NOWCYCLES=%08x\n", cputrace.startcycles, get_cycles ()); + write_log (_T("CPU tracer playback complete. STARTCYCLES=%08x NOWCYCLES=%08x\n"), cputrace.startcycles, get_cycles ()); cputrace.needendcycles = 1; cpu_tracer = 0; return true; @@ -265,7 +265,7 @@ static bool get_trace (uaecptr addr, int accessmode, int size, uae_u32 *data) struct cputracememory *ctm = &cputrace.ctm[i]; if (ctm->addr == addr && ctm->mode == mode) { ctm->mode = 0; - write_log (L"CPU trace: GET %d: PC=%08x %08x=%08x %d %d %08x/%08x/%08x %d/%d (%08X)\n", + write_log (_T("CPU trace: GET %d: PC=%08x %08x=%08x %d %d %08x/%08x/%08x %d/%d (%08X)\n"), i, cputrace.pc, addr, ctm->data, accessmode, size, cputrace.cyclecounter, cputrace.cyclecounter_pre, cputrace.cyclecounter_post, cputrace.readcounter, cputrace.writecounter, get_cycles ()); @@ -296,7 +296,7 @@ static bool get_trace (uaecptr addr, int accessmode, int size, uae_u32 *data) x_do_cycles (c); return false; } - gui_message (L"CPU trace: GET %08x %d %d NOT FOUND!\n", addr, accessmode, size); + gui_message (_T("CPU trace: GET %08x %d %d NOT FOUND!\n"), addr, accessmode, size); check_trace (); *data = 0; return false; @@ -499,7 +499,7 @@ static void cputracefunc2_x_put_long (uaecptr o, uae_u32 val) check_trace2 (); } if (v != val) - write_log (L"cputracefunc2_x_put_long %d <> %d\n", v, val); + write_log (_T("cputracefunc2_x_put_long %d <> %d\n"), v, val); } static void cputracefunc2_x_put_word (uaecptr o, uae_u32 val) { @@ -509,7 +509,7 @@ static void cputracefunc2_x_put_word (uaecptr o, uae_u32 val) check_trace2 (); } if (v != val) - write_log (L"cputracefunc2_x_put_word %d <> %d\n", v, val); + write_log (_T("cputracefunc2_x_put_word %d <> %d\n"), v, val); } static void cputracefunc2_x_put_byte (uaecptr o, uae_u32 val) { @@ -519,7 +519,7 @@ static void cputracefunc2_x_put_byte (uaecptr o, uae_u32 val) check_trace2 (); } if (v != val) - write_log (L"cputracefunc2_x_put_byte %d <> %d\n", v, val); + write_log (_T("cputracefunc2_x_put_byte %d <> %d\n"), v, val); } static void cputracefunc_x_do_cycles (unsigned long cycles) @@ -829,11 +829,11 @@ bool set_cpu_tracer (bool state) cpu_tracer = 1; set_x_funcs (); if (old != cpu_tracer) - write_log (L"CPU tracer enabled\n"); + write_log (_T("CPU tracer enabled\n")); } if (old > 0 && state == false) { set_x_funcs (); - write_log (L"CPU tracer disabled\n"); + write_log (_T("CPU tracer disabled\n")); } return is_cpu_tracer (); } @@ -977,7 +977,7 @@ static void build_cpufunctbl (void) } if (tbl == 0) { - write_log (L"no CPU emulation cores available CPU=%d!", currprefs.cpu_model); + write_log (_T("no CPU emulation cores available CPU=%d!"), currprefs.cpu_model); abort (); } @@ -1019,13 +1019,13 @@ static void build_cpufunctbl (void) opcnt++; } } - write_log (L"Building CPU, %d opcodes (%d %d %d)\n", + write_log (_T("Building CPU, %d opcodes (%d %d %d)\n"), opcnt, lvl, currprefs.cpu_cycle_exact ? -1 : currprefs.cpu_compatible ? 1 : 0, currprefs.address_space_24); - write_log (L"CPU=%d, FPU=%d, MMU=%d, JIT%s=%d.\n", + write_log (_T("CPU=%d, FPU=%d, MMU=%d, JIT%s=%d.\n"), currprefs.cpu_model, currprefs.fpu_model, currprefs.mmu_model, - currprefs.cachesize ? (currprefs.compfpu ? L"=CPU/FPU" : L"=CPU") : L"", + currprefs.cachesize ? (currprefs.compfpu ? _T("=CPU/FPU") : _T("=CPU")) : _T(""), currprefs.cachesize); #ifdef JIT build_comp (); @@ -1084,7 +1084,7 @@ static void update_68k_cycles (void) if (cpucycleunit < 1) cpucycleunit = 1; if (currprefs.cpu_cycle_exact) - write_log (L"CPU cycleunit: %d (%.3f)\n", cpucycleunit, (float)cpucycleunit / CYCLE_UNIT); + write_log (_T("CPU cycleunit: %d (%.3f)\n"), cpucycleunit, (float)cpucycleunit / CYCLE_UNIT); config_changed = 1; } @@ -1164,7 +1164,7 @@ void init_m68k (void) if (f) { uae_u32 opcode, count, total; TCHAR name[20]; - write_log (L"Reading instruction count file...\n"); + write_log (_T("Reading instruction count file...\n")); fscanf (f, "Total: %lu\n", &total); while (fscanf (f, "%lx: %lu %s\n", &opcode, &count, name) == 3) { instrcount[opcode] = count; @@ -1173,31 +1173,31 @@ void init_m68k (void) } } #endif - write_log (L"Building CPU table for configuration: %d", currprefs.cpu_model); + write_log (_T("Building CPU table for configuration: %d"), currprefs.cpu_model); regs.address_space_mask = 0xffffffff; if (currprefs.cpu_compatible) { if (currprefs.address_space_24 && currprefs.cpu_model >= 68030) currprefs.address_space_24 = false; } if (currprefs.fpu_model > 0) - write_log (L"/%d", currprefs.fpu_model); + write_log (_T("/%d"), currprefs.fpu_model); if (currprefs.cpu_cycle_exact) { if (currprefs.cpu_model == 68000) - write_log (L" prefetch and cycle-exact"); + write_log (_T(" prefetch and cycle-exact")); else - write_log (L" ~cycle-exact"); + write_log (_T(" ~cycle-exact")); } else if (currprefs.cpu_compatible) - write_log (L" prefetch"); + write_log (_T(" prefetch")); if (currprefs.address_space_24) { regs.address_space_mask = 0x00ffffff; - write_log (L" 24-bit"); + write_log (_T(" 24-bit")); } - write_log (L"\n"); + write_log (_T("\n")); read_table68k (); do_merges (); - write_log (L"%d CPU functions\n", nr_cpuop_funcs); + write_log (_T("%d CPU functions\n"), nr_cpuop_funcs); build_cpufunctbl (); set_x_funcs (); @@ -1230,21 +1230,21 @@ static uae_s32 ShowEA (void *f, uae_u16 opcode, int reg, amodes mode, wordsizes switch (mode){ case Dreg: - _stprintf (buffer, L"D%d", reg); + _stprintf (buffer, _T("D%d"), reg); break; case Areg: - _stprintf (buffer, L"A%d", reg); + _stprintf (buffer, _T("A%d"), reg); break; case Aind: - _stprintf (buffer, L"(A%d)", reg); + _stprintf (buffer, _T("(A%d)"), reg); addr = regs.regs[reg + 8]; break; case Aipi: - _stprintf (buffer, L"(A%d)+", reg); + _stprintf (buffer, _T("(A%d)+"), reg); addr = regs.regs[reg + 8]; break; case Apdi: - _stprintf (buffer, L"-(A%d)", reg); + _stprintf (buffer, _T("-(A%d)"), reg); addr = regs.regs[reg + 8]; break; case Ad16: @@ -1252,11 +1252,11 @@ static uae_s32 ShowEA (void *f, uae_u16 opcode, int reg, amodes mode, wordsizes TCHAR offtxt[80]; disp16 = get_iword_1 (m68kpc_offset); m68kpc_offset += 2; if (disp16 < 0) - _stprintf (offtxt, L"-$%04x", -disp16); + _stprintf (offtxt, _T("-$%04x"), -disp16); else - _stprintf (offtxt, L"$%04x", disp16); + _stprintf (offtxt, _T("$%04x"), disp16); addr = m68k_areg (regs, reg) + disp16; - _stprintf (buffer, L"(A%d, %s) == $%08lx", reg, offtxt, (unsigned long)addr); + _stprintf (buffer, _T("(A%d, %s) == $%08lx"), reg, offtxt, (unsigned long)addr); } break; case Ad8r: @@ -1271,7 +1271,7 @@ static uae_s32 ShowEA (void *f, uae_u16 opcode, int reg, amodes mode, wordsizes uae_s32 outer = 0, disp = 0; uae_s32 base = m68k_areg (regs, reg); TCHAR name[10]; - _stprintf (name, L"A%d, ", reg); + _stprintf (name, _T("A%d, "), reg); if (dp & 0x80) { base = 0; name[0] = 0; } if (dp & 0x40) dispreg = 0; if ((dp & 0x30) == 0x20) { disp = (uae_s32)(uae_s16)get_iword_1 (m68kpc_offset); m68kpc_offset += 2; } @@ -1286,14 +1286,14 @@ static uae_s32 ShowEA (void *f, uae_u16 opcode, int reg, amodes mode, wordsizes if (dp & 4) base += dispreg; addr = base + outer; - _stprintf (buffer, L"(%s%c%d.%c*%d+%ld)+%ld == $%08lx", name, + _stprintf (buffer, _T("(%s%c%d.%c*%d+%ld)+%ld == $%08lx"), name, dp & 0x8000 ? 'A' : 'D', (int)r, dp & 0x800 ? 'L' : 'W', 1 << ((dp >> 9) & 3), disp, outer, (unsigned long)addr); } else { addr = m68k_areg (regs, reg) + (uae_s32)((uae_s8)disp8) + dispreg; - _stprintf (buffer, L"(A%d, %c%d.%c*%d, $%02x) == $%08lx", reg, + _stprintf (buffer, _T("(A%d, %c%d.%c*%d, $%02x) == $%08lx"), reg, dp & 0x8000 ? 'A' : 'D', (int)r, dp & 0x800 ? 'L' : 'W', 1 << ((dp >> 9) & 3), disp8, (unsigned long)addr); @@ -1303,7 +1303,7 @@ static uae_s32 ShowEA (void *f, uae_u16 opcode, int reg, amodes mode, wordsizes addr = m68k_getpc () + m68kpc_offset; disp16 = get_iword_1 (m68kpc_offset); m68kpc_offset += 2; addr += (uae_s16)disp16; - _stprintf (buffer, L"(PC,$%04x) == $%08lx", disp16 & 0xffff, (unsigned long)addr); + _stprintf (buffer, _T("(PC,$%04x) == $%08lx"), disp16 & 0xffff, (unsigned long)addr); break; case PC8r: addr = m68k_getpc () + m68kpc_offset; @@ -1318,7 +1318,7 @@ static uae_s32 ShowEA (void *f, uae_u16 opcode, int reg, amodes mode, wordsizes uae_s32 outer = 0, disp = 0; uae_s32 base = addr; TCHAR name[10]; - _stprintf (name, L"PC, "); + _stprintf (name, _T("PC, ")); if (dp & 0x80) { base = 0; name[0] = 0; } if (dp & 0x40) dispreg = 0; if ((dp & 0x30) == 0x20) { disp = (uae_s32)(uae_s16)get_iword_1 (m68kpc_offset); m68kpc_offset += 2; } @@ -1333,40 +1333,40 @@ static uae_s32 ShowEA (void *f, uae_u16 opcode, int reg, amodes mode, wordsizes if (dp & 4) base += dispreg; addr = base + outer; - _stprintf (buffer, L"(%s%c%d.%c*%d+%ld)+%ld == $%08lx", name, + _stprintf (buffer, _T("(%s%c%d.%c*%d+%ld)+%ld == $%08lx"), name, dp & 0x8000 ? 'A' : 'D', (int)r, dp & 0x800 ? 'L' : 'W', 1 << ((dp >> 9) & 3), disp, outer, (unsigned long)addr); } else { addr += (uae_s32)((uae_s8)disp8) + dispreg; - _stprintf (buffer, L"(PC, %c%d.%c*%d, $%02x) == $%08lx", dp & 0x8000 ? 'A' : 'D', + _stprintf (buffer, _T("(PC, %c%d.%c*%d, $%02x) == $%08lx"), dp & 0x8000 ? 'A' : 'D', (int)r, dp & 0x800 ? 'L' : 'W', 1 << ((dp >> 9) & 3), disp8, (unsigned long)addr); } break; case absw: addr = (uae_s32)(uae_s16)get_iword_1 (m68kpc_offset); - _stprintf (buffer, L"$%08lx", (unsigned long)addr); + _stprintf (buffer, _T("$%08lx"), (unsigned long)addr); m68kpc_offset += 2; break; case absl: addr = get_ilong_1 (m68kpc_offset); - _stprintf (buffer, L"$%08lx", (unsigned long)addr); + _stprintf (buffer, _T("$%08lx"), (unsigned long)addr); m68kpc_offset += 4; break; case imm: switch (size){ case sz_byte: - _stprintf (buffer, L"#$%02x", (unsigned int)(get_iword_1 (m68kpc_offset) & 0xff)); + _stprintf (buffer, _T("#$%02x"), (unsigned int)(get_iword_1 (m68kpc_offset) & 0xff)); m68kpc_offset += 2; break; case sz_word: - _stprintf (buffer, L"#$%04x", (unsigned int)(get_iword_1 (m68kpc_offset) & 0xffff)); + _stprintf (buffer, _T("#$%04x"), (unsigned int)(get_iword_1 (m68kpc_offset) & 0xffff)); m68kpc_offset += 2; break; case sz_long: - _stprintf (buffer, L"#$%08lx", (unsigned long)(get_ilong_1 (m68kpc_offset))); + _stprintf (buffer, _T("#$%08lx"), (unsigned long)(get_ilong_1 (m68kpc_offset))); m68kpc_offset += 4; break; default: @@ -1376,28 +1376,28 @@ static uae_s32 ShowEA (void *f, uae_u16 opcode, int reg, amodes mode, wordsizes case imm0: offset = (uae_s32)(uae_s8)get_iword_1 (m68kpc_offset); m68kpc_offset += 2; - _stprintf (buffer, L"#$%02x", (unsigned int)(offset & 0xff)); + _stprintf (buffer, _T("#$%02x"), (unsigned int)(offset & 0xff)); break; case imm1: offset = (uae_s32)(uae_s16)get_iword_1 (m68kpc_offset); m68kpc_offset += 2; buffer[0] = 0; - _stprintf (buffer, L"#$%04x", (unsigned int)(offset & 0xffff)); + _stprintf (buffer, _T("#$%04x"), (unsigned int)(offset & 0xffff)); break; case imm2: offset = (uae_s32)get_ilong_1 (m68kpc_offset); m68kpc_offset += 4; - _stprintf (buffer, L"#$%08lx", (unsigned long)offset); + _stprintf (buffer, _T("#$%08lx"), (unsigned long)offset); break; case immi: offset = (uae_s32)(uae_s8)(reg & 0xff); - _stprintf (buffer, L"#$%08lx", (unsigned long)offset); + _stprintf (buffer, _T("#$%08lx"), (unsigned long)offset); break; default: break; } if (buf == 0) - f_out (f, L"%s", buffer); + f_out (f, _T("%s"), buffer); else _tcscat (buf, buffer); if (eaddr) @@ -1582,7 +1582,7 @@ uae_u32 REGPARAM2 get_bitfield (uae_u32 src, uae_u32 bdata[2], uae_s32 offset, i break; default: /* Panic? */ - write_log (L"get_bitfield() can't happen %d\n", (offset + width + 7) >> 3); + write_log (_T("get_bitfield() can't happen %d\n"), (offset + width + 7) >> 3); res = 0; break; } @@ -1614,7 +1614,7 @@ void REGPARAM2 put_bitfield (uae_u32 dst, uae_u32 bdata[2], uae_u32 val, uae_s32 put_byte (dst + 4, bdata[1] | (val << (40 - offset))); break; default: - write_log (L"put_bitfield() can't happen %d\n", (offset + 7) >> 3); + write_log (_T("put_bitfield() can't happen %d\n"), (offset + 7) >> 3); break; } } @@ -1659,7 +1659,7 @@ uae_u32 REGPARAM2 x_get_bitfield (uae_u32 src, uae_u32 bdata[2], uae_s32 offset, break; default: /* Panic? */ - write_log (L"x_get_bitfield() can't happen %d\n", (offset + width + 7) >> 3); + write_log (_T("x_get_bitfield() can't happen %d\n"), (offset + width + 7) >> 3); res = 0; break; } @@ -1688,7 +1688,7 @@ void REGPARAM2 x_put_bitfield (uae_u32 dst, uae_u32 bdata[2], uae_u32 val, uae_s x_put_byte (dst + 4, bdata[1] | (val << (40 - offset))); break; default: - write_log (L"x_put_bitfield() can't happen %d\n", (offset + 7) >> 3); + write_log (_T("x_put_bitfield() can't happen %d\n"), (offset + 7) >> 3); break; } } @@ -1897,7 +1897,7 @@ static void exception_debug (int nr) #ifdef DEBUGGER if (!exception_debugging) return; - console_out_f (L"Exception %d, PC=%08X\n", nr, M68K_GETPC); + console_out_f (_T("Exception %d, PC=%08X\n"), nr, M68K_GETPC); #endif } @@ -2038,7 +2038,7 @@ static void Exception_ce000 (int nr) x_put_word (m68k_areg (regs, 7) + 0, mode); x_put_word (m68k_areg (regs, 7) + 2, last_fault_for_exception_3 >> 16); x_do_cycles (2 * cpucycleunit); - write_log (L"Exception %d (%x) at %x -> %x!\n", nr, last_addr_for_exception_3, currpc, get_long (4 * nr)); + write_log (_T("Exception %d (%x) at %x -> %x!\n"), nr, last_addr_for_exception_3, currpc, get_long (4 * nr)); goto kludge_me_do; } m68k_areg (regs, 7) -= 6; @@ -2099,7 +2099,7 @@ static void Exception_mmu (int nr) mmu_set_super (1); } if (nr == 2) { -// write_log (L"%08x %08x %08x\n", currpc, oldpc, regs.mmu_fault_addr); +// write_log (_T("%08x %08x %08x\n"), currpc, oldpc, regs.mmu_fault_addr); // if (currpc == 0x0013b5e2) // activate_debugger (); // bus error @@ -2333,7 +2333,7 @@ static void Exception_normal (int nr) m68k_areg (regs, 7) -= 2; x_put_word (m68k_areg (regs, 7), 0xb000 + nr * 4); } - write_log (L"Exception %d (%x) at %x -> %x!\n", nr, regs.instruction_pc, currpc, x_get_long (regs.vbr + 4*nr)); + write_log (_T("Exception %d (%x) at %x -> %x!\n"), nr, regs.instruction_pc, currpc, x_get_long (regs.vbr + 4*nr)); } else if (nr ==5 || nr == 6 || nr == 7 || nr == 9) { m68k_areg (regs, 7) -= 4; x_put_long (m68k_areg (regs, 7), regs.instruction_pc); @@ -2368,7 +2368,7 @@ static void Exception_normal (int nr) x_put_word (m68k_areg (regs, 7) + 6, last_op_for_exception_3); x_put_word (m68k_areg (regs, 7) + 8, regs.sr); x_put_long (m68k_areg (regs, 7) + 10, last_addr_for_exception_3); - write_log (L"Exception %d (%x) at %x -> %x!\n", nr, last_fault_for_exception_3, currpc, x_get_long (regs.vbr + 4*nr)); + write_log (_T("Exception %d (%x) at %x -> %x!\n"), nr, last_fault_for_exception_3, currpc, x_get_long (regs.vbr + 4*nr)); goto kludge_me_do; } } @@ -2415,7 +2415,7 @@ void REGPARAM2 Exception (int nr) if (debug_illegal && !in_rom (M68K_GETPC)) { int v = nr; if (nr <= 63 && (debug_illegal_mask & ((uae_u64)1 << nr))) { - write_log (L"Exception %d breakpoint\n", nr); + write_log (_T("Exception %d breakpoint\n"), nr); activate_debugger (); } } @@ -2494,7 +2494,7 @@ int movec_illg (int regno) int m68k_move2c (int regno, uae_u32 *regp) { #if MOVEC_DEBUG > 0 - write_log (L"move2c %04X <- %08X PC=%x\n", regno, *regp, M68K_GETPC); + write_log (_T("move2c %04X <- %08X PC=%x\n"), regno, *regp, M68K_GETPC); #endif if (movec_illg (regno)) { op_illg (0x4E7B); @@ -2550,7 +2550,7 @@ int m68k_move2c (int regno, uae_u32 *regp) regs.pcr &= ~(0x40 | 2 | 1); regs.pcr |= (*regp) & (0x40 | 2 | 1); if (((opcr ^ regs.pcr) & 2) == 2) { - write_log (L"68060 FPU state: %s\n", regs.pcr & 2 ? L"disabled" : L"enabled"); + write_log (_T("68060 FPU state: %s\n"), regs.pcr & 2 ? _T("disabled") : _T("enabled")); /* flush possible already translated FPU instructions */ flush_icache (0, 3); } @@ -2567,7 +2567,7 @@ int m68k_move2c (int regno, uae_u32 *regp) int m68k_movec2 (int regno, uae_u32 *regp) { #if MOVEC_DEBUG > 0 - write_log (L"movec2 %04X PC=%x\n", regno, M68K_GETPC); + write_log (_T("movec2 %04X PC=%x\n"), regno, M68K_GETPC); #endif if (movec_illg (regno)) { op_illg (0x4E7A); @@ -2614,7 +2614,7 @@ int m68k_movec2 (int regno, uae_u32 *regp) } } #if MOVEC_DEBUG > 0 - write_log (L"-> %08X\n", *regp); + write_log (_T("-> %08X\n"), *regp); #endif return 1; } @@ -2993,7 +2993,7 @@ unsigned long REGPARAM2 op_illg (uae_u32 opcode) if ((opcode & 0xF000) == 0xF000) { if (warned < 20) { - //write_log (L"B-Trap %x at %x (%p)\n", opcode, pc, regs.pc_p); + //write_log (_T("B-Trap %x at %x (%p)\n"), opcode, pc, regs.pc_p); //warned++; } Exception (0xB); @@ -3002,7 +3002,7 @@ unsigned long REGPARAM2 op_illg (uae_u32 opcode) } if ((opcode & 0xF000) == 0xA000) { if (warned < 20) { - //write_log (L"A-Trap %x at %x (%p)\n", opcode, pc, regs.pc_p); + //write_log (_T("A-Trap %x at %x (%p)\n"), opcode, pc, regs.pc_p); //warned++; } Exception (0xA); @@ -3010,7 +3010,7 @@ unsigned long REGPARAM2 op_illg (uae_u32 opcode) return 4; } if (warned < 20) { - write_log (L"Illegal instruction: %04x at %08X -> %08X\n", opcode, pc, get_long (regs.vbr + 0x10)); + write_log (_T("Illegal instruction: %04x at %08X -> %08X\n"), opcode, pc, get_long (regs.vbr + 0x10)); warned++; //activate_debugger(); } @@ -3021,7 +3021,7 @@ unsigned long REGPARAM2 op_illg (uae_u32 opcode) #ifdef CPUEMU_0 -static TCHAR *mmu30regs[] = { L"TCR", L"", L"SRP", L"CRP", L"", L"", L"", L"" }; +static TCHAR *mmu30regs[] = { _T("TCR"), _T(""), _T("SRP"), _T("CRP"), _T(""), _T(""), _T(""), _T("") }; static void mmu_op30_pmove (uaecptr pc, uae_u32 opcode, uae_u16 next, uaecptr extra) { @@ -3035,7 +3035,7 @@ static void mmu_op30_pmove (uaecptr pc, uae_u32 opcode, uae_u16 next, uaecptr ex switch (preg) { case 0x10: // TC - reg = L"TC"; + reg = _T("TC"); siz = 4; if (rw) x_put_long (extra, tc_030); @@ -3043,7 +3043,7 @@ static void mmu_op30_pmove (uaecptr pc, uae_u32 opcode, uae_u16 next, uaecptr ex tc_030 = x_get_long (extra); break; case 0x12: // SRP - reg = L"SRP"; + reg = _T("SRP"); siz = 8; if (rw) { x_put_long (extra, srp_030 >> 32); @@ -3054,7 +3054,7 @@ static void mmu_op30_pmove (uaecptr pc, uae_u32 opcode, uae_u16 next, uaecptr ex } break; case 0x13: // CRP - reg = L"CRP"; + reg = _T("CRP"); siz = 8; if (rw) { x_put_long (extra, crp_030 >> 32); @@ -3065,7 +3065,7 @@ static void mmu_op30_pmove (uaecptr pc, uae_u32 opcode, uae_u16 next, uaecptr ex } break; case 0x18: // MMUSR - reg = L"MMUSR"; + reg = _T("MMUSR"); siz = 2; if (rw) x_put_word (extra, mmusr_030); @@ -3073,7 +3073,7 @@ static void mmu_op30_pmove (uaecptr pc, uae_u32 opcode, uae_u16 next, uaecptr ex mmusr_030 = x_get_word (extra); break; case 0x02: // TT0 - reg = L"TT0"; + reg = _T("TT0"); siz = 4; if (rw) x_put_long (extra, tt0_030); @@ -3081,7 +3081,7 @@ static void mmu_op30_pmove (uaecptr pc, uae_u32 opcode, uae_u16 next, uaecptr ex tt0_030 = x_get_long (extra); break; case 0x03: // TT1 - reg = L"TT1"; + reg = _T("TT1"); siz = 4; if (rw) x_put_long (extra, tt1_030); @@ -3101,20 +3101,20 @@ static void mmu_op30_pmove (uaecptr pc, uae_u32 opcode, uae_u16 next, uaecptr ex uae_u32 val2 = x_get_long (extra); val = x_get_long (extra + 4); if (rw) - write_log (L"PMOVE %s,%08X%08X", reg, val2, val); + write_log (_T("PMOVE %s,%08X%08X"), reg, val2, val); else - write_log (L"PMOVE %08X%08X,%s", val2, val, reg); + write_log (_T("PMOVE %08X%08X,%s"), val2, val, reg); } else { if (siz == 4) val = x_get_long (extra); else val = x_get_word (extra); if (rw) - write_log (L"PMOVE %s,%08X", reg, val); + write_log (_T("PMOVE %s,%08X"), reg, val); else - write_log (L"PMOVE %08X,%s", val, reg); + write_log (_T("PMOVE %08X,%s"), val, reg); } - write_log (L" PC=%08X\n", pc); + write_log (_T(" PC=%08X\n"), pc); } #endif if (currprefs.cs_mbdmac == 1 && currprefs.mbresmem_low_size > 0) { @@ -3131,8 +3131,8 @@ static void mmu_op30_ptest (uaecptr pc, uae_u32 opcode, uae_u16 next, uaecptr ex tmp[0] = 0; if ((next >> 8) & 1) - _stprintf (tmp, L",A%d", (next >> 4) & 15); - write_log (L"PTEST%c %02X,%08X,#%X%s PC=%08X\n", + _stprintf (tmp, _T(",A%d"), (next >> 4) & 15); + write_log (_T("PTEST%c %02X,%08X,#%X%s PC=%08X\n"), ((next >> 9) & 1) ? 'W' : 'R', (next & 15), extra, (next >> 10) & 7, tmp, pc); #endif mmusr_030 = 0; @@ -3141,7 +3141,7 @@ static void mmu_op30_ptest (uaecptr pc, uae_u32 opcode, uae_u16 next, uaecptr ex static void mmu_op30_pflush (uaecptr pc, uae_u32 opcode, uae_u16 next, uaecptr extra) { #if MMUOP_DEBUG > 0 - write_log (L"PFLUSH PC=%08X\n", pc); + write_log (_T("PFLUSH PC=%08X\n"), pc); #endif } @@ -3167,20 +3167,20 @@ void mmu_op (uae_u32 opcode, uae_u32 extra) return; } #if MMUOP_DEBUG > 1 - write_log (L"mmu_op %04X PC=%08X\n", opcode, m68k_getpc ()); + write_log (_T("mmu_op %04X PC=%08X\n"), opcode, m68k_getpc ()); #endif if ((opcode & 0xFE0) == 0x0500) { /* PFLUSH */ regs.mmusr = 0; #if MMUOP_DEBUG > 0 - write_log (L"PFLUSH\n"); + write_log (_T("PFLUSH\n")); #endif return; } else if ((opcode & 0x0FD8) == 0x548) { if (currprefs.cpu_model < 68060) { /* PTEST not in 68060 */ /* PTEST */ #if MMUOP_DEBUG > 0 - write_log (L"PTEST\n"); + write_log (_T("PTEST\n")); #endif return; } @@ -3188,13 +3188,13 @@ void mmu_op (uae_u32 opcode, uae_u32 extra) /* PLPA */ if (currprefs.cpu_model == 68060) { #if MMUOP_DEBUG > 0 - write_log (L"PLPA\n"); + write_log (_T("PLPA\n")); #endif return; } } #if MMUOP_DEBUG > 0 - write_log (L"Unknown MMU OP %04X\n", opcode); + write_log (_T("Unknown MMU OP %04X\n"), opcode); #endif m68k_setpc (m68k_getpc () - 2); op_illg (opcode); @@ -3280,7 +3280,7 @@ STATIC_INLINE int do_specialties (int cycles) #endif if ((regs.spcflags & SPCFLAG_ACTION_REPLAY) && action_replay_flag != ACTION_REPLAY_INACTIVE) { /*if (action_replay_flag == ACTION_REPLAY_ACTIVE && !is_ar_pc_in_rom ())*/ - /* write_log (L"PC:%p\n", m68k_getpc ());*/ + /* write_log (_T("PC:%p\n"), m68k_getpc ());*/ if (action_replay_flag == ACTION_REPLAY_ACTIVATE || action_replay_flag == ACTION_REPLAY_DORESET) action_replay_enter (); @@ -3289,7 +3289,7 @@ STATIC_INLINE int do_specialties (int cycles) unset_special (SPCFLAG_ACTION_REPLAY); } if (action_replay_flag == ACTION_REPLAY_WAIT_PC) { - /*write_log (L"Waiting for PC: %p, current PC= %p\n", wait_for_pc, m68k_getpc ());*/ + /*write_log (_T("Waiting for PC: %p, current PC= %p\n"), wait_for_pc, m68k_getpc ());*/ if (m68k_getpc () == wait_for_pc) { action_replay_flag = ACTION_REPLAY_ACTIVATE; /* Activate after next instruction. */ } @@ -3447,8 +3447,8 @@ static uae_u32 cd32nextpc, cd32request; static void out_cd32io2 (void) { uae_u32 request = cd32request; - write_log (L"%08x returned\n", request); - //write_log (L"ACTUAL=%d ERROR=%d\n", get_long (request + 32), get_byte (request + 31)); + write_log (_T("%08x returned\n"), request); + //write_log (_T("ACTUAL=%d ERROR=%d\n"), get_long (request + 32), get_byte (request + 31)); cd32nextpc = 0; cd32request = 0; } @@ -3468,30 +3468,30 @@ static void out_cd32io (uae_u32 pc) { case 0xe57cc0: case 0xf04c34: - _stprintf (out, L"opendevice"); + _stprintf (out, _T("opendevice")); break; case 0xe57ce6: case 0xf04c56: - _stprintf (out, L"closedevice"); + _stprintf (out, _T("closedevice")); break; case 0xe57e44: case 0xf04f2c: - _stprintf (out, L"beginio"); + _stprintf (out, _T("beginio")); ioreq = 1; break; case 0xe57ef2: case 0xf0500e: - _stprintf (out, L"abortio"); + _stprintf (out, _T("abortio")); ioreq = -1; break; } if (out[0] == 0) return; if (cd32request) - write_log (L"old request still not returned!\n"); + write_log (_T("old request still not returned!\n")); cd32request = request; cd32nextpc = get_long (m68k_areg (regs, 7)); - write_log (L"%s A1=%08X\n", out, request); + write_log (_T("%s A1=%08X\n"), out, request); if (ioreq) { static int cnt = 0; int cmd = get_word (request + 28); @@ -3502,7 +3502,7 @@ static void out_cd32io (uae_u32 pc) activate_debugger (); } #endif - write_log (L"CMD=%d DATA=%08X LEN=%d %OFF=%d PC=%x\n", + write_log (_T("CMD=%d DATA=%08X LEN=%d %OFF=%d PC=%x\n"), cmd, get_long (request + 40), get_long (request + 36), get_long (request + 44), M68K_GETPC); } @@ -3539,11 +3539,11 @@ static void m68k_run_1 (void) #if 0 int pc = m68k_getpc (); if (pc == 0xdff002) - write_log (L"hip\n"); + write_log (_T("hip\n")); if (pc != pcs[0] && (pc < 0xd00000 || pc > 0x1000000)) { memmove (pcs + 1, pcs, 998 * 4); pcs[0] = pc; - //write_log (L"%08X-%04X ", pc, opcode); + //write_log (_T("%08X-%04X "), pc, opcode); } #endif do_cycles (cpu_cycles); @@ -3588,14 +3588,14 @@ static void m68k_run_1_ce (void) m68k_setpc (cputrace.pc); if (!r->stopped) { if (cputrace.state > 1) { - write_log (L"CPU TRACE: EXCEPTION %d\n", cputrace.state); + write_log (_T("CPU TRACE: EXCEPTION %d\n"), cputrace.state); Exception (cputrace.state); } else if (cputrace.state == 1) { - write_log (L"CPU TRACE: %04X\n", cputrace.opcode); + write_log (_T("CPU TRACE: %04X\n"), cputrace.opcode); (*cpufunctbl[cputrace.opcode])(cputrace.opcode); } } else { - write_log (L"CPU TRACE: STOPPED\n"); + write_log (_T("CPU TRACE: STOPPED\n")); } if (r->stopped) set_special (SPCFLAG_STOP); @@ -3643,7 +3643,7 @@ static void m68k_run_1_ce (void) cont: if (cputrace.needendcycles) { cputrace.needendcycles = 0; - write_log (L"STARTCYCLES=%08x ENDCYCLES=%08x\n", cputrace.startcycles, get_cycles ()); + write_log (_T("STARTCYCLES=%08x ENDCYCLES=%08x\n"), cputrace.startcycles, get_cycles ()); log_dma_record (); } @@ -3776,9 +3776,9 @@ static void opcodedebug (uae_u32 pc, uae_u16 opcode, bool full) if (!fault) { TCHAR buf[100]; if (full) - write_log (L"mmufixup=%d %04x %04x\n", mmufixup[0].reg, regs.wb3_status, regs.mmu_ssw); + write_log (_T("mmufixup=%d %04x %04x\n"), mmufixup[0].reg, regs.wb3_status, regs.mmu_ssw); m68k_disasm_2 (buf, sizeof buf / sizeof (TCHAR), addr, NULL, 1, NULL, NULL, 0); - write_log (L"%s\n", buf); + write_log (_T("%s\n"), buf); if (full) m68k_dumpstate (stdout, NULL); } @@ -3804,7 +3804,7 @@ retry: #if 0 static int done; if (pc == 0x16AF94) { -// write_log (L"D0=%d A7=%08x\n", regs.regs[0], regs.regs[15]); +// write_log (_T("D0=%d A7=%08x\n"), regs.regs[0], regs.regs[15]); if (regs.regs[0] == 360) { done = 1; activate_debugger (); @@ -3812,15 +3812,15 @@ retry: } /* if (pc == 0x16B01A) { - write_log (L"-> ERR\n"); + write_log (_T("-> ERR\n")); } if (pc == 0x16B018) { - write_log (L"->\n"); + write_log (_T("->\n")); } */ if (pc == 0x17967C || pc == 0x13b5e2 - 4) { if (done) { - write_log (L"*\n"); + write_log (_T("*\n")); mmu_dump_tables (); activate_debugger (); } @@ -3852,7 +3852,7 @@ retry: // movem to memory? if ((opcode & 0xff80) == 0x4880) { regs.mmu_ssw |= MMU_SSW_CM; - //write_log (L"MMU_SSW_CM\n"); + //write_log (_T("MMU_SSW_CM\n")); } } #endif @@ -3868,7 +3868,7 @@ retry: TRY (prb2) { Exception (prb); } CATCH (prb2) { - write_log (L"MMU: double bus error, rebooting..\n"); + write_log (_T("MMU: double bus error, rebooting..\n")); regs.tcr = 0; m68k_reset (0); m68k_setpc (0xf80002); @@ -4048,7 +4048,7 @@ static void m68k_run_2 (void) #if 0 if (!used[opcode]) { - write_log (L"%04X ", opcode); + write_log (_T("%04X "), opcode); used[opcode] = 1; } #endif @@ -4103,7 +4103,7 @@ void m68k_go (int may_quit) int startup = 1; if (in_m68k_go || !may_quit) { - write_log (L"Bug! m68k_go is not reentrant.\n"); + write_log (_T("Bug! m68k_go is not reentrant.\n")); abort (); } @@ -4151,7 +4151,7 @@ void m68k_go (int may_quit) m68k_reset (hardreset); if (hardreset) { memory_hardreset (); - write_log (L"hardreset, memory cleared\n"); + write_log (_T("hardreset, memory cleared\n")); } #ifdef SAVESTATE /* We may have been restoring state, but we're done now. */ @@ -4204,7 +4204,7 @@ void m68k_go (int may_quit) exception2_handle (regs.panic_pc, regs.panic_addr); if (regs.panic) { /* system is very badly confused */ - write_log (L"double bus error or corrupted stack, forcing reboot..\n"); + write_log (_T("double bus error or corrupted stack, forcing reboot..\n")); regs.panic = 0; uae_reset (1); } @@ -4270,8 +4270,8 @@ static void m68k_verify (uaecptr addr, uaecptr *nextpc) #endif static const TCHAR *ccnames[] = -{ L"T ",L"F ",L"HI",L"LS",L"CC",L"CS",L"NE",L"EQ", -L"VC",L"VS",L"PL",L"MI",L"GE",L"LT",L"GT",L"LE" }; +{ _T("T "),_T("F "),_T("HI"),_T("LS"),_T("CC"),_T("CS"),_T("NE"),_T("EQ"), +_T("VC"),_T("VS"),_T("PL"),_T("MI"),_T("GE"),_T("LT"),_T("GT"),_T("LE") }; static void addmovemreg (TCHAR *out, int *prevreg, int *lastreg, int *first, int reg) { @@ -4282,12 +4282,12 @@ static void addmovemreg (TCHAR *out, int *prevreg, int *lastreg, int *first, int return; } if ((*prevreg) + 1 != reg || (reg & 8) != ((*prevreg & 8))) { - _stprintf (p, L"%s%c%d", (*first) ? L"" : L"/", (*lastreg) < 8 ? 'D' : 'A', (*lastreg) & 7); + _stprintf (p, _T("%s%c%d"), (*first) ? _T("") : _T("/"), (*lastreg) < 8 ? 'D' : 'A', (*lastreg) & 7); p = p + _tcslen (p); if ((*lastreg) + 2 == reg) { - _stprintf (p, L"/%c%d", (*prevreg) < 8 ? 'D' : 'A', (*prevreg) & 7); + _stprintf (p, _T("/%c%d"), (*prevreg) < 8 ? 'D' : 'A', (*prevreg) & 7); } else if ((*lastreg) != (*prevreg)) { - _stprintf (p, L"-%c%d", (*prevreg) < 8 ? 'D' : 'A', (*prevreg) & 7); + _stprintf (p, _T("-%c%d"), (*prevreg) < 8 ? 'D' : 'A', (*prevreg) & 7); } *lastreg = reg; *first = 0; @@ -4341,16 +4341,16 @@ static void disasm_size (TCHAR *instrname, struct instr *dp) switch (dp->size) { case sz_byte: - _tcscat (instrname, L".B "); + _tcscat (instrname, _T(".B ")); break; case sz_word: - _tcscat (instrname, L".W "); + _tcscat (instrname, _T(".W ")); break; case sz_long: - _tcscat (instrname, L".L "); + _tcscat (instrname, _T(".L ")); break; default: - _tcscat (instrname, L" "); + _tcscat (instrname, _T(" ")); break; } } @@ -4381,7 +4381,7 @@ void m68k_disasm_2 (TCHAR *buf, int bufsize, uaecptr addr, uaecptr *nextpc, int for (lookup = lookuptab;lookup->mnemo != dp->mnemo; lookup++) ; - buf = buf_out (buf, &bufsize, L"%08lX ", m68k_getpc () + m68kpc_offset); + buf = buf_out (buf, &bufsize, _T("%08lX "), m68k_getpc () + m68kpc_offset); m68kpc_offset += 2; @@ -4389,7 +4389,7 @@ void m68k_disasm_2 (TCHAR *buf, int bufsize, uaecptr addr, uaecptr *nextpc, int _tcscpy (instrname, lookup->friendlyname); else _tcscpy (instrname, lookup->name); - ccpt = _tcsstr (instrname, L"cc"); + ccpt = _tcsstr (instrname, _T("cc")); if (ccpt != 0) { _tcsncpy (ccpt, ccnames[dp->cc], 2); } @@ -4399,22 +4399,22 @@ void m68k_disasm_2 (TCHAR *buf, int bufsize, uaecptr addr, uaecptr *nextpc, int uae_u16 imm = get_iword_1 (m68kpc_offset); uae_u16 creg = imm & 0x0fff; uae_u16 r = imm >> 12; - TCHAR regs[16], *cname = L"?"; + TCHAR regs[16], *cname = _T("?"); int i; for (i = 0; m2cregs[i].regname; i++) { if (m2cregs[i].regno == creg) break; } - _stprintf (regs, L"%c%d", r >= 8 ? 'A' : 'D', r >= 8 ? r - 8 : r); + _stprintf (regs, _T("%c%d"), r >= 8 ? 'A' : 'D', r >= 8 ? r - 8 : r); if (m2cregs[i].regname) cname = m2cregs[i].regname; if (lookup->mnemo == i_MOVE2C) { _tcscat (instrname, regs); - _tcscat (instrname, L","); + _tcscat (instrname, _T(",")); _tcscat (instrname, cname); } else { _tcscat (instrname, cname); - _tcscat (instrname, L","); + _tcscat (instrname, _T(",")); _tcscat (instrname, regs); } m68kpc_offset += 2; @@ -4422,12 +4422,12 @@ void m68k_disasm_2 (TCHAR *buf, int bufsize, uaecptr addr, uaecptr *nextpc, int newpc = m68k_getpc () + m68kpc_offset; m68kpc_offset += 2; newpc += ShowEA (0, opcode, dp->dreg, dp->dmode, dp->size, instrname, deaddr, safemode); - _tcscat (instrname, L","); + _tcscat (instrname, _T(",")); movemout (instrname, get_iword_1 (oldpc + 2), dp->dmode); } else if (lookup->mnemo == i_MVMLE) { m68kpc_offset += 2; movemout (instrname, get_iword_1 (oldpc + 2), dp->dmode); - _tcscat (instrname, L","); + _tcscat (instrname, _T(",")); newpc = m68k_getpc () + m68kpc_offset; newpc += ShowEA (0, opcode, dp->dreg, dp->dmode, dp->size, instrname, deaddr, safemode); } else { @@ -4436,7 +4436,7 @@ void m68k_disasm_2 (TCHAR *buf, int bufsize, uaecptr addr, uaecptr *nextpc, int newpc += ShowEA (0, opcode, dp->sreg, dp->smode, dp->size, instrname, seaddr, safemode); } if (dp->suse && dp->duse) - _tcscat (instrname, L","); + _tcscat (instrname, _T(",")); if (dp->duse) { newpc = m68k_getpc () + m68kpc_offset; newpc += ShowEA (0, opcode, dp->dreg, dp->dmode, dp->size, instrname, deaddr, safemode); @@ -4444,10 +4444,10 @@ void m68k_disasm_2 (TCHAR *buf, int bufsize, uaecptr addr, uaecptr *nextpc, int } for (i = 0; i < (m68kpc_offset - oldpc) / 2; i++) { - buf = buf_out (buf, &bufsize, L"%04x ", get_iword_1 (oldpc + i * 2)); + buf = buf_out (buf, &bufsize, _T("%04x "), get_iword_1 (oldpc + i * 2)); } while (i++ < 5) - buf = buf_out (buf, &bufsize, L" "); + buf = buf_out (buf, &bufsize, _T(" ")); buf = buf_out (buf, &bufsize, instrname); @@ -4455,15 +4455,15 @@ void m68k_disasm_2 (TCHAR *buf, int bufsize, uaecptr addr, uaecptr *nextpc, int if (deaddr) *deaddr = newpc; if (cctrue (dp->cc)) - buf = buf_out (buf, &bufsize, L" == $%08lX (T)", newpc); + buf = buf_out (buf, &bufsize, _T(" == $%08lX (T)"), newpc); else - buf = buf_out (buf, &bufsize, L" == $%08lX (F)", newpc); + buf = buf_out (buf, &bufsize, _T(" == $%08lX (F)"), newpc); } else if ((opcode & 0xff00) == 0x6100) { /* BSR */ if (deaddr) *deaddr = newpc; - buf = buf_out (buf, &bufsize, L" == $%08lX", newpc); + buf = buf_out (buf, &bufsize, _T(" == $%08lX"), newpc); } - buf = buf_out (buf, &bufsize, L"\n"); + buf = buf_out (buf, &bufsize, _T("\n")); } if (nextpc) *nextpc = m68k_getpc () + m68kpc_offset; @@ -4477,7 +4477,7 @@ void m68k_disasm_ea (void *f, uaecptr addr, uaecptr *nextpc, int cnt, uae_u32 *s if (!buf) return; m68k_disasm_2 (buf, (MAX_LINEWIDTH + 1) * cnt, addr, nextpc, cnt, seaddr, deaddr, 1); - f_out (f, L"%s", buf); + f_out (f, _T("%s"), buf); xfree (buf); } void m68k_disasm (void *f, uaecptr addr, uaecptr *nextpc, int cnt) @@ -4488,7 +4488,7 @@ void m68k_disasm (void *f, uaecptr addr, uaecptr *nextpc, int cnt) if (!buf) return; m68k_disasm_2 (buf, (MAX_LINEWIDTH + 1) * cnt, addr, nextpc, cnt, NULL, NULL, 0); - f_out (f, L"%s", buf); + f_out (f, _T("%s"), buf); xfree (buf); } @@ -4519,15 +4519,15 @@ void sm68k_disasm (TCHAR *instrname, TCHAR *instrcode, uaecptr addr, uaecptr *ne m68kpc_offset += 2; _tcscpy (instrname, lookup->name); - ccpt = _tcsstr (instrname, L"cc"); + ccpt = _tcsstr (instrname, _T("cc")); if (ccpt != 0) { _tcsncpy (ccpt, ccnames[dp->cc], 2); } switch (dp->size){ - case sz_byte: _tcscat (instrname, L".B "); break; - case sz_word: _tcscat (instrname, L".W "); break; - case sz_long: _tcscat (instrname, L".L "); break; - default: _tcscat (instrname, L" "); break; + case sz_byte: _tcscat (instrname, _T(".B ")); break; + case sz_word: _tcscat (instrname, _T(".W ")); break; + case sz_long: _tcscat (instrname, _T(".L ")); break; + default: _tcscat (instrname, _T(" ")); break; } if (dp->suse) { @@ -4535,7 +4535,7 @@ void sm68k_disasm (TCHAR *instrname, TCHAR *instrcode, uaecptr addr, uaecptr *ne newpc += ShowEA (0, opcode, dp->sreg, dp->smode, dp->size, instrname, NULL, 0); } if (dp->suse && dp->duse) - _tcscat (instrname, L","); + _tcscat (instrname, _T(",")); if (dp->duse) { newpc = m68k_getpc () + m68kpc_offset; newpc += ShowEA (0, opcode, dp->dreg, dp->dmode, dp->size, instrname, NULL, 0); @@ -4546,7 +4546,7 @@ void sm68k_disasm (TCHAR *instrname, TCHAR *instrcode, uaecptr addr, uaecptr *ne int i; for (i = 0; i < (m68kpc_offset - oldpc) / 2; i++) { - _stprintf (instrcode, L"%04x ", get_iword_1 (oldpc + i * 2)); + _stprintf (instrcode, _T("%04x "), get_iword_1 (oldpc + i * 2)); instrcode += _tcslen (instrcode); } } @@ -4556,24 +4556,24 @@ void sm68k_disasm (TCHAR *instrname, TCHAR *instrcode, uaecptr addr, uaecptr *ne } struct cpum2c m2cregs[] = { - 0, L"SFC", - 1, L"DFC", - 2, L"CACR", - 3, L"TC", - 4, L"ITT0", - 5, L"ITT1", - 6, L"DTT0", - 7, L"DTT1", - 8, L"BUSC", - 0x800, L"USP", - 0x801, L"VBR", - 0x802, L"CAAR", - 0x803, L"MSP", - 0x804, L"ISP", - 0x805, L"MMUS", - 0x806, L"URP", - 0x807, L"SRP", - 0x808, L"PCR", + 0, _T("SFC"), + 1, _T("DFC"), + 2, _T("CACR"), + 3, _T("TC"), + 4, _T("ITT0"), + 5, _T("ITT1"), + 6, _T("DTT0"), + 7, _T("DTT1"), + 8, _T("BUSC"), + 0x800, _T("USP"), + 0x801, _T("VBR"), + 0x802, _T("CAAR"), + 0x803, _T("MSP"), + 0x804, _T("ISP"), + 0x805, _T("MMUS"), + 0x806, _T("URP"), + 0x807, _T("SRP"), + 0x808, _T("PCR"), -1, NULL }; @@ -4631,12 +4631,12 @@ void m68k_dumpstate (void *f, uaecptr *nextpc) int i, j; for (i = 0; i < 8; i++){ - f_out (f, L" D%d %08lX ", i, m68k_dreg (regs, i)); - if ((i & 3) == 3) f_out (f, L"\n"); + f_out (f, _T(" D%d %08lX "), i, m68k_dreg (regs, i)); + if ((i & 3) == 3) f_out (f, _T("\n")); } for (i = 0; i < 8; i++){ - f_out (f, L" A%d %08lX ", i, m68k_areg (regs, i)); - if ((i & 3) == 3) f_out (f, L"\n"); + f_out (f, _T(" A%d %08lX "), i, m68k_areg (regs, i)); + if ((i & 3) == 3) f_out (f, _T("\n")); } if (regs.s == 0) regs.usp = m68k_areg (regs, 7); @@ -4645,20 +4645,20 @@ void m68k_dumpstate (void *f, uaecptr *nextpc) if (regs.s && regs.m == 0) regs.isp = m68k_areg (regs, 7); j = 2; - f_out (f, L"USP %08X ISP %08X ", regs.usp, regs.isp); + f_out (f, _T("USP %08X ISP %08X "), regs.usp, regs.isp); for (i = 0; m2cregs[i].regno>= 0; i++) { if (!movec_illg (m2cregs[i].regno)) { - if (!_tcscmp (m2cregs[i].regname, L"USP") || !_tcscmp (m2cregs[i].regname, L"ISP")) + if (!_tcscmp (m2cregs[i].regname, _T("USP")) || !_tcscmp (m2cregs[i].regname, _T("ISP"))) continue; if (j > 0 && (j % 4) == 0) - f_out (f, L"\n"); - f_out (f, L"%-4s %08X ", m2cregs[i].regname, val_move2c (m2cregs[i].regno)); + f_out (f, _T("\n")); + f_out (f, _T("%-4s %08X "), m2cregs[i].regname, val_move2c (m2cregs[i].regno)); j++; } } if (j > 0) - f_out (f, L"\n"); - f_out (f, L"T=%d%d S=%d M=%d X=%d N=%d Z=%d V=%d C=%d IMASK=%d STP=%d\n", + f_out (f, _T("\n")); + f_out (f, _T("T=%d%d S=%d M=%d X=%d N=%d Z=%d V=%d C=%d IMASK=%d STP=%d\n"), regs.t1, regs.t0, regs.s, regs.m, GET_XFLG (), GET_NFLG (), GET_ZFLG (), GET_VFLG (), GET_CFLG (), @@ -4667,12 +4667,12 @@ void m68k_dumpstate (void *f, uaecptr *nextpc) if (currprefs.fpu_model) { uae_u32 fpsr; for (i = 0; i < 8; i++){ - f_out (f, L"FP%d: %g ", i, regs.fp[i]); + f_out (f, _T("FP%d: %g "), i, regs.fp[i]); if ((i & 3) == 3) - f_out (f, L"\n"); + f_out (f, _T("\n")); } fpsr = get_fpsr (); - f_out (f, L"N=%d Z=%d I=%d NAN=%d\n", + f_out (f, _T("N=%d Z=%d I=%d NAN=%d\n"), (fpsr & 0x8000000) != 0, (fpsr & 0x4000000) != 0, (fpsr & 0x2000000) != 0, @@ -4686,12 +4686,12 @@ void m68k_dumpstate (void *f, uaecptr *nextpc) for (lookup1 = lookuptab; lookup1->mnemo != dp->mnemo; lookup1++); dp = table68k + regs.ir; for (lookup2 = lookuptab; lookup2->mnemo != dp->mnemo; lookup2++); - f_out (f, L"Prefetch %04x (%s) %04x (%s)\n", regs.irc, lookup1->name, regs.ir, lookup2->name); + f_out (f, _T("Prefetch %04x (%s) %04x (%s)\n"), regs.irc, lookup1->name, regs.ir, lookup2->name); } m68k_disasm (f, m68k_getpc (), nextpc, 1); if (nextpc) - f_out (f, L"Next PC: %08lx\n", *nextpc); + f_out (f, _T("Next PC: %08lx\n"), *nextpc); } #ifdef SAVESTATE @@ -4810,8 +4810,8 @@ uae_u8 *restore_cpu (uae_u8 *src) } } - write_log (L"CPU: %d%s%03d, PC=%08X\n", - model / 1000, flags & 1 ? L"EC" : L"", model % 1000, regs.pc); + write_log (_T("CPU: %d%s%03d, PC=%08X\n"), + model / 1000, flags & 1 ? _T("EC") : _T(""), model % 1000, regs.pc); return src; } @@ -4860,7 +4860,7 @@ uae_u8 *save_cpu_trace (int *len, uae_u8 *dstptr) save_u32 (cputrace.readcounter); save_u32 (cputrace.writecounter); save_u32 (cputrace.memoryoffset); - write_log (L"CPUT SAVE: PC=%08x C=%08X %08x %08x %08x %d %d %d\n", + write_log (_T("CPUT SAVE: PC=%08x C=%08X %08x %08x %08x %d %d %d\n"), cputrace.pc, cputrace.startcycles, cputrace.cyclecounter, cputrace.cyclecounter_pre, cputrace.cyclecounter_post, cputrace.readcounter, cputrace.writecounter, cputrace.memoryoffset); @@ -4868,7 +4868,7 @@ uae_u8 *save_cpu_trace (int *len, uae_u8 *dstptr) save_u32 (cputrace.ctm[i].addr); save_u32 (cputrace.ctm[i].data); save_u32 (cputrace.ctm[i].mode); - write_log (L"CPUT%d: %08x %08x %08x\n", i, cputrace.ctm[i].addr, cputrace.ctm[i].data, cputrace.ctm[i].mode); + write_log (_T("CPUT%d: %08x %08x %08x\n"), i, cputrace.ctm[i].addr, cputrace.ctm[i].data, cputrace.ctm[i].mode); } save_u32 (cputrace.startcycles); *len = dst - dstbak; @@ -5085,7 +5085,7 @@ uae_u8 *restore_mmu (uae_u8 *src) changed_prefs.mmu_model = model = restore_u32 (); flags = restore_u32 (); - write_log (L"MMU: %d\n", model); + write_log (_T("MMU: %d\n"), model); return src; } @@ -5121,7 +5121,7 @@ void exception3i (uae_u32 opcode, uaecptr addr) void exception2 (uaecptr addr) { - write_log (L"delayed exception2!\n"); + write_log (_T("delayed exception2!\n")); regs.panic_pc = m68k_getpc (); regs.panic_addr = addr; regs.panic = 2; @@ -5151,7 +5151,7 @@ void cpureset (void) custom_reset (0); return; } - write_log (L"M68K RESET PC=%x, rebooting..\n", pc); + write_log (_T("M68K RESET PC=%x, rebooting..\n"), pc); custom_reset (0); m68k_setpc (ksboot); return; @@ -5161,14 +5161,14 @@ void cpureset (void) if ((ins & ~7) == 0x4ed0) { int reg = ins & 7; uae_u32 addr = m68k_areg (regs, reg); - write_log (L"reset/jmp (ax) combination emulated -> %x\n", addr); + write_log (_T("reset/jmp (ax) combination emulated -> %x\n"), addr); custom_reset (0); if (addr < 0x80000) addr += 0xf80000; m68k_setpc (addr - 2); return; } - write_log (L"M68K RESET PC=%x, rebooting..\n", pc); + write_log (_T("M68K RESET PC=%x, rebooting..\n"), pc); custom_reset (0); m68k_setpc (ksboot); } @@ -5514,9 +5514,9 @@ void write_dcache030 (uaecptr addr, uae_u32 val, int size) #if 0 uaecptr a = 0x1db0c; if (addr - (1 << size) + 1 <= a && addr + (1 << size) >= a) { - write_log (L"%08x %d %d %08x %08x %d\n", addr, aligned, size, val, tag1, lws1); + write_log (_T("%08x %d %d %08x %08x %d\n"), addr, aligned, size, val, tag1, lws1); if (aligned == 2) - write_log (L"*\n"); + write_log (_T("*\n")); } #endif @@ -5590,7 +5590,7 @@ uae_u32 read_dcache030 (uaecptr addr, int size) } else { v1 = c1->data[lws1]; if (get_long (addr) != v1) { - write_log (L"data cache mismatch %d %d %08x %08x != %08x %08x %d PC=%08x\n", + write_log (_T("data cache mismatch %d %d %08x %08x != %08x %08x %d PC=%08x\n"), size, aligned, addr, get_long (addr), v1, tag1, lws1, M68K_GETPC); v1 = get_long (addr); } @@ -5614,7 +5614,7 @@ uae_u32 read_dcache030 (uaecptr addr, int size) } else { v2 = c2->data[lws2]; if (get_long (addr) != v2) { - write_log (L"data cache mismatch %d %d %08x %08x != %08x %08x %d PC=%08x\n", + write_log (_T("data cache mismatch %d %d %08x %08x != %08x %08x %d PC=%08x\n"), size, aligned, addr, get_long (addr), v2, tag2, lws2, M68K_GETPC); v2 = get_long (addr); } @@ -5628,7 +5628,7 @@ uae_u32 read_dcache030 (uaecptr addr, int size) else if (size == 2 && aligned == 3) return (v1 << 24) | (v2 >> 8); - write_log (L"dcache030 weirdness!?\n"); + write_log (_T("dcache030 weirdness!?\n")); return 0; } diff --git a/od-win32/WinUAE_Install.nsi b/od-win32/WinUAE_Install.nsi index 94de6707..b096b95a 100644 --- a/od-win32/WinUAE_Install.nsi +++ b/od-win32/WinUAE_Install.nsi @@ -1,5 +1,5 @@ !define PRODUCT_NAME "WinUAE" -!define PRODUCT_VERSION "2.3.3" +!define PRODUCT_VERSION "2.4.0" !define PRODUCT_PUBLISHER "Arabuusimiehet" !define PRODUCT_WEB_SITE "http://www.winuae.net/" !define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\winuae.exe" diff --git a/od-win32/ahidsound_dsonly.cpp b/od-win32/ahidsound_dsonly.cpp index ddb27837..02eca16f 100644 --- a/od-win32/ahidsound_dsonly.cpp +++ b/od-win32/ahidsound_dsonly.cpp @@ -154,9 +154,9 @@ void ahi_close_sound (void) if (lpDSB2) { hr = IDirectSoundBuffer_Stop (lpDSB2); if(FAILED (hr)) - write_log (L"AHI: SoundStop() failure: %s\n", DXError (hr)); + write_log (_T("AHI: SoundStop() failure: %s\n"), DXError (hr)); } else { - write_log (L"AHI: Sound Stopped...\n"); + write_log (_T("AHI: Sound Stopped...\n")); } if (lpDSB2) @@ -220,7 +220,7 @@ void ahi_updatesound(int force) hr = lpDSB2->Lock (oldpos, amigablksize * 4, &dwData1, &dwBytes1, &dwData2, &dwBytes2, 0); if(hr == DSERR_BUFFERLOST) { - write_log (L"AHI: lostbuf %d %x\n", pos, amigablksize); + write_log (_T("AHI: lostbuf %d %x\n"), pos, amigablksize); IDirectSoundBuffer_Restore (lpDSB2); hr = lpDSB2->Lock (oldpos, amigablksize * 4, &dwData1, &dwBytes1, &dwData2, &dwBytes2, 0); } @@ -272,7 +272,7 @@ static int ahi_init_record_win32 (void) // Record begin hr = DirectSoundCaptureCreate (NULL, &lpDS2r, NULL); if (FAILED (hr)) { - write_log (L"AHI: DirectSoundCaptureCreate() failure: %s\n", DXError (hr)); + write_log (_T("AHI: DirectSoundCaptureCreate() failure: %s\n"), DXError (hr)); record_enabled = -1; return 0; } @@ -284,19 +284,19 @@ static int ahi_init_record_win32 (void) hr = IDirectSoundCapture_CreateCaptureBuffer (lpDS2r, &sound_buffer_rec, &lpDSB2r, NULL); if (FAILED (hr)) { - write_log (L"AHI: CreateCaptureSoundBuffer() failure: %s\n", DXError(hr)); + write_log (_T("AHI: CreateCaptureSoundBuffer() failure: %s\n"), DXError(hr)); record_enabled = -1; return 0; } hr = IDirectSoundCaptureBuffer_Start (lpDSB2r, DSCBSTART_LOOPING); if (FAILED (hr)) { - write_log (L"AHI: DirectSoundCaptureBuffer_Start failed: %s\n", DXError (hr)); + write_log (_T("AHI: DirectSoundCaptureBuffer_Start failed: %s\n"), DXError (hr)); record_enabled = -1; return 0; } record_enabled = 1; - write_log (L"AHI: Init AHI Audio Recording \n"); + write_log (_T("AHI: Init AHI Audio Recording \n")); return 1; } @@ -307,7 +307,7 @@ void setvolume_ahi (LONG vol) return; hr = IDirectSoundBuffer_SetVolume (lpDSB2, vol); if (FAILED (hr)) - write_log (L"AHI: SetVolume(%d) failed: %s\n", vol, DXError (hr)); + write_log (_T("AHI: SetVolume(%d) failed: %s\n"), vol, DXError (hr)); } static int ahi_init_sound_win32 (void) @@ -328,7 +328,7 @@ static int ahi_init_sound_win32 (void) wavfmt.nAvgBytesPerSec = wavfmt.nBlockAlign * sound_freq_ahi; wavfmt.cbSize = 0; - write_log (L"AHI: Init AHI Sound Rate %d, Channels %d, Bits %d, Buffsize %d\n", + write_log (_T("AHI: Init AHI Sound Rate %d, Channels %d, Bits %d, Buffsize %d\n"), sound_freq_ahi, sound_channels_ahi, sound_bits_ahi, amigablksize); if (!amigablksize) @@ -343,7 +343,7 @@ static int ahi_init_sound_win32 (void) else hr = DirectSoundCreate (&sound_devices[currprefs.win32_soundcard]->guid, &lpDS2, NULL); if (FAILED (hr)) { - write_log (L"AHI: DirectSoundCreate() failure: %s\n", DXError (hr)); + write_log (_T("AHI: DirectSoundCreate() failure: %s\n"), DXError (hr)); return 0; } memset (&sound_buffer, 0, sizeof (DSBUFFERDESC)); @@ -356,18 +356,18 @@ static int ahi_init_sound_win32 (void) hr = IDirectSound_GetCaps (lpDS2, &DSCaps); if (SUCCEEDED (hr)) { if (DSCaps.dwFlags & DSCAPS_EMULDRIVER) - write_log (L"AHI: Your DirectSound Driver is emulated via WaveOut - yuck!\n"); + write_log (_T("AHI: Your DirectSound Driver is emulated via WaveOut - yuck!\n")); } if (FAILED (IDirectSound_SetCooperativeLevel (lpDS2, hMainWnd, DSSCL_PRIORITY))) return 0; hr = IDirectSound_CreateSoundBuffer (lpDS2, &sound_buffer, &lpDSBprimary2, NULL); if (FAILED (hr)) { - write_log (L"AHI: CreateSoundBuffer() failure: %s\n", DXError(hr)); + write_log (_T("AHI: CreateSoundBuffer() failure: %s\n"), DXError(hr)); return 0; } hr = IDirectSoundBuffer_SetFormat (lpDSBprimary2, &wavfmt); if (FAILED (hr)) { - write_log (L"AHI: SetFormat() failure: %s\n", DXError (hr)); + write_log (_T("AHI: SetFormat() failure: %s\n"), DXError (hr)); return 0; } sound_buffer.dwBufferBytes = ahisndbufsize; @@ -377,7 +377,7 @@ static int ahi_init_sound_win32 (void) sound_buffer.guid3DAlgorithm = GUID_NULL; hr = IDirectSound_CreateSoundBuffer (lpDS2, &sound_buffer, &lpDSB2, NULL); if (FAILED (hr)) { - write_log (L"AHI: CreateSoundBuffer() failure: %s\n", DXError (hr)); + write_log (_T("AHI: CreateSoundBuffer() failure: %s\n"), DXError (hr)); return 0; } @@ -385,7 +385,7 @@ static int ahi_init_sound_win32 (void) hr = IDirectSoundBuffer_GetFormat (lpDSBprimary2,&wavfmt,500,0); if (FAILED (hr)) { - write_log (L"AHI: GetFormat() failure: %s\n", DXError (hr)); + write_log (_T("AHI: GetFormat() failure: %s\n"), DXError (hr)); return 0; } @@ -653,28 +653,28 @@ uae_u32 REGPARAM2 ahi_demux (TrapContext *context) _tcscpy (newdllpath, dpath + _tcslen (start_path_data)); if (!_tcsncmp (newdllpath, dlldir, _tcslen (dlldir))) /* remove "winuae_dll" */ _tcscpy (newdllpath, dpath + _tcslen (start_path_data) + 1 + _tcslen (dlldir)); - _stprintf (dpath, L"%s%s%s", start_path_data, WIN32_PLUGINDIR, newdllpath); + _stprintf (dpath, _T("%s%s%s"), start_path_data, WIN32_PLUGINDIR, newdllpath); h = LoadLibrary (dpath); if (h == NULL) - write_log (L"native open: '%s' = %d\n", dpath, GetLastError ()); + write_log (_T("native open: '%s' = %d\n"), dpath, GetLastError ()); if (h == NULL) { - _stprintf (dpath, L"%s%s\\%s", start_path_data, dlldir, newdllpath); + _stprintf (dpath, _T("%s%s\\%s"), start_path_data, dlldir, newdllpath); h = LoadLibrary (dllname); if (h == NULL) - write_log (L"fallback native open: '%s' = %d\n", dpath, GetLastError ()); + write_log (_T("fallback native open: '%s' = %d\n"), dpath, GetLastError ()); } } else { - write_log (L"native open outside of installation dir '%s'!\n", dpath); + write_log (_T("native open outside of installation dir '%s'!\n"), dpath); } xfree (dllname); #if 0 if (h == NULL) { h = LoadLibrary (filepart); - write_log (L"native file open: '%s' = %p\n", filepart, h); + write_log (_T("native file open: '%s' = %p\n"), filepart, h); if (h == NULL) { _stprintf (dpath, "%s%s%s", start_path_data, WIN32_PLUGINDIR, filepart); h = LoadLibrary (dpath); - write_log (L"native path open: '%s' = %p\n", dpath, h); + write_log (_T("native path open: '%s' = %p\n"), dpath, h); } } #endif diff --git a/od-win32/ahidsound_new.cpp b/od-win32/ahidsound_new.cpp index 9c50e49e..d810441a 100644 --- a/od-win32/ahidsound_new.cpp +++ b/od-win32/ahidsound_new.cpp @@ -533,7 +533,7 @@ static void setevent (struct DSAHI *dsahip) t = (evt)(cycles / f); if (dsahip->evttime == t) return; - write_log (L"AHI: playerfunc freq = %.2fHz\n", f); + write_log (_T("AHI: playerfunc freq = %.2fHz\n"), f); dsahip->evttime = t; if (t < 10) return; @@ -555,8 +555,8 @@ static int alError (const TCHAR *format,...) return 0; va_start (parms, format); _vsntprintf (buffer, sizeof buffer -1, format, parms); - _stprintf (buffer + _tcslen (buffer), L": ERR=%x\n", err); - write_log (L"%s", buffer); + _stprintf (buffer + _tcslen (buffer), _T(": ERR=%x\n"), err); + write_log (_T("%s"), buffer); return err; } @@ -599,7 +599,7 @@ static void ds_free (struct DSAHI *dsahip) alcCloseDevice (dsahip->al_dev); dsahip->al_dev = 0; if (ahi_debug && ahi_active) - write_log (L"AHI: OpenAL freed\n"); + write_log (_T("AHI: OpenAL freed\n")); ahi_active = 0; } @@ -645,7 +645,7 @@ static int ds_init_record (struct DSAHI *dsahip) return 1; error: if (ahi_debug) - write_log (L"AHI: OPENAL recording initialization failed\n"); + write_log (_T("AHI: OPENAL recording initialization failed\n")); return 0; } @@ -700,18 +700,18 @@ static int ds_init (struct DSAHI *dsahip) dsahip->bytespersampleout = dsahip->bitspersampleout / 8; dsahip->channellength = 65536 * dsahip->chout * dsahip->bytespersampleout; if (ahi_debug) - write_log (L"AHI: CH=%d BLEN=%d\n", + write_log (_T("AHI: CH=%d BLEN=%d\n"), dsahip->chout, dsahip->channellength); dsahip->tmpbuffer_size = 1000000; dsahip->tmpbuffer = xmalloc (uae_u8, dsahip->tmpbuffer_size); if (ahi_debug) - write_log (L"AHI: OpenAL initialized: %s\n", sound_devices[dsahip->output]->name); + write_log (_T("AHI: OpenAL initialized: %s\n"), sound_devices[dsahip->output]->name); return 1; error: if (ahi_debug) - write_log (L"AHI: OpenAL initialization failed\n"); + write_log (_T("AHI: OpenAL initialization failed\n")); ds_free (dsahip); return 0; } @@ -729,7 +729,7 @@ static void ds_setvolume (struct DSAHI *dsahip, struct dschannel *dc) float vol = ((float)(abs (dc->csnext.volume))) / 65536.0; alClear (); alSourcef (dc->al_source, AL_GAIN, vol); - alError (L"AHI: SetVolume(%d,%d)", dc->num, vol); + alError (_T("AHI: SetVolume(%d,%d)"), dc->num, vol); } if (abs (dc->cs.panning) != abs (dc->csnext.panning)) { ;// pan = (abs (dc->csnext.panning) - 0x8000) * DSBPAN_RIGHT / 32768; @@ -744,7 +744,7 @@ static void ds_setfreq (struct DSAHI *dsahip, struct dschannel *dc) if (dc->dsplaying && dc->cs.frequency != dc->csnext.frequency && dc->csnext.frequency > 0 && dc->al_source != -1) { //alClear (); //alSourcei (dc->al_source, AL_FREQUENCY, dc->csnext.frequency); - //alError (L"AHI: SetFrequency(%d,%d)", dc->num, dc->csnext.frequency); + //alError (_T("AHI: SetFrequency(%d,%d)"), dc->num, dc->csnext.frequency); } dc->cs.frequency = dc->csnext.frequency; } @@ -755,7 +755,7 @@ static int ds_allocchannel (struct DSAHI *dsahip, struct dschannel *dc) return 1; alClear (); alGenSources (1, &dc->al_source); - if (alError (L"alGenSources()")) + if (alError (_T("alGenSources()"))) goto error; dc->cs.frequency = -1; dc->cs.volume = -1; @@ -763,7 +763,7 @@ static int ds_allocchannel (struct DSAHI *dsahip, struct dschannel *dc) ds_setvolume (dsahip, dc); ds_setfreq (dsahip, dc); if (ahi_debug) - write_log (L"AHI: allocated OpenAL source for channel %d. vol=%d pan=%d freq=%d\n", + write_log (_T("AHI: allocated OpenAL source for channel %d. vol=%d pan=%d freq=%d\n"), dc->num, dc->cs.volume, dc->cs.panning, dc->cs.frequency); return 1; error: @@ -995,14 +995,14 @@ static void al_setloop (struct dschannel *dc, int state) { alClear (); alSourcei (dc->al_source, AL_LOOPING, state ? AL_TRUE : AL_FALSE); - alError (L"AHI: ds_play() alSourcei(AL_LOOPING)"); + alError (_T("AHI: ds_play() alSourcei(AL_LOOPING)")); } static void al_startplay (struct dschannel *dc) { alClear (); alSourcePlay (dc->al_source); - alError (L"AHI: ds_play() alSourcePlay"); + alError (_T("AHI: ds_play() alSourcePlay")); } static void preparesample_single (struct DSAHI *dsahip, struct dschannel *dc) @@ -1023,12 +1023,12 @@ static void preparesample_single (struct DSAHI *dsahip, struct dschannel *dc) dlen = copysampledata (dsahip, dc, ds, &p, pe, ps, dsahip->tmpbuffer, slen); alClear (); alBufferData (ds->al_buffer[dc->buffertoggle], dsahip->al_bufferformat, dsahip->tmpbuffer, dlen, dc->cs.frequency); - alError (L"AHI: preparesample_single:alBufferData(len=%d,freq=%d)", dlen, dc->cs.frequency); + alError (_T("AHI: preparesample_single:alBufferData(len=%d,freq=%d)"), dlen, dc->cs.frequency); alClear (); alSourceQueueBuffers (dc->al_source, 1, &ds->al_buffer[dc->buffertoggle]); - alError (L"AHI: al_initsample_single:alSourceQueueBuffers(freq=%d)", dc->cs.frequency); + alError (_T("AHI: al_initsample_single:alSourceQueueBuffers(freq=%d)"), dc->cs.frequency); if (ahi_debug > 2) - write_log (L"AHI: sample queued %d: %d/%d\n", + write_log (_T("AHI: sample queued %d: %d/%d\n"), dc->num, dc->samplecounter, dc->totalsamples); } @@ -1051,12 +1051,12 @@ static void preparesample_multi (struct DSAHI *dsahip, struct dschannel *dc) dlen = copysampledata (dsahip, dc, ds, &p, pe, ps, dsahip->tmpbuffer, slen); alClear (); alBufferData (ds->al_buffer[dc->buffertoggle], dsahip->al_bufferformat, dsahip->tmpbuffer, dlen, dc->cs.frequency); - alError (L"AHI: preparesample:alBufferData(len=%d,freq=%d)", dlen, dc->cs.frequency); + alError (_T("AHI: preparesample:alBufferData(len=%d,freq=%d)"), dlen, dc->cs.frequency); alClear (); alSourceQueueBuffers (dc->al_source, 1, &ds->al_buffer[dc->buffertoggle]); - alError (L"AHI: al_initsample:alSourceQueueBuffers(freq=%d)", dc->cs.frequency); + alError (_T("AHI: al_initsample:alSourceQueueBuffers(freq=%d)"), dc->cs.frequency); if (ahi_debug > 2) - write_log (L"AHI: sample queued %d: %d/%d\n", + write_log (_T("AHI: sample queued %d: %d/%d\n"), dc->num, dc->samplecounter, dc->totalsamples); dc->samplecounter++; dc->buffertoggle ^= 1; @@ -1072,7 +1072,7 @@ static void al_initsample (struct DSAHI *dsahip, struct dschannel *dc) alSourceStop (dc->al_source); alClear (); alSourcei (dc->al_source, AL_BUFFER, AL_NONE); - alError (L"AHI: al_initsample:AL_BUFFER=AL_NONE"); + alError (_T("AHI: al_initsample:AL_BUFFER=AL_NONE")); memcpy (&dc->cs, &dc->csnext, sizeof (struct chsample)); dc->csnext.ds = NULL; @@ -1128,14 +1128,14 @@ static void al_queuesample (struct DSAHI *dsahip, struct dschannel *dc) if (dc->dsplaying) { alClear (); alGetSourcei (dc->al_source, AL_SOURCE_STATE, &v); - alError (L"AHI: queuesample AL_SOURCE_STATE"); + alError (_T("AHI: queuesample AL_SOURCE_STATE")); if (v != AL_PLAYING) { alClear (); alSourceRewind (dc->al_source); - alError (L"AHI: queuesample:restart"); + alError (_T("AHI: queuesample:restart")); restart = 1; if (ahi_debug > 2) - write_log (L"AHI: queuesample, play restart\n"); + write_log (_T("AHI: queuesample, play restart\n")); preparesample_multi (dsahip, dc); } } @@ -1145,7 +1145,7 @@ static void al_queuesample (struct DSAHI *dsahip, struct dschannel *dc) if (restart) al_startplay (dc); if (ahi_debug > 2) - write_log (L"AHI: sample %d queued to channel %d\n", dc->cs.ds->num, dc->num); + write_log (_T("AHI: sample %d queued to channel %d\n"), dc->cs.ds->num, dc->num); } static int unqueuebuffers (struct dschannel *dc) @@ -1155,7 +1155,7 @@ static int unqueuebuffers (struct dschannel *dc) ALuint tmp; alClear (); alGetSourcei (dc->al_source, AL_BUFFERS_PROCESSED, &v); - if (alError (L"AHI: hsync AL_BUFFERS_PROCESSED %d", dc->num)) + if (alError (_T("AHI: hsync AL_BUFFERS_PROCESSED %d"), dc->num)) return cnt; if (v == 0) return cnt; @@ -1197,12 +1197,12 @@ void ahi_hsync (void) v = 0; alClear (); alGetSourcei (dc->al_source, AL_SOURCE_STATE, &v); - alError (L"AHI: hsync AL_SOURCE_STATE"); + alError (_T("AHI: hsync AL_SOURCE_STATE")); if (v != AL_PLAYING) { if (dc->cs.ds) { setchannelevent (dsahip, dc); if (ahi_debug) - write_log (L"AHI: ********* channel %d stopped state=%d!\n", dc->num, v); + write_log (_T("AHI: ********* channel %d stopped state=%d!\n"), dc->num, v); removed = 1; dc->dsplaying = 2; dc->waitforack = 0; @@ -1211,11 +1211,11 @@ void ahi_hsync (void) if (!dc->waitforack && dc->samplecounter >= 0 && removed) { int evt = 0; if (ahi_debug > 2) - write_log (L"sample end channel %d: %d/%d\n", dc->num, dc->samplecounter, dc->totalsamples); + write_log (_T("sample end channel %d: %d/%d\n"), dc->num, dc->samplecounter, dc->totalsamples); if (dc->samplecounter >= dc->totalsamples) { evt = 1; if (ahi_debug > 2) - write_log (L"sample finished channel %d: %d\n", dc->num, dc->totalsamples); + write_log (_T("sample finished channel %d: %d\n"), dc->num, dc->totalsamples); dc->samplecounter = 0; if (dc->csnext.ds) { memcpy (&dc->cs, &dc->csnext, sizeof (struct chsample)); @@ -1250,7 +1250,7 @@ static void ds_record (struct DSAHI *dsahip, int start) alcCaptureStop (dsahip->al_recorddev); dsahip->dsrecording = 0; } - alError (L"AHI: alcCapture%s failed", start ? "Start" : "Stop"); + alError (_T("AHI: alcCapture%s failed"), start ? "Start" : "Stop"); } static void ds_stop (struct DSAHI *dsahip, struct dschannel *dc) @@ -1259,10 +1259,10 @@ static void ds_stop (struct DSAHI *dsahip, struct dschannel *dc) if (dc->al_source == -1) return; if (ahi_debug) - write_log (L"AHI: ds_stop(%d)\n", dc->num); + write_log (_T("AHI: ds_stop(%d)\n"), dc->num); alClear (); alSourceStop (dc->al_source); - alError (L"AHI: alSourceStop"); + alError (_T("AHI: alSourceStop")); unqueuebuffers (dc); } @@ -1278,7 +1278,7 @@ static void ds_play (struct DSAHI *dsahip, struct dschannel *dc) if (dc->al_source == -1) return; if (ahi_debug) - write_log (L"AHI: ds_play(%d)\n", dc->num); + write_log (_T("AHI: ds_play(%d)\n"), dc->num); al_startplay (dc); } @@ -1308,9 +1308,9 @@ static uae_u32 init (TrapContext *ctx) int i, j; enumerate_sound_devices (); - xahi_author = ds (L"Toni Wilen"); - xahi_copyright = ds (L"GPL"); - xahi_version = ds (L"uae2 0.2 (xx.xx.2008)\r\n"); + xahi_author = ds (_T("Toni Wilen")); + xahi_copyright = ds (_T("GPL")); + xahi_version = ds (_T("uae2 0.2 (xx.xx.2008)\r\n")); j = 0; for (i = 0; i < MAX_SOUND_DEVICES && sound_devices[i]; i++) { if (sound_devices[i]->type == SOUND_DEVICE_AL) @@ -1337,22 +1337,22 @@ static uae_u32 AHIsub_AllocAudio (TrapContext *ctx) struct DSAHI *dsahip = &dsahi[0]; if (ahi_debug) - write_log (L"AHI: AllocAudio(%08x,%08x)\n", tags, audioctrl); + write_log (_T("AHI: AllocAudio(%08x,%08x)\n"), tags, audioctrl); ver = get_long (pbase + pub_Version); size = get_long (pbase + pub_SizeOf); if (ver != AHI_STRUCT_VERSION) { - gui_message (L"AHI: Incompatible DEVS:AHI/uae2.audio\nVersion mismatch %d<>%d.", ver, AHI_STRUCT_VERSION); + gui_message (_T("AHI: Incompatible DEVS:AHI/uae2.audio\nVersion mismatch %d<>%d."), ver, AHI_STRUCT_VERSION); return AHISF_ERROR; } if (size < pub_End) { - gui_message (L"AHI: Incompatible DEVS:AHI/uae2.audio.\nInternal structure size %d<>%d.", size, pub_End); + gui_message (_T("AHI: Incompatible DEVS:AHI/uae2.audio.\nInternal structure size %d<>%d."), size, pub_End); return AHISF_ERROR; } v = get_long (pbase + pub_Index); if (v != -1) { - write_log (L"AHI: corrupted memory\n"); + write_log (_T("AHI: corrupted memory\n")); return AHISF_ERROR; } put_long (pbase + pub_Index, dsahip - dsahi); @@ -1365,7 +1365,7 @@ static uae_u32 AHIsub_AllocAudio (TrapContext *ctx) dsahip->audioid = 0x003b0001; while ((tag = gettag (&tags, &data))) { if (ahi_debug) - write_log (L"- TAG %08x=%d: %08x=%u\n", tag, tag & 0x7fff, data, data); + write_log (_T("- TAG %08x=%d: %08x=%u\n"), tag, tag & 0x7fff, data, data); switch (tag) { case AHIA_AudioID: @@ -1410,7 +1410,7 @@ static void AHIsub_Disable (TrapContext *ctx) uae_u32 audioctrl = m68k_areg (regs, 2); struct DSAHI *dsahip = GETAHI; if (ahi_debug > 1) - write_log (L"AHI: Disable(%08x)\n", audioctrl); + write_log (_T("AHI: Disable(%08x)\n"), audioctrl); dsahip->enabledisable++; } @@ -1419,7 +1419,7 @@ static void AHIsub_Enable (TrapContext *ctx) uae_u32 audioctrl = m68k_areg (regs, 2); struct DSAHI *dsahip = GETAHI; if (ahi_debug > 1) - write_log (L"AHI: Enable(%08x)\n", audioctrl); + write_log (_T("AHI: Enable(%08x)\n"), audioctrl); dsahip->enabledisable--; if (dsahip->enabledisable == 0 && dsahip->playing) setevent (dsahip); @@ -1431,7 +1431,7 @@ static void AHIsub_FreeAudio (TrapContext *ctx) uae_u32 pbase = get_long (audioctrl + ahiac_DriverData); struct DSAHI *dsahip = GETAHI; if (ahi_debug) - write_log (L"AHI: FreeAudio(%08x)\n", audioctrl); + write_log (_T("AHI: FreeAudio(%08x)\n"), audioctrl); if (ahi_active == 0) return; ahi_active = 0; @@ -1537,7 +1537,7 @@ static uae_u32 AHIsub_GetAttr (TrapContext *ctx) v = getattr2 (dsahip, attribute, argument, def); if (ahi_debug) - write_log (L"AHI: GetAttr(%08x=%d,%08x,%08x)=%08x\n", attribute, attribute & 0x7fff, argument, def, v); + write_log (_T("AHI: GetAttr(%08x=%d,%08x,%08x)=%08x\n"), attribute, attribute & 0x7fff, argument, def, v); return v; } @@ -1549,7 +1549,7 @@ static uae_u32 AHIsub_HardwareControl (TrapContext *ctx) uae_u32 audioctrl = m68k_areg (regs, 2); struct DSAHI *dsahip = GETAHI; if (ahi_debug) - write_log (L"AHI: HardwareControl(%08x=%d,%08x,%08x)\n", attribute, attribute & 0x7fff, argument, audioctrl); + write_log (_T("AHI: HardwareControl(%08x=%d,%08x,%08x)\n"), attribute, attribute & 0x7fff, argument, audioctrl); switch (attribute) { case AHIC_Input: @@ -1586,7 +1586,7 @@ static uae_u32 AHIsub_Start (TrapContext *ctx) int i; if (ahi_debug) - write_log (L"AHI: Play(%08x,%08x)\n", + write_log (_T("AHI: Play(%08x,%08x)\n"), flags, audioctrl); if ((flags & AHISF_PLAY) && !dsahip->playing) { dsahip->playing = 1; @@ -1612,7 +1612,7 @@ static uae_u32 AHIsub_Stop (TrapContext *ctx) int i; if (ahi_debug) - write_log (L"AHI: Stop(%08x,%08x)\n", + write_log (_T("AHI: Stop(%08x,%08x)\n"), flags, audioctrl); if ((flags & AHISF_PLAY) && dsahip->playing) { dsahip->playing = 0; @@ -1635,7 +1635,7 @@ static uae_u32 AHIsub_Update (TrapContext *ctx) uae_u32 audioctrl = m68k_areg (regs, 2); struct DSAHI *dsahip = GETAHI; if (ahi_debug) - write_log (L"AHI: Update(%08x,%08x)\n", flags, audioctrl); + write_log (_T("AHI: Update(%08x,%08x)\n"), flags, audioctrl); setevent (dsahip); return 0; } @@ -1651,7 +1651,7 @@ static uae_u32 AHIsub_SetVol (TrapContext *ctx) struct dschannel *dc = GETCHANNEL; if (ahi_debug > 1) - write_log (L"AHI: SetVol(%d,%d,%d,%08x,%08x)\n", + write_log (_T("AHI: SetVol(%d,%d,%d,%08x,%08x)\n"), channel, volume, pan, audioctrl, flags); if (dc) { if (volume < -65535) @@ -1681,7 +1681,7 @@ static uae_u32 AHIsub_SetFreq (TrapContext *ctx) struct dschannel *dc = GETCHANNEL; if (ahi_debug > 1) - write_log (L"AHI: SetFreq(%d,%d,%08x,%08x)\n", + write_log (_T("AHI: SetFreq(%d,%d,%08x,%08x)\n"), channel, frequency, audioctrl, flags); if (dc) { dc->csnext.frequency = frequency; @@ -1706,7 +1706,7 @@ static uae_u32 AHIsub_SetSound (TrapContext *ctx) struct dschannel *dc = GETCHANNEL; if (ahi_debug > 1) - write_log (L"AHI: SetSound(%d,%d,%08x,%d,%08x,%08x)\n", + write_log (_T("AHI: SetSound(%d,%d,%08x,%d,%08x,%08x)\n"), channel, sound, offset, length, audioctrl, flags); if (dc == NULL) return AHIE_UNKNOWN; @@ -1747,7 +1747,7 @@ static uae_u32 AHIsub_SetEffect (TrapContext *ctx) struct DSAHI *dsahip = GETAHI; if (ahi_debug) - write_log (L"AHI: SetEffect(%08x (%08x),%08x)\n", effect, effectype, audioctrl); + write_log (_T("AHI: SetEffect(%08x (%08x),%08x)\n"), effect, effectype, audioctrl); switch (effectype) { case AHIET_CHANNELINFO: @@ -1757,7 +1757,7 @@ static uae_u32 AHIsub_SetEffect (TrapContext *ctx) put_long (puaebase + pub_ChannelInfo, 0); break; case AHIET_MASTERVOLUME: - write_log (L"AHI: SetEffect(MasterVolume=%08x)\n", get_long (effect + 4)); + write_log (_T("AHI: SetEffect(MasterVolume=%08x)\n"), get_long (effect + 4)); case AHIET_MASTERVOLUME | AHIET_CANCEL: break; default: @@ -1782,7 +1782,7 @@ static uae_u32 AHIsub_LoadSound (TrapContext *ctx) int bps; if (ahi_debug > 1) - write_log (L"AHI: LoadSound(%d,%d,%08x,%08x,SMP=%d,ADDR=%08x,LEN=%d)\n", + write_log (_T("AHI: LoadSound(%d,%d,%08x,%08x,SMP=%d,ADDR=%08x,LEN=%d)\n"), sound, type, info, audioctrl, sampletype, addr, len); if (!ds) @@ -1839,10 +1839,10 @@ static uae_u32 AHIsub_LoadSound (TrapContext *ctx) if (ds->al_buffer[0] == -1) { alClear (); alGenBuffers (2, ds->al_buffer); - if (alError (L"AHI: alGenBuffers")) + if (alError (_T("AHI: alGenBuffers"))) return AHIE_NOMEM; if (ahi_debug > 1) - write_log (L"AHI:LoadSound:allocated OpenAL buffer\n"); + write_log (_T("AHI:LoadSound:allocated OpenAL buffer\n")); } return AHIE_OK; } @@ -1855,7 +1855,7 @@ static uae_u32 AHIsub_UnloadSound (TrapContext *ctx) struct dssample *ds = GETSAMPLE; if (ahi_debug > 1) - write_log (L"AHI: UnloadSound(%d,%08x)\n", + write_log (_T("AHI: UnloadSound(%d,%08x)\n"), sound, audioctrl); ds->num = -1; return AHIE_OK; @@ -1868,7 +1868,7 @@ static uae_u32 REGPARAM2 ahi_demux (TrapContext *ctx) uae_u32 offset = get_long (sp + 4); if (0 && ahi_debug) - write_log (L"AHI: %d\n", offset); + write_log (_T("AHI: %d\n"), offset); switch (offset) { @@ -1928,7 +1928,7 @@ void init_ahi_v2 (void) { uaecptr a = here (); org (rtarea_base + 0xFFC8); - calltrap (deftrapres (ahi_demux, 0, L"ahi_v2")); + calltrap (deftrapres (ahi_demux, 0, _T("ahi_v2"))); dw (RTS); org (a); } diff --git a/od-win32/ahidsound_unified.cpp b/od-win32/ahidsound_unified.cpp index efac74df..cf448af5 100644 --- a/od-win32/ahidsound_unified.cpp +++ b/od-win32/ahidsound_unified.cpp @@ -157,9 +157,9 @@ void ahi_close_sound (void) if (lpDSB2) { hr = IDirectSoundBuffer_Stop (lpDSB2); if(FAILED (hr)) - write_log (L"AHI: SoundStop() failure: %s\n", DXError (hr)); + write_log (_T("AHI: SoundStop() failure: %s\n"), DXError (hr)); } else { - write_log (L"AHI: Sound Stopped...\n"); + write_log (_T("AHI: Sound Stopped...\n")); } if (lpDSB2) @@ -276,7 +276,7 @@ void ahi_updatesound (int force) hr = IDirectSoundBuffer_Lock (lpDSB2, oldpos, amigablksize * 4, &dwData1, &dwBytes1, &dwData2, &dwBytes2, 0); if(hr == DSERR_BUFFERLOST) { - write_log (L"AHI: lostbuf %d %x\n", pos, amigablksize); + write_log (_T("AHI: lostbuf %d %x\n"), pos, amigablksize); IDirectSoundBuffer_Restore (lpDSB2); hr = IDirectSoundBuffer_Lock (lpDSB2, oldpos, amigablksize * 4, &dwData1, &dwBytes1, &dwData2, &dwBytes2, 0); } @@ -328,7 +328,7 @@ static int ahi_init_record_win32 (void) // Record begin hr = DirectSoundCaptureCreate (NULL, &lpDS2r, NULL); if (FAILED (hr)) { - write_log (L"AHI: DirectSoundCaptureCreate() failure: %s\n", DXError (hr)); + write_log (_T("AHI: DirectSoundCaptureCreate() failure: %s\n"), DXError (hr)); record_enabled = -1; return 0; } @@ -340,19 +340,19 @@ static int ahi_init_record_win32 (void) hr = IDirectSoundCapture_CreateCaptureBuffer (lpDS2r, &sound_buffer_rec, &lpDSB2r, NULL); if (FAILED (hr)) { - write_log (L"AHI: CreateCaptureSoundBuffer() failure: %s\n", DXError(hr)); + write_log (_T("AHI: CreateCaptureSoundBuffer() failure: %s\n"), DXError(hr)); record_enabled = -1; return 0; } hr = IDirectSoundCaptureBuffer_Start (lpDSB2r, DSCBSTART_LOOPING); if (FAILED (hr)) { - write_log (L"AHI: DirectSoundCaptureBuffer_Start failed: %s\n", DXError (hr)); + write_log (_T("AHI: DirectSoundCaptureBuffer_Start failed: %s\n"), DXError (hr)); record_enabled = -1; return 0; } record_enabled = 1; - write_log (L"AHI: Init AHI Audio Recording \n"); + write_log (_T("AHI: Init AHI Audio Recording \n")); return 1; } @@ -366,7 +366,7 @@ void setvolume_ahi (int vol) return; hr = IDirectSoundBuffer_SetVolume (lpDSB2, vol); if (FAILED (hr)) - write_log (L"AHI: SetVolume(%d) failed: %s\n", vol, DXError (hr)); + write_log (_T("AHI: SetVolume(%d) failed: %s\n"), vol, DXError (hr)); #endif } @@ -396,7 +396,7 @@ static int ahi_init_sound_win32 (void) if (!ret) return 0; - write_log (L"AHI: Init AHI Sound Rate %d, Channels %d, Bits %d, Buffsize %d\n", + write_log (_T("AHI: Init AHI Sound Rate %d, Channels %d, Bits %d, Buffsize %d\n"), sound_freq_ahi, sound_channels_ahi, sound_bits_ahi, amigablksize); wavfmt.wFormatTag = WAVE_FORMAT_PCM; @@ -413,7 +413,7 @@ static int ahi_init_sound_win32 (void) else hr = DirectSoundCreate (&sound_devices[currprefs.win32_soundcard].guid, &lpDS2, NULL); if (FAILED (hr)) { - write_log (L"AHI: DirectSoundCreate() failure: %s\n", DXError (hr)); + write_log (_T("AHI: DirectSoundCreate() failure: %s\n"), DXError (hr)); return 0; } memset (&sound_buffer, 0, sizeof (DSBUFFERDESC)); @@ -426,18 +426,18 @@ static int ahi_init_sound_win32 (void) hr = IDirectSound_GetCaps (lpDS2, &DSCaps); if (SUCCEEDED (hr)) { if (DSCaps.dwFlags & DSCAPS_EMULDRIVER) - write_log (L"AHI: Your DirectSound Driver is emulated via WaveOut - yuck!\n"); + write_log (_T("AHI: Your DirectSound Driver is emulated via WaveOut - yuck!\n")); } if (FAILED (IDirectSound_SetCooperativeLevel (lpDS2, hMainWnd, DSSCL_PRIORITY))) return 0; hr = IDirectSound_CreateSoundBuffer (lpDS2, &sound_buffer, &lpDSBprimary2, NULL); if (FAILED (hr)) { - write_log (L"AHI: CreateSoundBuffer() failure: %s\n", DXError(hr)); + write_log (_T("AHI: CreateSoundBuffer() failure: %s\n"), DXError(hr)); return 0; } hr = IDirectSoundBuffer_SetFormat (lpDSBprimary2, &wavfmt); if (FAILED (hr)) { - write_log (L"AHI: SetFormat() failure: %s\n", DXError (hr)); + write_log (_T("AHI: SetFormat() failure: %s\n"), DXError (hr)); return 0; } sound_buffer.dwBufferBytes = ahisndbufsize; @@ -447,13 +447,13 @@ static int ahi_init_sound_win32 (void) sound_buffer.guid3DAlgorithm = GUID_NULL; hr = IDirectSound_CreateSoundBuffer (lpDS2, &sound_buffer, &lpDSB2, NULL); if (FAILED (hr)) { - write_log (L"AHI: CreateSoundBuffer() failure: %s\n", DXError (hr)); + write_log (_T("AHI: CreateSoundBuffer() failure: %s\n"), DXError (hr)); return 0; } hr = IDirectSoundBuffer_GetFormat (lpDSBprimary2,&wavfmt,500,0); if (FAILED (hr)) { - write_log (L"AHI: GetFormat() failure: %s\n", DXError (hr)); + write_log (_T("AHI: GetFormat() failure: %s\n"), DXError (hr)); return 0; } #endif @@ -734,28 +734,28 @@ uae_u32 REGPARAM2 ahi_demux (TrapContext *context) _tcscpy (newdllpath, dpath + _tcslen (start_path_data)); if (!_tcsncmp (newdllpath, dlldir, _tcslen (dlldir))) /* remove "winuae_dll" */ _tcscpy (newdllpath, dpath + _tcslen (start_path_data) + 1 + _tcslen (dlldir)); - _stprintf (dpath, L"%s%s%s", start_path_data, WIN32_PLUGINDIR, newdllpath); + _stprintf (dpath, _T("%s%s%s"), start_path_data, WIN32_PLUGINDIR, newdllpath); h = LoadLibrary (dpath); if (h == NULL) - write_log (L"native open: '%s' = %d\n", dpath, GetLastError ()); + write_log (_T("native open: '%s' = %d\n"), dpath, GetLastError ()); if (h == NULL) { - _stprintf (dpath, L"%s%s\\%s", start_path_data, dlldir, newdllpath); + _stprintf (dpath, _T("%s%s\\%s"), start_path_data, dlldir, newdllpath); h = LoadLibrary (dllname); if (h == NULL) - write_log (L"fallback native open: '%s' = %d\n", dpath, GetLastError ()); + write_log (_T("fallback native open: '%s' = %d\n"), dpath, GetLastError ()); } } else { - write_log (L"native open outside of installation dir '%s'!\n", dpath); + write_log (_T("native open outside of installation dir '%s'!\n"), dpath); } xfree (dllname); #if 0 if (h == NULL) { h = LoadLibrary (filepart); - write_log (L"native file open: '%s' = %p\n", filepart, h); + write_log (_T("native file open: '%s' = %p\n"), filepart, h); if (h == NULL) { _stprintf (dpath, "%s%s%s", start_path_data, WIN32_PLUGINDIR, filepart); h = LoadLibrary (dpath); - write_log (L"native path open: '%s' = %p\n", dpath, h); + write_log (_T("native path open: '%s' = %p\n"), dpath, h); } } #endif diff --git a/od-win32/avioutput.cpp b/od-win32/avioutput.cpp index 9ade40fa..333df317 100644 --- a/od-win32/avioutput.cpp +++ b/od-win32/avioutput.cpp @@ -124,10 +124,10 @@ void avi_message (const TCHAR *format,...) write_log (msg); if (msg[_tcslen (msg) - 1] != '\n') - write_log (L"\n"); + write_log (_T("\n")); - if (!MessageBox (NULL, msg, L"AVI", flags)) - write_log (L"MessageBox(%s) failed, err=%d\n", msg, GetLastError ()); + if (!MessageBox (NULL, msg, _T("AVI"), flags)) + write_log (_T("MessageBox(%s) failed, err=%d\n"), msg, GetLastError ()); } static int lpbisize (void) @@ -208,31 +208,31 @@ static void waitqueuefull (void) static UAEREG *openavikey (void) { - return regcreatetree (NULL, L"AVConfiguration"); + return regcreatetree (NULL, _T("AVConfiguration")); } static void storesettings (UAEREG *avikey) { - regsetint (avikey, L"FrameLimiter", avioutput_framelimiter); - regsetint (avikey, L"NoSoundOutput", avioutput_nosoundoutput); - regsetint (avikey, L"NoSoundSync", avioutput_nosoundsync); - regsetint (avikey, L"Original", avioutput_originalsize); - regsetint (avikey, L"FPS", avioutput_fps); + regsetint (avikey, _T("FrameLimiter"), avioutput_framelimiter); + regsetint (avikey, _T("NoSoundOutput"), avioutput_nosoundoutput); + regsetint (avikey, _T("NoSoundSync"), avioutput_nosoundsync); + regsetint (avikey, _T("Original"), avioutput_originalsize); + regsetint (avikey, _T("FPS"), avioutput_fps); } static void getsettings (UAEREG *avikey) { int val; - if (regqueryint (avikey, L"NoSoundOutput", &val)) + if (regqueryint (avikey, _T("NoSoundOutput"), &val)) avioutput_nosoundoutput = val; - if (regqueryint (avikey, L"NoSoundSync", &val)) + if (regqueryint (avikey, _T("NoSoundSync"), &val)) avioutput_nosoundsync = val; - if (regqueryint (avikey, L"FrameLimiter", &val)) + if (regqueryint (avikey, _T("FrameLimiter"), &val)) avioutput_framelimiter = val; - if (regqueryint (avikey, L"Original", &val)) + if (regqueryint (avikey, _T("Original"), &val)) avioutput_originalsize = val; if (!avioutput_framelimiter) avioutput_nosoundoutput = 1; - if (regqueryint (avikey, L"FPS", &val)) + if (regqueryint (avikey, _T("FPS"), &val)) avioutput_fps = val; } @@ -271,7 +271,7 @@ static int AVIOutput_AllocateAudio (void) AVIOutput_ReleaseAudio (); if ((err = acmMetrics (NULL, ACM_METRIC_MAX_SIZE_FORMAT, &wfxMaxFmtSize))) { - gui_message (L"acmMetrics() FAILED (%X)\n", err); + gui_message (_T("acmMetrics() FAILED (%X)\n"), err); return 0; } @@ -316,7 +316,7 @@ static int AVIOutput_AllocateAudio (void) acmopt.fdwStyle = ACMFORMATCHOOSE_STYLEF_INITTOWFXSTRUCT; acmopt.pwfx = pwfxDst; acmopt.cbwfx = wfxMaxFmtSize; - acmopt.pszTitle = L"Choose Audio Codec"; + acmopt.pszTitle = _T("Choose Audio Codec"); //acmopt.szFormatTag =; // not valid until the format is chosen //acmopt.szFormat =; // not valid until the format is chosen @@ -357,7 +357,7 @@ static int AVIOutput_ValidateAudio (WAVEFORMATEX *wft, TCHAR *name, int len) return 0; if (name) - _stprintf (name, L"%s %s", aftd.szFormatTag, afd.szFormat); + _stprintf (name, _T("%s %s"), aftd.szFormatTag, afd.szFormat); return 1; } @@ -373,13 +373,13 @@ static int AVIOutput_GetAudioFromRegistry (WAVEFORMATEX *wft) getsettings (avikey); if (wft) { ss = wfxMaxFmtSize; - if (regquerydata (avikey, L"AudioConfigurationVars", wft, &ss)) { + if (regquerydata (avikey, _T("AudioConfigurationVars"), wft, &ss)) { if (AVIOutput_ValidateAudio (wft, NULL, 0)) ok = 1; } } if (!ok) - regdelete (avikey, L"AudioConfigurationVars"); + regdelete (avikey, _T("AudioConfigurationVars")); regclosetree (avikey); return ok; } @@ -423,7 +423,7 @@ int AVIOutput_ChooseAudioCodec (HWND hwnd, TCHAR *s, int len) _tcscpy (s, acmopt.szFormatTag); avikey = openavikey (); if (avikey) { - regsetdata (avikey, L"AudioConfigurationVars", pwfxDst, pwfxDst->cbSize + sizeof (WAVEFORMATEX)); + regsetdata (avikey, _T("AudioConfigurationVars"), pwfxDst, pwfxDst->cbSize + sizeof (WAVEFORMATEX)); storesettings (avikey); regclosetree (avikey); } @@ -436,27 +436,27 @@ int AVIOutput_ChooseAudioCodec (HWND hwnd, TCHAR *s, int len) break; case ACMERR_NOTPOSSIBLE: - MessageBox (hwnd, L"The buffer identified by the pwfx member of the ACMFORMATCHOOSE structure is too small to contain the selected format.", VersionStr, MB_OK | MB_ICONERROR | MB_APPLMODAL | MB_SETFOREGROUND); + MessageBox (hwnd, _T("The buffer identified by the pwfx member of the ACMFORMATCHOOSE structure is too small to contain the selected format."), VersionStr, MB_OK | MB_ICONERROR | MB_APPLMODAL | MB_SETFOREGROUND); break; case MMSYSERR_INVALFLAG: - MessageBox (hwnd, L"At least one flag is invalid.", VersionStr, MB_OK | MB_ICONERROR | MB_APPLMODAL | MB_SETFOREGROUND); + MessageBox (hwnd, _T("At least one flag is invalid."), VersionStr, MB_OK | MB_ICONERROR | MB_APPLMODAL | MB_SETFOREGROUND); break; case MMSYSERR_INVALHANDLE: - MessageBox (hwnd, L"The specified handle is invalid.", VersionStr, MB_OK | MB_ICONERROR | MB_APPLMODAL | MB_SETFOREGROUND); + MessageBox (hwnd, _T("The specified handle is invalid."), VersionStr, MB_OK | MB_ICONERROR | MB_APPLMODAL | MB_SETFOREGROUND); break; case MMSYSERR_INVALPARAM: - MessageBox (hwnd, L"At least one parameter is invalid.", VersionStr, MB_OK | MB_ICONERROR | MB_APPLMODAL | MB_SETFOREGROUND); + MessageBox (hwnd, _T("At least one parameter is invalid."), VersionStr, MB_OK | MB_ICONERROR | MB_APPLMODAL | MB_SETFOREGROUND); break; case MMSYSERR_NODRIVER: - MessageBox (hwnd, L"A suitable driver is not available to provide valid format selections.\n(Unsupported channel-mode selected in Sound-panel?)", VersionStr, MB_OK | MB_ICONERROR | MB_APPLMODAL | MB_SETFOREGROUND); + MessageBox (hwnd, _T("A suitable driver is not available to provide valid format selections.\n(Unsupported channel-mode selected in Sound-panel?)"), VersionStr, MB_OK | MB_ICONERROR | MB_APPLMODAL | MB_SETFOREGROUND); break; default: - MessageBox (hwnd, L"acmFormatChoose() FAILED", VersionStr, MB_OK | MB_ICONERROR | MB_APPLMODAL | MB_SETFOREGROUND); + MessageBox (hwnd, _T("acmFormatChoose() FAILED"), VersionStr, MB_OK | MB_ICONERROR | MB_APPLMODAL | MB_SETFOREGROUND); break; } return 0; @@ -542,14 +542,14 @@ static int AVIOutput_GetCOMPVARSFromRegistry (COMPVARS *pcv) if (pcv) { ss = pcv->cbSize; pcv->hic = 0; - if (regquerydata (avikey, L"VideoConfigurationVars", pcv, &ss)) { + if (regquerydata (avikey, _T("VideoConfigurationVars"), pcv, &ss)) { pcv->hic = 0; pcv->lpbiIn = pcv->lpbiOut = 0; pcv->cbState = 0; - if (regquerydatasize (avikey, L"VideoConfigurationState", &ss)) { + if (regquerydatasize (avikey, _T("VideoConfigurationState"), &ss)) { if (ss > 0) { LPBYTE state = xmalloc (BYTE, ss); - if (regquerydata (avikey, L"VideoConfigurationState", state, &ss)) { + if (regquerydata (avikey, _T("VideoConfigurationState"), state, &ss)) { pcv->hic = ICOpen (pcv->fccType, pcv->fccHandler, ICMODE_COMPRESS); if (pcv->hic) { ok = 1; @@ -564,8 +564,8 @@ static int AVIOutput_GetCOMPVARSFromRegistry (COMPVARS *pcv) } } if (!ok) { - regdelete (avikey, L"VideoConfigurationVars"); - regdelete (avikey, L"VideoConfigurationState"); + regdelete (avikey, _T("VideoConfigurationVars")); + regdelete (avikey, _T("VideoConfigurationState")); } regclosetree (avikey); return ok; @@ -577,7 +577,7 @@ static int AVIOutput_GetVideoCodecName (COMPVARS *pcv, TCHAR *name, int len) name[0] = 0; if (pcv->fccHandler == mmioFOURCC ('D','I','B',' ')) { - _tcscpy (name, L"Full Frames (Uncompressed)"); + _tcscpy (name, _T("Full Frames (Uncompressed)")); return 1; } if (ICGetInfo (pcv->hic, &icinfo, sizeof (ICINFO)) != 0) { @@ -646,8 +646,8 @@ int AVIOutput_ChooseVideoCodec (HWND hwnd, TCHAR *s, int len) state = xmalloc (uae_u8, 1); avikey = openavikey (); if (avikey) { - regsetdata (avikey, L"VideoConfigurationState", state, ss); - regsetdata (avikey, L"VideoConfigurationVars", pcompvars, pcompvars->cbSize); + regsetdata (avikey, _T("VideoConfigurationState"), state, ss); + regsetdata (avikey, _T("VideoConfigurationVars"), pcompvars, pcompvars->cbSize); storesettings (avikey); regclosetree (avikey); } @@ -672,8 +672,8 @@ static void checkAVIsize (int force) if (total_avi_size == 0) return; _tcscpy (fn, avioutput_filename_tmp); - _stprintf (avioutput_filename, L"%s_%d.avi", fn, tmp_partcnt); - write_log (L"AVI split %d at %d bytes, %d frames\n", + _stprintf (avioutput_filename, _T("%s_%d.avi"), fn, tmp_partcnt); + write_log (_T("AVI split %d at %d bytes, %d frames\n"), tmp_partcnt, total_avi_size, frame_count); AVIOutput_End (); first_frame = 0; @@ -687,7 +687,7 @@ static void checkAVIsize (int force) static void dorestart (void) { - write_log (L"AVIOutput: parameters changed, restarting..\n"); + write_log (_T("AVIOutput: parameters changed, restarting..\n")); avioutput_needs_restart = 0; checkAVIsize (1); } @@ -720,7 +720,7 @@ static int AVIOutput_AVIWriteAudio_Thread (struct avientry *ae) goto error; if ((err = acmStreamSize (has, ae->sndsize, &dwOutputBytes, ACM_STREAMSIZEF_SOURCE) != 0)) { - gui_message (L"acmStreamSize() FAILED (%X)\n", err); + gui_message (_T("acmStreamSize() FAILED (%X)\n"), err); goto error; } @@ -748,17 +748,17 @@ static int AVIOutput_AVIWriteAudio_Thread (struct avientry *ae) ash.dwDstUser = 0; if ((err = acmStreamPrepareHeader (has, &ash, 0))) { - avi_message (L"acmStreamPrepareHeader() FAILED (%X)\n", err); + avi_message (_T("acmStreamPrepareHeader() FAILED (%X)\n"), err); goto error; } if ((err = acmStreamConvert (has, &ash, ACM_STREAMCONVERTF_BLOCKALIGN))) { - avi_message (L"acmStreamConvert() FAILED (%X)\n", err); + avi_message (_T("acmStreamConvert() FAILED (%X)\n"), err); goto error; } if ((err = AVIStreamWrite (AVIAudioStream, StreamSizeAudio, ash.cbDstLengthUsed / pwfxDst->nBlockAlign, lpAudio, ash.cbDstLengthUsed, 0, &swritten, &written)) != 0) { - avi_message (L"AVIStreamWrite() FAILED (%X)\n", err); + avi_message (_T("AVIStreamWrite() FAILED (%X)\n"), err); goto error; } @@ -822,7 +822,7 @@ static int getFromDC (struct avientry *avie) BitBlt (hdcMem, (avioutput_width / 2) - (actual_width / 2), (avioutput_height / 2) - (actual_height / 2), actual_width, actual_height, hdc, 0, 0, SRCCOPY); SelectObject (hdcMem, hbitmapOld); if (GetDIBits (hdc, hbitmap, 0, avioutput_height, avie->lpVideo, (LPBITMAPINFO)lpbi, DIB_RGB_COLORS) == 0) { - gui_message (L"GetDIBits() FAILED (%X)\n", GetLastError ()); + gui_message (_T("GetDIBits() FAILED (%X)\n"), GetLastError ()); ok = 0; } DeleteObject (hbitmap); @@ -954,13 +954,13 @@ static int AVIOutput_AVIWriteVideo_Thread (struct avientry *ae) if (!frame_count) { if ((err = AVIStreamSetFormat (AVIVideoStream, frame_count, ae->lpbi, ae->lpbi->biSize + (ae->lpbi->biClrUsed * sizeof (RGBQUAD)))) != 0) { - avi_message (L"AVIStreamSetFormat() FAILED (%X)\n", err); + avi_message (_T("AVIStreamSetFormat() FAILED (%X)\n"), err); goto error; } } if ((err = AVIStreamWrite (AVIVideoStream, frame_count, 1, ae->lpVideo, ae->lpbi->biSizeImage, 0, NULL, &written)) != 0) { - avi_message (L"AVIStreamWrite() FAILED (%X)\n", err); + avi_message (_T("AVIStreamWrite() FAILED (%X)\n"), err); goto error; } @@ -969,13 +969,13 @@ static int AVIOutput_AVIWriteVideo_Thread (struct avientry *ae) } else { - avi_message (L"DirectDraw_GetDC() FAILED\n"); + avi_message (_T("DirectDraw_GetDC() FAILED\n")); goto error; } if ((frame_count % (avioutput_fps * 10)) == 0) - write_log (L"AVIOutput: %d frames, (%d fps)\n", frame_count, avioutput_fps); + write_log (_T("AVIOutput: %d frames, (%d fps)\n"), frame_count, avioutput_fps); return 1; error: @@ -1030,7 +1030,7 @@ void AVIOutput_End (void) avioutput_enabled = 0; if (alive) { - write_log (L"killing worker thread\n"); + write_log (_T("killing worker thread\n")); write_comm_pipe_u32 (&workindex, 0xfffffffe, 1); while (alive) { while (comm_pipe_has_data (&queuefull)) @@ -1103,9 +1103,9 @@ void AVIOutput_Begin (void) reset_sound (); if (avioutput_audio == AVIAUDIO_WAV) { - ext1 = L".wav"; ext2 = L".avi"; + ext1 = _T(".wav"); ext2 = _T(".avi"); } else { - ext1 = L".avi"; ext2 = L".wav"; + ext1 = _T(".avi"); ext2 = _T(".wav"); } if (_tcslen (avioutput_filename) >= 4 && !_tcsicmp (avioutput_filename + _tcslen (avioutput_filename) - 4, ext2)) avioutput_filename[_tcslen (avioutput_filename) - 4] = 0; @@ -1127,18 +1127,18 @@ void AVIOutput_Begin (void) DeleteFile (avioutput_filename); if (avioutput_audio == AVIAUDIO_WAV) { - wavfile = _tfopen (avioutput_filename, L"wb"); + wavfile = _tfopen (avioutput_filename, _T("wb")); if (!wavfile) { - gui_message (L"Failed to open wave-file\n\nThis can happen if the path and or file name was entered incorrectly.\n"); + gui_message (_T("Failed to open wave-file\n\nThis can happen if the path and or file name was entered incorrectly.\n")); goto error; } writewavheader (0); - write_log (L"wave-output to '%s' started\n", avioutput_filename); + write_log (_T("wave-output to '%s' started\n"), avioutput_filename); return; } if (((err = AVIFileOpen (&pfile, avioutput_filename, OF_CREATE | OF_WRITE, NULL)) != 0)) { - gui_message (L"AVIFileOpen() FAILED (Error %X)\n\nThis can happen if the path and or file name was entered incorrectly.\nRequired *.avi extension.\n", err); + gui_message (_T("AVIFileOpen() FAILED (Error %X)\n\nThis can happen if the path and or file name was entered incorrectly.\nRequired *.avi extension.\n"), err); goto error; } @@ -1163,21 +1163,21 @@ void AVIOutput_Begin (void) //avistreaminfo.rcFrame; // doesn't apply to audio //avistreaminfo.dwEditCount =; // Number of times the stream has been edited. The stream handler maintains this count. //avistreaminfo.dwFormatChangeCount =; // Number of times the stream format has changed. The stream handler maintains this count. - _tcscpy (avistreaminfo.szName, L"Audiostream"); // description of the stream. + _tcscpy (avistreaminfo.szName, _T("Audiostream")); // description of the stream. // create the audio stream if ((err = AVIFileCreateStream (pfile, &AVIAudioStream, &avistreaminfo)) != 0) { - gui_message (L"AVIFileCreateStream() FAILED (%X)\n", err); + gui_message (_T("AVIFileCreateStream() FAILED (%X)\n"), err); goto error; } if ((err = AVIStreamSetFormat (AVIAudioStream, 0, pwfxDst, sizeof (WAVEFORMATEX) + pwfxDst->cbSize)) != 0) { - gui_message (L"AVIStreamSetFormat() FAILED (%X)\n", err); + gui_message (_T("AVIStreamSetFormat() FAILED (%X)\n"), err); goto error; } if ((err = acmStreamOpen(&has, NULL, &wfxSrc.Format, pwfxDst, NULL, 0, 0, ACM_STREAMOPENF_NONREALTIME)) != 0) { - gui_message (L"acmStreamOpen() FAILED (%X)\n", err); + gui_message (_T("acmStreamOpen() FAILED (%X)\n"), err); goto error; } } @@ -1213,11 +1213,11 @@ void AVIOutput_Begin (void) //avistreaminfo.dwEditCount =; // Number of times the stream has been edited. The stream handler maintains this count. //avistreaminfo.dwFormatChangeCount =; // Number of times the stream format has changed. The stream handler maintains this count. - _tcscpy (avistreaminfo.szName, L"Videostream"); // description of the stream. + _tcscpy (avistreaminfo.szName, _T("Videostream")); // description of the stream. // create the stream if ((err = AVIFileCreateStream (pfile, &AVIStreamInterface, &avistreaminfo)) != 0) { - gui_message (L"AVIFileCreateStream() FAILED (%X)\n", err); + gui_message (_T("AVIFileCreateStream() FAILED (%X)\n"), err); goto error; } @@ -1239,7 +1239,7 @@ void AVIOutput_Begin (void) // create a compressed stream from our uncompressed stream and a compression filter if ((err = AVIMakeCompressedStream (&AVIVideoStream, AVIStreamInterface, &videoOptions, NULL)) != AVIERR_OK) { - gui_message (L"AVIMakeCompressedStream() FAILED (%X)\n", err); + gui_message (_T("AVIMakeCompressedStream() FAILED (%X)\n"), err); goto error; } } @@ -1247,8 +1247,8 @@ void AVIOutput_Begin (void) init_comm_pipe (&workindex, 20, 1); init_comm_pipe (&queuefull, 20, 1); alive = -1; - uae_start_thread (L"aviworker", AVIOutput_worker, NULL, NULL); - write_log (L"AVIOutput enabled: video=%d audio=%d\n", avioutput_video, avioutput_audio); + uae_start_thread (_T("aviworker"), AVIOutput_worker, NULL, NULL); + write_log (_T("AVIOutput enabled: video=%d audio=%d\n"), avioutput_video, avioutput_audio); return; error: @@ -1299,7 +1299,7 @@ void AVIOutput_Initialize (void) static void *AVIOutput_worker (void *arg) { - write_log (L"AVIOutput worker thread started\n"); + write_log (_T("AVIOutput worker thread started\n")); alive = 1; for (;;) { uae_u32 idx = read_comm_pipe_u32_blocking (&workindex); @@ -1330,7 +1330,7 @@ static void *AVIOutput_worker (void *arg) if (idx == 0xfffffffe || idx == 0xffffffff) break; } - write_log (L"AVIOutput worker thread killed\n"); + write_log (_T("AVIOutput worker thread killed\n")); alive = 0; return 0; } @@ -1371,7 +1371,7 @@ void frame_drawn (void) sound_setadjust (0.0); #if 0 - write_log (L"%d ", idiff); + write_log (_T("%d "), idiff); diff = idiff / 20.0; skipmode = pow (diff < 0 ? -diff : diff, EXP); if (idiff < 0) @@ -1380,12 +1380,12 @@ void frame_drawn (void) skipmode = -ADJUST_SIZE; if (skipmode > ADJUST_SIZE) skipmode = ADJUST_SIZE; - write_log (L"%d/%.2f\n", idiff, skipmode); + write_log (_T("%d/%.2f\n"), idiff, skipmode); sound_setadjust (skipmode); if (0 && !(frame_count % avioutput_fps)) - write_log (L"AVIOutput: diff=%.2f skip=%.2f (%d-%d=%d)\n", diff, skipmode, + write_log (_T("AVIOutput: diff=%.2f skip=%.2f (%d-%d=%d)\n"), diff, skipmode, StreamSizeAudio, StreamSizeAudioExpected, idiff); #endif } diff --git a/od-win32/blkdev_win32_aspi.cpp b/od-win32/blkdev_win32_aspi.cpp index 64a09acd..c226568a 100644 --- a/od-win32/blkdev_win32_aspi.cpp +++ b/od-win32/blkdev_win32_aspi.cpp @@ -63,7 +63,7 @@ static int getversion(const TCHAR *name, VS_FIXEDFILEINFO *ver) if(vsFileInfo) { memcpy (ver, vsFileInfo, sizeof (*ver)); ok = TRUE; - write_log (L"%s version %d.%d.%d.%d\n", name, + write_log (_T("%s version %d.%d.%d.%d\n"), name, vsFileInfo->dwFileVersionMS >> 16, vsFileInfo->dwFileVersionMS & 0xffff, vsFileInfo->dwFileVersionLS >> 16, @@ -82,7 +82,7 @@ const TCHAR *get_aspi_path (int aspitype) static int nero, adaptec, frog; static TCHAR path_nero[MAX_DPATH]; static TCHAR path_adaptec[MAX_DPATH]; - static const TCHAR *path_frog = L"FrogAspi.dll"; + static const TCHAR *path_frog = _T("FrogAspi.dll"); VS_FIXEDFILEINFO ver; switch (aspitype) @@ -107,11 +107,11 @@ const TCHAR *get_aspi_path (int aspitype) if (nero < 0) return NULL; nero = -1; - if (RegOpenKeyEx (HKEY_LOCAL_MACHINE, L"SOFTWARE\\Ahead\\shared", 0, KEY_READ, &key) == ERROR_SUCCESS) { - if (RegQueryValueEx (key, L"NeroAPI", 0, &type, (LPBYTE)path_nero, &size) == ERROR_SUCCESS) { + if (RegOpenKeyEx (HKEY_LOCAL_MACHINE, _T("SOFTWARE\\Ahead\\shared"), 0, KEY_READ, &key) == ERROR_SUCCESS) { + if (RegQueryValueEx (key, _T("NeroAPI"), 0, &type, (LPBYTE)path_nero, &size) == ERROR_SUCCESS) { if (path_nero[_tcslen (path_nero) - 1] != '\\') - _tcscat (path_nero, L"\\"); - _tcscat (path_nero, L"wnaspi32.dll"); + _tcscat (path_nero, _T("\\")); + _tcscat (path_nero, _T("wnaspi32.dll")); RegCloseKey (key); if (getversion(path_nero, &ver)) { if (ver.dwFileVersionMS >= 0x20000) { @@ -133,7 +133,7 @@ const TCHAR *get_aspi_path (int aspitype) if (adaptec < 0) return NULL; adaptec = -1; - _tcscpy (path_adaptec, L"wnaspi32.dll"); + _tcscpy (path_adaptec, _T("wnaspi32.dll")); if (getversion(path_adaptec, &ver)) { if (ver.dwFileVersionMS >= 0x40000 || ver.dwFileVersionMS < 0x10000) { adaptec = 1; @@ -159,7 +159,7 @@ static int ha_inquiry (SCSI *scgp, int id, SRB_HAInquiry *ip) if (log_scsi) { TCHAR *s1 = au ((char*)ip->HA_ManagerId); TCHAR *s2 = au ((char*)ip->HA_Identifier); - write_log (L"ASPI: S=%d ha=%d, ID=%d, M='%s', Id='%s'\n", + write_log (_T("ASPI: S=%d ha=%d, ID=%d, M='%s', Id='%s'\n"), Status, ip->HA_Count, ip->HA_SCSI_ID, s1, s2); xfree (s2); xfree (s1); @@ -185,7 +185,7 @@ static int open_driver (SCSI *scgp) return TRUE; nero = frog = 0; - _tcscpy (path, L"WNASPI32"); + _tcscpy (path, _T("WNASPI32")); if (currprefs.win32_uaescsimode == UAESCSI_NEROASPI) { const TCHAR *p = get_aspi_path (1); if (p) { @@ -202,18 +202,18 @@ static int open_driver (SCSI *scgp) /* * Load the ASPI library */ - write_log (L"ASPI: driver location '%s'\n", path); + write_log (_T("ASPI: driver location '%s'\n"), path); hAspiLib = LoadLibrary (path); if (hAspiLib == NULL && (nero || frog)) { - write_log (L"ASPI: NERO/FROG ASPI failed to load, falling back to default\n"); - hAspiLib = LoadLibrary (L"WNASPI32"); + write_log (_T("ASPI: NERO/FROG ASPI failed to load, falling back to default\n")); + hAspiLib = LoadLibrary (_T("WNASPI32")); } /* * Check if ASPI library is loaded correctly */ if (hAspiLib == NULL) { - write_log (L"ASPI: failed to load wnaspi32.dll\n"); + write_log (_T("ASPI: failed to load wnaspi32.dll\n")); return FALSE; } /* @@ -224,7 +224,7 @@ static int open_driver (SCSI *scgp) pfnSendASPI32Command = (DWORD(_cdecl *)(LPSRB))GetProcAddress (hAspiLib, "SendASPI32Command"); if (pfnGetASPI32SupportInfo == NULL || pfnSendASPI32Command == NULL) { - write_log (L"ASPI: obsolete wnaspi32.dll found\n"); + write_log (_T("ASPI: obsolete wnaspi32.dll found\n")); return FALSE; } @@ -242,15 +242,15 @@ static int open_driver (SCSI *scgp) ASPIStatus = HIBYTE(LOWORD(astatus)); HACount = LOBYTE(LOWORD(astatus)); - write_log (L"ASPI: open_driver %X HostASPIStatus=0x%x HACount=0x%x\n", astatus, ASPIStatus, HACount); + write_log (_T("ASPI: open_driver %X HostASPIStatus=0x%x HACount=0x%x\n"), astatus, ASPIStatus, HACount); if (ASPIStatus != SS_COMP && ASPIStatus != SS_NO_ADAPTERS) { - write_log (L"ASPI: Could not find any host adapters, ASPIStatus == 0x%02X\n", ASPIStatus); + write_log (_T("ASPI: Could not find any host adapters, ASPIStatus == 0x%02X\n"), ASPIStatus); return FALSE; } busses = HACount; - write_log (L"ASPI: open_driver HostASPIStatus=0x%x HACount=0x%x\n", ASPIStatus, HACount); + write_log (_T("ASPI: open_driver HostASPIStatus=0x%x HACount=0x%x\n"), ASPIStatus, HACount); if (!scgp) return TRUE; @@ -371,7 +371,7 @@ static SCSI *openscsi (int busno, int tgt, int tlun) if (busno >= MAX_SCG || tgt >= MAX_TGT || tlun >= MAX_LUN) { errno = EINVAL; if (log_scsi) - write_log (L"ASPI: Illegal value for busno, target or lun '%d,%d,%d'\n", busno, tgt, tlun); + write_log (_T("ASPI: Illegal value for busno, target or lun '%d,%d,%d'\n"), busno, tgt, tlun); scsi_sfree (scgp); return 0; } @@ -424,7 +424,7 @@ static void scsi_debug (SCSI *scgp, SRB_ExecSCSICmd *s) return; if (scanphase) return; - write_log (L"ASPI EXEC_SCSI: bus=%d,target=%d,lun=%d\n", + write_log (_T("ASPI EXEC_SCSI: bus=%d,target=%d,lun=%d\n"), s->SRB_HaId, s->SRB_Target, s->SRB_Lun); scsi_log_before (scgp->scmd->cdb.cmd_cdb, scgp->scmd->cdb_len, (s->SRB_Flags & SRB_DIR_OUT) ? s->SRB_BufPointer : 0, s->SRB_BufLen); @@ -510,7 +510,7 @@ static int scsiabort(SCSI *scgp, SRB_ExecSCSICmd *sp) SRB_Abort s; if (log_scsi) - write_log (L"ASPI: Attempting to abort SCSI command\n"); + write_log (_T("ASPI: Attempting to abort SCSI command\n")); /* * Set structure variables */ @@ -527,11 +527,11 @@ static int scsiabort(SCSI *scgp, SRB_ExecSCSICmd *sp) */ if (s.SRB_Status != SS_COMP) { if (log_scsi) - write_log (L"ASPI: Abort ERROR! 0x%08X\n", s.SRB_Status); + write_log (_T("ASPI: Abort ERROR! 0x%08X\n"), s.SRB_Status); return FALSE; } if (log_scsi) - write_log (L"ASPI: Abort SCSI command completed\n"); + write_log (_T("ASPI: Abort SCSI command completed\n")); /* * Everything went OK */ @@ -563,7 +563,7 @@ static int scsicmd(SCSI *scgp) sp->error = SCG_FATAL; sp->ux_errno = EINVAL; if (log_scsi) - write_log (L"ASPI: sp->cdb_len > sizeof(SRB_ExecSCSICmd.CDBByte). Fatal error in scgo_send, exiting...\n"); + write_log (_T("ASPI: sp->cdb_len > sizeof(SRB_ExecSCSICmd.CDBByte). Fatal error in scgo_send, exiting...\n")); return -1; } /* @@ -636,11 +636,11 @@ static int scsicmd(SCSI *scgp) if (s.SRB_Status != SS_COMP) { if (log_scsi && s.SRB_Status != 0x82) - write_log (L"ASPI: Error in scgo_send: s.SRB_Status is 0x%x\n", s.SRB_Status); + write_log (_T("ASPI: Error in scgo_send: s.SRB_Status is 0x%x\n"), s.SRB_Status); set_error(&s, sp); /* Set error flags */ copy_sensedata(&s, sp); /* Copy sense and status */ if (log_scsi && s.SRB_Status != 0x82) - write_log (L"ASPI: Mapped to: error %d errno: %d\n", sp->error, sp->ux_errno); + write_log (_T("ASPI: Mapped to: error %d errno: %d\n"), sp->error, sp->ux_errno); return 1; } /* @@ -683,7 +683,7 @@ static int scsierr(SCSI *scgp) static void scan_scsi_bus (SCSI *scgp, int flags) { /* add all units we find */ - write_log (L"ASPI: SCSI scan starting..\n"); + write_log (_T("ASPI: SCSI scan starting..\n")); scanphase = 1; for (scgp->addr.scsibus=0; scgp->addr.scsibus < 8; scgp->addr.scsibus++) { if (!scsi_havebus(scgp, scgp->addr.scsibus)) @@ -708,27 +708,27 @@ static void scan_scsi_bus (SCSI *scgp, int flags) tmp[4] = 0; rev = au (tmp); - write_log (L"ASPI: %d:%d:%d '%s' '%s' '%s' ", + write_log (_T("ASPI: %d:%d:%d '%s' '%s' '%s' "), scgp->addr.scsibus,scgp->addr.target,scgp->addr.lun, vend, prod, rev); if (unitcnt < MAX_TOTAL_SCSI_DEVICES) { struct scsi_info *cis = &si[unitcnt]; int use = 0; - write_log (L"["); + write_log (_T("[")); if (inq.type == INQ_ROMD) { - write_log (L"CDROM"); + write_log (_T("CDROM")); use = 1; } else if ((inq.type >= INQ_SEQD && inq.type < INQ_COMM && aspi_allow_misc) || aspi_allow_all) { - write_log (L"%d", inq.type); + write_log (_T("%d"), inq.type); use = 1; } else { - write_log (L"<%d>", inq.type); + write_log (_T("<%d>"), inq.type); } if (inq.ansi_version == 0) { - write_log (L",ATAPI"); + write_log (_T(",ATAPI")); cis->isatapi = 1; } else - write_log (L",SCSI"); - write_log (L"]"); + write_log (_T(",SCSI")); + write_log (_T("]")); if (use) { unitcnt++; cis->buf = xmalloc (uae_u8, DEVICE_SCSI_BUFSIZE); @@ -737,10 +737,10 @@ static void scan_scsi_bus (SCSI *scgp, int flags) cis->lun = scgp->addr.lun; cis->type = inq.type; cis->removable = inq.removable; - _stprintf (cis->label, L"%s %s %s", vend, prod, rev); + _stprintf (cis->label, _T("%s %s %s"), vend, prod, rev); } } - write_log (L"\n"); + write_log (_T("\n")); xfree (rev); xfree (prod); @@ -749,7 +749,7 @@ static void scan_scsi_bus (SCSI *scgp, int flags) } } } - write_log (L"ASPI: SCSI scan ended\n"); + write_log (_T("ASPI: SCSI scan ended\n")); scanphase = 0; } @@ -885,12 +885,12 @@ static int open_scsi_device (int unitnum, const TCHAR *ident, int flags) if (unitnum >= unitcnt) return 0; if (log_scsi) - write_log (L"ASPI: opening %d:%d:%d (%d)\n", si[unitnum].scsibus, si[unitnum].target, si[unitnum].lun, unitnum); + write_log (_T("ASPI: opening %d:%d:%d (%d)\n"), si[unitnum].scsibus, si[unitnum].target, si[unitnum].lun, unitnum); si[unitnum].handle = openscsi (si[unitnum].scsibus, si[unitnum].target, si[unitnum].lun); if (si[unitnum].handle) si[unitnum].mediainserted = mediacheck (unitnum); if (log_scsi) - write_log (L"unit %d: %s\n", unitnum, si[unitnum].mediainserted ? L"CD inserted" : L"Drive empty"); + write_log (_T("unit %d: %s\n"), unitnum, si[unitnum].mediainserted ? _T("CD inserted") : _T("Drive empty")); return si[unitnum].handle ? 1 : 0; } @@ -987,9 +987,9 @@ static struct device_info *info_device (int unitnum, struct device_info *di, int di->unitnum = unitnum + 1; di->removable = sif->removable; _tcscpy (di->label, sif->label); - di->backend = L"ASPI"; + di->backend = _T("ASPI"); if (log_scsi) { - write_log (L"MI=%d TP=%d WP=%d CY=%d BK=%d '%s'\n", + write_log (_T("MI=%d TP=%d WP=%d CY=%d BK=%d '%s'\n"), di->media_inserted, di->type, di->write_protected, di->cylinders, di->bytespersector, di->label); } return di; @@ -1003,7 +1003,7 @@ bool win32_aspi_media_change (TCHAR driveletter, int insert) if (si[i].type == INQ_ROMD) { now = mediacheck (i); if (now != si[i].mediainserted) { - write_log (L"ASPI: media change %c %d\n", driveletter, insert); + write_log (_T("ASPI: media change %c %d\n"), driveletter, insert); si[i].mediainserted = now; scsi_do_disk_change (i + 1, insert, NULL); return true; @@ -1019,7 +1019,7 @@ static int check_isatapi (int unitnum) } struct device_functions devicefunc_win32_aspi = { - L"ASPI", + _T("ASPI"), open_scsi_bus, close_scsi_bus, open_scsi_device, close_scsi_device, info_device, execscsicmd_out, execscsicmd_in, execscsicmd_direct, 0, 0, 0, 0, 0, 0, 0, 0, 0, check_isatapi, 0, 0 diff --git a/od-win32/blkdev_win32_ioctl.cpp b/od-win32/blkdev_win32_ioctl.cpp index 80616b73..1319bf67 100644 --- a/od-win32/blkdev_win32_ioctl.cpp +++ b/od-win32/blkdev_win32_ioctl.cpp @@ -129,7 +129,7 @@ static int mcierr (TCHAR *str, DWORD err) if (err == MMSYSERR_NOERROR) return MMSYSERR_NOERROR; if (mciGetErrorString (err, es, sizeof es)) - write_log (L"MCIErr: %s: %d = '%s'\n", str, err, es); + write_log (_T("MCIErr: %s: %d = '%s'\n"), str, err, es); return err; } @@ -141,10 +141,10 @@ static int win32_error (struct dev_info_ioctl *ciw, int unitnum, const TCHAR *fo DWORD err = GetLastError (); if (err == ERROR_WRONG_DISK) { - write_log (L"IOCTL: media change, re-opening device\n"); + write_log (_T("IOCTL: media change, re-opening device\n")); sys_cddev_close (ciw, unitnum); if (sys_cddev_open (ciw, unitnum)) - write_log (L"IOCTL: re-opening failed!\n"); + write_log (_T("IOCTL: re-opening failed!\n")); return -1; } va_start (arglist, format); @@ -152,7 +152,7 @@ static int win32_error (struct dev_info_ioctl *ciw, int unitnum, const TCHAR *fo FormatMessage (FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSERTS, NULL, err, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR)&lpMsgBuf, 0, NULL); - write_log (L"IOCTL ERR: unit=%d,%s,%d: %s\n", unitnum, buf, err, (TCHAR*)lpMsgBuf); + write_log (_T("IOCTL ERR: unit=%d,%s,%d: %s\n"), unitnum, buf, err, (TCHAR*)lpMsgBuf); va_end (arglist); return err; } @@ -162,10 +162,10 @@ static int close_createfile (struct dev_info_ioctl *ciw) ciw->fullaccess = 0; if (ciw->h != INVALID_HANDLE_VALUE) { if (log_scsi) - write_log (L"IOCTL: IOCTL close\n"); + write_log (_T("IOCTL: IOCTL close\n")); CloseHandle (ciw->h); if (log_scsi) - write_log (L"IOCTL: IOCTL close completed\n"); + write_log (_T("IOCTL: IOCTL close completed\n")); ciw->h = INVALID_HANDLE_VALUE; return 1; } @@ -185,7 +185,7 @@ static int open_createfile (struct dev_info_ioctl *ciw, int fullaccess) } } if (log_scsi) - write_log (L"IOCTL: opening IOCTL %s\n", ciw->devname); + write_log (_T("IOCTL: opening IOCTL %s\n"), ciw->devname); for (;;) { if (fullaccess) { ciw->h = CreateFile (ciw->devname, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); @@ -204,13 +204,13 @@ static int open_createfile (struct dev_info_ioctl *ciw, int fullaccess) } if (ciw->h != INVALID_HANDLE_VALUE) break; - write_log (L"IOCTL: failed to open '%s', err=%d\n", ciw->devname, GetLastError ()); + write_log (_T("IOCTL: failed to open '%s', err=%d\n"), ciw->devname, GetLastError ()); return 0; } if (!DeviceIoControl (ciw->h, FSCTL_ALLOW_EXTENDED_DASD_IO, NULL, 0, NULL, 0, &len, NULL)) - write_log (L"IOCTL: FSCTL_ALLOW_EXTENDED_DASD_IO returned %d\n", GetLastError ()); + write_log (_T("IOCTL: FSCTL_ALLOW_EXTENDED_DASD_IO returned %d\n"), GetLastError ()); if (log_scsi) - write_log (L"IOCTL: IOCTL open completed\n"); + write_log (_T("IOCTL: IOCTL open completed\n")); return 1; } @@ -247,7 +247,7 @@ static int do_raw_scsi (struct dev_info_ioctl *ciw, int unitnum, uae_u8 *cmd, in reseterrormode (ciw); if (!status) { DWORD err = GetLastError (); - write_log (L"IOCTL_RAW_SCSI unit %d, CMD=%d, ERR=%d ", unitnum, cmd[0], err); + write_log (_T("IOCTL_RAW_SCSI unit %d, CMD=%d, ERR=%d "), unitnum, cmd[0], err); return 0; } int tlen = swb.spt.DataTransferLength > datalen ? datalen : swb.spt.DataTransferLength; @@ -394,9 +394,9 @@ retry: } else { reseterrormode (ciw); DWORD err = GetLastError (); - write_log (L"IOCTL_CDROM_RAW_READ(%d,%d) failed, err=%d\n", sector, rri.TrackMode, err); + write_log (_T("IOCTL_CDROM_RAW_READ(%d,%d) failed, err=%d\n"), sector, rri.TrackMode, err); if ((err == ERROR_INVALID_FUNCTION || err == ERROR_INVALID_PARAMETER) && origsector == sector && origdata == data) { - write_log (L"-> fallback to SPTI mode\n"); + write_log (_T("-> fallback to SPTI mode\n")); ciw->usesptiread = true; size = origsize; goto retry; @@ -463,7 +463,7 @@ static int cdda_openwav (struct dev_info_ioctl *ciw) wav.wFormatTag = WAVE_FORMAT_PCM; mmr = waveOutOpen (&ciw->cdda_wavehandle, WAVE_MAPPER, &wav, 0, 0, WAVE_ALLOWSYNC | WAVE_FORMAT_DIRECT); if (mmr != MMSYSERR_NOERROR) { - write_log (L"IOCTL CDDA: wave open %d\n", mmr); + write_log (_T("IOCTL CDDA: wave open %d\n"), mmr); cdda_closewav (ciw); return 0; } @@ -518,8 +518,8 @@ static void *cdda_play (void *v) cdda_pos = ciw->cdda_start; ciw->cd_last_pos = cdda_pos; oldplay = ciw->cdda_play; - write_log (L"IOCTL%s CDDA: playing from %d to %d\n", - ciw->usesptiread ? L"(SPTI)" : L"", ciw->cdda_start, ciw->cdda_end); + write_log (_T("IOCTL%s CDDA: playing from %d to %d\n"), + ciw->usesptiread ? _T("(SPTI)") : _T(""), ciw->cdda_start, ciw->cdda_end); ciw->subcodevalid = false; idleframes = ciw->cdda_delay_frames; while (ciw->cdda_paused && ciw->cdda_play > 0) { @@ -545,7 +545,7 @@ static void *cdda_play (void *v) for (int i = 2 * SUB_ENTRY_SIZE; i < SUB_CHANNEL_SIZE; i++) { if (subbuf[i]) { // non-zero R-W subchannels? int diff = cdda_pos - sector + 2; - write_log (L"-> CD+G start pos fudge -> %d (%d)\n", sector, -diff); + write_log (_T("-> CD+G start pos fudge -> %d (%d)\n"), sector, -diff); idleframes -= diff; cdda_pos = sector; seensub = true; @@ -580,7 +580,7 @@ static void *cdda_play (void *v) if (idleframes <= 0 && cdda_pos >= ciw->cdda_start && !isaudiotrack (&ciw->di.toc, cdda_pos)) { setstate (ciw, AUDIO_STATUS_PLAY_ERROR); - write_log (L"IOCTL: attempted to play data track %d\n", cdda_pos); + write_log (_T("IOCTL: attempted to play data track %d\n"), cdda_pos); goto end; // data track? } @@ -672,7 +672,7 @@ end: delete cda; ciw->cdda_play = 0; - write_log (L"IOCTL CDDA: thread killed\n"); + write_log (_T("IOCTL CDDA: thread killed\n")); return NULL; } @@ -748,7 +748,7 @@ static int ioctl_command_play (int unitnum, int startlsn, int endlsn, int scan, return 0; } if (!ciw->cdda_play) { - uae_start_thread (L"ioctl_cdda_play", cdda_play, ciw, NULL); + uae_start_thread (_T("ioctl_cdda_play"), cdda_play, ciw, NULL); } ciw->cdda_start = startlsn; ciw->cdda_end = endlsn; @@ -817,7 +817,7 @@ static int ioctl_command_qcode (int unitnum, uae_u8 *buf, int sector) memset (ciw->tempbuffer, 0, CD_RAW_SECTOR_WITH_SUBCODE_SIZE); if (!DeviceIoControl (ciw->h, IOCTL_CDROM_RAW_READ, &rri, sizeof rri, ciw->tempbuffer, CD_RAW_SECTOR_WITH_SUBCODE_SIZE, &len, NULL)) { DWORD err = GetLastError (); - write_log (L"IOCTL_CDROM_RAW_READ SUBQ CDDA sector %d returned %d\n", pos, err); + write_log (_T("IOCTL_CDROM_RAW_READ SUBQ CDDA sector %d returned %d\n"), pos, err); } reseterrormode (ciw); uae_u8 subbuf[SUB_CHANNEL_SIZE]; @@ -848,7 +848,7 @@ static int ioctl_command_qcode (int unitnum, uae_u8 *buf, int sector) tolongbcd (p + 3, msf); } -// write_log (L"%6d %02x.%02x.%02x.%02x.%02x.%02x.%02x.%02x.%02x.%02x.%02x.%02x\n", +// write_log (_T("%6d %02x.%02x.%02x.%02x.%02x.%02x.%02x.%02x.%02x.%02x.%02x.%02x\n"), // pos, p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7], p[8], p[9], p[10], p[11]); return 1; @@ -864,7 +864,7 @@ static int ioctl_command_rawread (int unitnum, uae_u8 *data, int sector, int siz int ret = 0; if (log_scsi) - write_log (L"IOCTL rawread unit=%d sector=%d blocksize=%d\n", unitnum, sector, sectorsize); + write_log (_T("IOCTL rawread unit=%d sector=%d blocksize=%d\n"), unitnum, sector, sectorsize); cdda_stop (ciw); gui_flicker_led (LED_CD, unitnum, LED_CD_ACTIVE); if (sectorsize > 0) { @@ -964,7 +964,7 @@ static int ioctl_command_readwrite (int unitnum, int sector, int size, int write seterrormode (ciw); if (SetFilePointer (ciw->h, sector * ciw->di.bytespersector, 0, FILE_BEGIN) == INVALID_SET_FILE_POINTER) { reseterrormode (ciw); - if (win32_error (ciw, unitnum, L"SetFilePointer") < 0) + if (win32_error (ciw, unitnum, _T("SetFilePointer")) < 0) continue; return 0; } @@ -982,7 +982,7 @@ static int ioctl_command_readwrite (int unitnum, int sector, int size, int write if (!WriteFile (ciw->h, p, blocksize, &dtotal, 0)) { int err; reseterrormode (ciw); - err = win32_error (ciw, unitnum, L"WriteFile"); + err = win32_error (ciw, unitnum, _T("WriteFile")); if (err < 0) continue; if (err == ERROR_WRITE_PROTECT) @@ -993,7 +993,7 @@ static int ioctl_command_readwrite (int unitnum, int sector, int size, int write dtotal = 0; if (!ReadFile (ciw->h, p, blocksize, &dtotal, 0)) { reseterrormode (ciw); - if (win32_error (ciw, unitnum, L"ReadFile") < 0) + if (win32_error (ciw, unitnum, _T("ReadFile")) < 0) continue; return 0; } @@ -1002,7 +1002,7 @@ static int ioctl_command_readwrite (int unitnum, int sector, int size, int write /* ESS Mega (CDTV) "fake" data area returns zero bytes and no error.. */ spti_read (ciw, unitnum, data, sector, 2048); if (reported++ < 100) - write_log (L"IOCTL unit %d, sector %d: ReadFile()==0. SPTI=%d\n", unitnum, sector, GetLastError ()); + write_log (_T("IOCTL unit %d, sector %d: ReadFile()==0. SPTI=%d\n"), unitnum, sector, GetLastError ()); return 1; } if (data) { @@ -1040,7 +1040,7 @@ static int fetch_geometry (struct dev_info_ioctl *ciw, int unitnum, struct devic if (!DeviceIoControl (ciw->h, IOCTL_CDROM_GET_DRIVE_GEOMETRY, NULL, 0, &geom, sizeof (geom), &len, NULL)) { DWORD err = GetLastError (); if (err == ERROR_WRONG_DISK) { - if (win32_error (ciw, unitnum, L"IOCTL_CDROM_GET_DRIVE_GEOMETRY") < 0) + if (win32_error (ciw, unitnum, _T("IOCTL_CDROM_GET_DRIVE_GEOMETRY")) < 0) continue; } reseterrormode (ciw); @@ -1111,7 +1111,7 @@ static int ioctl_command_toc2 (int unitnum, struct cd_toc_head *tocout, bool hid DWORD err = GetLastError (); reseterrormode (ciw); if (!hide_errors || (hide_errors && err == ERROR_WRONG_DISK)) { - if (win32_error (ciw, unitnum, L"IOCTL_CDROM_READ_TOC") < 0) + if (win32_error (ciw, unitnum, _T("IOCTL_CDROM_READ_TOC")) < 0) continue; } return 0; @@ -1173,7 +1173,7 @@ static void update_device_info (int unitnum) di->lun = 0; di->media_inserted = 0; di->bytespersector = 2048; - _stprintf (di->mediapath, L"\\\\.\\%c:", ciw->drvletter); + _stprintf (di->mediapath, _T("\\\\.\\%c:"), ciw->drvletter); if (fetch_geometry (ciw, unitnum, di)) { // || ioctl_command_toc (unitnum)) di->media_inserted = 1; } @@ -1183,7 +1183,7 @@ static void update_device_info (int unitnum) di->type = ciw->type == DRIVE_CDROM ? INQ_ROMD : INQ_DASD; di->unitnum = unitnum + 1; _tcscpy (di->label, ciw->drvlettername); - di->backend = L"IOCTL"; + di->backend = _T("IOCTL"); } static void trim (TCHAR *s) @@ -1202,13 +1202,13 @@ static int sys_cddev_open (struct dev_info_ioctl *ciw, int unitnum) /* buffer must be page aligned for device access */ ciw->tempbuffer = (uae_u8*)VirtualAlloc (NULL, IOCTL_DATA_BUFFER, MEM_COMMIT, PAGE_READWRITE); if (!ciw->tempbuffer) { - write_log (L"IOCTL: failed to allocate buffer"); + write_log (_T("IOCTL: failed to allocate buffer")); return 1; } - _tcscpy (ciw->di.vendorid, L"UAE"); - _stprintf (ciw->di.productid, L"SCSI CD%d IMG", unitnum); - _tcscpy (ciw->di.revision, L"0.1"); + _tcscpy (ciw->di.vendorid, _T("UAE")); + _stprintf (ciw->di.productid, _T("SCSI CD%d IMG"), unitnum); + _tcscpy (ciw->di.revision, _T("0.1")); if (spti_inquiry (ciw, unitnum, inquiry)) { char tmp[20]; TCHAR *s; @@ -1234,7 +1234,7 @@ static int sys_cddev_open (struct dev_info_ioctl *ciw, int unitnum) } if (!open_createfile (ciw, 0)) { - write_log (L"IOCTL: failed to open '%s', err=%d\n", ciw->devname, GetLastError ()); + write_log (_T("IOCTL: failed to open '%s', err=%d\n"), ciw->devname, GetLastError ()); goto error; } uae_sem_init (&ciw->sub_sem, 0, 1); @@ -1243,12 +1243,12 @@ static int sys_cddev_open (struct dev_info_ioctl *ciw, int unitnum) update_device_info (unitnum); ciw->open = true; //ciw->usesptiread = true; - write_log (L"IOCTL: device '%s' (%s/%s/%s) opened succesfully (unit=%d,media=%d)\n", + write_log (_T("IOCTL: device '%s' (%s/%s/%s) opened succesfully (unit=%d,media=%d)\n"), ciw->devname, ciw->di.vendorid, ciw->di.productid, ciw->di.revision, unitnum, ciw->di.media_inserted); return 0; error: - win32_error (ciw, unitnum, L"CreateFile"); + win32_error (ciw, unitnum, _T("CreateFile")); VirtualFree (ciw->tempbuffer, 0, MEM_RELEASE); ciw->tempbuffer = NULL; CloseHandle (ciw->h); @@ -1268,7 +1268,7 @@ static void sys_cddev_close (struct dev_info_ioctl *ciw, int unitnum) uae_sem_destroy (&ciw->sub_sem); uae_sem_destroy (&ciw->sub_sem2); ciw->open = false; - write_log (L"IOCTL: device '%s' closed\n", ciw->devname, unitnum); + write_log (_T("IOCTL: device '%s' closed\n"), ciw->devname, unitnum); } static int open_device (int unitnum, const TCHAR *ident, int flags) @@ -1319,7 +1319,7 @@ static int total_devices; static void close_bus (void) { if (!bus_open) { - write_log (L"IOCTL close_bus() when already closed!\n"); + write_log (_T("IOCTL close_bus() when already closed!\n")); return; } total_devices = 0; @@ -1330,7 +1330,7 @@ static void close_bus (void) unittable[i] = 0; } bus_open = 0; - write_log (L"IOCTL driver closed.\n"); + write_log (_T("IOCTL driver closed.\n")); } static int open_bus (int flags) @@ -1339,30 +1339,30 @@ static int open_bus (int flags) int drive; if (bus_open) { - write_log (L"IOCTL open_bus() more than once!\n"); + write_log (_T("IOCTL open_bus() more than once!\n")); return 1; } total_devices = 0; dwDriveMask = GetLogicalDrives (); if (log_scsi) - write_log (L"IOCTL: drive mask = %08X\n", dwDriveMask); + write_log (_T("IOCTL: drive mask = %08X\n"), dwDriveMask); dwDriveMask >>= 2; // Skip A and B drives... for (drive = 'C'; drive <= 'Z' && total_devices < MAX_TOTAL_SCSI_DEVICES; drive++) { if (dwDriveMask & 1) { int dt; TCHAR tmp[10]; - _stprintf (tmp, L"%c:\\", drive); + _stprintf (tmp, _T("%c:\\"), drive); dt = GetDriveType (tmp); if (log_scsi) - write_log (L"IOCTL: drive %c type %d\n", drive, dt); + write_log (_T("IOCTL: drive %c type %d\n"), drive, dt); if (dt == DRIVE_CDROM) { if (log_scsi) - write_log (L"IOCTL: drive %c: = unit %d\n", drive, total_devices); + write_log (_T("IOCTL: drive %c: = unit %d\n"), drive, total_devices); ciw32[total_devices].drvletter = drive; _tcscpy (ciw32[total_devices].drvlettername, tmp); ciw32[total_devices].type = dt; ciw32[total_devices].di.bytespersector = 2048; - _stprintf (ciw32[total_devices].devname, L"\\\\.\\%c:", drive); + _stprintf (ciw32[total_devices].devname, _T("\\\\.\\%c:"), drive); ciw32[total_devices].h = INVALID_HANDLE_VALUE; total_devices++; } @@ -1370,7 +1370,7 @@ static int open_bus (int flags) dwDriveMask >>= 1; } bus_open = 1; - write_log (L"IOCTL driver open, %d devices.\n", total_devices); + write_log (_T("IOCTL driver open, %d devices.\n"), total_devices); return total_devices; } @@ -1403,7 +1403,7 @@ bool win32_ioctl_media_change (TCHAR driveletter, int insert) for (int i = 0; i < total_devices; i++) { struct dev_info_ioctl *ciw = &ciw32[i]; if (ciw->drvletter == driveletter && ciw->di.media_inserted != insert) { - write_log (L"IOCTL: media change %s %d\n", ciw->drvlettername, insert); + write_log (_T("IOCTL: media change %s %d\n"), ciw->drvlettername, insert); ciw->di.media_inserted = insert; int unitnum = getunitnum (ciw); if (unitnum >= 0) { @@ -1433,7 +1433,7 @@ static int ioctl_scsiemu (int unitnum, uae_u8 *cmd) } struct device_functions devicefunc_win32_ioctl = { - L"IOCTL", + _T("IOCTL"), open_bus, close_bus, open_device, close_device, info_device, 0, 0, 0, ioctl_command_pause, ioctl_command_stop, ioctl_command_play, ioctl_command_volume, ioctl_command_qcode, diff --git a/od-win32/blkdev_win32_spti.cpp b/od-win32/blkdev_win32_spti.cpp index b7d9346b..c5f42797 100644 --- a/od-win32/blkdev_win32_spti.cpp +++ b/od-win32/blkdev_win32_spti.cpp @@ -111,7 +111,7 @@ static int doscsi (struct dev_info_spti *di, int unitnum, SCSI_PASS_THROUGH_DIRE *err = 0; if (log_scsi) { - write_log (L"SCSI, H=%X:%d:%d:%d:%d: ", di->handle, di->bus, di->path, di->target, di->lun); + write_log (_T("SCSI, H=%X:%d:%d:%d:%d: "), di->handle, di->bus, di->path, di->target, di->lun); scsi_log_before (swb->spt.Cdb, swb->spt.CdbLength, swb->spt.DataIn == SCSI_IOCTL_DATA_OUT ? (uae_u8*)swb->spt.DataBuffer : NULL, swb->spt.DataTransferLength); } @@ -129,8 +129,8 @@ static int doscsi (struct dev_info_spti *di, int unitnum, SCSI_PASS_THROUGH_DIRE if (!status) { int lasterror = GetLastError(); *err = lasterror; - write_log (L"SCSI ERROR, H=%X:%d:%d:%d:%d: ", di->handle, di->bus, di->path, di->target, di->lun); - write_log (L"Status = %d, Error code = %d, LastError=%d\n", status, swb->spt.ScsiStatus, lasterror); + write_log (_T("SCSI ERROR, H=%X:%d:%d:%d:%d: "), di->handle, di->bus, di->path, di->target, di->lun); + write_log (_T("Status = %d, Error code = %d, LastError=%d\n"), status, swb->spt.ScsiStatus, lasterror); scsi_log_before (swb->spt.Cdb, swb->spt.CdbLength, swb->spt.DataIn == SCSI_IOCTL_DATA_OUT ? (uae_u8*)swb->spt.DataBuffer : 0,swb->spt.DataTransferLength); } @@ -336,7 +336,7 @@ static int rescan (void); static void close_scsi_bus (void) { if (!bus_open) { - write_log (L"SPTI close_bus() when already closed!\n"); + write_log (_T("SPTI close_bus() when already closed!\n")); return; } for (int i = 0; i < MAX_TOTAL_SCSI_DEVICES; i++) { @@ -345,20 +345,20 @@ static void close_scsi_bus (void) } total_devices = 0; bus_open = 0; - write_log (L"SPTI driver closed.\n"); + write_log (_T("SPTI driver closed.\n")); } static int open_scsi_bus (int flags) { if (bus_open) { - write_log (L"SPTI open_bus() more than once!\n"); + write_log (_T("SPTI open_bus() more than once!\n")); return 1; } total_devices = 0; uae_sem_init (&scgp_sem, 0, 1); rescan (); bus_open = 1; - write_log (L"SPTI driver open, %d devices.\n", total_devices); + write_log (_T("SPTI driver open, %d devices.\n"), total_devices); return total_devices; } @@ -400,7 +400,7 @@ static int mediacheck_full (struct dev_info_spti *di, int unitnum, struct device dinfo->write_protected = (p[3] & 0x80) ? 1 : 0; } } - // write_log (L"mediacheck_full(%d,%d,%d,%d,%d)\n", + // write_log (_T("mediacheck_full(%d,%d,%d,%d,%d)\n"), // di->bytespersector, di->sectorspertrack, di->trackspercylinder, di->cylinders, di->write_protected); return 1; } @@ -421,9 +421,9 @@ static void update_device_info (int unitnum) mediacheck_full (dispti, unitnum, di); di->type = dispti->type; di->unitnum = unitnum + 1; - di->backend = L"SPTI"; + di->backend = _T("SPTI"); if (log_scsi) { - write_log (L"MI=%d TP=%d WP=%d CY=%d BK=%d RMB=%d '%s'\n", + write_log (_T("MI=%d TP=%d WP=%d CY=%d BK=%d RMB=%d '%s'\n"), di->media_inserted, di->type, di->write_protected, di->cylinders, di->bytespersector, di->removable, di->label); } } @@ -441,7 +441,7 @@ static void checkcapabilities (struct dev_info_spti *di) &query, sizeof query, &desc, sizeof desc, &ret, NULL); if (status) { if (desc.Version > offsetof (STORAGE_ADAPTER_DESCRIPTOR, BusType)) - write_log (L"SCSI CAPS: BusType=%d, MaxTransfer=0x%08X, Mask=0x%08X\n", + write_log (_T("SCSI CAPS: BusType=%d, MaxTransfer=0x%08X, Mask=0x%08X\n"), desc.BusType, desc.MaximumTransferLength, desc.AlignmentMask); } } @@ -459,7 +459,7 @@ static int inquiry (struct dev_info_spti *di, int unitnum, uae_u8 *inquirydata) di->type = 0x1f; if (!p) { if (log_scsi) - write_log (L"SPTI: INQUIRY failed\n"); + write_log (_T("SPTI: INQUIRY failed\n")); return 0; } inqlen = outlen > INQUIRY_SIZE ? INQUIRY_SIZE : outlen; @@ -481,7 +481,7 @@ static int inquiry (struct dev_info_spti *di, int unitnum, uae_u8 *inquirydata) memcpy (tmp, p + 16, 16); tmp[16] = 0; s2 = au (tmp); - write_log (L"SPTI: INQUIRY: %02X%02X%02X %d '%s' '%s'\n", + write_log (_T("SPTI: INQUIRY: %02X%02X%02X %d '%s' '%s'\n"), p[0], p[1], p[2], di->isatapi, s1, s2); xfree (s2); xfree (s1); @@ -497,7 +497,7 @@ static int open_scsi_device2 (struct dev_info_spti *di, int unitnum) if (di->bus >= 0) { dev = xmalloc (TCHAR, 100); - _stprintf (dev, L"\\\\.\\Scsi%d:", di->bus); + _stprintf (dev, _T("\\\\.\\Scsi%d:"), di->bus); } else { dev = my_strdup (di->drvpath); } @@ -506,12 +506,12 @@ static int open_scsi_device2 (struct dev_info_spti *di, int unitnum) h = CreateFile(dev,GENERIC_READ|GENERIC_WRITE,FILE_SHARE_READ|FILE_SHARE_WRITE,NULL,OPEN_EXISTING,0,NULL); di->handle = h; if (h == INVALID_HANDLE_VALUE) { - write_log (L"SPTI: failed to open unit %d err=%d ('%s')\n", unitnum, GetLastError (), dev); + write_log (_T("SPTI: failed to open unit %d err=%d ('%s')\n"), unitnum, GetLastError (), dev); } else { uae_u8 inqdata[INQUIRY_SIZE + 1] = { 0 }; checkcapabilities (di); if (!inquiry (di, unitnum, inqdata)) { - write_log (L"SPTI: inquiry failed unit %d ('%s':%d:%d:%d:%d)\n", unitnum, dev, + write_log (_T("SPTI: inquiry failed unit %d ('%s':%d:%d:%d:%d)\n"), unitnum, dev, di->bus, di->path, di->target, di->lun); close_scsi_device2 (di); xfree (dev); @@ -521,13 +521,13 @@ static int open_scsi_device2 (struct dev_info_spti *di, int unitnum) di->name = my_strdup_ansi ((char*)inqdata + 8); if (di->type == INQ_ROMD) { di->mediainserted = mediacheck (di, unitnum); - write_log (L"SPTI: unit %d (%c:\\) opened [%s], %s, '%s'\n", + write_log (_T("SPTI: unit %d (%c:\\) opened [%s], %s, '%s'\n"), unitnum, di->drvletter ? di->drvletter : '*', - di->isatapi ? L"ATAPI" : L"SCSI", - di->mediainserted ? L"media inserted" : L"drive empty", + di->isatapi ? _T("ATAPI") : _T("SCSI"), + di->mediainserted ? _T("media inserted") : _T("drive empty"), di->name); } else { - write_log (L"SPTI: unit %d, type %d, '%s'\n", + write_log (_T("SPTI: unit %d, type %d, '%s'\n"), unitnum, di->type, di->name); } di->inquirydata = xmalloc (uae_u8, INQUIRY_SIZE); @@ -588,7 +588,7 @@ static int adddrive (const TCHAR *drvpath, int bus, int pathid, int targetid, in if (!_tcscmp (drvpath, di->drvpath)) return 0; } - write_log (L"SPTI: unit %d '%s' added\n", total_devices, drvpath); + write_log (_T("SPTI: unit %d '%s' added\n"), total_devices, drvpath); di = &dev_info[total_devices]; di->drvpath = my_strdup (drvpath); di->type = 0; @@ -603,10 +603,10 @@ static int adddrive (const TCHAR *drvpath, int bus, int pathid, int targetid, in for (TCHAR drvletter = 'C'; drvletter <= 'Z'; drvletter++) { TCHAR drvname[10]; TCHAR volname[MAX_DPATH], volname2[MAX_DPATH]; - _stprintf (drvname, L"%c:\\", drvletter); + _stprintf (drvname, _T("%c:\\"), drvletter); if (GetVolumeNameForVolumeMountPoint (drvname, volname, sizeof volname / sizeof (TCHAR))) { TCHAR drvpath2[MAX_DPATH]; - _stprintf (drvpath2, L"%s\\", di->drvpath); + _stprintf (drvpath2, _T("%s\\"), di->drvpath); if (GetVolumeNameForVolumeMountPoint (drvpath2, volname2, sizeof volname2 / sizeof (TCHAR))) { if (!_tcscmp (volname, volname2)) { di->drvletter = drvletter; @@ -623,7 +623,7 @@ static int adddrive (const TCHAR *drvpath, int bus, int pathid, int targetid, in if (open_scsi_device2 (&dev_info[cnt], cnt)) { for (i = 0; i < cnt; i++) { if (!memcmp (di->inquirydata, dev_info[i].inquirydata, INQUIRY_SIZE) && di->scanmode != dev_info[i].scanmode) { - write_log (L"duplicate device, skipped..\n"); + write_log (_T("duplicate device, skipped..\n")); break; } } @@ -657,7 +657,7 @@ bool win32_spti_media_change (TCHAR driveletter, int insert) for (int i = 0; i < total_devices; i++) { struct dev_info_spti *di = &dev_info[i]; if (di->drvletter == driveletter && di->mediainserted != insert) { - write_log (L"SPTI: media change %c %d\n", dev_info[i].drvletter, insert); + write_log (_T("SPTI: media change %c %d\n"), dev_info[i].drvletter, insert); di->mediainserted = insert; int unitnum = getunitnum (di); if (unitnum >= 0) { @@ -758,7 +758,7 @@ static void scanscsi (void) idx = 0; for (;;) { - _stprintf (DeviceName, L"\\\\.\\Scsi%d:", idx++); + _stprintf (DeviceName, _T("\\\\.\\Scsi%d:"), idx++); h = CreateFile (DeviceName, GENERIC_READ | GENERIC_WRITE, 0, @@ -777,7 +777,7 @@ static void scanscsi (void) 0, &bytesTransferred, NULL)) { - write_log (L"Rescan SCSI port %d failed [Error %d]\n", idx - 1, GetLastError()); + write_log (_T("Rescan SCSI port %d failed [Error %d]\n"), idx - 1, GetLastError()); CloseHandle (h); continue; } @@ -794,7 +794,7 @@ static void scanscsi (void) NULL); if (!status) { - write_log (L"Error in IOCTL_SCSI_GET_INQUIRY_DATA\n" ); + write_log (_T("Error in IOCTL_SCSI_GET_INQUIRY_DATA\n") ); CloseHandle (h); continue; } @@ -807,13 +807,13 @@ static void scanscsi (void) TCHAR label[100]; int type = InquiryData->InquiryData[0] & 0x1f; Claimed = InquiryData->DeviceClaimed; - write_log (L"SCSI=%d Initiator=%d Path=%d Target=%d LUN=%d Claimed=%s Type=%d\n", + write_log (_T("SCSI=%d Initiator=%d Path=%d Target=%d LUN=%d Claimed=%s Type=%d\n"), idx - 1, BusData->InitiatorBusId, InquiryData->PathId, InquiryData->TargetId, - InquiryData->Lun, Claimed ? L"Yes" : L"No ", type); + InquiryData->Lun, Claimed ? _T("Yes") : _T("No "), type); if (Claimed == 0 && !luncheck) { luncheck = 1; - _stprintf (label, L"SCSI(%d):%d:%d:%d:%d", idx - 1, BusData->InitiatorBusId, + _stprintf (label, _T("SCSI(%d):%d:%d:%d:%d"), idx - 1, BusData->InitiatorBusId, InquiryData->PathId, InquiryData->TargetId, InquiryData->Lun); adddrive (label, idx - 1, InquiryData->PathId, InquiryData->TargetId, InquiryData->Lun, 3); } @@ -829,7 +829,7 @@ static const GUID *guids[] = { &GUID_DEVCLASS_IMAGE, &GUID_DEVCLASS_TAPEDRIVE, NULL }; -static const TCHAR *scsinames[] = { L"Tape", L"Scanner", L"Changer", NULL }; +static const TCHAR *scsinames[] = { _T("Tape"), _T("Scanner"), _T("Changer"), NULL }; static int rescan (void) { @@ -853,7 +853,7 @@ static int rescan (void) for (idx = 0; idx < max; idx++) { TCHAR tmp[100]; HANDLE h; - _stprintf (tmp, L"\\\\.\\%s%d", scsinames[idx2], idx); + _stprintf (tmp, _T("\\\\.\\%s%d"), scsinames[idx2], idx); h = CreateFile (tmp, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL); @@ -866,9 +866,9 @@ static int rescan (void) } } if (currprefs.win32_uaescsimode == UAESCSI_SPTISCAN) { - write_log (L"SCSI adapter enumeration..\n"); + write_log (_T("SCSI adapter enumeration..\n")); scanscsi (); - write_log (L"SCSI adapter enumeration ends\n"); + write_log (_T("SCSI adapter enumeration ends\n")); } return 1; } @@ -878,7 +878,7 @@ static int rescan (void) struct device_functions devicefunc_win32_spti = { - L"SPTI", + _T("SPTI"), open_scsi_bus, close_scsi_bus, open_scsi_device, close_scsi_device, info_device, execscsicmd_out, execscsicmd_in, execscsicmd_direct, 0, 0, 0, 0, 0, 0, 0, 0, 0, check_isatapi, 0, 0 diff --git a/od-win32/bsdsock.cpp b/od-win32/bsdsock.cpp index 21ab6083..c8fc3d7c 100644 --- a/od-win32/bsdsock.cpp +++ b/od-win32/bsdsock.cpp @@ -164,12 +164,12 @@ static int mySockStartup(void) WIN32GUI_LoadUIString(IDS_WSOCK2NEEDED, szMessage, MAX_DPATH); gui_message(szMessage); } else - write_log (L"BSDSOCK: ERROR - Unable to initialize Windows socket layer! Error code: %d\n", lasterror); + write_log (_T("BSDSOCK: ERROR - Unable to initialize Windows socket layer! Error code: %d\n"), lasterror); return 0; } ss = au (bsd->wsbData.szDescription); - write_log (L"BSDSOCK: using %s\n", ss); + write_log (_T("BSDSOCK: using %s\n"), ss); xfree (ss); // make sure WSP/NSPStartup gets called from within the regular stack // (Windows 95/98 need this) @@ -177,7 +177,7 @@ static int mySockStartup(void) closesocket(dummy); result = 1; } else { - write_log (L"BSDSOCK: ERROR - WSPStartup/NSPStartup failed! Error code: %d\n", + write_log (_T("BSDSOCK: ERROR - WSPStartup/NSPStartup failed! Error code: %d\n"), WSAGetLastError()); result = 0; } @@ -209,17 +209,17 @@ int init_socket_layer (void) wc.hCursor = LoadCursor (NULL, IDC_ARROW); wc.hbrBackground = (HBRUSH)GetStockObject (BLACK_BRUSH); wc.lpszMenuName = 0; - wc.lpszClassName = L"SocketFun"; + wc.lpszClassName = _T("SocketFun"); RegisterClass(&wc); bsd->hSockWnd = CreateWindowEx (0, - L"SocketFun", L"WinUAE Socket Window", + _T("SocketFun"), _T("WinUAE Socket Window"), WS_POPUP, 0, 0, 1, 1, NULL, NULL, 0, NULL); bsd->hSockThread = THREAD(sock_thread, NULL); if (!bsd->hSockWnd) { - write_log (L"bsdsocket initialization failed\n"); + write_log (_T("bsdsocket initialization failed\n")); deinit_socket_layer(); return 0; } @@ -283,7 +283,7 @@ void deinit_socket_layer(void) bsd->hSockReqHandled = NULL; DestroyWindow (bsd->hSockWnd); bsd->hSockWnd = NULL; - UnregisterClass (L"SocketFun", hInst); + UnregisterClass (_T("SocketFun"), hInst); } close_selectget_threads (); WSACleanup(); @@ -405,7 +405,7 @@ static void sockmsg(unsigned int msg, WPARAM wParam, LPARAM lParam) { // cancel socket event WSAAsyncSelect((SOCKET)wParam, hWndSelector ? hAmigaWnd : bsd->hSockWnd, 0, 0); - BSDTRACE((L"unknown sockmsg %d\n", index)); + BSDTRACE((_T("unknown sockmsg %d\n"), index)); return; } @@ -447,7 +447,7 @@ static void sockmsg(unsigned int msg, WPARAM wParam, LPARAM lParam) if (sb->sb_errno >= 1001 && sb->sb_errno <= 1005) { bsdsocklib_setherrno(sb, sb->sb_errno - 1000); } else if (sb->sb_errno == 55) { // ENOBUFS - write_log (L"BSDSOCK: ERROR - Buffer overflow - %d bytes requested\n", + write_log (_T("BSDSOCK: ERROR - Buffer overflow - %d bytes requested\n"), WSAGETASYNCBUFLEN(lParam)); } } else { @@ -485,7 +485,7 @@ static unsigned int allocasyncmsg(SB,uae_u32 sd,SOCKET s) unlocksigqueue(); bsdsocklib_seterrno(sb, 12); // ENOMEM - write_log (L"BSDSOCK: ERROR - Async operation completion table overflow\n"); + write_log (_T("BSDSOCK: ERROR - Async operation completion table overflow\n")); return 0; } @@ -565,14 +565,14 @@ int host_dup2socket(TrapContext *context, SB, int fd1, int fd2) { SOCKET s1,s2; - BSDTRACE((L"dup2socket(%d,%d) -> ",fd1,fd2)); + BSDTRACE((_T("dup2socket(%d,%d) -> "),fd1,fd2)); fd1++; s1 = getsock(sb, fd1); if (s1 != INVALID_SOCKET) { if (fd2 != -1) { if ((unsigned int) (fd2) >= (unsigned int) sb->dtablesize) { - BSDTRACE ((L"Bad file descriptor (%d)\n", fd2)); + BSDTRACE ((_T("Bad file descriptor (%d)\n"), fd2)); bsdsocklib_seterrno (sb, 9); /* EBADF */ } fd2++; @@ -582,16 +582,16 @@ int host_dup2socket(TrapContext *context, SB, int fd1, int fd2) closesocket(s2); } setsd(context, sb, fd2, s1); - BSDTRACE((L"0\n")); + BSDTRACE((_T("0\n"))); return 0; } else { fd2 = getsd(context, sb, 1); setsd(context, sb, fd2, s1); - BSDTRACE((L"%d\n",fd2)); + BSDTRACE((_T("%d\n"),fd2)); return (fd2 - 1); } } - BSDTRACE((L"-1\n")); + BSDTRACE((_T("-1\n"))); return -1; } @@ -602,7 +602,7 @@ int host_socket(TrapContext *context, SB, int af, int type, int protocol) unsigned long nonblocking = 1; int faketype; - BSDTRACE((L"socket(%s,%s,%d) -> ",af == AF_INET ? L"AF_INET" : L"AF_other",type == SOCK_STREAM ? L"SOCK_STREAM" : type == SOCK_DGRAM ? L"SOCK_DGRAM " : L"SOCK_RAW",protocol)); + BSDTRACE((_T("socket(%s,%s,%d) -> "),af == AF_INET ? _T("AF_INET") : _T("AF_other"),type == SOCK_STREAM ? _T("SOCK_STREAM") : type == SOCK_DGRAM ? _T("SOCK_DGRAM ") : _T("SOCK_RAW"),protocol)); faketype = type; if (protocol == IPPROTO_UDP && type == SOCK_RAW && !rawsockets) @@ -610,7 +610,7 @@ int host_socket(TrapContext *context, SB, int af, int type, int protocol) if ((s = socket(af,faketype,protocol)) == INVALID_SOCKET) { SETERRNO; - BSDTRACE((L"failed (%d)\n",sb->sb_errno)); + BSDTRACE((_T("failed (%d)\n"),sb->sb_errno)); return -1; } else { sd = getsd(context, sb,s); @@ -618,7 +618,7 @@ int host_socket(TrapContext *context, SB, int af, int type, int protocol) sb->ftable[sd-1] = SF_BLOCKING; ioctlsocket(s,FIONBIO,&nonblocking); - BSDTRACE((L" -> Socket=%d\n",sd)); + BSDTRACE((_T(" -> Socket=%d\n"),sd)); if (type == SOCK_RAW) { if (protocol==IPPROTO_UDP) { @@ -629,7 +629,7 @@ int host_socket(TrapContext *context, SB, int af, int type, int protocol) sin.sin_family = AF_INET; sin.sin_addr.s_addr = INADDR_ANY; if (bind(s,(struct sockaddr *)&sin,sizeof(sin))) - write_log (L"IPPROTO_ICMP socket bind() failed: %d\n", WSAGetLastError ()); + write_log (_T("IPPROTO_ICMP socket bind() failed: %d\n"), WSAGetLastError ()); } else if (protocol==IPPROTO_RAW) { sb->ftable[sd-1] |= SF_RAW_RAW; } @@ -645,12 +645,12 @@ uae_u32 host_bind(TrapContext *context, SB, uae_u32 sd, uae_u32 name, uae_u32 na SOCKET s; sd++; - BSDTRACE((L"bind(%d,0x%x,%d) -> ",sd, name, namelen)); + BSDTRACE((_T("bind(%d,0x%x,%d) -> "),sd, name, namelen)); s = getsock(sb, sd); if (s != INVALID_SOCKET) { if (namelen <= sizeof buf) { - if (!addr_valid (L"host_bind", name, namelen)) + if (!addr_valid (_T("host_bind"), name, namelen)) return 0; memcpy(buf, get_real_address (name), namelen); @@ -659,11 +659,11 @@ uae_u32 host_bind(TrapContext *context, SB, uae_u32 sd, uae_u32 name, uae_u32 na if ((success = bind(s,(struct sockaddr *)buf, namelen)) != 0) { SETERRNO; - BSDTRACE((L"failed (%d)\n",sb->sb_errno)); + BSDTRACE((_T("failed (%d)\n"),sb->sb_errno)); } else - BSDTRACE((L"OK\n")); + BSDTRACE((_T("OK\n"))); } else - write_log (L"BSDSOCK: ERROR - Excessive namelen (%d) in bind()!\n", namelen); + write_log (_T("BSDSOCK: ERROR - Excessive namelen (%d) in bind()!\n"), namelen); } return success; @@ -675,15 +675,15 @@ uae_u32 host_listen(TrapContext *context, SB, uae_u32 sd, uae_u32 backlog) uae_u32 success = -1; sd++; - BSDTRACE((L"listen(%d,%d) -> ", sd, backlog)); + BSDTRACE((_T("listen(%d,%d) -> "), sd, backlog)); s = getsock(sb, sd); if (s != INVALID_SOCKET) { if ((success = listen(s,backlog)) != 0) { SETERRNO; - BSDTRACE((L"failed (%d)\n",sb->sb_errno)); + BSDTRACE((_T("failed (%d)\n"),sb->sb_errno)); } else - BSDTRACE((L"OK\n")); + BSDTRACE((_T("OK\n"))); } return success; } @@ -699,7 +699,7 @@ void host_accept(TrapContext *context, SB, uae_u32 sd, uae_u32 name, uae_u32 nam sd++; if (name != 0) { - if (!addr_valid (L"host_accept1", name, sizeof(struct sockaddr)) || !addr_valid (L"host_accept2", namelen, 4)) + if (!addr_valid (_T("host_accept1"), name, sizeof(struct sockaddr)) || !addr_valid (_T("host_accept2"), namelen, 4)) return; rp_nameuae = rp_name = (struct sockaddr *)get_real_address (name); hlenuae = hlen = get_long (namelen); @@ -712,7 +712,7 @@ void host_accept(TrapContext *context, SB, uae_u32 sd, uae_u32 name, uae_u32 nam rp_name = &sockaddr; hlen = sizeof(sockaddr); } - BSDTRACE((L"accept(%d,%d,%d) -> ",sd,name,hlenuae)); + BSDTRACE((_T("accept(%d,%d,%d) -> "),sd,name,hlenuae)); s = getsock(sb, (int)sd); @@ -741,7 +741,7 @@ void host_accept(TrapContext *context, SB, uae_u32 sd, uae_u32 name, uae_u32 nam } if (sb->eintr) { - BSDTRACE((L"[interrupted]\n")); + BSDTRACE((_T("[interrupted]\n"))); ENDBLOCKING; return; } @@ -752,7 +752,7 @@ void host_accept(TrapContext *context, SB, uae_u32 sd, uae_u32 name, uae_u32 nam SETERRNO; if (sb->sb_errno == WSAEWOULDBLOCK - WSABASEERR) - write_log (L"BSDSOCK: ERRRO - accept() would block despite FD_ACCEPT message\n"); + write_log (_T("BSDSOCK: ERRRO - accept() would block despite FD_ACCEPT message\n")); } } } @@ -760,7 +760,7 @@ void host_accept(TrapContext *context, SB, uae_u32 sd, uae_u32 name, uae_u32 nam if (s2 == INVALID_SOCKET) { sb->resultval = -1; - BSDTRACE((L"failed (%d)\n",sb->sb_errno)); + BSDTRACE((_T("failed (%d)\n"),sb->sb_errno)); } else { sb->resultval = getsd(context, sb, s2); sb->ftable[sb->resultval - 1] = sb->ftable[sd - 1]; // new socket inherits the old socket's properties @@ -780,7 +780,7 @@ void host_accept(TrapContext *context, SB, uae_u32 sd, uae_u32 name, uae_u32 nam } } } - BSDTRACE((L"%d/%d\n", sb->resultval, hlen)); + BSDTRACE((_T("%d/%d\n"), sb->resultval, hlen)); } ENDBLOCKING; @@ -849,7 +849,7 @@ static BOOL HandleStuff(void) // 100ms sleepiness might need some tuning... //if(WaitForSingleObject( hSockReq, 100 ) == WAIT_OBJECT_0 ) { - BSDTRACE((L"sockreq start %d:%d\n", sockreq.packet_type,sockreq.wscnt)); + BSDTRACE((_T("sockreq start %d:%d\n"), sockreq.packet_type,sockreq.wscnt)); switch(sockreq.packet_type) { case connect_req: @@ -883,7 +883,7 @@ static BOOL HandleStuff(void) break; case last_req: default: - write_log (L"BSDSOCK: Invalid sock-thread request!\n"); + write_log (_T("BSDSOCK: Invalid sock-thread request!\n")); handled = FALSE; break; } @@ -893,7 +893,7 @@ static BOOL HandleStuff(void) SETERRNO; } } - BSDTRACE((L"sockreq end %d,%d,%d:%d\n", sockreq.packet_type,sockreq.sb->resultval,sockreq.sb->sb_errno,sockreq.wscnt)); + BSDTRACE((_T("sockreq end %d,%d,%d:%d\n"), sockreq.packet_type,sockreq.sb->resultval,sockreq.sb->sb_errno,sockreq.wscnt)); SetEvent(bsd->hSockReqHandled); } } else { @@ -906,7 +906,7 @@ static LRESULT CALLBACK SocketWindowProc(HWND hwnd, UINT message, WPARAM wParam, { if(message >= 0xB000 && message < 0xB000 + MAXPENDINGASYNC * 2) { #ifdef TRACING_ENABLED - write_log (L"sockmsg(0x%x[%d], 0x%x, 0x%x)\n", message, (message - 0xb000) / 2, wParam, lParam ); + write_log (_T("sockmsg(0x%x[%d], 0x%x, 0x%x)\n"), message, (message - 0xb000) / 2, wParam, lParam ); #endif sockmsg(message, wParam, lParam); return 0; @@ -947,7 +947,7 @@ static unsigned int sock_thread2(void *blah) } } } - write_log (L"BSDSOCK: We have exited our sock_thread()\n"); + write_log (_T("BSDSOCK: We have exited our sock_thread()\n")); THREADEND(result); return result; } @@ -973,9 +973,9 @@ void host_connect(TrapContext *context, SB, uae_u32 sd, uae_u32 name, uae_u32 na sd++; wscnt = ++wscounter; - BSDTRACE((L"connect(%d,0x%x,%d):%d -> ", sd, name, namelen, wscnt)); + BSDTRACE((_T("connect(%d,0x%x,%d):%d -> "), sd, name, namelen, wscnt)); - if (!addr_valid (L"host_connect", name, namelen)) + if (!addr_valid (_T("host_connect"), name, namelen)) return; s = getsock(sb,(int)sd); @@ -1034,10 +1034,10 @@ void host_connect(TrapContext *context, SB, uae_u32 sd, uae_u32 name, uae_u32 na } } } else { - write_log (L"BSDSOCK: WARNING - Excessive namelen (%d) in connect():%d!\n", namelen, wscnt); + write_log (_T("BSDSOCK: WARNING - Excessive namelen (%d) in connect():%d!\n"), namelen, wscnt); } } - BSDTRACE((L" -> connect %d:%d\n",sb->sb_errno, wscnt)); + BSDTRACE((_T(" -> connect %d:%d\n"),sb->sb_errno, wscnt)); } @@ -1078,23 +1078,23 @@ void host_sendto (TrapContext *context, SB, uae_u32 sd, uae_u32 msg, uae_u32 len #ifdef TRACING_ENABLED if (to) - BSDTRACE((L"sendto(%d,0x%x,%d,0x%x,0x%x,%d):%d-> ",sd,msg,len,flags,to,tolen,wscnt)); + BSDTRACE((_T("sendto(%d,0x%x,%d,0x%x,0x%x,%d):%d-> "),sd,msg,len,flags,to,tolen,wscnt)); else - BSDTRACE((L"send(%d,0x%x,%d,%d):%d -> ",sd,msg,len,flags,wscnt)); + BSDTRACE((_T("send(%d,0x%x,%d,%d):%d -> "),sd,msg,len,flags,wscnt)); #endif sd++; s = getsock(sb,sd); if (s != INVALID_SOCKET) { - if (!addr_valid (L"host_sendto1", msg, 4)) + if (!addr_valid (_T("host_sendto1"), msg, 4)) return; realpt = (char*)get_real_address (msg); if (to) { if (tolen > sizeof buf) { - write_log (L"BSDSOCK: WARNING - Target address in sendto() too large (%d):%d!\n", tolen,wscnt); + write_log (_T("BSDSOCK: WARNING - Target address in sendto() too large (%d):%d!\n"), tolen,wscnt); } else { - if (!addr_valid (L"host_sendto2", to, tolen)) + if (!addr_valid (_T("host_sendto2"), to, tolen)) return; memcpy(buf, get_real_address (to), tolen); // some Amiga software sets this field to bogus values @@ -1134,7 +1134,7 @@ void host_sendto (TrapContext *context, SB, uae_u32 sd, uae_u32 msg, uae_u32 len sb->ftable[sd-1]&= ~SF_RAW_RAW; sb->ftable[sd-1]|= SF_RAW_RUDP; } else { - write_log(L"Unknown RAW protocol %d\n", realpt[9]); + write_log(_T("Unknown RAW protocol %d\n"), realpt[9]); } } @@ -1205,7 +1205,7 @@ void host_sendto (TrapContext *context, SB, uae_u32 sd, uae_u32 msg, uae_u32 len } if (sb->eintr) { - BSDTRACE((L"[interrupted]\n")); + BSDTRACE((_T("[interrupted]\n"))); return; } } else @@ -1219,9 +1219,9 @@ void host_sendto (TrapContext *context, SB, uae_u32 sd, uae_u32 msg, uae_u32 len #ifdef TRACING_ENABLED if (sb->resultval == -1) - BSDTRACE((L"sendto failed (%d):%d\n",sb->sb_errno,wscnt)); + BSDTRACE((_T("sendto failed (%d):%d\n"),sb->sb_errno,wscnt)); else - BSDTRACE((L"sendto %d:%d\n",sb->resultval,wscnt)); + BSDTRACE((_T("sendto %d:%d\n"),sb->resultval,wscnt)); #endif } @@ -1241,23 +1241,23 @@ void host_recvfrom(TrapContext *context, SB, uae_u32 sd, uae_u32 msg, uae_u32 le #ifdef TRACING_ENABLED if (addr) - BSDTRACE((L"recvfrom(%d,0x%x,%d,0x%x,0x%x,%d):%d -> ",sd,msg,len,flags,addr,get_long (addrlen),wscnt)); + BSDTRACE((_T("recvfrom(%d,0x%x,%d,0x%x,0x%x,%d):%d -> "),sd,msg,len,flags,addr,get_long (addrlen),wscnt)); else - BSDTRACE((L"recv(%d,0x%x,%d,0x%x):%d -> ",sd,msg,len,flags,wscnt)); + BSDTRACE((_T("recv(%d,0x%x,%d,0x%x):%d -> "),sd,msg,len,flags,wscnt)); #endif sd++; s = getsock(sb,sd); if (s != INVALID_SOCKET) { - if (!addr_valid (L"host_recvfrom1", msg, 4)) + if (!addr_valid (_T("host_recvfrom1"), msg, 4)) return; realpt = (char*)get_real_address (msg); if (addr) { - if (!addr_valid (L"host_recvfrom1", addrlen, 4)) + if (!addr_valid (_T("host_recvfrom1"), addrlen, 4)) return; hlen = get_long (addrlen); - if (!addr_valid (L"host_recvfrom2", addr, hlen)) + if (!addr_valid (_T("host_recvfrom2"), addr, hlen)) return; rp_addr = (struct sockaddr *)get_real_address (addr); } @@ -1322,7 +1322,7 @@ void host_recvfrom(TrapContext *context, SB, uae_u32 sd, uae_u32 msg, uae_u32 le } if (sb->eintr) { - BSDTRACE((L"[interrupted]\n")); + BSDTRACE((_T("[interrupted]\n"))); return; } @@ -1345,9 +1345,9 @@ void host_recvfrom(TrapContext *context, SB, uae_u32 sd, uae_u32 msg, uae_u32 le #ifdef TRACING_ENABLED if (sb->resultval == -1) - BSDTRACE((L"recv failed (%d):%d\n",sb->sb_errno,wscnt)); + BSDTRACE((_T("recv failed (%d):%d\n"),sb->sb_errno,wscnt)); else - BSDTRACE((L"recv %d:%d\n",sb->resultval,wscnt)); + BSDTRACE((_T("recv %d:%d\n"),sb->resultval,wscnt)); #endif } @@ -1356,16 +1356,16 @@ uae_u32 host_shutdown(SB, uae_u32 sd, uae_u32 how) { SOCKET s; - BSDTRACE((L"shutdown(%d,%d) -> ",sd,how)); + BSDTRACE((_T("shutdown(%d,%d) -> "),sd,how)); sd++; s = getsock(sb,sd); if (s != INVALID_SOCKET) { if (shutdown(s,how)) { SETERRNO; - BSDTRACE((L"failed (%d)\n",sb->sb_errno)); + BSDTRACE((_T("failed (%d)\n"),sb->sb_errno)); } else { - BSDTRACE((L"OK\n")); + BSDTRACE((_T("OK\n"))); return 0; } } @@ -1379,13 +1379,13 @@ void host_setsockopt(SB, uae_u32 sd, uae_u32 level, uae_u32 optname, uae_u32 opt uae_char buf[MAXADDRLEN]; int i; - BSDTRACE((L"setsockopt(%d,%d,0x%x,0x%x[0x%x],%d) -> ",sd,(short)level,optname,optval,get_long(optval),len)); + BSDTRACE((_T("setsockopt(%d,%d,0x%x,0x%x[0x%x],%d) -> "),sd,(short)level,optname,optval,get_long(optval),len)); sd++; s = getsock(sb,sd); if (s != INVALID_SOCKET) { if (len > sizeof buf) { - write_log (L"BSDSOCK: WARNING - Excessive optlen in setsockopt() (%d)\n", len); + write_log (_T("BSDSOCK: WARNING - Excessive optlen in setsockopt() (%d)\n"), len); len = sizeof buf; } #if 1 @@ -1439,12 +1439,12 @@ void host_setsockopt(SB, uae_u32 sd, uae_u32 level, uae_u32 optname, uae_u32 opt } if (!sb->resultval) { - BSDTRACE((L"OK\n")); + BSDTRACE((_T("OK\n"))); return; } else SETERRNO; - BSDTRACE((L"failed (%d)\n",sb->sb_errno)); + BSDTRACE((_T("failed (%d)\n"),sb->sb_errno)); } } @@ -1460,13 +1460,13 @@ uae_u32 host_getsockopt(SB, uae_u32 sd, uae_u32 level, uae_u32 optname, uae_u32 else outlen = 0; - BSDTRACE((L"getsockopt(%d,%d,0x%x,0x%x,0x%x[%d]) -> ",sd,(short)level,optname,optval,optlen,outlen)); + BSDTRACE((_T("getsockopt(%d,%d,0x%x,0x%x,0x%x[%d]) -> "),sd,(short)level,optname,optval,optlen,outlen)); sd++; s = getsock(sb,sd); if (s != INVALID_SOCKET) { if (!getsockopt(s,level,optname,buf,&len)) { - BSDTRACE((L"0x%x, %d -> ", *((long*)buf), len)); + BSDTRACE((_T("0x%x, %d -> "), *((long*)buf), len)); uae_u32 outcnt = 0; if (outlen) { if (level == SOL_SOCKET && (optname == SO_SNDTIMEO || optname == SO_RCVTIMEO)) { @@ -1501,11 +1501,11 @@ uae_u32 host_getsockopt(SB, uae_u32 sd, uae_u32 level, uae_u32 optname, uae_u32 } put_long (optlen,outcnt); } - BSDTRACE((L"OK (%d,0x%x)\n",outcnt,get_long(optval))); + BSDTRACE((_T("OK (%d,0x%x)\n"),outcnt,get_long(optval))); return 0; } else { SETERRNO; - BSDTRACE((L"failed (%d)\n",sb->sb_errno)); + BSDTRACE((_T("failed (%d)\n"),sb->sb_errno)); } } @@ -1519,24 +1519,24 @@ uae_u32 host_getsockname(SB, uae_u32 sd, uae_u32 name, uae_u32 namelen) struct sockaddr *rp_name; sd++; - if (!addr_valid (L"host_getsockname1", namelen, 4)) + if (!addr_valid (_T("host_getsockname1"), namelen, 4)) return -1; len = get_long (namelen); - BSDTRACE((L"getsockname(%d,0x%x,%d) -> ",sd,name,len)); + BSDTRACE((_T("getsockname(%d,0x%x,%d) -> "),sd,name,len)); s = getsock(sb,sd); if (s != INVALID_SOCKET) { - if (!addr_valid (L"host_getsockname2", name, len)) + if (!addr_valid (_T("host_getsockname2"), name, len)) return -1; rp_name = (struct sockaddr *)get_real_address (name); if (getsockname(s,rp_name,&len)) { SETERRNO; - BSDTRACE((L"failed (%d)\n",sb->sb_errno)); + BSDTRACE((_T("failed (%d)\n"),sb->sb_errno)); } else { - BSDTRACE((L"%d\n",len)); + BSDTRACE((_T("%d\n"),len)); prepamigaaddr(rp_name,len); put_long (namelen,len); return 0; @@ -1553,24 +1553,24 @@ uae_u32 host_getpeername(SB, uae_u32 sd, uae_u32 name, uae_u32 namelen) struct sockaddr *rp_name; sd++; - if (!addr_valid (L"host_getpeername1", namelen, 4)) + if (!addr_valid (_T("host_getpeername1"), namelen, 4)) return -1; len = get_long (namelen); - BSDTRACE((L"getpeername(%d,0x%x,%d) -> ",sd,name,len)); + BSDTRACE((_T("getpeername(%d,0x%x,%d) -> "),sd,name,len)); s = getsock(sb,sd); if (s != INVALID_SOCKET) { - if (!addr_valid (L"host_getpeername2", name, len)) + if (!addr_valid (_T("host_getpeername2"), name, len)) return -1; rp_name = (struct sockaddr *)get_real_address (name); if (getpeername(s,rp_name,&len)) { SETERRNO; - BSDTRACE((L"failed (%d)\n",sb->sb_errno)); + BSDTRACE((_T("failed (%d)\n"),sb->sb_errno)); } else { - BSDTRACE((L"%d\n",len)); + BSDTRACE((_T("%d\n"),len)); prepamigaaddr(rp_name,len); put_long (namelen,len); return 0; @@ -1586,7 +1586,7 @@ uae_u32 host_IoctlSocket(TrapContext *context, SB, uae_u32 sd, uae_u32 request, uae_u32 data; int success = SOCKET_ERROR; - BSDTRACE((L"IoctlSocket(%d,0x%x,0x%x) ",sd,request,arg)); + BSDTRACE((_T("IoctlSocket(%d,0x%x,0x%x) "),sd,request,arg)); sd++; s = getsock(sb,sd); @@ -1602,19 +1602,19 @@ uae_u32 host_IoctlSocket(TrapContext *context, SB, uae_u32 sd, uae_u32 request, success = 0; break; case FIONBIO: - BSDTRACE((L"[FIONBIO] -> ")); + BSDTRACE((_T("[FIONBIO] -> "))); if (get_long (arg)) { - BSDTRACE((L"nonblocking\n")); + BSDTRACE((_T("nonblocking\n"))); sb->ftable[sd-1] &= ~SF_BLOCKING; } else { - BSDTRACE((L"blocking\n")); + BSDTRACE((_T("blocking\n"))); sb->ftable[sd-1] |= SF_BLOCKING; } success = 0; break; case FIONREAD: ioctlsocket(s,request,(u_long *)&data); - BSDTRACE((L"[FIONREAD] -> %d\n",data)); + BSDTRACE((_T("[FIONREAD] -> %d\n"),data)); put_long (arg,data); success = 0; break; @@ -1622,7 +1622,7 @@ uae_u32 host_IoctlSocket(TrapContext *context, SB, uae_u32 sd, uae_u32 request, if (get_long (arg)) { sb->ftable[sd-1] |= REP_ALL; - BSDTRACE((L"[FIOASYNC] -> enabled\n")); + BSDTRACE((_T("[FIOASYNC] -> enabled\n"))); if (sb->mtable[sd-1] || (sb->mtable[sd-1] = allocasyncmsg(sb,sd,s))) { WSAAsyncSelect(s,hWndSelector ? hAmigaWnd : bsd-> hSockWnd, sb->mtable[sd-1], FD_ACCEPT | FD_CONNECT | FD_OOB | FD_READ | FD_WRITE | FD_CLOSE); @@ -1631,12 +1631,12 @@ uae_u32 host_IoctlSocket(TrapContext *context, SB, uae_u32 sd, uae_u32 request, } } else - write_log (L"BSDSOCK: WARNING - FIOASYNC disabling unsupported.\n"); + write_log (_T("BSDSOCK: WARNING - FIOASYNC disabling unsupported.\n")); success = -1; break; default: - write_log (L"BSDSOCK: WARNING - Unknown IoctlSocket request: 0x%08lx\n", request); + write_log (_T("BSDSOCK: WARNING - Unknown IoctlSocket request: 0x%08lx\n"), request); bsdsocklib_seterrno(sb, 22); // EINVAL break; } @@ -1650,7 +1650,7 @@ int host_CloseSocket(TrapContext *context, SB, int sd) unsigned int wMsg; SOCKET s; - BSDTRACE((L"CloseSocket(%d) -> ",sd)); + BSDTRACE((_T("CloseSocket(%d) -> "),sd)); sd++; s = getsock(sb,sd); @@ -1671,7 +1671,7 @@ int host_CloseSocket(TrapContext *context, SB, int sd) shutdown(s,1); if (!closesocket(s)) { releasesock(context, sb, sd); - BSDTRACE((L"OK\n")); + BSDTRACE((_T("OK\n"))); return 0; } @@ -1688,7 +1688,7 @@ int host_CloseSocket(TrapContext *context, SB, int sd) cancelasyncmsg(context, wMsg); if (sb->eintr) { - BSDTRACE((L"[interrupted]\n")); + BSDTRACE((_T("[interrupted]\n"))); break; } } else @@ -1698,7 +1698,7 @@ int host_CloseSocket(TrapContext *context, SB, int sd) ENDBLOCKING; } - BSDTRACE((L"failed (%d)\n",sb->sb_errno)); + BSDTRACE((_T("failed (%d)\n"),sb->sb_errno)); return -1; } @@ -1723,7 +1723,7 @@ static void makesocktable(SB, uae_u32 fd_set_amiga, struct fd_set *fd_set_win, i } if (nfds > sb->dtablesize) { - write_log (L"BSDSOCK: ERROR - select()ing more sockets (%d) than socket descriptors available (%d)!\n", nfds, sb->dtablesize); + write_log (_T("BSDSOCK: ERROR - select()ing more sockets (%d) than socket descriptors available (%d)!\n"), nfds, sb->dtablesize); nfds = sb->dtablesize; } @@ -1745,7 +1745,7 @@ static void makesocktable(SB, uae_u32 fd_set_amiga, struct fd_set *fd_set_win, i fd_set_win->fd_array[fd_set_win->fd_count++] = s; if (fd_set_win->fd_count >= FD_SETSIZE) { - write_log (L"BSDSOCK: ERROR - select()ing more sockets (%d) than the hard-coded fd_set limit (%d) - please report\n", nfds, FD_SETSIZE); + write_log (_T("BSDSOCK: ERROR - select()ing more sockets (%d) than the hard-coded fd_set limit (%d) - please report\n"), nfds, FD_SETSIZE); return; } } @@ -1828,19 +1828,19 @@ static unsigned int thread_WaitSelect2(void *indexp) if (timeout) { tv.tv_sec = get_long (timeout); tv.tv_usec = get_long (timeout+4); - BSDTRACE((L"(to: %d.%06d) ",tv.tv_sec,tv.tv_usec)); + BSDTRACE((_T("(to: %d.%06d) "),tv.tv_sec,tv.tv_usec)); } - BSDTRACE((L"tWS2(%d) -> ", wscnt)); + BSDTRACE((_T("tWS2(%d) -> "), wscnt)); resultval = select(nfds+1, &readsocks, writefds ? &writesocks : NULL, exceptfds ? &exceptsocks : NULL, timeout ? &tv : 0); if (bsd->hEvents[index] == NULL) break; - BSDTRACE((L"tWS2(%d,%d) -> ", resultval, wscnt)); + BSDTRACE((_T("tWS2(%d,%d) -> "), resultval, wscnt)); if (resultval == 0) { - BSDTRACE((L"timeout -> ")); + BSDTRACE((_T("timeout -> "))); } sb->resultval = resultval; @@ -1868,7 +1868,7 @@ static unsigned int thread_WaitSelect2(void *indexp) } } if (FD_ISSET(sb->sockAbort,&readsocks)) { - BSDTRACE((L"tWS2 abort %d:%d\n", sb->resultval, wscnt)); + BSDTRACE((_T("tWS2 abort %d:%d\n"), sb->resultval, wscnt)); if (sb->resultval != SOCKET_ERROR) { sb->resultval--; } @@ -1877,7 +1877,7 @@ static unsigned int thread_WaitSelect2(void *indexp) } if (sb->resultval == SOCKET_ERROR) { SETERRNO; - BSDTRACE((L"tWS2 failed %d:%d - ",sb->sb_errno,wscnt)); + BSDTRACE((_T("tWS2 failed %d:%d - "),sb->sb_errno,wscnt)); if (readfds) fd_zero(readfds,nfds); if (writefds) @@ -1885,7 +1885,7 @@ static unsigned int thread_WaitSelect2(void *indexp) if (exceptfds) fd_zero(exceptfds,nfds); } else { - BSDTRACE((L"tWS2 ok %d\n", wscnt)); + BSDTRACE((_T("tWS2 ok %d\n"), wscnt)); if (readfds) makesockbitfield(sb,readfds,&readsocks,nfds); if (writefds) @@ -1900,7 +1900,7 @@ static unsigned int thread_WaitSelect2(void *indexp) SetEvent(sb->hEvent); } } - write_log (L"BSDSOCK: thread_WaitSelect2 terminated\n"); + write_log (_T("BSDSOCK: thread_WaitSelect2 terminated\n")); THREADEND(result); return result; } @@ -1927,7 +1927,7 @@ static void fddebug(const TCHAR *name, uae_u32 nfds, uae_u32 fd) out[i] = (v & (1 << i)) ? 'x' : '-'; out[i + 1] = 0; } - write_log (L"%s: %08x %s\n", name, v, out); + write_log (_T("%s: %08x %s\n"), name, v, out); #endif } @@ -1943,15 +1943,15 @@ void host_WaitSelect(TrapContext *context, SB, uae_u32 nfds, uae_u32 readfds, ua wssigs = sigmp ? get_long (sigmp) : 0; - BSDTRACE((L"WaitSelect(%d,0x%x,0x%x,0x%x,0x%x,0x%x):%d ", + BSDTRACE((_T("WaitSelect(%d,0x%x,0x%x,0x%x,0x%x,0x%x):%d "), nfds, readfds, writefds, exceptfds, timeout, wssigs, wscnt)); - fddebug(L"read", nfds, readfds); - fddebug(L"write", nfds, writefds); - fddebug(L"except", nfds, exceptfds); + fddebug(_T("read"), nfds, readfds); + fddebug(_T("write"), nfds, writefds); + fddebug(_T("except"), nfds, exceptfds); if (!readfds && !writefds && !exceptfds && !timeout && !wssigs) { sb->resultval = 0; - BSDTRACE((L"-> [ignored]\n")); + BSDTRACE((_T("-> [ignored]\n"))); return; } if (wssigs) { @@ -1960,7 +1960,7 @@ void host_WaitSelect(TrapContext *context, SB, uae_u32 nfds, uae_u32 readfds, ua sigs = CallLib (context, sb->sysbase, -0x132) & wssigs; // SetSignal() if (sigs) { - BSDTRACE((L"-> [preempted by signals 0x%08lx]\n",sigs & wssigs)); + BSDTRACE((_T("-> [preempted by signals 0x%08lx]\n"),sigs & wssigs)); put_long (sigmp,sigs & wssigs); // Check for zero address -> otherwise WinUAE crashes if (readfds) @@ -2011,7 +2011,7 @@ void host_WaitSelect(TrapContext *context, SB, uae_u32 nfds, uae_u32 readfds, ua if (bsd->hEvents[i] == NULL || bsd->hThreads[i] == NULL) { bsd->hThreads[i] = 0; unlocksigqueue (); - write_log (L"BSDSOCK: ERROR - Thread/Event creation failed - error code: %d\n", + write_log (_T("BSDSOCK: ERROR - Thread/Event creation failed - error code: %d\n"), GetLastError()); bsdsocklib_seterrno(sb,12); // ENOMEM sb->resultval = -1; @@ -2027,7 +2027,7 @@ void host_WaitSelect(TrapContext *context, SB, uae_u32 nfds, uae_u32 readfds, ua unlocksigqueue (); if (i >= MAX_SELECT_THREADS) { - write_log (L"BSDSOCK: ERROR - Too many select()s, %d\n", wscnt); + write_log (_T("BSDSOCK: ERROR - Too many select()s, %d\n"), wscnt); } else { SOCKET newsock = INVALID_SOCKET; @@ -2053,7 +2053,7 @@ void host_WaitSelect(TrapContext *context, SB, uae_u32 nfds, uae_u32 readfds, ua */ if (sb->needAbort) { if ((newsock = socket(AF_INET,SOCK_STREAM,IPPROTO_TCP)) == INVALID_SOCKET) - write_log (L"BSDSOCK: ERROR - Cannot create socket: %d, %d\n", WSAGetLastError(),wscnt); + write_log (_T("BSDSOCK: ERROR - Cannot create socket: %d, %d\n"), WSAGetLastError(),wscnt); shutdown(sb->sockAbort,1); if (newsock != sb->sockAbort) { shutdown(sb->sockAbort, 1); @@ -2073,7 +2073,7 @@ void host_WaitSelect(TrapContext *context, SB, uae_u32 nfds, uae_u32 readfds, ua if (sigs & wssigs) { uae_u32 gotsigs = sigs & wssigs; - BSDTRACE((L"[interrupted by signals 0x%08lx]:%d\n", gotsigs, wscnt)); + BSDTRACE((_T("[interrupted by signals 0x%08lx]:%d\n"), gotsigs, wscnt)); if (readfds) fd_zero(readfds,nfds); if (writefds) fd_zero(writefds,nfds); if (exceptfds) fd_zero(exceptfds,nfds); @@ -2081,7 +2081,7 @@ void host_WaitSelect(TrapContext *context, SB, uae_u32 nfds, uae_u32 readfds, ua sb->resultval = 0; } else if (sigs & sb->eintrsigs) { uae_u32 gotsigs = sigs & sb->eintrsigs; - BSDTRACE((L"[interrupted 0x%08x]:%d\n", gotsigs, wscnt)); + BSDTRACE((_T("[interrupted 0x%08x]:%d\n"), gotsigs, wscnt)); sb->resultval = -1; bsdsocklib_seterrno(sb,4); // EINTR /* EINTR signals are kept active */ @@ -2091,9 +2091,9 @@ void host_WaitSelect(TrapContext *context, SB, uae_u32 nfds, uae_u32 readfds, ua } if (sb->resultval >= 0) { - BSDTRACE((L"WaitSelect, %d:%d\n",sb->resultval,wscnt)); + BSDTRACE((_T("WaitSelect, %d:%d\n"),sb->resultval,wscnt)); } else { - BSDTRACE((L"WaitSelect error, %d errno %d:%d\n",sb->resultval,sb->sb_errno,wscnt)); + BSDTRACE((_T("WaitSelect error, %d errno %d:%d\n"),sb->resultval,sb->sb_errno,wscnt)); } } } @@ -2106,21 +2106,21 @@ uae_u32 host_Inet_NtoA(TrapContext *context, SB, uae_u32 in) *(uae_u32 *)&ina = htonl(in); - BSDTRACE((L"Inet_NtoA(%x) -> ",in)); + BSDTRACE((_T("Inet_NtoA(%x) -> "),in)); if ((addr = inet_ntoa(ina)) != NULL) { scratchbuf = m68k_areg (regs,6) + offsetof(struct UAEBSDBase,scratchbuf); strncpyha(scratchbuf,addr,SCRATCHBUFSIZE); #ifdef TRACING_ENABLED TCHAR *s = au (addr); - BSDTRACE((L"%s\n",s)); + BSDTRACE((_T("%s\n"),s)); xfree (s); #endif return scratchbuf; } else SETERRNO; - BSDTRACE((L"failed (%d)\n",sb->sb_errno)); + BSDTRACE((_T("failed (%d)\n"),sb->sb_errno)); return 0; } @@ -2130,7 +2130,7 @@ uae_u32 host_inet_addr(uae_u32 cp) uae_u32 addr; char *cp_rp; - if (!addr_valid (L"host_inet_addr", cp, 4)) + if (!addr_valid (_T("host_inet_addr"), cp, 4)) return 0; cp_rp = (char*)get_real_address (cp); @@ -2138,7 +2138,7 @@ uae_u32 host_inet_addr(uae_u32 cp) #ifdef TRACING_ENABLED TCHAR *s = au (cp_rp); - BSDTRACE((L"inet_addr(%s) -> 0x%08lx\n",s,addr)); + BSDTRACE((_T("inet_addr(%s) -> 0x%08lx\n"),s,addr)); xfree (s); #endif return addr; @@ -2193,7 +2193,7 @@ static unsigned int thread_get2 (void *indexp) args = bsd->threadGetargs[index]; - BSDTRACE((L"tg2 %p,%d,%d:%d -> ", args->sb, index, bsd->threadGetargs_inuse[index], args->wscnt)); + BSDTRACE((_T("tg2 %p,%d,%d:%d -> "), args->sb, index, bsd->threadGetargs_inuse[index], args->wscnt)); if (bsd->threadGetargs_inuse[index] == GET_STATE_ACTIVE) { wscnt = args->wscnt; @@ -2206,26 +2206,26 @@ static unsigned int thread_get2 (void *indexp) name = args->args2; namelen = args->args3; addrtype = args->args4; - if (addr_valid (L"thread_get1", name, 1)) + if (addr_valid (_T("thread_get1"), name, 1)) name_rp = (char*)get_real_address (name); else name_rp = ""; if (strchr (name_rp, '.') == 0 || CheckOnline(sb) == TRUE) { // Local Address or Internet Online ? - BSDTRACE((L"tg2_0a %d:%d -> ",addrtype,wscnt)); + BSDTRACE((_T("tg2_0a %d:%d -> "),addrtype,wscnt)); if (addrtype == -1) { host = gethostbyname (name_rp); } else { host = gethostbyaddr (name_rp, namelen, addrtype); } - BSDTRACE((L"tg2_0b %d -> ", wscnt)); + BSDTRACE((_T("tg2_0b %d -> "), wscnt)); if (bsd->threadGetargs_inuse[index] != GET_STATE_CANCEL) { // No CTRL-C Signal if (host == 0) { // Error occured SETERRNO; - BSDTRACE((L"tg2_0 failed %d:%d -> ", sb->sb_errno,wscnt)); + BSDTRACE((_T("tg2_0 failed %d:%d -> "), sb->sb_errno,wscnt)); } else { bsdsocklib_seterrno(sb, 0); memcpy((void*)args->buf, host, sizeof(HOSTENT)); @@ -2239,7 +2239,7 @@ static unsigned int thread_get2 (void *indexp) struct protoent *proto; name = args->args2; - if (addr_valid (L"thread_get2", name, 1)) + if (addr_valid (_T("thread_get2"), name, 1)) name_rp = (char*)get_real_address (name); else name_rp = ""; @@ -2248,7 +2248,7 @@ static unsigned int thread_get2 (void *indexp) if (proto == 0) { // Error occured SETERRNO; - BSDTRACE((L"tg2_1 failed %d:%d -> ", sb->sb_errno, wscnt)); + BSDTRACE((_T("tg2_1 failed %d:%d -> "), sb->sb_errno, wscnt)); } else { bsdsocklib_seterrno(sb, 0); memcpy((void*)args->buf, proto, sizeof(struct protoent)); @@ -2269,14 +2269,14 @@ static unsigned int thread_get2 (void *indexp) type = args->args4; if (proto) { - if (addr_valid (L"thread_get3", proto, 1)) + if (addr_valid (_T("thread_get3"), proto, 1)) proto_rp = (char*)get_real_address (proto); } if (type) { serv = getservbyport(nameport, proto_rp); } else { - if (addr_valid (L"thread_get4", nameport, 1)) + if (addr_valid (_T("thread_get4"), nameport, 1)) name_rp = (char*)get_real_address (nameport); serv = getservbyname(name_rp, proto_rp); } @@ -2285,7 +2285,7 @@ static unsigned int thread_get2 (void *indexp) if (serv == 0) { // Error occured SETERRNO; - BSDTRACE((L"tg2_2 failed %d:%d -> ", sb->sb_errno, wscnt)); + BSDTRACE((_T("tg2_2 failed %d:%d -> "), sb->sb_errno, wscnt)); } else { bsdsocklib_seterrno(sb, 0); memcpy((void*)args->buf, serv, sizeof (struct servent)); @@ -2305,10 +2305,10 @@ static unsigned int thread_get2 (void *indexp) SetEvent(bsd->hGetEvents2[index]); - BSDTRACE((L"tg2 done %d:%d\n", index, wscnt)); + BSDTRACE((_T("tg2 done %d:%d\n"), index, wscnt)); } } - write_log (L"BSDSOCK: thread_get2 terminated\n"); + write_log (_T("BSDSOCK: thread_get2 terminated\n")); THREADEND(result); return result; } @@ -2354,7 +2354,7 @@ static int run_get_thread(TrapContext *context, SB, struct threadargs *args) if (bsd->hGetEvents2[i]) CloseHandle (bsd->hGetEvents2[i]); bsd->hGetEvents2[i] = NULL; - write_log (L"BSDSOCK: ERROR - Thread/Event creation failed - error code: %d:%d\n", + write_log (_T("BSDSOCK: ERROR - Thread/Event creation failed - error code: %d:%d\n"), GetLastError(), args->wscnt); bsdsocklib_seterrno(sb, 12); // ENOMEM sb->resultval = -1; @@ -2368,7 +2368,7 @@ static int run_get_thread(TrapContext *context, SB, struct threadargs *args) } if (i >= MAX_GET_THREADS) { - write_log (L"BSDSOCK: ERROR - Too many gethostbyname()s:%d\n", args->wscnt); + write_log (_T("BSDSOCK: ERROR - Too many gethostbyname()s:%d\n"), args->wscnt); bsdsocklib_seterrno(sb, 12); // ENOMEM sb->resultval = -1; unlocksigqueue (); @@ -2431,13 +2431,13 @@ void host_gethostbynameaddr (TrapContext *context, SB, uae_u32 name, uae_u32 nam name_rp = ""; - if (addr_valid (L"host_gethostbynameaddr", name, 1)) + if (addr_valid (_T("host_gethostbynameaddr"), name, 1)) name_rp = (char*)get_real_address (name); if (addrtype == -1) { #ifdef TRACING_ENABLED TCHAR *s = au (name_rp); - BSDTRACE((L"gethostbyname(%s) -> ",s)); + BSDTRACE((_T("gethostbyname(%s) -> "),s)); xfree (s); #endif // workaround for numeric host "names" @@ -2454,7 +2454,7 @@ void host_gethostbynameaddr (TrapContext *context, SB, uae_u32 name, uae_u32 nam goto kludge; } } else { - BSDTRACE((L"gethostbyaddr(0x%x,0x%x,%ld):%d -> ",name,namelen,addrtype,argsp->wscnt)); + BSDTRACE((_T("gethostbyaddr(0x%x,0x%x,%ld):%d -> "),name,namelen,addrtype,argsp->wscnt)); } argsp->sb = sb; @@ -2493,9 +2493,9 @@ kludge: sb->hostent = uae_AllocMem(context, size, 0); if (!sb->hostent) { - write_log (L"BSDSOCK: WARNING - gethostby%s() ran out of Amiga memory " - L"(couldn't allocate %ld bytes) while returning result of lookup for '%s':%d\n", - addrtype == -1 ? L"name" : L"addr", size, name_rp, argsp->wscnt); + write_log (_T("BSDSOCK: WARNING - gethostby%s() ran out of Amiga memory ") + _T("(couldn't allocate %ld bytes) while returning result of lookup for '%s':%d\n"), + addrtype == -1 ? _T("name") : _T("addr"), size, name_rp, argsp->wscnt); bsdsocklib_seterrno(sb, 12); // ENOMEM release_get_thread (tindex); return; @@ -2522,14 +2522,14 @@ kludge: #ifdef TRACING_ENABLED TCHAR *s = au (h->h_name); - BSDTRACE((L"OK (%s):%d\n", s, argsp->wscnt)); + BSDTRACE((_T("OK (%s):%d\n"), s, argsp->wscnt)); xfree (s); #endif bsdsocklib_seterrno(sb, 0); bsdsocklib_setherrno(sb, 0); } else { - BSDTRACE((L"failed (%d/%d):%d\n", sb->sb_errno, sb->sb_herrno,argsp->wscnt)); + BSDTRACE((_T("failed (%d/%d):%d\n"), sb->sb_errno, sb->sb_herrno,argsp->wscnt)); } release_get_thread (tindex); @@ -2553,12 +2553,12 @@ void host_getprotobyname(TrapContext *context, SB, uae_u32 name) argsp->wscnt = ++wscounter; name_rp = ""; - if (addr_valid (L"host_gethostbynameaddr", name, 1)) + if (addr_valid (_T("host_gethostbynameaddr"), name, 1)) name_rp = (char*)get_real_address (name); #ifdef TRACING_ENABLED TCHAR *s = au (name_rp); - BSDTRACE((L"getprotobyname(%s):%d -> ",s, argsp->wscnt)); + BSDTRACE((_T("getprotobyname(%s):%d -> "),s, argsp->wscnt)); xfree (s); #endif @@ -2589,8 +2589,8 @@ void host_getprotobyname(TrapContext *context, SB, uae_u32 name) if (!sb->protoent) { #ifdef TRACING_ENABLED TCHAR *s = au (name_rp); - write_log (L"BSDSOCK: WARNING - getprotobyname() ran out of Amiga memory " - L"(couldn't allocate %ld bytes) while returning result of lookup for '%s':%d\n", + write_log (_T("BSDSOCK: WARNING - getprotobyname() ran out of Amiga memory ") + _T("(couldn't allocate %ld bytes) while returning result of lookup for '%s':%d\n"), size, s, argsp->wscnt); xfree (s); #endif @@ -2614,13 +2614,13 @@ void host_getprotobyname(TrapContext *context, SB, uae_u32 name) addstr_ansi (&aptr, p->p_name); #ifdef TRACING_ENABLED TCHAR *s = au (p->p_name); - BSDTRACE((L"OK (%s, %d):%d\n", s, p->p_proto, argsp->wscnt)); + BSDTRACE((_T("OK (%s, %d):%d\n"), s, p->p_proto, argsp->wscnt)); xfree (s); #endif bsdsocklib_seterrno (sb,0); } else { - BSDTRACE((L"failed (%d):%d\n", sb->sb_errno, argsp->wscnt)); + BSDTRACE((_T("failed (%d):%d\n"), sb->sb_errno, argsp->wscnt)); } release_get_thread (tindex); @@ -2648,16 +2648,16 @@ void host_getservbynameport(TrapContext *context, SB, uae_u32 nameport, uae_u32 argsp->wscnt = ++wscounter; if (proto) { - if (addr_valid (L"host_getservbynameport1", proto, 1)) + if (addr_valid (_T("host_getservbynameport1"), proto, 1)) proto_rp = au ((char*)get_real_address (proto)); } if (type) { - BSDTRACE((L"getservbyport(%d,%s);%d -> ",nameport, proto_rp ? proto_rp : L"NULL", argsp->wscnt)); + BSDTRACE((_T("getservbyport(%d,%s);%d -> "),nameport, proto_rp ? proto_rp : _T("NULL"), argsp->wscnt)); } else { - if (addr_valid (L"host_getservbynameport2", nameport, 1)) + if (addr_valid (_T("host_getservbynameport2"), nameport, 1)) name_rp = au ((char*)get_real_address (nameport)); - BSDTRACE((L"getservbyname(%s,%s):%d -> ",name_rp, proto_rp ? proto_rp : L"NULL", argsp->wscnt)); + BSDTRACE((_T("getservbyname(%s,%s):%d -> "),name_rp, proto_rp ? proto_rp : _T("NULL"), argsp->wscnt)); } argsp->args1 = 2; @@ -2690,7 +2690,7 @@ void host_getservbynameport(TrapContext *context, SB, uae_u32 nameport, uae_u32 sb->servent = uae_AllocMem(context, size, 0); if (!sb->servent) { - write_log (L"BSDSOCK: WARNING - getservby%s() ran out of Amiga memory (couldn't allocate %ld bytes):%d\n", type ? L"port" : L"name", size, argsp->wscnt); + write_log (_T("BSDSOCK: WARNING - getservby%s() ran out of Amiga memory (couldn't allocate %ld bytes):%d\n"), type ? _T("port") : _T("name"), size, argsp->wscnt); bsdsocklib_seterrno(sb, 12); // ENOMEM release_get_thread (tindex); return; @@ -2714,13 +2714,13 @@ void host_getservbynameport(TrapContext *context, SB, uae_u32 nameport, uae_u32 #ifdef TRACING_ENABLED TCHAR *ss = au (s->s_name); - BSDTRACE((L"OK (%s, %d):%d\n", ss, (unsigned short)htons(s->s_port), argsp->wscnt)); + BSDTRACE((_T("OK (%s, %d):%d\n"), ss, (unsigned short)htons(s->s_port), argsp->wscnt)); xfree (ss); #endif bsdsocklib_seterrno(sb, 0); } else { - BSDTRACE((L"failed (%d):%d\n",sb->sb_errno, argsp->wscnt)); + BSDTRACE((_T("failed (%d):%d\n"),sb->sb_errno, argsp->wscnt)); } release_get_thread (tindex); @@ -2728,7 +2728,7 @@ void host_getservbynameport(TrapContext *context, SB, uae_u32 nameport, uae_u32 uae_u32 host_gethostname(uae_u32 name, uae_u32 namelen) { - if (!addr_valid (L"host_gethostname", name, namelen)) + if (!addr_valid (_T("host_gethostname"), name, namelen)) return -1; return gethostname ((char*)get_real_address (name),namelen); } diff --git a/od-win32/caps/caps_win32.cpp b/od-win32/caps/caps_win32.cpp index 591814e4..1449f192 100644 --- a/od-win32/caps/caps_win32.cpp +++ b/od-win32/caps/caps_win32.cpp @@ -47,7 +47,7 @@ int caps_init (void) static int init, noticed; int i; HMODULE h; - TCHAR *dllname = L"CAPSImg.dll"; + TCHAR *dllname = _T("CAPSImg.dll"); if (init) return 1; @@ -55,7 +55,7 @@ int caps_init (void) if (!h) { TCHAR tmp[MAX_DPATH]; if (SUCCEEDED (SHGetFolderPath (NULL, CSIDL_PROGRAM_FILES_COMMON, NULL, 0, tmp))) { - _tcscat (tmp, L"\\Software Preservation Society\\"); + _tcscat (tmp, _T("\\Software Preservation Society\\")); _tcscat (tmp, dllname); h = LoadLibrary (tmp); if (!h) { @@ -87,7 +87,7 @@ int caps_init (void) init = 1; cvi.type = 1; pCAPSGetVersionInfo (&cvi, 0); - write_log (L"CAPS: library version %d.%d (flags=%08X)\n", cvi.release, cvi.revision, cvi.flag); + write_log (_T("CAPS: library version %d.%d (flags=%08X)\n"), cvi.release, cvi.revision, cvi.flag); oldlib = (cvi.flag & (DI_LOCK_TRKBIT | DI_LOCK_OVLBIT)) != (DI_LOCK_TRKBIT | DI_LOCK_OVLBIT); if (!oldlib) caps_flags |= DI_LOCK_TRKBIT | DI_LOCK_OVLBIT; @@ -134,7 +134,7 @@ int caps_loadimage (struct zfile *zf, int drv, int *num_tracks) notify_user (NUMSG_OLDCAPS); notified = 1; } - write_log (L"caps: CAPSLockImageMemory() returned %d\n", ret); + write_log (_T("caps: CAPSLockImageMemory() returned %d\n"), ret); return 0; } caps_locked[drv] = 1; @@ -156,8 +156,8 @@ int caps_loadimage (struct zfile *zf, int drv, int *num_tracks) ret = pCAPSLoadImage(caps_cont[drv], caps_flags); cdt = &ci.crdt; - _stprintf (s1, L"%d.%d.%d %d:%d:%d", cdt->day, cdt->month, cdt->year, cdt->hour, cdt->min, cdt->sec); - write_log (L"caps: type:%d date:%s rel:%d rev:%d\n", + _stprintf (s1, _T("%d.%d.%d %d:%d:%d"), cdt->day, cdt->month, cdt->year, cdt->hour, cdt->min, cdt->sec); + write_log (_T("caps: type:%d date:%s rel:%d rev:%d\n"), ci.type, s1, ci.release, ci.revision); return 1; } @@ -248,7 +248,7 @@ int caps_loadtrack (uae_u16 *mfmbuf, uae_u16 *tracktiming, int drv, int track, i len = ci.tracklen; *gapoffset = ci.overlap >= 0 ? ci.overlap : -1; } - //write_log (L"%d %d %d %d\n", track, len, ci.tracklen, ci.overlap); + //write_log (_T("%d %d %d %d\n"), track, len, ci.tracklen, ci.overlap); *tracklength = len; mfmcopy (mfmbuf, ci.trackbuf, len); #if 0 @@ -263,7 +263,7 @@ int caps_loadtrack (uae_u16 *mfmbuf, uae_u16 *tracktiming, int drv, int track, i tracktiming[i] = (uae_u16)ci.timebuf[i]; } #if 0 - write_log (L"caps: drive:%d track:%d len:%d multi:%d timing:%d type:%d overlap:%d\n", + write_log (_T("caps: drive:%d track:%d len:%d multi:%d timing:%d type:%d overlap:%d\n"), drv, track, len, *multirev, ci.timelen, type, ci.overlap); #endif return 1; diff --git a/od-win32/cda_play.cpp b/od-win32/cda_play.cpp index 67797eba..0f1a648b 100644 --- a/od-win32/cda_play.cpp +++ b/od-win32/cda_play.cpp @@ -87,13 +87,13 @@ cda_audio::cda_audio(int num_sectors) hr = DirectSoundCreate8 (&sound_devices[currprefs.win32_soundcard].guid, &ds, NULL); if (FAILED (hr)) { - write_log (L"CDA: DirectSoundCreate8() failure: %s\n", DXError (hr)); + write_log (_T("CDA: DirectSoundCreate8() failure: %s\n"), DXError (hr)); return; } hr = ds->SetCooperativeLevel (hMainWnd, DSSCL_PRIORITY); if (FAILED (hr)) { - write_log (L"CDA: Can't set cooperativelevel: %s\n", DXError (hr)); + write_log (_T("CDA: Can't set cooperativelevel: %s\n"), DXError (hr)); return; } @@ -117,18 +117,18 @@ cda_audio::cda_audio(int num_sectors) hr = ds->CreateSoundBuffer (&desc, &pdsb, NULL); if (FAILED (hr)) { - write_log (L"CDA: IDirectSound_CreateSoundBuffer %s\n", DXError (hr)); + write_log (_T("CDA: IDirectSound_CreateSoundBuffer %s\n"), DXError (hr)); return; } hr = pdsb->QueryInterface (IID_IDirectSoundBuffer8, (LPVOID*)&dsbuf); IDirectSound_Release (pdsb); if (FAILED (hr)) { - write_log (L"CDA: Secondary QueryInterface() failure: %s\n", DXError (hr)); + write_log (_T("CDA: Secondary QueryInterface() failure: %s\n"), DXError (hr)); return; } hr = dsbuf->QueryInterface (IID_IDirectSoundNotify, (LPVOID*)&dsnotify); if (FAILED (hr)) { - write_log (L"CDA: IID_IDirectSoundNotify QueryInterface() failure: %s\n", DXError (hr)); + write_log (_T("CDA: IID_IDirectSoundNotify QueryInterface() failure: %s\n"), DXError (hr)); return; } @@ -146,7 +146,7 @@ cda_audio::cda_audio(int num_sectors) MMRESULT mmr; mmr = waveOutOpen (&wavehandle, WAVE_MAPPER, &wav, 0, 0, WAVE_ALLOWSYNC | WAVE_FORMAT_DIRECT); if (mmr != MMSYSERR_NOERROR) { - write_log (L"IMAGE CDDA: wave open %d\n", mmr); + write_log (_T("IMAGE CDDA: wave open %d\n"), mmr); return; } this->num_sectors = num_sectors; @@ -156,7 +156,7 @@ cda_audio::cda_audio(int num_sectors) whdr[i].lpData = (LPSTR)buffers[i]; mmr = waveOutPrepareHeader (wavehandle, &whdr[i], sizeof (WAVEHDR)); if (mmr != MMSYSERR_NOERROR) { - write_log (L"IMAGE CDDA: waveOutPrepareHeader %d:%d\n", i, mmr); + write_log (_T("IMAGE CDDA: waveOutPrepareHeader %d:%d\n"), i, mmr); return; } whdr[i].dwFlags |= WHDR_DONE; @@ -183,7 +183,7 @@ void cda_audio::setvolume(int master, int left, int right) vol = (LONG)((DSBVOLUME_MIN / 2) + (-DSBVOLUME_MIN / 2) * log (1 + (2.718281828 - 1) * (1 - volume / 100.0))); HRESULT hr = dsbuf->SetVolume(vol); if (FAILED (hr)) - write_log (L"CDA: SetVolume(%d) failed: %s\n", vol, DXError (hr)); + write_log (_T("CDA: SetVolume(%d) failed: %s\n"), vol, DXError (hr)); #endif } bool cda_audio::play(int bufnum) @@ -194,11 +194,11 @@ bool cda_audio::play(int bufnum) DWORD status; HRESULT hr = dsbuf->GetStatus (&status); if (FAILED (hr)) { - write_log (L"CDA: GetStatus() failed: %s\n", DXError (hr)); + write_log (_T("CDA: GetStatus() failed: %s\n"), DXError (hr)); return false; } if (status & DSBSTATUS_BUFFERLOST) { - write_log (L"CDA: bufferlost\n"); + write_log (_T("CDA: bufferlost\n")); return false; } if ((status & (DSBSTATUS_PLAYING | DSBSTATUS_LOOPING)) != (DSBSTATUS_PLAYING | DSBSTATUS_LOOPING)) { @@ -221,7 +221,7 @@ bool cda_audio::play(int bufnum) } MMRESULT mmr = waveOutWrite (wavehandle, &whdr[bufnum], sizeof (WAVEHDR)); if (mmr != MMSYSERR_NOERROR) { - write_log (L"IMAGE CDDA: waveOutWrite %d\n", mmr); + write_log (_T("IMAGE CDDA: waveOutWrite %d\n"), mmr); return false; } return true; diff --git a/od-win32/clipboard_win32.cpp b/od-win32/clipboard_win32.cpp index 38ee0e2f..a6228328 100644 --- a/od-win32/clipboard_win32.cpp +++ b/od-win32/clipboard_win32.cpp @@ -41,14 +41,14 @@ static void debugwrite (const TCHAR *name, uae_u8 *p, int size) cnt = 0; for (;;) { TCHAR tmp[MAX_DPATH]; - _stprintf (tmp, L"%s.%03d.dat", name, cnt); - f = _tfopen (tmp, L"rb"); + _stprintf (tmp, _T("%s.%03d.dat"), name, cnt); + f = _tfopen (tmp, _T("rb")); if (f) { fclose (f); cnt++; continue; } - f = _tfopen (tmp, L"wb"); + f = _tfopen (tmp, _T("wb")); if (f) { fwrite (p, size, 1, f); fclose (f); @@ -64,10 +64,10 @@ static void to_amiga_start (void) if (!clipboard_data || get_long (clipboard_data) != 0) return; if (clipboard_debug) { - debugwrite (L"clipboard_p2a", to_amiga, to_amiga_size); + debugwrite (_T("clipboard_p2a"), to_amiga, to_amiga_size); } #if DEBUG_CLIP > 0 - write_log (L"clipboard: to_amiga %08x %d\n", clipboard_data, to_amiga_size); + write_log (_T("clipboard: to_amiga %08x %d\n"), clipboard_data, to_amiga_size); #endif put_long (clipboard_data, to_amiga_size); uae_Signal (get_long (clipboard_data + 8), 1 << 13); @@ -215,7 +215,7 @@ static void from_iff_text (uaecptr ftxt, uae_u32 len) addr++; } if (txt == NULL) { - clipboard_put_text (L""); + clipboard_put_text (_T("")); } else { TCHAR *pctxt = amigatopc (txt); clipboard_put_text (pctxt); @@ -255,7 +255,7 @@ static void to_iff_ilbm (HBITMAP hbmp) return; } #if DEBUG_CLIP > 0 - write_log (L"BMP2IFF: W=%d H=%d bpp=%d\n", w, h, bpp); + write_log (_T("BMP2IFF: W=%d H=%d bpp=%d\n"), w, h, bpp); #endif iffbpp = bpp > 8 ? 24 : bpp; cnt = 0; @@ -281,7 +281,7 @@ static void to_iff_ilbm (HBITMAP hbmp) iffbpp++; } #if DEBUG_CLIP > 0 - write_log (L"BMP2IFF: Colors=%d BPP=%d\n", cnt, iffbpp); + write_log (_T("BMP2IFF: Colors=%d BPP=%d\n"), cnt, iffbpp); #endif } @@ -511,7 +511,7 @@ static void from_iff_ilbm (uaecptr ilbm, uae_u32 len) body = 1; #if DEBUG_CLIP > 0 - write_log (L"W=%d H=%d planes=%d mask=%d comp=%d CAMG=%08x\n", w, h, planes, masking, compr, camg); + write_log (_T("W=%d H=%d planes=%d mask=%d comp=%d CAMG=%08x\n"), w, h, planes, masking, compr, camg); #endif ham = 0; ehb = 0; @@ -669,7 +669,7 @@ static void from_iff (uaecptr data, uae_u32 len) return; addr = get_real_address (data); if (clipboard_debug) - debugwrite (L"clipboard_a2p", addr, len); + debugwrite (_T("clipboard_a2p"), addr, len); if (memcmp ("FORM", addr, 4)) return; if (!memcmp ("FTXT", addr + 8, 4)) @@ -693,13 +693,13 @@ static void clipboard_read (HWND hwnd) return; if (to_amiga) { #if DEBUG_CLIP > 0 - write_log (L"clipboard: read windows clipboard but ignored because previous clip transfer still active\n"); + write_log (_T("clipboard: read windows clipboard but ignored because previous clip transfer still active\n")); #endif return; } clipboard_change = 0; #if DEBUG_CLIP > 0 - write_log (L"clipboard: read windows clipboard\n"); + write_log (_T("clipboard: read windows clipboard\n")); #endif if (!OpenClipboard (hwnd)) return; @@ -716,7 +716,7 @@ static void clipboard_read (HWND hwnd) TCHAR *lptstr = (TCHAR*)GlobalLock (hglb); if (lptstr != NULL) { #if DEBUG_CLIP > 0 - write_log (L"clipboard: CF_UNICODETEXT '%s'\n", lptstr); + write_log (_T("clipboard: CF_UNICODETEXT '%s'\n"), lptstr); #endif to_iff_text (lptstr); GlobalUnlock (hglb); @@ -726,7 +726,7 @@ static void clipboard_read (HWND hwnd) HBITMAP hbmp = (HBITMAP)GetClipboardData (CF_BITMAP); if (hbmp != NULL) { #if DEBUG_CLIP > 0 - write_log (L"clipboard: CF_BITMAP\n"); + write_log (_T("clipboard: CF_BITMAP\n")); #endif to_iff_ilbm (hbmp); } @@ -749,7 +749,7 @@ static void clipboard_free_delayed (void) void clipboard_changed (HWND hwnd) { #if DEBUG_CLIP > 0 - write_log (L"clipboard: windows clipboard changed message\n"); + write_log (_T("clipboard: windows clipboard changed message\n")); #endif if (!clipboard_data || !initialized) return; @@ -775,7 +775,7 @@ static int clipboard_put_bmp_real (HBITMAP hbmp) CloseClipboard (); clipopen--; #if DEBUG_CLIP > 0 - write_log (L"clipboard: BMP written to windows clipboard\n"); + write_log (_T("clipboard: BMP written to windows clipboard\n")); #endif return ret; } @@ -800,7 +800,7 @@ static int clipboard_put_text_real (const TCHAR *txt) CloseClipboard (); clipopen--; #if DEBUG_CLIP > 0 - write_log (L"clipboard: text written to windows clipboard\n"); + write_log (_T("clipboard: text written to windows clipboard\n")); #endif return ret; } @@ -827,13 +827,13 @@ static int clipboard_put_bmp (HBITMAP hbmp) void amiga_clipboard_die (void) { signaling = 0; - write_log (L"clipboard not initialized\n"); + write_log (_T("clipboard not initialized\n")); } void amiga_clipboard_init (void) { signaling = 0; - write_log (L"clipboard initialized\n"); + write_log (_T("clipboard initialized\n")); initialized = 1; clipboard_read (chwnd); } @@ -842,12 +842,12 @@ void amiga_clipboard_task_start (uaecptr data) { clipboard_data = data; signaling = 1; - write_log (L"clipboard task init: %08x\n", clipboard_data); + write_log (_T("clipboard task init: %08x\n"), clipboard_data); } uae_u32 amiga_clipboard_proc_start (void) { - write_log (L"clipboard process init: %08x\n", clipboard_data); + write_log (_T("clipboard process init: %08x\n"), clipboard_data); signaling = 1; return clipboard_data; } @@ -856,12 +856,12 @@ void amiga_clipboard_got_data (uaecptr data, uae_u32 size, uae_u32 actual) { uae_u8 *addr; if (!initialized) { - write_log (L"clipboard: got_data() before initialized!?\n"); + write_log (_T("clipboard: got_data() before initialized!?\n")); return; } addr = get_real_address (data); #if DEBUG_CLIP > 0 - write_log (L"clipboard: <-amiga, %08x, %08x %d %d\n", clipboard_data, data, size, actual); + write_log (_T("clipboard: <-amiga, %08x, %08x %d %d\n"), clipboard_data, data, size, actual); #endif from_iff (data, actual); } @@ -873,12 +873,12 @@ int amiga_clipboard_want_data (void) addr = get_long (clipboard_data + 4); size = get_long (clipboard_data); if (!initialized) { - write_log (L"clipboard: want_data() before initialized!? (%08x %08x %d)\n", clipboard_data, addr, size); + write_log (_T("clipboard: want_data() before initialized!? (%08x %08x %d)\n"), clipboard_data, addr, size); to_amiga = NULL; return 0; } if (size != to_amiga_size) { - write_log (L"clipboard: size %d <> %d mismatch!?\n", size, to_amiga_size); + write_log (_T("clipboard: size %d <> %d mismatch!?\n"), size, to_amiga_size); to_amiga = NULL; return 0; } @@ -888,7 +888,7 @@ int amiga_clipboard_want_data (void) } xfree (to_amiga); #if DEBUG_CLIP > 0 - write_log (L"clipboard: ->amiga, %08x, %08x %d (%d) bytes\n", clipboard_data, addr, size, to_amiga_size); + write_log (_T("clipboard: ->amiga, %08x, %08x %d (%d) bytes\n"), clipboard_data, addr, size, to_amiga_size); #endif to_amiga = NULL; to_amiga_size = 0; @@ -928,7 +928,7 @@ void clipboard_vsync (void) if (task && native2amiga_isfree ()) { uae_Signal (task, 1 << 13); #if DEBUG_CLIP > 0 - write_log (L"clipboard: signal %08x\n", clipboard_data); + write_log (_T("clipboard: signal %08x\n"), clipboard_data); #endif } vdelay = 50; @@ -936,7 +936,7 @@ void clipboard_vsync (void) void clipboard_reset (void) { - write_log (L"clipboard: reset (%08x)\n", clipboard_data); + write_log (_T("clipboard: reset (%08x)\n"), clipboard_data); vdelay = 100; clipboard_free_delayed (); clipboard_data = 0; diff --git a/od-win32/clirun.cpp b/od-win32/clirun.cpp index 4190a570..481d4e33 100644 --- a/od-win32/clirun.cpp +++ b/od-win32/clirun.cpp @@ -56,7 +56,7 @@ static BOOL WINAPI ctrlhandler (DWORD type) return TRUE; } -#define conpar L"-console" +#define conpar _T("-console") static int runmain (int argc, wchar_t *argv[]) { @@ -77,10 +77,10 @@ static int runmain (int argc, wchar_t *argv[]) return 0; cmd = (TCHAR*)malloc ((len + 4 + 1) * sizeof (TCHAR)); _tcscpy (cmd, argv[0]); - if (_tcsicmp (cmd + len - 4, L".com")) - _tcscat (cmd + len, L".exe"); + if (_tcsicmp (cmd + len - 4, _T(".com"))) + _tcscat (cmd + len, _T(".exe")); else - _tcscpy (cmd + len - 4, L".exe"); + _tcscpy (cmd + len - 4, _T(".exe")); parmlen = 0; for (i = 1; i < argc; i++) { @@ -90,18 +90,18 @@ static int runmain (int argc, wchar_t *argv[]) } parms2 = (TCHAR*)malloc ((_tcslen (cmd) + 1 + parmlen + 1 + _tcslen (conpar) + 1) * sizeof (TCHAR)); _tcscpy (parms2, cmd); - _tcscat (parms2, L" "); + _tcscat (parms2, _T(" ")); _tcscat (parms2, conpar); for (i = 1; i < argc; i++) { int isspace = 0; - _tcscat (parms2, L" "); + _tcscat (parms2, _T(" ")); if (_tcschr (argv[i], ' ')) isspace = 1; if (isspace) - _tcscat (parms2, L"\""); + _tcscat (parms2, _T("\"")); _tcscat (parms2, argv[i]); if (isspace) - _tcscat (parms2, L"\""); + _tcscat (parms2, _T("\"")); } cp = GetCurrentProcess (); @@ -147,7 +147,7 @@ static int runmain (int argc, wchar_t *argv[]) NULL, NULL, TRUE, CREATE_SUSPENDED | CREATE_NEW_CONSOLE | GetPriorityClass (GetCurrentProcess ()), NULL, NULL, &si, &pi)) { - _tprintf (L"CreateProcess(%s) failed\n", cmd); + _tprintf (_T("CreateProcess(%s) failed\n"), cmd); goto end; } @@ -184,42 +184,42 @@ static int runxfd(int argc,wchar_t *argv[]) TCHAR *parms[5]; FILE *f; - _tprintf(L"uaexfd 0.1b by Toni Wilen (c)2010\n"); + _tprintf(_T("uaexfd 0.1b by Toni Wilen (c)2010\n")); if (argc < 2) { - _tprintf(L"uaexfd []"); + _tprintf(_T("uaexfd []")); return 0; } - if (GetFileAttributes(L"xfd.uae") == INVALID_FILE_ATTRIBUTES) { - _tprintf(L"xfd.uae missing\n"); + if (GetFileAttributes(_T("xfd.uae")) == INVALID_FILE_ATTRIBUTES) { + _tprintf(_T("xfd.uae missing\n")); return 0; } - if (GetFileAttributes(L"uaexfd.zip") == INVALID_FILE_ATTRIBUTES) { - _tprintf(L"uaexfd.zip missing\n"); + if (GetFileAttributes(_T("uaexfd.zip")) == INVALID_FILE_ATTRIBUTES) { + _tprintf(_T("uaexfd.zip missing\n")); return 0; } dst = src = argv[1]; if (GetFileAttributes(src) == INVALID_FILE_ATTRIBUTES) { - _tprintf(L"can't open '%s'\n", src); + _tprintf(_T("can't open '%s'\n"), src); return 0; } if (argc >= 3) dst = argv[2]; - DeleteFile(L"xfd-in-file.dat"); - DeleteFile(L"xfd-out-file.dat"); - DeleteFile(L"xfd-out-text.txt"); - CopyFile(src, L"xfd-in-file.dat", FALSE); - parms[0] = L"winuae.com"; - parms[1] = L"-f"; - parms[2] = L"xfd.uae"; - parms[3] = L"-datapath"; - parms[4] = L"."; + DeleteFile(_T("xfd-in-file.dat")); + DeleteFile(_T("xfd-out-file.dat")); + DeleteFile(_T("xfd-out-text.txt")); + CopyFile(src, _T("xfd-in-file.dat"), FALSE); + parms[0] = _T("winuae.com"); + parms[1] = _T("-f"); + parms[2] = _T("xfd.uae"); + parms[3] = _T("-datapath"); + parms[4] = _T("."); parms[5] = NULL; if (!runmain(5, parms)) { - if (GetFileAttributes(L"xfd-out-file.dat") != INVALID_FILE_ATTRIBUTES) { + if (GetFileAttributes(_T("xfd-out-file.dat")) != INVALID_FILE_ATTRIBUTES) { DeleteFile(dst); - MoveFile(L"xfd-out-file.dat", dst); + MoveFile(_T("xfd-out-file.dat"), dst); } - f = _tfopen(L"xfd-out-text.txt", L"rb"); + f = _tfopen(_T("xfd-out-text.txt"), _T("rb")); if (f) { char tmp[1000]; while (fgets(tmp, sizeof tmp, f)) { @@ -243,15 +243,15 @@ static int runxfd(int argc,wchar_t *argv[]) } fclose(f); } else { - _tprintf(L"startup failed\n"); + _tprintf(_T("startup failed\n")); } } - DeleteFile(L"xfd-in-file.dat"); - DeleteFile(L"xfd-out-file.dat"); - DeleteFile(L"xfd-out-text.txt"); - DeleteFile(L"winuaebootlog.txt"); - RemoveDirectory(L"Host"); - RemoveDirectory(L"Hardware"); + DeleteFile(_T("xfd-in-file.dat")); + DeleteFile(_T("xfd-out-file.dat")); + DeleteFile(_T("xfd-out-text.txt")); + DeleteFile(_T("winuaebootlog.txt")); + RemoveDirectory(_T("Host")); + RemoveDirectory(_T("Hardware")); return 0; } diff --git a/od-win32/cloanto/RetroPlatformGuestIPC.cpp b/od-win32/cloanto/RetroPlatformGuestIPC.cpp index e4e0eb78..e0a3bf9b 100644 --- a/od-win32/cloanto/RetroPlatformGuestIPC.cpp +++ b/od-win32/cloanto/RetroPlatformGuestIPC.cpp @@ -22,7 +22,7 @@ static LRESULT CALLBACK RPGuestWndProc(HWND hWnd, UINT message, WPARAM wParam, L static const _TCHAR g_szHostWndClass[] = _T(RPIPC_HostWndClass); static const _TCHAR g_szGuestWndClass[] = _T(RPIPC_GuestWndClass); -static const WCHAR g_szRegistration[] = L"Cloanto(R) RetroPlatform(TM)"; +static const WCHAR g_szRegistration[] = _T("Cloanto(R) RetroPlatform(TM)"); diff --git a/od-win32/cloanto/RetroPlatformIPC.h b/od-win32/cloanto/RetroPlatformIPC.h index 2af1ee0a..59a9a3c8 100644 --- a/od-win32/cloanto/RetroPlatformIPC.h +++ b/od-win32/cloanto/RetroPlatformIPC.h @@ -394,12 +394,12 @@ typedef struct RPDeviceContent_Legacy #define RP_DEVICE_INPUTPORT RP_DEVICECATEGORY_INPUTPORT #define RP_DEVICE_CATEGORIES RP_DEVICECATEGORY_COUNT // Legacy Host Side Input Port Devices -#define RP_IPD_MOUSE1 L"Mouse1" // \0\0-terminated first mouse type ("Mouse1\0\0" = default Windows mouse, or exact mouse described as "Mouse1\\\?\HID#VID_046D&PID_C521&MI_00#8&3b7afb0d&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd\0\0") -#define RP_IPD_JOYSTICK1 L"Joystick1" // \0\0-terminated first joystick type (e.g. standard joystick for WinUAE, described as "Joystick1\0ProductGUID InstanceGUID\0ProductName\0\0"); ProductName must be stripped of trailing spaces, if any -#define RP_IPD_JOYSTICK2 L"Joystick2" // \0\0-terminated second joystick type (e.g. X-Arcade (Left) joystick for WinUAE, described as "Joystick2\0ProductGUID InstanceGUID\0ProductName\0\0"); ProductName must be stripped of trailing spaces, if any -#define RP_IPD_JOYSTICK3 L"Joystick3" // \0\0-terminated third joystick type (e.g. X-Arcade (Right) joystick for WinUAE, described as "Joystick3\0ProductGUID InstanceGUID\0ProductName\0\0"); ProductName must be stripped of trailing spaces, if any -#define RP_IPD_KEYBDL1 L"KeyboardLayout1" // \0\0-terminated first joystick emulation keyboard layout (e.g. Keyboard Layout A for WinUAE) -#define RP_IPD_KEYBDL2 L"KeyboardLayout2" // \0\0-terminated second joystick emulation keyboard layout (e.g. Keyboard Layout B for WinUAE) -#define RP_IPD_KEYBDL3 L"KeyboardLayout3" // \0\0-terminated third joystick emulation keyboard layout (e.g. Keyboard Layout C for WinUAE) +#define RP_IPD_MOUSE1 _T("Mouse1") // \0\0-terminated first mouse type ("Mouse1\0\0" = default Windows mouse, or exact mouse described as "Mouse1\\\?\HID#VID_046D&PID_C521&MI_00#8&3b7afb0d&0&0000#{378de44c-56ef-11d1-bc8c-00a0c91405dd\0\0") +#define RP_IPD_JOYSTICK1 _T("Joystick1") // \0\0-terminated first joystick type (e.g. standard joystick for WinUAE, described as "Joystick1\0ProductGUID InstanceGUID\0ProductName\0\0"); ProductName must be stripped of trailing spaces, if any +#define RP_IPD_JOYSTICK2 _T("Joystick2") // \0\0-terminated second joystick type (e.g. X-Arcade (Left) joystick for WinUAE, described as "Joystick2\0ProductGUID InstanceGUID\0ProductName\0\0"); ProductName must be stripped of trailing spaces, if any +#define RP_IPD_JOYSTICK3 _T("Joystick3") // \0\0-terminated third joystick type (e.g. X-Arcade (Right) joystick for WinUAE, described as "Joystick3\0ProductGUID InstanceGUID\0ProductName\0\0"); ProductName must be stripped of trailing spaces, if any +#define RP_IPD_KEYBDL1 _T("KeyboardLayout1") // \0\0-terminated first joystick emulation keyboard layout (e.g. Keyboard Layout A for WinUAE) +#define RP_IPD_KEYBDL2 _T("KeyboardLayout2") // \0\0-terminated second joystick emulation keyboard layout (e.g. Keyboard Layout B for WinUAE) +#define RP_IPD_KEYBDL3 _T("KeyboardLayout3") // \0\0-terminated third joystick emulation keyboard layout (e.g. Keyboard Layout C for WinUAE) #endif // __CLOANTO_RETROPLATFORMIPC_H__ diff --git a/od-win32/debug_win32.cpp b/od-win32/debug_win32.cpp index 9c6988a0..5624b8fb 100644 --- a/od-win32/debug_win32.cpp +++ b/od-win32/debug_win32.cpp @@ -80,7 +80,7 @@ static struct debuggerpage dbgpage[MAXPAGES]; static int currpage, pages; static int pagetype; -TCHAR *pname[] = { L"OUT1", L"OUT2", L"MEM1", L"MEM2", L"DASM1", L"DASM2", L"BRKPTS", L"MISC", L"CUSTOM" }; +TCHAR *pname[] = { _T("OUT1"), _T("OUT2"), _T("MEM1"), _T("MEM2"), _T("DASM1"), _T("DASM2"), _T("BRKPTS"), _T("MISC"), _T("CUSTOM") }; static int pstatuscolor[MAXPAGES]; static int dbgwnd_minx = 800, dbgwnd_miny = 600; @@ -88,11 +88,11 @@ static int dbgwnd_minx = 800, dbgwnd_miny = 600; static BOOL useinternalcmd = FALSE; static TCHAR internalcmd[MAX_LINEWIDTH + 1]; -static const TCHAR *markinstr[] = { L"JMP", L"BT L", L"RTS", L"RTD", L"RTE", L"RTR", 0 }; -static const TCHAR *ucbranch[] = { L"BSR", L"JMP", L"JSR", 0 }; -static const TCHAR *cbranch[] = { L"B", L"DB", L"FB", L"FDB", 0 }; -static const TCHAR *ccode[] = { L"T ", L"F ", L"HI", L"LS", L"CC", L"CS", L"NE", L"EQ", - L"VC", L"VS", L"PL", L"MI", L"GE", L"LT", L"GT", L"LE", 0 }; +static const TCHAR *markinstr[] = { _T("JMP"), _T("BT L"), _T("RTS"), _T("RTD"), _T("RTE"), _T("RTR"), 0 }; +static const TCHAR *ucbranch[] = { _T("BSR"), _T("JMP"), _T("JSR"), 0 }; +static const TCHAR *cbranch[] = { _T("B"), _T("DB"), _T("FB"), _T("FDB"), 0 }; +static const TCHAR *ccode[] = { _T("T "), _T("F "), _T("HI"), _T("LS"), _T("CC"), _T("CS"), _T("NE"), _T("EQ"), + _T("VC"), _T("VS"), _T("PL"), _T("MI"), _T("GE"), _T("LT"), _T("GT"), _T("LE"), 0 }; static void OutputCurrHistNode(HWND hWnd) { @@ -191,7 +191,7 @@ int GetInput (TCHAR *out, int maxlen) WriteOutput(out, _tcslen(out)); WriteOutput(linebreak + 1, 2); AddToHistory(out); - SetWindowText(hInput, L""); + SetWindowText(hInput, _T("")); return chars; } @@ -230,7 +230,7 @@ void WriteOutput(const TCHAR *out, int len) int txtlen, pos = 0, count, index, leave = 0; TCHAR *buf = 0, *p, *tmp; - if (!hOutput || !_tcscmp(out, L">") || len == 0) + if (!hOutput || !_tcscmp(out, _T(">")) || len == 0) return; if (!CheckLineLimit(hOutput, out)) return; @@ -345,7 +345,7 @@ static void ShowMiscCPU(HWND hwnd) for (i = 0; m2cregs[i].regno>= 0; i++) { if (!movec_illg(m2cregs[i].regno)) { - _stprintf(out, L"%-4s %08X", m2cregs[i].regname, val_move2c(m2cregs[i].regno)); + _stprintf(out, _T("%-4s %08X"), m2cregs[i].regname, val_move2c(m2cregs[i].regno)); UpdateListboxString(hwnd, line++, out, TRUE); } } @@ -386,20 +386,20 @@ static void ShowCustomSmall(HWND hwnd) } ULBSINIT(hwnd); cnt = 0; - _stprintf(out, L"CPU %d", currprefs.cpu_model); + _stprintf(out, _T("CPU %d"), currprefs.cpu_model); if (currprefs.fpu_model) - _stprintf (out + _tcslen(out), L"/%d", currprefs.fpu_model); - _stprintf(out + _tcslen(out), L" %s", (currprefs.chipset_mask & CSMASK_AGA) ? L"AGA" : ((currprefs.chipset_mask & CSMASK_ECS_AGNUS) ? L"ECS" : L"OCS")); + _stprintf (out + _tcslen(out), _T("/%d"), currprefs.fpu_model); + _stprintf(out + _tcslen(out), _T(" %s"), (currprefs.chipset_mask & CSMASK_AGA) ? _T("AGA") : ((currprefs.chipset_mask & CSMASK_ECS_AGNUS) ? _T("ECS") : _T("OCS"))); ULBST(out); - ULBST(L"VPOS %04X (%d)", vpos, vpos); - ULBST(L"HPOS %04X (%d)", current_hpos(), current_hpos()); + ULBST(_T("VPOS %04X (%d)"), vpos, vpos); + ULBST(_T("HPOS %04X (%d)"), current_hpos(), current_hpos()); for (i = 0; dcustom[i]; i++) { for (j = 0; custd[j].name; j++) { if (custd[j].adr == (dcustom[i] & 0x1fe) + 0xdff000) { if (dcustom[i] & 0x8000) - ULBST(L"%-8s %08X", custd[j].name, (gw(p1, dcustom[i] & 0x1fe) << 16) | gw(p1, (dcustom[i] & 0x1fe) + 2)); + ULBST(_T("%-8s %08X"), custd[j].name, (gw(p1, dcustom[i] & 0x1fe) << 16) | gw(p1, (dcustom[i] & 0x1fe) + 2)); else - ULBST(L"%-8s %04X", custd[j].name, gw(p1, dcustom[i] & 0x1fe)); + ULBST(_T("%-8s %04X"), custd[j].name, gw(p1, dcustom[i] & 0x1fe)); break; } } @@ -418,17 +418,17 @@ static void ShowMisc(void) ULBSINIT(hMisc); for (i = 0; i < 2; i++) { p = p2 = save_cia (i, &len, NULL); - ULBS(L""); - ULBS(L"CIA %c:", i == 1 ? 'B' : 'A'); - ULBS(L""); - ULBS(L"PRA %02X PRB %02X", p[0], p[1]); - ULBS(L"DRA %02X DRB %02X", p[2], p[3]); - ULBS(L"CRA %02X CRB %02X ICR %02X IM %02X", + ULBS(_T("")); + ULBS(_T("CIA %c:"), i == 1 ? 'B' : 'A'); + ULBS(_T("")); + ULBS(_T("PRA %02X PRB %02X"), p[0], p[1]); + ULBS(_T("DRA %02X DRB %02X"), p[2], p[3]); + ULBS(_T("CRA %02X CRB %02X ICR %02X IM %02X"), p[14], p[15], p[13], p[16]); - ULBS(L"TA %04X (%04X) TB %04X (%04X)", + ULBS(_T("TA %04X (%04X) TB %04X (%04X)"), (p[5] << 8) | p[4], (p[18] << 8) | p[17], (p[7] << 8) | p[6], (p[20] << 8) | p[19]); - ULBS(L"TOD %06X (%06X) ALARM %06X %c%c", + ULBS(_T("TOD %06X (%06X) ALARM %06X %c%c"), (p[10] << 16) | (p[ 9] << 8) | p[ 8], (p[23] << 16) | (p[22] << 8) | p[21], (p[26] << 16) | (p[25] << 8) | p[24], @@ -437,23 +437,23 @@ static void ShowMisc(void) } for (i = 0; i < 4; i++) { p = p2 = save_disk (i, &len, NULL, false); - ULBS(L""); - ULBS(L"Drive DF%d: (%s)", i, (p[4] & 2) ? "disabled" : "enabled"); - ULBS(L"ID %08X Motor %s Cylinder %2d MFMPOS %d", + ULBS(_T("")); + ULBS(_T("Drive DF%d: (%s)"), i, (p[4] & 2) ? "disabled" : "enabled"); + ULBS(_T("ID %08X Motor %s Cylinder %2d MFMPOS %d"), (p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3], - (p[4] & 1) ? L"On" : L"Off", + (p[4] & 1) ? _T("On") : _T("Off"), p[5], (p[8] << 24) | (p[9] << 16) | (p[10] << 8) | p[11]); if (p[16]) - ULBS(L"'%s'", p + 16); + ULBS(_T("'%s'"), p + 16); else - ULBS(L"Drive is empty"); + ULBS(_T("Drive is empty")); free(p2); } p = p2 = save_floppy (&len, NULL); - ULBS(L""); - ULBS(L"Disk controller:"); - ULBS(L""); - ULBS(L"Shift register: Data=%04X Shift=%d. DMA=%d,%d", (p[0] << 8) | p[1], p[2], p[3], p[5]); + ULBS(_T("")); + ULBS(_T("Disk controller:")); + ULBS(_T("")); + ULBS(_T("Shift register: Data=%04X Shift=%d. DMA=%d,%d"), (p[0] << 8) | p[1], p[2], p[3], p[5]); free (p2); } @@ -495,7 +495,7 @@ static void ShowCustom(void) addr2 = custd[j].adr & 0x1ff; v1 = (p1[addr1 + 0] << 8) | p1[addr1 + 1]; v2 = (p1[addr2 + 0] << 8) | p1[addr2 + 1]; - ULBS(L"%03.3X %-15s %04X %03X %-15s %04X", + ULBS(_T("%03.3X %-15s %04X %03X %-15s %04X"), addr1, custd[i].name, v1, addr2, custd[j].name, v2); } @@ -511,9 +511,9 @@ static void ShowBreakpoints(void) hBrkpts = GetDlgItem(hDbgWnd, IDC_DBG_BRKPTS); ULBSINIT(hBrkpts); lines_old = SendMessage(hBrkpts, LB_GETCOUNT, 0, 0); - ULBS(L""); - ULBS(L"Breakpoints:"); - ULBS(L""); + ULBS(_T("")); + ULBS(_T("Breakpoints:")); + ULBS(_T("")); got = 0; for (i = 0; i < BREAKPOINT_TOTAL; i++) { if (!bpnodes[i].enabled) @@ -523,10 +523,10 @@ static void ShowBreakpoints(void) got = 1; } if (!got) - ULBS(L"none"); - ULBS(L""); - ULBS(L"Memwatch breakpoints:"); - ULBS(L""); + ULBS(_T("none")); + ULBS(_T("")); + ULBS(_T("Memwatch breakpoints:")); + ULBS(_T("")); got = 0; for (i = 0; i < MEMWATCH_TOTAL; i++) { if (mwnodes[i].size == 0) @@ -536,7 +536,7 @@ static void ShowBreakpoints(void) got = 1; } if (!got) - ULBS(L"none"); + ULBS(_T("none")); for (i = ulbs_pos; i < lines_old; i++) SendMessage(hBrkpts, LB_DELETESTRING, ulbs_pos, 0); } @@ -624,7 +624,7 @@ static void ShowDasm(int direction) if (addr > dbgpage[currpage].dasmaddr) UpdateListboxString(hDasm, i, out, FALSE); else - UpdateListboxString(hDasm, i, L"", FALSE); + UpdateListboxString(hDasm, i, _T(""), FALSE); } for (i = lines_new; i < lines_old; i++) { SendMessage(hDasm, LB_DELETESTRING, lines_new, 0); @@ -637,7 +637,7 @@ static void SetMemToPC(void) int i, id; dbgpage[currpage].dasmaddr = m68k_getpc (); - _stprintf(dbgpage[currpage].addrinput, L"%08lX", dbgpage[currpage].dasmaddr); + _stprintf(dbgpage[currpage].addrinput, _T("%08lX"), dbgpage[currpage].dasmaddr); for (i = 0; i < MAXPAGECONTROLS; i++) { id = GetDlgCtrlID(dbgpage[currpage].ctrl[i]); if (id == IDC_DBG_MEMINPUT) @@ -759,7 +759,7 @@ static void InitPages(void) for (i = 0; i < (sizeof(dpage) / sizeof(dpage[0])); i++) AddPage(dpage[i]); memset(parts, 0, MAXPAGES * sizeof(int)); - width = GetTextSize(hDbgWnd, L"12345678", TRUE); // longest pagename + 2 + width = GetTextSize(hDbgWnd, _T("12345678"), TRUE); // longest pagename + 2 for (i = 0; i < pages; i++) { pwidth += width; parts[i] = pwidth; @@ -805,7 +805,7 @@ static LRESULT CALLBACK MemInputProc (HWND hWnd, UINT message, WPARAM wParam, LP { HANDLE hdata; LPWSTR lptstr; - TCHAR allowed[] = L"1234567890abcdefABCDEF"; + TCHAR allowed[] = _T("1234567890abcdefABCDEF"); int ok = 1; TCHAR addrstr[12]; uae_u32 addr; @@ -846,7 +846,7 @@ static LRESULT CALLBACK MemInputProc (HWND hWnd, UINT message, WPARAM wParam, LP return 0; switch (wParam) { case VK_RETURN: - _stprintf(addrstr, L"0x"); + _stprintf(addrstr, _T("0x")); GetWindowText(hWnd, addrstr + 2, 9); if (addrstr[2] != 0) { addr = _tcstoul(addrstr, NULL, 0); @@ -978,15 +978,15 @@ static void ToggleBreakpoint(HWND hwnd) SendMessage(hwnd, LB_GETTEXT, index, (LPARAM)addrstr); addrstr[8] = '\0'; ptr = addrstr; - console_out_f (L"\nf %s\n", addrstr); + console_out_f (_T("\nf %s\n"), addrstr); instruction_breakpoint(&ptr); RedrawWindow(hwnd, 0, 0, RDW_INVALIDATE); } static void DeleteBreakpoints(HWND hwnd) { - TCHAR *cmd = L"d"; - console_out(L"\nfd\n"); + TCHAR *cmd = _T("d"); + console_out(_T("\nfd\n")); instruction_breakpoint(&cmd); RedrawWindow(hwnd, 0, 0, RDW_INVALIDATE); } @@ -1099,7 +1099,7 @@ static LRESULT CALLBACK ListboxEditProc(HWND hWnd, UINT message, WPARAM wParam, { HANDLE hdata; LPWSTR lptstr; - TCHAR allowed[] = L"1234567890abcdefABCDEF "; + TCHAR allowed[] = _T("1234567890abcdefABCDEF "); int ok = 1, id; WNDPROC oldproc; HWND hparent = GetParent(hWnd); @@ -1107,7 +1107,7 @@ static LRESULT CALLBACK ListboxEditProc(HWND hWnd, UINT message, WPARAM wParam, if (id == IDC_DBG_DREG || id == IDC_DBG_AREG) allowed[_tcslen(allowed) - 1] = '\0'; // no space else if (id == IDC_DBG_FPREG) - _stprintf(allowed, L"1234567890deDE.+-"); + _stprintf(allowed, _T("1234567890deDE.+-")); switch (message) { case WM_GETDLGCODE: return DLGC_WANTALLKEYS; @@ -1203,7 +1203,7 @@ static void ListboxEdit(HWND hwnd, int x, int y) } else return; - hedit = CreateWindow(L"Edit", L"Listbox Edit", WS_BORDER | WS_CHILD, 0, 0, 1, 1, hwnd, NULL, hInst, NULL); + hedit = CreateWindow(_T("Edit"), _T("Listbox Edit"), WS_BORDER | WS_CHILD, 0, 0, 1, 1, hwnd, NULL, hInst, NULL); if (!hedit) return; size = GetTextSize(hwnd, NULL, 0); @@ -1642,9 +1642,9 @@ static BOOL CALLBACK InitChildWindows(HWND hWnd, LPARAM lParam) break; default: if (GetClassName(hWnd, classname, CLASSNAMELENGTH)) { - if (!_tcscmp(classname, L"ListBox")) + if (!_tcscmp(classname, _T("ListBox"))) newproc = ListboxProc; - else if (!_tcscmp(classname, L"Edit")) + else if (!_tcscmp(classname, _T("Edit"))) newproc = EditProc; } break; @@ -1660,9 +1660,9 @@ static BOOL CALLBACK InitChildWindows(HWND hWnd, LPARAM lParam) static void step(BOOL over) { if (over) - _tcscpy(internalcmd, L"z"); + _tcscpy(internalcmd, _T("z")); else - _tcscpy(internalcmd, L"t"); + _tcscpy(internalcmd, _T("t")); useinternalcmd = TRUE; inputfinished = 1; } @@ -1725,13 +1725,13 @@ static INT_PTR CALLBACK DebuggerProc (HWND hDlg, UINT message, WPARAM wParam, LP dbgwnd_miny = rw.bottom - rw.top; GetClientRect(hDlg, &dlgRect); newpos = 1; - if (!regqueryint (NULL, L"DebuggerPosX", &x)) + if (!regqueryint (NULL, _T("DebuggerPosX"), &x)) newpos = 0; - if (!regqueryint (NULL, L"DebuggerPosY", &y)) + if (!regqueryint (NULL, _T("DebuggerPosY"), &y)) newpos = 0; - if (!regqueryint (NULL, L"DebuggerPosW", &w)) + if (!regqueryint (NULL, _T("DebuggerPosW"), &w)) newpos = 0; - if (!regqueryint (NULL, L"DebuggerPosH", &h)) + if (!regqueryint (NULL, _T("DebuggerPosH"), &h)) newpos = 0; if (newpos) { RECT rc; @@ -1775,11 +1775,11 @@ static INT_PTR CALLBACK DebuggerProc (HWND hDlg, UINT message, WPARAM wParam, LP r->bottom -= r->top; r->left += xoffset; r->top += yoffset; - regsetint (NULL, L"DebuggerPosX", r->left); - regsetint (NULL, L"DebuggerPosY", r->top); - regsetint (NULL, L"DebuggerPosW", r->right); - regsetint (NULL, L"DebuggerPosH", r->bottom); - regsetint (NULL, L"DebuggerMaximized", (IsZoomed(hDlg) || (wp.flags & WPF_RESTORETOMAXIMIZED)) ? 1 : 0); + regsetint (NULL, _T("DebuggerPosX"), r->left); + regsetint (NULL, _T("DebuggerPosY"), r->top); + regsetint (NULL, _T("DebuggerPosW"), r->right); + regsetint (NULL, _T("DebuggerPosH"), r->bottom); + regsetint (NULL, _T("DebuggerMaximized"), (IsZoomed(hDlg) || (wp.flags & WPF_RESTORETOMAXIMIZED)) ? 1 : 0); } hDbgWnd = 0; PostQuitMessage(0); @@ -1973,7 +1973,7 @@ static INT_PTR CALLBACK DebuggerProc (HWND hDlg, UINT message, WPARAM wParam, LP else if (text[pos] == '(' && _istdigit(text[pos + 2])) { //address register indirect int reg = _tstoi(text + pos + 2); uae_u32 loc = m68k_areg (regs, reg); - _stprintf(addrstr + 2, L"%08lx", loc); + _stprintf(addrstr + 2, _T("%08lx"), loc); } } break; @@ -1999,15 +1999,15 @@ static INT_PTR CALLBACK DebuggerProc (HWND hDlg, UINT message, WPARAM wParam, LP if (addrstr[2] != '\0') { uae_u32 branchaddr = _tcstoul(addrstr, NULL, 0); if (branchaddr < addr) - TextOut(hdc, rc.left, rc.top, L"^", 1); + TextOut(hdc, rc.left, rc.top, _T("^"), 1); else if (branchaddr > addr) { HFONT hfontold = (HFONT)SelectObject(hdc, udfont); - int width = GetTextSize(hDlg, L"^", TRUE); - TextOut(hdc, rc.left + width, rc.bottom, L"^", 1); + int width = GetTextSize(hDlg, _T("^"), TRUE); + TextOut(hdc, rc.left + width, rc.bottom, _T("^"), 1); SelectObject(hdc, hfontold); } else - TextOut(hdc, rc.left, rc.top, L"=", 1); + TextOut(hdc, rc.left, rc.top, _T("="), 1); } rc.left += size; if (addr == m68k_getpc()) { @@ -2064,7 +2064,7 @@ int open_debug_window(void) return 0; InitPages(); ShowPage(0, TRUE); - if (!regqueryint (NULL, L"DebuggerMaximized", &maximized)) + if (!regqueryint (NULL, _T("DebuggerMaximized"), &maximized)) maximized = 0; ShowWindow(hDbgWnd, maximized ? SW_SHOWMAXIMIZED : SW_SHOW); UpdateWindow(hDbgWnd); @@ -2098,9 +2098,9 @@ int console_get_gui (TCHAR *out, int maxlen) inputfinished = 0; if (useinternalcmd) { useinternalcmd = FALSE; - console_out(L"\n"); + console_out(_T("\n")); console_out(internalcmd); - console_out(L"\n"); + console_out(_T("\n")); _tcsncpy(out, internalcmd, maxlen); return _tcslen(out); } @@ -2119,20 +2119,20 @@ void update_debug_info(void) struct instr *dp; struct mnemolookup *lookup1, *lookup2; uae_u32 fpsr; - TCHAR *fpsrflag[] = { L"N: ", L"Z: ", L"I: ", L"NAN: " }; + TCHAR *fpsrflag[] = { _T("N: "), _T("Z: "), _T("I: "), _T("NAN: ") }; if (!hDbgWnd) return; hwnd = GetDlgItem(hDbgWnd, IDC_DBG_DREG); for (i = 0; i < 8; i++) { - _stprintf(out, L"D%d: %08lX", i, m68k_dreg (regs, i)); + _stprintf(out, _T("D%d: %08lX"), i, m68k_dreg (regs, i)); UpdateListboxString(hwnd, i, out, TRUE); } hwnd = GetDlgItem(hDbgWnd, IDC_DBG_AREG); for (i = 0; i < 8; i++) { hwnd = GetDlgItem(hDbgWnd, IDC_DBG_AREG); - _stprintf(out, L"A%d: %08lX", i, m68k_areg (regs, i)); + _stprintf(out, _T("A%d: %08lX"), i, m68k_areg (regs, i)); UpdateListboxString(hwnd, i, out, TRUE); hwnd = GetDlgItem(hDbgWnd, IDC_DBG_AMEM); dumpmem2(m68k_areg (regs, i), out, sizeof(out)); @@ -2140,34 +2140,34 @@ void update_debug_info(void) } hwnd = GetDlgItem(hDbgWnd, IDC_DBG_CCR); - UpdateListboxString(hwnd, 0, GET_XFLG() ? L"X: 1" : L"X: 0", TRUE); - UpdateListboxString(hwnd, 1, GET_NFLG() ? L"N: 1" : L"N: 0", TRUE); - UpdateListboxString(hwnd, 2, GET_ZFLG() ? L"Z: 1" : L"Z: 0", TRUE); - UpdateListboxString(hwnd, 3, GET_VFLG() ? L"V: 1" : L"V: 0", TRUE); - UpdateListboxString(hwnd, 4, GET_CFLG() ? L"C: 1" : L"C: 0", TRUE); + UpdateListboxString(hwnd, 0, GET_XFLG() ? _T("X: 1") : _T("X: 0"), TRUE); + UpdateListboxString(hwnd, 1, GET_NFLG() ? _T("N: 1") : _T("N: 0"), TRUE); + UpdateListboxString(hwnd, 2, GET_ZFLG() ? _T("Z: 1") : _T("Z: 0"), TRUE); + UpdateListboxString(hwnd, 3, GET_VFLG() ? _T("V: 1") : _T("V: 0"), TRUE); + UpdateListboxString(hwnd, 4, GET_CFLG() ? _T("C: 1") : _T("C: 0"), TRUE); hwnd = GetDlgItem(hDbgWnd, IDC_DBG_SP_VBR); - _stprintf(out, L"USP: %08lX", regs.usp); + _stprintf(out, _T("USP: %08lX"), regs.usp); UpdateListboxString(hwnd, 0, out, TRUE); - _stprintf(out, L"ISP: %08lX", regs.isp); + _stprintf(out, _T("ISP: %08lX"), regs.isp); UpdateListboxString(hwnd, 1, out, TRUE); ShowMiscCPU(GetDlgItem(hDbgWnd, IDC_DBG_MISCCPU)); hwnd = GetDlgItem(hDbgWnd, IDC_DBG_MMISC); - _stprintf(out, L"T: %d%d", regs.t1, regs.t0); + _stprintf(out, _T("T: %d%d"), regs.t1, regs.t0); UpdateListboxString(hwnd, 0, out, TRUE); - _stprintf(out, L"S: %d", regs.s); + _stprintf(out, _T("S: %d"), regs.s); UpdateListboxString(hwnd, 1, out, TRUE); - _stprintf(out, L"M: %d", regs.m); + _stprintf(out, _T("M: %d"), regs.m); UpdateListboxString(hwnd, 2, out, TRUE); - _stprintf(out, L"IMASK: %d", regs.intmask); + _stprintf(out, _T("IMASK: %d"), regs.intmask); UpdateListboxString(hwnd, 3, out, TRUE); - _stprintf(out, L"STP: %d", regs.stopped); + _stprintf(out, _T("STP: %d"), regs.stopped); UpdateListboxString(hwnd, 4, out, TRUE); hwnd = GetDlgItem(hDbgWnd, IDC_DBG_PC); - _stprintf(out, L"PC: %08lX", m68k_getpc ()); + _stprintf(out, _T("PC: %08lX"), m68k_getpc ()); UpdateListboxString(hwnd, 0, out, TRUE); hwnd = GetDlgItem(hDbgWnd, IDC_DBG_PREFETCH); @@ -2175,21 +2175,21 @@ void update_debug_info(void) for (lookup1 = lookuptab; lookup1->mnemo != dp->mnemo; lookup1++); dp = table68k + regs.ir; for (lookup2 = lookuptab; lookup2->mnemo != dp->mnemo; lookup2++); - _stprintf(out, L"Prefetch: %04X (%s) %04X (%s)", regs.irc, lookup1->name, regs.ir, lookup2->name); + _stprintf(out, _T("Prefetch: %04X (%s) %04X (%s)"), regs.irc, lookup1->name, regs.ir, lookup2->name); UpdateListboxString(hwnd, 0, out, TRUE); ShowCustomSmall(GetDlgItem(hDbgWnd, IDC_DBG_MCUSTOM)); hwnd = GetDlgItem(hDbgWnd, IDC_DBG_FPREG); for (i = 0; i < 8; i++) { - _stprintf(out, L"FP%d: %g", i, regs.fp[i]); + _stprintf(out, _T("FP%d: %g"), i, regs.fp[i]); UpdateListboxString(hwnd, i, out, TRUE); } hwnd = GetDlgItem(hDbgWnd, IDC_DBG_FPSR); fpsr = get_fpsr(); for (i = 0; i < 4; i++) { - _stprintf(out, L"%s%d", fpsrflag[i], (fpsr & (0x8000000 >> i)) != 0 ? 1 : 0); + _stprintf(out, _T("%s%d"), fpsrflag[i], (fpsr & (0x8000000 >> i)) != 0 ? 1 : 0); UpdateListboxString(hwnd, i, out, TRUE); } ShowPage(currpage, TRUE); diff --git a/od-win32/dinput.cpp b/od-win32/dinput.cpp index 0c4ea3f6..83cf1011 100644 --- a/od-win32/dinput.cpp +++ b/od-win32/dinput.cpp @@ -168,12 +168,12 @@ int dinput_winmousemode (void) #if 0 static LRESULT CALLBACK LowLevelKeyboardProc (int nCode, WPARAM wParam, LPARAM lParam) { - write_log (L"*"); + write_log (_T("*")); if (nCode >= 0) { KBDLLHOOKSTRUCT *k = (KBDLLHOOKSTRUCT*)lParam; int vk = k->vkCode; int sc = k->scanCode; - write_log (L"%02x %02x\n", vk, sc); + write_log (_T("%02x %02x\n"), vk, sc); } return CallNextHookEx (NULL, nCode, wParam, lParam); } @@ -185,15 +185,15 @@ static void lock_kb (void) return; kbhook = SetWindowsHookEx (WH_KEYBOARD_LL, LowLevelKeyboardProc, hInst, 0); if (!kbhook) - write_log (L"SetWindowsHookEx %d\n", GetLastError ()); + write_log (_T("SetWindowsHookEx %d\n"), GetLastError ()); else - write_log (L"***************************\n"); + write_log (_T("***************************\n")); } static void unlock_kb (void) { if (!kbhook) return; - write_log (L"!!!!!!!!!!!!!!!!!!!!!!!!\n"); + write_log (_T("!!!!!!!!!!!!!!!!!!!!!!!!\n")); UnhookWindowsHookEx (kbhook); kbhook = NULL; } @@ -275,7 +275,7 @@ static void set_leds (uae_u32 led) InputBuffer.LedFlags |= KEYBOARD_SCROLL_LOCK_ON; if (!DeviceIoControl (kbhandle, IOCTL_KEYBOARD_SET_INDICATORS, &InputBuffer, DataLength, NULL, 0, &ReturnedLength, NULL)) - write_log (L"kbleds: DeviceIoControl() failed %d\n", GetLastError()); + write_log (_T("kbleds: DeviceIoControl() failed %d\n"), GetLastError()); #endif } } @@ -321,10 +321,10 @@ static void fixbuttons (struct didata *did) { if (did->buttons > 0) return; - write_log (L"'%s' has no buttons, adding single default button\n", did->name); + write_log (_T("'%s' has no buttons, adding single default button\n"), did->name); did->buttonmappings[0] = DIJOFS_BUTTON (0); did->buttonsort[0] = 0; - did->buttonname[0] = my_strdup (L"Button"); + did->buttonname[0] = my_strdup (_T("Button")); did->buttons++; } @@ -336,7 +336,7 @@ static void addplusminus (struct didata *did, int i) if (did->buttons + 1 >= MAX_MAPPINGS) return; for (j = 0; j < 2; j++) { - _stprintf (tmp, L"%s [%c]", did->axisname[i], j ? '+' : '-'); + _stprintf (tmp, _T("%s [%c]"), did->axisname[i], j ? '+' : '-'); did->buttonname[did->buttons] = my_strdup (tmp); did->buttonmappings[did->buttons] = did->axismappings[i]; did->buttonsort[did->buttons] = 1000 + (did->axismappings[i] + did->axistype[i]) * 2 + j; @@ -376,15 +376,15 @@ static bool test_rawinput (int usage) rid.usUsagePage = 1; rid.usUsage = usage; if (RegisterRawInputDevices (&rid, 1, sizeof RAWINPUTDEVICE) == FALSE) { - write_log (L"RAWINPUT test failed, usage=%d ERR=%d\n", usage, GetLastError ()); + write_log (_T("RAWINPUT test failed, usage=%d ERR=%d\n"), usage, GetLastError ()); return false; } rid.dwFlags |= RIDEV_REMOVE; if (RegisterRawInputDevices (&rid, 1, sizeof RAWINPUTDEVICE) == FALSE) { - write_log (L"RAWINPUT test failed (release), usage=%d, ERR=%d\n", usage, GetLastError ()); + write_log (_T("RAWINPUT test failed (release), usage=%d, ERR=%d\n"), usage, GetLastError ()); return false; } - write_log (L"RAWINPUT test ok, usage=%d\n", usage); + write_log (_T("RAWINPUT test ok, usage=%d\n"), usage); return true; } @@ -469,17 +469,17 @@ static int doregister_rawinput (void) } } - //write_log (L"RegisterRawInputDevices = %d (%d)\n", activate, num); + //write_log (_T("RegisterRawInputDevices = %d (%d)\n"), activate, num); rawinput_reg = num; if (!add) rawinput_reg = -rawinput_reg; - //write_log (L"+++++++++++++++++++++++++++%x\n", hMainWnd); + //write_log (_T("+++++++++++++++++++++++++++%x\n"), hMainWnd); if (RegisterRawInputDevices (rid, num, sizeof RAWINPUTDEVICE) == FALSE) { - write_log (L"RAWINPUT %sregistration failed %d\n", - add ? L"" : L"un", GetLastError ()); + write_log (_T("RAWINPUT %sregistration failed %d\n"), + add ? _T("") : _T("un"), GetLastError ()); return 0; } - //write_log (L"-------------------------- %x\n", hMainWnd); + //write_log (_T("-------------------------- %x\n"), hMainWnd); return 1; } @@ -636,7 +636,7 @@ void send_tablet_proximity (int inproxi) void send_tablet (int x, int y, int z, int pres, uae_u32 buttons, int flags, int ax, int ay, int az, int rx, int ry, int rz, RECT *r) { - //write_log (L"%d %d %d (%d,%d,%d), %08X %d\n", x, y, pres, ax, ay, az, buttons, proxi); + //write_log (_T("%d %d %d (%d,%d,%d), %08X %d\n"), x, y, pres, ax, ay, az, buttons, proxi); if (axmax > 0) ax = ax * 255 / axmax; else @@ -713,12 +713,12 @@ void *open_tablet (HWND hwnd) if (zmax > 0) lc.lcInExtZ = tz.axMax; if (!initialized) { - write_log (L"Tablet '%s' parameters\n", tabletname); - write_log (L"Xmax=%d,Ymax=%d,Zmax=%d\n", xmax, ymax, zmax); - write_log (L"Xres=%.1f:%d,Yres=%.1f:%d,Zres=%.1f:%d\n", + write_log (_T("Tablet '%s' parameters\n"), tabletname); + write_log (_T("Xmax=%d,Ymax=%d,Zmax=%d\n"), xmax, ymax, zmax); + write_log (_T("Xres=%.1f:%d,Yres=%.1f:%d,Zres=%.1f:%d\n"), tx.axResolution / 65536.0, tx.axUnits, ty.axResolution / 65536.0, ty.axUnits, tz.axResolution / 65536.0, tz.axUnits); - write_log (L"Xrotmax=%d,Yrotmax=%d,Zrotmax=%d\n", axmax, aymax, azmax); - write_log (L"PressureMin=%d,PressureMax=%d\n", pres.axMin, pres.axMax); + write_log (_T("Xrotmax=%d,Yrotmax=%d,Zrotmax=%d\n"), axmax, aymax, azmax); + write_log (_T("PressureMin=%d,PressureMax=%d\n"), pres.axMin, pres.axMax); } maxpres = pres.axMax; xres = gettabletres (&tx); @@ -760,14 +760,14 @@ static int initialize_tablet (void) struct tagAXIS ori[3]; int tilt = 0; - h = LoadLibrary (L"wintab32.dll"); + h = LoadLibrary (_T("wintab32.dll")); if (h == NULL) { - write_log (L"Tablet: no wintab32.dll\n"); + write_log (_T("Tablet: no wintab32.dll\n")); return 0; } FreeLibrary (h); if (!WTInfo (0, 0, NULL)) { - write_log (L"Tablet: WTInfo() returned failure\n"); + write_log (_T("Tablet: WTInfo() returned failure\n")); return 0; } name[0] = 0; @@ -782,7 +782,7 @@ static int initialize_tablet (void) if (ori[2].axMax > 0) azmax = ori[2].axMax; } - write_log (L"Tablet '%s' detected\n", name); + write_log (_T("Tablet '%s' detected\n"), name); tabletname = my_strdup (name); tablet = TRUE; return 1; @@ -801,10 +801,10 @@ static int initialize_parjoyport (void) continue; HANDLE ph = CreateFile (p, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL); if (ph == INVALID_HANDLE_VALUE) { - write_log (L"PARJOY: '%s' failed to open: %u\n", p, GetLastError ()); + write_log (_T("PARJOY: '%s' failed to open: %u\n"), p, GetLastError ()); continue; } - write_log (L"PARJOY: '%s' open\n", p); + write_log (_T("PARJOY: '%s' open\n"), p); for (int j = 0; j < 2; j++) { TCHAR tmp[100]; did = di_joystick; @@ -812,20 +812,20 @@ static int initialize_parjoyport (void) cleardid(did); did->connection = DIDC_PARJOY; did->parjoy = ph; - _stprintf (tmp, L"Parallel joystick %d.%d", i + 1, j + 1); + _stprintf (tmp, _T("Parallel joystick %d.%d"), i + 1, j + 1); did->name = my_strdup (tmp); did->sortname = my_strdup (tmp); - _stprintf (tmp, L"PARJOY%d.%d", i, j); + _stprintf (tmp, _T("PARJOY%d.%d"), i, j); did->configname = my_strdup (tmp); did->buttons = did->buttons_real = 1; did->axles = 2; did->axissort[0] = 0; - did->axisname[0] = my_strdup (L"X Axis"); + did->axisname[0] = my_strdup (_T("X Axis")); did->axissort[1] = 1; - did->axisname[1] = my_strdup (L"Y Axis"); + did->axisname[1] = my_strdup (_T("Y Axis")); for (j = 0; j < did->buttons; j++) { did->buttonsort[j] = j; - _stprintf (tmp, L"Button %d", j + 1); + _stprintf (tmp, _T("Button %d"), j + 1); did->buttonname[j] = my_strdup (tmp); } did->priority = -1; @@ -851,20 +851,20 @@ static int initialize_catweasel (void) cleardid(did); did->connection = DIDC_CAT; did->catweasel = i; - _stprintf (tmp, L"Catweasel mouse"); + _stprintf (tmp, _T("Catweasel mouse")); did->name = my_strdup (tmp); did->sortname = my_strdup (tmp); - _stprintf (tmp, L"CWMOUSE%d", i); + _stprintf (tmp, _T("CWMOUSE%d"), i); did->configname = my_strdup (tmp); did->buttons = did->buttons_real = 3; did->axles = 2; did->axissort[0] = 0; - did->axisname[0] = my_strdup (L"X Axis"); + did->axisname[0] = my_strdup (_T("X Axis")); did->axissort[1] = 1; - did->axisname[1] = my_strdup (L"Y Axis"); + did->axisname[1] = my_strdup (_T("Y Axis")); for (j = 0; j < did->buttons; j++) { did->buttonsort[j] = j; - _stprintf (tmp, L"Button %d", j + 1); + _stprintf (tmp, _T("Button %d"), j + 1); did->buttonname[j] = my_strdup (tmp); } did->priority = -1; @@ -878,20 +878,20 @@ static int initialize_catweasel (void) cleardid(did); did->connection = DIDC_CAT; did->catweasel = i; - _stprintf (tmp, L"Catweasel joystick"); + _stprintf (tmp, _T("Catweasel joystick")); did->name = my_strdup (tmp); did->sortname = my_strdup (tmp); - _stprintf (tmp, L"CWJOY%d", i); + _stprintf (tmp, _T("CWJOY%d"), i); did->configname = my_strdup (tmp); did->buttons = did->buttons_real = (catweasel_isjoystick () & 0x80) ? 3 : 1; did->axles = 2; did->axissort[0] = 0; - did->axisname[0] = my_strdup (L"X Axis"); + did->axisname[0] = my_strdup (_T("X Axis")); did->axissort[1] = 1; - did->axisname[1] = my_strdup (L"Y Axis"); + did->axisname[1] = my_strdup (_T("Y Axis")); for (j = 0; j < did->buttons; j++) { did->buttonsort[j] = j; - _stprintf (tmp, L"Button %d", j + 1); + _stprintf (tmp, _T("Button %d"), j + 1); did->buttonname[j] = my_strdup (tmp); } did->priority = -1; @@ -938,26 +938,26 @@ static void sortobjects (struct didata *did) #if DI_DEBUG if (did->axles + did->buttons > 0) { - write_log (L"%s: (%04X/%04X)\n", did->name, did->vid, did->pid); + write_log (_T("%s: (%04X/%04X)\n"), did->name, did->vid, did->pid); if (did->connection == DIDC_DX) - write_log (L"PGUID=%s\n", outGUID (&did->pguid)); + write_log (_T("PGUID=%s\n"), outGUID (&did->pguid)); for (i = 0; i < did->axles; i++) { HIDP_VALUE_CAPS *caps = &did->hidvcaps[i]; - write_log (L"%02X %03d '%s' (%d, [%d - %d, %d - %d, %d %d %d])\n", + write_log (_T("%02X %03d '%s' (%d, [%d - %d, %d - %d, %d %d %d])\n"), did->axismappings[i], did->axismappings[i], did->axisname[i], did->axissort[i], caps->LogicalMin, caps->LogicalMax, caps->PhysicalMin, caps->PhysicalMax, caps->BitSize, caps->Units, caps->UnitsExp); } for (i = 0; i < did->buttons; i++) { - write_log (L"%02X %03d '%s' (%d)\n", + write_log (_T("%02X %03d '%s' (%d)\n"), did->buttonmappings[i], did->buttonmappings[i], did->buttonname[i], did->buttonsort[i]); } } #endif } -#define RDP_DEVICE1 L"\\??\\Root#" -#define RDP_DEVICE2 L"\\\\?\\Root#" +#define RDP_DEVICE1 _T("\\??\\Root#") +#define RDP_DEVICE2 _T("\\\\?\\Root#") static int rdpdevice(TCHAR *buf) { @@ -1016,11 +1016,11 @@ static void rawinputfixname (const TCHAR *name, const TCHAR *friendlyname) if (_tcslen (p2) >= _tcslen (tmp) && !_tcsncmp (p2, tmp, _tcslen (tmp))) { xfree (did->name); // if (did->vid > 0 && did->pid > 0) -// _stprintf (tmp, L"%s [%04X/%04X]", friendlyname, did->vid, did->pid); +// _stprintf (tmp, _T("%s [%04X/%04X]"), friendlyname, did->vid, did->pid); // else - _stprintf (tmp, L"%s", friendlyname); + _stprintf (tmp, _T("%s"), friendlyname); did->name = my_strdup (tmp); - write_log (L"'%s' ('%s')\n", did->name, did->configname); + write_log (_T("'%s' ('%s')\n"), did->name, did->configname); } } } @@ -1084,40 +1084,40 @@ static void rawinputfriendlynames (void) static const TCHAR *rawkeyboardlabels[256] = { - L"ESCAPE", - L"1",L"2",L"3",L"4",L"5",L"6",L"7",L"8",L"9",L"0", - L"MINUS",L"EQUALS",L"BACK",L"TAB", - L"Q",L"W",L"E",L"R",L"T",L"Y",L"U",L"I",L"O",L"P", - L"LBRACKET",L"RBRACKET",L"RETURN",L"LCONTROL", - L"A",L"S",L"D",L"F",L"G",L"H",L"J",L"K",L"L", - L"SEMICOLON",L"APOSTROPHE",L"GRAVE",L"LSHIFT",L"BACKSLASH", - L"Z",L"X",L"C",L"V",L"B",L"N",L"M", - L"COMMA",L"PERIOD",L"SLASH",L"RSHIFT",L"MULTIPLY",L"LMENU",L"SPACE",L"CAPITAL", - L"F1",L"F2",L"F3",L"F4",L"F5",L"F6",L"F7",L"F8",L"F9",L"F10", - L"NUMLOCK",L"SCROLL",L"NUMPAD7",L"NUMPAD8",L"NUMPAD9",L"SUBTRACT", - L"NUMPAD4",L"NUMPAD5",L"NUMPAD6",L"ADD",L"NUMPAD1",L"NUMPAD2",L"NUMPAD3",L"NUMPAD0", - L"DECIMAL",NULL,NULL,L"OEM_102",L"F11",L"F12", + _T("ESCAPE"), + _T("1"),_T("2"),_T("3"),_T("4"),_T("5"),_T("6"),_T("7"),_T("8"),_T("9"),_T("0"), + _T("MINUS"),_T("EQUALS"),_T("BACK"),_T("TAB"), + _T("Q"),_T("W"),_T("E"),_T("R"),_T("T"),_T("Y"),_T("U"),_T("I"),_T("O"),_T("P"), + _T("LBRACKET"),_T("RBRACKET"),_T("RETURN"),_T("LCONTROL"), + _T("A"),_T("S"),_T("D"),_T("F"),_T("G"),_T("H"),_T("J"),_T("K"),_T("L"), + _T("SEMICOLON"),_T("APOSTROPHE"),_T("GRAVE"),_T("LSHIFT"),_T("BACKSLASH"), + _T("Z"),_T("X"),_T("C"),_T("V"),_T("B"),_T("N"),_T("M"), + _T("COMMA"),_T("PERIOD"),_T("SLASH"),_T("RSHIFT"),_T("MULTIPLY"),_T("LMENU"),_T("SPACE"),_T("CAPITAL"), + _T("F1"),_T("F2"),_T("F3"),_T("F4"),_T("F5"),_T("F6"),_T("F7"),_T("F8"),_T("F9"),_T("F10"), + _T("NUMLOCK"),_T("SCROLL"),_T("NUMPAD7"),_T("NUMPAD8"),_T("NUMPAD9"),_T("SUBTRACT"), + _T("NUMPAD4"),_T("NUMPAD5"),_T("NUMPAD6"),_T("ADD"),_T("NUMPAD1"),_T("NUMPAD2"),_T("NUMPAD3"),_T("NUMPAD0"), + _T("DECIMAL"),NULL,NULL,_T("OEM_102"),_T("F11"),_T("F12"), NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, - L"F13",L"F14",L"F15",NULL,NULL,NULL,NULL,NULL,NULL,NULL, + _T("F13"),_T("F14"),_T("F15"),NULL,NULL,NULL,NULL,NULL,NULL,NULL, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, - L"NUMPADEQUALS",NULL,NULL, - L"PREVTRACK",NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, - L"NEXTTRACK",NULL,NULL,L"NUMPADENTER",L"RCONTROL",NULL,NULL, - L"MUTE",L"CALCULATOR",L"PLAYPAUSE",NULL,L"MEDIASTOP", + _T("NUMPADEQUALS"),NULL,NULL, + _T("PREVTRACK"),NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, + _T("NEXTTRACK"),NULL,NULL,_T("NUMPADENTER"),_T("RCONTROL"),NULL,NULL, + _T("MUTE"),_T("CALCULATOR"),_T("PLAYPAUSE"),NULL,_T("MEDIASTOP"), NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, - L"VOLUMEDOWN",NULL,L"VOLUMEUP",NULL,L"WEBHOME",L"NUMPADCOMMA",NULL, - L"DIVIDE",NULL,L"SYSRQ",L"RMENU", + _T("VOLUMEDOWN"),NULL,_T("VOLUMEUP"),NULL,_T("WEBHOME"),_T("NUMPADCOMMA"),NULL, + _T("DIVIDE"),NULL,_T("SYSRQ"),_T("RMENU"), NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, - L"PAUSE",NULL,L"HOME",L"UP",L"PRIOR",NULL,L"LEFT",NULL,L"RIGHT",NULL,L"END", - L"DOWN",L"NEXT",L"INSERT",L"DELETE", + _T("PAUSE"),NULL,_T("HOME"),_T("UP"),_T("PRIOR"),NULL,_T("LEFT"),NULL,_T("RIGHT"),NULL,_T("END"), + _T("DOWN"),_T("NEXT"),_T("INSERT"),_T("DELETE"), NULL,NULL,NULL,NULL,NULL,NULL,NULL, - L"LWIN",L"RWIN",L"APPS",L"POWER",L"SLEEP", + _T("LWIN"),_T("RWIN"),_T("APPS"),_T("POWER"),_T("SLEEP"), NULL,NULL,NULL, - L"WAKE",NULL,L"WEBSEARCH",L"WEBFAVORITES",L"WEBREFRESH",L"WEBSTOP", - L"WEBFORWARD",L"WEBBACK",L"MYCOMPUTER",L"MAIL",L"MEDIASELECT", - L"" + _T("WAKE"),NULL,_T("WEBSEARCH"),_T("WEBFAVORITES"),_T("WEBREFRESH"),_T("WEBSTOP"), + _T("WEBFORWARD"),_T("WEBBACK"),_T("MYCOMPUTER"),_T("MAIL"),_T("MEDIASELECT"), + _T("") }; static void getvidpid2 (const TCHAR *devname, int *id, const TCHAR *str) @@ -1128,7 +1128,7 @@ static void getvidpid2 (const TCHAR *devname, int *id, const TCHAR *str) TCHAR *s = _tcsstr (dv, str); if (s) { int val = -1; - _stscanf (s + _tcslen (str), L"%X", &val); + _stscanf (s + _tcslen (str), _T("%X"), &val); *id = val; } xfree (dv); @@ -1137,9 +1137,9 @@ static void getvidpid2 (const TCHAR *devname, int *id, const TCHAR *str) static void getvidpid (const TCHAR *devname, int *vid, int *pid, int *mi) { *vid = *pid = *mi = -1; - getvidpid2 (devname, vid, L"VID_"); - getvidpid2 (devname, pid, L"PID_"); - getvidpid2 (devname, mi, L"MI_"); + getvidpid2 (devname, vid, _T("VID_")); + getvidpid2 (devname, pid, _T("PID_")); + getvidpid2 (devname, mi, _T("MI_")); } static void addrkblabels (struct didata *did) @@ -1150,7 +1150,7 @@ static void addrkblabels (struct didata *did) if (rawkeyboardlabels[k] != NULL && rawkeyboardlabels[k][0]) _tcscpy (tmp, rawkeyboardlabels[k]); if (!tmp[0]) - _stprintf (tmp, L"KEY_%02X", k + 1); + _stprintf (tmp, _T("KEY_%02X"), k + 1); did->buttonname[k] = my_strdup (tmp); did->buttonmappings[k] = k + 1; did->buttonsort[k] = k + 1; @@ -1167,22 +1167,22 @@ struct hiddesc }; static const struct hiddesc hidtable[] = { - { 0x30, 1, 0x30, L"X Axis", 0 }, - { 0x31, 1, 0x31, L"Y Axis", 0 }, - { 0x32, 1, 0x32, L"Z Axis", 0 }, - { 0x33, 1, 0x33, L"X Rotation", 0 }, - { 0x34, 1, 0x34, L"Y Rotation", 0 }, - { 0x35, 1, 0x35, L"Z Rotation", 0 }, - { 0x36, 1, 0x36, L"Slider", AXISTYPE_SLIDER }, - { 0x37, 1, 0x37, L"Dial", AXISTYPE_DIAL }, - { 0x38, 1, 0x38, L"Wheel", 0 }, - { 0x39, 1, 0x39, L"Hat Switch", AXISTYPE_POV_X }, - { 0x90, 1, 0x90, L"D-pad Up", 0 }, - { 0x91, 1, 0x91, L"D-pad Down", 0 }, - { 0x92, 1, 0x92, L"D-pad Right", 0 }, - { 0x93, 1, 0x93, L"D-pad Left", 0 }, - { 0xbb, 2, 0xbb, L"Throttle", AXISTYPE_SLIDER }, - { 0xba, 2, 0xba, L"Rudder", 0 }, + { 0x30, 1, 0x30, _T("X Axis"), 0 }, + { 0x31, 1, 0x31, _T("Y Axis"), 0 }, + { 0x32, 1, 0x32, _T("Z Axis"), 0 }, + { 0x33, 1, 0x33, _T("X Rotation"), 0 }, + { 0x34, 1, 0x34, _T("Y Rotation"), 0 }, + { 0x35, 1, 0x35, _T("Z Rotation"), 0 }, + { 0x36, 1, 0x36, _T("Slider"), AXISTYPE_SLIDER }, + { 0x37, 1, 0x37, _T("Dial"), AXISTYPE_DIAL }, + { 0x38, 1, 0x38, _T("Wheel"), 0 }, + { 0x39, 1, 0x39, _T("Hat Switch"), AXISTYPE_POV_X }, + { 0x90, 1, 0x90, _T("D-pad Up"), 0 }, + { 0x91, 1, 0x91, _T("D-pad Down"), 0 }, + { 0x92, 1, 0x92, _T("D-pad Right"), 0 }, + { 0x93, 1, 0x93, _T("D-pad Left"), 0 }, + { 0xbb, 2, 0xbb, _T("Throttle"), AXISTYPE_SLIDER }, + { 0xba, 2, 0xba, _T("Rudder"), 0 }, { 0 } }; @@ -1295,16 +1295,16 @@ static bool initialize_rawinput (void) buf2 = buf1 + 10000; if (GetRawInputDeviceList (NULL, &num, sizeof (RAWINPUTDEVICELIST)) != 0) { - write_log (L"RAWINPUT error %08X\n", GetLastError()); + write_log (_T("RAWINPUT error %08X\n"), GetLastError()); goto error2; } - write_log (L"RAWINPUT: found %d devices\n", num); + write_log (_T("RAWINPUT: found %d devices\n"), num); if (num <= 0) goto error2; ridl = xcalloc (RAWINPUTDEVICELIST, num); gotnum = GetRawInputDeviceList (ridl, &num, sizeof (RAWINPUTDEVICELIST)); if (gotnum <= 0) { - write_log (L"RAWINPUT didn't find any devices\n"); + write_log (_T("RAWINPUT didn't find any devices\n")); goto error2; } rnum_raw = rnum_mouse = rnum_kb = rnum_hid = 0; @@ -1426,47 +1426,47 @@ static bool initialize_rawinput (void) did->fullname = true; } else { if (did->vid > 0 && did->pid > 0) - _stprintf (tmp, L"%s (%04X/%04X)", type == RIM_TYPEHID ? L"RAW HID" : (type == RIM_TYPEMOUSE ? L"RAW Mouse" : L"RAW Keyboard"), did->vid, did->pid); + _stprintf (tmp, _T("%s (%04X/%04X)"), type == RIM_TYPEHID ? _T("RAW HID") : (type == RIM_TYPEMOUSE ? _T("RAW Mouse") : _T("RAW Keyboard")), did->vid, did->pid); else - _stprintf (tmp, L"%s", type == RIM_TYPEHID ? L"RAW HID" : (type == RIM_TYPEMOUSE ? L"RAW Mouse" : L"RAW Keyboard")); + _stprintf (tmp, _T("%s"), type == RIM_TYPEHID ? _T("RAW HID") : (type == RIM_TYPEMOUSE ? _T("RAW Mouse") : _T("RAW Keyboard"))); } did->name = my_strdup (tmp); did->rawinput = h; did->connection = DIDC_RAW; - write_log (L"%p %s: ", h, type == RIM_TYPEHID ? L"hid" : (type == RIM_TYPEMOUSE ? L"mouse" : L"keyboard")); + write_log (_T("%p %s: "), h, type == RIM_TYPEHID ? _T("hid") : (type == RIM_TYPEMOUSE ? _T("mouse") : _T("keyboard"))); did->sortname = my_strdup (buf1); - write_log (L"'%s'\n", buf1); + write_log (_T("'%s'\n"), buf1); did->configname = my_strdup (buf1); if (type == RIM_TYPEMOUSE) { PRID_DEVICE_INFO_MOUSE rdim = &rdi->mouse; - write_log (L"id=%d buttons=%d hw=%d rate=%d\n", + write_log (_T("id=%d buttons=%d hw=%d rate=%d\n"), rdim->dwId, rdim->dwNumberOfButtons, rdim->fHasHorizontalWheel, rdim->dwSampleRate); if (rdim->dwNumberOfButtons >= MAX_MAPPINGS) { - write_log (L"bogus number of buttons, ignored\n"); + write_log (_T("bogus number of buttons, ignored\n")); } else { did->buttons_real = did->buttons = rdim->dwNumberOfButtons; for (j = 0; j < did->buttons; j++) { did->buttonsort[j] = j; did->buttonmappings[j] = j; - _stprintf (tmp, L"Button %d", j + 1); + _stprintf (tmp, _T("Button %d"), j + 1); did->buttonname[j] = my_strdup (tmp); } did->axles = 3; did->axissort[0] = 0; did->axismappings[0] = 0; - did->axisname[0] = my_strdup (L"X Axis"); + did->axisname[0] = my_strdup (_T("X Axis")); did->axissort[1] = 1; did->axismappings[1] = 1; - did->axisname[1] = my_strdup (L"Y Axis"); + did->axisname[1] = my_strdup (_T("Y Axis")); did->axissort[2] = 2; did->axismappings[2] = 2; - did->axisname[2] = my_strdup (L"Wheel"); + did->axisname[2] = my_strdup (_T("Wheel")); addplusminus (did, 2); if (1 || rdim->fHasHorizontalWheel) { // why is this always false? did->axissort[3] = 3; - did->axisname[3] = my_strdup (L"HWheel"); + did->axisname[3] = my_strdup (_T("HWheel")); did->axismappings[3] = 3; did->axles++; addplusminus (did, 3); @@ -1475,7 +1475,7 @@ static bool initialize_rawinput (void) } } else if (type == RIM_TYPEKEYBOARD) { PRID_DEVICE_INFO_KEYBOARD rdik = &rdi->keyboard; - write_log (L"type=%d sub=%d mode=%d fkeys=%d indicators=%d tkeys=%d\n", + write_log (_T("type=%d sub=%d mode=%d fkeys=%d indicators=%d tkeys=%d\n"), rdik->dwType, rdik->dwSubType, rdik->dwKeyboardMode, rdik->dwNumberOfFunctionKeys, rdik->dwNumberOfIndicators, rdik->dwNumberOfKeysTotal); addrkblabels (did); @@ -1499,7 +1499,7 @@ static bool initialize_rawinput (void) for (j = first; j <= last && buttoncnt < MAX_MAPPINGS; j++) { did->buttonsort[buttoncnt] = j * 2; did->buttonmappings[buttoncnt] = j; - _stprintf (tmp, L"Button %d", j); + _stprintf (tmp, _T("Button %d"), j); did->buttonname[buttoncnt] = my_strdup (tmp); buttoncnt++; } @@ -1531,7 +1531,7 @@ static bool initialize_rawinput (void) if (axiscnt + 1 < MAX_MAPPINGS) { for (int l = 0; l < 2; l++) { TCHAR tmp[256]; - _stprintf (tmp, L"%s (%c)", hidtable[ht].name, l == 0 ? 'X' : 'Y'); + _stprintf (tmp, _T("%s (%c)"), hidtable[ht].name, l == 0 ? 'X' : 'Y'); did->axisname[axiscnt] = my_strdup (tmp); did->axissort[axiscnt] = hidtable[ht].priority * 2 + l; did->axismappings[axiscnt] = acnt; @@ -1555,7 +1555,7 @@ static bool initialize_rawinput (void) } } if (hidtable[ht].name == NULL) - write_log (L"unsupported usage %d/%d\n", vcaps[i].UsagePage, acnt); + write_log (_T("unsupported usage %d/%d\n"), vcaps[i].UsagePage, acnt); } } if (axiscnt > 0) { @@ -1592,12 +1592,12 @@ static bool initialize_rawinput (void) struct didata *did = di_keyboard + num_keyboard; num_keyboard++; rnum_kb++; - did->name = my_strdup (L"WinUAE null keyboard"); + did->name = my_strdup (_T("WinUAE null keyboard")); did->rawinput = NULL; did->connection = DIDC_RAW; - did->sortname = my_strdup (L"NULLKEYBOARD"); + did->sortname = my_strdup (_T("NULLKEYBOARD")); did->priority = -2; - did->configname = my_strdup (L"NULLKEYBOARD"); + did->configname = my_strdup (_T("NULLKEYBOARD")); addrkblabels (did); } @@ -1615,7 +1615,7 @@ static bool initialize_rawinput (void) return 1; - write_log (L"RAWINPUT not available or failed to initialize\n"); + write_log (_T("RAWINPUT not available or failed to initialize\n")); error2: xfree (ridl); xfree (bufp); @@ -1633,11 +1633,11 @@ static void initialize_windowsmouse (void) if (num_mouse >= MAX_INPUT_DEVICES) return; num_mouse++; - name = (i == 0) ? L"Windows mouse" : L"Mousehack mouse"; + name = (i == 0) ? _T("Windows mouse") : _T("Mousehack mouse"); did->connection = DIDC_WIN; - did->name = my_strdup (i ? L"Mousehack mouse (Required for tablets)" : L"Windows mouse"); - did->sortname = my_strdup (i ? L"Windowsmouse2" : L"Windowsmouse1"); - did->configname = my_strdup (i ? L"WINMOUSE2" : L"WINMOUSE1"); + did->name = my_strdup (i ? _T("Mousehack mouse (Required for tablets)") : _T("Windows mouse")); + did->sortname = my_strdup (i ? _T("Windowsmouse2") : _T("Windowsmouse1")); + did->configname = my_strdup (i ? _T("WINMOUSE2") : _T("WINMOUSE1")); did->buttons = GetSystemMetrics (SM_CMOUSEBUTTONS); if (did->buttons < 3) did->buttons = 3; @@ -1646,23 +1646,23 @@ static void initialize_windowsmouse (void) did->buttons_real = did->buttons; for (j = 0; j < did->buttons; j++) { did->buttonsort[j] = j; - _stprintf (tmp, L"Button %d", j + 1); + _stprintf (tmp, _T("Button %d"), j + 1); did->buttonname[j] = my_strdup (tmp); } winmousewheelbuttonstart = did->buttons; did->axles = os_vista ? 4 : 3; did->axissort[0] = 0; - did->axisname[0] = my_strdup (L"X Axis"); + did->axisname[0] = my_strdup (_T("X Axis")); did->axissort[1] = 1; - did->axisname[1] = my_strdup (L"Y Axis"); + did->axisname[1] = my_strdup (_T("Y Axis")); if (did->axles > 2) { did->axissort[2] = 2; - did->axisname[2] = my_strdup (L"Wheel"); + did->axisname[2] = my_strdup (_T("Wheel")); addplusminus (did, 2); } if (did->axles > 3) { did->axissort[3] = 3; - did->axisname[3] = my_strdup (L"HWheel"); + did->axisname[3] = my_strdup (_T("HWheel")); addplusminus (did, 3); } did->priority = 2; @@ -1690,7 +1690,7 @@ static void handle_rawinput_2 (RAWINPUT *raw) } } if (rawinput_log & 2) - write_log (L"HANDLE=%08x %04x %04x %04x %08x %3d %3d %08x M=%d\n", + write_log (_T("HANDLE=%08x %04x %04x %04x %08x %3d %3d %08x M=%d\n"), raw->header.hDevice, rm->usFlags, rm->usButtonFlags, @@ -1770,7 +1770,7 @@ static void handle_rawinput_2 (RAWINPUT *raw) PCHAR rawdata; if (rawinput_log & 4) { uae_u8 *r = hid->bRawData; - write_log (L"%d %d %02x%02x%02x%02x%02x%02x%02x\n", hid->dwCount, hid->dwSizeHid, + write_log (_T("%d %d %02x%02x%02x%02x%02x%02x%02x\n"), hid->dwCount, hid->dwSizeHid, r[0], r[1], r[2], r[3], r[4], r[5], r[6]); } for (num = 0; num < num_joystick; num++) { @@ -1798,7 +1798,7 @@ static void handle_rawinput_2 (RAWINPUT *raw) } if (j == did->maxusagelistlength || did->prevusagelist[j].Usage == 0) { if (rawinput_log & 4) - write_log (L"%d/%d ON\n", did->usagelist[k].UsagePage, did->usagelist[k].Usage); + write_log (_T("%d/%d ON\n"), did->usagelist[k].UsagePage, did->usagelist[k].Usage); for (int l = 0; l < did->buttons; l++) { if (did->buttonmappings[l] == did->usagelist[k].Usage) @@ -1811,7 +1811,7 @@ static void handle_rawinput_2 (RAWINPUT *raw) for (j = 0; j < did->maxusagelistlength; j++) { if (did->prevusagelist[j].Usage) { if (rawinput_log & 4) - write_log (L"%d/%d OFF\n", did->prevusagelist[j].UsagePage, did->prevusagelist[j].Usage); + write_log (_T("%d/%d OFF\n"), did->prevusagelist[j].UsagePage, did->prevusagelist[j].Usage); for (int l = 0; l < did->buttons; l++) { if (did->buttonmappings[l] == did->prevusagelist[j].Usage) @@ -1882,12 +1882,12 @@ static void handle_rawinput_2 (RAWINPUT *raw) data = logicalrange; else data = 0; - //write_log (L"%d %d: (%d-%d) %d\n", num, axisnum, did->axismin[axisnum], did->axismax[axisnum], data); + //write_log (_T("%d %d: (%d-%d) %d\n"), num, axisnum, did->axismin[axisnum], did->axismax[axisnum], data); } } if (data != axisold[num][axisnum] && logicalrange) { - //write_log (L"%d %d: %d->%d\n", num, axisnum, axisold[num][axisnum], data); + //write_log (_T("%d %d: %d->%d\n"), num, axisnum, axisold[num][axisnum], data); axisold[num][axisnum] = data; int bstate = -1; for (j = 0; j < did->buttons; j++) { @@ -1916,7 +1916,7 @@ static void handle_rawinput_2 (RAWINPUT *raw) int pressed = (rk->Flags & RI_KEY_BREAK) ? 0 : 1; if (rawinput_log & 1) - write_log (L"HANDLE=%x CODE=%x Flags=%x VK=%x MSG=%x EXTRA=%x SC=%x\n", + write_log (_T("HANDLE=%x CODE=%x Flags=%x VK=%x MSG=%x EXTRA=%x SC=%x\n"), raw->header.hDevice, rk->MakeCode, rk->Flags, @@ -1931,7 +1931,7 @@ static void handle_rawinput_2 (RAWINPUT *raw) if (scancode == 0) { scancode = MapVirtualKey (rk->VKey, MAPVK_VK_TO_VSC); if (rawinput_log & 1) - write_log (L"VK->CODE: %x\n", scancode); + write_log (_T("VK->CODE: %x\n"), scancode); } if (rk->VKey == 0xff || (rk->Flags & RI_KEY_E0)) @@ -2039,11 +2039,11 @@ void handle_rawinput (LPARAM lParam) handle_rawinput_2 (raw); DefRawInputProc (&raw, 1, sizeof (RAWINPUTHEADER)); } else { - write_log (L"GetRawInputData(%d) failed, %d\n", dwSize, GetLastError ()); + write_log (_T("GetRawInputData(%d) failed, %d\n"), dwSize, GetLastError ()); } } } else { - write_log (L"GetRawInputData(-1) failed, %d\n", GetLastError ()); + write_log (_T("GetRawInputData(-1) failed, %d\n"), GetLastError ()); } } @@ -2053,7 +2053,7 @@ static void unacquire (LPDIRECTINPUTDEVICE8 lpdi, TCHAR *txt) if (lpdi) { hr = IDirectInputDevice8_Unacquire (lpdi); if (FAILED (hr) && hr != DI_NOEFFECT) - write_log (L"unacquire %s failed, %s\n", txt, DXError (hr)); + write_log (_T("unacquire %s failed, %s\n"), txt, DXError (hr)); } } @@ -2063,7 +2063,7 @@ static int acquire (LPDIRECTINPUTDEVICE8 lpdi, TCHAR *txt) if (lpdi) { hr = IDirectInputDevice8_Acquire (lpdi); if (FAILED (hr) && hr != 0x80070005) { - write_log (L"acquire %s failed, %s\n", txt, DXError (hr)); + write_log (_T("acquire %s failed, %s\n"), txt, DXError (hr)); } } return SUCCEEDED (hr) ? 1 : 0; @@ -2085,10 +2085,10 @@ static int setcoop (struct didata *did, DWORD mode, TCHAR *txt) if (!did->coop && hwnd) { hr = IDirectInputDevice8_SetCooperativeLevel (did->lpdi, hwnd, mode); if (FAILED (hr) && hr != E_NOTIMPL) { - write_log (L"setcooperativelevel %s failed, %s\n", txt, DXError (hr)); + write_log (_T("setcooperativelevel %s failed, %s\n"), txt, DXError (hr)); } else { did->coop = 1; - //write_log (L"cooperativelevel %s set\n", txt); + //write_log (_T("cooperativelevel %s set\n"), txt); } } } @@ -2127,10 +2127,10 @@ static void sortdd (struct didata *dd, int num, int type) for (j = i; j < num; j++) { did2 = &dd[j]; if (!_tcscmp (tmp2, did2->name)) { - _stprintf (tmp, L"%s [%d]", did2->name, cnt); + _stprintf (tmp, _T("%s [%d]"), did2->name, cnt); xfree (did2->name); did2->name = my_strdup (tmp); - _stprintf (tmp, L"%s [%d]", did2->sortname, cnt); + _stprintf (tmp, _T("%s [%d]"), did2->sortname, cnt); xfree (did2->sortname); did2->sortname = my_strdup (tmp); cnt++; @@ -2186,7 +2186,7 @@ static BOOL CALLBACK EnumObjectsCallback (const DIDEVICEOBJECTINSTANCE* pdidoi, #if 0 if (pdidoi->dwOfs != DIDFT_GETINSTANCE (pdidoi->dwType)) - write_log (L"%x-%s: %x <> %x\n", pdidoi->dwType & 0xff, pdidoi->tszName, + write_log (_T("%x-%s: %x <> %x\n"), pdidoi->dwType & 0xff, pdidoi->tszName, pdidoi->dwOfs, DIDFT_GETINSTANCE (pdidoi->dwType)); #endif if (pdidoi->dwType & DIDFT_AXIS) { @@ -2204,7 +2204,7 @@ static BOOL CALLBACK EnumObjectsCallback (const DIDEVICEOBJECTINSTANCE* pdidoi, if (sort < 0) { for (i = 0; i < did->axles; i++) { if (did->axissort[i] == sort) { - write_log (L"ignored duplicate '%s'\n", pdidoi->tszName); + write_log (_T("ignored duplicate '%s'\n"), pdidoi->tszName); return DIENUM_CONTINUE; } } @@ -2228,7 +2228,7 @@ static BOOL CALLBACK EnumObjectsCallback (const DIDEVICEOBJECTINSTANCE* pdidoi, did->axissort[did->axles] = makesort_mouse (&pdidoi->guidType, &did->axismappings[did->axles]); for (i = 0; i < 2; i++) { did->axismappings[did->axles + i] = DIJOFS_POV(numpov); - _stprintf (tmp, L"%s (%c)", pdidoi->tszName, i ? 'Y' : 'X'); + _stprintf (tmp, _T("%s (%c)"), pdidoi->tszName, i ? 'Y' : 'X'); did->axisname[did->axles + i] = my_strdup (tmp); did->axissort[did->axles + i] = did->axissort[did->axles]; did->axistype[did->axles + i] = i + 1; @@ -2262,7 +2262,7 @@ static void trimws (TCHAR *s) { /* Delete trailing whitespace. */ int len = _tcslen (s); - while (len > 0 && _tcscspn (s + len - 1, L"\t \r\n") == 0) + while (len > 0 && _tcscspn (s + len - 1, _T("\t \r\n")) == 0) s[--len] = '\0'; } @@ -2279,23 +2279,23 @@ static BOOL di_enumcallback2 (LPCDIDEVICEINSTANCE lpddi, int joy) type = lpddi->dwDevType & 0xff; if (type == DI8DEVTYPE_MOUSE || type == DI8DEVTYPE_SCREENPOINTER) { did = di_mouse; - typetxt = L"Mouse"; + typetxt = _T("Mouse"); } else if ((type == DI8DEVTYPE_GAMEPAD || type == DI8DEVTYPE_JOYSTICK || type == DI8DEVTYPE_SUPPLEMENTAL || type == DI8DEVTYPE_FLIGHT || type == DI8DEVTYPE_DRIVING || type == DI8DEVTYPE_1STPERSON) || joy) { did = di_joystick; - typetxt = L"Game controller"; + typetxt = _T("Game controller"); } else if (type == DI8DEVTYPE_KEYBOARD) { did = di_keyboard; - typetxt = L"Keyboard"; + typetxt = _T("Keyboard"); } else { did = NULL; - typetxt = L"Unknown"; + typetxt = _T("Unknown"); } #if DI_DEBUG - write_log (L"I=%s ", outGUID (&lpddi->guidInstance)); - write_log (L"P=%s\n", outGUID (&lpddi->guidProduct)); - write_log (L"'%s' '%s' %08X [%s]\n", lpddi->tszProductName, lpddi->tszInstanceName, lpddi->dwDevType, typetxt); + write_log (_T("I=%s "), outGUID (&lpddi->guidInstance)); + write_log (_T("P=%s\n"), outGUID (&lpddi->guidProduct)); + write_log (_T("'%s' '%s' %08X [%s]\n"), lpddi->tszProductName, lpddi->tszInstanceName, lpddi->dwDevType, typetxt); #endif if (did == di_mouse) { @@ -2323,10 +2323,10 @@ static BOOL di_enumcallback2 (LPCDIDEVICEINSTANCE lpddi, int joy) _tcscpy (did->name, lpddi->tszInstanceName); } else { did->name = xmalloc (TCHAR, 100); - _tcscpy (did->name, L"[no name]"); + _tcscpy (did->name, _T("[no name]")); } trimws (did->name); - _stprintf (tmp, L"%08X-%04X-%04X-%02X%02X%02X%02X%02X%02X%02X%02X %08X-%04X-%04X-%02X%02X%02X%02X%02X%02X%02X%02X", + _stprintf (tmp, _T("%08X-%04X-%04X-%02X%02X%02X%02X%02X%02X%02X%02X %08X-%04X-%04X-%02X%02X%02X%02X%02X%02X%02X%02X"), lpddi->guidProduct.Data1, lpddi->guidProduct.Data2, lpddi->guidProduct.Data3, lpddi->guidProduct.Data4[0], lpddi->guidProduct.Data4[1], lpddi->guidProduct.Data4[2], lpddi->guidProduct.Data4[3], lpddi->guidProduct.Data4[4], lpddi->guidProduct.Data4[5], lpddi->guidProduct.Data4[6], lpddi->guidProduct.Data4[7], @@ -2392,7 +2392,7 @@ static int di_do_init (void) rawinput_enabled_hid = 0; if (!no_rawinput) { - write_log (L"RawInput enumeration..\n"); + write_log (_T("RawInput enumeration..\n")); if (!initialize_rawinput ()) rawinput_enabled_hid = 0; } else { @@ -2413,34 +2413,34 @@ static int di_do_init (void) hr = DirectInput8Create (hInst, DIRECTINPUT_VERSION, IID_IDirectInput8, (LPVOID *)&g_lpdi, NULL); if (FAILED (hr)) { - write_log (L"DirectInput8Create failed, %s\n", DXError (hr)); + write_log (_T("DirectInput8Create failed, %s\n"), DXError (hr)); } else { if (dinput_enum_all) { - write_log (L"DirectInput enumeration..\n"); + write_log (_T("DirectInput enumeration..\n")); g_lpdi->EnumDevices (DI8DEVCLASS_ALL, di_enumcallback, 0, DIEDFL_ATTACHEDONLY); } else { if (!rawinput_enabled_keyboard) { - write_log (L"DirectInput enumeration.. Keyboards..\n"); + write_log (_T("DirectInput enumeration.. Keyboards..\n")); g_lpdi->EnumDevices (DI8DEVCLASS_KEYBOARD, di_enumcallback, 0, DIEDFL_ATTACHEDONLY); } if (!rawinput_enabled_mouse) { - write_log (L"DirectInput enumeration.. Pointing devices..\n"); + write_log (_T("DirectInput enumeration.. Pointing devices..\n")); g_lpdi->EnumDevices (DI8DEVCLASS_POINTER, di_enumcallback, 0, DIEDFL_ATTACHEDONLY); } - write_log (L"DirectInput enumeration.. Game controllers..\n"); + write_log (_T("DirectInput enumeration.. Game controllers..\n")); g_lpdi->EnumDevices (DI8DEVCLASS_GAMECTRL, di_enumcallbackj, 0, DIEDFL_ATTACHEDONLY); } } - write_log (L"Windowsmouse initialization..\n"); + write_log (_T("Windowsmouse initialization..\n")); initialize_windowsmouse (); - write_log (L"Catweasel joymouse initialization..\n"); + write_log (_T("Catweasel joymouse initialization..\n")); initialize_catweasel (); -// write_log (L"Parallel joystick port initialization..\n"); +// write_log (_T("Parallel joystick port initialization..\n")); // initialize_parjoyport (); - write_log (L"wintab tablet initialization..\n"); + write_log (_T("wintab tablet initialization..\n")); initialize_tablet (); - write_log (L"end\n"); + write_log (_T("end\n")); sortdd (di_joystick, num_joystick, DID_JOYSTICK); sortdd (di_mouse, num_mouse, DID_MOUSE); @@ -2556,7 +2556,7 @@ static int init_mouse (void) sortobjects (did); did->lpdi = lpdi; } else { - write_log (L"mouse %d CreateDevice failed, %s\n", i, DXError (hr)); + write_log (_T("mouse %d CreateDevice failed, %s\n"), i, DXError (hr)); } } } @@ -2588,9 +2588,9 @@ static int acquire_mouse (int num, int flags) return 1; } - unacquire (lpdi, L"mouse"); + unacquire (lpdi, _T("mouse")); if (did->connection == DIDC_DX && lpdi) { - setcoop (&di_mouse[num], flags ? (DISCL_FOREGROUND | DISCL_EXCLUSIVE) : (DISCL_BACKGROUND | DISCL_NONEXCLUSIVE), L"mouse"); + setcoop (&di_mouse[num], flags ? (DISCL_FOREGROUND | DISCL_EXCLUSIVE) : (DISCL_BACKGROUND | DISCL_NONEXCLUSIVE), _T("mouse")); dipdw.diph.dwSize = sizeof (DIPROPDWORD); dipdw.diph.dwHeaderSize = sizeof (DIPROPHEADER); dipdw.diph.dwObj = 0; @@ -2598,8 +2598,8 @@ static int acquire_mouse (int num, int flags) dipdw.dwData = DI_BUFFER; hr = IDirectInputDevice8_SetProperty (lpdi, DIPROP_BUFFERSIZE, &dipdw.diph); if (FAILED (hr)) - write_log (L"mouse setpropertry failed, %s\n", DXError (hr)); - di_mouse[num].acquired = acquire (lpdi, L"mouse") ? 1 : -1; + write_log (_T("mouse setpropertry failed, %s\n"), DXError (hr)); + di_mouse[num].acquired = acquire (lpdi, _T("mouse")) ? 1 : -1; } else { di_mouse[num].acquired = 1; } @@ -2624,7 +2624,7 @@ static void unacquire_mouse (int num) doregister_rawinput (); return; } - unacquire (di_mouse[num].lpdi, L"mouse"); + unacquire (di_mouse[num].lpdi, _T("mouse")); if (di_mouse[num].acquired > 0) { if (di_mouse[num].rawinput) rawmouse--; @@ -2682,7 +2682,7 @@ static void read_mouse (void) int data = didod[j].dwData; int state = (data & 0x80) ? 1 : 0; if (rawinput_log & 8) - write_log (L"MOUSE: %d OFF=%d DATA=%d STATE=%d\n", i, dimofs, data, state); + write_log (_T("MOUSE: %d OFF=%d DATA=%d STATE=%d\n"), i, dimofs, data, state); if (istest || isfocus () > 0) { for (k = 0; k < did->axles; k++) { @@ -2719,9 +2719,9 @@ static void read_mouse (void) } } } else if (hr == DIERR_INPUTLOST) { - acquire (lpdi, L"mouse"); + acquire (lpdi, _T("mouse")); } else if (did->acquired && hr == DIERR_NOTACQUIRED) { - acquire (lpdi, L"mouse"); + acquire (lpdi, _T("mouse")); } IDirectInputDevice8_Poll (lpdi); } @@ -2797,7 +2797,7 @@ static int init_kb (void) if (SUCCEEDED (hr)) { hr = lpdi->SetDataFormat (&c_dfDIKeyboard); if (FAILED (hr)) - write_log (L"keyboard setdataformat failed, %s\n", DXError (hr)); + write_log (_T("keyboard setdataformat failed, %s\n"), DXError (hr)); memset (&dipdw, 0, sizeof (dipdw)); dipdw.diph.dwSize = sizeof (DIPROPDWORD); dipdw.diph.dwHeaderSize = sizeof (DIPROPHEADER); @@ -2806,12 +2806,12 @@ static int init_kb (void) dipdw.dwData = DI_KBBUFFER; hr = lpdi->SetProperty (DIPROP_BUFFERSIZE, &dipdw.diph); if (FAILED (hr)) - write_log (L"keyboard setpropertry failed, %s\n", DXError (hr)); + write_log (_T("keyboard setpropertry failed, %s\n"), DXError (hr)); lpdi->EnumObjects (EnumObjectsCallback, did, DIDFT_ALL); sortobjects (did); did->lpdi = lpdi; } else - write_log (L"keyboard CreateDevice failed, %s\n", DXError (hr)); + write_log (_T("keyboard CreateDevice failed, %s\n"), DXError (hr)); } } keyboard_german = 0; @@ -2874,19 +2874,19 @@ static int acquire_kb (int num, int flags) } lpdi = di_keyboard[num].lpdi; - unacquire (lpdi, L"keyboard"); + unacquire (lpdi, _T("keyboard")); if (currprefs.keyboard_leds_in_use) { #ifdef WINDDK if (!currprefs.win32_kbledmode) { - if (DefineDosDevice (DDD_RAW_TARGET_PATH, L"Kbd", L"\\Device\\KeyboardClass0")) { - kbhandle = CreateFile (L"\\\\.\\Kbd", GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL); + if (DefineDosDevice (DDD_RAW_TARGET_PATH, _T("Kbd"), _T("\\Device\\KeyboardClass0"))) { + kbhandle = CreateFile (_T("\\\\.\\Kbd"), GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL); if (kbhandle == INVALID_HANDLE_VALUE) { - write_log (L"kbled: CreateFile failed, error %d\n", GetLastError()); + write_log (_T("kbled: CreateFile failed, error %d\n"), GetLastError()); currprefs.win32_kbledmode = 1; } } else { currprefs.win32_kbledmode = 1; - write_log (L"kbled: DefineDosDevice failed, error %d\n", GetLastError()); + write_log (_T("kbled: DefineDosDevice failed, error %d\n"), GetLastError()); } } #else @@ -2899,10 +2899,10 @@ static int acquire_kb (int num, int flags) } //lock_kb (); - setcoop (&di_keyboard[num], DISCL_NOWINKEY | DISCL_FOREGROUND | DISCL_EXCLUSIVE, L"keyboard"); + setcoop (&di_keyboard[num], DISCL_NOWINKEY | DISCL_FOREGROUND | DISCL_EXCLUSIVE, _T("keyboard")); kb_do_refresh = ~0; di_keyboard[num].acquired = -1; - if (acquire (lpdi, L"keyboard")) { + if (acquire (lpdi, _T("keyboard"))) { if (di_keyboard[num].rawinput) rawkb++; else if (di_keyboard[num].superdevice) @@ -2922,7 +2922,7 @@ static void unacquire_kb (int num) return; } lpdi = di_keyboard[num].lpdi; - unacquire (lpdi, L"keyboard"); + unacquire (lpdi, _T("keyboard")); if (di_keyboard[num].acquired > 0) { if (di_keyboard[num].rawinput) rawkb--; @@ -2941,7 +2941,7 @@ static void unacquire_kb (int num) #ifdef WINDDK if (kbhandle != INVALID_HANDLE_VALUE) { CloseHandle (kbhandle); - DefineDosDevice (DDD_REMOVE_DEFINITION, L"Kbd", NULL); + DefineDosDevice (DDD_REMOVE_DEFINITION, _T("Kbd"), NULL); kbhandle = INVALID_HANDLE_VALUE; } #endif @@ -2965,7 +2965,7 @@ static int refresh_kb (LPDIRECTINPUTDEVICE8 lpdi, int num) else kc[i] = 0; if (kc[i] != di_keycodes[num][i]) { - write_log (L"%d: %02X -> %d\n", num, i, kc[i]); + write_log (_T("%d: %02X -> %d\n"), num, i, kc[i]); di_keycodes[num][i] = kc[i]; my_kbd_handler (num, i, kc[i]); } @@ -3016,7 +3016,7 @@ static void read_kb (void) int scancode = didod[j].dwOfs; int pressed = (didod[j].dwData & 0x80) ? 1 : 0; - //write_log (L"%d: %02X %d\n", j, scancode, pressed); + //write_log (_T("%d: %02X %d\n"), j, scancode, pressed); if (!istest) scancode = keyhack (scancode, pressed, i); if (scancode < 0) @@ -3210,10 +3210,10 @@ static void read_joystick (void) PAR_QUERY_INFORMATION inf; ret = 0; if (DeviceIoControl (did->parjoy, IOCTL_PAR_QUERY_INFORMATION, NULL, 0, &inf, sizeof inf, &ret, NULL)) { - write_log (L"PARJOY: IOCTL_PAR_QUERY_INFORMATION = %u\n", GetLastError ()); + write_log (_T("PARJOY: IOCTL_PAR_QUERY_INFORMATION = %u\n"), GetLastError ()); } else { if (inf.Status != did->oldparjoystatus.Status) { - write_log (L"PARJOY: %08x\n", inf.Status); + write_log (_T("PARJOY: %08x\n"), inf.Status); did->oldparjoystatus.Status = inf.Status; } } @@ -3238,7 +3238,7 @@ static void read_joystick (void) memcpy (did->hidbufferprev, did->hidbuffer, readbytes); DWORD usagelength = did->maxusagelistlength; if (changedreport) - write_log (L"%02x%02x%02x%02x%02x%02x%02x\n", + write_log (_T("%02x%02x%02x%02x%02x%02x%02x\n"), (uae_u8)did->hidbuffer[0], (uae_u8)did->hidbuffer[1], (uae_u8)did->hidbuffer[2], (uae_u8)did->hidbuffer[3], (uae_u8)did->hidbuffer[4], (uae_u8)did->hidbuffer[5], (uae_u8)did->hidbuffer[6]); if (HidP_GetUsagesEx (HidP_Input, 0, did->usagelist, &usagelength, did->hidpreparseddata, did->hidbuffer, readbytes) == HIDP_STATUS_SUCCESS) { for (k = 0; k < usagelength; k++) { @@ -3248,14 +3248,14 @@ static void read_joystick (void) break; } if (j == did->maxusagelistlength || did->prevusagelist[j].Usage == 0) { - write_log (L"%d/%d ON\n", did->usagelist[k].UsagePage, did->usagelist[k].Usage); + write_log (_T("%d/%d ON\n"), did->usagelist[k].UsagePage, did->usagelist[k].Usage); } else { did->prevusagelist[j].Usage = 0; } } for (j = 0; j < did->maxusagelistlength; j++) { if (did->prevusagelist[j].Usage) { - write_log (L"%d/%d OFF\n", did->prevusagelist[j].UsagePage, did->prevusagelist[j].Usage); + write_log (_T("%d/%d OFF\n"), did->prevusagelist[j].UsagePage, did->prevusagelist[j].Usage); } } memcpy (did->prevusagelist, did->usagelist, usagelength * sizeof USAGE_AND_PAGE); @@ -3307,7 +3307,7 @@ static void read_joystick (void) setjoybuttonstate (i, k, bstate); axisold[i][k] = bstate; if (rawinput_log & 8) - write_log (L"AB:NUM=%d OFF=%d AXIS=%d DIR=%d NAME=%s VAL=%d STATE=%d BS=%d\n", + write_log (_T("AB:NUM=%d OFF=%d AXIS=%d DIR=%d NAME=%s VAL=%d STATE=%d BS=%d\n"), k, dimofs, axis, dir, did->buttonname[k], data, state, bstate); } @@ -3315,7 +3315,7 @@ static void read_joystick (void) } else if (did->buttonaxisparent[k] < 0 && did->buttonmappings[k] == dimofs) { if (rawinput_log & 8) - write_log (L"B:NUM=%d OFF=%d NAME=%s VAL=%d STATE=%d\n", + write_log (_T("B:NUM=%d OFF=%d NAME=%s VAL=%d STATE=%d\n"), k, dimofs, did->buttonname[k], data, state); setjoybuttonstate (i, k, state); } @@ -3328,11 +3328,11 @@ static void read_joystick (void) } else if (did->axistype[k] == 2) { setjoystickstate (i, k, ((data2 >= 29250 && data2 <= 33750) || (data2 >= 0 && data2 <= 6750)) ? -1 : (data2 >= 11250 && data2 <= 24750) ? 1 : 0, 1); if (rawinput_log & 8) - write_log (L"P:NUM=%d OFF=%d NAME=%s VAL=%d\n", k, dimofs, did->axisname[k], data2); + write_log (_T("P:NUM=%d OFF=%d NAME=%s VAL=%d\n"), k, dimofs, did->axisname[k], data2); } else if (did->axistype[k] == 0) { if (rawinput_log & 8) { if (data < -20000 || data > 20000) - write_log (L"A:NUM=%d OFF=%d NAME=%s VAL=%d\n", k, dimofs, did->axisname[k], data); + write_log (_T("A:NUM=%d OFF=%d NAME=%s VAL=%d\n"), k, dimofs, did->axisname[k], data); } if (istest) { if (data < -20000) @@ -3353,9 +3353,9 @@ static void read_joystick (void) } } else if (hr == DIERR_INPUTLOST) { - acquire (lpdi, L"joystick"); + acquire (lpdi, _T("joystick")); } else if (did->acquired && hr == DIERR_NOTACQUIRED) { - acquire (lpdi, L"joystick"); + acquire (lpdi, _T("joystick")); } IDirectInputDevice8_Poll (lpdi); } @@ -3386,7 +3386,7 @@ static int init_joystick (void) sortobjects (did); } } else { - write_log (L"joystick createdevice failed, %s\n", DXError (hr)); + write_log (_T("joystick createdevice failed, %s\n"), DXError (hr)); } } } @@ -3428,9 +3428,9 @@ static int acquire_joystick (int num, int flags) return 1; } lpdi = di_joystick[num].lpdi; - unacquire (lpdi, L"joystick"); + unacquire (lpdi, _T("joystick")); if (di_joystick[num].connection == DIDC_DX && lpdi) { - setcoop (&di_joystick[num], flags ? (DISCL_FOREGROUND | DISCL_EXCLUSIVE) : (DISCL_BACKGROUND | DISCL_NONEXCLUSIVE), L"joystick"); + setcoop (&di_joystick[num], flags ? (DISCL_FOREGROUND | DISCL_EXCLUSIVE) : (DISCL_BACKGROUND | DISCL_NONEXCLUSIVE), _T("joystick")); memset (&dipdw, 0, sizeof (dipdw)); dipdw.diph.dwSize = sizeof (DIPROPDWORD); dipdw.diph.dwHeaderSize = sizeof (DIPROPHEADER); @@ -3439,8 +3439,8 @@ static int acquire_joystick (int num, int flags) dipdw.dwData = DI_BUFFER; hr = IDirectInputDevice8_SetProperty (lpdi, DIPROP_BUFFERSIZE, &dipdw.diph); if (FAILED (hr)) - write_log (L"joystick setproperty failed, %s\n", DXError (hr)); - di_joystick[num].acquired = acquire (lpdi, L"joystick") ? 1 : -1; + write_log (_T("joystick setproperty failed, %s\n"), DXError (hr)); + di_joystick[num].acquired = acquire (lpdi, _T("joystick")) ? 1 : -1; } else if (di_joystick[num].connection == DIDC_RAW) { rawhid++; di_joystick[num].acquired = 1; @@ -3459,7 +3459,7 @@ static void unacquire_joystick (int num) return; } - unacquire (did->lpdi, L"joystick"); + unacquire (did->lpdi, _T("joystick")); if (did->connection == DIDC_RAW) { if (di_joystick[num].acquired) rawhid--; diff --git a/od-win32/direct3d.cpp b/od-win32/direct3d.cpp index f16a5fee..dfe1846b 100644 --- a/od-win32/direct3d.cpp +++ b/od-win32/direct3d.cpp @@ -15,7 +15,7 @@ #endif #define EFFECT_VERSION 3 -#define D3DX9DLL L"d3dx9_43.dll" +#define D3DX9DLL _T("d3dx9_43.dll") #define TWOPASS 1 #include "options.h" @@ -37,7 +37,7 @@ extern int D3DEX, d3ddebug; #include "direct3d.h" -static TCHAR *D3DHEAD = L"-"; +static TCHAR *D3DHEAD = _T("-"); static int psEnabled, psActive, psPreProcess, shaderon; static bool showoverlay = true; @@ -114,7 +114,7 @@ static void ddraw_fs_hack_free (void) ddraw->RestoreDisplayMode (); hr = ddraw->SetCooperativeLevel (d3dhwnd, DDSCL_NORMAL); if (FAILED (hr)) { - write_log (L"IDirectDraw7_SetCooperativeLevel CLEAR: %s\n", DXError (hr)); + write_log (_T("IDirectDraw7_SetCooperativeLevel CLEAR: %s\n"), DXError (hr)); } ddraw->Release (); ddraw = NULL; @@ -134,26 +134,26 @@ static int ddraw_fs_hack_init (void) return 0; hr = DirectDrawCreateEx (md->primary ? NULL : &md->ddguid, (LPVOID*)&ddraw, IID_IDirectDraw7, NULL); if (FAILED (hr)) { - write_log (L"DirectDrawCreateEx failed, %s\n", DXError (hr)); + write_log (_T("DirectDrawCreateEx failed, %s\n"), DXError (hr)); return 0; } ddraw_fs = 1; hr = ddraw->SetCooperativeLevel (d3dhwnd, DDSCL_ALLOWREBOOT | DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN); if (FAILED (hr)) { - write_log (L"IDirectDraw7_SetCooperativeLevel SET: %s\n", DXError (hr)); + write_log (_T("IDirectDraw7_SetCooperativeLevel SET: %s\n"), DXError (hr)); ddraw_fs_hack_free (); return 0; } hr = ddraw->SetDisplayMode (dpp.BackBufferWidth, dpp.BackBufferHeight, t_depth, dpp.FullScreen_RefreshRateInHz, 0); if (FAILED (hr)) { - write_log (L"1:IDirectDraw7_SetDisplayMode: %s\n", DXError (hr)); + write_log (_T("1:IDirectDraw7_SetDisplayMode: %s\n"), DXError (hr)); if (dpp.FullScreen_RefreshRateInHz && isvsync_chipset () < 0) { hr = ddraw->SetDisplayMode (dpp.BackBufferWidth, dpp.BackBufferHeight, t_depth, 0, 0); if (FAILED (hr)) - write_log (L"2:IDirectDraw7_SetDisplayMode: %s\n", DXError (hr)); + write_log (_T("2:IDirectDraw7_SetDisplayMode: %s\n"), DXError (hr)); } if (FAILED (hr)) { - write_log (L"IDirectDraw7_SetDisplayMode: %s\n", DXError (hr)); + write_log (_T("IDirectDraw7_SetDisplayMode: %s\n"), DXError (hr)); ddraw_fs_hack_free (); return 0; } @@ -164,12 +164,12 @@ static int ddraw_fs_hack_init (void) static TCHAR *D3D_ErrorText (HRESULT error) { - return L""; + return _T(""); } static TCHAR *D3D_ErrorString (HRESULT dival) { static TCHAR dierr[200]; - _stprintf (dierr, L"%08X S=%d F=%04X C=%04X (%d) (%s)", + _stprintf (dierr, _T("%08X S=%d F=%04X C=%04X (%d) (%s)"), dival, (dival & 0x80000000) ? 1 : 0, HRESULT_FACILITY(dival), HRESULT_CODE(dival), @@ -217,7 +217,7 @@ static TCHAR *D3DX_ErrorString (HRESULT hr, LPD3DXBUFFER Errors) _tcscpy (buffer, D3D_ErrorString (hr)); if (s) { if (buffer[0]) - _tcscat (buffer, L" "); + _tcscat (buffer, _T(" ")); _tcscat (buffer, s); } xfree (s); @@ -277,7 +277,7 @@ static int postEffect_ParseParameters (LPD3DXEFFECTCOMPILER EffectCompiler, LPD3 postFilterMode = effect->GetParameterByName (NULL, "filtermode"); postTexelSize = effect->GetParameterByName (NULL, "texelsize"); if (!postMaskShift || !postMaskMult || !postFilterMode || !postMatrixSource || !postTexelSize) { - gui_message (L"Mismatched _winuae.fx! Exiting.."); + gui_message (_T("Mismatched _winuae.fx! Exiting..")); abort (); } return true; @@ -310,7 +310,7 @@ static int psEffect_ParseParameters (LPD3DXEFFECTCOMPILER EffectCompiler, LPD3DX hParam = effect->GetParameter (NULL, iParam); hr = effect->GetParameterDesc (hParam, &ParamDesc); if (FAILED (hr)) { - write_log (L"GetParameterDescParm(%d) failed: %s\n", D3DHEAD, iParam, D3DX_ErrorString (hr, NULL)); + write_log (_T("GetParameterDescParm(%d) failed: %s\n"), D3DHEAD, iParam, D3DX_ErrorString (hr, NULL)); return 0; } hr = S_OK; @@ -361,7 +361,7 @@ static int psEffect_ParseParameters (LPD3DXEFFECTCOMPILER EffectCompiler, LPD3DX } } if (FAILED (hr)) { - write_log (L"ParamDesc.Semantic failed: %s\n", D3DHEAD, D3DX_ErrorString (hr, NULL)); + write_log (_T("ParamDesc.Semantic failed: %s\n"), D3DHEAD, D3DX_ErrorString (hr, NULL)); return 0; } } @@ -370,7 +370,7 @@ static int psEffect_ParseParameters (LPD3DXEFFECTCOMPILER EffectCompiler, LPD3DX hAnnot = effect->GetAnnotation (hParam, iAnnot); hr = effect->GetParameterDesc(hAnnot, &AnnotDesc); if (FAILED (hr)) { - write_log (L"GetParameterDescAnnot(%d) failed: %s\n", D3DHEAD, iAnnot, D3DX_ErrorString (hr, NULL)); + write_log (_T("GetParameterDescAnnot(%d) failed: %s\n"), D3DHEAD, iAnnot, D3DX_ErrorString (hr, NULL)); return 0; } hr = S_OK; @@ -391,7 +391,7 @@ static int psEffect_ParseParameters (LPD3DXEFFECTCOMPILER EffectCompiler, LPD3DX hr = effect->GetString(hAnnot, &pstrTextureType); } if (FAILED (hr)) { - write_log (L"GetString/GetInt(%d) failed: %s\n", D3DHEAD, iAnnot, D3DX_ErrorString (hr, NULL)); + write_log (_T("GetString/GetInt(%d) failed: %s\n"), D3DHEAD, iAnnot, D3DX_ErrorString (hr, NULL)); return 0; } } @@ -453,7 +453,7 @@ static int psEffect_ParseParameters (LPD3DXEFFECTCOMPILER EffectCompiler, LPD3DX if (ppTextureShader) ppTextureShader->Release (); } else { - write_log (L"%s: Could not compile texture shader: %s\n", D3DHEAD, D3DX_ErrorString (hr, lpErrors)); + write_log (_T("%s: Could not compile texture shader: %s\n"), D3DHEAD, D3DX_ErrorString (hr, lpErrors)); if (lpErrors) lpErrors->Release (); return 0; @@ -513,7 +513,7 @@ int D3D_canshaders (void) if (d3dx != NULL) { if (SUCCEEDED (d3dx->GetDeviceCaps (D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, &d3dCaps))) { if (d3dCaps.PixelShaderVersion >= D3DPS_VERSION(2,0)) { - write_log (L"Direct3D: Pixel shader 2.0+ support detected, shader filters enabled.\n"); + write_log (_T("Direct3D: Pixel shader 2.0+ support detected, shader filters enabled.\n")); d3d_yesno = 1; } } @@ -750,11 +750,11 @@ static LPD3DXEFFECT psEffect_LoadEffect (const TCHAR *shaderfile, int full) bool plugin_path; compileflags |= EFFECTCOMPILERFLAGS; - plugin_path = get_plugin_path (tmp, sizeof tmp / sizeof (TCHAR), L"filtershaders\\direct3d"); + plugin_path = get_plugin_path (tmp, sizeof tmp / sizeof (TCHAR), _T("filtershaders\\direct3d")); _tcscpy (tmp3, tmp); _tcscat (tmp, shaderfile); if (!full) { - struct zfile *z = zfile_fopen (tmp, L"r", 0); + struct zfile *z = zfile_fopen (tmp, _T("r"), 0); if (z) { existsfile = 1; zfile_fgets (tmp2, sizeof tmp2 / sizeof (TCHAR), z); @@ -763,21 +763,21 @@ static LPD3DXEFFECT psEffect_LoadEffect (const TCHAR *shaderfile, int full) if (ver == EFFECT_VERSION) { canusefile = 1; } else { - write_log (L"'%s' mismatched version (%d != %d)\n", tmp, ver, EFFECT_VERSION); + write_log (_T("'%s' mismatched version (%d != %d)\n"), tmp, ver, EFFECT_VERSION); } } hr = E_FAIL; if (canusefile) { - write_log (L"%s: Attempting to load '%s'\n", D3DHEAD, tmp); + write_log (_T("%s: Attempting to load '%s'\n"), D3DHEAD, tmp); hr = D3DXCreateEffectCompilerFromFile (tmp, NULL, NULL, compileflags, &EffectCompiler, &Errors); if (FAILED (hr)) - write_log (L"%s: D3DXCreateEffectCompilerFromFile failed: %s\n", D3DHEAD, D3DX_ErrorString (hr, Errors)); + write_log (_T("%s: D3DXCreateEffectCompilerFromFile failed: %s\n"), D3DHEAD, D3DX_ErrorString (hr, Errors)); } if (FAILED (hr)) { const char *str = psEnabled ? fx20 : fx10; int len = strlen (str); if (!existsfile && plugin_path) { - struct zfile *z = zfile_fopen (tmp, L"w", 0); + struct zfile *z = zfile_fopen (tmp, _T("w"), 0); if (z) { zfile_fwrite ((void*)str, len, 1, z); zfile_fclose (z); @@ -785,28 +785,28 @@ static LPD3DXEFFECT psEffect_LoadEffect (const TCHAR *shaderfile, int full) } hr = D3DXCreateEffectCompiler (str, len, NULL, NULL, compileflags, &EffectCompiler, &Errors); if (FAILED (hr)) { - write_log (L"%s: D3DXCreateEffectCompilerFromResource failed: %s\n", D3DHEAD, D3DX_ErrorString (hr, Errors)); + write_log (_T("%s: D3DXCreateEffectCompilerFromResource failed: %s\n"), D3DHEAD, D3DX_ErrorString (hr, Errors)); goto end; } } } else { - write_log (L"%s: Attempting to load '%s'\n", D3DHEAD, tmp); + write_log (_T("%s: Attempting to load '%s'\n"), D3DHEAD, tmp); hr = D3DXCreateEffectCompilerFromFile (tmp, NULL, NULL, compileflags, &EffectCompiler, &Errors); if (FAILED (hr)) { - write_log (L"%s: D3DXCreateEffectCompilerFromFile failed: %s\n", D3DHEAD, D3DX_ErrorString (hr, Errors)); + write_log (_T("%s: D3DXCreateEffectCompilerFromFile failed: %s\n"), D3DHEAD, D3DX_ErrorString (hr, Errors)); goto end; } } if (Errors) { - write_log (L"%s: '%s' warning: %s\n", D3DHEAD, shaderfile, D3DX_ErrorString (hr, Errors)); + write_log (_T("%s: '%s' warning: %s\n"), D3DHEAD, shaderfile, D3DX_ErrorString (hr, Errors)); Errors->Release(); Errors = NULL; } hr = EffectCompiler->CompileEffect (0, &BufferEffect, &Errors); if (FAILED (hr)) { - write_log (L"%s: CompileEffect failed: %s\n", D3DHEAD, D3DX_ErrorString (hr, Errors)); + write_log (_T("%s: CompileEffect failed: %s\n"), D3DHEAD, D3DX_ErrorString (hr, Errors)); goto end; } void *bp = BufferEffect->GetBufferPointer (); @@ -817,12 +817,12 @@ static LPD3DXEFFECT psEffect_LoadEffect (const TCHAR *shaderfile, int full) EFFECTCOMPILERFLAGS, NULL, &effect, &Errors); if (FAILED (hr)) { - write_log (L"%s: D3DXCreateEffect failed: %s\n", D3DHEAD, D3DX_ErrorString (hr, Errors)); + write_log (_T("%s: D3DXCreateEffect failed: %s\n"), D3DHEAD, D3DX_ErrorString (hr, Errors)); goto end; } hr = effect->GetDesc (&EffectDesc); if (FAILED (hr)) { - write_log (L"%s: effect->GetDesc() failed: %s\n", D3DHEAD, D3DX_ErrorString (hr, Errors)); + write_log (_T("%s: effect->GetDesc() failed: %s\n"), D3DHEAD, D3DX_ErrorString (hr, Errors)); goto end; } if (full) { @@ -854,9 +854,9 @@ end: } if (ret) - write_log (L"%s: pixelshader filter '%s' enabled\n", D3DHEAD, tmp); + write_log (_T("%s: pixelshader filter '%s' enabled\n"), D3DHEAD, tmp); else - write_log (L"%s: pixelshader filter '%s' failed to initialize\n", D3DHEAD, tmp); + write_log (_T("%s: pixelshader filter '%s' failed to initialize\n"), D3DHEAD, tmp); return effect; } @@ -867,21 +867,21 @@ static int psEffect_SetMatrices (D3DXMATRIXA16 *matProj, D3DXMATRIXA16 *matView, if (m_MatWorldEffectHandle) { hr = pEffect->SetMatrix (m_MatWorldEffectHandle, matWorld); if (FAILED (hr)) { - write_log (L"%s: Create:SetMatrix:matWorld %s\n", D3DHEAD, D3D_ErrorString (hr)); + write_log (_T("%s: Create:SetMatrix:matWorld %s\n"), D3DHEAD, D3D_ErrorString (hr)); return 0; } } if (m_MatViewEffectHandle) { hr = pEffect->SetMatrix (m_MatViewEffectHandle, matView); if (FAILED (hr)) { - write_log (L"%s: Create:SetMatrix:matView %s\n", D3DHEAD, D3D_ErrorString (hr)); + write_log (_T("%s: Create:SetMatrix:matView %s\n"), D3DHEAD, D3D_ErrorString (hr)); return 0; } } if (m_MatProjEffectHandle) { hr = pEffect->SetMatrix (m_MatProjEffectHandle, matProj); if (FAILED (hr)) { - write_log (L"%s: Create:SetMatrix:matProj %s\n", D3DHEAD, D3D_ErrorString (hr)); + write_log (_T("%s: Create:SetMatrix:matProj %s\n"), D3DHEAD, D3D_ErrorString (hr)); return 0; } } @@ -890,7 +890,7 @@ static int psEffect_SetMatrices (D3DXMATRIXA16 *matProj, D3DXMATRIXA16 *matView, D3DXMatrixMultiply (&matWorldView, matWorld, matView); hr = pEffect->SetMatrix (m_MatWorldViewEffectHandle, &matWorldView); if (FAILED (hr)) { - write_log (L"%s: Create:SetMatrix:matWorldView %s\n", D3DHEAD, D3D_ErrorString (hr)); + write_log (_T("%s: Create:SetMatrix:matWorldView %s\n"), D3DHEAD, D3D_ErrorString (hr)); return 0; } } @@ -899,7 +899,7 @@ static int psEffect_SetMatrices (D3DXMATRIXA16 *matProj, D3DXMATRIXA16 *matView, D3DXMatrixMultiply (&matViewProj, matView, matProj); hr = pEffect->SetMatrix (m_MatViewProjEffectHandle, &matViewProj); if (FAILED (hr)) { - write_log (L"%s: Create:SetMatrix:matViewProj %s\n", D3DHEAD, D3D_ErrorString (hr)); + write_log (_T("%s: Create:SetMatrix:matViewProj %s\n"), D3DHEAD, D3D_ErrorString (hr)); return 0; } } @@ -909,7 +909,7 @@ static int psEffect_SetMatrices (D3DXMATRIXA16 *matProj, D3DXMATRIXA16 *matView, D3DXMatrixMultiply (&matWorldViewProj, &tmp, matProj); hr = pEffect->SetMatrix (m_MatWorldViewProjEffectHandle, &matWorldViewProj); if (FAILED (hr)) { - write_log (L"%s: Create:SetMatrix:matWorldViewProj %s\n", D3DHEAD, D3D_ErrorString (hr)); + write_log (_T("%s: Create:SetMatrix:matWorldViewProj %s\n"), D3DHEAD, D3D_ErrorString (hr)); return 0; } } @@ -923,32 +923,32 @@ static int psEffect_SetTextures (LPDIRECT3DTEXTURE9 lpSource, LPDIRECT3DTEXTURE9 D3DXVECTOR4 fDims, fTexelSize; if (!m_SourceTextureEffectHandle) { - write_log (L"%s: Texture with SOURCETEXTURE semantic not found\n", D3DHEAD); + write_log (_T("%s: Texture with SOURCETEXTURE semantic not found\n"), D3DHEAD); return 0; } hr = pEffect->SetTexture (m_SourceTextureEffectHandle, lpSource); if (FAILED (hr)) { - write_log (L"%s: SetTextures:lpSource %s\n", D3DHEAD, D3D_ErrorString (hr)); + write_log (_T("%s: SetTextures:lpSource %s\n"), D3DHEAD, D3D_ErrorString (hr)); return 0; } if (m_WorkingTexture1EffectHandle) { hr = pEffect->SetTexture (m_WorkingTexture1EffectHandle, lpWorking1); if (FAILED (hr)) { - write_log (L"%s: SetTextures:lpWorking1 %s\n", D3DHEAD, D3D_ErrorString (hr)); + write_log (_T("%s: SetTextures:lpWorking1 %s\n"), D3DHEAD, D3D_ErrorString (hr)); return 0; } } if (m_WorkingTexture2EffectHandle) { hr = pEffect->SetTexture (m_WorkingTexture2EffectHandle, lpWorking2); if (FAILED (hr)) { - write_log (L"%s: SetTextures:lpWorking2 %s\n", D3DHEAD, D3D_ErrorString (hr)); + write_log (_T("%s: SetTextures:lpWorking2 %s\n"), D3DHEAD, D3D_ErrorString (hr)); return 0; } } if (m_Hq2xLookupTextureHandle) { hr = pEffect->SetTexture (m_Hq2xLookupTextureHandle, lpHq2xLookupTexture); if (FAILED (hr)) { - write_log (L"%s: SetTextures:lpHq2xLookupTexture %s\n", D3DHEAD, D3D_ErrorString (hr)); + write_log (_T("%s: SetTextures:lpHq2xLookupTexture %s\n"), D3DHEAD, D3D_ErrorString (hr)); return 0; } } @@ -967,14 +967,14 @@ static int psEffect_SetTextures (LPDIRECT3DTEXTURE9 lpSource, LPDIRECT3DTEXTURE9 if (m_SourceDimsEffectHandle) { hr = pEffect->SetVector (m_SourceDimsEffectHandle, &fDims); if (FAILED (hr)) { - write_log (L"%s: SetTextures:SetVector:Source %s\n", D3DHEAD, D3D_ErrorString (hr)); + write_log (_T("%s: SetTextures:SetVector:Source %s\n"), D3DHEAD, D3D_ErrorString (hr)); return 0; } } if (m_TexelSizeEffectHandle) { hr = pEffect->SetVector (m_TexelSizeEffectHandle, &fTexelSize); if (FAILED (hr)) { - write_log (L"%s: SetTextures:SetVector:Texel %s\n", D3DHEAD, D3D_ErrorString (hr)); + write_log (_T("%s: SetTextures:SetVector:Texel %s\n"), D3DHEAD, D3D_ErrorString (hr)); return 0; } } @@ -1001,12 +1001,12 @@ static int psEffect_Begin (LPD3DXEFFECT effect, enum psEffect_Pass pass, UINT *p break; } if (FAILED (hr)) { - write_log (L"%s: SetTechnique: %s\n", D3DHEAD, D3D_ErrorString (hr)); + write_log (_T("%s: SetTechnique: %s\n"), D3DHEAD, D3D_ErrorString (hr)); return 0; } hr = effect->Begin (pPasses, 0); if (FAILED (hr)) { - write_log (L"%s: Begin: %s\n", D3DHEAD, D3D_ErrorString (hr)); + write_log (_T("%s: Begin: %s\n"), D3DHEAD, D3D_ErrorString (hr)); return 0; } return 1; @@ -1018,7 +1018,7 @@ static int psEffect_BeginPass (LPD3DXEFFECT effect, UINT Pass) hr = effect->BeginPass (Pass); if (FAILED (hr)) { - write_log (L"%s: BeginPass: %s\n", D3DHEAD, D3D_ErrorString (hr)); + write_log (_T("%s: BeginPass: %s\n"), D3DHEAD, D3D_ErrorString (hr)); return 0; } return 1; @@ -1029,7 +1029,7 @@ static int psEffect_EndPass (LPD3DXEFFECT effect) hr = effect->EndPass (); if (FAILED (hr)) { - write_log (L"%s: EndPass: %s\n", D3DHEAD, D3D_ErrorString (hr)); + write_log (_T("%s: EndPass: %s\n"), D3DHEAD, D3D_ErrorString (hr)); return 0; } return 1; @@ -1040,7 +1040,7 @@ static int psEffect_End (LPD3DXEFFECT effect) hr = effect->End (); if (FAILED (hr)) { - write_log (L"%s: End: %s\n", D3DHEAD, D3D_ErrorString (hr)); + write_log (_T("%s: End: %s\n"), D3DHEAD, D3D_ErrorString (hr)); return 0; } return 1; @@ -1054,13 +1054,13 @@ static LPDIRECT3DTEXTURE9 createtext (int w, int h, D3DFORMAT format) hr = d3ddev->CreateTexture (w, h, 1, D3DUSAGE_DYNAMIC, format, D3DPOOL_DEFAULT, &t, NULL); if (FAILED (hr)) - write_log (L"%s: CreateTexture() D3DUSAGE_DYNAMIC failed: %s (%d*%d %08x)\n", + write_log (_T("%s: CreateTexture() D3DUSAGE_DYNAMIC failed: %s (%d*%d %08x)\n"), D3DHEAD, D3D_ErrorString (hr), w, h, format); if (FAILED (hr)) { hr = d3ddev->CreateTexture (w, h, 1, 0, format, D3DPOOL_DEFAULT, &t, NULL); } if (FAILED (hr)) { - write_log (L"%s: CreateTexture() failed: %s (%d*%d %08x)\n", + write_log (_T("%s: CreateTexture() failed: %s (%d*%d %08x)\n"), D3DHEAD, D3D_ErrorString (hr), w, h, format); return 0; } @@ -1087,7 +1087,7 @@ static int createtexture (int iw, int ih, int ow, int oh, int win_w, int win_h) texture = createtext (iw, ih, tformat); if (!texture) return 0; - write_log (L"%s: %d*%d texture allocated, bits per pixel %d\n", D3DHEAD, iw, ih, t_depth); + write_log (_T("%s: %d*%d texture allocated, bits per pixel %d\n"), D3DHEAD, iw, ih, t_depth); int w, h; if (ow > win_w * multx && oh > win_h * multx) { w = ow; @@ -1097,28 +1097,28 @@ static int createtexture (int iw, int ih, int ow, int oh, int win_w, int win_h) h = win_h * multx; } if (FAILED (hr = d3ddev->CreateTexture (w, h, 1, D3DUSAGE_RENDERTARGET, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &lpTempTexture, NULL))) { - write_log (L"%s: Failed to create working texture1: %s\n", D3DHEAD, D3D_ErrorString (hr)); + write_log (_T("%s: Failed to create working texture1: %s\n"), D3DHEAD, D3D_ErrorString (hr)); return 0; } - write_log (L"%s: %d*%d working texture allocated, bits per pixel %d\n", D3DHEAD, w, h, t_depth); + write_log (_T("%s: %d*%d working texture allocated, bits per pixel %d\n"), D3DHEAD, w, h, t_depth); texelsize.x = 1.0f / w; texelsize.y = 1.0f / h; texelsize.z = 1; texelsize.w = 1; if (psActive) { D3DLOCKED_BOX lockedBox; if (FAILED (hr = d3ddev->CreateTexture (iw, ih, 1, D3DUSAGE_RENDERTARGET, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &lpWorkTexture1, NULL))) { - write_log (L"%s: Failed to create temp texture: %s\n", D3DHEAD, D3D_ErrorString (hr)); + write_log (_T("%s: Failed to create temp texture: %s\n"), D3DHEAD, D3D_ErrorString (hr)); return 0; } if (FAILED (hr = d3ddev->CreateTexture (iw, ih, 1, D3DUSAGE_RENDERTARGET, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &lpWorkTexture2, NULL))) { - write_log (L"%s: Failed to create working texture2: %s\n", D3DHEAD, D3D_ErrorString (hr)); + write_log (_T("%s: Failed to create working texture2: %s\n"), D3DHEAD, D3D_ErrorString (hr)); return 0; } if (FAILED (hr = d3ddev->CreateVolumeTexture (256, 16, 256, 1, D3DUSAGE_DYNAMIC, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &lpHq2xLookupTexture, NULL))) { - write_log (L"%s: Failed to create volume texture: %s\n", D3DHEAD, D3D_ErrorString (hr)); + write_log (_T("%s: Failed to create volume texture: %s\n"), D3DHEAD, D3D_ErrorString (hr)); return 0; } if (FAILED (hr = lpHq2xLookupTexture->LockBox (0, &lockedBox, NULL, 0))) { - write_log (L"%s: Failed to lock box of volume texture: %s\n", D3DHEAD, D3D_ErrorString (hr)); + write_log (_T("%s: Failed to lock box of volume texture: %s\n"), D3DHEAD, D3D_ErrorString (hr)); return 0; } BuildHq2xLookupTexture (w, h, iw, ih, (unsigned char*)lockedBox.pBits); @@ -1147,7 +1147,7 @@ static void updateleds (void) } hr = ledtexture->LockRect (0, &locked, NULL, D3DLOCK_DISCARD); if (FAILED (hr)) { - write_log (L"%d: SL LockRect failed: %s\n", D3DHEAD, D3D_ErrorString (hr)); + write_log (_T("%d: SL LockRect failed: %s\n"), D3DHEAD, D3D_ErrorString (hr)); return; } for (y = 0; y < TD_TOTAL_HEIGHT; y++) { @@ -1175,7 +1175,7 @@ static int createsltexture (void) sltexture = createtext (required_sl_texture_w, required_sl_texture_h, t_depth < 32 ? D3DFMT_A4R4G4B4 : D3DFMT_A8R8G8B8); if (!sltexture) return 0; - write_log (L"%s: SL %d*%d texture allocated\n", D3DHEAD, required_sl_texture_w, required_sl_texture_h); + write_log (_T("%s: SL %d*%d texture allocated\n"), D3DHEAD, required_sl_texture_w, required_sl_texture_h); maskmult_x = 1.0; maskmult_y = 1.0; return 1; @@ -1219,7 +1219,7 @@ static void createscanlines (int force) hr = sltexture->LockRect (0, &locked, NULL, 0); if (FAILED (hr)) { - write_log (L"%s: SL LockRect failed: %s\n", D3DHEAD, D3D_ErrorString (hr)); + write_log (_T("%s: SL LockRect failed: %s\n"), D3DHEAD, D3D_ErrorString (hr)); return; } sld = (uae_u8*)locked.pBits; @@ -1296,7 +1296,7 @@ static int createmask2texture (const TCHAR *filename) zf = NULL; for (int i = 0; i < 2; i++) { if (i == 0) { - get_plugin_path (tmp, sizeof tmp / sizeof (TCHAR), L"overlays"); + get_plugin_path (tmp, sizeof tmp / sizeof (TCHAR), _T("overlays")); _tcscat (tmp, filename); } else { _tcscpy (tmp, filename); @@ -1321,8 +1321,8 @@ static int createmask2texture (const TCHAR *filename) s2--; } _tcscpy (tmp2, s); - _stprintf (s, L"_%dx%d%s", window_w, window_h, tmp2); - zf = zfile_fopen (tmp3, L"rb", ZFD_NORMAL); + _stprintf (s, _T("_%dx%d%s"), window_w, window_h, tmp2); + zf = zfile_fopen (tmp3, _T("rb"), ZFD_NORMAL); if (zf) break; float aspect = (float)window_w / window_h; @@ -1334,18 +1334,18 @@ static int createmask2texture (const TCHAR *filename) if (abs (aspect - 4.0 / 3.0) <= 0.1) ax = 4, ay = 3; if (ax > 0 && ay > 0) { - _stprintf (s, L"_%dx%d%s", ax, ay, tmp2); - zf = zfile_fopen (tmp3, L"rb", ZFD_NORMAL); + _stprintf (s, _T("_%dx%d%s"), ax, ay, tmp2); + zf = zfile_fopen (tmp3, _T("rb"), ZFD_NORMAL); if (zf) break; } } - zf = zfile_fopen (tmp, L"rb", ZFD_NORMAL); + zf = zfile_fopen (tmp, _T("rb"), ZFD_NORMAL); if (zf) break; } if (!zf) { - write_log (L"%s: couldn't open overlay '%s'\n", D3DHEAD, filename); + write_log (_T("%s: couldn't open overlay '%s'\n"), D3DHEAD, filename); return 0; } size = zfile_size (zf); @@ -1357,7 +1357,7 @@ static int createmask2texture (const TCHAR *filename) D3DPOOL_DEFAULT, D3DX_FILTER_NONE, D3DX_FILTER_NONE, 0, &dinfo, NULL, &tx); xfree (buf); if (FAILED (hr)) { - write_log (L"%s: overlay texture load failed: %s\n", D3DHEAD, D3D_ErrorString (hr)); + write_log (_T("%s: overlay texture load failed: %s\n"), D3DHEAD, D3D_ErrorString (hr)); goto end; } mask2texture_w = dinfo.Width; @@ -1431,7 +1431,7 @@ static int createmask2texture (const TCHAR *filename) mask2texture_hhx = mask2texture_h * ymult; - write_log (L"%s: overlay '%s' %.0f*%.0f (%d*%d - %d*%d) (%d*%d)\n", + write_log (_T("%s: overlay '%s' %.0f*%.0f (%d*%d - %d*%d) (%d*%d)\n"), D3DHEAD, tmp, mask2texture_w, mask2texture_h, mask2rect.left, mask2rect.top, mask2rect.right, mask2rect.bottom, mask2rect.right - mask2rect.left, mask2rect.bottom - mask2rect.top); @@ -1458,13 +1458,13 @@ static int createmasktexture (const TCHAR *filename) if (filename[0] == 0) return 0; tx = NULL; - get_plugin_path (tmp, sizeof tmp / sizeof (TCHAR), L"masks"); + get_plugin_path (tmp, sizeof tmp / sizeof (TCHAR), _T("masks")); _tcscat (tmp, filename); - zf = zfile_fopen (tmp, L"rb", ZFD_NORMAL); + zf = zfile_fopen (tmp, _T("rb"), ZFD_NORMAL); if (!zf) { - zf = zfile_fopen (filename, L"rb", ZFD_NORMAL); + zf = zfile_fopen (filename, _T("rb"), ZFD_NORMAL); if (!zf) { - write_log (L"%s: couldn't open mask '%s'\n", D3DHEAD, filename); + write_log (_T("%s: couldn't open mask '%s'\n"), D3DHEAD, filename); return 0; } } @@ -1477,12 +1477,12 @@ static int createmasktexture (const TCHAR *filename) D3DPOOL_DEFAULT, D3DX_FILTER_NONE, D3DX_FILTER_NONE, 0, &dinfo, NULL, &tx); xfree (buf); if (FAILED (hr)) { - write_log (L"%s: temp mask texture load failed: %s\n", D3DHEAD, D3D_ErrorString (hr)); + write_log (_T("%s: temp mask texture load failed: %s\n"), D3DHEAD, D3D_ErrorString (hr)); goto end; } hr = tx->GetLevelDesc (0, &txdesc); if (FAILED (hr)) { - write_log (L"%s: mask image texture GetLevelDesc() failed: %s\n", D3DHEAD, D3D_ErrorString (hr)); + write_log (_T("%s: mask image texture GetLevelDesc() failed: %s\n"), D3DHEAD, D3D_ErrorString (hr)); goto end; } masktexture_w = dinfo.Width; @@ -1494,12 +1494,12 @@ static int createmasktexture (const TCHAR *filename) } else { masktexture = createtext (window_w, window_h, D3DFMT_X8R8G8B8); if (FAILED (hr)) { - write_log (L"%s: mask texture creation failed: %s\n", D3DHEAD, D3D_ErrorString (hr)); + write_log (_T("%s: mask texture creation failed: %s\n"), D3DHEAD, D3D_ErrorString (hr)); goto end; } hr = masktexture->GetLevelDesc (0, &maskdesc); if (FAILED (hr)) { - write_log (L"%s: mask texture GetLevelDesc() failed: %s\n", D3DHEAD, D3D_ErrorString (hr)); + write_log (_T("%s: mask texture GetLevelDesc() failed: %s\n"), D3DHEAD, D3D_ErrorString (hr)); goto end; } if (SUCCEEDED (hr = masktexture->LockRect (0, &lock, NULL, 0))) { @@ -1533,7 +1533,7 @@ static int createmasktexture (const TCHAR *filename) masktexture_w = maskdesc.Width; masktexture_h = maskdesc.Height; } - write_log (L"%s: mask %d*%d (%d*%d) ('%s') texture allocated\n", D3DHEAD, masktexture_w, masktexture_h, txdesc.Width, txdesc.Height, filename); + write_log (_T("%s: mask %d*%d (%d*%d) ('%s') texture allocated\n"), D3DHEAD, masktexture_w, masktexture_h, txdesc.Width, txdesc.Height, filename); maskmult_x = (float)window_w / masktexture_w; maskmult_y = (float)window_h / masktexture_h; @@ -1578,7 +1578,7 @@ static void setupscenecoords (void) int resmult, vresmult; static RECT sr2, dr2, zr2; - //write_log (L"%dx%d %dx%d %dx%d\n", tin_w, tin_h, tin_w, tin_h, window_w, window_h); + //write_log (_T("%dx%d %dx%d %dx%d\n"), tin_w, tin_h, tin_w, tin_h, window_w, window_h); resmult = 1 << (gfxvidinfo.gfx_resolution_reserved - currprefs.gfx_resolution); vresmult = 1 << (gfxvidinfo.gfx_vresolution_reserved - currprefs.gfx_vresolution); @@ -1586,7 +1586,7 @@ static void setupscenecoords (void) getfilterrect2 (&dr, &sr, &zr, window_w, window_h, tin_w / (mult * resmult), tin_h / (mult * vresmult), mult, tin_w / resmult, tin_h / vresmult); if (memcmp (&sr, &sr2, sizeof RECT) || memcmp (&dr, &dr2, sizeof RECT) || memcmp (&zr, &zr2, sizeof RECT)) { - write_log (L"POS (%d %d %d %d) - (%d %d %d %d)[%d,%d] (%d %d)\n", + write_log (_T("POS (%d %d %d %d) - (%d %d %d %d)[%d,%d] (%d %d)\n"), dr.left, dr.top, dr.right, dr.bottom, sr.left, sr.top, sr.right, sr.bottom, sr.right - sr.left, sr.bottom - sr.top, zr.left, zr.top); @@ -1661,7 +1661,7 @@ static void setupscenecoords (void) cursor_offset_x = -zr.left; cursor_offset_y = -zr.top; - //write_log (L"%.1fx%.1f %.1fx%.1f %.1fx%.1f\n", dw, dh, w, h, sw, sh); + //write_log (_T("%.1fx%.1f %.1fx%.1f %.1fx%.1f\n"), dw, dh, w, h, sw, sh); // ratio between Amiga texture and overlay mask texture float sw2 = dw * tin_w / window_w; @@ -1706,7 +1706,7 @@ static void createvertex (void) sizex = 1.0f; sizey = 1.0f; if (FAILED (hr = vertexBuffer->Lock (0, 0, (void**)&vertices, 0))) { - write_log (L"%s: Vertexbuffer lock failed: %s\n", D3DHEAD, D3D_ErrorString (hr)); + write_log (_T("%s: Vertexbuffer lock failed: %s\n"), D3DHEAD, D3D_ErrorString (hr)); return; } memset (vertices, 0, sizeof (struct TLVERTEX) * NUMVERTICES); @@ -1737,7 +1737,7 @@ static void createvertex (void) vertices[7].diffuse = 0xFFFFFF00; vertices[7].texcoord.x = 1.0f; vertices[7].texcoord.y = 0.0f; if (FAILED(hr = vertexBuffer->Unlock ())) - write_log (L"%s: Vertexbuffer unlock failed: %s\n", D3DHEAD, D3D_ErrorString (hr)); + write_log (_T("%s: Vertexbuffer unlock failed: %s\n"), D3DHEAD, D3D_ErrorString (hr)); } static void settransform (void) @@ -1855,7 +1855,7 @@ static int restoredeviceobjects (void) invalidatedeviceobjects (); while (shaderon > 0) { - postEffect = psEffect_LoadEffect (psEnabled ? L"_winuae.fx" : L"_winuae_old.fx", false); + postEffect = psEffect_LoadEffect (psEnabled ? _T("_winuae.fx") : _T("_winuae_old.fx"), false); if (!postEffect) { shaderon = 0; break; @@ -1874,7 +1874,7 @@ static int restoredeviceobjects (void) break; } if (wasshader && !shaderon) - write_log (L"Falling back to non-shader mode\n"); + write_log (_T("Falling back to non-shader mode\n")); createmask2texture (currprefs.gfx_filteroverlay); @@ -1884,7 +1884,7 @@ static int restoredeviceobjects (void) hr = D3DXCreateSprite (d3ddev, &sprite); if (FAILED (hr)) { - write_log (L"%s: D3DXSprite failed: %s\n", D3DHEAD, D3D_ErrorString (hr)); + write_log (_T("%s: D3DXSprite failed: %s\n"), D3DHEAD, D3D_ErrorString (hr)); } int curw = CURSORMAXWIDTH, curh = CURSORMAXHEIGHT; @@ -1894,14 +1894,14 @@ static int restoredeviceobjects (void) vbsize = sizeof (struct TLVERTEX) * NUMVERTICES; if (FAILED (hr = d3ddev->CreateVertexBuffer (vbsize, D3DUSAGE_WRITEONLY, D3DFVF_TLVERTEX, D3DPOOL_DEFAULT, &vertexBuffer, NULL))) { - write_log (L"%s: failed to create vertex buffer: %s\n", D3DHEAD, D3D_ErrorString (hr)); + write_log (_T("%s: failed to create vertex buffer: %s\n"), D3DHEAD, D3D_ErrorString (hr)); return 0; } createvertex (); if (FAILED (hr = d3ddev->SetFVF (D3DFVF_TLVERTEX))) - write_log (L"%s: SetFVF failed: %s\n", D3DHEAD, D3D_ErrorString (hr)); + write_log (_T("%s: SetFVF failed: %s\n"), D3DHEAD, D3D_ErrorString (hr)); if (FAILED (hr = d3ddev->SetStreamSource (0, vertexBuffer, 0, sizeof (struct TLVERTEX)))) - write_log (L"%s: SetStreamSource failed: %s\n", D3DHEAD, D3D_ErrorString (hr)); + write_log (_T("%s: SetStreamSource failed: %s\n"), D3DHEAD, D3D_ErrorString (hr)); hr = d3ddev->SetRenderState (D3DRS_CULLMODE, D3DCULL_NONE); hr = d3ddev->SetRenderState (D3DRS_LIGHTING, FALSE); @@ -1959,7 +1959,7 @@ bool D3D_getvblankpos (int *vpos) else hr = d3ddev->GetRasterStatus (0, &rt); if (FAILED (hr)) { - write_log (L"%s: GetRasterStatus %s\n", D3DHEAD, D3D_ErrorString (hr)); + write_log (_T("%s: GetRasterStatus %s\n"), D3DHEAD, D3D_ErrorString (hr)); return false; } if (rt.ScanLine > maxscanline) @@ -1967,7 +1967,7 @@ bool D3D_getvblankpos (int *vpos) *vpos = rt.ScanLine; #if VBLANKDEBUG if (lastline != rt.ScanLine || lastinvblank != rt.InVBlank) { - write_log(L"%d:%d ", rt.InVBlank ? 1 : 0, rt.ScanLine); + write_log(_T("%d:%d "), rt.InVBlank ? 1 : 0, rt.ScanLine); lastline = rt.ScanLine; lastinvblank = rt.InVBlank; } @@ -2017,15 +2017,15 @@ const TCHAR *D3D_init (HWND ahwnd, int w_w, int w_h, int t_w, int t_h, int depth D3D_free2 (); if (!currprefs.gfx_api) { - _tcscpy (errmsg, L"D3D: not enabled"); + _tcscpy (errmsg, _T("D3D: not enabled")); return errmsg; } d3dx = LoadLibrary (D3DX9DLL); if (d3dx == NULL) { - _tcscpy (errmsg, L"Direct3D: Newer DirectX Runtime required.\n\nhttp://go.microsoft.com/fwlink/?linkid=56513"); + _tcscpy (errmsg, _T("Direct3D: Newer DirectX Runtime required.\n\nhttp://go.microsoft.com/fwlink/?linkid=56513")); if (isfullscreen () <= 0) - ShellExecute(NULL, L"open", L"http://go.microsoft.com/fwlink/?linkid=56513", NULL, NULL, SW_SHOWNORMAL); + ShellExecute(NULL, _T("open"), _T("http://go.microsoft.com/fwlink/?linkid=56513"), NULL, NULL, SW_SHOWNORMAL); return errmsg; } FreeLibrary (d3dx); @@ -2034,9 +2034,9 @@ const TCHAR *D3D_init (HWND ahwnd, int w_w, int w_h, int t_w, int t_h, int depth D3D_canshaders (); d3d_ex = FALSE; - d3dDLL = LoadLibrary (L"D3D9.DLL"); + d3dDLL = LoadLibrary (_T("D3D9.DLL")); if (d3dDLL == NULL) { - _tcscpy (errmsg, L"Direct3D: DirectX 9 or newer required"); + _tcscpy (errmsg, _T("Direct3D: DirectX 9 or newer required")); return errmsg; } else { d3dexp = (LPDIRECT3DCREATE9EX)GetProcAddress (d3dDLL, "Direct3DCreate9Ex"); @@ -2048,7 +2048,7 @@ const TCHAR *D3D_init (HWND ahwnd, int w_w, int w_h, int t_w, int t_h, int depth if (d3d_ex && D3DEX) { hr = d3dexp (D3D_SDK_VERSION, &d3dex); if (FAILED (hr)) - write_log (L"Direct3D: failed to create D3DEx object: %s\n", D3D_ErrorString (hr)); + write_log (_T("Direct3D: failed to create D3DEx object: %s\n"), D3D_ErrorString (hr)); d3d = (IDirect3D9*)d3dex; } if (FAILED (hr)) { @@ -2057,14 +2057,14 @@ const TCHAR *D3D_init (HWND ahwnd, int w_w, int w_h, int t_w, int t_h, int depth d3d = Direct3DCreate9 (D3D_SDK_VERSION); if (d3d == NULL) { D3D_free (); - _tcscpy (errmsg, L"Direct3D: failed to create D3D object"); + _tcscpy (errmsg, _T("Direct3D: failed to create D3D object")); return errmsg; } } if (d3d_ex) - D3DHEAD = L"D3D9Ex"; + D3DHEAD = _T("D3D9Ex"); else - D3DHEAD = L"D3D9"; + D3DHEAD = _T("D3D9"); adapter = getd3dadapter (d3d); @@ -2076,9 +2076,9 @@ const TCHAR *D3D_init (HWND ahwnd, int w_w, int w_h, int t_w, int t_h, int depth hr = d3dex->GetAdapterDisplayModeEx (adapter, &modeex, NULL); } if (FAILED (hr = d3d->GetAdapterDisplayMode (adapter, &mode))) - write_log (L"%s: GetAdapterDisplayMode failed %s\n", D3DHEAD, D3D_ErrorString (hr)); + write_log (_T("%s: GetAdapterDisplayMode failed %s\n"), D3DHEAD, D3D_ErrorString (hr)); if (FAILED (hr = d3d->GetDeviceCaps (adapter, D3DDEVTYPE_HAL, &d3dCaps))) - write_log (L"%s: GetDeviceCaps failed %s\n", D3DHEAD, D3D_ErrorString (hr)); + write_log (_T("%s: GetDeviceCaps failed %s\n"), D3DHEAD, D3D_ErrorString (hr)); memset (&dpp, 0, sizeof (dpp)); dpp.Windowed = isfullscreen () <= 0; @@ -2164,10 +2164,10 @@ const TCHAR *D3D_init (HWND ahwnd, int w_w, int w_h, int t_w, int t_h, int depth } if (FAILED (ret)) { - _stprintf (errmsg, L"%s failed, %s\n", d3d_ex && D3DEX ? L"CreateDeviceEx" : L"CreateDevice", D3D_ErrorString (ret)); + _stprintf (errmsg, _T("%s failed, %s\n"), d3d_ex && D3DEX ? _T("CreateDeviceEx") : _T("CreateDevice"), D3D_ErrorString (ret)); if (ret == D3DERR_INVALIDCALL && dpp.Windowed == 0 && dpp.FullScreen_RefreshRateInHz && !ddraw_fs) { - write_log (L"%s\n", errmsg); - write_log (L"%s: Retrying fullscreen with DirectDraw\n", D3DHEAD); + write_log (_T("%s\n"), errmsg); + write_log (_T("%s: Retrying fullscreen with DirectDraw\n"), D3DHEAD); if (ddraw_fs_hack_init ()) { const TCHAR *err2 = D3D_init (ahwnd, w_w, w_h, t_w, t_h, depth, mult); if (err2) @@ -2176,7 +2176,7 @@ const TCHAR *D3D_init (HWND ahwnd, int w_w, int w_h, int t_w, int t_h, int depth } } if (d3d_ex && D3DEX) { - write_log (L"%s\n", errmsg); + write_log (_T("%s\n"), errmsg); D3DEX = 0; return D3D_init (ahwnd, w_w, w_h, t_w, t_h, depth, mult); } @@ -2192,38 +2192,38 @@ const TCHAR *D3D_init (HWND ahwnd, int w_w, int w_h, int t_w, int t_h, int depth max_texture_w = d3dCaps.MaxTextureWidth; max_texture_h = d3dCaps.MaxTextureHeight; - write_log (L"%s: %08X ", D3DHEAD, flags); + write_log (_T("%s: %08X "), D3DHEAD, flags); if (d3dCaps.TextureCaps & D3DPTEXTURECAPS_SQUAREONLY) - write_log (L"SQUAREONLY "); + write_log (_T("SQUAREONLY ")); if (d3dCaps.TextureCaps & D3DPTEXTURECAPS_POW2) - write_log (L"POW2 "); + write_log (_T("POW2 ")); if (d3dCaps.TextureCaps & D3DPTEXTURECAPS_NONPOW2CONDITIONAL) - write_log (L"NPOTCONDITIONAL "); + write_log (_T("NPOTCONDITIONAL ")); if (d3dCaps.TextureCaps & D3DPTEXTURECAPS_ALPHA) - write_log (L"ALPHA "); + write_log (_T("ALPHA ")); if (d3dCaps.Caps2 & D3DCAPS2_DYNAMICTEXTURES) - write_log (L"DYNAMIC "); - write_log (L"\n"); + write_log (_T("DYNAMIC ")); + write_log (_T("\n")); - write_log (L"%s: PS=%d.%d VS=%d.%d %d*%d*%d%s VS=%d B=%d%s %d-bit %d\n", + write_log (_T("%s: PS=%d.%d VS=%d.%d %d*%d*%d%s VS=%d B=%d%s %d-bit %d\n"), D3DHEAD, (d3dCaps.PixelShaderVersion >> 8) & 0xff, d3dCaps.PixelShaderVersion & 0xff, (d3dCaps.VertexShaderVersion >> 8) & 0xff, d3dCaps.VertexShaderVersion & 0xff, max_texture_w, max_texture_h, dpp.FullScreen_RefreshRateInHz, - dpp.Windowed ? L"" : L" FS", + dpp.Windowed ? _T("") : _T(" FS"), vsync, ap->gfx_backbuffers, - ap->gfx_vflip < 0 ? L"WE" : (ap->gfx_vflip > 0 ? L"WS" : L"I"), + ap->gfx_vflip < 0 ? _T("WE") : (ap->gfx_vflip > 0 ? _T("WS") : _T("I")), t_depth, adapter ); if ((d3dCaps.PixelShaderVersion < D3DPS_VERSION(2,0) || !psEnabled || max_texture_w < 2048 || max_texture_h < 2048 || !shaderon) && d3d_ex) { D3DEX = 0; - write_log (L"Disabling D3D9Ex\n"); + write_log (_T("Disabling D3D9Ex\n")); return D3D_init (ahwnd, w_w, w_h, t_w, t_h, depth, mult); } if (!shaderon) - write_log (L"Using non-shader version\n"); + write_log (_T("Using non-shader version\n")); window_w = w_w; window_h = w_h; @@ -2235,7 +2235,7 @@ const TCHAR *D3D_init (HWND ahwnd, int w_w, int w_h, int t_w, int t_h, int depth tout_h = tin_h * multx; if (max_texture_w < w_w || max_texture_h < w_h) { - _stprintf (errmsg, L"%s: %d * %d or bigger texture support required\nYour card's maximum texture size is only %d * %d", + _stprintf (errmsg, _T("%s: %d * %d or bigger texture support required\nYour card's maximum texture size is only %d * %d"), D3DHEAD, t_w, t_h, max_texture_w, max_texture_h); return errmsg; } @@ -2245,15 +2245,15 @@ const TCHAR *D3D_init (HWND ahwnd, int w_w, int w_h, int t_w, int t_h, int depth required_sl_texture_w = w_w; required_sl_texture_h = w_h; if (currprefs.gfx_filter_scanlines > 0 && (max_texture_w < w_w || max_texture_h < w_h)) { - gui_message (L"%s: %d * %d or bigger texture support required for scanlines (max is only %d * %d)\n", - D3DHEAD, L"Scanlines disabled.", + gui_message (_T("%s: %d * %d or bigger texture support required for scanlines (max is only %d * %d)\n"), + D3DHEAD, _T("Scanlines disabled."), required_sl_texture_w, required_sl_texture_h, max_texture_w, max_texture_h); changed_prefs.gfx_filter_scanlines = currprefs.gfx_filter_scanlines = 0; } hr = d3ddev->GetSwapChain (0, &d3dswapchain); if (FAILED (hr)) { - write_log (L"%s: GetSwapChain() failed, %s\n", D3DHEAD, D3D_ErrorString (hr)); + write_log (_T("%s: GetSwapChain() failed, %s\n"), D3DHEAD, D3D_ErrorString (hr)); } switch (depth) @@ -2274,7 +2274,7 @@ const TCHAR *D3D_init (HWND ahwnd, int w_w, int w_h, int t_w, int t_h, int depth if (!restoredeviceobjects ()) { D3D_free (); - _stprintf (errmsg, L"%s: initialization failed.", D3DHEAD); + _stprintf (errmsg, _T("%s: initialization failed."), D3DHEAD); return errmsg; } maxscanline = 0; @@ -2284,12 +2284,12 @@ const TCHAR *D3D_init (HWND ahwnd, int w_w, int w_h, int t_w, int t_h, int depth if (vsync < 0 && ap->gfx_vflip == 0) { hr = d3ddev->CreateQuery(D3DQUERYTYPE_EVENT, &query); if (FAILED (hr)) - write_log (L"%s: CreateQuery(D3DQUERYTYPE_EVENT) failed: %s\n", D3DHEAD, D3D_ErrorString (hr)); + write_log (_T("%s: CreateQuery(D3DQUERYTYPE_EVENT) failed: %s\n"), D3DHEAD, D3D_ErrorString (hr)); } if (d3ddevex) { hr = d3ddevex->SetMaximumFrameLatency (vsync < 0 && ap->gfx_vflip <= 0 ? 1 : 0); if (FAILED (hr)) - write_log (L"%s: SetMaximumFrameLatency() failed: %s\n", D3DHEAD, D3D_ErrorString (hr)); + write_log (_T("%s: SetMaximumFrameLatency() failed: %s\n"), D3DHEAD, D3D_ErrorString (hr)); } return 0; @@ -2317,29 +2317,29 @@ int D3D_needreset (void) if (hr == S_PRESENT_OCCLUDED) return 0; if (hr == D3DERR_DEVICENOTRESET) { - write_log (L"%s: DEVICENOTRESET\n", D3DHEAD); + write_log (_T("%s: DEVICENOTRESET\n"), D3DHEAD); devicelost = 2; invalidatedeviceobjects (); hr = reset (); if (FAILED (hr)) { - write_log (L"%s: Reset failed %s\n", D3DHEAD, D3D_ErrorString (hr)); + write_log (_T("%s: Reset failed %s\n"), D3DHEAD, D3D_ErrorString (hr)); resetcount++; if (resetcount > 2 || hr == D3DERR_DEVICEHUNG) { changed_prefs.gfx_api = 0; - write_log (L"%s: Too many failed resets, disabling Direct3D mode\n", D3DHEAD); + write_log (_T("%s: Too many failed resets, disabling Direct3D mode\n"), D3DHEAD); } return 1; } devicelost = 0; - write_log (L"%s: Reset succeeded\n", D3DHEAD); + write_log (_T("%s: Reset succeeded\n"), D3DHEAD); restoredeviceobjects (); return -1; } else if (hr == D3DERR_DEVICELOST) { - write_log (L"%s: D3DERR_DEVICELOST\n", D3DHEAD); + write_log (_T("%s: D3DERR_DEVICELOST\n"), D3DHEAD); invalidatedeviceobjects (); return 0; } else if (hr == S_PRESENT_MODE_CHANGED) { - write_log (L"%s: S_PRESENT_MODE_CHANGED (%d,%d)\n", D3DHEAD, ddraw_fs, ddraw_fs_attempt); + write_log (_T("%s: S_PRESENT_MODE_CHANGED (%d,%d)\n"), D3DHEAD, ddraw_fs, ddraw_fs_attempt); #if 0 if (!ddraw_fs) { ddraw_fs_attempt++; @@ -2353,16 +2353,16 @@ int D3D_needreset (void) devicelost = 0; invalidatedeviceobjects (); if (do_dd) { - write_log (L"%s: S_PRESENT_MODE_CHANGED, Retrying fullscreen with DirectDraw\n", D3DHEAD); + write_log (_T("%s: S_PRESENT_MODE_CHANGED, Retrying fullscreen with DirectDraw\n"), D3DHEAD); ddraw_fs_hack_init (); } hr = reset (); if (FAILED (hr)) - write_log (L"%s: Reset failed %s\n", D3DHEAD, D3D_ErrorString (hr)); + write_log (_T("%s: Reset failed %s\n"), D3DHEAD, D3D_ErrorString (hr)); restoredeviceobjects (); return -1; } - write_log (L"%s: TestCooperativeLevel %s\n", D3DHEAD, D3D_ErrorString (hr)); + write_log (_T("%s: TestCooperativeLevel %s\n"), D3DHEAD, D3D_ErrorString (hr)); return 0; } @@ -2393,7 +2393,7 @@ static void D3D_showframe2 (bool dowait) //devicelost = 1; ; } else if (FAILED (hr)) { - write_log (L"%s: Present() %s\n", D3DHEAD, D3D_ErrorString (hr)); + write_log (_T("%s: Present() %s\n"), D3DHEAD, D3D_ErrorString (hr)); if (hr == D3DERR_DEVICELOST || hr == S_PRESENT_MODE_CHANGED) { devicelost = 1; } @@ -2429,7 +2429,7 @@ static void D3D_render2 (void) hr = d3ddev->Clear (0, NULL, D3DCLEAR_TARGET, D3DCOLOR_XRGB(0, d3ddebug ? 0x80 : 0, 0), 0, 0); if (FAILED (hr = d3ddev->BeginScene ())) { - write_log (L"%s: BeginScene: %s\n", D3DHEAD, D3D_ErrorString (hr)); + write_log (_T("%s: BeginScene: %s\n"), D3DHEAD, D3D_ErrorString (hr)); return; } if (shaderon > 0 && postEffect) { @@ -2446,21 +2446,21 @@ static void D3D_render2 (void) return; if (FAILED (hr = d3ddev->GetRenderTarget (0, &lpRenderTarget))) - write_log (L"%s: GetRenderTarget: %s\n", D3DHEAD, D3D_ErrorString (hr)); + write_log (_T("%s: GetRenderTarget: %s\n"), D3DHEAD, D3D_ErrorString (hr)); lpWorkTexture = lpWorkTexture1; lpNewRenderTarget = NULL; pass2: if (FAILED (hr = lpWorkTexture->GetSurfaceLevel (0, &lpNewRenderTarget))) - write_log (L"%s: GetSurfaceLevel: %s\n", D3DHEAD, D3D_ErrorString (hr)); + write_log (_T("%s: GetSurfaceLevel: %s\n"), D3DHEAD, D3D_ErrorString (hr)); if (FAILED (hr = d3ddev->SetRenderTarget (0, lpNewRenderTarget))) - write_log (L"%s: SetRenderTarget: %s\n", D3DHEAD, D3D_ErrorString (hr)); + write_log (_T("%s: SetRenderTarget: %s\n"), D3DHEAD, D3D_ErrorString (hr)); uPasses = 0; if (psEffect_Begin (pEffect, (lpWorkTexture == lpWorkTexture1) ? psEffect_PreProcess1 : psEffect_PreProcess2, &uPasses)) { for (uPass = 0; uPass < uPasses; uPass++) { if (psEffect_BeginPass (pEffect, uPass)) { if (FAILED (hr = d3ddev->DrawPrimitive (D3DPT_TRIANGLESTRIP, 4, 2))) { - write_log (L"%s: Effect DrawPrimitive failed: %s\n", D3DHEAD, D3D_ErrorString (hr)); + write_log (_T("%s: Effect DrawPrimitive failed: %s\n"), D3DHEAD, D3D_ErrorString (hr)); } psEffect_EndPass (pEffect); } @@ -2468,7 +2468,7 @@ static void D3D_render2 (void) psEffect_End (pEffect); } if (FAILED (hr = d3ddev->SetRenderTarget (0, lpRenderTarget))) - write_log (L"%s: Effect RenderTarget reset failed: %s\n", D3DHEAD, D3D_ErrorString (hr)); + write_log (_T("%s: Effect RenderTarget reset failed: %s\n"), D3DHEAD, D3D_ErrorString (hr)); lpNewRenderTarget->Release (); lpNewRenderTarget = NULL; if (psEffect_hasPreProcess2 () && lpWorkTexture == lpWorkTexture1) { @@ -2482,11 +2482,11 @@ static void D3D_render2 (void) #if TWOPASS if (FAILED (hr = d3ddev->GetRenderTarget (0, &lpRenderTarget))) - write_log (L"%s: GetRenderTarget: %s\n", D3DHEAD, D3D_ErrorString (hr)); + write_log (_T("%s: GetRenderTarget: %s\n"), D3DHEAD, D3D_ErrorString (hr)); if (FAILED (hr = lpTempTexture->GetSurfaceLevel (0, &lpNewRenderTarget))) - write_log (L"%s: GetSurfaceLevel: %s\n", D3DHEAD, D3D_ErrorString (hr)); + write_log (_T("%s: GetSurfaceLevel: %s\n"), D3DHEAD, D3D_ErrorString (hr)); if (FAILED (hr = d3ddev->SetRenderTarget (0, lpNewRenderTarget))) - write_log (L"%s: SetRenderTarget: %s\n", D3DHEAD, D3D_ErrorString (hr)); + write_log (_T("%s: SetRenderTarget: %s\n"), D3DHEAD, D3D_ErrorString (hr)); #endif hr = d3ddev->Clear (0, NULL, D3DCLEAR_TARGET, D3DCOLOR_XRGB(0, 0, d3ddebug ? 0x80 : 0), 0, 0); @@ -2496,14 +2496,14 @@ static void D3D_render2 (void) if (!psEffect_BeginPass (pEffect, uPass)) return; if (FAILED (hr = d3ddev->DrawPrimitive (D3DPT_TRIANGLESTRIP, 0, 2))) - write_log (L"%s: Effect2 DrawPrimitive failed: %s\n", D3DHEAD, D3D_ErrorString (hr)); + write_log (_T("%s: Effect2 DrawPrimitive failed: %s\n"), D3DHEAD, D3D_ErrorString (hr)); psEffect_EndPass (pEffect); } psEffect_End (pEffect); } #if TWOPASS if (FAILED (hr = d3ddev->SetRenderTarget (0, lpRenderTarget))) - write_log (L"%s: SetRenderTarget: %s\n", D3DHEAD, D3D_ErrorString (hr)); + write_log (_T("%s: SetRenderTarget: %s\n"), D3DHEAD, D3D_ErrorString (hr)); lpNewRenderTarget->Release (); lpRenderTarget->Release (); #endif @@ -2517,22 +2517,22 @@ static void D3D_render2 (void) if (masktexture) { if (FAILED (hr = postEffect->SetTechnique (postTechnique))) - write_log (L"%s: SetTechnique(postTechnique) failed: %s\n", D3DHEAD, D3D_ErrorString (hr)); + write_log (_T("%s: SetTechnique(postTechnique) failed: %s\n"), D3DHEAD, D3D_ErrorString (hr)); if (FAILED (hr = postEffect->SetTexture (postMaskTextureHandle, masktexture))) - write_log (L"%s: SetTexture(masktexture) failed: %s\n", D3DHEAD, D3D_ErrorString (hr)); + write_log (_T("%s: SetTexture(masktexture) failed: %s\n"), D3DHEAD, D3D_ErrorString (hr)); } else if (sltexture) { if (FAILED (hr = postEffect->SetTechnique (postTechniqueAlpha))) - write_log (L"%s: SetTechnique(postTechniqueAlpha) failed: %s\n", D3DHEAD, D3D_ErrorString (hr)); + write_log (_T("%s: SetTechnique(postTechniqueAlpha) failed: %s\n"), D3DHEAD, D3D_ErrorString (hr)); if (FAILED (hr = postEffect->SetTexture (postMaskTextureHandle, sltexture))) - write_log (L"%s: SetTexture(sltexture) failed: %s\n", D3DHEAD, D3D_ErrorString (hr)); + write_log (_T("%s: SetTexture(sltexture) failed: %s\n"), D3DHEAD, D3D_ErrorString (hr)); } else { if (FAILED (hr = postEffect->SetTechnique (postTechniquePlain))) - write_log (L"%s: SetTechnique(postTechniquePlain) failed: %s\n", D3DHEAD, D3D_ErrorString (hr)); + write_log (_T("%s: SetTechnique(postTechniquePlain) failed: %s\n"), D3DHEAD, D3D_ErrorString (hr)); } hr = postEffect->SetInt (postFilterMode, currprefs.gfx_filter_bilinear ? D3DTEXF_LINEAR : D3DTEXF_POINT); if (FAILED (hr = postEffect->SetTexture (postSourceTextureHandle, srctex))) - write_log (L"%s: SetTexture(srctex) failed: %s\n", D3DHEAD, D3D_ErrorString (hr)); + write_log (_T("%s: SetTexture(srctex) failed: %s\n"), D3DHEAD, D3D_ErrorString (hr)); setupscenecoords (); hr = postEffect->SetMatrix (postMatrixSource, &postproj); hr = postEffect->SetVector (postMaskMult, &maskmult); @@ -2544,7 +2544,7 @@ static void D3D_render2 (void) for (uPass = 0; uPass < uPasses; uPass++) { if (psEffect_BeginPass (postEffect, uPass)) { if (FAILED (hr = d3ddev->DrawPrimitive (D3DPT_TRIANGLESTRIP, 0, 2))) - write_log (L"%s: Post DrawPrimitive failed: %s\n", D3DHEAD, D3D_ErrorString (hr)); + write_log (_T("%s: Post DrawPrimitive failed: %s\n"), D3DHEAD, D3D_ErrorString (hr)); psEffect_EndPass (postEffect); } } @@ -2685,7 +2685,7 @@ static void D3D_render2 (void) hr = d3ddev->EndScene (); if (FAILED (hr)) - write_log (L"%s: EndScene() %s\n", D3DHEAD, D3D_ErrorString (hr)); + write_log (_T("%s: EndScene() %s\n"), D3DHEAD, D3D_ErrorString (hr)); } void D3D_setcursor (int x, int y, int width, int height, bool visible) @@ -2731,8 +2731,8 @@ void D3D_flushtexture (int miny, int maxy) if (r.top <= r.bottom) { HRESULT hr = texture->AddDirtyRect (&r); if (FAILED (hr)) - write_log (L"%s: AddDirtyRect(): %s\n", D3DHEAD, D3D_ErrorString (hr)); - //write_log (L"%d %d\n", r.top, r.bottom); + write_log (_T("%s: AddDirtyRect(): %s\n"), D3DHEAD, D3D_ErrorString (hr)); + //write_log (_T("%d %d\n"), r.top, r.bottom); } } } @@ -2751,11 +2751,11 @@ uae_u8 *D3D_locktexture (int *pitch, bool fullupdate) lock.Pitch = 0; hr = texture->LockRect (0, &lock, NULL, fullupdate ? D3DLOCK_DISCARD : D3DLOCK_NO_DIRTY_UPDATE); if (FAILED (hr)) { - write_log (L"%s: LockRect failed: %s\n", D3DHEAD, D3D_ErrorString (hr)); + write_log (_T("%s: LockRect failed: %s\n"), D3DHEAD, D3D_ErrorString (hr)); return NULL; } if (lock.pBits == NULL || lock.Pitch == 0) { - write_log (L"%s: LockRect returned NULL texture\n", D3DHEAD); + write_log (_T("%s: LockRect returned NULL texture\n"), D3DHEAD); D3D_unlocktexture (); return NULL; } @@ -2778,7 +2778,7 @@ static void flushgpu (bool wait) static int reported; if (reported < 10) { reported++; - write_log (L"%s: query->Issue (D3DISSUE_END) failed: %s\n", D3DHEAD, D3D_ErrorString (hr)); + write_log (_T("%s: query->Issue (D3DISSUE_END) failed: %s\n"), D3DHEAD, D3D_ErrorString (hr)); } } } @@ -2795,7 +2795,7 @@ bool D3D_renderframe (void) while (WaitForSingleObject (filenotificationhandle, 0) == WAIT_OBJECT_0) { FindNextChangeNotification (filenotificationhandle); devicelost = 2; - write_log (L"%s: Shader file modification notification\n", D3DHEAD); + write_log (_T("%s: Shader file modification notification\n"), D3DHEAD); } } @@ -2900,7 +2900,7 @@ void D3D_guimode (bool guion) return; hr = d3ddev->SetDialogBoxMode (guion ? TRUE : FALSE); if (FAILED (hr)) - write_log (L"%s: SetDialogBoxMode %s\n", D3DHEAD, D3D_ErrorString (hr)); + write_log (_T("%s: SetDialogBoxMode %s\n"), D3DHEAD, D3D_ErrorString (hr)); guimode = guion; } @@ -2914,13 +2914,13 @@ HDC D3D_getDC (HDC hdc) if (!hdc) { hr = d3ddev->GetBackBuffer (0, 0, D3DBACKBUFFER_TYPE_MONO, &bb); if (FAILED (hr)) { - write_log (L"%s: GetBackBuffer() failed: %s\n", D3DHEAD, D3D_ErrorString (hr)); + write_log (_T("%s: GetBackBuffer() failed: %s\n"), D3DHEAD, D3D_ErrorString (hr)); return 0; } hr = bb->GetDC (&hdc); if (SUCCEEDED (hr)) return hdc; - write_log (L"%s: GetDC() failed: %s\n", D3DHEAD, D3D_ErrorString (hr)); + write_log (_T("%s: GetDC() failed: %s\n"), D3DHEAD, D3D_ErrorString (hr)); } if (hdc) bb->ReleaseDC (hdc); diff --git a/od-win32/driveclick_win32.cpp b/od-win32/driveclick_win32.cpp index 1b8105f5..5b8050f8 100644 --- a/od-win32/driveclick_win32.cpp +++ b/od-win32/driveclick_win32.cpp @@ -127,7 +127,7 @@ static int driveclick_fdrawcmd_init(int drive) return 1; thread_ok = 1; init_comm_pipe (dc_pipe, DC_PIPE_SIZE, 3); - uae_start_thread (L"fdrawcmd_win32", driveclick_thread, NULL, NULL); + uae_start_thread (_T("fdrawcmd_win32"), driveclick_thread, NULL, NULL); return 1; } @@ -144,7 +144,7 @@ static int driveclick_fdrawcmd_open_2(int drive) TCHAR s[32]; driveclick_fdrawcmd_close(drive); - _stprintf (s, L"\\\\.\\fdraw%d", drive); + _stprintf (s, _T("\\\\.\\fdraw%d"), drive); h[drive] = CreateFile(s, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL); if (h[drive] == INVALID_HANDLE_VALUE) return 0; diff --git a/od-win32/dxwrap.cpp b/od-win32/dxwrap.cpp index a212eb12..0a115f37 100644 --- a/od-win32/dxwrap.cpp +++ b/od-win32/dxwrap.cpp @@ -26,7 +26,7 @@ HRESULT DirectDraw_GetDisplayMode (void) dxdata.native.dwSize = sizeof (DDSURFACEDESC2); ddrval = IDirectDraw7_GetDisplayMode (dxdata.maindd, &dxdata.native); if (FAILED (ddrval)) - write_log (L"IDirectDraw7_GetDisplayMode: %s\n", DXError (ddrval)); + write_log (_T("IDirectDraw7_GetDisplayMode: %s\n"), DXError (ddrval)); return ddrval; } @@ -79,7 +79,7 @@ HRESULT restoresurface (LPDIRECTDRAWSURFACE7 surf) return ddrval; ddrval = IDirectDrawSurface7_Restore (surf); if (FAILED (ddrval)) { - write_log (L"IDirectDrawSurface7_Restore: %s\n", DXError (ddrval)); + write_log (_T("IDirectDrawSurface7_Restore: %s\n"), DXError (ddrval)); } return ddrval; } @@ -138,7 +138,7 @@ int locksurface (LPDIRECTDRAWSURFACE7 surf, LPDDSURFACEDESC2 desc) } else if (ddrval != DDERR_SURFACEBUSY) { if (cnt > 0) { cnt--; - write_log (L"locksurface %d: %s\n", cnt, DXError (ddrval)); + write_log (_T("locksurface %d: %s\n"), cnt, DXError (ddrval)); } return 0; } @@ -151,7 +151,7 @@ void unlocksurface (LPDIRECTDRAWSURFACE7 surf) ddrval = IDirectDrawSurface7_Unlock (surf, NULL); if (FAILED (ddrval)) - write_log (L"IDirectDrawSurface7_Unlock: %s\n", DXError (ddrval)); + write_log (_T("IDirectDrawSurface7_Unlock: %s\n"), DXError (ddrval)); } static void setsurfacecap (DDSURFACEDESC2 *desc, int w, int h, int mode) @@ -172,7 +172,7 @@ STATIC_INLINE uae_u16 rgb32torgb16pc (uae_u32 rgb) return (((rgb >> (16 + 3)) & 0x1f) << 11) | (((rgb >> (8 + 2)) & 0x3f) << 5) | (((rgb >> (0 + 3)) & 0x1f) << 0); } -static TCHAR *alloctexts[] = { L"NonLocalVRAM", L"DefaultRAM", L"VRAM", L"RAM" }; +static TCHAR *alloctexts[] = { _T("NonLocalVRAM"), _T("DefaultRAM"), _T("VRAM"), _T("RAM") }; static LPDIRECTDRAWSURFACE7 allocsurface_3 (int width, int height, uae_u8 *ptr, int pitch, int ck, int forcemode) { HRESULT ddrval; @@ -206,10 +206,10 @@ static LPDIRECTDRAWSURFACE7 allocsurface_3 (int width, int height, uae_u8 *ptr, } ddrval = IDirectDraw7_CreateSurface (dxdata.maindd, &desc, &surf, NULL); if (FAILED (ddrval)) { - write_log (L"IDirectDraw7_CreateSurface (%dx%d,%s): %s\n", width, height, alloctexts[forcemode], DXError (ddrval)); + write_log (_T("IDirectDraw7_CreateSurface (%dx%d,%s): %s\n"), width, height, alloctexts[forcemode], DXError (ddrval)); } else { - write_log (L"Created %dx%dx%d (%p) surface in %s (%d)%s\n", width, height, desc.ddpfPixelFormat.dwRGBBitCount, surf, - alloctexts[forcemode], forcemode, ck ? (dxcaps.cancolorkey ? L" hardware colorkey" : L" software colorkey") : L""); + write_log (_T("Created %dx%dx%d (%p) surface in %s (%d)%s\n"), width, height, desc.ddpfPixelFormat.dwRGBBitCount, surf, + alloctexts[forcemode], forcemode, ck ? (dxcaps.cancolorkey ? _T(" hardware colorkey") : _T(" software colorkey")) : _T("")); } return surf; } @@ -313,7 +313,7 @@ int dx_testck (void) clearsurface (cksurf); clearsurface (tmp); if (failed) { - write_log (L"Color key test failure, display driver bug, falling back to software emulation.\n"); + write_log (_T("Color key test failure, display driver bug, falling back to software emulation.\n")); dxcaps.cancolorkey = 0; releaser (dxdata.cursorsurface1, IDirectDrawSurface7_Release); dxdata.cursorsurface1 = allocsurface_2 (dxcaps.cursorwidth, dxcaps.cursorheight, TRUE); @@ -364,7 +364,7 @@ HRESULT DirectDraw_CreateMainSurface (int width, int height) } } if (FAILED (ddrval)) - write_log (L"IDirectDrawSurface7_GetAttachedSurface: %s\n", DXError (ddrval)); + write_log (_T("IDirectDrawSurface7_GetAttachedSurface: %s\n"), DXError (ddrval)); ok = 1; } } @@ -378,13 +378,13 @@ HRESULT DirectDraw_CreateMainSurface (int width, int height) ddrval = IDirectDraw7_CreateSurface (dxdata.maindd, &desc, &dxdata.primary, NULL); } if (FAILED (ddrval)) { - write_log (L"IDirectDraw7_CreateSurface: %s\n", DXError (ddrval)); + write_log (_T("IDirectDraw7_CreateSurface: %s\n"), DXError (ddrval)); return ddrval; } dxdata.native.dwSize = sizeof (DDSURFACEDESC2); ddrval = IDirectDrawSurface7_GetSurfaceDesc (dxdata.primary, &dxdata.native); if (FAILED (ddrval)) - write_log (L"IDirectDrawSurface7_GetSurfaceDesc: %s\n", DXError (ddrval)); + write_log (_T("IDirectDrawSurface7_GetSurfaceDesc: %s\n"), DXError (ddrval)); if (dxdata.fsmodeset) { clearsurf (dxdata.primary, 0); dxdata.fsmodeset = 1; @@ -402,15 +402,15 @@ HRESULT DirectDraw_CreateMainSurface (int width, int height) dxdata.pitch = desc.lPitch; unlocksurface (surf); } else { - write_log (L"Couldn't get surface pitch!\n"); + write_log (_T("Couldn't get surface pitch!\n")); } createstatussurface (); } else { ddrval = DD_FALSE; } - write_log (L"DDRAW: %dx%d B=%d%s %d-bit\n", + write_log (_T("DDRAW: %dx%d B=%d%s %d-bit\n"), width, height, - ap->gfx_backbuffers, ap->gfx_vflip < 0 ? L"WE" : (ap->gfx_vflip > 0 ? L"WS" : L"I"), + ap->gfx_backbuffers, ap->gfx_vflip < 0 ? _T("WE") : (ap->gfx_vflip > 0 ? _T("WS") : _T("I")), dxdata.native.ddpfPixelFormat.dwRGBBitCount ); return ddrval; @@ -428,7 +428,7 @@ HRESULT DirectDraw_SetDisplayMode (int width, int height, int bits, int freq) dxdata.vblank_skip_cnt = 0; ddrval = IDirectDraw7_SetDisplayMode (dxdata.maindd, width, height, bits, freq, 0); if (FAILED (ddrval)) { - write_log (L"IDirectDraw7_SetDisplayMode: %s\n", DXError (ddrval)); + write_log (_T("IDirectDraw7_SetDisplayMode: %s\n"), DXError (ddrval)); IDirectDraw7_RestoreDisplayMode (dxdata.maindd); dxdata.fsmodeset = 0; } else { @@ -450,11 +450,11 @@ HRESULT DirectDraw_SetCooperativeLevel (HWND window, int fullscreen, int doset) ddrval = IDirectDraw7_SetCooperativeLevel (dxdata.maindd, window, fullscreen ? DDSCL_ALLOWREBOOT | DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN : DDSCL_NORMAL); if (FAILED (ddrval)) - write_log (L"IDirectDraw7_SetCooperativeLevel: SET %s\n", DXError (ddrval)); + write_log (_T("IDirectDraw7_SetCooperativeLevel: SET %s\n"), DXError (ddrval)); } else { ddrval = IDirectDraw7_SetCooperativeLevel (dxdata.maindd, dxdata.hwnd, DDSCL_NORMAL); if (FAILED (ddrval)) - write_log (L"IDirectDraw7_SetCooperativeLevel: RESET %s\n", DXError (ddrval)); + write_log (_T("IDirectDraw7_SetCooperativeLevel: RESET %s\n"), DXError (ddrval)); } return ddrval; } @@ -465,7 +465,7 @@ HRESULT DirectDraw_CreateClipper (void) ddrval = IDirectDraw7_CreateClipper (dxdata.maindd, 0, &dxdata.dclip, NULL); if (FAILED (ddrval)) - write_log (L"IDirectDraw7_CreateClipper: %s\n", DXError (ddrval)); + write_log (_T("IDirectDraw7_CreateClipper: %s\n"), DXError (ddrval)); return ddrval; } @@ -477,11 +477,11 @@ HRESULT DirectDraw_SetClipper (HWND hWnd) return DD_FALSE; ddrval = IDirectDrawSurface7_SetClipper (dxdata.primary, hWnd ? dxdata.dclip : NULL); if (FAILED (ddrval)) - write_log (L"IDirectDrawSurface7_SetClipper: %s\n", DXError (ddrval)); + write_log (_T("IDirectDrawSurface7_SetClipper: %s\n"), DXError (ddrval)); if(hWnd && SUCCEEDED (ddrval)) { ddrval = IDirectDrawClipper_SetHWnd (dxdata.dclip, 0, hWnd); if (FAILED (ddrval)) - write_log (L"IDirectDrawClipper_SetHWnd: %s\n", DXError (ddrval)); + write_log (_T("IDirectDrawClipper_SetHWnd: %s\n"), DXError (ddrval)); } return ddrval; } @@ -491,8 +491,8 @@ TCHAR *outGUID (const GUID *guid) { static TCHAR gb[64]; if (guid == NULL) - return L"NULL"; - _stprintf (gb, L"{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}", + return _T("NULL"); + _stprintf (gb, _T("{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}"), guid->Data1, guid->Data2, guid->Data3, guid->Data4[0], guid->Data4[1], guid->Data4[2], guid->Data4[3], guid->Data4[4], guid->Data4[5], guid->Data4[6], guid->Data4[7]); @@ -502,7 +502,7 @@ TCHAR *outGUID (const GUID *guid) const TCHAR *DXError (HRESULT ddrval) { static TCHAR dderr[1000]; - _stprintf (dderr, L"%08X S=%d F=%04X C=%04X (%d) (%s)", + _stprintf (dderr, _T("%08X S=%d F=%04X C=%04X (%d) (%s)"), ddrval, (ddrval & 0x80000000) ? 1 : 0, HRESULT_FACILITY(ddrval), HRESULT_CODE(ddrval), @@ -567,7 +567,7 @@ RGBFTYPE DirectDraw_GetSurfacePixelFormat (LPDDSURFACEDESC2 surface) break; default: - write_log (L"Unknown %d bit format %d %d %d\n", pfp->dwRGBBitCount, r, g, b); + write_log (_T("Unknown %d bit format %d %d %d\n"), pfp->dwRGBBitCount, r, g, b); break; } return RGBFB_NONE; @@ -622,7 +622,7 @@ int DirectDraw_SurfaceLock (void) void DirectDraw_SurfaceUnlock (void) { if (dxdata.lockcnt < 0) - write_log (L"DirectDraw_SurfaceUnlock negative lock count %d!\n", dxdata.lockcnt); + write_log (_T("DirectDraw_SurfaceUnlock negative lock count %d!\n"), dxdata.lockcnt); if (dxdata.lockcnt == 0) return; dxdata.lockcnt--; @@ -728,11 +728,11 @@ int DirectDraw_BlitToPrimaryScale (RECT *dstrect, RECT *srcrect) if (FAILED (ddrval)) return 0; } else if (ddrval != DDERR_SURFACEBUSY) { - write_log (L"DirectDraw_BlitToPrimary: %s\n", DXError (ddrval)); + write_log (_T("DirectDraw_BlitToPrimary: %s\n"), DXError (ddrval)); if (srcrect) - write_log (L"SRC=%dx%d %dx%d\n", srcrect->left, srcrect->top, srcrect->right, srcrect->bottom); + write_log (_T("SRC=%dx%d %dx%d\n"), srcrect->left, srcrect->top, srcrect->right, srcrect->bottom); if (srcrect) - write_log (L"DST=%dx%d %dx%d\n", dstrect->left, dstrect->top, dstrect->right, dstrect->bottom); + write_log (_T("DST=%dx%d %dx%d\n"), dstrect->left, dstrect->top, dstrect->right, dstrect->bottom); break; } } @@ -772,7 +772,7 @@ static int DirectDraw_BlitToPrimary2 (RECT *rect, int dooffset) if (FAILED (ddrval)) return 0; } else if (ddrval != DDERR_SURFACEBUSY) { - write_log (L"DirectDraw_BlitToPrimary: %s\n", DXError (ddrval)); + write_log (_T("DirectDraw_BlitToPrimary: %s\n"), DXError (ddrval)); break; } } @@ -856,7 +856,7 @@ static int DirectDraw_Blt (LPDIRECTDRAWSURFACE7 dst, RECT *dstrect, LPDIRECTDRAW if (FAILED (ddrval)) return 0; } else if (ddrval != DDERR_SURFACEBUSY) { - write_log (L"DirectDraw_Blit: %s\n", DXError (ddrval)); + write_log (_T("DirectDraw_Blit: %s\n"), DXError (ddrval)); return 0; } } @@ -891,7 +891,7 @@ void DirectDraw_FillSurface (LPDIRECTDRAWSURFACE7 dst, RECT *rect, uae_u32 color if (FAILED (ddrval)) break; } else if (ddrval != DDERR_SURFACEBUSY) { - write_log (L"DirectDraw_Fill: %s\n", DXError (ddrval)); + write_log (_T("DirectDraw_Fill: %s\n"), DXError (ddrval)); break; } } @@ -972,7 +972,7 @@ static void flip (void) recurse--; } } else if (FAILED (ddrval)) { - write_log (L"IDirectDrawSurface7_Flip: %s\n", DXError (ddrval)); + write_log (_T("IDirectDrawSurface7_Flip: %s\n"), DXError (ddrval)); } } @@ -1017,45 +1017,45 @@ struct dxcap { }; static struct dxcap dxcapsinfo[] = { - { 1, L"DDCAPS_BLT", DDCAPS_BLT }, - { 1, L"DDCAPS_BLTQUEUE", DDCAPS_BLTQUEUE }, - { 1, L"DDCAPS_BLTFOURCC", DDCAPS_BLTFOURCC }, - { 1, L"DDCAPS_BLTCOLORFILL", DDCAPS_BLTSTRETCH }, - { 1, L"DDCAPS_BLTSTRETCH", DDCAPS_BLTSTRETCH }, - { 1, L"DDCAPS_CANBLTSYSMEM", DDCAPS_CANBLTSYSMEM }, - { 1, L"DDCAPS_CANCLIP", DDCAPS_CANCLIP }, - { 1, L"DDCAPS_CANCLIPSTRETCHED", DDCAPS_CANCLIPSTRETCHED }, - { 1, L"DDCAPS_COLORKEY", DDCAPS_COLORKEY }, - { 1, L"DDCAPS_COLORKEYHWASSIST", DDCAPS_COLORKEYHWASSIST }, - { 1, L"DDCAPS_GDI", DDCAPS_GDI }, - { 1, L"DDCAPS_NOHARDWARE", DDCAPS_NOHARDWARE }, - { 1, L"DDCAPS_OVERLAY", DDCAPS_OVERLAY }, - { 1, L"DDCAPS_VBI", DDCAPS_VBI }, - { 1, L"DDCAPS_3D", DDCAPS_3D }, - { 1, L"DDCAPS_BANKSWITCHED", DDCAPS_BANKSWITCHED }, - { 1, L"DDCAPS_PALETTE", DDCAPS_PALETTE }, - { 1, L"DDCAPS_PALETTEVSYNC", DDCAPS_PALETTEVSYNC }, - { 1, L"DDCAPS_READSCANLINE", DDCAPS_READSCANLINE }, - { 2, L"DDCAPS2_CERTIFIED", DDCAPS2_CERTIFIED }, - { 2, L"DDCAPS2_CANRENDERWINDOWED", DDCAPS2_CANRENDERWINDOWED }, - { 2, L"DDCAPS2_NOPAGELOCKREQUIRED", DDCAPS2_NOPAGELOCKREQUIRED }, - { 2, L"DDCAPS2_FLIPNOVSYNC", DDCAPS2_FLIPNOVSYNC }, - { 2, L"DDCAPS2_FLIPINTERVAL", DDCAPS2_FLIPINTERVAL }, - { 2, L"DDCAPS2_NO2DDURING3DSCENE", DDCAPS2_NO2DDURING3DSCENE }, - { 2, L"DDCAPS2_NONLOCALVIDMEM", DDCAPS2_NONLOCALVIDMEM }, - { 2, L"DDCAPS2_NONLOCALVIDMEMCAPS", DDCAPS2_NONLOCALVIDMEMCAPS }, - { 2, L"DDCAPS2_WIDESURFACES", DDCAPS2_WIDESURFACES }, - { 3, L"DDCKEYCAPS_DESTBLT", DDCKEYCAPS_DESTBLT }, - { 3, L"DDCKEYCAPS_DESTBLTCLRSPACE", DDCKEYCAPS_DESTBLTCLRSPACE }, - { 3, L"DDCKEYCAPS_SRCBLT", DDCKEYCAPS_SRCBLT }, - { 3, L"DDCKEYCAPS_SRCBLTCLRSPACE", DDCKEYCAPS_SRCBLTCLRSPACE }, + { 1, _T("DDCAPS_BLT"), DDCAPS_BLT }, + { 1, _T("DDCAPS_BLTQUEUE"), DDCAPS_BLTQUEUE }, + { 1, _T("DDCAPS_BLTFOURCC"), DDCAPS_BLTFOURCC }, + { 1, _T("DDCAPS_BLTCOLORFILL"), DDCAPS_BLTSTRETCH }, + { 1, _T("DDCAPS_BLTSTRETCH"), DDCAPS_BLTSTRETCH }, + { 1, _T("DDCAPS_CANBLTSYSMEM"), DDCAPS_CANBLTSYSMEM }, + { 1, _T("DDCAPS_CANCLIP"), DDCAPS_CANCLIP }, + { 1, _T("DDCAPS_CANCLIPSTRETCHED"), DDCAPS_CANCLIPSTRETCHED }, + { 1, _T("DDCAPS_COLORKEY"), DDCAPS_COLORKEY }, + { 1, _T("DDCAPS_COLORKEYHWASSIST"), DDCAPS_COLORKEYHWASSIST }, + { 1, _T("DDCAPS_GDI"), DDCAPS_GDI }, + { 1, _T("DDCAPS_NOHARDWARE"), DDCAPS_NOHARDWARE }, + { 1, _T("DDCAPS_OVERLAY"), DDCAPS_OVERLAY }, + { 1, _T("DDCAPS_VBI"), DDCAPS_VBI }, + { 1, _T("DDCAPS_3D"), DDCAPS_3D }, + { 1, _T("DDCAPS_BANKSWITCHED"), DDCAPS_BANKSWITCHED }, + { 1, _T("DDCAPS_PALETTE"), DDCAPS_PALETTE }, + { 1, _T("DDCAPS_PALETTEVSYNC"), DDCAPS_PALETTEVSYNC }, + { 1, _T("DDCAPS_READSCANLINE"), DDCAPS_READSCANLINE }, + { 2, _T("DDCAPS2_CERTIFIED"), DDCAPS2_CERTIFIED }, + { 2, _T("DDCAPS2_CANRENDERWINDOWED"), DDCAPS2_CANRENDERWINDOWED }, + { 2, _T("DDCAPS2_NOPAGELOCKREQUIRED"), DDCAPS2_NOPAGELOCKREQUIRED }, + { 2, _T("DDCAPS2_FLIPNOVSYNC"), DDCAPS2_FLIPNOVSYNC }, + { 2, _T("DDCAPS2_FLIPINTERVAL"), DDCAPS2_FLIPINTERVAL }, + { 2, _T("DDCAPS2_NO2DDURING3DSCENE"), DDCAPS2_NO2DDURING3DSCENE }, + { 2, _T("DDCAPS2_NONLOCALVIDMEM"), DDCAPS2_NONLOCALVIDMEM }, + { 2, _T("DDCAPS2_NONLOCALVIDMEMCAPS"), DDCAPS2_NONLOCALVIDMEMCAPS }, + { 2, _T("DDCAPS2_WIDESURFACES"), DDCAPS2_WIDESURFACES }, + { 3, _T("DDCKEYCAPS_DESTBLT"), DDCKEYCAPS_DESTBLT }, + { 3, _T("DDCKEYCAPS_DESTBLTCLRSPACE"), DDCKEYCAPS_DESTBLTCLRSPACE }, + { 3, _T("DDCKEYCAPS_SRCBLT"), DDCKEYCAPS_SRCBLT }, + { 3, _T("DDCKEYCAPS_SRCBLTCLRSPACE"), DDCKEYCAPS_SRCBLTCLRSPACE }, { 0, NULL } }; static void showcaps (DDCAPS_DX7 *dc) { int i, out; - write_log (L"%08x %08x %08x %08x %08x %08x\n", + write_log (_T("%08x %08x %08x %08x %08x %08x\n"), dc->dwCaps, dc->dwCaps2, dc->dwCKeyCaps, dc->dwFXCaps, dc->dwFXAlphaCaps, dc->dwPalCaps, dc->ddsCaps); out = 0; for (i = 0; dxcapsinfo[i].name; i++) { @@ -1074,13 +1074,13 @@ static void showcaps (DDCAPS_DX7 *dc) } if (caps & dxcapsinfo[i].mask) { if (out > 0) - write_log (L","); - write_log (L"%s", dxcapsinfo[i].name); + write_log (_T(",")); + write_log (_T("%s"), dxcapsinfo[i].name); out++; } } if (out > 0) - write_log (L"\n"); + write_log (_T("\n")); if ((dc->dwCaps & DDCAPS_COLORKEY) && (dc->dwCKeyCaps & DDCKEYCAPS_SRCBLT)) dxcaps.cancolorkey = TRUE; if (dc->dwCaps2 & DDCAPS2_NONLOCALVIDMEM) @@ -1099,12 +1099,12 @@ static void getcaps (void) hc.dwSize = sizeof hc; hr = IDirectDraw7_GetCaps (dxdata.maindd, &dc, &hc); if (FAILED (hr)) { - write_log (L"IDirectDraw7_GetCaps() failed %s\n", DXError (hr)); + write_log (_T("IDirectDraw7_GetCaps() failed %s\n"), DXError (hr)); return; } - write_log (L"DriverCaps: "); + write_log (_T("DriverCaps: ")); showcaps (&dc); - write_log (L"HELCaps : "); + write_log (_T("HELCaps : ")); showcaps (&hc); } @@ -1124,7 +1124,7 @@ static BOOL CALLBACK displaysCallback (GUID *guid, char *adesc, char *aname, LPV pt.y = (md->rect.bottom - md->rect.top) / 2 + md->rect.top; winmon = MonitorFromPoint (pt, MONITOR_DEFAULTTONEAREST); if (hm == winmon) { - write_log(L"%s = %s\n", md->fullname, outGUID (guid)); + write_log(_T("%s = %s\n"), md->fullname, outGUID (guid)); memcpy (&monitorguids[i], guid, sizeof GUID); memcpy (&md->ddguid, guid, sizeof GUID); return TRUE; @@ -1139,9 +1139,9 @@ void DirectDraw_get_GUIDs (void) if (guidsenumerated) return; guidsenumerated = true; - write_log (L"DirectDraw displays:\n"); + write_log (_T("DirectDraw displays:\n")); DirectDrawEnumerateExA (displaysCallback, 0, DDENUM_DETACHEDSECONDARYDEVICES | DDENUM_ATTACHEDSECONDARYDEVICES); - write_log (L"End\n"); + write_log (_T("End\n")); } int DirectDraw_Start (void) @@ -1154,14 +1154,14 @@ int DirectDraw_Start (void) GUID *guid; if (!first) { - d3dDLL = LoadLibrary (L"D3D9.DLL"); + d3dDLL = LoadLibrary (_T("D3D9.DLL")); if (d3dDLL) { d3d = Direct3DCreate9 (D3D9b_SDK_VERSION); if (d3d) { if (SUCCEEDED (IDirect3D9_GetDeviceCaps (d3d, 0, D3DDEVTYPE_HAL, &d3dCaps))) { dxcaps.maxwidth = d3dCaps.MaxTextureWidth; dxcaps.maxheight = d3dCaps.MaxTextureHeight; - write_log (L"Max hardware surface size: %dx%d\n", dxcaps.maxwidth, dxcaps.maxheight); + write_log (_T("Max hardware surface size: %dx%d\n"), dxcaps.maxwidth, dxcaps.maxheight); } IDirect3D9_Release (d3d); } @@ -1202,7 +1202,7 @@ int DirectDraw_Start (void) LPDIRECTDRAW dd; ddrval = DirectDrawCreate (guid, &dd, NULL); if (FAILED (ddrval)) { - write_log (L"DirectDrawCreate() failed, %s\n", DXError (ddrval)); + write_log (_T("DirectDrawCreate() failed, %s\n"), DXError (ddrval)); if (guid != NULL) return 0; goto oops; @@ -1210,13 +1210,13 @@ int DirectDraw_Start (void) ddrval = IDirectDraw_QueryInterface (dd, &IID_IDirectDraw7, &dxdata.maindd); IDirectDraw_Release (dd); if (FAILED (ddrval)) { - write_log (L"IDirectDraw_QueryInterface() failed, %s\n", DXError (ddrval)); + write_log (_T("IDirectDraw_QueryInterface() failed, %s\n"), DXError (ddrval)); goto oops; } #else ddrval = DirectDrawCreateEx (guid, (void**)&dxdata.maindd, IID_IDirectDraw7, NULL); if (FAILED (ddrval)) { - write_log (L"DirectDrawCreateEx() failed, %s\n", DXError (ddrval)); + write_log (_T("DirectDrawCreateEx() failed, %s\n"), DXError (ddrval)); if (guid != NULL) return 0; goto oops; @@ -1234,11 +1234,11 @@ int DirectDraw_Start (void) dxdata.ddzeroguid = 0; memcpy (&dxdata.ddguid, guid, sizeof (GUID)); } - write_log (L"DirectDraw Display GUID = %s\n", outGUID (guid)); + write_log (_T("DirectDraw Display GUID = %s\n"), outGUID (guid)); return 1; } oops: - write_log (L"DirectDraw_Start: %s\n", DXError (ddrval)); + write_log (_T("DirectDraw_Start: %s\n"), DXError (ddrval)); DirectDraw_Release (); return 0; } @@ -1271,7 +1271,7 @@ bool DD_getvblankpos (int *vpos) return false; hr = IDirectDraw7_GetVerticalBlankStatus (dxdata.maindd, &vbs); if (FAILED (hr)) { - write_log (L"IDirectDraw7_GetVerticalBlankStatus() failed, %s\n", DXError (hr)); + write_log (_T("IDirectDraw7_GetVerticalBlankStatus() failed, %s\n"), DXError (hr)); return false; } slstate = 4; @@ -1284,7 +1284,7 @@ bool DD_getvblankpos (int *vpos) slstate = 2; sl = -1; } else if (FAILED (hr) ) { - write_log (L"IDirectDraw7_GetScanLine() failed, %s\n", DXError (hr)); + write_log (_T("IDirectDraw7_GetScanLine() failed, %s\n"), DXError (hr)); return false; } } @@ -1296,7 +1296,7 @@ bool DD_getvblankpos (int *vpos) #if 0 static DWORD oldsl, oldslstate; if (oldsl != sl || oldslstate != slstate) { - write_log (L"%d:%d ", sl, slstate); + write_log (_T("%d:%d "), sl, slstate); oldsl = sl; oldslstate = slstate; } diff --git a/od-win32/fsdb_mywin32.cpp b/od-win32/fsdb_mywin32.cpp index ca1c5eff..1a7cab87 100644 --- a/od-win32/fsdb_mywin32.cpp +++ b/od-win32/fsdb_mywin32.cpp @@ -96,7 +96,7 @@ int my_rmdir (const TCHAR *name) } cnt = 0; while (my_readdir (od, tname)) { - if (!_tcscmp (tname, L".") || !_tcscmp (tname, L"..")) + if (!_tcscmp (tname, _T(".")) || !_tcscmp (tname, _T(".."))) continue; cnt++; break; @@ -129,7 +129,7 @@ struct my_opendir_s { struct my_opendir_s *my_opendir (const TCHAR *name) { - return my_opendir (name, L"*.*"); + return my_opendir (name, _T("*.*")); } struct my_opendir_s *my_opendir (const TCHAR *name, const TCHAR *mask) { @@ -137,7 +137,7 @@ struct my_opendir_s *my_opendir (const TCHAR *name, const TCHAR *mask) TCHAR tmp[MAX_DPATH]; _tcscpy (tmp, name); - _tcscat (tmp, L"\\"); + _tcscat (tmp, _T("\\")); _tcscat (tmp, mask); mod = xmalloc (struct my_opendir_s, 1); if (!mod) @@ -290,7 +290,7 @@ struct my_openfile_s *my_open (const TCHAR *name, int flags) err = GetLastError(); } if (h == INVALID_HANDLE_VALUE) { - write_log (L"failed to open '%s' %x %x err=%d\n", name, DesiredAccess, CreationDisposition, err); + write_log (_T("failed to open '%s' %x %x err=%d\n"), name, DesiredAccess, CreationDisposition, err); xfree (mos); mos = NULL; goto err; @@ -298,7 +298,7 @@ struct my_openfile_s *my_open (const TCHAR *name, int flags) } mos->h = h; err: - //write_log (L"open '%s' = %x\n", name, mos ? mos->h : 0); + //write_log (_T("open '%s' = %x\n"), name, mos ? mos->h : 0); return mos; } @@ -315,14 +315,14 @@ int my_truncate (const TCHAR *name, uae_u64 len) li.QuadPart = len; li.LowPart = SetFilePointer (hFile, li.LowPart, &li.HighPart, FILE_BEGIN); if (li.LowPart == INVALID_SET_FILE_POINTER && GetLastError () != NO_ERROR) { - write_log (L"truncate: SetFilePointer() failure for %s to posn %d\n", name, len); + write_log (_T("truncate: SetFilePointer() failure for %s to posn %d\n"), name, len); } else { if (SetEndOfFile (hFile) == TRUE) result = 0; } CloseHandle (hFile); } else { - write_log (L"truncate: CreateFile() failed to open %s\n", name); + write_log (_T("truncate: CreateFile() failed to open %s\n"), name); } return result; } @@ -331,7 +331,7 @@ int dos_errno (void) { DWORD e = GetLastError (); - //write_log (L"ec=%d\n", e); + //write_log (_T("ec=%d\n"), e); switch (e) { case ERROR_NOT_ENOUGH_MEMORY: case ERROR_OUTOFMEMORY: @@ -377,7 +377,7 @@ int dos_errno (void) { static int done; if (!done) - gui_message (L"Unimplemented error %d\nContact author!", e); + gui_message (_T("Unimplemented error %d\nContact author!"), e); done = 1; } return ERROR_NOT_IMPLEMENTED; @@ -405,13 +405,13 @@ int my_getvolumeinfo (const TCHAR *root) ret |= MYVOLUMEINFO_READONLY; */ pGetVolumePathName = (GETVOLUMEPATHNAME)GetProcAddress( - GetModuleHandle (L"kernel32.dll"), "GetVolumePathNameW"); + GetModuleHandle (_T("kernel32.dll")), "GetVolumePathNameW"); if (pGetVolumePathName && pGetVolumePathName (root, volume, sizeof (volume))) { TCHAR fsname[MAX_DPATH]; DWORD comlen; DWORD flags; if (GetVolumeInformation (volume, NULL, 0, NULL, &comlen, &flags, fsname, sizeof (fsname))) { - //write_log (L"Volume %s FS=%s maxlen=%d flags=%08X\n", volume, fsname, comlen, flags); + //write_log (_T("Volume %s FS=%s maxlen=%d flags=%08X\n"), volume, fsname, comlen, flags); if (flags & FILE_NAMED_STREAMS) ret |= MYVOLUMEINFO_STREAMS; } @@ -425,16 +425,16 @@ FILE *my_opentext (const TCHAR *name) uae_u8 tmp[4]; int v; - f = _tfopen (name, L"rb"); + f = _tfopen (name, _T("rb")); if (!f) return NULL; v = fread (tmp, 1, 4, f); fclose (f); if (v == 4) { if (tmp[0] == 0xef && tmp[1] == 0xbb && tmp[2] == 0xbf) - return _tfopen (name, L"r, ccs=UTF-8"); + return _tfopen (name, _T("r, ccs=UTF-8")); if (tmp[0] == 0xff && tmp[1] == 0xfe) - return _tfopen (name, L"r, ccs=UTF-16LE"); + return _tfopen (name, _T("r, ccs=UTF-16LE")); } - return _tfopen (name, L"r"); + return _tfopen (name, _T("r")); } diff --git a/od-win32/fsdb_win32.cpp b/od-win32/fsdb_win32.cpp index a8118c8b..270a71be 100644 --- a/od-win32/fsdb_win32.cpp +++ b/od-win32/fsdb_win32.cpp @@ -31,8 +31,8 @@ static int fsdb_debug = 0; #define NUM_EVILCHARS 7 static TCHAR evilchars[NUM_EVILCHARS] = { '\\', '*', '?', '\"', '<', '>', '|' }; -#define UAEFSDB_BEGINS L"__uae___" -#define UAEFSDB_BEGINSX L"__uae___*" +#define UAEFSDB_BEGINS _T("__uae___") +#define UAEFSDB_BEGINSX _T("__uae___*") #define UAEFSDB_LEN 604 #define UAEFSDB2_LEN 1632 @@ -64,9 +64,9 @@ static TCHAR *make_uaefsdbpath (const TCHAR *dir, const TCHAR *name) if (!p) return NULL; if (name) - _stprintf (p, L"%s\\%s:%s", dir, name, FSDB_FILE); + _stprintf (p, _T("%s\\%s:%s"), dir, name, FSDB_FILE); else - _stprintf (p, L"%s:%s", dir, FSDB_FILE); + _stprintf (p, _T("%s:%s"), dir, FSDB_FILE); return p; } @@ -81,7 +81,7 @@ static int read_uaefsdb (const TCHAR *dir, const TCHAR *name, uae_u8 *fsdb) h = CreateFile (p, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); if (fsdb_debug) - write_log (L"read_uaefsdb '%s' = %x\n", p, h); + write_log (_T("read_uaefsdb '%s' = %x\n"), p, h); xfree (p); if (h != INVALID_HANDLE_VALUE) { memset (fsdb, 0, UAEFSDB2_LEN); @@ -90,11 +90,11 @@ static int read_uaefsdb (const TCHAR *dir, const TCHAR *name, uae_u8 *fsdb) if (read == UAEFSDB_LEN || read == UAEFSDB2_LEN) { if (fsdb_debug) { TCHAR *an, *nn, *co; - write_log (L"->ok\n"); + write_log (_T("->ok\n")); an = au_fs ((char*)fsdb + 5); nn = au_fs ((char*)fsdb + 262); co = au_fs ((char*)fsdb + 519); - write_log (L"v=%02x flags=%08x an='%s' nn='%s' c='%s'\n", + write_log (_T("v=%02x flags=%08x an='%s' nn='%s' c='%s'\n"), fsdb[0], ((uae_u32*)(fsdb+1))[0], an, nn, co); xfree (co); xfree (nn); @@ -104,7 +104,7 @@ static int read_uaefsdb (const TCHAR *dir, const TCHAR *name, uae_u8 *fsdb) } } if (fsdb_debug) - write_log (L"->fail %d, %d\n", read, GetLastError ()); + write_log (_T("->fail %d, %d\n"), read, GetLastError ()); memset (fsdb, 0, UAEFSDB2_LEN); return 0; } @@ -117,7 +117,7 @@ static int delete_uaefsdb (const TCHAR *dir) p = make_uaefsdbpath (dir, NULL); ret = DeleteFile (p); if (fsdb_debug) - write_log (L"delete_uaefsdb '%s' = %d\n", p, ret); + write_log (_T("delete_uaefsdb '%s' = %d\n"), p, ret); xfree (p); return ret; } @@ -151,8 +151,8 @@ static int write_uaefsdb (const TCHAR *dir, uae_u8 *fsdb) an = au_fs ((char*)fsdb + 5); nn = au_fs ((char*)fsdb + 262); co = au_fs ((char*)fsdb + 519); - write_log (L"write_uaefsdb '%s' = %x\n", p, h); - write_log (L"v=%02x flags=%08x an='%s' nn='%s' c='%s'\n", + write_log (_T("write_uaefsdb '%s' = %x\n"), p, h); + write_log (_T("v=%02x flags=%08x an='%s' nn='%s' c='%s'\n"), fsdb[0], ((uae_u32*)(fsdb+1))[0], an, nn, co); xfree (co); xfree (nn); @@ -166,7 +166,7 @@ static int write_uaefsdb (const TCHAR *dir, uae_u8 *fsdb) h = CreateFile (p, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); if (fsdb_debug) - write_log (L"write_uaefsdb (2) '%s' = %x\n", p, h); + write_log (_T("write_uaefsdb (2) '%s' = %x\n"), p, h); } } } @@ -175,13 +175,13 @@ static int write_uaefsdb (const TCHAR *dir, uae_u8 *fsdb) CloseHandle (h); if (written == UAEFSDB2_LEN) { if (fsdb_debug) - write_log (L"->ok\n"); + write_log (_T("->ok\n")); ret = 1; goto end; } } if (fsdb_debug) - write_log (L"->fail %d, %d\n", written, GetLastError ()); + write_log (_T("->fail %d, %d\n"), written, GetLastError ()); DeleteFile (p); end: @@ -214,7 +214,7 @@ static void create_uaefsdb (a_inode *aino, uae_u8 *buf, int winmode) strncpy ((char*)buf + 5 + 257, s, 256); buf[5 + 257 + 256] = '\0'; xfree (s); - s = ua_fs (aino->comment ? aino->comment : L"", -1); + s = ua_fs (aino->comment ? aino->comment : _T(""), -1); strncpy ((char*)buf + 5 + 2 * 257, s, 80); buf[5 + 2 * 257 + 80] = '\0'; xfree (s); @@ -259,7 +259,7 @@ static a_inode *aino_from_buf (a_inode *base, uae_u8 *buf, int *winmode) aino->dirty = 0; aino->db_offset = 0; if((mode = GetFileAttributes (aino->nname)) == INVALID_FILE_ATTRIBUTES) { - write_log (L"xGetFileAttributes('%s') failed! error=%d, aino=%p\n", + write_log (_T("xGetFileAttributes('%s') failed! error=%d, aino=%p\n"), aino->nname, GetLastError (), aino); return aino; } @@ -328,7 +328,7 @@ int fsdb_name_invalid (const TCHAR *n) int v = fsdb_name_invalid_2 (n); if (v <= 0) return v; - write_log (L"FILESYS: '%s' illegal filename\n", n); + write_log (_T("FILESYS: '%s' illegal filename\n"), n); return v; } @@ -353,7 +353,7 @@ int fsdb_fill_file_attrs (a_inode *base, a_inode *aino) int reset = 0; if((mode = GetFileAttributes(aino->nname)) == INVALID_FILE_ATTRIBUTES) { - write_log (L"GetFileAttributes('%s') failed! error=%d, aino=%p dir=%d\n", + write_log (_T("GetFileAttributes('%s') failed! error=%d, aino=%p dir=%d\n"), aino->nname, GetLastError(), aino, aino->dir); return 0; } @@ -369,7 +369,7 @@ int fsdb_fill_file_attrs (a_inode *base, a_inode *aino) xfree (aino_from_buf (base, fsdb, &winmode)); if (winmode == mode) /* no Windows-side editing? */ return 1; - write_log (L"FS: '%s' protection flags edited from Windows-side\n", aino->nname); + write_log (_T("FS: '%s' protection flags edited from Windows-side\n"), aino->nname); reset = 1; /* edited from Windows-side -> use Windows side flags instead */ } @@ -506,7 +506,7 @@ TCHAR *fsdb_create_unique_nname (a_inode *base, const TCHAR *suggestion) for (;;) { TCHAR *p = build_nname (base->nname, tmp); if (!fsdb_exists (p)) { - write_log (L"unique name: %s\n", p); + write_log (_T("unique name: %s\n"), p); return p; } xfree (p); diff --git a/od-win32/hardfile_win32.cpp b/od-win32/hardfile_win32.cpp index 6df28ffc..d95ef982 100644 --- a/od-win32/hardfile_win32.cpp +++ b/od-win32/hardfile_win32.cpp @@ -91,7 +91,7 @@ static void rdbdump (HANDLE h, uae_u64 offset, uae_u8 *buf, int blocksize) FILE *f; bool needfree = false; - write_log (L"creating rdb dump.. offset=%I64X blocksize=%d\n", offset, blocksize); + write_log (_T("creating rdb dump.. offset=%I64X blocksize=%d\n"), offset, blocksize); if (buf) { blocks = (buf[132] << 24) | (buf[133] << 16) | (buf[134] << 8) | (buf[135] << 0); if (blocks < 0 || blocks > 100000) @@ -101,10 +101,10 @@ static void rdbdump (HANDLE h, uae_u64 offset, uae_u8 *buf, int blocksize) buf = (uae_u8*)VirtualAlloc (NULL, CACHE_SIZE, MEM_COMMIT, PAGE_READWRITE); needfree = true; } - _stprintf (name, L"rdb_dump_%d.rdb", cnt); - f = _tfopen (name, L"wb"); + _stprintf (name, _T("rdb_dump_%d.rdb"), cnt); + f = _tfopen (name, _T("wb")); if (!f) { - write_log (L"failed to create file '%s'\n", name); + write_log (_T("failed to create file '%s'\n"), name); return; } for (i = 0; i <= blocks; i++) { @@ -120,7 +120,7 @@ static void rdbdump (HANDLE h, uae_u64 offset, uae_u8 *buf, int blocksize) fclose (f); if (needfree) VirtualFree (buf, 0, MEM_RELEASE); - write_log (L"'%s' saved\n", name); + write_log (_T("'%s' saved\n"), name); cnt++; } @@ -138,7 +138,7 @@ static int getsignfromhandle (HANDLE h, DWORD *sign, DWORD *pstyle) *pstyle = dli->PartitionStyle; ok = 1; } else { - hdf_log2 (L"IOCTL_DISK_GET_DRIVE_LAYOUT_EX() returned %08x\n", GetLastError ()); + hdf_log2 (_T("IOCTL_DISK_GET_DRIVE_LAYOUT_EX() returned %08x\n"), GetLastError ()); } if (!ok) { if (DeviceIoControl (h, IOCTL_DISK_GET_DRIVE_LAYOUT, NULL, 0, dli, outsize, &written, NULL)) { @@ -147,10 +147,10 @@ static int getsignfromhandle (HANDLE h, DWORD *sign, DWORD *pstyle) *pstyle = PARTITION_STYLE_MBR; ok = 1; } else { - hdf_log2 (L"IOCTL_DISK_GET_DRIVE_LAYOUT() returned %08x\n", GetLastError ()); + hdf_log2 (_T("IOCTL_DISK_GET_DRIVE_LAYOUT() returned %08x\n"), GetLastError ()); } } - hdf_log2 (L"getsignfromhandle(signature=%08X,pstyle=%d)\n", *sign, *pstyle); + hdf_log2 (_T("getsignfromhandle(signature=%08X,pstyle=%d)\n"), *sign, *pstyle); xfree (dli); return ok; } @@ -162,8 +162,8 @@ static int ismounted (const TCHAR *name, HANDLE hd) int mounted; DWORD sign, pstyle; - hdf_log2 (L"\n"); - hdf_log2 (L"Name='%s'\n", name); + hdf_log2 (_T("\n")); + hdf_log2 (_T("Name='%s'\n"), name); if (!getsignfromhandle (hd, &sign, &pstyle)) return 0; if (pstyle == PARTITION_STYLE_GPT) @@ -178,30 +178,30 @@ static int ismounted (const TCHAR *name, HANDLE hd) volname[_tcslen (volname) - 1] = 0; d = CreateFile (volname, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); - hdf_log2 (L"volname='%s' %08x\n", volname, d); + hdf_log2 (_T("volname='%s' %08x\n"), volname, d); if (d != INVALID_HANDLE_VALUE) { DWORD isntfs, outsize, written; isntfs = 0; if (DeviceIoControl (d, FSCTL_IS_VOLUME_MOUNTED, NULL, 0, NULL, 0, &written, NULL)) { VOLUME_DISK_EXTENTS *vde; NTFS_VOLUME_DATA_BUFFER ntfs; - hdf_log2 (L"FSCTL_IS_VOLUME_MOUNTED returned is mounted\n"); + hdf_log2 (_T("FSCTL_IS_VOLUME_MOUNTED returned is mounted\n")); if (DeviceIoControl (d, FSCTL_GET_NTFS_VOLUME_DATA, NULL, 0, &ntfs, sizeof ntfs, &written, NULL)) { isntfs = 1; } - hdf_log2 (L"FSCTL_GET_NTFS_VOLUME_DATA returned %d\n", isntfs); + hdf_log2 (_T("FSCTL_GET_NTFS_VOLUME_DATA returned %d\n"), isntfs); outsize = sizeof (VOLUME_DISK_EXTENTS) + sizeof (DISK_EXTENT) * 32; vde = (VOLUME_DISK_EXTENTS*)xmalloc (uae_u8, outsize); if (DeviceIoControl (d, IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS, NULL, 0, vde, outsize, &written, NULL)) { int i; - hdf_log2 (L"IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS returned %d extents\n", vde->NumberOfDiskExtents); + hdf_log2 (_T("IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS returned %d extents\n"), vde->NumberOfDiskExtents); for (i = 0; i < vde->NumberOfDiskExtents; i++) { TCHAR pdrv[MAX_DPATH]; HANDLE ph; - _stprintf (pdrv, L"\\\\.\\PhysicalDrive%d", vde->Extents[i].DiskNumber); + _stprintf (pdrv, _T("\\\\.\\PhysicalDrive%d"), vde->Extents[i].DiskNumber); ph = CreateFile (pdrv, 0, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); - hdf_log2 (L"PhysicalDrive%d: Extent %d Start=%I64X Len=%I64X\n", i, + hdf_log2 (_T("PhysicalDrive%d: Extent %d Start=%I64X Len=%I64X\n"), i, vde->Extents[i].DiskNumber, vde->Extents[i].StartingOffset.QuadPart, vde->Extents[i].ExtentLength.QuadPart); if (ph != INVALID_HANDLE_VALUE) { DWORD sign2; @@ -213,20 +213,20 @@ static int ismounted (const TCHAR *name, HANDLE hd) } } } else { - hdf_log2 (L"IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS returned %08x\n", GetLastError ()); + hdf_log2 (_T("IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS returned %08x\n"), GetLastError ()); } } else { - hdf_log2 (L"FSCTL_IS_VOLUME_MOUNTED returned not mounted\n"); + hdf_log2 (_T("FSCTL_IS_VOLUME_MOUNTED returned not mounted\n")); } CloseHandle (d); } else { - write_log (L"'%s': %d\n", volname, GetLastError ()); + write_log (_T("'%s': %d\n"), volname, GetLastError ()); } if (!FindNextVolume (h, volname, sizeof volname / sizeof (TCHAR))) break; } FindVolumeClose (h); - hdf_log2 (L"\n"); + hdf_log2 (_T("\n")); return mounted; } @@ -241,13 +241,13 @@ static int safetycheck (HANDLE h, const TCHAR *name, uae_u64 offset, uae_u8 *buf for (j = 0; j < blocks; j++) { high = (LONG)(offset >> 32); if (SetFilePointer (h, (DWORD)offset, &high, FILE_BEGIN) == INVALID_FILE_SIZE) { - write_log (L"hd ignored, SetFilePointer failed, error %d\n", GetLastError ()); + write_log (_T("hd ignored, SetFilePointer failed, error %d\n"), GetLastError ()); return 1; } memset (buf, 0xaa, blocksize); ReadFile (h, buf, blocksize, &outlen, NULL); if (outlen != blocksize) { - write_log (L"hd ignored, read error %d!\n", GetLastError ()); + write_log (_T("hd ignored, read error %d!\n"), GetLastError ()); return 2; } if (j == 0 && offset > 0) @@ -256,20 +256,20 @@ static int safetycheck (HANDLE h, const TCHAR *name, uae_u64 offset, uae_u8 *buf // ADIDE "CPRM" hidden block.. if (do_rdbdump) rdbdump (h, offset, buf, blocksize); - write_log (L"hd accepted (adide rdb detected at block %d)\n", j); + write_log (_T("hd accepted (adide rdb detected at block %d)\n"), j); return -3; } if (!memcmp (buf, "RDSK", 4) || !memcmp (buf, "DRKS", 4)) { if (do_rdbdump) rdbdump (h, offset, buf, blocksize); - write_log (L"hd accepted (rdb detected at block %d)\n", j); + write_log (_T("hd accepted (rdb detected at block %d)\n"), j); return -1; } if (!memcmp (buf + 2, "CIS@", 4) && !memcmp (buf + 16, CA, strlen (CA))) { if (do_rdbdump) rdbdump (h, offset, NULL, blocksize); - write_log (L"hd accepted (PCMCIA RAM)\n"); + write_log (_T("hd accepted (PCMCIA RAM)\n")); return -2; } if (j == 0) { @@ -282,8 +282,8 @@ static int safetycheck (HANDLE h, const TCHAR *name, uae_u64 offset, uae_u8 *buf } if (!empty) { int mounted; - if (regexiststree (NULL, L"DangerousDrives")) { - UAEREG *fkey = regcreatetree (NULL, L"DangerousDrives"); + if (regexiststree (NULL, _T("DangerousDrives"))) { + UAEREG *fkey = regcreatetree (NULL, _T("DangerousDrives")); int match = 0; if (fkey) { int idx = 0; @@ -303,7 +303,7 @@ static int safetycheck (HANDLE h, const TCHAR *name, uae_u64 offset, uae_u8 *buf if (match) { if (do_rdbdump > 1) rdbdump (h, origoffset, NULL, blocksize); - write_log (L"hd accepted, enabled in registry!\n"); + write_log (_T("hd accepted, enabled in registry!\n")); return -7; } } @@ -311,22 +311,22 @@ static int safetycheck (HANDLE h, const TCHAR *name, uae_u64 offset, uae_u8 *buf if (!mounted) { if (do_rdbdump > 1) rdbdump (h, origoffset, NULL, blocksize); - write_log (L"hd accepted, not empty and not mounted in Windows\n"); + write_log (_T("hd accepted, not empty and not mounted in Windows\n")); return -8; } if (mounted < 0) { - write_log (L"hd ignored, NTFS partitions\n"); + write_log (_T("hd ignored, NTFS partitions\n")); return 0; } return -6; //if (harddrive_dangerous == 0x1234dead) // return -6; - //write_log (L"hd ignored, not empty and no RDB detected or Windows mounted\n"); + //write_log (_T("hd ignored, not empty and no RDB detected or Windows mounted\n")); //return 0; } if (do_rdbdump > 1) rdbdump (h, origoffset, NULL, blocksize); - write_log (L"hd accepted (empty)\n"); + write_log (_T("hd accepted (empty)\n")); return -9; } @@ -347,7 +347,7 @@ int isharddrive (const TCHAR *name) return -1; } -static TCHAR *hdz[] = { L"hdz", L"zip", L"rar", L"7z", NULL }; +static TCHAR *hdz[] = { _T("hdz"), _T("zip"), _T("rar"), _T("7z"), NULL }; #if 0 static void getserial (HANDLE h) @@ -365,7 +365,7 @@ static void getserial (HANDLE h) if (DeviceIoControl (h, IOCTL_DISK_GET_DRIVE_GEOMETRY_EX, NULL, 0, out, outsize, &written, NULL)) { DISK_DETECTION_INFO *ddi = DiskGeometryGetDetect (out); DISK_PARTITION_INFO *dpi = DiskGeometryGetPartition (out); - write_log (L""); + write_log (_T("")); } xfree (out); @@ -374,7 +374,7 @@ static void getserial (HANDLE h) vde = xmalloc (outsize); if (DeviceIoControl (h, IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS, NULL, 0, vde, outsize, &written, NULL)) { if (vde->NumberOfDiskExtents > 0) - write_log(L"%d\n", vde->Extents[0].DiskNumber); + write_log(_T("%d\n"), vde->Extents[0].DiskNumber); } xfree (vde); } @@ -396,12 +396,12 @@ int hdf_open_target (struct hardfiledata *hfd, const TCHAR *pname) hfd->virtual_size = 0; hfd->virtual_rdb = NULL; if (!hfd->cache) { - write_log (L"VirtualAlloc(%d) failed, error %d\n", CACHE_SIZE, GetLastError ()); + write_log (_T("VirtualAlloc(%d) failed, error %d\n"), CACHE_SIZE, GetLastError ()); goto end; } hfd->handle = xcalloc (struct hardfilehandle, 1); hfd->handle->h = INVALID_HANDLE_VALUE; - hfd_log (L"hfd open: '%s'\n", name); + hfd_log (_T("hfd open: '%s'\n"), name); if (name[0] == ':') { hdf_init_target (); i = isharddrive (name); @@ -422,7 +422,7 @@ int hdf_open_target (struct hardfiledata *hfd, const TCHAR *pname) if (h == INVALID_HANDLE_VALUE) goto end; if (!DeviceIoControl(h, FSCTL_ALLOW_EXTENDED_DASD_IO, NULL, 0, NULL, 0, &r, NULL)) - write_log (L"WARNING: '%s' FSCTL_ALLOW_EXTENDED_DASD_IO returned %d\n", name, GetLastError ()); + write_log (_T("WARNING: '%s' FSCTL_ALLOW_EXTENDED_DASD_IO returned %d\n"), name, GetLastError ()); _tcsncpy (hfd->vendor_id, udi->vendor_id, 8); _tcsncpy (hfd->product_id, udi->product_id, 16); _tcsncpy (hfd->product_rev, udi->product_rev, 4); @@ -434,7 +434,7 @@ int hdf_open_target (struct hardfiledata *hfd, const TCHAR *pname) if (sf > 0) goto end; if (sf == 0 && !hfd->readonly && harddrive_dangerous != 0x1234dead) { - write_log (L"'%s' forced read-only, safetycheck enabled\n", udi->device_path); + write_log (_T("'%s' forced read-only, safetycheck enabled\n"), udi->device_path); hfd->dangerous = 1; // clear GENERIC_WRITE CloseHandle (h); @@ -446,7 +446,7 @@ int hdf_open_target (struct hardfiledata *hfd, const TCHAR *pname) if (h == INVALID_HANDLE_VALUE) goto end; if (!DeviceIoControl(h, FSCTL_ALLOW_EXTENDED_DASD_IO, NULL, 0, NULL, 0, &r, NULL)) - write_log (L"WARNING: '%s' FSCTL_ALLOW_EXTENDED_DASD_IO returned %d\n", name, GetLastError ()); + write_log (_T("WARNING: '%s' FSCTL_ALLOW_EXTENDED_DASD_IO returned %d\n"), name, GetLastError ()); } #if 0 @@ -489,9 +489,9 @@ int hdf_open_target (struct hardfiledata *hfd, const TCHAR *pname) i = _tcslen (name) - 1; while (i >= 0) { if ((i > 0 && (name[i - 1] == '/' || name[i - 1] == '\\')) || i == 0) { - _tcscpy (hfd->vendor_id, L"UAE"); + _tcscpy (hfd->vendor_id, _T("UAE")); _tcsncpy (hfd->product_id, name + i, 15); - _tcscpy (hfd->product_rev, L"0.3"); + _tcscpy (hfd->product_rev, _T("0.3")); break; } i--; @@ -509,15 +509,15 @@ int hdf_open_target (struct hardfiledata *hfd, const TCHAR *pname) low &= ~(hfd->blocksize - 1); hfd->physsize = hfd->virtsize = ((uae_u64)high2 << 32) | low; if (hfd->physsize < hfd->blocksize || hfd->physsize == 0) { - write_log (L"HDF '%s' is too small\n", name); + write_log (_T("HDF '%s' is too small\n"), name); goto end; } hfd->handle_valid = HDF_HANDLE_WIN32; if (hfd->physsize < 64 * 1024 * 1024 && zmode) { - write_log (L"HDF '%s' re-opened in zfile-mode\n", name); + write_log (_T("HDF '%s' re-opened in zfile-mode\n"), name); CloseHandle (h); hfd->handle->h = INVALID_HANDLE_VALUE; - hfd->handle->zf = zfile_fopen (name, L"rb", ZFD_NORMAL); + hfd->handle->zf = zfile_fopen (name, _T("rb"), ZFD_NORMAL); hfd->handle->zfile = 1; if (!hfd->handle->zf) goto end; @@ -527,11 +527,11 @@ int hdf_open_target (struct hardfiledata *hfd, const TCHAR *pname) hfd->handle_valid = HDF_HANDLE_ZFILE; } } else { - write_log (L"HDF '%s' failed to open. error = %d\n", name, GetLastError ()); + write_log (_T("HDF '%s' failed to open. error = %d\n"), name, GetLastError ()); } } if (hfd->handle_valid || hfd->drive_empty) { - hfd_log (L"HDF '%s' %p opened, size=%dK mode=%d empty=%d\n", + hfd_log (_T("HDF '%s' %p opened, size=%dK mode=%d empty=%d\n"), name, hfd, hfd->physsize / 1024, hfd->handle_valid, hfd->drive_empty); return 1; } @@ -607,16 +607,16 @@ static int hdf_seek (struct hardfiledata *hfd, uae_u64 offset) DWORD ret; if (hfd->handle_valid == 0) { - gui_message (L"hd: hdf handle is not valid. bug."); + gui_message (_T("hd: hdf handle is not valid. bug.")); abort(); } if (offset >= hfd->physsize - hfd->virtual_size) { - gui_message (L"hd: tried to seek out of bounds! (%I64X >= %I64X)\n", offset, hfd->physsize); + gui_message (_T("hd: tried to seek out of bounds! (%I64X >= %I64X)\n"), offset, hfd->physsize); abort (); } offset += hfd->offset; if (offset & (hfd->blocksize - 1)) { - gui_message (L"hd: poscheck failed, offset=%I64X not aligned to blocksize=%d! (%I64X & %04X = %04X)\n", + gui_message (_T("hd: poscheck failed, offset=%I64X not aligned to blocksize=%d! (%I64X & %04X = %04X)\n"), offset, hfd->blocksize, offset, hfd->blocksize, offset & (hfd->blocksize - 1)); abort (); } @@ -641,7 +641,7 @@ static void poscheck (struct hardfiledata *hfd, int len) ret = SetFilePointer (hfd->handle->h, 0, &high, FILE_CURRENT); err = GetLastError (); if (ret == INVALID_FILE_SIZE && err != NO_ERROR) { - gui_message (L"hd: poscheck failed. seek failure, error %d", err); + gui_message (_T("hd: poscheck failed. seek failure, error %d"), err); abort (); } pos = ((uae_u64)high) << 32 | ret; @@ -649,19 +649,19 @@ static void poscheck (struct hardfiledata *hfd, int len) pos = zfile_ftell (hfd->handle->zf); } if (len < 0) { - gui_message (L"hd: poscheck failed, negative length! (%d)", len); + gui_message (_T("hd: poscheck failed, negative length! (%d)"), len); abort (); } if (pos < hfd->offset) { - gui_message (L"hd: poscheck failed, offset out of bounds! (%I64d < %I64d)", pos, hfd->offset); + gui_message (_T("hd: poscheck failed, offset out of bounds! (%I64d < %I64d)"), pos, hfd->offset); abort (); } if (pos >= hfd->offset + hfd->physsize - hfd->virtual_size || pos >= hfd->offset + hfd->physsize + len - hfd->virtual_size) { - gui_message (L"hd: poscheck failed, offset out of bounds! (%I64d >= %I64d, LEN=%d)", pos, hfd->offset + hfd->physsize, len); + gui_message (_T("hd: poscheck failed, offset out of bounds! (%I64d >= %I64d, LEN=%d)"), pos, hfd->offset + hfd->physsize, len); abort (); } if (pos & (hfd->blocksize - 1)) { - gui_message (L"hd: poscheck failed, offset not aligned to blocksize! (%I64X & %04X = %04X\n", pos, hfd->blocksize, pos & hfd->blocksize); + gui_message (_T("hd: poscheck failed, offset not aligned to blocksize! (%I64X & %04X = %04X\n"), pos, hfd->blocksize, pos & hfd->blocksize); abort (); } } @@ -811,7 +811,7 @@ static int hdf_read_2 (struct hardfiledata *hfd, void *buffer, uae_u64 offset, i memcpy (buffer, hfd->cache + coffset, len); return len; } - write_log (L"hdf_read: cache bug! offset=%I64d len=%d\n", offset, len); + write_log (_T("hdf_read: cache bug! offset=%I64d len=%d\n"), offset, len); hfd->cache_valid = 0; return 0; } @@ -872,12 +872,12 @@ static int hdf_write_2 (struct hardfiledata *hfd, void *buffer, uae_u64 offset, poscheck (hfd, len); memcpy (hfd->cache, buffer, len); if (hfd->handle_valid == HDF_HANDLE_WIN32) { - TCHAR *name = hfd->emptyname == NULL ? L"" : hfd->emptyname; + TCHAR *name = hfd->emptyname == NULL ? _T("") : hfd->emptyname; if (offset == 0) { if (!hfd->handle->firstwrite && (hfd->flags & HFD_FLAGS_REALDRIVE)) { hfd->handle->firstwrite = true; if (ismounted (hfd->device_name, hfd->handle->h)) { - gui_message (L"\"%s\"\n\nBlock zero write attempt but drive has one or more mounted PC partitions. Erase the drive or unmount all PC partitions first.", name); + gui_message (_T("\"%s\"\n\nBlock zero write attempt but drive has one or more mounted PC partitions. Erase the drive or unmount all PC partitions first."), name); hfd->readonly = 1; return 0; } @@ -894,7 +894,7 @@ static int hdf_write_2 (struct hardfiledata *hfd, void *buffer, uae_u64 offset, hdf_seek (hfd, offset); ReadFile (hfd->handle->h, tmp, tmplen, &outlen2, NULL); if (memcmp (hfd->cache, tmp, tmplen) != 0 || outlen != len) - gui_message (L"\"%s\"\n\nblock zero write failed!", name); + gui_message (_T("\"%s\"\n\nblock zero write failed!"), name); VirtualFree (tmp, 0, MEM_RELEASE); } } @@ -942,7 +942,7 @@ int hdf_resize_target (struct hardfiledata *hfd, uae_u64 newsize) } err = GetLastError (); if (ret == INVALID_SET_FILE_POINTER && err != NO_ERROR) { - write_log (L"hdf_resize_target: SetFilePointer() %d\n", err); + write_log (_T("hdf_resize_target: SetFilePointer() %d\n"), err); return 0; } if (SetEndOfFile (hfd->handle->h)) { @@ -950,7 +950,7 @@ int hdf_resize_target (struct hardfiledata *hfd, uae_u64 newsize) return 1; } err = GetLastError (); - write_log (L"hdf_resize_target: SetEndOfFile() %d\n", err); + write_log (_T("hdf_resize_target: SetEndOfFile() %d\n"), err); return 0; } @@ -960,10 +960,10 @@ int hdf_resize_target (struct hardfiledata *hfd, uae_u64 newsize) static void generatestorageproperty (struct uae_driveinfo *udi, int ignoreduplicates) { - _tcscpy (udi->vendor_id, L"UAE"); - _tcscpy (udi->product_id, L"DISK"); - _tcscpy (udi->product_rev, L"1.1"); - _stprintf (udi->device_name, L"%s", udi->device_path); + _tcscpy (udi->vendor_id, _T("UAE")); + _tcscpy (udi->product_id, _T("DISK")); + _tcscpy (udi->product_rev, _T("1.1")); + _stprintf (udi->device_name, _T("%s"), udi->device_path); udi->removablemedia = 1; } @@ -979,11 +979,11 @@ static int getstorageproperty (PUCHAR outBuf, int returnedLength, struct uae_dri size = devDesc->Version; p = (PUCHAR) outBuf; if (offsetof(STORAGE_DEVICE_DESCRIPTOR, CommandQueueing) > size) { - write_log (L"too short STORAGE_DEVICE_DESCRIPTOR only %d bytes\n", size); + write_log (_T("too short STORAGE_DEVICE_DESCRIPTOR only %d bytes\n"), size); return 1; } if (devDesc->DeviceType != INQ_DASD && devDesc->DeviceType != INQ_ROMD && devDesc->DeviceType != INQ_OPTD) { - write_log (L"not a direct access device, ignored (type=%d)\n", devDesc->DeviceType); + write_log (_T("not a direct access device, ignored (type=%d)\n"), devDesc->DeviceType); return 1; } if (size > offsetof(STORAGE_DEVICE_DESCRIPTOR, VendorIdOffset) && devDesc->VendorIdOffset && p[devDesc->VendorIdOffset]) { @@ -1010,33 +1010,33 @@ static int getstorageproperty (PUCHAR outBuf, int returnedLength, struct uae_dri _tcscat (udi->device_name, udi->vendor_id); if (udi->product_id[0]) { if (udi->device_name[0]) - _tcscat (udi->device_name, L" "); + _tcscat (udi->device_name, _T(" ")); _tcscat (udi->device_name, udi->product_id); } if (udi->product_rev[0]) { if (udi->device_name[0]) - _tcscat (udi->device_name, L" "); + _tcscat (udi->device_name, _T(" ")); _tcscat (udi->device_name, udi->product_rev); } if (udi->product_serial[0]) { if (udi->device_name[0]) - _tcscat (udi->device_name, L" "); + _tcscat (udi->device_name, _T(" ")); _tcscat (udi->device_name, udi->product_serial); } if (!udi->device_name[0]) { - write_log (L"empty device id?!?, replacing with device path\n"); + write_log (_T("empty device id?!?, replacing with device path\n")); _tcscpy (udi->device_name, udi->device_path); } udi->removablemedia = devDesc->RemovableMedia; - write_log (L"device id string: '%s'\n", udi->device_name); + write_log (_T("device id string: '%s'\n"), udi->device_name); if (ignoreduplicates) { - _stprintf (orgname, L":%s", udi->device_name); + _stprintf (orgname, _T(":%s"), udi->device_name); if (isharddrive (orgname) >= 0) { - write_log (L"duplicate device, ignored\n"); + write_log (_T("duplicate device, ignored\n")); return 1; } if (!udi->removablemedia) { - write_log (L"drive letter not removable, ignored\n"); + write_log (_T("drive letter not removable, ignored\n")); return 1; } } @@ -1069,7 +1069,7 @@ static BOOL GetDevicePropertyFromName(const TCHAR *DevicePath, DWORD Index, DWOR udi = &uae_drives[*index2]; memset (udi, 0, sizeof (struct uae_driveinfo)); _tcscpy (udi->device_path, DevicePath); - write_log (L"opening device '%s'\n", udi->device_path); + write_log (_T("opening device '%s'\n"), udi->device_path); hDevice = CreateFile( udi->device_path, // device interface name GENERIC_READ, // dwDesiredAccess @@ -1087,7 +1087,7 @@ static BOOL GetDevicePropertyFromName(const TCHAR *DevicePath, DWORD Index, DWOR if (hDevice == INVALID_HANDLE_VALUE) { - write_log (L"CreateFile failed with error: %d\n", GetLastError()); + write_log (_T("CreateFile failed with error: %d\n"), GetLastError()); ret = 1; goto end; } @@ -1106,7 +1106,7 @@ static BOOL GetDevicePropertyFromName(const TCHAR *DevicePath, DWORD Index, DWOR NULL ); if (!status) { - write_log (L"IOCTL_STORAGE_QUERY_PROPERTY failed with error code %d.\n", GetLastError()); + write_log (_T("IOCTL_STORAGE_QUERY_PROPERTY failed with error code %d.\n"), GetLastError()); } else { adpDesc = (PSTORAGE_ADAPTER_DESCRIPTOR) outBuf; } @@ -1125,7 +1125,7 @@ static BOOL GetDevicePropertyFromName(const TCHAR *DevicePath, DWORD Index, DWOR NULL); if (!status) { DWORD err = GetLastError (); - write_log (L"IOCTL_STORAGE_QUERY_PROPERTY failed with error code %d.\n", err); + write_log (_T("IOCTL_STORAGE_QUERY_PROPERTY failed with error code %d.\n"), err); if (err != ERROR_INVALID_FUNCTION) { ret = 1; goto end; @@ -1150,7 +1150,7 @@ static BOOL GetDevicePropertyFromName(const TCHAR *DevicePath, DWORD Index, DWOR udi->nomedia = 1; goto amipartfound; } - write_log (L"IOCTL_DISK_GET_DRIVE_GEOMETRY failed with error code %d.\n", err); + write_log (_T("IOCTL_DISK_GET_DRIVE_GEOMETRY failed with error code %d.\n"), err); dg.BytesPerSector = 512; geom_ok = 0; } @@ -1164,12 +1164,12 @@ static BOOL GetDevicePropertyFromName(const TCHAR *DevicePath, DWORD Index, DWOR gli_ok = 1; if (!DeviceIoControl (hDevice, IOCTL_DISK_GET_LENGTH_INFO, NULL, 0, (void*)&gli, sizeof (gli), &returnedLength, NULL)) { gli_ok = 0; - write_log (L"IOCTL_DISK_GET_LENGTH_INFO failed with error code %d.\n", GetLastError()); + write_log (_T("IOCTL_DISK_GET_LENGTH_INFO failed with error code %d.\n"), GetLastError()); if (!nosp) - write_log (L"IOCTL_DISK_GET_LENGTH_INFO not supported, detected disk size may not be correct.\n"); + write_log (_T("IOCTL_DISK_GET_LENGTH_INFO not supported, detected disk size may not be correct.\n")); } if (geom_ok == 0 && gli_ok == 0) { - write_log (L"Can't detect size of device\n"); + write_log (_T("Can't detect size of device\n")); ret = 1; goto end; } @@ -1178,23 +1178,23 @@ static BOOL GetDevicePropertyFromName(const TCHAR *DevicePath, DWORD Index, DWOR if (geom_ok) { udi->bytespersector = dg.BytesPerSector; if (dg.BytesPerSector < 512) { - write_log (L"unsupported blocksize < 512 (%d)\n", dg.BytesPerSector); + write_log (_T("unsupported blocksize < 512 (%d)\n"), dg.BytesPerSector); ret = 1; goto end; } if (dg.BytesPerSector > 2048) { - write_log (L"unsupported blocksize > 2048 (%d)\n", dg.BytesPerSector); + write_log (_T("unsupported blocksize > 2048 (%d)\n"), dg.BytesPerSector); ret = 1; goto end; } - write_log (L"BPS=%d Cyls=%I64d TPC=%d SPT=%d MediaType=%d\n", + write_log (_T("BPS=%d Cyls=%I64d TPC=%d SPT=%d MediaType=%d\n"), dg.BytesPerSector, dg.Cylinders.QuadPart, dg.TracksPerCylinder, dg.SectorsPerTrack, dg.MediaType); udi->size = (uae_u64)dg.BytesPerSector * (uae_u64)dg.Cylinders.QuadPart * (uae_u64)dg.TracksPerCylinder * (uae_u64)dg.SectorsPerTrack; } if (gli_ok) udi->size = gli.Length.QuadPart; - write_log (L"device size %I64d (0x%I64x) bytes\n", udi->size, udi->size); + write_log (_T("device size %I64d (0x%I64x) bytes\n"), udi->size, udi->size); trim (orgname); memset (outBuf, 0, sizeof (outBuf)); @@ -1202,7 +1202,7 @@ static BOOL GetDevicePropertyFromName(const TCHAR *DevicePath, DWORD Index, DWOR &outBuf, sizeof (outBuf), &returnedLength, NULL); if (!status) { DWORD err = GetLastError(); - write_log (L"IOCTL_DISK_GET_DRIVE_LAYOUT failed with error code %d.\n", err); + write_log (_T("IOCTL_DISK_GET_DRIVE_LAYOUT failed with error code %d.\n"), err); if (err != ERROR_INVALID_FUNCTION) { ret = 1; goto end; @@ -1215,28 +1215,28 @@ static BOOL GetDevicePropertyFromName(const TCHAR *DevicePath, DWORD Index, DWOR int nonzeropart = 0; int gotpart = 0; int safepart = 0; - write_log (L"%d MBR partitions found\n", dli->PartitionCount); + write_log (_T("%d MBR partitions found\n"), dli->PartitionCount); for (i = 0; i < dli->PartitionCount && (*index2) < MAX_FILESYSTEM_UNITS; i++) { PARTITION_INFORMATION *pi = &dli->PartitionEntry[i]; if (pi->PartitionType == PARTITION_ENTRY_UNUSED) continue; - write_log (L"%d: num: %d type: %02X offset: %I64d size: %I64d, ", i, + write_log (_T("%d: num: %d type: %02X offset: %I64d size: %I64d, "), i, pi->PartitionNumber, pi->PartitionType, pi->StartingOffset.QuadPart, pi->PartitionLength.QuadPart); if (pi->RecognizedPartition == 0) { - write_log (L"unrecognized\n"); + write_log (_T("unrecognized\n")); continue; } nonzeropart++; if (pi->PartitionType != 0x76 && pi->PartitionType != 0x30) { - write_log (L"type not 0x76 or 0x30\n"); + write_log (_T("type not 0x76 or 0x30\n")); continue; } memmove (udi, udi2, sizeof (*udi)); udi->device_name[0] = 0; udi->offset = pi->StartingOffset.QuadPart; udi->size = pi->PartitionLength.QuadPart; - write_log (L"used\n"); - _stprintf (udi->device_name, L":P#%d_%s", pi->PartitionNumber, orgname); + write_log (_T("used\n")); + _stprintf (udi->device_name, _T(":P#%d_%s"), pi->PartitionNumber, orgname); udi->dangerous = -5; udi++; (*index2)++; @@ -1244,14 +1244,14 @@ static BOOL GetDevicePropertyFromName(const TCHAR *DevicePath, DWORD Index, DWOR gotpart = 1; } if (!nonzeropart) { - write_log (L"empty MBR partition table detected, checking for RDB\n"); + write_log (_T("empty MBR partition table detected, checking for RDB\n")); } else if (!gotpart) { - write_log (L"non-empty MBR partition table detected, doing RDB check anyway\n"); + write_log (_T("non-empty MBR partition table detected, doing RDB check anyway\n")); } else if (safepart) { goto amipartfound; /* ugly but bleh.. */ } } else { - write_log (L"no MBR partition table detected, checking for RDB\n"); + write_log (_T("no MBR partition table detected, checking for RDB\n")); } if (udi->offset == 0) { udi->dangerous = safetycheck (hDevice, udi->device_path, 0, buffer, dg.BytesPerSector); @@ -1259,7 +1259,7 @@ static BOOL GetDevicePropertyFromName(const TCHAR *DevicePath, DWORD Index, DWOR goto end; } amipartfound: - _stprintf (udi->device_name, L":%s", orgname); + _stprintf (udi->device_name, _T(":%s"), orgname); { int cnt = 1; int off = _tcslen (udi->device_name); @@ -1321,7 +1321,7 @@ static BOOL GetDeviceProperty(HDEVINFO IntDevInfo, DWORD Index, DWORD *index2, u if (status == FALSE) { errorCode = GetLastError(); if (errorCode != ERROR_NO_MORE_ITEMS) { - write_log (L"SetupDiEnumDeviceInterfaces failed with error: %d\n", errorCode); + write_log (_T("SetupDiEnumDeviceInterfaces failed with error: %d\n"), errorCode); } ret = 0; goto end; @@ -1349,7 +1349,7 @@ static BOOL GetDeviceProperty(HDEVINFO IntDevInfo, DWORD Index, DWORD *index2, u if (status == FALSE) { errorCode = GetLastError(); if (errorCode != ERROR_INSUFFICIENT_BUFFER) { - write_log (L"SetupDiGetDeviceInterfaceDetail failed with error: %d\n", errorCode); + write_log (_T("SetupDiGetDeviceInterfaceDetail failed with error: %d\n"), errorCode); ret = 0; goto end; } @@ -1363,7 +1363,7 @@ static BOOL GetDeviceProperty(HDEVINFO IntDevInfo, DWORD Index, DWORD *index2, u interfaceDetailDataSize = reqSize; interfaceDetailData = (PSP_DEVICE_INTERFACE_DETAIL_DATA)xmalloc (uae_u8, interfaceDetailDataSize); if (interfaceDetailData == NULL) { - write_log (L"Unable to allocate memory to get the interface detail data.\n"); + write_log (_T("Unable to allocate memory to get the interface detail data.\n")); ret = 0; goto end; } @@ -1378,7 +1378,7 @@ static BOOL GetDeviceProperty(HDEVINFO IntDevInfo, DWORD Index, DWORD *index2, u NULL); // Interface device info if (status == FALSE) { - write_log (L"Error in SetupDiGetDeviceInterfaceDetail failed with error: %d\n", GetLastError()); + write_log (_T("Error in SetupDiGetDeviceInterfaceDetail failed with error: %d\n"), GetLastError()); ret = 0; goto end; } @@ -1435,10 +1435,10 @@ static int hdf_init2 (int force) if((dwDriveMask & 1) && (drive >= 'C' || usefloppydrives)) { TCHAR tmp1[20], tmp2[20]; DWORD drivetype; - _stprintf (tmp1, L"%c:\\", drive); + _stprintf (tmp1, _T("%c:\\"), drive); drivetype = GetDriveType (tmp1); if (drivetype != DRIVE_REMOTE) { - _stprintf (tmp2, L"\\\\.\\%c:", drive); + _stprintf (tmp2, _T("\\\\.\\%c:"), drive); GetDevicePropertyFromName (tmp2, index, &index2, buffer, 1); num_drives = index2; } @@ -1460,7 +1460,7 @@ static int hdf_init2 (int force) VirtualFree (buffer, 0, MEM_RELEASE); } num_drives = index2; - write_log (L"Drive scan result: %d drives detected\n", num_drives); + write_log (_T("Drive scan result: %d drives detected\n"), num_drives); #endif return num_drives; } @@ -1481,50 +1481,50 @@ TCHAR *hdf_getnameharddrive (int index, int flags, int *sectorsize, int *dangero TCHAR tmp[32]; uae_u64 size = uae_drives[index].size; int nomedia = uae_drives[index].nomedia; - TCHAR *dang = L"?"; - TCHAR *rw = L"RW"; + TCHAR *dang = _T("?"); + TCHAR *rw = _T("RW"); if (dangerousdrive) *dangerousdrive = 0; switch (uae_drives[index].dangerous) { case -5: - dang = L"[PART]"; + dang = _T("[PART]"); break; case -6: - dang = L"[MBR]"; + dang = _T("[MBR]"); break; case -7: - dang = L"[!]"; + dang = _T("[!]"); break; case -8: - dang = L"[UNK]"; + dang = _T("[UNK]"); break; case -9: - dang = L"[EMPTY]"; + dang = _T("[EMPTY]"); break; case -3: - dang = L"(CPRM)"; + dang = _T("(CPRM)"); break; case -2: - dang = L"(SRAM)"; + dang = _T("(SRAM)"); break; case -1: - dang = L"(RDB)"; + dang = _T("(RDB)"); break; case 0: - dang = L"[OS]"; + dang = _T("[OS]"); if (dangerousdrive) *dangerousdrive |= 1; break; } if (nomedia) { - dang = L"[NO MEDIA]"; + dang = _T("[NO MEDIA]"); if (dangerousdrive) *dangerousdrive &= ~1; } if (uae_drives[index].readonly) { - rw = L"RO"; + rw = _T("RO"); if (dangerousdrive && !nomedia) *dangerousdrive |= 2; } @@ -1533,16 +1533,16 @@ TCHAR *hdf_getnameharddrive (int index, int flags, int *sectorsize, int *dangero *sectorsize = uae_drives[index].bytespersector; if (flags & 1) { if (nomedia) { - _tcscpy (tmp, L"N/A"); + _tcscpy (tmp, _T("N/A")); } else { if (size >= 1024 * 1024 * 1024) - _stprintf (tmp, L"%.1fG", ((double)(uae_u32)(size / (1024 * 1024))) / 1024.0); + _stprintf (tmp, _T("%.1fG"), ((double)(uae_u32)(size / (1024 * 1024))) / 1024.0); else if (size < 10 * 1024 * 1024) - _stprintf (tmp, L"%dK", size / 1024); + _stprintf (tmp, _T("%dK"), size / 1024); else - _stprintf (tmp, L"%.1fM", ((double)(uae_u32)(size / (1024))) / 1024.0); + _stprintf (tmp, _T("%.1fM"), ((double)(uae_u32)(size / (1024))) / 1024.0); } - _stprintf (name, L"%10s [%s,%s] %s", dang, tmp, rw, uae_drives[index].device_name + 1); + _stprintf (name, _T("%10s [%s,%s] %s"), dang, tmp, rw, uae_drives[index].device_name + 1); return name; } if (flags & 2) @@ -1558,7 +1558,7 @@ static int hmc (struct hardfiledata *hfd) while (hfd->handle_valid) { DWORD errormode; - write_log (L"testing if %s has media inserted\n", hfd->emptyname); + write_log (_T("testing if %s has media inserted\n"), hfd->emptyname); status = 0; errormode = SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOOPENFILEERRORBOX); SetFilePointer (hfd->handle->h, 0, NULL, FILE_BEGIN); @@ -1567,14 +1567,14 @@ static int hmc (struct hardfiledata *hfd) SetErrorMode(errormode); if (ret) { if (got == hfd->blocksize) { - write_log (L"read ok (%d)\n", got); + write_log (_T("read ok (%d)\n"), got); } else { - write_log (L"read ok but no data (%d)\n", hfd->blocksize); + write_log (_T("read ok but no data (%d)\n"), hfd->blocksize); ret = 0; err = 0; } } else { - write_log (L"=%d\n", err); + write_log (_T("=%d\n"), err); } if (!ret && (err == ERROR_DEV_NOT_EXIST || err == ERROR_WRONG_DISK)) { if (!first) @@ -1596,7 +1596,7 @@ static int hmc (struct hardfiledata *hfd) status = -1; end: xfree (buf); - write_log (L"hmc returned %d\n", status); + write_log (_T("hmc returned %d\n"), status); return status; } @@ -1616,12 +1616,12 @@ static void hmc_check (struct hardfiledata *hfd, struct uaedev_config_info *uci, } if (hfd->emptyname && _tcslen (hfd->emptyname) >= 6 && drvname && _tcslen (drvname) == 3 && drvname[1] == ':' && drvname[2] == '\\' && !inserted) { /* drive letter check */ TCHAR tmp[10], *p; - _stprintf (tmp, L"\\\\.\\%c:", drvname[0]); + _stprintf (tmp, _T("\\\\.\\%c:"), drvname[0]); p = hfd->emptyname + _tcslen (hfd->emptyname) - 6; - write_log( L"workaround-remove test: '%s' and '%s'\n", p, drvname); + write_log( _T("workaround-remove test: '%s' and '%s'\n"), p, drvname); if (!_tcscmp (tmp, p)) { TCHAR *en = my_strdup (hfd->emptyname); - write_log (L"workaround-remove done\n"); + write_log (_T("workaround-remove done\n")); hdf_close (hfd); hfd->emptyname = en; hfd->drive_empty = 1; @@ -1633,9 +1633,9 @@ static void hmc_check (struct hardfiledata *hfd, struct uaedev_config_info *uci, if (hfd->drive_empty < 0 || !hfd->handle_valid) { int empty = hfd->drive_empty; int r; - //write_log (L"trying to open '%s' de=%d hv=%d\n", hfd->emptyname, hfd->drive_empty, hfd->handle_valid); + //write_log (_T("trying to open '%s' de=%d hv=%d\n"), hfd->emptyname, hfd->drive_empty, hfd->handle_valid); r = hdf_open (hfd, hfd->emptyname); - //write_log (L"=%d\n", r); + //write_log (_T("=%d\n"), r); if (!r) return; *reopen = 1; @@ -1684,7 +1684,7 @@ int win32_hardfile_media_change (const TCHAR *drvname, int inserted) } } - //write_log (L"win32_hardfile_media_change returned %d\n", gotinsert); + //write_log (_T("win32_hardfile_media_change returned %d\n"), gotinsert); return gotinsert; } @@ -1780,7 +1780,7 @@ int harddrive_to_hdf (HWND hDlg, struct uae_prefs *p, int idx) break; if (cnt > 0) { SendMessage (hwndprogress, PBM_SETPOS, (WPARAM)pct, 0); - _stprintf (tmp, L"%dM / %dM (%d%%)", (int)(written >> 20), (int)(size >> 20), pct); + _stprintf (tmp, _T("%dM / %dM (%d%%)"), (int)(written >> 20), (int)(size >> 20), pct); SendMessage (hwndprogresstxt, WM_SETTEXT, 0, (LPARAM)tmp); while (PeekMessage (&msg, hwnd, 0, 0, PM_REMOVE)) { if (!IsDialogMessage (hwnd, &msg)) { diff --git a/od-win32/ioport.cpp b/od-win32/ioport.cpp index 49e6b819..4583a808 100644 --- a/od-win32/ioport.cpp +++ b/od-win32/ioport.cpp @@ -52,7 +52,7 @@ int ioport_init (void) return initialized > 0 ? 1 : 0; #ifndef IOPORT_EMU - ioh = WIN32_LoadLibrary (L"tvicport.dll"); + ioh = WIN32_LoadLibrary (_T("tvicport.dll")); if (ioh) { for (;;) { pOpenTVicPort = (OPENTVICPORT)GetProcAddress (ioh, "OpenTVicPort"); @@ -61,25 +61,25 @@ int ioport_init (void) pReadPort = (READPORT)GetProcAddress (ioh, "ReadPort"); pWritePort = (WRITEPORT)GetProcAddress (ioh, "WritePort"); if (!pOpenTVicPort || !pCloseTVicPort || !pIsDriverOpened || !pReadPort || !pWritePort) { - write_log (L"IO: incompatible tvicport.dll\n"); + write_log (_T("IO: incompatible tvicport.dll\n")); break; } if (!pOpenTVicPort()) { - write_log (L"IO: tvicport.dll failed to initialize\n"); + write_log (_T("IO: tvicport.dll failed to initialize\n")); break; } if (!pIsDriverOpened()) { - write_log (L"IO: tvicport.dll failed to initialize!\n"); + write_log (_T("IO: tvicport.dll failed to initialize!\n")); pCloseTVicPort(); break; } initialized = 1; - write_log (L"IO: tvicport.dll initialized\n"); + write_log (_T("IO: tvicport.dll initialized\n")); return 1; } } FreeLibrary(ioh); - ioh = WIN32_LoadLibrary (L"winio.dll"); + ioh = WIN32_LoadLibrary (_T("winio.dll")); if (ioh) { for (;;) { pInitializeWinIo = (INITIALIZEWINIO)GetProcAddress (ioh, "InitializeWinIo"); @@ -87,23 +87,23 @@ int ioport_init (void) pGetPortVal = (GETPORTVAL)GetProcAddress (ioh, "GetPortVal"); pSetPortVal = (SETPORTVAL)GetProcAddress (ioh, "SetPortVal"); if (!pInitializeWinIo || !pShutdownWinIo || !pGetPortVal || !pSetPortVal) { - write_log (L"IO: incompatible winio.dll\n"); + write_log (_T("IO: incompatible winio.dll\n")); break; } __try { initialized = pInitializeWinIo() ? 2 : 0; } __except (EXCEPTION_EXECUTE_HANDLER) { - write_log (L"IO: winio.dll initialization failed\n"); + write_log (_T("IO: winio.dll initialization failed\n")); } if (!initialized) break; - write_log (L"IO: winio.dll initialized\n"); + write_log (_T("IO: winio.dll initialized\n")); return 1; } } FreeLibrary(ioh); initialized = -1; - write_log (L"IO: tvicport.dll or winio.dll failed to initialize\n"); + write_log (_T("IO: tvicport.dll or winio.dll failed to initialize\n")); return 0; #else initialized = 1; @@ -191,9 +191,9 @@ int paraport_init (void) HANDLE pp; paraport_free (); - para = WIN32_LoadLibrary(L"ParaPort.dll"); + para = WIN32_LoadLibrary(_T("ParaPort.dll")); if (!para) { - write_log (L"PARAPORT: no ParaPort.dll, direct parallel port emulation disabled\n"); + write_log (_T("PARAPORT: no ParaPort.dll, direct parallel port emulation disabled\n")); return 0; } pp_closeport = (closePort)GetProcAddress (para, "closePort"); @@ -201,10 +201,10 @@ int paraport_init (void) pp_getportinfo = (getPortInfo)GetProcAddress (para, "getPortInfo"); pp_openport = (openPort)GetProcAddress (para, "openPort"); if (!pp_openport || !pp_closeport || !pp_executecycle) { - write_log (L"PARAPORT: GetProcAddress() failed\n"); + write_log (_T("PARAPORT: GetProcAddress() failed\n")); paraport_free (); } - write_log (L"PARAPORT:"); + write_log (_T("PARAPORT:")); for (i = 0; i < 4 ; i++) { char tmp[10]; sprintf (tmp, "LPT%d", i + 1); @@ -216,8 +216,8 @@ int paraport_init (void) pp = 0; } if (!mask) - write_log (L"no parallel ports detected"); - write_log (L"\n"); + write_log (_T("no parallel ports detected")); + write_log (_T("\n")); return mask; } @@ -235,17 +235,17 @@ int paraport_open (TCHAR *port) pport = pp_openport (port2); xfree (port2); if (!pport) { - write_log (L"PARAPORT: couldn't open '%s'\n", port); + write_log (_T("PARAPORT: couldn't open '%s'\n"), port); paraport_free (); return 0; } _tcscpy (oldport, port); - write_log (L"PARAPORT: port '%s' opened\n", port); + write_log (_T("PARAPORT: port '%s' opened\n"), port); memset (c, 0, sizeof (PARAPORT_CYCLE)); c[0].MaskControl = PARAPORT_MASK_CONTROL | PARAPORT_MASK_CONTROL_DIRECTION; c[0].Control = PARAPORT_MASK_CONTROL_INIT | PARAPORT_MASK_CONTROL_DIRECTION; if (!pp_executecycle (pport, c, 1)) { - write_log (L"PARAPORT: init executeCycle failed\n"); + write_log (_T("PARAPORT: init executeCycle failed\n")); } return 1; } @@ -261,20 +261,20 @@ int parallel_direct_write_status (uae_u8 v, uae_u8 dir) memset (c, 0, sizeof (PARAPORT_CYCLE)); c[0].MaskControl = PARAPORT_MASK_CONTROL_SELECTIN; if ((dir & 1)) { - write_log (L"PARAPORT: BUSY can't be output\n"); + write_log (_T("PARAPORT: BUSY can't be output\n")); ok = 0; } if ((dir & 2)) { - write_log (L"PARAPORT: POUT can't be output\n"); + write_log (_T("PARAPORT: POUT can't be output\n")); ok = 0; } if ((dir & 4) && !(v & 4)) c[0].Control |= PARAPORT_MASK_CONTROL_SELECTIN; if (!pp_executecycle (pport, c, 1)) { - write_log (L"PARAPORT: write executeCycle failed, CTL=%02X DIR=%02X\n", v & 7, dir & 7); + write_log (_T("PARAPORT: write executeCycle failed, CTL=%02X DIR=%02X\n"), v & 7, dir & 7); return 0; } - para_log (L"PARAPORT: write CTL=%02X DIR=%02X\n", v & 7, dir & 7); + para_log (_T("PARAPORT: write CTL=%02X DIR=%02X\n"), v & 7, dir & 7); return ok; } @@ -290,7 +290,7 @@ int parallel_direct_read_status (uae_u8 *vp) memset (c + 0, 0, sizeof (PARAPORT_CYCLE)); c[0].MaskStatus = PARAPORT_MASK_STATUS; if (!pp_executecycle (pport, c, 1)) { - write_log (L"PARAPORT: CTL read executeCycle failed\n"); + write_log (_T("PARAPORT: CTL read executeCycle failed\n")); return 0; } if (c[0].Status & PARAPORT_MASK_STATUS_SELECT) @@ -307,7 +307,7 @@ int parallel_direct_read_status (uae_u8 *vp) } else { oldack = 0; } - para_log (L"PARAPORT: read CTL=%02X\n", v); + para_log (_T("PARAPORT: read CTL=%02X\n"), v); v &= 7; *vp &= ~7; *vp |= v; @@ -322,7 +322,7 @@ int parallel_direct_write_data (uae_u8 v, uae_u8 dir) if (!pport) return 0; if (dir != 0xff) { - write_log (L"PARAPORT: unsupported mixed i/o attempted, DATA=%02X DIR=%02X, ignored\n", v, dir); + write_log (_T("PARAPORT: unsupported mixed i/o attempted, DATA=%02X DIR=%02X, ignored\n"), v, dir); return 0; } memset (c, 0, 3 * sizeof (PARAPORT_CYCLE)); @@ -337,10 +337,10 @@ int parallel_direct_write_data (uae_u8 v, uae_u8 dir) c[2].MaskControl = PARAPORT_MASK_CONTROL_STROBE; if (!pp_executecycle (pport, c, 3)) { - write_log (L"PARAPORT: write executeCycle failed, data=%02X\n", v); + write_log (_T("PARAPORT: write executeCycle failed, data=%02X\n"), v); return 0; } - para_log (L"PARAPORT: write DATA=%02X\n", v); + para_log (_T("PARAPORT: write DATA=%02X\n"), v); return 1; } @@ -364,11 +364,11 @@ int parallel_direct_read_data (uae_u8 *v) c[2].MaskControl = PARAPORT_MASK_CONTROL_STROBE; if (!pp_executecycle (pport, c, 3)) { - write_log (L"PARAPORT: DATA read executeCycle failed\n"); + write_log (_T("PARAPORT: DATA read executeCycle failed\n")); return 0; } *v = c[0].Data; - para_log (L"PARAPORT: read DATA=%02X\n", v); + para_log (_T("PARAPORT: read DATA=%02X\n"), v); return ok; } diff --git a/od-win32/keyboard_win32.cpp b/od-win32/keyboard_win32.cpp index d7f55f55..5db2a20a 100644 --- a/od-win32/keyboard_win32.cpp +++ b/od-win32/keyboard_win32.cpp @@ -421,7 +421,7 @@ void my_kbd_handler (int keyboard, int scancode, int newstate) if (scancode_new == currprefs.win32_guikey && scancode_new != defaultguikey) scancode = scancode_new; - //write_log (L"keyboard = %d scancode = 0x%02x state = %d\n", keyboard, scancode, newstate ); + //write_log (_T("keyboard = %d scancode = 0x%02x state = %d\n"), keyboard, scancode, newstate ); if (newstate && code == 0 && amode) { @@ -449,7 +449,7 @@ void my_kbd_handler (int keyboard, int scancode, int newstate) disk_prevnext (0, -1); return; //crap++; - //write_log (L"%d\n", crap); + //write_log (_T("%d\n"), crap); } #endif if (specialpressed ()) { diff --git a/od-win32/lcd.cpp b/od-win32/lcd.cpp index d4646bff..9ed112e5 100644 --- a/od-win32/lcd.cpp +++ b/od-win32/lcd.cpp @@ -44,25 +44,25 @@ static int lcd_init (void) ret = lgLcdInit (); if (ret != ERROR_SUCCESS) { if (ret == RPC_S_SERVER_UNAVAILABLE || ret == ERROR_OLD_WIN_VERSION) { - write_log (L"LCD: Logitech LCD system not detected\n"); + write_log (_T("LCD: Logitech LCD system not detected\n")); return 0; } - write_log (L"LCD: lgLcdInit() returned %d\n", ret); + write_log (_T("LCD: lgLcdInit() returned %d\n"), ret); return 0; } memset (&cctx, 0, sizeof (cctx)); - cctx.appFriendlyName = L"WinUAE"; + cctx.appFriendlyName = _T("WinUAE"); cctx.isPersistent = TRUE; cctx.isAutostartable = FALSE; ret = lgLcdConnect (&cctx); if (ret != ERROR_SUCCESS) { - write_log (L"LCD: lgLcdConnect() returned %d\n", ret); + write_log (_T("LCD: lgLcdConnect() returned %d\n"), ret); lcd_close (); return 0; } ret = lgLcdEnumerateEx (cctx.connection, 0, &desc); if (ret != ERROR_SUCCESS) { - write_log (L"LCD: lgLcdEnumerateEx() returned %d\n", ret); + write_log (_T("LCD: lgLcdEnumerateEx() returned %d\n"), ret); lcd_close (); return 0; } @@ -75,7 +75,7 @@ static int lcd_init (void) octx.index = 0; ret = lgLcdOpen (&octx); if (ret != ERROR_SUCCESS) { - write_log (L"LCD: lgLcdOpen() returned %d\n", ret); + write_log (_T("LCD: lgLcdOpen() returned %d\n"), ret); lcd_close (); return 0; } @@ -94,7 +94,7 @@ static int lcd_init (void) memcpy (origbitmap, bitmap, desc.Width * desc.Height); DeleteDC (dc); - write_log (L"LCD: '%s' enabled\n", desc.deviceDisplayName); + write_log (_T("LCD: '%s' enabled\n"), desc.deviceDisplayName); return 1; } diff --git a/od-win32/midi.cpp b/od-win32/midi.cpp index 31783d6e..1b00bd9e 100644 --- a/od-win32/midi.cpp +++ b/od-win32/midi.cpp @@ -133,7 +133,7 @@ static int MidiOut_Alloc(void) } outbufferselect = 0; } else { - write_log (L"MIDI: ERROR - MidiOutAlloc() called twice?\n"); + write_log (_T("MIDI: ERROR - MidiOutAlloc() called twice?\n")); } return out_allocated; } @@ -199,7 +199,7 @@ static int MidiOut_PrepareHeader(LPMIDIHDR out, LPSTR data, DWORD length) out->dwFlags = 0; if((result = midiOutPrepareHeader(outHandle, out, sizeof( MIDIHDR)))) { - write_log (L"MIDI: error %s / %d\n", getmidiouterr (err, result), result); + write_log (_T("MIDI: error %s / %d\n"), getmidiouterr (err, result), result); result = 0; } return result; @@ -264,7 +264,7 @@ static int MidiIn_Alloc(void) } } } else { - write_log (L"MIDI: ERROR - MidiInAlloc() called twice?\n"); + write_log (_T("MIDI: ERROR - MidiInAlloc() called twice?\n")); } return in_allocated; } @@ -311,7 +311,7 @@ static const uae_u8 plen[128] = { 1,1,2,1,0,0,0,0,0,0,0,0,0,0,0,0 }; -#define DBGOUT_MIDI_BYTE(x) TRACE((L"MIDI: 0x%02x\n", (x) )) +#define DBGOUT_MIDI_BYTE(x) TRACE((_T("MIDI: 0x%02x\n"), (x) )) /* * FUNCTION: Midi_Parse @@ -345,16 +345,16 @@ int Midi_Parse(midi_direction_e direction, BYTE *dataptr) switch(data) { case MIDI_CLOCK: - TRACE((L"MIDI: MIDI_CLOCK\n" )); + TRACE((_T("MIDI: MIDI_CLOCK\n") )); break; case MIDI_START: - TRACE((L"MIDI: MIDI_START\n" )); + TRACE((_T("MIDI: MIDI_START\n") )); break; case MIDI_CONTINUE: - TRACE((L"MIDI: MIDI_CONTINUE\n" )); + TRACE((_T("MIDI: MIDI_CONTINUE\n") )); break; case MIDI_STOP: - TRACE((L"MIDI: MIDI_STOP\n" )); + TRACE((_T("MIDI: MIDI_STOP\n") )); break; default: break; @@ -432,7 +432,7 @@ static long midi_inptr = 0, midi_inlast = 0; static void add1byte(DWORD_PTR w) //put 1 Byte to Midibuffer { if(midi_inlast >= BUFFLEN - 10) { - TRACE((L"add1byte buffer full %d %d (%02X)\n", midi_inlast, midi_inptr, w)); + TRACE((_T("add1byte buffer full %d %d (%02X)\n"), midi_inlast, midi_inptr, w)); return; } midibuf[midi_inlast++] = (uae_u8)w; @@ -440,7 +440,7 @@ static void add1byte(DWORD_PTR w) //put 1 Byte to Midibuffer static void add2byte(DWORD_PTR w) //put 2 Byte to Midibuffer { if(midi_inlast >= BUFFLEN - 10) { - TRACE((L"add2byte buffer full %d %d (%04X)\n", midi_inlast, midi_inptr, w)); + TRACE((_T("add2byte buffer full %d %d (%04X)\n"), midi_inlast, midi_inptr, w)); return; } midibuf[midi_inlast++] = (uae_u8)w; @@ -450,7 +450,7 @@ static void add2byte(DWORD_PTR w) //put 2 Byte to Midibuffer static void add3byte(DWORD_PTR w) //put 3 Byte to Midibuffer { if(midi_inlast >= BUFFLEN - 10) { - TRACE((L"add3byte buffer full %d %d (%08X)\n", midi_inlast, midi_inptr, w)); + TRACE((_T("add3byte buffer full %d %d (%08X)\n"), midi_inlast, midi_inptr, w)); return; } midibuf[midi_inlast++] = (uae_u8)w; @@ -479,7 +479,7 @@ LONG getmidibyte(void) //return midibyte or -1 if none gui_message(szMessage); overflow = 0; } - TRACE((L"getmidibyte(%02X)\n", midibuf[midi_inptr])); + TRACE((_T("getmidibyte(%02X)\n"), midibuf[midi_inptr])); if (midibuf[midi_inptr] >= 0xf0) { // only check for free buffers if status sysex for (i = 0;i < MIDI_INBUFFERS;i++) { if (midiin[i].dwFlags == (MHDR_DONE|MHDR_PREPARED)) { @@ -503,23 +503,23 @@ static void CALLBACK MidiInProc(HMIDIIN hMidiIn,UINT wMsg,DWORD_PTR dwInstance,D { EnterCriticalSection (&cs_proc); if(wMsg == MIM_ERROR) { - TRACE((L"MIDI Data Lost\n")); + TRACE((_T("MIDI Data Lost\n"))); } if(wMsg == MIM_LONGDATA) { LPMIDIHDR midiin = (LPMIDIHDR)dwParam1; - TRACE((L"MIM_LONGDATA bytes=%d ts=%u\n", midiin->dwBytesRecorded, dwParam2)); + TRACE((_T("MIM_LONGDATA bytes=%d ts=%u\n"), midiin->dwBytesRecorded, dwParam2)); if (exitin == 1) goto end; //for safeness midi want close if ((midi_inlast + midiin->dwBytesRecorded) >= (BUFFLEN-6)) { overflow = 1; - TRACE((L"MIDI overflow1\n")); + TRACE((_T("MIDI overflow1\n"))); //for safeness if buffer too full (should not occur) goto end; } if (midiin->dwBufferLength == midiin->dwBytesRecorded) { //for safeness if buffer too full (should not occur) overflow = 1; - TRACE((L"MIDI overflow2\n")); + TRACE((_T("MIDI overflow2\n"))); goto end; } memcpy(&midibuf[midi_inlast], midiin->lpData, midiin->dwBytesRecorded); @@ -528,7 +528,7 @@ static void CALLBACK MidiInProc(HMIDIIN hMidiIn,UINT wMsg,DWORD_PTR dwInstance,D if(wMsg == MM_MIM_DATA || wMsg == MM_MIM_MOREDATA) { BYTE state = (BYTE)dwParam1; - TRACE((L"%s %08X\n", wMsg == MM_MIM_DATA ? "MM_MIM_DATA" : "MM_MIM_MOREDATA", dwParam1)); + TRACE((_T("%s %08X\n"), wMsg == MM_MIM_DATA ? "MM_MIM_DATA" : "MM_MIM_MOREDATA", dwParam1)); if(state == 254) goto end; if(state < 0xf0) @@ -617,14 +617,14 @@ int Midi_Open(void) if (currprefs.win32_midioutdev < -1) return 0; if((result = midiOutOpen(&outHandle, currprefs.win32_midioutdev, 0, 0,CALLBACK_NULL))) { - write_log (L"MIDI OUT: error %s / %d while opening port %d\n", getmidiouterr(err, result), result, currprefs.win32_midioutdev); + write_log (_T("MIDI OUT: error %s / %d while opening port %d\n"), getmidiouterr(err, result), result, currprefs.win32_midioutdev); result = 0; } else { InitializeCriticalSection(&cs_proc); // We don't need input for output... if((currprefs.win32_midiindev >= 0) && (result = midiInOpen(&inHandle, currprefs.win32_midiindev, (DWORD_PTR)MidiInProc, 0, CALLBACK_FUNCTION|MIDI_IO_STATUS))) { - write_log (L"MIDI IN: error %s / %d while opening port %d\n", getmidiinerr(err, result), result, currprefs.win32_midiindev); + write_log (_T("MIDI IN: error %s / %d while opening port %d\n"), getmidiinerr(err, result), result, currprefs.win32_midiindev); } else { midi_in_ready = TRUE; result=midiInStart(inHandle); @@ -703,7 +703,7 @@ void Midi_Close(void) exitin = 0; } midi_ready = FALSE; - write_log (L"MIDI: closed.\n"); + write_log (_T("MIDI: closed.\n")); DeleteCriticalSection(&cs_proc); } } diff --git a/od-win32/mman.cpp b/od-win32/mman.cpp index 846d9cd6..2ea23b41 100644 --- a/od-win32/mman.cpp +++ b/od-win32/mman.cpp @@ -98,7 +98,7 @@ int mman_GetWriteWatch (PVOID lpBaseAddress, SIZE_T dwRegionSize, PVOID *lpAddre void mman_ResetWatch (PVOID lpBaseAddress, SIZE_T dwRegionSize) { if (ResetWriteWatch (lpBaseAddress, dwRegionSize)) - write_log (L"ResetWriteWatch() failed, %d\n", GetLastError ()); + write_log (_T("ResetWriteWatch() failed, %d\n"), GetLastError ()); } static uae_u64 size64; @@ -130,7 +130,7 @@ void preinit_shm (void) GlobalMemoryStatus(&memstats); totalphys64 = memstats.dwTotalPhys; total64 = (uae_u64)memstats.dwAvailPageFile + (uae_u64)memstats.dwTotalPhys; - pGlobalMemoryStatusEx = (GLOBALMEMORYSTATUSEX)GetProcAddress (GetModuleHandle (L"kernel32.dll"), "GlobalMemoryStatusEx"); + pGlobalMemoryStatusEx = (GLOBALMEMORYSTATUSEX)GetProcAddress (GetModuleHandle (_T("kernel32.dll")), "GlobalMemoryStatusEx"); if (pGlobalMemoryStatusEx) { memstatsex.dwLength = sizeof (MEMORYSTATUSEX); if (pGlobalMemoryStatusEx(&memstatsex)) { @@ -167,7 +167,7 @@ void preinit_shm (void) shmids[i].name[0] = 0; } - write_log (L"Max Z3FastRAM %dM. Total physical RAM %uM\n", max_z3fastmem >> 20, totalphys64 >> 20); + write_log (_T("Max Z3FastRAM %dM. Total physical RAM %uM\n"), max_z3fastmem >> 20, totalphys64 >> 20); canbang = 1; } @@ -190,9 +190,9 @@ static void resetmem (void) shmaddr = natmem_offset + ((uae_u8*)s->attached - (uae_u8*)s->natmembase); result = virtualallocwithlock (shmaddr, size, MEM_COMMIT, s->mode); if (result != shmaddr) - write_log (L"NATMEM: realloc(%p,%d,%d) failed, err=%x\n", shmaddr, size, s->mode, GetLastError ()); + write_log (_T("NATMEM: realloc(%p,%d,%d) failed, err=%x\n"), shmaddr, size, s->mode, GetLastError ()); else - write_log (L"NATMEM: rellocated(%p,%d,%s)\n", shmaddr, size, s->name); + write_log (_T("NATMEM: rellocated(%p,%d,%s)\n"), shmaddr, size, s->name); } } @@ -217,7 +217,7 @@ restart: int lowround = 0; uae_u8 *blah = NULL; if (rounds > 0) - write_log (L"NATMEM: retrying %d..\n", rounds); + write_log (_T("NATMEM: retrying %d..\n"), rounds); rounds++; if (natmem_offset) VirtualFree (natmem_offset, 0, MEM_RELEASE); @@ -247,11 +247,11 @@ restart: int change = lowmem (); if (!change) return 0; - write_log (L"NATMEM: %d, %dM > %dM = %dM\n", ++lowround, totalsize >> 20, size64 >> 20, (totalsize - change) >> 20); + write_log (_T("NATMEM: %d, %dM > %dM = %dM\n"), ++lowround, totalsize >> 20, size64 >> 20, (totalsize - change) >> 20); totalsize -= change; } if ((rounds > 1 && totalsize < 0x10000000) || rounds > 20) { - write_log (L"NATMEM: No special area could be allocated (3)!\n"); + write_log (_T("NATMEM: No special area could be allocated (3)!\n")); return 0; } natmemsize = size + z3size; @@ -267,10 +267,10 @@ restart: natmem_offset = blah; break; } - write_log (L"NATMEM: %dM area failed to allocate, err=%d (Z3=%dM,RTG=%dM)\n", + write_log (_T("NATMEM: %dM area failed to allocate, err=%d (Z3=%dM,RTG=%dM)\n"), natmemsize >> 20, GetLastError (), (currprefs.z3fastmem_size + currprefs.z3fastmem2_size + currprefs.z3chipmem_size) >> 20, z3rtgmem_size >> 20); if (!lowmem ()) { - write_log (L"NATMEM: No special area could be allocated (2)!\n"); + write_log (_T("NATMEM: No special area could be allocated (2)!\n")); return 0; } } @@ -278,7 +278,7 @@ restart: if (currprefs.rtgmem_size && currprefs.rtgmem_type) { VirtualFree (natmem_offset, 0, MEM_RELEASE); if (!VirtualAlloc (natmem_offset, natmemsize + rtgbarrier + z3chipbarrier, MEM_RESERVE, PAGE_READWRITE)) { - write_log (L"VirtualAlloc() part 2 error %d. RTG disabled.\n", GetLastError ()); + write_log (_T("VirtualAlloc() part 2 error %d. RTG disabled.\n"), GetLastError ()); currprefs.rtgmem_size = changed_prefs.rtgmem_size = 0; rtgbarrier = si.dwPageSize; rtgextra = 0; @@ -289,14 +289,14 @@ restart: if (!p96mem_offset) { currprefs.rtgmem_size = changed_prefs.rtgmem_size = 0; z3rtgmem_size = 0; - write_log (L"NATMEM: failed to allocate special Picasso96 GFX RAM, err=%d\n", GetLastError ()); + write_log (_T("NATMEM: failed to allocate special Picasso96 GFX RAM, err=%d\n"), GetLastError ()); } } else if (currprefs.rtgmem_size && !currprefs.rtgmem_type) { // This so annoying.. VirtualFree (natmem_offset, 0, MEM_RELEASE); // Chip + Z2Fast if (!VirtualAlloc (natmem_offset, 2 * 1024 * 1024 + currprefs.fastmem_size, MEM_RESERVE, PAGE_READWRITE)) { - write_log (L"VirtualAlloc() part 2 error %d. RTG disabled.\n", GetLastError ()); + write_log (_T("VirtualAlloc() part 2 error %d. RTG disabled.\n"), GetLastError ()); currprefs.rtgmem_size = changed_prefs.rtgmem_size = 0; rtgbarrier = si.dwPageSize; rtgextra = 0; @@ -305,7 +305,7 @@ restart: // After RTG if (!VirtualAlloc (natmem_offset + 2 * 1024 * 1024 + 8 * 1024 * 1024, natmemsize + rtgbarrier + z3chipbarrier - (2 * 1024 * 1024 + 8 * 1024 * 1024) + si.dwPageSize, MEM_RESERVE, PAGE_READWRITE)) { - write_log (L"VirtualAlloc() part 2 error %d. RTG disabled.\n", GetLastError ()); + write_log (_T("VirtualAlloc() part 2 error %d. RTG disabled.\n"), GetLastError ()); currprefs.rtgmem_size = changed_prefs.rtgmem_size = 0; rtgbarrier = si.dwPageSize; rtgextra = 0; @@ -316,18 +316,18 @@ restart: MEM_RESERVE | MEM_WRITE_WATCH, PAGE_READWRITE); if (!p96mem_offset) { currprefs.rtgmem_size = changed_prefs.rtgmem_size = 0; - write_log (L"NATMEM: failed to allocate special Picasso96 GFX RAM, err=%d\n", GetLastError ()); + write_log (_T("NATMEM: failed to allocate special Picasso96 GFX RAM, err=%d\n"), GetLastError ()); } } if (!natmem_offset) { - write_log (L"NATMEM: No special area could be allocated! (1) err=%d\n", GetLastError ()); + write_log (_T("NATMEM: No special area could be allocated! (1) err=%d\n"), GetLastError ()); } else { - write_log (L"NATMEM: Our special area: 0x%p-0x%p (%08x %dM)\n", + write_log (_T("NATMEM: Our special area: 0x%p-0x%p (%08x %dM)\n"), natmem_offset, (uae_u8*)natmem_offset + natmemsize, natmemsize, natmemsize >> 20); if (currprefs.rtgmem_size) - write_log (L"NATMEM: P96 special area: 0x%p-0x%p (%08x %dM)\n", + write_log (_T("NATMEM: P96 special area: 0x%p-0x%p (%08x %dM)\n"), p96mem_offset, (uae_u8*)p96mem_offset + currprefs.rtgmem_size, currprefs.rtgmem_size, currprefs.rtgmem_size >> 20); canbang = 1; @@ -422,40 +422,40 @@ void *shmat (int shmid, void *shmaddr, int shmflg) return shmids[shmid].attached; if ((uae_u8*)shmaddr < natmem_offset) { - if(!_tcscmp (shmids[shmid].name, L"chip")) { + if(!_tcscmp (shmids[shmid].name, _T("chip"))) { shmaddr=natmem_offset; got = TRUE; if (getz2endaddr () <= 2 * 1024 * 1024 || currprefs.chipmem_size < 2 * 1024 * 1024) size += BARRIER; } - if(!_tcscmp (shmids[shmid].name, L"kick")) { + if(!_tcscmp (shmids[shmid].name, _T("kick"))) { shmaddr=natmem_offset + 0xf80000; got = TRUE; size += BARRIER; } - if(!_tcscmp (shmids[shmid].name, L"rom_a8")) { + if(!_tcscmp (shmids[shmid].name, _T("rom_a8"))) { shmaddr=natmem_offset + 0xa80000; got = TRUE; } - if(!_tcscmp (shmids[shmid].name, L"rom_e0")) { + if(!_tcscmp (shmids[shmid].name, _T("rom_e0"))) { shmaddr=natmem_offset + 0xe00000; got = TRUE; } - if(!_tcscmp (shmids[shmid].name, L"rom_f0")) { + if(!_tcscmp (shmids[shmid].name, _T("rom_f0"))) { shmaddr=natmem_offset + 0xf00000; got = TRUE; } - if(!_tcscmp (shmids[shmid].name, L"rtarea")) { + if(!_tcscmp (shmids[shmid].name, _T("rtarea"))) { shmaddr=natmem_offset + rtarea_base; got = TRUE; } - if(!_tcscmp (shmids[shmid].name, L"fast")) { + if(!_tcscmp (shmids[shmid].name, _T("fast"))) { shmaddr=natmem_offset + 0x200000; got = TRUE; if (!(currprefs.rtgmem_size && !currprefs.rtgmem_type)) size += BARRIER; } - if(!_tcscmp (shmids[shmid].name, L"z2_gfx")) { + if(!_tcscmp (shmids[shmid].name, _T("z2_gfx"))) { ULONG start = getz2rtgaddr (); got = TRUE; p96special = TRUE; @@ -464,44 +464,44 @@ void *shmat (int shmid, void *shmaddr, int shmflg) if (start + currprefs.rtgmem_size < 10 * 1024 * 1024) size += BARRIER; } - if(!_tcscmp (shmids[shmid].name, L"ramsey_low")) { + if(!_tcscmp (shmids[shmid].name, _T("ramsey_low"))) { shmaddr=natmem_offset + a3000lmem_start; got = TRUE; } - if(!_tcscmp (shmids[shmid].name, L"ramsey_high")) { + if(!_tcscmp (shmids[shmid].name, _T("ramsey_high"))) { shmaddr=natmem_offset + a3000hmem_start; got = TRUE; } - if(!_tcscmp (shmids[shmid].name, L"z3")) { + if(!_tcscmp (shmids[shmid].name, _T("z3"))) { shmaddr=natmem_offset + z3fastmem_start; if (!currprefs.z3fastmem2_size) size += BARRIER; got = TRUE; } - if(!_tcscmp (shmids[shmid].name, L"z3_2")) { + if(!_tcscmp (shmids[shmid].name, _T("z3_2"))) { shmaddr=natmem_offset + z3fastmem_start + currprefs.z3fastmem_size; size += BARRIER; got = TRUE; } - if(!_tcscmp (shmids[shmid].name, L"z3_chip")) { + if(!_tcscmp (shmids[shmid].name, _T("z3_chip"))) { shmaddr=natmem_offset + z3chipmem_start; size += BARRIER; got = TRUE; } - if(!_tcscmp (shmids[shmid].name, L"z3_gfx")) { + if(!_tcscmp (shmids[shmid].name, _T("z3_gfx"))) { got = TRUE; p96special = TRUE; p96ram_start = p96mem_offset - natmem_offset; shmaddr = natmem_offset + p96ram_start; size += BARRIER; } - if(!_tcscmp (shmids[shmid].name, L"bogo")) { + if(!_tcscmp (shmids[shmid].name, _T("bogo"))) { shmaddr=natmem_offset+0x00C00000; got = TRUE; if (currprefs.bogomem_size <= 0x100000) size += BARRIER; } - if(!_tcscmp (shmids[shmid].name, L"filesys")) { + if(!_tcscmp (shmids[shmid].name, _T("filesys"))) { static uae_u8 *filesysptr; if (filesysptr == NULL) filesysptr = xcalloc (uae_u8, size); @@ -509,60 +509,60 @@ void *shmat (int shmid, void *shmaddr, int shmflg) shmids[shmid].attached = result; return result; } - if(!_tcscmp (shmids[shmid].name, L"custmem1")) { + if(!_tcscmp (shmids[shmid].name, _T("custmem1"))) { shmaddr=natmem_offset + currprefs.custom_memory_addrs[0]; got = TRUE; } - if(!_tcscmp (shmids[shmid].name, L"custmem2")) { + if(!_tcscmp (shmids[shmid].name, _T("custmem2"))) { shmaddr=natmem_offset + currprefs.custom_memory_addrs[1]; got = TRUE; } - if(!_tcscmp (shmids[shmid].name, L"hrtmem")) { + if(!_tcscmp (shmids[shmid].name, _T("hrtmem"))) { shmaddr=natmem_offset + 0x00a10000; got = TRUE; } - if(!_tcscmp (shmids[shmid].name, L"arhrtmon")) { + if(!_tcscmp (shmids[shmid].name, _T("arhrtmon"))) { shmaddr=natmem_offset + 0x00800000; size += BARRIER; got = TRUE; } - if(!_tcscmp (shmids[shmid].name, L"xpower_e2")) { + if(!_tcscmp (shmids[shmid].name, _T("xpower_e2"))) { shmaddr=natmem_offset + 0x00e20000; size += BARRIER; got = TRUE; } - if(!_tcscmp (shmids[shmid].name, L"xpower_f2")) { + if(!_tcscmp (shmids[shmid].name, _T("xpower_f2"))) { shmaddr=natmem_offset + 0x00f20000; size += BARRIER; got = TRUE; } - if(!_tcscmp (shmids[shmid].name, L"nordic_f0")) { + if(!_tcscmp (shmids[shmid].name, _T("nordic_f0"))) { shmaddr=natmem_offset + 0x00f00000; size += BARRIER; got = TRUE; } - if(!_tcscmp (shmids[shmid].name, L"nordic_f4")) { + if(!_tcscmp (shmids[shmid].name, _T("nordic_f4"))) { shmaddr=natmem_offset + 0x00f40000; size += BARRIER; got = TRUE; } - if(!_tcscmp (shmids[shmid].name, L"nordic_f6")) { + if(!_tcscmp (shmids[shmid].name, _T("nordic_f6"))) { shmaddr=natmem_offset + 0x00f60000; size += BARRIER; got = TRUE; } - if(!_tcscmp(shmids[shmid].name, L"superiv_b0")) { + if(!_tcscmp(shmids[shmid].name, _T("superiv_b0"))) { shmaddr=natmem_offset + 0x00b00000; size += BARRIER; got = TRUE; } - if(!_tcscmp (shmids[shmid].name, L"superiv_d0")) { + if(!_tcscmp (shmids[shmid].name, _T("superiv_d0"))) { shmaddr=natmem_offset + 0x00d00000; size += BARRIER; got = TRUE; } - if(!_tcscmp (shmids[shmid].name, L"superiv_e0")) { + if(!_tcscmp (shmids[shmid].name, _T("superiv_e0"))) { shmaddr=natmem_offset + 0x00e00000; size += BARRIER; got = TRUE; @@ -581,14 +581,14 @@ void *shmat (int shmid, void *shmaddr, int shmflg) result = virtualallocwithlock (shmaddr, size, MEM_COMMIT, protect); if (result == NULL) { result = (void*)-1; - write_log (L"VirtualAlloc %08X - %08X %x (%dk) failed %d\n", + write_log (_T("VirtualAlloc %08X - %08X %x (%dk) failed %d\n"), (uae_u8*)shmaddr - natmem_offset, (uae_u8*)shmaddr - natmem_offset + size, size, size >> 10, GetLastError ()); } else { shmids[shmid].attached = result; - write_log (L"VirtualAlloc %08X - %08X %x (%dk) ok (%08X)%s\n", + write_log (_T("VirtualAlloc %08X - %08X %x (%dk) ok (%08X)%s\n"), (uae_u8*)shmaddr - natmem_offset, (uae_u8*)shmaddr - natmem_offset + size, - size, size >> 10, shmaddr, p96special ? L" P96" : L""); + size, size >> 10, shmaddr, p96special ? _T(" P96") : _T("")); } } return result; @@ -604,7 +604,7 @@ int shmget (key_t key, size_t size, int shmflg, const TCHAR *name) int result = -1; if((key == IPC_PRIVATE) || ((shmflg & IPC_CREAT) && (find_shmkey (key) == -1))) { - write_log (L"shmget of size %d (%dk) for %s\n", size, size >> 10, name); + write_log (_T("shmget of size %d (%dk) for %s\n"), size, size >> 10, name); if ((result = get_next_shmkey ()) != -1) { shmids[result].size = size; _tcscpy (shmids[result].name, name); diff --git a/od-win32/mp3decoder.cpp b/od-win32/mp3decoder.cpp index 5b1b6590..edf27355 100644 --- a/od-win32/mp3decoder.cpp +++ b/od-win32/mp3decoder.cpp @@ -94,7 +94,7 @@ mp3decoder::mp3decoder() LocalFree(mp3format); LocalFree(waveFormat); if (mmr != MMSYSERR_NOERROR) { - write_log(L"MP3: couldn't open ACM mp3 decoder, %d\n", mmr); + write_log(_T("MP3: couldn't open ACM mp3 decoder, %d\n"), mmr); throw exception(); } } @@ -109,10 +109,10 @@ uae_u8 *mp3decoder::get (struct zfile *zf, uae_u8 *outbuf, int maxsize) ACMSTREAMHEADER mp3streamHead; HACMSTREAM h = (HACMSTREAM)g_mp3stream; - write_log(L"MP3: decoding '%s'..\n", zfile_getname(zf)); + write_log(_T("MP3: decoding '%s'..\n"), zfile_getname(zf)); mmr = acmStreamSize(h, MP3_BLOCK_SIZE, &rawbufsize, ACM_STREAMSIZEF_SOURCE); if (mmr != MMSYSERR_NOERROR) { - write_log (L"MP3: acmStreamSize, %d\n", mmr); + write_log (_T("MP3: acmStreamSize, %d\n"), mmr); return NULL; } // allocate our I/O buffers @@ -128,7 +128,7 @@ uae_u8 *mp3decoder::get (struct zfile *zf, uae_u8 *outbuf, int maxsize) mp3streamHead.cbDstLength = rawbufsize; mmr = acmStreamPrepareHeader(h, &mp3streamHead, 0); if (mmr != MMSYSERR_NOERROR) { - write_log(L"MP3: acmStreamPrepareHeader, %d\n", mmr); + write_log(_T("MP3: acmStreamPrepareHeader, %d\n"), mmr); return NULL; } zfile_fseek(zf, 0, SEEK_SET); @@ -139,7 +139,7 @@ uae_u8 *mp3decoder::get (struct zfile *zf, uae_u8 *outbuf, int maxsize) // convert the data mmr = acmStreamConvert(h, &mp3streamHead, ACM_STREAMCONVERTF_BLOCKALIGN); if (mmr != MMSYSERR_NOERROR) { - write_log(L"MP3: acmStreamConvert, %d\n", mmr); + write_log(_T("MP3: acmStreamConvert, %d\n"), mmr); return NULL; } if (outoffset + mp3streamHead.cbDstLengthUsed > maxsize) @@ -150,7 +150,7 @@ uae_u8 *mp3decoder::get (struct zfile *zf, uae_u8 *outbuf, int maxsize) acmStreamUnprepareHeader(h, &mp3streamHead, 0); LocalFree(rawbuf); LocalFree(mp3buf); - write_log(L"MP3: unpacked size %d bytes\n", outoffset); + write_log(_T("MP3: unpacked size %d bytes\n"), outoffset); return outbuf; } @@ -232,7 +232,7 @@ uae_u32 mp3decoder::getsize (struct zfile *zf) ver = (header[1] >> 3) & 3; if (ver == 1) { - write_log (L"MP3: ver==1?!\n"); + write_log (_T("MP3: ver==1?!\n")); return 0; } if (ver == 0) @@ -243,14 +243,14 @@ uae_u32 mp3decoder::getsize (struct zfile *zf) ver = 0; layer = 4 - ((header[1] >> 1) & 3); if (layer == 4) { - write_log (L"MP3: layer==4?!\n"); + write_log (_T("MP3: layer==4?!\n")); return 0; } iscrc = ((header[1] >> 0) & 1) ? 0 : 2; bitrateidx = (header[2] >> 4) & 15; freq = mp3_frequencies[(header[2] >> 2) & 3]; if (!freq) { - write_log (L"MP3: reserved frequency?!\n"); + write_log (_T("MP3: reserved frequency?!\n")); return 0; } channelmode = (header[3] >> 6) & 3; @@ -265,14 +265,14 @@ uae_u32 mp3decoder::getsize (struct zfile *zf) } bitrate = mp3_bitrates[bitindex * 16 + bitrateidx] * 1000; if (bitrate <= 0) { - write_log (L"MP3: reserved bitrate?!\n"); + write_log (_T("MP3: reserved bitrate?!\n")); return 0; } padding = (header[2] >> 1) & 1; samplerate = mp3_samplesperframe[(layer - 1) * 3 + ver]; framelen = ((samplerate / 8 * bitrate) / freq) + padding; if (framelen <= 4) { - write_log (L"MP3: too small frame size?!\n"); + write_log (_T("MP3: too small frame size?!\n")); return 0; } zfile_fseek(zf, framelen - 4, SEEK_CUR); diff --git a/od-win32/opengl.cpp b/od-win32/opengl.cpp index 2621f301..698581be 100644 --- a/od-win32/opengl.cpp +++ b/od-win32/opengl.cpp @@ -67,7 +67,7 @@ static void testerror (TCHAR *s) GLint err = glGetError(); if (err == 0) return; - write_log (L"OpenGL error %d (%s)\n", err, s); + write_log (_T("OpenGL error %d (%s)\n"), err, s); } } @@ -169,12 +169,12 @@ static int InitMultisample(HDC hDC, PIXELFORMATDESCRIPTOR *pfd) if (valid && numFormats >= 1) { arbMultisampleSupported = i; arbMultisampleFormat = pixelFormat; - write_log (L"OPENGL: max FSAA = %d\n", i); + write_log (_T("OPENGL: max FSAA = %d\n"), i); return arbMultisampleSupported; } } // Return The Valid Format - write_log (L"OPENGL: no FSAA support detected\n"); + write_log (_T("OPENGL: no FSAA support detected\n")); return arbMultisampleSupported; } #endif @@ -188,7 +188,7 @@ const TCHAR *OGL_init (HWND ahwnd, int w_w, int w_h, int t_w, int t_h, int depth ogl_enabled = 0; if (currprefs.gfx_filter != UAE_FILTER_OPENGL) { - _tcscpy (errmsg, L"OPENGL: not enabled"); + _tcscpy (errmsg, _T("OPENGL: not enabled")); return errmsg; } @@ -202,7 +202,7 @@ const TCHAR *OGL_init (HWND ahwnd, int w_w, int w_h, int t_w, int t_h, int depth total_textures = 2; if (isfullscreen() > 0 && WIN32GFX_GetDepth (TRUE) < 15) { - _tcscpy (errmsg, L"OPENGL: display depth must be at least 15 bit"); + _tcscpy (errmsg, _T("OPENGL: display depth must be at least 15 bit")); return errmsg; } @@ -220,7 +220,7 @@ const TCHAR *OGL_init (HWND ahwnd, int w_w, int w_h, int t_w, int t_h, int depth if (!arbMultisampleSupported) { PixelFormat = ChoosePixelFormat (openglhdc, &pfd); // Find A Compatible Pixel Format if (PixelFormat == 0) { // Did We Find A Compatible Format? - _tcscpy (errmsg, L"OPENGL: can't find suitable pixelformat"); + _tcscpy (errmsg, _T("OPENGL: can't find suitable pixelformat")); return errmsg; } } else { @@ -228,17 +228,17 @@ const TCHAR *OGL_init (HWND ahwnd, int w_w, int w_h, int t_w, int t_h, int depth } if (!SetPixelFormat (openglhdc, PixelFormat, &pfd)) { - _stprintf (errmsg, L"OPENGL: can't set pixelformat %x", PixelFormat); + _stprintf (errmsg, _T("OPENGL: can't set pixelformat %x"), PixelFormat); return errmsg; } if (!(hrc = wglCreateContext (openglhdc))) { - _tcscpy (errmsg, L"OPENGL: can't create gl rendering context"); + _tcscpy (errmsg, _T("OPENGL: can't create gl rendering context")); return errmsg; } if (!wglMakeCurrent (openglhdc, hrc)) { - _tcscpy (errmsg, L"OPENGL: can't activate gl rendering context"); + _tcscpy (errmsg, _T("OPENGL: can't activate gl rendering context")); return errmsg; } #ifdef FSAA @@ -256,28 +256,28 @@ const TCHAR *OGL_init (HWND ahwnd, int w_w, int w_h, int t_w, int t_h, int depth glGetIntegerv (GL_MAX_TEXTURE_SIZE, &max_texture_size); required_texture_size = 2 << exact_log2 (t_width > t_height ? t_width : t_height); if (max_texture_size < t_width || max_texture_size < t_height) { - _stprintf (errmsg, L"OPENGL: %d * %d or bigger texture support required\nYour gfx card's maximum texture size is only %d * %d", + _stprintf (errmsg, _T("OPENGL: %d * %d or bigger texture support required\nYour gfx card's maximum texture size is only %d * %d"), required_texture_size, required_texture_size, max_texture_size, max_texture_size); return errmsg; } required_sl_texture_size = 2 << exact_log2 (w_width > w_height ? w_width : w_height); if (currprefs.gfx_filter_scanlines > 0 && (max_texture_size < w_width || max_texture_size < w_height)) { - gui_message (L"OPENGL: %d * %d or bigger texture support required for scanlines (max is only %d * %d)\n" - L"Scanlines disabled.", + gui_message (_T("OPENGL: %d * %d or bigger texture support required for scanlines (max is only %d * %d)\n") + _T("Scanlines disabled."), required_sl_texture_size, required_sl_texture_size, max_texture_size, max_texture_size); changed_prefs.gfx_filter_scanlines = currprefs.gfx_filter_scanlines = 0; } ext1 = glGetString (GL_EXTENSIONS); if (!init) - write_log (L"OpenGL extensions: %s\n", ext1); + write_log (_T("OpenGL extensions: %s\n"), ext1); if (strstr (ext1, "EXT_packed_pixels")) packed_pixels = 1; if (strstr (ext1, "WGL_EXT_swap_control")) { wglSwapIntervalEXT = (PFNWGLSWAPINTERVALEXTPROC)wglGetProcAddress ("wglSwapIntervalEXT"); wglGetSwapIntervalEXT = (PFNWGLGETSWAPINTERVALEXTPROC)wglGetProcAddress ("wglGetSwapIntervalEXT"); if (!wglGetSwapIntervalEXT || !wglSwapIntervalEXT) { - write_log (L"OPENGL: WGL_EXT_swap_control extension found but no wglGetSwapIntervalEXT or wglSwapIntervalEXT found!?\n"); + write_log (_T("OPENGL: WGL_EXT_swap_control extension found but no wglGetSwapIntervalEXT or wglSwapIntervalEXT found!?\n")); wglSwapIntervalEXT = 0; wglGetSwapIntervalEXT = 0; } @@ -290,8 +290,8 @@ const TCHAR *OGL_init (HWND ahwnd, int w_w, int w_h, int t_w, int t_h, int depth ti2d_type = -1; if (depth == 15 || depth == 16) { if (!packed_pixels) { - _stprintf (errmsg, L"OPENGL: can't use 15/16 bit screen depths because\n" - L"EXT_packed_pixels extension was not found."); + _stprintf (errmsg, _T("OPENGL: can't use 15/16 bit screen depths because\n") + _T("EXT_packed_pixels extension was not found.")); OGL_free (); return errmsg; } @@ -310,7 +310,7 @@ const TCHAR *OGL_init (HWND ahwnd, int w_w, int w_h, int t_w, int t_h, int depth } } if (ti2d_type < 0) { - _stprintf (errmsg, L"OPENGL: Only 15, 16 or 32 bit screen depths supported (was %d)", depth); + _stprintf (errmsg, _T("OPENGL: Only 15, 16 or 32 bit screen depths supported (was %d)"), depth); OGL_free (); return errmsg; } @@ -338,7 +338,7 @@ const TCHAR *OGL_init (HWND ahwnd, int w_w, int w_h, int t_w, int t_h, int depth OGL_refresh (); init = 1; - write_log (L"OPENGL: using texture depth %d texture size %d * %d scanline texture size %d * %d\n", + write_log (_T("OPENGL: using texture depth %d texture size %d * %d scanline texture size %d * %d\n"), depth, required_texture_size, required_texture_size, required_sl_texture_size, required_sl_texture_size); return 0; } @@ -472,7 +472,7 @@ static void OGL_dorender (int newtex) float dw, dh; getfilterrect2 (&dr, &sr, &zr, w_width, w_height, t_width, t_height, 1, t_width, t_height); -// write_log (L"(%d %d %d %d) - (%d %d %d %d) (%d %d)\n", +// write_log (_T("(%d %d %d %d) - (%d %d %d %d) (%d %d)\n"), // dr.left, dr.top, dr.right, dr.bottom, sr.left, sr.top, sr.right, sr.bottom, zr.left, zr.top); dw = dr.right - dr.left; dh = dr.bottom - dr.top; @@ -481,7 +481,7 @@ static void OGL_dorender (int newtex) multx = dw * t_width / w_width; multy = dh * t_height / w_height; -// write_log (L"%fx%f\n", multx, multy); +// write_log (_T("%fx%f\n"), multx, multy); x1 = -0.5f + dw * t_width / w_width / 2 - zr.left - sr.left; y1 = 0.5f + dh * t_height / w_height / 2 - zr.top - (t_height - 2 * zr.top - h) + sr.top; diff --git a/od-win32/parser.cpp b/od-win32/parser.cpp index e5cbb7fa..fab2388f 100644 --- a/od-win32/parser.cpp +++ b/od-win32/parser.cpp @@ -129,8 +129,8 @@ static void freepsbuffers (void) static int openprinter_ps (void) { TCHAR *gsargv[] = { - L"-dNOPAUSE", L"-dBATCH", L"-dNOPAGEPROMPT", L"-dNOPROMPT", L"-dQUIET", L"-dNoCancel", - L"-sDEVICE=mswinpr2", NULL + _T("-dNOPAUSE"), _T("-dBATCH"), _T("-dNOPAGEPROMPT"), _T("-dNOPROMPT"), _T("-dQUIET"), _T("-dNoCancel"), + _T("-sDEVICE=mswinpr2"), NULL }; int gsargc, gsargc2, i; TCHAR *tmpparms[100]; @@ -142,20 +142,20 @@ static int openprinter_ps (void) cmdlineparser (currprefs.ghostscript_parameters, tmpparms, 100 - 10); gsargc2 = 0; - gsparms[gsargc2++] = ua (L"WinUAE"); + gsparms[gsargc2++] = ua (_T("WinUAE")); for (gsargc = 0; gsargv[gsargc]; gsargc++) { gsparms[gsargc2++] = ua (gsargv[gsargc]); } for (i = 0; tmpparms[i]; i++) gsparms[gsargc2++] = ua (tmpparms[i]); if (currprefs.prtname[0]) { - _stprintf (tmp, L"-sOutputFile=%%printer%%%s", currprefs.prtname); + _stprintf (tmp, _T("-sOutputFile=%%printer%%%s"), currprefs.prtname); gsparms[gsargc2++] = ua (tmp); } if (postscript_print_debugging) { for (i = 0; i < gsargc2; i++) { TCHAR *parm = au (gsparms[i]); - write_log (L"GSPARM%d: '%s'\n", i, parm); + write_log (_T("GSPARM%d: '%s'\n"), i, parm); xfree (parm); } } @@ -165,12 +165,12 @@ static int openprinter_ps (void) xfree (gsparms[i]); } if (rc != 0) { - write_log (L"GS failed, returncode %d\n", rc); + write_log (_T("GS failed, returncode %d\n"), rc); return 0; } ptr_gsapi_run_string_begin (gsinstance, 0, &gs_exitcode); } __except (ExceptionFilter (GetExceptionInformation (), GetExceptionCode ())) { - write_log (L"GS crashed\n"); + write_log (_T("GS crashed\n")); return 0; } psmode = 1; @@ -188,14 +188,14 @@ static void *prt_thread (void *p) SetThreadPriority (GetCurrentThread (), THREAD_PRIORITY_BELOW_NORMAL); if (load_ghostscript ()) { if (openprinter_ps ()) { - write_log (L"PostScript printing emulation started..\n"); + write_log (_T("PostScript printing emulation started..\n")); cnt = 0; while (buffers[cnt]) { uae_u8 *p = buffers[cnt]; err = ptr_gsapi_run_string_continue (gsinstance, (char*)p + 2, (p[0] << 8) | p[1], 0, &gs_exitcode); if (err != e_NeedInput && err <= e_Fatal) { ptr_gsapi_exit (gsinstance); - write_log (L"PostScript parsing failed.\n"); + write_log (_T("PostScript parsing failed.\n")); ok = 0; break; } @@ -208,14 +208,14 @@ static void *prt_thread (void *p) } xfree (buffers); if (ok) { - write_log (L"PostScript printing emulation finished..\n"); + write_log (_T("PostScript printing emulation finished..\n")); ptr_gsapi_run_string_end (gsinstance, 0, &gs_exitcode); } } else { - write_log (L"gsdll32.dll failed to initialize\n"); + write_log (_T("gsdll32.dll failed to initialize\n")); } } else { - write_log (L"gsdll32.dll failed to load\n"); + write_log (_T("gsdll32.dll failed to load\n")); } unload_ghostscript (); prt_running--; @@ -226,7 +226,7 @@ static int doflushprinter (void) { if (prtopen == 0 && prtbufbytes < MIN_PRTBYTES) { if (prtbufbytes > 0) - write_log (L"PRINTER: %d bytes received, less than %d bytes, not printing.\n", prtbufbytes, MIN_PRTBYTES); + write_log (_T("PRINTER: %d bytes received, less than %d bytes, not printing.\n"), prtbufbytes, MIN_PRTBYTES); prtbufbytes = 0; return 0; } @@ -281,9 +281,9 @@ static void flushprtbuf (void) if (hPrt != INVALID_HANDLE_VALUE) { if (WritePrinter (hPrt, prtbuf, pbyt, &written)) { if (written != pbyt) - write_log (L"PRINTER: Only wrote %d of %d bytes!\n", written, pbyt); + write_log (_T("PRINTER: Only wrote %d of %d bytes!\n"), written, pbyt); } else { - write_log (L"PRINTER: Couldn't write data!\n"); + write_log (_T("PRINTER: Couldn't write data!\n")); } } } @@ -310,7 +310,7 @@ static void DoSomeWeirdPrintingStuff (uae_char val) *prtbuf = val; prtbufbytes = 1; flushprtbuf (); - write_log (L"PostScript end detected..\n"); + write_log (_T("PostScript end detected..\n")); if (postscript_print_debugging) { zfile_fclose (prtdump); @@ -319,7 +319,7 @@ static void DoSomeWeirdPrintingStuff (uae_char val) if (currprefs.parallel_postscript_emulation) { prt_started = 0; - if (uae_start_thread (L"postscript", prt_thread, psbuffer, NULL)) { + if (uae_start_thread (_T("postscript"), prt_thread, psbuffer, NULL)) { while (!prt_started) Sleep (5); psbuffers = 0; @@ -334,7 +334,7 @@ static void DoSomeWeirdPrintingStuff (uae_char val) } else if (!psmode && !stricmp (prev, "%!PS")) { if (postscript_print_debugging) - prtdump = zfile_fopen (L"psdump.dat", L"wb", 0); + prtdump = zfile_fopen (_T("psdump.dat"), _T("wb"), 0); psmode = 1; psbuffer = xmalloc (uae_u8*, 1); @@ -343,7 +343,7 @@ static void DoSomeWeirdPrintingStuff (uae_char val) strcpy (prtbuf, "%!PS"); prtbufbytes = strlen (prtbuf); flushprtbuf (); - write_log (L"PostScript start detected..\n"); + write_log (_T("PostScript start detected..\n")); return; } } @@ -360,7 +360,7 @@ int isprinter (void) { if (!currprefs.prtname[0]) return 0; - if (!_tcsncmp (currprefs.prtname, L"LPT", 3)) { + if (!_tcsncmp (currprefs.prtname, _T("LPT"), 3)) { paraport_open (currprefs.prtname); return -1; } @@ -382,17 +382,17 @@ int load_ghostscript (void) if (gsdll) return 1; - _tcscpy (path, L"gsdll32.dll"); + _tcscpy (path, _T("gsdll32.dll")); gsdll = WIN32_LoadLibrary (path); if (!gsdll) { - if (GetEnvironmentVariable (L"GS_DLL", path, sizeof (path) / sizeof (TCHAR))) + if (GetEnvironmentVariable (_T("GS_DLL"), path, sizeof (path) / sizeof (TCHAR))) gsdll = LoadLibrary (path); } if (!gsdll) { HKEY key; - DWORD ret = RegOpenKeyEx (HKEY_LOCAL_MACHINE, L"SOFTWARE\\AFPL Ghostscript", 0, KEY_READ, &key); + DWORD ret = RegOpenKeyEx (HKEY_LOCAL_MACHINE, _T("SOFTWARE\\AFPL Ghostscript"), 0, KEY_READ, &key); if (ret != ERROR_SUCCESS) - ret = RegOpenKeyEx (HKEY_LOCAL_MACHINE, L"SOFTWARE\\GPL Ghostscript", 0, KEY_READ, &key); + ret = RegOpenKeyEx (HKEY_LOCAL_MACHINE, _T("SOFTWARE\\GPL Ghostscript"), 0, KEY_READ, &key); if (ret == ERROR_SUCCESS) { int idx = 0, cnt = 20; TCHAR tmp1[MAX_DPATH]; @@ -404,7 +404,7 @@ int load_ghostscript (void) if (RegOpenKeyEx (key, tmp1, 0, KEY_READ, &key2) == ERROR_SUCCESS) { DWORD type = REG_SZ; DWORD size = sizeof (path) / sizeof (TCHAR); - if (RegQueryValueEx (key2, L"GS_DLL", 0, &type, (LPBYTE)path, &size) == ERROR_SUCCESS) { + if (RegQueryValueEx (key2, _T("GS_DLL"), 0, &type, (LPBYTE)path, &size) == ERROR_SUCCESS) { gsdll = LoadLibrary (path); } RegCloseKey (key2); @@ -422,12 +422,12 @@ int load_ghostscript (void) ptr_gsapi_revision = (GSAPI_REVISION)GetProcAddress (gsdll, "gsapi_revision"); if (!ptr_gsapi_revision) { unload_ghostscript (); - write_log (L"incompatible %s! (1)\n", path); + write_log (_T("incompatible %s! (1)\n"), path); return -1; } if (ptr_gsapi_revision(&r, sizeof(r))) { unload_ghostscript (); - write_log (L"incompatible %s! (2)\n", path); + write_log (_T("incompatible %s! (2)\n"), path); return -2; } ptr_gsapi_new_instance = (GSAPI_NEW_INSTANCE)GetProcAddress (gsdll, "gsapi_new_instance"); @@ -442,11 +442,11 @@ int load_ghostscript (void) !ptr_gsapi_run_string_begin || !ptr_gsapi_run_string_continue || !ptr_gsapi_run_string_end || !ptr_gsapi_init_with_args) { unload_ghostscript (); - write_log (L"incompatible %s! (3)\n", path); + write_log (_T("incompatible %s! (3)\n"), path); return -3; } s = au (r.product); - write_log (L"%s: %s rev %d initialized\n", path, s, r.revision); + write_log (_T("%s: %s rev %d initialized\n"), path, s, r.revision); xfree (s); return 1; } @@ -482,9 +482,9 @@ static void openprinter (void) flushprtbuf (); if (OpenPrinter (currprefs.prtname, &hPrt, NULL)) { // Fill in the structure with info about this "document." - DocInfo.pDocName = L"WinUAE Document"; + DocInfo.pDocName = _T("WinUAE Document"); DocInfo.pOutputFile = NULL; - DocInfo.pDatatype = (currprefs.parallel_matrix_emulation || currprefs.parallel_postscript_detection) ? L"TEXT" : L"RAW"; + DocInfo.pDatatype = (currprefs.parallel_matrix_emulation || currprefs.parallel_postscript_detection) ? _T("TEXT") : _T("RAW"); // Inform the spooler the document is beginning. if ((dwJob = StartDocPrinter (hPrt, 1, (LPBYTE)&DocInfo)) == 0) { ClosePrinter (hPrt ); @@ -497,9 +497,9 @@ static void openprinter (void) } } if (hPrt != INVALID_HANDLE_VALUE) { - write_log (L"PRINTER: Opening printer \"%s\" with handle 0x%x.\n", currprefs.prtname, hPrt); + write_log (_T("PRINTER: Opening printer \"%s\" with handle 0x%x.\n"), currprefs.prtname, hPrt); } else if (*currprefs.prtname) { - write_log (L"PRINTER: ERROR - Couldn't open printer \"%s\" for output.\n", currprefs.prtname); + write_log (_T("PRINTER: ERROR - Couldn't open printer \"%s\" for output.\n"), currprefs.prtname); } } @@ -523,14 +523,14 @@ void closeprinter (void) EndDocPrinter (hPrt); ClosePrinter (hPrt); hPrt = INVALID_HANDLE_VALUE; - write_log (L"PRINTER: Closing printer.\n"); + write_log (_T("PRINTER: Closing printer.\n")); } if (currprefs.parallel_postscript_emulation) prtopen = 1; else prtopen = 0; if (prt_running) { - write_log (L"waiting for printing to finish...\n"); + write_log (_T("waiting for printing to finish...\n")); while (prt_running) Sleep (10); } @@ -652,7 +652,7 @@ int uaeser_setparams (void *vsd, int baud, int rbuffer, int bits, int sbits, int //dcb.XonLim = 2048; if (!SetCommState (sd->hCom, &dcb)) { - write_log (L"uaeserial: SetCommState() failed %d\n", GetLastError()); + write_log (_T("uaeserial: SetCommState() failed %d\n"), GetLastError()); return 5; } SetupComm (sd->hCom, rbuffer, rbuffer); @@ -763,7 +763,7 @@ int uaeser_open (void *vsd, void *user, int unit) COMMTIMEOUTS CommTimeOuts; sd->user = user; - _stprintf (buf, L"\\\\.\\COM%d", unit); + _stprintf (buf, _T("\\\\.\\COM%d"), unit); sd->evtr = CreateEvent (NULL, TRUE, FALSE, NULL); sd->evtw = CreateEvent (NULL, TRUE, FALSE, NULL); sd->evtt = CreateEvent (NULL, FALSE, FALSE, NULL); @@ -776,17 +776,17 @@ int uaeser_open (void *vsd, void *user, int unit) sd->hCom = CreateFile (buf, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_OVERLAPPED, NULL); if (sd->hCom == INVALID_HANDLE_VALUE) { - _stprintf (buf, L"\\.\\\\COM%d", unit); + _stprintf (buf, _T("\\.\\\\COM%d"), unit); sd->hCom = CreateFile (buf, GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_OVERLAPPED, NULL); if (sd->hCom == INVALID_HANDLE_VALUE) { - write_log (L"UAESER: '%s' failed to open, err=%d\n", buf, GetLastError()); + write_log (_T("UAESER: '%s' failed to open, err=%d\n"), buf, GetLastError()); goto end; } } uae_sem_init (&sd->sync_sem, 0, 0); uae_sem_init (&sd->change_sem, 0, 1); - uae_start_thread (L"uaeserial_win32", uaeser_trap_thread, sd, NULL); + uae_start_thread (_T("uaeserial_win32"), uaeser_trap_thread, sd, NULL); uae_sem_wait (&sd->sync_sem); CommTimeOuts.ReadIntervalTimeout = 0; @@ -860,7 +860,7 @@ static bool tcp_is_connected (void) if (select (1, &fd, NULL, NULL, &tv)) { serialconn = accept (serialsocket, (struct sockaddr*)socketaddr, &sa_len); if (serialconn != INVALID_SOCKET) - write_log (L"SERIRAL_TCP: connection accepted\n"); + write_log (_T("SERIRAL_TCP: connection accepted\n")); } } return serialconn != INVALID_SOCKET; @@ -872,7 +872,7 @@ static void tcp_disconnect (void) return; closesocket (serialconn); serialconn = INVALID_SOCKET; - write_log (L"SERIAL_TCP: disconnect\n"); + write_log (_T("SERIAL_TCP: disconnect\n")); } static void closetcp (void) @@ -900,7 +900,7 @@ static int opentcp (const TCHAR *sername) if (WSAStartup (MAKEWORD (2, 2), &wsadata)) { DWORD lasterror = WSAGetLastError (); - write_log (L"SERIAL_TCP: can't open '%s', error %d\n", sername, lasterror); + write_log (_T("SERIAL_TCP: can't open '%s', error %d\n"), sername, lasterror); return 0; } name = my_strdup (sername); @@ -912,7 +912,7 @@ static int opentcp (const TCHAR *sername) const TCHAR *p2 = _tcschr (port, '/'); if (p2) { port[p2 - port] = 0; - if (!_tcsicmp (p2 + 1, L"wait")) + if (!_tcsicmp (p2 + 1, _T("wait"))) waitmode = true; } } @@ -921,42 +921,42 @@ static int opentcp (const TCHAR *sername) port = NULL; } if (!port) - port = my_strdup (L"1234"); + port = my_strdup (_T("1234")); err = GetAddrInfoW (name, port, NULL, &socketinfo); if (err < 0) { - write_log (L"SERIAL_TCP: GetAddrInfoW() failed, %s:%s: %d\n", name, port, WSAGetLastError ()); + write_log (_T("SERIAL_TCP: GetAddrInfoW() failed, %s:%s: %d\n"), name, port, WSAGetLastError ()); goto end; } serialsocket = socket (socketinfo->ai_family, socketinfo->ai_socktype, socketinfo->ai_protocol); if (serialsocket == INVALID_SOCKET) { - write_log(L"SERIAL_TCP: socket() failed, %s:%s: %d\n", name, port, WSAGetLastError ()); + write_log(_T("SERIAL_TCP: socket() failed, %s:%s: %d\n"), name, port, WSAGetLastError ()); goto end; } err = bind (serialsocket, socketinfo->ai_addr, socketinfo->ai_addrlen); if (err < 0) { - write_log(L"SERIAL_TCP: bind() failed, %s:%s: %d\n", name, port, WSAGetLastError ()); + write_log(_T("SERIAL_TCP: bind() failed, %s:%s: %d\n"), name, port, WSAGetLastError ()); goto end; } err = listen (serialsocket, 1); if (err < 0) { - write_log(L"SERIAL_TCP: listen() failed, %s:%s: %d\n", name, port, WSAGetLastError ()); + write_log(_T("SERIAL_TCP: listen() failed, %s:%s: %d\n"), name, port, WSAGetLastError ()); goto end; } err = setsockopt (serialsocket, SOL_SOCKET, SO_LINGER, (char*)&linger_1s, sizeof linger_1s); if (err < 0) { - write_log(L"SERIAL_TCP: setsockopt(SO_LINGER) failed, %s:%s: %d\n", name, port, WSAGetLastError ()); + write_log(_T("SERIAL_TCP: setsockopt(SO_LINGER) failed, %s:%s: %d\n"), name, port, WSAGetLastError ()); goto end; } err = setsockopt (serialsocket, SOL_SOCKET, SO_REUSEADDR, (char*)&one, sizeof one); if (err < 0) { - write_log(L"SERIAL_TCP: setsockopt(SO_REUSEADDR) failed, %s:%s: %d\n", name, port, WSAGetLastError ()); + write_log(_T("SERIAL_TCP: setsockopt(SO_REUSEADDR) failed, %s:%s: %d\n"), name, port, WSAGetLastError ()); goto end; } while (tcp_is_connected () == false) { Sleep (1000); - write_log (L"SERIAL_TCP: waiting for connect...\n"); + write_log (_T("SERIAL_TCP: waiting for connect...\n")); } xfree (port); @@ -974,21 +974,21 @@ int openser (const TCHAR *sername) { COMMTIMEOUTS CommTimeOuts; - if (!_tcsnicmp (sername, L"TCP://", 6)) { + if (!_tcsnicmp (sername, _T("TCP://"), 6)) { return opentcp (sername + 6); } - if (!_tcsnicmp (sername, L"TCP:", 4)) { + if (!_tcsnicmp (sername, _T("TCP:"), 4)) { return opentcp (sername + 4); } if (!(readevent = CreateEvent (NULL, TRUE, FALSE, NULL))) { - write_log (L"SERIAL: Failed to create r event!\n"); + write_log (_T("SERIAL: Failed to create r event!\n")); return 0; } readol.hEvent = readevent; if (!(writeevent = CreateEvent (NULL, TRUE, FALSE, NULL))) { - write_log (L"SERIAL: Failed to create w event!\n"); + write_log (_T("SERIAL: Failed to create w event!\n")); return 0; } SetEvent (writeevent); @@ -1003,7 +1003,7 @@ int openser (const TCHAR *sername) FILE_ATTRIBUTE_NORMAL | FILE_FLAG_OVERLAPPED, NULL); if (hCom == INVALID_HANDLE_VALUE) { - write_log (L"SERIAL: failed to open '%s' err=%d\n", sername, GetLastError()); + write_log (_T("SERIAL: failed to open '%s' err=%d\n"), sername, GetLastError()); closeser (); return 0; } @@ -1052,11 +1052,11 @@ int openser (const TCHAR *sername) //dcb.XonLim = 2048; if (SetCommState (hCom, &dcb)) { - write_log (L"SERIAL: Using %s CTS/RTS=%d\n", sername, currprefs.serial_hwctsrts); + write_log (_T("SERIAL: Using %s CTS/RTS=%d\n"), sername, currprefs.serial_hwctsrts); return 1; } - write_log (L"SERIAL: serial driver didn't accept new parameters\n"); + write_log (_T("SERIAL: serial driver didn't accept new parameters\n")); closeser(); return 0; } @@ -1116,7 +1116,7 @@ void writeser (int c) if (datainoutput + 1 < sizeof (outputbuffer)) { outputbuffer[datainoutput++] = c; } else { - write_log (L"serial output buffer overflow, data will be lost\n"); + write_log (_T("serial output buffer overflow, data will be lost\n")); datainoutput = 0; } outser (); @@ -1285,7 +1285,7 @@ int setbaud (long baud) /* MIDI baud-rate */ if (!midi_ready) { if (Midi_Open()) - write_log (L"Midi enabled\n"); + write_log (_T("Midi enabled\n")); } return 1; } else { @@ -1298,11 +1298,11 @@ int setbaud (long baud) if (GetCommState (hCom, &dcb)) { dcb.BaudRate = baud; if (!SetCommState (hCom, &dcb)) { - write_log (L"SERIAL: Error setting baud rate %d!\n", baud); + write_log (_T("SERIAL: Error setting baud rate %d!\n"), baud); return 0; } } else { - write_log (L"SERIAL: setbaud internal error!\n"); + write_log (_T("SERIAL: setbaud internal error!\n")); } } } @@ -1314,7 +1314,7 @@ void initparallel (void) if (uae_boot_rom) { uaecptr a = here (); //this install the ahisound org (rtarea_base + 0xFFC0); - calltrap (deftrapres (ahi_demux, 0, L"ahi_winuae")); + calltrap (deftrapres (ahi_demux, 0, _T("ahi_winuae"))); dw (RTS); org (a); init_ahi_v2 (); @@ -1426,27 +1426,27 @@ static int enumports_2 (struct serparportinfo **pi, int cnt, bool parport) pi[cnt] = xcalloc (struct serparportinfo, 1); pi[cnt]->dev = my_strdup (pDetData->DevicePath); pi[cnt]->name = my_strdup (fname); - p = _tcsstr (fname, parport ? L"(LPT" : L"(COM"); + p = _tcsstr (fname, parport ? _T("(LPT") : _T("(COM")); if (p && (p[5] == ')' || p[6] == ')')) { pi[cnt]->cfgname = xmalloc (TCHAR, 100); if (isdigit(p[5])) - _stprintf (pi[cnt]->cfgname, parport ? L"LPT%c%c" : L"COM%c%c", p[4], p[5]); + _stprintf (pi[cnt]->cfgname, parport ? _T("LPT%c%c") : _T("COM%c%c"), p[4], p[5]); else - _stprintf (pi[cnt]->cfgname, parport ? L"LPT%c" : L"COM%c", p[4]); + _stprintf (pi[cnt]->cfgname, parport ? _T("LPT%c") : _T("COM%c"), p[4]); } else { pi[cnt]->cfgname = my_strdup (pDetData->DevicePath); } - write_log (L"%s: '%s' = '%s' = '%s'\n", parport ? L"PARPORT" : L"SERPORT", pi[cnt]->name, pi[cnt]->cfgname, pi[cnt]->dev); + write_log (_T("%s: '%s' = '%s' = '%s'\n"), parport ? _T("PARPORT") : _T("SERPORT"), pi[cnt]->name, pi[cnt]->cfgname, pi[cnt]->dev); cnt++; } } else { - write_log (L"SetupDiGetDeviceInterfaceDetail failed, err=%d", GetLastError ()); + write_log (_T("SetupDiGetDeviceInterfaceDetail failed, err=%d"), GetLastError ()); goto end; } } else { DWORD err = GetLastError (); if (err != ERROR_NO_MORE_ITEMS) { - write_log (L"SetupDiEnumDeviceInterfaces failed, err=%d", err); + write_log (_T("SetupDiEnumDeviceInterfaces failed, err=%d"), err); goto end; } } @@ -1467,24 +1467,24 @@ int enumserialports (void) DWORD size = sizeof (COMMCONFIG); TCHAR devname[1000]; - write_log (L"Serial port enumeration..\n"); + write_log (_T("Serial port enumeration..\n")); cnt = 0; #ifdef SERIAL_ENET - comports[cnt].dev = my_strdup (L"ENET:H"); + comports[cnt].dev = my_strdup (_T("ENET:H")); comports[cnt].cfgname = my_strdup (comports[0].dev); - comports[cnt].name = my_strdup (L"NET (host)"); + comports[cnt].name = my_strdup (_T("NET (host)")); cnt++; - comports[cnt].dev = my_strdup (L"ENET:L"); + comports[cnt].dev = my_strdup (_T("ENET:L")); comports[cnt].cfgname = my_strdup (comports[1].dev); - comports[cnt].name = my_strdup (L"NET (client)"); + comports[cnt].name = my_strdup (_T("NET (client)")); cnt++; #endif cnt = enumports_2 (comports, cnt, false); j = 0; for (i = 0; i < 10; i++) { - _stprintf (name, L"COM%d", i); + _stprintf (name, _T("COM%d"), i); if (!QueryDosDevice (name, devname, sizeof devname / sizeof (TCHAR))) continue; for(j = 0; j < cnt; j++) { @@ -1496,10 +1496,10 @@ int enumserialports (void) break; comports[j] = xcalloc(struct serparportinfo, 1); comports[j]->dev = xmalloc (TCHAR, 100); - _stprintf (comports[cnt]->dev, L"\\.\\\\%s", name); + _stprintf (comports[cnt]->dev, _T("\\.\\\\%s"), name); comports[j]->cfgname = my_strdup (name); comports[j]->name = my_strdup (name); - write_log (L"SERPORT: %d:'%s' = '%s' (%s)\n", cnt, comports[j]->name, comports[j]->dev, devname); + write_log (_T("SERPORT: %d:'%s' = '%s' (%s)\n"), cnt, comports[j]->name, comports[j]->dev, devname); cnt++; j++; } @@ -1519,15 +1519,15 @@ int enumserialports (void) if (cnt < MAX_SERPAR_PORTS) { comports[cnt] = xcalloc(struct serparportinfo, 1); - comports[cnt]->dev = my_strdup (L"TCP://0.0.0.0:1234"); + comports[cnt]->dev = my_strdup (_T("TCP://0.0.0.0:1234")); comports[cnt]->cfgname = my_strdup (comports[cnt]->dev); comports[cnt]->name = my_strdup (comports[cnt]->dev); cnt++; } - write_log (L"Parallel port enumeration..\n"); + write_log (_T("Parallel port enumeration..\n")); enumports_2 (parports, 0, true); - write_log (L"Port enumeration end\n"); + write_log (_T("Port enumeration end\n")); return cnt; } @@ -1538,7 +1538,7 @@ int enummidiports (void) MIDIINCAPS midiInCaps; int i, j, num, total; - write_log (L"MIDI port enumeration..\n"); + write_log (_T("MIDI port enumeration..\n")); num = midiOutGetNumDevs (); for (i = 0; i < num + 1 && i < MAX_MIDI_PORTS - 1; i++) { MMRESULT r = midiOutGetDevCaps (i - 1, &midiOutCaps, sizeof (midiOutCaps)); @@ -1549,7 +1549,7 @@ int enummidiports (void) midioutportinfo[i] = xcalloc (struct midiportinfo, 1); midioutportinfo[i]->name = my_strdup (midiOutCaps.szPname); midioutportinfo[i]->devid = i - 1; - write_log (L"MIDI OUT: %d:'%s' (%d/%d)\n", midioutportinfo[i]->devid, midioutportinfo[i]->name, midiOutCaps.wMid, midiOutCaps.wPid); + write_log (_T("MIDI OUT: %d:'%s' (%d/%d)\n"), midioutportinfo[i]->devid, midioutportinfo[i]->name, midiOutCaps.wMid, midiOutCaps.wPid); } total = num + 1; for (i = 1; i < num + 1; i++) { @@ -1572,7 +1572,7 @@ int enummidiports (void) midiinportinfo[i] = xcalloc (struct midiportinfo, 1); midiinportinfo[i]->name = my_strdup (midiInCaps.szPname); midiinportinfo[i]->devid = i; - write_log (L"MIDI IN: %d:'%s' (%d/%d)\n", midiinportinfo[i]->devid, midiinportinfo[i]->name, midiInCaps.wMid, midiInCaps.wPid); + write_log (_T("MIDI IN: %d:'%s' (%d/%d)\n"), midiinportinfo[i]->devid, midiinportinfo[i]->name, midiInCaps.wMid, midiInCaps.wPid); } total += num; for (i = 0; i < num; i++) { @@ -1586,7 +1586,7 @@ int enummidiports (void) } } - write_log (L"MIDI port enumeration end\n"); + write_log (_T("MIDI port enumeration end\n")); return total; } @@ -1602,7 +1602,7 @@ void sernametodev (TCHAR *sername) return; } } - if (!_tcsncmp (sername, L"TCP:", 4)) + if (!_tcsncmp (sername, _T("TCP:"), 4)) return; sername[0] = 0; } @@ -1610,7 +1610,7 @@ void sernametodev (TCHAR *sername) void serdevtoname (TCHAR *sername) { int i; - if (!_tcsncmp (sername, L"TCP:", 4)) + if (!_tcsncmp (sername, _T("TCP:"), 4)) return; for (i = 0; i < MAX_SERPAR_PORTS && comports[i]; i++) { if (!_tcscmp (sername, comports[i]->dev)) { diff --git a/od-win32/picasso96_win.cpp b/od-win32/picasso96_win.cpp index a70f0bfe..44269bba 100644 --- a/od-win32/picasso96_win.cpp +++ b/od-win32/picasso96_win.cpp @@ -192,7 +192,7 @@ static void checkrtglibrary(void) WIN32GUI_LoadUIString(IDS_OLDRTGLIBRARY, msg, sizeof(msg)); gui_message(msg, ver, rev, UAE_RTG_LIBRARY_VERSION, UAE_RTG_LIBRARY_REVISION); } else { - write_log (L"P96: rtg.library %d.%d detected\n", ver, rev); + write_log (_T("P96: rtg.library %d.%d detected\n"), ver, rev); } checked = TRUE; } @@ -225,31 +225,31 @@ STATIC_INLINE void endianswap (uae_u32 *vp, int bpp) */ static void DumpModeInfoStructure (uaecptr amigamodeinfoptr) { - write_log (L"ModeInfo Structure Dump:\n"); - write_log (L" Node.ln_Succ = 0x%x\n", get_long (amigamodeinfoptr)); - write_log (L" Node.ln_Pred = 0x%x\n", get_long (amigamodeinfoptr + 4)); - write_log (L" Node.ln_Type = 0x%x\n", get_byte (amigamodeinfoptr + 8)); - write_log (L" Node.ln_Pri = %d\n", get_byte (amigamodeinfoptr + 9)); - /*write_log (L" Node.ln_Name = %s\n", uaememptr->Node.ln_Name); */ - write_log (L" OpenCount = %d\n", get_word (amigamodeinfoptr + PSSO_ModeInfo_OpenCount)); - write_log (L" Active = %d\n", get_byte (amigamodeinfoptr + PSSO_ModeInfo_Active)); - write_log (L" Width = %d\n", get_word (amigamodeinfoptr + PSSO_ModeInfo_Width)); - write_log (L" Height = %d\n", get_word (amigamodeinfoptr + PSSO_ModeInfo_Height)); - write_log (L" Depth = %d\n", get_byte (amigamodeinfoptr + PSSO_ModeInfo_Depth)); - write_log (L" Flags = %d\n", get_byte (amigamodeinfoptr + PSSO_ModeInfo_Flags)); - write_log (L" HorTotal = %d\n", get_word (amigamodeinfoptr + PSSO_ModeInfo_HorTotal)); - write_log (L" HorBlankSize = %d\n", get_word (amigamodeinfoptr + PSSO_ModeInfo_HorBlankSize)); - write_log (L" HorSyncStart = %d\n", get_word (amigamodeinfoptr + PSSO_ModeInfo_HorSyncStart)); - write_log (L" HorSyncSize = %d\n", get_word (amigamodeinfoptr + PSSO_ModeInfo_HorSyncSize)); - write_log (L" HorSyncSkew = %d\n", get_byte (amigamodeinfoptr + PSSO_ModeInfo_HorSyncSkew)); - write_log (L" HorEnableSkew = %d\n", get_byte (amigamodeinfoptr + PSSO_ModeInfo_HorEnableSkew)); - write_log (L" VerTotal = %d\n", get_word (amigamodeinfoptr + PSSO_ModeInfo_VerTotal)); - write_log (L" VerBlankSize = %d\n", get_word (amigamodeinfoptr + PSSO_ModeInfo_VerBlankSize)); - write_log (L" VerSyncStart = %d\n", get_word (amigamodeinfoptr + PSSO_ModeInfo_VerSyncStart)); - write_log (L" VerSyncSize = %d\n", get_word (amigamodeinfoptr + PSSO_ModeInfo_VerSyncSize)); - write_log (L" Clock = %d\n", get_byte (amigamodeinfoptr + PSSO_ModeInfo_first_union)); - write_log (L" ClockDivide = %d\n", get_byte (amigamodeinfoptr + PSSO_ModeInfo_second_union)); - write_log (L" PixelClock = %d\n", get_long (amigamodeinfoptr + PSSO_ModeInfo_PixelClock)); + write_log (_T("ModeInfo Structure Dump:\n")); + write_log (_T(" Node.ln_Succ = 0x%x\n"), get_long (amigamodeinfoptr)); + write_log (_T(" Node.ln_Pred = 0x%x\n"), get_long (amigamodeinfoptr + 4)); + write_log (_T(" Node.ln_Type = 0x%x\n"), get_byte (amigamodeinfoptr + 8)); + write_log (_T(" Node.ln_Pri = %d\n"), get_byte (amigamodeinfoptr + 9)); + /*write_log (_T(" Node.ln_Name = %s\n"), uaememptr->Node.ln_Name); */ + write_log (_T(" OpenCount = %d\n"), get_word (amigamodeinfoptr + PSSO_ModeInfo_OpenCount)); + write_log (_T(" Active = %d\n"), get_byte (amigamodeinfoptr + PSSO_ModeInfo_Active)); + write_log (_T(" Width = %d\n"), get_word (amigamodeinfoptr + PSSO_ModeInfo_Width)); + write_log (_T(" Height = %d\n"), get_word (amigamodeinfoptr + PSSO_ModeInfo_Height)); + write_log (_T(" Depth = %d\n"), get_byte (amigamodeinfoptr + PSSO_ModeInfo_Depth)); + write_log (_T(" Flags = %d\n"), get_byte (amigamodeinfoptr + PSSO_ModeInfo_Flags)); + write_log (_T(" HorTotal = %d\n"), get_word (amigamodeinfoptr + PSSO_ModeInfo_HorTotal)); + write_log (_T(" HorBlankSize = %d\n"), get_word (amigamodeinfoptr + PSSO_ModeInfo_HorBlankSize)); + write_log (_T(" HorSyncStart = %d\n"), get_word (amigamodeinfoptr + PSSO_ModeInfo_HorSyncStart)); + write_log (_T(" HorSyncSize = %d\n"), get_word (amigamodeinfoptr + PSSO_ModeInfo_HorSyncSize)); + write_log (_T(" HorSyncSkew = %d\n"), get_byte (amigamodeinfoptr + PSSO_ModeInfo_HorSyncSkew)); + write_log (_T(" HorEnableSkew = %d\n"), get_byte (amigamodeinfoptr + PSSO_ModeInfo_HorEnableSkew)); + write_log (_T(" VerTotal = %d\n"), get_word (amigamodeinfoptr + PSSO_ModeInfo_VerTotal)); + write_log (_T(" VerBlankSize = %d\n"), get_word (amigamodeinfoptr + PSSO_ModeInfo_VerBlankSize)); + write_log (_T(" VerSyncStart = %d\n"), get_word (amigamodeinfoptr + PSSO_ModeInfo_VerSyncStart)); + write_log (_T(" VerSyncSize = %d\n"), get_word (amigamodeinfoptr + PSSO_ModeInfo_VerSyncSize)); + write_log (_T(" Clock = %d\n"), get_byte (amigamodeinfoptr + PSSO_ModeInfo_first_union)); + write_log (_T(" ClockDivide = %d\n"), get_byte (amigamodeinfoptr + PSSO_ModeInfo_second_union)); + write_log (_T(" PixelClock = %d\n"), get_long (amigamodeinfoptr + PSSO_ModeInfo_PixelClock)); } static void DumpLibResolutionStructure (uaecptr amigalibresptr) @@ -258,23 +258,23 @@ static void DumpLibResolutionStructure (uaecptr amigalibresptr) uaecptr amigamodeinfoptr; struct LibResolution *uaememptr = (struct LibResolution *)get_mem_bank(amigalibresptr).xlateaddr(amigalibresptr); - write_log (L"LibResolution Structure Dump:\n"); + write_log (_T("LibResolution Structure Dump:\n")); if (get_long (amigalibresptr + PSSO_LibResolution_DisplayID) == 0xFFFFFFFF) { - write_log (L" Finished With LibResolutions...\n"); + write_log (_T(" Finished With LibResolutions...\n")); } else { - write_log (L" Name = %s\n", uaememptr->P96ID); - write_log (L" DisplayID = 0x%x\n", get_long (amigalibresptr + PSSO_LibResolution_DisplayID)); - write_log (L" Width = %d\n", get_word (amigalibresptr + PSSO_LibResolution_Width)); - write_log (L" Height = %d\n", get_word (amigalibresptr + PSSO_LibResolution_Height)); - write_log (L" Flags = %d\n", get_word (amigalibresptr + PSSO_LibResolution_Flags)); + write_log (_T(" Name = %s\n"), uaememptr->P96ID); + write_log (_T(" DisplayID = 0x%x\n"), get_long (amigalibresptr + PSSO_LibResolution_DisplayID)); + write_log (_T(" Width = %d\n"), get_word (amigalibresptr + PSSO_LibResolution_Width)); + write_log (_T(" Height = %d\n"), get_word (amigalibresptr + PSSO_LibResolution_Height)); + write_log (_T(" Flags = %d\n"), get_word (amigalibresptr + PSSO_LibResolution_Flags)); for (i = 0; i < MAXMODES; i++) { amigamodeinfoptr = get_long (amigalibresptr + PSSO_LibResolution_Modes + i*4); - write_log (L" ModeInfo[%d] = 0x%x\n", i, amigamodeinfoptr); + write_log (_T(" ModeInfo[%d] = 0x%x\n"), i, amigamodeinfoptr); if (amigamodeinfoptr) DumpModeInfoStructure (amigamodeinfoptr); } - write_log (L" BoardInfo = 0x%x\n", get_long (amigalibresptr + PSSO_LibResolution_BoardInfo)); + write_log (_T(" BoardInfo = 0x%x\n"), get_long (amigalibresptr + PSSO_LibResolution_BoardInfo)); } } @@ -296,9 +296,9 @@ static void DumpPattern (struct Pattern *patt) for (row = 0; row < (1 << patt->Size); row++) { mem = patt->Memory + row * 2; for (col = 0; col < 2; col++) { - write_log (L"%s ", BuildBinaryString (*mem++)); + write_log (_T("%s "), BuildBinaryString (*mem++)); } - write_log (L"\n"); + write_log (_T("\n")); } } @@ -307,35 +307,35 @@ static void DumpTemplate (struct Template *tmp, unsigned long w, unsigned long h uae_u8 *mem = tmp->Memory; unsigned int row, col, width; width = (w + 7) >> 3; - write_log (L"xoffset = %d, bpr = %d\n", tmp->XOffset, tmp->BytesPerRow); + write_log (_T("xoffset = %d, bpr = %d\n"), tmp->XOffset, tmp->BytesPerRow); for (row = 0; row < h; row++) { mem = tmp->Memory + row * tmp->BytesPerRow; for (col = 0; col < width; col++) { - write_log (L"%s ", BuildBinaryString (*mem++)); + write_log (_T("%s "), BuildBinaryString (*mem++)); } - write_log (L"\n"); + write_log (_T("\n")); } } static void DumpLine(struct Line *line) { if (line) { - write_log (L"Line->X = %d\n", line->X); - write_log (L"Line->Y = %d\n", line->Y); - write_log (L"Line->Length = %d\n", line->Length); - write_log (L"Line->dX = %d\n", line->dX); - write_log (L"Line->dY = %d\n", line->dY); - write_log (L"Line->sDelta = %d\n", line->sDelta); - write_log (L"Line->lDelta = %d\n", line->lDelta); - write_log (L"Line->twoSDminusLD = %d\n", line->twoSDminusLD); - write_log (L"Line->LinePtrn = %d\n", line->LinePtrn); - write_log (L"Line->PatternShift = %d\n", line->PatternShift); - write_log (L"Line->FgPen = 0x%x\n", line->FgPen); - write_log (L"Line->BgPen = 0x%x\n", line->BgPen); - write_log (L"Line->Horizontal = %d\n", line->Horizontal); - write_log (L"Line->DrawMode = %d\n", line->DrawMode); - write_log (L"Line->Xorigin = %d\n", line->Xorigin); - write_log (L"Line->Yorigin = %d\n", line->Yorigin); + write_log (_T("Line->X = %d\n"), line->X); + write_log (_T("Line->Y = %d\n"), line->Y); + write_log (_T("Line->Length = %d\n"), line->Length); + write_log (_T("Line->dX = %d\n"), line->dX); + write_log (_T("Line->dY = %d\n"), line->dY); + write_log (_T("Line->sDelta = %d\n"), line->sDelta); + write_log (_T("Line->lDelta = %d\n"), line->lDelta); + write_log (_T("Line->twoSDminusLD = %d\n"), line->twoSDminusLD); + write_log (_T("Line->LinePtrn = %d\n"), line->LinePtrn); + write_log (_T("Line->PatternShift = %d\n"), line->PatternShift); + write_log (_T("Line->FgPen = 0x%x\n"), line->FgPen); + write_log (_T("Line->BgPen = 0x%x\n"), line->BgPen); + write_log (_T("Line->Horizontal = %d\n"), line->Horizontal); + write_log (_T("Line->DrawMode = %d\n"), line->DrawMode); + write_log (_T("Line->Xorigin = %d\n"), line->Xorigin); + write_log (_T("Line->Yorigin = %d\n"), line->Yorigin); } } @@ -343,12 +343,12 @@ static void ShowSupportedResolutions (void) { int i = 0; - write_log (L"-----------------\n"); + write_log (_T("-----------------\n")); while (newmodes[i].depth >= 0) { - write_log (L"%s\n", newmodes[i].name); + write_log (_T("%s\n"), newmodes[i].name); i++; } - write_log (L"-----------------\n"); + write_log (_T("-----------------\n")); } #endif @@ -399,7 +399,7 @@ static int CopyRenderInfoStructureA2U (uaecptr amigamemptr, struct RenderInfo *r ri->RGBFormat = (RGBFTYPE)get_long (amigamemptr + PSSO_RenderInfo_RGBFormat); return 1; } - write_log (L"ERROR - Invalid RenderInfo memory area...\n"); + write_log (_T("ERROR - Invalid RenderInfo memory area...\n")); return 0; } @@ -416,7 +416,7 @@ static int CopyPatternStructureA2U (uaecptr amigamemptr, struct Pattern *pattern pattern->DrawMode = get_byte (amigamemptr + PSSO_Pattern_DrawMode); return 1; } - write_log (L"ERROR - Invalid Pattern memory area...\n"); + write_log (_T("ERROR - Invalid Pattern memory area...\n")); return 0; } @@ -477,7 +477,7 @@ static int CopyTemplateStructureA2U (uaecptr amigamemptr, struct Template *tmpl) tmpl->BgPen = get_long (amigamemptr + PSSO_Template_BgPen); return 1; } - write_log (L"ERROR - Invalid Template memory area...\n"); + write_log (_T("ERROR - Invalid Template memory area...\n")); return 0; } @@ -502,7 +502,7 @@ static int CopyLineStructureA2U(uaecptr amigamemptr, struct Line *line) line->Yorigin = get_word (amigamemptr + PSSO_Line_Yorigin); return 1; } - write_log (L"ERROR - Invalid Line structure...\n"); + write_log (_T("ERROR - Invalid Line structure...\n")); return 0; } @@ -604,9 +604,9 @@ static void setupcursor (void) } cursorsurfaced3d->UnlockRect (0); setupcursor_needed = 0; - P96TRACE_SPR((L"cursorsurface3d updated\n")); + P96TRACE_SPR((_T("cursorsurface3d updated\n"))); } else { - P96TRACE_SPR((L"cursorsurfaced3d LockRect() failed %08x\n", hr)); + P96TRACE_SPR((_T("cursorsurfaced3d LockRect() failed %08x\n"), hr)); } } gfx_unlock (); @@ -931,7 +931,7 @@ static void setconvert (void) gfx_set_picasso_colors (picasso96_state.RGBFormat); picasso_palette (); if (host_mode != ohost_mode || picasso96_state.RGBFormat != orgbformat) { - write_log (L"RTG conversion: Depth=%d HostRGBF=%d P96RGBF=%d Mode=%d\n", d, host_mode, picasso96_state.RGBFormat, v); + write_log (_T("RTG conversion: Depth=%d HostRGBF=%d P96RGBF=%d Mode=%d\n"), d, host_mode, picasso96_state.RGBFormat, v); ohost_mode = host_mode; orgbformat = picasso96_state.RGBFormat; } @@ -982,7 +982,7 @@ void picasso_refresh (void) height = picasso96_state.Height; } } else { - write_log (L"ERROR - picasso_refresh() can't refresh!\n"); + write_log (_T("ERROR - picasso_refresh() can't refresh!\n")); } } @@ -1207,10 +1207,10 @@ static int do_blitrect_frame_buffer (struct RenderInfo *ri, struct src = ri->Memory + srcx * Bpp + srcy * ri->BytesPerRow; dst = dstri->Memory + dstx * Bpp + dsty * dstri->BytesPerRow; if (mask != 0xFF && Bpp > 1) { - write_log (L"WARNING - BlitRect() has mask 0x%x with Bpp %d.\n", mask, Bpp); + write_log (_T("WARNING - BlitRect() has mask 0x%x with Bpp %d.\n"), mask, Bpp); } - P96TRACE ((L"(%dx%d)=(%dx%d)=(%dx%d)=%d\n", srcx, srcy, dstx, dsty, width, height, opcode)); + P96TRACE ((_T("(%dx%d)=(%dx%d)=(%dx%d)=%d\n"), srcx, srcy, dstx, dsty, width, height, opcode)); if (mask == 0xFF || Bpp > 1) { if(opcode == BLIT_SRC) { @@ -1370,7 +1370,7 @@ static uae_u32 REGPARAM2 picasso_SetSpriteColor (TrapContext *ctx) if (idx >= 4) return 0; cursorrgb[idx] = (red << 16) | (green << 8) | (blue << 0); - P96TRACE_SPR ((L"SetSpriteColor(%08x,%d:%02X%02X%02X). %x\n", bi, idx, red, green, blue, bi + PSSO_BoardInfo_MousePens)); + P96TRACE_SPR ((_T("SetSpriteColor(%08x,%d:%02X%02X%02X). %x\n"), bi, idx, red, green, blue, bi + PSSO_BoardInfo_MousePens)); return 1; } @@ -1495,7 +1495,7 @@ int createwindowscursor (uaecptr src, int w, int h, int hiressprite, int doubled } } } - write_log (L"wincursor: %dx%d hires=%d doubled=%d\n", w2, h2, hiressprite, doubledsprite); + write_log (_T("wincursor: %dx%d hires=%d doubled=%d\n"), w2, h2, hiressprite, doubledsprite); xfree (tmp_sprite_data); tmp_sprite_data = NULL; @@ -1586,7 +1586,7 @@ end: } if (!ret) - write_log (L"RTG Windows color cursor creation failed\n"); + write_log (_T("RTG Windows color cursor creation failed\n")); exit: if (currprefs.input_tablet && currprefs.input_magic_mouse && currprefs.input_magic_mouse_cursor == MAGICMOUSE_NATIVE_ONLY) { @@ -1640,7 +1640,7 @@ static uae_u32 setspriteimage (uaecptr bi) doubledsprite = 1; updatesprcolors (bpp); - P96TRACE_SPR ((L"SetSpriteImage(%08x,%08x,w=%d,h=%d,%d/%d,%08x)\n", + P96TRACE_SPR ((_T("SetSpriteImage(%08x,%08x,w=%d,h=%d,%d/%d,%08x)\n"), bi, get_long (bi + PSSO_BoardInfo_MouseImage), w, h, hiressprite - 1, doubledsprite, bi + PSSO_BoardInfo_MouseImage)); @@ -1695,7 +1695,7 @@ static uae_u32 setspriteimage (uaecptr bi) setupcursor (); ret = 1; cursorok = TRUE; - P96TRACE_SPR ((L"hardware sprite created\n")); + P96TRACE_SPR ((_T("hardware sprite created\n"))); end: return ret; } @@ -1754,7 +1754,7 @@ static uae_u32 REGPARAM2 picasso_SetSprite (TrapContext *ctx) cursordeactivate = 2; } result = 1; - P96TRACE_SPR ((L"SetSprite: %d\n", activate)); + P96TRACE_SPR ((_T("SetSprite: %d\n"), activate)); return result; } @@ -1927,7 +1927,7 @@ static int AssignModeID (int w, int h, int *unkcnt) return 0x50001000 | (mi[i].id * 0x10000); } (*unkcnt)++; - write_log (L"P96: Non-unique mode %dx%d\n", w, h); + write_log (_T("P96: Non-unique mode %dx%d\n"), w, h); return 0x51001000 - (*unkcnt) * 0x10000; } @@ -1965,7 +1965,7 @@ static void init_alloc (TrapContext *ctx, int size) picasso96_amem = gfxmem_start + allocated_gfxmem - size; } picasso96_amemend = picasso96_amem + size; - write_log (L"P96 RESINFO: %08X-%08X (%d,%d)\n", picasso96_amem, picasso96_amemend, size / PSSO_ModeInfo_sizeof, size); + write_log (_T("P96 RESINFO: %08X-%08X (%d,%d)\n"), picasso96_amem, picasso96_amemend, size / PSSO_ModeInfo_sizeof, size); xfree (gwwbuf); GetSystemInfo (&si); gwwpagesize = si.dwPageSize; @@ -2072,7 +2072,7 @@ static void picasso96_alloc2 (TrapContext *ctx) memcpy (pr, &DisplayModes[i], sizeof (struct PicassoResolution)); pr->res.width = missmodes[misscnt * 2 + 0]; pr->res.height = missmodes[misscnt * 2 + 1]; - _stprintf (pr->name, L"%dx%d FAKE", pr->res.width, pr->res.height); + _stprintf (pr->name, _T("%dx%d FAKE"), pr->res.width, pr->res.height); size += PSSO_ModeInfo_sizeof * depths; cnt++; misscnt++; @@ -2149,7 +2149,7 @@ void picasso96_alloc (TrapContext *ctx) { if (uaegfx_old) return; - uaegfx_resname = ds (L"uaegfx.card"); + uaegfx_resname = ds (_T("uaegfx.card")); picasso96_alloc2 (ctx); } @@ -2161,7 +2161,7 @@ static void inituaegfx (uaecptr ABI) cursorvisible = false; cursorok = 0; cursordeactivate = 0; - write_log (L"RTG mode mask: %x\n", currprefs.picasso96_modeflags); + write_log (_T("RTG mode mask: %x\n"), currprefs.picasso96_modeflags); put_word (ABI + PSSO_BoardInfo_BitsPerCannon, 8); put_word (ABI + PSSO_BoardInfo_RGBFormats, currprefs.picasso96_modeflags); put_long (ABI + PSSO_BoardInfo_BoardType, picasso96_BT); @@ -2196,17 +2196,17 @@ static void inituaegfx (uaecptr ABI) if (currprefs.gfx_api && D3D_goodenough () && USE_HARDWARESPRITE) { hwsprite = 1; flags |= BIF_HARDWARESPRITE; - write_log (L"P96: Hardware sprite support enabled\n"); + write_log (_T("P96: Hardware sprite support enabled\n")); } else { hwsprite = 0; - write_log (L"P96: Hardware sprite support disabled\n"); + write_log (_T("P96: Hardware sprite support disabled\n")); } if (flags & BIF_NOBLITTER) - write_log (L"P96: Blitter disabled in devs:monitors/uaegfx!\n"); + write_log (_T("P96: Blitter disabled in devs:monitors/uaegfx!\n")); if (currprefs.win32_rtgvblankrate >= -1 && !uaegfx_old) flags |= BIF_VBLANKINTERRUPT; if (!(flags & BIF_INDISPLAYCHAIN)) { - write_log (L"P96: BIF_INDISPLAYCHAIN force-enabled!\n"); + write_log (_T("P96: BIF_INDISPLAYCHAIN force-enabled!\n")); flags |= BIF_INDISPLAYCHAIN; } put_long (ABI + PSSO_BoardInfo_Flags, flags); @@ -2270,7 +2270,7 @@ static uae_u32 REGPARAM2 picasso_InitCard (TrapContext *ctx) uaecptr AmigaBoardInfo = m68k_areg (regs, 0); if (!picasso96_amem) { - write_log (L"P96: InitCard() but no resolution memory!\n"); + write_log (_T("P96: InitCard() but no resolution memory!\n")); return 0; } amem = picasso96_amem; @@ -2285,7 +2285,7 @@ static uae_u32 REGPARAM2 picasso_InitCard (TrapContext *ctx) j = i; addmode (AmigaBoardInfo, &amem, &res, newmodes[i].res.width, newmodes[i].res.height, NULL, 0, &unkcnt); s = au (res.Name); - write_log (L"%2d: %08X %4dx%4d %s\n", ++cnt, res.DisplayID, res.Width, res.Height, s); + write_log (_T("%2d: %08X %4dx%4d %s\n"), ++cnt, res.DisplayID, res.Width, res.Height, s); xfree (s); while (newmodes[i].depth >= 0 && newmodes[i].res.width == newmodes[j].res.width @@ -2312,7 +2312,7 @@ static uae_u32 REGPARAM2 picasso_InitCard (TrapContext *ctx) else _stprintf (tmp, "UAE:Display#%d", i); addmode (AmigaBoardInfo, &amem, &res, w, h, tmp, i + 1, &unkcnt); - write_log (L"%08X %4dx%4d %s\n", res.DisplayID, res.Width + 16, res.Height, res.Name); + write_log (_T("%08X %4dx%4d %s\n"), res.DisplayID, res.Width + 16, res.Height, res.Name); LibResolutionStructureCount++; CopyLibResolutionStructureU2A (&res, amem); #if P96TRACING_ENABLED && P96TRACING_LEVEL > 1 @@ -2324,7 +2324,7 @@ static uae_u32 REGPARAM2 picasso_InitCard (TrapContext *ctx) #endif if (amem > picasso96_amemend) - write_log (L"P96: display resolution list corruption %08x<>%08x (%d)\n", amem, picasso96_amemend, i); + write_log (_T("P96: display resolution list corruption %08x<>%08x (%d)\n"), amem, picasso96_amemend, i); return -1; } @@ -2352,10 +2352,10 @@ static uae_u32 REGPARAM2 picasso_SetSwitch (TrapContext *ctx) picasso_requested_on = flag != 0; p96text[0] = 0; if (flag) - _stprintf (p96text, L"Picasso96 %dx%dx%d (%dx%dx%d)", + _stprintf (p96text, _T("Picasso96 %dx%dx%d (%dx%dx%d)"), picasso96_state.Width, picasso96_state.Height, picasso96_state.BytesPerPixel * 8, picasso_vidinfo.width, picasso_vidinfo.height, picasso_vidinfo.pixbytes * 8); - write_log (L"SetSwitch() - %s\n", flag ? p96text : L"amiga"); + write_log (_T("SetSwitch() - %s\n"), flag ? p96text : _T("amiga")); /* Put old switch-state in D0 */ return !flag; } @@ -2398,7 +2398,7 @@ static int updateclut (uaecptr clut, int start, int count) int g = get_byte (clut + 1); int b = get_byte (clut + 2); - //write_log(L"%d: %02x%02x%02x\n", i, r, g, b); + //write_log(_T("%d: %02x%02x%02x\n"), i, r, g, b); changed |= picasso96_state.CLUT[i].Red != r || picasso96_state.CLUT[i].Green != g || picasso96_state.CLUT[i].Blue != b; @@ -2424,7 +2424,7 @@ static uae_u32 REGPARAM2 picasso_SetColorArray (TrapContext *ctx) uaecptr clut = boardinfo + PSSO_BoardInfo_CLUT; if (updateclut (clut, start, count)) full_refresh = 1; - P96TRACE((L"SetColorArray(%d,%d)\n", start, count)); + P96TRACE((_T("SetColorArray(%d,%d)\n"), start, count)); return 1; } @@ -2441,7 +2441,7 @@ static uae_u32 REGPARAM2 picasso_SetDAC (TrapContext *ctx) /* Fill in some static UAE related structure about this new DAC setting * Lets us keep track of what pixel format the Amiga is thinking about in our frame-buffer */ - P96TRACE((L"SetDAC()\n")); + P96TRACE((_T("SetDAC()\n"))); rtg_clear (); return 1; } @@ -2498,7 +2498,7 @@ static uae_u32 REGPARAM2 picasso_SetGC (TrapContext *ctx) picasso96_state.GC_Depth = get_byte (modeinfo + PSSO_ModeInfo_Depth); picasso96_state.GC_Flags = get_byte (modeinfo + PSSO_ModeInfo_Flags); - P96TRACE((L"SetGC(%d,%d,%d,%d)\n", picasso96_state.Width, picasso96_state.Height, picasso96_state.GC_Depth, border)); + P96TRACE((_T("SetGC(%d,%d,%d,%d)\n"), picasso96_state.Width, picasso96_state.Height, picasso96_state.GC_Depth, border)); set_gc_called = 1; picasso96_state.HostAddress = NULL; init_picasso_screen (); @@ -2579,7 +2579,7 @@ static uae_u32 REGPARAM2 picasso_SetPanning (TrapContext *ctx) full_refresh = 1; set_panning_called = 1; - P96TRACE((L"SetPanning(%d, %d, %d) (%dx%d) Start 0x%x, BPR %d Bpp %d RGBF %d\n", + P96TRACE((_T("SetPanning(%d, %d, %d) (%dx%d) Start 0x%x, BPR %d Bpp %d RGBF %d\n"), Width, picasso96_state.XOffset, picasso96_state.YOffset, bme_width, bme_height, start_of_screen, picasso96_state.BytesPerRow, picasso96_state.BytesPerPixel, picasso96_state.RGBFormat)); @@ -2668,7 +2668,7 @@ static uae_u32 REGPARAM2 picasso_InvertRect (TrapContext *ctx) if (NOBLITTER) return 0; if (CopyRenderInfoStructureA2U (renderinfo, &ri)) { - P96TRACE((L"InvertRect %dbpp 0x%lx\n", Bpp, (long)mask)); + P96TRACE((_T("InvertRect %dbpp 0x%lx\n"), Bpp, (long)mask)); if (mask != 0xFF && Bpp > 1) mask = 0xFF; @@ -2718,7 +2718,7 @@ static uae_u32 REGPARAM2 picasso_FillRect (TrapContext *ctx) if (CopyRenderInfoStructureA2U (renderinfo, &ri) && Y != 0xFFFF) { Bpp = GetBytesPerPixel (RGBFormat); - P96TRACE((L"FillRect(%d, %d, %d, %d) Pen 0x%x BPP %d BPR %d Mask 0x%x\n", + P96TRACE((_T("FillRect(%d, %d, %d, %d) Pen 0x%x BPP %d BPR %d Mask 0x%x\n"), X, Y, Width, Height, Pen, Bpp, ri.BytesPerRow, Mask)); if(Bpp > 1) @@ -2734,7 +2734,7 @@ static uae_u32 REGPARAM2 picasso_FillRect (TrapContext *ctx) /* We get here only if Mask != 0xFF */ if (Bpp != 1) { - write_log (L"WARNING - FillRect() has unhandled mask 0x%x with Bpp %d. Using fall-back routine.\n", Mask, Bpp); + write_log (_T("WARNING - FillRect() has unhandled mask 0x%x with Bpp %d. Using fall-back routine.\n"), Mask, Bpp); } else { Pen &= Mask; Mask = ~Mask; @@ -2812,7 +2812,7 @@ STATIC_INLINE int BlitRectHelper (void) uae_u8 Bpp = GetBytesPerPixel (ri->RGBFormat); if (opcode == BLIT_DST) { - write_log ( L"WARNING: BlitRect() being called with opcode of BLIT_DST\n" ); + write_log ( _T("WARNING: BlitRect() being called with opcode of BLIT_DST\n") ); return 1; } @@ -2886,7 +2886,7 @@ static uae_u32 REGPARAM2 picasso_BlitRect (TrapContext *ctx) if (NOBLITTER_BLIT) return 0; - P96TRACE((L"BlitRect(%d, %d, %d, %d, %d, %d, 0x%x)\n", srcx, srcy, dstx, dsty, width, height, Mask)); + P96TRACE((_T("BlitRect(%d, %d, %d, %d, %d, %d, 0x%x)\n"), srcx, srcy, dstx, dsty, width, height, Mask)); result = BlitRect (renderinfo, (uaecptr)NULL, srcx, srcy, dstx, dsty, width, height, Mask, BLIT_SRC); return result; } @@ -2926,7 +2926,7 @@ static uae_u32 REGPARAM2 picasso_BlitRectNoMaskComplete (TrapContext *ctx) if (NOBLITTER_BLIT) return 0; - P96TRACE((L"BlitRectNoMaskComplete() op 0x%02x, %08x:(%4d,%4d) --> %08x:(%4d,%4d), wh(%4d,%4d)\n", + P96TRACE((_T("BlitRectNoMaskComplete() op 0x%02x, %08x:(%4d,%4d) --> %08x:(%4d,%4d), wh(%4d,%4d)\n"), OpCode, get_long (srcri + PSSO_RenderInfo_Memory), srcx, srcy, get_long (dstri + PSSO_RenderInfo_Memory), dstx, dsty, width, height)); result = BlitRect (srcri, dstri, srcx, srcy, dstx, dsty, width, height, 0xFF, OpCode); return result; @@ -3019,7 +3019,7 @@ static uae_u32 REGPARAM2 picasso_BlitPattern (TrapContext *ctx) if(result) { uae_u32 fgpen, bgpen; - P96TRACE((L"BlitPattern() xy(%d,%d), wh(%d,%d) draw 0x%x, off(%d,%d), ph %d\n", + P96TRACE((_T("BlitPattern() xy(%d,%d), wh(%d,%d) draw 0x%x, off(%d,%d), ph %d\n"), X, Y, W, H, pattern.DrawMode, pattern.XOffset, pattern.YOffset, 1 << pattern.Size)); #if P96TRACING_ENABLED @@ -3174,7 +3174,7 @@ static uae_u32 REGPARAM2 picasso_BlitTemplate (TrapContext *ctx) if(Bpp > 1) Mask = 0xFF; if(tmp.DrawMode == COMP) { - write_log (L"WARNING - BlitTemplate() has unhandled mask 0x%x with COMP DrawMode. Using fall-back routine.\n", Mask); + write_log (_T("WARNING - BlitTemplate() has unhandled mask 0x%x with COMP DrawMode. Using fall-back routine.\n"), Mask); return 0; } else { result = 1; @@ -3186,7 +3186,7 @@ static uae_u32 REGPARAM2 picasso_BlitTemplate (TrapContext *ctx) if(result) { uae_u32 fgpen, bgpen; - P96TRACE((L"BlitTemplate() xy(%d,%d), wh(%d,%d) draw 0x%x fg 0x%x bg 0x%x \n", + P96TRACE((_T("BlitTemplate() xy(%d,%d), wh(%d,%d) draw 0x%x fg 0x%x bg 0x%x \n"), X, Y, W, H, tmp.DrawMode, tmp.FgPen, tmp.BgPen)); bitoffset = tmp.XOffset % 8; @@ -3320,7 +3320,7 @@ static uae_u32 REGPARAM2 picasso_CalculateBytesPerRow (TrapContext *ctx) static uae_u32 REGPARAM2 picasso_SetDisplay (TrapContext *ctx) { uae_u32 state = m68k_dreg (regs, 0); - P96TRACE ((L"SetDisplay(%d)\n", state)); + P96TRACE ((_T("SetDisplay(%d)\n"), state)); resetpalette (); return !state; } @@ -3343,7 +3343,7 @@ void init_hz_p96 (void) if (p96vblank >= 300) p96vblank = 300; p96syncrate = maxvpos_nom * vblank_hz / p96vblank; - write_log (L"P96FREQ: %d*%.4f = %.4f / %.1f = %d\n", maxvpos_nom, vblank_hz, maxvpos_nom * vblank_hz, p96vblank, p96syncrate); + write_log (_T("P96FREQ: %d*%.4f = %.4f / %.1f = %d\n"), maxvpos_nom, vblank_hz, maxvpos_nom * vblank_hz, p96vblank, p96syncrate); } /* NOTE: Watch for those planeptrs of 0x00000000 and 0xFFFFFFFF for all zero / all one bitmaps !!!! */ @@ -3450,12 +3450,12 @@ static uae_u32 REGPARAM2 picasso_BlitPlanar2Chunky (TrapContext *ctx) if (NOBLITTER) return 0; if (minterm != 0x0C) { - write_log (L"ERROR - BlitPlanar2Chunky() has minterm 0x%x, which I don't handle. Using fall-back routine.\n", + write_log (_T("ERROR - BlitPlanar2Chunky() has minterm 0x%x, which I don't handle. Using fall-back routine.\n"), minterm); } else if (CopyRenderInfoStructureA2U (ri, &local_ri) && CopyBitMapStructureA2U (bm, &local_bm)) { - P96TRACE((L"BlitPlanar2Chunky(%d, %d, %d, %d, %d, %d) Minterm 0x%x, Mask 0x%x, Depth %d\n", + P96TRACE((_T("BlitPlanar2Chunky(%d, %d, %d, %d, %d, %d) Minterm 0x%x, Mask 0x%x, Depth %d\n"), srcx, srcy, dstx, dsty, width, height, minterm, mask, local_bm.Depth)); - P96TRACE((L"P2C - BitMap has %d BPR, %d rows\n", local_bm.BytesPerRow, local_bm.Rows)); + P96TRACE((_T("P2C - BitMap has %d BPR, %d rows\n"), local_bm.BytesPerRow, local_bm.Rows)); PlanarToChunky (&local_ri, &local_bm, srcx, srcy, dstx, dsty, width, height, mask); result = 1; } @@ -3590,13 +3590,13 @@ static uae_u32 REGPARAM2 picasso_BlitPlanar2Direct (TrapContext *ctx) if (NOBLITTER) return 0; if (minterm != 0x0C) { - write_log (L"WARNING - BlitPlanar2Direct() has unhandled op-code 0x%x. Using fall-back routine.\n", minterm); + write_log (_T("WARNING - BlitPlanar2Direct() has unhandled op-code 0x%x. Using fall-back routine.\n"), minterm); return 0; } if (CopyRenderInfoStructureA2U (ri, &local_ri) && CopyBitMapStructureA2U (bm, &local_bm)) { Mask = 0xFF; CopyColorIndexMappingA2U (cim, &local_cim, GetBytesPerPixel (local_ri.RGBFormat)); - P96TRACE((L"BlitPlanar2Direct(%d, %d, %d, %d, %d, %d) Minterm 0x%x, Mask 0x%x, Depth %d\n", + P96TRACE((_T("BlitPlanar2Direct(%d, %d, %d, %d, %d, %d) Minterm 0x%x, Mask 0x%x, Depth %d\n"), srcx, srcy, dstx, dsty, width, height, minterm, Mask, local_bm.Depth)); PlanarToDirect (&local_ri, &local_bm, srcx, srcy, dstx, dsty, width, height, Mask, &local_cim); result = 1; @@ -3917,7 +3917,7 @@ static bool flushpixels (void) src_start = src + (off & ~gwwpagemask); src_end = src + ((off + picasso96_state.BytesPerRow * pheight + gwwpagesize - 1) & ~gwwpagemask); #if 0 - write_log (L"%dx%d %dx%d %dx%d (%dx%d)\n", picasso96_state.Width, picasso96_state.Width, + write_log (_T("%dx%d %dx%d %dx%d (%dx%d)\n"), picasso96_state.Width, picasso96_state.Width, picasso96_state.VirtualWidth, picasso96_state.VirtualHeight, picasso_vidinfo.width, picasso_vidinfo.height, pwidth, pheight); @@ -4117,7 +4117,7 @@ static uae_u8 *REGPARAM2 gfxmem_xlate (uaecptr addr) addrbank gfxmem_bank = { gfxmem_lgetx, gfxmem_wgetx, gfxmem_bgetx, gfxmem_lputx, gfxmem_wputx, gfxmem_bputx, - gfxmem_xlate, gfxmem_check, NULL, L"RTG RAM", + gfxmem_xlate, gfxmem_check, NULL, _T("RTG RAM"), dummy_lgeti, dummy_wgeti, ABFLAG_RAM }; @@ -4152,7 +4152,7 @@ static uae_u32 REGPARAM2 picasso_SetInterrupt (TrapContext *ctx) uaecptr bi = m68k_areg (regs, 0); uae_u32 onoff = m68k_dreg (regs, 0); interrupt_enabled = onoff; - //write_log (L"Picasso_SetInterrupt(%08x,%d)\n", bi, onoff); + //write_log (_T("Picasso_SetInterrupt(%08x,%d)\n"), bi, onoff); return onoff; } @@ -4199,7 +4199,7 @@ static void initvblankirq (TrapContext *ctx, uaecptr base) static uae_u32 REGPARAM2 picasso_SetClock(TrapContext *ctx) { uaecptr bi = m68k_areg (regs, 0); - P96TRACE((L"SetClock\n")); + P96TRACE((_T("SetClock\n"))); return 0; } @@ -4207,7 +4207,7 @@ static uae_u32 REGPARAM2 picasso_SetMemoryMode(TrapContext *ctx) { uaecptr bi = m68k_areg (regs, 0); uae_u32 rgbformat = m68k_dreg (regs, 7); - P96TRACE((L"SetMemoryMode\n")); + P96TRACE((_T("SetMemoryMode\n"))); return 0; } @@ -4399,7 +4399,7 @@ static uaecptr inituaegfxfuncs (uaecptr start, uaecptr ABI) RTGCALL2(PSSO_BoardInfo_SetInterrupt, picasso_SetInterrupt); - write_log (L"uaegfx.card magic code: %08X-%08X ABI=%08X\n", start, here (), ABI); + write_log (_T("uaegfx.card magic code: %08X-%08X ABI=%08X\n"), start, here (), ABI); if (ABI && currprefs.win32_rtgvblankrate >= -1) initvblankABI (uaegfx_base, ABI); @@ -4453,9 +4453,9 @@ static uaecptr uaegfx_card_install (TrapContext *ctx, uae_u32 extrasize) if (uaegfx_old || !gfxmem_start) return NULL; - uaegfx_resid = ds (L"UAE Graphics Card 3.3"); - uaegfx_vblankname = ds (L"UAE Graphics Card VBLANK"); - uaegfx_portsname = ds (L"UAE Graphics Card PORTS"); + uaegfx_resid = ds (_T("UAE Graphics Card 3.3")); + uaegfx_vblankname = ds (_T("UAE Graphics Card VBLANK")); + uaegfx_portsname = ds (_T("UAE Graphics Card PORTS")); /* Open */ openfunc = here (); @@ -4511,7 +4511,7 @@ static uaecptr uaegfx_card_install (TrapContext *ctx, uae_u32 extrasize) if (currprefs.win32_rtgvblankrate >= -1) initvblankirq (ctx, uaegfx_base); - write_log (L"uaegfx.card %d.%d init @%08X\n", UAEGFX_VERSION, UAEGFX_REVISION, uaegfx_base); + write_log (_T("uaegfx.card %d.%d init @%08X\n"), UAEGFX_VERSION, UAEGFX_REVISION, uaegfx_base); uaegfx_active = 1; return uaegfx_base; } @@ -4522,12 +4522,12 @@ uae_u32 picasso_demux (uae_u32 arg, TrapContext *ctx) if (uaegfx_base) { if (num >= 16 && num <= 39) { - write_log (L"uaelib: obsolete Picasso96 uaelib hook called, call ignored\n"); + write_log (_T("uaelib: obsolete Picasso96 uaelib hook called, call ignored\n")); return 0; } } if (!uaegfx_old) { - write_log (L"uaelib: uaelib hook in use\n"); + write_log (_T("uaelib: uaelib hook in use\n")); uaegfx_old = 1; uaegfx_active = 1; } diff --git a/od-win32/posixemu.cpp b/od-win32/posixemu.cpp index 4b591291..604bb24d 100644 --- a/od-win32/posixemu.cpp +++ b/od-win32/posixemu.cpp @@ -108,7 +108,7 @@ int posixemu_stat (const TCHAR *name, struct _stat64 *statbuf) // FILE_FLAG_BACKUP_SEMANTICS = can also "open" directories h = CreateFile (name, 0, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_BACKUP_SEMANTICS, NULL); if (h == INVALID_HANDLE_VALUE) { - write_log (L"Stat CreateFile(%s) failed: %d\n", name, GetLastError ()); + write_log (_T("Stat CreateFile(%s) failed: %d\n"), name, GetLastError ()); return -1; } ok = GetFileInformationByHandle (h, &fi); @@ -121,7 +121,7 @@ int posixemu_stat (const TCHAR *name, struct _stat64 *statbuf) ft = fi.ftLastWriteTime; statbuf->st_size = ((uae_u64)fi.nFileSizeHigh << 32) | fi.nFileSizeLow; } else { - write_log (L"GetFileInformationByHandle(%s) failed: %d\n", name, GetLastError ()); + write_log (_T("GetFileInformationByHandle(%s) failed: %d\n"), name, GetLastError ()); return -1; } @@ -308,7 +308,7 @@ int uae_start_thread (const TCHAR *name, void *(*f)(void *), void *arg, uae_thre hThread = (HANDLE)_beginthreadex (NULL, 0, thread_init, thp, 0, &foo); if (hThread) { if (name) { - //write_log (L"Thread '%s' started (%d)\n", name, hThread); + //write_log (_T("Thread '%s' started (%d)\n"), name, hThread); if (!AVTask) { SetThreadPriority (hThread, THREAD_PRIORITY_HIGHEST); } else { @@ -317,7 +317,7 @@ int uae_start_thread (const TCHAR *name, void *(*f)(void *), void *arg, uae_thre } } else { result = 0; - write_log (L"Thread '%s' failed to start!?\n", name ? name : L""); + write_log (_T("Thread '%s' failed to start!?\n"), name ? name : _T("")); } if (tid) *tid = hThread; diff --git a/od-win32/registry.cpp b/od-win32/registry.cpp index bb6acd97..32dcd6ec 100644 --- a/od-win32/registry.cpp +++ b/od-win32/registry.cpp @@ -10,7 +10,7 @@ static int inimode = 0; static TCHAR *inipath; -#define PUPPA L"eitätäoo" +#define PUPPA _T("eitätäoo") static HKEY gr (UAEREG *root) { @@ -21,7 +21,7 @@ static HKEY gr (UAEREG *root) static TCHAR *gs (UAEREG *root) { if (!root) - return L"WinUAE"; + return _T("WinUAE"); return root->inipath; } static TCHAR *gsn (UAEREG *root, const TCHAR *name) @@ -31,7 +31,7 @@ static TCHAR *gsn (UAEREG *root, const TCHAR *name) return my_strdup (name); r = gs (root); s = xmalloc (TCHAR, _tcslen (r) + 1 + _tcslen (name) + 1); - _stprintf (s, L"%s/%s", r, name); + _stprintf (s, _T("%s/%s"), r, name); return s; } @@ -54,7 +54,7 @@ int regsetint (UAEREG *root, const TCHAR *name, int val) if (inimode) { DWORD ret; TCHAR tmp[100]; - _stprintf (tmp, L"%d", val); + _stprintf (tmp, _T("%d"), val); ret = WritePrivateProfileString (gs (root), name, tmp, inipath); return ret; } else { @@ -180,7 +180,7 @@ int regsetdata (UAEREG *root, const TCHAR *name, const void *str, int size) int i; TCHAR *tmp = xmalloc (TCHAR, size * 2 + 1); for (i = 0; i < size; i++) - _stprintf (tmp + i * 2, L"%02X", in[i]); + _stprintf (tmp + i * 2, _T("%02X"), in[i]); ret = WritePrivateProfileString (gs (root), name, tmp, inipath); xfree (tmp); return ret; @@ -273,7 +273,7 @@ void regdeletetree (UAEREG *root, const TCHAR *name) TCHAR *s = gsn (root, name); if (!s) return; - WritePrivateProfileSection (s, L"", inipath); + WritePrivateProfileSection (s, _T(""), inipath); xfree (s); } else { HKEY rk = gr (root); @@ -335,7 +335,7 @@ UAEREG *regcreatetree (UAEREG *root, const TCHAR *name) ininame = my_strdup (name); } else { ininame = xmalloc (TCHAR, _tcslen (root->inipath) + 1 + _tcslen (name) + 1); - _stprintf (ininame, L"%s/%s", root->inipath, name); + _stprintf (ininame, _T("%s/%s"), root->inipath, name); } fkey = xcalloc (UAEREG, 1); fkey->inipath = ininame; @@ -344,9 +344,9 @@ UAEREG *regcreatetree (UAEREG *root, const TCHAR *name) HKEY rk = gr (root); if (!rk) { rk = HKEY_CURRENT_USER; - name = L"Software\\Arabuusimiehet\\WinUAE"; + name = _T("Software\\Arabuusimiehet\\WinUAE"); } else if (!name) { - name = L""; + name = _T(""); } err = RegCreateKeyEx (rk, name, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_READ | KEY_WRITE, NULL, &rkey, NULL); @@ -385,8 +385,8 @@ int reginitializeinit (TCHAR **pppath) TCHAR *posn; path[0] = 0; GetFullPathName (_wpgmptr, sizeof path / sizeof (TCHAR), path, NULL); - if (_tcslen (path) > 4 && !_tcsicmp (path + _tcslen (path) - 4, L".exe")) { - _tcscpy (path + _tcslen (path) - 3, L"ini"); + if (_tcslen (path) > 4 && !_tcsicmp (path + _tcslen (path) - 4, _T(".exe"))) { + _tcscpy (path + _tcslen (path) - 3, _T("ini")); if (GetFileAttributes (path) != INVALID_FILE_ATTRIBUTES) ok = 1; } @@ -395,7 +395,7 @@ int reginitializeinit (TCHAR **pppath) GetFullPathName (_wpgmptr, sizeof path / sizeof (TCHAR), path, NULL); if((posn = _tcsrchr (path, '\\'))) posn[1] = 0; - _tcscat (path, L"winuae.ini"); + _tcscat (path, _T("winuae.ini")); } if (GetFileAttributes (path) == INVALID_FILE_ATTRIBUTES) return 0; @@ -405,32 +405,32 @@ int reginitializeinit (TCHAR **pppath) fpath[0] = 0; GetFullPathName (path, sizeof fpath / sizeof (TCHAR), fpath, NULL); - if (_tcslen (fpath) < 5 || _tcsicmp (fpath + _tcslen (fpath) - 4, L".ini")) + if (_tcslen (fpath) < 5 || _tcsicmp (fpath + _tcslen (fpath) - 4, _T(".ini"))) return 0; inimode = 1; inipath = my_strdup (fpath); - if (!regexists (NULL, L"Version")) + if (!regexists (NULL, _T("Version"))) goto fail; - r = regcreatetree (NULL, L"Warning"); + r = regcreatetree (NULL, _T("Warning")); if (!r) goto fail; memset (tmp1, 0, sizeof tmp1); s = 200; - if (!regquerystr (r, L"info1", tmp1, &s)) + if (!regquerystr (r, _T("info1"), tmp1, &s)) goto fail; - if (!regquerystr (r, L"info2", tmp1 + 200, &s)) + if (!regquerystr (r, _T("info2"), tmp1 + 200, &s)) goto fail; get_sha1 (tmp1, sizeof tmp1, crc); if (memcmp (crc, crcok, sizeof crcok)) goto fail; v1 = v2 = -1; - regsetint (r, L"check", 1); - regqueryint (r, L"check", &v1); - regsetint (r, L"check", 3); - regqueryint (r, L"check", &v2); - regdelete (r, L"check"); - if (regqueryint (r, L"check", &v3)) + regsetint (r, _T("check"), 1); + regqueryint (r, _T("check"), &v1); + regsetint (r, _T("check"), 3); + regqueryint (r, _T("check"), &v2); + regdelete (r, _T("check")); + if (regqueryint (r, _T("check"), &v3)) goto fail; if (v1 != 1 || v2 != 3) goto fail; @@ -442,17 +442,17 @@ fail: DeleteFile (path); if (GetFileAttributes (path) != INVALID_FILE_ATTRIBUTES) goto end; - f = _tfopen (path, L"wb"); + f = _tfopen (path, _T("wb")); if (f) { uae_u8 bom[3] = { 0xef, 0xbb, 0xbf }; fwrite (bom, sizeof (bom), 1, f); fclose (f); } - r = regcreatetree (NULL, L"Warning"); + r = regcreatetree (NULL, _T("Warning")); if (!r) goto end; - regsetstr (r, L"info1", L"This is unsupported file. Compatibility between versions is not guaranteed."); - regsetstr (r, L"info2", L"Incompatible ini-files may be re-created from scratch!"); + regsetstr (r, _T("info1"), _T("This is unsupported file. Compatibility between versions is not guaranteed.")); + regsetstr (r, _T("info2"), _T("Incompatible ini-files may be re-created from scratch!")); regclosetree (r); if (*pppath == NULL) *pppath = my_strdup (path); @@ -466,7 +466,7 @@ end: void regstatus (void) { if (inimode) - write_log (L"WARNING: Unsupported '%s' enabled\n", inipath); + write_log (_T("WARNING: Unsupported '%s' enabled\n"), inipath); } int getregmode (void) diff --git a/od-win32/resources/winuae.rc b/od-win32/resources/winuae.rc index 01cb3c0e..fbe13d0d 100644 --- a/od-win32/resources/winuae.rc +++ b/od-win32/resources/winuae.rc @@ -1074,8 +1074,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 2,4,0,0 - PRODUCTVERSION 2,4,0,0 + FILEVERSION 2,4,1,0 + PRODUCTVERSION 2,4,1,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -1091,12 +1091,12 @@ BEGIN BLOCK "040904b0" BEGIN VALUE "FileDescription", "WinUAE" - VALUE "FileVersion", "2.4.0.0" + VALUE "FileVersion", "2.4.1.0" VALUE "InternalName", "WinUAE" VALUE "LegalCopyright", "© 1996-2012 under the GNU Public License (GPL)" VALUE "OriginalFilename", "WinUAE.exe" VALUE "ProductName", "WinUAE" - VALUE "ProductVersion", "2.4.0.0" + VALUE "ProductVersion", "2.4.1.0" END END BLOCK "VarFileInfo" diff --git a/od-win32/resources/winuae_minimal.rc b/od-win32/resources/winuae_minimal.rc index 6ef278d6..b4f2f408 100644 --- a/od-win32/resources/winuae_minimal.rc +++ b/od-win32/resources/winuae_minimal.rc @@ -115,9 +115,9 @@ STYLE DS_LOCALEDIT | DS_SETFONT | DS_3DLOOK | DS_CONTROL | WS_CHILD FONT 8, "MS Sans Serif", 0, 0, 0x1 BEGIN GROUPBOX "Screen",IDC_SCREENRESTEXT,4,0,292,67,BS_LEFT - COMBOBOX IDC_DISPLAYSELECT,59,10,225,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_DISPLAYSELECT,10,10,279,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP COMBOBOX IDC_RESOLUTION,59,27,68,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP - COMBOBOX IDC_REFRESHRATE,187,27,97,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_REFRESHRATE,187,27,102,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP EDITTEXT IDC_XSIZE,59,48,48,12,ES_NUMBER EDITTEXT IDC_YSIZE,114,48,47,12,ES_NUMBER GROUPBOX "Settings",IDC_SETTINGSTEXT,4,73,209,137 @@ -138,8 +138,8 @@ BEGIN EDITTEXT IDC_RATE2TEXT,143,192,41,12,ES_AUTOHSCROLL COMBOBOX IDC_RESOLUTIONDEPTH,134,27,46,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP CONTROL "Filtered low resolution",IDC_LORES_SMOOTHED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,120,125,89,10 - COMBOBOX IDC_SCREENMODE_NATIVE,39,85,67,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP - COMBOBOX IDC_SCREENMODE_RTG,39,103,67,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_SCREENMODE_NATIVE,39,85,63,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_SCREENMODE_RTG,39,103,63,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP RTEXT "Native:",IDC_STATIC,9,85,23,15,SS_CENTERIMAGE RTEXT "RTG:",IDC_STATIC,8,101,24,15,SS_CENTERIMAGE PUSHBUTTON "Reset to defaults",IDC_DA_RESET,221,218,75,14 @@ -147,12 +147,12 @@ BEGIN COMBOBOX IDC_LORES,103,152,102,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP CONTROL "Remove interlace artifacts",IDC_FLICKERFIXER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,139,99,10 RTEXT "Windowed:",IDC_STATIC,13,46,40,15,SS_CENTERIMAGE - RTEXT "Fullscreen:",IDC_STATIC,13,19,40,15,SS_CENTERIMAGE - COMBOBOX IDC_DISPLAY_BUFFERCNT,187,47,97,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP + RTEXT "Fullscreen:",IDC_STATIC,11,27,40,15,SS_CENTERIMAGE + COMBOBOX IDC_DISPLAY_BUFFERCNT,187,47,102,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP CONTROL "Resolution autoswitch",IDC_AUTORESOLUTION,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,120,139,89,10 EDITTEXT IDC_DA_TEXT,167,218,46,12,ES_AUTOHSCROLL | ES_READONLY - COMBOBOX IDC_SCREENMODE_NATIVE2,112,85,95,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP - COMBOBOX IDC_SCREENMODE_RTG2,112,103,95,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_SCREENMODE_NATIVE2,108,85,99,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_SCREENMODE_RTG2,108,103,99,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP COMBOBOX IDC_RATE2BOX,143,173,60,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP CONTROL "",IDC_RATE2ENABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,194,193,8,10 END @@ -182,9 +182,10 @@ BEGIN RTEXT "Chip:",IDC_STATIC,19,25,32,15,SS_CENTERIMAGE RTEXT "Slow:",IDC_STATIC,144,25,32,15,SS_CENTERIMAGE RTEXT "Z3 Fast:",IDC_STATIC,144,49,32,15,SS_CENTERIMAGE - RTEXT "32-bit Chip:",IDC_STATIC,99,73,78,15,SS_CENTERIMAGE + RTEXT "32-bit Chip:",IDC_STATIC,136,74,41,15,SS_CENTERIMAGE CONTROL "",IDC_Z3CHIPMEM,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,179,71,60,20 EDITTEXT IDC_Z3CHIPRAM,243,76,34,12,ES_CENTER | ES_READONLY + CONTROL "Autoconfig Fast RAM",IDC_FASTMEMAUTOCONFIG,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,29,76,101,10 END IDD_CPU DIALOGEX 0, 0, 300, 241 @@ -302,12 +303,12 @@ BEGIN PUSHBUTTON "&Properties",IDC_EDIT,235,172,60,15 CONTROL "Add PC drives at startup",IDC_MAPDRIVES,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,5,154,100,10 CONTROL "Disable UAEFSDB-support",IDC_NOUAEFSDB,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,110,154,119,10 - CONTROL "Don't use Windows Recycle Bin",IDC_NORECYCLEBIN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,110,165,121,10 - CONTROL "Include network drives..",IDC_MAPDRIVES_NET,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,5,188,101,10 - CONTROL "Include CD/DVD drives..",IDC_MAPDRIVES_CD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,5,177,100,10 - CONTROL "Automount removable drives",IDC_MAPDRIVES_AUTO,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,110,177,115,10 + CONTROL "Don't use Windows Recycle Bin",IDC_NORECYCLEBIN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,110,166,121,10 + CONTROL "Include network drives..",IDC_MAPDRIVES_NET,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,5,178,101,10 + CONTROL "CDFS automount CD/DVD drives",IDC_MAPDRIVES_CD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,5,190,160,10 + CONTROL "Automount removable drives",IDC_MAPDRIVES_AUTO,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,110,178,115,10 CONTROL "Include removable drives..",IDC_MAPDRIVES_REMOVABLE, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,5,165,100,10 + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,5,166,100,10 COMBOBOX IDC_CD_TEXT,5,224,289,75,CBS_DROPDOWN | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP PUSHBUTTON "Eject",IDC_CD_EJECT,265,204,30,15 PUSHBUTTON "Select image file",IDC_CD_SELECT,90,204,98,15 @@ -324,12 +325,12 @@ BEGIN CONTROL "Disabled",IDC_SOUND0,"Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,13,35,101,10 CONTROL "Disabled, but emulated",IDC_SOUND1,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,13,53,102,10 CONTROL "Enabled",IDC_SOUND2,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,13,71,102,10 - GROUPBOX "Volume",IDC_STATIC,132,36,164,31 - CONTROL "",IDC_SOUNDVOLUME,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,137,44,105,20 - EDITTEXT IDC_SOUNDVOLUME2,247,47,40,12,ES_CENTER | ES_READONLY - GROUPBOX "Sound Buffer Size",IDC_STATIC,132,73,164,31 - CONTROL "Slider1",IDC_SOUNDBUFFERRAM,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,137,81,105,19 - EDITTEXT IDC_SOUNDBUFFERMEM,247,84,40,12,ES_CENTER | ES_READONLY + GROUPBOX "Volume",IDC_STATIC,132,20,164,31 + CONTROL "",IDC_SOUNDVOLUME,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,137,29,105,20 + EDITTEXT IDC_SOUNDVOLUME2,247,32,40,12,ES_CENTER | ES_READONLY + GROUPBOX "Sound Buffer Size",IDC_STATIC,132,59,164,31 + CONTROL "Slider1",IDC_SOUNDBUFFERRAM,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,137,67,105,19 + EDITTEXT IDC_SOUNDBUFFERMEM,247,70,40,12,ES_CENTER | ES_READONLY GROUPBOX "Settings",IDC_SOUNDINTERPOLATION2,6,106,290,60 LTEXT "Frequency:",IDC_SOUNDFREQTXT,11,140,53,8,SS_CENTERIMAGE COMBOBOX IDC_SOUNDFREQ,13,149,51,75,CBS_DROPDOWN | WS_VSCROLL | WS_TABSTOP @@ -351,7 +352,6 @@ BEGIN COMBOBOX IDC_SOUNDSWAP,73,149,62,75,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP LTEXT "Swap channels:",IDC_SOUNDSWAPTXT,74,140,61,8,SS_CENTERIMAGE CONTROL "Automatic switching",IDC_SOUND_AUTO,"Button",BS_AUTOCHECKBOX | BS_LEFT | WS_GROUP | WS_TABSTOP,14,89,103,10 - CONTROL "Exclusive mode",IDC_SOUND_EXCLUSIVE,"Button",BS_AUTOCHECKBOX | BS_LEFT | WS_GROUP | WS_TABSTOP,137,25,154,10 CONTROL "DirectSound",IDC_SOUND_DS,"Button",BS_AUTOCHECKBOX | BS_LEFT | WS_GROUP | WS_TABSTOP,235,181,55,10 CONTROL "WASAPI",IDC_SOUND_WASAPI,"Button",BS_AUTOCHECKBOX | BS_LEFT | WS_GROUP | WS_TABSTOP,235,193,53,10 CONTROL "OpenAL",IDC_SOUND_OPENAL,"Button",BS_AUTOCHECKBOX | BS_LEFT | WS_GROUP | WS_TABSTOP,235,205,53,10 @@ -488,7 +488,7 @@ BEGIN GROUPBOX "Miscellaneous Options",IDC_STATIC,4,2,293,165 CONTROL "Untrap = middle button",IDC_JULIAN,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,19,19,110,10 CONTROL "Show GUI on startup",IDC_SHOWGUI,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,19,43,109,10 - CONTROL "Native on-screen display",IDC_SHOWLEDS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,19,139,109,10 + CONTROL "Native on-screen display",IDC_SHOWLEDS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,182,103,109,10 CONTROL "Don't show taskbar button",IDC_NOTASKBARBUTTON,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,19,67,109,10 CONTROL "Use CTRL-F11 to quit",IDC_CTRLF11,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,19,55,110,10 GROUPBOX "Keyboard LEDs",IDC_STATIC,3,207,294,29 @@ -513,13 +513,14 @@ BEGIN CONTROL "Synchronize clock",IDC_CLOCKSYNC,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,19,103,111,10 CONTROL "Faster RTG [] Enables less accurate custom chipset emulation mode when Picasso96 is enabled.",IDC_FASTERRTG, "Button",BS_AUTOCHECKBOX | BS_LEFT | WS_GROUP | WS_TABSTOP,19,115,111,10 - CONTROL "RTG on-screen display",IDC_SHOWLEDSRTG,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,19,151,109,10 + CONTROL "RTG on-screen display",IDC_SHOWLEDSRTG,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,182,114,109,10 RTEXT "Graphics API:",IDC_STATIC,130,62,79,10,SS_CENTERIMAGE COMBOBOX IDC_DXMODE,213,60,79,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP CONTROL "Minimize when focus is lost",IDC_FOCUSMINIMIZE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,19,31,110,10 RTEXT "Windowed style:",IDC_STATIC,128,45,81,10,SS_CENTERIMAGE COMBOBOX IDC_WINDOWEDMODE,213,43,79,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP CONTROL "Clipboard sharing",IDC_CLIPBOARDSHARE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,19,127,111,10 + CONTROL "Allow native code",IDC_NATIVECODE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,19,139,111,10 END IDD_HARDFILE DIALOGEX 0, 0, 299, 249 @@ -601,11 +602,11 @@ BEGIN PUSHBUTTON "Cancel",IDCANCEL,175,65,48,15 END -IDD_CHIPSET DIALOGEX 0, 65490, 300, 165 +IDD_CHIPSET DIALOGEX 0, 65490, 300, 188 STYLE DS_LOCALEDIT | DS_SETFONT | DS_3DLOOK | DS_CONTROL | WS_CHILD FONT 8, "MS Sans Serif", 0, 0, 0x0 BEGIN - GROUPBOX "Chipset",IDC_STATIC,14,11,145,90 + GROUPBOX "Chipset",IDC_STATIC,14,11,145,111 CONTROL "OCS [] Original chipset. A1000 and most A500s.",IDC_OCS, "Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,37,26,51,10 CONTROL "ECS Agnus [] Enhanced chipset (ECS Agnus chip only). CDTV and later A500 and A2000 hardware revisions.",IDC_ECS_AGNUS, @@ -618,24 +619,26 @@ BEGIN "Button",BS_AUTORADIOBUTTON | WS_TABSTOP,100,26,51,10 CONTROL "NTSC [] North American and Japanese display standard, 60Hz refresh rate. Other countries use PAL (50Hz. display refresh rate)",IDC_NTSC, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,100,58,50,10 - GROUPBOX "Options",IDC_STATIC,168,11,114,89 + GROUPBOX "Options",IDC_STATIC,168,11,114,111 CONTROL "Immediate Blitter [] Faster but less compatible blitter emulation.",IDC_BLITIMM, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,179,33,96,10 CONTROL "Cycle-exact [] The most compatible A500 emulation mode. Very fast PC recommended.",IDC_CYCLEEXACT, "Button",BS_AUTOCHECKBOX | BS_LEFT | WS_GROUP | WS_TABSTOP,179,46,100,10 - GROUPBOX "Collision Level",IDC_STATIC,14,105,267,48 + GROUPBOX "Collision Level",IDC_STATIC,14,128,267,48 CONTROL "None [] Collision hardware emulation disabled.",IDC_COLLISION0, - "Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,37,121,59,10 + "Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,37,144,59,10 CONTROL "Sprites only [] Emulate only sprite vs. sprite collisions.",IDC_COLLISION1, - "Button",BS_AUTORADIOBUTTON | WS_TABSTOP,37,137,62,10 + "Button",BS_AUTORADIOBUTTON | WS_TABSTOP,37,160,62,10 CONTROL "Sprites and Sprites vs. Playfield [] Recommended collision emulation level.",IDC_COLLISION2, - "Button",BS_AUTORADIOBUTTON | WS_TABSTOP,100,121,161,10 + "Button",BS_AUTORADIOBUTTON | WS_TABSTOP,100,144,161,10 CONTROL "Full [] 100% collision hardware emulation. Only very few games need this option. Slowest.",IDC_COLLISION3, - "Button",BS_AUTORADIOBUTTON | WS_TABSTOP,100,137,119,10 + "Button",BS_AUTORADIOBUTTON | WS_TABSTOP,100,160,119,10 CONTROL "Genlock connected [] Allow boot sequence to detect genlock. Genlock is not emulated.",IDC_GENLOCK, "Button",BS_AUTOCHECKBOX | BS_LEFT | WS_GROUP | WS_TABSTOP,179,59,100,10 COMBOBOX IDC_CS_EXT,100,80,49,65,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP RTEXT "Chipset Extra",IDC_STATIC,25,79,52,15,SS_CENTERIMAGE + COMBOBOX IDC_MONITOREMU,178,99,98,65,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + RTEXT "External display hardware:",IDC_STATIC,174,78,100,15,SS_CENTERIMAGE END IDD_CHIPSET2 DIALOGEX 0, 65490, 300, 247 @@ -809,23 +812,26 @@ IDD_MISC2 DIALOGEX 0, 0, 300, 244 STYLE DS_LOCALEDIT | DS_SETFONT | DS_3DLOOK | DS_CONTROL | WS_CHILD FONT 8, "MS Sans Serif", 0, 0, 0x1 BEGIN - GROUPBOX "When Active",IDC_STATIC,8,7,88,73 - RTEXT "Run at priority:",IDC_ACTIVE_PRI,14,17,52,10,SS_CENTERIMAGE | WS_TABSTOP + GROUPBOX "When Active",IDC_STATIC,8,7,88,81 + CTEXT "Run at priority:",IDC_ACTIVE_PRI,14,17,77,10,SS_CENTERIMAGE | WS_TABSTOP COMBOBOX IDC_ACTIVE_PRIORITY,14,29,76,65,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - GROUPBOX "When Inactive",IDC_STATIC,102,7,92,73 - RTEXT "Run at priority:",IDC_INACTIVE_PRI,109,17,51,10,SS_CENTERIMAGE | WS_TABSTOP + GROUPBOX "When Inactive",IDC_STATIC,102,7,92,81 + CTEXT "Run at priority:",IDC_INACTIVE_PRI,109,17,75,10,SS_CENTERIMAGE | WS_TABSTOP COMBOBOX IDC_INACTIVE_PRIORITY,109,29,76,65,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - CONTROL "Pause emulation",IDC_INACTIVE_PAUSE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,109,50,69,10 - CONTROL "Disable sound",IDC_INACTIVE_NOSOUND,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,109,63,79,10 - GROUPBOX "When Minimized",IDC_STATIC,199,7,92,73 - RTEXT "Run at priority:",IDC_MINIMIZED_PRI,207,18,51,10,SS_CENTERIMAGE | WS_TABSTOP + CONTROL "Pause emulation",IDC_INACTIVE_PAUSE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,109,61,69,10 + CONTROL "Disable sound",IDC_INACTIVE_NOSOUND,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,109,74,79,10 + GROUPBOX "When Minimized",IDC_STATIC,199,7,92,81 + CTEXT "Run at priority:",IDC_MINIMIZED_PRI,207,18,75,10,SS_CENTERIMAGE | WS_TABSTOP COMBOBOX IDC_MINIMIZED_PRIORITY,207,29,76,65,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - CONTROL "Pause emulation",IDC_MINIMIZED_PAUSE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,207,50,69,10 - CONTROL "Disable sound",IDC_MINIMIZED_NOSOUND,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,207,63,79,10 - CONTROL "",IDC_ASSOCIATELIST,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_ALIGNLEFT | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,19,94,164,100 - GROUPBOX "File Extension Associations",IDC_STATIC,8,83,186,138 - PUSHBUTTON "Deassociate all",IDC_ASSOCIATE_OFF,108,200,75,14 - PUSHBUTTON "Associate all",IDC_ASSOCIATE_ON,19,200,75,14 + CONTROL "Pause emulation",IDC_MINIMIZED_PAUSE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,207,61,69,10 + CONTROL "Disable sound",IDC_MINIMIZED_NOSOUND,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,207,74,79,10 + CONTROL "",IDC_ASSOCIATELIST,"SysListView32",LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_ALIGNLEFT | LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,19,104,164,100 + GROUPBOX "File Extension Associations",IDC_STATIC,8,93,186,138 + PUSHBUTTON "Deassociate all",IDC_ASSOCIATE_OFF,108,210,75,14 + PUSHBUTTON "Associate all",IDC_ASSOCIATE_ON,19,210,75,14 + CONTROL "Pause emulation",IDC_ACTIVE_PAUSE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,61,69,10 + CONTROL "Disable sound",IDC_ACTIVE_NOSOUND,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,74,79,10 + CTEXT "Mouse uncaptured:",IDC_STATIC,18,44,72,15,SS_CENTERIMAGE END IDD_DISK DIALOGEX 0, 0, 300, 242 @@ -1005,24 +1011,24 @@ IDD_EXPANSION DIALOGEX 0, 0, 300, 206 STYLE DS_LOCALEDIT | DS_SETFONT | DS_3DLOOK | DS_CONTROL | WS_CHILD FONT 8, "MS Sans Serif", 0, 0, 0x1 BEGIN - RTEXT "Memory: [] Graphics card memory. Required for RTG (Picasso96) emulation.",IDC_GFXCARDTEXT,25,44,53,10,SS_NOTIFY | SS_CENTERIMAGE - CONTROL "",IDC_P96MEM,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,88,40,60,20 - EDITTEXT IDC_P96RAM,152,43,34,12,ES_CENTER | ES_READONLY - GROUPBOX "RTG Graphics Card",IDC_STATIC,5,12,291,113 + RTEXT "Memory: [] Graphics card memory. Required for RTG (Picasso96) emulation.",IDC_GFXCARDTEXT,25,35,53,10,SS_NOTIFY | SS_CENTERIMAGE + CONTROL "",IDC_P96MEM,"msctls_trackbar32",TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,88,31,60,20 + EDITTEXT IDC_P96RAM,152,34,34,12,ES_CENTER | ES_READONLY + GROUPBOX "RTG Graphics Card",IDC_STATIC,5,1,291,124 CONTROL "Scale if smaller than display size setting",IDC_RTG_SCALE, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,25,74,162,10 + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,25,65,162,10 CONTROL "Match host and RTG color depth if possible",IDC_RTG_MATCH_DEPTH, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,25,62,163,10 - COMBOBOX IDC_RTG_8BIT,211,29,68,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP - COMBOBOX IDC_RTG_16BIT,211,44,68,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP - COMBOBOX IDC_RTG_24BIT,211,59,68,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP - COMBOBOX IDC_RTG_32BIT,211,74,68,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,25,53,163,10 + COMBOBOX IDC_RTG_8BIT,211,21,68,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_RTG_16BIT,211,36,68,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_RTG_24BIT,211,51,68,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_RTG_32BIT,211,66,68,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP CONTROL "Always scale in windowed mode",IDC_RTG_SCALE_ALLOW, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,25,86,162,10 - COMBOBOX IDC_RTG_SCALE_ASPECTRATIO,211,101,68,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP - RTEXT "Aspect ratio:",IDC_STATIC,153,102,52,10,SS_CENTERIMAGE - RTEXT "Refresh rate:",IDC_STATIC,22,103,51,10,SS_CENTERIMAGE - COMBOBOX IDC_RTG_VBLANKRATE,77,101,68,150,CBS_DROPDOWN | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,25,77,162,10 + COMBOBOX IDC_RTG_SCALE_ASPECTRATIO,211,108,68,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP + CTEXT "Aspect ratio:",IDC_STATIC,215,95,60,10,SS_CENTERIMAGE + CTEXT "Refresh rate:",IDC_STATIC,28,95,64,10,SS_CENTERIMAGE + COMBOBOX IDC_RTG_VBLANKRATE,24,108,68,150,CBS_DROPDOWN | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP CONTROL "bsdsocket.library [] bsdsocket network library emulation.",IDC_SOCKETS, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,142,148,120,10 CONTROL "uaenet.device [] Sana 2 compatible network device emulation. WinPcap required.",IDC_SANA2, @@ -1035,6 +1041,10 @@ BEGIN CONTROL "Catweasel Z2 emulation [] Catweasel MK2 Zorro II card emulation. Physical Windows compatible Catweasel card and drivers required.",IDC_CATWEASEL, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,148,101,10 GROUPBOX "Miscellaneous Expansions",IDC_STATIC,5,130,117,66 + COMBOBOX IDC_RTG_Z2Z3,26,14,68,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP + CTEXT "Buffer mode:",IDC_STATIC,112,95,81,10,SS_CENTERIMAGE + COMBOBOX IDC_RTG_BUFFERCNT,111,108,84,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP + CTEXT "Color modes:",IDC_STATIC,215,9,62,10,SS_CENTERIMAGE END IDD_INPUTMAP DIALOGEX 0, 0, 300, 240 @@ -1064,8 +1074,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 2,3,3,0 - PRODUCTVERSION 2,3,3,0 + FILEVERSION 2,4,0,0 + PRODUCTVERSION 2,4,0,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -1081,12 +1091,12 @@ BEGIN BLOCK "040904b0" BEGIN VALUE "FileDescription", "WinUAE" - VALUE "FileVersion", "2.3.3.0" + VALUE "FileVersion", "2.4.0.0" VALUE "InternalName", "WinUAE" - VALUE "LegalCopyright", "© 1996-2011 under the GNU Public License (GPL)" + VALUE "LegalCopyright", "© 1996-2012 under the GNU Public License (GPL)" VALUE "OriginalFilename", "WinUAE.exe" VALUE "ProductName", "WinUAE" - VALUE "ProductVersion", "2.3.3.0" + VALUE "ProductVersion", "2.4.0.0" END END BLOCK "VarFileInfo" @@ -1238,8 +1248,13 @@ BEGIN BEGIN END + IDD_FILESYS, DIALOG + BEGIN + END + IDD_CHIPSET, DIALOG BEGIN + BOTTOMMARGIN, 165 END IDD_CHIPSET2, DIALOG @@ -1387,7 +1402,7 @@ BEGIN IDS_SELECTFILESYSROOT "Please select the root directory of the file system..." IDS_DEFAULTMIDIOUT "Default MIDI-Out Device" IDS_CONTRIBUTORS1 "Bernd Schmidt - The Grand-Master\nSam Jordan - Custom-chip, floppy-DMA, etc.\nMathias Ortmann - Original WinUAE Main Guy, BSD Socket support\nBrian King - Picasso96 Support, Integrated GUI for WinUAE, previous WinUAE Main Guy\nToni Wilen - Core updates, WinUAE Main Guy\nGustavo Goedert/Peter Remmers/Michael Sontheimer/Tomi Hakala/Tim Gunn/Nemo Pohle - DOS Port Stuff\nSamuel Devulder/Olaf Barthel/Sam Jordan - Amiga Ports\nKrister Bergman - XFree86 and OS/2 Port\nA. Blanchard/Ernesto Corvi - MacOS Port\nChristian Bauer - BeOS Port\nIan Stephenson - NextStep Port\nPeter Teichmann - Acorn/RiscOS Port\nStefan Reinauer - ZorroII/III AutoConfig, Serial Support\nChristian Schmitt/Chris Hames - Serial Support\nHerman ten Brugge - 68020/68881 Emulation Code\nTauno Taipaleenmaki - Various UAE-Control/UAE-Library Support\nBrett Eden/Tim Gunn/Paolo Besser/Nemo Pohle - Various Docs and Web-Sites\nGeorg Veichtlbauer - Help File coordinator, German GUI\nFulvio Leonardi - Italian translator for WinUAE\n" - IDS_CONTRIBUTORS2 "Bill Panagouleas - Hardware support\nSpecial thanks to Alexander Kneer and Tobias Abt (The Picasso96 Team)\nSteven Weiser - Postscript printing emulation idea and testing.\nPéter Tóth /Balázs Rátkai/Iván Herczeg/András Arató - Hungarian translation.\nKarsten Bock, Gavin Fance, Dirk Trowe and Christian Schindler - Freezer cartridge hardware support.\nMikko Nieminen - Demo compatibility testing.\nArabuusimiehet - [This information is on a need-to-know basis]" + IDS_CONTRIBUTORS2 "Arnljot Arntsen, Bill Panagouleas, Cloanto - Hardware support\nSpecial thanks to Alexander Kneer and Tobias Abt (The Picasso96 Team)\nSteven Weiser - Postscript printing emulation idea and testing.\nPéter Tóth /Balázs Rátkai/Iván Herczeg/András Arató - Hungarian translation.\nKarsten Bock, Gavin Fance, Dirk Trowe and Christian Schindler - Freezer cartridge hardware support.\nMikko Nieminen - Demo compatibility testing.\nArabuusimiehet - [This information is on a need-to-know basis]" IDS_INVALIDPRTPORT "The printer you have in this configuration is not valid on this machine.\n" IDS_RESTOREUSS "Restore a WinUAE snapshot file" IDS_USS "WinUAE snapshot files" @@ -1481,8 +1496,8 @@ BEGIN IDS_SCREEN_WINDOWED "Windowed" IDS_SCREEN_FULLSCREEN "Fullscreen" IDS_SCREEN_FULLWINDOW "Full-window" - IDS_SCREEN_VSYNC "VSync" - IDS_SCREEN_VSYNC_AUTOSWITCH "AutoVSync" + IDS_SCREEN_VSYNC "Legacy VSync" + IDS_SCREEN_VSYNC_AUTOSWITCH "Legacy VS, 50/60Hz" IDS_SOUND_MONO "Mono" IDS_SOUND_MIXED "Mixed" IDS_SOUND_STEREO "Stereo" @@ -1672,8 +1687,16 @@ BEGIN IDS_PORT_AUTOFIRE_ALWAYS "Autofire (always)" IDS_PORT_AUTOFIRE_NO "No autofire" IDS_AUTOSCALE_INTEGER "Integer scaling" - IDS_SCREEN_VSYNC2_AUTOSWITCH "Low latency AutoVSync" + IDS_SCREEN_VSYNC2_AUTOSWITCH "Low latency VS, 50/60Hz" IDS_SCREEN_VSYNC2 "Low latency VSync" + IDS_SCREEN_VSYNC_NONE "-" +END + +STRINGTABLE +BEGIN + IDS_INPUTQUALIFIER "Qualifiers" + IDS_GENERIC "Generic" + IDS_AUTODETECT "Autodetect" END #endif // English resources diff --git a/od-win32/rp.cpp b/od-win32/rp.cpp index cba5159b..ff7c8f59 100644 --- a/od-win32/rp.cpp +++ b/od-win32/rp.cpp @@ -73,61 +73,61 @@ static int isrecursive (void) static void outhex (const uae_u8 *s) { for (;;) { - write_log (L"%02X%02X ", s[0], s[1]); + write_log (_T("%02X%02X "), s[0], s[1]); if (s[0] == 0 && s[1] == 0) break; s += 2; } - write_log (L"\n"); + write_log (_T("\n")); } static const TCHAR *getmsg (int msg) { switch (msg) { - case RPIPCGM_REGISTER: return L"RPIPCGM_REGISTER"; - case RPIPCGM_FEATURES: return L"RPIPCGM_FEATURES"; - case RPIPCGM_CLOSED: return L"RPIPCGM_CLOSED"; - case RPIPCGM_ACTIVATED: return L"RPIPCGM_ACTIVATED"; - case RPIPCGM_DEACTIVATED: return L"RPIPCGM_DEACTIVATED"; - case RPIPCGM_SCREENMODE: return L"RPIPCGM_SCREENMODE"; - case RPIPCGM_POWERLED: return L"RPIPCGM_POWERLED"; - case RPIPCGM_DEVICES: return L"RPIPCGM_DEVICES"; - case RPIPCGM_DEVICEACTIVITY: return L"RPIPCGM_DEVICEACTIVITY"; - case RPIPCGM_MOUSECAPTURE: return L"RPIPCGM_MOUSECAPTURE"; - case RPIPCGM_HOSTAPIVERSION: return L"RPIPCGM_HOSTAPIVERSION"; - case RPIPCGM_PAUSE: return L"RPIPCGM_PAUSE"; - case RPIPCGM_DEVICECONTENT: return L"RPIPCGM_DEVICECONTENT"; - case RPIPCGM_TURBO: return L"RPIPCGM_TURBO"; - case RPIPCGM_PING: return L"RPIPCGM_PING"; - case RPIPCGM_VOLUME: return L"RPIPCGM_VOLUME"; - case RPIPCGM_ESCAPED: return L"RPIPCGM_ESCAPED"; - case RPIPCGM_PARENT: return L"RPIPCGM_PARENT"; - case RPIPCGM_DEVICESEEK: return L"RPIPCGM_DEVICESEEK"; - case RPIPCGM_CLOSE: return L"RPIPCGM_CLOSE"; - case RPIPCGM_DEVICEREADWRITE: return L"RPIPCGM_DEVICEREADWRITE"; - case RPIPCGM_HOSTVERSION: return L"RPIPCGM_HOSTVERSION"; - case RPIPCGM_INPUTDEVICE: return L"RPIPCGM_INPUTDEVICE"; - - case RPIPCHM_CLOSE: return L"RPIPCHM_CLOSE"; - case RPIPCHM_SCREENMODE: return L"RPIPCHM_SCREENMODE"; - case RPIPCHM_SCREENCAPTURE: return L"RPIPCHM_SCREENCAPTURE"; - case RPIPCHM_PAUSE: return L"RPIPCHM_PAUSE"; - case RPIPCHM_DEVICECONTENT: return L"RPIPCHM_DEVICECONTENT"; - case RPIPCHM_RESET: return L"RPIPCHM_RESET"; - case RPIPCHM_TURBO: return L"RPIPCHM_TURBO"; - case RPIPCHM_PING: return L"RPIPCHM_PING"; - case RPIPCHM_VOLUME: return L"RPIPCHM_VOLUME"; - case RPIPCHM_ESCAPEKEY: return L"RPIPCHM_ESCAPEKEY"; - case RPIPCHM_EVENT: return L"RPIPCHM_EVENT"; - case RPIPCHM_MOUSECAPTURE: return L"RPIPCHM_MOUSECAPTURE"; - case RPIPCHM_SAVESTATE: return L"RPIPCHM_SAVESTATE"; - case RPIPCHM_LOADSTATE: return L"RPIPCHM_LOADSTATE"; - case RPIPCHM_FLUSH: return L"RPIPCHM_FLUSH"; - case RPIPCHM_DEVICEREADWRITE: return L"RPIPCHM_DEVICEREADWRITE"; - case RPIPCHM_QUERYSCREENMODE: return L"RPIPCHM_QUERYSCREENMODE"; - case RPIPCHM_GUESTAPIVERSION : return L"RPIPCHM_GUESTAPIVERSION"; - default: return L"UNKNOWN"; + case RPIPCGM_REGISTER: return _T("RPIPCGM_REGISTER"); + case RPIPCGM_FEATURES: return _T("RPIPCGM_FEATURES"); + case RPIPCGM_CLOSED: return _T("RPIPCGM_CLOSED"); + case RPIPCGM_ACTIVATED: return _T("RPIPCGM_ACTIVATED"); + case RPIPCGM_DEACTIVATED: return _T("RPIPCGM_DEACTIVATED"); + case RPIPCGM_SCREENMODE: return _T("RPIPCGM_SCREENMODE"); + case RPIPCGM_POWERLED: return _T("RPIPCGM_POWERLED"); + case RPIPCGM_DEVICES: return _T("RPIPCGM_DEVICES"); + case RPIPCGM_DEVICEACTIVITY: return _T("RPIPCGM_DEVICEACTIVITY"); + case RPIPCGM_MOUSECAPTURE: return _T("RPIPCGM_MOUSECAPTURE"); + case RPIPCGM_HOSTAPIVERSION: return _T("RPIPCGM_HOSTAPIVERSION"); + case RPIPCGM_PAUSE: return _T("RPIPCGM_PAUSE"); + case RPIPCGM_DEVICECONTENT: return _T("RPIPCGM_DEVICECONTENT"); + case RPIPCGM_TURBO: return _T("RPIPCGM_TURBO"); + case RPIPCGM_PING: return _T("RPIPCGM_PING"); + case RPIPCGM_VOLUME: return _T("RPIPCGM_VOLUME"); + case RPIPCGM_ESCAPED: return _T("RPIPCGM_ESCAPED"); + case RPIPCGM_PARENT: return _T("RPIPCGM_PARENT"); + case RPIPCGM_DEVICESEEK: return _T("RPIPCGM_DEVICESEEK"); + case RPIPCGM_CLOSE: return _T("RPIPCGM_CLOSE"); + case RPIPCGM_DEVICEREADWRITE: return _T("RPIPCGM_DEVICEREADWRITE"); + case RPIPCGM_HOSTVERSION: return _T("RPIPCGM_HOSTVERSION"); + case RPIPCGM_INPUTDEVICE: return _T("RPIPCGM_INPUTDEVICE"); + + case RPIPCHM_CLOSE: return _T("RPIPCHM_CLOSE"); + case RPIPCHM_SCREENMODE: return _T("RPIPCHM_SCREENMODE"); + case RPIPCHM_SCREENCAPTURE: return _T("RPIPCHM_SCREENCAPTURE"); + case RPIPCHM_PAUSE: return _T("RPIPCHM_PAUSE"); + case RPIPCHM_DEVICECONTENT: return _T("RPIPCHM_DEVICECONTENT"); + case RPIPCHM_RESET: return _T("RPIPCHM_RESET"); + case RPIPCHM_TURBO: return _T("RPIPCHM_TURBO"); + case RPIPCHM_PING: return _T("RPIPCHM_PING"); + case RPIPCHM_VOLUME: return _T("RPIPCHM_VOLUME"); + case RPIPCHM_ESCAPEKEY: return _T("RPIPCHM_ESCAPEKEY"); + case RPIPCHM_EVENT: return _T("RPIPCHM_EVENT"); + case RPIPCHM_MOUSECAPTURE: return _T("RPIPCHM_MOUSECAPTURE"); + case RPIPCHM_SAVESTATE: return _T("RPIPCHM_SAVESTATE"); + case RPIPCHM_LOADSTATE: return _T("RPIPCHM_LOADSTATE"); + case RPIPCHM_FLUSH: return _T("RPIPCHM_FLUSH"); + case RPIPCHM_DEVICEREADWRITE: return _T("RPIPCHM_DEVICEREADWRITE"); + case RPIPCHM_QUERYSCREENMODE: return _T("RPIPCHM_QUERYSCREENMODE"); + case RPIPCHM_GUESTAPIVERSION : return _T("RPIPCHM_GUESTAPIVERSION"); + default: return _T("UNKNOWN"); } } @@ -135,7 +135,7 @@ static void trimws (TCHAR *s) { /* Delete trailing whitespace. */ int len = _tcslen (s); - while (len > 0 && _tcscspn (s + len - 1, L"\t \r\n") == 0) + while (len > 0 && _tcscspn (s + len - 1, _T("\t \r\n")) == 0) s[--len] = '\0'; } @@ -156,7 +156,7 @@ static int port_insert (int num, int devicetype, DWORD flags, const TCHAR *name) if (num < 0 || num >= maxjports) return FALSE; if (_tcslen (name) == 0) { - inputdevice_joyport_config (&changed_prefs, L"none", num, 0, 0); + inputdevice_joyport_config (&changed_prefs, _T("none"), num, 0, 0); return TRUE; } devicetype2 = -1; @@ -171,9 +171,9 @@ static int port_insert (int num, int devicetype, DWORD flags, const TCHAR *name) for (int i = 0; i < 10; i++) { TCHAR tmp2[100]; - _stprintf (tmp2, L"KeyboardLayout%d", i); + _stprintf (tmp2, _T("KeyboardLayout%d"), i); if (!_tcscmp (tmp2, name)) { - _stprintf (tmp2, L"kbd%d", i + 1); + _stprintf (tmp2, _T("kbd%d"), i + 1); return inputdevice_joyport_config (&changed_prefs, tmp2, num, devicetype2, 0); } } @@ -196,7 +196,7 @@ static BOOL RPPostMessagex(UINT uMessage, WPARAM wParam, LPARAM lParam, const RP int dolog = log_rp; if (!pInfo) { - write_log (L"RPPOST: pInfo == NULL!\n"); + write_log (_T("RPPOST: pInfo == NULL!\n")); return FALSE; } if (uMessage == RPIPCGM_DEVICESEEK || uMessage == RPIPCGM_DEVICEACTIVITY) @@ -205,14 +205,14 @@ static BOOL RPPostMessagex(UINT uMessage, WPARAM wParam, LPARAM lParam, const RP cnt++; ncnt = cnt; if (dolog) - write_log (L"RPPOST_%d->\n", ncnt); + write_log (_T("RPPOST_%d->\n"), ncnt); v = RPPostMessage (uMessage, wParam, lParam, pInfo); recursive--; if (dolog) { - write_log (L"RPPOST_%d(%s [%d], %08x, %08x)\n", ncnt, + write_log (_T("RPPOST_%d(%s [%d], %08x, %08x)\n"), ncnt, getmsg (uMessage), uMessage - WM_APP, wParam, lParam); if (v == FALSE) - write_log (L"ERROR %d\n", GetLastError ()); + write_log (_T("ERROR %d\n"), GetLastError ()); } return v; } @@ -226,11 +226,11 @@ static BOOL RPSendMessagex (UINT uMessage, WPARAM wParam, LPARAM lParam, int dolog = log_rp; if (!pInfo) { - write_log (L"RPSEND: pInfo == NULL!\n"); + write_log (_T("RPSEND: pInfo == NULL!\n")); return FALSE; } if (!pInfo->hHostMessageWindow) { - write_log (L"RPSEND: pInfo->hHostMessageWindow == NULL!\n"); + write_log (_T("RPSEND: pInfo->hHostMessageWindow == NULL!\n")); return FALSE; } if (uMessage == RPIPCGM_DEVICESEEK) @@ -239,14 +239,14 @@ static BOOL RPSendMessagex (UINT uMessage, WPARAM wParam, LPARAM lParam, cnt++; ncnt = cnt; if (dolog) - write_log (L"RPSEND_%d->\n", ncnt); + write_log (_T("RPSEND_%d->\n"), ncnt); v = RPSendMessage (uMessage, wParam, lParam, pData, dwDataSize, pInfo, plResult); recursive--; if (dolog) { - write_log (L"RPSEND_%d(%s [%d], %08x, %08x, %08x, %d)\n", ncnt, + write_log (_T("RPSEND_%d(%s [%d], %08x, %08x, %08x, %d)\n"), ncnt, getmsg (uMessage), uMessage - WM_APP, wParam, lParam, pData, dwDataSize); if (v == FALSE) - write_log (L"ERROR %d\n", GetLastError ()); + write_log (_T("ERROR %d\n"), GetLastError ()); } return v; } @@ -268,7 +268,7 @@ static void fixup_size (struct uae_prefs *prefs) if (done) return; done = 1; - write_log(L"fixup_size(%d,%d)\n", prefs->gfx_xcenter_size, prefs->gfx_ycenter_size); + write_log(_T("fixup_size(%d,%d)\n"), prefs->gfx_xcenter_size, prefs->gfx_ycenter_size); if (prefs->gfx_xcenter_size > 0) { int hres = prefs->gfx_resolution; if (prefs->gfx_filter) { @@ -293,7 +293,7 @@ static void fixup_size (struct uae_prefs *prefs) prefs->gfx_size_win.height = (prefs->gfx_ycenter_size * 2) >> (VRES_QUAD - vres); prefs->gfx_filter_autoscale = 0; } - write_log(L"-> %dx%d\n", prefs->gfx_size_win.width, prefs->gfx_size_win.height); + write_log(_T("-> %dx%d\n"), prefs->gfx_size_win.width, prefs->gfx_size_win.height); } static int getmult (int mult) @@ -370,7 +370,7 @@ static void get_screenmode (struct RPScreenMode *sm, struct uae_prefs *p) m = RP_SCREENMODE_4X; if (log_rp) - write_log (L"GET_RPSM: hres=%d (%d) vres=%d (%d) full=%d xcpos=%d ycpos=%d w=%d h=%d vm=%d hm=%d\n", + write_log (_T("GET_RPSM: hres=%d (%d) vres=%d (%d) full=%d xcpos=%d ycpos=%d w=%d h=%d vm=%d hm=%d\n"), totalhdbl, hres, totalvdbl, vres, full, p->gfx_xcenter_pos, p->gfx_ycenter_pos, p->gfx_size_win.width, p->gfx_size_win.height, @@ -411,7 +411,7 @@ static void get_screenmode (struct RPScreenMode *sm, struct uae_prefs *p) sm->dwClipFlags = cf; if (log_rp) - write_log (L"GET_RPSM: %08X %dx%d %dx%d hres=%d (%d) vres=%d (%d) disp=%d fs=%d\n", + write_log (_T("GET_RPSM: %08X %dx%d %dx%d hres=%d (%d) vres=%d (%d) disp=%d fs=%d\n"), sm->dwScreenMode, sm->lClipLeft, sm->lClipTop, sm->lClipWidth, sm->lClipHeight, totalhdbl, hres, totalvdbl, vres, p->gfx_display, full); } @@ -445,10 +445,10 @@ static void set_screenmode (struct RPScreenMode *sm, struct uae_prefs *p) disp = getdisplay (p); if (log_rp) { - write_log (L"SET_RPSM: %08X %dx%d %dx%d hres=%d vres=%d disp=%d fs=%d smm=%d\n", + write_log (_T("SET_RPSM: %08X %dx%d %dx%d hres=%d vres=%d disp=%d fs=%d smm=%d\n"), sm->dwScreenMode, sm->lClipLeft, sm->lClipTop, sm->lClipWidth, sm->lClipHeight, hdbl, vdbl, display, fs, smm); - write_log (L"aspect=%d stretch=%d force=%d integer=%d\n", + write_log (_T("aspect=%d stretch=%d force=%d integer=%d\n"), keepaspect, stretch, forcesize, integerscale); } @@ -536,7 +536,7 @@ static void set_screenmode (struct RPScreenMode *sm, struct uae_prefs *p) } if (log_rp) - write_log(L"%dx%d %dx%d %dx%d %08x HM=%d VM=%d\n", + write_log(_T("%dx%d %dx%d %dx%d %08x HM=%d VM=%d\n"), sm->lClipLeft, sm->lClipTop, sm->lClipWidth, sm->lClipHeight, sm->lTargetWidth, sm->lTargetHeight, sm->dwClipFlags, hmult, vmult); if (!integerscale) { @@ -584,7 +584,7 @@ static void set_screenmode (struct RPScreenMode *sm, struct uae_prefs *p) } if (log_rp) - write_log (L"WW=%d WH=%d FW=%d FH=%d HM=%d VM=%d XP=%d YP=%d XS=%d YS=%d AS=%d AR=%d,%d\n", + write_log (_T("WW=%d WH=%d FW=%d FH=%d HM=%d VM=%d XP=%d YP=%d XS=%d YS=%d AS=%d AR=%d,%d\n"), p->gfx_size_win.width, p->gfx_size_win.height, p->gfx_size_fs.width, p->gfx_size_fs.height, p->gfx_filter_horiz_zoom_mult, p->gfx_filter_vert_zoom_mult, @@ -602,11 +602,11 @@ static LRESULT CALLBACK RPHostMsgFunction2 (UINT uMessage, WPARAM wParam, LPARAM LPCVOID pData, DWORD dwDataSize, LPARAM lMsgFunctionParam) { if (log_rp) { - write_log (L"RPFUNC(%s [%d], %08x, %08x, %08x, %d, %08x)\n", + write_log (_T("RPFUNC(%s [%d], %08x, %08x, %08x, %d, %08x)\n"), getmsg (uMessage), uMessage - WM_APP, wParam, lParam, pData, dwDataSize, lMsgFunctionParam); if (uMessage == RPIPCHM_DEVICECONTENT) { struct RPDeviceContent *dc = (struct RPDeviceContent*)pData; - write_log (L" Cat=%d Num=%d Flags=%08x '%s'\n", + write_log (_T(" Cat=%d Num=%d Flags=%08x '%s'\n"), dc->btDeviceCategory, dc->btDeviceNumber, dc->dwFlags, dc->szContent); } } @@ -614,7 +614,7 @@ static LRESULT CALLBACK RPHostMsgFunction2 (UINT uMessage, WPARAM wParam, LPARAM switch (uMessage) { default: - write_log (L"RP: Unknown or unsupported command %x\n", uMessage); + write_log (_T("RP: Unknown or unsupported command %x\n"), uMessage); break; case RPIPCHM_PING: return TRUE; @@ -726,8 +726,8 @@ static LRESULT CALLBACK RPHostMsgFunction2 (UINT uMessage, WPARAM wParam, LPARAM return 1; } if (vpos == 0) { - savestate_initsave (L"", 1, TRUE, true); - save_state (s, L"AmigaForever"); + savestate_initsave (_T(""), 1, TRUE, true); + save_state (s, _T("AmigaForever")); ret = 1; } else { //savestate_initsave (s, 1, TRUE); @@ -799,15 +799,15 @@ HRESULT rp_init (void) { HRESULT hr; - write_log (L"rp_init()\n"); + write_log (_T("rp_init()\n")); hr = RPInitializeGuest (&guestinfo, hInst, rp_param, RPHostMsgFunction, 0); if (SUCCEEDED (hr)) { initialized = TRUE; rp_version = rp_revision = rp_build = -1; rp_hostversion (&rp_version, &rp_revision, &rp_build); - write_log (L"rp_init('%s') succeeded. Version: %d.%d.%d\n", rp_param, rp_version, rp_revision, rp_build); + write_log (_T("rp_init('%s') succeeded. Version: %d.%d.%d\n"), rp_param, rp_version, rp_revision, rp_build); } else { - write_log (L"rp_init('%s') failed, error code %08x\n", rp_param, hr); + write_log (_T("rp_init('%s') failed, error code %08x\n"), rp_param, hr); } xfree (rp_param); rp_param = NULL; @@ -854,7 +854,7 @@ static void sendenum (void) int cnt; WIN32GUI_LoadUIString (IDS_KEYJOY, tmp, sizeof tmp / sizeof (TCHAR)); - _tcscat (tmp, L"\n"); + _tcscat (tmp, _T("\n")); p1 = tmp; cnt = 0; for (;;) { @@ -863,7 +863,7 @@ static void sendenum (void) TCHAR tmp2[100]; *p2++ = 0; memset (&desc, 0, sizeof desc); - _stprintf (tmp2, L"KeyboardLayout%d", cnt); + _stprintf (tmp2, _T("KeyboardLayout%d"), cnt); _tcscpy (desc.szHostInputID, tmp2); _tcscpy (desc.szHostInputName, p1); desc.dwHostInputType= RP_HOSTINPUT_KEYJOY_MAP1 + cnt; @@ -871,7 +871,7 @@ static void sendenum (void) if (cnt == 0) desc.dwInputDeviceFeatures |= RP_FEATURE_INPUTDEVICE_JOYPAD; if (log_rp) - write_log(L"Enum%d: '%s' '%s'\n", cnt, desc.szHostInputName, desc.szHostInputID); + write_log(_T("Enum%d: '%s' '%s'\n"), cnt, desc.szHostInputName, desc.szHostInputID); RPSendMessagex (RPIPCGM_INPUTDEVICE, 0, 0, &desc, sizeof desc, &guestinfo, NULL); cnt++; p1 = p2; @@ -882,7 +882,7 @@ static void sendenum (void) cnt = 0; while ((cnt = rp_input_enum (&desc, cnt)) >= 0) { if (log_rp) - write_log(L"Enum%d: '%s' '%s' (%x/%x)\n", + write_log(_T("Enum%d: '%s' '%s' (%x/%x)\n"), cnt, desc.szHostInputName, desc.szHostInputID, desc.dwHostInputVendorID, desc.dwHostInputProductID); RPSendMessagex (RPIPCGM_INPUTDEVICE, 0, 0, &desc, sizeof desc, &guestinfo, NULL); } @@ -929,14 +929,14 @@ void rp_fixup_options (struct uae_prefs *p) if (!initialized) return; - write_log (L"rp_fixup_options(escapekey=%d,escapeholdtime=%d,screenmode=%d,inputmode=%d)\n", + write_log (_T("rp_fixup_options(escapekey=%d,escapeholdtime=%d,screenmode=%d,inputmode=%d)\n"), rp_rpescapekey, rp_rpescapeholdtime, rp_screenmode, rp_inputmode); max_horiz_dbl = currprefs.gfx_max_horizontal; max_vert_dbl = currprefs.gfx_max_vertical; maxjports = (rp_version * 256 + rp_revision) >= 2 * 256 + 3 ? MAX_JPORTS : 2; - write_log (L"w=%dx%d fs=%dx%d pos=%dx%d %dx%d HV=%d,%d J=%d\n", + write_log (_T("w=%dx%d fs=%dx%d pos=%dx%d %dx%d HV=%d,%d J=%d\n"), p->gfx_size_win.width, p->gfx_size_win.height, p->gfx_size_fs.width, p->gfx_size_fs.height, p->gfx_xcenter_pos, p->gfx_ycenter_pos, @@ -1032,7 +1032,7 @@ static void rp_device_change (int dev, int num, int mode, bool readonly, const T if (content) _tcscpy (dc.szContent, content); if (log_rp) - write_log (L"RPIPCGM_DEVICECONTENT cat=%d num=%d type=%d '%s'\n", + write_log (_T("RPIPCGM_DEVICECONTENT cat=%d num=%d type=%d '%s'\n"), dc.btDeviceCategory, dc.btDeviceNumber, dc.dwInputDevice, dc.szContent); RPSendMessagex (RPIPCGM_DEVICECONTENT, 0, 0, &dc, sizeof(struct RPDeviceContent), &guestinfo, NULL); } @@ -1050,7 +1050,7 @@ void rp_input_change (int num) name[0] = 0; if (k >= 0) { - _stprintf (name, L"KeyboardLayout%d", k); + _stprintf (name, _T("KeyboardLayout%d"), k); } else if (j >= 0) { _tcscpy (name, inputdevice_get_device_unique_name (IDTYPE_JOYSTICK, j)); } else if (m >= 0) { @@ -1064,7 +1064,7 @@ void rp_input_change (int num) } } if (log_rp) - write_log(L"PORT%d: '%s':%d\n", num, name, mode); + write_log(_T("PORT%d: '%s':%d\n"), num, name, mode); rp_device_change (RP_DEVICECATEGORY_INPUTPORT, num, mode, false, name); } void rp_disk_image_change (int num, const TCHAR *name, bool writeprotected) diff --git a/od-win32/screenshot.cpp b/od-win32/screenshot.cpp index be06ab32..4bd25810 100644 --- a/od-win32/screenshot.cpp +++ b/od-win32/screenshot.cpp @@ -100,7 +100,7 @@ int screenshot_prepare (void) screenshot_free (); - regqueryint (NULL, L"Screenshot_Original", &screenshot_originalsize); + regqueryint (NULL, _T("Screenshot_Original"), &screenshot_originalsize); if (screenshot_originalsize && !WIN32GFX_IsPicassoScreen ()) { int spitch, dpitch, x, y; @@ -238,7 +238,7 @@ static void _cdecl pngtest_blah (png_structp png_ptr, png_const_charp message) TCHAR *name = au ("unknown"); if (png_ptr != NULL && png_ptr->error_ptr != NULL) name = au ((char*)png_ptr->error_ptr); - write_log (L"%s: libpng warning: %s\n", name, message); + write_log (_T("%s: libpng warning: %s\n"), name, message); xfree (name); } @@ -327,11 +327,11 @@ int screenshotf (const TCHAR *spath, int mode, int doprepare) TCHAR filename[MAX_DPATH]; TCHAR path[MAX_DPATH]; TCHAR name[MAX_DPATH]; - TCHAR underline[] = L"_"; + TCHAR underline[] = _T("_"); int number = 0; if (spath) { - fp = _tfopen (spath, L"wb"); + fp = _tfopen (spath, _T("wb")); if (fp) { #if PNG_SCREENSHOTS > 0 if (screenshotmode) @@ -344,7 +344,7 @@ int screenshotf (const TCHAR *spath, int mode, int doprepare) goto oops; } } - fetch_path (L"ScreenshotPath", path, sizeof (path) / sizeof (TCHAR)); + fetch_path (_T("ScreenshotPath"), path, sizeof (path) / sizeof (TCHAR)); CreateDirectory (path, NULL); name[0] = 0; if (currprefs.floppyslots[0].dfxtype >= 0) @@ -357,11 +357,11 @@ int screenshotf (const TCHAR *spath, int mode, int doprepare) while(++number < 1000) // limit 999 iterations / screenshots { - _stprintf (filename, L"%s%s%s%03d.%s", path, name, underline, number, screenshotmode ? L"png" : L"bmp"); - if ((fp = _tfopen (filename, L"rb")) == NULL) // does file not exist? + _stprintf (filename, _T("%s%s%s%03d.%s"), path, name, underline, number, screenshotmode ? _T("png") : _T("bmp")); + if ((fp = _tfopen (filename, _T("rb"))) == NULL) // does file not exist? { int ok = 0; - if ((fp = _tfopen (filename, L"wb")) == NULL) + if ((fp = _tfopen (filename, _T("wb"))) == NULL) goto oops; // error #if PNG_SCREENSHOTS > 0 if (screenshotmode) @@ -373,7 +373,7 @@ int screenshotf (const TCHAR *spath, int mode, int doprepare) fp = NULL; if (!ok) goto oops; - write_log (L"Screenshot saved as \"%s\"\n", filename); + write_log (_T("Screenshot saved as \"%s\"\n"), filename); allok = 1; break; } diff --git a/od-win32/serial_win32.cpp b/od-win32/serial_win32.cpp index 9da9904f..5be24773 100644 --- a/od-win32/serial_win32.cpp +++ b/od-win32/serial_win32.cpp @@ -95,7 +95,7 @@ void SERPER (uae_u16 w) serial_period_hsync_counter = 0; - write_log (L"SERIAL: period=%d, baud=%d, hsyncs=%d, bits=%d, PC=%x\n", w, baud, serial_period_hsyncs, ninebit ? 9 : 8, M68K_GETPC); + write_log (_T("SERIAL: period=%d, baud=%d, hsyncs=%d, bits=%d, PC=%x\n"), w, baud, serial_period_hsyncs, ninebit ? 9 : 8, M68K_GETPC); if (ninebit) baud *= 2; @@ -135,7 +135,7 @@ static void checkreceive_enet (int mode) ovrun = 1; INTREQ (0x8000 | 0x0800); while (enet_readser (&recdata)); - write_log (L"SERIAL: overrun\n"); + write_log (_T("SERIAL: overrun\n")); } return; } @@ -151,7 +151,7 @@ static void checkreceive_enet (int mode) data_in_serdatr = 1; serial_check_irq (); #if SERIALDEBUG > 2 - write_log (L"SERIAL: received %02X (%c)\n", serdatr & 0xff, dochar (serdatr)); + write_log (_T("SERIAL: received %02X (%c)\n"), serdatr & 0xff, dochar (serdatr)); #endif #endif } @@ -174,7 +174,7 @@ static void checkreceive_serial (int mode) ovrun = 1; INTREQ (0x8000 | 0x0800); while (readser (&recdata)); - write_log (L"SERIAL: overrun\n"); + write_log (_T("SERIAL: overrun\n")); } return; } @@ -192,7 +192,7 @@ static void checkreceive_serial (int mode) } else { ninebitdata = recdata; if ((ninebitdata & ~1) != 0xa8) { - write_log (L"SERIAL: 9-bit serial emulation sync lost, %02X != %02X\n", ninebitdata & ~1, 0xa8); + write_log (_T("SERIAL: 9-bit serial emulation sync lost, %02X != %02X\n"), ninebitdata & ~1, 0xa8); ninebitdata = 0; return; } @@ -210,7 +210,7 @@ static void checkreceive_serial (int mode) data_in_serdatr = 1; serial_check_irq (); #if SERIALDEBUG > 2 - write_log (L"SERIAL: received %02X (%c)\n", serdatr & 0xff, dochar (serdatr)); + write_log (_T("SERIAL: received %02X (%c)\n"), serdatr & 0xff, dochar (serdatr)); #endif #endif } @@ -248,7 +248,7 @@ static void checksend (int mode) data_in_serdat = 0; INTREQ (0x8000 | 0x0001); #if SERIALDEBUG > 2 - write_log (L"SERIAL: send %04X (%c)\n", serdatshift, dochar (serdatshift)); + write_log (_T("SERIAL: send %04X (%c)\n"), serdatshift, dochar (serdatshift)); #endif } } @@ -276,25 +276,25 @@ void SERDAT (uae_u16 w) if (!(w & 0x3ff)) { #if SERIALDEBUG > 1 - write_log (L"SERIAL: zero serial word written?! PC=%x\n", M68K_GETPC); + write_log (_T("SERIAL: zero serial word written?! PC=%x\n"), M68K_GETPC); #endif return; } #if SERIALDEBUG > 1 if (data_in_serdat) { - write_log (L"SERIAL: program wrote to SERDAT but old byte wasn't fetched yet\n"); + write_log (_T("SERIAL: program wrote to SERDAT but old byte wasn't fetched yet\n")); } #endif if (seriallog) - write_log (L"%c", dochar (w)); + write_log (_T("%c"), dochar (w)); if (serper == 372) { if (enforcermode & 2) { - console_out_f (L"%c", dochar (w)); + console_out_f (_T("%c"), dochar (w)); if (w == 256 + 10) - console_out (L"\n"); + console_out (_T("\n")); } } @@ -303,7 +303,7 @@ void SERDAT (uae_u16 w) checksend (1); #if SERIALDEBUG > 2 - write_log (L"SERIAL: wrote 0x%04x (%c) PC=%x\n", w, dochar (w), M68K_GETPC); + write_log (_T("SERIAL: wrote 0x%04x (%c) PC=%x\n"), w, dochar (w), M68K_GETPC); #endif return; @@ -321,7 +321,7 @@ uae_u16 SERDATR (void) if (ovrun) serdatr |= 0x8000; #if SERIALDEBUG > 2 - write_log (L"SERIAL: read 0x%04x (%c) %x\n", serdatr, dochar (serdatr), M68K_GETPC); + write_log (_T("SERIAL: read 0x%04x (%c) %x\n"), serdatr, dochar (serdatr), M68K_GETPC); #endif ovrun = 0; data_in_serdatr = 0; @@ -369,7 +369,7 @@ static uae_u8 oldserbits; static void serial_status_debug (TCHAR *s) { #if SERIALHSDEBUG > 1 - write_log (L"%s: DTR=%d RTS=%d CD=%d CTS=%d DSR=%d\n", s, + write_log (_T("%s: DTR=%d RTS=%d CD=%d CTS=%d DSR=%d\n"), s, (oldserbits & 0x80) ? 0 : 1, (oldserbits & 0x40) ? 0 : 1, (oldserbits & 0x20) ? 0 : 1, (oldserbits & 0x10) ? 0 : 1, (oldserbits & 0x08) ? 0 : 1); #endif @@ -435,7 +435,7 @@ uae_u8 serial_readstatus (uae_u8 dir) oldserbits &= ~(0x08 | 0x10 | 0x20); oldserbits |= serbits; - serial_status_debug (L"read"); + serial_status_debug (_T("read")); return oldserbits; } @@ -457,12 +457,12 @@ uae_u8 serial_writestatus (uae_u8 newstate, uae_u8 dir) if (newstate & 0x40) { setserstat (TIOCM_RTS, 0); #if SERIALHSDEBUG > 0 - write_log (L"SERIAL: RTS cleared\n"); + write_log (_T("SERIAL: RTS cleared\n")); #endif } else { setserstat (TIOCM_RTS, 1); #if SERIALHSDEBUG > 0 - write_log (L"SERIAL: RTS set\n"); + write_log (_T("SERIAL: RTS set\n")); #endif } } @@ -470,20 +470,20 @@ uae_u8 serial_writestatus (uae_u8 newstate, uae_u8 dir) #if 0 /* CIA io-pins can be read even when set to output.. */ if ((newstate & 0x20) != (oldserbits & 0x20) && (dir & 0x20)) - write_log (L"SERIAL: warning, program tries to use CD as an output!\n"); + write_log (_T("SERIAL: warning, program tries to use CD as an output!\n")); if ((newstate & 0x10) != (oldserbits & 0x10) && (dir & 0x10)) - write_log (L"SERIAL: warning, program tries to use CTS as an output!\n"); + write_log (_T("SERIAL: warning, program tries to use CTS as an output!\n")); if ((newstate & 0x08) != (oldserbits & 0x08) && (dir & 0x08)) - write_log (L"SERIAL: warning, program tries to use DSR as an output!\n"); + write_log (_T("SERIAL: warning, program tries to use DSR as an output!\n")); #endif if (logcnt > 0) { if (((newstate ^ oldserbits) & 0x40) && !(dir & 0x40)) { - write_log (L"SERIAL: warning, program tries to use RTS as an input! PC=%x\n", M68K_GETPC); + write_log (_T("SERIAL: warning, program tries to use RTS as an input! PC=%x\n"), M68K_GETPC); logcnt--; } if (((newstate ^ oldserbits) & 0x80) && !(dir & 0x80)) { - write_log (L"SERIAL: warning, program tries to use DTR as an input! PC=%x\n", M68K_GETPC); + write_log (_T("SERIAL: warning, program tries to use DTR as an input! PC=%x\n"), M68K_GETPC); logcnt--; } } @@ -493,14 +493,14 @@ uae_u8 serial_writestatus (uae_u8 newstate, uae_u8 dir) oldserbits &= ~(0x80 | 0x40); newstate &= 0x80 | 0x40; oldserbits |= newstate; - serial_status_debug (L"write"); + serial_status_debug (_T("write")); return oldserbits; } static int enet_is (TCHAR *name) { - return !_tcsnicmp (name, L"ENET:", 5); + return !_tcsnicmp (name, _T("ENET:"), 5); } void serial_open (void) @@ -513,7 +513,7 @@ void serial_open (void) enet_open (currprefs.sername); } else { if(!openser (currprefs.sername)) { - write_log (L"SERIAL: Could not open device %s\n", currprefs.sername); + write_log (_T("SERIAL: Could not open device %s\n"), currprefs.sername); return; } } @@ -582,7 +582,7 @@ static void enet_service (int serveronly) { case ENET_EVENT_TYPE_CONNECT: address = evt.peer->address; - write_log (L"ENET_SERVER: connect from %d.%d.%d.%d:%u\n", + write_log (_T("ENET_SERVER: connect from %d.%d.%d.%d:%u\n"), (address.host >> 0) & 0xff, (address.host >> 8) & 0xff, (address.host >> 16) & 0xff, (address.host >> 24) & 0xff, address.port); evt.peer->data = 0; @@ -602,7 +602,7 @@ static void enet_service (int serveronly) break; case ENET_EVENT_TYPE_DISCONNECT: address = evt.peer->address; - write_log (L"ENET_SERVER: disconnect from %d.%d.%d.%d:%u\n", + write_log (_T("ENET_SERVER: disconnect from %d.%d.%d.%d:%u\n"), (address.host >> 0) & 0xff, (address.host >> 8) & 0xff, (address.host >> 16) & 0xff, (address.host >> 24) & 0xff, address.port); break; @@ -615,7 +615,7 @@ static void enet_service (int serveronly) switch (evt.type) { default: - write_log (L"ENET_CLIENT: %d\n", evt.type); + write_log (_T("ENET_CLIENT: %d\n"), evt.type); break; } } @@ -631,7 +631,7 @@ static void enet_disconnect (ENetPeer *peer) if (!peer) return; - write_log (L"ENET_CLIENT: disconnecting..\n"); + write_log (_T("ENET_CLIENT: disconnecting..\n")); enet_peer_disconnect (peer, 0); while (cnt-- > 0) { enet_service (1); @@ -644,13 +644,13 @@ static void enet_disconnect (ENetPeer *peer) break; case ENET_EVENT_TYPE_DISCONNECT: - write_log (L"ENET_CLIENT: disconnection succeeded\n"); + write_log (_T("ENET_CLIENT: disconnection succeeded\n")); enetpeer = NULL; return; } } } - write_log (L"ENET_CLIENT: disconnection forced\n"); + write_log (_T("ENET_CLIENT: disconnection forced\n")); enet_peer_reset (enetpeer); enetpeer = NULL; } @@ -679,7 +679,7 @@ int enet_open (TCHAR *name) if (!initialized) { int err = enet_initialize (); if (err) { - write_log (L"ENET: initialization failed: %d\n", err); + write_log (_T("ENET: initialization failed: %d\n"), err); return 0; } initialized = 1; @@ -687,37 +687,37 @@ int enet_open (TCHAR *name) enet_close (); enetmode = 0; - if (!_tcsnicmp (name, L"ENET:H", 6)) { + if (!_tcsnicmp (name, _T("ENET:H"), 6)) { address.host = ENET_HOST_ANY; address.port = 1234; enethost = enet_host_create (&address, 2, 0, 0); if (enethost == NULL) { - write_log (L"ENET_SERVER: enet_host_create(server) failed\n"); + write_log (_T("ENET_SERVER: enet_host_create(server) failed\n")); enet_close (); return 0; } - write_log (L"ENET_SERVER: server created\n"); + write_log (_T("ENET_SERVER: server created\n")); enetmode = 1; } else { enetmode = -1; } enetclient = enet_host_create (NULL, 1, 0, 0); if (enetclient == NULL) { - write_log (L"ENET_CLIENT: enet_host_create(client) failed\n"); + write_log (_T("ENET_CLIENT: enet_host_create(client) failed\n")); enet_close (); return 0; } - write_log (L"ENET_CLIENT: client created\n"); + write_log (_T("ENET_CLIENT: client created\n")); enet_address_set_host (&address, enetmode > 0 ? "127.0.0.1" : "192.168.0.10"); address.port = 1234; enetpeer = enet_host_connect (enetclient, &address, 2); if (enetpeer == NULL) { - write_log (L"ENET_CLIENT: connection to host %d.%d.%d.%d:%d failed\n", + write_log (_T("ENET_CLIENT: connection to host %d.%d.%d.%d:%d failed\n"), (address.host >> 0) & 0xff, (address.host >> 8) & 0xff, (address.host >> 16) & 0xff, (address.host >> 24) & 0xff, address.port); enet_host_destroy (enetclient); enetclient = NULL; } - write_log (L"ENET_CLIENT: connecting to %d.%d.%d.%d:%d...\n", + write_log (_T("ENET_CLIENT: connecting to %d.%d.%d.%d:%d...\n"), (address.host >> 0) & 0xff, (address.host >> 8) & 0xff, (address.host >> 16) & 0xff, (address.host >> 24) & 0xff, address.port); cnt = 10 * 5; while (cnt-- > 0) { @@ -729,7 +729,7 @@ int enet_open (TCHAR *name) } } if (cnt <= 0) { - write_log (L"ENET_CLIENT: connection failed, no response in 5 seconds\n"); + write_log (_T("ENET_CLIENT: connection failed, no response in 5 seconds\n")); enet_close (); return 0; } @@ -737,7 +737,7 @@ int enet_open (TCHAR *name) p = enet_packet_create (data, sizeof data, ENET_PACKET_FLAG_RELIABLE); enet_peer_send (enetpeer, 0, p); enet_host_flush (enetclient); - write_log (L"ENET: connected\n"); + write_log (_T("ENET: connected\n")); serial_enet = 1; return 1; } @@ -750,7 +750,7 @@ void enet_writeser (uae_u16 w) memcpy (data, "UAE_", 4); data[4] = w >> 8; data[5] = w >> 0; - write_log (L"W=%04X ", w); + write_log (_T("W=%04X "), w); p = enet_packet_create (data, 6, ENET_PACKET_FLAG_RELIABLE); enet_peer_send (enetpeer, 0, p); enet_host_flush (enetclient); @@ -767,7 +767,7 @@ int enet_readser (uae_u16 *data) if (enet_receive_off_r == enet_receive_off_w) return 0; *data = enet_receive[enet_receive_off_r++]; - write_log (L"R=%04X ", *data); + write_log (_T("R=%04X "), *data); enet_receive_off_r &= 0xff; return 1; } diff --git a/od-win32/sounddep/sound.cpp b/od-win32/sounddep/sound.cpp index ac6ee3b0..f0d87cf2 100644 --- a/od-win32/sounddep/sound.cpp +++ b/od-win32/sounddep/sound.cpp @@ -195,7 +195,7 @@ void update_sound (double freq, int longframe, int linetoggle) sampler_evtime = hpos * lines * freq * CYCLE_UNIT; #if 0 lines -= maxvpos_nom; - write_log (L"%d.%d %d.%d %.2f\n", + write_log (_T("%d.%d %d.%d %.2f\n"), maxhpos_short, linetoggle ? 5 : 0, maxvpos_nom + (lines == 1.0 ? 1 : 0), lines > 0 && lines < 1 ? 5 : 0, scaled_sample_evtime); @@ -254,7 +254,7 @@ static void docorrection (struct sound_dp *s, int sndbuf, double sync, int granu avgskipmode = avg / (10000.0 / granulaty); if ((0 || sound_debug) && (tfprev % 10) == 0) { - write_log (L"%+05d S=%7.1f AVG=%7.1f (IMM=%7.1f + AVG=%7.1f = %7.1f)\n", sndbuf, sync, avg, skipmode, avgskipmode, skipmode + avgskipmode); + write_log (_T("%+05d S=%7.1f AVG=%7.1f (IMM=%7.1f + AVG=%7.1f = %7.1f)\n"), sndbuf, sync, avg, skipmode, avgskipmode, skipmode + avgskipmode); } gui_data.sndbuf = sndbuf; @@ -280,7 +280,7 @@ static void clearbuffer_ds (struct sound_data *sd) hr = IDirectSoundBuffer_Lock (s->lpDSBsecondary, 0, s->dsoundbuf, &buffer, &size, NULL, NULL, 0); } if (FAILED (hr)) { - write_log (L"DS: failed to Lock sound buffer (clear): %s\n", DXError (hr)); + write_log (_T("DS: failed to Lock sound buffer (clear): %s\n"), DXError (hr)); return; } memset (buffer, 0, size); @@ -310,7 +310,7 @@ static void resume_audio_xaudio2 (struct sound_data *sd) hr = s->xaudio2->StartEngine (); if (FAILED (hr)) - write_log (L"XAUDIO2: StartEngine() %08X\n", hr); + write_log (_T("XAUDIO2: StartEngine() %08X\n"), hr); s->xsource->FlushSourceBuffers (); s->xsource->GetState (&state); s->xsamplesplayed = state.SamplesPlayed; @@ -321,13 +321,13 @@ static void resume_audio_xaudio2 (struct sound_data *sd) buffer->pAudioData = (BYTE*)s->xdata[s->xabufcnt]; hr = s->xsource->SubmitSourceBuffer (buffer); if (FAILED (hr)) - write_log (L"XAUDIO2: SubmitSourceBuffer %08X\n", hr); + write_log (_T("XAUDIO2: SubmitSourceBuffer %08X\n"), hr); s->xsamplesplayed += sd->sndbufframes; s->xabufcnt = (s->xabufcnt + 1) & (XA_BUFFERS - 1); } hr = s->xsource->Start (0, 0); if (FAILED (hr)) - write_log (L"XAUDIO2: Start() %08X\n", hr); + write_log (_T("XAUDIO2: Start() %08X\n"), hr); } static void pause_audio_wasapi (struct sound_data *sd) @@ -337,7 +337,7 @@ static void pause_audio_wasapi (struct sound_data *sd) hr = s->pAudioClient->Stop (); if (FAILED (hr)) - write_log (L"WASAPI: Stop() %08X\n", hr); + write_log (_T("WASAPI: Stop() %08X\n"), hr); } static void resume_audio_wasapi (struct sound_data *sd) { @@ -348,7 +348,7 @@ static void resume_audio_wasapi (struct sound_data *sd) hr = s->pAudioClient->Reset (); if (FAILED (hr)) - write_log (L"WASAPI: Reset() %08X\n", hr); + write_log (_T("WASAPI: Reset() %08X\n"), hr); framecnt = s->wasapigoodsize; hr = s->pRenderClient->GetBuffer (framecnt, &pData); if (FAILED (hr)) @@ -356,7 +356,7 @@ static void resume_audio_wasapi (struct sound_data *sd) hr = s->pRenderClient->ReleaseBuffer (framecnt, AUDCLNT_BUFFERFLAGS_SILENT); hr = s->pAudioClient->Start (); if (FAILED (hr)) - write_log (L"WASAPI: Start() %08X\n", hr); + write_log (_T("WASAPI: Start() %08X\n"), hr); s->wasapiframes = 0; s->sndbuf = 0; } @@ -369,10 +369,10 @@ static void pause_audio_ds (struct sound_data *sd) sd->waiting_for_buffer = 0; hr = IDirectSoundBuffer_Stop (s->lpDSBsecondary); if (FAILED (hr)) - write_log (L"DS: DirectSoundBuffer_Stop failed, %s\n", DXError (hr)); + write_log (_T("DS: DirectSoundBuffer_Stop failed, %s\n"), DXError (hr)); hr = IDirectSoundBuffer_SetCurrentPosition (s->lpDSBsecondary, 0); if (FAILED (hr)) - write_log (L"DS: DirectSoundBuffer_SetCurretPosition failed, %s\n", DXError (hr)); + write_log (_T("DS: DirectSoundBuffer_SetCurretPosition failed, %s\n"), DXError (hr)); clearbuffer (sd); } static void resume_audio_ds (struct sound_data *sd) @@ -389,7 +389,7 @@ static void pause_audio_pa (struct sound_data *sd) struct sound_dp *s = sd->data; PaError err = Pa_StopStream (s->pastream); if (err != paNoError) - write_log (L"PASOUND: Pa_StopStream() error %d (%s)\n", err, Pa_GetErrorText (err)); + write_log (_T("PASOUND: Pa_StopStream() error %d (%s)\n"), err, Pa_GetErrorText (err)); } static void resume_audio_pa (struct sound_data *sd) { @@ -400,7 +400,7 @@ static void resume_audio_pa (struct sound_data *sd) s->pafinishsb = false; PaError err = Pa_StartStream (s->pastream); if (err != paNoError) - write_log (L"PASOUND: Pa_StartStream() error %d (%s)\n", err, Pa_GetErrorText (err)); + write_log (_T("PASOUND: Pa_StartStream() error %d (%s)\n"), err, Pa_GetErrorText (err)); sd->paused = 0; } static void pause_audio_al (struct sound_data *sd) @@ -422,10 +422,10 @@ static int restore_ds (struct sound_data *sd, DWORD hr) if (hr != DSERR_BUFFERLOST) return 0; if (sound_debug) - write_log (L"DS: sound buffer lost\n"); + write_log (_T("DS: sound buffer lost\n")); hr = IDirectSoundBuffer_Restore (s->lpDSBsecondary); if (FAILED (hr)) { - write_log (L"DS: restore failed %s\n", DXError (hr)); + write_log (_T("DS: restore failed %s\n"), DXError (hr)); return 1; } pause_audio_ds (sd); @@ -458,7 +458,7 @@ static void close_audio_ds (struct sound_data *sd) #endif if (s->lpDS) { IDirectSound_Release (s->lpDS); - write_log (L"DS: DirectSound driver freed\n"); + write_log (_T("DS: DirectSound driver freed\n")); } s->lpDS = 0; } @@ -481,7 +481,7 @@ void set_volume_sound_device (struct sound_data *sd, int volume, int mute) vol = (LONG)((DSBVOLUME_MIN / 2) + (-DSBVOLUME_MIN / 2) * log (1 + (2.718281828 - 1) * (1 - volume / 100.0))); hr = IDirectSoundBuffer_SetVolume (s->lpDSBsecondary, vol); if (FAILED (hr)) - write_log (L"DS: SetVolume(%d) failed: %s\n", vol, DXError (hr)); + write_log (_T("DS: SetVolume(%d) failed: %s\n"), vol, DXError (hr)); } else if (sd->devicetype == SOUND_DEVICE_WASAPI || sd->devicetype == SOUND_DEVICE_WASAPI_EXCLUSIVE) { if (s->pAudioVolume) { float vol = 0.0; @@ -489,10 +489,10 @@ void set_volume_sound_device (struct sound_data *sd, int volume, int mute) vol = (100 - volume) / 100.0; hr = s->pAudioVolume->SetMasterVolume (vol, NULL); if (FAILED (hr)) - write_log (L"AudioVolume->SetMasterVolume(%.2f) failed: %08Xs\n", vol, hr); + write_log (_T("AudioVolume->SetMasterVolume(%.2f) failed: %08Xs\n"), vol, hr); hr = s->pAudioVolume->SetMute (mute, NULL); if (FAILED (hr)) - write_log (L"pAudioVolume->SetMute(%d) failed: %08Xs\n", mute, hr); + write_log (_T("pAudioVolume->SetMute(%d) failed: %08Xs\n"), mute, hr); } } else if (sd->devicetype == SOUND_DEVICE_PA) { s->pavolume = volume; @@ -637,7 +637,7 @@ static void finish_sound_buffer_pa (struct sound_data *sd, uae_u16 *sndbuffer) if (!t) { t = time (NULL) + 2; } else if (time (NULL) >= t) { - write_log (L"PA: audio stuck!? %d\n", avail); + write_log (_T("PA: audio stuck!? %d\n"), avail); break; } sleep_millis (1); @@ -767,7 +767,7 @@ static int open_audio_pa (struct sound_data *sd, int index) fixfreq: err2 = err; errtxt = au (Pa_GetErrorText (err)); - write_log (L"PASOUND: sound format not supported, ch=%d, rate=%d. %s\n", freq, ch, errtxt); + write_log (_T("PASOUND: sound format not supported, ch=%d, rate=%d. %s\n"), freq, ch, errtxt); xfree (errtxt); if (err == paInvalidChannelCount) { if (ch > 2) { @@ -810,7 +810,7 @@ fixfreq: goto fixfreq; if (err != paNoError) { errtxt = au (Pa_GetErrorText (err)); - write_log (L"PASOUND: Pa_OpenStream() error %d (%s)\n", err, errtxt); + write_log (_T("PASOUND: Pa_OpenStream() error %d (%s)\n"), err, errtxt); xfree (errtxt); goto end; } @@ -822,9 +822,9 @@ fixfreq: } name = au (di->name); - write_log (L"PASOUND: CH=%d,FREQ=%d (%s) '%s' buffer %d/%d (%s)\n", + write_log (_T("PASOUND: CH=%d,FREQ=%d (%s) '%s' buffer %d/%d (%s)\n"), ch, freq, sound_devices[index]->name, name, - s->pasndbufsize, s->paframesperbuffer, s->pablocking ? L"push" : L"pull"); + s->pasndbufsize, s->paframesperbuffer, s->pablocking ? _T("push") : _T("pull")); xfree (name); return 1; end: @@ -902,7 +902,7 @@ static int open_audio_al (struct sound_data *sd, int index) if (s->al_format == 0) goto error; - write_log (L"ALSOUND: %08X,CH=%d,FREQ=%d '%s' buffer %d (%d)\n", + write_log (_T("ALSOUND: %08X,CH=%d,FREQ=%d '%s' buffer %d (%d)\n"), s->al_format, ch, freq, sound_devices[index]->alname, sd->sndbufsize, s->al_bufsize); return 1; @@ -956,7 +956,7 @@ static int open_audio_xaudio2 (struct sound_data *sd, int index) hr = XAudio2Create (&s->xaudio2, 0, XAUDIO2_DEFAULT_PROCESSOR); if (FAILED (hr)) { - write_log (L"XAudio2 enumeration failed, %08x\n", hr); + write_log (_T("XAudio2 enumeration failed, %08x\n"), hr); return 0; } @@ -1009,7 +1009,7 @@ static int open_audio_xaudio2 (struct sound_data *sd, int index) continue; } - write_log (L"XAUDIO2: open failed %08X\n", hr); + write_log (_T("XAUDIO2: open failed %08X\n"), hr); return 0; } @@ -1017,7 +1017,7 @@ static int open_audio_xaudio2 (struct sound_data *sd, int index) sd->samplesize = sd->channels * 16 / 8; sd->sndbufsize = sd->sndbufsize * sd->samplesize / 32; - write_log(L"XAUDIO2: '%s' CH=%d FREQ=%d BUF=%d\n", + write_log(_T("XAUDIO2: '%s' CH=%d FREQ=%d BUF=%d\n"), sound_devices[index]->cfgname, sd->channels, sd->freq, sd->sndbufsize); sd->sndbufsize = sd->sndbufsize * sd->samplesize; @@ -1073,7 +1073,7 @@ static int open_audio_wasapi (struct sound_data *sd, int index, int exclusive) CLSCTX_ALL, __uuidof(IMMDeviceEnumerator), (void**)&s->pEnumerator); if (FAILED (hr)) { - write_log (L"WASAPI: %d\n", hr); + write_log (_T("WASAPI: %d\n"), hr); goto error; } @@ -1082,31 +1082,31 @@ static int open_audio_wasapi (struct sound_data *sd, int index, int exclusive) else hr = s->pEnumerator->GetDevice (sound_devices[index]->alname, &s->pDevice); if (FAILED (hr)) { - write_log (L"WASAPI: GetDevice(%s) %08X\n", sound_devices[index]->alname ? sound_devices[index]->alname : L"NULL", hr); + write_log (_T("WASAPI: GetDevice(%s) %08X\n"), sound_devices[index]->alname ? sound_devices[index]->alname : _T("NULL"), hr); goto error; } hr = s->pDevice->GetId (&name); if (FAILED (hr)) { - write_log (L"WASAPI: GetId() %08X\n", hr); + write_log (_T("WASAPI: GetId() %08X\n"), hr); goto error; } hr = s->pDevice->Activate (__uuidof(IAudioClient), CLSCTX_ALL, NULL, (void**)&s->pAudioClient); if (FAILED (hr)) { - write_log (L"WASAPI: Activate() %d\n", hr); + write_log (_T("WASAPI: Activate() %d\n"), hr); goto error; } hr = s->pAudioClient->GetMixFormat (&pwfx); if (FAILED (hr)) { - write_log (L"WASAPI: GetMixFormat() %08X\n", hr); + write_log (_T("WASAPI: GetMixFormat() %08X\n"), hr); goto error; } hr = s->pAudioClient->GetDevicePeriod (NULL, &s->hnsRequestedDuration); if (FAILED (hr)) { - write_log (L"WASAPI: GetDevicePeriod() %08X\n", hr); + write_log (_T("WASAPI: GetDevicePeriod() %08X\n"), hr); goto error; } @@ -1139,7 +1139,7 @@ static int open_audio_wasapi (struct sound_data *sd, int index, int exclusive) hr = s->pAudioClient->IsFormatSupported (sharemode, &wavfmt.Format, &pwfx); if (SUCCEEDED (hr) && hr != S_FALSE) break; - write_log (L"WASAPI: IsFormatSupported(%d,%08X,%d) (%d,%d) %08X\n", + write_log (_T("WASAPI: IsFormatSupported(%d,%08X,%d) (%d,%d) %08X\n"), sd->channels, rn[rncnt], sd->freq, pwfx ? pwfx->nChannels : -1, pwfx ? pwfx->nSamplesPerSec : -1, hr); @@ -1214,7 +1214,7 @@ static int open_audio_wasapi (struct sound_data *sd, int index, int exclusive) if (hr == AUDCLNT_E_BUFFER_SIZE_NOT_ALIGNED) { hr = s->pAudioClient->GetBufferSize (&s->bufferFrameCount); if (FAILED (hr)) { - write_log (L"WASAPI: GetBufferSize() %08X\n", hr); + write_log (_T("WASAPI: GetBufferSize() %08X\n"), hr); goto error; } s->pAudioClient->Release (); @@ -1229,20 +1229,20 @@ static int open_audio_wasapi (struct sound_data *sd, int index, int exclusive) s->hnsRequestedDuration *= sd->sndbufsize / 512; hr = s->pDevice->Activate (__uuidof(IAudioClient), CLSCTX_ALL, NULL, (void**)&s->pAudioClient); if (FAILED (hr)) { - write_log (L"WASAPI: Activate() %08X\n", hr); + write_log (_T("WASAPI: Activate() %08X\n"), hr); goto error; } hr = s->pAudioClient->Initialize (sharemode, AUDCLNT_STREAMFLAGS_NOPERSIST, s->hnsRequestedDuration, s->wasapiexclusive ? s->hnsRequestedDuration : 0, pwfx ? pwfx : &wavfmt.Format, NULL); } if (FAILED (hr)) { - write_log (L"WASAPI: Initialize() %08X\n", hr); + write_log (_T("WASAPI: Initialize() %08X\n"), hr); goto error; } hr = s->pAudioClient->GetBufferSize (&s->bufferFrameCount); if (FAILED (hr)) { - write_log (L"WASAPI: GetBufferSize() %08X\n", hr); + write_log (_T("WASAPI: GetBufferSize() %08X\n"), hr); goto error; } @@ -1257,22 +1257,22 @@ static int open_audio_wasapi (struct sound_data *sd, int index, int exclusive) hr = s->pAudioClient->GetService (__uuidof(IAudioRenderClient), (void**)&s->pRenderClient); if (FAILED (hr)) { - write_log (L"WASAPI: GetService(IAudioRenderClient) %08X\n", hr); + write_log (_T("WASAPI: GetService(IAudioRenderClient) %08X\n"), hr); goto error; } hr = s->pAudioClient->GetService (__uuidof(ISimpleAudioVolume), (void**)&s->pAudioVolume ); if (FAILED (hr)) { - write_log (L"WASAPI: GetService(ISimpleAudioVolume) %08X\n", hr); + write_log (_T("WASAPI: GetService(ISimpleAudioVolume) %08X\n"), hr); goto error; } #if 0 hr = s->pAudioClient->GetService (IAudioClock, (void**)&s->pAudioClock); if (FAILED (hr)) { - write_log (L"WASAPI: GetService(IAudioClock) %08X\n", hr); + write_log (_T("WASAPI: GetService(IAudioClock) %08X\n"), hr); } else { hr = s->pAudioClock->GetFrequency (&s->wasapiclock); if (FAILED (hr)) { - write_log (L"WASAPI: GetFrequency() %08X\n", hr); + write_log (_T("WASAPI: GetFrequency() %08X\n"), hr); } } #endif @@ -1282,7 +1282,7 @@ static int open_audio_wasapi (struct sound_data *sd, int index, int exclusive) sd->sndbufsize = v; s->wasapigoodsize = s->bufferFrameCount / 2; - write_log(L"WASAPI: '%s'\nWASAPI: EX=%d CH=%d FREQ=%d BUF=%d (%d)\n", + write_log(_T("WASAPI: '%s'\nWASAPI: EX=%d CH=%d FREQ=%d BUF=%d (%d)\n"), name, s->wasapiexclusive, sd->channels, sd->freq, sd->sndbufsize / sd->samplesize, s->bufferFrameCount); CoTaskMemFree (pwfx); @@ -1338,13 +1338,13 @@ static int open_audio_ds (struct sound_data *sd, int index) hr = DirectSoundCreate8 (&sound_devices[index]->guid, &s->lpDS, NULL); if (FAILED (hr)) { - write_log (L"DS: DirectSoundCreate8() failure: %s\n", DXError (hr)); + write_log (_T("DS: DirectSoundCreate8() failure: %s\n"), DXError (hr)); return 0; } hr = IDirectSound_SetCooperativeLevel (s->lpDS, hMainWnd, DSSCL_PRIORITY); if (FAILED (hr)) { - write_log (L"DS: Can't set cooperativelevel: %s\n", DXError (hr)); + write_log (_T("DS: Can't set cooperativelevel: %s\n"), DXError (hr)); goto error; } @@ -1352,11 +1352,11 @@ static int open_audio_ds (struct sound_data *sd, int index) DSCaps.dwSize = sizeof (DSCaps); hr = IDirectSound_GetCaps (s->lpDS, &DSCaps); if (FAILED(hr)) { - write_log (L"DS: Error getting DirectSound capabilities: %s\n", DXError (hr)); + write_log (_T("DS: Error getting DirectSound capabilities: %s\n"), DXError (hr)); goto error; } if (DSCaps.dwFlags & DSCAPS_EMULDRIVER) { - write_log (L"DS: Emulated DirectSound driver detected, don't complain if sound quality is crap :)\n"); + write_log (_T("DS: Emulated DirectSound driver detected, don't complain if sound quality is crap :)\n")); } if (DSCaps.dwFlags & DSCAPS_CONTINUOUSRATE) { int minfreq = DSCaps.dwMinSecondarySampleRate; @@ -1364,20 +1364,20 @@ static int open_audio_ds (struct sound_data *sd, int index) if (minfreq > freq && freq < 22050) { freq = minfreq; sd->freq = freq; - write_log (L"DS: minimum supported frequency: %d\n", minfreq); + write_log (_T("DS: minimum supported frequency: %d\n"), minfreq); } if (maxfreq < freq && freq > 44100) { freq = maxfreq; sd->freq = freq; - write_log (L"DS: maximum supported frequency: %d\n", maxfreq); + write_log (_T("DS: maximum supported frequency: %d\n"), maxfreq); } } speakerconfig = fillsupportedmodes (sd, freq, supportedmodes); - write_log (L"DS: %08X ", speakerconfig); + write_log (_T("DS: %08X "), speakerconfig); for (i = 0; supportedmodes[i].ch; i++) - write_log (L"%d:%08X ", supportedmodes[i].ch, supportedmodes[i].ksmode); - write_log (L"\n"); + write_log (_T("%d:%08X "), supportedmodes[i].ch, supportedmodes[i].ksmode); + write_log (_T("\n")); for (round = 0; supportedmodes[round].ch; round++) { DWORD ksmode = 0; @@ -1403,7 +1403,7 @@ static int open_audio_ds (struct sound_data *sd, int index) wavfmt.Format.nBlockAlign = wavfmt.Format.wBitsPerSample / 8 * wavfmt.Format.nChannels; wavfmt.Format.nAvgBytesPerSec = wavfmt.Format.nBlockAlign * wavfmt.Format.nSamplesPerSec; - write_log (L"DS: %08X,CH=%d,FREQ=%d '%s' buffer %d, dist %d\n", + write_log (_T("DS: %08X,CH=%d,FREQ=%d '%s' buffer %d, dist %d\n"), ksmode, ch, freq, sound_devices[index]->name, s->max_sndbufsize / sd->samplesize, s->snd_configsize / sd->samplesize); @@ -1424,11 +1424,11 @@ static int open_audio_ds (struct sound_data *sd, int index) sound_buffer.dwFlags |= DSBCAPS_LOCSOFTWARE; hr = IDirectSound_CreateSoundBuffer (s->lpDS, &sound_buffer, &pdsb, NULL); if (SUCCEEDED(hr)) { - //write_log (L"DS: Couldn't use hardware buffer (switched to software): %s\n", DXError (hr2)); + //write_log (_T("DS: Couldn't use hardware buffer (switched to software): %s\n"), DXError (hr2)); break; } } - write_log (L"DS: Secondary CreateSoundBuffer() failure: %s\n", DXError (hr)); + write_log (_T("DS: Secondary CreateSoundBuffer() failure: %s\n"), DXError (hr)); } if (pdsb == NULL) @@ -1436,7 +1436,7 @@ static int open_audio_ds (struct sound_data *sd, int index) hr = pdsb->QueryInterface (IID_IDirectSoundBuffer8, (LPVOID*)&s->lpDSBsecondary); IDirectSound_Release (pdsb); if (FAILED (hr)) { - write_log (L"DS: Secondary QueryInterface() failure: %s\n", DXError (hr)); + write_log (_T("DS: Secondary QueryInterface() failure: %s\n"), DXError (hr)); goto error; } clearbuffer (sd); @@ -1647,7 +1647,7 @@ static void restart_sound_buffer2 (struct sound_data *sd) return; hr = IDirectSoundBuffer_GetCurrentPosition (s->lpDSBsecondary, &playpos, &safed); if (FAILED (hr)) { - write_log (L"DS: DirectSoundBuffer_GetCurrentPosition failed, %s\n", DXError (hr)); + write_log (_T("DS: DirectSoundBuffer_GetCurrentPosition failed, %s\n"), DXError (hr)); return; } s->writepos = safed + s->snd_writeoffset; @@ -1670,8 +1670,8 @@ static int alcheck (struct sound_data *sd, int v) alGetSourcei (s->al_Source, AL_BUFFERS_PROCESSED, &v1); alGetSourcei (s->al_Source, AL_BUFFERS_QUEUED, &v2); alGetSourcei (s->al_Source, AL_SOURCE_STATE, &v3); - write_log (L"OpenAL %d: error %d. PROC=%d QUEUE=%d STATE=%d\n", v, err, v1, v2, v3); - write_log (L" %d %08x %08x %08x %d %d\n", + write_log (_T("OpenAL %d: error %d. PROC=%d QUEUE=%d STATE=%d\n"), v, err, v1, v2, v3); + write_log (_T(" %d %08x %08x %08x %d %d\n"), s->al_toggle, s->al_Buffers[s->al_toggle], s->al_format, s->al_bigbuffer, s->al_bufsize, sd->freq); return 1; } @@ -1707,7 +1707,7 @@ static void finish_sound_buffer_al (struct sound_data *sd, uae_u16 *sndbuffer) alSourceUnqueueBuffers (s->al_Source, 1, &tmp); alGetError (); - // write_log (L" %d %08x %08x %08x %d %d\n", + // write_log (_T(" %d %08x %08x %08x %d %d\n"), // al_toggle, al_Buffers[al_toggle], al_format, al_bigbuffer, al_bufsize, currprefs.sound_freq); alBufferData (s->al_Buffers[s->al_toggle], s->al_format, s->al_bigbuffer, s->al_bufsize, sd->freq); @@ -1724,7 +1724,7 @@ static void finish_sound_buffer_al (struct sound_data *sd, uae_u16 *sndbuffer) alcheck (sd, 3); if (v != AL_PLAYING && v2 >= AL_BUFFERS) { if (sd->waiting_for_buffer > 0) { - write_log (L"AL SOUND PLAY!\n"); + write_log (_T("AL SOUND PLAY!\n")); alSourcePlay (s->al_Source); sd->waiting_for_buffer = -1; tfprev = timeframes + 10; @@ -1732,7 +1732,7 @@ static void finish_sound_buffer_al (struct sound_data *sd, uae_u16 *sndbuffer) } else { gui_data.sndbuf_status = 2; statuscnt = SND_STATUSCNT; - write_log (L"AL underflow\n"); + write_log (_T("AL underflow\n")); clearbuffer (sd); sd->waiting_for_buffer = 1; } @@ -1778,7 +1778,7 @@ static void finish_sound_buffer_al (struct sound_data *sd, uae_u16 *sndbuffer) } if (tfprev != timeframes) { if ((0 || sound_debug) && !(tfprev % 10)) - write_log (L"s=%+02.1f\n", skipmode); + write_log (_T("s=%+02.1f\n"), skipmode); tfprev = timeframes; sound_setadjust (skipmode); } @@ -1801,7 +1801,7 @@ int blocking_sound_device (struct sound_data *sd) hr = IDirectSoundBuffer_GetCurrentPosition (s->lpDSBsecondary, &playpos, &safepos); if (FAILED (hr)) { restore_ds (sd, hr); - write_log (L"DS: GetCurrentPosition failed: %s\n", DXError (hr)); + write_log (_T("DS: GetCurrentPosition failed: %s\n"), DXError (hr)); return -1; } if (s->writepos >= safepos) @@ -1900,7 +1900,7 @@ static void finish_sound_buffer_xaudio2 (struct sound_data *sd, uae_u16 *sndbuff XAUDIO2_VOICE_STATE state; s->xsource->GetState (&state); avail = s->xsamplesplayed - state.SamplesPlayed; - //write_log (L"%d %d\n", state.BuffersQueued, goodsize - avail); + //write_log (_T("%d %d\n"), state.BuffersQueued, goodsize - avail); if (state.BuffersQueued == 0 || (avail >= sd->sndbufframes && state.BuffersQueued < XA_BUFFERS)) { if (avail >= 2 * XA_BUFFERS * sd->sndbufframes) { statuscnt = SND_STATUSCNT; @@ -1913,7 +1913,7 @@ static void finish_sound_buffer_xaudio2 (struct sound_data *sd, uae_u16 *sndbuff sleep_millis (1); if (oldpadding == avail) { if (stuck-- < 0) { - write_log (L"XAUDIO2: sound stuck %d !?\n", avail, sd->sndbufframes); + write_log (_T("XAUDIO2: sound stuck %d !?\n"), avail, sd->sndbufframes); reopen_sound (); return; } @@ -1929,7 +1929,7 @@ static void finish_sound_buffer_xaudio2 (struct sound_data *sd, uae_u16 *sndbuff buffer->pAudioData = (BYTE*)s->xdata[s->xabufcnt]; hr = s->xsource->SubmitSourceBuffer (buffer); if (FAILED (hr)) { - write_log (L"XAUDIO2: SubmitSourceBuffer %08X\n", hr); + write_log (_T("XAUDIO2: SubmitSourceBuffer %08X\n"), hr); return; } s->xsamplesplayed += sd->sndbufframes; @@ -1950,7 +1950,7 @@ static void finish_sound_buffer_wasapi (struct sound_data *sd, uae_u16 *sndbuffe for (;;) { hr = s->pAudioClient->GetCurrentPadding (&numFramesPadding); if (FAILED (hr)) { - write_log (L"WASAPI: GetCurrentPadding() %08X\n", hr); + write_log (_T("WASAPI: GetCurrentPadding() %08X\n"), hr); return; } avail = s->bufferFrameCount - numFramesPadding; @@ -1966,7 +1966,7 @@ static void finish_sound_buffer_wasapi (struct sound_data *sd, uae_u16 *sndbuffe sleep_millis (1); if (oldpadding == numFramesPadding) { if (stuck-- < 0) { - write_log (L"WASAPI: sound stuck %d %d %d !?\n", s->bufferFrameCount, numFramesPadding, sd->sndbufframes); + write_log (_T("WASAPI: sound stuck %d %d %d !?\n"), s->bufferFrameCount, numFramesPadding, sd->sndbufframes); reopen_sound (); return; } @@ -2001,14 +2001,14 @@ static void finish_sound_buffer_ds (struct sound_data *sd, uae_u16 *sndbuffer) if (sd->waiting_for_buffer == 1) { hr = s->lpDSBsecondary->Play (0, 0, DSBPLAY_LOOPING); if (FAILED (hr)) { - write_log (L"DS: Play failed: %s\n", DXError (hr)); + write_log (_T("DS: Play failed: %s\n"), DXError (hr)); restore_ds (sd, DSERR_BUFFERLOST); sd->waiting_for_buffer = 0; return; } hr = s->lpDSBsecondary->SetCurrentPosition (0); if (FAILED (hr)) { - write_log (L"DS: 1st SetCurrentPosition failed: %s\n", DXError (hr)); + write_log (_T("DS: 1st SetCurrentPosition failed: %s\n"), DXError (hr)); restore_ds (sd, DSERR_BUFFERLOST); sd->waiting_for_buffer = 0; return; @@ -2022,12 +2022,12 @@ static void finish_sound_buffer_ds (struct sound_data *sd, uae_u16 *sndbuffer) sleep_millis (1); counter--; if (counter < 0) { - write_log (L"DS: stuck?!?!\n"); + write_log (_T("DS: stuck?!?!\n")); disable_sound (); break; } } - write_log (L"DS: %d = (%d - %d)\n", (s->safedist - playpos) / sd->samplesize, s->safedist / sd->samplesize, playpos / sd->samplesize); + write_log (_T("DS: %d = (%d - %d)\n"), (s->safedist - playpos) / sd->samplesize, s->safedist / sd->samplesize, playpos / sd->samplesize); recalc_offsets (sd); s->safedist -= playpos; if (s->safedist < 64) @@ -2045,7 +2045,7 @@ static void finish_sound_buffer_ds (struct sound_data *sd, uae_u16 *sndbuffer) #endif sd->waiting_for_buffer = -1; restart_sound_buffer2 (sd); - write_log (L"DS: bs=%d w=%d max=%d tof=%d tuf=%d\n", + write_log (_T("DS: bs=%d w=%d max=%d tof=%d tuf=%d\n"), sd->sndbufsize / sd->samplesize, s->snd_writeoffset / sd->samplesize, s->snd_maxoffset / sd->samplesize, s->snd_totalmaxoffset_of / sd->samplesize, s->snd_totalmaxoffset_uf / sd->samplesize); @@ -2056,17 +2056,17 @@ static void finish_sound_buffer_ds (struct sound_data *sd, uae_u16 *sndbuffer) counter = 5000; hr = s->lpDSBsecondary->GetStatus (&status); if (FAILED (hr)) { - write_log (L"DS: GetStatus() failed: %s\n", DXError (hr)); + write_log (_T("DS: GetStatus() failed: %s\n"), DXError (hr)); restore_ds (sd, DSERR_BUFFERLOST); return; } if (status & DSBSTATUS_BUFFERLOST) { - write_log (L"DS: buffer lost\n"); + write_log (_T("DS: buffer lost\n")); restore_ds (sd, DSERR_BUFFERLOST); return; } if ((status & (DSBSTATUS_PLAYING | DSBSTATUS_LOOPING)) != (DSBSTATUS_PLAYING | DSBSTATUS_LOOPING)) { - write_log (L"DS: status = %08X\n", status); + write_log (_T("DS: status = %08X\n"), status); restore_ds (sd, DSERR_BUFFERLOST); return; } @@ -2074,7 +2074,7 @@ static void finish_sound_buffer_ds (struct sound_data *sd, uae_u16 *sndbuffer) hr = s->lpDSBsecondary->GetCurrentPosition (&playpos, &safepos); if (FAILED (hr)) { restore_ds (sd, hr); - write_log (L"DS: GetCurrentPosition failed: %s\n", DXError (hr)); + write_log (_T("DS: GetCurrentPosition failed: %s\n"), DXError (hr)); return; } if (s->writepos >= safepos) @@ -2107,7 +2107,7 @@ static void finish_sound_buffer_ds (struct sound_data *sd, uae_u16 *sndbuffer) statuscnt = SND_STATUSCNT; restart_sound_buffer2 (sd); diff = s->snd_writeoffset; - write_log (L"DS: underflow (%d %d)\n", diff / sd->samplesize, s->snd_totalmaxoffset_of / sd->samplesize); + write_log (_T("DS: underflow (%d %d)\n"), diff / sd->samplesize, s->snd_totalmaxoffset_of / sd->samplesize); break; } @@ -2117,7 +2117,7 @@ static void finish_sound_buffer_ds (struct sound_data *sd, uae_u16 *sndbuffer) sleep_millis (1); counter--; if (counter < 0) { - write_log (L"DS: sound system got stuck!?\n"); + write_log (_T("DS: sound system got stuck!?\n")); restore_ds (sd, DSERR_BUFFERLOST); reopen_sound (); return; @@ -2131,7 +2131,7 @@ static void finish_sound_buffer_ds (struct sound_data *sd, uae_u16 *sndbuffer) if (restore_ds (sd, hr)) return; if (FAILED (hr)) { - write_log (L"DS: lock failed: %s (%d %d)\n", DXError (hr), s->writepos / sd->samplesize, sd->sndbufsize / sd->samplesize); + write_log (_T("DS: lock failed: %s (%d %d)\n"), DXError (hr), s->writepos / sd->samplesize, sd->sndbufsize / sd->samplesize); return; } memcpy (b1, sndbuffer, s1); @@ -2152,7 +2152,7 @@ static void finish_sound_buffer_ds (struct sound_data *sd, uae_u16 *sndbuffer) s->cnt_correct++; double adj = (s->avg_correct / s->cnt_correct) / 50.0; if ((0 || sound_debug) && !(tfprev % 10)) - write_log (L"%d,%d,%d,%d d%5d vd%5.0f s%+02.1f %.0f %+02.1f\n", + write_log (_T("%d,%d,%d,%d d%5d vd%5.0f s%+02.1f %.0f %+02.1f\n"), sd->sndbufsize / sd->samplesize, s->snd_configsize / sd->samplesize, s->max_sndbufsize / sd->samplesize, s->dsoundbuf / sd->samplesize, diff / sd->samplesize, vdiff, skipmode, s->avg_correct / s->cnt_correct, adj); tfprev = timeframes; @@ -2274,7 +2274,7 @@ static void wasapi_enum (struct sound_device **sdp) IMMDeviceCollection *col; int i, cnt, cnt2, start; - write_log (L"Enumerating WASAPI devices...\n"); + write_log (_T("Enumerating WASAPI devices...\n")); for (cnt = 0; cnt < MAX_SOUND_DEVICES; cnt++) { if (sdp[cnt] == NULL) break; @@ -2315,9 +2315,9 @@ static void wasapi_enum (struct sound_device **sdp) if (devid && devname) { if (i == 0) { sdp[cnt] = xcalloc (struct sound_device, 1); - sdp[cnt]->cfgname = my_strdup (L"Default Audio Device"); + sdp[cnt]->cfgname = my_strdup (_T("Default Audio Device")); sdp[cnt]->type = SOUND_DEVICE_WASAPI; - sdp[cnt]->name = my_strdup (L"Default Audio Device"); + sdp[cnt]->name = my_strdup (_T("Default Audio Device")); sdp[cnt]->alname = NULL; cnt++; } @@ -2341,12 +2341,12 @@ static void wasapi_enum (struct sound_device **sdp) cnt2 = cnt; for (i = start; i < cnt2; i++) { TCHAR buf[1000]; - _stprintf (buf, L"WASAPIX:%s", sdp[i]->cfgname); + _stprintf (buf, _T("WASAPIX:%s"), sdp[i]->cfgname); sdp[cnt] = xcalloc (struct sound_device, 1); sdp[cnt]->cfgname = my_strdup (buf); sdp[cnt]->name = my_strdup (sdp[i]->name); sdp[cnt]->alname = sdp[i]->alname ? my_strdup (sdp[i]->alname) : NULL; - _stprintf (buf, L"WASAPI:%s", sdp[i]->cfgname); + _stprintf (buf, _T("WASAPI:%s"), sdp[i]->cfgname); sdp[cnt]->type = SOUND_DEVICE_WASAPI_EXCLUSIVE; xfree (sdp[i]->cfgname); sdp[i]->cfgname = my_strdup (buf); @@ -2399,7 +2399,7 @@ static void OpenALEnumerate (struct sound_device **sds, const char *pDeviceNames sds[i]->type = SOUND_DEVICE_AL; if (ppDefaultDevice) { TCHAR *tdevname = au (devname); - _stprintf (tmp, L"Default [%s]", tdevname); + _stprintf (tmp, _T("Default [%s]"), tdevname); xfree (tdevname); sds[i]->alname = my_strdup_ansi (ppDefaultDevice); sds[i]->name = my_strdup (tmp); @@ -2407,7 +2407,7 @@ static void OpenALEnumerate (struct sound_device **sds, const char *pDeviceNames sds[i]->alname = my_strdup_ansi (pDeviceNames); sds[i]->name = my_strdup_ansi (pDeviceNames); } - _stprintf (tmp, L"OPENAL:%s", sds[i]->alname); + _stprintf (tmp, _T("OPENAL:%s"), sds[i]->alname); sds[i]->cfgname = my_strdup (tmp); } if (ppDefaultDevice) @@ -2426,7 +2426,7 @@ static void xaudioenumerate (struct sound_device **sds) hr = XAudio2Create (&xaudio2, 0, XAUDIO2_DEFAULT_PROCESSOR); if (FAILED (hr)) { - write_log (L"XAudio2 enumeration failed, %08x\n", hr); + write_log (_T("XAudio2 enumeration failed, %08x\n"), hr); return; } hr = xaudio2->GetDeviceCount (&num); @@ -2463,7 +2463,7 @@ static void PortAudioEnumerate (struct sound_device **sds) num = Pa_GetDeviceCount (); if (num < 0) { TCHAR *errtxt = au (Pa_GetErrorText (num)); - write_log (L"PA: Pa_GetDeviceCount() failed: %08x (%s)\n", num, errtxt); + write_log (_T("PA: Pa_GetDeviceCount() failed: %08x (%s)\n"), num, errtxt); xfree (errtxt); return; } @@ -2487,12 +2487,12 @@ static void PortAudioEnumerate (struct sound_device **sds) sds[i] = xcalloc (struct sound_device, 1); s1 = au (hai->name); s2 = au (di->name); - _stprintf (tmp, L"[%s] %s", s1, s2); + _stprintf (tmp, _T("[%s] %s"), s1, s2); xfree (s2); xfree (s1); sds[i]->type = SOUND_DEVICE_PA; sds[i]->name = my_strdup (tmp); - _stprintf (tmp2, L"PORTAUDIO:%s", tmp); + _stprintf (tmp2, _T("PORTAUDIO:%s"), tmp); sds[i]->cfgname = my_strdup (tmp2); sds[i]->panum = j; } @@ -2509,7 +2509,7 @@ int enumerate_sound_devices (void) { if (!num_sound_devices) { HMODULE l = NULL; - write_log (L"Enumerating DirectSound devices..\n"); + write_log (_T("Enumerating DirectSound devices..\n")); if (os_vista && (sounddrivermask & SOUNDDRIVER_WASAPI)) wasapi_enum (sound_devices); if ((1 || force_directsound || !os_vista) && (sounddrivermask & SOUNDDRIVER_DS)) { @@ -2520,8 +2520,8 @@ int enumerate_sound_devices (void) xaudioenumerate (sound_devices); if (sounddrivermask & SOUNDDRIVER_OPENAL) { __try { - if (isdllversion (L"openal32.dll", 6, 14, 357, 22)) { - write_log (L"Enumerating OpenAL devices..\n"); + if (isdllversion (_T("openal32.dll"), 6, 14, 357, 22)) { + write_log (_T("Enumerating OpenAL devices..\n")); if (alcIsExtensionPresent (NULL, "ALC_ENUMERATION_EXT")) { const char* ppDefaultDevice = alcGetString (NULL, ALC_DEFAULT_DEVICE_SPECIFIER); const char* pDeviceNames = alcGetString (NULL, ALC_DEVICE_SPECIFIER); @@ -2536,20 +2536,20 @@ int enumerate_sound_devices (void) } } } __except(ExceptionFilter (GetExceptionInformation (), GetExceptionCode ())) { - write_log (L"OpenAL enumeration crashed!\n"); + write_log (_T("OpenAL enumeration crashed!\n")); flush_log (); } } #if PORTAUDIO if (sounddrivermask & SOUNDDRIVER_PORTAUDIO) { __try { - HMODULE hm = WIN32_LoadLibrary (L"portaudio_x86.dll"); + HMODULE hm = WIN32_LoadLibrary (_T("portaudio_x86.dll")); if (hm) { TCHAR *s; PaError err; - write_log (L"Enumerating PortAudio devices..\n"); + write_log (_T("Enumerating PortAudio devices..\n")); s = au (Pa_GetVersionText ()); - write_log (L"%s (%d)\n", s, Pa_GetVersion ()); + write_log (_T("%s (%d)\n"), s, Pa_GetVersion ()); xfree (s); if (Pa_GetVersion () >= 1899) { err = Pa_Initialize (); @@ -2557,23 +2557,23 @@ int enumerate_sound_devices (void) PortAudioEnumerate (sound_devices); } else { s = au (Pa_GetErrorText (err)); - write_log (L"Portaudio initialization failed: %d (%s)\n", + write_log (_T("Portaudio initialization failed: %d (%s)\n"), err, s); xfree (s); FreeLibrary (hm); } } else { - write_log (L"Too old PortAudio library\n"); + write_log (_T("Too old PortAudio library\n")); flush_log (); FreeLibrary (hm); } } } __except(ExceptionFilter (GetExceptionInformation (), GetExceptionCode ())) { - write_log (L"Portaudio enumeration crashed!\n"); + write_log (_T("Portaudio enumeration crashed!\n")); } } #endif - write_log (L"Enumeration end\n"); + write_log (_T("Enumeration end\n")); for (num_sound_devices = 0; num_sound_devices < MAX_SOUND_DEVICES; num_sound_devices++) { if (sound_devices[num_sound_devices] == NULL) break; @@ -2642,9 +2642,9 @@ static void mcierr (const TCHAR *str, DWORD err) if (err == MMSYSERR_NOERROR) return; if (mciGetErrorString (err, es, sizeof es / sizeof (TCHAR))) - write_log (L"MCIErr: %s: %d = '%s'\n", str, err, es); + write_log (_T("MCIErr: %s: %d = '%s'\n"), str, err, es); else - write_log (L"%s, errcode=%d\n", str, err); + write_log (_T("%s, errcode=%d\n"), str, err); } /* from http://www.codeproject.com/audio/mixerSetControlDetails.asp */ static int setget_master_volume_xp (int setvolume, int *volume, int *mute) @@ -2708,14 +2708,14 @@ static int setget_master_volume_xp (int setvolume, int *volume, int *mute) if (result == MMSYSERR_NOERROR) ok = 1; } else - mcierr (L"mixerGetLineControls Mute", result); + mcierr (_T("mixerGetLineControls Mute"), result); } else - mcierr (L"mixerGetLineControls Volume", result); + mcierr (_T("mixerGetLineControls Volume"), result); } else - mcierr (L"mixerGetLineInfo", result); + mcierr (_T("mixerGetLineInfo"), result); mixerClose (hMixer); } else - mcierr (L"mixerOpen", result); + mcierr (_T("mixerOpen"), result); return ok; } diff --git a/od-win32/sysconfig.h b/od-win32/sysconfig.h index 1c94b71e..ddf7e143 100644 --- a/od-win32/sysconfig.h +++ b/od-win32/sysconfig.h @@ -519,4 +519,4 @@ #define HAVE_WINDOWS_H 1 #define FSDB_DIR_SEPARATOR '\\' -#define FSDB_DIR_SEPARATOR_S L"\\" +#define FSDB_DIR_SEPARATOR_S _T("\\") diff --git a/od-win32/target.h b/od-win32/target.h index 7f7dc252..f21cd2cf 100644 --- a/od-win32/target.h +++ b/od-win32/target.h @@ -12,12 +12,12 @@ #define TARGET_NO_ZFILE #define DONT_PARSE_CMDLINE #else -#define TARGET_NAME L"win32" +#define TARGET_NAME _T("win32") #endif #define TARGET_PROVIDES_DEFAULT_PREFS #define TARGET_NO_DITHER #define NO_MAIN_IN_MAIN_C -#define OPTIONSFILENAME L"default.uae" +#define OPTIONSFILENAME _T("default.uae") diff --git a/od-win32/uaeunp_win32.cpp b/od-win32/uaeunp_win32.cpp index 1bd2961c..f92064cc 100644 --- a/od-win32/uaeunp_win32.cpp +++ b/od-win32/uaeunp_win32.cpp @@ -12,7 +12,7 @@ static void LLError(const TCHAR *s) if (err == ERROR_MOD_NOT_FOUND || err == ERROR_DLL_NOT_FOUND) return; - write_log (L"%s failed to open %d\n", s, err); + write_log (_T("%s failed to open %d\n"), s, err); } void notify_user (int n) @@ -59,15 +59,15 @@ HMODULE WIN32_LoadLibrary (const TCHAR *name) #endif s = xmalloc (TCHAR, _tcslen (start_path_exe) + _tcslen (WIN32_PLUGINDIR) + _tcslen (newname) + 1); if (s) { - _stprintf (s, L"%s%s%s", start_path_exe, WIN32_PLUGINDIR, newname); + _stprintf (s, _T("%s%s%s"), start_path_exe, WIN32_PLUGINDIR, newname); m = LoadLibrary (s); if (m) goto end; - _stprintf (s, L"%s%s", start_path_exe, newname); + _stprintf (s, _T("%s%s"), start_path_exe, newname); m = LoadLibrary (s); if (m) goto end; - _stprintf (s, L"%s%s%s", start_path_exe, WIN32_PLUGINDIR, newname); + _stprintf (s, _T("%s%s%s"), start_path_exe, WIN32_PLUGINDIR, newname); LLError(s); xfree (s); } diff --git a/od-win32/unicode.cpp b/od-win32/unicode.cpp index 8efe7677..d4b868d5 100644 --- a/od-win32/unicode.cpp +++ b/od-win32/unicode.cpp @@ -31,7 +31,7 @@ static void err (const char *func, const WCHAR *w, const char *c, UINT cp) fwrite (zero, 1, 1, f); fwrite (&err, 4, 1, f); fclose (f); - write_log (L"CP=%d,ERR=%d\n", cp, err); + write_log (_T("CP=%d,ERR=%d\n"), cp, err); #endif } @@ -254,19 +254,19 @@ WCHAR *au_fs_copy (TCHAR *dst, int maxlen, const char *src) static void mbtwc (UINT cp, DWORD flags, LPCSTR src, int len, LPWSTR dst, int maxlen) { DWORD err; - //write_log (L"CP=%08X F=%x %p %02X %02X %d %p %04X %04X %d", cp, flags, src, (unsigned char)src[0], (unsigned char)src[1], len, dst, dst[0], dst[1], maxlen); + //write_log (_T("CP=%08X F=%x %p %02X %02X %d %p %04X %04X %d"), cp, flags, src, (unsigned char)src[0], (unsigned char)src[1], len, dst, dst[0], dst[1], maxlen); err = MultiByteToWideChar (cp, flags, src, len, dst, maxlen); - //write_log (L"=%d %04X %04X\n", err, dst[0], dst[1]); + //write_log (_T("=%d %04X %04X\n"), err, dst[0], dst[1]); if (err) return; err = GetLastError (); - write_log (L"\nMBTWC %u:%d\n", cp, err); + write_log (_T("\nMBTWC %u:%d\n"), cp, err); #if 0 if (cp != CP_ACP) { cp = CP_ACP; if (MultiByteToWideChar (cp, flags, src, len, dst, maxlen)) { err = GetLastError (); - write_log (L"MBTWC2 %u:%d\n", cp, err); + write_log (_T("MBTWC2 %u:%d\n"), cp, err); } } #endif @@ -286,7 +286,7 @@ void unicode_init (void) ac = GetACP (); if (ac == 1251) // cyrillic -> always use 1251 fscodepage = 1251; - write_log (L"Filesystem charset (ACP=%u,FSCP=%u):\n", ac, fscodepage); + write_log (_T("Filesystem charset (ACP=%u,FSCP=%u):\n"), ac, fscodepage); minac = 0x7f; maxac = 0x9f; for (i = 0; i < 256; i++) { @@ -303,11 +303,11 @@ void unicode_init (void) mbtwc (CP_ACP, 0, src, 1, dst1, 1); mbtwc (fscodepage, 0, src, 1, dst2, 1); if (dst2[0] != dst1[0]) - write_log (L" %02X: %04X (%04X)", i, dst1[0], dst2[0]); + write_log (_T(" %02X: %04X (%04X)"), i, dst1[0], dst2[0]); else - write_log (L" %02X: %04X ", i, dst1[0]); + write_log (_T(" %02X: %04X "), i, dst1[0]); if ((i & 3) == 3) - write_log (L"\n"); + write_log (_T("\n")); if (i < 32 || (i >= minac && i <= maxac)) aufstable[i] = dst1[0]; else @@ -315,7 +315,7 @@ void unicode_init (void) if (aufstable[i] == 0) aufstable[i] = (unsigned char)i; } - write_log (L"End\n"); + write_log (_T("End\n")); } int same_aname (const TCHAR *an1, const TCHAR *an2) diff --git a/od-win32/win32.cpp b/od-win32/win32.cpp index e1abce6d..fcda8d40 100644 --- a/od-win32/win32.cpp +++ b/od-win32/win32.cpp @@ -188,7 +188,7 @@ static int timeend (void) timeon = 0; if (timeEndPeriod (mm_timerres) == TIMERR_NOERROR) return 1; - write_log (L"TimeEndPeriod() failed\n"); + write_log (_T("TimeEndPeriod() failed\n")); return 0; } @@ -203,7 +203,7 @@ static int timebegin (void) timeon = 1; return 1; } - write_log (L"TimeBeginPeriod() failed\n"); + write_log (_T("TimeBeginPeriod() failed\n")); return 0; } @@ -294,7 +294,7 @@ frame_time_t read_processor_time (void) cnt++; if (cnt > 1000000) { - write_log (L"**************\n"); + write_log (_T("**************\n")); cnt = 0; } #endif @@ -348,7 +348,7 @@ static void figure_processor_speed_rdtsc (void) clockrate = (win32_read_processor_time () - clockrate) * 2; dummythread_die = 0; SetThreadPriority (th, oldpri); - write_log (L"CLOCKFREQ: RDTSC %.2fMHz\n", clockrate / 1000000.0); + write_log (_T("CLOCKFREQ: RDTSC %.2fMHz\n"), clockrate / 1000000.0); syncbase = clockrate >> 6; } @@ -370,7 +370,7 @@ static void figure_processor_speed_qpf (void) qpfrate >>= 1; qpcdivisor++; } - write_log (L"CLOCKFREQ: QPF %.2fMHz (%.2fMHz, DIV=%d)\n", freq.QuadPart / 1000000.0, + write_log (_T("CLOCKFREQ: QPF %.2fMHz (%.2fMHz, DIV=%d)\n"), freq.QuadPart / 1000000.0, qpfrate / 1000000.0, 1 << qpcdivisor); syncbase = (unsigned long)qpfrate; } @@ -397,7 +397,7 @@ static void setcursor (int oldx, int oldy) return; } #if 0 - write_log (L"%d %d %d %d %d - %d %d %d %d %d\n", + write_log (_T("%d %d %d %d %d - %d %d %d %d %d\n"), x, amigawin_rect.left, amigawin_rect.right, mouseposx, oldx, y, amigawin_rect.top, amigawin_rect.bottom, mouseposy, oldy); #endif @@ -410,7 +410,7 @@ static void setcursor (int oldx, int oldy) } mouseposx = mouseposy = 0; if (oldx < 0 || oldy < 0 || oldx > amigawin_rect.right - amigawin_rect.left || oldy > amigawin_rect.bottom - amigawin_rect.top) { - write_log (L"Mouse out of range: %dx%d (%dx%d %dx%d)\n", oldx, oldy, + write_log (_T("Mouse out of range: %dx%d (%dx%d %dx%d)\n"), oldx, oldy, amigawin_rect.left, amigawin_rect.top, amigawin_rect.right, amigawin_rect.bottom); return; } @@ -436,7 +436,7 @@ void setsoundpaused (void) } void resumepaused (int priority) { - //write_log (L"resume %d (%d)\n", priority, pause_emulation); + //write_log (_T("resume %d (%d)\n"), priority, pause_emulation); if (pause_emulation > priority) return; resumesoundpaused (); @@ -451,7 +451,7 @@ void resumepaused (int priority) } void setpaused (int priority) { - //write_log (L"pause %d (%d)\n", priority, pause_emulation); + //write_log (_T("pause %d (%d)\n"), priority, pause_emulation); if (pause_emulation > priority) return; pause_emulation = priority; @@ -483,13 +483,13 @@ static void setmaintitle (HWND hwnd) inprec_getstatus (txt); if (currprefs.config_window_title[0]) { _tcscat (txt, currprefs.config_window_title); - _tcscat (txt, L" - "); + _tcscat (txt, _T(" - ")); } else if (config_filename[0]) { - _tcscat (txt, L"["); + _tcscat (txt, _T("[")); _tcscat (txt, config_filename); - _tcscat (txt, L"] - "); + _tcscat (txt, _T("] - ")); } - _tcscat (txt, L"WinUAE"); + _tcscat (txt, _T("WinUAE")); txt2[0] = 0; if (mouseactive > 0) { WIN32GUI_LoadUIString (currprefs.win32_middle_mouse ? IDS_WINUAETITLE_MMB : IDS_WINUAETITLE_NORMAL, @@ -498,12 +498,12 @@ static void setmaintitle (HWND hwnd) if (_tcslen (WINUAEBETA) > 0) { _tcscat (txt, BetaStr); if (_tcslen (WINUAEEXTRA) > 0) { - _tcscat (txt, L" "); + _tcscat (txt, _T(" ")); _tcscat (txt, WINUAEEXTRA); } } if (txt2[0]) { - _tcscat (txt, L" - "); + _tcscat (txt, _T(" - ")); _tcscat (txt, txt2); } SetWindowText (hwnd, txt); @@ -529,7 +529,7 @@ void setpriority (struct threadpriorities *pri) return; err = SetPriorityClass (GetCurrentProcess (), pri->classvalue); if (!err) - write_log (L"priority set failed, %08X\n", GetLastError ()); + write_log (_T("priority set failed, %08X\n"), GetLastError ()); } } @@ -556,7 +556,7 @@ static void releasecapture (void) static void setmouseactive2 (int active, bool allowpause) { - //write_log (L"setmouseactive %d->%d\n", mouseactive, active); + //write_log (_T("setmouseactive %d->%d\n"), mouseactive, active); if (active == 0) releasecapture (); if (mouseactive == active && active >= 0) @@ -578,7 +578,7 @@ static void setmouseactive2 (int active, bool allowpause) mouseactive = active; mouseposx = mouseposy = 0; - //write_log (L"setmouseactive(%d)\n", active); + //write_log (_T("setmouseactive(%d)\n"), active); releasecapture (); recapture = 0; @@ -664,7 +664,7 @@ static void winuae_active (HWND hWnd, int minimized) { struct threadpriorities *pri; - write_log (L"winuae_active(%d)\n", minimized); + write_log (_T("winuae_active(%d)\n"), minimized); /* without this returning from hibernate-mode causes wrong timing */ timeend (); @@ -713,7 +713,7 @@ static void winuae_active (HWND hWnd, int minimized) if (os_vista && AVTask == NULL) { DWORD taskIndex = 0; if (!(AVTask = AvSetMmThreadCharacteristics (TEXT("Pro Audio"), &taskIndex))) - write_log (L"AvSetMmThreadCharacteristics failed: %d\n", GetLastError ()); + write_log (_T("AvSetMmThreadCharacteristics failed: %d\n"), GetLastError ()); } #endif } @@ -723,7 +723,7 @@ static void winuae_inactive (HWND hWnd, int minimized) struct threadpriorities *pri; int wasfocus = focus; - write_log (L"winuae_inactive(%d)\n", minimized); + write_log (_T("winuae_inactive(%d)\n"), minimized); #if USETHREADCHARACTERICS if (AVTask) AvRevertMmThreadCharacteristics (AVTask); @@ -818,7 +818,7 @@ void disablecapture (void) void gui_gameport_button_change (int port, int button, int onoff) { - //write_log (L"%d %d %d\n", port, button, onoff); + //write_log (_T("%d %d %d\n"), port, button, onoff); #ifdef RETROPLATFORM int mask = 0; if (button == JOYBUTTON_CD32_PLAY) @@ -939,7 +939,7 @@ static LRESULT CALLBACK AmigaWindowProc (HWND hWnd, UINT message, WPARAM wParam, static bool ignorelbutton; #if MSGDEBUG > 1 - write_log (L"AWP: %x %x\n", hWnd, message); + write_log (_T("AWP: %x %x\n"), hWnd, message); #endif switch (message) @@ -962,7 +962,7 @@ static LRESULT CALLBACK AmigaWindowProc (HWND hWnd, UINT message, WPARAM wParam, dx_check (); break; case WM_ACTIVATE: - //write_log (L"active %d\n", LOWORD(wParam)); + //write_log (_T("active %d\n"), LOWORD(wParam)); if (LOWORD (wParam) == WA_INACTIVE) { minimized = HIWORD (wParam) ? 1 : 0; winuae_inactive (hWnd, minimized); @@ -1170,7 +1170,7 @@ static LRESULT CALLBACK AmigaWindowProc (HWND hWnd, UINT message, WPARAM wParam, mx -= mouseposx; my -= mouseposy; - //write_log (L"%d %d %d %d %d %d %dx%d %dx%d\n", wm, mouseactive, focus, showcursor, recapture, isfullscreen (), mx, my, mouseposx, mouseposy); + //write_log (_T("%d %d %d %d %d %d %dx%d %dx%d\n"), wm, mouseactive, focus, showcursor, recapture, isfullscreen (), mx, my, mouseposx, mouseposy); if (recapture && isfullscreen () <= 0) { enablecapture (); return 0; @@ -1196,7 +1196,7 @@ static LRESULT CALLBACK AmigaWindowProc (HWND hWnd, UINT message, WPARAM wParam, int myy = (amigawin_rect.bottom - amigawin_rect.top) / 2; mx = mx - mxx; my = my - myy; - //write_log (L"%d:%dx%d\n", dinput_winmouse(), mx, my); + //write_log (_T("%d:%dx%d\n"), dinput_winmouse(), mx, my); setmousestate (dinput_winmouse (), 0, mx, 0); setmousestate (dinput_winmouse (), 1, my, 0); } @@ -1238,7 +1238,7 @@ static LRESULT CALLBACK AmigaWindowProc (HWND hWnd, UINT message, WPARAM wParam, if (SHGetPathFromIDList ((struct _ITEMIDLIST *)(shns->dwItem1), path)) { int inserted = lParam == SHCNE_MEDIAINSERTED ? 1 : 0; UINT errormode = SetErrorMode (SEM_FAILCRITICALERRORS | SEM_NOOPENFILEERRORBOX); - write_log (L"Shell Notification %d '%s'\n", inserted, path); + write_log (_T("Shell Notification %d '%s'\n"), inserted, path); if (!win32_hardfile_media_change (path, inserted)) { if ((inserted && CheckRM (path)) || !inserted) { if (inserted) { @@ -1285,7 +1285,7 @@ static LRESULT CALLBACK AmigaWindowProc (HWND hWnd, UINT message, WPARAM wParam, int type; drive = 'A' + i; - _stprintf (drvname, L"%c:\\", drive); + _stprintf (drvname, _T("%c:\\"), drive); type = GetDriveType (drvname); if (wParam == DBT_DEVICEARRIVAL) inserted = 1; @@ -1300,7 +1300,7 @@ static LRESULT CALLBACK AmigaWindowProc (HWND hWnd, UINT message, WPARAM wParam, matched |= win32_aspi_media_change (drive, inserted); } if (type == DRIVE_REMOVABLE || type == DRIVE_CDROM || !inserted) { - write_log (L"WM_DEVICECHANGE '%s' type=%d inserted=%d\n", drvname, type, inserted); + write_log (_T("WM_DEVICECHANGE '%s' type=%d inserted=%d\n"), drvname, type, inserted); if (!win32_hardfile_media_change (drvname, inserted)) { if ((inserted && CheckRM (drvname)) || !inserted) { if (type == DRIVE_CDROM && inserted) @@ -1516,7 +1516,7 @@ static LRESULT CALLBACK MainWindowProc (HWND hWnd, UINT message, WPARAM wParam, HDC hDC; #if MSGDEBUG > 1 - write_log (L"MWP: %x %d\n", hWnd, message); + write_log (_T("MWP: %x %d\n"), hWnd, message); #endif switch (message) @@ -1607,8 +1607,8 @@ static LRESULT CALLBACK MainWindowProc (HWND hWnd, UINT message, WPARAM wParam, DWORD width = rc2.right - rc2.left; DWORD height = rc2.bottom - rc2.top; if (store_xy++) { - regsetint (NULL, L"MainPosX", left); - regsetint (NULL, L"MainPosY", top); + regsetint (NULL, _T("MainPosX"), left); + regsetint (NULL, _T("MainPosY"), top); } changed_prefs.gfx_size_win.x = left; changed_prefs.gfx_size_win.y = top; @@ -1823,7 +1823,7 @@ static LRESULT CALLBACK HiddenWindowProc (HWND hWnd, UINT message, WPARAM wParam break; } if (TaskbarRestart != 0 && TaskbarRestartHWND == hWnd && message == TaskbarRestart) { - //write_log (L"notif: taskbarrestart\n"); + //write_log (_T("notif: taskbarrestart\n")); systray (TaskbarRestartHWND, FALSE); } return DefWindowProc (hWnd, message, wParam, lParam); @@ -1852,7 +1852,7 @@ void handle_events (void) if (hStatusWnd && guijoychange && window_led_joy_start > 0) { guijoychange = false; for (int i = 0; i < window_led_joy_start; i++) - PostMessage (hStatusWnd, SB_SETTEXT, (WPARAM)((i + 1) | SBT_OWNERDRAW), (LPARAM)L""); + PostMessage (hStatusWnd, SB_SETTEXT, (WPARAM)((i + 1) | SBT_OWNERDRAW), (LPARAM)_T("")); } while (pause_emulation) { @@ -1934,7 +1934,7 @@ static int WIN32_RegisterClasses (void) wc.hIcon = LoadIcon (GetModuleHandle (NULL), MAKEINTRESOURCE (IDI_APPICON)); wc.hCursor = LoadCursor (NULL, IDC_ARROW); wc.lpszMenuName = 0; - wc.lpszClassName = L"AmigaPowah"; + wc.lpszClassName = _T("AmigaPowah"); wc.hbrBackground = CreateSolidBrush (g_dwBackgroundColor); if (!RegisterClass (&wc)) return 0; @@ -1948,7 +1948,7 @@ static int WIN32_RegisterClasses (void) wc.hCursor = LoadCursor (NULL, IDC_ARROW); wc.hbrBackground = CreateSolidBrush (black); wc.lpszMenuName = 0; - wc.lpszClassName = L"PCsuxRox"; + wc.lpszClassName = _T("PCsuxRox"); if (!RegisterClass (&wc)) return 0; @@ -1961,12 +1961,12 @@ static int WIN32_RegisterClasses (void) wc.hCursor = NULL; wc.hbrBackground = CreateSolidBrush (g_dwBackgroundColor); wc.lpszMenuName = 0; - wc.lpszClassName = L"Useless"; + wc.lpszClassName = _T("Useless"); if (!RegisterClass (&wc)) return 0; hHiddenWnd = CreateWindowEx (0, - L"Useless", L"You don't see me", + _T("Useless"), _T("You don't see me"), WS_POPUP, 0, 0, 1, 1, @@ -1996,13 +1996,13 @@ int WIN32_CleanupLibraries (void) /* HtmlHelp Initialization - optional component */ int WIN32_InitHtmlHelp (void) { - TCHAR *chm = L"WinUAE.chm"; + TCHAR *chm = _T("WinUAE.chm"); int result = 0; - _stprintf(help_file, L"%s%s", start_path_data, chm); + _stprintf(help_file, _T("%s%s"), start_path_data, chm); if (!zfile_exists (help_file)) - _stprintf(help_file, L"%s%s", start_path_exe, chm); + _stprintf(help_file, _T("%s%s"), start_path_exe, chm); if (zfile_exists (help_file)) { - if (hHtmlHelp = LoadLibrary (L"HHCTRL.OCX")) { + if (hHtmlHelp = LoadLibrary (_T("HHCTRL.OCX"))) { pHtmlHelp = (HWND(WINAPI *)(HWND, LPCWSTR, UINT, LPDWORD))GetProcAddress (hHtmlHelp, "HtmlHelpW"); result = 1; } @@ -2012,74 +2012,74 @@ int WIN32_InitHtmlHelp (void) struct winuae_lang langs[] = { - { LANG_AFRIKAANS, L"Afrikaans" }, - { LANG_ARABIC, L"Arabic" }, - { LANG_ARMENIAN, L"Armenian" }, - { LANG_ASSAMESE, L"Assamese" }, - { LANG_AZERI, L"Azeri" }, - { LANG_BASQUE, L"Basque" }, - { LANG_BELARUSIAN, L"Belarusian" }, - { LANG_BENGALI, L"Bengali" }, - { LANG_BULGARIAN, L"Bulgarian" }, - { LANG_CATALAN, L"Catalan" }, - { LANG_CHINESE, L"Chinese" }, - { LANG_CROATIAN, L"Croatian" }, - { LANG_CZECH, L"Czech" }, - { LANG_DANISH, L"Danish" }, - { LANG_DUTCH, L"Dutch" }, - { LANG_ESTONIAN, L"Estoanian" }, - { LANG_FAEROESE, L"Faeroese" }, - { LANG_FARSI, L"Farsi" }, - { LANG_FINNISH, L"Finnish" }, - { LANG_FRENCH, L"French" }, - { LANG_GEORGIAN, L"Georgian" }, - { LANG_GERMAN, L"German" }, - { LANG_GREEK, L"Greek" }, - { LANG_GUJARATI, L"Gujarati" }, - { LANG_HEBREW, L"Hebrew" }, - { LANG_HINDI, L"Hindi" }, - { LANG_HUNGARIAN, L"Hungarian" }, - { LANG_ICELANDIC, L"Icelandic" }, - { LANG_INDONESIAN, L"Indonesian" }, - { LANG_ITALIAN, L"Italian" }, - { LANG_JAPANESE, L"Japanese" }, - { LANG_KANNADA, L"Kannada" }, - { LANG_KASHMIRI, L"Kashmiri" }, - { LANG_KAZAK, L"Kazak" }, - { LANG_KONKANI, L"Konkani" }, - { LANG_KOREAN, L"Korean" }, - { LANG_LATVIAN, L"Latvian" }, - { LANG_LITHUANIAN, L"Lithuanian" }, - { LANG_MACEDONIAN, L"Macedonian" }, - { LANG_MALAY, L"Malay" }, - { LANG_MALAYALAM, L"Malayalam" }, - { LANG_MANIPURI, L"Manipuri" }, - { LANG_MARATHI, L"Marathi" }, - { LANG_NEPALI, L"Nepali" }, - { LANG_NORWEGIAN, L"Norwegian" }, - { LANG_ORIYA, L"Oriya" }, - { LANG_POLISH, L"Polish" }, - { LANG_PORTUGUESE, L"Portuguese" }, - { LANG_PUNJABI, L"Punjabi" }, - { LANG_ROMANIAN, L"Romanian" }, - { LANG_RUSSIAN, L"Russian" }, - { LANG_SANSKRIT, L"Sanskrit" }, - { LANG_SINDHI, L"Sindhi" }, - { LANG_SLOVAK, L"Slovak" }, - { LANG_SLOVENIAN, L"Slovenian" }, - { LANG_SPANISH, L"Spanish" }, - { LANG_SWAHILI, L"Swahili" }, - { LANG_SWEDISH, L"Swedish" }, - { LANG_TAMIL, L"Tamil" }, - { LANG_TATAR, L"Tatar" }, - { LANG_TELUGU, L"Telugu" }, - { LANG_THAI, L"Thai" }, - { LANG_TURKISH, L"Turkish" }, - { LANG_UKRAINIAN, L"Ukrainian" }, - { LANG_UZBEK, L"Uzbek" }, - { LANG_VIETNAMESE, L"Vietnamese" }, - { LANG_ENGLISH, L"default" }, - { 0x400, L"guidll.dll"}, + { LANG_AFRIKAANS, _T("Afrikaans") }, + { LANG_ARABIC, _T("Arabic") }, + { LANG_ARMENIAN, _T("Armenian") }, + { LANG_ASSAMESE, _T("Assamese") }, + { LANG_AZERI, _T("Azeri") }, + { LANG_BASQUE, _T("Basque") }, + { LANG_BELARUSIAN, _T("Belarusian") }, + { LANG_BENGALI, _T("Bengali") }, + { LANG_BULGARIAN, _T("Bulgarian") }, + { LANG_CATALAN, _T("Catalan") }, + { LANG_CHINESE, _T("Chinese") }, + { LANG_CROATIAN, _T("Croatian") }, + { LANG_CZECH, _T("Czech") }, + { LANG_DANISH, _T("Danish") }, + { LANG_DUTCH, _T("Dutch") }, + { LANG_ESTONIAN, _T("Estoanian") }, + { LANG_FAEROESE, _T("Faeroese") }, + { LANG_FARSI, _T("Farsi") }, + { LANG_FINNISH, _T("Finnish") }, + { LANG_FRENCH, _T("French") }, + { LANG_GEORGIAN, _T("Georgian") }, + { LANG_GERMAN, _T("German") }, + { LANG_GREEK, _T("Greek") }, + { LANG_GUJARATI, _T("Gujarati") }, + { LANG_HEBREW, _T("Hebrew") }, + { LANG_HINDI, _T("Hindi") }, + { LANG_HUNGARIAN, _T("Hungarian") }, + { LANG_ICELANDIC, _T("Icelandic") }, + { LANG_INDONESIAN, _T("Indonesian") }, + { LANG_ITALIAN, _T("Italian") }, + { LANG_JAPANESE, _T("Japanese") }, + { LANG_KANNADA, _T("Kannada") }, + { LANG_KASHMIRI, _T("Kashmiri") }, + { LANG_KAZAK, _T("Kazak") }, + { LANG_KONKANI, _T("Konkani") }, + { LANG_KOREAN, _T("Korean") }, + { LANG_LATVIAN, _T("Latvian") }, + { LANG_LITHUANIAN, _T("Lithuanian") }, + { LANG_MACEDONIAN, _T("Macedonian") }, + { LANG_MALAY, _T("Malay") }, + { LANG_MALAYALAM, _T("Malayalam") }, + { LANG_MANIPURI, _T("Manipuri") }, + { LANG_MARATHI, _T("Marathi") }, + { LANG_NEPALI, _T("Nepali") }, + { LANG_NORWEGIAN, _T("Norwegian") }, + { LANG_ORIYA, _T("Oriya") }, + { LANG_POLISH, _T("Polish") }, + { LANG_PORTUGUESE, _T("Portuguese") }, + { LANG_PUNJABI, _T("Punjabi") }, + { LANG_ROMANIAN, _T("Romanian") }, + { LANG_RUSSIAN, _T("Russian") }, + { LANG_SANSKRIT, _T("Sanskrit") }, + { LANG_SINDHI, _T("Sindhi") }, + { LANG_SLOVAK, _T("Slovak") }, + { LANG_SLOVENIAN, _T("Slovenian") }, + { LANG_SPANISH, _T("Spanish") }, + { LANG_SWAHILI, _T("Swahili") }, + { LANG_SWEDISH, _T("Swedish") }, + { LANG_TAMIL, _T("Tamil") }, + { LANG_TATAR, _T("Tatar") }, + { LANG_TELUGU, _T("Telugu") }, + { LANG_THAI, _T("Thai") }, + { LANG_TURKISH, _T("Turkish") }, + { LANG_UKRAINIAN, _T("Ukrainian") }, + { LANG_UZBEK, _T("Uzbek") }, + { LANG_VIETNAMESE, _T("Vietnamese") }, + { LANG_ENGLISH, _T("default") }, + { 0x400, _T("guidll.dll")}, { 0, NULL } }; static TCHAR *getlanguagename(DWORD id) @@ -2116,9 +2116,9 @@ HMODULE language_load (WORD language) int fail = 1; if (language == 0x400) - _tcscpy (dllbuf, L"guidll.dll"); + _tcscpy (dllbuf, _T("guidll.dll")); else - _stprintf (dllbuf, L"WinUAE_%s.dll", dllname); + _stprintf (dllbuf, _T("WinUAE_%s.dll"), dllname); result = WIN32_LoadLibrary (dllbuf); if (result) { dwFileVersionInfoSize = GetFileVersionInfoSize (dllbuf, &dwVersionHandle); @@ -2134,9 +2134,9 @@ HMODULE language_load (WORD language) && LOWORD(vsFileInfo->dwProductVersionMS) == UAEMINOR && (HIWORD(vsFileInfo->dwProductVersionLS) == UAESUBREV)) { success = TRUE; - write_log (L"Translation DLL '%s' loaded and enabled\n", dllbuf); + write_log (_T("Translation DLL '%s' loaded and enabled\n"), dllbuf); } else { - write_log (L"Translation DLL '%s' version mismatch (%d.%d.%d)\n", dllbuf, + write_log (_T("Translation DLL '%s' version mismatch (%d.%d.%d)\n"), dllbuf, HIWORD(vsFileInfo->dwProductVersionMS), LOWORD(vsFileInfo->dwProductVersionMS), HIWORD(vsFileInfo->dwProductVersionLS)); @@ -2150,7 +2150,7 @@ HMODULE language_load (WORD language) if (fail) { DWORD err = GetLastError (); if (err != ERROR_MOD_NOT_FOUND && err != ERROR_DLL_NOT_FOUND) - write_log (L"Translation DLL '%s' failed to load, error %d\n", dllbuf, GetLastError ()); + write_log (_T("Translation DLL '%s' failed to load, error %d\n"), dllbuf, GetLastError ()); } if (result && !success) { FreeLibrary (result); @@ -2185,7 +2185,7 @@ static void WIN32_InitLang (void) int lid; WORD langid = -1; - if (regqueryint (NULL, L"Language", &lid)) + if (regqueryint (NULL, _T("Language"), &lid)) langid = (WORD)lid; hUIDLL = language_load (langid); pritransla (); @@ -2202,24 +2202,24 @@ static int WIN32_InitLibraries (void) CoInitializeEx (NULL, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE); /* Determine our processor speed and capabilities */ if (!init_mmtimer ()) { - pre_gui_message (L"MMTimer initialization failed, exiting.."); + pre_gui_message (_T("MMTimer initialization failed, exiting..")); return 0; } if (!QueryPerformanceCounter (&freq)) { - pre_gui_message (L"No QueryPerformanceFrequency() supported, exiting..\n"); + pre_gui_message (_T("No QueryPerformanceFrequency() supported, exiting..\n")); return 0; } figure_processor_speed (); if (!timebegin ()) { - pre_gui_message (L"MMTimer second initialization failed, exiting.."); + pre_gui_message (_T("MMTimer second initialization failed, exiting..")); return 0; } pSetCurrentProcessExplicitAppUserModelID = (SETCURRENTPROCESSEXPLICITAPPUSERMODEIDD)GetProcAddress ( - GetModuleHandle (L"shell32.dll"), "SetCurrentProcessExplicitAppUserModelID"); + GetModuleHandle (_T("shell32.dll")), "SetCurrentProcessExplicitAppUserModelID"); if (pSetCurrentProcessExplicitAppUserModelID) pSetCurrentProcessExplicitAppUserModelID (WINUAEAPPNAME); - hRichEdit = LoadLibrary (L"RICHED32.DLL"); + hRichEdit = LoadLibrary (_T("RICHED32.DLL")); return 1; } @@ -2232,8 +2232,8 @@ void toggle_mousegrab (void) { } -#define LOG_BOOT L"winuaebootlog.txt" -#define LOG_NORMAL L"winuaelog.txt" +#define LOG_BOOT _T("winuaebootlog.txt") +#define LOG_NORMAL _T("winuaelog.txt") static bool createbootlog = true; @@ -2244,9 +2244,9 @@ void logging_open (int bootlog, int append) debugfilename[0] = 0; #ifndef SINGLEFILE if (currprefs.win32_logfile) - _stprintf (debugfilename, L"%s%s", start_path_data, LOG_NORMAL); + _stprintf (debugfilename, _T("%s%s"), start_path_data, LOG_NORMAL); if (bootlog) { - _stprintf (debugfilename, L"%s%s", start_path_data, LOG_BOOT); + _stprintf (debugfilename, _T("%s%s"), start_path_data, LOG_BOOT); if (!createbootlog) bootlog = -1; } @@ -2270,11 +2270,11 @@ void logging_init (void) TCHAR tmp[MAX_DPATH]; if (first > 1) { - write_log (L"** RESTART **\n"); + write_log (_T("** RESTART **\n")); return; } if (first == 1) { - write_log (L"Log (%s): '%s%s'\n", currprefs.win32_logfile ? L"enabled" : L"disabled", + write_log (_T("Log (%s): '%s%s'\n"), currprefs.win32_logfile ? _T("enabled") : _T("disabled"), start_path_data, LOG_NORMAL); if (debugfile) log_close (debugfile); @@ -2286,30 +2286,30 @@ void logging_init (void) #ifdef _WIN64 wow64 = 1; #else - fnIsWow64Process = (LPFN_ISWOW64PROCESS)GetProcAddress (GetModuleHandle (L"kernel32"), "IsWow64Process"); + fnIsWow64Process = (LPFN_ISWOW64PROCESS)GetProcAddress (GetModuleHandle (_T("kernel32")), "IsWow64Process"); if (fnIsWow64Process) fnIsWow64Process (GetCurrentProcess (), &wow64); #endif - write_log (L"%s (%d.%d %s%s[%d])", VersionStr, + write_log (_T("%s (%d.%d %s%s[%d])"), VersionStr, osVersion.dwMajorVersion, osVersion.dwMinorVersion, osVersion.szCSDVersion, - _tcslen (osVersion.szCSDVersion) > 0 ? L" " : L"", os_winnt_admin); - write_log (L" %d-bit %X.%X.%X %d", + _tcslen (osVersion.szCSDVersion) > 0 ? _T(" ") : _T(""), os_winnt_admin); + write_log (_T(" %d-bit %X.%X.%X %d"), wow64 ? 64 : 32, SystemInfo.wProcessorArchitecture, SystemInfo.wProcessorLevel, SystemInfo.wProcessorRevision, SystemInfo.dwNumberOfProcessors); - write_log (L"\n(c) 1995-2001 Bernd Schmidt - Core UAE concept and implementation." - L"\n(c) 1998-2012 Toni Wilen - Win32 port, core code updates." - L"\n(c) 1996-2001 Brian King - Win32 port, Picasso96 RTG, and GUI." - L"\n(c) 1996-1999 Mathias Ortmann - Win32 port and bsdsocket support." - L"\n(c) 2000-2001 Bernd Meyer - JIT engine." - L"\n(c) 2000-2005 Bernd Roesch - MIDI input, many fixes." - L"\nPress F12 to show the Settings Dialog (GUI), Alt-F4 to quit." - L"\nEnd+F1 changes floppy 0, End+F2 changes floppy 1, etc." - L"\n"); + write_log (_T("\n(c) 1995-2001 Bernd Schmidt - Core UAE concept and implementation.") + _T("\n(c) 1998-2012 Toni Wilen - Win32 port, core code updates.") + _T("\n(c) 1996-2001 Brian King - Win32 port, Picasso96 RTG, and GUI.") + _T("\n(c) 1996-1999 Mathias Ortmann - Win32 port and bsdsocket support.") + _T("\n(c) 2000-2001 Bernd Meyer - JIT engine.") + _T("\n(c) 2000-2005 Bernd Roesch - MIDI input, many fixes.") + _T("\nPress F12 to show the Settings Dialog (GUI), Alt-F4 to quit.") + _T("\nEnd+F1 changes floppy 0, End+F2 changes floppy 1, etc.") + _T("\n")); tmp[0] = 0; GetModuleFileName (NULL, tmp, sizeof tmp / sizeof (TCHAR)); - write_log (L"'%s'\n", tmp); - write_log (L"EXE: '%s', DATA: '%s', PLUGIN: '%s'\n", start_path_exe, start_path_data, start_path_plugins); + write_log (_T("'%s'\n"), tmp); + write_log (_T("EXE: '%s', DATA: '%s', PLUGIN: '%s'\n"), start_path_exe, start_path_data, start_path_plugins); regstatus (); } @@ -2328,7 +2328,7 @@ uae_u8 *save_log (int bootlog, int *len) if (!logging_started) return NULL; - f = _tfopen (bootlog ? LOG_BOOT : LOG_NORMAL, L"rb"); + f = _tfopen (bootlog ? LOG_BOOT : LOG_NORMAL, _T("rb")); if (!f) return NULL; fseek (f, 0, SEEK_END); @@ -2357,7 +2357,7 @@ void fixtrailing (TCHAR *p) return; if (p[_tcslen(p) - 1] == '/' || p[_tcslen(p) - 1] == '\\') return; - _tcscat(p, L"\\"); + _tcscat(p, _T("\\")); } // convert path to absolute or relative void fullpath (TCHAR *path, int size) @@ -2366,7 +2366,7 @@ void fullpath (TCHAR *path, int size) return; /* : is supposed to mean same as :\ */ if (_istalpha (path[0]) && path[1] == ':' && path[2] == 0) - _tcscat (path, L"\\"); + _tcscat (path, _T("\\")); if (relativepaths) { TCHAR tmp1[MAX_DPATH], tmp2[MAX_DPATH]; tmp1[0] = 0; @@ -2377,7 +2377,7 @@ void fullpath (TCHAR *path, int size) if (ret == 0 || ret >= sizeof tmp2 / sizeof (TCHAR)) return; if (_tcsnicmp (tmp1, tmp2, _tcslen (tmp1)) == 0) { // tmp2 is inside tmp1 - _tcscpy (path, L".\\"); + _tcscpy (path, _T(".\\")); _tcscat (path, tmp2 + _tcslen (tmp1)); } else { _tcscpy (path, tmp2); @@ -2413,20 +2413,20 @@ uae_u8 *target_load_keyfile (struct uae_prefs *p, const TCHAR *path, int *sizep, HMODULE h; PFN_GetKey pfnGetKey; int size; - TCHAR *libname = L"amigaforever.dll"; + TCHAR *libname = _T("amigaforever.dll"); h = WIN32_LoadLibrary (libname); if (!h) { TCHAR path[MAX_DPATH]; - _stprintf (path, L"%s..\\Player\\%s", start_path_exe, libname); + _stprintf (path, _T("%s..\\Player\\%s"), start_path_exe, libname); h = WIN32_LoadLibrary2 (path); if (!h) { - TCHAR *afr = _wgetenv (L"AMIGAFOREVERROOT"); + TCHAR *afr = _wgetenv (_T("AMIGAFOREVERROOT")); if (afr) { TCHAR tmp[MAX_DPATH]; _tcscpy (tmp, afr); fixtrailing (tmp); - _stprintf (path, L"%sPlayer\\%s", tmp, libname); + _stprintf (path, _T("%sPlayer\\%s"), tmp, libname); h = WIN32_LoadLibrary2 (path); } } @@ -2434,18 +2434,18 @@ uae_u8 *target_load_keyfile (struct uae_prefs *p, const TCHAR *path, int *sizep, if (!h) return NULL; GetModuleFileName (h, name, MAX_DPATH); - //write_log (L"keydll: %s'\n", name); + //write_log (_T("keydll: %s'\n"), name); pfnGetKey = (PFN_GetKey)GetProcAddress (h, "GetKey"); - //write_log (L"addr: %08x\n", pfnGetKey); + //write_log (_T("addr: %08x\n"), pfnGetKey); if (pfnGetKey) { size = pfnGetKey (NULL, 0); *sizep = size; - //write_log (L"size: %d\n", size); + //write_log (_T("size: %d\n"), size); if (size > 0) { int gotsize; keybuf = xmalloc (uae_u8, size); gotsize = pfnGetKey (keybuf, size); - //write_log (L"gotsize: %d\n", gotsize); + //write_log (_T("gotsize: %d\n"), gotsize); if (gotsize != size) { xfree (keybuf); keybuf = NULL; @@ -2453,7 +2453,7 @@ uae_u8 *target_load_keyfile (struct uae_prefs *p, const TCHAR *path, int *sizep, } } FreeLibrary (h); - //write_log (L"keybuf=%08x\n", keybuf); + //write_log (_T("keybuf=%08x\n"), keybuf); return keybuf; } @@ -2750,13 +2750,13 @@ static void shellexecute (const TCHAR *command) _tcscat (cmd, L"\""); _tcscat (cmd, arg[k]); if (quote) - _tcscat (cmd, L"\""); - if (!exec && !_tcsicmp (cmd, L"cmd.exe")) { + _tcscat (cmd, _T("\"")); + if (!exec && !_tcsicmp (cmd, _T("cmd.exe"))) { int size; - size = GetEnvironmentVariable (L"ComSpec", NULL, 0); + size = GetEnvironmentVariable (_T("ComSpec"), NULL, 0); if (size > 0) { exec = xcalloc (TCHAR, size + 1); - GetEnvironmentVariable (L"ComSpec", exec, size); + GetEnvironmentVariable (_T("ComSpec"), exec, size); } cmd[0] = 0; } @@ -2773,7 +2773,7 @@ static void shellexecute (const TCHAR *command) CloseHandle (pi.hProcess); CloseHandle (pi.hThread); } else { - write_log (L"CreateProcess('%s' '%s') failed, %d\n", + write_log (_T("CreateProcess('%s' '%s') failed, %d\n"), exec, cmd, GetLastError ()); } xfree (exec); @@ -2876,8 +2876,8 @@ void target_default_options (struct uae_prefs *p, int type) } } -static const TCHAR *scsimode[] = { L"SCSIEMU", L"SPTI", L"SPTI+SCSISCAN", L"AdaptecASPI", L"NeroASPI", L"FrogASPI", NULL }; -static const TCHAR *statusbarmode[] = { L"none", L"normal", L"extended", NULL }; +static const TCHAR *scsimode[] = { _T("SCSIEMU"), _T("SPTI"), _T("SPTI+SCSISCAN"), _T("AdaptecASPI"), _T("NeroASPI"), _T("FrogASPI"), NULL }; +static const TCHAR *statusbarmode[] = { _T("none"), _T("normal"), _T("extended"), NULL }; static struct midiportinfo *getmidiport (struct midiportinfo **mi, int devid) { @@ -2892,86 +2892,86 @@ void target_save_options (struct zfile *f, struct uae_prefs *p) { struct midiportinfo *midp; - cfgfile_target_dwrite_bool (f, L"middle_mouse", p->win32_middle_mouse); - cfgfile_target_dwrite_bool (f, L"logfile", p->win32_logfile); - cfgfile_target_dwrite_bool (f, L"map_drives", p->win32_automount_drives); - cfgfile_target_dwrite_bool (f, L"map_drives_auto", p->win32_automount_removable); - cfgfile_target_dwrite_bool (f, L"map_cd_drives", p->win32_automount_cddrives); - cfgfile_target_dwrite_bool (f, L"map_net_drives", p->win32_automount_netdrives); - cfgfile_target_dwrite_bool (f, L"map_removable_drives", p->win32_automount_removabledrives); + cfgfile_target_dwrite_bool (f, _T("middle_mouse"), p->win32_middle_mouse); + cfgfile_target_dwrite_bool (f, _T("logfile"), p->win32_logfile); + cfgfile_target_dwrite_bool (f, _T("map_drives"), p->win32_automount_drives); + cfgfile_target_dwrite_bool (f, _T("map_drives_auto"), p->win32_automount_removable); + cfgfile_target_dwrite_bool (f, _T("map_cd_drives"), p->win32_automount_cddrives); + cfgfile_target_dwrite_bool (f, _T("map_net_drives"), p->win32_automount_netdrives); + cfgfile_target_dwrite_bool (f, _T("map_removable_drives"), p->win32_automount_removabledrives); serdevtoname (p->sername); - cfgfile_target_dwrite_str (f, L"serial_port", p->sername[0] ? p->sername : L"none"); + cfgfile_target_dwrite_str (f, _T("serial_port"), p->sername[0] ? p->sername : _T("none")); sernametodev (p->sername); - cfgfile_target_dwrite_str (f, L"parallel_port", p->prtname[0] ? p->prtname : L"none"); + cfgfile_target_dwrite_str (f, _T("parallel_port"), p->prtname[0] ? p->prtname : _T("none")); - cfgfile_target_dwrite (f, L"active_priority", L"%d", priorities[p->win32_active_capture_priority].value); + cfgfile_target_dwrite (f, _T("active_priority"), _T("%d"), priorities[p->win32_active_capture_priority].value); #if 0 - cfgfile_target_dwrite (f, L"active_not_captured_priority", L"%d", priorities[p->win32_active_nocapture_priority].value); + cfgfile_target_dwrite (f, _T("active_not_captured_priority"), _T("%d"), priorities[p->win32_active_nocapture_priority].value); #endif - cfgfile_target_dwrite_bool (f, L"active_not_captured_nosound", p->win32_active_nocapture_nosound); - cfgfile_target_dwrite_bool (f, L"active_not_captured_pause", p->win32_active_nocapture_pause); - cfgfile_target_dwrite (f, L"inactive_priority", L"%d", priorities[p->win32_inactive_priority].value); - cfgfile_target_dwrite_bool (f, L"inactive_nosound", p->win32_inactive_nosound); - cfgfile_target_dwrite_bool (f, L"inactive_pause", p->win32_inactive_pause); - cfgfile_target_dwrite (f, L"iconified_priority", L"%d", priorities[p->win32_iconified_priority].value); - cfgfile_target_dwrite_bool (f, L"iconified_nosound", p->win32_iconified_nosound); - cfgfile_target_dwrite_bool (f, L"iconified_pause", p->win32_iconified_pause); - cfgfile_target_dwrite_bool (f, L"inactive_iconify", p->win32_minimize_inactive); + cfgfile_target_dwrite_bool (f, _T("active_not_captured_nosound"), p->win32_active_nocapture_nosound); + cfgfile_target_dwrite_bool (f, _T("active_not_captured_pause"), p->win32_active_nocapture_pause); + cfgfile_target_dwrite (f, _T("inactive_priority"), _T("%d"), priorities[p->win32_inactive_priority].value); + cfgfile_target_dwrite_bool (f, _T("inactive_nosound"), p->win32_inactive_nosound); + cfgfile_target_dwrite_bool (f, _T("inactive_pause"), p->win32_inactive_pause); + cfgfile_target_dwrite (f, _T("iconified_priority"), _T("%d"), priorities[p->win32_iconified_priority].value); + cfgfile_target_dwrite_bool (f, _T("iconified_nosound"), p->win32_iconified_nosound); + cfgfile_target_dwrite_bool (f, _T("iconified_pause"), p->win32_iconified_pause); + cfgfile_target_dwrite_bool (f, _T("inactive_iconify"), p->win32_minimize_inactive); - cfgfile_target_dwrite_bool (f, L"ctrl_f11_is_quit", p->win32_ctrl_F11_is_quit); + cfgfile_target_dwrite_bool (f, _T("ctrl_f11_is_quit"), p->win32_ctrl_F11_is_quit); - cfgfile_target_dwrite (f, L"midiout_device", L"%d", p->win32_midioutdev); - cfgfile_target_dwrite (f, L"midiin_device", L"%d", p->win32_midiindev); + cfgfile_target_dwrite (f, _T("midiout_device"), _T("%d"), p->win32_midioutdev); + cfgfile_target_dwrite (f, _T("midiin_device"), _T("%d"), p->win32_midiindev); midp = getmidiport (midioutportinfo, p->win32_midioutdev); if (p->win32_midioutdev < -1) - cfgfile_target_dwrite_str (f, L"midiout_device_name", L"none"); + cfgfile_target_dwrite_str (f, _T("midiout_device_name"), _T("none")); else if (p->win32_midioutdev == -1 || midp == NULL) - cfgfile_target_dwrite_str (f, L"midiout_device_name", L"default"); + cfgfile_target_dwrite_str (f, _T("midiout_device_name"), _T("default")); else - cfgfile_target_dwrite_str (f, L"midiout_device_name", midp->name); + cfgfile_target_dwrite_str (f, _T("midiout_device_name"), midp->name); midp = getmidiport (midiinportinfo, p->win32_midiindev); if (p->win32_midiindev < 0 || midp == NULL) - cfgfile_target_dwrite_str (f, L"midiin_device_name", L"none"); + cfgfile_target_dwrite_str (f, _T("midiin_device_name"), _T("none")); else - cfgfile_target_dwrite_str (f, L"midiin_device_name", midp->name); + cfgfile_target_dwrite_str (f, _T("midiin_device_name"), midp->name); - cfgfile_target_dwrite_bool (f, L"rtg_match_depth", p->win32_rtgmatchdepth); - cfgfile_target_dwrite_bool (f, L"rtg_scale_small", p->win32_rtgscaleifsmall); - cfgfile_target_dwrite_bool (f, L"rtg_scale_allow", p->win32_rtgallowscaling); - cfgfile_target_dwrite (f, L"rtg_scale_aspect_ratio", L"%d:%d", + cfgfile_target_dwrite_bool (f, _T("rtg_match_depth"), p->win32_rtgmatchdepth); + cfgfile_target_dwrite_bool (f, _T("rtg_scale_small"), p->win32_rtgscaleifsmall); + cfgfile_target_dwrite_bool (f, _T("rtg_scale_allow"), p->win32_rtgallowscaling); + cfgfile_target_dwrite (f, _T("rtg_scale_aspect_ratio"), _T("%d:%d"), p->win32_rtgscaleaspectratio >= 0 ? (p->win32_rtgscaleaspectratio >> 8) : -1, p->win32_rtgscaleaspectratio >= 0 ? (p->win32_rtgscaleaspectratio & 0xff) : -1); if (p->win32_rtgvblankrate <= 0) - cfgfile_target_dwrite_str (f, L"rtg_vblank", p->win32_rtgvblankrate == -1 ? L"real" : (p->win32_rtgvblankrate == -2 ? L"disabled" : L"chipset")); + cfgfile_target_dwrite_str (f, _T("rtg_vblank"), p->win32_rtgvblankrate == -1 ? _T("real") : (p->win32_rtgvblankrate == -2 ? _T("disabled") : _T("chipset"))); else - cfgfile_target_dwrite (f, L"rtg_vblank", L"%d", p->win32_rtgvblankrate); - cfgfile_target_dwrite_bool (f, L"borderless", p->win32_borderless); - cfgfile_target_dwrite_str (f, L"uaescsimode", scsimode[p->win32_uaescsimode]); - cfgfile_target_dwrite_str (f, L"statusbar", statusbarmode[p->win32_statusbar]); - cfgfile_target_write (f, L"soundcard", L"%d", p->win32_soundcard); + cfgfile_target_dwrite (f, _T("rtg_vblank"), _T("%d"), p->win32_rtgvblankrate); + cfgfile_target_dwrite_bool (f, _T("borderless"), p->win32_borderless); + cfgfile_target_dwrite_str (f, _T("uaescsimode"), scsimode[p->win32_uaescsimode]); + cfgfile_target_dwrite_str (f, _T("statusbar"), statusbarmode[p->win32_statusbar]); + cfgfile_target_write (f, _T("soundcard"), _T("%d"), p->win32_soundcard); if (p->win32_soundcard >= 0 && p->win32_soundcard < MAX_SOUND_DEVICES && sound_devices[p->win32_soundcard]) - cfgfile_target_write_str (f, L"soundcardname", sound_devices[p->win32_soundcard]->cfgname); + cfgfile_target_write_str (f, _T("soundcardname"), sound_devices[p->win32_soundcard]->cfgname); if (p->win32_samplersoundcard >= 0 && p->win32_samplersoundcard < MAX_SOUND_DEVICES) { - cfgfile_target_write (f, L"samplersoundcard", L"%d", p->win32_samplersoundcard); + cfgfile_target_write (f, _T("samplersoundcard"), _T("%d"), p->win32_samplersoundcard); if (record_devices[p->win32_samplersoundcard]) - cfgfile_target_write_str (f, L"samplersoundcardname", record_devices[p->win32_samplersoundcard]->cfgname); + cfgfile_target_write_str (f, _T("samplersoundcardname"), record_devices[p->win32_samplersoundcard]->cfgname); } - cfgfile_target_dwrite (f, L"cpu_idle", L"%d", p->cpu_idle); - cfgfile_target_dwrite_bool (f, L"notaskbarbutton", p->win32_notaskbarbutton); - cfgfile_target_dwrite_bool (f, L"always_on_top", p->win32_alwaysontop); - cfgfile_target_dwrite_bool (f, L"no_recyclebin", p->win32_norecyclebin); + cfgfile_target_dwrite (f, _T("cpu_idle"), _T("%d"), p->cpu_idle); + cfgfile_target_dwrite_bool (f, _T("notaskbarbutton"), p->win32_notaskbarbutton); + cfgfile_target_dwrite_bool (f, _T("always_on_top"), p->win32_alwaysontop); + cfgfile_target_dwrite_bool (f, _T("no_recyclebin"), p->win32_norecyclebin); if (p->win32_guikey >= 0) - cfgfile_target_dwrite (f, L"guikey", L"0x%x", p->win32_guikey); - cfgfile_target_dwrite (f, L"kbledmode", L"%d", p->win32_kbledmode); - cfgfile_target_dwrite_bool (f, L"powersavedisabled", p->win32_powersavedisabled); - cfgfile_target_dwrite_str (f, L"exec_before", p->win32_commandpathstart); - cfgfile_target_dwrite_str (f, L"exec_after", p->win32_commandpathend); - cfgfile_target_dwrite_str (f, L"parjoyport0", p->win32_parjoyport0); - cfgfile_target_dwrite_str (f, L"parjoyport1", p->win32_parjoyport1); - cfgfile_target_dwrite_str (f, L"gui_page", p->win32_guipage); + cfgfile_target_dwrite (f, _T("guikey"), _T("0x%x"), p->win32_guikey); + cfgfile_target_dwrite (f, _T("kbledmode"), _T("%d"), p->win32_kbledmode); + cfgfile_target_dwrite_bool (f, _T("powersavedisabled"), p->win32_powersavedisabled); + cfgfile_target_dwrite_str (f, _T("exec_before"), p->win32_commandpathstart); + cfgfile_target_dwrite_str (f, _T("exec_after"), p->win32_commandpathend); + cfgfile_target_dwrite_str (f, _T("parjoyport0"), p->win32_parjoyport0); + cfgfile_target_dwrite_str (f, _T("parjoyport1"), p->win32_parjoyport1); + cfgfile_target_dwrite_str (f, _T("gui_page"), p->win32_guipage); } static int fetchpri (int pri, int defpri) @@ -2998,11 +2998,11 @@ TCHAR *target_expand_environment (const TCHAR *path) } static const TCHAR *obsolete[] = { - L"killwinkeys", L"sound_force_primary", L"iconified_highpriority", - L"sound_sync", L"sound_tweak", L"directx6", L"sound_style", - L"file_path", L"iconified_nospeed", L"activepriority", L"magic_mouse", - L"filesystem_codepage", L"aspi", L"no_overlay", L"soundcard_exclusive", - L"specialkey", L"sound_speed_tweak", L"sound_lag", + _T("killwinkeys"), _T("sound_force_primary"), _T("iconified_highpriority"), + _T("sound_sync"), _T("sound_tweak"), _T("directx6"), _T("sound_style"), + _T("file_path"), _T("iconified_nospeed"), _T("activepriority"), _T("magic_mouse"), + _T("filesystem_codepage"), _T("aspi"), _T("no_overlay"), _T("soundcard_exclusive"), + _T("specialkey"), _T("sound_speed_tweak"), _T("sound_lag"), 0 }; @@ -3011,53 +3011,53 @@ int target_parse_option (struct uae_prefs *p, const TCHAR *option, const TCHAR * TCHAR tmpbuf[CONFIG_BLEN]; int i, v; - int result = (cfgfile_yesno (option, value, L"middle_mouse", &p->win32_middle_mouse) - || cfgfile_yesno (option, value, L"map_drives", &p->win32_automount_drives) - || cfgfile_yesno (option, value, L"map_drives_auto", &p->win32_automount_removable) - || cfgfile_yesno (option, value, L"map_cd_drives", &p->win32_automount_cddrives) - || cfgfile_yesno (option, value, L"map_net_drives", &p->win32_automount_netdrives) - || cfgfile_yesno (option, value, L"map_removable_drives", &p->win32_automount_removabledrives) - || cfgfile_yesno (option, value, L"logfile", &p->win32_logfile) - || cfgfile_yesno (option, value, L"networking", &p->socket_emu) - || cfgfile_yesno (option, value, L"borderless", &p->win32_borderless) - || cfgfile_yesno (option, value, L"active_not_captured_pause", &p->win32_active_nocapture_pause) - || cfgfile_yesno (option, value, L"active_not_captured_nosound", &p->win32_active_nocapture_nosound) - || cfgfile_yesno (option, value, L"inactive_pause", &p->win32_inactive_pause) - || cfgfile_yesno (option, value, L"inactive_nosound", &p->win32_inactive_nosound) - || cfgfile_yesno (option, value, L"iconified_pause", &p->win32_iconified_pause) - || cfgfile_yesno (option, value, L"iconified_nosound", &p->win32_iconified_nosound) - || cfgfile_yesno (option, value, L"ctrl_f11_is_quit", &p->win32_ctrl_F11_is_quit) - || cfgfile_yesno (option, value, L"no_recyclebin", &p->win32_norecyclebin) - || cfgfile_intval (option, value, L"midi_device", &p->win32_midioutdev, 1) - || cfgfile_intval (option, value, L"midiout_device", &p->win32_midioutdev, 1) - || cfgfile_intval (option, value, L"midiin_device", &p->win32_midiindev, 1) - || cfgfile_intval (option, value, L"samplersoundcard", &p->win32_samplersoundcard, 1) - || cfgfile_yesno (option, value, L"notaskbarbutton", &p->win32_notaskbarbutton) - || cfgfile_yesno (option, value, L"always_on_top", &p->win32_alwaysontop) - || cfgfile_yesno (option, value, L"powersavedisabled", &p->win32_powersavedisabled) - || cfgfile_string (option, value, L"exec_before", p->win32_commandpathstart, sizeof p->win32_commandpathstart / sizeof (TCHAR)) - || cfgfile_string (option, value, L"exec_after", p->win32_commandpathend, sizeof p->win32_commandpathend / sizeof (TCHAR)) - || cfgfile_string (option, value, L"parjoyport0", p->win32_parjoyport0, sizeof p->win32_parjoyport0 / sizeof (TCHAR)) - || cfgfile_string (option, value, L"parjoyport1", p->win32_parjoyport1, sizeof p->win32_parjoyport1 / sizeof (TCHAR)) - || cfgfile_string (option, value, L"gui_page", p->win32_guipage, sizeof p->win32_guipage / sizeof (TCHAR)) - || cfgfile_intval (option, value, L"guikey", &p->win32_guikey, 1) - || cfgfile_intval (option, value, L"kbledmode", &p->win32_kbledmode, 1) - || cfgfile_intval (option, value, L"cpu_idle", &p->cpu_idle, 1)); - - if (cfgfile_yesno (option, value, L"rtg_match_depth", &p->win32_rtgmatchdepth)) + int result = (cfgfile_yesno (option, value, _T("middle_mouse"), &p->win32_middle_mouse) + || cfgfile_yesno (option, value, _T("map_drives"), &p->win32_automount_drives) + || cfgfile_yesno (option, value, _T("map_drives_auto"), &p->win32_automount_removable) + || cfgfile_yesno (option, value, _T("map_cd_drives"), &p->win32_automount_cddrives) + || cfgfile_yesno (option, value, _T("map_net_drives"), &p->win32_automount_netdrives) + || cfgfile_yesno (option, value, _T("map_removable_drives"), &p->win32_automount_removabledrives) + || cfgfile_yesno (option, value, _T("logfile"), &p->win32_logfile) + || cfgfile_yesno (option, value, _T("networking"), &p->socket_emu) + || cfgfile_yesno (option, value, _T("borderless"), &p->win32_borderless) + || cfgfile_yesno (option, value, _T("active_not_captured_pause"), &p->win32_active_nocapture_pause) + || cfgfile_yesno (option, value, _T("active_not_captured_nosound"), &p->win32_active_nocapture_nosound) + || cfgfile_yesno (option, value, _T("inactive_pause"), &p->win32_inactive_pause) + || cfgfile_yesno (option, value, _T("inactive_nosound"), &p->win32_inactive_nosound) + || cfgfile_yesno (option, value, _T("iconified_pause"), &p->win32_iconified_pause) + || cfgfile_yesno (option, value, _T("iconified_nosound"), &p->win32_iconified_nosound) + || cfgfile_yesno (option, value, _T("ctrl_f11_is_quit"), &p->win32_ctrl_F11_is_quit) + || cfgfile_yesno (option, value, _T("no_recyclebin"), &p->win32_norecyclebin) + || cfgfile_intval (option, value, _T("midi_device"), &p->win32_midioutdev, 1) + || cfgfile_intval (option, value, _T("midiout_device"), &p->win32_midioutdev, 1) + || cfgfile_intval (option, value, _T("midiin_device"), &p->win32_midiindev, 1) + || cfgfile_intval (option, value, _T("samplersoundcard"), &p->win32_samplersoundcard, 1) + || cfgfile_yesno (option, value, _T("notaskbarbutton"), &p->win32_notaskbarbutton) + || cfgfile_yesno (option, value, _T("always_on_top"), &p->win32_alwaysontop) + || cfgfile_yesno (option, value, _T("powersavedisabled"), &p->win32_powersavedisabled) + || cfgfile_string (option, value, _T("exec_before"), p->win32_commandpathstart, sizeof p->win32_commandpathstart / sizeof (TCHAR)) + || cfgfile_string (option, value, _T("exec_after"), p->win32_commandpathend, sizeof p->win32_commandpathend / sizeof (TCHAR)) + || cfgfile_string (option, value, _T("parjoyport0"), p->win32_parjoyport0, sizeof p->win32_parjoyport0 / sizeof (TCHAR)) + || cfgfile_string (option, value, _T("parjoyport1"), p->win32_parjoyport1, sizeof p->win32_parjoyport1 / sizeof (TCHAR)) + || cfgfile_string (option, value, _T("gui_page"), p->win32_guipage, sizeof p->win32_guipage / sizeof (TCHAR)) + || cfgfile_intval (option, value, _T("guikey"), &p->win32_guikey, 1) + || cfgfile_intval (option, value, _T("kbledmode"), &p->win32_kbledmode, 1) + || cfgfile_intval (option, value, _T("cpu_idle"), &p->cpu_idle, 1)); + + if (cfgfile_yesno (option, value, _T("rtg_match_depth"), &p->win32_rtgmatchdepth)) return 1; - if (cfgfile_yesno (option, value, L"rtg_scale_small", &p->win32_rtgscaleifsmall)) + if (cfgfile_yesno (option, value, _T("rtg_scale_small"), &p->win32_rtgscaleifsmall)) return 1; - if (cfgfile_yesno (option, value, L"rtg_scale_allow", &p->win32_rtgallowscaling)) + if (cfgfile_yesno (option, value, _T("rtg_scale_allow"), &p->win32_rtgallowscaling)) return 1; - if (cfgfile_intval (option, value, L"soundcard", &p->win32_soundcard, 1)) { + if (cfgfile_intval (option, value, _T("soundcard"), &p->win32_soundcard, 1)) { if (p->win32_soundcard < 0 || p->win32_soundcard >= MAX_SOUND_DEVICES || sound_devices[p->win32_soundcard] == NULL) p->win32_soundcard = 0; return 1; } - if (cfgfile_string (option, value, L"soundcardname", tmpbuf, sizeof tmpbuf / sizeof (TCHAR))) { + if (cfgfile_string (option, value, _T("soundcardname"), tmpbuf, sizeof tmpbuf / sizeof (TCHAR))) { int i, num; num = p->win32_soundcard; @@ -3082,7 +3082,7 @@ int target_parse_option (struct uae_prefs *p, const TCHAR *option, const TCHAR * p->win32_soundcard = num; return 1; } - if (cfgfile_string (option, value, L"samplersoundcardname", tmpbuf, sizeof tmpbuf / sizeof (TCHAR))) { + if (cfgfile_string (option, value, _T("samplersoundcardname"), tmpbuf, sizeof tmpbuf / sizeof (TCHAR))) { int i, num; num = p->win32_samplersoundcard; @@ -3106,16 +3106,16 @@ int target_parse_option (struct uae_prefs *p, const TCHAR *option, const TCHAR * return 1; } - if (cfgfile_string (option, value, L"rtg_vblank", tmpbuf, sizeof tmpbuf / sizeof (TCHAR))) { - if (!_tcscmp (tmpbuf, L"real")) { + if (cfgfile_string (option, value, _T("rtg_vblank"), tmpbuf, sizeof tmpbuf / sizeof (TCHAR))) { + if (!_tcscmp (tmpbuf, _T("real"))) { p->win32_rtgvblankrate = -1; return 1; } - if (!_tcscmp (tmpbuf, L"disabled")) { + if (!_tcscmp (tmpbuf, _T("disabled"))) { p->win32_rtgvblankrate = -2; return 1; } - if (!_tcscmp (tmpbuf, L"chipset")) { + if (!_tcscmp (tmpbuf, _T("chipset"))) { p->win32_rtgvblankrate = 0; return 1; } @@ -3123,7 +3123,7 @@ int target_parse_option (struct uae_prefs *p, const TCHAR *option, const TCHAR * return 1; } - if (cfgfile_string (option, value, L"rtg_scale_aspect_ratio", tmpbuf, sizeof tmpbuf / sizeof (TCHAR))) { + if (cfgfile_string (option, value, _T("rtg_scale_aspect_ratio"), tmpbuf, sizeof tmpbuf / sizeof (TCHAR))) { int v1, v2; TCHAR *s; @@ -3142,41 +3142,41 @@ int target_parse_option (struct uae_prefs *p, const TCHAR *option, const TCHAR * return 1; } - if (cfgfile_strval (option, value, L"uaescsimode", &p->win32_uaescsimode, scsimode, 0)) { + if (cfgfile_strval (option, value, _T("uaescsimode"), &p->win32_uaescsimode, scsimode, 0)) { // force SCSIEMU if pre 2.3 configuration if (p->config_version < ((2 << 16) | (3 << 8))) p->win32_uaescsimode = UAESCSI_CDEMU; return 1; } - if (cfgfile_strval (option, value, L"statusbar", &p->win32_statusbar, statusbarmode, 0)) + if (cfgfile_strval (option, value, _T("statusbar"), &p->win32_statusbar, statusbarmode, 0)) return 1; - if (cfgfile_intval (option, value, L"active_priority", &v, 1) || cfgfile_intval (option, value, L"activepriority", &v, 1)) { + if (cfgfile_intval (option, value, _T("active_priority"), &v, 1) || cfgfile_intval (option, value, _T("activepriority"), &v, 1)) { p->win32_active_capture_priority = fetchpri (v, 1); p->win32_active_nocapture_pause = false; p->win32_active_nocapture_nosound = false; return 1; } #if 0 - if (cfgfile_intval (option, value, L"active_not_captured_priority", &v, 1)) { + if (cfgfile_intval (option, value, _T("active_not_captured_priority"), &v, 1)) { p->win32_active_nocapture_priority = fetchpri (v, 1); return 1; } #endif - if (cfgfile_intval (option, value, L"inactive_priority", &v, 1)) { + if (cfgfile_intval (option, value, _T("inactive_priority"), &v, 1)) { p->win32_inactive_priority = fetchpri (v, 1); return 1; } - if (cfgfile_intval (option, value, L"iconified_priority", &v, 1)) { + if (cfgfile_intval (option, value, _T("iconified_priority"), &v, 1)) { p->win32_iconified_priority = fetchpri (v, 2); return 1; } - if (cfgfile_yesno (option, value, L"inactive_iconify", &p->win32_minimize_inactive)) + if (cfgfile_yesno (option, value, _T("inactive_iconify"), &p->win32_minimize_inactive)) return 1; - if (cfgfile_string (option, value, L"serial_port", &p->sername[0], 256)) { + if (cfgfile_string (option, value, _T("serial_port"), &p->sername[0], 256)) { sernametodev (p->sername); if (p->sername[0]) p->use_serial = 1; @@ -3185,10 +3185,10 @@ int target_parse_option (struct uae_prefs *p, const TCHAR *option, const TCHAR * return 1; } - if (cfgfile_string (option, value, L"parallel_port", &p->prtname[0], 256)) { - if (!_tcscmp (p->prtname, L"none")) + if (cfgfile_string (option, value, _T("parallel_port"), &p->prtname[0], 256)) { + if (!_tcscmp (p->prtname, _T("none"))) p->prtname[0] = 0; - if (!_tcscmp (p->prtname, L"default")) { + if (!_tcscmp (p->prtname, _T("default"))) { p->prtname[0] = 0; DWORD size = 256; GetDefaultPrinter (p->prtname, &size); @@ -3196,9 +3196,9 @@ int target_parse_option (struct uae_prefs *p, const TCHAR *option, const TCHAR * return 1; } - if (cfgfile_string (option, value, L"midiout_device_name", tmpbuf, 256)) { + if (cfgfile_string (option, value, _T("midiout_device_name"), tmpbuf, 256)) { p->win32_midioutdev = -2; - if (!_tcsicmp (tmpbuf, L"default") || (midioutportinfo[0] && !_tcsicmp (tmpbuf, midioutportinfo[0]->name))) + if (!_tcsicmp (tmpbuf, _T("default")) || (midioutportinfo[0] && !_tcsicmp (tmpbuf, midioutportinfo[0]->name))) p->win32_midioutdev = -1; for (int i = 0; i < MAX_MIDI_PORTS && midioutportinfo[i]; i++) { if (!_tcsicmp (midioutportinfo[i]->name, tmpbuf)) { @@ -3207,7 +3207,7 @@ int target_parse_option (struct uae_prefs *p, const TCHAR *option, const TCHAR * } return 1; } - if (cfgfile_string (option, value, L"midiin_device_name", tmpbuf, 256)) { + if (cfgfile_string (option, value, _T("midiin_device_name"), tmpbuf, 256)) { p->win32_midiindev = -1; for (int i = 0; i < MAX_MIDI_PORTS && midiinportinfo[i]; i++) { if (!_tcsicmp (midiinportinfo[i]->name, tmpbuf)) { @@ -3221,7 +3221,7 @@ int target_parse_option (struct uae_prefs *p, const TCHAR *option, const TCHAR * i = 0; while (obsolete[i]) { if (!strcasecmp (obsolete[i], option)) { - write_log (L"obsolete config entry '%s'\n", option); + write_log (_T("obsolete config entry '%s'\n"), option); return 1; } i++; @@ -3237,32 +3237,32 @@ static void createdir (const TCHAR *path) void fetch_saveimagepath (TCHAR *out, int size, int dir) { - fetch_path (L"SaveimagePath", out, size); + fetch_path (_T("SaveimagePath"), out, size); if (dir) { out[_tcslen (out) - 1] = 0; createdir (out); - fetch_path (L"SaveimagePath", out, size); + fetch_path (_T("SaveimagePath"), out, size); } } void fetch_configurationpath (TCHAR *out, int size) { - fetch_path (L"ConfigurationPath", out, size); + fetch_path (_T("ConfigurationPath"), out, size); } void fetch_screenshotpath (TCHAR *out, int size) { - fetch_path (L"ScreenshotPath", out, size); + fetch_path (_T("ScreenshotPath"), out, size); } void fetch_ripperpath (TCHAR *out, int size) { - fetch_path (L"RipperPath", out, size); + fetch_path (_T("RipperPath"), out, size); } void fetch_statefilepath (TCHAR *out, int size) { - fetch_path (L"StatefilePath", out, size); + fetch_path (_T("StatefilePath"), out, size); } void fetch_inputfilepath (TCHAR *out, int size) { - fetch_path (L"InputPath", out, size); + fetch_path (_T("InputPath"), out, size); } void fetch_datapath (TCHAR *out, int size) { @@ -3281,7 +3281,7 @@ static int isfilesindir (const TCHAR *p) if (v == INVALID_FILE_ATTRIBUTES || !(v & FILE_ATTRIBUTE_DIRECTORY)) return 0; _tcscpy (path, p); - _tcscat (path, L"\\*.*"); + _tcscat (path, _T("\\*.*")); h = FindFirstFile (path, &fd); if (h != INVALID_HANDLE_VALUE) { for (i = 0; i < 3; i++) { @@ -3304,20 +3304,20 @@ void fetch_path (const TCHAR *name, TCHAR *out, int size) fullpath (out, size); return; } - if (!_tcscmp (name, L"FloppyPath")) - _tcscat (out, L"..\\shared\\adf\\"); - if (!_tcscmp (name, L"CDPath")) - _tcscat (out, L"..\\shared\\cd\\"); - if (!_tcscmp (name, L"hdfPath")) - _tcscat (out, L"..\\shared\\hdf\\"); - if (!_tcscmp (name, L"KickstartPath")) - _tcscat (out, L"..\\shared\\rom\\"); - if (!_tcscmp (name, L"ConfigurationPath")) - _tcscat (out, L"Configurations\\"); - if (!_tcscmp (name, L"StatefilePath")) - _tcscat (out, L"Savestates\\"); - if (!_tcscmp (name, L"InputPath")) - _tcscat (out, L"Inputrecordings\\"); + if (!_tcscmp (name, _T("FloppyPath"))) + _tcscat (out, _T("..\\shared\\adf\\")); + if (!_tcscmp (name, _T("CDPath"))) + _tcscat (out, _T("..\\shared\\cd\\")); + if (!_tcscmp (name, _T("hdfPath"))) + _tcscat (out, _T("..\\shared\\hdf\\")); + if (!_tcscmp (name, _T("KickstartPath"))) + _tcscat (out, _T("..\\shared\\rom\\")); + if (!_tcscmp (name, _T("ConfigurationPath"))) + _tcscat (out, _T("Configurations\\")); + if (!_tcscmp (name, _T("StatefilePath"))) + _tcscat (out, _T("Savestates\\")); + if (!_tcscmp (name, _T("InputPath"))) + _tcscat (out, _T("Inputrecordings\\")); if (start_data >= 0) regquerystr (NULL, name, out, &size); if (GetFileAttributes (out) == INVALID_FILE_ATTRIBUTES) @@ -3332,7 +3332,7 @@ void fetch_path (const TCHAR *name, TCHAR *out, int size) } #endif stripslashes (out); - if (!_tcscmp (name, L"KickstartPath")) { + if (!_tcscmp (name, _T("KickstartPath"))) { DWORD v = GetFileAttributes (out); if (v == INVALID_FILE_ATTRIBUTES || !(v & FILE_ATTRIBUTE_DIRECTORY)) _tcscpy (out, start_path_data); @@ -3351,18 +3351,18 @@ int get_rom_path (TCHAR *out, pathtype mode) case PATH_TYPE_DEFAULT: { if (!_tcscmp (start_path_data, start_path_exe)) - _tcscpy (tmp, L".\\"); + _tcscpy (tmp, _T(".\\")); else _tcscpy (tmp, start_path_data); if (GetFileAttributes (tmp) != INVALID_FILE_ATTRIBUTES) { TCHAR tmp2[MAX_DPATH]; _tcscpy (tmp2, tmp); - _tcscat (tmp2, L"rom"); + _tcscat (tmp2, _T("rom")); if (GetFileAttributes (tmp2) != INVALID_FILE_ATTRIBUTES) { _tcscpy (tmp, tmp2); } else { _tcscpy (tmp2, tmp); - _tcscpy (tmp2, L"roms"); + _tcscpy (tmp2, _T("roms")); if (GetFileAttributes (tmp2) != INVALID_FILE_ATTRIBUTES) { _tcscpy (tmp, tmp2); } else { @@ -3380,13 +3380,13 @@ int get_rom_path (TCHAR *out, pathtype mode) { TCHAR tmp2[MAX_DPATH]; _tcscpy (tmp2, start_path_new1); - _tcscat (tmp2, L"..\\system\\rom"); + _tcscat (tmp2, _T("..\\system\\rom")); if (isfilesindir (tmp2)) { _tcscpy (tmp, tmp2); break; } _tcscpy (tmp2, start_path_new1); - _tcscat (tmp2, L"..\\shared\\rom"); + _tcscat (tmp2, _T("..\\shared\\rom")); if (isfilesindir (tmp2)) { _tcscpy (tmp, tmp2); break; @@ -3397,13 +3397,13 @@ int get_rom_path (TCHAR *out, pathtype mode) { TCHAR tmp2[MAX_DPATH]; _tcscpy (tmp2, start_path_new2); - _tcscat (tmp2, L"system\\rom"); + _tcscat (tmp2, _T("system\\rom")); if (isfilesindir (tmp2)) { _tcscpy (tmp, tmp2); break; } _tcscpy (tmp2, start_path_new2); - _tcscat (tmp2, L"shared\\rom"); + _tcscat (tmp2, _T("shared\\rom")); if (isfilesindir (tmp2)) { _tcscpy (tmp, tmp2); break; @@ -3429,26 +3429,26 @@ void set_path (const TCHAR *name, TCHAR *path, pathtype mode) if (!path) { if (!_tcscmp (start_path_data, start_path_exe)) - _tcscpy (tmp, L".\\"); + _tcscpy (tmp, _T(".\\")); else _tcscpy (tmp, start_path_data); - if (!_tcscmp (name, L"KickstartPath")) - _tcscat (tmp, L"Roms"); - if (!_tcscmp (name, L"ConfigurationPath")) - _tcscat (tmp, L"Configurations"); - if (!_tcscmp (name, L"ScreenshotPath")) - _tcscat (tmp, L"Screenshots"); - if (!_tcscmp (name, L"StatefilePath")) - _tcscat (tmp, L"Savestates"); - if (!_tcscmp (name, L"SaveimagePath")) - _tcscat (tmp, L"SaveImages"); - if (!_tcscmp (name, L"InputPath")) - _tcscat (tmp, L"Inputrecordings"); + if (!_tcscmp (name, _T("KickstartPath"))) + _tcscat (tmp, _T("Roms")); + if (!_tcscmp (name, _T("ConfigurationPath"))) + _tcscat (tmp, _T("Configurations")); + if (!_tcscmp (name, _T("ScreenshotPath"))) + _tcscat (tmp, _T("Screenshots")); + if (!_tcscmp (name, _T("StatefilePath"))) + _tcscat (tmp, _T("Savestates")); + if (!_tcscmp (name, _T("SaveimagePath"))) + _tcscat (tmp, _T("SaveImages")); + if (!_tcscmp (name, _T("InputPath"))) + _tcscat (tmp, _T("Inputrecordings")); } else { _tcscpy (tmp, path); } stripslashes (tmp); - if (!_tcscmp (name, L"KickstartPath")) { + if (!_tcscmp (name, _T("KickstartPath"))) { DWORD v = GetFileAttributes (tmp); if (v == INVALID_FILE_ATTRIBUTES || !(v & FILE_ATTRIBUTE_DIRECTORY)) get_rom_path (tmp, PATH_TYPE_DEFAULT); @@ -3503,8 +3503,8 @@ void read_rom_list (void) int size, size2, exists; romlist_clear (); - exists = regexiststree (NULL, L"DetectedROMs"); - fkey = regcreatetree (NULL, L"DetectedROMs"); + exists = regexiststree (NULL, _T("DetectedROMs")); + fkey = regcreatetree (NULL, _T("DetectedROMs")); if (fkey == NULL) return; if (!exists || forceroms) { @@ -3572,7 +3572,7 @@ static int checkversion (TCHAR *vs) int ver; if (_tcslen (vs) < 10) return 0; - if (_tcsncmp (vs, L"WinUAE ", 7)) + if (_tcsncmp (vs, _T("WinUAE "), 7)) return 0; vs += 7; ver = parseversion (&vs) << 16; @@ -3586,8 +3586,8 @@ static int checkversion (TCHAR *vs) static int shell_deassociate (const TCHAR *extension) { HKEY rkey; - const TCHAR *progid = L"WinUAE"; - int def = !_tcscmp (extension, L".uae"); + const TCHAR *progid = _T("WinUAE"); + int def = !_tcscmp (extension, _T(".uae")); TCHAR rpath1[MAX_DPATH], rpath2[MAX_DPATH], progid2[MAX_DPATH]; UAEREG *fkey; @@ -3600,7 +3600,7 @@ static int shell_deassociate (const TCHAR *extension) else rkey = HKEY_CURRENT_USER; - _tcscpy (rpath1, L"Software\\Classes\\"); + _tcscpy (rpath1, _T("Software\\Classes\\")); _tcscpy (rpath2, rpath1); _tcscat (rpath2, extension); RegDeleteKey (rkey, rpath2); @@ -3609,7 +3609,7 @@ static int shell_deassociate (const TCHAR *extension) if (!def) _tcscat (rpath2, extension); SHDeleteKey (rkey, rpath2); - fkey = regcreatetree (NULL, L"FileAssociations"); + fkey = regcreatetree (NULL, _T("FileAssociations")); regdelete (fkey, extension); regclosetree (fkey); return 1; @@ -3621,8 +3621,8 @@ static int shell_associate_2 (const TCHAR *extension, TCHAR *shellcommand, TCHAR TCHAR rpath1[MAX_DPATH], rpath2[MAX_DPATH], progid2[MAX_DPATH]; HKEY rkey, key1, key2; DWORD disposition; - const TCHAR *progid = L"WinUAE"; - int def = !_tcscmp (extension, L".uae"); + const TCHAR *progid = _T("WinUAE"); + int def = !_tcscmp (extension, _T(".uae")); const TCHAR *defprogid; UAEREG *fkey; @@ -3637,14 +3637,14 @@ static int shell_associate_2 (const TCHAR *extension, TCHAR *shellcommand, TCHAR rkey = HKEY_CURRENT_USER; defprogid = def ? progid : progid2; - _tcscpy (rpath1, L"Software\\Classes\\"); + _tcscpy (rpath1, _T("Software\\Classes\\")); _tcscpy (rpath2, rpath1); _tcscat (rpath2, extension); if (RegCreateKeyEx (rkey, rpath2, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE | KEY_READ, NULL, &key1, &disposition) == ERROR_SUCCESS) { - RegSetValueEx (key1, L"", 0, REG_SZ, (CONST BYTE *)defprogid, (_tcslen (defprogid) + 1) * sizeof (TCHAR)); + RegSetValueEx (key1, _T(""), 0, REG_SZ, (CONST BYTE *)defprogid, (_tcslen (defprogid) + 1) * sizeof (TCHAR)); if (perceivedtype) - RegSetValueEx (key1, L"PerceivedType", 0, REG_SZ, (CONST BYTE *)perceivedtype, (_tcslen (perceivedtype) + 1) * sizeof (TCHAR)); + RegSetValueEx (key1, _T("PerceivedType"), 0, REG_SZ, (CONST BYTE *)perceivedtype, (_tcslen (perceivedtype) + 1) * sizeof (TCHAR)); RegCloseKey (key1); } _tcscpy (rpath2, rpath1); @@ -3654,20 +3654,20 @@ static int shell_associate_2 (const TCHAR *extension, TCHAR *shellcommand, TCHAR if (description) { if (RegCreateKeyEx (rkey, rpath2, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE | KEY_READ, NULL, &key1, &disposition) == ERROR_SUCCESS) { TCHAR tmp[MAX_DPATH]; - RegSetValueEx (key1, L"", 0, REG_SZ, (CONST BYTE *)description, (_tcslen (description) + 1) * sizeof (TCHAR)); - RegSetValueEx (key1, L"AppUserModelID", 0, REG_SZ, (CONST BYTE *)WINUAEAPPNAME, (_tcslen (WINUAEAPPNAME) + 1) * sizeof (TCHAR)); + RegSetValueEx (key1, _T(""), 0, REG_SZ, (CONST BYTE *)description, (_tcslen (description) + 1) * sizeof (TCHAR)); + RegSetValueEx (key1, _T("AppUserModelID"), 0, REG_SZ, (CONST BYTE *)WINUAEAPPNAME, (_tcslen (WINUAEAPPNAME) + 1) * sizeof (TCHAR)); _tcscpy (tmp, rpath2); - _tcscat (tmp, L"\\CurVer"); + _tcscat (tmp, _T("\\CurVer")); if (RegCreateKeyEx (rkey, tmp, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE | KEY_READ, NULL, &key2, &disposition) == ERROR_SUCCESS) { - RegSetValueEx (key2, L"", 0, REG_SZ, (CONST BYTE *)defprogid, (_tcslen (defprogid) + 1) * sizeof (TCHAR)); + RegSetValueEx (key2, _T(""), 0, REG_SZ, (CONST BYTE *)defprogid, (_tcslen (defprogid) + 1) * sizeof (TCHAR)); RegCloseKey (key2); } if (icon) { _tcscpy (tmp, rpath2); - _tcscat (tmp, L"\\DefaultIcon"); + _tcscat (tmp, _T("\\DefaultIcon")); if (RegCreateKeyEx (rkey, tmp, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE | KEY_READ, NULL, &key2, &disposition) == ERROR_SUCCESS) { - _stprintf (tmp, L"%s,%d", _wpgmptr, -icon); - RegSetValueEx (key2, L"", 0, REG_SZ, (CONST BYTE *)tmp, (_tcslen (tmp) + 1) * sizeof (TCHAR)); + _stprintf (tmp, _T("%s,%d"), _wpgmptr, -icon); + RegSetValueEx (key2, _T(""), 0, REG_SZ, (CONST BYTE *)tmp, (_tcslen (tmp) + 1) * sizeof (TCHAR)); RegCloseKey (key2); } } @@ -3687,40 +3687,40 @@ static int shell_associate_2 (const TCHAR *extension, TCHAR *shellcommand, TCHAR TCHAR path2[MAX_DPATH]; for (int i = 0; cc[i].command; i++) { _tcscpy (path2, rpath2); - _tcscat (path2, L"\\shell\\"); + _tcscat (path2, _T("\\shell\\")); if (cc[i].shellcommand) _tcscat (path2, cc[i].shellcommand); else - _tcscat (path2, L"open"); + _tcscat (path2, _T("open")); if (cc[i].icon) { if (RegCreateKeyEx (rkey, path2, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE | KEY_READ, NULL, &key1, &disposition) == ERROR_SUCCESS) { TCHAR tmp[MAX_DPATH]; - _stprintf (tmp, L"%s,%d", _wpgmptr, -cc[i].icon); - RegSetValueEx (key1, L"Icon", 0, REG_SZ, (CONST BYTE *)tmp, (_tcslen (tmp) + 1) * sizeof (TCHAR)); + _stprintf (tmp, _T("%s,%d"), _wpgmptr, -cc[i].icon); + RegSetValueEx (key1, _T("Icon"), 0, REG_SZ, (CONST BYTE *)tmp, (_tcslen (tmp) + 1) * sizeof (TCHAR)); RegCloseKey (key1); } } - _tcscat (path2, L"\\command"); + _tcscat (path2, _T("\\command")); if (RegCreateKeyEx (rkey, path2, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE | KEY_READ, NULL, &key1, &disposition) == ERROR_SUCCESS) { TCHAR path[MAX_DPATH]; - _stprintf (path, L"\"%sWinUAE.exe\" %s", start_path_exe, cc[i].command); - RegSetValueEx (key1, L"", 0, REG_SZ, (CONST BYTE *)path, (_tcslen (path) + 1) * sizeof (TCHAR)); + _stprintf (path, _T("\"%sWinUAE.exe\" %s"), start_path_exe, cc[i].command); + RegSetValueEx (key1, _T(""), 0, REG_SZ, (CONST BYTE *)path, (_tcslen (path) + 1) * sizeof (TCHAR)); RegCloseKey (key1); } } } - fkey = regcreatetree (NULL, L"FileAssociations"); - regsetstr (fkey, extension, L""); + fkey = regcreatetree (NULL, _T("FileAssociations")); + regsetstr (fkey, extension, _T("")); regclosetree (fkey); return 1; } static int shell_associate (const TCHAR *extension, TCHAR *command, struct contextcommand *cc, const TCHAR *perceivedtype, const TCHAR *description, const TCHAR *ext2, int icon) { int v = shell_associate_2 (extension, NULL, command, cc, perceivedtype, description, ext2, icon); - if (!_tcscmp (extension, L".uae")) - shell_associate_2 (extension, L"edit", L"-f \"%1\" -s use_gui=yes", NULL, L"text", description, NULL, 0); + if (!_tcscmp (extension, _T(".uae"))) + shell_associate_2 (extension, _T("edit"), _T("-f \"%1\" -s use_gui=yes"), NULL, _T("text"), description, NULL, 0); return v; } @@ -3730,8 +3730,8 @@ static int shell_associate_is (const TCHAR *extension) TCHAR progid2[MAX_DPATH], tmp[MAX_DPATH]; DWORD size; HKEY rkey, key1; - const TCHAR *progid = L"WinUAE"; - int def = !_tcscmp (extension, L".uae"); + const TCHAR *progid = _T("WinUAE"); + int def = !_tcscmp (extension, _T(".uae")); _tcscpy (progid2, progid); _tcscat (progid2, extension); @@ -3740,7 +3740,7 @@ static int shell_associate_is (const TCHAR *extension) else rkey = HKEY_CURRENT_USER; - _tcscpy (rpath1, L"Software\\Classes\\"); + _tcscpy (rpath1, _T("Software\\Classes\\")); _tcscpy (rpath2, rpath1); _tcscat (rpath2, extension); size = sizeof tmp / sizeof (TCHAR); @@ -3764,26 +3764,26 @@ static int shell_associate_is (const TCHAR *extension) return 0; } static struct contextcommand cc_cd[] = { - { L"CDTV", L"-cdimage=\"%1\" -s use_gui=no -cfgparam=quickstart=CDTV,0", IDI_APPICON }, - { L"CD32", L"-cdimage=\"%1\" -s use_gui=no -cfgparam=quickstart=CD32,0", IDI_APPICON }, + { _T("CDTV"), _T("-cdimage=\"%1\" -s use_gui=no -cfgparam=quickstart=CDTV,0"), IDI_APPICON }, + { _T("CD32"), _T("-cdimage=\"%1\" -s use_gui=no -cfgparam=quickstart=CD32,0"), IDI_APPICON }, { NULL } }; static struct contextcommand cc_disk[] = { - { L"A500", L"-0 \"%1\" -s use_gui=no -cfgparam=quickstart=A500,0", IDI_DISKIMAGE }, - { L"A1200", L"-0 \"%1\" -s use_gui=no -cfgparam=quickstart=A1200,0", IDI_DISKIMAGE }, + { _T("A500"), _T("-0 \"%1\" -s use_gui=no -cfgparam=quickstart=A500,0"), IDI_DISKIMAGE }, + { _T("A1200"), _T("-0 \"%1\" -s use_gui=no -cfgparam=quickstart=A1200,0"), IDI_DISKIMAGE }, { NULL } }; struct assext exts[] = { -// { L".cue", L"-cdimage=\"%1\" -s use_gui=no", L"WinUAE CD image", IDI_DISKIMAGE, cc_cd }, -// { L".iso", L"-cdimage=\"%1\" -s use_gui=no", L"WinUAE CD image", IDI_DISKIMAGE, cc_cd }, -// { L".ccd", L"-cdimage=\"%1\" -s use_gui=no", L"WinUAE CD image", IDI_DISKIMAGE, cc_cd }, - { L".uae", L"-f \"%1\"", L"WinUAE configuration file", IDI_CONFIGFILE, NULL }, - { L".adf", L"-0 \"%1\" -s use_gui=no", L"WinUAE floppy disk image", IDI_DISKIMAGE, cc_disk }, - { L".adz", L"-0 \"%1\" -s use_gui=no", L"WinUAE floppy disk image", IDI_DISKIMAGE, cc_disk }, - { L".dms", L"-0 \"%1\" -s use_gui=no", L"WinUAE floppy disk image", IDI_DISKIMAGE, cc_disk }, - { L".fdi", L"-0 \"%1\" -s use_gui=no", L"WinUAE floppy disk image", IDI_DISKIMAGE, cc_disk }, - { L".ipf", L"-0 \"%1\" -s use_gui=no", L"WinUAE floppy disk image", IDI_DISKIMAGE, cc_disk }, - { L".uss", L"-s statefile=\"%1\" -s use_gui=no", L"WinUAE statefile", IDI_APPICON, NULL }, +// { _T(".cue"), _T("-cdimage=\"%1\" -s use_gui=no"), _T("WinUAE CD image"), IDI_DISKIMAGE, cc_cd }, +// { _T(".iso"), _T("-cdimage=\"%1\" -s use_gui=no"), _T("WinUAE CD image"), IDI_DISKIMAGE, cc_cd }, +// { _T(".ccd"), _T("-cdimage=\"%1\" -s use_gui=no"), _T("WinUAE CD image"), IDI_DISKIMAGE, cc_cd }, + { _T(".uae"), _T("-f \"%1\""), _T("WinUAE configuration file"), IDI_CONFIGFILE, NULL }, + { _T(".adf"), _T("-0 \"%1\" -s use_gui=no"), _T("WinUAE floppy disk image"), IDI_DISKIMAGE, cc_disk }, + { _T(".adz"), _T("-0 \"%1\" -s use_gui=no"), _T("WinUAE floppy disk image"), IDI_DISKIMAGE, cc_disk }, + { _T(".dms"), _T("-0 \"%1\" -s use_gui=no"), _T("WinUAE floppy disk image"), IDI_DISKIMAGE, cc_disk }, + { _T(".fdi"), _T("-0 \"%1\" -s use_gui=no"), _T("WinUAE floppy disk image"), IDI_DISKIMAGE, cc_disk }, + { _T(".ipf"), _T("-0 \"%1\" -s use_gui=no"), _T("WinUAE floppy disk image"), IDI_DISKIMAGE, cc_disk }, + { _T(".uss"), _T("-s statefile=\"%1\" -s use_gui=no"), _T("WinUAE statefile"), IDI_APPICON, NULL }, { NULL } }; @@ -3799,14 +3799,14 @@ static void associate_init_extensions (void) if (rp_param || inipath) return; // associate .uae by default when running for the first time - if (!regexiststree (NULL, L"FileAssociations")) { + if (!regexiststree (NULL, _T("FileAssociations"))) { UAEREG *fkey; if (exts[0].enabled == 0) { shell_associate (exts[0].ext, exts[0].cmd, exts[0].cc, NULL, exts[0].desc, NULL, exts[0].icon); exts[0].enabled = shell_associate_is (exts[0].ext); } - fkey = regcreatetree (NULL, L"FileAssociations"); - regsetstr (fkey, exts[0].ext, L""); + fkey = regcreatetree (NULL, _T("FileAssociations")); + regsetstr (fkey, exts[0].ext, _T("")); regclosetree (fkey); } if (os_winnt_admin > 1) { @@ -3816,7 +3816,7 @@ static void associate_init_extensions (void) HKEY key1; bool setit = true; - _tcscpy (rpath, L"Software\\Microsoft\\Windows\\CurrentVersion\\App Paths\\winuae.exe"); + _tcscpy (rpath, _T("Software\\Microsoft\\Windows\\CurrentVersion\\App Paths\\winuae.exe")); if (RegOpenKeyEx (rkey, rpath, 0, KEY_READ, &key1) == ERROR_SUCCESS) { TCHAR tmp[MAX_DPATH]; DWORD size = sizeof tmp / sizeof (TCHAR); @@ -3829,11 +3829,11 @@ static void associate_init_extensions (void) if (setit) { if (RegCreateKeyEx (rkey, rpath, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_READ | KEY_WRITE, NULL, &key1, &disposition) == ERROR_SUCCESS) { DWORD val = 1; - RegSetValueEx (key1, L"", 0, REG_SZ, (CONST BYTE *)_wpgmptr, (_tcslen (_wpgmptr) + 1) * sizeof (TCHAR)); - RegSetValueEx (key1, L"UseUrl", 0, REG_DWORD, (LPBYTE)&val, sizeof val); + RegSetValueEx (key1, _T(""), 0, REG_SZ, (CONST BYTE *)_wpgmptr, (_tcslen (_wpgmptr) + 1) * sizeof (TCHAR)); + RegSetValueEx (key1, _T("UseUrl"), 0, REG_DWORD, (LPBYTE)&val, sizeof val); _tcscpy (rpath, start_path_exe); rpath[_tcslen (rpath) - 1] = 0; - RegSetValueEx (key1, L"Path", 0, REG_SZ, (CONST BYTE *)rpath, (_tcslen (rpath) + 1) * sizeof (TCHAR)); + RegSetValueEx (key1, _T("Path"), 0, REG_SZ, (CONST BYTE *)rpath, (_tcslen (rpath) + 1) * sizeof (TCHAR)); RegCloseKey (key1); SHChangeNotify (SHCNE_ASSOCCHANGED, 0, 0, 0); } @@ -3842,11 +3842,11 @@ static void associate_init_extensions (void) #if 0 UAEREG *fkey; - fkey = regcreatetree (NULL, L"FileAssociations"); + fkey = regcreatetree (NULL, _T("FileAssociations")); if (fkey) { int ok = 1; TCHAR tmp[MAX_DPATH]; - _tcscpy (tmp, L"Following file associations:\n"); + _tcscpy (tmp, _T("Following file associations:\n")); for (i = 0; exts[i].ext; i++) { TCHAR tmp2[10]; int size = sizeof tmp; @@ -3854,7 +3854,7 @@ static void associate_init_extensions (void) int is2 = regquerystr (fkey, exts[i].ext, tmp2, &size); if (is1 == 0 && is2 != 0) { _tcscat (tmp, exts[i].ext); - _tcscat (tmp, L"\n"); + _tcscat (tmp, _T("\n")); ok = 0; } } @@ -3918,19 +3918,19 @@ static void WIN32_HandleRegistryStuff (void) DWORD dwType = REG_DWORD; DWORD dwDisplayInfoSize = sizeof (colortype); int size; - TCHAR path[MAX_DPATH] = L""; + TCHAR path[MAX_DPATH] = _T(""); TCHAR version[100]; - initpath (L"FloppyPath", start_path_data); - initpath (L"KickstartPath", start_path_data); - initpath (L"hdfPath", start_path_data); - initpath (L"ConfigurationPath", start_path_data); - initpath (L"ScreenshotPath", start_path_data); - initpath (L"StatefilePath", start_path_data); - initpath (L"SaveimagePath", start_path_data); - initpath (L"VideoPath", start_path_data); - initpath (L"InputPath", start_path_data); - if (!regexists (NULL, L"MainPosX") || !regexists (NULL, L"GUIPosX")) { + initpath (_T("FloppyPath"), start_path_data); + initpath (_T("KickstartPath"), start_path_data); + initpath (_T("hdfPath"), start_path_data); + initpath (_T("ConfigurationPath"), start_path_data); + initpath (_T("ScreenshotPath"), start_path_data); + initpath (_T("StatefilePath"), start_path_data); + initpath (_T("SaveimagePath"), start_path_data); + initpath (_T("VideoPath"), start_path_data); + initpath (_T("InputPath"), start_path_data); + if (!regexists (NULL, _T("MainPosX")) || !regexists (NULL, _T("GUIPosX"))) { int x = GetSystemMetrics (SM_CXSCREEN); int y = GetSystemMetrics (SM_CYSCREEN); x = (x - 800) / 2; @@ -3940,61 +3940,61 @@ static void WIN32_HandleRegistryStuff (void) if (y < 10) y = 10; /* Create and initialize all our sub-keys to the default values */ - regsetint (NULL, L"MainPosX", x); - regsetint (NULL, L"MainPosY", y); - regsetint (NULL, L"GUIPosX", x); - regsetint (NULL, L"GUIPosY", y); + regsetint (NULL, _T("MainPosX"), x); + regsetint (NULL, _T("MainPosY"), y); + regsetint (NULL, _T("GUIPosX"), x); + regsetint (NULL, _T("GUIPosY"), y); } size = sizeof (version) / sizeof (TCHAR); - if (regquerystr (NULL, L"Version", version, &size)) { + if (regquerystr (NULL, _T("Version"), version, &size)) { if (checkversion (version)) - regsetstr (NULL, L"Version", VersionStr); + regsetstr (NULL, _T("Version"), VersionStr); } else { - regsetstr (NULL, L"Version", VersionStr); + regsetstr (NULL, _T("Version"), VersionStr); } size = sizeof (version) / sizeof (TCHAR); - if (regquerystr (NULL, L"ROMCheckVersion", version, &size)) { + if (regquerystr (NULL, _T("ROMCheckVersion"), version, &size)) { if (checkversion (version)) { - if (regsetstr (NULL, L"ROMCheckVersion", VersionStr)) + if (regsetstr (NULL, _T("ROMCheckVersion"), VersionStr)) forceroms = 1; } } else { - if (regsetstr (NULL, L"ROMCheckVersion", VersionStr)) + if (regsetstr (NULL, _T("ROMCheckVersion"), VersionStr)) forceroms = 1; } - regqueryint (NULL, L"DirectDraw_Secondary", &ddforceram); - if (regexists (NULL, L"SoundDriverMask")) { - regqueryint (NULL, L"SoundDriverMask", &sounddrivermask); + regqueryint (NULL, _T("DirectDraw_Secondary"), &ddforceram); + if (regexists (NULL, _T("SoundDriverMask"))) { + regqueryint (NULL, _T("SoundDriverMask"), &sounddrivermask); } else { sounddrivermask = 3; - regsetint (NULL, L"SoundDriverMask", sounddrivermask); + regsetint (NULL, _T("SoundDriverMask"), sounddrivermask); } - if (regexists (NULL, L"ConfigurationCache")) - regqueryint (NULL, L"ConfigurationCache", &configurationcache); + if (regexists (NULL, _T("ConfigurationCache"))) + regqueryint (NULL, _T("ConfigurationCache"), &configurationcache); else - regsetint (NULL, L"ConfigurationCache", configurationcache); - if (regexists (NULL, L"RelativePaths")) - regqueryint (NULL, L"RelativePaths", &relativepaths); + regsetint (NULL, _T("ConfigurationCache"), configurationcache); + if (regexists (NULL, _T("RelativePaths"))) + regqueryint (NULL, _T("RelativePaths"), &relativepaths); else - regsetint (NULL, L"RelativePaths", relativepaths); - regqueryint (NULL, L"QuickStartMode", &quickstart); + regsetint (NULL, _T("RelativePaths"), relativepaths); + regqueryint (NULL, _T("QuickStartMode"), &quickstart); reopen_console (); - fetch_path (L"ConfigurationPath", path, sizeof (path) / sizeof (TCHAR)); + fetch_path (_T("ConfigurationPath"), path, sizeof (path) / sizeof (TCHAR)); path[_tcslen (path) - 1] = 0; if (GetFileAttributes (path) == 0xffffffff) { createdir (path); - _tcscat (path, L"\\Host"); + _tcscat (path, _T("\\Host")); createdir (path); - fetch_path (L"ConfigurationPath", path, sizeof (path) / sizeof (TCHAR)); - _tcscat (path, L"Hardware"); + fetch_path (_T("ConfigurationPath"), path, sizeof (path) / sizeof (TCHAR)); + _tcscat (path, _T("Hardware")); createdir (path); } - fetch_path (L"StatefilePath", path, sizeof (path) / sizeof (TCHAR)); + fetch_path (_T("StatefilePath"), path, sizeof (path) / sizeof (TCHAR)); createdir (path); - _tcscat (path, L"default.uss"); + _tcscat (path, _T("default.uss")); _tcscpy (savestate_fname, path); - fetch_path (L"InputPath", path, sizeof (path) / sizeof (TCHAR)); + fetch_path (_T("InputPath"), path, sizeof (path) / sizeof (TCHAR)); createdir (path); regclosetree (read_disk_history (HISTORY_FLOPPY)); regclosetree (read_disk_history (HISTORY_CD)); @@ -4005,7 +4005,7 @@ static void WIN32_HandleRegistryStuff (void) #if WINUAEPUBLICBETA > 0 static TCHAR *BETAMESSAGE = { - L"This is unstable beta software. Click cancel if you are not comfortable using software that is incomplete and can have serious programming errors." + _T("This is unstable beta software. Click cancel if you are not comfortable using software that is incomplete and can have serious programming errors.") }; #endif @@ -4040,7 +4040,7 @@ static int betamessage (void) ft64.HighPart = ft.dwHighDateTime; dwType = REG_QWORD; size = sizeof regft64; - if (RegQueryValueEx (hWinUAEKey, L"BetaToken", 0, &dwType, (LPBYTE)®ft64, &size) != ERROR_SUCCESS) + if (RegQueryValueEx (hWinUAEKey, _T("BetaToken"), 0, &dwType, (LPBYTE)®ft64, &size) != ERROR_SUCCESS) break; GetSystemTime(&st); SystemTimeToFileTime(&st, &sft); @@ -4061,9 +4061,9 @@ static int betamessage (void) dwType = REG_DWORD; size = sizeof data; - if (hWinUAEKey && RegQueryValueEx (hWinUAEKey, L"Beta_Just_Shut_Up", 0, &dwType, (LPBYTE)&data, &size) == ERROR_SUCCESS) { + if (hWinUAEKey && RegQueryValueEx (hWinUAEKey, _T("Beta_Just_Shut_Up"), 0, &dwType, (LPBYTE)&data, &size) == ERROR_SUCCESS) { if (data == 68000 + 10) { - write_log (L"I was told to shut up :(\n"); + write_log (_T("I was told to shut up :(\n")); return 1; } } @@ -4072,16 +4072,16 @@ static int betamessage (void) t = _gmtime64 (<ime); /* "expire" in 1 month */ if (MAKEBD(t->tm_year + 1900, t->tm_mon + 1, t->tm_mday) > WINUAEDATE + 100) - pre_gui_message (L"This beta build of WinUAE is obsolete.\nPlease download newer version."); + pre_gui_message (_T("This beta build of WinUAE is obsolete.\nPlease download newer version.")); - _tcscpy (title, L"WinUAE Public Beta Disclaimer"); + _tcscpy (title, _T("WinUAE Public Beta Disclaimer")); _tcscat (title, BetaStr); r = MessageBox (NULL, BETAMESSAGE, title, MB_OKCANCEL | MB_TASKMODAL | MB_SETFOREGROUND | MB_ICONWARNING | MB_DEFBUTTON2); if (r == IDABORT || r == IDCANCEL) return 0; if (ft64.QuadPart > 0) { regft64 = ft64.QuadPart; - RegSetValueEx (hWinUAEKey, L"BetaToken", 0, REG_QWORD, (LPBYTE)®ft64, sizeof regft64); + RegSetValueEx (hWinUAEKey, _T("BetaToken"), 0, REG_QWORD, (LPBYTE)®ft64, sizeof regft64); } } #endif @@ -4092,7 +4092,7 @@ static int dxdetect (void) { #if !defined(WIN64) /* believe or not but this is MS supported way of detecting DX8+ */ - HMODULE h = LoadLibrary (L"D3D8.DLL"); + HMODULE h = LoadLibrary (_T("D3D8.DLL")); TCHAR szWrongDXVersion[MAX_DPATH]; if (h) { FreeLibrary (h); @@ -4120,7 +4120,7 @@ static int isadminpriv (void) // Open a handle to the access token for the calling process. if (!OpenProcessToken (GetCurrentProcess (), TOKEN_QUERY, &hToken)) { - write_log (L"OpenProcessToken Error %u\n", GetLastError ()); + write_log (_T("OpenProcessToken Error %u\n"), GetLastError ()); return FALSE; } @@ -4128,7 +4128,7 @@ static int isadminpriv (void) if(!GetTokenInformation (hToken, TokenGroups, NULL, dwSize, &dwSize)) { dwResult = GetLastError (); if(dwResult != ERROR_INSUFFICIENT_BUFFER) { - write_log (L"GetTokenInformation Error %u\n", dwResult); + write_log (_T("GetTokenInformation Error %u\n"), dwResult); return FALSE; } } @@ -4138,7 +4138,7 @@ static int isadminpriv (void) // Call GetTokenInformation again to get the group information. if (!GetTokenInformation (hToken, TokenGroups, pGroupInfo, dwSize, &dwSize)) { - write_log (L"GetTokenInformation Error %u\n", GetLastError ()); + write_log (_T("GetTokenInformation Error %u\n"), GetLastError ()); return FALSE; } @@ -4148,7 +4148,7 @@ static int isadminpriv (void) DOMAIN_ALIAS_RID_ADMINS, 0, 0, 0, 0, 0, 0, &pSID)) { - write_log (L"AllocateAndInitializeSid Error %u\n", GetLastError ()); + write_log (_T("AllocateAndInitializeSid Error %u\n"), GetLastError ()); return FALSE; } @@ -4174,9 +4174,9 @@ static int osdetect (void) PISUSERANADMIN pIsUserAnAdmin; pGetNativeSystemInfo = (PGETNATIVESYSTEMINFO)GetProcAddress ( - GetModuleHandle (L"kernel32.dll"), "GetNativeSystemInfo"); + GetModuleHandle (_T("kernel32.dll")), "GetNativeSystemInfo"); pIsUserAnAdmin = (PISUSERANADMIN)GetProcAddress ( - GetModuleHandle (L"shell32.dll"), "IsUserAnAdmin"); + GetModuleHandle (_T("shell32.dll")), "IsUserAnAdmin"); GetSystemInfo (&SystemInfo); if (pGetNativeSystemInfo) @@ -4226,9 +4226,9 @@ void create_afnewdir (int remove) if (SUCCEEDED (SHGetFolderPath (NULL, CSIDL_COMMON_DOCUMENTS, NULL, 0, tmp))) { fixtrailing (tmp); _tcscpy (tmp2, tmp); - _tcscat (tmp2, L"Amiga Files"); + _tcscat (tmp2, _T("Amiga Files")); _tcscpy (tmp, tmp2); - _tcscat (tmp, L"\\WinUAE"); + _tcscat (tmp, _T("\\WinUAE")); if (remove) { if (GetFileAttributes (tmp) != INVALID_FILE_ATTRIBUTES) { RemoveDirectory (tmp); @@ -4262,16 +4262,16 @@ bool get_plugin_path (TCHAR *out, int len, const TCHAR *path) fixtrailing (out); return true; } - if (!_tcsicmp (path, L"floppysounds")) { + if (!_tcsicmp (path, _T("floppysounds"))) { _tcscpy (tmp, start_path_data); - _tcscpy (tmp, L"uae_data"); + _tcscpy (tmp, _T("uae_data")); if (isdir (tmp)) { _tcscpy (out, tmp); fixtrailing (out); return true; } _tcscpy (tmp, start_path_exe); - _tcscpy (tmp, L"uae_data"); + _tcscpy (tmp, _T("uae_data")); if (isdir (tmp)) { _tcscpy (out, tmp); fixtrailing (out); @@ -4307,14 +4307,14 @@ void setpathmode (pathtype pt) { TCHAR pathmode[32] = { 0 }; if (pt == PATH_TYPE_WINUAE) - _tcscpy (pathmode, L"WinUAE"); + _tcscpy (pathmode, _T("WinUAE")); if (pt == PATH_TYPE_NEWWINUAE) - _tcscpy (pathmode, L"WinUAE_2"); + _tcscpy (pathmode, _T("WinUAE_2")); if (pt == PATH_TYPE_NEWAF) - _tcscpy (pathmode, L"AmigaForever"); + _tcscpy (pathmode, _T("AmigaForever")); if (pt == PATH_TYPE_AMIGAFOREVERDATA) - _tcscpy (pathmode, L"AMIGAFOREVERDATA"); - regsetstr (NULL, L"PathMode", pathmode); + _tcscpy (pathmode, _T("AMIGAFOREVERDATA")); + regsetstr (NULL, _T("PathMode"), pathmode); } static void getstartpaths (void) @@ -4332,17 +4332,17 @@ static void getstartpaths (void) key = regcreatetree (NULL, NULL); if (key) { int size = sizeof (prevpath) / sizeof (TCHAR); - if (!regquerystr (key, L"PathMode", prevpath, &size)) + if (!regquerystr (key, _T("PathMode"), prevpath, &size)) prevpath[0] = 0; regclosetree (key); } - if (!_tcscmp (prevpath, L"WinUAE")) + if (!_tcscmp (prevpath, _T("WinUAE"))) path_type = PATH_TYPE_WINUAE; - if (!_tcscmp (prevpath, L"WinUAE_2")) + if (!_tcscmp (prevpath, _T("WinUAE_2"))) path_type = PATH_TYPE_NEWWINUAE; - if (!_tcscmp (prevpath, L"AF2005") || !_tcscmp (prevpath, L"AmigaForever")) + if (!_tcscmp (prevpath, _T("AF2005")) || !_tcscmp (prevpath, _T("AmigaForever"))) path_type = PATH_TYPE_NEWAF; - if (!_tcscmp (prevpath, L"AMIGAFOREVERDATA")) + if (!_tcscmp (prevpath, _T("AMIGAFOREVERDATA"))) path_type = PATH_TYPE_AMIGAFOREVERDATA; GetFullPathName (_wpgmptr, sizeof start_path_exe / sizeof (TCHAR), start_path_exe, NULL); @@ -4356,12 +4356,12 @@ static void getstartpaths (void) } else if (path_type == PATH_TYPE_DEFAULT && start_data == 0 && key) { bool ispath = false; _tcscpy (tmp2, start_path_exe); - _tcscat (tmp2, L"configurations\\configuration.cache"); + _tcscat (tmp2, _T("configurations\\configuration.cache")); v = GetFileAttributes (tmp2); if (v != INVALID_FILE_ATTRIBUTES && !(v & FILE_ATTRIBUTE_DIRECTORY)) ispath = true; _tcscpy (tmp2, start_path_exe); - _tcscat (tmp2, L"roms"); + _tcscat (tmp2, _T("roms")); v = GetFileAttributes (tmp2); if (v != INVALID_FILE_ATTRIBUTES && (v & FILE_ATTRIBUTE_DIRECTORY)) ispath = true; @@ -4373,25 +4373,25 @@ static void getstartpaths (void) if (SUCCEEDED (SHGetFolderPath (NULL, CSIDL_COMMON_DOCUMENTS, NULL, SHGFP_TYPE_CURRENT, tmp))) { fixtrailing (tmp); _tcscpy (tmp2, tmp); - _tcscat (tmp2, L"Amiga Files"); + _tcscat (tmp2, _T("Amiga Files")); CreateDirectory (tmp2, NULL); - _tcscat (tmp2, L"\\WinUAE"); + _tcscat (tmp2, _T("\\WinUAE")); CreateDirectory (tmp2, NULL); v = GetFileAttributes (tmp2); if (v != INVALID_FILE_ATTRIBUTES && (v & FILE_ATTRIBUTE_DIRECTORY)) { - _tcscat (tmp2, L"\\"); + _tcscat (tmp2, _T("\\")); path_type = PATH_TYPE_NEWWINUAE; _tcscpy (tmp, tmp2); - _tcscat (tmp, L"Configurations"); + _tcscat (tmp, _T("Configurations")); CreateDirectory (tmp, NULL); _tcscpy (tmp, tmp2); - _tcscat (tmp, L"Screenshots"); + _tcscat (tmp, _T("Screenshots")); CreateDirectory (tmp, NULL); _tcscpy (tmp, tmp2); - _tcscat (tmp, L"Savestates"); + _tcscat (tmp, _T("Savestates")); CreateDirectory (tmp, NULL); _tcscpy (tmp, tmp2); - _tcscat (tmp, L"Screenshots"); + _tcscat (tmp, _T("Screenshots")); CreateDirectory (tmp, NULL); } } @@ -4401,17 +4401,17 @@ static void getstartpaths (void) } _tcscpy (tmp, start_path_exe); - _tcscat (tmp, L"roms"); + _tcscat (tmp, _T("roms")); if (isfilesindir (tmp)) { _tcscpy (xstart_path_uae, start_path_exe); } _tcscpy (tmp, start_path_exe); - _tcscat (tmp, L"configurations"); + _tcscat (tmp, _T("configurations")); if (isfilesindir (tmp)) { _tcscpy (xstart_path_uae, start_path_exe); } - p = _wgetenv (L"AMIGAFOREVERDATA"); + p = _wgetenv (_T("AMIGAFOREVERDATA")); if (p) { _tcscpy (tmp, p); fixtrailing (tmp); @@ -4419,7 +4419,7 @@ static void getstartpaths (void) v = GetFileAttributes (tmp); if (v != INVALID_FILE_ATTRIBUTES && (v & FILE_ATTRIBUTE_DIRECTORY)) { _tcscpy (xstart_path_new2, start_path_new2); - _tcscpy (xstart_path_new2, L"WinUAE\\"); + _tcscpy (xstart_path_new2, _T("WinUAE\\")); af_path_2005 |= 2; } } @@ -4427,22 +4427,22 @@ static void getstartpaths (void) if (SUCCEEDED (SHGetFolderPath (NULL, CSIDL_COMMON_DOCUMENTS, NULL, SHGFP_TYPE_CURRENT, tmp))) { fixtrailing (tmp); _tcscpy (tmp2, tmp); - _tcscat (tmp2, L"Amiga Files\\"); + _tcscat (tmp2, _T("Amiga Files\\")); _tcscpy (tmp, tmp2); - _tcscat (tmp, L"WinUAE"); + _tcscat (tmp, _T("WinUAE")); v = GetFileAttributes (tmp); if (v != INVALID_FILE_ATTRIBUTES && (v & FILE_ATTRIBUTE_DIRECTORY)) { TCHAR *p; _tcscpy (xstart_path_new1, tmp2); - _tcscat (xstart_path_new1, L"WinUAE\\"); + _tcscat (xstart_path_new1, _T("WinUAE\\")); _tcscpy (xstart_path_uae, start_path_exe); _tcscpy (start_path_new1, xstart_path_new1); p = tmp2 + _tcslen (tmp2); - _tcscpy (p, L"System"); + _tcscpy (p, _T("System")); if (isfilesindir (tmp2)) { af_path_2005 |= 1; } else { - _tcscpy (p, L"Shared"); + _tcscpy (p, _T("Shared")); if (isfilesindir (tmp2)) { af_path_2005 |= 1; } @@ -4471,12 +4471,12 @@ static void getstartpaths (void) } if (af_path_2005 & 2) { _tcscpy (tmp, xstart_path_new2); - _tcscat (tmp, L"system\\rom"); + _tcscat (tmp, _T("system\\rom")); if (isfilesindir (tmp)) { path_type = PATH_TYPE_AMIGAFOREVERDATA; } else { _tcscpy (tmp, xstart_path_new2); - _tcscat (tmp, L"shared\\rom"); + _tcscat (tmp, _T("shared\\rom")); if (isfilesindir (tmp)) { path_type = PATH_TYPE_AMIGAFOREVERDATA; } else { @@ -4542,22 +4542,22 @@ static int getval (const TCHAR *s) static void makeverstr (TCHAR *s) { if (_tcslen (WINUAEBETA) > 0) { - _stprintf (BetaStr, L" (%sBeta %s, %d.%02d.%02d)", WINUAEPUBLICBETA > 0 ? L"Public " : L"", WINUAEBETA, + _stprintf (BetaStr, _T(" (%sBeta %s, %d.%02d.%02d)"), WINUAEPUBLICBETA > 0 ? _T("Public ") : _T(""), WINUAEBETA, GETBDY(WINUAEDATE), GETBDM(WINUAEDATE), GETBDD(WINUAEDATE)); #ifdef _WIN64 - _tcscat (BetaStr, L" 64-bit"); + _tcscat (BetaStr, _T(" 64-bit")); #endif - _stprintf (s, L"WinUAE %d.%d.%d%s%s", + _stprintf (s, _T("WinUAE %d.%d.%d%s%s"), UAEMAJOR, UAEMINOR, UAESUBREV, WINUAEREV, BetaStr); } else { - _stprintf (s, L"WinUAE %d.%d.%d%s (%d.%02d.%02d)", + _stprintf (s, _T("WinUAE %d.%d.%d%s (%d.%02d.%02d)"), UAEMAJOR, UAEMINOR, UAESUBREV, WINUAEREV, GETBDY(WINUAEDATE), GETBDM(WINUAEDATE), GETBDD(WINUAEDATE)); #ifdef _WIN64 - _tcscat (s, L" 64-bit"); + _tcscat (s, _T(" 64-bit")); #endif } if (_tcslen (WINUAEEXTRA) > 0) { - _tcscat (s, L" "); + _tcscat (s, _T(" ")); _tcscat (s, WINUAEEXTRA); } } @@ -4572,15 +4572,15 @@ static TCHAR *getdefaultini (void) TCHAR *posn; if((posn = _tcsrchr (path, '\\'))) posn[1] = 0; - _tcscat (path, L"winuae.ini"); + _tcscat (path, _T("winuae.ini")); _tcscpy (orgpath, path); #if 1 - f = _tfopen (path, L"r+"); + f = _tfopen (path, _T("r+")); if (f) { fclose (f); return my_strdup (path); } - f = _tfopen (path, L"w"); + f = _tfopen (path, _T("w")); if (f) { fclose (f); return my_strdup (path); @@ -4589,8 +4589,8 @@ static TCHAR *getdefaultini (void) int v = GetTempPath (sizeof path / sizeof (TCHAR), path); if (v == 0 || v > sizeof path / sizeof (TCHAR)) return my_strdup (orgpath); - _tcsncat (path, L"winuae.ini", sizeof path / sizeof (TCHAR)); - f = _tfopen (path, L"w"); + _tcsncat (path, _T("winuae.ini"), sizeof path / sizeof (TCHAR)); + f = _tfopen (path, _T("w")); if (f) { fclose (f); return my_strdup (path); @@ -4605,129 +4605,129 @@ static int parseargs (const TCHAR *argx, const TCHAR *np, const TCHAR *np2) if (argx[0] != '-' && argx[0] != '/') return 0; - if (!_tcscmp (arg, L"convert") && np && np2) { + if (!_tcscmp (arg, _T("convert")) && np && np2) { zfile_convertimage (np, np2); return -1; } - if (!_tcscmp (arg, L"console")) { + if (!_tcscmp (arg, _T("console"))) { console_started = 1; return 1; } - if (!_tcscmp (arg, L"cli")) { + if (!_tcscmp (arg, _T("cli"))) { console_emulation = 1; return 1; } - if (!_tcscmp (arg, L"log")) { + if (!_tcscmp (arg, _T("log"))) { console_logging = 1; return 1; } #ifdef FILESYS - if (!_tcscmp (arg, L"rdbdump")) { + if (!_tcscmp (arg, _T("rdbdump"))) { do_rdbdump = 1; return 1; } - if (!_tcscmp (arg, L"hddump")) { + if (!_tcscmp (arg, _T("hddump"))) { do_rdbdump = 2; return 1; } - if (!_tcscmp (arg, L"disableharddrivesafetycheck")) { + if (!_tcscmp (arg, _T("disableharddrivesafetycheck"))) { //harddrive_dangerous = 0x1234dead; return 1; } - if (!_tcscmp (arg, L"noaspifiltering")) { + if (!_tcscmp (arg, _T("noaspifiltering"))) { aspi_allow_all = 1; return 1; } #endif - if (!_tcscmp (arg, L"pngprint")) { + if (!_tcscmp (arg, _T("pngprint"))) { pngprint = 1; return 1; } - if (!_tcscmp (arg, L"norawinput")) { + if (!_tcscmp (arg, _T("norawinput"))) { no_rawinput = 1; return 1; } - if (!_tcscmp (arg, L"rawhid")) { + if (!_tcscmp (arg, _T("rawhid"))) { rawinput_enabled_hid = 1; return 1; } - if (!_tcscmp (arg, L"norawhid")) { + if (!_tcscmp (arg, _T("norawhid"))) { rawinput_enabled_hid = 0; return 1; } - if (!_tcscmp (arg, L"rawkeyboard")) { + if (!_tcscmp (arg, _T("rawkeyboard"))) { // obsolete return 1; } - if (!_tcscmp (arg, L"directsound")) { + if (!_tcscmp (arg, _T("directsound"))) { force_directsound = 1; return 1; } - if (!_tcscmp (arg, L"scsilog")) { + if (!_tcscmp (arg, _T("scsilog"))) { log_scsi = 1; return 1; } - if (!_tcscmp (arg, L"scsiemulog")) { + if (!_tcscmp (arg, _T("scsiemulog"))) { extern int log_scsiemu; log_scsiemu = 1; return 1; } - if (!_tcscmp (arg, L"netlog")) { + if (!_tcscmp (arg, _T("netlog"))) { log_net = 1; return 1; } - if (!_tcscmp (arg, L"serlog")) { + if (!_tcscmp (arg, _T("serlog"))) { log_sercon = 1; return 1; } - if (!_tcscmp (arg, L"a2065log")) { + if (!_tcscmp (arg, _T("a2065log"))) { log_a2065 = 1; return 1; } - if (!_tcscmp (arg, L"a2065log2")) { + if (!_tcscmp (arg, _T("a2065log2"))) { log_a2065 = 2; return 1; } - if (!_tcscmp (arg, L"a2065_promiscuous")) { + if (!_tcscmp (arg, _T("a2065_promiscuous"))) { a2065_promiscuous = 1; return 1; } - if (!_tcscmp (arg, L"seriallog")) { + if (!_tcscmp (arg, _T("seriallog"))) { log_uaeserial = 1; return 1; } - if (!_tcscmp (arg, L"vsynclog")) { + if (!_tcscmp (arg, _T("vsynclog"))) { log_vsync = 1; return 1; } - if (!_tcscmp (arg, L"clipboarddebug")) { + if (!_tcscmp (arg, _T("clipboarddebug"))) { clipboard_debug = 1; return 1; } - if (!_tcscmp (arg, L"rplog")) { + if (!_tcscmp (arg, _T("rplog"))) { log_rp = 1; return 1; } - if (!_tcscmp (arg, L"nomultidisplay")) { + if (!_tcscmp (arg, _T("nomultidisplay"))) { return 1; } - if (!_tcscmp (arg, L"legacypaths")) { + if (!_tcscmp (arg, _T("legacypaths"))) { start_data = -2; return 1; } - if (!_tcscmp (arg, L"screenshotbmp")) { + if (!_tcscmp (arg, _T("screenshotbmp"))) { screenshotmode = 0; return 1; } - if (!_tcscmp (arg, L"psprintdebug")) { + if (!_tcscmp (arg, _T("psprintdebug"))) { postscript_print_debugging = 1; return 1; } - if (!_tcscmp (arg, L"sounddebug")) { + if (!_tcscmp (arg, _T("sounddebug"))) { sound_debug = 1; return 1; } - if (!_tcscmp (arg, L"directcatweasel")) { + if (!_tcscmp (arg, _T("directcatweasel"))) { force_direct_catweasel = 1; if (np) { force_direct_catweasel = getval (np); @@ -4735,55 +4735,55 @@ static int parseargs (const TCHAR *argx, const TCHAR *np, const TCHAR *np2) } return 1; } - if (!_tcscmp (arg, L"forcerdtsc")) { + if (!_tcscmp (arg, _T("forcerdtsc"))) { userdtsc = 1; return 1; } - if (!_tcscmp (arg, L"ddsoftwarecolorkey")) { + if (!_tcscmp (arg, _T("ddsoftwarecolorkey"))) { // obsolete return 1; } - if (!_tcscmp (arg, L"nod3d9ex")) { + if (!_tcscmp (arg, _T("nod3d9ex"))) { D3DEX = 0; return 1; } - if (!_tcscmp (arg, L"d3ddebug")) { + if (!_tcscmp (arg, _T("d3ddebug"))) { d3ddebug = 1; return 1; } - if (!_tcscmp (arg, L"logflush")) { + if (!_tcscmp (arg, _T("logflush"))) { extern int always_flush_log; always_flush_log = 1; return 1; } - if (!_tcscmp (arg, L"ahidebug")) { + if (!_tcscmp (arg, _T("ahidebug"))) { extern int ahi_debug; ahi_debug = 2; return 1; } - if (!_tcscmp (arg, L"ahidebug2")) { + if (!_tcscmp (arg, _T("ahidebug2"))) { extern int ahi_debug; ahi_debug = 3; return 1; } - if (!_tcscmp (arg, L"quittogui")) { + if (!_tcscmp (arg, _T("quittogui"))) { quit_to_gui = 1; return 1; } - if (!_tcscmp (arg, L"ini") && np) { + if (!_tcscmp (arg, _T("ini")) && np) { inipath = my_strdup (np); return 2; } - if (!_tcscmp (arg, L"portable")) { + if (!_tcscmp (arg, _T("portable"))) { inipath = getdefaultini (); createbootlog = false; return 2; } - if (!_tcscmp (arg, L"bootlog")) { + if (!_tcscmp (arg, _T("bootlog"))) { createbootlog = true; return 1; } - if (!_tcscmp (arg, L"nobootlog")) { + if (!_tcscmp (arg, _T("nobootlog"))) { createbootlog = false; return 1; } @@ -4791,97 +4791,97 @@ static int parseargs (const TCHAR *argx, const TCHAR *np, const TCHAR *np2) if (!np) return 0; - if (!_tcscmp (arg, L"inputlog")) { + if (!_tcscmp (arg, _T("inputlog"))) { rawinput_log = getval (np); return 2; } - if (!_tcscmp (arg, L"vsyncbusywait")) { + if (!_tcscmp (arg, _T("vsyncbusywait"))) { vsync_busy_wait_mode = getval (np); return 2; } - if (!_tcscmp (arg, L"midiinbuffer")) { + if (!_tcscmp (arg, _T("midiinbuffer"))) { midi_inbuflen = getval (np); if (midi_inbuflen < 16000) midi_inbuflen = 16000; return 2; } - if (!_tcscmp (arg, L"ddforcemode")) { + if (!_tcscmp (arg, _T("ddforcemode"))) { extern int ddforceram; ddforceram = getval (np); if (ddforceram < 0 || ddforceram > 3) ddforceram = 0; return 2; } - if (!_tcscmp (arg, L"affinity")) { + if (!_tcscmp (arg, _T("affinity"))) { cpu_affinity = getval (np); if (cpu_affinity == 0) cpu_affinity = original_affinity; SetThreadAffinityMask (GetCurrentThread (), cpu_affinity); return 2; } - if (!_tcscmp (arg, L"paffinity")) { + if (!_tcscmp (arg, _T("paffinity"))) { cpu_paffinity = getval (np); if (cpu_paffinity == 0) cpu_paffinity = original_affinity; SetProcessAffinityMask (GetCurrentProcess (), cpu_paffinity); return 2; } - if (!_tcscmp (arg, L"datapath")) { + if (!_tcscmp (arg, _T("datapath"))) { ExpandEnvironmentStrings (np, start_path_data, sizeof start_path_data / sizeof (TCHAR)); start_data = -1; return 2; } - if (!_tcscmp (arg, L"pluginpath")) { + if (!_tcscmp (arg, _T("pluginpath"))) { ExpandEnvironmentStrings (np, start_path_plugins, sizeof start_path_plugins / sizeof (TCHAR)); return 2; } - if (!_tcscmp (arg, L"maxmem")) { + if (!_tcscmp (arg, _T("maxmem"))) { maxmem = getval (np); return 2; } - if (!_tcscmp (arg, L"soundmodeskip")) { + if (!_tcscmp (arg, _T("soundmodeskip"))) { sound_mode_skip = getval (np); return 2; } - if (!_tcscmp (arg, L"p96skipmode")) { + if (!_tcscmp (arg, _T("p96skipmode"))) { extern int p96skipmode; p96skipmode = getval (np); return 2; } - if (!_tcscmp (arg, L"minidumpmode")) { + if (!_tcscmp (arg, _T("minidumpmode"))) { minidumpmode = (MINIDUMP_TYPE)getval (np); return 2; } - if (!_tcscmp (arg, L"jitevent")) { + if (!_tcscmp (arg, _T("jitevent"))) { pissoff_value = getval (np) * CYCLE_UNIT; return 2; } - if (!_tcscmp (arg, L"inputrecorddebug")) { + if (!_tcscmp (arg, _T("inputrecorddebug"))) { inputrecord_debug = getval (np); return 2; } - if (!_tcscmp (arg, L"extraframewait")) { + if (!_tcscmp (arg, _T("extraframewait"))) { extraframewait = getval (np); return 2; } #ifdef RETROPLATFORM - if (!_tcscmp (arg, L"rphost")) { + if (!_tcscmp (arg, _T("rphost"))) { rp_param = my_strdup (np); return 2; } - if (!_tcscmp (arg, L"rpescapekey")) { + if (!_tcscmp (arg, _T("rpescapekey"))) { rp_rpescapekey = getval (np); return 2; } - if (!_tcscmp (arg, L"rpescapeholdtime")) { + if (!_tcscmp (arg, _T("rpescapeholdtime"))) { rp_rpescapeholdtime = getval (np); return 2; } - if (!_tcscmp (arg, L"rpscreenmode")) { + if (!_tcscmp (arg, _T("rpscreenmode"))) { rp_screenmode = getval (np); return 2; } - if (!_tcscmp (arg, L"rpinputmode")) { + if (!_tcscmp (arg, _T("rpinputmode"))) { rp_inputmode = getval (np); return 2; } @@ -4935,7 +4935,7 @@ static int process_arg (TCHAR *cmdline, TCHAR **xargv, TCHAR ***xargv3) ok = 0; if (f[0] != '-' && f[0] != '/') { int type = -1; - struct zfile *z = zfile_fopen (f, L"rb", ZFD_NORMAL); + struct zfile *z = zfile_fopen (f, _T("rb"), ZFD_NORMAL); if (z) { type = zfile_gettype (z); zfile_fclose (z); @@ -4944,17 +4944,17 @@ static int process_arg (TCHAR *cmdline, TCHAR **xargv, TCHAR ***xargv3) switch (type) { case ZFILE_CONFIGURATION: - _stprintf (tmp, L"-config=%s", f); + _stprintf (tmp, _T("-config=%s"), f); break; case ZFILE_STATEFILE: - _stprintf (tmp, L"-statefile=%s", f); + _stprintf (tmp, _T("-statefile=%s"), f); break; case ZFILE_CDIMAGE: - _stprintf (tmp, L"-cdimage=%s", f); + _stprintf (tmp, _T("-cdimage=%s"), f); break; case ZFILE_DISKIMAGE: if (fd < 4) - _stprintf (tmp, L"-cfgparam=floppy%d=%s", fd++, f); + _stprintf (tmp, _T("-cfgparam=floppy%d=%s"), fd++, f); break; } if (tmp[0]) { @@ -4969,8 +4969,8 @@ static int process_arg (TCHAR *cmdline, TCHAR **xargv, TCHAR ***xargv3) } if (added) { for (i = 0; argv[i]; i++); - argv[i++] = my_strdup (L"-s"); - argv[i++] = my_strdup (L"use_gui=no"); + argv[i++] = my_strdup (_T("-s")); + argv[i++] = my_strdup (_T("use_gui=no")); argv[i] = NULL; } for (i = 0; argv[i]; i++) { @@ -5005,16 +5005,16 @@ static TCHAR **WIN32_InitRegistry (TCHAR **argv) hWinUAEKey = NULL; if (getregmode () == 0 || WINUAEPUBLICBETA > 0) { /* Create/Open the hWinUAEKey which points our config-info */ - RegCreateKeyEx (HKEY_CURRENT_USER, L"Software\\Arabuusimiehet\\WinUAE", 0, L"", REG_OPTION_NON_VOLATILE, + RegCreateKeyEx (HKEY_CURRENT_USER, _T("Software\\Arabuusimiehet\\WinUAE"), 0, _T(""), REG_OPTION_NON_VOLATILE, KEY_WRITE | KEY_READ, NULL, &hWinUAEKey, &disposition); if (hWinUAEKey == NULL) { FILE *f; TCHAR *path; path = getdefaultini (); - f = _tfopen (path, L"r"); + f = _tfopen (path, _T("r")); if (!f) - f = _tfopen (path, L"w"); + f = _tfopen (path, _T("w")); if (f) { fclose (f); reginitializeinit (&path); @@ -5022,7 +5022,7 @@ static TCHAR **WIN32_InitRegistry (TCHAR **argv) xfree (path); } } - if (regquerystr (NULL, L"Commandline", tmp, &size)) + if (regquerystr (NULL, _T("Commandline"), tmp, &size)) return parseargstrings (tmp, argv); return NULL; } @@ -5040,7 +5040,7 @@ static int PASCAL WinMain2 (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR return 0; hInst = hInstance; - hMutex = CreateMutex (NULL, FALSE, L"WinUAE Instantiated"); // To tell the installer we're running + hMutex = CreateMutex (NULL, FALSE, _T("WinUAE Instantiated")); // To tell the installer we're running argv = xcalloc (TCHAR*, MAX_ARGUMENTS); @@ -5055,16 +5055,16 @@ static int PASCAL WinMain2 (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR logging_init (); if (_tcslen (lpCmdLine) > 0) - write_log (L"'%s'\n", lpCmdLine); + write_log (_T("'%s'\n"), lpCmdLine); if (argv3 && argv3[0]) { - write_log (L"params:\n"); + write_log (_T("params:\n")); for (i = 0; argv3[i]; i++) - write_log (L"%d: '%s'\n", i + 1, argv3[i]); + write_log (_T("%d: '%s'\n"), i + 1, argv3[i]); } if (argv2) { - write_log (L"extra params:\n"); + write_log (_T("extra params:\n")); for (i = 0; argv2[i]; i++) - write_log (L"%d: '%s'\n", i + 1, argv2[i]); + write_log (_T("%d: '%s'\n"), i + 1, argv2[i]); } if (WIN32_RegisterClasses () && WIN32_InitLibraries ()) { DWORD i; @@ -5076,22 +5076,22 @@ static int PASCAL WinMain2 (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR } #endif WIN32_HandleRegistryStuff (); - write_log (L"Enumerating display devices.. \n"); + write_log (_T("Enumerating display devices.. \n")); enumeratedisplays (); - write_log (L"Sorting devices and modes..\n"); + write_log (_T("Sorting devices and modes..\n")); sortdisplays (); - write_log (L"Display buffer mode = %d\n", ddforceram); + write_log (_T("Display buffer mode = %d\n"), ddforceram); enumerate_sound_devices (); for (i = 0; i < MAX_SOUND_DEVICES && sound_devices[i]; i++) { int type = sound_devices[i]->type; - write_log (L"%d:%s: %s\n", i, type == SOUND_DEVICE_XAUDIO2 ? L"XA" : (type == SOUND_DEVICE_DS ? L"DS" : (type == SOUND_DEVICE_AL ? L"AL" : (type == SOUND_DEVICE_WASAPI ? L"WA" : (type == SOUND_DEVICE_WASAPI_EXCLUSIVE ? L"WX" : L"PA")))), sound_devices[i]->name); + write_log (_T("%d:%s: %s\n"), i, type == SOUND_DEVICE_XAUDIO2 ? _T("XA") : (type == SOUND_DEVICE_DS ? _T("DS") : (type == SOUND_DEVICE_AL ? _T("AL") : (type == SOUND_DEVICE_WASAPI ? _T("WA") : (type == SOUND_DEVICE_WASAPI_EXCLUSIVE ? _T("WX") : _T("PA"))))), sound_devices[i]->name); } - write_log (L"Enumerating recording devices:\n"); + write_log (_T("Enumerating recording devices:\n")); for (i = 0; i < MAX_SOUND_DEVICES && record_devices[i]; i++) { int type = record_devices[i]->type; - write_log (L"%d:%s: %s\n", i, type == SOUND_DEVICE_XAUDIO2 ? L"XA" : (type == SOUND_DEVICE_DS ? L"DS" : (type == SOUND_DEVICE_AL ? L"AL" : (type == SOUND_DEVICE_WASAPI ? L"WA" : (type == SOUND_DEVICE_WASAPI_EXCLUSIVE ? L"WX" : L"PA")))), record_devices[i]->name); + write_log (_T("%d:%s: %s\n"), i, type == SOUND_DEVICE_XAUDIO2 ? _T("XA") : (type == SOUND_DEVICE_DS ? _T("DS") : (type == SOUND_DEVICE_AL ? _T("AL") : (type == SOUND_DEVICE_WASAPI ? _T("WA") : (type == SOUND_DEVICE_WASAPI_EXCLUSIVE ? _T("WX") : _T("PA"))))), record_devices[i]->name); } - write_log (L"done\n"); + write_log (_T("done\n")); #if 0 DEVMODE devmode; memset (&devmode, 0, sizeof (devmode)); @@ -5116,7 +5116,7 @@ static int PASCAL WinMain2 (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR #ifdef PARALLEL_PORT paraport_mask = paraport_init (); #endif - globalipc = createIPC (L"WinUAE", 0); + globalipc = createIPC (_T("WinUAE"), 0); serialipc = createIPC (COMPIPENAME, 1); enumserialports (); enummidiports (); @@ -5201,7 +5201,7 @@ int driveclick_loadresource (struct drvsample *sp, int drivetype) ok = 1; for (i = 0; drvsampleres[i] >= 0; i += 2) { struct drvsample *s = sp + drvsampleres[i + 1]; - HRSRC res = FindResource (NULL, MAKEINTRESOURCE (drvsampleres[i + 0]), L"WAVE"); + HRSRC res = FindResource (NULL, MAKEINTRESOURCE (drvsampleres[i + 0]), _T("WAVE")); if (res != 0) { HANDLE h = LoadResource (NULL, res); int len = SizeofResource (NULL, res); @@ -5219,7 +5219,7 @@ int driveclick_loadresource (struct drvsample *sp, int drivetype) LONG WINAPI WIN32_ExceptionFilter (struct _EXCEPTION_POINTERS * pExceptionPointers, DWORD ec) { - write_log (L"EVALEXCEPTION!\n"); + write_log (_T("EVALEXCEPTION!\n")); return EXCEPTION_EXECUTE_HANDLER; } #else @@ -5303,7 +5303,7 @@ LONG WINAPI WIN32_ExceptionFilter (struct _EXCEPTION_POINTERS *pExceptionPointer if (ec == EXCEPTION_ACCESS_VIOLATION && !er->ExceptionFlags && er->NumberParameters >= 2 && !er->ExceptionInformation[0] && regs.pc_p) { void *p = (void*)er->ExceptionInformation[1]; - write_log (L"ExceptionFilter Trap: %p %p %p\n", p, regs.pc_p, prevpc); + write_log (_T("ExceptionFilter Trap: %p %p %p\n"), p, regs.pc_p, prevpc); if ((p >= (void*)regs.pc_p && p < (void*)(regs.pc_p + 32)) || (p >= (void*)prevpc && p < (void*)(prevpc + 32))) { int got = 0; @@ -5316,9 +5316,9 @@ LONG WINAPI WIN32_ExceptionFilter (struct _EXCEPTION_POINTERS *pExceptionPointer efix (&ctx->Edx, p, ps, &got); efix (&ctx->Esi, p, ps, &got); efix (&ctx->Edi, p, ps, &got); - write_log (L"Access violation! (68KPC=%08X HOSTADDR=%p)\n", M68K_GETPC, p); + write_log (_T("Access violation! (68KPC=%08X HOSTADDR=%p)\n"), M68K_GETPC, p); if (got == 0) { - write_log (L"failed to find and fix the problem (%p). crashing..\n", p); + write_log (_T("failed to find and fix the problem (%p). crashing..\n"), p); } else { void *ppc = regs.pc_p; m68k_setpc (0); @@ -5349,7 +5349,7 @@ LONG WINAPI WIN32_ExceptionFilter (struct _EXCEPTION_POINTERS *pExceptionPointer when = *_localtime64 (&now); _tcscpy (path2, path); if (slash) { - _tcscpy (slash + 1, L"DBGHELP.DLL"); + _tcscpy (slash + 1, _T("DBGHELP.DLL")); dll = WIN32_LoadLibrary (path); } slash = _tcsrchr (path2, '\\'); @@ -5359,12 +5359,12 @@ LONG WINAPI WIN32_ExceptionFilter (struct _EXCEPTION_POINTERS *pExceptionPointer p = path2; beta[0] = 0; if (WINUAEPUBLICBETA > 0) - _stprintf (beta, L"b%s", WINUAEBETA); - _stprintf (p, L"winuae_%d%d%d%s_%d%02d%02d_%02d%02d%02d.dmp", + _stprintf (beta, _T("b%s"), WINUAEBETA); + _stprintf (p, _T("winuae_%d%d%d%s_%d%02d%02d_%02d%02d%02d.dmp"), UAEMAJOR, UAEMINOR, UAESUBREV, beta, when.tm_year + 1900, when.tm_mon + 1, when.tm_mday, when.tm_hour, when.tm_min, when.tm_sec); if (dll == NULL) - dll = WIN32_LoadLibrary (L"DBGHELP.DLL"); + dll = WIN32_LoadLibrary (_T("DBGHELP.DLL")); if (dll) { MINIDUMPWRITEDUMP dump = (MINIDUMPWRITEDUMP)GetProcAddress (dll, "MiniDumpWriteDump"); if (dump) { @@ -5374,8 +5374,8 @@ LONG WINAPI WIN32_ExceptionFilter (struct _EXCEPTION_POINTERS *pExceptionPointer savedump (dump, f, pExceptionPointers); CloseHandle (f); if (isfullscreen () <= 0) { - _stprintf (msg, L"Crash detected. MiniDump saved as:\n%s\n", path2); - MessageBox (NULL, msg, L"Crash", MB_OK | MB_ICONWARNING | MB_TASKMODAL | MB_SETFOREGROUND); + _stprintf (msg, _T("Crash detected. MiniDump saved as:\n%s\n"), path2); + MessageBox (NULL, msg, _T("Crash"), MB_OK | MB_ICONWARNING | MB_TASKMODAL | MB_SETFOREGROUND); } } } @@ -5384,9 +5384,9 @@ LONG WINAPI WIN32_ExceptionFilter (struct _EXCEPTION_POINTERS *pExceptionPointer } #endif #if 0 - HMODULE hFaultRepDll = LoadLibrary (L"FaultRep.dll") ; + HMODULE hFaultRepDll = LoadLibrary (_T("FaultRep.dll")) ; if (hFaultRepDll) { - pfn_REPORTFAULT pfn = (pfn_REPORTFAULT)GetProcAddress (hFaultRepDll, L"ReportFault"); + pfn_REPORTFAULT pfn = (pfn_REPORTFAULT)GetProcAddress (hFaultRepDll, _T("ReportFault")); if (pfn) { EFaultRepRetVal rc = pfn (pExceptionPointers, 0); lRet = EXCEPTION_EXECUTE_HANDLER; @@ -5421,9 +5421,9 @@ void addnotifications (HWND hwnd, int remove, int isgui) SHCHANGENOTIFYDEREGISTER pSHChangeNotifyDeregister; pSHChangeNotifyRegister = (SHCHANGENOTIFYREGISTER)GetProcAddress ( - GetModuleHandle (L"shell32.dll"), "SHChangeNotifyRegister"); + GetModuleHandle (_T("shell32.dll")), "SHChangeNotifyRegister"); pSHChangeNotifyDeregister = (SHCHANGENOTIFYDEREGISTER)GetProcAddress ( - GetModuleHandle (L"shell32.dll"), "SHChangeNotifyDeregister"); + GetModuleHandle (_T("shell32.dll")), "SHChangeNotifyDeregister"); if (remove) { if (ret > 0 && pSHChangeNotifyDeregister) @@ -5463,11 +5463,11 @@ void systray (HWND hwnd, int remove) if (rp_isactive ()) return; #endif - //write_log (L"notif: systray(%x,%d)\n", hwnd, remove); + //write_log (_T("notif: systray(%x,%d)\n"), hwnd, remove); if (!remove) { - TaskbarRestart = RegisterWindowMessage (L"TaskbarCreated"); + TaskbarRestart = RegisterWindowMessage (_T("TaskbarCreated")); TaskbarRestartHWND = hwnd; - //write_log (L"notif: taskbarrestart = %d\n", TaskbarRestart); + //write_log (_T("notif: taskbarrestart = %d\n"), TaskbarRestart); } else { TaskbarRestart = 0; hwnd = TaskbarRestartHWND; @@ -5481,13 +5481,13 @@ void systray (HWND hwnd, int remove) nid.uFlags = NIF_ICON | NIF_MESSAGE; nid.uCallbackMessage = WM_USER + 1; v = Shell_NotifyIcon (remove ? NIM_DELETE : NIM_ADD, &nid); - //write_log (L"notif: Shell_NotifyIcon returned %d\n", v); + //write_log (_T("notif: Shell_NotifyIcon returned %d\n"), v); if (v) { if (remove) TaskbarRestartHWND = NULL; } else { DWORD err = GetLastError (); - write_log (L"Notify error code = %x (%d)\n", err, err); + write_log (_T("Notify error code = %x (%d)\n"), err, err); } } @@ -5513,9 +5513,9 @@ static void systraymenu (HWND hwnd) while (drvs[i] >= 0) { TCHAR s[MAX_DPATH]; if (currprefs.floppyslots[i].df[0]) - _stprintf (s, L"DF%d: [%s]", i, currprefs.floppyslots[i].df); + _stprintf (s, _T("DF%d: [%s]"), i, currprefs.floppyslots[i].df); else - _stprintf (s, L"DF%d: [%s]", i, text); + _stprintf (s, _T("DF%d: [%s]"), i, text); ModifyMenu (drvmenu, drvs[i], MF_BYCOMMAND | MF_STRING, drvs[i], s); EnableMenuItem (menu2, drvs[i], currprefs.floppyslots[i].dfxtype < 0 ? MF_GRAYED : MF_ENABLED); i++; @@ -5523,9 +5523,9 @@ static void systraymenu (HWND hwnd) { TCHAR s[MAX_DPATH]; if (currprefs.cdslots[0].inuse && currprefs.cdslots[0].name[0]) - _stprintf (s, L"CD: [%s]", currprefs.cdslots[0].name); + _stprintf (s, _T("CD: [%s]"), currprefs.cdslots[0].name); else - _stprintf (s, L"CD: [%s]", text2); + _stprintf (s, _T("CD: [%s]"), text2); ModifyMenu (cdmenu, ID_ST_CD0, MF_BYCOMMAND | MF_STRING, ID_ST_CD0, s); int open = 0; struct device_info di; @@ -5548,13 +5548,13 @@ static void LLError (HMODULE m, const TCHAR *s) DWORD err; if (m) { - // write_log (L"'%s' opened\n", s); + // write_log (_T("'%s' opened\n"), s); return; } err = GetLastError (); if (err == ERROR_MOD_NOT_FOUND || err == ERROR_DLL_NOT_FOUND) return; - write_log (L"%s failed to open %d\n", s, err); + write_log (_T("%s failed to open %d\n"), s, err); } HMODULE WIN32_LoadLibrary_2 (const TCHAR *name, int expand) @@ -5577,7 +5577,7 @@ HMODULE WIN32_LoadLibrary_2 (const TCHAR *name, int expand) switch(round) { case 0: - p = _tcsstr (newname, L"32"); + p = _tcsstr (newname, _T("32")); if (p) { p[0] = '6'; p[1] = '4'; @@ -5585,22 +5585,22 @@ HMODULE WIN32_LoadLibrary_2 (const TCHAR *name, int expand) break; case 1: p = _tcschr (newname, '.'); - _tcscpy (p, L"_x64"); + _tcscpy (p, _T("_x64")); _tcscat (p, _tcschr (name, '.')); break; case 2: p = _tcschr (newname, '.'); - _tcscpy (p, L"x64"); + _tcscpy (p, _T("x64")); _tcscat (p, _tcschr (name, '.')); break; case 3: p = _tcschr (newname, '.'); - _tcscpy (p, L"_64"); + _tcscpy (p, _T("_64")); _tcscat (p, _tcschr (name, '.')); break; case 4: p = _tcschr (newname, '.'); - _tcscpy (p, L"64"); + _tcscpy (p, _T("64")); _tcscat (p, _tcschr (name, '.')); break; } @@ -5650,7 +5650,7 @@ int isdllversion (const TCHAR *name, int version, int revision, int subver, int if (vsFileInfo) { uae_u64 v1 = ((uae_u64)vsFileInfo->dwProductVersionMS << 32) | vsFileInfo->dwProductVersionLS; uae_u64 v2 = ((uae_u64)version << 48) | ((uae_u64)revision << 32) | (subver << 16) | (subrev << 0); - write_log (L"%s %d.%d.%d.%d\n", name, + write_log (_T("%s %d.%d.%d.%d\n"), name, HIWORD (vsFileInfo->dwProductVersionMS), LOWORD (vsFileInfo->dwProductVersionMS), HIWORD (vsFileInfo->dwProductVersionLS), LOWORD (vsFileInfo->dwProductVersionLS)); if (v1 >= v2) @@ -5696,7 +5696,7 @@ void target_addtorecent (const TCHAR *name, int t) SHCREATEITEMFROMPARSINGNAME pSHCreateItemFromParsingName; SHARDAPPIDINFO shard; pSHCreateItemFromParsingName = (SHCREATEITEMFROMPARSINGNAME)GetProcAddress ( - GetModuleHandle (L"shell32.dll"), "SHCreateItemFromParsingName"); + GetModuleHandle (_T("shell32.dll")), "SHCreateItemFromParsingName"); if (!pSHCreateItemFromParsingName) return; shard.pszAppID = WINUAEAPPNAME; @@ -5773,7 +5773,7 @@ int PASCAL wWinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdL } #endif #endif - SetDllDirectory (L""); + SetDllDirectory (_T("")); /* Make sure we do an InitCommonControls() to get some advanced controls */ InitCommonControls (); @@ -5788,13 +5788,13 @@ int PASCAL wWinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdL #define MSGFLT_ADD 1 CHANGEWINDOWMESSAGEFILTER pChangeWindowMessageFilter; pChangeWindowMessageFilter = (CHANGEWINDOWMESSAGEFILTER)GetProcAddress( - GetModuleHandle(L"user32.dll"), L"ChangeWindowMessageFilter"); + GetModuleHandle(_T("user32.dll")), _T("ChangeWindowMessageFilter")); if (pChangeWindowMessageFilter) pChangeWindowMessageFilter(WM_DROPFILES, MSGFLT_ADD); #endif pSetProcessDPIAware = (SETPROCESSDPIAWARE)GetProcAddress ( - GetModuleHandle (L"user32.dll"), "SetProcessDPIAware"); + GetModuleHandle (_T("user32.dll")), "SetProcessDPIAware"); if (pSetProcessDPIAware) pSetProcessDPIAware (); log_open (NULL, 0, 0); diff --git a/od-win32/win32.h b/od-win32/win32.h index d57479eb..aae911de 100644 --- a/od-win32/win32.h +++ b/od-win32/win32.h @@ -15,20 +15,20 @@ #define GETBDM(x) (((x) - ((x / 10000) * 10000)) / 100) #define GETBDD(x) ((x) % 100) -#define WINUAEPUBLICBETA 0 +#define WINUAEPUBLICBETA 1 #define LANG_DLL 1 -#define WINUAEBETA L"" -//#define WINUAEBETA L"Beta 0" +//#define WINUAEBETA _T("") +#define WINUAEBETA _T("Beta 0") #define WINUAEDATE MAKEBD(2012, 3, 29) -#define WINUAEEXTRA L"" -//#define WINUAEEXTRA L"AmiKit Preview" -#define WINUAEREV L"" +#define WINUAEEXTRA _T("") +//#define WINUAEEXTRA _T("AmiKit Preview") +#define WINUAEREV _T("") #define IHF_WINDOWHIDDEN 6 #define NORMAL_WINDOW_STYLE (WS_BORDER | WS_CAPTION | WS_MINIMIZEBOX | WS_SYSMENU | WS_SIZEBOX) -#define WINUAEAPPNAME L"Arabuusimiehet.WinUAE" +#define WINUAEAPPNAME _T("Arabuusimiehet.WinUAE") extern HMODULE hUIDLL; extern HWND hAmigaWnd, hMainWnd, hHiddenWnd, hGUIWnd; extern RECT amigawin_rect, mainwin_rect; @@ -132,7 +132,7 @@ void set_path (const TCHAR *name, TCHAR *path, pathtype); void read_rom_list (void); void associate_file_extensions (void); -#define WIN32_PLUGINDIR L"plugins\\" +#define WIN32_PLUGINDIR _T("plugins\\") HMODULE WIN32_LoadLibrary (const TCHAR *); HMODULE WIN32_LoadLibrary2 (const TCHAR *); int isdllversion (const TCHAR *name, int version, int revision, int subver, int subrev); diff --git a/od-win32/win32_filesys.cpp b/od-win32/win32_filesys.cpp index 7413e39a..b597d161 100644 --- a/od-win32/win32_filesys.cpp +++ b/od-win32/win32_filesys.cpp @@ -7,7 +7,7 @@ int CheckRM (const TCHAR *DriveName) DWORD dwHold; BOOL result = FALSE; - _stprintf (filename, L"%s.", DriveName); + _stprintf (filename, _T("%s."), DriveName); dwHold = GetFileAttributes (filename); if(dwHold != 0xFFFFFFFF) result = TRUE; @@ -16,7 +16,7 @@ int CheckRM (const TCHAR *DriveName) /* This function makes sure the volume-name being requested is not already in use, or any of the following illegal values: */ -static const TCHAR *illegal_volumenames[] = { L"SYS", L"DEVS", L"LIBS", L"FONTS", L"C", L"L", L"S" }; +static const TCHAR *illegal_volumenames[] = { _T("SYS"), _T("DEVS"), _T("LIBS"), _T("FONTS"), _T("C"), _T("L"), _T("S") }; static int valid_volumename (struct uaedev_mount_info *mountinfo, const TCHAR *volumename, int fullcheck) { @@ -51,12 +51,12 @@ int target_get_volume_name (struct uaedev_mount_info *mtinf, const TCHAR *volume volumename[0] && valid_volumename (mtinf, volumename, fullcheck)) { // +++Bernd Roesch - if(!_tcscmp (volumename, L"AmigaOS35")) - _tcscpy (volumename, L"AmigaOS3.5"); - if(!_tcscmp (volumename, L"AmigaOS39")) - _tcscpy (volumename, L"AmigaOS3.9"); - if(!_tcscmp (volumename, L"AmigaOS_XL")) - _tcscpy (volumename, L"AmigaOS XL"); + if(!_tcscmp (volumename, _T("AmigaOS35"))) + _tcscpy (volumename, _T("AmigaOS3.5")); + if(!_tcscmp (volumename, _T("AmigaOS39"))) + _tcscpy (volumename, _T("AmigaOS3.9")); + if(!_tcscmp (volumename, _T("AmigaOS_XL"))) + _tcscpy (volumename, _T("AmigaOS XL")); // ---Bernd Roesch if (_tcslen (volumename) > 0) result = 1; @@ -67,19 +67,19 @@ int target_get_volume_name (struct uaedev_mount_info *mtinf, const TCHAR *volume switch(drivetype) { case DRIVE_FIXED: - _stprintf (volumename, L"WinDH_%c", volumepath[0]); + _stprintf (volumename, _T("WinDH_%c"), volumepath[0]); break; case DRIVE_CDROM: - _stprintf (volumename, L"WinCD_%c", volumepath[0]); + _stprintf (volumename, _T("WinCD_%c"), volumepath[0]); break; case DRIVE_REMOVABLE: - _stprintf (volumename, L"WinRMV_%c", volumepath[0]); + _stprintf (volumename, _T("WinRMV_%c"), volumepath[0]); break; case DRIVE_REMOTE: - _stprintf (volumename, L"WinNET_%c", volumepath[0]); + _stprintf (volumename, _T("WinNET_%c"), volumepath[0]); break; case DRIVE_RAMDISK: - _stprintf (volumename, L"WinRAM_%c", volumepath[0]); + _stprintf (volumename, _T("WinRAM_%c"), volumepath[0]); break; case DRIVE_UNKNOWN: case DRIVE_NO_ROOT_DIR: @@ -114,7 +114,7 @@ static int hfdcheck (TCHAR drive) TCHAR tmp[16]; int disknum, i; - _stprintf (tmp, L"\\\\.\\%c:", drive); + _stprintf (tmp, _T("\\\\.\\%c:"), drive); h = CreateFile (tmp, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); if (h == INVALID_HANDLE_VALUE) return 0; @@ -135,7 +135,7 @@ static void filesys_addexternals (void) { int drive, drivetype; UINT errormode; - TCHAR volumename[MAX_DPATH] = L""; + TCHAR volumename[MAX_DPATH] = _T(""); TCHAR volumepath[16]; DWORD dwDriveMask; int drvnum = 0; @@ -148,7 +148,7 @@ static void filesys_addexternals (void) dwDriveMask >>= 2; // Skip A and B drives... for(drive = 'C'; drive <= 'Z'; ++drive) { - _stprintf (volumepath, L"%c:\\", drive); + _stprintf (volumepath, _T("%c:\\"), drive); /* Is this drive-letter valid (it used to check for media in drive) */ if(dwDriveMask & 1) { TCHAR devname[MAX_DPATH]; @@ -158,7 +158,7 @@ static void filesys_addexternals (void) drivetype = GetDriveType (volumepath); if (inserted && drivetype != DRIVE_NO_ROOT_DIR && drivetype != DRIVE_UNKNOWN) { if (hfdcheck (drive)) { - write_log (L"Drive %c:\\ ignored, was configured as a harddrive\n", drive); + write_log (_T("Drive %c:\\ ignored, was configured as a harddrive\n"), drive); continue; } } @@ -166,7 +166,7 @@ static void filesys_addexternals (void) for (;;) { #if USE_CDFS == 0 if (drivetype == DRIVE_CDROM && currprefs.win32_automount_cddrives) { - _stprintf (devname, L"WinCD_%c", drive); + _stprintf (devname, _T("WinCD_%c"), drive); rw = 0; break; } @@ -190,19 +190,19 @@ static void filesys_addexternals (void) if (inserted) { target_get_volume_name (&mountinfo, volumepath, volumename, MAX_DPATH, inserted, true); if (!volumename[0]) - _stprintf (volumename, L"WinUNK_%c", drive); + _stprintf (volumename, _T("WinUNK_%c"), drive); } if (drivetype == DRIVE_REMOTE) - _tcscat (volumepath, L"."); + _tcscat (volumepath, _T(".")); else - _tcscat (volumepath, L".."); + _tcscat (volumepath, _T("..")); #if 0 if (currprefs.win32_automount_drives > 1) { devname[0] = drive; devname[1] = 0; } #endif - //write_log (L"Drive type %d: '%s' '%s'\n", drivetype, volumepath, volumename); + //write_log (_T("Drive type %d: '%s' '%s'\n"), drivetype, volumepath, volumename); add_filesys_unit (devname[0] ? devname : NULL, volumename, volumepath, !rw, 0, 0, 0, 0, -20 - drvnum, 0, 1, 0, 0, 0); drvnum++; } /* if drivemask */ diff --git a/od-win32/win32_scaler.cpp b/od-win32/win32_scaler.cpp index ccd1becb..8c492f30 100644 --- a/od-win32/win32_scaler.cpp +++ b/od-win32/win32_scaler.cpp @@ -22,23 +22,23 @@ struct uae_filter uaefilters[] = { - { UAE_FILTER_NULL, 0, 1, L"Null filter", L"null", UAE_FILTER_MODE_16_16 | UAE_FILTER_MODE_32_32 }, + { UAE_FILTER_NULL, 0, 1, _T("Null filter"), _T("null"), UAE_FILTER_MODE_16_16 | UAE_FILTER_MODE_32_32 }, - { UAE_FILTER_SCALE2X, 0, 2, L"Scale2X", L"scale2x", UAE_FILTER_MODE_16_16 | UAE_FILTER_MODE_32_32 }, + { UAE_FILTER_SCALE2X, 0, 2, _T("Scale2X"), _T("scale2x"), UAE_FILTER_MODE_16_16 | UAE_FILTER_MODE_32_32 }, - { UAE_FILTER_HQ2X, 0, 2, L"hq2x", L"hq2x", UAE_FILTER_MODE_16_16 | UAE_FILTER_MODE_16_32, }, + { UAE_FILTER_HQ2X, 0, 2, _T("hq2x"), _T("hq2x"), UAE_FILTER_MODE_16_16 | UAE_FILTER_MODE_16_32, }, - { UAE_FILTER_HQ3X, 0, 3, L"hq3x", L"hq3x", UAE_FILTER_MODE_16_16 | UAE_FILTER_MODE_16_32 }, + { UAE_FILTER_HQ3X, 0, 3, _T("hq3x"), _T("hq3x"), UAE_FILTER_MODE_16_16 | UAE_FILTER_MODE_16_32 }, - { UAE_FILTER_HQ4X, 0, 4, L"hq4x", L"hq4x", UAE_FILTER_MODE_16_16 | UAE_FILTER_MODE_16_32 }, + { UAE_FILTER_HQ4X, 0, 4, _T("hq4x"), _T("hq4x"), UAE_FILTER_MODE_16_16 | UAE_FILTER_MODE_16_32 }, - { UAE_FILTER_SUPEREAGLE, 0, 2, L"SuperEagle", L"supereagle", UAE_FILTER_MODE_16_16 | UAE_FILTER_MODE_16_32 }, + { UAE_FILTER_SUPEREAGLE, 0, 2, _T("SuperEagle"), _T("supereagle"), UAE_FILTER_MODE_16_16 | UAE_FILTER_MODE_16_32 }, - { UAE_FILTER_SUPER2XSAI, 0, 2, L"Super2xSaI", L"super2xsai", UAE_FILTER_MODE_16_16 | UAE_FILTER_MODE_16_32 }, + { UAE_FILTER_SUPER2XSAI, 0, 2, _T("Super2xSaI"), _T("super2xsai"), UAE_FILTER_MODE_16_16 | UAE_FILTER_MODE_16_32 }, - { UAE_FILTER_2XSAI, 0, 2, L"2xSaI", L"2xsai", UAE_FILTER_MODE_16_16 | UAE_FILTER_MODE_16_32 }, + { UAE_FILTER_2XSAI, 0, 2, _T("2xSaI"), _T("2xsai"), UAE_FILTER_MODE_16_16 | UAE_FILTER_MODE_16_32 }, - { UAE_FILTER_PAL, 1, 1, L"PAL", L"pal", UAE_FILTER_MODE_16_16 | UAE_FILTER_MODE_32_32 }, + { UAE_FILTER_PAL, 1, 1, _T("PAL"), _T("pal"), UAE_FILTER_MODE_16_16 | UAE_FILTER_MODE_32_32 }, { 0 } }; @@ -236,7 +236,7 @@ void getfilterrect2 (RECT *sr, RECT *dr, RECT *zr, int dst_width, int dst_height ahs2 = vblscale (ah) * scale; aws = aw * scale; ahs = ah * scale; - //write_log (L"%d %d %d\n", dst_width, temp_width, aws); + //write_log (_T("%d %d %d\n"), dst_width, temp_width, aws); extraw = -aws * (filter_horiz_zoom - currprefs.gfx_filteroverlay_overscan * 10) / 2000; extrah = -ahs * (filter_vert_zoom - currprefs.gfx_filteroverlay_overscan * 10) / 2000; @@ -325,7 +325,7 @@ void getfilterrect2 (RECT *sr, RECT *dr, RECT *zr, int dst_width, int dst_height maxw = (maxw + mult - 1) / mult; maxh = (maxh + mult - 1) / mult; } - //write_log(L"(%dx%d) (%dx%d) ww=%d hh=%d w=%d h=%d m=%d\n", cx, cy, cw, ch, currprefs.gfx_size.width, currprefs.gfx_size.height, maxw, maxh, mult); + //write_log(_T("(%dx%d) (%dx%d) ww=%d hh=%d w=%d h=%d m=%d\n"), cx, cy, cw, ch, currprefs.gfx_size.width, currprefs.gfx_size.height, maxw, maxh, mult); cx -= (maxw - cw) / 2; cw = maxw; cy -= (maxh - ch) / 2; @@ -340,11 +340,11 @@ void getfilterrect2 (RECT *sr, RECT *dr, RECT *zr, int dst_width, int dst_height filter_vert_offset = 0; get_custom_topedge (&cx, &cy); - //write_log (L"%dx%d %dx%d\n", cx, cy, currprefs.gfx_resolution, currprefs.gfx_vresolution); + //write_log (_T("%dx%d %dx%d\n"), cx, cy, currprefs.gfx_resolution, currprefs.gfx_vresolution); getmanualpos (&cx, &cy, &cw, &ch); - //write_log (L"%dx%d %dx%d %dx%d\n", currprefs.gfx_xcenter_pos, currprefs.gfx_ycenter_pos, cx, cy, cw, ch); + //write_log (_T("%dx%d %dx%d %dx%d\n"), currprefs.gfx_xcenter_pos, currprefs.gfx_ycenter_pos, cx, cy, cw, ch); cv = 1; @@ -630,7 +630,7 @@ void getfilterrect2 (RECT *sr, RECT *dr, RECT *zr, int dst_width, int dst_height ahs2 = vblscale (ah) * scale; aws = aw * scale; ahs = ah * scale; - //write_log (L"%d %d %d\n", dst_width, temp_width, aws); + //write_log (_T("%d %d %d\n"), dst_width, temp_width, aws); extraw = -aws * (filter_horiz_zoom - currprefs.gfx_filteroverlay_overscan * 10) / 2000; extrah = -ahs * (filter_vert_zoom - currprefs.gfx_filteroverlay_overscan * 10) / 2000; @@ -734,7 +734,7 @@ void getfilterrect2 (RECT *sr, RECT *dr, RECT *zr, int dst_width, int dst_height maxw = (maxw + mult - 1) / mult; maxh = (maxh + mult - 1) / mult; } - //write_log(L"(%dx%d) (%dx%d) ww=%d hh=%d w=%d h=%d m=%d\n", cx, cy, cw, ch, currprefs.gfx_size.width, currprefs.gfx_size.height, maxw, maxh, mult); + //write_log(_T("(%dx%d) (%dx%d) ww=%d hh=%d w=%d h=%d m=%d\n"), cx, cy, cw, ch, currprefs.gfx_size.width, currprefs.gfx_size.height, maxw, maxh, mult); cx -= (maxw - cw) / 2; cw = maxw; cy -= (maxh - ch) / 2; @@ -749,11 +749,11 @@ void getfilterrect2 (RECT *sr, RECT *dr, RECT *zr, int dst_width, int dst_height filter_vert_offset = 0; get_custom_topedge (&cx, &cy); - //write_log (L"%dx%d %dx%d\n", cx, cy, currprefs.gfx_resolution, currprefs.gfx_vresolution); + //write_log (_T("%dx%d %dx%d\n"), cx, cy, currprefs.gfx_resolution, currprefs.gfx_vresolution); getmanualpos (&cx, &cy, &cw, &ch); - //write_log (L"%dx%d %dx%d %dx%d\n", currprefs.gfx_xcenter_pos, currprefs.gfx_ycenter_pos, cx, cy, cw, ch); + //write_log (_T("%dx%d %dx%d %dx%d\n"), currprefs.gfx_xcenter_pos, currprefs.gfx_ycenter_pos, cx, cy, cw, ch); cv = 1; @@ -1187,7 +1187,7 @@ void S2X_init (int dw, int dh, int dd) tempsurf = allocsurface (temp_width, temp_height); } if (!tempsurf && !d3d) - write_log (L"DDRAW: failed to create temp surface (%dx%d)\n", temp_width, temp_height); + write_log (_T("DDRAW: failed to create temp surface (%dx%d)\n"), temp_width, temp_height); inited = true; } @@ -1368,7 +1368,7 @@ end: unlocksurface (tempsurf); getfilterrect2 (&dr, &sr, &zr, dst_width, dst_height, aw, ah, scale, temp_width, temp_height); - //write_log (L"(%d %d %d %d) - (%d %d %d %d) (%d %d)\n", dr.left, dr.top, dr.right, dr.bottom, sr.left, sr.top, sr.right, sr.bottom, zr.left, zr.top); + //write_log (_T("(%d %d %d %d) - (%d %d %d %d) (%d %d)\n"), dr.left, dr.top, dr.right, dr.bottom, sr.left, sr.top, sr.right, sr.bottom, zr.left, zr.top); OffsetRect (&sr, zr.left, zr.top); if (sr.left < 0) sr.left = 0; diff --git a/od-win32/win32_uaenet.cpp b/od-win32/win32_uaenet.cpp index 4eb70591..53c68a2b 100644 --- a/od-win32/win32_uaenet.cpp +++ b/od-win32/win32_uaenet.cpp @@ -160,7 +160,7 @@ static void *uaenet_trap_threadr (void *arg) uae_sem_post (&sd->change_sem); } if (r < 0) { - write_log (L"pcap_next_ex failed, err=%d\n", r); + write_log (_T("pcap_next_ex failed, err=%d\n"), r); break; } } @@ -211,7 +211,7 @@ int uaenet_open (void *vsd, struct netdriverdata *tc, void *user, uaenet_gotfunc xfree (s); if (sd->fp == NULL) { TCHAR *ss = au (sd->errbuf); - write_log (L"'%s' failed to open: %s\n", tc->name, ss); + write_log (_T("'%s' failed to open: %s\n"), tc->name, ss); xfree (ss); return 0; } @@ -229,12 +229,12 @@ int uaenet_open (void *vsd, struct netdriverdata *tc, void *user, uaenet_gotfunc uae_sem_init (&sd->change_sem, 0, 1); uae_sem_init (&sd->sync_semr, 0, 0); - uae_start_thread (L"uaenet_win32r", uaenet_trap_threadr, sd, &sd->tidr); + uae_start_thread (_T("uaenet_win32r"), uaenet_trap_threadr, sd, &sd->tidr); uae_sem_wait (&sd->sync_semr); uae_sem_init (&sd->sync_semw, 0, 0); - uae_start_thread (L"uaenet_win32w", uaenet_trap_threadw, sd, &sd->tidw); + uae_start_thread (_T("uaenet_win32w"), uaenet_trap_threadw, sd, &sd->tidw); uae_sem_wait (&sd->sync_semw); - write_log (L"uaenet_win32 initialized\n"); + write_log (_T("uaenet_win32 initialized\n")); return 1; end: @@ -257,14 +257,14 @@ void uaenet_close (void *vsd) if (sd->threadactiver) { while (sd->threadactiver) Sleep(10); - write_log (L"uaenet_win32 thread %d killed\n", sd->tidr); + write_log (_T("uaenet_win32 thread %d killed\n"), sd->tidr); uae_end_thread (&sd->tidr); } if (sd->threadactivew) { while (sd->threadactivew) Sleep(10); CloseHandle (sd->evttw); - write_log (L"uaenet_win32 thread %d killed\n", sd->tidw); + write_log (_T("uaenet_win32 thread %d killed\n"), sd->tidw); uae_end_thread (&sd->tidw); } xfree (sd->readbuffer); @@ -272,7 +272,7 @@ void uaenet_close (void *vsd) if (sd->fp) pcap_close (sd->fp); uaeser_initdata (sd, sd->user); - write_log (L"uaenet_win32 closed\n"); + write_log (_T("uaenet_win32 closed\n")); } void uaenet_enumerate_free (struct netdriverdata *tcp) @@ -296,7 +296,7 @@ static struct netdriverdata *enumit (const TCHAR *name) for (cnt = 0; cnt < MAX_TOTAL_NET_DEVICES; cnt++) { TCHAR mac[20]; struct netdriverdata *tc = tds + cnt; - _stprintf (mac, L"%02X:%02X:%02X:%02X:%02X:%02X", + _stprintf (mac, _T("%02X:%02X:%02X:%02X:%02X:%02X"), tc->mac[0], tc->mac[1], tc->mac[2], tc->mac[3], tc->mac[4], tc->mac[5]); if (tc->active && name && (!_tcsicmp (name, tc->name) || !_tcsicmp (name, mac))) return tc; @@ -324,59 +324,59 @@ struct netdriverdata *uaenet_enumerate (struct netdriverdata **out, const TCHAR return enumit (name); } tcp = tds; - hm = LoadLibrary (L"wpcap.dll"); + hm = LoadLibrary (_T("wpcap.dll")); if (hm == NULL) { - write_log (L"uaenet: winpcap not installed (wpcap.dll)\n"); + write_log (_T("uaenet: winpcap not installed (wpcap.dll)\n")); return NULL; } FreeLibrary (hm); - hm = LoadLibrary (L"packet.dll"); + hm = LoadLibrary (_T("packet.dll")); if (hm == NULL) { - write_log (L"uaenet: winpcap not installed (packet.dll)\n"); + write_log (_T("uaenet: winpcap not installed (packet.dll)\n")); return NULL; } FreeLibrary (hm); - if (!isdllversion (L"wpcap.dll", 4, 0, 0, 0)) { - write_log (L"uaenet: too old winpcap, v4 or newer required\n"); + if (!isdllversion (_T("wpcap.dll"), 4, 0, 0, 0)) { + write_log (_T("uaenet: too old winpcap, v4 or newer required\n")); return NULL; } ss = au (pcap_lib_version ()); if (!done) - write_log (L"uaenet: %s\n", ss); + write_log (_T("uaenet: %s\n"), ss); xfree (ss); if (pcap_findalldevs_ex (PCAP_SRC_IF_STRING, NULL, &alldevs, errbuf) == -1) { ss = au (errbuf); - write_log (L"uaenet: failed to get interfaces: %s\n", ss); + write_log (_T("uaenet: failed to get interfaces: %s\n"), ss); xfree (ss); return NULL; } if (!done) - write_log (L"uaenet: detecting interfaces\n"); + write_log (_T("uaenet: detecting interfaces\n")); for(cnt = 0, d = alldevs; d != NULL; d = d->next) { char *n2; TCHAR *ss2; tc = tcp + cnt; if (cnt >= MAX_TOTAL_NET_DEVICES) { - write_log (L"buffer overflow\n"); + write_log (_T("buffer overflow\n")); break; } ss = au (d->name); - ss2 = d->description ? au (d->description) : L"(no description)"; - write_log (L"%s\n- %s\n", ss, ss2); + ss2 = d->description ? au (d->description) : _T("(no description)"); + write_log (_T("%s\n- %s\n"), ss, ss2); xfree (ss2); xfree (ss); n2 = d->name; if (strlen (n2) <= strlen (PCAP_SRC_IF_STRING)) { - write_log (L"- corrupt name\n"); + write_log (_T("- corrupt name\n")); continue; } fp = pcap_open (d->name, 65536, 0, 0, NULL, errbuf); if (!fp) { ss = au (errbuf); - write_log (L"- pcap_open() failed: %s\n", ss); + write_log (_T("- pcap_open() failed: %s\n"), ss); xfree (ss); continue; } @@ -384,14 +384,14 @@ struct netdriverdata *uaenet_enumerate (struct netdriverdata **out, const TCHAR pcap_close (fp); if (val != DLT_EN10MB) { if (!done) - write_log (L"- not an ethernet adapter (%d)\n", val); + write_log (_T("- not an ethernet adapter (%d)\n"), val); continue; } lpAdapter = PacketOpenAdapter (n2 + strlen (PCAP_SRC_IF_STRING)); if (lpAdapter == NULL) { if (!done) - write_log (L"- PacketOpenAdapter() failed\n"); + write_log (_T("- PacketOpenAdapter() failed\n")); continue; } OidData = (PPACKET_OID_DATA)xcalloc (uae_u8, 6 + sizeof(PACKET_OID_DATA)); @@ -401,7 +401,7 @@ struct netdriverdata *uaenet_enumerate (struct netdriverdata **out, const TCHAR if (PacketRequest (lpAdapter, FALSE, OidData)) { memcpy (tc->mac, OidData->Data, 6); if (!done) - write_log (L"- MAC %02X:%02X:%02X:%02X:%02X:%02X (%d)\n", + write_log (_T("- MAC %02X:%02X:%02X:%02X:%02X:%02X (%d)\n"), tc->mac[0], tc->mac[1], tc->mac[2], tc->mac[3], tc->mac[4], tc->mac[5], cnt++); tc->active = 1; @@ -409,14 +409,14 @@ struct netdriverdata *uaenet_enumerate (struct netdriverdata **out, const TCHAR tc->name = au (d->name); tc->desc = au (d->description); } else { - write_log (L" - failed to get MAC\n"); + write_log (_T(" - failed to get MAC\n")); } xfree (OidData); } PacketCloseAdapter (lpAdapter); } if (!done) - write_log (L"uaenet: end of detection\n"); + write_log (_T("uaenet: end of detection\n")); done = 1; pcap_freealldevs (alldevs); enumerated = 1; diff --git a/od-win32/win32gfx.cpp b/od-win32/win32gfx.cpp index bfe53d1e..c02b6cf4 100644 --- a/od-win32/win32gfx.cpp +++ b/od-win32/win32gfx.cpp @@ -269,7 +269,7 @@ struct MultiDisplay *getdisplay (struct uae_prefs *p) i++; } if (i == 0) { - gui_message (L"no display adapters! Exiting"); + gui_message (_T("no display adapters! Exiting")); exit (0); } if (display >= i) @@ -404,17 +404,17 @@ static int set_ddraw_2 (void) } } if (got == FALSE) { - write_log (L"set_ddraw: refresh rate %d not supported\n", freq); + write_log (_T("set_ddraw: refresh rate %d not supported\n"), freq); freq = 0; } } - write_log (L"set_ddraw: trying %dx%d, bits=%d, refreshrate=%d\n", width, height, bits, freq); + write_log (_T("set_ddraw: trying %dx%d, bits=%d, refreshrate=%d\n"), width, height, bits, freq); ddrval = DirectDraw_SetDisplayMode (width, height, bits, freq); if (SUCCEEDED (ddrval)) break; olderr = ddrval; if (freq) { - write_log (L"set_ddraw: failed, trying without forced refresh rate\n"); + write_log (_T("set_ddraw: failed, trying without forced refresh rate\n")); DirectDraw_SetCooperativeLevel (hAmigaWnd, dxfullscreen, TRUE); ddrval = DirectDraw_SetDisplayMode (width, height, bits, 0); if (SUCCEEDED (ddrval)) @@ -433,7 +433,7 @@ static int set_ddraw_2 (void) goto oops; ddrval = DirectDraw_CreateMainSurface (width, height); if (FAILED(ddrval)) { - write_log (L"set_ddraw: couldn't CreateSurface() for primary because %s.\n", DXError (ddrval)); + write_log (_T("set_ddraw: couldn't CreateSurface() for primary because %s.\n"), DXError (ddrval)); goto oops; } ddrval = DirectDraw_SetClipper (hAmigaWnd); @@ -445,7 +445,7 @@ static int set_ddraw_2 (void) } } - write_log (L"set_ddraw: %dx%d@%d-bytes\n", width, height, bits); + write_log (_T("set_ddraw: %dx%d@%d-bytes\n"), width, height, bits); return 1; oops: return 0; @@ -515,9 +515,9 @@ static void addmode (struct MultiDisplay *md, DEVMODE *dm, int rawmode) md->DisplayModes[i].refresh[1] = 0; md->DisplayModes[i].colormodes = ct; md->DisplayModes[i + 1].depth = -1; - _stprintf (md->DisplayModes[i].name, L"%dx%d%s, %d-bit", + _stprintf (md->DisplayModes[i].name, _T("%dx%d%s, %d-bit"), md->DisplayModes[i].res.width, md->DisplayModes[i].res.height, - lace ? L"i" : L"", + lace ? _T("i") : _T(""), md->DisplayModes[i].depth * 8); } @@ -574,18 +574,18 @@ static void modesList (struct MultiDisplay *md) i = 0; while (md->DisplayModes[i].depth >= 0) { - write_log (L"%d: %s%s (", i, md->DisplayModes[i].rawmode ? L"!" : L"", md->DisplayModes[i].name); + write_log (_T("%d: %s%s ("), i, md->DisplayModes[i].rawmode ? _T("!") : _T(""), md->DisplayModes[i].name); j = 0; while (md->DisplayModes[i].refresh[j] > 0) { if (j > 0) - write_log (L","); + write_log (_T(",")); if (md->DisplayModes[i].refreshtype[j]) - write_log (L"!%d", md->DisplayModes[i].refresh[j]); + write_log (_T("!%d"), md->DisplayModes[i].refresh[j]); else - write_log (L"%d", md->DisplayModes[i].refresh[j]); + write_log (_T("%d"), md->DisplayModes[i].refresh[j]); j++; } - write_log (L")\n"); + write_log (_T(")\n")); i++; } } @@ -601,9 +601,9 @@ static BOOL CALLBACK monitorEnumProc (HMONITOR h, HDC hdc, LPRECT rect, LPARAM d TCHAR tmp[1000]; md->rect = lpmi.rcMonitor; if (md->rect.left == 0 && md->rect.top == 0) - _stprintf (tmp, L"%s (%d*%d)", md->monitorname, md->rect.right - md->rect.left, md->rect.bottom - md->rect.top); + _stprintf (tmp, _T("%s (%d*%d)"), md->monitorname, md->rect.right - md->rect.left, md->rect.bottom - md->rect.top); else - _stprintf (tmp, L"%s (%d*%d) [%d*%d]", md->monitorname, md->rect.right - md->rect.left, md->rect.bottom - md->rect.top, md->rect.left, md->rect.top); + _stprintf (tmp, _T("%s (%d*%d) [%d*%d]"), md->monitorname, md->rect.right - md->rect.left, md->rect.bottom - md->rect.top, md->rect.left, md->rect.top); xfree (md->fullname); md->fullname = my_strdup (tmp); return TRUE; @@ -674,7 +674,7 @@ void sortdisplays (void) b = GetDeviceCaps(hdc, BITSPIXEL) * GetDeviceCaps(hdc, PLANES); ReleaseDC (NULL, hdc); } - write_log (L"Desktop: W=%d H=%d B=%d. CXVS=%d CYVS=%d\n", w, h, b, + write_log (_T("Desktop: W=%d H=%d B=%d. CXVS=%d CYVS=%d\n"), w, h, b, GetSystemMetrics (SM_CXVIRTUALSCREEN), GetSystemMetrics (SM_CYVIRTUALSCREEN)); md1 = Displays; @@ -682,8 +682,8 @@ void sortdisplays (void) md1->DisplayModes = xmalloc (struct PicassoResolution, MAX_PICASSO_MODES); md1->DisplayModes[0].depth = -1; - write_log (L"%s [%s]\n", md1->adaptername, md1->monitorname); - write_log (L"-: %d*%d [%d*%d]\n", md1->rect.right - md1->rect.left, md1->rect.bottom - md1->rect.top, md1->rect.left, md1->rect.top); + write_log (_T("%s [%s]\n"), md1->adaptername, md1->monitorname); + write_log (_T("-: %d*%d [%d*%d]\n"), md1->rect.right - md1->rect.left, md1->rect.bottom - md1->rect.top, md1->rect.left, md1->rect.top); for (int mode = 0; mode < 2; mode++) { DEVMODE dm; dm.dmSize = sizeof dm; @@ -707,7 +707,7 @@ void sortdisplays (void) if (!found && dm.dmBitsPerPel > 8) { int freq = 0; #if 0 - write_log (L"EnumDisplaySettings(%dx%dx%d %dHz %08x)\n", + write_log (_T("EnumDisplaySettings(%dx%dx%d %dHz %08x)\n"), dm.dmPelsWidth, dm.dmPelsHeight, dm.dmBitsPerPel, dm.dmDisplayFrequency, dm.dmFields); #endif if ((dm.dmFields & DM_PELSWIDTH) && (dm.dmFields & DM_PELSHEIGHT) && (dm.dmFields & DM_BITSPERPEL)) { @@ -723,7 +723,7 @@ void sortdisplays (void) i = 0; while (md1->DisplayModes[i].depth > 0) i++; - write_log (L"%d display modes.\n", i); + write_log (_T("%d display modes.\n"), i); md1++; } } @@ -1126,7 +1126,7 @@ static uae_u8 *gfx_lock_picasso2 (bool fullupdate) uae_u8 *gfx_lock_picasso (bool fullupdate, bool doclear) { if (rtg_locked) { - write_log (L"rtg already locked!\n"); + write_log (_T("rtg already locked!\n")); abort (); } EnterCriticalSection (&screen_cs); @@ -1780,7 +1780,7 @@ int picasso_palette (void) | doMask256 (b, blue_bits, blue_shift)) | doMask256 (0xff, alpha_bits, alpha_shift); if (v != picasso_vidinfo.clut[i]) { - //write_log (L"%d:%08x\n", i, v); + //write_log (_T("%d:%08x\n"), i, v); picasso_vidinfo.clut[i] = v; changed = 1; } @@ -1917,7 +1917,7 @@ bool vsync_switchmode (int hz) if (currprefs.gfx_apmode[0].gfx_vsync != changed_prefs.gfx_apmode[0].gfx_vsync) { config_changed = 1; } - write_log (L"refresh rate changed to %d but no matching screenmode found, vsync disabled\n", hz); + write_log (_T("refresh rate changed to %d but no matching screenmode found, vsync disabled\n"), hz); return false; } else { newh = found->res.height; @@ -1925,7 +1925,7 @@ bool vsync_switchmode (int hz) changed_prefs.gfx_apmode[0].gfx_refreshrate = hz; if (changed_prefs.gfx_size_fs.height != currprefs.gfx_size_fs.height || changed_prefs.gfx_apmode[0].gfx_refreshrate != currprefs.gfx_apmode[0].gfx_refreshrate) { - write_log (L"refresh rate changed to %d, new screenmode %dx%d\n", hz, w, newh); + write_log (_T("refresh rate changed to %d, new screenmode %dx%d\n"), hz, w, newh); config_changed = 1; } return true; @@ -2240,7 +2240,7 @@ static int createnotification (HWND hwnd) if(!hDevNotify) { - write_log (L"RegisterDeviceNotification failed: %d\n", GetLastError()); + write_log (_T("RegisterDeviceNotification failed: %d\n"), GetLastError()); return FALSE; } @@ -2275,7 +2275,7 @@ static int getbestmode (int nextbest) struct PicassoResolution *pr = &md->DisplayModes[i]; int r = pr->res.width > pr->res.height ? 1 : 0; if (pr->res.width >= currentmode->native_width && pr->res.height >= currentmode->native_height && r == ratio) { - write_log (L"FS: %dx%d -> %dx%d (%d)\n", currentmode->native_width, currentmode->native_height, + write_log (_T("FS: %dx%d -> %dx%d (%d)\n"), currentmode->native_width, currentmode->native_height, pr->res.width, pr->res.height, ratio); currentmode->native_width = pr->res.width; currentmode->native_height = pr->res.height; @@ -2290,7 +2290,7 @@ static int getbestmode (int nextbest) struct PicassoResolution *pr = &md->DisplayModes[i]; int r = pr->res.width > pr->res.height ? 1 : 0; if (pr->res.width >= currentmode->native_width && pr->res.height >= currentmode->native_height) { - write_log (L"FS: %dx%d -> %dx%d\n", currentmode->native_width, currentmode->native_height, + write_log (_T("FS: %dx%d -> %dx%d\n"), currentmode->native_width, currentmode->native_height, pr->res.width, pr->res.height); currentmode->native_width = pr->res.width; currentmode->native_height = pr->res.height; @@ -2334,7 +2334,7 @@ static bool getvblankpos (int *vp) } #if 0 t = read_processor_time () - t; - write_log (L"(%d:%d)", t, sl); + write_log (_T("(%d:%d)"), t, sl); #endif prevvblankpos = sl; if (sl > maxscanline) @@ -2441,7 +2441,7 @@ static bool vblanklaceskip (void) { if (vblankbaselace_chipset >= 0 && vblankbaselace) { if ((vblankbaselace_chipset && !vblankthread_oddeven) || (!vblankbaselace_chipset && vblankthread_oddeven)) { - write_log (L"Interlaced frame type mismatch %d<>%d\n", vblankbaselace_chipset, vblankthread_oddeven); + write_log (_T("Interlaced frame type mismatch %d<>%d\n"), vblankbaselace_chipset, vblankthread_oddeven); return true; } } @@ -2507,7 +2507,7 @@ static unsigned int __stdcall vblankthread (void *dummy) } } vblank_found_rtg = true; - //write_log (L"%d\n", t - thread_vblank_time); + //write_log (_T("%d\n"), t - thread_vblank_time); thread_vblank_time = t; vblankthread_mode = VBLANKTH_ACTIVE_WAIT; } @@ -2543,7 +2543,7 @@ static void vsync_notvblank (void) if (!getvblankpos (&vp)) return; if (vp > 0) { - //write_log (L"%d ", vpos); + //write_log (_T("%d "), vpos); break; } vsync_sleep (true); @@ -2609,7 +2609,7 @@ bool vsync_busywait_do (int *freetime, bool lace, bool oddeven) } if (log_vsync) { - console_out_f(L"F:%8d M:%8d E:%8d %3d%% (%3d%%) %10d\r", frame_counted, frame_missed, frame_errors, frame_usage, frame_usage_avg, (t - vblank_prev_time) - vblankbasefull); + console_out_f(_T("F:%8d M:%8d E:%8d %3d%% (%3d%%) %10d\r"), frame_counted, frame_missed, frame_errors, frame_usage, frame_usage_avg, (t - vblank_prev_time) - vblankbasefull); } if (freetime) @@ -2777,13 +2777,13 @@ double vblank_calibrate (double approx_vblank, bool waitonly) if (cnt == 0) tfirst = tval; if (abs (tval - tfirst) > 1) { - write_log (L"Very unstable vsync! %.6f vs %.6f, retrying..\n", tval, tfirst); + write_log (_T("Very unstable vsync! %.6f vs %.6f, retrying..\n"), tval, tfirst); break; } tsum2 += tval; tcnt2++; if (abs (tval - tfirst) > 0.1) { - write_log (L"Unstable vsync! %.6f vs %.6f\n", tval, tfirst); + write_log (_T("Unstable vsync! %.6f vs %.6f\n"), tval, tfirst); break; } tsum += tval; @@ -2797,7 +2797,7 @@ double vblank_calibrate (double approx_vblank, bool waitonly) SetThreadPriority (th, oldpri); if (maxcnt >= maxtotal) { tsum = tsum2 / tcnt2; - write_log (L"Unstable vsync reporting, using average value\n"); + write_log (_T("Unstable vsync reporting, using average value\n")); } else { tsum /= total; } @@ -2820,8 +2820,8 @@ skip: vblankbasewait2 = (syncbase / tsum2) * 70 / 100; vblankbasewait3 = (syncbase / tsum2) * 90 / 100; vblankbaselace = lace; - write_log (L"VSync %s: %.6fHz/%.1f=%.6fHz. MinV=%d MaxV=%d%s Units=%d\n", - waitonly ? L"remembered" : L"calibrated", tsum, div, tsum2, minscanline, maxvpos, lace ? L"i" : L"", vblankbasefull); + write_log (_T("VSync %s: %.6fHz/%.1f=%.6fHz. MinV=%d MaxV=%d%s Units=%d\n"), + waitonly ? _T("remembered") : _T("calibrated"), tsum, div, tsum2, minscanline, maxvpos, lace ? _T("i") : _T(""), vblankbasefull); remembered_vblank = tsum; vblank_prev_time = read_processor_time (); @@ -2849,7 +2849,7 @@ skip: vblank_reset (tsum); return tsum; fail: - write_log (L"VSync calibration failed\n"); + write_log (_T("VSync calibration failed\n")); ap->gfx_vsync = 0; return -1; } @@ -2939,7 +2939,7 @@ static int create_windows_2 (void) GetWindowRect (hMainWnd, &mainwin_rect); if (d3dfs || dxfs) SetCursorPos (x + w / 2, y + h / 2); - write_log (L"window already open\n"); + write_log (_T("window already open\n")); #ifdef RETROPLATFORM rp_set_hwnd (hAmigaWnd); #endif @@ -2961,8 +2961,8 @@ static int create_windows_2 (void) int oldx, oldy; int first = 2; - regqueryint (NULL, L"MainPosX", &stored_x); - regqueryint (NULL, L"MainPosY", &stored_y); + regqueryint (NULL, _T("MainPosX"), &stored_x); + regqueryint (NULL, _T("MainPosY"), &stored_y); while (first) { first--; @@ -2991,7 +2991,7 @@ static int create_windows_2 (void) win_y_diff = rc.top - oldy; if (MonitorFromRect (&rc, MONITOR_DEFAULTTONULL) == NULL) { - write_log (L"window coordinates are not visible on any monitor, reseting..\n"); + write_log (_T("window coordinates are not visible on any monitor, reseting..\n")); stored_x = stored_y = 0; continue; } @@ -3010,13 +3010,13 @@ static int create_windows_2 (void) if (!borderless) { RECT rc2; hMainWnd = CreateWindowEx (WS_EX_ACCEPTFILES | exstyle | flags, - L"PCsuxRox", L"WinUAE", + _T("PCsuxRox"), _T("WinUAE"), style, rc.left, rc.top, rc.right - rc.left + 1, rc.bottom - rc.top + 1, NULL, NULL, hInst, NULL); if (!hMainWnd) { - write_log (L"main window creation failed\n"); + write_log (_T("main window creation failed\n")); return 0; } GetWindowRect (hMainWnd, &rc2); @@ -3051,21 +3051,21 @@ static int create_windows_2 (void) if (rp_isactive () && !dxfs && !d3dfs && !fsw) { HWND parent = rp_getparent (); hAmigaWnd = CreateWindowEx (dxfs || d3dfs ? WS_EX_ACCEPTFILES | WS_EX_TOPMOST : WS_EX_ACCEPTFILES | WS_EX_TOOLWINDOW | (currprefs.win32_alwaysontop ? WS_EX_TOPMOST : 0), - L"AmigaPowah", L"WinUAE", + _T("AmigaPowah"), _T("WinUAE"), WS_POPUP, x, y, w, h, parent, NULL, hInst, NULL); } else { hAmigaWnd = CreateWindowEx ( ((dxfs || d3dfs || currprefs.win32_alwaysontop) ? WS_EX_TOPMOST : WS_EX_ACCEPTFILES) | exstyle, - L"AmigaPowah", L"WinUAE", + _T("AmigaPowah"), _T("WinUAE"), ((dxfs || d3dfs || currprefs.headless) ? WS_POPUP : (WS_CLIPCHILDREN | WS_CLIPSIBLINGS | (hMainWnd ? WS_VISIBLE | WS_CHILD : WS_VISIBLE | WS_POPUP | WS_SYSMENU | WS_MINIMIZEBOX))), x, y, w, h, borderless ? NULL : (hMainWnd ? hMainWnd : NULL), NULL, hInst, NULL); } if (!hAmigaWnd) { - write_log (L"creation of amiga window failed\n"); + write_log (_T("creation of amiga window failed\n")); close_hwnds (); return 0; } diff --git a/od-win32/win32gui.cpp b/od-win32/win32gui.cpp index 5405bdcb..4a182cdd 100644 --- a/od-win32/win32gui.cpp +++ b/od-win32/win32gui.cpp @@ -91,17 +91,17 @@ #include "rp.h" #endif -#define ARCHIVE_STRING L"*.zip;*.7z;*.rar;*.lha;*.lzh;*.lzx" - -#define DISK_FORMAT_STRING L"(*.adf;*.adz;*.gz;*.dms;*.fdi;*.ipf;*.exe)\0*.adf;*.adz;*.gz;*.dms;*.fdi;*.ipf;*.exe;*.ima;*.wrp;*.dsq;*.st;" ARCHIVE_STRING L"\0" -#define ROM_FORMAT_STRING L"(*.rom;*.roz)\0*.rom;*.roz;" ARCHIVE_STRING L"\0" -#define USS_FORMAT_STRING_RESTORE L"(*.uss)\0*.uss;*.gz;" ARCHIVE_STRING L"\0" -#define USS_FORMAT_STRING_SAVE L"(*.uss)\0*.uss\0" -#define HDF_FORMAT_STRING L"(*.hdf;*.vhd;*.rdf;*.hdz;*.rdz)\0*.hdf;*.vhd;*.rdf;*.hdz;*.rdz\0" -#define INP_FORMAT_STRING L"(*.inp)\0*.inp\0" -#define CD_FORMAT_STRING L"(*.cue;*.ccd;*.mds;*.iso)\0*.cue;*.ccd;*.mds;*.iso;" ARCHIVE_STRING L"\0" -#define CONFIG_HOST L"Host" -#define CONFIG_HARDWARE L"Hardware" +#define ARCHIVE_STRING _T("*.zip;*.7z;*.rar;*.lha;*.lzh;*.lzx") + +#define DISK_FORMAT_STRING _T("(*.adf;*.adz;*.gz;*.dms;*.fdi;*.ipf;*.exe)\0*.adf;*.adz;*.gz;*.dms;*.fdi;*.ipf;*.exe;*.ima;*.wrp;*.dsq;*.st;") ARCHIVE_STRING _T("\0") +#define ROM_FORMAT_STRING _T("(*.rom;*.roz)\0*.rom;*.roz;") ARCHIVE_STRING _T("\0") +#define USS_FORMAT_STRING_RESTORE _T("(*.uss)\0*.uss;*.gz;") ARCHIVE_STRING _T("\0") +#define USS_FORMAT_STRING_SAVE _T("(*.uss)\0*.uss\0") +#define HDF_FORMAT_STRING _T("(*.hdf;*.vhd;*.rdf;*.hdz;*.rdz)\0*.hdf;*.vhd;*.rdf;*.hdz;*.rdz\0") +#define INP_FORMAT_STRING _T("(*.inp)\0*.inp\0") +#define CD_FORMAT_STRING _T("(*.cue;*.ccd;*.mds;*.iso)\0*.cue;*.ccd;*.mds;*.iso;") ARCHIVE_STRING _T("\0") +#define CONFIG_HOST _T("Host") +#define CONFIG_HARDWARE _T("Hardware") #define SOUND_BUFFER_MULTIPLIER 1024 @@ -130,10 +130,10 @@ extern TCHAR help_file[MAX_DPATH]; extern int mouseactive; -TCHAR config_filename[256] = L""; +TCHAR config_filename[256] = _T(""); static TCHAR stored_path[MAX_DPATH]; -#define Error(x) MessageBox (NULL, (x), L"WinUAE Error", MB_OK) +#define Error(x) MessageBox (NULL, (x), _T("WinUAE Error"), MB_OK) wstring WIN32GUI_LoadUIString (DWORD id) { @@ -306,7 +306,7 @@ static BOOL GetFileDialog (OPENFILENAME *opn, const GUID *guid, int mode) hr = -1; ret = 0; pSHCreateItemFromParsingName = (SHCREATEITEMFROMPARSINGNAME)GetProcAddress ( - GetModuleHandle (L"shell32.dll"), "SHCreateItemFromParsingName"); + GetModuleHandle (_T("shell32.dll")), "SHCreateItemFromParsingName"); if (pSHCreateItemFromParsingName) hr = CoCreateInstance (mode > 0 ? __uuidof(FileSaveDialog) : __uuidof(FileOpenDialog), NULL, @@ -494,7 +494,7 @@ static void write_disk_history2 (int type) TCHAR tmp[16]; UAEREG *fkey; - fkey = regcreatetree (NULL, type ? L"CDImageMRUList" : L"DiskImageMRUList"); + fkey = regcreatetree (NULL, type ? _T("CDImageMRUList") : _T("DiskImageMRUList")); if (fkey == NULL) return; j = 1; @@ -502,13 +502,13 @@ static void write_disk_history2 (int type) TCHAR *s = DISK_history_get (i, type); if (s == 0 || _tcslen (s) == 0) continue; - _stprintf (tmp, L"Image%02d", j); + _stprintf (tmp, _T("Image%02d"), j); regsetstr (fkey, tmp, s); j++; } while (j <= MAX_PREVIOUS_FLOPPIES) { - TCHAR *s = L""; - _stprintf (tmp, L"Image%02d", j); + TCHAR *s = _T(""); + _stprintf (tmp, _T("Image%02d"), j); regsetstr (fkey, tmp, s); j++; } @@ -540,7 +540,7 @@ UAEREG *read_disk_history (int type) UAEREG *fkey; TCHAR tmp[1000]; - fkey = regcreatetree (NULL, type ? L"CDImageMRUList" : L"DiskImageMRUList"); + fkey = regcreatetree (NULL, type ? _T("CDImageMRUList") : _T("DiskImageMRUList")); if (fkey == NULL || (regread & (1 << type))) return fkey; @@ -598,7 +598,7 @@ static void writefavoritepaths (int num, struct favitems *fitem) int i, idx; UAEREG *fkey; - fkey = regcreatetree (NULL, L"FavoritePaths"); + fkey = regcreatetree (NULL, _T("FavoritePaths")); if (fkey == NULL) return; idx = 0; @@ -610,8 +610,8 @@ static void writefavoritepaths (int num, struct favitems *fitem) if (!_tcscmp (fitem[i].value, fitem[i].path)) _tcscpy (str, fitem[i].value); else - _stprintf (str, L"%s \"%s\"", fitem[i].value, fitem[i].path); - _stprintf (key, L"PATH_ALL_%02d", idx + 1); + _stprintf (str, _T("%s \"%s\""), fitem[i].value, fitem[i].path); + _stprintf (key, _T("PATH_ALL_%02d"), idx + 1); idx++; regsetstr (fkey, key, str); xfree (fitem[i].value); @@ -619,7 +619,7 @@ static void writefavoritepaths (int num, struct favitems *fitem) } while (idx < MAXFAVORITES) { TCHAR key[100]; - _stprintf (key, L"PATH_ALL_%02d", idx + 1); + _stprintf (key, _T("PATH_ALL_%02d"), idx + 1); regdelete (fkey, key); idx++; } @@ -698,7 +698,7 @@ static void addeditmenu (HMENU menu, struct favitems *fitem) mii.fMask = MIIM_STRING | MIIM_ID; mii.fType = MFT_STRING; mii.fState = MFS_ENABLED; - mii.dwTypeData = L"Add New"; + mii.dwTypeData = _T("Add New"); mii.cch = _tcslen (mii.dwTypeData); mii.wID = 1000; InsertMenuItem (emenu, -1, TRUE, &mii); @@ -709,7 +709,7 @@ static void addeditmenu (HMENU menu, struct favitems *fitem) mii.fType = MFT_STRING; mii.fState = MFS_ENABLED; mii.wID = 1001 + i; - _stprintf (newpath, L"Remove '%s'", fitem[i].value); + _stprintf (newpath, _T("Remove '%s'"), fitem[i].value); mii.dwTypeData = newpath; mii.cch = _tcslen (mii.dwTypeData); InsertMenuItem (emenu, -1, TRUE, &mii); @@ -720,7 +720,7 @@ static void addeditmenu (HMENU menu, struct favitems *fitem) mii.fMask = MIIM_STRING | MIIM_SUBMENU; mii.fType = MFT_STRING; mii.fState = MFS_ENABLED; - mii.dwTypeData = L"Edit"; + mii.dwTypeData = _T("Edit"); mii.cch = _tcslen (mii.dwTypeData); mii.hSubMenu = emenu; InsertMenuItem (menu, -1, TRUE, &mii); @@ -757,7 +757,7 @@ static int popupmenu (HWND hwnd, struct favitems *items, int morefiles) mii.fType = MFT_STRING; mii.fState = MFS_ENABLED; mii.wID = 999; - mii.dwTypeData = L"[Directory scan]"; + mii.dwTypeData = _T("[Directory scan]"); mii.cch = _tcslen (mii.dwTypeData); InsertMenuItem (menu, -1, TRUE, &mii); got = 1; @@ -831,7 +831,7 @@ static int getdeepfavdiskimage (TCHAR *imgpath, struct favitems *fitem, int idx) if (my_existsdir (path)) break; } - static TCHAR notallowed[] = L"[]()_-#!{}=.,"; + static TCHAR notallowed[] = _T("[]()_-#!{}=.,"); for (int i = 0; i < _tcslen (notallowed); i++) { for (;;) { p = _tcsrchr (mask, notallowed[i]); @@ -844,7 +844,7 @@ static int getdeepfavdiskimage (TCHAR *imgpath, struct favitems *fitem, int idx) } while (mask[_tcslen (mask) - 1] == ' ') mask[_tcslen (mask) - 1] = 0; - _tcscat (mask, L"*.*"); + _tcscat (mask, _T("*.*")); myd = my_opendir (path, mask); int cnt = 0; while (cnt < 30) { @@ -852,7 +852,7 @@ static int getdeepfavdiskimage (TCHAR *imgpath, struct favitems *fitem, int idx) if (!my_readdir (myd, tmp)) break; _tcscpy (tmp2, path); - _tcscat (tmp2, L"\\"); + _tcscat (tmp2, _T("\\")); _tcscat (tmp2, tmp); fitem[idx].value = my_strdup (tmp2); fitem[idx].path = NULL; @@ -905,7 +905,7 @@ static TCHAR *favoritepopup (HWND hwnd, int drive) srcdrive = dstdrive = drive; for (;;) { - fkey = regcreatetree (NULL, L"FavoritePaths"); + fkey = regcreatetree (NULL, _T("FavoritePaths")); if (fkey == NULL) return NULL; idx = 0; @@ -954,7 +954,7 @@ static TCHAR *favoritepopup (HWND hwnd, int drive) for (i = 0; i < 4; i++) { if (workprefs.floppyslots[i].df[0] && srcdrive != i) { TCHAR tmp[100]; - _stprintf (tmp, L"[DF%c:]", i + '0'); + _stprintf (tmp, _T("[DF%c:]"), i + '0'); fitem[idx].value = my_strdup (tmp); fitem[idx].path = my_strdup (workprefs.floppyslots[i].df); fitem[idx].type = 3 + i; @@ -1179,7 +1179,7 @@ static struct romdata *scan_single_rom_2 (struct zfile *f) size = zfile_ftell (f); zfile_fseek (f, 0, SEEK_SET); if (size > 524288 * 2) {/* don't skip KICK disks or 1M ROMs */ - write_log (L"'%s': too big %d, ignored\n", zfile_getname(f), size); + write_log (_T("'%s': too big %d, ignored\n"), zfile_getname(f), size); return 0; } zfile_fread (buffer, 1, 11, f); @@ -1215,12 +1215,12 @@ static struct romdata *scan_single_rom_2 (struct zfile *f) } } if (!rd) { - write_log (L"!: Name='%s':%d\nCRC32=%08X SHA1=%s\n", + write_log (_T("!: Name='%s':%d\nCRC32=%08X SHA1=%s\n"), zfile_getname (f), size, get_crc32 (rombuf, size), get_sha1_txt (rombuf, size)); } else { TCHAR tmp[MAX_DPATH]; getromname (rd, tmp); - write_log (L"*: %s:%d = %s\nCRC32=%08X SHA1=%s\n", + write_log (_T("*: %s:%d = %s\nCRC32=%08X SHA1=%s\n"), zfile_getname (f), size, tmp, get_crc32 (rombuf, size), get_sha1_txt (rombuf, size)); } xfree (rombuf); @@ -1240,7 +1240,7 @@ static struct romdata *scan_single_rom (const TCHAR *path) rd = getromdatabypath (path); if (rd && rd->crc32 == 0xffffffff) return rd; - z = zfile_fopen (path, L"rb", ZFD_NORMAL); + z = zfile_fopen (path, _T("rb"), ZFD_NORMAL); if (!z) return 0; return scan_single_rom_2 (z); @@ -1256,10 +1256,10 @@ static int addrom (UAEREG *fkey, struct romdata *rd, const TCHAR *name) { TCHAR tmp1[MAX_DPATH], tmp2[MAX_DPATH]; - _stprintf (tmp1, L"ROM_%03d", rd->id); + _stprintf (tmp1, _T("ROM_%03d"), rd->id); if (rd->group) { TCHAR *p = tmp1 + _tcslen (tmp1); - _stprintf (p, L"_%02d_%02d", rd->group >> 16, rd->group & 65535); + _stprintf (p, _T("_%02d_%02d"), rd->group >> 16, rd->group & 65535); } if (regexists (fkey, tmp1)) return 0; @@ -1267,17 +1267,17 @@ static int addrom (UAEREG *fkey, struct romdata *rd, const TCHAR *name) if (name) { TCHAR name2[MAX_DPATH]; _tcscpy (name2, name); - _tcscat (tmp2, L" / \""); + _tcscat (tmp2, _T(" / \"")); if (getregmode ()) abspathtorelative (name2); _tcscat (tmp2, name2); - _tcscat (tmp2, L"\""); + _tcscat (tmp2, _T("\"")); } if (rd->crc32 == 0xffffffff) { if (rd->configname) - _stprintf (tmp2, L":%s", rd->configname); + _stprintf (tmp2, _T(":%s"), rd->configname); else - _stprintf (tmp2, L":ROM_%03d", rd->id); + _stprintf (tmp2, _T(":ROM_%03d"), rd->id); } if (!regsetstr (fkey, tmp1, tmp2)) return 0; @@ -1296,8 +1296,8 @@ static int isromext (const TCHAR *path, bool deepscan) return 0; ext++; - if (!_tcsicmp (ext, L"rom") || !_tcsicmp (ext, L"adf") || !_tcsicmp (ext, L"key") - || !_tcsicmp (ext, L"a500") || !_tcsicmp (ext, L"a1200") || !_tcsicmp (ext, L"a4000") || !_tcsicmp (ext, L"cd32")) + if (!_tcsicmp (ext, _T("rom")) || !_tcsicmp (ext, _T("adf")) || !_tcsicmp (ext, _T("key")) + || !_tcsicmp (ext, _T("a500")) || !_tcsicmp (ext, _T("a1200")) || !_tcsicmp (ext, _T("a4000")) || !_tcsicmp (ext, _T("cd32"))) return 1; if (_tcslen (ext) >= 2 && toupper(ext[0]) == 'U' && isdigit (ext[1])) return 1; @@ -1381,7 +1381,7 @@ static int scan_rom_2 (struct zfile *f, void *vrsd) { struct romscandata *rsd = (struct romscandata*)vrsd; const TCHAR *path = zfile_getname(f); - const TCHAR *romkey = L"rom.key"; + const TCHAR *romkey = _T("rom.key"); struct romdata *rd; scan_rom_hook (NULL, 0); @@ -1468,22 +1468,22 @@ static void show_rom_list (void) WIN32GUI_LoadUIString (IDS_ROM_AVAILABLE, avail, sizeof (avail) / sizeof (TCHAR)); WIN32GUI_LoadUIString (IDS_ROM_UNAVAILABLE, unavail, sizeof (avail) / sizeof (TCHAR)); - _tcscat (avail, L"\n"); - _tcscat (unavail, L"\n"); - p1 = L"A500 Boot ROM 1.2\0A500 Boot ROM 1.3\0A500+\0A600\0A1000\0A1200\0A3000\0A4000\0\nCD32\0CDTV\0Arcadia Multi Select\0High end WinUAE\0\nA590/A2091 SCSI Boot ROM\0\0"; + _tcscat (avail, _T("\n")); + _tcscat (unavail, _T("\n")); + p1 = _T("A500 Boot ROM 1.2\0A500 Boot ROM 1.3\0A500+\0A600\0A1000\0A1200\0A3000\0A4000\0\nCD32\0CDTV\0Arcadia Multi Select\0High end WinUAE\0\nA590/A2091 SCSI Boot ROM\0\0"); p = xmalloc (TCHAR, 100000); if (!p) return; WIN32GUI_LoadUIString (IDS_ROMSCANEND, p, 100); - _tcscat (p, L"\n\n"); + _tcscat (p, _T("\n\n")); rp = romtable; while(rp[0]) { int ok = 0; p2 = p1 + _tcslen (p1) + 1; - _tcscat (p, L" "); - _tcscat (p, p1); _tcscat (p, L": "); + _tcscat (p, _T(" ")); + _tcscat (p, p1); _tcscat (p, _T(": ")); if (listrom (rp)) ok = 1; while(*rp++ != -1); @@ -1514,9 +1514,9 @@ static int scan_roms_2 (UAEREG *fkey, const TCHAR *path, bool deepscan) if (!path) return 0; - write_log (L"ROM scan directory '%s'\n", path); + write_log (_T("ROM scan directory '%s'\n"), path); _tcscpy (buf, path); - _tcscat (buf, L"*.*"); + _tcscat (buf, _T("*.*")); ret = 0; handle = FindFirstFile (buf, &find_data); if (handle == INVALID_HANDLE_VALUE) @@ -1583,8 +1583,8 @@ int scan_roms (HWND hDlg, int show) return 0; recursive++; - regdeletetree (NULL, L"DetectedROMs"); - fkey = regcreatetree (NULL, L"DetectedROMs"); + regdeletetree (NULL, _T("DetectedROMs")); + fkey = regcreatetree (NULL, _T("DetectedROMs")); if (fkey == NULL) goto end; @@ -1604,7 +1604,7 @@ int scan_roms (HWND hDlg, int show) scan_rom_hook (NULL, 0); while (scan_rom_hook (NULL, 0)) { keys = get_keyring (); - fetch_path (L"KickstartPath", path, sizeof path / sizeof (TCHAR)); + fetch_path (_T("KickstartPath"), path, sizeof path / sizeof (TCHAR)); cnt += scan_roms_3 (fkey, paths, path); if (1) { static pathtype pt[] = { PATH_TYPE_DEFAULT, PATH_TYPE_WINUAE, PATH_TYPE_NEWWINUAE, PATH_TYPE_NEWAF, PATH_TYPE_AMIGAFOREVERDATA, PATH_TYPE_END }; @@ -1615,7 +1615,7 @@ int scan_roms (HWND hDlg, int show) cnt += scan_roms_3 (fkey, paths, path); } if (get_keyring() > keys) { /* more keys detected in previous scan? */ - write_log (L"ROM scan: more keys found, restarting..\n"); + write_log (_T("ROM scan: more keys found, restarting..\n")); for (i = 0; i < MAX_ROM_PATHS; i++) { xfree (paths[i]); paths[i] = NULL; @@ -1631,7 +1631,7 @@ int scan_roms (HWND hDlg, int show) for (i = 0; i < MAX_ROM_PATHS; i++) xfree (paths[i]); - fkey2 = regcreatetree (NULL, L"DetectedROMS"); + fkey2 = regcreatetree (NULL, _T("DetectedROMS")); if (fkey2) { id = 1; for (;;) { @@ -1678,8 +1678,8 @@ struct ConfigStruct { FILETIME t; }; -static TCHAR *configreg[] = { L"ConfigFile", L"ConfigFileHardware", L"ConfigFileHost" }; -static TCHAR *configreg2[] = { L"", L"ConfigFileHardware_Auto", L"ConfigFileHost_Auto" }; +static TCHAR *configreg[] = { _T("ConfigFile"), _T("ConfigFileHardware"), _T("ConfigFileHost") }; +static TCHAR *configreg2[] = { _T(""), _T("ConfigFileHardware_Auto"), _T("ConfigFileHost_Auto") }; static struct ConfigStruct **configstore; static int configstoresize, configstoreallocated, configtype, configtypepanel; @@ -1738,7 +1738,7 @@ int target_cfgfile_load (struct uae_prefs *p, const TCHAR *filename, int type, i #endif } - regqueryint (NULL, L"ConfigFile_NoAuto", &ct2); + regqueryint (NULL, _T("ConfigFile_NoAuto"), &ct2); v = cfgfile_load (p, fname, &type2, ct2, isdefault ? 0 : 1); if (!v) return v; @@ -1752,7 +1752,7 @@ int target_cfgfile_load (struct uae_prefs *p, const TCHAR *filename, int type, i if (ct && ((i == 1 && p->config_hardware_path[0] == 0) || (i == 2 && p->config_host_path[0] == 0) || ct2)) { size = sizeof (tmp1) / sizeof (TCHAR); regquerystr (NULL, configreg[i], tmp1, &size); - fetch_path (L"ConfigurationPath", tmp2, sizeof (tmp2) / sizeof (TCHAR)); + fetch_path (_T("ConfigurationPath"), tmp2, sizeof (tmp2) / sizeof (TCHAR)); _tcscat (tmp2, tmp1); v = i; cfgfile_load (p, tmp2, &v, 1, 0); @@ -1768,9 +1768,9 @@ static int gui_width = 640, gui_height = 480; static int mm = 0; static void m (void) { - write_log (L"%d:0: %dx%d %dx%d %dx%d\n", mm, currprefs.gfx_size.width, currprefs.gfx_size.height, + write_log (_T("%d:0: %dx%d %dx%d %dx%d\n"), mm, currprefs.gfx_size.width, currprefs.gfx_size.height, workprefs.gfx_size.width, workprefs.gfx_size.height, changed_prefs.gfx_size.width, changed_prefs.gfx_size.height); - write_log (L"%d:1: %dx%d %dx%d %dx%d\n", mm, currprefs.gfx_size_fs.width, currprefs.gfx_size_fs.height, + write_log (_T("%d:1: %dx%d %dx%d %dx%d\n"), mm, currprefs.gfx_size_fs.width, currprefs.gfx_size_fs.height, workprefs.gfx_size_fs.width, workprefs.gfx_size_fs.height, changed_prefs.gfx_size_fs.width, changed_prefs.gfx_size_fs.height); mm++; } @@ -1829,7 +1829,7 @@ void gui_display (int shortcut) DiskSelection (hAmigaWnd, IDC_DF0 + shortcut, 0, &changed_prefs, 0); } else if (shortcut == 5) { if (DiskSelection (hAmigaWnd, IDC_DOSAVESTATE, 9, &changed_prefs, 0)) - save_state (savestate_fname, L"Description!"); + save_state (savestate_fname, _T("Description!")); } else if (shortcut == 4) { if (DiskSelection (hAmigaWnd, IDC_DOLOADSTATE, 10, &changed_prefs, 0)) savestate_state = STATE_DORESTORE; @@ -1900,7 +1900,7 @@ static const GUID diskselectionguids[] = { static void getfilter (int num, TCHAR *name, int *filter, TCHAR *fname) { _tcscpy (fname, name); - _tcscat (fname, L"_Filter"); + _tcscat (fname, _T("_Filter")); regqueryint (NULL, fname, &filter[num]); } static void setfilter (int num, int *filter, TCHAR *fname) @@ -1919,7 +1919,7 @@ static UINT_PTR CALLBACK ofnhook (HWND hDlg, UINT message, WPARAM wParam, LPARAM if (message == WM_NOTIFY) { nmhdr = (LPNMHDR)lParam; if (nmhdr->code == CDN_INITDONE) { - write_log (L"OFNHOOK CDN_INITDONE\n"); + write_log (_T("OFNHOOK CDN_INITDONE\n")); PostMessage (hDlg, WM_USER + 1, 0, 0); // OFN_ENABLESIZING enabled: SetWindowPos() only works once here... } @@ -1927,19 +1927,19 @@ static UINT_PTR CALLBACK ofnhook (HWND hDlg, UINT message, WPARAM wParam, LPARAM } else if (message != WM_USER + 1) { return FALSE; } - write_log (L"OFNHOOK POST\n"); + write_log (_T("OFNHOOK POST\n")); hWnd = GetParent (hDlg); md = getdisplay (&currprefs); if (!md) return FALSE; w2 = WIN32GFX_GetWidth (); h2 = WIN32GFX_GetHeight (); - write_log (L"MOVEWINDOW %dx%d %dx%d (%dx%d)\n", md->rect.left, md->rect.top, md->rect.right, md->rect.bottom, w2, h2); + write_log (_T("MOVEWINDOW %dx%d %dx%d (%dx%d)\n"), md->rect.left, md->rect.top, md->rect.right, md->rect.bottom, w2, h2); windowRect.left = windowRect.right = windowRect.top = windowRect.bottom = -1; GetWindowRect (hWnd, &windowRect); width = windowRect.right - windowRect.left; height = windowRect.bottom - windowRect.top; - write_log (L"%dx%d %dx%d\n", windowRect.left, windowRect.top, windowRect.right, windowRect.bottom); + write_log (_T("%dx%d %dx%d\n"), windowRect.left, windowRect.top, windowRect.right, windowRect.bottom); if (width < 800) width = 800; if (height < 600) @@ -1950,7 +1950,7 @@ static UINT_PTR CALLBACK ofnhook (HWND hDlg, UINT message, WPARAM wParam, LPARAM height = h2; x = md->rect.left + (w2 - width) / 2; y = md->rect.top + (h2 - height) / 2; - write_log (L"X=%d Y=%d W=%d H=%d\n", x, y, width, height); + write_log (_T("X=%d Y=%d W=%d H=%d\n"), x, y, width, height); SetWindowPos (hWnd, NULL, x, y, width, height, SWP_NOZORDER | SWP_NOACTIVATE); return FALSE; } @@ -2026,12 +2026,12 @@ static void setdpath (const TCHAR *name, const TCHAR *path) int DiskSelection_2 (HWND hDlg, WPARAM wParam, int flag, struct uae_prefs *prefs, TCHAR *path_out, int *multi) { static int previousfilter[20]; - TCHAR filtername[MAX_DPATH] = L""; + TCHAR filtername[MAX_DPATH] = _T(""); OPENFILENAME openFileName; - TCHAR full_path[MAX_DPATH] = L""; + TCHAR full_path[MAX_DPATH] = _T(""); TCHAR full_path2[MAX_DPATH]; - TCHAR file_name[MAX_DPATH] = L""; - TCHAR init_path[MAX_DPATH] = L""; + TCHAR file_name[MAX_DPATH] = _T(""); + TCHAR init_path[MAX_DPATH] = _T(""); BOOL result = FALSE; TCHAR *amiga_path = NULL, *initialdir = NULL, *defext = NULL; TCHAR *p, *nextp; @@ -2055,28 +2055,28 @@ int DiskSelection_2 (HWND hDlg, WPARAM wParam, int flag, struct uae_prefs *prefs { case 0: case 1: - getfilter (flag, L"FloppyPath", previousfilter, filtername); - fetch_path (L"FloppyPath", init_path, sizeof (init_path) / sizeof (TCHAR)); + getfilter (flag, _T("FloppyPath"), previousfilter, filtername); + fetch_path (_T("FloppyPath"), init_path, sizeof (init_path) / sizeof (TCHAR)); guid = &diskselectionguids[0]; break; case 2: case 3: - getfilter (flag, L"hdfPath", previousfilter, filtername); - fetch_path (L"hdfPath", init_path, sizeof (init_path) / sizeof (TCHAR)); + getfilter (flag, _T("hdfPath"), previousfilter, filtername); + fetch_path (_T("hdfPath"), init_path, sizeof (init_path) / sizeof (TCHAR)); guid = &diskselectionguids[1]; break; case 6: case 7: case 11: - getfilter (flag, L"KickstartPath", previousfilter, filtername); - fetch_path (L"KickstartPath", init_path, sizeof (init_path) / sizeof (TCHAR)); + getfilter (flag, _T("KickstartPath"), previousfilter, filtername); + fetch_path (_T("KickstartPath"), init_path, sizeof (init_path) / sizeof (TCHAR)); guid = &diskselectionguids[2]; break; case 4: case 5: case 8: - getfilter (flag, L"ConfigurationPath", previousfilter, filtername); - fetch_path (L"ConfigurationPath", init_path, sizeof (init_path) / sizeof (TCHAR)); + getfilter (flag, _T("ConfigurationPath"), previousfilter, filtername); + fetch_path (_T("ConfigurationPath"), init_path, sizeof (init_path) / sizeof (TCHAR)); guid = &diskselectionguids[3]; break; case 9: @@ -2100,21 +2100,21 @@ int DiskSelection_2 (HWND hDlg, WPARAM wParam, int flag, struct uae_prefs *prefs } } if (!ok) { - getfilter(flag, L"StatefilePath", previousfilter, filtername); - fetch_path (L"StatefilePath", init_path, sizeof (init_path) / sizeof (TCHAR)); + getfilter(flag, _T("StatefilePath"), previousfilter, filtername); + fetch_path (_T("StatefilePath"), init_path, sizeof (init_path) / sizeof (TCHAR)); } guid = &diskselectionguids[4]; } break; case 15: case 16: - getfilter (flag, L"InputPath", previousfilter, filtername); - fetch_path (L"InputPath", init_path, sizeof (init_path) / sizeof (TCHAR)); + getfilter (flag, _T("InputPath"), previousfilter, filtername); + fetch_path (_T("InputPath"), init_path, sizeof (init_path) / sizeof (TCHAR)); guid = &diskselectionguids[5]; break; case 17: - getfilter (flag, L"CDPath", previousfilter, filtername); - fetch_path (L"CDPath", init_path, sizeof (init_path) / sizeof (TCHAR)); + getfilter (flag, _T("CDPath"), previousfilter, filtername); + fetch_path (_T("CDPath"), init_path, sizeof (init_path) / sizeof (TCHAR)); guid = &diskselectionguids[6]; break; } @@ -2126,60 +2126,60 @@ int DiskSelection_2 (HWND hDlg, WPARAM wParam, int flag, struct uae_prefs *prefs case 0: WIN32GUI_LoadUIString (IDS_SELECTADF, szTitle, MAX_DPATH); WIN32GUI_LoadUIString (IDS_ADF, szFormat, MAX_DPATH); - _stprintf (szFilter, L"%s ", szFormat); + _stprintf (szFilter, _T("%s "), szFormat); memcpy (szFilter + _tcslen (szFilter), DISK_FORMAT_STRING, sizeof (DISK_FORMAT_STRING) + sizeof (TCHAR)); - defext = L"adf"; + defext = _T("adf"); break; case 1: WIN32GUI_LoadUIString (IDS_CHOOSEBLANK, szTitle, MAX_DPATH); WIN32GUI_LoadUIString (IDS_ADF, szFormat, MAX_DPATH); - _stprintf (szFilter, L"%s ", szFormat); - memcpy (szFilter + _tcslen (szFilter), L"(*.adf)\0*.adf\0", 15 * sizeof (TCHAR)); - defext = L"adf"; + _stprintf (szFilter, _T("%s "), szFormat); + memcpy (szFilter + _tcslen (szFilter), _T("(*.adf)\0*.adf\0"), 15 * sizeof (TCHAR)); + defext = _T("adf"); break; case 2: case 3: WIN32GUI_LoadUIString (IDS_SELECTHDF, szTitle, MAX_DPATH); WIN32GUI_LoadUIString (IDS_HDF, szFormat, MAX_DPATH); - _stprintf (szFilter, L"%s ", szFormat); + _stprintf (szFilter, _T("%s "), szFormat); memcpy (szFilter + _tcslen (szFilter), HDF_FORMAT_STRING, sizeof (HDF_FORMAT_STRING) + sizeof (TCHAR)); - defext = L"hdf"; + defext = _T("hdf"); break; case 4: case 5: WIN32GUI_LoadUIString (IDS_SELECTUAE, szTitle, MAX_DPATH); WIN32GUI_LoadUIString (IDS_UAE, szFormat, MAX_DPATH ); - _stprintf (szFilter, L"%s ", szFormat); - memcpy (szFilter + _tcslen (szFilter), L"(*.uae)\0*.uae\0", 15 * sizeof (TCHAR)); - defext = L"uae"; + _stprintf (szFilter, _T("%s "), szFormat); + memcpy (szFilter + _tcslen (szFilter), _T("(*.uae)\0*.uae\0"), 15 * sizeof (TCHAR)); + defext = _T("uae"); break; case 6: WIN32GUI_LoadUIString (IDS_SELECTROM, szTitle, MAX_DPATH); WIN32GUI_LoadUIString (IDS_ROM, szFormat, MAX_DPATH); - _stprintf (szFilter, L"%s ", szFormat); + _stprintf (szFilter, _T("%s "), szFormat); memcpy (szFilter + _tcslen (szFilter), ROM_FORMAT_STRING, sizeof (ROM_FORMAT_STRING) + sizeof (TCHAR)); - defext = L"rom"; + defext = _T("rom"); break; case 7: WIN32GUI_LoadUIString (IDS_SELECTKEY, szTitle, MAX_DPATH); WIN32GUI_LoadUIString (IDS_KEY, szFormat, MAX_DPATH); - _stprintf (szFilter, L"%s ", szFormat); - memcpy (szFilter + _tcslen (szFilter), L"(*.key)\0*.key\0", 15 * sizeof (TCHAR)); - defext = L"key"; + _stprintf (szFilter, _T("%s "), szFormat); + memcpy (szFilter + _tcslen (szFilter), _T("(*.key)\0*.key\0"), 15 * sizeof (TCHAR)); + defext = _T("key"); break; case 15: case 16: WIN32GUI_LoadUIString (flag == 15 ? IDS_RESTOREINP : IDS_SAVEINP, szTitle, MAX_DPATH); WIN32GUI_LoadUIString (IDS_INP, szFormat, MAX_DPATH); - _stprintf (szFilter, L"%s ", szFormat); + _stprintf (szFilter, _T("%s "), szFormat); memcpy (szFilter + _tcslen (szFilter), INP_FORMAT_STRING, sizeof (INP_FORMAT_STRING) + sizeof (TCHAR)); - defext = L"inp"; + defext = _T("inp"); break; case 9: case 10: WIN32GUI_LoadUIString (flag == 10 ? IDS_RESTOREUSS : IDS_SAVEUSS, szTitle, MAX_DPATH); WIN32GUI_LoadUIString (IDS_USS, szFormat, MAX_DPATH); - _stprintf (szFilter, L"%s ", szFormat); + _stprintf (szFilter, _T("%s "), szFormat); if (flag == 10) { memcpy (szFilter + _tcslen (szFilter), USS_FORMAT_STRING_RESTORE, sizeof (USS_FORMAT_STRING_RESTORE) + sizeof (TCHAR)); all = 1; @@ -2191,33 +2191,33 @@ int DiskSelection_2 (HWND hDlg, WPARAM wParam, int flag, struct uae_prefs *prefs p++; WIN32GUI_LoadUIString (IDS_STATEFILE_UNCOMPRESSED, tmp, sizeof (tmp) / sizeof (TCHAR)); _tcscat (p, tmp); - _tcscat (p, L" (*.uss)"); + _tcscat (p, _T(" (*.uss)")); p += _tcslen (p) + 1; - _tcscpy (p, L"*.uss"); + _tcscpy (p, _T("*.uss")); p += _tcslen (p) + 1; WIN32GUI_LoadUIString (IDS_STATEFILE_RAMDUMP, tmp, sizeof (tmp) / sizeof (TCHAR)); _tcscat (p, tmp); - _tcscat (p, L" (*.dat)"); + _tcscat (p, _T(" (*.dat)")); p += _tcslen (p) + 1; - _tcscpy (p, L"*.dat"); + _tcscpy (p, _T("*.dat")); p += _tcslen (p) + 1; WIN32GUI_LoadUIString (IDS_STATEFILE_WAVE, tmp, sizeof (tmp) / sizeof (TCHAR)); _tcscat (p, tmp); - _tcscat (p, L" (*.wav)"); + _tcscat (p, _T(" (*.wav)")); p += _tcslen (p) + 1; - _tcscpy (p, L"*.wav"); + _tcscpy (p, _T("*.wav")); p += _tcslen (p) + 1; *p = 0; all = 0; } - defext = L"uss"; + defext = _T("uss"); break; case 11: WIN32GUI_LoadUIString (IDS_SELECTFLASH, szTitle, MAX_DPATH); WIN32GUI_LoadUIString (IDS_FLASH, szFormat, MAX_DPATH); - _stprintf (szFilter, L"%s ", szFormat); - memcpy (szFilter + _tcslen (szFilter), L"(*.nvr)\0*.nvr\0", 15 * sizeof (TCHAR)); - defext = L"nvr"; + _stprintf (szFilter, _T("%s "), szFormat); + memcpy (szFilter + _tcslen (szFilter), _T("(*.nvr)\0*.nvr\0"), 15 * sizeof (TCHAR)); + defext = _T("nvr"); break; case 8: default: @@ -2232,26 +2232,26 @@ int DiskSelection_2 (HWND hDlg, WPARAM wParam, int flag, struct uae_prefs *prefs initialdir = path_out; break; case 14: - _tcscpy (szTitle, L"Select supported archive file"); - _stprintf (szFilter, L"%s (%s)", L"Archive", ARCHIVE_STRING); + _tcscpy (szTitle, _T("Select supported archive file")); + _stprintf (szFilter, _T("%s (%s)"), _T("Archive"), ARCHIVE_STRING); _tcscpy (szFilter + _tcslen (szFilter) + 1, ARCHIVE_STRING); initialdir = path_out; break; case 17: WIN32GUI_LoadUIString (IDS_SELECTCD, szTitle, MAX_DPATH); WIN32GUI_LoadUIString (IDS_CD, szFormat, MAX_DPATH); - _stprintf (szFilter, L"%s ", szFormat); + _stprintf (szFilter, _T("%s "), szFormat); memcpy (szFilter + _tcslen (szFilter), CD_FORMAT_STRING, sizeof (CD_FORMAT_STRING) + sizeof (TCHAR)); - defext = L"cue"; + defext = _T("cue"); break; } if (all) { p = szFilter; while (p[0] != 0 || p[1] !=0) p++; p++; - _tcscpy (p, L"All files (*.*)"); + _tcscpy (p, _T("All files (*.*)")); p += _tcslen (p) + 1; - _tcscpy (p, L"*.*"); + _tcscpy (p, _T("*.*")); p += _tcslen (p) + 1; *p = 0; } @@ -2277,10 +2277,10 @@ int DiskSelection_2 (HWND hDlg, WPARAM wParam, int flag, struct uae_prefs *prefs openFileName.Flags |= OFN_ALLOWMULTISELECT; if (flag == 1 || flag == 3 || flag == 5 || flag == 9 || flag == 16) { if (!(result = GetSaveFileName_2 (hDlg, &openFileName, guid))) - write_log (L"GetSaveFileNameX() failed, err=%d.\n", GetLastError ()); + write_log (_T("GetSaveFileNameX() failed, err=%d.\n"), GetLastError ()); } else { if (!(result = GetOpenFileName_2 (hDlg, &openFileName, guid))) - write_log (L"GetOpenFileNameX() failed, err=%d.\n", GetLastError ()); + write_log (_T("GetOpenFileNameX() failed, err=%d.\n"), GetLastError ()); } if (result) { previousfilter[flag] = openFileName.nFilterIndex; @@ -2309,7 +2309,7 @@ int DiskSelection_2 (HWND hDlg, WPARAM wParam, int flag, struct uae_prefs *prefs if (multi) { if (nextp[0] == 0) break; - _stprintf (full_path, L"%s\\%s", full_path2, nextp); + _stprintf (full_path, _T("%s\\%s"), full_path2, nextp); nextp += _tcslen (nextp) + 1; } switch (wParam) @@ -2317,7 +2317,7 @@ int DiskSelection_2 (HWND hDlg, WPARAM wParam, int flag, struct uae_prefs *prefs case IDC_PATH_NAME: case IDC_PATH_FILESYS: if (flag == 8) { - if(_tcsstr (full_path, L"Configurations\\")) { + if(_tcsstr (full_path, _T("Configurations\\"))) { _tcscpy (full_path, init_path); _tcscat (full_path, file_name); } @@ -2407,19 +2407,19 @@ int DiskSelection_2 (HWND hDlg, WPARAM wParam, int flag, struct uae_prefs *prefs amiga_path = _tcsstr (openFileName.lpstrFile, openFileName.lpstrFileTitle); if (amiga_path && amiga_path != openFileName.lpstrFile) { *amiga_path = 0; - setdpath (L"FloppyPath", openFileName.lpstrFile); + setdpath (_T("FloppyPath"), openFileName.lpstrFile); } } else if (flag == 2 || flag == 3) { amiga_path = _tcsstr (openFileName.lpstrFile, openFileName.lpstrFileTitle); if (amiga_path && amiga_path != openFileName.lpstrFile) { *amiga_path = 0; - setdpath (L"hdfPath", openFileName.lpstrFile); + setdpath (_T("hdfPath"), openFileName.lpstrFile); } } else if (flag == 17) { amiga_path = _tcsstr (openFileName.lpstrFile, openFileName.lpstrFileTitle); if (amiga_path && amiga_path != openFileName.lpstrFile) { *amiga_path = 0; - setdpath (L"CDPath", openFileName.lpstrFile); + setdpath (_T("CDPath"), openFileName.lpstrFile); } } } @@ -2457,7 +2457,7 @@ static int loopmulti (TCHAR *s, TCHAR *out) } return 0; } - _stprintf (out, L"%s\\%s", s, s + index); + _stprintf (out, _T("%s\\%s"), s, s + index); index += _tcslen (s + index) + 1; return 1; } @@ -2469,7 +2469,7 @@ static BOOL CreateHardFile (HWND hDlg, UINT hfsizem, TCHAR *dostype, TCHAR *newp BOOL result = FALSE; LONG highword = 0; DWORD ret, written; - TCHAR init_path[MAX_DPATH] = L""; + TCHAR init_path[MAX_DPATH] = _T(""); uae_u64 hfsize; uae_u32 dt; uae_u8 b; @@ -2491,10 +2491,10 @@ static BOOL CreateHardFile (HWND hDlg, UINT hfsizem, TCHAR *dostype, TCHAR *newp GetDlgItemText (hDlg, IDC_PATH_NAME, init_path, MAX_DPATH); if (*init_path && hfsize) { if (dynamic) { - if (!_stscanf (dostype, L"%x", &dt)) + if (!_stscanf (dostype, _T("%x"), &dt)) dt = 0; - if (_tcslen (init_path) > 4 && !_tcsicmp (init_path + _tcslen (init_path) - 4, L".hdf")) - _tcscpy (init_path + _tcslen (init_path) - 4, L".vhd"); + if (_tcslen (init_path) > 4 && !_tcsicmp (init_path + _tcslen (init_path) - 4, _T(".hdf"))) + _tcscpy (init_path + _tcslen (init_path) - 4, _T(".vhd")); result = vhd_create (init_path, hfsize, dt); } else { SetCursor (LoadCursor (NULL, IDC_WAIT)); @@ -2510,7 +2510,7 @@ static BOOL CreateHardFile (HWND hDlg, UINT hfsizem, TCHAR *dostype, TCHAR *newp ret = SetFilePointer (hf, (DWORD)hfsize, NULL, FILE_BEGIN); } if (ret == INVALID_SET_FILE_POINTER && GetLastError() != NO_ERROR) - write_log (L"SetFilePointer() failure for %s to posn %ud\n", init_path, hfsize); + write_log (_T("SetFilePointer() failure for %s to posn %ud\n"), init_path, hfsize); else result = SetEndOfFile (hf); SetFilePointer (hf, 0, NULL, FILE_BEGIN); @@ -2519,7 +2519,7 @@ static BOOL CreateHardFile (HWND hDlg, UINT hfsizem, TCHAR *dostype, TCHAR *newp WriteFile (hf, &b, 1, &written, NULL); WriteFile (hf, &b, 1, &written, NULL); WriteFile (hf, &b, 1, &written, NULL); - if (_stscanf (dostype, L"%x", &dt) > 0) { + if (_stscanf (dostype, _T("%x"), &dt) > 0) { SetFilePointer (hf, 0, NULL, FILE_BEGIN); b = dt >> 24; WriteFile (hf, &b, 1, &written, NULL); @@ -2532,7 +2532,7 @@ static BOOL CreateHardFile (HWND hDlg, UINT hfsizem, TCHAR *dostype, TCHAR *newp } CloseHandle (hf); } else { - write_log (L"CreateFile() failed to create %s\n", init_path); + write_log (_T("CreateFile() failed to create %s\n"), init_path); } SetCursor (LoadCursor (NULL, IDC_ARROW)); } @@ -2551,27 +2551,27 @@ static BOOL CreateHardFile (HWND hDlg, UINT hfsizem, TCHAR *dostype, TCHAR *newp static const TCHAR *memsize_names[] = { /* 0 */ szNone.c_str(), - /* 1 */ L"256 K", - /* 2 */ L"512 K", - /* 3 */ L"1 MB", - /* 4 */ L"2 MB", - /* 5 */ L"4 MB", - /* 6 */ L"8 MB", - /* 7 */ L"16 MB", - /* 8 */ L"32 MB", - /* 9 */ L"64 MB", - /* 10*/ L"128 MB", - /* 11*/ L"256 MB", - /* 12*/ L"512 MB", - /* 13*/ L"1 GB", - /* 14*/ L"1.5MB", - /* 15*/ L"1.8MB", - /* 16*/ L"2 GB", - /* 17*/ L"384 MB", - /* 18*/ L"768 MB", - /* 19*/ L"1.5 GB", - /* 20*/ L"2.5 GB", - /* 21*/ L"3 GB" + /* 1 */ _T("256 K"), + /* 2 */ _T("512 K"), + /* 3 */ _T("1 MB"), + /* 4 */ _T("2 MB"), + /* 5 */ _T("4 MB"), + /* 6 */ _T("8 MB"), + /* 7 */ _T("16 MB"), + /* 8 */ _T("32 MB"), + /* 9 */ _T("64 MB"), + /* 10*/ _T("128 MB"), + /* 11*/ _T("256 MB"), + /* 12*/ _T("512 MB"), + /* 13*/ _T("1 GB"), + /* 14*/ _T("1.5MB"), + /* 15*/ _T("1.8MB"), + /* 16*/ _T("2 GB"), + /* 17*/ _T("384 MB"), + /* 18*/ _T("768 MB"), + /* 19*/ _T("1.5 GB"), + /* 20*/ _T("2.5 GB"), + /* 21*/ _T("3 GB") }; static unsigned long memsizes[] = { @@ -2620,7 +2620,7 @@ static int CalculateHardfileSize (HWND hDlg) } static const TCHAR *nth[] = { - L"", L"second ", L"third ", L"fourth ", L"fifth ", L"sixth ", L"seventh ", L"eighth ", L"ninth ", L"tenth " + _T(""), _T("second "), _T("third "), _T("fourth "), _T("fifth "), _T("sixth "), _T("seventh "), _T("eighth "), _T("ninth "), _T("tenth ") }; static void setguititle (HWND phwnd) @@ -2637,7 +2637,7 @@ static void setguititle (HWND phwnd) if (_tcslen (WINUAEBETA) > 0) { _tcscat (title, BetaStr); if (_tcslen (WINUAEEXTRA) > 0) { - _tcscat (title, L" "); + _tcscat (title, _T(" ")); _tcscat (title, WINUAEEXTRA); } } @@ -2646,14 +2646,14 @@ static void setguititle (HWND phwnd) name = workprefs.config_window_title; if (name && _tcslen (name) > 0) { _tcscat (title2, name); - _tcscat (title2, L" - "); + _tcscat (title2, _T(" - ")); } if (!title2[0]) { name = config_filename; if (name && _tcslen (name) > 0) { - _tcscat (title2, L"["); + _tcscat (title2, _T("[")); _tcscat (title2, name); - _tcscat (title2, L"] - "); + _tcscat (title2, _T("] - ")); } } _tcscat (title2, title); @@ -2666,14 +2666,14 @@ static void GetConfigPath (TCHAR *path, struct ConfigStruct *parent, int noroot) if (parent == NULL) { path[0] = 0; if (!noroot) { - fetch_path (L"ConfigurationPath", path, MAX_DPATH); + fetch_path (_T("ConfigurationPath"), path, MAX_DPATH); } return; } if (parent) { GetConfigPath (path, parent->Parent, noroot); _tcsncat (path, parent->Name, MAX_DPATH); - _tcsncat (path, L"\\", MAX_DPATH); + _tcsncat (path, _T("\\"), MAX_DPATH); } } @@ -2702,7 +2702,7 @@ static void FreeConfigStore (void) static void getconfigcache (TCHAR *dst, const TCHAR *path) { _tcscpy (dst, path); - _tcsncat (dst, L"configuration.cache", MAX_DPATH); + _tcsncat (dst, _T("configuration.cache"), MAX_DPATH); } static TCHAR *fgetsx (TCHAR *dst, FILE *f) @@ -2721,7 +2721,7 @@ static TCHAR *fgetsx (TCHAR *dst, FILE *f) return dst; } -static TCHAR configcachever[] = L"WinUAE Configuration.Cache"; +static TCHAR configcachever[] = _T("WinUAE Configuration.Cache"); static void setconfighosthard (struct ConfigStruct *config) { @@ -2736,17 +2736,17 @@ static void setconfighosthard (struct ConfigStruct *config) static void flushconfigcache (const TCHAR *cachepath) { FILE *zcache; - zcache = _tfopen (cachepath, L"r"); + zcache = _tfopen (cachepath, _T("r")); if (zcache == NULL) return; fclose (zcache); bool hidden = my_isfilehidden (cachepath); my_setfilehidden (cachepath, false); - zcache = _tfopen (cachepath, L"w+, ccs=UTF-8"); + zcache = _tfopen (cachepath, _T("w+, ccs=UTF-8")); if (zcache) fclose (zcache); my_setfilehidden (cachepath, hidden); - write_log (L"'%s' flushed\n", cachepath); + write_log (_T("'%s' flushed\n"), cachepath); } static struct ConfigStruct *readconfigcache (const TCHAR *path) @@ -2901,8 +2901,8 @@ static struct ConfigStruct *readconfigcache (const TCHAR *path) } if (_tcslen (cs->Path) > 0 && !dirmode) { - _tcscat (cs->Path, L"\\"); - _tcscat (cs->Fullpath, L"\\"); + _tcscat (cs->Path, _T("\\")); + _tcscat (cs->Fullpath, _T("\\")); } if (!dirmode) { @@ -2933,12 +2933,12 @@ end: err = 1; fclose (zcache); if (err || first == NULL) { - write_log (L"'%s' load failed\n", cachepath); + write_log (_T("'%s' load failed\n"), cachepath); flushconfigcache (cachepath); FreeConfigStore (); return NULL; } else { - write_log (L"'%s' loaded successfully\n", cachepath); + write_log (_T("'%s' loaded successfully\n"), cachepath); } return first; } @@ -2947,7 +2947,7 @@ static void writeconfigcacheentry (FILE *zcache, const TCHAR *relpath, struct Co { TCHAR path2[MAX_DPATH]; TCHAR lf = 10; - TCHAR el[] = L";\n"; + TCHAR el[] = _T(";\n"); TCHAR *p; ULARGE_INTEGER li; @@ -2963,7 +2963,7 @@ static void writeconfigcacheentry (FILE *zcache, const TCHAR *relpath, struct Co fwrite (&lf, 1, sizeof (TCHAR), zcache); memcpy (&li, &cs->t, sizeof (ULARGE_INTEGER)); - _stprintf (path2, L"%I64u", li.QuadPart); + _stprintf (path2, _T("%I64u"), li.QuadPart); fwrite (path2, _tcslen (path2), sizeof (TCHAR), zcache); fwrite (&lf, 1, sizeof (TCHAR), zcache); @@ -2977,7 +2977,7 @@ static void writeconfigcacheentry (FILE *zcache, const TCHAR *relpath, struct Co fwrite (&lf, 1, sizeof (TCHAR), zcache); fwrite (cs->HostLink, _tcslen (cs->HostLink), sizeof (TCHAR), zcache); fwrite (&lf, 1, sizeof (TCHAR), zcache); - _stprintf (path2, L"%d", cs->Type); + _stprintf (path2, _T("%d"), cs->Type); fwrite (path2, _tcslen (path2), sizeof (TCHAR), zcache); fwrite (&lf, 1, sizeof (TCHAR), zcache); } @@ -3014,7 +3014,7 @@ static void writeconfigcache (const TCHAR *path) getconfigcache (cachepath, path); bool hidden = my_isfilehidden (cachepath); my_setfilehidden (cachepath, false); - zcache = _tfopen (cachepath, L"w, ccs=UTF-8"); + zcache = _tfopen (cachepath, _T("w, ccs=UTF-8")); if (!zcache) return; t.dwHighDateTime = t.dwLowDateTime = 0; @@ -3022,7 +3022,7 @@ static void writeconfigcache (const TCHAR *path) SystemTimeToFileTime (&st, &t); fwrite (configcachever, _tcslen (configcachever), sizeof (TCHAR), zcache); fwrite (&lf, 1, sizeof (TCHAR), zcache); - _stprintf (path2, L"3\n4\n7\n%I64u\n;\n", t); + _stprintf (path2, _T("3\n4\n7\n%I64u\n;\n"), t); fwrite (path2, _tcslen (path2), sizeof (TCHAR), zcache); GetFullPathName (path, sizeof path2 / sizeof (TCHAR), path2, NULL); for (i = 0; i < configstoresize; i++) { @@ -3037,7 +3037,7 @@ static void writeconfigcache (const TCHAR *path) } fclose (zcache); my_setfilehidden (cachepath, hidden); - write_log (L"'%s' created\n", cachepath); + write_log (_T("'%s' created\n"), cachepath); } static struct ConfigStruct *GetConfigs (struct ConfigStruct *configparent, int usedirs, int *level, int flushcache) @@ -3057,7 +3057,7 @@ static struct ConfigStruct *GetConfigs (struct ConfigStruct *configparent, int u GetConfigPath (path, configparent, FALSE); GetConfigPath (shortpath, configparent, TRUE); _tcscpy (path2, path); - _tcsncat (path2, L"*.*", MAX_DPATH); + _tcsncat (path2, _T("*.*"), MAX_DPATH); if (*level == 0) { if (flushcache) { @@ -3085,7 +3085,7 @@ static struct ConfigStruct *GetConfigs (struct ConfigStruct *configparent, int u } for (;;) { config = NULL; - if (_tcscmp (find_data.cFileName, L".") && _tcscmp (find_data.cFileName, L"..")) { + if (_tcscmp (find_data.cFileName, _T(".")) && _tcscmp (find_data.cFileName, _T(".."))) { int ok = 0; config = AllocConfigStruct (); _tcscpy (config->Path, shortpath); @@ -3097,10 +3097,10 @@ static struct ConfigStruct *GetConfigs (struct ConfigStruct *configparent, int u _tcscpy (config->Name, find_data.cFileName); _tcscpy (config->Path, shortpath); _tcscat (config->Path, config->Name); - _tcscat (config->Path, L"\\"); + _tcscat (config->Path, _T("\\")); _tcscpy (config->Fullpath, path); _tcscat (config->Fullpath, config->Name); - _tcscat (config->Fullpath, L"\\"); + _tcscat (config->Fullpath, _T("\\")); config->Directory = 1; (*level)++; config->Parent = configparent; @@ -3113,7 +3113,7 @@ static struct ConfigStruct *GetConfigs (struct ConfigStruct *configparent, int u } } else if (!(find_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) { TCHAR path3[MAX_DPATH]; - if (_tcslen (find_data.cFileName) > 4 && !strcasecmp (find_data.cFileName + _tcslen (find_data.cFileName) - 4, L".uae")) { + if (_tcslen (find_data.cFileName) > 4 && !strcasecmp (find_data.cFileName + _tcslen (find_data.cFileName) - 4, _T(".uae"))) { _tcscpy (path3, path); _tcsncat (path3, find_data.cFileName, MAX_DPATH); if (cfgfile_get_description (path3, config->Description, config->HostLink, config->HardwareLink, &config->Type)) { @@ -3186,8 +3186,8 @@ static TCHAR *HandleConfiguration (HWND hDlg, int flag, struct ConfigStruct *con GetDlgItemText (hDlg, IDC_EDITNAME, name, MAX_DPATH); _tcscpy (config_filename, name); if (flag == CONFIG_SAVE_FULL || flag == CONFIG_SAVE) { - if (_tcslen (name) < 4 || strcasecmp (name + _tcslen (name) - 4, L".uae")) { - _tcscat (name, L".uae"); + if (_tcslen (name) < 4 || strcasecmp (name + _tcslen (name) - 4, _T(".uae"))) { + _tcscat (name, _T(".uae")); SetDlgItemText (hDlg, IDC_EDITNAME, name); } if (config) @@ -3213,7 +3213,7 @@ static TCHAR *HandleConfiguration (HWND hDlg, int flag, struct ConfigStruct *con break; case CONFIG_SAVE: - if (_tcslen (name) == 0 || _tcscmp (name, L".uae") == 0) { + if (_tcslen (name) == 0 || _tcscmp (name, _T(".uae")) == 0) { TCHAR szMessage[MAX_DPATH]; WIN32GUI_LoadUIString(IDS_MUSTENTERNAME, szMessage, MAX_DPATH); pre_gui_message (szMessage); @@ -3255,7 +3255,7 @@ static TCHAR *HandleConfiguration (HWND hDlg, int flag, struct ConfigStruct *con MB_YESNO | MB_ICONWARNING | MB_APPLMODAL | MB_SETFOREGROUND) == IDYES) { cfgfile_backup (path); DeleteFile (path); - write_log (L"deleted config '%s'\n", path); + write_log (_T("deleted config '%s'\n"), path); config_filename[0] = 0; } else { ok = 0; @@ -3332,17 +3332,17 @@ static void getqualifiername (TCHAR *p, int mask) int i, j; *p = 0; if (mask == IDEV_MAPPED_QUALIFIER_SPECIAL) { - _tcscpy (p, L"*"); + _tcscpy (p, _T("*")); } else if (mask == IDEV_MAPPED_QUALIFIER_SHIFT) { - _tcscpy (p, L"Shift"); + _tcscpy (p, _T("Shift")); } else if (mask == IDEV_MAPPED_QUALIFIER_CONTROL) { - _tcscpy (p, L"Ctrl"); + _tcscpy (p, _T("Ctrl")); } else if (mask == IDEV_MAPPED_QUALIFIER_ALT) { - _tcscpy (p, L"Alt"); + _tcscpy (p, _T("Alt")); } else { for (i = IDEV_MAPPED_QUALIFIER1, j = 0; i <= IDEV_MAPPED_QUALIFIER8; i <<= 1, j++) { if (i == mask) - _stprintf (p, L"%d", j + 1); + _stprintf (p, _T("%d"), j + 1); } } } @@ -3363,23 +3363,23 @@ static void set_lventry_input (HWND list, int index) } else if (flags & IDEV_MAPPED_AUTOFIRE_POSSIBLE) { WIN32GUI_LoadUIString (IDS_NO, af, sizeof af / sizeof (TCHAR)); } else { - _tcscpy (af, L"-"); + _tcscpy (af, _T("-")); } if (flags & IDEV_MAPPED_TOGGLE) WIN32GUI_LoadUIString (IDS_YES, toggle, sizeof toggle / sizeof (TCHAR)); else if (flags & IDEV_MAPPED_AUTOFIRE_POSSIBLE) WIN32GUI_LoadUIString (IDS_NO, toggle, sizeof toggle / sizeof (TCHAR)); else - _tcscpy (toggle, L"-"); + _tcscpy (toggle, _T("-")); if (port > 0) { TCHAR tmp[256]; _tcscpy (tmp, name); - _stprintf (name, L"[PORT%d] %s", port, tmp); + _stprintf (name, _T("[PORT%d] %s"), port, tmp); } ListView_SetItemText (list, index, 1, custom[0] ? custom : name); ListView_SetItemText (list, index, 2, af); ListView_SetItemText (list, index, 3, toggle); - _tcscpy (name, L"-"); + _tcscpy (name, _T("-")); if (flags & IDEV_MAPPED_QUALIFIER_MASK) { TCHAR *p; p = name; @@ -3399,7 +3399,7 @@ static void set_lventry_input (HWND list, int index) if (inputdevice_get_mapping (input_selected_device, index, &flags, NULL, name, custom, i) || custom[0]) sub++; } - _stprintf (name, L"%d", sub); + _stprintf (name, _T("%d"), sub); ListView_SetItemText (list, index, 5, name); } @@ -3478,7 +3478,7 @@ static int inputmap_handle (HWND list, int currentdevnum, int currentwidgetnum, if (list) { TCHAR target[MAX_DPATH]; _tcscpy (target, name); - _tcscat (target, L", "); + _tcscat (target, _T(", ")); _tcscat (target, inputdevice_get_device_name2 (devnum)); lvstruct.pszText = target; lvstruct.iItem = cntgroup * 256 + cntitem; @@ -3506,7 +3506,7 @@ static int inputmap_handle (HWND list, int currentdevnum, int currentwidgetnum, } if (!found) { if (list) { - lvstruct.pszText = L""; + lvstruct.pszText = _T(""); lvstruct.iItem = cntgroup * 256 + cntitem; item = ListView_InsertItem (list, &lvstruct); } @@ -3562,12 +3562,12 @@ void InitializeListView (HWND hDlg) LV_COLUMN lvcolumn; RECT rect; TCHAR column_heading[HARDDISK_COLUMNS][MAX_COLUMN_HEADING_WIDTH]; - TCHAR blocksize_str[6] = L""; - TCHAR readwrite_str[10] = L""; - TCHAR size_str[32] = L""; - TCHAR volname_str[MAX_DPATH] = L""; - TCHAR devname_str[MAX_DPATH] = L""; - TCHAR bootpri_str[6] = L""; + TCHAR blocksize_str[6] = _T(""); + TCHAR readwrite_str[10] = _T(""); + TCHAR size_str[32] = _T(""); + TCHAR volname_str[MAX_DPATH] = _T(""); + TCHAR devname_str[MAX_DPATH] = _T(""); + TCHAR bootpri_str[6] = _T(""); int width = 0; int items = 0, result = 0, i, j, entry = 0, temp = 0; TCHAR tmp[10], tmp2[MAX_DPATH]; @@ -3584,7 +3584,7 @@ void InitializeListView (HWND hDlg) listview_num_columns = HARDDISK_COLUMNS; lv_type = LV_HARDDISK; - _tcscpy (column_heading[0], L"*"); + _tcscpy (column_heading[0], _T("*")); WIN32GUI_LoadUIString (IDS_DEVICE, column_heading[1], MAX_COLUMN_HEADING_WIDTH); WIN32GUI_LoadUIString (IDS_VOLUME, column_heading[2], MAX_COLUMN_HEADING_WIDTH); WIN32GUI_LoadUIString (IDS_PATH, column_heading[3], MAX_COLUMN_HEADING_WIDTH); @@ -3603,7 +3603,7 @@ void InitializeListView (HWND hDlg) WIN32GUI_LoadUIString (IDS_INPUTAUTOFIRE, column_heading[2], MAX_COLUMN_HEADING_WIDTH); WIN32GUI_LoadUIString (IDS_INPUTTOGGLE, column_heading[3], MAX_COLUMN_HEADING_WIDTH); WIN32GUI_LoadUIString (IDS_INPUTQUALIFIER, column_heading[4], MAX_COLUMN_HEADING_WIDTH); - _tcscpy (column_heading[5], L"#"); + _tcscpy (column_heading[5], _T("#")); list = GetDlgItem (hDlg, IDC_INPUTLIST); } else if (hDlg == pages[INPUTMAP_ID]) { @@ -3617,15 +3617,15 @@ void InitializeListView (HWND hDlg) listview_num_columns = MISC2_COLUMNS; lv_type = LV_MISC2; - _tcscpy (column_heading[0], L"Extension"); - _tcscpy (column_heading[1], L""); + _tcscpy (column_heading[0], _T("Extension")); + _tcscpy (column_heading[1], _T("")); list = GetDlgItem (hDlg, IDC_ASSOCIATELIST); } else { listview_num_columns = DISK_COLUMNS; lv_type = LV_DISK; - _tcscpy (column_heading[0], L"#"); + _tcscpy (column_heading[0], _T("#")); WIN32GUI_LoadUIString (IDS_DISK_IMAGENAME, column_heading[1], MAX_COLUMN_HEADING_WIDTH); WIN32GUI_LoadUIString (IDS_DISK_DRIVENAME, column_heading[2], MAX_COLUMN_HEADING_WIDTH); list = GetDlgItem (hDlg, IDC_DISK); @@ -3665,7 +3665,7 @@ void InitializeListView (HWND hDlg) lvstruct.iItem = i; lvstruct.iSubItem = 0; result = ListView_InsertItem (list, &lvstruct); - ListView_SetItemText (list, result, 1, exts[i].enabled ? L"*" : L""); + ListView_SetItemText (list, result, 1, exts[i].enabled ? _T("*") : _T("")); } } else if (lv_type == LV_INPUT) { @@ -3699,7 +3699,7 @@ void InitializeListView (HWND hDlg) for (i = 0; i < MAX_SPARE_DRIVES; i++) { int drv; - _stprintf (tmp, L"%d", i + 1); + _stprintf (tmp, _T("%d"), i + 1); lvstruct.mask = LVIF_TEXT | LVIF_PARAM; lvstruct.pszText = tmp; lvstruct.lParam = 0; @@ -3721,7 +3721,7 @@ void InitializeListView (HWND hDlg) drv = disk_in_drive (i); tmp[0] = 0; if (drv >= 0) - _stprintf (tmp, L"DF%d:", drv); + _stprintf (tmp, _T("DF%d:"), drv); ListView_SetItemText (list, result, 2, tmp); width = ListView_GetStringWidth (list, lvstruct.pszText) + 15; if (width > listview_column_width[0]) @@ -3748,63 +3748,63 @@ void InitializeListView (HWND hDlg) } if (nosize) - _tcscpy (size_str, L"n/a"); + _tcscpy (size_str, _T("n/a")); else if (mi.size >= 1024 * 1024 * 1024) - _stprintf (size_str, L"%.1fG", ((double)(uae_u32)(mi.size / (1024 * 1024))) / 1024.0); + _stprintf (size_str, _T("%.1fG"), ((double)(uae_u32)(mi.size / (1024 * 1024))) / 1024.0); else if (mi.size < 10 * 1024 * 1024) - _stprintf (size_str, L"%dK", mi.size / 1024); + _stprintf (size_str, _T("%dK"), mi.size / 1024); else - _stprintf (size_str, L"%.1fM", ((double)(uae_u32)(mi.size / (1024))) / 1024.0); + _stprintf (size_str, _T("%.1fM"), ((double)(uae_u32)(mi.size / (1024))) / 1024.0); if (uci->controller >= HD_CONTROLLER_IDE0 && uci->controller <= HD_CONTROLLER_IDE3) { - _stprintf (blocksize_str, L"%d", uci->blocksize); - _stprintf (devname_str, L"*IDE%d*", uci->controller - HD_CONTROLLER_IDE0); - _tcscpy (volname_str, L"n/a"); - _tcscpy (bootpri_str, L"n/a"); + _stprintf (blocksize_str, _T("%d"), uci->blocksize); + _stprintf (devname_str, _T("*IDE%d*"), uci->controller - HD_CONTROLLER_IDE0); + _tcscpy (volname_str, _T("n/a")); + _tcscpy (bootpri_str, _T("n/a")); } else if (uci->controller >= HD_CONTROLLER_SCSI0 && uci->controller <= HD_CONTROLLER_SCSI6) { - _stprintf (blocksize_str, L"%d", uci->blocksize); - _stprintf (devname_str, L"*SCSI%d*", uci->controller - HD_CONTROLLER_SCSI0); - _tcscpy (volname_str, L"n/a"); - _tcscpy (bootpri_str, L"n/a"); + _stprintf (blocksize_str, _T("%d"), uci->blocksize); + _stprintf (devname_str, _T("*SCSI%d*"), uci->controller - HD_CONTROLLER_SCSI0); + _tcscpy (volname_str, _T("n/a")); + _tcscpy (bootpri_str, _T("n/a")); } else if (uci->controller == HD_CONTROLLER_PCMCIA_SRAM) { - _tcscpy (blocksize_str, L"n/a"); - _tcscpy(devname_str, L"*SCSRAM*"); - _tcscpy (volname_str, L"n/a"); - _tcscpy (bootpri_str, L"n/a"); + _tcscpy (blocksize_str, _T("n/a")); + _tcscpy(devname_str, _T("*SCSRAM*")); + _tcscpy (volname_str, _T("n/a")); + _tcscpy (bootpri_str, _T("n/a")); } else if (uci->controller == HD_CONTROLLER_PCMCIA_IDE) { - _tcscpy (blocksize_str, L"n/a"); - _tcscpy(devname_str, L"*SCIDE*"); - _tcscpy (volname_str, L"n/a"); - _tcscpy (bootpri_str, L"n/a"); + _tcscpy (blocksize_str, _T("n/a")); + _tcscpy(devname_str, _T("*SCIDE*")); + _tcscpy (volname_str, _T("n/a")); + _tcscpy (bootpri_str, _T("n/a")); } else if (type == FILESYS_HARDFILE) { - _stprintf (blocksize_str, L"%d", uci->blocksize); + _stprintf (blocksize_str, _T("%d"), uci->blocksize); _tcscpy (devname_str, uci->devname); - _tcscpy (volname_str, L"n/a"); - _stprintf (bootpri_str, L"%d", uci->bootpri); + _tcscpy (volname_str, _T("n/a")); + _stprintf (bootpri_str, _T("%d"), uci->bootpri); } else if (type == FILESYS_HARDFILE_RDB || type == FILESYS_HARDDRIVE || uci->controller) { - _stprintf (blocksize_str, L"%d", uci->blocksize); - _tcscpy (devname_str, L"n/a"); - _tcscpy (volname_str, L"n/a"); - _tcscpy (bootpri_str, L"n/a"); - if (!_tcsncmp (rootdir, L"HD_", 3)) + _stprintf (blocksize_str, _T("%d"), uci->blocksize); + _tcscpy (devname_str, _T("n/a")); + _tcscpy (volname_str, _T("n/a")); + _tcscpy (bootpri_str, _T("n/a")); + if (!_tcsncmp (rootdir, _T("HD_"), 3)) rootdir += 3; } else { - _tcscpy (blocksize_str, L"n/a"); + _tcscpy (blocksize_str, _T("n/a")); _tcscpy (devname_str, uci->devname); _tcscpy (volname_str, uci->volname); - _tcscpy (size_str, L"n/a"); - _stprintf (bootpri_str, L"%d", uci->bootpri); + _tcscpy (size_str, _T("n/a")); + _stprintf (bootpri_str, _T("%d"), uci->bootpri); } if (!mi.ismedia) { - _tcscpy (blocksize_str, L"n/a"); - _tcscpy (size_str, L"n/a"); + _tcscpy (blocksize_str, _T("n/a")); + _tcscpy (size_str, _T("n/a")); } WIN32GUI_LoadUIString (uci->readonly ? IDS_NO : IDS_YES, readwrite_str, sizeof (readwrite_str) / sizeof (TCHAR)); lvstruct.mask = LVIF_TEXT | LVIF_PARAM; - lvstruct.pszText = mi.ismedia == 0 ? L"E" : (nosize ? L"X" : (mi.ismounted ? L"*" : L" ")); + lvstruct.pszText = mi.ismedia == 0 ? _T("E") : (nosize ? _T("X") : (mi.ismounted ? _T("*") : _T(" "))); if (uci->controller) - lvstruct.pszText = L" "; + lvstruct.pszText = _T(" "); lvstruct.lParam = 0; lvstruct.iItem = i; lvstruct.iSubItem = 0; @@ -3977,8 +3977,8 @@ static HTREEITEM AddConfigNode (HWND hDlg, struct ConfigStruct *config, const TC { TVINSERTSTRUCT is; HWND TVhDlg; - TCHAR s[MAX_DPATH] = L""; - TCHAR file_name[MAX_DPATH] = L"", file_path[MAX_DPATH] = L""; + TCHAR s[MAX_DPATH] = _T(""); + TCHAR file_name[MAX_DPATH] = _T(""), file_path[MAX_DPATH] = _T(""); GetDlgItemText (hDlg, IDC_EDITNAME, file_name, MAX_DPATH); GetDlgItemText (hDlg, IDC_EDITPATH, file_path, MAX_DPATH); @@ -3992,7 +3992,7 @@ static HTREEITEM AddConfigNode (HWND hDlg, struct ConfigStruct *config, const TC is.itemex.stateMask |= TVIS_SELECTED; } if (isdir) { - _tcscat (s, L" "); + _tcscat (s, _T(" ")); is.itemex.state |= TVIS_BOLD; is.itemex.stateMask |= TVIS_BOLD; } @@ -4001,12 +4001,12 @@ static HTREEITEM AddConfigNode (HWND hDlg, struct ConfigStruct *config, const TC is.itemex.stateMask |= TVIS_EXPANDED; } _tcscat (s, name); - if (_tcslen (s) > 4 && !_tcsicmp (s + _tcslen (s) - 4, L".uae")) + if (_tcslen (s) > 4 && !_tcsicmp (s + _tcslen (s) - 4, _T(".uae"))) s[_tcslen (s) - 4] = 0; if (desc && _tcslen (desc) > 0) { - _tcscat (s, L" ("); + _tcscat (s, _T(" (")); _tcscat (s, desc); - _tcscat (s, L")"); + _tcscat (s, _T(")")); } is.itemex.pszText = s; is.itemex.iImage = is.itemex.iSelectedImage = isdir > 0 ? 0 : (isdir < 0) ? 2 : 1; @@ -4074,14 +4074,14 @@ static void InitializeConfig (HWND hDlg, struct ConfigStruct *config) int i, j, idx1, idx2; if (config == NULL) { - SetDlgItemText (hDlg, IDC_EDITNAME, L""); - SetDlgItemText (hDlg, IDC_EDITDESCRIPTION, L""); + SetDlgItemText (hDlg, IDC_EDITNAME, _T("")); + SetDlgItemText (hDlg, IDC_EDITDESCRIPTION, _T("")); } else { SetDlgItemText (hDlg, IDC_EDITNAME, config->Name); SetDlgItemText (hDlg, IDC_EDITDESCRIPTION, config->Description); } SendDlgItemMessage (hDlg, IDC_CONFIGLINK, CB_RESETCONTENT, 0, 0L); - SendDlgItemMessage (hDlg, IDC_CONFIGLINK, CB_ADDSTRING, 0, (LPARAM)L""); + SendDlgItemMessage (hDlg, IDC_CONFIGLINK, CB_ADDSTRING, 0, (LPARAM)_T("")); idx1 = 1; idx2 = 0; for (j = 0; j < 2; j++) { @@ -4148,7 +4148,7 @@ static void ConfigToRegistry2 (DWORD ct, int type, DWORD noauto) if (type > 0) regsetint (NULL, configreg2[type], ct); if (noauto == 0 || noauto == 1) - regsetint (NULL, L"ConfigFile_NoAuto", noauto); + regsetint (NULL, _T("ConfigFile_NoAuto"), noauto); } static void checkautoload (HWND hDlg, struct ConfigStruct *config) @@ -4163,7 +4163,7 @@ static void checkautoload (HWND hDlg, struct ConfigStruct *config) } CheckDlgButton (hDlg, IDC_CONFIGAUTO, ct ? BST_CHECKED : BST_UNCHECKED); ew (hDlg, IDC_CONFIGAUTO, configtypepanel > 0 && config && !config->Directory ? TRUE : FALSE); - regqueryint (NULL, L"ConfigFile_NoAuto", &ct); + regqueryint (NULL, _T("ConfigFile_NoAuto"), &ct); CheckDlgButton(hDlg, IDC_CONFIGNOLINK, ct ? BST_CHECKED : BST_UNCHECKED); } @@ -4194,7 +4194,7 @@ static struct ConfigStruct *initloadsave (HWND hDlg, struct ConfigStruct *config TCHAR path[MAX_DPATH]; EnableWindow (GetDlgItem (hDlg, IDC_VIEWINFO), workprefs.info[0]); - SetDlgItemText (hDlg, IDC_EDITPATH, L""); + SetDlgItemText (hDlg, IDC_EDITPATH, _T("")); SetDlgItemText (hDlg, IDC_EDITDESCRIPTION, workprefs.description); root = InitializeConfigTreeView (hDlg); if (regquerystr (NULL, configreg[configtypepanel], name_buf, &dwRFPsize)) { @@ -4274,8 +4274,8 @@ static void loadsavecommands (HWND hDlg, WPARAM wParam, struct ConfigStruct **co case IDC_VIEWINFO: if (workprefs.info[0]) { TCHAR name_buf[MAX_DPATH]; - if (_tcsstr (workprefs.info, L"Configurations\\")) - _stprintf (name_buf, L"%s\\%s", start_path_data, workprefs.info); + if (_tcsstr (workprefs.info, _T("Configurations\\"))) + _stprintf (name_buf, _T("%s\\%s"), start_path_data, workprefs.info); else _tcscpy (name_buf, workprefs.info); ShellExecute (NULL, NULL, name_buf, NULL, NULL, SW_SHOWNORMAL); @@ -4444,14 +4444,14 @@ static INT_PTR CALLBACK ContributorsProc (HWND hDlg, UINT msg, WPARAM wParam, LP WIN32GUI_LoadUIString(IDS_CONTRIBUTORS1, szContributors1, MAX_CONTRIBUTORS_LENGTH); WIN32GUI_LoadUIString(IDS_CONTRIBUTORS2, szContributors2, MAX_CONTRIBUTORS_LENGTH); - _stprintf (szContributors, L"%s%s", szContributors1, szContributors2); + _stprintf (szContributors, _T("%s%s"), szContributors1, szContributors2); SetDlgItemText (hDlg, IDC_CONTRIBUTORS, szContributors ); SendDlgItemMessage (hDlg, IDC_CONTRIBUTORS, EM_GETCHARFORMAT, 0, (LPARAM) & CharFormat); CharFormat.dwMask |= CFM_SIZE | CFM_FACE; CharFormat.yHeight = 8 * 20; /* height in twips, where a twip is 1/20th of a point - for a pt.size of 18 */ - _tcscpy (CharFormat.szFaceName, os_vista ? L"Segoe UI" : L"Tahoma"); + _tcscpy (CharFormat.szFaceName, os_vista ? _T("Segoe UI") : _T("Tahoma")); SendDlgItemMessage (hDlg, IDC_CONTRIBUTORS, EM_SETCHARFORMAT, SCF_ALL, (LPARAM) & CharFormat); return TRUE; } @@ -4473,17 +4473,17 @@ typedef struct url_info static urlinfo urls[] = { - {IDC_CLOANTOHOME, FALSE, L"Cloanto's Amiga Forever", L"http://www.amigaforever.com/"}, - {IDC_AMIGAHOME, FALSE, L"Amiga Inc.", L"http://www.amiga.com"}, -// {IDC_PICASSOHOME, FALSE, L"Picasso96 Home Page", L"http://www.picasso96.cogito.de/"}, - {IDC_UAEHOME, FALSE, L"UAE Home Page", L"http://www.amigaemulator.org/"}, - {IDC_WINUAEHOME, FALSE, L"WinUAE Home Page", L"http://www.winuae.net/"}, -// {IDC_AIABHOME, FALSE, L"AIAB", L"http://www.amigainabox.co.uk/"}, - {IDC_THEROOTS, FALSE, L"Back To The Roots", L"http://www.back2roots.org/"}, - {IDC_ABIME, FALSE, L"abime.net", L"http://www.abime.net/"}, - {IDC_CAPS, FALSE, L"SPS", L"http://www.softpres.org/"}, - {IDC_AMIGASYS, FALSE, L"AmigaSYS", L"http://www.amigasys.com/"}, - {IDC_AMIKIT, FALSE, L"AmiKit", L"http://amikit.amiga.sk/"}, + {IDC_CLOANTOHOME, FALSE, _T("Cloanto's Amiga Forever"), _T("http://www.amigaforever.com/")}, + {IDC_AMIGAHOME, FALSE, _T("Amiga Inc."), _T("http://www.amiga.com")}, +// {IDC_PICASSOHOME, FALSE, _T("Picasso96 Home Page"), _T("http://www.picasso96.cogito.de/")}, + {IDC_UAEHOME, FALSE, _T("UAE Home Page"), _T("http://www.amigaemulator.org/")}, + {IDC_WINUAEHOME, FALSE, _T("WinUAE Home Page"), _T("http://www.winuae.net/")}, +// {IDC_AIABHOME, FALSE, _T("AIAB"), _T("http://www.amigainabox.co.uk/")}, + {IDC_THEROOTS, FALSE, _T("Back To The Roots"), _T("http://www.back2roots.org/")}, + {IDC_ABIME, FALSE, _T("abime.net"), _T("http://www.abime.net/")}, + {IDC_CAPS, FALSE, _T("SPS"), _T("http://www.softpres.org/")}, + {IDC_AMIGASYS, FALSE, _T("AmigaSYS"), _T("http://www.amigasys.com/")}, + {IDC_AMIKIT, FALSE, _T("AmiKit"), _T("http://amikit.amiga.sk/")}, { -1, FALSE, NULL, NULL } }; @@ -4499,7 +4499,7 @@ static void SetupRichText(HWND hDlg, urlinfo *url) CharFormat.yHeight = 10 * 20; /* height in twips, where a twip is 1/20th of a point - for a pt.size of 18 */ CharFormat.crTextColor = GetSysColor (COLOR_ACTIVECAPTION); - _tcscpy (CharFormat.szFaceName, os_vista ? L"Segoe UI" : L"Tahoma"); + _tcscpy (CharFormat.szFaceName, os_vista ? _T("Segoe UI") : _T("Tahoma")); SendDlgItemMessage (hDlg, url->id, EM_SETCHARFORMAT, SCF_ALL, (LPARAM)&CharFormat); SendDlgItemMessage (hDlg, url->id, EM_SETBKGNDCOLOR, 0, GetSysColor (COLOR_3DFACE)); } @@ -4570,7 +4570,7 @@ static void setac (HWND hDlg, int id) } static void setautocomplete (HWND hDlg, int id) { - HWND item = FindWindowEx (GetDlgItem (hDlg, id), NULL, L"Edit", NULL); + HWND item = FindWindowEx (GetDlgItem (hDlg, id), NULL, _T("Edit"), NULL); if (item) SHAutoComplete (item, SHACF_FILESYSTEM | SHACF_AUTOAPPEND_FORCE_ON | SHACF_AUTOSUGGEST_FORCE_ON | SHACF_USETAB); } @@ -4592,38 +4592,38 @@ static void setpath (HWND hDlg, TCHAR *name, DWORD d, TCHAR *def) static void values_to_pathsdialog (HWND hDlg) { - setpath (hDlg, L"KickstartPath", IDC_PATHS_ROM, L"Roms"); - setpath (hDlg, L"ConfigurationPath", IDC_PATHS_CONFIG, L"Configurations"); - setpath (hDlg, L"ScreenshotPath", IDC_PATHS_SCREENSHOT, L"ScreenShots"); - setpath (hDlg, L"StatefilePath", IDC_PATHS_SAVESTATE, L"Savestates"); - setpath (hDlg, L"SaveimagePath", IDC_PATHS_SAVEIMAGE, L"SaveImages"); - setpath (hDlg, L"VideoPath", IDC_PATHS_AVIOUTPUT, L"Videos"); - setpath (hDlg, L"RipperPath", IDC_PATHS_RIP, L".\\"); + setpath (hDlg, _T("KickstartPath"), IDC_PATHS_ROM, _T("Roms")); + setpath (hDlg, _T("ConfigurationPath"), IDC_PATHS_CONFIG, _T("Configurations")); + setpath (hDlg, _T("ScreenshotPath"), IDC_PATHS_SCREENSHOT, _T("ScreenShots")); + setpath (hDlg, _T("StatefilePath"), IDC_PATHS_SAVESTATE, _T("Savestates")); + setpath (hDlg, _T("SaveimagePath"), IDC_PATHS_SAVEIMAGE, _T("SaveImages")); + setpath (hDlg, _T("VideoPath"), IDC_PATHS_AVIOUTPUT, _T("Videos")); + setpath (hDlg, _T("RipperPath"), IDC_PATHS_RIP, _T(".\\")); } static void resetregistry (void) { - regdeletetree (NULL, L"DetectedROMs"); - regdelete (NULL, L"QuickStartMode"); - regdelete (NULL, L"ConfigFile"); - regdelete (NULL, L"ConfigFileHardware"); - regdelete (NULL, L"ConfigFileHost"); - regdelete (NULL, L"ConfigFileHardware_Auto"); - regdelete (NULL, L"ConfigFileHost_Auto"); - regdelete (NULL, L"ConfigurationPath"); - regdelete (NULL, L"SaveimagePath"); - regdelete (NULL, L"ScreenshotPath"); - regdelete (NULL, L"StatefilePath"); - regdelete (NULL, L"VideoPath"); - regdelete (NULL, L"RipperPath"); - regdelete (NULL, L"QuickStartModel"); - regdelete (NULL, L"QuickStartConfiguration"); - regdelete (NULL, L"QuickStartCompatibility"); - regdelete (NULL, L"QuickStartHostConfig"); - regdelete (NULL, L"ConfigurationCache"); - regdelete (NULL, L"RelativePaths"); - regdelete (NULL, L"DirectDraw_Secondary"); - regdelete (NULL, L"ShownsupportedModes"); + regdeletetree (NULL, _T("DetectedROMs")); + regdelete (NULL, _T("QuickStartMode")); + regdelete (NULL, _T("ConfigFile")); + regdelete (NULL, _T("ConfigFileHardware")); + regdelete (NULL, _T("ConfigFileHost")); + regdelete (NULL, _T("ConfigFileHardware_Auto")); + regdelete (NULL, _T("ConfigFileHost_Auto")); + regdelete (NULL, _T("ConfigurationPath")); + regdelete (NULL, _T("SaveimagePath")); + regdelete (NULL, _T("ScreenshotPath")); + regdelete (NULL, _T("StatefilePath")); + regdelete (NULL, _T("VideoPath")); + regdelete (NULL, _T("RipperPath")); + regdelete (NULL, _T("QuickStartModel")); + regdelete (NULL, _T("QuickStartConfiguration")); + regdelete (NULL, _T("QuickStartCompatibility")); + regdelete (NULL, _T("QuickStartHostConfig")); + regdelete (NULL, _T("ConfigurationCache")); + regdelete (NULL, _T("RelativePaths")); + regdelete (NULL, _T("DirectDraw_Secondary")); + regdelete (NULL, _T("ShownsupportedModes")); } pathtype path_type; @@ -4670,7 +4670,7 @@ static INT_PTR CALLBACK PathsDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM ptypes[numtypes++] = PATH_TYPE_NEWWINUAE; } if ((af_path_2005 & 3) == 2) { - SendDlgItemMessage (hDlg, IDC_PATHS_DEFAULTTYPE, CB_ADDSTRING, 0, (LPARAM)L"AmigaForeverData"); + SendDlgItemMessage (hDlg, IDC_PATHS_DEFAULTTYPE, CB_ADDSTRING, 0, (LPARAM)_T("AmigaForeverData")); if (path_type == PATH_TYPE_AMIGAFOREVERDATA) selpath = numtypes; ptypes[numtypes++] = PATH_TYPE_AMIGAFOREVERDATA; @@ -4693,10 +4693,10 @@ static INT_PTR CALLBACK PathsDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM switch (LOWORD (wParam)) { case IDC_PATHS_ROMS: - fetch_path (L"KickstartPath", tmp, sizeof (tmp) / sizeof (TCHAR)); + fetch_path (_T("KickstartPath"), tmp, sizeof (tmp) / sizeof (TCHAR)); if (DirectorySelection (hDlg, &pathsguid, tmp)) { load_keyring (&workprefs, NULL); - set_path (L"KickstartPath", tmp); + set_path (_T("KickstartPath"), tmp); if (!scan_roms (hDlg, 1)) gui_message_id (IDS_ROMSCANNOROMS); values_to_pathsdialog (hDlg); @@ -4704,75 +4704,75 @@ static INT_PTR CALLBACK PathsDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM break; case IDC_PATHS_ROM: GetWindowText (GetDlgItem (hDlg, IDC_PATHS_ROM), tmp, sizeof (tmp) / sizeof (TCHAR)); - set_path (L"KickstartPath", tmp); + set_path (_T("KickstartPath"), tmp); break; case IDC_PATHS_CONFIGS: - fetch_path (L"ConfigurationPath", tmp, sizeof (tmp) / sizeof (TCHAR)); + fetch_path (_T("ConfigurationPath"), tmp, sizeof (tmp) / sizeof (TCHAR)); if (DirectorySelection (hDlg, &pathsguid, tmp)) { - set_path (L"ConfigurationPath", tmp); + set_path (_T("ConfigurationPath"), tmp); values_to_pathsdialog (hDlg); FreeConfigStore (); } break; case IDC_PATHS_CONFIG: GetWindowText (GetDlgItem (hDlg, IDC_PATHS_CONFIG), tmp, sizeof (tmp) / sizeof (TCHAR)); - set_path (L"ConfigurationPath", tmp); + set_path (_T("ConfigurationPath"), tmp); FreeConfigStore (); break; case IDC_PATHS_SCREENSHOTS: - fetch_path (L"ScreenshotPath", tmp, sizeof (tmp) / sizeof (TCHAR)); + fetch_path (_T("ScreenshotPath"), tmp, sizeof (tmp) / sizeof (TCHAR)); if (DirectorySelection (hDlg, &pathsguid, tmp)) { - set_path (L"ScreenshotPath", tmp); + set_path (_T("ScreenshotPath"), tmp); values_to_pathsdialog (hDlg); } break; case IDC_PATHS_SCREENSHOT: GetWindowText (GetDlgItem (hDlg, IDC_PATHS_SCREENSHOT), tmp, sizeof (tmp) / sizeof (TCHAR)); - set_path (L"ScreenshotPath", tmp); + set_path (_T("ScreenshotPath"), tmp); break; case IDC_PATHS_SAVESTATES: - fetch_path (L"StatefilePath", tmp, sizeof (tmp) / sizeof (TCHAR)); + fetch_path (_T("StatefilePath"), tmp, sizeof (tmp) / sizeof (TCHAR)); if (DirectorySelection (hDlg, &pathsguid, tmp)) { - set_path (L"StatefilePath", tmp); + set_path (_T("StatefilePath"), tmp); values_to_pathsdialog (hDlg); } break; case IDC_PATHS_SAVESTATE: GetWindowText (GetDlgItem (hDlg, IDC_PATHS_SAVESTATE), tmp, sizeof (tmp) / sizeof (TCHAR)); - set_path (L"StatefilePath", tmp); + set_path (_T("StatefilePath"), tmp); break; case IDC_PATHS_SAVEIMAGES: - fetch_path (L"SaveimagePath", tmp, sizeof (tmp) / sizeof (TCHAR)); + fetch_path (_T("SaveimagePath"), tmp, sizeof (tmp) / sizeof (TCHAR)); if (DirectorySelection (hDlg, &pathsguid, tmp)) { - set_path (L"SaveimagePath", tmp); + set_path (_T("SaveimagePath"), tmp); values_to_pathsdialog (hDlg); } break; case IDC_PATHS_SAVEIMAGE: GetWindowText (GetDlgItem (hDlg, IDC_PATHS_SAVEIMAGE), tmp, sizeof (tmp) / sizeof (TCHAR)); - set_path (L"SaveimagePath", tmp); + set_path (_T("SaveimagePath"), tmp); break; case IDC_PATHS_AVIOUTPUTS: - fetch_path (L"VideoPath", tmp, sizeof (tmp) / sizeof (TCHAR)); + fetch_path (_T("VideoPath"), tmp, sizeof (tmp) / sizeof (TCHAR)); if (DirectorySelection (hDlg, &pathsguid, tmp)) { - set_path (L"VideoPath", tmp); + set_path (_T("VideoPath"), tmp); values_to_pathsdialog (hDlg); } break; case IDC_PATHS_RIPS: - fetch_path (L"RipperPath", tmp, sizeof (tmp) / sizeof (TCHAR)); + fetch_path (_T("RipperPath"), tmp, sizeof (tmp) / sizeof (TCHAR)); if (DirectorySelection (hDlg, &pathsguid, tmp)) { - set_path (L"RipperPath", tmp); + set_path (_T("RipperPath"), tmp); values_to_pathsdialog (hDlg); } break; case IDC_PATHS_AVIOUTPUT: GetWindowText (GetDlgItem (hDlg, IDC_PATHS_AVIOUTPUT), tmp, sizeof (tmp) / sizeof (TCHAR)); - set_path (L"VideoPath", tmp); + set_path (_T("VideoPath"), tmp); break; case IDC_PATHS_RIP: GetWindowText (GetDlgItem (hDlg, IDC_PATHS_RIP), tmp, sizeof (tmp) / sizeof (TCHAR)); - set_path (L"RipperPath", tmp); + set_path (_T("RipperPath"), tmp); break; case IDC_PATHS_DEFAULT: val = SendDlgItemMessage (hDlg, IDC_PATHS_DEFAULTTYPE, CB_GETCURSEL, 0, 0L); @@ -4795,14 +4795,14 @@ static INT_PTR CALLBACK PathsDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM } SetCurrentDirectory (start_path_data); setpathmode (path_type); - set_path (L"KickstartPath", NULL, path_type); - set_path (L"ConfigurationPath", NULL, path_type); - set_path (L"ScreenshotPath", NULL, path_type); - set_path (L"StatefilePath", NULL, path_type); - set_path (L"SaveimagePath", NULL, path_type); - set_path (L"VideoPath", NULL, path_type); - set_path (L"RipperPath", NULL, path_type); - set_path (L"InputPath", NULL, path_type); + set_path (_T("KickstartPath"), NULL, path_type); + set_path (_T("ConfigurationPath"), NULL, path_type); + set_path (_T("ScreenshotPath"), NULL, path_type); + set_path (_T("StatefilePath"), NULL, path_type); + set_path (_T("SaveimagePath"), NULL, path_type); + set_path (_T("VideoPath"), NULL, path_type); + set_path (_T("RipperPath"), NULL, path_type); + set_path (_T("InputPath"), NULL, path_type); values_to_pathsdialog (hDlg); FreeConfigStore (); } @@ -4818,11 +4818,11 @@ static INT_PTR CALLBACK PathsDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM break; case IDC_PATHS_CONFIGCACHE: configurationcache = ischecked (hDlg, IDC_PATHS_CONFIGCACHE) ? 1 : 0; - regsetint (NULL, L"ConfigurationCache", configurationcache); + regsetint (NULL, _T("ConfigurationCache"), configurationcache); break; case IDC_PATHS_RELATIVE: relativepaths = ischecked (hDlg, IDC_PATHS_RELATIVE) ? 1 : 0; - regsetint (NULL, L"RelativePaths", relativepaths); + regsetint (NULL, _T("RelativePaths"), relativepaths); break; } @@ -4908,16 +4908,16 @@ static void init_quickstartdlg (HWND hDlg) TCHAR *p1, *p2; qssize = sizeof (tmp1) / sizeof (TCHAR); - regquerystr (NULL, L"QuickStartHostConfig", hostconf, &qssize); + regquerystr (NULL, _T("QuickStartHostConfig"), hostconf, &qssize); if (firsttime == 0 && workprefs.start_gui) { - regqueryint (NULL, L"QuickStartModel", &quickstart_model); - regqueryint (NULL, L"QuickStartConfiguration", &quickstart_conf); - regqueryint (NULL, L"QuickStartCompatibility", &quickstart_compa); - regqueryint (NULL, L"QuickStartFloppies", &quickstart_floppy); - regqueryint (NULL, L"QuickStartCDType", &quickstart_cdtype); + regqueryint (NULL, _T("QuickStartModel"), &quickstart_model); + regqueryint (NULL, _T("QuickStartConfiguration"), &quickstart_conf); + regqueryint (NULL, _T("QuickStartCompatibility"), &quickstart_compa); + regqueryint (NULL, _T("QuickStartFloppies"), &quickstart_floppy); + regqueryint (NULL, _T("QuickStartCDType"), &quickstart_cdtype); int size = sizeof quickstart_cddrive / sizeof (TCHAR); - regquerystr (NULL, L"QuickStartCDDrive", quickstart_cddrive, &size); - regqueryint (NULL, L"QuickStartNTSC", &quickstart_ntsc); + regquerystr (NULL, _T("QuickStartCDDrive"), quickstart_cddrive, &size); + regqueryint (NULL, _T("QuickStartNTSC"), &quickstart_ntsc); if (quickstart) { workprefs.floppyslots[0].df[0] = 0; workprefs.floppyslots[1].df[0] = 0; @@ -4935,7 +4935,7 @@ static void init_quickstartdlg (HWND hDlg) CheckDlgButton (hDlg, IDC_NTSC, quickstart_ntsc != 0); WIN32GUI_LoadUIString (IDS_QS_MODELS, tmp1, sizeof (tmp1) / sizeof (TCHAR)); - _tcscat (tmp1, L"\n"); + _tcscat (tmp1, _T("\n")); p1 = tmp1; SendDlgItemMessage (hDlg, IDC_QUICKSTART_MODEL, CB_RESETCONTENT, 0, 0L); idx = idx2 = 0; @@ -4967,7 +4967,7 @@ static void init_quickstartdlg (HWND hDlg) xfree (rl); } else { WIN32GUI_LoadUIString (amodels[quickstart_model].id, tmp1, sizeof (tmp1) / sizeof (TCHAR)); - _tcscat (tmp1, L"\n"); + _tcscat (tmp1, _T("\n")); p1 = tmp1; init_quickstartdlg_tooltip (hDlg, 0); total = 0; @@ -5018,9 +5018,9 @@ static void init_quickstartdlg (HWND hDlg) } } SendDlgItemMessage (hDlg, IDC_QUICKSTART_HOSTCONFIG, CB_SETCURSEL, idx, 0); - regsetint (NULL, L"QuickStartModel", quickstart_model); - regsetint (NULL, L"QuickStartConfiguration", quickstart_conf); - regsetint (NULL, L"QuickStartCompatibility", quickstart_compa); + regsetint (NULL, _T("QuickStartModel"), quickstart_model); + regsetint (NULL, _T("QuickStartConfiguration"), quickstart_conf); + regsetint (NULL, _T("QuickStartCompatibility"), quickstart_compa); } static void floppytooltip (HWND hDlg, int num, uae_u32 crc32); @@ -5214,7 +5214,7 @@ static INT_PTR CALLBACK QuickstartDlgProc (HWND hDlg, UINT msg, WPARAM wParam, L val = SendDlgItemMessage (hDlg, IDC_QUICKSTART_HOSTCONFIG, CB_GETCURSEL, 0, 0); if (val != CB_ERR) { SendDlgItemMessage (hDlg, IDC_QUICKSTART_HOSTCONFIG, CB_GETLBTEXT, (WPARAM)val, (LPARAM)tmp); - regsetstr (NULL, L"QuickStartHostConfig", tmp); + regsetstr (NULL, _T("QuickStartHostConfig"), tmp); quickstarthost (hDlg, tmp); if (val == 0 && quickstart) load_quickstart (hDlg, 0); @@ -5226,7 +5226,7 @@ static INT_PTR CALLBACK QuickstartDlgProc (HWND hDlg, UINT msg, WPARAM wParam, L { case IDC_NTSC: quickstart_ntsc = ischecked (hDlg, IDC_NTSC); - regsetint (NULL, L"QuickStartNTSC", quickstart_ntsc); + regsetint (NULL, _T("QuickStartNTSC"), quickstart_ntsc); if (quickstart) { init_quickstartdlg (hDlg); load_quickstart (hDlg, 0); @@ -5234,7 +5234,7 @@ static INT_PTR CALLBACK QuickstartDlgProc (HWND hDlg, UINT msg, WPARAM wParam, L break; case IDC_QUICKSTARTMODE: quickstart = ischecked (hDlg, IDC_QUICKSTARTMODE); - regsetint (NULL, L"QuickStartMode", quickstart); + regsetint (NULL, _T("QuickStartMode"), quickstart); quickstart_cd = 0; if (quickstart) { init_quickstartdlg (hDlg); @@ -5305,13 +5305,13 @@ static void init_aboutdlg (HWND hDlg) CharFormat.cbSize = sizeof (CharFormat); - SetDlgItemText (hDlg, IDC_RICHEDIT1, L"WinUAE"); + SetDlgItemText (hDlg, IDC_RICHEDIT1, _T("WinUAE")); SendDlgItemMessage (hDlg, IDC_RICHEDIT1, EM_GETCHARFORMAT, 0, (LPARAM) & CharFormat); CharFormat.dwMask |= CFM_BOLD | CFM_SIZE | CFM_FACE; CharFormat.dwEffects = CFE_BOLD; CharFormat.yHeight = 18 * 20; /* height in twips, where a twip is 1/20th of a point - for a pt.size of 18 */ - _tcscpy (CharFormat.szFaceName, L"Times New Roman"); + _tcscpy (CharFormat.szFaceName, _T("Times New Roman")); SendDlgItemMessage (hDlg, IDC_RICHEDIT1, EM_SETCHARFORMAT, SCF_ALL, (LPARAM) & CharFormat); SendDlgItemMessage (hDlg, IDC_RICHEDIT1, EM_SETBKGNDCOLOR, 0, GetSysColor (COLOR_3DFACE)); @@ -5319,7 +5319,7 @@ static void init_aboutdlg (HWND hDlg) SendDlgItemMessage (hDlg, IDC_RICHEDIT2, EM_GETCHARFORMAT, 0, (LPARAM) & CharFormat); CharFormat.dwMask |= CFM_SIZE | CFM_FACE; CharFormat.yHeight = 10 * 20; - _tcscpy (CharFormat.szFaceName, L"Times New Roman"); + _tcscpy (CharFormat.szFaceName, _T("Times New Roman")); SendDlgItemMessage (hDlg, IDC_RICHEDIT2, EM_SETCHARFORMAT, SCF_ALL, (LPARAM) & CharFormat); SendDlgItemMessage (hDlg, IDC_RICHEDIT2, EM_SETBKGNDCOLOR, 0, GetSysColor (COLOR_3DFACE)); @@ -5403,13 +5403,13 @@ static void init_frequency_combo (HWND hDlg, int dmode) for (i = 0; md->DisplayModes[dmode].refresh[i] > 0; i++) { int freq = md->DisplayModes[dmode].refresh[i]; int type = md->DisplayModes[dmode].refreshtype[i]; - _stprintf (hz, L"%dHz", freq); + _stprintf (hz, _T("%dHz"), freq); if (freq == 50 || freq == 100) - _tcscat (hz, L" PAL"); + _tcscat (hz, _T(" PAL")); if (freq == 60 || freq == 120) - _tcscat (hz, L" NTSC"); + _tcscat (hz, _T(" NTSC")); if (type) - _tcscat (hz, L" (*)"); + _tcscat (hz, _T(" (*)")); if (abs (workprefs.gfx_apmode[0].gfx_refreshrate) == freq) _tcscpy (hz2, hz); SendDlgItemMessage (hDlg, IDC_REFRESHRATE, CB_ADDSTRING, 0, (LPARAM)hz); @@ -5470,7 +5470,7 @@ static void set_da (HWND hDlg) int *p = getp_da (); TCHAR buf[10]; SendDlgItemMessage (hDlg, IDC_DA_SLIDER, TBM_SETPOS, TRUE, (*p) / 10); - _stprintf(buf, L"%.1f", (double)((*p) / 10.0)); + _stprintf(buf, _T("%.1f"), (double)((*p) / 10.0)); SetDlgItemText (hDlg, IDC_DA_TEXT, buf); } @@ -5505,9 +5505,9 @@ void init_da (HWND hDlg) { int *p; SendDlgItemMessage(hDlg, IDC_DA_MODE, CB_RESETCONTENT, 0, 0); - SendDlgItemMessage(hDlg, IDC_DA_MODE, CB_ADDSTRING, 0, (LPARAM)L"Brightness"); - SendDlgItemMessage(hDlg, IDC_DA_MODE, CB_ADDSTRING, 0, (LPARAM)L"Contrast"); - SendDlgItemMessage(hDlg, IDC_DA_MODE, CB_ADDSTRING, 0, (LPARAM)L"Gamma"); + SendDlgItemMessage(hDlg, IDC_DA_MODE, CB_ADDSTRING, 0, (LPARAM)_T("Brightness")); + SendDlgItemMessage(hDlg, IDC_DA_MODE, CB_ADDSTRING, 0, (LPARAM)_T("Contrast")); + SendDlgItemMessage(hDlg, IDC_DA_MODE, CB_ADDSTRING, 0, (LPARAM)_T("Gamma")); if (da_mode_selected == CB_ERR) da_mode_selected = 0; SendDlgItemMessage (hDlg, IDC_DA_MODE, CB_SETCURSEL, da_mode_selected, 0); @@ -5568,7 +5568,7 @@ static void init_display_mode (HWND hDlg) for (i = 0; md->DisplayModes[i].depth >= 0; i++) { if (md->DisplayModes[i].depth > 1 && md->DisplayModes[i].residx == md->DisplayModes[index].residx) { TCHAR tmp[64]; - _stprintf (tmp, L"%d", md->DisplayModes[i].depth * 8); + _stprintf (tmp, _T("%d"), md->DisplayModes[i].depth * 8); SendDlgItemMessage(hDlg, IDC_RESOLUTIONDEPTH, CB_ADDSTRING, 0, (LPARAM)tmp); if (md->DisplayModes[i].depth == d) SendDlgItemMessage (hDlg, IDC_RESOLUTIONDEPTH, CB_SETCURSEL, cnt, 0); @@ -5665,7 +5665,7 @@ static void values_to_displaydlg (HWND hDlg) if (cr->rate > 0) { _tcscpy (buffer, cr->label); if (!buffer[0]) - _stprintf (buffer, L":%d", i); + _stprintf (buffer, _T(":%d"), i); SendDlgItemMessage(hDlg, IDC_RATE2BOX, CB_ADDSTRING, 0, (LPARAM)buffer); d = workprefs.chipset_refreshrate; if (abs (d) < 1) @@ -5683,7 +5683,7 @@ static void values_to_displaydlg (HWND hDlg) selectcr = &workprefs.cr[workprefs.cr_selected]; SendDlgItemMessage(hDlg, IDC_RATE2BOX, CB_SETCURSEL, rates[workprefs.cr_selected], 0); SendDlgItemMessage (hDlg, IDC_FRAMERATE2, TBM_SETPOS, TRUE, (LPARAM)(selectcr->rate + 0.5)); - _stprintf (buffer, L"%.6f", selectcr->locked || full_property_sheet ? selectcr->rate : workprefs.chipset_refreshrate); + _stprintf (buffer, _T("%.6f"), selectcr->locked || full_property_sheet ? selectcr->rate : workprefs.chipset_refreshrate); SetDlgItemText (hDlg, IDC_RATE2TEXT, buffer); CheckDlgButton (hDlg, IDC_RATE2ENABLE, selectcr->locked); @@ -5731,7 +5731,7 @@ static void values_to_displaydlg (HWND hDlg) WIN32GUI_LoadUIString(IDS_SCREEN_FULLWINDOW, buffer, sizeof buffer / sizeof (TCHAR)); SendDlgItemMessage(hDlg, IDC_SCREENMODE_RTG, CB_ADDSTRING, 0, (LPARAM)buffer); - SendDlgItemMessage(hDlg, IDC_SCREENMODE_RTG2, CB_ADDSTRING, 0, (LPARAM)L"-"); + SendDlgItemMessage(hDlg, IDC_SCREENMODE_RTG2, CB_ADDSTRING, 0, (LPARAM)_T("-")); #if 0 WIN32GUI_LoadUIString(IDS_SCREEN_VSYNC, buffer, sizeof buffer / sizeof (TCHAR)); SendDlgItemMessage(hDlg, IDC_SCREENMODE_RTG2, CB_ADDSTRING, 0, (LPARAM)buffer); @@ -5789,9 +5789,9 @@ static void init_resolution_combo (HWND hDlg) SendDlgItemMessage(hDlg, IDC_RESOLUTION, CB_RESETCONTENT, 0, 0); for (i = 0; md->DisplayModes[i].depth >= 0; i++) { if (md->DisplayModes[i].depth > 1 && md->DisplayModes[i].residx != idx) { - _stprintf (tmp, L"%dx%d%s", md->DisplayModes[i].res.width, md->DisplayModes[i].res.height, md->DisplayModes[i].lace ? L"i" : L""); + _stprintf (tmp, _T("%dx%d%s"), md->DisplayModes[i].res.width, md->DisplayModes[i].res.height, md->DisplayModes[i].lace ? _T("i") : _T("")); if (md->DisplayModes[i].rawmode) - _tcscat (tmp, L" (*)"); + _tcscat (tmp, _T(" (*)")); SendDlgItemMessage(hDlg, IDC_RESOLUTION, CB_ADDSTRING, 0, (LPARAM)tmp); idx = md->DisplayModes[i].residx; } @@ -5800,7 +5800,7 @@ static void init_resolution_combo (HWND hDlg) static void init_displays_combo (HWND hDlg) { - TCHAR *adapter = L""; + TCHAR *adapter = _T(""); struct MultiDisplay *md = Displays; int cnt = 0, cnt2 = 0; int displaynum; @@ -5817,7 +5817,7 @@ static void init_displays_combo (HWND hDlg) cnt++; } TCHAR buf[MAX_DPATH]; - _stprintf (buf, L" %s", md->fullname); + _stprintf (buf, _T(" %s"), md->fullname); SendDlgItemMessage (hDlg, IDC_DISPLAYSELECT, CB_ADDSTRING, 0, (LPARAM)buf); if (displaynum == cnt2) idx = cnt; @@ -5832,7 +5832,7 @@ static void get_displays_combo (HWND hDlg) { struct MultiDisplay *md = Displays; LRESULT posn; - TCHAR *adapter = L""; + TCHAR *adapter = _T(""); int cnt = 0, cnt2 = 0; int displaynum; @@ -5955,7 +5955,7 @@ static void values_from_displaydlg (HWND hDlg, UINT msg, WPARAM wParam, LPARAM l } if (updaterate) { TCHAR buffer[20]; - _stprintf (buffer, L"%.6f", cr->rate); + _stprintf (buffer, _T("%.6f"), cr->rate); SetDlgItemText (hDlg, IDC_RATE2TEXT, buffer); } if (updateslider) { @@ -6196,28 +6196,28 @@ static INT_PTR CALLBACK ChipsetDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPAR currentpage = CHIPSET_ID; SendDlgItemMessage (hDlg, IDC_CS_EXT, CB_RESETCONTENT, 0, 0); - SendDlgItemMessage (hDlg, IDC_CS_EXT, CB_ADDSTRING, 0, (LPARAM)L""); + SendDlgItemMessage (hDlg, IDC_CS_EXT, CB_ADDSTRING, 0, (LPARAM)_T("")); WIN32GUI_LoadUIString(IDS_GENERIC, buffer, sizeof buffer / sizeof (TCHAR)); SendDlgItemMessage (hDlg, IDC_CS_EXT, CB_ADDSTRING, 0, (LPARAM)buffer); - SendDlgItemMessage (hDlg, IDC_CS_EXT, CB_ADDSTRING, 0, (LPARAM)L"CDTV"); - SendDlgItemMessage (hDlg, IDC_CS_EXT, CB_ADDSTRING, 0, (LPARAM)L"CD32"); - SendDlgItemMessage (hDlg, IDC_CS_EXT, CB_ADDSTRING, 0, (LPARAM)L"A500"); - SendDlgItemMessage (hDlg, IDC_CS_EXT, CB_ADDSTRING, 0, (LPARAM)L"A500+"); - SendDlgItemMessage (hDlg, IDC_CS_EXT, CB_ADDSTRING, 0, (LPARAM)L"A600"); - SendDlgItemMessage (hDlg, IDC_CS_EXT, CB_ADDSTRING, 0, (LPARAM)L"A1000"); - SendDlgItemMessage (hDlg, IDC_CS_EXT, CB_ADDSTRING, 0, (LPARAM)L"A1200"); - SendDlgItemMessage (hDlg, IDC_CS_EXT, CB_ADDSTRING, 0, (LPARAM)L"A2000"); - SendDlgItemMessage (hDlg, IDC_CS_EXT, CB_ADDSTRING, 0, (LPARAM)L"A3000"); - SendDlgItemMessage (hDlg, IDC_CS_EXT, CB_ADDSTRING, 0, (LPARAM)L"A3000T"); - SendDlgItemMessage (hDlg, IDC_CS_EXT, CB_ADDSTRING, 0, (LPARAM)L"A4000"); - SendDlgItemMessage (hDlg, IDC_CS_EXT, CB_ADDSTRING, 0, (LPARAM)L"A4000T"); + SendDlgItemMessage (hDlg, IDC_CS_EXT, CB_ADDSTRING, 0, (LPARAM)_T("CDTV")); + SendDlgItemMessage (hDlg, IDC_CS_EXT, CB_ADDSTRING, 0, (LPARAM)_T("CD32")); + SendDlgItemMessage (hDlg, IDC_CS_EXT, CB_ADDSTRING, 0, (LPARAM)_T("A500")); + SendDlgItemMessage (hDlg, IDC_CS_EXT, CB_ADDSTRING, 0, (LPARAM)_T("A500+")); + SendDlgItemMessage (hDlg, IDC_CS_EXT, CB_ADDSTRING, 0, (LPARAM)_T("A600")); + SendDlgItemMessage (hDlg, IDC_CS_EXT, CB_ADDSTRING, 0, (LPARAM)_T("A1000")); + SendDlgItemMessage (hDlg, IDC_CS_EXT, CB_ADDSTRING, 0, (LPARAM)_T("A1200")); + SendDlgItemMessage (hDlg, IDC_CS_EXT, CB_ADDSTRING, 0, (LPARAM)_T("A2000")); + SendDlgItemMessage (hDlg, IDC_CS_EXT, CB_ADDSTRING, 0, (LPARAM)_T("A3000")); + SendDlgItemMessage (hDlg, IDC_CS_EXT, CB_ADDSTRING, 0, (LPARAM)_T("A3000T")); + SendDlgItemMessage (hDlg, IDC_CS_EXT, CB_ADDSTRING, 0, (LPARAM)_T("A4000")); + SendDlgItemMessage (hDlg, IDC_CS_EXT, CB_ADDSTRING, 0, (LPARAM)_T("A4000T")); SendDlgItemMessage (hDlg, IDC_MONITOREMU, CB_RESETCONTENT, 0, 0); - SendDlgItemMessage (hDlg, IDC_MONITOREMU, CB_ADDSTRING, 0, (LPARAM)L"-"); + SendDlgItemMessage (hDlg, IDC_MONITOREMU, CB_ADDSTRING, 0, (LPARAM)_T("-")); WIN32GUI_LoadUIString(IDS_AUTODETECT, buffer, sizeof buffer / sizeof (TCHAR)); SendDlgItemMessage (hDlg, IDC_MONITOREMU, CB_ADDSTRING, 0, (LPARAM)buffer); - SendDlgItemMessage (hDlg, IDC_MONITOREMU, CB_ADDSTRING, 0, (LPARAM)L"A2024"); - SendDlgItemMessage (hDlg, IDC_MONITOREMU, CB_ADDSTRING, 0, (LPARAM)L"Graffiti"); + SendDlgItemMessage (hDlg, IDC_MONITOREMU, CB_ADDSTRING, 0, (LPARAM)_T("A2024")); + SendDlgItemMessage (hDlg, IDC_MONITOREMU, CB_ADDSTRING, 0, (LPARAM)_T("Graffiti")); #ifndef AGA ew (hDlg, IDC_AGA, FALSE); @@ -6302,20 +6302,20 @@ static void values_to_chipsetdlg2 (HWND hDlg) CheckDlgButton (hDlg, IDC_CS_IDE1, workprefs.cs_ide > 0 && (workprefs.cs_ide & 1)); CheckDlgButton (hDlg, IDC_CS_IDE2, workprefs.cs_ide > 0 && (workprefs.cs_ide & 2)); txt[0] = 0; - _stprintf (txt, L"%d", workprefs.cs_rtc_adjust); + _stprintf (txt, _T("%d"), workprefs.cs_rtc_adjust); SetDlgItemText(hDlg, IDC_CS_RTCADJUST, txt); txt[0] = 0; if (workprefs.cs_fatgaryrev >= 0) - _stprintf (txt, L"%02X", workprefs.cs_fatgaryrev); + _stprintf (txt, _T("%02X"), workprefs.cs_fatgaryrev); SetDlgItemText(hDlg, IDC_CS_FATGARYREV, txt); txt[0] = 0; if (workprefs.cs_ramseyrev >= 0) - _stprintf (txt, L"%02X", workprefs.cs_ramseyrev); + _stprintf (txt, _T("%02X"), workprefs.cs_ramseyrev); SetDlgItemText(hDlg, IDC_CS_RAMSEYREV, txt); txt[0] = 0; if (workprefs.cs_agnusrev >= 0) { rev = workprefs.cs_agnusrev; - _stprintf (txt, L"%02X", rev); + _stprintf (txt, _T("%02X"), rev); } else if (workprefs.cs_compatible) { rev = 0; if (workprefs.ntscmode) @@ -6324,20 +6324,20 @@ static void values_to_chipsetdlg2 (HWND hDlg) rev |= (currprefs.chipset_mask & CSMASK_ECS_AGNUS) ? 0x20 : 0; if (workprefs.chipmem_size > 1024 * 1024 && (workprefs.chipset_mask & CSMASK_ECS_AGNUS)) rev |= 0x21; - _stprintf (txt, L"%02X", rev); + _stprintf (txt, _T("%02X"), rev); } SetDlgItemText(hDlg, IDC_CS_AGNUSREV, txt); txt[0] = 0; if (workprefs.cs_deniserev >= 0) { rev = workprefs.cs_deniserev; - _stprintf (txt, L"%01.1X", rev); + _stprintf (txt, _T("%01.1X"), rev); } else if (workprefs.cs_compatible) { rev = 0xf; if (workprefs.chipset_mask & CSMASK_ECS_DENISE) rev = 0xc; if (workprefs.chipset_mask & CSMASK_AGA) rev = 0x8; - _stprintf (txt, L"%01.1X", rev); + _stprintf (txt, _T("%01.1X"), rev); } SetDlgItemText(hDlg, IDC_CS_DENISEREV, txt); } @@ -6718,7 +6718,7 @@ static void values_to_memorydlg (HWND hDlg) (workprefs.win32_rtgvblankrate == 75) ? 6 : 0, 0); } else { TCHAR tmp[10]; - _stprintf (tmp, L"%d", workprefs.win32_rtgvblankrate); + _stprintf (tmp, _T("%d"), workprefs.win32_rtgvblankrate); SendDlgItemMessage (hDlg, IDC_RTG_VBLANKRATE, WM_SETTEXT, 0, (LPARAM)tmp); } @@ -6820,15 +6820,15 @@ static void expansion_net (HWND hDlg) SendDlgItemMessage (hDlg, IDC_NETDEVICE, CB_RESETCONTENT, 0, 0); WIN32GUI_LoadUIString (IDS_NETDISCONNECTED, tmp, sizeof tmp / sizeof (TCHAR)); SendDlgItemMessage (hDlg, IDC_NETDEVICE, CB_ADDSTRING, 0, (LPARAM)tmp); - if (!_tcscmp (workprefs.a2065name, L"none")) + if (!_tcscmp (workprefs.a2065name, _T("none"))) SendDlgItemMessage (hDlg, IDC_NETDEVICE, CB_SETCURSEL, 0, 0); cnt = 1; for (i = 0; ndd && i < MAX_TOTAL_NET_DEVICES; i++) { if (ndd[i].active) { TCHAR mac[20]; - _stprintf (mac, L"%02X:%02X:%02X:%02X:%02X:%02X", + _stprintf (mac, _T("%02X:%02X:%02X:%02X:%02X:%02X"), ndd[i].mac[0], ndd[i].mac[1], ndd[i].mac[2], ndd[i].mac[3], ndd[i].mac[4], ndd[i].mac[5]); - _stprintf (tmp, L"%s %s", mac, ndd[i].desc); + _stprintf (tmp, _T("%s %s"), mac, ndd[i].desc); SendDlgItemMessage (hDlg, IDC_NETDEVICE, CB_ADDSTRING, 0, (LPARAM)tmp); if (!_tcsicmp (workprefs.a2065name, mac) || !_tcsicmp (workprefs.a2065name, ndd[i].name)) SendDlgItemMessage (hDlg, IDC_NETDEVICE, CB_SETCURSEL, cnt, 0); @@ -6888,52 +6888,52 @@ static INT_PTR CALLBACK ExpansionDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LP } expansion_net (hDlg); SendDlgItemMessage (hDlg, IDC_RTG_Z2Z3, CB_RESETCONTENT, 0, 0); - SendDlgItemMessage (hDlg, IDC_RTG_Z2Z3, CB_ADDSTRING, 0, (LPARAM)L"Zorro II"); - SendDlgItemMessage (hDlg, IDC_RTG_Z2Z3, CB_ADDSTRING, 0, (LPARAM)L"Zorro III (*)"); + SendDlgItemMessage (hDlg, IDC_RTG_Z2Z3, CB_ADDSTRING, 0, (LPARAM)_T("Zorro II")); + SendDlgItemMessage (hDlg, IDC_RTG_Z2Z3, CB_ADDSTRING, 0, (LPARAM)_T("Zorro III (*)")); WIN32GUI_LoadUIString(IDS_ALL, tmp, sizeof tmp / sizeof (TCHAR)); SendDlgItemMessage (hDlg, IDC_RTG_8BIT, CB_RESETCONTENT, 0, 0); - SendDlgItemMessage (hDlg, IDC_RTG_8BIT, CB_ADDSTRING, 0, (LPARAM)L"(8bit)"); - SendDlgItemMessage (hDlg, IDC_RTG_8BIT, CB_ADDSTRING, 0, (LPARAM)L"8-bit (*)"); + SendDlgItemMessage (hDlg, IDC_RTG_8BIT, CB_ADDSTRING, 0, (LPARAM)_T("(8bit)")); + SendDlgItemMessage (hDlg, IDC_RTG_8BIT, CB_ADDSTRING, 0, (LPARAM)_T("8-bit (*)")); SendDlgItemMessage (hDlg, IDC_RTG_16BIT, CB_RESETCONTENT, 0, 0); - SendDlgItemMessage (hDlg, IDC_RTG_16BIT, CB_ADDSTRING, 0, (LPARAM)L"(15/16bit)"); + SendDlgItemMessage (hDlg, IDC_RTG_16BIT, CB_ADDSTRING, 0, (LPARAM)_T("(15/16bit)")); SendDlgItemMessage (hDlg, IDC_RTG_16BIT, CB_ADDSTRING, 0, (LPARAM)tmp); - SendDlgItemMessage (hDlg, IDC_RTG_16BIT, CB_ADDSTRING, 0, (LPARAM)L"R5G6B5PC (*)"); - SendDlgItemMessage (hDlg, IDC_RTG_16BIT, CB_ADDSTRING, 0, (LPARAM)L"R5G5B5PC"); - SendDlgItemMessage (hDlg, IDC_RTG_16BIT, CB_ADDSTRING, 0, (LPARAM)L"R5G6B5"); - SendDlgItemMessage (hDlg, IDC_RTG_16BIT, CB_ADDSTRING, 0, (LPARAM)L"R5G5B5"); - SendDlgItemMessage (hDlg, IDC_RTG_16BIT, CB_ADDSTRING, 0, (LPARAM)L"B5G6R5PC"); - SendDlgItemMessage (hDlg, IDC_RTG_16BIT, CB_ADDSTRING, 0, (LPARAM)L"B5G5R5PC"); + SendDlgItemMessage (hDlg, IDC_RTG_16BIT, CB_ADDSTRING, 0, (LPARAM)_T("R5G6B5PC (*)")); + SendDlgItemMessage (hDlg, IDC_RTG_16BIT, CB_ADDSTRING, 0, (LPARAM)_T("R5G5B5PC")); + SendDlgItemMessage (hDlg, IDC_RTG_16BIT, CB_ADDSTRING, 0, (LPARAM)_T("R5G6B5")); + SendDlgItemMessage (hDlg, IDC_RTG_16BIT, CB_ADDSTRING, 0, (LPARAM)_T("R5G5B5")); + SendDlgItemMessage (hDlg, IDC_RTG_16BIT, CB_ADDSTRING, 0, (LPARAM)_T("B5G6R5PC")); + SendDlgItemMessage (hDlg, IDC_RTG_16BIT, CB_ADDSTRING, 0, (LPARAM)_T("B5G5R5PC")); SendDlgItemMessage (hDlg, IDC_RTG_24BIT, CB_RESETCONTENT, 0, 0); - SendDlgItemMessage (hDlg, IDC_RTG_24BIT, CB_ADDSTRING, 0, (LPARAM)L"(24bit)"); + SendDlgItemMessage (hDlg, IDC_RTG_24BIT, CB_ADDSTRING, 0, (LPARAM)_T("(24bit)")); SendDlgItemMessage (hDlg, IDC_RTG_24BIT, CB_ADDSTRING, 0, (LPARAM)tmp); - SendDlgItemMessage (hDlg, IDC_RTG_24BIT, CB_ADDSTRING, 0, (LPARAM)L"R8G8B8"); - SendDlgItemMessage (hDlg, IDC_RTG_24BIT, CB_ADDSTRING, 0, (LPARAM)L"B8G8R8"); + SendDlgItemMessage (hDlg, IDC_RTG_24BIT, CB_ADDSTRING, 0, (LPARAM)_T("R8G8B8")); + SendDlgItemMessage (hDlg, IDC_RTG_24BIT, CB_ADDSTRING, 0, (LPARAM)_T("B8G8R8")); SendDlgItemMessage (hDlg, IDC_RTG_32BIT, CB_RESETCONTENT, 0, 0); - SendDlgItemMessage (hDlg, IDC_RTG_32BIT, CB_ADDSTRING, 0, (LPARAM)L"(32bit)"); + SendDlgItemMessage (hDlg, IDC_RTG_32BIT, CB_ADDSTRING, 0, (LPARAM)_T("(32bit)")); SendDlgItemMessage (hDlg, IDC_RTG_32BIT, CB_ADDSTRING, 0, (LPARAM)tmp); - SendDlgItemMessage (hDlg, IDC_RTG_32BIT, CB_ADDSTRING, 0, (LPARAM)L"A8R8G8B8"); - SendDlgItemMessage (hDlg, IDC_RTG_32BIT, CB_ADDSTRING, 0, (LPARAM)L"A8B8G8R8"); - SendDlgItemMessage (hDlg, IDC_RTG_32BIT, CB_ADDSTRING, 0, (LPARAM)L"R8G8B8A8"); - SendDlgItemMessage (hDlg, IDC_RTG_32BIT, CB_ADDSTRING, 0, (LPARAM)L"B8G8R8A8 (*)"); + SendDlgItemMessage (hDlg, IDC_RTG_32BIT, CB_ADDSTRING, 0, (LPARAM)_T("A8R8G8B8")); + SendDlgItemMessage (hDlg, IDC_RTG_32BIT, CB_ADDSTRING, 0, (LPARAM)_T("A8B8G8R8")); + SendDlgItemMessage (hDlg, IDC_RTG_32BIT, CB_ADDSTRING, 0, (LPARAM)_T("R8G8B8A8")); + SendDlgItemMessage (hDlg, IDC_RTG_32BIT, CB_ADDSTRING, 0, (LPARAM)_T("B8G8R8A8 (*)")); SendDlgItemMessage (hDlg, IDC_P96MEM, TBM_SETRANGE, TRUE, MAKELONG (MIN_P96_MEM, workprefs.rtgmem_type ? MAX_P96_MEM_Z3 : MAX_P96_MEM_Z2)); SendDlgItemMessage (hDlg, IDC_RTG_SCALE_ASPECTRATIO, CB_RESETCONTENT, 0, 0); WIN32GUI_LoadUIString (IDS_DISABLED, tmp, sizeof tmp / sizeof (TCHAR)); SendDlgItemMessage (hDlg, IDC_RTG_SCALE_ASPECTRATIO, CB_ADDSTRING, 0, (LPARAM)tmp); WIN32GUI_LoadUIString (IDS_AUTOMATIC, tmp, sizeof tmp / sizeof (TCHAR)); SendDlgItemMessage (hDlg, IDC_RTG_SCALE_ASPECTRATIO, CB_ADDSTRING, 0, (LPARAM)tmp); - SendDlgItemMessage (hDlg, IDC_RTG_SCALE_ASPECTRATIO, CB_ADDSTRING, 0, (LPARAM)L"4:3"); - SendDlgItemMessage (hDlg, IDC_RTG_SCALE_ASPECTRATIO, CB_ADDSTRING, 0, (LPARAM)L"5:4"); - SendDlgItemMessage (hDlg, IDC_RTG_SCALE_ASPECTRATIO, CB_ADDSTRING, 0, (LPARAM)L"15:9"); - SendDlgItemMessage (hDlg, IDC_RTG_SCALE_ASPECTRATIO, CB_ADDSTRING, 0, (LPARAM)L"16:9"); - SendDlgItemMessage (hDlg, IDC_RTG_SCALE_ASPECTRATIO, CB_ADDSTRING, 0, (LPARAM)L"16:10"); + SendDlgItemMessage (hDlg, IDC_RTG_SCALE_ASPECTRATIO, CB_ADDSTRING, 0, (LPARAM)_T("4:3")); + SendDlgItemMessage (hDlg, IDC_RTG_SCALE_ASPECTRATIO, CB_ADDSTRING, 0, (LPARAM)_T("5:4")); + SendDlgItemMessage (hDlg, IDC_RTG_SCALE_ASPECTRATIO, CB_ADDSTRING, 0, (LPARAM)_T("15:9")); + SendDlgItemMessage (hDlg, IDC_RTG_SCALE_ASPECTRATIO, CB_ADDSTRING, 0, (LPARAM)_T("16:9")); + SendDlgItemMessage (hDlg, IDC_RTG_SCALE_ASPECTRATIO, CB_ADDSTRING, 0, (LPARAM)_T("16:10")); SendDlgItemMessage (hDlg, IDC_RTG_VBLANKRATE, CB_RESETCONTENT, 0, 0); - SendDlgItemMessage (hDlg, IDC_RTG_VBLANKRATE, CB_ADDSTRING, 0, (LPARAM)L"Disabled"); - SendDlgItemMessage (hDlg, IDC_RTG_VBLANKRATE, CB_ADDSTRING, 0, (LPARAM)L"Chipset"); - SendDlgItemMessage (hDlg, IDC_RTG_VBLANKRATE, CB_ADDSTRING, 0, (LPARAM)L"Real"); - SendDlgItemMessage (hDlg, IDC_RTG_VBLANKRATE, CB_ADDSTRING, 0, (LPARAM)L"50"); - SendDlgItemMessage (hDlg, IDC_RTG_VBLANKRATE, CB_ADDSTRING, 0, (LPARAM)L"60"); - SendDlgItemMessage (hDlg, IDC_RTG_VBLANKRATE, CB_ADDSTRING, 0, (LPARAM)L"70"); - SendDlgItemMessage (hDlg, IDC_RTG_VBLANKRATE, CB_ADDSTRING, 0, (LPARAM)L"75"); + SendDlgItemMessage (hDlg, IDC_RTG_VBLANKRATE, CB_ADDSTRING, 0, (LPARAM)_T("Disabled")); + SendDlgItemMessage (hDlg, IDC_RTG_VBLANKRATE, CB_ADDSTRING, 0, (LPARAM)_T("Chipset")); + SendDlgItemMessage (hDlg, IDC_RTG_VBLANKRATE, CB_ADDSTRING, 0, (LPARAM)_T("Real")); + SendDlgItemMessage (hDlg, IDC_RTG_VBLANKRATE, CB_ADDSTRING, 0, (LPARAM)_T("50")); + SendDlgItemMessage (hDlg, IDC_RTG_VBLANKRATE, CB_ADDSTRING, 0, (LPARAM)_T("60")); + SendDlgItemMessage (hDlg, IDC_RTG_VBLANKRATE, CB_ADDSTRING, 0, (LPARAM)_T("70")); + SendDlgItemMessage (hDlg, IDC_RTG_VBLANKRATE, CB_ADDSTRING, 0, (LPARAM)_T("75")); SendDlgItemMessage(hDlg, IDC_RTG_BUFFERCNT, CB_RESETCONTENT, 0, 0); WIN32GUI_LoadUIString(IDS_BUFFER_DOUBLE, tmp, sizeof tmp / sizeof (TCHAR)); SendDlgItemMessage(hDlg, IDC_RTG_BUFFERCNT, CB_ADDSTRING, 0, (LPARAM)tmp); @@ -6983,7 +6983,7 @@ static INT_PTR CALLBACK ExpansionDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LP break; case IDC_A2065: if (ischecked (hDlg, IDC_A2065)) { - _tcscpy (workprefs.a2065name, L"none"); + _tcscpy (workprefs.a2065name, _T("none")); expansion_net (hDlg); enable_for_expansiondlg (hDlg); } else { @@ -7111,7 +7111,7 @@ static INT_PTR CALLBACK ExpansionDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LP v = SendDlgItemMessage (hDlg, IDC_NETDEVICE, CB_GETCURSEL, 0, 0L); if (v != CB_ERR) { if (v == 0) { - _tcscpy (workprefs.a2065name, L"none"); + _tcscpy (workprefs.a2065name, _T("none")); } else if (ndd) { v--; _tcscpy (workprefs.a2065name, ndd[v].name); @@ -7192,7 +7192,7 @@ static void addromfiles (UAEREG *fkey, HWND hDlg, DWORD d, TCHAR *path, int type rdx = scan_single_rom (path); SendDlgItemMessage(hDlg, d, CB_RESETCONTENT, 0, 0); - SendDlgItemMessage(hDlg, d, CB_ADDSTRING, 0, (LPARAM)L""); + SendDlgItemMessage(hDlg, d, CB_ADDSTRING, 0, (LPARAM)_T("")); idx = 0; seltmp[0] = 0; for (;fkey;) { @@ -7241,7 +7241,7 @@ static void getromfile (HWND hDlg, DWORD d, TCHAR *path, int size) if (rd) { struct romlist *rl = getromlistbyromdata(rd); if (rd->configname) - _stprintf (path, L":%s", rd->configname); + _stprintf (path, _T(":%s"), rd->configname); else if (rl) _tcsncpy (path, rl->path, size); } @@ -7259,7 +7259,7 @@ static void values_to_kickstartdlg (HWND hDlg) { UAEREG *fkey; - fkey = regcreatetree (NULL, L"DetectedROMs"); + fkey = regcreatetree (NULL, _T("DetectedROMs")); load_keyring(&workprefs, NULL); addromfiles (fkey, hDlg, IDC_ROMFILE, workprefs.romfile, ROMTYPE_KICK | ROMTYPE_KICKCD32); @@ -7292,7 +7292,7 @@ static void init_kickstart (HWND hDlg) ew (hDlg, IDC_CARTCHOOSER), FALSE); ew (hDlg, IDC_FLASHCHOOSER), FALSE); #endif - if (!regexiststree (NULL , L"DetectedROMs")) + if (!regexiststree (NULL , _T("DetectedROMs"))) scan_roms (NULL, rp_isactive () ? 0 : 1); } @@ -7466,16 +7466,16 @@ static void enable_for_miscdlg (HWND hDlg) static void misc_kbled (HWND hDlg, int v, int nv) { - TCHAR *defname = v == IDC_KBLED1 ? L"(NumLock)" : v == IDC_KBLED2 ? L"(CapsLock)" : L"(ScrollLock)"; + TCHAR *defname = v == IDC_KBLED1 ? _T("(NumLock)") : v == IDC_KBLED2 ? _T("(CapsLock)") : _T("(ScrollLock)"); SendDlgItemMessage (hDlg, v, CB_RESETCONTENT, 0, 0L); SendDlgItemMessage (hDlg, v, CB_ADDSTRING, 0, (LPARAM)defname); - SendDlgItemMessage (hDlg, v, CB_ADDSTRING, 0, (LPARAM)L"POWER"); - SendDlgItemMessage (hDlg, v, CB_ADDSTRING, 0, (LPARAM)L"DF0"); - SendDlgItemMessage (hDlg, v, CB_ADDSTRING, 0, (LPARAM)L"DF1"); - SendDlgItemMessage (hDlg, v, CB_ADDSTRING, 0, (LPARAM)L"DF2"); - SendDlgItemMessage (hDlg, v, CB_ADDSTRING, 0, (LPARAM)L"DF3"); - SendDlgItemMessage (hDlg, v, CB_ADDSTRING, 0, (LPARAM)L"HD"); - SendDlgItemMessage (hDlg, v, CB_ADDSTRING, 0, (LPARAM)L"CD"); + SendDlgItemMessage (hDlg, v, CB_ADDSTRING, 0, (LPARAM)_T("POWER")); + SendDlgItemMessage (hDlg, v, CB_ADDSTRING, 0, (LPARAM)_T("DF0")); + SendDlgItemMessage (hDlg, v, CB_ADDSTRING, 0, (LPARAM)_T("DF1")); + SendDlgItemMessage (hDlg, v, CB_ADDSTRING, 0, (LPARAM)_T("DF2")); + SendDlgItemMessage (hDlg, v, CB_ADDSTRING, 0, (LPARAM)_T("DF3")); + SendDlgItemMessage (hDlg, v, CB_ADDSTRING, 0, (LPARAM)_T("HD")); + SendDlgItemMessage (hDlg, v, CB_ADDSTRING, 0, (LPARAM)_T("CD")); SendDlgItemMessage (hDlg, v, CB_SETCURSEL, nv, 0); } @@ -7518,12 +7518,12 @@ extern const TCHAR *get_aspi_path (int); static void misc_scsi (HWND hDlg) { SendDlgItemMessage (hDlg, IDC_SCSIMODE, CB_RESETCONTENT, 0, 0); - SendDlgItemMessage (hDlg, IDC_SCSIMODE, CB_ADDSTRING, 0, (LPARAM)L"SCSI Emulation *"); - SendDlgItemMessage (hDlg, IDC_SCSIMODE, CB_ADDSTRING, 0, (LPARAM)L"SPTI"); - SendDlgItemMessage (hDlg, IDC_SCSIMODE, CB_ADDSTRING, 0, (LPARAM)L"SPTI + SCSI SCAN"); - SendDlgItemMessage (hDlg, IDC_SCSIMODE, CB_ADDSTRING, 0, (LPARAM)((get_aspi_path (0)) ? L"AdaptecASPI" : L"(AdaptecASPI)")); - SendDlgItemMessage (hDlg, IDC_SCSIMODE, CB_ADDSTRING, 0, (LPARAM)((get_aspi_path (1)) ? L"NeroASPI" : L"(NeroASPI)")); - SendDlgItemMessage (hDlg, IDC_SCSIMODE, CB_ADDSTRING, 0, (LPARAM)((get_aspi_path (2)) ? L"FrogASPI" : L"(FrogASPI)")); + SendDlgItemMessage (hDlg, IDC_SCSIMODE, CB_ADDSTRING, 0, (LPARAM)_T("SCSI Emulation *")); + SendDlgItemMessage (hDlg, IDC_SCSIMODE, CB_ADDSTRING, 0, (LPARAM)_T("SPTI")); + SendDlgItemMessage (hDlg, IDC_SCSIMODE, CB_ADDSTRING, 0, (LPARAM)_T("SPTI + SCSI SCAN")); + SendDlgItemMessage (hDlg, IDC_SCSIMODE, CB_ADDSTRING, 0, (LPARAM)((get_aspi_path (0)) ? _T("AdaptecASPI") : _T("(AdaptecASPI)"))); + SendDlgItemMessage (hDlg, IDC_SCSIMODE, CB_ADDSTRING, 0, (LPARAM)((get_aspi_path (1)) ? _T("NeroASPI") : _T("(NeroASPI)"))); + SendDlgItemMessage (hDlg, IDC_SCSIMODE, CB_ADDSTRING, 0, (LPARAM)((get_aspi_path (2)) ? _T("FrogASPI") : _T("(FrogASPI)"))); SendDlgItemMessage (hDlg, IDC_SCSIMODE, CB_SETCURSEL, workprefs.win32_uaescsimode, 0); } @@ -7532,11 +7532,11 @@ static void misc_lang (HWND hDlg) int i, idx = 0, cnt = 0, lid; WORD langid = -1; - if (regqueryint (NULL, L"Language", &lid)) + if (regqueryint (NULL, _T("Language"), &lid)) langid = (WORD)lid; SendDlgItemMessage (hDlg, IDC_LANGUAGE, CB_RESETCONTENT, 0, 0); - SendDlgItemMessage (hDlg, IDC_LANGUAGE, CB_ADDSTRING, 0, (LPARAM)L"Autodetect"); - SendDlgItemMessage (hDlg, IDC_LANGUAGE, CB_ADDSTRING, 0, (LPARAM)L"English (built-in)"); + SendDlgItemMessage (hDlg, IDC_LANGUAGE, CB_ADDSTRING, 0, (LPARAM)_T("Autodetect")); + SendDlgItemMessage (hDlg, IDC_LANGUAGE, CB_ADDSTRING, 0, (LPARAM)_T("English (built-in)")); if (langid == 0) idx = 1; cnt = 2; @@ -7572,7 +7572,7 @@ static void misc_setlang (int v) } if (v == -2) langid = -1; - regsetint (NULL, L"Language", langid); + regsetint (NULL, _T("Language"), langid); FreeLibrary(hUIDLL); hUIDLL = NULL; if (langid >= 0) @@ -7610,22 +7610,22 @@ static void values_to_miscdlg (HWND hDlg) misc_lang (hDlg); SendDlgItemMessage (hDlg, IDC_DXMODE, CB_RESETCONTENT, 0, 0); - SendDlgItemMessage (hDlg, IDC_DXMODE, CB_ADDSTRING, 0, (LPARAM)L"DirectDraw"); - SendDlgItemMessage (hDlg, IDC_DXMODE, CB_ADDSTRING, 0, (LPARAM)L"Direct3D"); + SendDlgItemMessage (hDlg, IDC_DXMODE, CB_ADDSTRING, 0, (LPARAM)_T("DirectDraw")); + SendDlgItemMessage (hDlg, IDC_DXMODE, CB_ADDSTRING, 0, (LPARAM)_T("Direct3D")); SendDlgItemMessage (hDlg, IDC_DXMODE, CB_SETCURSEL, workprefs.gfx_api, 0); SendDlgItemMessage (hDlg, IDC_DD_SURFACETYPE, CB_RESETCONTENT, 0, 0); - SendDlgItemMessage (hDlg, IDC_DD_SURFACETYPE, CB_ADDSTRING, 0, (LPARAM)L"NonLocalVRAM"); - SendDlgItemMessage (hDlg, IDC_DD_SURFACETYPE, CB_ADDSTRING, 0, (LPARAM)L"DefaultRAM *"); - SendDlgItemMessage (hDlg, IDC_DD_SURFACETYPE, CB_ADDSTRING, 0, (LPARAM)L"LocalVRAM"); - SendDlgItemMessage (hDlg, IDC_DD_SURFACETYPE, CB_ADDSTRING, 0, (LPARAM)L"SystemRAM"); + SendDlgItemMessage (hDlg, IDC_DD_SURFACETYPE, CB_ADDSTRING, 0, (LPARAM)_T("NonLocalVRAM")); + SendDlgItemMessage (hDlg, IDC_DD_SURFACETYPE, CB_ADDSTRING, 0, (LPARAM)_T("DefaultRAM *")); + SendDlgItemMessage (hDlg, IDC_DD_SURFACETYPE, CB_ADDSTRING, 0, (LPARAM)_T("LocalVRAM")); + SendDlgItemMessage (hDlg, IDC_DD_SURFACETYPE, CB_ADDSTRING, 0, (LPARAM)_T("SystemRAM")); SendDlgItemMessage (hDlg, IDC_DD_SURFACETYPE, CB_SETCURSEL, ddforceram, 0); SendDlgItemMessage (hDlg, IDC_WINDOWEDMODE, CB_RESETCONTENT, 0, 0); - SendDlgItemMessage (hDlg, IDC_WINDOWEDMODE, CB_ADDSTRING, 0, (LPARAM)L"Borderless"); - SendDlgItemMessage (hDlg, IDC_WINDOWEDMODE, CB_ADDSTRING, 0, (LPARAM)L"Minimal"); - SendDlgItemMessage (hDlg, IDC_WINDOWEDMODE, CB_ADDSTRING, 0, (LPARAM)L"Standard"); - SendDlgItemMessage (hDlg, IDC_WINDOWEDMODE, CB_ADDSTRING, 0, (LPARAM)L"Extended"); + SendDlgItemMessage (hDlg, IDC_WINDOWEDMODE, CB_ADDSTRING, 0, (LPARAM)_T("Borderless")); + SendDlgItemMessage (hDlg, IDC_WINDOWEDMODE, CB_ADDSTRING, 0, (LPARAM)_T("Minimal")); + SendDlgItemMessage (hDlg, IDC_WINDOWEDMODE, CB_ADDSTRING, 0, (LPARAM)_T("Standard")); + SendDlgItemMessage (hDlg, IDC_WINDOWEDMODE, CB_ADDSTRING, 0, (LPARAM)_T("Extended")); SendDlgItemMessage (hDlg, IDC_WINDOWEDMODE, CB_SETCURSEL, workprefs.win32_borderless ? 0 : (workprefs.win32_statusbar + 1), 0); @@ -7671,7 +7671,7 @@ static INT_PTR MiscDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) _tcscpy (path, s); xfree (s); if (DiskSelection(hDlg, wParam, 9, &workprefs, path)) - save_state (savestate_fname, L"Description!"); + save_state (savestate_fname, _T("Description!")); } } else if (GetDlgCtrlID((HWND)wParam) == IDC_DOLOADSTATE) { TCHAR *s = favoritepopup (hDlg); @@ -7744,7 +7744,7 @@ static INT_PTR MiscDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) v = SendDlgItemMessage (hDlg, IDC_DD_SURFACETYPE, CB_GETCURSEL, 0, 0L); if (v != CB_ERR) { ddforceram = v; - regsetint (NULL, L"DirectDraw_Secondary", ddforceram); + regsetint (NULL, _T("DirectDraw_Secondary"), ddforceram); } break; case IDC_SCSIMODE: @@ -7776,7 +7776,7 @@ static INT_PTR MiscDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) break; case IDC_DOSAVESTATE: if (DiskSelection(hDlg, wParam, 9, &workprefs, 0)) - save_state (savestate_fname, L"Description!"); + save_state (savestate_fname, _T("Description!")); break; case IDC_DOLOADSTATE: if (DiskSelection(hDlg, wParam, 10, &workprefs, 0)) @@ -7963,7 +7963,7 @@ static int getcpufreq (int m) static void values_to_cpudlg (HWND hDlg) { - TCHAR cache[8] = L""; + TCHAR cache[8] = _T(""); int cpu; SendDlgItemMessage (hDlg, IDC_SPEED, TBM_SETPOS, TRUE, workprefs.m68k_speed <= 0 ? 1 : workprefs.m68k_speed / CYCLE_UNIT ); @@ -7988,7 +7988,7 @@ static void values_to_cpudlg (HWND hDlg) CheckRadioButton (hDlg, IDC_TRUST0, IDC_TRUST1, trust_ids[workprefs.comptrustbyte]); SendDlgItemMessage (hDlg, IDC_CACHE, TBM_SETPOS, TRUE, workprefs.cachesize / 1024); - _stprintf (cache, L"%d MB", workprefs.cachesize / 1024 ); + _stprintf (cache, _T("%d MB"), workprefs.cachesize / 1024 ); SetDlgItemText (hDlg, IDC_CACHETEXT, cache); CheckDlgButton (hDlg, IDC_NOFLAGS, workprefs.compnf); @@ -8002,11 +8002,11 @@ static void values_to_cpudlg (HWND hDlg) if (workprefs.cpu_clock_multiplier) { TCHAR txt[20]; double f = getcpufreq (workprefs.cpu_clock_multiplier); - _stprintf (txt, L"%.6f", f / 1000000.0); + _stprintf (txt, _T("%.6f"), f / 1000000.0); SendDlgItemMessage (hDlg, IDC_CPU_FREQUENCY2, WM_SETTEXT, 0, (LPARAM)txt); } } else { - SendDlgItemMessage (hDlg, IDC_CPU_FREQUENCY2, WM_SETTEXT, 0, (LPARAM)L""); + SendDlgItemMessage (hDlg, IDC_CPU_FREQUENCY2, WM_SETTEXT, 0, (LPARAM)_T("")); } } @@ -8155,10 +8155,10 @@ static INT_PTR CALLBACK CPUDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM l SendDlgItemMessage (hDlg, IDC_CPUIDLE, TBM_SETPAGESIZE, 0, 1); SendDlgItemMessage (hDlg, IDC_CPU_FREQUENCY, CB_RESETCONTENT, 0, 0); - SendDlgItemMessage (hDlg, IDC_CPU_FREQUENCY, CB_ADDSTRING, 0, (LPARAM)L"A500"); - SendDlgItemMessage (hDlg, IDC_CPU_FREQUENCY, CB_ADDSTRING, 0, (LPARAM)L"A1200"); - SendDlgItemMessage (hDlg, IDC_CPU_FREQUENCY, CB_ADDSTRING, 0, (LPARAM)L"2x"); - SendDlgItemMessage (hDlg, IDC_CPU_FREQUENCY, CB_ADDSTRING, 0, (LPARAM)L"Custom"); + SendDlgItemMessage (hDlg, IDC_CPU_FREQUENCY, CB_ADDSTRING, 0, (LPARAM)_T("A500")); + SendDlgItemMessage (hDlg, IDC_CPU_FREQUENCY, CB_ADDSTRING, 0, (LPARAM)_T("A1200")); + SendDlgItemMessage (hDlg, IDC_CPU_FREQUENCY, CB_ADDSTRING, 0, (LPARAM)_T("2x")); + SendDlgItemMessage (hDlg, IDC_CPU_FREQUENCY, CB_ADDSTRING, 0, (LPARAM)_T("Custom")); idx = 3; if (workprefs.cpu_clock_multiplier == 2 << 8 || (workprefs.cpu_clock_multiplier == 0 && workprefs.cpu_frequency == 0 && workprefs.cpu_model <= 68010)) { @@ -8180,7 +8180,7 @@ static INT_PTR CALLBACK CPUDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM l SendDlgItemMessage (hDlg, IDC_CPU_FREQUENCY, CB_SETCURSEL, idx, 0); if (!workprefs.cpu_clock_multiplier) { TCHAR txt[20]; - _stprintf (txt, L"%.6f", workprefs.cpu_frequency / 1000000.0); + _stprintf (txt, _T("%.6f"), workprefs.cpu_frequency / 1000000.0); SendDlgItemMessage (hDlg, IDC_CPU_FREQUENCY2, WM_SETTEXT, 0, (LPARAM)txt); } recursive--; @@ -8270,8 +8270,8 @@ static void sound_loaddrivesamples (void) free (drivesounds); p = drivesounds = 0; - get_plugin_path (dirname, sizeof dirname / sizeof (TCHAR), L"floppysounds"); - _tcscat (dirname, L"*.wav"); + get_plugin_path (dirname, sizeof dirname / sizeof (TCHAR), _T("floppysounds")); + _tcscat (dirname, _T("*.wav")); h = FindFirstFile (dirname, &fd); if (h == INVALID_HANDLE_VALUE) return; @@ -8319,15 +8319,15 @@ static void update_soundgui (HWND hDlg) TCHAR txt[20]; bufsize = getsoundbufsizeindex (workprefs.sound_maxbsiz) + 1; - _stprintf (txt, L"%d", bufsize); + _stprintf (txt, _T("%d"), bufsize); SetDlgItemText (hDlg, IDC_SOUNDBUFFERMEM, txt); SendDlgItemMessage (hDlg, IDC_SOUNDVOLUME, TBM_SETPOS, TRUE, 100 - workprefs.sound_volume); - _stprintf (txt, L"%d%%", 100 - workprefs.sound_volume); + _stprintf (txt, _T("%d%%"), 100 - workprefs.sound_volume); SetDlgItemText (hDlg, IDC_SOUNDVOLUME2, txt); SendDlgItemMessage (hDlg, IDC_SOUNDDRIVEVOLUME, TBM_SETPOS, TRUE, 100 - workprefs.dfxclickvolume); - _stprintf (txt, L"%d%%", 100 - workprefs.dfxclickvolume); + _stprintf (txt, _T("%d%%"), 100 - workprefs.dfxclickvolume); SetDlgItemText (hDlg, IDC_SOUNDDRIVEVOLUME2, txt); } @@ -8386,7 +8386,7 @@ static void values_to_sounddlg (HWND hDlg) SendDlgItemMessage (hDlg, IDC_SOUNDSTEREO, CB_SETCURSEL, workprefs.sound_stereo, 0); SendDlgItemMessage (hDlg, IDC_SOUNDSWAP, CB_RESETCONTENT, 0, 0); - SendDlgItemMessage (hDlg, IDC_SOUNDSWAP, CB_ADDSTRING, 0, (LPARAM)L"-"); + SendDlgItemMessage (hDlg, IDC_SOUNDSWAP, CB_ADDSTRING, 0, (LPARAM)_T("-")); WIN32GUI_LoadUIString (IDS_SOUND_SWAP_PAULA, txt, sizeof (txt) / sizeof (TCHAR)); SendDlgItemMessage (hDlg, IDC_SOUNDSWAP, CB_ADDSTRING, 0, (LPARAM)txt); WIN32GUI_LoadUIString (IDS_SOUND_SWAP_AHI, txt, sizeof (txt) / sizeof (TCHAR)); @@ -8398,15 +8398,15 @@ static void values_to_sounddlg (HWND hDlg) SendDlgItemMessage (hDlg, IDC_SOUNDSTEREOSEP, CB_RESETCONTENT, 0, 0); for (i = 10; i >= 0; i--) { - _stprintf (txt, L"%d%%", i * 10); + _stprintf (txt, _T("%d%%"), i * 10); SendDlgItemMessage (hDlg, IDC_SOUNDSTEREOSEP, CB_ADDSTRING, 0, (LPARAM)txt); } SendDlgItemMessage (hDlg, IDC_SOUNDSTEREOSEP, CB_SETCURSEL, 10 - workprefs.sound_stereo_separation, 0); SendDlgItemMessage (hDlg, IDC_SOUNDSTEREOMIX, CB_RESETCONTENT, 0, 0); - SendDlgItemMessage (hDlg, IDC_SOUNDSTEREOMIX, CB_ADDSTRING, 0, (LPARAM)L"-"); + SendDlgItemMessage (hDlg, IDC_SOUNDSTEREOMIX, CB_ADDSTRING, 0, (LPARAM)_T("-")); for (i = 0; i < 10; i++) { - _stprintf (txt, L"%d", i + 1); + _stprintf (txt, _T("%d"), i + 1); SendDlgItemMessage (hDlg, IDC_SOUNDSTEREOMIX, CB_ADDSTRING, 0, (LPARAM)txt); } SendDlgItemMessage (hDlg, IDC_SOUNDSTEREOMIX, CB_SETCURSEL, @@ -8415,21 +8415,21 @@ static void values_to_sounddlg (HWND hDlg) SendDlgItemMessage (hDlg, IDC_SOUNDINTERPOLATION, CB_RESETCONTENT, 0, 0); WIN32GUI_LoadUIString (IDS_DISABLED, txt, sizeof (txt) / sizeof (TCHAR)); SendDlgItemMessage (hDlg, IDC_SOUNDINTERPOLATION, CB_ADDSTRING, 0, (LPARAM)txt); - SendDlgItemMessage (hDlg, IDC_SOUNDINTERPOLATION, CB_ADDSTRING, 0, (LPARAM)L"Anti"); - SendDlgItemMessage (hDlg, IDC_SOUNDINTERPOLATION, CB_ADDSTRING, 0, (LPARAM)L"Sinc"); - SendDlgItemMessage (hDlg, IDC_SOUNDINTERPOLATION, CB_ADDSTRING, 0, (LPARAM)L"RH"); - SendDlgItemMessage (hDlg, IDC_SOUNDINTERPOLATION, CB_ADDSTRING, 0, (LPARAM)L"Crux"); + SendDlgItemMessage (hDlg, IDC_SOUNDINTERPOLATION, CB_ADDSTRING, 0, (LPARAM)_T("Anti")); + SendDlgItemMessage (hDlg, IDC_SOUNDINTERPOLATION, CB_ADDSTRING, 0, (LPARAM)_T("Sinc")); + SendDlgItemMessage (hDlg, IDC_SOUNDINTERPOLATION, CB_ADDSTRING, 0, (LPARAM)_T("RH")); + SendDlgItemMessage (hDlg, IDC_SOUNDINTERPOLATION, CB_ADDSTRING, 0, (LPARAM)_T("Crux")); SendDlgItemMessage (hDlg, IDC_SOUNDINTERPOLATION, CB_SETCURSEL, workprefs.sound_interpol, 0); SendDlgItemMessage (hDlg, IDC_SOUNDFREQ, CB_RESETCONTENT, 0, 0); i = 0; selected = -1; while (soundfreqs[i]) { - _stprintf (txt, L"%d", soundfreqs[i]); + _stprintf (txt, _T("%d"), soundfreqs[i]); SendDlgItemMessage (hDlg, IDC_SOUNDFREQ, CB_ADDSTRING, 0, (LPARAM)txt); i++; } - _stprintf (txt, L"%d", workprefs.sound_freq); + _stprintf (txt, _T("%d"), workprefs.sound_freq); SendDlgItemMessage (hDlg, IDC_SOUNDFREQ, WM_SETTEXT, 0, (LPARAM)txt); switch (workprefs.produce_sound) @@ -8456,7 +8456,7 @@ static void values_to_sounddlg (HWND hDlg) idx = 0; SendDlgItemMessage (hDlg, IDC_SOUNDDRIVE, CB_RESETCONTENT, 0, 0); for (i = 0; i < 4; i++) { - _stprintf (txt, L"DF%d:", i); + _stprintf (txt, _T("DF%d:"), i); SendDlgItemMessage (hDlg, IDC_SOUNDDRIVE, CB_ADDSTRING, 0, (LPARAM)txt); } SendDlgItemMessage (hDlg, IDC_SOUNDDRIVE, CB_SETCURSEL, idx, 0); @@ -8579,7 +8579,7 @@ static void values_from_sounddlg (HWND hDlg) if (ischecked (hDlg, sounddrivers[i])) sounddrivermask |= 1 << i; if (old != sounddrivermask) - regsetint (NULL, L"SoundDriverMask", sounddrivermask); + regsetint (NULL, _T("SoundDriverMask"), sounddrivermask); } idx = SendDlgItemMessage (hDlg, IDC_SOUNDDRIVE, CB_GETCURSEL, 0, 0); @@ -8634,8 +8634,8 @@ static INT_PTR CALLBACK SoundDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM for (card = 0; card < numdevs; card++) { TCHAR tmp[MAX_DPATH]; int type = sound_devices[card]->type; - _stprintf (tmp, L"%s: %s", - type == SOUND_DEVICE_XAUDIO2 ? L"XAudio2" : (type == SOUND_DEVICE_DS ? L"DSOUND" : (type == SOUND_DEVICE_AL ? L"OpenAL" : (type == SOUND_DEVICE_PA ? L"PortAudio" : (type == SOUND_DEVICE_WASAPI ? L"WASAPI" : L"WASAPI EX")))), + _stprintf (tmp, _T("%s: %s"), + type == SOUND_DEVICE_XAUDIO2 ? _T("XAudio2") : (type == SOUND_DEVICE_DS ? _T("DSOUND") : (type == SOUND_DEVICE_AL ? _T("OpenAL") : (type == SOUND_DEVICE_PA ? _T("PortAudio") : (type == SOUND_DEVICE_WASAPI ? _T("WASAPI") : _T("WASAPI EX"))))), sound_devices[card]->name); SendDlgItemMessage (hDlg, IDC_SOUNDCARDLIST, CB_ADDSTRING, 0, (LPARAM)tmp); } @@ -8694,7 +8694,7 @@ struct fsvdlg_vals int rdb; }; -static struct fsvdlg_vals empty_fsvdlg = { L"", L"", L"", 0, 1, 1, 1, 0 }; +static struct fsvdlg_vals empty_fsvdlg = { _T(""), _T(""), _T(""), 0, 1, 1, 1, 0 }; static struct fsvdlg_vals current_fsvdlg; struct hfdlg_vals @@ -8716,7 +8716,7 @@ struct hfdlg_vals bool original; }; -static struct hfdlg_vals empty_hfdlg = { L"", L"", L"", 32, 2, 1, 0, 512, 1, 0, 0, 0, 1, 0, 1 }; +static struct hfdlg_vals empty_hfdlg = { _T(""), _T(""), _T(""), 32, 2, 1, 0, 512, 1, 0, 0, 0, 1, 0, 1 }; static struct hfdlg_vals current_hfdlg; static int archivehd; @@ -8726,10 +8726,10 @@ static void volumeselectfile (HWND hDlg) _tcscpy (directory_path, current_fsvdlg.rootdir); if (directory_path[0] == 0) { int out = sizeof directory_path / sizeof (TCHAR); - regquerystr (NULL, L"FilesystemFilePath", directory_path, &out); + regquerystr (NULL, _T("FilesystemFilePath"), directory_path, &out); } if (DiskSelection (hDlg, 0, 14, &workprefs, directory_path)) { - TCHAR *s = filesys_createvolname (NULL, directory_path, L"Harddrive"); + TCHAR *s = filesys_createvolname (NULL, directory_path, _T("Harddrive")); SetDlgItemText (hDlg, IDC_PATH_NAME, directory_path); SetDlgItemText (hDlg, IDC_VOLUME_NAME, s); xfree (s); @@ -8740,7 +8740,7 @@ static void volumeselectfile (HWND hDlg) if (p) { TCHAR t = p[1]; p[1] = 0; - regsetstr (NULL, L"FilesystemFilePath", directory_path); + regsetstr (NULL, _T("FilesystemFilePath"), directory_path); p[1] = t; } } @@ -8755,12 +8755,12 @@ static void volumeselectdir (HWND hDlg, int newdir) if (!newdir) { if (directory_path[0] == 0) { int out = sizeof directory_path / sizeof (TCHAR); - regquerystr (NULL, L"FilesystemDirectoryPath", directory_path, &out); + regquerystr (NULL, _T("FilesystemDirectoryPath"), directory_path, &out); } WIN32GUI_LoadUIString (IDS_SELECTFILESYSROOT, szTitle, MAX_DPATH); if (DirectorySelection (hDlg, &volumeguid, directory_path)) { newdir = 1; - regsetstr (NULL, L"FilesystemDirectoryPath", directory_path); + regsetstr (NULL, _T("FilesystemDirectoryPath"), directory_path); } } if (newdir) { @@ -8824,8 +8824,8 @@ static INT_PTR CALLBACK VolumeSettingsProc (HWND hDlg, UINT msg, WPARAM wParam, switch (LOWORD (wParam)) { case IDC_FS_SELECT_EJECT: - SetDlgItemText (hDlg, IDC_PATH_NAME, L""); - SetDlgItemText (hDlg, IDC_VOLUME_NAME, L""); + SetDlgItemText (hDlg, IDC_PATH_NAME, _T("")); + SetDlgItemText (hDlg, IDC_VOLUME_NAME, _T("")); CheckDlgButton (hDlg, IDC_FS_RW, TRUE); ew (hDlg, IDC_FS_RW, TRUE); archivehd = -1; @@ -8885,20 +8885,20 @@ static void sethardfile (HWND hDlg) static void inithdcontroller (HWND hDlg) { SendDlgItemMessage (hDlg, IDC_HDF_CONTROLLER, CB_RESETCONTENT, 0, 0); - SendDlgItemMessage (hDlg, IDC_HDF_CONTROLLER, CB_ADDSTRING, 0, (LPARAM)L"UAE"); - SendDlgItemMessage (hDlg, IDC_HDF_CONTROLLER, CB_ADDSTRING, 0, (LPARAM)L"IDE0"); - SendDlgItemMessage (hDlg, IDC_HDF_CONTROLLER, CB_ADDSTRING, 0, (LPARAM)L"IDE1"); - SendDlgItemMessage (hDlg, IDC_HDF_CONTROLLER, CB_ADDSTRING, 0, (LPARAM)L"IDE2"); - SendDlgItemMessage (hDlg, IDC_HDF_CONTROLLER, CB_ADDSTRING, 0, (LPARAM)L"IDE3"); - SendDlgItemMessage (hDlg, IDC_HDF_CONTROLLER, CB_ADDSTRING, 0, (LPARAM)L"SCSI0"); - SendDlgItemMessage (hDlg, IDC_HDF_CONTROLLER, CB_ADDSTRING, 0, (LPARAM)L"SCSI1"); - SendDlgItemMessage (hDlg, IDC_HDF_CONTROLLER, CB_ADDSTRING, 0, (LPARAM)L"SCSI2"); - SendDlgItemMessage (hDlg, IDC_HDF_CONTROLLER, CB_ADDSTRING, 0, (LPARAM)L"SCSI3"); - SendDlgItemMessage (hDlg, IDC_HDF_CONTROLLER, CB_ADDSTRING, 0, (LPARAM)L"SCSI4"); - SendDlgItemMessage (hDlg, IDC_HDF_CONTROLLER, CB_ADDSTRING, 0, (LPARAM)L"SCSI5"); - SendDlgItemMessage (hDlg, IDC_HDF_CONTROLLER, CB_ADDSTRING, 0, (LPARAM)L"SCSI6"); - SendDlgItemMessage (hDlg, IDC_HDF_CONTROLLER, CB_ADDSTRING, 0, (LPARAM)L"SCSRAM"); - SendDlgItemMessage (hDlg, IDC_HDF_CONTROLLER, CB_ADDSTRING, 0, (LPARAM)L"SC IDE"); + SendDlgItemMessage (hDlg, IDC_HDF_CONTROLLER, CB_ADDSTRING, 0, (LPARAM)_T("UAE")); + SendDlgItemMessage (hDlg, IDC_HDF_CONTROLLER, CB_ADDSTRING, 0, (LPARAM)_T("IDE0")); + SendDlgItemMessage (hDlg, IDC_HDF_CONTROLLER, CB_ADDSTRING, 0, (LPARAM)_T("IDE1")); + SendDlgItemMessage (hDlg, IDC_HDF_CONTROLLER, CB_ADDSTRING, 0, (LPARAM)_T("IDE2")); + SendDlgItemMessage (hDlg, IDC_HDF_CONTROLLER, CB_ADDSTRING, 0, (LPARAM)_T("IDE3")); + SendDlgItemMessage (hDlg, IDC_HDF_CONTROLLER, CB_ADDSTRING, 0, (LPARAM)_T("SCSI0")); + SendDlgItemMessage (hDlg, IDC_HDF_CONTROLLER, CB_ADDSTRING, 0, (LPARAM)_T("SCSI1")); + SendDlgItemMessage (hDlg, IDC_HDF_CONTROLLER, CB_ADDSTRING, 0, (LPARAM)_T("SCSI2")); + SendDlgItemMessage (hDlg, IDC_HDF_CONTROLLER, CB_ADDSTRING, 0, (LPARAM)_T("SCSI3")); + SendDlgItemMessage (hDlg, IDC_HDF_CONTROLLER, CB_ADDSTRING, 0, (LPARAM)_T("SCSI4")); + SendDlgItemMessage (hDlg, IDC_HDF_CONTROLLER, CB_ADDSTRING, 0, (LPARAM)_T("SCSI5")); + SendDlgItemMessage (hDlg, IDC_HDF_CONTROLLER, CB_ADDSTRING, 0, (LPARAM)_T("SCSI6")); + SendDlgItemMessage (hDlg, IDC_HDF_CONTROLLER, CB_ADDSTRING, 0, (LPARAM)_T("SCSRAM")); + SendDlgItemMessage (hDlg, IDC_HDF_CONTROLLER, CB_ADDSTRING, 0, (LPARAM)_T("SC IDE")); SendDlgItemMessage (hDlg, IDC_HDF_CONTROLLER, CB_SETCURSEL, 0, 0); } @@ -8911,8 +8911,8 @@ static void inithardfile (HWND hDlg) inithdcontroller (hDlg); SendDlgItemMessage (hDlg, IDC_HF_TYPE, CB_RESETCONTENT, 0, 0); WIN32GUI_LoadUIString (IDS_HF_FS_CUSTOM, tmp, sizeof (tmp) / sizeof (TCHAR)); - SendDlgItemMessage (hDlg, IDC_HF_TYPE, CB_ADDSTRING, 0, (LPARAM)L"OFS/FFS/RDB"); - SendDlgItemMessage (hDlg, IDC_HF_TYPE, CB_ADDSTRING, 0, (LPARAM)L"SFS"); + SendDlgItemMessage (hDlg, IDC_HF_TYPE, CB_ADDSTRING, 0, (LPARAM)_T("OFS/FFS/RDB")); + SendDlgItemMessage (hDlg, IDC_HF_TYPE, CB_ADDSTRING, 0, (LPARAM)_T("SFS")); SendDlgItemMessage (hDlg, IDC_HF_TYPE, CB_ADDSTRING, 0, (LPARAM)tmp); SendDlgItemMessage (hDlg, IDC_HF_TYPE, CB_SETCURSEL, 0, 0); } @@ -8920,14 +8920,14 @@ static void inithardfile (HWND hDlg) static void sethfdostype (HWND hDlg, int idx) { if (idx == 1) - SetDlgItemText (hDlg, IDC_HF_DOSTYPE, L"0x53465300"); + SetDlgItemText (hDlg, IDC_HF_DOSTYPE, _T("0x53465300")); else - SetDlgItemText (hDlg, IDC_HF_DOSTYPE, L""); + SetDlgItemText (hDlg, IDC_HF_DOSTYPE, _T("")); } static void hardfile_testrdb (HWND hDlg, struct hfdlg_vals *hdf) { - struct zfile *f = zfile_fopen (hdf->filename, L"rb", ZFD_NORMAL); + struct zfile *f = zfile_fopen (hdf->filename, _T("rb"), ZFD_NORMAL); uae_u8 tmp[8]; int i; @@ -9006,17 +9006,17 @@ static void updatehdfinfo (HWND hDlg, bool force) tmp[0] = 0; if (bsize) { - _stprintf (tmp2, L" %s [%02X%02X%02X%02X%02X%02X%02X%02X]", idtmp, id[0], id[1], id[2], id[3], id[4], id[5], id[6], id[7]); + _stprintf (tmp2, _T(" %s [%02X%02X%02X%02X%02X%02X%02X%02X]"), idtmp, id[0], id[1], id[2], id[3], id[4], id[5], id[6], id[7]); if (!cyls || !blocks) { - _stprintf (tmp, L"%dMB", bsize / (1024 * 1024)); + _stprintf (tmp, _T("%dMB"), bsize / (1024 * 1024)); } else { - _stprintf (tmp, L"%u cyls, %u blocks, %.1fMB/%.1fMB", + _stprintf (tmp, _T("%u cyls, %u blocks, %.1fMB/%.1fMB"), cyls, blocks, (double)blocks * 1.0 * current_hfdlg.blocksize / (1024.0 * 1024.0), (double)bsize / (1024.0 * 1024.0)); if (cyls > 65535) { - _stprintf (tmp2, L" %4.4s [%02X%02X%02X%02X]", idtmp, id[0], id[1], id[2], id[3]); - _tcscat (tmp, L" [Too many cyls]"); + _stprintf (tmp2, _T(" %4.4s [%02X%02X%02X%02X]"), idtmp, id[0], id[1], id[2], id[3]); + _tcscat (tmp, _T(" [Too many cyls]")); } } _tcscat (tmp, tmp2); @@ -9155,8 +9155,8 @@ static INT_PTR CALLBACK HardfileSettingsProc (HWND hDlg, UINT msg, WPARAM wParam SetDlgItemInt (hDlg, IDC_SECTORS, 0, FALSE); SetDlgItemInt (hDlg, IDC_RESERVED, 0, FALSE); SetDlgItemInt (hDlg, IDC_HEADS, 0, FALSE); - SetDlgItemText (hDlg, IDC_PATH_FILESYS, L""); - SetDlgItemText (hDlg, IDC_HARDFILE_DEVICE, L""); + SetDlgItemText (hDlg, IDC_PATH_FILESYS, _T("")); + SetDlgItemText (hDlg, IDC_HARDFILE_DEVICE, _T("")); current_hfdlg.sectors = current_hfdlg.reserved = current_hfdlg.surfaces = 0; current_hfdlg.bootpri = 0; current_hfdlg.autoboot = 1; @@ -9433,7 +9433,7 @@ static int harddiskdlg_button (HWND hDlg, WPARAM wParam) break; case IDC_CD_EJECT: eject_cd (); - SetDlgItemText (hDlg, IDC_CD_TEXT, L""); + SetDlgItemText (hDlg, IDC_CD_TEXT, _T("")); addcdtype (hDlg, IDC_CD_TYPE); break; case IDC_NEW_FS: @@ -9679,7 +9679,7 @@ static void out_floppyspeed (HWND hDlg) WIN32GUI_LoadUIString (IDS_FLOPPY_COMPATIBLE, tmp1, sizeof (tmp1) / sizeof (TCHAR)); WIN32GUI_LoadUIString (IDS_FLOPPY_TURBO, tmp2, sizeof (tmp2) / sizeof (TCHAR)); if (workprefs.floppy_speed) - _stprintf (txt, L"%d%%%s", workprefs.floppy_speed, workprefs.floppy_speed == 100 ? tmp1 : L""); + _stprintf (txt, _T("%d%%%s"), workprefs.floppy_speed, workprefs.floppy_speed == 100 ? tmp1 : _T("")); else _tcscpy (txt, tmp2); SetDlgItemText (hDlg, IDC_FLOPPYSPDTEXT, txt); @@ -9719,7 +9719,7 @@ static void floppytooltip (HWND hDlg, int num, uae_u32 crc32) SendMessage (ToolTipHWND, TTM_DELTOOL, 0, (LPARAM) (LPTOOLINFO) &ti); if (crc32 == 0) return; - _stprintf (tmp, L"CRC=%08X", crc32); + _stprintf (tmp, _T("CRC=%08X"), crc32); ti.lpszText = tmp; SendMessage (ToolTipHWND, TTM_ADDTOOL, 0, (LPARAM) (LPTOOLINFO) &ti); } @@ -9769,9 +9769,9 @@ static void addfloppyhistory_2 (HWND hDlg, int n, int f_text, int type) _tcscpy (tmpname, p + 1); *++p = 0; if (tmppath[0]) { - _tcscat (tmpname, L" { "); + _tcscat (tmpname, _T(" { ")); _tcscat (tmpname, tmppath); - _tcscat (tmpname, L" }"); + _tcscat (tmpname, _T(" }")); } if (f_text >= 0) SendDlgItemMessage (hDlg, f_text, CB_ADDSTRING, 0, (LPARAM)tmpname); @@ -9825,7 +9825,7 @@ static void addcdtype (HWND hDlg, int id) int cnt = 2; for (int drive = 'C'; drive <= 'Z'; ++drive) { TCHAR vol[100]; - _stprintf (vol, L"%c:\\", drive); + _stprintf (vol, _T("%c:\\"), drive); int drivetype = GetDriveType (vol); if (drivetype == DRIVE_CDROM) { SendDlgItemMessage (hDlg, id, CB_ADDSTRING, 0, (LPARAM)vol); @@ -9878,8 +9878,8 @@ static void addfloppytype (HWND hDlg, int n) addcdtype (hDlg, IDC_CD0Q_TYPE); hide (hDlg, IDC_CD0Q_TYPE, 0); text = workprefs.cdslots[0].name; - regsetstr (NULL, L"QuickStartCDDrive", quickstart_cdtype >= 2 ? quickstart_cddrive : L""); - regsetint (NULL, L"QuickStartCDType", quickstart_cdtype >= 2 ? 2 : quickstart_cdtype); + regsetstr (NULL, _T("QuickStartCDDrive"), quickstart_cdtype >= 2 ? quickstart_cddrive : _T("")); + regsetint (NULL, _T("QuickStartCDType"), quickstart_cdtype >= 2 ? 2 : quickstart_cdtype); } else { hide (hDlg, f_wp, 0); hide (hDlg, f_wptext, 0); @@ -9957,7 +9957,7 @@ static void getfloppytypeq (HWND hDlg, int n) quickstart_floppy = 2; else quickstart_floppy = 1; - regsetint (NULL, L"QuickStartFloppies", quickstart_floppy); + regsetint (NULL, _T("QuickStartFloppies"), quickstart_floppy); } } @@ -9977,8 +9977,8 @@ static int getfloppybox (HWND hDlg, int f_text, TCHAR *out, int maxlen, int type tmp = xmalloc (TCHAR, maxlen + 1); _tcscpy (tmp, out); - p1 = _tcsstr(tmp, L" { "); - p2 = _tcsstr(tmp, L" }"); + p1 = _tcsstr(tmp, _T(" { ")); + p2 = _tcsstr(tmp, _T(" }")); if (p1 && p2 && p2 > p1) { *p1 = 0; memset (out, 0, maxlen * sizeof (TCHAR)); @@ -10102,7 +10102,7 @@ static INT_PTR CALLBACK FloppyDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARA { static int recursive = 0; int i; - static TCHAR diskname[40] = { L"" }; + static TCHAR diskname[40] = { _T("") }; switch (msg) { @@ -10259,25 +10259,25 @@ static INT_PTR CALLBACK FloppyDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARA break; case IDC_EJECT0: case IDC_EJECT0Q: - SetDlgItemText (hDlg, IDC_DF0TEXT, L""); - SetDlgItemText (hDlg, IDC_DF0TEXTQ, L""); + SetDlgItemText (hDlg, IDC_DF0TEXT, _T("")); + SetDlgItemText (hDlg, IDC_DF0TEXTQ, _T("")); ejectfloppy (0); addfloppytype (hDlg, 0); break; case IDC_EJECT1: case IDC_EJECT1Q: - SetDlgItemText (hDlg, IDC_DF1TEXT, L""); - SetDlgItemText (hDlg, IDC_DF1TEXTQ, L""); + SetDlgItemText (hDlg, IDC_DF1TEXT, _T("")); + SetDlgItemText (hDlg, IDC_DF1TEXTQ, _T("")); ejectfloppy (1); addfloppytype (hDlg, 1); break; case IDC_EJECT2: - SetDlgItemText (hDlg, IDC_DF2TEXT, L""); + SetDlgItemText (hDlg, IDC_DF2TEXT, _T("")); ejectfloppy (2); addfloppytype (hDlg, 2); break; case IDC_EJECT3: - SetDlgItemText (hDlg, IDC_DF3TEXT, L""); + SetDlgItemText (hDlg, IDC_DF3TEXT, _T("")); ejectfloppy (3); addfloppytype (hDlg, 3); break; @@ -10367,7 +10367,7 @@ static void diskswapper_addfile (struct uae_prefs *prefs, const TCHAR *file) if (zd && zfile_readdir_archive (zd, NULL, true) > 1) { TCHAR out[MAX_DPATH]; while (zfile_readdir_archive (zd, out, true)) { - struct zfile *zf = zfile_fopen (out, L"rb", ZFD_NORMAL); + struct zfile *zf = zfile_fopen (out, _T("rb"), ZFD_NORMAL); if (zf) { int type = zfile_gettype (zf); if (type == ZFILE_DISKIMAGE) @@ -10728,12 +10728,12 @@ static void updatejoyport (HWND hDlg) SendDlgItemMessage (hDlg, idm, CB_SETCURSEL, vm, 0); SendDlgItemMessage (hDlg, id, CB_RESETCONTENT, 0, 0L); - SendDlgItemMessage (hDlg, id, CB_ADDSTRING, 0, (LPARAM)L""); + SendDlgItemMessage (hDlg, id, CB_ADDSTRING, 0, (LPARAM)_T("")); WIN32GUI_LoadUIString (IDS_NONE, tmp, sizeof (tmp) / sizeof (TCHAR) - 3); - _stprintf (tmp2, L"<%s>", tmp); + _stprintf (tmp2, _T("<%s>"), tmp); SendDlgItemMessage (hDlg, id, CB_ADDSTRING, 0, (LPARAM)tmp2); WIN32GUI_LoadUIString (IDS_KEYJOY, tmp, sizeof (tmp) / sizeof (TCHAR)); - _tcscat (tmp, L"\n"); + _tcscat (tmp, _T("\n")); p1 = tmp; for (;;) { p2 = _tcschr (p1, '\n'); @@ -10752,7 +10752,7 @@ static void updatejoyport (HWND hDlg) SendDlgItemMessage (hDlg, id, CB_ADDSTRING, 0, (LPARAM)inputdevice_get_device_name (IDTYPE_MOUSE, j)); } if (v == JPORT_CUSTOM) { - SendDlgItemMessage (hDlg, id, CB_ADDSTRING, 0, (LPARAM)L""); + SendDlgItemMessage (hDlg, id, CB_ADDSTRING, 0, (LPARAM)_T("")); total++; } @@ -10918,7 +10918,7 @@ static void values_from_portsdlg (HWND hDlg) item -= dwEnumeratedPrinters; for (i = 0; i < 4; i++) { if ((paraport_mask & (1 << i)) && item == 0) { - _stprintf (workprefs.prtname, L"LPT%d", i + 1); + _stprintf (workprefs.prtname, _T("LPT%d"), i + 1); got = 1; break; } @@ -10988,7 +10988,7 @@ static void values_to_portsdlg (HWND hDlg) TCHAR tmp[10]; result = SendDlgItemMessage (hDlg, IDC_PRINTERLIST, CB_FINDSTRINGEXACT, -1, (LPARAM)workprefs.prtname); for (i = 0; i < 4; i++) { - _stprintf (tmp, L"LPT%d", i + 1); + _stprintf (tmp, _T("LPT%d"), i + 1); if (!_tcscmp (tmp, workprefs.prtname)) { got = 0; if (paraport_mask & (1 << i)) @@ -11038,7 +11038,7 @@ static void values_to_portsdlg (HWND hDlg) int i; LRESULT result = -1; for (i = 0; i < MAX_SERPAR_PORTS && comports[i]; i++) { - if (!_tcscmp (comports[i]->dev, workprefs.sername) || (!_tcsncmp (workprefs.sername, L"TCP:", 4) && !_tcsncmp (comports[i]->dev, workprefs.sername, 4))) { + if (!_tcscmp (comports[i]->dev, workprefs.sername) || (!_tcsncmp (workprefs.sername, _T("TCP:"), 4) && !_tcsncmp (comports[i]->dev, workprefs.sername, 4))) { result = SendDlgItemMessage (hDlg, IDC_SERIAL, CB_SETCURSEL, i + 1, 0L); break; } @@ -11080,14 +11080,14 @@ static void init_portsdlg (HWND hDlg) SendDlgItemMessage (hDlg, IDC_DONGLELIST, CB_RESETCONTENT, 0, 0L); SendDlgItemMessage (hDlg, IDC_DONGLELIST, CB_ADDSTRING, 0, (LPARAM)szNone.c_str()); - SendDlgItemMessage (hDlg, IDC_DONGLELIST, CB_ADDSTRING, 0, (LPARAM)L"Robocop 3"); - SendDlgItemMessage (hDlg, IDC_DONGLELIST, CB_ADDSTRING, 0, (LPARAM)L"Leaderboard"); - SendDlgItemMessage (hDlg, IDC_DONGLELIST, CB_ADDSTRING, 0, (LPARAM)L"B.A.T. II"); - SendDlgItemMessage (hDlg, IDC_DONGLELIST, CB_ADDSTRING, 0, (LPARAM)L"Italy'90 Soccer"); - SendDlgItemMessage (hDlg, IDC_DONGLELIST, CB_ADDSTRING, 0, (LPARAM)L"Dames Grand Maitre"); - SendDlgItemMessage (hDlg, IDC_DONGLELIST, CB_ADDSTRING, 0, (LPARAM)L"Rugby Coach"); - SendDlgItemMessage (hDlg, IDC_DONGLELIST, CB_ADDSTRING, 0, (LPARAM)L"Cricket Captain"); - SendDlgItemMessage (hDlg, IDC_DONGLELIST, CB_ADDSTRING, 0, (LPARAM)L"Leviathan"); + SendDlgItemMessage (hDlg, IDC_DONGLELIST, CB_ADDSTRING, 0, (LPARAM)_T("Robocop 3")); + SendDlgItemMessage (hDlg, IDC_DONGLELIST, CB_ADDSTRING, 0, (LPARAM)_T("Leaderboard")); + SendDlgItemMessage (hDlg, IDC_DONGLELIST, CB_ADDSTRING, 0, (LPARAM)_T("B.A.T. II")); + SendDlgItemMessage (hDlg, IDC_DONGLELIST, CB_ADDSTRING, 0, (LPARAM)_T("Italy'90 Soccer")); + SendDlgItemMessage (hDlg, IDC_DONGLELIST, CB_ADDSTRING, 0, (LPARAM)_T("Dames Grand Maitre")); + SendDlgItemMessage (hDlg, IDC_DONGLELIST, CB_ADDSTRING, 0, (LPARAM)_T("Rugby Coach")); + SendDlgItemMessage (hDlg, IDC_DONGLELIST, CB_ADDSTRING, 0, (LPARAM)_T("Cricket Captain")); + SendDlgItemMessage (hDlg, IDC_DONGLELIST, CB_ADDSTRING, 0, (LPARAM)_T("Leviathan")); SendDlgItemMessage (hDlg, IDC_SERIAL, CB_RESETCONTENT, 0, 0L); SendDlgItemMessage (hDlg, IDC_SERIAL, CB_ADDSTRING, 0, (LPARAM)szNone.c_str()); @@ -11115,8 +11115,8 @@ static void init_portsdlg (HWND hDlg) for (int card = 0; card < MAX_SOUND_DEVICES && record_devices[card]; card++) { int type = record_devices[card]->type; TCHAR tmp[MAX_DPATH]; - _stprintf (tmp, L"%s: %s", - type == SOUND_DEVICE_XAUDIO2 ? L"XAudio2" : (type == SOUND_DEVICE_DS ? L"DSOUND" : (type == SOUND_DEVICE_AL ? L"OpenAL" : (type == SOUND_DEVICE_PA ? L"PortAudio" : L"WASAPI"))), + _stprintf (tmp, _T("%s: %s"), + type == SOUND_DEVICE_XAUDIO2 ? _T("XAudio2") : (type == SOUND_DEVICE_DS ? _T("DSOUND") : (type == SOUND_DEVICE_AL ? _T("OpenAL") : (type == SOUND_DEVICE_PA ? _T("PortAudio") : _T("WASAPI")))), record_devices[card]->name); if (type == SOUND_DEVICE_DS) SendDlgItemMessage (hDlg, IDC_SAMPLERLIST, CB_ADDSTRING, 0, (LPARAM)tmp); @@ -11151,7 +11151,7 @@ static void init_portsdlg (HWND hDlg) while (mask) { if (mask & 1) { TCHAR tmp[30]; - _stprintf (tmp, L"LPT%d", i); + _stprintf (tmp, _T("LPT%d"), i); SendDlgItemMessage (hDlg, IDC_PRINTERLIST, CB_ADDSTRING, 0, (LPARAM)tmp); } i++; @@ -11554,14 +11554,14 @@ static void init_inputdlg (HWND hDlg) } WIN32GUI_LoadUIString (IDS_INPUT_COPY_DEFAULT, buf, sizeof (buf) / sizeof (TCHAR)); SendDlgItemMessage (hDlg, IDC_INPUTCOPYFROM, CB_ADDSTRING, 0, (LPARAM)buf); - SendDlgItemMessage (hDlg, IDC_INPUTCOPYFROM, CB_ADDSTRING, 0, (LPARAM)L"Default"); - SendDlgItemMessage (hDlg, IDC_INPUTCOPYFROM, CB_ADDSTRING, 0, (LPARAM)L"Default (PC KB)"); + SendDlgItemMessage (hDlg, IDC_INPUTCOPYFROM, CB_ADDSTRING, 0, (LPARAM)_T("Default")); + SendDlgItemMessage (hDlg, IDC_INPUTCOPYFROM, CB_ADDSTRING, 0, (LPARAM)_T("Default (PC KB)")); SendDlgItemMessage (hDlg, IDC_INPUTCOPYFROM, CB_SETCURSEL, input_copy_from, 0); SendDlgItemMessage (hDlg, IDC_INPUTAMIGACNT, CB_RESETCONTENT, 0, 0L); for (i = 0; i < MAX_INPUT_SUB_EVENT; i++) { - _stprintf (buf, L"%d", i + 1); + _stprintf (buf, _T("%d"), i + 1); SendDlgItemMessage (hDlg, IDC_INPUTAMIGACNT, CB_ADDSTRING, 0, (LPARAM)buf); } SendDlgItemMessage (hDlg, IDC_INPUTAMIGACNT, CB_SETCURSEL, input_selected_sub_num, 0); @@ -11806,7 +11806,7 @@ static void CALLBACK timerfunc (HWND hDlg, UINT uMsg, UINT_PTR idEvent, DWORD dw struct inputevent *ie = inputdevice_get_eventinfo (evtnum); TCHAR name[256]; inputdevice_get_eventname (ie, name); - //write_log (L"%d %d %d %s\n", input_selected_device, input_selected_widget, evtnum, name); + //write_log (_T("%d %d %d %s\n"), input_selected_device, input_selected_widget, evtnum, name); inputdevice_set_gameports_mapping (&workprefs, input_selected_device, input_selected_widget, name, inputmap_port); InitializeListView (hDlg); inputmap_remap_counter += cntadd; @@ -11818,7 +11818,7 @@ static void CALLBACK timerfunc (HWND hDlg, UINT uMsg, UINT_PTR idEvent, DWORD dw TCHAR tmp[256]; tmp[0] = 0; inputdevice_get_widget_type (input_selected_device, input_selected_widget, tmp); - _tcscat (tmp, L", "); + _tcscat (tmp, _T(", ")); _tcscat (tmp, inputdevice_get_device_name2 (input_selected_device)); SetWindowText (GetDlgItem (hDlg, IDC_INPUTMAPOUT), tmp); @@ -11856,7 +11856,7 @@ static void CALLBACK timerfunc (HWND hDlg, UINT uMsg, UINT_PTR idEvent, DWORD dw TCHAR tmp[256]; tmp[0] = 0; inputdevice_get_widget_type (input_selected_device, input_selected_widget, tmp); - _tcscat (tmp, L", "); + _tcscat (tmp, _T(", ")); _tcscat (tmp, inputdevice_get_device_name2 (input_selected_device)); SetWindowText (GetDlgItem (hDlg, IDC_INPUTMAPOUT), tmp); @@ -11983,7 +11983,7 @@ static void input_test (HWND hDlg, int port) updatePanel (INPUTMAP_ID); for (int idx = 0; idx < MAX_JPORTS; idx++) { int mode, **events, *axistable; - write_log (L"Port: %d\n", idx); + write_log (_T("Port: %d\n"), idx); if (inputdevice_get_compatibility_input (&workprefs, idx, &mode, &events, &axistable)) { for (int k = 0; k < 2 && events[k]; k++) { int *p = events[k]; @@ -11997,7 +11997,7 @@ static void input_test (HWND hDlg, int port) int *atp = axistable; int atpidx; - write_log (L"- %d: %s = ", i, evt->name); + write_log (_T("- %d: %s = "), i, evt->name); atpidx = 0; while (*atp >= 0) { if (*atp == evtnum) { @@ -12018,7 +12018,7 @@ static void input_test (HWND hDlg, int port) for (int j = 0; j < inputdevice_get_widget_num (devnum); j++) { if (inputdevice_get_mapped_name (devnum, j, &flags, NULL, NULL, 0) == evtnum) { inputdevice_get_widget_type (devnum, j, name); - write_log (L"[%s, %s]", inputdevice_get_device_name2 (devnum), name); + write_log (_T("[%s, %s]"), inputdevice_get_device_name2 (devnum), name); found = true; } } @@ -12029,14 +12029,14 @@ static void input_test (HWND hDlg, int port) atpidx--; } if (!found) - write_log (L""); - write_log (L"\n"); + write_log (_T("")); + write_log (_T("\n")); } } } else { - write_log (L""); + write_log (_T("")); } - write_log (L"\n"); + write_log (_T("\n")); } } @@ -12265,7 +12265,7 @@ static void input_toggletoggle (void) static INT_PTR CALLBACK InputDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) { - TCHAR name_buf[MAX_DPATH] = L"", desc_buf[128] = L""; + TCHAR name_buf[MAX_DPATH] = _T(""), desc_buf[128] = _T(""); TCHAR *posn = NULL; HWND list; int dblclick = 0; @@ -12448,7 +12448,7 @@ static void enable_for_hw3ddlg (HWND hDlg) ew (hDlg, IDC_FILTERPRESETDELETE, filterpreset_selected > 0 && filterpreset_builtin < 0); } -static TCHAR *filtermultnames[] = { L"FS", L"1/2x", L"1x", L"2x", L"4x", L"6x", L"8x", NULL }; +static TCHAR *filtermultnames[] = { _T("FS"), _T("1/2x"), _T("1x"), _T("2x"), _T("4x"), _T("6x"), _T("8x"), NULL }; static int filtermults[] = { 0, 2000, 1000, 500, 250, 167, 125 }; struct filterxtra { TCHAR *label; @@ -12460,20 +12460,20 @@ static int filter_selected_num; static struct filterxtra filter_pal_extra[] = { - L"Brightness", &workprefs.gfx_filter_luminance, &currprefs.gfx_filter_luminance, -1000, 1000, 10, - L"Contrast", &workprefs.gfx_filter_contrast, &currprefs.gfx_filter_contrast, -1000, 1000, 10, - L"Saturation", &workprefs.gfx_filter_saturation, &currprefs.gfx_filter_saturation, -1000, 1000, 10, - L"Gamma", &workprefs.gfx_gamma, &currprefs.gfx_gamma, -1000, 1000, 10, - L"Scanlines", &workprefs.gfx_filter_scanlines, &currprefs.gfx_filter_scanlines, 0, 100, 1, - L"Blurriness", &workprefs.gfx_filter_blur, &currprefs.gfx_filter_blur,0, 2000, 10, - L"Noise", &workprefs.gfx_filter_noise, &currprefs.gfx_filter_noise,0, 100, 10, + _T("Brightness"), &workprefs.gfx_filter_luminance, &currprefs.gfx_filter_luminance, -1000, 1000, 10, + _T("Contrast"), &workprefs.gfx_filter_contrast, &currprefs.gfx_filter_contrast, -1000, 1000, 10, + _T("Saturation"), &workprefs.gfx_filter_saturation, &currprefs.gfx_filter_saturation, -1000, 1000, 10, + _T("Gamma"), &workprefs.gfx_gamma, &currprefs.gfx_gamma, -1000, 1000, 10, + _T("Scanlines"), &workprefs.gfx_filter_scanlines, &currprefs.gfx_filter_scanlines, 0, 100, 1, + _T("Blurriness"), &workprefs.gfx_filter_blur, &currprefs.gfx_filter_blur,0, 2000, 10, + _T("Noise"), &workprefs.gfx_filter_noise, &currprefs.gfx_filter_noise,0, 100, 10, NULL }; static struct filterxtra filter_3d_extra[] = { - L"Point/Bilinear", &workprefs.gfx_filter_bilinear, &currprefs.gfx_filter_bilinear, 0, 1, 1, - L"Scanline transparency", &workprefs.gfx_filter_scanlines, &currprefs.gfx_filter_scanlines, 0, 100, 10, - L"Scanline level", &workprefs.gfx_filter_scanlinelevel, &currprefs.gfx_filter_scanlinelevel, 0, 100, 10, + _T("Point/Bilinear"), &workprefs.gfx_filter_bilinear, &currprefs.gfx_filter_bilinear, 0, 1, 1, + _T("Scanline transparency"), &workprefs.gfx_filter_scanlines, &currprefs.gfx_filter_scanlines, 0, 100, 10, + _T("Scanline level"), &workprefs.gfx_filter_scanlinelevel, &currprefs.gfx_filter_scanlinelevel, 0, 100, 10, NULL }; static int dummy_in, dummy_out; @@ -12512,9 +12512,9 @@ struct filterpreset { }; static struct filterpreset filterpresets[] = { - { L"PAL", UAE_FILTER_PAL, 0, 0, 0, 0, 0, 0, 0, 50, 0, 0, 1, 1, 0, 0, 0, 10, 0, 0, 0, 300, 30, 0, 0, 0 }, - { L"D3D Autoscale", UAE_FILTER_NULL, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 1 }, - { L"D3D Full Scaling", UAE_FILTER_NULL, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0 }, + { _T("PAL"), UAE_FILTER_PAL, 0, 0, 0, 0, 0, 0, 0, 50, 0, 0, 1, 1, 0, 0, 0, 10, 0, 0, 0, 300, 30, 0, 0, 0 }, + { _T("D3D Autoscale"), UAE_FILTER_NULL, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 1 }, + { _T("D3D Full Scaling"), UAE_FILTER_NULL, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0 }, { NULL } }; @@ -12527,7 +12527,7 @@ static int getfiltermult (HWND hDlg, DWORD dlg) if (v != CB_ERR) return filtermults[v]; SendDlgItemMessage (hDlg, dlg, WM_GETTEXT, (WPARAM)sizeof tmp / sizeof (TCHAR), (LPARAM)tmp); - if (!_tcsicmp (tmp, L"FS")) + if (!_tcsicmp (tmp, _T("FS"))) return 0; f = (float)_tstof (tmp); if (f < 0) @@ -12552,7 +12552,7 @@ static void setfiltermult2 (HWND hDlg, int id, int val) TCHAR tmp[100]; tmp[0] = 0; if (val > 0) - _stprintf (tmp, L"%.2f", 1000.0 / val); + _stprintf (tmp, _T("%.2f"), 1000.0 / val); SendDlgItemMessage (hDlg, id, CB_SETCURSEL, 0, 0); SetDlgItemText (hDlg, id, tmp); } @@ -12639,13 +12639,13 @@ static void values_to_hw3ddlg (HWND hDlg) HANDLE h; WIN32_FIND_DATA wfd; TCHAR tmp[MAX_DPATH]; - get_plugin_path (tmp, sizeof tmp / sizeof (TCHAR), L"filtershaders\\direct3d"); - _tcscat (tmp, L"*.fx"); + get_plugin_path (tmp, sizeof tmp / sizeof (TCHAR), _T("filtershaders\\direct3d")); + _tcscat (tmp, _T("*.fx")); h = FindFirstFile (tmp, &wfd); while (h != INVALID_HANDLE_VALUE) { if (wfd.cFileName[0] != '_') { TCHAR tmp2[100]; - _stprintf (tmp2, L"D3D: %s", wfd.cFileName); + _stprintf (tmp2, _T("D3D: %s"), wfd.cFileName); tmp2[_tcslen (tmp2) - 3] = 0; SendDlgItemMessage (hDlg, IDC_FILTERMODE, CB_ADDSTRING, 0, (LPARAM)tmp2); if (workprefs.gfx_api && !_tcscmp (workprefs.gfx_filtershader, wfd.cFileName)) @@ -12666,15 +12666,15 @@ static void values_to_hw3ddlg (HWND hDlg) HANDLE h; WIN32_FIND_DATA wfd; TCHAR tmp[MAX_DPATH]; - get_plugin_path (tmp, sizeof tmp / sizeof (TCHAR), overlaytype == 0 ? L"overlays" : L"masks"); - _tcscat (tmp, L"*.*"); + get_plugin_path (tmp, sizeof tmp / sizeof (TCHAR), overlaytype == 0 ? _T("overlays") : _T("masks")); + _tcscat (tmp, _T("*.*")); h = FindFirstFile (tmp, &wfd); i = 0; j = 1; while (h != INVALID_HANDLE_VALUE) { TCHAR *ext = _tcsrchr (wfd.cFileName, '.'); if (ext && ( - !_tcsicmp (ext, L".png") || - !_tcsicmp (ext, L".bmp"))) + !_tcsicmp (ext, _T(".png")) || + !_tcsicmp (ext, _T(".bmp")))) { SendDlgItemMessage (hDlg, IDC_FILTEROVERLAY, CB_ADDSTRING, 0, (LPARAM)wfd.cFileName); if (!_tcsicmp (wfd.cFileName, overlaytype == 0 ? workprefs.gfx_filteroverlay : workprefs.gfx_filtermask)) @@ -12705,7 +12705,7 @@ static void values_to_hw3ddlg (HWND hDlg) if (workprefs.gfx_api) { for (i = 0; i < 4; i++) { TCHAR tmp[100]; - _stprintf (tmp, L"%dx", i + 1); + _stprintf (tmp, _T("%dx"), i + 1); SendDlgItemMessage (hDlg, IDC_FILTERFILTER, CB_ADDSTRING, 0, (LPARAM)tmp); filtermodenum++; } @@ -12758,7 +12758,7 @@ static void values_to_hw3ddlg (HWND hDlg) i = j = 0; while (scanlineratios[i * 2]) { int sl = scanlineratios[i * 2] * 16 + scanlineratios[i * 2 + 1]; - _stprintf (txt, L"%d:%d", scanlineratios[i * 2], scanlineratios[i * 2 + 1]); + _stprintf (txt, _T("%d:%d"), scanlineratios[i * 2], scanlineratios[i * 2 + 1]); if (workprefs.gfx_filter_scanlineratio == sl) j = i; SendDlgItemMessage (hDlg, IDC_FILTERSLR, CB_ADDSTRING, 0, (LPARAM)txt); @@ -12769,13 +12769,13 @@ static void values_to_hw3ddlg (HWND hDlg) j = 0; SendDlgItemMessage (hDlg, IDC_FILTERPRESETS, CB_RESETCONTENT, 0, 0L); - SendDlgItemMessage (hDlg, IDC_FILTERPRESETS, CB_ADDSTRING, 0, (LPARAM)L""); + SendDlgItemMessage (hDlg, IDC_FILTERPRESETS, CB_ADDSTRING, 0, (LPARAM)_T("")); for (i = 0; filterpresets[i].name; i++) { TCHAR tmp[MAX_DPATH]; - _stprintf (tmp, L"* %s", filterpresets[i].name); + _stprintf (tmp, _T("* %s"), filterpresets[i].name); SendDlgItemMessage (hDlg, IDC_FILTERPRESETS, CB_ADDSTRING, 0, (LPARAM)tmp); } - fkey = regcreatetree (NULL, L"FilterPresets"); + fkey = regcreatetree (NULL, _T("FilterPresets")); if (fkey) { int idx = 0; TCHAR tmp[MAX_DPATH], tmp2[MAX_DPATH]; @@ -12830,7 +12830,7 @@ static void filter_preset (HWND hDlg, WPARAM wParam) load = 0; ok = 0; for (builtin = 0; filterpresets[builtin].name; builtin++); - fkey = regcreatetree (NULL, L"FilterPresets"); + fkey = regcreatetree (NULL, _T("FilterPresets")); item = SendDlgItemMessage (hDlg, IDC_FILTERPRESETS, CB_GETCURSEL, 0, 0); tmp1[0] = 0; if (item != CB_ERR) { @@ -12858,10 +12858,10 @@ static void filter_preset (HWND hDlg, WPARAM wParam) TCHAR *p = tmp2; for (i = 0; filtervars[i]; i++) { if (i > 0) { - _tcscat (p, L","); + _tcscat (p, _T(",")); p++; } - _stprintf (p, L"%d", filterpresets[filterpreset_builtin].conf[i]); + _stprintf (p, _T("%d"), filterpresets[filterpreset_builtin].conf[i]); p += _tcslen (p); } ok = 1; @@ -12871,10 +12871,10 @@ static void filter_preset (HWND hDlg, WPARAM wParam) TCHAR *p = tmp2; for (i = 0; filtervars[i]; i++) { if (i > 0) { - _tcscat (p, L","); + _tcscat (p, _T(",")); p++; } - _stprintf (p, L"%d", *(filtervars[i])); + _stprintf (p, _T("%d"), *(filtervars[i])); p += _tcslen (p); } if (ok == 0) { @@ -12895,7 +12895,7 @@ static void filter_preset (HWND hDlg, WPARAM wParam) TCHAR *t; load = 1; - _tcscat (s, L","); + _tcscat (s, _T(",")); t = _tcschr (s, ','); *t++ = 0; for (i = 0; filtervars[i]; i++) { @@ -12939,7 +12939,7 @@ static void filter_handle (HWND hDlg) } if (item > 0) { if (item > UAE_FILTER_LAST) { - _stprintf (workprefs.gfx_filtershader, L"%s.fx", tmp + 5); + _stprintf (workprefs.gfx_filtershader, _T("%s.fx"), tmp + 5); } else { item--; workprefs.gfx_filter = uaefilters[item].type; @@ -12990,17 +12990,17 @@ static INT_PTR CALLBACK hw3dDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM SendDlgItemMessage (hDlg, IDC_FILTERASPECT, CB_ADDSTRING, 0, (LPARAM)tmp); WIN32GUI_LoadUIString (IDS_AUTOMATIC, tmp, sizeof tmp / sizeof (TCHAR)); SendDlgItemMessage (hDlg, IDC_FILTERASPECT, CB_ADDSTRING, 0, (LPARAM)tmp); - SendDlgItemMessage (hDlg, IDC_FILTERASPECT, CB_ADDSTRING, 0, (LPARAM)L"4:3"); - SendDlgItemMessage (hDlg, IDC_FILTERASPECT, CB_ADDSTRING, 0, (LPARAM)L"5:4"); - SendDlgItemMessage (hDlg, IDC_FILTERASPECT, CB_ADDSTRING, 0, (LPARAM)L"15:9"); - SendDlgItemMessage (hDlg, IDC_FILTERASPECT, CB_ADDSTRING, 0, (LPARAM)L"16:9"); - SendDlgItemMessage (hDlg, IDC_FILTERASPECT, CB_ADDSTRING, 0, (LPARAM)L"16:10"); + SendDlgItemMessage (hDlg, IDC_FILTERASPECT, CB_ADDSTRING, 0, (LPARAM)_T("4:3")); + SendDlgItemMessage (hDlg, IDC_FILTERASPECT, CB_ADDSTRING, 0, (LPARAM)_T("5:4")); + SendDlgItemMessage (hDlg, IDC_FILTERASPECT, CB_ADDSTRING, 0, (LPARAM)_T("15:9")); + SendDlgItemMessage (hDlg, IDC_FILTERASPECT, CB_ADDSTRING, 0, (LPARAM)_T("16:9")); + SendDlgItemMessage (hDlg, IDC_FILTERASPECT, CB_ADDSTRING, 0, (LPARAM)_T("16:10")); SendDlgItemMessage (hDlg, IDC_FILTERASPECT2, CB_RESETCONTENT, 0, 0); WIN32GUI_LoadUIString (IDS_DISABLED, tmp, sizeof tmp / sizeof (TCHAR)); SendDlgItemMessage (hDlg, IDC_FILTERASPECT2, CB_ADDSTRING, 0, (LPARAM)tmp); - SendDlgItemMessage (hDlg, IDC_FILTERASPECT2, CB_ADDSTRING, 0, (LPARAM)L"VGA"); - SendDlgItemMessage (hDlg, IDC_FILTERASPECT2, CB_ADDSTRING, 0, (LPARAM)L"TV"); + SendDlgItemMessage (hDlg, IDC_FILTERASPECT2, CB_ADDSTRING, 0, (LPARAM)_T("VGA")); + SendDlgItemMessage (hDlg, IDC_FILTERASPECT2, CB_ADDSTRING, 0, (LPARAM)_T("TV")); SendDlgItemMessage (hDlg, IDC_FILTERHZMULT, CB_RESETCONTENT, 0, 0L); SendDlgItemMessage (hDlg, IDC_FILTERVZMULT, CB_RESETCONTENT, 0, 0L); @@ -13010,8 +13010,8 @@ static INT_PTR CALLBACK hw3dDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM } SendDlgItemMessage (hDlg, IDC_FILTEROVERLAYTYPE, CB_RESETCONTENT, 0, 0L); - SendDlgItemMessage (hDlg, IDC_FILTEROVERLAYTYPE, CB_ADDSTRING, 0, (LPARAM)L"Overlays"); - SendDlgItemMessage (hDlg, IDC_FILTEROVERLAYTYPE, CB_ADDSTRING, 0, (LPARAM)L"Masks"); + SendDlgItemMessage (hDlg, IDC_FILTEROVERLAYTYPE, CB_ADDSTRING, 0, (LPARAM)_T("Overlays")); + SendDlgItemMessage (hDlg, IDC_FILTEROVERLAYTYPE, CB_ADDSTRING, 0, (LPARAM)_T("Masks")); SendDlgItemMessage (hDlg, IDC_FILTEROVERLAYTYPE, CB_SETCURSEL, filteroverlaypos, 0); enable_for_hw3ddlg (hDlg); @@ -13266,7 +13266,7 @@ static void enable_for_avioutputdlg (HWND hDlg) ew (hDlg, IDC_STATEREC_BUFFERSIZE, !input_record && full_property_sheet ? TRUE : FALSE); if (avioutput_audio == AVIAUDIO_WAV) { - _tcscpy (tmp, L"Wave (internal)"); + _tcscpy (tmp, _T("Wave (internal)")); } else { avioutput_audio = AVIOutput_GetAudioCodec (tmp, sizeof tmp / sizeof (TCHAR)); } @@ -13312,34 +13312,34 @@ static INT_PTR CALLBACK AVIOutputDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LP pages[AVIOUTPUT_ID] = hDlg; currentpage = AVIOUTPUT_ID; AVIOutput_GetSettings (); - regqueryint (NULL, L"Screenshot_Original", &screenshot_originalsize); + regqueryint (NULL, _T("Screenshot_Original"), &screenshot_originalsize); enable_for_avioutputdlg (hDlg); if (!avioutput_filename[0]) { - fetch_path (L"VideoPath", avioutput_filename, sizeof (avioutput_filename) / sizeof (TCHAR)); - _tcscat (avioutput_filename, L"output.avi"); + fetch_path (_T("VideoPath"), avioutput_filename, sizeof (avioutput_filename) / sizeof (TCHAR)); + _tcscat (avioutput_filename, _T("output.avi")); } SendDlgItemMessage (hDlg, IDC_STATEREC_RATE, CB_RESETCONTENT, 0, 0); - SendDlgItemMessage (hDlg, IDC_STATEREC_RATE, CB_ADDSTRING, 0, (LPARAM)L"-"); - SendDlgItemMessage (hDlg, IDC_STATEREC_RATE, CB_ADDSTRING, 0, (LPARAM)L"1"); - SendDlgItemMessage (hDlg, IDC_STATEREC_RATE, CB_ADDSTRING, 0, (LPARAM)L"2"); - SendDlgItemMessage (hDlg, IDC_STATEREC_RATE, CB_ADDSTRING, 0, (LPARAM)L"5"); - SendDlgItemMessage (hDlg, IDC_STATEREC_RATE, CB_ADDSTRING, 0, (LPARAM)L"10"); - SendDlgItemMessage (hDlg, IDC_STATEREC_RATE, CB_ADDSTRING, 0, (LPARAM)L"20"); - SendDlgItemMessage (hDlg, IDC_STATEREC_RATE, CB_ADDSTRING, 0, (LPARAM)L"30"); - SendDlgItemMessage (hDlg, IDC_STATEREC_RATE, CB_ADDSTRING, 0, (LPARAM)L"60"); + SendDlgItemMessage (hDlg, IDC_STATEREC_RATE, CB_ADDSTRING, 0, (LPARAM)_T("-")); + SendDlgItemMessage (hDlg, IDC_STATEREC_RATE, CB_ADDSTRING, 0, (LPARAM)_T("1")); + SendDlgItemMessage (hDlg, IDC_STATEREC_RATE, CB_ADDSTRING, 0, (LPARAM)_T("2")); + SendDlgItemMessage (hDlg, IDC_STATEREC_RATE, CB_ADDSTRING, 0, (LPARAM)_T("5")); + SendDlgItemMessage (hDlg, IDC_STATEREC_RATE, CB_ADDSTRING, 0, (LPARAM)_T("10")); + SendDlgItemMessage (hDlg, IDC_STATEREC_RATE, CB_ADDSTRING, 0, (LPARAM)_T("20")); + SendDlgItemMessage (hDlg, IDC_STATEREC_RATE, CB_ADDSTRING, 0, (LPARAM)_T("30")); + SendDlgItemMessage (hDlg, IDC_STATEREC_RATE, CB_ADDSTRING, 0, (LPARAM)_T("60")); SendDlgItemMessage (hDlg, IDC_STATEREC_RATE, CB_SETCURSEL, 0, 0); if (workprefs.statecapturerate > 0) { - _stprintf (tmp, L"%d", workprefs.statecapturerate / 50); + _stprintf (tmp, _T("%d"), workprefs.statecapturerate / 50); SendDlgItemMessage( hDlg, IDC_STATEREC_RATE, WM_SETTEXT, 0, (LPARAM)tmp); } SendDlgItemMessage (hDlg, IDC_STATEREC_BUFFERSIZE, CB_RESETCONTENT, 0, 0); - SendDlgItemMessage (hDlg, IDC_STATEREC_BUFFERSIZE, CB_ADDSTRING, 0, (LPARAM)L"50"); - SendDlgItemMessage (hDlg, IDC_STATEREC_BUFFERSIZE, CB_ADDSTRING, 0, (LPARAM)L"100"); - SendDlgItemMessage (hDlg, IDC_STATEREC_BUFFERSIZE, CB_ADDSTRING, 0, (LPARAM)L"500"); - SendDlgItemMessage (hDlg, IDC_STATEREC_BUFFERSIZE, CB_ADDSTRING, 0, (LPARAM)L"1000"); - SendDlgItemMessage (hDlg, IDC_STATEREC_BUFFERSIZE, CB_ADDSTRING, 0, (LPARAM)L"10000"); - _stprintf (tmp, L"%d", workprefs.statecapturebuffersize); + SendDlgItemMessage (hDlg, IDC_STATEREC_BUFFERSIZE, CB_ADDSTRING, 0, (LPARAM)_T("50")); + SendDlgItemMessage (hDlg, IDC_STATEREC_BUFFERSIZE, CB_ADDSTRING, 0, (LPARAM)_T("100")); + SendDlgItemMessage (hDlg, IDC_STATEREC_BUFFERSIZE, CB_ADDSTRING, 0, (LPARAM)_T("500")); + SendDlgItemMessage (hDlg, IDC_STATEREC_BUFFERSIZE, CB_ADDSTRING, 0, (LPARAM)_T("1000")); + SendDlgItemMessage (hDlg, IDC_STATEREC_BUFFERSIZE, CB_ADDSTRING, 0, (LPARAM)_T("10000")); + _stprintf (tmp, _T("%d"), workprefs.statecapturebuffersize); SendDlgItemMessage( hDlg, IDC_STATEREC_BUFFERSIZE, WM_SETTEXT, 0, (LPARAM)tmp); @@ -13385,14 +13385,14 @@ static INT_PTR CALLBACK AVIOutputDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LP break; case IDC_SCREENSHOT_ORIGINALSIZE: screenshot_originalsize = ischecked (hDlg, IDC_SCREENSHOT_ORIGINALSIZE) ? 1 : 0; - regsetint (NULL, L"Screenshot_Original", screenshot_originalsize); + regsetint (NULL, _T("Screenshot_Original"), screenshot_originalsize); break; case IDC_STATEREC_SAVE: if (input_record > INPREC_RECORD_NORMAL) { if (DiskSelection (hDlg, wParam, 16, &workprefs, NULL)) { TCHAR tmp[MAX_DPATH]; _tcscpy (tmp, workprefs.inprecfile); - _tcscat (tmp, L".uss"); + _tcscat (tmp, _T(".uss")); inprec_save (workprefs.inprecfile, tmp); statefile_save_recording (tmp); workprefs.inprecfile[0] = 0; @@ -13493,15 +13493,15 @@ static INT_PTR CALLBACK AVIOutputDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LP ofn.lpfnHook = NULL; ofn.lpTemplateName = NULL; ofn.lCustData = 0; - ofn.lpstrFilter = L"Video Clip (*.avi)\0*.avi\0Wave Sound (*.wav)\0"; + ofn.lpstrFilter = _T("Video Clip (*.avi)\0*.avi\0Wave Sound (*.wav)\0"); if(!GetSaveFileName (&ofn)) break; if (ofn.nFilterIndex == 2) { avioutput_audio = AVIAUDIO_WAV; avioutput_video = 0; - if (_tcslen (avioutput_filename) > 4 && !_tcsicmp (avioutput_filename + _tcslen (avioutput_filename) - 4, L".avi")) - _tcscpy (avioutput_filename + _tcslen (avioutput_filename) - 4, L".wav"); + if (_tcslen (avioutput_filename) > 4 && !_tcsicmp (avioutput_filename + _tcslen (avioutput_filename) - 4, _T(".avi"))) + _tcscpy (avioutput_filename + _tcslen (avioutput_filename) - 4, _T(".wav")); } break; } @@ -13793,8 +13793,8 @@ static HWND updatePanel (int id) LONG left, top; left = r.left; top = r.top; - regsetint (NULL, L"GUIPosX", left); - regsetint (NULL, L"GUIPosY", top); + regsetint (NULL, _T("GUIPosX"), left); + regsetint (NULL, _T("GUIPosY"), top); } } ew (hDlg, IDHELP, FALSE); @@ -13932,35 +13932,35 @@ static void createTreeView (HWND hDlg) TreeView_SetImageList (TVhDlg, himl, TVSIL_NORMAL); p = root = CreateFolderNode (TVhDlg, IDS_TREEVIEW_SETTINGS, NULL, ABOUT_ID, 0, NULL); - CN (ABOUT_ID, L"about"); - CN (PATHS_ID, L"path"); - CN (QUICKSTART_ID, L"quickstart"); - CN (LOADSAVE_ID, L"configuration"); + CN (ABOUT_ID, _T("about")); + CN (PATHS_ID, _T("path")); + CN (QUICKSTART_ID, _T("quickstart")); + CN (LOADSAVE_ID, _T("configuration")); #if FRONTEND == 1 - CN (FRONTEND_ID, L"frontend"); + CN (FRONTEND_ID, _T("frontend")); #endif - p1 = p = CreateFolderNode (TVhDlg, IDS_TREEVIEW_HARDWARE, root, LOADSAVE_ID, CONFIG_TYPE_HARDWARE, L"configuration_hardware"); - CN (CPU_ID, L"cpu"); - CN (CHIPSET_ID, L"chipset"); - CN (CHIPSET2_ID, L"chipset2"); - CN (KICKSTART_ID, L"rom"); - CN (MEMORY_ID, L"ram"); - CN (FLOPPY_ID, L"floppy"); - CN (HARDDISK_ID, L"harddisk"); - CN (EXPANSION_ID, L"expansion"); - - p2 = p = CreateFolderNode (TVhDlg, IDS_TREEVIEW_HOST, root, LOADSAVE_ID, CONFIG_TYPE_HOST, L"configuration_host"); - CN (DISPLAY_ID, L"display"); - CN (SOUND_ID, L"sound"); - CN (GAMEPORTS_ID, L"gameport"); - CN (IOPORTS_ID, L"ioport"); - CN (INPUT_ID, L"input"); - CN (AVIOUTPUT_ID, L"output"); - CN (HW3D_ID, L"filter"); - CN (DISK_ID, L"swapper"); - CN (MISC1_ID, L"misc"); - CN (MISC2_ID, L"misc2"); + p1 = p = CreateFolderNode (TVhDlg, IDS_TREEVIEW_HARDWARE, root, LOADSAVE_ID, CONFIG_TYPE_HARDWARE, _T("configuration_hardware")); + CN (CPU_ID, _T("cpu")); + CN (CHIPSET_ID, _T("chipset")); + CN (CHIPSET2_ID, _T("chipset2")); + CN (KICKSTART_ID, _T("rom")); + CN (MEMORY_ID, _T("ram")); + CN (FLOPPY_ID, _T("floppy")); + CN (HARDDISK_ID, _T("harddisk")); + CN (EXPANSION_ID, _T("expansion")); + + p2 = p = CreateFolderNode (TVhDlg, IDS_TREEVIEW_HOST, root, LOADSAVE_ID, CONFIG_TYPE_HOST, _T("configuration_host")); + CN (DISPLAY_ID, _T("display")); + CN (SOUND_ID, _T("sound")); + CN (GAMEPORTS_ID, _T("gameport")); + CN (IOPORTS_ID, _T("ioport")); + CN (INPUT_ID, _T("input")); + CN (AVIOUTPUT_ID, _T("output")); + CN (HW3D_ID, _T("filter")); + CN (DISK_ID, _T("swapper")); + CN (MISC1_ID, _T("misc")); + CN (MISC2_ID, _T("misc2")); if (configtypepanel == 1) TreeView_SelectItem (TVhDlg, p1); @@ -13982,8 +13982,8 @@ static void centerWindow (HWND hDlg) if (owner == NULL) owner = GetDesktopWindow (); if (isfullscreen () <= 0) { - regqueryint (NULL, L"GUIPosX", &x); - regqueryint (NULL, L"GUIPosY", &y); + regqueryint (NULL, _T("GUIPosX"), &x); + regqueryint (NULL, _T("GUIPosY"), &y); } else { GetWindowRect (owner, &rcOwner); GetWindowRect (hDlg, &rcDlg); @@ -14032,7 +14032,7 @@ static int floppyslot_addfile (struct uae_prefs *prefs, const TCHAR *file, int d if (zd && zfile_readdir_archive (zd, NULL, true) > 1) { TCHAR out[MAX_DPATH]; while (zfile_readdir_archive (zd, out, true)) { - struct zfile *zf = zfile_fopen (out, L"rb", ZFD_NORMAL); + struct zfile *zf = zfile_fopen (out, _T("rb"), ZFD_NORMAL); if (zf) { int type = zfile_gettype (zf); if (type == ZFILE_DISKIMAGE) { @@ -14120,14 +14120,14 @@ int dragdrop (HWND hDlg, HDROP hd, struct uae_prefs *prefs, int currentpage) mask = ZFD_NORMAL; if (type < 0) { if (currentpage < 0) { - z = zfile_fopen (file, L"rb", 0); + z = zfile_fopen (file, _T("rb"), 0); if (z) { zip = iszip (z); zfile_fclose (z); } } if (!zip) { - z = zfile_fopen (file, L"rb", mask); + z = zfile_fopen (file, _T("rb"), mask); if (z) { if (currentpage < 0 && iszip (z)) { zip = 1; @@ -14162,7 +14162,7 @@ int dragdrop (HWND hDlg, HDROP hd, struct uae_prefs *prefs, int currentpage) if (currentpage == DISK_ID) { diskswapper_addfile (prefs, file); } else if (currentpage == HARDDISK_ID) { - add_filesys_config (&workprefs, -1, NULL, L"", file, 0, + add_filesys_config (&workprefs, -1, NULL, _T(""), file, 0, 0, 0, 0, 0, 0, NULL, 0, 0); } else { drv = floppyslot_addfile (prefs, file, drv, firstdrv, i); @@ -14187,7 +14187,7 @@ int dragdrop (HWND hDlg, HDROP hd, struct uae_prefs *prefs, int currentpage) if (!full_property_sheet && currentpage < 0) do_filesys_insert (file); else - add_filesys_config (&workprefs, -1, NULL, L"", file, 0, + add_filesys_config (&workprefs, -1, NULL, _T(""), file, 0, 0, 0, 0, 0, 0, NULL, 0, 0); } else { add_filesys_config (&workprefs, -1, NULL, NULL, file, 0, @@ -14225,7 +14225,7 @@ int dragdrop (HWND hDlg, HDROP hd, struct uae_prefs *prefs, int currentpage) if (currentpage < 0 && !full_property_sheet) { do_filesys_insert (file); } else if (currentpage == HARDDISK_ID) { - add_filesys_config (&workprefs, -1, NULL, L"", file, 0, + add_filesys_config (&workprefs, -1, NULL, _T(""), file, 0, 0, 0, 0, 0, 0, NULL, 0, 0); if (!full_property_sheet) do_filesys_insert (file); @@ -14263,7 +14263,7 @@ static INT_PTR CALLBACK DialogProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM l doit = 1; } else if (pBHdr && pBHdr->dbch_devicetype == DBT_DEVTYP_DEVICEINTERFACE) { DEV_BROADCAST_DEVICEINTERFACE *dbd = (DEV_BROADCAST_DEVICEINTERFACE*)lParam; - write_log (L"%s: %s\n", wParam == DBT_DEVICEREMOVECOMPLETE ? L"Removed" : L"Inserted", + write_log (_T("%s: %s\n"), wParam == DBT_DEVICEREMOVECOMPLETE ? _T("Removed") : _T("Inserted"), dbd->dbcc_name); if (wParam == DBT_DEVICEREMOVECOMPLETE) doit = 1; @@ -14394,7 +14394,7 @@ struct newresource *getresource (int tmpl) struct newresource *nr; int size; - _stprintf (rid, L"#%d", tmpl); + _stprintf (rid, _T("#%d"), tmpl); hrsrc = FindResource (inst, rid, RT_DIALOG); if (!hrsrc) { inst = hInst; @@ -14469,7 +14469,7 @@ static int init_page (int tmpl, int icon, int title, res = getresource (tmpl); if (!res) { - write_log (L"init_page(%d) failed\n", tmpl); + write_log (_T("init_page(%d) failed\n"), tmpl); return -1; } ppage[id].nres = res; @@ -14558,14 +14558,14 @@ static void dialogmousemove (HWND hDlg) static void blah(void) { char *str1 = "äöå€õãñëÿüïñç"; - TCHAR *str2 = L"äöå€õãñëÿüïñç"; + TCHAR *str2 = _T("äöå€õãñëÿüïñç"); TCHAR *s1; char *s2; MessageBoxA(NULL, str1, "Test1 ANSI", MB_OK); s1 = au (str1); - MessageBoxW(NULL, s1, L"Test1 UNICODE", MB_OK); + MessageBoxW(NULL, s1, _T("Test1 UNICODE"), MB_OK); - MessageBoxW(NULL, str2, L"Test2 UNICODE", MB_OK); + MessageBoxW(NULL, str2, _T("Test2 UNICODE"), MB_OK); s2 = ua (str2); MessageBoxA(NULL, s2, "Test2 ANSI", MB_OK); } @@ -14594,34 +14594,34 @@ static int GetSettings (int all_options, HWND hwnd) if (!init_called) { first = 1; panelresource = getresource (IDD_PANEL); - LOADSAVE_ID = init_page (IDD_LOADSAVE, IDI_FILE, IDS_LOADSAVE, LoadSaveDlgProc, NULL, L"gui/configurations.htm", IDC_CONFIGTREE); - MEMORY_ID = init_page (IDD_MEMORY, IDI_MEMORY, IDS_MEMORY, MemoryDlgProc, NULL, L"gui/ram.htm", 0); - EXPANSION_ID = init_page (IDD_EXPANSION, IDI_EXPANSION, IDS_EXPANSION, ExpansionDlgProc, NULL, L"gui/expansion.htm", 0); - KICKSTART_ID = init_page (IDD_KICKSTART, IDI_MEMORY, IDS_KICKSTART, KickstartDlgProc, NULL, L"gui/rom.htm", 0); - CPU_ID = init_page (IDD_CPU, IDI_CPU, IDS_CPU, CPUDlgProc, NULL, L"gui/cpu.htm", 0); - DISPLAY_ID = init_page (IDD_DISPLAY, IDI_DISPLAY, IDS_DISPLAY, DisplayDlgProc, NULL, L"gui/display.htm", 0); + LOADSAVE_ID = init_page (IDD_LOADSAVE, IDI_FILE, IDS_LOADSAVE, LoadSaveDlgProc, NULL, _T("gui/configurations.htm"), IDC_CONFIGTREE); + MEMORY_ID = init_page (IDD_MEMORY, IDI_MEMORY, IDS_MEMORY, MemoryDlgProc, NULL, _T("gui/ram.htm"), 0); + EXPANSION_ID = init_page (IDD_EXPANSION, IDI_EXPANSION, IDS_EXPANSION, ExpansionDlgProc, NULL, _T("gui/expansion.htm"), 0); + KICKSTART_ID = init_page (IDD_KICKSTART, IDI_MEMORY, IDS_KICKSTART, KickstartDlgProc, NULL, _T("gui/rom.htm"), 0); + CPU_ID = init_page (IDD_CPU, IDI_CPU, IDS_CPU, CPUDlgProc, NULL, _T("gui/cpu.htm"), 0); + DISPLAY_ID = init_page (IDD_DISPLAY, IDI_DISPLAY, IDS_DISPLAY, DisplayDlgProc, NULL, _T("gui/display.htm"), 0); #if defined (GFXFILTER) - HW3D_ID = init_page (IDD_FILTER, IDI_DISPLAY, IDS_FILTER, hw3dDlgProc, NULL, L"gui/filter.htm", 0); + HW3D_ID = init_page (IDD_FILTER, IDI_DISPLAY, IDS_FILTER, hw3dDlgProc, NULL, _T("gui/filter.htm"), 0); #endif - CHIPSET_ID = init_page (IDD_CHIPSET, IDI_CPU, IDS_CHIPSET, ChipsetDlgProc, NULL, L"gui/chipset.htm", 0); - CHIPSET2_ID = init_page (IDD_CHIPSET2, IDI_CPU, IDS_CHIPSET2, ChipsetDlgProc2, NULL, L"gui/chipset.htm", 0); - SOUND_ID = init_page (IDD_SOUND, IDI_SOUND, IDS_SOUND, SoundDlgProc, NULL, L"gui/sound.htm", 0); - FLOPPY_ID = init_page (IDD_FLOPPY, IDI_FLOPPY, IDS_FLOPPY, FloppyDlgProc, NULL, L"gui/floppies.htm", 0); - DISK_ID = init_page (IDD_DISK, IDI_FLOPPY, IDS_DISK, SwapperDlgProc, SwapperAccel, L"gui/disk.htm", IDC_DISKLIST); + CHIPSET_ID = init_page (IDD_CHIPSET, IDI_CPU, IDS_CHIPSET, ChipsetDlgProc, NULL, _T("gui/chipset.htm"), 0); + CHIPSET2_ID = init_page (IDD_CHIPSET2, IDI_CPU, IDS_CHIPSET2, ChipsetDlgProc2, NULL, _T("gui/chipset.htm"), 0); + SOUND_ID = init_page (IDD_SOUND, IDI_SOUND, IDS_SOUND, SoundDlgProc, NULL, _T("gui/sound.htm"), 0); + FLOPPY_ID = init_page (IDD_FLOPPY, IDI_FLOPPY, IDS_FLOPPY, FloppyDlgProc, NULL, _T("gui/floppies.htm"), 0); + DISK_ID = init_page (IDD_DISK, IDI_FLOPPY, IDS_DISK, SwapperDlgProc, SwapperAccel, _T("gui/disk.htm"), IDC_DISKLIST); #ifdef FILESYS - HARDDISK_ID = init_page (IDD_HARDDISK, IDI_HARDDISK, IDS_HARDDISK, HarddiskDlgProc, HarddiskAccel, L"gui/hard-drives.htm", 0); + HARDDISK_ID = init_page (IDD_HARDDISK, IDI_HARDDISK, IDS_HARDDISK, HarddiskDlgProc, HarddiskAccel, _T("gui/hard-drives.htm"), 0); #endif - GAMEPORTS_ID = init_page (IDD_GAMEPORTS, IDI_GAMEPORTS, IDS_GAMEPORTS, GamePortsDlgProc, NULL, L"gui/gameports.htm", 0); + GAMEPORTS_ID = init_page (IDD_GAMEPORTS, IDI_GAMEPORTS, IDS_GAMEPORTS, GamePortsDlgProc, NULL, _T("gui/gameports.htm"), 0); INPUTMAP_ID = init_page (IDD_INPUTMAP, IDI_GAMEPORTS, IDS_GAMEPORTS, InputMapDlgProc, NULL, NULL, IDC_INPUTMAPLIST); - IOPORTS_ID = init_page (IDD_IOPORTS, IDI_PORTS, IDS_IOPORTS, IOPortsDlgProc, NULL, L"gui/ioports.htm", 0); - INPUT_ID = init_page (IDD_INPUT, IDI_INPUT, IDS_INPUT, InputDlgProc, NULL, L"gui/input.htm", IDC_INPUTLIST); - MISC1_ID = init_page (IDD_MISC1, IDI_MISC1, IDS_MISC1, MiscDlgProc1, NULL, L"gui/misc.htm", 0); - MISC2_ID = init_page (IDD_MISC2, IDI_MISC2, IDS_MISC2, MiscDlgProc2, NULL, L"gui/misc2.htm", 0); + IOPORTS_ID = init_page (IDD_IOPORTS, IDI_PORTS, IDS_IOPORTS, IOPortsDlgProc, NULL, _T("gui/ioports.htm"), 0); + INPUT_ID = init_page (IDD_INPUT, IDI_INPUT, IDS_INPUT, InputDlgProc, NULL, _T("gui/input.htm"), IDC_INPUTLIST); + MISC1_ID = init_page (IDD_MISC1, IDI_MISC1, IDS_MISC1, MiscDlgProc1, NULL, _T("gui/misc.htm"), 0); + MISC2_ID = init_page (IDD_MISC2, IDI_MISC2, IDS_MISC2, MiscDlgProc2, NULL, _T("gui/misc2.htm"), 0); #ifdef AVIOUTPUT - AVIOUTPUT_ID = init_page (IDD_AVIOUTPUT, IDI_AVIOUTPUT, IDS_AVIOUTPUT, AVIOutputDlgProc, NULL, L"gui/output.htm", 0); + AVIOUTPUT_ID = init_page (IDD_AVIOUTPUT, IDI_AVIOUTPUT, IDS_AVIOUTPUT, AVIOutputDlgProc, NULL, _T("gui/output.htm"), 0); #endif - PATHS_ID = init_page (IDD_PATHS, IDI_PATHS, IDS_PATHS, PathsDlgProc, NULL, L"gui/paths.htm", 0); - QUICKSTART_ID = init_page (IDD_QUICKSTART, IDI_QUICKSTART, IDS_QUICKSTART, QuickstartDlgProc, NULL, L"gui/quickstart.htm", 0); + PATHS_ID = init_page (IDD_PATHS, IDI_PATHS, IDS_PATHS, PathsDlgProc, NULL, _T("gui/paths.htm"), 0); + QUICKSTART_ID = init_page (IDD_QUICKSTART, IDI_QUICKSTART, IDS_QUICKSTART, QuickstartDlgProc, NULL, _T("gui/quickstart.htm"), 0); ABOUT_ID = init_page (IDD_ABOUT, IDI_ABOUT, IDS_ABOUT, AboutDlgProc, NULL, NULL, 0); FRONTEND_ID = init_page (IDD_FRONTEND, IDI_QUICKSTART, IDS_FRONTEND, AboutDlgProc, NULL, NULL, 0); C_PAGES = FRONTEND_ID + 1; @@ -14639,7 +14639,7 @@ static int GetSettings (int all_options, HWND hwnd) hAccelTable = NULL; DragAcceptFiles (hwnd, TRUE); if (first) - write_log (L"Entering GUI idle loop\n"); + write_log (_T("Entering GUI idle loop\n")); scaleresource_setmaxsize (800, 600); tres = scaleresource (panelresource, hwnd); @@ -14847,9 +14847,9 @@ void gui_led (int led, int on) pos = 6 + (led - LED_DF0); ptr = drive_text + pos * 16; if (gui_data.drive_disabled[led - 1]) - _tcscpy (ptr, L""); + _tcscpy (ptr, _T("")); else - _stprintf (ptr , L"%02d", gui_data.drive_track[led - 1]); + _stprintf (ptr , _T("%02d"), gui_data.drive_track[led - 1]); p = gui_data.df[led - 1]; j = _tcslen (p) - 1; if (j < 0) @@ -14862,23 +14862,23 @@ void gui_led (int led, int on) tt = dfx[led - 1]; tt[0] = 0; if (_tcslen (p + j) > 0) - _stprintf (tt, L"%s [CRC=%08X]", p + j, gui_data.crc32[led - 1]); + _stprintf (tt, _T("%s [CRC=%08X]"), p + j, gui_data.crc32[led - 1]); center = 1; if (gui_data.drive_writing[led - 1]) writing = 1; } else if (led == LED_POWER) { pos = 3; - ptr = _tcscpy (drive_text + pos * 16, L"Power"); + ptr = _tcscpy (drive_text + pos * 16, _T("Power")); center = 1; } else if (led == LED_HD) { pos = 4; - ptr = _tcscpy (drive_text + pos * 16, L"HD"); + ptr = _tcscpy (drive_text + pos * 16, _T("HD")); center = 1; if (on > 1) writing = 1; } else if (led == LED_CD) { pos = 5; - ptr = _tcscpy (drive_text + pos * 16, L"CD"); + ptr = _tcscpy (drive_text + pos * 16, _T("CD")); center = 1; if (on & LED_CD_AUDIO) playing = 1; @@ -14893,18 +14893,18 @@ void gui_led (int led, int on) if (fps > 999.9) fps = 999.9; if (picasso_on) - _stprintf (ptr, L"%.1f [%.1f]", p96vblank, fps); + _stprintf (ptr, _T("%.1f [%.1f]"), p96vblank, fps); else - _stprintf (ptr, L"FPS: %.1f", fps); + _stprintf (ptr, _T("FPS: %.1f"), fps); if (pause_emulation) { - _tcscpy (ptr, L"PAUSED"); + _tcscpy (ptr, _T("PAUSED")); center = 1; } on = 1; } else if (led == LED_CPU) { pos = 1; ptr = drive_text + pos * 16; - _stprintf (ptr, L"CPU: %.0f%%", (double)((gui_data.idle) / 10.0)); + _stprintf (ptr, _T("CPU: %.0f%%"), (double)((gui_data.idle) / 10.0)); if (pause_emulation) on = 0; else @@ -14913,15 +14913,15 @@ void gui_led (int led, int on) pos = 0; ptr = drive_text + pos * 16; if (gui_data.sndbuf_status < 3 && !pause_emulation) { - _stprintf (ptr, L"SND: %+.0f%%", (double)((gui_data.sndbuf) / 10.0)); + _stprintf (ptr, _T("SND: %+.0f%%"), (double)((gui_data.sndbuf) / 10.0)); } else { - _tcscpy (ptr, L"SND: -"); + _tcscpy (ptr, _T("SND: -")); center = 1; on = 0; } } else if (led == LED_MD) { pos = 6 + 3; - ptr = _tcscpy (drive_text + pos * 16, L"NV"); + ptr = _tcscpy (drive_text + pos * 16, _T("NV")); } type = SBT_OWNERDRAW; @@ -14968,7 +14968,7 @@ static int fsdialog (HWND *hwnd, DWORD *flags) HRESULT hr; hr = DirectDraw_FlipToGDISurface(); if (FAILED(hr)) { - write_log (L"FlipToGDISurface failed, %s\n", DXError (hr)); + write_log (_T("FlipToGDISurface failed, %s\n"), DXError (hr)); return 0; } *hwnd = NULL; @@ -15008,7 +15008,7 @@ int gui_message_multibutton (int flags, const TCHAR *format,...) va_end (parms); write_log (msg); if (msg[_tcslen (msg) - 1]!='\n') - write_log (L"\n"); + write_log (_T("\n")); WIN32GUI_LoadUIString (IDS_ERRORTITLE, szTitle, MAX_DPATH); @@ -15062,12 +15062,12 @@ void gui_message (const TCHAR *format,...) write_log (msg); if (msg[_tcslen (msg) - 1] != '\n') - write_log (L"\n"); + write_log (_T("\n")); WIN32GUI_LoadUIString (IDS_ERRORTITLE, szTitle, MAX_DPATH); if (!MessageBox (hwnd, msg, szTitle, flags)) - write_log (L"MessageBox(%s) failed, err=%d\n", msg, GetLastError ()); + write_log (_T("MessageBox(%s) failed, err=%d\n"), msg, GetLastError ()); if (!gui_active) { flipgui (false); @@ -15097,7 +15097,7 @@ void pre_gui_message (const TCHAR *format,...) va_end (parms); write_log (msg); if (msg[_tcslen (msg) - 1] != '\n') - write_log (L"\n"); + write_log (_T("\n")); WIN32GUI_LoadUIString (IDS_ERRORTITLE, szTitle, MAX_DPATH); _tcscat (szTitle, BetaStr); diff --git a/od-win32/win32gui_extra.cpp b/od-win32/win32gui_extra.cpp index 4ed2e6d3..8d6a05b8 100644 --- a/od-win32/win32gui_extra.cpp +++ b/od-win32/win32gui_extra.cpp @@ -72,11 +72,11 @@ typedef struct { #include static int font_vista_ok; -static wchar_t wfont_vista[] = L"Segoe UI"; -static wchar_t wfont_xp[] = L"Tahoma"; -static wchar_t wfont_old[] = L"MS Sans Serif"; -static TCHAR font_vista[] = L"Segoe UI"; -static TCHAR font_xp[] = L"Tahoma"; +static wchar_t wfont_vista[] = _T("Segoe UI"); +static wchar_t wfont_xp[] = _T("Tahoma"); +static wchar_t wfont_old[] = _T("MS Sans Serif"); +static TCHAR font_vista[] = _T("Segoe UI"); +static TCHAR font_xp[] = _T("Tahoma"); static BYTE *skiptextone (BYTE *s) { diff --git a/od-win32/writelog.cpp b/od-win32/writelog.cpp index 53f6ff2a..3f28c55f 100644 --- a/od-win32/writelog.cpp +++ b/od-win32/writelog.cpp @@ -34,17 +34,17 @@ static void premsg (void) ws = au_fs (ast); MessageBoxA(NULL, "español", "ANSI", MB_OK); - MessageBoxW(NULL, L"español", L"UTF-16", MB_OK); + MessageBoxW(NULL, _T("español"), _T("UTF-16"), MB_OK); - as = ua (L"español"); + as = ua (_T("español")); MessageBoxA(NULL, as, "ANSI:2", MB_OK); ws = au (as); - MessageBoxW(NULL, ws, L"UTF-16:2", MB_OK); + MessageBoxW(NULL, ws, _T("UTF-16:2"), MB_OK); xfree (ws); xfree (as); ws = au ("español"); - MessageBoxW(NULL, ws, L"UTF-16:3", MB_OK); + MessageBoxW(NULL, ws, _T("UTF-16:3"), MB_OK); as = ua (ws); MessageBoxA(NULL, as, "ANSI:3", MB_OK); xfree (ws); @@ -119,7 +119,7 @@ static void openconsole (void) if (consoleopen > 0 || debuggerinitializing) return; if (debugger_type < 0) { - regqueryint (NULL, L"DebuggerType", &debugger_type); + regqueryint (NULL, _T("DebuggerType"), &debugger_type); if (debugger_type <= 0) debugger_type = 2; openconsole(); @@ -147,7 +147,7 @@ void debugger_change (int mode) debugger_type = mode; if (debugger_type != 1 && debugger_type != 2) debugger_type = 2; - regsetint (NULL, L"DebuggerType", debugger_type); + regsetint (NULL, _T("DebuggerType"), debugger_type); openconsole (); } @@ -163,13 +163,13 @@ void reopen_console (void) if (hwnd) { int newpos = 1; int x, y, w, h; - if (!regqueryint (NULL, L"LoggerPosX", &x)) + if (!regqueryint (NULL, _T("LoggerPosX"), &x)) newpos = 0; - if (!regqueryint (NULL, L"LoggerPosY", &y)) + if (!regqueryint (NULL, _T("LoggerPosY"), &y)) newpos = 0; - if (!regqueryint (NULL, L"LoggerPosW", &w)) + if (!regqueryint (NULL, _T("LoggerPosW"), &w)) newpos = 0; - if (!regqueryint (NULL, L"LoggerPosH", &h)) + if (!regqueryint (NULL, _T("LoggerPosH"), &h)) newpos = 0; if (newpos) { RECT rc; @@ -199,10 +199,10 @@ void close_console (void) if (GetWindowRect (hwnd, &r)) { r.bottom -= r.top; r.right -= r.left; - regsetint (NULL, L"LoggerPosX", r.left); - regsetint (NULL, L"LoggerPosY", r.top); - regsetint (NULL, L"LoggerPosW", r.right); - regsetint (NULL, L"LoggerPosH", r.bottom); + regsetint (NULL, _T("LoggerPosX"), r.left); + regsetint (NULL, _T("LoggerPosY"), r.top); + regsetint (NULL, _T("LoggerPosW"), r.right); + regsetint (NULL, _T("LoggerPosH"), r.bottom); } } FreeConsole (); @@ -380,7 +380,7 @@ static TCHAR *writets (void) return NULL; _ftime (&tb); t = localtime (&tb.time); - _tcsftime (curts, sizeof curts / sizeof (TCHAR), L"%Y-%m-%d %H:%M:%S\n", t); + _tcsftime (curts, sizeof curts / sizeof (TCHAR), _T("%Y-%m-%d %H:%M:%S\n"), t); p = out; *p = 0; if (_tcsncmp (curts, lastts, _tcslen (curts) - 3)) { // "xx\n" @@ -388,13 +388,13 @@ static TCHAR *writets (void) p += _tcslen (p); _tcscpy (lastts, curts); } - _tcsftime (p, sizeof out / sizeof (TCHAR) - (p - out) , L"%S-", t); + _tcsftime (p, sizeof out / sizeof (TCHAR) - (p - out) , _T("%S-"), t); p += _tcslen (p); - _stprintf (p, L"%03d", tb.millitm); + _stprintf (p, _T("%03d"), tb.millitm); p += _tcslen (p); if (vsync_counter != 0xffffffff) - _stprintf (p, L" [%d %03dx%03d]", vsync_counter, current_hpos (), vpos); - _tcscat (p, L": "); + _stprintf (p, _T(" [%d %03dx%03d]"), vsync_counter, current_hpos (), vpos); + _tcscat (p, _T(": ")); return out; } @@ -426,7 +426,7 @@ void write_dlog (const TCHAR *format, ...) break; } bufp[bufsize - 1] = 0; - if (!_tcsncmp (bufp, L"write ", 6)) + if (!_tcsncmp (bufp, _T("write "), 6)) bufsize--; if (bufp[0] == '*') count++; @@ -434,7 +434,7 @@ void write_dlog (const TCHAR *format, ...) writeconsole (bufp); } if (debugfile) { - _ftprintf (debugfile, L"%s", bufp); + _ftprintf (debugfile, _T("%s"), bufp); } lfdetected = 0; if (_tcslen (bufp) > 0 && bufp[_tcslen (bufp) - 1] == '\n') @@ -475,7 +475,7 @@ void write_log (const TCHAR *format, ...) break; } bufp[bufsize - 1] = 0; - if (!_tcsncmp (bufp, L"write ", 6)) + if (!_tcsncmp (bufp, _T("write "), 6)) bufsize--; ts = writets (); if (bufp[0] == '*') @@ -487,8 +487,8 @@ void write_log (const TCHAR *format, ...) } if (debugfile) { if (lfdetected && ts) - _ftprintf (debugfile, L"%s", ts); - _ftprintf (debugfile, L"%s", bufp); + _ftprintf (debugfile, _T("%s"), ts); + _ftprintf (debugfile, _T("%s"), bufp); } lfdetected = 0; if (_tcslen (bufp) > 0 && bufp[_tcslen (bufp) - 1] == '\n') @@ -547,20 +547,20 @@ FILE *log_open (const TCHAR *name, int append, int bootlog) if (name != NULL) { if (bootlog >= 0) { - f = _tfopen (name, append ? L"a, ccs=UTF-8" : L"wt, ccs=UTF-8"); + f = _tfopen (name, append ? _T("a, ccs=UTF-8") : _T("wt, ccs=UTF-8")); if (!f && bootlog) { TCHAR tmp[MAX_DPATH]; tmp[0] = 0; if (GetTempPath (MAX_DPATH, tmp) > 0) { - _tcscat (tmp, L"glog.txt"); - f = _tfopen (tmp, append ? L"a, ccs=UTF-8" : L"wt, ccs=UTF-8"); + _tcscat (tmp, _T("glog.txt")); + f = _tfopen (tmp, append ? _T("a, ccs=UTF-8") : _T("wt, ccs=UTF-8")); } } } bootlogmode = bootlog; } else if (1) { TCHAR *c = GetCommandLine (); - if (_tcsstr (c, L" -console")) { + if (_tcsstr (c, _T(" -console"))) { if (GetStdHandle (STD_INPUT_HANDLE) && GetStdHandle (STD_OUTPUT_HANDLE)) { consoleopen = -1; realconsole = 1; @@ -592,7 +592,7 @@ void jit_abort (const TCHAR *format,...) writeconsole (buffer); va_end (parms); if (!happened) - gui_message (L"JIT: Serious error:\n%s", buffer); + gui_message (_T("JIT: Serious error:\n%s"), buffer); happened = 1; uae_reset (1); } diff --git a/readcpu.cpp b/readcpu.cpp index f8448cd2..aa8eb763 100644 --- a/readcpu.cpp +++ b/readcpu.cpp @@ -15,141 +15,141 @@ int nr_cpuop_funcs; struct mnemolookup lookuptab[] = { - { i_ILLG, L"ILLEGAL" }, - { i_OR, L"OR" }, - { i_CHK, L"CHK" }, - { i_CHK2, L"CHK2" }, - { i_AND, L"AND" }, - { i_EOR, L"EOR" }, - { i_ORSR, L"ORSR" }, - { i_ANDSR, L"ANDSR" }, - { i_EORSR, L"EORSR" }, - { i_SUB, L"SUB" }, - { i_SUBA, L"SUBA" }, - { i_SUBX, L"SUBX" }, - { i_SBCD, L"SBCD" }, - { i_ADD, L"ADD" }, - { i_ADDA, L"ADDA" }, - { i_ADDX, L"ADDX" }, - { i_ABCD, L"ABCD" }, - { i_NEG, L"NEG" }, - { i_NEGX, L"NEGX" }, - { i_NBCD, L"NBCD" }, - { i_CLR, L"CLR" }, - { i_NOT, L"NOT" }, - { i_TST, L"TST" }, - { i_BTST, L"BTST" }, - { i_BCHG, L"BCHG" }, - { i_BCLR, L"BCLR" }, - { i_BSET, L"BSET" }, - { i_CMP, L"CMP" }, - { i_CMPM, L"CMPM" }, - { i_CMPA, L"CMPA" }, - { i_MVPRM, L"MVPRM" }, - { i_MVPMR, L"MVPMR" }, - { i_MOVE, L"MOVE" }, - { i_MOVEA, L"MOVEA" }, - { i_MVSR2, L"MVSR2" }, - { i_MV2SR, L"MV2SR" }, - { i_SWAP, L"SWAP" }, - { i_EXG, L"EXG" }, - { i_EXT, L"EXT" }, - { i_MVMEL, L"MVMEL", L"MOVEM" }, - { i_MVMLE, L"MVMLE", L"MOVEM" }, - { i_TRAP, L"TRAP" }, - { i_MVR2USP, L"MVR2USP" }, - { i_MVUSP2R, L"MVUSP2R" }, - { i_NOP, L"NOP" }, - { i_RESET, L"RESET" }, - { i_RTE, L"RTE" }, - { i_RTD, L"RTD" }, - { i_LINK, L"LINK" }, - { i_UNLK, L"UNLK" }, - { i_RTS, L"RTS" }, - { i_STOP, L"STOP" }, - { i_TRAPV, L"TRAPV" }, - { i_RTR, L"RTR" }, - { i_JSR, L"JSR" }, - { i_JMP, L"JMP" }, - { i_BSR, L"BSR" }, - { i_Bcc, L"Bcc" }, - { i_LEA, L"LEA" }, - { i_PEA, L"PEA" }, - { i_DBcc, L"DBcc" }, - { i_Scc, L"Scc" }, - { i_DIVU, L"DIVU" }, - { i_DIVS, L"DIVS" }, - { i_MULU, L"MULU" }, - { i_MULS, L"MULS" }, - { i_ASR, L"ASR" }, - { i_ASL, L"ASL" }, - { i_LSR, L"LSR" }, - { i_LSL, L"LSL" }, - { i_ROL, L"ROL" }, - { i_ROR, L"ROR" }, - { i_ROXL, L"ROXL" }, - { i_ROXR, L"ROXR" }, - { i_ASRW, L"ASRW" }, - { i_ASLW, L"ASLW" }, - { i_LSRW, L"LSRW" }, - { i_LSLW, L"LSLW" }, - { i_ROLW, L"ROLW" }, - { i_RORW, L"RORW" }, - { i_ROXLW, L"ROXLW" }, - { i_ROXRW, L"ROXRW" }, - - { i_MOVE2C, L"MOVE2C", L"MOVEC" }, - { i_MOVEC2, L"MOVEC2", L"MOVEC" }, - { i_CAS, L"CAS" }, - { i_CAS2, L"CAS2" }, - { i_MULL, L"MULL" }, - { i_DIVL, L"DIVL" }, - { i_BFTST, L"BFTST" }, - { i_BFEXTU, L"BFEXTU" }, - { i_BFCHG, L"BFCHG" }, - { i_BFEXTS, L"BFEXTS" }, - { i_BFCLR, L"BFCLR" }, - { i_BFFFO, L"BFFFO" }, - { i_BFSET, L"BFSET" }, - { i_BFINS, L"BFINS" }, - { i_PACK, L"PACK" }, - { i_UNPK, L"UNPK" }, - { i_TAS, L"TAS" }, - { i_BKPT, L"BKPT" }, - { i_CALLM, L"CALLM" }, - { i_RTM, L"RTM" }, - { i_TRAPcc, L"TRAPcc" }, - { i_MOVES, L"MOVES" }, - { i_FPP, L"FPP" }, - { i_FDBcc, L"FDBcc" }, - { i_FScc, L"FScc" }, - { i_FTRAPcc, L"FTRAPcc" }, - { i_FBcc, L"FBcc" }, - { i_FBcc, L"FBcc" }, - { i_FSAVE, L"FSAVE" }, - { i_FRESTORE, L"FRESTORE" }, - - { i_CINVL, L"CINVL" }, - { i_CINVP, L"CINVP" }, - { i_CINVA, L"CINVA" }, - { i_CPUSHL, L"CPUSHL" }, - { i_CPUSHP, L"CPUSHP" }, - { i_CPUSHA, L"CPUSHA" }, - { i_MOVE16, L"MOVE16" }, - - { i_MMUOP030, L"MMUOP030" }, - { i_PFLUSHN, L"PFLUSHN" }, - { i_PFLUSH, L"PFLUSH" }, - { i_PFLUSHAN, L"PFLUSHAN" }, - { i_PFLUSHA, L"PFLUSHA" }, - - { i_PLPAR, L"PLPAR" }, - { i_PLPAW, L"PLPAW" }, - { i_PTESTR, L"PTESTR" }, - { i_PTESTW, L"PTESTW" }, - - { i_LPSTOP, L"LPSTOP" }, - { i_ILLG, L"" }, + { i_ILLG, _T("ILLEGAL") }, + { i_OR, _T("OR") }, + { i_CHK, _T("CHK") }, + { i_CHK2, _T("CHK2") }, + { i_AND, _T("AND") }, + { i_EOR, _T("EOR") }, + { i_ORSR, _T("ORSR") }, + { i_ANDSR, _T("ANDSR") }, + { i_EORSR, _T("EORSR") }, + { i_SUB, _T("SUB") }, + { i_SUBA, _T("SUBA") }, + { i_SUBX, _T("SUBX") }, + { i_SBCD, _T("SBCD") }, + { i_ADD, _T("ADD") }, + { i_ADDA, _T("ADDA") }, + { i_ADDX, _T("ADDX") }, + { i_ABCD, _T("ABCD") }, + { i_NEG, _T("NEG") }, + { i_NEGX, _T("NEGX") }, + { i_NBCD, _T("NBCD") }, + { i_CLR, _T("CLR") }, + { i_NOT, _T("NOT") }, + { i_TST, _T("TST") }, + { i_BTST, _T("BTST") }, + { i_BCHG, _T("BCHG") }, + { i_BCLR, _T("BCLR") }, + { i_BSET, _T("BSET") }, + { i_CMP, _T("CMP") }, + { i_CMPM, _T("CMPM") }, + { i_CMPA, _T("CMPA") }, + { i_MVPRM, _T("MVPRM") }, + { i_MVPMR, _T("MVPMR") }, + { i_MOVE, _T("MOVE") }, + { i_MOVEA, _T("MOVEA") }, + { i_MVSR2, _T("MVSR2") }, + { i_MV2SR, _T("MV2SR") }, + { i_SWAP, _T("SWAP") }, + { i_EXG, _T("EXG") }, + { i_EXT, _T("EXT") }, + { i_MVMEL, _T("MVMEL"), _T("MOVEM") }, + { i_MVMLE, _T("MVMLE"), _T("MOVEM") }, + { i_TRAP, _T("TRAP") }, + { i_MVR2USP, _T("MVR2USP") }, + { i_MVUSP2R, _T("MVUSP2R") }, + { i_NOP, _T("NOP") }, + { i_RESET, _T("RESET") }, + { i_RTE, _T("RTE") }, + { i_RTD, _T("RTD") }, + { i_LINK, _T("LINK") }, + { i_UNLK, _T("UNLK") }, + { i_RTS, _T("RTS") }, + { i_STOP, _T("STOP") }, + { i_TRAPV, _T("TRAPV") }, + { i_RTR, _T("RTR") }, + { i_JSR, _T("JSR") }, + { i_JMP, _T("JMP") }, + { i_BSR, _T("BSR") }, + { i_Bcc, _T("Bcc") }, + { i_LEA, _T("LEA") }, + { i_PEA, _T("PEA") }, + { i_DBcc, _T("DBcc") }, + { i_Scc, _T("Scc") }, + { i_DIVU, _T("DIVU") }, + { i_DIVS, _T("DIVS") }, + { i_MULU, _T("MULU") }, + { i_MULS, _T("MULS") }, + { i_ASR, _T("ASR") }, + { i_ASL, _T("ASL") }, + { i_LSR, _T("LSR") }, + { i_LSL, _T("LSL") }, + { i_ROL, _T("ROL") }, + { i_ROR, _T("ROR") }, + { i_ROXL, _T("ROXL") }, + { i_ROXR, _T("ROXR") }, + { i_ASRW, _T("ASRW") }, + { i_ASLW, _T("ASLW") }, + { i_LSRW, _T("LSRW") }, + { i_LSLW, _T("LSLW") }, + { i_ROLW, _T("ROLW") }, + { i_RORW, _T("RORW") }, + { i_ROXLW, _T("ROXLW") }, + { i_ROXRW, _T("ROXRW") }, + + { i_MOVE2C, _T("MOVE2C"), _T("MOVEC") }, + { i_MOVEC2, _T("MOVEC2"), _T("MOVEC") }, + { i_CAS, _T("CAS") }, + { i_CAS2, _T("CAS2") }, + { i_MULL, _T("MULL") }, + { i_DIVL, _T("DIVL") }, + { i_BFTST, _T("BFTST") }, + { i_BFEXTU, _T("BFEXTU") }, + { i_BFCHG, _T("BFCHG") }, + { i_BFEXTS, _T("BFEXTS") }, + { i_BFCLR, _T("BFCLR") }, + { i_BFFFO, _T("BFFFO") }, + { i_BFSET, _T("BFSET") }, + { i_BFINS, _T("BFINS") }, + { i_PACK, _T("PACK") }, + { i_UNPK, _T("UNPK") }, + { i_TAS, _T("TAS") }, + { i_BKPT, _T("BKPT") }, + { i_CALLM, _T("CALLM") }, + { i_RTM, _T("RTM") }, + { i_TRAPcc, _T("TRAPcc") }, + { i_MOVES, _T("MOVES") }, + { i_FPP, _T("FPP") }, + { i_FDBcc, _T("FDBcc") }, + { i_FScc, _T("FScc") }, + { i_FTRAPcc, _T("FTRAPcc") }, + { i_FBcc, _T("FBcc") }, + { i_FBcc, _T("FBcc") }, + { i_FSAVE, _T("FSAVE") }, + { i_FRESTORE, _T("FRESTORE") }, + + { i_CINVL, _T("CINVL") }, + { i_CINVP, _T("CINVP") }, + { i_CINVA, _T("CINVA") }, + { i_CPUSHL, _T("CPUSHL") }, + { i_CPUSHP, _T("CPUSHP") }, + { i_CPUSHA, _T("CPUSHA") }, + { i_MOVE16, _T("MOVE16") }, + + { i_MMUOP030, _T("MMUOP030") }, + { i_PFLUSHN, _T("PFLUSHN") }, + { i_PFLUSH, _T("PFLUSH") }, + { i_PFLUSHAN, _T("PFLUSHAN") }, + { i_PFLUSHA, _T("PFLUSHA") }, + + { i_PLPAR, _T("PLPAR") }, + { i_PLPAW, _T("PLPAW") }, + { i_PTESTR, _T("PTESTR") }, + { i_PTESTW, _T("PTESTW") }, + + { i_LPSTOP, _T("LPSTOP") }, + { i_ILLG, _T("") }, }; struct instr *table68k; @@ -178,18 +178,18 @@ static int specialcase (uae_u16 opcode, int cpu_lev) static amodes mode_from_str (const TCHAR *str) { - if (_tcsncmp (str, L"Dreg", 4) == 0) return Dreg; - if (_tcsncmp (str, L"Areg", 4) == 0) return Areg; - if (_tcsncmp (str, L"Aind", 4) == 0) return Aind; - if (_tcsncmp (str, L"Apdi", 4) == 0) return Apdi; - if (_tcsncmp (str, L"Aipi", 4) == 0) return Aipi; - if (_tcsncmp (str, L"Ad16", 4) == 0) return Ad16; - if (_tcsncmp (str, L"Ad8r", 4) == 0) return Ad8r; - if (_tcsncmp (str, L"absw", 4) == 0) return absw; - if (_tcsncmp (str, L"absl", 4) == 0) return absl; - if (_tcsncmp (str, L"PC16", 4) == 0) return PC16; - if (_tcsncmp (str, L"PC8r", 4) == 0) return PC8r; - if (_tcsncmp (str, L"Immd", 4) == 0) return imm; + if (_tcsncmp (str, _T("Dreg"), 4) == 0) return Dreg; + if (_tcsncmp (str, _T("Areg"), 4) == 0) return Areg; + if (_tcsncmp (str, _T("Aind"), 4) == 0) return Aind; + if (_tcsncmp (str, _T("Apdi"), 4) == 0) return Apdi; + if (_tcsncmp (str, _T("Aipi"), 4) == 0) return Aipi; + if (_tcsncmp (str, _T("Ad16"), 4) == 0) return Ad16; + if (_tcsncmp (str, _T("Ad8r"), 4) == 0) return Ad8r; + if (_tcsncmp (str, _T("absw"), 4) == 0) return absw; + if (_tcsncmp (str, _T("absl"), 4) == 0) return absl; + if (_tcsncmp (str, _T("PC16"), 4) == 0) return PC16; + if (_tcsncmp (str, _T("PC8r"), 4) == 0) return PC8r; + if (_tcsncmp (str, _T("Immd"), 4) == 0) return imm; abort (); return 0; } @@ -718,7 +718,7 @@ out1: endofline: /* now, we have a match */ if (table68k[opc].mnemo != i_ILLG) - ;//write_log (L"Double match: %x: %s\n", opc, opcstr); + ;//write_log (_T("Double match: %x: %s\n"), opc, opcstr); if (find == -1) { for (find = 0;; find++) { if (_tcscmp (mnemonic, lookuptab[find].name) == 0) { diff --git a/rommgr.cpp b/rommgr.cpp index bbde5516..242345de 100644 --- a/rommgr.cpp +++ b/rommgr.cpp @@ -92,215 +92,215 @@ struct romdata *getromdatabypath (const TCHAR *path) #define NEXT_ROM_ID 74 static struct romheader romheaders[] = { - { L"Freezer Cartridges", 1 }, - { L"Arcadia Games", 2 }, + { _T("Freezer Cartridges"), 1 }, + { _T("Arcadia Games"), 2 }, { NULL, 0 } }; #define ALTROM(id,grp,num,size,flags,crc32,a,b,c,d,e) \ -{ L"X", 0, 0, 0, 0, 0, size, id, 0, 0, flags, (grp << 16) | num, 0, NULL, crc32, a, b, c, d, e }, +{ _T("X"), 0, 0, 0, 0, 0, size, id, 0, 0, flags, (grp << 16) | num, 0, NULL, crc32, a, b, c, d, e }, #define ALTROMPN(id,grp,num,size,flags,pn,crc32,a,b,c,d,e) \ -{ L"X", 0, 0, 0, 0, 0, size, id, 0, 0, flags, (grp << 16) | num, 0, pn, crc32, a, b, c, d, e }, +{ _T("X"), 0, 0, 0, 0, 0, size, id, 0, 0, flags, (grp << 16) | num, 0, pn, crc32, a, b, c, d, e }, static struct romdata roms[] = { - { L" AROS KS ROM (built-in)", 0, 0, 0, 0, L"AROS\0", 524288 * 2, 66, 0, 0, ROMTYPE_KICK, 0, 0, NULL, - 0xffffffff, 0, 0, 0, 0, 0, L"AROS" }, + { _T(" AROS KS ROM (built-in)"), 0, 0, 0, 0, _T("AROS\0"), 524288 * 2, 66, 0, 0, ROMTYPE_KICK, 0, 0, NULL, + 0xffffffff, 0, 0, 0, 0, 0, _T("AROS") }, - { L"Cloanto Amiga Forever ROM key", 0, 0, 0, 0, 0, 2069, 0, 0, 1, ROMTYPE_KEY, 0, 0, NULL, + { _T("Cloanto Amiga Forever ROM key"), 0, 0, 0, 0, 0, 2069, 0, 0, 1, ROMTYPE_KEY, 0, 0, NULL, 0x869ae1b1, 0x801bbab3,0x2e3d3738,0x6dd1636d,0x4f1d6fa7,0xe21d5874 }, - { L"Cloanto Amiga Forever 2006 ROM key", 0, 0, 0, 0, 0, 750, 48, 0, 1, ROMTYPE_KEY, 0, 0, NULL, + { _T("Cloanto Amiga Forever 2006 ROM key"), 0, 0, 0, 0, 0, 750, 48, 0, 1, ROMTYPE_KEY, 0, 0, NULL, 0xb01c4b56, 0xbba8e5cd,0x118b8d92,0xafed5693,0x5eeb9770,0x2a662d8f }, - { L"Cloanto Amiga Forever 2010 ROM key", 0, 0, 0, 0, 0, 1544, 73, 0, 1, ROMTYPE_KEY, 0, 0, NULL, + { _T("Cloanto Amiga Forever 2010 ROM key"), 0, 0, 0, 0, 0, 1544, 73, 0, 1, ROMTYPE_KEY, 0, 0, NULL, 0x8c4dd05c, 0x05034f62,0x0b5bb7b2,0x86954ea9,0x164fdb90,0xfb2897a4 }, - { L"KS ROM v1.0 (A1000)(NTSC)", 1, 0, 1, 0, L"A1000\0", 262144, 1, 0, 0, ROMTYPE_KICK, 0, 0, NULL, + { _T("KS ROM v1.0 (A1000)(NTSC)"), 1, 0, 1, 0, _T("A1000\0"), 262144, 1, 0, 0, ROMTYPE_KICK, 0, 0, NULL, 0x299790ff, 0x00C15406,0xBEB4B8AB,0x1A16AA66,0xC05860E1,0xA7C1AD79 }, - { L"KS ROM v1.1 (A1000)(NTSC)", 1, 1, 31, 34, L"A1000\0", 262144, 2, 0, 0, ROMTYPE_KICK, 0, 0, NULL, + { _T("KS ROM v1.1 (A1000)(NTSC)"), 1, 1, 31, 34, _T("A1000\0"), 262144, 2, 0, 0, ROMTYPE_KICK, 0, 0, NULL, 0xd060572a, 0x4192C505,0xD130F446,0xB2ADA6BD,0xC91DAE73,0x0ACAFB4C}, - { L"KS ROM v1.1 (A1000)(PAL)", 1, 1, 31, 34, L"A1000\0", 262144, 3, 0, 0, ROMTYPE_KICK, 0, 0, NULL, + { _T("KS ROM v1.1 (A1000)(PAL)"), 1, 1, 31, 34, _T("A1000\0"), 262144, 3, 0, 0, ROMTYPE_KICK, 0, 0, NULL, 0xec86dae2, 0x16DF8B5F,0xD524C5A1,0xC7584B24,0x57AC15AF,0xF9E3AD6D }, - { L"KS ROM v1.2 (A1000)", 1, 2, 33, 166, L"A1000\0", 262144, 4, 0, 0, ROMTYPE_KICK, 0, 0, NULL, + { _T("KS ROM v1.2 (A1000)"), 1, 2, 33, 166, _T("A1000\0"), 262144, 4, 0, 0, ROMTYPE_KICK, 0, 0, NULL, 0x9ed783d0, 0x6A7BFB5D,0xBD6B8F17,0x9F03DA84,0xD8D95282,0x67B6273B }, - { L"KS ROM v1.2 (A500,A1000,A2000)", 1, 2, 33, 180, L"A500\0A1000\0A2000\0", 262144, 5, 0, 0, ROMTYPE_KICK, 0, 0, L"315093-01", + { _T("KS ROM v1.2 (A500,A1000,A2000)"), 1, 2, 33, 180, _T("A500\0A1000\0A2000\0"), 262144, 5, 0, 0, ROMTYPE_KICK, 0, 0, _T("315093-01"), 0xa6ce1636, 0x11F9E62C,0xF299F721,0x84835B7B,0x2A70A163,0x33FC0D88 }, - { L"KS ROM v1.3 (A500,A1000,A2000)", 1, 3, 34, 5, L"A500\0A1000\0A2000\0", 262144, 6, 0, 0, ROMTYPE_KICK, 0, 0, L"315093-02", + { _T("KS ROM v1.3 (A500,A1000,A2000)"), 1, 3, 34, 5, _T("A500\0A1000\0A2000\0"), 262144, 6, 0, 0, ROMTYPE_KICK, 0, 0, _T("315093-02"), 0xc4f0f55f, 0x891E9A54,0x7772FE0C,0x6C19B610,0xBAF8BC4E,0xA7FCB785 }, - { L"KS ROM v1.3 (A3000)(SK)", 1, 3, 34, 5, L"A3000\0", 262144, 32, 0, 0, ROMTYPE_KICK, 0, 0, NULL, + { _T("KS ROM v1.3 (A3000)(SK)"), 1, 3, 34, 5, _T("A3000\0"), 262144, 32, 0, 0, ROMTYPE_KICK, 0, 0, NULL, 0xe0f37258, 0xC39BD909,0x4D4E5F4E,0x28C1411F,0x30869504,0x06062E87 }, - { L"KS ROM v1.4 (A3000)", 1, 4, 36, 16, L"A3000\0", 524288, 59, 3, 0, ROMTYPE_KICK, 0, 0, NULL, + { _T("KS ROM v1.4 (A3000)"), 1, 4, 36, 16, _T("A3000\0"), 524288, 59, 3, 0, ROMTYPE_KICK, 0, 0, NULL, 0xbc0ec13f, 0xF76316BF,0x36DFF14B,0x20FA349E,0xD02E4B11,0xDD932B07 }, - ALTROMPN(59, 1, 1, 262144, ROMTYPE_EVEN, L"390629-02", 0x58327536,0xd1713d7f,0x31474a59,0x48e6d488,0xe3368606,0x1cf3d1e2) - ALTROMPN(59, 1, 2, 262144, ROMTYPE_ODD , L"390630-02", 0xfe2f7fb9,0xc05c9c52,0xd014c66f,0x9019152b,0x3f2a2adc,0x2c678794) - { L"KS ROM v2.04 (A500+)", 2, 4, 37, 175, L"A500+\0", 524288, 7, 0, 0, ROMTYPE_KICK, 0, 0, L"390979-01", + ALTROMPN(59, 1, 1, 262144, ROMTYPE_EVEN, _T("390629-02"), 0x58327536,0xd1713d7f,0x31474a59,0x48e6d488,0xe3368606,0x1cf3d1e2) + ALTROMPN(59, 1, 2, 262144, ROMTYPE_ODD , _T("390630-02"), 0xfe2f7fb9,0xc05c9c52,0xd014c66f,0x9019152b,0x3f2a2adc,0x2c678794) + { _T("KS ROM v2.04 (A500+)"), 2, 4, 37, 175, _T("A500+\0"), 524288, 7, 0, 0, ROMTYPE_KICK, 0, 0, _T("390979-01"), 0xc3bdb240, 0xC5839F5C,0xB98A7A89,0x47065C3E,0xD2F14F5F,0x42E334A1 }, - { L"KS ROM v2.05 (A600)", 2, 5, 37, 299, L"A600\0", 524288, 8, 0, 0, ROMTYPE_KICK, 0, 0, L"391388-01", + { _T("KS ROM v2.05 (A600)"), 2, 5, 37, 299, _T("A600\0"), 524288, 8, 0, 0, ROMTYPE_KICK, 0, 0, _T("391388-01"), 0x83028fb5, 0x87508DE8,0x34DC7EB4,0x7359CEDE,0x72D2E3C8,0xA2E5D8DB }, - { L"KS ROM v2.05 (A600HD)", 2, 5, 37, 300, L"A600HD\0A600\0", 524288, 9, 0, 0, ROMTYPE_KICK, 0, 0, L"391304-01", + { _T("KS ROM v2.05 (A600HD)"), 2, 5, 37, 300, _T("A600HD\0A600\0"), 524288, 9, 0, 0, ROMTYPE_KICK, 0, 0, _T("391304-01"), 0x64466c2a, 0xF72D8914,0x8DAC39C6,0x96E30B10,0x859EBC85,0x9226637B }, - { L"KS ROM v2.05 (A600HD)", 2, 5, 37, 350, L"A600HD\0A600\0", 524288, 10, 0, 0, ROMTYPE_KICK, 0, 0, L"391304-02", + { _T("KS ROM v2.05 (A600HD)"), 2, 5, 37, 350, _T("A600HD\0A600\0"), 524288, 10, 0, 0, ROMTYPE_KICK, 0, 0, _T("391304-02"), 0x43b0df7b, 0x02843C42,0x53BBD29A,0xBA535B0A,0xA3BD9A85,0x034ECDE4 }, - { L"KS ROM v2.04 (A3000)", 2, 4, 37, 175, L"A3000\0", 524288, 71, 3, 0, ROMTYPE_KICK, 0, 0, NULL, + { _T("KS ROM v2.04 (A3000)"), 2, 4, 37, 175, _T("A3000\0"), 524288, 71, 3, 0, ROMTYPE_KICK, 0, 0, NULL, 0x234a7233, 0xd82ebb59,0xafc53540,0xddf2d718,0x7ecf239b,0x7ea91590 }, - ALTROMPN(71, 1, 1, 262144, ROMTYPE_EVEN, L"390629-03", 0xa245dbdf,0x83bab8e9,0x5d378b55,0xb0c6ae65,0x61385a96,0xf638598f) - ALTROMPN(71, 1, 2, 262144, ROMTYPE_ODD , L"390630-03", 0x7db1332b,0x48f14b31,0x279da675,0x7848df6f,0xeb531881,0x8f8f576c) + ALTROMPN(71, 1, 1, 262144, ROMTYPE_EVEN, _T("390629-03"), 0xa245dbdf,0x83bab8e9,0x5d378b55,0xb0c6ae65,0x61385a96,0xf638598f) + ALTROMPN(71, 1, 2, 262144, ROMTYPE_ODD , _T("390630-03"), 0x7db1332b,0x48f14b31,0x279da675,0x7848df6f,0xeb531881,0x8f8f576c) - { L"KS ROM v3.0 (A1200)", 3, 0, 39, 106, L"A1200\0", 524288, 11, 0, 0, ROMTYPE_KICK, 0, 0, NULL, + { _T("KS ROM v3.0 (A1200)"), 3, 0, 39, 106, _T("A1200\0"), 524288, 11, 0, 0, ROMTYPE_KICK, 0, 0, NULL, 0x6c9b07d2, 0x70033828,0x182FFFC7,0xED106E53,0x73A8B89D,0xDA76FAA5 }, - ALTROMPN(11, 1, 1, 262144, ROMTYPE_EVEN, L"391523-01", 0xc742a412,0x999eb81c,0x65dfd07a,0x71ee1931,0x5d99c7eb,0x858ab186) - ALTROMPN(11, 1, 2, 262144, ROMTYPE_ODD , L"391524-01", 0xd55c6ec6,0x3341108d,0x3a402882,0xb5ef9d3b,0x242cbf3c,0x8ab1a3e9) - { L"KS ROM v3.0 (A4000)", 3, 0, 39, 106, L"A4000\0", 524288, 12, 2 | 4, 0, ROMTYPE_KICK, 0, 0, NULL, + ALTROMPN(11, 1, 1, 262144, ROMTYPE_EVEN, _T("391523-01"), 0xc742a412,0x999eb81c,0x65dfd07a,0x71ee1931,0x5d99c7eb,0x858ab186) + ALTROMPN(11, 1, 2, 262144, ROMTYPE_ODD , _T("391524-01"), 0xd55c6ec6,0x3341108d,0x3a402882,0xb5ef9d3b,0x242cbf3c,0x8ab1a3e9) + { _T("KS ROM v3.0 (A4000)"), 3, 0, 39, 106, _T("A4000\0"), 524288, 12, 2 | 4, 0, ROMTYPE_KICK, 0, 0, NULL, 0x9e6ac152, 0xF0B4E9E2,0x9E12218C,0x2D5BD702,0x0E4E7852,0x97D91FD7 }, - ALTROMPN(12, 1, 1, 262144, ROMTYPE_EVEN, L"391513-02", 0x36f64dd0,0x196e9f3f,0x9cad934e,0x181c07da,0x33083b1f,0x0a3c702f) - ALTROMPN(12, 1, 2, 262144, ROMTYPE_ODD , L"391514-02", 0x17266a55,0x42fbed34,0x53d1f11c,0xcbde89a9,0x826f2d11,0x75cca5cc) - { L"KS ROM v3.1 (A4000)", 3, 1, 40, 70, L"A4000\0", 524288, 13, 2 | 4, 0, ROMTYPE_KICK, 0, 0, NULL, + ALTROMPN(12, 1, 1, 262144, ROMTYPE_EVEN, _T("391513-02"), 0x36f64dd0,0x196e9f3f,0x9cad934e,0x181c07da,0x33083b1f,0x0a3c702f) + ALTROMPN(12, 1, 2, 262144, ROMTYPE_ODD , _T("391514-02"), 0x17266a55,0x42fbed34,0x53d1f11c,0xcbde89a9,0x826f2d11,0x75cca5cc) + { _T("KS ROM v3.1 (A4000)"), 3, 1, 40, 70, _T("A4000\0"), 524288, 13, 2 | 4, 0, ROMTYPE_KICK, 0, 0, NULL, 0x2b4566f1, 0x81c631dd,0x096bbb31,0xd2af9029,0x9c76b774,0xdb74076c }, ALTROM(13, 1, 1, 262144, ROMTYPE_EVEN, 0xf9cbecc9,0x138d8cb4,0x3b8312fe,0x16d69070,0xde607469,0xb3d4078e) ALTROM(13, 1, 2, 262144, ROMTYPE_ODD , 0xf8248355,0xc2379547,0x9fae3910,0xc185512c,0xa268b82f,0x1ae4fe05) - { L"KS ROM v3.1 (A500,A600,A2000)", 3, 1, 40, 63, L"A500\0A600\0A2000\0", 524288, 14, 0, 0, ROMTYPE_KICK, 0, 0, NULL, + { _T("KS ROM v3.1 (A500,A600,A2000)"), 3, 1, 40, 63, _T("A500\0A600\0A2000\0"), 524288, 14, 0, 0, ROMTYPE_KICK, 0, 0, NULL, 0xfc24ae0d, 0x3B7F1493,0xB27E2128,0x30F989F2,0x6CA76C02,0x049F09CA }, - { L"KS ROM v3.1 (A1200)", 3, 1, 40, 68, L"A1200\0", 524288, 15, 1, 0, ROMTYPE_KICK, 0, 0, NULL, + { _T("KS ROM v3.1 (A1200)"), 3, 1, 40, 68, _T("A1200\0"), 524288, 15, 1, 0, ROMTYPE_KICK, 0, 0, NULL, 0x1483a091, 0xE2154572,0x3FE8374E,0x91342617,0x604F1B3D,0x703094F1 }, - ALTROMPN(15, 1, 1, 262144, ROMTYPE_EVEN, L"391773-01", 0x08dbf275,0xb8800f5f,0x90929810,0x9ea69690,0xb1b8523f,0xa22ddb37) - ALTROMPN(15, 1, 2, 262144, ROMTYPE_ODD , L"391774-01", 0x16c07bf8,0x90e331be,0x1970b0e5,0x3f53a9b0,0x390b51b5,0x9b3869c2) - { L"KS ROM v3.1 (A3000)", 3, 1, 40, 68, L"A3000\0", 524288, 61, 2, 0, ROMTYPE_KICK, 0, 0, NULL, + ALTROMPN(15, 1, 1, 262144, ROMTYPE_EVEN, _T("391773-01"), 0x08dbf275,0xb8800f5f,0x90929810,0x9ea69690,0xb1b8523f,0xa22ddb37) + ALTROMPN(15, 1, 2, 262144, ROMTYPE_ODD , _T("391774-01"), 0x16c07bf8,0x90e331be,0x1970b0e5,0x3f53a9b0,0x390b51b5,0x9b3869c2) + { _T("KS ROM v3.1 (A3000)"), 3, 1, 40, 68, _T("A3000\0"), 524288, 61, 2, 0, ROMTYPE_KICK, 0, 0, NULL, 0xefb239cc, 0xF8E210D7,0x2B4C4853,0xE0C9B85D,0x223BA20E,0x3D1B36EE }, ALTROM(61, 1, 1, 262144, ROMTYPE_EVEN, 0x286b9a0d,0x6763a225,0x8ec493f7,0x408cf663,0x110dae9a,0x17803ad1) ALTROM(61, 1, 2, 262144, ROMTYPE_ODD , 0x0b8cde6a,0x5f02e97b,0x48ebbba8,0x7d516a56,0xb0400c6f,0xc3434d8d) - { L"KS ROM v3.1 (A4000)(Cloanto)", 3, 1, 40, 68, L"A4000\0", 524288, 31, 2 | 4, 1, ROMTYPE_KICK, 0, 0, NULL, + { _T("KS ROM v3.1 (A4000)(Cloanto)"), 3, 1, 40, 68, _T("A4000\0"), 524288, 31, 2 | 4, 1, ROMTYPE_KICK, 0, 0, NULL, 0x43b6dd22, 0xC3C48116,0x0866E60D,0x085E436A,0x24DB3617,0xFF60B5F9 }, - { L"KS ROM v3.1 (A4000)", 3, 1, 40, 68, L"A4000\0", 524288, 16, 2 | 4, 0, ROMTYPE_KICK, 0, 0, NULL, + { _T("KS ROM v3.1 (A4000)"), 3, 1, 40, 68, _T("A4000\0"), 524288, 16, 2 | 4, 0, ROMTYPE_KICK, 0, 0, NULL, 0xd6bae334, 0x5FE04842,0xD04A4897,0x20F0F4BB,0x0E469481,0x99406F49 }, ALTROM(16, 1, 1, 262144, ROMTYPE_EVEN, 0xb2af34f8,0x24e52b5e,0xfc020495,0x17387ab7,0xb1a1475f,0xc540350e) ALTROM(16, 1, 2, 262144, ROMTYPE_ODD , 0xe65636a3,0x313c7cbd,0xa5779e56,0xf19a41d3,0x4e760f51,0x7626d882) - { L"KS ROM v3.1 (A4000T)", 3, 1, 40, 70, L"A4000T\0", 524288, 17, 2 | 4, 0, ROMTYPE_KICK, 0, 0, NULL, + { _T("KS ROM v3.1 (A4000T)"), 3, 1, 40, 70, _T("A4000T\0"), 524288, 17, 2 | 4, 0, ROMTYPE_KICK, 0, 0, NULL, 0x75932c3a, 0xB0EC8B84,0xD6768321,0xE01209F1,0x1E6248F2,0xF5281A21 }, - ALTROMPN(17, 1, 1, 262144, ROMTYPE_EVEN, L"391657-01", 0x0ca94f70,0xb3806eda,0xcb3362fc,0x16a154ce,0x1eeec5bf,0x5bc24789) - ALTROMPN(17, 1, 2, 262144, ROMTYPE_ODD , L"391658-01", 0xdfe03120,0xcd7a706c,0x431b04d8,0x7814d3a2,0xd8b39710,0x0cf44c0c) - { L"KS ROM v3.X (A4000)(Cloanto)", 3, 10, 45, 57, L"A4000\0", 524288, 46, 2 | 4, 0, ROMTYPE_KICK, 0, 0, NULL, + ALTROMPN(17, 1, 1, 262144, ROMTYPE_EVEN, _T("391657-01"), 0x0ca94f70,0xb3806eda,0xcb3362fc,0x16a154ce,0x1eeec5bf,0x5bc24789) + ALTROMPN(17, 1, 2, 262144, ROMTYPE_ODD , _T("391658-01"), 0xdfe03120,0xcd7a706c,0x431b04d8,0x7814d3a2,0xd8b39710,0x0cf44c0c) + { _T("KS ROM v3.X (A4000)(Cloanto)"), 3, 10, 45, 57, _T("A4000\0"), 524288, 46, 2 | 4, 0, ROMTYPE_KICK, 0, 0, NULL, 0x3ac99edc, 0x3cbfc9e1,0xfe396360,0x157bd161,0xde74fc90,0x1abee7ec }, - { L"CD32 KS ROM v3.1", 3, 1, 40, 60, L"CD32\0", 524288, 18, 1, 0, ROMTYPE_KICKCD32, 0, 0, NULL, + { _T("CD32 KS ROM v3.1"), 3, 1, 40, 60, _T("CD32\0"), 524288, 18, 1, 0, ROMTYPE_KICKCD32, 0, 0, NULL, 0x1e62d4a5, 0x3525BE88,0x87F79B59,0x29E017B4,0x2380A79E,0xDFEE542D }, - { L"CD32 extended ROM", 3, 1, 40, 60, L"CD32\0", 524288, 19, 1, 0, ROMTYPE_EXTCD32, 0, 0, NULL, + { _T("CD32 extended ROM"), 3, 1, 40, 60, _T("CD32\0"), 524288, 19, 1, 0, ROMTYPE_EXTCD32, 0, 0, NULL, 0x87746be2, 0x5BEF3D62,0x8CE59CC0,0x2A66E6E4,0xAE0DA48F,0x60E78F7F }, /* plain CD32 rom */ - { L"CD32 ROM (KS + extended)", 3, 1, 40, 60, L"CD32\0", 2 * 524288, 64, 1, 0, ROMTYPE_KICKCD32 | ROMTYPE_EXTCD32 | ROMTYPE_CD32, 0, 0, NULL, + { _T("CD32 ROM (KS + extended)"), 3, 1, 40, 60, _T("CD32\0"), 2 * 524288, 64, 1, 0, ROMTYPE_KICKCD32 | ROMTYPE_EXTCD32 | ROMTYPE_CD32, 0, 0, NULL, 0xf5d4f3c8, 0x9fa14825,0xc40a2475,0xa2eba5cf,0x325bd483,0xc447e7c1 }, /* real CD32 rom dump 391640-03 */ - ALTROMPN(64, 1, 1, 2 * 524288, ROMTYPE_CD32, L"391640-03", 0xa4fbc94a, 0x816ce6c5,0x07787585,0x0c7d4345,0x2230a9ba,0x3a2902db ) + ALTROMPN(64, 1, 1, 2 * 524288, ROMTYPE_CD32, _T("391640-03"), 0xa4fbc94a, 0x816ce6c5,0x07787585,0x0c7d4345,0x2230a9ba,0x3a2902db ) - { L"CD32 MPEG Cartridge ROM", 3, 1, 40, 30, L"CD32FMV\0", 262144, 23, 1, 0, ROMTYPE_CD32CART, 0, 0, NULL, + { _T("CD32 MPEG Cartridge ROM"), 3, 1, 40, 30, _T("CD32FMV\0"), 262144, 23, 1, 0, ROMTYPE_CD32CART, 0, 0, NULL, 0xc35c37bf, 0x03ca81c7,0xa7b259cf,0x64bc9582,0x863eca0f,0x6529f435 }, - { L"CDTV extended ROM v1.00", 1, 0, 1, 0, L"CDTV\0", 262144, 20, 0, 0, ROMTYPE_EXTCDTV, 0, 0, NULL, + { _T("CDTV extended ROM v1.00"), 1, 0, 1, 0, _T("CDTV\0"), 262144, 20, 0, 0, ROMTYPE_EXTCDTV, 0, 0, NULL, 0x42baa124, 0x7BA40FFA,0x17E500ED,0x9FED041F,0x3424BD81,0xD9C907BE }, - ALTROMPN(20, 1, 1, 131072, ROMTYPE_EVEN | ROMTYPE_8BIT, L"252606-01", 0x791cb14b,0x277a1778,0x92449635,0x3ffe56be,0x68063d2a,0x334360e4) - ALTROMPN(20, 1, 2, 131072, ROMTYPE_ODD | ROMTYPE_8BIT, L"252607-01", 0xaccbbc2e,0x41b06d16,0x79c6e693,0x3c3378b7,0x626025f7,0x641ebc5c) - { L"CDTV extended ROM v2.07", 2, 7, 2, 7, L"CDTV\0", 262144, 22, 0, 0, ROMTYPE_EXTCDTV, 0, 0, NULL, + ALTROMPN(20, 1, 1, 131072, ROMTYPE_EVEN | ROMTYPE_8BIT, _T("252606-01"), 0x791cb14b,0x277a1778,0x92449635,0x3ffe56be,0x68063d2a,0x334360e4) + ALTROMPN(20, 1, 2, 131072, ROMTYPE_ODD | ROMTYPE_8BIT, _T("252607-01"), 0xaccbbc2e,0x41b06d16,0x79c6e693,0x3c3378b7,0x626025f7,0x641ebc5c) + { _T("CDTV extended ROM v2.07"), 2, 7, 2, 7, _T("CDTV\0"), 262144, 22, 0, 0, ROMTYPE_EXTCDTV, 0, 0, NULL, 0xceae68d2, 0x5BC114BB,0xA29F60A6,0x14A31174,0x5B3E2464,0xBFA06846 }, ALTROM(22, 1, 1, 131072, ROMTYPE_EVEN | ROMTYPE_8BIT, 0x36d73cb8,0x9574e546,0x4b390697,0xf28f9a43,0x4e604e5e,0xf5e5490a) ALTROM(22, 1, 2, 131072, ROMTYPE_ODD | ROMTYPE_8BIT, 0x6e84dce7,0x01a0679e,0x895a1a0f,0x559c7253,0xf539606b,0xd447b54f) - { L"CDTV/A570 extended ROM v2.30", 2, 30, 2, 30, L"CDTV\0", 262144, 21, 0, 0, ROMTYPE_EXTCDTV, 0, 0, L"391298-01", + { _T("CDTV/A570 extended ROM v2.30"), 2, 30, 2, 30, _T("CDTV\0"), 262144, 21, 0, 0, ROMTYPE_EXTCDTV, 0, 0, _T("391298-01"), 0x30b54232, 0xED7E461D,0x1FFF3CDA,0x321631AE,0x42B80E3C,0xD4FA5EBB }, ALTROM(21, 1, 1, 131072, ROMTYPE_EVEN | ROMTYPE_8BIT, 0x48e4d74f,0x54946054,0x2269e410,0x36018402,0xe1f6b855,0xfd89092b) ALTROM(21, 1, 2, 131072, ROMTYPE_ODD | ROMTYPE_8BIT, 0x8a54f362,0x03df800f,0x032046fd,0x892f6e7e,0xec08b76d,0x33981e8c) - { L"A1000 bootstrap ROM", 0, 0, 0, 0, L"A1000\0", 65536, 24, 0, 0, ROMTYPE_KICK, 0, 0, NULL, + { _T("A1000 bootstrap ROM"), 0, 0, 0, 0, _T("A1000\0"), 65536, 24, 0, 0, ROMTYPE_KICK, 0, 0, NULL, 0x0b1ad2d0, 0xBA93B8B8,0x5CA0D83A,0x68225CC3,0x3B95050D,0x72D2FDD7 }, ALTROM(24, 1, 1, 8192, 0, 0x62f11c04, 0xC87F9FAD,0xA4EE4E69,0xF3CCA0C3,0x6193BE82,0x2B9F5FE6) - ALTROMPN(24, 2, 1, 4096, ROMTYPE_EVEN | ROMTYPE_8BIT, L"252179-01", 0x42553bc4,0x8855a97f,0x7a44e3f6,0x2d1c88d9,0x38fee1f4,0xc606af5b) - ALTROMPN(24, 2, 2, 4096, ROMTYPE_ODD | ROMTYPE_8BIT, L"252180-01", 0x8e5b9a37,0xd10f1564,0xb99f5ffe,0x108fa042,0x362e877f,0x569de2c3) + ALTROMPN(24, 2, 1, 4096, ROMTYPE_EVEN | ROMTYPE_8BIT, _T("252179-01"), 0x42553bc4,0x8855a97f,0x7a44e3f6,0x2d1c88d9,0x38fee1f4,0xc606af5b) + ALTROMPN(24, 2, 2, 4096, ROMTYPE_ODD | ROMTYPE_8BIT, _T("252180-01"), 0x8e5b9a37,0xd10f1564,0xb99f5ffe,0x108fa042,0x362e877f,0x569de2c3) - { L"The Diagnostic 2.0 (Logica)", 2, 0, 2, 0, L"LOGICA\0", 524288, 72, 0, 0, ROMTYPE_KICK | ROMTYPE_SPECIALKICK, 0, 0, NULL, + { _T("The Diagnostic 2.0 (Logica)"), 2, 0, 2, 0, _T("LOGICA\0"), 524288, 72, 0, 0, ROMTYPE_KICK | ROMTYPE_SPECIALKICK, 0, 0, NULL, 0x8484f426, 0xba10d161,0x66b2e2d6,0x177c979c,0x99edf846,0x2b21651e }, - { L"Freezer: Action Replay Mk I v1.00", 1, 0, 1, 0, L"AR\0", 65536, 52, 0, 0, ROMTYPE_AR, 0, 1, NULL, + { _T("Freezer: Action Replay Mk I v1.00"), 1, 0, 1, 0, _T("AR\0"), 65536, 52, 0, 0, ROMTYPE_AR, 0, 1, NULL, 0x2d921771, 0x1EAD9DDA,0x2DAD2914,0x6441F5EF,0x72183750,0x22E01248 }, ALTROM(52, 1, 1, 32768, ROMTYPE_EVEN | ROMTYPE_8BIT, 0x82d6eb87, 0x7c9bac11,0x28666017,0xeee6f019,0x63fb3890,0x7fbea355) ALTROM(52, 1, 2, 32768, ROMTYPE_ODD | ROMTYPE_8BIT, 0x40ae490c, 0x81d8e432,0x01b73fd9,0x2e204ebd,0x68af8602,0xb62ce397) - { L"Freezer: Action Replay Mk I v1.50", 1, 50, 1, 50, L"AR\0", 65536, 25, 0, 0, ROMTYPE_AR, 0, 1, NULL, + { _T("Freezer: Action Replay Mk I v1.50"), 1, 50, 1, 50, _T("AR\0"), 65536, 25, 0, 0, ROMTYPE_AR, 0, 1, NULL, 0xd4ce0675, 0x843B433B,0x2C56640E,0x045D5FDC,0x854DC6B1,0xA4964E7C }, ALTROM(25, 1, 1, 32768, ROMTYPE_EVEN | ROMTYPE_8BIT, 0x7fbd6de2, 0xb5f71a5c,0x09d65ecc,0xa8a3bc93,0x93558461,0xca190228) ALTROM(25, 1, 2, 32768, ROMTYPE_ODD | ROMTYPE_8BIT, 0x43018069, 0xad8ff242,0xb2cbf125,0x1fc53a73,0x581cf57a,0xb69cee00) - { L"Freezer: Action Replay Mk II v2.05", 2, 5, 2, 5, L"AR\0", 131072, 26, 0, 0, ROMTYPE_AR, 0, 1, NULL, + { _T("Freezer: Action Replay Mk II v2.05"), 2, 5, 2, 5, _T("AR\0"), 131072, 26, 0, 0, ROMTYPE_AR, 0, 1, NULL, 0x1287301f, 0xF6601DE8,0x888F0050,0x72BF562B,0x9F533BBC,0xAF1B0074 }, - { L"Freezer: Action Replay Mk II v2.12", 2, 12, 2, 12, L"AR\0", 131072, 27, 0, 0, ROMTYPE_AR, 0, 1, NULL, + { _T("Freezer: Action Replay Mk II v2.12"), 2, 12, 2, 12, _T("AR\0"), 131072, 27, 0, 0, ROMTYPE_AR, 0, 1, NULL, 0x804d0361, 0x3194A07A,0x0A82D8B5,0xF2B6AEFA,0x3CA581D6,0x8BA8762B }, - { L"Freezer: Action Replay Mk II v2.14", 2, 14, 2, 14, L"AR\0", 131072, 28, 0, 0, ROMTYPE_AR, 0, 1, NULL, + { _T("Freezer: Action Replay Mk II v2.14"), 2, 14, 2, 14, _T("AR\0"), 131072, 28, 0, 0, ROMTYPE_AR, 0, 1, NULL, 0x49650e4f, 0x255D6DF6,0x3A4EAB0A,0x838EB1A1,0x6A267B09,0x59DFF634 }, - { L"Freezer: Action Replay Mk III v3.09", 3, 9, 3, 9, L"AR\0", 262144, 29, 0, 0, ROMTYPE_AR, 0, 1, NULL, + { _T("Freezer: Action Replay Mk III v3.09"), 3, 9, 3, 9, _T("AR\0"), 262144, 29, 0, 0, ROMTYPE_AR, 0, 1, NULL, 0x0ed9b5aa, 0x0FF3170A,0xBBF0CA64,0xC9DD93D6,0xEC0C7A01,0xB5436824 }, ALTROM(29, 1, 1, 131072, ROMTYPE_EVEN | ROMTYPE_8BIT, 0x2b84519f, 0x7841873b,0xf009d834,0x1dfa2794,0xb3751bac,0xf86adcc8) ALTROM(29, 1, 2, 131072, ROMTYPE_ODD | ROMTYPE_8BIT, 0x1d35bd56, 0x6464be16,0x26b51949,0x9e76e4e3,0x409e8016,0x515d48b6) - { L"Freezer: Action Replay Mk III v3.17", 3, 17, 3, 17, L"AR\0", 262144, 30, 0, 0, ROMTYPE_AR, 0, 1, NULL, + { _T("Freezer: Action Replay Mk III v3.17"), 3, 17, 3, 17, _T("AR\0"), 262144, 30, 0, 0, ROMTYPE_AR, 0, 1, NULL, 0xc8a16406, 0x5D4987C2,0xE3FFEA8B,0x1B02E314,0x30EF190F,0x2DB76542 }, - { L"Freezer: Action Replay 1200", 0, 0, 0, 0, L"AR\0", 262144, 47, 0, 0, ROMTYPE_AR, 0, 1, NULL, + { _T("Freezer: Action Replay 1200"), 0, 0, 0, 0, _T("AR\0"), 262144, 47, 0, 0, ROMTYPE_AR, 0, 1, NULL, 0x8d760101, 0x0F6AB834,0x2810094A,0xC0642F62,0xBA42F78B,0xC0B07E6A }, - { L"Freezer: Action Cartridge Super IV Professional", 0, 0, 0, 0, L"SUPERIV\0", 0, 62, 0, 0, ROMTYPE_SUPERIV, 0, 1, NULL, - 0xffffffff, 0, 0, 0, 0, 0, L"SuperIV" }, - { L"Freezer: Action Cart. Super IV Pro (+ROM v4.3)", 4, 3, 4, 3, L"SUPERIV\0", 170368, 60, 0, 0, ROMTYPE_SUPERIV, 0, 1, NULL, + { _T("Freezer: Action Cartridge Super IV Professional"), 0, 0, 0, 0, _T("SUPERIV\0"), 0, 62, 0, 0, ROMTYPE_SUPERIV, 0, 1, NULL, + 0xffffffff, 0, 0, 0, 0, 0, _T("SuperIV") }, + { _T("Freezer: Action Cart. Super IV Pro (+ROM v4.3)"), 4, 3, 4, 3, _T("SUPERIV\0"), 170368, 60, 0, 0, ROMTYPE_SUPERIV, 0, 1, NULL, 0xe668a0be, 0x633A6E65,0xA93580B8,0xDDB0BE9C,0x9A64D4A1,0x7D4B4801 }, - { L"Freezer: X-Power Professional 500 v1.2", 1, 2, 1, 2, L"XPOWER\0", 131072, 65, 0, 0, ROMTYPE_XPOWER, 0, 1, NULL, + { _T("Freezer: X-Power Professional 500 v1.2"), 1, 2, 1, 2, _T("XPOWER\0"), 131072, 65, 0, 0, ROMTYPE_XPOWER, 0, 1, NULL, 0x9e70c231, 0xa2977a1c,0x41a8ca7d,0x4af4a168,0x726da542,0x179d5963 }, ALTROM(65, 1, 1, 65536, ROMTYPE_EVEN|ROMTYPE_SCRAMBLED|ROMTYPE_8BIT, 0xf98742e4,0xe8e683ba,0xd8b38d1f,0x79f3ad83,0xa9e67c6f,0xa91dc96c) ALTROM(65, 1, 2, 65536, ROMTYPE_ODD |ROMTYPE_SCRAMBLED|ROMTYPE_8BIT, 0xdfb9984b,0x8d6bdd49,0x469ec8e2,0x0143fbb3,0x72e92500,0x99f07910) - { L"Freezer: X-Power Professional 500 v1.3", 1, 2, 1, 2, L"XPOWER\0", 131072, 68, 0, 0, ROMTYPE_XPOWER, 0, 1, NULL, + { _T("Freezer: X-Power Professional 500 v1.3"), 1, 2, 1, 2, _T("XPOWER\0"), 131072, 68, 0, 0, ROMTYPE_XPOWER, 0, 1, NULL, 0x31e057f0, 0x84650266,0x465d1859,0x7fd71dee,0x00775930,0xb7e450ee }, ALTROM(68, 1, 1, 65536, ROMTYPE_EVEN|ROMTYPE_SCRAMBLED|ROMTYPE_8BIT, 0x0b2ce0c7,0x45ad5456,0x89192404,0x956f47ce,0xf66a5274,0x57ace33b) ALTROM(68, 1, 2, 65536, ROMTYPE_ODD |ROMTYPE_SCRAMBLED|ROMTYPE_8BIT, 0x34580c35,0x8ad42566,0x7364f238,0x978f4381,0x08f8d5ec,0x470e72ea) - { L"Freezer: Nordic Power v1.5", 1, 5, 1, 5, L"NPOWER\0", 65536, 69, 0, 0, ROMTYPE_NORDIC, 0, 1, NULL, + { _T("Freezer: Nordic Power v1.5"), 1, 5, 1, 5, _T("NPOWER\0"), 65536, 69, 0, 0, ROMTYPE_NORDIC, 0, 1, NULL, 0x83b4b21c, 0xc56ced25,0x506a5aab,0x3fa13813,0x4fc9e5ae,0x0f9d3709 }, ALTROM(69, 1, 1, 32768, ROMTYPE_EVEN|ROMTYPE_SCRAMBLED|ROMTYPE_8BIT, 0xdd207174,0xae67652d,0x64f5db20,0x0f4b2110,0xee59567f,0xfbd90a1b) ALTROM(69, 1, 2, 32768, ROMTYPE_ODD |ROMTYPE_SCRAMBLED|ROMTYPE_8BIT, 0x8f93d85d,0x73c62d21,0x40c0c092,0x6315b702,0xdd5d0f05,0x3dad7fab) - { L"Freezer: Nordic Power v2.0", 2, 0, 2, 0, L"NPOWER\0", 65536, 67, 0, 0, ROMTYPE_NORDIC, 0, 1, NULL, + { _T("Freezer: Nordic Power v2.0"), 2, 0, 2, 0, _T("NPOWER\0"), 65536, 67, 0, 0, ROMTYPE_NORDIC, 0, 1, NULL, 0xa4db2906, 0x0aec68f7,0x25470c89,0x6b699ff4,0x6623dec5,0xc777466e }, ALTROM(67, 1, 1, 32768, ROMTYPE_EVEN|ROMTYPE_SCRAMBLED|ROMTYPE_8BIT, 0xb21be46c,0x50dc607c,0xce976bbd,0x3841eaf0,0x591ddc7e,0xa1939ad2) ALTROM(67, 1, 2, 32768, ROMTYPE_ODD |ROMTYPE_SCRAMBLED|ROMTYPE_8BIT, 0x96057aed,0xdd9209e2,0x1d5edfc1,0xcdb52abe,0x93de0f35,0xc43da696) - { L"Freezer: Nordic Power v3.0", 3, 0, 3, 0, L"NPOWER\0", 65536, 70, 0, 0, ROMTYPE_NORDIC, 0, 1, NULL, + { _T("Freezer: Nordic Power v3.0"), 3, 0, 3, 0, _T("NPOWER\0"), 65536, 70, 0, 0, ROMTYPE_NORDIC, 0, 1, NULL, 0x72850aef, 0x59c91d1f,0xa8f118f9,0x0bdba05a,0x9ae788d7,0x7a6cc7c9 }, ALTROM(70, 1, 1, 32768, ROMTYPE_EVEN|ROMTYPE_SCRAMBLED|ROMTYPE_8BIT, 0xf3330e1f,0x3a597db2,0xb7d11b6c,0xb8e13496,0xc215f223,0x88c4ca3c) ALTROM(70, 1, 2, 32768, ROMTYPE_EVEN|ROMTYPE_SCRAMBLED|ROMTYPE_8BIT, 0xee58e0f9,0x4148f4cb,0xb42cec33,0x8ca144de,0xd4f54118,0xe0f185dd) - { L"Freezer: HRTMon v2.33 (built-in)", 0, 0, 0, 0, L"HRTMON\0", 0, 63, 0, 0, ROMTYPE_HRTMON, 0, 1, NULL, - 0xffffffff, 0, 0, 0, 0, 0, L"HRTMon" }, + { _T("Freezer: HRTMon v2.33 (built-in)"), 0, 0, 0, 0, _T("HRTMON\0"), 0, 63, 0, 0, ROMTYPE_HRTMON, 0, 1, NULL, + 0xffffffff, 0, 0, 0, 0, 0, _T("HRTMon") }, - { L"A590/A2091 SCSI boot ROM", 6, 0, 6, 0, L"A590\0A2091\0", 16384, 53, 0, 0, ROMTYPE_A2091BOOT, 0, 0, NULL, + { _T("A590/A2091 SCSI boot ROM"), 6, 0, 6, 0, _T("A590\0A2091\0"), 16384, 53, 0, 0, ROMTYPE_A2091BOOT, 0, 0, NULL, 0x8396cf4e, 0x5E03BC61,0x8C862ABE,0x7BF79723,0xB4EEF4D2,0x1859A0F2 }, - ALTROMPN(53, 1, 1, 8192, ROMTYPE_ODD | ROMTYPE_8BIT, L"390389-03", 0xb0b8cf24,0xfcf40175,0x05f4d441,0x814b45d5,0x59c19eab,0x43816b30) - ALTROMPN(53, 1, 2, 8192, ROMTYPE_EVEN | ROMTYPE_8BIT, L"390388-03", 0x2e77bbff,0x8a098845,0x068f32cf,0xa4d34a27,0x8cd290f6,0x1d35a52c) - { L"A590/A2091 SCSI boot ROM", 6, 6, 6, 6, L"A590\0A2091\0", 16384, 54, 0, 0, ROMTYPE_A2091BOOT, 0, 0, NULL, + ALTROMPN(53, 1, 1, 8192, ROMTYPE_ODD | ROMTYPE_8BIT, _T("390389-03"), 0xb0b8cf24,0xfcf40175,0x05f4d441,0x814b45d5,0x59c19eab,0x43816b30) + ALTROMPN(53, 1, 2, 8192, ROMTYPE_EVEN | ROMTYPE_8BIT, _T("390388-03"), 0x2e77bbff,0x8a098845,0x068f32cf,0xa4d34a27,0x8cd290f6,0x1d35a52c) + { _T("A590/A2091 SCSI boot ROM"), 6, 6, 6, 6, _T("A590\0A2091\0"), 16384, 54, 0, 0, ROMTYPE_A2091BOOT, 0, 0, NULL, 0x33e00a7a, 0x739BB828,0xE874F064,0x9360F59D,0x26B5ED3F,0xBC99BB66 }, - ALTROMPN(54, 1, 1, 8192, ROMTYPE_ODD | ROMTYPE_8BIT, L"390722-02", 0xe536bbb2,0xfd7f8a6d,0xa18c1b02,0xd07eb990,0xc2467a24,0x183ede12) - ALTROMPN(54, 1, 2, 8192, ROMTYPE_EVEN | ROMTYPE_8BIT, L"390721-02", 0xc0871d25,0xe155f18a,0xbb90cf82,0x0589c15e,0x70559d3b,0x6b391af8) - { L"A590/A2091 SCSI boot ROM", 7, 0, 7, 0, L"A590\0A2091\0", 16384, 55, 0, 0, ROMTYPE_A2091BOOT, 0, 0, NULL, + ALTROMPN(54, 1, 1, 8192, ROMTYPE_ODD | ROMTYPE_8BIT, _T("390722-02"), 0xe536bbb2,0xfd7f8a6d,0xa18c1b02,0xd07eb990,0xc2467a24,0x183ede12) + ALTROMPN(54, 1, 2, 8192, ROMTYPE_EVEN | ROMTYPE_8BIT, _T("390721-02"), 0xc0871d25,0xe155f18a,0xbb90cf82,0x0589c15e,0x70559d3b,0x6b391af8) + { _T("A590/A2091 SCSI boot ROM"), 7, 0, 7, 0, _T("A590\0A2091\0"), 16384, 55, 0, 0, ROMTYPE_A2091BOOT, 0, 0, NULL, 0x714a97a2, 0xE50F01BA,0xF2899892,0x85547863,0x72A82C33,0x3C91276E }, - ALTROMPN(55, 1, 1, 8192, ROMTYPE_ODD | ROMTYPE_8BIT, L"390722-03", 0xa9ccffed,0x149f5bd5,0x2e2d2990,0x4e3de483,0xb9ad7724,0x48e9278e) - ALTROMPN(55, 1, 2, 8192, ROMTYPE_EVEN | ROMTYPE_8BIT, L"390721-03", 0x2942747a,0xdbd7648e,0x79c75333,0x7ff3e4f4,0x91de224b,0xf05e6bb6) - { L"A590/A2091 SCSI Guru boot ROM", 6, 14, 6, 14, L"A590\0A2091\0", 32768, 56, 0, 0, ROMTYPE_A2091BOOT, 0, 0, NULL, + ALTROMPN(55, 1, 1, 8192, ROMTYPE_ODD | ROMTYPE_8BIT, _T("390722-03"), 0xa9ccffed,0x149f5bd5,0x2e2d2990,0x4e3de483,0xb9ad7724,0x48e9278e) + ALTROMPN(55, 1, 2, 8192, ROMTYPE_EVEN | ROMTYPE_8BIT, _T("390721-03"), 0x2942747a,0xdbd7648e,0x79c75333,0x7ff3e4f4,0x91de224b,0xf05e6bb6) + { _T("A590/A2091 SCSI Guru boot ROM"), 6, 14, 6, 14, _T("A590\0A2091\0"), 32768, 56, 0, 0, ROMTYPE_A2091BOOT, 0, 0, NULL, 0x04e52f93, 0x6DA21B6F,0x5E8F8837,0xD64507CD,0x8A4D5CDC,0xAC4F426B }, - { L"A4091 SCSI boot ROM", 40, 9, 40, 9, L"A4091\0", 32768, 57, 0, 0, ROMTYPE_A4091BOOT, 0, 0, NULL, + { _T("A4091 SCSI boot ROM"), 40, 9, 40, 9, _T("A4091\0"), 32768, 57, 0, 0, ROMTYPE_A4091BOOT, 0, 0, NULL, 0x00000000, 0, 0, 0, 0, 0 }, - { L"A4091 SCSI boot ROM", 40, 13, 40, 13, L"A4091\0", 32768, 58, 0, 0, ROMTYPE_A4091BOOT, 0, 0, L"391592-02", + { _T("A4091 SCSI boot ROM"), 40, 13, 40, 13, _T("A4091\0"), 32768, 58, 0, 0, ROMTYPE_A4091BOOT, 0, 0, _T("391592-02"), 0x54cb9e85, 0x3CE66919,0xF6FD6797,0x4923A12D,0x91B730F1,0xFFB4A7BA }, - { L"Arcadia OnePlay 2.11", 0, 0, 0, 0, L"ARCADIA\0", 0, 49, 0, 0, ROMTYPE_ARCADIABIOS, 0, 0 }, - { L"Arcadia TenPlay 2.11", 0, 0, 0, 0, L"ARCADIA\0", 0, 50, 0, 0, ROMTYPE_ARCADIABIOS, 0, 0 }, - { L"Arcadia OnePlay 3.00", 0, 0, 0, 0, L"ARCADIA\0", 0, 51, 0, 0, ROMTYPE_ARCADIABIOS, 0, 0 }, - - { L"Arcadia SportTime Table Hockey", 0, 0, 0, 0, L"ARCADIA\0", 0, 33, 0, 0, ROMTYPE_ARCADIAGAME, 0, 2 }, - { L"Arcadia SportTime Bowling", 0, 0, 0, 0, L"ARCADIA\0", 0, 34, 0, 0, ROMTYPE_ARCADIAGAME, 0, 2 }, - { L"Arcadia World Darts", 0, 0, 0, 0, L"ARCADIA\0", 0, 35, 0, 0, ROMTYPE_ARCADIAGAME, 0, 2 }, - { L"Arcadia Magic Johnson's Fast Break", 0, 0, 0, 0, L"ARCADIA\0", 0, 36, 0, 0, ROMTYPE_ARCADIAGAME, 0, 2 }, - { L"Arcadia Leader Board Golf", 0, 0, 0, 0, L"ARCADIA\0", 0, 37, 0, 0, ROMTYPE_ARCADIAGAME, 0, 2 }, - { L"Arcadia Leader Board Golf (alt)", 0, 0, 0, 0, L"ARCADIA\0", 0, 38, 0, 0, ROMTYPE_ARCADIAGAME, 0, 2 }, - { L"Arcadia Ninja Mission", 0, 0, 0, 0, L"ARCADIA\0", 0, 39, 0, 0, ROMTYPE_ARCADIAGAME, 0, 2 }, - { L"Arcadia Road Wars", 0, 0, 0, 0, L"ARCADIA\0", 0, 40, 0, 0, ROMTYPE_ARCADIAGAME, 0, 2 }, - { L"Arcadia Sidewinder", 0, 0, 0, 0, L"ARCADIA\0", 0, 41, 0, 0, ROMTYPE_ARCADIAGAME, 0, 2 }, - { L"Arcadia Spot", 0, 0, 0, 0, L"ARCADIA\0", 0, 42, 0, 0, ROMTYPE_ARCADIAGAME, 0, 2 }, - { L"Arcadia Space Ranger", 0, 0, 0, 0, L"ARCADIA\0", 0, 43, 0, 0, ROMTYPE_ARCADIAGAME, 0, 2 }, - { L"Arcadia Xenon", 0, 0, 0, 0, L"ARCADIA\0", 0, 44, 0, 0, ROMTYPE_ARCADIAGAME, 0, 2 }, - { L"Arcadia World Trophy Soccer", 0, 0, 0, 0, L"ARCADIA\0", 0, 45, 0, 0, ROMTYPE_ARCADIAGAME, 0, 2 }, + { _T("Arcadia OnePlay 2.11"), 0, 0, 0, 0, _T("ARCADIA\0"), 0, 49, 0, 0, ROMTYPE_ARCADIABIOS, 0, 0 }, + { _T("Arcadia TenPlay 2.11"), 0, 0, 0, 0, _T("ARCADIA\0"), 0, 50, 0, 0, ROMTYPE_ARCADIABIOS, 0, 0 }, + { _T("Arcadia OnePlay 3.00"), 0, 0, 0, 0, _T("ARCADIA\0"), 0, 51, 0, 0, ROMTYPE_ARCADIABIOS, 0, 0 }, + + { _T("Arcadia SportTime Table Hockey"), 0, 0, 0, 0, _T("ARCADIA\0"), 0, 33, 0, 0, ROMTYPE_ARCADIAGAME, 0, 2 }, + { _T("Arcadia SportTime Bowling"), 0, 0, 0, 0, _T("ARCADIA\0"), 0, 34, 0, 0, ROMTYPE_ARCADIAGAME, 0, 2 }, + { _T("Arcadia World Darts"), 0, 0, 0, 0, _T("ARCADIA\0"), 0, 35, 0, 0, ROMTYPE_ARCADIAGAME, 0, 2 }, + { _T("Arcadia Magic Johnson's Fast Break"), 0, 0, 0, 0, _T("ARCADIA\0"), 0, 36, 0, 0, ROMTYPE_ARCADIAGAME, 0, 2 }, + { _T("Arcadia Leader Board Golf"), 0, 0, 0, 0, _T("ARCADIA\0"), 0, 37, 0, 0, ROMTYPE_ARCADIAGAME, 0, 2 }, + { _T("Arcadia Leader Board Golf (alt)"), 0, 0, 0, 0, _T("ARCADIA\0"), 0, 38, 0, 0, ROMTYPE_ARCADIAGAME, 0, 2 }, + { _T("Arcadia Ninja Mission"), 0, 0, 0, 0, _T("ARCADIA\0"), 0, 39, 0, 0, ROMTYPE_ARCADIAGAME, 0, 2 }, + { _T("Arcadia Road Wars"), 0, 0, 0, 0, _T("ARCADIA\0"), 0, 40, 0, 0, ROMTYPE_ARCADIAGAME, 0, 2 }, + { _T("Arcadia Sidewinder"), 0, 0, 0, 0, _T("ARCADIA\0"), 0, 41, 0, 0, ROMTYPE_ARCADIAGAME, 0, 2 }, + { _T("Arcadia Spot"), 0, 0, 0, 0, _T("ARCADIA\0"), 0, 42, 0, 0, ROMTYPE_ARCADIAGAME, 0, 2 }, + { _T("Arcadia Space Ranger"), 0, 0, 0, 0, _T("ARCADIA\0"), 0, 43, 0, 0, ROMTYPE_ARCADIAGAME, 0, 2 }, + { _T("Arcadia Xenon"), 0, 0, 0, 0, _T("ARCADIA\0"), 0, 44, 0, 0, ROMTYPE_ARCADIAGAME, 0, 2 }, + { _T("Arcadia World Trophy Soccer"), 0, 0, 0, 0, _T("ARCADIA\0"), 0, 45, 0, 0, ROMTYPE_ARCADIAGAME, 0, 2 }, { NULL } @@ -330,11 +330,11 @@ void romlist_clear (void) if (rd->partnumber && !pn) { TCHAR *newpn; if (parent->partnumber == NULL) - parent->partnumber = my_strdup (L""); + parent->partnumber = my_strdup (_T("")); newpn = xcalloc (TCHAR, _tcslen (parent->partnumber) + 1 + _tcslen (rd->partnumber) + 1); if (_tcslen (parent->partnumber) > 0) { _tcscpy (newpn, parent->partnumber); - _tcscat (newpn, L"/"); + _tcscat (newpn, _T("/")); } _tcscat (newpn, rd->partnumber); xfree (parent->partnumber); @@ -366,7 +366,7 @@ static void romlist_cleanup (void) struct romlist *rl2 = romlist_getrl (&roms[i]); if (rl2) { int cnt = romlist_cnt - (rl2 - rl) - 1; - write_log (L"%s '%s' removed from romlist\n", roms[k].name, rl2->path); + write_log (_T("%s '%s' removed from romlist\n"), roms[k].name, rl2->path); xfree (rl2->path); if (cnt > 0) memmove (rl2, rl2 + 1, cnt * sizeof (struct romlist)); @@ -379,7 +379,7 @@ static void romlist_cleanup (void) } for (i = 0; i < romlist_cnt; i++) { struct romlist *rll = &rl[i]; - //write_log (L"%s (%s)\n", rll->rd->name, rll->path); + //write_log (_T("%s (%s)\n"), rll->rd->name, rll->path); } } @@ -534,7 +534,7 @@ static void addkey (uae_u8 *key, int size, const TCHAR *name) { int i; - //write_log (L"addkey(%08x,%d,'%s')\n", key, size, name); + //write_log (_T("addkey(%08x,%d,'%s')\n"), key, size, name); if (key == NULL || size == 0) { xfree (key); return; @@ -542,7 +542,7 @@ static void addkey (uae_u8 *key, int size, const TCHAR *name) for (i = 0; i < ROM_KEY_NUM; i++) { if (keyring[i].key && keyring[i].size == size && !memcmp (keyring[i].key, key, size)) { xfree (key); - //write_log (L"key already in keyring\n"); + //write_log (_T("key already in keyring\n")); return; } } @@ -552,12 +552,12 @@ static void addkey (uae_u8 *key, int size, const TCHAR *name) } if (i == ROM_KEY_NUM) { xfree (key); - //write_log (L"keyring full\n"); + //write_log (_T("keyring full\n")); return; } keyring[i].key = key; keyring[i].size = size; - write_log (L"ROM KEY '%s' %d bytes loaded\n", name, size); + write_log (_T("ROM KEY '%s' %d bytes loaded\n"), name, size); } void addkeyfile (const TCHAR *path) @@ -566,7 +566,7 @@ void addkeyfile (const TCHAR *path) int keysize; uae_u8 *keybuf; - f = zfile_fopen (path, L"rb", ZFD_NORMAL); + f = zfile_fopen (path, _T("rb"), ZFD_NORMAL); if (!f) return; zfile_fseek (f, 0, SEEK_END); @@ -593,8 +593,8 @@ void addkeydir (const TCHAR *path) } tmp[i] = 0; } - _tcscat (tmp, L"/"); - _tcscat (tmp, L"rom.key"); + _tcscat (tmp, _T("/")); + _tcscat (tmp, _T("rom.key")); addkeyfile (tmp); } @@ -641,23 +641,23 @@ int load_keyring (struct uae_prefs *p, const TCHAR *path) _tcscpy (tmp, path); break; case 1: - _tcscat (tmp, L"rom.key"); + _tcscat (tmp, _T("rom.key")); break; case 2: if (p) { _tcscpy (tmp, p->path_rom.path[0]); - _tcscat (tmp, L"rom.key"); + _tcscat (tmp, _T("rom.key")); } break; case 3: - _tcscpy (tmp, L"roms/rom.key"); + _tcscpy (tmp, _T("roms/rom.key")); break; case 4: _tcscpy (tmp, start_path_data); - _tcscat (tmp, L"rom.key"); + _tcscat (tmp, _T("rom.key")); break; case 5: - _stprintf (tmp, L"%s../shared/rom/rom.key", start_path_data); + _stprintf (tmp, _T("%s../shared/rom/rom.key"), start_path_data); break; case 6: if (p) { @@ -671,7 +671,7 @@ int load_keyring (struct uae_prefs *p, const TCHAR *path) if (!d) d = _tcsrchr (tmp, '\\'); if (d) - _tcscpy (d + 1, L"rom.key"); + _tcscpy (d + 1, _T("rom.key")); } } break; @@ -929,11 +929,11 @@ void getromname (const struct romdata *rd, TCHAR *name) rd--; _tcscat (name, rd->name); if ((rd->subrev || rd->subver) && rd->subver != rd->ver) - _stprintf (name + _tcslen (name), L" rev %d.%d", rd->subver, rd->subrev); + _stprintf (name + _tcslen (name), _T(" rev %d.%d"), rd->subver, rd->subrev); if (rd->size > 0) - _stprintf (name + _tcslen (name), L" (%dk)", (rd->size + 1023) / 1024); + _stprintf (name + _tcslen (name), _T(" (%dk)"), (rd->size + 1023) / 1024); if (rd->partnumber && _tcslen (rd->partnumber) > 0) - _stprintf (name + _tcslen (name), L" [%s]", rd->partnumber); + _stprintf (name + _tcslen (name), _T(" [%s]"), rd->partnumber); } struct romlist *getromlistbyromdata (const struct romdata *rd) @@ -976,9 +976,9 @@ void romwarning (const int *ids) while (ids[i] >= 0) { struct romdata *rd = getromdatabyid (ids[i]); getromname (rd, tmp1); - _tcscat (tmp2, L"- "); + _tcscat (tmp2, _T("- ")); _tcscat (tmp2, tmp1); - _tcscat (tmp2, L"\n"); + _tcscat (tmp2, _T("\n")); if (rd->type & (ROMTYPE_A2091BOOT | ROMTYPE_A4091BOOT)) exp++; i++; @@ -1049,7 +1049,7 @@ static int read_rom_file (uae_u8 *buf, const struct romdata *rd) if (!rl || _tcslen (rl->path) == 0) return 0; - zf = zfile_fopen (rl->path, L"rb", ZFD_NORMAL); + zf = zfile_fopen (rl->path, _T("rb"), ZFD_NORMAL); if (!zf) return 0; addkeydir (rl->path); @@ -1189,9 +1189,9 @@ struct zfile *read_rom (struct romdata **prd) struct zfile *rom_fopen (const TCHAR *name, const TCHAR *mode, int mask) { struct zfile *f; - //write_log (L"attempting to load '%s'\n", name); + //write_log (_T("attempting to load '%s'\n"), name); f = zfile_fopen (name, mode, mask); - //write_log (L"=%p\n", f); + //write_log (_T("=%p\n"), f); return f; } @@ -1208,7 +1208,7 @@ struct zfile *read_rom_name (const TCHAR *filename) return f; } } - f = rom_fopen (filename, L"rb", ZFD_NORMAL); + f = rom_fopen (filename, _T("rb"), ZFD_NORMAL); if (f) { uae_u8 tmp[11]; zfile_fread (tmp, sizeof tmp, 1, f); @@ -1222,7 +1222,7 @@ struct zfile *read_rom_name (const TCHAR *filename) zfile_fseek (f, sizeof tmp, SEEK_SET); buf = xmalloc (uae_u8, size); zfile_fread (buf, size, 1, f); - df = zfile_fopen_empty (f, L"tmp.rom", size); + df = zfile_fopen_empty (f, _T("tmp.rom"), size); decode_cloanto_rom_do (buf, size, size); zfile_fwrite (buf, size, 1, df); zfile_fclose (f); @@ -1262,7 +1262,7 @@ struct zfile *read_rom_name_guess (const TCHAR *filename) struct romdata *rd = rl[i].rd; f = read_rom (&rd); if (f) { - write_log (L"ROM %s not found, using %s\n", filename, rl[i].path); + write_log (_T("ROM %s not found, using %s\n"), filename, rl[i].path); return f; } } diff --git a/sampler.cpp b/sampler.cpp index 9f7bc24d..99144d32 100644 --- a/sampler.cpp +++ b/sampler.cpp @@ -51,7 +51,7 @@ static int capture_init (void) hr = DirectSoundCaptureCreate (&record_devices[currprefs.win32_samplersoundcard]->guid, &lpDS2r, NULL); if (FAILED (hr)) { - write_log (L"SAMPLER: DirectSoundCaptureCreate() failure: %s\n", DXError (hr)); + write_log (_T("SAMPLER: DirectSoundCaptureCreate() failure: %s\n"), DXError (hr)); return 0; } memset (&sound_buffer_rec, 0, sizeof (DSCBUFFERDESC)); @@ -62,17 +62,17 @@ static int capture_init (void) hr = lpDS2r->CreateCaptureBuffer (&sound_buffer_rec, &lpDSB2r, NULL); if (FAILED (hr)) { - write_log (L"SAMPLER: CreateCaptureSoundBuffer() failure: %s\n", DXError(hr)); + write_log (_T("SAMPLER: CreateCaptureSoundBuffer() failure: %s\n"), DXError(hr)); return 0; } hr = lpDSB2r->Start (DSCBSTART_LOOPING); if (FAILED (hr)) { - write_log (L"SAMPLER: DirectSoundCaptureBuffer_Start failed: %s\n", DXError (hr)); + write_log (_T("SAMPLER: DirectSoundCaptureBuffer_Start failed: %s\n"), DXError (hr)); return 0; } samplebuffer = xcalloc (uae_u8, SAMPLEBUFFER * SAMPLESIZE); - write_log (L"SAMPLER: Parallel port sampler initialized\n"); + write_log (_T("SAMPLER: Parallel port sampler initialized\n")); return 1; } @@ -81,7 +81,7 @@ static void capture_free (void) if (lpDSB2r) { lpDSB2r->Stop (); lpDSB2r->Release (); - write_log (L"SAMPLER: Parallel port sampler freed\n"); + write_log (_T("SAMPLER: Parallel port sampler freed\n")); } lpDSB2r = NULL; if (lpDS2r) @@ -180,7 +180,7 @@ uae_u8 sampler_getsample (int channel) if (diff2 < 0) diffsample = -diffsample; #endif -// write_log (L"%d:%.1f\n", diff, diffsample); +// write_log (_T("%d:%.1f\n"), diff, diffsample); cap_pos += SAMPLEBUFFER * SAMPLESIZE; if (cap_pos < 0) diff --git a/sana2.cpp b/sana2.cpp index ec23edf8..47c11fa9 100644 --- a/sana2.cpp +++ b/sana2.cpp @@ -28,7 +28,7 @@ #include "win32_uaenet.h" #include "execio.h" -#define SANA2NAME L"uaenet.device" +#define SANA2NAME _T("uaenet.device") #define MAX_ASYNC_REQUESTS 200 #define MAX_OPEN_DEVICES 20 @@ -151,7 +151,7 @@ static uaecptr ROM_netdev_resname = 0, static TCHAR *getdevname (void) { - return L"uaenet.device"; + return _T("uaenet.device"); } struct asyncreq { @@ -240,7 +240,7 @@ static struct priv_s2devstruct *getps2devstruct (uaecptr request) { int i = get_long (request + 24); if (i < 0 || i >= MAX_OPEN_DEVICES || pdevst[i].inuse == 0) { - write_log (L"%s: corrupt iorequest %08X %d\n", SANA2NAME, request, i); + write_log (_T("%s: corrupt iorequest %08X %d\n"), SANA2NAME, request, i); return 0; } return &pdevst[i]; @@ -265,16 +265,16 @@ static uae_u32 REGPARAM2 dev_close_2 (TrapContext *context) struct s2devstruct *dev; if (!pdev) { - write_log (L"%s close with unknown request %08X!?\n", SANA2NAME, request); + write_log (_T("%s close with unknown request %08X!?\n"), SANA2NAME, request); return 0; } dev = gets2devstruct (pdev->unit); if (!dev) { - write_log (L"%s:%d close with unknown request %08X!?\n", SANA2NAME, pdev->unit, request); + write_log (_T("%s:%d close with unknown request %08X!?\n"), SANA2NAME, pdev->unit, request); return 0; } if (log_net) - write_log (L"%s:%d close, open=%d req=%08X\n", SANA2NAME, pdev->unit, dev->opencnt, request); + write_log (_T("%s:%d close, open=%d req=%08X\n"), SANA2NAME, pdev->unit, dev->opencnt, request); put_long (request + 24, 0); dev->opencnt--; pdev->inuse = 0; @@ -290,7 +290,7 @@ static uae_u32 REGPARAM2 dev_close_2 (TrapContext *context) xfree (dev->sysdata); dev->sysdata = NULL; write_comm_pipe_u32 (&dev->requests, 0, 1); - write_log (L"%s: opencnt == 0, all instances closed\n", SANA2NAME); + write_log (_T("%s: opencnt == 0, all instances closed\n"), SANA2NAME); } put_word (m68k_areg (regs, 6) + 32, get_word (m68k_areg (regs, 6) + 32) - 1); return 0; @@ -311,7 +311,7 @@ static int openfail (uaecptr ioreq, int error) put_byte (ioreq + 31, error); put_long (ioreq + 32, 0); /* io_device */ if (log_net) - write_log (L"-> failed with error %d\n", error); + write_log (_T("-> failed with error %d\n"), error); return (uae_u32)-1; } @@ -330,7 +330,7 @@ static int initint (TrapContext *ctx) if (!p) return 0; tmp1 = here (); - calltrap (deftrap2 (uaenet_int_handler, TRAPFLAG_EXTRA_STACK, L"uaenet_int_handler")); + calltrap (deftrap2 (uaenet_int_handler, TRAPFLAG_EXTRA_STACK, _T("uaenet_int_handler"))); put_word (p + 8, 0x020a); put_long (p + 10, ROM_netdev_resid); put_long (p + 18, tmp1); @@ -359,7 +359,7 @@ static uae_u32 REGPARAM2 dev_open_2 (TrapContext *context) if (!initint(context)) return openfail (ioreq, IOERR_SELFTEST); if (log_net) - write_log (L"opening %s:%d opencnt=%d ioreq=%08X\n", SANA2NAME, unit, dev->opencnt, ioreq); + write_log (_T("opening %s:%d opencnt=%d ioreq=%08X\n"), SANA2NAME, unit, dev->opencnt, ioreq); if (get_word (ioreq + 0x12) < IOSTDREQ_SIZE) return openfail (ioreq, IOERR_BADLENGTH); if ((flags & SANA2OPF_PROM) && dev->opencnt > 0) @@ -391,7 +391,7 @@ static uae_u32 REGPARAM2 dev_open_2 (TrapContext *context) dev->sysdata = NULL; return openfail (ioreq, IOERR_OPENFAIL); } - write_log (L"%s: initializing unit %d\n", getdevname (), unit); + write_log (_T("%s: initializing unit %d\n"), getdevname (), unit); dev->td = pdev->td; dev->adapter = pdev->td ? pdev->td->active : 0; if (dev->adapter) { @@ -443,7 +443,7 @@ static uae_u32 REGPARAM2 dev_open_2 (TrapContext *context) } } if (log_net) - write_log (L"%s:%d CTB=%08x CFB=%08x PF=%08x\n", + write_log (_T("%s:%d CTB=%08x CFB=%08x PF=%08x\n"), getdevname(), unit, pdev->copytobuff, pdev->copyfrombuff, pdev->packetfilter); m68k_dreg (regs, 0) = dev->td->mtu + ETH_HEADER_SIZE + 2; m68k_dreg (regs, 1) = 1; @@ -551,7 +551,7 @@ static int add_async_request (struct s2devstruct *dev, uaecptr request) struct asyncreq *ar, *ar2; if (log_net) - write_log (L"%s:%d async request %x added\n", getdevname(), dev->unit, request); + write_log (_T("%s:%d async request %x added\n"), getdevname(), dev->unit, request); uae_sem_wait (&async_sem); ar = xcalloc (struct asyncreq, 1); @@ -584,14 +584,14 @@ static int release_async_request (struct s2devstruct *dev, uaecptr request) uae_sem_post (&async_sem); xfree (ar); if (log_net) - write_log (L"%s:%d async request %x removed\n", getdevname(), dev->unit, request); + write_log (_T("%s:%d async request %x removed\n"), getdevname(), dev->unit, request); return 1; } prevar = ar; ar = ar->next; } uae_sem_post (&async_sem); - write_log (L"%s:%d async request %x not found for removal!\n", getdevname(), dev->unit, request); + write_log (_T("%s:%d async request %x not found for removal!\n"), getdevname(), dev->unit, request); return 0; } @@ -607,11 +607,11 @@ static void abort_async (struct s2devstruct *dev, uaecptr request) { struct asyncreq *ar = get_async_request (dev, request, 1); if (!ar) { - write_log (L"%s:%d: abort async but no request %x found!\n", getdevname(), dev->unit, request); + write_log (_T("%s:%d: abort async but no request %x found!\n"), getdevname(), dev->unit, request); return; } if (log_net) - write_log (L"%s:%d asyncronous request=%08X aborted\n", getdevname(), dev->unit, request); + write_log (_T("%s:%d asyncronous request=%08X aborted\n"), getdevname(), dev->unit, request); do_abort_async (dev, request); } @@ -620,7 +620,7 @@ static void signalasync (struct s2devstruct *dev, struct asyncreq *ar, int actua uaecptr request = ar->request; int command = get_word (request + 28); if (log_net) - write_log (L"%s:%d CMD=%d async request %x completed\n", getdevname(), dev->unit, command, request); + write_log (_T("%s:%d CMD=%d async request %x completed\n"), getdevname(), dev->unit, command, request); put_long (request + 32, actual); put_byte (request + 31, err); ar->ready = 1; @@ -828,7 +828,7 @@ void uaenet_gotdata (struct s2devstruct *dev, const uae_u8 *d, int len) type = (d[12] << 8) | d[13]; s2p = createreadpacket (dev, d, len); if (log_net) - write_log (L"<-DST:%02X.%02X.%02X.%02X.%02X.%02X SRC:%02X.%02X.%02X.%02X.%02X.%02X E=%04X L=%d P=%p\n", + write_log (_T("<-DST:%02X.%02X.%02X.%02X.%02X.%02X SRC:%02X.%02X.%02X.%02X.%02X.%02X E=%04X L=%d P=%p\n"), d[0], d[1], d[2], d[3], d[4], d[5], d[6], d[7], d[8], d[9], d[10], d[11], type, len, s2p); @@ -902,7 +902,7 @@ static int uaenet_getdata (struct s2devstruct *dev, uae_u8 *d, int *len) *len = ars2p->s2p->len; memcpy (d, ars2p->s2p->data, *len); if (log_net) - write_log (L"->DST:%02X.%02X.%02X.%02X.%02X.%02X SRC:%02X.%02X.%02X.%02X.%02X.%02X E=%04X S=%d\n", + write_log (_T("->DST:%02X.%02X.%02X.%02X.%02X.%02X SRC:%02X.%02X.%02X.%02X.%02X.%02X E=%04X S=%d\n"), d[0], d[1], d[2], d[3], d[4], d[5], d[6], d[7], d[8], d[9], d[10], d[11], packettype, *len); @@ -985,7 +985,7 @@ static int dev_do_io_2 (struct s2devstruct *dev, uaecptr request, int quick) struct priv_s2devstruct *pdev = getps2devstruct (request); if (log_net) - write_log (L"S2: C=%02d T=%04X S=%02X%02X%02X%02X%02X%02X D=%02X%02X%02X%02X%02X%02X L=%d D=%08X SD=%08X BM=%08X\n", + write_log (_T("S2: C=%02d T=%04X S=%02X%02X%02X%02X%02X%02X D=%02X%02X%02X%02X%02X%02X L=%d D=%08X SD=%08X BM=%08X\n"), command, packettype, get_byte (srcaddr + 0), get_byte (srcaddr + 1), get_byte (srcaddr + 2), get_byte (srcaddr + 3), get_byte (srcaddr + 4), get_byte (srcaddr + 5), get_byte (dstaddr + 0), get_byte (dstaddr + 1), get_byte (dstaddr + 2), get_byte (dstaddr + 3), get_byte (dstaddr + 4), get_byte (dstaddr + 5), @@ -1039,7 +1039,7 @@ static int dev_do_io_2 (struct s2devstruct *dev, uaecptr request, int quick) dev->flush_timeout_cnt = 0; dev->flush_timeout = FLUSH_TIMEOUT; if (log_net) - write_log (L"CMD_FLUSH started %08x\n", request); + write_log (_T("CMD_FLUSH started %08x\n"), request); uae_sem_wait (&async_sem); flush (pdev); uae_sem_post (&async_sem); @@ -1219,7 +1219,7 @@ toobig: } end: if (log_net && (io_error || wire_error)) - write_log (L"-> %d (%d)\n", io_error, wire_error); + write_log (_T("-> %d (%d)\n"), io_error, wire_error); put_long (request + 32, wire_error); put_byte (request + 31, io_error); return async; @@ -1233,7 +1233,7 @@ static int dev_do_io (struct s2devstruct *dev, uaecptr request, int quick) put_byte (request + 31, 0); if (!pdev) { - write_log (L"%s unknown iorequest %08x\n", getdevname (), request); + write_log (_T("%s unknown iorequest %08x\n"), getdevname (), request); return 0; } if (command == NSCMD_DEVICEQUERY) { @@ -1283,20 +1283,20 @@ static uae_u32 REGPARAM2 dev_beginio (TrapContext *context) put_byte (request + 8, NT_MESSAGE); if (!pdev) { - write_log (L"%s unknown iorequest (1) %08x\n", getdevname (), request); + write_log (_T("%s unknown iorequest (1) %08x\n"), getdevname (), request); put_byte (request + 31, 32); return get_byte (request + 31); } dev = gets2devstruct (pdev->unit); if (!dev) { - write_log (L"%s unknown iorequest (2) %08x\n", getdevname (), request); + write_log (_T("%s unknown iorequest (2) %08x\n"), getdevname (), request); put_byte (request + 31, 32); return get_byte (request + 31); } put_byte (request + 31, 0); if ((flags & 1) && dev_canquick (dev, request)) { if (dev_do_io (dev, request, 1)) - write_log (L"%s: command %d bug with IO_QUICK\n", SANA2NAME, command); + write_log (_T("%s: command %d bug with IO_QUICK\n"), SANA2NAME, command); return get_byte (request + 31); } else { if (command == CMD_WRITE || command == S2_BROADCAST || command == S2_MULTICAST) { @@ -1346,7 +1346,7 @@ static void *dev_thread (void *devs) dev->thread_running = 0; uae_sem_post (&dev->sync_sem); uae_sem_post (&change_sem); - write_log (L"%s: dev_thread killed\n", getdevname ()); + write_log (_T("%s: dev_thread killed\n"), getdevname ()); return 0; } else if (get_async_request (dev, request, 1)) { uae_ReplyMsg (request); @@ -1368,7 +1368,7 @@ static uae_u32 REGPARAM2 dev_init_2 (TrapContext *context) { uae_u32 base = m68k_dreg (regs,0); if (log_net) - write_log (L"%s init\n", SANA2NAME); + write_log (_T("%s init\n"), SANA2NAME); return base; } @@ -1384,18 +1384,18 @@ static uae_u32 REGPARAM2 dev_abortio (TrapContext *context) struct s2devstruct *dev; if (!pdev) { - write_log (L"%s abortio but no request %08x found!\n", getdevname(), request); + write_log (_T("%s abortio but no request %08x found!\n"), getdevname(), request); put_byte (request + 31, 32); return get_byte (request + 31); } dev = gets2devstruct (pdev->unit); if (!dev) { - write_log (L"%s (%d) abortio but no request %08x found!\n", getdevname(), pdev->unit, request); + write_log (_T("%s (%d) abortio but no request %08x found!\n"), getdevname(), pdev->unit, request); put_byte (request + 31, 32); return get_byte (request + 31); } if (log_net) - write_log (L"%s:%d abortio %08x\n", getdevname(), dev->unit, request); + write_log (_T("%s:%d abortio %08x\n"), getdevname(), dev->unit, request); abort_async (dev, request); return 0; } @@ -1434,14 +1434,14 @@ static uae_u32 REGPARAM2 uaenet_int_handler (TrapContext *ctx) if (pdev && pdev->tmp == 0) { if (handleread (ctx, pdev, request, p->data, p->len, command)) { if (log_net) - write_log (L"-> %p Accepted, CMD_READ, REQ=%08X LEN=%d\n", p, request, p->len); + write_log (_T("-> %p Accepted, CMD_READ, REQ=%08X LEN=%d\n"), p, request, p->len); write_comm_pipe_u32 (&dev->requests, request, 1); dev->packetsreceived++; gotit = 1; pdev->tmp = 1; } else { if (log_net) - write_log (L"-> %p PacketFilter() rejected, CMD_READ, REQ=%08X LEN=%d\n", p, request, p->len); + write_log (_T("-> %p PacketFilter() rejected, CMD_READ, REQ=%08X LEN=%d\n"), p, request, p->len); pdev->tmp = -1; } } @@ -1458,7 +1458,7 @@ static uae_u32 REGPARAM2 uaenet_int_handler (TrapContext *ctx) struct priv_s2devstruct *pdev = getps2devstruct (request); if (pdev && pdev->tmp <= 0) { if (log_net) - write_log (L"-> %p Accepted, S2_READORPHAN, REQ=%08X LEN=%d\n", p, request, p->len); + write_log (_T("-> %p Accepted, S2_READORPHAN, REQ=%08X LEN=%d\n"), p, request, p->len); handleread (ctx, pdev, request, p->data, p->len, command); write_comm_pipe_u32 (&dev->requests, request, 1); dev->packetsreceived++; @@ -1472,7 +1472,7 @@ static uae_u32 REGPARAM2 uaenet_int_handler (TrapContext *ctx) } if (!gotit) { if (log_net) - write_log (L"-> %p packet dropped, LEN=%d\n", p, p->len); + write_log (_T("-> %p packet dropped, LEN=%d\n"), p, p->len); for (j = 0; j < MAX_OPEN_DEVICES; j++) { if (pdevst[j].unit == dev->unit) { if (pdevst[j].tracks[type]) @@ -1521,7 +1521,7 @@ static uae_u32 REGPARAM2 uaenet_int_handler (TrapContext *ctx) /* do not reply CMD_FLUSH until all other requests are gone */ if (dev->ar->next == NULL) { if (log_net) - write_log (L"CMD_FLUSH replied %08x\n", request); + write_log (_T("CMD_FLUSH replied %08x\n"), request); write_comm_pipe_u32 (&dev->requests, request, 1); uaenet_vsync_requested--; } else { @@ -1531,7 +1531,7 @@ static uae_u32 REGPARAM2 uaenet_int_handler (TrapContext *ctx) if (dev->flush_timeout <= 0) { dev->flush_timeout = FLUSH_TIMEOUT; if (dev->flush_timeout_cnt > 1) - write_log (L"WARNING: %s:%d CMD_FLUSH possibly frozen..\n", getdevname(), pdev->unit); + write_log (_T("WARNING: %s:%d CMD_FLUSH possibly frozen..\n"), getdevname(), pdev->unit); dev->flush_timeout_cnt++; flush (pdev); } @@ -1557,7 +1557,7 @@ static void dev_reset (void) struct s2devstruct *dev; int unitnum = 0; - write_log (L"%s reset\n", getdevname()); + write_log (_T("%s reset\n"), getdevname()); for (i = 0; i < MAX_TOTAL_NET_DEVICES; i++) { dev = &devst[i]; if (dev->opencnt) { @@ -1589,7 +1589,7 @@ uaecptr netdev_startup (uaecptr resaddr) if (!currprefs.sana2) return resaddr; if (log_net) - write_log (L"netdev_startup(0x%x)\n", resaddr); + write_log (_T("netdev_startup(0x%x)\n"), resaddr); /* Build a struct Resident. This will set up and initialize * the uaescsi.device */ put_word (resaddr + 0x0, 0x4AFC); @@ -1613,38 +1613,38 @@ void netdev_install (void) if (!currprefs.sana2) return; if (log_net) - write_log (L"netdev_install(): 0x%x\n", here ()); + write_log (_T("netdev_install(): 0x%x\n"), here ()); uaenet_enumerate_free (td); uaenet_enumerate (&td, NULL); ROM_netdev_resname = ds (getdevname()); - ROM_netdev_resid = ds (L"UAE net.device 0.2"); - timerdevname = ds (L"timer.device"); + ROM_netdev_resid = ds (_T("UAE net.device 0.2")); + timerdevname = ds (_T("timer.device")); /* initcode */ initcode = here (); - calltrap (deftrap2 (dev_init, TRAPFLAG_EXTRA_STACK, L"uaenet.init")); dw (RTS); + calltrap (deftrap2 (dev_init, TRAPFLAG_EXTRA_STACK, _T("uaenet.init"))); dw (RTS); /* Open */ openfunc = here (); - calltrap (deftrap2 (dev_open, TRAPFLAG_EXTRA_STACK, L"uaenet.open")); dw (RTS); + calltrap (deftrap2 (dev_open, TRAPFLAG_EXTRA_STACK, _T("uaenet.open"))); dw (RTS); /* Close */ closefunc = here (); - calltrap (deftrap2 (dev_close, TRAPFLAG_EXTRA_STACK, L"uaenet.close")); dw (RTS); + calltrap (deftrap2 (dev_close, TRAPFLAG_EXTRA_STACK, _T("uaenet.close"))); dw (RTS); /* Expunge */ expungefunc = here (); - calltrap (deftrap2 (dev_expunge, TRAPFLAG_EXTRA_STACK, L"uaenet.expunge")); dw (RTS); + calltrap (deftrap2 (dev_expunge, TRAPFLAG_EXTRA_STACK, _T("uaenet.expunge"))); dw (RTS); /* BeginIO */ beginiofunc = here (); - calltrap (deftrap2 (dev_beginio, TRAPFLAG_EXTRA_STACK, L"uaenet.beginio")); dw (RTS); + calltrap (deftrap2 (dev_beginio, TRAPFLAG_EXTRA_STACK, _T("uaenet.beginio"))); dw (RTS); /* AbortIO */ abortiofunc = here (); - calltrap (deftrap2 (dev_abortio, TRAPFLAG_EXTRA_STACK, L"uaenet.abortio")); dw (RTS); + calltrap (deftrap2 (dev_abortio, TRAPFLAG_EXTRA_STACK, _T("uaenet.abortio"))); dw (RTS); /* FuncTable */ functable = here (); @@ -1716,7 +1716,7 @@ void netdev_start_threads (void) if (!currprefs.sana2) return; if (log_net) - write_log (L"netdev_start_threads()\n"); + write_log (_T("netdev_start_threads()\n")); uae_sem_init (&change_sem, 0, 1); uae_sem_init (&async_sem, 0, 1); } diff --git a/savestate.cpp b/savestate.cpp index 5d539b62..2b9b1c14 100644 --- a/savestate.cpp +++ b/savestate.cpp @@ -362,7 +362,7 @@ static void save_chunk (struct zfile *f, uae_u8 *chunk, size_t len, TCHAR *name, if (len2) zfile_fwrite (zero, 1, len2, f); - write_log (L"Chunk '%s' chunk size %d (%d)\n", name, chunklen, len); + write_log (_T("Chunk '%s' chunk size %d (%d)\n"), name, chunklen, len); } static uae_u8 *restore_chunk (struct zfile *f, TCHAR *name, size_t *len, size_t *totallen, size_t *filepos) @@ -404,14 +404,14 @@ static uae_u8 *restore_chunk (struct zfile *f, TCHAR *name, size_t *len, size_t } /* chunk data. RAM contents will be loaded during the reset phase, no need to malloc multiple megabytes here. */ - if (_tcscmp (name, L"CRAM") != 0 - && _tcscmp (name, L"BRAM") != 0 - && _tcscmp (name, L"FRAM") != 0 - && _tcscmp (name, L"ZRAM") != 0 - && _tcscmp (name, L"ZCRM") != 0 - && _tcscmp (name, L"PRAM") != 0 - && _tcscmp (name, L"A3K1") != 0 - && _tcscmp (name, L"A3K2") != 0) + if (_tcscmp (name, _T("CRAM")) != 0 + && _tcscmp (name, _T("BRAM")) != 0 + && _tcscmp (name, _T("FRAM")) != 0 + && _tcscmp (name, _T("ZRAM")) != 0 + && _tcscmp (name, _T("ZCRM")) != 0 + && _tcscmp (name, _T("PRAM")) != 0 + && _tcscmp (name, _T("A3K1")) != 0 + && _tcscmp (name, _T("A3K2")) != 0) { /* extra bytes at the end needed to handle old statefiles that now have new fields */ mem = xcalloc (uae_u8, *totallen + 100); @@ -463,7 +463,7 @@ static uae_u8 *restore_log (uae_u8 *src) { #if OPEN_LOG > 0 TCHAR *s = utf8u (src); - write_log (L"%s\n", s); + write_log (_T("%s\n"), s); xfree (s); #endif src += strlen ((char*)src) + 1; @@ -478,7 +478,7 @@ static void restore_header (uae_u8 *src) emuname = restore_string (); emuversion = restore_string (); description = restore_string (); - write_log (L"Saved with: '%s %s', description: '%s'\n", + write_log (_T("Saved with: '%s %s', description: '%s'\n"), emuname, emuversion, description); xfree (description); xfree (emuversion); @@ -497,7 +497,7 @@ void restore_state (const TCHAR *filename) int z3num; chunk = 0; - f = zfile_fopen (filename, L"rb", ZFD_NORMAL); + f = zfile_fopen (filename, _T("rb"), ZFD_NORMAL); if (!f) goto error; zfile_fseek (f, 0, SEEK_END); @@ -507,11 +507,11 @@ void restore_state (const TCHAR *filename) savestate_init (); chunk = restore_chunk (f, name, &len, &totallen, &filepos); - if (!chunk || _tcsncmp (name, L"ASF ", 4)) { - write_log (L"%s is not an AmigaStateFile\n", filename); + if (!chunk || _tcsncmp (name, _T("ASF "), 4)) { + write_log (_T("%s is not an AmigaStateFile\n"), filename); goto error; } - write_log (L"STATERESTORE:\n"); + write_log (_T("STATERESTORE:\n")); config_changed = 1; savestate_file = f; restore_header (chunk); @@ -527,181 +527,181 @@ void restore_state (const TCHAR *filename) for (;;) { name[0] = 0; chunk = end = restore_chunk (f, name, &len, &totallen, &filepos); - write_log (L"Chunk '%s' size %d (%d)\n", name, len, totallen); - if (!_tcscmp (name, L"END ")) { + write_log (_T("Chunk '%s' size %d (%d)\n"), name, len, totallen); + if (!_tcscmp (name, _T("END "))) { #ifdef _DEBUG if (filesize > filepos + 8) continue; #endif break; } - if (!_tcscmp (name, L"CRAM")) { + if (!_tcscmp (name, _T("CRAM"))) { restore_cram (totallen, filepos); continue; - } else if (!_tcscmp (name, L"BRAM")) { + } else if (!_tcscmp (name, _T("BRAM"))) { restore_bram (totallen, filepos); continue; - } else if (!_tcscmp (name, L"A3K1")) { + } else if (!_tcscmp (name, _T("A3K1"))) { restore_a3000lram (totallen, filepos); continue; - } else if (!_tcscmp (name, L"A3K2")) { + } else if (!_tcscmp (name, _T("A3K2"))) { restore_a3000hram (totallen, filepos); continue; #ifdef AUTOCONFIG - } else if (!_tcscmp (name, L"FRAM")) { + } else if (!_tcscmp (name, _T("FRAM"))) { restore_fram (totallen, filepos); continue; - } else if (!_tcscmp (name, L"ZRAM")) { + } else if (!_tcscmp (name, _T("ZRAM"))) { restore_zram (totallen, filepos, z3num++); continue; - } else if (!_tcscmp (name, L"ZCRM")) { + } else if (!_tcscmp (name, _T("ZCRM"))) { restore_zram (totallen, filepos, -1); continue; - } else if (!_tcscmp (name, L"BORO")) { + } else if (!_tcscmp (name, _T("BORO"))) { restore_bootrom (totallen, filepos); continue; #endif #ifdef PICASSO96 - } else if (!_tcscmp (name, L"PRAM")) { + } else if (!_tcscmp (name, _T("PRAM"))) { restore_pram (totallen, filepos); continue; #endif - } else if (!_tcscmp (name, L"CYCS")) { + } else if (!_tcscmp (name, _T("CYCS"))) { end = restore_cycles (chunk); - } else if (!_tcscmp (name, L"CPU ")) { + } else if (!_tcscmp (name, _T("CPU "))) { end = restore_cpu (chunk); - } else if (!_tcscmp (name, L"CPUX")) + } else if (!_tcscmp (name, _T("CPUX"))) end = restore_cpu_extra (chunk); - else if (!_tcscmp (name, L"CPUT")) + else if (!_tcscmp (name, _T("CPUT"))) end = restore_cpu_trace (chunk); #ifdef FPUEMU - else if (!_tcscmp (name, L"FPU ")) + else if (!_tcscmp (name, _T("FPU "))) end = restore_fpu (chunk); #endif #ifdef MMUEMU - else if (!_tcscmp (name, L"MMU ")) + else if (!_tcscmp (name, _T("MMU "))) end = restore_mmu (chunk); #endif - else if (!_tcscmp (name, L"AGAC")) + else if (!_tcscmp (name, _T("AGAC"))) end = restore_custom_agacolors (chunk); - else if (!_tcscmp (name, L"SPR0")) + else if (!_tcscmp (name, _T("SPR0"))) end = restore_custom_sprite (0, chunk); - else if (!_tcscmp (name, L"SPR1")) + else if (!_tcscmp (name, _T("SPR1"))) end = restore_custom_sprite (1, chunk); - else if (!_tcscmp (name, L"SPR2")) + else if (!_tcscmp (name, _T("SPR2"))) end = restore_custom_sprite (2, chunk); - else if (!_tcscmp (name, L"SPR3")) + else if (!_tcscmp (name, _T("SPR3"))) end = restore_custom_sprite (3, chunk); - else if (!_tcscmp (name, L"SPR4")) + else if (!_tcscmp (name, _T("SPR4"))) end = restore_custom_sprite (4, chunk); - else if (!_tcscmp (name, L"SPR5")) + else if (!_tcscmp (name, _T("SPR5"))) end = restore_custom_sprite (5, chunk); - else if (!_tcscmp (name, L"SPR6")) + else if (!_tcscmp (name, _T("SPR6"))) end = restore_custom_sprite (6, chunk); - else if (!_tcscmp (name, L"SPR7")) + else if (!_tcscmp (name, _T("SPR7"))) end = restore_custom_sprite (7, chunk); - else if (!_tcscmp (name, L"CIAA")) + else if (!_tcscmp (name, _T("CIAA"))) end = restore_cia (0, chunk); - else if (!_tcscmp (name, L"CIAB")) + else if (!_tcscmp (name, _T("CIAB"))) end = restore_cia (1, chunk); - else if (!_tcscmp (name, L"CHIP")) + else if (!_tcscmp (name, _T("CHIP"))) end = restore_custom (chunk); - else if (!_tcscmp (name, L"CINP")) + else if (!_tcscmp (name, _T("CINP"))) end = restore_input (chunk); - else if (!_tcscmp (name, L"CHPX")) + else if (!_tcscmp (name, _T("CHPX"))) end = restore_custom_extra (chunk); - else if (!_tcscmp (name, L"CHPD")) + else if (!_tcscmp (name, _T("CHPD"))) end = restore_custom_event_delay (chunk); - else if (!_tcscmp (name, L"AUD0")) + else if (!_tcscmp (name, _T("AUD0"))) end = restore_audio (0, chunk); - else if (!_tcscmp (name, L"AUD1")) + else if (!_tcscmp (name, _T("AUD1"))) end = restore_audio (1, chunk); - else if (!_tcscmp (name, L"AUD2")) + else if (!_tcscmp (name, _T("AUD2"))) end = restore_audio (2, chunk); - else if (!_tcscmp (name, L"AUD3")) + else if (!_tcscmp (name, _T("AUD3"))) end = restore_audio (3, chunk); - else if (!_tcscmp (name, L"BLIT")) + else if (!_tcscmp (name, _T("BLIT"))) end = restore_blitter (chunk); - else if (!_tcscmp (name, L"BLTX")) + else if (!_tcscmp (name, _T("BLTX"))) end = restore_blitter_new (chunk); - else if (!_tcscmp (name, L"DISK")) + else if (!_tcscmp (name, _T("DISK"))) end = restore_floppy (chunk); - else if (!_tcscmp (name, L"DSK0")) + else if (!_tcscmp (name, _T("DSK0"))) end = restore_disk (0, chunk); - else if (!_tcscmp (name, L"DSK1")) + else if (!_tcscmp (name, _T("DSK1"))) end = restore_disk (1, chunk); - else if (!_tcscmp (name, L"DSK2")) + else if (!_tcscmp (name, _T("DSK2"))) end = restore_disk (2, chunk); - else if (!_tcscmp (name, L"DSK3")) + else if (!_tcscmp (name, _T("DSK3"))) end = restore_disk (3, chunk); - else if (!_tcscmp (name, L"DSD0")) + else if (!_tcscmp (name, _T("DSD0"))) end = restore_disk2 (0, chunk); - else if (!_tcscmp (name, L"DSD1")) + else if (!_tcscmp (name, _T("DSD1"))) end = restore_disk2 (1, chunk); - else if (!_tcscmp (name, L"DSD2")) + else if (!_tcscmp (name, _T("DSD2"))) end = restore_disk2 (2, chunk); - else if (!_tcscmp (name, L"DSD3")) + else if (!_tcscmp (name, _T("DSD3"))) end = restore_disk2 (3, chunk); - else if (!_tcscmp (name, L"KEYB")) + else if (!_tcscmp (name, _T("KEYB"))) end = restore_keyboard (chunk); #ifdef AUTOCONFIG - else if (!_tcscmp (name, L"EXPA")) + else if (!_tcscmp (name, _T("EXPA"))) end = restore_expansion (chunk); #endif - else if (!_tcscmp (name, L"ROM ")) + else if (!_tcscmp (name, _T("ROM "))) end = restore_rom (chunk); #ifdef PICASSO96 - else if (!_tcscmp (name, L"P96 ")) + else if (!_tcscmp (name, _T("P96 "))) end = restore_p96 (chunk); #endif #ifdef ACTION_REPLAY - else if (!_tcscmp (name, L"ACTR")) + else if (!_tcscmp (name, _T("ACTR"))) end = restore_action_replay (chunk); - else if (!_tcscmp (name, L"HRTM")) + else if (!_tcscmp (name, _T("HRTM"))) end = restore_hrtmon (chunk); #endif #ifdef FILESYS - else if (!_tcscmp (name, L"FSYS")) + else if (!_tcscmp (name, _T("FSYS"))) end = restore_filesys (chunk); - else if (!_tcscmp (name, L"FSYC")) + else if (!_tcscmp (name, _T("FSYC"))) end = restore_filesys_common (chunk); #endif #ifdef CD32 - else if (!_tcscmp (name, L"CD32")) + else if (!_tcscmp (name, _T("CD32"))) end = restore_akiko (chunk); #endif #ifdef CDTV - else if (!_tcscmp (name, L"CDTV")) + else if (!_tcscmp (name, _T("CDTV"))) end = restore_cdtv (chunk); - else if (!_tcscmp (name, L"DMAC")) + else if (!_tcscmp (name, _T("DMAC"))) end = restore_dmac (chunk); #endif - else if (!_tcscmp (name, L"GAYL")) + else if (!_tcscmp (name, _T("GAYL"))) end = restore_gayle (chunk); - else if (!_tcscmp (name, L"IDE ")) + else if (!_tcscmp (name, _T("IDE "))) end = restore_ide (chunk); - else if (!_tcsncmp (name, L"CDU", 3)) + else if (!_tcsncmp (name, _T("CDU"), 3)) end = restore_cd (name[3] - '0', chunk); #ifdef A2065 - else if (!_tcsncmp (name, L"2065", 4)) + else if (!_tcsncmp (name, _T("2065"), 4)) end = restore_a2065 (chunk); #endif - else if (!_tcsncmp (name, L"DMWP", 4)) + else if (!_tcsncmp (name, _T("DMWP"), 4)) end = restore_debug_memwatch (chunk); - else if (!_tcscmp (name, L"CONF")) + else if (!_tcscmp (name, _T("CONF"))) end = restore_configuration (chunk); - else if (!_tcscmp (name, L"LOG ")) + else if (!_tcscmp (name, _T("LOG "))) end = restore_log (chunk); else { end = chunk + len; - write_log (L"unknown chunk '%s' size %d bytes\n", name, len); + write_log (_T("unknown chunk '%s' size %d bytes\n"), name, len); } if (end == NULL) - write_log (L"Chunk '%s', size %d bytes was not accepted!\n", + write_log (_T("Chunk '%s', size %d bytes was not accepted!\n"), name, len); else if (totallen != end - chunk) - write_log (L"Chunk '%s' total size %d bytes but read %d bytes!\n", + write_log (_T("Chunk '%s' total size %d bytes but read %d bytes!\n"), name, totallen, end - chunk); xfree (chunk); } @@ -765,28 +765,28 @@ static void save_rams (struct zfile *f, int comp) int len; dst = save_cram (&len); - save_chunk (f, dst, len, L"CRAM", comp); + save_chunk (f, dst, len, _T("CRAM"), comp); dst = save_bram (&len); - save_chunk (f, dst, len, L"BRAM", comp); + save_chunk (f, dst, len, _T("BRAM"), comp); dst = save_a3000lram (&len); - save_chunk (f, dst, len, L"A3K1", comp); + save_chunk (f, dst, len, _T("A3K1"), comp); dst = save_a3000hram (&len); - save_chunk (f, dst, len, L"A3K2", comp); + save_chunk (f, dst, len, _T("A3K2"), comp); #ifdef AUTOCONFIG dst = save_fram (&len); - save_chunk (f, dst, len, L"FRAM", comp); + save_chunk (f, dst, len, _T("FRAM"), comp); dst = save_zram (&len, 0); - save_chunk (f, dst, len, L"ZRAM", comp); + save_chunk (f, dst, len, _T("ZRAM"), comp); dst = save_zram (&len, 1); - save_chunk (f, dst, len, L"ZRAM", comp); + save_chunk (f, dst, len, _T("ZRAM"), comp); dst = save_zram (&len, -1); - save_chunk (f, dst, len, L"ZCRM", comp); + save_chunk (f, dst, len, _T("ZCRM"), comp); dst = save_bootrom (&len); - save_chunk (f, dst, len, L"BORO", comp); + save_chunk (f, dst, len, _T("BORO"), comp); #endif #ifdef PICASSO96 dst = save_pram (&len); - save_chunk (f, dst, len, L"PRAM", comp); + save_chunk (f, dst, len, _T("PRAM"), comp); #endif } @@ -801,44 +801,44 @@ static int save_state_internal (struct zfile *f, const TCHAR *description, int c TCHAR name[5]; int i, len; - write_log (L"STATESAVE (%s):\n", f ? zfile_getname (f) : L""); + write_log (_T("STATESAVE (%s):\n"), f ? zfile_getname (f) : _T("")); dst = header; save_u32 (0); - save_string (L"UAE"); - _stprintf (tmp, L"%d.%d.%d", UAEMAJOR, UAEMINOR, UAESUBREV); + save_string (_T("UAE")); + _stprintf (tmp, _T("%d.%d.%d"), UAEMAJOR, UAEMINOR, UAESUBREV); save_string (tmp); save_string (description); - save_chunk (f, header, dst-header, L"ASF ", 0); + save_chunk (f, header, dst-header, _T("ASF "), 0); dst = save_cycles (&len, 0); - save_chunk (f, dst, len, L"CYCS", 0); + save_chunk (f, dst, len, _T("CYCS"), 0); xfree (dst); dst = save_cpu (&len, 0); - save_chunk (f, dst, len, L"CPU ", 0); + save_chunk (f, dst, len, _T("CPU "), 0); xfree (dst); dst = save_cpu_extra (&len, 0); - save_chunk (f, dst, len, L"CPUX", 0); + save_chunk (f, dst, len, _T("CPUX"), 0); xfree (dst); dst = save_cpu_trace (&len, 0); - save_chunk (f, dst, len, L"CPUT", 0); + save_chunk (f, dst, len, _T("CPUT"), 0); xfree (dst); #ifdef FPUEMU dst = save_fpu (&len,0 ); - save_chunk (f, dst, len, L"FPU ", 0); + save_chunk (f, dst, len, _T("FPU "), 0); xfree (dst); #endif #ifdef MMUEMU dst = save_mmu (&len, 0); - save_chunk (f, dst, len, L"MMU ", 0); + save_chunk (f, dst, len, _T("MMU "), 0); xfree (dst); #endif - _tcscpy(name, L"DSKx"); + _tcscpy(name, _T("DSKx")); for (i = 0; i < 4; i++) { dst = save_disk (i, &len, 0, savepath); if (dst) { @@ -847,7 +847,7 @@ static int save_state_internal (struct zfile *f, const TCHAR *description, int c xfree (dst); } } - _tcscpy(name, L"DSDx"); + _tcscpy(name, _T("DSDx")); for (i = 0; i < 4; i++) { dst = save_disk2 (i, &len, 0); if (dst) { @@ -859,39 +859,39 @@ static int save_state_internal (struct zfile *f, const TCHAR *description, int c dst = save_floppy (&len, 0); - save_chunk (f, dst, len, L"DISK", 0); + save_chunk (f, dst, len, _T("DISK"), 0); xfree (dst); dst = save_custom (&len, 0, 0); - save_chunk (f, dst, len, L"CHIP", 0); + save_chunk (f, dst, len, _T("CHIP"), 0); xfree (dst); dst = save_custom_extra (&len, 0); - save_chunk (f, dst, len, L"CHPX", 0); + save_chunk (f, dst, len, _T("CHPX"), 0); xfree (dst); dst = save_custom_event_delay (&len, 0); - save_chunk (f, dst, len, L"CHPD", 0); + save_chunk (f, dst, len, _T("CHPD"), 0); xfree (dst); dst = save_blitter_new (&len, 0); - save_chunk (f, dst, len, L"BLTX", 0); + save_chunk (f, dst, len, _T("BLTX"), 0); xfree (dst); if (new_blitter == false) { dst = save_blitter (&len, 0); - save_chunk (f, dst, len, L"BLIT", 0); + save_chunk (f, dst, len, _T("BLIT"), 0); xfree (dst); } dst = save_input (&len, 0); - save_chunk (f, dst, len, L"CINP", 0); + save_chunk (f, dst, len, _T("CINP"), 0); xfree (dst); dst = save_custom_agacolors (&len, 0); - save_chunk (f, dst, len, L"AGAC", 0); + save_chunk (f, dst, len, _T("AGAC"), 0); xfree (dst); - _tcscpy (name, L"SPRx"); + _tcscpy (name, _T("SPRx")); for (i = 0; i < 8; i++) { dst = save_custom_sprite (i, &len, 0); name[3] = i + '0'; @@ -899,7 +899,7 @@ static int save_state_internal (struct zfile *f, const TCHAR *description, int c xfree (dst); } - _tcscpy (name, L"AUDx"); + _tcscpy (name, _T("AUDx")); for (i = 0; i < 4; i++) { dst = save_audio (i, &len, 0); name[3] = i + '0'; @@ -908,28 +908,28 @@ static int save_state_internal (struct zfile *f, const TCHAR *description, int c } dst = save_cia (0, &len, 0); - save_chunk (f, dst, len, L"CIAA", 0); + save_chunk (f, dst, len, _T("CIAA"), 0); xfree (dst); dst = save_cia (1, &len, 0); - save_chunk (f, dst, len, L"CIAB", 0); + save_chunk (f, dst, len, _T("CIAB"), 0); xfree (dst); dst = save_keyboard (&len, NULL); - save_chunk (f, dst, len, L"KEYB", 0); + save_chunk (f, dst, len, _T("KEYB"), 0); xfree (dst); #ifdef AUTOCONFIG dst = save_expansion (&len, 0); - save_chunk (f, dst, len, L"EXPA", 0); + save_chunk (f, dst, len, _T("EXPA"), 0); #endif #ifdef A2065 dst = save_a2065 (&len, NULL); - save_chunk (f, dst, len, L"2065", 0); + save_chunk (f, dst, len, _T("2065"), 0); #endif #ifdef PICASSO96 dst = save_p96 (&len, 0); - save_chunk (f, dst, len, L"P96 ", 0); + save_chunk (f, dst, len, _T("P96 "), 0); #endif save_rams (f, comp); @@ -937,38 +937,38 @@ static int save_state_internal (struct zfile *f, const TCHAR *description, int c do { if (!dst) break; - save_chunk (f, dst, len, L"ROM ", 0); + save_chunk (f, dst, len, _T("ROM "), 0); xfree (dst); } while ((dst = save_rom (0, &len, 0))); #ifdef CD32 dst = save_akiko (&len, NULL); - save_chunk (f, dst, len, L"CD32", 0); + save_chunk (f, dst, len, _T("CD32"), 0); xfree (dst); #endif #ifdef CDTV dst = save_cdtv (&len, NULL); - save_chunk (f, dst, len, L"CDTV", 0); + save_chunk (f, dst, len, _T("CDTV"), 0); xfree (dst); dst = save_dmac (&len, NULL); - save_chunk (f, dst, len, L"DMAC", 0); + save_chunk (f, dst, len, _T("DMAC"), 0); xfree (dst); #endif #ifdef ACTION_REPLAY dst = save_action_replay (&len, NULL); - save_chunk (f, dst, len, L"ACTR", comp); + save_chunk (f, dst, len, _T("ACTR"), comp); dst = save_hrtmon (&len, NULL); - save_chunk (f, dst, len, L"HRTM", comp); + save_chunk (f, dst, len, _T("HRTM"), comp); #endif #ifdef FILESYS dst = save_filesys_common (&len); if (dst) { - save_chunk (f, dst, len, L"FSYC", 0); + save_chunk (f, dst, len, _T("FSYC"), 0); for (i = 0; i < nr_units (); i++) { dst = save_filesys (i, &len); if (dst) { - save_chunk (f, dst, len, L"FSYS", 0); + save_chunk (f, dst, len, _T("FSYS"), 0); xfree (dst); } } @@ -976,13 +976,13 @@ static int save_state_internal (struct zfile *f, const TCHAR *description, int c #endif dst = save_gayle (&len, NULL); if (dst) { - save_chunk (f, dst, len, L"GAYL", 0); + save_chunk (f, dst, len, _T("GAYL"), 0); xfree(dst); } for (i = 0; i < 4; i++) { dst = save_ide (i, &len, NULL); if (dst) { - save_chunk (f, dst, len, L"IDE ", 0); + save_chunk (f, dst, len, _T("IDE "), 0); xfree (dst); } } @@ -990,14 +990,14 @@ static int save_state_internal (struct zfile *f, const TCHAR *description, int c for (i = 0; i < MAX_TOTAL_SCSI_DEVICES; i++) { dst = save_cd (i, &len); if (dst) { - _stprintf (name, L"CDU%d", i); + _stprintf (name, _T("CDU%d"), i); save_chunk (f, dst, len, name, 0); } } dst = save_debug_memwatch (&len, NULL); if (dst) { - save_chunk (f, dst, len, L"DMWP", 0); + save_chunk (f, dst, len, _T("DMWP"), 0); xfree(dst); } @@ -1007,13 +1007,13 @@ static int save_state_internal (struct zfile *f, const TCHAR *description, int c dst = save_configuration (&len); if (dst) { - save_chunk (f, dst, len, L"CONF", comp); + save_chunk (f, dst, len, _T("CONF"), comp); xfree(dst); } len = 30000; dst = save_log (TRUE, &len); if (dst) { - save_chunk (f, dst, len, L"LOG ", comp); + save_chunk (f, dst, len, _T("LOG "), comp); xfree (dst); } @@ -1030,14 +1030,14 @@ int save_state (const TCHAR *filename, const TCHAR *description) if (!savestate_specialdump && !savestate_nodialogs) { state_incompatible_warn (); if (!save_filesys_cando ()) { - gui_message (L"Filesystem active. Try again later."); + gui_message (_T("Filesystem active. Try again later.")); return -1; } } new_blitter = false; savestate_nodialogs = 0; custom_prepare_savestate (); - f = zfile_fopen (filename, L"w+b", 0); + f = zfile_fopen (filename, _T("w+b"), 0); if (!f) return 0; if (savestate_specialdump) { @@ -1064,7 +1064,7 @@ int save_state (const TCHAR *filename, const TCHAR *description) } int v = save_state_internal (f, description, comp, true); if (v) - write_log (L"Save of '%s' complete\n", filename); + write_log (_T("Save of '%s' complete\n"), filename); zfile_fclose (f); savestate_state = 0; return v; @@ -1081,24 +1081,24 @@ void savestate_quick (int slot, int save) while (i >= 0 && savestate_fname[i] != '.') i--; if (i <= 0) { - write_log (L"savestate name skipped '%s'\n", savestate_fname); + write_log (_T("savestate name skipped '%s'\n"), savestate_fname); return; } } - _tcscpy (savestate_fname + i, L".uss"); + _tcscpy (savestate_fname + i, _T(".uss")); if (slot > 0) - _stprintf (savestate_fname + i, L"_%d.uss", slot); + _stprintf (savestate_fname + i, _T("_%d.uss"), slot); if (save) { - write_log (L"saving '%s'\n", savestate_fname); + write_log (_T("saving '%s'\n"), savestate_fname); savestate_docompress = 1; - save_state (savestate_fname, L""); + save_state (savestate_fname, _T("")); } else { if (!zfile_exists (savestate_fname)) { - write_log (L"staterestore, file '%s' not found\n", savestate_fname); + write_log (_T("staterestore, file '%s' not found\n"), savestate_fname); return; } savestate_state = STATE_DORESTORE; - write_log (L"staterestore starting '%s'\n", savestate_fname); + write_log (_T("staterestore starting '%s'\n"), savestate_fname); } } @@ -1144,7 +1144,7 @@ int savestate_dorewind (int pos) pos = replaycounter - 1; if (canrewind (pos)) { savestate_state = STATE_DOREWIND; - write_log (L"dorewind %d (%010d/%03d) -> %d\n", replaycounter - 1, hsync_counter, vsync_counter, pos); + write_log (_T("dorewind %d (%010d/%03d) -> %d\n"), replaycounter - 1, hsync_counter, vsync_counter, pos); return 1; } return 0; @@ -1165,7 +1165,7 @@ void savestate_listrewind (void) break; p = st->cpu + 17 * 4; pc = restore_u32_func (&p); - console_out_f (L"%d: PC=%08X %c\n", cnt, pc, regs.pc == pc ? '*' : ' '); + console_out_f (_T("%d: PC=%08X %c\n"), cnt, pc, regs.pc == pc ? '*' : ' '); cnt++; i--; if (i < 0) @@ -1198,7 +1198,7 @@ void savestate_rewind (void) } p = st->data; p2 = st->end; - write_log (L"rewinding %d -> %d\n", replaycounter - 1, pos); + write_log (_T("rewinding %d -> %d\n"), replaycounter - 1, pos); hsync_counter = restore_u32_func (&p); vsync_counter = restore_u32_func (&p); p = restore_cpu (p); @@ -1277,12 +1277,12 @@ void savestate_rewind (void) } p += 4; if (p != p2) { - gui_message (L"reload failure, address mismatch %p != %p", p, p2); + gui_message (_T("reload failure, address mismatch %p != %p"), p, p2); uae_reset (0); return; } inprec_setposition (st->inprecoffset, pos); - write_log (L"state %d restored. (%010d/%03d)\n", pos, hsync_counter, vsync_counter); + write_log (_T("state %d restored. (%010d/%03d)\n"), pos, hsync_counter, vsync_counter); if (rewind) { replaycounter--; if (replaycounter < 0) @@ -1307,9 +1307,9 @@ void savestate_memorysave (void) new_blitter = true; // create real statefile in memory too for later saving zfile_fclose (staterecord_statefile); - staterecord_statefile = zfile_fopen_empty (NULL, L"statefile.inp.uss"); + staterecord_statefile = zfile_fopen_empty (NULL, _T("statefile.inp.uss")); if (staterecord_statefile) - save_state_internal (staterecord_statefile, L"rerecording", 1, false); + save_state_internal (staterecord_statefile, _T("rerecording"), 1, false); } void savestate_capture (int force) @@ -1350,7 +1350,7 @@ retry2: st = (struct staterecord*)xmalloc (uae_u8, statefile_alloc); st->len = statefile_alloc; } else if (retrycnt > 0) { - write_log (L"realloc %d -> %d\n", st->len, st->len + STATEFILE_ALLOC_SIZE); + write_log (_T("realloc %d -> %d\n"), st->len, st->len + STATEFILE_ALLOC_SIZE); st->len += STATEFILE_ALLOC_SIZE; st = (struct staterecord*)xrealloc (uae_u8, st, st->len); } @@ -1647,7 +1647,7 @@ retry2: staterecords_first -= staterecords_max; } - write_log (L"state capture %d (%010d/%03d,%d/%d) (%d bytes, alloc %d)\n", + write_log (_T("state capture %d (%010d/%03d,%d/%d) (%d bytes, alloc %d)\n"), replaycounter, hsync_counter, vsync_counter, hsync_counter % current_maxvpos (), current_maxvpos (), st->end - st->data, statefile_alloc); @@ -1668,7 +1668,7 @@ retry2: retry: if (retrycnt < 10) goto retry2; - write_log (L"can't save, too small capture buffer or out of memory\n"); + write_log (_T("can't save, too small capture buffer or out of memory\n")); return; } @@ -1704,14 +1704,14 @@ void statefile_save_recording (const TCHAR *filename) { if (!staterecord_statefile) return; - struct zfile *zf = zfile_fopen (filename, L"wb", 0); + struct zfile *zf = zfile_fopen (filename, _T("wb"), 0); if (zf) { int len = zfile_size (staterecord_statefile); uae_u8 *data = zfile_getdata (staterecord_statefile, 0, len); zfile_fwrite (data, len, 1, zf); xfree (data); zfile_fclose (zf); - write_log (L"input statefile '%s' saved\n", filename); + write_log (_T("input statefile '%s' saved\n"), filename); } } diff --git a/scsi.cpp b/scsi.cpp index 366fbbe9..cc82bef2 100644 --- a/scsi.cpp +++ b/scsi.cpp @@ -40,7 +40,7 @@ int scsi_data_dir(struct scsi_data *sd) return 0; } } - write_log (L"SCSI command %02X, no direction specified (IN?)!\n", sd->cmd[0]); + write_log (_T("SCSI command %02X, no direction specified (IN?)!\n"), sd->cmd[0]); return -2; } @@ -99,7 +99,7 @@ struct scsi_data *scsi_alloc_native(int id, int nativeunit) { struct scsi_data *sd; if (!sys_command_open (nativeunit)) { - write_log (L"SCSI: native scsi unit %d failed to open\n", nativeunit); + write_log (_T("SCSI: native scsi unit %d failed to open\n"), nativeunit); return NULL; } sd = xcalloc (struct scsi_data, 1); @@ -133,13 +133,13 @@ int scsi_send_data(struct scsi_data *sd, uae_u8 b) { if (sd->direction) { if (sd->offset >= SCSI_DATA_BUFFER_SIZE) { - write_log (L"SCSI data buffer overflow!\n"); + write_log (_T("SCSI data buffer overflow!\n")); return 0; } sd->buffer[sd->offset++] = b; } else { if (sd->offset >= 16) { - write_log (L"SCSI command buffer overflow!\n"); + write_log (_T("SCSI command buffer overflow!\n")); return 0; } sd->cmd[sd->offset++] = b; diff --git a/scsiemul.cpp b/scsiemul.cpp index 1e42c4b9..9e9913fc 100644 --- a/scsiemul.cpp +++ b/scsiemul.cpp @@ -30,9 +30,9 @@ #define CDDEV_COMMANDS -#define UAEDEV_SCSI L"uaescsi.device" +#define UAEDEV_SCSI _T("uaescsi.device") #define UAEDEV_SCSI_ID 1 -#define UAEDEV_DISK L"uaedisk.device" +#define UAEDEV_DISK _T("uaedisk.device") #define UAEDEV_DISK_ID 2 #define MAX_ASYNC_REQUESTS 20 @@ -93,7 +93,7 @@ static struct device_info *devinfo (struct devstruct *devst, struct device_info static void io_log (const TCHAR *msg, uaecptr request) { if (log_scsi) - write_log (L"%s: %08X %d %08X %d %d io_actual=%d io_error=%d\n", + write_log (_T("%s: %08X %d %08X %d %d io_actual=%d io_error=%d\n"), msg, request, get_word (request + 28), get_long (request + 40), get_long (request + 36), get_long (request + 44), get_long (request + 32), get_byte (request + 31)); @@ -113,7 +113,7 @@ static struct priv_devstruct *getpdevstruct (uaecptr request) { int i = get_long (request + 24); if (i < 0 || i >= MAX_OPEN_DEVICES || pdevst[i].inuse == 0) { - write_log (L"uaescsi.device: corrupt iorequest %08X %d\n", request, i); + write_log (_T("uaescsi.device: corrupt iorequest %08X %d\n"), request, i); return 0; } return &pdevst[i]; @@ -127,7 +127,7 @@ static TCHAR *getdevname (int type) case UAEDEV_DISK_ID: return UAEDEV_DISK; default: - return L"NULL"; + return _T("NULL"); } } @@ -138,7 +138,7 @@ static int start_thread (struct devstruct *dev) return 1; init_comm_pipe (&dev->requests, 100, 1); uae_sem_init (&dev->sync_sem, 0, 0); - uae_start_thread (L"uaescsi", dev_thread, dev, NULL); + uae_start_thread (_T("uaescsi"), dev_thread, dev, NULL); uae_sem_wait (&dev->sync_sem); return dev->thread_running; } @@ -164,7 +164,7 @@ static uae_u32 REGPARAM2 dev_close_2 (TrapContext *context) return 0; dev = getdevstruct (pdev->unit); if (log_scsi) - write_log (L"%s:%d close, req=%08X\n", getdevname (pdev->type), pdev->unit, request); + write_log (_T("%s:%d close, req=%08X\n"), getdevname (pdev->type), pdev->unit, request); if (!dev) return 0; dev_close_3 (dev, pdev); @@ -199,7 +199,7 @@ static uae_u32 REGPARAM2 dev_open_2 (TrapContext *context, int type) int i; if (log_scsi) - write_log (L"opening %s:%d ioreq=%08X\n", getdevname (type), unit, ioreq); + write_log (_T("opening %s:%d ioreq=%08X\n"), getdevname (type), unit, ioreq); if (get_word (ioreq + 0x12) < IOSTDREQ_SIZE && get_word (ioreq + 0x12) > 0) return openfail (ioreq, IOERR_BADLENGTH); if (!dev) @@ -295,7 +295,7 @@ static int scsiemul_switchscsi (const TCHAR *name) dev->drivetype = discsi->type; memcpy (&dev->di, discsi, sizeof (struct device_info)); dev->iscd = 1; - write_log (L"%s mounted as uaescsi.device:0\n", discsi->label); + write_log (_T("%s mounted as uaescsi.device:0\n"), discsi->label); if (dev->di.media_inserted) { dev->di.media_inserted = 0; scsi_do_disk_change (dev->di.id, 1, NULL); @@ -362,7 +362,7 @@ static int add_async_request (struct devstruct *dev, uaecptr request, int type, int i; if (log_scsi) - write_log (L"async request %08x (%d) added\n", request, type); + write_log (_T("async request %08x (%d) added\n"), request, type); i = 0; while (i < MAX_ASYNC_REQUESTS) { if (dev->d_request[i] == request) { @@ -390,7 +390,7 @@ static int release_async_request (struct devstruct *dev, uaecptr request) int i = 0; if (log_scsi) - write_log (L"async request %p removed\n", request); + write_log (_T("async request %p removed\n"), request); while (i < MAX_ASYNC_REQUESTS) { if (dev->d_request[i] == request) { int type = dev->d_request_type[i]; @@ -419,7 +419,7 @@ static void abort_async (struct devstruct *dev, uaecptr request, int errcode, in } i = release_async_request (dev, request); if (i >= 0 && log_scsi) - write_log (L"asyncronous request=%08X aborted, error=%d\n", request, errcode); + write_log (_T("asyncronous request=%08X aborted, error=%d\n"), request, errcode); } static int command_read (struct devstruct *dev, uaecptr data, uae_u64 offset, uae_u32 length, uae_u32 *io_actual) @@ -522,7 +522,7 @@ static int dev_do_io (struct devstruct *dev, uaecptr request) command = get_word (request + 28); if (log_scsi) - write_log (L"%d: DATA=%08X LEN=%08X OFFSET=%08X ACTUAL=%08X\n", + write_log (_T("%d: DATA=%08X LEN=%08X OFFSET=%08X ACTUAL=%08X\n"), command, io_data, io_length, io_offset, io_actual); switch (command) @@ -859,7 +859,7 @@ static int dev_do_io (struct devstruct *dev, uaecptr request) uae_u32 sdd = get_long (request + 40); io_error = sys_command_scsi_direct (dev->unitnum, sdd); if (log_scsi) - write_log (L"scsidev: did io: sdd %p request %p error %d\n", sdd, request, get_byte (request + 31)); + write_log (_T("scsidev: did io: sdd %p request %p error %d\n"), sdd, request, get_byte (request + 31)); } break; case NSCMD_DEVICEQUERY: @@ -885,7 +885,7 @@ no_media: } put_long (request + 32, io_actual); put_byte (request + 31, io_error); - io_log (L"dev_io",request); + io_log (_T("dev_io"),request); return async; } @@ -969,7 +969,7 @@ static void *dev_thread (void *devs) uae_ReplyMsg (request); } else { if (log_scsi) - write_log (L"%s:%d async request %08X\n", getdevname(0), dev->unitnum, request); + write_log (_T("%s:%d async request %08X\n"), getdevname(0), dev->unitnum, request); } uae_sem_post (&change_sem); } @@ -980,7 +980,7 @@ static uae_u32 REGPARAM2 dev_init_2 (TrapContext *context, int type) { uae_u32 base = m68k_dreg (regs,0); if (log_scsi) - write_log (L"%s init\n", getdevname (type)); + write_log (_T("%s init\n"), getdevname (type)); return base; } @@ -1010,7 +1010,7 @@ static uae_u32 REGPARAM2 dev_abortio (TrapContext *context) } put_byte (request + 31, IOERR_ABORTED); if (log_scsi) - write_log (L"abortio %s unit=%d, request=%08X\n", getdevname (pdev->type), pdev->unit, request); + write_log (_T("abortio %s unit=%d, request=%08X\n"), getdevname (pdev->type), pdev->unit, request); abort_async (dev, request, IOERR_ABORTED, 0); return 0; } @@ -1099,7 +1099,7 @@ static void dev_reset (void) dev->aunit = unitnum; unitnum++; } - write_log (L"%s:%d = %s:'%s'\n", UAEDEV_SCSI, dev->aunit, dev->di.backend, dev->di.label); + write_log (_T("%s:%d = %s:'%s'\n"), UAEDEV_SCSI, dev->aunit, dev->di.backend, dev->di.label); } dev->di.label[0] = 0; } @@ -1119,7 +1119,7 @@ static uaecptr diskdev_startup (uaecptr resaddr) /* Build a struct Resident. This will set up and initialize * the cd.device */ if (log_scsi) - write_log (L"diskdev_startup(0x%x)\n", resaddr); + write_log (_T("diskdev_startup(0x%x)\n"), resaddr); put_word (resaddr + 0x0, 0x4AFC); put_long (resaddr + 0x2, resaddr); put_long (resaddr + 0x6, resaddr + 0x1A); /* Continue scan here */ @@ -1137,7 +1137,7 @@ uaecptr scsidev_startup (uaecptr resaddr) if (currprefs.scsi != 1) return resaddr; if (log_scsi) - write_log (L"scsidev_startup(0x%x)\n", resaddr); + write_log (_T("scsidev_startup(0x%x)\n"), resaddr); /* Build a struct Resident. This will set up and initialize * the uaescsi.device */ put_word (resaddr + 0x0, 0x4AFC); @@ -1162,10 +1162,10 @@ static void diskdev_install (void) if (currprefs.scsi != 1) return; if (log_scsi) - write_log (L"diskdev_install(): 0x%x\n", here ()); + write_log (_T("diskdev_install(): 0x%x\n"), here ()); ROM_diskdev_resname = ds (UAEDEV_DISK); - ROM_diskdev_resid = ds (L"UAE disk.device 0.1"); + ROM_diskdev_resid = ds (_T("UAE disk.device 0.1")); /* initcode */ initcode = here (); @@ -1241,10 +1241,10 @@ void scsidev_install (void) if (currprefs.scsi != 1) return; if (log_scsi) - write_log (L"scsidev_install(): 0x%x\n", here ()); + write_log (_T("scsidev_install(): 0x%x\n"), here ()); ROM_scsidev_resname = ds (UAEDEV_SCSI); - ROM_scsidev_resid = ds (L"UAE scsi.device 0.2"); + ROM_scsidev_resid = ds (_T("UAE scsi.device 0.2")); /* initcode */ initcode = here (); @@ -1345,7 +1345,7 @@ void scsidev_start_threads (void) if (currprefs.scsi != 1) /* quite useless.. */ return; if (log_scsi) - write_log (L"scsidev_start_threads()\n"); + write_log (_T("scsidev_start_threads()\n")); uae_sem_init (&change_sem, 0, 1); } diff --git a/specialmonitors.cpp b/specialmonitors.cpp index f4bf36e1..cd66fa25 100644 --- a/specialmonitors.cpp +++ b/specialmonitors.cpp @@ -139,7 +139,7 @@ static bool graffiti(struct vidbuffer *src, struct vidbuffer *dst) #if 0 //if (cmd != 0) - write_log(L"X=%d Y=%d %02x = %02x (%d %d)\n", x, y, cmd, parm, color, color2); + write_log(_T("X=%d Y=%d %02x = %02x (%d %d)\n"), x, y, cmd, parm, color, color2); #endif if (automatic && cmd >= 0x40) @@ -226,7 +226,7 @@ static bool graffiti(struct vidbuffer *src, struct vidbuffer *dst) if (monitor != MONITOREMU_GRAFFITI) { monitor = MONITOREMU_GRAFFITI; - write_log (L"GRAFFITI %s mode\n", hires ? L"hires" : L"lores"); + write_log (_T("GRAFFITI %s mode\n"), hires ? _T("hires") : _T("lores")); } return true; @@ -258,7 +258,7 @@ static bool a2024(struct vidbuffer *src, struct vidbuffer *dst) dataline = src->bufmem + (((idline << VRES_MAX) - src->yoffset) / gfxvidinfo.ychange) * src->rowbytes + (((200 << RES_MAX) - src->xoffset) / gfxvidinfo.xchange) * src->pixbytes; #if 0 - write_log (L"%02x%02x%02x %02x%02x%02x %02x%02x%02x %02x%02x%02x\n", + write_log (_T("%02x%02x%02x %02x%02x%02x %02x%02x%02x %02x%02x%02x\n"), dataline[0 * doff + 0], dataline[0 * doff + 1], dataline[0 * doff + 2], dataline[1 * doff + 0], dataline[1 * doff + 1], dataline[1 * doff + 2], dataline[2 * doff + 0], dataline[2 * doff + 1], dataline[2 * doff + 2], @@ -328,13 +328,13 @@ static bool a2024(struct vidbuffer *src, struct vidbuffer *dst) } #if 0 - write_log (L"0 = F6-4:%d INTERLACE:%d\n", f64, interlace); - write_log (L"1 = FN:%d EXPAND:%d\n", py + px *2, expand); - write_log (L"2 = ENP:%d WPB=%d\n", enp, wpb); - write_log (L"3 = DPL:%d LESS16=%d\n", dpl, less16); + write_log (_T("0 = F6-4:%d INTERLACE:%d\n"), f64, interlace); + write_log (_T("1 = FN:%d EXPAND:%d\n"), py + px *2, expand); + write_log (_T("2 = ENP:%d WPB=%d\n"), enp, wpb); + write_log (_T("3 = DPL:%d LESS16=%d\n"), dpl, less16); #endif #if 0 - write_log (L"%02x%02x%02x %02x%02x%02x %02x%02x%02x %02x%02x%02x %dx%d\n", + write_log (_T("%02x%02x%02x %02x%02x%02x %02x%02x%02x %02x%02x%02x %dx%d\n"), dataline[0 * doff + 0], dataline[0 * doff + 1], dataline[0 * doff + 2], dataline[1 * doff + 0], dataline[1 * doff + 1], dataline[1 * doff + 2], dataline[2 * doff + 0], dataline[2 * doff + 1], dataline[2 * doff + 2], @@ -417,7 +417,7 @@ static bool a2024(struct vidbuffer *src, struct vidbuffer *dst) if (monitor != MONITOREMU_A2024) { monitor = MONITOREMU_A2024; - write_log (L"A2024 %dHz %s mode\n", hires ? 10 : 15, ntsc ? L"NTSC" : L"PAL"); + write_log (_T("A2024 %dHz %s mode\n"), hires ? 10 : 15, ntsc ? _T("NTSC") : _T("PAL")); } return true; @@ -448,7 +448,7 @@ bool emulate_specialmonitors(struct vidbuffer *src, struct vidbuffer *dst) if (monitor) { clearmonitor(dst); monitor = 0; - write_log (L"Native mode\n"); + write_log (_T("Native mode\n")); } return false; } diff --git a/traps.cpp b/traps.cpp index 742315b9..580f5fed 100644 --- a/traps.cpp +++ b/traps.cpp @@ -105,7 +105,7 @@ uaecptr find_trap (const TCHAR *name) unsigned int define_trap (TrapHandler handler_func, int flags, const TCHAR *name) { if (trap_count == MAX_TRAPS) { - write_log (L"Ran out of emulator traps\n"); + write_log (_T("Ran out of emulator traps\n")); abort (); return -1; } else { @@ -147,7 +147,7 @@ void REGPARAM2 m68k_handle_trap (unsigned int trap_num) int implicit_rts = (trap->flags & TRAPFLAG_DORET) != 0; if (trap->name && trap->name[0] != 0 && trace_traps) - write_log (L"TRAP: %s\n", trap->name); + write_log (_T("TRAP: %s\n"), trap->name); if (trap_num < trap_count) { if (trap->flags & TRAPFLAG_EXTRA_STACK) { @@ -170,7 +170,7 @@ void REGPARAM2 m68k_handle_trap (unsigned int trap_num) } } } else - write_log (L"Illegal emulator trap\n"); + write_log (_T("Illegal emulator trap\n")); } @@ -475,13 +475,13 @@ void init_traps (void) void init_extended_traps (void) { m68k_call_trapaddr = here (); - calltrap (deftrap2 (m68k_call_handler, TRAPFLAG_NO_RETVAL, L"m68k_call")); + calltrap (deftrap2 (m68k_call_handler, TRAPFLAG_NO_RETVAL, _T("m68k_call"))); m68k_return_trapaddr = here(); - calltrap (deftrap2 (m68k_return_handler, TRAPFLAG_NO_RETVAL, L"m68k_return")); + calltrap (deftrap2 (m68k_return_handler, TRAPFLAG_NO_RETVAL, _T("m68k_return"))); exit_trap_trapaddr = here(); - calltrap (deftrap2 (exit_trap_handler, TRAPFLAG_NO_RETVAL, L"exit_trap")); + calltrap (deftrap2 (exit_trap_handler, TRAPFLAG_NO_RETVAL, _T("exit_trap"))); uae_sem_init (&trap_mutex, 0, 1); } diff --git a/uaeexe.cpp b/uaeexe.cpp index c2b656bf..1914d2b9 100644 --- a/uaeexe.cpp +++ b/uaeexe.cpp @@ -30,7 +30,7 @@ void uaeexe_install (void) loop = here (); org (UAEEXE_ORG); - calltrap (deftrapres (uaeexe_server, 0, L"uaeexe_server")); + calltrap (deftrapres (uaeexe_server, 0, _T("uaeexe_server"))); dw (RTS); org (loop); } @@ -76,7 +76,7 @@ int uaeexe (const TCHAR *cmd) NOMEM: return UAEEXE_NOMEM; NORUN: - write_log (L"Remote cli is not running.\n"); + write_log (_T("Remote cli is not running.\n")); return UAEEXE_NOTRUNNING; } @@ -111,7 +111,7 @@ static uae_u32 REGPARAM2 uaeexe_server (TrapContext *context) if (ARG (0) && !running) { running = 1; - write_log (L"Remote CLI started.\n"); + write_log (_T("Remote CLI started.\n")); } cmd = get_cmd (); @@ -126,7 +126,7 @@ static uae_u32 REGPARAM2 uaeexe_server (TrapContext *context) len = ARG (1); s = ua (cmd); strncpy (dst, s, len); - write_log (L"Sending '%s' to remote cli\n", cmd); + write_log (_T("Sending '%s' to remote cli\n"), cmd); xfree (s); xfree (cmd); return ARG (0); diff --git a/uaeipc.cpp b/uaeipc.cpp index c4b6bc96..0afec9fe 100644 --- a/uaeipc.cpp +++ b/uaeipc.cpp @@ -32,7 +32,7 @@ struct uaeipc static void parsemessage(TCHAR *in, struct uae_prefs *p, TCHAR *out, int outsize) { out[0] = 0; - if (!_tcsncmp (in, L"CFG ", 4) || !_tcsncmp (in, L"EVT ", 4)) { + if (!_tcsncmp (in, _T("CFG "), 4) || !_tcsncmp (in, _T("EVT "), 4)) { TCHAR tmpout[256]; int index = -1; int cnt = 0; @@ -44,8 +44,8 @@ static void parsemessage(TCHAR *in, struct uae_prefs *p, TCHAR *out, int outsize index++; if (_tcslen (tmpout) > 0) { if (_tcslen (out) == 0) - _tcscat (out, L"200 "); - _tcsncat (out, L"\n", outsize); + _tcscat (out, _T("200 ")); + _tcsncat (out, _T("\n"), outsize); _tcsncat (out, tmpout, outsize); } cnt++; @@ -53,9 +53,9 @@ static void parsemessage(TCHAR *in, struct uae_prefs *p, TCHAR *out, int outsize break; } if (_tcslen (out) == 0) - _tcscat (out, L"404"); + _tcscat (out, _T("404")); } else { - _tcscpy (out, L"501"); + _tcscpy (out, _T("501")); } } @@ -67,19 +67,19 @@ static int listenIPC (void *vipc) memset(&ipc->ol, 0, sizeof (OVERLAPPED)); ipc->ol.hEvent = ipc->olevent; if (ConnectNamedPipe(ipc->hipc, &ipc->ol)) { - write_log (L"IPC: ConnectNamedPipe init failed, err=%d\n", GetLastError()); + write_log (_T("IPC: ConnectNamedPipe init failed, err=%d\n"), GetLastError()); closeIPC(ipc); return 0; } err = GetLastError(); if (err == ERROR_PIPE_CONNECTED) { if (SetEvent(ipc->olevent)) { - write_log (L"IPC: ConnectNamedPipe SetEvent failed, err=%d\n", GetLastError()); + write_log (_T("IPC: ConnectNamedPipe SetEvent failed, err=%d\n"), GetLastError()); closeIPC(ipc); return 0; } } else if (err != ERROR_IO_PENDING) { - write_log (L"IPC: ConnectNamedPipe failed, err=%d\n", err); + write_log (_T("IPC: ConnectNamedPipe failed, err=%d\n"), err); closeIPC(ipc); return 0; } @@ -92,7 +92,7 @@ static void disconnectIPC (void *vipc) ipc->readpending = ipc->writepending = FALSE; if (ipc->connected) { if (!DisconnectNamedPipe(ipc->hipc)) - write_log (L"IPC: DisconnectNamedPipe failed, err=%d\n", GetLastError()); + write_log (_T("IPC: DisconnectNamedPipe failed, err=%d\n"), GetLastError()); ipc->connected = FALSE; } } @@ -133,10 +133,10 @@ void *createIPC (const TCHAR *name, int binary) ipc->olevent = INVALID_HANDLE_VALUE; ipc->binary = 1; while (cnt < 10) { - _stprintf (tmpname, L"\\\\.\\pipe\\%s", name); + _stprintf (tmpname, _T("\\\\.\\pipe\\%s"), name); if (cnt > 0) { TCHAR *p = tmpname + _tcslen (tmpname); - _stprintf (p, L"_%d", cnt); + _stprintf (p, _T("_%d"), cnt); } ipc->hipc = CreateNamedPipe (tmpname, PIPE_ACCESS_DUPLEX | FILE_FLAG_OVERLAPPED | FILE_FLAG_FIRST_PIPE_INSTANCE, @@ -153,7 +153,7 @@ void *createIPC (const TCHAR *name, int binary) } break; } - write_log (L"IPC: Named Pipe '%s' open\n", tmpname); + write_log (_T("IPC: Named Pipe '%s' open\n"), tmpname); ipc->olevent = CreateEvent(NULL, TRUE, TRUE, NULL); if (listenIPC(ipc)) return ipc; @@ -218,7 +218,7 @@ int checkIPC (void *vipc, struct uae_prefs *p) xfree (ipc->outmsg[ipc->outmessages--]); err = GetLastError (); if (!ok && err != ERROR_IO_PENDING) { - write_log (L"IPC: WriteFile() err=%d\n", err); + write_log (_T("IPC: WriteFile() err=%d\n"), err); resetIPC (ipc); return 0; } @@ -231,12 +231,12 @@ int checkIPC (void *vipc, struct uae_prefs *p) err = GetLastError (); if (err == ERROR_IO_INCOMPLETE) return 0; - write_log (L"IPC: GetOverlappedResult error %d\n", err); + write_log (_T("IPC: GetOverlappedResult error %d\n"), err); resetIPC (ipc); return 0; } if (!ipc->connected) { - write_log (L"IPC: Pipe connected\n"); + write_log (_T("IPC: Pipe connected\n")); ipc->connected = TRUE; return 0; } @@ -256,9 +256,9 @@ int checkIPC (void *vipc, struct uae_prefs *p) ipc->readpending = TRUE; return 0; } else if (err == ERROR_BROKEN_PIPE) { - write_log (L"IPC: IPC client disconnected\n"); + write_log (_T("IPC: IPC client disconnected\n")); } else { - write_log (L"IPC: ReadFile() err=%d\n", err); + write_log (_T("IPC: ReadFile() err=%d\n"), err); } resetIPC (ipc); return 0; @@ -268,14 +268,14 @@ int checkIPC (void *vipc, struct uae_prefs *p) if (ipc->binary) { } else { - write_log (L"IPC: got message '%s'\n", ipc->buffer); + write_log (_T("IPC: got message '%s'\n"), ipc->buffer); parsemessage ((TCHAR*)ipc->buffer, p, (TCHAR*)ipc->outbuf, sizeof ipc->outbuf); memset (&ipc->ol, 0, sizeof (OVERLAPPED)); ipc->ol.hEvent = ipc->olevent; ok = WriteFile (ipc->hipc, ipc->outbuf, strlen ((char*)ipc->outbuf) + 1, &ret, &ipc->ol); err = GetLastError (); if (!ok && err != ERROR_IO_PENDING) { - write_log (L"IPC: WriteFile() err=%d\n", err); + write_log (_T("IPC: WriteFile() err=%d\n"), err); resetIPC (ipc); return 0; } diff --git a/uaelib.cpp b/uaelib.cpp index 0f04fc15..cd119438 100644 --- a/uaelib.cpp +++ b/uaelib.cpp @@ -135,7 +135,7 @@ static uae_u32 REGPARAM2 emulib_ChgCMemSize (uae_u32 memsize) if (memsize != 0x80000 && memsize != 0x100000 && memsize != 0x200000) { memsize = 0x200000; - write_log (L"Unsupported chipmem size!\n"); + write_log (_T("Unsupported chipmem size!\n")); } m68k_dreg (regs, 0) = 0; @@ -153,7 +153,7 @@ static uae_u32 REGPARAM2 emulib_ChgSMemSize (uae_u32 memsize) if (memsize != 0x80000 && memsize != 0x100000 && memsize != 0x180000 && memsize != 0x1C0000) { memsize = 0; - write_log (L"Unsupported bogomem size!\n"); + write_log (_T("Unsupported bogomem size!\n")); } m68k_dreg (regs, 0) = 0; @@ -171,7 +171,7 @@ static uae_u32 REGPARAM2 emulib_ChgFMemSize (uae_u32 memsize) if (memsize != 0x100000 && memsize != 0x200000 && memsize != 0x400000 && memsize != 0x800000) { memsize = 0; - write_log (L"Unsupported fastmem size!\n"); + write_log (_T("Unsupported fastmem size!\n")); } m68k_dreg (regs, 0) = 0; changed_prefs.fastmem_size = memsize; @@ -410,7 +410,7 @@ static uae_u32 REGPARAM2 uaelib_demux2 (TrapContext *context) case 86: if (valid_address (ARG1, 1)) { TCHAR *s = au ((char*)get_real_address (ARG1)); - write_log (L"DBG: %s\n", s); + write_log (_T("DBG: %s\n"), s); xfree (s); return 1; } @@ -434,13 +434,13 @@ static uae_u32 REGPARAM2 uaelib_demux (TrapContext *context) struct regstruct *r = ®s; if (uaelib_debug) - write_log (L"%d: %08x %08x %08x %08x %08x %08x %08x %08x, %08x %08x %08x %08x %08x %08x %08x %08x\n", + write_log (_T("%d: %08x %08x %08x %08x %08x %08x %08x %08x, %08x %08x %08x %08x %08x %08x %08x %08x\n"), ARG0, r->regs[0],r->regs[1],r->regs[2],r->regs[3],r->regs[4],r->regs[5],r->regs[6],r->regs[7], r->regs[8],r->regs[9],r->regs[10],r->regs[11],r->regs[12],r->regs[13],r->regs[14],r->regs[15]); v = uaelib_demux2 (context); if (uaelib_debug) - write_log (L"=%08x\n", v); + write_log (_T("=%08x\n"), v); return v; } @@ -460,7 +460,7 @@ void emulib_install (void) dw ((rtarea_base >> 16) | get_word (rtarea_base + 36)); dw (get_word (rtarea_base + 38) + 12); #endif - calltrap (deftrapres (uaelib_demux, 0, L"uaelib_demux")); + calltrap (deftrapres (uaelib_demux, 0, _T("uaelib_demux"))); dw (RTS); org (a); } diff --git a/uaeresource.cpp b/uaeresource.cpp index 9c39fb9a..2268b7cc 100644 --- a/uaeresource.cpp +++ b/uaeresource.cpp @@ -88,8 +88,8 @@ void uaeres_install (void) uae_u32 initcode, getfunc; TCHAR tmp[100]; - _stprintf (tmp, L"UAE resource %d.%d.%d", UAEMAJOR, UAEMINOR, UAESUBREV); - res_name = ds (L"uae.resource"); + _stprintf (tmp, _T("UAE resource %d.%d.%d"), UAEMAJOR, UAEMINOR, UAESUBREV); + res_name = ds (_T("uae.resource")); res_id = ds (tmp); /* initcode */ diff --git a/uaeserial.cpp b/uaeserial.cpp index 441bcc78..89bef6cd 100644 --- a/uaeserial.cpp +++ b/uaeserial.cpp @@ -133,13 +133,13 @@ static uae_sem_t change_sem, async_sem; static TCHAR *getdevname (void) { - return L"uaeserial.device"; + return _T("uaeserial.device"); } static void io_log (TCHAR *msg, uaecptr request) { if (log_uaeserial) - write_log (L"%s: %08X %d %08X %d %d io_actual=%d io_error=%d\n", + write_log (_T("%s: %08X %d %08X %d %d io_actual=%d io_error=%d\n"), msg, request, get_word (request + 28), get_long (request + 40), get_long (request + 36), get_long (request + 44), get_long (request + 32), get_byte (request + 31)); @@ -160,7 +160,7 @@ static int start_thread (struct devstruct *dev) { init_comm_pipe (&dev->requests, 100, 1); uae_sem_init (&dev->sync_sem, 0, 0); - uae_start_thread (L"uaeserial", dev_thread, dev, NULL); + uae_start_thread (_T("uaeserial"), dev_thread, dev, NULL); uae_sem_wait (&dev->sync_sem); return dev->thread_running; } @@ -182,7 +182,7 @@ static uae_u32 REGPARAM2 dev_close (TrapContext *context) if (!dev) return 0; if (log_uaeserial) - write_log (L"%s:%d close, req=%x\n", getdevname(), dev->unit, request); + write_log (_T("%s:%d close, req=%x\n"), getdevname(), dev->unit, request); dev_close_3 (dev); put_long (request + 24, 0); put_word (m68k_areg (regs, 6) + 32, get_word (m68k_areg (regs, 6) + 32) - 1); @@ -213,13 +213,13 @@ static int setparams (struct devstruct *dev, uaecptr req) rbuffer = get_long (req + io_RBufLen); v = get_long (req + io_ExtFlags); if (v) { - write_log (L"UAESER: io_ExtFlags=%08x, not supported\n", v); + write_log (_T("UAESER: io_ExtFlags=%08x, not supported\n"), v); return 5; } baud = get_long (req + io_Baud); v = get_byte (req + io_SerFlags); if (v & SERF_EOFMODE) { - write_log (L"UAESER: SERF_EOFMODE not supported\n"); + write_log (_T("UAESER: SERF_EOFMODE not supported\n")); return 5; } xonxoff = (v & SERF_XDISABLED) ? 0 : 1; @@ -234,16 +234,16 @@ static int setparams (struct devstruct *dev, uaecptr req) wbits = get_byte (req + io_WriteLen); sbits = get_byte (req + io_StopBits); if ((rbits != 7 && rbits != 8) || (wbits != 7 && wbits != 8) || (sbits != 1 && sbits != 2) || rbits != wbits) { - write_log (L"UAESER: Read=%d, Write=%d, Stop=%d, not supported\n", rbits, wbits, sbits); + write_log (_T("UAESER: Read=%d, Write=%d, Stop=%d, not supported\n"), rbits, wbits, sbits); return 5; } - write_log (L"%s:%d BAUD=%d BUF=%d BITS=%d+%d RTSCTS=%d PAR=%d XO=%06X\n", + write_log (_T("%s:%d BAUD=%d BUF=%d BITS=%d+%d RTSCTS=%d PAR=%d XO=%06X\n"), getdevname(), dev->unit, baud, rbuffer, rbits, sbits, rtscts, parity, xonxoff); v = uaeser_setparams (dev->sysdata, baud, rbuffer, rbits, sbits, rtscts, parity, xonxoff); if (v) { - write_log (L"->failed\n"); + write_log (_T("->failed\n")); return v; } return 0; @@ -296,7 +296,7 @@ static uae_u32 REGPARAM2 dev_open (TrapContext *context) return openfail (ioreq, err); } if (log_uaeserial) - write_log (L"%s:%d open ioreq=%08X\n", getdevname(), unit, ioreq); + write_log (_T("%s:%d open ioreq=%08X\n"), getdevname(), unit, ioreq); start_thread (dev); put_word (m68k_areg (regs, 6) + 32, get_word (m68k_areg (regs, 6) + 32) + 1); @@ -334,7 +334,7 @@ static int add_async_request (struct devstruct *dev, uaecptr request) struct asyncreq *ar, *ar2; if (log_uaeserial) - write_log (L"%s:%d async request %x added\n", getdevname(), dev->unit, request); + write_log (_T("%s:%d async request %x added\n"), getdevname(), dev->unit, request); uae_sem_wait (&async_sem); ar = xcalloc (struct asyncreq, 1); @@ -367,14 +367,14 @@ static int release_async_request (struct devstruct *dev, uaecptr request) uae_sem_post (&async_sem); xfree (ar); if (log_uaeserial) - write_log (L"%s:%d async request %x removed\n", getdevname(), dev->unit, request); + write_log (_T("%s:%d async request %x removed\n"), getdevname(), dev->unit, request); return 1; } prevar = ar; ar = ar->next; } uae_sem_post (&async_sem); - write_log (L"%s:%d async request %x not found for removal!\n", getdevname(), dev->unit, request); + write_log (_T("%s:%d async request %x not found for removal!\n"), getdevname(), dev->unit, request); return 0; } @@ -382,11 +382,11 @@ static void abort_async (struct devstruct *dev, uaecptr request) { struct asyncreq *ar = get_async_request (dev, request, 1); if (!ar) { - write_log (L"%s:%d: abort async but no request %x found!\n", getdevname(), dev->unit, request); + write_log (_T("%s:%d: abort async but no request %x found!\n"), getdevname(), dev->unit, request); return; } if (log_uaeserial) - write_log (L"%s:%d asyncronous request=%08X aborted\n", getdevname(), dev->unit, request); + write_log (_T("%s:%d asyncronous request=%08X aborted\n"), getdevname(), dev->unit, request); put_byte (request + 31, IOERR_ABORTED); put_byte (request + 30, get_byte (request + 30) | 0x20); write_comm_pipe_u32 (&dev->requests, request, 1); @@ -452,13 +452,13 @@ void uaeser_signal (void *vdev, int sigmask) } break; default: - write_log (L"%s:%d incorrect async request %x (cmd=%d) signaled?!", getdevname(), dev->unit, request, command); + write_log (_T("%s:%d incorrect async request %x (cmd=%d) signaled?!"), getdevname(), dev->unit, request, command); break; } if (io_done) { if (log_uaeserial) - write_log (L"%s:%d async request %x completed\n", getdevname(), dev->unit, request); + write_log (_T("%s:%d async request %x completed\n"), getdevname(), dev->unit, request); put_long (request + 32, io_actual); put_byte (request + 31, io_error); ar->ready = 1; @@ -502,7 +502,7 @@ static int dev_do_io (struct devstruct *dev, uaecptr request, int quick) if (!dev) return 0; command = get_word (request + 28); - io_log (L"dev_io_START",request); + io_log (_T("dev_io_START"),request); switch (command) { @@ -552,7 +552,7 @@ static int dev_do_io (struct devstruct *dev, uaecptr request, int quick) } put_long (request + 32, io_actual); put_byte (request + 31, io_error); - io_log (L"dev_io_END",request); + io_log (_T("dev_io_END"),request); return async; } @@ -576,7 +576,7 @@ static uae_u32 REGPARAM2 dev_beginio (TrapContext *context) put_byte (request + 31, 0); if ((flags & 1) && dev_canquick (dev, request)) { if (dev_do_io (dev, request, 1)) - write_log (L"device %s:%d command %d bug with IO_QUICK\n", getdevname(), dev->unit, command); + write_log (_T("device %s:%d command %d bug with IO_QUICK\n"), getdevname(), dev->unit, command); return get_byte (request + 31); } else { put_byte (request + 30, get_byte (request + 30) & ~1); @@ -618,7 +618,7 @@ static uae_u32 REGPARAM2 dev_init (TrapContext *context) { uae_u32 base = m68k_dreg (regs, 0); if (log_uaeserial) - write_log (L"%s init\n", getdevname ()); + write_log (_T("%s init\n"), getdevname ()); return base; } @@ -661,7 +661,7 @@ uaecptr uaeserialdev_startup (uaecptr resaddr) if (!currprefs.uaeserial) return resaddr; if (log_uaeserial) - write_log (L"uaeserialdev_startup(0x%x)\n", resaddr); + write_log (_T("uaeserialdev_startup(0x%x)\n"), resaddr); /* Build a struct Resident. This will set up and initialize * the serial.device */ put_word (resaddr + 0x0, 0x4AFC); @@ -686,8 +686,8 @@ void uaeserialdev_install (void) if (!currprefs.uaeserial) return; - ROM_uaeserialdev_resname = ds (L"uaeserial.device"); - ROM_uaeserialdev_resid = ds (L"UAE serial.device 0.1"); + ROM_uaeserialdev_resname = ds (_T("uaeserial.device")); + ROM_uaeserialdev_resid = ds (_T("UAE serial.device 0.1")); /* initcode */ initcode = here (); diff --git a/uaeunp.cpp b/uaeunp.cpp index 0c0dabac..e2bac91d 100644 --- a/uaeunp.cpp +++ b/uaeunp.cpp @@ -104,10 +104,10 @@ static void geterror (void) TCHAR *err = zfile_geterror (); if (!err) return; - _tprintf (L"%s\n", err); + _tprintf (_T("%s\n"), err); } -static const TCHAR *prots = L"HSPARWED"; +static const TCHAR *prots = _T("HSPARWED"); struct arcdir { TCHAR *name; @@ -152,32 +152,32 @@ static void dolist (struct arcdir **filelist, struct arcdir *adp, int entries, i } protflags[j] = 0; } else { - _tcscpy (protflags, L"--------"); + _tcscpy (protflags, _T("--------")); } if (ad->dt > 0) { dt = _gmtime64 (&ad->dt); - _tcsftime (dates, sizeof (dates) / sizeof (TCHAR), L"%Y/%m/%d %H:%M:%S", dt); + _tcsftime (dates, sizeof (dates) / sizeof (TCHAR), _T("%Y/%m/%d %H:%M:%S"), dt); } else { - _tcscpy (dates, L"-------------------"); + _tcscpy (dates, _T("-------------------")); } for (j = 0; j < level; j++) - _tprintf (L" "); + _tprintf (_T(" ")); if (ad->iscrc > 0) - _stprintf (crcs, L"%08X", ad->crc32); + _stprintf (crcs, _T("%08X"), ad->crc32); else if (ad->iscrc < 0) - _tcscpy (crcs, L"????????"); + _tcscpy (crcs, _T("????????")); else - _tcscpy (crcs, L"--------"); + _tcscpy (crcs, _T("--------")); if (ad->isdir > 0) - _tprintf (L" [DIR] %s %s %s\n", protflags, dates, ad->name); + _tprintf (_T(" [DIR] %s %s %s\n"), protflags, dates, ad->name); else if (ad->isdir < 0) - _tprintf (L" [VDIR] %s %s %s\n", protflags, dates, ad->name); + _tprintf (_T(" [VDIR] %s %s %s\n"), protflags, dates, ad->name); else - _tprintf (L"%10I64d %s %s %s %s\n", ad->size, protflags, dates, crcs, ad->name); + _tprintf (_T("%10I64d %s %s %s %s\n"), ad->size, protflags, dates, crcs, ad->name); if (ad->comment) - _tprintf (L" \"%s\"\n", ad->comment); + _tprintf (_T(" \"%s\"\n"), ad->comment); if (ad->nextlevel >= 0) { level++; dolist (filelist, adp, entries, ad - adp, level); @@ -212,17 +212,17 @@ static int unlist2 (struct arcdir *adp, const TCHAR *src, int all) zv = zfile_fopen_archive_root (src, ZFD_ALL); if (zv == NULL) { geterror(); - _tprintf (L"Couldn't open archive '%s'\n", src); + _tprintf (_T("Couldn't open archive '%s'\n"), src); return 0; } h = zfile_opendir_archive (src); if (!h) { _tcscpy (p, src); - _tcscat (p, L".DIR"); + _tcscat (p, _T(".DIR")); h = zfile_opendir_archive (src); if (!h) { geterror(); - _tprintf (L"Couldn't open directory '%s'\n", src); + _tprintf (_T("Couldn't open directory '%s'\n"), src); return 0; } } @@ -328,20 +328,20 @@ static int docrclist (const TCHAR *src) TCHAR path[MAX_DPATH]; _tcscpy (path, src); - _tcscat (path, L"\\*.*"); + _tcscat (path, _T("\\*.*")); h = FindFirstFile (path, &ffd); while (h) { if (ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { - if (!_tcscmp (ffd.cFileName, L".") || !_tcscmp (ffd.cFileName, L"..")) + if (!_tcscmp (ffd.cFileName, _T(".")) || !_tcscmp (ffd.cFileName, _T(".."))) goto next; _tcscpy (path, src); - _tcscat (path, L"\\"); + _tcscat (path, _T("\\")); _tcscat (path, ffd.cFileName); docrclist (path); } else { TCHAR path2[MAX_DPATH]; _tcscpy (path, src); - _tcscat (path, L"\\"); + _tcscat (path, _T("\\")); _tcscat (path, ffd.cFileName); GetFullPathName (path, MAX_DPATH, path2, NULL); resetlist (); @@ -380,13 +380,13 @@ static int unpack (const TCHAR *src, const TCHAR *filename, const TCHAR *dst, in zv = zfile_fopen_archive_root (src, ZFD_ALL); if (zv == NULL) { geterror(); - _tprintf (L"Couldn't open archive '%s'\n", src); + _tprintf (_T("Couldn't open archive '%s'\n"), src); return 0; } h = zfile_opendir_archive (src); if (!h) { geterror(); - _tprintf (L"Couldn't open directory '%s'\n", src); + _tprintf (_T("Couldn't open directory '%s'\n"), src); return 0; } while (zfile_readdir_archive (h, fn)) { @@ -400,7 +400,7 @@ static int unpack (const TCHAR *src, const TCHAR *filename, const TCHAR *dst, in _tcscat (tmp, sep); _tcscat (tmp, fn); if (!zfile_stat_archive (tmp, &st)) { - _tprintf (L"Couldn't stat '%s'\n", tmp); + _tprintf (_T("Couldn't stat '%s'\n"), tmp); continue; } if (dst == NULL || all) @@ -417,14 +417,14 @@ static int unpack (const TCHAR *src, const TCHAR *filename, const TCHAR *dst, in setdate (dst, st.st_mtime); continue; } - _tprintf (L"Directory extraction not yet supported\n"); + _tprintf (_T("Directory extraction not yet supported\n")); return 0; } s = zfile_open_archive (tmp, ZFD_ARCHIVE | ZFD_NORECURSE); if (!s) { geterror(); - _tprintf (L"Couldn't open '%s' for reading\n", src); + _tprintf (_T("Couldn't open '%s' for reading\n"), src); continue; } zfile_fseek (s, 0, SEEK_END); @@ -434,14 +434,14 @@ static int unpack (const TCHAR *src, const TCHAR *filename, const TCHAR *dst, in if (b) { if (zfile_fread (b, size, 1, s) == 1) { if (out) { - _tprintf (L"\n"); + _tprintf (_T("\n")); fwrite (b, size, 1, stdout); } else { - d = zfile_fopen (dst, L"wb", 0); + d = zfile_fopen (dst, _T("wb"), 0); if (d) { if (zfile_fwrite (b, size, 1, d) == 1) { ret = 1; - _tprintf (L"%s extracted, %d bytes\n", dst, size); + _tprintf (_T("%s extracted, %d bytes\n"), dst, size); } zfile_fclose (d); setdate (dst, st.st_mtime); @@ -458,9 +458,9 @@ static int unpack (const TCHAR *src, const TCHAR *filename, const TCHAR *dst, in geterror (); if (!found && !level) { if (filename[0]) - _tprintf (L"'%s' not found\n", filename); + _tprintf (_T("'%s' not found\n"), filename); else - _tprintf (L"nothing extracted\n"); + _tprintf (_T("nothing extracted\n")); } return ret; } @@ -478,13 +478,13 @@ static int unpack2 (const TCHAR *src, const TCHAR *match, int level) zv = zfile_fopen_archive_root (src, ZFD_ALL); if (zv == NULL) { geterror(); - _tprintf (L"Couldn't open archive '%s'\n", src); + _tprintf (_T("Couldn't open archive '%s'\n"), src); return 0; } h = zfile_opendir_archive (src); if (!h) { geterror(); - _tprintf (L"Couldn't open directory '%s'\n", src); + _tprintf (_T("Couldn't open directory '%s'\n"), src); return 0; } while (zfile_readdir_archive (h, fn)) { @@ -498,7 +498,7 @@ static int unpack2 (const TCHAR *src, const TCHAR *match, int level) _tcscat (tmp, fn); zfile_fill_file_attrs_archive (tmp, &isdir, &flags, NULL); if (isdir) { - TCHAR *p = _tcsstr (fn, L".DIR"); + TCHAR *p = _tcsstr (fn, _T(".DIR")); if (isdir == ZNODE_VDIR && p && _tcslen (p) == 4) { p[0] = 0; if (pattern_match (fn, match)) @@ -520,7 +520,7 @@ static int unpack2 (const TCHAR *src, const TCHAR *match, int level) s = zfile_open_archive (tmp, ZFD_NORECURSE); if (!s) { geterror(); - _tprintf (L"Couldn't open '%s' for reading\n", tmp); + _tprintf (_T("Couldn't open '%s' for reading\n"), tmp); continue; } zfile_fseek (s, 0, SEEK_END); @@ -529,11 +529,11 @@ static int unpack2 (const TCHAR *src, const TCHAR *match, int level) b = xcalloc (uae_u8, size); if (b) { if (zfile_fread (b, size, 1, s) == 1) { - d = zfile_fopen (dst, L"wb", 0); + d = zfile_fopen (dst, _T("wb"), 0); if (d) { if (zfile_fwrite (b, size, 1, d) == 1) { ret = 1; - _tprintf (L"%s extracted, %d bytes\n", dst, size); + _tprintf (_T("%s extracted, %d bytes\n"), dst, size); } zfile_fclose (d); setdate (dst, st.st_mtime); @@ -546,7 +546,7 @@ static int unpack2 (const TCHAR *src, const TCHAR *match, int level) } geterror (); if (!found && !level) { - _tprintf (L"'%s' not matched\n", match); + _tprintf (_T("'%s' not matched\n"), match); } return ret; } @@ -560,13 +560,13 @@ static int scanpath (TCHAR *src, TCHAR *outpath) zv = zfile_fopen_archive_root (src, ZFD_ALL | ZFD_NORECURSE); if (zv == NULL) { geterror(); - _tprintf (L"Couldn't open archive '%s'\n", src); + _tprintf (_T("Couldn't open archive '%s'\n"), src); return 0; } h = zfile_opendir_archive (src); if (!h) { geterror(); - _tprintf (L"Couldn't open directory '%s'\n", src); + _tprintf (_T("Couldn't open directory '%s'\n"), src); return 0; } while (zfile_readdir_archive (h, fn)) { @@ -602,47 +602,47 @@ int __cdecl wmain (int argc, wchar_t *argv[], wchar_t *envp[]) resetlist (); for (i = 0; i < argc && i < 32; i++) { - if (!_tcsicmp (argv[i], L"-crclist")) { + if (!_tcsicmp (argv[i], _T("-crclist"))) { crclist = 1; used[i] = 1; } - if (!_tcsicmp (argv[i], L"o")) { + if (!_tcsicmp (argv[i], _T("o"))) { out = 1; used[i] = 1; } - if (!_tcsicmp (argv[i], L"-o")) { + if (!_tcsicmp (argv[i], _T("-o"))) { out = 1; used[i] = 1; } - if (!_tcsicmp (argv[i], L"l")) { + if (!_tcsicmp (argv[i], _T("l"))) { list = 1; used[i] = 1; } - if (!_tcsicmp (argv[i], L"-l")) { + if (!_tcsicmp (argv[i], _T("-l"))) { list = 1; used[i] = 1; } - if (!_tcsicmp (argv[i], L"x")) { + if (!_tcsicmp (argv[i], _T("x"))) { xtract = 1; used[i] = 1; } - if (!_tcsicmp (argv[i], L"-x")) { + if (!_tcsicmp (argv[i], _T("-x"))) { xtract = 1; used[i] = 1; } - if (!_tcsicmp (argv[i], L"e")) { + if (!_tcsicmp (argv[i], _T("e"))) { extract = 1; used[i] = 1; } - if (!_tcsicmp (argv[i], L"-e")) { + if (!_tcsicmp (argv[i], _T("-e"))) { extract = 1; used[i] = 1; } - if (!_tcsicmp (argv[i], L"*")) { + if (!_tcsicmp (argv[i], _T("*"))) { all = 1; used[i] = 1; } - if (!_tcsicmp (argv[i], L"**")) { + if (!_tcsicmp (argv[i], _T("**"))) { all = -1; used[i] = 1; } @@ -679,13 +679,13 @@ int __cdecl wmain (int argc, wchar_t *argv[], wchar_t *envp[]) // scanpath (tmppath, path); if (crclist) { - docrclist (L"."); + docrclist (_T(".")); ok = 1; } else if (!list && match) { unpack2 (path, match, 0); ok = 1; } else if (!list && !parm2 && all > 0) { - unpack2 (path, L"*", 0); + unpack2 (path, _T("*"), 0); ok = 1; } else if (!list && extract && parm2) { unpack2 (path, parm2, 0); @@ -701,24 +701,24 @@ int __cdecl wmain (int argc, wchar_t *argv[], wchar_t *envp[]) ok = 1; } if (!ok) { - _tprintf (L"UAE unpacker uaeunp 0.8e by Toni Wilen (c)2011\n"); - _tprintf (L"\n"); - _tprintf (L"List: \"uaeunp (-l) \"\n"); - _tprintf (L"List all recursively: \"uaeunp -l **\"\n"); - _tprintf (L"Extract to file: \"uaeunp (-x) []\"\n"); - _tprintf (L"Extract all (single directory): \"uaeunp (-x) *\"\n"); - _tprintf (L"Extract all (recursively): \"uaeunp (-x) **\"\n"); - _tprintf (L"Extract all (recursively, current dir): \"uaeunp -e \"\n"); - _tprintf (L"Output to console: \"uaeunp (-x) -o \"\n"); - _tprintf (L"\n"); - _tprintf (L"Supported disk image formats:\n"); - _tprintf (L" ADF, HDF (VHD), DMS, encrypted DMS, IPF, FDI, DSQ, WRP\n"); - _tprintf (L"Supported filesystems:\n"); - _tprintf (L" OFS, FFS, SFS, SFS2 and FAT12\n"); - _tprintf (L"Supported archive formats:\n"); - _tprintf (L" 7ZIP, LHA, LZX, RAR (unrar.dll), TAR, ZIP, ArchiveAccess.DLL\n"); - _tprintf (L"Miscellaneous formats:\n"); - _tprintf (L" RDB partition table, GZIP, XZ\n"); + _tprintf (_T("UAE unpacker uaeunp 0.8e by Toni Wilen (c)2011\n")); + _tprintf (_T("\n")); + _tprintf (_T("List: \"uaeunp (-l) \"\n")); + _tprintf (_T("List all recursively: \"uaeunp -l **\"\n")); + _tprintf (_T("Extract to file: \"uaeunp (-x) []\"\n")); + _tprintf (_T("Extract all (single directory): \"uaeunp (-x) *\"\n")); + _tprintf (_T("Extract all (recursively): \"uaeunp (-x) **\"\n")); + _tprintf (_T("Extract all (recursively, current dir): \"uaeunp -e \"\n")); + _tprintf (_T("Output to console: \"uaeunp (-x) -o \"\n")); + _tprintf (_T("\n")); + _tprintf (_T("Supported disk image formats:\n")); + _tprintf (_T(" ADF, HDF (VHD), DMS, encrypted DMS, IPF, FDI, DSQ, WRP\n")); + _tprintf (_T("Supported filesystems:\n")); + _tprintf (_T(" OFS, FFS, SFS, SFS2 and FAT12\n")); + _tprintf (_T("Supported archive formats:\n")); + _tprintf (_T(" 7ZIP, LHA, LZX, RAR (unrar.dll), TAR, ZIP, ArchiveAccess.DLL\n")); + _tprintf (_T("Miscellaneous formats:\n")); + _tprintf (_T(" RDB partition table, GZIP, XZ\n")); } return 0; } diff --git a/zfile.cpp b/zfile.cpp index 5d72178b..77c63eb0 100644 --- a/zfile.cpp +++ b/zfile.cpp @@ -31,7 +31,7 @@ static struct zfile *zlist = 0; -const TCHAR *uae_archive_extensions[] = { L"zip", L"rar", L"7z", L"lha", L"lzh", L"lzx", L"tar", NULL }; +const TCHAR *uae_archive_extensions[] = { _T("zip"), _T("rar"), _T("7z"), _T("lha"), _T("lzh"), _T("lzx"), _T("tar"), NULL }; #define MAX_CACHE_ENTRIES 10 @@ -129,7 +129,7 @@ static void zcache_check (void) zc = zc->next; cnt++; } - write_log (L"CACHE: %d\n", cnt); + write_log (_T("CACHE: %d\n"), cnt); if (cnt >= MAX_CACHE_ENTRIES && last) zcache_free (last); } @@ -178,7 +178,7 @@ static void zfile_free (struct zfile *f) fclose (f->f); if (f->deleteafterclose) { _wunlink (f->name); - write_log (L"deleted temporary file '%s'\n", f->name); + write_log (_T("deleted temporary file '%s'\n"), f->name); } xfree (f->name); xfree (f->data); @@ -198,11 +198,11 @@ void zfile_exit (void) void zfile_fclose (struct zfile *f) { - //write_log (L"%p\n", f); + //write_log (_T("%p\n"), f); if (!f) return; if (f->opencnt < 0) { - write_log (L"zfile: tried to free already closed filehandle!\n"); + write_log (_T("zfile: tried to free already closed filehandle!\n")); return; } f->opencnt--; @@ -223,7 +223,7 @@ void zfile_fclose (struct zfile *f) struct zfile *l = zlist; while (l != f) { if (l == 0) { - write_log (L"zfile: tried to free already freed or nonexisting filehandle!\n"); + write_log (_T("zfile: tried to free already freed or nonexisting filehandle!\n")); return; } pl = l; @@ -260,7 +260,7 @@ static bool checkwrite (struct zfile *zf, int *retcode) static uae_u8 exeheader[]={ 0x00,0x00,0x03,0xf3,0x00,0x00,0x00,0x00 }; -static TCHAR *diskimages[] = { L"adf", L"adz", L"ipf", L"fdi", L"dms", L"wrp", L"dsq", 0 }; +static TCHAR *diskimages[] = { _T("adf"), _T("adz"), _T("ipf"), _T("fdi"), _T("dms"), _T("wrp"), _T("dsq"), 0 }; int zfile_gettype (struct zfile *z) { @@ -277,19 +277,19 @@ int zfile_gettype (struct zfile *z) if (strcasecmp (ext, diskimages[i]) == 0) return ZFILE_DISKIMAGE; } - if (strcasecmp (ext, L"roz") == 0) + if (strcasecmp (ext, _T("roz")) == 0) return ZFILE_ROM; - if (strcasecmp (ext, L"uss") == 0) + if (strcasecmp (ext, _T("uss")) == 0) return ZFILE_STATEFILE; - if (strcasecmp (ext, L"rom") == 0) + if (strcasecmp (ext, _T("rom")) == 0) return ZFILE_ROM; - if (strcasecmp (ext, L"key") == 0) + if (strcasecmp (ext, _T("key")) == 0) return ZFILE_KEY; - if (strcasecmp (ext, L"nvr") == 0) + if (strcasecmp (ext, _T("nvr")) == 0) return ZFILE_NVR; - if (strcasecmp (ext, L"uae") == 0) + if (strcasecmp (ext, _T("uae")) == 0) return ZFILE_CONFIGURATION; - if (strcasecmp (ext, L"cue") == 0 || strcasecmp (ext, L"iso") == 0 || strcasecmp (ext, L"ccd") == 0 || strcasecmp (ext, L"mds") == 0) + if (strcasecmp (ext, _T("cue")) == 0 || strcasecmp (ext, _T("iso")) == 0 || strcasecmp (ext, _T("ccd")) == 0 || strcasecmp (ext, _T("mds")) == 0) return ZFILE_CDIMAGE; } memset (buf, 0, sizeof (buf)); @@ -306,9 +306,9 @@ int zfile_gettype (struct zfile *z) return ZFILE_HDF; } if (ext != NULL) { - if (strcasecmp (ext, L"hdf") == 0) + if (strcasecmp (ext, _T("hdf")) == 0) return ZFILE_HDF; - if (strcasecmp (ext, L"hdz") == 0) + if (strcasecmp (ext, _T("hdz")) == 0) return ZFILE_HDF; } return ZFILE_UNKNOWN; @@ -359,7 +359,7 @@ static uae_u64 vhd_fread2 (struct zfile *zf, void *dataptrv, uae_u64 offset, uae struct zfile_vhd *zvhd = (struct zfile_vhd*)zf->userdata; uae_u8 *dataptr = (uae_u8*)dataptrv; - //write_log (L"%08x %08x\n", (uae_u32)offset, (uae_u32)len); + //write_log (_T("%08x %08x\n"), (uae_u32)offset, (uae_u32)len); read = 0; if (offset & 511) return read; @@ -381,7 +381,7 @@ static uae_u64 vhd_fread2 (struct zfile *zf, void *dataptrv, uae_u64 offset, uae sectormapblock = sectoroffset * 512 + (bitmapoffsetbytes & ~511); if (zvhd->vhd_sectormapblock != sectormapblock) { // read sector bitmap - //write_log (L"BM %08x\n", sectormapblock); + //write_log (_T("BM %08x\n"), sectormapblock); zfile_fseek (zp, sectormapblock, SEEK_SET); if (zfile_fread (zvhd->vhd_sectormap, 1, 512, zp) != 512) return read; @@ -391,7 +391,7 @@ static uae_u64 vhd_fread2 (struct zfile *zf, void *dataptrv, uae_u64 offset, uae if (zvhd->vhd_sectormap[bitmapoffsetbytes & 511] & (1 << (7 - (bitmapoffsetbits & 7)))) { // read data block int block = sectoroffset * 512 + zvhd->vhd_bitmapsize + bitmapoffsetbits * 512; - //write_log (L"DB %08x\n", block); + //write_log (_T("DB %08x\n"), block); zfile_fseek (zp, block, SEEK_SET); if (zfile_fread (dataptr, 1, 512, zp) != 512) return read; @@ -508,9 +508,9 @@ static struct zfile *vhd (struct zfile *z) z->dataseek = 1; z->userdata = zvhd; z->zfileread = vhd_fread; - write_log (L"%s is VHD %s image, virtual size=%dK\n", + write_log (_T("%s is VHD %s image, virtual size=%dK\n"), zfile_getname (z), - zvhd->vhd_type == 2 ? L"fixed" : L"dynamic", + zvhd->vhd_type == 2 ? _T("fixed") : _T("dynamic"), zvhd->virtsize / 1024); return z; nonvhd: @@ -566,7 +566,7 @@ static struct zfile *zfile_gunzip (struct zfile *z, int *retcode) zfile_fread (&b, 1, 1, z); } while (b); } - removeext (name, L".gz"); + removeext (name, _T(".gz")); offset = zfile_ftell (z); zfile_fseek (z, -4, SEEK_END); zfile_fread (&b, 1, 1, z); @@ -660,12 +660,12 @@ static struct zfile *extadf (struct zfile *z, int index, int *retcode) _tcscpy (newname, zfile_getname (z)); ext = _tcsrchr (newname, '.'); if (ext) { - _tcscpy (newname + _tcslen (newname) - _tcslen (ext), L".std.adf"); + _tcscpy (newname + _tcslen (newname) - _tcslen (ext), _T(".std.adf")); } else { - _tcscat (newname, L".std.adf"); + _tcscat (newname, _T(".std.adf")); } if (index > 0) - _tcscpy (newname + _tcslen (newname) - 4, L".ima"); + _tcscpy (newname + _tcslen (newname) - 4, _T(".ima")); zo = zfile_fopen_empty (z, newname, 0); if (!zo) @@ -693,7 +693,7 @@ static struct zfile *extadf (struct zfile *z, int index, int *retcode) if (index == 0) { r = isamigatrack (amigamfmbuffer, (uae_u8*)mfm, len, outbuf, writebuffer_ok, i, &outsize); if (r < 0 && i == 0) { - zfile_seterror (L"'%s' is not AmigaDOS formatted", zo->name); + zfile_seterror (_T("'%s' is not AmigaDOS formatted"), zo->name); goto end; } if (i == 0) @@ -701,7 +701,7 @@ static struct zfile *extadf (struct zfile *z, int index, int *retcode) } else { r = ispctrack (amigamfmbuffer, (uae_u8*)mfm, len, outbuf, writebuffer_ok, i, &outsize); if (r < 0 && i == 0) { - zfile_seterror (L"'%s' is not PC formatted", zo->name); + zfile_seterror (_T("'%s' is not PC formatted"), zo->name); goto end; } if (i == 0) @@ -791,14 +791,14 @@ static struct zfile *fdi (struct zfile *z, int index, int *retcode) tracks = zc->zd->tracks; if (ext) { _tcscpy (newname, orgname); - _tcscpy (newname + _tcslen (newname) - _tcslen (ext), L".adf"); + _tcscpy (newname + _tcslen (newname) - _tcslen (ext), _T(".adf")); } else { - _tcscat (newname, L".adf"); + _tcscat (newname, _T(".adf")); } if (index == 1) - _tcscpy (newname + _tcslen (newname) - 4, L".ima"); + _tcscpy (newname + _tcslen (newname) - 4, _T(".ima")); if (index == 2) - _tcscpy (newname + _tcslen (newname) - 4, L".ext.adf"); + _tcscpy (newname + _tcslen (newname) - 4, _T(".ext.adf")); zo = zfile_fopen_empty (z, newname, 0); if (!zo) goto end; @@ -824,14 +824,14 @@ static struct zfile *fdi (struct zfile *z, int index, int *retcode) if (index == 0) { r = isamigatrack (amigamfmbuffer, p, len, outbuf, writebuffer_ok, i, &outsize); if (r < 0 && i == 0) { - zfile_seterror (L"'%s' is not AmigaDOS formatted", orgname); + zfile_seterror (_T("'%s' is not AmigaDOS formatted"), orgname); goto end; } zfile_fwrite (outbuf, outsize, 1, zo); } else if (index == 1) { r = ispctrack (amigamfmbuffer, p, len, outbuf, writebuffer_ok, i, &outsize); if (r < 0 && i == 0) { - zfile_seterror (L"'%s' is not PC formatted", orgname); + zfile_seterror (_T("'%s' is not PC formatted"), orgname); goto end; } zfile_fwrite (outbuf, outsize, 1, zo); @@ -902,7 +902,7 @@ static struct zfile *ipf (struct zfile *z, int index, int *retcode) uae_u8 *buf, *p; int mrev, gapo; caps_loadtrack (mfm, NULL, 0, i, &len, &mrev, &gapo); - //write_log (L"%d: %d %d %d\n", i, mrev, gapo, len); + //write_log (_T("%d: %d %d %d\n"), i, mrev, gapo, len); len /= 8; buf = p = xmalloc (uae_u8, len); for (j = 0; j < len / 2; j++) { @@ -921,14 +921,14 @@ static struct zfile *ipf (struct zfile *z, int index, int *retcode) amigamfmbuffer = xcalloc (uae_u16, 32000 / 2); if (ext) { _tcscpy (newname, orgname); - _tcscpy (newname + _tcslen (newname) - _tcslen (ext), L".adf"); + _tcscpy (newname + _tcslen (newname) - _tcslen (ext), _T(".adf")); } else { - _tcscat (newname, L".adf"); + _tcscat (newname, _T(".adf")); } if (index == 1) - _tcscpy (newname + _tcslen (newname) - 4, L".ima"); + _tcscpy (newname + _tcslen (newname) - 4, _T(".ima")); if (index == 2) - _tcscpy (newname + _tcslen (newname) - 4, L".ext.adf"); + _tcscpy (newname + _tcslen (newname) - 4, _T(".ext.adf")); zo = zfile_fopen_empty (z, newname, 0); if (!zo) @@ -960,14 +960,14 @@ static struct zfile *ipf (struct zfile *z, int index, int *retcode) if (index == 0) { r = isamigatrack (amigamfmbuffer, p, len, outbuf, writebuffer_ok, i, &outsize); if (r < 0 && i == 0) { - zfile_seterror (L"'%s' is not AmigaDOS formatted", orgname); + zfile_seterror (_T("'%s' is not AmigaDOS formatted"), orgname); goto end; } zfile_fwrite (outbuf, 1, outsize, zo); } else if (index == 1) { r = ispctrack (amigamfmbuffer, p, len, outbuf, writebuffer_ok, i, &outsize); if (r < 0 && i == 0) { - zfile_seterror (L"'%s' is not PC formatted", orgname); + zfile_seterror (_T("'%s' is not PC formatted"), orgname); goto end; } zfile_fwrite (outbuf, outsize, 1, zo); @@ -1041,7 +1041,7 @@ static struct zfile *dsq (struct zfile *z, int lzx, int *retcode) bitmap = &buf[off]; off += (blocks + 7) / 8; } else if (buf[off - 1] > 1) { - write_log (L"unknown DSQ extra header type %d\n", buf[off - 1]); + write_log (_T("unknown DSQ extra header type %d\n"), buf[off - 1]); } } else { off = 32; @@ -1053,9 +1053,9 @@ static struct zfile *dsq (struct zfile *z, int lzx, int *retcode) if (zfile_getfilename (zi) && _tcslen (zfile_getfilename (zi))) { fn = xmalloc (TCHAR, (_tcslen (zfile_getfilename (zi)) + 5)); _tcscpy (fn, zfile_getfilename (zi)); - _tcscat (fn, L".adf"); + _tcscat (fn, _T(".adf")); } else { - fn = my_strdup (L"dsq.adf"); + fn = my_strdup (_T("dsq.adf")); } zo = zfile_fopen_empty (z, fn, size); xfree (fn); @@ -1201,9 +1201,9 @@ static struct zfile *dms (struct zfile *z, int index, int *retcode) return NULL; if (ext) { _tcscpy (newname, orgname); - _tcscpy (newname + _tcslen (newname) - _tcslen (ext), L".adf"); + _tcscpy (newname + _tcslen (newname) - _tcslen (ext), _T(".adf")); } else { - _tcscat (newname, L".adf"); + _tcscat (newname, _T(".adf")); } zo = zfile_fopen_empty (z, newname, 1760 * 512); @@ -1215,12 +1215,12 @@ static struct zfile *dms (struct zfile *z, int index, int *retcode) if (off >= 1760 * 512 / 3 && off <= 1760 * 512 * 3 / 4) { // possible split dms? if (_tcslen (orgname) > 5) { TCHAR *s = orgname + _tcslen (orgname) - 5; - if (!_tcsicmp (s, L"a.dms")) { + if (!_tcsicmp (s, _T("a.dms"))) { TCHAR *fn2 = my_strdup (orgname); struct zfile *z2; fn2[_tcslen (fn2) - 5]++; recursive++; - z2 = zfile_fopen (fn2, L"rb", z->zfdmask); + z2 = zfile_fopen (fn2, _T("rb"), z->zfdmask); recursive--; if (z2) { ret = DMS_Process_File (z2, zo, CMD_UNPACK, OPT_VERBOSE, 0, 0, 1, NULL); @@ -1256,9 +1256,9 @@ end: } const TCHAR *uae_ignoreextensions[] = -{ L".gif", L".jpg", L".png", L".xml", L".pdf", L".txt", 0 }; +{ _T(".gif"), _T(".jpg"), _T(".png"), _T(".xml"), _T(".pdf"), _T(".txt"), 0 }; const TCHAR *uae_diskimageextensions[] = -{ L".adf", L".adz", L".ipf", L".fdi", L".exe", L".dms", L".wrp", L".dsq", 0 }; +{ _T(".adf"), _T(".adz"), _T(".ipf"), _T(".fdi"), _T(".exe"), _T(".dms"), _T(".wrp"), _T(".dsq"), 0 }; int zfile_is_ignore_ext (const TCHAR *name) { @@ -1288,19 +1288,19 @@ int zfile_is_diskimage (const TCHAR *name) return HISTORY_FLOPPY; i++; } - if (!_tcsicmp (ext, L".cue")) + if (!_tcsicmp (ext, _T(".cue"))) return HISTORY_CD; return -1; } static const TCHAR *archive_extensions[] = { - L"7z", L"rar", L"zip", L"lha", L"lzh", L"lzx", - L"adf", L"adz", L"dsq", L"dms", L"ipf", L"fdi", L"wrp", L"ima", - L"hdf", L"tar", + _T("7z"), _T("rar"), _T("zip"), _T("lha"), _T("lzh"), _T("lzx"), + _T("adf"), _T("adz"), _T("dsq"), _T("dms"), _T("ipf"), _T("fdi"), _T("wrp"), _T("ima"), + _T("hdf"), _T("tar"), NULL }; -static const TCHAR *plugins_7z[] = { L"7z", L"rar", L"zip", L"lha", L"lzh", L"lzx", L"adf", L"dsq", L"hdf", L"tar", NULL }; +static const TCHAR *plugins_7z[] = { _T("7z"), _T("rar"), _T("zip"), _T("lha"), _T("lzh"), _T("lzx"), _T("adf"), _T("dsq"), _T("hdf"), _T("tar"), NULL }; static const uae_char *plugins_7z_x[] = { "7z", "Rar!", "MK", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; static const int plugins_7z_t[] = { ArchiveFormat7Zip, ArchiveFormatRAR, ArchiveFormatZIP, ArchiveFormatLHA, ArchiveFormatLHA, ArchiveFormatLZX, @@ -1326,49 +1326,49 @@ int iszip (struct zfile *z, int mask) zfile_fseek (z, 0, SEEK_SET); if (mask & ZFD_ARCHIVE) { - if (!strcasecmp (ext, L".zip") || !strcasecmp (ext, L".rp9")) { + if (!strcasecmp (ext, _T(".zip")) || !strcasecmp (ext, _T(".rp9"))) { if (header[0] == 'P' && header[1] == 'K') return ArchiveFormatZIP; return 0; } } if (mask & ZFD_ARCHIVE) { - if (!strcasecmp (ext, L".7z")) { + if (!strcasecmp (ext, _T(".7z"))) { if (header[0] == '7' && header[1] == 'z') return ArchiveFormat7Zip; return 0; } - if (!strcasecmp (ext, L".rar")) { + if (!strcasecmp (ext, _T(".rar"))) { if (header[0] == 'R' && header[1] == 'a' && header[2] == 'r' && header[3] == '!') return ArchiveFormatRAR; return 0; } - if (!strcasecmp (ext, L".lha") || !strcasecmp (ext, L".lzh")) { + if (!strcasecmp (ext, _T(".lha")) || !strcasecmp (ext, _T(".lzh"))) { if (header[2] == '-' && header[3] == 'l' && header[4] == 'h' && header[6] == '-') return ArchiveFormatLHA; return 0; } - if (!strcasecmp (ext, L".lzx")) { + if (!strcasecmp (ext, _T(".lzx"))) { if (header[0] == 'L' && header[1] == 'Z' && header[2] == 'X') return ArchiveFormatLZX; return 0; } } if (mask & ZFD_ADF) { - if (!strcasecmp (ext, L".adf")) { + if (!strcasecmp (ext, _T(".adf"))) { if (header[0] == 'D' && header[1] == 'O' && header[2] == 'S' && (header[3] >= 0 && header[3] <= 7)) return ArchiveFormatADF; if (isfat (header)) return ArchiveFormatFAT; return 0; } - if (!strcasecmp (ext, L".ima")) { + if (!strcasecmp (ext, _T(".ima"))) { if (isfat (header)) return ArchiveFormatFAT; } } if (mask & ZFD_HD) { - if (!strcasecmp (ext, L".hdf")) { + if (!strcasecmp (ext, _T(".hdf"))) { if (header[0] == 'D' && header[1] == 'O' && header[2] == 'S' && (header[3] >= 0 && header[3] <= 7)) return ArchiveFormatADF; if (header[0] == 'S' && header[1] == 'F' && header[2] == 'S') @@ -1413,43 +1413,43 @@ struct zfile *zuncompress (struct znode *parent, struct zfile *z, int dodefault, if (ext != NULL) { if (mask & ZFD_ARCHIVE) { - if (strcasecmp (ext, L"7z") == 0) + if (strcasecmp (ext, _T("7z")) == 0) return archive_access_select (parent, z, ArchiveFormat7Zip, dodefault, retcode, index); - if (strcasecmp (ext, L"zip") == 0) + if (strcasecmp (ext, _T("zip")) == 0) return archive_access_select (parent, z, ArchiveFormatZIP, dodefault, retcode, index); - if (strcasecmp (ext, L"lha") == 0 || strcasecmp (ext, L"lzh") == 0) + if (strcasecmp (ext, _T("lha")) == 0 || strcasecmp (ext, _T("lzh")) == 0) return archive_access_select (parent, z, ArchiveFormatLHA, dodefault, retcode, index); - if (strcasecmp (ext, L"lzx") == 0) + if (strcasecmp (ext, _T("lzx")) == 0) return archive_access_select (parent, z, ArchiveFormatLZX, dodefault, retcode, index); - if (strcasecmp (ext, L"rar") == 0) + if (strcasecmp (ext, _T("rar")) == 0) return archive_access_select (parent, z, ArchiveFormatRAR, dodefault, retcode, index); - if (strcasecmp (ext, L"tar") == 0) + if (strcasecmp (ext, _T("tar")) == 0) return archive_access_select (parent, z, ArchiveFormatTAR, dodefault, retcode, index); } if (mask & ZFD_UNPACK) { if (index == 0) { - if (strcasecmp (ext, L"gz") == 0) + if (strcasecmp (ext, _T("gz")) == 0) return zfile_gunzip (z, retcode); - if (strcasecmp (ext, L"adz") == 0) + if (strcasecmp (ext, _T("adz")) == 0) return zfile_gunzip (z, retcode); - if (strcasecmp (ext, L"roz") == 0) + if (strcasecmp (ext, _T("roz")) == 0) return zfile_gunzip (z, retcode); - if (strcasecmp (ext, L"hdz") == 0) + if (strcasecmp (ext, _T("hdz")) == 0) return zfile_gunzip (z, retcode); - if (strcasecmp (ext, L"wrp") == 0) + if (strcasecmp (ext, _T("wrp")) == 0) return wrp (z, retcode); - if (strcasecmp (ext, L"xz") == 0) + if (strcasecmp (ext, _T("xz")) == 0) return xz (z, retcode); } - if (strcasecmp (ext, L"dms") == 0) + if (strcasecmp (ext, _T("dms")) == 0) return dms (z, index, retcode); } if (mask & ZFD_RAWDISK) { #ifdef CAPS - if (strcasecmp (ext, L"ipf") == 0) + if (strcasecmp (ext, _T("ipf")) == 0) return ipf (z, index, retcode); #endif - if (strcasecmp (ext, L"fdi") == 0) + if (strcasecmp (ext, _T("fdi")) == 0) return fdi (z, index, retcode); if (mask & (ZFD_RAWDISK_PC | ZFD_RAWDISK_AMIGA)) return NULL; @@ -1517,11 +1517,11 @@ struct zfile *zuncompress (struct znode *parent, struct zfile *z, int dodefault, if (ext) { if (mask & ZFD_UNPACK) { - if (strcasecmp (ext, L"dsq") == 0) + if (strcasecmp (ext, _T("dsq")) == 0) return dsq (z, 1, retcode); } if (mask & ZFD_ADF) { - if (strcasecmp (ext, L"adf") == 0 && !memcmp (header, "DOS", 3)) + if (strcasecmp (ext, _T("adf")) == 0 && !memcmp (header, "DOS", 3)) return archive_access_select (parent, z, ArchiveFormatADF, dodefault, retcode, index); } } @@ -1544,7 +1544,7 @@ static struct zfile *zfile_opensinglefile(struct zfile *l) s--; if (s > tmp) s++; - write_log (L"loading from singlefile: '%s'\n", tmp); + write_log (_T("loading from singlefile: '%s'\n"), tmp); while (*p++); offset = (p[0] << 24)|(p[1] << 16)|(p[2] << 8)|(p[3] << 0); p += 4; @@ -1555,14 +1555,14 @@ static struct zfile *zfile_opensinglefile(struct zfile *l) if (!strcmpi (tmp, p + 4)) { l->data = singlefile_data + offset; l->size = size; - write_log (L"found, size %d\n", size); + write_log (_T("found, size %d\n"), size); return l; } offset += size; p += 4; p += _tcslen (p) + 1; } - write_log (L"not found\n"); + write_log (_T("not found\n")); return 0; } #endif @@ -1603,7 +1603,7 @@ static struct zfile *openzip (const TCHAR *pname) for (j = 0; plugins_7z[j]; j++) { int len = _tcslen (plugins_7z[j]); if (name[i - len - 1] == '.' && !strcasecmp (name + i - len, plugins_7z[j])) { - struct zfile *f = zfile_fopen_nozip (name, L"rb"); + struct zfile *f = zfile_fopen_nozip (name, _T("rb")); if (f) { f->zipname = my_strdup (name + i + 1); return f; @@ -1653,7 +1653,7 @@ static struct zfile *zfile_fopen_2 (const TCHAR *name, const TCHAR *mode, int ma l->mode = my_strdup (mode); l->name = my_strdup (name); l->zfdmask = mask; - if (!_tcsicmp (mode, L"r")) { + if (!_tcsicmp (mode, _T("r"))) { f = my_opentext (l->name); l->textmode = 1; } else { @@ -1673,7 +1673,7 @@ static struct zfile *zfile_fopen_2 (const TCHAR *name, const TCHAR *mode, int ma #ifdef _WIN32 #include "win32.h" -#define AF L"%AMIGAFOREVERDATA%" +#define AF _T("%AMIGAFOREVERDATA%") static void manglefilename (TCHAR *out, const TCHAR *in) { @@ -1708,7 +1708,7 @@ int zfile_zopen (const TCHAR *name, zfile_callback zc, void *user) TCHAR path[MAX_DPATH]; manglefilename (path, name); - l = zfile_fopen_2 (path, L"rb", ZFD_NORMAL); + l = zfile_fopen_2 (path, _T("rb"), ZFD_NORMAL); if (!l) return 0; ztype = iszip (l); @@ -1759,9 +1759,9 @@ static struct zfile *zfile_fopen_x (const TCHAR *name, const TCHAR *mode, int ma #ifdef _WIN32 static int isinternetfile (const TCHAR *name) { - if (!_tcsnicmp (name, L"http://", 7) || !_tcsnicmp (name, L"https://", 8)) + if (!_tcsnicmp (name, _T("http://"), 7) || !_tcsnicmp (name, _T("https://"), 8)) return 1; - if (!_tcsnicmp (name, L"ftp://", 6)) + if (!_tcsnicmp (name, _T("ftp://"), 6)) return -1; return 0; } @@ -1786,7 +1786,7 @@ static struct zfile *zfile_fopen_internet (const TCHAR *name, const TCHAR *mode, if (!hi) { hi = InternetOpen (WINUAEAPPNAME, INTERNET_OPEN_TYPE_PRECONFIG_WITH_NO_AUTOPROXY, NULL, NULL, 0); if (hi == NULL) { - write_log (L"InternetOpen() failed, %d\n", GetLastError ()); + write_log (_T("InternetOpen() failed, %d\n"), GetLastError ()); return NULL; } } @@ -1795,7 +1795,7 @@ static struct zfile *zfile_fopen_internet (const TCHAR *name, const TCHAR *mode, DWORD err = GetLastError (); if (err == ERROR_INTERNET_EXTENDED_ERROR) InternetGetLastResponseInfo (&ierr, tmp, &outbuf); - write_log (L"InternetOpenUrl(%s) failed %d (%d,%s)\n", name, err, ierr, tmp); + write_log (_T("InternetOpenUrl(%s) failed %d (%d,%s)\n"), name, err, ierr, tmp); goto end; } @@ -1805,11 +1805,11 @@ static struct zfile *zfile_fopen_internet (const TCHAR *name, const TCHAR *mode, DWORD size = sizeof statuscode; if (!HttpQueryInfo (i, HTTP_QUERY_STATUS_CODE | HTTP_QUERY_FLAG_NUMBER, &statuscode, &size, &hindex)) { DWORD err = GetLastError (); - write_log (L"HttpQueryInfo(%s) failed %d\n", name, err); + write_log (_T("HttpQueryInfo(%s) failed %d\n"), name, err); goto end; } if (statuscode != 200) { - write_log (L"HttpQueryInfo(%s)=%d\n", name, statuscode); + write_log (_T("HttpQueryInfo(%s)=%d\n"), name, statuscode); goto end; } } @@ -1826,7 +1826,7 @@ static struct zfile *zfile_fopen_internet (const TCHAR *name, const TCHAR *mode, DWORD err = GetLastError (); if (err == ERROR_INTERNET_EXTENDED_ERROR) InternetGetLastResponseInfo (&ierr, tmp, &outbuf); - write_log (L"InternetReadFile(%s) failed %d (%d,%s)\n", name, err, ierr, tmp); + write_log (_T("InternetReadFile(%s) failed %d (%d,%s)\n"), name, err, ierr, tmp); break; } if (didread == 0) @@ -1903,9 +1903,9 @@ static struct zfile *zfile_fopenx2 (const TCHAR *name, const TCHAR *mode, int ma static struct zfile *zfile_fopenx (const TCHAR *name, const TCHAR *mode, int mask, int index) { struct zfile *zf; - //write_log (L"zfile_fopen('%s','%s',%08x,%d)\n", name, mode, mask, index); + //write_log (_T("zfile_fopen('%s','%s',%08x,%d)\n"), name, mode, mask, index); zf = zfile_fopenx2 (name, mode, mask, index); - //write_log (L"=%p\n", zf); + //write_log (_T("=%p\n"), zf); return zf; } @@ -1968,7 +1968,7 @@ int zfile_exists (const TCHAR *name) if (my_existsfile (name)) return 1; - z = zfile_fopen (name, L"rb", ZFD_NORMAL | ZFD_CHECKONLY); + z = zfile_fopen (name, _T("rb"), ZFD_NORMAL | ZFD_CHECKONLY); if (!z) return 0; zfile_fclose (z); @@ -1984,7 +1984,7 @@ struct zfile *zfile_fopen_empty (struct zfile *prev, const TCHAR *name, uae_u64 { struct zfile *l; l = zfile_create (prev); - l->name = name ? my_strdup (name) : L""; + l->name = name ? my_strdup (name) : _T(""); if (size) { l->data = xcalloc (uae_u8, size); if (!l->data) { @@ -2037,7 +2037,7 @@ struct zfile *zfile_fopen_data (const TCHAR *name, uae_u64 size, const uae_u8 *d struct zfile *l; l = zfile_create (NULL); - l->name = name ? my_strdup (name) : L""; + l->name = name ? my_strdup (name) : _T(""); l->data = xmalloc (uae_u8, size); l->size = size; l->datasize = size; @@ -2184,7 +2184,7 @@ size_t zfile_fwrite (void *b, size_t l1, size_t l2, struct zfile *z) if (z->data) { int off = z->seek + l1 * l2; if (z->allocsize == 0) { - write_log (L"zfile_fwrite(data,%s) but allocsize=0!\n", z->name); + write_log (_T("zfile_fwrite(data,%s) but allocsize=0!\n"), z->name); return 0; } if (off > z->allocsize) { @@ -2475,7 +2475,7 @@ static struct znode *znode_alloc (struct znode *parent, const TCHAR *name) _tcscat (fullpath, FSDB_DIR_SEPARATOR_S); _tcscat (fullpath, tmpname); #ifdef ZFILE_DEBUG - write_log (L"znode_alloc vol='%s' parent='%s' name='%s'\n", parent->volume->root.name, parent->name, name); + write_log (_T("znode_alloc vol='%s' parent='%s' name='%s'\n"), parent->volume->root.name, parent->name, name); #endif zn->fullname = my_strdup (fullpath); zn->name = my_strdup (tmpname); @@ -2549,7 +2549,7 @@ static struct zvolume *zvolume_alloc_2 (const TCHAR *name, struct zfile *z, unsi root->volume = zv; root->type = ZNODE_DIR; i = 0; - if (name[0] != '/' && name[0] != '\\' && _tcsncmp (name, L".\\", 2) != 0) { + if (name[0] != '/' && name[0] != '\\' && _tcsncmp (name, _T(".\\"), 2) != 0) { if (_tcschr (name, ':') == 0) { for (i = _tcslen (name) - 1; i > 0; i--) { if (name[i] == FSDB_DIR_SEPARATOR) { @@ -2562,7 +2562,7 @@ static struct zvolume *zvolume_alloc_2 (const TCHAR *name, struct zfile *z, unsi root->name = my_strdup (name + i); root->fullname = my_strdup (name); #ifdef ZFILE_DEBUG - write_log (L"created zvolume: '%s' (%s)\n", root->name, root->fullname); + write_log (_T("created zvolume: '%s' (%s)\n"), root->name, root->fullname); #endif if (volname) zv->volumename = my_strdup (volname); @@ -2625,25 +2625,25 @@ static struct zvolume *zfile_fopen_archive_ext (struct znode *parent, struct zfi if (ext != NULL) { ext++; if (flags & ZFD_ARCHIVE) { - if (strcasecmp (ext, L"lha") == 0 || strcasecmp (ext, L"lzh") == 0) + if (strcasecmp (ext, _T("lha")) == 0 || strcasecmp (ext, _T("lzh")) == 0) zv = archive_directory_lha (zf); - if (strcasecmp (ext, L"zip") == 0) + if (strcasecmp (ext, _T("zip")) == 0) zv = archive_directory_zip (zf); - if (strcasecmp (ext, L"7z") == 0) + if (strcasecmp (ext, _T("7z")) == 0) zv = archive_directory_7z (zf); - if (strcasecmp (ext, L"lzx") == 0) + if (strcasecmp (ext, _T("lzx")) == 0) zv = archive_directory_lzx (zf); - if (strcasecmp (ext, L"rar") == 0) + if (strcasecmp (ext, _T("rar")) == 0) zv = archive_directory_rar (zf); - if (strcasecmp (ext, L"tar") == 0) + if (strcasecmp (ext, _T("tar")) == 0) zv = archive_directory_tar (zf); } if (flags & ZFD_ADF) { - if (strcasecmp (ext, L"adf") == 0 && !memcmp (header, "DOS", 3)) + if (strcasecmp (ext, _T("adf")) == 0 && !memcmp (header, "DOS", 3)) zv = archive_directory_adf (parent, zf); } if (flags & ZFD_HD) { - if (strcasecmp (ext, L"hdf") == 0) { + if (strcasecmp (ext, _T("hdf")) == 0) { if (!memcmp (header, "RDSK", 4)) zv = archive_directory_rdb (zf); else @@ -2694,7 +2694,7 @@ static void zfile_fopen_archive_recurse2 (struct zvolume *zv, struct znode *zn, struct znode *zndir; TCHAR tmp[MAX_DPATH]; - _stprintf (tmp, L"%s.DIR", zn->fullname + _tcslen (zv->root.name) + 1); + _stprintf (tmp, _T("%s.DIR"), zn->fullname + _tcslen (zv->root.name) + 1); zndir = get_znode (zv, tmp, TRUE); if (!zndir) { struct zarchive_info zai = { 0 }; @@ -2751,7 +2751,7 @@ static struct zvolume *prepare_recursive_volume (struct zvolume *zv, const TCHAR int done = 0; #ifdef ZFILE_DEBUG - write_log (L"unpacking '%s'\n", path); + write_log (_T("unpacking '%s'\n"), path); #endif zf = zfile_open_archive (path, 0); if (!zf) @@ -2802,7 +2802,7 @@ static struct zvolume *prepare_recursive_volume (struct zvolume *zv, const TCHAR zfile_fclose_archive (zv); return zvnew; end: - write_log (L"unpack '%s' failed\n", path); + write_log (_T("unpack '%s' failed\n"), path); zfile_fclose_archive (zvnew); zfile_fclose (zf); return NULL; @@ -2836,11 +2836,11 @@ static struct znode *get_znode (struct zvolume *zv, const TCHAR *ppath, int recu newpath[0] = 0; recurparent (newpath, zn, recurse); #ifdef ZFILE_DEBUG - write_log (L"'%s'\n", newpath); + write_log (_T("'%s'\n"), newpath); #endif zvdeep = prepare_recursive_volume (zvdeep, newpath, ZFD_ALL); if (!zvdeep) { - write_log (L"failed to unpack '%s'\n", newpath); + write_log (_T("failed to unpack '%s'\n"), newpath); return NULL; } /* replace dummy empty volume with real volume */ @@ -2967,10 +2967,10 @@ struct zvolume *zfile_fopen_directory (const TCHAR *dirname) TCHAR fullname[MAX_DPATH]; struct _stat64 statbuf; struct zarchive_info zai = { 0 }; - if (!_tcscmp (fname, L".") || !_tcscmp (fname, L"..")) + if (!_tcscmp (fname, _T(".")) || !_tcscmp (fname, _T(".."))) continue; _tcscpy (fullname, dirname); - _tcscat (fullname, L"\\"); + _tcscat (fullname, _T("\\")); _tcscat (fullname, fname); if (stat (fullname, &statbuf) == -1) continue; @@ -2995,7 +2995,7 @@ struct zvolume *zfile_fopen_directory (const TCHAR *dirname) struct zvolume *zfile_fopen_archive (const TCHAR *filename, int flags) { struct zvolume *zv = NULL; - struct zfile *zf = zfile_fopen_nozip (filename, L"rb"); + struct zfile *zf = zfile_fopen_nozip (filename, _T("rb")); if (!zf) return NULL; @@ -3218,7 +3218,7 @@ int zfile_readdir_archive (struct zdirectory *zd, TCHAR *out, bool fullpath) return zd->cnt; if (fullpath) { _tcscpy (out, zd->parentpath); - _tcscat (out, L"\\"); + _tcscat (out, _T("\\")); } _tcscat (out, zd->filenames[zd->offset]); zd->offset++; @@ -3329,7 +3329,7 @@ int zfile_exists_archive (const TCHAR *path, const TCHAR *rel) struct zvolume *zv; struct znode *zn; - _stprintf (tmp, L"%s%c%s", path, FSDB_DIR_SEPARATOR, rel); + _stprintf (tmp, _T("%s%c%s"), path, FSDB_DIR_SEPARATOR, rel); zv = get_zvolume (tmp); zn = get_znode (zv, tmp, TRUE); return zn ? 1 : 0; @@ -3340,7 +3340,7 @@ int zfile_convertimage (const TCHAR *src, const TCHAR *dst) struct zfile *s, *d; int ret = 0; - s = zfile_fopen (src, L"rb", ZFD_NORMAL); + s = zfile_fopen (src, _T("rb"), ZFD_NORMAL); if (s) { uae_u8 *b; int size; @@ -3350,7 +3350,7 @@ int zfile_convertimage (const TCHAR *src, const TCHAR *dst) b = xcalloc (uae_u8, size); if (b) { if (zfile_fread (b, size, 1, s) == 1) { - d = zfile_fopen (dst, L"wb", 0); + d = zfile_fopen (dst, _T("wb"), 0); if (d) { if (zfile_fwrite (b, size, 1, d) == 1) ret = 1; diff --git a/zfile_archive.cpp b/zfile_archive.cpp index 80aa30a6..b5006caa 100644 --- a/zfile_archive.cpp +++ b/zfile_archive.cpp @@ -161,15 +161,15 @@ struct zfile *archive_access_select (struct znode *parent, struct zfile *zf, uns int whf = 1; int ft = 0; if (mask & ZFD_CD) { - if (ext && !_tcsicmp (ext, L".iso")) { + if (ext && !_tcsicmp (ext, _T(".iso"))) { whf = 2; ft = ZFILE_CDIMAGE; } - if (ext && !_tcsicmp (ext, L".ccd")) { + if (ext && !_tcsicmp (ext, _T(".ccd"))) { whf = 9; ft = ZFILE_CDIMAGE; } - if (ext && !_tcsicmp (ext, L".cue")) { + if (ext && !_tcsicmp (ext, _T(".cue"))) { whf = 10; ft = ZFILE_CDIMAGE; } @@ -434,22 +434,22 @@ static struct zfile *archive_do_zip (struct znode *zn, struct zfile *z, int flag if (z) { int err = -1; if (!(flags & FILE_DELAYEDOPEN) || z->size <= PEEK_BYTES) { - unpack_log (L"ZIP: unpacking %s, flags=%d\n", name, flags); + unpack_log (_T("ZIP: unpacking %s, flags=%d\n"), name, flags); err = unzReadCurrentFile (uz, z->data, z->datasize); - unpack_log (L"ZIP: unpacked, code=%d\n", err); + unpack_log (_T("ZIP: unpacked, code=%d\n"), err); } else { z->archiveparent = zfile_dup (zn->volume->archive); if (z->archiveparent) { - unpack_log (L"ZIP: delayed open '%s'\n", name); + unpack_log (_T("ZIP: delayed open '%s'\n"), name); xfree (z->archiveparent->name); z->archiveparent->name = my_strdup (tmp); z->datasize = PEEK_BYTES; err = unzReadCurrentFile (uz, z->data, z->datasize); - unpack_log (L"ZIP: unpacked, code=%d\n", err); + unpack_log (_T("ZIP: unpacked, code=%d\n"), err); } else { - unpack_log (L"ZIP: unpacking %s (failed DELAYEDOPEN)\n", name); + unpack_log (_T("ZIP: unpacking %s (failed DELAYEDOPEN)\n"), name); err = unzReadCurrentFile (uz, z->data, z->datasize); - unpack_log (L"ZIP: unpacked, code=%d\n", err); + unpack_log (_T("ZIP: unpacked, code=%d\n"), err); } } } @@ -570,7 +570,7 @@ struct zvolume *archive_directory_7z (struct zfile *z) SzArEx_Init (&ctx->db); res = SzArEx_Open (&ctx->db, &ctx->lookStream.s, &allocImp, &allocTempImp); if (res != SZ_OK) { - write_log (L"7Z: SzArchiveOpen %s returned %d\n", zfile_getname (z), res); + write_log (_T("7Z: SzArchiveOpen %s returned %d\n"), zfile_getname (z), res); xfree (ctx); return NULL; } @@ -621,7 +621,7 @@ static struct zfile *archive_access_7z (struct znode *zn) z = zfile_fopen_empty (NULL, zn->fullname, zn->size); zfile_fwrite (ctx->outBuffer + offset, zn->size, 1, z); } else { - write_log (L"7Z: SzExtract %s returned %d\n", zn->fullname, res); + write_log (_T("7Z: SzExtract %s returned %d\n"), zn->fullname, res); } return z; } @@ -656,7 +656,7 @@ static int canrar (void) { HMODULE rarlib; - rarlib = WIN32_LoadLibrary (L"unrar.dll"); + rarlib = WIN32_LoadLibrary (_T("unrar.dll")); if (rarlib) { TCHAR tmp[MAX_DPATH]; tmp[0] = 0; @@ -672,9 +672,9 @@ static int canrar (void) israr = 1; if (pRARGetDllVersion) version = pRARGetDllVersion (); - write_log (L"%s version %08X detected\n", tmp, version); + write_log (_T("%s version %08X detected\n"), tmp, version); if (version < 4) { - write_log (L"Too old unrar.dll, must be at least version 4\n"); + write_log (_T("Too old unrar.dll, must be at least version 4\n")); israr = -1; } @@ -836,9 +836,9 @@ static int arcacc_init (struct zfile *zf) { if (arcacc_mod) return 1; - arcacc_mod = WIN32_LoadLibrary (L"archiveaccess.dll"); + arcacc_mod = WIN32_LoadLibrary (_T("archiveaccess.dll")); if (!arcacc_mod) { - write_log (L"failed to open archiveaccess.dll ('%s')\n", zfile_getname (zf)); + write_log (_T("failed to open archiveaccess.dll ('%s')\n"), zfile_getname (zf)); return 0; } aaOpenArchive = (aapOpenArchive) GetProcAddress (arcacc_mod, "aaOpenArchive"); @@ -847,7 +847,7 @@ static int arcacc_init (struct zfile *zf) aaExtract = (aapExtract) GetProcAddress (arcacc_mod, "aaExtract"); aaCloseArchive = (aapCloseArchive) GetProcAddress (arcacc_mod, "aaCloseArchive"); if (!aaOpenArchive || !aaGetFileCount || !aaGetFileInfo || !aaExtract || !aaCloseArchive) { - write_log (L"Missing functions in archiveaccess.dll. Old version?\n"); + write_log (_T("Missing functions in archiveaccess.dll. Old version?\n")); arcacc_free (); return 0; } @@ -1028,7 +1028,7 @@ struct zvolume *archive_directory_plain (struct zfile *z) char *an = ua (zai.name); char *data = xmalloc (char, 1 + strlen (an) + 1 + 1 + 1); sprintf (data, "\"%s\"\n", an); - zn = addfile (zv, z, L"s/startup-sequence", (uae_u8*)data, strlen (data)); + zn = addfile (zv, z, _T("s/startup-sequence"), (uae_u8*)data, strlen (data)); xfree (data); xfree (an); } @@ -1068,7 +1068,7 @@ static struct zfile *archive_access_plain (struct znode *zn) if (zn->offset) { struct zfile *zf; z = zfile_fopen_empty (zn->volume->archive, zn->fullname, zn->size); - zf = zfile_fopen (zfile_getname (zn->volume->archive), L"rb", zn->volume->archive->zfdmask & ~ZFD_ADF, zn->offset - 1); + zf = zfile_fopen (zfile_getname (zn->volume->archive), _T("rb"), zn->volume->archive->zfdmask & ~ZFD_ADF, zn->offset - 1); if (zf) { zfile_fread (z->data, zn->size, 1, zf); zfile_fclose (zf); @@ -1588,7 +1588,7 @@ static struct zfile *archive_access_adf (struct znode *zn) for (i = 0; i < sfsblockcnt; i++) bsize += sfsblocks[i].length * adf->blocksize; if (bsize < size) - write_log (L"SFS extracting error, %s size mismatch %d<%d\n", z->name, bsize, size); + write_log (_T("SFS extracting error, %s size mismatch %d<%d\n"), z->name, bsize, size); dst = z->data; block = zn->offset; @@ -1691,15 +1691,15 @@ struct zvolume *archive_directory_rdb (struct zfile *z) dos = tochar (buf + 192, 4); - if (!memcmp (dos, L"DOS", 3)) + if (!memcmp (dos, _T("DOS"), 3)) rootblock = ((size / blocksize) - 1 + 2) / 2; else rootblock = 0; devname = getBSTR (buf + 36); - _stprintf (tmp, L"%s.hdf", devname); + _stprintf (tmp, _T("%s.hdf"), devname); memset (&zai, 0, sizeof zai); - _stprintf (comment, L"FS=%s LO=%d HI=%d HEADS=%d SPT=%d RES=%d BLOCK=%d ROOT=%d", + _stprintf (comment, _T("FS=%s LO=%d HI=%d HEADS=%d SPT=%d RES=%d BLOCK=%d ROOT=%d"), dos, lowcyl, highcyl, surf, spt, reserved, blocksize, rootblock); zai.comment = comment; xfree (dos); @@ -1714,7 +1714,7 @@ struct zvolume *archive_directory_rdb (struct zfile *z) zfile_fseek (z, 0, SEEK_SET); p = buf; zfile_fread (buf, 1, 512, z); - zai.name = L"rdb_dump.dat"; + zai.name = _T("rdb_dump.dat"); bs = rl (p + 16); zai.size = rl (p + 140) * bs; zai.comment = NULL; @@ -1985,7 +1985,7 @@ struct zvolume *archive_directory_fat (struct zfile *z) dataregion = rootdir + rootentries * 32 / 512; zv = zvolume_alloc (z, ArchiveFormatFAT, NULL, NULL); - fatdirectory (z, zv, L"", rootdir, rootentries, sectorspercluster, reserved, dataregion, fatbits); + fatdirectory (z, zv, _T(""), rootdir, rootentries, sectorspercluster, reserved, dataregion, fatbits); zv->method = ArchiveFormatFAT; return zv; } @@ -2061,7 +2061,7 @@ void archive_access_close (void *handle, unsigned int id) static struct zfile *archive_access_dir (struct znode *zn) { - return zfile_fopen (zn->fullname, L"rb", 0); + return zfile_fopen (zn->fullname, _T("rb"), 0); } @@ -2070,7 +2070,7 @@ struct zfile *archive_unpackzfile (struct zfile *zf) struct zfile *zout = NULL; if (!zf->archiveparent) return NULL; - unpack_log (L"delayed unpack '%s'\n", zf->name); + unpack_log (_T("delayed unpack '%s'\n"), zf->name); zf->datasize = zf->size; switch (zf->archiveid) {