summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/machine/decoprot.c
diff options
context:
space:
mode:
author Brian Troha <briantro@users.noreply.github.com>2008-01-01 22:15:01 +0000
committer Brian Troha <briantro@users.noreply.github.com>2008-01-01 22:15:01 +0000
commitc2d269ced61bdb8465bdb1b8139c8b5872f88aed (patch)
tree69a0dcd961dfb0198b31d3d4824d4f2e8f2abf87 /src/mame/machine/decoprot.c
parent0738d02527e8d38a6f5b09d171af47e22d17f37e (diff)
Checking in Bryan McPhail's MAMETesters Challenge fixes
Fixes: funkyjet055yel liberate074u1gre tokiu056gre
Diffstat (limited to 'src/mame/machine/decoprot.c')
-rw-r--r--src/mame/machine/decoprot.c19
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;
}