cleanup and style changes, fixed gcc4.6 warning

This commit is contained in:
Stanislav Shwartsman 2011-05-10 20:04:20 +00:00
parent dd29e555cc
commit 39ccbf5a77
3 changed files with 15 additions and 71 deletions

View File

@ -974,17 +974,16 @@ void bx_keyb_c::controller_enQ(Bit8u data, unsigned source)
void bx_keyb_c::kbd_enQ_imm(Bit8u val)
{
int tail;
if (BX_KEY_THIS s.kbd_internal_buffer.num_elements >= BX_KBD_ELEMENTS) {
BX_PANIC(("internal keyboard buffer full (imm)"));
return;
}
/* enqueue scancode in multibyte internal keyboard buffer */
tail = (BX_KEY_THIS s.kbd_internal_buffer.head + BX_KEY_THIS s.kbd_internal_buffer.num_elements) %
/*
int tail = (BX_KEY_THIS s.kbd_internal_buffer.head + BX_KEY_THIS s.kbd_internal_buffer.num_elements) %
BX_KBD_ELEMENTS;
*/
BX_KEY_THIS s.kbd_controller.kbd_output_buffer = val;
BX_KEY_THIS s.kbd_controller.outb = 1;

View File

@ -251,10 +251,8 @@ void bx_svga_cirrus_c::init(void)
BX_CIRRUS_THIS bx_vga_c::init();
if (!strcmp(SIM->get_param_string(BXPN_VGA_EXTENSION)->getptr(), "cirrus")) {
// initialize SVGA stuffs.
BX_CIRRUS_THIS bx_vga_c::init_iohandlers(
svga_read_handler, svga_write_handler);
BX_CIRRUS_THIS bx_vga_c::init_systemtimer(
svga_timer_handler, svga_param_handler);
BX_CIRRUS_THIS bx_vga_c::init_iohandlers(svga_read_handler, svga_write_handler);
BX_CIRRUS_THIS bx_vga_c::init_systemtimer(svga_timer_handler, svga_param_handler);
#if BX_SUPPORT_PCI
BX_CIRRUS_THIS pci_enabled = DEV_is_pci_device("cirrus");
#endif

View File

@ -579,8 +579,7 @@ void bx_vga_c::determine_screen_dimensions(unsigned *piHeight, unsigned *piWidth
}
}
else if (BX_VGA_THIS s.graphics_ctrl.shift_reg == 2)
{
{
if (BX_VGA_THIS s.sequencer.chain_four)
{
*piWidth = h;
@ -638,13 +637,6 @@ Bit32u bx_vga_c::read(Bit32u address, unsigned io_len)
RETURN(ret16);
}
#ifdef __OS2__
if (bx_options.videomode == BX_VIDEO_DIRECT)
{
return _inp(address);
}
#endif
#if !defined(VGA_TRACE_FEATURE)
BX_DEBUG(("io read from 0x%04x", (unsigned) address));
#endif
@ -697,7 +689,6 @@ Bit32u bx_vga_c::read(Bit32u address, unsigned io_len)
RETURN(retval);
break;
case 0x03c0: /* */
if (BX_VGA_THIS s.attribute_ctrl.flip_flop == 0) {
//BX_INFO(("io read: 0x3c0: flip_flop = 0"));
@ -985,8 +976,7 @@ void bx_vga_c::write(Bit32u address, Bit32u value, unsigned io_len, bx_bool no_l
}
#else
if (io_len == 1) {
BX_DEBUG(("io write to 0x%04x = 0x%02x", (unsigned) address,
(unsigned) value));
BX_DEBUG(("io write to 0x%04x = 0x%02x", (unsigned) address, (unsigned) value));
}
#endif
@ -1001,14 +991,6 @@ void bx_vga_c::write(Bit32u address, Bit32u value, unsigned io_len, bx_bool no_l
return;
}
#ifdef __OS2__
if (bx_options.videomode == BX_VIDEO_DIRECT)
{
_outp(address, value);
return;
}
#endif
if ((address >= 0x03b0) && (address <= 0x03bf) &&
(BX_VGA_THIS s.misc_output.color_emulation))
return;
@ -2061,7 +2043,6 @@ void bx_vga_c::update(void)
BX_VGA_THIS s.vga_mem_updated = 0;
return;
}
else { // text mode
unsigned long start_address;
unsigned long cursor_address, cursor_x, cursor_y;
@ -2191,27 +2172,12 @@ Bit8u bx_vga_c::mem_read(bx_phy_address addr)
Bit8u *plane0, *plane1, *plane2, *plane3;
// if in a vbe enabled mode, read from the vbe_memory
if ((BX_VGA_THIS vbe.enabled) && (BX_VGA_THIS vbe.bpp != VBE_DISPI_BPP_4))
{
if ((BX_VGA_THIS vbe.enabled) && (BX_VGA_THIS vbe.bpp != VBE_DISPI_BPP_4)) {
return vbe_mem_read(addr);
} else if ((BX_VGA_THIS vbe.base_address != 0) && (addr >= BX_VGA_THIS vbe.base_address)) {
return 0xff;
}
#ifdef __OS2__
#if BX_PLUGINS
#error Fix the code for plugins
#endif
if (bx_options.videomode == BX_VIDEO_DIRECT)
{
char value;
value = devices->mem->video[addr-0xA0000];
return value;
}
#endif
switch (BX_VGA_THIS s.graphics_ctrl.memory_mapping) {
case 1: // 0xA0000 .. 0xAFFFF
if (addr > 0xAFFFF) return 0xff;
@ -2324,19 +2290,6 @@ void bx_vga_c::mem_write(bx_phy_address addr, Bit8u value)
return;
}
#ifdef __OS2__
#if BX_PLUGINS
#error Fix the code for plugins
#endif
if (bx_options.videomode == BX_VIDEO_DIRECT)
{
devices->mem->video[addr-0xA0000] = value;
return;
}
#endif
switch (BX_VGA_THIS s.graphics_ctrl.memory_mapping) {
case 1: // 0xA0000 .. 0xAFFFF
if ((addr < 0xA0000) || (addr > 0xAFFFF)) return;
@ -2840,7 +2793,7 @@ void bx_vga_c::redraw_area(unsigned x0, unsigned y0, unsigned width,
{
unsigned xti, yti, xt0, xt1, yt0, yt1, xmax, ymax;
if ((width == 0) || (height == 0)) {
if (width == 0 || height == 0) {
return;
}
@ -2896,13 +2849,11 @@ bx_vga_c::vbe_mem_read(bx_phy_address addr)
{
Bit32u offset;
if (addr >= BX_VGA_THIS vbe.base_address)
{
if (addr >= BX_VGA_THIS vbe.base_address) {
// LFB read
offset = (Bit32u)(addr - BX_VGA_THIS vbe.base_address);
}
else
{
else {
// banked mode read
offset = (Bit32u)(BX_VGA_THIS vbe.bank*65536 + addr - 0xA0000);
}
@ -2922,26 +2873,22 @@ bx_vga_c::vbe_mem_write(bx_phy_address addr, Bit8u value)
if (BX_VGA_THIS vbe.lfb_enabled)
{
if (addr >= BX_VGA_THIS vbe.base_address)
{
if (addr >= BX_VGA_THIS vbe.base_address) {
// LFB write
offset = (Bit32u)(addr - BX_VGA_THIS vbe.base_address);
}
else
{
else {
// banked mode write while in LFB mode -> ignore
return;
}
}
else
{
if (addr < BX_VGA_THIS vbe.base_address)
{
if (addr < BX_VGA_THIS vbe.base_address) {
// banked mode write
offset = (Bit32u)(BX_VGA_THIS vbe.bank*65536 + (addr - 0xA0000));
}
else
{
else {
// LFB write while in banked mode -> ignore
return;
}