summaryrefslogtreecommitdiffstatshomepage
path: root/src/mess/machine/pokemini.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mess/machine/pokemini.c')
-rw-r--r--src/mess/machine/pokemini.c78
1 files changed, 39 insertions, 39 deletions
diff --git a/src/mess/machine/pokemini.c b/src/mess/machine/pokemini.c
index 20f8c0800e1..49eb2a84b66 100644
--- a/src/mess/machine/pokemini.c
+++ b/src/mess/machine/pokemini.c
@@ -391,7 +391,7 @@ static TIMER_CALLBACK(pokemini_timer3_hi_callback)
WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
{
- pokemini_state *state = device->machine().driver_data<pokemini_state>();
+ pokemini_state *state = space.machine().driver_data<pokemini_state>();
static const int timer_to_cycles_fast[8] = { 2, 8, 32, 64, 128, 256, 1024, 4096 };
static const int timer_to_cycles_slow[8] = { 128, 256, 512, 1024, 2048, 4096, 8192, 16384 };
@@ -409,7 +409,7 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
case 0x02: /* CPU related?
Bit 0-7 R/W Unknown
*/
- logerror( "%0X: Write to unknown hardware address: %02X, %02X\n", device->machine().firstcpu->pc( ), offset, data );
+ logerror( "%0X: Write to unknown hardware address: %02X, %02X\n", space.machine().firstcpu->pc( ), offset, data );
break;
case 0x08: /* Seconds-timer control
Bit 0 R/W Timer enable
@@ -441,7 +441,7 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
Bit 5 R Battery status: 0 - battery OK, 1 - battery low
Bit 6-7 Unused
*/
- logerror( "%0X: Write to unknown hardware address: %02X, %02X\n", device->machine().firstcpu->pc( ), offset, data );
+ logerror( "%0X: Write to unknown hardware address: %02X, %02X\n", space.machine().firstcpu->pc( ), offset, data );
break;
case 0x18: /* Timer 1 pre-scale + enable
Bit 0-2 R/W low timer 1 prescaler select
@@ -463,7 +463,7 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
int index = data & 0x07;
int cycles = ( state->m_pm_reg[0x19] & 0x01 ) ? timer_to_cycles_slow[index] : timer_to_cycles_fast[index];
- state->m_timers.timer1->adjust(attotime::zero, 0, device->machine().device<cpu_device>("maincpu")->cycles_to_attotime(cycles));
+ state->m_timers.timer1->adjust(attotime::zero, 0, space.machine().device<cpu_device>("maincpu")->cycles_to_attotime(cycles));
}
/* Check for prescaler change for the high counter */
@@ -472,7 +472,7 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
int index = ( data >> 4 ) & 0x07;
int cycles = ( state->m_pm_reg[0x19] & 0x02 ) ? timer_to_cycles_slow[index] : timer_to_cycles_fast[index];
- state->m_timers.timer1_hi->adjust(attotime::zero, 0, device->machine().device<cpu_device>("maincpu")->cycles_to_attotime(cycles));
+ state->m_timers.timer1_hi->adjust(attotime::zero, 0, space.machine().device<cpu_device>("maincpu")->cycles_to_attotime(cycles));
}
/* Check if timer1 low should be enabled */
@@ -513,7 +513,7 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
int index = state->m_pm_reg[0x18] & 0x07;
int cycles = ( data & 0x01 ) ? timer_to_cycles_slow[index] : timer_to_cycles_fast[index];
- state->m_timers.timer1->adjust(attotime::zero, 0, device->machine().device<cpu_device>("maincpu")->cycles_to_attotime(cycles));
+ state->m_timers.timer1->adjust(attotime::zero, 0, space.machine().device<cpu_device>("maincpu")->cycles_to_attotime(cycles));
}
/* Check for prescaler change for the low counter */
@@ -522,7 +522,7 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
int index = ( state->m_pm_reg[0x18] >> 4 ) & 0x07;
int cycles = ( data & 0x02 ) ? timer_to_cycles_slow[index] : timer_to_cycles_fast[index];
- state->m_timers.timer1_hi->adjust(attotime::zero, 0, device->machine().device<cpu_device>("maincpu")->cycles_to_attotime(cycles));
+ state->m_timers.timer1_hi->adjust(attotime::zero, 0, space.machine().device<cpu_device>("maincpu")->cycles_to_attotime(cycles));
}
{
@@ -592,7 +592,7 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
int index = data & 0x07;
int cycles = ( state->m_pm_reg[0x1B] & 0x01 ) ? timer_to_cycles_slow[index] : timer_to_cycles_fast[index];
- state->m_timers.timer2->adjust(attotime::zero, 0, device->machine().device<cpu_device>("maincpu")->cycles_to_attotime(cycles));
+ state->m_timers.timer2->adjust(attotime::zero, 0, space.machine().device<cpu_device>("maincpu")->cycles_to_attotime(cycles));
}
/* Check for prescaler change for the high counter */
@@ -601,7 +601,7 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
int index = ( data >> 4 ) & 0x07;
int cycles = ( state->m_pm_reg[0x1B] & 0x02 ) ? timer_to_cycles_slow[index] : timer_to_cycles_fast[index];
- state->m_timers.timer2_hi->adjust(attotime::zero, 0, device->machine().device<cpu_device>("maincpu")->cycles_to_attotime(cycles));
+ state->m_timers.timer2_hi->adjust(attotime::zero, 0, space.machine().device<cpu_device>("maincpu")->cycles_to_attotime(cycles));
}
/* Check if timer2 low should be enabled */
@@ -638,7 +638,7 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
int index = state->m_pm_reg[0x1A] & 0x07;
int cycles = ( data & 0x01 ) ? timer_to_cycles_slow[index] : timer_to_cycles_fast[index];
- state->m_timers.timer2->adjust(attotime::zero, 0, device->machine().device<cpu_device>("maincpu")->cycles_to_attotime(cycles));
+ state->m_timers.timer2->adjust(attotime::zero, 0, space.machine().device<cpu_device>("maincpu")->cycles_to_attotime(cycles));
if ( ( state->m_pm_reg[0x1A] & 0x08 ) && ( state->m_pm_reg[0x38] & 0x04 ) &&
( ( ( state->m_pm_reg[0x19] & 0x10 ) && ( data & 0x01 ) ) ||
@@ -658,7 +658,7 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
int index = ( state->m_pm_reg[0x1A] >> 4 ) & 0x07;
int cycles = ( data & 0x02 ) ? timer_to_cycles_slow[index] : timer_to_cycles_fast[index];
- state->m_timers.timer2_hi->adjust(attotime::zero, 0, device->machine().device<cpu_device>("maincpu")->cycles_to_attotime(cycles));
+ state->m_timers.timer2_hi->adjust(attotime::zero, 0, space.machine().device<cpu_device>("maincpu")->cycles_to_attotime(cycles));
if ( ( state->m_pm_reg[0x1A] & 0x80 ) && ( state->m_pm_reg[0x39] & 0x04 ) && ! ( state->m_pm_reg[0x38] & 0x80 ) &&
( ( ( state->m_pm_reg[0x19] & 0x10 ) && ( data & 0x02 ) ) ||
@@ -692,7 +692,7 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
int index = data & 0x07;
int cycles = ( state->m_pm_reg[0x1D] & 0x01 ) ? timer_to_cycles_slow[index] : timer_to_cycles_fast[index];
- state->m_timers.timer3->adjust(attotime::zero, 0, device->machine().device<cpu_device>("maincpu")->cycles_to_attotime(cycles));
+ state->m_timers.timer3->adjust(attotime::zero, 0, space.machine().device<cpu_device>("maincpu")->cycles_to_attotime(cycles));
}
/* Check for prescaler change for the high counter */
@@ -701,7 +701,7 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
int index = ( data >> 4 ) & 0x07;
int cycles = ( state->m_pm_reg[0x1D] & 0x02 ) ? timer_to_cycles_slow[index] : timer_to_cycles_fast[index];
- state->m_timers.timer3_hi->adjust(attotime::zero, 0, device->machine().device<cpu_device>("maincpu")->cycles_to_attotime(cycles));
+ state->m_timers.timer3_hi->adjust(attotime::zero, 0, space.machine().device<cpu_device>("maincpu")->cycles_to_attotime(cycles));
}
/* Check if timer2 low should be enabled */
@@ -738,7 +738,7 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
int index = state->m_pm_reg[0x1C] & 0x07;
int cycles = ( data & 0x01 ) ? timer_to_cycles_slow[index] : timer_to_cycles_fast[index];
- state->m_timers.timer3->adjust(attotime::zero, 0, device->machine().device<cpu_device>("maincpu")->cycles_to_attotime(cycles));
+ state->m_timers.timer3->adjust(attotime::zero, 0, space.machine().device<cpu_device>("maincpu")->cycles_to_attotime(cycles));
if ( ( state->m_pm_reg[0x1C] & 0x08 ) && ( state->m_pm_reg[0x48] & 0x04 ) &&
( ( ( state->m_pm_reg[0x19] & 0x10 ) && ( data & 0x01 ) ) ||
@@ -758,7 +758,7 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
int index = ( state->m_pm_reg[0x1C] >> 4 ) & 0x07;
int cycles = ( data & 0x02 ) ? timer_to_cycles_slow[index] : timer_to_cycles_fast[index];
- state->m_timers.timer3_hi->adjust(attotime::zero, 0, device->machine().device<cpu_device>("maincpu")->cycles_to_attotime(cycles));
+ state->m_timers.timer3_hi->adjust(attotime::zero, 0, space.machine().device<cpu_device>("maincpu")->cycles_to_attotime(cycles));
if ( ( state->m_pm_reg[0x1C] & 0x80 ) && ( state->m_pm_reg[0x49] & 0x04 ) && ! ( state->m_pm_reg[0x48] & 0x80 ) &&
( ( ( state->m_pm_reg[0x19] & 0x10 ) && ( data & 0x02 ) ) ||
@@ -779,7 +779,7 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
Bit 6-7 R/W VDraw/VBlank trigger Interrupt #1-#2
*/
state->m_pm_reg[0x20] = data;
- pokemini_check_irqs(device->machine());
+ pokemini_check_irqs(space.machine());
break;
case 0x21: /* Event #15-#22 priority
Bit 0-1 R/W Unknown
@@ -787,14 +787,14 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
Bit 4-7 R/W Unknown
*/
state->m_pm_reg[0x21] = data;
- pokemini_check_irqs(device->machine());
+ pokemini_check_irqs(space.machine());
break;
case 0x22: /* Event #9-#14 priority
Bit 0-1 R/W All #9 - #14 events - Interrupt #9-#14
Bit 2-7 Unused
*/
state->m_pm_reg[0x22] = data;
- pokemini_check_irqs(device->machine());
+ pokemini_check_irqs(space.machine());
break;
case 0x23: /* Event #1-#8 enable
Bit 0 R/W Timer 3 overflow (mirror) - Enable Interrupt #8
@@ -807,14 +807,14 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
Bit 7 R/W V-Blank trigger - Enable Interrupt #1
*/
state->m_pm_reg[0x23] = data;
- pokemini_check_irqs(device->machine());
+ pokemini_check_irqs(space.machine());
break;
case 0x24: /* Event #9-#12 enable
Bit 0-5 R/W Unknown
Bit 6-7 Unused
*/
state->m_pm_reg[0x24] = data;
- pokemini_check_irqs(device->machine());
+ pokemini_check_irqs(space.machine());
break;
case 0x25: /* Event #15-#22 enable
Bit 0 R/W Press key "A" event - Enable interrupt #22
@@ -827,7 +827,7 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
Bit 7 R/W Press power button event - Enable interrupt #15
*/
state->m_pm_reg[0x25] = data;
- pokemini_check_irqs(device->machine());
+ pokemini_check_irqs(space.machine());
break;
case 0x26: /* Event #13-#14 enable
Bit 0-2 R/W Unknown
@@ -837,7 +837,7 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
Bit 7 R/W IR receiver - low to high trigger - Enable interrupt #13
*/
state->m_pm_reg[0x26] = data;
- pokemini_check_irqs(device->machine());
+ pokemini_check_irqs(space.machine());
break;
case 0x27: /* Interrupt active flag #1-#8
Bit 0 Timer 3 overflow (mirror) / Clear interrupt #8
@@ -850,7 +850,7 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
Bit 7 VBlank trigger / Clear interrupt #1
*/
state->m_pm_reg[0x27] &= ~data;
- pokemini_check_irqs(device->machine());
+ pokemini_check_irqs(space.machine());
return;
case 0x28: /* Interrupt active flag #9-#12
Bit 0-1 Unknown
@@ -861,7 +861,7 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
Bit 6-7 Unknown
*/
state->m_pm_reg[0x28] &= ~data;
- pokemini_check_irqs(device->machine());
+ pokemini_check_irqs(space.machine());
return;
case 0x29: /* Interrupt active flag #15-#22
Bit 0 Press key "A" event / Clear interrupt #22
@@ -874,7 +874,7 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
Bit 7 Press power button event / Clear interrupt #15
*/
state->m_pm_reg[0x29] &= ~data;
- pokemini_check_irqs(device->machine());
+ pokemini_check_irqs(space.machine());
return;
case 0x2A: /* Interrupt active flag #13-#14
Bit 0-5 Unknown
@@ -882,7 +882,7 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
Bit 7 Unknown / Clear interrupt #13
*/
state->m_pm_reg[0x2A] &= ~data;
- pokemini_check_irqs(device->machine());
+ pokemini_check_irqs(space.machine());
return;
case 0x30: /* Timer 1 control 1
Bit 0 R/W Unknown
@@ -956,7 +956,7 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
*/
case 0x35: /* Timer 1 sound-pivot (high, unused)
*/
- logerror( "%0X: Write to unknown hardware address: %02X, %02X\n", device->machine().firstcpu->pc( ), offset, data );
+ logerror( "%0X: Write to unknown hardware address: %02X, %02X\n", space.machine().firstcpu->pc( ), offset, data );
break;
case 0x36: /* Timer 1 counter (low), read only
*/
@@ -1035,7 +1035,7 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
*/
case 0x3D: /* Timer 2 sound-pivot (high, unused)
*/
- logerror( "%0X: Write to unknown hardware address: %02X, %02X\n", device->machine().firstcpu->pc( ), offset, data );
+ logerror( "%0X: Write to unknown hardware address: %02X, %02X\n", space.machine().firstcpu->pc( ), offset, data );
break;
case 0x3E: /* Timer 2 counter (low), read only
Bit 0-7 R/W Timer 2 counter value bit 0-7
@@ -1095,7 +1095,7 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
state->m_timers.timer3_hi->enable( 0 );
}
state->m_pm_reg[0x48] = data;
- pokemini_update_sound(device->machine());
+ pokemini_update_sound(space.machine());
break;
case 0x49: /* Timer 3 control 2
Bit 0 R/W Unknown
@@ -1121,25 +1121,25 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
state->m_timers.timer3_hi->enable( 0 );
}
state->m_pm_reg[0x49] = data;
- pokemini_update_sound(device->machine());
+ pokemini_update_sound(space.machine());
break;
case 0x4A: /* Timer 3 preset value (low)
Bit 0-7 R/W Timer 3 preset value bit 0-7
*/
state->m_pm_reg[0x4A] = data;
- pokemini_update_sound(device->machine());
+ pokemini_update_sound(space.machine());
break;
case 0x4B: /* Timer 3 preset value (high)
Bit 0-7 R/W Timer 3 preset value bit 8-15
*/
state->m_pm_reg[0x4B] = data;
- pokemini_update_sound(device->machine());
+ pokemini_update_sound(space.machine());
break;
case 0x4C: /* Timer 3 sound-pivot (low)
Bit 0-7 R/W Timer 3 sound-pivot value bit 0-7
*/
state->m_pm_reg[0x4C] = data;
- pokemini_update_sound(device->machine());
+ pokemini_update_sound(space.machine());
break;
case 0x4D: /* Timer 3 sound-pivot (high)
Bit 0-7 R/W Timer 3 sound-pivot value bit 8-15
@@ -1150,7 +1150,7 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
Pulse-Width of 100% = Same as preset-value
*/
state->m_pm_reg[0x4D] = data;
- pokemini_update_sound(device->machine());
+ pokemini_update_sound(space.machine());
break;
case 0x4E: /* Timer 3 counter (low), read only
Bit 0-7 R/W Timer 3 counter value bit 0-7
@@ -1200,7 +1200,7 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
break;
case 0x70: /* Sound related */
state->m_pm_reg[0x70] = data;
- pokemini_update_sound(device->machine());
+ pokemini_update_sound(space.machine());
break;
case 0x71: /* Sound volume
Bit 0-1 R/W Sound volume
@@ -1212,7 +1212,7 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
Bit 3-7 Unused
*/
state->m_pm_reg[0x71] = data;
- pokemini_update_sound(device->machine());
+ pokemini_update_sound(space.machine());
break;
case 0x80: /* LCD control
Bit 0 R/W Invert colors; 0 - normal, 1 - inverted
@@ -1300,7 +1300,7 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
Map size 2: 0x00 to 0x60
Bit 7 Unused
*/
- logerror( "%0X: Write to unknown hardware address: %02X, %02X\n", device->machine().firstcpu->pc( ), offset, data );
+ logerror( "%0X: Write to unknown hardware address: %02X, %02X\n", space.machine().firstcpu->pc( ), offset, data );
break;
case 0x87: /* Sprite tile data memory offset (low)
Bit 0-5 Always "0"
@@ -1341,7 +1341,7 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
// lcd_data_w( data );
break;
default:
- logerror( "%0X: Write to unknown hardware address: %02X, %02X\n", device->machine().firstcpu->pc( ), offset, data );
+ logerror( "%0X: Write to unknown hardware address: %02X, %02X\n", space.machine().firstcpu->pc( ), offset, data );
break;
}
state->m_pm_reg[offset] = data;
@@ -1349,7 +1349,7 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
READ8_DEVICE_HANDLER( pokemini_hwreg_r )
{
- pokemini_state *state = device->machine().driver_data<pokemini_state>();
+ pokemini_state *state = space.machine().driver_data<pokemini_state>();
UINT8 data = state->m_pm_reg[offset];
switch( offset )