2012-09-15 01:50:50 +04:00
|
|
|
/////////////////////////////////////////////////////////////////////////
|
|
|
|
// $Id$
|
|
|
|
/////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
2018-01-05 20:43:51 +03:00
|
|
|
// Copyright (C) 2012-2018 The Bochs Project
|
2012-09-15 01:50:50 +04:00
|
|
|
//
|
|
|
|
// This library is free software; you can redistribute it and/or
|
|
|
|
// modify it under the terms of the GNU Lesser General Public
|
|
|
|
// License as published by the Free Software Foundation; either
|
|
|
|
// version 2 of the License, or (at your option) any later version.
|
|
|
|
//
|
|
|
|
// This library is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
// Lesser General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU Lesser General Public
|
|
|
|
// License along with this library; if not, write to the Free Software
|
|
|
|
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
|
|
|
|
#ifndef BX_IODEV_VOODOO_H
|
|
|
|
#define BX_IODEV_VOODOO_H
|
|
|
|
|
|
|
|
#define BX_VOODOO_THIS theVoodooDevice->
|
|
|
|
#define BX_VOODOO_THIS_PTR theVoodooDevice
|
2017-10-12 22:34:58 +03:00
|
|
|
#define BX_VVGA_THIS theVoodooVga->
|
Started implementing the Voodoo Banshee display adapter based on the existing
"Voodoo VGA" framework. Most of the work is still to do.
- Added Banshee specific PCI write handler and related stuff. The device is
initialzed properly by the Bochs BIOS (mem, lfb, rom and i/o).
- With Banshee specific VGA BIOS it passes the init stage and boots properly
to DOS. Parts of the init code coming from file "voodoo.h.txt" (part of the
original patch).
- Standard VGA modes are all usable (using the Bochs VGA core).
- VBE graphics modes with 8, 16, 24 and 32 BPP are usable (VBE drawing code is
mostly copy&paste from the Bochs VBE code. DAC 6/8 bit switch is present.
- TODO list:
- Voodoo Banshee memory layout (registers, 2D, 3D, LFB, textures)
- 2D graphics engine must be written from scratch
- interaction between new device and existing 3D core
- non-VGA mode (Voodoo model "banshee" without VGA extension "voodoo")
- save/restore support, move Banshee stuff to separate file, ...
2017-10-21 15:46:17 +03:00
|
|
|
#define BX_VVGA_THIS_PTR theVoodooVga
|
2012-09-15 01:50:50 +04:00
|
|
|
|
|
|
|
typedef struct {
|
2017-04-28 21:45:45 +03:00
|
|
|
Bit8u model;
|
2012-09-15 01:50:50 +04:00
|
|
|
struct {
|
|
|
|
Bit32u width;
|
|
|
|
Bit32u height;
|
2014-01-15 21:29:28 +04:00
|
|
|
Bit64u htotal_usec;
|
2012-09-15 01:50:50 +04:00
|
|
|
Bit64u vtotal_usec;
|
2017-05-01 12:11:12 +03:00
|
|
|
Bit64u hsync_usec;
|
2012-09-15 01:50:50 +04:00
|
|
|
Bit64u vsync_usec;
|
2017-05-01 12:11:12 +03:00
|
|
|
double htime_to_pixel;
|
2012-09-15 01:50:50 +04:00
|
|
|
Bit64u frame_start;
|
|
|
|
bx_bool clock_enabled;
|
|
|
|
bx_bool output_on;
|
|
|
|
bx_bool override_on;
|
|
|
|
bx_bool screen_update_pending;
|
2017-05-01 14:54:12 +03:00
|
|
|
bx_bool gui_update_pending;
|
2012-09-15 01:50:50 +04:00
|
|
|
} vdraw;
|
|
|
|
int mode_change_timer_id;
|
2017-05-01 14:54:12 +03:00
|
|
|
int vertical_timer_id;
|
2012-09-15 01:50:50 +04:00
|
|
|
Bit8u devfunc;
|
2017-11-09 20:58:53 +03:00
|
|
|
Bit16u max_xres;
|
|
|
|
Bit16u max_yres;
|
|
|
|
Bit16u num_x_tiles;
|
|
|
|
Bit16u num_y_tiles;
|
|
|
|
bx_bool *vga_tile_updated;
|
2012-09-15 01:50:50 +04:00
|
|
|
} bx_voodoo_t;
|
|
|
|
|
|
|
|
|
2017-12-28 12:54:22 +03:00
|
|
|
class bx_voodoo_base_c : public bx_nonvga_device_c {
|
2012-09-15 01:50:50 +04:00
|
|
|
public:
|
2017-12-28 12:54:22 +03:00
|
|
|
bx_voodoo_base_c();
|
|
|
|
virtual ~bx_voodoo_base_c();
|
2012-09-15 01:50:50 +04:00
|
|
|
virtual void init(void);
|
2017-12-28 12:54:22 +03:00
|
|
|
virtual void init_model(void) {}
|
|
|
|
virtual void register_state(void) {}
|
2012-09-15 01:50:50 +04:00
|
|
|
|
2012-10-28 12:23:39 +04:00
|
|
|
virtual void refresh_display(void *this_ptr, bx_bool redraw);
|
2012-10-25 19:53:04 +04:00
|
|
|
virtual void redraw_area(unsigned x0, unsigned y0,
|
|
|
|
unsigned width, unsigned height);
|
2017-05-01 14:54:12 +03:00
|
|
|
virtual void update(void);
|
2017-12-28 12:54:22 +03:00
|
|
|
virtual bx_bool update_timing(void) {return 0;}
|
|
|
|
virtual Bit32u get_retrace(bx_bool hv) {return 0;}
|
2012-10-25 19:53:04 +04:00
|
|
|
|
2017-12-28 12:54:22 +03:00
|
|
|
virtual void output_enable(bx_bool enabled) {}
|
|
|
|
virtual void update_screen_start(void) {}
|
2012-09-15 01:50:50 +04:00
|
|
|
|
2017-12-29 14:18:45 +03:00
|
|
|
virtual void reg_write(Bit32u reg, Bit32u value);
|
2017-12-28 12:54:22 +03:00
|
|
|
virtual void blt_reg_write(Bit8u reg, Bit32u value) {}
|
|
|
|
virtual void mem_write_linear(Bit32u offset, Bit32u value, unsigned len) {}
|
|
|
|
virtual void draw_hwcursor(unsigned xc, unsigned yc, bx_svga_tileinfo_t *info) {}
|
|
|
|
virtual void set_tile_updated(unsigned xti, unsigned yti, bx_bool flag) {}
|
2012-09-15 01:50:50 +04:00
|
|
|
|
2017-12-28 12:54:22 +03:00
|
|
|
static void vertical_timer_handler(void *);
|
2017-11-09 20:58:53 +03:00
|
|
|
|
2017-12-28 12:54:22 +03:00
|
|
|
protected:
|
|
|
|
bx_voodoo_t s;
|
2017-10-30 00:25:37 +03:00
|
|
|
|
2017-12-28 12:54:22 +03:00
|
|
|
void register_state(bx_list_c *parent);
|
|
|
|
void set_irq_level(bx_bool level);
|
|
|
|
void vertical_timer(void);
|
|
|
|
};
|
2017-12-15 23:54:09 +03:00
|
|
|
|
2017-12-28 12:54:22 +03:00
|
|
|
class bx_voodoo_1_2_c : public bx_voodoo_base_c {
|
|
|
|
public:
|
|
|
|
bx_voodoo_1_2_c();
|
|
|
|
virtual ~bx_voodoo_1_2_c() {}
|
|
|
|
virtual void init_model(void);
|
|
|
|
virtual void reset(unsigned type);
|
|
|
|
virtual void register_state(void);
|
|
|
|
virtual void after_restore_state(void);
|
|
|
|
|
|
|
|
virtual bx_bool update_timing(void);
|
|
|
|
virtual Bit32u get_retrace(bx_bool hv);
|
2012-09-15 01:50:50 +04:00
|
|
|
|
2017-12-28 12:54:22 +03:00
|
|
|
virtual void output_enable(bx_bool enabled);
|
|
|
|
virtual void update_screen_start(void);
|
|
|
|
|
|
|
|
virtual void pci_write_handler(Bit8u address, Bit32u value, unsigned io_len);
|
2012-09-15 01:50:50 +04:00
|
|
|
|
2017-12-28 12:54:22 +03:00
|
|
|
private:
|
2012-09-15 01:50:50 +04:00
|
|
|
static bx_bool mem_read_handler(bx_phy_address addr, unsigned len, void *data, void *param);
|
|
|
|
static bx_bool mem_write_handler(bx_phy_address addr, unsigned len, void *data, void *param);
|
|
|
|
|
|
|
|
static void mode_change_timer_handler(void *);
|
2017-12-28 12:54:22 +03:00
|
|
|
void mode_change_timer(void);
|
|
|
|
};
|
|
|
|
|
|
|
|
class bx_banshee_c : public bx_voodoo_base_c {
|
|
|
|
public:
|
|
|
|
bx_banshee_c();
|
|
|
|
virtual ~bx_banshee_c() {}
|
|
|
|
virtual void init_model(void);
|
|
|
|
virtual void reset(unsigned type);
|
|
|
|
virtual void register_state(void);
|
|
|
|
virtual void after_restore_state(void);
|
|
|
|
|
|
|
|
virtual bx_bool update_timing(void);
|
|
|
|
virtual Bit32u get_retrace(bx_bool hv);
|
|
|
|
|
2017-12-29 14:18:45 +03:00
|
|
|
virtual void reg_write(Bit32u reg, Bit32u value);
|
2017-12-28 12:54:22 +03:00
|
|
|
virtual void blt_reg_write(Bit8u reg, Bit32u value);
|
|
|
|
virtual void mem_write_linear(Bit32u offset, Bit32u value, unsigned len);
|
|
|
|
virtual void draw_hwcursor(unsigned xc, unsigned yc, bx_svga_tileinfo_t *info);
|
|
|
|
virtual void set_tile_updated(unsigned xti, unsigned yti, bx_bool flag);
|
|
|
|
|
|
|
|
virtual void pci_write_handler(Bit8u address, Bit32u value, unsigned io_len);
|
|
|
|
|
|
|
|
Bit32u blt_reg_read(Bit8u reg);
|
|
|
|
|
|
|
|
private:
|
|
|
|
static bx_bool mem_read_handler(bx_phy_address addr, unsigned len, void *data, void *param);
|
|
|
|
static bx_bool mem_write_handler(bx_phy_address addr, unsigned len, void *data, void *param);
|
Started implementing the Voodoo Banshee display adapter based on the existing
"Voodoo VGA" framework. Most of the work is still to do.
- Added Banshee specific PCI write handler and related stuff. The device is
initialzed properly by the Bochs BIOS (mem, lfb, rom and i/o).
- With Banshee specific VGA BIOS it passes the init stage and boots properly
to DOS. Parts of the init code coming from file "voodoo.h.txt" (part of the
original patch).
- Standard VGA modes are all usable (using the Bochs VGA core).
- VBE graphics modes with 8, 16, 24 and 32 BPP are usable (VBE drawing code is
mostly copy&paste from the Bochs VBE code. DAC 6/8 bit switch is present.
- TODO list:
- Voodoo Banshee memory layout (registers, 2D, 3D, LFB, textures)
- 2D graphics engine must be written from scratch
- interaction between new device and existing 3D core
- non-VGA mode (Voodoo model "banshee" without VGA extension "voodoo")
- save/restore support, move Banshee stuff to separate file, ...
2017-10-21 15:46:17 +03:00
|
|
|
|
2017-12-28 12:54:22 +03:00
|
|
|
void mem_read(bx_phy_address addr, unsigned len, void *data);
|
|
|
|
void mem_write(bx_phy_address addr, unsigned len, void *data);
|
Started implementing the Voodoo Banshee display adapter based on the existing
"Voodoo VGA" framework. Most of the work is still to do.
- Added Banshee specific PCI write handler and related stuff. The device is
initialzed properly by the Bochs BIOS (mem, lfb, rom and i/o).
- With Banshee specific VGA BIOS it passes the init stage and boots properly
to DOS. Parts of the init code coming from file "voodoo.h.txt" (part of the
original patch).
- Standard VGA modes are all usable (using the Bochs VGA core).
- VBE graphics modes with 8, 16, 24 and 32 BPP are usable (VBE drawing code is
mostly copy&paste from the Bochs VBE code. DAC 6/8 bit switch is present.
- TODO list:
- Voodoo Banshee memory layout (registers, 2D, 3D, LFB, textures)
- 2D graphics engine must be written from scratch
- interaction between new device and existing 3D core
- non-VGA mode (Voodoo model "banshee" without VGA extension "voodoo")
- save/restore support, move Banshee stuff to separate file, ...
2017-10-21 15:46:17 +03:00
|
|
|
|
2017-12-28 12:54:22 +03:00
|
|
|
static Bit32u read_handler(void *this_ptr, Bit32u address, unsigned io_len);
|
|
|
|
static void write_handler(void *this_ptr, Bit32u address, Bit32u value, unsigned io_len);
|
Started implementing the Voodoo Banshee display adapter based on the existing
"Voodoo VGA" framework. Most of the work is still to do.
- Added Banshee specific PCI write handler and related stuff. The device is
initialzed properly by the Bochs BIOS (mem, lfb, rom and i/o).
- With Banshee specific VGA BIOS it passes the init stage and boots properly
to DOS. Parts of the init code coming from file "voodoo.h.txt" (part of the
original patch).
- Standard VGA modes are all usable (using the Bochs VGA core).
- VBE graphics modes with 8, 16, 24 and 32 BPP are usable (VBE drawing code is
mostly copy&paste from the Bochs VBE code. DAC 6/8 bit switch is present.
- TODO list:
- Voodoo Banshee memory layout (registers, 2D, 3D, LFB, textures)
- 2D graphics engine must be written from scratch
- interaction between new device and existing 3D core
- non-VGA mode (Voodoo model "banshee" without VGA extension "voodoo")
- save/restore support, move Banshee stuff to separate file, ...
2017-10-21 15:46:17 +03:00
|
|
|
|
2017-12-28 12:54:22 +03:00
|
|
|
Bit32u read(Bit32u address, unsigned io_len);
|
|
|
|
void write(Bit32u address, Bit32u value, unsigned io_len);
|
2017-10-30 00:25:37 +03:00
|
|
|
|
2017-12-28 12:54:22 +03:00
|
|
|
Bit32u agp_reg_read(Bit8u reg);
|
|
|
|
void agp_reg_write(Bit8u reg, Bit32u value);
|
2017-11-24 23:18:52 +03:00
|
|
|
|
2017-12-28 12:54:22 +03:00
|
|
|
void blt_launch_area_setup(void);
|
|
|
|
void blt_launch_area_write(Bit32u value);
|
|
|
|
void blt_execute(void);
|
|
|
|
void blt_complete(void);
|
|
|
|
bx_bool blt_apply_clipwindow(int *x0, int *y0, int *x1, int *y1, int *w, int *h);
|
2017-11-24 23:18:52 +03:00
|
|
|
|
2017-12-28 12:54:22 +03:00
|
|
|
void blt_rectangle_fill(void);
|
|
|
|
void blt_pattern_fill_mono(void);
|
|
|
|
void blt_pattern_fill_color(void);
|
|
|
|
void blt_screen_to_screen(void);
|
|
|
|
void blt_screen_to_screen_pattern(void);
|
2018-01-06 20:27:55 +03:00
|
|
|
void blt_screen_to_screen_stretch(void);
|
2017-12-28 12:54:22 +03:00
|
|
|
void blt_host_to_screen(void);
|
|
|
|
void blt_host_to_screen_pattern(void);
|
|
|
|
void blt_line(bx_bool pline);
|
2018-01-11 22:02:08 +03:00
|
|
|
|
|
|
|
bx_ddc_c ddc;
|
2018-03-09 21:33:44 +03:00
|
|
|
bx_bool is_agp;
|
2012-09-15 01:50:50 +04:00
|
|
|
};
|
|
|
|
|
2017-10-12 22:34:58 +03:00
|
|
|
class bx_voodoo_vga_c : public bx_vgacore_c {
|
|
|
|
public:
|
|
|
|
bx_voodoo_vga_c();
|
|
|
|
virtual ~bx_voodoo_vga_c();
|
|
|
|
|
|
|
|
virtual void reset(unsigned type);
|
|
|
|
virtual void register_state(void);
|
|
|
|
virtual void after_restore_state(void);
|
|
|
|
|
Started implementing the Voodoo Banshee display adapter based on the existing
"Voodoo VGA" framework. Most of the work is still to do.
- Added Banshee specific PCI write handler and related stuff. The device is
initialzed properly by the Bochs BIOS (mem, lfb, rom and i/o).
- With Banshee specific VGA BIOS it passes the init stage and boots properly
to DOS. Parts of the init code coming from file "voodoo.h.txt" (part of the
original patch).
- Standard VGA modes are all usable (using the Bochs VGA core).
- VBE graphics modes with 8, 16, 24 and 32 BPP are usable (VBE drawing code is
mostly copy&paste from the Bochs VBE code. DAC 6/8 bit switch is present.
- TODO list:
- Voodoo Banshee memory layout (registers, 2D, 3D, LFB, textures)
- 2D graphics engine must be written from scratch
- interaction between new device and existing 3D core
- non-VGA mode (Voodoo model "banshee" without VGA extension "voodoo")
- save/restore support, move Banshee stuff to separate file, ...
2017-10-21 15:46:17 +03:00
|
|
|
virtual Bit8u mem_read(bx_phy_address addr);
|
|
|
|
virtual void mem_write(bx_phy_address addr, Bit8u value);
|
|
|
|
|
2017-10-12 22:34:58 +03:00
|
|
|
virtual void redraw_area(unsigned x0, unsigned y0,
|
|
|
|
unsigned width, unsigned height);
|
|
|
|
|
|
|
|
virtual bx_bool init_vga_extension(void);
|
2017-11-28 21:05:36 +03:00
|
|
|
virtual void get_crtc_params(bx_crtc_params_t *crtcp);
|
2018-01-23 22:08:23 +03:00
|
|
|
Bit32u get_retrace(void);
|
2017-10-12 22:34:58 +03:00
|
|
|
|
Started implementing the Voodoo Banshee display adapter based on the existing
"Voodoo VGA" framework. Most of the work is still to do.
- Added Banshee specific PCI write handler and related stuff. The device is
initialzed properly by the Bochs BIOS (mem, lfb, rom and i/o).
- With Banshee specific VGA BIOS it passes the init stage and boots properly
to DOS. Parts of the init code coming from file "voodoo.h.txt" (part of the
original patch).
- Standard VGA modes are all usable (using the Bochs VGA core).
- VBE graphics modes with 8, 16, 24 and 32 BPP are usable (VBE drawing code is
mostly copy&paste from the Bochs VBE code. DAC 6/8 bit switch is present.
- TODO list:
- Voodoo Banshee memory layout (registers, 2D, 3D, LFB, textures)
- 2D graphics engine must be written from scratch
- interaction between new device and existing 3D core
- non-VGA mode (Voodoo model "banshee" without VGA extension "voodoo")
- save/restore support, move Banshee stuff to separate file, ...
2017-10-21 15:46:17 +03:00
|
|
|
void banshee_update_mode(void);
|
|
|
|
void banshee_set_dac_mode(bx_bool mode);
|
2017-10-27 21:49:19 +03:00
|
|
|
void banshee_set_vclk3(Bit32u value);
|
Started implementing the Voodoo Banshee display adapter based on the existing
"Voodoo VGA" framework. Most of the work is still to do.
- Added Banshee specific PCI write handler and related stuff. The device is
initialzed properly by the Bochs BIOS (mem, lfb, rom and i/o).
- With Banshee specific VGA BIOS it passes the init stage and boots properly
to DOS. Parts of the init code coming from file "voodoo.h.txt" (part of the
original patch).
- Standard VGA modes are all usable (using the Bochs VGA core).
- VBE graphics modes with 8, 16, 24 and 32 BPP are usable (VBE drawing code is
mostly copy&paste from the Bochs VBE code. DAC 6/8 bit switch is present.
- TODO list:
- Voodoo Banshee memory layout (registers, 2D, 3D, LFB, textures)
- 2D graphics engine must be written from scratch
- interaction between new device and existing 3D core
- non-VGA mode (Voodoo model "banshee" without VGA extension "voodoo")
- save/restore support, move Banshee stuff to separate file, ...
2017-10-21 15:46:17 +03:00
|
|
|
|
2017-10-23 21:45:16 +03:00
|
|
|
static Bit32u banshee_vga_read_handler(void *this_ptr, Bit32u address, unsigned io_len);
|
|
|
|
static void banshee_vga_write_handler(void *this_ptr, Bit32u address, Bit32u value, unsigned io_len);
|
Started implementing the Voodoo Banshee display adapter based on the existing
"Voodoo VGA" framework. Most of the work is still to do.
- Added Banshee specific PCI write handler and related stuff. The device is
initialzed properly by the Bochs BIOS (mem, lfb, rom and i/o).
- With Banshee specific VGA BIOS it passes the init stage and boots properly
to DOS. Parts of the init code coming from file "voodoo.h.txt" (part of the
original patch).
- Standard VGA modes are all usable (using the Bochs VGA core).
- VBE graphics modes with 8, 16, 24 and 32 BPP are usable (VBE drawing code is
mostly copy&paste from the Bochs VBE code. DAC 6/8 bit switch is present.
- TODO list:
- Voodoo Banshee memory layout (registers, 2D, 3D, LFB, textures)
- 2D graphics engine must be written from scratch
- interaction between new device and existing 3D core
- non-VGA mode (Voodoo model "banshee" without VGA extension "voodoo")
- save/restore support, move Banshee stuff to separate file, ...
2017-10-21 15:46:17 +03:00
|
|
|
|
2017-10-12 22:34:58 +03:00
|
|
|
protected:
|
2017-10-23 21:45:16 +03:00
|
|
|
virtual void update(void);
|
2017-10-12 22:34:58 +03:00
|
|
|
};
|
2018-01-05 20:43:51 +03:00
|
|
|
|
|
|
|
extern bx_voodoo_base_c* theVoodooDevice;
|
|
|
|
extern bx_voodoo_vga_c* theVoodooVga;
|
|
|
|
|
2012-09-15 01:50:50 +04:00
|
|
|
#endif
|