Another big one.
Moved memory global state into a struct hanging off of the machine. Updated almost all memory APIs to take an address_space * where appropriate, and updated all callers. Changed memory internals to use address spaces where appropriate. Changed accessors to point to the memory_* functions instead of the address space-specific functions. Improved internal handling of watchpoints. Added cputag_* functions: cputag_reset(), cputag_get_index(), cputag_get_address_space(). These just expand via macros to an initial fetch of the CPU via cputag_get_cpu() followed by the standard CPU call. Added debugger_interrupt_hook() and debugger_exception_hook() calls which intelligently look at the debugger flags before calling. Did minimal cleanup of debugger, mainly moving CPU-specific data to hang off of the CPU classdata for more direct access.
This commit is contained in:
parent
e9b33a8462
commit
371cd0a56d
@ -754,43 +754,43 @@ static int drcbec_execute(drcbe_state *drcbe, drcuml_codehandle *entry)
|
||||
break;
|
||||
|
||||
case MAKE_OPCODE_SHORT(DRCUML_OP_READ1, 4, 0): /* READ dst,src1,space_BYTE */
|
||||
PARAM0 = (UINT8)(*active_address_space[PARAM2 / 16]->accessors.read_byte)(PARAM1);
|
||||
PARAM0 = memory_read_byte(active_address_space[PARAM2 / 16], PARAM1);
|
||||
break;
|
||||
|
||||
case MAKE_OPCODE_SHORT(DRCUML_OP_READ2, 4, 0): /* READ dst,src1,space_WORD */
|
||||
PARAM0 = (UINT16)(*active_address_space[PARAM2 / 16]->accessors.read_word)(PARAM1);
|
||||
PARAM0 = memory_read_word(active_address_space[PARAM2 / 16], PARAM1);
|
||||
break;
|
||||
|
||||
case MAKE_OPCODE_SHORT(DRCUML_OP_READ4, 4, 0): /* READ dst,src1,space_DWORD */
|
||||
PARAM0 = (UINT32)(*active_address_space[PARAM2 / 16]->accessors.read_dword)(PARAM1);
|
||||
PARAM0 = memory_read_dword(active_address_space[PARAM2 / 16], PARAM1);
|
||||
break;
|
||||
|
||||
case MAKE_OPCODE_SHORT(DRCUML_OP_READM2, 4, 0): /* READM dst,src1,mask,space_WORD */
|
||||
PARAM0 = (UINT16)(*active_address_space[PARAM3 / 16]->accessors.read_word_masked)(PARAM1, PARAM2);
|
||||
PARAM0 = memory_read_word_masked(active_address_space[PARAM3 / 16], PARAM1, PARAM2);
|
||||
break;
|
||||
|
||||
case MAKE_OPCODE_SHORT(DRCUML_OP_READM4, 4, 0): /* READM dst,src1,mask,space_DWORD */
|
||||
PARAM0 = (UINT32)(*active_address_space[PARAM3 / 16]->accessors.read_dword_masked)(PARAM1, PARAM2);
|
||||
PARAM0 = memory_read_dword_masked(active_address_space[PARAM3 / 16], PARAM1, PARAM2);
|
||||
break;
|
||||
|
||||
case MAKE_OPCODE_SHORT(DRCUML_OP_WRITE1, 4, 0): /* WRITE dst,src1,space_BYTE */
|
||||
(*active_address_space[PARAM2 / 16]->accessors.write_byte)(PARAM0, PARAM1);
|
||||
memory_write_byte(active_address_space[PARAM2 / 16], PARAM0, PARAM1);
|
||||
break;
|
||||
|
||||
case MAKE_OPCODE_SHORT(DRCUML_OP_WRITE2, 4, 0): /* WRITE dst,src1,space_WORD */
|
||||
(*active_address_space[PARAM2 / 16]->accessors.write_word)(PARAM0, PARAM1);
|
||||
memory_write_word(active_address_space[PARAM2 / 16], PARAM0, PARAM1);
|
||||
break;
|
||||
|
||||
case MAKE_OPCODE_SHORT(DRCUML_OP_WRITE4, 4, 0): /* WRITE dst,src1,space_DWORD */
|
||||
(*active_address_space[PARAM2 / 16]->accessors.write_dword)(PARAM0, PARAM1);
|
||||
memory_write_dword(active_address_space[PARAM2 / 16], PARAM0, PARAM1);
|
||||
break;
|
||||
|
||||
case MAKE_OPCODE_SHORT(DRCUML_OP_WRITEM2, 4, 0): /* WRITEM dst,src1,mask,space_WORD */
|
||||
(*active_address_space[PARAM3 / 16]->accessors.write_word_masked)(PARAM0, PARAM1, PARAM2);
|
||||
memory_write_word_masked(active_address_space[PARAM3 / 16], PARAM0, PARAM1, PARAM2);
|
||||
break;
|
||||
|
||||
case MAKE_OPCODE_SHORT(DRCUML_OP_WRITEM4, 4, 0): /* WRITEM dst,src1,mask,space_DWORD */
|
||||
(*active_address_space[PARAM3 / 16]->accessors.write_dword_masked)(PARAM0, PARAM1, PARAM2);
|
||||
memory_write_dword_masked(active_address_space[PARAM3 / 16], PARAM0, PARAM1, PARAM2);
|
||||
break;
|
||||
|
||||
case MAKE_OPCODE_SHORT(DRCUML_OP_CARRY, 4, 1): /* CARRY src,bitnum */
|
||||
@ -1185,59 +1185,59 @@ static int drcbec_execute(drcbe_state *drcbe, drcuml_codehandle *entry)
|
||||
break;
|
||||
|
||||
case MAKE_OPCODE_SHORT(DRCUML_OP_READ1, 8, 0): /* DREAD dst,src1,space_BYTE */
|
||||
DPARAM0 = (UINT8)(*active_address_space[PARAM2 / 16]->accessors.read_byte)(PARAM1);
|
||||
DPARAM0 = memory_read_byte(active_address_space[PARAM2 / 16], PARAM1);
|
||||
break;
|
||||
|
||||
case MAKE_OPCODE_SHORT(DRCUML_OP_READ2, 8, 0): /* DREAD dst,src1,space_WORD */
|
||||
DPARAM0 = (UINT16)(*active_address_space[PARAM2 / 16]->accessors.read_word)(PARAM1);
|
||||
DPARAM0 = memory_read_word(active_address_space[PARAM2 / 16], PARAM1);
|
||||
break;
|
||||
|
||||
case MAKE_OPCODE_SHORT(DRCUML_OP_READ4, 8, 0): /* DREAD dst,src1,space_DWORD */
|
||||
DPARAM0 = (UINT32)(*active_address_space[PARAM2 / 16]->accessors.read_dword)(PARAM1);
|
||||
DPARAM0 = memory_read_dword(active_address_space[PARAM2 / 16], PARAM1);
|
||||
break;
|
||||
|
||||
case MAKE_OPCODE_SHORT(DRCUML_OP_READ8, 8, 0): /* DREAD dst,src1,space_QOWRD */
|
||||
DPARAM0 = (UINT64)(*active_address_space[PARAM2 / 16]->accessors.read_qword)(PARAM1);
|
||||
DPARAM0 = memory_read_qword(active_address_space[PARAM2 / 16], PARAM1);
|
||||
break;
|
||||
|
||||
case MAKE_OPCODE_SHORT(DRCUML_OP_READM2, 8, 0): /* DREADM dst,src1,mask,space_WORD */
|
||||
DPARAM0 = (UINT16)(*active_address_space[PARAM3 / 16]->accessors.read_word_masked)(PARAM1, PARAM2);
|
||||
DPARAM0 = memory_read_word_masked(active_address_space[PARAM3 / 16], PARAM1, PARAM2);
|
||||
break;
|
||||
|
||||
case MAKE_OPCODE_SHORT(DRCUML_OP_READM4, 8, 0): /* DREADM dst,src1,mask,space_DWORD */
|
||||
DPARAM0 = (UINT32)(*active_address_space[PARAM3 / 16]->accessors.read_dword_masked)(PARAM1, PARAM2);
|
||||
DPARAM0 = memory_read_dword_masked(active_address_space[PARAM3 / 16], PARAM1, PARAM2);
|
||||
break;
|
||||
|
||||
case MAKE_OPCODE_SHORT(DRCUML_OP_READM8, 8, 0): /* DREADM dst,src1,mask,space_QWORD */
|
||||
DPARAM0 = (UINT64)(*active_address_space[PARAM3 / 16]->accessors.read_qword_masked)(PARAM1, PARAM2);
|
||||
DPARAM0 = memory_read_qword_masked(active_address_space[PARAM3 / 16], PARAM1, PARAM2);
|
||||
break;
|
||||
|
||||
case MAKE_OPCODE_SHORT(DRCUML_OP_WRITE1, 8, 0): /* DWRITE dst,src1,space_BYTE */
|
||||
(*active_address_space[PARAM2 / 16]->accessors.write_byte)(PARAM0, PARAM1);
|
||||
memory_write_byte(active_address_space[PARAM2 / 16], PARAM0, PARAM1);
|
||||
break;
|
||||
|
||||
case MAKE_OPCODE_SHORT(DRCUML_OP_WRITE2, 8, 0): /* DWRITE dst,src1,space_WORD */
|
||||
(*active_address_space[PARAM2 / 16]->accessors.write_word)(PARAM0, PARAM1);
|
||||
memory_write_word(active_address_space[PARAM2 / 16], PARAM0, PARAM1);
|
||||
break;
|
||||
|
||||
case MAKE_OPCODE_SHORT(DRCUML_OP_WRITE4, 8, 0): /* DWRITE dst,src1,space_DWORD */
|
||||
(*active_address_space[PARAM2 / 16]->accessors.write_dword)(PARAM0, PARAM1);
|
||||
memory_write_dword(active_address_space[PARAM2 / 16], PARAM0, PARAM1);
|
||||
break;
|
||||
|
||||
case MAKE_OPCODE_SHORT(DRCUML_OP_WRITE8, 8, 0): /* DWRITE dst,src1,space_QWORD */
|
||||
(*active_address_space[PARAM2 / 16]->accessors.write_qword)(PARAM0, DPARAM1);
|
||||
memory_write_qword(active_address_space[PARAM2 / 16], PARAM0, DPARAM1);
|
||||
break;
|
||||
|
||||
case MAKE_OPCODE_SHORT(DRCUML_OP_WRITEM2, 8, 0): /* DWRITEM dst,src1,mask,space_WORD */
|
||||
(*active_address_space[PARAM3 / 16]->accessors.write_word_masked)(PARAM0, DPARAM1, DPARAM2);
|
||||
memory_write_word_masked(active_address_space[PARAM3 / 16], PARAM0, DPARAM1, DPARAM2);
|
||||
break;
|
||||
|
||||
case MAKE_OPCODE_SHORT(DRCUML_OP_WRITEM4, 8, 0): /* DWRITEM dst,src1,mask,space_DWORD */
|
||||
(*active_address_space[PARAM3 / 16]->accessors.write_dword_masked)(PARAM0, DPARAM1, DPARAM2);
|
||||
memory_write_dword_masked(active_address_space[PARAM3 / 16], PARAM0, DPARAM1, DPARAM2);
|
||||
break;
|
||||
|
||||
case MAKE_OPCODE_SHORT(DRCUML_OP_WRITEM8, 8, 0): /* DWRITEM dst,src1,mask,space_QWORD */
|
||||
(*active_address_space[PARAM3 / 16]->accessors.write_qword_masked)(PARAM0, DPARAM1, DPARAM2);
|
||||
memory_write_qword_masked(active_address_space[PARAM3 / 16], PARAM0, DPARAM1, DPARAM2);
|
||||
break;
|
||||
|
||||
case MAKE_OPCODE_SHORT(DRCUML_OP_CARRY, 8, 0): /* DCARRY src,bitnum */
|
||||
@ -1598,11 +1598,11 @@ static int drcbec_execute(drcbe_state *drcbe, drcuml_codehandle *entry)
|
||||
break;
|
||||
|
||||
case MAKE_OPCODE_SHORT(DRCUML_OP_FREAD, 4, 0): /* FSREAD dst,src1,space */
|
||||
PARAM0 = (UINT32)(*active_address_space[PARAM2]->accessors.read_dword)(PARAM1);
|
||||
PARAM0 = memory_read_dword(active_address_space[PARAM2], PARAM1);
|
||||
break;
|
||||
|
||||
case MAKE_OPCODE_SHORT(DRCUML_OP_FWRITE, 4, 0): /* FSWRITE dst,src1,space */
|
||||
(*active_address_space[PARAM2]->accessors.write_dword)(PARAM0, PARAM1);
|
||||
memory_write_dword(active_address_space[PARAM2], PARAM0, PARAM1);
|
||||
break;
|
||||
|
||||
case MAKE_OPCODE_SHORT(DRCUML_OP_FMOV, 4, 1): /* FSMOV dst,src[,c] */
|
||||
@ -1733,11 +1733,11 @@ static int drcbec_execute(drcbe_state *drcbe, drcuml_codehandle *entry)
|
||||
break;
|
||||
|
||||
case MAKE_OPCODE_SHORT(DRCUML_OP_FREAD, 8, 0): /* FDREAD dst,src1,space */
|
||||
DPARAM0 = (UINT64)(*active_address_space[PARAM2]->accessors.read_qword)(PARAM1);
|
||||
DPARAM0 = memory_read_qword(active_address_space[PARAM2], PARAM1);
|
||||
break;
|
||||
|
||||
case MAKE_OPCODE_SHORT(DRCUML_OP_FWRITE, 8, 0): /* FDWRITE dst,src1,space */
|
||||
(*active_address_space[PARAM2]->accessors.write_qword)(PARAM0, DPARAM1);
|
||||
memory_write_qword(active_address_space[PARAM2], PARAM0, DPARAM1);
|
||||
break;
|
||||
|
||||
case MAKE_OPCODE_SHORT(DRCUML_OP_FMOV, 8, 1): /* FDMOV dst,src[,c] */
|
||||
|
@ -278,6 +278,7 @@ struct _drcbe_state
|
||||
x86code * debug_log_hashjmp; /* hashjmp debugging */
|
||||
x86code * drcmap_get_value; /* map lookup helper */
|
||||
data_accessors accessors[ADDRESS_SPACES];/* memory accessors */
|
||||
const address_space * space[ADDRESS_SPACES]; /* address spaces */
|
||||
|
||||
UINT8 sse41; /* do we have SSE4.1 support? */
|
||||
UINT32 ssemode; /* saved SSE mode */
|
||||
@ -706,6 +707,14 @@ static drcbe_state *drcbex64_alloc(drcuml_state *drcuml, drccache *cache, UINT32
|
||||
drcbe->cache = cache;
|
||||
drcbe->rbpvalue = drccache_near(cache) + 0x80;
|
||||
|
||||
/* get address spaces and accessors */
|
||||
for (spacenum = 0; spacenum < ADDRESS_SPACES; spacenum++)
|
||||
if (active_address_space[spacenum] != NULL)
|
||||
{
|
||||
drcbe->accessors[spacenum] = active_address_space[spacenum]->accessors;
|
||||
drcbe->space[spacenum] = active_address_space[spacenum];
|
||||
}
|
||||
|
||||
/* build up necessary arrays */
|
||||
memcpy(drcbe->ssecontrol, sse_control, sizeof(drcbe->ssecontrol));
|
||||
drcbe->absmask32 = drccache_memory_alloc_near(cache, 16*2 + 15);
|
||||
@ -795,12 +804,6 @@ static void drcbex64_reset(drcbe_state *drcbe)
|
||||
if (drcbe->log != NULL)
|
||||
x86log_printf(drcbe->log, "\n\n===========\nCACHE RESET\n===========\n\n");
|
||||
|
||||
/* fetch the accessors now that things are ready to go */
|
||||
/* FIXME: Not sure about this one */
|
||||
for (spacenum = 0; spacenum < ADDRESS_SPACES; spacenum++)
|
||||
if (active_address_space[spacenum] != NULL)
|
||||
drcbe->accessors[spacenum] = active_address_space[spacenum]->accessors;
|
||||
|
||||
/* generate a little bit of glue code to set up the environment */
|
||||
dst = (x86code **)drccache_begin_codegen(drcbe->cache, 500);
|
||||
if (dst == NULL)
|
||||
@ -4075,7 +4078,9 @@ static x86code *op_read(drcbe_state *drcbe, x86code *dst, const drcuml_instructi
|
||||
dstreg = param_select_register(REG_EAX, &dstp, NULL);
|
||||
|
||||
/* set up a call to the read byte handler */
|
||||
emit_mov_r32_p32(drcbe, &dst, REG_PARAM1, &addrp); // mov param1,addrp
|
||||
emit_mov_r64_m64(drcbe, &dst, REG_PARAM1, MBD(REG_RCX, offsetof(drcuml_machine_state, &drcbe->space[spacesizep.value / 16]));
|
||||
// mov param1,space
|
||||
emit_mov_r32_p32(drcbe, &dst, REG_PARAM2, &addrp); // mov param2,addrp
|
||||
if ((spacesizep.value & 3) == DRCUML_SIZE_BYTE)
|
||||
{
|
||||
emit_smart_call_m64(drcbe, &dst, (x86code **)&drcbe->accessors[spacesizep.value / 16].read_byte);
|
||||
@ -4134,11 +4139,13 @@ static x86code *op_readm(drcbe_state *drcbe, x86code *dst, const drcuml_instruct
|
||||
dstreg = param_select_register(REG_EAX, &dstp, NULL);
|
||||
|
||||
/* set up a call to the read byte handler */
|
||||
emit_mov_r32_p32(drcbe, &dst, REG_PARAM1, &addrp); // mov param1,addrp
|
||||
emit_mov_r64_m64(drcbe, &dst, REG_PARAM1, MBD(REG_RCX, offsetof(drcuml_machine_state, &drcbe->space[spacesizep.value / 16]));
|
||||
// mov param1,space
|
||||
emit_mov_r32_p32(drcbe, &dst, REG_PARAM2, &addrp); // mov param2,addrp
|
||||
if ((spacesizep.value & 3) != DRCUML_SIZE_QWORD)
|
||||
emit_mov_r32_p32(drcbe, &dst, REG_PARAM2, &maskp); // mov param2,maskp
|
||||
emit_mov_r32_p32(drcbe, &dst, REG_PARAM3, &maskp); // mov param3,maskp
|
||||
else
|
||||
emit_mov_r64_p64(drcbe, &dst, REG_PARAM2, &maskp); // mov param2,maskp
|
||||
emit_mov_r64_p64(drcbe, &dst, REG_PARAM3, &maskp); // mov param3,maskp
|
||||
if ((spacesizep.value & 3) == DRCUML_SIZE_WORD)
|
||||
{
|
||||
emit_smart_call_m64(drcbe, &dst, (x86code **)&drcbe->accessors[spacesizep.value / 16].read_word_masked);
|
||||
@ -4187,11 +4194,13 @@ static x86code *op_write(drcbe_state *drcbe, x86code *dst, const drcuml_instruct
|
||||
param_normalize_3(drcbe, inst, &addrp, PTYPE_MRI, &srcp, PTYPE_MRI, &spacesizep, PTYPE_I);
|
||||
|
||||
/* set up a call to the write byte handler */
|
||||
emit_mov_r32_p32(drcbe, &dst, REG_PARAM1, &addrp); // mov param1,addrp
|
||||
emit_mov_r64_m64(drcbe, &dst, REG_PARAM1, MBD(REG_RCX, offsetof(drcuml_machine_state, &drcbe->space[spacesizep.value / 16]));
|
||||
// mov param1,space
|
||||
emit_mov_r32_p32(drcbe, &dst, REG_PARAM2, &addrp); // mov param2,addrp
|
||||
if ((spacesizep.value & 3) != DRCUML_SIZE_QWORD)
|
||||
emit_mov_r32_p32(drcbe, &dst, REG_PARAM2, &srcp); // mov param1,srcp
|
||||
emit_mov_r32_p32(drcbe, &dst, REG_PARAM3, &srcp); // mov param3,srcp
|
||||
else
|
||||
emit_mov_r64_p64(drcbe, &dst, REG_PARAM2, &srcp); // mov param1,srcp
|
||||
emit_mov_r64_p64(drcbe, &dst, REG_PARAM3, &srcp); // mov param3,srcp
|
||||
if ((spacesizep.value & 3) == DRCUML_SIZE_BYTE)
|
||||
emit_smart_call_m64(drcbe, &dst, (x86code **)&drcbe->accessors[spacesizep.value / 16].write_byte);
|
||||
// call write_byte
|
||||
@ -4225,16 +4234,18 @@ static x86code *op_writem(drcbe_state *drcbe, x86code *dst, const drcuml_instruc
|
||||
param_normalize_4(drcbe, inst, &addrp, PTYPE_MRI, &srcp, PTYPE_MRI, &maskp, PTYPE_MRI, &spacesizep, PTYPE_I);
|
||||
|
||||
/* set up a call to the write byte handler */
|
||||
emit_mov_r32_p32(drcbe, &dst, REG_PARAM1, &addrp); // mov param1,addrp
|
||||
emit_mov_r64_m64(drcbe, &dst, REG_PARAM1, MBD(REG_RCX, offsetof(drcuml_machine_state, &drcbe->space[spacesizep.value / 16]));
|
||||
// mov param1,space
|
||||
emit_mov_r32_p32(drcbe, &dst, REG_PARAM1, &addrp); // mov param2,addrp
|
||||
if ((spacesizep.value & 3) != DRCUML_SIZE_QWORD)
|
||||
{
|
||||
emit_mov_r32_p32(drcbe, &dst, REG_PARAM2, &srcp); // mov param2,srcp
|
||||
emit_mov_r32_p32(drcbe, &dst, REG_PARAM3, &maskp); // mov param3,maskp
|
||||
emit_mov_r32_p32(drcbe, &dst, REG_PARAM3, &srcp); // mov param3,srcp
|
||||
emit_mov_r32_p32(drcbe, &dst, REG_PARAM4, &maskp); // mov param4,maskp
|
||||
}
|
||||
else
|
||||
{
|
||||
emit_mov_r64_p64(drcbe, &dst, REG_PARAM2, &srcp); // mov param2,srcp
|
||||
emit_mov_r64_p64(drcbe, &dst, REG_PARAM3, &maskp); // mov param3,maskp
|
||||
emit_mov_r64_p64(drcbe, &dst, REG_PARAM3, &srcp); // mov param3,srcp
|
||||
emit_mov_r64_p64(drcbe, &dst, REG_PARAM4, &maskp); // mov param4,maskp
|
||||
}
|
||||
if ((spacesizep.value & 3) == DRCUML_SIZE_WORD)
|
||||
emit_smart_call_m64(drcbe, &dst, (x86code **)&drcbe->accessors[spacesizep.value / 16].write_word_masked);
|
||||
@ -6220,7 +6231,9 @@ static x86code *op_fread(drcbe_state *drcbe, x86code *dst, const drcuml_instruct
|
||||
param_normalize_3(drcbe, inst, &dstp, PTYPE_MF, &addrp, PTYPE_MRI, &spacep, PTYPE_I);
|
||||
|
||||
/* set up a call to the read dword/qword handler */
|
||||
emit_mov_r32_p32(drcbe, &dst, REG_PARAM1, &addrp); // mov param1,addrp
|
||||
emit_mov_r64_m64(drcbe, &dst, REG_PARAM1, MBD(REG_RCX, offsetof(drcuml_machine_state, &drcbe->space[spacesizep.value / 16]));
|
||||
// mov param1,space
|
||||
emit_mov_r32_p32(drcbe, &dst, REG_PARAM2, &addrp); // mov param2,addrp
|
||||
if (inst->size == 4)
|
||||
emit_smart_call_m64(drcbe, &dst, (x86code **)&drcbe->accessors[spacep.value].read_dword);// call read_dword
|
||||
else if (inst->size == 8)
|
||||
@ -6262,15 +6275,17 @@ static x86code *op_fwrite(drcbe_state *drcbe, x86code *dst, const drcuml_instruc
|
||||
param_normalize_3(drcbe, inst, &addrp, PTYPE_MRI, &srcp, PTYPE_MF, &spacep, PTYPE_I);
|
||||
|
||||
/* general case */
|
||||
emit_mov_r32_p32(drcbe, &dst, REG_PARAM1, &addrp); // mov param1,addrp
|
||||
emit_mov_r64_m64(drcbe, &dst, REG_PARAM1, MBD(REG_RCX, offsetof(drcuml_machine_state, &drcbe->space[spacesizep.value / 16]));
|
||||
// mov param1,space
|
||||
emit_mov_r32_p32(drcbe, &dst, REG_PARAM2, &addrp); // mov param21,addrp
|
||||
|
||||
/* 32-bit form */
|
||||
if (inst->size == 4)
|
||||
{
|
||||
if (srcp.type == DRCUML_PTYPE_MEMORY)
|
||||
emit_mov_r32_m32(&dst, REG_PARAM2, MABS(drcbe, srcp.value)); // mov param2,[srcp]
|
||||
emit_mov_r32_m32(&dst, REG_PARAM3, MABS(drcbe, srcp.value)); // mov param3,[srcp]
|
||||
else if (srcp.type == DRCUML_PTYPE_FLOAT_REGISTER)
|
||||
emit_movd_r32_r128(&dst, REG_PARAM2, srcp.value); // movd param2,srcp
|
||||
emit_movd_r32_r128(&dst, REG_PARAM3, srcp.value); // movd param3,srcp
|
||||
emit_smart_call_m64(drcbe, &dst, (x86code **)&drcbe->accessors[spacep.value].write_dword);// call write_dword
|
||||
}
|
||||
|
||||
@ -6278,9 +6293,9 @@ static x86code *op_fwrite(drcbe_state *drcbe, x86code *dst, const drcuml_instruc
|
||||
else if (inst->size == 8)
|
||||
{
|
||||
if (srcp.type == DRCUML_PTYPE_MEMORY)
|
||||
emit_mov_r64_m64(&dst, REG_PARAM2, MABS(drcbe, srcp.value)); // mov param2,[srcp]
|
||||
emit_mov_r64_m64(&dst, REG_PARAM3, MABS(drcbe, srcp.value)); // mov param3,[srcp]
|
||||
else if (srcp.type == DRCUML_PTYPE_FLOAT_REGISTER)
|
||||
emit_movq_r64_r128(&dst, REG_PARAM2, srcp.value); // movq param2,srcp
|
||||
emit_movq_r64_r128(&dst, REG_PARAM3, srcp.value); // movq param3,srcp
|
||||
emit_smart_call_m64(drcbe, &dst, (x86code **)&drcbe->accessors[spacep.value].write_qword);// call write_qword
|
||||
}
|
||||
|
||||
|
@ -177,6 +177,8 @@ struct _drcbe_state
|
||||
UINT32 * reghi[REG_MAX]; /* pointer to high part of data for each register */
|
||||
double fptemp; /* temporary storage for floating point */
|
||||
|
||||
const address_space * space[ADDRESS_SPACES]; /* address spaces */
|
||||
|
||||
UINT8 sse3; /* do we have SSE3 support? */
|
||||
UINT16 fpumode; /* saved FPU mode */
|
||||
UINT16 fmodesave; /* temporary location for saving */
|
||||
@ -533,7 +535,7 @@ INLINE void emit_combine_z_shl_flags(x86code **dst)
|
||||
|
||||
static drcbe_state *drcbex86_alloc(drcuml_state *drcuml, drccache *cache, UINT32 flags, int modes, int addrbits, int ignorebits)
|
||||
{
|
||||
int opnum, regnum, entry;
|
||||
int opnum, regnum, entry, spacenum;
|
||||
drcbe_state *drcbe;
|
||||
|
||||
/* allocate space in the cache for our state */
|
||||
@ -546,6 +548,10 @@ static drcbe_state *drcbex86_alloc(drcuml_state *drcuml, drccache *cache, UINT32
|
||||
drcbe->drcuml = drcuml;
|
||||
drcbe->cache = cache;
|
||||
|
||||
/* get address spaces */
|
||||
for (spacenum = 0; spacenum < ADDRESS_SPACES; spacenum++)
|
||||
drcbe->space[spacenum] = active_address_space[spacenum];
|
||||
|
||||
/* allocate hash tables */
|
||||
drcbe->hash = drchash_alloc(cache, modes, addrbits, ignorebits);
|
||||
if (drcbe->hash == NULL)
|
||||
@ -4118,28 +4124,29 @@ static x86code *op_read(drcbe_state *drcbe, x86code *dst, const drcuml_instructi
|
||||
dstreg = param_select_register(REG_EAX, &dstp, NULL);
|
||||
|
||||
/* set up a call to the read byte handler */
|
||||
emit_mov_m32_p32(drcbe, &dst, MBD(REG_ESP, 0), &addrp); // mov [esp],addrp
|
||||
emit_mov_m32_p32(drcbe, &dst, MBD(REG_ESP, 4), &addrp); // mov [esp+4],addrp
|
||||
emit_mov_m32_imm(&dst, MBD(REG_ESP, 0), (UINT32)drcbe->space[spacesizep.value / 16]);// mov [esp],space
|
||||
if ((spacesizep.value & 3) == DRCUML_SIZE_BYTE)
|
||||
{
|
||||
emit_call(&dst, (x86code *)active_address_space[spacesizep.value / 16]->accessors.read_byte);
|
||||
emit_call(&dst, (x86code *)drcbe->space[spacesizep.value / 16]->accessors.read_byte);
|
||||
// call read_byte
|
||||
emit_movzx_r32_r8(&dst, dstreg, REG_AL); // movzx dstreg,al
|
||||
}
|
||||
else if ((spacesizep.value & 3) == DRCUML_SIZE_WORD)
|
||||
{
|
||||
emit_call(&dst, (x86code *)active_address_space[spacesizep.value / 16]->accessors.read_word);
|
||||
emit_call(&dst, (x86code *)drcbe->space[spacesizep.value / 16]->accessors.read_word);
|
||||
// call read_word
|
||||
emit_movzx_r32_r16(&dst, dstreg, REG_AX); // movzx dstreg,ax
|
||||
}
|
||||
else if ((spacesizep.value & 3) == DRCUML_SIZE_DWORD)
|
||||
{
|
||||
emit_call(&dst, (x86code *)active_address_space[spacesizep.value / 16]->accessors.read_dword);
|
||||
emit_call(&dst, (x86code *)drcbe->space[spacesizep.value / 16]->accessors.read_dword);
|
||||
// call read_dword
|
||||
emit_mov_r32_r32(&dst, dstreg, REG_EAX); // mov dstreg,eax
|
||||
}
|
||||
else if ((spacesizep.value & 3) == DRCUML_SIZE_QWORD)
|
||||
{
|
||||
emit_call(&dst, (x86code *)active_address_space[spacesizep.value / 16]->accessors.read_qword);
|
||||
emit_call(&dst, (x86code *)drcbe->space[spacesizep.value / 16]->accessors.read_qword);
|
||||
// call read_qword
|
||||
emit_mov_r32_r32(&dst, dstreg, REG_EAX); // mov dstreg,eax
|
||||
}
|
||||
@ -4194,25 +4201,26 @@ static x86code *op_readm(drcbe_state *drcbe, x86code *dst, const drcuml_instruct
|
||||
|
||||
/* set up a call to the read byte handler */
|
||||
if ((spacesizep.value & 3) != DRCUML_SIZE_QWORD)
|
||||
emit_mov_m32_p32(drcbe, &dst, MBD(REG_ESP, 4), &maskp); // mov [esp+4],maskp
|
||||
emit_mov_m32_p32(drcbe, &dst, MBD(REG_ESP, 8), &maskp); // mov [esp+8],maskp
|
||||
else
|
||||
emit_mov_m64_p64(drcbe, &dst, MBD(REG_ESP, 4), &maskp); // mov [esp+4],maskp
|
||||
emit_mov_m32_p32(drcbe, &dst, MBD(REG_ESP, 0), &addrp); // mov [esp],addrp
|
||||
emit_mov_m64_p64(drcbe, &dst, MBD(REG_ESP, 8), &maskp); // mov [esp+8],maskp
|
||||
emit_mov_m32_p32(drcbe, &dst, MBD(REG_ESP, 4), &addrp); // mov [esp+4],addrp
|
||||
emit_mov_m32_imm(&dst, MBD(REG_ESP, 0), (UINT32)drcbe->space[spacesizep.value / 16]);// mov [esp],space
|
||||
if ((spacesizep.value & 3) == DRCUML_SIZE_WORD)
|
||||
{
|
||||
emit_call(&dst, (x86code *)active_address_space[spacesizep.value / 16]->accessors.read_word_masked);
|
||||
emit_call(&dst, (x86code *)drcbe->space[spacesizep.value / 16]->accessors.read_word_masked);
|
||||
// call read_word_masked
|
||||
emit_movzx_r32_r16(&dst, dstreg, REG_AX); // movzx dstreg,ax
|
||||
}
|
||||
else if ((spacesizep.value & 3) == DRCUML_SIZE_DWORD)
|
||||
{
|
||||
emit_call(&dst, (x86code *)active_address_space[spacesizep.value / 16]->accessors.read_dword_masked);
|
||||
emit_call(&dst, (x86code *)drcbe->space[spacesizep.value / 16]->accessors.read_dword_masked);
|
||||
// call read_dword_masked
|
||||
emit_mov_r32_r32(&dst, dstreg, REG_EAX); // mov dstreg,eax
|
||||
}
|
||||
else if ((spacesizep.value & 3) == DRCUML_SIZE_QWORD)
|
||||
{
|
||||
emit_call(&dst, (x86code *)active_address_space[spacesizep.value / 16]->accessors.read_qword_masked);
|
||||
emit_call(&dst, (x86code *)drcbe->space[spacesizep.value / 16]->accessors.read_qword_masked);
|
||||
// call read_qword_masked
|
||||
emit_mov_r32_r32(&dst, dstreg, REG_EAX); // mov dstreg,eax
|
||||
}
|
||||
@ -4263,21 +4271,22 @@ static x86code *op_write(drcbe_state *drcbe, x86code *dst, const drcuml_instruct
|
||||
|
||||
/* set up a call to the write byte handler */
|
||||
if ((spacesizep.value & 3) != DRCUML_SIZE_QWORD)
|
||||
emit_mov_m32_p32(drcbe, &dst, MBD(REG_ESP, 4), &srcp); // mov [esp+4],srcp
|
||||
emit_mov_m32_p32(drcbe, &dst, MBD(REG_ESP, 8), &srcp); // mov [esp+8],srcp
|
||||
else
|
||||
emit_mov_m64_p64(drcbe, &dst, MBD(REG_ESP, 4), &srcp); // mov [esp+4],srcp
|
||||
emit_mov_m32_p32(drcbe, &dst, MBD(REG_ESP, 0), &addrp); // mov [esp],addrp
|
||||
emit_mov_m64_p64(drcbe, &dst, MBD(REG_ESP, 8), &srcp); // mov [esp+8],srcp
|
||||
emit_mov_m32_p32(drcbe, &dst, MBD(REG_ESP, 4), &addrp); // mov [esp+4],addrp
|
||||
emit_mov_m32_imm(&dst, MBD(REG_ESP, 0), (UINT32)drcbe->space[spacesizep.value / 16]);// mov [esp],space
|
||||
if ((spacesizep.value & 3) == DRCUML_SIZE_BYTE)
|
||||
emit_call(&dst, (x86code *)active_address_space[spacesizep.value / 16]->accessors.write_byte);
|
||||
emit_call(&dst, (x86code *)drcbe->space[spacesizep.value / 16]->accessors.write_byte);
|
||||
// call write_byte
|
||||
else if ((spacesizep.value & 3) == DRCUML_SIZE_WORD)
|
||||
emit_call(&dst, (x86code *)active_address_space[spacesizep.value / 16]->accessors.write_word);
|
||||
emit_call(&dst, (x86code *)drcbe->space[spacesizep.value / 16]->accessors.write_word);
|
||||
// call write_word
|
||||
else if ((spacesizep.value & 3) == DRCUML_SIZE_DWORD)
|
||||
emit_call(&dst, (x86code *)active_address_space[spacesizep.value / 16]->accessors.write_dword);
|
||||
emit_call(&dst, (x86code *)drcbe->space[spacesizep.value / 16]->accessors.write_dword);
|
||||
// call write_dword
|
||||
else if ((spacesizep.value & 3) == DRCUML_SIZE_QWORD)
|
||||
emit_call(&dst, (x86code *)active_address_space[spacesizep.value / 16]->accessors.write_qword);
|
||||
emit_call(&dst, (x86code *)drcbe->space[spacesizep.value / 16]->accessors.write_qword);
|
||||
// call write_qword
|
||||
return dst;
|
||||
}
|
||||
@ -4302,23 +4311,24 @@ static x86code *op_writem(drcbe_state *drcbe, x86code *dst, const drcuml_instruc
|
||||
/* set up a call to the write byte handler */
|
||||
if ((spacesizep.value & 3) != DRCUML_SIZE_QWORD)
|
||||
{
|
||||
emit_mov_m32_p32(drcbe, &dst, MBD(REG_ESP, 8), &maskp); // mov [esp+8],maskp
|
||||
emit_mov_m32_p32(drcbe, &dst, MBD(REG_ESP, 4), &srcp); // mov [esp+4],srcp
|
||||
emit_mov_m32_p32(drcbe, &dst, MBD(REG_ESP, 12), &maskp); // mov [esp+12],maskp
|
||||
emit_mov_m32_p32(drcbe, &dst, MBD(REG_ESP, 8), &srcp); // mov [esp+8],srcp
|
||||
}
|
||||
else
|
||||
{
|
||||
emit_mov_m64_p64(drcbe, &dst, MBD(REG_ESP, 12), &maskp); // mov [esp+12],maskp
|
||||
emit_mov_m64_p64(drcbe, &dst, MBD(REG_ESP, 4), &srcp); // mov [esp+4],srcp
|
||||
emit_mov_m64_p64(drcbe, &dst, MBD(REG_ESP, 16), &maskp); // mov [esp+16],maskp
|
||||
emit_mov_m64_p64(drcbe, &dst, MBD(REG_ESP, 8), &srcp); // mov [esp+8],srcp
|
||||
}
|
||||
emit_mov_m32_p32(drcbe, &dst, MBD(REG_ESP, 0), &addrp); // mov [esp],addrp
|
||||
emit_mov_m32_p32(drcbe, &dst, MBD(REG_ESP, 4), &addrp); // mov [esp+4],addrp
|
||||
emit_mov_m32_imm(&dst, MBD(REG_ESP, 0), (UINT32)drcbe->space[spacesizep.value / 16]);// mov [esp],space
|
||||
if ((spacesizep.value & 3) == DRCUML_SIZE_WORD)
|
||||
emit_call(&dst, (x86code *)active_address_space[spacesizep.value / 16]->accessors.write_word_masked);
|
||||
emit_call(&dst, (x86code *)drcbe->space[spacesizep.value / 16]->accessors.write_word_masked);
|
||||
// call write_word_masked
|
||||
else if ((spacesizep.value & 3) == DRCUML_SIZE_DWORD)
|
||||
emit_call(&dst, (x86code *)active_address_space[spacesizep.value / 16]->accessors.write_dword_masked);
|
||||
emit_call(&dst, (x86code *)drcbe->space[spacesizep.value / 16]->accessors.write_dword_masked);
|
||||
// call write_dword_masked
|
||||
else if ((spacesizep.value & 3) == DRCUML_SIZE_QWORD)
|
||||
emit_call(&dst, (x86code *)active_address_space[spacesizep.value / 16]->accessors.write_qword_masked);
|
||||
emit_call(&dst, (x86code *)drcbe->space[spacesizep.value / 16]->accessors.write_qword_masked);
|
||||
// call write_qword_masked
|
||||
return dst;
|
||||
}
|
||||
@ -6178,11 +6188,12 @@ static x86code *op_fread(drcbe_state *drcbe, x86code *dst, const drcuml_instruct
|
||||
param_normalize_3(drcbe, inst, &dstp, PTYPE_MF, &addrp, PTYPE_MRI, &spacep, PTYPE_I);
|
||||
|
||||
/* set up a call to the read dword/qword handler */
|
||||
emit_mov_m32_p32(drcbe, &dst, MBD(REG_ESP, 0), &addrp); // mov [esp],addrp
|
||||
emit_mov_m32_p32(drcbe, &dst, MBD(REG_ESP, 4), &addrp); // mov [esp+4],addrp
|
||||
emit_mov_m32_imm(&dst, MBD(REG_ESP, 0), (UINT32)drcbe->space[spacep.value / 16]); // mov [esp],space
|
||||
if (inst->size == 4)
|
||||
emit_call(&dst, (x86code *)active_address_space[spacep.value]->accessors.read_dword);// call read_dword
|
||||
emit_call(&dst, (x86code *)drcbe->space[spacep.value]->accessors.read_dword); // call read_dword
|
||||
else if (inst->size == 8)
|
||||
emit_call(&dst, (x86code *)active_address_space[spacep.value]->accessors.read_qword);// call read_qword
|
||||
emit_call(&dst, (x86code *)drcbe->space[spacep.value]->accessors.read_qword); // call read_qword
|
||||
|
||||
/* store result */
|
||||
if (inst->size == 4)
|
||||
@ -6212,14 +6223,15 @@ static x86code *op_fwrite(drcbe_state *drcbe, x86code *dst, const drcuml_instruc
|
||||
|
||||
/* set up a call to the write dword/qword handler */
|
||||
if (inst->size == 4)
|
||||
emit_mov_m32_p32(drcbe, &dst, MBD(REG_ESP, 4), &srcp); // mov [esp+4],srcp
|
||||
emit_mov_m32_p32(drcbe, &dst, MBD(REG_ESP, 8), &srcp); // mov [esp+8],srcp
|
||||
else if (inst->size == 8)
|
||||
emit_mov_m64_p64(drcbe, &dst, MBD(REG_ESP, 4), &srcp); // mov [esp+4],srcp
|
||||
emit_mov_m32_p32(drcbe, &dst, MBD(REG_ESP, 0), &addrp); // mov [esp],addrp
|
||||
emit_mov_m64_p64(drcbe, &dst, MBD(REG_ESP, 8), &srcp); // mov [esp+8],srcp
|
||||
emit_mov_m32_p32(drcbe, &dst, MBD(REG_ESP, 4), &addrp); // mov [esp+4],addrp
|
||||
emit_mov_m32_imm(&dst, MBD(REG_ESP, 0), (UINT32)drcbe->space[spacep.value / 16]); // mov [esp],space
|
||||
if (inst->size == 4)
|
||||
emit_call(&dst, (x86code *)active_address_space[spacep.value]->accessors.write_dword);// call write_dword
|
||||
emit_call(&dst, (x86code *)drcbe->space[spacep.value]->accessors.write_dword); // call write_dword
|
||||
else if (inst->size == 8)
|
||||
emit_call(&dst, (x86code *)active_address_space[spacep.value]->accessors.write_qword);// call write_qword
|
||||
emit_call(&dst, (x86code *)drcbe->space[spacep.value]->accessors.write_qword); // call write_qword
|
||||
|
||||
return dst;
|
||||
}
|
||||
|
@ -216,7 +216,7 @@ INLINE UINT8 argument_fetch(mcs48_state *mcs48, offs_t address)
|
||||
|
||||
INLINE void update_regptr(mcs48_state *mcs48)
|
||||
{
|
||||
mcs48->regptr = memory_get_write_ptr(cpunum_get_active(), ADDRESS_SPACE_DATA, (PSW & B_FLAG) ? 24 : 0);
|
||||
mcs48->regptr = memory_get_write_ptr(mcs48->data, (PSW & B_FLAG) ? 24 : 0);
|
||||
}
|
||||
|
||||
|
||||
|
@ -677,8 +677,8 @@ INLINE UINT8 r_psw(mcs51_state_t *mcs51_state) { return SFR_A(ADDR_PSW); }
|
||||
|
||||
INLINE void update_ptrs(mcs51_state_t *mcs51_state)
|
||||
{
|
||||
mcs51_state->internal_ram = memory_get_write_ptr(cpunum_get_active(), ADDRESS_SPACE_DATA, 0x00);
|
||||
mcs51_state->sfr_ram = memory_get_write_ptr(cpunum_get_active(), ADDRESS_SPACE_DATA, 0x100);
|
||||
mcs51_state->internal_ram = memory_get_write_ptr(mcs51_state->data, 0x00);
|
||||
mcs51_state->sfr_ram = memory_get_write_ptr(mcs51_state->data, 0x100);
|
||||
}
|
||||
|
||||
|
||||
|
@ -88,7 +88,7 @@ void mips3com_init(mips3_state *mips, mips3_flavor flavor, int bigendian, const
|
||||
mips->system_clock = config->system_clock;
|
||||
|
||||
/* set up the endianness */
|
||||
mips->memory = *memory_get_accessors(ADDRESS_SPACE_PROGRAM, 32, mips->bigendian ? CPU_IS_BE : CPU_IS_LE);
|
||||
mips->memory = cpu_get_address_space(device, ADDRESS_SPACE_PROGRAM)->accessors;
|
||||
|
||||
/* allocate the virtual TLB */
|
||||
mips->vtlb = vtlb_alloc(device, ADDRESS_SPACE_PROGRAM, 2 * MIPS3_TLB_ENTRIES + 2, 0);
|
||||
|
@ -768,7 +768,7 @@ static void code_compile_block(drcuml_state *drcuml, UINT8 mode, offs_t pc)
|
||||
}
|
||||
|
||||
/* validate this code block if we're not pointing into ROM */
|
||||
if (memory_get_write_ptr(cpunum_get_active(), ADDRESS_SPACE_PROGRAM, seqhead->physpc) != NULL)
|
||||
if (memory_get_write_ptr(cpu_get_address_space(Machine->activecpu, ADDRESS_SPACE_PROGRAM), seqhead->physpc) != NULL)
|
||||
generate_checksum_block(block, &compiler, seqhead, seqlast);
|
||||
|
||||
/* label this instruction, if it may be jumped to locally */
|
||||
|
@ -1293,20 +1293,19 @@ static WRITE32_HANDLER( psx_berr_w )
|
||||
|
||||
static void mips_update_scratchpad( const address_space *space )
|
||||
{
|
||||
int cpu = cpunum_get_active();
|
||||
psxcpu_state *psxcpu = space->cpu->token;
|
||||
|
||||
if( ( psxcpu->biu & BIU_RAM ) == 0 )
|
||||
{
|
||||
memory_install_readwrite32_handler( space->machine, cpu, ADDRESS_SPACE_PROGRAM, 0x1f800000, 0x1f8003ff, 0, 0, psx_berr_r, psx_berr_w );
|
||||
memory_install_readwrite32_handler( space, 0x1f800000, 0x1f8003ff, 0, 0, psx_berr_r, psx_berr_w );
|
||||
}
|
||||
else if( ( psxcpu->biu & BIU_DS ) == 0 )
|
||||
{
|
||||
memory_install_readwrite32_handler( space->machine, cpu, ADDRESS_SPACE_PROGRAM, 0x1f800000, 0x1f8003ff, 0, 0, psx_berr_r, SMH_NOP );
|
||||
memory_install_readwrite32_handler( space, 0x1f800000, 0x1f8003ff, 0, 0, psx_berr_r, SMH_NOP );
|
||||
}
|
||||
else
|
||||
{
|
||||
memory_install_readwrite32_handler( space->machine, cpu, ADDRESS_SPACE_PROGRAM, 0x1f800000, 0x1f8003ff, 0, 0, SMH_BANK32, SMH_BANK32 );
|
||||
memory_install_readwrite32_handler( space, 0x1f800000, 0x1f8003ff, 0, 0, SMH_BANK32, SMH_BANK32 );
|
||||
|
||||
memory_set_bankptr( 32, psxcpu->dcache );
|
||||
}
|
||||
|
@ -132,7 +132,7 @@ static UINT32 *ppcdrc_getopptr(UINT32 address)
|
||||
address &= ~0x07;
|
||||
}
|
||||
|
||||
result = (UINT32 *) memory_get_op_ptr(Machine, cpunum_get_active(), address, 0);
|
||||
result = (UINT32 *) memory_decrypted_read_ptr(cpu_get_address_space(Machine->activecpu, ADDRESS_SPACE_PROGRAM), address);
|
||||
if (result)
|
||||
result += offset;
|
||||
return result;
|
||||
|
@ -209,7 +209,7 @@ static int ppc_translate_address(offs_t *addr_ptr, int flags)
|
||||
| (((ppc.sdr1 & 0x01FF) & (hash >> 10)) << 16)
|
||||
| ((hash & 0x03FF) << 6);
|
||||
|
||||
pteg_ptr[hash_type] = memory_get_read_ptr(cpunum_get_active(), ADDRESS_SPACE_PROGRAM, pteg_address);
|
||||
pteg_ptr[hash_type] = memory_get_read_ptr(cpu_get_address_space(Machine->activecpu), ADDRESS_SPACE_PROGRAM), pteg_address);
|
||||
if (pteg_ptr[hash_type])
|
||||
{
|
||||
for (i = 0; i < 8; i++)
|
||||
|
@ -427,7 +427,7 @@ static UINT32 ppccom_translate_address_internal(powerpc_state *ppc, int intentio
|
||||
for (hashnum = 0; hashnum < 2; hashnum++)
|
||||
{
|
||||
offs_t ptegaddr = hashbase | ((hash << 6) & hashmask);
|
||||
UINT32 *ptegptr = memory_get_read_ptr(cpunum_get_active(), ADDRESS_SPACE_PROGRAM, ptegaddr);
|
||||
UINT32 *ptegptr = memory_get_read_ptr(cpu_get_address_space(Machine->activecpu, ADDRESS_SPACE_PROGRAM), ptegaddr);
|
||||
|
||||
/* should only have valid memory here, but make sure */
|
||||
if (ptegptr != NULL)
|
||||
|
@ -976,7 +976,7 @@ static void code_compile_block(drcuml_state *drcuml, UINT8 mode, offs_t pc)
|
||||
}
|
||||
|
||||
/* validate this code block if we're not pointing into ROM */
|
||||
if (memory_get_write_ptr(cpunum_get_active(), ADDRESS_SPACE_PROGRAM, seqhead->physpc) != NULL)
|
||||
if (memory_get_write_ptr(cpu_get_address_space(Machine->activecpu, ADDRESS_SPACE_PROGRAM), seqhead->physpc) != NULL)
|
||||
generate_checksum_block(block, &compiler, seqhead, seqlast); // <checksum>
|
||||
|
||||
/* label this instruction, if it may be jumped to locally */
|
||||
|
@ -966,7 +966,7 @@ static void code_compile_block(drcuml_state *drcuml, UINT8 mode, offs_t pc)
|
||||
}
|
||||
|
||||
/* validate this code block if we're not pointing into ROM */
|
||||
if (memory_get_write_ptr(cpunum_get_active(), ADDRESS_SPACE_PROGRAM, seqhead->physpc) != NULL)
|
||||
if (memory_get_write_ptr(cpu_get_address_space(Machine->activecpu, ADDRESS_SPACE_PROGRAM), seqhead->physpc) != NULL)
|
||||
generate_checksum_block(block, &compiler, seqhead, seqlast);
|
||||
|
||||
/* label this instruction, if it may be jumped to locally */
|
||||
|
@ -1359,7 +1359,7 @@ static IRQ_CALLBACK( standard_irq_callback )
|
||||
vector = (*classdata->driver_irq)(device, irqline);
|
||||
|
||||
/* notify the debugger */
|
||||
debug_cpu_interrupt_hook(device->machine, classdata->header.index, irqline);
|
||||
debugger_interrupt_hook(device->machine, classdata->header.index, irqline);
|
||||
|
||||
/* otherwise, just return the current vector */
|
||||
return vector;
|
||||
|
@ -1173,9 +1173,9 @@ void cpu_init(const device_config *device, int index, int clock, cpu_irq_callbac
|
||||
device->machine->activecpu = device;
|
||||
|
||||
classheader->index = index;
|
||||
classheader->space[ADDRESS_SPACE_PROGRAM] = active_address_space[ADDRESS_SPACE_PROGRAM];
|
||||
classheader->space[ADDRESS_SPACE_DATA] = active_address_space[ADDRESS_SPACE_DATA];
|
||||
classheader->space[ADDRESS_SPACE_IO] = active_address_space[ADDRESS_SPACE_IO];
|
||||
classheader->space[ADDRESS_SPACE_PROGRAM] = memory_find_address_space(device, ADDRESS_SPACE_PROGRAM);
|
||||
classheader->space[ADDRESS_SPACE_DATA] = memory_find_address_space(device, ADDRESS_SPACE_DATA);
|
||||
classheader->space[ADDRESS_SPACE_IO] = memory_find_address_space(device, ADDRESS_SPACE_IO);
|
||||
|
||||
(*classheader->init)(device, index, clock, irqcallback);
|
||||
(*classheader->get_context)(device->token);
|
||||
|
@ -570,11 +570,21 @@ typedef enum _cpu_type cpu_type;
|
||||
#define cputype_get_core_credits(cputype) cputype_get_info_string(cputype, CPUINFO_STR_CORE_CREDITS)
|
||||
|
||||
|
||||
/* helpers for using machine/cputag instead of cpu objects */
|
||||
#define cputag_reset(mach, tag) cpu_reset(cputag_get_cpu(mach, tag))
|
||||
#define cputag_get_index(mach, tag) cpu_get_index(cputag_get_cpu(mach, tag))
|
||||
#define cputag_get_address_space(mach, tag, space) cpu_get_address_space(cputag_get_cpu(mach, tag), space)
|
||||
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
TYPE DEFINITIONS
|
||||
***************************************************************************/
|
||||
|
||||
/* opaque definition of CPU debugging info */
|
||||
typedef struct _cpu_debug_data cpu_debug_data;
|
||||
|
||||
|
||||
/* forward declaration of this union */
|
||||
typedef union _cpuinfo cpuinfo;
|
||||
|
||||
@ -638,7 +648,8 @@ struct _cpu_class_header
|
||||
{
|
||||
int index; /* index of this CPU */
|
||||
cpu_type cputype; /* type index of this CPU */
|
||||
address_space * space[ADDRESS_SPACES]; /* address spaces */
|
||||
cpu_debug_data * debug; /* debugging data */
|
||||
const address_space * space[ADDRESS_SPACES]; /* address spaces */
|
||||
|
||||
/* table of core functions */
|
||||
cpu_get_info_func get_info;
|
||||
@ -776,6 +787,18 @@ INLINE int cpu_get_index(const device_config *cpu)
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------
|
||||
cpu_get_debug_data - return a pointer to
|
||||
the given CPU's debugger data
|
||||
-------------------------------------------------*/
|
||||
|
||||
INLINE cpu_debug_data *cpu_get_debug_data(const device_config *cpu)
|
||||
{
|
||||
cpu_class_header *classheader = cpu->classtoken;
|
||||
return classheader->debug;
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------
|
||||
cpu_get_address_space - return a pointer to
|
||||
the given CPU's address space
|
||||
|
@ -18,6 +18,7 @@
|
||||
#include "debughlp.h"
|
||||
#include "debugvw.h"
|
||||
#include "render.h"
|
||||
#include "deprecat.h"
|
||||
#include <ctype.h>
|
||||
|
||||
|
||||
@ -371,7 +372,7 @@ static void global_set(void *ref, UINT64 value)
|
||||
|
||||
int debug_command_parameter_number(const char *param, UINT64 *result)
|
||||
{
|
||||
EXPRERR err = expression_evaluate(param, debug_get_cpu_info(cpunum_get_active())->symtable, &debug_expression_callbacks, result);
|
||||
EXPRERR err = expression_evaluate(param, cpu_get_debug_data(Machine->activecpu)->symtable, &debug_expression_callbacks, result);
|
||||
if (err == EXPRERR_NONE)
|
||||
return 1;
|
||||
debug_console_printf("Error in expression: %s\n", param);
|
||||
@ -388,7 +389,7 @@ int debug_command_parameter_number(const char *param, UINT64 *result)
|
||||
|
||||
static int debug_command_parameter_expression(const char *param, parsed_expression **result)
|
||||
{
|
||||
EXPRERR err = expression_parse(param, debug_get_cpu_info(cpunum_get_active())->symtable, &debug_expression_callbacks, result);
|
||||
EXPRERR err = expression_parse(param, cpu_get_debug_data(Machine->activecpu)->symtable, &debug_expression_callbacks, result);
|
||||
if (err == EXPRERR_NONE)
|
||||
return 1;
|
||||
debug_console_printf("Error in expression: %s\n", param);
|
||||
@ -603,7 +604,7 @@ static void execute_logerror(running_machine *machine, int ref, int params, cons
|
||||
|
||||
static void execute_tracelog(running_machine *machine, int ref, int params, const char *param[])
|
||||
{
|
||||
FILE *file = debug_get_cpu_info(cpunum_get_active())->trace.file;
|
||||
FILE *file = cpu_get_debug_data(machine->activecpu)->trace.file;
|
||||
UINT64 values[MAX_COMMAND_PARAMS];
|
||||
char buffer[1024];
|
||||
int i;
|
||||
@ -775,15 +776,16 @@ static void execute_focus(running_machine *machine, int ref, int params, const c
|
||||
}
|
||||
|
||||
/* first clear the ignore flag on the focused CPU */
|
||||
debug_cpu_ignore_cpu(cpuwhich, 0);
|
||||
debug_cpu_ignore_cpu(machine->cpu[cpuwhich], 0);
|
||||
|
||||
/* then loop over CPUs and set the ignore flags on all other CPUs */
|
||||
for (cpunum = 0; cpunum < MAX_CPU; cpunum++)
|
||||
{
|
||||
const debug_cpu_info *info = debug_get_cpu_info(cpunum);
|
||||
if (info && info->valid && cpunum != cpuwhich)
|
||||
debug_cpu_ignore_cpu(cpunum, 1);
|
||||
}
|
||||
for (cpunum = 0; cpunum < ARRAY_LENGTH(machine->cpu); cpunum++)
|
||||
if (machine->cpu[cpunum] != NULL)
|
||||
{
|
||||
const cpu_debug_data *info = cpu_get_debug_data(machine->cpu[cpunum]);
|
||||
if (info->valid && cpunum != cpuwhich)
|
||||
debug_cpu_ignore_cpu(machine->cpu[cpunum], 1);
|
||||
}
|
||||
debug_console_printf("Now focused on CPU %d\n", (int)cpuwhich);
|
||||
}
|
||||
|
||||
@ -803,17 +805,20 @@ static void execute_ignore(running_machine *machine, int ref, int params, const
|
||||
if (params == 0)
|
||||
{
|
||||
/* loop over all CPUs */
|
||||
for (cpunum = 0; cpunum < MAX_CPU; cpunum++)
|
||||
{
|
||||
const debug_cpu_info *info = debug_get_cpu_info(cpunum);
|
||||
|
||||
/* build up a comma-separated list */
|
||||
if (info && info->valid && (info->flags & DEBUG_FLAG_OBSERVING) == 0)
|
||||
for (cpunum = 0; cpunum < ARRAY_LENGTH(machine->cpu); cpunum++)
|
||||
if (machine->cpu[cpunum] != NULL)
|
||||
{
|
||||
if (buflen == 0) buflen += sprintf(&buffer[buflen], "Currently ignoring CPU %d", cpunum);
|
||||
else buflen += sprintf(&buffer[buflen], ",%d", cpunum);
|
||||
const cpu_debug_data *info = cpu_get_debug_data(machine->cpu[cpunum]);
|
||||
|
||||
/* build up a comma-separated list */
|
||||
if (info->valid && (info->flags & DEBUG_FLAG_OBSERVING) == 0)
|
||||
{
|
||||
if (buflen == 0)
|
||||
buflen += sprintf(&buffer[buflen], "Currently ignoring CPU %d", cpunum);
|
||||
else
|
||||
buflen += sprintf(&buffer[buflen], ",%d", cpunum);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* special message for none */
|
||||
if (buflen == 0)
|
||||
@ -840,19 +845,20 @@ static void execute_ignore(running_machine *machine, int ref, int params, const
|
||||
for (paramnum = 0; paramnum < params; paramnum++)
|
||||
{
|
||||
/* make sure this isn't the last live CPU */
|
||||
for (cpunum = 0; cpunum < MAX_CPU; cpunum++)
|
||||
{
|
||||
const debug_cpu_info *info = debug_get_cpu_info(cpunum);
|
||||
if (cpunum != cpuwhich[paramnum] && info && info->valid && (info->flags & DEBUG_FLAG_OBSERVING) != 0)
|
||||
break;
|
||||
}
|
||||
if (cpunum == MAX_CPU)
|
||||
for (cpunum = 0; cpunum < ARRAY_LENGTH(machine->cpu); cpunum++)
|
||||
if (cpunum != cpuwhich[paramnum] && machine->cpu[cpunum] != NULL)
|
||||
{
|
||||
const cpu_debug_data *info = cpu_get_debug_data(machine->cpu[cpunum]);
|
||||
if (info->valid && (info->flags & DEBUG_FLAG_OBSERVING) != 0)
|
||||
break;
|
||||
}
|
||||
if (cpunum == ARRAY_LENGTH(machine->cpu))
|
||||
{
|
||||
debug_console_printf("Can't ignore all CPUs!\n");
|
||||
return;
|
||||
}
|
||||
|
||||
debug_cpu_ignore_cpu(cpuwhich[paramnum], 1);
|
||||
debug_cpu_ignore_cpu(machine->cpu[cpuwhich[paramnum]], 1);
|
||||
debug_console_printf("Now ignoring CPU %d\n", (int)cpuwhich[paramnum]);
|
||||
}
|
||||
}
|
||||
@ -874,17 +880,20 @@ static void execute_observe(running_machine *machine, int ref, int params, const
|
||||
if (params == 0)
|
||||
{
|
||||
/* loop over all CPUs */
|
||||
for (cpunum = 0; cpunum < MAX_CPU; cpunum++)
|
||||
{
|
||||
const debug_cpu_info *info = debug_get_cpu_info(cpunum);
|
||||
|
||||
/* build up a comma-separated list */
|
||||
if (info && info->valid && (info->flags & DEBUG_FLAG_OBSERVING) != 0)
|
||||
for (cpunum = 0; cpunum < ARRAY_LENGTH(machine->cpu); cpunum++)
|
||||
if (machine->cpu[cpunum] != NULL)
|
||||
{
|
||||
if (buflen == 0) buflen += sprintf(&buffer[buflen], "Currently observing CPU %d", cpunum);
|
||||
else buflen += sprintf(&buffer[buflen], ",%d", cpunum);
|
||||
const cpu_debug_data *info = cpu_get_debug_data(machine->cpu[cpunum]);
|
||||
|
||||
/* build up a comma-separated list */
|
||||
if (info->valid && (info->flags & DEBUG_FLAG_OBSERVING) != 0)
|
||||
{
|
||||
if (buflen == 0)
|
||||
buflen += sprintf(&buffer[buflen], "Currently observing CPU %d", cpunum);
|
||||
else
|
||||
buflen += sprintf(&buffer[buflen], ",%d", cpunum);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* special message for none */
|
||||
if (buflen == 0)
|
||||
@ -910,7 +919,7 @@ static void execute_observe(running_machine *machine, int ref, int params, const
|
||||
/* clear the ignore flags */
|
||||
for (paramnum = 0; paramnum < params; paramnum++)
|
||||
{
|
||||
debug_cpu_ignore_cpu(cpuwhich[paramnum], 0);
|
||||
debug_cpu_ignore_cpu(machine->cpu[cpuwhich[paramnum]], 0);
|
||||
debug_console_printf("Now observing CPU %d\n", (int)cpuwhich[paramnum]);
|
||||
}
|
||||
}
|
||||
@ -1023,16 +1032,17 @@ static void execute_bpclear(running_machine *machine, int ref, int params, const
|
||||
{
|
||||
int cpunum;
|
||||
|
||||
for (cpunum = 0; cpunum < MAX_CPU; cpunum++)
|
||||
{
|
||||
const debug_cpu_info *cpuinfo = debug_get_cpu_info(cpunum);
|
||||
if (cpuinfo->valid)
|
||||
for (cpunum = 0; cpunum < ARRAY_LENGTH(machine->cpu); cpunum++)
|
||||
if (machine->cpu[cpunum] != NULL)
|
||||
{
|
||||
debug_cpu_breakpoint *bp;
|
||||
while ((bp = cpuinfo->bplist) != NULL)
|
||||
debug_cpu_breakpoint_clear(machine, bp->index);
|
||||
const cpu_debug_data *cpuinfo = cpu_get_debug_data(machine->cpu[cpunum]);
|
||||
if (cpuinfo->valid)
|
||||
{
|
||||
debug_cpu_breakpoint *bp;
|
||||
while ((bp = cpuinfo->bplist) != NULL)
|
||||
debug_cpu_breakpoint_clear(machine, bp->index);
|
||||
}
|
||||
}
|
||||
}
|
||||
debug_console_printf("Cleared all breakpoints\n");
|
||||
}
|
||||
|
||||
@ -1064,16 +1074,17 @@ static void execute_bpdisenable(running_machine *machine, int ref, int params, c
|
||||
{
|
||||
int cpunum;
|
||||
|
||||
for (cpunum = 0; cpunum < MAX_CPU; cpunum++)
|
||||
{
|
||||
const debug_cpu_info *cpuinfo = debug_get_cpu_info(cpunum);
|
||||
if (cpuinfo->valid)
|
||||
for (cpunum = 0; cpunum < ARRAY_LENGTH(machine->cpu); cpunum++)
|
||||
if (machine->cpu[cpunum] != NULL)
|
||||
{
|
||||
debug_cpu_breakpoint *bp;
|
||||
for (bp = cpuinfo->bplist; bp != NULL; bp = bp->next)
|
||||
debug_cpu_breakpoint_enable(machine, bp->index, ref);
|
||||
const cpu_debug_data *cpuinfo = cpu_get_debug_data(machine->cpu[cpunum]);
|
||||
if (cpuinfo->valid)
|
||||
{
|
||||
debug_cpu_breakpoint *bp;
|
||||
for (bp = cpuinfo->bplist; bp != NULL; bp = bp->next)
|
||||
debug_cpu_breakpoint_enable(machine, bp->index, ref);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ref == 0)
|
||||
debug_console_printf("Disabled all breakpoints\n");
|
||||
else
|
||||
@ -1105,30 +1116,31 @@ static void execute_bplist(running_machine *machine, int ref, int params, const
|
||||
char buffer[256];
|
||||
|
||||
/* loop over all CPUs */
|
||||
for (cpunum = 0; cpunum < MAX_CPU; cpunum++)
|
||||
{
|
||||
const debug_cpu_info *cpuinfo = debug_get_cpu_info(cpunum);
|
||||
|
||||
if (cpuinfo->valid && cpuinfo->bplist != NULL)
|
||||
for (cpunum = 0; cpunum < ARRAY_LENGTH(machine->cpu); cpunum++)
|
||||
if (machine->cpu[cpunum] != NULL)
|
||||
{
|
||||
debug_cpu_breakpoint *bp;
|
||||
const cpu_debug_data *cpuinfo = cpu_get_debug_data(machine->cpu[cpunum]);
|
||||
|
||||
debug_console_printf("CPU %d breakpoints:\n", cpunum);
|
||||
|
||||
/* loop over the breakpoints */
|
||||
for (bp = cpuinfo->bplist; bp != NULL; bp = bp->next)
|
||||
if (cpuinfo->valid && cpuinfo->bplist != NULL)
|
||||
{
|
||||
int buflen;
|
||||
buflen = sprintf(buffer, "%c%4X @ %08X", bp->enabled ? ' ' : 'D', bp->index, bp->address);
|
||||
if (bp->condition)
|
||||
buflen += sprintf(&buffer[buflen], " if %s", expression_original_string(bp->condition));
|
||||
if (bp->action)
|
||||
buflen += sprintf(&buffer[buflen], " do %s", bp->action);
|
||||
debug_console_printf("%s\n", buffer);
|
||||
printed++;
|
||||
debug_cpu_breakpoint *bp;
|
||||
|
||||
debug_console_printf("CPU %d breakpoints:\n", cpunum);
|
||||
|
||||
/* loop over the breakpoints */
|
||||
for (bp = cpuinfo->bplist; bp != NULL; bp = bp->next)
|
||||
{
|
||||
int buflen;
|
||||
buflen = sprintf(buffer, "%c%4X @ %08X", bp->enabled ? ' ' : 'D', bp->index, bp->address);
|
||||
if (bp->condition)
|
||||
buflen += sprintf(&buffer[buflen], " if %s", expression_original_string(bp->condition));
|
||||
if (bp->action)
|
||||
buflen += sprintf(&buffer[buflen], " do %s", bp->action);
|
||||
debug_console_printf("%s\n", buffer);
|
||||
printed++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!printed)
|
||||
debug_console_printf("No breakpoints currently installed\n");
|
||||
@ -1197,21 +1209,22 @@ static void execute_wpclear(running_machine *machine, int ref, int params, const
|
||||
{
|
||||
int cpunum;
|
||||
|
||||
for (cpunum = 0; cpunum < MAX_CPU; cpunum++)
|
||||
{
|
||||
const debug_cpu_info *cpuinfo = debug_get_cpu_info(cpunum);
|
||||
if (cpuinfo->valid)
|
||||
for (cpunum = 0; cpunum < ARRAY_LENGTH(machine->cpu); cpunum++)
|
||||
if (machine->cpu[cpunum] != NULL)
|
||||
{
|
||||
int spacenum;
|
||||
|
||||
for (spacenum = 0; spacenum < ADDRESS_SPACES; spacenum++)
|
||||
const cpu_debug_data *cpuinfo = cpu_get_debug_data(machine->cpu[cpunum]);
|
||||
if (cpuinfo->valid)
|
||||
{
|
||||
debug_cpu_watchpoint *wp;
|
||||
while ((wp = cpuinfo->space[spacenum].wplist) != NULL)
|
||||
debug_cpu_watchpoint_clear(machine, wp->index);
|
||||
int spacenum;
|
||||
|
||||
for (spacenum = 0; spacenum < ADDRESS_SPACES; spacenum++)
|
||||
{
|
||||
debug_cpu_watchpoint *wp;
|
||||
while ((wp = cpuinfo->space[spacenum].wplist) != NULL)
|
||||
debug_cpu_watchpoint_clear(machine, wp->index);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
debug_console_printf("Cleared all watchpoints\n");
|
||||
}
|
||||
|
||||
@ -1243,21 +1256,22 @@ static void execute_wpdisenable(running_machine *machine, int ref, int params, c
|
||||
{
|
||||
int cpunum;
|
||||
|
||||
for (cpunum = 0; cpunum < MAX_CPU; cpunum++)
|
||||
{
|
||||
const debug_cpu_info *cpuinfo = debug_get_cpu_info(cpunum);
|
||||
if (cpuinfo->valid)
|
||||
for (cpunum = 0; cpunum < ARRAY_LENGTH(machine->cpu); cpunum++)
|
||||
if (machine->cpu[cpunum] != NULL)
|
||||
{
|
||||
int spacenum;
|
||||
|
||||
for (spacenum = 0; spacenum < ADDRESS_SPACES; spacenum++)
|
||||
const cpu_debug_data *cpuinfo = cpu_get_debug_data(machine->cpu[cpunum]);
|
||||
if (cpuinfo->valid)
|
||||
{
|
||||
debug_cpu_watchpoint *wp;
|
||||
for (wp = cpuinfo->space[spacenum].wplist; wp != NULL; wp = wp->next)
|
||||
debug_cpu_watchpoint_enable(machine, wp->index, ref);
|
||||
int spacenum;
|
||||
|
||||
for (spacenum = 0; spacenum < ADDRESS_SPACES; spacenum++)
|
||||
{
|
||||
debug_cpu_watchpoint *wp;
|
||||
for (wp = cpuinfo->space[spacenum].wplist; wp != NULL; wp = wp->next)
|
||||
debug_cpu_watchpoint_enable(machine, wp->index, ref);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (ref == 0)
|
||||
debug_console_printf("Disabled all watchpoints\n");
|
||||
else
|
||||
@ -1289,40 +1303,40 @@ static void execute_wplist(running_machine *machine, int ref, int params, const
|
||||
char buffer[256];
|
||||
|
||||
/* loop over all CPUs */
|
||||
for (cpunum = 0; cpunum < MAX_CPU; cpunum++)
|
||||
{
|
||||
const debug_cpu_info *cpuinfo = debug_get_cpu_info(cpunum);
|
||||
|
||||
if (cpuinfo->valid)
|
||||
for (cpunum = 0; cpunum < ARRAY_LENGTH(machine->cpu); cpunum++)
|
||||
if (machine->cpu[cpunum] != NULL)
|
||||
{
|
||||
int spacenum;
|
||||
|
||||
for (spacenum = 0; spacenum < ADDRESS_SPACES; spacenum++)
|
||||
const cpu_debug_data *cpuinfo = cpu_get_debug_data(machine->cpu[cpunum]);
|
||||
if (cpuinfo->valid)
|
||||
{
|
||||
if (cpuinfo->space[spacenum].wplist != NULL)
|
||||
int spacenum;
|
||||
|
||||
for (spacenum = 0; spacenum < ADDRESS_SPACES; spacenum++)
|
||||
{
|
||||
static const char *const types[] = { "unkn ", "read ", "write", "r/w " };
|
||||
debug_cpu_watchpoint *wp;
|
||||
|
||||
debug_console_printf("CPU %d %s space watchpoints:\n", cpunum, address_space_names[spacenum]);
|
||||
|
||||
/* loop over the watchpoints */
|
||||
for (wp = cpuinfo->space[spacenum].wplist; wp != NULL; wp = wp->next)
|
||||
if (cpuinfo->space[spacenum].wplist != NULL)
|
||||
{
|
||||
int buflen;
|
||||
buflen = sprintf(buffer, "%c%4X @ %08X-%08X %s", wp->enabled ? ' ' : 'D',
|
||||
wp->index, BYTE2ADDR(wp->address, cpuinfo, spacenum), BYTE2ADDR(wp->address + wp->length, cpuinfo, spacenum) - 1, types[wp->type & 3]);
|
||||
if (wp->condition)
|
||||
buflen += sprintf(&buffer[buflen], " if %s", expression_original_string(wp->condition));
|
||||
if (wp->action)
|
||||
buflen += sprintf(&buffer[buflen], " do %s", wp->action);
|
||||
debug_console_printf("%s\n", buffer);
|
||||
printed++;
|
||||
static const char *const types[] = { "unkn ", "read ", "write", "r/w " };
|
||||
debug_cpu_watchpoint *wp;
|
||||
|
||||
debug_console_printf("CPU %d %s space watchpoints:\n", cpunum, address_space_names[spacenum]);
|
||||
|
||||
/* loop over the watchpoints */
|
||||
for (wp = cpuinfo->space[spacenum].wplist; wp != NULL; wp = wp->next)
|
||||
{
|
||||
int buflen;
|
||||
buflen = sprintf(buffer, "%c%4X @ %08X-%08X %s", wp->enabled ? ' ' : 'D',
|
||||
wp->index, BYTE2ADDR(wp->address, cpuinfo, spacenum), BYTE2ADDR(wp->address + wp->length, cpuinfo, spacenum) - 1, types[wp->type & 3]);
|
||||
if (wp->condition)
|
||||
buflen += sprintf(&buffer[buflen], " if %s", expression_original_string(wp->condition));
|
||||
if (wp->action)
|
||||
buflen += sprintf(&buffer[buflen], " do %s", wp->action);
|
||||
debug_console_printf("%s\n", buffer);
|
||||
printed++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!printed)
|
||||
debug_console_printf("No watchpoints currently installed\n");
|
||||
@ -1346,17 +1360,18 @@ static void execute_hotspot(running_machine *machine, int ref, int params, const
|
||||
int cleared = FALSE;
|
||||
|
||||
/* loop over CPUs and find live spots */
|
||||
for (cpunum = 0; cpunum < MAX_CPU; cpunum++)
|
||||
{
|
||||
const debug_cpu_info *cpuinfo = debug_get_cpu_info(cpunum);
|
||||
|
||||
if (cpuinfo->valid && cpuinfo->hotspots)
|
||||
for (cpunum = 0; cpunum < ARRAY_LENGTH(machine->cpu); cpunum++)
|
||||
if (machine->cpu[cpunum] != NULL)
|
||||
{
|
||||
debug_cpu_hotspot_track(machine, cpunum, 0, 0);
|
||||
debug_console_printf("Cleared hotspot tracking on CPU %d\n", (int)cpunum);
|
||||
cleared = TRUE;
|
||||
const cpu_debug_data *cpuinfo = cpu_get_debug_data(machine->cpu[cpunum]);
|
||||
|
||||
if (cpuinfo->valid && cpuinfo->hotspots)
|
||||
{
|
||||
debug_cpu_hotspot_track(machine, cpunum, 0, 0);
|
||||
debug_console_printf("Cleared hotspot tracking on CPU %d\n", (int)cpunum);
|
||||
cleared = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* if we cleared, we're done */
|
||||
if (cleared)
|
||||
@ -1389,7 +1404,7 @@ static void execute_hotspot(running_machine *machine, int ref, int params, const
|
||||
static void execute_save(running_machine *machine, int ref, int params, const char *param[])
|
||||
{
|
||||
UINT64 offset, endoffset, length, cpunum = cpunum_get_active();
|
||||
const debug_cpu_info *info;
|
||||
const cpu_debug_data *info;
|
||||
int spacenum = ref;
|
||||
FILE *f;
|
||||
UINT64 i;
|
||||
@ -1403,7 +1418,7 @@ static void execute_save(running_machine *machine, int ref, int params, const ch
|
||||
return;
|
||||
|
||||
/* determine the addresses to write */
|
||||
info = debug_get_cpu_info(cpunum);
|
||||
info = cpu_get_debug_data(machine->cpu[cpunum]);
|
||||
endoffset = ADDR2BYTE_MASKED(offset + length - 1, info, spacenum);
|
||||
offset = ADDR2BYTE_MASKED(offset, info, spacenum);
|
||||
|
||||
@ -1437,7 +1452,7 @@ static void execute_save(running_machine *machine, int ref, int params, const ch
|
||||
static void execute_dump(running_machine *machine, int ref, int params, const char *param[])
|
||||
{
|
||||
UINT64 offset, endoffset, length, width = 0, ascii = 1, cpunum = cpunum_get_active();
|
||||
const debug_cpu_info *info;
|
||||
const cpu_debug_data *info;
|
||||
int spacenum = ref;
|
||||
FILE *f = NULL;
|
||||
UINT64 i, j;
|
||||
@ -1460,7 +1475,7 @@ static void execute_dump(running_machine *machine, int ref, int params, const ch
|
||||
debug_console_printf("Invalid CPU number!\n");
|
||||
return;
|
||||
}
|
||||
info = debug_get_cpu_info(cpunum);
|
||||
info = cpu_get_debug_data(machine->cpu[cpunum]);
|
||||
if (width == 0)
|
||||
width = info->space[spacenum].databytes;
|
||||
if (width < ADDR2BYTE(1, info, spacenum))
|
||||
@ -1606,7 +1621,7 @@ static void execute_dump(running_machine *machine, int ref, int params, const ch
|
||||
static void execute_find(running_machine *machine, int ref, int params, const char *param[])
|
||||
{
|
||||
UINT64 offset, endoffset, length, cpunum = cpunum_get_active();
|
||||
const debug_cpu_info *info;
|
||||
const cpu_debug_data *info;
|
||||
UINT64 data_to_find[256];
|
||||
UINT8 data_size[256];
|
||||
int cur_data_size;
|
||||
@ -1627,7 +1642,7 @@ static void execute_find(running_machine *machine, int ref, int params, const ch
|
||||
debug_console_printf("Invalid CPU number!\n");
|
||||
return;
|
||||
}
|
||||
info = debug_get_cpu_info(cpunum);
|
||||
info = cpu_get_debug_data(machine->cpu[cpunum]);
|
||||
endoffset = ADDR2BYTE_MASKED(offset + length - 1, info, spacenum);
|
||||
offset = ADDR2BYTE_MASKED(offset, info, spacenum);
|
||||
cur_data_size = ADDR2BYTE(1, info, spacenum);
|
||||
@ -1712,7 +1727,7 @@ static void execute_find(running_machine *machine, int ref, int params, const ch
|
||||
static void execute_dasm(running_machine *machine, int ref, int params, const char *param[])
|
||||
{
|
||||
UINT64 offset, length, bytes = 1, cpunum = cpunum_get_active();
|
||||
const debug_cpu_info *info;
|
||||
const cpu_debug_data *info;
|
||||
int minbytes, maxbytes, byteswidth;
|
||||
FILE *f = NULL;
|
||||
int i, j;
|
||||
@ -1733,7 +1748,7 @@ static void execute_dasm(running_machine *machine, int ref, int params, const ch
|
||||
debug_console_printf("Invalid CPU number!\n");
|
||||
return;
|
||||
}
|
||||
info = debug_get_cpu_info(cpunum);
|
||||
info = cpu_get_debug_data(machine->cpu[cpunum]);
|
||||
|
||||
/* determine the width of the bytes */
|
||||
minbytes = cpu_get_min_opcode_bytes(machine->cpu[cpunum]);
|
||||
@ -1946,7 +1961,7 @@ static void execute_traceflush(running_machine *machine, int ref, int params, co
|
||||
static void execute_history(running_machine *machine, int ref, int params, const char *param[])
|
||||
{
|
||||
UINT64 count = DEBUG_HISTORY_SIZE;
|
||||
const debug_cpu_info *info;
|
||||
const cpu_debug_data *info;
|
||||
UINT64 cpunum;
|
||||
int i;
|
||||
|
||||
@ -1967,7 +1982,7 @@ static void execute_history(running_machine *machine, int ref, int params, const
|
||||
if (count > DEBUG_HISTORY_SIZE)
|
||||
count = DEBUG_HISTORY_SIZE;
|
||||
|
||||
info = debug_get_cpu_info(cpunum);
|
||||
info = cpu_get_debug_data(machine->cpu[cpunum]);
|
||||
|
||||
/* loop over lines */
|
||||
cpu_push_context(machine->cpu[cpunum]);
|
||||
@ -2062,7 +2077,7 @@ static void execute_source(running_machine *machine, int ref, int params, const
|
||||
static void execute_map(running_machine *machine, int ref, int params, const char *param[])
|
||||
{
|
||||
UINT64 address, cpunum = cpunum_get_active();
|
||||
const debug_cpu_info *info;
|
||||
const cpu_debug_data *info;
|
||||
int spacenum = ref;
|
||||
offs_t taddress;
|
||||
int intention;
|
||||
@ -2070,7 +2085,7 @@ static void execute_map(running_machine *machine, int ref, int params, const cha
|
||||
/* validate parameters */
|
||||
if (!debug_command_parameter_number(param[0], &address))
|
||||
return;
|
||||
info = debug_get_cpu_info(cpunum);
|
||||
info = cpu_get_debug_data(machine->cpu[cpunum]);
|
||||
|
||||
/* do the translation first */
|
||||
for (intention = TRANSLATE_READ_DEBUG; intention <= TRANSLATE_FETCH_DEBUG; intention++)
|
||||
@ -2081,7 +2096,7 @@ static void execute_map(running_machine *machine, int ref, int params, const cha
|
||||
{
|
||||
if ((*info->translate)(info->device, spacenum, intention, &taddress))
|
||||
{
|
||||
const char *mapname = memory_get_handler_string(intention == TRANSLATE_WRITE_DEBUG, cpunum, spacenum, taddress);
|
||||
const char *mapname = memory_get_handler_string(cpu_get_address_space(machine->cpu[cpunum], spacenum), intention == TRANSLATE_WRITE_DEBUG, taddress);
|
||||
debug_console_printf("%7s: %08X logical == %08X physical -> %s\n", intnames[intention & 3], (UINT32)address, BYTE2ADDR(taddress, info, spacenum), mapname);
|
||||
}
|
||||
else
|
||||
@ -2089,7 +2104,7 @@ static void execute_map(running_machine *machine, int ref, int params, const cha
|
||||
}
|
||||
else
|
||||
{
|
||||
const char *mapname = memory_get_handler_string(intention == TRANSLATE_WRITE_DEBUG, cpunum, spacenum, taddress);
|
||||
const char *mapname = memory_get_handler_string(cpu_get_address_space(machine->cpu[cpunum], spacenum), intention == TRANSLATE_WRITE_DEBUG, taddress);
|
||||
debug_console_printf("%7s: %08X -> %s\n", intnames[intention & 3], BYTE2ADDR(taddress, info, spacenum), mapname);
|
||||
}
|
||||
}
|
||||
@ -2112,7 +2127,7 @@ static void execute_memdump(running_machine *machine, int ref, int params, const
|
||||
file = fopen(filename, "w");
|
||||
if (file)
|
||||
{
|
||||
memory_dump(file);
|
||||
memory_dump(machine, file);
|
||||
fclose(file);
|
||||
}
|
||||
}
|
||||
@ -2144,7 +2159,7 @@ static void execute_symlist(running_machine *machine, int ref, int params, const
|
||||
debug_console_printf("Invalid CPU number!\n");
|
||||
return;
|
||||
}
|
||||
symtable = (cpunum == 100000) ? global_symtable : debug_get_cpu_info(cpunum)->symtable;
|
||||
symtable = (cpunum == 100000) ? global_symtable : cpu_get_debug_data(machine->cpu[cpunum])->symtable;
|
||||
|
||||
if (symtable == global_symtable)
|
||||
debug_console_printf("Global symbols:\n");
|
||||
|
@ -307,14 +307,14 @@ UINT32 debug_comment_all_change_count(void)
|
||||
|
||||
UINT32 debug_comment_get_opcode_crc32(offs_t address)
|
||||
{
|
||||
const debug_cpu_info *info = debug_get_cpu_info(cpunum_get_active());
|
||||
const cpu_debug_data *info = cpu_get_debug_data(Machine->activecpu);
|
||||
int i;
|
||||
UINT32 crc;
|
||||
UINT8 opbuf[64], argbuf[64];
|
||||
char buff[256];
|
||||
offs_t numbytes;
|
||||
int maxbytes = cpu_get_max_opcode_bytes(Machine->activecpu);
|
||||
UINT32 addrmask = (debug_get_cpu_info(cpunum_get_active()))->space[ADDRESS_SPACE_PROGRAM].logaddrmask;
|
||||
UINT32 addrmask = (cpu_get_debug_data(Machine->activecpu))->space[ADDRESS_SPACE_PROGRAM].logaddrmask;
|
||||
|
||||
memset(opbuf, 0x00, sizeof(opbuf));
|
||||
memset(argbuf, 0x00, sizeof(argbuf));
|
||||
|
@ -328,7 +328,7 @@ static CMDERR internal_parse_command(running_machine *machine, const char *origi
|
||||
if (isexpr && paramcount == 1)
|
||||
{
|
||||
UINT64 expresult;
|
||||
EXPRERR exprerr = expression_evaluate(command_start, debug_get_cpu_info(cpunum_get_active())->symtable, &debug_expression_callbacks, &expresult);
|
||||
EXPRERR exprerr = expression_evaluate(command_start, cpu_get_debug_data(machine->activecpu)->symtable, &debug_expression_callbacks, &expresult);
|
||||
if (exprerr != EXPRERR_NONE)
|
||||
return MAKE_CMDERR_EXPRESSION_ERROR(EXPRERR_ERROR_OFFSET(exprerr));
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -44,12 +44,6 @@
|
||||
#define DEBUG_FLAG_STOP_VBLANK 0x00001000 /* there is a pending stop on the next VBLANK */
|
||||
#define DEBUG_FLAG_STOP_TIME 0x00002000 /* there is a pending stop at cpu->stoptime */
|
||||
#define DEBUG_FLAG_LIVE_BP 0x00010000 /* there are live breakpoints for this CPU */
|
||||
#define DEBUG_FLAG_LIVE_WPR_PROGRAM 0x01000000 /* there are live read watchpoints in program address space */
|
||||
#define DEBUG_FLAG_LIVE_WPR_DATA 0x02000000 /* there are live read watchpoints in data address space */
|
||||
#define DEBUG_FLAG_LIVE_WPR_IO 0x04000000 /* there are live read watchpoints in io address space */
|
||||
#define DEBUG_FLAG_LIVE_WPW_PROGRAM 0x10000000 /* there are live write watchpoints in program address space */
|
||||
#define DEBUG_FLAG_LIVE_WPW_DATA 0x20000000 /* there are live write watchpoints in data address space */
|
||||
#define DEBUG_FLAG_LIVE_WPW_IO 0x40000000 /* there are live write watchpoints in io address space */
|
||||
|
||||
#define DEBUG_FLAG_STEPPING_ANY (DEBUG_FLAG_STEPPING | \
|
||||
DEBUG_FLAG_STEPPING_OVER | \
|
||||
@ -66,17 +60,6 @@
|
||||
DEBUG_FLAG_STOP_VBLANK | \
|
||||
DEBUG_FLAG_STOP_TIME)
|
||||
|
||||
#define DEBUG_FLAG_READ_WATCHPOINT (DEBUG_FLAG_LIVE_WPR_PROGRAM | \
|
||||
DEBUG_FLAG_LIVE_WPR_DATA | \
|
||||
DEBUG_FLAG_LIVE_WPR_IO)
|
||||
|
||||
#define DEBUG_FLAG_WRITE_WATCHPOINT (DEBUG_FLAG_LIVE_WPW_PROGRAM | \
|
||||
DEBUG_FLAG_LIVE_WPW_DATA | \
|
||||
DEBUG_FLAG_LIVE_WPW_IO)
|
||||
|
||||
#define DEBUG_FLAG_WATCHPOINT (DEBUG_FLAG_READ_WATCHPOINT | \
|
||||
DEBUG_FLAG_WRITE_WATCHPOINT)
|
||||
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
@ -142,8 +125,8 @@ struct _debug_hotspot_entry
|
||||
};
|
||||
|
||||
|
||||
typedef struct _debug_cpu_info debug_cpu_info;
|
||||
struct _debug_cpu_info
|
||||
/* In cpuintrf.h: typedef struct _cpu_debug_data cpu_debug_data; */
|
||||
struct _cpu_debug_data
|
||||
{
|
||||
UINT8 valid; /* are we valid? */
|
||||
UINT8 endianness; /* little or bigendian */
|
||||
@ -237,17 +220,16 @@ void debug_cpu_exception_hook(running_machine *machine, int cpunum, int exceptio
|
||||
void debug_cpu_instruction_hook(running_machine *machine, offs_t curpc);
|
||||
|
||||
/* the memory system calls this hook when watchpoints are enabled and a memory read happens */
|
||||
void debug_cpu_memory_read_hook(running_machine *machine, int cpunum, int spacenum, offs_t address, UINT64 mem_mask);
|
||||
void debug_cpu_memory_read_hook(const address_space *space, offs_t address, UINT64 mem_mask);
|
||||
|
||||
/* the memory system calls this hook when watchpoints are enabled and a memory write happens */
|
||||
void debug_cpu_memory_write_hook(running_machine *machine, int cpunum, int spacenum, offs_t address, UINT64 data, UINT64 mem_mask);
|
||||
void debug_cpu_memory_write_hook(const address_space *space, offs_t address, UINT64 data, UINT64 mem_mask);
|
||||
|
||||
|
||||
|
||||
/* ----- core debugger functions ----- */
|
||||
|
||||
int debug_cpu_within_instruction_hook(running_machine *machine);
|
||||
const debug_cpu_info *debug_get_cpu_info(int cpunum);
|
||||
void debug_cpu_halt_on_next_instruction(running_machine *machine, int cpunum, const char *fmt, ...) ATTR_PRINTF(3,4);
|
||||
int debug_cpu_is_stopped(running_machine *machine);
|
||||
void debug_cpu_trace_printf(int cpunum, const char *fmt, ...) ATTR_PRINTF(2,3);
|
||||
@ -267,7 +249,7 @@ void debug_cpu_go_vblank(void);
|
||||
void debug_cpu_go_interrupt(int irqline);
|
||||
void debug_cpu_go_milliseconds(UINT64 milliseconds);
|
||||
void debug_cpu_next_cpu(void);
|
||||
void debug_cpu_ignore_cpu(int cpunum, int ignore);
|
||||
void debug_cpu_ignore_cpu(const device_config *cpu, int ignore);
|
||||
|
||||
/* tracing support */
|
||||
void debug_cpu_trace(int cpunum, FILE *file, int trace_over, const char *action);
|
||||
|
@ -1323,7 +1323,7 @@ static void disasm_free(debug_view *view)
|
||||
of instructions from the given PC
|
||||
-------------------------------------------------*/
|
||||
|
||||
static offs_t disasm_back_up(int cpunum, const debug_cpu_info *cpuinfo, offs_t startpc, int numinstrs)
|
||||
static offs_t disasm_back_up(int cpunum, const cpu_debug_data *cpuinfo, offs_t startpc, int numinstrs)
|
||||
{
|
||||
int minlen = BYTE2ADDR(cpu_get_min_opcode_bytes(Machine->activecpu), cpuinfo, ADDRESS_SPACE_PROGRAM);
|
||||
int maxlen = BYTE2ADDR(cpu_get_max_opcode_bytes(Machine->activecpu), cpuinfo, ADDRESS_SPACE_PROGRAM);
|
||||
@ -1405,7 +1405,7 @@ static offs_t disasm_back_up(int cpunum, const debug_cpu_info *cpuinfo, offs_t s
|
||||
byte values
|
||||
-------------------------------------------------*/
|
||||
|
||||
static void disasm_generate_bytes(offs_t pcbyte, int numbytes, const debug_cpu_info *cpuinfo, int minbytes, char *string, int maxchars, int encrypted)
|
||||
static void disasm_generate_bytes(offs_t pcbyte, int numbytes, const cpu_debug_data *cpuinfo, int minbytes, char *string, int maxchars, int encrypted)
|
||||
{
|
||||
int byte, offset = 0;
|
||||
UINT64 val;
|
||||
@ -1464,7 +1464,7 @@ static void disasm_generate_bytes(offs_t pcbyte, int numbytes, const debug_cpu_i
|
||||
static int disasm_recompute(debug_view *view, offs_t pc, int startline, int lines, int original_cpunum)
|
||||
{
|
||||
debug_view_disasm *dasmdata = view->extra_data;
|
||||
const debug_cpu_info *cpuinfo = debug_get_cpu_info(dasmdata->cpunum);
|
||||
const cpu_debug_data *cpuinfo = cpu_get_debug_data(Machine->cpu[dasmdata->cpunum]);
|
||||
const address_space *space = cpu_get_address_space(cpuinfo->device, ADDRESS_SPACE_PROGRAM);
|
||||
int chunksize, minbytes, maxbytes, maxbytes_clamped;
|
||||
int changed = FALSE;
|
||||
@ -1617,7 +1617,7 @@ static int disasm_recompute(debug_view *view, offs_t pc, int startline, int line
|
||||
static void disasm_update(debug_view *view)
|
||||
{
|
||||
debug_view_disasm *dasmdata = view->extra_data;
|
||||
const debug_cpu_info *cpuinfo = debug_get_cpu_info(dasmdata->cpunum);
|
||||
const cpu_debug_data *cpuinfo = cpu_get_debug_data(Machine->cpu[dasmdata->cpunum]);
|
||||
const address_space *space = cpu_get_address_space(cpuinfo->device, ADDRESS_SPACE_PROGRAM);
|
||||
offs_t pc = cpu_get_reg(Machine->cpu[dasmdata->cpunum], REG_PC);
|
||||
offs_t pcbyte = ADDR2BYTE_MASKED(pc, cpuinfo, ADDRESS_SPACE_PROGRAM);
|
||||
@ -1636,7 +1636,7 @@ static void disasm_update(debug_view *view)
|
||||
parsed_expression *expr;
|
||||
|
||||
/* parse the new expression */
|
||||
exprerr = expression_parse(dasmdata->expression_string, debug_get_cpu_info(dasmdata->cpunum)->symtable, &debug_expression_callbacks, &expr);
|
||||
exprerr = expression_parse(dasmdata->expression_string, cpu_get_debug_data(Machine->cpu[dasmdata->cpunum])->symtable, &debug_expression_callbacks, &expr);
|
||||
|
||||
/* if it worked, update the expression */
|
||||
if (exprerr == EXPRERR_NONE)
|
||||
@ -1851,7 +1851,7 @@ static void disasm_handle_char(debug_view *view, char chval)
|
||||
|
||||
case DCH_HOME: /* set the active column to the PC */
|
||||
{
|
||||
const debug_cpu_info *cpuinfo = debug_get_cpu_info(dasmdata->cpunum);
|
||||
const cpu_debug_data *cpuinfo = cpu_get_debug_data(Machine->cpu[dasmdata->cpunum]);
|
||||
offs_t pc = cpu_get_reg(Machine->cpu[dasmdata->cpunum], REG_PC);
|
||||
int i;
|
||||
|
||||
@ -2479,7 +2479,7 @@ static void generic_write_qword(debug_view_memory *memdata, offs_t offs, UINT64
|
||||
static void memory_handle_char(debug_view *view, char chval)
|
||||
{
|
||||
debug_view_memory *memdata = view->extra_data;
|
||||
const debug_cpu_info *cpuinfo = debug_get_cpu_info(memdata->cpunum);
|
||||
const cpu_debug_data *cpuinfo = cpu_get_debug_data(Machine->cpu[memdata->cpunum]);
|
||||
static const char hexvals[] = "0123456789abcdef";
|
||||
char *hexchar = strchr(hexvals, tolower(chval));
|
||||
UINT32 bytes_per_row;
|
||||
@ -2638,7 +2638,7 @@ static void memory_handle_char(debug_view *view, char chval)
|
||||
static void memory_update(debug_view *view)
|
||||
{
|
||||
debug_view_memory *memdata = view->extra_data;
|
||||
const debug_cpu_info *cpuinfo = debug_get_cpu_info(memdata->cpunum);
|
||||
const cpu_debug_data *cpuinfo = cpu_get_debug_data(Machine->cpu[memdata->cpunum]);
|
||||
debug_view_char *dest = view->viewdata;
|
||||
char addrformat[16];
|
||||
EXPRERR exprerr;
|
||||
@ -2707,7 +2707,7 @@ static void memory_update(debug_view *view)
|
||||
parsed_expression *expr;
|
||||
|
||||
/* parse the new expression */
|
||||
exprerr = expression_parse(memdata->expression_string, debug_get_cpu_info(memdata->cpunum)->symtable, &debug_expression_callbacks, &expr);
|
||||
exprerr = expression_parse(memdata->expression_string, cpu_get_debug_data(Machine->cpu[memdata->cpunum])->symtable, &debug_expression_callbacks, &expr);
|
||||
|
||||
/* if it worked, update the expression */
|
||||
if (exprerr == EXPRERR_NONE)
|
||||
|
@ -33,7 +33,7 @@ void debugger_refresh_display(running_machine *machine);
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
INLINE FUNCTIONS
|
||||
CPU CORE INLINE FUNCTIONS
|
||||
***************************************************************************/
|
||||
|
||||
/*-------------------------------------------------
|
||||
@ -48,6 +48,23 @@ INLINE void debugger_instruction_hook(running_machine *machine, offs_t curpc)
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------
|
||||
debugger_exception_hook - CPU cores call this
|
||||
anytime an exception is generated
|
||||
-------------------------------------------------*/
|
||||
|
||||
INLINE void debugger_exception_hook(running_machine *machine, int cpunum, int exception)
|
||||
{
|
||||
if ((machine->debug_flags & DEBUG_FLAG_ENABLED) != 0)
|
||||
debug_cpu_exception_hook(machine, cpunum, exception);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
CPU EXECUTION SYSTEM INLINE FUNCTIONS
|
||||
***************************************************************************/
|
||||
|
||||
/*-------------------------------------------------
|
||||
debugger_start_cpu_hook - the CPU execution
|
||||
system calls this hook before beginning
|
||||
@ -74,6 +91,24 @@ INLINE void debugger_stop_cpu_hook(running_machine *machine, int cpunum)
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------
|
||||
debugger_interrupt_hook - the CPU execution
|
||||
system calls this hook when an interrupt is
|
||||
acknowledged
|
||||
-------------------------------------------------*/
|
||||
|
||||
INLINE void debugger_interrupt_hook(running_machine *machine, int cpunum, int irqline)
|
||||
{
|
||||
if ((machine->debug_flags & DEBUG_FLAG_ENABLED) != 0)
|
||||
debug_cpu_interrupt_hook(machine, cpunum, irqline);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
GENERAL INLINE FUNCTIONS
|
||||
***************************************************************************/
|
||||
|
||||
/*-------------------------------------------------
|
||||
debugger_break - stop in the debugger at the
|
||||
next opportunity
|
||||
|
@ -126,6 +126,7 @@ typedef void (*output_callback_func)(void *param, const char *format, va_list ar
|
||||
|
||||
/* forward type declarations */
|
||||
typedef struct _mame_private mame_private;
|
||||
typedef struct _memory_private memory_private;
|
||||
typedef struct _palette_private palette_private;
|
||||
typedef struct _streams_private streams_private;
|
||||
typedef struct _devices_private devices_private;
|
||||
@ -168,6 +169,7 @@ struct _running_machine
|
||||
|
||||
/* internal core information */
|
||||
mame_private * mame_data; /* internal data from mame.c */
|
||||
memory_private * memory_data; /* internal data from memory.c */
|
||||
palette_private * palette_data; /* internal data from palette.c */
|
||||
streams_private * streams_data; /* internal data from streams.c */
|
||||
devices_private * devices_data; /* internal data from devices.c */
|
||||
|
2910
src/emu/memory.c
2910
src/emu/memory.c
File diff suppressed because it is too large
Load Diff
327
src/emu/memory.h
327
src/emu/memory.h
@ -110,7 +110,7 @@ struct _direct_read_data
|
||||
};
|
||||
|
||||
|
||||
/* opcode base adjustment handler */
|
||||
/* direct region update handler */
|
||||
typedef offs_t (*direct_update_func) (ATTR_UNUSED const address_space *space, ATTR_UNUSED offs_t address, ATTR_UNUSED direct_read_data *direct);
|
||||
|
||||
|
||||
@ -140,23 +140,21 @@ typedef void (*write64_device_func)(ATTR_UNUSED const device_config *device, ATT
|
||||
typedef struct _data_accessors data_accessors;
|
||||
struct _data_accessors
|
||||
{
|
||||
void (*change_pc)(offs_t byteaddress);
|
||||
UINT8 (*read_byte)(const address_space *space, offs_t byteaddress);
|
||||
UINT16 (*read_word)(const address_space *space, offs_t byteaddress);
|
||||
UINT16 (*read_word_masked)(const address_space *space, offs_t byteaddress, UINT16 mask);
|
||||
UINT32 (*read_dword)(const address_space *space, offs_t byteaddress);
|
||||
UINT32 (*read_dword_masked)(const address_space *space, offs_t byteaddress, UINT32 mask);
|
||||
UINT64 (*read_qword)(const address_space *space, offs_t byteaddress);
|
||||
UINT64 (*read_qword_masked)(const address_space *space, offs_t byteaddress, UINT64 mask);
|
||||
|
||||
UINT8 (*read_byte)(offs_t byteaddress);
|
||||
UINT16 (*read_word)(offs_t byteaddress);
|
||||
UINT16 (*read_word_masked)(offs_t byteaddress, UINT16 mask);
|
||||
UINT32 (*read_dword)(offs_t byteaddress);
|
||||
UINT32 (*read_dword_masked)(offs_t byteaddress, UINT32 mask);
|
||||
UINT64 (*read_qword)(offs_t byteaddress);
|
||||
UINT64 (*read_qword_masked)(offs_t byteaddress, UINT64 mask);
|
||||
|
||||
void (*write_byte)(offs_t byteaddress, UINT8 data);
|
||||
void (*write_word)(offs_t byteaddress, UINT16 data);
|
||||
void (*write_word_masked)(offs_t byteaddress, UINT16 data, UINT16 mask);
|
||||
void (*write_dword)(offs_t byteaddress, UINT32 data);
|
||||
void (*write_dword_masked)(offs_t byteaddress, UINT32 data, UINT32 mask);
|
||||
void (*write_qword)(offs_t byteaddress, UINT64 data);
|
||||
void (*write_qword_masked)(offs_t byteaddress, UINT64 data, UINT64 mask);
|
||||
void (*write_byte)(const address_space *space, offs_t byteaddress, UINT8 data);
|
||||
void (*write_word)(const address_space *space, offs_t byteaddress, UINT16 data);
|
||||
void (*write_word_masked)(const address_space *space, offs_t byteaddress, UINT16 data, UINT16 mask);
|
||||
void (*write_dword)(const address_space *space, offs_t byteaddress, UINT32 data);
|
||||
void (*write_dword_masked)(const address_space *space, offs_t byteaddress, UINT32 data, UINT32 mask);
|
||||
void (*write_qword)(const address_space *space, offs_t byteaddress, UINT64 data);
|
||||
void (*write_qword_masked)(const address_space *space, offs_t byteaddress, UINT64 data, UINT64 mask);
|
||||
};
|
||||
|
||||
|
||||
@ -271,9 +269,11 @@ struct _address_table
|
||||
/* Declared above: typedef struct _address_space address_space; */
|
||||
struct _address_space
|
||||
{
|
||||
address_space * next; /* next address space in the global list */
|
||||
running_machine * machine; /* reference to the owning machine */
|
||||
const device_config * cpu; /* reference to the owning CPU */
|
||||
address_map * map; /* original memory map */
|
||||
const char * name; /* friendly name of the address space */
|
||||
UINT8 * readlookup; /* live lookup table for reads */
|
||||
UINT8 * writelookup; /* live lookup table for writes */
|
||||
data_accessors accessors; /* data access handlers */
|
||||
@ -287,6 +287,8 @@ struct _address_space
|
||||
INT8 ashift; /* address shift */
|
||||
UINT8 abits; /* address bits */
|
||||
UINT8 dbits; /* data bits */
|
||||
UINT8 debugger_access; /* treat accesses as coming from the debugger */
|
||||
UINT8 log_unmap; /* log unmapped accesses in this space? */
|
||||
address_table read; /* memory read lookup table */
|
||||
address_table write; /* memory write lookup table */
|
||||
};
|
||||
@ -548,75 +550,75 @@ union _addrmap64_token
|
||||
#endif
|
||||
|
||||
/* wrappers for dynamic read handler installation */
|
||||
#define memory_install_read_handler(machine, cpu, space, start, end, mask, mirror, rhandler) \
|
||||
_memory_install_handler(machine, cpu, space, start, end, mask, mirror, rhandler, (FPTR)NULL, #rhandler, NULL)
|
||||
#define memory_install_read8_handler(machine, cpu, space, start, end, mask, mirror, rhandler) \
|
||||
_memory_install_handler8(machine, cpu, space, start, end, mask, mirror, rhandler, NULL, #rhandler, NULL)
|
||||
#define memory_install_read16_handler(machine, cpu, space, start, end, mask, mirror, rhandler) \
|
||||
_memory_install_handler16(machine, cpu, space, start, end, mask, mirror, rhandler, NULL, #rhandler, NULL)
|
||||
#define memory_install_read32_handler(machine, cpu, space, start, end, mask, mirror, rhandler) \
|
||||
_memory_install_handler32(machine, cpu, space, start, end, mask, mirror, rhandler, NULL, #rhandler, NULL)
|
||||
#define memory_install_read64_handler(machine, cpu, space, start, end, mask, mirror, rhandler) \
|
||||
_memory_install_handler64(machine, cpu, space, start, end, mask, mirror, rhandler, NULL, #rhandler, NULL)
|
||||
#define memory_install_read_handler(space, start, end, mask, mirror, rhandler) \
|
||||
_memory_install_handler(space, start, end, mask, mirror, rhandler, (FPTR)NULL, #rhandler, NULL)
|
||||
#define memory_install_read8_handler(space, start, end, mask, mirror, rhandler) \
|
||||
_memory_install_handler8(space, start, end, mask, mirror, rhandler, NULL, #rhandler, NULL)
|
||||
#define memory_install_read16_handler(space, start, end, mask, mirror, rhandler) \
|
||||
_memory_install_handler16(space, start, end, mask, mirror, rhandler, NULL, #rhandler, NULL)
|
||||
#define memory_install_read32_handler(space, start, end, mask, mirror, rhandler) \
|
||||
_memory_install_handler32(space, start, end, mask, mirror, rhandler, NULL, #rhandler, NULL)
|
||||
#define memory_install_read64_handler(space, start, end, mask, mirror, rhandler) \
|
||||
_memory_install_handler64(space, start, end, mask, mirror, rhandler, NULL, #rhandler, NULL)
|
||||
|
||||
#define memory_install_read_device_handler(device, cpu, space, start, end, mask, mirror, rhandler) \
|
||||
_memory_install_device_handler(device, cpu, space, start, end, mask, mirror, rhandler, NULL, #rhandler, NULL)
|
||||
#define memory_install_read8_device_handler(device, cpu, space, start, end, mask, mirror, rhandler) \
|
||||
_memory_install_device_handler8(device, cpu, space, start, end, mask, mirror, rhandler, NULL, #rhandler, NULL)
|
||||
#define memory_install_read16_device_handler(device, cpu, space, start, end, mask, mirror, rhandler) \
|
||||
_memory_install_device_handler16(device, cpu, space, start, end, mask, mirror, rhandler, NULL, #rhandler, NULL)
|
||||
#define memory_install_read32_device_handler(device, cpu, space, start, end, mask, mirror, rhandler) \
|
||||
_memory_install_device_handler32(device, cpu, space, start, end, mask, mirror, rhandler, NULL, #rhandler, NULL)
|
||||
#define memory_install_read64_device_handler(device, cpu, space, start, end, mask, mirror, rhandler) \
|
||||
_memory_install_device_handler64(device, cpu, space, start, end, mask, mirror, rhandler, NULL, #rhandler, NULL)
|
||||
#define memory_install_read_device_handler(space, device, start, end, mask, mirror, rhandler) \
|
||||
_memory_install_device_handler(space, device, start, end, mask, mirror, rhandler, NULL, #rhandler, NULL)
|
||||
#define memory_install_read8_device_handler(space, device, start, end, mask, mirror, rhandler) \
|
||||
_memory_install_device_handler8(space, device, start, end, mask, mirror, rhandler, NULL, #rhandler, NULL)
|
||||
#define memory_install_read16_device_handler(space, device, start, end, mask, mirror, rhandler) \
|
||||
_memory_install_device_handler16(space, device, start, end, mask, mirror, rhandler, NULL, #rhandler, NULL)
|
||||
#define memory_install_read32_device_handler(space, device, start, end, mask, mirror, rhandler) \
|
||||
_memory_install_device_handler32(space, device, start, end, mask, mirror, rhandler, NULL, #rhandler, NULL)
|
||||
#define memory_install_read64_device_handler(space, device, start, end, mask, mirror, rhandler) \
|
||||
_memory_install_device_handler64(space, device, start, end, mask, mirror, rhandler, NULL, #rhandler, NULL)
|
||||
|
||||
|
||||
/* wrappers for dynamic write handler installation */
|
||||
#define memory_install_write_handler(machine, cpu, space, start, end, mask, mirror, whandler) \
|
||||
_memory_install_handler(machine, cpu, space, start, end, mask, mirror, (FPTR)NULL, whandler, NULL, #whandler)
|
||||
#define memory_install_write8_handler(machine, cpu, space, start, end, mask, mirror, whandler) \
|
||||
_memory_install_handler8(machine, cpu, space, start, end, mask, mirror, NULL, whandler, NULL, #whandler)
|
||||
#define memory_install_write16_handler(machine, cpu, space, start, end, mask, mirror, whandler) \
|
||||
_memory_install_handler16(machine, cpu, space, start, end, mask, mirror, NULL, whandler, NULL, #whandler)
|
||||
#define memory_install_write32_handler(machine, cpu, space, start, end, mask, mirror, whandler) \
|
||||
_memory_install_handler32(machine, cpu, space, start, end, mask, mirror, NULL, whandler, NULL, #whandler)
|
||||
#define memory_install_write64_handler(machine, cpu, space, start, end, mask, mirror, whandler) \
|
||||
_memory_install_handler64(machine, cpu, space, start, end, mask, mirror, NULL, whandler, NULL, #whandler)
|
||||
#define memory_install_write_handler(space, start, end, mask, mirror, whandler) \
|
||||
_memory_install_handler(space, start, end, mask, mirror, (FPTR)NULL, whandler, NULL, #whandler)
|
||||
#define memory_install_write8_handler(space, start, end, mask, mirror, whandler) \
|
||||
_memory_install_handler8(space, start, end, mask, mirror, NULL, whandler, NULL, #whandler)
|
||||
#define memory_install_write16_handler(space, start, end, mask, mirror, whandler) \
|
||||
_memory_install_handler16(space, start, end, mask, mirror, NULL, whandler, NULL, #whandler)
|
||||
#define memory_install_write32_handler(space, start, end, mask, mirror, whandler) \
|
||||
_memory_install_handler32(space, start, end, mask, mirror, NULL, whandler, NULL, #whandler)
|
||||
#define memory_install_write64_handler(space, start, end, mask, mirror, whandler) \
|
||||
_memory_install_handler64(space, start, end, mask, mirror, NULL, whandler, NULL, #whandler)
|
||||
|
||||
#define memory_install_write_device_handler(device, cpu, space, start, end, mask, mirror, whandler) \
|
||||
_memory_install_device_handler(device, cpu, space, start, end, mask, mirror, NULL, whandler, NULL, #whandler)
|
||||
#define memory_install_write8_device_handler(device, cpu, space, start, end, mask, mirror, whandler) \
|
||||
_memory_install_device_handler8(device, cpu, space, start, end, mask, mirror, NULL, whandler, NULL, #whandler)
|
||||
#define memory_install_write16_device_handler(device, cpu, space, start, end, mask, mirror, whandler) \
|
||||
_memory_install_device_handler16(device, cpu, space, start, end, mask, mirror, NULL, whandler, NULL, #whandler)
|
||||
#define memory_install_write32_device_handler(device, cpu, space, start, end, mask, mirror, whandler) \
|
||||
_memory_install_device_handler32(device, cpu, space, start, end, mask, mirror, NULL, whandler, NULL, #whandler)
|
||||
#define memory_install_write64_device_handler(device, cpu, space, start, end, mask, mirror, whandler) \
|
||||
_memory_install_device_handler64(device, cpu, space, start, end, mask, mirror, NULL, whandler, NULL, #whandler)
|
||||
#define memory_install_write_device_handler(space, device, start, end, mask, mirror, whandler) \
|
||||
_memory_install_device_handler(space, device, start, end, mask, mirror, NULL, whandler, NULL, #whandler)
|
||||
#define memory_install_write8_device_handler(space, device, start, end, mask, mirror, whandler) \
|
||||
_memory_install_device_handler8(space, device, start, end, mask, mirror, NULL, whandler, NULL, #whandler)
|
||||
#define memory_install_write16_device_handler(space, device, start, end, mask, mirror, whandler) \
|
||||
_memory_install_device_handler16(space, device, start, end, mask, mirror, NULL, whandler, NULL, #whandler)
|
||||
#define memory_install_write32_device_handler(space, device, start, end, mask, mirror, whandler) \
|
||||
_memory_install_device_handler32(space, device, start, end, mask, mirror, NULL, whandler, NULL, #whandler)
|
||||
#define memory_install_write64_device_handler(space, device, start, end, mask, mirror, whandler) \
|
||||
_memory_install_device_handler64(space, device, start, end, mask, mirror, NULL, whandler, NULL, #whandler)
|
||||
|
||||
|
||||
/* wrappers for dynamic read/write handler installation */
|
||||
#define memory_install_readwrite_handler(machine, cpu, space, start, end, mask, mirror, rhandler, whandler) \
|
||||
_memory_install_handler(machine, cpu, space, start, end, mask, mirror, rhandler, whandler, #rhandler, #whandler)
|
||||
#define memory_install_readwrite8_handler(machine, cpu, space, start, end, mask, mirror, rhandler, whandler) \
|
||||
_memory_install_handler8(machine, cpu, space, start, end, mask, mirror, rhandler, whandler, #rhandler, #whandler)
|
||||
#define memory_install_readwrite16_handler(machine, cpu, space, start, end, mask, mirror, rhandler, whandler) \
|
||||
_memory_install_handler16(machine, cpu, space, start, end, mask, mirror, rhandler, whandler, #rhandler, #whandler)
|
||||
#define memory_install_readwrite32_handler(machine, cpu, space, start, end, mask, mirror, rhandler, whandler) \
|
||||
_memory_install_handler32(machine, cpu, space, start, end, mask, mirror, rhandler, whandler, #rhandler, #whandler)
|
||||
#define memory_install_readwrite64_handler(machine, cpu, space, start, end, mask, mirror, rhandler, whandler) \
|
||||
_memory_install_handler64(machine, cpu, space, start, end, mask, mirror, rhandler, whandler, #rhandler, #whandler)
|
||||
#define memory_install_readwrite_handler(space, start, end, mask, mirror, rhandler, whandler) \
|
||||
_memory_install_handler(space, start, end, mask, mirror, rhandler, whandler, #rhandler, #whandler)
|
||||
#define memory_install_readwrite8_handler(space, start, end, mask, mirror, rhandler, whandler) \
|
||||
_memory_install_handler8(space, start, end, mask, mirror, rhandler, whandler, #rhandler, #whandler)
|
||||
#define memory_install_readwrite16_handler(space, start, end, mask, mirror, rhandler, whandler) \
|
||||
_memory_install_handler16(space, start, end, mask, mirror, rhandler, whandler, #rhandler, #whandler)
|
||||
#define memory_install_readwrite32_handler(space, start, end, mask, mirror, rhandler, whandler) \
|
||||
_memory_install_handler32(space, start, end, mask, mirror, rhandler, whandler, #rhandler, #whandler)
|
||||
#define memory_install_readwrite64_handler(space, start, end, mask, mirror, rhandler, whandler) \
|
||||
_memory_install_handler64(space, start, end, mask, mirror, rhandler, whandler, #rhandler, #whandler)
|
||||
|
||||
#define memory_install_readwrite_device_handler(device, cpu, space, start, end, mask, mirror, rhandler, whandler) \
|
||||
_memory_install_device_handler(device, cpu, space, start, end, mask, mirror, rhandler, whandler, #rhandler, #whandler)
|
||||
#define memory_install_readwrite8_device_handler(device, cpu, space, start, end, mask, mirror, rhandler, whandler) \
|
||||
_memory_install_device_handler8(device, cpu, space, start, end, mask, mirror, rhandler, whandler, #rhandler, #whandler)
|
||||
#define memory_install_readwrite16_device_handler(device, cpu, space, start, end, mask, mirror, rhandler, whandler) \
|
||||
_memory_install_device_handler16(device, cpu, space, start, end, mask, mirror, rhandler, whandler, #rhandler, #whandler)
|
||||
#define memory_install_readwrite32_device_handler(device, cpu, space, start, end, mask, mirror, rhandler, whandler) \
|
||||
_memory_install_device_handler32(device, cpu, space, start, end, mask, mirror, rhandler, whandler, #rhandler, #whandler)
|
||||
#define memory_install_readwrite64_device_handler(device, cpu, space, start, end, mask, mirror, rhandler, whandler) \
|
||||
_memory_install_device_handler64(device, cpu, space, start, end, mask, mirror, rhandler, whandler, #rhandler, #whandler)
|
||||
#define memory_install_readwrite_device_handler(space, device, start, end, mask, mirror, rhandler, whandler) \
|
||||
_memory_install_device_handler(space, device, start, end, mask, mirror, rhandler, whandler, #rhandler, #whandler)
|
||||
#define memory_install_readwrite8_device_handler(space, device, start, end, mask, mirror, rhandler, whandler) \
|
||||
_memory_install_device_handler8(space, device, start, end, mask, mirror, rhandler, whandler, #rhandler, #whandler)
|
||||
#define memory_install_readwrite16_device_handler(space, device, start, end, mask, mirror, rhandler, whandler) \
|
||||
_memory_install_device_handler16(space, device, start, end, mask, mirror, rhandler, whandler, #rhandler, #whandler)
|
||||
#define memory_install_readwrite32_device_handler(space, device, start, end, mask, mirror, rhandler, whandler) \
|
||||
_memory_install_device_handler32(space, device, start, end, mask, mirror, rhandler, whandler, #rhandler, #whandler)
|
||||
#define memory_install_readwrite64_device_handler(space, device, start, end, mask, mirror, rhandler, whandler) \
|
||||
_memory_install_device_handler64(space, device, start, end, mask, mirror, rhandler, whandler, #rhandler, #whandler)
|
||||
|
||||
|
||||
/* macros for accessing bytes and words within larger chunks */
|
||||
@ -881,7 +883,7 @@ union _addrmap64_token
|
||||
GLOBAL VARIABLES
|
||||
***************************************************************************/
|
||||
|
||||
extern address_space * active_address_space[]; /* address spaces */
|
||||
extern const address_space * active_address_space[]; /* address spaces */
|
||||
|
||||
extern const char *const address_space_names[ADDRESS_SPACES];
|
||||
|
||||
@ -897,12 +899,11 @@ extern const char *const address_space_names[ADDRESS_SPACES];
|
||||
/* initialize the memory system */
|
||||
void memory_init(running_machine *machine);
|
||||
|
||||
/* set the current memory context */
|
||||
void memory_set_context(running_machine *machine, int activecpu);
|
||||
/* find an address space in our internal list; for faster access use cpu_get_address_space() */
|
||||
const address_space *memory_find_address_space(const device_config *cpu, int spacenum);
|
||||
|
||||
/* get a pointer to the set of memory accessor functions based on the address space,
|
||||
databus width, and endianness */
|
||||
const data_accessors *memory_get_accessors(int spacenum, int databits, int endianness);
|
||||
/* set the current memory context - soon to be deprecated */
|
||||
void memory_set_context(running_machine *machine, int activecpu);
|
||||
|
||||
|
||||
|
||||
@ -914,15 +915,12 @@ address_map *address_map_alloc(const machine_config *drv, const game_driver *dri
|
||||
/* release allocated memory for an address map */
|
||||
void address_map_free(address_map *map);
|
||||
|
||||
/* return a pointer to the constructed address map for a CPU's address space */
|
||||
const address_map *memory_get_address_map(int cpunum, int spacenum);
|
||||
|
||||
|
||||
|
||||
/* ----- direct access control ----- */
|
||||
|
||||
/* registers an address range as having a decrypted data pointer */
|
||||
void memory_set_decrypted_region(int cpunum, offs_t addrstart, offs_t addrend, void *base);
|
||||
void memory_set_decrypted_region(const address_space *space, offs_t addrstart, offs_t addrend, void *base);
|
||||
|
||||
/* register a handler for opcode base changes on a given CPU */
|
||||
direct_update_func memory_set_direct_update_handler(const address_space *space, direct_update_func function);
|
||||
@ -930,43 +928,89 @@ direct_update_func memory_set_direct_update_handler(const address_space *space,
|
||||
/* called by CPU cores to update the opcode base for the given address */
|
||||
int memory_set_direct_region(const address_space *space, offs_t byteaddress);
|
||||
|
||||
/* return a pointer the memory byte provided in the given address space, or NULL if it is not mapped to a bank */
|
||||
void *memory_get_read_ptr(const address_space *space, offs_t byteaddress);
|
||||
|
||||
/* return a pointer the memory byte provided in the given address space, or NULL if it is not mapped to a writeable bank */
|
||||
void *memory_get_write_ptr(const address_space *space, offs_t byteaddress);
|
||||
|
||||
|
||||
/* return a base pointer to memory */
|
||||
void * memory_get_read_ptr(int cpunum, int spacenum, offs_t byteaddress);
|
||||
void * memory_get_write_ptr(int cpunum, int spacenum, offs_t byteaddress);
|
||||
void * memory_get_op_ptr(running_machine *machine, int cpunum, offs_t byteaddress, int arg);
|
||||
|
||||
/* memory banking */
|
||||
void memory_configure_bank(int banknum, int startentry, int numentries, void *base, offs_t stride);
|
||||
void memory_configure_bank_decrypted(int banknum, int startentry, int numentries, void *base, offs_t stride);
|
||||
void memory_set_bank(int banknum, int entrynum);
|
||||
int memory_get_bank(int banknum);
|
||||
void memory_set_bankptr(int banknum, void *base);
|
||||
/* ----- memory banking ----- */
|
||||
|
||||
/* configure the addresses for a bank */
|
||||
void memory_configure_bank(running_machine *machine, int banknum, int startentry, int numentries, void *base, offs_t stride);
|
||||
|
||||
/* configure the decrypted addresses for a bank */
|
||||
void memory_configure_bank_decrypted(running_machine *machine, int banknum, int startentry, int numentries, void *base, offs_t stride);
|
||||
|
||||
/* select one pre-configured entry to be the new bank base */
|
||||
void memory_set_bank(int banknum, int entrynum);
|
||||
|
||||
/* return the currently selected bank */
|
||||
int memory_get_bank(int banknum);
|
||||
|
||||
/* set the absolute address of a bank base */
|
||||
void memory_set_bankptr(int banknum, void *base);
|
||||
|
||||
|
||||
/* debugging */
|
||||
void memory_set_debugger_access(int debugger);
|
||||
void memory_set_log_unmap(int spacenum, int log);
|
||||
int memory_get_log_unmap(int spacenum);
|
||||
|
||||
/* dynamic address space mapping */
|
||||
void * _memory_install_handler (running_machine *machine, int cpunum, int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, FPTR rhandler, FPTR whandler, const char *rhandler_name, const char *whandler_name);
|
||||
UINT8 * _memory_install_handler8 (running_machine *machine, int cpunum, int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read8_space_func rhandler, write8_space_func whandler, const char *rhandler_name, const char *whandler_name);
|
||||
UINT16 * _memory_install_handler16(running_machine *machine, int cpunum, int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read16_space_func rhandler, write16_space_func whandler, const char *rhandler_name, const char *whandler_name);
|
||||
UINT32 * _memory_install_handler32(running_machine *machine, int cpunum, int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read32_space_func rhandler, write32_space_func whandler, const char *rhandler_name, const char *whandler_name);
|
||||
UINT64 * _memory_install_handler64(running_machine *machine, int cpunum, int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read64_space_func rhandler, write64_space_func whandler, const char *rhandler_name, const char *whandler_name);
|
||||
/* ----- dynamic address space mapping ----- */
|
||||
|
||||
/* dynamic device address space mapping */
|
||||
void * _memory_install_device_handler (const device_config *device, int cpunum, int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, FPTR rhandler, FPTR whandler, const char *rhandler_name, const char *whandler_name);
|
||||
UINT8 * _memory_install_device_handler8 (const device_config *device, int cpunum, int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read8_device_func rhandler, write8_device_func whandler, const char *rhandler_name, const char *whandler_name);
|
||||
UINT16 * _memory_install_device_handler16(const device_config *device, int cpunum, int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read16_device_func rhandler, write16_device_func whandler, const char *rhandler_name, const char *whandler_name);
|
||||
UINT32 * _memory_install_device_handler32(const device_config *device, int cpunum, int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read32_device_func rhandler, write32_device_func whandler, const char *rhandler_name, const char *whandler_name);
|
||||
UINT64 * _memory_install_device_handler64(const device_config *device, int cpunum, int spacenum, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read64_device_func rhandler, write64_device_func whandler, const char *rhandler_name, const char *whandler_name);
|
||||
/* install a new memory handler into the given address space, returning a pointer to the memory backing it, if present */
|
||||
void *_memory_install_handler(const address_space *space, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, FPTR rhandler, FPTR whandler, const char *rhandler_name, const char *whandler_name);
|
||||
|
||||
/* memory debugging */
|
||||
void memory_dump(FILE *file);
|
||||
const char *memory_get_handler_string(int read0_or_write1, int cpunum, int spacenum, offs_t byteaddress);
|
||||
/* same as above but explicitly for 8-bit handlers */
|
||||
UINT8 *_memory_install_handler8(const address_space *space, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read8_space_func rhandler, write8_space_func whandler, const char *rhandler_name, const char *whandler_name);
|
||||
|
||||
/* same as above but explicitly for 16-bit handlers */
|
||||
UINT16 *_memory_install_handler16(const address_space *space, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read16_space_func rhandler, write16_space_func whandler, const char *rhandler_name, const char *whandler_name);
|
||||
|
||||
/* same as above but explicitly for 32-bit handlers */
|
||||
UINT32 *_memory_install_handler32(const address_space *space, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read32_space_func rhandler, write32_space_func whandler, const char *rhandler_name, const char *whandler_name);
|
||||
|
||||
/* same as above but explicitly for 64-bit handlers */
|
||||
UINT64 *_memory_install_handler64(const address_space *space, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read64_space_func rhandler, write64_space_func whandler, const char *rhandler_name, const char *whandler_name);
|
||||
|
||||
/* install a new device memory handler into the given address space, returning a pointer to the memory backing it, if present */
|
||||
void *_memory_install_device_handler(const address_space *space, const device_config *device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, FPTR rhandler, FPTR whandler, const char *rhandler_name, const char *whandler_name);
|
||||
|
||||
/* same as above but explicitly for 8-bit handlers */
|
||||
UINT8 *_memory_install_device_handler8(const address_space *space, const device_config *device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read8_device_func rhandler, write8_device_func whandler, const char *rhandler_name, const char *whandler_name);
|
||||
|
||||
/* same as above but explicitly for 16-bit handlers */
|
||||
UINT16 *_memory_install_device_handler16(const address_space *space, const device_config *device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read16_device_func rhandler, write16_device_func whandler, const char *rhandler_name, const char *whandler_name);
|
||||
|
||||
/* same as above but explicitly for 32-bit handlers */
|
||||
UINT32 *_memory_install_device_handler32(const address_space *space, const device_config *device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read32_device_func rhandler, write32_device_func whandler, const char *rhandler_name, const char *whandler_name);
|
||||
|
||||
/* same as above but explicitly for 64-bit handlers */
|
||||
UINT64 *_memory_install_device_handler64(const address_space *space, const device_config *device, offs_t addrstart, offs_t addrend, offs_t addrmask, offs_t addrmirror, read64_device_func rhandler, write64_device_func whandler, const char *rhandler_name, const char *whandler_name);
|
||||
|
||||
|
||||
|
||||
/* ----- debugger helpers ----- */
|
||||
|
||||
/* return a string describing the handler at a particular offset */
|
||||
const char *memory_get_handler_string(const address_space *space, int read0_or_write1, offs_t byteaddress);
|
||||
|
||||
/* enable/disable read watchpoint tracking for a given address space */
|
||||
void memory_enable_read_watchpoints(const address_space *space, int enable);
|
||||
|
||||
/* enable/disable write watchpoint tracking for a given address space */
|
||||
void memory_enable_write_watchpoints(const address_space *space, int enable);
|
||||
|
||||
/* control whether subsequent accesses are treated as coming from the debugger */
|
||||
void memory_set_debugger_access(const address_space *space, int debugger);
|
||||
|
||||
/* sets whether unmapped memory accesses should be logged or not */
|
||||
void memory_set_log_unmap(const address_space *space, int log);
|
||||
|
||||
/* gets whether unmapped memory accesses are being logged or not */
|
||||
int memory_get_log_unmap(const address_space *space);
|
||||
|
||||
/* dump the internal memory tables to the given file */
|
||||
void memory_dump(running_machine *machine, FILE *file);
|
||||
|
||||
|
||||
|
||||
@ -981,22 +1025,37 @@ const char *memory_get_handler_string(int read0_or_write1, int cpunum, int space
|
||||
|
||||
INLINE UINT8 memory_read_byte(const address_space *space, offs_t byteaddress)
|
||||
{
|
||||
return (*space->accessors.read_byte)(byteaddress);
|
||||
return (*space->accessors.read_byte)(space, byteaddress);
|
||||
}
|
||||
|
||||
INLINE UINT16 memory_read_word(const address_space *space, offs_t byteaddress)
|
||||
{
|
||||
return (*space->accessors.read_word)(byteaddress);
|
||||
return (*space->accessors.read_word)(space, byteaddress);
|
||||
}
|
||||
|
||||
INLINE UINT16 memory_read_word_masked(const address_space *space, offs_t byteaddress, UINT16 mask)
|
||||
{
|
||||
return (*space->accessors.read_word_masked)(space, byteaddress, mask);
|
||||
}
|
||||
|
||||
INLINE UINT32 memory_read_dword(const address_space *space, offs_t byteaddress)
|
||||
{
|
||||
return (*space->accessors.read_dword)(byteaddress);
|
||||
return (*space->accessors.read_dword)(space, byteaddress);
|
||||
}
|
||||
|
||||
INLINE UINT32 memory_read_dword_masked(const address_space *space, offs_t byteaddress, UINT32 mask)
|
||||
{
|
||||
return (*space->accessors.read_dword_masked)(space, byteaddress, mask);
|
||||
}
|
||||
|
||||
INLINE UINT64 memory_read_qword(const address_space *space, offs_t byteaddress)
|
||||
{
|
||||
return (*space->accessors.read_qword)(byteaddress);
|
||||
return (*space->accessors.read_qword)(space, byteaddress);
|
||||
}
|
||||
|
||||
INLINE UINT64 memory_read_qword_masked(const address_space *space, offs_t byteaddress, UINT64 mask)
|
||||
{
|
||||
return (*space->accessors.read_qword_masked)(space, byteaddress, mask);
|
||||
}
|
||||
|
||||
|
||||
@ -1007,22 +1066,37 @@ INLINE UINT64 memory_read_qword(const address_space *space, offs_t byteaddress)
|
||||
|
||||
INLINE void memory_write_byte(const address_space *space, offs_t byteaddress, UINT8 data)
|
||||
{
|
||||
(*space->accessors.write_byte)(byteaddress, data);
|
||||
(*space->accessors.write_byte)(space, byteaddress, data);
|
||||
}
|
||||
|
||||
INLINE void memory_write_word(const address_space *space, offs_t byteaddress, UINT16 data)
|
||||
{
|
||||
(*space->accessors.write_word)(byteaddress, data);
|
||||
(*space->accessors.write_word)(space, byteaddress, data);
|
||||
}
|
||||
|
||||
INLINE void memory_write_word_masked(const address_space *space, offs_t byteaddress, UINT16 data, UINT16 mask)
|
||||
{
|
||||
(*space->accessors.write_word_masked)(space, byteaddress, data, mask);
|
||||
}
|
||||
|
||||
INLINE void memory_write_dword(const address_space *space, offs_t byteaddress, UINT32 data)
|
||||
{
|
||||
(*space->accessors.write_dword)(byteaddress, data);
|
||||
(*space->accessors.write_dword)(space, byteaddress, data);
|
||||
}
|
||||
|
||||
INLINE void memory_write_dword_masked(const address_space *space, offs_t byteaddress, UINT32 data, UINT32 mask)
|
||||
{
|
||||
(*space->accessors.write_dword_masked)(space, byteaddress, data, mask);
|
||||
}
|
||||
|
||||
INLINE void memory_write_qword(const address_space *space, offs_t byteaddress, UINT64 data)
|
||||
{
|
||||
(*space->accessors.write_qword)(byteaddress, data);
|
||||
(*space->accessors.write_qword)(space, byteaddress, data);
|
||||
}
|
||||
|
||||
INLINE void memory_write_qword_masked(const address_space *space, offs_t byteaddress, UINT64 data, UINT64 mask)
|
||||
{
|
||||
(*space->accessors.write_qword_masked)(space, byteaddress, data, mask);
|
||||
}
|
||||
|
||||
|
||||
@ -1112,11 +1186,6 @@ INLINE UINT64 memory_raw_read_qword(const address_space *space, offs_t byteaddre
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------
|
||||
program_* - shortcuts to the above for the
|
||||
active program address space
|
||||
-------------------------------------------------*/
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
FUNCTION PROTOTYPES FOR CORE READ/WRITE ROUTINES
|
||||
|
@ -145,7 +145,7 @@ void atarijsa_init(running_machine *machine, const char *testport, int testmask)
|
||||
|
||||
/* install POKEY memory handlers */
|
||||
if (has_pokey)
|
||||
memory_install_readwrite8_handler(machine, cpu_num, ADDRESS_SPACE_PROGRAM, 0x2c00, 0x2c0f, 0, 0, pokey1_r, pokey1_w);
|
||||
memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[cpu_num], ADDRESS_SPACE_PROGRAM), 0x2c00, 0x2c0f, 0, 0, pokey1_r, pokey1_w);
|
||||
|
||||
init_save_state();
|
||||
atarijsa_reset();
|
||||
|
@ -170,7 +170,7 @@ void cage_init(running_machine *machine, offs_t speedup)
|
||||
timer[1] = timer_alloc(cage_timer_callback, NULL);
|
||||
|
||||
if (speedup)
|
||||
speedup_ram = memory_install_write32_handler(machine, cage_cpu, ADDRESS_SPACE_PROGRAM, speedup, speedup, 0, 0, speedup_w);
|
||||
speedup_ram = memory_install_write32_handler(cpu_get_address_space(machine->cpu[cage_cpu], ADDRESS_SPACE_PROGRAM), speedup, speedup, 0, 0, speedup_w);
|
||||
|
||||
state_save_register_global(cpu_to_cage_ready);
|
||||
state_save_register_global(cage_to_cpu_ready);
|
||||
|
@ -1599,7 +1599,7 @@ static WRITE8_HANDLER( qb3_sound_w )
|
||||
static MACHINE_RESET( qb3_sound )
|
||||
{
|
||||
MACHINE_RESET_CALL(demon_sound);
|
||||
memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x04, 0x04, 0, 0, qb3_sound_w);
|
||||
memory_install_write8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x04, 0x04, 0, 0, qb3_sound_w);
|
||||
|
||||
/* this patch prevents the sound ROM from eating itself when command $0A is sent */
|
||||
/* on a cube rotate */
|
||||
|
@ -924,7 +924,7 @@ void dcs_init(running_machine *machine)
|
||||
dcs.sounddata = dcs.bootrom;
|
||||
dcs.sounddata_words = dcs.bootrom_words;
|
||||
dcs.sounddata_banks = dcs.sounddata_words / 0x1000;
|
||||
memory_configure_bank(20, 0, dcs.sounddata_banks, dcs.sounddata, 0x1000*2);
|
||||
memory_configure_bank(machine, 20, 0, dcs.sounddata_banks, dcs.sounddata, 0x1000*2);
|
||||
|
||||
/* create the timers */
|
||||
dcs.internal_timer = timer_alloc(internal_timer_callback, NULL);
|
||||
@ -986,7 +986,7 @@ void dcs2_init(running_machine *machine, int dram_in_mb, offs_t polling_offset)
|
||||
}
|
||||
dcs.sounddata_banks = dcs.sounddata_words / soundbank_words;
|
||||
if (dcs.rev != 2)
|
||||
memory_configure_bank(20, 0, dcs.sounddata_banks, dcs.sounddata, soundbank_words*2);
|
||||
memory_configure_bank(machine, 20, 0, dcs.sounddata_banks, dcs.sounddata, soundbank_words*2);
|
||||
|
||||
/* allocate memory for the SRAM */
|
||||
dcs_sram = auto_malloc(0x8000*4);
|
||||
@ -1001,7 +1001,7 @@ void dcs2_init(running_machine *machine, int dram_in_mb, offs_t polling_offset)
|
||||
|
||||
/* install the speedup handler */
|
||||
if (polling_offset)
|
||||
dcs_polling_base = memory_install_read16_handler(machine, cpu_get_index(dcs.cpu), ADDRESS_SPACE_DATA, polling_offset, polling_offset, 0, 0, dcs_polling_r);
|
||||
dcs_polling_base = memory_install_read16_handler(cpu_get_address_space(dcs.cpu, ADDRESS_SPACE_DATA), polling_offset, polling_offset, 0, 0, dcs_polling_r);
|
||||
|
||||
/* allocate a watchdog timer for HLE transfers */
|
||||
transfer.hle_enabled = (ENABLE_HLE_TRANSFERS && dram_in_mb != 0);
|
||||
@ -1092,24 +1092,24 @@ static void sdrc_remap_memory(running_machine *machine)
|
||||
/* if SRAM disabled, clean it out */
|
||||
if (SDRC_SM_EN == 0)
|
||||
{
|
||||
memory_install_readwrite32_handler(machine, cpu_get_index(dcs.cpu), ADDRESS_SPACE_PROGRAM, 0x0800, 0x3fff, 0, 0, SMH_UNMAP, SMH_UNMAP);
|
||||
memory_install_readwrite16_handler(machine, cpu_get_index(dcs.cpu), ADDRESS_SPACE_DATA, 0x0800, 0x37ff, 0, 0, SMH_UNMAP, SMH_UNMAP);
|
||||
memory_install_readwrite32_handler(cpu_get_address_space(machine->cpu[cpu_get_index(dcs.cpu)], ADDRESS_SPACE_PROGRAM), 0x0800, 0x3fff, 0, 0, SMH_UNMAP, SMH_UNMAP);
|
||||
memory_install_readwrite16_handler(cpu_get_address_space(machine->cpu[cpu_get_index(dcs.cpu)], ADDRESS_SPACE_DATA), 0x0800, 0x37ff, 0, 0, SMH_UNMAP, SMH_UNMAP);
|
||||
}
|
||||
|
||||
/* otherwise, map the SRAM */
|
||||
else
|
||||
{
|
||||
/* first start with a clean program map */
|
||||
memory_install_readwrite32_handler(machine, cpu_get_index(dcs.cpu), ADDRESS_SPACE_PROGRAM, 0x0800, 0x3fff, 0, 0, SMH_BANK21, SMH_BANK21);
|
||||
memory_install_readwrite32_handler(cpu_get_address_space(machine->cpu[cpu_get_index(dcs.cpu)], ADDRESS_SPACE_PROGRAM), 0x0800, 0x3fff, 0, 0, SMH_BANK21, SMH_BANK21);
|
||||
memory_set_bankptr(21, dcs_sram + 0x4800);
|
||||
|
||||
/* set up the data map based on the SRAM banking */
|
||||
/* map 0: ram from 0800-37ff */
|
||||
if (SDRC_SM_BK == 0)
|
||||
{
|
||||
memory_install_readwrite16_handler(machine, cpu_get_index(dcs.cpu), ADDRESS_SPACE_DATA, 0x0800, 0x17ff, 0, 0, SMH_BANK22, SMH_BANK22);
|
||||
memory_install_readwrite16_handler(machine, cpu_get_index(dcs.cpu), ADDRESS_SPACE_DATA, 0x1800, 0x27ff, 0, 0, SMH_BANK23, SMH_BANK23);
|
||||
memory_install_readwrite16_handler(machine, cpu_get_index(dcs.cpu), ADDRESS_SPACE_DATA, 0x2800, 0x37ff, 0, 0, SMH_BANK24, SMH_BANK24);
|
||||
memory_install_readwrite16_handler(cpu_get_address_space(machine->cpu[cpu_get_index(dcs.cpu)], ADDRESS_SPACE_DATA), 0x0800, 0x17ff, 0, 0, SMH_BANK22, SMH_BANK22);
|
||||
memory_install_readwrite16_handler(cpu_get_address_space(machine->cpu[cpu_get_index(dcs.cpu)], ADDRESS_SPACE_DATA), 0x1800, 0x27ff, 0, 0, SMH_BANK23, SMH_BANK23);
|
||||
memory_install_readwrite16_handler(cpu_get_address_space(machine->cpu[cpu_get_index(dcs.cpu)], ADDRESS_SPACE_DATA), 0x2800, 0x37ff, 0, 0, SMH_BANK24, SMH_BANK24);
|
||||
memory_set_bankptr(22, dcs_sram + 0x0000);
|
||||
memory_set_bankptr(23, dcs_sram + 0x1000);
|
||||
memory_set_bankptr(24, dcs_sram + 0x2000);
|
||||
@ -1118,9 +1118,9 @@ static void sdrc_remap_memory(running_machine *machine)
|
||||
/* map 1: nothing from 0800-17ff, alternate RAM at 1800-27ff, same RAM at 2800-37ff */
|
||||
else
|
||||
{
|
||||
memory_install_readwrite16_handler(machine, cpu_get_index(dcs.cpu), ADDRESS_SPACE_DATA, 0x0800, 0x17ff, 0, 0, SMH_UNMAP, SMH_UNMAP);
|
||||
memory_install_readwrite16_handler(machine, cpu_get_index(dcs.cpu), ADDRESS_SPACE_DATA, 0x1800, 0x27ff, 0, 0, SMH_BANK23, SMH_BANK23);
|
||||
memory_install_readwrite16_handler(machine, cpu_get_index(dcs.cpu), ADDRESS_SPACE_DATA, 0x2800, 0x37ff, 0, 0, SMH_BANK24, SMH_BANK24);
|
||||
memory_install_readwrite16_handler(cpu_get_address_space(machine->cpu[cpu_get_index(dcs.cpu)], ADDRESS_SPACE_DATA), 0x0800, 0x17ff, 0, 0, SMH_UNMAP, SMH_UNMAP);
|
||||
memory_install_readwrite16_handler(cpu_get_address_space(machine->cpu[cpu_get_index(dcs.cpu)], ADDRESS_SPACE_DATA), 0x1800, 0x27ff, 0, 0, SMH_BANK23, SMH_BANK23);
|
||||
memory_install_readwrite16_handler(cpu_get_address_space(machine->cpu[cpu_get_index(dcs.cpu)], ADDRESS_SPACE_DATA), 0x2800, 0x37ff, 0, 0, SMH_BANK24, SMH_BANK24);
|
||||
memory_set_bankptr(23, dcs_sram + 0x3000);
|
||||
memory_set_bankptr(24, dcs_sram + 0x2000);
|
||||
}
|
||||
@ -1131,14 +1131,14 @@ static void sdrc_remap_memory(running_machine *machine)
|
||||
{
|
||||
int baseaddr = (SDRC_ROM_ST == 0) ? 0x0000 : (SDRC_ROM_ST == 1) ? 0x3000 : 0x3400;
|
||||
int pagesize = (SDRC_ROM_SZ == 0 && SDRC_ROM_ST != 0) ? 4096 : 1024;
|
||||
memory_install_read16_handler(machine, cpu_get_index(dcs.cpu), ADDRESS_SPACE_DATA, baseaddr, baseaddr + pagesize - 1, 0, 0, SMH_BANK25);
|
||||
memory_install_read16_handler(cpu_get_address_space(dcs.cpu, ADDRESS_SPACE_DATA), baseaddr, baseaddr + pagesize - 1, 0, 0, SMH_BANK25);
|
||||
}
|
||||
|
||||
/* map the DRAM page as bank 26 */
|
||||
if (SDRC_DM_ST != 0)
|
||||
{
|
||||
int baseaddr = (SDRC_DM_ST == 1) ? 0x0000 : (SDRC_DM_ST == 2) ? 0x3000 : 0x3400;
|
||||
memory_install_readwrite16_handler(machine, cpu_get_index(dcs.cpu), ADDRESS_SPACE_DATA, baseaddr, baseaddr + 0x3ff, 0, 0, SMH_BANK26, SMH_BANK26);
|
||||
memory_install_readwrite16_handler(cpu_get_address_space(machine->cpu[cpu_get_index(dcs.cpu)], ADDRESS_SPACE_DATA), baseaddr, baseaddr + 0x3ff, 0, 0, SMH_BANK26, SMH_BANK26);
|
||||
}
|
||||
|
||||
/* update the bank pointers */
|
||||
|
@ -271,7 +271,7 @@ void cojag_sound_init(running_machine *machine)
|
||||
}
|
||||
|
||||
#if ENABLE_SPEEDUP_HACKS
|
||||
memory_install_write32_handler(machine, 2, ADDRESS_SPACE_PROGRAM, 0xf1a100, 0xf1a103, 0, 0, dsp_flags_w);
|
||||
memory_install_write32_handler(cpu_get_address_space(machine->cpu[2], ADDRESS_SPACE_PROGRAM), 0xf1a100, 0xf1a103, 0, 0, dsp_flags_w);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -1419,11 +1419,11 @@ static WRITE16_HANDLER( i80186_internal_port_w )
|
||||
|
||||
temp = (i80186.mem.peripheral & 0xffc0) << 4;
|
||||
if (i80186.mem.middle_size & 0x0040)
|
||||
memory_install_readwrite16_handler(space->machine, 2, ADDRESS_SPACE_PROGRAM, temp, temp + 0x2ff, 0, 0, peripheral_r, peripheral_w);
|
||||
memory_install_readwrite16_handler(cpu_get_address_space(space->cpu, ADDRESS_SPACE_PROGRAM), temp, temp + 0x2ff, 0, 0, peripheral_r, peripheral_w);
|
||||
else
|
||||
{
|
||||
temp &= 0xffff;
|
||||
memory_install_readwrite16_handler(space->machine, 2, ADDRESS_SPACE_IO, temp, temp + 0x2ff, 0, 0, peripheral_r, peripheral_w);
|
||||
memory_install_readwrite16_handler(cpu_get_address_space(space->cpu, ADDRESS_SPACE_IO), temp, temp + 0x2ff, 0, 0, peripheral_r, peripheral_w);
|
||||
}
|
||||
|
||||
/* we need to do this at a time when the 80186 context is swapped in */
|
||||
@ -1488,11 +1488,11 @@ static WRITE16_HANDLER( i80186_internal_port_w )
|
||||
/* okay to leave us mapped where we were */
|
||||
temp = (data & 0x0fff) << 8;
|
||||
if (data & 0x1000)
|
||||
memory_install_readwrite16_handler(space->machine, 2, ADDRESS_SPACE_PROGRAM, temp, temp + 0xff, 0, 0, i80186_internal_port_r, i80186_internal_port_w);
|
||||
memory_install_readwrite16_handler(cpu_get_address_space(space->cpu, ADDRESS_SPACE_PROGRAM), temp, temp + 0xff, 0, 0, i80186_internal_port_r, i80186_internal_port_w);
|
||||
else
|
||||
{
|
||||
temp &= 0xffff;
|
||||
memory_install_readwrite16_handler(space->machine, 2, ADDRESS_SPACE_IO, temp, temp + 0xff, 0, 0, i80186_internal_port_r, i80186_internal_port_w);
|
||||
memory_install_readwrite16_handler(cpu_get_address_space(space->cpu, ADDRESS_SPACE_IO), temp, temp + 0xff, 0, 0, i80186_internal_port_r, i80186_internal_port_w);
|
||||
}
|
||||
/* popmessage("Sound CPU reset");*/
|
||||
break;
|
||||
|
@ -267,9 +267,9 @@ static SOUND_START( mario )
|
||||
if (audiocpu != -1 && machine->config->cpu[audiocpu].type != CPU_Z80)
|
||||
{
|
||||
state->eabank = 1;
|
||||
memory_install_read8_handler(machine, audiocpu, ADDRESS_SPACE_PROGRAM, 0x000, 0x7ff, 0, 0, SMH_BANK1);
|
||||
memory_configure_bank(1, 0, 1, memory_region(machine, "audio"), 0);
|
||||
memory_configure_bank(1, 1, 1, memory_region(machine, "audio") + 0x1000, 0x800);
|
||||
memory_install_read8_handler(cpu_get_address_space(machine->cpu[audiocpu], ADDRESS_SPACE_PROGRAM), 0x000, 0x7ff, 0, 0, SMH_BANK1);
|
||||
memory_configure_bank(machine, 1, 0, 1, memory_region(machine, "audio"), 0);
|
||||
memory_configure_bank(machine, 1, 1, 1, memory_region(machine, "audio") + 0x1000, 0x800);
|
||||
}
|
||||
|
||||
state_save_register_global(state->last);
|
||||
|
@ -89,7 +89,7 @@ void namcoc7x_on_driver_init(running_machine *machine)
|
||||
// install speedup cheat
|
||||
for (cpunum = 0; cpunum < MAX_CPU; cpunum++)
|
||||
if (machine->config->cpu[cpunum].type == CPU_M37702)
|
||||
memory_install_readwrite16_handler(machine, cpunum, ADDRESS_SPACE_PROGRAM, 0x82, 0x83, 0, 0, speedup_r, speedup_w);
|
||||
memory_install_readwrite16_handler(cpu_get_address_space(machine->cpu[cpunum], ADDRESS_SPACE_PROGRAM), 0x82, 0x83, 0, 0, speedup_r, speedup_w);
|
||||
}
|
||||
|
||||
void namcoc7x_set_host_ram(UINT32 *hostram)
|
||||
|
@ -105,11 +105,12 @@ static UINT8 decrypt_opcode(int a,int src)
|
||||
|
||||
void seibu_sound_decrypt(running_machine *machine,const char *cpu,int length)
|
||||
{
|
||||
const address_space *space = cputag_get_address_space(machine, cpu, ADDRESS_SPACE_PROGRAM);
|
||||
UINT8 *decrypt = auto_malloc(length);
|
||||
UINT8 *rom = memory_region(machine, cpu);
|
||||
int i;
|
||||
|
||||
memory_set_decrypted_region(mame_find_cpu_index(machine, cpu), 0x0000, (length < 0x10000) ? (length - 1) : 0x1fff, decrypt);
|
||||
memory_set_decrypted_region(space, 0x0000, (length < 0x10000) ? (length - 1) : 0x1fff, decrypt);
|
||||
|
||||
for (i = 0;i < length;i++)
|
||||
{
|
||||
@ -120,7 +121,7 @@ void seibu_sound_decrypt(running_machine *machine,const char *cpu,int length)
|
||||
}
|
||||
|
||||
if (length > 0x10000)
|
||||
memory_configure_bank_decrypted(1, 0, (length - 0x10000) / 0x8000, decrypt + 0x10000, 0x8000);
|
||||
memory_configure_bank_decrypted(machine, 1, 0, (length - 0x10000) / 0x8000, decrypt + 0x10000, 0x8000);
|
||||
}
|
||||
|
||||
|
||||
@ -362,7 +363,7 @@ MACHINE_RESET( seibu_sound )
|
||||
sound_cpu=mame_find_cpu_index(machine, "audio");
|
||||
update_irq_lines(machine, VECTOR_INIT);
|
||||
if (romlength > 0x10000)
|
||||
memory_configure_bank(1, 0, (romlength - 0x10000) / 0x8000, rom + 0x10000, 0x8000);
|
||||
memory_configure_bank(machine, 1, 0, (romlength - 0x10000) / 0x8000, rom + 0x10000, 0x8000);
|
||||
}
|
||||
|
||||
/***************************************************************************/
|
||||
|
@ -282,7 +282,7 @@ void williams_cvsd_init(int pianum)
|
||||
D3 -> A16
|
||||
*/
|
||||
offs_t offset = 0x8000 * ((bank >> 2) & 3) + 0x20000 * (bank & 3);
|
||||
memory_configure_bank(5, bank, 1, &ROM[0x10000 + offset], 0);
|
||||
memory_configure_bank(Machine, 5, bank, 1, &ROM[0x10000 + offset], 0);
|
||||
}
|
||||
memory_set_bank(5, 0);
|
||||
|
||||
@ -314,7 +314,7 @@ void williams_narc_init(void)
|
||||
D3 -> A16
|
||||
*/
|
||||
offs_t offset = 0x8000 * (bank & 1) + 0x10000 * ((bank >> 3) & 1) + 0x20000 * ((bank >> 1) & 3);
|
||||
memory_configure_bank(5, bank, 1, &ROM[0x10000 + offset], 0);
|
||||
memory_configure_bank(Machine, 5, bank, 1, &ROM[0x10000 + offset], 0);
|
||||
}
|
||||
memory_set_bankptr(6, &ROM[0x10000 + 0x4000 + 0x8000 + 0x10000 + 0x20000 * 3]);
|
||||
|
||||
@ -328,7 +328,7 @@ void williams_narc_init(void)
|
||||
D3 -> A16
|
||||
*/
|
||||
offs_t offset = 0x8000 * (bank & 1) + 0x10000 * ((bank >> 3) & 1) + 0x20000 * ((bank >> 1) & 3);
|
||||
memory_configure_bank(7, bank, 1, &ROM[0x10000 + offset], 0);
|
||||
memory_configure_bank(Machine, 7, bank, 1, &ROM[0x10000 + offset], 0);
|
||||
}
|
||||
memory_set_bankptr(8, &ROM[0x10000 + 0x4000 + 0x8000 + 0x10000 + 0x20000 * 3]);
|
||||
|
||||
@ -349,7 +349,7 @@ void williams_adpcm_init(void)
|
||||
|
||||
/* configure banks */
|
||||
ROM = memory_region(Machine, "adpcm");
|
||||
memory_configure_bank(5, 0, 8, &ROM[0x10000], 0x8000);
|
||||
memory_configure_bank(Machine, 5, 0, 8, &ROM[0x10000], 0x8000);
|
||||
memory_set_bankptr(6, &ROM[0x10000 + 0x4000 + 7 * 0x8000]);
|
||||
|
||||
/* expand ADPCM data */
|
||||
|
@ -478,7 +478,7 @@ ROM_END
|
||||
static DRIVER_INIT( 1942 )
|
||||
{
|
||||
UINT8 *ROM = memory_region(machine, "main");
|
||||
memory_configure_bank(1, 0, 3, &ROM[0x10000], 0x4000);
|
||||
memory_configure_bank(machine, 1, 0, 3, &ROM[0x10000], 0x4000);
|
||||
}
|
||||
|
||||
|
||||
|
@ -598,7 +598,7 @@ static READ8_HANDLER( undoukai_mcu_status_r )
|
||||
static DRIVER_INIT( undoukai )
|
||||
{
|
||||
UINT8 *ROM = memory_region(machine, "main");
|
||||
memory_configure_bank(1, 0, 2, &ROM[0x10000], 0x2000);
|
||||
memory_configure_bank(machine, 1, 0, 2, &ROM[0x10000], 0x2000);
|
||||
|
||||
from_mcu = 0xff;
|
||||
mcu_cmd = -1;
|
||||
@ -612,7 +612,7 @@ static DRIVER_INIT( undoukai )
|
||||
static DRIVER_INIT( 40love )
|
||||
{
|
||||
UINT8 *ROM = memory_region(machine, "main");
|
||||
memory_configure_bank(1, 0, 2, &ROM[0x10000], 0x2000);
|
||||
memory_configure_bank(machine, 1, 0, 2, &ROM[0x10000], 0x2000);
|
||||
|
||||
#if 0
|
||||
/* character ROM hack
|
||||
|
@ -576,12 +576,12 @@ static READ8_HANDLER( cyclej_r )
|
||||
|
||||
static DRIVER_INIT( actfancr )
|
||||
{
|
||||
memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f0026, 0x1f0027, 0, 0, cycle_r);
|
||||
memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x1f0026, 0x1f0027, 0, 0, cycle_r);
|
||||
}
|
||||
|
||||
static DRIVER_INIT( actfancj )
|
||||
{
|
||||
memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1f0026, 0x1f0027, 0, 0, cyclej_r);
|
||||
memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x1f0026, 0x1f0027, 0, 0, cyclej_r);
|
||||
}
|
||||
|
||||
|
||||
|
@ -762,7 +762,7 @@ ROM_END
|
||||
|
||||
static DRIVER_INIT( airbustr )
|
||||
{
|
||||
memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe000, 0xefff, 0, 0, devram_r); // protection device lives here
|
||||
memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0xe000, 0xefff, 0, 0, devram_r); // protection device lives here
|
||||
}
|
||||
|
||||
|
||||
|
@ -156,8 +156,8 @@ static READ16_HANDLER( aladbl_r )
|
||||
static DRIVER_INIT( aladbl )
|
||||
{
|
||||
// 220000 = writes to mcu? 330000 = reads?
|
||||
memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x220000, 0x220001, 0, 0, aladbl_w);
|
||||
memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x330000, 0x330001, 0, 0, aladbl_r);
|
||||
memory_install_write16_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x220000, 0x220001, 0, 0, aladbl_w);
|
||||
memory_install_read16_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x330000, 0x330001, 0, 0, aladbl_r);
|
||||
DRIVER_INIT_CALL(megadrij);
|
||||
}
|
||||
|
||||
|
@ -203,11 +203,11 @@ static void alg_cia_0_porta_w(UINT8 data)
|
||||
/* swap the write handlers between ROM and bank 1 based on the bit */
|
||||
if ((data & 1) == 0)
|
||||
/* overlay disabled, map RAM on 0x000000 */
|
||||
memory_install_write16_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, 0x000000, 0x07ffff, 0, 0, SMH_BANK1);
|
||||
memory_install_write16_handler(cpu_get_address_space(Machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x000000, 0x07ffff, 0, 0, SMH_BANK1);
|
||||
|
||||
else
|
||||
/* overlay enabled, map Amiga system ROM on 0x000000 */
|
||||
memory_install_write16_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, 0x000000, 0x07ffff, 0, 0, SMH_UNMAP);
|
||||
memory_install_write16_handler(cpu_get_address_space(Machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x000000, 0x07ffff, 0, 0, SMH_UNMAP);
|
||||
}
|
||||
|
||||
|
||||
@ -659,8 +659,8 @@ static void alg_init(running_machine *machine)
|
||||
amiga_machine_config(machine, &alg_intf);
|
||||
|
||||
/* set up memory */
|
||||
memory_configure_bank(1, 0, 1, amiga_chip_ram, 0);
|
||||
memory_configure_bank(1, 1, 1, memory_region(machine, "user1"), 0);
|
||||
memory_configure_bank(machine, 1, 0, 1, amiga_chip_ram, 0);
|
||||
memory_configure_bank(machine, 1, 1, 1, memory_region(machine, "user1"), 0);
|
||||
}
|
||||
|
||||
|
||||
|
@ -3135,7 +3135,7 @@ static DRIVER_INIT( jongbou )
|
||||
|
||||
alpha68k_video_banking = jongbou_video_banking;
|
||||
|
||||
memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0c0000, 0x0c0001, 0, 0, jongbou_inputs_r);
|
||||
memory_install_read16_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x0c0000, 0x0c0001, 0, 0, jongbou_inputs_r);
|
||||
}
|
||||
|
||||
static DRIVER_INIT( paddlema )
|
||||
@ -3146,7 +3146,7 @@ static DRIVER_INIT( paddlema )
|
||||
|
||||
static DRIVER_INIT( timesold )
|
||||
{
|
||||
memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x40008, 0x40009, 0, 0, timesold_cycle_r);
|
||||
memory_install_read16_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x40008, 0x40009, 0, 0, timesold_cycle_r);
|
||||
invert_controls=0;
|
||||
microcontroller_id=0;
|
||||
coin_id=0x22|(0x22<<8);
|
||||
@ -3154,7 +3154,7 @@ static DRIVER_INIT( timesold )
|
||||
|
||||
static DRIVER_INIT( timesol1 )
|
||||
{
|
||||
memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x40008, 0x40009, 0, 0, timesol1_cycle_r);
|
||||
memory_install_read16_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x40008, 0x40009, 0, 0, timesol1_cycle_r);
|
||||
invert_controls=1;
|
||||
microcontroller_id=0;
|
||||
coin_id=0x22|(0x22<<8);
|
||||
@ -3162,7 +3162,7 @@ static DRIVER_INIT( timesol1 )
|
||||
|
||||
static DRIVER_INIT( btlfield )
|
||||
{
|
||||
memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x40008, 0x40009, 0, 0, btlfield_cycle_r);
|
||||
memory_install_read16_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x40008, 0x40009, 0, 0, btlfield_cycle_r);
|
||||
invert_controls=1;
|
||||
microcontroller_id=0;
|
||||
coin_id=0x22|(0x22<<8);
|
||||
@ -3177,7 +3177,7 @@ static DRIVER_INIT( btlfildb )
|
||||
|
||||
static DRIVER_INIT( skysoldr )
|
||||
{
|
||||
memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x40008, 0x40009, 0, 0, skysoldr_cycle_r);
|
||||
memory_install_read16_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x40008, 0x40009, 0, 0, skysoldr_cycle_r);
|
||||
memory_set_bankptr(8, (memory_region(machine, "user1"))+0x40000);
|
||||
invert_controls=0;
|
||||
microcontroller_id=0;
|
||||
@ -3201,7 +3201,7 @@ static DRIVER_INIT( goldmeda )
|
||||
|
||||
static DRIVER_INIT( skyadvnt )
|
||||
{
|
||||
memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x40008, 0x40009, 0, 0, skyadvnt_cycle_r);
|
||||
memory_install_read16_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x40008, 0x40009, 0, 0, skyadvnt_cycle_r);
|
||||
invert_controls=0;
|
||||
microcontroller_id=0x8814;
|
||||
coin_id=0x22|(0x22<<8);
|
||||
@ -3209,7 +3209,7 @@ static DRIVER_INIT( skyadvnt )
|
||||
|
||||
static DRIVER_INIT( skyadvnu )
|
||||
{
|
||||
memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x40008, 0x40009, 0, 0, skyadvnt_cycle_r);
|
||||
memory_install_read16_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x40008, 0x40009, 0, 0, skyadvnt_cycle_r);
|
||||
invert_controls=0;
|
||||
microcontroller_id=0x8814;
|
||||
coin_id=0x23|(0x24<<8);
|
||||
@ -3217,7 +3217,7 @@ static DRIVER_INIT( skyadvnu )
|
||||
|
||||
static DRIVER_INIT( gangwars )
|
||||
{
|
||||
memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x40206, 0x40207, 0, 0, gangwars_cycle_r);
|
||||
memory_install_read16_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x40206, 0x40207, 0, 0, gangwars_cycle_r);
|
||||
memory_set_bankptr(8, memory_region(machine, "user1"));
|
||||
invert_controls=0;
|
||||
microcontroller_id=0x8512;
|
||||
@ -3226,7 +3226,7 @@ static DRIVER_INIT( gangwars )
|
||||
|
||||
static DRIVER_INIT( gangwarb )
|
||||
{
|
||||
memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x40206, 0x40207, 0, 0, gangwarb_cycle_r);
|
||||
memory_install_read16_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x40206, 0x40207, 0, 0, gangwarb_cycle_r);
|
||||
memory_set_bankptr(8, memory_region(machine, "user1"));
|
||||
invert_controls=0;
|
||||
microcontroller_id=0x8512;
|
||||
|
@ -554,7 +554,8 @@ static DRIVER_INIT(robowres){
|
||||
}
|
||||
|
||||
static DRIVER_INIT(robowrb){
|
||||
memory_set_decrypted_region(0, 0x0000, 0x7fff, memory_region(machine, "main") + 0x1c000);
|
||||
const address_space *space = cputag_get_address_space(machine, "main", ADDRESS_SPACE_PROGRAM);
|
||||
memory_set_decrypted_region(space, 0x0000, 0x7fff, memory_region(machine, "main") + 0x1c000);
|
||||
}
|
||||
|
||||
|
||||
|
@ -436,8 +436,8 @@ ROM_END
|
||||
|
||||
static DRIVER_INIT( arabian )
|
||||
{
|
||||
memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xd34b, 0xd34b, 0, 0, custom_flip_w);
|
||||
memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xd400, 0xd401, 0, 0, custom_cocktail_w);
|
||||
memory_install_write8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0xd34b, 0xd34b, 0, 0, custom_flip_w);
|
||||
memory_install_write8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0xd400, 0xd401, 0, 0, custom_cocktail_w);
|
||||
}
|
||||
|
||||
|
||||
|
@ -72,7 +72,7 @@ static UINT8 coin_counter[2];
|
||||
|
||||
static WRITE16_HANDLER( arcadia_multibios_change_game )
|
||||
{
|
||||
memory_install_read16_handler(space->machine, 0, ADDRESS_SPACE_PROGRAM, 0x800000, 0x97ffff, 0, 0, (data == 0) ? SMH_BANK2 : SMH_NOP);
|
||||
memory_install_read16_handler(space, 0x800000, 0x97ffff, 0, 0, (data == 0) ? SMH_BANK2 : SMH_NOP);
|
||||
}
|
||||
|
||||
|
||||
@ -105,11 +105,11 @@ static void arcadia_cia_0_porta_w(UINT8 data)
|
||||
/* swap the write handlers between ROM and bank 1 based on the bit */
|
||||
if ((data & 1) == 0)
|
||||
/* overlay disabled, map RAM on 0x000000 */
|
||||
memory_install_write16_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, 0x000000, 0x07ffff, 0, 0, SMH_BANK1);
|
||||
memory_install_write16_handler(cpu_get_address_space(Machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x000000, 0x07ffff, 0, 0, SMH_BANK1);
|
||||
|
||||
else
|
||||
/* overlay enabled, map Amiga system ROM on 0x000000 */
|
||||
memory_install_write16_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, 0x000000, 0x07ffff, 0, 0, SMH_UNMAP);
|
||||
memory_install_write16_handler(cpu_get_address_space(Machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x000000, 0x07ffff, 0, 0, SMH_UNMAP);
|
||||
|
||||
/* bit 2 = Power Led on Amiga */
|
||||
set_led_status(0, (data & 2) ? 0 : 1);
|
||||
@ -670,8 +670,8 @@ static void arcadia_init(running_machine *machine)
|
||||
amiga_machine_config(machine, &arcadia_intf);
|
||||
|
||||
/* set up memory */
|
||||
memory_configure_bank(1, 0, 1, amiga_chip_ram, 0);
|
||||
memory_configure_bank(1, 1, 1, memory_region(machine, "user1"), 0);
|
||||
memory_configure_bank(machine, 1, 0, 1, amiga_chip_ram, 0);
|
||||
memory_configure_bank(machine, 1, 1, 1, memory_region(machine, "user1"), 0);
|
||||
|
||||
/* OnePlay bios is encrypted, TenPlay is not */
|
||||
biosrom = (UINT16 *)memory_region(machine, "user2");
|
||||
|
@ -1100,9 +1100,9 @@ ROM_END
|
||||
|
||||
static void arkanoid_bootleg_init( running_machine *machine )
|
||||
{
|
||||
memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf002, 0xf002, 0, 0, arkanoid_bootleg_f002_r );
|
||||
memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xd018, 0xd018, 0, 0, arkanoid_bootleg_d018_w );
|
||||
memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xd008, 0xd008, 0, 0, arkanoid_bootleg_d008_r );
|
||||
memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0xf002, 0xf002, 0, 0, arkanoid_bootleg_f002_r );
|
||||
memory_install_write8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0xd018, 0xd018, 0, 0, arkanoid_bootleg_d018_w );
|
||||
memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0xd008, 0xd008, 0, 0, arkanoid_bootleg_d008_r );
|
||||
}
|
||||
|
||||
static DRIVER_INIT( arkangc )
|
||||
|
@ -879,7 +879,7 @@ static DRIVER_INIT( ultennis )
|
||||
protection_handler = ultennis_protection;
|
||||
|
||||
/* additional (protection?) hack */
|
||||
memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x300000, 0x300001, 0, 0, ultennis_hack_r);
|
||||
memory_install_read16_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x300000, 0x300001, 0, 0, ultennis_hack_r);
|
||||
}
|
||||
|
||||
|
||||
|
@ -879,14 +879,14 @@ ROM_END
|
||||
|
||||
static DRIVER_INIT( asteroib )
|
||||
{
|
||||
memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x2000, 0, 0, input_port_read_handler8(machine->portconfig, "IN0"));
|
||||
memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2003, 0x2003, 0, 0, input_port_read_handler8(machine->portconfig, "HS"));
|
||||
memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x2000, 0x2000, 0, 0, input_port_read_handler8(machine->portconfig, "IN0"));
|
||||
memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x2003, 0x2003, 0, 0, input_port_read_handler8(machine->portconfig, "HS"));
|
||||
}
|
||||
|
||||
|
||||
static DRIVER_INIT( asterock )
|
||||
{
|
||||
memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x2000, 0x2007, 0, 0, asterock_IN0_r);
|
||||
memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x2000, 0x2007, 0, 0, asterock_IN0_r);
|
||||
}
|
||||
|
||||
|
||||
|
@ -421,12 +421,12 @@ static WRITE8_HANDLER( profpac_banksw_w )
|
||||
profpac_bank = data;
|
||||
|
||||
/* set the main banking */
|
||||
memory_install_read8_handler(space->machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0xbfff, 0, 0, SMH_BANK1);
|
||||
memory_install_read8_handler(space, 0x4000, 0xbfff, 0, 0, SMH_BANK1);
|
||||
memory_set_bankptr(1, memory_region(space->machine, "user1") + 0x8000 * bank);
|
||||
|
||||
/* bank 0 reads video RAM in the 4000-7FFF range */
|
||||
if (bank == 0)
|
||||
memory_install_read8_handler(space->machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x7fff, 0, 0, profpac_videoram_r);
|
||||
memory_install_read8_handler(space, 0x4000, 0x7fff, 0, 0, profpac_videoram_r);
|
||||
|
||||
/* if we have a 640k EPROM board, map that on top of the 4000-7FFF range if specified */
|
||||
if ((data & 0x80) && memory_region(space->machine, "user2") != NULL)
|
||||
@ -437,11 +437,11 @@ static WRITE8_HANDLER( profpac_banksw_w )
|
||||
/* if the bank is in range, map the appropriate bank */
|
||||
if (bank < 0x28)
|
||||
{
|
||||
memory_install_read8_handler(space->machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x7fff, 0, 0, SMH_BANK2);
|
||||
memory_install_read8_handler(space, 0x4000, 0x7fff, 0, 0, SMH_BANK2);
|
||||
memory_set_bankptr(2, memory_region(space->machine, "user2") + 0x4000 * bank);
|
||||
}
|
||||
else
|
||||
memory_install_read8_handler(space->machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x7fff, 0, 0, SMH_UNMAP);
|
||||
memory_install_read8_handler(space, 0x4000, 0x7fff, 0, 0, SMH_UNMAP);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1672,48 +1672,48 @@ ROM_END
|
||||
static DRIVER_INIT( seawolf2 )
|
||||
{
|
||||
astrocade_video_config = 0x00;
|
||||
memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x40, 0x40, 0, 0xff18, seawolf2_sound_1_w);
|
||||
memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x41, 0x41, 0, 0xff18, seawolf2_sound_2_w);
|
||||
memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x42, 0x43, 0, 0xff18, seawolf2_lamps_w);
|
||||
memory_install_write8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x40, 0x40, 0, 0xff18, seawolf2_sound_1_w);
|
||||
memory_install_write8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x41, 0x41, 0, 0xff18, seawolf2_sound_2_w);
|
||||
memory_install_write8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x42, 0x43, 0, 0xff18, seawolf2_lamps_w);
|
||||
}
|
||||
|
||||
|
||||
static DRIVER_INIT( ebases )
|
||||
{
|
||||
astrocade_video_config = AC_SOUND_PRESENT;
|
||||
memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x20, 0x20, 0, 0xff07, ebases_coin_w);
|
||||
memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x28, 0x28, 0, 0xff07, ebases_trackball_select_w);
|
||||
memory_install_write8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x20, 0x20, 0, 0xff07, ebases_coin_w);
|
||||
memory_install_write8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x28, 0x28, 0, 0xff07, ebases_trackball_select_w);
|
||||
}
|
||||
|
||||
|
||||
static DRIVER_INIT( spacezap )
|
||||
{
|
||||
astrocade_video_config = AC_SOUND_PRESENT;
|
||||
memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x13, 0x13, 0x03ff, 0xff00, spacezap_io_r);
|
||||
memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x13, 0x13, 0x03ff, 0xff00, spacezap_io_r);
|
||||
}
|
||||
|
||||
|
||||
static DRIVER_INIT( wow )
|
||||
{
|
||||
astrocade_video_config = AC_SOUND_PRESENT | AC_LIGHTPEN_INTS | AC_STARS;
|
||||
memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x15, 0x15, 0x0fff, 0xff00, wow_io_r);
|
||||
memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x17, 0x17, 0xffff, 0xff00, wow_speech_r);
|
||||
memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x15, 0x15, 0x0fff, 0xff00, wow_io_r);
|
||||
memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x17, 0x17, 0xffff, 0xff00, wow_speech_r);
|
||||
}
|
||||
|
||||
|
||||
static DRIVER_INIT( gorf )
|
||||
{
|
||||
astrocade_video_config = AC_SOUND_PRESENT | AC_LIGHTPEN_INTS | AC_STARS;
|
||||
memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x15, 0x15, 0x0fff, 0xff00, gorf_io_1_r);
|
||||
memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x16, 0x16, 0x0fff, 0xff00, gorf_io_2_r);
|
||||
memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x17, 0x17, 0xffff, 0xff00, gorf_speech_r);
|
||||
memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x15, 0x15, 0x0fff, 0xff00, gorf_io_1_r);
|
||||
memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x16, 0x16, 0x0fff, 0xff00, gorf_io_2_r);
|
||||
memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x17, 0x17, 0xffff, 0xff00, gorf_speech_r);
|
||||
}
|
||||
|
||||
|
||||
static DRIVER_INIT( robby )
|
||||
{
|
||||
astrocade_video_config = AC_SOUND_PRESENT;
|
||||
memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x15, 0x15, 0x0fff, 0xff00, robby_io_r);
|
||||
memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x15, 0x15, 0x0fff, 0xff00, robby_io_r);
|
||||
}
|
||||
|
||||
|
||||
@ -1722,8 +1722,8 @@ static DRIVER_INIT( profpac )
|
||||
const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
|
||||
|
||||
astrocade_video_config = AC_SOUND_PRESENT;
|
||||
memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x14, 0x14, 0x0fff, 0xff00, profpac_io_1_r);
|
||||
memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x15, 0x15, 0x77ff, 0xff00, profpac_io_2_r);
|
||||
memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x14, 0x14, 0x0fff, 0xff00, profpac_io_1_r);
|
||||
memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x15, 0x15, 0x77ff, 0xff00, profpac_io_2_r);
|
||||
|
||||
/* reset banking */
|
||||
profpac_banksw_w(space, 0, 0);
|
||||
@ -1736,10 +1736,10 @@ static DRIVER_INIT( demndrgn )
|
||||
const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
|
||||
|
||||
astrocade_video_config = 0x00;
|
||||
memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x14, 0x14, 0x1fff, 0xff00, demndrgn_io_r);
|
||||
memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x1c, 0x1c, 0x0000, 0xff00, input_port_read_handler8(machine->portconfig, "FIREX"));
|
||||
memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x1d, 0x1d, 0x0000, 0xff00, input_port_read_handler8(machine->portconfig, "FIREY"));
|
||||
memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x97, 0x97, 0x0000, 0xff00, demndrgn_sound_w);
|
||||
memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x14, 0x14, 0x1fff, 0xff00, demndrgn_io_r);
|
||||
memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x1c, 0x1c, 0x0000, 0xff00, input_port_read_handler8(machine->portconfig, "FIREX"));
|
||||
memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x1d, 0x1d, 0x0000, 0xff00, input_port_read_handler8(machine->portconfig, "FIREY"));
|
||||
memory_install_write8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x97, 0x97, 0x0000, 0xff00, demndrgn_sound_w);
|
||||
|
||||
/* reset banking */
|
||||
profpac_banksw_w(space, 0, 0);
|
||||
@ -1752,15 +1752,15 @@ static DRIVER_INIT( tenpindx )
|
||||
const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
|
||||
|
||||
astrocade_video_config = 0x00;
|
||||
memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x60, 0x60, 0x0000, 0xff00, input_port_read_handler8(machine->portconfig, "P60"));
|
||||
memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x61, 0x61, 0x0000, 0xff00, input_port_read_handler8(machine->portconfig, "P61"));
|
||||
memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x62, 0x62, 0x0000, 0xff00, input_port_read_handler8(machine->portconfig, "P62"));
|
||||
memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x63, 0x63, 0x0000, 0xff00, input_port_read_handler8(machine->portconfig, "P63"));
|
||||
memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x64, 0x64, 0x0000, 0xff00, input_port_read_handler8(machine->portconfig, "P64"));
|
||||
memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x65, 0x66, 0x0000, 0xff00, tenpindx_lamp_w);
|
||||
memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x67, 0x67, 0x0000, 0xff00, tenpindx_counter_w);
|
||||
memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x68, 0x68, 0x0000, 0xff00, tenpindx_lights_w);
|
||||
memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x97, 0x97, 0x0000, 0xff00, tenpindx_sound_w);
|
||||
memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x60, 0x60, 0x0000, 0xff00, input_port_read_handler8(machine->portconfig, "P60"));
|
||||
memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x61, 0x61, 0x0000, 0xff00, input_port_read_handler8(machine->portconfig, "P61"));
|
||||
memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x62, 0x62, 0x0000, 0xff00, input_port_read_handler8(machine->portconfig, "P62"));
|
||||
memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x63, 0x63, 0x0000, 0xff00, input_port_read_handler8(machine->portconfig, "P63"));
|
||||
memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x64, 0x64, 0x0000, 0xff00, input_port_read_handler8(machine->portconfig, "P64"));
|
||||
memory_install_write8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x65, 0x66, 0x0000, 0xff00, tenpindx_lamp_w);
|
||||
memory_install_write8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x67, 0x67, 0x0000, 0xff00, tenpindx_counter_w);
|
||||
memory_install_write8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x68, 0x68, 0x0000, 0xff00, tenpindx_lights_w);
|
||||
memory_install_write8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x97, 0x97, 0x0000, 0xff00, tenpindx_sound_w);
|
||||
|
||||
/* reset banking */
|
||||
profpac_banksw_w(space, 0, 0);
|
||||
|
@ -1190,8 +1190,8 @@ static DRIVER_INIT( abattle )
|
||||
rom[i] = prom[rom[i]];
|
||||
|
||||
/* set up protection handlers */
|
||||
memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa003, 0xa003, 0, 0, shoot_r);
|
||||
memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa004, 0xa004, 0, 0, abattle_coin_prot_r);
|
||||
memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0xa003, 0xa003, 0, 0, shoot_r);
|
||||
memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0xa004, 0xa004, 0, 0, abattle_coin_prot_r);
|
||||
}
|
||||
|
||||
|
||||
@ -1204,8 +1204,8 @@ static DRIVER_INIT( afire )
|
||||
rom[i] = ~rom[i];
|
||||
|
||||
/* set up protection handlers */
|
||||
memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa003, 0xa003, 0, 0, shoot_r);
|
||||
memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa004, 0xa004, 0, 0, afire_coin_prot_r);
|
||||
memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0xa003, 0xa003, 0, 0, shoot_r);
|
||||
memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0xa004, 0xa004, 0, 0, afire_coin_prot_r);
|
||||
}
|
||||
|
||||
|
||||
@ -1218,8 +1218,8 @@ static DRIVER_INIT( sstarbtl )
|
||||
rom[i] = ~rom[i];
|
||||
|
||||
/* set up protection handlers */
|
||||
memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa003, 0xa003, 0, 0, shoot_r);
|
||||
memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa004, 0xa004, 0, 0, abattle_coin_prot_r);
|
||||
memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0xa003, 0xa003, 0, 0, shoot_r);
|
||||
memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0xa004, 0xa004, 0, 0, abattle_coin_prot_r);
|
||||
}
|
||||
|
||||
|
||||
|
@ -298,8 +298,8 @@ static WRITE8_HANDLER( asuka_msm5205_stop_w )
|
||||
static MACHINE_START( asuka )
|
||||
{
|
||||
/* configure the banks */
|
||||
memory_configure_bank(1, 0, 1, memory_region(machine, "audio"), 0);
|
||||
memory_configure_bank(1, 1, 3, memory_region(machine, "audio") + 0x10000, 0x04000);
|
||||
memory_configure_bank(machine, 1, 0, 1, memory_region(machine, "audio"), 0);
|
||||
memory_configure_bank(machine, 1, 1, 3, memory_region(machine, "audio") + 0x10000, 0x04000);
|
||||
|
||||
state_save_register_global(adpcm_pos);
|
||||
}
|
||||
|
@ -192,7 +192,7 @@ static READ16_HANDLER( pitfighb_cheap_slapstic_r )
|
||||
static void pitfighb_cheap_slapstic_init(running_machine *machine)
|
||||
{
|
||||
/* install a read handler */
|
||||
bslapstic_base = memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x038000, 0x03ffff, 0, 0, pitfighb_cheap_slapstic_r);
|
||||
bslapstic_base = memory_install_read16_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x038000, 0x03ffff, 0, 0, pitfighb_cheap_slapstic_r);
|
||||
|
||||
/* allocate memory for a copy of bank 0 */
|
||||
bslapstic_bank0 = auto_malloc(0x2000);
|
||||
|
@ -686,7 +686,7 @@ static DRIVER_INIT( roadriot )
|
||||
atarig42_motion_object_base = 0x200;
|
||||
atarig42_motion_object_mask = 0x1ff;
|
||||
|
||||
sloop_base = memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x000000, 0x07ffff, 0, 0, roadriot_sloop_data_r, roadriot_sloop_data_w);
|
||||
sloop_base = memory_install_readwrite16_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x000000, 0x07ffff, 0, 0, roadriot_sloop_data_r, roadriot_sloop_data_w);
|
||||
memory_set_direct_update_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), sloop_direct_handler);
|
||||
|
||||
asic65_config(machine, ASIC65_ROMBASED);
|
||||
@ -739,7 +739,7 @@ static DRIVER_INIT( guardian )
|
||||
/* put an RTS there so we don't die */
|
||||
*(UINT16 *)&memory_region(machine, "main")[0x80000] = 0x4E75;
|
||||
|
||||
sloop_base = memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x000000, 0x07ffff, 0, 0, guardians_sloop_data_r, guardians_sloop_data_w);
|
||||
sloop_base = memory_install_readwrite16_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x000000, 0x07ffff, 0, 0, guardians_sloop_data_r, guardians_sloop_data_w);
|
||||
memory_set_direct_update_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), sloop_direct_handler);
|
||||
|
||||
asic65_config(machine, ASIC65_GUARDIANS);
|
||||
|
@ -1077,7 +1077,7 @@ static DRIVER_INIT( tmek )
|
||||
protection_w = tmek_protection_w;
|
||||
|
||||
/* temp hack */
|
||||
memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xd72000, 0xd75fff, 0, 0, tmek_pf_w);
|
||||
memory_install_write32_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0xd72000, 0xd75fff, 0, 0, tmek_pf_w);
|
||||
}
|
||||
|
||||
|
||||
|
@ -2106,7 +2106,7 @@ static DRIVER_INIT( rrreveng )
|
||||
atarigx2_motion_object_base = 0x400;
|
||||
atarigx2_motion_object_mask = 0x3ff;
|
||||
|
||||
memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xca0fc0, 0xca0fc3, 0, 0, rrreveng_prot_r);
|
||||
memory_install_read32_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0xca0fc0, 0xca0fc3, 0, 0, rrreveng_prot_r);
|
||||
}
|
||||
|
||||
|
||||
|
@ -665,7 +665,7 @@ static DRIVER_INIT( ataxx )
|
||||
leland_rotate_memory(machine, "slave");
|
||||
|
||||
/* set up additional input ports */
|
||||
memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x00, 0x03, 0, 0, ataxx_trackball_r);
|
||||
memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x00, 0x03, 0, 0, ataxx_trackball_r);
|
||||
}
|
||||
|
||||
|
||||
@ -688,7 +688,7 @@ static DRIVER_INIT( ataxxj )
|
||||
leland_rotate_memory(machine, "slave");
|
||||
|
||||
/* set up additional input ports */
|
||||
memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x00, 0x03, 0, 0, ataxx_trackball_r);
|
||||
memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x00, 0x03, 0, 0, ataxx_trackball_r);
|
||||
}
|
||||
|
||||
|
||||
@ -711,9 +711,9 @@ static DRIVER_INIT( wsf )
|
||||
leland_rotate_memory(machine, "slave");
|
||||
|
||||
/* set up additional input ports */
|
||||
memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x0d, 0x0d, 0, 0, input_port_read_handler8(machine->portconfig, "P1_P2"));
|
||||
memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x0e, 0x0e, 0, 0, input_port_read_handler8(machine->portconfig, "P3_P4"));
|
||||
memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x0f, 0x0f, 0, 0, input_port_read_handler8(machine->portconfig, "BUTTONS"));
|
||||
memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x0d, 0x0d, 0, 0, input_port_read_handler8(machine->portconfig, "P1_P2"));
|
||||
memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x0e, 0x0e, 0, 0, input_port_read_handler8(machine->portconfig, "P3_P4"));
|
||||
memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x0f, 0x0f, 0, 0, input_port_read_handler8(machine->portconfig, "BUTTONS"));
|
||||
}
|
||||
|
||||
|
||||
@ -736,14 +736,14 @@ static DRIVER_INIT( indyheat )
|
||||
leland_rotate_memory(machine, "slave");
|
||||
|
||||
/* set up additional input ports */
|
||||
memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x00, 0x02, 0, 0, indyheat_wheel_r);
|
||||
memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x08, 0x0b, 0, 0, indyheat_analog_r);
|
||||
memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x0d, 0x0d, 0, 0, input_port_read_handler8(machine->portconfig, "P1"));
|
||||
memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x0e, 0x0e, 0, 0, input_port_read_handler8(machine->portconfig, "P2"));
|
||||
memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x0f, 0x0f, 0, 0, input_port_read_handler8(machine->portconfig, "P3"));
|
||||
memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x00, 0x02, 0, 0, indyheat_wheel_r);
|
||||
memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x08, 0x0b, 0, 0, indyheat_analog_r);
|
||||
memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x0d, 0x0d, 0, 0, input_port_read_handler8(machine->portconfig, "P1"));
|
||||
memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x0e, 0x0e, 0, 0, input_port_read_handler8(machine->portconfig, "P2"));
|
||||
memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x0f, 0x0f, 0, 0, input_port_read_handler8(machine->portconfig, "P3"));
|
||||
|
||||
/* set up additional output ports */
|
||||
memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x08, 0x0b, 0, 0, indyheat_analog_w);
|
||||
memory_install_write8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x08, 0x0b, 0, 0, indyheat_analog_w);
|
||||
}
|
||||
|
||||
|
||||
@ -766,9 +766,9 @@ static DRIVER_INIT( brutforc )
|
||||
leland_rotate_memory(machine, "slave");
|
||||
|
||||
/* set up additional input ports */
|
||||
memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x0d, 0x0d, 0, 0, input_port_read_handler8(machine->portconfig, "P2"));
|
||||
memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x0e, 0x0e, 0, 0, input_port_read_handler8(machine->portconfig, "P1"));
|
||||
memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x0f, 0x0f, 0, 0, input_port_read_handler8(machine->portconfig, "P3"));
|
||||
memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x0d, 0x0d, 0, 0, input_port_read_handler8(machine->portconfig, "P2"));
|
||||
memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x0e, 0x0e, 0, 0, input_port_read_handler8(machine->portconfig, "P1"));
|
||||
memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x0f, 0x0f, 0, 0, input_port_read_handler8(machine->portconfig, "P3"));
|
||||
}
|
||||
|
||||
|
||||
@ -791,13 +791,13 @@ static DRIVER_INIT( asylum )
|
||||
leland_rotate_memory(machine, "slave");
|
||||
|
||||
/* asylum appears to have some extra RAM for the slave CPU */
|
||||
memory_install_readwrite8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0xf000, 0xfffb, 0, 0, SMH_BANK4, SMH_BANK4);
|
||||
memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[1], ADDRESS_SPACE_PROGRAM), 0xf000, 0xfffb, 0, 0, SMH_BANK4, SMH_BANK4);
|
||||
memory_set_bankptr(4, auto_malloc(0x1000));
|
||||
|
||||
/* set up additional input ports */
|
||||
memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x0d, 0x0d, 0, 0, input_port_read_handler8(machine->portconfig, "P2"));
|
||||
memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x0e, 0x0e, 0, 0, input_port_read_handler8(machine->portconfig, "P1"));
|
||||
memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x0f, 0x0f, 0, 0, input_port_read_handler8(machine->portconfig, "P3"));
|
||||
memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x0d, 0x0d, 0, 0, input_port_read_handler8(machine->portconfig, "P2"));
|
||||
memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x0e, 0x0e, 0, 0, input_port_read_handler8(machine->portconfig, "P1"));
|
||||
memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x0f, 0x0f, 0, 0, input_port_read_handler8(machine->portconfig, "P3"));
|
||||
}
|
||||
|
||||
|
||||
|
@ -682,7 +682,7 @@ static DRIVER_INIT( backfire )
|
||||
deco156_decrypt(machine);
|
||||
cpu_set_clockscale(machine->cpu[0], 4.0f); /* core timings aren't accurate */
|
||||
descramble_sound(machine);
|
||||
memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0170018, 0x017001b, 0, 0, backfire_speedup_r );
|
||||
memory_install_read32_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x0170018, 0x017001b, 0, 0, backfire_speedup_r );
|
||||
}
|
||||
|
||||
GAME( 1995, backfire, 0, backfire, backfire, backfire, ROT0, "Data East Corporation", "Backfire! (set 1)", 0 )
|
||||
|
@ -1952,41 +1952,41 @@ static DRIVER_INIT( minigol2 ) { expand_roms(machine, 0x0c); balsente_sho
|
||||
static DRIVER_INIT( toggle ) { expand_roms(machine, EXPAND_ALL); balsente_shooter = 0; /* noanalog */ }
|
||||
static DRIVER_INIT( nametune )
|
||||
{
|
||||
memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x9f00, 0x9f00, 0, 0, balsente_rombank2_select_w);
|
||||
memory_install_write8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x9f00, 0x9f00, 0, 0, balsente_rombank2_select_w);
|
||||
expand_roms(machine, EXPAND_NONE | SWAP_HALVES); balsente_shooter = 0; /* noanalog */
|
||||
}
|
||||
static DRIVER_INIT( nstocker )
|
||||
{
|
||||
memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x9f00, 0x9f00, 0, 0, balsente_rombank2_select_w);
|
||||
memory_install_write8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x9f00, 0x9f00, 0, 0, balsente_rombank2_select_w);
|
||||
expand_roms(machine, EXPAND_NONE | SWAP_HALVES); balsente_shooter = 1; balsente_adc_shift = 1;
|
||||
}
|
||||
static DRIVER_INIT( sfootbal )
|
||||
{
|
||||
memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x9f00, 0x9f00, 0, 0, balsente_rombank2_select_w);
|
||||
memory_install_write8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x9f00, 0x9f00, 0, 0, balsente_rombank2_select_w);
|
||||
expand_roms(machine, EXPAND_ALL | SWAP_HALVES); balsente_shooter = 0; balsente_adc_shift = 0;
|
||||
}
|
||||
static DRIVER_INIT( spiker )
|
||||
{
|
||||
memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x9f80, 0x9f8f, 0, 0, spiker_expand_r, spiker_expand_w);
|
||||
memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x9f00, 0x9f00, 0, 0, balsente_rombank2_select_w);
|
||||
memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x9f80, 0x9f8f, 0, 0, spiker_expand_r, spiker_expand_w);
|
||||
memory_install_write8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x9f00, 0x9f00, 0, 0, balsente_rombank2_select_w);
|
||||
expand_roms(machine, EXPAND_ALL | SWAP_HALVES); balsente_shooter = 0; balsente_adc_shift = 1;
|
||||
}
|
||||
static DRIVER_INIT( stompin )
|
||||
{
|
||||
memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x9f00, 0x9f00, 0, 0, balsente_rombank2_select_w);
|
||||
memory_install_write8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x9f00, 0x9f00, 0, 0, balsente_rombank2_select_w);
|
||||
expand_roms(machine, 0x0c | SWAP_HALVES); balsente_shooter = 0; balsente_adc_shift = 32;
|
||||
}
|
||||
static DRIVER_INIT( rescraid ) { expand_roms(machine, EXPAND_NONE); balsente_shooter = 0; /* noanalog */ }
|
||||
static DRIVER_INIT( grudge )
|
||||
{
|
||||
memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x9400, 0x9400, 0, 0, grudge_steering_r);
|
||||
memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x9400, 0x9400, 0, 0, grudge_steering_r);
|
||||
expand_roms(machine, EXPAND_NONE); balsente_shooter = 0;
|
||||
}
|
||||
static DRIVER_INIT( shrike )
|
||||
{
|
||||
memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x9e00, 0x9fff, 0, 0, shrike_shared_6809_r, shrike_shared_6809_w);
|
||||
memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x9e01, 0x9e01, 0, 0, shrike_sprite_select_w );
|
||||
memory_install_readwrite16_handler(machine, 2, ADDRESS_SPACE_PROGRAM, 0x10000, 0x1001f, 0, 0, shrike_io_68k_r, shrike_io_68k_w);
|
||||
memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x9e00, 0x9fff, 0, 0, shrike_shared_6809_r, shrike_shared_6809_w);
|
||||
memory_install_write8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x9e01, 0x9e01, 0, 0, shrike_sprite_select_w );
|
||||
memory_install_readwrite16_handler(cpu_get_address_space(machine->cpu[2], ADDRESS_SPACE_PROGRAM), 0x10000, 0x1001f, 0, 0, shrike_io_68k_r, shrike_io_68k_w);
|
||||
|
||||
expand_roms(machine, EXPAND_ALL); balsente_shooter = 0; balsente_adc_shift = 32;
|
||||
}
|
||||
|
@ -514,8 +514,8 @@ static DRIVER_INIT( beathead )
|
||||
atarijsa_init(machine, "IN2", 0x0040);
|
||||
|
||||
/* prepare the speedups */
|
||||
speedup_data = memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x00000ae8, 0x00000aeb, 0, 0, speedup_r);
|
||||
movie_speedup_data = memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x00000804, 0x00000807, 0, 0, movie_speedup_r);
|
||||
speedup_data = memory_install_read32_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x00000ae8, 0x00000aeb, 0, 0, speedup_r);
|
||||
movie_speedup_data = memory_install_read32_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x00000804, 0x00000807, 0, 0, movie_speedup_r);
|
||||
}
|
||||
|
||||
|
||||
|
@ -374,8 +374,8 @@ send data to them, although obviously there's no response. */
|
||||
{
|
||||
UINT8 *rom = memory_region(machine, "main");
|
||||
|
||||
memory_configure_bank(1, 0, 1, &rom[0x10000], 0);
|
||||
memory_configure_bank(1, 1, 3, &rom[0x02000], 0x02000);
|
||||
memory_configure_bank(machine, 1, 0, 1, &rom[0x10000], 0);
|
||||
memory_configure_bank(machine, 1, 1, 3, &rom[0x02000], 0x02000);
|
||||
|
||||
memory_set_bank(1,3);
|
||||
}
|
||||
|
@ -246,7 +246,7 @@ static const ym2203_interface ym2203_config =
|
||||
static MACHINE_START( blktiger )
|
||||
{
|
||||
/* configure bankswitching */
|
||||
memory_configure_bank(1, 0, 16, memory_region(machine, "main") + 0x10000, 0x4000);
|
||||
memory_configure_bank(machine, 1, 0, 16, memory_region(machine, "main") + 0x10000, 0x4000);
|
||||
}
|
||||
|
||||
static MACHINE_DRIVER_START( blktiger )
|
||||
|
@ -1640,19 +1640,20 @@ ROM_START( sdtennis )
|
||||
ROM_LOAD( "ao_04.10f", 0x1000, 0x1000, CRC(921952af) SHA1(4e9248f3493a5f4651278f27c11f507571242317) )
|
||||
ROM_END
|
||||
|
||||
static void decrypt_C10707_cpu(running_machine *machine, int cpu, const char *cputag)
|
||||
static void decrypt_C10707_cpu(running_machine *machine, const char *cputag)
|
||||
{
|
||||
const address_space *space = cputag_get_address_space(machine, cputag, ADDRESS_SPACE_PROGRAM);
|
||||
UINT8 *decrypt = auto_malloc(0x10000);
|
||||
UINT8 *rom = memory_region(machine, cputag);
|
||||
offs_t addr;
|
||||
|
||||
memory_set_decrypted_region(cpu, 0x0000, 0xffff, decrypt);
|
||||
memory_set_decrypted_region(space, 0x0000, 0xffff, decrypt);
|
||||
|
||||
/* Swap bits 5 & 6 for opcodes */
|
||||
for (addr = 0; addr < 0x10000; addr++)
|
||||
decrypt[addr] = swap_bits_5_6(rom[addr]);
|
||||
|
||||
if (cpu == 0)
|
||||
if (space->cpu == machine->cpu[0])
|
||||
decrypted = decrypt;
|
||||
}
|
||||
|
||||
@ -1671,10 +1672,11 @@ static READ8_HANDLER( wtennis_reset_hack_r )
|
||||
|
||||
static void init_rom1(running_machine *machine)
|
||||
{
|
||||
const address_space *space = cputag_get_address_space(machine, "main", ADDRESS_SPACE_PROGRAM);
|
||||
UINT8 *rom = memory_region(machine, "main");
|
||||
|
||||
decrypted = auto_malloc(0x10000);
|
||||
memory_set_decrypted_region(0, 0x0000, 0xffff, decrypted);
|
||||
memory_set_decrypted_region(space, 0x0000, 0xffff, decrypted);
|
||||
|
||||
/* For now, just copy the RAM array over to ROM. Decryption will happen */
|
||||
/* at run time, since the CPU applies the decryption only if the previous */
|
||||
@ -1702,26 +1704,26 @@ static DRIVER_INIT( zoar )
|
||||
|
||||
static DRIVER_INIT( lnc )
|
||||
{
|
||||
decrypt_C10707_cpu(machine, 0, "main");
|
||||
decrypt_C10707_cpu(machine, "main");
|
||||
}
|
||||
|
||||
static DRIVER_INIT( cookrace )
|
||||
{
|
||||
memcpy(&audio_rambase[0x200], memory_region(machine, "audio") + 0xf200, 0x200);
|
||||
decrypt_C10707_cpu(machine, 0, "main");
|
||||
decrypt_C10707_cpu(machine, "main");
|
||||
}
|
||||
|
||||
static DRIVER_INIT( wtennis )
|
||||
{
|
||||
memcpy(&audio_rambase[0x200], memory_region(machine, "audio") + 0xf200, 0x200);
|
||||
memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc15f, 0xc15f, 0, 0, wtennis_reset_hack_r);
|
||||
decrypt_C10707_cpu(machine, 0, "main");
|
||||
memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0xc15f, 0xc15f, 0, 0, wtennis_reset_hack_r);
|
||||
decrypt_C10707_cpu(machine, "main");
|
||||
}
|
||||
|
||||
static DRIVER_INIT( sdtennis )
|
||||
{
|
||||
decrypt_C10707_cpu(machine, 0, "main");
|
||||
decrypt_C10707_cpu(machine, 1, "audio");
|
||||
decrypt_C10707_cpu(machine, "main");
|
||||
decrypt_C10707_cpu(machine, "audio");
|
||||
}
|
||||
|
||||
|
||||
|
@ -1286,7 +1286,7 @@ static DRIVER_INIT( tokio )
|
||||
|
||||
static DRIVER_INIT( tokiob )
|
||||
{
|
||||
memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xfe00, 0xfe00, 0, 0, tokiob_mcu_r );
|
||||
memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0xfe00, 0xfe00, 0, 0, tokiob_mcu_r );
|
||||
|
||||
DRIVER_INIT_CALL(tokio);
|
||||
}
|
||||
|
@ -802,13 +802,13 @@ static WRITE8_HANDLER( analog_select_w )
|
||||
|
||||
static DRIVER_INIT( bradley )
|
||||
{
|
||||
memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x400, 0x7ff, 0, 0, SMH_BANK1, SMH_BANK1);
|
||||
memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x400, 0x7ff, 0, 0, SMH_BANK1, SMH_BANK1);
|
||||
memory_set_bankptr(1, auto_malloc(0x400));
|
||||
|
||||
memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1808, 0x1808, 0, 0, input_port_read_handler8(machine->portconfig, "1808"));
|
||||
memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1809, 0x1809, 0, 0, input_port_read_handler8(machine->portconfig, "1809"));
|
||||
memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x180a, 0x180a, 0, 0, analog_data_r);
|
||||
memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1848, 0x1850, 0, 0, analog_select_w);
|
||||
memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x1808, 0x1808, 0, 0, input_port_read_handler8(machine->portconfig, "1808"));
|
||||
memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x1809, 0x1809, 0, 0, input_port_read_handler8(machine->portconfig, "1809"));
|
||||
memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x180a, 0x180a, 0, 0, analog_data_r);
|
||||
memory_install_write8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x1848, 0x1850, 0, 0, analog_select_w);
|
||||
}
|
||||
|
||||
|
||||
|
@ -463,7 +463,8 @@ static DRIVER_INIT( calorie )
|
||||
|
||||
static DRIVER_INIT( calorieb )
|
||||
{
|
||||
memory_set_decrypted_region(0, 0x0000, 0x7fff, memory_region(machine, "main") + 0x10000);
|
||||
const address_space *space = cputag_get_address_space(machine, "main", ADDRESS_SPACE_PROGRAM);
|
||||
memory_set_decrypted_region(space, 0x0000, 0x7fff, memory_region(machine, "main") + 0x10000);
|
||||
}
|
||||
|
||||
|
||||
|
@ -4108,7 +4108,7 @@ static DRIVER_INIT( agallet )
|
||||
unpack_sprites(machine);
|
||||
|
||||
// Speed Hack
|
||||
memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb80000, 0xb80001, 0, 0, agallet_irq_cause_r);
|
||||
memory_install_read16_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0xb80000, 0xb80001, 0, 0, agallet_irq_cause_r);
|
||||
}
|
||||
|
||||
static DRIVER_INIT( dfeveron )
|
||||
|
@ -306,7 +306,7 @@ ROM_END
|
||||
|
||||
static DRIVER_INIT( cbasebal )
|
||||
{
|
||||
memory_configure_bank(1, 0, 32, memory_region(machine, "main") + 0x10000, 0x4000);
|
||||
memory_configure_bank(machine, 1, 0, 32, memory_region(machine, "main") + 0x10000, 0x4000);
|
||||
pang_decode(machine);
|
||||
}
|
||||
|
||||
|
@ -229,7 +229,7 @@ static MACHINE_START( ccastles )
|
||||
video_screen_configure(machine->primary_screen, 320, 256, &visarea, HZ_TO_ATTOSECONDS(PIXEL_CLOCK) * VTOTAL * HTOTAL);
|
||||
|
||||
/* configure the ROM banking */
|
||||
memory_configure_bank(1, 0, 2, memory_region(machine, "main") + 0xa000, 0x6000);
|
||||
memory_configure_bank(machine, 1, 0, 2, memory_region(machine, "main") + 0xa000, 0x6000);
|
||||
|
||||
/* create a timer for IRQs and set up the first callback */
|
||||
irq_timer = timer_alloc(clock_irq, NULL);
|
||||
|
@ -1935,15 +1935,15 @@ ROM_END
|
||||
|
||||
static DRIVER_INIT( caterplr )
|
||||
{
|
||||
memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x100f, 0, 0, caterplr_AY8910_r, caterplr_AY8910_w);
|
||||
memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1780, 0x1780, 0, 0, caterplr_rand_r);
|
||||
memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x1000, 0x100f, 0, 0, caterplr_AY8910_r, caterplr_AY8910_w);
|
||||
memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x1780, 0x1780, 0, 0, caterplr_rand_r);
|
||||
}
|
||||
|
||||
|
||||
static DRIVER_INIT( magworm )
|
||||
{
|
||||
memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1001, 0x1001, 0, 0, ay8910_control_port_0_w);
|
||||
memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1003, 0x1003, 0, 0, ay8910_read_port_0_r, ay8910_write_port_0_w);
|
||||
memory_install_write8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x1001, 0x1001, 0, 0, ay8910_control_port_0_w);
|
||||
memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x1003, 0x1003, 0, 0, ay8910_read_port_0_r, ay8910_write_port_0_w);
|
||||
}
|
||||
|
||||
|
||||
|
@ -73,7 +73,7 @@ static VIDEO_UPDATE(chinsan)
|
||||
|
||||
static MACHINE_RESET( chinsan )
|
||||
{
|
||||
memory_configure_bank(1, 0, 4, memory_region(machine, "main") + 0x10000, 0x4000);
|
||||
memory_configure_bank(machine, 1, 0, 4, memory_region(machine, "main") + 0x10000, 0x4000);
|
||||
}
|
||||
|
||||
|
||||
|
@ -54,18 +54,18 @@ static WRITE8_HANDLER( chqflag_bankswitch_w )
|
||||
/* bit 5 = memory bank select */
|
||||
if (data & 0x20)
|
||||
{
|
||||
memory_install_readwrite8_handler(space->machine, 0, ADDRESS_SPACE_PROGRAM, 0x1800, 0x1fff, 0, 0, SMH_BANK5, paletteram_xBBBBBGGGGGRRRRR_be_w);
|
||||
memory_install_readwrite8_handler(space, 0x1800, 0x1fff, 0, 0, SMH_BANK5, paletteram_xBBBBBGGGGGRRRRR_be_w);
|
||||
memory_set_bankptr(5, paletteram);
|
||||
|
||||
if (K051316_readroms)
|
||||
memory_install_readwrite8_handler(space->machine, 0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x17ff, 0, 0, K051316_rom_0_r, K051316_0_w); /* 051316 #1 (ROM test) */
|
||||
memory_install_readwrite8_handler(space, 0x1000, 0x17ff, 0, 0, K051316_rom_0_r, K051316_0_w); /* 051316 #1 (ROM test) */
|
||||
else
|
||||
memory_install_readwrite8_handler(space->machine, 0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x17ff, 0, 0, K051316_0_r, K051316_0_w); /* 051316 #1 */
|
||||
memory_install_readwrite8_handler(space, 0x1000, 0x17ff, 0, 0, K051316_0_r, K051316_0_w); /* 051316 #1 */
|
||||
}
|
||||
else
|
||||
{
|
||||
memory_install_readwrite8_handler(space->machine, 0, ADDRESS_SPACE_PROGRAM, 0x1000, 0x17ff, 0, 0, SMH_BANK1, SMH_BANK1); /* RAM */
|
||||
memory_install_readwrite8_handler(space->machine, 0, ADDRESS_SPACE_PROGRAM, 0x1800, 0x1fff, 0, 0, SMH_BANK2, SMH_BANK2); /* RAM */
|
||||
memory_install_readwrite8_handler(space, 0x1000, 0x17ff, 0, 0, SMH_BANK1, SMH_BANK1); /* RAM */
|
||||
memory_install_readwrite8_handler(space, 0x1800, 0x1fff, 0, 0, SMH_BANK2, SMH_BANK2); /* RAM */
|
||||
}
|
||||
|
||||
/* other bits unknown/unused */
|
||||
@ -82,9 +82,9 @@ static WRITE8_HANDLER( chqflag_vreg_w )
|
||||
/* bit 4 = enable rom reading thru K051316 #1 & #2 */
|
||||
K051316_readroms = (data & 0x10);
|
||||
if (K051316_readroms)
|
||||
memory_install_read8_handler(space->machine, 0, ADDRESS_SPACE_PROGRAM, 0x2800, 0x2fff, 0, 0, K051316_rom_1_r); /* 051316 (ROM test) */
|
||||
memory_install_read8_handler(space, 0x2800, 0x2fff, 0, 0, K051316_rom_1_r); /* 051316 (ROM test) */
|
||||
else
|
||||
memory_install_read8_handler(space->machine, 0, ADDRESS_SPACE_PROGRAM, 0x2800, 0x2fff, 0, 0, K051316_1_r); /* 051316 */
|
||||
memory_install_read8_handler(space, 0x2800, 0x2fff, 0, 0, K051316_1_r); /* 051316 */
|
||||
|
||||
/* Bits 3-7 probably control palette dimming in a similar way to TMNT2/Saunset Riders, */
|
||||
/* however I don't have enough evidence to determine the exact behaviour. */
|
||||
|
@ -566,7 +566,7 @@ static MACHINE_START( draco )
|
||||
|
||||
/* setup COP402 memory banking */
|
||||
|
||||
memory_configure_bank(1, 0, 2, memory_region(machine, "audio"), 0x400);
|
||||
memory_configure_bank(machine, 1, 0, 2, memory_region(machine, "audio"), 0x400);
|
||||
memory_set_bank(1, 0);
|
||||
|
||||
/* register for state saving */
|
||||
|
@ -1438,36 +1438,36 @@ ROM_END
|
||||
|
||||
static DRIVER_INIT( speedfrk )
|
||||
{
|
||||
memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x00, 0x03, 0, 0, speedfrk_wheel_r);
|
||||
memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x04, 0x06, 0, 0, speedfrk_gear_r);
|
||||
memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x00, 0x03, 0, 0, speedfrk_wheel_r);
|
||||
memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x04, 0x06, 0, 0, speedfrk_gear_r);
|
||||
}
|
||||
|
||||
|
||||
static DRIVER_INIT( sundance )
|
||||
{
|
||||
memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x00, 0x0f, 0, 0, sundance_inputs_r);
|
||||
memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x00, 0x0f, 0, 0, sundance_inputs_r);
|
||||
}
|
||||
|
||||
|
||||
static DRIVER_INIT( tailg )
|
||||
{
|
||||
memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x07, 0x07, 0, 0, mux_select_w);
|
||||
memory_install_write8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x07, 0x07, 0, 0, mux_select_w);
|
||||
}
|
||||
|
||||
|
||||
static DRIVER_INIT( boxingb )
|
||||
{
|
||||
memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x0c, 0x0f, 0, 0, boxingb_dial_r);
|
||||
memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x07, 0x07, 0, 0, mux_select_w);
|
||||
memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x0c, 0x0f, 0, 0, boxingb_dial_r);
|
||||
memory_install_write8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x07, 0x07, 0, 0, mux_select_w);
|
||||
}
|
||||
|
||||
|
||||
static DRIVER_INIT( qb3 )
|
||||
{
|
||||
memory_install_read8_handler(machine, 0, ADDRESS_SPACE_IO, 0x0f, 0x0f, 0, 0, qb3_frame_r);
|
||||
memory_install_write8_handler(machine, 0, ADDRESS_SPACE_IO, 0x00, 0x00, 0, 0, qb3_ram_bank_w);
|
||||
memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x0f, 0x0f, 0, 0, qb3_frame_r);
|
||||
memory_install_write8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_IO), 0x00, 0x00, 0, 0, qb3_ram_bank_w);
|
||||
|
||||
memory_configure_bank(1, 0, 4, rambase, 0x100*2);
|
||||
memory_configure_bank(machine, 1, 0, 4, rambase, 0x100*2);
|
||||
}
|
||||
|
||||
|
||||
|
@ -2703,7 +2703,7 @@ ROM_END
|
||||
|
||||
static DRIVER_INIT( wildplt )
|
||||
{
|
||||
memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x080000, 0x087fff, 0, 0, wildplt_vregs_r );
|
||||
memory_install_read16_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x080000, 0x087fff, 0, 0, wildplt_vregs_r );
|
||||
|
||||
DRIVER_INIT_CALL(f1gpstar);
|
||||
}
|
||||
|
@ -1769,13 +1769,13 @@ static void cninja_patch(running_machine *machine)
|
||||
|
||||
static DRIVER_INIT( cninja )
|
||||
{
|
||||
memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1bc0a8, 0x1bc0a9, 0, 0, cninja_sound_w);
|
||||
memory_install_write16_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x1bc0a8, 0x1bc0a9, 0, 0, cninja_sound_w);
|
||||
cninja_patch(machine);
|
||||
}
|
||||
|
||||
static DRIVER_INIT( stoneage )
|
||||
{
|
||||
memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1bc0a8, 0x1bc0a9, 0, 0, stoneage_sound_w);
|
||||
memory_install_write16_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x1bc0a8, 0x1bc0a9, 0, 0, stoneage_sound_w);
|
||||
}
|
||||
|
||||
static DRIVER_INIT( mutantf )
|
||||
|
@ -350,15 +350,15 @@ static MACHINE_RESET( cojag )
|
||||
/* graphics banks */
|
||||
if (cojag_is_r3000)
|
||||
{
|
||||
memory_configure_bank(1, 0, 2, rom + 0x800000, 0x400000);
|
||||
memory_configure_bank(machine, 1, 0, 2, rom + 0x800000, 0x400000);
|
||||
memory_set_bank(1, 0);
|
||||
}
|
||||
memory_configure_bank(8, 0, 2, rom + 0x800000, 0x400000);
|
||||
memory_configure_bank(machine, 8, 0, 2, rom + 0x800000, 0x400000);
|
||||
memory_set_bank(8, 0);
|
||||
|
||||
/* sound banks */
|
||||
memory_configure_bank(2, 0, 8, rom + 0x000000, 0x200000);
|
||||
memory_configure_bank(9, 0, 8, rom + 0x000000, 0x200000);
|
||||
memory_configure_bank(machine, 2, 0, 8, rom + 0x000000, 0x200000);
|
||||
memory_configure_bank(machine, 9, 0, 8, rom + 0x000000, 0x200000);
|
||||
memory_set_bank(2, 0);
|
||||
memory_set_bank(9, 0);
|
||||
}
|
||||
@ -1508,10 +1508,10 @@ static void cojag_common_init(running_machine *machine, UINT16 gpu_jump_offs, UI
|
||||
|
||||
/* install synchronization hooks for GPU */
|
||||
if (cojag_is_r3000)
|
||||
memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x04f0b000 + gpu_jump_offs, 0x04f0b003 + gpu_jump_offs, 0, 0, gpu_jump_w);
|
||||
memory_install_write32_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x04f0b000 + gpu_jump_offs, 0x04f0b003 + gpu_jump_offs, 0, 0, gpu_jump_w);
|
||||
else
|
||||
memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf0b000 + gpu_jump_offs, 0xf0b003 + gpu_jump_offs, 0, 0, gpu_jump_w);
|
||||
memory_install_read32_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0xf03000 + gpu_jump_offs, 0xf03003 + gpu_jump_offs, 0, 0, gpu_jump_r);
|
||||
memory_install_write32_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0xf0b000 + gpu_jump_offs, 0xf0b003 + gpu_jump_offs, 0, 0, gpu_jump_w);
|
||||
memory_install_read32_handler(cpu_get_address_space(machine->cpu[1], ADDRESS_SPACE_PROGRAM), 0xf03000 + gpu_jump_offs, 0xf03003 + gpu_jump_offs, 0, 0, gpu_jump_r);
|
||||
gpu_jump_address = &jaguar_gpu_ram[gpu_jump_offs/4];
|
||||
gpu_spin_pc = 0xf03000 + spin_pc;
|
||||
|
||||
@ -1526,7 +1526,7 @@ static DRIVER_INIT( area51a )
|
||||
|
||||
#if ENABLE_SPEEDUP_HACKS
|
||||
/* install speedup for main CPU */
|
||||
main_speedup = memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa02030, 0xa02033, 0, 0, area51_main_speedup_w);
|
||||
main_speedup = memory_install_write32_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0xa02030, 0xa02033, 0, 0, area51_main_speedup_w);
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -1538,7 +1538,7 @@ static DRIVER_INIT( area51 )
|
||||
#if ENABLE_SPEEDUP_HACKS
|
||||
/* install speedup for main CPU */
|
||||
main_speedup_max_cycles = 120;
|
||||
main_speedup = memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x100062e8, 0x100062eb, 0, 0, cojagr3k_main_speedup_r);
|
||||
main_speedup = memory_install_read32_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x100062e8, 0x100062eb, 0, 0, cojagr3k_main_speedup_r);
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -1552,7 +1552,7 @@ static DRIVER_INIT( maxforce )
|
||||
#if ENABLE_SPEEDUP_HACKS
|
||||
/* install speedup for main CPU */
|
||||
main_speedup_max_cycles = 120;
|
||||
main_speedup = memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x1000865c, 0x1000865f, 0, 0, cojagr3k_main_speedup_r);
|
||||
main_speedup = memory_install_read32_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x1000865c, 0x1000865f, 0, 0, cojagr3k_main_speedup_r);
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -1566,7 +1566,7 @@ static DRIVER_INIT( area51mx )
|
||||
|
||||
#if ENABLE_SPEEDUP_HACKS
|
||||
/* install speedup for main CPU */
|
||||
main_speedup = memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa19550, 0xa19557, 0, 0, area51mx_main_speedup_w);
|
||||
main_speedup = memory_install_write32_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0xa19550, 0xa19557, 0, 0, area51mx_main_speedup_w);
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -1581,7 +1581,7 @@ static DRIVER_INIT( a51mxr3k )
|
||||
#if ENABLE_SPEEDUP_HACKS
|
||||
/* install speedup for main CPU */
|
||||
main_speedup_max_cycles = 120;
|
||||
main_speedup = memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x10006f0c, 0x10006f0f, 0, 0, cojagr3k_main_speedup_r);
|
||||
main_speedup = memory_install_read32_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x10006f0c, 0x10006f0f, 0, 0, cojagr3k_main_speedup_r);
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -1593,7 +1593,7 @@ static DRIVER_INIT( fishfren )
|
||||
#if ENABLE_SPEEDUP_HACKS
|
||||
/* install speedup for main CPU */
|
||||
main_speedup_max_cycles = 200;
|
||||
main_speedup = memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x10021b60, 0x10021b63, 0, 0, cojagr3k_main_speedup_r);
|
||||
main_speedup = memory_install_read32_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x10021b60, 0x10021b63, 0, 0, cojagr3k_main_speedup_r);
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -1606,8 +1606,8 @@ static void init_freeze_common(running_machine *machine, offs_t main_speedup_add
|
||||
/* install speedup for main CPU */
|
||||
main_speedup_max_cycles = 200;
|
||||
if (main_speedup_addr != 0)
|
||||
main_speedup = memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, main_speedup_addr, main_speedup_addr + 3, 0, 0, cojagr3k_main_speedup_r);
|
||||
main_gpu_wait = memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0400d900, 0x0400d900 + 3, 0, 0, main_gpu_wait_r);
|
||||
main_speedup = memory_install_read32_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), main_speedup_addr, main_speedup_addr + 3, 0, 0, cojagr3k_main_speedup_r);
|
||||
main_gpu_wait = memory_install_read32_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x0400d900, 0x0400d900 + 3, 0, 0, main_gpu_wait_r);
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -1626,7 +1626,7 @@ static DRIVER_INIT( vcircle )
|
||||
#if ENABLE_SPEEDUP_HACKS
|
||||
/* install speedup for main CPU */
|
||||
main_speedup_max_cycles = 50;
|
||||
main_speedup = memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x12005b34, 0x12005b37, 0, 0, cojagr3k_main_speedup_r);
|
||||
main_speedup = memory_install_read32_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x12005b34, 0x12005b37, 0, 0, cojagr3k_main_speedup_r);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -827,7 +827,7 @@ static DRIVER_INIT( combasct )
|
||||
static DRIVER_INIT( combasc )
|
||||
{
|
||||
/* joystick instead of trackball */
|
||||
memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0404, 0x0404, 0, 0, input_port_read_handler8(machine->portconfig, "IN1"));
|
||||
memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x0404, 0x0404, 0, 0, input_port_read_handler8(machine->portconfig, "IN1"));
|
||||
|
||||
combasc_init_common();
|
||||
}
|
||||
|
@ -505,11 +505,12 @@ ROM_END
|
||||
|
||||
static DRIVER_INIT( commando )
|
||||
{
|
||||
const address_space *space = cputag_get_address_space(machine, "main", ADDRESS_SPACE_PROGRAM);
|
||||
UINT8 *rom = memory_region(machine, "main");
|
||||
UINT8 *decrypt = auto_malloc(0xc000);
|
||||
int A;
|
||||
|
||||
memory_set_decrypted_region(0, 0x0000, 0xbfff, decrypt);
|
||||
memory_set_decrypted_region(space, 0x0000, 0xbfff, decrypt);
|
||||
|
||||
// the first opcode is *not* encrypted
|
||||
decrypt[0] = rom[0];
|
||||
@ -524,11 +525,12 @@ static DRIVER_INIT( commando )
|
||||
|
||||
static DRIVER_INIT( spaceinv )
|
||||
{
|
||||
const address_space *space = cputag_get_address_space(machine, "main", ADDRESS_SPACE_PROGRAM);
|
||||
UINT8 *rom = memory_region(machine, "main");
|
||||
UINT8 *decrypt = auto_malloc(0xc000);
|
||||
int A;
|
||||
|
||||
memory_set_decrypted_region(0, 0x0000, 0xbfff, decrypt);
|
||||
memory_set_decrypted_region(space, 0x0000, 0xbfff, decrypt);
|
||||
|
||||
// the first opcode *is* encrypted
|
||||
for (A = 0; A < 0xc000; A++)
|
||||
|
@ -934,7 +934,7 @@ ROM_END
|
||||
|
||||
static DRIVER_INIT( coolpool )
|
||||
{
|
||||
memory_install_read16_handler(machine, 1, ADDRESS_SPACE_IO, 0x07, 0x07, 0, 0, coolpool_input_r);
|
||||
memory_install_read16_handler(cpu_get_address_space(machine->cpu[1], ADDRESS_SPACE_IO), 0x07, 0x07, 0, 0, coolpool_input_r);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1584,16 +1584,16 @@ static DRIVER_INIT( cosmicg )
|
||||
|
||||
static DRIVER_INIT( devzone )
|
||||
{
|
||||
memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4807, 0x4807, 0, 0, cosmic_background_enable_w);
|
||||
memory_install_write8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x4807, 0x4807, 0, 0, cosmic_background_enable_w);
|
||||
}
|
||||
|
||||
|
||||
static DRIVER_INIT( nomnlnd )
|
||||
{
|
||||
memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x5000, 0x5001, 0, 0, nomnlnd_port_0_1_r);
|
||||
memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4800, 0x4800, 0, 0, SMH_NOP);
|
||||
memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x4807, 0x4807, 0, 0, cosmic_background_enable_w);
|
||||
memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x480a, 0x480a, 0, 0, dac_0_data_w);
|
||||
memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x5000, 0x5001, 0, 0, nomnlnd_port_0_1_r);
|
||||
memory_install_write8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x4800, 0x4800, 0, 0, SMH_NOP);
|
||||
memory_install_write8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x4807, 0x4807, 0, 0, cosmic_background_enable_w);
|
||||
memory_install_write8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x480a, 0x480a, 0, 0, dac_0_data_w);
|
||||
}
|
||||
|
||||
|
||||
|
@ -8268,10 +8268,10 @@ static DRIVER_INIT( forgottn )
|
||||
{
|
||||
/* Forgotten Worlds has a NEC uPD4701AC on the B-board handling dial inputs from the CN-MOWS connector. */
|
||||
/* The memory mapping is handled by PAL LWIO */
|
||||
memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x800040, 0x800041, 0, 0, forgottn_dial_0_reset_w);
|
||||
memory_install_write16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x800048, 0x800049, 0, 0, forgottn_dial_1_reset_w);
|
||||
memory_install_read16_handler (machine, 0, ADDRESS_SPACE_PROGRAM, 0x800052, 0x800055, 0, 0, forgottn_dial_0_r);
|
||||
memory_install_read16_handler (machine, 0, ADDRESS_SPACE_PROGRAM, 0x80005a, 0x80005d, 0, 0, forgottn_dial_1_r);
|
||||
memory_install_write16_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x800040, 0x800041, 0, 0, forgottn_dial_0_reset_w);
|
||||
memory_install_write16_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x800048, 0x800049, 0, 0, forgottn_dial_1_reset_w);
|
||||
memory_install_read16_handler (cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x800052, 0x800055, 0, 0, forgottn_dial_0_r);
|
||||
memory_install_read16_handler (cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x80005a, 0x80005d, 0, 0, forgottn_dial_1_r);
|
||||
|
||||
DRIVER_INIT_CALL(cps1);
|
||||
}
|
||||
@ -8280,14 +8280,14 @@ static DRIVER_INIT( sf2ue )
|
||||
{
|
||||
/* This specific version of SF2 has the CPS-B custom mapped at a different address. */
|
||||
/* The mapping is handled by a PAL on the B-board */
|
||||
memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x800140, 0x80017f, 0, 0, SMH_UNMAP, SMH_UNMAP);
|
||||
memory_install_readwrite16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x8001c0, 0x8001ff, 0, 0, cps1_cps_b_r, cps1_cps_b_w);
|
||||
memory_install_readwrite16_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x800140, 0x80017f, 0, 0, SMH_UNMAP, SMH_UNMAP);
|
||||
memory_install_readwrite16_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x8001c0, 0x8001ff, 0, 0, cps1_cps_b_r, cps1_cps_b_w);
|
||||
}
|
||||
|
||||
static DRIVER_INIT( sf2hack )
|
||||
{
|
||||
/* some SF2 hacks have some inputs wired to the LSB instead of MSB */
|
||||
memory_install_read16_handler (machine, 0, ADDRESS_SPACE_PROGRAM, 0x800018, 0x80001f, 0, 0, cps1_hack_dsw_r);
|
||||
memory_install_read16_handler (cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x800018, 0x80001f, 0, 0, cps1_hack_dsw_r);
|
||||
|
||||
DRIVER_INIT_CALL(cps1);
|
||||
}
|
||||
@ -8320,7 +8320,7 @@ static DRIVER_INIT( pang3 )
|
||||
{
|
||||
/* Pang 3 is the only non-QSound game to have an EEPROM. */
|
||||
/* It is mapped in the CPS-B address range so probably is on the C-board. */
|
||||
memory_install_readwrite16_handler (machine, 0, ADDRESS_SPACE_PROGRAM, 0x80017a, 0x80017b, 0, 0, cps1_eeprom_port_r, cps1_eeprom_port_w);
|
||||
memory_install_readwrite16_handler (cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x80017a, 0x80017b, 0, 0, cps1_eeprom_port_r, cps1_eeprom_port_w);
|
||||
|
||||
DRIVER_INIT_CALL(cps1);
|
||||
}
|
||||
@ -8371,11 +8371,11 @@ static DRIVER_INIT( sf2mdt )
|
||||
rom[i+3] = rom[i+6];
|
||||
rom[i+6] = tmp;
|
||||
}
|
||||
memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x70c01a, 0x70c01b, 0, 0, sf2mdt_r);
|
||||
memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x70c01c, 0x70c01d, 0, 0, sf2mdt_r);
|
||||
memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x70c01e, 0x70c01f, 0, 0, sf2mdt_r);
|
||||
memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x70c010, 0x70c011, 0, 0, sf2mdt_r);
|
||||
memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x70c018, 0x70c019, 0, 0, sf2mdt_r);
|
||||
memory_install_read16_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x70c01a, 0x70c01b, 0, 0, sf2mdt_r);
|
||||
memory_install_read16_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x70c01c, 0x70c01d, 0, 0, sf2mdt_r);
|
||||
memory_install_read16_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x70c01e, 0x70c01f, 0, 0, sf2mdt_r);
|
||||
memory_install_read16_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x70c010, 0x70c011, 0, 0, sf2mdt_r);
|
||||
memory_install_read16_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x70c018, 0x70c019, 0, 0, sf2mdt_r);
|
||||
|
||||
DRIVER_INIT_CALL(cps1);
|
||||
}
|
||||
|
@ -7325,7 +7325,7 @@ static DRIVER_INIT( ssf2tb )
|
||||
static DRIVER_INIT ( pzloop2 )
|
||||
{
|
||||
DRIVER_INIT_CALL(cps2);
|
||||
memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x804000, 0x804001, 0, 0, joy_or_paddle_r);
|
||||
memory_install_read16_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x804000, 0x804001, 0, 0, joy_or_paddle_r);
|
||||
}
|
||||
|
||||
|
||||
|
@ -62,7 +62,7 @@ static WRITE8_HANDLER( rom_bank_select_w )
|
||||
static MACHINE_START( crgolf )
|
||||
{
|
||||
/* configure the banking */
|
||||
memory_configure_bank(1, 0, 16, memory_region(machine, "main") + 0x10000, 0x2000);
|
||||
memory_configure_bank(machine, 1, 0, 16, memory_region(machine, "main") + 0x10000, 0x2000);
|
||||
memory_set_bank(1, 0);
|
||||
|
||||
/* register for save states */
|
||||
@ -580,7 +580,7 @@ ROM_END
|
||||
|
||||
static DRIVER_INIT( crgolfhi )
|
||||
{
|
||||
memory_install_write8_handler(machine, 1, ADDRESS_SPACE_PROGRAM, 0xa000, 0xa003, 0, 0, crgolfhi_sample_w);
|
||||
memory_install_write8_handler(cpu_get_address_space(machine->cpu[1], ADDRESS_SPACE_PROGRAM), 0xa000, 0xa003, 0, 0, crgolfhi_sample_w);
|
||||
}
|
||||
|
||||
|
||||
|
@ -423,11 +423,11 @@ static void crimfght_banking( int lines )
|
||||
/* bit 5 = select work RAM or palette */
|
||||
if (lines & 0x20)
|
||||
{
|
||||
memory_install_readwrite8_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x03ff, 0, 0, SMH_BANK3, paletteram_xBBBBBGGGGGRRRRR_be_w);
|
||||
memory_install_readwrite8_handler(cpu_get_address_space(Machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x0000, 0x03ff, 0, 0, SMH_BANK3, paletteram_xBBBBBGGGGGRRRRR_be_w);
|
||||
memory_set_bankptr(3, paletteram);
|
||||
}
|
||||
else
|
||||
memory_install_readwrite8_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x03ff, 0, 0, SMH_BANK1, SMH_BANK1); /* RAM */
|
||||
memory_install_readwrite8_handler(cpu_get_address_space(Machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x0000, 0x03ff, 0, 0, SMH_BANK1, SMH_BANK1); /* RAM */
|
||||
|
||||
/* bit 6 = enable char ROM reading through the video RAM */
|
||||
K052109_set_RMRD_line((lines & 0x40) ? ASSERT_LINE : CLEAR_LINE);
|
||||
|
@ -688,11 +688,12 @@ static DRIVER_INIT( cshooter )
|
||||
|
||||
static DRIVER_INIT( cshootre )
|
||||
{
|
||||
const address_space *space = cputag_get_address_space(machine, "main", ADDRESS_SPACE_PROGRAM);
|
||||
int A;
|
||||
UINT8 *rom = memory_region(machine, "main");
|
||||
UINT8 *decrypt = auto_malloc(0x8000);
|
||||
|
||||
memory_set_decrypted_region(0, 0x0000, 0x7fff, decrypt);
|
||||
memory_set_decrypted_region(space, 0x0000, 0x7fff, decrypt);
|
||||
|
||||
for (A = 0x0000;A < 0x8000;A++)
|
||||
{
|
||||
|
@ -62,10 +62,10 @@ static WRITE32_HANDLER( aga_overlay_w )
|
||||
/* swap the write handlers between ROM and bank 1 based on the bit */
|
||||
if ((data & 1) == 0)
|
||||
/* overlay disabled, map RAM on 0x000000 */
|
||||
memory_install_write32_handler(space->machine, 0, ADDRESS_SPACE_PROGRAM, 0x000000, 0x1fffff, 0, 0, SMH_BANK1);
|
||||
memory_install_write32_handler(space, 0x000000, 0x1fffff, 0, 0, SMH_BANK1);
|
||||
else
|
||||
/* overlay enabled, map Amiga system ROM on 0x000000 */
|
||||
memory_install_write32_handler(space->machine, 0, ADDRESS_SPACE_PROGRAM, 0x000000, 0x1fffff, 0, 0, SMH_UNMAP);
|
||||
memory_install_write32_handler(space, 0x000000, 0x1fffff, 0, 0, SMH_UNMAP);
|
||||
}
|
||||
}
|
||||
|
||||
@ -337,8 +337,8 @@ static DRIVER_INIT( cd32 )
|
||||
amiga_machine_config(machine, &cubocd32_intf);
|
||||
|
||||
/* set up memory */
|
||||
memory_configure_bank(1, 0, 1, amiga_chip_ram32, 0);
|
||||
memory_configure_bank(1, 1, 1, memory_region(machine, "user1"), 0);
|
||||
memory_configure_bank(machine, 1, 0, 1, amiga_chip_ram32, 0);
|
||||
memory_configure_bank(machine, 1, 1, 1, memory_region(machine, "user1"), 0);
|
||||
|
||||
/* intialize akiko */
|
||||
amiga_akiko_init(machine);
|
||||
|
@ -422,6 +422,7 @@ static void decrypt_snd(running_machine *machine)
|
||||
|
||||
static DRIVER_INIT(darkmist)
|
||||
{
|
||||
const address_space *space = cputag_get_address_space(machine, "main", ADDRESS_SPACE_PROGRAM);
|
||||
int i, len;
|
||||
UINT8 *ROM = memory_region(machine, "main");
|
||||
UINT8 *buffer = malloc_or_die(0x10000);
|
||||
@ -455,7 +456,7 @@ static DRIVER_INIT(darkmist)
|
||||
decrypt[i] = p;
|
||||
}
|
||||
|
||||
memory_set_decrypted_region(0, 0x0000, 0x7fff, decrypt);
|
||||
memory_set_decrypted_region(space, 0x0000, 0x7fff, decrypt);
|
||||
memory_set_bankptr(1,&ROM[0x010000]);
|
||||
|
||||
/* adr line swaps */
|
||||
|
@ -844,7 +844,7 @@ static DRIVER_INIT( dassault )
|
||||
free(tmp);
|
||||
|
||||
/* Save time waiting on vblank bit */
|
||||
memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x3f8000, 0x3f8001, 0, 0, dassault_main_skip);
|
||||
memory_install_read16_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x3f8000, 0x3f8001, 0, 0, dassault_main_skip);
|
||||
}
|
||||
|
||||
static DRIVER_INIT( thndzone )
|
||||
@ -864,7 +864,7 @@ static DRIVER_INIT( thndzone )
|
||||
free(tmp);
|
||||
|
||||
/* Save time waiting on vblank bit */
|
||||
memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x3f8000, 0x3f8001, 0, 0, thndzone_main_skip);
|
||||
memory_install_read16_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x3f8000, 0x3f8001, 0, 0, thndzone_main_skip);
|
||||
}
|
||||
|
||||
/**********************************************************************************/
|
||||
|
@ -635,7 +635,7 @@ static READ16_HANDLER( ddealer_mcu_r )
|
||||
|
||||
static DRIVER_INIT( ddealer )
|
||||
{
|
||||
memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xfe01c, 0xfe01d, 0, 0, ddealer_mcu_r );
|
||||
memory_install_read16_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0xfe01c, 0xfe01d, 0, 0, ddealer_mcu_r );
|
||||
}
|
||||
|
||||
ROM_START( ddealer )
|
||||
|
@ -7604,7 +7604,7 @@ static DRIVER_INIT( rongrong )
|
||||
version of the game might be a bootleg with the protection
|
||||
patched. (both sets need this)
|
||||
*/
|
||||
memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x60d4, 0x60d4, 0, 0, SMH_NOP);
|
||||
memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x60d4, 0x60d4, 0, 0, SMH_NOP);
|
||||
}
|
||||
|
||||
/***************************************************************************
|
||||
|
@ -176,7 +176,7 @@ static TIMER_CALLBACK( ddragon_scanline_callback )
|
||||
static MACHINE_START( ddragon )
|
||||
{
|
||||
/* configure banks */
|
||||
memory_configure_bank(1, 0, 8, memory_region(machine, "main") + 0x10000, 0x4000);
|
||||
memory_configure_bank(machine, 1, 0, 8, memory_region(machine, "main") + 0x10000, 0x4000);
|
||||
|
||||
/* allocate timer for scanlines */
|
||||
scanline_timer = timer_alloc(ddragon_scanline_callback, NULL);
|
||||
@ -300,9 +300,9 @@ static WRITE8_HANDLER( darktowr_bankswitch_w )
|
||||
|
||||
memory_set_bank(1, newbank);
|
||||
if (newbank == 4 && oldbank != 4)
|
||||
memory_install_readwrite8_handler(space->machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x7fff, 0, 0, darktowr_mcu_bank_r, darktowr_mcu_bank_w);
|
||||
memory_install_readwrite8_handler(space, 0x4000, 0x7fff, 0, 0, darktowr_mcu_bank_r, darktowr_mcu_bank_w);
|
||||
else if (newbank != 4 && oldbank == 4)
|
||||
memory_install_readwrite8_handler(space->machine, 0, ADDRESS_SPACE_PROGRAM, 0x4000, 0x7fff, 0, 0, SMH_BANK1, SMH_BANK1);
|
||||
memory_install_readwrite8_handler(space, 0x4000, 0x7fff, 0, 0, SMH_BANK1, SMH_BANK1);
|
||||
}
|
||||
|
||||
|
||||
@ -1932,7 +1932,7 @@ static DRIVER_INIT( darktowr )
|
||||
sound_irq = M6809_IRQ_LINE;
|
||||
ym_irq = M6809_FIRQ_LINE;
|
||||
technos_video_hw = 0;
|
||||
memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x3808, 0x3808, 0, 0, darktowr_bankswitch_w);
|
||||
memory_install_write8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x3808, 0x3808, 0, 0, darktowr_bankswitch_w);
|
||||
}
|
||||
|
||||
|
||||
@ -1944,7 +1944,7 @@ static DRIVER_INIT( toffy )
|
||||
sound_irq = M6809_IRQ_LINE;
|
||||
ym_irq = M6809_FIRQ_LINE;
|
||||
technos_video_hw = 0;
|
||||
memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x3808, 0x3808, 0, 0, toffy_bankswitch_w);
|
||||
memory_install_write8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x3808, 0x3808, 0, 0, toffy_bankswitch_w);
|
||||
|
||||
/* the program rom has a simple bitswap encryption */
|
||||
rom = memory_region(machine, "main");
|
||||
|
@ -410,8 +410,8 @@ static DRIVER_INIT( ghunter )
|
||||
seibu_sound_decrypt(machine, "audio", 0x2000);
|
||||
seibu_adpcm_decrypt(machine, "adpcm");
|
||||
|
||||
memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x80000, 0x80001, 0, 0, ghunter_trackball_low_r);
|
||||
memory_install_read16_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xb0000, 0xb0001, 0, 0, ghunter_trackball_high_r);
|
||||
memory_install_read16_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x80000, 0x80001, 0, 0, ghunter_trackball_low_r);
|
||||
memory_install_read16_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0xb0000, 0xb0001, 0, 0, ghunter_trackball_high_r);
|
||||
}
|
||||
|
||||
/* Game Drivers */
|
||||
|
@ -3445,19 +3445,16 @@ ROM_END
|
||||
/* Ghostbusters, Darwin, Oscar use a "Deco 222" custom 6502 for sound. */
|
||||
static DRIVER_INIT( deco222 )
|
||||
{
|
||||
int A,sound_cpu;
|
||||
const address_space *space = cputag_get_address_space(machine, "audio", ADDRESS_SPACE_PROGRAM);
|
||||
int A;
|
||||
UINT8 *decrypt;
|
||||
UINT8 *rom;
|
||||
|
||||
sound_cpu = 1;
|
||||
/* Oscar has three CPUs */
|
||||
if (machine->config->cpu[2].type != CPU_DUMMY) sound_cpu = 2;
|
||||
|
||||
/* bits 5 and 6 of the opcodes are swapped */
|
||||
rom = memory_region(machine, "audio");
|
||||
decrypt = auto_malloc(0x8000);
|
||||
|
||||
memory_set_decrypted_region(sound_cpu, 0x8000, 0xffff, decrypt);
|
||||
memory_set_decrypted_region(space, 0x8000, 0xffff, decrypt);
|
||||
|
||||
for (A = 0x8000;A < 0x10000;A++)
|
||||
decrypt[A-0x8000] = (rom[A] & 0x9f) | ((rom[A] & 0x20) << 1) | ((rom[A] & 0x40) >> 1);
|
||||
|
@ -732,7 +732,7 @@ static DRIVER_INIT( avengrgs )
|
||||
cpu_set_info_int(machine->cpu[0], CPUINFO_INT_SH2_PCFLUSH_ADDR, 0x32dc);
|
||||
|
||||
mainCpuIsArm=0;
|
||||
memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x01089a0, 0x01089a3, 0, 0, avengrgs_speedup_r );
|
||||
memory_install_read32_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x01089a0, 0x01089a3, 0, 0, avengrgs_speedup_r );
|
||||
descramble_sound(machine);
|
||||
}
|
||||
|
||||
|
@ -1099,14 +1099,15 @@ ROM_END
|
||||
|
||||
static DRIVER_INIT( decocass )
|
||||
{
|
||||
const address_space *space = cputag_get_address_space(machine, "main", ADDRESS_SPACE_PROGRAM);
|
||||
UINT8 *rom = memory_region(machine, "main");
|
||||
int A;
|
||||
|
||||
/* allocate memory and mark all RAM regions with their decrypted pointers */
|
||||
decrypted = auto_malloc(0x10000);
|
||||
memory_set_decrypted_region(0, 0x0000, 0xc7ff, &decrypted[0x0000]);
|
||||
memory_set_decrypted_region(0, 0xd000, 0xdbff, &decrypted[0xd000]);
|
||||
memory_set_decrypted_region(0, 0xf000, 0xffff, &decrypted[0xf000]);
|
||||
memory_set_decrypted_region(space, 0x0000, 0xc7ff, &decrypted[0x0000]);
|
||||
memory_set_decrypted_region(space, 0xd000, 0xdbff, &decrypted[0xd000]);
|
||||
memory_set_decrypted_region(space, 0xf000, 0xffff, &decrypted[0xf000]);
|
||||
|
||||
/* Swap bits 5 & 6 for opcodes */
|
||||
for (A = 0xf000;A < 0x10000;A++)
|
||||
@ -1133,15 +1134,15 @@ static DRIVER_INIT( decocrom )
|
||||
decrypted2[i] = swap_bits_5_6(rom[i]);
|
||||
|
||||
/* convert charram to a banked ROM */
|
||||
memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x6000, 0xafff, 0, 0, SMH_BANK1, decocass_de0091_w);
|
||||
memory_configure_bank(1, 0, 1, decocass_charram, 0);
|
||||
memory_configure_bank(1, 1, 1, memory_region(machine, "user3"), 0);
|
||||
memory_configure_bank_decrypted(1, 0, 1, &decrypted[0x6000], 0);
|
||||
memory_configure_bank_decrypted(1, 1, 1, decrypted2, 0);
|
||||
memory_install_readwrite8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x6000, 0xafff, 0, 0, SMH_BANK1, decocass_de0091_w);
|
||||
memory_configure_bank(machine, 1, 0, 1, decocass_charram, 0);
|
||||
memory_configure_bank(machine, 1, 1, 1, memory_region(machine, "user3"), 0);
|
||||
memory_configure_bank_decrypted(machine, 1, 0, 1, &decrypted[0x6000], 0);
|
||||
memory_configure_bank_decrypted(machine, 1, 1, 1, decrypted2, 0);
|
||||
memory_set_bank(1, 0);
|
||||
|
||||
/* install the bank selector */
|
||||
memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xe900, 0xe900, 0, 0, decocass_e900_w);
|
||||
memory_install_write8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0xe900, 0xe900, 0, 0, decocass_e900_w);
|
||||
}
|
||||
|
||||
|
||||
|
@ -565,7 +565,7 @@ static DRIVER_INIT( xfiles )
|
||||
rom[BYTE4_XOR_BE(0x3aa933)] = 0;
|
||||
|
||||
// protection related ?
|
||||
// memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xf0c8b440, 0xf0c8b447, 0, 0, SMH_NOP );
|
||||
// memory_install_read32_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0xf0c8b440, 0xf0c8b447, 0, 0, SMH_NOP );
|
||||
|
||||
flash_roms = 2;
|
||||
}
|
||||
@ -585,7 +585,7 @@ static DRIVER_INIT( kdynastg )
|
||||
rom[BYTE4_XOR_BE(0x3a45c9)] = 0;
|
||||
|
||||
// protection related ?
|
||||
// memory_install_read32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x12341234, 0x12341243, 0, 0, SMH_NOP );
|
||||
// memory_install_read32_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x12341234, 0x12341243, 0, 0, SMH_NOP );
|
||||
|
||||
flash_roms = 4;
|
||||
}
|
||||
|
@ -468,7 +468,7 @@ static MACHINE_RESET( strtheat )
|
||||
MACHINE_RESET_CALL(dkong);
|
||||
|
||||
/* The initial state of the counter is 0x08 */
|
||||
memory_configure_bank(1, 0, 4, &ROM[0x10000], 0x4000);
|
||||
memory_configure_bank(machine, 1, 0, 4, &ROM[0x10000], 0x4000);
|
||||
state->decrypt_counter = 0x08;
|
||||
memory_set_bank(1, 0);
|
||||
}
|
||||
@ -481,7 +481,7 @@ static MACHINE_RESET( drakton )
|
||||
MACHINE_RESET_CALL(dkong);
|
||||
|
||||
/* The initial state of the counter is 0x09 */
|
||||
memory_configure_bank(1, 0, 4, &ROM[0x10000], 0x4000);
|
||||
memory_configure_bank(machine, 1, 0, 4, &ROM[0x10000], 0x4000);
|
||||
state->decrypt_counter = 0x09;
|
||||
memory_set_bank(1, 1);
|
||||
}
|
||||
@ -2877,7 +2877,7 @@ static DRIVER_INIT( drakton )
|
||||
{7,1,4,0,3,6,2,5},
|
||||
};
|
||||
|
||||
memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, SMH_BANK1 );
|
||||
memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x0000, 0x3fff, 0, 0, SMH_BANK1 );
|
||||
|
||||
/* While the PAL supports up to 16 decryption methods, only four
|
||||
are actually used in the PAL. Therefore, we'll take a little
|
||||
@ -2899,7 +2899,7 @@ static DRIVER_INIT( strtheat )
|
||||
{6,3,4,1,0,7,2,5},
|
||||
};
|
||||
|
||||
memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x0000, 0x3fff, 0, 0, SMH_BANK1 );
|
||||
memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x0000, 0x3fff, 0, 0, SMH_BANK1 );
|
||||
|
||||
/* While the PAL supports up to 16 decryption methods, only four
|
||||
are actually used in the PAL. Therefore, we'll take a little
|
||||
@ -2910,8 +2910,8 @@ static DRIVER_INIT( strtheat )
|
||||
drakton_decrypt_rom(machine, 0x88, 0x1c000, bs[3]);
|
||||
|
||||
/* custom handlers supporting Joystick or Steering Wheel */
|
||||
memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x7c00, 0x7c00, 0, 0, strtheat_inputport_0_r);
|
||||
memory_install_read8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x7c80, 0x7c80, 0, 0, strtheat_inputport_1_r);
|
||||
memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x7c00, 0x7c00, 0, 0, strtheat_inputport_0_r);
|
||||
memory_install_read8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x7c80, 0x7c80, 0, 0, strtheat_inputport_1_r);
|
||||
}
|
||||
|
||||
/*************************************
|
||||
|
@ -66,7 +66,7 @@ static WRITE8_HANDLER( lastday_bankswitch_w )
|
||||
|
||||
static MACHINE_START( lastday )
|
||||
{
|
||||
memory_configure_bank(1, 0, 8, memory_region(machine, "main") + 0x10000, 0x4000);
|
||||
memory_configure_bank(machine, 1, 0, 8, memory_region(machine, "main") + 0x10000, 0x4000);
|
||||
}
|
||||
|
||||
static WRITE8_HANDLER( flip_screen_w )
|
||||
|
@ -5609,7 +5609,7 @@ ROM_END
|
||||
|
||||
static DRIVER_INIT( mjreach )
|
||||
{
|
||||
memory_install_write8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x10060, 0x10060, 0, 0, yarunara_flipscreen_w);
|
||||
memory_install_write8_handler(cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM), 0x10060, 0x10060, 0, 0, yarunara_flipscreen_w);
|
||||
}
|
||||
|
||||
/***************************************************************************
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user