Page 1 of 1

[outzone*] "Select Starting Level" cheat

Posted: Fri Aug 27, 2010 6:30 pm
by stephh
Here are cheats to select your starting level in 'outzone' and its clones to be appended to your .xml files ... As they affect ROM area, each set has to have its own cheats ...

outzone.xml :

Code: Select all

  <cheat desc="Select Starting Level">
    <parameter min="1" max="7" step="1"/>
    <script state="run">
      <action>maincpu.mw@013abe=4e71</action> <comment>Ignore checksum error (ROM EVEN)</comment>
      <action>maincpu.mw@013ad4=6022</action> <comment>Ignore checksum error (ROM ODD)</comment>
      <action>maincpu.mw@000970=4ef9</action> <comment>Jump to our patched routine</comment>
      <action>maincpu.mw@000972=0003</action>
      <action>maincpu.mw@000974=ffd0</action>
      <action>maincpu.mw@000976=4e71</action>
      <action>maincpu.mw@000978=4e71</action>
      <action>maincpu.mw@00097a=4e71</action>
      <action>maincpu.mw@03ffd0=48e7</action> <comment>Our patched routine starts here</comment>
      <action>maincpu.mw@03ffd2=fffe</action>
      <action>maincpu.mb@03ffd4=70</action>
      <action>maincpu.mb@03ffd5=(param-1)</action>
      <action>maincpu.mw@03ffd6=d179</action>
      <action>maincpu.mw@03ffd8=0024</action>
      <action>maincpu.mw@03ffda=0c02</action>
      <action>maincpu.mw@03ffdc=4cdf</action>
      <action>maincpu.mw@03ffde=7fff</action>
      <action>maincpu.mw@03ffe0=4a79</action> <comment>Copy of the original code</comment>
      <action>maincpu.mw@03ffe2=0024</action>
      <action>maincpu.mw@03ffe4=0b4a</action>
      <action>maincpu.mw@03ffe6=6704</action>
      <action>maincpu.mw@03ffe8=32bc</action>
      <action>maincpu.mw@03ffea=0004</action>
      <action>maincpu.mw@03ffec=4ef9</action> <comment>Back to the original routine</comment>
      <action>maincpu.mw@03ffee=0000</action>
      <action>maincpu.mw@03fff0=097c</action>
    </script>
    <script state="off">
      <action>maincpu.mb@03ffd5=00</action>
    </script>
  </cheat>
outzonea.xml :

Code: Select all

  <cheat desc="Select Starting Level">
    <parameter min="1" max="7" step="1"/>
    <script state="run">
      <action>maincpu.mw@013af4=4e71</action> <comment>Ignore checksum error (ROM EVEN)</comment>
      <action>maincpu.mw@013b0a=6022</action> <comment>Ignore checksum error (ROM ODD)</comment>
      <action>maincpu.mw@000970=4ef9</action> <comment>Jump to our patched routine</comment>
      <action>maincpu.mw@000972=0003</action>
      <action>maincpu.mw@000974=ffd0</action>
      <action>maincpu.mw@000976=4e71</action>
      <action>maincpu.mw@000978=4e71</action>
      <action>maincpu.mw@00097a=4e71</action>
      <action>maincpu.mw@03ffd0=48e7</action> <comment>Our patched routine starts here</comment>
      <action>maincpu.mw@03ffd2=fffe</action>
      <action>maincpu.mb@03ffd4=70</action>
      <action>maincpu.mb@03ffd5=(param-1)</action>
      <action>maincpu.mw@03ffd6=d179</action>
      <action>maincpu.mw@03ffd8=0024</action>
      <action>maincpu.mw@03ffda=0c02</action>
      <action>maincpu.mw@03ffdc=4cdf</action>
      <action>maincpu.mw@03ffde=7fff</action>
      <action>maincpu.mw@03ffe0=4a79</action> <comment>Copy of the original code</comment>
      <action>maincpu.mw@03ffe2=0024</action>
      <action>maincpu.mw@03ffe4=0b4a</action>
      <action>maincpu.mw@03ffe6=6704</action>
      <action>maincpu.mw@03ffe8=32bc</action>
      <action>maincpu.mw@03ffea=0004</action>
      <action>maincpu.mw@03ffec=4ef9</action> <comment>Back to the original routine</comment>
      <action>maincpu.mw@03ffee=0000</action>
      <action>maincpu.mw@03fff0=097c</action>
    </script>
    <script state="off">
      <action>maincpu.mb@03ffd5=00</action>
    </script>
  </cheat>
