Page 1 of 1

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

Posted: Sun Feb 04, 2018 5:00 pm
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.

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

Posted: Sun Feb 04, 2018 6:37 pm
by crazyc

Code: Select all

	MCFG_CPU_ADD("mastercpu",Z80,MASTER_CLOCK/4))
mastercpu not maincpu.

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

Posted: Sun Feb 04, 2018 6:44 pm
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!

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

Posted: Sun Feb 04, 2018 7:32 pm
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.

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

Posted: Mon Feb 05, 2018 1:55 am
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.

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

Posted: Sat Apr 28, 2018 10:07 am
by Pugsy
Thanks for the report, will be sorted in the next release.