From bba83b69aa5e47d007c3ae80a6403e77fabc7087 Mon Sep 17 00:00:00 2001 From: Aaron Giles Date: Thu, 5 Jun 2008 09:47:46 +0000 Subject: [PATCH] 01859: looping, loopinga, skybump: Fatal Error crash The CPU context is not active in a timer callback. You have to set it yourself. --- src/emu/cpu/cop400/cop420.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/emu/cpu/cop400/cop420.c b/src/emu/cpu/cop400/cop420.c index 6c072742009..ab94755a53a 100644 --- a/src/emu/cpu/cop400/cop420.c +++ b/src/emu/cpu/cop400/cop420.c @@ -226,6 +226,7 @@ ADDRESS_MAP_END static TIMER_CALLBACK(cop420_counter_tick) { + cpuintrf_push_context(param); R.counter++; if (R.counter == 1024) @@ -233,15 +234,18 @@ static TIMER_CALLBACK(cop420_counter_tick) R.counter = 0; R.timerlatch = 1; } + cpuintrf_pop_context(); } /* IN Latches */ static TIMER_CALLBACK(cop420_inil_tick) { - UINT8 in = IN_IN(); + UINT8 in; int i; + cpuintrf_push_context(param); + in = IN_IN(); for (i = 0; i < 4; i++) { R.in[i] = (R.in[i] << 1) | BIT(in, i); @@ -251,14 +255,17 @@ static TIMER_CALLBACK(cop420_inil_tick) IL |= (1 << i); } } + cpuintrf_pop_context(); } /* Microbus */ static TIMER_CALLBACK(cop420_microbus_tick) { - UINT8 in = IN_IN(); + UINT8 in; + cpuintrf_push_context(param); + in = IN_IN(); if (!BIT(in, 2)) { // chip select @@ -280,6 +287,7 @@ static TIMER_CALLBACK(cop420_microbus_tick) R.microbus_int = 0; } } + cpuintrf_pop_context(); } /****************************************************************************