outzoneb.xml :

Code: Select all

  <cheat desc="Select Starting Level">
    <parameter min="1" max="7" step="1"/>
    <script state="run">
      <action>maincpu.mw@0126cc=4e71</action> <comment>Ignore checksum error (ROM EVEN)</comment>
      <action>maincpu.mw@0126e2=6024</action> <comment>Ignore checksum error (ROM ODD)</comment>
      <action>maincpu.mw@0008be=4ef9</action> <comment>Jump to our patched routine</comment>
      <action>maincpu.mw@0008c0=0003</action>
      <action>maincpu.mw@0008c2=ffd0</action>
      <action>maincpu.mw@0008c4=4e71</action>
      <action>maincpu.mw@0008c6=4e71</action>
      <action>maincpu.mw@0008c8=4e71</action>
      <action>maincpu.mw@03ffd0=48e7</action> <comment>Our patched routine starts here</comment>
      <action>maincpu.mw@03ffd2=fffe</action>
      <action>maincpu.mb@03ffd4=70</action>
      <action>maincpu.mb@03ffd5=(param-1)</action>
      <action>maincpu.mw@03ffd6=d179</action>
      <action>maincpu.mw@03ffd8=0024</action>
      <action>maincpu.mw@03ffda=0c02</action>
      <action>maincpu.mw@03ffdc=4cdf</action>
      <action>maincpu.mw@03ffde=7fff</action>
      <action>maincpu.mw@03ffe0=4a79</action> <comment>Copy of the original code</comment>
      <action>maincpu.mw@03ffe2=0024</action>
      <action>maincpu.mw@03ffe4=0b4a</action>
      <action>maincpu.mw@03ffe6=6704</action>
      <action>maincpu.mw@03ffe8=32bc</action>
      <action>maincpu.mw@03ffea=0004</action>
      <action>maincpu.mw@03ffec=4ef9</action> <comment>Back to the original routine</comment>
      <action>maincpu.mw@03ffee=0000</action>
      <action>maincpu.mw@03fff0=08ca</action>
    </script>
    <script state="off">
      <action>maincpu.mb@03ffd5=00</action>
    </script>
  </cheat>
outzonec.xml :

Code: Select all

  <cheat desc="Select Starting Level">
    <parameter min="1" max="7" step="1"/>
    <script state="run">
      <action>maincpu.mw@013af4=4e71</action> <comment>Ignore checksum error (ROM EVEN)</comment>
      <action>maincpu.mw@013b0a=6022</action> <comment>Ignore checksum error (ROM ODD)</comment>
      <action>maincpu.mw@000970=4ef9</action> <comment>Jump to our patched routine</comment>
      <action>maincpu.mw@000972=0003</action>
      <action>maincpu.mw@000974=ffd0</action>
      <action>maincpu.mw@000976=4e71</action>
      <action>maincpu.mw@000978=4e71</action>
      <action>maincpu.mw@00097a=4e71</action>
      <action>maincpu.mw@03ffd0=48e7</action> <comment>Our patched routine starts here</comment>
      <action>maincpu.mw@03ffd2=fffe</action>
      <action>maincpu.mb@03ffd4=70</action>
      <action>maincpu.mb@03ffd5=(param-1)</action>
      <action>maincpu.mw@03ffd6=d179</action>
      <action>maincpu.mw@03ffd8=0024</action>
      <action>maincpu.mw@03ffda=0c02</action>
      <action>maincpu.mw@03ffdc=4cdf</action>
      <action>maincpu.mw@03ffde=7fff</action>
      <action>maincpu.mw@03ffe0=4a79</action> <comment>Copy of the original code</comment>
      <action>maincpu.mw@03ffe2=0024</action>
      <action>maincpu.mw@03ffe4=0b4a</action>
      <action>maincpu.mw@03ffe6=6704</action>
      <action>maincpu.mw@03ffe8=32bc</action>
      <action>maincpu.mw@03ffea=0004</action>
      <action>maincpu.mw@03ffec=4ef9</action> <comment>Back to the original routine</comment>
      <action>maincpu.mw@03ffee=0000</action>
      <action>maincpu.mw@03fff0=097c</action>
    </script>
    <script state="off">
      <action>maincpu.mb@03ffd5=00</action>
    </script>
  </cheat>
