mirror of
https://github.com/holub/mame
synced 2025-10-05 16:50:57 +03:00
Here's the big one....
Added new function cpuexec_describe_context(machine) which can be used in logerror() and other printf-style functions to return a description of the current CPU/PC given only the machine. Changed several dozen sites to use this instead of directly interrogating the activecpu. Removed all other uses of activecpu throughout the system. Removed activecpu from the machine structure to prevent future abuse. Removed cpu_push_context() and cpu_pop_context(), and all call sites. Voodoo devices now require a CPU to be defined in the configuration in order to know whom to steal cycles from or stall when FIFOs get full. Updated all voodoo users to specify one. CPD1869 devices now also require a CPU to be defined in the configuration, in order to know which CPU's registers to fetch. Updated all cdp1869 users to specify one. Many other small changes to make this all work.
This commit is contained in:
parent
c8944548df
commit
d87ef8f79b
@ -123,8 +123,6 @@ static TIMER_CALLBACK( cop400_serial_tick )
|
||||
{
|
||||
cop400_state *cop400 = ptr;
|
||||
|
||||
cpu_push_context(cop400->device);
|
||||
|
||||
if (BIT(EN, 0))
|
||||
{
|
||||
/*
|
||||
@ -194,8 +192,6 @@ static TIMER_CALLBACK( cop400_serial_tick )
|
||||
|
||||
SIO = ((SIO << 1) | IN_SI()) & 0x0f;
|
||||
}
|
||||
|
||||
cpu_pop_context();
|
||||
}
|
||||
|
||||
INLINE void WRITE_Q(cop400_state *cop400, UINT8 data)
|
||||
|
@ -26,8 +26,6 @@ static TIMER_CALLBACK( cop400_counter_tick )
|
||||
{
|
||||
cop400_state *cop400 = ptr;
|
||||
|
||||
cpu_push_context(cop400->device);
|
||||
|
||||
T++;
|
||||
|
||||
if (T == 0)
|
||||
@ -40,8 +38,6 @@ static TIMER_CALLBACK( cop400_counter_tick )
|
||||
cop400->halt = 0;
|
||||
}
|
||||
}
|
||||
|
||||
cpu_pop_context();
|
||||
}
|
||||
|
||||
/* IN Latches */
|
||||
@ -52,8 +48,6 @@ static TIMER_CALLBACK( cop400_inil_tick )
|
||||
UINT8 in;
|
||||
int i;
|
||||
|
||||
cpu_push_context(cop400->device);
|
||||
|
||||
in = IN_IN();
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
@ -65,8 +59,6 @@ static TIMER_CALLBACK( cop400_inil_tick )
|
||||
IL |= (1 << i);
|
||||
}
|
||||
}
|
||||
|
||||
cpu_pop_context();
|
||||
}
|
||||
|
||||
/* Microbus */
|
||||
@ -76,8 +68,6 @@ static TIMER_CALLBACK( cop400_microbus_tick )
|
||||
cop400_state *cop400 = ptr;
|
||||
UINT8 in;
|
||||
|
||||
cpu_push_context(cop400->device);
|
||||
|
||||
in = IN_IN();
|
||||
|
||||
if (!BIT(in, 2))
|
||||
@ -101,8 +91,6 @@ static TIMER_CALLBACK( cop400_microbus_tick )
|
||||
cop400->microbus_int = 0;
|
||||
}
|
||||
}
|
||||
|
||||
cpu_pop_context();
|
||||
}
|
||||
|
||||
/* Arithmetic Instructions */
|
||||
|
@ -500,8 +500,6 @@ void dsp32c_pio_w(const device_config *device, int reg, int data)
|
||||
UINT16 mask;
|
||||
UINT8 mode;
|
||||
|
||||
cpu_push_context(device);
|
||||
|
||||
/* look up register and mask */
|
||||
mode = ((cpustate->pcr >> 8) & 2) | ((cpustate->pcr >> 1) & 1);
|
||||
reg = regmap[mode][reg];
|
||||
@ -567,8 +565,6 @@ void dsp32c_pio_w(const device_config *device, int reg, int data)
|
||||
logerror("dsp32_pio_w called on invalid register %d\n", reg);
|
||||
break;
|
||||
}
|
||||
|
||||
cpu_pop_context();
|
||||
}
|
||||
|
||||
|
||||
@ -583,8 +579,6 @@ int dsp32c_pio_r(const device_config *device, int reg)
|
||||
UINT16 mask, result = 0xffff;
|
||||
UINT8 mode, shift = 0;
|
||||
|
||||
cpu_push_context(device);
|
||||
|
||||
/* look up register and mask */
|
||||
mode = ((cpustate->pcr >> 8) & 2) | ((cpustate->pcr >> 1) & 1);
|
||||
reg = regmap[mode][reg];
|
||||
@ -643,7 +637,6 @@ int dsp32c_pio_r(const device_config *device, int reg)
|
||||
break;
|
||||
}
|
||||
|
||||
cpu_pop_context();
|
||||
return (result >> shift) & ~mask;
|
||||
}
|
||||
|
||||
|
@ -635,8 +635,6 @@ static TIMER_CALLBACK( e132xs_timer_callback )
|
||||
hyperstone_state *cpustate = device->token;
|
||||
int update = param;
|
||||
|
||||
cpu_push_context(device);
|
||||
|
||||
/* update the values if necessary */
|
||||
if (update)
|
||||
update_timer_prescale(cpustate);
|
||||
@ -648,8 +646,6 @@ static TIMER_CALLBACK( e132xs_timer_callback )
|
||||
/* adjust ourselves for the next time */
|
||||
else
|
||||
adjust_timer_interrupt(cpustate);
|
||||
|
||||
cpu_pop_context();
|
||||
}
|
||||
|
||||
|
||||
|
@ -264,13 +264,11 @@ static TIMER_CALLBACK( m37710_timer_cb )
|
||||
int which = param;
|
||||
int curirq = M37710_LINE_TIMERA0 - which;
|
||||
|
||||
cpu_push_context(cpustate->device);
|
||||
timer_adjust_oneshot(cpustate->timers[which], cpustate->reload[which], param);
|
||||
|
||||
cpustate->m37710_regs[m37710_irq_levels[curirq]] |= 0x04;
|
||||
m37710_set_irq_line(cpustate, curirq, PULSE_LINE);
|
||||
cpu_triggerint(cpustate->device);
|
||||
cpu_pop_context();
|
||||
}
|
||||
|
||||
static void m37710_external_tick(m37710i_cpu_struct *cpustate, int timer, int state)
|
||||
|
@ -665,7 +665,6 @@ static TIMER_CALLBACK(m6800_tx_tick)
|
||||
{
|
||||
m6800_state *cpustate = ptr;
|
||||
|
||||
cpu_push_context(cpustate->device);
|
||||
if (cpustate->trcsr & M6800_TRCSR_TE)
|
||||
{
|
||||
// force Port 2 bit 4 as output
|
||||
@ -734,14 +733,12 @@ static TIMER_CALLBACK(m6800_tx_tick)
|
||||
}
|
||||
|
||||
m6800_tx(cpustate, cpustate->tx);
|
||||
cpu_pop_context();
|
||||
}
|
||||
|
||||
static TIMER_CALLBACK(m6800_rx_tick)
|
||||
{
|
||||
m6800_state *cpustate =ptr;
|
||||
|
||||
cpu_push_context(cpustate->device);
|
||||
if (cpustate->trcsr & M6800_TRCSR_RE)
|
||||
{
|
||||
if (cpustate->trcsr & M6800_TRCSR_WU)
|
||||
@ -833,7 +830,6 @@ static TIMER_CALLBACK(m6800_rx_tick)
|
||||
}
|
||||
}
|
||||
}
|
||||
cpu_pop_context();
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -1376,10 +1376,8 @@ static int ppc4xx_dma_fetch_transmit_byte(powerpc_state *ppc, int dmachan, UINT8
|
||||
return FALSE;
|
||||
|
||||
/* fetch the data */
|
||||
cpu_push_context(ppc->device);
|
||||
*byte = memory_read_byte(ppc->program, dmaregs[DCR4XX_DMADA0]++);
|
||||
ppc4xx_dma_decrement_count(ppc, dmachan);
|
||||
cpu_pop_context();
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -1402,10 +1400,8 @@ static int ppc4xx_dma_handle_receive_byte(powerpc_state *ppc, int dmachan, UINT8
|
||||
return FALSE;
|
||||
|
||||
/* store the data */
|
||||
cpu_push_context(ppc->device);
|
||||
memory_write_byte(ppc->program, dmaregs[DCR4XX_DMADA0]++, byte);
|
||||
ppc4xx_dma_decrement_count(ppc, dmachan);
|
||||
cpu_pop_context();
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -114,7 +114,6 @@ TIMER_CALLBACK( sh2_timer_callback )
|
||||
SH2 *sh2 = ptr;
|
||||
UINT16 frc;
|
||||
|
||||
cpu_push_context(sh2->device);
|
||||
sh2_timer_resync(sh2);
|
||||
|
||||
frc = sh2->frc;
|
||||
@ -135,8 +134,6 @@ TIMER_CALLBACK( sh2_timer_callback )
|
||||
|
||||
sh2_recalc_irq(sh2);
|
||||
sh2_timer_activate(sh2);
|
||||
|
||||
cpu_pop_context();
|
||||
}
|
||||
|
||||
TIMER_CALLBACK( sh2_dmac_callback )
|
||||
@ -144,12 +141,10 @@ TIMER_CALLBACK( sh2_dmac_callback )
|
||||
int dma = param & 1;
|
||||
SH2 *sh2 = ptr;
|
||||
|
||||
cpu_push_context(sh2->device);
|
||||
LOG(("SH2.%d: DMA %d complete\n", cpu_get_index(sh2->device), dma));
|
||||
sh2->m[0x63+4*dma] |= 2;
|
||||
sh2->dma_timer_active[dma] = 0;
|
||||
sh2_recalc_irq(sh2);
|
||||
cpu_pop_context();
|
||||
}
|
||||
|
||||
static void sh2_dmac_check(SH2 *sh2, int dma)
|
||||
@ -519,10 +514,7 @@ void sh2_set_frt_input(const device_config *device, int state)
|
||||
return;
|
||||
}
|
||||
|
||||
cpu_push_context(device);
|
||||
|
||||
if(sh2->frt_input == state) {
|
||||
cpu_pop_context();
|
||||
return;
|
||||
}
|
||||
|
||||
@ -530,12 +522,10 @@ void sh2_set_frt_input(const device_config *device, int state)
|
||||
|
||||
if(sh2->m[5] & 0x8000) {
|
||||
if(state == CLEAR_LINE) {
|
||||
cpu_pop_context();
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
if(state == ASSERT_LINE) {
|
||||
cpu_pop_context();
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -545,7 +535,6 @@ void sh2_set_frt_input(const device_config *device, int state)
|
||||
sh2->m[4] |= ICF;
|
||||
logerror("SH2.%d: ICF activated (%x)\n", cpu_get_index(sh2->device), sh2->pc & AM);
|
||||
sh2_recalc_irq(sh2);
|
||||
cpu_pop_context();
|
||||
}
|
||||
|
||||
void sh2_set_irq_line(SH2 *sh2, int irqline, int state)
|
||||
|
@ -257,7 +257,6 @@ static TIMER_CALLBACK( sh4_refresh_timer_callback )
|
||||
{
|
||||
SH4 *sh4 = ptr;
|
||||
|
||||
cpu_push_context(sh4->device);
|
||||
sh4->m[RTCNT] = 0;
|
||||
sh4_refresh_timer_recompute(sh4);
|
||||
sh4->m[RTCSR] |= 128;
|
||||
@ -270,7 +269,6 @@ static TIMER_CALLBACK( sh4_refresh_timer_callback )
|
||||
sh4->m[RTCSR] |= 4;
|
||||
}
|
||||
}
|
||||
cpu_pop_context();
|
||||
}
|
||||
|
||||
static void increment_rtc_time(SH4 *sh4, int mode)
|
||||
@ -370,7 +368,6 @@ static TIMER_CALLBACK( sh4_rtc_timer_callback )
|
||||
{
|
||||
SH4 *sh4 = ptr;
|
||||
|
||||
cpu_push_context(sh4->device);
|
||||
timer_adjust_oneshot(sh4->rtc_timer, ATTOTIME_IN_HZ(128), 0);
|
||||
sh4->m[R64CNT] = (sh4->m[R64CNT]+1) & 0x7f;
|
||||
if (sh4->m[R64CNT] == 64)
|
||||
@ -379,7 +376,6 @@ static TIMER_CALLBACK( sh4_rtc_timer_callback )
|
||||
increment_rtc_time(sh4, 0);
|
||||
//sh4_exception_request(sh4, SH4_INTC_NMI); // TEST
|
||||
}
|
||||
cpu_pop_context();
|
||||
}
|
||||
|
||||
static TIMER_CALLBACK( sh4_timer_callback )
|
||||
@ -389,13 +385,11 @@ static TIMER_CALLBACK( sh4_timer_callback )
|
||||
int which = param;
|
||||
int idx = tcr[which];
|
||||
|
||||
cpu_push_context(sh4->device);
|
||||
sh4->m[tcnt[which]] = sh4->m[tcor[which]];
|
||||
sh4_timer_recompute(sh4, which);
|
||||
sh4->m[idx] = sh4->m[idx] | 0x100;
|
||||
if (sh4->m[idx] & 0x20)
|
||||
sh4_exception_request(sh4, tuni[which]);
|
||||
cpu_pop_context();
|
||||
}
|
||||
|
||||
static TIMER_CALLBACK( sh4_dmac_callback )
|
||||
@ -403,7 +397,6 @@ static TIMER_CALLBACK( sh4_dmac_callback )
|
||||
SH4 *sh4 = ptr;
|
||||
int channel = param;
|
||||
|
||||
cpu_push_context(sh4->device);
|
||||
LOG(("SH4 '%s': DMA %d complete\n", sh4->device->tag, channel));
|
||||
sh4->dma_timer_active[channel] = 0;
|
||||
switch (channel)
|
||||
@ -433,7 +426,6 @@ static TIMER_CALLBACK( sh4_dmac_callback )
|
||||
sh4_exception_request(sh4, SH4_INTC_DMTE3);
|
||||
break;
|
||||
}
|
||||
cpu_pop_context();
|
||||
}
|
||||
|
||||
static int sh4_dma_transfer(SH4 *sh4, int channel, int timermode, UINT32 chcr, UINT32 *sar, UINT32 *dar, UINT32 *dmatcr)
|
||||
@ -976,10 +968,7 @@ void sh4_set_frt_input(const device_config *device, int state)
|
||||
return;
|
||||
}
|
||||
|
||||
cpu_push_context(device);
|
||||
|
||||
if(sh4->frt_input == state) {
|
||||
cpu_pop_context();
|
||||
return;
|
||||
}
|
||||
|
||||
@ -987,12 +976,10 @@ void sh4_set_frt_input(const device_config *device, int state)
|
||||
|
||||
if(sh4->m[5] & 0x8000) {
|
||||
if(state == CLEAR_LINE) {
|
||||
cpu_pop_context();
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
if(state == ASSERT_LINE) {
|
||||
cpu_pop_context();
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -1004,7 +991,6 @@ void sh4_set_frt_input(const device_config *device, int state)
|
||||
logerror("SH4 '%s': ICF activated (%x)\n", sh4->device->tag, sh4->pc & AM);
|
||||
sh4_recalc_irq();
|
||||
#endif
|
||||
cpu_pop_context();
|
||||
}
|
||||
|
||||
void sh4_set_irln_input(const device_config *device, int value)
|
||||
|
@ -180,7 +180,7 @@ INLINE void PUSH_STACK(tms32010_state *cpustate, UINT16 data)
|
||||
cpustate->STACK[3] = (data & cpustate->addr_mask);
|
||||
}
|
||||
|
||||
inline void UPDATE_AR(tms32010_state *cpustate)
|
||||
INLINE void UPDATE_AR(tms32010_state *cpustate)
|
||||
{
|
||||
if (cpustate->opcode.b.l & 0x30) {
|
||||
UINT16 tmpAR = cpustate->AR[ARP];
|
||||
|
@ -898,9 +898,6 @@ static TIMER_CALLBACK( scanline_callback )
|
||||
int enabled;
|
||||
int master;
|
||||
|
||||
/* set the CPU context */
|
||||
cpu_push_context(tms->device);
|
||||
|
||||
/* fetch the core timing parameters */
|
||||
current_visarea = video_screen_get_visible_area(tms->screen);
|
||||
enabled = SMART_IOREG(tms, DPYCTL) & 0x8000;
|
||||
@ -1029,9 +1026,6 @@ static TIMER_CALLBACK( scanline_callback )
|
||||
/* note that we add !master (0 or 1) as a attoseconds value; this makes no practical difference */
|
||||
/* but helps ensure that masters are updated first before slaves */
|
||||
timer_adjust_oneshot(tms->scantimer, attotime_add_attoseconds(video_screen_get_time_until_pos(tms->screen, vcount, 0), !master), cpunum | (vcount << 8));
|
||||
|
||||
/* restore the context */
|
||||
cpu_pop_context();
|
||||
}
|
||||
|
||||
|
||||
@ -1558,9 +1552,6 @@ void tms34010_host_w(const device_config *cpu, int reg, int data)
|
||||
tms34010_state *tms = cpu->token;
|
||||
unsigned int addr;
|
||||
|
||||
/* swap to the target cpu */
|
||||
cpu_push_context(cpu);
|
||||
|
||||
switch (reg)
|
||||
{
|
||||
/* upper 16 bits of the address */
|
||||
@ -1603,9 +1594,6 @@ void tms34010_host_w(const device_config *cpu, int reg, int data)
|
||||
logerror("tms34010_host_control_w called on invalid register %d\n", reg);
|
||||
break;
|
||||
}
|
||||
|
||||
/* swap back */
|
||||
cpu_pop_context();
|
||||
}
|
||||
|
||||
|
||||
@ -1639,9 +1627,7 @@ int tms34010_host_r(const device_config *cpu, int reg)
|
||||
|
||||
/* read from the address */
|
||||
addr = (IOREG(tms, REG_HSTADRH) << 16) | IOREG(tms, REG_HSTADRL);
|
||||
cpu_push_context(cpu);
|
||||
result = TMS34010_RDMEM_WORD(tms, TOBYTE(addr & 0xfffffff0));
|
||||
cpu_pop_context();
|
||||
|
||||
/* optional postincrement (it says preincrement, but data is preloaded, so it
|
||||
is effectively a postincrement */
|
||||
|
@ -63,7 +63,6 @@ struct _cpu_class_data
|
||||
cpu_class_header header; /* header containing public data */
|
||||
|
||||
/* cycle counting and executing */
|
||||
UINT8 executing; /* TRUE if the values below are valid */
|
||||
int * icount; /* pointer to the icount */
|
||||
int cycles_running; /* number of cycles we are executing */
|
||||
int cycles_stolen; /* number of cycles we artificially stole */
|
||||
@ -98,6 +97,15 @@ struct _cpu_class_data
|
||||
};
|
||||
|
||||
|
||||
/* global data stored in the machine */
|
||||
/* In mame.h: typedef struct _cpuexec_private cpuexec_private; */
|
||||
struct _cpuexec_private
|
||||
{
|
||||
const device_config *executingcpu; /* pointer to the currently executing CPU */
|
||||
char statebuf[256]; /* string buffer containing state description */
|
||||
};
|
||||
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
FUNCTION PROTOTYPES
|
||||
@ -198,6 +206,10 @@ const device_config *cpuexec_create_cpu_device(const cpu_config *config)
|
||||
void cpuexec_init(running_machine *machine)
|
||||
{
|
||||
int cpunum;
|
||||
|
||||
/* allocate global state */
|
||||
machine->cpuexec_data = auto_malloc(sizeof(*machine->cpuexec_data));
|
||||
memset(machine->cpuexec_data, 0, sizeof(*machine->cpuexec_data));
|
||||
|
||||
/* loop over all our CPUs */
|
||||
for (cpunum = 0; cpunum < ARRAY_LENGTH(machine->config->cpu); cpunum++)
|
||||
@ -350,6 +362,7 @@ static void cpuexec_exit(running_machine *machine)
|
||||
void cpuexec_timeslice(running_machine *machine)
|
||||
{
|
||||
int call_debugger = ((machine->debug_flags & DEBUG_FLAG_ENABLED) != 0);
|
||||
cpuexec_private *global = machine->cpuexec_data;
|
||||
attotime target = timer_next_fire_time(machine);
|
||||
attotime base = timer_get_time(machine);
|
||||
int cpunum, ran;
|
||||
@ -369,7 +382,8 @@ void cpuexec_timeslice(running_machine *machine)
|
||||
/* loop over non-suspended CPUs */
|
||||
for (cpunum = 0; machine->cpu[cpunum] != NULL; cpunum++)
|
||||
{
|
||||
cpu_class_data *classdata = machine->cpu[cpunum]->classtoken;
|
||||
const device_config *cpu = machine->cpu[cpunum];
|
||||
cpu_class_data *classdata = cpu->classtoken;
|
||||
if (classdata->suspend == 0)
|
||||
{
|
||||
attotime delta = attotime_sub(target, classdata->localtime);
|
||||
@ -384,14 +398,14 @@ void cpuexec_timeslice(running_machine *machine)
|
||||
/* note that this global variable cycles_stolen can be modified */
|
||||
/* via the call to the cpunum_execute */
|
||||
classdata->cycles_stolen = 0;
|
||||
classdata->executing = TRUE;
|
||||
global->executingcpu = cpu;
|
||||
if (!call_debugger)
|
||||
ran = cpu_execute(machine->cpu[cpunum], classdata->cycles_running);
|
||||
ran = cpu_execute(cpu, classdata->cycles_running);
|
||||
else
|
||||
{
|
||||
debugger_start_cpu_hook(machine->cpu[cpunum], target);
|
||||
ran = cpu_execute(machine->cpu[cpunum], classdata->cycles_running);
|
||||
debugger_stop_cpu_hook(machine->cpu[cpunum]);
|
||||
debugger_start_cpu_hook(cpu, target);
|
||||
ran = cpu_execute(cpu, classdata->cycles_running);
|
||||
debugger_stop_cpu_hook(cpu);
|
||||
}
|
||||
|
||||
#ifdef MAME_DEBUG
|
||||
@ -399,7 +413,6 @@ void cpuexec_timeslice(running_machine *machine)
|
||||
fatalerror("Negative CPU cycle count!");
|
||||
#endif /* MAME_DEBUG */
|
||||
|
||||
classdata->executing = FALSE;
|
||||
ran -= classdata->cycles_stolen;
|
||||
profiler_mark(PROFILER_END);
|
||||
|
||||
@ -417,6 +430,7 @@ void cpuexec_timeslice(running_machine *machine)
|
||||
}
|
||||
}
|
||||
}
|
||||
global->executingcpu = NULL;
|
||||
|
||||
/* update the local times of all CPUs */
|
||||
for (cpunum = 0; cpunum < ARRAY_LENGTH(machine->cpu) && machine->cpu[cpunum] != NULL; cpunum++)
|
||||
@ -447,19 +461,10 @@ void cpuexec_timeslice(running_machine *machine)
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------
|
||||
cpuexec_boost_interleave - temporarily boosts
|
||||
the interleave factor
|
||||
-------------------------------------------------*/
|
||||
|
||||
void cpuexec_boost_interleave(running_machine *machine, attotime timeslice_time, attotime boost_duration)
|
||||
{
|
||||
/* ignore timeslices > 1 second */
|
||||
if (timeslice_time.seconds > 0)
|
||||
return;
|
||||
timer_add_scheduling_quantum(machine, timeslice_time.attoseconds, boost_duration);
|
||||
}
|
||||
|
||||
/***************************************************************************
|
||||
GLOBAL HELPERS
|
||||
***************************************************************************/
|
||||
|
||||
/*-------------------------------------------------
|
||||
cputag_get_cpu - return a pointer to the given
|
||||
@ -478,6 +483,41 @@ const device_config *cputag_get_cpu(running_machine *machine, const char *tag)
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------
|
||||
cpuexec_boost_interleave - temporarily boosts
|
||||
the interleave factor
|
||||
-------------------------------------------------*/
|
||||
|
||||
void cpuexec_boost_interleave(running_machine *machine, attotime timeslice_time, attotime boost_duration)
|
||||
{
|
||||
/* ignore timeslices > 1 second */
|
||||
if (timeslice_time.seconds > 0)
|
||||
return;
|
||||
timer_add_scheduling_quantum(machine, timeslice_time.attoseconds, boost_duration);
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------
|
||||
cpuexec_describe_context - return a string
|
||||
describing which CPUs are currently executing
|
||||
and their PC
|
||||
-------------------------------------------------*/
|
||||
|
||||
const char *cpuexec_describe_context(running_machine *machine)
|
||||
{
|
||||
cpuexec_private *global = machine->cpuexec_data;
|
||||
const device_config *executingcpu = global->executingcpu;
|
||||
|
||||
/* if we have an executing CPU, output data */
|
||||
if (executingcpu != NULL)
|
||||
sprintf(global->statebuf, "'%s'(%08X)", executingcpu->tag, cpu_get_pc(executingcpu));
|
||||
else
|
||||
strcpy(global->statebuf, "(no context)");
|
||||
|
||||
return global->statebuf;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
CPU SCHEDULING
|
||||
@ -497,8 +537,7 @@ void cpu_suspend(const device_config *device, int reason, int eatcycles)
|
||||
classdata->nexteatcycles = eatcycles;
|
||||
|
||||
/* if we're active, synchronize */
|
||||
if (classdata->executing)
|
||||
cpu_abort_timeslice(device);
|
||||
cpu_abort_timeslice(device);
|
||||
}
|
||||
|
||||
|
||||
@ -515,8 +554,7 @@ void cpu_resume(const device_config *device, int reason)
|
||||
classdata->nextsuspend &= ~reason;
|
||||
|
||||
/* if we're active, synchronize */
|
||||
if (classdata->executing)
|
||||
cpu_abort_timeslice(device);
|
||||
cpu_abort_timeslice(device);
|
||||
}
|
||||
|
||||
|
||||
@ -527,8 +565,7 @@ void cpu_resume(const device_config *device, int reason)
|
||||
|
||||
int cpu_is_executing(const device_config *device)
|
||||
{
|
||||
cpu_class_data *classdata = get_safe_classtoken(device);
|
||||
return classdata->executing;
|
||||
return (device == device->machine->cpuexec_data->executingcpu);
|
||||
}
|
||||
|
||||
|
||||
@ -654,7 +691,7 @@ attotime cpu_get_local_time(const device_config *device)
|
||||
|
||||
/* if we're active, add in the time from the current slice */
|
||||
result = classdata->localtime;
|
||||
if (classdata->executing)
|
||||
if (device == device->machine->cpuexec_data->executingcpu)
|
||||
{
|
||||
int cycles = classdata->cycles_running - *classdata->icount;
|
||||
result = attotime_add(result, cpu_clocks_to_attotime(device, cycles));
|
||||
@ -663,6 +700,21 @@ attotime cpu_get_local_time(const device_config *device)
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------
|
||||
cpuexec_override_local_time - overrides the
|
||||
given time with the executing CPU's local
|
||||
time, if present (this function is private
|
||||
to timer.c)
|
||||
-------------------------------------------------*/
|
||||
|
||||
attotime cpuexec_override_local_time(running_machine *machine, attotime default_time)
|
||||
{
|
||||
if (machine->cpuexec_data != NULL && machine->cpuexec_data->executingcpu != NULL)
|
||||
return cpu_get_local_time(machine->cpuexec_data->executingcpu);
|
||||
return default_time;
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------
|
||||
cpu_get_total_cycles - return the total
|
||||
number of CPU cycles executed on the active
|
||||
@ -673,7 +725,7 @@ UINT64 cpu_get_total_cycles(const device_config *device)
|
||||
{
|
||||
cpu_class_data *classdata = get_safe_classtoken(device);
|
||||
|
||||
if (classdata->executing)
|
||||
if (device == device->machine->cpuexec_data->executingcpu)
|
||||
return classdata->totalcycles + classdata->cycles_running - *classdata->icount;
|
||||
else
|
||||
return classdata->totalcycles;
|
||||
@ -690,7 +742,7 @@ void cpu_eat_cycles(const device_config *device, int cycles)
|
||||
cpu_class_data *classdata = get_safe_classtoken(device);
|
||||
|
||||
/* ignore if not the executing CPU */
|
||||
if (!classdata->executing)
|
||||
if (device != device->machine->cpuexec_data->executingcpu)
|
||||
return;
|
||||
|
||||
if (cycles > *classdata->icount)
|
||||
@ -709,7 +761,7 @@ void cpu_adjust_icount(const device_config *device, int delta)
|
||||
cpu_class_data *classdata = get_safe_classtoken(device);
|
||||
|
||||
/* ignore if not the executing CPU */
|
||||
if (!classdata->executing)
|
||||
if (device != device->machine->cpuexec_data->executingcpu)
|
||||
return;
|
||||
|
||||
*classdata->icount += delta;
|
||||
@ -728,7 +780,7 @@ void cpu_abort_timeslice(const device_config *device)
|
||||
int delta;
|
||||
|
||||
/* ignore if not the executing CPU */
|
||||
if (!classdata->executing)
|
||||
if (device != device->machine->cpuexec_data->executingcpu)
|
||||
return;
|
||||
|
||||
/* swallow the remaining cycles */
|
||||
@ -742,6 +794,19 @@ void cpu_abort_timeslice(const device_config *device)
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------
|
||||
cpuexec_abort_timeslice - abort execution
|
||||
for the current timeslice
|
||||
-------------------------------------------------*/
|
||||
|
||||
void cpuexec_abort_timeslice(running_machine *machine)
|
||||
{
|
||||
const device_config *executingcpu = machine->cpuexec_data->executingcpu;
|
||||
if (executingcpu != NULL)
|
||||
cpu_abort_timeslice(executingcpu);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
SYNCHRONIZATION HELPERS
|
||||
@ -834,8 +899,7 @@ void cpuexec_trigger(running_machine *machine, int trigger)
|
||||
cpu_class_data *classdata = machine->cpu[cpunum]->classtoken;
|
||||
|
||||
/* if we're executing, for an immediate abort */
|
||||
if (classdata->executing)
|
||||
cpu_abort_timeslice(machine->cpu[cpunum]);
|
||||
cpu_abort_timeslice(machine->cpu[cpunum]);
|
||||
|
||||
/* see if this is a matching trigger */
|
||||
if (classdata->suspend != 0 && classdata->trigger == trigger)
|
||||
@ -1153,11 +1217,7 @@ static void on_vblank(const device_config *device, void *param, int vblank_state
|
||||
if (cpu_interested)
|
||||
{
|
||||
if (!(classdata->suspend & (SUSPEND_REASON_HALT | SUSPEND_REASON_RESET | SUSPEND_REASON_DISABLE)))
|
||||
{
|
||||
cpu_push_context(cpudevice);
|
||||
(*config->vblank_interrupt)(cpudevice);
|
||||
cpu_pop_context();
|
||||
}
|
||||
|
||||
/* if we have more than one interrupt per frame, start the timer now to trigger the rest of them */
|
||||
if (config->vblank_interrupts_per_frame > 1 && !(classdata->suspend & SUSPEND_REASON_DISABLE))
|
||||
@ -1189,11 +1249,7 @@ static TIMER_CALLBACK( trigger_partial_frame_interrupt )
|
||||
|
||||
/* call the interrupt handler */
|
||||
if (!cpu_is_suspended(device, SUSPEND_REASON_HALT | SUSPEND_REASON_RESET | SUSPEND_REASON_DISABLE))
|
||||
{
|
||||
cpu_push_context(device);
|
||||
(*config->vblank_interrupt)(device);
|
||||
cpu_pop_context();
|
||||
}
|
||||
|
||||
/* more? */
|
||||
if (classdata->iloops > 1)
|
||||
@ -1213,11 +1269,7 @@ static TIMER_CALLBACK( trigger_periodic_interrupt )
|
||||
|
||||
/* bail if there is no routine */
|
||||
if (config->timed_interrupt != NULL && !cpu_is_suspended(device, SUSPEND_REASON_HALT | SUSPEND_REASON_RESET | SUSPEND_REASON_DISABLE))
|
||||
{
|
||||
cpu_push_context(device);
|
||||
(*config->timed_interrupt)(device);
|
||||
cpu_pop_context();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1244,9 +1296,6 @@ static TIMER_CALLBACK( empty_event_queue )
|
||||
cpu_input_data *inputline = &classdata->input[param];
|
||||
int curevent;
|
||||
|
||||
/* swap to the CPU's context */
|
||||
cpu_push_context(device);
|
||||
|
||||
/* loop over all events */
|
||||
for (curevent = 0; curevent < inputline->qindex; curevent++)
|
||||
{
|
||||
@ -1321,9 +1370,6 @@ static TIMER_CALLBACK( empty_event_queue )
|
||||
}
|
||||
}
|
||||
|
||||
/* swap back */
|
||||
cpu_pop_context();
|
||||
|
||||
/* reset counter */
|
||||
inputline->qindex = 0;
|
||||
}
|
||||
|
@ -108,9 +108,19 @@ void cpuexec_timeslice(running_machine *machine);
|
||||
/* temporarily boosts the interleave factor */
|
||||
void cpuexec_boost_interleave(running_machine *machine, attotime timeslice_time, attotime boost_duration);
|
||||
|
||||
|
||||
|
||||
/* ----- global helpers ----- */
|
||||
|
||||
/* return a pointer to the given CPU by tag */
|
||||
const device_config *cputag_get_cpu(running_machine *machine, const char *tag);
|
||||
|
||||
/* abort execution for the current timeslice */
|
||||
void cpuexec_abort_timeslice(running_machine *machine);
|
||||
|
||||
/* return a string describing which CPUs are currently executing and their PC */
|
||||
const char *cpuexec_describe_context(running_machine *machine);
|
||||
|
||||
|
||||
|
||||
/* ----- CPU scheduling----- */
|
||||
@ -165,7 +175,7 @@ void cpu_eat_cycles(const device_config *device, int cycles);
|
||||
/* apply a +/- to the current icount */
|
||||
void cpu_adjust_icount(const device_config *device, int delta);
|
||||
|
||||
/* aborts the timeslice for the active CPU */
|
||||
/* abort execution for the current timeslice, allowing other CPUs to run before we run again */
|
||||
void cpu_abort_timeslice(const device_config *device);
|
||||
|
||||
|
||||
|
@ -911,9 +911,6 @@ static const struct
|
||||
|
||||
static cpu_class_header cpu_type_header[CPU_COUNT];
|
||||
|
||||
static const device_config *cpu_context_stack[4];
|
||||
static int cpu_context_stack_ptr;
|
||||
|
||||
static char temp_string_pool[TEMP_STRING_POOL_ENTRIES][MAX_STRING_LENGTH];
|
||||
static int temp_string_pool_index;
|
||||
|
||||
@ -952,41 +949,6 @@ INLINE cpu_class_header *get_safe_classheader(const device_config *device)
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------
|
||||
set_cpu_context - set the current CPU context
|
||||
swapping out the old one if necessary
|
||||
-------------------------------------------------*/
|
||||
|
||||
INLINE void set_cpu_context(const device_config *oldcpu, const device_config *newcpu)
|
||||
{
|
||||
cpu_class_header *classheader;
|
||||
|
||||
/* if nothing is changing, quick exit */
|
||||
if (oldcpu == newcpu)
|
||||
return;
|
||||
|
||||
/* swap out the old context if we have one */
|
||||
if (oldcpu != NULL)
|
||||
{
|
||||
classheader = oldcpu->classtoken;
|
||||
(*classheader->get_context)(oldcpu->token);
|
||||
}
|
||||
|
||||
/* swap in the new context if we have one */
|
||||
if (newcpu != NULL)
|
||||
{
|
||||
/* make this the activecpu */
|
||||
newcpu->machine->activecpu = newcpu;
|
||||
|
||||
/* set the memory context and swap in the new */
|
||||
classheader = newcpu->classtoken;
|
||||
(*classheader->set_context)(newcpu->token);
|
||||
}
|
||||
else
|
||||
Machine->activecpu = NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
GLOBAL MANAGEMENT
|
||||
@ -1067,10 +1029,6 @@ void cpuintrf_init(running_machine *machine)
|
||||
for (mapindex = 0; mapindex < CPU_COUNT; mapindex++)
|
||||
if (cpu_type_header[mapindex].get_info == NULL)
|
||||
cpu_type_header[mapindex] = cpu_type_header[CPU_DUMMY];
|
||||
|
||||
/* reset the context stack */
|
||||
memset((void *)&cpu_context_stack[0], 0, sizeof(cpu_context_stack));
|
||||
cpu_context_stack_ptr = 0;
|
||||
}
|
||||
|
||||
|
||||
@ -1079,31 +1037,6 @@ void cpuintrf_init(running_machine *machine)
|
||||
LIVE CONTEXT CONTROL
|
||||
***************************************************************************/
|
||||
|
||||
/*-------------------------------------------------
|
||||
cpu_push_context - remember the current
|
||||
context and push a new one on the stack
|
||||
-------------------------------------------------*/
|
||||
|
||||
void cpu_push_context(const device_config *device)
|
||||
{
|
||||
const device_config *oldcpu = device->machine->activecpu;
|
||||
cpu_context_stack[cpu_context_stack_ptr++] = oldcpu;
|
||||
set_cpu_context(oldcpu, device);
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------
|
||||
cpu_pop_context - restore a previously saved
|
||||
context
|
||||
-------------------------------------------------*/
|
||||
|
||||
void cpu_pop_context(void)
|
||||
{
|
||||
const device_config *device = cpu_context_stack[--cpu_context_stack_ptr];
|
||||
set_cpu_context(Machine->activecpu, device);
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------
|
||||
cpu_get_index_slow - find a CPU in the machine
|
||||
by searching
|
||||
@ -1138,12 +1071,8 @@ void cpu_init(const device_config *device, int index, int clock, cpu_irq_callbac
|
||||
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);
|
||||
|
||||
device->machine->activecpu = device;
|
||||
|
||||
(*classheader->init)(device, index, clock, irqcallback);
|
||||
(*classheader->get_context)(device->token);
|
||||
|
||||
device->machine->activecpu = NULL;
|
||||
}
|
||||
|
||||
|
||||
@ -1156,11 +1085,7 @@ void cpu_exit(const device_config *device)
|
||||
cpu_class_header *classheader = get_safe_classheader(device);
|
||||
|
||||
if (classheader->exit != NULL)
|
||||
{
|
||||
set_cpu_context(device->machine->activecpu, device);
|
||||
(*classheader->exit)(device);
|
||||
device->machine->activecpu = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1174,10 +1099,8 @@ INT64 cpu_get_info_int(const device_config *device, UINT32 state)
|
||||
cpu_class_header *classheader = get_safe_classheader(device);
|
||||
cpuinfo info;
|
||||
|
||||
cpu_push_context(device);
|
||||
info.i = 0;
|
||||
(*classheader->get_info)(device, state, &info);
|
||||
cpu_pop_context();
|
||||
return info.i;
|
||||
}
|
||||
|
||||
@ -1186,10 +1109,8 @@ void *cpu_get_info_ptr(const device_config *device, UINT32 state)
|
||||
cpu_class_header *classheader = get_safe_classheader(device);
|
||||
cpuinfo info;
|
||||
|
||||
cpu_push_context(device);
|
||||
info.p = NULL;
|
||||
(*classheader->get_info)(device, state, &info);
|
||||
cpu_pop_context();
|
||||
return info.p;
|
||||
}
|
||||
|
||||
@ -1198,10 +1119,8 @@ genf *cpu_get_info_fct(const device_config *device, UINT32 state)
|
||||
cpu_class_header *classheader = get_safe_classheader(device);
|
||||
cpuinfo info;
|
||||
|
||||
cpu_push_context(device);
|
||||
info.f = NULL;
|
||||
(*classheader->get_info)(device, state, &info);
|
||||
cpu_pop_context();
|
||||
return info.f;
|
||||
}
|
||||
|
||||
@ -1210,10 +1129,8 @@ const char *cpu_get_info_string(const device_config *device, UINT32 state)
|
||||
cpu_class_header *classheader = get_safe_classheader(device);
|
||||
cpuinfo info;
|
||||
|
||||
cpu_push_context(device);
|
||||
info.s = get_temp_string_buffer();
|
||||
(*classheader->get_info)(device, state, &info);
|
||||
cpu_pop_context();
|
||||
return info.s;
|
||||
}
|
||||
|
||||
@ -1229,9 +1146,7 @@ void cpu_set_info_int(const device_config *device, UINT32 state, INT64 data)
|
||||
cpuinfo info;
|
||||
|
||||
info.i = data;
|
||||
cpu_push_context(device);
|
||||
(*classheader->set_info)(device, state, &info);
|
||||
cpu_pop_context();
|
||||
}
|
||||
|
||||
void cpu_set_info_ptr(const device_config *device, UINT32 state, void *data)
|
||||
@ -1240,9 +1155,7 @@ void cpu_set_info_ptr(const device_config *device, UINT32 state, void *data)
|
||||
cpuinfo info;
|
||||
|
||||
info.p = data;
|
||||
cpu_push_context(device);
|
||||
(*classheader->set_info)(device, state, &info);
|
||||
cpu_pop_context();
|
||||
}
|
||||
|
||||
void cpu_set_info_fct(const device_config *device, UINT32 state, genf *data)
|
||||
@ -1251,9 +1164,7 @@ void cpu_set_info_fct(const device_config *device, UINT32 state, genf *data)
|
||||
cpuinfo info;
|
||||
|
||||
info.f = data;
|
||||
cpu_push_context(device);
|
||||
(*classheader->set_info)(device, state, &info);
|
||||
cpu_pop_context();
|
||||
}
|
||||
|
||||
|
||||
@ -1268,9 +1179,7 @@ int cpu_execute(const device_config *device, int cycles)
|
||||
cpu_class_header *classheader = get_safe_classheader(device);
|
||||
int ran;
|
||||
|
||||
cpu_push_context(device);
|
||||
ran = (*classheader->execute)(device, cycles);
|
||||
cpu_pop_context();
|
||||
return ran;
|
||||
}
|
||||
|
||||
@ -1283,9 +1192,7 @@ void cpu_reset(const device_config *device)
|
||||
{
|
||||
cpu_class_header *classheader = get_safe_classheader(device);
|
||||
|
||||
cpu_push_context(device);
|
||||
(*classheader->reset)(device);
|
||||
cpu_pop_context();
|
||||
}
|
||||
|
||||
|
||||
@ -1300,10 +1207,8 @@ offs_t cpu_get_physical_pc_byte(const device_config *device)
|
||||
const address_space *space = cpu_get_address_space(device, ADDRESS_SPACE_PROGRAM);
|
||||
offs_t pc;
|
||||
|
||||
cpu_push_context(device);
|
||||
pc = memory_address_to_byte(space, cpu_get_info_int(device, CPUINFO_INT_PC));
|
||||
memory_address_physical(space, TRANSLATE_FETCH, &pc);
|
||||
cpu_pop_context();
|
||||
return pc;
|
||||
}
|
||||
|
||||
@ -1318,8 +1223,6 @@ offs_t cpu_dasm(const device_config *device, char *buffer, offs_t pc, const UINT
|
||||
cpu_class_header *classheader = get_safe_classheader(device);
|
||||
offs_t result = 0;
|
||||
|
||||
cpu_push_context(device);
|
||||
|
||||
/* check for disassembler override */
|
||||
if (classheader->dasm_override != NULL)
|
||||
result = (*classheader->dasm_override)(device, buffer, pc, oprom, opram);
|
||||
@ -1365,7 +1268,6 @@ offs_t cpu_dasm(const device_config *device, char *buffer, offs_t pc, const UINT
|
||||
}
|
||||
#endif
|
||||
|
||||
cpu_pop_context();
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -166,16 +166,16 @@ enum
|
||||
/* get_reg/set_reg constants */
|
||||
enum
|
||||
{
|
||||
/* This value is passed to activecpu_get_reg to retrieve the previous
|
||||
/* This value is passed to cpu_get_reg to retrieve the previous
|
||||
* program counter value, ie. before a CPU emulation started
|
||||
* to fetch opcodes and arguments for the current instrution. */
|
||||
REG_PREVIOUSPC = CPUINFO_INT_PREVIOUSPC - CPUINFO_INT_REGISTER,
|
||||
|
||||
/* This value is passed to activecpu_get_reg to retrieve the current
|
||||
/* This value is passed to cpu_get_reg to retrieve the current
|
||||
* program counter value. */
|
||||
REG_PC = CPUINFO_INT_PC - CPUINFO_INT_REGISTER,
|
||||
|
||||
/* This value is passed to activecpu_get_reg to retrieve the current
|
||||
/* This value is passed to cpu_get_reg to retrieve the current
|
||||
* stack pointer value. */
|
||||
REG_SP = CPUINFO_INT_SP - CPUINFO_INT_REGISTER
|
||||
};
|
||||
@ -690,12 +690,6 @@ char *cpuintrf_temp_str(void);
|
||||
|
||||
/* ----- live context control ----- */
|
||||
|
||||
/* remember the current context and push a new one on the stack */
|
||||
void cpu_push_context(const device_config *cpu);
|
||||
|
||||
/* restore the previously saved context */
|
||||
void cpu_pop_context(void);
|
||||
|
||||
/* find a CPU in the machine by searching */
|
||||
int cpu_get_index_slow(const device_config *cpu);
|
||||
|
||||
|
@ -1491,13 +1491,11 @@ static void execute_save(running_machine *machine, int ref, int params, const ch
|
||||
}
|
||||
|
||||
/* now write the data out */
|
||||
cpu_push_context(space->cpu);
|
||||
for (i = offset; i <= endoffset; i++)
|
||||
{
|
||||
UINT8 byte = debug_read_byte(space, i, TRUE);
|
||||
fwrite(&byte, 1, 1, f);
|
||||
}
|
||||
cpu_pop_context();
|
||||
|
||||
/* close the file */
|
||||
fclose(f);
|
||||
@ -1550,7 +1548,6 @@ static void execute_dump(running_machine *machine, int ref, int params, const ch
|
||||
}
|
||||
|
||||
/* now write the data out */
|
||||
cpu_push_context(space->cpu);
|
||||
for (i = offset; i <= endoffset; i += 16)
|
||||
{
|
||||
char output[200];
|
||||
@ -1659,7 +1656,6 @@ static void execute_dump(running_machine *machine, int ref, int params, const ch
|
||||
/* output the result */
|
||||
fprintf(f, "%s\n", output);
|
||||
}
|
||||
cpu_pop_context();
|
||||
|
||||
/* close the file */
|
||||
fclose(f);
|
||||
@ -1733,7 +1729,6 @@ static void execute_find(running_machine *machine, int ref, int params, const ch
|
||||
}
|
||||
|
||||
/* now search */
|
||||
cpu_push_context(space->cpu);
|
||||
for (i = offset; i <= endoffset; i += data_size[0])
|
||||
{
|
||||
int suboffset = 0;
|
||||
@ -1760,7 +1755,6 @@ static void execute_find(running_machine *machine, int ref, int params, const ch
|
||||
debug_console_printf(machine, "Found at %*X\n", space->logaddrchars, (UINT32)memory_byte_to_address(space, i));
|
||||
}
|
||||
}
|
||||
cpu_pop_context();
|
||||
|
||||
/* print something if not found */
|
||||
if (found == 0)
|
||||
@ -1809,7 +1803,6 @@ static void execute_dasm(running_machine *machine, int ref, int params, const ch
|
||||
}
|
||||
|
||||
/* now write the data out */
|
||||
cpu_push_context(space->cpu);
|
||||
for (i = 0; i < length; )
|
||||
{
|
||||
int pcbyte = memory_address_to_byte(space, offset + i) & space->bytemask;
|
||||
@ -1898,7 +1891,6 @@ static void execute_dasm(running_machine *machine, int ref, int params, const ch
|
||||
/* output the result */
|
||||
fprintf(f, "%s\n", output);
|
||||
}
|
||||
cpu_pop_context();
|
||||
|
||||
/* close the file */
|
||||
fclose(f);
|
||||
@ -2011,7 +2003,6 @@ static void execute_history(running_machine *machine, int ref, int params, const
|
||||
cpuinfo = cpu_get_debug_data(space->cpu);
|
||||
|
||||
/* loop over lines */
|
||||
cpu_push_context(space->cpu);
|
||||
for (i = 0; i < count; i++)
|
||||
{
|
||||
offs_t pc = cpuinfo->pc_history[(cpuinfo->pc_history_index + DEBUG_HISTORY_SIZE - count + i) % DEBUG_HISTORY_SIZE];
|
||||
@ -2033,7 +2024,6 @@ static void execute_history(running_machine *machine, int ref, int params, const
|
||||
|
||||
debug_console_printf(machine, "%0*X: %s\n", space->logaddrchars, pc, buffer);
|
||||
}
|
||||
cpu_pop_context();
|
||||
}
|
||||
|
||||
|
||||
|
@ -2350,7 +2350,6 @@ static UINT64 expression_read_address_space(const address_space *space, offs_t a
|
||||
address = memory_address_to_byte(space, address);
|
||||
|
||||
/* switch contexts and do the read */
|
||||
cpu_push_context(space->cpu);
|
||||
switch (size)
|
||||
{
|
||||
case 1: result = debug_read_byte(space, address, TRUE); break;
|
||||
@ -2358,7 +2357,6 @@ static UINT64 expression_read_address_space(const address_space *space, offs_t a
|
||||
case 4: result = debug_read_dword(space, address, TRUE); break;
|
||||
case 8: result = debug_read_qword(space, address, TRUE); break;
|
||||
}
|
||||
cpu_pop_context();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@ -2558,7 +2556,6 @@ static void expression_write_address_space(const address_space *space, offs_t ad
|
||||
address = memory_address_to_byte(space, address);
|
||||
|
||||
/* switch contexts and do the write */
|
||||
cpu_push_context(space->cpu);
|
||||
switch (size)
|
||||
{
|
||||
case 1: debug_write_byte(space, address, data, TRUE); break;
|
||||
@ -2566,7 +2563,6 @@ static void expression_write_address_space(const address_space *space, offs_t ad
|
||||
case 4: debug_write_dword(space, address, data, TRUE); break;
|
||||
case 8: debug_write_qword(space, address, data, TRUE); break;
|
||||
}
|
||||
cpu_pop_context();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1963,9 +1963,6 @@ static void disasm_view_update(debug_view *view)
|
||||
pc = cpu_get_pc(space->cpu);
|
||||
pcbyte = memory_address_to_byte(space, pc) & space->logbytemask;
|
||||
|
||||
/* switch to the CPU's context */
|
||||
cpu_push_context(space->cpu);
|
||||
|
||||
/* if our expression is dirty, fix it */
|
||||
if (dasmdata->expression.dirty)
|
||||
{
|
||||
@ -2138,9 +2135,6 @@ recompute:
|
||||
col++;
|
||||
}
|
||||
}
|
||||
|
||||
/* restore the original CPU context */
|
||||
cpu_pop_context();
|
||||
}
|
||||
|
||||
|
||||
@ -2624,10 +2618,6 @@ static void memory_view_update(debug_view *view)
|
||||
/* get positional data */
|
||||
posdata = &memory_pos_table[memdata->bytes_per_chunk];
|
||||
|
||||
/* switch to the CPU's context */
|
||||
if (space != NULL)
|
||||
cpu_push_context(space->cpu);
|
||||
|
||||
/* loop over visible rows */
|
||||
for (row = 0; row < view->visible.y; row++)
|
||||
{
|
||||
@ -2696,10 +2686,6 @@ static void memory_view_update(debug_view *view)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* restore the context */
|
||||
if (memdata->desc->base == NULL)
|
||||
cpu_pop_context();
|
||||
}
|
||||
|
||||
|
||||
@ -3019,7 +3005,6 @@ static UINT64 memory_view_read(debug_view_memory *memdata, UINT8 size, offs_t of
|
||||
const address_space *space = memdata->desc->space;
|
||||
UINT64 result = ~(UINT64)0;
|
||||
|
||||
cpu_push_context(space->cpu);
|
||||
switch (size)
|
||||
{
|
||||
case 1: result = debug_read_byte(space, offs, !memdata->no_translation); break;
|
||||
@ -3027,7 +3012,6 @@ static UINT64 memory_view_read(debug_view_memory *memdata, UINT8 size, offs_t of
|
||||
case 4: result = debug_read_dword(space, offs, !memdata->no_translation); break;
|
||||
case 8: result = debug_read_qword(space, offs, !memdata->no_translation); break;
|
||||
}
|
||||
cpu_pop_context();
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -3061,7 +3045,6 @@ static void memory_view_write(debug_view_memory *memdata, UINT8 size, offs_t off
|
||||
{
|
||||
const address_space *space = memdata->desc->space;
|
||||
|
||||
cpu_push_context(space->cpu);
|
||||
switch (size)
|
||||
{
|
||||
case 1: debug_write_byte(space, offs, data, !memdata->no_translation); break;
|
||||
@ -3069,7 +3052,6 @@ static void memory_view_write(debug_view_memory *memdata, UINT8 size, offs_t off
|
||||
case 4: debug_write_dword(space, offs, data, !memdata->no_translation); break;
|
||||
case 8: debug_write_qword(space, offs, data, !memdata->no_translation); break;
|
||||
}
|
||||
cpu_pop_context();
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -178,7 +178,7 @@ static void via_set_int (running_machine *machine, int which, int data)
|
||||
|
||||
v->ifr |= data;
|
||||
#ifdef TRACE_VIA
|
||||
logerror("6522VIA chip %d: IFR = %02X. PC: %08X\n", which, v->ifr, safe_cpu_get_pc(machine->activecpu));
|
||||
logerror("%s:6522VIA chip %d: IFR = %02X\n", cpuexec_describe_context(machine), which, v->ifr);
|
||||
#endif
|
||||
|
||||
if (v->ier & v->ifr)
|
||||
@ -187,7 +187,7 @@ logerror("6522VIA chip %d: IFR = %02X. PC: %08X\n", which, v->ifr, safe_cpu_get
|
||||
if (v->intf->irq_func)
|
||||
(*v->intf->irq_func)(machine, ASSERT_LINE);
|
||||
else
|
||||
logerror("6522VIA chip %d: Interrupt is asserted but there is no callback function. PC: %08X\n", which, safe_cpu_get_pc(machine->activecpu));
|
||||
logerror("%s:6522VIA chip %d: Interrupt is asserted but there is no callback function\n", cpuexec_describe_context(machine), which);
|
||||
}
|
||||
}
|
||||
|
||||
@ -198,7 +198,7 @@ static void via_clear_int (running_machine *machine, int which, int data)
|
||||
|
||||
v->ifr = (v->ifr & ~data) & 0x7f;
|
||||
#ifdef TRACE_VIA
|
||||
logerror("6522VIA chip %d: IFR = %02X. PC: %08X\n", which, v->ifr, safe_cpu_get_pc(machine->activecpu));
|
||||
logerror("%s:6522VIA chip %d: IFR = %02X\n", cpuexec_describe_context(machine), which, v->ifr);
|
||||
#endif
|
||||
|
||||
if (v->ifr & v->ier)
|
||||
@ -208,7 +208,7 @@ logerror("6522VIA chip %d: IFR = %02X. PC: %08X\n", which, v->ifr, safe_cpu_get
|
||||
if (v->intf->irq_func)
|
||||
(*v->intf->irq_func)(machine, CLEAR_LINE);
|
||||
// else
|
||||
// logerror("6522VIA chip %d: Interrupt is cleared but there is no callback function. PC: %08X\n", which, safe_cpu_get_pc(machine->activecpu));
|
||||
// logerror("%s:6522VIA chip %d: Interrupt is cleared but there is no callback function\n", cpuexec_describe_context(machine), which);
|
||||
}
|
||||
}
|
||||
|
||||
@ -343,7 +343,7 @@ static TIMER_CALLBACK( via_t1_timeout )
|
||||
if (v->intf->out_b_func)
|
||||
v->intf->out_b_func(space, 0, write_data);
|
||||
else
|
||||
logerror("6522VIA chip %d: Port B is being written to but has no handler. PC: %08X - %02X\n", which, safe_cpu_get_pc(machine->activecpu), write_data);
|
||||
logerror("%s:6522VIA chip %d: Port B is being written to but has no handler. %02X\n", cpuexec_describe_context(machine), which, write_data);
|
||||
}
|
||||
|
||||
if (!(v->ifr & INT_T1))
|
||||
@ -411,7 +411,7 @@ int via_read(running_machine *machine, int which, int offset)
|
||||
if (v->intf->in_b_func)
|
||||
v->in_b = v->intf->in_b_func(space, 0);
|
||||
else
|
||||
logerror("6522VIA chip %d: Port B is being read but has no handler. PC: %08X\n", which, safe_cpu_get_pc(machine->activecpu));
|
||||
logerror("%s:6522VIA chip %d: Port B is being read but has no handler\n", cpuexec_describe_context(machine), which);
|
||||
}
|
||||
|
||||
CLR_PB_INT(v, which);
|
||||
@ -430,7 +430,7 @@ int via_read(running_machine *machine, int which, int offset)
|
||||
if (v->intf->in_a_func)
|
||||
v->in_a = v->intf->in_a_func(space, 0);
|
||||
else
|
||||
logerror("6522VIA chip %d: Port A is being read but has no handler. PC: %08X\n", which, safe_cpu_get_pc(machine->activecpu));
|
||||
logerror("%s:6522VIA chip %d: Port A is being read but has no handler\n", cpuexec_describe_context(machine), which);
|
||||
}
|
||||
|
||||
/* combine input and output values */
|
||||
@ -451,7 +451,7 @@ int via_read(running_machine *machine, int which, int offset)
|
||||
if (v->intf->out_ca2_func)
|
||||
v->intf->out_ca2_func(space, 0, 0);
|
||||
else
|
||||
logerror("6522VIA chip %d: Port CA2 is being written to but has no handler. PC: %08X - %02X\n", which, safe_cpu_get_pc(machine->activecpu), 0);
|
||||
logerror("%s:6522VIA chip %d: Port CA2 is being written to but has no handler - %02X\n", cpuexec_describe_context(machine), which, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@ -464,7 +464,7 @@ int via_read(running_machine *machine, int which, int offset)
|
||||
if (v->intf->in_a_func)
|
||||
v->in_a = v->intf->in_a_func(space, 0);
|
||||
else
|
||||
logerror("6522VIA chip %d: Port A is being read but has no handler. PC: %08X\n", which, safe_cpu_get_pc(machine->activecpu));
|
||||
logerror("%s:6522VIA chip %d: Port A is being read but has no handler\n", cpuexec_describe_context(machine), which);
|
||||
}
|
||||
|
||||
/* combine input and output values */
|
||||
@ -576,7 +576,7 @@ void via_write(running_machine *machine, int which, int offset, int data)
|
||||
if (v->intf->out_b_func)
|
||||
v->intf->out_b_func(space, 0, write_data);
|
||||
else
|
||||
logerror("6522VIA chip %d: Port B is being written to but has no handler. PC: %08X - %02X\n", which, safe_cpu_get_pc(machine->activecpu), write_data);
|
||||
logerror("%s:6522VIA chip %d: Port B is being written to but has no handler - %02X\n", cpuexec_describe_context(machine), which, write_data);
|
||||
}
|
||||
|
||||
CLR_PB_INT(v, which);
|
||||
@ -594,7 +594,7 @@ void via_write(running_machine *machine, int which, int offset, int data)
|
||||
if (v->intf->out_cb2_func)
|
||||
v->intf->out_cb2_func(space, 0, 0);
|
||||
else
|
||||
logerror("6522VIA chip %d: Port CB2 is being written to but has no handler. PC: %08X - %02X\n", which, safe_cpu_get_pc(machine->activecpu), 0);
|
||||
logerror("%s:6522VIA chip %d: Port CB2 is being written to but has no handler - %02X\n", cpuexec_describe_context(machine), which, 0);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -609,7 +609,7 @@ void via_write(running_machine *machine, int which, int offset, int data)
|
||||
if (v->intf->out_a_func)
|
||||
v->intf->out_a_func(space, 0, write_data);
|
||||
else
|
||||
logerror("6522VIA chip %d: Port A is being written to but has no handler. PC: %08X - %02X\n", which, safe_cpu_get_pc(machine->activecpu), write_data);
|
||||
logerror("%s:6522VIA chip %d: Port A is being written to but has no handler - %02X\n", cpuexec_describe_context(machine), which, write_data);
|
||||
}
|
||||
|
||||
CLR_PA_INT(v, which);
|
||||
@ -625,7 +625,7 @@ void via_write(running_machine *machine, int which, int offset, int data)
|
||||
v->intf->out_ca2_func(space, 0, 1);
|
||||
}
|
||||
else
|
||||
logerror("6522VIA chip %d: Port CA2 is being pulsed but has no handler. PC: %08X\n", which, safe_cpu_get_pc(machine->activecpu));
|
||||
logerror("%s:6522VIA chip %d: Port CA2 is being pulsed but has no handler\n", cpuexec_describe_context(machine), which);
|
||||
|
||||
/* set CA2 (shouldn't be needed) */
|
||||
v->out_ca2 = 1;
|
||||
@ -641,7 +641,7 @@ void via_write(running_machine *machine, int which, int offset, int data)
|
||||
if (v->intf->out_ca2_func)
|
||||
v->intf->out_ca2_func(space, 0, 0);
|
||||
else
|
||||
logerror("6522VIA chip %d: Port CA2 is being written to but has no handler. PC: %08X - %02X\n", which, safe_cpu_get_pc(machine->activecpu), 0);
|
||||
logerror("%s:6522VIA chip %d: Port CA2 is being written to but has no handler - %02X\n", cpuexec_describe_context(machine), which, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@ -657,7 +657,7 @@ void via_write(running_machine *machine, int which, int offset, int data)
|
||||
if (v->intf->out_a_func)
|
||||
v->intf->out_a_func(space, 0, write_data);
|
||||
else
|
||||
logerror("6522VIA chip %d: Port A is being written to but has no handler. PC: %08X - %02X\n", which, safe_cpu_get_pc(machine->activecpu), write_data);
|
||||
logerror("%s:6522VIA chip %d: Port A is being written to but has no handler - %02X\n", cpuexec_describe_context(machine), which, write_data);
|
||||
}
|
||||
|
||||
break;
|
||||
@ -675,7 +675,7 @@ void via_write(running_machine *machine, int which, int offset, int data)
|
||||
if (v->intf->out_b_func)
|
||||
v->intf->out_b_func(space, 0, write_data);
|
||||
else
|
||||
logerror("6522VIA chip %d: Port B is being written to but has no handler. PC: %08X - %02X\n", which, safe_cpu_get_pc(machine->activecpu), write_data);
|
||||
logerror("%s:6522VIA chip %d: Port B is being written to but has no handler - %02X\n", cpuexec_describe_context(machine), which, write_data);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -693,7 +693,7 @@ void via_write(running_machine *machine, int which, int offset, int data)
|
||||
if (v->intf->out_a_func)
|
||||
v->intf->out_a_func(space, 0, write_data);
|
||||
else
|
||||
logerror("6522VIA chip %d: Port A is being written to but has no handler. PC: %08X - %02X\n", which, safe_cpu_get_pc(machine->activecpu), write_data);
|
||||
logerror("%s:6522VIA chip %d: Port A is being written to but has no handler - %02X\n", cpuexec_describe_context(machine), which, write_data);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -725,7 +725,7 @@ void via_write(running_machine *machine, int which, int offset, int data)
|
||||
if (v->intf->out_b_func)
|
||||
v->intf->out_b_func(space, 0, write_data);
|
||||
else
|
||||
logerror("6522VIA chip %d: Port B is being written to but has no handler. PC: %08X - %02X\n", which, safe_cpu_get_pc(machine->activecpu), write_data);
|
||||
logerror("%s:6522VIA chip %d: Port B is being written to but has no handler - %02X\n", cpuexec_describe_context(machine), which, write_data);
|
||||
}
|
||||
}
|
||||
timer_adjust_oneshot(v->t1, v_cycles_to_time(v, TIMER1_VALUE(v) + IFR_DELAY), which);
|
||||
@ -766,7 +766,7 @@ void via_write(running_machine *machine, int which, int offset, int data)
|
||||
case VIA_PCR:
|
||||
v->pcr = data;
|
||||
#ifdef TRACE_VIA
|
||||
logerror("6522VIA chip %d: PCR = %02X. PC: %08X\n", which, data, safe_cpu_get_pc(machine->activecpu));
|
||||
logerror("%s:6522VIA chip %d: PCR = %02X\n", cpuexec_describe_context(machine), which, data);
|
||||
#endif
|
||||
|
||||
if (CA2_FIX_OUTPUT(data) && CA2_OUTPUT_LEVEL(data) ^ v->out_ca2)
|
||||
@ -775,7 +775,7 @@ logerror("6522VIA chip %d: PCR = %02X. PC: %08X\n", which, data, safe_cpu_get_p
|
||||
if (v->intf->out_ca2_func)
|
||||
v->intf->out_ca2_func(space, 0, v->out_ca2);
|
||||
else
|
||||
logerror("6522VIA chip %d: Port CA2 is being written to but has no handler. PC: %08X - %02X\n", which, safe_cpu_get_pc(machine->activecpu), v->out_ca2);
|
||||
logerror("%s:6522VIA chip %d: Port CA2 is being written to but has no handler - %02X\n", cpuexec_describe_context(machine), which, v->out_ca2);
|
||||
}
|
||||
|
||||
if (CB2_FIX_OUTPUT(data) && CB2_OUTPUT_LEVEL(data) ^ v->out_cb2)
|
||||
@ -784,7 +784,7 @@ logerror("6522VIA chip %d: PCR = %02X. PC: %08X\n", which, data, safe_cpu_get_p
|
||||
if (v->intf->out_cb2_func)
|
||||
v->intf->out_cb2_func(space, 0, v->out_cb2);
|
||||
else
|
||||
logerror("6522VIA chip %d: Port CB2 is being written to but has no handler. PC: %08X - %02X\n", which, safe_cpu_get_pc(machine->activecpu), v->out_cb2);
|
||||
logerror("%s:6522VIA chip %d: Port CB2 is being written to but has no handler - %02X\n", cpuexec_describe_context(machine), which, v->out_cb2);
|
||||
}
|
||||
break;
|
||||
|
||||
@ -806,7 +806,7 @@ logerror("6522VIA chip %d: PCR = %02X. PC: %08X\n", which, data, safe_cpu_get_p
|
||||
if (v->intf->out_b_func)
|
||||
v->intf->out_b_func(space, 0, write_data);
|
||||
else
|
||||
logerror("6522VIA chip %d: Port B is being written to but has no handler. PC: %08X - %02X\n", which, safe_cpu_get_pc(machine->activecpu), write_data);
|
||||
logerror("%s:6522VIA chip %d: Port B is being written to but has no handler - %02X\n", cpuexec_describe_context(machine), which, write_data);
|
||||
}
|
||||
}
|
||||
if (T1_CONTINUOUS(data))
|
||||
@ -831,7 +831,7 @@ logerror("6522VIA chip %d: PCR = %02X. PC: %08X\n", which, data, safe_cpu_get_p
|
||||
if (v->intf->irq_func)
|
||||
(*v->intf->irq_func)(machine, CLEAR_LINE);
|
||||
// else
|
||||
// logerror("6522VIA chip %d: Interrupt is cleared but there is no callback function. PC: %08X\n", which, safe_cpu_get_pc(machine->activecpu));
|
||||
// logerror("%s:6522VIA chip %d: Interrupt is cleared but there is no callback function\n", cpuexec_describe_context(machine), which);
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -842,7 +842,7 @@ logerror("6522VIA chip %d: PCR = %02X. PC: %08X\n", which, data, safe_cpu_get_p
|
||||
if (v->intf->irq_func)
|
||||
(*v->intf->irq_func)(machine, ASSERT_LINE);
|
||||
else
|
||||
logerror("6522VIA chip %d: Interrupt is asserted but there is no callback function. PC: %08X\n", which, safe_cpu_get_pc(machine->activecpu));
|
||||
logerror("%s:6522VIA chip %d: Interrupt is asserted but there is no callback function\n", cpuexec_describe_context(machine), which);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -880,7 +880,7 @@ void via_set_input_ca1(running_machine *machine, int which, int data)
|
||||
if (data != v->in_ca1)
|
||||
{
|
||||
#ifdef TRACE_VIA
|
||||
logerror("6522VIA chip %d: CA1 = %02X. PC: %08X\n", which, data, safe_cpu_get_pc(machine->activecpu));
|
||||
logerror("%s:6522VIA chip %d: CA1 = %02X\n", cpuexec_describe_context(machine), which, data);
|
||||
#endif
|
||||
if ((CA1_LOW_TO_HIGH(v->pcr) && data) || (CA1_HIGH_TO_LOW(v->pcr) && !data))
|
||||
{
|
||||
@ -889,7 +889,7 @@ logerror("6522VIA chip %d: CA1 = %02X. PC: %08X\n", which, data, safe_cpu_get_p
|
||||
if (v->intf->in_a_func)
|
||||
v->in_a = v->intf->in_a_func(space, 0);
|
||||
else
|
||||
logerror("6522VIA chip %d: Port A is being read but has no handler. PC: %08X\n", which, safe_cpu_get_pc(machine->activecpu));
|
||||
logerror("%s:6522VIA chip %d: Port A is being read but has no handler\n", cpuexec_describe_context(machine), which);
|
||||
}
|
||||
|
||||
via_set_int (machine, which, INT_CA1);
|
||||
@ -907,7 +907,7 @@ logerror("6522VIA chip %d: CA1 = %02X. PC: %08X\n", which, data, safe_cpu_get_p
|
||||
if (v->intf->out_ca2_func)
|
||||
v->intf->out_ca2_func(space, 0, 1);
|
||||
else
|
||||
logerror("6522VIA chip %d: Port CA2 is being written to but has no handler. PC: %08X - %02X\n", which, safe_cpu_get_pc(machine->activecpu), 1);
|
||||
logerror("%s:6522VIA chip %d: Port CA2 is being written to but has no handler - %02X\n", cpuexec_describe_context(machine), which, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -978,7 +978,7 @@ void via_set_input_cb1(running_machine *machine, int which, int data)
|
||||
if (v->intf->in_b_func)
|
||||
v->in_b = v->intf->in_b_func(space, 0);
|
||||
else
|
||||
logerror("6522VIA chip %d: Port B is being read but has no handler. PC: %08X\n", which, safe_cpu_get_pc(machine->activecpu));
|
||||
logerror("%s:6522VIA chip %d: Port B is being read but has no handler\n", cpuexec_describe_context(machine), which);
|
||||
}
|
||||
if (SO_EXT_CONTROL(v->acr) || SI_EXT_CONTROL(v->acr))
|
||||
via_shift (machine, which);
|
||||
@ -998,7 +998,7 @@ void via_set_input_cb1(running_machine *machine, int which, int data)
|
||||
if (v->intf->out_cb2_func)
|
||||
v->intf->out_cb2_func(space, 0, 1);
|
||||
else
|
||||
logerror("6522VIA chip %d: Port CB2 is being written to but has no handler. PC: %08X - %02X\n", which, safe_cpu_get_pc(machine->activecpu), 1);
|
||||
logerror("%s:6522VIA chip %d: Port CB2 is being written to but has no handler - %02X\n", cpuexec_describe_context(machine), which, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -100,7 +100,7 @@ INLINE void update_irqstate(const device_config *device)
|
||||
if (riot->intf->irq_func != NULL)
|
||||
(*riot->intf->irq_func)(device, (state != 0) ? ASSERT_LINE : CLEAR_LINE);
|
||||
else
|
||||
logerror("6532RIOT chip #%d: no irq callback function. PC: %08X\n", riot->index, safe_cpu_get_pc(device->machine->activecpu));
|
||||
logerror("%s:6532RIOT chip #%d: no irq callback function\n", cpuexec_describe_context(device->machine), riot->index);
|
||||
}
|
||||
|
||||
|
||||
@ -263,7 +263,7 @@ WRITE8_DEVICE_HANDLER( riot6532_w )
|
||||
if (port->out_func != NULL)
|
||||
(*port->out_func)(device, data, olddata);
|
||||
else
|
||||
logerror("6532RIOT chip %s: Port %c is being written to but has no handler. PC: %08X - %02X\n", device->tag, 'A' + (offset & 1), safe_cpu_get_pc(device->machine->activecpu), data);
|
||||
logerror("%s:6532RIOT chip %s: Port %c is being written to but has no handler. %02X\n", cpuexec_describe_context(device->machine), device->tag, 'A' + (offset & 1), data);
|
||||
}
|
||||
|
||||
/* writes to port A need to update the PA7 state */
|
||||
@ -332,7 +332,7 @@ READ8_DEVICE_HANDLER( riot6532_r )
|
||||
update_pa7_state(device);
|
||||
}
|
||||
else
|
||||
logerror("6532RIOT chip %s: Port %c is being read but has no handler. PC: %08X\n", device->tag, 'A' + (offset & 1), safe_cpu_get_pc(device->machine->activecpu));
|
||||
logerror("%s:6532RIOT chip %s: Port %c is being read but has no handler\n", cpuexec_describe_context(device->machine), device->tag, 'A' + (offset & 1));
|
||||
|
||||
/* apply the DDR to the result */
|
||||
val = apply_ddr(port);
|
||||
|
@ -473,7 +473,7 @@ int ptm6840_read(running_machine *machine, int which, int offset)
|
||||
|
||||
case PTM_6840_STATUS:
|
||||
{
|
||||
PLOG(("%06X: MC6840 #%d: Status read = %04X\n", cpu_get_previouspc(machine->activecpu), which, currptr->status_reg));
|
||||
PLOG(("%s: MC6840 #%d: Status read = %04X\n", cpuexec_describe_context(machine), which, currptr->status_reg));
|
||||
currptr->status_read_since_int |= currptr->status_reg & 0x07;
|
||||
val = currptr->status_reg;
|
||||
break;
|
||||
@ -495,7 +495,7 @@ int ptm6840_read(running_machine *machine, int which, int offset)
|
||||
|
||||
currptr->lsb_buffer = result & 0xff;
|
||||
|
||||
PLOG(("%06X: MC6840 #%d: Counter %d read = %04X\n", cpu_get_previouspc(machine->activecpu), which, idx, result >> 8));
|
||||
PLOG(("%s: MC6840 #%d: Counter %d read = %04X\n", cpuexec_describe_context(machine), which, idx, result >> 8));
|
||||
val = result >> 8;
|
||||
break;
|
||||
}
|
||||
@ -613,7 +613,7 @@ void ptm6840_write (running_machine *machine, int which, int offset, int data)
|
||||
if (!(currptr->control_reg[idx] & 0x10))
|
||||
reload_count(machine, which,idx);
|
||||
|
||||
PLOG(("%06X:MC6840 #%d: Counter %d latch = %04X\n", cpu_get_previouspc(machine->activecpu), which, idx, currptr->latch[idx]));
|
||||
PLOG(("%s:MC6840 #%d: Counter %d latch = %04X\n", cpuexec_describe_context(machine), which, idx, currptr->latch[idx]));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -422,7 +422,7 @@ WRITE8_DEVICE_HANDLER( acia6850_data_w )
|
||||
}
|
||||
else
|
||||
{
|
||||
logerror("ACIA %p: Data write while in reset! (%x)\n", device, cpu_get_previouspc(device->machine->activecpu));
|
||||
logerror("%s:ACIA %p: Data write while in reset!\n", cpuexec_describe_context(device->machine), device);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -21,14 +21,7 @@ INLINE void ATTR_PRINTF(2,3) verboselog( int n_level, const char *s_fmt, ... )
|
||||
va_start( v, s_fmt );
|
||||
vsprintf( buf, s_fmt, v );
|
||||
va_end( v );
|
||||
if( Machine->activecpu != NULL )
|
||||
{
|
||||
logerror( "%08x: %s", cpu_get_pc(Machine->activecpu), buf );
|
||||
}
|
||||
else
|
||||
{
|
||||
logerror( "(timer) : %s", buf );
|
||||
}
|
||||
logerror( "%s: %s", cpuexec_describe_context(Machine), buf );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -50,11 +50,11 @@ WRITE8_DEVICE_HANDLER( at28c16_w )
|
||||
|
||||
if( c->last_write >= 0 )
|
||||
{
|
||||
// logerror( "%08x: at28c16_write( %d, %04x, %02x ) busy\n", cpu_get_pc(machine->activecpu), chip, offset, data );
|
||||
// logerror( "%s: at28c16_write( %d, %04x, %02x ) busy\n", cpuexec_describe_context(machine), chip, offset, data );
|
||||
}
|
||||
else if( c->oe_12v )
|
||||
{
|
||||
// logerror( "%08x: at28c16_write( %d, %04x, %02x ) erase\n", cpu_get_pc(machine->activecpu), chip, offset, data );
|
||||
// logerror( "%s: at28c16_write( %d, %04x, %02x ) erase\n", cpuexec_describe_context(machine), chip, offset, data );
|
||||
memset( c->data, 0xff, SIZE_DATA );
|
||||
memset( c->id, 0xff, SIZE_ID );
|
||||
c->last_write = 0xff;
|
||||
@ -62,14 +62,14 @@ WRITE8_DEVICE_HANDLER( at28c16_w )
|
||||
}
|
||||
else if( offset >= OFFSET_ID && c->a9_12v )
|
||||
{
|
||||
// logerror( "%08x: at28c16_write( %d, %04x, %02x ) id\n", cpu_get_pc(machine->activecpu), chip, offset, data );
|
||||
// logerror( "%s: at28c16_write( %d, %04x, %02x ) id\n", cpuexec_describe_context(machine), chip, offset, data );
|
||||
c->id[ offset - OFFSET_ID ] = data;
|
||||
c->last_write = data;
|
||||
timer_adjust_oneshot( c->write_timer, ATTOTIME_IN_USEC( 200 ), 0 );
|
||||
}
|
||||
else
|
||||
{
|
||||
// logerror( "%08x: at28c16_write( %d, %04x, %02x ) data\n", cpu_get_pc(machine->activecpu), chip, offset, data );
|
||||
// logerror( "%s: at28c16_write( %d, %04x, %02x ) data\n", cpuexec_describe_context(machine), chip, offset, data );
|
||||
c->data[ offset ] = data;
|
||||
c->last_write = data;
|
||||
timer_adjust_oneshot( c->write_timer, ATTOTIME_IN_USEC( 200 ), 0 );
|
||||
@ -93,7 +93,7 @@ READ8_DEVICE_HANDLER( at28c16_r )
|
||||
}
|
||||
else
|
||||
{
|
||||
// logerror( "%08x: at28c16_read( %d, %04x ) %02x data\n", cpu_get_pc(machine->activecpu), chip, offset, c->data[ offset ] );
|
||||
// logerror( "%s: at28c16_read( %d, %04x ) %02x data\n", cpuexec_describe_context(machine), chip, offset, c->data[ offset ] );
|
||||
return c->data[ offset ];
|
||||
}
|
||||
}
|
||||
|
@ -23,14 +23,7 @@ INLINE void ATTR_PRINTF(2,3) verboselog( int n_level, const char *s_fmt, ... )
|
||||
va_start( v, s_fmt );
|
||||
vsprintf( buf, s_fmt, v );
|
||||
va_end( v );
|
||||
if( Machine->activecpu != NULL )
|
||||
{
|
||||
logerror( "%08x: %s", cpu_get_pc(Machine->activecpu), buf );
|
||||
}
|
||||
else
|
||||
{
|
||||
logerror( "(timer) : %s", buf );
|
||||
}
|
||||
logerror( "%s: %s", cpuexec_describe_context(Machine), buf );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -35,14 +35,7 @@ INLINE void ATTR_PRINTF(2,3) verboselog( int n_level, const char *s_fmt, ... )
|
||||
va_start( v, s_fmt );
|
||||
vsprintf( buf, s_fmt, v );
|
||||
va_end( v );
|
||||
if( Machine->activecpu != NULL )
|
||||
{
|
||||
logerror( "%08x: %s", cpu_get_pc(Machine->activecpu), buf );
|
||||
}
|
||||
else
|
||||
{
|
||||
logerror( "(timer) : %s", buf );
|
||||
}
|
||||
logerror( "%s: %s", cpuexec_describe_context(Machine), buf );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1182,7 +1182,7 @@ static UINT32 ide_controller_read(const device_config *device, offs_t offset, in
|
||||
|
||||
/* logit */
|
||||
// if (offset != IDE_ADDR_DATA && offset != IDE_ADDR_STATUS_COMMAND && offset != IDE_ADDR_STATUS_CONTROL)
|
||||
LOG(("%08X:IDE read at %03X, size=%d\n", cpu_get_previouspc(device->machine->activecpu), offset, size));
|
||||
LOG(("%s:IDE read at %03X, size=%d\n", cpuexec_describe_context(device->machine), offset, size));
|
||||
|
||||
switch (offset)
|
||||
{
|
||||
@ -1217,7 +1217,7 @@ static UINT32 ide_controller_read(const device_config *device, offs_t offset, in
|
||||
/* if we're at the end of the buffer, handle it */
|
||||
if (ide->buffer_offset >= IDE_DISK_SECTOR_SIZE)
|
||||
{
|
||||
LOG(("%08X:IDE completed PIO read\n", cpu_get_previouspc(device->machine->activecpu)));
|
||||
LOG(("%s:IDE completed PIO read\n", cpuexec_describe_context(device->machine)));
|
||||
continue_read(ide);
|
||||
}
|
||||
}
|
||||
@ -1264,14 +1264,11 @@ static UINT32 ide_controller_read(const device_config *device, offs_t offset, in
|
||||
if (ide->interrupt_pending)
|
||||
clear_interrupt(ide);
|
||||
}
|
||||
|
||||
/* take a bit of time to speed up people who poll hard */
|
||||
cpu_adjust_icount(device->machine->activecpu, -100);
|
||||
break;
|
||||
|
||||
/* log anything else */
|
||||
default:
|
||||
logerror("%08X:unknown IDE read at %03X, size=%d\n", cpu_get_previouspc(device->machine->activecpu), offset, size);
|
||||
logerror("%s:unknown IDE read at %03X, size=%d\n", cpuexec_describe_context(device->machine), offset, size);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -1293,7 +1290,7 @@ static void ide_controller_write(const device_config *device, offs_t offset, int
|
||||
|
||||
/* logit */
|
||||
if (offset != IDE_ADDR_DATA)
|
||||
LOG(("%08X:IDE write to %03X = %08X, size=%d\n", cpu_get_previouspc(device->machine->activecpu), offset, data, size));
|
||||
LOG(("%s:IDE write to %03X = %08X, size=%d\n", cpuexec_describe_context(device->machine), offset, data, size));
|
||||
|
||||
switch (offset)
|
||||
{
|
||||
@ -1330,7 +1327,7 @@ static void ide_controller_write(const device_config *device, offs_t offset, int
|
||||
/* if we're at the end of the buffer, handle it */
|
||||
if (ide->buffer_offset >= IDE_DISK_SECTOR_SIZE)
|
||||
{
|
||||
LOG(("%08X:IDE completed PIO write\n", cpu_get_previouspc(device->machine->activecpu)));
|
||||
LOG(("%s:IDE completed PIO write\n", cpuexec_describe_context(device->machine)));
|
||||
if (ide->command != IDE_COMMAND_SECURITY_UNLOCK)
|
||||
continue_write(ide);
|
||||
else
|
||||
@ -1440,7 +1437,7 @@ static UINT32 ide_bus_master_read(const device_config *device, offs_t offset, in
|
||||
{
|
||||
ide_state *ide = get_safe_token(device);
|
||||
|
||||
LOG(("%08X:ide_bus_master_read(%d, %d)\n", cpu_get_previouspc(device->machine->activecpu), offset, size));
|
||||
LOG(("%s:ide_bus_master_read(%d, %d)\n", cpuexec_describe_context(device->machine), offset, size));
|
||||
|
||||
/* command register */
|
||||
if (offset == 0)
|
||||
@ -1469,7 +1466,7 @@ static void ide_bus_master_write(const device_config *device, offs_t offset, int
|
||||
{
|
||||
ide_state *ide = get_safe_token(device);
|
||||
|
||||
LOG(("%08X:ide_bus_master_write(%d, %d, %08X)\n", cpu_get_previouspc(device->machine->activecpu), offset, size, data));
|
||||
LOG(("%s:ide_bus_master_write(%d, %d, %08X)\n", cpuexec_describe_context(device->machine), offset, size, data));
|
||||
|
||||
/* command register */
|
||||
if (offset == 0)
|
||||
|
@ -212,7 +212,7 @@ UINT32 intelflash_read(int chip, UINT32 address)
|
||||
break;
|
||||
}
|
||||
|
||||
// logerror( "%08x: intelflash_read( %d, %08x ) %08x\n", cpu_get_pc(machine->activecpu), chip, address, data );
|
||||
// logerror( "%s: intelflash_read( %d, %08x ) %08x\n", cpuexec_describe_context(machine), chip, address, data );
|
||||
|
||||
return data;
|
||||
}
|
||||
@ -227,7 +227,7 @@ void intelflash_write(int chip, UINT32 address, UINT32 data)
|
||||
}
|
||||
c = &chips[ chip ];
|
||||
|
||||
// logerror( "%08x: intelflash_write( %d, %08x, %08x )\n", cpu_get_pc(machine->activecpu), chip, address, data );
|
||||
// logerror( "%s: intelflash_write( %d, %08x, %08x )\n", cpuexec_describe_context(machine), chip, address, data );
|
||||
|
||||
switch( c->flash_mode )
|
||||
{
|
||||
|
@ -538,7 +538,7 @@ static WRITE8_DEVICE_HANDLER( ppi0_porta_w )
|
||||
laserdisc_state *ld = find_ldv1000(device->machine);
|
||||
ld->player->counter_start = data;
|
||||
if (LOG_PORT_IO)
|
||||
printf("%04X:PORTA.0=%02X\n", cpu_get_pc(device->machine->activecpu), data);
|
||||
printf("%s:PORTA.0=%02X\n", cpuexec_describe_context(device->machine), data);
|
||||
}
|
||||
|
||||
|
||||
@ -601,7 +601,7 @@ static WRITE8_DEVICE_HANDLER( ppi0_portc_w )
|
||||
player->portc0 = data;
|
||||
if (LOG_PORT_IO && ((data ^ prev) & 0x0f) != 0)
|
||||
{
|
||||
printf("%04X:PORTC.0=%02X", cpu_get_pc(device->machine->activecpu), data);
|
||||
printf("%s:PORTC.0=%02X", cpuexec_describe_context(device->machine), data);
|
||||
if (data & 0x01) printf(" PRELOAD");
|
||||
if (!(data & 0x02)) printf(" /MULTIJUMP");
|
||||
if (data & 0x04) printf(" SCANMODE");
|
||||
@ -697,7 +697,7 @@ static WRITE8_DEVICE_HANDLER( ppi1_portb_w )
|
||||
player->portb1 = data;
|
||||
if (LOG_PORT_IO && ((data ^ prev) & 0xff) != 0)
|
||||
{
|
||||
printf("%04X:PORTB.1=%02X:", cpu_get_pc(device->machine->activecpu), data);
|
||||
printf("%s:PORTB.1=%02X:", cpuexec_describe_context(device->machine), data);
|
||||
if (!(data & 0x01)) printf(" FOCSON");
|
||||
if (!(data & 0x02)) printf(" SPDLRUN");
|
||||
if (!(data & 0x04)) printf(" JUMPTRIG");
|
||||
@ -753,7 +753,7 @@ static WRITE8_DEVICE_HANDLER( ppi1_portc_w )
|
||||
player->portc1 = data;
|
||||
if (LOG_PORT_IO && ((data ^ prev) & 0xcf) != 0)
|
||||
{
|
||||
printf("%04X:PORTC.1=%02X", cpu_get_pc(device->machine->activecpu), data);
|
||||
printf("%s:PORTC.1=%02X", cpuexec_describe_context(device->machine), data);
|
||||
if (data & 0x01) printf(" AUD1");
|
||||
if (data & 0x02) printf(" AUD2");
|
||||
if (data & 0x04) printf(" AUDEN");
|
||||
|
@ -100,7 +100,7 @@ READ8_DEVICE_HANDLER( msm6242_r )
|
||||
case MSM6242_REG_CF: return msm6242->reg[2];
|
||||
}
|
||||
|
||||
logerror("%04x: MSM6242 unmapped offset %02x read\n", cpu_get_pc(device->machine->activecpu), offset);
|
||||
logerror("%s: MSM6242 unmapped offset %02x read\n", cpuexec_describe_context(device->machine), offset);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -141,7 +141,7 @@ WRITE8_DEVICE_HANDLER( msm6242_w )
|
||||
}
|
||||
}
|
||||
|
||||
logerror("%04x: MSM6242 unmapped offset %02x written with %02x\n", cpu_get_pc(device->machine->activecpu), offset, data);
|
||||
logerror("%s: MSM6242 unmapped offset %02x written with %02x\n", cpuexec_describe_context(device->machine), offset, data);
|
||||
}
|
||||
|
||||
|
||||
|
@ -28,7 +28,7 @@ static int scsidev_exec_command( SCSIInstance *scsiInstance, UINT8 *statusCode )
|
||||
return 0;
|
||||
|
||||
default:
|
||||
logerror( "%08x: SCSIDEV unknown command %02x\n", cpu_get_pc(Machine->activecpu), command[ 0 ] );
|
||||
logerror( "%s: SCSIDEV unknown command %02x\n", cpuexec_describe_context(Machine), command[ 0 ] );
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@ -43,7 +43,7 @@ static void scsidev_read_data( SCSIInstance *scsiInstance, UINT8 *data, int data
|
||||
switch( command[ 0 ] )
|
||||
{
|
||||
default:
|
||||
logerror( "%08x: SCSIDEV unknown read %02x\n", cpu_get_pc(Machine->activecpu), command[ 0 ] );
|
||||
logerror( "%s: SCSIDEV unknown read %02x\n", cpuexec_describe_context(Machine), command[ 0 ] );
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -58,7 +58,7 @@ static void scsidev_write_data( SCSIInstance *scsiInstance, UINT8 *data, int dat
|
||||
switch( command[ 0 ] )
|
||||
{
|
||||
default:
|
||||
logerror( "%08x: SCSIDEV unknown write %02x\n", cpu_get_pc(Machine->activecpu), command[ 0 ] );
|
||||
logerror( "%s: SCSIDEV unknown write %02x\n", cpuexec_describe_context(Machine), command[ 0 ] );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -377,7 +377,7 @@ READ16_DEVICE_HANDLER( smc91c9x_r )
|
||||
}
|
||||
|
||||
if (LOG_ETHERNET && offset != EREG_BANK)
|
||||
logerror("%08X:smc91c9x_r(%s) = %04X & %04X\n", cpu_get_pc(device->machine->activecpu), ethernet_regname[offset], result, mem_mask);
|
||||
logerror("%s:smc91c9x_r(%s) = %04X & %04X\n", cpuexec_describe_context(device->machine), ethernet_regname[offset], result, mem_mask);
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -402,7 +402,7 @@ WRITE16_DEVICE_HANDLER( smc91c9x_w )
|
||||
COMBINE_DATA(&smc->reg[offset]);
|
||||
|
||||
if (LOG_ETHERNET && offset != 7)
|
||||
logerror("%08X:smc91c9x_w(%s) = %04X & %04X\n", cpu_get_pc(device->machine->activecpu), ethernet_regname[offset], data, mem_mask);
|
||||
logerror("%s:smc91c9x_w(%s) = %04X & %04X\n", cpuexec_describe_context(device->machine), ethernet_regname[offset], data, mem_mask);
|
||||
|
||||
/* handle it */
|
||||
switch (offset)
|
||||
|
@ -266,7 +266,7 @@ WRITE8_DEVICE_HANDLER( timekeeper_w )
|
||||
data &= ~FLAGS_BL;
|
||||
}
|
||||
|
||||
// logerror( "%08x: timekeeper_write( %s, %04x, %02x )\n", cpu_get_pc(machine->activecpu), c->device->tag, offset, data );
|
||||
// logerror( "%s: timekeeper_write( %s, %04x, %02x )\n", cpuexec_describe_context(machine), c->device->tag, offset, data );
|
||||
c->data[ offset ] = data;
|
||||
}
|
||||
|
||||
@ -274,7 +274,7 @@ READ8_DEVICE_HANDLER( timekeeper_r )
|
||||
{
|
||||
timekeeper_state *c = get_safe_token(device);
|
||||
UINT8 data = c->data[ offset ];
|
||||
// logerror( "%08x: timekeeper_read( %s, %04x ) %02x\n", cpu_get_pc(machine->activecpu), c->device->tag, offset, data );
|
||||
// logerror( "%s: timekeeper_read( %s, %04x ) %02x\n", cpuexec_describe_context(machine), c->device->tag, offset, data );
|
||||
return data;
|
||||
}
|
||||
|
||||
|
@ -23,7 +23,7 @@ static void tmp68301_update_timer( running_machine *machine, int i );
|
||||
static IRQ_CALLBACK(tmp68301_irq_callback)
|
||||
{
|
||||
int vector = tmp68301_irq_vector[irqline];
|
||||
// logerror("CPU #0 PC %06X: irq callback returns %04X for level %x\n",cpu_get_pc(machine->activecpu),vector,int_level);
|
||||
// logerror("%s: irq callback returns %04X for level %x\n",cpuexec_describe_context(machine),vector,int_level);
|
||||
return vector;
|
||||
}
|
||||
|
||||
@ -35,7 +35,7 @@ static TIMER_CALLBACK( tmp68301_timer_callback )
|
||||
UINT16 ICR = tmp68301_regs[0x8e/2+i]; // Interrupt Controller Register (ICR7..9)
|
||||
UINT16 IVNR = tmp68301_regs[0x9a/2]; // Interrupt Vector Number Register (IVNR)
|
||||
|
||||
// logerror("CPU #0 PC %06X: callback timer %04X, j = %d\n",cpu_get_pc(machine->activecpu),i,tcount);
|
||||
// logerror("s: callback timer %04X, j = %d\n",cpuexec_describe_context(machine),i,tcount);
|
||||
|
||||
if ( (TCR & 0x0004) && // INT
|
||||
!(IMR & (0x100<<i))
|
||||
@ -95,14 +95,14 @@ static void tmp68301_update_timer( running_machine *machine, int i )
|
||||
break;
|
||||
}
|
||||
|
||||
// logerror("CPU #0 PC %06X: TMP68301 Timer %d, duration %lf, max %04X\n",cpu_get_pc(machine->activecpu),i,duration,max);
|
||||
// logerror("%s: TMP68301 Timer %d, duration %lf, max %04X\n",cpuexec_describe_context(machine),i,duration,max);
|
||||
|
||||
if (!(TCR & 0x0002)) // CS
|
||||
{
|
||||
if (attotime_compare(duration, attotime_zero))
|
||||
timer_adjust_oneshot(tmp68301_timer[i],duration,i);
|
||||
else
|
||||
logerror("CPU #0 PC %06X: TMP68301 error, timer %d duration is 0\n",cpu_get_pc(machine->activecpu),i);
|
||||
logerror("%s: TMP68301 error, timer %d duration is 0\n",cpuexec_describe_context(machine),i);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -294,7 +294,7 @@ static void wd33c93_complete_cmd( UINT8 status )
|
||||
/* command handlers */
|
||||
static void wd33c93_invalid_cmd( void )
|
||||
{
|
||||
logerror( "Unknown/Unimplemented SCSI controller command: %02x (PC=%x)\n", scsi_data.regs[WD_COMMAND], cpu_get_pc(Machine->activecpu) );
|
||||
logerror( "%s:Unknown/Unimplemented SCSI controller command: %02x\n", cpuexec_describe_context(Machine), scsi_data.regs[WD_COMMAND] );
|
||||
|
||||
/* complete the command */
|
||||
wd33c93_complete_cmd( CSR_INVALID );
|
||||
|
@ -26,14 +26,7 @@ INLINE void ATTR_PRINTF(2,3) verboselog( int n_level, const char *s_fmt, ... )
|
||||
va_start( v, s_fmt );
|
||||
vsprintf( buf, s_fmt, v );
|
||||
va_end( v );
|
||||
if( Machine->activecpu != NULL )
|
||||
{
|
||||
logerror( "%08x: %s", cpu_get_pc(Machine->activecpu), buf );
|
||||
}
|
||||
else
|
||||
{
|
||||
logerror( "(timer) : %s", buf );
|
||||
}
|
||||
logerror( "%s: %s", cpuexec_describe_context(Machine), buf );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -24,14 +24,7 @@ INLINE void ATTR_PRINTF(2,3) verboselog( int n_level, const char *s_fmt, ... )
|
||||
va_start( v, s_fmt );
|
||||
vsprintf( buf, s_fmt, v );
|
||||
va_end( v );
|
||||
if( Machine->activecpu != NULL )
|
||||
{
|
||||
logerror( "%08x: %s", cpu_get_pc(Machine->activecpu), buf );
|
||||
}
|
||||
else
|
||||
{
|
||||
logerror( "(timer) : %s", buf );
|
||||
}
|
||||
logerror( "%s: %s", cpuexec_describe_context(Machine), buf );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -340,7 +340,7 @@ WRITE8_DEVICE_HANDLER( z80sio_c_w )
|
||||
UINT8 old = chan->regs[reg];
|
||||
|
||||
if (reg != 0 || (reg & 0xf8))
|
||||
VPRINTF(("%04X:sio_reg_w(%c,%d) = %02X\n", cpu_get_pc(device->machine->activecpu), 'A' + ch, reg, data));
|
||||
VPRINTF(("%s:sio_reg_w(%c,%d) = %02X\n", cpuexec_describe_context(device->machine), 'A' + ch, reg, data));
|
||||
|
||||
/* write a new value to the selected register */
|
||||
chan->regs[reg] = data;
|
||||
@ -357,7 +357,7 @@ WRITE8_DEVICE_HANDLER( z80sio_c_w )
|
||||
switch (data & SIO_WR0_COMMAND_MASK)
|
||||
{
|
||||
case SIO_WR0_COMMAND_CH_RESET:
|
||||
VPRINTF(("%04X:SIO reset channel %c\n", cpu_get_pc(device->machine->activecpu), 'A' + ch));
|
||||
VPRINTF(("%s:SIO reset channel %c\n", cpuexec_describe_context(device->machine), 'A' + ch));
|
||||
reset_channel(device, ch);
|
||||
break;
|
||||
|
||||
@ -424,7 +424,7 @@ READ8_DEVICE_HANDLER( z80sio_c_r )
|
||||
break;
|
||||
}
|
||||
|
||||
VPRINTF(("%04X:sio_reg_r(%c,%d) = %02x\n", cpu_get_pc(device->machine->activecpu), 'A' + ch, reg, chan->status[reg]));
|
||||
VPRINTF(("%s:sio_reg_r(%c,%d) = %02x\n", cpuexec_describe_context(device->machine), 'A' + ch, reg, chan->status[reg]));
|
||||
|
||||
return chan->status[reg];
|
||||
}
|
||||
@ -446,7 +446,7 @@ WRITE8_DEVICE_HANDLER( z80sio_d_w )
|
||||
int ch = offset & 1;
|
||||
sio_channel *chan = &sio->chan[ch];
|
||||
|
||||
VPRINTF(("%04X:sio_data_w(%c) = %02X\n", cpu_get_pc(device->machine->activecpu), 'A' + ch, data));
|
||||
VPRINTF(("%s:sio_data_w(%c) = %02X\n", cpuexec_describe_context(device->machine), 'A' + ch, data));
|
||||
|
||||
/* if tx not enabled, just ignore it */
|
||||
if (!(chan->regs[5] & SIO_WR5_TX_ENABLE))
|
||||
@ -481,7 +481,7 @@ READ8_DEVICE_HANDLER( z80sio_d_r )
|
||||
sio->int_state[INT_CHA_RECEIVE - 4*ch] &= ~Z80_DAISY_INT;
|
||||
interrupt_check(device);
|
||||
|
||||
VPRINTF(("%04X:sio_data_r(%c) = %02X\n", cpu_get_pc(device->machine->activecpu), 'A' + ch, chan->inbuf));
|
||||
VPRINTF(("%s:sio_data_r(%c) = %02X\n", cpuexec_describe_context(device->machine), 'A' + ch, chan->inbuf));
|
||||
|
||||
return chan->inbuf;
|
||||
}
|
||||
|
@ -230,6 +230,26 @@ static void logfile_callback(running_machine *machine, const char *buffer);
|
||||
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
CORE IMPLEMENTATION
|
||||
***************************************************************************/
|
||||
|
||||
/*-------------------------------------------------
|
||||
eat_all_cpu_cycles - eat a ton of cycles on
|
||||
all CPUs to force a quick exit
|
||||
-------------------------------------------------*/
|
||||
|
||||
INLINE void eat_all_cpu_cycles(running_machine *machine)
|
||||
{
|
||||
int cpunum;
|
||||
|
||||
for (cpunum = 0; cpunum < ARRAY_LENGTH(machine->cpu); cpunum++)
|
||||
if (machine->cpu[cpunum] != NULL)
|
||||
cpu_eat_cycles(machine->cpu[cpunum], 1000000000);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
CORE IMPLEMENTATION
|
||||
***************************************************************************/
|
||||
@ -559,8 +579,7 @@ void mame_schedule_exit(running_machine *machine)
|
||||
mame->exit_pending = TRUE;
|
||||
|
||||
/* if we're executing, abort out immediately */
|
||||
if (machine->activecpu != NULL)
|
||||
cpu_eat_cycles(machine->activecpu, 1000000000);
|
||||
eat_all_cpu_cycles(machine);
|
||||
|
||||
/* if we're autosaving on exit, schedule a save as well */
|
||||
if (options_get_bool(mame_options(), OPTION_AUTOSAVE) && (machine->gamedrv->flags & GAME_SUPPORTS_SAVE))
|
||||
@ -579,8 +598,7 @@ void mame_schedule_hard_reset(running_machine *machine)
|
||||
mame->hard_reset_pending = TRUE;
|
||||
|
||||
/* if we're executing, abort out immediately */
|
||||
if (machine->activecpu != NULL)
|
||||
cpu_eat_cycles(machine->activecpu, 1000000000);
|
||||
eat_all_cpu_cycles(machine);
|
||||
}
|
||||
|
||||
|
||||
@ -599,8 +617,7 @@ void mame_schedule_soft_reset(running_machine *machine)
|
||||
mame_pause(machine, FALSE);
|
||||
|
||||
/* if we're executing, abort out immediately */
|
||||
if (machine->activecpu != NULL)
|
||||
cpu_eat_cycles(machine->activecpu, 1000000000);
|
||||
eat_all_cpu_cycles(machine);
|
||||
}
|
||||
|
||||
|
||||
@ -616,8 +633,7 @@ void mame_schedule_new_driver(running_machine *machine, const game_driver *drive
|
||||
mame->new_driver_pending = driver;
|
||||
|
||||
/* if we're executing, abort out immediately */
|
||||
if (machine->activecpu != NULL)
|
||||
cpu_eat_cycles(machine->activecpu, 1000000000);
|
||||
eat_all_cpu_cycles(machine);
|
||||
}
|
||||
|
||||
|
||||
@ -1732,14 +1748,10 @@ static void handle_save(running_machine *machine)
|
||||
for (cpunum = 0; cpunum < ARRAY_LENGTH(machine->cpu); cpunum++)
|
||||
if (machine->cpu[cpunum] != NULL)
|
||||
{
|
||||
cpu_push_context(machine->cpu[cpunum]);
|
||||
|
||||
/* save the CPU data */
|
||||
state_save_push_tag(cpunum + 1);
|
||||
state_save_save_continue(machine);
|
||||
state_save_pop_tag();
|
||||
|
||||
cpu_pop_context();
|
||||
}
|
||||
|
||||
/* finish and close */
|
||||
@ -1812,14 +1824,10 @@ static void handle_load(running_machine *machine)
|
||||
for (cpunum = 0; cpunum < ARRAY_LENGTH(machine->cpu); cpunum++)
|
||||
if (machine->cpu[cpunum] != NULL)
|
||||
{
|
||||
cpu_push_context(machine->cpu[cpunum]);
|
||||
|
||||
/* load the CPU data */
|
||||
state_save_push_tag(cpunum + 1);
|
||||
state_save_load_continue(machine);
|
||||
state_save_pop_tag();
|
||||
|
||||
cpu_pop_context();
|
||||
}
|
||||
|
||||
/* finish and close */
|
||||
|
@ -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 _cpuexec_private cpuexec_private;
|
||||
typedef struct _timer_private timer_private;
|
||||
typedef struct _state_private state_private;
|
||||
typedef struct _memory_private memory_private;
|
||||
@ -148,7 +149,6 @@ struct _running_machine
|
||||
const input_port_config *portconfig; /* points to a list of input port configurations */
|
||||
|
||||
/* CPU information */
|
||||
const device_config * activecpu; /* active CPU (or NULL) -- deprecated soon */
|
||||
const device_config * cpu[MAX_CPU]; /* array of CPU devices */
|
||||
|
||||
/* game-related information */
|
||||
@ -173,6 +173,7 @@ struct _running_machine
|
||||
|
||||
/* internal core information */
|
||||
mame_private * mame_data; /* internal data from mame.c */
|
||||
cpuexec_private * cpuexec_data; /* internal data from cpuexec.c */
|
||||
timer_private * timer_data; /* internal data from timer.c */
|
||||
state_private * state_data; /* internal data from state.c */
|
||||
memory_private * memory_data; /* internal data from memory.c */
|
||||
|
@ -104,6 +104,7 @@ has twice the steps, happening twice as fast.
|
||||
#include "deprecat.h"
|
||||
#include "streams.h"
|
||||
#include "cpuintrf.h"
|
||||
#include "cpuexec.h"
|
||||
#include "ay8910.h"
|
||||
|
||||
/*************************************
|
||||
@ -800,7 +801,7 @@ int ay8910_read_ym(void *chip)
|
||||
if (psg->intf->portAread)
|
||||
psg->regs[AY_PORTA] = (*psg->intf->portAread)(space, 0);
|
||||
else
|
||||
logerror("PC %04x: warning - read 8910 '%s' Port A\n",cpu_get_pc(Machine->activecpu),psg->device->tag);
|
||||
logerror("%s: warning - read 8910 '%s' Port A\n",cpuexec_describe_context(Machine),psg->device->tag);
|
||||
break;
|
||||
case AY_PORTB:
|
||||
if ((psg->regs[AY_ENABLE] & 0x80) != 0)
|
||||
@ -808,7 +809,7 @@ int ay8910_read_ym(void *chip)
|
||||
if (psg->intf->portBread)
|
||||
psg->regs[AY_PORTB] = (*psg->intf->portBread)(space, 0);
|
||||
else
|
||||
logerror("PC %04x: warning - read 8910 '%s' Port B\n",cpu_get_pc(Machine->activecpu),psg->device->tag);
|
||||
logerror("%s: warning - read 8910 '%s' Port B\n",cpuexec_describe_context(Machine),psg->device->tag);
|
||||
break;
|
||||
}
|
||||
return psg->regs[r];
|
||||
|
@ -12,6 +12,7 @@
|
||||
#include "deprecat.h"
|
||||
#include "streams.h"
|
||||
#include "cpuintrf.h"
|
||||
#include "cpuexec.h"
|
||||
#include "es5506.h"
|
||||
|
||||
|
||||
@ -1564,7 +1565,7 @@ INLINE void es5505_reg_write_low(struct ES5506Chip *chip, struct ES5506Voice *vo
|
||||
}
|
||||
|
||||
if (LOG_COMMANDS && eslog)
|
||||
fprintf(eslog, "%06x:voice %d, control=%04x (raw=%04x & %04x)\n", cpu_get_previouspc(Machine->activecpu), chip->current_page & 0x1f, voice->control, data, mem_mask ^ 0xffff);
|
||||
fprintf(eslog, "%s:voice %d, control=%04x (raw=%04x & %04x)\n", cpuexec_describe_context(Machine), chip->current_page & 0x1f, voice->control, data, mem_mask ^ 0xffff);
|
||||
break;
|
||||
|
||||
case 0x01: /* FC */
|
||||
@ -1573,7 +1574,7 @@ INLINE void es5505_reg_write_low(struct ES5506Chip *chip, struct ES5506Voice *vo
|
||||
if (ACCESSING_BITS_8_15)
|
||||
voice->freqcount = (voice->freqcount & ~0x1fe00) | ((data & 0xff00) << 1);
|
||||
if (LOG_COMMANDS && eslog)
|
||||
fprintf(eslog, "%06x:voice %d, freq count=%08x\n", cpu_get_previouspc(Machine->activecpu), chip->current_page & 0x1f, voice->freqcount);
|
||||
fprintf(eslog, "%s:voice %d, freq count=%08x\n", cpuexec_describe_context(Machine), chip->current_page & 0x1f, voice->freqcount);
|
||||
break;
|
||||
|
||||
case 0x02: /* STRT (hi) */
|
||||
@ -1582,7 +1583,7 @@ INLINE void es5505_reg_write_low(struct ES5506Chip *chip, struct ES5506Voice *vo
|
||||
if (ACCESSING_BITS_8_15)
|
||||
voice->start = (voice->start & ~0x7c000000) | ((data & 0x1f00) << 18);
|
||||
if (LOG_COMMANDS && eslog)
|
||||
fprintf(eslog, "%06x:voice %d, loop start=%08x\n", cpu_get_previouspc(Machine->activecpu), chip->current_page & 0x1f, voice->start);
|
||||
fprintf(eslog, "%s:voice %d, loop start=%08x\n", cpuexec_describe_context(Machine), chip->current_page & 0x1f, voice->start);
|
||||
break;
|
||||
|
||||
case 0x03: /* STRT (lo) */
|
||||
@ -1591,7 +1592,7 @@ INLINE void es5505_reg_write_low(struct ES5506Chip *chip, struct ES5506Voice *vo
|
||||
if (ACCESSING_BITS_8_15)
|
||||
voice->start = (voice->start & ~0x0003fc00) | ((data & 0xff00) << 2);
|
||||
if (LOG_COMMANDS && eslog)
|
||||
fprintf(eslog, "%06x:voice %d, loop start=%08x\n", cpu_get_previouspc(Machine->activecpu), chip->current_page & 0x1f, voice->start);
|
||||
fprintf(eslog, "%s:voice %d, loop start=%08x\n", cpuexec_describe_context(Machine), chip->current_page & 0x1f, voice->start);
|
||||
break;
|
||||
|
||||
case 0x04: /* END (hi) */
|
||||
@ -1603,7 +1604,7 @@ INLINE void es5505_reg_write_low(struct ES5506Chip *chip, struct ES5506Voice *vo
|
||||
voice->control |= CONTROL_STOP0;
|
||||
#endif
|
||||
if (LOG_COMMANDS && eslog)
|
||||
fprintf(eslog, "%06x:voice %d, loop end=%08x\n", cpu_get_previouspc(Machine->activecpu), chip->current_page & 0x1f, voice->end);
|
||||
fprintf(eslog, "%s:voice %d, loop end=%08x\n", cpuexec_describe_context(Machine), chip->current_page & 0x1f, voice->end);
|
||||
break;
|
||||
|
||||
case 0x05: /* END (lo) */
|
||||
@ -1615,7 +1616,7 @@ INLINE void es5505_reg_write_low(struct ES5506Chip *chip, struct ES5506Voice *vo
|
||||
voice->control |= CONTROL_STOP0;
|
||||
#endif
|
||||
if (LOG_COMMANDS && eslog)
|
||||
fprintf(eslog, "%06x:voice %d, loop end=%08x\n", cpu_get_previouspc(Machine->activecpu), chip->current_page & 0x1f, voice->end);
|
||||
fprintf(eslog, "%s:voice %d, loop end=%08x\n", cpuexec_describe_context(Machine), chip->current_page & 0x1f, voice->end);
|
||||
break;
|
||||
|
||||
case 0x06: /* K2 */
|
||||
@ -1624,7 +1625,7 @@ INLINE void es5505_reg_write_low(struct ES5506Chip *chip, struct ES5506Voice *vo
|
||||
if (ACCESSING_BITS_8_15)
|
||||
voice->k2 = (voice->k2 & ~0xff00) | (data & 0xff00);
|
||||
if (LOG_COMMANDS && eslog)
|
||||
fprintf(eslog, "%06x:voice %d, K2=%04x\n", cpu_get_previouspc(Machine->activecpu), chip->current_page & 0x1f, voice->k2);
|
||||
fprintf(eslog, "%s:voice %d, K2=%04x\n", cpuexec_describe_context(Machine), chip->current_page & 0x1f, voice->k2);
|
||||
break;
|
||||
|
||||
case 0x07: /* K1 */
|
||||
@ -1633,21 +1634,21 @@ INLINE void es5505_reg_write_low(struct ES5506Chip *chip, struct ES5506Voice *vo
|
||||
if (ACCESSING_BITS_8_15)
|
||||
voice->k1 = (voice->k1 & ~0xff00) | (data & 0xff00);
|
||||
if (LOG_COMMANDS && eslog)
|
||||
fprintf(eslog, "%06x:voice %d, K1=%04x\n", cpu_get_previouspc(Machine->activecpu), chip->current_page & 0x1f, voice->k1);
|
||||
fprintf(eslog, "%s:voice %d, K1=%04x\n", cpuexec_describe_context(Machine), chip->current_page & 0x1f, voice->k1);
|
||||
break;
|
||||
|
||||
case 0x08: /* LVOL */
|
||||
if (ACCESSING_BITS_8_15)
|
||||
voice->lvol = (voice->lvol & ~0xff00) | (data & 0xff00);
|
||||
if (LOG_COMMANDS && eslog)
|
||||
fprintf(eslog, "%06x:voice %d, left vol=%04x\n", cpu_get_previouspc(Machine->activecpu), chip->current_page & 0x1f, voice->lvol);
|
||||
fprintf(eslog, "%s:voice %d, left vol=%04x\n", cpuexec_describe_context(Machine), chip->current_page & 0x1f, voice->lvol);
|
||||
break;
|
||||
|
||||
case 0x09: /* RVOL */
|
||||
if (ACCESSING_BITS_8_15)
|
||||
voice->rvol = (voice->rvol & ~0xff00) | (data & 0xff00);
|
||||
if (LOG_COMMANDS && eslog)
|
||||
fprintf(eslog, "%06x:voice %d, right vol=%04x\n", cpu_get_previouspc(Machine->activecpu), chip->current_page & 0x1f, voice->rvol);
|
||||
fprintf(eslog, "%s:voice %d, right vol=%04x\n", cpuexec_describe_context(Machine), chip->current_page & 0x1f, voice->rvol);
|
||||
break;
|
||||
|
||||
case 0x0a: /* ACC (hi) */
|
||||
@ -1656,7 +1657,7 @@ INLINE void es5505_reg_write_low(struct ES5506Chip *chip, struct ES5506Voice *vo
|
||||
if (ACCESSING_BITS_8_15)
|
||||
voice->accum = (voice->accum & ~0x7c000000) | ((data & 0x1f00) << 18);
|
||||
if (LOG_COMMANDS && eslog)
|
||||
fprintf(eslog, "%06x:voice %d, accum=%08x\n", cpu_get_previouspc(Machine->activecpu), chip->current_page & 0x1f, voice->accum);
|
||||
fprintf(eslog, "%s:voice %d, accum=%08x\n", cpuexec_describe_context(Machine), chip->current_page & 0x1f, voice->accum);
|
||||
break;
|
||||
|
||||
case 0x0b: /* ACC (lo) */
|
||||
@ -1665,7 +1666,7 @@ INLINE void es5505_reg_write_low(struct ES5506Chip *chip, struct ES5506Voice *vo
|
||||
if (ACCESSING_BITS_8_15)
|
||||
voice->accum = (voice->accum & ~0x0003fc00) | ((data & 0xff00) << 2);
|
||||
if (LOG_COMMANDS && eslog)
|
||||
fprintf(eslog, "%06x:voice %d, accum=%08x\n", cpu_get_previouspc(Machine->activecpu), chip->current_page & 0x1f, voice->accum);
|
||||
fprintf(eslog, "%s:voice %d, accum=%08x\n", cpuexec_describe_context(Machine), chip->current_page & 0x1f, voice->accum);
|
||||
break;
|
||||
|
||||
case 0x0c: /* unused */
|
||||
@ -1712,7 +1713,7 @@ INLINE void es5505_reg_write_high(struct ES5506Chip *chip, struct ES5506Voice *v
|
||||
((data << 2) & (CONTROL_CA0 | CONTROL_CA1));
|
||||
}
|
||||
if (LOG_COMMANDS && eslog)
|
||||
fprintf(eslog, "%06x:voice %d, control=%04x (raw=%04x & %04x)\n", cpu_get_previouspc(Machine->activecpu), chip->current_page & 0x1f, voice->control, data, mem_mask);
|
||||
fprintf(eslog, "%s:voice %d, control=%04x (raw=%04x & %04x)\n", cpuexec_describe_context(Machine), chip->current_page & 0x1f, voice->control, data, mem_mask);
|
||||
break;
|
||||
|
||||
case 0x01: /* O4(n-1) */
|
||||
@ -1721,7 +1722,7 @@ INLINE void es5505_reg_write_high(struct ES5506Chip *chip, struct ES5506Voice *v
|
||||
if (ACCESSING_BITS_8_15)
|
||||
voice->o4n1 = (INT16)((voice->o4n1 & ~0xff00) | (data & 0xff00));
|
||||
if (LOG_COMMANDS && eslog)
|
||||
fprintf(eslog, "%06x:voice %d, O4(n-1)=%05x\n", cpu_get_previouspc(Machine->activecpu), chip->current_page & 0x1f, voice->o4n1 & 0x3ffff);
|
||||
fprintf(eslog, "%s:voice %d, O4(n-1)=%05x\n", cpuexec_describe_context(Machine), chip->current_page & 0x1f, voice->o4n1 & 0x3ffff);
|
||||
break;
|
||||
|
||||
case 0x02: /* O3(n-1) */
|
||||
@ -1730,7 +1731,7 @@ INLINE void es5505_reg_write_high(struct ES5506Chip *chip, struct ES5506Voice *v
|
||||
if (ACCESSING_BITS_8_15)
|
||||
voice->o3n1 = (INT16)((voice->o3n1 & ~0xff00) | (data & 0xff00));
|
||||
if (LOG_COMMANDS && eslog)
|
||||
fprintf(eslog, "%06x:voice %d, O3(n-1)=%05x\n", cpu_get_previouspc(Machine->activecpu), chip->current_page & 0x1f, voice->o3n1 & 0x3ffff);
|
||||
fprintf(eslog, "%s:voice %d, O3(n-1)=%05x\n", cpuexec_describe_context(Machine), chip->current_page & 0x1f, voice->o3n1 & 0x3ffff);
|
||||
break;
|
||||
|
||||
case 0x03: /* O3(n-2) */
|
||||
@ -1739,7 +1740,7 @@ INLINE void es5505_reg_write_high(struct ES5506Chip *chip, struct ES5506Voice *v
|
||||
if (ACCESSING_BITS_8_15)
|
||||
voice->o3n2 = (INT16)((voice->o3n2 & ~0xff00) | (data & 0xff00));
|
||||
if (LOG_COMMANDS && eslog)
|
||||
fprintf(eslog, "%06x:voice %d, O3(n-2)=%05x\n", cpu_get_previouspc(Machine->activecpu), chip->current_page & 0x1f, voice->o3n2 & 0x3ffff);
|
||||
fprintf(eslog, "%s:voice %d, O3(n-2)=%05x\n", cpuexec_describe_context(Machine), chip->current_page & 0x1f, voice->o3n2 & 0x3ffff);
|
||||
break;
|
||||
|
||||
case 0x04: /* O2(n-1) */
|
||||
@ -1748,7 +1749,7 @@ INLINE void es5505_reg_write_high(struct ES5506Chip *chip, struct ES5506Voice *v
|
||||
if (ACCESSING_BITS_8_15)
|
||||
voice->o2n1 = (INT16)((voice->o2n1 & ~0xff00) | (data & 0xff00));
|
||||
if (LOG_COMMANDS && eslog)
|
||||
fprintf(eslog, "%06x:voice %d, O2(n-1)=%05x\n", cpu_get_previouspc(Machine->activecpu), chip->current_page & 0x1f, voice->o2n1 & 0x3ffff);
|
||||
fprintf(eslog, "%s:voice %d, O2(n-1)=%05x\n", cpuexec_describe_context(Machine), chip->current_page & 0x1f, voice->o2n1 & 0x3ffff);
|
||||
break;
|
||||
|
||||
case 0x05: /* O2(n-2) */
|
||||
@ -1757,7 +1758,7 @@ INLINE void es5505_reg_write_high(struct ES5506Chip *chip, struct ES5506Voice *v
|
||||
if (ACCESSING_BITS_8_15)
|
||||
voice->o2n2 = (INT16)((voice->o2n2 & ~0xff00) | (data & 0xff00));
|
||||
if (LOG_COMMANDS && eslog)
|
||||
fprintf(eslog, "%06x:voice %d, O2(n-2)=%05x\n", cpu_get_previouspc(Machine->activecpu), chip->current_page & 0x1f, voice->o2n2 & 0x3ffff);
|
||||
fprintf(eslog, "%s:voice %d, O2(n-2)=%05x\n", cpuexec_describe_context(Machine), chip->current_page & 0x1f, voice->o2n2 & 0x3ffff);
|
||||
break;
|
||||
|
||||
case 0x06: /* O1(n-1) */
|
||||
@ -1766,7 +1767,7 @@ INLINE void es5505_reg_write_high(struct ES5506Chip *chip, struct ES5506Voice *v
|
||||
if (ACCESSING_BITS_8_15)
|
||||
voice->o1n1 = (INT16)((voice->o1n1 & ~0xff00) | (data & 0xff00));
|
||||
if (LOG_COMMANDS && eslog)
|
||||
fprintf(eslog, "%06x:voice %d, O1(n-1)=%05x (accum=%08x)\n", cpu_get_previouspc(Machine->activecpu), chip->current_page & 0x1f, voice->o2n1 & 0x3ffff, voice->accum);
|
||||
fprintf(eslog, "%s:voice %d, O1(n-1)=%05x (accum=%08x)\n", cpuexec_describe_context(Machine), chip->current_page & 0x1f, voice->o2n1 & 0x3ffff, voice->accum);
|
||||
break;
|
||||
|
||||
case 0x07:
|
||||
@ -1848,7 +1849,7 @@ static void es5505_reg_write(struct ES5506Chip *chip, offs_t offset, UINT16 data
|
||||
{
|
||||
struct ES5506Voice *voice = &chip->voice[chip->current_page & 0x1f];
|
||||
|
||||
// logerror("%04x:ES5505 write %02x/%02x = %04x & %04x\n", cpu_get_previouspc(Machine->activecpu), chip->current_page, offset, data, mem_mask);
|
||||
// logerror("%s:ES5505 write %02x/%02x = %04x & %04x\n", cpuexec_describe_context(Machine), chip->current_page, offset, data, mem_mask);
|
||||
|
||||
/* force an update */
|
||||
stream_update(chip->stream);
|
||||
|
@ -10,6 +10,7 @@
|
||||
#include "deprecat.h"
|
||||
#include "streams.h"
|
||||
#include "cpuintrf.h"
|
||||
#include "cpuexec.h"
|
||||
#include "ics2115.h"
|
||||
|
||||
#define ICS2115LOGERROR 0
|
||||
@ -66,12 +67,6 @@ struct ics2115{
|
||||
sound_stream * stream;
|
||||
};
|
||||
|
||||
static int caller_get_pc(void)
|
||||
{
|
||||
int pc = cpu_get_pc(Machine->activecpu);
|
||||
return pc;
|
||||
}
|
||||
|
||||
static void recalc_irq(struct ics2115 *chip)
|
||||
{
|
||||
int i;
|
||||
@ -201,8 +196,8 @@ static void ics2115_reg_w(struct ics2115 *chip, UINT8 reg, UINT8 data, int msb)
|
||||
case 0x00: // [osc] Oscillator Configuration
|
||||
if(msb) {
|
||||
chip->voice[chip->osc].conf = data;
|
||||
if (ICS2115LOGERROR) logerror("ICS2115: %2d: conf = %02x (%04x)\n", chip->osc,
|
||||
chip->voice[chip->osc].conf, caller_get_pc());
|
||||
if (ICS2115LOGERROR) logerror("%s:ICS2115: %2d: conf = %02x\n", cpuexec_describe_context(Machine), chip->osc,
|
||||
chip->voice[chip->osc].conf);
|
||||
}
|
||||
break;
|
||||
|
||||
@ -212,8 +207,8 @@ static void ics2115_reg_w(struct ics2115 *chip, UINT8 reg, UINT8 data, int msb)
|
||||
chip->voice[chip->osc].fc = (chip->voice[chip->osc].fc & 0xff)|(data << 8);
|
||||
else
|
||||
chip->voice[chip->osc].fc = (chip->voice[chip->osc].fc & 0xff00)|data;
|
||||
if (ICS2115LOGERROR) logerror("ICS2115: %2d: fc = %04x (%dHz) (%04x)\n", chip->osc,
|
||||
chip->voice[chip->osc].fc, chip->voice[chip->osc].fc*33075/1024, caller_get_pc());
|
||||
if (ICS2115LOGERROR) logerror("%s:ICS2115: %2d: fc = %04x (%dHz)\n", cpuexec_describe_context(Machine), chip->osc,
|
||||
chip->voice[chip->osc].fc, chip->voice[chip->osc].fc*33075/1024);
|
||||
break;
|
||||
|
||||
case 0x02: // [osc] Wavesample loop start address 19-4
|
||||
@ -221,15 +216,15 @@ static void ics2115_reg_w(struct ics2115 *chip, UINT8 reg, UINT8 data, int msb)
|
||||
chip->voice[chip->osc].strth = (chip->voice[chip->osc].strth & 0xff)|(data << 8);
|
||||
else
|
||||
chip->voice[chip->osc].strth = (chip->voice[chip->osc].strth & 0xff00)|data;
|
||||
if (ICS2115LOGERROR) logerror("ICS2115: %2d: strth = %04x (%04x)\n", chip->osc,
|
||||
chip->voice[chip->osc].strth, caller_get_pc());
|
||||
if (ICS2115LOGERROR) logerror("%s:ICS2115: %2d: strth = %04x\n", cpuexec_describe_context(Machine), chip->osc,
|
||||
chip->voice[chip->osc].strth);
|
||||
break;
|
||||
|
||||
case 0x03: // [osc] Wavesample loop start address 3-0.3-0
|
||||
if(msb) {
|
||||
chip->voice[chip->osc].strtl = data;
|
||||
if (ICS2115LOGERROR) logerror("ICS2115: %2d: strtl = %02x (%04x)\n", chip->osc,
|
||||
chip->voice[chip->osc].strtl, caller_get_pc());
|
||||
if (ICS2115LOGERROR) logerror("%s:ICS2115: %2d: strtl = %02x\n", cpuexec_describe_context(Machine), chip->osc,
|
||||
chip->voice[chip->osc].strtl);
|
||||
}
|
||||
break;
|
||||
|
||||
@ -238,31 +233,31 @@ static void ics2115_reg_w(struct ics2115 *chip, UINT8 reg, UINT8 data, int msb)
|
||||
chip->voice[chip->osc].endh = (chip->voice[chip->osc].endh & 0xff)|(data << 8);
|
||||
else
|
||||
chip->voice[chip->osc].endh = (chip->voice[chip->osc].endh & 0xff00)|data;
|
||||
if (ICS2115LOGERROR) logerror("ICS2115: %2d: endh = %04x (%04x)\n", chip->osc,
|
||||
chip->voice[chip->osc].endh, caller_get_pc());
|
||||
if (ICS2115LOGERROR) logerror("%s:ICS2115: %2d: endh = %04x\n", cpuexec_describe_context(Machine), chip->osc,
|
||||
chip->voice[chip->osc].endh);
|
||||
break;
|
||||
|
||||
case 0x05: // [osc] Wavesample loop end address 3-0.3-0
|
||||
if(msb) {
|
||||
chip->voice[chip->osc].endl = data;
|
||||
if (ICS2115LOGERROR) logerror("ICS2115: %2d: endl = %02x (%04x)\n", chip->osc,
|
||||
chip->voice[chip->osc].endl, caller_get_pc());
|
||||
if (ICS2115LOGERROR) logerror("%s:ICS2115: %2d: endl = %02x\n", cpuexec_describe_context(Machine), chip->osc,
|
||||
chip->voice[chip->osc].endl);
|
||||
}
|
||||
break;
|
||||
|
||||
case 0x07: // [osc] Volume Start
|
||||
if(msb) {
|
||||
chip->voice[chip->osc].vstart = data;
|
||||
if (ICS2115LOGERROR) logerror("ICS2115: %2d: vstart = %02x (%04x)\n", chip->osc,
|
||||
chip->voice[chip->osc].vstart, caller_get_pc());
|
||||
if (ICS2115LOGERROR) logerror("%s:ICS2115: %2d: vstart = %02x\n", cpuexec_describe_context(Machine), chip->osc,
|
||||
chip->voice[chip->osc].vstart);
|
||||
}
|
||||
break;
|
||||
|
||||
case 0x08: // [osc] Volume End
|
||||
if(msb) {
|
||||
chip->voice[chip->osc].vend = data;
|
||||
if (ICS2115LOGERROR) logerror("ICS2115: %2d: vend = %02x (%04x)\n", chip->osc,
|
||||
chip->voice[chip->osc].vend, caller_get_pc());
|
||||
if (ICS2115LOGERROR) logerror("%s:ICS2115: %2d: vend = %02x\n", cpuexec_describe_context(Machine), chip->osc,
|
||||
chip->voice[chip->osc].vend);
|
||||
}
|
||||
break;
|
||||
|
||||
@ -271,8 +266,8 @@ static void ics2115_reg_w(struct ics2115 *chip, UINT8 reg, UINT8 data, int msb)
|
||||
chip->voice[chip->osc].volacc = (chip->voice[chip->osc].volacc & 0xff)|(data << 8);
|
||||
else
|
||||
chip->voice[chip->osc].volacc = (chip->voice[chip->osc].volacc & 0xff00)|data;
|
||||
if (ICS2115LOGERROR) logerror("ICS2115: %2d: volacc = %04x (%04x)\n", chip->osc,
|
||||
chip->voice[chip->osc].volacc, caller_get_pc());
|
||||
if (ICS2115LOGERROR) logerror("%s:ICS2115: %2d: volacc = %04x\n", cpuexec_describe_context(Machine), chip->osc,
|
||||
chip->voice[chip->osc].volacc);
|
||||
break;
|
||||
|
||||
case 0x0a: // [osc] Wavesample address 19-4
|
||||
@ -280,8 +275,8 @@ static void ics2115_reg_w(struct ics2115 *chip, UINT8 reg, UINT8 data, int msb)
|
||||
chip->voice[chip->osc].addrh = (chip->voice[chip->osc].addrh & 0xff)|(data << 8);
|
||||
else
|
||||
chip->voice[chip->osc].addrh = (chip->voice[chip->osc].addrh & 0xff00)|data;
|
||||
if (ICS2115LOGERROR) logerror("ICS2115: %2d: addrh = %04x (%04x)\n", chip->osc,
|
||||
chip->voice[chip->osc].addrh, caller_get_pc());
|
||||
if (ICS2115LOGERROR) logerror("%s:ICS2115: %2d: addrh = %04x\n", cpuexec_describe_context(Machine), chip->osc,
|
||||
chip->voice[chip->osc].addrh);
|
||||
break;
|
||||
|
||||
case 0x0b: // [osc] Wavesample address 3-0.8-0
|
||||
@ -289,32 +284,32 @@ static void ics2115_reg_w(struct ics2115 *chip, UINT8 reg, UINT8 data, int msb)
|
||||
chip->voice[chip->osc].addrl = (chip->voice[chip->osc].addrl & 0xff)|(data << 8);
|
||||
else
|
||||
chip->voice[chip->osc].addrl = (chip->voice[chip->osc].addrl & 0xff00)|data;
|
||||
if (ICS2115LOGERROR) logerror("ICS2115: %2d: addrl = %04x (%04x)\n", chip->osc,
|
||||
chip->voice[chip->osc].addrl, caller_get_pc());
|
||||
if (ICS2115LOGERROR) logerror("%s:ICS2115: %2d: addrl = %04x\n", cpuexec_describe_context(Machine), chip->osc,
|
||||
chip->voice[chip->osc].addrl);
|
||||
break;
|
||||
|
||||
|
||||
case 0x0c: // [osc] Pan
|
||||
if(msb) {
|
||||
chip->voice[chip->osc].pan = data;
|
||||
if (ICS2115LOGERROR) logerror("ICS2115: %2d: pan = %02x (%04x)\n", chip->osc,
|
||||
chip->voice[chip->osc].pan, caller_get_pc());
|
||||
if (ICS2115LOGERROR) logerror("%s:ICS2115: %2d: pan = %02x\n", cpuexec_describe_context(Machine), chip->osc,
|
||||
chip->voice[chip->osc].pan);
|
||||
}
|
||||
break;
|
||||
|
||||
case 0x0d: // [osc] Volume Enveloppe Control
|
||||
if(msb) {
|
||||
chip->voice[chip->osc].vctl = data;
|
||||
if (ICS2115LOGERROR) logerror("ICS2115: %2d: vctl = %02x (%04x)\n", chip->osc,
|
||||
chip->voice[chip->osc].vctl, caller_get_pc());
|
||||
if (ICS2115LOGERROR) logerror("%s:ICS2115: %2d: vctl = %02x\n", cpuexec_describe_context(Machine), chip->osc,
|
||||
chip->voice[chip->osc].vctl);
|
||||
}
|
||||
break;
|
||||
|
||||
case 0x10: // [osc] Oscillator Control
|
||||
if(msb) {
|
||||
chip->voice[chip->osc].ctl = data;
|
||||
if (ICS2115LOGERROR) logerror("ICS2115: %2d: ctl = %02x (%04x)\n", chip->osc,
|
||||
chip->voice[chip->osc].ctl, caller_get_pc());
|
||||
if (ICS2115LOGERROR) logerror("%s:ICS2115: %2d: ctl = %02x\n", cpuexec_describe_context(Machine), chip->osc,
|
||||
chip->voice[chip->osc].ctl);
|
||||
if(data == 0)
|
||||
keyon(chip, chip->osc);
|
||||
}
|
||||
@ -323,15 +318,15 @@ static void ics2115_reg_w(struct ics2115 *chip, UINT8 reg, UINT8 data, int msb)
|
||||
case 0x11: // [osc] Wavesample static address 27-20
|
||||
if(msb) {
|
||||
chip->voice[chip->osc].saddr = data;
|
||||
if (ICS2115LOGERROR) logerror("ICS2115: %2d: saddr = %02x (%04x)\n", chip->osc,
|
||||
chip->voice[chip->osc].saddr, caller_get_pc());
|
||||
if (ICS2115LOGERROR) logerror("%s:ICS2115: %2d: saddr = %02x\n", cpuexec_describe_context(Machine), chip->osc,
|
||||
chip->voice[chip->osc].saddr);
|
||||
}
|
||||
break;
|
||||
|
||||
case 0x40: // Timer 1 Preset
|
||||
if(!msb) {
|
||||
chip->timer[0].preset = data;
|
||||
if (ICS2115LOGERROR) logerror("ICS2115: t1preset = %d (%04x)\n", chip->timer[0].preset, caller_get_pc());
|
||||
if (ICS2115LOGERROR) logerror("%s:ICS2115: t1preset = %d\n", cpuexec_describe_context(Machine), chip->timer[0].preset);
|
||||
recalc_timer(chip, 0);
|
||||
}
|
||||
break;
|
||||
@ -339,7 +334,7 @@ static void ics2115_reg_w(struct ics2115 *chip, UINT8 reg, UINT8 data, int msb)
|
||||
case 0x41: // Timer 2 Preset
|
||||
if(!msb) {
|
||||
chip->timer[1].preset = data;
|
||||
if (ICS2115LOGERROR) logerror("ICS2115: t2preset = %d (%04x)\n", chip->timer[1].preset, caller_get_pc());
|
||||
if (ICS2115LOGERROR) logerror("%s:ICS2115: t2preset = %d\n", cpuexec_describe_context(Machine), chip->timer[1].preset);
|
||||
recalc_timer(chip, 1);
|
||||
}
|
||||
break;
|
||||
@ -347,7 +342,7 @@ static void ics2115_reg_w(struct ics2115 *chip, UINT8 reg, UINT8 data, int msb)
|
||||
case 0x42: // Timer 1 Prescaler
|
||||
if(!msb) {
|
||||
chip->timer[0].scale = data;
|
||||
if (ICS2115LOGERROR) logerror("ICS2115: t1scale = %d (%04x)\n", chip->timer[0].scale, caller_get_pc());
|
||||
if (ICS2115LOGERROR) logerror("%s:ICS2115: t1scale = %d\n", cpuexec_describe_context(Machine), chip->timer[0].scale);
|
||||
recalc_timer(chip, 0);
|
||||
}
|
||||
break;
|
||||
@ -355,7 +350,7 @@ static void ics2115_reg_w(struct ics2115 *chip, UINT8 reg, UINT8 data, int msb)
|
||||
case 0x43: // Timer 2 Prescaler
|
||||
if(!msb) {
|
||||
chip->timer[1].scale = data;
|
||||
if (ICS2115LOGERROR) logerror("ICS2115: t2scale = %d (%04x)\n", chip->timer[1].scale, caller_get_pc());
|
||||
if (ICS2115LOGERROR) logerror("%s:ICS2115: t2scale = %d\n", cpuexec_describe_context(Machine), chip->timer[1].scale);
|
||||
recalc_timer(chip, 1);
|
||||
}
|
||||
break;
|
||||
@ -363,7 +358,7 @@ static void ics2115_reg_w(struct ics2115 *chip, UINT8 reg, UINT8 data, int msb)
|
||||
case 0x4a: // IRQ Enable
|
||||
if(!msb) {
|
||||
chip->irq_en = data;
|
||||
if (ICS2115LOGERROR) logerror("ICS2115: irq_en = %02x (%04x)\n", chip->irq_en, caller_get_pc());
|
||||
if (ICS2115LOGERROR) logerror("%s:ICS2115: irq_en = %02x\n", cpuexec_describe_context(Machine), chip->irq_en);
|
||||
recalc_irq(chip);
|
||||
}
|
||||
break;
|
||||
@ -371,12 +366,12 @@ static void ics2115_reg_w(struct ics2115 *chip, UINT8 reg, UINT8 data, int msb)
|
||||
case 0x4f: // Oscillator Address being Programmed
|
||||
if(!msb) {
|
||||
chip->osc = data & 31;
|
||||
if (ICS2115LOGERROR) logerror("ICS2115: oscnumber = %d (%04x)\n", chip->osc, caller_get_pc());
|
||||
if (ICS2115LOGERROR) logerror("%s:ICS2115: oscnumber = %d\n", cpuexec_describe_context(Machine), chip->osc);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
if (ICS2115LOGERROR) logerror("ICS2115: write %02x, %02x:%d (%04x)\n", reg, data, msb, caller_get_pc());
|
||||
if (ICS2115LOGERROR) logerror("%s:ICS2115: write %02x, %02x:%d\n", cpuexec_describe_context(Machine), reg, data, msb);
|
||||
}
|
||||
}
|
||||
|
||||
@ -384,7 +379,7 @@ static UINT16 ics2115_reg_r(struct ics2115 *chip, UINT8 reg)
|
||||
{
|
||||
switch(reg) {
|
||||
case 0x0d: // [osc] Volume Enveloppe Control
|
||||
if (ICS2115LOGERROR) logerror("ICS2115: %2d: read vctl (%04x)\n", chip->osc, caller_get_pc());
|
||||
if (ICS2115LOGERROR) logerror("%s:ICS2115: %2d: read vctl\n", cpuexec_describe_context(Machine), chip->osc);
|
||||
// res = chip->voice[chip->osc].vctl << 8;
|
||||
// may expect |8 on voice irq with &40 == 0
|
||||
// may expect |8 on reg 0 on voice irq with &80 == 0
|
||||
@ -401,40 +396,40 @@ static UINT16 ics2115_reg_r(struct ics2115 *chip, UINT8 reg)
|
||||
res = 0x40 | osc; // 0x40 ? 0x80 ?
|
||||
break;
|
||||
}
|
||||
if (ICS2115LOGERROR) logerror("ICS2115: read irqv %02x (%04x)\n", res, caller_get_pc());
|
||||
if (ICS2115LOGERROR) logerror("%s:ICS2115: read irqv %02x\n", cpuexec_describe_context(Machine), res);
|
||||
return res << 8;
|
||||
}
|
||||
|
||||
case 0x40: // Timer 0 clear irq
|
||||
// if (ICS2115LOGERROR) logerror("ICS2115: clear timer 0 (%04x)\n", caller_get_pc());
|
||||
// if (ICS2115LOGERROR) logerror("%s:ICS2115: clear timer 0\n", cpuexec_describe_context(Machine));
|
||||
chip->irq_pend &= ~(1<<0);
|
||||
recalc_irq(chip);
|
||||
return chip->timer[0].preset;
|
||||
|
||||
case 0x41: // Timer 1 clear irq
|
||||
if (ICS2115LOGERROR) logerror("ICS2115: clear timer 1 (%04x)\n", caller_get_pc());
|
||||
if (ICS2115LOGERROR) logerror("%s:ICS2115: clear timer 1\n", cpuexec_describe_context(Machine));
|
||||
chip->irq_pend &= ~(1<<1);
|
||||
recalc_irq(chip);
|
||||
return chip->timer[1].preset;
|
||||
|
||||
case 0x43: // Timer status
|
||||
// if (ICS2115LOGERROR) logerror("ICS2115: read timer status %02x (%04x)\n", chip->irq_pend & 3, caller_get_pc());
|
||||
// if (ICS2115LOGERROR) logerror("%s:ICS2115: read timer status %02x\n", cpuexec_describe_context(Machine), chip->irq_pend & 3);
|
||||
return chip->irq_pend & 3;
|
||||
|
||||
case 0x4a: // IRQ Pending
|
||||
if (ICS2115LOGERROR) logerror("ICS2115: read irq_pend %02x (%04x)\n", chip->irq_pend, caller_get_pc());
|
||||
if (ICS2115LOGERROR) logerror("%s:ICS2115: read irq_pend %02x\n", cpuexec_describe_context(Machine), chip->irq_pend);
|
||||
return chip->irq_pend;
|
||||
|
||||
case 0x4b: // Address of Interrupting Oscillator
|
||||
if (ICS2115LOGERROR) logerror("ICS2115: %2d: read intoscaddr (%04x)\n", chip->osc, caller_get_pc());
|
||||
if (ICS2115LOGERROR) logerror("%s:ICS2115: %2d: read intoscaddr\n", cpuexec_describe_context(Machine), chip->osc);
|
||||
return 0x80;
|
||||
|
||||
case 0x4c: // Chip revision
|
||||
if (ICS2115LOGERROR) logerror("ICS2115: read revision (%04x)\n", caller_get_pc());
|
||||
if (ICS2115LOGERROR) logerror("%s:ICS2115: read revision\n", cpuexec_describe_context(Machine));
|
||||
return 0x01;
|
||||
|
||||
default:
|
||||
if (ICS2115LOGERROR) logerror("ICS2115: read %02x unmapped (%04x)\n", reg, caller_get_pc());
|
||||
if (ICS2115LOGERROR) logerror("%s:ICS2115: read %02x unmapped\n", cpuexec_describe_context(Machine), reg);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@ -488,7 +483,7 @@ READ8_HANDLER( ics2115_r )
|
||||
break;
|
||||
}
|
||||
}
|
||||
// if (ICS2115LOGERROR) logerror("ICS2115: read status %02x (%04x)\n", res, caller_get_pc());
|
||||
// if (ICS2115LOGERROR) logerror("%s:ICS2115: read status %02x\n", cpuexec_describe_context(Machine), res);
|
||||
|
||||
return res;
|
||||
}
|
||||
@ -516,7 +511,7 @@ WRITE8_HANDLER( ics2115_w )
|
||||
ics2115_reg_w(chip, chip->reg, data, 1);
|
||||
break;
|
||||
}
|
||||
// if (ICS2115LOGERROR) logerror("ICS2115: wi %d, %02x (%04x)\n", offset, data, caller_get_pc());
|
||||
// if (ICS2115LOGERROR) logerror("ICS2115: wi %d, %02x\n", cpuexec_describe_context(Machine), offset, data);
|
||||
}
|
||||
|
||||
static SND_RESET( ics2115 )
|
||||
|
@ -8,6 +8,7 @@
|
||||
#include "deprecat.h"
|
||||
#include "streams.h"
|
||||
#include "cpuintrf.h"
|
||||
#include "cpuexec.h"
|
||||
#include "k053260.h"
|
||||
|
||||
/* 2004-02-28: Fixed ppcm decoding. Games sound much better now.*/
|
||||
@ -399,7 +400,7 @@ static UINT8 k053260_read( int chip, offs_t offset )
|
||||
ic->channels[0].pos += ( 1 << 16 );
|
||||
|
||||
if ( offs > ic->rom_size ) {
|
||||
logerror("%06x: K53260: Attempting to read past rom size in rom Read Mode (offs = %06x, size = %06x).\n",cpu_get_pc(Machine->activecpu),offs,ic->rom_size );
|
||||
logerror("%s: K53260: Attempting to read past rom size in rom Read Mode (offs = %06x, size = %06x).\n", cpuexec_describe_context(Machine),offs,ic->rom_size );
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -601,7 +601,6 @@ INLINE void apu_update(struct nesapu_info *info, stream_sample_t *buffer16, int
|
||||
{
|
||||
int accum;
|
||||
|
||||
cpu_push_context( info->APU.dpcm.memory->cpu );
|
||||
while (samples--)
|
||||
{
|
||||
accum = apu_square(info, &info->APU.squ[0]);
|
||||
@ -618,7 +617,6 @@ INLINE void apu_update(struct nesapu_info *info, stream_sample_t *buffer16, int
|
||||
|
||||
*(buffer16++)=accum<<8;
|
||||
}
|
||||
cpu_pop_context();
|
||||
}
|
||||
|
||||
/* READ VALUES FROM REGISTERS */
|
||||
|
@ -53,6 +53,7 @@
|
||||
#include "deprecat.h"
|
||||
#include "streams.h"
|
||||
#include "cpuintrf.h"
|
||||
#include "cpuexec.h"
|
||||
#include "pokey.h"
|
||||
|
||||
/*
|
||||
@ -855,7 +856,7 @@ static int pokey_register_r(int chip, int offs)
|
||||
}
|
||||
}
|
||||
else
|
||||
logerror("PC %04x: warning - read p[chip] #%d POT%d\n", cpu_get_pc(Machine->activecpu), chip, pot);
|
||||
logerror("%s: warning - read p[chip] #%d POT%d\n", cpuexec_describe_context(Machine), chip, pot);
|
||||
break;
|
||||
|
||||
case ALLPOT_C:
|
||||
|
@ -13,6 +13,7 @@
|
||||
#include "deprecat.h"
|
||||
#include "streams.h"
|
||||
#include "cpuintrf.h"
|
||||
#include "cpuexec.h"
|
||||
#include "psx.h"
|
||||
|
||||
#define VERBOSE_LEVEL ( 0 )
|
||||
@ -26,7 +27,7 @@ INLINE void ATTR_PRINTF(2,3) verboselog( int n_level, const char *s_fmt, ... )
|
||||
va_start( v, s_fmt );
|
||||
vsprintf( buf, s_fmt, v );
|
||||
va_end( v );
|
||||
logerror( "%08x: %s", cpu_get_pc(Machine->activecpu), buf );
|
||||
logerror( "%s: %s", cpuexec_describe_context(Machine), buf );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -442,11 +442,11 @@ static void rf5c400_w(int chipnum, int offset, UINT16 data)
|
||||
|
||||
default:
|
||||
{
|
||||
//mame_printf_debug("rf5c400_w: %08X, %08X, %08X at %08X\n", data, offset, mem_mask, cpu_get_pc(machine->activecpu));
|
||||
//mame_printf_debug("%s:rf5c400_w: %08X, %08X, %08X\n", cpuexec_describe_context(Machine), data, offset, mem_mask);
|
||||
break;
|
||||
}
|
||||
}
|
||||
//mame_printf_debug("rf5c400_w: %08X, %08X, %08X at %08X\n", data, offset, mem_mask, cpu_get_pc(machine->activecpu));
|
||||
//mame_printf_debug("%s:rf5c400_w: %08X, %08X, %08X at %08X\n", cpuexec_describe_context(Machine), data, offset, mem_mask);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -66,6 +66,7 @@
|
||||
#include "sndintrf.h"
|
||||
#include "streams.h"
|
||||
#include "cpuintrf.h"
|
||||
#include "cpuexec.h"
|
||||
#include "saa1099.h"
|
||||
#include "deprecat.h"
|
||||
#include <math.h>
|
||||
@ -334,7 +335,7 @@ static void saa1099_control_port_w( int chip, int reg, int data )
|
||||
if ((data & 0xff) > 0x1c)
|
||||
{
|
||||
/* Error! */
|
||||
logerror("%04x: (SAA1099 #%d) Unknown register selected\n",cpu_get_pc(Machine->activecpu), chip);
|
||||
logerror("%s: (SAA1099 #%d) Unknown register selected\n",cpuexec_describe_context(Machine), chip);
|
||||
}
|
||||
|
||||
saa->selected_reg = data & 0x1f;
|
||||
@ -420,7 +421,7 @@ static void saa1099_write_port_w( int chip, int offset, int data )
|
||||
int i;
|
||||
|
||||
/* Synch & Reset generators */
|
||||
logerror("%04x: (SAA1099 #%d) -reg 0x1c- Chip reset\n",cpu_get_pc(Machine->activecpu), chip);
|
||||
logerror("%s: (SAA1099 #%d) -reg 0x1c- Chip reset\n",cpuexec_describe_context(Machine), chip);
|
||||
for (i = 0; i < 6; i++)
|
||||
{
|
||||
saa->channels[i].level = 0;
|
||||
@ -429,7 +430,7 @@ static void saa1099_write_port_w( int chip, int offset, int data )
|
||||
}
|
||||
break;
|
||||
default: /* Error! */
|
||||
logerror("%04x: (SAA1099 #%d) Unknown operation (reg:%02x, data:%02x)\n",cpu_get_pc(Machine->activecpu), chip, reg, data);
|
||||
logerror("%s: (SAA1099 #%d) Unknown operation (reg:%02x, data:%02x)\n",cpuexec_describe_context(Machine), chip, reg, data);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -129,6 +129,7 @@ static void timer_remove(emu_timer *which);
|
||||
|
||||
INLINE attotime get_current_time(running_machine *machine)
|
||||
{
|
||||
extern attotime cpuexec_override_local_time(running_machine *machine, attotime default_time);
|
||||
timer_private *global = machine->timer_data;
|
||||
|
||||
/* if we're currently in a callback, use the timer's expiration time as a base */
|
||||
@ -136,11 +137,8 @@ INLINE attotime get_current_time(running_machine *machine)
|
||||
return global->callback_timer_expire_time;
|
||||
|
||||
/* if we're executing as a particular CPU, use its local time as a base */
|
||||
if (machine->activecpu != NULL)
|
||||
return cpu_get_local_time(machine->activecpu);
|
||||
|
||||
/* otherwise, return the current global base time */
|
||||
return global->basetime;
|
||||
/* otherwise, return the global base time */
|
||||
return cpuexec_override_local_time(machine, global->basetime);
|
||||
}
|
||||
|
||||
|
||||
@ -737,8 +735,8 @@ void timer_adjust_periodic(emu_timer *which, attotime start_delay, INT32 param,
|
||||
|
||||
/* if this was inserted as the head, abort the current timeslice and resync */
|
||||
LOG(("timer_adjust_oneshot %s.%s:%d to expire @ %s\n", which->file, which->func, which->line, attotime_string(which->expire, 9)));
|
||||
if (which == global->activelist && which->machine->activecpu != NULL)
|
||||
cpu_abort_timeslice(which->machine->activecpu);
|
||||
if (which == global->activelist)
|
||||
cpuexec_abort_timeslice(which->machine);
|
||||
}
|
||||
|
||||
|
||||
|
@ -43,6 +43,7 @@ struct _cdp1869_t
|
||||
{
|
||||
const cdp1869_interface *intf; /* interface */
|
||||
const device_config *screen; /* screen */
|
||||
const device_config *cpu; /* CPU */
|
||||
sound_stream *stream; /* sound output */
|
||||
|
||||
/* video state */
|
||||
@ -150,9 +151,9 @@ static STATE_POSTLOAD( cdp1869_state_save_postload )
|
||||
|
||||
/* CDP1802 X Register */
|
||||
|
||||
static UINT16 cdp1802_get_r_x(running_machine *machine)
|
||||
static UINT16 cdp1802_get_r_x(cdp1869_t *cdp1869)
|
||||
{
|
||||
return cpu_get_reg(machine->activecpu, CDP1802_R0 + cpu_get_reg(machine->activecpu, CDP1802_X));
|
||||
return cpu_get_reg(cdp1869->cpu, CDP1802_R0 + cpu_get_reg(cdp1869->cpu, CDP1802_X));
|
||||
}
|
||||
|
||||
/* Palette Initialization */
|
||||
@ -383,7 +384,7 @@ WRITE8_DEVICE_HANDLER( cdp1869_out4_w )
|
||||
{
|
||||
cdp1869_t *cdp1869 = get_safe_token(device);
|
||||
|
||||
UINT16 word = cdp1802_get_r_x(device->machine);
|
||||
UINT16 word = cdp1802_get_r_x(cdp1869);
|
||||
|
||||
/*
|
||||
bit description
|
||||
@ -422,7 +423,7 @@ WRITE8_DEVICE_HANDLER( cdp1869_out5_w )
|
||||
{
|
||||
cdp1869_t *cdp1869 = get_safe_token(device);
|
||||
|
||||
UINT16 word = cdp1802_get_r_x(device->machine);
|
||||
UINT16 word = cdp1802_get_r_x(cdp1869);
|
||||
|
||||
/*
|
||||
bit description
|
||||
@ -479,7 +480,7 @@ WRITE8_DEVICE_HANDLER( cdp1869_out6_w )
|
||||
{
|
||||
cdp1869_t *cdp1869 = get_safe_token(device);
|
||||
|
||||
UINT16 word = cdp1802_get_r_x(device->machine);
|
||||
UINT16 word = cdp1802_get_r_x(cdp1869);
|
||||
|
||||
/*
|
||||
bit description
|
||||
@ -509,7 +510,7 @@ WRITE8_DEVICE_HANDLER( cdp1869_out7_w )
|
||||
{
|
||||
cdp1869_t *cdp1869 = get_safe_token(device);
|
||||
|
||||
UINT16 word = cdp1802_get_r_x(device->machine);
|
||||
UINT16 word = cdp1802_get_r_x(cdp1869);
|
||||
|
||||
/*
|
||||
bit description
|
||||
@ -799,9 +800,14 @@ static DEVICE_START( cdp1869 )
|
||||
|
||||
// get the screen device
|
||||
|
||||
cdp1869->screen = device_list_find_by_tag(device->machine->config->devicelist, VIDEO_SCREEN, cdp1869->intf->screen_tag);
|
||||
cdp1869->screen = devtag_get_device(device->machine, VIDEO_SCREEN, cdp1869->intf->screen_tag);
|
||||
assert(cdp1869->screen != NULL);
|
||||
|
||||
// get the CPU device
|
||||
|
||||
cdp1869->cpu = cputag_get_cpu(device->machine, cdp1869->intf->cpu_tag);
|
||||
assert(cdp1869->cpu != NULL);
|
||||
|
||||
// allocate timers
|
||||
|
||||
if (cdp1869->intf->on_prd_changed != NULL)
|
||||
|
@ -109,6 +109,7 @@ typedef struct _cdp1869_interface cdp1869_interface;
|
||||
struct _cdp1869_interface
|
||||
{
|
||||
const char *screen_tag; /* screen we are acting on */
|
||||
const char *cpu_tag; /* CPU we work together with */
|
||||
int pixel_clock; /* the dot clock of the chip */
|
||||
int color_clock; /* the chroma clock of the chip */
|
||||
|
||||
|
@ -230,7 +230,7 @@ WRITE8_DEVICE_HANDLER( mc6845_register_w )
|
||||
{
|
||||
mc6845_t *mc6845 = get_safe_token(device);
|
||||
|
||||
if (LOG) logerror("M6845 PC %04x: reg 0x%02x = 0x%02x\n", cpu_get_pc(device->machine->activecpu), mc6845->register_address_latch, data);
|
||||
if (LOG) logerror("%s:M6845 reg 0x%02x = 0x%02x\n", cpuexec_describe_context(device->machine), mc6845->register_address_latch, data);
|
||||
|
||||
switch (mc6845->register_address_latch)
|
||||
{
|
||||
|
@ -187,7 +187,7 @@ static void register_w(offs_t offset, UINT8 data)
|
||||
}
|
||||
|
||||
/* log it */
|
||||
if (VERBOSE) logerror("%04X:tms34061 %s = %04x\n", cpu_get_pc(Machine->activecpu), regnames[regnum], tms34061.regs[regnum]);
|
||||
if (VERBOSE) logerror("%s:tms34061 %s = %04x\n", cpuexec_describe_context(Machine), regnames[regnum], tms34061.regs[regnum]);
|
||||
|
||||
/* update the state of things */
|
||||
switch (regnum)
|
||||
@ -265,7 +265,7 @@ static UINT8 register_r(offs_t offset)
|
||||
}
|
||||
|
||||
/* log it */
|
||||
if (VERBOSE) logerror("%04X:tms34061 %s read = %04X\n", cpu_get_pc(Machine->activecpu), regnames[regnum], result);
|
||||
if (VERBOSE) logerror("%s:tms34061 %s read = %04X\n", cpuexec_describe_context(Machine), regnames[regnum], result);
|
||||
return (offset & 0x02) ? (result >> 8) : result;
|
||||
}
|
||||
|
||||
@ -372,7 +372,7 @@ static void xypixel_w(int offset, UINT8 data)
|
||||
|
||||
/* mask to the VRAM size */
|
||||
pixeloffs &= tms34061.vrammask;
|
||||
if (VERBOSE) logerror("%04X:tms34061 xy (%04x) = %02x/%02x\n", cpu_get_pc(Machine->activecpu), pixeloffs, data, tms34061.latchdata);
|
||||
if (VERBOSE) logerror("%s:tms34061 xy (%04x) = %02x/%02x\n", cpuexec_describe_context(Machine), pixeloffs, data, tms34061.latchdata);
|
||||
|
||||
/* set the pixel data */
|
||||
tms34061.vram[pixeloffs] = data;
|
||||
@ -428,7 +428,7 @@ void tms34061_w(int col, int row, int func, UINT8 data)
|
||||
offs = ((row << tms34061.intf.rowshift) | col) & tms34061.vrammask;
|
||||
if (tms34061.regs[TMS34061_CONTROL2] & 0x0040)
|
||||
offs |= (tms34061.regs[TMS34061_CONTROL2] & 3) << 16;
|
||||
if (VERBOSE) logerror("%04X:tms34061 direct (%04x) = %02x/%02x\n", cpu_get_pc(Machine->activecpu), offs, data, tms34061.latchdata);
|
||||
if (VERBOSE) logerror("%s:tms34061 direct (%04x) = %02x/%02x\n", cpuexec_describe_context(Machine), offs, data, tms34061.latchdata);
|
||||
if (tms34061.vram[offs] != data || tms34061.latchram[offs] != tms34061.latchdata)
|
||||
{
|
||||
tms34061.vram[offs] = data;
|
||||
@ -442,7 +442,7 @@ void tms34061_w(int col, int row, int func, UINT8 data)
|
||||
if (tms34061.regs[TMS34061_CONTROL2] & 0x0040)
|
||||
offs |= (tms34061.regs[TMS34061_CONTROL2] & 3) << 16;
|
||||
offs &= tms34061.vrammask;
|
||||
if (VERBOSE) logerror("%04X:tms34061 shiftreg write (%04x)\n", cpu_get_pc(Machine->activecpu), offs);
|
||||
if (VERBOSE) logerror("%s:tms34061 shiftreg write (%04x)\n", cpuexec_describe_context(Machine), offs);
|
||||
|
||||
memcpy(&tms34061.vram[offs], tms34061.shiftreg, (size_t)1 << tms34061.intf.rowshift);
|
||||
memset(&tms34061.latchram[offs], tms34061.latchdata, (size_t)1 << tms34061.intf.rowshift);
|
||||
@ -454,14 +454,14 @@ void tms34061_w(int col, int row, int func, UINT8 data)
|
||||
if (tms34061.regs[TMS34061_CONTROL2] & 0x0040)
|
||||
offs |= (tms34061.regs[TMS34061_CONTROL2] & 3) << 16;
|
||||
offs &= tms34061.vrammask;
|
||||
if (VERBOSE) logerror("%04X:tms34061 shiftreg read (%04x)\n", cpu_get_pc(Machine->activecpu), offs);
|
||||
if (VERBOSE) logerror("%s:tms34061 shiftreg read (%04x)\n", cpuexec_describe_context(Machine), offs);
|
||||
|
||||
tms34061.shiftreg = &tms34061.vram[offs];
|
||||
break;
|
||||
|
||||
/* log anything else */
|
||||
default:
|
||||
logerror("Unsupported TMS34061 function %d - PC: %04X\n", func, cpu_get_pc(Machine->activecpu));
|
||||
logerror("%s:Unsupported TMS34061 function %d\n", cpuexec_describe_context(Machine), func);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -515,8 +515,8 @@ UINT8 tms34061_r(int col, int row, int func)
|
||||
|
||||
/* log anything else */
|
||||
default:
|
||||
logerror("Unsupported TMS34061 function %d - PC: %04X\n",
|
||||
func, cpu_get_pc(Machine->activecpu));
|
||||
logerror("%s:Unsupported TMS34061 function %d\n", cpuexec_describe_context(Machine),
|
||||
func);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -1671,6 +1671,7 @@ struct _voodoo_state
|
||||
UINT8 index; /* index of board */
|
||||
const device_config *device; /* pointer to our containing device */
|
||||
const device_config *screen; /* the screen we are acting on */
|
||||
const device_config *cpu; /* the CPU we interact with */
|
||||
UINT8 type; /* type of system */
|
||||
UINT8 chipmask; /* mask for which chips are available */
|
||||
UINT32 freq; /* operating frequency */
|
||||
@ -1696,7 +1697,7 @@ struct _voodoo_state
|
||||
|
||||
voodoo_stats stats; /* internal statistics */
|
||||
|
||||
offs_t last_status_pc; /* PC of last status read (for logging) */
|
||||
offs_t last_status_pc; /* PC of last status description (for logging) */
|
||||
UINT32 last_status_value; /* value of last status read (for logging) */
|
||||
|
||||
int next_rasterizer; /* next rasterizer index */
|
||||
|
@ -1979,7 +1979,7 @@ static void cmdfifo_w(voodoo_state *v, cmdfifo_info *f, offs_t offset, UINT32 da
|
||||
|
||||
/*************************************
|
||||
*
|
||||
* Stall the activecpu until we are
|
||||
* Stall the active cpu until we are
|
||||
* ready
|
||||
*
|
||||
*************************************/
|
||||
@ -2057,7 +2057,7 @@ static void stall_cpu(voodoo_state *v, int state, attotime current_time)
|
||||
if (v->pci.stall_callback)
|
||||
(*v->pci.stall_callback)(v->device, TRUE);
|
||||
else
|
||||
cpu_spinuntil_trigger(v->device->machine->activecpu, v->trigger);
|
||||
cpu_spinuntil_trigger(v->cpu, v->trigger);
|
||||
|
||||
/* set a timer to clear the stall */
|
||||
timer_adjust_oneshot(v->pci.continue_timer, attotime_sub(v->pci.op_end_time, current_time), 0);
|
||||
@ -3681,7 +3681,7 @@ static UINT32 register_r(voodoo_state *v, offs_t offset)
|
||||
/* bit 31 is not used */
|
||||
|
||||
/* eat some cycles since people like polling here */
|
||||
cpu_eat_cycles(v->device->machine->activecpu, 1000);
|
||||
cpu_eat_cycles(v->cpu, 1000);
|
||||
break;
|
||||
|
||||
/* bit 2 of the initEnable register maps this to dacRead */
|
||||
@ -3694,7 +3694,7 @@ static UINT32 register_r(voodoo_state *v, offs_t offset)
|
||||
case vRetrace:
|
||||
|
||||
/* eat some cycles since people like polling here */
|
||||
cpu_eat_cycles(v->device->machine->activecpu, 10);
|
||||
cpu_eat_cycles(v->cpu, 10);
|
||||
result = video_screen_get_vpos(v->screen);
|
||||
break;
|
||||
|
||||
@ -3709,7 +3709,7 @@ static UINT32 register_r(voodoo_state *v, offs_t offset)
|
||||
result = v->fbi.cmdfifo[0].rdptr;
|
||||
|
||||
/* eat some cycles since people like polling here */
|
||||
cpu_eat_cycles(v->device->machine->activecpu, 1000);
|
||||
cpu_eat_cycles(v->cpu, 1000);
|
||||
break;
|
||||
|
||||
case cmdFifoAMin:
|
||||
@ -3745,16 +3745,16 @@ static UINT32 register_r(voodoo_state *v, offs_t offset)
|
||||
int logit = TRUE;
|
||||
|
||||
/* don't log multiple identical status reads from the same address */
|
||||
if (regnum == status)
|
||||
{
|
||||
offs_t pc = cpu_get_pc(v->device->machine->activecpu);
|
||||
if (pc == v->last_status_pc && result == v->last_status_value)
|
||||
logit = FALSE;
|
||||
v->last_status_pc = pc;
|
||||
v->last_status_value = result;
|
||||
}
|
||||
if (regnum == cmdFifoRdPtr)
|
||||
logit = FALSE;
|
||||
if (regnum == status)
|
||||
{
|
||||
offs_t pc = cpu_get_pc(v->cpu);
|
||||
if (pc == v->last_status_pc && result == v->last_status_value)
|
||||
logit = FALSE;
|
||||
v->last_status_pc = pc;
|
||||
v->last_status_value = result;
|
||||
}
|
||||
if (regnum == cmdFifoRdPtr)
|
||||
logit = FALSE;
|
||||
|
||||
if (logit)
|
||||
logerror("VOODOO.%d.REG:%s read = %08X\n", v->index, v->regnames[regnum], result);
|
||||
@ -3930,7 +3930,7 @@ static READ32_DEVICE_HANDLER( banshee_agp_r )
|
||||
}
|
||||
|
||||
if (LOG_REGISTERS)
|
||||
logerror("%08X:banshee_r(AGP:%s)\n", cpu_get_pc(v->device->machine->activecpu), banshee_agp_reg_name[offset]);
|
||||
logerror("%s:banshee_r(AGP:%s)\n", cpuexec_describe_context(v->device->machine), banshee_agp_reg_name[offset]);
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -3949,15 +3949,15 @@ READ32_DEVICE_HANDLER( banshee_r )
|
||||
else if (offset < 0x100000/4)
|
||||
result = banshee_agp_r(device, offset, mem_mask);
|
||||
else if (offset < 0x200000/4)
|
||||
logerror("%08X:banshee_r(2D:%X)\n", cpu_get_pc(device->machine->activecpu), (offset*4) & 0xfffff);
|
||||
logerror("%s:banshee_r(2D:%X)\n", cpuexec_describe_context(device->machine), (offset*4) & 0xfffff);
|
||||
else if (offset < 0x600000/4)
|
||||
result = register_r(v, offset & 0x1fffff/4);
|
||||
else if (offset < 0x800000/4)
|
||||
logerror("%08X:banshee_r(TEX:%X)\n", cpu_get_pc(device->machine->activecpu), (offset*4) & 0x1fffff);
|
||||
logerror("%s:banshee_r(TEX:%X)\n", cpuexec_describe_context(device->machine), (offset*4) & 0x1fffff);
|
||||
else if (offset < 0xc00000/4)
|
||||
logerror("%08X:banshee_r(RES:%X)\n", cpu_get_pc(device->machine->activecpu), (offset*4) & 0x3fffff);
|
||||
logerror("%s:banshee_r(RES:%X)\n", cpuexec_describe_context(device->machine), (offset*4) & 0x3fffff);
|
||||
else if (offset < 0x1000000/4)
|
||||
logerror("%08X:banshee_r(YUV:%X)\n", cpu_get_pc(device->machine->activecpu), (offset*4) & 0x3fffff);
|
||||
logerror("%s:banshee_r(YUV:%X)\n", cpuexec_describe_context(device->machine), (offset*4) & 0x3fffff);
|
||||
else if (offset < 0x2000000/4)
|
||||
{
|
||||
UINT8 temp = v->fbi.lfb_stride;
|
||||
@ -3980,7 +3980,7 @@ READ32_DEVICE_HANDLER( banshee_fb_r )
|
||||
|
||||
if (offset < v->fbi.lfb_base)
|
||||
{
|
||||
logerror("%08X:banshee_fb_r(%X)\n", cpu_get_pc(device->machine->activecpu), offset*4);
|
||||
logerror("%s:banshee_fb_r(%X)\n", cpuexec_describe_context(device->machine), offset*4);
|
||||
if (offset*4 <= v->fbi.mask)
|
||||
result = ((UINT32 *)v->fbi.ram)[offset];
|
||||
}
|
||||
@ -4005,20 +4005,20 @@ static READ8_DEVICE_HANDLER( banshee_vga_r )
|
||||
if (v->banshee.vga[0x3c1 & 0x1f] < ARRAY_LENGTH(v->banshee.att))
|
||||
result = v->banshee.att[v->banshee.vga[0x3c1 & 0x1f]];
|
||||
if (LOG_REGISTERS)
|
||||
logerror("%08X:banshee_att_r(%X)\n", cpu_get_pc(device->machine->activecpu), v->banshee.vga[0x3c1 & 0x1f]);
|
||||
logerror("%s:banshee_att_r(%X)\n", cpuexec_describe_context(device->machine), v->banshee.vga[0x3c1 & 0x1f]);
|
||||
break;
|
||||
|
||||
/* Input status 0 */
|
||||
case 0x3c2:
|
||||
/*
|
||||
bit 7 = Interrupt Status. When its value is ?1?, denotes that an interrupt is pending.
|
||||
bit 6:5 = Feature Connector. These 2 bits are readable bits from the feature connector.
|
||||
bit 4 = Sense. This bit reflects the state of the DAC monitor sense logic.
|
||||
bit 3:0 = Reserved. Read back as 0.
|
||||
*/
|
||||
bit 7 = Interrupt Status. When its value is ?1?, denotes that an interrupt is pending.
|
||||
bit 6:5 = Feature Connector. These 2 bits are readable bits from the feature connector.
|
||||
bit 4 = Sense. This bit reflects the state of the DAC monitor sense logic.
|
||||
bit 3:0 = Reserved. Read back as 0.
|
||||
*/
|
||||
result = 0x00;
|
||||
if (LOG_REGISTERS)
|
||||
logerror("%08X:banshee_vga_r(%X)\n", cpu_get_pc(device->machine->activecpu), 0x300+offset);
|
||||
logerror("%s:banshee_vga_r(%X)\n", cpuexec_describe_context(device->machine), 0x300+offset);
|
||||
break;
|
||||
|
||||
/* Sequencer access */
|
||||
@ -4026,7 +4026,7 @@ static READ8_DEVICE_HANDLER( banshee_vga_r )
|
||||
if (v->banshee.vga[0x3c4 & 0x1f] < ARRAY_LENGTH(v->banshee.seq))
|
||||
result = v->banshee.seq[v->banshee.vga[0x3c4 & 0x1f]];
|
||||
if (LOG_REGISTERS)
|
||||
logerror("%08X:banshee_seq_r(%X)\n", cpu_get_pc(device->machine->activecpu), v->banshee.vga[0x3c4 & 0x1f]);
|
||||
logerror("%s:banshee_seq_r(%X)\n", cpuexec_describe_context(device->machine), v->banshee.vga[0x3c4 & 0x1f]);
|
||||
break;
|
||||
|
||||
/* Feature control */
|
||||
@ -4034,14 +4034,14 @@ static READ8_DEVICE_HANDLER( banshee_vga_r )
|
||||
result = v->banshee.vga[0x3da & 0x1f];
|
||||
v->banshee.attff = 0;
|
||||
if (LOG_REGISTERS)
|
||||
logerror("%08X:banshee_vga_r(%X)\n", cpu_get_pc(device->machine->activecpu), 0x300+offset);
|
||||
logerror("%s:banshee_vga_r(%X)\n", cpuexec_describe_context(device->machine), 0x300+offset);
|
||||
break;
|
||||
|
||||
/* Miscellaneous output */
|
||||
case 0x3cc:
|
||||
result = v->banshee.vga[0x3c2 & 0x1f];
|
||||
if (LOG_REGISTERS)
|
||||
logerror("%08X:banshee_vga_r(%X)\n", cpu_get_pc(device->machine->activecpu), 0x300+offset);
|
||||
logerror("%s:banshee_vga_r(%X)\n", cpuexec_describe_context(device->machine), 0x300+offset);
|
||||
break;
|
||||
|
||||
/* Graphics controller access */
|
||||
@ -4049,7 +4049,7 @@ static READ8_DEVICE_HANDLER( banshee_vga_r )
|
||||
if (v->banshee.vga[0x3ce & 0x1f] < ARRAY_LENGTH(v->banshee.gc))
|
||||
result = v->banshee.gc[v->banshee.vga[0x3ce & 0x1f]];
|
||||
if (LOG_REGISTERS)
|
||||
logerror("%08X:banshee_gc_r(%X)\n", cpu_get_pc(device->machine->activecpu), v->banshee.vga[0x3ce & 0x1f]);
|
||||
logerror("%s:banshee_gc_r(%X)\n", cpuexec_describe_context(device->machine), v->banshee.vga[0x3ce & 0x1f]);
|
||||
break;
|
||||
|
||||
/* CRTC access */
|
||||
@ -4057,29 +4057,29 @@ static READ8_DEVICE_HANDLER( banshee_vga_r )
|
||||
if (v->banshee.vga[0x3d4 & 0x1f] < ARRAY_LENGTH(v->banshee.crtc))
|
||||
result = v->banshee.crtc[v->banshee.vga[0x3d4 & 0x1f]];
|
||||
if (LOG_REGISTERS)
|
||||
logerror("%08X:banshee_crtc_r(%X)\n", cpu_get_pc(device->machine->activecpu), v->banshee.vga[0x3d4 & 0x1f]);
|
||||
logerror("%s:banshee_crtc_r(%X)\n", cpuexec_describe_context(device->machine), v->banshee.vga[0x3d4 & 0x1f]);
|
||||
break;
|
||||
|
||||
/* Input status 1 */
|
||||
case 0x3da:
|
||||
/*
|
||||
bit 7:6 = Reserved. These bits read back 0.
|
||||
bit 5:4 = Display Status. These 2 bits reflect 2 of the 8 pixel data outputs from the Attribute
|
||||
controller, as determined by the Attribute controller index 0x12 bits 4 and 5.
|
||||
bit 3 = Vertical sync Status. A ?1? indicates vertical retrace is in progress.
|
||||
bit 2:1 = Reserved. These bits read back 0x2.
|
||||
bit 0 = Display Disable. When this bit is 1, either horizontal or vertical display end has occurred,
|
||||
otherwise video data is being displayed.
|
||||
*/
|
||||
bit 7:6 = Reserved. These bits read back 0.
|
||||
bit 5:4 = Display Status. These 2 bits reflect 2 of the 8 pixel data outputs from the Attribute
|
||||
controller, as determined by the Attribute controller index 0x12 bits 4 and 5.
|
||||
bit 3 = Vertical sync Status. A ?1? indicates vertical retrace is in progress.
|
||||
bit 2:1 = Reserved. These bits read back 0x2.
|
||||
bit 0 = Display Disable. When this bit is 1, either horizontal or vertical display end has occurred,
|
||||
otherwise video data is being displayed.
|
||||
*/
|
||||
result = 0x04;
|
||||
if (LOG_REGISTERS)
|
||||
logerror("%08X:banshee_vga_r(%X)\n", cpu_get_pc(device->machine->activecpu), 0x300+offset);
|
||||
logerror("%s:banshee_vga_r(%X)\n", cpuexec_describe_context(device->machine), 0x300+offset);
|
||||
break;
|
||||
|
||||
default:
|
||||
result = v->banshee.vga[offset];
|
||||
if (LOG_REGISTERS)
|
||||
logerror("%08X:banshee_vga_r(%X)\n", cpu_get_pc(device->machine->activecpu), 0x300+offset);
|
||||
logerror("%s:banshee_vga_r(%X)\n", cpuexec_describe_context(device->machine), 0x300+offset);
|
||||
break;
|
||||
}
|
||||
return result;
|
||||
@ -4103,7 +4103,7 @@ READ32_DEVICE_HANDLER( banshee_io_r )
|
||||
case io_dacData:
|
||||
result = v->fbi.clut[v->banshee.io[io_dacAddr] & 0x1ff] = v->banshee.io[offset];
|
||||
if (LOG_REGISTERS)
|
||||
logerror("%08X:banshee_dac_r(%X)\n", cpu_get_pc(device->machine->activecpu), v->banshee.io[io_dacAddr] & 0x1ff);
|
||||
logerror("%s:banshee_dac_r(%X)\n", cpuexec_describe_context(device->machine), v->banshee.io[io_dacAddr] & 0x1ff);
|
||||
break;
|
||||
|
||||
case io_vgab0: case io_vgab4: case io_vgab8: case io_vgabc:
|
||||
@ -4123,7 +4123,7 @@ READ32_DEVICE_HANDLER( banshee_io_r )
|
||||
default:
|
||||
result = v->banshee.io[offset];
|
||||
if (LOG_REGISTERS)
|
||||
logerror("%08X:banshee_io_r(%s)\n", cpu_get_pc(device->machine->activecpu), banshee_io_reg_name[offset]);
|
||||
logerror("%s:banshee_io_r(%s)\n", cpuexec_describe_context(device->machine), banshee_io_reg_name[offset]);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -4133,7 +4133,7 @@ READ32_DEVICE_HANDLER( banshee_io_r )
|
||||
|
||||
READ32_DEVICE_HANDLER( banshee_rom_r )
|
||||
{
|
||||
logerror("%08X:banshee_rom_r(%X)\n", cpu_get_pc(device->machine->activecpu), offset*4);
|
||||
logerror("%s:banshee_rom_r(%X)\n", cpuexec_describe_context(device->machine), offset*4);
|
||||
return 0xffffffff;
|
||||
}
|
||||
|
||||
@ -4227,7 +4227,7 @@ static WRITE32_DEVICE_HANDLER( banshee_agp_w )
|
||||
}
|
||||
|
||||
if (LOG_REGISTERS)
|
||||
logerror("%08X:banshee_w(AGP:%s) = %08X & %08X\n", cpu_get_pc(device->machine->activecpu), banshee_agp_reg_name[offset], data, mem_mask);
|
||||
logerror("%s:banshee_w(AGP:%s) = %08X & %08X\n", cpuexec_describe_context(device->machine), banshee_agp_reg_name[offset], data, mem_mask);
|
||||
}
|
||||
|
||||
|
||||
@ -4244,15 +4244,15 @@ WRITE32_DEVICE_HANDLER( banshee_w )
|
||||
else if (offset < 0x100000/4)
|
||||
banshee_agp_w(device, offset, data, mem_mask);
|
||||
else if (offset < 0x200000/4)
|
||||
logerror("%08X:banshee_w(2D:%X) = %08X & %08X\n", cpu_get_pc(device->machine->activecpu), (offset*4) & 0xfffff, data, mem_mask);
|
||||
logerror("%s:banshee_w(2D:%X) = %08X & %08X\n", cpuexec_describe_context(device->machine), (offset*4) & 0xfffff, data, mem_mask);
|
||||
else if (offset < 0x600000/4)
|
||||
register_w(v, offset & 0x1fffff/4, data);
|
||||
else if (offset < 0x800000/4)
|
||||
logerror("%08X:banshee_w(TEX:%X) = %08X & %08X\n", cpu_get_pc(device->machine->activecpu), (offset*4) & 0x1fffff, data, mem_mask);
|
||||
logerror("%s:banshee_w(TEX:%X) = %08X & %08X\n", cpuexec_describe_context(device->machine), (offset*4) & 0x1fffff, data, mem_mask);
|
||||
else if (offset < 0xc00000/4)
|
||||
logerror("%08X:banshee_w(RES:%X) = %08X & %08X\n", cpu_get_pc(device->machine->activecpu), (offset*4) & 0x3fffff, data, mem_mask);
|
||||
logerror("%s:banshee_w(RES:%X) = %08X & %08X\n", cpuexec_describe_context(device->machine), (offset*4) & 0x3fffff, data, mem_mask);
|
||||
else if (offset < 0x1000000/4)
|
||||
logerror("%08X:banshee_w(YUV:%X) = %08X & %08X\n", cpu_get_pc(device->machine->activecpu), (offset*4) & 0x3fffff, data, mem_mask);
|
||||
logerror("%s:banshee_w(YUV:%X) = %08X & %08X\n", cpuexec_describe_context(device->machine), (offset*4) & 0x3fffff, data, mem_mask);
|
||||
else if (offset < 0x2000000/4)
|
||||
{
|
||||
UINT8 temp = v->fbi.lfb_stride;
|
||||
@ -4282,7 +4282,7 @@ WRITE32_DEVICE_HANDLER( banshee_fb_w )
|
||||
{
|
||||
if (offset*4 <= v->fbi.mask)
|
||||
COMBINE_DATA(&((UINT32 *)v->fbi.ram)[offset]);
|
||||
logerror("%08X:banshee_fb_w(%X) = %08X & %08X\n", cpu_get_pc(device->machine->activecpu), offset*4, data, mem_mask);
|
||||
logerror("%s:banshee_fb_w(%X) = %08X & %08X\n", cpuexec_describe_context(device->machine), offset*4, data, mem_mask);
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -4305,14 +4305,14 @@ static WRITE8_DEVICE_HANDLER( banshee_vga_w )
|
||||
{
|
||||
v->banshee.vga[0x3c1 & 0x1f] = data;
|
||||
if (LOG_REGISTERS)
|
||||
logerror("%08X:banshee_vga_w(%X) = %02X\n", cpu_get_pc(device->machine->activecpu), 0x3c0+offset, data);
|
||||
logerror("%s:banshee_vga_w(%X) = %02X\n", cpuexec_describe_context(device->machine), 0x3c0+offset, data);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (v->banshee.vga[0x3c1 & 0x1f] < ARRAY_LENGTH(v->banshee.att))
|
||||
v->banshee.att[v->banshee.vga[0x3c1 & 0x1f]] = data;
|
||||
if (LOG_REGISTERS)
|
||||
logerror("%08X:banshee_att_w(%X) = %02X\n", cpu_get_pc(device->machine->activecpu), v->banshee.vga[0x3c1 & 0x1f], data);
|
||||
logerror("%s:banshee_att_w(%X) = %02X\n", cpuexec_describe_context(device->machine), v->banshee.vga[0x3c1 & 0x1f], data);
|
||||
}
|
||||
v->banshee.attff ^= 1;
|
||||
break;
|
||||
@ -4322,7 +4322,7 @@ static WRITE8_DEVICE_HANDLER( banshee_vga_w )
|
||||
if (v->banshee.vga[0x3c4 & 0x1f] < ARRAY_LENGTH(v->banshee.seq))
|
||||
v->banshee.seq[v->banshee.vga[0x3c4 & 0x1f]] = data;
|
||||
if (LOG_REGISTERS)
|
||||
logerror("%08X:banshee_seq_w(%X) = %02X\n", cpu_get_pc(device->machine->activecpu), v->banshee.vga[0x3c4 & 0x1f], data);
|
||||
logerror("%s:banshee_seq_w(%X) = %02X\n", cpuexec_describe_context(device->machine), v->banshee.vga[0x3c4 & 0x1f], data);
|
||||
break;
|
||||
|
||||
/* Graphics controller access */
|
||||
@ -4330,7 +4330,7 @@ static WRITE8_DEVICE_HANDLER( banshee_vga_w )
|
||||
if (v->banshee.vga[0x3ce & 0x1f] < ARRAY_LENGTH(v->banshee.gc))
|
||||
v->banshee.gc[v->banshee.vga[0x3ce & 0x1f]] = data;
|
||||
if (LOG_REGISTERS)
|
||||
logerror("%08X:banshee_gc_w(%X) = %02X\n", cpu_get_pc(device->machine->activecpu), v->banshee.vga[0x3ce & 0x1f], data);
|
||||
logerror("%s:banshee_gc_w(%X) = %02X\n", cpuexec_describe_context(device->machine), v->banshee.vga[0x3ce & 0x1f], data);
|
||||
break;
|
||||
|
||||
/* CRTC access */
|
||||
@ -4338,13 +4338,13 @@ static WRITE8_DEVICE_HANDLER( banshee_vga_w )
|
||||
if (v->banshee.vga[0x3d4 & 0x1f] < ARRAY_LENGTH(v->banshee.crtc))
|
||||
v->banshee.crtc[v->banshee.vga[0x3d4 & 0x1f]] = data;
|
||||
if (LOG_REGISTERS)
|
||||
logerror("%08X:banshee_crtc_w(%X) = %02X\n", cpu_get_pc(device->machine->activecpu), v->banshee.vga[0x3d4 & 0x1f], data);
|
||||
logerror("%s:banshee_crtc_w(%X) = %02X\n", cpuexec_describe_context(device->machine), v->banshee.vga[0x3d4 & 0x1f], data);
|
||||
break;
|
||||
|
||||
default:
|
||||
v->banshee.vga[offset] = data;
|
||||
if (LOG_REGISTERS)
|
||||
logerror("%08X:banshee_vga_w(%X) = %02X\n", cpu_get_pc(device->machine->activecpu), 0x3c0+offset, data);
|
||||
logerror("%s:banshee_vga_w(%X) = %02X\n", cpuexec_describe_context(device->machine), 0x3c0+offset, data);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -4366,7 +4366,7 @@ WRITE32_DEVICE_HANDLER( banshee_io_w )
|
||||
if ((v->banshee.io[offset] ^ old) & 0x2800)
|
||||
v->fbi.clut_dirty = TRUE;
|
||||
if (LOG_REGISTERS)
|
||||
logerror("%08X:banshee_io_w(%s) = %08X & %08X\n", cpu_get_pc(device->machine->activecpu), banshee_io_reg_name[offset], data, mem_mask);
|
||||
logerror("%s:banshee_io_w(%s) = %08X & %08X\n", cpuexec_describe_context(device->machine), banshee_io_reg_name[offset], data, mem_mask);
|
||||
break;
|
||||
|
||||
case io_dacData:
|
||||
@ -4377,14 +4377,14 @@ WRITE32_DEVICE_HANDLER( banshee_io_w )
|
||||
v->fbi.clut_dirty = TRUE;
|
||||
}
|
||||
if (LOG_REGISTERS)
|
||||
logerror("%08X:banshee_dac_w(%X) = %08X & %08X\n", cpu_get_pc(device->machine->activecpu), v->banshee.io[io_dacAddr] & 0x1ff, data, mem_mask);
|
||||
logerror("%s:banshee_dac_w(%X) = %08X & %08X\n", cpuexec_describe_context(device->machine), v->banshee.io[io_dacAddr] & 0x1ff, data, mem_mask);
|
||||
break;
|
||||
|
||||
case io_miscInit0:
|
||||
COMBINE_DATA(&v->banshee.io[offset]);
|
||||
v->fbi.yorigin = (data >> 18) & 0xfff;
|
||||
if (LOG_REGISTERS)
|
||||
logerror("%08X:banshee_io_w(%s) = %08X & %08X\n", cpu_get_pc(device->machine->activecpu), banshee_io_reg_name[offset], data, mem_mask);
|
||||
logerror("%s:banshee_io_w(%s) = %08X & %08X\n", cpuexec_describe_context(device->machine), banshee_io_reg_name[offset], data, mem_mask);
|
||||
break;
|
||||
|
||||
case io_vidScreenSize:
|
||||
@ -4398,14 +4398,14 @@ WRITE32_DEVICE_HANDLER( banshee_io_w )
|
||||
video_screen_set_visarea(v->screen, 0, v->fbi.width - 1, 0, v->fbi.height - 1);
|
||||
adjust_vblank_timer(v);
|
||||
if (LOG_REGISTERS)
|
||||
logerror("%08X:banshee_io_w(%s) = %08X & %08X\n", cpu_get_pc(device->machine->activecpu), banshee_io_reg_name[offset], data, mem_mask);
|
||||
logerror("%s:banshee_io_w(%s) = %08X & %08X\n", cpuexec_describe_context(device->machine), banshee_io_reg_name[offset], data, mem_mask);
|
||||
break;
|
||||
|
||||
case io_lfbMemoryConfig:
|
||||
v->fbi.lfb_base = (data & 0x1fff) << 10;
|
||||
v->fbi.lfb_stride = ((data >> 13) & 7) + 9;
|
||||
if (LOG_REGISTERS)
|
||||
logerror("%08X:banshee_io_w(%s) = %08X & %08X\n", cpu_get_pc(device->machine->activecpu), banshee_io_reg_name[offset], data, mem_mask);
|
||||
logerror("%s:banshee_io_w(%s) = %08X & %08X\n", cpuexec_describe_context(device->machine), banshee_io_reg_name[offset], data, mem_mask);
|
||||
break;
|
||||
|
||||
case io_vgab0: case io_vgab4: case io_vgab8: case io_vgabc:
|
||||
@ -4424,7 +4424,7 @@ WRITE32_DEVICE_HANDLER( banshee_io_w )
|
||||
default:
|
||||
COMBINE_DATA(&v->banshee.io[offset]);
|
||||
if (LOG_REGISTERS)
|
||||
logerror("%08X:banshee_io_w(%s) = %08X & %08X\n", cpu_get_pc(device->machine->activecpu), banshee_io_reg_name[offset], data, mem_mask);
|
||||
logerror("%s:banshee_io_w(%s) = %08X & %08X\n", cpuexec_describe_context(device->machine), banshee_io_reg_name[offset], data, mem_mask);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -4432,11 +4432,11 @@ WRITE32_DEVICE_HANDLER( banshee_io_w )
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
DEVICE INTERFACE
|
||||
DEVICE INTERFACE
|
||||
***************************************************************************/
|
||||
|
||||
/*-------------------------------------------------
|
||||
device start callback
|
||||
device start callback
|
||||
-------------------------------------------------*/
|
||||
|
||||
static DEVICE_START( voodoo )
|
||||
@ -4456,6 +4456,7 @@ static DEVICE_START( voodoo )
|
||||
|
||||
/* validate configuration */
|
||||
assert(config->screen != NULL);
|
||||
assert(config->cputag != NULL);
|
||||
assert(config->type >= VOODOO_1 && config->type < MAX_VOODOO_TYPES);
|
||||
assert(config->fbmem > 0);
|
||||
assert(config->type >= VOODOO_BANSHEE || config->tmumem0 > 0);
|
||||
@ -4539,8 +4540,10 @@ static DEVICE_START( voodoo )
|
||||
|
||||
/* set the type, and initialize the chip mask */
|
||||
v->index = device_list_index(device->machine->config->devicelist, device->type, device->tag);
|
||||
v->screen = device_list_find_by_tag(device->machine->config->devicelist, VIDEO_SCREEN, config->screen);
|
||||
v->screen = devtag_get_device(device->machine, VIDEO_SCREEN, config->screen);
|
||||
assert_always(v->screen != NULL, "Unable to find screen attached to voodoo");
|
||||
v->cpu = cputag_get_cpu(device->machine, config->cputag);
|
||||
assert_always(v->cpu != NULL, "Unable to find CPU attached to voodoo");
|
||||
v->type = config->type;
|
||||
v->chipmask = 0x01;
|
||||
v->attoseconds_per_cycle = ATTOSECONDS_PER_SECOND / v->freq;
|
||||
@ -4617,7 +4620,7 @@ static DEVICE_START( voodoo )
|
||||
|
||||
|
||||
/*-------------------------------------------------
|
||||
device exit callback
|
||||
device exit callback
|
||||
-------------------------------------------------*/
|
||||
|
||||
static DEVICE_STOP( voodoo )
|
||||
@ -4631,7 +4634,7 @@ static DEVICE_STOP( voodoo )
|
||||
|
||||
|
||||
/*-------------------------------------------------
|
||||
device reset callback
|
||||
device reset callback
|
||||
-------------------------------------------------*/
|
||||
|
||||
static DEVICE_RESET( voodoo )
|
||||
@ -4642,7 +4645,7 @@ static DEVICE_RESET( voodoo )
|
||||
|
||||
|
||||
/*-------------------------------------------------
|
||||
device set info callback
|
||||
device set info callback
|
||||
-------------------------------------------------*/
|
||||
|
||||
static DEVICE_SET_INFO( voodoo )
|
||||
@ -4655,7 +4658,7 @@ static DEVICE_SET_INFO( voodoo )
|
||||
|
||||
|
||||
/*-------------------------------------------------
|
||||
device get info callback
|
||||
device get info callback
|
||||
-------------------------------------------------*/
|
||||
|
||||
DEVICE_GET_INFO( voodoo )
|
||||
|
@ -45,6 +45,7 @@ struct _voodoo_config
|
||||
UINT8 tmumem0;
|
||||
UINT8 tmumem1;
|
||||
const char * screen;
|
||||
const char * cputag;
|
||||
voodoo_vblank_func vblank;
|
||||
voodoo_stall_func stall;
|
||||
};
|
||||
@ -83,6 +84,9 @@ struct _voodoo_config
|
||||
#define MDRV_3DFX_VOODOO_STALL(_stall) \
|
||||
MDRV_DEVICE_CONFIG_DATAPTR(voodoo_config, stall, _stall)
|
||||
|
||||
#define MDRV_3DFX_VOODOO_CPU(_cputag) \
|
||||
MDRV_DEVICE_CONFIG_DATAPTR(voodoo_config, cputag, _cputag)
|
||||
|
||||
#define MDRV_3DFX_VOODOO_MODIFY(_tag) \
|
||||
MDRV_DEVICE_MODIFY(_tag, VOODOO_GRAPHICS)
|
||||
|
||||
|
@ -461,13 +461,11 @@ static void update_control_lines(running_machine *machine)
|
||||
}
|
||||
|
||||
/* set the IOF input lines */
|
||||
cpu_push_context(cage_cpu);
|
||||
val = cpu_get_reg(cage_cpu, TMS32031_IOF);
|
||||
val &= ~0x88;
|
||||
if (cpu_to_cage_ready) val |= 0x08;
|
||||
if (cage_to_cpu_ready) val |= 0x80;
|
||||
cpu_set_reg(cage_cpu, TMS32031_IOF, val);
|
||||
cpu_pop_context();
|
||||
}
|
||||
|
||||
|
||||
@ -513,7 +511,7 @@ static READ32_HANDLER( cage_io_status_r )
|
||||
UINT16 main_from_cage_r(const address_space *space)
|
||||
{
|
||||
if (LOG_COMM)
|
||||
logerror("%06X:main read data = %04X\n", cpu_get_pc(space->machine->activecpu), soundlatch_word_r(space, 0, 0));
|
||||
logerror("%s:main read data = %04X\n", cpuexec_describe_context(space->machine), soundlatch_word_r(space, 0, 0));
|
||||
cage_to_cpu_ready = 0;
|
||||
update_control_lines(space->machine);
|
||||
return soundlatch_word_r(space, 0, 0xffff);
|
||||
@ -532,7 +530,7 @@ static TIMER_CALLBACK( deferred_cage_w )
|
||||
void main_to_cage_w(UINT16 data)
|
||||
{
|
||||
if (LOG_COMM)
|
||||
logerror("%06X:Command to CAGE = %04X\n", cpu_get_pc(Machine->activecpu), data);
|
||||
logerror("%s:Command to CAGE = %04X\n", cpuexec_describe_context(Machine), data);
|
||||
timer_call_after_resynch(Machine, NULL, data, deferred_cage_w);
|
||||
}
|
||||
|
||||
|
@ -1414,18 +1414,15 @@ WRITE32_HANDLER( dsio_idma_addr_w )
|
||||
{
|
||||
if (LOG_DCS_TRANSFERS)
|
||||
logerror("%08X:IDMA_addr = %04X\n", cpu_get_pc(space->cpu), data);
|
||||
cpu_push_context(dcs.cpu);
|
||||
adsp2181_idma_addr_w(dcs.cpu, data);
|
||||
if (data == 0)
|
||||
dsio.start_on_next_write = 2;
|
||||
cpu_pop_context();
|
||||
}
|
||||
|
||||
|
||||
WRITE32_HANDLER( dsio_idma_data_w )
|
||||
{
|
||||
UINT32 pc = cpu_get_pc(space->cpu);
|
||||
cpu_push_context(dcs.cpu);
|
||||
if (ACCESSING_BITS_0_15)
|
||||
{
|
||||
if (LOG_DCS_TRANSFERS)
|
||||
@ -1438,7 +1435,6 @@ WRITE32_HANDLER( dsio_idma_data_w )
|
||||
logerror("%08X:IDMA_data_w(%04X) = %04X\n", pc, adsp2181_idma_addr_r(dcs.cpu), data >> 16);
|
||||
adsp2181_idma_data_w(dcs.cpu, data >> 16);
|
||||
}
|
||||
cpu_pop_context();
|
||||
if (dsio.start_on_next_write && --dsio.start_on_next_write == 0)
|
||||
{
|
||||
logerror("Starting DSIO CPU\n");
|
||||
@ -1450,9 +1446,7 @@ WRITE32_HANDLER( dsio_idma_data_w )
|
||||
READ32_HANDLER( dsio_idma_data_r )
|
||||
{
|
||||
UINT32 result;
|
||||
cpu_push_context(dcs.cpu);
|
||||
result = adsp2181_idma_data_r(dcs.cpu);
|
||||
cpu_pop_context();
|
||||
if (LOG_DCS_TRANSFERS)
|
||||
logerror("%08X:IDMA_data_r(%04X) = %04X\n", cpu_get_pc(space->cpu), adsp2181_idma_addr_r(dcs.cpu), result);
|
||||
return result;
|
||||
@ -1492,7 +1486,7 @@ void dcs_reset_w(int state)
|
||||
/* going high halts the CPU */
|
||||
if (state)
|
||||
{
|
||||
logerror("%08x: DCS reset = %d\n", safe_cpu_get_pc(Machine->activecpu), state);
|
||||
logerror("%s: DCS reset = %d\n", cpuexec_describe_context(Machine), state);
|
||||
|
||||
/* just run through the init code again */
|
||||
timer_call_after_resynch(Machine, NULL, 0, dcs_reset);
|
||||
@ -1537,7 +1531,7 @@ static READ16_HANDLER( fifo_input_r )
|
||||
static void dcs_delayed_data_w(running_machine *machine, int data)
|
||||
{
|
||||
if (LOG_DCS_IO)
|
||||
logerror("%08X:dcs_data_w(%04X)\n", cpu_get_pc(machine->activecpu), data);
|
||||
logerror("%s:dcs_data_w(%04X)\n", cpuexec_describe_context(machine), data);
|
||||
|
||||
/* boost the interleave temporarily */
|
||||
cpuexec_boost_interleave(machine, ATTOTIME_IN_NSEC(500), ATTOTIME_IN_USEC(5));
|
||||
@ -1643,7 +1637,7 @@ int dcs_data_r(void)
|
||||
delayed_ack_w();
|
||||
|
||||
if (LOG_DCS_IO)
|
||||
logerror("%08X:dcs_data_r(%04X)\n", cpu_get_pc(Machine->activecpu), dcs.output_data);
|
||||
logerror("%s:dcs_data_r(%04X)\n", cpuexec_describe_context(Machine), dcs.output_data);
|
||||
return dcs.output_data;
|
||||
}
|
||||
|
||||
@ -1755,7 +1749,6 @@ static void reset_timer(running_machine *machine)
|
||||
{
|
||||
/* Road Burners: @ 28: JMP $0032 18032F, same code at $32 */
|
||||
|
||||
cpu_push_context(dcs.cpu);
|
||||
if (memory_read_dword(dcs.program, 0x18*4) == 0x0c0030 && /* ENA SEC_REG */
|
||||
memory_read_dword(dcs.program, 0x19*4) == 0x804828 && /* SI = DM($0482) */
|
||||
memory_read_dword(dcs.program, 0x1a*4) == 0x904828 && /* DM($0482) = SI */
|
||||
@ -1764,7 +1757,6 @@ static void reset_timer(running_machine *machine)
|
||||
{
|
||||
dcs.timer_ignore = TRUE;
|
||||
}
|
||||
cpu_pop_context();
|
||||
}
|
||||
|
||||
/* adjust the timer if not optimized */
|
||||
@ -1929,13 +1921,11 @@ static TIMER_CALLBACK( dcs_irq )
|
||||
INT16 buffer[0x400];
|
||||
int i;
|
||||
|
||||
cpu_push_context(dcs.cpu);
|
||||
for (i = 0; i < count; i++)
|
||||
{
|
||||
buffer[i] = memory_read_word(dcs.data, reg * 2);
|
||||
reg += dcs.incs;
|
||||
}
|
||||
cpu_pop_context();
|
||||
|
||||
if (dcs.channels)
|
||||
dmadac_transfer(0, dcs.channels, 1, dcs.channels, (dcs.size / 2) / dcs.channels, buffer);
|
||||
@ -2128,7 +2118,7 @@ static int preprocess_stage_1(running_machine *machine, UINT16 data)
|
||||
if (data == 0x001a)
|
||||
{
|
||||
if (LOG_DCS_TRANSFERS)
|
||||
logerror("%08X:DCS Transfer command %04X\n", cpu_get_pc(machine->activecpu), data);
|
||||
logerror("%s:DCS Transfer command %04X\n", cpuexec_describe_context(machine), data);
|
||||
transfer.state++;
|
||||
if (transfer.hle_enabled)
|
||||
return 1;
|
||||
@ -2138,7 +2128,7 @@ static int preprocess_stage_1(running_machine *machine, UINT16 data)
|
||||
else if (data == 0x002a)
|
||||
{
|
||||
if (LOG_DCS_TRANSFERS)
|
||||
logerror("%08X:DCS State change %04X\n", cpu_get_pc(machine->activecpu), data);
|
||||
logerror("%s:DCS State change %04X\n", cpuexec_describe_context(machine), data);
|
||||
transfer.dcs_state = 1;
|
||||
}
|
||||
|
||||
@ -2219,7 +2209,6 @@ static int preprocess_stage_1(running_machine *machine, UINT16 data)
|
||||
if (transfer.hle_enabled)
|
||||
{
|
||||
/* write the new data to memory */
|
||||
cpu_push_context(dcs.cpu);
|
||||
if (transfer.type == 0)
|
||||
{
|
||||
if (transfer.writes_left & 1)
|
||||
@ -2229,7 +2218,6 @@ static int preprocess_stage_1(running_machine *machine, UINT16 data)
|
||||
}
|
||||
else
|
||||
memory_write_word(dcs.data, transfer.start++ * 2, data);
|
||||
cpu_pop_context();
|
||||
|
||||
/* if we're done, start a timer to send the response words */
|
||||
if (transfer.state == 0)
|
||||
@ -2266,7 +2254,7 @@ static int preprocess_stage_2(running_machine *machine, UINT16 data)
|
||||
if (data == 0x55d0 || data == 0x55d1)
|
||||
{
|
||||
if (LOG_DCS_TRANSFERS)
|
||||
logerror("%08X:DCS Transfer command %04X\n", cpu_get_pc(machine->activecpu), data);
|
||||
logerror("%s:DCS Transfer command %04X\n", cpuexec_describe_context(machine), data);
|
||||
transfer.state++;
|
||||
if (transfer.hle_enabled)
|
||||
return 1;
|
||||
@ -2276,7 +2264,7 @@ static int preprocess_stage_2(running_machine *machine, UINT16 data)
|
||||
else
|
||||
{
|
||||
if (LOG_DCS_TRANSFERS)
|
||||
logerror("%08X:Command: %04X\n", cpu_get_pc(machine->activecpu), data);
|
||||
logerror("%s:Command: %04X\n", cpuexec_describe_context(machine), data);
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -1115,7 +1115,7 @@ static READ8_DEVICE_HANDLER( dkong_tune_r )
|
||||
}
|
||||
else
|
||||
{
|
||||
/* printf("rom access at pc = %4x\n",cpu_get_pc(machine->activecpu)); */
|
||||
/* printf("%s:rom access\n",cpuexec_describe_context(device->machine)); */
|
||||
return (state->snd_rom[0x1000+(page & 7)*256+offset]);
|
||||
}
|
||||
}
|
||||
|
@ -420,11 +420,11 @@ static void r6532_portb_w(const device_config *device, UINT8 newdata, UINT8 oldd
|
||||
if ((olddata & 0x01) && !(newdata & 0x01))
|
||||
{
|
||||
riot6532_porta_in_set(riot, tms5220_status_r(space, 0), 0xff);
|
||||
logerror("(%f)%04X:TMS5220 status read = %02X\n", attotime_to_double(timer_get_time(device->machine)), cpu_get_previouspc(device->machine->activecpu), tms5220_status_r(space, 0));
|
||||
logerror("(%f)%s:TMS5220 status read = %02X\n", attotime_to_double(timer_get_time(device->machine)), cpuexec_describe_context(device->machine), tms5220_status_r(space, 0));
|
||||
}
|
||||
if ((olddata & 0x02) && !(newdata & 0x02))
|
||||
{
|
||||
logerror("(%f)%04X:TMS5220 data write = %02X\n", attotime_to_double(timer_get_time(device->machine)), cpu_get_previouspc(device->machine->activecpu), riot6532_porta_out_get(riot));
|
||||
logerror("(%f)%s:TMS5220 data write = %02X\n", attotime_to_double(timer_get_time(device->machine)), cpuexec_describe_context(device->machine), riot6532_porta_out_get(riot));
|
||||
tms5220_data_w(space, 0, riot6532_porta_out_get(riot));
|
||||
}
|
||||
}
|
||||
|
@ -258,20 +258,14 @@ WRITE16_HANDLER( hdsnd68k_320ram_w )
|
||||
READ16_HANDLER( hdsnd68k_320ports_r )
|
||||
{
|
||||
const address_space *iospace = cpu_get_address_space(hdcpu_sounddsp, ADDRESS_SPACE_IO);
|
||||
UINT16 result;
|
||||
cpu_push_context(iospace->cpu);
|
||||
result = memory_read_word(iospace, (offset & 7) << 1);
|
||||
cpu_pop_context();
|
||||
return result;
|
||||
return memory_read_word(iospace, (offset & 7) << 1);
|
||||
}
|
||||
|
||||
|
||||
WRITE16_HANDLER( hdsnd68k_320ports_w )
|
||||
{
|
||||
const address_space *iospace = cpu_get_address_space(hdcpu_sounddsp, ADDRESS_SPACE_IO);
|
||||
cpu_push_context(hdcpu_sounddsp);
|
||||
memory_write_word(iospace, (offset & 7) << 1, data);
|
||||
cpu_pop_context();
|
||||
}
|
||||
|
||||
|
||||
|
@ -377,7 +377,6 @@ static void leland_80186_dma_update(void *param, stream_sample_t **inputs, strea
|
||||
memset(buffer, 0, length * sizeof(*buffer));
|
||||
|
||||
/* loop over DMA buffers */
|
||||
cpu_push_context(dmaspace->cpu);
|
||||
for (i = 0; i < 2; i++)
|
||||
{
|
||||
struct dma_state *d = &i80186.dma[i];
|
||||
@ -447,7 +446,6 @@ static void leland_80186_dma_update(void *param, stream_sample_t **inputs, strea
|
||||
}
|
||||
}
|
||||
}
|
||||
cpu_pop_context();
|
||||
}
|
||||
|
||||
|
||||
@ -614,12 +612,12 @@ void leland_80186_sound_init(void)
|
||||
*
|
||||
*************************************/
|
||||
|
||||
static IRQ_CALLBACK(int_callback)
|
||||
static IRQ_CALLBACK( int_callback )
|
||||
{
|
||||
if (LOG_INTERRUPTS) logerror("(%f) **** Acknowledged interrupt vector %02X\n", attotime_to_double(timer_get_time(device->machine)), i80186.intr.poll_status & 0x1f);
|
||||
|
||||
/* clear the interrupt */
|
||||
cpu_set_info_int(device->machine->activecpu, CPUINFO_INT_INPUT_STATE + 0, CLEAR_LINE);
|
||||
cpu_set_info_int(device, CPUINFO_INT_INPUT_STATE + 0, CLEAR_LINE);
|
||||
i80186.intr.pending = 0;
|
||||
|
||||
/* clear the request and set the in-service bit */
|
||||
@ -752,7 +750,7 @@ static void handle_eoi(running_machine *machine, int data)
|
||||
case 0x0d: i80186.intr.in_service &= ~0x20; break;
|
||||
case 0x0e: i80186.intr.in_service &= ~0x40; break;
|
||||
case 0x0f: i80186.intr.in_service &= ~0x80; break;
|
||||
default: logerror("%05X:ERROR - 80186 EOI with unknown vector %02X\n", cpu_get_pc(machine->activecpu), data & 0x1f);
|
||||
default: logerror("%s:ERROR - 80186 EOI with unknown vector %02X\n", cpuexec_describe_context(machine), data & 0x1f);
|
||||
}
|
||||
if (LOG_INTERRUPTS) logerror("(%f) **** Got EOI for vector %02X\n", attotime_to_double(timer_get_time(machine)), data & 0x1f);
|
||||
}
|
||||
@ -1709,7 +1707,7 @@ WRITE8_HANDLER( leland_80186_control_w )
|
||||
|
||||
static TIMER_CALLBACK( command_lo_sync )
|
||||
{
|
||||
if (LOG_COMM) logerror("%04X:Write sound command latch lo = %02X\n", cpu_get_previouspc(machine->activecpu), param);
|
||||
if (LOG_COMM) logerror("%s:Write sound command latch lo = %02X\n", cpuexec_describe_context(machine), param);
|
||||
sound_command = (sound_command & 0xff00) | param;
|
||||
}
|
||||
|
||||
|
@ -67,7 +67,7 @@ void meadows_sh_update(running_machine *machine)
|
||||
/* amplitude is a combination of the upper 4 bits of 0c01 */
|
||||
/* and bit 4 merged from S2650's flag output */
|
||||
amp = ((meadows_0c03 & ENABLE_CTR1) == 0) ? 0 : (meadows_0c01 & 0xf0) >> 1;
|
||||
if( cpu_get_reg(machine->activecpu, S2650_FO) )
|
||||
if( cpu_get_reg(machine->cpu[0], S2650_FO) )
|
||||
amp += 0x80;
|
||||
/* calculate frequency for counter #1 */
|
||||
/* bit 0..3 of 0c01 are ctr preset */
|
||||
|
@ -219,7 +219,7 @@ static UINT8 alg_cia_0_porta_r(const device_config *device)
|
||||
|
||||
static UINT8 alg_cia_0_portb_r(const device_config *device)
|
||||
{
|
||||
logerror("%06x:alg_cia_0_portb_r\n", cpu_get_pc(device->machine->activecpu));
|
||||
logerror("%s:alg_cia_0_portb_r\n", cpuexec_describe_context(device->machine));
|
||||
return 0xff;
|
||||
}
|
||||
|
||||
@ -227,20 +227,20 @@ static UINT8 alg_cia_0_portb_r(const device_config *device)
|
||||
static void alg_cia_0_portb_w(const device_config *device, UINT8 data)
|
||||
{
|
||||
/* parallel port */
|
||||
logerror("%06x:alg_cia_0_portb_w(%02x)\n", cpu_get_pc(device->machine->activecpu), data);
|
||||
logerror("%s:alg_cia_0_portb_w(%02x)\n", cpuexec_describe_context(device->machine), data);
|
||||
}
|
||||
|
||||
|
||||
static UINT8 alg_cia_1_porta_r(const device_config *device)
|
||||
{
|
||||
logerror("%06x:alg_cia_1_porta_r\n", cpu_get_pc(device->machine->activecpu));
|
||||
logerror("%s:alg_cia_1_porta_r\n", cpuexec_describe_context(device->machine));
|
||||
return 0xff;
|
||||
}
|
||||
|
||||
|
||||
static void alg_cia_1_porta_w(const device_config *device, UINT8 data)
|
||||
{
|
||||
logerror("%06x:alg_cia_1_porta_w(%02x)\n", cpu_get_pc(device->machine->activecpu), data);
|
||||
logerror("%s:alg_cia_1_porta_w(%02x)\n", cpuexec_describe_context(device->machine), data);
|
||||
}
|
||||
|
||||
|
||||
|
@ -409,9 +409,9 @@ INLINE UINT8* blitter_get_addr(running_machine *machine, UINT32 addr)
|
||||
The Flare One blitter is a simpler design with slightly different parameters
|
||||
and will require hardware tests to figure everything out correctly.
|
||||
*/
|
||||
static void RunBlit(running_machine *machine)
|
||||
static void RunBlit(const address_space *space)
|
||||
{
|
||||
#define BLITPRG_READ(x) blitter.x = *(blitter_get_addr(machine, blitter.program.addr++))
|
||||
#define BLITPRG_READ(x) blitter.x = *(blitter_get_addr(space->machine, blitter.program.addr++))
|
||||
|
||||
int cycles_used = 0;
|
||||
|
||||
@ -439,7 +439,7 @@ static void RunBlit(running_machine *machine)
|
||||
/* This debug is now wrong ! */
|
||||
if (DEBUG_BLITTER)
|
||||
{
|
||||
mame_printf_debug("\nBlitter (%x): Running command from 0x%.5x\n\n", cpu_get_previouspc(machine->activecpu), blitter.program.addr - 12);
|
||||
mame_printf_debug("\n%s:Blitter: Running command from 0x%.5x\n\n", cpuexec_describe_context(device->machine), blitter.program.addr - 12);
|
||||
mame_printf_debug("Command Reg %.2x", blitter.command);
|
||||
mame_printf_debug(" %s %s %s %s %s %s %s\n",
|
||||
blitter.command & CMD_RUN ? "RUN" : " ",
|
||||
@ -521,7 +521,7 @@ static void RunBlit(running_machine *machine)
|
||||
blitter.source.addr0 -=blitter.step;
|
||||
}
|
||||
|
||||
*blitter_get_addr(machine, blitter.dest.addr) = blitter.pattern;
|
||||
*blitter_get_addr(space->machine, blitter.dest.addr) = blitter.pattern;
|
||||
cycles_used++;
|
||||
|
||||
} while (--innercnt);
|
||||
@ -535,7 +535,7 @@ static void RunBlit(running_machine *machine)
|
||||
|
||||
if (LOOPTYPE == 3 && innercnt == blitter.innercnt)
|
||||
{
|
||||
srcdata = *(blitter_get_addr(machine, blitter.source.addr & 0xfffff));
|
||||
srcdata = *(blitter_get_addr(space->machine, blitter.source.addr & 0xfffff));
|
||||
blitter.source.loword++;
|
||||
cycles_used++;
|
||||
}
|
||||
@ -545,7 +545,7 @@ static void RunBlit(running_machine *machine)
|
||||
{
|
||||
if (LOOPTYPE == 0 || LOOPTYPE == 1)
|
||||
{
|
||||
srcdata = *(blitter_get_addr(machine, blitter.source.addr & 0xfffff));
|
||||
srcdata = *(blitter_get_addr(space->machine, blitter.source.addr & 0xfffff));
|
||||
cycles_used++;
|
||||
|
||||
if (blitter.modectl & MODE_SSIGN)
|
||||
@ -560,7 +560,7 @@ static void RunBlit(running_machine *machine)
|
||||
/* Read destination pixel? */
|
||||
if (LOOPTYPE == 0)
|
||||
{
|
||||
dstdata = *blitter_get_addr(machine, blitter.dest.addr & 0xfffff);
|
||||
dstdata = *blitter_get_addr(space->machine, blitter.dest.addr & 0xfffff);
|
||||
cycles_used++;
|
||||
}
|
||||
|
||||
@ -629,10 +629,10 @@ static void RunBlit(running_machine *machine)
|
||||
The existing destination pixel is used as a lookup
|
||||
into the table and the colours is replaced.
|
||||
*/
|
||||
UINT8 dest = *blitter_get_addr(machine, blitter.dest.addr);
|
||||
UINT8 newcol = *(blitter_get_addr(machine, (blitter.source.addr + dest) & 0xfffff));
|
||||
UINT8 dest = *blitter_get_addr(space->machine, blitter.dest.addr);
|
||||
UINT8 newcol = *(blitter_get_addr(space->machine, (blitter.source.addr + dest) & 0xfffff));
|
||||
|
||||
*blitter_get_addr(machine, blitter.dest.addr) = newcol;
|
||||
*blitter_get_addr(space->machine, blitter.dest.addr) = newcol;
|
||||
cycles_used += 3;
|
||||
}
|
||||
else
|
||||
@ -651,7 +651,7 @@ static void RunBlit(running_machine *machine)
|
||||
if (blitter.compfunc & CMPFUNC_LOG0)
|
||||
final_result |= ~result & ~dstdata;
|
||||
|
||||
*blitter_get_addr(machine, blitter.dest.addr) = final_result;
|
||||
*blitter_get_addr(space->machine, blitter.dest.addr) = final_result;
|
||||
cycles_used++;
|
||||
}
|
||||
}
|
||||
@ -691,7 +691,7 @@ static void RunBlit(running_machine *machine)
|
||||
} while (blitter.command & CMD_RUN);
|
||||
|
||||
/* Burn Z80 cycles while blitter is in operation */
|
||||
cpu_spinuntil_time(machine->activecpu, ATTOTIME_IN_NSEC( (1000000000 / Z80_XTAL)*cycles_used * 2 ) );
|
||||
cpu_spinuntil_time(space->cpu, ATTOTIME_IN_NSEC( (1000000000 / Z80_XTAL)*cycles_used * 2 ) );
|
||||
}
|
||||
|
||||
|
||||
@ -944,7 +944,7 @@ static WRITE8_HANDLER( chipset_w )
|
||||
blitter.command = data;
|
||||
|
||||
if (data & CMD_RUN)
|
||||
RunBlit(space->machine);
|
||||
RunBlit(space);
|
||||
else
|
||||
mame_printf_debug("Blitter stopped by IO.\n");
|
||||
|
||||
|
@ -83,7 +83,7 @@ INLINE UINT8 swap_bits_5_6(UINT8 data)
|
||||
}
|
||||
|
||||
|
||||
static void btime_decrypt(running_machine *machine)
|
||||
static void btime_decrypt(const address_space *space)
|
||||
{
|
||||
UINT8 *src, *src1;
|
||||
int addr, addr1;
|
||||
@ -95,17 +95,17 @@ static void btime_decrypt(running_machine *machine)
|
||||
/* xxxx xxx1 xxxx x1xx are encrypted. */
|
||||
|
||||
/* get the address of the next opcode */
|
||||
addr = cpu_get_pc(machine->activecpu);
|
||||
addr = cpu_get_pc(space->cpu);
|
||||
|
||||
/* however if the previous instruction was JSR (which caused a write to */
|
||||
/* the stack), fetch the address of the next instruction. */
|
||||
addr1 = cpu_get_previouspc(machine->activecpu);
|
||||
src1 = (addr1 < 0x9000) ? rambase : memory_region(machine, "main");
|
||||
addr1 = cpu_get_previouspc(space->cpu);
|
||||
src1 = (addr1 < 0x9000) ? rambase : memory_region(space->machine, "main");
|
||||
if (decrypted[addr1] == 0x20) /* JSR $xxxx */
|
||||
addr = src1[addr1+1] + 256 * src1[addr1+2];
|
||||
|
||||
/* If the address of the next instruction is xxxx xxx1 xxxx x1xx, decode it. */
|
||||
src = (addr < 0x9000) ? rambase : memory_region(machine, "main");
|
||||
src = (addr < 0x9000) ? rambase : memory_region(space->machine, "main");
|
||||
if ((addr & 0x0104) == 0x0104)
|
||||
{
|
||||
/* 76543210 -> 65342710 bit rotation */
|
||||
@ -164,7 +164,7 @@ static WRITE8_HANDLER( btime_w )
|
||||
|
||||
rambase[offset] = data;
|
||||
|
||||
btime_decrypt(space->machine);
|
||||
btime_decrypt(space);
|
||||
}
|
||||
|
||||
static WRITE8_HANDLER( tisland_w )
|
||||
@ -184,7 +184,7 @@ static WRITE8_HANDLER( tisland_w )
|
||||
|
||||
rambase[offset] = data;
|
||||
|
||||
btime_decrypt(space->machine);
|
||||
btime_decrypt(space);
|
||||
}
|
||||
|
||||
static WRITE8_HANDLER( zoar_w )
|
||||
@ -202,7 +202,7 @@ static WRITE8_HANDLER( zoar_w )
|
||||
|
||||
rambase[offset] = data;
|
||||
|
||||
btime_decrypt(space->machine);
|
||||
btime_decrypt(space);
|
||||
}
|
||||
|
||||
static WRITE8_HANDLER( disco_w )
|
||||
@ -216,7 +216,7 @@ static WRITE8_HANDLER( disco_w )
|
||||
|
||||
rambase[offset] = data;
|
||||
|
||||
btime_decrypt(space->machine);
|
||||
btime_decrypt(space);
|
||||
}
|
||||
|
||||
|
||||
|
@ -579,7 +579,7 @@ static MACHINE_START( draco )
|
||||
|
||||
static MACHINE_RESET( cidelsa )
|
||||
{
|
||||
cputag_set_input_line(machine, "main", INPUT_LINE_RESET, PULSE_LINE);
|
||||
cputag_set_input_line(machine, MAIN_CPU_TAG, INPUT_LINE_RESET, PULSE_LINE);
|
||||
}
|
||||
|
||||
/* Machine Drivers */
|
||||
@ -589,7 +589,7 @@ static MACHINE_DRIVER_START( destryer )
|
||||
|
||||
// basic system hardware
|
||||
|
||||
MDRV_CPU_ADD("main", CDP1802, DESTRYER_CHR1)
|
||||
MDRV_CPU_ADD(MAIN_CPU_TAG, CDP1802, DESTRYER_CHR1)
|
||||
MDRV_CPU_PROGRAM_MAP(destryer_map, 0)
|
||||
MDRV_CPU_IO_MAP(destryer_io_map, 0)
|
||||
MDRV_CPU_CONFIG(cidelsa_cdp1802_config)
|
||||
@ -615,7 +615,7 @@ static MACHINE_DRIVER_START( destryea )
|
||||
|
||||
// basic system hardware
|
||||
|
||||
MDRV_CPU_ADD("main", CDP1802, DESTRYER_CHR1)
|
||||
MDRV_CPU_ADD(MAIN_CPU_TAG, CDP1802, DESTRYER_CHR1)
|
||||
MDRV_CPU_PROGRAM_MAP(destryea_map, 0)
|
||||
MDRV_CPU_IO_MAP(destryer_io_map, 0)
|
||||
MDRV_CPU_CONFIG(cidelsa_cdp1802_config)
|
||||
@ -641,7 +641,7 @@ static MACHINE_DRIVER_START( altair )
|
||||
|
||||
// basic system hardware
|
||||
|
||||
MDRV_CPU_ADD("main", CDP1802, ALTAIR_CHR1)
|
||||
MDRV_CPU_ADD(MAIN_CPU_TAG, CDP1802, ALTAIR_CHR1)
|
||||
MDRV_CPU_PROGRAM_MAP(altair_map, 0)
|
||||
MDRV_CPU_IO_MAP(altair_io_map, 0)
|
||||
MDRV_CPU_CONFIG(cidelsa_cdp1802_config)
|
||||
@ -680,7 +680,7 @@ static MACHINE_DRIVER_START( draco )
|
||||
|
||||
// basic system hardware
|
||||
|
||||
MDRV_CPU_ADD("main", CDP1802, DRACO_CHR1)
|
||||
MDRV_CPU_ADD(MAIN_CPU_TAG, CDP1802, DRACO_CHR1)
|
||||
MDRV_CPU_PROGRAM_MAP(draco_map, 0)
|
||||
MDRV_CPU_IO_MAP(draco_io_map, 0)
|
||||
MDRV_CPU_CONFIG(cidelsa_cdp1802_config)
|
||||
@ -726,7 +726,7 @@ MACHINE_DRIVER_END
|
||||
/* ROMs */
|
||||
|
||||
ROM_START( destryer )
|
||||
ROM_REGION( 0x10000, "main", 0 )
|
||||
ROM_REGION( 0x10000, MAIN_CPU_TAG, 0 )
|
||||
ROM_LOAD( "des a 2.ic4", 0x0000, 0x0800, CRC(63749870) SHA1(a8eee4509d7a52dcf33049de221d928da3632174) )
|
||||
ROM_LOAD( "des b 2.ic5", 0x0800, 0x0800, CRC(60604f40) SHA1(32ca95c5b38b0f4992e04d77123d217f143ae084) )
|
||||
ROM_LOAD( "des c 2.ic6", 0x1000, 0x0800, CRC(a7cdeb7b) SHA1(a5a7748967d4ca89fb09632e1f0130ef050dbd68) )
|
||||
@ -735,7 +735,7 @@ ROM_END
|
||||
|
||||
// this was destroyer2.rom in standalone emu..
|
||||
ROM_START( destryea )
|
||||
ROM_REGION( 0x10000, "main", 0 )
|
||||
ROM_REGION( 0x10000, MAIN_CPU_TAG, 0 )
|
||||
ROM_LOAD( "destryea_1", 0x0000, 0x0800, CRC(421428e9) SHA1(0ac3a1e7f61125a1cd82145fa28cbc4b93505dc9) )
|
||||
ROM_LOAD( "destryea_2", 0x0800, 0x0800, CRC(55dc8145) SHA1(a0066d3f3ac0ae56273485b74af90eeffea5e64e) )
|
||||
ROM_LOAD( "destryea_3", 0x1000, 0x0800, CRC(5557bdf8) SHA1(37a9cbc5d25051d3bed7535c58aac937cd7c64e1) )
|
||||
@ -743,7 +743,7 @@ ROM_START( destryea )
|
||||
ROM_END
|
||||
|
||||
ROM_START( altair )
|
||||
ROM_REGION( 0x10000, "main", 0 )
|
||||
ROM_REGION( 0x10000, MAIN_CPU_TAG, 0 )
|
||||
ROM_LOAD( "alt a 1.ic7", 0x0000, 0x0800, CRC(37c26c4e) SHA1(30df7efcf5bd12dafc1cb6e894fc18e7b76d3e61) )
|
||||
ROM_LOAD( "alt b 1.ic8", 0x0800, 0x0800, CRC(76b814a4) SHA1(e8ab1d1cbcef974d929ef8edd10008f60052a607) )
|
||||
ROM_LOAD( "alt c 1.ic9", 0x1000, 0x0800, CRC(2569ce44) SHA1(a09597d2f8f50fab9a09ed9a59c50a2bdcba47bb) )
|
||||
@ -753,7 +753,7 @@ ROM_START( altair )
|
||||
ROM_END
|
||||
|
||||
ROM_START( draco )
|
||||
ROM_REGION( 0x10000, "main", 0 )
|
||||
ROM_REGION( 0x10000, MAIN_CPU_TAG, 0 )
|
||||
ROM_LOAD( "dra a 1.ic10", 0x0000, 0x0800, CRC(ca127984) SHA1(46721cf42b1c891f7c88bc063a2149dd3cefea74) )
|
||||
ROM_LOAD( "dra b 1.ic11", 0x0800, 0x0800, CRC(e4936e28) SHA1(ddbbf769994d32a6bce75312306468a89033f0aa) )
|
||||
ROM_LOAD( "dra c 1.ic12", 0x1000, 0x0800, CRC(94480f5d) SHA1(8f49ce0f086259371e999d097a502482c83c6e9e) )
|
||||
|
@ -2604,7 +2604,7 @@ static UINT32 cps3_dma_callback(UINT32 src, UINT32 dst, UINT32 data, int size)
|
||||
}
|
||||
else
|
||||
{
|
||||
//printf("PC %08x :src %08x, dst %08x, returning %08x\n", cpu_get_pc(machine->activecpu), src, dst, data);
|
||||
//printf("%s :src %08x, dst %08x, returning %08x\n", cpuexec_describe_context(machine), src, dst, data);
|
||||
}
|
||||
|
||||
/* I doubt this is endian safe.. needs checking / fixing */
|
||||
|
@ -79,7 +79,7 @@ static CUSTOM_INPUT( pc3092_r )
|
||||
else
|
||||
ret = 0x00;
|
||||
|
||||
if (LOG_PC3092) logerror("%04X: read PC3092 = 0x%02x\n", safe_cpu_get_pc(field->port->machine->activecpu), ret);
|
||||
if (LOG_PC3092) logerror("%s: read PC3092 = 0x%02x\n", cpuexec_describe_context(field->port->machine), ret);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -114,8 +114,6 @@ static VIDEO_UPDATE( cubeqst )
|
||||
/* Bit 3 selects LD/#GRAPHICS */
|
||||
bitmap_fill(bitmap, cliprect, colormap[255]);
|
||||
|
||||
cpu_push_context(screen->machine->cpu[LINE_CPU]);
|
||||
|
||||
/* TODO: Add 1 for linebuffering? */
|
||||
for (y = cliprect->min_y; y <= cliprect->max_y; ++y)
|
||||
{
|
||||
@ -173,7 +171,6 @@ static VIDEO_UPDATE( cubeqst )
|
||||
}
|
||||
}
|
||||
|
||||
cpu_pop_context();
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -248,13 +245,10 @@ static WRITE16_HANDLER( control_w )
|
||||
|
||||
static TIMER_CALLBACK( delayed_bank_swap )
|
||||
{
|
||||
cpu_push_context(machine->cpu[LINE_CPU]);
|
||||
cubeqcpu_swap_line_banks(machine->cpu[LINE_CPU]);
|
||||
|
||||
/* TODO: This is a little dubious */
|
||||
cubeqcpu_clear_stack(machine->cpu[LINE_CPU]);
|
||||
|
||||
cpu_pop_context();
|
||||
}
|
||||
|
||||
|
||||
|
@ -116,14 +116,14 @@ static void cd32_cia_0_porta_w(const device_config *device, UINT8 data)
|
||||
static UINT8 cd32_cia_0_portb_r(const device_config *device)
|
||||
{
|
||||
/* parallel port */
|
||||
logerror("%06x:CIA0_portb_r\n", cpu_get_pc(device->machine->activecpu));
|
||||
logerror("%s:CIA0_portb_r\n", cpuexec_describe_context(device->machine));
|
||||
return 0xff;
|
||||
}
|
||||
|
||||
static void cd32_cia_0_portb_w(const device_config *device, UINT8 data)
|
||||
{
|
||||
/* parallel port */
|
||||
logerror("%06x:CIA0_portb_w(%02x)\n", cpu_get_pc(device->machine->activecpu), data);
|
||||
logerror("%s:CIA0_portb_w(%02x)\n", cpuexec_describe_context(device->machine), data);
|
||||
}
|
||||
|
||||
static ADDRESS_MAP_START( cd32_map, ADDRESS_SPACE_PROGRAM, 32 )
|
||||
|
@ -594,8 +594,8 @@ static void blit_vert_line(void)
|
||||
INLINE void log_blit(running_machine *machine, int data)
|
||||
{
|
||||
#if 1
|
||||
logerror("%06x: blit src %06x x %03x y %03x flags %02x layer %02x pen %02x penmode %02x w %03x h %03x linelen %03x clip: ctrl %x xy %03x %03x wh %03x %03x\n",
|
||||
cpu_get_pc(machine->activecpu),
|
||||
logerror("%s: blit src %06x x %03x y %03x flags %02x layer %02x pen %02x penmode %02x w %03x h %03x linelen %03x clip: ctrl %x xy %03x %03x wh %03x %03x\n",
|
||||
cpuexec_describe_context(machine),
|
||||
ddenlovr_blit_address,ddenlovr_blit_x,ddenlovr_blit_y,data,
|
||||
ddenlovr_dest_layer,ddenlovr_blit_pen,ddenlovr_blit_pen_mode,ddenlovr_rect_width,ddenlovr_rect_height,ddenlovr_line_length,
|
||||
ddenlovr_clip_ctrl,ddenlovr_clip_x,ddenlovr_clip_y, ddenlovr_clip_width,ddenlovr_clip_height );
|
||||
@ -903,7 +903,7 @@ profiler_mark(PROFILER_VIDEO);
|
||||
;
|
||||
#ifdef MAME_DEBUG
|
||||
popmessage("unknown blitter command %02x",data);
|
||||
logerror("%06x: unknown blitter command %02x\n", cpu_get_pc(machine->activecpu), data);
|
||||
logerror("%s: unknown blitter command %02x\n", cpuexec_describe_context(machine), data);
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -911,7 +911,7 @@ profiler_mark(PROFILER_VIDEO);
|
||||
break;
|
||||
|
||||
default:
|
||||
logerror("%06x: Blitter %d reg %02x = %02x\n", cpu_get_pc(machine->activecpu), blitter, ddenlovr_blit_reg[blitter], data);
|
||||
logerror("%s: Blitter %d reg %02x = %02x\n", cpuexec_describe_context(machine), blitter, ddenlovr_blit_reg[blitter], data);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -2503,7 +2503,7 @@ static void mjchuuka_get_romdata(running_machine *machine)
|
||||
|
||||
if (address >= size)
|
||||
{
|
||||
logerror("CPU#0 PC %06X: Error, Blitter address %06X out of range\n", cpu_get_pc(machine->activecpu), address);
|
||||
logerror("%s: Error, Blitter address %06X out of range\n", cpuexec_describe_context(machine), address);
|
||||
address %= size;
|
||||
}
|
||||
|
||||
|
@ -179,7 +179,7 @@ static WRITE32_HANDLER( coin_w )
|
||||
static READ32_HANDLER( vblank_r )
|
||||
{
|
||||
/* burn a bunch of cycles because this is polled frequently during busy loops */
|
||||
cpu_adjust_icount(space->cpu, -100);
|
||||
cpu_eat_cycles(space->cpu, 100);
|
||||
return input_port_read(space->machine, "VBLANK");
|
||||
}
|
||||
|
||||
|
@ -497,21 +497,13 @@ static MACHINE_RESET( drakton )
|
||||
static READ8_DEVICE_HANDLER( dk_dma_read_byte )
|
||||
{
|
||||
const address_space *space = cpu_get_address_space(device->machine->cpu[0], ADDRESS_SPACE_PROGRAM);
|
||||
UINT8 result;
|
||||
|
||||
cpu_push_context(space->cpu);
|
||||
result = memory_read_byte(space, offset);
|
||||
cpu_pop_context();
|
||||
|
||||
return result;
|
||||
return memory_read_byte(space, offset);
|
||||
}
|
||||
|
||||
static WRITE8_DEVICE_HANDLER( dk_dma_write_byte )
|
||||
{
|
||||
const address_space *space = cpu_get_address_space(device->machine->cpu[0], ADDRESS_SPACE_PROGRAM);
|
||||
cpu_push_context(space->cpu);
|
||||
memory_write_byte(space, offset, data);
|
||||
cpu_pop_context();
|
||||
}
|
||||
|
||||
static READ8_DEVICE_HANDLER( hb_dma_read_byte )
|
||||
@ -520,18 +512,13 @@ static READ8_DEVICE_HANDLER( hb_dma_read_byte )
|
||||
dkong_state *state = device->machine->driver_data;
|
||||
int bucket = state->rev_map[(offset>>10) & 0x1ff];
|
||||
int addr;
|
||||
UINT8 data;
|
||||
|
||||
if (bucket<0)
|
||||
fatalerror("hb_dma_read_byte - unmapped access for 0x%02x - bucket 0x%02x\n", offset, bucket);
|
||||
|
||||
addr = ((bucket<<7) & 0x7c00) | (offset & 0x3ff);
|
||||
|
||||
cpu_push_context(space->cpu);
|
||||
data = memory_read_byte(space, addr);
|
||||
cpu_pop_context();
|
||||
|
||||
return data;
|
||||
return memory_read_byte(space, addr);
|
||||
}
|
||||
|
||||
static WRITE8_DEVICE_HANDLER( hb_dma_write_byte )
|
||||
@ -546,9 +533,7 @@ static WRITE8_DEVICE_HANDLER( hb_dma_write_byte )
|
||||
|
||||
addr = ((bucket<<7) & 0x7c00) | (offset & 0x3ff);
|
||||
|
||||
cpu_push_context(space->cpu);
|
||||
memory_write_byte(space, addr, data);
|
||||
cpu_pop_context();
|
||||
}
|
||||
|
||||
static READ8_DEVICE_HANDLER( p8257_ctl_r )
|
||||
|
@ -31,18 +31,15 @@ static CUSTOM_INPUT( dorachan_protection_r )
|
||||
{
|
||||
UINT8 ret = 0;
|
||||
|
||||
if (field->port->machine->activecpu != NULL)
|
||||
switch (cpu_get_previouspc(field->port->machine->cpu[0]))
|
||||
{
|
||||
switch (cpu_get_previouspc(field->port->machine->activecpu))
|
||||
{
|
||||
case 0x70ce: ret = 0xf2; break;
|
||||
case 0x72a2: ret = 0xd5; break;
|
||||
case 0x72b5: ret = 0xcb; break;
|
||||
case 0x70ce: ret = 0xf2; break;
|
||||
case 0x72a2: ret = 0xd5; break;
|
||||
case 0x72b5: ret = 0xcb; break;
|
||||
|
||||
default:
|
||||
mame_printf_debug("unhandled $2400 read @ %x\n",cpu_get_previouspc(field->port->machine->activecpu));
|
||||
break;
|
||||
}
|
||||
default:
|
||||
mame_printf_debug("unhandled $2400 read @ %x\n",cpu_get_previouspc(field->port->machine->cpu[0]));
|
||||
break;
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
@ -112,7 +112,7 @@ static WRITE8_DEVICE_HANDLER( misc_w )
|
||||
/* bit 1 = (10) = PC1 */
|
||||
/* bit 0 = (32) = PC0 */
|
||||
input_mux = data & 7;
|
||||
logerror("%04X:misc_w(%02X)\n", cpu_get_previouspc(device->machine->activecpu), data);
|
||||
logerror("%s:misc_w(%02X)\n", cpuexec_describe_context(device->machine), data);
|
||||
}
|
||||
|
||||
|
||||
@ -126,14 +126,14 @@ static WRITE8_DEVICE_HANDLER( sound_w )
|
||||
/* bit 2 = folla a */
|
||||
/* bit 1 = folla m */
|
||||
/* bit 0 = folla b */
|
||||
logerror("%04X:sound_w(%02X)\n", cpu_get_previouspc(device->machine->activecpu), data);
|
||||
logerror("%s:sound_w(%02X)\n", cpuexec_describe_context(device->machine), data);
|
||||
}
|
||||
|
||||
|
||||
static WRITE8_DEVICE_HANDLER( pb_w )
|
||||
{
|
||||
/* write PB0-7 */
|
||||
logerror("%04X:pb_w(%02X)\n", cpu_get_previouspc(device->machine->activecpu), data);
|
||||
logerror("%s:pb_w(%02X)\n", cpuexec_describe_context(device->machine), data);
|
||||
}
|
||||
|
||||
|
||||
|
@ -102,7 +102,7 @@ static READ32_HANDLER( eolith_custom_r )
|
||||
bit 8 = ???
|
||||
bit 9 = ???
|
||||
*/
|
||||
eolith_speedup_read(space->machine);
|
||||
eolith_speedup_read(space);
|
||||
|
||||
return (input_port_read(space->machine, "IN0") & ~0x300) | (mame_rand(space->machine) & 0x300);
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ static WRITE16_HANDLER( eeprom_w )
|
||||
|
||||
static READ16_HANDLER( eolith16_custom_r )
|
||||
{
|
||||
eolith_speedup_read(space->machine);
|
||||
eolith_speedup_read(space);
|
||||
return input_port_read(space->machine, "SPECIAL");
|
||||
}
|
||||
|
||||
|
@ -17,15 +17,15 @@ static int eolith_speedup_resume_scanline;
|
||||
static int eolith_vblank = 0;
|
||||
static int eolith_scanline = 0;
|
||||
|
||||
void eolith_speedup_read(running_machine *machine)
|
||||
void eolith_speedup_read(const address_space *space)
|
||||
{
|
||||
/* for debug */
|
||||
// if ((cpu_get_pc(machine->activecpu)!=eolith_speedup_address) && (eolith_vblank!=1) )
|
||||
// printf("%06x eolith speedup_read data %02x\n",cpu_get_pc(machine->activecpu), eolith_vblank);
|
||||
// if ((cpu_get_pc(space->cpu)!=eolith_speedup_address) && (eolith_vblank!=1) )
|
||||
// printf("%s:eolith speedup_read data %02x\n",cpuexec_describe_context(space->machine), eolith_vblank);
|
||||
|
||||
if (cpu_get_pc(machine->activecpu)==eolith_speedup_address && eolith_vblank==0 && eolith_scanline < eolith_speedup_resume_scanline)
|
||||
if (cpu_get_pc(space->cpu)==eolith_speedup_address && eolith_vblank==0 && eolith_scanline < eolith_speedup_resume_scanline)
|
||||
{
|
||||
cpu_spinuntil_trigger(machine->activecpu, 1000);
|
||||
cpu_spinuntil_trigger(space->cpu, 1000);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -96,7 +96,7 @@ static READ32_HANDLER( f32_input_port_1_r )
|
||||
{
|
||||
/* burn a bunch of cycles because this is polled frequently during busy loops */
|
||||
if ((cpu_get_pc(space->cpu) == 0x000379de) ||
|
||||
(cpu_get_pc(space->cpu) == 0x000379cc) ) cpu_adjust_icount(space->cpu, -100);
|
||||
(cpu_get_pc(space->cpu) == 0x000379cc) ) cpu_eat_cycles(space->cpu, 100);
|
||||
//else printf("PC %08x\n", cpu_get_pc(space->cpu) );
|
||||
return input_port_read(space->machine, "SYSTEM_P2");
|
||||
}
|
||||
|
@ -300,7 +300,7 @@ static void borntofi_adpcm_start(int voice)
|
||||
msm5205_reset_w(voice,0);
|
||||
borntofi_adpcm[voice].playing = 1;
|
||||
borntofi_adpcm[voice].nibble = 0;
|
||||
// logerror("CPU #0 PC = %04X: adpcm start = %06x, stop = %06x\n", cpu_get_pc(machine->activecpu), borntofi_adpcm[voice].addr[0], borntofi_adpcm[voice].addr[1]);
|
||||
// logerror("%s: adpcm start = %06x, stop = %06x\n", cpuexec_describe_context(device->machine), borntofi_adpcm[voice].addr[0], borntofi_adpcm[voice].addr[1]);
|
||||
}
|
||||
|
||||
static void borntofi_adpcm_stop(int voice)
|
||||
|
@ -552,15 +552,10 @@ static UINT8 at_pages[0x10];
|
||||
static DMA8237_MEM_READ( pc_dma_read_byte )
|
||||
{
|
||||
const address_space *space = cpu_get_address_space(device->machine->cpu[0], ADDRESS_SPACE_PROGRAM);
|
||||
UINT8 result;
|
||||
offs_t page_offset = (((offs_t) dma_offset[0][channel]) << 16)
|
||||
& 0xFF0000;
|
||||
|
||||
cpu_push_context(space->cpu);
|
||||
result = memory_read_byte(space, page_offset + offset);
|
||||
cpu_pop_context();
|
||||
|
||||
return result;
|
||||
return memory_read_byte(space, page_offset + offset);
|
||||
}
|
||||
|
||||
|
||||
@ -570,9 +565,7 @@ static DMA8237_MEM_WRITE( pc_dma_write_byte )
|
||||
offs_t page_offset = (((offs_t) dma_offset[0][channel]) << 16)
|
||||
& 0xFF0000;
|
||||
|
||||
cpu_push_context(space->cpu);
|
||||
memory_write_byte(space, page_offset + offset, data);
|
||||
cpu_pop_context();
|
||||
}
|
||||
|
||||
static READ8_HANDLER(dma_page_select_r)
|
||||
|
@ -102,7 +102,7 @@ static WRITE8_DEVICE_HANDLER( sound_w )
|
||||
/* bit 7 goes directly to the sound amplifier */
|
||||
dac_data_w(0,((data & 0x80) >> 7) * 255);
|
||||
|
||||
// logerror("%04x: sound_w %02x\n",cpu_get_pc(machine->activecpu),data);
|
||||
// logerror("%s: sound_w %02x\n",cpuexec_describe_context(device->machine),data);
|
||||
// popmessage("%02x",data);
|
||||
}
|
||||
|
||||
|
@ -579,8 +579,8 @@ static void GCU_w(running_machine *machine, int chip, UINT32 offset, UINT32 data
|
||||
|
||||
if (reg != 0x70 && chip == 0)
|
||||
{
|
||||
//printf("gcu%d_w: %08X, %08X, %08X at %08X\n", chip, data, offset, mem_mask, cpu_get_pc(machine->activecpu));
|
||||
//logerror("gcu%d_w: %08X, %08X, %08X at %08X\n", chip, data, offset, mem_mask, cpu_get_pc(machine->activecpu));
|
||||
//printf("%s:gcu%d_w: %08X, %08X, %08X at %08X\n", cpuexec_describe_context(machine), chip, data, offset, mem_mask);
|
||||
//logerror("%s:gcu%d_w: %08X, %08X, %08X at %08X\n", ccpuexec_describe_context(machine), hip, data, offset, mem_mask);
|
||||
}
|
||||
|
||||
switch(reg)
|
||||
@ -974,7 +974,7 @@ static void atapi_command_reg_w(running_machine *machine, int reg, UINT16 data)
|
||||
|
||||
if (reg == ATAPI_REG_DATA)
|
||||
{
|
||||
// printf("ATAPI: packet write %04x at %08X\n", data, cpu_get_pc(machine->activecpu));
|
||||
// printf("%s:ATAPI: packet write %04x\n", cpuexec_describe_context(device->machine), data);
|
||||
atapi_data[atapi_data_ptr] = data;
|
||||
atapi_data_ptr++;
|
||||
|
||||
|
@ -56,7 +56,7 @@ static WRITE8_DEVICE_HANDLER( ppi0_portc_w )
|
||||
|
||||
static READ8_DEVICE_HANDLER( ppi0_portc_r )
|
||||
{
|
||||
// popmessage("%04x",cpu_get_pc(machine->activecpu));
|
||||
// popmessage("%s",cpuexec_describe_context(device->machine));
|
||||
return (~(eeprom_read_bit()<<1) & 2);
|
||||
}
|
||||
|
||||
|
@ -556,7 +556,7 @@ static WRITE16_HANDLER( gaelco_vram_encrypted_w )
|
||||
{
|
||||
// mame_printf_debug("gaelco_vram_encrypted_w!!\n");
|
||||
|
||||
data = gaelco_decrypt(space->machine, offset, data, 0x0f, 0x4228);
|
||||
data = gaelco_decrypt(space, offset, data, 0x0f, 0x4228);
|
||||
COMBINE_DATA(&gaelco_videoram[offset]);
|
||||
|
||||
tilemap_mark_tile_dirty(gaelco_tilemap[offset >> 11],((offset << 1) & 0x0fff) >> 2);
|
||||
@ -567,7 +567,7 @@ static WRITE16_HANDLER(gaelco_encrypted_w)
|
||||
{
|
||||
// mame_printf_debug("gaelco_encrypted_w!!\n");
|
||||
|
||||
data = gaelco_decrypt(space->machine, offset, data, 0x0f, 0x4228);
|
||||
data = gaelco_decrypt(space, offset, data, 0x0f, 0x4228);
|
||||
COMBINE_DATA(&gaelco_screen[offset]);
|
||||
}
|
||||
|
||||
@ -575,7 +575,7 @@ static WRITE16_HANDLER( thoop_vram_encrypted_w )
|
||||
{
|
||||
// mame_printf_debug("gaelco_vram_encrypted_w!!\n");
|
||||
|
||||
data = gaelco_decrypt(space->machine, offset, data, 0x0e, 0x4228);
|
||||
data = gaelco_decrypt(space, offset, data, 0x0e, 0x4228);
|
||||
COMBINE_DATA(&gaelco_videoram[offset]);
|
||||
|
||||
tilemap_mark_tile_dirty(gaelco_tilemap[offset >> 11],((offset << 1) & 0x0fff) >> 2);
|
||||
@ -585,7 +585,7 @@ static WRITE16_HANDLER(thoop_encrypted_w)
|
||||
{
|
||||
// mame_printf_debug("gaelco_encrypted_w!!\n");
|
||||
|
||||
data = gaelco_decrypt(space->machine, offset, data, 0x0e, 0x4228);
|
||||
data = gaelco_decrypt(space, offset, data, 0x0e, 0x4228);
|
||||
COMBINE_DATA(&gaelco_screen[offset]);
|
||||
}
|
||||
|
||||
|
@ -388,13 +388,13 @@ static WRITE8_HANDLER( konami_sound_filter_w )
|
||||
|
||||
static WRITE8_DEVICE_HANDLER( konami_portc_0_w )
|
||||
{
|
||||
logerror("%04X:ppi0_portc_w = %02X\n", cpu_get_pc(device->machine->activecpu), data);
|
||||
logerror("%s:ppi0_portc_w = %02X\n", cpuexec_describe_context(device->machine), data);
|
||||
}
|
||||
|
||||
|
||||
static WRITE8_DEVICE_HANDLER( konami_portc_1_w )
|
||||
{
|
||||
logerror("%04X:ppi1_portc_w = %02X\n", cpu_get_pc(device->machine->activecpu), data);
|
||||
logerror("%s:ppi1_portc_w = %02X\n", cpuexec_describe_context(device->machine), data);
|
||||
}
|
||||
|
||||
|
||||
|
@ -144,7 +144,7 @@ static void galpani2_mcu_nmi(running_machine *machine)
|
||||
mcu_size = (memory_read_byte(srcspace, mcu_address + 8)<<8) +
|
||||
(memory_read_byte(srcspace, mcu_address + 9)<<0) ;
|
||||
|
||||
logerror("CPU #0 PC %06X : MCU executes command $A, %04X %02X-> %04x\n",cpu_get_pc(machine->activecpu),mcu_src,mcu_size,mcu_dst);
|
||||
logerror("%s : MCU executes command $A, %04X %02X-> %04x\n",cpuexec_describe_context(machine),mcu_src,mcu_size,mcu_dst);
|
||||
|
||||
for( ; mcu_size > 0 ; mcu_size-- )
|
||||
{
|
||||
@ -164,7 +164,7 @@ static void galpani2_mcu_nmi(running_machine *machine)
|
||||
memory_write_byte(srcspace,mcu_address+0,0xff);
|
||||
memory_write_byte(srcspace,mcu_address+1,0xff);
|
||||
|
||||
logerror("CPU #0 PC %06X : MCU ERROR, unknown command %02X\n",cpu_get_pc(machine->activecpu),mcu_command);
|
||||
logerror("%s : MCU ERROR, unknown command %02X\n",cpuexec_describe_context(machine),mcu_command);
|
||||
}
|
||||
|
||||
/* Erase command? */
|
||||
|
@ -441,7 +441,7 @@ static void galpani3_mcu_run(running_machine *machine)
|
||||
UINT16 mcu_offset = mcu_ram[0x0012/2] / 2; /* offset in shared RAM where MCU will write */
|
||||
UINT16 mcu_subcmd = mcu_ram[0x0014/2]; /* sub-command parameter, happens only for command #4 */
|
||||
|
||||
logerror("(PC=%06X): MCU executed command : %04X %04X\n",cpu_get_pc(machine->activecpu),mcu_command,mcu_offset*2);
|
||||
logerror("%s: MCU executed command : %04X %04X\n",cpuexec_describe_context(machine),mcu_command,mcu_offset*2);
|
||||
|
||||
/* the only MCU commands found in program code are:
|
||||
0x04: protection: provide code/data,
|
||||
@ -454,7 +454,7 @@ static void galpani3_mcu_run(running_machine *machine)
|
||||
case 0x03: // DSW
|
||||
{
|
||||
mcu_ram[mcu_offset] = input_port_read(machine, "DSW");
|
||||
logerror("PC=%06X : MCU executed command: %04X %04X (read DSW)\n", cpu_get_pc(machine->activecpu), mcu_command, mcu_offset*2);
|
||||
logerror("%s : MCU executed command: %04X %04X (read DSW)\n", cpuexec_describe_context(machine), mcu_command, mcu_offset*2);
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -185,7 +185,7 @@ static UINT8 mxtc_config_r(const device_config *busdevice, const device_config *
|
||||
|
||||
static void mxtc_config_w(const device_config *busdevice, const device_config *device, int function, int reg, UINT8 data)
|
||||
{
|
||||
// mame_printf_debug("MXTC: write %d, %02X, %02X at %08X\n", function, reg, data, cpu_get_pc(machine->activecpu));
|
||||
// mame_printf_debug("%s:MXTC: write %d, %02X, %02X\n", cpuexec_describe_context(busdevice->machine), function, reg, data);
|
||||
|
||||
switch(reg)
|
||||
{
|
||||
@ -269,7 +269,7 @@ static UINT8 piix4_config_r(const device_config *busdevice, const device_config
|
||||
|
||||
static void piix4_config_w(const device_config *busdevice, const device_config *device, int function, int reg, UINT8 data)
|
||||
{
|
||||
// mame_printf_debug("PIIX4: write %d, %02X, %02X at %08X\n", function, reg, data, cpu_get_pc(machine->activecpu));
|
||||
// mame_printf_debug("%s:PIIX4: write %d, %02X, %02X\n", cpuexec_describe_context(busdevice->machine), function, reg, data);
|
||||
piix4_config_reg[function][reg] = data;
|
||||
}
|
||||
|
||||
@ -422,15 +422,10 @@ static WRITE8_HANDLER(at_page8_w)
|
||||
static DMA8237_MEM_READ( pc_dma_read_byte )
|
||||
{
|
||||
const address_space *space = cpu_get_address_space(device->machine->cpu[0], ADDRESS_SPACE_PROGRAM);
|
||||
UINT8 result;
|
||||
offs_t page_offset = (((offs_t) dma_offset[0][channel]) << 16)
|
||||
& 0xFF0000;
|
||||
|
||||
cpu_push_context(space->cpu);
|
||||
result = memory_read_byte(space, page_offset + offset);
|
||||
cpu_pop_context();
|
||||
|
||||
return result;
|
||||
return memory_read_byte(space, page_offset + offset);
|
||||
}
|
||||
|
||||
|
||||
@ -440,9 +435,7 @@ static DMA8237_MEM_WRITE( pc_dma_write_byte )
|
||||
offs_t page_offset = (((offs_t) dma_offset[0][channel]) << 16)
|
||||
& 0xFF0000;
|
||||
|
||||
cpu_push_context(space->cpu);
|
||||
memory_write_byte(space, page_offset + offset, data);
|
||||
cpu_pop_context();
|
||||
}
|
||||
|
||||
|
||||
|
@ -979,11 +979,13 @@ static MACHINE_DRIVER_START( hangplt )
|
||||
MDRV_MACHINE_RESET(hangplt)
|
||||
|
||||
MDRV_3DFX_VOODOO_1_ADD("voodoo0", STD_VOODOO_1_CLOCK, 2, "left")
|
||||
MDRV_3DFX_VOODOO_CPU("dsp1")
|
||||
MDRV_3DFX_VOODOO_TMU_MEMORY(0, 2)
|
||||
MDRV_3DFX_VOODOO_TMU_MEMORY(1, 2)
|
||||
MDRV_3DFX_VOODOO_VBLANK(voodoo_vblank_0)
|
||||
|
||||
MDRV_3DFX_VOODOO_1_ADD("voodoo1", STD_VOODOO_1_CLOCK, 2, "right")
|
||||
MDRV_3DFX_VOODOO_CPU("dsp2")
|
||||
MDRV_3DFX_VOODOO_TMU_MEMORY(0, 2)
|
||||
MDRV_3DFX_VOODOO_TMU_MEMORY(1, 2)
|
||||
MDRV_3DFX_VOODOO_VBLANK(voodoo_vblank_1)
|
||||
|
@ -311,7 +311,7 @@ static void blit(int offset)
|
||||
|
||||
#if HALLEYS_DEBUG
|
||||
if (0) {
|
||||
logerror("%04x:[%04x]", cpu_get_pc(machine->activecpu), offset);
|
||||
logerror("%s:[%04x]", cpuexec_describe_context(machine), offset);
|
||||
for (ecx=0; ecx<16; ecx++) logerror(" %02x", param[ecx]);
|
||||
logerror("\n"); }
|
||||
#endif
|
||||
|
@ -1069,6 +1069,7 @@ static MACHINE_DRIVER_START( hornet )
|
||||
MDRV_NVRAM_HANDLER( hornet )
|
||||
|
||||
MDRV_3DFX_VOODOO_1_ADD("voodoo0", STD_VOODOO_1_CLOCK, 2, "main")
|
||||
MDRV_3DFX_VOODOO_CPU("dsp")
|
||||
MDRV_3DFX_VOODOO_TMU_MEMORY(0, 4)
|
||||
MDRV_3DFX_VOODOO_VBLANK(voodoo_vblank_0)
|
||||
|
||||
@ -1126,10 +1127,12 @@ static MACHINE_DRIVER_START( hornet_2board )
|
||||
|
||||
MDRV_3DFX_VOODOO_REMOVE("voodoo0")
|
||||
MDRV_3DFX_VOODOO_1_ADD("voodoo0", STD_VOODOO_1_CLOCK, 2, "left")
|
||||
MDRV_3DFX_VOODOO_CPU("dsp")
|
||||
MDRV_3DFX_VOODOO_TMU_MEMORY(0, 4)
|
||||
MDRV_3DFX_VOODOO_VBLANK(voodoo_vblank_0)
|
||||
|
||||
MDRV_3DFX_VOODOO_1_ADD("voodoo1", STD_VOODOO_1_CLOCK, 2, "right")
|
||||
MDRV_3DFX_VOODOO_CPU("dsp2")
|
||||
MDRV_3DFX_VOODOO_TMU_MEMORY(0, 4)
|
||||
MDRV_3DFX_VOODOO_VBLANK(voodoo_vblank_1)
|
||||
|
||||
@ -1156,11 +1159,13 @@ static MACHINE_DRIVER_START( hornet_2board_v2 )
|
||||
|
||||
MDRV_3DFX_VOODOO_REMOVE("voodoo0")
|
||||
MDRV_3DFX_VOODOO_2_ADD("voodoo0", STD_VOODOO_2_CLOCK, 2, "left")
|
||||
MDRV_3DFX_VOODOO_CPU("dsp")
|
||||
MDRV_3DFX_VOODOO_TMU_MEMORY(0, 4)
|
||||
MDRV_3DFX_VOODOO_VBLANK(voodoo_vblank_0)
|
||||
|
||||
MDRV_3DFX_VOODOO_REMOVE("voodoo1")
|
||||
MDRV_3DFX_VOODOO_2_ADD("voodoo1", STD_VOODOO_2_CLOCK, 2, "right")
|
||||
MDRV_3DFX_VOODOO_CPU("dsp2")
|
||||
MDRV_3DFX_VOODOO_TMU_MEMORY(0, 4)
|
||||
MDRV_3DFX_VOODOO_VBLANK(voodoo_vblank_1)
|
||||
MACHINE_DRIVER_END
|
||||
|
@ -318,7 +318,7 @@ INLINE void blt_write(const address_space *space, const int tmap, const offs_t o
|
||||
case 2: hyprduel_vram_1_w(space,offs,data,mask); break;
|
||||
case 3: hyprduel_vram_2_w(space,offs,data,mask); break;
|
||||
}
|
||||
// logerror("CPU #0 PC %06X : Blitter %X] %04X <- %04X & %04X\n",cpu_get_pc(machine->activecpu),tmap,offs,data,mask);
|
||||
// logerror("%s : Blitter %X] %04X <- %04X & %04X\n",cpuexec_describe_context(space->machine),tmap,offs,data,mask);
|
||||
}
|
||||
|
||||
|
||||
|
@ -212,7 +212,7 @@ static void jchan_mcu_run(running_machine *machine)
|
||||
UINT16 mcu_offset = mcu_ram[0x0012/2] / 2; /* offset in shared RAM where MCU will write */
|
||||
UINT16 mcu_subcmd = mcu_ram[0x0014/2]; /* sub-command parameter, happens only for command #4 */
|
||||
|
||||
logerror("CPU #0 (PC=%06X) : MCU executed command: %04X %04X %04X ",cpu_get_pc(machine->activecpu),mcu_command,mcu_offset*2,mcu_subcmd);
|
||||
logerror("%s : MCU executed command: %04X %04X %04X ",cpuexec_describe_context(machine),mcu_command,mcu_offset*2,mcu_subcmd);
|
||||
|
||||
/*
|
||||
the only MCU commands found in program code are:
|
||||
@ -233,7 +233,7 @@ static void jchan_mcu_run(running_machine *machine)
|
||||
case 0x03: // DSW
|
||||
{
|
||||
mcu_ram[mcu_offset] = input_port_read(machine, "DSW");
|
||||
logerror("PC=%06X : MCU executed command: %04X %04X (read DSW)\n",cpu_get_pc(machine->activecpu),mcu_command,mcu_offset*2);
|
||||
logerror("%s : MCU executed command: %04X %04X (read DSW)\n",cpuexec_describe_context(machine),mcu_command,mcu_offset*2);
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -84,7 +84,7 @@ static void karnov_i8751_w(running_machine *machine, int data)
|
||||
if (data==0x401) i8751_return=0x4138; /* ^Whistling wind */
|
||||
if (data==0x408) i8751_return=0x4276; /* ^Heavy Gates */
|
||||
|
||||
// if (!i8751_return && data!=0x300) logerror("CPU %04x - Unknown Write %02x intel\n",cpu_get_pc(machine->activecpu),data);
|
||||
// if (!i8751_return && data!=0x300) logerror("%s - Unknown Write %02x intel\n",cpuexec_describe_context(machine),data);
|
||||
|
||||
cpu_set_input_line(machine->cpu[0],6,HOLD_LINE); /* Signal main cpu task is complete */
|
||||
i8751_needs_ack=1;
|
||||
@ -114,7 +114,7 @@ static void wndrplnt_i8751_w(running_machine *machine, int data)
|
||||
case 0x18: i8751_return=0x5341; break;
|
||||
}
|
||||
}
|
||||
// else logerror("CPU %04x - Unknown Write %02x intel\n",cpu_get_pc(machine->activecpu),data);
|
||||
// else logerror("%s - Unknown Write %02x intel\n",cpuexec_describe_context(machine),data);
|
||||
|
||||
/* These are 68k function call addresses - different address for each power-up */
|
||||
if (data==0x400) i8751_return=0x594;
|
||||
@ -248,7 +248,7 @@ static void chelnov_i8751_w(running_machine *machine, int data)
|
||||
}
|
||||
}
|
||||
|
||||
// logerror("CPU %04x - Unknown Write %02x intel\n",cpu_get_pc(machine->activecpu),data);
|
||||
// logerror("%s - Unknown Write %02x intel\n",cpuexec_describe_context(machine),data);
|
||||
|
||||
cpu_set_input_line(machine->cpu[0],6,HOLD_LINE); /* Signal main cpu task is complete */
|
||||
i8751_needs_ack=1;
|
||||
|
@ -1075,7 +1075,7 @@ static READ64_HANDLER(cpu_r)
|
||||
|
||||
if (ACCESSING_BITS_32_63)
|
||||
{
|
||||
r = (UINT64)((space->machine->activecpu != space->machine->cpu[0]) ? 0x80000000 : 0);
|
||||
r = (UINT64)((space->cpu != space->machine->cpu[0]) ? 0x80000000 : 0);
|
||||
//r |= 0x40000000; // sets Video-LowRes !?
|
||||
return r << 32;
|
||||
}
|
||||
|
@ -232,14 +232,7 @@ INLINE void ATTR_PRINTF(2,3) verboselog( int n_level, const char *s_fmt, ... )
|
||||
va_start( v, s_fmt );
|
||||
vsprintf( buf, s_fmt, v );
|
||||
va_end( v );
|
||||
if( Machine->activecpu != NULL )
|
||||
{
|
||||
logerror( "%08x: %s", cpu_get_pc(Machine->activecpu), buf );
|
||||
}
|
||||
else
|
||||
{
|
||||
logerror( "(timer) : %s", buf );
|
||||
}
|
||||
logerror( "%s: %s", cpuexec_describe_context(Machine), buf );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -72,51 +72,33 @@ static WRITE16_HANDLER( adrst_w )
|
||||
static READ16_HANDLER( main_gnd_r )
|
||||
{
|
||||
const address_space *gndspace = cpu_get_address_space(space->machine->cpu[GROUND_CPU], ADDRESS_SPACE_PROGRAM);
|
||||
UINT16 result;
|
||||
|
||||
cpu_push_context(gndspace->cpu);
|
||||
result = memory_read_word(gndspace, V30_GND_ADDR | offset * 2);
|
||||
cpu_pop_context();
|
||||
|
||||
return result;
|
||||
return memory_read_word(gndspace, V30_GND_ADDR | offset * 2);
|
||||
}
|
||||
|
||||
static WRITE16_HANDLER( main_gnd_w )
|
||||
{
|
||||
const address_space *gndspace = cpu_get_address_space(space->machine->cpu[GROUND_CPU], ADDRESS_SPACE_PROGRAM);
|
||||
cpu_push_context(gndspace->cpu);
|
||||
|
||||
if (ACCESSING_BITS_0_7)
|
||||
memory_write_byte(gndspace, V30_GND_ADDR | (offset * 2 + 0), data);
|
||||
if (ACCESSING_BITS_8_15)
|
||||
memory_write_byte(gndspace, V30_GND_ADDR | (offset * 2 + 1), data >> 8);
|
||||
|
||||
cpu_pop_context();
|
||||
}
|
||||
|
||||
static READ16_HANDLER( main_obj_r )
|
||||
{
|
||||
const address_space *objspace = cpu_get_address_space(space->machine->cpu[OBJECT_CPU], ADDRESS_SPACE_PROGRAM);
|
||||
UINT16 result;
|
||||
|
||||
cpu_push_context(objspace->cpu);
|
||||
result = memory_read_word(objspace, V30_OBJ_ADDR | offset * 2);
|
||||
cpu_pop_context();
|
||||
|
||||
return result;
|
||||
return memory_read_word(objspace, V30_OBJ_ADDR | offset * 2);
|
||||
}
|
||||
|
||||
static WRITE16_HANDLER( main_obj_w )
|
||||
{
|
||||
const address_space *objspace = cpu_get_address_space(space->machine->cpu[OBJECT_CPU], ADDRESS_SPACE_PROGRAM);
|
||||
cpu_push_context(objspace->cpu);
|
||||
|
||||
if (ACCESSING_BITS_0_7)
|
||||
memory_write_byte(objspace, V30_OBJ_ADDR | (offset * 2 + 0), data);
|
||||
if (ACCESSING_BITS_8_15)
|
||||
memory_write_byte(objspace, V30_OBJ_ADDR | (offset * 2 + 1), data >> 8);
|
||||
|
||||
cpu_pop_context();
|
||||
}
|
||||
|
||||
static WRITE16_HANDLER( tst_w )
|
||||
@ -126,40 +108,28 @@ static WRITE16_HANDLER( tst_w )
|
||||
const address_space *gndspace = cpu_get_address_space(space->machine->cpu[GROUND_CPU], ADDRESS_SPACE_PROGRAM);
|
||||
const address_space *objspace = cpu_get_address_space(space->machine->cpu[OBJECT_CPU], ADDRESS_SPACE_PROGRAM);
|
||||
|
||||
cpu_push_context(gndspace->cpu);
|
||||
if (ACCESSING_BITS_0_7)
|
||||
memory_write_byte(gndspace, V30_GND_ADDR | (offset * 2 + 0), data);
|
||||
if (ACCESSING_BITS_8_15)
|
||||
memory_write_byte(gndspace, V30_GND_ADDR | (offset * 2 + 1), data >> 8);
|
||||
cpu_pop_context();
|
||||
|
||||
cpu_push_context(objspace->cpu);
|
||||
if (ACCESSING_BITS_0_7)
|
||||
memory_write_byte(objspace, V30_OBJ_ADDR | (offset * 2 + 0), data);
|
||||
if (ACCESSING_BITS_8_15)
|
||||
memory_write_byte(objspace, V30_OBJ_ADDR | (offset * 2 + 1), data >> 8);
|
||||
cpu_pop_context();
|
||||
}
|
||||
}
|
||||
|
||||
static READ16_HANDLER( main_z80_r )
|
||||
{
|
||||
const address_space *sndspace = cpu_get_address_space(space->machine->cpu[SOUND_CPU], ADDRESS_SPACE_PROGRAM);
|
||||
UINT16 val;
|
||||
|
||||
cpu_push_context(sndspace->cpu);
|
||||
val = memory_read_byte(sndspace, offset);
|
||||
cpu_pop_context();
|
||||
|
||||
return 0xff00 | val;
|
||||
return 0xff00 | memory_read_byte(sndspace, offset);
|
||||
}
|
||||
|
||||
static WRITE16_HANDLER( main_z80_w )
|
||||
{
|
||||
const address_space *sndspace = cpu_get_address_space(space->machine->cpu[SOUND_CPU], ADDRESS_SPACE_PROGRAM);
|
||||
cpu_push_context(sndspace->cpu);
|
||||
memory_write_byte(sndspace, offset, data);
|
||||
cpu_pop_context();
|
||||
}
|
||||
|
||||
static WRITE16_HANDLER( inten_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