fixed some MSVC warnings in the iodev code (vgacore, voodoo, vpc-img, vvfat)
TODO: fix MSVC warnings in the voodoo rasterizer code
This commit is contained in:
parent
c8012c3f1d
commit
9011005580
@ -1445,8 +1445,9 @@ void bx_vgacore_c::update(void)
|
||||
if (BX_VGA_THIS s.graphics_ctrl.graphics_alpha) {
|
||||
// Graphics mode
|
||||
Bit8u color;
|
||||
unsigned bit_no, r, c, x, y;
|
||||
unsigned long byte_offset, start_addr;
|
||||
Bit16u x, y, start_addr;
|
||||
unsigned bit_no, r, c;
|
||||
unsigned long byte_offset;
|
||||
unsigned xc, yc, xti, yti;
|
||||
|
||||
start_addr = (BX_VGA_THIS s.CRTC.reg[0x0c] << 8) | BX_VGA_THIS s.CRTC.reg[0x0d];
|
||||
@ -1466,7 +1467,7 @@ void bx_vgacore_c::update(void)
|
||||
switch (BX_VGA_THIS s.graphics_ctrl.shift_reg) {
|
||||
case 0: // interleaved shift
|
||||
Bit8u attribute, palette_reg_val, DAC_regno;
|
||||
unsigned long line_compare;
|
||||
Bit16u line_compare;
|
||||
Bit8u *plane[4];
|
||||
|
||||
if ((BX_VGA_THIS s.CRTC.reg[0x17] & 1) == 0) { // CGA 640x200x2
|
||||
|
@ -396,7 +396,7 @@ void bx_voodoo_c::mode_change_timer_handler(void *this_ptr)
|
||||
BX_INFO(("Voodoo output %dx%d@%uHz", v->fbi.width, v->fbi.height, vfreq));
|
||||
bx_gui->dimension_update(v->fbi.width+1, v->fbi.height, 0, 0, 16);
|
||||
update_timer_handler(NULL);
|
||||
bx_virt_timer.activate_timer(BX_VOODOO_THIS s.update_timer_id, BX_VOODOO_THIS s.vdraw.vtotal_usec, 1);
|
||||
bx_virt_timer.activate_timer(BX_VOODOO_THIS s.update_timer_id, (Bit32u)BX_VOODOO_THIS s.vdraw.vtotal_usec, 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1704,10 +1704,10 @@ void register_w(Bit32u offset, Bit32u data) {
|
||||
case sARGB:
|
||||
if (chips & 1)
|
||||
{
|
||||
v->reg[sAlpha].f = RGB_ALPHA(data);
|
||||
v->reg[sRed].f = RGB_RED(data);
|
||||
v->reg[sGreen].f = RGB_GREEN(data);
|
||||
v->reg[sBlue].f = RGB_BLUE(data);
|
||||
v->reg[sAlpha].f = (float)RGB_ALPHA(data);
|
||||
v->reg[sRed].f = (float)RGB_RED(data);
|
||||
v->reg[sGreen].f = (float)RGB_GREEN(data);
|
||||
v->reg[sBlue].f = (float)RGB_BLUE(data);
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -227,12 +227,12 @@ ssize_t vpc_image_t::read(void* buf, size_t count)
|
||||
if (offset == -1) {
|
||||
memset(buf, 0, 512);
|
||||
} else {
|
||||
ret = bx_read_image(fd, offset, cbuf, sectors * 512);
|
||||
ret = bx_read_image(fd, offset, cbuf, (int)sectors * 512);
|
||||
if (ret != 512) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
scount -= sectors;
|
||||
scount -= (Bit32u)sectors;
|
||||
cur_sector += sectors;
|
||||
cbuf += sectors * 512;
|
||||
}
|
||||
@ -266,12 +266,12 @@ ssize_t vpc_image_t::write(const void* buf, size_t count)
|
||||
return -1;
|
||||
}
|
||||
|
||||
ret = bx_write_image(fd, offset, cbuf, sectors * 512);
|
||||
ret = bx_write_image(fd, offset, cbuf, (int)sectors * 512);
|
||||
if (ret != sectors * 512) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
scount -= sectors;
|
||||
scount -= (Bit32u)sectors;
|
||||
cur_sector += sectors;
|
||||
cbuf += sectors * 512;
|
||||
}
|
||||
@ -336,7 +336,7 @@ Bit64s vpc_image_t::get_sector_offset(Bit64s sector_num, int write)
|
||||
Bit64u bitmap_offset, block_offset;
|
||||
Bit32u pagetable_index, pageentry_index;
|
||||
|
||||
pagetable_index = offset / block_size;
|
||||
pagetable_index = (Bit32u)(offset / block_size);
|
||||
pageentry_index = (offset % block_size) / 512;
|
||||
|
||||
if ((pagetable_index >= (Bit32u)max_table_entries) ||
|
||||
@ -400,11 +400,11 @@ Bit64s vpc_image_t::alloc_block(Bit64s sector_num)
|
||||
return -1;
|
||||
|
||||
// Write entry into in-memory BAT
|
||||
index = (sector_num * 512) / block_size;
|
||||
index = (Bit32u)((sector_num * 512) / block_size);
|
||||
if (pagetable[index] != 0xFFFFFFFF)
|
||||
return -1;
|
||||
|
||||
pagetable[index] = free_data_block_offset / 512;
|
||||
pagetable[index] = (Bit32u)(free_data_block_offset / 512);
|
||||
|
||||
// Initialize the block's bitmap
|
||||
Bit8u *bitmap = new Bit8u[bitmap_size];
|
||||
|
@ -947,7 +947,7 @@ int vvfat_image_t::init_directories(const char* dirname)
|
||||
if (!use_boot_file) {
|
||||
volume_sector_count = sector_count - offset_to_bootsector;
|
||||
tmpsc = volume_sector_count - reserved_sectors - root_entries / 16;
|
||||
cluster_count = (tmpsc * 0x200) / ((sectors_per_cluster * 0x200) + fat_type / 4);
|
||||
cluster_count = (Bit32u)((tmpsc * 0x200) / ((sectors_per_cluster * 0x200) + fat_type / 4));
|
||||
sectors_per_fat = ((cluster_count + 2) * fat_type / 8) / 0x200;
|
||||
sectors_per_fat += (((cluster_count + 2) * fat_type / 8) % 0x200) > 0;
|
||||
} else {
|
||||
@ -1069,7 +1069,7 @@ int vvfat_image_t::init_directories(const char* dirname)
|
||||
if (fat_type != 32) {
|
||||
bootsector->root_entries = htod16(root_entries);
|
||||
}
|
||||
bootsector->total_sectors16 = (volume_sector_count > 0xffff) ? 0:htod16(volume_sector_count);
|
||||
bootsector->total_sectors16 = (Bit16u)((volume_sector_count > 0xffff) ? 0:htod16(volume_sector_count));
|
||||
bootsector->media_type = ((fat_type != 12) ? 0xf8:0xf0);
|
||||
if (fat_type != 32) {
|
||||
bootsector->sectors_per_fat = htod16(sectors_per_fat);
|
||||
@ -1077,7 +1077,7 @@ int vvfat_image_t::init_directories(const char* dirname)
|
||||
bootsector->sectors_per_track = htod16(spt);
|
||||
bootsector->number_of_heads = htod16(heads);
|
||||
bootsector->hidden_sectors = htod32(offset_to_bootsector);
|
||||
bootsector->total_sectors = htod32((volume_sector_count > 0xffff) ? volume_sector_count:0);
|
||||
bootsector->total_sectors = (Bit32u)(htod32((volume_sector_count > 0xffff) ? volume_sector_count:0));
|
||||
if (fat_type != 32) {
|
||||
bootsector->u.fat16.drive_number = (fat_type == 12) ? 0:0x80; // assume this is hda (TODO)
|
||||
bootsector->u.fat16.signature = 0x29;
|
||||
|
Loading…
Reference in New Issue
Block a user