Cheats in [flower] (now that driver is rewritten)

If you are having problems finding or using cheats for an Emulator (particularly MAME/MESS) or have found a trick that you wish to share this is the place to do it. But please read the Cheat FAQ first.
Post Reply
User avatar
megaman_exe
Posts: 39
Joined: Mon Nov 05, 2007 2:12 am

Cheats in [flower] (now that driver is rewritten)

Post by megaman_exe »

Hi, I've tried doing simple cheats with values I found on the debugger (mame 0.193), for instance, with ci, cn eq,0, cn eq,0 (multiple times without inserting coins) and then cn eq,1 (inserting a coin) and cn eq,3 (inserting 2 coins) and then pushing the 2nd start button and then cn eq,1 I determined the coin address is at $c023.

The problem starts when I try to do anything in the xml's or in the hiscore.dat. In flower.xml it says the address (which I tried referencing as maincpu.pb@c023, maincpu.mb@c023, maincpu.rb@c023 and maincpu.ob@c023) is an unknown symbol, (that the message mame shows in the console) despite having found it in the debugger.

It also isn't the same problem with williams driver where the addresses must be multiplied by 8 (I've tried). I don't know how can I fix it in the driver and recompile mame since the address is in the "workram" area (0xc000 - 0xdfff)

Code: Select all

static ADDRESS_MAP_START( shared_map, AS_PROGRAM, 8, flower_state )
	AM_RANGE(0x0000, 0x7fff) AM_ROM
	AM_RANGE(0xc000, 0xdfff) AM_RAM AM_SHARE("workram")
	AM_RANGE(0xa000, 0xa000) AM_WRITENOP
	AM_RANGE(0xa001, 0xa001) AM_WRITE(flipscreen_w)
	AM_RANGE(0xa002, 0xa002) AM_WRITENOP // master irq related (0 at start, 1 at end)
	AM_RANGE(0xa003, 0xa003) AM_WRITENOP // slave irq related (0 at start, 1 at end)
	AM_RANGE(0xa004, 0xa004) AM_WRITE(coin_counter_w)
	AM_RANGE(0xa005, 0xa005) AM_WRITENOP
	AM_RANGE(0xa100, 0xa100) AM_READ_PORT("P1")
	AM_RANGE(0xa101, 0xa101) AM_READ_PORT("P2")
	AM_RANGE(0xa102, 0xa102) AM_READ_PORT("DSW1")
	AM_RANGE(0xa103, 0xa103) AM_READ_PORT("DSW2")
	AM_RANGE(0xa400, 0xa400) AM_WRITE(sound_command_w)
	AM_RANGE(0xe000, 0xefff) AM_RAM AM_SHARE("txvram")
	AM_RANGE(0xf000, 0xf1ff) AM_RAM_WRITE(fgvram_w) AM_SHARE("fgvram")
	AM_RANGE(0xf200, 0xf200) AM_RAM AM_SHARE("fgscroll")
	AM_RANGE(0xf800, 0xf9ff) AM_RAM_WRITE(bgvram_w) AM_SHARE("bgvram")
	AM_RANGE(0xfa00, 0xfa00) AM_RAM AM_SHARE("bgscroll")
ADDRESS_MAP_END
There's another game called darkmist (same romset name) which has also a "workram" (mame/drivers/darkmist.cpp) and there are cheats written for it in the workram area itself (infinite credits, infinite energy). What sort of changes need to be done to the flower driver so I can poke and write values to such "workram" area?

I hope you can help me with this problem. It's driving me nuts.
Thanks in advance.
Greets.
crazyc
Posts: 31
Joined: Sat Apr 30, 2016 4:49 pm

Re: Cheats in [flower] (now that driver is rewritten)

Post by crazyc »

Code: Select all

	MCFG_CPU_ADD("mastercpu",Z80,MASTER_CLOCK/4))
mastercpu not maincpu.
User avatar
megaman_exe
Posts: 39
Joined: Mon Nov 05, 2007 2:12 am

Re: Cheats in [flower] (now that driver is rewritten)

Post by megaman_exe »

crazyc wrote:

Code: Select all

	MCFG_CPU_ADD("mastercpu",Z80,MASTER_CLOCK/4))
mastercpu not maincpu.
Should I change all the ocurrences of "maincpu" with "mastercpu"? Or just that line? Also, the line you mention was:

Code: Select all

MCFG_CPU_ADD("maincpu", Z80,4000000)         /* ? MHz */
The clock frequency is hardcoded.

Looking forward from reading your answer.
Greets!

EDIT: Sorry, I was reading the code of another driver. This means I should add that line?
Greets!

EDIT2: Now I get it. I should write mastercpu in the address reference. Thanks!
User avatar
megaman_exe
Posts: 39
Joined: Mon Nov 05, 2007 2:12 am

Re: Cheats in [flower] (now that driver is rewritten)

Post by megaman_exe »

Hi, I wrote some changes in mame\drivers\flower.cpp and changed all ocurrences of "mastercpu" to "maincpu" and the cheats and hiscore works flawlessly.

BTW, the hiscore plugin seems to write only when it detects changes in the memory areas it points to, so if you just open and then close the game to see if the .hi file appears it's not gonna work. You must make some decent score to appear in the list of highest scores.
crazyc
Posts: 31
Joined: Sat Apr 30, 2016 4:49 pm

Re: Cheats in [flower] (now that driver is rewritten)

Post by crazyc »

You can try to make a pull request for that if you want I suspect it would not be committed. It'd be simpler to change the cheats and hiscore entry to use "mastercpu" instead.
User avatar
Pugsy
Posts: 3638
Joined: Fri Aug 17, 2001 12:59 am
Location: North Wales, UK.
Has thanked: 1 time
Been thanked: 12 times
Contact:

Re: Cheats in [flower] (now that driver is rewritten)

Post by Pugsy »

Thanks for the report, will be sorted in the next release.
Pugsy

Servicing your cheating needs since 1985 8)

Grab the latest cheat collection:
MAME 0.259 XML cheat collection (6 OCTOBER 2023) from http://www.mamecheat.co.uk or direct from:-
https://mega.nz/file/q4dHGZ6K#i-EUiqIjH ... KMz7hnbTfw (ZIP Archive 3.76MB)
Post Reply