diff options
Diffstat (limited to 'src/mame/machine/decoprot.c')
-rw-r--r-- | src/mame/machine/decoprot.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/mame/machine/decoprot.c b/src/mame/machine/decoprot.c index 4acf0a102c6..4280aae7701 100644 --- a/src/mame/machine/decoprot.c +++ b/src/mame/machine/decoprot.c @@ -701,15 +701,25 @@ READ16_HANDLER( deco16_146_funkyjet_prot_r ) return deco16_prot_ram[0x104>>1]; case 0x3a8 >> 1: /* See 93e4/9376 */ return deco16_prot_ram[0x500>>1]; - case 0x3e8 >> 1: + + // The top byte of 0x50c is used as a bitmask of completed levels, + // checked at end of each (0x0100 = level 1 completed, + // 0x3000 = levels 5 & 6 completed, 0x3f00 = levels 1-6 completed, etc) + case 0x56c >> 1: return deco16_prot_ram[0x50c>>1]; + // The game compares $ffc0 to check for all 6 basic levels + // being completed. (which is 0x3f00 inverted and shifted) + // If wrong value is returned here the level select screen is + // incorrectly shown and leads to a crash as that screen + // cannot cope with all levels being already completed. + case 0x3e8 >> 1: + return (deco16_prot_ram[0x50c>>1] >> 8) ^ 0xffff; + case 0x4e4 >> 1: return deco16_prot_ram[0x702>>1]; case 0x562 >> 1: return deco16_prot_ram[0x18e>>1]; - case 0x56c >> 1: - return deco16_prot_ram[0x50c>>1]; case 0x688 >> 1: return deco16_prot_ram[0x300>>1]; @@ -737,7 +747,8 @@ READ16_HANDLER( deco16_146_funkyjet_prot_r ) return (readinputport(3) + (readinputport(4) << 8)); } - if (activecpu_get_pc()!=0xc0ea) logerror("CPU #0 PC %06x: warning - read unmapped control address %06x\n",activecpu_get_pc(),offset<<1); + if (activecpu_get_pc()!=0xc0ea) + logerror("CPU #0 PC %06x: warning - read unmapped control address %06x (ctrl %04x)\n",activecpu_get_pc(),offset<<1, readinputport(0)); return 0; } |