Commit Graph

99 Commits

Author SHA1 Message Date
Volker Ruppert
5c9c57a60a - don't enable vbe if already active
- value of flag vbe_get_capabilities fixed
2004-03-02 16:29:27 +00:00
Volker Ruppert
7f9edd09c8 - convert the display library option string (options separated with commas) to an
array of strings in vga init
- added sdl specific option "fullscreen" (startup in fullscreen mode)
2004-02-24 19:21:48 +00:00
Volker Ruppert
d5f337e1ef - prepared implementation of display library specific options
- fixed bug #890734 (commas in strings enclosed with double quotes)
2004-02-22 18:51:38 +00:00
Volker Ruppert
d748f22ed0 - new gui function get_capabilities() returns the maximum values for xres, yres
and bpp (done for the x display library)
- new switch VBE_DISPI_GETCAPS. The xres, yres and bpp registers return the gui
  capabilities if enabled.
- VBE_DISPI_ID3 defined
2004-02-22 13:03:02 +00:00
Volker Ruppert
897695270b - notify the display library if the bpp value changes (switching from VBE to VGA mode) 2004-01-24 20:50:45 +00:00
Volker Ruppert
2127a3925b - re-implemented old VBE interface for backward compatibility (USB must be disabled) 2003-12-31 10:33:27 +00:00
Volker Ruppert
c99cd71125 - don't print the VBE disable info if the status is unchanged 2003-11-06 18:48:01 +00:00
Volker Ruppert
597c2834ca - CRTC initialisation fixed (bug found with valgrind) 2003-11-02 16:34:10 +00:00
Volker Ruppert
6c398a7170 - the CRT controller works the same way in color and monochrome emulation modes
- use the same text mode update code for color and monochrome modes (vga mode 0x07
  now works with the Elpin BIOS)
2003-11-01 10:28:40 +00:00
Volker Ruppert
5616d81a67 - removed unnecessary comments 2003-10-31 15:49:29 +00:00
Daniel Gimpelevich
abc180a397 fix oversight and prepare for change in vgabios 2003-10-04 15:58:21 +00:00
Volker Ruppert
df2d388fa4 - io_len mask fixed and unnecessary io_len checks removed from the remaining
devices except pciusb
2003-07-31 19:51:42 +00:00
Volker Ruppert
4a4e90d96e - missing #if BX_SUPPORT_VBE added in i/o write handler 2003-07-27 17:50:43 +00:00
Volker Ruppert
1155b63564 - undocumented feature (???): blinking feature exists in graphics modes, too.
The colors 0..7 appear in high intensity and the colors 8..15 blink using
  low / high intensity. Blinking is not present in Bochs yet. For now, the 3rd
  bit of the attribute will be inverted.
- attribute controller mode control register: only a change of the internal
  palette size bit should force a redraw
- skip screen update if video is disabled
2003-07-19 21:44:37 +00:00
Volker Ruppert
687b8281cc - these attribute controller registers now force a redraw: mode control, color
plane enable and color select
- a screen update is necessary after updating the charmap
- lots of missing parentheses added (found after disabling VGA_TRACE_FEATURE)
- BX_DEBUG and BX_INFO messages improved
2003-07-18 18:31:50 +00:00
Volker Ruppert
592d7a7207 - a palette entry change must force a redraw in VBE mode, too
- update function: the 'for' loop now initializes and increments the variables
  xti and yti
