static READ32_HANDLER( speedup_r ) { int result = *speedup_data; if ((activecpu_get_previouspc() & 0xfffff) == 0x006f0 && result == activecpu_get_reg(ASAP_R3)) cpu_spinuntil_int(); return result; }
static READ32_HANDLER( speedup_r ) { int result = *speedup_data; if ((cpu_get_previouspc(space->cpu) & 0xfffff) == 0x006f0 && result == cpu_get_reg(space->cpu, ASAP_R3)) cpu_spinuntil_int(space->cpu); return result; }
int simpsons_speedup1_r( int offs ) { unsigned char *RAM = memory_region(REGION_CPU1); int data1 = RAM[0x486a]; if ( data1 == 0 ) { int data2 = ( RAM[0x4942] << 8 ) | RAM[0x4943]; if ( data2 < memory_region_length(REGION_CPU1) ) { data2 = ( RAM[data2] << 8 ) | RAM[data2 + 1]; if ( data2 == 0xffff ) cpu_spinuntil_int(); return RAM[0x4942]; } return RAM[0x4942]; } if ( data1 == 1 ) RAM[0x486a]--; return RAM[0x4942]; }
static READ16_HANDLER( sub_cycle_r ) { if (activecpu_get_pc()==0x454) cpu_spinuntil_int(); return superchs_ram[2]&0xffff; }
static READ32_HANDLER( kinst_control_r ) { UINT32 result; /* apply shuffling */ offset = control_map[offset / 2]; result = kinst_control[offset]; switch (offset) { case 2: /* $90 -- sound return */ result = 0xffff0000 | readinputport(offset); result &= ~0x0002; if (dcs_control_r() & 0x800) result |= 0x0002; break; case 0: /* $80 */ case 1: /* $88 */ case 3: /* $98 */ result = 0xffff0000 | readinputport(offset); break; case 4: /* $a0 */ result = 0xffff0000 | readinputport(offset); if (activecpu_get_pc() == 0x802d428) cpu_spinuntil_int(); break; } return result; }
static READ32_HANDLER( kinst_control_r ) { UINT32 result; static const char *const portnames[] = { "P1", "P2", "VOLUME", "UNUSED", "DSW" }; /* apply shuffling */ offset = control_map[offset / 2]; result = kinst_control[offset]; switch (offset) { case 2: /* $90 -- sound return */ result = input_port_read(space->machine, portnames[offset]); result &= ~0x0002; if (dcs_control_r() & 0x800) result |= 0x0002; break; case 0: /* $80 */ case 1: /* $88 */ case 3: /* $98 */ result = input_port_read(space->machine, portnames[offset]); break; case 4: /* $a0 */ result = input_port_read(space->machine, portnames[offset]); if (cpu_get_pc(space->cpu) == 0x802d428) cpu_spinuntil_int(space->cpu); break; } return result; }
ROM_END static READ32_HANDLER( main_cycle_r ) { if (activecpu_get_pc()==0x702) cpu_spinuntil_int(); return superchs_ram[0]; }
static READ16_HANDLER( speedup_r ) { if ((cpu_get_pc(space->cpu) == 0xc12d) && (!(su_82 & 0xff00))) { cpu_spinuntil_int(space->cpu); } return su_82; }
int simpsons_speedup2_r( int offs ) { int data = memory_region(REGION_CPU1)[0x4856]; if ( data == 1 ) cpu_spinuntil_int(); return data; }
static READ16_HANDLER( thndzone_main_skip ) { int ret=dassault_ram[0]; if (activecpu_get_pc()==0x114c && ret&0x8000) cpu_spinuntil_int(); return ret; }
static READ16_HANDLER( speedup_r ) { if ((activecpu_get_pc() == 0xc12d) && (!(su_82 & 0xff00))) { cpu_spinuntil_int(); } return su_82; }
static READ_HANDLER( speedup_r ) { int data = memory_region(REGION_CPU1)[0x1837]; if ( cpu_get_pc() == 0xa400 && data == 0 ) cpu_spinuntil_int(); return data; }
static WRITE_HANDLER( blockade_videoram_w ) { videoram_w(offset, data); if (input_port_3_r(0) & 0x80) { logerror("blockade_videoram_w: scanline %d\n", cpu_getscanline()); cpu_spinuntil_int(); } }
ROM_END /******************************************************************************/ static READ_HANDLER( supbtime_cycle_r ) { if (cpu_get_pc()==0x7e2 && READ_WORD(&supbtime_ram[0])==0) {cpu_spinuntil_int(); return 1;} return READ_WORD(&supbtime_ram[0]); }
static READ16_HANDLER( thndzone_main_skip ) { dassault_state *state = space->machine->driver_data<dassault_state>(); int ret = state->ram[0]; if (cpu_get_pc(space->cpu) == 0x114c && ret & 0x8000) cpu_spinuntil_int(space->cpu); return ret; }
/* * Sound V3.0 * * Used by puzzle de pon and Super Sidekicks 2 * */ static READ_HANDLER( cycle_v3_sr ) { unsigned char *RAM = memory_region(REGION_CPU2); if (cpu_get_pc()==0x0137) { cpu_spinuntil_int(); return RAM[0xfeb1]; } return RAM[0xfeb1]; }
/* * Also sound revision no 3.0, but different types. */ static READ_HANDLER( ssideki_cycle_sr ) { unsigned char *RAM = memory_region(REGION_CPU2); if (cpu_get_pc()==0x015A) { cpu_spinuntil_int(); return RAM[0xfef3]; } return RAM[0xfef3]; }
static READ_HANDLER( maglord_cycle_sr ) { unsigned char *RAM = memory_region(REGION_CPU2); if (cpu_get_pc()==0xd487) { cpu_spinuntil_int(); return RAM[0xfb91]; } return RAM[0xfb91]; }
static READ_HANDLER( vwpoint_cycle_sr ) { unsigned char *RAM = memory_region(REGION_CPU2); if (cpu_get_pc()==0x0143) { cpu_spinuntil_int(); return RAM[0xfe46]; } return RAM[0xfe46]; }
static int jap_cycle_r(int offset) { int pc=cpu_get_pc(); int ret=READ_WORD(&prehisle_ram[0x24]); if ((ret&0x8000) && (pc==0x34b6 /* Todo! */ )) { cpu_spinuntil_int(); return ret&0x7fff; } return ret; }
static int usa_cycle_r(int offset) { int pc=cpu_get_pc(); int ret=READ_WORD(&prehisle_ram[0x24]); if ((ret&0x8000) && (pc==0x281e || pc==0x28a6 || pc==0x295a || pc==0x2868 || pc==0x8f98 || pc==0x3b1e)) { cpu_spinuntil_int(); return ret&0x7fff; } return ret; }
void digdug_sharedram_w(int offset,int data) { /* a video ram write */ if (offset < 0x400) dirtybuffer[offset] = 1; /* location 9b3d is set to zero just before CPU 2 spins */ if (offset == 0x1b3d && data == 0 && cpu_get_pc () == 0x1df1 && cpu_getactivecpu () == 1) cpu_spinuntil_int (); digdug_sharedram[offset] = data; }
static READ32_HANDLER( movie_speedup_r ) { int result = *movie_speedup_data; if ((cpu_get_previouspc(space->cpu) & 0xfffff) == 0x00a88 && (cpu_get_reg(space->cpu, ASAP_R28) & 0xfffff) == 0x397c0 && movie_speedup_data[4] == cpu_get_reg(space->cpu, ASAP_R1)) { UINT32 temp = (INT16)result + movie_speedup_data[4] * 262; if (temp - (UINT32)cpu_get_reg(space->cpu, ASAP_R15) < (UINT32)cpu_get_reg(space->cpu, ASAP_R23)) cpu_spinuntil_int(space->cpu); } return result; }
static READ_HANDLER( minasan_cycle_r ) { int mem; if (cpu_get_pc()==0x17766) { cpu_spinuntil_int(); mem=READ_WORD(&neogeo_ram[0x00ca]); mem--; WRITE_WORD(&neogeo_ram[0x00ca],mem); return mem; } return READ_WORD(&neogeo_ram[0x00ca]); }
/* Above prom also at 16s and 17s */ ROM_END /**********************************************************************************/ static READ16_HANDLER( dassault_main_skip ) { int ret=dassault_ram[0]; if (activecpu_get_previouspc()==0x1170 && ret&0x8000) cpu_spinuntil_int(); return ret; }
static READ_HANDLER( bakatono_cycle_r ) { int mem; if (cpu_get_pc()==0x197cc) { cpu_spinuntil_int(); mem=READ_WORD(&neogeo_ram[0x00fa]); mem--; WRITE_WORD(&neogeo_ram[0x00fa],mem); return mem; } return READ_WORD(&neogeo_ram[0x00fa]); }
static int cyclej_r(int offset) { int pc=cpu_get_pc(); int ret=actfancr_ram[0x26]; if (offset==1) return actfancr_ram[0x27]; if (pc==0xe2b1 && ret==0) { cpu_spinuntil_int(); return 1; } return ret; }
/* Above prom also at 16s and 17s */ ROM_REGION( 0x1000, "plds", 0 ) ROM_LOAD( "pal16r8a 1h", 0x0000, 0x0104, NO_DUMP ) /* PAL is read protected */ ROM_LOAD( "pal16l8b.7c", 0x0200, 0x0104, NO_DUMP ) /* PAL is read protected */ ROM_LOAD( "pal16l8b.7d", 0x0400, 0x0104, CRC(199e83fd) SHA1(ebb5d66f29935b0a58e79b0db30611b5dce328a6) ) /* PAL is read protected */ ROM_LOAD( "pal16l8b.7e", 0x0600, 0x0104, NO_DUMP ) /* PAL is read protected */ ROM_LOAD( "pal16l8b.7l", 0x0800, 0x0104, NO_DUMP ) /* PAL is read protected */ ROM_LOAD( "pal16l8b.8e", 0x0a00, 0x0104, NO_DUMP ) /* PAL is read protected */ ROM_LOAD( "pal16l8b.9d", 0x0c00, 0x0104, NO_DUMP ) /* PAL is read protected */ ROM_LOAD( "pal16l8b.10c", 0x0e00, 0x0104, NO_DUMP ) /* PAL is read protected */ ROM_END /**********************************************************************************/ static READ16_HANDLER( dassault_main_skip ) { dassault_state *state = space->machine->driver_data<dassault_state>(); int ret = state->ram[0]; if (cpu_get_previouspc(space->cpu) == 0x1170 && ret & 0x8000) cpu_spinuntil_int(space->cpu); return ret; }
static READ8_HANDLER( cyclej_r ) { int pc=activecpu_get_pc(); int ret=actfancr_ram[0x26]; if (offset==1) return actfancr_ram[0x27]; if (pc==0xe2b1 && ret==0) { cpu_spinuntil_int(); return 1; } return ret; }
ROM_END /******************************************************************************/ static int world_cycle_r(int offset) { int pc=cpu_get_pc(); int ret=READ_WORD(&prehisle_ram[0x24]); if ((ret&0x8000) && (pc==0x260c || pc==0x268a || pc==0x2b0a || pc==0x34a8 || pc==0x6ae4 || pc==0x83ac || pc==0x25ce || pc==0x29c4)) { cpu_spinuntil_int(); return ret&0x7fff; } return ret; }