Using MAME debug cheat search to find #credits?

Scucci

Well-known member
Joined
Feb 6, 2003
Messages
4,497
Reaction score
94
Location
Nashville, Tennessee
Possible? I'm working on figure'ng out where I need to look in Route 16 to make a freeplay chip (don't like having to open the top to credit it every time).

I've been at this for like 3 hours, and I can't find a damned thing with this search feature... I check from 0x0000 to 0xFFFF signed and unsigned 8 and 16bit on CPU 0 and 1... can't find a friggin' thing...

I want to use that information (none so fucking far) to look through the asm code for the roms and just tell it to set the credits at XX when I start the game and keep them there (noop a dec I'm assuming?).

But this search feature they have seems about as useless as a wiener flavored lollipop.

I've read all the FAQs and guides... can't figure this heap out.

Anyone have any luck using that feature for something similar?

I run cheatinit, credit the game, then cheatnext increase, then credit it again, and cheatnext increase again... that usually gets me down to under 10 results... then I credit it again, cheatnext increase again... and 0 results... ...
 
Okay, NVM... found it. Had to change the range it was searching... Well, that was easy... I'll have to remember that little step they failed to explain in the guides.
 
You're going to have to disassemble the code to patch it anyway, so why bother with mame?

Just look for where the code checks the coin switches, and the credit increment will be nearby.
 
You're going to have to disassemble the code to patch it anyway, so why bother with mame?

Just look for where the code checks the coin switches, and the credit increment will be nearby.

That's the problem, I know no idea what that code would look like. I've been try'ng to find a good book assembly (specifically for the Z80), but apparently that stopped make'ng them around 1985. lol Go figure.

I wanted to use MAME to show me where it was getting the # of credits from (4020h) and then I just checked the disassembled code for anything that has to do with that address...

It more or less worked... I can set the credits to 99 at startup... but not a true freeplay. Que sera... 99 credits should last long enough.

BTW, how would I go about finding where it checks the coin switches? Are they always the same?
 
Did you ever find an answer to this?

For the coin switches and other inputs? Nope... never figured it out. But I've put this on hold for a while because I have too much stuffs going on right now. So, I'm really not worried about it right now.

It would probably be MUCH easier if I just new some assembly... so I've picked up a few books and I'll be reading them in my spare time, so maybe when I get back to this projects, I'll actually be able to do it without feeling like pulling my hair out.
 
BTW, how would I go about finding where it checks the coin switches? Are they always the same?

MAME source code (or the schematics).

http://mamedev.org/source/src/mame/drivers/dkong.c.html

Code:
static INPUT_PORTS_START( dkong_in2 )
      PORT_START("IN2")      /* IN2 */
      PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN  ) /* connection not labeled in schematics - reset */
      PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* connection not labeled in schematics - freeze or reset */
      PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 )
      PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START2 )
      PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_SERVICE )   /* not connected - held to high - used as service */
      PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )   /* not connected - held to high */
      PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL )   /* status from sound cpu */
      PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_COIN1 )
INPUT_PORTS_END

and

Code:
     AM_RANGE(0x7d00, 0x7d00) AM_READ(dkong_in2_r)                               /* IN2 */

Look for any reference to 0x7d00 in the code that checks bit 7.
 
Last edited:
MAME source code (or the schematics).

http://mamedev.org/source/src/mame/drivers/dkong.c.html

Code:
static INPUT_PORTS_START( dkong_in2 )
      PORT_START("IN2")      /* IN2 */
      PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN  ) /* connection not labeled in schematics - reset */
      PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* connection not labeled in schematics - freeze or reset */
      PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 )
      PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START2 )
      PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_SERVICE )   /* not connected - held to high - used as service */
      PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNKNOWN )   /* not connected - held to high */
      PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL )   /* status from sound cpu */
      PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_COIN1 )
INPUT_PORTS_END
and

Code:
     AM_RANGE(0x7d00, 0x7d00) AM_READ(dkong_in2_r)                               /* IN2 */
Look for any reference to 0x7d000 in the code that checks bit 7.

Thank you, I honestly didn't know about searching for the stuff there.

I'll keep that in mind when I pick my projects back up... Hopefully it'll be helpful to other people between now and then. :)

I've gotten on this weird kick about getting my broken games up and running before I finish messing with machines that are already running.
 
Back
Top Bottom