Added symbol VSIDE in the MSVC workspace files and and the manifest section

of win32res.rc to compile Bochs correctly with both IDE and nmake.
Fixed MSVC warnings in some devices.
This commit is contained in:
Volker Ruppert 2017-03-19 12:22:27 +00:00
parent 9bef555f3e
commit df6adaaf1f
8 changed files with 12 additions and 10 deletions

View File

@ -1945,7 +1945,7 @@ BX_CPP_INLINE Bit32s fast_reciplog(Bit64s value, Bit32s *log2)
recip <<= exp;
/* on the way out, apply the original sign to the reciprocal */
return neg ? -recip : recip;
return neg ? -((Bit32s)recip) : recip;
}

View File

@ -574,9 +574,9 @@ void adlib_init(Bit32u samplerate)
// create tremolo table
Bit32s trem_table_int[TREMTAB_SIZE];
for (i=0; i<14; i++) trem_table_int[i] = i-13; // upwards (13 to 26 -> -0.5/6 to 0)
for (i=14; i<41; i++) trem_table_int[i] = -i+14; // downwards (26 to 0 -> 0 to -1/6)
for (i=41; i<53; i++) trem_table_int[i] = i-40-26; // upwards (1 to 12 -> -1/6 to -0.5/6)
for (i=0; i<14; i++) trem_table_int[i] = (Bit32s)(i-13); // upwards (13 to 26 -> -0.5/6 to 0)
for (i=14; i<41; i++) trem_table_int[i] = (Bit32s)(-i+14); // downwards (26 to 0 -> 0 to -1/6)
for (i=41; i<53; i++) trem_table_int[i] = (Bit32s)(i-40-26); // upwards (1 to 12 -> -1/6 to -0.5/6)
for (i=0; i<TREMTAB_SIZE; i++) {
// 0.0 .. -26/26*4.8/6 == [0.0 .. -0.8], 4/53 steps == [1 .. 0.57]
@ -1025,10 +1025,10 @@ bx_bool adlib_getsample(Bit16u rate, Bit16s* sndptr, Bits numsamples, Bit16u vol
endsamples = samples_to_process-cursmp;
if (endsamples>BLOCKBUF_SIZE) endsamples = BLOCKBUF_SIZE;
memset((void*)&outbufl,0,endsamples*sizeof(Bit32s));
memset((void*)&outbufl, 0, (size_t)endsamples*sizeof(Bit32s));
#if defined(OPLTYPE_IS_OPL3)
// clear second output buffer (opl3 stereo)
if (adlibreg[0x105]&1) memset((void*)&outbufr,0,endsamples*sizeof(Bit32s));
if (adlibreg[0x105]&1) memset((void*)&outbufr, 0, (size_t)endsamples*sizeof(Bit32s));
#endif
// calculate vibrato/tremolo lookup tables

View File

@ -954,7 +954,7 @@ int usb_cbi_device_c::handle_data(USBPacket *p)
count = max_sectors;
}
s.sector_count -= count;
ret = s.hdimage->read((bx_ptr_t) s.usb_buf, count * 512);
ret = (int)s.hdimage->read((bx_ptr_t) s.usb_buf, count * 512);
if (ret > 0) {
s.usb_len += ret;
s.usb_buf += ret;
@ -1111,7 +1111,7 @@ int usb_cbi_device_c::floppy_read_sector()
if (((CBI_MAX_SECTORS * 512) - s.usb_len) >= 512) {
ret = s.hdimage->read((bx_ptr_t) s.usb_buf, 512);
if (ret > 0) {
s.usb_len += ret;
s.usb_len += (Bit32u)ret;
s.usb_buf += ret;
} else {
BX_ERROR(("read error"));

View File

@ -2144,7 +2144,7 @@ void bx_usb_ehci_c::ehci_frame_timer(void)
t_now = bx_pc_system.time_usec();
usec_elapsed = t_now - BX_EHCI_THIS hub.last_run_usec;
frames = usec_elapsed / FRAME_TIMER_USEC;
frames = (int)(usec_elapsed / FRAME_TIMER_USEC);
if (BX_EHCI_THIS periodic_enabled() || (BX_EHCI_THIS hub.pstate != EST_INACTIVE)) {
need_timer++;

View File

@ -430,7 +430,7 @@ bx_bool usb_msd_device_c::init()
s.hdimage = DEV_hdimage_init_image(s.image_mode, 0, s.journal);
if (s.image_mode == BX_HDIMAGE_MODE_VVFAT) {
Bit64u hdsize = ((Bit64u)s.size) << 20;
s.hdimage->cylinders = (Bit64u)(hdsize/16.0/63.0/512.0);
s.hdimage->cylinders = (unsigned)(hdsize/16.0/63.0/512.0);
s.hdimage->heads = 16;
s.hdimage->spt = 63;
}

View File

@ -6,7 +6,9 @@ ICON_BOCHS ICON build/win32/nsis/bochs.ico
ICON_BOCHS2 ICON build/win32/nsis/logo.ico
// Manifest for both 32-bit and 64-bit Windows
#ifndef VSIDE
1 24 build/win32/bochs.manifest
#endif
ASK_DLG DIALOG 30, 30, 200, 100
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU