Customized cheat.c

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.
ShimaPong
Posts: 1063
Joined: Wed May 21, 2003 4:19 pm
Location: Japan

Post by ShimaPong »

Stephh wrote:If you've made new changes to the cheat engine, please send them to me after you've included them in 0.111u3 ...

Then, PLEASE do NOT update cheat.c ANYMORE until I've made the changes requested by the other Devs !
I'm updating cheat source file now though. Therefore it's impossible. Of course, I don't send you any update file.
And I don't know the request by the other Devs.
stephh
Posts: 601
Joined: Fri Aug 17, 2001 1:00 am
Location: Paris, France

Post by stephh »

ShimaPong wrote:I'm updating cheat source file now though. Therefore it's impossible. Of course, I don't send you any update file.
And I don't know the request by the other Devs.
Well ... Once you get a "stable" version (I really wonder about what you want to add/fix), please send it to me ... And I won't let you do the "required" changes as I'm also unsure about what the Devs want ...

Image Steph from The Ultimate Patchers Image
ShimaPong
Posts: 1063
Joined: Wed May 21, 2003 4:19 pm
Location: Japan

Post by ShimaPong »

Stephh wrote:please send it to me
Sorry, it's updating now and it has failed to compile unfortunatery.
Therefore I can't send you soon.

BTW, on 0.111u3, any popup message doesn't be displayed if tab-menu is opened.
Is it MAME bug or new specifications ?
stephh
Posts: 601
Joined: Fri Aug 17, 2001 1:00 am
Location: Paris, France

Post by stephh »

ShimaPong wrote:
Stephh wrote:please send it to me
Sorry, it's updating now and it has failed to compile unfortunatery.
Therefore I can't send you soon.
There is no emergency, but I don't want to you to code too much stuff because almost everything as to be rewritten (not the functionnalities which are useful, but the way they are coded) ... So once you get something working that doesn't require another update, please send it to me and stop further improvements ...
BTW, on 0.111u3, any popup message doesn't be displayed if tab-menu is opened.
Is it MAME bug or new specifications ?
Aaron decided to have such "feature" in u3 ... I told him that popups and cheats watches were very useful for us in any mode (normal, paused, tab-menu or not) ... So we'll see what he decides in next release ...

Image Steph from The Ultimate Patchers Image
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:

Post by Pugsy »

3 Bugs introduced recently:-

1. The select of the memory regions to search is still non-existent.

2. The Name field in the Edit Cheat menu is no longer selectable with the left and right arrow keys so you can't select Infinite Lives, Infinite Time etc.

3. There seems to be a bug when a watch exceeds the length of a line when displayed as ASCII text and it crashes MAME (and it used to work)

eg.

From the cheat file (this now crashes MAME):-

Code: Select all

:findout:000800FE:4069:00000031:FFFFFFFF:Display the Correct Answer (characters may appear strange):Solution
There also seems to be an issue with the cheat engine the cheat type is 000800FE but this is saved by MAME. If you change it to 000000FE manually when you edit the cheat in MAME the SET/CLEAR option is available toggle it back and to WATCH and the SET/CLEAR option disappears but when you save the cheat it's 000800FE again and as xxx8xxxx refers to the Write if Match type it's bizarre!
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)
ShimaPong
Posts: 1063
Joined: Wed May 21, 2003 4:19 pm
Location: Japan

Post by ShimaPong »

Don't believe Pugsy !
Stephh wrote:but I don't want to you to code too much stuff because almost everything as to be rewritten (not the functionnalities which are useful, but the way they are coded)
I can't be satisfied with an update without too much stuff.
Stephh wrote:stop further improvements ...
I refuse it. I have thought other "new" functions but it is impossible with my cheap skill right now.
So I have update it over and over again to learn.
And Current cheat source file is too hard to understand because lost many comments.
Stephh wrote:we'll see what he decides in next release
I just have to pray...

I have finished about the following update.
  • Fixed 1st comment code no skip problem in Enable/Disable Cheat menu when use quick page switch.
  • Ignored 24 or 32 bit Force Range type code.
  • Improved the inputs in Minimum Search Mode.
  • Improved Activation Key save.
Pugsy wrote:1. The select of the memory regions to search is still non-existent.
Not bug. I have merged it into "CPU" item on the search menus. I have already explained it in previoius though.
Pugsy wrote:2. The Name field in the Edit Cheat menu is no longer selectable with the left and right arrow keys so you can't select Infinite Lives, Infinite Time etc.
I don't use it so that I don't know.
stephh
Posts: 601
Joined: Fri Aug 17, 2001 1:00 am
Location: Paris, France

Post by stephh »

ShimaPong wrote:
Pugsy wrote:2. The Name field in the Edit Cheat menu is no longer selectable with the left and right arrow keys so you can't select Infinite Lives, Infinite Time etc.
I don't use it so that I don't know.
Pugsy, some code has been removed (I can't tell if it's ShimaPong or some MAME Dev) and I don't know if I shall submit what follows to the list ... Anyway, do the following steps (IN THIS ORDER PLEASE !) to add this feature again :


Step 1

At line 3985, add this code :

Code: Select all

			case kType_Name:
				currentNameTemplate++;

				if((currentNameTemplate < 0) || !kCheatNameTemplates[currentNameTemplate][0])
				{
					currentNameTemplate = 0;
				}

				entry->name = realloc(entry->name, strlen(kCheatNameTemplates[currentNameTemplate]) + 1);
				strcpy(entry->name, kCheatNameTemplates[currentNameTemplate]);
				break;

Step 2

At line 3682, add this code :

Code: Select all

			case kType_Name:
				currentNameTemplate--;

				if(currentNameTemplate < 0)
				{
					currentNameTemplate = 0;

					while(kCheatNameTemplates[currentNameTemplate + 1][0])
					{
						currentNameTemplate++;
					}
				}

				entry->name = realloc(entry->name, strlen(kCheatNameTemplates[currentNameTemplate]) + 1);
				strcpy(entry->name, kCheatNameTemplates[currentNameTemplate]);
				break;

Step 3

At line 3019, add this code :

Code: Select all

	static INT32		currentNameTemplate = 0;
Step 4

At line 569, add this code :

Code: Select all

static const char *	kCheatNameTemplates[] =
{
	"Infinite Lives",
	"Infinite Lives PL1",
	"Infinite Lives PL2",
	"Infinite Time",
	"Infinite Time PL1",
	"Infinite Time PL2",
	"Invincibility",
	"Invincibility PL1",
	"Invincibility PL2",
	"Infinite Energy",
	"Infinite Energy PL1",
	"Infinite Energy PL2",
	"Select next level",
	"Select current level",
	"Infinite Ammo",
	"Infinite Ammo PL1",
	"Infinite Ammo PL2",
	"Infinite Bombs",
	"Infinite Bombs PL1",
	"Infinite Bombs PL2",
	"Infinite Smart Bombs",
	"Infinite Smart Bombs PL1",
	"Infinite Smart Bombs PL2",
	"Select Score PL1",
	"Select Score PL2",
	"Drain all Energy Now! PL1",
	"Drain all Energy Now! PL2",
	"Watch me for good answer",
	"Infinite",
	"Always have",
	"Get",
	"Lose",
	"Finish this",
	"---> <ENTER> To Edit <---",
	"\0"
};


Now it shall be good ... Please let me know if this works ...

Image Steph from The Ultimate Patchers Image
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:

Post by Pugsy »

stephh wrote: Pugsy, some code has been removed (I can't tell if it's ShimaPong or some MAME Dev) and I don't know if I shall submit what follows to the list ... Anyway, do the following steps (IN THIS ORDER PLEASE !) to add this feature again :
Thanks that worked great, please submit it though I do use it all the time.

Maybe time to reorder some of the descriptions a bit though as hopefully it'll get readded...:-

Code: Select all

{
	 "Infinite Credits",
   "Infinite Time",
   "Infinite Lives",
   "Infinite Energy",
   "Invincibility",
   "Infinite Time PL1",
   "Infinite Lives PL1",
   "Infinite Energy PL1",
   "Drain all Energy Now! PL1",
   "Invincibility PL1",   
   "Infinite Time PL2",
   "Infinite Lives PL2",
   "Infinite Energy PL2",
   "Drain all Energy Now! PL2",
   "Invincibility PL2",   
   "Infinite Ammo",
   "Infinite Bombs",   
   "Select starting level", 
   "Rapid Fire",     
   "Infinite Ammo PL1",     
   "Infinite Bombs PL1",
   "Select Score PL1",
   "Rapid Fire PL1",       
   "Infinite Ammo PL2",
   "Infinite Bombs PL2",
   "Select Score PL2",
   "Rapid Fire PL2",    
   "Display the Correct Answer",
   "Infinite",
   "Always have",
   "Get",
   "Lose",
   "Finish this",
   "---> <ENTER> To Edit <---",
   "\0"
}; 

PS: Just noticed U4 is out...typical as I just did a fresh u3 pm compile :(
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)
stephh
Posts: 601
Joined: Fri Aug 17, 2001 1:00 am
Location: Paris, France

Post by stephh »

Pugsy wrote:
stephh wrote: Pugsy, some code has been removed (I can't tell if it's ShimaPong or some MAME Dev) and I don't know if I shall submit what follows to the list ... Anyway, do the following steps (IN THIS ORDER PLEASE !) to add this feature again :
Thanks that worked great, please submit it though I do use it all the time.

Maybe time to reorder some of the descriptions a bit though as hopefully it'll get readded...:-

- SNIP -
OK, I'll do it in a couple of days ... Now, couldn't it be useful for you to have an ending space for these ones :

Code: Select all

   "Infinite ",
   "Always have ",
   "Get ",
   "Lose ",
   "Finish this ",
PS: Just noticed U4 is out...typical as I just did a fresh u3 pm compile :(
I can't explain why, but most beta releases are out on Thursdays ...

Image Steph from The Ultimate Patchers Image
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:

Post by Pugsy »

stephh wrote:OK, I'll do it in a couple of days ... Now, couldn't it be useful for you to have an ending space for these ones SNIP
Thanks appreciate it, and well spotted a trailing space for those would be nice :)
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)
ShimaPong
Posts: 1063
Joined: Wed May 21, 2003 4:19 pm
Location: Japan

Post by ShimaPong »

Don't believe Pugsy !
Pugsy wrote:There seems to be a bug when a watch exceeds the length of a line when displayed as ASCII
Don't use BDF font.
http://zetubou.mine.nu/timer/file/bomber34642_d5.png

The cheat system is limited now because it can't follow MAME core update.

Also we can't adjust the cheat system because it is core related problem.
Do you remember that the watchpoint display has been broken on 0.107u1 ?
The reason was that the ui_draw_text required "float" value due to core update.
It seems to be fixed but incomplete because MAME crash problem has remaind.

I think that the cheat engine will be dead in the future.
Pugsy wrote:If you change it to 000000FE manually when you edit the cheat in MAME the SET/CLEAR option is available toggle it back and to WATCH and the SET/CLEAR option disappears but when you save the cheat it's 000800FE again and as xxx8xxxx refers to the Write if Match type it's bizarre!
The cheat engine doesn't have the bit check.
And you can't edit "dust" bit via the cheat edit menu because the cheat engine hides it on this menu.
Therefore, edit type field manually ON THE TEXT EDITOR instead of this menu.

Pugsy, you should not believe the code editor in the cheat menu because it is incomplete.
It is NOT FOR EDIT BUT FOR CHECK.
I have used it as "code display" but edit a code on the text editor only.
(Therefore I have added the key to reload database quickly because of the above reason)

I hope to change current code "editor" to "viewer", otherwords, delete all "edit" functions.
Because people rely on it too much (and EditCheat() is too huge to analize/modify).

But I think that the code check is the job of the code creator or database manager.



Fortunatery, 0.111u4 doesn't have any update for cheat source file.
Unfortunatery, any popup message/watchpoint has not be displayed when tab-menu is opened in this version too.

So I have added the item for displaying number of results in Minimum Search mode.
http://zetubou.mine.nu/timer/file/bomber34643_d5.png
We can use sub-menu display instead of popup message. But I think it's too no-good.
And about watchpoint display, I have to give up.
ShimaPong
Posts: 1063
Joined: Wed May 21, 2003 4:19 pm
Location: Japan

Post by ShimaPong »

Don't believe Pugsy !

I have added "message display" item instead of popup message in Minimum mode.
http://zetubou.mine.nu/timer/file/bomber34651_d5.png
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:

Post by Pugsy »

ShimaPong wrote:
Pugsy wrote:There seems to be a bug when a watch exceeds the length of a line when displayed as ASCII
Don't use BDF font.
http://zetubou.mine.nu/timer/file/bomber34642_d5.png
I was using the built in MAME font though!
ShimaPong wrote:
Pugsy wrote:If you change it to 000000FE manually when you edit the cheat in MAME the SET/CLEAR option is available toggle it back and to WATCH and the SET/CLEAR option disappears but when you save the cheat it's 000800FE again and as xxx8xxxx refers to the Write if Match type it's bizarre!
The cheat engine doesn't have the bit check.
And you can't edit "dust" bit via the cheat edit menu because the cheat engine hides it on this menu.
Therefore, edit type field manually ON THE TEXT EDITOR instead of this menu.

Pugsy, you should not believe the code editor in the cheat menu because it is incomplete.
It is NOT FOR EDIT BUT FOR CHECK.
I have used it as "code display" but edit a code on the text editor only.
(Therefore I have added the key to reload database quickly because of the above reason)

I hope to change current code "editor" to "viewer", otherwords, delete all "edit" functions.
Because people rely on it too much (and EditCheat() is too huge to analize/modify).

But I think that the code check is the job of the code creator or database manager.
It's a bad idea to remove the edit functionality, it's there for a reason. To be VERY FRANK if you want to remove it because you can't understand it then you should not be changing the cheat source AT ALL.

To be perfectly honest as you've been making changes (removals as well as additions) to the cheat.c that are not documented/discussed or requested I'd be happier if you stopped tarting around with it completely and leave it somebody who can do it properly...you've made some great additions but you also seem to think that you can remove functionality simply because YOU don't use it....AND YOU HAVE!!

As the MAME team want to update the cheat engine to make it simpler/more compliant now is the time to stop hacking around with cheat.c and give them a chance to update it or the cheat engine will indeed stop working sooner rather than later!

PLEASE STOP MESSING ABOUT WITH CHEAT.C!!!!

And Stephh please don't submit any more cheat engine changes from ShimaPong.
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)
stephh
Posts: 601
Joined: Fri Aug 17, 2001 1:00 am
Location: Paris, France

Post by stephh »

Pugsy wrote:And Stephh please don't submit any more cheat engine changes from ShimaPong.
I'm somewhere faulty because I submitted ShimaPong's work without checking everything due to lack of time :( But he used to describe his changes, even if since a few releases, he removes stuff because he doesn't use it (while we do - old format is the main thing that comes to my mind) ...

Anyway, because of the rewrite that SHALL begin when 0.112 is out, I won't submit anything with new/removed functionnalities and I'll ask the Devs not to accept anything that doesn't come from me until everything is done (even if this may require a long time - remember Ian's work at the begining) ...

Image Steph from The Ultimate Patchers Image
stephh
Posts: 601
Joined: Fri Aug 17, 2001 1:00 am
Location: Paris, France

Post by stephh »

Pugsy, I was about to forget, I readded the strings and submitted the work to the Team :)

Image Steph from The Ultimate Patchers Image
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:

Post by Pugsy »

I'm somewhere faulty because I submitted ShimaPong's work without checking everything due to lack of time But he used to describe his changes, even if since a few releases, he removes stuff because he doesn't use it (while we do - old format is the main thing that comes to my mind) ...
The problem with the cheat engine is that there's so much to check it would be a massive task, a task best suited to the person making the changes because they should no what it can effect. The removal of the old cheat format has effected me slightly as well as I have a lot of WIP cheats in the old format which I never bothered converting. Old cheat format, descriptions selector and the loss of one of the search techniques are all we've encountered so far...I just hope there's not anything else yet to be encountered. The 'threat' of removing the edit functionality completely from the cheat engine is the final straw in my eyes...I'm willing to do without new features (or even make any "discussed" changes myself) if that's the cost.
Pugsy, I was about to forget, I readded the strings and submitted the work to the Team :)
Thanks, appreciate it.
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)
etabeta78
Posts: 32
Joined: Tue Dec 05, 2006 9:46 pm
Location: Trondheim, Norway

Post by etabeta78 »

being on the topic of 'disappeared' features, until 0.108 there was the option 'continue old search', which was quite useful, since the new search was continuing from the values resulted in the previous researches...

i cannot reproduce the same kind of search with the new options in 0.111 (but recall it could well due to my little experience with the cheat engine... please explain me how to accomplish the same result with the new interface and I will be more than happy to retire these 'complaints')

there are actually many interesting features with the new engine that were missing before, but I really miss that very easy old way to find trivial cheats as # of life, choose # of the level and similar ;)
stephh
Posts: 601
Joined: Fri Aug 17, 2001 1:00 am
Location: Paris, France

Post by stephh »

Pugsy wrote:The problem with the cheat engine is that there's so much to check it would be a massive task, a task best suited to the person making the changes because they should no what it can effect.
I agree here, but there is some stuff that shall no more belong to cheat.c file which shall done by someone aware of the core files (who said Aaron ? ;) )
The removal of the old cheat format has effected me slightly as well as I have a lot of WIP cheats in the old format which I never bothered converting.
Old cheat format only got removed for one 'u' release (you know how much this is important to me as I almost never use the "new" stuff), so you can now load them, then save them so they are converted to the new format ...
Old cheat format, descriptions selector and the loss of one of the search techniques are all we've encountered so far ...
The 2 first things have been readded, so I guess there's only the "bit-search" stuff that requires a little investigation (you can easily imagine how happy I am as I saved an old cheat.c file !) before readding it (ShimaPong shouldn't bother as he never uses it) ...
I just hope there's not anything else yet to be encountered.
I also hope so ... And I'll do my best to avoid the loss of anything else ...
The 'threat' of removing the edit functionality completely from the cheat engine is the final straw in my eyes ...
The "edit" functionality is one of most important thing we need which is not related directly to cheat finding, as I don't want to have a headache with the text file looking in the (invisible) docs for what all bits do ! So don't worry, it will NEVER be removed ...

