mirror of
https://github.com/86Box/86Box.git
synced 2026-02-25 12:55:32 -07:00
Merge remote-tracking branch 'upstream/master' into feature/ich2
This commit is contained in:
@@ -47,10 +47,14 @@
|
||||
#ifdef ABS
|
||||
# undef ABS
|
||||
#endif
|
||||
#ifdef ABSD
|
||||
# undef ABSD
|
||||
#endif
|
||||
|
||||
#define MIN(a, b) ((a) < (b) ? (a) : (b))
|
||||
#define MAX(a, b) ((a) > (b) ? (a) : (b))
|
||||
#define ABS(x) ((x) > 0 ? (x) : -(x))
|
||||
#define ABSD(x) ((x) > 0.0 ? (x) : -(x))
|
||||
#define BCD8(x) ((((x) / 10) << 4) | ((x) % 10))
|
||||
#define BCD16(x) ((((x) / 1000) << 12) | (((x) / 100) << 8) | BCD8(x))
|
||||
#define BCD32(x) ((((x) / 10000000) << 28) | (((x) / 1000000) << 24) | (((x) / 100000) << 20) | (((x) / 10000) << 16) | BCD16(x))
|
||||
@@ -143,8 +147,10 @@ extern int is_pentium; /* TODO: Move back to cpu/cpu.h when it's figured out,
|
||||
extern int fixed_size_x;
|
||||
extern int fixed_size_y;
|
||||
extern double mouse_sensitivity; /* (C) Mouse sensitivity scale */
|
||||
extern double mouse_x_error; /* Mouse error accumulator - Y */
|
||||
extern double mouse_y_error; /* Mouse error accumulator - Y */
|
||||
#ifdef _Atomic
|
||||
extern _Atomic double mouse_x_error; /* Mouse error accumulator - Y */
|
||||
extern _Atomic double mouse_y_error; /* Mouse error accumulator - Y */
|
||||
#endif
|
||||
extern int pit_mode; /* (C) force setting PIT mode */
|
||||
extern int fm_driver; /* (C) select FM sound driver */
|
||||
|
||||
|
||||
@@ -36,6 +36,9 @@ extern const device_t ali6117d_device;
|
||||
/* AMD */
|
||||
extern const device_t amd640_device;
|
||||
|
||||
/* Compaq */
|
||||
extern const device_t compaq_386_device;
|
||||
|
||||
/* Contaq/Cypress */
|
||||
extern const device_t contaq_82c596a_device;
|
||||
extern const device_t contaq_82c597_device;
|
||||
|
||||
@@ -135,8 +135,7 @@ typedef struct _device_ {
|
||||
void (*reset)(void *priv);
|
||||
union {
|
||||
int (*available)(void);
|
||||
int (*poll)(int x, int y, int z, int b, double abs_x, double abs_y, void *priv);
|
||||
void (*register_pci_slot)(int device, int type, int inta, int intb, int intc, int intd, void *priv);
|
||||
int (*poll)(void *priv);
|
||||
};
|
||||
void (*speed_changed)(void *priv);
|
||||
void (*force_redraw)(void *priv);
|
||||
@@ -179,8 +178,7 @@ extern void device_close_all(void);
|
||||
extern void device_reset_all(uint32_t match_flags);
|
||||
extern void *device_get_priv(const device_t *d);
|
||||
extern int device_available(const device_t *d);
|
||||
extern int device_poll(const device_t *d, int x, int y, int z, int b);
|
||||
extern void device_register_pci_slot(const device_t *d, int device, int type, int inta, int intb, int intc, int intd);
|
||||
extern int device_poll(const device_t *d);
|
||||
extern void device_speed_changed(void);
|
||||
extern void device_force_redraw(void);
|
||||
extern void device_get_name(const device_t *d, int bus, char *name);
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
#endif
|
||||
|
||||
#define MOUSE_TYPE_NONE 0 /* no mouse configured */
|
||||
#define MOUSE_TYPE_INTERNAL 1 /* machine has internal mouse */
|
||||
#define MOUSE_TYPE_INTERNAL 1 /* achine has internal mouse */
|
||||
#define MOUSE_TYPE_LOGIBUS 2 /* Logitech/ATI Bus Mouse */
|
||||
#define MOUSE_TYPE_INPORT 3 /* Microsoft InPort Mouse */
|
||||
#if 0
|
||||
@@ -47,11 +47,6 @@
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#else
|
||||
extern atomic_int mouse_x;
|
||||
extern atomic_int mouse_y;
|
||||
extern atomic_int mouse_z;
|
||||
extern atomic_int mouse_buttons;
|
||||
#endif
|
||||
|
||||
extern int mouse_type;
|
||||
@@ -62,17 +57,14 @@ extern double mouse_x_abs;
|
||||
extern double mouse_y_abs;
|
||||
extern int tablet_tool_type;
|
||||
extern double mouse_sensitivity;
|
||||
extern double mouse_x_error;
|
||||
extern double mouse_y_error;
|
||||
|
||||
#ifdef EMU_DEVICE_H
|
||||
extern const device_t *mouse_get_device(int mouse);
|
||||
extern void *mouse_ps2_init(const device_t *);
|
||||
|
||||
extern const device_t mouse_logibus_device;
|
||||
extern const device_t mouse_logibus_onboard_device;
|
||||
extern const device_t mouse_msinport_device;
|
||||
# if 0
|
||||
# ifdef USE_GENIBUS
|
||||
extern const device_t mouse_genibus_device;
|
||||
# endif
|
||||
extern const device_t mouse_mssystems_device;
|
||||
@@ -83,33 +75,49 @@ extern const device_t mouse_wacom_device;
|
||||
extern const device_t mouse_wacom_artpad_device;
|
||||
#endif
|
||||
|
||||
extern void mouse_init(void);
|
||||
extern void mouse_close(void);
|
||||
extern void mouse_reset(void);
|
||||
extern void mouse_set_buttons(int buttons);
|
||||
extern void mouse_set_poll_ex(void (*poll_ex)(void));
|
||||
extern void mouse_process(void);
|
||||
extern void mouse_set_poll(int (*f)(int, int, int, int, void *), void *);
|
||||
extern void mouse_clear_x(void);
|
||||
extern void mouse_clear_y(void);
|
||||
extern void mouse_clear_coords(void);
|
||||
extern void mouse_clear_buttons(void);
|
||||
extern void mouse_subtract_x(int *delta_x, int *o_x, int min, int max, int abs);
|
||||
extern void mouse_subtract_y(int *delta_y, int *o_y, int min, int max, int invert, int abs);
|
||||
extern void mouse_subtract_coords(int *delta_x, int *delta_y, int *o_x, int *o_y,
|
||||
int min, int max, int invert, int abs);
|
||||
extern int mouse_moved(void);
|
||||
extern int mouse_state_changed(void);
|
||||
extern int mouse_mbut_changed(void);
|
||||
extern void mouse_scale_fx(double x);
|
||||
extern void mouse_scale_fy(double y);
|
||||
extern void mouse_scale_x(int x);
|
||||
extern void mouse_scale_y(int y);
|
||||
extern void mouse_scalef(double x, double y);
|
||||
extern void mouse_scale(int x, int y);
|
||||
extern void mouse_set_z(int z);
|
||||
extern void mouse_clear_z(void);
|
||||
extern void mouse_subtract_z(int *delta_z, int min, int max, int invert);
|
||||
extern void mouse_set_buttons_ex(int b);
|
||||
extern int mouse_get_buttons_ex(void);
|
||||
extern void mouse_set_sample_rate(double new_rate);
|
||||
extern void mouse_set_buttons(int buttons);
|
||||
extern void mouse_get_abs_coords(double *x_abs, double *y_abs);
|
||||
extern void mouse_process(void);
|
||||
extern void mouse_set_poll_ex(void (*poll_ex)(void));
|
||||
extern void mouse_set_poll(int (*f)(void *), void *);
|
||||
extern char * mouse_get_name(int mouse);
|
||||
extern char * mouse_get_internal_name(int mouse);
|
||||
extern int mouse_get_from_internal_name(char *s);
|
||||
extern int mouse_has_config(int mouse);
|
||||
#ifdef EMU_DEVICE_H
|
||||
extern const device_t *mouse_get_device(int mouse);
|
||||
#endif
|
||||
extern int mouse_get_buttons(void);
|
||||
extern int mouse_get_ndev(void);
|
||||
extern void mouse_set_raw(int raw);
|
||||
extern void mouse_reset(void);
|
||||
extern void mouse_close(void);
|
||||
extern void mouse_init(void);
|
||||
|
||||
extern void mouse_bus_set_irq(void *priv, int irq);
|
||||
|
||||
extern void mouse_set_sample_rate(double new_rate);
|
||||
extern void mouse_scale(int x, int y);
|
||||
extern void mouse_scale_x(int x);
|
||||
extern void mouse_scale_y(int y);
|
||||
extern void mouse_set_z(int z);
|
||||
extern void mouse_set_buttons_ex(int b);
|
||||
extern int mouse_get_buttons_ex(void);
|
||||
|
||||
extern char *mouse_get_name(int mouse);
|
||||
extern char *mouse_get_internal_name(int mouse);
|
||||
extern int mouse_get_from_internal_name(char *s);
|
||||
extern int mouse_has_config(int mouse);
|
||||
extern int mouse_get_type(int mouse);
|
||||
extern int mouse_get_ndev(void);
|
||||
extern int mouse_get_buttons(void);
|
||||
|
||||
extern void mouse_clear_data(void *priv);
|
||||
extern void mouse_bus_set_irq(void *priv, int irq);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -255,8 +255,9 @@ extern void pci_add_card(uint8_t add_type, uint8_t (*read)(int func, int
|
||||
void (*write)(int func, int addr, uint8_t val, void *priv), void *priv, uint8_t *slot);
|
||||
|
||||
/* Add an instance of the PCI bridge. */
|
||||
extern uint8_t pci_add_bridge(uint8_t (*read)(int func, int addr, void *priv),
|
||||
void (*write)(int func, int addr, uint8_t val, void *priv), void *priv);
|
||||
extern void pci_add_bridge(uint8_t agp, uint8_t (*read)(int func, int addr, void *priv),
|
||||
void (*write)(int func, int addr, uint8_t val, void *priv), void *priv,
|
||||
uint8_t *slot);
|
||||
|
||||
/* Register the cards that have been added into slots. */
|
||||
extern void pci_register_cards(void);
|
||||
|
||||
@@ -55,8 +55,13 @@ extern int strnicmp(const char *s1, const char *s2, size_t n);
|
||||
# define off64_t off_t
|
||||
#endif
|
||||
|
||||
#if !defined (__APPLE__) && !defined(__clang__)
|
||||
# define FALLTHROUGH_ANNOTATION
|
||||
#if __has_attribute(fallthrough)
|
||||
# define fallthrough __attribute__((fallthrough))
|
||||
#else
|
||||
# if __has_attribute(__fallthrough__)
|
||||
# define fallthrough __attribute__((__fallthrough__))
|
||||
# endif
|
||||
# define fallthrough do {} while (0) /* fallthrough */
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
@@ -137,6 +142,8 @@ extern void plat_vidapi_reload(void);
|
||||
extern void plat_vid_reload_options(void);
|
||||
extern uint32_t plat_language_code(char *langcode);
|
||||
extern void plat_language_code_r(uint32_t lcid, char *outbuf, int len);
|
||||
extern void plat_get_cpu_string(char *outbuf, uint8_t len);
|
||||
extern double plat_get_dpi(void);
|
||||
|
||||
/* Resource management. */
|
||||
extern void set_language(uint32_t id);
|
||||
|
||||
@@ -18,8 +18,13 @@
|
||||
#ifndef EMU_PLAT_FALLTHROUGH_H
|
||||
#define EMU_PLAT_FALLTHROUGH_H
|
||||
|
||||
#if !defined (__APPLE__) && !defined(__clang__)
|
||||
# define FALLTHROUGH_ANNOTATION
|
||||
#if __has_attribute(__fallthrough__)
|
||||
# define fallthrough __attribute__((__fallthrough__))
|
||||
#else
|
||||
# if __has_attribute(fallthrough)
|
||||
# define fallthrough __attribute__((fallthrough))
|
||||
# endif
|
||||
# define fallthrough do {} while (0) /* fallthrough */
|
||||
#endif
|
||||
|
||||
#endif /*EMU_PLAT_FALLTHROUGH_H*/
|
||||
|
||||
@@ -19,8 +19,24 @@
|
||||
#ifndef VIDEO_8514A_H
|
||||
#define VIDEO_8514A_H
|
||||
|
||||
typedef struct hwcursor8514_t {
|
||||
int ena;
|
||||
int x;
|
||||
int y;
|
||||
int xoff;
|
||||
int yoff;
|
||||
int cur_xsize;
|
||||
int cur_ysize;
|
||||
int v_acc;
|
||||
int h_acc;
|
||||
uint32_t addr;
|
||||
uint32_t pitch;
|
||||
} hwcursor8514_t;
|
||||
|
||||
typedef struct ibm8514_t {
|
||||
uint8_t pos_regs[8];
|
||||
hwcursor8514_t hwcursor;
|
||||
hwcursor8514_t hwcursor_latch;
|
||||
uint8_t pos_regs[8];
|
||||
|
||||
int force_old_addr;
|
||||
int type;
|
||||
@@ -29,8 +45,10 @@ typedef struct ibm8514_t {
|
||||
|
||||
uint32_t vram_size;
|
||||
uint32_t vram_mask;
|
||||
uint32_t pallook[512];
|
||||
|
||||
PALETTE vgapal;
|
||||
uint8_t hwcursor_oddeven;
|
||||
uint8_t dac_mask;
|
||||
uint8_t dac_status;
|
||||
uint32_t *map8;
|
||||
@@ -38,7 +56,9 @@ typedef struct ibm8514_t {
|
||||
int dac_pos;
|
||||
int dac_r;
|
||||
int dac_g;
|
||||
int dac_b;
|
||||
int internal_pitch;
|
||||
int hwcursor_on;
|
||||
|
||||
struct {
|
||||
uint16_t subsys_cntl;
|
||||
|
||||
@@ -44,9 +44,9 @@ typedef struct ega_t {
|
||||
uint8_t colournocare;
|
||||
uint8_t scrblank;
|
||||
uint8_t plane_mask;
|
||||
uint8_t pad;
|
||||
uint8_t pad0;
|
||||
uint8_t pad1;
|
||||
uint8_t ctl_mode;
|
||||
uint8_t color_mux;
|
||||
uint8_t dot;
|
||||
uint8_t crtc[32];
|
||||
uint8_t gdcreg[16];
|
||||
uint8_t attrregs[32];
|
||||
@@ -108,6 +108,7 @@ typedef struct ega_t {
|
||||
int res_y;
|
||||
int bpp;
|
||||
int index;
|
||||
int remap_required;
|
||||
|
||||
uint32_t charseta;
|
||||
uint32_t charsetb;
|
||||
@@ -117,21 +118,24 @@ typedef struct ega_t {
|
||||
uint32_t ca;
|
||||
uint32_t vram_limit;
|
||||
uint32_t overscan_color;
|
||||
uint32_t cca;
|
||||
|
||||
uint32_t *pallook;
|
||||
|
||||
uint64_t dispontime;
|
||||
uint64_t dispofftime;
|
||||
|
||||
uint64_t dot_time;
|
||||
|
||||
pc_timer_t timer;
|
||||
pc_timer_t dot_timer;
|
||||
|
||||
double clock;
|
||||
double dot_clock;
|
||||
|
||||
int remap_required;
|
||||
uint32_t (*remap_func)(struct ega_t *ega, uint32_t in_addr);
|
||||
void * eeprom;
|
||||
|
||||
void (*render)(struct ega_t *svga);
|
||||
|
||||
void *eeprom;
|
||||
uint32_t (*remap_func)(struct ega_t *ega, uint32_t in_addr);
|
||||
void (*render)(struct ega_t *svga);
|
||||
} ega_t;
|
||||
#endif
|
||||
|
||||
|
||||
@@ -89,6 +89,7 @@ typedef struct svga_t {
|
||||
int dac_pos;
|
||||
int dac_r;
|
||||
int dac_g;
|
||||
int dac_b;
|
||||
int vtotal;
|
||||
int dispend;
|
||||
int vsyncstart;
|
||||
@@ -341,6 +342,9 @@ extern void ati68860_ramdac_set_render(void *priv, svga_t *svga);
|
||||
extern void ati68860_ramdac_set_pallook(void *priv, int i, uint32_t col);
|
||||
extern void ati68860_hwcursor_draw(svga_t *svga, int displine);
|
||||
|
||||
extern void ati68875_ramdac_out(uint16_t addr, int rs2, int rs3, uint8_t val, void *priv, svga_t *svga);
|
||||
extern uint8_t ati68875_ramdac_in(uint16_t addr, int rs2, int rs3, void *priv, svga_t *svga);
|
||||
|
||||
extern void att49x_ramdac_out(uint16_t addr, int rs2, uint8_t val, void *priv, svga_t *svga);
|
||||
extern uint8_t att49x_ramdac_in(uint16_t addr, int rs2, void *priv, svga_t *svga);
|
||||
|
||||
@@ -396,6 +400,7 @@ extern float tvp3026_getclock(int clock, void *priv);
|
||||
|
||||
# ifdef EMU_DEVICE_H
|
||||
extern const device_t ati68860_ramdac_device;
|
||||
extern const device_t ati68875_ramdac_device;
|
||||
extern const device_t att490_ramdac_device;
|
||||
extern const device_t att491_ramdac_device;
|
||||
extern const device_t att492_ramdac_device;
|
||||
@@ -409,6 +414,9 @@ extern const device_t bt485a_ramdac_device;
|
||||
extern const device_t gendac_ramdac_device;
|
||||
extern const device_t ibm_rgb528_ramdac_device;
|
||||
extern const device_t ics2494an_305_device;
|
||||
extern const device_t ati18810_device;
|
||||
extern const device_t ati18811_0_device;
|
||||
extern const device_t ati18811_1_device;
|
||||
extern const device_t ics2595_device;
|
||||
extern const device_t icd2061_device;
|
||||
extern const device_t ics9161_device;
|
||||
|
||||
@@ -73,6 +73,15 @@ void svga_render_ABGR8888_highres(svga_t *svga);
|
||||
void svga_render_RGBA8888_lowres(svga_t *svga);
|
||||
void svga_render_RGBA8888_highres(svga_t *svga);
|
||||
|
||||
void ibm8514_render_8bpp(svga_t *svga);
|
||||
void ibm8514_render_15bpp(svga_t *svga);
|
||||
void ibm8514_render_16bpp(svga_t *svga);
|
||||
void ibm8514_render_24bpp(svga_t *svga);
|
||||
void ibm8514_render_BGR(svga_t *svga);
|
||||
void ibm8514_render_32bpp(svga_t *svga);
|
||||
void ibm8514_render_ABGR8888(svga_t *svga);
|
||||
void ibm8514_render_RGBA8888(svga_t *svga);
|
||||
|
||||
extern void (*svga_render)(svga_t *svga);
|
||||
|
||||
#endif /*VID_SVGA_RENDER_H*/
|
||||
|
||||
@@ -103,8 +103,8 @@ typedef struct monitor_t {
|
||||
int mon_efscrnsz_y;
|
||||
int mon_unscaled_size_x;
|
||||
int mon_unscaled_size_y;
|
||||
int mon_res_x;
|
||||
int mon_res_y;
|
||||
double mon_res_x;
|
||||
double mon_res_y;
|
||||
int mon_bpp;
|
||||
bitmap_t *target_buffer;
|
||||
int mon_video_timing_read_b;
|
||||
@@ -263,6 +263,8 @@ extern void video_close(void);
|
||||
extern void video_reset_close(void);
|
||||
extern void video_pre_reset(int card);
|
||||
extern void video_reset(int card);
|
||||
extern void video_post_reset(void);
|
||||
extern void video_voodoo_init(void);
|
||||
extern uint8_t video_force_resize_get_monitor(int monitor_index);
|
||||
extern void video_force_resize_set_monitor(uint8_t res, int monitor_index);
|
||||
extern void video_update_timing(void);
|
||||
@@ -300,7 +302,9 @@ extern void ibm8514_device_add(void);
|
||||
extern const device_t mach8_isa_device;
|
||||
extern const device_t mach32_isa_device;
|
||||
extern const device_t mach32_vlb_device;
|
||||
extern const device_t mach32_mca_device;
|
||||
extern const device_t mach32_pci_device;
|
||||
extern const device_t mach32_onboard_pci_device;
|
||||
|
||||
/* ATi Mach64 */
|
||||
extern const device_t mach64gx_isa_device;
|
||||
|
||||
Reference in New Issue
Block a user