diff --git a/src/cpu/386_common.h b/src/cpu/386_common.h index 1343057..f011b48 100644 --- a/src/cpu/386_common.h +++ b/src/cpu/386_common.h @@ -8,7 +8,7 @@ * * Common 386 CPU code. * - * Version: @(#)386_common.h 1.0.2 2018/03/09 + * Version: @(#)386_common.h 1.0.3 2018/05/09 * * Authors: Sarah Walker, * Miran Grca, @@ -40,14 +40,20 @@ extern uint16_t ea_rseg; #undef writememb -#define readmemb(s,a) ((readlookup2[(uint32_t)((s)+(a))>>12]==-1 || (s)==0xFFFFFFFF)?readmemb386l(s,a): *(uint8_t *)(readlookup2[(uint32_t)((s)+(a))>>12] + (uint32_t)((s) + (a))) ) -#define readmemq(s,a) ((readlookup2[(uint32_t)((s)+(a))>>12]==-1 || (s)==0xFFFFFFFF || (((s)+(a)) & 7))?readmemql(s,a):*(uint64_t *)(readlookup2[(uint32_t)((s)+(a))>>12]+(uint32_t)((s)+(a)))) +#define readmemb(s,a) ((readlookup2[(uint32_t)((s)+(a))>>12]==(uintptr_t)-1 || \ + (s)==0xFFFFFFFF) \ + ? readmemb386l(s,a) \ + : *(uint8_t *)(readlookup2[(uint32_t)((s)+(a))>>12] + (uint32_t)((s) + (a))) ) +#define readmemq(s,a) ((readlookup2[(uint32_t)((s)+(a))>>12]==(uintptr_t)-1 || \ + (s)==0xFFFFFFFF || (((s)+(a)) & 7)) \ + ? readmemql(s,a) \ + : *(uint64_t *)(readlookup2[(uint32_t)((s)+(a))>>12]+(uint32_t)((s)+(a)))) -#define writememb(s,a,v) if (writelookup2[(uint32_t)((s)+(a))>>12]==-1 || (s)==0xFFFFFFFF) writememb386l(s,a,v); else *(uint8_t *)(writelookup2[(uint32_t)((s) + (a)) >> 12] + (uint32_t)((s) + (a))) = v +#define writememb(s,a,v) if (writelookup2[(uint32_t)((s)+(a))>>12]==(uintptr_t)-1 || (s)==0xFFFFFFFF) writememb386l(s,a,v); else *(uint8_t *)(writelookup2[(uint32_t)((s) + (a)) >> 12] + (uint32_t)((s) + (a))) = v -#define writememw(s,a,v) if (writelookup2[(uint32_t)((s)+(a))>>12]==-1 || (s)==0xFFFFFFFF || (((s)+(a)) & 1)) writememwl(s,a,v); else *(uint16_t *)(writelookup2[(uint32_t)((s) + (a)) >> 12] + (uint32_t)((s) + (a))) = v -#define writememl(s,a,v) if (writelookup2[(uint32_t)((s)+(a))>>12]==-1 || (s)==0xFFFFFFFF || (((s)+(a)) & 3)) writememll(s,a,v); else *(uint32_t *)(writelookup2[(uint32_t)((s) + (a)) >> 12] + (uint32_t)((s) + (a))) = v -#define writememq(s,a,v) if (writelookup2[(uint32_t)((s)+(a))>>12]==-1 || (s)==0xFFFFFFFF || (((s)+(a)) & 7)) writememql(s,a,v); else *(uint64_t *)(writelookup2[(uint32_t)((s) + (a)) >> 12] + (uint32_t)((s) + (a))) = v +#define writememw(s,a,v) if (writelookup2[(uint32_t)((s)+(a))>>12]==(uintptr_t)-1 || (s)==0xFFFFFFFF || (((s)+(a)) & 1)) writememwl(s,a,v); else *(uint16_t *)(writelookup2[(uint32_t)((s) + (a)) >> 12] + (uint32_t)((s) + (a))) = v +#define writememl(s,a,v) if (writelookup2[(uint32_t)((s)+(a))>>12]==(uintptr_t)-1 || (s)==0xFFFFFFFF || (((s)+(a)) & 3)) writememll(s,a,v); else *(uint32_t *)(writelookup2[(uint32_t)((s) + (a)) >> 12] + (uint32_t)((s) + (a))) = v +#define writememq(s,a,v) if (writelookup2[(uint32_t)((s)+(a))>>12]==(uintptr_t)-1 || (s)==0xFFFFFFFF || (((s)+(a)) & 7)) writememql(s,a,v); else *(uint64_t *)(writelookup2[(uint32_t)((s) + (a)) >> 12] + (uint32_t)((s) + (a))) = v #define check_io_perm(port) if (msw&1 && ((CPL > IOPL) || (eflags&VM_FLAG))) \ @@ -103,7 +109,7 @@ extern uint16_t ea_rseg; } #define CHECK_WRITE_REP(chseg, low, high) \ - if ((low < (chseg)->limit_low) || (high > (chseg)->limit_high)) \ + if ((low < (chseg)->limit_low) || ((unsigned)high > (chseg)->limit_high)) \ { \ x86gpf("Limit check (WRITE REP)", 0); \ break; \ diff --git a/src/cpu/386_dynarec.c b/src/cpu/386_dynarec.c index 33cd629..dd9166c 100644 --- a/src/cpu/386_dynarec.c +++ b/src/cpu/386_dynarec.c @@ -8,7 +8,7 @@ * * Implementation of the CPU's dynamic recompiler. * - * Version: @(#)386_dynarec.c 1.0.3 2018/05/06 + * Version: @(#)386_dynarec.c 1.0.4 2018/05/09 * * Authors: Sarah Walker, * Miran Grca, @@ -170,9 +170,9 @@ static __inline void fetch_ea_32_long(uint32_t rmdat) if (easeg != 0xFFFFFFFF && ((easeg + cpu_state.eaaddr) & 0xFFF) <= 0xFFC) { uint32_t addr = easeg + cpu_state.eaaddr; - if ( readlookup2[addr >> 12] != -1) + if (readlookup2[addr >> 12] != (uintptr_t)-1) eal_r = (uint32_t *)(readlookup2[addr >> 12] + addr); - if (writelookup2[addr >> 12] != -1) + if (writelookup2[addr >> 12] != (uintptr_t)-1) eal_w = (uint32_t *)(writelookup2[addr >> 12] + addr); } cpu_state.last_ea = cpu_state.eaaddr; @@ -213,9 +213,9 @@ static __inline void fetch_ea_16_long(uint32_t rmdat) if (easeg != 0xFFFFFFFF && ((easeg + cpu_state.eaaddr) & 0xFFF) <= 0xFFC) { uint32_t addr = easeg + cpu_state.eaaddr; - if ( readlookup2[addr >> 12] != -1) + if (readlookup2[addr >> 12] != (uintptr_t)-1) eal_r = (uint32_t *)(readlookup2[addr >> 12] + addr); - if (writelookup2[addr >> 12] != -1) + if (writelookup2[addr >> 12] != (uintptr_t)-1) eal_w = (uint32_t *)(writelookup2[addr >> 12] + addr); } cpu_state.last_ea = cpu_state.eaaddr; diff --git a/src/cpu/x86_ops_mov.h b/src/cpu/x86_ops_mov.h index 93623c1..d497007 100644 --- a/src/cpu/x86_ops_mov.h +++ b/src/cpu/x86_ops_mov.h @@ -8,7 +8,7 @@ * * Miscellaneous x86 CPU Instructions. * - * Version: @(#)x86_ops_mov.h 1.0.1 2018/02/14 + * Version: @(#)x86_ops_mov.h 1.0.2 2018/05/09 * * Authors: Sarah Walker, * Miran Grca, @@ -310,7 +310,7 @@ static int opMOV_AX_a16(uint32_t fetchdat) { uint16_t temp; uint16_t addr = getwordf(); - CHECK_READ(cpu_state.ea_seg, addr, addr + 1); + CHECK_READ(cpu_state.ea_seg, addr, (uint16_t)(addr + 1)); temp = readmemw(cpu_state.ea_seg->base, addr); if (cpu_state.abrt) return 1; AX = temp; CLOCK_CYCLES((is486) ? 1 : 4); @@ -332,7 +332,7 @@ static int opMOV_EAX_a16(uint32_t fetchdat) { uint32_t temp; uint16_t addr = getwordf(); - CHECK_READ(cpu_state.ea_seg, addr, addr + 3); + CHECK_READ(cpu_state.ea_seg, addr, (uint16_t) (addr + 3)); temp = readmeml(cpu_state.ea_seg->base, addr); if (cpu_state.abrt) return 1; EAX = temp; CLOCK_CYCLES((is486) ? 1 : 4); @@ -372,7 +372,7 @@ static int opMOV_a32_AL(uint32_t fetchdat) static int opMOV_a16_AX(uint32_t fetchdat) { uint16_t addr = getwordf(); - CHECK_WRITE(cpu_state.ea_seg, addr, addr + 1); + CHECK_WRITE(cpu_state.ea_seg, addr, (uint16_t)(addr + 1)); writememw(cpu_state.ea_seg->base, addr, AX); CLOCK_CYCLES((is486) ? 1 : 2); PREFETCH_RUN(2, 3, -1, 0,0,1,0, 0); @@ -390,7 +390,7 @@ static int opMOV_a32_AX(uint32_t fetchdat) static int opMOV_a16_EAX(uint32_t fetchdat) { uint16_t addr = getwordf(); - CHECK_WRITE(cpu_state.ea_seg, addr, addr + 3); + CHECK_WRITE(cpu_state.ea_seg, addr, (uint16_t)(addr + 3)); writememl(cpu_state.ea_seg->base, addr, EAX); CLOCK_CYCLES((is486) ? 1 : 2); PREFETCH_RUN(2, 3, -1, 0,0,0,1, 0); diff --git a/src/cpu/x86_ops_pmode.h b/src/cpu/x86_ops_pmode.h index f0f3ea1..471bc15 100644 --- a/src/cpu/x86_ops_pmode.h +++ b/src/cpu/x86_ops_pmode.h @@ -8,7 +8,7 @@ * * Miscellaneous x86 CPU Instructions. * - * Version: @(#)x86_ops_pmode.h 1.0.1 2018/02/14 + * Version: @(#)x86_ops_pmode.h 1.0.2 2018/05/09 * * Authors: Sarah Walker, * Miran Grca, @@ -95,7 +95,7 @@ static int opARPL_a32(uint32_t fetchdat) \ flags_rebuild(); \ if (!(sel & 0xfffc)) { flags &= ~Z_FLAG; return 0; } /*Null selector*/ \ - valid = (sel & ~7) < ((sel & 4) ? ldt.limit : gdt.limit); \ + valid = (uint16_t)(sel & ~7) < ((sel & 4) ? ldt.limit : gdt.limit); \ if (valid) \ { \ cpl_override = 1; \ @@ -145,7 +145,7 @@ opLAR(l_a32, fetch_ea_32, 1, 1) flags_rebuild(); \ flags &= ~Z_FLAG; \ if (!(sel & 0xfffc)) return 0; /*Null selector*/ \ - valid = (sel & ~7) < ((sel & 4) ? ldt.limit : gdt.limit); \ + valid = (uint16_t)(sel & ~7) < ((sel & 4) ? ldt.limit : gdt.limit); \ if (valid) \ { \ cpl_override = 1; \ @@ -270,7 +270,7 @@ static int op0F00_common(uint32_t fetchdat, int ea32) flags &= ~Z_FLAG; if (!(sel & 0xfffc)) return 0; /*Null selector*/ cpl_override = 1; - valid = (sel & ~7) < ((sel & 4) ? ldt.limit : gdt.limit); + valid = (uint16_t)(sel & ~7) < ((sel & 4) ? ldt.limit : gdt.limit); desc = readmemw(0, ((sel & 4) ? ldt.base : gdt.base) + (sel & ~7) + 4); cpl_override = 0; if (cpu_state.abrt) return 1; if (!(desc & 0x1000)) valid = 0; @@ -290,7 +290,7 @@ static int op0F00_common(uint32_t fetchdat, int ea32) flags &= ~Z_FLAG; if (!(sel & 0xfffc)) return 0; /*Null selector*/ cpl_override = 1; - valid = (sel & ~7) < ((sel & 4) ? ldt.limit : gdt.limit); + valid = (uint16_t)(sel & ~7) < ((sel & 4) ? ldt.limit : gdt.limit); desc = readmemw(0, ((sel & 4) ? ldt.base : gdt.base) + (sel & ~7) + 4); cpl_override = 0; if (cpu_state.abrt) return 1; if (!(desc & 0x1000)) valid = 0; diff --git a/src/cpu/x86_ops_rep.h b/src/cpu/x86_ops_rep.h index f3e0fae..98e49d3 100644 --- a/src/cpu/x86_ops_rep.h +++ b/src/cpu/x86_ops_rep.h @@ -8,7 +8,7 @@ * * Miscellaneous x86 CPU Instructions. * - * Version: @(#)x86_ops_rep.h 1.0.1 2018/02/14 + * Version: @(#)x86_ops_rep.h 1.0.2 2018/05/09 * * Authors: Sarah Walker, * Miran Grca, diff --git a/src/device.c b/src/device.c index 7ce6ee5..935bfc5 100644 --- a/src/device.c +++ b/src/device.c @@ -9,7 +9,7 @@ * Implementation of the generic device interface to handle * all devices attached to the emulator. * - * Version: @(#)device.c 1.0.9 2018/05/06 + * Version: @(#)device.c 1.0.10 2018/05/09 * * Authors: Fred N. van Kempen, * Miran Grca, @@ -93,7 +93,7 @@ device_add(const device_t *d) */ if (d->flags & DEVICE_UNSTABLE) { mbstowcs(devname, d->name, sizeof_w(devname)); - swprintf(temp, sizeof_w(temp), plat_get_string(IDS_2144), devname); + swprintf(temp, sizeof_w(temp), get_string(IDS_2144), devname); /* Show the messagebox, and abort if 'No' was selected. */ if (ui_msgbox(MBX_WARNING, temp) == 1) return(0); diff --git a/src/devices/network/slirp/misc.c b/src/devices/network/slirp/slirp_misc.c similarity index 100% rename from src/devices/network/slirp/misc.c rename to src/devices/network/slirp/slirp_misc.c diff --git a/src/emu.h b/src/emu.h index 6a9bfa4..a57d8d7 100644 --- a/src/emu.h +++ b/src/emu.h @@ -8,7 +8,7 @@ * * Main include file for the application. * - * Version: @(#)emu.h 1.0.21 2018/05/05 + * Version: @(#)emu.h 1.0.22 2018/05/09 * * Author: Fred N. van Kempen, * @@ -157,27 +157,30 @@ extern int config_changed; /* config has changed */ /* Function prototypes. */ #ifdef HAVE_STDARG_H -extern void pclog_ex(const char *fmt, va_list); +extern void pclog_ex(const char *fmt, va_list); #endif -extern void pclog(const char *fmt, ...); -extern void fatal(const char *fmt, ...); -extern void pc_version(const char *platform); -extern void pc_path(wchar_t *dest, int dest_sz, const wchar_t *src); -extern int pc_setup(int argc, wchar_t *argv[]); -extern int pc_init(void); -extern void pc_close(void *threadid); -extern void pc_reset_hard_close(void); -extern void pc_reset_hard_init(void); -extern void pc_reset_hard(void); -extern void pc_reset(int hard); -extern void pc_reload(const wchar_t *fn); -extern void pc_full_speed(void); -extern void pc_speed_changed(void); -extern void pc_thread(void *param); -extern void pc_start(void); -extern void pc_onesec(void); -extern void set_screen_size(int x, int y); -extern void set_screen_size_natural(void); +extern void pclog(const char *fmt, ...); +extern void fatal(const char *fmt, ...); +extern void pc_version(const char *platform); +extern void pc_path(wchar_t *dest, int dest_sz, const wchar_t *src); +extern int pc_setup(int argc, wchar_t *argv[]); +extern int pc_init(void); +extern void pc_close(void *threadid); +extern void pc_reset_hard_close(void); +extern void pc_reset_hard_init(void); +extern void pc_reset_hard(void); +extern void pc_reset(int hard); +extern void pc_reload(const wchar_t *fn); +extern void pc_full_speed(void); +extern void pc_speed_changed(void); +extern void pc_thread(void *param); +extern void pc_start(void); +extern void pc_onesec(void); +extern void set_screen_size(int x, int y); +extern void set_screen_size_natural(void); + +extern const wchar_t *get_string(int id); +extern uint32_t get_val(const char *str); #ifdef __cplusplus } diff --git a/src/mem.h b/src/mem.h index 660bab6..f905471 100644 --- a/src/mem.h +++ b/src/mem.h @@ -8,7 +8,7 @@ * * Definitions for the memory interface. * - * Version: @(#)mem.h 1.0.4 2018/03/16 + * Version: @(#)mem.h 1.0.5 2018/05/09 * * Authors: Fred N. van Kempen, * Sarah Walker, @@ -106,7 +106,7 @@ extern uint32_t biosmask; extern int readlookup[256], readlookupp[256]; -extern uintptr_t * readlookup2; +extern uintptr_t *readlookup2; extern int readlnext; extern int writelookup[256], writelookupp[256]; @@ -144,9 +144,18 @@ extern int mem_a20_state, mem_a20_key; -#define readmemb(a) ((readlookup2[(a)>>12]==-1)?readmembl(a):*(uint8_t *)(readlookup2[(a) >> 12] + (a))) -#define readmemw(s,a) ((readlookup2[(uint32_t)((s)+(a))>>12]==-1 || (s)==0xFFFFFFFF || (((s)+(a)) & 1))?readmemwl(s,a):*(uint16_t *)(readlookup2[(uint32_t)((s)+(a))>>12]+(uint32_t)((s)+(a)))) -#define readmeml(s,a) ((readlookup2[(uint32_t)((s)+(a))>>12]==-1 || (s)==0xFFFFFFFF || (((s)+(a)) & 3))?readmemll(s,a):*(uint32_t *)(readlookup2[(uint32_t)((s)+(a))>>12]+(uint32_t)((s)+(a)))) +#define readmemb(a) ((readlookup2[(a)>>12]== (uintptr_t)-1) \ + ? readmembl(a) \ + : *(uint8_t *)(readlookup2[(a) >> 12] + (a))) + +#define readmemw(s,a) ((readlookup2[(uint32_t)((s)+(a))>>12]== (uintptr_t)-1 || \ + (s)==0xFFFFFFFF || (((s)+(a)) & 1)) \ + ? readmemwl(s,a) \ + : *(uint16_t *)(readlookup2[(uint32_t)((s)+(a))>>12]+(uint32_t)((s)+(a)))) +#define readmeml(s,a) ((readlookup2[(uint32_t)((s)+(a))>>12]== (uintptr_t)-1 || \ + (s)==0xFFFFFFFF || (((s)+(a)) & 3)) \ + ? readmemll(s,a) \ + : *(uint32_t *)(readlookup2[(uint32_t)((s)+(a))>>12]+(uint32_t)((s)+(a)))) extern uint8_t readmembl(uint32_t addr); diff --git a/src/misc.c b/src/misc.c new file mode 100644 index 0000000..a08786f --- /dev/null +++ b/src/misc.c @@ -0,0 +1,87 @@ +/* + * VARCem Virtual ARchaeological Computer EMulator. + * An emulator of (mostly) x86-based PC systems and devices, + * using the ISA,EISA,VLB,MCA and PCI system buses, roughly + * spanning the era between 1981 and 1995. + * + * This file is part of the VARCem Project. + * + * Misc functions that do not fit anywhere else. + * + * Version: @(#)misc.c 1.0.1 2018/05/09 + * + * Author: Fred N. van Kempen, + * + * Copyright 2018 Fred N. van Kempen. + * + * Redistribution and use in source and binary forms, with + * or without modification, are permitted provided that the + * following conditions are met: + * + * 1. Redistributions of source code must retain the entire + * above notice, this list of conditions and the following + * disclaimer. + * + * 2. Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the + * following disclaimer in the documentation and/or other + * materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names + * of its contributors may be used to endorse or promote + * products derived from this software without specific + * prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include +#include +#include +#include +#include +#include "emu.h" +#include "plat.h" + + +const wchar_t * +get_string(int id) +{ + const wchar_t *str = NULL; + const string_t *tbl; + + tbl = plat_strings; + while(tbl->str != NULL) { + if (tbl->id == id) { + str = tbl->str; + break; + } + + tbl++; + } + + return(str); +} + + +/* Grab the value from a string. */ +uint32_t +get_val(const char *str) +{ + long unsigned int l = 0UL; + + if ((strlen(str) > 1) && /* hex always is 0x... */ + (sscanf(str, "0x%lx", &l) == 0)) /* no valid field found */ + sscanf(str, "%i", (int *)&l); /* try decimal.. */ + + return(l); +} diff --git a/src/pc.c b/src/pc.c index 9eea923..a4f3ff7 100644 --- a/src/pc.c +++ b/src/pc.c @@ -8,7 +8,7 @@ * * Main emulator module where most things are controlled. * - * Version: @(#)pc.c 1.0.39 2018/05/09 + * Version: @(#)pc.c 1.0.41 2018/05/09 * * Authors: Fred N. van Kempen, * Miran Grca, @@ -213,9 +213,17 @@ pclog_ex(const char *fmt, va_list ap) if (log_path[0] != L'\0') { stdlog = plat_fopen(log_path, L"w"); if (stdlog == NULL) +#ifdef _WIN32 stdlog = stdout; +#else + stdlog = stderr; +#endif } else { +#ifdef _WIN32 stdlog = stdout; +#else + stdlog = stderr; +#endif } } @@ -713,12 +721,12 @@ pc_init(void) { wchar_t temp[1024]; wchar_t name[128]; - wchar_t *str; + const wchar_t *str; /* Load the ROMs for the selected machine. */ if ((machine < 0) || !machine_available(machine)) { /* Whoops, selected machine not available. */ - str = plat_get_string(IDS_2063); + str = get_string(IDS_2063); mbstowcs(name, machine_getname(), sizeof_w(name)); swprintf(temp, sizeof_w(temp), str, name); @@ -732,7 +740,7 @@ pc_init(void) if ((video_card < 0) || !video_card_available(video_old_to_new(video_card))) { /* Whoops, selected video not available. */ - str = plat_get_string(IDS_2064); + str = get_string(IDS_2064); mbstowcs(name, machine_getname(), sizeof_w(name)); swprintf(temp, sizeof_w(temp), str, name); @@ -1105,9 +1113,9 @@ pc_thread(void *param) if (mouse_type != MOUSE_NONE) { wcscat(temp, L" - "); if (!mouse_capture) { - wcscat(temp, plat_get_string(IDS_2077)); + wcscat(temp, get_string(IDS_2077)); } else { - wcscat(temp, (mouse_get_buttons() > 2) ? plat_get_string(IDS_2078) : plat_get_string(IDS_2079)); + wcscat(temp, (mouse_get_buttons() > 2) ? get_string(IDS_2078) : get_string(IDS_2079)); } } diff --git a/src/plat.h b/src/plat.h index a6497c1..67beb87 100644 --- a/src/plat.h +++ b/src/plat.h @@ -89,6 +89,11 @@ extern "C" { #endif +/* Define an entry in the strings table. */ +typedef struct { + int id; + const wchar_t *str; +} string_t; /* Define a "vidapi", or, rather, a Renderer API. */ typedef struct { @@ -112,6 +117,7 @@ GLOBAL int dopause, /* system is paused */ GLOBAL uint64_t timer_freq; GLOBAL int infocus; GLOBAL const vidapi_t *plat_vidapis[]; +extern const string_t *plat_strings; /* System-related functions. */ @@ -142,7 +148,6 @@ extern int plat_fdd_icon(int); /* Resource management. */ extern void set_language(int id); -extern wchar_t *plat_get_string(int id); /* Dynamic Module Loader interface. */ diff --git a/src/rom_load.c b/src/rom_load.c index 022bdff..3685cb5 100644 --- a/src/rom_load.c +++ b/src/rom_load.c @@ -17,7 +17,7 @@ * or to use a generic handler, and then pass it a pointer * to a command table. For now, we don't. * - * Version: @(#)rom_load.c 1.0.9 2018/05/06 + * Version: @(#)rom_load.c 1.0.10 2018/05/09 * * Author: Fred N. van Kempen, * @@ -70,20 +70,6 @@ #define MAX_ARGS 16 /* max number of arguments */ -/* Grab the value from a string. */ -static uint32_t -get_val(char *str) -{ - long unsigned int l = 0UL; - - if ((strlen(str) > 1) && /* hex always is 0x... */ - (sscanf(str, "0x%lx", &l) == 0)) /* no valid field found */ - sscanf(str, "%i", (int *)&l); /* try decimal.. */ - - return(l); -} - - /* Process a single (logical) command line. */ static int process(int ln, int argc, char **argv, romdef_t *r) diff --git a/src/ui/ui.h b/src/ui/ui.h index 8e41b55..ccf67ad 100644 --- a/src/ui/ui.h +++ b/src/ui/ui.h @@ -145,7 +145,7 @@ extern void ui_menu_toggle_video_item(int idm, int *val); extern void menu_enable_item(int idm, int val); extern void menu_set_item(int idm, int val); extern void menu_set_radio_item(int idm, int num, int val); -extern wchar_t *ui_window_title(wchar_t *s); +extern wchar_t *ui_window_title(const wchar_t *s); /* Status Bar functions. */ extern void ui_sb_update(void); diff --git a/src/ui/ui_main.c b/src/ui/ui_main.c index d4221fb..898e1c3 100644 --- a/src/ui/ui_main.c +++ b/src/ui/ui_main.c @@ -11,7 +11,7 @@ * This code is called by the UI frontend modules, and, also, * depends on those same modules for lower-level functions. * - * Version: @(#)ui_main.c 1.0.13 2018/05/09 + * Version: @(#)ui_main.c 1.0.14 2018/05/09 * * Author: Fred N. van Kempen, * @@ -497,7 +497,7 @@ ui_menu_command(int idm) /* FIXME: need to fix these.. */ case IDM_LOAD: /* TOOLS menu */ plat_pause(1); - if (! dlg_file(plat_get_string(IDS_2160), NULL, temp, 0) && + if (! dlg_file(get_string(IDS_2160), NULL, temp, 0) && (ui_msgbox(MBX_QUESTION, (wchar_t *)IDS_2051) == 0)) { pc_reload(temp); ui_menu_reset_all(); @@ -507,7 +507,7 @@ ui_menu_command(int idm) case IDM_SAVE: /* TOOLS menu */ plat_pause(1); - if (! dlg_file(plat_get_string(IDS_2160), NULL, temp, 1)) { + if (! dlg_file(get_string(IDS_2160), NULL, temp, 1)) { config_write(temp); } plat_pause(0); diff --git a/src/ui/ui_resource.h b/src/ui/ui_resource.h index 2451f88..d6439c5 100644 --- a/src/ui/ui_resource.h +++ b/src/ui/ui_resource.h @@ -8,7 +8,7 @@ * * Platform-independent resource identifiers. * - * Version: @(#)ui_resource.h 1.0.6 2018/05/07 + * Version: @(#)ui_resource.h 1.0.7 2018/05/09 * * Authors: Fred N. van Kempen, * Miran Grca, @@ -193,6 +193,8 @@ /* String IDs. */ +#define IDS_BEGIN 2048 // start of string IDs + #define IDS_2048 2048 // "Error" #define IDS_2049 2049 // "Fatal Error" #define IDS_2050 2050 // "Configuration Error" @@ -392,20 +394,9 @@ #define IDS_6147 6147 // "2%% below perfect RPM" #define IDS_7168 7168 // "English (United States)" - #define IDS_LANG_ENUS IDS_7168 -#define STR_NUM_2048 132 -#define STR_NUM_3072 11 -#define STR_NUM_4096 20 -#define STR_NUM_4352 6 -#define STR_NUM_4608 6 -#define STR_NUM_5120 1 -#define STR_NUM_5376 6 -#define STR_NUM_5632 6 -#define STR_NUM_5888 14 -#define STR_NUM_6144 4 -#define STR_NUM_7168 1 +#define IDS_END 8191 // end of string IDs #endif /*EMU_UI_RESOURCE_H*/ diff --git a/src/ui/ui_stbar.c b/src/ui/ui_stbar.c index 9a2ec10..1c33d19 100644 --- a/src/ui/ui_stbar.c +++ b/src/ui/ui_stbar.c @@ -8,7 +8,7 @@ * * Common UI support functions for the Status Bar module. * - * Version: @(#)ui_stbar.c 1.0.5 2018/05/08 + * Version: @(#)ui_stbar.c 1.0.6 2018/05/09 * * Authors: Fred N. van Kempen, * Miran Grca, @@ -195,7 +195,7 @@ ui_sb_tip_update(int tag) { wchar_t tip[512]; wchar_t temp[512]; - wchar_t *str; + const wchar_t *str; const char *stransi; int bus, drive, id; int type, part; @@ -212,34 +212,34 @@ ui_sb_tip_update(int tag) mbstowcs(temp, stransi, sizeof_w(temp)); str = floppyfns[drive]; if (*str == L'\0') - str = plat_get_string(IDS_2057); /*"empty"*/ + str = get_string(IDS_2057); /*"empty"*/ swprintf(tip, sizeof_w(tip), - plat_get_string(IDS_2158), drive+1, temp, str); + get_string(IDS_2158), drive+1, temp, str); break; case SB_CDROM: drive = sb_tags[part] & 0x0f; bus = cdrom_drives[drive].bus_type; id = IDS_4352 + (bus - 1); - wcscpy(temp, plat_get_string(id)); + wcscpy(temp, get_string(id)); str = cdrom_image[drive].image_path; if (*str == L'\0') - str = plat_get_string(IDS_2057); /*"empty"*/ + str = get_string(IDS_2057); /*"empty"*/ if (cdrom_drives[drive].host_drive == 200) { swprintf(tip, sizeof_w(tip), - plat_get_string(IDS_5120), + get_string(IDS_5120), drive+1, temp, str); } else if ((cdrom_drives[drive].host_drive >= 'A') && (cdrom_drives[drive].host_drive <= 'Z')) { swprintf(temp, sizeof_w(temp), - plat_get_string(IDS_2058), + get_string(IDS_2058), cdrom_drives[drive].host_drive & ~0x20); swprintf(tip, sizeof_w(tip), - plat_get_string(IDS_5120), - drive+1, plat_get_string(id), temp); + get_string(IDS_5120), + drive+1, get_string(id), temp); } else { swprintf(tip, sizeof_w(tip), - plat_get_string(IDS_5120), + get_string(IDS_5120), drive+1, temp, str); } break; @@ -249,34 +249,34 @@ ui_sb_tip_update(int tag) type = zip_drives[drive].is_250 ? 250 : 100; str = zip_drives[drive].image_path; if (*str == L'\0') - str = plat_get_string(IDS_2057); /*"empty"*/ + str = get_string(IDS_2057); /*"empty"*/ swprintf(tip, sizeof_w(tip), - plat_get_string(IDS_2177), drive+1, type, str); + get_string(IDS_2177), drive+1, type, str); break; case SB_RDISK: drive = sb_tags[part] & 0x1f; str = hdd[drive].fn; if (*str == L'\0') - str = plat_get_string(IDS_2057); /*"empty"*/ + str = get_string(IDS_2057); /*"empty"*/ swprintf(tip, sizeof_w(tip), - plat_get_string(IDS_4115), drive, str); + get_string(IDS_4115), drive, str); break; case SB_HDD: bus = sb_tags[part] & 0x0f; id = IDS_4352 + (bus - 1); - str = plat_get_string(id); + str = get_string(id); swprintf(tip, sizeof_w(tip), - plat_get_string(IDS_4096), str); + get_string(IDS_4096), str); break; case SB_NETWORK: - swprintf(tip, sizeof_w(tip), plat_get_string(IDS_2069)); + swprintf(tip, sizeof_w(tip), get_string(IDS_2069)); break; case SB_SOUND: - swprintf(tip, sizeof_w(tip), plat_get_string(IDS_2068)); + swprintf(tip, sizeof_w(tip), get_string(IDS_2068)); break; default: @@ -316,18 +316,18 @@ static void menu_floppy(int part, int drive) { sb_menu_add_item(part, IDM_FLOPPY_IMAGE_NEW | drive, - plat_get_string(IDS_2161)); + get_string(IDS_2161)); sb_menu_add_item(part, -1, NULL); sb_menu_add_item(part, IDM_FLOPPY_IMAGE_EXISTING | drive, - plat_get_string(IDS_2162)); + get_string(IDS_2162)); sb_menu_add_item(part, IDM_FLOPPY_IMAGE_EXISTING_WP | drive, - plat_get_string(IDS_2163)); + get_string(IDS_2163)); sb_menu_add_item(part, -1, NULL); sb_menu_add_item(part, IDM_FLOPPY_EXPORT_TO_86F | drive, - plat_get_string(IDS_2172)); + get_string(IDS_2172)); sb_menu_add_item(part, -1, NULL); sb_menu_add_item(part, IDM_FLOPPY_EJECT | drive, - plat_get_string(IDS_2164)); + get_string(IDS_2164)); if (floppyfns[drive][0] == L'\0') { sb_menu_enable_item(part, IDM_FLOPPY_EJECT | drive, 0); @@ -344,15 +344,15 @@ menu_cdrom(int part, int drive) int i; sb_menu_add_item(part, IDM_CDROM_MUTE | drive, - plat_get_string(IDS_2165)); + get_string(IDS_2165)); sb_menu_add_item(part, -1, NULL); sb_menu_add_item(part, IDM_CDROM_EMPTY | drive, - plat_get_string(IDS_2166)); + get_string(IDS_2166)); sb_menu_add_item(part, IDM_CDROM_RELOAD | drive, - plat_get_string(IDS_2167)); + get_string(IDS_2167)); sb_menu_add_item(part, -1, NULL); sb_menu_add_item(part, IDM_CDROM_IMAGE | drive, - plat_get_string(IDS_2168)); + get_string(IDS_2168)); if (host_cdrom_drive_available_num == 0) { if ((cdrom_drives[drive].host_drive >= 'A') && @@ -401,15 +401,15 @@ static void menu_zip(int part, int drive) { sb_menu_add_item(part, IDM_ZIP_IMAGE_NEW | drive, - plat_get_string(IDS_2161)); + get_string(IDS_2161)); sb_menu_add_item(part, -1, NULL); sb_menu_add_item(part, IDM_ZIP_IMAGE_EXISTING | drive, - plat_get_string(IDS_2162)); + get_string(IDS_2162)); sb_menu_add_item(part, IDM_ZIP_IMAGE_EXISTING_WP | drive, - plat_get_string(IDS_2163)); + get_string(IDS_2163)); sb_menu_add_item(part, -1, NULL); - sb_menu_add_item(part, IDM_ZIP_EJECT | drive, plat_get_string(IDS_2164)); - sb_menu_add_item(part, IDM_ZIP_RELOAD | drive, plat_get_string(IDS_2167)); + sb_menu_add_item(part, IDM_ZIP_EJECT | drive, get_string(IDS_2164)); + sb_menu_add_item(part, IDM_ZIP_RELOAD | drive, get_string(IDS_2167)); if (zip_drives[drive].image_path[0] == L'\0') { sb_menu_enable_item(part, IDM_ZIP_EJECT | drive, 0); @@ -426,17 +426,17 @@ static void menu_remov(int part, int drive) { sb_menu_add_item(part, IDM_RDISK_EJECT | drive, - plat_get_string(IDS_2164)); + get_string(IDS_2164)); sb_menu_add_item(part, IDM_RDISK_RELOAD | drive, - plat_get_string(IDS_2167)); + get_string(IDS_2167)); sb_menu_add_item(part, -1, NULL); sb_menu_add_item(part, IDM_RDISK_SEND_CHANGE | drive, - plat_get_string(IDS_2142)); + get_string(IDS_2142)); sb_menu_add_item(part, -1, NULL); sb_menu_add_item(part, IDM_RDISK_IMAGE | drive, - plat_get_string(IDS_2168)); + get_string(IDS_2168)); sb_menu_add_item(part, IDM_RDISK_IMAGE_WP | drive, - plat_get_string(IDS_2169)); + get_string(IDS_2169)); } @@ -811,7 +811,7 @@ ui_sb_menu_command(int idm, int tag) if (part == -1) break; i = (idm == IDM_FLOPPY_IMAGE_EXISTING_WP) ? 0x80 : 0; - if (! dlg_file(plat_get_string(IDS_2159), + if (! dlg_file(get_string(IDS_2159), floppyfns[drive], temp, i)) ui_sb_mount_floppy(drive, part, i ? 1 : 0, temp); break; @@ -834,7 +834,7 @@ ui_sb_menu_command(int idm, int tag) part = find_tag(SB_FLOPPY | drive); if (part == -1) break; - if (! dlg_file(plat_get_string(IDS_2173), floppyfns[drive], temp, 1)) { + if (! dlg_file(get_string(IDS_2173), floppyfns[drive], temp, 1)) { plat_pause(1); if (! d86f_export(drive, temp)) ui_msgbox(MBX_ERROR, (wchar_t *)IDS_4108); @@ -869,7 +869,7 @@ ui_sb_menu_command(int idm, int tag) part = find_tag(SB_CDROM | drive); if (part == -1) break; - if (dlg_file(plat_get_string(IDS_2075), + if (dlg_file(get_string(IDS_2075), cdrom_image[drive].image_path, temp, 0x80)) break; cdrom_drives[drive].prev_host_drive = cdrom_drives[drive].host_drive; @@ -952,7 +952,7 @@ ui_sb_menu_command(int idm, int tag) if (part == -1) break; i = (idm == IDM_ZIP_IMAGE_EXISTING_WP) ? 0x80 : 0; - if (dlg_file(plat_get_string(IDS_2175), + if (dlg_file(get_string(IDS_2175), zip_drives[drive].image_path, temp, i)) break; ui_sb_mount_zip(drive, part, i ? 1 : 0, temp); break; @@ -988,7 +988,7 @@ ui_sb_menu_command(int idm, int tag) part = find_tag(idm | drive); i = (idm == IDM_RDISK_IMAGE_WP) ? 0x80 : 0; - if (dlg_file(plat_get_string(IDS_4106), + if (dlg_file(get_string(IDS_4106), hdd[drive].fn, temp, i)) break; removable_disk_unload(drive); diff --git a/src/win/mingw/Makefile.MinGW b/src/win/mingw/Makefile.MinGW index 984cae2..9f95da9 100644 --- a/src/win/mingw/Makefile.MinGW +++ b/src/win/mingw/Makefile.MinGW @@ -8,7 +8,7 @@ # # Makefile for Windows systems using the MinGW32 environment. # -# Version: @(#)Makefile.mingw 1.0.41 2018/05/07 +# Version: @(#)Makefile.mingw 1.0.42 2018/05/09 # # Author: Fred N. van Kempen, # @@ -475,6 +475,7 @@ endif # Final versions of the toolchain flags. +# FIXME: add the -Wsign-compare option soon! CFLAGS := $(WX_FLAGS) $(OPTS) $(DFLAGS) $(COPTIM) $(AOPTIM) \ $(AFLAGS) -fomit-frame-pointer -mstackrealign \ -Wall -Wundef #-Wshadow #-Wunused-parameter -Wmissing-declarations @@ -489,12 +490,12 @@ CXXFLAGS := $(WX_FLAGS) $(OPTS) $(DFLAGS) $(COPTIM) $(AOPTIM) \ ######################################################################### # Create the (final) list of objects to build. # ######################################################################### -MAINOBJ := pc.o config.o \ +MAINOBJ := pc.o config.o misc.o \ random.o timer.o io.o dma.o nmi.o pic.o pit.o ppi.o \ pci.o mca.o mcr.o mem.o memregs.o rom.o rom_load.o \ device.o nvr.o nvr_at.o nvr_ps2.o $(VNCOBJ) $(RDPOBJ) -UIOBJ += ui_main.o ui_new_floppy.o ui_stbar.o +UIOBJ += ui_main.o ui_new_floppy.o ui_stbar.o ui_vidapi.o INTELOBJ := intel.o \ intel_flash.o \ @@ -570,9 +571,10 @@ SCSIOBJ := scsi.o \ NETOBJ := network.o \ net_pcap.o \ net_slirp.o \ - bootp.o ip_icmp.o misc.o socket.o tcp_timer.o cksum.o \ - ip_input.o queue.o tcp_input.o debug.o ip_output.o \ - sbuf.o tcp_output.o udp.o if.o mbuf.o slirp.o tcp_subr.o \ + bootp.o ip_icmp.o slirp_misc.o socket.o tcp_timer.o \ + cksum.o ip_input.o queue.o tcp_input.o debug.o \ + ip_output.o sbuf.o tcp_output.o udp.o if.o mbuf.o \ + slirp.o tcp_subr.o \ net_ne2000.o SNDOBJ := sound.o \ @@ -662,6 +664,10 @@ else @echo $< @$(CPP) $(CXXFLAGS) -c $< +%.int: %.c + @echo $< + @$(PREPROC) $(OPTS) $< >$@ + %.d: %.c $(wildcard $*.d) @echo $< @$(CC) $(CFLAGS) $(DEPS) -E $< >NUL diff --git a/src/win/msvc/Makefile.VC b/src/win/msvc/Makefile.VC index b144e27..dd07cfb 100644 --- a/src/win/msvc/Makefile.VC +++ b/src/win/msvc/Makefile.VC @@ -8,7 +8,7 @@ # # Makefile for Windows using Visual Studio 2015. # -# Version: @(#)Makefile.VC 1.0.28 2018/05/09 +# Version: @(#)Makefile.VC 1.0.29 2018/05/09 # # Author: Fred N. van Kempen, # @@ -453,7 +453,7 @@ CXXFLAGS := $(WX_FLAGS) $(OPTS) $(CXXOPTS) $(COPTS) $(DOPTS) $(AOPTIM) $(AFLAGS) ######################################################################### # Create the (final) list of objects to build. # ######################################################################### -MAINOBJ := pc.obj config.obj \ +MAINOBJ := pc.obj config.obj misc.obj \ random.obj timer.obj io.obj dma.obj nmi.obj pic.obj \ pit.obj ppi.obj pci.obj mca.obj mcr.obj mem.obj \ memregs.obj rom.obj rom_load.obj device.obj nvr.obj \ @@ -535,9 +535,11 @@ SCSIOBJ := scsi.obj \ NETOBJ := network.obj \ net_pcap.obj \ net_slirp.obj \ - bootp.obj ip_icmp.obj misc.obj socket.obj tcp_timer.obj cksum.obj \ - ip_input.obj queue.obj tcp_input.obj debug.obj ip_output.obj \ - sbuf.obj tcp_output.obj udp.obj if.obj mbuf.obj slirp.obj tcp_subr.obj \ + bootp.obj ip_icmp.obj slirp_misc.obj socket.obj \ + tcp_timer.obj cksum.obj ip_input.obj queue.obj \ + tcp_input.obj debug.obj ip_output.obj sbuf.obj \ + tcp_output.obj udp.obj if.obj mbuf.obj slirp.obj \ + tcp_subr.obj \ net_ne2000.obj SNDOBJ := sound.obj \ @@ -625,6 +627,9 @@ else %.obj: %.cpp @$(CPP) $(CXXFLAGS) -Fo$@ -c $< +%.int: %.c + @$(PREPROC) $(OPTS) -Fo$@ $< + %.d: %.c $(wildcard $*.d) $(MCPP) $(OPTS) $(DEPS) $< >NUL diff --git a/src/win/win.c b/src/win/win.c index e2bf205..e545118 100644 --- a/src/win/win.c +++ b/src/win/win.c @@ -72,30 +72,16 @@ #include "win.h" -typedef struct { - WCHAR str[512]; -} rc_str_t; - - /* Platform Public data, specific. */ HINSTANCE hInstance; /* application instance */ LCID lang_id; /* current language ID used */ DWORD dwSubLangID; +const string_t *plat_strings; /* Local data. */ static HANDLE hBlitMutex, /* video mutex */ thMain; /* main thread */ -static rc_str_t *lpRCstr2048, - *lpRCstr4096, - *lpRCstr4352, - *lpRCstr4608, - *lpRCstr5120, - *lpRCstr5376, - *lpRCstr5632, - *lpRCstr5888, - *lpRCstr6144, - *lpRCstr7168; /* The list with supported VidAPI modules. */ @@ -125,48 +111,45 @@ const vidapi_t *plat_vidapis[] = { static void LoadCommonStrings(void) { - int i; + wchar_t temp[512], *str; + string_t *array, *tbl; + int c = 0, i; - lpRCstr2048 = (rc_str_t *)malloc(STR_NUM_2048*sizeof(rc_str_t)); - lpRCstr4096 = (rc_str_t *)malloc(STR_NUM_4096*sizeof(rc_str_t)); - lpRCstr4352 = (rc_str_t *)malloc(STR_NUM_4352*sizeof(rc_str_t)); - lpRCstr4608 = (rc_str_t *)malloc(STR_NUM_4608*sizeof(rc_str_t)); - lpRCstr5120 = (rc_str_t *)malloc(STR_NUM_5120*sizeof(rc_str_t)); - lpRCstr5376 = (rc_str_t *)malloc(STR_NUM_5376*sizeof(rc_str_t)); - lpRCstr5632 = (rc_str_t *)malloc(STR_NUM_5632*sizeof(rc_str_t)); - lpRCstr5888 = (rc_str_t *)malloc(STR_NUM_5888*sizeof(rc_str_t)); - lpRCstr6144 = (rc_str_t *)malloc(STR_NUM_6144*sizeof(rc_str_t)); - lpRCstr7168 = (rc_str_t *)malloc(STR_NUM_7168*sizeof(rc_str_t)); + /* + * First, we need to know how many strings are in the table. + * Sadly, there is no other way to determine this but to try + * to load all possible ID's... + */ + for (i = IDS_BEGIN; i < IDS_END; i++) + if (LoadString(hInstance, i, temp, sizeof_w(temp)) > 0) c++; - for (i=0; iid = i; + str = (wchar_t *)malloc((c + 1) * sizeof(wchar_t)); + wcscpy(str, temp); + tbl->str = str; - for (i=0; istr = NULL; - for (i=0; i= 2048) && (i <= 3071)) - str = lpRCstr2048[i-2048].str; - else if ((i >= 4096) && (i <= 4351)) - str = lpRCstr4096[i-4096].str; - else if ((i >= 4352) && (i <= 4607)) - str = lpRCstr4352[i-4352].str; - else if ((i >= 4608) && (i <= 5119)) - str = lpRCstr4608[i-4608].str; - else if ((i >= 5120) && (i <= 5375)) - str = lpRCstr5120[i-5120].str; - else if ((i >= 5376) && (i <= 5631)) - str = lpRCstr5376[i-5376].str; - else if ((i >= 5632) && (i <= 5887)) - str = lpRCstr5632[i-5632].str; - else if ((i >= 5888) && (i <= 6143)) - str = lpRCstr5888[i-5888].str; - else if ((i >= 6144) && (i <= 7167)) - str = lpRCstr6144[i-6144].str; - else - str = lpRCstr7168[i-7168].str; - - return((wchar_t *)str); -} - - void plat_get_exe_name(wchar_t *bufp, int size) { diff --git a/src/win/win.h b/src/win/win.h index af77295..46b0f9e 100644 --- a/src/win/win.h +++ b/src/win/win.h @@ -76,7 +76,6 @@ extern HWND hwndMain, extern LCID lang_id; extern DWORD filterindex; extern int status_is_open; -extern const vidapi_t *vid_apis[]; /* VidApi initializers. */ extern const vidapi_t ddraw_vidapi; diff --git a/src/win/win_ddraw.cpp b/src/win/win_ddraw.cpp index d7dd1f2..4ef37db 100644 --- a/src/win/win_ddraw.cpp +++ b/src/win/win_ddraw.cpp @@ -8,7 +8,7 @@ * * Rendering module for Microsoft DirectDraw 9. * - * Version: @(#)win_ddraw.cpp 1.0.8 2018/05/07 + * Version: @(#)win_ddraw.cpp 1.0.9 2018/05/09 * * Authors: Fred N. van Kempen, * Miran Grca, @@ -228,7 +228,7 @@ SavePNG(const wchar_t *fn, HBITMAP hBitmap) fp = plat_fopen(fn, L"wb"); if (fp == NULL) { pclog("[SavePNG] File %ls could not be opened for writing!\n", fn); - _swprintf(temp, plat_get_string(IDS_2088), fn); + _swprintf(temp, get_string(IDS_2088), fn); ui_msgbox(MBX_ERROR, temp); return; } @@ -238,7 +238,7 @@ SavePNG(const wchar_t *fn, HBITMAP hBitmap) if (png_ptr == NULL) { (void)fclose(fp); pclog("[SavePNG] png_create_write_struct failed!\n"); - _swprintf(temp, plat_get_string(IDS_2088), fn); + _swprintf(temp, get_string(IDS_2088), fn); ui_msgbox(MBX_ERROR, temp); return; } @@ -247,7 +247,7 @@ SavePNG(const wchar_t *fn, HBITMAP hBitmap) if (png_info_ptr == NULL) { (void)fclose(fp); pclog("[SavePNG] png_create_info_struct failed!\n"); - _swprintf(temp, plat_get_string(IDS_2088), fn); + _swprintf(temp, get_string(IDS_2088), fn); ui_msgbox(MBX_ERROR, temp); return; } @@ -267,7 +267,7 @@ SavePNG(const wchar_t *fn, HBITMAP hBitmap) if ((pBuf = malloc(bmpInfo.bmiHeader.biSizeImage)) == NULL) { (void)fclose(fp); pclog("[SavePNG] Unable to allocate bitmap memory!\n"); - _swprintf(temp, plat_get_string(IDS_2088), fn); + _swprintf(temp, get_string(IDS_2088), fn); ui_msgbox(MBX_ERROR, temp); return; } @@ -279,7 +279,7 @@ SavePNG(const wchar_t *fn, HBITMAP hBitmap) (void)fclose(fp); free(pBuf); pclog("[SavePNG] Unable to allocate secondary bitmap memory!\n"); - _swprintf(temp, plat_get_string(IDS_2088), fn); + _swprintf(temp, get_string(IDS_2088), fn); ui_msgbox(MBX_ERROR, temp); return; } @@ -308,7 +308,7 @@ SavePNG(const wchar_t *fn, HBITMAP hBitmap) free(pBuf); free(pBuf2); pclog("[SavePNG] Unable to allocate RGB bitmap memory!\n"); - _swprintf(temp, plat_get_string(IDS_2088), fn); + _swprintf(temp, get_string(IDS_2088), fn); ui_msgbox(MBX_ERROR, temp); return; } @@ -381,7 +381,7 @@ SaveBMP(const wchar_t *fn, HBITMAP hBitmap) GetDIBits(hdc, hBitmap, 0, bmpInfo.bmiHeader.biHeight, pBuf, &bmpInfo, DIB_RGB_COLORS); if ((fp = _wfopen(fn, L"wb")) == NULL) { - _swprintf(temp, plat_get_string(IDS_2088), fn); + _swprintf(temp, get_string(IDS_2088), fn); ui_msgbox(MBX_ERROR, temp); break; } diff --git a/src/win/win_dialog.c b/src/win/win_dialog.c index d500fc5..ab5c686 100644 --- a/src/win/win_dialog.c +++ b/src/win/win_dialog.c @@ -8,7 +8,7 @@ * * Implementation of server several dialogs. * - * Version: @(#)win_dialog.c 1.0.8 2018/04/29 + * Version: @(#)win_dialog.c 1.0.9 2018/05/09 * * Authors: Fred N. van Kempen, * Miran Grca, @@ -89,8 +89,8 @@ ui_msgbox(int flags, void *arg) { WCHAR temp[512]; DWORD fl = 0; - WCHAR *str = NULL; - WCHAR *cap = NULL; + const WCHAR *str = NULL; + const WCHAR *cap = NULL; switch(flags & 0x1f) { case MBX_INFO: /* just an informational message */ @@ -100,16 +100,16 @@ ui_msgbox(int flags, void *arg) case MBX_WARNING: /* warning message */ fl = (MB_YESNO | MB_ICONWARNING); - cap = plat_get_string(IDS_2051); /* "Warning" */ + cap = get_string(IDS_2051); /* "Warning" */ break; case MBX_ERROR: /* error message */ if (flags & MBX_FATAL) { fl = (MB_OK | MB_ICONERROR); - cap = plat_get_string(IDS_2049); /* "Fatal Error"*/ + cap = get_string(IDS_2049); /* "Fatal Error"*/ } else { fl = (MB_OK | MB_ICONWARNING); - cap = plat_get_string(IDS_2048); /* "Error" */ + cap = get_string(IDS_2048); /* "Error" */ } break; @@ -120,7 +120,7 @@ ui_msgbox(int flags, void *arg) case MBX_CONFIG: /* configuration */ fl = (MB_YESNO | MB_ICONERROR); - cap = plat_get_string(IDS_2050); /* "Configuration Error" */ + cap = get_string(IDS_2050); /* "Configuration Error" */ break; } @@ -145,7 +145,7 @@ ui_msgbox(int flags, void *arg) * that if the value of 'arg' is low, its an ID.. */ if (((uintptr_t)arg) < ((uintptr_t)65636)) - str = plat_get_string((intptr_t)arg); + str = get_string((intptr_t)arg); } /* At any rate, we do have a valid (wide) string now. */ diff --git a/src/win/win_new_floppy.c b/src/win/win_new_floppy.c index c15c18f..33c9c04 100644 --- a/src/win/win_new_floppy.c +++ b/src/win/win_new_floppy.c @@ -8,7 +8,7 @@ * * Implementation of the New Floppy Image dialog. * - * Version: @(#)win_new_floppy.c 1.0.13 2018/05/06 + * Version: @(#)win_new_floppy.c 1.0.14 2018/05/09 * * Authors: Fred N. van Kempen, * Miran Grca, @@ -85,18 +85,18 @@ dlg_init(HWND hdlg) zip_types = zip_drives[fdd_id].is_250 ? 2 : 1; for (i = 0; i < zip_types; i++) SendMessage(h, CB_ADDSTRING, 0, - (LPARAM)plat_get_string(IDS_5900 + i)); + (LPARAM)get_string(IDS_5900 + i)); } else { for (i = 0; i < 12; i++) SendMessage(h, CB_ADDSTRING, 0, - (LPARAM)plat_get_string(IDS_5888 + i)); + (LPARAM)get_string(IDS_5888 + i)); } SendMessage(h, CB_SETCURSEL, 0, 0); EnableWindow(h, FALSE); h = GetDlgItem(hdlg, IDC_COMBO_RPM_MODE); for (i = 0; i < 4; i++) - SendMessage(h, CB_ADDSTRING, 0, (LPARAM)plat_get_string(IDS_6144 + i)); + SendMessage(h, CB_ADDSTRING, 0, (LPARAM)get_string(IDS_6144 + i)); SendMessage(h, CB_SETCURSEL, 0, 0); EnableWindow(h, FALSE); ShowWindow(h, SW_HIDE); @@ -181,7 +181,7 @@ dlg_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam) return TRUE; case IDC_CFILE: - if (! dlg_file_ex(hdlg, plat_get_string(is_zip ? IDS_2176 : IDS_2174), NULL, temp_path, 1)) { + if (! dlg_file_ex(hdlg, get_string(is_zip ? IDS_2176 : IDS_2174), NULL, temp_path, 1)) { if (! wcschr(temp_path, L'.')) { if (wcslen(temp_path) && (wcslen(temp_path) <= 256)) { twcs = &temp_path[wcslen(temp_path)]; diff --git a/src/win/win_settings.c b/src/win/win_settings.c index f876eb7..2220b31 100644 --- a/src/win/win_settings.c +++ b/src/win/win_settings.c @@ -8,7 +8,7 @@ * * Implementation of the Settings dialog. * - * Version: @(#)win_settings.c 1.0.28 2018/05/06 + * Version: @(#)win_settings.c 1.0.29 2018/05/09 * * Authors: Fred N. van Kempen, * Miran Grca, @@ -552,7 +552,7 @@ insert_categories(HWND hwndList) lvI.stateMask = lvI.iSubItem = lvI.state = 0; for (i=0; i<10; i++) { - lvI.pszText = plat_get_string(IDS_2065+i); + lvI.pszText = (LPTSTR)get_string(IDS_2065+i); lvI.iItem = i; lvI.iImage = i; diff --git a/src/win/win_settings_disk.h b/src/win/win_settings_disk.h index a8bd276..2dc8624 100644 --- a/src/win/win_settings_disk.h +++ b/src/win/win_settings_disk.h @@ -8,7 +8,7 @@ * * Implementation of the Settings dialog. * - * Version: @(#)win_settings_disk.h 1.0.7 2018/05/02 + * Version: @(#)win_settings_disk.h 1.0.8 2018/05/09 * * Authors: Fred N. van Kempen, * Miran Grca, @@ -165,29 +165,29 @@ disk_add_locations(HWND hdlg) h = GetDlgItem(hdlg, IDC_COMBO_HD_BUS); for (i = 0; i < 6; i++) - SendMessage(h, CB_ADDSTRING, 0, (LPARAM)plat_get_string(IDS_4352 + i)); + SendMessage(h, CB_ADDSTRING, 0, (LPARAM)get_string(IDS_4352 + i)); h = GetDlgItem(hdlg, IDC_COMBO_HD_CHANNEL); for (i = 0; i < 8; i++) { - swprintf(temp, sizeof_w(temp), plat_get_string(IDS_4097), i >> 1, i & 1); + swprintf(temp, sizeof_w(temp), get_string(IDS_4097), i >> 1, i & 1); SendMessage(h, CB_ADDSTRING, 0, (LPARAM)temp); } h = GetDlgItem(hdlg, IDC_COMBO_HD_ID); for (i = 0; i < 16; i++) { - swprintf(temp, sizeof_w(temp), plat_get_string(IDS_4098), i); + swprintf(temp, sizeof_w(temp), get_string(IDS_4098), i); SendMessage(h, CB_ADDSTRING, 0, (LPARAM)temp); } h = GetDlgItem(hdlg, IDC_COMBO_HD_LUN); for (i = 0; i < 8; i++) { - swprintf(temp, sizeof_w(temp), plat_get_string(IDS_4098), i); + swprintf(temp, sizeof_w(temp), get_string(IDS_4098), i); SendMessage(h, CB_ADDSTRING, 0, (LPARAM)temp); } h = GetDlgItem(hdlg, IDC_COMBO_HD_CHANNEL_IDE); for (i = 0; i < 8; i++) { - swprintf(temp, sizeof_w(temp), plat_get_string(IDS_4097), i >> 1, i & 1); + swprintf(temp, sizeof_w(temp), get_string(IDS_4097), i >> 1, i & 1); SendMessage(h, CB_ADDSTRING, 0, (LPARAM)temp); } } @@ -464,27 +464,27 @@ disk_update_item(HWND hwndList, int i, int column) if (column == 0) { switch(temp_hdd[i].bus) { case HDD_BUS_ST506: - swprintf(temp, sizeof_w(temp), plat_get_string(IDS_4608), temp_hdd[i].id.st506_channel >> 1, temp_hdd[i].id.st506_channel & 1); + swprintf(temp, sizeof_w(temp), get_string(IDS_4608), temp_hdd[i].id.st506_channel >> 1, temp_hdd[i].id.st506_channel & 1); break; case HDD_BUS_ESDI: - swprintf(temp, sizeof_w(temp), plat_get_string(IDS_4609), temp_hdd[i].id.esdi_channel >> 1, temp_hdd[i].id.esdi_channel & 1); + swprintf(temp, sizeof_w(temp), get_string(IDS_4609), temp_hdd[i].id.esdi_channel >> 1, temp_hdd[i].id.esdi_channel & 1); break; case HDD_BUS_IDE_PIO_ONLY: - swprintf(temp, sizeof_w(temp), plat_get_string(IDS_4610), temp_hdd[i].id.ide_channel >> 1, temp_hdd[i].id.ide_channel & 1); + swprintf(temp, sizeof_w(temp), get_string(IDS_4610), temp_hdd[i].id.ide_channel >> 1, temp_hdd[i].id.ide_channel & 1); break; case HDD_BUS_IDE_PIO_AND_DMA: - swprintf(temp, sizeof_w(temp), plat_get_string(IDS_4611), temp_hdd[i].id.ide_channel >> 1, temp_hdd[i].id.ide_channel & 1); + swprintf(temp, sizeof_w(temp), get_string(IDS_4611), temp_hdd[i].id.ide_channel >> 1, temp_hdd[i].id.ide_channel & 1); break; case HDD_BUS_SCSI: - swprintf(temp, sizeof_w(temp), plat_get_string(IDS_4612), temp_hdd[i].id.scsi.id, temp_hdd[i].id.scsi.lun); + swprintf(temp, sizeof_w(temp), get_string(IDS_4612), temp_hdd[i].id.scsi.id, temp_hdd[i].id.scsi.lun); break; case HDD_BUS_SCSI_REMOVABLE: - swprintf(temp, sizeof_w(temp), plat_get_string(IDS_4613), temp_hdd[i].id.scsi.id, temp_hdd[i].id.scsi.lun); + swprintf(temp, sizeof_w(temp), get_string(IDS_4613), temp_hdd[i].id.scsi.id, temp_hdd[i].id.scsi.lun); break; } @@ -494,19 +494,19 @@ disk_update_item(HWND hwndList, int i, int column) lvI.pszText = temp_hdd[i].fn; lvI.iImage = 0; } else if (column == 2) { - swprintf(temp, sizeof_w(temp), plat_get_string(IDS_4098), temp_hdd[i].tracks); + swprintf(temp, sizeof_w(temp), get_string(IDS_4098), temp_hdd[i].tracks); lvI.pszText = temp; lvI.iImage = 0; } else if (column == 3) { - swprintf(temp, sizeof_w(temp), plat_get_string(IDS_4098), temp_hdd[i].hpc); + swprintf(temp, sizeof_w(temp), get_string(IDS_4098), temp_hdd[i].hpc); lvI.pszText = temp; lvI.iImage = 0; } else if (column == 4) { - swprintf(temp, sizeof_w(temp), plat_get_string(IDS_4098), temp_hdd[i].spt); + swprintf(temp, sizeof_w(temp), get_string(IDS_4098), temp_hdd[i].spt); lvI.pszText = temp; lvI.iImage = 0; } else if (column == 5) { - swprintf(temp, sizeof_w(temp), plat_get_string(IDS_4098), (temp_hdd[i].tracks * temp_hdd[i].hpc * temp_hdd[i].spt) >> 11); + swprintf(temp, sizeof_w(temp), get_string(IDS_4098), (temp_hdd[i].tracks * temp_hdd[i].hpc * temp_hdd[i].spt) >> 11); lvI.pszText = temp; lvI.iImage = 0; } @@ -547,27 +547,27 @@ disk_recalc_list(HWND hwndList) switch(temp_hdd[i].bus) { case HDD_BUS_ST506: - swprintf(temp, sizeof_w(temp), plat_get_string(IDS_4608), temp_hdd[i].id.st506_channel >> 1, temp_hdd[i].id.st506_channel & 1); + swprintf(temp, sizeof_w(temp), get_string(IDS_4608), temp_hdd[i].id.st506_channel >> 1, temp_hdd[i].id.st506_channel & 1); break; case HDD_BUS_ESDI: - swprintf(temp, sizeof_w(temp), plat_get_string(IDS_4609), temp_hdd[i].id.esdi_channel >> 1, temp_hdd[i].id.esdi_channel & 1); + swprintf(temp, sizeof_w(temp), get_string(IDS_4609), temp_hdd[i].id.esdi_channel >> 1, temp_hdd[i].id.esdi_channel & 1); break; case HDD_BUS_IDE_PIO_ONLY: - swprintf(temp, sizeof_w(temp), plat_get_string(IDS_4610), temp_hdd[i].id.ide_channel >> 1, temp_hdd[i].id.ide_channel & 1); + swprintf(temp, sizeof_w(temp), get_string(IDS_4610), temp_hdd[i].id.ide_channel >> 1, temp_hdd[i].id.ide_channel & 1); break; case HDD_BUS_IDE_PIO_AND_DMA: - swprintf(temp, sizeof_w(temp), plat_get_string(IDS_4611), temp_hdd[i].id.ide_channel >> 1, temp_hdd[i].id.ide_channel & 1); + swprintf(temp, sizeof_w(temp), get_string(IDS_4611), temp_hdd[i].id.ide_channel >> 1, temp_hdd[i].id.ide_channel & 1); break; case HDD_BUS_SCSI: - swprintf(temp, sizeof_w(temp), plat_get_string(IDS_4612), temp_hdd[i].id.scsi.id, temp_hdd[i].id.scsi.lun); + swprintf(temp, sizeof_w(temp), get_string(IDS_4612), temp_hdd[i].id.scsi.id, temp_hdd[i].id.scsi.lun); break; case HDD_BUS_SCSI_REMOVABLE: - swprintf(temp, sizeof_w(temp), plat_get_string(IDS_4613), temp_hdd[i].id.scsi.id, temp_hdd[i].id.scsi.lun); + swprintf(temp, sizeof_w(temp), get_string(IDS_4613), temp_hdd[i].id.scsi.id, temp_hdd[i].id.scsi.lun); break; } @@ -583,28 +583,28 @@ disk_recalc_list(HWND hwndList) if (ListView_SetItem(hwndList, &lvI) == -1) return FALSE; lvI.iSubItem = 2; - swprintf(temp, sizeof_w(temp), plat_get_string(IDS_4098), temp_hdd[i].tracks); + swprintf(temp, sizeof_w(temp), get_string(IDS_4098), temp_hdd[i].tracks); lvI.pszText = temp; lvI.iItem = j; lvI.iImage = 0; if (ListView_SetItem(hwndList, &lvI) == -1) return FALSE; lvI.iSubItem = 3; - swprintf(temp, sizeof_w(temp), plat_get_string(IDS_4098), temp_hdd[i].hpc); + swprintf(temp, sizeof_w(temp), get_string(IDS_4098), temp_hdd[i].hpc); lvI.pszText = temp; lvI.iItem = j; lvI.iImage = 0; if (ListView_SetItem(hwndList, &lvI) == -1) return FALSE; lvI.iSubItem = 4; - swprintf(temp, sizeof_w(temp), plat_get_string(IDS_4098), temp_hdd[i].spt); + swprintf(temp, sizeof_w(temp), get_string(IDS_4098), temp_hdd[i].spt); lvI.pszText = temp; lvI.iItem = j; lvI.iImage = 0; if (ListView_SetItem(hwndList, &lvI) == -1) return FALSE; lvI.iSubItem = 5; - swprintf(temp, sizeof_w(temp), plat_get_string(IDS_4098), (temp_hdd[i].tracks * temp_hdd[i].hpc * temp_hdd[i].spt) >> 11); + swprintf(temp, sizeof_w(temp), get_string(IDS_4098), (temp_hdd[i].tracks * temp_hdd[i].hpc * temp_hdd[i].spt) >> 11); lvI.pszText = temp; lvI.iItem = j; lvI.iImage = 0; @@ -631,7 +631,7 @@ disk_init_columns(HWND hwndList) lvc.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM; lvc.iSubItem = iCol; - lvc.pszText = plat_get_string(2082 + iCol); + lvc.pszText = (LPTSTR)get_string(2082 + iCol); switch(iCol) { case 0: /* Bus */ @@ -699,7 +699,7 @@ set_edit_box_contents(HWND hdlg, int id, uint64_t val) HWND h; h = GetDlgItem(hdlg, id); - swprintf(temp, sizeof_w(temp), plat_get_string(IDS_2156), val); + swprintf(temp, sizeof_w(temp), get_string(IDS_2156), val); SendMessage(h, WM_SETTEXT, (WPARAM)wcslen(temp), (LPARAM)temp); } @@ -720,7 +720,7 @@ disk_initialize_hdt(HWND hdlg) temp_size = hdd_table[i].cyls * hdd_table[i].head * hdd_table[i].sect; size_mb = temp_size >> 11; swprintf(temp, sizeof_w(temp), - plat_get_string(IDS_2157), + get_string(IDS_2157), size_mb, hdd_table[i].cyls, hdd_table[i].head, hdd_table[i].sect); SendMessage(h, CB_ADDSTRING, 0, (LPARAM)temp); @@ -728,8 +728,8 @@ disk_initialize_hdt(HWND hdlg) selection = i; } - SendMessage(h, CB_ADDSTRING, 0, (LPARAM)plat_get_string(IDS_4100)); - SendMessage(h, CB_ADDSTRING, 0, (LPARAM)plat_get_string(IDS_4101)); + SendMessage(h, CB_ADDSTRING, 0, (LPARAM)get_string(IDS_4100)); + SendMessage(h, CB_ADDSTRING, 0, (LPARAM)get_string(IDS_4101)); SendMessage(h, CB_SETCURSEL, selection & 0xffff, 0); return selection; @@ -791,7 +791,7 @@ disk_add_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam) hdd_ptr = &(temp_hdd[next_free_id]); } - SetWindowText(hdlg, plat_get_string((existing & 1) ? IDS_4103 : IDS_4102)); + SetWindowText(hdlg, get_string((existing & 1) ? IDS_4103 : IDS_4102)); no_update = 1; spt = (existing & 1) ? 0 : 17; @@ -1065,7 +1065,7 @@ hd_add_ok_common: return TRUE; case IDC_CFILE: - if (! dlg_file_ex(hdlg, plat_get_string(IDS_4106), NULL, temp_path, !(existing & 1))) { + if (! dlg_file_ex(hdlg, get_string(IDS_4106), NULL, temp_path, !(existing & 1))) { if (! wcschr(temp_path, L'.')) { if (wcslen(temp_path) && (wcslen(temp_path) <= 256)) { twcs = &temp_path[wcslen(temp_path)]; diff --git a/src/win/win_settings_floppy.h b/src/win/win_settings_floppy.h index 720d583..b1c3ccf 100644 --- a/src/win/win_settings_floppy.h +++ b/src/win/win_settings_floppy.h @@ -8,7 +8,7 @@ * * Implementation of the Settings dialog. * - * Version: @(#)win_settings_floppy.h 1.0.4 2018/05/03 + * Version: @(#)win_settings_floppy.h 1.0.5 2018/05/09 * * Authors: Fred N. van Kempen, * Miran Grca, @@ -85,7 +85,7 @@ floppy_recalc_list(HWND hwndList) mbstowcs(temp, tempA, sizeof_w(temp)); lvI.pszText = temp; } else { - lvI.pszText = plat_get_string(IDS_5376); + lvI.pszText = (LPTSTR)get_string(IDS_5376); } lvI.iItem = i; lvI.iImage = temp_fdd_types[i]; @@ -93,14 +93,14 @@ floppy_recalc_list(HWND hwndList) return FALSE; lvI.iSubItem = 1; - lvI.pszText = plat_get_string(temp_fdd_turbo[i] ? IDS_2060 : IDS_2061); + lvI.pszText = (LPTSTR)get_string(temp_fdd_turbo[i] ? IDS_2060 : IDS_2061); lvI.iItem = i; lvI.iImage = 0; if (ListView_SetItem(hwndList, &lvI) == -1) return FALSE; lvI.iSubItem = 2; - lvI.pszText = plat_get_string(temp_fdd_check_bpb[i] ? IDS_2060 : IDS_2061); + lvI.pszText = (LPTSTR)get_string(temp_fdd_check_bpb[i] ? IDS_2060 : IDS_2061); lvI.iItem = i; lvI.iImage = 0; if (ListView_SetItem(hwndList, &lvI) == -1) @@ -119,21 +119,21 @@ floppy_init_columns(HWND hwndList) lvc.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM; lvc.iSubItem = 0; - lvc.pszText = plat_get_string(IDS_2143); + lvc.pszText = (LPTSTR)get_string(IDS_2143); lvc.cx = 292; lvc.fmt = LVCFMT_LEFT; if (ListView_InsertColumn(hwndList, 0, &lvc) == -1) return FALSE; lvc.iSubItem = 1; - lvc.pszText = plat_get_string(IDS_2059); + lvc.pszText = (LPTSTR)get_string(IDS_2059); lvc.cx = 50; lvc.fmt = LVCFMT_LEFT; if (ListView_InsertColumn(hwndList, 1, &lvc) == -1) return FALSE; lvc.iSubItem = 2; - lvc.pszText = plat_get_string(IDS_2170); + lvc.pszText = (LPTSTR)get_string(IDS_2170); lvc.cx = 75; lvc.fmt = LVCFMT_LEFT; if (ListView_InsertColumn(hwndList, 2, &lvc) == -1) @@ -179,21 +179,21 @@ floppy_update_item(HWND hwndList, int i) mbstowcs(temp, tempA, sizeof_w(temp)); lvI.pszText = temp; } else { - lvI.pszText = plat_get_string(IDS_5376); + lvI.pszText = (LPTSTR)get_string(IDS_5376); } lvI.iImage = temp_fdd_types[i]; if (ListView_SetItem(hwndList, &lvI) == -1) return; lvI.iSubItem = 1; - lvI.pszText = plat_get_string(temp_fdd_turbo[i] ? IDS_2060 : IDS_2061); + lvI.pszText = (LPTSTR)get_string(temp_fdd_turbo[i] ? IDS_2060 : IDS_2061); lvI.iItem = i; lvI.iImage = 0; if (ListView_SetItem(hwndList, &lvI) == -1) return; lvI.iSubItem = 2; - lvI.pszText = plat_get_string(temp_fdd_check_bpb[i] ? IDS_2060 : IDS_2061); + lvI.pszText = (LPTSTR)get_string(temp_fdd_check_bpb[i] ? IDS_2060 : IDS_2061); lvI.iItem = i; lvI.iImage = 0; if (ListView_SetItem(hwndList, &lvI) == -1) @@ -226,7 +226,7 @@ floppy_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam) h = GetDlgItem(hdlg, IDC_COMBO_FD_TYPE); for (i = 0; i < 14; i++) { if (i == 0) { - SendMessage(h, CB_ADDSTRING, 0, (LPARAM)plat_get_string(IDS_5376)); + SendMessage(h, CB_ADDSTRING, 0, (LPARAM)get_string(IDS_5376)); } else { mbstowcs(temp, fdd_getname(i), sizeof_w(temp)); SendMessage(h, CB_ADDSTRING, 0, (LPARAM)temp); diff --git a/src/win/win_settings_machine.h b/src/win/win_settings_machine.h index 195ab5c..152a850 100644 --- a/src/win/win_settings_machine.h +++ b/src/win/win_settings_machine.h @@ -8,7 +8,7 @@ * * Implementation of the Settings dialog. * - * Version: @(#)win_settings_machine.h 1.0.5 2018/05/02 + * Version: @(#)win_settings_machine.h 1.0.6 2018/05/09 * * Authors: Fred N. van Kempen, * Miran Grca, @@ -178,11 +178,11 @@ machine_recalc_machine(HWND hdlg) if (!(machines[romstomachine[rs]].flags & MACHINE_AT) || (machines[romstomachine[rs]].ram_granularity >= 128)) { SendMessage(h, UDM_SETPOS, 0, temp_mem_size); h = GetDlgItem(hdlg, IDC_TEXT_MB); - SendMessage(h, WM_SETTEXT, 0, (LPARAM)plat_get_string(IDS_2094)); + SendMessage(h, WM_SETTEXT, 0, (LPARAM)get_string(IDS_2094)); } else { SendMessage(h, UDM_SETPOS, 0, temp_mem_size / 1024); h = GetDlgItem(hdlg, IDC_TEXT_MB); - SendMessage(h, WM_SETTEXT, 0, (LPARAM)plat_get_string(IDS_2087)); + SendMessage(h, WM_SETTEXT, 0, (LPARAM)get_string(IDS_2087)); } } @@ -223,10 +223,10 @@ machine_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam) SendMessage(h, CB_SETCURSEL, machinetolist[temp_machine], 0); h = GetDlgItem(hdlg, IDC_COMBO_WS); - SendMessage(h, CB_ADDSTRING, 0, (LPARAM)plat_get_string(IDS_2131)); + SendMessage(h, CB_ADDSTRING, 0, (LPARAM)get_string(IDS_2131)); for (c = 0; c < 8; c++) { - swprintf(temp, sizeof_w(temp), plat_get_string(2132), c); + swprintf(temp, sizeof_w(temp), get_string(2132), c); SendMessage(h, CB_ADDSTRING, 0, (LPARAM)temp); } diff --git a/src/win/win_settings_periph.h b/src/win/win_settings_periph.h index ce42171..3a937d3 100644 --- a/src/win/win_settings_periph.h +++ b/src/win/win_settings_periph.h @@ -8,7 +8,7 @@ * * Implementation of the Settings dialog. * - * Version: @(#)win_settings_periph.h 1.0.7 2018/05/04 + * Version: @(#)win_settings_periph.h 1.0.8 2018/05/09 * * Authors: Fred N. van Kempen, * Miran Grca, @@ -150,7 +150,7 @@ peripherals_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam) if (device_is_valid(dev, machines[temp_machine].flags)) { if (c == 0) { - SendMessage(h, CB_ADDSTRING, 0, (LPARAM)plat_get_string(IDS_2152)); + SendMessage(h, CB_ADDSTRING, 0, (LPARAM)get_string(IDS_2152)); } else { mbstowcs(temp, stransi, sizeof_w(temp)); SendMessage(h, CB_ADDSTRING, 0, (LPARAM)temp); @@ -180,9 +180,9 @@ peripherals_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam) recalc_hdc_list(hdlg, temp_machine, 0); h = GetDlgItem(hdlg, IDC_COMBO_IDE_TER); - SendMessage(h, CB_ADDSTRING, 0, (LPARAM)plat_get_string(IDS_5376)); + SendMessage(h, CB_ADDSTRING, 0, (LPARAM)get_string(IDS_5376)); for (c = 0; c < 11; c++) { - swprintf(temp, sizeof_w(temp), plat_get_string(IDS_2155), valid_ide_irqs[c]); + swprintf(temp, sizeof_w(temp), get_string(IDS_2155), valid_ide_irqs[c]); SendMessage(h, CB_ADDSTRING, 0, (LPARAM)temp); } if (temp_ide_ter) @@ -191,9 +191,9 @@ peripherals_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam) SendMessage(h, CB_SETCURSEL, 0, 0); h = GetDlgItem(hdlg, IDC_COMBO_IDE_QUA); - SendMessage(h, CB_ADDSTRING, 0, (LPARAM)plat_get_string(IDS_5376)); + SendMessage(h, CB_ADDSTRING, 0, (LPARAM)get_string(IDS_5376)); for (c = 0; c < 11; c++) { - swprintf(temp, sizeof_w(temp), plat_get_string(IDS_2155), valid_ide_irqs[c]); + swprintf(temp, sizeof_w(temp), get_string(IDS_2155), valid_ide_irqs[c]); SendMessage(h, CB_ADDSTRING, 0, (LPARAM)temp); } if (temp_ide_qua) diff --git a/src/win/win_settings_remov.h b/src/win/win_settings_remov.h index f2147f5..fcc1426 100644 --- a/src/win/win_settings_remov.h +++ b/src/win/win_settings_remov.h @@ -8,7 +8,7 @@ * * Implementation of the "Removable Devices" dialog. * - * Version: @(#)win_settings_remov.h 1.0.5 2018/05/02 + * Version: @(#)win_settings_remov.h 1.0.6 2018/05/09 * * Authors: Fred N. van Kempen, * Miran Grca, @@ -117,24 +117,24 @@ cdrom_recalc_list(HWND hwndList) switch (temp_cdrom_drives[i].bus_type) { case CDROM_BUS_DISABLED: default: - lvI.pszText = plat_get_string(fsid); + lvI.pszText = (LPTSTR)get_string(fsid); lvI.iImage = 0; break; case CDROM_BUS_ATAPI_PIO_ONLY: - swprintf(temp, sizeof_w(temp), plat_get_string(fsid), temp_cdrom_drives[i].ide_channel >> 1, temp_cdrom_drives[i].ide_channel & 1); + swprintf(temp, sizeof_w(temp), get_string(fsid), temp_cdrom_drives[i].ide_channel >> 1, temp_cdrom_drives[i].ide_channel & 1); lvI.pszText = temp; lvI.iImage = 1; break; case CDROM_BUS_ATAPI_PIO_AND_DMA: - swprintf(temp, sizeof_w(temp), plat_get_string(fsid), temp_cdrom_drives[i].ide_channel >> 1, temp_cdrom_drives[i].ide_channel & 1); + swprintf(temp, sizeof_w(temp), get_string(fsid), temp_cdrom_drives[i].ide_channel >> 1, temp_cdrom_drives[i].ide_channel & 1); lvI.pszText = temp; lvI.iImage = 1; break; case CDROM_BUS_SCSI: - swprintf(temp, sizeof_w(temp), plat_get_string(fsid), temp_cdrom_drives[i].scsi_device_id, temp_cdrom_drives[i].scsi_device_lun); + swprintf(temp, sizeof_w(temp), get_string(fsid), temp_cdrom_drives[i].scsi_device_id, temp_cdrom_drives[i].scsi_device_lun); lvI.pszText = temp; lvI.iImage = 1; break; @@ -145,7 +145,7 @@ cdrom_recalc_list(HWND hwndList) lvI.iSubItem = 1; if (temp_cdrom_drives[i].bus_type == CDROM_BUS_DISABLED) { - lvI.pszText = plat_get_string(IDS_2152); + lvI.pszText = (LPTSTR)get_string(IDS_2152); } else { wsprintf(temp, L"%ix", cdrom_speeds[temp_cdrom_drives[i].speed_idx].speed); @@ -169,14 +169,14 @@ cdrom_init_columns(HWND hwndList) lvc.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM; lvc.iSubItem = 0; - lvc.pszText = plat_get_string(IDS_2082); + lvc.pszText = (LPTSTR)get_string(IDS_2082); lvc.cx = 342; lvc.fmt = LVCFMT_LEFT; if (ListView_InsertColumn(hwndList, 0, &lvc) == -1) return FALSE; lvc.iSubItem = 1; - lvc.pszText = plat_get_string(IDS_2179); + lvc.pszText = (LPTSTR)get_string(IDS_2179); lvc.cx = 50; lvc.fmt = LVCFMT_LEFT; if (ListView_InsertColumn(hwndList, 1, &lvc) == -1) @@ -222,24 +222,24 @@ cdrom_update_item(HWND hwndList, int i) switch (temp_cdrom_drives[i].bus_type) { case CDROM_BUS_DISABLED: default: - lvI.pszText = plat_get_string(fsid); + lvI.pszText = (LPTSTR)get_string(fsid); lvI.iImage = 0; break; case CDROM_BUS_ATAPI_PIO_ONLY: - swprintf(temp, sizeof_w(temp), plat_get_string(fsid), temp_cdrom_drives[i].ide_channel >> 1, temp_cdrom_drives[i].ide_channel & 1); + swprintf(temp, sizeof_w(temp), get_string(fsid), temp_cdrom_drives[i].ide_channel >> 1, temp_cdrom_drives[i].ide_channel & 1); lvI.pszText = temp; lvI.iImage = 1; break; case CDROM_BUS_ATAPI_PIO_AND_DMA: - swprintf(temp, sizeof_w(temp), plat_get_string(fsid), temp_cdrom_drives[i].ide_channel >> 1, temp_cdrom_drives[i].ide_channel & 1); + swprintf(temp, sizeof_w(temp), get_string(fsid), temp_cdrom_drives[i].ide_channel >> 1, temp_cdrom_drives[i].ide_channel & 1); lvI.pszText = temp; lvI.iImage = 1; break; case CDROM_BUS_SCSI: - swprintf(temp, sizeof_w(temp), plat_get_string(fsid), temp_cdrom_drives[i].scsi_device_id, temp_cdrom_drives[i].scsi_device_lun); + swprintf(temp, sizeof_w(temp), get_string(fsid), temp_cdrom_drives[i].scsi_device_id, temp_cdrom_drives[i].scsi_device_lun); lvI.pszText = temp; lvI.iImage = 1; break; @@ -249,7 +249,7 @@ cdrom_update_item(HWND hwndList, int i) lvI.iSubItem = 1; if (temp_cdrom_drives[i].bus_type == CDROM_BUS_DISABLED) { - lvI.pszText = plat_get_string(IDS_2152); + lvI.pszText = (LPTSTR)get_string(IDS_2152); } else { wsprintf(temp, L"%ix", cdrom_speeds[temp_cdrom_drives[i].speed_idx].speed); @@ -272,7 +272,7 @@ cdrom_add_locations(HWND hdlg) h = GetDlgItem(hdlg, IDC_COMBO_CD_BUS); for (i = CDROM_BUS_DISABLED; i <= CDROM_BUS_SCSI; i++) { if ((i == CDROM_BUS_DISABLED) || (i >= CDROM_BUS_ATAPI_PIO_ONLY)) { - SendMessage(h, CB_ADDSTRING, 0, (LPARAM)plat_get_string(combo_to_string(i))); + SendMessage(h, CB_ADDSTRING, 0, (LPARAM)get_string(combo_to_string(i))); } } @@ -285,19 +285,19 @@ cdrom_add_locations(HWND hdlg) h = GetDlgItem(hdlg, IDC_COMBO_CD_ID); for (i = 0; i < 16; i++) { - swprintf(temp, sizeof_w(temp), plat_get_string(IDS_4098), i); + swprintf(temp, sizeof_w(temp), get_string(IDS_4098), i); SendMessage(h, CB_ADDSTRING, 0, (LPARAM)temp); } h = GetDlgItem(hdlg, IDC_COMBO_CD_LUN); for (i = 0; i < 8; i++) { - swprintf(temp, sizeof_w(temp), plat_get_string(IDS_4098), i); + swprintf(temp, sizeof_w(temp), get_string(IDS_4098), i); SendMessage(h, CB_ADDSTRING, 0, (LPARAM)temp); } h = GetDlgItem(hdlg, IDC_COMBO_CD_CHANNEL_IDE); for (i = 0; i < 8; i++) { - swprintf(temp, sizeof_w(temp), plat_get_string(IDS_4097), i >> 1, i & 1); + swprintf(temp, sizeof_w(temp), get_string(IDS_4097), i >> 1, i & 1); SendMessage(h, CB_ADDSTRING, 0, (LPARAM)temp); } } @@ -464,24 +464,24 @@ zip_recalc_list(HWND hwndList) switch (temp_zip_drives[i].bus_type) { case ZIP_BUS_DISABLED: default: - lvI.pszText = plat_get_string(fsid); + lvI.pszText = (LPTSTR)get_string(fsid); lvI.iImage = 0; break; case ZIP_BUS_ATAPI_PIO_ONLY: - swprintf(temp, sizeof_w(temp), plat_get_string(fsid), temp_zip_drives[i].ide_channel >> 1, temp_zip_drives[i].ide_channel & 1); + swprintf(temp, sizeof_w(temp), get_string(fsid), temp_zip_drives[i].ide_channel >> 1, temp_zip_drives[i].ide_channel & 1); lvI.pszText = temp; lvI.iImage = 1; break; case ZIP_BUS_ATAPI_PIO_AND_DMA: - swprintf(temp, sizeof_w(temp), plat_get_string(fsid), temp_zip_drives[i].ide_channel >> 1, temp_zip_drives[i].ide_channel & 1); + swprintf(temp, sizeof_w(temp), get_string(fsid), temp_zip_drives[i].ide_channel >> 1, temp_zip_drives[i].ide_channel & 1); lvI.pszText = temp; lvI.iImage = 1; break; case ZIP_BUS_SCSI: - swprintf(temp, sizeof_w(temp), plat_get_string(fsid), temp_zip_drives[i].scsi_device_id, temp_zip_drives[i].scsi_device_lun); + swprintf(temp, sizeof_w(temp), get_string(fsid), temp_zip_drives[i].scsi_device_id, temp_zip_drives[i].scsi_device_lun); lvI.pszText = temp; lvI.iImage = 1; break; @@ -491,7 +491,7 @@ zip_recalc_list(HWND hwndList) return FALSE; lvI.iSubItem = 1; - lvI.pszText = plat_get_string(temp_zip_drives[i].is_250 ? IDS_5901 : IDS_5900); + lvI.pszText = (LPTSTR)get_string(temp_zip_drives[i].is_250 ? IDS_5901 : IDS_5900); lvI.iItem = i; lvI.iImage = 0; if (ListView_SetItem(hwndList, &lvI) == -1) @@ -510,14 +510,14 @@ zip_init_columns(HWND hwndList) lvc.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM; lvc.iSubItem = 0; - lvc.pszText = plat_get_string(IDS_2082); + lvc.pszText = (LPTSTR)get_string(IDS_2082); lvc.cx = 342; lvc.fmt = LVCFMT_LEFT; if (ListView_InsertColumn(hwndList, 0, &lvc) == -1) return FALSE; lvc.iSubItem = 1; - lvc.pszText = plat_get_string(IDS_2143); + lvc.pszText = (LPTSTR)get_string(IDS_2143); lvc.cx = 50; lvc.fmt = LVCFMT_LEFT; if (ListView_InsertColumn(hwndList, 1, &lvc) == -1) @@ -563,24 +563,24 @@ zip_update_item(HWND hwndList, int i) switch (temp_zip_drives[i].bus_type) { case ZIP_BUS_DISABLED: default: - lvI.pszText = plat_get_string(fsid); + lvI.pszText = (LPTSTR)get_string(fsid); lvI.iImage = 0; break; case ZIP_BUS_ATAPI_PIO_ONLY: - swprintf(temp, sizeof_w(temp), plat_get_string(fsid), temp_zip_drives[i].ide_channel >> 1, temp_zip_drives[i].ide_channel & 1); + swprintf(temp, sizeof_w(temp), get_string(fsid), temp_zip_drives[i].ide_channel >> 1, temp_zip_drives[i].ide_channel & 1); lvI.pszText = temp; lvI.iImage = 1; break; case ZIP_BUS_ATAPI_PIO_AND_DMA: - swprintf(temp, sizeof_w(temp), plat_get_string(fsid), temp_zip_drives[i].ide_channel >> 1, temp_zip_drives[i].ide_channel & 1); + swprintf(temp, sizeof_w(temp), get_string(fsid), temp_zip_drives[i].ide_channel >> 1, temp_zip_drives[i].ide_channel & 1); lvI.pszText = temp; lvI.iImage = 1; break; case ZIP_BUS_SCSI: - swprintf(temp, sizeof_w(temp), plat_get_string(fsid), temp_zip_drives[i].scsi_device_id, temp_zip_drives[i].scsi_device_lun); + swprintf(temp, sizeof_w(temp), get_string(fsid), temp_zip_drives[i].scsi_device_id, temp_zip_drives[i].scsi_device_lun); lvI.pszText = temp; lvI.iImage = 1; break; @@ -589,7 +589,7 @@ zip_update_item(HWND hwndList, int i) return; lvI.iSubItem = 1; - lvI.pszText = plat_get_string(temp_zip_drives[i].is_250 ? IDS_5901 : IDS_5900); + lvI.pszText = (LPTSTR)get_string(temp_zip_drives[i].is_250 ? IDS_5901 : IDS_5900); lvI.iItem = i; lvI.iImage = 0; if (ListView_SetItem(hwndList, &lvI) == -1) @@ -607,25 +607,25 @@ zip_add_locations(HWND hdlg) h = GetDlgItem(hdlg, IDC_COMBO_ZIP_BUS); for (i = ZIP_BUS_DISABLED; i <= ZIP_BUS_SCSI; i++) { if ((i == ZIP_BUS_DISABLED) || (i >= ZIP_BUS_ATAPI_PIO_ONLY)) { - SendMessage(h, CB_ADDSTRING, 0, (LPARAM)plat_get_string(combo_to_string(i))); + SendMessage(h, CB_ADDSTRING, 0, (LPARAM)get_string(combo_to_string(i))); } } h = GetDlgItem(hdlg, IDC_COMBO_ZIP_ID); for (i = 0; i < 16; i++) { - swprintf(temp, sizeof_w(temp), plat_get_string(IDS_4098), i); + swprintf(temp, sizeof_w(temp), get_string(IDS_4098), i); SendMessage(h, CB_ADDSTRING, 0, (LPARAM)temp); } h = GetDlgItem(hdlg, IDC_COMBO_ZIP_LUN); for (i = 0; i < 8; i++) { - swprintf(temp, sizeof_w(temp), plat_get_string(IDS_4098), i); + swprintf(temp, sizeof_w(temp), get_string(IDS_4098), i); SendMessage(h, CB_ADDSTRING, 0, (LPARAM)temp); } h = GetDlgItem(hdlg, IDC_COMBO_ZIP_CHANNEL_IDE); for (i = 0; i < 8; i++) { - swprintf(temp, sizeof_w(temp), plat_get_string(IDS_4097), i >> 1, i & 1); + swprintf(temp, sizeof_w(temp), get_string(IDS_4097), i >> 1, i & 1); SendMessage(h, CB_ADDSTRING, 0, (LPARAM)temp); } } diff --git a/src/win/win_settings_video.h b/src/win/win_settings_video.h index 0fa6807..37df562 100644 --- a/src/win/win_settings_video.h +++ b/src/win/win_settings_video.h @@ -8,7 +8,7 @@ * * Implementation of the Settings dialog. * - * Version: @(#)win_settings_video.h 1.0.4 2018/05/02 + * Version: @(#)win_settings_video.h 1.0.5 2018/05/09 * * Authors: Fred N. van Kempen, * Miran Grca, @@ -109,13 +109,13 @@ video_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam) recalc_vid_list(hdlg); h = GetDlgItem(hdlg, IDC_COMBO_VIDEO_SPEED); - SendMessage(h, CB_ADDSTRING, 0, (LPARAM)plat_get_string(IDS_2131)); - SendMessage(h, CB_ADDSTRING, 0, (LPARAM)plat_get_string(IDS_2133)); - SendMessage(h, CB_ADDSTRING, 0, (LPARAM)plat_get_string(IDS_2134)); - SendMessage(h, CB_ADDSTRING, 0, (LPARAM)plat_get_string(IDS_2135)); - SendMessage(h, CB_ADDSTRING, 0, (LPARAM)plat_get_string(IDS_2136)); - SendMessage(h, CB_ADDSTRING, 0, (LPARAM)plat_get_string(IDS_2137)); - SendMessage(h, CB_ADDSTRING, 0, (LPARAM)plat_get_string(IDS_2138)); + SendMessage(h, CB_ADDSTRING, 0, (LPARAM)get_string(IDS_2131)); + SendMessage(h, CB_ADDSTRING, 0, (LPARAM)get_string(IDS_2133)); + SendMessage(h, CB_ADDSTRING, 0, (LPARAM)get_string(IDS_2134)); + SendMessage(h, CB_ADDSTRING, 0, (LPARAM)get_string(IDS_2135)); + SendMessage(h, CB_ADDSTRING, 0, (LPARAM)get_string(IDS_2136)); + SendMessage(h, CB_ADDSTRING, 0, (LPARAM)get_string(IDS_2137)); + SendMessage(h, CB_ADDSTRING, 0, (LPARAM)get_string(IDS_2138)); SendMessage(h, CB_SETCURSEL, temp_video_speed+1, 0); h = GetDlgItem(hdlg, IDC_CHECK_VOODOO); diff --git a/src/win/win_ui.c b/src/win/win_ui.c index d64de05..b6e55f7 100644 --- a/src/win/win_ui.c +++ b/src/win/win_ui.c @@ -662,8 +662,7 @@ again: * Inform the user, and ask if they want to reset * to the system default one instead. */ - _swprintf(title, plat_get_string(IDS_2095), - vidapi_internal_name(vid_api)); + _swprintf(title, get_string(IDS_2095), vidapi_internal_name(vid_api)); if (ui_msgbox(MBX_CONFIG, title) != 0) { /* Nope, they don't, so just exit. */ return(5); @@ -797,7 +796,7 @@ ui_menu_update(void) /* Update the application's title bar. */ wchar_t * -ui_window_title(wchar_t *s) +ui_window_title(const wchar_t *s) { if (! vid_fullscreen) { if (s != NULL) @@ -811,7 +810,7 @@ ui_window_title(wchar_t *s) s = wTitle; } - return(s); + return((wchar_t *)s); } @@ -868,7 +867,7 @@ plat_setfullscreen(int on) plat_startblit(); video_wait_for_blit(); -// win_mouse_close(); + win_mouse_close(); /* Close the current mode, and open the new one. */ plat_vidapis[vid_api]->close(); @@ -879,7 +878,7 @@ plat_setfullscreen(int on) wx_set_fullscreen(on); #endif -// win_mouse_init(); + win_mouse_init(); /* Release video and make it redraw the screen. */ plat_endblit();