Now, I was thinking of adding something, so you can find where some bugs belong : the idea is to display on the last line of the menu (line that you can't edit), the following fields of the selected cheat you are editing :

Code: Select all

tttttttt:aaaaaaaa:dddddddd:mmmmmmmm
with :

. tttttttt : type (hexa : 8 digits)
. aaaaaaaa : address (hexa : 8 digits)
. dddddddd : data (hexa : 8 digits)
. mmmmmmmm : mask or extended data (hexa : 8 digits)

This way, you see exactly what will be saved to the cheat.dat and you can make some changes before it's "too late" ...

And as this line only always 35 chars wide (I won't change aaaaaaaa length because you have your conventions and I have mine), it should fit in any game screen (provided you don't have a wide font) ...

Please let me know what you think about such "feature", so I can try to add it for 0.111u5 ... BTW, would you mind if I also remove the TMS340?0 "hack" I told you before Christmas ? We'll need to do this one day or another, so let's do it now (I mean, before the rewrite or at least before MAME 0.112 is out as well as your possible new cheat.dat file) ...
I'm willing to do without new features (or even make any "discussed" changes myself) if that's the cost.
First step of the rewrite is ... the rewrite ! Then we'll see what we can add and/or remove ...

Image Steph from The Ultimate Patchers Image
ShimaPong
Posts: 1063
Joined: Wed May 21, 2003 4:19 pm
Location: Japan

Post by ShimaPong »

- Added extended comment display, called "Packed Comment".

See the database and you will find "too many" comment codes, just like many mahjong games, the information of the weapons in splatter etc etc.
MAME in-game menu is very limited about the display so that the above codes often causes annoying item selection and even gives you a lot of stress.
Because "too many" comment lines block easy finding the code you wanted and moving cursor.

Though the cheat engine supports displaying the comment field (Shift + UI_Select in Enable/Disable cheat menu).
But it is well-suited to display "subtle" comment.
And the main problem is that the cheat engine attemps to display the comment on single-line in this menu.
Otherwords, you can't use a line feed character to the comments.

So I have added another comment display menu.
See screenshot.
http://www.42ch.net/UploaderSmall/source/1184353654.png
A lot of comments (left screenshot) are packed to 1 item (center) in the code selection menu and displayed the comment in another menu when you choose it (right).

----- FORMAT -----

Code: Select all

:game:60040000:0000:00000000:00000000:--------------- Read Me! ---------------
:game:60050000:0000:00000000:00000000: Master code is the main title in the
:game:60050000:0000:00000000:00000000: cheat selection menu only and it isn't
:game:60050000:0000:00000000:00000000: displayed in the comment menu.
:game:60050000:0000:00000000:00000000: All linked codes are treated as packed
:game:60050000:0000:00000000:00000000: comment and displayed only in the
:game:60050000:0000:00000000:00000000: extended comment menu.
It's very similar to normal format of the comment code.
If you want to make packed comment code, set "Operation Extend" flag to the comment code.
Master (1st) code is main title and displayed in the cheat code selection menu.
If the cheat engine makes correct reading of the code as packed comment, "Read" sub-item is set.
When you choose it and press UI_Select key, the comment menu is opened.
UP/Down or Page Up/Page Down keys moves the cursor, pressing UI_Select or UI_Cancel close this menu then return previous menu.
----- NOTE -----
  • Master code isn't displayed in the comment menu.
  • You need to set "Operation Extend" flag to ALL codes to get packed comment code.
ShimaPong
Posts: 1063
Joined: Wed May 21, 2003 4:19 pm
Location: Japan

Post by ShimaPong »

- Added new special function code, called "Condition Code".

The condition code checks the value and "IF" matched, "DO" the cheat operaion.
The main difference between the condition code and default conditions (wait for modification, write if match etc) is that you can check "OTHER" addresses.

----------- FORMAT ----------

Code: Select all

Type Field:

MSB                             LSB
33222222 22221111 11111100 00000000
10987654 32109876 54321098 76543210
xxx----- -------- -------- --------     type
                                            000 =   standard memory write
                                            001 =   memory region
                                            010 =   write handler mapped memory
                                            011 =   custom
                                            100 =   relative address (CPU)
                                            101 =   condition
                                            110 =   unused
                                            111 =   unused
Set "Location Type" parameter as "Condition" so that basic format is "C0000000".
And this code needs special options separated from standard ones.

Code: Select all

MSB                             LSB
33222222 22221111 11111100 00000000
10987654 32109876 54321098 76543210
                                    [ condition ]
-------- -------- -------- -------x  one-shot (reserved by standard one-shot cheat)
-------- -------- -------- ----xxx-  comparison
                                            000 = equal
                                            001 = not equal
                                            010 = less
                                            011 = greater
                                            100 = less or equal
                                            101 = greater or equal
                                            110 = bit on
                                            111 = bit off
-------- -------- -------- ---x----  linked condition
                                            00 = and
                                            01 = or
NOTE : the options for CPU, Address, Bytes and Data are the same as standard memory write (RAM type code).

For example :

Code: Select all

:game:C0000000:1234:00000012:00000000:Infinite Items
:game:00010000:5678:00000099:FFFFFFFF:Infinite Items (2/2)
The cheat engine checks the value stored on $1234 and "IF" it matches 0x12, "DO" write the value on $5678 as 0x99.
"IF" 0x34, 2nd linked code doesn't work.

You can set the comparison option, Equal (=), Not Equal (!=), Less (<), Greater (>), Less or Equal (<=), Greater or Equal (>=).
Also the Bit itself, "If bit x is ON(OFF), Do linked codes".
Setting value in case of Bit is the same as standard type, for example if Bit 4, set 0x10.

And you can set "And" and "Or" (linked condition) to check multi addresses.

Code: Select all

:game:C0000010:1234:00000012:00000000:Infinite Items
:game:C001000C:789A:00000080:00000000:Infinite Items (2/4)
:game:00010000:5678:00000099:FFFFFFFF:Infintie Items (3/4)
:game:00010000:BCDE:000000FF:FFFFFFFF:Infintie Items (4/4)
The above means "If value is 0x12 in $1234 OR Bit 7 is ON in $789A, Do store 0x99 into $5678 and 0xFF into $BCDE".
You can set "simple" condition, "If((A != B) || (C >= D) || (E > F))", but can't set "complex" one, "If((A == B) || (C < D)) && (E > F)".
And the cheat engine checks this option on 1ST CONDITION CODE ONLY.
So if you set it on 2nd or later code, it is ignored.

Sample :

Code: Select all

:marineb:C000000E:802E:00000040:00000000:Infinite Oxygen
:marineb:00010000:803B:00000028:FFFFFFFF:Infinite Oxygen (2/2):If Round Finish flag (bit 6) on $802E is OFF, store 0x28 into $803B
Old "Infinite Oxygen" code prevents from going to the next round because Oxygen Bonus addition never completes.
But the above code only works when Round Finish flag (bit 6) is OFF and stops working when flag is ON at round finish.
It is the same as current ROM code in the database but the above is more simple.

Now you can check and edit it via the cheat edit menu.
http://www.42ch.net/UploaderSmall/source/1184434101.png
Post Reply