Cleanups and version bump.
This commit is contained in:
parent
f4523617ed
commit
d5ff8c002a
@ -394,7 +394,7 @@ static void drcbec_generate(drcbe_state *drcbe, drcuml_block *block, const drcum
|
||||
modified_inst.param[1].type = DRCUML_PTYPE_IMMEDIATE;
|
||||
inst = &modified_inst;
|
||||
}
|
||||
|
||||
|
||||
/* determine the operand size for each operand; mostly this is just the instruction size */
|
||||
for (pnum = 0; pnum < inst->numparams; pnum++)
|
||||
psize[pnum] = inst->size;
|
||||
|
@ -365,10 +365,10 @@ static UINT8 condition_map[DRCUML_COND_MAX - DRCUML_COND_Z] =
|
||||
/* rounding mode mapping table */
|
||||
static const UINT8 fprnd_map[4] =
|
||||
{
|
||||
FPRND_CHOP, /* DRCUML_FMOD_TRUNC, truncate */
|
||||
FPRND_NEAR, /* DRCUML_FMOD_ROUND, round */
|
||||
FPRND_UP, /* DRCUML_FMOD_CEIL, round up */
|
||||
FPRND_DOWN /* DRCUML_FMOD_FLOOR round down */
|
||||
FPRND_CHOP, /* DRCUML_FMOD_TRUNC, truncate */
|
||||
FPRND_NEAR, /* DRCUML_FMOD_ROUND, round */
|
||||
FPRND_UP, /* DRCUML_FMOD_CEIL, round up */
|
||||
FPRND_DOWN /* DRCUML_FMOD_FLOOR round down */
|
||||
};
|
||||
|
||||
|
||||
@ -867,7 +867,7 @@ static void drcbex64_reset(drcbe_state *drcbe)
|
||||
emit_mov_r32_r32(dst, REG_EAX, REG_ECX); // mov eax,ecx
|
||||
emit_pop_r64(dst, REG_RBX); // pop rbx
|
||||
emit_ret(dst); // ret
|
||||
|
||||
|
||||
/* call it to determine if we have SSE4.1 support */
|
||||
drcbe->sse41 = (((*cpuid_ecx_stub)() & 0x80000) != 0);
|
||||
|
||||
@ -3566,12 +3566,12 @@ static x86code *op_save(drcbe_state *drcbe, x86code *dst, const drcuml_instructi
|
||||
|
||||
/* copy live state to the destination */
|
||||
emit_mov_r64_imm(&dst, REG_RCX, dstp.value); // mov rcx,dstp
|
||||
|
||||
|
||||
/* copy flags */
|
||||
emit_pushf(&dst); // pushf
|
||||
emit_pop_r64(&dst, REG_RAX); // pop rax
|
||||
emit_and_r32_imm(&dst, REG_EAX, 0x8c5); // and eax,0x8c5
|
||||
emit_mov_r8_m8(&dst, REG_AL, MBISD(REG_RBP, REG_RAX, 1, offset_from_rbp(drcbe, (FPTR)&drcbe->flagsmap[0])));
|
||||
emit_mov_r8_m8(&dst, REG_AL, MBISD(REG_RBP, REG_RAX, 1, offset_from_rbp(drcbe, (FPTR)&drcbe->flagsmap[0])));
|
||||
// mov al,[flags_map]
|
||||
emit_mov_m8_r8(&dst, MBD(REG_RCX, offsetof(drcuml_machine_state, flags)), REG_AL); // mov state->flags,al
|
||||
|
||||
@ -7040,7 +7040,7 @@ static x86code *op_ftoi4x(drcbe_state *drcbe, x86code *dst, const drcuml_instruc
|
||||
|
||||
/* pick a target register for the general case */
|
||||
dstreg = param_select_register(REG_EAX, &dstp, NULL);
|
||||
|
||||
|
||||
/* non-SSE4.1 case */
|
||||
if (!drcbe->sse41 || inst->size == 8)
|
||||
{
|
||||
@ -7070,7 +7070,7 @@ static x86code *op_ftoi4x(drcbe_state *drcbe, x86code *dst, const drcuml_instruc
|
||||
emit_mov_p32_r32(drcbe, &dst, &dstp, dstreg); // mov dstp,dstreg
|
||||
emit_ldmxcsr_m32(&dst, MABS(drcbe, &drcbe->ssemodesave)); // ldmxcsr [ssemodesave]
|
||||
}
|
||||
|
||||
|
||||
/* SSE4.1 case */
|
||||
else
|
||||
{
|
||||
@ -7080,7 +7080,7 @@ static x86code *op_ftoi4x(drcbe_state *drcbe, x86code *dst, const drcuml_instruc
|
||||
// roundss xmm0,[srcp],mode
|
||||
else if (srcp.type == DRCUML_PTYPE_FLOAT_REGISTER)
|
||||
emit_roundss_r128_r128_imm(&dst, REG_XMM0, srcp.value, fprnd_map[mode]); // roundss xmm0,srcp,mode
|
||||
|
||||
|
||||
/* store to the destination */
|
||||
if (dstp.type == DRCUML_PTYPE_MEMORY)
|
||||
emit_movd_m32_r128(&dst, MABS(drcbe, dstp.value), REG_XMM0); // movd [dstp],xmm0
|
||||
@ -7211,7 +7211,7 @@ static x86code *op_ftoi8x(drcbe_state *drcbe, x86code *dst, const drcuml_instruc
|
||||
|
||||
/* pick a target register for the general case */
|
||||
dstreg = param_select_register(REG_EAX, &dstp, NULL);
|
||||
|
||||
|
||||
/* non-SSE4.1 case */
|
||||
if (!drcbe->sse41 || inst->size == 4)
|
||||
{
|
||||
@ -7241,7 +7241,7 @@ static x86code *op_ftoi8x(drcbe_state *drcbe, x86code *dst, const drcuml_instruc
|
||||
emit_mov_p64_r64(drcbe, &dst, &dstp, dstreg); // mov dstp,dstreg
|
||||
emit_ldmxcsr_m32(&dst, MABS(drcbe, &drcbe->ssemodesave)); // ldmxcsr [ssemodesave]
|
||||
}
|
||||
|
||||
|
||||
/* SSE4.1 case */
|
||||
else
|
||||
{
|
||||
@ -7251,7 +7251,7 @@ static x86code *op_ftoi8x(drcbe_state *drcbe, x86code *dst, const drcuml_instruc
|
||||
// roundsd xmm0,[srcp],mode
|
||||
else if (srcp.type == DRCUML_PTYPE_FLOAT_REGISTER)
|
||||
emit_roundsd_r128_r128_imm(&dst, REG_XMM0, srcp.value, fprnd_map[mode]); // roundsd xmm0,srcp,mode
|
||||
|
||||
|
||||
/* store to the destination */
|
||||
if (dstp.type == DRCUML_PTYPE_MEMORY)
|
||||
emit_movq_m64_r128(&dst, MABS(drcbe, dstp.value), REG_XMM0); // movq [dstp],xmm0
|
||||
|
@ -454,7 +454,7 @@ static const opcode_table_entry opcode_table_source[] =
|
||||
{ DRCUML_OP_TEST, op_test }, /* TEST src1,src2[,f] */
|
||||
{ DRCUML_OP_OR, op_or }, /* OR dst,src1,src2[,f] */
|
||||
{ DRCUML_OP_XOR, op_xor }, /* XOR dst,src1,src2[,f] */
|
||||
{ DRCUML_OP_LZCNT, op_lzcnt }, /* LZCNT dst,src */
|
||||
{ DRCUML_OP_LZCNT, op_lzcnt }, /* LZCNT dst,src */
|
||||
{ DRCUML_OP_SHL, op_shl }, /* SHL dst,src,count[,f] */
|
||||
{ DRCUML_OP_SHR, op_shr }, /* SHR dst,src,count[,f] */
|
||||
{ DRCUML_OP_SAR, op_sar }, /* SAR dst,src,count[,f] */
|
||||
@ -675,7 +675,7 @@ static void drcbex86_reset(drcbe_state *drcbe)
|
||||
dst = (x86code **)drccache_begin_codegen(drcbe->cache, 500);
|
||||
if (dst == NULL)
|
||||
fatalerror("Out of cache space after a reset!");
|
||||
|
||||
|
||||
/* generate a simple CPUID stub */
|
||||
cpuid_ecx_stub = (UINT32 (*)(void))*dst;
|
||||
emit_push_r32(dst, REG_EBX); // push ebx
|
||||
@ -684,7 +684,7 @@ static void drcbex86_reset(drcbe_state *drcbe)
|
||||
emit_mov_r32_r32(dst, REG_EAX, REG_ECX); // mov eax,ecx
|
||||
emit_pop_r32(dst, REG_EBX); // pop ebx
|
||||
emit_ret(dst); // ret
|
||||
|
||||
|
||||
/* call it to determine if we have SSE3 support */
|
||||
drcbe->sse3 = (((*cpuid_ecx_stub)() & 1) != 0);
|
||||
|
||||
@ -3616,7 +3616,7 @@ static x86code *op_save(drcbe_state *drcbe, x86code *dst, const drcuml_instructi
|
||||
|
||||
/* copy live state to the destination */
|
||||
emit_mov_r32_imm(&dst, REG_ECX, dstp.value); // mov ecx,dstp
|
||||
|
||||
|
||||
/* copy flags */
|
||||
emit_pushf(&dst); // pushf
|
||||
emit_pop_r32(&dst, REG_EAX); // pop eax
|
||||
@ -7035,7 +7035,7 @@ static x86code *op_ftoi4t(drcbe_state *drcbe, x86code *dst, const drcuml_instruc
|
||||
|
||||
/* normalize parameters */
|
||||
param_normalize_2(drcbe, inst, &dstp, PTYPE_MR, &srcp, PTYPE_MF);
|
||||
|
||||
|
||||
/* non-SSE3 case */
|
||||
if (!drcbe->sse3)
|
||||
{
|
||||
@ -7056,7 +7056,7 @@ static x86code *op_ftoi4t(drcbe_state *drcbe, x86code *dst, const drcuml_instruc
|
||||
/* restore control word and proceed */
|
||||
emit_fldcw_m16(&dst, MABS(&drcbe->fmodesave)); // fldcw [fmodesave]
|
||||
}
|
||||
|
||||
|
||||
/* SSE3 case */
|
||||
else
|
||||
{
|
||||
@ -7242,7 +7242,7 @@ static x86code *op_ftoi8t(drcbe_state *drcbe, x86code *dst, const drcuml_instruc
|
||||
/* restore control word and proceed */
|
||||
emit_fldcw_m16(&dst, MABS(&drcbe->fmodesave)); // fldcw [fmodesave]
|
||||
}
|
||||
|
||||
|
||||
/* SSE3 case */
|
||||
else
|
||||
{
|
||||
|
@ -331,7 +331,7 @@ static int bevalidate_verify_state(drcuml_state *drcuml, const drcuml_machine_st
|
||||
|
||||
/*-------------------------------------------------
|
||||
size_for_param - given a set of parameter
|
||||
flags and the instruction size, return the
|
||||
flags and the instruction size, return the
|
||||
size of the parameter
|
||||
-------------------------------------------------*/
|
||||
|
||||
@ -409,7 +409,7 @@ drcuml_state *drcuml_alloc(drccache *cache, UINT32 flags, int modes, int addrbit
|
||||
|
||||
|
||||
/*-------------------------------------------------
|
||||
drcuml_get_backend_info - return information
|
||||
drcuml_get_backend_info - return information
|
||||
about the back-end
|
||||
-------------------------------------------------*/
|
||||
|
||||
@ -428,7 +428,7 @@ void drcuml_reset(drcuml_state *drcuml)
|
||||
{
|
||||
drcuml_codehandle *handle;
|
||||
jmp_buf errorbuf;
|
||||
|
||||
|
||||
/* flush the cache */
|
||||
drccache_flush(drcuml->cache);
|
||||
|
||||
@ -981,7 +981,7 @@ static const bevalidate_test bevalidate_test_list[] =
|
||||
TEST_ENTRY_DSSI(ADDC, 4, 0x00000000, 0x92345678, 0x6dcba988, 0, FLAGS_C | FLAGS_Z)
|
||||
TEST_ENTRY_DSSI(ADDC, 4, 0x00000000, 0x92345678, 0x6dcba987, FLAGS_C, FLAGS_C | FLAGS_Z)
|
||||
TEST_ENTRY_DSSI(ADDC, 4, 0x12345678, 0x12345678, 0xffffffff, FLAGS_C, FLAGS_C)
|
||||
|
||||
|
||||
TEST_ENTRY_DSSI(ADDC, 8, 0x7fffffffffffffff, 0x0123456789abcdef, 0x7edcba9876543210, 0, 0)
|
||||
TEST_ENTRY_DSSI(ADDC, 8, 0x7fffffffffffffff, 0x0123456789abcdef, 0x7edcba987654320f, FLAGS_C, 0)
|
||||
TEST_ENTRY_DSSI(ADDC, 8, 0x8000000000000000, 0x0123456789abcdef, 0x7edcba9876543211, 0, FLAGS_V | FLAGS_S)
|
||||
@ -1003,19 +1003,19 @@ static void validate_backend(drcuml_state *drcuml)
|
||||
{
|
||||
drcuml_codehandle *handles[3];
|
||||
int tnum;
|
||||
|
||||
|
||||
/* allocate handles for the code */
|
||||
handles[0] = drcuml_handle_alloc(drcuml, "test_entry");
|
||||
handles[1] = drcuml_handle_alloc(drcuml, "code_start");
|
||||
handles[2] = drcuml_handle_alloc(drcuml, "code_end");
|
||||
|
||||
|
||||
/* iterate over test entries */
|
||||
printf("Backend validation....\n");
|
||||
for (tnum = 0; tnum < ARRAY_LENGTH(bevalidate_test_list); tnum++)
|
||||
{
|
||||
const bevalidate_test *test = &bevalidate_test_list[tnum];
|
||||
drcuml_parameter param[ARRAY_LENGTH(test->param)];
|
||||
|
||||
|
||||
/* reset parameter list and iterate */
|
||||
memset(param, 0, sizeof(param));
|
||||
printf("Executing test %d/%d", tnum + 1, (int)ARRAY_LENGTH(bevalidate_test_list));
|
||||
@ -1036,7 +1036,7 @@ static void validate_backend(drcuml_state *drcuml)
|
||||
static void bevalidate_iterate_over_params(drcuml_state *drcuml, drcuml_codehandle **handles, const bevalidate_test *test, drcuml_parameter *paramlist, int pnum)
|
||||
{
|
||||
const drcuml_opcode_valid *opvalid = &opcode_valid_table[test->opcode];
|
||||
|
||||
|
||||
/* if no parameters, execute now */
|
||||
if (pnum >= ARRAY_LENGTH(opvalid->ptypes) || opvalid->ptypes[pnum] == OV_PARAM_ALLOWED_NONE)
|
||||
{
|
||||
@ -1049,7 +1049,7 @@ static void bevalidate_iterate_over_params(drcuml_state *drcuml, drcuml_codehand
|
||||
if (opvalid->ptypes[pnum] & (1 << paramlist[pnum].type))
|
||||
{
|
||||
int pindex, pcount;
|
||||
|
||||
|
||||
/* mapvars can only do 32-bit tests */
|
||||
if (paramlist[pnum].type == DRCUML_PTYPE_MAPVAR && size_for_param(test->size, opvalid->ptypes[pnum]) == 8)
|
||||
continue;
|
||||
@ -1063,16 +1063,16 @@ static void bevalidate_iterate_over_params(drcuml_state *drcuml, drcuml_codehand
|
||||
default: pcount = 1; break;
|
||||
}
|
||||
|
||||
/* iterate over possibilities */
|
||||
/* iterate over possibilities */
|
||||
for (pindex = 0; pindex < pcount; pindex++)
|
||||
{
|
||||
int skip = FALSE;
|
||||
int pscannum;
|
||||
|
||||
|
||||
/* for param 0, print a dot */
|
||||
if (pnum == 0)
|
||||
printf(".");
|
||||
|
||||
|
||||
/* can't duplicate multiple source parameters unless they are immediates */
|
||||
if (paramlist[pnum].type != DRCUML_PTYPE_IMMEDIATE && ((test->destmask >> pnum) & 1) == 0)
|
||||
|
||||
@ -1102,7 +1102,7 @@ static void bevalidate_iterate_over_flags(drcuml_state *drcuml, drcuml_codehandl
|
||||
const drcuml_opcode_valid *opvalid = &opcode_valid_table[test->opcode];
|
||||
UINT8 flagmask = opvalid->condflags & 0x1f;
|
||||
UINT8 curmask;
|
||||
|
||||
|
||||
/* iterate over all possible flag combinations */
|
||||
for (curmask = 0; curmask <= flagmask; curmask++)
|
||||
if ((curmask & flagmask) == curmask)
|
||||
@ -1124,7 +1124,7 @@ static void bevalidate_execute(drcuml_state *drcuml, drcuml_codehandle **handles
|
||||
drcuml_block *block;
|
||||
UINT64 *parammem;
|
||||
int numparams;
|
||||
|
||||
|
||||
/* allocate memory for parameters */
|
||||
parammem = drccache_memory_alloc_near(drcuml->cache, sizeof(UINT64) * ARRAY_LENGTH(test->param));
|
||||
|
||||
@ -1134,10 +1134,10 @@ static void bevalidate_execute(drcuml_state *drcuml, drcuml_codehandle **handles
|
||||
/* start a new block */
|
||||
block = drcuml_block_begin(drcuml, 30, NULL);
|
||||
UML_HANDLE(block, handles[0]);
|
||||
|
||||
|
||||
/* set up a random initial state */
|
||||
bevalidate_initialize_random_state(block, &istate);
|
||||
|
||||
|
||||
/* then populate the state with the parameters */
|
||||
numparams = bevalidate_populate_state(block, &istate, test, paramlist, params, parammem);
|
||||
|
||||
@ -1149,19 +1149,19 @@ static void bevalidate_execute(drcuml_state *drcuml, drcuml_codehandle **handles
|
||||
case 0:
|
||||
drcuml_block_append_0(block, test->opcode, test->size, flagmask);
|
||||
break;
|
||||
|
||||
|
||||
case 1:
|
||||
drcuml_block_append_1(block, test->opcode, test->size, flagmask, params[0].type, params[0].value);
|
||||
break;
|
||||
|
||||
|
||||
case 2:
|
||||
drcuml_block_append_2(block, test->opcode, test->size, flagmask, params[0].type, params[0].value, params[1].type, params[1].value);
|
||||
break;
|
||||
|
||||
|
||||
case 3:
|
||||
drcuml_block_append_3(block, test->opcode, test->size, flagmask, params[0].type, params[0].value, params[1].type, params[1].value, params[2].type, params[2].value);
|
||||
break;
|
||||
|
||||
|
||||
case 4:
|
||||
drcuml_block_append_4(block, test->opcode, test->size, flagmask, params[0].type, params[0].value, params[1].type, params[1].value, params[2].type, params[2].value, params[3].type, params[3].value);
|
||||
break;
|
||||
@ -1170,13 +1170,13 @@ static void bevalidate_execute(drcuml_state *drcuml, drcuml_codehandle **handles
|
||||
UML_HANDLE(block, handles[2]);
|
||||
UML_SAVE(block, &fstate);
|
||||
UML_EXIT(block, IMM(0));
|
||||
|
||||
|
||||
/* end the block */
|
||||
drcuml_block_end(block);
|
||||
|
||||
|
||||
/* execute */
|
||||
drcuml_execute(drcuml, handles[0]);
|
||||
|
||||
|
||||
/* verify the results */
|
||||
bevalidate_verify_state(drcuml, &istate, &fstate, test, params, &testinst, handles[1]->code, handles[2]->code, flagmask);
|
||||
|
||||
@ -1186,19 +1186,19 @@ static void bevalidate_execute(drcuml_state *drcuml, drcuml_codehandle **handles
|
||||
|
||||
|
||||
/*-------------------------------------------------
|
||||
bevalidate_initialize_random_state -
|
||||
bevalidate_initialize_random_state -
|
||||
initialize the machine state to randomness
|
||||
-------------------------------------------------*/
|
||||
|
||||
static void bevalidate_initialize_random_state(drcuml_block *block, drcuml_machine_state *state)
|
||||
{
|
||||
int regnum;
|
||||
|
||||
|
||||
/* initialize core state to random values */
|
||||
state->fmod = mame_rand(Machine) & 0x03;
|
||||
state->flags = mame_rand(Machine) & 0x1f;
|
||||
state->exp = mame_rand(Machine);
|
||||
|
||||
|
||||
/* initialize integer registers to random values */
|
||||
for (regnum = 0; regnum < ARRAY_LENGTH(state->r); regnum++)
|
||||
{
|
||||
@ -1239,10 +1239,10 @@ static int bevalidate_populate_state(drcuml_block *block, drcuml_machine_state *
|
||||
{
|
||||
int psize = size_for_param(test->size, opvalid->ptypes[pnum]);
|
||||
drcuml_parameter *curparam = ¶ms[pnum];
|
||||
|
||||
|
||||
/* start with a copy of the parameter from the list */
|
||||
*curparam = paramlist[pnum];
|
||||
|
||||
|
||||
/* switch off the type */
|
||||
switch (curparam->type)
|
||||
{
|
||||
@ -1250,19 +1250,19 @@ static int bevalidate_populate_state(drcuml_block *block, drcuml_machine_state *
|
||||
case DRCUML_PTYPE_IMMEDIATE:
|
||||
curparam->value = test->param[pnum];
|
||||
break;
|
||||
|
||||
|
||||
/* register parameters: set the register value in the state and set the parameter value to the register index */
|
||||
case DRCUML_PTYPE_INT_REGISTER:
|
||||
state->r[curparam->value].d = test->param[pnum];
|
||||
curparam->value += DRCUML_REG_I0;
|
||||
break;
|
||||
|
||||
|
||||
/* register parameters: set the register value in the state and set the parameter value to the register index */
|
||||
case DRCUML_PTYPE_FLOAT_REGISTER:
|
||||
state->f[curparam->value].d = test->param[pnum];
|
||||
curparam->value += DRCUML_REG_F0;
|
||||
break;
|
||||
|
||||
|
||||
/* memory parameters: set the memory value in the parameter space and set the parameter value to point to it */
|
||||
case DRCUML_PTYPE_MEMORY:
|
||||
curparam->value = (FPTR)¶mmem[pnum];
|
||||
@ -1271,7 +1271,7 @@ static int bevalidate_populate_state(drcuml_block *block, drcuml_machine_state *
|
||||
else
|
||||
*(UINT64 *)(FPTR)curparam->value = test->param[pnum];
|
||||
break;
|
||||
|
||||
|
||||
/* map variables: issue a MAPVAR instruction to set the value and set the parameter value to the mapvar index */
|
||||
case DRCUML_PTYPE_MAPVAR:
|
||||
UML_MAPVAR(block, MVAR(curparam->value), test->param[pnum]);
|
||||
@ -1284,7 +1284,7 @@ static int bevalidate_populate_state(drcuml_block *block, drcuml_machine_state *
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* return the total number of parameters */
|
||||
return numparams;
|
||||
}
|
||||
@ -1306,7 +1306,7 @@ static int bevalidate_verify_state(drcuml_state *drcuml, const drcuml_machine_st
|
||||
int pnum, regnum;
|
||||
|
||||
*errend = 0;
|
||||
|
||||
|
||||
/* check flags */
|
||||
if ((state->flags & flagmask) != (test->flags & flagmask))
|
||||
{
|
||||
@ -1323,7 +1323,7 @@ static int bevalidate_verify_state(drcuml_state *drcuml, const drcuml_machine_st
|
||||
(flagmask & DRCUML_FLAG_C) ? ((test->flags & DRCUML_FLAG_C) ? 'C' : '.') : '-');
|
||||
}
|
||||
|
||||
/* check destination parameters */
|
||||
/* check destination parameters */
|
||||
for (pnum = 0; pnum < ARRAY_LENGTH(test->param); pnum++)
|
||||
if (test->destmask & (1 << pnum))
|
||||
{
|
||||
@ -1339,13 +1339,13 @@ static int bevalidate_verify_state(drcuml_state *drcuml, const drcuml_machine_st
|
||||
ireg[params[pnum].value - DRCUML_REG_I0] = 1;
|
||||
result = state->r[params[pnum].value - DRCUML_REG_I0].d;
|
||||
break;
|
||||
|
||||
|
||||
/* float registers fetch from the state */
|
||||
case DRCUML_PTYPE_FLOAT_REGISTER:
|
||||
freg[params[pnum].value - DRCUML_REG_I0] = 1;
|
||||
result = state->f[params[pnum].value - DRCUML_REG_F0].d;
|
||||
break;
|
||||
|
||||
|
||||
/* memory registers fetch from the memory address */
|
||||
case DRCUML_PTYPE_MEMORY:
|
||||
if (psize == 4)
|
||||
@ -1353,11 +1353,11 @@ static int bevalidate_verify_state(drcuml_state *drcuml, const drcuml_machine_st
|
||||
else
|
||||
result = *(UINT64 *)(FPTR)params[pnum].value;
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
/* check against the mask */
|
||||
if ((result & mask) != (test->param[pnum] & mask))
|
||||
{
|
||||
@ -1370,29 +1370,29 @@ static int bevalidate_verify_state(drcuml_state *drcuml, const drcuml_machine_st
|
||||
(UINT32)((test->param[pnum] & mask) >> 32), (UINT32)(test->param[pnum] & mask));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* check source integer parameters for unexpected alterations */
|
||||
for (regnum = 0; regnum < ARRAY_LENGTH(state->r); regnum++)
|
||||
if (ireg[regnum] == 0 && istate->r[regnum].d != state->r[regnum].d)
|
||||
errend += sprintf(errend, " Register i%d ... result:%08X%08X originally:%08X%08X\n", regnum,
|
||||
(UINT32)(state->r[regnum].d >> 32), (UINT32)state->r[regnum].d,
|
||||
(UINT32)(istate->r[regnum].d >> 32), (UINT32)istate->r[regnum].d);
|
||||
|
||||
|
||||
/* check source float parameters for unexpected alterations */
|
||||
for (regnum = 0; regnum < ARRAY_LENGTH(state->f); regnum++)
|
||||
if (freg[regnum] == 0 && *(UINT64 *)&istate->f[regnum].d != *(UINT64 *)&state->f[regnum].d)
|
||||
errend += sprintf(errend, " Register f%d ... result:%08X%08X originally:%08X%08X\n", regnum,
|
||||
(UINT32)(*(UINT64 *)&state->f[regnum].d >> 32), (UINT32)*(UINT64 *)&state->f[regnum].d,
|
||||
(UINT32)(*(UINT64 *)&istate->f[regnum].d >> 32), (UINT32)*(UINT64 *)&istate->f[regnum].d);
|
||||
|
||||
|
||||
/* output the error if we have one */
|
||||
if (errend != errorbuf)
|
||||
{
|
||||
char disasm[100];
|
||||
|
||||
|
||||
/* disassemble the test instruction */
|
||||
drcuml_disasm(testinst, disasm);
|
||||
|
||||
|
||||
/* output a description of what went wrong */
|
||||
printf("\n");
|
||||
printf("----------------------------------------------\n");
|
||||
@ -1404,4 +1404,4 @@ static int bevalidate_verify_state(drcuml_state *drcuml, const drcuml_machine_st
|
||||
fatalerror("Error during validation");
|
||||
}
|
||||
return errend != errorbuf;
|
||||
}
|
||||
}
|
||||
|
@ -231,7 +231,7 @@ enum _drcuml_opcode
|
||||
DRCUML_OP_TEST, /* TEST src1,src2[,f] */
|
||||
DRCUML_OP_OR, /* OR dst,src1,src2[,f] */
|
||||
DRCUML_OP_XOR, /* XOR dst,src1,src2[,f] */
|
||||
DRCUML_OP_LZCNT, /* LZCNT dst,src */
|
||||
DRCUML_OP_LZCNT, /* LZCNT dst,src */
|
||||
DRCUML_OP_SHL, /* SHL dst,src,count[,f] */
|
||||
DRCUML_OP_SHR, /* SHR dst,src,count[,f] */
|
||||
DRCUML_OP_SAR, /* SAR dst,src,count[,f] */
|
||||
|
@ -83,7 +83,7 @@ static const memory_accessors le_memory =
|
||||
size_t mips3com_init(mips3_state *mips, mips3_flavor flavor, int bigendian, int index, int clock, const struct mips3_config *config, int (*irqcallback)(int), void *memory)
|
||||
{
|
||||
int tlbindex;
|
||||
|
||||
|
||||
/* if no memory, return the amount needed */
|
||||
if (memory == NULL)
|
||||
return config->icache + config->dcache + (sizeof(mips->tlb_table[0]) * (1 << (MIPS3_MAX_PADDR_SHIFT - MIPS3_MIN_PAGE_SHIFT)));
|
||||
@ -229,7 +229,7 @@ void mips3com_map_tlb_entries(mips3_state *mips)
|
||||
UINT64 lo = tlbent->entry_lo[which];
|
||||
UINT32 pfn = (lo >> 6) & 0x00ffffff;
|
||||
UINT32 wp = (lo & 7) | TLB_PRESENT;
|
||||
|
||||
|
||||
/* ensure that if the valid bit is clear, the dirty bit is as well */
|
||||
/* this way we can always test dirty for writes, and valid for reads */
|
||||
if (!(wp & TLB_VALID))
|
||||
|
@ -195,7 +195,7 @@ struct _mips3_regs
|
||||
|
||||
/* internal stuff */
|
||||
UINT8 cache_dirty; /* true if we need to flush the cache */
|
||||
|
||||
|
||||
/* register mappings */
|
||||
drcuml_parameter regmap[34]; /* parameter to register mappings for all 32 integer registers */
|
||||
drcuml_parameter regmaplo[34]; /* parameter to register mappings for all 32 integer registers */
|
||||
@ -660,7 +660,7 @@ INLINE void alloc_handle(drcuml_state *drcuml, drcuml_codehandle **handleptr, co
|
||||
INLINE void load_fast_iregs(drcuml_block *block)
|
||||
{
|
||||
int regnum;
|
||||
|
||||
|
||||
for (regnum = 0; regnum < ARRAY_LENGTH(mips3.regmap); regnum++)
|
||||
if (mips3.regmap[regnum].type == DRCUML_PTYPE_INT_REGISTER)
|
||||
UML_DMOV(block, IREG(mips3.regmap[regnum].value - DRCUML_REG_I0), MEM(&mips3.core->r[regnum]));
|
||||
@ -675,7 +675,7 @@ INLINE void load_fast_iregs(drcuml_block *block)
|
||||
INLINE void save_fast_iregs(drcuml_block *block)
|
||||
{
|
||||
int regnum;
|
||||
|
||||
|
||||
for (regnum = 0; regnum < ARRAY_LENGTH(mips3.regmap); regnum++)
|
||||
if (mips3.regmap[regnum].type == DRCUML_PTYPE_INT_REGISTER)
|
||||
UML_DMOV(block, MEM(&mips3.core->r[regnum]), IREG(mips3.regmap[regnum].value - DRCUML_REG_I0));
|
||||
@ -910,7 +910,7 @@ static offs_t mips3_dasm(char *buffer, offs_t pc, const UINT8 *oprom, const UINT
|
||||
static void code_flush_cache(drcuml_state *drcuml)
|
||||
{
|
||||
int mode;
|
||||
|
||||
|
||||
/* empty the transient cache contents */
|
||||
drcuml_reset(drcuml);
|
||||
|
||||
@ -1151,7 +1151,7 @@ static void cfunc_printf_probe(void *param)
|
||||
|
||||
|
||||
/*-------------------------------------------------
|
||||
cfunc_unimplemented - handler for
|
||||
cfunc_unimplemented - handler for
|
||||
unimplemented opcdes
|
||||
-------------------------------------------------*/
|
||||
|
||||
@ -1196,7 +1196,7 @@ static void static_generate_entry_point(drcuml_state *drcuml)
|
||||
UML_AND(block, IREG(0), CCR132(31), IMM(3)); // and i0,ccr1[31],3
|
||||
UML_LOAD1U(block, IREG(0), &mips3.cstate->fpmode[0], IREG(0)); // load1u i0,fpmode,i0
|
||||
UML_SETFMOD(block, IREG(0)); // setfmod i0
|
||||
|
||||
|
||||
/* load fast integer registers */
|
||||
load_fast_iregs(block);
|
||||
|
||||
@ -1442,14 +1442,14 @@ static void static_generate_memory_accessor(drcuml_state *drcuml, int mode, int
|
||||
/* add a global entry for this */
|
||||
alloc_handle(drcuml, handleptr, name);
|
||||
UML_HANDLE(block, *handleptr); // handle *handleptr
|
||||
|
||||
|
||||
/* user mode? generate address exception if top bit is set */
|
||||
if (mode == MODE_USER)
|
||||
{
|
||||
UML_TEST(block, IREG(0), IMM(0x80000000)); // test i0,0x80000000
|
||||
UML_EXHc(block, IF_NZ, exception_addrerr, IREG(0)); // exh addrerr,i0,nz
|
||||
}
|
||||
|
||||
|
||||
/* supervisor mode? generate address exception if not in user space or in $C0000000-DFFFFFFF */
|
||||
if (mode == MODE_SUPER)
|
||||
{
|
||||
@ -1801,7 +1801,7 @@ static void generate_sequence_instruction(drcuml_block *block, compiler_state *c
|
||||
save_fast_iregs(block);
|
||||
UML_DEBUG(block, IMM(desc->pc)); // debug desc->pc
|
||||
}
|
||||
|
||||
|
||||
/* if we hit an unmapped address, fatal error */
|
||||
if (desc->flags & OPFLAG_COMPILER_UNMAPPED)
|
||||
{
|
||||
@ -1820,7 +1820,7 @@ static void generate_sequence_instruction(drcuml_block *block, compiler_state *c
|
||||
}
|
||||
UML_EXH(block, mips3.tlb_mismatch, IMM(0)); // exh tlb_mismatch,0
|
||||
}
|
||||
|
||||
|
||||
/* validate our TLB entry at this PC; if we fail, we need to handle it */
|
||||
if ((desc->flags & OPFLAG_VALIDATE_TLB) && (desc->pc < 0x80000000 || desc->pc >= 0xc0000000))
|
||||
{
|
||||
@ -1836,7 +1836,7 @@ static void generate_sequence_instruction(drcuml_block *block, compiler_state *c
|
||||
UML_CMP(block, IREG(0), IMM(mips3.core->tlb_table[desc->pc >> 12])); // cmp i0,*tlbentry
|
||||
UML_EXHc(block, IF_NE, mips3.tlb_mismatch, IMM(0)); // exh tlb_mismatch,0,NE
|
||||
}
|
||||
|
||||
|
||||
/* otherwise, we generate an unconditional exception */
|
||||
else
|
||||
{
|
||||
@ -2857,7 +2857,7 @@ static int generate_idt(drcuml_block *block, compiler_state *compiler, const opc
|
||||
{
|
||||
UINT32 op = *desc->opptr.l;
|
||||
UINT8 opswitch = op & 0x1f;
|
||||
|
||||
|
||||
/* only enabled on IDT processors */
|
||||
if (mips3.core->flavor != MIPS3_TYPE_R4650)
|
||||
return FALSE;
|
||||
|
@ -188,9 +188,9 @@ INLINE void saturn_interrupt_on(void)
|
||||
{
|
||||
LOG(( "SATURN#%d at %05x: INTON\n", cpu_getactivecpu(), saturn.pc-4 ));
|
||||
saturn.irq_enable=1;
|
||||
if (saturn.irq_state)
|
||||
if (saturn.irq_state)
|
||||
{
|
||||
LOG(( "SATURN#%d set_irq_line(ASSERT)\n", cpu_getactivecpu()));
|
||||
LOG(( "SATURN#%d set_irq_line(ASSERT)\n", cpu_getactivecpu()));
|
||||
saturn.pending_irq=1;
|
||||
}
|
||||
}
|
||||
@ -277,8 +277,8 @@ INLINE void saturn_in(int reg)
|
||||
{
|
||||
int in = 0;
|
||||
saturn_assert(reg>=0 && reg<9);
|
||||
if (!(saturn.pc&1))
|
||||
logerror( "SATURN#%d at %05x: reg=IN opcode at odd addresse\n",
|
||||
if (!(saturn.pc&1))
|
||||
logerror( "SATURN#%d at %05x: reg=IN opcode at odd addresse\n",
|
||||
cpu_getactivecpu(), saturn.pc-3 );
|
||||
if (saturn.config&&saturn.config->in) in = saturn.config->in(Machine);
|
||||
S64_WRITE_WORD(reg,in);
|
||||
@ -849,7 +849,7 @@ INLINE void saturn_add(int reg, int begin, int count, int right)
|
||||
t=saturn.reg[reg][begin+i];
|
||||
t+=saturn.reg[right][begin+i];
|
||||
t+=saturn.carry;
|
||||
if (t>=base) {
|
||||
if (t>=base) {
|
||||
saturn.carry=1;
|
||||
t-=base;
|
||||
}
|
||||
@ -871,7 +871,7 @@ INLINE void saturn_add_const(int reg, int begin, int count, SaturnNib right)
|
||||
t=saturn.reg[reg][begin+i];
|
||||
t+=(right&0xf);
|
||||
right>>=4;
|
||||
if (t>=base) {
|
||||
if (t>=base) {
|
||||
right++;
|
||||
t-=base;
|
||||
}
|
||||
@ -898,7 +898,7 @@ INLINE void saturn_sub(int reg, int begin, int count, int right)
|
||||
t=saturn.reg[reg][begin+i];
|
||||
t-=saturn.reg[right][begin+i];
|
||||
t-=saturn.carry;
|
||||
if (t<0) {
|
||||
if (t<0) {
|
||||
saturn.carry=1;
|
||||
t+=base;
|
||||
}
|
||||
@ -920,7 +920,7 @@ INLINE void saturn_sub_const(int reg, int begin, int count, int right)
|
||||
t=saturn.reg[reg][begin+i];
|
||||
t-=(right&0xf);
|
||||
right>>=4;
|
||||
if (t<0) {
|
||||
if (t<0) {
|
||||
right++;
|
||||
t+=base;
|
||||
}
|
||||
@ -947,7 +947,7 @@ INLINE void saturn_sub2(int reg, int begin, int count, int right)
|
||||
t=saturn.reg[right][begin+i];
|
||||
t-=saturn.reg[reg][begin+i];
|
||||
t-=saturn.carry;
|
||||
if (t<0) {
|
||||
if (t<0) {
|
||||
saturn.carry=1;
|
||||
t+=base;
|
||||
}
|
||||
|
@ -37,25 +37,25 @@ static const int sub_right[]={B,C,A,C, I,I,I,I, A,B,C,D, B,C,A,C};
|
||||
|
||||
void saturn_invalid3( int op1, int op2, int op3 )
|
||||
{
|
||||
logerror( "SATURN#%d invalid opcode %x%x%x at %05x\n",
|
||||
logerror( "SATURN#%d invalid opcode %x%x%x at %05x\n",
|
||||
cpu_getactivecpu(), op1, op2, op3, saturn.pc-3 );
|
||||
}
|
||||
|
||||
void saturn_invalid4( int op1, int op2, int op3, int op4 )
|
||||
{
|
||||
logerror( "SATURN#%d invalid opcode %x%x%x%x at %05x\n",
|
||||
logerror( "SATURN#%d invalid opcode %x%x%x%x at %05x\n",
|
||||
cpu_getactivecpu(), op1, op2, op3, op4, saturn.pc-4 );
|
||||
}
|
||||
|
||||
void saturn_invalid5( int op1, int op2, int op3, int op4, int op5 )
|
||||
{
|
||||
logerror( "SATURN#%d invalid opcode %x%x%x%x%x at %05x\n",
|
||||
logerror( "SATURN#%d invalid opcode %x%x%x%x%x at %05x\n",
|
||||
cpu_getactivecpu(), op1, op2, op3, op4, op5, saturn.pc-5 );
|
||||
}
|
||||
|
||||
void saturn_invalid6( int op1, int op2, int op3, int op4, int op5, int op6 )
|
||||
{
|
||||
logerror( "SATURN#%d invalid opcode %x%x%x%x%x%x at %05x\n",
|
||||
logerror( "SATURN#%d invalid opcode %x%x%x%x%x%x at %05x\n",
|
||||
cpu_getactivecpu(), op1, op2, op3, op4, op5, op6, saturn.pc-6 );
|
||||
}
|
||||
|
||||
@ -600,19 +600,19 @@ static void saturn_instruction_8(void)
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 0xc:
|
||||
case 0xc:
|
||||
adr=READ_OP_DIS16();
|
||||
saturn_jump((adr+saturn.pc-4)&0xfffff,1);
|
||||
break;
|
||||
case 0xd:
|
||||
break;
|
||||
case 0xd:
|
||||
adr=READ_OP_ARG20();
|
||||
saturn_jump(adr,1);
|
||||
break;
|
||||
case 0xe:
|
||||
case 0xe:
|
||||
adr=READ_OP_DIS16();
|
||||
saturn_call((adr+saturn.pc)&0xfffff);
|
||||
break;
|
||||
case 0xf:
|
||||
case 0xf:
|
||||
adr=READ_OP_ARG20();
|
||||
saturn_call(adr);
|
||||
break;
|
||||
@ -791,7 +791,7 @@ static void saturn_instruction_a(void)
|
||||
break; // a=0 wp
|
||||
case 4: case 5: case 6: case 7:
|
||||
case 8: case 9: case 0xa: case 0xb:
|
||||
saturn_copy(reg_right[reg&7], 0, saturn.p+1, reg_left[reg&7]);
|
||||
saturn_copy(reg_right[reg&7], 0, saturn.p+1, reg_left[reg&7]);
|
||||
break; // a=b wp
|
||||
case 0xc: case 0xd: case 0xe: case 0xf:
|
||||
saturn_exchange(reg_left[reg&3], 0, saturn.p+1, reg_right[reg&3]);
|
||||
@ -936,14 +936,14 @@ static void saturn_instruction(void)
|
||||
case 2:
|
||||
saturn_load_p();
|
||||
break;
|
||||
case 3:
|
||||
case 3:
|
||||
saturn_load_reg(C);
|
||||
break; // lc
|
||||
case 4:
|
||||
adr=READ_OP_DIS8();
|
||||
if (adr==0) {
|
||||
saturn_return(saturn.carry);
|
||||
}
|
||||
}
|
||||
else {
|
||||
saturn_jump((saturn.pc+adr-2)&0xfffff, saturn.carry);
|
||||
}
|
||||
@ -952,7 +952,7 @@ static void saturn_instruction(void)
|
||||
adr=READ_OP_DIS8();
|
||||
if (adr==0) {
|
||||
saturn_return(!saturn.carry);
|
||||
}
|
||||
}
|
||||
else {
|
||||
saturn_jump((saturn.pc+adr-2)&0xfffff,!saturn.carry);
|
||||
}
|
||||
|
@ -131,7 +131,7 @@ static void saturn_reset(void)
|
||||
{
|
||||
saturn.pc=0;
|
||||
saturn.sleeping = 0;
|
||||
saturn.irq_enable = 0;
|
||||
saturn.irq_enable = 0;
|
||||
saturn.in_irq = 0;
|
||||
change_pc(saturn.pc);
|
||||
}
|
||||
@ -160,7 +160,7 @@ INLINE void saturn_take_irq(void)
|
||||
saturn_ICount -= 7;
|
||||
saturn_push(saturn.pc);
|
||||
saturn.pc=IRQ_ADDRESS;
|
||||
|
||||
|
||||
LOG(("Saturn#%d takes IRQ ($%04x)\n", cpu_getactivecpu(), saturn.pc));
|
||||
|
||||
if (saturn.irq_callback) (*saturn.irq_callback)(SATURN_IRQ_LINE);
|
||||
@ -205,7 +205,7 @@ static void saturn_set_nmi_line(int state)
|
||||
if ( state == saturn.nmi_state ) return;
|
||||
saturn.nmi_state = state;
|
||||
if ( state != CLEAR_LINE )
|
||||
{
|
||||
{
|
||||
LOG(( "SATURN#%d set_nmi_line(ASSERT)\n", cpu_getactivecpu()));
|
||||
saturn.pending_irq = 1;
|
||||
}
|
||||
|
@ -83,12 +83,12 @@ typedef enum {
|
||||
CcopyP, PcopyC, sreq, CswapP,
|
||||
|
||||
inton, AloadImm, buscb,
|
||||
clearAbit, setAbit,
|
||||
clearAbit, setAbit,
|
||||
branchAbitclear, returnAbitclear,
|
||||
branchAbitset, returnAbitset,
|
||||
clearCbit, setCbit,
|
||||
branchCbitclear, returnCbitclear,
|
||||
branchCbitset, returnCbitset,
|
||||
clearCbit, setCbit,
|
||||
branchCbitclear, returnCbitclear,
|
||||
branchCbitset, returnCbitset,
|
||||
PCloadA, buscd, PCloadC, intoff, rsi,
|
||||
|
||||
jumpA, jumpC, PCcopyA, PCcopyC, AcopyPC, CcopyPC,
|
||||
|
@ -40,7 +40,7 @@ static void print_game_switches(FILE *out, const game_driver *game, const input_
|
||||
{
|
||||
const input_port_config *port;
|
||||
const input_field_config *field;
|
||||
|
||||
|
||||
/* iterate looking for DIP switches */
|
||||
for (port = portlist; port != NULL; port = port->next)
|
||||
for (field = port->fieldlist; field != NULL; field = field->next)
|
||||
|
@ -242,11 +242,11 @@ struct _input_port_private
|
||||
/* types */
|
||||
input_type_state * typestatelist; /* list of live type states */
|
||||
input_type_state * type_to_typestate[__ipt_max][MAX_PLAYERS]; /* map from type/player to type state */
|
||||
|
||||
|
||||
/* specific special global input states */
|
||||
digital_joystick_state joystick_info[MAX_PLAYERS][DIGITAL_JOYSTICKS_PER_PLAYER]; /* joystick states */
|
||||
osd_ticks_t ui_memory[__ipt_max];/* keypress timing for UI */
|
||||
|
||||
|
||||
/* frame time tracking */
|
||||
attotime last_frame_time; /* time of the last frame callback */
|
||||
attoseconds_t last_delta_nsec; /* nanoseconds that passed since the previous callback */
|
||||
@ -585,7 +585,7 @@ INLINE int get_port_index(const input_port_config *portlist, const char *tag)
|
||||
{
|
||||
const input_port_config *port;
|
||||
int index = 0;
|
||||
|
||||
|
||||
for (port = portlist; port != NULL; port = port->next)
|
||||
{
|
||||
if (port->tag != NULL && strcmp(tag, port->tag) == 0)
|
||||
@ -610,7 +610,7 @@ time_t input_port_init(running_machine *machine, const input_port_token *tokens)
|
||||
{
|
||||
input_port_private *portdata;
|
||||
time_t basetime;
|
||||
|
||||
|
||||
/* allocate memory for our data structure */
|
||||
machine->input_port_data = auto_malloc(sizeof(*machine->input_port_data));
|
||||
memset(machine->input_port_data, 0, sizeof(*machine->input_port_data));
|
||||
@ -651,7 +651,7 @@ static void input_port_exit(running_machine *machine)
|
||||
/* close any playback or recording files */
|
||||
playback_end(machine, NULL);
|
||||
record_end(machine, NULL);
|
||||
|
||||
|
||||
/* free our allocated config */
|
||||
if (machine->portconfig != NULL)
|
||||
input_port_config_free(machine->portconfig);
|
||||
@ -664,7 +664,7 @@ static void input_port_exit(running_machine *machine)
|
||||
***************************************************************************/
|
||||
|
||||
/*-------------------------------------------------
|
||||
input_port_config_alloc - allocate a list of
|
||||
input_port_config_alloc - allocate a list of
|
||||
input ports from the given token list
|
||||
-------------------------------------------------*/
|
||||
|
||||
@ -675,7 +675,7 @@ const input_port_config *input_port_config_alloc(const input_port_token *tokens)
|
||||
|
||||
|
||||
/*-------------------------------------------------
|
||||
input_port_config_alloc - free memory
|
||||
input_port_config_alloc - free memory
|
||||
allocated from input_port_alloc
|
||||
-------------------------------------------------*/
|
||||
|
||||
@ -696,12 +696,12 @@ void input_port_config_free(const input_port_config *portlist)
|
||||
const input_port_config *input_port_by_tag(const input_port_config *portlist, const char *tag)
|
||||
{
|
||||
const input_port_config *port;
|
||||
|
||||
|
||||
/* loop over ports until we hit the index or run out */
|
||||
for (port = portlist; port != NULL; port = port->next)
|
||||
if (port->tag != NULL && strcmp(port->tag, tag) == 0)
|
||||
return port;
|
||||
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -715,12 +715,12 @@ const input_port_config *input_port_by_tag(const input_port_config *portlist, co
|
||||
const input_port_config *input_port_by_index(const input_port_config *portlist, int index)
|
||||
{
|
||||
const input_port_config *port;
|
||||
|
||||
|
||||
/* loop over ports until we hit the index or run out */
|
||||
for (port = portlist; port != NULL; port = port->next)
|
||||
if (index-- == 0)
|
||||
return port;
|
||||
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -759,14 +759,14 @@ const input_seq *input_field_seq(const input_field_config *field, input_seq_type
|
||||
/* if the field is disabled, return no key */
|
||||
if (field->flags & FIELD_FLAG_UNUSED)
|
||||
return portseq;
|
||||
|
||||
|
||||
/* select either the live or config state depending on whether we have live state */
|
||||
portseq = (field->state == NULL) ? &field->seq[seqtype] : &field->state->seq[seqtype];
|
||||
|
||||
/* if the portseq is the special default code, return the expanded default value */
|
||||
if (input_seq_get_1(portseq) == SEQCODE_DEFAULT)
|
||||
return input_type_seq(field->port->machine, field->type, field->player, seqtype);
|
||||
|
||||
|
||||
/* otherwise, return the sequence as-is */
|
||||
return portseq;
|
||||
}
|
||||
@ -780,18 +780,18 @@ const input_seq *input_field_seq(const input_field_config *field, input_seq_type
|
||||
void input_field_get_user_settings(const input_field_config *field, input_field_user_settings *settings)
|
||||
{
|
||||
int seqtype;
|
||||
|
||||
|
||||
/* zap the entire structure */
|
||||
memset(settings, 0, sizeof(*settings));
|
||||
|
||||
|
||||
/* copy the basics */
|
||||
for (seqtype = 0; seqtype < ARRAY_LENGTH(settings->seq); seqtype++)
|
||||
settings->seq[seqtype] = field->state->seq[seqtype];
|
||||
|
||||
|
||||
/* if there's a list of settings or we're an adjuster, copy the current value */
|
||||
if (field->settinglist != NULL || field->type == IPT_ADJUSTER)
|
||||
settings->value = field->state->value;
|
||||
|
||||
|
||||
/* if there's analog data, extract the analog settings */
|
||||
if (field->state->analog != NULL)
|
||||
{
|
||||
@ -822,11 +822,11 @@ void input_field_set_user_settings(const input_field_config *field, const input_
|
||||
else
|
||||
field->state->seq[seqtype] = settings->seq[seqtype];
|
||||
}
|
||||
|
||||
|
||||
/* if there's a list of settings or we're an adjuster, copy the current value */
|
||||
if (field->settinglist != NULL || field->type == IPT_ADJUSTER)
|
||||
field->state->value = settings->value;
|
||||
|
||||
|
||||
/* if there's analog data, extract the analog settings */
|
||||
if (field->state->analog != NULL)
|
||||
{
|
||||
@ -844,7 +844,7 @@ void input_field_set_user_settings(const input_field_config *field, const input_
|
||||
***************************************************************************/
|
||||
|
||||
/*-------------------------------------------------
|
||||
input_type_is_analog - return TRUE if
|
||||
input_type_is_analog - return TRUE if
|
||||
the given type represents an analog control
|
||||
-------------------------------------------------*/
|
||||
|
||||
@ -855,7 +855,7 @@ int input_type_is_analog(int type)
|
||||
|
||||
|
||||
/*-------------------------------------------------
|
||||
input_type_name - return the name
|
||||
input_type_name - return the name
|
||||
for the given type/player
|
||||
-------------------------------------------------*/
|
||||
|
||||
@ -869,7 +869,7 @@ const char *input_type_name(running_machine *machine, int type, int player)
|
||||
if (typestate != NULL)
|
||||
return typestate->typedesc.name;
|
||||
}
|
||||
|
||||
|
||||
/* if no machine, fall back to brute force searching */
|
||||
else
|
||||
{
|
||||
@ -878,14 +878,14 @@ const char *input_type_name(running_machine *machine, int type, int player)
|
||||
if (core_types[typenum].type == type && core_types[typenum].player == player)
|
||||
return core_types[typenum].name;
|
||||
}
|
||||
|
||||
|
||||
/* if we find nothing, return an invalid group */
|
||||
return "???";
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------
|
||||
input_type_group - return the group
|
||||
input_type_group - return the group
|
||||
for the given type/player
|
||||
-------------------------------------------------*/
|
||||
|
||||
@ -899,7 +899,7 @@ int input_type_group(running_machine *machine, int type, int player)
|
||||
if (typestate != NULL)
|
||||
return typestate->typedesc.group;
|
||||
}
|
||||
|
||||
|
||||
/* if no machine, fall back to brute force searching */
|
||||
else
|
||||
{
|
||||
@ -908,21 +908,21 @@ int input_type_group(running_machine *machine, int type, int player)
|
||||
if (core_types[typenum].type == type && core_types[typenum].player == player)
|
||||
return core_types[typenum].group;
|
||||
}
|
||||
|
||||
|
||||
/* if we find nothing, return an invalid group */
|
||||
return IPG_INVALID;
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------
|
||||
input_type_seq - return the input
|
||||
input_type_seq - return the input
|
||||
sequence for the given type/player
|
||||
-------------------------------------------------*/
|
||||
|
||||
const input_seq *input_type_seq(running_machine *machine, int type, int player, input_seq_type seqtype)
|
||||
{
|
||||
static const input_seq ip_none = SEQ_DEF_0;
|
||||
|
||||
|
||||
/* if we have a machine, use the live state and quick lookup */
|
||||
if (machine != NULL)
|
||||
{
|
||||
@ -931,7 +931,7 @@ const input_seq *input_type_seq(running_machine *machine, int type, int player,
|
||||
if (typestate != NULL)
|
||||
return &typestate->seq[seqtype];
|
||||
}
|
||||
|
||||
|
||||
/* if no machine, fall back to brute force searching */
|
||||
else
|
||||
{
|
||||
@ -940,14 +940,14 @@ const input_seq *input_type_seq(running_machine *machine, int type, int player,
|
||||
if (core_types[typenum].type == type && core_types[typenum].player == player)
|
||||
return &core_types[typenum].seq[seqtype];
|
||||
}
|
||||
|
||||
|
||||
/* if we find nothing, return an empty sequence */
|
||||
return &ip_none;
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------
|
||||
input_type_set_seq - change the input
|
||||
input_type_set_seq - change the input
|
||||
sequence for the given type/player
|
||||
-------------------------------------------------*/
|
||||
|
||||
@ -990,7 +990,7 @@ const input_type_desc *input_type_list(running_machine *machine)
|
||||
|
||||
/*-------------------------------------------------
|
||||
input_ui_pressed - return TRUE if a key down
|
||||
for the given user interface sequence is
|
||||
for the given user interface sequence is
|
||||
detected
|
||||
-------------------------------------------------*/
|
||||
|
||||
@ -1002,7 +1002,7 @@ int input_ui_pressed(running_machine *machine, int code)
|
||||
|
||||
/*-------------------------------------------------
|
||||
input_ui_pressed_r - return TRUE if a key down
|
||||
for the given user interface sequence is
|
||||
for the given user interface sequence is
|
||||
detected, or if autorepeat at the given speed
|
||||
is triggered
|
||||
-------------------------------------------------*/
|
||||
@ -1022,7 +1022,7 @@ profiler_mark(PROFILER_INPUT);
|
||||
if (pressed)
|
||||
{
|
||||
osd_ticks_t tps = osd_ticks_per_second();
|
||||
|
||||
|
||||
/* if this is the first press, set a 3x delay and leave pressed = 1 */
|
||||
if (portdata->ui_memory[code] == 0)
|
||||
portdata->ui_memory[code] = osd_ticks() + 3 * speed * tps / 60;
|
||||
@ -1062,7 +1062,7 @@ input_port_value input_port_read_direct(const input_port_config *port)
|
||||
analog_field_state *analog;
|
||||
callback_field_info *custom;
|
||||
input_port_value result;
|
||||
|
||||
|
||||
/* start with the digital */
|
||||
result = port->state->digital;
|
||||
|
||||
@ -1094,7 +1094,7 @@ input_port_value input_port_read_direct(const input_port_config *port)
|
||||
{
|
||||
/* start with the raw value */
|
||||
INT32 value = analog->accum;
|
||||
|
||||
|
||||
/* interpolate if appropriate and if time has passed since the last update */
|
||||
if (analog->interpolate && !(analog->field->flags & ANALOG_FLAG_RESET) && portdata->last_delta_nsec != 0)
|
||||
{
|
||||
@ -1161,7 +1161,7 @@ input_port_value input_port_read_indexed(running_machine *machine, int portnum)
|
||||
|
||||
|
||||
/*-------------------------------------------------
|
||||
input_port_read_crosshair - return the
|
||||
input_port_read_crosshair - return the
|
||||
extracted crosshair values for the given
|
||||
player
|
||||
-------------------------------------------------*/
|
||||
@ -1181,14 +1181,14 @@ int input_port_get_crosshair_position(running_machine *machine, int player, floa
|
||||
analog_field_state *analog = field->state->analog;
|
||||
INT32 rawvalue = apply_analog_settings(analog->accum, analog) & (analog->field->mask >> analog->shift);
|
||||
float value = (float)(rawvalue - field->state->analog->adjmin) / (float)(field->state->analog->adjmax - field->state->analog->adjmin);
|
||||
|
||||
|
||||
/* apply the scale and offset */
|
||||
if (field->crossscale < 0)
|
||||
value = -(1.0 - value) * field->crossscale;
|
||||
else
|
||||
value *= field->crossscale;
|
||||
value += field->crossoffset;
|
||||
|
||||
|
||||
/* handle X axis */
|
||||
if (field->crossaxis == CROSSHAIR_AXIS_X)
|
||||
{
|
||||
@ -1212,7 +1212,7 @@ int input_port_get_crosshair_position(running_machine *machine, int player, floa
|
||||
gotx = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* if we got both, stop */
|
||||
if (gotx && goty)
|
||||
break;
|
||||
@ -1223,8 +1223,8 @@ int input_port_get_crosshair_position(running_machine *machine, int player, floa
|
||||
|
||||
|
||||
/*-------------------------------------------------
|
||||
input_port_update_defaults - force an update
|
||||
to the input port values based on current
|
||||
input_port_update_defaults - force an update
|
||||
to the input port values based on current
|
||||
conditions
|
||||
-------------------------------------------------*/
|
||||
|
||||
@ -1236,7 +1236,7 @@ void input_port_update_defaults(running_machine *machine)
|
||||
for (loopnum = 0; loopnum < 2; loopnum++)
|
||||
{
|
||||
const input_port_config *port;
|
||||
|
||||
|
||||
/* loop over all input ports */
|
||||
for (port = machine->portconfig; port != NULL; port = port->next)
|
||||
{
|
||||
@ -1298,14 +1298,14 @@ static INT32 apply_analog_settings(INT32 value, analog_field_state *analog)
|
||||
int input_condition_true(running_machine *machine, const input_condition *condition)
|
||||
{
|
||||
input_port_value condvalue;
|
||||
|
||||
|
||||
/* always condition is always true */
|
||||
if (condition->condition == PORTCOND_ALWAYS)
|
||||
return TRUE;
|
||||
|
||||
|
||||
/* otherwise, read the referenced port */
|
||||
condvalue = input_port_read(machine, condition->tag);
|
||||
|
||||
|
||||
/* based on the condition encoded, determine truth */
|
||||
switch (condition->condition)
|
||||
{
|
||||
@ -1320,7 +1320,7 @@ int input_condition_true(running_machine *machine, const input_condition *condit
|
||||
|
||||
|
||||
/*-------------------------------------------------
|
||||
input_port_string_from_token - convert an
|
||||
input_port_string_from_token - convert an
|
||||
input_port_token to a default string
|
||||
-------------------------------------------------*/
|
||||
|
||||
@ -1331,7 +1331,7 @@ const char *input_port_string_from_token(const input_port_token token)
|
||||
/* 0 is an invalid index */
|
||||
if (token.i == 0)
|
||||
return NULL;
|
||||
|
||||
|
||||
/* if the index is greater than the count, assume it to be a pointer */
|
||||
if (token.i >= INPUT_STRING_COUNT)
|
||||
return token.stringptr;
|
||||
@ -1346,8 +1346,8 @@ const char *input_port_string_from_token(const input_port_token token)
|
||||
|
||||
|
||||
/*-------------------------------------------------
|
||||
input_port_read_handler* - return a memory
|
||||
handler corresponding to a given input port
|
||||
input_port_read_handler* - return a memory
|
||||
handler corresponding to a given input port
|
||||
tag
|
||||
-------------------------------------------------*/
|
||||
|
||||
@ -1384,7 +1384,7 @@ read64_machine_func input_port_read_handler64(const input_port_config *portlist,
|
||||
***************************************************************************/
|
||||
|
||||
/*-------------------------------------------------
|
||||
init_port_types - initialize the default
|
||||
init_port_types - initialize the default
|
||||
type list
|
||||
-------------------------------------------------*/
|
||||
|
||||
@ -1395,7 +1395,7 @@ static void init_port_types(running_machine *machine)
|
||||
input_type_state *curtype;
|
||||
input_type_desc *lasttype = NULL;
|
||||
int seqtype, typenum;
|
||||
|
||||
|
||||
/* convert the array into a list of type states that can be modified */
|
||||
portdata->typestatelist = NULL;
|
||||
stateptr = &portdata->typestatelist;
|
||||
@ -1404,13 +1404,13 @@ static void init_port_types(running_machine *machine)
|
||||
/* allocate memory for the state and link it to the end of the list */
|
||||
*stateptr = auto_malloc(sizeof(**stateptr));
|
||||
memset(*stateptr, 0, sizeof(**stateptr));
|
||||
|
||||
|
||||
/* copy the type description and link the previous description to it */
|
||||
(*stateptr)->typedesc = core_types[typenum];
|
||||
if (lasttype != NULL)
|
||||
lasttype->next = &(*stateptr)->typedesc;
|
||||
lasttype = &(*stateptr)->typedesc;
|
||||
|
||||
|
||||
/* advance */
|
||||
stateptr = &(*stateptr)->next;
|
||||
}
|
||||
@ -1432,7 +1432,7 @@ static void init_port_types(running_machine *machine)
|
||||
|
||||
|
||||
/*-------------------------------------------------
|
||||
init_port_state - initialize the live port
|
||||
init_port_state - initialize the live port
|
||||
states based on the tokens
|
||||
-------------------------------------------------*/
|
||||
|
||||
@ -1450,41 +1450,41 @@ static void init_port_state(running_machine *machine)
|
||||
callback_field_info **custominfotail;
|
||||
callback_field_info **changedinfotail;
|
||||
input_port_state *portstate;
|
||||
|
||||
|
||||
/* allocate a new input_port_info structure */
|
||||
portstate = auto_malloc(sizeof(*portstate));
|
||||
memset(portstate, 0, sizeof(*portstate));
|
||||
((input_port_config *)port)->state = portstate;
|
||||
((input_port_config *)port)->machine = machine;
|
||||
|
||||
|
||||
/* start with tail pointers to all the data */
|
||||
analogstatetail = &portstate->analoglist;
|
||||
custominfotail = &portstate->customlist;
|
||||
changedinfotail = &portstate->changedlist;
|
||||
|
||||
|
||||
/* iterate over fields */
|
||||
for (field = port->fieldlist; field != NULL; field = field->next)
|
||||
{
|
||||
input_field_state *fieldstate;
|
||||
int seqtype;
|
||||
|
||||
|
||||
/* allocate a new input_field_info structure */
|
||||
fieldstate = auto_malloc(sizeof(*fieldstate));
|
||||
memset(fieldstate, 0, sizeof(*fieldstate));
|
||||
((input_field_config *)field)->state = fieldstate;
|
||||
|
||||
|
||||
/* fill in the basic values */
|
||||
for (seqtype = 0; seqtype < ARRAY_LENGTH(fieldstate->seq); seqtype++)
|
||||
fieldstate->seq[seqtype] = field->seq[seqtype];
|
||||
fieldstate->value = field->defvalue;
|
||||
|
||||
|
||||
/* if this is an analog field, allocate memory for the analog data */
|
||||
if (field->type >= __ipt_analog_start && field->type <= __ipt_analog_end)
|
||||
{
|
||||
*analogstatetail = fieldstate->analog = init_field_analog_state(field);
|
||||
analogstatetail = &(*analogstatetail)->next;
|
||||
}
|
||||
|
||||
|
||||
/* if this is a digital joystick field, make a note of it */
|
||||
if (field->type >= __ipt_digital_joystick_start && field->type <= __ipt_digital_joystick_end)
|
||||
{
|
||||
@ -1493,14 +1493,14 @@ static void init_port_state(running_machine *machine)
|
||||
fieldstate->joystick->field[fieldstate->joydir] = field;
|
||||
fieldstate->joystick->inuse = TRUE;
|
||||
}
|
||||
|
||||
|
||||
/* if this entry has custom callback, allocate memory for the tracking structure */
|
||||
if (field->custom != NULL)
|
||||
{
|
||||
*custominfotail = init_field_callback_info(field);
|
||||
custominfotail = &(*custominfotail)->next;
|
||||
}
|
||||
|
||||
|
||||
/* if this entry has changed callback, allocate memory for the tracking structure */
|
||||
if (field->changed != NULL)
|
||||
{
|
||||
@ -1610,7 +1610,7 @@ static callback_field_info *init_field_callback_info(const input_field_config *f
|
||||
info->field = field;
|
||||
for (mask = field->mask; !(mask & 1); mask >>= 1)
|
||||
info->shift++;
|
||||
|
||||
|
||||
return info;
|
||||
}
|
||||
|
||||
@ -1779,7 +1779,7 @@ static analog_field_state *init_field_analog_state(const input_field_config *fie
|
||||
/* compute scale for keypresses */
|
||||
state->keyscalepos = RECIP_SCALE(state->scalepos);
|
||||
state->keyscaleneg = RECIP_SCALE(state->scaleneg);
|
||||
|
||||
|
||||
return state;
|
||||
}
|
||||
|
||||
@ -1807,7 +1807,7 @@ static void frame_update_callback(running_machine *machine)
|
||||
|
||||
|
||||
/*-------------------------------------------------
|
||||
frame_update - core logic for per-frame input
|
||||
frame_update - core logic for per-frame input
|
||||
port updating
|
||||
-------------------------------------------------*/
|
||||
|
||||
@ -1852,11 +1852,11 @@ profiler_mark(PROFILER_INPUT);
|
||||
/* accumulate VBLANK bits */
|
||||
if (field->type == IPT_VBLANK)
|
||||
port->state->vblank ^= field->mask;
|
||||
|
||||
|
||||
/* handle analog inputs */
|
||||
else if (field->state->analog != NULL)
|
||||
frame_update_analog_field(field->state->analog);
|
||||
|
||||
|
||||
/* handle non-analog types, but only when the UI isn't visible */
|
||||
else if (!ui_visible && frame_get_digital_field_state(field))
|
||||
port->state->digital |= field->mask;
|
||||
@ -1879,7 +1879,7 @@ profiler_mark(PROFILER_INPUT);
|
||||
if (oldbits != newbits)
|
||||
(*changed->field->changed)(changed->field, changed->field->changed_param, oldbits, newbits);
|
||||
}
|
||||
|
||||
|
||||
/* remember the last value */
|
||||
port->state->lastvalue = newvalue;
|
||||
}
|
||||
@ -1897,7 +1897,7 @@ profiler_mark(PROFILER_END);
|
||||
|
||||
/*-------------------------------------------------
|
||||
frame_update_digital_joysticks - update the
|
||||
state of digital joysticks prior to
|
||||
state of digital joysticks prior to
|
||||
accumulating the results in a port
|
||||
-------------------------------------------------*/
|
||||
|
||||
@ -2132,14 +2132,14 @@ static int frame_get_digital_field_state(const input_field_config *field)
|
||||
{
|
||||
int curstate = input_seq_pressed(input_field_seq(field, SEQ_TYPE_STANDARD));
|
||||
int changed = FALSE;
|
||||
|
||||
|
||||
/* if the state changed, look for switch down/switch up */
|
||||
if (curstate != field->state->last)
|
||||
{
|
||||
field->state->last = curstate;
|
||||
changed = TRUE;
|
||||
}
|
||||
|
||||
|
||||
#ifdef MESS
|
||||
/* (MESS-specific) check for disabled keyboard */
|
||||
if (field->type == IPT_KEYBOARD && osd_keyboard_disabled())
|
||||
@ -2159,7 +2159,7 @@ static int frame_get_digital_field_state(const input_field_config *field)
|
||||
ui_popup_time(3, "Coinlock disabled %s.", input_field_name(field));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
/* if this is a switch-down event, handle impulse and toggle */
|
||||
if (changed && curstate)
|
||||
{
|
||||
@ -2171,7 +2171,7 @@ static int frame_get_digital_field_state(const input_field_config *field)
|
||||
if (field->flags & FIELD_FLAG_TOGGLE)
|
||||
field->state->toggle = !field->state->toggle;
|
||||
}
|
||||
|
||||
|
||||
/* update the current state with the impulse state */
|
||||
if (field->impulse != 0 && field->state->impulse != 0)
|
||||
{
|
||||
@ -2190,7 +2190,7 @@ static int frame_get_digital_field_state(const input_field_config *field)
|
||||
if (!(mask & (1 << field->state->joydir)))
|
||||
curstate = FALSE;
|
||||
}
|
||||
|
||||
|
||||
return curstate;
|
||||
}
|
||||
|
||||
@ -2211,7 +2211,7 @@ static input_port_config *port_config_detokenize(input_port_config *listhead, co
|
||||
input_setting_config *cursetting = NULL;
|
||||
input_field_config *curfield = NULL;
|
||||
input_port_config *curport = NULL;
|
||||
|
||||
|
||||
/* loop over tokens until we hit the end */
|
||||
while (entrytype != INPUT_TOKEN_END)
|
||||
{
|
||||
@ -2253,11 +2253,11 @@ static input_port_config *port_config_detokenize(input_port_config *listhead, co
|
||||
case INPUT_TOKEN_FIELD:
|
||||
if (curport == NULL)
|
||||
fatalerror("INPUT_TOKEN_FIELD encountered with no active port");
|
||||
|
||||
|
||||
TOKEN_UNGET_UINT32(ipt);
|
||||
TOKEN_GET_UINT32_UNPACK2(ipt, entrytype, 8, type, 24);
|
||||
TOKEN_GET_UINT64_UNPACK2(ipt, mask, 32, defval, 32);
|
||||
|
||||
|
||||
curfield = field_config_alloc(curport, type, defval, mask);
|
||||
cursetting = NULL;
|
||||
break;
|
||||
@ -2271,7 +2271,7 @@ static input_port_config *port_config_detokenize(input_port_config *listhead, co
|
||||
TOKEN_GET_UINT32_UNPACK2(ipt, entrytype, 8, condition.condition, 24);
|
||||
TOKEN_GET_UINT64_UNPACK2(ipt, condition.mask, 32, condition.value, 32);
|
||||
condition.tag = TOKEN_GET_STRING(ipt);
|
||||
|
||||
|
||||
if (cursetting != NULL)
|
||||
cursetting->condition = condition;
|
||||
else
|
||||
@ -2348,7 +2348,7 @@ static input_port_config *port_config_detokenize(input_port_config *listhead, co
|
||||
|
||||
TOKEN_UNGET_UINT32(ipt);
|
||||
TOKEN_GET_UINT64_UNPACK2(ipt, entrytype, 8, val, 32);
|
||||
|
||||
|
||||
input_seq_append_or(&curfield->seq[SEQ_TYPE_STANDARD], val);
|
||||
break;
|
||||
|
||||
@ -2492,7 +2492,7 @@ static input_port_config *port_config_detokenize(input_port_config *listhead, co
|
||||
|
||||
TOKEN_UNGET_UINT32(ipt);
|
||||
TOKEN_GET_UINT64_UNPACK2(ipt, entrytype, 8, val, 32);
|
||||
|
||||
|
||||
input_seq_append_or(&curfield->seq[SEQ_TYPE_INCREMENT], val);
|
||||
break;
|
||||
|
||||
@ -2538,7 +2538,7 @@ static input_port_config *port_config_detokenize(input_port_config *listhead, co
|
||||
|
||||
TOKEN_UNGET_UINT32(ipt);
|
||||
TOKEN_GET_UINT64_UNPACK2(ipt, entrytype, 8, defval, 32);
|
||||
|
||||
|
||||
cursetting = setting_config_alloc(curfield, defval & curfield->mask, input_port_string_from_token(*ipt++));
|
||||
break;
|
||||
|
||||
@ -2590,7 +2590,7 @@ static input_port_config *port_config_detokenize(input_port_config *listhead, co
|
||||
|
||||
TOKEN_UNGET_UINT32(ipt);
|
||||
TOKEN_GET_UINT64_UNPACK2(ipt, entrytype, 8, defval, 32);
|
||||
|
||||
|
||||
cursetting = setting_config_alloc(curfield, defval & curfield->mask, input_port_string_from_token(*ipt++));
|
||||
break;
|
||||
|
||||
@ -2614,7 +2614,7 @@ static input_port_config *port_config_detokenize(input_port_config *listhead, co
|
||||
|
||||
TOKEN_UNGET_UINT32(ipt);
|
||||
TOKEN_GET_UINT64_UNPACK2(ipt, entrytype, 8, defval, 32);
|
||||
|
||||
|
||||
cursetting = setting_config_alloc(curfield, defval & curfield->mask, input_port_string_from_token(*ipt++));
|
||||
break;
|
||||
|
||||
@ -2625,7 +2625,7 @@ static input_port_config *port_config_detokenize(input_port_config *listhead, co
|
||||
|
||||
TOKEN_UNGET_UINT32(ipt);
|
||||
TOKEN_GET_UINT64_UNPACK2(ipt, entrytype, 8, defval, 32);
|
||||
|
||||
|
||||
curfield = field_config_alloc(curport, IPT_ADJUSTER, defval, 0xff);
|
||||
cursetting = NULL;
|
||||
|
||||
@ -2637,7 +2637,7 @@ static input_port_config *port_config_detokenize(input_port_config *listhead, co
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return listhead;
|
||||
}
|
||||
|
||||
@ -2652,15 +2652,15 @@ static input_port_config *port_config_alloc(const input_port_config **listhead)
|
||||
{
|
||||
const input_port_config * const *tailptr;
|
||||
input_port_config *config;
|
||||
|
||||
|
||||
/* allocate memory */
|
||||
config = malloc_or_die(sizeof(*config));
|
||||
memset(config, 0, sizeof(*config));
|
||||
|
||||
|
||||
/* add it to the tail */
|
||||
for (tailptr = listhead; *tailptr != NULL; tailptr = &(*tailptr)->next) ;
|
||||
*(input_port_config **)tailptr = config;
|
||||
|
||||
|
||||
return config;
|
||||
}
|
||||
|
||||
@ -2673,14 +2673,14 @@ static input_port_config *port_config_alloc(const input_port_config **listhead)
|
||||
static void port_config_free(const input_port_config **portptr)
|
||||
{
|
||||
input_port_config *port = (input_port_config *)*portptr;
|
||||
|
||||
|
||||
/* free any field configs first */
|
||||
while (port->fieldlist != NULL)
|
||||
field_config_free((input_field_config **)&port->fieldlist);
|
||||
|
||||
|
||||
/* remove ourself from the list */
|
||||
*portptr = port->next;
|
||||
|
||||
|
||||
/* free ourself */
|
||||
free(port);
|
||||
}
|
||||
@ -2699,7 +2699,7 @@ static input_port_config *port_config_find(const input_port_config *listhead, co
|
||||
for (scanport = listhead; scanport != NULL; scanport = scanport->next)
|
||||
if (scanport->tag != NULL && strcmp(scanport->tag, tag) == 0)
|
||||
return (input_port_config *)scanport;
|
||||
|
||||
|
||||
/* failure is fatal */
|
||||
fatalerror("port_config_find failed to find a matching port '%s'", tag);
|
||||
}
|
||||
@ -2729,7 +2729,7 @@ static input_field_config *field_config_alloc(input_port_config *port, int type,
|
||||
/* reduce the mask of the field we found */
|
||||
config = (input_field_config *)*scanfieldptr;
|
||||
config->mask &= ~maskbits;
|
||||
|
||||
|
||||
/* if the new entry fully overrides the previous one, we nuke */
|
||||
if (config->mask == 0)
|
||||
{
|
||||
@ -2738,15 +2738,15 @@ static input_field_config *field_config_alloc(input_port_config *port, int type,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* make a mask of just the low bit */
|
||||
lowbit = (maskbits ^ (maskbits - 1)) & maskbits;
|
||||
|
||||
|
||||
/* scan forward to find where to insert ourselves */
|
||||
for (scanfieldptr = (const input_field_config * const *)&port->fieldlist; *scanfieldptr != NULL; scanfieldptr = &(*scanfieldptr)->next)
|
||||
if ((*scanfieldptr)->mask > lowbit)
|
||||
break;
|
||||
|
||||
|
||||
/* allocate memory */
|
||||
config = malloc_or_die(sizeof(*config));
|
||||
memset(config, 0, sizeof(*config));
|
||||
@ -2759,11 +2759,11 @@ static input_field_config *field_config_alloc(input_port_config *port, int type,
|
||||
config->max = maskbits;
|
||||
for (seqtype = 0; seqtype < ARRAY_LENGTH(config->seq); seqtype++)
|
||||
input_seq_set_1(&config->seq[seqtype], SEQCODE_DEFAULT);
|
||||
|
||||
|
||||
/* insert it into the list */
|
||||
config->next = *scanfieldptr;
|
||||
*(input_field_config **)scanfieldptr = config;
|
||||
|
||||
|
||||
return config;
|
||||
}
|
||||
|
||||
@ -2776,16 +2776,16 @@ static input_field_config *field_config_alloc(input_port_config *port, int type,
|
||||
static void field_config_free(input_field_config **fieldptr)
|
||||
{
|
||||
input_field_config *field = *fieldptr;
|
||||
|
||||
|
||||
/* free any settings and DIP locations first */
|
||||
while (field->settinglist != NULL)
|
||||
setting_config_free((input_setting_config **)&field->settinglist);
|
||||
while (field->diploclist != NULL)
|
||||
diplocation_free((input_field_diplocation **)&field->diploclist);
|
||||
|
||||
|
||||
/* remove ourself from the list */
|
||||
*fieldptr = (input_field_config *)field->next;
|
||||
|
||||
|
||||
/* free ourself */
|
||||
free(field);
|
||||
}
|
||||
@ -2801,20 +2801,20 @@ static input_setting_config *setting_config_alloc(input_field_config *field, inp
|
||||
{
|
||||
const input_setting_config * const *tailptr;
|
||||
input_setting_config *config;
|
||||
|
||||
|
||||
/* allocate memory */
|
||||
config = malloc_or_die(sizeof(*config));
|
||||
memset(config, 0, sizeof(*config));
|
||||
|
||||
|
||||
/* fill in the basic setting values */
|
||||
config->field = field;
|
||||
config->value = value;
|
||||
config->name = name;
|
||||
|
||||
|
||||
/* add it to the tail */
|
||||
for (tailptr = &field->settinglist; *tailptr != NULL; tailptr = &(*tailptr)->next) ;
|
||||
*(input_setting_config **)tailptr = config;
|
||||
|
||||
|
||||
return config;
|
||||
}
|
||||
|
||||
@ -2827,10 +2827,10 @@ static input_setting_config *setting_config_alloc(input_field_config *field, inp
|
||||
static void setting_config_free(input_setting_config **settingptr)
|
||||
{
|
||||
input_setting_config *setting = (input_setting_config *)*settingptr;
|
||||
|
||||
|
||||
/* remove ourself from the list */
|
||||
*settingptr = (input_setting_config *)setting->next;
|
||||
|
||||
|
||||
/* free ourself */
|
||||
free(setting);
|
||||
}
|
||||
@ -2838,7 +2838,7 @@ static void setting_config_free(input_setting_config **settingptr)
|
||||
|
||||
/*-------------------------------------------------
|
||||
diplocation_expand - expand a string-based
|
||||
DIP location into a linked list of
|
||||
DIP location into a linked list of
|
||||
descriptions
|
||||
-------------------------------------------------*/
|
||||
|
||||
@ -2861,7 +2861,7 @@ static const input_field_diplocation *diplocation_list_alloc(const input_field_c
|
||||
while (*curentry != 0)
|
||||
{
|
||||
const char *comma, *colon, *number;
|
||||
|
||||
|
||||
/* allocate a new entry */
|
||||
*tailptr = malloc_or_die(sizeof(**tailptr));
|
||||
memset(*tailptr, 0, sizeof(**tailptr));
|
||||
@ -2879,7 +2879,7 @@ static const input_field_diplocation *diplocation_list_alloc(const input_field_c
|
||||
/* first extract the switch name if present */
|
||||
number = tempbuf;
|
||||
colon = strchr(tempbuf, ':');
|
||||
|
||||
|
||||
/* allocate and copy the name if it is present */
|
||||
if (colon != NULL)
|
||||
{
|
||||
@ -2888,7 +2888,7 @@ static const input_field_diplocation *diplocation_list_alloc(const input_field_c
|
||||
lastname[colon - tempbuf] = 0;
|
||||
number = colon + 1;
|
||||
}
|
||||
|
||||
|
||||
/* otherwise, just copy the last name */
|
||||
else
|
||||
{
|
||||
@ -2936,14 +2936,14 @@ static const input_field_diplocation *diplocation_list_alloc(const input_field_c
|
||||
static void diplocation_free(input_field_diplocation **diplocptr)
|
||||
{
|
||||
input_field_diplocation *diploc = (input_field_diplocation *)*diplocptr;
|
||||
|
||||
|
||||
/* free the name */
|
||||
if (diploc->swname != NULL)
|
||||
free((void *)diploc->swname);
|
||||
|
||||
|
||||
/* remove ourself from the list */
|
||||
*diplocptr = (input_field_diplocation *)diploc->next;
|
||||
|
||||
|
||||
/* free ourself */
|
||||
free(diploc);
|
||||
}
|
||||
@ -3092,7 +3092,7 @@ static void load_config_callback(running_machine *machine, int config_type, xml_
|
||||
{
|
||||
input_type_state *typestate;
|
||||
int seqtype;
|
||||
|
||||
|
||||
for (typestate = portdata->typestatelist; typestate != NULL; typestate = typestate->next)
|
||||
for (seqtype = 0; seqtype < ARRAY_LENGTH(typestate->typedesc.seq); seqtype++)
|
||||
typestate->typedesc.seq[seqtype] = typestate->seq[seqtype];
|
||||
@ -3208,14 +3208,14 @@ static int load_game_config(running_machine *machine, xml_data_node *portnode, i
|
||||
tag = xml_get_attribute_string(portnode, "port", NULL);
|
||||
mask = xml_get_attribute_int(portnode, "mask", 0);
|
||||
defvalue = xml_get_attribute_int(portnode, "defvalue", 0);
|
||||
|
||||
|
||||
/* find the port we want; if no tag, search them all */
|
||||
for (port = machine->portconfig; port != NULL; port = port->next)
|
||||
if (tag == NULL || (port->tag != NULL && strcmp(port->tag, tag) == 0))
|
||||
for (field = port->fieldlist; field != NULL; field = field->next)
|
||||
|
||||
/* find the matching mask and defvalue */
|
||||
if (field->type == type && field->player == player &&
|
||||
if (field->type == type && field->player == player &&
|
||||
field->mask == mask && (field->defvalue & mask) == (defvalue & mask))
|
||||
{
|
||||
const char *revstring;
|
||||
@ -3256,7 +3256,7 @@ static int load_game_config(running_machine *machine, xml_data_node *portnode, i
|
||||
***************************************************************************/
|
||||
|
||||
/*-------------------------------------------------
|
||||
save_config_callback - config callback for
|
||||
save_config_callback - config callback for
|
||||
saving input port configuration
|
||||
-------------------------------------------------*/
|
||||
|
||||
@ -3335,7 +3335,7 @@ static void save_default_inputs(running_machine *machine, xml_data_node *parentn
|
||||
if (save_this_input_field_type(typestate->typedesc.type))
|
||||
{
|
||||
int seqtype;
|
||||
|
||||
|
||||
/* see if any of the sequences have changed */
|
||||
for (seqtype = 0; seqtype < ARRAY_LENGTH(typestate->seq); seqtype++)
|
||||
if (input_seq_cmp(&typestate->seq[seqtype], &typestate->typedesc.seq[seqtype]) != 0)
|
||||
@ -3379,11 +3379,11 @@ static void save_game_inputs(running_machine *machine, xml_data_node *parentnode
|
||||
{
|
||||
int changed = FALSE;
|
||||
int seqtype;
|
||||
|
||||
|
||||
/* determine if we changed */
|
||||
for (seqtype = 0; seqtype < ARRAY_LENGTH(field->state->seq); seqtype++)
|
||||
changed |= (input_seq_cmp(&field->state->seq[seqtype], &field->seq[seqtype]) != 0);
|
||||
|
||||
|
||||
/* non-analog changes */
|
||||
if (field->state->analog == NULL)
|
||||
changed |= ((field->state->value & field->mask) != (field->defvalue & field->mask));
|
||||
@ -3396,7 +3396,7 @@ static void save_game_inputs(running_machine *machine, xml_data_node *parentnode
|
||||
changed |= (field->state->analog->sensitivity != field->sensitivity);
|
||||
changed |= (field->state->analog->reverse != ((field->flags & ANALOG_FLAG_REVERSE) != 0));
|
||||
}
|
||||
|
||||
|
||||
/* if we did change, add a new node */
|
||||
if (changed)
|
||||
{
|
||||
|
@ -1581,7 +1581,7 @@ static void memory_init_populate(running_machine *machine)
|
||||
}
|
||||
space_map_range_private(space, ROW_READ, bits, entry->read_mask, entry->addrstart, entry->addrend, entry->addrmask, entry->addrmirror, rhandler.generic, object, entry->read_name);
|
||||
}
|
||||
|
||||
|
||||
/* install the write handler if present */
|
||||
if (whandler.generic != NULL)
|
||||
{
|
||||
|
@ -543,7 +543,7 @@ void tms5110_process(void *chip, INT16 *buffer, unsigned int size)
|
||||
tms->target_k[i] = tms->new_k[i];
|
||||
}
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
interp_period = tms->sample_count / 25;
|
||||
switch(tms->interp_count)
|
||||
|
@ -597,7 +597,7 @@ tryagain:
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
interp_period = tms->sample_count / 25;
|
||||
switch(tms->interp_count)
|
||||
|
@ -1732,7 +1732,7 @@ static INT32 slider_adjuster(running_machine *machine, INT32 newval, char *buffe
|
||||
{
|
||||
const input_field_config *field = arg;
|
||||
input_field_user_settings settings;
|
||||
|
||||
|
||||
input_field_get_user_settings(field, &settings);
|
||||
if (buffer != NULL)
|
||||
{
|
||||
|
@ -583,7 +583,7 @@ static void gfxset_handler(running_machine *machine, ui_gfx_state *state)
|
||||
|
||||
|
||||
/*-------------------------------------------------
|
||||
gfxset_handle_keys - handle keys for the
|
||||
gfxset_handle_keys - handle keys for the
|
||||
graphics viewer
|
||||
-------------------------------------------------*/
|
||||
|
||||
|
@ -1011,7 +1011,7 @@ static UINT32 menu_input(running_machine *machine, UINT32 state)
|
||||
if (selected != prevsel)
|
||||
record_next = FALSE;
|
||||
}
|
||||
|
||||
|
||||
/* if the sequence changed, update it */
|
||||
if (changed)
|
||||
{
|
||||
@ -1208,7 +1208,7 @@ static UINT32 menu_analog(running_machine *machine, UINT32 state)
|
||||
if (delta != 0 && selected_field != NULL)
|
||||
{
|
||||
input_field_user_settings settings;
|
||||
|
||||
|
||||
input_field_get_user_settings(selected_field, &settings);
|
||||
switch (selected_item)
|
||||
{
|
||||
@ -2098,7 +2098,7 @@ static void switches_menu_select_previous(const input_field_config *field)
|
||||
const input_setting_config *setting, *prevsetting;
|
||||
input_field_user_settings settings;
|
||||
int found_match = FALSE;
|
||||
|
||||
|
||||
/* get the current configured settings */
|
||||
input_field_get_user_settings(field, &settings);
|
||||
|
||||
@ -2115,7 +2115,7 @@ static void switches_menu_select_previous(const input_field_config *field)
|
||||
if (input_condition_true(field->port->machine, &setting->condition))
|
||||
prevsetting = setting;
|
||||
}
|
||||
|
||||
|
||||
/* if we didn't find a matching value, select the first */
|
||||
if (!found_match)
|
||||
{
|
||||
@ -2123,7 +2123,7 @@ static void switches_menu_select_previous(const input_field_config *field)
|
||||
if (input_condition_true(field->port->machine, &prevsetting->condition))
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
/* update the value to the previous one */
|
||||
if (prevsetting != NULL)
|
||||
settings.value = prevsetting->value;
|
||||
@ -2140,7 +2140,7 @@ static void switches_menu_select_next(const input_field_config *field)
|
||||
{
|
||||
const input_setting_config *setting, *nextsetting;
|
||||
input_field_user_settings settings;
|
||||
|
||||
|
||||
/* get the current configured settings */
|
||||
input_field_get_user_settings(field, &settings);
|
||||
|
||||
@ -2149,19 +2149,19 @@ static void switches_menu_select_next(const input_field_config *field)
|
||||
for (setting = field->settinglist; setting != NULL; setting = setting->next)
|
||||
if (setting->value == settings.value)
|
||||
break;
|
||||
|
||||
|
||||
/* if we found one, scan forward for the next valid one */
|
||||
if (setting != NULL)
|
||||
for (nextsetting = setting->next; nextsetting != NULL; nextsetting = nextsetting->next)
|
||||
if (input_condition_true(field->port->machine, &nextsetting->condition))
|
||||
break;
|
||||
|
||||
|
||||
/* if we hit the end, search from the beginning */
|
||||
if (nextsetting == NULL)
|
||||
for (nextsetting = field->settinglist; nextsetting != NULL; nextsetting = nextsetting->next)
|
||||
if (input_condition_true(field->port->machine, &nextsetting->condition))
|
||||
break;
|
||||
|
||||
|
||||
/* update the value to the previous one */
|
||||
if (nextsetting != NULL)
|
||||
settings.value = nextsetting->value;
|
||||
@ -2243,7 +2243,7 @@ static void dip_switch_build_model(const input_field_config *field, int item_is_
|
||||
diploc = field->diploclist;
|
||||
if (diploc == NULL || diploc->swname == NULL)
|
||||
return;
|
||||
|
||||
|
||||
input_field_get_user_settings(field, &settings);
|
||||
|
||||
/* get the entry in the model to work with */
|
||||
|
@ -957,7 +957,7 @@ static int get_defstr_index(const char *name, const game_driver *driver, int *er
|
||||
UINT32 crc = quark_string_crc(name);
|
||||
quark_entry *entry;
|
||||
int strindex = 0;
|
||||
|
||||
|
||||
/* scan the quark table of input port strings */
|
||||
for (entry = quark_table_get_first(defstr_table, crc); entry != NULL; entry = entry->next)
|
||||
if (entry->crc == crc && strcmp(name, input_port_string_from_index(entry - defstr_table->entry)) == 0)
|
||||
@ -972,13 +972,13 @@ static int get_defstr_index(const char *name, const game_driver *driver, int *er
|
||||
mame_printf_error("%s: %s must use DEF_STR( %s )\n", driver->source_file, driver->name, name);
|
||||
*error = TRUE;
|
||||
}
|
||||
|
||||
|
||||
return strindex;
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------
|
||||
validate_analog_input_field - validate an
|
||||
validate_analog_input_field - validate an
|
||||
analog input field
|
||||
-------------------------------------------------*/
|
||||
|
||||
@ -1098,12 +1098,12 @@ static void validate_dip_settings(const input_field_config *field, const game_dr
|
||||
UINT8 coin_list[INPUT_STRING_1C_9C + 1 - INPUT_STRING_9C_1C] = { 0 };
|
||||
const input_setting_config *setting;
|
||||
int coin_error = FALSE;
|
||||
|
||||
|
||||
/* iterate through the settings */
|
||||
for (setting = field->settinglist; setting != NULL; setting = setting->next)
|
||||
{
|
||||
int strindex = get_defstr_index(setting->name, driver, error);
|
||||
|
||||
|
||||
/* note any coinage strings */
|
||||
if (strindex >= INPUT_STRING_9C_1C && strindex <= INPUT_STRING_1C_9C)
|
||||
coin_list[strindex - INPUT_STRING_9C_1C] = 1;
|
||||
@ -1164,12 +1164,12 @@ static void validate_dip_settings(const input_field_config *field, const game_dr
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* if we have a coin error, demonstrate the correct way */
|
||||
if (coin_error)
|
||||
{
|
||||
int entry;
|
||||
|
||||
|
||||
mame_printf_error("%s: %s proper coin sort order should be:\n", driver->source_file, driver->name);
|
||||
for (entry = 0; entry < ARRAY_LENGTH(coin_list); entry++)
|
||||
if (coin_list[entry])
|
||||
@ -1225,7 +1225,7 @@ static int validate_inputs(int drivnum, const machine_config *config)
|
||||
for (field = port->fieldlist; field != NULL; field = field->next)
|
||||
{
|
||||
int strindex = 0;
|
||||
|
||||
|
||||
/* verify analog inputs */
|
||||
if (input_type_is_analog(field->type))
|
||||
validate_analog_input_field(field, driver, &error);
|
||||
@ -1239,11 +1239,11 @@ static int validate_inputs(int drivnum, const machine_config *config)
|
||||
mame_printf_error("%s: %s has a DIP switch name or setting with no name\n", driver->source_file, driver->name);
|
||||
error = TRUE;
|
||||
}
|
||||
|
||||
|
||||
/* verify the settings list */
|
||||
validate_dip_settings(field, driver, &error);
|
||||
}
|
||||
|
||||
|
||||
/* look for invalid (0) types which should be mapped to IPT_OTHER */
|
||||
if (field->type == IPT_INVALID)
|
||||
{
|
||||
@ -1279,7 +1279,7 @@ static int validate_inputs(int drivnum, const machine_config *config)
|
||||
strindex = get_defstr_index(field->name, driver, &error);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* free the config */
|
||||
input_port_config_free(portlist);
|
||||
return error;
|
||||
|
@ -28,7 +28,7 @@
|
||||
|
||||
driver by Pierpaolo Prazzoli & Tomasz Slanina
|
||||
|
||||
- Pierpaolo Prazzoli 2006.05.06
|
||||
- Pierpaolo Prazzoli 2006.05.06
|
||||
- added Fishing Maniac 3
|
||||
|
||||
- Pierpaolo Prazzoli 2006.01.16
|
||||
|
@ -655,7 +655,7 @@ static INPUT_PORTS_START( tm )
|
||||
PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_COIN1 ) // "E. Coin 1" (ECA?) tmaster defaults to e. coin,
|
||||
PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_COIN2 ) // "E. Coin 2" (ECA?) rather than m. coin
|
||||
PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_COIN3 ) // "E. Coin 3" (ECA?) so they're coin1-coin4
|
||||
PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_COIN4 ) // "E. Coin 4" (ECA?)
|
||||
PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_COIN4 ) // "E. Coin 4" (ECA?)
|
||||
INPUT_PORTS_END
|
||||
|
||||
static INPUT_PORTS_START( tmaster )
|
||||
|
@ -80,11 +80,11 @@ Palette related:
|
||||
* 2xMS6264A-20NC (8KB SRAM) @ C8 & C9 (palette RAM (xxxxBBBBRRRRGGGG))
|
||||
* 2x74HCT273 (octal D-Type flip-flop with clear) @ B8 & B9 (connected to RGB output)
|
||||
|
||||
Controls related: (added by Mirko Mattioli)
|
||||
Controls related: (added by Mirko Mattioli)
|
||||
=================
|
||||
When optical wheel is selected (via dipswitch), then gear shift (low/high) is enabled.
|
||||
On the real PCB the optical wheel encoder is connected to 74LS169 ICs (@A16 and @A17)
|
||||
via a flip-flop IC mounted in the steering wheel assembly. As a result, the output
|
||||
via a flip-flop IC mounted in the steering wheel assembly. As a result, the output
|
||||
of the flip-flop generates a signal that contains the information about the steering
|
||||
direction; this signal is routed to pin #1 (U/D) at ICs A16 and A17 (high when turn
|
||||
left and low when turn right). The second signal of the optical encoder goes directly
|
||||
|
@ -155,11 +155,11 @@ UpdatePalette(running_machine *machine, int offset )
|
||||
{
|
||||
UINT16 data = paletteram16[offset]; /* -RRRRRGG GGGBBBBB */
|
||||
/**
|
||||
* sprites can be configured to use an alternate interpretation of palette ram
|
||||
* (used in-game in Emeraldia)
|
||||
*
|
||||
* RRRGGGBB RRRGGGBB
|
||||
*/
|
||||
* sprites can be configured to use an alternate interpretation of palette ram
|
||||
* (used in-game in Emeraldia)
|
||||
*
|
||||
* RRRGGGBB RRRGGGBB
|
||||
*/
|
||||
int r = (((data&0x00e0)>>5)+((data&0xe000)>>13)*2)*0xff/(0x7*3);
|
||||
int g = (((data&0x001c)>>2)+((data&0x1c00)>>10)*2)*0xff/(0x7*3);
|
||||
int b = (((data&0x0003)>>0)+((data&0x0300)>>8)*2)*0xff/(0x3*3);
|
||||
|
@ -705,7 +705,7 @@ BOOL wininput_handle_raw(HANDLE device)
|
||||
void osd_customize_input_type_list(input_type_desc *typelist)
|
||||
{
|
||||
input_type_desc *typedesc;
|
||||
|
||||
|
||||
// loop over the defaults
|
||||
for (typedesc = typelist; typedesc != NULL; typedesc = typedesc->next)
|
||||
switch (typedesc->type)
|
||||
|
@ -9,4 +9,4 @@
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
const char build_version[] = "0.125u1 ("__DATE__")";
|
||||
const char build_version[] = "0.125u2 ("__DATE__")";
|
||||
|
Loading…
Reference in New Issue
Block a user