2012-09-15 01:50:50 +04:00
|
|
|
/////////////////////////////////////////////////////////////////////////
|
|
|
|
// $Id$
|
|
|
|
/////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
2017-03-24 22:57:25 +03:00
|
|
|
// Copyright (C) 2012-2017 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
|
|
|
|
|
|
|
|
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;
|
2017-04-30 12:07:25 +03:00
|
|
|
bx_bool realtime;
|
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;
|
|
|
|
} bx_voodoo_t;
|
|
|
|
|
|
|
|
|
2017-03-26 11:09:28 +03:00
|
|
|
class bx_voodoo_c : public bx_nonvga_device_c {
|
2012-09-15 01:50:50 +04:00
|
|
|
public:
|
|
|
|
bx_voodoo_c();
|
|
|
|
virtual ~bx_voodoo_c();
|
|
|
|
virtual void init(void);
|
|
|
|
virtual void reset(unsigned type);
|
|
|
|
virtual void register_state(void);
|
|
|
|
virtual void after_restore_state(void);
|
|
|
|
|
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);
|
2012-10-25 19:53:04 +04:00
|
|
|
|
2017-03-24 22:57:25 +03:00
|
|
|
virtual void pci_write_handler(Bit8u address, Bit32u value, unsigned io_len);
|
2012-09-15 01:50:50 +04:00
|
|
|
|
2017-05-01 12:11:12 +03:00
|
|
|
static Bit32u get_retrace(bx_bool hv);
|
2012-09-15 01:50:50 +04:00
|
|
|
static void output_enable(bx_bool enabled);
|
|
|
|
static void update_screen_start(void);
|
2014-01-08 02:32:22 +04:00
|
|
|
static bx_bool update_timing(void);
|
2012-09-15 01:50:50 +04:00
|
|
|
|
|
|
|
private:
|
|
|
|
bx_voodoo_t s;
|
|
|
|
|
|
|
|
static void set_irq_level(bx_bool level);
|
|
|
|
|
|
|
|
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-05-01 14:54:12 +03:00
|
|
|
static void vertical_timer_handler(void *);
|
2012-09-15 01:50:50 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|