outzoned.xml :

Code: Select all

  <cheat desc="Select Starting Level">
    <parameter min="1" max="7" step="1"/>
    <script state="run">
      <action>maincpu.mw@013a06=4e71</action> <comment>Ignore checksum error (ROM EVEN)</comment>
      <action>maincpu.mw@013a1c=6024</action> <comment>Ignore checksum error (ROM ODD)</comment>
      <action>maincpu.mw@0008c0=4ef9</action> <comment>Jump to our patched routine</comment>
      <action>maincpu.mw@0008c2=0003</action>
      <action>maincpu.mw@0008c4=ffd0</action>
      <action>maincpu.mw@0008c6=4e71</action>
      <action>maincpu.mw@0008c8=4e71</action>
      <action>maincpu.mw@0008ca=4e71</action>
      <action>maincpu.mw@03ffd0=48e7</action> <comment>Our patched routine starts here</comment>
      <action>maincpu.mw@03ffd2=fffe</action>
      <action>maincpu.mb@03ffd4=70</action>
      <action>maincpu.mb@03ffd5=(param-1)</action>
      <action>maincpu.mw@03ffd6=d179</action>
      <action>maincpu.mw@03ffd8=0024</action>
      <action>maincpu.mw@03ffda=0c02</action>
      <action>maincpu.mw@03ffdc=4cdf</action>
      <action>maincpu.mw@03ffde=7fff</action>
      <action>maincpu.mw@03ffe0=4a79</action> <comment>Copy of the original code</comment>
      <action>maincpu.mw@03ffe2=0024</action>
      <action>maincpu.mw@03ffe4=0b4a</action>
      <action>maincpu.mw@03ffe6=6704</action>
      <action>maincpu.mw@03ffe8=32bc</action>
      <action>maincpu.mw@03ffea=0004</action>
      <action>maincpu.mw@03ffec=4ef9</action> <comment>Back to the original routine</comment>
      <action>maincpu.mw@03ffee=0000</action>
      <action>maincpu.mw@03fff0=08cc</action>
    </script>
    <script state="off">
      <action>maincpu.mb@03ffd5=00</action>
    </script>
  </cheat>
For best effect, activate the cheat, then reset MAME (F3 key) ...

Note the way I've handled the cheat when you turn it off : by default, you start from level 1 and there is 0x00 at 0x03ffd5.b ... This also has the main advantage of NOT having many temp variables and of shortening the .xml files :)

FYI, here is the explanation of the patched code (sample from 'outzone') :

Code: Select all

013ABE: 4E71                       nop                           ; Ignore checksum error (ROM EVEN)

013AD4: 6022                       bra     $13af8                ; Ignore checksum error (ROM ODD)

000970: 4EF9 0003 FFE0             jmp     $3ffd0.l              ; Jump to our patched routine
000976: 4E71                       nop
000978: 4E71                       nop
00097a: 4E71                       nop

03FFD0: 48E7 FFFE                  movem.l D0-D7/A0-A6, -(A7)    ; Our patched routine starts here
03FFD4: 70xx                       moveq   xx, D0                ; Starting level - 1 (the value in D0 must be between 0 and 6)
03FFD6: D179 0024 0c02             add.w   D0, $240c02.l
03FFDC: 4CDF 7FFF                  movem.l (A7)+, D0-D7/A0-A6
03FFE0: 4A79 0024 0B4A             tst.w   $240b4a.l             ; Copy of the original code
03FFE6: 6704                       beq     $3ffec
03FFE8: 32BC 0004                  move.w  #$4, (A1)
03FFEC: 4EF9 0000 097c             jmp     $97c.l                ; Back to the original routine
Feel free to comment ...

Image Steph from The Ultimate Patchers Image

Re: [outzone*] "Select Starting Level" cheat

Posted: Fri Aug 27, 2010 8:28 pm
by Pugsy
My first thought was that a massive amount of code for a select starting level cheat. Had a quick look and I can see why you used so much code, changing the poke for this game is excessive - it's easier to change the first peek to a poke. I would not include a Skip ROM check cheat with the cheat either...

