mirror of
https://github.com/86Box/86Box.git
synced 2026-02-23 18:08:20 -07:00
Merge remote-tracking branch 'upstream/master' into feature/mtrr
This commit is contained in:
@@ -22,6 +22,52 @@
|
||||
#ifndef EMU_KEYBOARD_H
|
||||
#define EMU_KEYBOARD_H
|
||||
|
||||
enum {
|
||||
DEV_KBD = 0,
|
||||
DEV_AUX
|
||||
};
|
||||
|
||||
/* Used by the AT / PS/2 keyboard controller, common device, keyboard, and mouse. */
|
||||
typedef struct {
|
||||
uint8_t wantcmd, dat, pad, pad0;
|
||||
|
||||
int out_new;
|
||||
|
||||
void *priv;
|
||||
|
||||
void (*poll)(void *priv);
|
||||
} kbc_port_t;
|
||||
|
||||
/* Used by the AT / PS/2 common device, keyboard, and mouse. */
|
||||
typedef struct {
|
||||
const char *name; /* name of this device */
|
||||
|
||||
uint8_t type, inst, command, wantdata,
|
||||
last_scan_code, state, resolution, rate,
|
||||
cmd_queue_start, cmd_queue_end, queue_start, queue_end;
|
||||
|
||||
/* 6 bytes needed for mouse */
|
||||
uint8_t last_data[6];
|
||||
|
||||
uint16_t flags;
|
||||
|
||||
/* Internal FIFO, not present on real devices, needed for commands that
|
||||
output multiple bytes. */
|
||||
uint8_t cmd_queue[16];
|
||||
|
||||
uint8_t queue[16];
|
||||
|
||||
int mode,
|
||||
x, y, z, b;
|
||||
|
||||
int *scan;
|
||||
|
||||
void (*process_cmd)(void *priv);
|
||||
void (*execute_bat)(void *priv);
|
||||
|
||||
kbc_port_t *port;
|
||||
} atkbc_dev_t;
|
||||
|
||||
typedef struct {
|
||||
const uint8_t mk[4];
|
||||
const uint8_t brk[4];
|
||||
@@ -139,8 +185,11 @@ extern uint8_t keyboard_set3_flags[512];
|
||||
extern uint8_t keyboard_set3_all_repeat;
|
||||
extern uint8_t keyboard_set3_all_break;
|
||||
extern int mouse_queue_start, mouse_queue_end;
|
||||
extern int mouse_cmd_queue_start, mouse_cmd_queue_end;
|
||||
extern int mouse_scan;
|
||||
|
||||
extern kbc_port_t *kbc_ports[2];
|
||||
|
||||
#ifdef EMU_DEVICE_H
|
||||
extern const device_t keyboard_pc_device;
|
||||
extern const device_t keyboard_pc82_device;
|
||||
@@ -152,13 +201,13 @@ extern const device_t keyboard_xt_t1x00_device;
|
||||
extern const device_t keyboard_tandy_device;
|
||||
# if defined(DEV_BRANCH) && defined(USE_LASERXT)
|
||||
extern const device_t keyboard_xt_lxt3_device;
|
||||
# endif
|
||||
# endif /*defined(DEV_BRANCH) && defined(USE_LASERXT) */
|
||||
extern const device_t keyboard_xt_olivetti_device;
|
||||
extern const device_t keyboard_xt_zenith_device;
|
||||
extern const device_t keyboard_xtclone_device;
|
||||
extern const device_t keyboard_at_device;
|
||||
extern const device_t keyboard_at_ami_device;
|
||||
extern const device_t keyboard_at_samsung_device;
|
||||
extern const device_t keyboard_at_tg_ami_device;
|
||||
extern const device_t keyboard_at_toshiba_device;
|
||||
extern const device_t keyboard_at_olivetti_device;
|
||||
extern const device_t keyboard_at_ncr_device;
|
||||
@@ -167,6 +216,8 @@ extern const device_t keyboard_ps2_ps1_device;
|
||||
extern const device_t keyboard_ps2_ps1_pci_device;
|
||||
extern const device_t keyboard_ps2_xi8088_device;
|
||||
extern const device_t keyboard_ps2_ami_device;
|
||||
extern const device_t keyboard_ps2_tg_ami_device;
|
||||
extern const device_t keyboard_ps2_tg_ami_green_device;
|
||||
extern const device_t keyboard_ps2_olivetti_device;
|
||||
extern const device_t keyboard_ps2_mca_device;
|
||||
extern const device_t keyboard_ps2_mca_2_device;
|
||||
@@ -176,7 +227,8 @@ extern const device_t keyboard_ps2_ami_pci_device;
|
||||
extern const device_t keyboard_ps2_intel_ami_pci_device;
|
||||
extern const device_t keyboard_ps2_acer_pci_device;
|
||||
extern const device_t keyboard_ps2_ali_pci_device;
|
||||
#endif
|
||||
extern const device_t keyboard_ps2_tg_ami_pci_device;
|
||||
#endif /*EMU_DEVICE_H*/
|
||||
|
||||
extern void keyboard_init(void);
|
||||
extern void keyboard_close(void);
|
||||
@@ -190,22 +242,21 @@ extern uint8_t keyboard_get_shift(void);
|
||||
extern void keyboard_get_states(uint8_t *cl, uint8_t *nl, uint8_t *sl);
|
||||
extern void keyboard_set_states(uint8_t cl, uint8_t nl, uint8_t sl);
|
||||
extern int keyboard_recv(uint16_t key);
|
||||
extern int keyboard_isfsenter(void);
|
||||
extern int keyboard_isfsenter_down(void);
|
||||
extern int keyboard_isfsexit(void);
|
||||
extern int keyboard_isfsexit_down(void);
|
||||
extern int keyboard_ismsexit(void);
|
||||
extern void keyboard_set_is_amstrad(int ams);
|
||||
|
||||
extern void keyboard_at_adddata_mouse(uint8_t val);
|
||||
extern void keyboard_at_adddata_mouse_direct(uint8_t val);
|
||||
extern void keyboard_at_adddata_mouse_cmd(uint8_t val);
|
||||
extern void keyboard_at_mouse_reset(void);
|
||||
extern uint8_t keyboard_at_mouse_pos(void);
|
||||
extern int keyboard_at_fixed_channel(void);
|
||||
extern void keyboard_at_set_mouse(void (*mouse_write)(uint8_t val, void *), void *);
|
||||
extern void keyboard_at_set_a20_key(int state);
|
||||
extern void keyboard_at_set_mode(int ps2);
|
||||
extern uint8_t keyboard_at_get_mouse_scan(void);
|
||||
extern void keyboard_at_set_mouse_scan(uint8_t val);
|
||||
extern void keyboard_at_reset(void);
|
||||
extern void kbc_at_a20_reset(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -162,6 +162,7 @@
|
||||
#else
|
||||
# define IDS_DYNAREC IDS_2163
|
||||
#endif
|
||||
#define IDS_2166 2166 // "Video card #2 ""%hs"" is not..."
|
||||
|
||||
#define IDS_4096 4096 // "Hard disk (%s)"
|
||||
#define IDS_4097 4097 // "%01i:%01i"
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
#define MOUSE_TYPE_LT3BUTTON 10 /* Logitech 3-button Serial Mouse */
|
||||
#define MOUSE_TYPE_PS2 11 /* PS/2 series Bus Mouse */
|
||||
#define MOUSE_TYPE_WACOM 12 /* WACOM tablet */
|
||||
#define MOUSE_TYPE_WACOMARTP 13 /* WACOM tablet (ArtPad) */
|
||||
|
||||
#define MOUSE_TYPE_ONBOARD 0x80 /* Mouse is an on-board version of one of the above. */
|
||||
|
||||
@@ -65,6 +66,7 @@ extern const device_t mouse_msserial_device;
|
||||
extern const device_t mouse_ltserial_device;
|
||||
extern const device_t mouse_ps2_device;
|
||||
extern const device_t mouse_wacom_device;
|
||||
extern const device_t mouse_wacom_artpad_device;
|
||||
#endif
|
||||
|
||||
extern void mouse_init(void);
|
||||
|
||||
@@ -43,8 +43,11 @@ extern void pic_elcr_write(uint16_t port, uint8_t val, void *priv);
|
||||
extern uint8_t pic_elcr_read(uint16_t port, void *priv);
|
||||
|
||||
extern void pic_set_shadow(int sh);
|
||||
extern int pic_get_pci_flag(void);
|
||||
extern void pic_set_pci_flag(int pci);
|
||||
extern void pic_set_pci(void);
|
||||
extern void pic_kbd_latch(int enable);
|
||||
extern void pic_mouse_latch(int enable);
|
||||
extern void pic_init(void);
|
||||
extern void pic_init_pcjr(void);
|
||||
extern void pic2_init(void);
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
#define MPU401_VERSION 0x15
|
||||
#define MPU401_REVISION 0x01
|
||||
#define MPU401_QUEUE 64
|
||||
#define MPU401_QUEUE 1024
|
||||
#define MPU401_INPUT_QUEUE 1024
|
||||
#define MPU401_TIMECONSTANT (60000000 / 1000.0f)
|
||||
#define MPU401_RESETBUSY 27.0f
|
||||
|
||||
@@ -24,9 +24,16 @@
|
||||
|
||||
extern int sound_gain;
|
||||
|
||||
#define SOUNDBUFLEN (48000 / 50)
|
||||
#define FREQ_44100 44100
|
||||
#define FREQ_48000 48000
|
||||
#define FREQ_49716 49716
|
||||
#define FREQ_88200 88200
|
||||
#define FREQ_96000 96000
|
||||
|
||||
#define CD_FREQ 44100
|
||||
#define SOUND_FREQ FREQ_48000
|
||||
#define SOUNDBUFLEN (SOUND_FREQ / 50)
|
||||
|
||||
#define CD_FREQ FREQ_44100
|
||||
#define CD_BUFLEN (CD_FREQ / 10)
|
||||
|
||||
enum {
|
||||
|
||||
@@ -113,6 +113,7 @@ extern int con, cursoron, cgablink;
|
||||
extern int scrollcache;
|
||||
|
||||
extern uint8_t edatlookup[4][4];
|
||||
extern uint8_t egaremap2bpp[256];
|
||||
|
||||
#if defined(EMU_MEM_H) && defined(EMU_ROM_H)
|
||||
void ega_render_blank(ega_t *ega);
|
||||
@@ -120,14 +121,8 @@ void ega_render_blank(ega_t *ega);
|
||||
void ega_render_overscan_left(ega_t *ega);
|
||||
void ega_render_overscan_right(ega_t *ega);
|
||||
|
||||
void ega_render_text_40(ega_t *ega);
|
||||
void ega_render_text_80(ega_t *ega);
|
||||
|
||||
void ega_render_2bpp_lowres(ega_t *ega);
|
||||
void ega_render_2bpp_highres(ega_t *ega);
|
||||
|
||||
void ega_render_4bpp_lowres(ega_t *ega);
|
||||
void ega_render_4bpp_highres(ega_t *ega);
|
||||
void ega_render_text(ega_t *ega);
|
||||
void ega_render_graphics(ega_t *ega);
|
||||
#endif
|
||||
|
||||
#endif /*VIDEO_EGA_H*/
|
||||
|
||||
@@ -20,11 +20,11 @@
|
||||
break; \
|
||||
\
|
||||
case VAR_WORD_MODE_MA13: \
|
||||
out_addr = ((in_addr << 1) & 0x1fff8) | ((in_addr >> 13) & 0x4) | (in_addr & ~0x1ffff); \
|
||||
out_addr = ((in_addr << 1) & 0x3fff8) | ((in_addr >> 13) & 0x4) | (in_addr & ~0x3ffff); \
|
||||
break; \
|
||||
\
|
||||
case VAR_WORD_MODE_MA15: \
|
||||
out_addr = ((in_addr << 1) & 0x1fff8) | ((in_addr >> 15) & 0x4) | (in_addr & ~0x1ffff); \
|
||||
out_addr = ((in_addr << 1) & 0x3fff8) | ((in_addr >> 15) & 0x4) | (in_addr & ~0x3ffff); \
|
||||
break; \
|
||||
\
|
||||
case VAR_DWORD_MODE: \
|
||||
@@ -85,7 +85,7 @@ ega_recalc_remap_func(ega_t *ega)
|
||||
func_nr = VAR_DWORD_MODE;
|
||||
else if (ega->crtc[0x17] & 0x40)
|
||||
func_nr = VAR_BYTE_MODE;
|
||||
else if (ega->crtc[0x17] & 0x20)
|
||||
else if ((ega->crtc[0x17] & 0x20) && ega->vram_limit > 64*1024)
|
||||
func_nr = VAR_WORD_MODE_MA15;
|
||||
else
|
||||
func_nr = VAR_WORD_MODE_MA13;
|
||||
|
||||
Reference in New Issue
Block a user