Commit Graph

89 Commits

Author SHA1 Message Date
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
Bryce Denney
5e520261db Add plugin support to Bochs by merging all the changes from the
BRANCH_PLUGINS branch!

Authors:
  Bryce Denney
  Christophe Bothamy
  Kevin Lawton (we grabbed a lot of plugin code from plex86)
Testing help from:
  Volker Ruppert
  Don Becker (Psyon)
  Jeremy Parsons (Br'fin)

The change log is too long to paste in here.  To read the change log, do
  cvs log patches/patch.final-from-BRANCH_PLUGINS.gz

All the changes and a detailed description are contained in a patch
called patch.final-from-BRANCH_PLUGINS.gz.  To look at the complete
patch, do
  cvs upd -r1.1 patches/patch.final-from-BRANCH_PLUGINS.gz

Then you will have a local copy of the patch, which you can gunzip and
play with however you want.

Modified Files:
    .bochsrc Makefile.in aclocal.m4 bochs.h config.h.in configure
    configure.in gdbstub.cc logio.cc main.cc pc_system.cc
    pc_system.h state_file.h bios/Makefile.in bios/rombios.c
    cpu/Makefile.in cpu/access.cc cpu/apic.cc cpu/arith16.cc
    cpu/arith32.cc cpu/arith8.cc cpu/cpu.cc cpu/cpu.h
    cpu/ctrl_xfer32.cc cpu/exception.cc cpu/fetchdecode.cc
    cpu/fetchdecode64.cc cpu/flag_ctrl.cc cpu/flag_ctrl_pro.cc
    cpu/init.cc cpu/io.cc cpu/logical16.cc cpu/logical32.cc
    cpu/logical8.cc cpu/paging.cc cpu/proc_ctrl.cc
    cpu/protect_ctrl.cc cpu/segment_ctrl_pro.cc cpu/shift16.cc
    cpu/shift32.cc cpu/stack64.cc cpu/string.cc cpu/tasking.cc
    debug/Makefile.in debug/dbg_main.cc disasm/Makefile.in
    doc/docbook/user/user.dbk dynamic/Makefile.in fpu/Makefile.in
    gui/Makefile.in gui/amigaos.cc gui/beos.cc gui/carbon.cc
    gui/control.cc gui/control.h 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/sdlkeys.h gui/siminterface.cc
    gui/siminterface.h gui/term.cc gui/win32.cc gui/wx.cc
    gui/wxdialog.cc gui/wxdialog.h gui/wxmain.cc gui/wxmain.h
    gui/x.cc gui/keymaps/sdl-pc-de.map gui/keymaps/sdl-pc-us.map
    gui/keymaps/x11-pc-de.map instrument/example0/instrument.h
    instrument/example1/instrument.h
    instrument/stubs/instrument.cc instrument/stubs/instrument.h
    iodev/Makefile.in iodev/biosdev.cc iodev/biosdev.h
    iodev/cdrom.cc iodev/cmos.cc iodev/cmos.h iodev/devices.cc
    iodev/dma.cc iodev/dma.h iodev/eth_fbsd.cc iodev/eth_linux.cc
    iodev/eth_null.cc iodev/eth_tap.cc iodev/floppy.cc
    iodev/floppy.h iodev/guest2host.cc iodev/guest2host.h
    iodev/harddrv.cc iodev/harddrv.h iodev/iodebug.cc
    iodev/iodebug.h iodev/iodev.h iodev/keyboard.cc
    iodev/keyboard.h iodev/ne2k.cc iodev/ne2k.h iodev/parallel.cc
    iodev/parallel.h iodev/pci.cc iodev/pci.h iodev/pci2isa.cc
    iodev/pci2isa.h iodev/pic.cc iodev/pic.h iodev/pit.cc
    iodev/pit.h iodev/pit_wrap.cc iodev/pit_wrap.h iodev/sb16.cc
    iodev/sb16.h iodev/scancodes.cc iodev/scancodes.h
    iodev/serial.cc iodev/serial.h iodev/slowdown_timer.cc
    iodev/slowdown_timer.h iodev/unmapped.cc iodev/unmapped.h
    iodev/vga.cc iodev/vga.h memory/Makefile.in memory/memory.cc
    memory/memory.h memory/misc_mem.cc misc/bximage.c
    misc/niclist.c
Added Files:
    README-plugins extplugin.h ltdl.c ltdl.h ltdlconf.h.in
    ltmain.sh plugin.cc plugin.h
2002-10-24 21:07:56 +00:00
Volker Ruppert
f88e594dc2 - do a dimension update in text mode when the maximum scan line register has
changed. This changes the font height of the gui.
2002-10-20 13:18:21 +00:00
Volker Ruppert
0a89fc3352 - sequencer reset bits renamed to 'reset1' and 'reset2'
- default value of the sequencer reset bits is 1 (no reset)
- sequencer reset flag 1 resets the charmap select register when cleared
- skip the screen update when the sequencer is in reset mode (h/v sync and
  video ram refresh are disabled in that case)
- don't clear the memory update flag before the update is done
- skip the text screen update when the character height is set to 1 (MSL = 0)
- sequencer debug messages updated
2002-10-13 08:14:31 +00:00
Volker Ruppert
75ba36cb15 - fixed some warnings at BX_INFO, BX_PANIC, BX_ERROR and BX_DEBUG 2002-10-06 19:38:54 +00:00
Bryce Denney
c818baa0c9 - modified every I/O device so that it will not re-register its timers
if init() is called a second time.  This allows me to restart a
  simulation (wxwindows interface only) without restarting the whole
  application.
- modified: iodev/*.cc
2002-10-06 19:04:47 +00:00
Volker Ruppert
4bdd5acaeb - calculation of the number vertical tiles added for all graphics modes.
- screen height of the graphics mode 640x350 fixed
2002-10-05 08:04:28 +00:00
Kevin Lawton
83c9d266d0 Added a field on register_timer() so that a name identifying the
requesting source can be registered as well.  Otherwise, there
  is no way to know which source modules are requesting
  suspect frequencies which are too high.
2002-10-02 05:16:01 +00:00
Jeroen Janssen
53723a8569 hopefully solved bugreport [ 612741 ] VBE mem conflicts w/ local APIC address 2002-09-22 11:31:48 +00:00
Volker Ruppert
721f89b77b - forward changes of the active charmap to the gui with the new function
set_text_charbyte()
- vga: store the address of the active charmap in the new variable
  charmap_address
- vga: text mode hack removed. The write modes, operations and masks must be
  used in text mode too.
- sdl: clear_screen() is not necessary when the charmap has changed
- win32: update only the changed font bitmaps before drawing the text
2002-09-19 18:59:50 +00:00
Christophe Bothamy
8a9992998e - committed vga patch for yamit. I'm not really sure how the standard vga card
behaves in text mode memory mappings 0 & 1.
2002-09-13 00:11:49 +00:00