mirror of
https://github.com/86Box/86Box.git
synced 2026-02-24 02:18:20 -07:00
Merge branch 'master'
This commit is contained in:
25
src/86box.c
25
src/86box.c
@@ -188,7 +188,6 @@ int gfxcard[GFXCARD_MAX] = { 0, 0 }; /* (C) graphic
|
||||
int show_second_monitors = 1; /* (C) show non-primary monitors */
|
||||
int sound_is_float = 1; /* (C) sound uses FP values */
|
||||
int voodoo_enabled = 0; /* (C) video option */
|
||||
int lba_enhancer_enabled = 0; /* (C) enable Vision Systems LBA Enhancer */
|
||||
int ibm8514_standalone_enabled = 0; /* (C) video option */
|
||||
int xga_standalone_enabled = 0; /* (C) video option */
|
||||
int da2_standalone_enabled = 0; /* (C) video option */
|
||||
@@ -217,12 +216,15 @@ int test_mode = 0; /* (C) Test mo
|
||||
char uuid[MAX_UUID_LEN] = { '\0' }; /* (C) UUID or machine identifier */
|
||||
int sound_muted = 0; /* (C) Is sound muted? */
|
||||
int inhibit_multimedia_keys; /* (C) Inhibit multimedia keys on Windows. */
|
||||
int force_10ms; /* (C) Force 10ms CPU frame intervals. */
|
||||
|
||||
int other_ide_present = 0; /* IDE controllers from non-IDE cards are
|
||||
present */
|
||||
int other_scsi_present = 0; /* SCSI controllers from non-SCSI cards are
|
||||
present */
|
||||
|
||||
int is_pcjr = 0; /* The current machine is PCjr. */
|
||||
|
||||
// Accelerator key array
|
||||
struct accelKey acc_keys[NUM_ACCELS];
|
||||
|
||||
@@ -1532,9 +1534,6 @@ pc_reset_hard_init(void)
|
||||
if (unittester_enabled)
|
||||
device_add(&unittester_device);
|
||||
|
||||
if (lba_enhancer_enabled)
|
||||
device_add(&lba_enhancer_device);
|
||||
|
||||
if (novell_keycard_enabled)
|
||||
device_add(&novell_keycard_device);
|
||||
|
||||
@@ -1592,19 +1591,19 @@ update_mouse_msg(void)
|
||||
*(wcp - 1) = L'\0';
|
||||
mbstowcs(wcpu, cpu_s->name, strlen(cpu_s->name) + 1);
|
||||
#ifdef _WIN32
|
||||
swprintf(mouse_msg[0], sizeof_w(mouse_msg[0]), L"%%i%%%% - %ls",
|
||||
swprintf(mouse_msg[0], sizeof_w(mouse_msg[0]), L"%%i.%%i%%%% - %ls",
|
||||
plat_get_string(STRING_MOUSE_CAPTURE));
|
||||
swprintf(mouse_msg[1], sizeof_w(mouse_msg[1]), L"%%i%%%% - %ls",
|
||||
swprintf(mouse_msg[1], sizeof_w(mouse_msg[1]), L"%%i.%%i%%%% - %ls",
|
||||
(mouse_get_buttons() > 2) ? plat_get_string(STRING_MOUSE_RELEASE) : plat_get_string(STRING_MOUSE_RELEASE_MMB));
|
||||
wcsncpy(mouse_msg[2], L"%i%%", sizeof_w(mouse_msg[2]));
|
||||
wcsncpy(mouse_msg[2], L"%i.%i%%", sizeof_w(mouse_msg[2]));
|
||||
#else
|
||||
swprintf(mouse_msg[0], sizeof_w(mouse_msg[0]), L"%ls v%ls - %%i%%%% - %ls - %ls/%ls - %ls",
|
||||
swprintf(mouse_msg[0], sizeof_w(mouse_msg[0]), L"%ls v%ls - %%i.%%i%%%% - %ls - %ls/%ls - %ls",
|
||||
EMU_NAME_W, EMU_VERSION_FULL_W, wmachine, wcpufamily, wcpu,
|
||||
plat_get_string(STRING_MOUSE_CAPTURE));
|
||||
swprintf(mouse_msg[1], sizeof_w(mouse_msg[1]), L"%ls v%ls - %%i%%%% - %ls - %ls/%ls - %ls",
|
||||
swprintf(mouse_msg[1], sizeof_w(mouse_msg[1]), L"%ls v%ls - %%i.%%i%%%% - %ls - %ls/%ls - %ls",
|
||||
EMU_NAME_W, EMU_VERSION_FULL_W, wmachine, wcpufamily, wcpu,
|
||||
(mouse_get_buttons() > 2) ? plat_get_string(STRING_MOUSE_RELEASE) : plat_get_string(STRING_MOUSE_RELEASE_MMB));
|
||||
swprintf(mouse_msg[2], sizeof_w(mouse_msg[2]), L"%ls v%ls - %%i%%%% - %ls - %ls/%ls",
|
||||
swprintf(mouse_msg[2], sizeof_w(mouse_msg[2]), L"%ls v%ls - %%i.%%i%%%% - %ls - %ls/%ls",
|
||||
EMU_NAME_W, EMU_VERSION_FULL_W, wmachine, wcpufamily, wcpu);
|
||||
#endif
|
||||
}
|
||||
@@ -1714,7 +1713,7 @@ pc_run(void)
|
||||
|
||||
/* Run a block of code. */
|
||||
startblit();
|
||||
cpu_exec((int32_t) cpu_s->rspeed / 100);
|
||||
cpu_exec((int32_t) cpu_s->rspeed / (force_10ms ? 100 : 1000));
|
||||
ack_pause();
|
||||
#ifdef USE_GDBSTUB /* avoid a KBC FIFO overflow when CPU emulation is stalled */
|
||||
if (gdbstub_step == GDBSTUB_EXEC) {
|
||||
@@ -1729,14 +1728,14 @@ pc_run(void)
|
||||
|
||||
/* Done with this frame, update statistics. */
|
||||
framecount++;
|
||||
if (++framecountx >= 100) {
|
||||
if (++framecountx >= (force_10ms ? 100 : 1000)) {
|
||||
framecountx = 0;
|
||||
frames = 0;
|
||||
}
|
||||
|
||||
if (title_update) {
|
||||
mouse_msg_idx = ((mouse_type == MOUSE_TYPE_NONE) || (mouse_input_mode >= 1)) ? 2 : !!mouse_capture;
|
||||
swprintf(temp, sizeof_w(temp), mouse_msg[mouse_msg_idx], fps);
|
||||
swprintf(temp, sizeof_w(temp), mouse_msg[mouse_msg_idx], fps / (force_10ms ? 1 : 10), force_10ms ? 0 : (fps % 10));
|
||||
#ifdef __APPLE__
|
||||
/* Needed due to modifying the UI on the non-main thread is a big no-no. */
|
||||
dispatch_async_f(dispatch_get_main_queue(), wcsdup((const wchar_t *) temp), _ui_window_title);
|
||||
|
||||
@@ -2655,7 +2655,7 @@ cdrom_read_disc_information(const cdrom_t *dev, uint8_t *buffer)
|
||||
buffer[ 3] = first; /* Number of First Track on Disc */
|
||||
buffer[ 4] = sessions; /* Number of Sessions (LSB) */
|
||||
buffer[ 5] = ls_first; /* First Track Number in Last Session (LSB) */
|
||||
buffer[ 5] = ls_last; /* Last Track Number in Last Session (LSB) */
|
||||
buffer[ 6] = ls_last; /* Last Track Number in Last Session (LSB) */
|
||||
buffer[ 7] = 0x20; /* Unrestricted use */
|
||||
buffer[ 8] = t[0].ps; /* Disc Type */
|
||||
buffer[ 9] = 0x00; /* Number Of Sessions (MSB) */
|
||||
|
||||
@@ -746,8 +746,7 @@ codegen_skip:
|
||||
uop_MOV_PTR(ir, IREG_ea_seg, (void *) op_ea_seg);
|
||||
if (op_ssegs != last_op_ssegs)
|
||||
uop_MOV_IMM(ir, IREG_ssegs, op_ssegs);
|
||||
uop_LOAD_FUNC_ARG_IMM(ir, 0, fetchdat);
|
||||
uop_CALL_INSTRUCTION_FUNC(ir, op);
|
||||
uop_CALL_INSTRUCTION_FUNC(ir, op, fetchdat);
|
||||
codegen_flags_changed = 0;
|
||||
codegen_mark_code_present(block, cs + cpu_state.pc, 8);
|
||||
|
||||
|
||||
@@ -218,6 +218,7 @@ codegen_CALL_FUNC_RESULT(codeblock_t *block, uop_t *uop)
|
||||
static int
|
||||
codegen_CALL_INSTRUCTION_FUNC(codeblock_t *block, uop_t *uop)
|
||||
{
|
||||
host_arm64_mov_imm(block, REG_ARG0, uop->imm_data);
|
||||
host_arm64_call(block, uop->p);
|
||||
host_arm64_CBNZ(block, REG_X0, (uintptr_t) codegen_exit_rout);
|
||||
|
||||
|
||||
@@ -286,6 +286,7 @@ codegen_CALL_FUNC_RESULT(codeblock_t *block, uop_t *uop)
|
||||
static int
|
||||
codegen_CALL_INSTRUCTION_FUNC(codeblock_t *block, uop_t *uop)
|
||||
{
|
||||
host_arm_MOV_IMM(block, REG_ARG0, uop->imm_data);
|
||||
host_arm_call(block, uop->p);
|
||||
host_arm_TST_REG(block, REG_R0, REG_R0);
|
||||
host_arm_BNE(block, (uintptr_t) codegen_exit_rout);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -219,6 +219,11 @@ codegen_CALL_FUNC_RESULT(codeblock_t *block, uop_t *uop)
|
||||
static int
|
||||
codegen_CALL_INSTRUCTION_FUNC(codeblock_t *block, uop_t *uop)
|
||||
{
|
||||
# if _WIN64
|
||||
host_x86_MOV32_REG_IMM(block, REG_ECX, uop->imm_data);
|
||||
# else
|
||||
host_x86_MOV32_REG_IMM(block, REG_EDI, uop->imm_data);
|
||||
# endif
|
||||
host_x86_CALL(block, uop->p);
|
||||
host_x86_TEST32_REG(block, REG_EAX, REG_EAX);
|
||||
host_x86_JNZ(block, codegen_exit_rout);
|
||||
|
||||
@@ -221,6 +221,7 @@ codegen_CALL_FUNC_RESULT(codeblock_t *block, uop_t *uop)
|
||||
static int
|
||||
codegen_CALL_INSTRUCTION_FUNC(codeblock_t *block, uop_t *uop)
|
||||
{
|
||||
host_x86_MOV32_STACK_IMM(block, STACK_ARG0, uop->imm_data);
|
||||
host_x86_CALL(block, uop->p);
|
||||
host_x86_TEST32_REG(block, REG_EAX, REG_EAX);
|
||||
host_x86_JNZ(block, codegen_exit_rout);
|
||||
|
||||
@@ -38,7 +38,7 @@ codegen_ir_set_unroll(int count, int start, int first_instruction)
|
||||
static void
|
||||
duplicate_uop(ir_data_t *ir, uop_t *uop, int offset)
|
||||
{
|
||||
uop_t *new_uop = uop_alloc(ir, uop->type);
|
||||
uop_t *new_uop = uop_alloc_unroll(ir, uop->type);
|
||||
|
||||
if (!ir_reg_is_invalid(uop->src_reg_a))
|
||||
new_uop->src_reg_a = codegen_reg_read(uop->src_reg_a.reg);
|
||||
|
||||
@@ -41,8 +41,8 @@
|
||||
#define UOP_LOAD_FUNC_ARG_2_IMM (UOP_TYPE_PARAMS_IMM | 0x0a | UOP_TYPE_BARRIER)
|
||||
#define UOP_LOAD_FUNC_ARG_3_IMM (UOP_TYPE_PARAMS_IMM | 0x0b | UOP_TYPE_BARRIER)
|
||||
#define UOP_CALL_FUNC (UOP_TYPE_PARAMS_POINTER | 0x10 | UOP_TYPE_BARRIER)
|
||||
/*UOP_CALL_INSTRUCTION_FUNC - call instruction handler at p, check return value and exit block if non-zero*/
|
||||
#define UOP_CALL_INSTRUCTION_FUNC (UOP_TYPE_PARAMS_POINTER | 0x11 | UOP_TYPE_BARRIER)
|
||||
/*UOP_CALL_INSTRUCTION_FUNC - call instruction handler at p with fetchdat, check return value and exit block if non-zero*/
|
||||
#define UOP_CALL_INSTRUCTION_FUNC (UOP_TYPE_PARAMS_POINTER | UOP_TYPE_PARAMS_IMM | 0x11 | UOP_TYPE_BARRIER)
|
||||
#define UOP_STORE_P_IMM (UOP_TYPE_PARAMS_IMM | 0x12)
|
||||
#define UOP_STORE_P_IMM_8 (UOP_TYPE_PARAMS_IMM | 0x13)
|
||||
/*UOP_LOAD_SEG - load segment in src_reg_a to segment p via loadseg(), check return value and exit block if non-zero*/
|
||||
@@ -377,6 +377,34 @@ uop_alloc(ir_data_t *ir, uint32_t uop_type)
|
||||
uop->jump_dest_uop = -1;
|
||||
uop->jump_list_next = -1;
|
||||
|
||||
if (uop_type & (UOP_TYPE_BARRIER | UOP_TYPE_ORDER_BARRIER))
|
||||
dirty_ir_regs[0] = dirty_ir_regs[1] = ~0ULL;
|
||||
|
||||
return uop;
|
||||
}
|
||||
|
||||
static inline uop_t *
|
||||
uop_alloc_unroll(ir_data_t *ir, uint32_t uop_type)
|
||||
{
|
||||
uop_t *uop;
|
||||
|
||||
if (ir->wr_pos >= UOP_NR_MAX)
|
||||
fatal("Exceeded uOP max\n");
|
||||
|
||||
uop = &ir->uops[ir->wr_pos++];
|
||||
|
||||
uop->is_a16 = 0;
|
||||
|
||||
uop->dest_reg_a = invalid_ir_reg;
|
||||
uop->src_reg_a = invalid_ir_reg;
|
||||
uop->src_reg_b = invalid_ir_reg;
|
||||
uop->src_reg_c = invalid_ir_reg;
|
||||
|
||||
uop->pc = cpu_state.oldpc;
|
||||
|
||||
uop->jump_dest_uop = -1;
|
||||
uop->jump_list_next = -1;
|
||||
|
||||
if (uop_type & (UOP_TYPE_BARRIER | UOP_TYPE_ORDER_BARRIER))
|
||||
codegen_reg_mark_as_required();
|
||||
|
||||
@@ -662,7 +690,7 @@ uop_gen_reg_src2_pointer(uint32_t uop_type, ir_data_t *ir, int src_reg_a, int sr
|
||||
|
||||
#define uop_CALL_FUNC(ir, p) uop_gen_pointer(UOP_CALL_FUNC, ir, p)
|
||||
#define uop_CALL_FUNC_RESULT(ir, dst_reg, p) uop_gen_reg_dst_pointer(UOP_CALL_FUNC_RESULT, ir, dst_reg, p)
|
||||
#define uop_CALL_INSTRUCTION_FUNC(ir, p) uop_gen_pointer(UOP_CALL_INSTRUCTION_FUNC, ir, p)
|
||||
#define uop_CALL_INSTRUCTION_FUNC(ir, p, imm) uop_gen_pointer_imm(UOP_CALL_INSTRUCTION_FUNC, ir, p, imm)
|
||||
|
||||
#define uop_CMP_IMM_JZ(ir, src_reg, imm, p) uop_gen_reg_src_pointer_imm(UOP_CMP_IMM_JZ, ir, src_reg, p, imm)
|
||||
|
||||
|
||||
@@ -34,6 +34,8 @@ typedef struct host_reg_set_t {
|
||||
static host_reg_set_t host_reg_set;
|
||||
static host_reg_set_t host_fp_reg_set;
|
||||
|
||||
uint64_t dirty_ir_regs[2] = { 0, 0 };
|
||||
|
||||
enum {
|
||||
REG_BYTE,
|
||||
REG_WORD,
|
||||
@@ -184,15 +186,36 @@ struct
|
||||
[IREG_temp1d] = { REG_DOUBLE, (void *) 48, REG_FP, REG_VOLATILE },
|
||||
};
|
||||
|
||||
static const uint8_t native_requested_sizes[9][8] =
|
||||
{
|
||||
[REG_BYTE][IREG_SIZE_B >> IREG_SIZE_SHIFT] = 1,
|
||||
[REG_FPU_ST_BYTE][IREG_SIZE_B >> IREG_SIZE_SHIFT] = 1,
|
||||
[REG_WORD][IREG_SIZE_W >> IREG_SIZE_SHIFT] = 1,
|
||||
[REG_DWORD][IREG_SIZE_L >> IREG_SIZE_SHIFT] = 1,
|
||||
[REG_QWORD][IREG_SIZE_D >> IREG_SIZE_SHIFT] = 1,
|
||||
[REG_FPU_ST_QWORD][IREG_SIZE_D >> IREG_SIZE_SHIFT] = 1,
|
||||
[REG_DOUBLE][IREG_SIZE_D >> IREG_SIZE_SHIFT] = 1,
|
||||
[REG_FPU_ST_DOUBLE][IREG_SIZE_D >> IREG_SIZE_SHIFT] = 1,
|
||||
[REG_QWORD][IREG_SIZE_Q >> IREG_SIZE_SHIFT] = 1,
|
||||
[REG_FPU_ST_QWORD][IREG_SIZE_Q >> IREG_SIZE_SHIFT] = 1,
|
||||
[REG_DOUBLE][IREG_SIZE_Q >> IREG_SIZE_SHIFT] = 1,
|
||||
[REG_FPU_ST_DOUBLE][IREG_SIZE_Q >> IREG_SIZE_SHIFT] = 1,
|
||||
|
||||
[REG_POINTER][(sizeof(void *) == 4) ? (IREG_SIZE_L >> IREG_SIZE_SHIFT) : (IREG_SIZE_Q >> IREG_SIZE_SHIFT)] = 1
|
||||
};
|
||||
|
||||
void
|
||||
codegen_reg_mark_as_required(void)
|
||||
{
|
||||
for (uint8_t reg = 0; reg < IREG_COUNT; reg++) {
|
||||
/* This used to start from IREG_EAX, now only starts from IREG_ESP since the first 4 registers are never optimized out. */
|
||||
/* It also no longer iterates through volatile registers unnecessarily. */
|
||||
for (uint8_t reg = IREG_ESP; reg < IREG_temp0; reg++) {
|
||||
int last_version = reg_last_version[reg];
|
||||
|
||||
if (last_version > 0 && ireg_data[reg].is_volatile == REG_PERMANENT)
|
||||
if (last_version > 0)
|
||||
reg_version[reg][last_version].flags |= REG_FLAGS_REQUIRED;
|
||||
}
|
||||
dirty_ir_regs[0] = dirty_ir_regs[1] = 0;
|
||||
}
|
||||
|
||||
int
|
||||
@@ -201,29 +224,7 @@ reg_is_native_size(ir_reg_t ir_reg)
|
||||
int native_size = ireg_data[IREG_GET_REG(ir_reg.reg)].native_size;
|
||||
int requested_size = IREG_GET_SIZE(ir_reg.reg);
|
||||
|
||||
switch (native_size) {
|
||||
case REG_BYTE:
|
||||
case REG_FPU_ST_BYTE:
|
||||
return (requested_size == IREG_SIZE_B);
|
||||
case REG_WORD:
|
||||
return (requested_size == IREG_SIZE_W);
|
||||
case REG_DWORD:
|
||||
return (requested_size == IREG_SIZE_L);
|
||||
case REG_QWORD:
|
||||
case REG_FPU_ST_QWORD:
|
||||
case REG_DOUBLE:
|
||||
case REG_FPU_ST_DOUBLE:
|
||||
return ((requested_size == IREG_SIZE_D) || (requested_size == IREG_SIZE_Q));
|
||||
case REG_POINTER:
|
||||
if (sizeof(void *) == 4)
|
||||
return (requested_size == IREG_SIZE_L);
|
||||
return (requested_size == IREG_SIZE_Q);
|
||||
|
||||
default:
|
||||
fatal("get_reg_is_native_size: unknown native size %i\n", native_size);
|
||||
}
|
||||
|
||||
return 0;
|
||||
return native_requested_sizes[native_size][requested_size >> IREG_SIZE_SHIFT];
|
||||
}
|
||||
|
||||
void
|
||||
@@ -256,6 +257,8 @@ codegen_reg_reset(void)
|
||||
host_fp_reg_set.locked = 0;
|
||||
host_fp_reg_set.nr_regs = CODEGEN_HOST_FP_REGS;
|
||||
|
||||
dirty_ir_regs[0] = dirty_ir_regs[1] = 0;
|
||||
|
||||
for (c = 0; c < IREG_COUNT; c++) {
|
||||
reg_last_version[c] = 0;
|
||||
reg_version[c][0].refcount = 0;
|
||||
|
||||
@@ -16,59 +16,45 @@
|
||||
#define IREG_SIZE_Q (5 << IREG_SIZE_SHIFT)
|
||||
|
||||
enum {
|
||||
IREG_EAX = 0,
|
||||
IREG_ECX = 1,
|
||||
IREG_EDX = 2,
|
||||
IREG_EBX = 3,
|
||||
IREG_ESP = 4,
|
||||
IREG_EBP = 5,
|
||||
IREG_ESI = 6,
|
||||
IREG_EDI = 7,
|
||||
IREG_EAX,
|
||||
IREG_ECX,
|
||||
IREG_EDX,
|
||||
IREG_EBX,
|
||||
IREG_ESP,
|
||||
IREG_EBP,
|
||||
IREG_ESI,
|
||||
IREG_EDI,
|
||||
|
||||
IREG_flags_op = 8,
|
||||
IREG_flags_res = 9,
|
||||
IREG_flags_op1 = 10,
|
||||
IREG_flags_op2 = 11,
|
||||
IREG_flags_op,
|
||||
IREG_flags_res,
|
||||
IREG_flags_op1,
|
||||
IREG_flags_op2,
|
||||
|
||||
IREG_pc = 12,
|
||||
IREG_oldpc = 13,
|
||||
IREG_pc,
|
||||
IREG_oldpc,
|
||||
|
||||
IREG_eaaddr = 14,
|
||||
IREG_ea_seg = 15,
|
||||
IREG_op32 = 16,
|
||||
IREG_ssegsx = 17,
|
||||
IREG_eaaddr,
|
||||
IREG_ea_seg,
|
||||
IREG_op32,
|
||||
IREG_ssegsx,
|
||||
|
||||
IREG_rm_mod_reg = 18,
|
||||
IREG_rm_mod_reg,
|
||||
|
||||
IREG_acycs = 19,
|
||||
IREG_cycles = 20,
|
||||
IREG_cycles,
|
||||
|
||||
IREG_CS_base = 21,
|
||||
IREG_DS_base = 22,
|
||||
IREG_ES_base = 23,
|
||||
IREG_FS_base = 24,
|
||||
IREG_GS_base = 25,
|
||||
IREG_SS_base = 26,
|
||||
IREG_CS_base,
|
||||
IREG_DS_base,
|
||||
IREG_ES_base,
|
||||
IREG_FS_base,
|
||||
IREG_GS_base,
|
||||
IREG_SS_base,
|
||||
|
||||
IREG_CS_seg = 27,
|
||||
IREG_DS_seg = 28,
|
||||
IREG_ES_seg = 29,
|
||||
IREG_FS_seg = 30,
|
||||
IREG_GS_seg = 31,
|
||||
IREG_SS_seg = 32,
|
||||
|
||||
/*Temporary registers are stored on the stack, and are not guaranteed to
|
||||
be preserved across uOPs. They will not be written back if they will
|
||||
not be read again.*/
|
||||
IREG_temp0 = 33,
|
||||
IREG_temp1 = 34,
|
||||
IREG_temp2 = 35,
|
||||
IREG_temp3 = 36,
|
||||
|
||||
IREG_FPU_TOP = 37,
|
||||
|
||||
IREG_temp0d = 38,
|
||||
IREG_temp1d = 39,
|
||||
IREG_CS_seg,
|
||||
IREG_DS_seg,
|
||||
IREG_ES_seg,
|
||||
IREG_FS_seg,
|
||||
IREG_GS_seg,
|
||||
IREG_SS_seg,
|
||||
|
||||
/*FPU stack registers are physical registers. Use IREG_ST() / IREG_tag()
|
||||
to access.
|
||||
@@ -76,66 +62,79 @@ enum {
|
||||
used directly to index the stack. When it is clear, the difference
|
||||
between the current value of TOP and the value when the block was
|
||||
first compiled will be added to adjust for any changes in TOP.*/
|
||||
IREG_ST0 = 40,
|
||||
IREG_ST1 = 41,
|
||||
IREG_ST2 = 42,
|
||||
IREG_ST3 = 43,
|
||||
IREG_ST4 = 44,
|
||||
IREG_ST5 = 45,
|
||||
IREG_ST6 = 46,
|
||||
IREG_ST7 = 47,
|
||||
IREG_ST0,
|
||||
IREG_ST1,
|
||||
IREG_ST2,
|
||||
IREG_ST3,
|
||||
IREG_ST4,
|
||||
IREG_ST5,
|
||||
IREG_ST6,
|
||||
IREG_ST7,
|
||||
|
||||
IREG_tag0 = 48,
|
||||
IREG_tag1 = 49,
|
||||
IREG_tag2 = 50,
|
||||
IREG_tag3 = 51,
|
||||
IREG_tag4 = 52,
|
||||
IREG_tag5 = 53,
|
||||
IREG_tag6 = 54,
|
||||
IREG_tag7 = 55,
|
||||
IREG_tag0,
|
||||
IREG_tag1,
|
||||
IREG_tag2,
|
||||
IREG_tag3,
|
||||
IREG_tag4,
|
||||
IREG_tag5,
|
||||
IREG_tag6,
|
||||
IREG_tag7,
|
||||
|
||||
IREG_ST0_i64 = 56,
|
||||
IREG_ST1_i64 = 57,
|
||||
IREG_ST2_i64 = 58,
|
||||
IREG_ST3_i64 = 59,
|
||||
IREG_ST4_i64 = 60,
|
||||
IREG_ST5_i64 = 61,
|
||||
IREG_ST6_i64 = 62,
|
||||
IREG_ST7_i64 = 63,
|
||||
IREG_ST0_i64,
|
||||
IREG_ST1_i64,
|
||||
IREG_ST2_i64,
|
||||
IREG_ST3_i64,
|
||||
IREG_ST4_i64,
|
||||
IREG_ST5_i64,
|
||||
IREG_ST6_i64,
|
||||
IREG_ST7_i64,
|
||||
|
||||
IREG_MM0x = 64,
|
||||
IREG_MM1x = 65,
|
||||
IREG_MM2x = 66,
|
||||
IREG_MM3x = 67,
|
||||
IREG_MM4x = 68,
|
||||
IREG_MM5x = 69,
|
||||
IREG_MM6x = 70,
|
||||
IREG_MM7x = 71,
|
||||
IREG_MM0x,
|
||||
IREG_MM1x,
|
||||
IREG_MM2x,
|
||||
IREG_MM3x,
|
||||
IREG_MM4x,
|
||||
IREG_MM5x,
|
||||
IREG_MM6x,
|
||||
IREG_MM7x,
|
||||
|
||||
IREG_NPXCx = 72,
|
||||
IREG_NPXSx = 73,
|
||||
IREG_NPXCx,
|
||||
IREG_NPXSx,
|
||||
|
||||
IREG_flagsx = 74,
|
||||
IREG_eflagsx = 75,
|
||||
IREG_flagsx,
|
||||
IREG_eflagsx,
|
||||
|
||||
IREG_CS_limit_low = 76,
|
||||
IREG_DS_limit_low = 77,
|
||||
IREG_ES_limit_low = 78,
|
||||
IREG_FS_limit_low = 79,
|
||||
IREG_GS_limit_low = 80,
|
||||
IREG_SS_limit_low = 81,
|
||||
IREG_CS_limit_low,
|
||||
IREG_DS_limit_low,
|
||||
IREG_ES_limit_low,
|
||||
IREG_FS_limit_low,
|
||||
IREG_GS_limit_low,
|
||||
IREG_SS_limit_low,
|
||||
|
||||
IREG_CS_limit_high = 82,
|
||||
IREG_DS_limit_high = 83,
|
||||
IREG_ES_limit_high = 84,
|
||||
IREG_FS_limit_high = 85,
|
||||
IREG_GS_limit_high = 86,
|
||||
IREG_SS_limit_high = 87,
|
||||
IREG_CS_limit_high,
|
||||
IREG_DS_limit_high,
|
||||
IREG_ES_limit_high,
|
||||
IREG_FS_limit_high,
|
||||
IREG_GS_limit_high,
|
||||
IREG_SS_limit_high,
|
||||
|
||||
IREG_eaa16 = 88,
|
||||
IREG_x87_op = 89,
|
||||
IREG_eaa16,
|
||||
IREG_x87_op,
|
||||
|
||||
IREG_COUNT = 90,
|
||||
IREG_FPU_TOP,
|
||||
|
||||
/*Temporary registers are stored on the stack, and are not guaranteed to
|
||||
be preserved across uOPs. They will not be written back if they will
|
||||
not be read again.*/
|
||||
IREG_temp0,
|
||||
IREG_temp1,
|
||||
IREG_temp2,
|
||||
IREG_temp3,
|
||||
|
||||
IREG_temp0d,
|
||||
IREG_temp1d,
|
||||
|
||||
IREG_COUNT,
|
||||
|
||||
IREG_INVALID = 255,
|
||||
|
||||
@@ -279,6 +278,7 @@ ireg_seg_limit_high(x86seg *seg)
|
||||
}
|
||||
|
||||
extern uint8_t reg_last_version[IREG_COUNT];
|
||||
extern uint64_t dirty_ir_regs[2];
|
||||
|
||||
/*This version of the register must be calculated, regardless of whether it is
|
||||
apparently required or not. Do not optimise out.*/
|
||||
@@ -363,10 +363,12 @@ codegen_reg_write(int reg, int uop_nr)
|
||||
int last_version = reg_last_version[IREG_GET_REG(reg)];
|
||||
reg_version_t *version;
|
||||
|
||||
#ifndef RELEASE_BUILD
|
||||
if (IREG_GET_REG(reg) == IREG_INVALID)
|
||||
fatal("codegen_reg_write - IREG_INVALID\n");
|
||||
#endif
|
||||
if (dirty_ir_regs[(IREG_GET_REG(reg) >> 6) & 3] & (1ull << ((uint64_t)IREG_GET_REG(reg) & 0x3full))) {
|
||||
dirty_ir_regs[(IREG_GET_REG(reg) >> 6) & 3] &= ~(1ull << ((uint64_t)IREG_GET_REG(reg) & 0x3full));
|
||||
if ((IREG_GET_REG(reg) > IREG_EBX && IREG_GET_REG(reg) < IREG_temp0) && last_version > 0) {
|
||||
reg_version[IREG_GET_REG(reg)][last_version].flags |= REG_FLAGS_REQUIRED;
|
||||
}
|
||||
}
|
||||
ireg.reg = reg;
|
||||
ireg.version = last_version + 1;
|
||||
|
||||
@@ -376,12 +378,8 @@ codegen_reg_write(int reg, int uop_nr)
|
||||
}
|
||||
|
||||
reg_last_version[IREG_GET_REG(reg)]++;
|
||||
#ifndef RELEASE_BUILD
|
||||
if (!reg_last_version[IREG_GET_REG(reg)])
|
||||
fatal("codegen_reg_write - version overflow\n");
|
||||
else
|
||||
#endif
|
||||
if (reg_last_version[IREG_GET_REG(reg)] > REG_VERSION_MAX)
|
||||
|
||||
if (reg_last_version[IREG_GET_REG(reg)] > REG_VERSION_MAX)
|
||||
CPU_BLOCK_END();
|
||||
if (reg_last_version[IREG_GET_REG(reg)] > max_version_refcount)
|
||||
max_version_refcount = reg_last_version[IREG_GET_REG(reg)];
|
||||
|
||||
60
src/config.c
60
src/config.c
@@ -144,6 +144,8 @@ load_general(void)
|
||||
video_grayscale = ini_section_get_int(cat, "video_grayscale", 0);
|
||||
video_graytype = ini_section_get_int(cat, "video_graytype", 0);
|
||||
|
||||
force_10ms = !!ini_section_get_int(cat, "force_10ms", 0);
|
||||
|
||||
rctrl_is_lalt = ini_section_get_int(cat, "rctrl_is_lalt", 0);
|
||||
update_icons = ini_section_get_int(cat, "update_icons", 1);
|
||||
|
||||
@@ -263,7 +265,9 @@ load_machine(void)
|
||||
if (p != NULL) {
|
||||
migrate_from = p;
|
||||
/* Migrate renamed machines. */
|
||||
if (!strcmp(p, "430nx"))
|
||||
if (!strcmp(p, "tandy"))
|
||||
machine = machine_get_machine_from_internal_name("tandy1000sx");
|
||||
else if (!strcmp(p, "430nx"))
|
||||
machine = machine_get_machine_from_internal_name("586ip");
|
||||
else if (!strcmp(p, "586mc1"))
|
||||
machine = machine_get_machine_from_internal_name("586is");
|
||||
@@ -658,9 +662,9 @@ load_network(void)
|
||||
nc->net_type = NET_TYPE_PCAP;
|
||||
else if (!strcmp(p, "slirp") || !strcmp(p, "2"))
|
||||
nc->net_type = NET_TYPE_SLIRP;
|
||||
else if (!strcmp(p, "vde") || !strcmp(p, "2"))
|
||||
else if (!strcmp(p, "vde") || !strcmp(p, "3"))
|
||||
nc->net_type = NET_TYPE_VDE;
|
||||
else if (!strcmp(p, "tap") || !strcmp(p, "3"))
|
||||
else if (!strcmp(p, "tap") || !strcmp(p, "4"))
|
||||
nc->net_type = NET_TYPE_TAP;
|
||||
else
|
||||
nc->net_type = NET_TYPE_NONE;
|
||||
@@ -706,9 +710,9 @@ load_network(void)
|
||||
nc->net_type = NET_TYPE_PCAP;
|
||||
else if (!strcmp(p, "slirp") || !strcmp(p, "2"))
|
||||
nc->net_type = NET_TYPE_SLIRP;
|
||||
else if (!strcmp(p, "vde") || !strcmp(p, "2"))
|
||||
else if (!strcmp(p, "vde") || !strcmp(p, "3"))
|
||||
nc->net_type = NET_TYPE_VDE;
|
||||
else if (!strcmp(p, "tap") || !strcmp(p, "3"))
|
||||
else if (!strcmp(p, "tap") || !strcmp(p, "4"))
|
||||
nc->net_type = NET_TYPE_TAP;
|
||||
else
|
||||
nc->net_type = NET_TYPE_NONE;
|
||||
@@ -990,11 +994,6 @@ load_storage_controllers(void)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
lba_enhancer_enabled = !!ini_section_get_int(cat, "lba_enhancer_enabled", 0);
|
||||
|
||||
if (!lba_enhancer_enabled)
|
||||
ini_section_delete_var(cat, "lba_enhancer_enabled");
|
||||
}
|
||||
|
||||
/* Load "Hard Disks" section. */
|
||||
@@ -1211,14 +1210,20 @@ load_floppy_and_cdrom_drives(void)
|
||||
unsigned int board = 0;
|
||||
unsigned int dev = 0;
|
||||
int c;
|
||||
int d = 0;
|
||||
int d;
|
||||
int count = cdrom_get_type_count();
|
||||
|
||||
memset(temp, 0x00, sizeof(temp));
|
||||
for (c = 0; c < FDD_NUM; c++) {
|
||||
sprintf(temp, "fdd_%02i_type", c + 1);
|
||||
p = ini_section_get_string(cat, temp, (c < 2) ? "525_2dd" : "none");
|
||||
fdd_set_type(c, fdd_get_from_internal_name(p));
|
||||
if (!strcmp(p, "525_2hd_ps2"))
|
||||
d = fdd_get_from_internal_name("525_2hd");
|
||||
else if (!strcmp(p, "35_2hd_ps2"))
|
||||
d = fdd_get_from_internal_name("35_2hd");
|
||||
else
|
||||
d = fdd_get_from_internal_name(p);
|
||||
fdd_set_type(c, d);
|
||||
if (fdd_get_type(c) > 13)
|
||||
fdd_set_type(c, 13);
|
||||
|
||||
@@ -1297,6 +1302,7 @@ load_floppy_and_cdrom_drives(void)
|
||||
ini_section_delete_var(cat, temp);
|
||||
|
||||
sprintf(temp, "cdrom_%02i_parameters", c + 1);
|
||||
d = 0;
|
||||
p = ini_section_get_string(cat, temp, NULL);
|
||||
if (p != NULL)
|
||||
sscanf(p, "%01u, %s", &d, s);
|
||||
@@ -1725,6 +1731,17 @@ load_other_peripherals(void)
|
||||
ini_section_delete_var(cat, temp);
|
||||
}
|
||||
|
||||
/* Backwards compatibility for standalone LBA Enhancer from v4.2 and older. */
|
||||
if (ini_section_get_int(ini_find_section(config, "Storage controllers"), "lba_enhancer_enabled", 0) == 1) {
|
||||
/* Migrate to the first available ISA ROM slot. */
|
||||
for (uint8_t c = 0; c < ISAROM_MAX; c++) {
|
||||
if (!isarom_type[c]) {
|
||||
isarom_type[c] = isarom_get_from_internal_name("lba_enhancer");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
p = ini_section_get_string(cat, "isartc_type", "none");
|
||||
isartc_type = isartc_get_from_internal_name(p);
|
||||
|
||||
@@ -1947,6 +1964,10 @@ save_general(void)
|
||||
|
||||
const char *va_name;
|
||||
|
||||
ini_section_set_int(cat, "force_10ms", force_10ms);
|
||||
if (force_10ms == 0)
|
||||
ini_section_delete_var(cat, "force_10ms");
|
||||
|
||||
ini_section_set_int(cat, "inhibit_multimedia_keys", inhibit_multimedia_keys);
|
||||
if (inhibit_multimedia_keys == 0)
|
||||
ini_section_delete_var(cat, "inhibit_multimedia_keys");
|
||||
@@ -2691,10 +2712,19 @@ save_storage_controllers(void)
|
||||
}
|
||||
}
|
||||
|
||||
if (lba_enhancer_enabled == 0)
|
||||
/* Downgrade compatibility for standalone LBA Enhancer from v4.2 and older. */
|
||||
int card_id = isarom_get_from_internal_name("lba_enhancer");
|
||||
for (c = 0; c < ISAROM_MAX; c++) {
|
||||
if (isarom_type[c] == card_id) {
|
||||
/* A special value of 2 still enables the cards on older versions,
|
||||
but lets newer versions know that they've already been migrated. */
|
||||
ini_section_set_int(cat, "lba_enhancer_enabled", 2);
|
||||
card_id = 0; /* mark as found */
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (card_id > 0) /* not found */
|
||||
ini_section_delete_var(cat, "lba_enhancer_enabled");
|
||||
else
|
||||
ini_section_set_int(cat, "lba_enhancer_enabled", 1);
|
||||
|
||||
ini_delete_section_if_empty(config, cat);
|
||||
}
|
||||
|
||||
@@ -739,7 +739,7 @@ exec386_dynarec(int32_t cycs)
|
||||
uint64_t oldtsc;
|
||||
uint64_t delta;
|
||||
|
||||
int32_t cyc_period = cycs / 2000; /*5us*/
|
||||
int32_t cyc_period = cycs / (force_10ms ? 2000 : 200); /*5us*/
|
||||
|
||||
# ifdef USE_ACYCS
|
||||
acycs = 0;
|
||||
|
||||
@@ -1226,22 +1226,24 @@ custom_nmi(void)
|
||||
}
|
||||
|
||||
static int
|
||||
irq_pending(void)
|
||||
irq_pending(int nec_hlt)
|
||||
{
|
||||
uint8_t temp;
|
||||
int i_flag = (cpu_state.flags & I_FLAG) || nec_hlt;
|
||||
|
||||
temp = (nmi && nmi_enable && nmi_mask) || ((cpu_state.flags & T_FLAG) && !noint) || ((cpu_state.flags & I_FLAG) && pic.int_pending && !noint);
|
||||
temp = (nmi && nmi_enable && nmi_mask) || ((cpu_state.flags & T_FLAG) && !noint) || (i_flag && pic.int_pending && !noint);
|
||||
|
||||
return temp;
|
||||
}
|
||||
|
||||
static void
|
||||
check_interrupts(void)
|
||||
check_interrupts(int nec_hlt)
|
||||
{
|
||||
int temp;
|
||||
int i_flag = (cpu_state.flags & I_FLAG) || nec_hlt;
|
||||
|
||||
if (irq_pending()) {
|
||||
if ((cpu_state.flags & T_FLAG) && !noint) {
|
||||
if (irq_pending(nec_hlt)) {
|
||||
if ((cpu_state.flags & T_FLAG) && !(noint & 1)) {
|
||||
interrupt(1);
|
||||
return;
|
||||
}
|
||||
@@ -1256,7 +1258,7 @@ check_interrupts(void)
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
if ((cpu_state.flags & I_FLAG) && pic.int_pending && !noint) {
|
||||
if (i_flag && pic.int_pending && !noint) {
|
||||
repeating = 0;
|
||||
completed = 1;
|
||||
ovr_seg = NULL;
|
||||
@@ -1289,7 +1291,7 @@ rep_action(int bits)
|
||||
return 0;
|
||||
wait_cycs(2, 0);
|
||||
t = CX;
|
||||
if (irq_pending() && (repeating != 0)) {
|
||||
if (irq_pending(0) && (repeating != 0)) {
|
||||
access(71, bits);
|
||||
pfq_clear();
|
||||
if (is_nec && (ovr_seg != NULL))
|
||||
@@ -3008,9 +3010,9 @@ execx86(int cycs)
|
||||
wait_cycs(2, 0);
|
||||
wait_cycs(5, 0);
|
||||
#ifdef NO_HACK
|
||||
if (irq_pending()) {
|
||||
if (irq_pending(0)) {
|
||||
wait_cycs(7, 0);
|
||||
check_interrupts();
|
||||
check_interrupts(0);
|
||||
} else {
|
||||
repeating = 1;
|
||||
completed = 0;
|
||||
@@ -3018,7 +3020,7 @@ execx86(int cycs)
|
||||
}
|
||||
#else
|
||||
wait_cycs(7, 0);
|
||||
check_interrupts();
|
||||
check_interrupts(0);
|
||||
#endif
|
||||
break;
|
||||
case 0x9C: /*PUSHF*/
|
||||
@@ -3029,16 +3031,19 @@ execx86(int cycs)
|
||||
tempw = (cpu_state.flags & 0x0fd7) | 0xf000;
|
||||
push(&tempw);
|
||||
break;
|
||||
case 0x9D: /*POPF*/
|
||||
case 0x9D: { /*POPF*/
|
||||
uint16_t old_flags = cpu_state.flags;
|
||||
access(25, 16);
|
||||
if (is_nec && cpu_md_write_disable)
|
||||
cpu_state.flags = pop() | 0x8002;
|
||||
else
|
||||
cpu_state.flags = pop() | 0x0002;
|
||||
wait_cycs(1, 0);
|
||||
if ((old_flags ^ cpu_state.flags) & T_FLAG)
|
||||
noint = 1;
|
||||
sync_to_i8080();
|
||||
break;
|
||||
case 0x9E: /*SAHF*/
|
||||
} case 0x9E: /*SAHF*/
|
||||
wait_cycs(1, 0);
|
||||
cpu_state.flags = (cpu_state.flags & 0xff02) | AH;
|
||||
wait_cycs(2, 0);
|
||||
@@ -3307,7 +3312,7 @@ execx86(int cycs)
|
||||
else
|
||||
cpu_state.flags = pop() | 0x0002;
|
||||
wait_cycs(5, 0);
|
||||
noint = 1;
|
||||
noint = 2;
|
||||
nmi_enable = 1;
|
||||
if (is_nec && !(cpu_state.flags & MD_FLAG))
|
||||
sync_to_i8080();
|
||||
@@ -3647,9 +3652,9 @@ execx86(int cycs)
|
||||
pfq_clear();
|
||||
}
|
||||
wait_cycs(1, 0);
|
||||
if (irq_pending()) {
|
||||
if (irq_pending(is_nec)) {
|
||||
wait_cycs(cycles & 1, 0);
|
||||
check_interrupts();
|
||||
check_interrupts(is_nec);
|
||||
} else {
|
||||
repeating = 1;
|
||||
completed = 0;
|
||||
@@ -3848,7 +3853,7 @@ exec_completed:
|
||||
if (in_lock)
|
||||
clear_lock = 1;
|
||||
clock_end();
|
||||
check_interrupts();
|
||||
check_interrupts(0);
|
||||
|
||||
if (noint)
|
||||
noint = 0;
|
||||
|
||||
@@ -688,6 +688,23 @@ const cpu_family_t cpu_families[] = {
|
||||
.cache_write_cycles = 0,
|
||||
.atclk_div = 1
|
||||
},
|
||||
{
|
||||
.name = "8",
|
||||
.cpu_type = CPU_V20,
|
||||
.fpus = fpus_8088,
|
||||
.rspeed = 8000000,
|
||||
.multi = 1,
|
||||
.voltage = 5000,
|
||||
.edx_reset = 0,
|
||||
.cpuid_model = 0,
|
||||
.cyrix_id = 0,
|
||||
.cpu_flags = 0,
|
||||
.mem_read_cycles = 0,
|
||||
.mem_write_cycles = 0,
|
||||
.cache_read_cycles = 0,
|
||||
.cache_write_cycles = 0,
|
||||
.atclk_div = 1
|
||||
},
|
||||
{
|
||||
.name = "10",
|
||||
.cpu_type = CPU_V20,
|
||||
@@ -911,10 +928,10 @@ const cpu_family_t cpu_families[] = {
|
||||
.internal_name = "necv30",
|
||||
.cpus = (const CPU[]) {
|
||||
{
|
||||
.name = "5",
|
||||
.name = "7.16",
|
||||
.cpu_type = CPU_V30,
|
||||
.fpus = fpus_80186,
|
||||
.rspeed = 5000000,
|
||||
.rspeed = 7159092,
|
||||
.multi = 1,
|
||||
.voltage = 5000,
|
||||
.edx_reset = 0,
|
||||
@@ -944,6 +961,23 @@ const cpu_family_t cpu_families[] = {
|
||||
.cache_write_cycles = 0,
|
||||
.atclk_div = 1
|
||||
},
|
||||
{
|
||||
.name = "9.54",
|
||||
.cpu_type = CPU_V30,
|
||||
.fpus = fpus_80186,
|
||||
.rspeed = 9545456,
|
||||
.multi = 1,
|
||||
.voltage = 5000,
|
||||
.edx_reset = 0,
|
||||
.cpuid_model = 0,
|
||||
.cyrix_id = 0,
|
||||
.cpu_flags = 0,
|
||||
.mem_read_cycles = 0,
|
||||
.mem_write_cycles = 0,
|
||||
.cache_read_cycles = 0,
|
||||
.cache_write_cycles = 0,
|
||||
.atclk_div = 1
|
||||
},
|
||||
{
|
||||
.name = "10",
|
||||
.cpu_type = CPU_V30,
|
||||
|
||||
@@ -26,9 +26,14 @@
|
||||
#include <86box/nvr.h>
|
||||
#include <86box/isarom.h>
|
||||
|
||||
#define ISAROM_CARD 0
|
||||
#define ISAROM_CARD_DUAL 1
|
||||
#define ISAROM_CARD_QUAD 2
|
||||
enum {
|
||||
ISAROM_CARD = 0,
|
||||
ISAROM_CARD_DUAL,
|
||||
ISAROM_CARD_QUAD,
|
||||
ISAROM_CARD_LBA_ENHANCER
|
||||
};
|
||||
|
||||
#define BIOS_LBA_ENHANCER "roms/hdd/misc/lbaenhancer.bin"
|
||||
|
||||
#ifdef ENABLE_ISAROM_LOG
|
||||
int isarom_do_log = ENABLE_ISAROM_LOG;
|
||||
@@ -56,7 +61,7 @@ typedef struct isarom_t {
|
||||
uint32_t size;
|
||||
uint32_t len;
|
||||
char nvr_path[64];
|
||||
uint8_t wp;
|
||||
uint8_t writable;
|
||||
} socket[4];
|
||||
uint8_t inst;
|
||||
uint8_t type;
|
||||
@@ -65,11 +70,14 @@ typedef struct isarom_t {
|
||||
static inline uint8_t
|
||||
get_limit(uint8_t type)
|
||||
{
|
||||
if (type == ISAROM_CARD_DUAL)
|
||||
return 2;
|
||||
if (type == ISAROM_CARD_QUAD)
|
||||
return 4;
|
||||
return 1;
|
||||
switch (type) {
|
||||
case ISAROM_CARD_DUAL:
|
||||
return 2;
|
||||
case ISAROM_CARD_QUAD:
|
||||
return 4;
|
||||
default:
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
static inline void
|
||||
@@ -92,12 +100,13 @@ isarom_close(void *priv)
|
||||
if (!priv)
|
||||
return;
|
||||
|
||||
for (uint8_t i = 0; i < get_limit(dev->type); i++)
|
||||
if (dev->socket[i].rom.rom) {
|
||||
for (uint8_t i = 0; i < get_limit(dev->type); i++) {
|
||||
if (dev->socket[i].writable) {
|
||||
isarom_log("isarom[%u]: saving NVR for socket %u -> %s (%u bytes)\n",
|
||||
dev->inst, i, dev->socket[i].nvr_path, dev->socket[i].size);
|
||||
isarom_save_nvr(dev->socket[i].nvr_path, dev->socket[i].rom.rom, dev->socket[i].size);
|
||||
}
|
||||
}
|
||||
|
||||
free(dev);
|
||||
}
|
||||
@@ -115,32 +124,42 @@ isarom_init(const device_t *info)
|
||||
isarom_log("isarom[%u]: initializing device (type=%u)\n", dev->inst, dev->type);
|
||||
|
||||
for (uint8_t i = 0; i < get_limit(dev->type); i++) {
|
||||
char key_fn[12];
|
||||
char key_addr[14];
|
||||
char key_size[14];
|
||||
char key_writes[22];
|
||||
char str[22];
|
||||
char suffix[4] = "";
|
||||
if (i > 0)
|
||||
snprintf(suffix, sizeof(suffix), "%d", i + 1);
|
||||
|
||||
snprintf(key_fn, sizeof(key_fn), "bios_fn%s", suffix);
|
||||
snprintf(key_addr, sizeof(key_addr), "bios_addr%s", suffix);
|
||||
snprintf(key_size, sizeof(key_size), "bios_size%s", suffix);
|
||||
snprintf(key_writes, sizeof(key_writes), "rom_writes_enabled%s", suffix);
|
||||
snprintf(str, sizeof(str), "bios_addr%s", suffix);
|
||||
dev->socket[i].addr = device_get_config_hex20(str);
|
||||
|
||||
dev->socket[i].fn = device_get_config_string(key_fn);
|
||||
dev->socket[i].addr = device_get_config_hex20(key_addr);
|
||||
dev->socket[i].size = device_get_config_int(key_size);
|
||||
// Note: 2K is the smallest ROM I've found, but 86box's memory granularity is 4k, the number below is fine
|
||||
// as we'll end up allocating no less than 4k due to the device config limits.
|
||||
dev->socket[i].len = (dev->socket[i].size > 2048) ? dev->socket[i].size - 1 : 0;
|
||||
dev->socket[i].wp = (uint8_t) device_get_config_int(key_writes) ? 1 : 0;
|
||||
switch (dev->type) {
|
||||
case ISAROM_CARD_LBA_ENHANCER:
|
||||
dev->socket[i].fn = BIOS_LBA_ENHANCER;
|
||||
dev->socket[i].size = 0x4000;
|
||||
break;
|
||||
|
||||
isarom_log("isarom[%u]: socket %u: addr=0x%05X size=%u wp=%u fn=%s\n",
|
||||
default:
|
||||
snprintf(str, sizeof(str), "bios_fn%s", suffix);
|
||||
dev->socket[i].fn = device_get_config_string(str);
|
||||
|
||||
snprintf(str, sizeof(str), "bios_size%s", suffix);
|
||||
dev->socket[i].size = device_get_config_int(str);
|
||||
|
||||
snprintf(str, sizeof(str), "rom_writes_enabled%s", suffix);
|
||||
if (device_get_config_int(str))
|
||||
dev->socket[i].writable = 1;
|
||||
break;
|
||||
}
|
||||
|
||||
/* Note: 2K is the smallest ROM I've found, but 86Box's memory granularity is 4K, the number
|
||||
below is fine as we'll end up allocating no less than 4K due to the device config limits. */
|
||||
dev->socket[i].len = (dev->socket[i].size > 0) ? ((dev->socket[i].size - 1) | MEM_GRANULARITY_MASK) : 0;
|
||||
|
||||
isarom_log("isarom[%u]: socket %u: addr=0x%05X size=%u writable=%u fn=%s\n",
|
||||
dev->inst, i, dev->socket[i].addr, dev->socket[i].size,
|
||||
dev->socket[i].wp, dev->socket[i].fn ? dev->socket[i].fn : "(null)");
|
||||
dev->socket[i].writable, dev->socket[i].fn ? dev->socket[i].fn : "(null)");
|
||||
|
||||
if (dev->socket[i].addr != 0 && dev->socket[i].fn != NULL) {
|
||||
if ((dev->socket[i].addr != 0) && (dev->socket[i].fn != NULL)) {
|
||||
rom_init(&dev->socket[i].rom,
|
||||
dev->socket[i].fn,
|
||||
dev->socket[i].addr,
|
||||
@@ -151,7 +170,7 @@ isarom_init(const device_t *info)
|
||||
|
||||
isarom_log("isarom[%u]: ROM initialized for socket %u\n", dev->inst, i);
|
||||
|
||||
if (dev->socket[i].wp) {
|
||||
if (dev->socket[i].writable) {
|
||||
mem_mapping_set_write_handler(&dev->socket[i].rom.mapping, rom_write, rom_writew, rom_writel);
|
||||
snprintf(dev->socket[i].nvr_path, sizeof(dev->socket[i].nvr_path), "isarom_%i_%i.nvr", dev->inst, i + 1);
|
||||
FILE *fp = nvr_fopen(dev->socket[i].nvr_path, "rb");
|
||||
@@ -168,6 +187,12 @@ isarom_init(const device_t *info)
|
||||
return dev;
|
||||
}
|
||||
|
||||
static int
|
||||
isarom_lba_enhancer_available(void)
|
||||
{
|
||||
return rom_present(BIOS_LBA_ENHANCER);
|
||||
}
|
||||
|
||||
#define BIOS_FILE_FILTER "ROM files (*.bin *.rom)|*.bin,*.rom"
|
||||
|
||||
#define BIOS_ADDR_SELECTION { \
|
||||
@@ -444,7 +469,7 @@ static const device_config_t isarom_quad_config[] = {
|
||||
.type = CONFIG_FNAME,
|
||||
.default_string = NULL,
|
||||
.default_int = 0,
|
||||
.file_filter = "ROM files (*.bin *.rom)|*.bin,*.rom",
|
||||
.file_filter = BIOS_FILE_FILTER,
|
||||
.spinner = { 0 },
|
||||
.selection = { },
|
||||
.bios = { { 0 } }
|
||||
@@ -528,6 +553,29 @@ static const device_config_t isarom_quad_config[] = {
|
||||
},
|
||||
{ .name = "", .description = "", .type = CONFIG_END }
|
||||
};
|
||||
|
||||
static const device_config_t lba_enhancer_config[] = {
|
||||
{
|
||||
.name = "bios_addr",
|
||||
.description = "BIOS Address",
|
||||
.type = CONFIG_HEX20,
|
||||
.default_string = NULL,
|
||||
.default_int = 0xc8000,
|
||||
.file_filter = NULL,
|
||||
.spinner = { 0 },
|
||||
.selection = {
|
||||
{ .description = "C800H", .value = 0xc8000 },
|
||||
{ .description = "CC00H", .value = 0xcc000 },
|
||||
{ .description = "D000H", .value = 0xd0000 },
|
||||
{ .description = "D400H", .value = 0xd4000 },
|
||||
{ .description = "D800H", .value = 0xd8000 },
|
||||
{ .description = "DC00H", .value = 0xdc000 },
|
||||
{ .description = "" }
|
||||
},
|
||||
.bios = { { 0 } }
|
||||
},
|
||||
{ .name = "", .description = "", .type = CONFIG_END }
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
static const device_t isarom_device = {
|
||||
@@ -572,15 +620,30 @@ static const device_t isarom_quad_device = {
|
||||
.config = isarom_quad_config
|
||||
};
|
||||
|
||||
static const device_t lba_enhancer_device = {
|
||||
.name = "Vision Systems LBA Enhancer",
|
||||
.internal_name = "lba_enhancer",
|
||||
.flags = DEVICE_ISA,
|
||||
.local = ISAROM_CARD_LBA_ENHANCER,
|
||||
.init = isarom_init,
|
||||
.close = isarom_close,
|
||||
.reset = NULL,
|
||||
.available = isarom_lba_enhancer_available,
|
||||
.speed_changed = NULL,
|
||||
.force_redraw = NULL,
|
||||
.config = lba_enhancer_config
|
||||
};
|
||||
|
||||
static const struct {
|
||||
const device_t *dev;
|
||||
} boards[] = {
|
||||
// clang-format off
|
||||
{ &device_none },
|
||||
{ &isarom_device },
|
||||
{ &isarom_dual_device },
|
||||
{ &isarom_quad_device },
|
||||
{ NULL }
|
||||
{ &device_none },
|
||||
{ &isarom_device },
|
||||
{ &isarom_dual_device },
|
||||
{ &isarom_quad_device },
|
||||
{ &lba_enhancer_device },
|
||||
{ NULL }
|
||||
// clang-format on
|
||||
};
|
||||
|
||||
|
||||
@@ -626,34 +626,29 @@ lpt_set_ext(const int port, const uint8_t ext)
|
||||
void
|
||||
lpt_set_ecp(const int port, const uint8_t ecp)
|
||||
{
|
||||
if (lpt_ports[port].enabled) {
|
||||
const uint16_t addr = lpt_ports[port].addr;
|
||||
lpt_port_setup(port, 0xfff);
|
||||
if (lpt_ports[port].enabled)
|
||||
lpt_ports[port].ecp = ecp;
|
||||
lpt_port_setup(port, addr);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
lpt_set_epp(const int port, const uint8_t epp)
|
||||
{
|
||||
if (lpt_ports[port].enabled) {
|
||||
const uint16_t addr = lpt_ports[port].addr;
|
||||
lpt_port_setup(port, 0xfff);
|
||||
if (lpt_ports[port].enabled)
|
||||
lpt_ports[port].epp = epp;
|
||||
lpt_port_setup(port, addr);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
lpt_set_lv2(const int port, const uint8_t lv2)
|
||||
{
|
||||
if (lpt_ports[port].enabled) {
|
||||
const uint16_t addr = lpt_ports[port].addr;
|
||||
lpt_port_setup(port, 0xfff);
|
||||
if (lpt_ports[port].enabled)
|
||||
lpt_ports[port].lv2 = lv2;
|
||||
lpt_port_setup(port, addr);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
lpt_set_fifo_threshold(const int port, const int threshold)
|
||||
{
|
||||
if (lpt_ports[port].enabled)
|
||||
fifo_set_trigger_len(lpt_ports[port].fifo, threshold);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -778,19 +773,19 @@ void
|
||||
lpt_port_setup(const int i, const uint16_t port)
|
||||
{
|
||||
if (lpt_ports[i].enabled) {
|
||||
if (lpt_ports[i].addr != 0xffff) {
|
||||
if ((lpt_ports[i].addr != 0x0000) && (lpt_ports[i].addr != 0xffff)) {
|
||||
io_removehandler(lpt_ports[i].addr, 0x0007, lpt_read, NULL, NULL, lpt_write, NULL, NULL, &lpt_ports[i]);
|
||||
io_removehandler(lpt_ports[i].addr + 0x0400, 0x0007, lpt_read, NULL, NULL, lpt_write, NULL, NULL, &lpt_ports[i]);
|
||||
}
|
||||
if (port != 0xffff) {
|
||||
if ((port != 0x0000) && (port != 0xffff)) {
|
||||
lpt_log("Set handler: %04X-%04X\n", port, port + 0x0003);
|
||||
io_sethandler(port, 0x0003, lpt_read, NULL, NULL, lpt_write, NULL, NULL, &lpt_ports[i]);
|
||||
if (lpt_ports[i].epp)
|
||||
io_sethandler(lpt_ports[i].addr + 0x0003, 0x0003, lpt_read, NULL, NULL, lpt_write, NULL, NULL, &lpt_ports[i]);
|
||||
io_sethandler(port + 0x0003, 0x0005, lpt_read, NULL, NULL, lpt_write, NULL, NULL, &lpt_ports[i]);
|
||||
if (lpt_ports[i].ecp || lpt_ports[i].lv2) {
|
||||
io_sethandler(port + 0x0400, 0x0003, lpt_read, NULL, NULL, lpt_write, NULL, NULL, &lpt_ports[i]);
|
||||
if (lpt_ports[i].epp)
|
||||
io_sethandler(lpt_ports[i].addr + 0x0403, 0x0003, lpt_read, NULL, NULL, lpt_write, NULL, NULL, &lpt_ports[i]);
|
||||
io_sethandler(port + 0x0404, 0x0003, lpt_read, NULL, NULL, lpt_write, NULL, NULL, &lpt_ports[i]);
|
||||
}
|
||||
}
|
||||
lpt_ports[i].addr = port;
|
||||
|
||||
@@ -83,24 +83,25 @@ static const device_t mouse_internal_device = {
|
||||
|
||||
static mouse_t mouse_devices[] = {
|
||||
// clang-format off
|
||||
{ &mouse_none_device },
|
||||
{ &mouse_internal_device },
|
||||
{ &mouse_logibus_device },
|
||||
{ &mouse_msinport_device },
|
||||
{ &mouse_none_device },
|
||||
{ &mouse_internal_device },
|
||||
{ &mouse_logibus_device },
|
||||
{ &mouse_msinport_device },
|
||||
#ifdef USE_GENIBUS
|
||||
{ &mouse_genibus_device },
|
||||
{ &mouse_genibus_device },
|
||||
#endif
|
||||
{ &mouse_mssystems_device },
|
||||
{ &mouse_mssystems_bus_device },
|
||||
{ &mouse_msserial_device },
|
||||
{ &mouse_ltserial_device },
|
||||
{ &mouse_ps2_device },
|
||||
{ &mouse_mssystems_device },
|
||||
{ &mouse_mssystems_bus_device },
|
||||
{ &mouse_msserial_device },
|
||||
{ &mouse_msserial_ballpoint_device },
|
||||
{ &mouse_ltserial_device },
|
||||
{ &mouse_ps2_device },
|
||||
#ifdef USE_WACOM
|
||||
{ &mouse_wacom_device },
|
||||
{ &mouse_wacom_artpad_device },
|
||||
{ &mouse_wacom_device },
|
||||
{ &mouse_wacom_artpad_device },
|
||||
#endif
|
||||
{ &mouse_mtouch_device },
|
||||
{ NULL }
|
||||
{ &mouse_mtouch_device },
|
||||
{ NULL }
|
||||
// clang-format on
|
||||
};
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ enum {
|
||||
FORMAT_MM_SERIES = 0x13,
|
||||
FORMAT_PB_3BYTE,
|
||||
FORMAT_PB_5BYTE,
|
||||
FORMAT_MSYSTEMS = 0x15, /* Alias for FORMAT_PB_5BYTE. */
|
||||
FORMAT_MSYSTEMS = 0x15, /* Alias for FORMAT_PB_5BYTE. */
|
||||
FORMAT_MS,
|
||||
FORMAT_HEX,
|
||||
FORMAT_MS_4BYTE,
|
||||
@@ -59,45 +59,46 @@ enum {
|
||||
};
|
||||
|
||||
typedef struct mouse_t {
|
||||
const char *name; /* name of this device */
|
||||
const char *name; /* name of this device */
|
||||
|
||||
uint8_t id[252];
|
||||
uint8_t buf[256];
|
||||
uint8_t id[252];
|
||||
uint8_t buf[256];
|
||||
|
||||
uint8_t flags; /* device flags */
|
||||
uint8_t but;
|
||||
uint8_t rts_toggle;
|
||||
uint8_t status;
|
||||
uint8_t format;
|
||||
uint8_t prompt;
|
||||
uint8_t flags; /* device flags */
|
||||
uint8_t but;
|
||||
uint8_t rts_toggle;
|
||||
uint8_t status;
|
||||
uint8_t format;
|
||||
uint8_t prompt;
|
||||
|
||||
uint8_t continuous;
|
||||
uint8_t ib;
|
||||
uint8_t command;
|
||||
uint8_t buf_len;
|
||||
uint8_t report_mode;
|
||||
uint8_t id_len;
|
||||
uint8_t buf_pos;
|
||||
uint8_t rev;
|
||||
uint8_t continuous;
|
||||
uint8_t ib;
|
||||
uint8_t command;
|
||||
uint8_t buf_len;
|
||||
uint8_t report_mode;
|
||||
uint8_t id_len;
|
||||
uint8_t buf_pos;
|
||||
uint8_t rev;
|
||||
|
||||
int8_t type; /* type of this device */
|
||||
int8_t port;
|
||||
int8_t type; /* type of this device */
|
||||
int8_t port;
|
||||
|
||||
int state;
|
||||
int state;
|
||||
|
||||
int bps;
|
||||
int rps;
|
||||
int bps;
|
||||
int default_bps;
|
||||
int rps;
|
||||
|
||||
double transmit_period;
|
||||
double report_period;
|
||||
double cur_period;
|
||||
double min_bit_period;
|
||||
double acc_time;
|
||||
double host_transmit_period;
|
||||
double transmit_period;
|
||||
double report_period;
|
||||
double cur_period;
|
||||
double min_bit_period;
|
||||
double acc_time;
|
||||
double host_transmit_period;
|
||||
|
||||
pc_timer_t timer;
|
||||
pc_timer_t timer;
|
||||
|
||||
serial_t * serial;
|
||||
serial_t *serial;
|
||||
} mouse_t;
|
||||
|
||||
#define FLAG_INPORT 0x80 /* device is MS InPort */
|
||||
@@ -128,7 +129,7 @@ mouse_serial_log(const char *fmt, ...)
|
||||
static void
|
||||
sermouse_set_period(mouse_t *dev, double period)
|
||||
{
|
||||
dev->cur_period = period; /* Needed for the recalculation of the timings. */
|
||||
dev->cur_period = period; /* Needed for the recalculation of the timings. */
|
||||
|
||||
timer_stop(&dev->timer);
|
||||
|
||||
@@ -160,7 +161,7 @@ sermouse_transmit_byte(mouse_t *dev, int do_next)
|
||||
static void
|
||||
sermouse_transmit(mouse_t *dev, int len, int from_report, int to_report)
|
||||
{
|
||||
dev->state = to_report ? STATE_TRANSMIT_REPORT : STATE_TRANSMIT;
|
||||
dev->state = to_report ? STATE_TRANSMIT_REPORT : STATE_TRANSMIT;
|
||||
dev->buf_pos = 0;
|
||||
dev->buf_len = len;
|
||||
|
||||
@@ -186,7 +187,7 @@ sermouse_report_msystems(mouse_t *dev)
|
||||
{
|
||||
int delta_x = 0;
|
||||
int delta_y = 0;
|
||||
int b = mouse_get_buttons_ex();
|
||||
int b = mouse_get_buttons_ex();
|
||||
|
||||
mouse_subtract_coords(&delta_x, &delta_y, NULL, NULL, -128, 127, 1, 0);
|
||||
|
||||
@@ -195,12 +196,12 @@ sermouse_report_msystems(mouse_t *dev)
|
||||
if (dev->but >= 3)
|
||||
dev->buf[0] |= (b & 0x04) ? 0x00 : 0x02; /* middle button */
|
||||
else
|
||||
dev->buf[0] |= 0x02; /* middle button */
|
||||
dev->buf[0] |= 0x02; /* middle button */
|
||||
dev->buf[0] |= (b & 0x02) ? 0x00 : 0x01; /* right button */
|
||||
dev->buf[1] = delta_x;
|
||||
dev->buf[2] = delta_y;
|
||||
dev->buf[3] = delta_x; /* same as byte 1 */
|
||||
dev->buf[4] = delta_y; /* same as byte 2 */
|
||||
dev->buf[3] = delta_x; /* same as byte 1 */
|
||||
dev->buf[4] = delta_y; /* same as byte 2 */
|
||||
|
||||
return 5;
|
||||
}
|
||||
@@ -210,7 +211,7 @@ sermouse_report_3bp(mouse_t *dev)
|
||||
{
|
||||
int delta_x = 0;
|
||||
int delta_y = 0;
|
||||
int b = mouse_get_buttons_ex();
|
||||
int b = mouse_get_buttons_ex();
|
||||
|
||||
mouse_subtract_coords(&delta_x, &delta_y, NULL, NULL, -128, 127, 1, 0);
|
||||
|
||||
@@ -218,7 +219,7 @@ sermouse_report_3bp(mouse_t *dev)
|
||||
dev->buf[0] |= (b & 0x01) ? 0x04 : 0x00; /* left button */
|
||||
if (dev->but >= 3)
|
||||
dev->buf[0] |= (b & 0x04) ? 0x02 : 0x00; /* middle button */
|
||||
dev->buf[0] |= (b & 0x02) ? 0x01 : 0x00; /* right button */
|
||||
dev->buf[0] |= (b & 0x02) ? 0x01 : 0x00; /* right button */
|
||||
dev->buf[1] = delta_x;
|
||||
dev->buf[2] = delta_y;
|
||||
|
||||
@@ -230,7 +231,7 @@ sermouse_report_mmseries(mouse_t *dev)
|
||||
{
|
||||
int delta_x = 0;
|
||||
int delta_y = 0;
|
||||
int b = mouse_get_buttons_ex();
|
||||
int b = mouse_get_buttons_ex();
|
||||
|
||||
mouse_subtract_coords(&delta_x, &delta_y, NULL, NULL, -127, 127, 1, 0);
|
||||
|
||||
@@ -243,7 +244,7 @@ sermouse_report_mmseries(mouse_t *dev)
|
||||
dev->buf[0] |= (b & 0x01) ? 0x04 : 0x00; /* left button */
|
||||
if (dev->but >= 3)
|
||||
dev->buf[0] |= (b & 0x04) ? 0x02 : 0x00; /* middle button */
|
||||
dev->buf[0] |= (b & 0x02) ? 0x01 : 0x00; /* right button */
|
||||
dev->buf[0] |= (b & 0x02) ? 0x01 : 0x00; /* right button */
|
||||
dev->buf[1] = ABS(delta_x) & 0x7f;
|
||||
dev->buf[2] = ABS(delta_y) & 0x7f;
|
||||
mouse_serial_log("MM series mouse report: %02X %02X %02X\n", dev->buf[0], dev->buf[1], dev->buf[2]);
|
||||
@@ -256,7 +257,7 @@ sermouse_report_bp1(mouse_t *dev, int abs)
|
||||
{
|
||||
int delta_x = 0;
|
||||
int delta_y = 0;
|
||||
int b = mouse_get_buttons_ex();
|
||||
int b = mouse_get_buttons_ex();
|
||||
|
||||
mouse_subtract_coords(&delta_x, &delta_y, NULL, NULL, -2048, 2047, 1, abs);
|
||||
|
||||
@@ -264,7 +265,7 @@ sermouse_report_bp1(mouse_t *dev, int abs)
|
||||
dev->buf[0] |= (b & 0x01) ? 0x10 : 0x00; /* left button */
|
||||
if (dev->but >= 3)
|
||||
dev->buf[0] |= (b & 0x04) ? 0x08 : 0x00; /* middle button */
|
||||
dev->buf[0] |= (b & 0x02) ? 0x04 : 0x00; /* right button */
|
||||
dev->buf[0] |= (b & 0x02) ? 0x04 : 0x00; /* right button */
|
||||
dev->buf[1] = (delta_x & 0x3f);
|
||||
dev->buf[2] = ((delta_x >> 6) & 0x3f);
|
||||
dev->buf[3] = (delta_y & 0x3f);
|
||||
@@ -277,17 +278,17 @@ static uint8_t
|
||||
sermouse_report_ms(mouse_t *dev)
|
||||
{
|
||||
uint8_t len;
|
||||
int delta_x = 0;
|
||||
int delta_y = 0;
|
||||
int delta_z = 0;
|
||||
int b = mouse_get_buttons_ex();
|
||||
int delta_x = 0;
|
||||
int delta_y = 0;
|
||||
int delta_z = 0;
|
||||
int b = mouse_get_buttons_ex();
|
||||
|
||||
mouse_subtract_coords(&delta_x, &delta_y, NULL, NULL, -128, 127, 0, 0);
|
||||
mouse_subtract_z(&delta_z, -8, 7, 1);
|
||||
|
||||
dev->buf[0] = 0x40;
|
||||
dev->buf[0] |= (((delta_y >> 6) & 0x03) << 2);
|
||||
dev->buf[0] |= ((delta_x >> 6) & 0x03);
|
||||
dev->buf[0] |= ((((delta_y & 0xFF) >> 6) & 0x03) << 2);
|
||||
dev->buf[0] |= (((delta_x & 0xFF) >> 6) & 0x03);
|
||||
if (b & 0x01)
|
||||
dev->buf[0] |= 0x20;
|
||||
if (b & 0x02)
|
||||
@@ -295,7 +296,16 @@ sermouse_report_ms(mouse_t *dev)
|
||||
dev->buf[1] = delta_x & 0x3f;
|
||||
dev->buf[2] = delta_y & 0x3f;
|
||||
mouse_serial_log("Microsoft serial mouse report: %02X %02X %02X\n", dev->buf[0], dev->buf[1], dev->buf[2]);
|
||||
if (dev->but == 3) {
|
||||
if (dev->type == MOUSE_TYPE_MSBPOINT) {
|
||||
len = 4;
|
||||
dev->buf[3] = 0;
|
||||
if (b & 0x4)
|
||||
dev->buf[3] |= 0x8;
|
||||
if (b & 0x8)
|
||||
dev->buf[3] |= 0x4;
|
||||
dev->buf[3] |= !!(delta_y < 0) ? 0x2 : 0;
|
||||
dev->buf[3] |= !!(delta_x < 0) ? 0x1 : 0;
|
||||
} else if (dev->but == 3) {
|
||||
len = 3;
|
||||
if (dev->format == FORMAT_MS) {
|
||||
if (b & 0x04) {
|
||||
@@ -325,18 +335,18 @@ sermouse_report_ms(mouse_t *dev)
|
||||
static uint8_t
|
||||
sermouse_report_hex(mouse_t *dev)
|
||||
{
|
||||
char ret[6] = { 0, 0, 0, 0, 0, 0 };
|
||||
uint8_t but = 0x00;
|
||||
int delta_x = 0;
|
||||
int delta_y = 0;
|
||||
int b = mouse_get_buttons_ex();
|
||||
char ret[6] = { 0, 0, 0, 0, 0, 0 };
|
||||
uint8_t but = 0x00;
|
||||
int delta_x = 0;
|
||||
int delta_y = 0;
|
||||
int b = mouse_get_buttons_ex();
|
||||
|
||||
mouse_subtract_coords(&delta_x, &delta_y, NULL, NULL, -128, 127, 1, 0);
|
||||
|
||||
but |= (b & 0x01) ? 0x04 : 0x00; /* left button */
|
||||
if (dev->but >= 3)
|
||||
but |= (b & 0x04) ? 0x02 : 0x00; /* middle button */
|
||||
but |= (b & 0x02) ? 0x01 : 0x00; /* right button */
|
||||
but |= (b & 0x02) ? 0x01 : 0x00; /* right button */
|
||||
|
||||
sprintf(ret, "%01X%02X%02X", but & 0x0f, (int8_t) delta_x, (int8_t) delta_y);
|
||||
|
||||
@@ -441,14 +451,14 @@ ltsermouse_set_report_period(mouse_t *dev, int rps)
|
||||
sermouse_set_period(dev, 0.0);
|
||||
|
||||
dev->report_period = 0.0;
|
||||
dev->continuous = 1;
|
||||
dev->continuous = 1;
|
||||
} else {
|
||||
#if 0
|
||||
if (rps > dev->max_rps)
|
||||
rps = dev->max_rps;
|
||||
#endif
|
||||
|
||||
dev->continuous = 0;
|
||||
dev->continuous = 0;
|
||||
dev->report_period = 1000000.0 / ((double) rps);
|
||||
/* Actual spacing between reports. */
|
||||
}
|
||||
@@ -473,18 +483,19 @@ static void
|
||||
ltsermouse_switch_baud_rate(mouse_t *dev, int next_state)
|
||||
{
|
||||
double word_lens[FORMATS_NUM] = {
|
||||
[FORMAT_BP1_ABS] = 7.0 + 1.0, /* 7 data bits + even parity */
|
||||
[FORMAT_BP1_REL] = 7.0 + 1.0, /* 7 data bits + even parity */
|
||||
[FORMAT_MM_SERIES] = 8.0 + 1.0, /* 8 data bits + odd parity */
|
||||
[FORMAT_PB_3BYTE] = 8.0, /* 8 data bits + no parity */
|
||||
[FORMAT_PB_5BYTE] = 8.0, /* 8 data bits + no parity */
|
||||
[FORMAT_MS] = 7.0, /* 7 datas bits + no parity */
|
||||
[FORMAT_HEX] = 8.0, /* 8 data bits + no parity */
|
||||
[FORMAT_MS_4BYTE] = 7.0, /* 7 datas bits + no parity */
|
||||
[FORMAT_MS_WHEEL] = 7.0 }; /* 7 datas bits + no parity */
|
||||
[FORMAT_BP1_ABS] = 7.0 + 1.0, /* 7 data bits + even parity */
|
||||
[FORMAT_BP1_REL] = 7.0 + 1.0, /* 7 data bits + even parity */
|
||||
[FORMAT_MM_SERIES] = 8.0 + 1.0, /* 8 data bits + odd parity */
|
||||
[FORMAT_PB_3BYTE] = 8.0, /* 8 data bits + no parity */
|
||||
[FORMAT_PB_5BYTE] = 8.0, /* 8 data bits + no parity */
|
||||
[FORMAT_MS] = 7.0, /* 7 datas bits + no parity */
|
||||
[FORMAT_HEX] = 8.0, /* 8 data bits + no parity */
|
||||
[FORMAT_MS_4BYTE] = 7.0, /* 7 datas bits + no parity */
|
||||
[FORMAT_MS_WHEEL] = 7.0 /* 7 datas bits + no parity */
|
||||
};
|
||||
double word_len = word_lens[dev->format];
|
||||
|
||||
word_len += 1.0 + 2.0; /* 1 start bit + 2 stop bits */
|
||||
word_len += 1.0 + 2.0; /* 1 start bit + 2 stop bits */
|
||||
|
||||
#if 0
|
||||
dev->max_rps = (int) floor(((double) dev->bps) / (word_len * num_words));
|
||||
@@ -531,18 +542,19 @@ sermouse_next_state(mouse_t *dev)
|
||||
static void
|
||||
ltsermouse_process_command(mouse_t *dev)
|
||||
{
|
||||
int cmd_to_rps[9] = { 10, 20, 35, 70, 150, 0, -1, 100, 50 };
|
||||
int b;
|
||||
int cmd_to_rps[9] = { 10, 20, 35, 70, 150, 0, -1, 100, 50 };
|
||||
int b;
|
||||
uint8_t format_codes[FORMATS_NUM] = {
|
||||
[FORMAT_BP1_ABS] = 0x0c,
|
||||
[FORMAT_BP1_REL] = 0x06,
|
||||
[FORMAT_MM_SERIES] = 0x0a,
|
||||
[FORMAT_PB_3BYTE] = 0x00,
|
||||
[FORMAT_PB_5BYTE] = 0x02,
|
||||
[FORMAT_MS] = 0x0e,
|
||||
[FORMAT_HEX] = 0x04,
|
||||
[FORMAT_MS_4BYTE] = 0x08, /* Guess */
|
||||
[FORMAT_MS_WHEEL] = 0x08 }; /* Guess */
|
||||
[FORMAT_BP1_ABS] = 0x0c,
|
||||
[FORMAT_BP1_REL] = 0x06,
|
||||
[FORMAT_MM_SERIES] = 0x0a,
|
||||
[FORMAT_PB_3BYTE] = 0x00,
|
||||
[FORMAT_PB_5BYTE] = 0x02,
|
||||
[FORMAT_MS] = 0x0e,
|
||||
[FORMAT_HEX] = 0x04,
|
||||
[FORMAT_MS_4BYTE] = 0x08, /* Guess */
|
||||
[FORMAT_MS_WHEEL] = 0x08 /* Guess */
|
||||
};
|
||||
const char *copr = "\r\n(C) " COPYRIGHT_YEAR " 86Box, Revision 3.0";
|
||||
|
||||
mouse_serial_log("ltsermouse_process_command(): %02X\n", dev->ib);
|
||||
@@ -551,7 +563,7 @@ ltsermouse_process_command(mouse_t *dev)
|
||||
switch (dev->command) {
|
||||
case 0x20:
|
||||
/* Auto Baud Selection */
|
||||
dev->bps = (int) floor(1000000.0 / dev->host_transmit_period);
|
||||
dev->bps = (int) floor(1000000.0 / dev->host_transmit_period);
|
||||
dev->transmit_period = dev->host_transmit_period;
|
||||
|
||||
dev->buf[0] = 0x06;
|
||||
@@ -569,7 +581,7 @@ ltsermouse_process_command(mouse_t *dev)
|
||||
case 0x4e:
|
||||
case 0x4f:
|
||||
dev->report_mode = dev->command;
|
||||
dev->rps = cmd_to_rps[dev->command - 0x4a];
|
||||
dev->rps = cmd_to_rps[dev->command - 0x4a];
|
||||
ltsermouse_update_report_period(dev);
|
||||
break;
|
||||
|
||||
@@ -593,13 +605,13 @@ ltsermouse_process_command(mouse_t *dev)
|
||||
/* Absolute Bit Pad One Packed Binary Format */
|
||||
mouse_clear_coords();
|
||||
fallthrough;
|
||||
case 0x42: /* Relative Bit Pad One Packed Binary Format */
|
||||
case 0x53: /* MM Series Data Format */
|
||||
case 0x54: /* Three Byte Packed Binary Format */
|
||||
case 0x55: /* Five Byte Packed Binary Format (Mouse Systems-compatible) */
|
||||
case 0x56: /* Microsoft Compatible Format */
|
||||
case 0x57: /* Hexadecimal Format */
|
||||
case 0x58: /* Microsoft Compatible Format (3+1 byte 3-button, from the FreeBSD source code) */
|
||||
case 0x42: /* Relative Bit Pad One Packed Binary Format */
|
||||
case 0x53: /* MM Series Data Format */
|
||||
case 0x54: /* Three Byte Packed Binary Format */
|
||||
case 0x55: /* Five Byte Packed Binary Format (Mouse Systems-compatible) */
|
||||
case 0x56: /* Microsoft Compatible Format */
|
||||
case 0x57: /* Hexadecimal Format */
|
||||
case 0x58: /* Microsoft Compatible Format (3+1 byte 3-button, from the FreeBSD source code) */
|
||||
if ((dev->rev >= 0x02) && ((dev->command != 0x58) || (dev->rev > 0x04))) {
|
||||
dev->format = dev->command & 0x1f;
|
||||
ltsermouse_switch_baud_rate(dev, sermouse_next_state(dev));
|
||||
@@ -620,7 +632,7 @@ ltsermouse_process_command(mouse_t *dev)
|
||||
break;
|
||||
case 0x05:
|
||||
/* Diagnostic */
|
||||
b = mouse_get_buttons_ex();
|
||||
b = mouse_get_buttons_ex();
|
||||
dev->buf[0] = ((b & 0x01) << 2) | ((b & 0x06) >> 1);
|
||||
dev->buf[1] = dev->buf[2] = 0x00;
|
||||
sermouse_transmit(dev, 3, 0, 0);
|
||||
@@ -630,7 +642,7 @@ ltsermouse_process_command(mouse_t *dev)
|
||||
if (dev->rev >= 0x20) {
|
||||
/* Format and Revision Number */
|
||||
dev->buf[0] = format_codes[dev->format];
|
||||
dev->buf[0] |= 0x10; /* Revision 3.0, 0x00 would be Revision 2.0 */
|
||||
dev->buf[0] |= 0x10; /* Revision 3.0, 0x00 would be Revision 2.0 */
|
||||
sermouse_transmit(dev, 1, 0, 0);
|
||||
}
|
||||
break;
|
||||
@@ -676,7 +688,7 @@ ltsermouse_process_data(mouse_t *dev)
|
||||
{
|
||||
mouse_serial_log("ltsermouse_process_data(): %02X (command = %02X)\n", dev->ib, dev->command);
|
||||
|
||||
switch(dev->command) {
|
||||
switch (dev->command) {
|
||||
case 0x2a:
|
||||
switch (dev->ib) {
|
||||
default:
|
||||
@@ -707,23 +719,30 @@ sermouse_reset(mouse_t *dev, int callback)
|
||||
{
|
||||
sermouse_set_period(dev, 0.0);
|
||||
|
||||
dev->bps = 1200;
|
||||
dev->rps = 0;
|
||||
if (dev->default_bps)
|
||||
dev->bps = dev->default_bps;
|
||||
else
|
||||
dev->bps = 1200;
|
||||
dev->rps = 0;
|
||||
dev->prompt = 0;
|
||||
if (dev->id[0] == 'H')
|
||||
dev->format = FORMAT_MSYSTEMS;
|
||||
else switch (dev->but) {
|
||||
default:
|
||||
case 2:
|
||||
dev->format = FORMAT_MS;
|
||||
break;
|
||||
case 3:
|
||||
dev->format = (dev->type == MOUSE_TYPE_LT3BUTTON) ? FORMAT_MS : FORMAT_MS_4BYTE;
|
||||
break;
|
||||
case 4:
|
||||
dev->format = FORMAT_MS_WHEEL;
|
||||
break;
|
||||
}
|
||||
else
|
||||
switch (dev->but) {
|
||||
default:
|
||||
case 2:
|
||||
dev->format = FORMAT_MS;
|
||||
break;
|
||||
case 3:
|
||||
dev->format = (dev->type == MOUSE_TYPE_LT3BUTTON) ? FORMAT_MS : FORMAT_MS_4BYTE;
|
||||
break;
|
||||
case 4:
|
||||
dev->format = FORMAT_MS_WHEEL;
|
||||
break;
|
||||
case 5:
|
||||
dev->format = FORMAT_MS;
|
||||
break;
|
||||
}
|
||||
|
||||
ltsermouse_switch_baud_rate(dev, callback ? STATE_TRANSMIT : STATE_IDLE);
|
||||
}
|
||||
@@ -840,7 +859,7 @@ sermouse_close(void *priv)
|
||||
static void *
|
||||
sermouse_init(const device_t *info)
|
||||
{
|
||||
mouse_t *dev;
|
||||
mouse_t *dev = (mouse_t *) calloc(1, sizeof(mouse_t));
|
||||
void (*rcr_callback)(struct serial_s *serial, void *priv);
|
||||
void (*dev_write)(struct serial_s *serial, void *priv, uint8_t data);
|
||||
void (*transmit_period_callback)(struct serial_s *serial, void *priv,
|
||||
@@ -850,34 +869,40 @@ sermouse_init(const device_t *info)
|
||||
uintptr_t irqbase = ((device_get_config_int("irq") << 16) |
|
||||
(device_get_config_hex16("addr") << 20)) |
|
||||
ns16450_device.local;
|
||||
device_add_params(&ns16450_device, (void*)irqbase);
|
||||
device_add_params(&ns16450_device, (void *) irqbase);
|
||||
}
|
||||
|
||||
dev = (mouse_t *) calloc(1, sizeof(mouse_t));
|
||||
dev->name = info->name;
|
||||
dev->but = device_get_config_int("buttons");
|
||||
dev->rev = device_get_config_int("revision");
|
||||
dev->but = (info->local == MOUSE_TYPE_MSBPOINT) ? 5 : device_get_config_int("buttons");
|
||||
|
||||
if (info->local == 0)
|
||||
dev->rts_toggle = 1;
|
||||
if ((info->local == 0) || (info->local == MOUSE_TYPE_MSBPOINT))
|
||||
dev->rts_toggle = 1;
|
||||
else
|
||||
dev->rts_toggle = device_get_config_int("rts_toggle");
|
||||
dev->rts_toggle = device_get_config_int("rts_toggle");
|
||||
|
||||
if (dev->but > 2)
|
||||
dev->flags |= FLAG_3BTN;
|
||||
|
||||
if (info->local == MOUSE_TYPE_MSYSTEMS || info->local == MOUSE_TYPE_MSYSTEMSB) {
|
||||
dev->format = 0;
|
||||
dev->type = info->local;
|
||||
dev->id_len = 1;
|
||||
dev->id[0] = 'H';
|
||||
if (info->local == MOUSE_TYPE_MSBPOINT) {
|
||||
dev->format = 7;
|
||||
dev->status = 0x0f;
|
||||
dev->type = MOUSE_TYPE_MSBPOINT;
|
||||
dev->id_len = 1;
|
||||
dev->id[0] = 'B';
|
||||
dev->flags &= ~FLAG_3BTN;
|
||||
} else if ((info->local == MOUSE_TYPE_MSYSTEMS) || (info->local == MOUSE_TYPE_MSYSTEMSB)) {
|
||||
dev->format = 0;
|
||||
dev->type = info->local;
|
||||
dev->id_len = 1;
|
||||
dev->id[0] = 'H';
|
||||
} else {
|
||||
dev->format = 7;
|
||||
dev->status = 0x0f;
|
||||
dev->id_len = 1;
|
||||
dev->id[0] = 'M';
|
||||
if (info->local)
|
||||
dev->rev = device_get_config_int("revision");
|
||||
dev->format = 7;
|
||||
dev->status = 0x0f;
|
||||
dev->id_len = 1;
|
||||
dev->id[0] = 'M';
|
||||
if (info->local == 1) // Logitech Serial Mouse
|
||||
dev->rev = device_get_config_int("revision");
|
||||
dev->default_bps = device_get_config_int("default_baud");
|
||||
switch (dev->but) {
|
||||
default:
|
||||
case 2:
|
||||
@@ -900,8 +925,8 @@ sermouse_init(const device_t *info)
|
||||
dev->port = (info->local == MOUSE_TYPE_MSYSTEMSB) ? (SERIAL_MAX - 1) : device_get_config_int("port");
|
||||
|
||||
/* Attach a serial port to the mouse. */
|
||||
rcr_callback = dev->rts_toggle ? sermouse_callback : NULL;
|
||||
dev_write = (info->local == 1) ? ltsermouse_write : NULL;
|
||||
rcr_callback = dev->rts_toggle ? sermouse_callback : NULL;
|
||||
dev_write = (info->local == 1) ? ltsermouse_write : NULL;
|
||||
transmit_period_callback = (info->local == 1) ? ltsermouse_transmit_period : NULL;
|
||||
|
||||
dev->serial = serial_attach_ex(dev->port, rcr_callback, dev_write,
|
||||
@@ -923,25 +948,28 @@ sermouse_init(const device_t *info)
|
||||
return dev;
|
||||
}
|
||||
|
||||
#define SERMOUSE_PORT_CONFIG_COMMON \
|
||||
{ \
|
||||
.name = "port", \
|
||||
.description = "Serial Port", \
|
||||
.type = CONFIG_SELECTION, \
|
||||
.default_string = NULL, \
|
||||
.default_int = 0, \
|
||||
.file_filter = NULL, \
|
||||
.spinner = { 0 }, \
|
||||
.selection = { \
|
||||
{ .description = "COM1", .value = 0 }, \
|
||||
{ .description = "COM2", .value = 1 }, \
|
||||
{ .description = "COM3", .value = 2 }, \
|
||||
{ .description = "COM4", .value = 3 }, \
|
||||
{ .description = "" } \
|
||||
}, \
|
||||
.bios = { { 0 } } \
|
||||
}
|
||||
|
||||
static const device_config_t msssermouse_config[] = {
|
||||
// clang-format off
|
||||
{
|
||||
.name = "port",
|
||||
.description = "Serial Port",
|
||||
.type = CONFIG_SELECTION,
|
||||
.default_string = NULL,
|
||||
.default_int = 0,
|
||||
.file_filter = NULL,
|
||||
.spinner = { 0 },
|
||||
.selection = {
|
||||
{ .description = "COM1", .value = 0 },
|
||||
{ .description = "COM2", .value = 1 },
|
||||
{ .description = "COM3", .value = 2 },
|
||||
{ .description = "COM4", .value = 3 },
|
||||
{ .description = "" }
|
||||
},
|
||||
.bios = { { 0 } }
|
||||
},
|
||||
// clang-format off
|
||||
SERMOUSE_PORT_CONFIG_COMMON,
|
||||
{
|
||||
.name = "buttons",
|
||||
.description = "Buttons",
|
||||
@@ -969,7 +997,7 @@ static const device_config_t msssermouse_config[] = {
|
||||
.bios = { { 0 } }
|
||||
},
|
||||
{ .name = "", .description = "", .type = CONFIG_END }
|
||||
// clang-format on
|
||||
// clang-format on
|
||||
};
|
||||
|
||||
static const device_config_t mssbusmouse_config[] = {
|
||||
@@ -1042,27 +1070,11 @@ static const device_config_t mssbusmouse_config[] = {
|
||||
},
|
||||
{ .name = "", .description = "", .type = CONFIG_END }
|
||||
// clang-format on
|
||||
};
|
||||
};
|
||||
|
||||
static const device_config_t mssermouse_config[] = {
|
||||
// clang-format off
|
||||
{
|
||||
.name = "port",
|
||||
.description = "Serial Port",
|
||||
.type = CONFIG_SELECTION,
|
||||
.default_string = NULL,
|
||||
.default_int = 0,
|
||||
.file_filter = NULL,
|
||||
.spinner = { 0 },
|
||||
.selection = {
|
||||
{ .description = "COM1", .value = 0 },
|
||||
{ .description = "COM2", .value = 1 },
|
||||
{ .description = "COM3", .value = 2 },
|
||||
{ .description = "COM4", .value = 3 },
|
||||
{ .description = "" }
|
||||
},
|
||||
.bios = { { 0 } }
|
||||
},
|
||||
// clang-format off
|
||||
SERMOUSE_PORT_CONFIG_COMMON,
|
||||
{
|
||||
.name = "buttons",
|
||||
.description = "Buttons",
|
||||
@@ -1080,28 +1092,19 @@ static const device_config_t mssermouse_config[] = {
|
||||
.bios = { { 0 } }
|
||||
},
|
||||
{ .name = "", .description = "", .type = CONFIG_END }
|
||||
// clang-format on
|
||||
// clang-format on
|
||||
};
|
||||
|
||||
static const device_config_t msballpoint_config[] = {
|
||||
// clang-format off
|
||||
SERMOUSE_PORT_CONFIG_COMMON,
|
||||
{ .name = "", .description = "", .type = CONFIG_END }
|
||||
// clang-format on
|
||||
};
|
||||
|
||||
static const device_config_t ltsermouse_config[] = {
|
||||
// clang-format off
|
||||
{
|
||||
.name = "port",
|
||||
.description = "Serial Port",
|
||||
.type = CONFIG_SELECTION,
|
||||
.default_string = NULL,
|
||||
.default_int = 0,
|
||||
.file_filter = NULL,
|
||||
.spinner = { 0 },
|
||||
.selection = {
|
||||
{ .description = "COM1", .value = 0 },
|
||||
{ .description = "COM2", .value = 1 },
|
||||
{ .description = "COM3", .value = 2 },
|
||||
{ .description = "COM4", .value = 3 },
|
||||
{ .description = "" }
|
||||
},
|
||||
.bios = { { 0 } }
|
||||
},
|
||||
// clang-format off
|
||||
SERMOUSE_PORT_CONFIG_COMMON,
|
||||
{
|
||||
.name = "buttons",
|
||||
.description = "Buttons",
|
||||
@@ -1134,19 +1137,36 @@ static const device_config_t ltsermouse_config[] = {
|
||||
},
|
||||
.bios = { { 0 } }
|
||||
},
|
||||
{
|
||||
.name = "default_baud",
|
||||
.description = "Default Baud rate",
|
||||
.type = CONFIG_SELECTION,
|
||||
.default_string = NULL,
|
||||
.default_int = 1200,
|
||||
.file_filter = NULL,
|
||||
.spinner = { 0 },
|
||||
.selection = {
|
||||
{ .description = "1200", .value = 1200 },
|
||||
{ .description = "2400", .value = 2400 },
|
||||
{ .description = "4800", .value = 4800 },
|
||||
{ .description = "9600", .value = 9600 },
|
||||
{ .description = "" }
|
||||
},
|
||||
.bios = { { 0 } }
|
||||
},
|
||||
{
|
||||
.name = "rts_toggle",
|
||||
.description = "RTS toggle",
|
||||
.type = CONFIG_BINARY,
|
||||
.default_string = NULL,
|
||||
.default_int = 0,
|
||||
.default_int = 1,
|
||||
.file_filter = NULL,
|
||||
.spinner = { 0 },
|
||||
.selection = { { 0 } },
|
||||
.bios = { { 0 } }
|
||||
},
|
||||
{ .name = "", .description = "", .type = CONFIG_END }
|
||||
// clang-format on
|
||||
// clang-format on
|
||||
};
|
||||
|
||||
const device_t mouse_mssystems_device = {
|
||||
@@ -1191,6 +1211,20 @@ const device_t mouse_msserial_device = {
|
||||
.config = mssermouse_config
|
||||
};
|
||||
|
||||
const device_t mouse_msserial_ballpoint_device = {
|
||||
.name = "Microsoft Serial BallPoint",
|
||||
.internal_name = "msballpoint",
|
||||
.flags = DEVICE_COM,
|
||||
.local = MOUSE_TYPE_MSBPOINT,
|
||||
.init = sermouse_init,
|
||||
.close = sermouse_close,
|
||||
.reset = NULL,
|
||||
.available = NULL,
|
||||
.speed_changed = sermouse_speed_changed,
|
||||
.force_redraw = NULL,
|
||||
.config = msballpoint_config
|
||||
};
|
||||
|
||||
const device_t mouse_ltserial_device = {
|
||||
.name = "Logitech Serial Mouse",
|
||||
.internal_name = "ltserial",
|
||||
|
||||
@@ -37,24 +37,29 @@ novell_cardkey_read(uint16_t port, void *priv)
|
||||
novell_cardkey_t* cardkey = (novell_cardkey_t*)priv;
|
||||
uint8_t val = 0x00;
|
||||
switch (port) {
|
||||
/* Byte 5 high nibble + byte 4 high nibble */
|
||||
case 0x23A:
|
||||
val = (((cardkey->serial_number_str[11] > 'A') ? ((cardkey->serial_number_str[11] - 'A') + 10) : (cardkey->serial_number_str[11] - '0')) << 4) | (((cardkey->serial_number_str[9] > 'A') ? ((cardkey->serial_number_str[9] - 'A') + 10) : (cardkey->serial_number_str[9] - '0')) << 4);
|
||||
break;
|
||||
case 0x23B:
|
||||
val = (((cardkey->serial_number_str[10] > 'A') ? ((cardkey->serial_number_str[10] - 'A') + 10) : (cardkey->serial_number_str[10] - '0')) << 4) | (((cardkey->serial_number_str[8] > 'A') ? ((cardkey->serial_number_str[8] - 'A') + 10) : (cardkey->serial_number_str[8] - '0')) << 4);
|
||||
break;
|
||||
|
||||
/* Byte 5 low nibble + byte 4 low nibble */
|
||||
case 0x23B:
|
||||
val = (((cardkey->serial_number_str[11] > 'A') ? ((cardkey->serial_number_str[11] - 'A') + 10) : (cardkey->serial_number_str[11] - '0')) << 4) | (((cardkey->serial_number_str[9] > 'A') ? ((cardkey->serial_number_str[9] - 'A') + 10) : (cardkey->serial_number_str[9] - '0')) << 4);
|
||||
break;
|
||||
/* Byte 2 low nibble + byte 1 low nibble */
|
||||
case 0x23C:
|
||||
val = ((cardkey->serial_number_str[4] - '0') << 4) | ((cardkey->serial_number_str[2] - '0'));
|
||||
val = ((cardkey->serial_number_str[5] - '0') << 4) | ((cardkey->serial_number_str[3] - '0'));
|
||||
break;
|
||||
/* Byte 0 high nibble + byte 3 low nibble*/
|
||||
case 0x23D:
|
||||
val = ((cardkey->serial_number_str[1] - '0') << 4) | ((cardkey->serial_number_str[6] - '0'));
|
||||
break;
|
||||
case 0x23E:
|
||||
val = ((cardkey->serial_number_str[0] - '0') << 4) | ((cardkey->serial_number_str[7] - '0'));
|
||||
break;
|
||||
/* Byte 0 low nibble + byte 3 high nibble */
|
||||
case 0x23E:
|
||||
val = ((cardkey->serial_number_str[1] - '0') << 4) | ((cardkey->serial_number_str[6] - '0'));
|
||||
break;
|
||||
/* Byte 1 high nibble + byte 2 high nibble*/
|
||||
case 0x23F:
|
||||
val = ((cardkey->serial_number_str[3] - '0') << 4) | ((cardkey->serial_number_str[5] - '0'));
|
||||
val = ((cardkey->serial_number_str[2] - '0') << 4) | ((cardkey->serial_number_str[4] - '0'));
|
||||
break;
|
||||
}
|
||||
return val ^ 0xFF;
|
||||
@@ -110,7 +115,7 @@ static const device_config_t keycard_config[] = {
|
||||
|
||||
const device_t novell_keycard_device = {
|
||||
.name = "Novell NetWare 2.x Key Card",
|
||||
.internal_name = "mssystems",
|
||||
.internal_name = "novellkeycard",
|
||||
.flags = DEVICE_ISA,
|
||||
.local = 0,
|
||||
.init = novell_cardkey_init,
|
||||
|
||||
@@ -35,7 +35,6 @@ add_library(hdd OBJECT
|
||||
hdc_ide_sff8038i.c
|
||||
hdc_ide_um8673f.c
|
||||
hdc_ide_w83769f.c
|
||||
lba_enhancer.c
|
||||
)
|
||||
|
||||
add_library(zip OBJECT zip.c)
|
||||
|
||||
@@ -1,100 +0,0 @@
|
||||
/*
|
||||
* 86Box A hypervisor and IBM PC system emulator that specializes in
|
||||
* running old operating systems and software designed for IBM
|
||||
* PC systems and compatibles from 1981 through fairly recent
|
||||
* system designs based on the PCI bus.
|
||||
*
|
||||
* This file is part of the 86Box distribution.
|
||||
*
|
||||
* Vision Systems LBA Enhancer emulation.
|
||||
*
|
||||
*
|
||||
*
|
||||
* Authors: Cacodemon345
|
||||
*
|
||||
* Copyright 2024 Cacodemon345
|
||||
*/
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#define HAVE_STDARG_H
|
||||
#include <86box/86box.h>
|
||||
#include <86box/io.h>
|
||||
#include <86box/device.h>
|
||||
#include <86box/mem.h>
|
||||
#include <86box/rom.h>
|
||||
#include <86box/plat_unused.h>
|
||||
|
||||
typedef struct lba_enhancer_t
|
||||
{
|
||||
rom_t rom;
|
||||
} lba_enhancer_t;
|
||||
|
||||
#define BIOS_LBA_ENHANCER "roms/hdd/misc/lbaenhancer.bin"
|
||||
|
||||
void
|
||||
lba_enhancer_close(void* priv)
|
||||
{
|
||||
free(priv);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void *
|
||||
lba_enhancer_init(UNUSED(const device_t *info))
|
||||
{
|
||||
lba_enhancer_t *dev = (lba_enhancer_t *) calloc(1, sizeof(lba_enhancer_t));
|
||||
|
||||
rom_init(&dev->rom, BIOS_LBA_ENHANCER,
|
||||
device_get_config_hex20("bios_addr"), 0x4000, 0x3fff, 0, MEM_MAPPING_EXTERNAL);
|
||||
|
||||
return dev;
|
||||
}
|
||||
|
||||
static int
|
||||
lba_enhancer_available(void)
|
||||
{
|
||||
return rom_present(BIOS_LBA_ENHANCER);
|
||||
}
|
||||
|
||||
// clang-format off
|
||||
static const device_config_t lba_enhancer_config[] = {
|
||||
{
|
||||
.name = "bios_addr",
|
||||
.description = "BIOS Address",
|
||||
.type = CONFIG_HEX20,
|
||||
.default_string = NULL,
|
||||
.default_int = 0xc8000,
|
||||
.file_filter = NULL,
|
||||
.spinner = { 0 },
|
||||
.selection = {
|
||||
{ .description = "C800H", .value = 0xc8000 },
|
||||
{ .description = "CC00H", .value = 0xcc000 },
|
||||
{ .description = "D000H", .value = 0xd0000 },
|
||||
{ .description = "D400H", .value = 0xd4000 },
|
||||
{ .description = "D800H", .value = 0xd8000 },
|
||||
{ .description = "DC00H", .value = 0xdc000 },
|
||||
{ .description = "" }
|
||||
},
|
||||
.bios = { { 0 } }
|
||||
},
|
||||
{ .name = "", .description = "", .type = CONFIG_END }
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
const device_t lba_enhancer_device = {
|
||||
.name = "Vision Systems LBA Enhancer",
|
||||
.internal_name = "lba_enhancer",
|
||||
.flags = DEVICE_ISA16,
|
||||
.local = 0,
|
||||
.init = lba_enhancer_init,
|
||||
.close = lba_enhancer_close,
|
||||
.reset = NULL,
|
||||
.available = lba_enhancer_available,
|
||||
.speed_changed = NULL,
|
||||
.force_redraw = NULL,
|
||||
.config = lba_enhancer_config
|
||||
};
|
||||
@@ -214,7 +214,7 @@ static const device_config_t compaticard_ii_config[] = {
|
||||
},
|
||||
{
|
||||
.name = "dma",
|
||||
.description = "DMA channel",
|
||||
.description = "DMA",
|
||||
.type = CONFIG_SELECTION,
|
||||
.default_string = NULL,
|
||||
.default_int = 2,
|
||||
@@ -272,7 +272,7 @@ static const device_config_t compaticard_iv_config[] = {
|
||||
},
|
||||
{
|
||||
.name = "dma",
|
||||
.description = "DMA channel",
|
||||
.description = "DMA",
|
||||
.type = CONFIG_SELECTION,
|
||||
.default_string = NULL,
|
||||
.default_int = 2,
|
||||
|
||||
@@ -212,18 +212,9 @@ int
|
||||
fdd_get_from_internal_name(char *s)
|
||||
{
|
||||
int c = 0;
|
||||
char *n;
|
||||
|
||||
/* TODO: Remove this once the migration period is over. */
|
||||
if (!strcmp(s, "525_2hd_ps2"))
|
||||
n = "525_2hd";
|
||||
else if (!strcmp(s, "35_2hd_ps2"))
|
||||
n = "35_2hd";
|
||||
else
|
||||
n = s;
|
||||
|
||||
while (strlen(drive_types[c].internal_name)) {
|
||||
if (!strcmp((char *) drive_types[c].internal_name, n))
|
||||
if (!strcmp((char *) drive_types[c].internal_name, s))
|
||||
return c;
|
||||
c++;
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
*
|
||||
* Copyright 2016-2022 Miran Grca.
|
||||
* Copyright 2008-2018 Sarah Walker.
|
||||
* Copyright 2021 RichardG.
|
||||
* Copyright 2021 RichardG.
|
||||
* Copyright 2021-2025 Jasmine Iwanek.
|
||||
*/
|
||||
#include <stdio.h>
|
||||
@@ -90,11 +90,18 @@ static const struct {
|
||||
} joysticks[] = {
|
||||
{ &joystick_none },
|
||||
{ &joystick_2axis_2button },
|
||||
{ &joystick_2button_gamepad },
|
||||
{ &joystick_2button_flight_yoke },
|
||||
{ &joystick_2axis_4button },
|
||||
{ &joystick_4button_gamepad },
|
||||
{ &joystick_4button_flight_yoke },
|
||||
{ &joystick_2axis_6button },
|
||||
{ &joystick_2axis_8button },
|
||||
{ &joystick_3axis_2button },
|
||||
{ &joystick_2button_yoke_throttle },
|
||||
{ &joystick_3axis_4button },
|
||||
{ &joystick_win95_steering_wheel }, // Temp
|
||||
{ &joystick_4button_yoke_throttle },
|
||||
{ &joystick_4axis_4button },
|
||||
{ &joystick_ch_flightstick_pro },
|
||||
{ &joystick_ch_flightstick_pro_ch_pedals },
|
||||
@@ -245,7 +252,7 @@ gameport_write(UNUSED(uint16_t addr), UNUSED(uint8_t val), void *priv)
|
||||
/* Notify the interface. */
|
||||
joystick->intf->write(joystick->dat);
|
||||
|
||||
cycles -= ISA_CYCLES(8);
|
||||
cycles -= ISA_CYCLES((8 << is_pcjr));
|
||||
}
|
||||
|
||||
static uint8_t
|
||||
@@ -261,7 +268,7 @@ gameport_read(UNUSED(uint16_t addr), void *priv)
|
||||
/* Merge axis state with button state. */
|
||||
uint8_t ret = joystick->state | joystick->intf->read(joystick->dat);
|
||||
|
||||
cycles -= ISA_CYCLES(8);
|
||||
cycles -= ISA_CYCLES((8 << is_pcjr));
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -299,6 +306,9 @@ gameport_remap(void *priv, uint16_t address)
|
||||
gameport_t *dev = (gameport_t *) priv;
|
||||
gameport_t *other_dev;
|
||||
|
||||
if (dev == NULL)
|
||||
return;
|
||||
|
||||
if (dev->addr) {
|
||||
/* Remove this port from the active ports list. */
|
||||
if (active_gameports == dev) {
|
||||
|
||||
@@ -8,13 +8,14 @@
|
||||
*
|
||||
* Implementation of a standard joystick.
|
||||
*
|
||||
*
|
||||
*
|
||||
* Authors: Miran Grca, <mgrca8@gmail.com>
|
||||
* Sarah Walker, <https://pcem-emulator.co.uk/>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
* Jasmine Iwanek, <jriwanek@gmail.com>
|
||||
*
|
||||
* Copyright 2016-2018 Miran Grca.
|
||||
* Copyright 2008-2018 Sarah Walker.
|
||||
* Copyright 2021-2025 Jasmine Iwanek.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -147,6 +148,40 @@ joystick_standard_read_axis_4button(UNUSED(void *priv), int axis)
|
||||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
// For later use
|
||||
static int
|
||||
joystick_standard_read_axis_with_pov(UNUSED(void *priv), int axis)
|
||||
{
|
||||
if (!JOYSTICK_PRESENT(0, 0))
|
||||
return AXIS_NOT_PRESENT;
|
||||
|
||||
switch (axis) {
|
||||
case 0: // X-axis
|
||||
return joystick_state[0][0].axis[0];
|
||||
case 1: // Y-axis
|
||||
return joystick_state[0][0].axis[1];
|
||||
case 2: // POV Hat (mapped to the 3rd logical axis, index 2)
|
||||
if (joystick_state[0][0].pov[0] == -1)
|
||||
return 32767; // Centered/No input (as per tm_fcs_rcs_read_axis example)
|
||||
if (joystick_state[0][0].pov[0] > 315 || joystick_state[0][0].pov[0] < 45)
|
||||
return -32768; // Up
|
||||
if (joystick_state[0][0].pov[0] >= 45 && joystick_state[0][0].pov[0] < 135)
|
||||
return -16384; // Up-Right (example value, matches tm_fcs_rcs_read_axis)
|
||||
if (joystick_state[0][0].pov[0] >= 135 && joystick_state[0][0].pov[0] < 225)
|
||||
return 0; // Right/Left (example, matches tm_fcs_rcs_read_axis)
|
||||
if (joystick_state[0][0].pov[0] >= 225 && joystick_state[0][0].pov[0] < 315)
|
||||
return 16384; // Down-Left (example value, matches tm_fcs_rcs_read_axis)
|
||||
return 0; // Fallback
|
||||
case 3: // This case might be used for a Z-axis if present, or can return 0 if not.
|
||||
// For gamepads with only X/Y and POV, this will likely be unused or return 0.
|
||||
return 0;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static int
|
||||
joystick_standard_read_axis_3axis(UNUSED(void *priv), int axis)
|
||||
{
|
||||
@@ -257,6 +292,42 @@ const joystick_if_t joystick_2axis_2button = {
|
||||
.pov_names = { NULL }
|
||||
};
|
||||
|
||||
const joystick_if_t joystick_2button_gamepad = {
|
||||
.name = "2-button gamepad(s)",
|
||||
.internal_name = "2button_gamepad",
|
||||
.init = joystick_standard_init,
|
||||
.close = joystick_standard_close,
|
||||
.read = joystick_standard_read,
|
||||
.write = joystick_standard_write,
|
||||
.read_axis = joystick_standard_read_axis,
|
||||
.a0_over = joystick_standard_a0_over,
|
||||
.axis_count = 2,
|
||||
.button_count = 2,
|
||||
.pov_count = 0,
|
||||
.max_joysticks = 2,
|
||||
.axis_names = { "X axis", "Y axis" },
|
||||
.button_names = { "Button 1", "Button 2" },
|
||||
.pov_names = { NULL }
|
||||
};
|
||||
|
||||
const joystick_if_t joystick_2button_flight_yoke = {
|
||||
.name = "2-button flight yoke",
|
||||
.internal_name = "2button_flight_yoke",
|
||||
.init = joystick_standard_init,
|
||||
.close = joystick_standard_close,
|
||||
.read = joystick_standard_read,
|
||||
.write = joystick_standard_write,
|
||||
.read_axis = joystick_standard_read_axis,
|
||||
.a0_over = joystick_standard_a0_over,
|
||||
.axis_count = 2,
|
||||
.button_count = 2,
|
||||
.pov_count = 0,
|
||||
.max_joysticks = 2,
|
||||
.axis_names = { "Roll axis", "Pitch axis" },
|
||||
.button_names = { "Trigger", "Button 2" },
|
||||
.pov_names = { NULL }
|
||||
};
|
||||
|
||||
const joystick_if_t joystick_2axis_4button = {
|
||||
.name = "2-axis, 4-button joystick",
|
||||
.internal_name = "2axis_4button",
|
||||
@@ -275,6 +346,42 @@ const joystick_if_t joystick_2axis_4button = {
|
||||
.pov_names = { NULL }
|
||||
};
|
||||
|
||||
const joystick_if_t joystick_4button_gamepad = {
|
||||
.name = "4-button gamepad",
|
||||
.internal_name = "4button_gamepad",
|
||||
.init = joystick_standard_init,
|
||||
.close = joystick_standard_close,
|
||||
.read = joystick_standard_read_4button,
|
||||
.write = joystick_standard_write,
|
||||
.read_axis = joystick_standard_read_axis_4button,
|
||||
.a0_over = joystick_standard_a0_over,
|
||||
.axis_count = 2,
|
||||
.button_count = 4,
|
||||
.pov_count = 0,
|
||||
.max_joysticks = 1,
|
||||
.axis_names = { "X axis", "Y axis" },
|
||||
.button_names = { "Button 1", "Button 2", "Button 3", "Button 4" },
|
||||
.pov_names = { NULL }
|
||||
};
|
||||
|
||||
const joystick_if_t joystick_4button_flight_yoke = {
|
||||
.name = "4-button flight yoke",
|
||||
.internal_name = "4button_flight_yoke",
|
||||
.init = joystick_standard_init,
|
||||
.close = joystick_standard_close,
|
||||
.read = joystick_standard_read_4button,
|
||||
.write = joystick_standard_write,
|
||||
.read_axis = joystick_standard_read_axis_4button,
|
||||
.a0_over = joystick_standard_a0_over,
|
||||
.axis_count = 2,
|
||||
.button_count = 4,
|
||||
.pov_count = 0,
|
||||
.max_joysticks = 1,
|
||||
.axis_names = { "Roll axis", "Pitch axis" },
|
||||
.button_names = { "Trigger", "Button 2", "Button 3", "Button 4" },
|
||||
.pov_names = { NULL }
|
||||
};
|
||||
|
||||
const joystick_if_t joystick_3axis_2button = {
|
||||
.name = "3-axis, 2-button joystick",
|
||||
.internal_name = "3axis_2button",
|
||||
@@ -293,6 +400,24 @@ const joystick_if_t joystick_3axis_2button = {
|
||||
.pov_names = { NULL }
|
||||
};
|
||||
|
||||
const joystick_if_t joystick_2button_yoke_throttle = {
|
||||
.name = "2-button flight yoke with throttle",
|
||||
.internal_name = "2button_yoke_throttle",
|
||||
.init = joystick_standard_init,
|
||||
.close = joystick_standard_close,
|
||||
.read = joystick_standard_read,
|
||||
.write = joystick_standard_write,
|
||||
.read_axis = joystick_standard_read_axis_3axis,
|
||||
.a0_over = joystick_standard_a0_over,
|
||||
.axis_count = 3,
|
||||
.button_count = 2,
|
||||
.pov_count = 0,
|
||||
.max_joysticks = 1,
|
||||
.axis_names = { "Roll axis", "Pitch axis", "Throttle axis" },
|
||||
.button_names = { "Trigger", "Button 2" },
|
||||
.pov_names = { NULL }
|
||||
};
|
||||
|
||||
const joystick_if_t joystick_3axis_4button = {
|
||||
.name = "3-axis, 4-button joystick",
|
||||
.internal_name = "3axis_4button",
|
||||
@@ -311,6 +436,42 @@ const joystick_if_t joystick_3axis_4button = {
|
||||
.pov_names = { NULL }
|
||||
};
|
||||
|
||||
const joystick_if_t joystick_4button_yoke_throttle = {
|
||||
.name = "4-button flight yoke with throttle",
|
||||
.internal_name = "4button_yoke_throttle",
|
||||
.init = joystick_standard_init,
|
||||
.close = joystick_standard_close,
|
||||
.read = joystick_standard_read_4button,
|
||||
.write = joystick_standard_write,
|
||||
.read_axis = joystick_standard_read_axis_3axis,
|
||||
.a0_over = joystick_standard_a0_over,
|
||||
.axis_count = 3,
|
||||
.button_count = 4,
|
||||
.pov_count = 0,
|
||||
.max_joysticks = 1,
|
||||
.axis_names = { "Roll axis", "Pitch axis", "Throttle axis" },
|
||||
.button_names = { "Button 1", "Button 2", "Button 3", "Button 4" },
|
||||
.pov_names = { NULL }
|
||||
};
|
||||
|
||||
const joystick_if_t joystick_win95_steering_wheel = {
|
||||
.name = "Win95 Steering Wheel (3-axis, 4-button)",
|
||||
.internal_name = "win95_steering_wheel",
|
||||
.init = joystick_standard_init,
|
||||
.close = joystick_standard_close,
|
||||
.read = joystick_standard_read_4button,
|
||||
.write = joystick_standard_write,
|
||||
.read_axis = joystick_standard_read_axis_3axis,
|
||||
.a0_over = joystick_standard_a0_over,
|
||||
.axis_count = 3,
|
||||
.button_count = 4,
|
||||
.pov_count = 0,
|
||||
.max_joysticks = 1,
|
||||
.axis_names = { "Steering axis", "Accelerator axis", "Brake axis" },
|
||||
.button_names = { "Button 1", "Button 2", "Button 3", "Button 4" },
|
||||
.pov_names = { NULL }
|
||||
};
|
||||
|
||||
const joystick_if_t joystick_4axis_4button = {
|
||||
.name = "4-axis, 4-button joystick",
|
||||
.internal_name = "4axis_4button",
|
||||
|
||||
@@ -149,13 +149,14 @@ extern int fpu_type; /* (C) fpu type */
|
||||
extern int fpu_softfloat; /* (C) fpu uses softfloat */
|
||||
extern int time_sync; /* (C) enable time sync */
|
||||
extern int hdd_format_type; /* (C) hard disk file format */
|
||||
extern int lba_enhancer_enabled; /* (C) enable Vision Systems LBA Enhancer */
|
||||
extern int confirm_reset; /* (C) enable reset confirmation */
|
||||
extern int confirm_exit; /* (C) enable exit confirmation */
|
||||
extern int confirm_save; /* (C) enable save confirmation */
|
||||
extern int enable_discord; /* (C) enable Discord integration */
|
||||
extern int force_10ms; /* (C) force 10ms CPU frame interval */
|
||||
extern int other_ide_present; /* IDE controllers from non-IDE cards are present */
|
||||
extern int other_scsi_present; /* SCSI controllers from non-SCSI cards are present */
|
||||
extern int is_pcjr; /* The current machine is PCjr. */
|
||||
|
||||
extern int hard_reset_pending;
|
||||
extern int fixed_size_x;
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
*
|
||||
* Copyright 2016-2022 Miran Grca.
|
||||
* Copyright 2008-2018 Sarah Walker.
|
||||
* Copyright 2021 RichardG.
|
||||
* Copyright 2021 RichardG.
|
||||
* Copyright 2021-2025 Jasmine Iwanek.
|
||||
*/
|
||||
#ifndef EMU_GAMEPORT_H
|
||||
@@ -52,6 +52,26 @@
|
||||
#define GAMEPORT_8ADDR 0x080000
|
||||
#define GAMEPORT_SIO 0x1000000
|
||||
|
||||
typedef struct joystick_if_t {
|
||||
const char *name;
|
||||
const char *internal_name;
|
||||
|
||||
void *(*init)(void);
|
||||
void (*close)(void *priv);
|
||||
uint8_t (*read)(void *priv);
|
||||
void (*write)(void *priv);
|
||||
int (*read_axis)(void *priv, int axis);
|
||||
void (*a0_over)(void *priv);
|
||||
|
||||
int axis_count;
|
||||
int button_count;
|
||||
int pov_count;
|
||||
int max_joysticks;
|
||||
const char *axis_names[MAX_JOY_AXES];
|
||||
const char *button_names[MAX_JOY_BUTTONS];
|
||||
const char *pov_names[MAX_JOY_POVS];
|
||||
} joystick_if_t;
|
||||
|
||||
typedef struct plat_joystick_t {
|
||||
char name[260];
|
||||
|
||||
@@ -90,26 +110,6 @@ typedef struct joystick_t {
|
||||
int pov_mapping[MAX_JOY_POVS][2];
|
||||
} joystick_t;
|
||||
|
||||
typedef struct joystick_if_t {
|
||||
const char *name;
|
||||
const char *internal_name;
|
||||
|
||||
void *(*init)(void);
|
||||
void (*close)(void *priv);
|
||||
uint8_t (*read)(void *priv);
|
||||
void (*write)(void *priv);
|
||||
int (*read_axis)(void *priv, int axis);
|
||||
void (*a0_over)(void *priv);
|
||||
|
||||
int axis_count;
|
||||
int button_count;
|
||||
int pov_count;
|
||||
int max_joysticks;
|
||||
const char *axis_names[MAX_JOY_AXES];
|
||||
const char *button_names[MAX_JOY_BUTTONS];
|
||||
const char *pov_names[MAX_JOY_POVS];
|
||||
} joystick_if_t;
|
||||
|
||||
extern device_t game_ports[GAMEPORT_MAX];
|
||||
|
||||
#ifdef __cplusplus
|
||||
@@ -171,9 +171,16 @@ extern void gameport_remap(void *priv, uint16_t address);
|
||||
extern void *gameport_add(const device_t *gameport_type);
|
||||
|
||||
extern const joystick_if_t joystick_2axis_2button;
|
||||
extern const joystick_if_t joystick_2button_gamepad;
|
||||
extern const joystick_if_t joystick_2button_flight_yoke;
|
||||
extern const joystick_if_t joystick_2axis_4button;
|
||||
extern const joystick_if_t joystick_4button_gamepad;
|
||||
extern const joystick_if_t joystick_4button_flight_yoke;
|
||||
extern const joystick_if_t joystick_3axis_2button;
|
||||
extern const joystick_if_t joystick_2button_yoke_throttle;
|
||||
extern const joystick_if_t joystick_3axis_4button;
|
||||
extern const joystick_if_t joystick_4button_yoke_throttle;
|
||||
extern const joystick_if_t joystick_win95_steering_wheel;
|
||||
extern const joystick_if_t joystick_4axis_4button;
|
||||
extern const joystick_if_t joystick_2axis_6button;
|
||||
extern const joystick_if_t joystick_2axis_8button;
|
||||
@@ -186,14 +193,6 @@ extern const joystick_if_t joystick_sw_pad;
|
||||
extern const joystick_if_t joystick_tm_fcs;
|
||||
extern const joystick_if_t joystick_tm_fcs_rcs;
|
||||
|
||||
extern int gameport_available(int);
|
||||
extern int gameport_has_config(int);
|
||||
extern const char *gameport_get_internal_name(int);
|
||||
extern int gampeport_get_from_internal_name(char *);
|
||||
#ifdef EMU_DEVICE_H
|
||||
extern const device_t *gameport_getdevice(int);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -112,9 +112,6 @@ extern const device_t xtide_acculogic_device; /* xtide_ps2 */
|
||||
extern const device_t xtide_at_ps2_device; /* xtide_at_ps2 */
|
||||
extern const device_t xtide_at_ps2_2ch_device; /* xtide_at_ps2_2ch */
|
||||
|
||||
/* Miscellaneous */
|
||||
extern const device_t lba_enhancer_device;
|
||||
|
||||
extern void hdc_init(void);
|
||||
extern void hdc_reset(void);
|
||||
|
||||
|
||||
@@ -37,6 +37,7 @@ extern void lpt_set_ext(int port, uint8_t ext);
|
||||
extern void lpt_set_ecp(int port, uint8_t ecp);
|
||||
extern void lpt_set_epp(int port, uint8_t epp);
|
||||
extern void lpt_set_lv2(int port, uint8_t lv2);
|
||||
extern void lpt_set_fifo_threshold(int port, int threshold);
|
||||
extern void lpt_reset(void);
|
||||
extern void lpt_close(void);
|
||||
extern void lpt_init(void);
|
||||
|
||||
@@ -483,6 +483,8 @@ extern void mem_remap_top_nomid(int kb);
|
||||
|
||||
extern void umc_smram_recalc(uint32_t start, int set);
|
||||
|
||||
extern void pcjr_waitstates(void *);
|
||||
|
||||
extern mem_mapping_t *read_mapping[MEM_MAPPINGS_NO];
|
||||
extern mem_mapping_t *write_mapping[MEM_MAPPINGS_NO];
|
||||
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
#define MOUSE_TYPE_WACOM 12 /* WACOM tablet */
|
||||
#define MOUSE_TYPE_WACOMARTP 13 /* WACOM tablet (ArtPad) */
|
||||
#define MOUSE_TYPE_MSYSTEMSB 14 /* Mouse Systems bus mouse */
|
||||
#define MOUSE_TYPE_MSBPOINT 15 /* Microsoft Serial BallPoint mouse */
|
||||
|
||||
#define MOUSE_TYPE_ONBOARD 0x80 /* Mouse is an on-board version of one of the above. */
|
||||
|
||||
@@ -71,6 +72,7 @@ extern const device_t mouse_genibus_device;
|
||||
extern const device_t mouse_mssystems_device;
|
||||
extern const device_t mouse_mssystems_bus_device;
|
||||
extern const device_t mouse_msserial_device;
|
||||
extern const device_t mouse_msserial_ballpoint_device;
|
||||
extern const device_t mouse_ltserial_device;
|
||||
extern const device_t mouse_ps2_device;
|
||||
# ifdef USE_WACOM
|
||||
|
||||
@@ -41,89 +41,89 @@ typedef struct dp8390_t {
|
||||
|
||||
/* Command Register - 00h read/write */
|
||||
struct CR_t {
|
||||
int stop; /* STP - Software Reset command */
|
||||
int start; /* START - start the NIC */
|
||||
int tx_packet; /* TXP - initiate packet transmission */
|
||||
bool stop; /* STP - Software Reset command */
|
||||
bool start; /* START - start the NIC */
|
||||
bool tx_packet; /* TXP - initiate packet transmission */
|
||||
uint8_t rdma_cmd; /* RD0,RD1,RD2 - Remote DMA command */
|
||||
uint8_t pgsel; /* PS0,PS1 - Page select */
|
||||
} CR;
|
||||
|
||||
/* Interrupt Status Register - 07h read/write */
|
||||
struct ISR_t {
|
||||
int pkt_rx; /* PRX - packet received with no errors */
|
||||
int pkt_tx; /* PTX - packet txed with no errors */
|
||||
int rx_err; /* RXE - packet rxed with 1 or more errors */
|
||||
int tx_err; /* TXE - packet txed " " " " " */
|
||||
int overwrite; /* OVW - rx buffer resources exhausted */
|
||||
int cnt_oflow; /* CNT - network tally counter MSB's set */
|
||||
int rdma_done; /* RDC - remote DMA complete */
|
||||
int reset; /* RST - reset status */
|
||||
bool pkt_rx; /* PRX - packet received with no errors */
|
||||
bool pkt_tx; /* PTX - packet txed with no errors */
|
||||
bool rx_err; /* RXE - packet rxed with 1 or more errors */
|
||||
bool tx_err; /* TXE - packet txed " " " " " */
|
||||
bool overwrite; /* OVW - rx buffer resources exhausted */
|
||||
bool cnt_oflow; /* CNT - network tally counter MSB's set */
|
||||
bool rdma_done; /* RDC - remote DMA complete */
|
||||
bool reset; /* RST - reset status */
|
||||
} ISR;
|
||||
|
||||
/* Interrupt Mask Register - 0fh write */
|
||||
struct IMR_t {
|
||||
int rx_inte; /* PRXE - packet rx interrupt enable */
|
||||
int tx_inte; /* PTXE - packet tx interrput enable */
|
||||
int rxerr_inte; /* RXEE - rx error interrupt enable */
|
||||
int txerr_inte; /* TXEE - tx error interrupt enable */
|
||||
int overw_inte; /* OVWE - overwrite warn int enable */
|
||||
int cofl_inte; /* CNTE - counter o'flow int enable */
|
||||
int rdma_inte; /* RDCE - remote DMA complete int enable */
|
||||
int reserved; /* D7 - reserved */
|
||||
bool rx_inte; /* PRXE - packet rx interrupt enable */
|
||||
bool tx_inte; /* PTXE - packet tx interrput enable */
|
||||
bool rxerr_inte; /* RXEE - rx error interrupt enable */
|
||||
bool txerr_inte; /* TXEE - tx error interrupt enable */
|
||||
bool overw_inte; /* OVWE - overwrite warn int enable */
|
||||
bool cofl_inte; /* CNTE - counter o'flow int enable */
|
||||
bool rdma_inte; /* RDCE - remote DMA complete int enable */
|
||||
bool reserved; /* D7 - reserved */
|
||||
} IMR;
|
||||
|
||||
/* Data Configuration Register - 0eh write */
|
||||
struct DCR_t {
|
||||
int wdsize; /* WTS - 8/16-bit select */
|
||||
int endian; /* BOS - byte-order select */
|
||||
int longaddr; /* LAS - long-address select */
|
||||
int loop; /* LS - loopback select */
|
||||
int auto_rx; /* AR - auto-remove rx pkts with remote DMA */
|
||||
bool wdsize; /* WTS - 8/16-bit select */
|
||||
bool endian; /* BOS - byte-order select */
|
||||
bool longaddr; /* LAS - long-address select */
|
||||
bool loop; /* LS - loopback select */
|
||||
bool auto_rx; /* AR - auto-remove rx pkts with remote DMA */
|
||||
uint8_t fifo_size; /* FT0,FT1 - fifo threshold */
|
||||
} DCR;
|
||||
|
||||
/* Transmit Configuration Register - 0dh write */
|
||||
struct TCR_t {
|
||||
int crc_disable; /* CRC - inhibit tx CRC */
|
||||
bool crc_disable; /* CRC - inhibit tx CRC */
|
||||
uint8_t loop_cntl; /* LB0,LB1 - loopback control */
|
||||
int ext_stoptx; /* ATD - allow tx disable by external mcast */
|
||||
int coll_prio; /* OFST - backoff algorithm select */
|
||||
bool ext_stoptx; /* ATD - allow tx disable by external mcast */
|
||||
bool coll_prio; /* OFST - backoff algorithm select */
|
||||
uint8_t reserved; /* D5,D6,D7 - reserved */
|
||||
} TCR;
|
||||
|
||||
/* Transmit Status Register - 04h read */
|
||||
struct TSR_t {
|
||||
int tx_ok; /* PTX - tx complete without error */
|
||||
int reserved; /* D1 - reserved */
|
||||
int collided; /* COL - tx collided >= 1 times */
|
||||
int aborted; /* ABT - aborted due to excessive collisions */
|
||||
int no_carrier; /* CRS - carrier-sense lost */
|
||||
int fifo_ur; /* FU - FIFO underrun */
|
||||
int cd_hbeat; /* CDH - no tx cd-heartbeat from transceiver */
|
||||
int ow_coll; /* OWC - out-of-window collision */
|
||||
bool tx_ok; /* PTX - tx complete without error */
|
||||
bool reserved; /* D1 - reserved */
|
||||
bool collided; /* COL - tx collided >= 1 times */
|
||||
bool aborted; /* ABT - aborted due to excessive collisions */
|
||||
bool no_carrier; /* CRS - carrier-sense lost */
|
||||
bool fifo_ur; /* FU - FIFO underrun */
|
||||
bool cd_hbeat; /* CDH - no tx cd-heartbeat from transceiver */
|
||||
bool ow_coll; /* OWC - out-of-window collision */
|
||||
} TSR;
|
||||
|
||||
/* Receive Configuration Register - 0ch write */
|
||||
struct RCR_t {
|
||||
int errors_ok; /* SEP - accept pkts with rx errors */
|
||||
int runts_ok; /* AR - accept < 64-byte runts */
|
||||
int broadcast; /* AB - accept eth broadcast address */
|
||||
int multicast; /* AM - check mcast hash array */
|
||||
int promisc; /* PRO - accept all packets */
|
||||
int monitor; /* MON - check pkts, but don't rx */
|
||||
bool errors_ok; /* SEP - accept pkts with rx errors */
|
||||
bool runts_ok; /* AR - accept < 64-byte runts */
|
||||
bool broadcast; /* AB - accept eth broadcast address */
|
||||
bool multicast; /* AM - check mcast hash array */
|
||||
bool promisc; /* PRO - accept all packets */
|
||||
bool monitor; /* MON - check pkts, but don't rx */
|
||||
uint8_t reserved; /* D6,D7 - reserved */
|
||||
} RCR;
|
||||
|
||||
/* Receive Status Register - 0ch read */
|
||||
struct RSR_t {
|
||||
int rx_ok; /* PRX - rx complete without error */
|
||||
int bad_crc; /* CRC - Bad CRC detected */
|
||||
int bad_falign; /* FAE - frame alignment error */
|
||||
int fifo_or; /* FO - FIFO overrun */
|
||||
int rx_missed; /* MPA - missed packet error */
|
||||
int rx_mbit; /* PHY - unicast or mcast/bcast address match */
|
||||
int rx_disabled; /* DIS - set when in monitor mode */
|
||||
int deferred; /* DFR - collision active */
|
||||
bool rx_ok; /* PRX - rx complete without error */
|
||||
bool bad_crc; /* CRC - Bad CRC detected */
|
||||
bool bad_falign; /* FAE - frame alignment error */
|
||||
bool fifo_or; /* FO - FIFO overrun */
|
||||
bool rx_missed; /* MPA - missed packet error */
|
||||
bool rx_mbit; /* PHY - unicast or mcast/bcast address match */
|
||||
bool rx_disabled; /* DIS - set when in monitor mode */
|
||||
bool deferred; /* DFR - collision active */
|
||||
} RSR;
|
||||
|
||||
uint16_t local_dma; /* 01,02h read ; current local DMA addr */
|
||||
|
||||
@@ -19,6 +19,9 @@
|
||||
|
||||
#include <86box/rom.h>
|
||||
|
||||
#define INT_START_BLKNK_ENAB (1 << 0)
|
||||
#define INT_MASK 0xf
|
||||
|
||||
typedef struct xga_hwcursor_t {
|
||||
int ena;
|
||||
int x;
|
||||
@@ -84,13 +87,13 @@ typedef struct xga_t {
|
||||
uint8_t border_color;
|
||||
uint8_t direct_color;
|
||||
uint8_t dma_channel;
|
||||
uint8_t instance_isa;
|
||||
uint8_t instance_num;
|
||||
uint8_t ext_mem_addr;
|
||||
uint8_t vga_post;
|
||||
uint8_t addr_test;
|
||||
uint8_t *vram;
|
||||
uint8_t *changedvram;
|
||||
uint8_t int_ena;
|
||||
uint8_t int_stat;
|
||||
|
||||
int16_t hwc_pos_x;
|
||||
int16_t hwc_pos_y;
|
||||
@@ -151,7 +154,8 @@ typedef struct xga_t {
|
||||
int a5_test;
|
||||
int type;
|
||||
int bus;
|
||||
int busy;
|
||||
int src_reverse_order;
|
||||
int dst_reverse_order;
|
||||
|
||||
uint32_t linear_base;
|
||||
uint32_t linear_size;
|
||||
@@ -205,6 +209,10 @@ typedef struct xga_t {
|
||||
uint16_t dst_map_y;
|
||||
uint16_t pat_map_x;
|
||||
uint16_t pat_map_y;
|
||||
uint16_t clip_l;
|
||||
uint16_t clip_r;
|
||||
uint16_t clip_t;
|
||||
uint16_t clip_b;
|
||||
|
||||
int ssv_state;
|
||||
int pat_src;
|
||||
@@ -218,13 +226,13 @@ typedef struct xga_t {
|
||||
int y;
|
||||
int sx;
|
||||
int sy;
|
||||
int dx;
|
||||
int dy;
|
||||
int px;
|
||||
int py;
|
||||
int pattern;
|
||||
int command_len;
|
||||
int filling;
|
||||
int y_len;
|
||||
int x_len;
|
||||
|
||||
uint32_t short_stroke;
|
||||
uint32_t color_cmp;
|
||||
@@ -234,6 +242,7 @@ typedef struct xga_t {
|
||||
uint32_t bkgd_color;
|
||||
uint32_t command;
|
||||
uint32_t dir_cmd;
|
||||
uint32_t pattern_data;
|
||||
|
||||
uint8_t px_map_format[4];
|
||||
uint16_t px_map_width[4];
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
|
||||
#ifdef EMU_DEVICE_H
|
||||
extern const device_t xga_device;
|
||||
extern const device_t xga_isa_device;
|
||||
extern const device_t inmos_isa_device;
|
||||
#endif
|
||||
#endif /*VIDEO_XGA_DEVICE_H*/
|
||||
|
||||
@@ -180,9 +180,9 @@ static const device_config_t pbl300sx_config[] = {
|
||||
.file_filter = "",
|
||||
.spinner = { 0 },
|
||||
.bios = {
|
||||
{ .name = "1991", .internal_name = "pbl300sx_1991", .bios_type = BIOS_NORMAL,
|
||||
{ .name = "Phoenix ROM BIOS PLUS 1.10 - Revision 19910723091302", .internal_name = "pbl300sx_1991", .bios_type = BIOS_NORMAL,
|
||||
.files_no = 1, .local = 0, .size = 131072, .files = { "roms/machines/pbl300sx/V1.10_1113_910723.bin", "" } },
|
||||
{ .name = "1992", .internal_name = "pbl300sx", .bios_type = BIOS_NORMAL,
|
||||
{ .name = "Phoenix ROM BIOS PLUS 1.10 - Revision 19920910", .internal_name = "pbl300sx", .bios_type = BIOS_NORMAL,
|
||||
.files_no = 1, .local = 0, .size = 131072, .files = { "roms/machines/pbl300sx/pb_l300sx_1992.bin", "" } },
|
||||
{ .files_no = 0 }
|
||||
},
|
||||
@@ -391,46 +391,6 @@ machine_at_tuliptc7_init(const machine_t *model)
|
||||
return ret;
|
||||
}
|
||||
|
||||
int
|
||||
machine_at_micronics386_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_interleaved("roms/machines/micronics386/386-Micronics-09-00021-EVEN.BIN",
|
||||
"roms/machines/micronics386/386-Micronics-09-00021-ODD.BIN",
|
||||
0x000f0000, 65536, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_init(model);
|
||||
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int
|
||||
machine_at_micronics386px_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_interleaved("roms/machines/micronics386/386-Micronics-09-00021-LO.BIN",
|
||||
"roms/machines/micronics386/386-Micronics-09-00021-HI.BIN",
|
||||
0x000f0000, 65536, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_init(model);
|
||||
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void
|
||||
machine_at_scat_init(const machine_t *model, int is_v4, int is_ami)
|
||||
{
|
||||
@@ -899,9 +859,9 @@ static const device_config_t dells333sl_config[] = {
|
||||
.file_filter = "",
|
||||
.spinner = { 0 },
|
||||
.bios = {
|
||||
{ .name = "J01 (Jostens Learning Corporation OEM)", .internal_name = "dells333sl_j01", .bios_type = BIOS_NORMAL,
|
||||
{ .name = "Phoenix ROM BIOS PLUS 1.10 - Revision J01 (Jostens Learning Corporation OEM)", .internal_name = "dells333sl_j01", .bios_type = BIOS_NORMAL,
|
||||
.files_no = 1, .local = 0, .size = 131072, .files = { "roms/machines/dells333sl/DELL386.BIN", "" } },
|
||||
{ .name = "A02", .internal_name = "dells333sl", .bios_type = BIOS_NORMAL,
|
||||
{ .name = "Phoenix ROM BIOS PLUS 1.10 - Revision A02", .internal_name = "dells333sl", .bios_type = BIOS_NORMAL,
|
||||
.files_no = 1, .local = 0, .size = 131072, .files = { "roms/machines/dells333sl/Dell_386SX_30807_UBIOS_B400_VLSI_VL82C311_Cirrus_Logic_GD5420.bin", "" } },
|
||||
{ .files_no = 0 }
|
||||
},
|
||||
|
||||
@@ -860,11 +860,11 @@ static const device_config_t pb450_config[] = {
|
||||
.file_filter = "",
|
||||
.spinner = { 0 },
|
||||
.bios = {
|
||||
{ .name = "PCI 1.0A", .internal_name = "pb450a" /*"pci10a"*/, .bios_type = BIOS_NORMAL,
|
||||
{ .name = "PhoenixBIOS 4.03 - Revision PCI 1.0A", .internal_name = "pb450a_pci10a" /*"pci10a"*/, .bios_type = BIOS_NORMAL,
|
||||
.files_no = 1, .local = 0, .size = 131072, .files = { "roms/machines/pb450/OPTI802.bin", "" } },
|
||||
{ .name = "PNP 1.1A", .internal_name = "pnp11a", .bios_type = BIOS_NORMAL,
|
||||
{ .name = "PhoenixBIOS 4.03 - Revision PNP 1.1A", .internal_name = "pb450a", .bios_type = BIOS_NORMAL,
|
||||
.files_no = 1, .local = 0, .size = 131072, .files = { "roms/machines/pb450/PNP11A.bin", "" } },
|
||||
{ .name = "P4HS20 (Micro Firmware/Phoenix 4.05)", .internal_name = "p4hs20", .bios_type = BIOS_NORMAL,
|
||||
{ .name = "PhoenixBIOS 4.05 - Revision P4HS20 (by Micro Firmware)", .internal_name = "pb450a_p4hs20", .bios_type = BIOS_NORMAL,
|
||||
.files_no = 1, .local = 0, .size = 131072, .files = { "roms/machines/pb450/p4hs20.bin", "" } },
|
||||
{ .files_no = 0 }
|
||||
},
|
||||
@@ -1769,11 +1769,11 @@ static const device_config_t sb486pv_config[] = {
|
||||
.file_filter = "",
|
||||
.spinner = { 0 },
|
||||
.bios = {
|
||||
{ .name = "AMI 062594 (0108)", .internal_name = "sb486pv", .bios_type = BIOS_NORMAL,
|
||||
{ .name = "AMI WinBIOS (062594) - Revision 0108", .internal_name = "sb486pv_0108", .bios_type = BIOS_NORMAL,
|
||||
.files_no = 1, .local = 0, .size = 131072, .files = { "roms/machines/sb486pv/41-0108-062594-SATURN2.rom", "" } },
|
||||
{ .name = "AMI 062594 (0301)", .internal_name = "sb486pv_94", .bios_type = BIOS_NORMAL,
|
||||
{ .name = "AMI WinBIOS (062594) - Revision 0301", .internal_name = "sb486pv_0301", .bios_type = BIOS_NORMAL,
|
||||
.files_no = 1, .local = 0, .size = 131072, .files = { "roms/machines/sb486pv/0301-062594-SATURN2.rom", "" } },
|
||||
{ .name = "AMI 071595 (1301)", .internal_name = "sb486pv_95", .bios_type = BIOS_NORMAL,
|
||||
{ .name = "AMIBIOS 6 (071595) - Revision 1301", .internal_name = "sb486pv", .bios_type = BIOS_NORMAL,
|
||||
.files_no = 1, .local = 0, .size = 131072, .files = { "roms/machines/sb486pv/amiboot.rom", "" } },
|
||||
{ .files_no = 0 }
|
||||
},
|
||||
@@ -2296,9 +2296,9 @@ static const device_config_t hot433a_config[] = {
|
||||
.file_filter = "",
|
||||
.spinner = { 0 },
|
||||
.bios = {
|
||||
{ .name = "AMI", .internal_name = "hot433a", .bios_type = BIOS_NORMAL,
|
||||
{ .name = "AMIBIOS 5 (101094) - Revision 433AUS33", .internal_name = "hot433a", .bios_type = BIOS_NORMAL,
|
||||
.files_no = 1, .local = 0, .size = 131072, .files = { "roms/machines/hot433/433AUS33.ROM", "" } },
|
||||
{ .name = "Award (eSupport update)", .internal_name = "hot433a_award", .bios_type = BIOS_NORMAL,
|
||||
{ .name = "AwardBIOS v4.51PG - Revision 2.5 (by eSupport)", .internal_name = "hot433a_v451pg", .bios_type = BIOS_NORMAL,
|
||||
.files_no = 1, .local = 0, .size = 131072, .files = { "roms/machines/hot433/2A4X5H21.BIN", "" } },
|
||||
{ .files_no = 0 }
|
||||
},
|
||||
@@ -2919,3 +2919,45 @@ machine_at_cougar_init(const machine_t *model)
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int
|
||||
machine_at_micronics386_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_interleaved("roms/machines/micronics386/386-Micronics-09-00021-EVEN.BIN",
|
||||
"roms/machines/micronics386/386-Micronics-09-00021-ODD.BIN",
|
||||
0x000f0000, 65536, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_init(model);
|
||||
device_add(&port_92_device);
|
||||
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int
|
||||
machine_at_micronics386px_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_interleaved("roms/machines/micronics386/386-Micronics-09-00021-LO.BIN",
|
||||
"roms/machines/micronics386/386-Micronics-09-00021-HI.BIN",
|
||||
0x000f0000, 65536, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_init(model);
|
||||
device_add(&port_92_device);
|
||||
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ machine_at_v12p_init(const machine_t *model)
|
||||
return ret;
|
||||
|
||||
device_context(model->device);
|
||||
fn = device_get_bios_file(machine_get_device(machine), device_get_config_bios("bios_versions"), 0);
|
||||
fn = device_get_bios_file(machine_get_device(machine), device_get_config_bios("bios"), 0);
|
||||
ret = bios_load_linear(fn, 0x000e0000, 131072, 0);
|
||||
device_context_restore();
|
||||
|
||||
@@ -79,30 +79,28 @@ machine_at_v12p_init(const machine_t *model)
|
||||
static const device_config_t v12p_config[] = {
|
||||
// clang-format off
|
||||
{
|
||||
.name = "bios_versions",
|
||||
.description = "BIOS Versions",
|
||||
.name = "bios",
|
||||
.description = "BIOS Version",
|
||||
.type = CONFIG_BIOS,
|
||||
.default_string = "v12p_14",
|
||||
.default_string = "v12p",
|
||||
.default_int = 0,
|
||||
.file_filter = "",
|
||||
.spinner = { 0 }, /*W1*/
|
||||
.bios = {
|
||||
{ .name = "Core Version 1.2 Version R1.4", .internal_name = "v12p_14", .bios_type = BIOS_NORMAL,
|
||||
{ .name = "Acer BIOS V1.2 - Revision R1.4", .internal_name = "v12p_r14", .bios_type = BIOS_NORMAL,
|
||||
.files_no = 1, .local = 0, .size = 131072, .files = { "roms/machines/v12p/v12p_14.bin", "" } },
|
||||
{ .name = "Core Version 1.2 Version R1.6", .internal_name = "v12p_16", .bios_type = BIOS_NORMAL,
|
||||
{ .name = "Acer BIOS V1.2 - Revision R1.6", .internal_name = "v12p", .bios_type = BIOS_NORMAL,
|
||||
.files_no = 1, .local = 0, .size = 131072, .files = { "roms/machines/v12p/v12p_16.bin", "" } },
|
||||
|
||||
{ .files_no = 0 }
|
||||
},
|
||||
},
|
||||
{ .name = "", .description = "", .type = CONFIG_END }
|
||||
// clang-format on
|
||||
};
|
||||
|
||||
|
||||
|
||||
const device_t v12p_device = {
|
||||
.name = "Acer V12P",
|
||||
.internal_name = "v12p",
|
||||
.internal_name = "v12p_device",
|
||||
.flags = 0,
|
||||
.local = 0,
|
||||
.init = NULL,
|
||||
@@ -111,7 +109,7 @@ const device_t v12p_device = {
|
||||
.available = NULL,
|
||||
.speed_changed = NULL,
|
||||
.force_redraw = NULL,
|
||||
.config = &v12p_config[0]
|
||||
.config = v12p_config
|
||||
};
|
||||
|
||||
void
|
||||
|
||||
@@ -92,10 +92,10 @@ machine_at_d842_init(const machine_t *model)
|
||||
return ret;
|
||||
|
||||
device_context(model->device);
|
||||
fn = device_get_bios_file(machine_get_device(machine), device_get_config_bios("bios_versions"), 0);
|
||||
fn = device_get_bios_file(machine_get_device(machine), device_get_config_bios("bios"), 0);
|
||||
ret = bios_load_linear(fn, 0x000e0000, 131072, 0);
|
||||
device_context_restore();
|
||||
|
||||
|
||||
machine_at_common_init(model);
|
||||
|
||||
device_add(&ide_pci_2ch_device);
|
||||
@@ -118,37 +118,36 @@ machine_at_d842_init(const machine_t *model)
|
||||
static const device_config_t d842_config[] = {
|
||||
// clang-format off
|
||||
{
|
||||
.name = "bios_versions",
|
||||
.description = "BIOS Versions",
|
||||
.name = "bios",
|
||||
.description = "BIOS Version",
|
||||
.type = CONFIG_BIOS,
|
||||
.default_string = "d842",
|
||||
.default_int = 0,
|
||||
.file_filter = "",
|
||||
.spinner = { 0 }, /*W1*/
|
||||
.bios = {
|
||||
{ .name = "Version 1.03 Revision 1.03.842 (11/24/1994)", .internal_name = "d842", .bios_type = BIOS_NORMAL,
|
||||
{ .name = "PhoenixBIOS Pentium 1.03 - Revision 1.03.842", .internal_name = "d842_103", .bios_type = BIOS_NORMAL,
|
||||
.files_no = 1, .local = 0, .size = 131072, .files = { "roms/machines/d842/d842.BIN", "" } },
|
||||
{ .name = "Version 4.04 Revision 1.05.842 (03/15/1996)", .internal_name = "d842_mar96", .bios_type = BIOS_NORMAL,
|
||||
.files_no = 1, .local = 0, .size = 131072, .files = { "roms/machines/d842/d842_mar96.bin", "" } },
|
||||
{ .name = "Version 4.04 Revision 1.06.842 (04/03/1998)", .internal_name = "d842_apr98", .bios_type = BIOS_NORMAL,
|
||||
.files_no = 1, .local = 0, .size = 131072, .files = { "roms/machines/d842/d842_apr98.bin", "" } },
|
||||
{ .name = "Version 4.04 Revision 1.07.842 (06/02/1998)", .internal_name = "d842_jun98", .bios_type = BIOS_NORMAL,
|
||||
.files_no = 1, .local = 0, .size = 131072, .files = { "roms/machines/d842/d842_jun98.BIN", "" } },
|
||||
{ .name = "Version 1.03 Revision 1.09.842 (07/08/1996)", .internal_name = "d842_jul96", .bios_type = BIOS_NORMAL,
|
||||
{ .name = "PhoenixBIOS Pentium 1.03 - Revision 1.09.842", .internal_name = "d842_109", .bios_type = BIOS_NORMAL,
|
||||
.files_no = 1, .local = 0, .size = 131072, .files = { "roms/machines/d842/d842_jul96.bin", "" } },
|
||||
{ .name = "Version 1.03 Revision 1.10.842 (06/04/1998)", .internal_name = "d842_jun98_1", .bios_type = BIOS_NORMAL,
|
||||
{ .name = "PhoenixBIOS Pentium 1.03 - Revision 1.10.842", .internal_name = "d842", .bios_type = BIOS_NORMAL,
|
||||
.files_no = 1, .local = 0, .size = 131072, .files = { "roms/machines/d842/d842_jun98_1.bin", "" } },
|
||||
{ .name = "PhoenixBIOS 4.04 - Revision 1.05.842", .internal_name = "d842_105", .bios_type = BIOS_NORMAL,
|
||||
.files_no = 1, .local = 0, .size = 131072, .files = { "roms/machines/d842/d842_mar96.bin", "" } },
|
||||
{ .name = "PhoenixBIOS 4.04 - Revision 1.06.842", .internal_name = "d842_106", .bios_type = BIOS_NORMAL,
|
||||
.files_no = 1, .local = 0, .size = 131072, .files = { "roms/machines/d842/d842_apr98.bin", "" } },
|
||||
{ .name = "PhoenixBIOS 4.04 - Revision 1.07.842", .internal_name = "d842_107", .bios_type = BIOS_NORMAL,
|
||||
.files_no = 1, .local = 0, .size = 131072, .files = { "roms/machines/d842/d842_jun98.BIN", "" } },
|
||||
{ .files_no = 0 }
|
||||
},
|
||||
},
|
||||
{ .name = "", .description = "", .type = CONFIG_END }
|
||||
// clang-format on
|
||||
};
|
||||
|
||||
|
||||
|
||||
const device_t d842_device = {
|
||||
.name = "Siemens-Nixdorf D842",
|
||||
.internal_name = "d842",
|
||||
.internal_name = "d842_device",
|
||||
.flags = 0,
|
||||
.local = 0,
|
||||
.init = NULL,
|
||||
@@ -157,7 +156,7 @@ const device_t d842_device = {
|
||||
.available = NULL,
|
||||
.speed_changed = NULL,
|
||||
.force_redraw = NULL,
|
||||
.config = &d842_config[0]
|
||||
.config = d842_config
|
||||
};
|
||||
|
||||
int
|
||||
@@ -195,10 +194,10 @@ machine_at_p54np4_init(const machine_t *model)
|
||||
|
||||
pci_init(PCI_CONFIG_TYPE_2 | PCI_CAN_SWITCH_TYPE);
|
||||
pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0);
|
||||
pci_register_slot(0x06, PCI_CARD_NORMAL, 1, 2, 3, 4); /* 06 = Slot 1 */
|
||||
pci_register_slot(0x05, PCI_CARD_NORMAL, 2, 3, 4, 1); /* 05 = Slot 2 */
|
||||
pci_register_slot(0x04, PCI_CARD_NORMAL, 3, 4, 1, 2); /* 04 = Slot 3 */
|
||||
pci_register_slot(0x03, PCI_CARD_NORMAL, 4, 1, 2, 3); /* 03 = Slot 4 */
|
||||
pci_register_slot(0x07, PCI_CARD_NORMAL, 1, 2, 3, 4); /* 07 = Slot 1 */
|
||||
pci_register_slot(0x06, PCI_CARD_NORMAL, 2, 3, 4, 1); /* 06 = Slot 2 */
|
||||
pci_register_slot(0x05, PCI_CARD_NORMAL, 3, 4, 1, 2); /* 05 = Slot 3 */
|
||||
pci_register_slot(0x04, PCI_CARD_NORMAL, 4, 1, 2, 3); /* 04 = Slot 4 */
|
||||
pci_register_slot(0x02, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0);
|
||||
device_add(&i430nx_device);
|
||||
device_add(&sio_zb_device);
|
||||
@@ -237,7 +236,7 @@ machine_at_tek932_init(const machine_t *model)
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
|
||||
machine_at_common_init(model);
|
||||
|
||||
pci_init(PCI_CONFIG_TYPE_2 | PCI_CAN_SWITCH_TYPE);
|
||||
|
||||
@@ -624,7 +624,7 @@ machine_at_d943_init(const machine_t *model)
|
||||
return ret;
|
||||
|
||||
device_context(model->device);
|
||||
fn = device_get_bios_file(machine_get_device(machine), device_get_config_bios("bios_versions"), 0);
|
||||
fn = device_get_bios_file(machine_get_device(machine), device_get_config_bios("bios"), 0);
|
||||
ret = bios_load_linear(fn, 0x000e0000, 131072, 0);
|
||||
device_context_restore();
|
||||
|
||||
@@ -657,22 +657,23 @@ machine_at_d943_init(const machine_t *model)
|
||||
static const device_config_t d943_config[] = {
|
||||
// clang-format off
|
||||
{
|
||||
.name = "bios_versions",
|
||||
.description = "BIOS Versions",
|
||||
.name = "bios",
|
||||
.description = "BIOS Version",
|
||||
.type = CONFIG_BIOS,
|
||||
.default_string = "d943_oct96",
|
||||
.default_string = "d943",
|
||||
.default_int = 0,
|
||||
.file_filter = "",
|
||||
.spinner = { 0 }, /*W1*/
|
||||
.bios = {
|
||||
{ .name = "Version 4.05 Revision 1.02.943 (10/28/1996)", .internal_name = "d943_oct96", .bios_type = BIOS_NORMAL,
|
||||
{ .name = "PhoenixBIOS 4.05 - Revision 1.02.943", .internal_name = "d943_oct96", .bios_type = BIOS_NORMAL,
|
||||
.files_no = 1, .local = 0, .size = 131072, .files = { "roms/machines/d943/d943_oct96.bin", "" } },
|
||||
{ .name = "Version 4.05 Revision 1.03.943 (12/12/1996)", .internal_name = "d943_dec96", .bios_type = BIOS_NORMAL,
|
||||
{ .name = "PhoenixBIOS 4.05 - Revision 1.03.943", .internal_name = "d943_dec96", .bios_type = BIOS_NORMAL,
|
||||
.files_no = 1, .local = 0, .size = 131072, .files = { "roms/machines/d943/d943_dec96.bin", "" } },
|
||||
{ .name = "Version 4.05 Revision 1.05.943 (09/04/1997)", .internal_name = "d943_sept97", .bios_type = BIOS_NORMAL,
|
||||
{ .name = "PhoenixBIOS 4.05 - Revision 1.05.943", .internal_name = "d943_sept97", .bios_type = BIOS_NORMAL,
|
||||
.files_no = 1, .local = 0, .size = 131072, .files = { "roms/machines/d943/d943_sept97.bin", "" } },
|
||||
{ .name = "Version 4.05 Revision 1.06.943 (10/29/1997)", .internal_name = "d943_oct97", .bios_type = BIOS_NORMAL,
|
||||
{ .name = "PhoenixBIOS 4.05 - Revision 1.06.943", .internal_name = "d943", .bios_type = BIOS_NORMAL,
|
||||
.files_no = 1, .local = 0, .size = 131072, .files = { "roms/machines/d943/d943_oct97.bin", "" } },
|
||||
{ .files_no = 0 }
|
||||
},
|
||||
},
|
||||
{ .name = "", .description = "", .type = CONFIG_END }
|
||||
@@ -683,7 +684,7 @@ static const device_config_t d943_config[] = {
|
||||
|
||||
const device_t d943_device = {
|
||||
.name = "Siemens-Nixdorf D943",
|
||||
.internal_name = "d943",
|
||||
.internal_name = "d943_device",
|
||||
.flags = 0,
|
||||
.local = 0,
|
||||
.init = NULL,
|
||||
@@ -692,7 +693,7 @@ const device_t d943_device = {
|
||||
.available = NULL,
|
||||
.speed_changed = NULL,
|
||||
.force_redraw = NULL,
|
||||
.config = &d943_config[0]
|
||||
.config = d943_config
|
||||
};
|
||||
|
||||
int
|
||||
@@ -800,11 +801,11 @@ static const device_config_t ap5s_config[] = {
|
||||
.file_filter = "",
|
||||
.spinner = { 0 },
|
||||
.bios = {
|
||||
{ .name = "04/22/96 1.20 4.50PG", .internal_name = "ap5s_450pg", .bios_type = BIOS_NORMAL,
|
||||
{ .name = "AwardBIOS v4.50PG - Revision R1.20", .internal_name = "ap5s_450pg", .bios_type = BIOS_NORMAL,
|
||||
.files_no = 1, .local = 0, .size = 131072, .files = { "roms/machines/ap5s/ap5s120.bin", "" } },
|
||||
{ .name = "11/13/96 1.50 4.51PG", .internal_name = "ap5s", .bios_type = BIOS_NORMAL,
|
||||
{ .name = "AwardBIOS v4.51PG - Revision R1.50", .internal_name = "ap5s_r150", .bios_type = BIOS_NORMAL,
|
||||
.files_no = 1, .local = 0, .size = 131072, .files = { "roms/machines/ap5s/AP5S150.BIN", "" } },
|
||||
{ .name = "06/25/97 1.60 4.51PG", .internal_name = "ap5s_latest", .bios_type = BIOS_NORMAL,
|
||||
{ .name = "AwardBIOS v4.51PG - Revision R1.60", .internal_name = "ap5s", .bios_type = BIOS_NORMAL,
|
||||
.files_no = 1, .local = 0, .size = 131072, .files = { "roms/machines/ap5s/ap5s160.bin", "" } },
|
||||
{ .files_no = 0 }
|
||||
},
|
||||
@@ -961,11 +962,11 @@ static const device_config_t c5sbm2_config[] = {
|
||||
.file_filter = "",
|
||||
.spinner = { 0 },
|
||||
.bios = {
|
||||
{ .name = "4.50GP (07/17/1995)", .internal_name = "5sbm2", .bios_type = BIOS_NORMAL,
|
||||
{ .name = "AwardBIOS v4.50GP - Revision 07/17/1995", .internal_name = "5sbm2_v450gp", .bios_type = BIOS_NORMAL,
|
||||
.files_no = 1, .local = 0, .size = 131072, .files = { "roms/machines/5sbm2/5SBM0717.BIN", "" } },
|
||||
{ .name = "4.50PG (03/21/1996)", .internal_name = "5sbm2_450pg", .bios_type = BIOS_NORMAL,
|
||||
{ .name = "AwardBIOS v4.50PG - Revision 03/26/1996", .internal_name = "5sbm2", .bios_type = BIOS_NORMAL,
|
||||
.files_no = 1, .local = 0, .size = 131072, .files = { "roms/machines/5sbm2/5SBM0326.BIN", "" } },
|
||||
{ .name = "4.51PG (03/15/2000 Unicore Upgrade)", .internal_name = "5sbm2_451pg", .bios_type = BIOS_NORMAL,
|
||||
{ .name = "AwardBIOS v4.51PG - Revision 2.2 (by Unicore Software)", .internal_name = "5sbm2_451pg", .bios_type = BIOS_NORMAL,
|
||||
.files_no = 1, .local = 0, .size = 131072, .files = { "roms/machines/5sbm2/2A5ICC3A.BIN", "" } },
|
||||
{ .files_no = 0 }
|
||||
},
|
||||
|
||||
@@ -829,6 +829,8 @@ machine_pcjr_init(UNUSED(const machine_t *model))
|
||||
|
||||
pcjr = calloc(1, sizeof(pcjr_t));
|
||||
|
||||
is_pcjr = 1;
|
||||
|
||||
pic_init_pcjr();
|
||||
pit_common_init(0, pit_irq0_timer_pcjr, NULL);
|
||||
|
||||
|
||||
@@ -123,6 +123,8 @@ machine_init_ex(int m)
|
||||
pci_flags = 0x00000000;
|
||||
}
|
||||
|
||||
is_pcjr = 0;
|
||||
|
||||
/* All good, boot the machine! */
|
||||
if (machines[m].init)
|
||||
ret = machines[m].init(&machines[m]);
|
||||
|
||||
@@ -1564,7 +1564,7 @@ const machine_t machines[] = {
|
||||
},
|
||||
{
|
||||
.name = "[8088] Tandy 1000 SX",
|
||||
.internal_name = "tandy",
|
||||
.internal_name = "tandy1000sx",
|
||||
.type = MACHINE_TYPE_8088,
|
||||
.chipset = MACHINE_CHIPSET_PROPRIETARY,
|
||||
.init = machine_tandy1000sx_init,
|
||||
@@ -7440,7 +7440,7 @@ const machine_t machines[] = {
|
||||
.min_multi = 0,
|
||||
.max_multi = 0
|
||||
},
|
||||
.bus_flags = MACHINE_PS2_VLB,
|
||||
.bus_flags = MACHINE_VLB,
|
||||
.flags = MACHINE_IDE | MACHINE_APM,
|
||||
.ram = {
|
||||
.min = 2048,
|
||||
|
||||
@@ -1840,6 +1840,9 @@ mem_read_ram(uint32_t addr, UNUSED(void *priv))
|
||||
mem_log("Read B %02X from %08X\n", ram[addr], addr);
|
||||
#endif
|
||||
|
||||
if (is_pcjr)
|
||||
pcjr_waitstates(NULL);
|
||||
|
||||
if (cpu_use_exec)
|
||||
addreadlookup(mem_logical_addr, addr);
|
||||
|
||||
@@ -2100,6 +2103,9 @@ mem_write_ram(uint32_t addr, uint8_t val, UNUSED(void *priv))
|
||||
if ((addr >= 0xa0000) && (addr <= 0xbffff))
|
||||
mem_log("Write B %02X to %08X\n", val, addr);
|
||||
#endif
|
||||
if (is_pcjr)
|
||||
pcjr_waitstates(NULL);
|
||||
|
||||
if (cpu_use_exec) {
|
||||
addwritelookup(mem_logical_addr, addr);
|
||||
mem_write_ramb_page(addr, val, &pages[addr >> 12]);
|
||||
|
||||
@@ -45,6 +45,7 @@
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdarg.h>
|
||||
#include <wchar.h>
|
||||
#include <time.h>
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdarg.h>
|
||||
#include <wchar.h>
|
||||
#include <time.h>
|
||||
@@ -198,6 +199,11 @@ dp8390_write_cr(dp8390_t *dev, uint32_t val)
|
||||
if (dev->TCR.loop_cntl) {
|
||||
dp8390_rx_common(dev, &dev->mem[((dev->tx_page_start * 256) - dev->mem_start) & dev->mem_wrap],
|
||||
dev->tx_bytes);
|
||||
|
||||
if (dev->IMR.rx_inte && !dev->ISR.pkt_tx && dev->interrupt)
|
||||
dev->interrupt(dev->priv, 1);
|
||||
|
||||
dev->ISR.pkt_tx = 1;
|
||||
}
|
||||
} else if (val & 0x04) {
|
||||
if (dev->CR.stop || (!dev->CR.start && (dev->flags & DP8390_FLAG_CHECK_CR))) {
|
||||
@@ -220,12 +226,6 @@ dp8390_write_cr(dp8390_t *dev, uint32_t val)
|
||||
if (!(dev->card->link_state & NET_LINK_DOWN))
|
||||
network_tx(dev->card, &dev->mem[((dev->tx_page_start * 256) - dev->mem_start) & dev->mem_wrap], dev->tx_bytes);
|
||||
|
||||
/* some more debug */
|
||||
#ifdef ENABLE_DP8390_LOG
|
||||
if (dev->tx_timer_active)
|
||||
dp8390_log("DP8390: CR write, tx timer still active\n");
|
||||
#endif
|
||||
|
||||
dp8390_tx(dev, val);
|
||||
}
|
||||
|
||||
@@ -247,12 +247,12 @@ dp8390_tx(dp8390_t *dev, UNUSED(uint32_t val))
|
||||
{
|
||||
dev->CR.tx_packet = 0;
|
||||
dev->TSR.tx_ok = 1;
|
||||
dev->ISR.pkt_tx = 1;
|
||||
|
||||
/* Generate an interrupt if not masked */
|
||||
if (dev->IMR.tx_inte && dev->interrupt)
|
||||
if (dev->IMR.tx_inte && !dev->ISR.pkt_tx && dev->interrupt)
|
||||
dev->interrupt(dev->priv, 1);
|
||||
dev->tx_timer_active = 0;
|
||||
|
||||
dev->ISR.pkt_tx = 1;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -960,7 +960,6 @@ dp8390_reset(dp8390_t *dev)
|
||||
memset(&dev->TCR, 0x00, sizeof(dev->TCR));
|
||||
memset(&dev->TSR, 0x00, sizeof(dev->TSR));
|
||||
memset(&dev->RSR, 0x00, sizeof(dev->RSR));
|
||||
dev->tx_timer_active = 0;
|
||||
dev->local_dma = 0;
|
||||
dev->page_start = 0;
|
||||
dev->page_stop = 0;
|
||||
|
||||
@@ -48,6 +48,7 @@
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdarg.h>
|
||||
#include <wchar.h>
|
||||
#include <time.h>
|
||||
@@ -933,7 +934,7 @@ nic_init(const device_t *info)
|
||||
if (dev->board != NE2K_ETHERNEXT_MC) {
|
||||
dev->base_address = device_get_config_hex16("base");
|
||||
dev->base_irq = device_get_config_int("irq");
|
||||
if ((dev->board == NE2K_NE2000) || (dev->board == NE2K_NE2000_COMPAT) ||
|
||||
if ((dev->board == NE2K_NE2000) || (dev->board == NE2K_NE2000_COMPAT) ||
|
||||
(dev->board == NE2K_NE2000_COMPAT_8BIT) ) {
|
||||
dev->bios_addr = device_get_config_hex20("bios_addr");
|
||||
dev->has_bios = !!dev->bios_addr;
|
||||
@@ -1061,7 +1062,7 @@ nic_init(const device_t *info)
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (set_oui) {
|
||||
/* See if we have a local MAC address configured. */
|
||||
mac_oui = device_get_config_mac("mac_oui", -1);
|
||||
@@ -1742,7 +1743,7 @@ const device_t ne2000_compat_device = {
|
||||
const device_t ne2000_compat_8bit_device = {
|
||||
.name = "NE2000 Compatible 8-bit",
|
||||
.internal_name = "ne2k8",
|
||||
.flags = DEVICE_ISA,
|
||||
.flags = DEVICE_ISA,
|
||||
.local = NE2K_NE2000_COMPAT_8BIT,
|
||||
.init = nic_init,
|
||||
.close = nic_close,
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdarg.h>
|
||||
#include <wchar.h>
|
||||
#include <time.h>
|
||||
|
||||
26
src/pit.c
26
src/pit.c
@@ -247,7 +247,7 @@ ctr_tick(ctr_t *ctr, void *priv)
|
||||
ctr_decrease_count(ctr);
|
||||
} else
|
||||
ctr->count -= (ctr->newcount ? 1 : 2);
|
||||
if (ctr->count < 0) {
|
||||
if (ctr->count == 0) {
|
||||
ctr_set_out(ctr, 0, pit);
|
||||
ctr_load_count(ctr);
|
||||
ctr->state = 3;
|
||||
@@ -266,7 +266,7 @@ ctr_tick(ctr_t *ctr, void *priv)
|
||||
ctr_decrease_count(ctr);
|
||||
} else
|
||||
ctr->count -= (ctr->newcount ? 3 : 2);
|
||||
if (ctr->count < 0) {
|
||||
if (ctr->count == 0) {
|
||||
ctr_set_out(ctr, 1, pit);
|
||||
ctr_load_count(ctr);
|
||||
ctr->state = 2;
|
||||
@@ -334,7 +334,7 @@ ctr_set_state_1(ctr_t *ctr)
|
||||
{
|
||||
uint8_t mode = (ctr->m & 0x03);
|
||||
int do_reload = !!ctr->incomplete || (mode == 0) || (ctr->state == 0);
|
||||
|
||||
|
||||
ctr->incomplete = 0;
|
||||
|
||||
if (do_reload)
|
||||
@@ -358,8 +358,18 @@ ctr_load(ctr_t *ctr)
|
||||
else
|
||||
ctr_set_state_1(ctr);
|
||||
|
||||
if (ctr->load_func != NULL)
|
||||
ctr->load_func(ctr->m, ctr->l ? ctr->l : 0x10000);
|
||||
if (ctr->load_func != NULL) {
|
||||
uint32_t count = ctr->l ? ctr->l : 0x10000;
|
||||
if (ctr->bcd) {
|
||||
uint32_t bcd_count = (((count >> 16) & 0xf) * 10000) |
|
||||
(((count >> 12) & 0xf) * 1000 ) |
|
||||
(((count >> 8 ) & 0xf) * 100 ) |
|
||||
(((count >> 4 ) & 0xf) * 10 ) |
|
||||
(count & 0xf);
|
||||
ctr->load_func(ctr->m, bcd_count);
|
||||
} else
|
||||
ctr->load_func(ctr->m, ctr->l ? ctr->l : 0x10000);
|
||||
}
|
||||
|
||||
pit_log("Counter loaded, state = %i, gate = %i, latch = %i\n", ctr->state, ctr->gate, ctr->latch);
|
||||
}
|
||||
@@ -540,7 +550,8 @@ pit_write(uint16_t addr, uint8_t val, void *priv)
|
||||
ctr_t *ctr;
|
||||
|
||||
if ((dev->flags & (PIT_8254 | PIT_EXT_IO))) {
|
||||
pit_log("[%04X:%08X] pit_write(%04X, %02X, %08X)\n", CS, cpu_state.pc, addr, val, priv);
|
||||
pit_log("[%04X:%08X] pit_write(%04X, %02X, %016" PRIX64 ")\n",
|
||||
CS, cpu_state.pc, addr, val, (uint64_t) (uintptr_t) priv);
|
||||
}
|
||||
|
||||
switch (addr & 3) {
|
||||
@@ -788,7 +799,8 @@ pit_read(uint16_t addr, void *priv)
|
||||
}
|
||||
|
||||
if ((dev->flags & (PIT_8254 | PIT_EXT_IO))) {
|
||||
pit_log("[%04X:%08X] pit_read(%04X, %08X) = %02X\n", CS, cpu_state.pc, addr, priv, ret);
|
||||
pit_log("[%04X:%08X] pit_read(%04X, %016" PRIX64 ") = %02X\n",
|
||||
CS, cpu_state.pc, addr, (uint64_t) (uintptr_t) priv, ret);
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
||||
@@ -1906,6 +1906,13 @@ strobe(uint8_t old, uint8_t val, void *priv)
|
||||
/* Process incoming character. */
|
||||
handle_char(dev, dev->data);
|
||||
|
||||
if (timer_is_enabled(&dev->timeout_timer)) {
|
||||
timer_disable(&dev->timeout_timer);
|
||||
#ifdef USE_DYNAREC
|
||||
if (cpu_use_dynarec)
|
||||
update_tsc();
|
||||
#endif
|
||||
}
|
||||
/* ACK it, will be read on next READ STATUS. */
|
||||
dev->ack = 1;
|
||||
timer_set_delay_u64(&dev->pulse_timer, ISACONST);
|
||||
@@ -1940,6 +1947,13 @@ write_ctrl(uint8_t val, void *priv)
|
||||
/* Process incoming character. */
|
||||
handle_char(dev, dev->data);
|
||||
|
||||
if (timer_is_enabled(&dev->timeout_timer)) {
|
||||
timer_disable(&dev->timeout_timer);
|
||||
#ifdef USE_DYNAREC
|
||||
if (cpu_use_dynarec)
|
||||
update_tsc();
|
||||
#endif
|
||||
}
|
||||
/* ACK it, will be read on next READ STATUS. */
|
||||
dev->ack = 1;
|
||||
timer_set_delay_u64(&dev->pulse_timer, ISACONST);
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
#include <86box/plat_dynld.h>
|
||||
#include <86box/ui.h>
|
||||
#include <86box/prt_devs.h>
|
||||
#include "cpu.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
# define GSDLLAPI __stdcall
|
||||
@@ -341,6 +342,14 @@ ps_strobe(uint8_t old, uint8_t val, void *priv)
|
||||
if (!(val & 0x01) && (old & 0x01)) {
|
||||
process_data(dev);
|
||||
|
||||
if (timer_is_enabled(&dev->timeout_timer)) {
|
||||
timer_disable(&dev->timeout_timer);
|
||||
#ifdef USE_DYNAREC
|
||||
if (cpu_use_dynarec)
|
||||
update_tsc();
|
||||
#endif
|
||||
}
|
||||
|
||||
dev->ack = true;
|
||||
|
||||
timer_set_delay_u64(&dev->pulse_timer, ISACONST);
|
||||
@@ -371,6 +380,14 @@ ps_write_ctrl(uint8_t val, void *priv)
|
||||
if (!(val & 0x01) && (dev->ctrl & 0x01)) {
|
||||
process_data(dev);
|
||||
|
||||
if (timer_is_enabled(&dev->timeout_timer)) {
|
||||
timer_disable(&dev->timeout_timer);
|
||||
#ifdef USE_DYNAREC
|
||||
if (cpu_use_dynarec)
|
||||
update_tsc();
|
||||
#endif
|
||||
}
|
||||
|
||||
dev->ack = true;
|
||||
|
||||
timer_set_delay_u64(&dev->pulse_timer, ISACONST);
|
||||
|
||||
@@ -63,6 +63,7 @@
|
||||
#include <86box/lpt.h>
|
||||
#include <86box/printer.h>
|
||||
#include <86box/prt_devs.h>
|
||||
#include "cpu.h"
|
||||
|
||||
#define FULL_PAGE 1 /* set if no top/bot margins */
|
||||
|
||||
@@ -391,6 +392,14 @@ strobe(uint8_t old, uint8_t val, void *priv)
|
||||
/* Process incoming character. */
|
||||
handle_char(dev);
|
||||
|
||||
if (timer_is_enabled(&dev->timeout_timer)) {
|
||||
timer_disable(&dev->timeout_timer);
|
||||
#ifdef USE_DYNAREC
|
||||
if (cpu_use_dynarec)
|
||||
update_tsc();
|
||||
#endif
|
||||
}
|
||||
|
||||
/* ACK it, will be read on next READ STATUS. */
|
||||
dev->ack = 1;
|
||||
|
||||
@@ -429,6 +438,14 @@ write_ctrl(uint8_t val, void *priv)
|
||||
/* ACK it, will be read on next READ STATUS. */
|
||||
dev->ack = 1;
|
||||
|
||||
if (timer_is_enabled(&dev->timeout_timer)) {
|
||||
timer_disable(&dev->timeout_timer);
|
||||
#ifdef USE_DYNAREC
|
||||
if (cpu_use_dynarec)
|
||||
update_tsc();
|
||||
#endif
|
||||
}
|
||||
|
||||
timer_set_delay_u64(&dev->pulse_timer, ISACONST);
|
||||
timer_set_delay_u64(&dev->timeout_timer, 5000000 * TIMER_USEC);
|
||||
}
|
||||
|
||||
@@ -455,6 +455,7 @@ endif()
|
||||
|
||||
if (UNIX AND NOT APPLE AND NOT HAIKU)
|
||||
target_sources(ui PRIVATE x11_util.c)
|
||||
target_link_libraries(plat PRIVATE ${CMAKE_DL_LIBS})
|
||||
|
||||
find_package(X11 REQUIRED)
|
||||
target_link_libraries(ui PRIVATE X11::X11 X11::Xi)
|
||||
|
||||
@@ -147,6 +147,9 @@ msgstr "&Cor RGB"
|
||||
msgid "&RGB Grayscale"
|
||||
msgstr "Tons de cinza &RGB"
|
||||
|
||||
msgid "Generic RGBI color monitor"
|
||||
msgstr "Monitor colorido RGBI genérico"
|
||||
|
||||
msgid "&Amber monitor"
|
||||
msgstr "Monitor &âmbar"
|
||||
|
||||
@@ -384,6 +387,15 @@ msgstr "Ativar (UTC)"
|
||||
msgid "Dynamic Recompiler"
|
||||
msgstr "Recompilador dinâmico"
|
||||
|
||||
msgid "CPU frame size"
|
||||
msgstr "Tamanho de quadro do CPU"
|
||||
|
||||
msgid "Larger frames (less smooth)"
|
||||
msgstr "Quadros largos (menos suave)"
|
||||
|
||||
msgid "Smaller frames (smoother)"
|
||||
msgstr "Quadros menores (mais suave)"
|
||||
|
||||
msgid "Video:"
|
||||
msgstr "Vídeo:"
|
||||
|
||||
@@ -600,6 +612,9 @@ msgstr "RTC ISA:"
|
||||
msgid "ISA Memory Expansion"
|
||||
msgstr "Expansão de memória ISA"
|
||||
|
||||
msgid "ISA ROM Cards"
|
||||
msgstr "Placas ROM ISA"
|
||||
|
||||
msgid "Card 1:"
|
||||
msgstr "Placa 1:"
|
||||
|
||||
@@ -612,6 +627,27 @@ msgstr "Placa 3:"
|
||||
msgid "Card 4:"
|
||||
msgstr "Placa 4:"
|
||||
|
||||
msgid "Board 1"
|
||||
msgstr "Placa 1"
|
||||
|
||||
msgid "Board 2"
|
||||
msgstr "Placa 2"
|
||||
|
||||
msgid "Board 3"
|
||||
msgstr "Placa 3"
|
||||
|
||||
msgid "Board 4"
|
||||
msgstr "Placa 4"
|
||||
|
||||
msgid "Generic ISA ROM Board"
|
||||
msgstr "Placa ROM ISA Genérica"
|
||||
|
||||
msgid "Generic Dual ISA ROM Board"
|
||||
msgstr "Placa Dual ROM ISA Genérica"
|
||||
|
||||
msgid "Generic Quad ISA ROM Board"
|
||||
msgstr "Placa Quad ROM ISA Genérica"
|
||||
|
||||
msgid "ISABugger device"
|
||||
msgstr "Dispositivo ISABugger"
|
||||
|
||||
@@ -777,12 +813,39 @@ msgstr "Joystick padrão de 4 eixos, 4 botões"
|
||||
msgid "CH Flightstick Pro"
|
||||
msgstr "CH Flightstick Pro"
|
||||
|
||||
msgid "CH Flightstick Pro + CH Pedals"
|
||||
msgstr "CH Flightstick Pro + CH Pedais"
|
||||
|
||||
msgid "Microsoft SideWinder Pad"
|
||||
msgstr "Microsoft SideWinder Pad"
|
||||
|
||||
msgid "Thrustmaster Flight Control System"
|
||||
msgstr "Sistema de Controle de Voo Thrustmaster"
|
||||
|
||||
msgid "Thrustmaster FCS + Rudder Control System"
|
||||
msgstr "Thrustmaster SCV + Sistema de Controle de Leme"
|
||||
|
||||
msgid "2-button gamepad(s)"
|
||||
msgstr "Gamepad(s) de 2 botões"
|
||||
|
||||
msgid "2-button flight yoke"
|
||||
msgstr "Manche de voo de 2 botões"
|
||||
|
||||
msgid "4-button gamepad"
|
||||
msgstr "Gamepad de 4 botões"
|
||||
|
||||
msgid "4-button flight yoke"
|
||||
msgstr "Manche de voo de 4 botões"
|
||||
|
||||
msgid "2-button flight yoke with throttle"
|
||||
msgstr "Manche de voo de 2 botões com acelerador"
|
||||
|
||||
msgid "4-button flight yoke with throttle"
|
||||
msgstr "Manche de voo de 4 botões com acelerador"
|
||||
|
||||
msgid "Win95 Steering Wheel (3-axis, 4-button)"
|
||||
msgstr "Volante Win95 (3 eixos, 4 botões)"
|
||||
|
||||
msgid "None"
|
||||
msgstr "Nenhum"
|
||||
|
||||
@@ -841,7 +904,7 @@ msgid "About 86Box"
|
||||
msgstr "Sobre o 86Box"
|
||||
|
||||
msgid "86Box v"
|
||||
msgstr "86Box versão"
|
||||
msgstr "86Box versão "
|
||||
|
||||
msgid "An emulator of old computers\n\nAuthors: Miran Grča (OBattler), RichardG867, Jasmine Iwanek, TC1995, coldbrewed, Teemu Korhonen (Manaatti), Joakim L. Gilje, Adrien Moulin (elyosh), Daniel Balsom (gloriouscow), Cacodemon345, Fred N. van Kempen (waltje), Tiseno100, reenigne, and others.\n\nWith previous core contributions from Sarah Walker, leilei, JohnElliott, greatpsycho, and others.\n\nReleased under the GNU General Public License version 2 or later. See LICENSE for more information."
|
||||
msgstr "Um emulador de computadores antigos\n\nAutores: Miran Grča (OBattler), RichardG867, Jasmine Iwanek, TC1995, coldbrewed, Teemu Korhonen (Manaatti), Joakim L. Gilje, Adrien Moulin (elyosh), Daniel Balsom (gloriouscow), Cacodemon345, Fred N. van Kempen (waltje), Tiseno100, reenigne, e outros.\n\nCom contribuições anteriores de Sarah Walker, leilei, JohnElliott, greatpsycho, e outros.\n\nTraduzido por: Altieres Lima da Silva, Nelson K. Hennemann Filho\n\nLançado sob a Licença Pública Geral GNU, versão 2 ou posterior. Veja o arquivo LICENSE para mais informações."
|
||||
@@ -1377,6 +1440,9 @@ msgstr "Mouse de barramento Microsoft (InPort)"
|
||||
msgid "Mouse Systems Serial Mouse"
|
||||
msgstr "Mouse serial Mouse Systems"
|
||||
|
||||
msgid "Mouse Systems Bus Mouse"
|
||||
msgstr "Mouse de barramento Mouse Systems"
|
||||
|
||||
msgid "Microsoft Serial Mouse"
|
||||
msgstr "Mouse serial Microsoft"
|
||||
|
||||
@@ -1413,12 +1479,54 @@ msgstr "Sistema MIDI"
|
||||
msgid "MIDI Input Device"
|
||||
msgstr "Dispositivo de entrada MIDI"
|
||||
|
||||
msgid "BIOS file"
|
||||
msgstr "Arquivo do BIOS"
|
||||
|
||||
msgid "BIOS file (ROM #1)"
|
||||
msgstr "Arquivo do BIOS (ROM #1)"
|
||||
|
||||
msgid "BIOS file (ROM #2)"
|
||||
msgstr "Arquivo do BIOS (ROM #2)"
|
||||
|
||||
msgid "BIOS file (ROM #3)"
|
||||
msgstr "Arquivo do BIOS (ROM #3)"
|
||||
|
||||
msgid "BIOS file (ROM #4)"
|
||||
msgstr "Arquivo do BIOS (ROM #4)"
|
||||
|
||||
msgid "BIOS Address"
|
||||
msgstr "Endereço do BIOS"
|
||||
|
||||
msgid "BIOS address (ROM #1)"
|
||||
msgstr "Endereço do BIOS (ROM #1)"
|
||||
|
||||
msgid "BIOS address (ROM #2)"
|
||||
msgstr "Endereço do BIOS (ROM #2)"
|
||||
|
||||
msgid "BIOS address (ROM #3)"
|
||||
msgstr "Endereço do BIOS (ROM #3)"
|
||||
|
||||
msgid "BIOS address (ROM #4)"
|
||||
msgstr "Endereço do BIOS (ROM #4)"
|
||||
|
||||
msgid "Enable BIOS extension ROM Writes"
|
||||
msgstr "Habilitar gravações na ROM de extensão do BIOS"
|
||||
|
||||
msgid "Enable BIOS extension ROM Writes (ROM #1)"
|
||||
msgstr "Habilitar gravações na ROM de extensão do BIOS (ROM #1)"
|
||||
|
||||
msgid "Enable BIOS extension ROM Writes (ROM #2)"
|
||||
msgstr "Habilitar gravações na ROM de extensão do BIOS (ROM #2)"
|
||||
|
||||
msgid "Enable BIOS extension ROM Writes (ROM #3)"
|
||||
msgstr "Habilitar gravações na ROM de extensão do BIOS (ROM #3)"
|
||||
|
||||
msgid "Enable BIOS extension ROM Writes (ROM #4)"
|
||||
msgstr "Habilitar gravações na ROM de extensão do BIOS (ROM #4)"
|
||||
|
||||
msgid "Linear framebuffer base"
|
||||
msgstr "Base do framebuffer linear"
|
||||
|
||||
msgid "Address"
|
||||
msgstr "Endereço"
|
||||
|
||||
@@ -1428,6 +1536,21 @@ msgstr "IRQ"
|
||||
msgid "BIOS Revision"
|
||||
msgstr "Revisão do BIOS"
|
||||
|
||||
msgid "BIOS Version"
|
||||
msgstr "Versão do BIOS"
|
||||
|
||||
msgid "BIOS Versions"
|
||||
msgstr "Versões de BIOS"
|
||||
|
||||
msgid "BIOS Language"
|
||||
msgstr "Idioma do BIOS"
|
||||
|
||||
msgid "IBM 5161 Expansion Unit"
|
||||
msgstr "Unidade de Expansão IBM 5161"
|
||||
|
||||
msgid "IBM Cassette Basic"
|
||||
msgstr "Cassete BASIC IBM"
|
||||
|
||||
msgid "Translate 26 -> 17"
|
||||
msgstr "Traduzir 26 -> 17"
|
||||
|
||||
@@ -1443,6 +1566,18 @@ msgstr "Inverter cores"
|
||||
msgid "BIOS size"
|
||||
msgstr "Tamanho do BIOS"
|
||||
|
||||
msgid "BIOS size (ROM #1)"
|
||||
msgstr "Tamanho do BIOS (ROM #1)"
|
||||
|
||||
msgid "BIOS size (ROM #2)"
|
||||
msgstr "Tamanho do BIOS (ROM #2)"
|
||||
|
||||
msgid "BIOS size (ROM #3)"
|
||||
msgstr "Tamanho do BIOS (ROM #3)"
|
||||
|
||||
msgid "BIOS size (ROM #4)"
|
||||
msgstr "Tamanho do BIOS (ROM #4)"
|
||||
|
||||
msgid "Map C0000-C7FFF as UMB"
|
||||
msgstr "Mapear C0000-C7FFF como UMB"
|
||||
|
||||
@@ -1518,6 +1653,9 @@ msgstr "Nível de reverberação"
|
||||
msgid "Interpolation Method"
|
||||
msgstr "Método de interpolação"
|
||||
|
||||
msgid "Dynamic Sample Loading"
|
||||
msgstr "Carregamento dinâmico de amostra"
|
||||
|
||||
msgid "Reverb Output Gain"
|
||||
msgstr "Ganho da saída da reverberação"
|
||||
|
||||
@@ -1605,6 +1743,12 @@ msgstr "DMA baixo"
|
||||
msgid "Enable Game port"
|
||||
msgstr "Ativar a porta do jogo"
|
||||
|
||||
msgid "SID Model"
|
||||
msgstr "Modelo do SID"
|
||||
|
||||
msgid "SID Filter Strength"
|
||||
msgstr "Força do Filtro SID"
|
||||
|
||||
msgid "Surround module"
|
||||
msgstr "Módulo surround"
|
||||
|
||||
@@ -1617,6 +1761,9 @@ msgstr "Aumentar a interrupção do CODEC na configuração do CODEC (necessári
|
||||
msgid "SB Address"
|
||||
msgstr "Endereço do SB"
|
||||
|
||||
msgid "Use EEPROM setting"
|
||||
msgstr "Usar configuração da EEPROM"
|
||||
|
||||
msgid "WSS IRQ"
|
||||
msgstr "WSS IRQ"
|
||||
|
||||
@@ -1701,6 +1848,9 @@ msgstr "Tipo de RAMDAC"
|
||||
msgid "Blend"
|
||||
msgstr "Mistura"
|
||||
|
||||
msgid "Font"
|
||||
msgstr "Fonte"
|
||||
|
||||
msgid "Bilinear filtering"
|
||||
msgstr "Filtragem bilinear"
|
||||
|
||||
@@ -1746,6 +1896,33 @@ msgstr "Velocidade de transferência"
|
||||
msgid "EMS mode"
|
||||
msgstr "Modo EMS"
|
||||
|
||||
msgid "EMS Address"
|
||||
msgstr "Endereço EMS"
|
||||
|
||||
msgid "EMS 1 Address"
|
||||
msgstr "Endereço EMS 1"
|
||||
|
||||
msgid "EMS 2 Address"
|
||||
msgstr "Endereço EMS 2"
|
||||
|
||||
msgid "EMS Memory Size"
|
||||
msgstr "Tamanho de Memória EMS"
|
||||
|
||||
msgid "EMS 1 Memory Size"
|
||||
msgstr "Tamanho de Memória EMS 1"
|
||||
|
||||
msgid "EMS 2 Memory Size"
|
||||
msgstr "Tamanho de Memória EMS 2"
|
||||
|
||||
msgid "Enable EMS"
|
||||
msgstr "Habilitar EMS"
|
||||
|
||||
msgid "Enable EMS 1"
|
||||
msgstr "Habilitar EMS 1"
|
||||
|
||||
msgid "Enable EMS 2"
|
||||
msgstr "Habilitar EMS 2"
|
||||
|
||||
msgid "Address for > 2 MB"
|
||||
msgstr "Endereço para > 2 MB"
|
||||
|
||||
@@ -1902,6 +2079,15 @@ msgstr "Interpolação sRGB"
|
||||
msgid "Linear interpolation"
|
||||
msgstr "Interpolação linear"
|
||||
|
||||
msgid "Has secondary 8x8 character set"
|
||||
msgstr "Tem conjunto secundário de caracteres 8x8"
|
||||
|
||||
msgid "Has Quadcolor II daughter board"
|
||||
msgstr "Tem placa filha Quadcolor II"
|
||||
|
||||
msgid "Alternate monochrome contrast"
|
||||
msgstr "Contraste monocromático alternativo"
|
||||
|
||||
msgid "128 KB"
|
||||
msgstr "128 KB"
|
||||
|
||||
@@ -1935,6 +2121,9 @@ msgstr "Âmbar"
|
||||
msgid "Gray"
|
||||
msgstr "Cinza"
|
||||
|
||||
msgid "Grayscale"
|
||||
msgstr "Escala de cinza"
|
||||
|
||||
msgid "Color"
|
||||
msgstr "Colorido"
|
||||
|
||||
@@ -1950,6 +2139,12 @@ msgstr "Outros idiomas"
|
||||
msgid "Bochs latest"
|
||||
msgstr "Bochs mais recente"
|
||||
|
||||
msgid "Apply overscan deltas"
|
||||
msgstr "Aplicar deltas de overscan"
|
||||
|
||||
msgid "Mono Interlaced"
|
||||
msgstr "Monocromático entrelaçado"
|
||||
|
||||
msgid "Mono Non-Interlaced"
|
||||
msgstr "Monocromático não entrelaçado"
|
||||
|
||||
@@ -2076,6 +2271,12 @@ msgstr "Clone IBM 8514/A (ISA)"
|
||||
msgid "Vendor"
|
||||
msgstr "Fabricante"
|
||||
|
||||
msgid "30 Hz (JMP2 = 1)"
|
||||
msgstr "30 Hz (JMP2 = 1)"
|
||||
|
||||
msgid "60 Hz (JMP2 = 2)"
|
||||
msgstr "60 Hz (JMP2 = 2)"
|
||||
|
||||
msgid "Generic PC/XT Memory Expansion"
|
||||
msgstr "Expansão de memória genérica PC/XT"
|
||||
|
||||
@@ -2189,3 +2390,15 @@ msgstr "Alternar pausa"
|
||||
|
||||
msgid "Toggle mute"
|
||||
msgstr "Alternar mudo"
|
||||
|
||||
msgid "Text files"
|
||||
msgstr "Arquivos de texto"
|
||||
|
||||
msgid "ROM files (*.bin *.rom)|*.bin,*.rom"
|
||||
msgstr "Arquivos de ROM (*.bin *.rom)|*.bin,*.rom"
|
||||
|
||||
msgid "ROM files"
|
||||
msgstr "Arquivos de ROM"
|
||||
|
||||
msgid "SoundFont files"
|
||||
msgstr "Arquivos SoundFont"
|
||||
|
||||
@@ -390,6 +390,15 @@ msgstr "Включено (UTC)"
|
||||
msgid "Dynamic Recompiler"
|
||||
msgstr "Динамический рекомпилятор"
|
||||
|
||||
msgid "CPU frame size"
|
||||
msgstr "Размер кадра ЦП"
|
||||
|
||||
msgid "Larger frames (less smooth)"
|
||||
msgstr "Большие кадры (менее плавные)"
|
||||
|
||||
msgid "Smaller frames (smoother)"
|
||||
msgstr "Меньшие кадры (более плавные)"
|
||||
|
||||
msgid "Video:"
|
||||
msgstr "Видеокарта 1:"
|
||||
|
||||
@@ -765,9 +774,21 @@ msgstr "Неверное устройство PCap"
|
||||
msgid "2-axis, 2-button joystick(s)"
|
||||
msgstr "2-осевой, 2-кнопочный джойстик"
|
||||
|
||||
msgid "2-button gamepad(s)"
|
||||
msgstr "2-кнопочный геймпад"
|
||||
|
||||
msgid "2-button flight yoke"
|
||||
msgstr "2-кнопочный flight yoke"
|
||||
|
||||
msgid "2-axis, 4-button joystick"
|
||||
msgstr "2-осевой, 4-кнопочный джойстик"
|
||||
|
||||
msgid "4-button gamepad"
|
||||
msgstr "4-кнопочный геймпад"
|
||||
|
||||
msgid "4-button flight yoke"
|
||||
msgstr "4-кнопочный flight yoke"
|
||||
|
||||
msgid "2-axis, 6-button joystick"
|
||||
msgstr "2-осевой, 6-кнопочный джойстик"
|
||||
|
||||
@@ -777,21 +798,36 @@ msgstr "2-осевой, 8-кнопочный джойстик"
|
||||
msgid "3-axis, 2-button joystick"
|
||||
msgstr "3-осевой, 2-кнопочный джойстик"
|
||||
|
||||
msgid "2-button flight yoke with throttle"
|
||||
msgstr "2-кнопочный flight yoke с дросселем"
|
||||
|
||||
msgid "3-axis, 4-button joystick"
|
||||
msgstr "3-осевой, 4-кнопочный джойстик"
|
||||
|
||||
msgid "Win95 Steering Wheel (3-axis, 4-button)"
|
||||
msgstr "Руль Win95 (3-осевой, 4-кнопочный)"
|
||||
|
||||
msgid "4-button flight yoke with throttle"
|
||||
msgstr "4-кнопочный flight yoke с дросселем"
|
||||
|
||||
msgid "4-axis, 4-button joystick"
|
||||
msgstr "4-осевой, 4-кнопочный джойстик"
|
||||
|
||||
msgid "CH Flightstick Pro"
|
||||
msgstr "CH Flightstick Pro"
|
||||
|
||||
msgid "CH Flightstick Pro + CH Pedals"
|
||||
msgstr "CH Flightstick Pro + CH Педали"
|
||||
|
||||
msgid "Microsoft SideWinder Pad"
|
||||
msgstr "Microsoft SideWinder Pad"
|
||||
|
||||
msgid "Thrustmaster Flight Control System"
|
||||
msgstr "Система управления полётом Thrustmaster"
|
||||
|
||||
msgid "Thrustmaster FCS + Rudder Control System"
|
||||
msgstr "Thrustmaster FCS + Система управления рулем"
|
||||
|
||||
msgid "None"
|
||||
msgstr "Нет"
|
||||
|
||||
@@ -1386,6 +1422,9 @@ msgstr "Bus-мышь Microsoft (InPort)"
|
||||
msgid "Mouse Systems Serial Mouse"
|
||||
msgstr "COM-мышь Mouse Systems"
|
||||
|
||||
msgid "Mouse Systems Bus Mouse"
|
||||
msgstr "Bus-мышь Mouse Systems"
|
||||
|
||||
msgid "Microsoft Serial Mouse"
|
||||
msgstr "COM-мышь Microsoft"
|
||||
|
||||
@@ -1686,6 +1725,12 @@ msgstr "Низкий DMA"
|
||||
msgid "Enable Game port"
|
||||
msgstr "Включить игровой порт"
|
||||
|
||||
msgid "SID Model"
|
||||
msgstr "Модель SID"
|
||||
|
||||
msgid "SID Filter Strength"
|
||||
msgstr "Сила фильтра SID"
|
||||
|
||||
msgid "Surround module"
|
||||
msgstr "Модуль объёмного звучания"
|
||||
|
||||
@@ -1788,6 +1833,18 @@ msgstr "Смесь"
|
||||
msgid "Font"
|
||||
msgstr "Шрифт"
|
||||
|
||||
msgid "Has secondary 8x8 character set"
|
||||
msgstr "Вторичный набор символов 8x8"
|
||||
|
||||
msgid "Has Quadcolor II daughter board"
|
||||
msgstr "Дочерняя плата Quadcolor II"
|
||||
|
||||
msgid "Alternate monochrome contrast"
|
||||
msgstr "Альтернативный монохромный контраст"
|
||||
|
||||
msgid "Video chroma-keying"
|
||||
msgstr "Видео хромакеинг"
|
||||
|
||||
msgid "Bilinear filtering"
|
||||
msgstr "Билинейная фильтрация"
|
||||
|
||||
@@ -2154,6 +2211,9 @@ msgstr "Скорость передачи данных через канал"
|
||||
msgid "Named Pipe (Server)"
|
||||
msgstr "Именованный пайп (Сервер)"
|
||||
|
||||
msgid "Named Pipe (Client)"
|
||||
msgstr "Именованный пайп (Клиент)"
|
||||
|
||||
msgid "Host Serial Passthrough"
|
||||
msgstr "Последовательный порт хоста"
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -56,6 +56,10 @@ extern "C" {
|
||||
#include <86box/gdbstub.h>
|
||||
#include <86box/version.h>
|
||||
#include <86box/renderdefs.h>
|
||||
#ifdef Q_OS_LINUX
|
||||
#define GAMEMODE_AUTO
|
||||
#include "../unix/gamemode/gamemode_client.h"
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef Q_OS_WINDOWS
|
||||
@@ -102,6 +106,8 @@ bool cpu_thread_running = false;
|
||||
void qt_set_sequence_auto_mnemonic(bool b);
|
||||
|
||||
#ifdef Q_OS_WINDOWS
|
||||
bool acp_utf8 = false;
|
||||
|
||||
static void
|
||||
keyboard_getkeymap()
|
||||
{
|
||||
@@ -435,6 +441,9 @@ main_thread_fn()
|
||||
int frames;
|
||||
|
||||
QThread::currentThread()->setPriority(QThread::HighestPriority);
|
||||
#ifdef _WIN32
|
||||
SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_TIME_CRITICAL);
|
||||
#endif
|
||||
plat_set_thread_name(nullptr, "main_thread_fn");
|
||||
framecountx = 0;
|
||||
// title_update = 1;
|
||||
@@ -446,14 +455,14 @@ main_thread_fn()
|
||||
const uint64_t new_time = elapsed_timer.elapsed();
|
||||
#ifdef USE_GDBSTUB
|
||||
if (gdbstub_next_asap && (drawits <= 0))
|
||||
drawits = 10;
|
||||
drawits = force_10ms ? 10 : 1;
|
||||
else
|
||||
#endif
|
||||
drawits += static_cast<int>(new_time - old_time);
|
||||
old_time = new_time;
|
||||
if (drawits > 0 && !dopause) {
|
||||
/* Yes, so do one frame now. */
|
||||
drawits -= 10;
|
||||
drawits -= force_10ms ? 10 : 1;
|
||||
if (drawits > 50)
|
||||
drawits = 0;
|
||||
|
||||
@@ -472,8 +481,8 @@ main_thread_fn()
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
/* Every 200 frames we save the machine status. */
|
||||
if (++frames >= 200 && nvr_dosave) {
|
||||
/* Every 2 emulated seconds we save the machine status. */
|
||||
if (++frames >= (force_10ms ? 200 : 2000) && nvr_dosave) {
|
||||
qt_nvr_save();
|
||||
nvr_dosave = 0;
|
||||
frames = 0;
|
||||
@@ -515,6 +524,13 @@ extern bool windows_is_light_theme();
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
#ifdef Q_OS_WINDOWS
|
||||
/* Check if Windows supports UTF-8 */
|
||||
if (GetACP() == CP_UTF8)
|
||||
acp_utf8 = 1;
|
||||
else
|
||||
acp_utf8 = 0;
|
||||
#endif
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||
QApplication::setAttribute(Qt::AA_DisableHighDpiScaling, false);
|
||||
QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
|
||||
@@ -530,6 +546,9 @@ main(int argc, char *argv[])
|
||||
|
||||
#ifdef Q_OS_WINDOWS
|
||||
Q_INIT_RESOURCE(darkstyle);
|
||||
if (QFile(QApplication::applicationDirPath() + "/opengl32.dll").exists()) {
|
||||
qputenv("QT_OPENGL_DLL", QFileInfo(QApplication::applicationDirPath() + "/opengl32.dll").absoluteFilePath().toUtf8());
|
||||
}
|
||||
QApplication::setAttribute(Qt::AA_NativeWindows);
|
||||
|
||||
if (!windows_is_light_theme()) {
|
||||
@@ -788,6 +807,8 @@ main(int argc, char *argv[])
|
||||
});
|
||||
QObject::connect(main_window, &MainWindow::vmmRunningStateChanged, &manager_socket, &VMManagerClientSocket::clientRunningStateChanged);
|
||||
main_window->installEventFilter(&manager_socket);
|
||||
|
||||
manager_socket.sendWinIdMessage(main_window->winId());
|
||||
}
|
||||
|
||||
// pc_reset_hard_init();
|
||||
|
||||
@@ -1454,11 +1454,13 @@ MainWindow::eventFilter(QObject *receiver, QEvent *event)
|
||||
if (receiver == this) {
|
||||
static auto curdopause = dopause;
|
||||
if (event->type() == QEvent::WindowBlocked) {
|
||||
window_blocked = true;
|
||||
curdopause = dopause;
|
||||
plat_pause(isShowMessage ? 2 : 1);
|
||||
emit setMouseCapture(false);
|
||||
releaseKeyboard();
|
||||
} else if (event->type() == QEvent::WindowUnblocked) {
|
||||
window_blocked = false;
|
||||
plat_pause(curdopause);
|
||||
}
|
||||
}
|
||||
@@ -2112,7 +2114,7 @@ MainWindow::updateUiPauseState()
|
||||
QString(tr("Pause execution"));
|
||||
ui->actionPause->setIcon(pause_icon);
|
||||
ui->actionPause->setToolTip(tooltip_text);
|
||||
emit vmmRunningStateChanged(static_cast<VMManagerProtocol::RunningState>(dopause));
|
||||
emit vmmRunningStateChanged(static_cast<VMManagerProtocol::RunningState>(window_blocked ? (dopause ? VMManagerProtocol::RunningState::PausedWaiting : VMManagerProtocol::RunningState::RunningWaiting) : (VMManagerProtocol::RunningState)dopause));
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -200,6 +200,7 @@ private:
|
||||
QIcon caps_icon_off, scroll_icon_off, num_icon_off, kana_icon_off;
|
||||
|
||||
bool isShowMessage = false;
|
||||
bool window_blocked = false;
|
||||
};
|
||||
|
||||
#endif // QT_MAINWINDOW_HPP
|
||||
|
||||
@@ -177,14 +177,28 @@ do_stop(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
extern bool acp_utf8;
|
||||
void
|
||||
plat_get_exe_name(char *s, int size)
|
||||
{
|
||||
#ifdef Q_OS_WINDOWS
|
||||
wchar_t *temp;
|
||||
|
||||
if (acp_utf8)
|
||||
GetModuleFileNameA(NULL, s, size);
|
||||
else {
|
||||
temp = (wchar_t*)calloc(size, sizeof(wchar_t));
|
||||
GetModuleFileNameW(NULL, temp, size);
|
||||
c16stombs(s, (uint16_t*)temp, size);
|
||||
free(temp);
|
||||
}
|
||||
#else
|
||||
QByteArray exepath_temp = QCoreApplication::applicationDirPath().toLocal8Bit();
|
||||
|
||||
memcpy(s, exepath_temp.data(), std::min((qsizetype) exepath_temp.size(), (qsizetype) size));
|
||||
|
||||
path_slash(s);
|
||||
#endif
|
||||
}
|
||||
|
||||
uint32_t
|
||||
|
||||
@@ -166,6 +166,10 @@ int ignoreNextMouseEvent = 1;
|
||||
void
|
||||
RendererStack::mouseReleaseEvent(QMouseEvent *event)
|
||||
{
|
||||
#ifdef Q_OS_WINDOWS
|
||||
rw_hwnd = (HWND) this->winId();
|
||||
#endif
|
||||
|
||||
if (!dopause && this->geometry().contains(m_monitor_index >= 1 ? event->globalPos() : event->pos()) &&
|
||||
(event->button() == Qt::LeftButton) && !mouse_capture &&
|
||||
(isMouseDown & 1) && (kbd_req_capture || (mouse_get_buttons() != 0)) &&
|
||||
@@ -410,14 +414,8 @@ RendererStack::createRenderer(Renderer renderer)
|
||||
#endif
|
||||
}
|
||||
if (current.get() == nullptr) {
|
||||
#ifdef Q_OS_WINDOWS
|
||||
rw_hwnd = NULL;
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
#ifdef Q_OS_WINDOWS
|
||||
rw_hwnd = (HWND) this->winId();
|
||||
#endif
|
||||
current->setFocusPolicy(Qt::NoFocus);
|
||||
current->setFocusProxy(this);
|
||||
current->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
||||
|
||||
@@ -152,11 +152,8 @@ SettingsDisplay::on_pushButtonConfigure8514_clicked()
|
||||
void
|
||||
SettingsDisplay::on_pushButtonConfigureXga_clicked()
|
||||
{
|
||||
if (machine_has_bus(machineId, MACHINE_BUS_MCA) > 0) {
|
||||
if (machine_has_bus(machineId, MACHINE_BUS_MCA) > 0)
|
||||
DeviceConfig::ConfigureDevice(&xga_device);
|
||||
} else {
|
||||
DeviceConfig::ConfigureDevice(&xga_isa_device);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
@@ -189,7 +186,7 @@ SettingsDisplay::on_comboBoxVideo_currentIndexChanged(int index)
|
||||
bool videoCardHasXga = ((videoCard[0] == VID_INTERNAL) ? machine_has_flags(machineId, MACHINE_VIDEO_XGA) : (video_card_get_flags(videoCard[0]) == VIDEO_FLAG_TYPE_XGA));
|
||||
|
||||
bool machineSupports8514 = ((machineHasIsa16 || machineHasMca) && !videoCardHas8514);
|
||||
bool machineSupportsXga = (((machineHasIsa16 && device_available(&xga_isa_device)) || (machineHasMca && device_available(&xga_device))) && !videoCardHasXga);
|
||||
bool machineSupportsXga = ((machineHasMca && device_available(&xga_device)) && !videoCardHasXga);
|
||||
bool machineSupportsDa2 = machineHasMca && device_available(&ps55da2_device);
|
||||
|
||||
ui->checkBox8514->setEnabled(machineSupports8514);
|
||||
|
||||
@@ -117,6 +117,9 @@ SettingsMachine::SettingsMachine(QWidget *parent)
|
||||
ui->comboBoxMachineType->setCurrentIndex(-1);
|
||||
ui->comboBoxMachineType->setCurrentIndex(selectedMachineType);
|
||||
|
||||
ui->radioButtonLargerFrames->setChecked(force_10ms);
|
||||
ui->radioButtonSmallerFrames->setChecked(!force_10ms);
|
||||
|
||||
#ifndef USE_DYNAREC
|
||||
ui->checkBoxDynamicRecompiler->setEnabled(false);
|
||||
ui->checkBoxDynamicRecompiler->setVisible(false);
|
||||
@@ -137,6 +140,7 @@ SettingsMachine::save()
|
||||
fpu_type = ui->comboBoxFPU->currentData().toInt();
|
||||
cpu_use_dynarec = ui->checkBoxDynamicRecompiler->isChecked() ? 1 : 0;
|
||||
fpu_softfloat = ui->checkBoxFPUSoftfloat->isChecked() ? 1 : 0;
|
||||
force_10ms = ui->radioButtonLargerFrames->isChecked() ? 1 : 0;
|
||||
|
||||
int64_t temp_mem_size;
|
||||
if (machine_get_ram_granularity(machine) < 1024)
|
||||
@@ -359,3 +363,15 @@ void SettingsMachine::on_checkBoxFPUSoftfloat_stateChanged(int state) {
|
||||
ui->softFloatWarningText->setVisible(false);
|
||||
}
|
||||
}
|
||||
|
||||
void SettingsMachine::on_radioButtonSmallerFrames_clicked()
|
||||
{
|
||||
ui->radioButtonLargerFrames->setChecked(false);
|
||||
}
|
||||
|
||||
|
||||
void SettingsMachine::on_radioButtonLargerFrames_clicked()
|
||||
{
|
||||
ui->radioButtonSmallerFrames->setChecked(false);
|
||||
}
|
||||
|
||||
|
||||
@@ -28,6 +28,10 @@ private slots:
|
||||
void on_comboBoxMachineType_currentIndexChanged(int index);
|
||||
void on_checkBoxFPUSoftfloat_stateChanged(int state);
|
||||
|
||||
void on_radioButtonSmallerFrames_clicked();
|
||||
|
||||
void on_radioButtonLargerFrames_clicked();
|
||||
|
||||
private:
|
||||
Ui::SettingsMachine *ui;
|
||||
};
|
||||
|
||||
@@ -41,7 +41,6 @@
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
|
||||
<item row="0" column="1">
|
||||
<widget class="QComboBox" name="comboBoxMachineType">
|
||||
<property name="maxVisibleItems">
|
||||
@@ -49,7 +48,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
@@ -57,7 +55,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="text">
|
||||
@@ -65,7 +62,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
<item row="3" column="1">
|
||||
<widget class="QComboBox" name="comboBoxFPU">
|
||||
<property name="maxVisibleItems">
|
||||
@@ -73,7 +69,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
<item row="5" column="1">
|
||||
<widget class="QSpinBox" name="spinBoxRAM">
|
||||
<property name="sizePolicy">
|
||||
@@ -84,7 +79,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
@@ -92,7 +86,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
@@ -100,7 +93,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
<item row="2" column="1">
|
||||
<widget class="QWidget" name="widget_2" native="true">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
@@ -129,18 +121,16 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
<item>
|
||||
<widget class="QLabel" name="label_7">
|
||||
<property name="text">
|
||||
<string>Frequency:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
|
||||
<set>Qt::AlignmentFlag::AlignLeading|Qt::AlignmentFlag::AlignLeft|Qt::AlignmentFlag::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
<item>
|
||||
<widget class="QComboBox" name="comboBoxSpeed">
|
||||
<property name="sizePolicy">
|
||||
@@ -157,7 +147,6 @@
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
@@ -165,7 +154,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
@@ -173,7 +161,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
<item row="1" column="1">
|
||||
<widget class="QWidget" name="widget_3" native="true">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
@@ -196,7 +183,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButtonConfigure">
|
||||
<property name="sizePolicy">
|
||||
@@ -213,7 +199,6 @@
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
<item row="4" column="1">
|
||||
<widget class="QWidget" name="widget_4" native="true">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
@@ -268,7 +253,6 @@
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="dynamicRecompilerLayout">
|
||||
<item>
|
||||
@@ -286,7 +270,6 @@
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="softFloatLayout">
|
||||
<item>
|
||||
@@ -302,7 +285,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
<item>
|
||||
<widget class="QLabel" name="softFloatWarningIcon">
|
||||
<property name="text">
|
||||
@@ -310,7 +292,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
<item>
|
||||
<widget class="QLabel" name="softFloatWarningText">
|
||||
<property name="text">
|
||||
@@ -321,7 +302,7 @@
|
||||
<item>
|
||||
<spacer name="softFloatHorizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
@@ -333,7 +314,6 @@
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="sizePolicy">
|
||||
@@ -345,25 +325,57 @@
|
||||
<property name="title">
|
||||
<string>Time synchronization</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="0" column="0">
|
||||
<widget class="QRadioButton" name="radioButtonDisabled">
|
||||
<property name="text">
|
||||
<string>Disabled</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QRadioButton" name="radioButtonUTC">
|
||||
<property name="text">
|
||||
<string>Enabled (UTC)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QRadioButton" name="radioButtonLocalTime">
|
||||
<property name="text">
|
||||
<string>Enabled (local time)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_2">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Maximum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>CPU frame size</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignmentFlag::AlignLeading|Qt::AlignmentFlag::AlignLeft|Qt::AlignmentFlag::AlignTop</set>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QRadioButton" name="radioButtonUTC">
|
||||
<widget class="QRadioButton" name="radioButtonLargerFrames">
|
||||
<property name="text">
|
||||
<string>Enabled (UTC)</string>
|
||||
<string>Larger frames (less smooth)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="radioButtonSmallerFrames">
|
||||
<property name="text">
|
||||
<string>Smaller frames (smoother)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -373,7 +385,7 @@
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
<enum>Qt::Orientation::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
|
||||
@@ -94,6 +94,7 @@ SettingsNetwork::enableElements(Ui::SettingsNetwork *ui)
|
||||
intf_label->setVisible(true);
|
||||
break;
|
||||
|
||||
#if defined(__unix__) || defined(__APPLE__)
|
||||
case NET_TYPE_TAP:
|
||||
// option_list_label->setText("TAP Options");
|
||||
option_list_label->setVisible(true);
|
||||
@@ -101,6 +102,8 @@ SettingsNetwork::enableElements(Ui::SettingsNetwork *ui)
|
||||
|
||||
bridge_label->setVisible(true);
|
||||
bridge_line->setVisible(true);
|
||||
break;
|
||||
#endif
|
||||
|
||||
case NET_TYPE_SLIRP:
|
||||
default:
|
||||
@@ -139,7 +142,9 @@ SettingsNetwork::save()
|
||||
for (int i = 0; i < NET_CARD_MAX; ++i) {
|
||||
auto *cbox = findChild<QComboBox *>(QString("comboBoxNIC%1").arg(i + 1));
|
||||
auto *socket_line = findChild<QLineEdit *>(QString("socketVDENIC%1").arg(i + 1));
|
||||
#if defined(__unix__) || defined(__APPLE__)
|
||||
auto *bridge_line = findChild<QLineEdit *>(QString("bridgeTAPNIC%1").arg(i + 1));
|
||||
#endif
|
||||
net_cards_conf[i].device_num = cbox->currentData().toInt();
|
||||
cbox = findChild<QComboBox *>(QString("comboBoxNet%1").arg(i + 1));
|
||||
net_cards_conf[i].net_type = cbox->currentData().toInt();
|
||||
@@ -149,8 +154,10 @@ SettingsNetwork::save()
|
||||
strncpy(net_cards_conf[i].host_dev_name, network_devs[cbox->currentData().toInt()].device, sizeof(net_cards_conf[i].host_dev_name) - 1);
|
||||
else if (net_cards_conf[i].net_type == NET_TYPE_VDE)
|
||||
strncpy(net_cards_conf[i].host_dev_name, socket_line->text().toUtf8().constData(), sizeof(net_cards_conf[i].host_dev_name));
|
||||
#if defined(__unix__) || defined(__APPLE__)
|
||||
else if (net_cards_conf[i].net_type == NET_TYPE_TAP)
|
||||
strncpy(net_cards_conf[i].host_dev_name, bridge_line->text().toUtf8().constData(), sizeof(net_cards_conf[i].host_dev_name));
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -217,7 +224,9 @@ SettingsNetwork::onCurrentMachineChanged(int machineId)
|
||||
if (network_devmap.has_vde)
|
||||
Models::AddEntry(model, "VDE", NET_TYPE_VDE);
|
||||
|
||||
#if defined(__unix__) || defined(__APPLE__)
|
||||
Models::AddEntry(model, "TAP", NET_TYPE_TAP);
|
||||
#endif
|
||||
|
||||
model->removeRows(0, removeRows);
|
||||
cbox->setCurrentIndex(cbox->findData(net_cards_conf[i].net_type));
|
||||
@@ -243,10 +252,12 @@ SettingsNetwork::onCurrentMachineChanged(int machineId)
|
||||
QString currentVdeSocket = net_cards_conf[i].host_dev_name;
|
||||
auto editline = findChild<QLineEdit *>(QString("socketVDENIC%1").arg(i+1));
|
||||
editline->setText(currentVdeSocket);
|
||||
#if defined(__unix__) || defined(__APPLE__)
|
||||
} else if (net_cards_conf[i].net_type == NET_TYPE_TAP) {
|
||||
QString currentTapDevice = net_cards_conf[i].host_dev_name;
|
||||
auto editline = findChild<QLineEdit *>(QString("bridgeTAPNIC%1").arg(i+1));
|
||||
editline->setText(currentTapDevice);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,7 +62,6 @@ SettingsStorageControllers::save()
|
||||
ide_ter_enabled = ui->checkBoxTertiaryIDE->isChecked() ? 1 : 0;
|
||||
ide_qua_enabled = ui->checkBoxQuaternaryIDE->isChecked() ? 1 : 0;
|
||||
cassette_enable = ui->checkBoxCassette->isChecked() ? 1 : 0;
|
||||
lba_enhancer_enabled = ui->checkBoxLbaEnhancer->isChecked() ? 1 : 0;
|
||||
}
|
||||
|
||||
void
|
||||
@@ -232,9 +231,6 @@ SettingsStorageControllers::onCurrentMachineChanged(int machineId)
|
||||
ui->checkBoxCassette->setChecked(false);
|
||||
ui->checkBoxCassette->setEnabled(false);
|
||||
}
|
||||
|
||||
ui->checkBoxLbaEnhancer->setChecked(lba_enhancer_enabled > 0 && device_available(&lba_enhancer_device));
|
||||
ui->pushButtonConfigureLbaEnhancer->setEnabled(ui->checkBoxLbaEnhancer->isChecked());
|
||||
}
|
||||
|
||||
void
|
||||
@@ -365,15 +361,3 @@ SettingsStorageControllers::on_pushButtonSCSI4_clicked()
|
||||
{
|
||||
DeviceConfig::ConfigureDevice(scsi_card_getdevice(ui->comboBoxSCSI4->currentData().toInt()), 4);
|
||||
}
|
||||
|
||||
void
|
||||
SettingsStorageControllers::on_checkBoxLbaEnhancer_stateChanged(int arg1)
|
||||
{
|
||||
ui->pushButtonConfigureLbaEnhancer->setEnabled(arg1 != 0);
|
||||
}
|
||||
|
||||
void
|
||||
SettingsStorageControllers::on_pushButtonConfigureLbaEnhancer_clicked()
|
||||
{
|
||||
DeviceConfig::ConfigureDevice(&lba_enhancer_device);
|
||||
}
|
||||
|
||||
@@ -44,9 +44,6 @@ private slots:
|
||||
void on_comboBoxSCSI4_currentIndexChanged(int index);
|
||||
void on_pushButtonSCSI4_clicked();
|
||||
|
||||
void on_checkBoxLbaEnhancer_stateChanged(int arg1);
|
||||
void on_pushButtonConfigureLbaEnhancer_clicked();
|
||||
|
||||
private:
|
||||
Ui::SettingsStorageControllers *ui;
|
||||
int machineId = 0;
|
||||
|
||||
@@ -257,43 +257,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBoxLbaEnhancer">
|
||||
<property name="text">
|
||||
<string>Vision Systems LBA Enhancer</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButtonConfigureLbaEnhancer">
|
||||
<property name="text">
|
||||
<string>Configure</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
|
||||
@@ -59,7 +59,7 @@ VMManagerAddMachine(QWidget *parent) : QWizard(parent)
|
||||
|
||||
// Wizard wants to resize based on image. This keeps the size
|
||||
setMinimumSize(size());
|
||||
setOption(HaveHelpButton, true);
|
||||
setOption(HaveHelpButton, false);
|
||||
// setPixmap(LogoPixmap, QPixmap(":/settings/qt/icons/86Box-gray.ico"));
|
||||
|
||||
connect(this, &QWizard::helpRequested, this, &VMManagerAddMachine::showHelp);
|
||||
|
||||
@@ -218,7 +218,9 @@ VMManagerClientSocket::eventFilter(QObject *obj, QEvent *event)
|
||||
if (event->type() == QEvent::WindowBlocked) {
|
||||
running_state = dopause ? VMManagerProtocol::RunningState::PausedWaiting : VMManagerProtocol::RunningState::RunningWaiting;
|
||||
clientRunningStateChanged(running_state);
|
||||
window_blocked = true;
|
||||
} else if (event->type() == QEvent::WindowUnblocked) {
|
||||
window_blocked = false;
|
||||
running_state = dopause ? VMManagerProtocol::RunningState::Paused : VMManagerProtocol::RunningState::Running;
|
||||
clientRunningStateChanged(running_state);
|
||||
}
|
||||
@@ -226,11 +228,22 @@ VMManagerClientSocket::eventFilter(QObject *obj, QEvent *event)
|
||||
return QObject::eventFilter(obj, event);
|
||||
}
|
||||
|
||||
void
|
||||
VMManagerClientSocket::sendWinIdMessage(WId id)
|
||||
{
|
||||
QJsonObject extra_object;
|
||||
extra_object["params"] = static_cast<int>(id);
|
||||
sendMessageWithObject(VMManagerProtocol::ClientMessage::WinIdMessage, extra_object);
|
||||
}
|
||||
|
||||
void
|
||||
VMManagerClientSocket::clientRunningStateChanged(VMManagerProtocol::RunningState state) const
|
||||
{
|
||||
QJsonObject extra_object;
|
||||
if ((state == VMManagerProtocol::RunningState::Paused
|
||||
|| state == VMManagerProtocol::RunningState::Running) && window_blocked) {
|
||||
state = (state == VMManagerProtocol::RunningState::Paused) ? VMManagerProtocol::RunningState::PausedWaiting : VMManagerProtocol::RunningState::RunningWaiting;
|
||||
}
|
||||
extra_object["status"] = static_cast<int>(state);
|
||||
sendMessageWithObject(VMManagerProtocol::ClientMessage::RunningStateChanged, extra_object);
|
||||
|
||||
}
|
||||
|
||||
@@ -31,6 +31,8 @@ public:
|
||||
explicit VMManagerClientSocket(QObject* object = nullptr);
|
||||
bool IPCConnect(const QString &server);
|
||||
|
||||
void sendWinIdMessage(WId id);
|
||||
|
||||
signals:
|
||||
void pause();
|
||||
void ctrlaltdel();
|
||||
@@ -47,6 +49,7 @@ private:
|
||||
QString server_name;
|
||||
QLocalSocket *socket;
|
||||
bool server_connected;
|
||||
bool window_blocked = false;
|
||||
void connected() const;
|
||||
void disconnected() const;
|
||||
static void connectionError(QLocalSocket::LocalSocketError socketError);
|
||||
|
||||
@@ -336,6 +336,17 @@ VMManagerDetails::updateProcessStatus() {
|
||||
connect(startPauseButton, &QToolButton::clicked, sysconfig, &VMManagerSystem::startButtonPressed);
|
||||
startPauseButton->setToolTip(tr("Start"));
|
||||
}
|
||||
|
||||
if (sysconfig->window_obscured) {
|
||||
resetButton->setDisabled(true);
|
||||
stopButton->setDisabled(true);
|
||||
cadButton->setDisabled(true);
|
||||
startPauseButton->setDisabled(true);
|
||||
configureButton->setDisabled(true);
|
||||
} else {
|
||||
configureButton->setDisabled(false);
|
||||
startPauseButton->setDisabled(false);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -48,7 +48,7 @@ VMManagerMain::VMManagerMain(QWidget *parent) :
|
||||
|
||||
// Set up the context menu for the list view
|
||||
ui->listView->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||
connect(ui->listView, &QListView::customContextMenuRequested, [this](const QPoint &pos) {
|
||||
connect(ui->listView, &QListView::customContextMenuRequested, [this, parent](const QPoint &pos) {
|
||||
const auto indexAt = ui->listView->indexAt(pos);
|
||||
if (indexAt.isValid()) {
|
||||
QMenu contextMenu(tr("Context Menu"), ui->listView);
|
||||
@@ -59,6 +59,7 @@ VMManagerMain::VMManagerMain(QWidget *parent) :
|
||||
connect(&nameChangeAction, &QAction::triggered, ui->listView, [this, indexAt] {
|
||||
updateDisplayName(indexAt);
|
||||
});
|
||||
nameChangeAction.setEnabled(!selected_sysconfig->window_obscured);
|
||||
|
||||
QAction openSystemFolderAction(tr("Open folder"));
|
||||
contextMenu.addAction(&openSystemFolderAction);
|
||||
@@ -82,6 +83,18 @@ VMManagerMain::VMManagerMain(QWidget *parent) :
|
||||
selected_sysconfig->setIcon(iconName);
|
||||
}
|
||||
});
|
||||
setSystemIcon.setEnabled(!selected_sysconfig->window_obscured);
|
||||
|
||||
QAction killIcon(tr("&Kill"));
|
||||
contextMenu.addAction(&killIcon);
|
||||
connect(&killIcon, &QAction::triggered, [this, parent] {
|
||||
QMessageBox msgbox(QMessageBox::Warning, tr("Warning"), tr("Killing a virtual machine can cause data loss. Only do this if 86Box.exe process gets stuck.\n\nDo you really wish to kill the virtual machine \"%1\"?").arg(selected_sysconfig->displayName), QMessageBox::StandardButton::Yes | QMessageBox::StandardButton::No, parent);
|
||||
msgbox.exec();
|
||||
if (msgbox.result() == QMessageBox::Yes) {
|
||||
selected_sysconfig->process->kill();
|
||||
}
|
||||
});
|
||||
killIcon.setEnabled(selected_sysconfig->process->state() == QProcess::Running);
|
||||
|
||||
contextMenu.addSeparator();
|
||||
|
||||
@@ -131,12 +144,14 @@ VMManagerMain::VMManagerMain(QWidget *parent) :
|
||||
emit updateStatusRight(totalCountString());
|
||||
});
|
||||
|
||||
#if EMU_BUILD_NUM != 0
|
||||
// Start update check after a slight delay
|
||||
QTimer::singleShot(1000, this, [this] {
|
||||
if(updateCheck) {
|
||||
backgroundUpdateCheckStart();
|
||||
}
|
||||
});
|
||||
#endif
|
||||
}
|
||||
|
||||
VMManagerMain::~VMManagerMain() {
|
||||
@@ -276,7 +291,9 @@ VMManagerMain::loadSettings()
|
||||
{
|
||||
const auto config = new VMManagerConfig(VMManagerConfig::ConfigType::General);
|
||||
const auto lastSelection = config->getStringValue("last_selection");
|
||||
#if EMU_BUILD_NUM != 0
|
||||
updateCheck = config->getStringValue("update_check").toInt();
|
||||
#endif
|
||||
regexSearch = config->getStringValue("regex_search").toInt();
|
||||
|
||||
const auto matches = ui->listView->model()->match(vm_model->index(0, 0), VMManagerModel::Roles::ConfigName, QVariant::fromValue(lastSelection));
|
||||
@@ -453,10 +470,10 @@ VMManagerMain::onPreferencesUpdated()
|
||||
}
|
||||
}
|
||||
|
||||
#if EMU_BUILD_NUM != 0
|
||||
void
|
||||
VMManagerMain::backgroundUpdateCheckStart() const
|
||||
{
|
||||
#if EMU_BUILD_NUM != 0
|
||||
auto updateChannel = UpdateCheck::UpdateChannel::CI;
|
||||
#ifdef RELEASE_BUILD
|
||||
updateChannel = UpdateCheck::UpdateChannel::Stable;
|
||||
@@ -465,7 +482,6 @@ VMManagerMain::backgroundUpdateCheckStart() const
|
||||
connect(updateCheck, &UpdateCheck::updateCheckComplete, this, &VMManagerMain::backgroundUpdateCheckComplete);
|
||||
connect(updateCheck, &UpdateCheck::updateCheckError, this, &VMManagerMain::backgroundUpdateCheckError);
|
||||
updateCheck->checkForUpdates();
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
@@ -483,6 +499,7 @@ VMManagerMain::backgroundUpdateCheckError(const QString &errorMsg)
|
||||
qDebug() << "Update check failed with the following error:" << errorMsg;
|
||||
// TODO: Update the status bar
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
VMManagerMain::showTextFileContents(const QString &title, const QString &path)
|
||||
|
||||
@@ -69,7 +69,11 @@ public slots:
|
||||
void searchSystems(const QString &text) const;
|
||||
void newMachineWizard();
|
||||
void addNewSystem(const QString &name, const QString &dir, const QString &configFile = {});
|
||||
#if __GNUC__ >= 11
|
||||
[[nodiscard]] QStringList getSearchCompletionList() const;
|
||||
#else
|
||||
QStringList getSearchCompletionList() const;
|
||||
#endif
|
||||
void modelDataChange();
|
||||
void onPreferencesUpdated();
|
||||
|
||||
@@ -81,7 +85,9 @@ private:
|
||||
VMManagerSystem *selected_sysconfig;
|
||||
// VMManagerConfig *config;
|
||||
QSortFilterProxyModel *proxy_model;
|
||||
#if EMU_BUILD_NUM != 0
|
||||
bool updateCheck = false;
|
||||
#endif
|
||||
bool regexSearch = false;
|
||||
|
||||
// void updateSelection(const QItemSelection &selected,
|
||||
@@ -93,11 +99,15 @@ private:
|
||||
void loadSettings();
|
||||
[[nodiscard]] bool currentSelectionIsValid() const;
|
||||
[[nodiscard]] QString totalCountString() const;
|
||||
#if EMU_BUILD_NUM != 0
|
||||
void backgroundUpdateCheckStart() const;
|
||||
#endif
|
||||
void showTextFileContents(const QString &title, const QString &path);
|
||||
private slots:
|
||||
#if EMU_BUILD_NUM != 0
|
||||
void backgroundUpdateCheckComplete(const UpdateCheck::UpdateResult &result);
|
||||
void backgroundUpdateCheckError(const QString &errorMsg);
|
||||
#endif
|
||||
};
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
@@ -181,3 +181,9 @@ VMManagerMainWindow::checkForUpdatesTriggered()
|
||||
const auto updateCheck = new UpdateCheckDialog(updateChannel);
|
||||
updateCheck->exec();
|
||||
}
|
||||
|
||||
void VMManagerMainWindow::on_actionExit_triggered()
|
||||
{
|
||||
this->close();
|
||||
}
|
||||
|
||||
|
||||
@@ -52,6 +52,8 @@ private slots:
|
||||
void preferencesTriggered();
|
||||
static void checkForUpdatesTriggered();
|
||||
|
||||
void on_actionExit_triggered();
|
||||
|
||||
protected:
|
||||
void closeEvent(QCloseEvent *event) override;
|
||||
};
|
||||
|
||||
@@ -35,6 +35,8 @@
|
||||
<string>File</string>
|
||||
</property>
|
||||
<addaction name="actionNew_Machine"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionExit"/>
|
||||
</widget>
|
||||
<addaction name="menuFile"/>
|
||||
<addaction name="menuTools"/>
|
||||
@@ -204,6 +206,17 @@
|
||||
<string>Check for updates</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionExit">
|
||||
<property name="icon">
|
||||
<iconset theme="QIcon::ThemeIcon::ApplicationExit"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Exit</string>
|
||||
</property>
|
||||
<property name="menuRole">
|
||||
<enum>QAction::MenuRole::QuitRole</enum>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="../qt_resources.qrc"/>
|
||||
|
||||
@@ -44,8 +44,12 @@ VMManagerPreferences(QWidget *parent) : ui(new Ui::VMManagerPreferences)
|
||||
}
|
||||
|
||||
// TODO: Defaults
|
||||
#if EMU_BUILD_NUM != 0
|
||||
const auto configUpdateCheck = config->getStringValue("update_check").toInt();
|
||||
ui->updateCheckBox->setChecked(configUpdateCheck);
|
||||
#else
|
||||
ui->updateCheckBox->setVisible(false);
|
||||
#endif
|
||||
const auto useRegexSearch = config->getStringValue("regex_search").toInt();
|
||||
ui->regexSearchCheckBox->setChecked(useRegexSearch);
|
||||
|
||||
@@ -70,7 +74,9 @@ VMManagerPreferences::accept()
|
||||
{
|
||||
const auto config = new VMManagerConfig(VMManagerConfig::ConfigType::General);
|
||||
config->setStringValue("system_directory", ui->systemDirectory->text());
|
||||
#if EMU_BUILD_NUM != 0
|
||||
config->setStringValue("update_check", ui->updateCheckBox->isChecked() ? "1" : "0");
|
||||
#endif
|
||||
config->setStringValue("regex_search", ui->regexSearchCheckBox->isChecked() ? "1" : "0");
|
||||
QDialog::accept();
|
||||
}
|
||||
@@ -79,4 +85,4 @@ void
|
||||
VMManagerPreferences::reject()
|
||||
{
|
||||
QDialog::reject();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -91,6 +91,8 @@ VMManagerProtocol::getClientMessageType(const QJsonObject &json_document)
|
||||
return VMManagerProtocol::ClientMessage::WindowUnblocked;
|
||||
} else if (message_type == "RunningStateChanged") {
|
||||
return VMManagerProtocol::ClientMessage::RunningStateChanged;
|
||||
} else if (message_type == "WinIdMessage") {
|
||||
return VMManagerProtocol::ClientMessage::WinIdMessage;
|
||||
}
|
||||
return VMManagerProtocol::ClientMessage::UnknownMessage;
|
||||
}
|
||||
|
||||
@@ -54,6 +54,7 @@ public:
|
||||
WindowBlocked,
|
||||
WindowUnblocked,
|
||||
RunningStateChanged,
|
||||
WinIdMessage,
|
||||
UnknownMessage,
|
||||
};
|
||||
Q_ENUM(ClientMessage);
|
||||
@@ -82,6 +83,7 @@ public:
|
||||
|
||||
static bool hasRequiredFields(const QJsonObject &json_document);
|
||||
static QJsonObject getParams(const QJsonObject &json_document);
|
||||
static QJsonObject getStatus(const QJsonObject &json_document);
|
||||
static ClientMessage getClientMessageType(const QJsonObject &json_document);
|
||||
static ManagerMessage getManagerMessageType(const QJsonObject &json_document);
|
||||
|
||||
|
||||
@@ -153,6 +153,16 @@ VMManagerServerSocket::jsonReceived(const QJsonObject &json)
|
||||
|
||||
auto message_type = VMManagerProtocol::getClientMessageType(json);
|
||||
switch (message_type) {
|
||||
case VMManagerProtocol::ClientMessage::WinIdMessage:
|
||||
qDebug("WinId message received from client");
|
||||
params_object = VMManagerProtocol::getParams(json);
|
||||
if (!params_object.isEmpty()) {
|
||||
// valid object
|
||||
if(params_object.value("params").type() == QJsonValue::Double) {
|
||||
emit winIdReceived(params_object.value("params").toVariant().toULongLong());
|
||||
}
|
||||
}
|
||||
break;
|
||||
case VMManagerProtocol::ClientMessage::Status:
|
||||
qDebug("Status message received from client");
|
||||
break;
|
||||
|
||||
@@ -75,6 +75,7 @@ signals:
|
||||
void dataReceived();
|
||||
void windowStatusChanged(int status);
|
||||
void runningStatusChanged(VMManagerProtocol::RunningState state);
|
||||
void winIdReceived(WId id);
|
||||
|
||||
|
||||
};
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
* Copyright 2024 cold-brewed
|
||||
*/
|
||||
|
||||
|
||||
#include <QString>
|
||||
#include <QDirIterator>
|
||||
#include <QDebug>
|
||||
@@ -26,10 +27,15 @@
|
||||
#include <QtNetwork>
|
||||
#include <QElapsedTimer>
|
||||
#include <QProgressDialog>
|
||||
#include <QWindow>
|
||||
#include "qt_vmmanager_system.hpp"
|
||||
// #include "qt_vmmanager_details_section.hpp"
|
||||
#include "qt_vmmanager_detailsection.hpp"
|
||||
|
||||
#ifdef Q_OS_WINDOWS
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
|
||||
extern "C" {
|
||||
#include <86box/86box.h>
|
||||
@@ -427,12 +433,18 @@ VMManagerSystem::launchSettings() {
|
||||
|
||||
// If the system is already running, instruct it to show settings
|
||||
if (process->processId() != 0) {
|
||||
#ifdef Q_OS_WINDOWS
|
||||
if (this->id) {
|
||||
SetForegroundWindow((HWND)this->id);
|
||||
}
|
||||
#endif
|
||||
socket_server->serverSendMessage(VMManagerProtocol::ManagerMessage::ShowSettings);
|
||||
return;
|
||||
}
|
||||
|
||||
// Otherwise, launch the system with the settings parameter
|
||||
setProcessEnvVars();
|
||||
window_obscured = true;
|
||||
QString program = main_binary.filePath();
|
||||
QStringList open_command_args;
|
||||
QStringList args;
|
||||
@@ -776,6 +788,7 @@ VMManagerSystem::startServer() {
|
||||
connect(socket_server, &VMManagerServerSocket::dataReceived, this, &VMManagerSystem::dataReceived);
|
||||
connect(socket_server, &VMManagerServerSocket::windowStatusChanged, this, &VMManagerSystem::windowStatusChangeReceived);
|
||||
connect(socket_server, &VMManagerServerSocket::runningStatusChanged, this, &VMManagerSystem::runningStatusChangeReceived);
|
||||
connect(socket_server, &VMManagerServerSocket::winIdReceived, this, [this] (WId id) { this->id = id; });
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
@@ -846,6 +859,7 @@ VMManagerSystem::processStatusChanged()
|
||||
}
|
||||
} else if (process->state() == QProcess::ProcessState::NotRunning) {
|
||||
process_status = VMManagerSystem::ProcessStatus::Stopped;
|
||||
window_obscured = false;
|
||||
}
|
||||
emit itemDataChanged();
|
||||
emit clientProcessStatusChanged();
|
||||
@@ -892,12 +906,20 @@ VMManagerSystem::runningStatusChangeReceived(VMManagerProtocol::RunningState sta
|
||||
{
|
||||
if(state == VMManagerProtocol::RunningState::Running) {
|
||||
process_status = VMManagerSystem::ProcessStatus::Running;
|
||||
window_obscured = false;
|
||||
windowStatusChanged();
|
||||
} else if(state == VMManagerProtocol::RunningState::Paused) {
|
||||
process_status = VMManagerSystem::ProcessStatus::Paused;
|
||||
window_obscured = false;
|
||||
windowStatusChanged();
|
||||
} else if(state == VMManagerProtocol::RunningState::RunningWaiting) {
|
||||
process_status = VMManagerSystem::ProcessStatus::RunningWaiting;
|
||||
window_obscured = true;
|
||||
windowStatusChanged();
|
||||
} else if(state == VMManagerProtocol::RunningState::PausedWaiting) {
|
||||
process_status = VMManagerSystem::ProcessStatus::PausedWaiting;
|
||||
window_obscured = true;
|
||||
windowStatusChanged();
|
||||
} else {
|
||||
process_status = VMManagerSystem::ProcessStatus::Unknown;
|
||||
}
|
||||
|
||||
@@ -174,6 +174,8 @@ private:
|
||||
// Configuration file settings
|
||||
VMManagerConfig *config_settings;
|
||||
|
||||
WId id;
|
||||
|
||||
bool serverIsRunning;
|
||||
bool startServer();
|
||||
|
||||
|
||||
@@ -6,15 +6,22 @@
|
||||
*
|
||||
* This file is part of the 86Box distribution.
|
||||
*
|
||||
* Windows raw input native filter for QT
|
||||
* Windows raw input native filter for Qt
|
||||
*
|
||||
*
|
||||
*
|
||||
* Authors: Teemu Korhonen
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
* Sam Latinga
|
||||
* Cacodemon345
|
||||
*
|
||||
* Copyright 2021 Teemu Korhonen
|
||||
* Copyright 2016-2018 Miran Grca.
|
||||
* Copyright 1997-2025 Sam Latinga
|
||||
* Copyright 2024-2025 Cacodemon345.
|
||||
*
|
||||
* See this header for SDL3 code license:
|
||||
* https://github.com/libsdl-org/SDL/blob/8e5fe0ea61dc87b29ca9a6119324221df0113bcf/src/video/windows/SDL_windowsrawinput.c#L1
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
@@ -31,6 +38,8 @@
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
/* Mouse RawInput code taken from SDL3. */
|
||||
|
||||
#include "qt_winrawinputfilter.hpp"
|
||||
|
||||
#include <QMenuBar>
|
||||
@@ -94,30 +103,158 @@ bool windows_is_light_theme() {
|
||||
return i == 1;
|
||||
}
|
||||
|
||||
struct
|
||||
{
|
||||
HANDLE done_event = 0, ready_event = 0;
|
||||
std::atomic_bool done{false};
|
||||
|
||||
size_t rawinput_offset = 0, rawinput_size = 0;
|
||||
uint8_t* rawinput = nullptr;
|
||||
|
||||
HANDLE thread = 0;
|
||||
} win_rawinput_data;
|
||||
|
||||
static void
|
||||
win_poll_mouse(void)
|
||||
{
|
||||
// Yes, this is a thing in C++.
|
||||
auto* data = &win_rawinput_data;
|
||||
uint32_t size, i, count, total = 0;
|
||||
RAWINPUT *input;
|
||||
//static int64_t ms_time = plat_get_ticks();
|
||||
|
||||
if (data->rawinput_offset == 0) {
|
||||
BOOL isWow64;
|
||||
|
||||
data->rawinput_offset = sizeof(RAWINPUTHEADER);
|
||||
if (IsWow64Process(GetCurrentProcess(), &isWow64) && isWow64) {
|
||||
// We're going to get 64-bit data, so use the 64-bit RAWINPUTHEADER size
|
||||
data->rawinput_offset += 8;
|
||||
}
|
||||
}
|
||||
|
||||
input = (RAWINPUT *)data->rawinput;
|
||||
for (;;) {
|
||||
size = data->rawinput_size - (UINT)((BYTE *)input - data->rawinput);
|
||||
count = GetRawInputBuffer(input, &size, sizeof(RAWINPUTHEADER));
|
||||
if (count == 0 || count == (UINT)-1) {
|
||||
if (!data->rawinput || (count == (UINT)-1 && GetLastError() == ERROR_INSUFFICIENT_BUFFER)) {
|
||||
const UINT RAWINPUT_BUFFER_SIZE_INCREMENT = 96; // 2 64-bit raw mouse packets
|
||||
BYTE *rawinput = (BYTE *)realloc(data->rawinput, data->rawinput_size + RAWINPUT_BUFFER_SIZE_INCREMENT);
|
||||
if (!rawinput) {
|
||||
break;
|
||||
}
|
||||
input = (RAWINPUT *)(rawinput + ((BYTE *)input - data->rawinput));
|
||||
data->rawinput = rawinput;
|
||||
data->rawinput_size += RAWINPUT_BUFFER_SIZE_INCREMENT;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
total += count;
|
||||
|
||||
// Advance input to the end of the buffer
|
||||
while (count--) {
|
||||
input = NEXTRAWINPUTBLOCK(input);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (total > 0) {
|
||||
for (i = 0, input = (RAWINPUT *)data->rawinput; i < total; ++i, input = NEXTRAWINPUTBLOCK(input)) {
|
||||
if (input->header.dwType == RIM_TYPEMOUSE) {
|
||||
RAWMOUSE *rawmouse = (RAWMOUSE *)((BYTE *)input + data->rawinput_offset);
|
||||
if (mouse_capture)
|
||||
WindowsRawInputFilter::mouse_handle(rawmouse);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//qDebug() << "Mouse delay: " << (plat_get_ticks() - ms_time);
|
||||
//ms_time = plat_get_ticks();
|
||||
}
|
||||
|
||||
static DWORD
|
||||
win_rawinput_thread(void* param)
|
||||
{
|
||||
RAWINPUTDEVICE rid = {
|
||||
.usUsagePage = 0x01,
|
||||
.usUsage = 0x02,
|
||||
.dwFlags = 0,
|
||||
.hwndTarget = nullptr
|
||||
};
|
||||
auto window = CreateWindowEx(0, TEXT("Message"), NULL, 0, 0, 0, 0, 0, HWND_MESSAGE, NULL, NULL, NULL);
|
||||
if (!window) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
rid.hwndTarget = window;
|
||||
if (!RegisterRawInputDevices(&rid, 1, sizeof(rid))) {
|
||||
DestroyWindow(window);
|
||||
return 0;
|
||||
}
|
||||
|
||||
SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_TIME_CRITICAL);
|
||||
|
||||
SetEvent(win_rawinput_data.ready_event);
|
||||
|
||||
while (!win_rawinput_data.done) {
|
||||
DWORD result = MsgWaitForMultipleObjects(1, &win_rawinput_data.done_event, FALSE, INFINITE, QS_RAWINPUT);
|
||||
|
||||
if (result != (WAIT_OBJECT_0 + 1)) {
|
||||
break;
|
||||
}
|
||||
|
||||
// Clear the queue status so MsgWaitForMultipleObjects() will wait again
|
||||
(void)GetQueueStatus(QS_RAWINPUT);
|
||||
|
||||
win_poll_mouse();
|
||||
}
|
||||
|
||||
rid.dwFlags |= RIDEV_REMOVE;
|
||||
rid.hwndTarget = NULL;
|
||||
|
||||
RegisterRawInputDevices(&rid, 1, sizeof(rid));
|
||||
DestroyWindow(window);
|
||||
return 0;
|
||||
}
|
||||
|
||||
extern "C" void win_joystick_handle(PRAWINPUT);
|
||||
std::unique_ptr<WindowsRawInputFilter>
|
||||
WindowsRawInputFilter::Register(MainWindow *window)
|
||||
{
|
||||
RAWINPUTDEVICE rid[2] = {
|
||||
RAWINPUTDEVICE rid[1] = {
|
||||
{
|
||||
.usUsagePage = 0x01,
|
||||
.usUsage = 0x06,
|
||||
.dwFlags = RIDEV_NOHOTKEYS,
|
||||
.hwndTarget = nullptr
|
||||
},
|
||||
{
|
||||
.usUsagePage = 0x01,
|
||||
.usUsage = 0x02,
|
||||
.dwFlags = 0,
|
||||
.hwndTarget = nullptr
|
||||
}
|
||||
};
|
||||
|
||||
if (hook_enabled && (RegisterRawInputDevices(&(rid[1]), 1, sizeof(rid[0])) == FALSE))
|
||||
return std::unique_ptr<WindowsRawInputFilter>(nullptr);
|
||||
else if (!hook_enabled && (RegisterRawInputDevices(rid, 2, sizeof(rid[0])) == FALSE))
|
||||
return std::unique_ptr<WindowsRawInputFilter>(nullptr);
|
||||
if (!hook_enabled) {
|
||||
RegisterRawInputDevices(rid, 1, sizeof(rid[0]));
|
||||
}
|
||||
|
||||
win_rawinput_data.done_event = CreateEvent(nullptr, FALSE, FALSE, nullptr);
|
||||
win_rawinput_data.ready_event = CreateEvent(nullptr, FALSE, FALSE, nullptr);
|
||||
|
||||
if (!win_rawinput_data.done_event || !win_rawinput_data.ready_event) {
|
||||
warning("Failed to create RawInput events.");
|
||||
|
||||
goto conclude;
|
||||
}
|
||||
|
||||
win_rawinput_data.thread = CreateThread(nullptr, 0, win_rawinput_thread, nullptr, 0, nullptr);
|
||||
if (win_rawinput_data.thread) {
|
||||
HANDLE handles[2] = { win_rawinput_data.ready_event, win_rawinput_data.thread };
|
||||
|
||||
WaitForMultipleObjects(2, handles, FALSE, INFINITE);
|
||||
} else {
|
||||
warning("Failed to create RawInput thread.");
|
||||
}
|
||||
|
||||
conclude:
|
||||
std::unique_ptr<WindowsRawInputFilter> inputfilter(new WindowsRawInputFilter(window));
|
||||
|
||||
return inputfilter;
|
||||
@@ -135,25 +272,23 @@ WindowsRawInputFilter::WindowsRawInputFilter(MainWindow *window)
|
||||
|
||||
WindowsRawInputFilter::~WindowsRawInputFilter()
|
||||
{
|
||||
RAWINPUTDEVICE rid[2] = {
|
||||
win_rawinput_data.done = true;
|
||||
if (win_rawinput_data.done_event)
|
||||
SetEvent(win_rawinput_data.done_event);
|
||||
if (win_rawinput_data.thread)
|
||||
WaitForSingleObject(win_rawinput_data.thread, INFINITE);
|
||||
RAWINPUTDEVICE rid =
|
||||
{
|
||||
.usUsagePage = 0x01,
|
||||
.usUsage = 0x06,
|
||||
.dwFlags = RIDEV_REMOVE,
|
||||
.hwndTarget = NULL
|
||||
},
|
||||
{
|
||||
.usUsagePage = 0x01,
|
||||
.usUsage = 0x02,
|
||||
.dwFlags = RIDEV_REMOVE,
|
||||
.hwndTarget = NULL
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
if (hook_enabled)
|
||||
RegisterRawInputDevices(&(rid[1]), 1, sizeof(rid[0]));
|
||||
else
|
||||
RegisterRawInputDevices(rid, 2, sizeof(rid[0]));
|
||||
if (!hook_enabled)
|
||||
RegisterRawInputDevices(&rid, 1, sizeof(rid));
|
||||
|
||||
free(win_rawinput_data.rawinput);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -305,10 +440,6 @@ WindowsRawInputFilter::handle_input(HRAWINPUT input)
|
||||
case RIM_TYPEKEYBOARD:
|
||||
keyboard_handle(raw);
|
||||
break;
|
||||
case RIM_TYPEMOUSE:
|
||||
if (mouse_capture)
|
||||
mouse_handle(raw);
|
||||
break;
|
||||
case RIM_TYPEHID:
|
||||
win_joystick_handle(raw);
|
||||
break;
|
||||
@@ -328,9 +459,9 @@ WindowsRawInputFilter::keyboard_handle(PRAWINPUT raw)
|
||||
}
|
||||
|
||||
void
|
||||
WindowsRawInputFilter::mouse_handle(PRAWINPUT raw)
|
||||
WindowsRawInputFilter::mouse_handle(RAWMOUSE* raw)
|
||||
{
|
||||
RAWMOUSE state = raw->data.mouse;
|
||||
RAWMOUSE state = *raw;
|
||||
static int x, delta_x;
|
||||
static int y, delta_y;
|
||||
static int b, delta_z;
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
#include <QByteArray>
|
||||
|
||||
#include <windows.h>
|
||||
#include <windns.h>
|
||||
|
||||
#include <memory>
|
||||
|
||||
@@ -59,6 +60,8 @@ public:
|
||||
|
||||
~WindowsRawInputFilter();
|
||||
|
||||
static void mouse_handle(RAWMOUSE* raw);
|
||||
|
||||
private:
|
||||
MainWindow *window;
|
||||
int buttons = 0;
|
||||
@@ -71,7 +74,6 @@ private:
|
||||
|
||||
void handle_input(HRAWINPUT input);
|
||||
void keyboard_handle(PRAWINPUT raw);
|
||||
void mouse_handle(PRAWINPUT raw);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -45,8 +45,10 @@ static SDL_Joystick *sdl_joy[MAX_PLAT_JOYSTICKS];
|
||||
void
|
||||
joystick_init(void)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
/* This is needed for SDL's Windows raw input backend to work properly without SDL video. */
|
||||
SDL_SetHint(SDL_HINT_JOYSTICK_THREAD, "1");
|
||||
#endif
|
||||
|
||||
if (SDL_InitSubSystem(SDL_INIT_JOYSTICK) != 0) {
|
||||
return;
|
||||
|
||||
@@ -222,6 +222,7 @@ joystick_get_capabilities(raw_joystick_t *rawjoy, plat_joystick_t *joy)
|
||||
UINT size = 0;
|
||||
PHIDP_BUTTON_CAPS btn_caps = NULL;
|
||||
PHIDP_VALUE_CAPS val_caps = NULL;
|
||||
HIDP_CAPS caps;
|
||||
|
||||
/* Get preparsed data (HID data format) */
|
||||
GetRawInputDeviceInfoW(rawjoy->hdevice, RIDI_PREPARSEDDATA, NULL, &size);
|
||||
@@ -229,7 +230,6 @@ joystick_get_capabilities(raw_joystick_t *rawjoy, plat_joystick_t *joy)
|
||||
if (GetRawInputDeviceInfoW(rawjoy->hdevice, RIDI_PREPARSEDDATA, rawjoy->data, &size) <= 0)
|
||||
fatal("joystick_get_capabilities: Failed to get preparsed data.\n");
|
||||
|
||||
HIDP_CAPS caps;
|
||||
HidP_GetCaps(rawjoy->data, &caps);
|
||||
|
||||
/* Buttons */
|
||||
@@ -356,6 +356,7 @@ end_loop:
|
||||
free(info);
|
||||
}
|
||||
|
||||
free(deviceList);
|
||||
joystick_log("joystick_init: joysticks_present=%i\n", joysticks_present);
|
||||
|
||||
/* Initialize the RawInput (joystick and gamepad) module. */
|
||||
|
||||
@@ -81,28 +81,61 @@ ali5123_fdc_handler(ali5123_t *dev)
|
||||
static void
|
||||
ali5123_lpt_handler(ali5123_t *dev)
|
||||
{
|
||||
uint16_t ld_port = 0;
|
||||
uint16_t ld_port = 0x0000;
|
||||
uint16_t mask = 0xfffc;
|
||||
uint8_t global_enable = !(dev->regs[0x22] & (1 << 3));
|
||||
uint8_t local_enable = !!dev->ld_regs[3][0x30];
|
||||
uint8_t lpt_irq = dev->ld_regs[3][0x70];
|
||||
uint8_t lpt_dma = dev->ld_regs[3][0x74];
|
||||
uint8_t lpt_mode = dev->ld_regs[3][0xf0] & 0x07;
|
||||
|
||||
if (lpt_irq > 15)
|
||||
lpt_irq = 0xff;
|
||||
|
||||
if (lpt_dma == 4)
|
||||
if (lpt_dma >= 4)
|
||||
lpt_dma = 0xff;
|
||||
|
||||
lpt1_remove();
|
||||
lpt_set_epp(0, !!(dev->ld_regs[3][0xf0] & 0x01));
|
||||
lpt_set_ecp(0, !!(dev->ld_regs[3][0xf0] & 0x02));
|
||||
lpt_set_ext(0, !(dev->ld_regs[3][0xf0] & 0x04) || !!(dev->ld_regs[3][0xf1] & 0x80));
|
||||
lpt_set_fifo_threshold(0, (dev->ld_regs[3][0xf0] & 0x78) >> 3);
|
||||
if ((lpt_mode == 0x04) && (dev->ld_regs[3][0xf1] & 0x80))
|
||||
lpt_mode = 0x00;
|
||||
switch (lpt_mode) {
|
||||
default:
|
||||
case 0x04:
|
||||
lpt_set_epp(0, 0);
|
||||
lpt_set_ecp(0, 0);
|
||||
lpt_set_ext(0, 0);
|
||||
break;
|
||||
case 0x00:
|
||||
lpt_set_epp(0, 0);
|
||||
lpt_set_ecp(0, 0);
|
||||
lpt_set_ext(0, 1);
|
||||
break;
|
||||
case 0x01: case 0x05:
|
||||
mask = 0xfff8;
|
||||
lpt_set_epp(0, 1);
|
||||
lpt_set_ecp(0, 0);
|
||||
lpt_set_ext(0, 0);
|
||||
break;
|
||||
case 0x02:
|
||||
lpt_set_epp(0, 0);
|
||||
lpt_set_ecp(0, 1);
|
||||
lpt_set_ext(0, 0);
|
||||
break;
|
||||
case 0x03: case 0x07:
|
||||
mask = 0xfff8;
|
||||
lpt_set_epp(0, 1);
|
||||
lpt_set_ecp(0, 1);
|
||||
lpt_set_ext(0, 0);
|
||||
break;
|
||||
}
|
||||
if (global_enable && local_enable) {
|
||||
ld_port = make_port(dev, 3) & 0xFFFC;
|
||||
if ((ld_port >= 0x0100) && (ld_port <= 0x0FFC))
|
||||
ld_port = (make_port(dev, 3) & 0xfffc) & mask;
|
||||
if ((ld_port >= 0x0100) && (ld_port <= (0x0ffc & mask)))
|
||||
lpt1_setup(ld_port);
|
||||
}
|
||||
lpt1_irq(lpt_irq);
|
||||
lpt_port_dma(0, lpt_dma);
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
@@ -123,6 +123,8 @@ lpt1_handler(pc87306_t *dev)
|
||||
uint8_t lpt_irq = LPT2_IRQ;
|
||||
uint8_t lpt_dma = ((dev->regs[0x18] & 0x06) >> 1);
|
||||
|
||||
lpt1_remove();
|
||||
|
||||
if (lpt_dma == 0x00)
|
||||
lpt_dma = 0xff;
|
||||
|
||||
@@ -157,17 +159,17 @@ lpt1_handler(pc87306_t *dev)
|
||||
if (dev->regs[0x1b] & 0x10)
|
||||
lpt_irq = (dev->regs[0x1b] & 0x20) ? 7 : 5;
|
||||
|
||||
lpt_set_ext(0, !!(dev->regs[0x02] & 0x80));
|
||||
|
||||
lpt_set_epp(0, !!(dev->regs[0x04] & 0x01));
|
||||
lpt_set_ecp(0, !!(dev->regs[0x04] & 0x04));
|
||||
|
||||
if (lpt_port)
|
||||
lpt1_setup(lpt_port);
|
||||
|
||||
lpt1_irq(lpt_irq);
|
||||
|
||||
lpt_port_dma(0, lpt_dma);
|
||||
|
||||
lpt_set_ext(0, !!(dev->regs[0x02] & 0x80));
|
||||
|
||||
lpt_set_epp(0, !!(dev->regs[0x04] & 0x01));
|
||||
lpt_set_ecp(0, !!(dev->regs[0x04] & 0x04));
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -386,7 +388,7 @@ pc87306_write(uint16_t port, uint8_t val, void *priv)
|
||||
if (valxor & 0x70) {
|
||||
lpt1_remove();
|
||||
if (!(val & 0x40))
|
||||
dev->regs[0x19] = 0xEF;
|
||||
dev->regs[0x19] = 0xef;
|
||||
if ((dev->regs[0x00] & 1) && !(dev->regs[0x02] & 1))
|
||||
lpt1_handler(dev);
|
||||
}
|
||||
|
||||
@@ -246,7 +246,7 @@ gus_midi_update_int_status(gus_t *gus)
|
||||
}
|
||||
|
||||
void
|
||||
writegus(uint16_t addr, uint8_t val, void *priv)
|
||||
gus_write(uint16_t addr, uint8_t val, void *priv)
|
||||
{
|
||||
gus_t *gus = (gus_t *) priv;
|
||||
int c;
|
||||
@@ -703,7 +703,7 @@ writegus(uint16_t addr, uint8_t val, void *priv)
|
||||
}
|
||||
|
||||
uint8_t
|
||||
readgus(uint16_t addr, void *priv)
|
||||
gus_read(uint16_t addr, void *priv)
|
||||
{
|
||||
gus_t *gus = (gus_t *) priv;
|
||||
uint8_t val = 0xff;
|
||||
@@ -1357,10 +1357,10 @@ gus_init(UNUSED(const device_t *info))
|
||||
|
||||
gus->base = device_get_config_hex16("base");
|
||||
|
||||
io_sethandler(gus->base, 0x0010, readgus, NULL, NULL, writegus, NULL, NULL, gus);
|
||||
io_sethandler(0x0100 + gus->base, 0x0010, readgus, NULL, NULL, writegus, NULL, NULL, gus);
|
||||
io_sethandler(0x0506 + gus->base, 0x0001, readgus, NULL, NULL, writegus, NULL, NULL, gus);
|
||||
io_sethandler(0x0388, 0x0002, readgus, NULL, NULL, writegus, NULL, NULL, gus);
|
||||
io_sethandler(gus->base, 0x0010, gus_read, NULL, NULL, gus_write, NULL, NULL, gus);
|
||||
io_sethandler(0x0100 + gus->base, 0x0010, gus_read, NULL, NULL, gus_write, NULL, NULL, gus);
|
||||
io_sethandler(0x0506 + gus->base, 0x0001, gus_read, NULL, NULL, gus_write, NULL, NULL, gus);
|
||||
io_sethandler(0x0388, 0x0002, gus_read, NULL, NULL, gus_write, NULL, NULL, gus);
|
||||
|
||||
if (gus->type == GUS_MAX) {
|
||||
ad1848_init(&gus->ad1848, AD1848_TYPE_CS4231);
|
||||
|
||||
@@ -1152,11 +1152,14 @@ sb_ct1745_mixer_write(uint16_t addr, uint8_t val, void *priv)
|
||||
else if ((val & 0x06) == 0x02)
|
||||
mpu401_change_addr(sb->mpu, 0);
|
||||
}
|
||||
|
||||
sb->gameport_addr = 0;
|
||||
gameport_remap(sb->gameport, 0);
|
||||
if (!(val & 0x01)) {
|
||||
sb->gameport_addr = 0x200;
|
||||
gameport_remap(sb->gameport, 0x200);
|
||||
if (sb->gameport != NULL) {
|
||||
gameport_remap(sb->gameport, 0);
|
||||
if (!(val & 0x01)) {
|
||||
sb->gameport_addr = 0x200;
|
||||
gameport_remap(sb->gameport, 0x200);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -1619,7 +1622,8 @@ ess_mixer_write(uint16_t addr, uint8_t val, void *priv)
|
||||
ess_fm_midi_write, NULL, NULL,
|
||||
ess);
|
||||
|
||||
gameport_remap(ess->gameport, !(mixer->regs[0x40] & 0x2) ? 0x00 : 0x200);
|
||||
if (ess->gameport != NULL)
|
||||
gameport_remap(ess->gameport, !(mixer->regs[0x40] & 0x2) ? 0x00 : 0x200);
|
||||
|
||||
if (ess->dsp.sb_subtype > SB_SUBTYPE_ESS_ES1688) {
|
||||
/* Not on ES1688. */
|
||||
@@ -2864,11 +2868,17 @@ sb_init(UNUSED(const device_t *info))
|
||||
sb_dsp_init(&sb->dsp, model, SB_SUBTYPE_DEFAULT, sb);
|
||||
sb_dsp_setaddr(&sb->dsp, addr);
|
||||
sb_dsp_setirq(&sb->dsp, device_get_config_int("irq"));
|
||||
sb_dsp_setdma8(&sb->dsp, device_get_config_int("dma"));
|
||||
sb_dsp_setdma8(&sb->dsp, 1); // SB 1, SB1.5 and 2 don't support DMA3
|
||||
|
||||
if (mixer_addr > 0x0000)
|
||||
sb_ct1335_mixer_reset(sb);
|
||||
|
||||
if (device_get_config_int("gameport")) {
|
||||
sb->gameport = gameport_add(&gameport_device);
|
||||
sb->gameport_addr = 0x200;
|
||||
gameport_remap(sb->gameport, sb->gameport_addr);
|
||||
}
|
||||
|
||||
/* DSP I/O handler is activated in sb_dsp_setaddr */
|
||||
if (sb->opl_enabled) {
|
||||
// TODO: See if this applies to the SB1.5 as well
|
||||
@@ -2948,6 +2958,12 @@ sb_mcv_init(UNUSED(const device_t *info))
|
||||
if (device_get_config_int("receive_input"))
|
||||
midi_in_handler(1, sb_dsp_input_msg, sb_dsp_input_sysex, &sb->dsp);
|
||||
|
||||
if (device_get_config_int("gameport")) {
|
||||
sb->gameport = gameport_add(&gameport_device);
|
||||
sb->gameport_addr = 0x200;
|
||||
gameport_remap(sb->gameport, sb->gameport_addr);
|
||||
}
|
||||
|
||||
return sb;
|
||||
}
|
||||
|
||||
@@ -3030,6 +3046,12 @@ sb_pro_v1_init(UNUSED(const device_t *info))
|
||||
if (device_get_config_int("receive_input"))
|
||||
midi_in_handler(1, sb_dsp_input_msg, sb_dsp_input_sysex, &sb->dsp);
|
||||
|
||||
if (device_get_config_int("gameport")) {
|
||||
sb->gameport = gameport_add(&gameport_device);
|
||||
sb->gameport_addr = 0x200;
|
||||
gameport_remap(sb->gameport, sb->gameport_addr);
|
||||
}
|
||||
|
||||
return sb;
|
||||
}
|
||||
|
||||
@@ -3084,6 +3106,12 @@ sb_pro_v2_init(UNUSED(const device_t *info))
|
||||
if (device_get_config_int("receive_input"))
|
||||
midi_in_handler(1, sb_dsp_input_msg, sb_dsp_input_sysex, &sb->dsp);
|
||||
|
||||
if (device_get_config_int("gameport")) {
|
||||
sb->gameport = gameport_add(&gameport_device);
|
||||
sb->gameport_addr = 0x200;
|
||||
gameport_remap(sb->gameport, sb->gameport_addr);
|
||||
}
|
||||
|
||||
return sb;
|
||||
}
|
||||
|
||||
@@ -3117,6 +3145,12 @@ sb_pro_mcv_init(UNUSED(const device_t *info))
|
||||
if (device_get_config_int("receive_input"))
|
||||
midi_in_handler(1, sb_dsp_input_msg, sb_dsp_input_sysex, &sb->dsp);
|
||||
|
||||
if (device_get_config_int("gameport")) {
|
||||
sb->gameport = gameport_add(&gameport_device);
|
||||
sb->gameport_addr = 0x200;
|
||||
gameport_remap(sb->gameport, sb->gameport_addr);
|
||||
}
|
||||
|
||||
return sb;
|
||||
}
|
||||
|
||||
@@ -3201,9 +3235,17 @@ sb_16_init(UNUSED(const device_t *info))
|
||||
if (device_get_config_int("receive_input"))
|
||||
midi_in_handler(1, sb_dsp_input_msg, sb_dsp_input_sysex, &sb->dsp);
|
||||
|
||||
sb->gameport = gameport_add(&gameport_pnp_device);
|
||||
sb->gameport_addr = 0x200;
|
||||
gameport_remap(sb->gameport, sb->gameport_addr);
|
||||
if (info->local == FM_YMF289B) {
|
||||
sb->gameport = gameport_add(&gameport_pnp_device);
|
||||
sb->gameport_addr = 0x200;
|
||||
gameport_remap(sb->gameport, sb->gameport_addr);
|
||||
} else {
|
||||
if (device_get_config_int("gameport")) {
|
||||
sb->gameport = gameport_add(&gameport_device);
|
||||
sb->gameport_addr = 0x200;
|
||||
gameport_remap(sb->gameport, sb->gameport_addr);
|
||||
}
|
||||
}
|
||||
|
||||
return sb;
|
||||
}
|
||||
@@ -3481,7 +3523,6 @@ sb_16_compat_init(const device_t *info)
|
||||
music_add_handler(sb_get_music_buffer_sb16_awe32, sb);
|
||||
|
||||
sb->mpu = (mpu_t *) calloc(1, sizeof(mpu_t));
|
||||
memset(sb->mpu, 0, sizeof(mpu_t));
|
||||
mpu401_init(sb->mpu, 0, 0, M_UART, (int) (intptr_t) info->local);
|
||||
sb_dsp_set_mpu(&sb->dsp, sb->mpu);
|
||||
|
||||
@@ -3549,8 +3590,6 @@ sb_awe32_init(UNUSED(const device_t *info))
|
||||
uint16_t emu_addr = device_get_config_hex16("emu_base");
|
||||
int onboard_ram = device_get_config_int("onboard_ram");
|
||||
|
||||
memset(sb, 0x00, sizeof(sb_t));
|
||||
|
||||
sb->opl_enabled = device_get_config_int("opl");
|
||||
if (sb->opl_enabled)
|
||||
fm_driver_get(FM_YMF262, &sb->opl);
|
||||
@@ -3594,7 +3633,6 @@ sb_awe32_init(UNUSED(const device_t *info))
|
||||
|
||||
if (mpu_addr) {
|
||||
sb->mpu = (mpu_t *) calloc(1, sizeof(mpu_t));
|
||||
memset(sb->mpu, 0, sizeof(mpu_t));
|
||||
mpu401_init(sb->mpu, device_get_config_hex16("base401"), 0, M_UART,
|
||||
device_get_config_int("receive_input401"));
|
||||
} else
|
||||
@@ -3606,9 +3644,11 @@ sb_awe32_init(UNUSED(const device_t *info))
|
||||
if (device_get_config_int("receive_input"))
|
||||
midi_in_handler(1, sb_dsp_input_msg, sb_dsp_input_sysex, &sb->dsp);
|
||||
|
||||
sb->gameport = gameport_add(&gameport_pnp_device);
|
||||
sb->gameport_addr = 0x200;
|
||||
gameport_remap(sb->gameport, sb->gameport_addr);
|
||||
if (device_get_config_int("gameport")) {
|
||||
sb->gameport = gameport_add(&gameport_device);
|
||||
sb->gameport_addr = 0x200;
|
||||
gameport_remap(sb->gameport, sb->gameport_addr);
|
||||
}
|
||||
|
||||
return sb;
|
||||
}
|
||||
@@ -3870,9 +3910,11 @@ ess_x688_init(UNUSED(const device_t *info))
|
||||
sb_dsp_set_mpu(&ess->dsp, ess->mpu);
|
||||
}
|
||||
|
||||
ess->gameport = gameport_add(&gameport_pnp_device);
|
||||
ess->gameport_addr = 0x200;
|
||||
gameport_remap(ess->gameport, ess->gameport_addr);
|
||||
if (device_get_config_int("gameport")) {
|
||||
ess->gameport = gameport_add(&gameport_device);
|
||||
ess->gameport_addr = 0x200;
|
||||
gameport_remap(ess->gameport, ess->gameport_addr);
|
||||
}
|
||||
|
||||
if (ide_base > 0x0000) {
|
||||
device_add(&ide_qua_pnp_device);
|
||||
@@ -4118,18 +4160,14 @@ static const device_config_t sb_config[] = {
|
||||
.bios = { { 0 } }
|
||||
},
|
||||
{
|
||||
.name = "dma",
|
||||
.description = "DMA",
|
||||
.type = CONFIG_SELECTION,
|
||||
.name = "gameport",
|
||||
.description = "Enable Game port",
|
||||
.type = CONFIG_BINARY,
|
||||
.default_string = NULL,
|
||||
.default_int = 1,
|
||||
.default_int = 0,
|
||||
.file_filter = NULL,
|
||||
.spinner = { 0 },
|
||||
.selection = {
|
||||
{ .description = "DMA 1", .value = 1 },
|
||||
{ .description = "DMA 3", .value = 3 },
|
||||
{ .description = "" }
|
||||
},
|
||||
.selection = { { 0 } },
|
||||
.bios = { { 0 } }
|
||||
},
|
||||
{
|
||||
@@ -4153,7 +4191,7 @@ static const device_config_t sb_config[] = {
|
||||
.spinner = { 0 },
|
||||
.selection = { { 0 } },
|
||||
.bios = { { 0 } }
|
||||
},
|
||||
},
|
||||
{ .name = "", .description = "", .type = CONFIG_END }
|
||||
};
|
||||
|
||||
@@ -4178,8 +4216,8 @@ static const device_config_t sb15_config[] = {
|
||||
.bios = { { 0 } }
|
||||
},
|
||||
{
|
||||
.name = "irq",
|
||||
.description = "IRQ",
|
||||
.name = "irq",
|
||||
.description = "IRQ",
|
||||
.type = CONFIG_SELECTION,
|
||||
.default_string = NULL,
|
||||
.default_int = 7,
|
||||
@@ -4195,18 +4233,14 @@ static const device_config_t sb15_config[] = {
|
||||
.bios = { { 0 } }
|
||||
},
|
||||
{
|
||||
.name = "dma",
|
||||
.description = "DMA",
|
||||
.type = CONFIG_SELECTION,
|
||||
.name = "gameport",
|
||||
.description = "Enable Game port",
|
||||
.type = CONFIG_BINARY,
|
||||
.default_string = NULL,
|
||||
.default_int = 1,
|
||||
.default_int = 0,
|
||||
.file_filter = NULL,
|
||||
.spinner = { 0 },
|
||||
.selection = {
|
||||
{ .description = "DMA 1", .value = 1 },
|
||||
{ .description = "DMA 3", .value = 3 },
|
||||
{ .description = "" }
|
||||
},
|
||||
.selection = { { 0 } },
|
||||
.bios = { { 0 } }
|
||||
},
|
||||
{
|
||||
@@ -4247,8 +4281,8 @@ static const device_config_t sb15_config[] = {
|
||||
|
||||
static const device_config_t sb2_config[] = {
|
||||
{
|
||||
.name = "base",
|
||||
.description = "Address",
|
||||
.name = "base",
|
||||
.description = "Address",
|
||||
.type = CONFIG_HEX16,
|
||||
.default_string = NULL,
|
||||
.default_int = 0x220,
|
||||
@@ -4295,18 +4329,14 @@ static const device_config_t sb2_config[] = {
|
||||
.bios = { { 0 } }
|
||||
},
|
||||
{
|
||||
.name = "dma",
|
||||
.description = "DMA",
|
||||
.type = CONFIG_SELECTION,
|
||||
.default_string = "",
|
||||
.default_int = 1,
|
||||
.name = "gameport",
|
||||
.description = "Enable Game port",
|
||||
.type = CONFIG_BINARY,
|
||||
.default_string = NULL,
|
||||
.default_int = 0,
|
||||
.file_filter = NULL,
|
||||
.spinner = { 0 },
|
||||
.selection = {
|
||||
{ .description = "DMA 1", .value = 1 },
|
||||
{ .description = "DMA 3", .value = 3 },
|
||||
{ .description = "" }
|
||||
},
|
||||
.selection = { { 0 } },
|
||||
.bios = { { 0 } }
|
||||
},
|
||||
{
|
||||
@@ -4367,7 +4397,7 @@ static const device_config_t sb_mcv_config[] = {
|
||||
.name = "dma",
|
||||
.description = "DMA",
|
||||
.type = CONFIG_SELECTION,
|
||||
.default_string = "",
|
||||
.default_string = NULL,
|
||||
.default_int = 1,
|
||||
.file_filter = NULL,
|
||||
.spinner = { 0 },
|
||||
@@ -4378,6 +4408,17 @@ static const device_config_t sb_mcv_config[] = {
|
||||
},
|
||||
.bios = { { 0 } }
|
||||
},
|
||||
{
|
||||
.name = "gameport",
|
||||
.description = "Enable Game port",
|
||||
.type = CONFIG_BINARY,
|
||||
.default_string = NULL,
|
||||
.default_int = 0,
|
||||
.file_filter = NULL,
|
||||
.spinner = { 0 },
|
||||
.selection = { { 0 } },
|
||||
.bios = { { 0 } }
|
||||
},
|
||||
{
|
||||
.name = "opl",
|
||||
.description = "Enable OPL",
|
||||
@@ -4452,6 +4493,17 @@ static const device_config_t sb_pro_config[] = {
|
||||
},
|
||||
.bios = { { 0 } }
|
||||
},
|
||||
{
|
||||
.name = "gameport",
|
||||
.description = "Enable Game port",
|
||||
.type = CONFIG_BINARY,
|
||||
.default_string = NULL,
|
||||
.default_int = 0,
|
||||
.file_filter = NULL,
|
||||
.spinner = { 0 },
|
||||
.selection = { { 0 } },
|
||||
.bios = { { 0 } }
|
||||
},
|
||||
{
|
||||
.name = "opl",
|
||||
.description = "Enable OPL",
|
||||
@@ -4478,6 +4530,17 @@ static const device_config_t sb_pro_config[] = {
|
||||
};
|
||||
|
||||
static const device_config_t sb_pro_mcv_config[] = {
|
||||
{
|
||||
.name = "gameport",
|
||||
.description = "Enable Game port",
|
||||
.type = CONFIG_BINARY,
|
||||
.default_string = NULL,
|
||||
.default_int = 0,
|
||||
.file_filter = NULL,
|
||||
.spinner = { 0 },
|
||||
.selection = { { 0 } },
|
||||
.bios = { { 0 } }
|
||||
},
|
||||
{
|
||||
.name = "receive_input",
|
||||
.description = "Receive MIDI input",
|
||||
@@ -4575,6 +4638,17 @@ static const device_config_t sb_16_config[] = {
|
||||
},
|
||||
.bios = { { 0 } }
|
||||
},
|
||||
{
|
||||
.name = "gameport",
|
||||
.description = "Enable Game port",
|
||||
.type = CONFIG_BINARY,
|
||||
.default_string = NULL,
|
||||
.default_int = 0,
|
||||
.file_filter = NULL,
|
||||
.spinner = { 0 },
|
||||
.selection = { { 0 } },
|
||||
.bios = { { 0 } }
|
||||
},
|
||||
{
|
||||
.name = "opl",
|
||||
.description = "Enable OPL",
|
||||
@@ -4857,6 +4931,17 @@ static const device_config_t sb_awe32_config[] = {
|
||||
},
|
||||
.bios = { { 0 } }
|
||||
},
|
||||
{
|
||||
.name = "gameport",
|
||||
.description = "Enable Game port",
|
||||
.type = CONFIG_BINARY,
|
||||
.default_string = NULL,
|
||||
.default_int = 0,
|
||||
.file_filter = NULL,
|
||||
.spinner = { 0 },
|
||||
.selection = { { 0 } },
|
||||
.bios = { { 0 } }
|
||||
},
|
||||
{
|
||||
.name = "opl",
|
||||
.description = "Enable OPL",
|
||||
@@ -5186,6 +5271,17 @@ static const device_config_t ess_688_config[] = {
|
||||
},
|
||||
.bios = { { 0 } }
|
||||
},
|
||||
{
|
||||
.name = "gameport",
|
||||
.description = "Enable Game port",
|
||||
.type = CONFIG_BINARY,
|
||||
.default_string = NULL,
|
||||
.default_int = 0,
|
||||
.file_filter = NULL,
|
||||
.spinner = { 0 },
|
||||
.selection = { { 0 } },
|
||||
.bios = { { 0 } }
|
||||
},
|
||||
{
|
||||
.name = "ide_ctrl",
|
||||
.description = "IDE Controller",
|
||||
@@ -5269,6 +5365,17 @@ static const device_config_t ess_1688_config[] = {
|
||||
},
|
||||
.bios = { { 0 } }
|
||||
},
|
||||
{
|
||||
.name = "gameport",
|
||||
.description = "Enable Game port",
|
||||
.type = CONFIG_BINARY,
|
||||
.default_string = NULL,
|
||||
.default_int = 0,
|
||||
.file_filter = NULL,
|
||||
.spinner = { 0 },
|
||||
.selection = { { 0 } },
|
||||
.bios = { { 0 } }
|
||||
},
|
||||
{
|
||||
.name = "ide_ctrl",
|
||||
.description = "IDE Controller",
|
||||
@@ -5343,7 +5450,7 @@ static const device_config_t ess_1688_pnp_config[] = {
|
||||
.name = "control_pc_speaker",
|
||||
.description = "Control PC speaker",
|
||||
.type = CONFIG_BINARY,
|
||||
.default_string = "",
|
||||
.default_string = NULL,
|
||||
.default_int = 0,
|
||||
.file_filter = NULL,
|
||||
.spinner = { 0 },
|
||||
@@ -5354,7 +5461,7 @@ static const device_config_t ess_1688_pnp_config[] = {
|
||||
.name = "receive_input",
|
||||
.description = "Receive MIDI input",
|
||||
.type = CONFIG_BINARY,
|
||||
.default_string = "",
|
||||
.default_string = NULL,
|
||||
.default_int = 1,
|
||||
.file_filter = NULL,
|
||||
.spinner = { 0 },
|
||||
@@ -5365,7 +5472,7 @@ static const device_config_t ess_1688_pnp_config[] = {
|
||||
.name = "receive_input401",
|
||||
.description = "Receive MIDI input (MPU-401)",
|
||||
.type = CONFIG_BINARY,
|
||||
.default_string = "",
|
||||
.default_string = NULL,
|
||||
.default_int = 0,
|
||||
.file_filter = NULL,
|
||||
.spinner = { 0 },
|
||||
|
||||
@@ -1582,19 +1582,19 @@ sb_exec_command(sb_dsp_t *dsp)
|
||||
timer_set_delay_u64(&dsp->output_timer, (uint64_t) trunc(dsp->sblatcho));
|
||||
break;
|
||||
case 0x90: /* High speed 8-bit autoinit DMA output */
|
||||
if ((dsp->sb_type >= SB_DSP_201) && (dsp->sb_type < SB16_DSP_404)) // TODO docs need validated
|
||||
if (dsp->sb_type >= SB_DSP_201) // TODO docs need validated
|
||||
sb_start_dma(dsp, 1, 1, 0, dsp->sb_8_autolen);
|
||||
break;
|
||||
case 0x91: /* High speed 8-bit single cycle DMA output */
|
||||
if ((dsp->sb_type >= SB_DSP_201) && (dsp->sb_type < SB16_DSP_404)) // TODO docs need validated
|
||||
if (dsp->sb_type >= SB_DSP_201) // TODO docs need validated
|
||||
sb_start_dma(dsp, 1, 0, 0, dsp->sb_8_autolen);
|
||||
break;
|
||||
case 0x98: /* High speed 8-bit autoinit DMA input */
|
||||
if ((dsp->sb_type >= SB_DSP_201) && (dsp->sb_type < SB16_DSP_404)) // TODO docs need validated
|
||||
if (dsp->sb_type >= SB_DSP_201) // TODO docs need validated
|
||||
sb_start_dma_i(dsp, 1, 1, 0, dsp->sb_8_autolen);
|
||||
break;
|
||||
case 0x99: /* High speed 8-bit single cycle DMA input */
|
||||
if ((dsp->sb_type >= SB_DSP_201) && (dsp->sb_type < SB16_DSP_404)) // TODO docs need validated
|
||||
if (dsp->sb_type >= SB_DSP_201) // TODO docs need validated
|
||||
sb_start_dma_i(dsp, 1, 0, 0, dsp->sb_8_autolen);
|
||||
break;
|
||||
case 0xA0: /* Set input mode to mono */
|
||||
|
||||
@@ -56,7 +56,7 @@ speaker_update(void)
|
||||
int32_t val;
|
||||
double amplitude;
|
||||
|
||||
amplitude = ((speaker_count / 64.0) * 10240.0) - 5120.0;
|
||||
amplitude = ((speaker_count / 256.0) * 10240.0) - 5120.0;
|
||||
|
||||
if (amplitude > 5120.0)
|
||||
amplitude = 5120.0;
|
||||
|
||||
@@ -157,14 +157,13 @@ static const device_config_t ssi2001_config[] = {
|
||||
.description = "Enable Game port",
|
||||
.type = CONFIG_BINARY,
|
||||
.default_string = NULL,
|
||||
.default_int = 1,
|
||||
.default_int = 0,
|
||||
.file_filter = NULL,
|
||||
.spinner = { 0 },
|
||||
.selection = { { 0 } },
|
||||
.bios = { { 0 } }
|
||||
},
|
||||
|
||||
{
|
||||
{
|
||||
.name = "sid_config",
|
||||
.description = "SID Model",
|
||||
.type = CONFIG_HEX16,
|
||||
@@ -201,7 +200,7 @@ static const device_config_t entertainer_config[] = {
|
||||
.description = "Enable Game port",
|
||||
.type = CONFIG_BINARY,
|
||||
.default_string = NULL,
|
||||
.default_int = 1,
|
||||
.default_int = 0,
|
||||
.file_filter = NULL,
|
||||
.spinner = { 0 },
|
||||
.selection = { { 0 } },
|
||||
|
||||
@@ -52,7 +52,7 @@ namespace ymfm
|
||||
//
|
||||
// System-wide registers:
|
||||
// 01 xxxxxxxx Test register
|
||||
// --x----- Enable OPL compatibility mode [OPL2 only] (1 = enable)
|
||||
// --x----- Enable OPL compatibility mode [OPL2 only] (0 = enable)
|
||||
// 02 xxxxxxxx Timer A value (4 * OPN)
|
||||
// 03 xxxxxxxx Timer B value
|
||||
// 04 x------- RST
|
||||
@@ -243,7 +243,7 @@ public:
|
||||
uint32_t op_decay_rate(uint32_t opoffs) const { return byte(0x60, 0, 4, opoffs); }
|
||||
uint32_t op_sustain_level(uint32_t opoffs) const { return byte(0x80, 4, 4, opoffs); }
|
||||
uint32_t op_release_rate(uint32_t opoffs) const { return byte(0x80, 0, 4, opoffs); }
|
||||
uint32_t op_waveform(uint32_t opoffs) const { return IsOpl2Plus ? byte(0xe0, 0, newflag() ? 3 : 2, opoffs) : 0; }
|
||||
uint32_t op_waveform(uint32_t opoffs) const { return waveform_enable() ? byte(0xe0, 0, newflag() ? 3 : 2, opoffs) : 0; }
|
||||
|
||||
protected:
|
||||
// return a bitfield extracted from a byte
|
||||
|
||||
@@ -155,14 +155,13 @@ bool opn_registers_base<IsOpnA>::write(uint16_t index, uint8_t data, uint32_t &c
|
||||
|
||||
// writes to the upper half just latch (only low 6 bits matter)
|
||||
if (bitfield(index, 2))
|
||||
m_regdata[latchindex] = data | 0x80;
|
||||
m_regdata[latchindex] = data & 0x3f;
|
||||
|
||||
// writes to the lower half only commit if the latch is there
|
||||
else if (bitfield(m_regdata[latchindex], 7))
|
||||
// writes to the lower half also apply said latch
|
||||
else
|
||||
{
|
||||
m_regdata[index] = data;
|
||||
m_regdata[index | 4] = m_regdata[latchindex] & 0x3f;
|
||||
m_regdata[latchindex] = 0;
|
||||
m_regdata[index | 4] = m_regdata[latchindex];
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
376
src/unix/gamemode/gamemode_client.h
Normal file
376
src/unix/gamemode/gamemode_client.h
Normal file
@@ -0,0 +1,376 @@
|
||||
/*
|
||||
|
||||
Copyright (c) 2017-2025, Feral Interactive and the GameMode contributors
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
* Neither the name of Feral Interactive nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
*/
|
||||
#ifndef CLIENT_GAMEMODE_H
|
||||
#define CLIENT_GAMEMODE_H
|
||||
/*
|
||||
* GameMode supports the following client functions
|
||||
* Requests are refcounted in the daemon
|
||||
*
|
||||
* int gamemode_request_start() - Request gamemode starts
|
||||
* 0 if the request was sent successfully
|
||||
* -1 if the request failed
|
||||
*
|
||||
* int gamemode_request_end() - Request gamemode ends
|
||||
* 0 if the request was sent successfully
|
||||
* -1 if the request failed
|
||||
*
|
||||
* GAMEMODE_AUTO can be defined to make the above two functions apply during static init and
|
||||
* destruction, as appropriate. In this configuration, errors will be printed to stderr
|
||||
*
|
||||
* int gamemode_query_status() - Query the current status of gamemode
|
||||
* 0 if gamemode is inactive
|
||||
* 1 if gamemode is active
|
||||
* 2 if gamemode is active and this client is registered
|
||||
* -1 if the query failed
|
||||
*
|
||||
* int gamemode_request_start_for(pid_t pid) - Request gamemode starts for another process
|
||||
* 0 if the request was sent successfully
|
||||
* -1 if the request failed
|
||||
* -2 if the request was rejected
|
||||
*
|
||||
* int gamemode_request_end_for(pid_t pid) - Request gamemode ends for another process
|
||||
* 0 if the request was sent successfully
|
||||
* -1 if the request failed
|
||||
* -2 if the request was rejected
|
||||
*
|
||||
* int gamemode_query_status_for(pid_t pid) - Query status of gamemode for another process
|
||||
* 0 if gamemode is inactive
|
||||
* 1 if gamemode is active
|
||||
* 2 if gamemode is active and this client is registered
|
||||
* -1 if the query failed
|
||||
*
|
||||
* const char* gamemode_error_string() - Get an error string
|
||||
* returns a string describing any of the above errors
|
||||
*
|
||||
* Note: All the above requests can be blocking - dbus requests can and will block while the daemon
|
||||
* handles the request. It is not recommended to make these calls in performance critical code
|
||||
*/
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <dlfcn.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
static char internal_gamemode_client_error_string[512] = { 0 };
|
||||
|
||||
/**
|
||||
* Load libgamemode dynamically to dislodge us from most dependencies.
|
||||
* This allows clients to link and/or use this regardless of runtime.
|
||||
* See SDL2 for an example of the reasoning behind this in terms of
|
||||
* dynamic versioning as well.
|
||||
*/
|
||||
static volatile int internal_libgamemode_loaded = 1;
|
||||
|
||||
/* Typedefs for the functions to load */
|
||||
typedef int (*api_call_return_int)(void);
|
||||
typedef const char *(*api_call_return_cstring)(void);
|
||||
typedef int (*api_call_pid_return_int)(pid_t);
|
||||
|
||||
/* Storage for functors */
|
||||
static api_call_return_int REAL_internal_gamemode_request_start = NULL;
|
||||
static api_call_return_int REAL_internal_gamemode_request_end = NULL;
|
||||
static api_call_return_int REAL_internal_gamemode_query_status = NULL;
|
||||
static api_call_return_cstring REAL_internal_gamemode_error_string = NULL;
|
||||
static api_call_pid_return_int REAL_internal_gamemode_request_start_for = NULL;
|
||||
static api_call_pid_return_int REAL_internal_gamemode_request_end_for = NULL;
|
||||
static api_call_pid_return_int REAL_internal_gamemode_query_status_for = NULL;
|
||||
|
||||
/**
|
||||
* Internal helper to perform the symbol binding safely.
|
||||
*
|
||||
* Returns 0 on success and -1 on failure
|
||||
*/
|
||||
__attribute__((always_inline)) static inline int internal_bind_libgamemode_symbol(
|
||||
void *handle, const char *name, void **out_func, size_t func_size, bool required)
|
||||
{
|
||||
void *symbol_lookup = NULL;
|
||||
char *dl_error = NULL;
|
||||
|
||||
/* Safely look up the symbol */
|
||||
symbol_lookup = dlsym(handle, name);
|
||||
dl_error = dlerror();
|
||||
if (required && (dl_error || !symbol_lookup)) {
|
||||
snprintf(internal_gamemode_client_error_string,
|
||||
sizeof(internal_gamemode_client_error_string),
|
||||
"dlsym failed - %s",
|
||||
dl_error);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Have the symbol correctly, copy it to make it usable */
|
||||
memcpy(out_func, &symbol_lookup, func_size);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads libgamemode and needed functions
|
||||
*
|
||||
* Returns 0 on success and -1 on failure
|
||||
*/
|
||||
__attribute__((always_inline)) static inline int internal_load_libgamemode(void)
|
||||
{
|
||||
/* We start at 1, 0 is a success and -1 is a fail */
|
||||
if (internal_libgamemode_loaded != 1) {
|
||||
return internal_libgamemode_loaded;
|
||||
}
|
||||
|
||||
/* Anonymous struct type to define our bindings */
|
||||
struct binding {
|
||||
const char *name;
|
||||
void **functor;
|
||||
size_t func_size;
|
||||
bool required;
|
||||
} bindings[] = {
|
||||
{ "real_gamemode_request_start",
|
||||
(void **)&REAL_internal_gamemode_request_start,
|
||||
sizeof(REAL_internal_gamemode_request_start),
|
||||
true },
|
||||
{ "real_gamemode_request_end",
|
||||
(void **)&REAL_internal_gamemode_request_end,
|
||||
sizeof(REAL_internal_gamemode_request_end),
|
||||
true },
|
||||
{ "real_gamemode_query_status",
|
||||
(void **)&REAL_internal_gamemode_query_status,
|
||||
sizeof(REAL_internal_gamemode_query_status),
|
||||
false },
|
||||
{ "real_gamemode_error_string",
|
||||
(void **)&REAL_internal_gamemode_error_string,
|
||||
sizeof(REAL_internal_gamemode_error_string),
|
||||
true },
|
||||
{ "real_gamemode_request_start_for",
|
||||
(void **)&REAL_internal_gamemode_request_start_for,
|
||||
sizeof(REAL_internal_gamemode_request_start_for),
|
||||
false },
|
||||
{ "real_gamemode_request_end_for",
|
||||
(void **)&REAL_internal_gamemode_request_end_for,
|
||||
sizeof(REAL_internal_gamemode_request_end_for),
|
||||
false },
|
||||
{ "real_gamemode_query_status_for",
|
||||
(void **)&REAL_internal_gamemode_query_status_for,
|
||||
sizeof(REAL_internal_gamemode_query_status_for),
|
||||
false },
|
||||
};
|
||||
|
||||
void *libgamemode = NULL;
|
||||
|
||||
/* Try and load libgamemode */
|
||||
libgamemode = dlopen("libgamemode.so.0", RTLD_NOW);
|
||||
if (!libgamemode) {
|
||||
/* Attempt to load unversioned library for compatibility with older
|
||||
* versions (as of writing, there are no ABI changes between the two -
|
||||
* this may need to change if ever ABI-breaking changes are made) */
|
||||
libgamemode = dlopen("libgamemode.so", RTLD_NOW);
|
||||
if (!libgamemode) {
|
||||
snprintf(internal_gamemode_client_error_string,
|
||||
sizeof(internal_gamemode_client_error_string),
|
||||
"dlopen failed - %s",
|
||||
dlerror());
|
||||
internal_libgamemode_loaded = -1;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/* Attempt to bind all symbols */
|
||||
for (size_t i = 0; i < sizeof(bindings) / sizeof(bindings[0]); i++) {
|
||||
struct binding *binder = &bindings[i];
|
||||
|
||||
if (internal_bind_libgamemode_symbol(libgamemode,
|
||||
binder->name,
|
||||
binder->functor,
|
||||
binder->func_size,
|
||||
binder->required)) {
|
||||
internal_libgamemode_loaded = -1;
|
||||
return -1;
|
||||
};
|
||||
}
|
||||
|
||||
/* Success */
|
||||
internal_libgamemode_loaded = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Redirect to the real libgamemode
|
||||
*/
|
||||
__attribute__((always_inline)) static inline const char *gamemode_error_string(void)
|
||||
{
|
||||
/* If we fail to load the system gamemode, or we have an error string already, return our error
|
||||
* string instead of diverting to the system version */
|
||||
if (internal_load_libgamemode() < 0 || internal_gamemode_client_error_string[0] != '\0') {
|
||||
return internal_gamemode_client_error_string;
|
||||
}
|
||||
|
||||
/* Assert for static analyser that the function is not NULL */
|
||||
assert(REAL_internal_gamemode_error_string != NULL);
|
||||
|
||||
return REAL_internal_gamemode_error_string();
|
||||
}
|
||||
|
||||
/**
|
||||
* Redirect to the real libgamemode
|
||||
* Allow automatically requesting game mode
|
||||
* Also prints errors as they happen.
|
||||
*/
|
||||
#ifdef GAMEMODE_AUTO
|
||||
__attribute__((constructor))
|
||||
#else
|
||||
__attribute__((always_inline)) static inline
|
||||
#endif
|
||||
int gamemode_request_start(void)
|
||||
{
|
||||
/* Need to load gamemode */
|
||||
if (internal_load_libgamemode() < 0) {
|
||||
#ifdef GAMEMODE_AUTO
|
||||
fprintf(stderr, "gamemodeauto: %s\n", gamemode_error_string());
|
||||
#endif
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Assert for static analyser that the function is not NULL */
|
||||
assert(REAL_internal_gamemode_request_start != NULL);
|
||||
|
||||
if (REAL_internal_gamemode_request_start() < 0) {
|
||||
#ifdef GAMEMODE_AUTO
|
||||
fprintf(stderr, "gamemodeauto: %s\n", gamemode_error_string());
|
||||
#endif
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Redirect to the real libgamemode */
|
||||
#ifdef GAMEMODE_AUTO
|
||||
__attribute__((destructor))
|
||||
#else
|
||||
__attribute__((always_inline)) static inline
|
||||
#endif
|
||||
int gamemode_request_end(void)
|
||||
{
|
||||
/* Need to load gamemode */
|
||||
if (internal_load_libgamemode() < 0) {
|
||||
#ifdef GAMEMODE_AUTO
|
||||
fprintf(stderr, "gamemodeauto: %s\n", gamemode_error_string());
|
||||
#endif
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Assert for static analyser that the function is not NULL */
|
||||
assert(REAL_internal_gamemode_request_end != NULL);
|
||||
|
||||
if (REAL_internal_gamemode_request_end() < 0) {
|
||||
#ifdef GAMEMODE_AUTO
|
||||
fprintf(stderr, "gamemodeauto: %s\n", gamemode_error_string());
|
||||
#endif
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Redirect to the real libgamemode */
|
||||
__attribute__((always_inline)) static inline int gamemode_query_status(void)
|
||||
{
|
||||
/* Need to load gamemode */
|
||||
if (internal_load_libgamemode() < 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (REAL_internal_gamemode_query_status == NULL) {
|
||||
snprintf(internal_gamemode_client_error_string,
|
||||
sizeof(internal_gamemode_client_error_string),
|
||||
"gamemode_query_status missing (older host?)");
|
||||
return -1;
|
||||
}
|
||||
|
||||
return REAL_internal_gamemode_query_status();
|
||||
}
|
||||
|
||||
/* Redirect to the real libgamemode */
|
||||
__attribute__((always_inline)) static inline int gamemode_request_start_for(pid_t pid)
|
||||
{
|
||||
/* Need to load gamemode */
|
||||
if (internal_load_libgamemode() < 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (REAL_internal_gamemode_request_start_for == NULL) {
|
||||
snprintf(internal_gamemode_client_error_string,
|
||||
sizeof(internal_gamemode_client_error_string),
|
||||
"gamemode_request_start_for missing (older host?)");
|
||||
return -1;
|
||||
}
|
||||
|
||||
return REAL_internal_gamemode_request_start_for(pid);
|
||||
}
|
||||
|
||||
/* Redirect to the real libgamemode */
|
||||
__attribute__((always_inline)) static inline int gamemode_request_end_for(pid_t pid)
|
||||
{
|
||||
/* Need to load gamemode */
|
||||
if (internal_load_libgamemode() < 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (REAL_internal_gamemode_request_end_for == NULL) {
|
||||
snprintf(internal_gamemode_client_error_string,
|
||||
sizeof(internal_gamemode_client_error_string),
|
||||
"gamemode_request_end_for missing (older host?)");
|
||||
return -1;
|
||||
}
|
||||
|
||||
return REAL_internal_gamemode_request_end_for(pid);
|
||||
}
|
||||
|
||||
/* Redirect to the real libgamemode */
|
||||
__attribute__((always_inline)) static inline int gamemode_query_status_for(pid_t pid)
|
||||
{
|
||||
/* Need to load gamemode */
|
||||
if (internal_load_libgamemode() < 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (REAL_internal_gamemode_query_status_for == NULL) {
|
||||
snprintf(internal_gamemode_client_error_string,
|
||||
sizeof(internal_gamemode_client_error_string),
|
||||
"gamemode_query_status_for missing (older host?)");
|
||||
return -1;
|
||||
}
|
||||
|
||||
return REAL_internal_gamemode_query_status_for(pid);
|
||||
}
|
||||
|
||||
#endif // CLIENT_GAMEMODE_H
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user