More warnings fixed (in cpu/ and mem.c)
More vidapi cleanups, synced with UNIX version now. More fine-tuning of UI code here and there.
This commit is contained in:
@@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
* Common 386 CPU code.
|
* 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, <tommowalker@tommowalker.co.uk>
|
* Authors: Sarah Walker, <tommowalker@tommowalker.co.uk>
|
||||||
* Miran Grca, <mgrca8@gmail.com>
|
* Miran Grca, <mgrca8@gmail.com>
|
||||||
@@ -40,14 +40,20 @@ extern uint16_t ea_rseg;
|
|||||||
#undef writememb
|
#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 readmemb(s,a) ((readlookup2[(uint32_t)((s)+(a))>>12]==(uintptr_t)-1 || \
|
||||||
#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))))
|
(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 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]==-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 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]==-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 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))) \
|
#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) \
|
#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); \
|
x86gpf("Limit check (WRITE REP)", 0); \
|
||||||
break; \
|
break; \
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
* Implementation of the CPU's dynamic recompiler.
|
* 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, <tommowalker@tommowalker.co.uk>
|
* Authors: Sarah Walker, <tommowalker@tommowalker.co.uk>
|
||||||
* Miran Grca, <mgrca8@gmail.com>
|
* Miran Grca, <mgrca8@gmail.com>
|
||||||
@@ -170,9 +170,9 @@ static __inline void fetch_ea_32_long(uint32_t rmdat)
|
|||||||
if (easeg != 0xFFFFFFFF && ((easeg + cpu_state.eaaddr) & 0xFFF) <= 0xFFC)
|
if (easeg != 0xFFFFFFFF && ((easeg + cpu_state.eaaddr) & 0xFFF) <= 0xFFC)
|
||||||
{
|
{
|
||||||
uint32_t addr = easeg + cpu_state.eaaddr;
|
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);
|
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);
|
eal_w = (uint32_t *)(writelookup2[addr >> 12] + addr);
|
||||||
}
|
}
|
||||||
cpu_state.last_ea = cpu_state.eaaddr;
|
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)
|
if (easeg != 0xFFFFFFFF && ((easeg + cpu_state.eaaddr) & 0xFFF) <= 0xFFC)
|
||||||
{
|
{
|
||||||
uint32_t addr = easeg + cpu_state.eaaddr;
|
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);
|
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);
|
eal_w = (uint32_t *)(writelookup2[addr >> 12] + addr);
|
||||||
}
|
}
|
||||||
cpu_state.last_ea = cpu_state.eaaddr;
|
cpu_state.last_ea = cpu_state.eaaddr;
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
* Miscellaneous x86 CPU Instructions.
|
* 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, <tommowalker@tommowalker.co.uk>
|
* Authors: Sarah Walker, <tommowalker@tommowalker.co.uk>
|
||||||
* Miran Grca, <mgrca8@gmail.com>
|
* Miran Grca, <mgrca8@gmail.com>
|
||||||
@@ -310,7 +310,7 @@ static int opMOV_AX_a16(uint32_t fetchdat)
|
|||||||
{
|
{
|
||||||
uint16_t temp;
|
uint16_t temp;
|
||||||
uint16_t addr = getwordf();
|
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;
|
temp = readmemw(cpu_state.ea_seg->base, addr); if (cpu_state.abrt) return 1;
|
||||||
AX = temp;
|
AX = temp;
|
||||||
CLOCK_CYCLES((is486) ? 1 : 4);
|
CLOCK_CYCLES((is486) ? 1 : 4);
|
||||||
@@ -332,7 +332,7 @@ static int opMOV_EAX_a16(uint32_t fetchdat)
|
|||||||
{
|
{
|
||||||
uint32_t temp;
|
uint32_t temp;
|
||||||
uint16_t addr = getwordf();
|
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;
|
temp = readmeml(cpu_state.ea_seg->base, addr); if (cpu_state.abrt) return 1;
|
||||||
EAX = temp;
|
EAX = temp;
|
||||||
CLOCK_CYCLES((is486) ? 1 : 4);
|
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)
|
static int opMOV_a16_AX(uint32_t fetchdat)
|
||||||
{
|
{
|
||||||
uint16_t addr = getwordf();
|
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);
|
writememw(cpu_state.ea_seg->base, addr, AX);
|
||||||
CLOCK_CYCLES((is486) ? 1 : 2);
|
CLOCK_CYCLES((is486) ? 1 : 2);
|
||||||
PREFETCH_RUN(2, 3, -1, 0,0,1,0, 0);
|
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)
|
static int opMOV_a16_EAX(uint32_t fetchdat)
|
||||||
{
|
{
|
||||||
uint16_t addr = getwordf();
|
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);
|
writememl(cpu_state.ea_seg->base, addr, EAX);
|
||||||
CLOCK_CYCLES((is486) ? 1 : 2);
|
CLOCK_CYCLES((is486) ? 1 : 2);
|
||||||
PREFETCH_RUN(2, 3, -1, 0,0,0,1, 0);
|
PREFETCH_RUN(2, 3, -1, 0,0,0,1, 0);
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
* Miscellaneous x86 CPU Instructions.
|
* 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, <tommowalker@tommowalker.co.uk>
|
* Authors: Sarah Walker, <tommowalker@tommowalker.co.uk>
|
||||||
* Miran Grca, <mgrca8@gmail.com>
|
* Miran Grca, <mgrca8@gmail.com>
|
||||||
@@ -95,7 +95,7 @@ static int opARPL_a32(uint32_t fetchdat)
|
|||||||
\
|
\
|
||||||
flags_rebuild(); \
|
flags_rebuild(); \
|
||||||
if (!(sel & 0xfffc)) { flags &= ~Z_FLAG; return 0; } /*Null selector*/ \
|
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) \
|
if (valid) \
|
||||||
{ \
|
{ \
|
||||||
cpl_override = 1; \
|
cpl_override = 1; \
|
||||||
@@ -145,7 +145,7 @@ opLAR(l_a32, fetch_ea_32, 1, 1)
|
|||||||
flags_rebuild(); \
|
flags_rebuild(); \
|
||||||
flags &= ~Z_FLAG; \
|
flags &= ~Z_FLAG; \
|
||||||
if (!(sel & 0xfffc)) return 0; /*Null selector*/ \
|
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) \
|
if (valid) \
|
||||||
{ \
|
{ \
|
||||||
cpl_override = 1; \
|
cpl_override = 1; \
|
||||||
@@ -270,7 +270,7 @@ static int op0F00_common(uint32_t fetchdat, int ea32)
|
|||||||
flags &= ~Z_FLAG;
|
flags &= ~Z_FLAG;
|
||||||
if (!(sel & 0xfffc)) return 0; /*Null selector*/
|
if (!(sel & 0xfffc)) return 0; /*Null selector*/
|
||||||
cpl_override = 1;
|
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);
|
desc = readmemw(0, ((sel & 4) ? ldt.base : gdt.base) + (sel & ~7) + 4);
|
||||||
cpl_override = 0; if (cpu_state.abrt) return 1;
|
cpl_override = 0; if (cpu_state.abrt) return 1;
|
||||||
if (!(desc & 0x1000)) valid = 0;
|
if (!(desc & 0x1000)) valid = 0;
|
||||||
@@ -290,7 +290,7 @@ static int op0F00_common(uint32_t fetchdat, int ea32)
|
|||||||
flags &= ~Z_FLAG;
|
flags &= ~Z_FLAG;
|
||||||
if (!(sel & 0xfffc)) return 0; /*Null selector*/
|
if (!(sel & 0xfffc)) return 0; /*Null selector*/
|
||||||
cpl_override = 1;
|
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);
|
desc = readmemw(0, ((sel & 4) ? ldt.base : gdt.base) + (sel & ~7) + 4);
|
||||||
cpl_override = 0; if (cpu_state.abrt) return 1;
|
cpl_override = 0; if (cpu_state.abrt) return 1;
|
||||||
if (!(desc & 0x1000)) valid = 0;
|
if (!(desc & 0x1000)) valid = 0;
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
* Miscellaneous x86 CPU Instructions.
|
* 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, <tommowalker@tommowalker.co.uk>
|
* Authors: Sarah Walker, <tommowalker@tommowalker.co.uk>
|
||||||
* Miran Grca, <mgrca8@gmail.com>
|
* Miran Grca, <mgrca8@gmail.com>
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
* Implementation of the generic device interface to handle
|
* Implementation of the generic device interface to handle
|
||||||
* all devices attached to the emulator.
|
* 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, <decwiz@yahoo.com>
|
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||||
* Miran Grca, <mgrca8@gmail.com>
|
* Miran Grca, <mgrca8@gmail.com>
|
||||||
@@ -93,7 +93,7 @@ device_add(const device_t *d)
|
|||||||
*/
|
*/
|
||||||
if (d->flags & DEVICE_UNSTABLE) {
|
if (d->flags & DEVICE_UNSTABLE) {
|
||||||
mbstowcs(devname, d->name, sizeof_w(devname));
|
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. */
|
/* Show the messagebox, and abort if 'No' was selected. */
|
||||||
if (ui_msgbox(MBX_WARNING, temp) == 1) return(0);
|
if (ui_msgbox(MBX_WARNING, temp) == 1) return(0);
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
* Main include file for the application.
|
* 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, <decwiz@yahoo.com>
|
* Author: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||||
*
|
*
|
||||||
@@ -179,6 +179,9 @@ extern void pc_onesec(void);
|
|||||||
extern void set_screen_size(int x, int y);
|
extern void set_screen_size(int x, int y);
|
||||||
extern void set_screen_size_natural(void);
|
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
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
17
src/mem.h
17
src/mem.h
@@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
* Definitions for the memory interface.
|
* 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, <decwiz@yahoo.com>
|
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||||
* Sarah Walker, <tommowalker@tommowalker.co.uk>
|
* Sarah Walker, <tommowalker@tommowalker.co.uk>
|
||||||
@@ -144,9 +144,18 @@ extern int mem_a20_state,
|
|||||||
mem_a20_key;
|
mem_a20_key;
|
||||||
|
|
||||||
|
|
||||||
#define readmemb(a) ((readlookup2[(a)>>12]==-1)?readmembl(a):*(uint8_t *)(readlookup2[(a) >> 12] + (a)))
|
#define readmemb(a) ((readlookup2[(a)>>12]== (uintptr_t)-1) \
|
||||||
#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))))
|
? readmembl(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))))
|
: *(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);
|
extern uint8_t readmembl(uint32_t addr);
|
||||||
|
|||||||
87
src/misc.c
Normal file
87
src/misc.c
Normal file
@@ -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, <decwiz@yahoo.com>
|
||||||
|
*
|
||||||
|
* 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 <stdio.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <wchar.h>
|
||||||
|
#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);
|
||||||
|
}
|
||||||
20
src/pc.c
20
src/pc.c
@@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
* Main emulator module where most things are controlled.
|
* 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, <decwiz@yahoo.com>
|
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||||
* Miran Grca, <mgrca8@gmail.com>
|
* Miran Grca, <mgrca8@gmail.com>
|
||||||
@@ -213,9 +213,17 @@ pclog_ex(const char *fmt, va_list ap)
|
|||||||
if (log_path[0] != L'\0') {
|
if (log_path[0] != L'\0') {
|
||||||
stdlog = plat_fopen(log_path, L"w");
|
stdlog = plat_fopen(log_path, L"w");
|
||||||
if (stdlog == NULL)
|
if (stdlog == NULL)
|
||||||
|
#ifdef _WIN32
|
||||||
stdlog = stdout;
|
stdlog = stdout;
|
||||||
|
#else
|
||||||
|
stdlog = stderr;
|
||||||
|
#endif
|
||||||
} else {
|
} else {
|
||||||
|
#ifdef _WIN32
|
||||||
stdlog = stdout;
|
stdlog = stdout;
|
||||||
|
#else
|
||||||
|
stdlog = stderr;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -713,12 +721,12 @@ pc_init(void)
|
|||||||
{
|
{
|
||||||
wchar_t temp[1024];
|
wchar_t temp[1024];
|
||||||
wchar_t name[128];
|
wchar_t name[128];
|
||||||
wchar_t *str;
|
const wchar_t *str;
|
||||||
|
|
||||||
/* Load the ROMs for the selected machine. */
|
/* Load the ROMs for the selected machine. */
|
||||||
if ((machine < 0) || !machine_available(machine)) {
|
if ((machine < 0) || !machine_available(machine)) {
|
||||||
/* Whoops, selected machine not available. */
|
/* Whoops, selected machine not available. */
|
||||||
str = plat_get_string(IDS_2063);
|
str = get_string(IDS_2063);
|
||||||
mbstowcs(name, machine_getname(), sizeof_w(name));
|
mbstowcs(name, machine_getname(), sizeof_w(name));
|
||||||
swprintf(temp, sizeof_w(temp), str, name);
|
swprintf(temp, sizeof_w(temp), str, name);
|
||||||
|
|
||||||
@@ -732,7 +740,7 @@ pc_init(void)
|
|||||||
if ((video_card < 0) ||
|
if ((video_card < 0) ||
|
||||||
!video_card_available(video_old_to_new(video_card))) {
|
!video_card_available(video_old_to_new(video_card))) {
|
||||||
/* Whoops, selected video not available. */
|
/* Whoops, selected video not available. */
|
||||||
str = plat_get_string(IDS_2064);
|
str = get_string(IDS_2064);
|
||||||
mbstowcs(name, machine_getname(), sizeof_w(name));
|
mbstowcs(name, machine_getname(), sizeof_w(name));
|
||||||
swprintf(temp, sizeof_w(temp), str, name);
|
swprintf(temp, sizeof_w(temp), str, name);
|
||||||
|
|
||||||
@@ -1105,9 +1113,9 @@ pc_thread(void *param)
|
|||||||
if (mouse_type != MOUSE_NONE) {
|
if (mouse_type != MOUSE_NONE) {
|
||||||
wcscat(temp, L" - ");
|
wcscat(temp, L" - ");
|
||||||
if (!mouse_capture) {
|
if (!mouse_capture) {
|
||||||
wcscat(temp, plat_get_string(IDS_2077));
|
wcscat(temp, get_string(IDS_2077));
|
||||||
} else {
|
} 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));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -89,6 +89,11 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#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. */
|
/* Define a "vidapi", or, rather, a Renderer API. */
|
||||||
typedef struct {
|
typedef struct {
|
||||||
@@ -112,6 +117,7 @@ GLOBAL int dopause, /* system is paused */
|
|||||||
GLOBAL uint64_t timer_freq;
|
GLOBAL uint64_t timer_freq;
|
||||||
GLOBAL int infocus;
|
GLOBAL int infocus;
|
||||||
GLOBAL const vidapi_t *plat_vidapis[];
|
GLOBAL const vidapi_t *plat_vidapis[];
|
||||||
|
extern const string_t *plat_strings;
|
||||||
|
|
||||||
|
|
||||||
/* System-related functions. */
|
/* System-related functions. */
|
||||||
@@ -142,7 +148,6 @@ extern int plat_fdd_icon(int);
|
|||||||
|
|
||||||
/* Resource management. */
|
/* Resource management. */
|
||||||
extern void set_language(int id);
|
extern void set_language(int id);
|
||||||
extern wchar_t *plat_get_string(int id);
|
|
||||||
|
|
||||||
|
|
||||||
/* Dynamic Module Loader interface. */
|
/* Dynamic Module Loader interface. */
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
* or to use a generic handler, and then pass it a pointer
|
* or to use a generic handler, and then pass it a pointer
|
||||||
* to a command table. For now, we don't.
|
* 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, <decwiz@yahoo.com>
|
* Author: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||||
*
|
*
|
||||||
@@ -70,20 +70,6 @@
|
|||||||
#define MAX_ARGS 16 /* max number of arguments */
|
#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. */
|
/* Process a single (logical) command line. */
|
||||||
static int
|
static int
|
||||||
process(int ln, int argc, char **argv, romdef_t *r)
|
process(int ln, int argc, char **argv, romdef_t *r)
|
||||||
|
|||||||
@@ -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_enable_item(int idm, int val);
|
||||||
extern void menu_set_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 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. */
|
/* Status Bar functions. */
|
||||||
extern void ui_sb_update(void);
|
extern void ui_sb_update(void);
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
* This code is called by the UI frontend modules, and, also,
|
* This code is called by the UI frontend modules, and, also,
|
||||||
* depends on those same modules for lower-level functions.
|
* 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, <decwiz@yahoo.com>
|
* Author: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||||
*
|
*
|
||||||
@@ -497,7 +497,7 @@ ui_menu_command(int idm)
|
|||||||
/* FIXME: need to fix these.. */
|
/* FIXME: need to fix these.. */
|
||||||
case IDM_LOAD: /* TOOLS menu */
|
case IDM_LOAD: /* TOOLS menu */
|
||||||
plat_pause(1);
|
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)) {
|
(ui_msgbox(MBX_QUESTION, (wchar_t *)IDS_2051) == 0)) {
|
||||||
pc_reload(temp);
|
pc_reload(temp);
|
||||||
ui_menu_reset_all();
|
ui_menu_reset_all();
|
||||||
@@ -507,7 +507,7 @@ ui_menu_command(int idm)
|
|||||||
|
|
||||||
case IDM_SAVE: /* TOOLS menu */
|
case IDM_SAVE: /* TOOLS menu */
|
||||||
plat_pause(1);
|
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);
|
config_write(temp);
|
||||||
}
|
}
|
||||||
plat_pause(0);
|
plat_pause(0);
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
* Platform-independent resource identifiers.
|
* 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, <decwiz@yahoo.com>
|
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||||
* Miran Grca, <mgrca8@gmail.com>
|
* Miran Grca, <mgrca8@gmail.com>
|
||||||
@@ -193,6 +193,8 @@
|
|||||||
|
|
||||||
|
|
||||||
/* String IDs. */
|
/* String IDs. */
|
||||||
|
#define IDS_BEGIN 2048 // start of string IDs
|
||||||
|
|
||||||
#define IDS_2048 2048 // "Error"
|
#define IDS_2048 2048 // "Error"
|
||||||
#define IDS_2049 2049 // "Fatal Error"
|
#define IDS_2049 2049 // "Fatal Error"
|
||||||
#define IDS_2050 2050 // "Configuration Error"
|
#define IDS_2050 2050 // "Configuration Error"
|
||||||
@@ -392,20 +394,9 @@
|
|||||||
#define IDS_6147 6147 // "2%% below perfect RPM"
|
#define IDS_6147 6147 // "2%% below perfect RPM"
|
||||||
|
|
||||||
#define IDS_7168 7168 // "English (United States)"
|
#define IDS_7168 7168 // "English (United States)"
|
||||||
|
|
||||||
#define IDS_LANG_ENUS IDS_7168
|
#define IDS_LANG_ENUS IDS_7168
|
||||||
|
|
||||||
#define STR_NUM_2048 132
|
#define IDS_END 8191 // end of string IDs
|
||||||
#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
|
|
||||||
|
|
||||||
|
|
||||||
#endif /*EMU_UI_RESOURCE_H*/
|
#endif /*EMU_UI_RESOURCE_H*/
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
* Common UI support functions for the Status Bar module.
|
* 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, <decwiz@yahoo.com>
|
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||||
* Miran Grca, <mgrca8@gmail.com>
|
* Miran Grca, <mgrca8@gmail.com>
|
||||||
@@ -195,7 +195,7 @@ ui_sb_tip_update(int tag)
|
|||||||
{
|
{
|
||||||
wchar_t tip[512];
|
wchar_t tip[512];
|
||||||
wchar_t temp[512];
|
wchar_t temp[512];
|
||||||
wchar_t *str;
|
const wchar_t *str;
|
||||||
const char *stransi;
|
const char *stransi;
|
||||||
int bus, drive, id;
|
int bus, drive, id;
|
||||||
int type, part;
|
int type, part;
|
||||||
@@ -212,34 +212,34 @@ ui_sb_tip_update(int tag)
|
|||||||
mbstowcs(temp, stransi, sizeof_w(temp));
|
mbstowcs(temp, stransi, sizeof_w(temp));
|
||||||
str = floppyfns[drive];
|
str = floppyfns[drive];
|
||||||
if (*str == L'\0')
|
if (*str == L'\0')
|
||||||
str = plat_get_string(IDS_2057); /*"empty"*/
|
str = get_string(IDS_2057); /*"empty"*/
|
||||||
swprintf(tip, sizeof_w(tip),
|
swprintf(tip, sizeof_w(tip),
|
||||||
plat_get_string(IDS_2158), drive+1, temp, str);
|
get_string(IDS_2158), drive+1, temp, str);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SB_CDROM:
|
case SB_CDROM:
|
||||||
drive = sb_tags[part] & 0x0f;
|
drive = sb_tags[part] & 0x0f;
|
||||||
bus = cdrom_drives[drive].bus_type;
|
bus = cdrom_drives[drive].bus_type;
|
||||||
id = IDS_4352 + (bus - 1);
|
id = IDS_4352 + (bus - 1);
|
||||||
wcscpy(temp, plat_get_string(id));
|
wcscpy(temp, get_string(id));
|
||||||
str = cdrom_image[drive].image_path;
|
str = cdrom_image[drive].image_path;
|
||||||
if (*str == L'\0')
|
if (*str == L'\0')
|
||||||
str = plat_get_string(IDS_2057); /*"empty"*/
|
str = get_string(IDS_2057); /*"empty"*/
|
||||||
if (cdrom_drives[drive].host_drive == 200) {
|
if (cdrom_drives[drive].host_drive == 200) {
|
||||||
swprintf(tip, sizeof_w(tip),
|
swprintf(tip, sizeof_w(tip),
|
||||||
plat_get_string(IDS_5120),
|
get_string(IDS_5120),
|
||||||
drive+1, temp, str);
|
drive+1, temp, str);
|
||||||
} else if ((cdrom_drives[drive].host_drive >= 'A') &&
|
} else if ((cdrom_drives[drive].host_drive >= 'A') &&
|
||||||
(cdrom_drives[drive].host_drive <= 'Z')) {
|
(cdrom_drives[drive].host_drive <= 'Z')) {
|
||||||
swprintf(temp, sizeof_w(temp),
|
swprintf(temp, sizeof_w(temp),
|
||||||
plat_get_string(IDS_2058),
|
get_string(IDS_2058),
|
||||||
cdrom_drives[drive].host_drive & ~0x20);
|
cdrom_drives[drive].host_drive & ~0x20);
|
||||||
swprintf(tip, sizeof_w(tip),
|
swprintf(tip, sizeof_w(tip),
|
||||||
plat_get_string(IDS_5120),
|
get_string(IDS_5120),
|
||||||
drive+1, plat_get_string(id), temp);
|
drive+1, get_string(id), temp);
|
||||||
} else {
|
} else {
|
||||||
swprintf(tip, sizeof_w(tip),
|
swprintf(tip, sizeof_w(tip),
|
||||||
plat_get_string(IDS_5120),
|
get_string(IDS_5120),
|
||||||
drive+1, temp, str);
|
drive+1, temp, str);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -249,34 +249,34 @@ ui_sb_tip_update(int tag)
|
|||||||
type = zip_drives[drive].is_250 ? 250 : 100;
|
type = zip_drives[drive].is_250 ? 250 : 100;
|
||||||
str = zip_drives[drive].image_path;
|
str = zip_drives[drive].image_path;
|
||||||
if (*str == L'\0')
|
if (*str == L'\0')
|
||||||
str = plat_get_string(IDS_2057); /*"empty"*/
|
str = get_string(IDS_2057); /*"empty"*/
|
||||||
swprintf(tip, sizeof_w(tip),
|
swprintf(tip, sizeof_w(tip),
|
||||||
plat_get_string(IDS_2177), drive+1, type, str);
|
get_string(IDS_2177), drive+1, type, str);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SB_RDISK:
|
case SB_RDISK:
|
||||||
drive = sb_tags[part] & 0x1f;
|
drive = sb_tags[part] & 0x1f;
|
||||||
str = hdd[drive].fn;
|
str = hdd[drive].fn;
|
||||||
if (*str == L'\0')
|
if (*str == L'\0')
|
||||||
str = plat_get_string(IDS_2057); /*"empty"*/
|
str = get_string(IDS_2057); /*"empty"*/
|
||||||
swprintf(tip, sizeof_w(tip),
|
swprintf(tip, sizeof_w(tip),
|
||||||
plat_get_string(IDS_4115), drive, str);
|
get_string(IDS_4115), drive, str);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SB_HDD:
|
case SB_HDD:
|
||||||
bus = sb_tags[part] & 0x0f;
|
bus = sb_tags[part] & 0x0f;
|
||||||
id = IDS_4352 + (bus - 1);
|
id = IDS_4352 + (bus - 1);
|
||||||
str = plat_get_string(id);
|
str = get_string(id);
|
||||||
swprintf(tip, sizeof_w(tip),
|
swprintf(tip, sizeof_w(tip),
|
||||||
plat_get_string(IDS_4096), str);
|
get_string(IDS_4096), str);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SB_NETWORK:
|
case SB_NETWORK:
|
||||||
swprintf(tip, sizeof_w(tip), plat_get_string(IDS_2069));
|
swprintf(tip, sizeof_w(tip), get_string(IDS_2069));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SB_SOUND:
|
case SB_SOUND:
|
||||||
swprintf(tip, sizeof_w(tip), plat_get_string(IDS_2068));
|
swprintf(tip, sizeof_w(tip), get_string(IDS_2068));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@@ -316,18 +316,18 @@ static void
|
|||||||
menu_floppy(int part, int drive)
|
menu_floppy(int part, int drive)
|
||||||
{
|
{
|
||||||
sb_menu_add_item(part, IDM_FLOPPY_IMAGE_NEW | 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, -1, NULL);
|
||||||
sb_menu_add_item(part, IDM_FLOPPY_IMAGE_EXISTING | drive,
|
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,
|
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, -1, NULL);
|
||||||
sb_menu_add_item(part, IDM_FLOPPY_EXPORT_TO_86F | drive,
|
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, -1, NULL);
|
||||||
sb_menu_add_item(part, IDM_FLOPPY_EJECT | drive,
|
sb_menu_add_item(part, IDM_FLOPPY_EJECT | drive,
|
||||||
plat_get_string(IDS_2164));
|
get_string(IDS_2164));
|
||||||
|
|
||||||
if (floppyfns[drive][0] == L'\0') {
|
if (floppyfns[drive][0] == L'\0') {
|
||||||
sb_menu_enable_item(part, IDM_FLOPPY_EJECT | drive, 0);
|
sb_menu_enable_item(part, IDM_FLOPPY_EJECT | drive, 0);
|
||||||
@@ -344,15 +344,15 @@ menu_cdrom(int part, int drive)
|
|||||||
int i;
|
int i;
|
||||||
|
|
||||||
sb_menu_add_item(part, IDM_CDROM_MUTE | drive,
|
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, -1, NULL);
|
||||||
sb_menu_add_item(part, IDM_CDROM_EMPTY | drive,
|
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,
|
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, -1, NULL);
|
||||||
sb_menu_add_item(part, IDM_CDROM_IMAGE | drive,
|
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 (host_cdrom_drive_available_num == 0) {
|
||||||
if ((cdrom_drives[drive].host_drive >= 'A') &&
|
if ((cdrom_drives[drive].host_drive >= 'A') &&
|
||||||
@@ -401,15 +401,15 @@ static void
|
|||||||
menu_zip(int part, int drive)
|
menu_zip(int part, int drive)
|
||||||
{
|
{
|
||||||
sb_menu_add_item(part, IDM_ZIP_IMAGE_NEW | 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, -1, NULL);
|
||||||
sb_menu_add_item(part, IDM_ZIP_IMAGE_EXISTING | drive,
|
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,
|
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, -1, NULL);
|
||||||
sb_menu_add_item(part, IDM_ZIP_EJECT | drive, plat_get_string(IDS_2164));
|
sb_menu_add_item(part, IDM_ZIP_EJECT | drive, 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_RELOAD | drive, get_string(IDS_2167));
|
||||||
|
|
||||||
if (zip_drives[drive].image_path[0] == L'\0') {
|
if (zip_drives[drive].image_path[0] == L'\0') {
|
||||||
sb_menu_enable_item(part, IDM_ZIP_EJECT | drive, 0);
|
sb_menu_enable_item(part, IDM_ZIP_EJECT | drive, 0);
|
||||||
@@ -426,17 +426,17 @@ static void
|
|||||||
menu_remov(int part, int drive)
|
menu_remov(int part, int drive)
|
||||||
{
|
{
|
||||||
sb_menu_add_item(part, IDM_RDISK_EJECT | 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,
|
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, -1, NULL);
|
||||||
sb_menu_add_item(part, IDM_RDISK_SEND_CHANGE | drive,
|
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, -1, NULL);
|
||||||
sb_menu_add_item(part, IDM_RDISK_IMAGE | drive,
|
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,
|
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;
|
if (part == -1) break;
|
||||||
|
|
||||||
i = (idm == IDM_FLOPPY_IMAGE_EXISTING_WP) ? 0x80 : 0;
|
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))
|
floppyfns[drive], temp, i))
|
||||||
ui_sb_mount_floppy(drive, part, i ? 1 : 0, temp);
|
ui_sb_mount_floppy(drive, part, i ? 1 : 0, temp);
|
||||||
break;
|
break;
|
||||||
@@ -834,7 +834,7 @@ ui_sb_menu_command(int idm, int tag)
|
|||||||
part = find_tag(SB_FLOPPY | drive);
|
part = find_tag(SB_FLOPPY | drive);
|
||||||
if (part == -1) break;
|
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);
|
plat_pause(1);
|
||||||
if (! d86f_export(drive, temp))
|
if (! d86f_export(drive, temp))
|
||||||
ui_msgbox(MBX_ERROR, (wchar_t *)IDS_4108);
|
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);
|
part = find_tag(SB_CDROM | drive);
|
||||||
if (part == -1) break;
|
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_image[drive].image_path, temp, 0x80)) break;
|
||||||
|
|
||||||
cdrom_drives[drive].prev_host_drive = cdrom_drives[drive].host_drive;
|
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;
|
if (part == -1) break;
|
||||||
|
|
||||||
i = (idm == IDM_ZIP_IMAGE_EXISTING_WP) ? 0x80 : 0;
|
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;
|
zip_drives[drive].image_path, temp, i)) break;
|
||||||
ui_sb_mount_zip(drive, part, i ? 1 : 0, temp);
|
ui_sb_mount_zip(drive, part, i ? 1 : 0, temp);
|
||||||
break;
|
break;
|
||||||
@@ -988,7 +988,7 @@ ui_sb_menu_command(int idm, int tag)
|
|||||||
part = find_tag(idm | drive);
|
part = find_tag(idm | drive);
|
||||||
|
|
||||||
i = (idm == IDM_RDISK_IMAGE_WP) ? 0x80 : 0;
|
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;
|
hdd[drive].fn, temp, i)) break;
|
||||||
|
|
||||||
removable_disk_unload(drive);
|
removable_disk_unload(drive);
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
#
|
#
|
||||||
# Makefile for Windows systems using the MinGW32 environment.
|
# 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, <decwiz@yahoo.com>
|
# Author: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||||
#
|
#
|
||||||
@@ -475,6 +475,7 @@ endif
|
|||||||
|
|
||||||
|
|
||||||
# Final versions of the toolchain flags.
|
# Final versions of the toolchain flags.
|
||||||
|
# FIXME: add the -Wsign-compare option soon!
|
||||||
CFLAGS := $(WX_FLAGS) $(OPTS) $(DFLAGS) $(COPTIM) $(AOPTIM) \
|
CFLAGS := $(WX_FLAGS) $(OPTS) $(DFLAGS) $(COPTIM) $(AOPTIM) \
|
||||||
$(AFLAGS) -fomit-frame-pointer -mstackrealign \
|
$(AFLAGS) -fomit-frame-pointer -mstackrealign \
|
||||||
-Wall -Wundef #-Wshadow #-Wunused-parameter -Wmissing-declarations
|
-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. #
|
# 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 \
|
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 \
|
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)
|
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 \
|
INTELOBJ := intel.o \
|
||||||
intel_flash.o \
|
intel_flash.o \
|
||||||
@@ -570,9 +571,10 @@ SCSIOBJ := scsi.o \
|
|||||||
NETOBJ := network.o \
|
NETOBJ := network.o \
|
||||||
net_pcap.o \
|
net_pcap.o \
|
||||||
net_slirp.o \
|
net_slirp.o \
|
||||||
bootp.o ip_icmp.o misc.o socket.o tcp_timer.o cksum.o \
|
bootp.o ip_icmp.o slirp_misc.o socket.o tcp_timer.o \
|
||||||
ip_input.o queue.o tcp_input.o debug.o ip_output.o \
|
cksum.o ip_input.o queue.o tcp_input.o debug.o \
|
||||||
sbuf.o tcp_output.o udp.o if.o mbuf.o slirp.o tcp_subr.o \
|
ip_output.o sbuf.o tcp_output.o udp.o if.o mbuf.o \
|
||||||
|
slirp.o tcp_subr.o \
|
||||||
net_ne2000.o
|
net_ne2000.o
|
||||||
|
|
||||||
SNDOBJ := sound.o \
|
SNDOBJ := sound.o \
|
||||||
@@ -662,6 +664,10 @@ else
|
|||||||
@echo $<
|
@echo $<
|
||||||
@$(CPP) $(CXXFLAGS) -c $<
|
@$(CPP) $(CXXFLAGS) -c $<
|
||||||
|
|
||||||
|
%.int: %.c
|
||||||
|
@echo $<
|
||||||
|
@$(PREPROC) $(OPTS) $< >$@
|
||||||
|
|
||||||
%.d: %.c $(wildcard $*.d)
|
%.d: %.c $(wildcard $*.d)
|
||||||
@echo $<
|
@echo $<
|
||||||
@$(CC) $(CFLAGS) $(DEPS) -E $< >NUL
|
@$(CC) $(CFLAGS) $(DEPS) -E $< >NUL
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
#
|
#
|
||||||
# Makefile for Windows using Visual Studio 2015.
|
# 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, <decwiz@yahoo.com>
|
# Author: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||||
#
|
#
|
||||||
@@ -453,7 +453,7 @@ CXXFLAGS := $(WX_FLAGS) $(OPTS) $(CXXOPTS) $(COPTS) $(DOPTS) $(AOPTIM) $(AFLAGS)
|
|||||||
#########################################################################
|
#########################################################################
|
||||||
# Create the (final) list of objects to build. #
|
# 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 \
|
random.obj timer.obj io.obj dma.obj nmi.obj pic.obj \
|
||||||
pit.obj ppi.obj pci.obj mca.obj mcr.obj mem.obj \
|
pit.obj ppi.obj pci.obj mca.obj mcr.obj mem.obj \
|
||||||
memregs.obj rom.obj rom_load.obj device.obj nvr.obj \
|
memregs.obj rom.obj rom_load.obj device.obj nvr.obj \
|
||||||
@@ -535,9 +535,11 @@ SCSIOBJ := scsi.obj \
|
|||||||
NETOBJ := network.obj \
|
NETOBJ := network.obj \
|
||||||
net_pcap.obj \
|
net_pcap.obj \
|
||||||
net_slirp.obj \
|
net_slirp.obj \
|
||||||
bootp.obj ip_icmp.obj misc.obj socket.obj tcp_timer.obj cksum.obj \
|
bootp.obj ip_icmp.obj slirp_misc.obj socket.obj \
|
||||||
ip_input.obj queue.obj tcp_input.obj debug.obj ip_output.obj \
|
tcp_timer.obj cksum.obj ip_input.obj queue.obj \
|
||||||
sbuf.obj tcp_output.obj udp.obj if.obj mbuf.obj slirp.obj tcp_subr.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
|
net_ne2000.obj
|
||||||
|
|
||||||
SNDOBJ := sound.obj \
|
SNDOBJ := sound.obj \
|
||||||
@@ -625,6 +627,9 @@ else
|
|||||||
%.obj: %.cpp
|
%.obj: %.cpp
|
||||||
@$(CPP) $(CXXFLAGS) -Fo$@ -c $<
|
@$(CPP) $(CXXFLAGS) -Fo$@ -c $<
|
||||||
|
|
||||||
|
%.int: %.c
|
||||||
|
@$(PREPROC) $(OPTS) -Fo$@ $<
|
||||||
|
|
||||||
%.d: %.c $(wildcard $*.d)
|
%.d: %.c $(wildcard $*.d)
|
||||||
$(MCPP) $(OPTS) $(DEPS) $< >NUL
|
$(MCPP) $(OPTS) $(DEPS) $< >NUL
|
||||||
|
|
||||||
|
|||||||
113
src/win/win.c
113
src/win/win.c
@@ -72,30 +72,16 @@
|
|||||||
#include "win.h"
|
#include "win.h"
|
||||||
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
WCHAR str[512];
|
|
||||||
} rc_str_t;
|
|
||||||
|
|
||||||
|
|
||||||
/* Platform Public data, specific. */
|
/* Platform Public data, specific. */
|
||||||
HINSTANCE hInstance; /* application instance */
|
HINSTANCE hInstance; /* application instance */
|
||||||
LCID lang_id; /* current language ID used */
|
LCID lang_id; /* current language ID used */
|
||||||
DWORD dwSubLangID;
|
DWORD dwSubLangID;
|
||||||
|
const string_t *plat_strings;
|
||||||
|
|
||||||
|
|
||||||
/* Local data. */
|
/* Local data. */
|
||||||
static HANDLE hBlitMutex, /* video mutex */
|
static HANDLE hBlitMutex, /* video mutex */
|
||||||
thMain; /* main thread */
|
thMain; /* main thread */
|
||||||
static rc_str_t *lpRCstr2048,
|
|
||||||
*lpRCstr4096,
|
|
||||||
*lpRCstr4352,
|
|
||||||
*lpRCstr4608,
|
|
||||||
*lpRCstr5120,
|
|
||||||
*lpRCstr5376,
|
|
||||||
*lpRCstr5632,
|
|
||||||
*lpRCstr5888,
|
|
||||||
*lpRCstr6144,
|
|
||||||
*lpRCstr7168;
|
|
||||||
|
|
||||||
|
|
||||||
/* The list with supported VidAPI modules. */
|
/* The list with supported VidAPI modules. */
|
||||||
@@ -125,48 +111,45 @@ const vidapi_t *plat_vidapis[] = {
|
|||||||
static void
|
static void
|
||||||
LoadCommonStrings(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));
|
* First, we need to know how many strings are in the table.
|
||||||
lpRCstr4352 = (rc_str_t *)malloc(STR_NUM_4352*sizeof(rc_str_t));
|
* Sadly, there is no other way to determine this but to try
|
||||||
lpRCstr4608 = (rc_str_t *)malloc(STR_NUM_4608*sizeof(rc_str_t));
|
* to load all possible ID's...
|
||||||
lpRCstr5120 = (rc_str_t *)malloc(STR_NUM_5120*sizeof(rc_str_t));
|
*/
|
||||||
lpRCstr5376 = (rc_str_t *)malloc(STR_NUM_5376*sizeof(rc_str_t));
|
for (i = IDS_BEGIN; i < IDS_END; i++)
|
||||||
lpRCstr5632 = (rc_str_t *)malloc(STR_NUM_5632*sizeof(rc_str_t));
|
if (LoadString(hInstance, i, temp, sizeof_w(temp)) > 0) c++;
|
||||||
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));
|
|
||||||
|
|
||||||
for (i=0; i<STR_NUM_2048; i++)
|
/*
|
||||||
LoadString(hInstance, 2048+i, lpRCstr2048[i].str, 512);
|
* Now that we know how many strings exist, we can allocate
|
||||||
|
* our string_table array.
|
||||||
|
*/
|
||||||
|
i = (c + 1) * sizeof(string_t);
|
||||||
|
array = (string_t *)malloc(i);
|
||||||
|
memset(array, 0x00, i);
|
||||||
|
|
||||||
for (i=0; i<STR_NUM_4096; i++)
|
/* Now load the actual strings into our string table. */
|
||||||
LoadString(hInstance, 4096+i, lpRCstr4096[i].str, 512);
|
tbl = array;
|
||||||
|
for (i = IDS_BEGIN; i < IDS_END; i++) {
|
||||||
|
c = LoadString(hInstance, i, temp, sizeof_w(temp));
|
||||||
|
if (c == 0) continue;
|
||||||
|
|
||||||
for (i=0; i<STR_NUM_4352; i++)
|
tbl->id = i;
|
||||||
LoadString(hInstance, 4352+i, lpRCstr4352[i].str, 512);
|
str = (wchar_t *)malloc((c + 1) * sizeof(wchar_t));
|
||||||
|
wcscpy(str, temp);
|
||||||
|
tbl->str = str;
|
||||||
|
|
||||||
for (i=0; i<STR_NUM_4608; i++)
|
tbl++;
|
||||||
LoadString(hInstance, 4608+i, lpRCstr4608[i].str, 512);
|
}
|
||||||
|
|
||||||
for (i=0; i<STR_NUM_5120; i++)
|
/* Terminate the table. */
|
||||||
LoadString(hInstance, 5120+i, lpRCstr5120[i].str, 512);
|
tbl->str = NULL;
|
||||||
|
|
||||||
for (i=0; i<STR_NUM_5376; i++)
|
/* Consider this table const. */
|
||||||
LoadString(hInstance, 5376+i, lpRCstr5376[i].str, 512);
|
plat_strings = array;
|
||||||
|
|
||||||
for (i=0; i<STR_NUM_5632; i++)
|
|
||||||
LoadString(hInstance, 5632+i, lpRCstr5632[i].str, 512);
|
|
||||||
|
|
||||||
for (i=0; i<STR_NUM_5888; i++)
|
|
||||||
LoadString(hInstance, 5888+i, lpRCstr5888[i].str, 512);
|
|
||||||
|
|
||||||
for (i=0; i<STR_NUM_6144; i++)
|
|
||||||
LoadString(hInstance, 6144+i, lpRCstr6144[i].str, 512);
|
|
||||||
|
|
||||||
for (i=0; i<STR_NUM_7168; i++)
|
|
||||||
LoadString(hInstance, 7168+i, lpRCstr7168[i].str, 512);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -440,36 +423,6 @@ plat_fdd_icon(int type)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
wchar_t *
|
|
||||||
plat_get_string(int i)
|
|
||||||
{
|
|
||||||
LPTSTR str;
|
|
||||||
|
|
||||||
if ((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
|
void
|
||||||
plat_get_exe_name(wchar_t *bufp, int size)
|
plat_get_exe_name(wchar_t *bufp, int size)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -76,7 +76,6 @@ extern HWND hwndMain,
|
|||||||
extern LCID lang_id;
|
extern LCID lang_id;
|
||||||
extern DWORD filterindex;
|
extern DWORD filterindex;
|
||||||
extern int status_is_open;
|
extern int status_is_open;
|
||||||
extern const vidapi_t *vid_apis[];
|
|
||||||
|
|
||||||
/* VidApi initializers. */
|
/* VidApi initializers. */
|
||||||
extern const vidapi_t ddraw_vidapi;
|
extern const vidapi_t ddraw_vidapi;
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
* Rendering module for Microsoft DirectDraw 9.
|
* 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, <decwiz@yahoo.com>
|
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||||
* Miran Grca, <mgrca8@gmail.com>
|
* Miran Grca, <mgrca8@gmail.com>
|
||||||
@@ -228,7 +228,7 @@ SavePNG(const wchar_t *fn, HBITMAP hBitmap)
|
|||||||
fp = plat_fopen(fn, L"wb");
|
fp = plat_fopen(fn, L"wb");
|
||||||
if (fp == NULL) {
|
if (fp == NULL) {
|
||||||
pclog("[SavePNG] File %ls could not be opened for writing!\n", fn);
|
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);
|
ui_msgbox(MBX_ERROR, temp);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -238,7 +238,7 @@ SavePNG(const wchar_t *fn, HBITMAP hBitmap)
|
|||||||
if (png_ptr == NULL) {
|
if (png_ptr == NULL) {
|
||||||
(void)fclose(fp);
|
(void)fclose(fp);
|
||||||
pclog("[SavePNG] png_create_write_struct failed!\n");
|
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);
|
ui_msgbox(MBX_ERROR, temp);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -247,7 +247,7 @@ SavePNG(const wchar_t *fn, HBITMAP hBitmap)
|
|||||||
if (png_info_ptr == NULL) {
|
if (png_info_ptr == NULL) {
|
||||||
(void)fclose(fp);
|
(void)fclose(fp);
|
||||||
pclog("[SavePNG] png_create_info_struct failed!\n");
|
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);
|
ui_msgbox(MBX_ERROR, temp);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -267,7 +267,7 @@ SavePNG(const wchar_t *fn, HBITMAP hBitmap)
|
|||||||
if ((pBuf = malloc(bmpInfo.bmiHeader.biSizeImage)) == NULL) {
|
if ((pBuf = malloc(bmpInfo.bmiHeader.biSizeImage)) == NULL) {
|
||||||
(void)fclose(fp);
|
(void)fclose(fp);
|
||||||
pclog("[SavePNG] Unable to allocate bitmap memory!\n");
|
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);
|
ui_msgbox(MBX_ERROR, temp);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -279,7 +279,7 @@ SavePNG(const wchar_t *fn, HBITMAP hBitmap)
|
|||||||
(void)fclose(fp);
|
(void)fclose(fp);
|
||||||
free(pBuf);
|
free(pBuf);
|
||||||
pclog("[SavePNG] Unable to allocate secondary bitmap memory!\n");
|
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);
|
ui_msgbox(MBX_ERROR, temp);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -308,7 +308,7 @@ SavePNG(const wchar_t *fn, HBITMAP hBitmap)
|
|||||||
free(pBuf);
|
free(pBuf);
|
||||||
free(pBuf2);
|
free(pBuf2);
|
||||||
pclog("[SavePNG] Unable to allocate RGB bitmap memory!\n");
|
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);
|
ui_msgbox(MBX_ERROR, temp);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -381,7 +381,7 @@ SaveBMP(const wchar_t *fn, HBITMAP hBitmap)
|
|||||||
GetDIBits(hdc, hBitmap, 0, bmpInfo.bmiHeader.biHeight, pBuf, &bmpInfo, DIB_RGB_COLORS);
|
GetDIBits(hdc, hBitmap, 0, bmpInfo.bmiHeader.biHeight, pBuf, &bmpInfo, DIB_RGB_COLORS);
|
||||||
|
|
||||||
if ((fp = _wfopen(fn, L"wb")) == NULL) {
|
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);
|
ui_msgbox(MBX_ERROR, temp);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
* Implementation of server several dialogs.
|
* 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, <decwiz@yahoo.com>
|
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||||
* Miran Grca, <mgrca8@gmail.com>
|
* Miran Grca, <mgrca8@gmail.com>
|
||||||
@@ -89,8 +89,8 @@ ui_msgbox(int flags, void *arg)
|
|||||||
{
|
{
|
||||||
WCHAR temp[512];
|
WCHAR temp[512];
|
||||||
DWORD fl = 0;
|
DWORD fl = 0;
|
||||||
WCHAR *str = NULL;
|
const WCHAR *str = NULL;
|
||||||
WCHAR *cap = NULL;
|
const WCHAR *cap = NULL;
|
||||||
|
|
||||||
switch(flags & 0x1f) {
|
switch(flags & 0x1f) {
|
||||||
case MBX_INFO: /* just an informational message */
|
case MBX_INFO: /* just an informational message */
|
||||||
@@ -100,16 +100,16 @@ ui_msgbox(int flags, void *arg)
|
|||||||
|
|
||||||
case MBX_WARNING: /* warning message */
|
case MBX_WARNING: /* warning message */
|
||||||
fl = (MB_YESNO | MB_ICONWARNING);
|
fl = (MB_YESNO | MB_ICONWARNING);
|
||||||
cap = plat_get_string(IDS_2051); /* "Warning" */
|
cap = get_string(IDS_2051); /* "Warning" */
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MBX_ERROR: /* error message */
|
case MBX_ERROR: /* error message */
|
||||||
if (flags & MBX_FATAL) {
|
if (flags & MBX_FATAL) {
|
||||||
fl = (MB_OK | MB_ICONERROR);
|
fl = (MB_OK | MB_ICONERROR);
|
||||||
cap = plat_get_string(IDS_2049); /* "Fatal Error"*/
|
cap = get_string(IDS_2049); /* "Fatal Error"*/
|
||||||
} else {
|
} else {
|
||||||
fl = (MB_OK | MB_ICONWARNING);
|
fl = (MB_OK | MB_ICONWARNING);
|
||||||
cap = plat_get_string(IDS_2048); /* "Error" */
|
cap = get_string(IDS_2048); /* "Error" */
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -120,7 +120,7 @@ ui_msgbox(int flags, void *arg)
|
|||||||
|
|
||||||
case MBX_CONFIG: /* configuration */
|
case MBX_CONFIG: /* configuration */
|
||||||
fl = (MB_YESNO | MB_ICONERROR);
|
fl = (MB_YESNO | MB_ICONERROR);
|
||||||
cap = plat_get_string(IDS_2050); /* "Configuration Error" */
|
cap = get_string(IDS_2050); /* "Configuration Error" */
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -145,7 +145,7 @@ ui_msgbox(int flags, void *arg)
|
|||||||
* that if the value of 'arg' is low, its an ID..
|
* that if the value of 'arg' is low, its an ID..
|
||||||
*/
|
*/
|
||||||
if (((uintptr_t)arg) < ((uintptr_t)65636))
|
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. */
|
/* At any rate, we do have a valid (wide) string now. */
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
* Implementation of the New Floppy Image dialog.
|
* 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, <decwiz@yahoo.com>
|
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||||
* Miran Grca, <mgrca8@gmail.com>
|
* Miran Grca, <mgrca8@gmail.com>
|
||||||
@@ -85,18 +85,18 @@ dlg_init(HWND hdlg)
|
|||||||
zip_types = zip_drives[fdd_id].is_250 ? 2 : 1;
|
zip_types = zip_drives[fdd_id].is_250 ? 2 : 1;
|
||||||
for (i = 0; i < zip_types; i++)
|
for (i = 0; i < zip_types; i++)
|
||||||
SendMessage(h, CB_ADDSTRING, 0,
|
SendMessage(h, CB_ADDSTRING, 0,
|
||||||
(LPARAM)plat_get_string(IDS_5900 + i));
|
(LPARAM)get_string(IDS_5900 + i));
|
||||||
} else {
|
} else {
|
||||||
for (i = 0; i < 12; i++)
|
for (i = 0; i < 12; i++)
|
||||||
SendMessage(h, CB_ADDSTRING, 0,
|
SendMessage(h, CB_ADDSTRING, 0,
|
||||||
(LPARAM)plat_get_string(IDS_5888 + i));
|
(LPARAM)get_string(IDS_5888 + i));
|
||||||
}
|
}
|
||||||
SendMessage(h, CB_SETCURSEL, 0, 0);
|
SendMessage(h, CB_SETCURSEL, 0, 0);
|
||||||
EnableWindow(h, FALSE);
|
EnableWindow(h, FALSE);
|
||||||
|
|
||||||
h = GetDlgItem(hdlg, IDC_COMBO_RPM_MODE);
|
h = GetDlgItem(hdlg, IDC_COMBO_RPM_MODE);
|
||||||
for (i = 0; i < 4; i++)
|
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);
|
SendMessage(h, CB_SETCURSEL, 0, 0);
|
||||||
EnableWindow(h, FALSE);
|
EnableWindow(h, FALSE);
|
||||||
ShowWindow(h, SW_HIDE);
|
ShowWindow(h, SW_HIDE);
|
||||||
@@ -181,7 +181,7 @@ dlg_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
case IDC_CFILE:
|
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 (! wcschr(temp_path, L'.')) {
|
||||||
if (wcslen(temp_path) && (wcslen(temp_path) <= 256)) {
|
if (wcslen(temp_path) && (wcslen(temp_path) <= 256)) {
|
||||||
twcs = &temp_path[wcslen(temp_path)];
|
twcs = &temp_path[wcslen(temp_path)];
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
* Implementation of the Settings dialog.
|
* 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, <decwiz@yahoo.com>
|
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||||
* Miran Grca, <mgrca8@gmail.com>
|
* Miran Grca, <mgrca8@gmail.com>
|
||||||
@@ -552,7 +552,7 @@ insert_categories(HWND hwndList)
|
|||||||
lvI.stateMask = lvI.iSubItem = lvI.state = 0;
|
lvI.stateMask = lvI.iSubItem = lvI.state = 0;
|
||||||
|
|
||||||
for (i=0; i<10; i++) {
|
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.iItem = i;
|
||||||
lvI.iImage = i;
|
lvI.iImage = i;
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
* Implementation of the Settings dialog.
|
* 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, <decwiz@yahoo.com>
|
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||||
* Miran Grca, <mgrca8@gmail.com>
|
* Miran Grca, <mgrca8@gmail.com>
|
||||||
@@ -165,29 +165,29 @@ disk_add_locations(HWND hdlg)
|
|||||||
|
|
||||||
h = GetDlgItem(hdlg, IDC_COMBO_HD_BUS);
|
h = GetDlgItem(hdlg, IDC_COMBO_HD_BUS);
|
||||||
for (i = 0; i < 6; i++)
|
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);
|
h = GetDlgItem(hdlg, IDC_COMBO_HD_CHANNEL);
|
||||||
for (i = 0; i < 8; i++) {
|
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);
|
SendMessage(h, CB_ADDSTRING, 0, (LPARAM)temp);
|
||||||
}
|
}
|
||||||
|
|
||||||
h = GetDlgItem(hdlg, IDC_COMBO_HD_ID);
|
h = GetDlgItem(hdlg, IDC_COMBO_HD_ID);
|
||||||
for (i = 0; i < 16; i++) {
|
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);
|
SendMessage(h, CB_ADDSTRING, 0, (LPARAM)temp);
|
||||||
}
|
}
|
||||||
|
|
||||||
h = GetDlgItem(hdlg, IDC_COMBO_HD_LUN);
|
h = GetDlgItem(hdlg, IDC_COMBO_HD_LUN);
|
||||||
for (i = 0; i < 8; i++) {
|
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);
|
SendMessage(h, CB_ADDSTRING, 0, (LPARAM)temp);
|
||||||
}
|
}
|
||||||
|
|
||||||
h = GetDlgItem(hdlg, IDC_COMBO_HD_CHANNEL_IDE);
|
h = GetDlgItem(hdlg, IDC_COMBO_HD_CHANNEL_IDE);
|
||||||
for (i = 0; i < 8; i++) {
|
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);
|
SendMessage(h, CB_ADDSTRING, 0, (LPARAM)temp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -464,27 +464,27 @@ disk_update_item(HWND hwndList, int i, int column)
|
|||||||
if (column == 0) {
|
if (column == 0) {
|
||||||
switch(temp_hdd[i].bus) {
|
switch(temp_hdd[i].bus) {
|
||||||
case HDD_BUS_ST506:
|
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;
|
break;
|
||||||
|
|
||||||
case HDD_BUS_ESDI:
|
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;
|
break;
|
||||||
|
|
||||||
case HDD_BUS_IDE_PIO_ONLY:
|
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;
|
break;
|
||||||
|
|
||||||
case HDD_BUS_IDE_PIO_AND_DMA:
|
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;
|
break;
|
||||||
|
|
||||||
case HDD_BUS_SCSI:
|
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;
|
break;
|
||||||
|
|
||||||
case HDD_BUS_SCSI_REMOVABLE:
|
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;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -494,19 +494,19 @@ disk_update_item(HWND hwndList, int i, int column)
|
|||||||
lvI.pszText = temp_hdd[i].fn;
|
lvI.pszText = temp_hdd[i].fn;
|
||||||
lvI.iImage = 0;
|
lvI.iImage = 0;
|
||||||
} else if (column == 2) {
|
} 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.pszText = temp;
|
||||||
lvI.iImage = 0;
|
lvI.iImage = 0;
|
||||||
} else if (column == 3) {
|
} 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.pszText = temp;
|
||||||
lvI.iImage = 0;
|
lvI.iImage = 0;
|
||||||
} else if (column == 4) {
|
} 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.pszText = temp;
|
||||||
lvI.iImage = 0;
|
lvI.iImage = 0;
|
||||||
} else if (column == 5) {
|
} 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.pszText = temp;
|
||||||
lvI.iImage = 0;
|
lvI.iImage = 0;
|
||||||
}
|
}
|
||||||
@@ -547,27 +547,27 @@ disk_recalc_list(HWND hwndList)
|
|||||||
|
|
||||||
switch(temp_hdd[i].bus) {
|
switch(temp_hdd[i].bus) {
|
||||||
case HDD_BUS_ST506:
|
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;
|
break;
|
||||||
|
|
||||||
case HDD_BUS_ESDI:
|
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;
|
break;
|
||||||
|
|
||||||
case HDD_BUS_IDE_PIO_ONLY:
|
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;
|
break;
|
||||||
|
|
||||||
case HDD_BUS_IDE_PIO_AND_DMA:
|
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;
|
break;
|
||||||
|
|
||||||
case HDD_BUS_SCSI:
|
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;
|
break;
|
||||||
|
|
||||||
case HDD_BUS_SCSI_REMOVABLE:
|
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;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -583,28 +583,28 @@ disk_recalc_list(HWND hwndList)
|
|||||||
if (ListView_SetItem(hwndList, &lvI) == -1) return FALSE;
|
if (ListView_SetItem(hwndList, &lvI) == -1) return FALSE;
|
||||||
|
|
||||||
lvI.iSubItem = 2;
|
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.pszText = temp;
|
||||||
lvI.iItem = j;
|
lvI.iItem = j;
|
||||||
lvI.iImage = 0;
|
lvI.iImage = 0;
|
||||||
if (ListView_SetItem(hwndList, &lvI) == -1) return FALSE;
|
if (ListView_SetItem(hwndList, &lvI) == -1) return FALSE;
|
||||||
|
|
||||||
lvI.iSubItem = 3;
|
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.pszText = temp;
|
||||||
lvI.iItem = j;
|
lvI.iItem = j;
|
||||||
lvI.iImage = 0;
|
lvI.iImage = 0;
|
||||||
if (ListView_SetItem(hwndList, &lvI) == -1) return FALSE;
|
if (ListView_SetItem(hwndList, &lvI) == -1) return FALSE;
|
||||||
|
|
||||||
lvI.iSubItem = 4;
|
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.pszText = temp;
|
||||||
lvI.iItem = j;
|
lvI.iItem = j;
|
||||||
lvI.iImage = 0;
|
lvI.iImage = 0;
|
||||||
if (ListView_SetItem(hwndList, &lvI) == -1) return FALSE;
|
if (ListView_SetItem(hwndList, &lvI) == -1) return FALSE;
|
||||||
|
|
||||||
lvI.iSubItem = 5;
|
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.pszText = temp;
|
||||||
lvI.iItem = j;
|
lvI.iItem = j;
|
||||||
lvI.iImage = 0;
|
lvI.iImage = 0;
|
||||||
@@ -631,7 +631,7 @@ disk_init_columns(HWND hwndList)
|
|||||||
lvc.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
|
lvc.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
|
||||||
|
|
||||||
lvc.iSubItem = iCol;
|
lvc.iSubItem = iCol;
|
||||||
lvc.pszText = plat_get_string(2082 + iCol);
|
lvc.pszText = (LPTSTR)get_string(2082 + iCol);
|
||||||
|
|
||||||
switch(iCol) {
|
switch(iCol) {
|
||||||
case 0: /* Bus */
|
case 0: /* Bus */
|
||||||
@@ -699,7 +699,7 @@ set_edit_box_contents(HWND hdlg, int id, uint64_t val)
|
|||||||
HWND h;
|
HWND h;
|
||||||
|
|
||||||
h = GetDlgItem(hdlg, id);
|
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);
|
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;
|
temp_size = hdd_table[i].cyls * hdd_table[i].head * hdd_table[i].sect;
|
||||||
size_mb = temp_size >> 11;
|
size_mb = temp_size >> 11;
|
||||||
swprintf(temp, sizeof_w(temp),
|
swprintf(temp, sizeof_w(temp),
|
||||||
plat_get_string(IDS_2157),
|
get_string(IDS_2157),
|
||||||
size_mb, hdd_table[i].cyls,
|
size_mb, hdd_table[i].cyls,
|
||||||
hdd_table[i].head, hdd_table[i].sect);
|
hdd_table[i].head, hdd_table[i].sect);
|
||||||
SendMessage(h, CB_ADDSTRING, 0, (LPARAM)temp);
|
SendMessage(h, CB_ADDSTRING, 0, (LPARAM)temp);
|
||||||
@@ -728,8 +728,8 @@ disk_initialize_hdt(HWND hdlg)
|
|||||||
selection = i;
|
selection = i;
|
||||||
}
|
}
|
||||||
|
|
||||||
SendMessage(h, CB_ADDSTRING, 0, (LPARAM)plat_get_string(IDS_4100));
|
SendMessage(h, CB_ADDSTRING, 0, (LPARAM)get_string(IDS_4100));
|
||||||
SendMessage(h, CB_ADDSTRING, 0, (LPARAM)plat_get_string(IDS_4101));
|
SendMessage(h, CB_ADDSTRING, 0, (LPARAM)get_string(IDS_4101));
|
||||||
SendMessage(h, CB_SETCURSEL, selection & 0xffff, 0);
|
SendMessage(h, CB_SETCURSEL, selection & 0xffff, 0);
|
||||||
|
|
||||||
return selection;
|
return selection;
|
||||||
@@ -791,7 +791,7 @@ disk_add_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
|
|||||||
hdd_ptr = &(temp_hdd[next_free_id]);
|
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;
|
no_update = 1;
|
||||||
spt = (existing & 1) ? 0 : 17;
|
spt = (existing & 1) ? 0 : 17;
|
||||||
@@ -1065,7 +1065,7 @@ hd_add_ok_common:
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
case IDC_CFILE:
|
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 (! wcschr(temp_path, L'.')) {
|
||||||
if (wcslen(temp_path) && (wcslen(temp_path) <= 256)) {
|
if (wcslen(temp_path) && (wcslen(temp_path) <= 256)) {
|
||||||
twcs = &temp_path[wcslen(temp_path)];
|
twcs = &temp_path[wcslen(temp_path)];
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
* Implementation of the Settings dialog.
|
* 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, <decwiz@yahoo.com>
|
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||||
* Miran Grca, <mgrca8@gmail.com>
|
* Miran Grca, <mgrca8@gmail.com>
|
||||||
@@ -85,7 +85,7 @@ floppy_recalc_list(HWND hwndList)
|
|||||||
mbstowcs(temp, tempA, sizeof_w(temp));
|
mbstowcs(temp, tempA, sizeof_w(temp));
|
||||||
lvI.pszText = temp;
|
lvI.pszText = temp;
|
||||||
} else {
|
} else {
|
||||||
lvI.pszText = plat_get_string(IDS_5376);
|
lvI.pszText = (LPTSTR)get_string(IDS_5376);
|
||||||
}
|
}
|
||||||
lvI.iItem = i;
|
lvI.iItem = i;
|
||||||
lvI.iImage = temp_fdd_types[i];
|
lvI.iImage = temp_fdd_types[i];
|
||||||
@@ -93,14 +93,14 @@ floppy_recalc_list(HWND hwndList)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
lvI.iSubItem = 1;
|
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.iItem = i;
|
||||||
lvI.iImage = 0;
|
lvI.iImage = 0;
|
||||||
if (ListView_SetItem(hwndList, &lvI) == -1)
|
if (ListView_SetItem(hwndList, &lvI) == -1)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
lvI.iSubItem = 2;
|
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.iItem = i;
|
||||||
lvI.iImage = 0;
|
lvI.iImage = 0;
|
||||||
if (ListView_SetItem(hwndList, &lvI) == -1)
|
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.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
|
||||||
|
|
||||||
lvc.iSubItem = 0;
|
lvc.iSubItem = 0;
|
||||||
lvc.pszText = plat_get_string(IDS_2143);
|
lvc.pszText = (LPTSTR)get_string(IDS_2143);
|
||||||
lvc.cx = 292;
|
lvc.cx = 292;
|
||||||
lvc.fmt = LVCFMT_LEFT;
|
lvc.fmt = LVCFMT_LEFT;
|
||||||
if (ListView_InsertColumn(hwndList, 0, &lvc) == -1)
|
if (ListView_InsertColumn(hwndList, 0, &lvc) == -1)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
lvc.iSubItem = 1;
|
lvc.iSubItem = 1;
|
||||||
lvc.pszText = plat_get_string(IDS_2059);
|
lvc.pszText = (LPTSTR)get_string(IDS_2059);
|
||||||
lvc.cx = 50;
|
lvc.cx = 50;
|
||||||
lvc.fmt = LVCFMT_LEFT;
|
lvc.fmt = LVCFMT_LEFT;
|
||||||
if (ListView_InsertColumn(hwndList, 1, &lvc) == -1)
|
if (ListView_InsertColumn(hwndList, 1, &lvc) == -1)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
lvc.iSubItem = 2;
|
lvc.iSubItem = 2;
|
||||||
lvc.pszText = plat_get_string(IDS_2170);
|
lvc.pszText = (LPTSTR)get_string(IDS_2170);
|
||||||
lvc.cx = 75;
|
lvc.cx = 75;
|
||||||
lvc.fmt = LVCFMT_LEFT;
|
lvc.fmt = LVCFMT_LEFT;
|
||||||
if (ListView_InsertColumn(hwndList, 2, &lvc) == -1)
|
if (ListView_InsertColumn(hwndList, 2, &lvc) == -1)
|
||||||
@@ -179,21 +179,21 @@ floppy_update_item(HWND hwndList, int i)
|
|||||||
mbstowcs(temp, tempA, sizeof_w(temp));
|
mbstowcs(temp, tempA, sizeof_w(temp));
|
||||||
lvI.pszText = temp;
|
lvI.pszText = temp;
|
||||||
} else {
|
} else {
|
||||||
lvI.pszText = plat_get_string(IDS_5376);
|
lvI.pszText = (LPTSTR)get_string(IDS_5376);
|
||||||
}
|
}
|
||||||
lvI.iImage = temp_fdd_types[i];
|
lvI.iImage = temp_fdd_types[i];
|
||||||
if (ListView_SetItem(hwndList, &lvI) == -1)
|
if (ListView_SetItem(hwndList, &lvI) == -1)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
lvI.iSubItem = 1;
|
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.iItem = i;
|
||||||
lvI.iImage = 0;
|
lvI.iImage = 0;
|
||||||
if (ListView_SetItem(hwndList, &lvI) == -1)
|
if (ListView_SetItem(hwndList, &lvI) == -1)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
lvI.iSubItem = 2;
|
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.iItem = i;
|
||||||
lvI.iImage = 0;
|
lvI.iImage = 0;
|
||||||
if (ListView_SetItem(hwndList, &lvI) == -1)
|
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);
|
h = GetDlgItem(hdlg, IDC_COMBO_FD_TYPE);
|
||||||
for (i = 0; i < 14; i++) {
|
for (i = 0; i < 14; i++) {
|
||||||
if (i == 0) {
|
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 {
|
} else {
|
||||||
mbstowcs(temp, fdd_getname(i), sizeof_w(temp));
|
mbstowcs(temp, fdd_getname(i), sizeof_w(temp));
|
||||||
SendMessage(h, CB_ADDSTRING, 0, (LPARAM)temp);
|
SendMessage(h, CB_ADDSTRING, 0, (LPARAM)temp);
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
* Implementation of the Settings dialog.
|
* 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, <decwiz@yahoo.com>
|
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||||
* Miran Grca, <mgrca8@gmail.com>
|
* Miran Grca, <mgrca8@gmail.com>
|
||||||
@@ -178,11 +178,11 @@ machine_recalc_machine(HWND hdlg)
|
|||||||
if (!(machines[romstomachine[rs]].flags & MACHINE_AT) || (machines[romstomachine[rs]].ram_granularity >= 128)) {
|
if (!(machines[romstomachine[rs]].flags & MACHINE_AT) || (machines[romstomachine[rs]].ram_granularity >= 128)) {
|
||||||
SendMessage(h, UDM_SETPOS, 0, temp_mem_size);
|
SendMessage(h, UDM_SETPOS, 0, temp_mem_size);
|
||||||
h = GetDlgItem(hdlg, IDC_TEXT_MB);
|
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 {
|
} else {
|
||||||
SendMessage(h, UDM_SETPOS, 0, temp_mem_size / 1024);
|
SendMessage(h, UDM_SETPOS, 0, temp_mem_size / 1024);
|
||||||
h = GetDlgItem(hdlg, IDC_TEXT_MB);
|
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);
|
SendMessage(h, CB_SETCURSEL, machinetolist[temp_machine], 0);
|
||||||
|
|
||||||
h = GetDlgItem(hdlg, IDC_COMBO_WS);
|
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++) {
|
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);
|
SendMessage(h, CB_ADDSTRING, 0, (LPARAM)temp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
* Implementation of the Settings dialog.
|
* 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, <decwiz@yahoo.com>
|
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||||
* Miran Grca, <mgrca8@gmail.com>
|
* Miran Grca, <mgrca8@gmail.com>
|
||||||
@@ -150,7 +150,7 @@ peripherals_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
|
|||||||
|
|
||||||
if (device_is_valid(dev, machines[temp_machine].flags)) {
|
if (device_is_valid(dev, machines[temp_machine].flags)) {
|
||||||
if (c == 0) {
|
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 {
|
} else {
|
||||||
mbstowcs(temp, stransi, sizeof_w(temp));
|
mbstowcs(temp, stransi, sizeof_w(temp));
|
||||||
SendMessage(h, CB_ADDSTRING, 0, (LPARAM)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);
|
recalc_hdc_list(hdlg, temp_machine, 0);
|
||||||
|
|
||||||
h = GetDlgItem(hdlg, IDC_COMBO_IDE_TER);
|
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++) {
|
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);
|
SendMessage(h, CB_ADDSTRING, 0, (LPARAM)temp);
|
||||||
}
|
}
|
||||||
if (temp_ide_ter)
|
if (temp_ide_ter)
|
||||||
@@ -191,9 +191,9 @@ peripherals_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
|
|||||||
SendMessage(h, CB_SETCURSEL, 0, 0);
|
SendMessage(h, CB_SETCURSEL, 0, 0);
|
||||||
|
|
||||||
h = GetDlgItem(hdlg, IDC_COMBO_IDE_QUA);
|
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++) {
|
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);
|
SendMessage(h, CB_ADDSTRING, 0, (LPARAM)temp);
|
||||||
}
|
}
|
||||||
if (temp_ide_qua)
|
if (temp_ide_qua)
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
* Implementation of the "Removable Devices" dialog.
|
* 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, <decwiz@yahoo.com>
|
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||||
* Miran Grca, <mgrca8@gmail.com>
|
* Miran Grca, <mgrca8@gmail.com>
|
||||||
@@ -117,24 +117,24 @@ cdrom_recalc_list(HWND hwndList)
|
|||||||
switch (temp_cdrom_drives[i].bus_type) {
|
switch (temp_cdrom_drives[i].bus_type) {
|
||||||
case CDROM_BUS_DISABLED:
|
case CDROM_BUS_DISABLED:
|
||||||
default:
|
default:
|
||||||
lvI.pszText = plat_get_string(fsid);
|
lvI.pszText = (LPTSTR)get_string(fsid);
|
||||||
lvI.iImage = 0;
|
lvI.iImage = 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CDROM_BUS_ATAPI_PIO_ONLY:
|
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.pszText = temp;
|
||||||
lvI.iImage = 1;
|
lvI.iImage = 1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CDROM_BUS_ATAPI_PIO_AND_DMA:
|
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.pszText = temp;
|
||||||
lvI.iImage = 1;
|
lvI.iImage = 1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CDROM_BUS_SCSI:
|
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.pszText = temp;
|
||||||
lvI.iImage = 1;
|
lvI.iImage = 1;
|
||||||
break;
|
break;
|
||||||
@@ -145,7 +145,7 @@ cdrom_recalc_list(HWND hwndList)
|
|||||||
|
|
||||||
lvI.iSubItem = 1;
|
lvI.iSubItem = 1;
|
||||||
if (temp_cdrom_drives[i].bus_type == CDROM_BUS_DISABLED) {
|
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 {
|
} else {
|
||||||
wsprintf(temp, L"%ix",
|
wsprintf(temp, L"%ix",
|
||||||
cdrom_speeds[temp_cdrom_drives[i].speed_idx].speed);
|
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.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
|
||||||
|
|
||||||
lvc.iSubItem = 0;
|
lvc.iSubItem = 0;
|
||||||
lvc.pszText = plat_get_string(IDS_2082);
|
lvc.pszText = (LPTSTR)get_string(IDS_2082);
|
||||||
lvc.cx = 342;
|
lvc.cx = 342;
|
||||||
lvc.fmt = LVCFMT_LEFT;
|
lvc.fmt = LVCFMT_LEFT;
|
||||||
if (ListView_InsertColumn(hwndList, 0, &lvc) == -1)
|
if (ListView_InsertColumn(hwndList, 0, &lvc) == -1)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
lvc.iSubItem = 1;
|
lvc.iSubItem = 1;
|
||||||
lvc.pszText = plat_get_string(IDS_2179);
|
lvc.pszText = (LPTSTR)get_string(IDS_2179);
|
||||||
lvc.cx = 50;
|
lvc.cx = 50;
|
||||||
lvc.fmt = LVCFMT_LEFT;
|
lvc.fmt = LVCFMT_LEFT;
|
||||||
if (ListView_InsertColumn(hwndList, 1, &lvc) == -1)
|
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) {
|
switch (temp_cdrom_drives[i].bus_type) {
|
||||||
case CDROM_BUS_DISABLED:
|
case CDROM_BUS_DISABLED:
|
||||||
default:
|
default:
|
||||||
lvI.pszText = plat_get_string(fsid);
|
lvI.pszText = (LPTSTR)get_string(fsid);
|
||||||
lvI.iImage = 0;
|
lvI.iImage = 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CDROM_BUS_ATAPI_PIO_ONLY:
|
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.pszText = temp;
|
||||||
lvI.iImage = 1;
|
lvI.iImage = 1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CDROM_BUS_ATAPI_PIO_AND_DMA:
|
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.pszText = temp;
|
||||||
lvI.iImage = 1;
|
lvI.iImage = 1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CDROM_BUS_SCSI:
|
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.pszText = temp;
|
||||||
lvI.iImage = 1;
|
lvI.iImage = 1;
|
||||||
break;
|
break;
|
||||||
@@ -249,7 +249,7 @@ cdrom_update_item(HWND hwndList, int i)
|
|||||||
|
|
||||||
lvI.iSubItem = 1;
|
lvI.iSubItem = 1;
|
||||||
if (temp_cdrom_drives[i].bus_type == CDROM_BUS_DISABLED) {
|
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 {
|
} else {
|
||||||
wsprintf(temp, L"%ix",
|
wsprintf(temp, L"%ix",
|
||||||
cdrom_speeds[temp_cdrom_drives[i].speed_idx].speed);
|
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);
|
h = GetDlgItem(hdlg, IDC_COMBO_CD_BUS);
|
||||||
for (i = CDROM_BUS_DISABLED; i <= CDROM_BUS_SCSI; i++) {
|
for (i = CDROM_BUS_DISABLED; i <= CDROM_BUS_SCSI; i++) {
|
||||||
if ((i == CDROM_BUS_DISABLED) || (i >= CDROM_BUS_ATAPI_PIO_ONLY)) {
|
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);
|
h = GetDlgItem(hdlg, IDC_COMBO_CD_ID);
|
||||||
for (i = 0; i < 16; i++) {
|
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);
|
SendMessage(h, CB_ADDSTRING, 0, (LPARAM)temp);
|
||||||
}
|
}
|
||||||
|
|
||||||
h = GetDlgItem(hdlg, IDC_COMBO_CD_LUN);
|
h = GetDlgItem(hdlg, IDC_COMBO_CD_LUN);
|
||||||
for (i = 0; i < 8; i++) {
|
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);
|
SendMessage(h, CB_ADDSTRING, 0, (LPARAM)temp);
|
||||||
}
|
}
|
||||||
|
|
||||||
h = GetDlgItem(hdlg, IDC_COMBO_CD_CHANNEL_IDE);
|
h = GetDlgItem(hdlg, IDC_COMBO_CD_CHANNEL_IDE);
|
||||||
for (i = 0; i < 8; i++) {
|
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);
|
SendMessage(h, CB_ADDSTRING, 0, (LPARAM)temp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -464,24 +464,24 @@ zip_recalc_list(HWND hwndList)
|
|||||||
switch (temp_zip_drives[i].bus_type) {
|
switch (temp_zip_drives[i].bus_type) {
|
||||||
case ZIP_BUS_DISABLED:
|
case ZIP_BUS_DISABLED:
|
||||||
default:
|
default:
|
||||||
lvI.pszText = plat_get_string(fsid);
|
lvI.pszText = (LPTSTR)get_string(fsid);
|
||||||
lvI.iImage = 0;
|
lvI.iImage = 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ZIP_BUS_ATAPI_PIO_ONLY:
|
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.pszText = temp;
|
||||||
lvI.iImage = 1;
|
lvI.iImage = 1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ZIP_BUS_ATAPI_PIO_AND_DMA:
|
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.pszText = temp;
|
||||||
lvI.iImage = 1;
|
lvI.iImage = 1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ZIP_BUS_SCSI:
|
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.pszText = temp;
|
||||||
lvI.iImage = 1;
|
lvI.iImage = 1;
|
||||||
break;
|
break;
|
||||||
@@ -491,7 +491,7 @@ zip_recalc_list(HWND hwndList)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
lvI.iSubItem = 1;
|
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.iItem = i;
|
||||||
lvI.iImage = 0;
|
lvI.iImage = 0;
|
||||||
if (ListView_SetItem(hwndList, &lvI) == -1)
|
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.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
|
||||||
|
|
||||||
lvc.iSubItem = 0;
|
lvc.iSubItem = 0;
|
||||||
lvc.pszText = plat_get_string(IDS_2082);
|
lvc.pszText = (LPTSTR)get_string(IDS_2082);
|
||||||
lvc.cx = 342;
|
lvc.cx = 342;
|
||||||
lvc.fmt = LVCFMT_LEFT;
|
lvc.fmt = LVCFMT_LEFT;
|
||||||
if (ListView_InsertColumn(hwndList, 0, &lvc) == -1)
|
if (ListView_InsertColumn(hwndList, 0, &lvc) == -1)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
lvc.iSubItem = 1;
|
lvc.iSubItem = 1;
|
||||||
lvc.pszText = plat_get_string(IDS_2143);
|
lvc.pszText = (LPTSTR)get_string(IDS_2143);
|
||||||
lvc.cx = 50;
|
lvc.cx = 50;
|
||||||
lvc.fmt = LVCFMT_LEFT;
|
lvc.fmt = LVCFMT_LEFT;
|
||||||
if (ListView_InsertColumn(hwndList, 1, &lvc) == -1)
|
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) {
|
switch (temp_zip_drives[i].bus_type) {
|
||||||
case ZIP_BUS_DISABLED:
|
case ZIP_BUS_DISABLED:
|
||||||
default:
|
default:
|
||||||
lvI.pszText = plat_get_string(fsid);
|
lvI.pszText = (LPTSTR)get_string(fsid);
|
||||||
lvI.iImage = 0;
|
lvI.iImage = 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ZIP_BUS_ATAPI_PIO_ONLY:
|
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.pszText = temp;
|
||||||
lvI.iImage = 1;
|
lvI.iImage = 1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ZIP_BUS_ATAPI_PIO_AND_DMA:
|
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.pszText = temp;
|
||||||
lvI.iImage = 1;
|
lvI.iImage = 1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ZIP_BUS_SCSI:
|
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.pszText = temp;
|
||||||
lvI.iImage = 1;
|
lvI.iImage = 1;
|
||||||
break;
|
break;
|
||||||
@@ -589,7 +589,7 @@ zip_update_item(HWND hwndList, int i)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
lvI.iSubItem = 1;
|
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.iItem = i;
|
||||||
lvI.iImage = 0;
|
lvI.iImage = 0;
|
||||||
if (ListView_SetItem(hwndList, &lvI) == -1)
|
if (ListView_SetItem(hwndList, &lvI) == -1)
|
||||||
@@ -607,25 +607,25 @@ zip_add_locations(HWND hdlg)
|
|||||||
h = GetDlgItem(hdlg, IDC_COMBO_ZIP_BUS);
|
h = GetDlgItem(hdlg, IDC_COMBO_ZIP_BUS);
|
||||||
for (i = ZIP_BUS_DISABLED; i <= ZIP_BUS_SCSI; i++) {
|
for (i = ZIP_BUS_DISABLED; i <= ZIP_BUS_SCSI; i++) {
|
||||||
if ((i == ZIP_BUS_DISABLED) || (i >= ZIP_BUS_ATAPI_PIO_ONLY)) {
|
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);
|
h = GetDlgItem(hdlg, IDC_COMBO_ZIP_ID);
|
||||||
for (i = 0; i < 16; i++) {
|
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);
|
SendMessage(h, CB_ADDSTRING, 0, (LPARAM)temp);
|
||||||
}
|
}
|
||||||
|
|
||||||
h = GetDlgItem(hdlg, IDC_COMBO_ZIP_LUN);
|
h = GetDlgItem(hdlg, IDC_COMBO_ZIP_LUN);
|
||||||
for (i = 0; i < 8; i++) {
|
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);
|
SendMessage(h, CB_ADDSTRING, 0, (LPARAM)temp);
|
||||||
}
|
}
|
||||||
|
|
||||||
h = GetDlgItem(hdlg, IDC_COMBO_ZIP_CHANNEL_IDE);
|
h = GetDlgItem(hdlg, IDC_COMBO_ZIP_CHANNEL_IDE);
|
||||||
for (i = 0; i < 8; i++) {
|
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);
|
SendMessage(h, CB_ADDSTRING, 0, (LPARAM)temp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
* Implementation of the Settings dialog.
|
* 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, <decwiz@yahoo.com>
|
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
|
||||||
* Miran Grca, <mgrca8@gmail.com>
|
* Miran Grca, <mgrca8@gmail.com>
|
||||||
@@ -109,13 +109,13 @@ video_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
|
|||||||
recalc_vid_list(hdlg);
|
recalc_vid_list(hdlg);
|
||||||
|
|
||||||
h = GetDlgItem(hdlg, IDC_COMBO_VIDEO_SPEED);
|
h = GetDlgItem(hdlg, IDC_COMBO_VIDEO_SPEED);
|
||||||
SendMessage(h, CB_ADDSTRING, 0, (LPARAM)plat_get_string(IDS_2131));
|
SendMessage(h, CB_ADDSTRING, 0, (LPARAM)get_string(IDS_2131));
|
||||||
SendMessage(h, CB_ADDSTRING, 0, (LPARAM)plat_get_string(IDS_2133));
|
SendMessage(h, CB_ADDSTRING, 0, (LPARAM)get_string(IDS_2133));
|
||||||
SendMessage(h, CB_ADDSTRING, 0, (LPARAM)plat_get_string(IDS_2134));
|
SendMessage(h, CB_ADDSTRING, 0, (LPARAM)get_string(IDS_2134));
|
||||||
SendMessage(h, CB_ADDSTRING, 0, (LPARAM)plat_get_string(IDS_2135));
|
SendMessage(h, CB_ADDSTRING, 0, (LPARAM)get_string(IDS_2135));
|
||||||
SendMessage(h, CB_ADDSTRING, 0, (LPARAM)plat_get_string(IDS_2136));
|
SendMessage(h, CB_ADDSTRING, 0, (LPARAM)get_string(IDS_2136));
|
||||||
SendMessage(h, CB_ADDSTRING, 0, (LPARAM)plat_get_string(IDS_2137));
|
SendMessage(h, CB_ADDSTRING, 0, (LPARAM)get_string(IDS_2137));
|
||||||
SendMessage(h, CB_ADDSTRING, 0, (LPARAM)plat_get_string(IDS_2138));
|
SendMessage(h, CB_ADDSTRING, 0, (LPARAM)get_string(IDS_2138));
|
||||||
SendMessage(h, CB_SETCURSEL, temp_video_speed+1, 0);
|
SendMessage(h, CB_SETCURSEL, temp_video_speed+1, 0);
|
||||||
|
|
||||||
h = GetDlgItem(hdlg, IDC_CHECK_VOODOO);
|
h = GetDlgItem(hdlg, IDC_CHECK_VOODOO);
|
||||||
|
|||||||
@@ -662,8 +662,7 @@ again:
|
|||||||
* Inform the user, and ask if they want to reset
|
* Inform the user, and ask if they want to reset
|
||||||
* to the system default one instead.
|
* to the system default one instead.
|
||||||
*/
|
*/
|
||||||
_swprintf(title, plat_get_string(IDS_2095),
|
_swprintf(title, get_string(IDS_2095), vidapi_internal_name(vid_api));
|
||||||
vidapi_internal_name(vid_api));
|
|
||||||
if (ui_msgbox(MBX_CONFIG, title) != 0) {
|
if (ui_msgbox(MBX_CONFIG, title) != 0) {
|
||||||
/* Nope, they don't, so just exit. */
|
/* Nope, they don't, so just exit. */
|
||||||
return(5);
|
return(5);
|
||||||
@@ -797,7 +796,7 @@ ui_menu_update(void)
|
|||||||
|
|
||||||
/* Update the application's title bar. */
|
/* Update the application's title bar. */
|
||||||
wchar_t *
|
wchar_t *
|
||||||
ui_window_title(wchar_t *s)
|
ui_window_title(const wchar_t *s)
|
||||||
{
|
{
|
||||||
if (! vid_fullscreen) {
|
if (! vid_fullscreen) {
|
||||||
if (s != NULL)
|
if (s != NULL)
|
||||||
@@ -811,7 +810,7 @@ ui_window_title(wchar_t *s)
|
|||||||
s = wTitle;
|
s = wTitle;
|
||||||
}
|
}
|
||||||
|
|
||||||
return(s);
|
return((wchar_t *)s);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -868,7 +867,7 @@ plat_setfullscreen(int on)
|
|||||||
plat_startblit();
|
plat_startblit();
|
||||||
video_wait_for_blit();
|
video_wait_for_blit();
|
||||||
|
|
||||||
// win_mouse_close();
|
win_mouse_close();
|
||||||
|
|
||||||
/* Close the current mode, and open the new one. */
|
/* Close the current mode, and open the new one. */
|
||||||
plat_vidapis[vid_api]->close();
|
plat_vidapis[vid_api]->close();
|
||||||
@@ -879,7 +878,7 @@ plat_setfullscreen(int on)
|
|||||||
wx_set_fullscreen(on);
|
wx_set_fullscreen(on);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// win_mouse_init();
|
win_mouse_init();
|
||||||
|
|
||||||
/* Release video and make it redraw the screen. */
|
/* Release video and make it redraw the screen. */
|
||||||
plat_endblit();
|
plat_endblit();
|
||||||
|
|||||||
Reference in New Issue
Block a user