I'd have something a lot smaller like this for outzone.xml:-

Code: Select all

  <cheat desc="Select Starting Level">
    <parameter min="1" max="7" step="1"/>
    <script state="run">
      <action>maincpu.mb@0029C9=(param-1)</action>
      <action>maincpu.mw@0029CA=33C0</action>
    </script>
    <script state="off">
      <action>maincpu.mb@0029C9=00</action>
      <action>maincpu.mw@0029CA=3039</action>
    </script>
  </cheat>

  <cheat desc="Skip ROM Checks">
    <script state="on">
      <action>temp0 =maincpu.mw@013AD6</action>
    </script>
    <script state="run">
      <action>maincpu.mw@013AD6=6020</action>
    </script>
    <script state="off">
      <action>maincpu.mw@013AD6=temp0 </action>
    </script>
  </cheat>
The move.q #0,d0 at 29c8 was very handy!, just change the #0 to something else (29c9) and then change the "move.w $240c02.l,D0" at 29ca to "move.w D0, $240c02.l"...job done

Re: [outzone*] "Select Starting Level" cheat

Posted: Sat Aug 28, 2010 4:27 am
by stephh
Pugsy wrote:My first thought was that a massive amount of code for a select starting level cheat. Had a quick look and I can see why you used so much code, changing the poke for this game is excessive - it's easier to change the first peek to a poke. I would not include a Skip ROM check cheat with the cheat either...

I'd have something a lot smaller like this for outzone.xml ...

The move.q #0,d0 at 29c8 was very handy!, just change the #0 to something else (29c9) and then change the "move.w $240c02.l,D0" at 29ca to "move.w D0, $240c02.l"...job done
I must admit I didn't spend ages in looking at the game code and I didn't think about the "poke instead of first peek" trick (remember that the M68000 isn't my "best" CPU) ... So yes, nice findings, and a far shorter cheat :)

As for the "Skip ROM" cheat, even if I admit that I could have moved it to a different cheat, I thought it was easier to change the conditional "jumps" than the error routine (which might have been used if some other errors were reported - again, I only looked quickly at the game code) ... Anyway, since it works, I can't blame you ;)

Image Steph from The Ultimate Patchers Image

Re: [outzone*] "Select Starting Level" cheat

Posted: Sat Aug 28, 2010 5:37 pm
by NotAGoodName
Hey guys, can I play?

Code: Select all

  <cheat desc="Select Starting Level">
    <parameter min="1" max="7" step="1"/>
    <script state="run">
      <action condition="maincpu.pb@240C03 LT (param-1)">maincpu.pb@240C03=(param-1)</action>
    </script>
  </cheat>
Tested working on outzone and outzonea. I figure it probably works on the others too.

Re: [outzone*] "Select Starting Level" cheat

Posted: Sat Aug 28, 2010 7:12 pm
by Pugsy
NotAGoodName wrote:Hey guys, can I play?

Tested working on outzone and outzonea. I figure it probably works on the others too.

I'm sure they must be a reason why stephh was looking in terms of a ROM cheat as he used the RAM address in his cheat....
Perhaps he's just improving his 68000 skills ;)

Re: [outzone*] "Select Starting Level" cheat

Posted: Mon Aug 30, 2010 6:51 pm
by stephh
Pugsy wrote:I'm sure they must be a reason why stephh was looking in terms of a ROM cheat as he used the RAM address in his cheat....
Perhaps he's just improving his 68000 skills ;)
Well ... I know I need to improve my M68000 "skills", but as you'll notice in MAME 0.139u2 whatsnew.txt, I've worked on some more "funky" CPUs too :roll:

Anyway, the purpose of my ROM cheat was to try to help in fixing this bug : http://www.mametesters.org/view.php?id=949 ...

So as you proved it, there was a better ROM cheat, and I didn't even try to look for a RAM cheat (which is impossible on real hardware) ...

Image Steph from The Ultimate Patchers Image

Re: [outzone*] "Select Starting Level" cheat

Posted: Mon Aug 30, 2010 7:21 pm
by NotAGoodName
I never thought of using ROM cheats on a real machine but the game has an invincibility dip switch. Getting to level 6 manually would take far less time than finding this hack, patching a ROM file, burning the ROM, and installing it.

And heck. I just couldn't pass up the chance. :wink: