From 295dc068478f0ac05baac0e92524e5c3378032a6 Mon Sep 17 00:00:00 2001 From: iq_132 <1191709+iq132@users.noreply.github.com> Date: Tue, 13 Aug 2013 00:06:03 +0000 Subject: [PATCH] Fix olds High Score screen (improve protection emulation) [rockywall, Creamy Mami, JackC, IQ_132] --- src/burn/drv/pgm/pgm_prot.cpp | 38 ++++++++++++++++++++++++++++++----- 1 file changed, 33 insertions(+), 5 deletions(-) diff --git a/src/burn/drv/pgm/pgm_prot.cpp b/src/burn/drv/pgm/pgm_prot.cpp index 23345fa2d..932eade8d 100644 --- a/src/burn/drv/pgm/pgm_prot.cpp +++ b/src/burn/drv/pgm/pgm_prot.cpp @@ -3208,13 +3208,41 @@ static void __fastcall olds_protection_w(UINT32 offset, UINT16 data) case 0x64: // incomplete... { - UINT16 p1 = sharedprotram[0x3050 / 2]; - UINT16 p2 = sharedprotram[0x3082 / 2]; + UINT16 p1 = sharedprotram[0x3050 / 2]; + UINT16 p2 = sharedprotram[0x3082 / 2]; + UINT16 p3 = sharedprotram[0x3054 / 2]; + UINT16 p4 = sharedprotram[0x3088 / 2]; - if (p2 == 0x02) - olds_write_reg(p1, olds_read_reg(p1) + 0x10000); + if (p2 == 0x02) + olds_write_reg(p1, olds_read_reg(p1) + 0x10000); + + switch (p4) + { + case 0xd: + olds_write_reg(p1,olds_read_reg(p3)); + break; + case 0x0: + olds_write_reg(p3,(olds_read_reg(p2))^(olds_read_reg(p1))); + break; + case 0xe: + olds_write_reg(p3,olds_read_reg(p3)+0x10000); + break; + case 0x2: + olds_write_reg(p1,(olds_read_reg(p2))+(olds_read_reg(p3))); + break; + case 0x6: + olds_write_reg(p3,(olds_read_reg(p2))&(olds_read_reg(p1))); + break; + case 0x1: + olds_write_reg(p2,olds_read_reg(p1)+0x10000); + break; + case 0x7: + olds_write_reg(p3,olds_read_reg(p1)); + break; + default: + break; + } } - break; } m_olds_cmd3 = ((data >> 4) + 1) & 0x3;