mirror of
https://github.com/holub/mame
synced 2025-05-22 05:38:52 +03:00
Removed save_device pattern if favor of just accepting the
device from the reset.
This commit is contained in:
parent
6f4ee44948
commit
b5f1e96c98
@ -304,10 +304,9 @@ INLINE void SetRegister( int rIndex, UINT32 value )
|
||||
static CPU_RESET( arm )
|
||||
{
|
||||
cpu_irq_callback save_irqcallback = arm.irq_callback;
|
||||
const device_config *save_device = arm.device;
|
||||
memset(&arm, 0, sizeof(arm));
|
||||
arm.irq_callback = save_irqcallback;
|
||||
arm.device = save_device;
|
||||
arm.device = device;
|
||||
|
||||
/* start up in SVC mode with interrupts disabled. */
|
||||
R15 = eARM_MODE_SVC|I_MASK|F_MASK;
|
||||
|
@ -103,7 +103,7 @@ static CPU_INIT( arm7 )
|
||||
static CPU_RESET( arm7 )
|
||||
{
|
||||
// must call core reset
|
||||
arm7_core_reset();
|
||||
arm7_core_reset(device);
|
||||
}
|
||||
|
||||
static CPU_EXIT( arm7 )
|
||||
|
@ -520,14 +520,13 @@ static void arm7_core_init(const char *cpuname, int index)
|
||||
}
|
||||
|
||||
// CPU RESET
|
||||
static void arm7_core_reset(void)
|
||||
static void arm7_core_reset(const device_config *device)
|
||||
{
|
||||
cpu_irq_callback save_irqcallback = ARM7.irq_callback;
|
||||
const device_config *save_device = ARM7.device;
|
||||
|
||||
memset(&ARM7, 0, sizeof(ARM7));
|
||||
ARM7.irq_callback = save_irqcallback;
|
||||
ARM7.device = save_device;
|
||||
ARM7.device = device;
|
||||
|
||||
/* start up in SVC mode with interrupts disabled. */
|
||||
SwitchMode(eARM7_MODE_SVC);
|
||||
|
@ -1724,15 +1724,13 @@ static CPU_RESET( hyperstone )
|
||||
//TODO: Add different reset initializations for BCR, MCR, FCR, TPR
|
||||
|
||||
emu_timer *save_timer;
|
||||
const device_config *save_device;
|
||||
cpu_irq_callback save_irqcallback;
|
||||
|
||||
save_timer = hyperstone.timer;
|
||||
save_irqcallback = hyperstone.irq_callback;
|
||||
save_device = hyperstone.device;
|
||||
memset(&hyperstone, 0, sizeof(hyperstone_regs));
|
||||
hyperstone.irq_callback = save_irqcallback;
|
||||
hyperstone.device = save_device;
|
||||
hyperstone.device = device;
|
||||
hyperstone.timer = save_timer;
|
||||
|
||||
hyperstone.tr_clocks_per_tick = 2;
|
||||
|
@ -1536,13 +1536,11 @@ static CPU_RESET( f8 )
|
||||
UINT8 data;
|
||||
int i;
|
||||
cpu_irq_callback save_callback;
|
||||
const device_config *save_device;
|
||||
|
||||
save_callback = f8.irq_callback;
|
||||
save_device = f8.device;
|
||||
memset(&f8, 0, sizeof(f8_Regs));
|
||||
f8.irq_callback = save_callback;
|
||||
f8.device = save_device;
|
||||
f8.device = device;
|
||||
f8.w&=~I;
|
||||
|
||||
/* save PC0 to PC1 and reset PC0 */
|
||||
|
@ -193,15 +193,13 @@ static CPU_INIT( h6280 )
|
||||
static CPU_RESET( h6280 )
|
||||
{
|
||||
cpu_irq_callback save_irqcallback;
|
||||
const device_config *save_device;
|
||||
int i;
|
||||
|
||||
/* wipe out the h6280 structure */
|
||||
save_irqcallback = h6280.irq_callback;
|
||||
save_device = h6280.device;
|
||||
memset(&h6280, 0, sizeof(h6280_Regs));
|
||||
h6280.irq_callback = save_irqcallback;
|
||||
h6280.device = save_device;
|
||||
h6280.device = device;
|
||||
|
||||
/* set I and B flags */
|
||||
P = _fI | _fB;
|
||||
|
@ -616,13 +616,11 @@ static void build_opcode_table(UINT32 features)
|
||||
static CPU_RESET( i386 )
|
||||
{
|
||||
cpu_irq_callback save_irqcallback;
|
||||
const device_config *save_device;
|
||||
|
||||
save_irqcallback = I.irq_callback;
|
||||
save_device = I.device;
|
||||
memset( &I, 0, sizeof(I386_REGS) );
|
||||
I.irq_callback = save_irqcallback;
|
||||
I.device = save_device;
|
||||
I.device = device;
|
||||
|
||||
I.sreg[CS].selector = 0xf000;
|
||||
I.sreg[CS].base = 0xffff0000;
|
||||
@ -1074,13 +1072,11 @@ static CPU_INIT( i486 )
|
||||
static CPU_RESET( i486 )
|
||||
{
|
||||
cpu_irq_callback save_irqcallback;
|
||||
const device_config *save_device;
|
||||
|
||||
save_irqcallback = I.irq_callback;
|
||||
save_device = I.device;
|
||||
memset( &I, 0, sizeof(I386_REGS) );
|
||||
I.irq_callback = save_irqcallback;
|
||||
I.device = save_device;
|
||||
I.device = device;
|
||||
|
||||
I.sreg[CS].selector = 0xf000;
|
||||
I.sreg[CS].base = 0xffff0000;
|
||||
@ -1184,13 +1180,11 @@ static CPU_INIT( pentium )
|
||||
static CPU_RESET( pentium )
|
||||
{
|
||||
cpu_irq_callback save_irqcallback;
|
||||
const device_config *save_device;
|
||||
|
||||
save_irqcallback = I.irq_callback;
|
||||
save_device = I.device;
|
||||
memset( &I, 0, sizeof(I386_REGS) );
|
||||
I.irq_callback = save_irqcallback;
|
||||
I.device = save_device;
|
||||
I.device = device;
|
||||
|
||||
I.sreg[CS].selector = 0xf000;
|
||||
I.sreg[CS].base = 0xffff0000;
|
||||
@ -1314,13 +1308,11 @@ static CPU_INIT( mediagx )
|
||||
static CPU_RESET( mediagx )
|
||||
{
|
||||
cpu_irq_callback save_irqcallback;
|
||||
const device_config *save_device;
|
||||
|
||||
save_irqcallback = I.irq_callback;
|
||||
save_device = I.device;
|
||||
memset( &I, 0, sizeof(I386_REGS) );
|
||||
I.irq_callback = save_irqcallback;
|
||||
I.device = save_device;
|
||||
I.device = device;
|
||||
|
||||
I.sreg[CS].selector = 0xf000;
|
||||
I.sreg[CS].base = 0xffff0000;
|
||||
|
@ -1387,21 +1387,19 @@ static CPU_INIT( i8085 )
|
||||
static CPU_RESET( i8085 )
|
||||
{
|
||||
cpu_irq_callback save_irqcallback;
|
||||
const device_config *save_device;
|
||||
void (*save_sodcallback)(int);
|
||||
int (*save_sidcallback)(void);
|
||||
int cputype_bak = I.cputype;
|
||||
|
||||
init_tables();
|
||||
save_device = I.device;
|
||||
save_irqcallback = I.irq_callback;
|
||||
save_sodcallback = I.sod_callback;
|
||||
save_sidcallback = I.sid_callback;
|
||||
memset(&I, 0, sizeof(i8085_Regs));
|
||||
I.device = save_device;
|
||||
I.irq_callback = save_irqcallback;
|
||||
I.sod_callback = save_sodcallback;
|
||||
I.sid_callback = save_sidcallback;
|
||||
I.device = device;
|
||||
change_pc(I.PC.d);
|
||||
|
||||
I.cputype = cputype_bak;
|
||||
|
@ -160,16 +160,14 @@ static CPU_INIT( i8088 )
|
||||
static CPU_RESET( i8086 )
|
||||
{
|
||||
cpu_irq_callback save_irqcallback;
|
||||
const device_config *save_device;
|
||||
memory_interface save_mem;
|
||||
|
||||
save_irqcallback = I.irq_callback;
|
||||
save_device = I.device;
|
||||
save_mem = I.mem;
|
||||
memset(&I, 0, sizeof (I));
|
||||
I.device = save_device;
|
||||
I.irq_callback = save_irqcallback;
|
||||
I.mem = save_mem;
|
||||
I.device = device;
|
||||
|
||||
I.sregs[CS] = 0xf000;
|
||||
I.base[CS] = SegBase(CS);
|
||||
|
@ -451,10 +451,9 @@ static CPU_INIT( m6805 )
|
||||
static CPU_RESET( m6805 )
|
||||
{
|
||||
cpu_irq_callback save_irqcallback = m6805.irq_callback;
|
||||
const device_config *save_device = m6805.device;
|
||||
memset(&m6805, 0, sizeof(m6805));
|
||||
m6805.irq_callback = save_irqcallback;
|
||||
m6805.device = save_device;
|
||||
m6805.device = device;
|
||||
/* Force CPU sub-type and relevant masks */
|
||||
m6805.subtype = SUBTYPE_M6805;
|
||||
SP_MASK = 0x07f;
|
||||
|
@ -789,10 +789,9 @@ static CPU_INIT( s2650 )
|
||||
static CPU_RESET( s2650 )
|
||||
{
|
||||
cpu_irq_callback save_irqcallback = S.irq_callback;
|
||||
const device_config *save_device = S.device;
|
||||
memset(&S, 0, sizeof(S));
|
||||
S.irq_callback = save_irqcallback;
|
||||
S.device = save_device;
|
||||
S.device = device;
|
||||
S.psl = COM | WC;
|
||||
S.psu = 0;
|
||||
}
|
||||
|
@ -1725,10 +1725,9 @@ static void BuildTable(void)
|
||||
static CPU_RESET( SE3208 )
|
||||
{
|
||||
cpu_irq_callback save_irqcallback = Context.irq_callback;
|
||||
const device_config *save_device = Context.device;
|
||||
memset(&Context,0,sizeof(_SE3208Context));
|
||||
Context.irq_callback = save_irqcallback;
|
||||
Context.device = save_device;
|
||||
Context.device = device;
|
||||
Context.PC=SE3208_Read32(0);
|
||||
Context.SR=0;
|
||||
Context.IRQ=CLEAR_LINE;
|
||||
|
@ -2146,7 +2146,6 @@ static CPU_RESET( sh2 )
|
||||
|
||||
void (*f)(UINT32 data);
|
||||
cpu_irq_callback save_irqcallback;
|
||||
const device_config *save_device;
|
||||
|
||||
cpunum = sh2->cpu_number;
|
||||
m = sh2->m;
|
||||
@ -2156,7 +2155,6 @@ static CPU_RESET( sh2 )
|
||||
|
||||
f = sh2->ftcsr_read_callback;
|
||||
save_irqcallback = sh2->irq_callback;
|
||||
save_device = sh2->device;
|
||||
save_is_slave = sh2->is_slave;
|
||||
dma_callback_kludge = sh2->dma_callback_kludge;
|
||||
|
||||
@ -2166,7 +2164,7 @@ static CPU_RESET( sh2 )
|
||||
sh2->is_slave = save_is_slave;
|
||||
sh2->ftcsr_read_callback = f;
|
||||
sh2->irq_callback = save_irqcallback;
|
||||
sh2->device = save_device;
|
||||
sh2->device = device;
|
||||
|
||||
sh2->timer = tsave;
|
||||
sh2->dma_timer[0] = tsaved0;
|
||||
|
@ -785,7 +785,6 @@ static CPU_RESET( sh2 )
|
||||
|
||||
void (*f)(UINT32 data);
|
||||
cpu_irq_callback save_irqcallback;
|
||||
const device_config *save_device;
|
||||
|
||||
cpunum = sh2->cpu_number;
|
||||
m = sh2->m;
|
||||
@ -795,7 +794,6 @@ static CPU_RESET( sh2 )
|
||||
|
||||
f = sh2->ftcsr_read_callback;
|
||||
save_irqcallback = sh2->irq_callback;
|
||||
save_device = sh2->device;
|
||||
|
||||
sh2->ppc = sh2->pc = sh2->pr = sh2->sr = sh2->gbr = sh2->vbr = sh2->mach = sh2->macl = 0;
|
||||
sh2->evec = sh2->irqsr = 0;
|
||||
@ -811,7 +809,7 @@ static CPU_RESET( sh2 )
|
||||
|
||||
sh2->ftcsr_read_callback = f;
|
||||
sh2->irq_callback = save_irqcallback;
|
||||
sh2->device = save_device;
|
||||
sh2->device = device;
|
||||
|
||||
sh2->timer = tsave;
|
||||
sh2->dma_timer[0] = tsaved0;
|
||||
|
@ -3248,7 +3248,6 @@ static CPU_RESET( sh4 )
|
||||
|
||||
void (*f)(UINT32 data);
|
||||
cpu_irq_callback save_irqcallback;
|
||||
const device_config *save_device;
|
||||
|
||||
cpunum = sh4.cpu_number;
|
||||
m = sh4.m;
|
||||
@ -3264,7 +3263,6 @@ static CPU_RESET( sh4 )
|
||||
|
||||
f = sh4.ftcsr_read_callback;
|
||||
save_irqcallback = sh4.irq_callback;
|
||||
save_device = sh4.device;
|
||||
save_is_slave = sh4.is_slave;
|
||||
savecpu_clock = sh4.cpu_clock;
|
||||
savebus_clock = sh4.bus_clock;
|
||||
@ -3276,7 +3274,7 @@ static CPU_RESET( sh4 )
|
||||
sh4.pm_clock = savepm_clock;
|
||||
sh4.ftcsr_read_callback = f;
|
||||
sh4.irq_callback = save_irqcallback;
|
||||
sh4.device = save_device;
|
||||
sh4.device = device;
|
||||
|
||||
sh4.dma_timer[0] = tsaved[0];
|
||||
sh4.dma_timer[1] = tsaved[1];
|
||||
|
@ -684,7 +684,6 @@ static CPU_RESET( tms34010 )
|
||||
const device_config *screen = tms.screen;
|
||||
UINT16 *shiftreg = tms.shiftreg;
|
||||
cpu_irq_callback save_irqcallback = tms.irq_callback;
|
||||
const device_config *save_device = tms.device;
|
||||
emu_timer *save_scantimer = tms.scantimer;
|
||||
|
||||
memset(&tms, 0, sizeof(tms));
|
||||
@ -693,8 +692,8 @@ static CPU_RESET( tms34010 )
|
||||
tms.screen = screen;
|
||||
tms.shiftreg = shiftreg;
|
||||
tms.irq_callback = save_irqcallback;
|
||||
tms.device = save_device;
|
||||
tms.scantimer = save_scantimer;
|
||||
tms.device = device;
|
||||
|
||||
/* fetch the initial PC and reset the state */
|
||||
PC = RLONG(0xffffffe0) & 0xfffffff0;
|
||||
|
@ -1607,15 +1607,13 @@ static CPU_RESET( upd7810 )
|
||||
{
|
||||
UPD7810_CONFIG save_config;
|
||||
cpu_irq_callback save_irqcallback;
|
||||
const device_config *save_device;
|
||||
|
||||
save_config = upd7810.config;
|
||||
save_irqcallback = upd7810.irq_callback;
|
||||
save_device = upd7810.device;
|
||||
memset(&upd7810, 0, sizeof(upd7810));
|
||||
upd7810.config = save_config;
|
||||
upd7810.irq_callback = save_irqcallback;
|
||||
upd7810.device = save_device;
|
||||
upd7810.device = device;
|
||||
|
||||
upd7810.opXX = opXX_7810;
|
||||
upd7810.op48 = op48;
|
||||
|
@ -112,13 +112,11 @@ static CPU_RESET( nec )
|
||||
unsigned int i,j,c;
|
||||
static const BREGS reg_name[8]={ AL, CL, DL, BL, AH, CH, DH, BH };
|
||||
cpu_irq_callback save_irqcallback;
|
||||
const device_config *save_device;
|
||||
|
||||
save_irqcallback = I.irq_callback;
|
||||
save_device = I.device;
|
||||
memset( &I, 0, sizeof(I) );
|
||||
I.irq_callback = save_irqcallback;
|
||||
I.device = save_device;
|
||||
I.device = device;
|
||||
|
||||
I.sregs[CS] = 0xffff;
|
||||
|
||||
|
@ -1940,7 +1940,6 @@ static CPU_RESET( z180 )
|
||||
{
|
||||
z80_daisy_state *save_daisy;
|
||||
cpu_irq_callback save_irqcallback;
|
||||
const device_config *save_device;
|
||||
int i, p;
|
||||
#if BIG_FLAGS_ARRAY
|
||||
int oldval, newval, val;
|
||||
@ -2021,7 +2020,6 @@ static CPU_RESET( z180 )
|
||||
|
||||
save_daisy = Z180.daisy;
|
||||
save_irqcallback = Z180.irq_callback;
|
||||
save_device = Z180.device;
|
||||
memset(&Z180, 0, sizeof(Z180));
|
||||
Z180.daisy = save_daisy;
|
||||
Z180.irq_callback = save_irqcallback;
|
||||
@ -2040,6 +2038,7 @@ static CPU_RESET( z180 )
|
||||
Z180.read_tcr_tmdr[1] = 0;
|
||||
Z180.tmdr_value[0] = 0xffff;
|
||||
Z180.tmdr_value[1] = 0xffff;
|
||||
Z180.device = device;
|
||||
|
||||
/* reset io registers */
|
||||
IO_CNTLA0 = Z180_CNTLA0_RESET;
|
||||
|
@ -463,10 +463,9 @@ INLINE void Interrupt(void)
|
||||
static CPU_RESET( z8000 )
|
||||
{
|
||||
cpu_irq_callback save_irqcallback = Z.irq_callback;
|
||||
const device_config *save_device = Z.device;
|
||||
memset(&Z, 0, sizeof(z8000_Regs));
|
||||
Z.irq_callback = save_irqcallback;
|
||||
Z.device = save_device;
|
||||
Z.device = device;
|
||||
FCW = RDMEM_W( 2 ); /* get reset FCW */
|
||||
PC = RDMEM_W( 4 ); /* get reset PC */
|
||||
change_pc(PC);
|
||||
|
Loading…
Reference in New Issue
Block a user