diff --git a/src/emu/machine/s3c2410.h b/src/emu/machine/s3c2410.h index b2da4a6b493..fc745340b12 100644 --- a/src/emu/machine/s3c2410.h +++ b/src/emu/machine/s3c2410.h @@ -36,6 +36,8 @@ enum DECLARE_LEGACY_DEVICE(S3C2410, s3c2410); +READ32_DEVICE_HANDLER( s3c24xx_lcd_r ); + /******************************************************************************* TYPE DEFINITIONS *******************************************************************************/ diff --git a/src/emu/machine/s3c24xx.c b/src/emu/machine/s3c24xx.c index 08656be966e..b807e6da052 100644 --- a/src/emu/machine/s3c24xx.c +++ b/src/emu/machine/s3c24xx.c @@ -734,7 +734,7 @@ static UINT32 s3c24xx_video_update( running_device *device, screen_device *scree return 0; } -static READ32_DEVICE_HANDLER( s3c24xx_lcd_r ) +READ32_DEVICE_HANDLER( s3c24xx_lcd_r ) { s3c24xx_t *s3c24xx = get_token( device); UINT32 data = ((UINT32*)&s3c24xx->lcd.regs)[offset]; diff --git a/src/mame/drivers/ghosteo.c b/src/mame/drivers/ghosteo.c index 2e85ecf5d72..cb711916b3d 100644 --- a/src/mame/drivers/ghosteo.c +++ b/src/mame/drivers/ghosteo.c @@ -390,6 +390,39 @@ static const i2cmem_interface i2cmem_interface = I2CMEM_SLAVE_ADDRESS, 0, 256 }; + +running_device* s3c2410; + +static READ32_HANDLER( bballoon_speedup_r ) +{ + UINT32 ret = s3c24xx_lcd_r(s3c2410, offset+0x10/4, mem_mask); + + + int pc = cpu_get_pc(space->cpu); + + // these are vblank waits + if (pc == 0x3001c0e4 || pc == 0x3001c0d8) + { + // BnB Arcade + cpu_spinuntil_time(space->cpu, ATTOTIME_IN_USEC(20)); + } + else if (pc == 0x3002b580 || pc == 0x3002b550) + { + // Happy Tour + cpu_spinuntil_time(space->cpu, ATTOTIME_IN_USEC(20)); + } + //else + // printf("speedup %08x %08x\n", pc, ret); + + return ret; +} + +static MACHINE_RESET( bballoon ) +{ + memory_install_read32_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x4d000010, 0x4d000013, 0, 0, bballoon_speedup_r); + s3c2410 = machine->device("s3c2410"); +} + static MACHINE_CONFIG_START( bballoon, driver_device ) /* basic machine hardware */ @@ -405,6 +438,8 @@ static MACHINE_CONFIG_START( bballoon, driver_device ) MDRV_PALETTE_LENGTH(256) + MDRV_MACHINE_RESET( bballoon ) + MDRV_VIDEO_START(s3c2410) MDRV_VIDEO_UPDATE(s3c2410)