- VBE: banked writes are now ignored in LFB mode, LFB writes are ignored in
  banked mode (based on SF patch #742782)
2003-07-17 07:55:56 +00:00
Volker Ruppert
a016eff261 - VBE LFB flag added
- VBE set bank now ignored in LFB mode
2003-07-16 17:56:25 +00:00
Volker Ruppert
4e63eca16c - vbe_mem_write(): offset calculation fixed
- calculation of the VBE virtual height for >8bpp fixed
- visible screen size must be recalculated after changing the virtual width
- modify standard VGA register when enabling a VBE mode (some test applications
  expect this behaviour)
- BX_INFO messages in the VBE code fixed
2003-07-15 13:05:20 +00:00
Volker Ruppert
5c11b64bdf - support for 15 bpp modes added in the vga code and the sdl display library
- sdl: in function graphics_tile_update() vga_bpp handled in a case structure
2003-07-09 20:15:38 +00:00
Volker Ruppert
cc4708c348 - a dimension update after enabling a VBE mode is only necessary for modes >4bpp
- don't clear the VBE memory if the new flag VBE_DISPI_NOCLEARMEM is set
- vbe_bpp_multiplier for the 4bpp mode set to 1 (usually unused, but this value is save)
2003-07-01 16:07:59 +00:00
Volker Ruppert
3845a23b55 - support for 16, 24 and 32 bit VBE modes implemented in the vga code and the
X11 display library (vga changes based on a patch from Chistopher Nelson)
- VBE_DISPI_ID2 0xB0C2 defined
2003-06-30 18:53:12 +00:00
Volker Ruppert
906b7f8d1c - update(): skip screen update if the vertical retrace is in progress
(using 72 Hz vertical frequency). The vertial retrace phase is often used for
  vga register or memory manipulations to reduce screen flickering.
- update(): check variable vga_mem_updated before everything else
2003-06-10 16:26:19 +00:00
Volker Ruppert
e75e7a929d - graphics update code rewritten based on patch.vga-mode2-speed-dohzono
(without localized variables)
- start address support for CGA modes added
- start address support for mode 13h completed
- clearing the text snapshot is not necessary after a start address change
  (set needs_update to 1 in graphics mode only)
2003-06-08 16:45:24 +00:00
Volker Ruppert
3a788ddcf4 - char width switch feature (8 / 9 pixels) prepared for all display libraries
and implemented in SDL
  * sequencer controller register 0x01 bit 0 controls the width of the characters.
    This value is used to calculate the screen width.
  * attribute controller register 0x10 bit 2 controls the appearance of graphics
    characters (ASCII 0xC0 - 0cDF). A change of this value forces a charmap update
    to rebuild the font bitmaps.
  * the SDL display library uses the new feature described above
  * the other display libraries recalculate the screen width, since they are using
    a fixed font width of 8 for now.
- VGA: attribute controller register 0x10 bit 2 (enable_line_graphics) does not
  switch the palatte in CGA mode
2003-05-11 15:07:54 +00:00
Volker Ruppert
46d5548439 - modify the horizontal pel panning value of the tm_info structure if a char
width of 9 is enabled. For now, a panning value of 8 must be decremented.
2003-05-10 12:00:58 +00:00
Volker Ruppert
36959329c5 - more accurate emulation of the horizontal and vertical retrace
ATTENTION: the Elpin VGA BIOS uses a delay of 280 vertical retraces after
  displaying the copyright text
- changes to the horizontal or vertical pel panning registers force a redraw of
  the screen
- screen update problems in text mode fixed
- sort order of the CRT register write cases changed
2003-05-09 15:32:28 +00:00
Volker Ruppert
5ab9786871 - function text_update() prepared for new features. New structure
'bx_vga_tminfo_t' replaces variable 'cursor_state'.
2003-05-07 19:15:47 +00:00
Volker Ruppert
b6c957a3b2 - behaviour of CRTC reg 0x18 (line compare) fixed
- fixed calculation of the byte offset for standard VGA modes if line compare
  is active
- force a resize of the screen after a change of the display mode (text/graphics)
- mem_write(): skip the rotation of the cpu byte if 'data_rotate' is 0
2003-05-06 17:10:13 +00:00
Volker Ruppert
b937905a97 - dotclock/2 switch implemented - stored in new variable 'x_dotclockdiv2'.
If set, the screen size will be horizontally doubled in CGA and standard
  VGA modes.
- doublescan feature for CGA mode 320x200x4 added
- removed trailing spaces in VBE update code
2003-05-03 16:09:39 +00:00
Volker Ruppert
3411535a8b - 'split screen' feature for standard VGA 16-color modes implemented
* new variables 'line_compare' and 'vertical_display_end' depend on CRT
    register values
  * implemented 'split screen' in functions update() and mem_write()
- mem_write(): CGA section: unnecessary variable 'isEven' removed
2003-05-02 07:32:06 +00:00
Volker Ruppert
8b22768895 - applied some speed optimizations in mem_write() from patch.vga-mode2-speed-dohzono 2003-05-01 12:07:27 +00:00
Volker Ruppert
d02c729791 - removed variable 'scan_bits' and added new variable 'line_offset'. It specifies
the address offset between two lines on the screen in all VGA modes.
  It depends on the CRTC offset register value and the address mode (byte, word,
  dword)
- moved screen update code to the end of the write handler. If a register change
  should force a redraw of the screen, the variable 'needs_update' must be set
  to 1.
- changes to the attribute controller palette index register now force a redraw
  of the screen
- modeX: calculation of the tile numbers fixed
2003-04-28 18:15:31 +00:00
Volker Ruppert
b1324da2e1 - function mem_read() rewritten
* check memory mapping before everything else
  * read mode 1 optimized using a part of patch.vga-mode2-speed-dohzono
- function mem_write(): check memory mapping before everything else
- writes to the CRT registers are handled only if the new value differs
- a CRT start address change forces a redraw of the screen
2003-04-27 09:13:47 +00:00
Volker Ruppert
e79aa992af - emulated CGA graphics mode 160x100x16 colors implemented using the text mode
with 100 rows and a char height of 4
- raster operations AND, OR and XOR in write mode 2 implemented (part of patch #707931)
- use the vga_tile_updated array in modeX like other modes do
- small optimizations in the graphics update code
2003-04-26 16:43:22 +00:00
Volker Ruppert
daee2aac9b - improvements to mode 13h emulation (start address, scan bits, doublescan,
double width)
- cleanup in modeX emulation similar to mode 13h
- consider start address in function mem_write for VGA modes
- register 0x03c8 is readable, too
2003-04-25 18:51:55 +00:00
Volker Ruppert
548dd3a13c - doublescan feature implemented (used by CGA 640x200x2, VGA 640x200 and modeX)
- clear tile array when switching to graphics mode, clear text snapshot when
  switching to text mode, do the same when changing the palette or disable video
- simplified the function determine_screen_dimensions()
- fixed the code for the CGA mode 640x200x2 in update() and mem_write()
2003-04-21 19:03:46 +00:00
Volker Ruppert
a6c6d50951 - CGA-compatible 640x200 2 color graphics mode (mode 6) implemented
- check of graphics_ctrl.shift_reg and BX_PANIC in vga mem_read() removed
2003-04-20 17:04:45 +00:00
Christophe Bothamy
50efc3b8c7 - apply Conn Clark's patch.perf-regparm-cclark :
- it works only on x86 with gcc2.95+
  - uses the GCC function atribute "regparm(n)" to declare that certain
    functions use the register calling convention
  - performance improvement is about 6%
2003-03-02 23:59:12 +00:00
Volker Ruppert
e492acd792 - VBE 4 bpp modes are using the default vga read/write/update code (for VESA
mode 0x102 = SVGA mode 0x6a)
- function redraw_area() now uses the old screen dimensions for redrawing
2003-02-09 08:25:22 +00:00
Volker Ruppert
047699cc6a - VBE: update the variables for the old screen dimensions after redrawing 2003-01-21 17:39:47 +00:00
Volker Ruppert
61f1fcd679 - fixed the behaviour of the vga emulation after changing a palette entry
* removed the unnecessary screen resize code (caused lots of resizes when
    booting the DLX linux demo)
  * force a redraw of the screen in text mode
2003-01-11 21:41:20 +00:00
Volker Ruppert
2c93eb7600 - port 0x03c7 returns the DAC state (read = 11b, write = 00b)
- pel data register returns 0x3f if the DAC is not in read mode
2003-01-11 11:18:04 +00:00
Volker Ruppert
5e09a0a3f8 - in modeX use the screen width in pixels stored in the CRT controller.
The pixels are horizontally doubled now.
2003-01-01 21:21:29 +00:00
Volker Ruppert
1cfe6c248a - function determine_screen_dimensions() prepared for SVGA mode 0x6A (800x600x4) 2002-12-31 16:58:02 +00:00
Volker Ruppert
51c9c6c83a - bugfix for the textmode colors: the color value is not an index to the DAC
palette - it's an index to the attribute controller palette index.
  The new function get_actl_palette_idx() now returns the real DAC index.
  The guis sdl, wx and x11 are using the new function. TODO: Fix this bug in
  all other guis.
2002-12-28 11:49:17 +00:00
Christophe Bothamy
4be6048bb4 - add comment about multi-bytes IO accesses 2002-12-24 08:20:13 +00:00
Volker Ruppert
d61b85202a - bugfixes in function redraw_area():
* missing VBE support added, use xmax / ymax variables instead of the
    values 640 / 480
  * use the constant Y_TILESIZE when checking the y position
  * variable vga_mem_updated was always set twice
2002-12-10 20:09:25 +00:00
Bryce Denney
cb1d6121b2 - this should fix bug #635223: VGA tiles array access out of bounds.
For years we have been writing beyond the end of this array in the VGA code:
    bx_bool  vga_tile_updated[BX_NUM_X_TILES][BX_NUM_Y_TILES];
  and doing who-know-how-much damage to other memory structures in the process.
  I changed every reference to vga_tile_updated[][] into calls to two macros
  GET_TILE_UPDATED and SET_TILE_UPDATED, and defined the macros to check
  the bounds of the array before referencing it.  At first I used an
  assert, then a panic, then an error, and now I'm not printing any message
  at all because there were thousands and thousands of messages during
  a boot of win95 when it's updating the win95 logo screen.
- I couldn't resist cleaning up a few confusing-looking things like
  "if (condition) { // }".  There are no functional changes except for
  bounds checking on the vga_tile_updated array.
2002-11-16 15:43:13 +00:00
Christophe Bothamy
92f04bdd0b - fix "if ((addr < 0xB0000) | (addr > 0xB7FFF)) return;" bug, thanks to Kazuo Fox Dohzono 2002-11-07 22:02:13 +00:00
Bryce Denney
cec9135e9f - Apply patch.replace-Boolean rev 1.3. Every "Boolean" is now changed to a
"bx_bool" which is always defined as Bit32u on all platforms.  In Carbon
  specific code, Boolean is still used because the Carbon header files
  define it to unsigned char.
- this fixes bug [ 623152 ] MacOSX: Triple Exception Booting win95.
  The bug was that some code in Bochs depends on Boolean to be a
  32 bit value.  (This should be fixed, but I don't know all the places
  where it needs to be fixed yet.)  Because Carbon defined Boolean as
  an unsigned char, Bochs just followed along and used the unsigned char
  definition to avoid compile problems.  This exposed the dependency
  on 32 bit Boolean on MacOS X only and led to major simulation problems,
  that could only be reproduced and debugged on that platform.
- On the mailing list we debated whether to make all Booleans into "bool" or
  our own type.  I chose bx_bool for several reasons.
  1. Unlike C++'s bool, we can guarantee that bx_bool is the same size on all
     platforms, which makes it much less likely to have more platform-specific
     simulation differences in the future.  (I spent hours on a borrowed
     MacOSX machine chasing bug 618388 before discovering that different sized
     Booleans were the problem, and I don't want to repeat that.)
  2. We still have at least one dependency on 32 bit Booleans which must be
     fixed some time, but I don't want to risk introducing new bugs into the
     simulation just before the 2.0 release.

Modified Files:
    bochs.h config.h.in gdbstub.cc logio.cc main.cc pc_system.cc
    pc_system.h plugin.cc plugin.h bios/rombios.c cpu/apic.cc
    cpu/arith16.cc cpu/arith32.cc cpu/arith64.cc cpu/arith8.cc
    cpu/cpu.cc cpu/cpu.h cpu/ctrl_xfer16.cc cpu/ctrl_xfer32.cc
    cpu/ctrl_xfer64.cc cpu/data_xfer16.cc cpu/data_xfer32.cc
    cpu/data_xfer64.cc cpu/debugstuff.cc cpu/exception.cc
    cpu/fetchdecode.cc cpu/flag_ctrl_pro.cc cpu/init.cc
    cpu/io_pro.cc cpu/lazy_flags.cc cpu/lazy_flags.h cpu/mult16.cc
    cpu/mult32.cc cpu/mult64.cc cpu/mult8.cc cpu/paging.cc
    cpu/proc_ctrl.cc cpu/segment_ctrl_pro.cc cpu/stack_pro.cc
    cpu/tasking.cc debug/dbg_main.cc debug/debug.h debug/sim2.cc
    disasm/dis_decode.cc disasm/disasm.h doc/docbook/Makefile
    docs-html/cosimulation.html fpu/wmFPUemu_glue.cc
    gui/amigaos.cc gui/beos.cc gui/carbon.cc gui/gui.cc gui/gui.h
    gui/keymap.cc gui/keymap.h gui/macintosh.cc gui/nogui.cc
    gui/rfb.cc gui/sdl.cc gui/siminterface.cc gui/siminterface.h
    gui/term.cc gui/win32.cc gui/wx.cc gui/wxmain.cc gui/wxmain.h
    gui/x.cc instrument/example0/instrument.cc
    instrument/example0/instrument.h
    instrument/example1/instrument.cc
    instrument/example1/instrument.h
    instrument/stubs/instrument.cc instrument/stubs/instrument.h
    iodev/cdrom.cc iodev/cdrom.h iodev/cdrom_osx.cc iodev/cmos.cc
    iodev/devices.cc iodev/dma.cc iodev/dma.h iodev/eth_arpback.cc
    iodev/eth_packetmaker.cc iodev/eth_packetmaker.h
    iodev/floppy.cc iodev/floppy.h iodev/guest2host.h
    iodev/harddrv.cc iodev/harddrv.h iodev/ioapic.cc
    iodev/ioapic.h iodev/iodebug.cc iodev/iodev.h
    iodev/keyboard.cc iodev/keyboard.h iodev/ne2k.h
    iodev/parallel.h iodev/pci.cc iodev/pci.h iodev/pic.h
    iodev/pit.cc iodev/pit.h iodev/pit_wrap.cc iodev/pit_wrap.h
    iodev/sb16.cc iodev/sb16.h iodev/serial.cc iodev/serial.h
    iodev/vga.cc iodev/vga.h memory/memory.h memory/misc_mem.cc
2002-10-25 11:44:41 +00:00