Customized cheat.c
I've got the file and the password, thanksShimaPong wrote:OK, I have finished checking for 3rd update.
http://zetubou.mine.nu/timer/file/bomber31853_d5.zip

First, I'm not sure that cheat.txt will be added to official documentation files ... IMO, it should be best distributed with Pugsy's cheat.dat file ... What do you think about that ?
Second, I read that in your cheatnew.txt file :
How does it work ? Which bit of the option field is it ? I have serious doubt with this code :* code loading:
- Ignored to load old format code by default. If you need to
load, choose "Load Old Format" item in Options menu.
But in the future, it should be merged into new format.
Code: Select all
/* ----- convert the old code to the new format ----- */
if(TEST_FIELD(cheatOptions, LoadOldFormat))
//type = ConvertOldCode(oldCode, oldCPU, &data, &extendData);
continue;
Last thing : please NEVER remove the possibility to still use the old format as I REALLY need it !Cheat Engine Commands:
These special cheat lines are used to set global preferences for the cheat engine. They follow this format:
:_command:[ data ]
The lower byte of the data field stores the command, and the remaining bytes store data for the command. Here is a list of the commands:
0x00 disable help boxes (once I add them)
0x01 use old-style cheat search box (now redundant)
0x02 use new-style cheat search box
0x03 don't print labels in new-style search menu
0x04 auto-save cheats on exit
So, if you wanted to use the old-style cheat box, you would add this line to your cheat.dat:
:_command:00000001


As you choose. If I can divide source file, I don't hope others.Stephh wrote:I'm not sure that cheat.txt will be added to official documentation files ... IMO, it should be best distributed with Pugsy's cheat.dat file ... What do you think about that ?
Sorry, the dust has remained. It's hard for me to figure out many modification completely in "BIG" file.Stephh wrote:How does it work ? Which bit of the option field is it ? I have serious doubt with this code
Remove "//" to work old format loading. Other fix will be unneeded.
Yes, I don't fix divided information right now.Stephh wrote:BTW, in cheat.txt, the comments seem wrong
Rewriting cheat.txt is harder than customizing cheat.c.
Because I'm Japanese and English is not first language.
Please give me an idea to manage current "BIG" cheat source file !Stephh wrote:Last thing : please NEVER remove the possibility to still use the old format as I REALLY need it !
Now that MAME 0.111 is out, could you please send me an update cheat.c file that fixes the bug and which is up-to-date ? IMO, it hasn't changed, so you shall only need to fix what's wrong ... And if you've made some new changes, don't forget to include an updated cheatnew.txt file ... TIA ...ShimaPong wrote:Sorry, the dust has remained. It's hard for me to figure out many modification completely in "BIG" file.Stephh wrote:How does it work ? Which bit of the option field is it ? I have serious doubt with this code
Remove "//" to work old format loading. Other fix will be unneeded.
As for cheat.txt, the file will be distributed by Pugsy, so send a PM with a copy of it to him ...
I know the file is big, but cheats are only tolerated (because some of them - even if we spend time in checking them - are still buggy and cause bugs that shall not be reported on MAME Testers board) ... So, I'm not sure that some Devs would be happy to split cheat.c in multiple files ...Please give me an idea to manage current "BIG" cheat source file !Stephh wrote:Last thing : please NEVER remove the possibility to still use the old format as I REALLY need it !
Anyway, how many parts do you need ? Here is what I think about :
. cheat.c : primary functions used by multiple modules (such as DecimalTOBCD, BCDToDecimal, Do*Edit*, *KeyPressed)
. cheatdef.c : definitions (enums, structs, global static vars/consts)
. cheatdo.c : activate cheat stuff
. cheatdsk.c : load/save/edit stuff (includes the ConvertOldCode function)
. cheatsch.c : search stuff
. cheatwtc.c : watches stuff
. cheatmsc.c : other stuff (to be determinated)
Any comments are welcome about this, so I can try to speak about it to MAME Team ...


I have confirmed that Program Space accesor works fine in afighter and regulus.
But also I have found the problems...
And added new functions/operations.
http://zetubou.mine.nu/timer/file/bomber32242_d5.png
But I don't use and understand old format so that if the cheat engine has a trouble, I may be unable to resolve an issue.
So I hope you to do if you will.
But also I have found the problems...
- Can't access in finalizr, roadf.
- Restore Previous Value doesn't work or even causes the game crash in rachero, goldnaxj.
And added new functions/operations.
http://zetubou.mine.nu/timer/file/bomber32242_d5.png
- Added 3rd search menu, called "Minimum Search Mode".
- Added new operation, called "Write if Match".
After arrangements are finalized.could you please send me an update cheat.c file that fixes the bug and which is up-to-date ?
But I don't use and understand old format so that if the cheat engine has a trouble, I may be unable to resolve an issue.
Current database has the same material as cheat.txt. I think divide it from the database too because also the database is big.As for cheat.txt, the file will be distributed by Pugsy
Main problem is that I don't know how to divide source file because it needs to fix other files which is not associated with cheat core directly.Anyway, how many parts do you need ?
So I hope you to do if you will.
OK, I will wait ... I'm going on holidays in about 10 days, so I'd be very happy if you could send me something before (remember that I need to make some preliminary tests before I submit the file(s) to MAME Team) ...ShimaPong wrote:After arrangements are finalized.could you please send me an update cheat.c file that fixes the bug and which is up-to-date ?
Don't remove the ConvertOldCode function, tell me the way you want to use it (use an option or try old format if cheat line doesn't match the new one), and I'll fix that if you have troubles with it ...But I don't use and understand old format so that if the cheat engine has a trouble, I may be unable to resolve an issue.
IIRC, most of the blahblah at the begining of Pugsy's cheat.dat file is a copy of what is at the begining of cheat.c ... So if you have sort of "header" named cheat.txt, I think you could remove the text in it from both cheat.dat and cheat.c (wait for Pugsy's confirm though) ...Current database has the same material as cheat.txt. I think divide it from the database too because also the database is big.As for cheat.txt, the file will be distributed by Pugsy
I agree that cheat.c as dependencies, but not that much ... I'll try to compile a version without the cheat engine and see which files need to be changed ... Then I'll post a list here as fast as possible, and we'll see what needs to be done when I come back in mid-January ...Main problem is that I don't know how to divide source file because it needs to fix other files which is not associated with cheat core directly.Anyway, how many parts do you need ?
So I hope you to do if you will.


3rd Update Plus.
http://zetubou.mine.nu/timer/file/bomber32453_d5.zip
I have already updated the cheat engine for HazeMD too but the above archive doesn't include.
http://zetubou.mine.nu/timer/file/bomber32453_d5.zip
I have already updated the cheat engine for HazeMD too but the above archive doesn't include.
I've only had a quick look at your changes and there seems to be a little error with the LoadOldFormat and Debug options in SelectOptions function :ShimaPong wrote:3rd Update Plus.
http://zetubou.mine.nu/timer/file/bomber32453_d5.zip
Code: Select all
case kMenu_LoadOldFormat:
if(TEST_FIELD(cheatOptions, Debug))
TOGGLE_MASK_FIELD(cheatOptions, LoadOldFormat);
break;
Here is IMO what you sould have :
Code: Select all
case kMenu_LoadOldFormat:
if(TEST_FIELD(cheatOptions, LoadOldFormat))
TOGGLE_MASK_FIELD(cheatOptions, LoadOldFormat);
break;
case kMenu_Debug:
if(TEST_FIELD(cheatOptions, Debug))
TOGGLE_MASK_FIELD(cheatOptions, Debug);
break;
Thanks a lot for your hard work on this file which is, I admit, big to maintain ...


Sorry, it's not bug. I have forgotten to explain it.Stephh wrote:If you agree with this, I change the cheat.c file, then I submit it to MAME Team
Debug option is for cheat engine developer so that I intend to forbid changing by end-user easily.
Developer needs to edit command code directly on the text editor and can confirm debug ON/OFF on the Options menu.
I made that point before, and I can't manage old format so that "Load Old Format" is one of Debug items.
But if you feel troublesome, fix with your idea and send.
I understand your point of view, but I don't have time at the moment to allow such thing, so I submitted your file with these changes :ShimaPong wrote:Sorry, it's not bug. I have forgotten to explain it.
Debug option is for cheat engine developer so that I intend to forbid changing by end-user easily.
Developer needs to edit command code directly on the text editor and can confirm debug ON/OFF on the Options menu.
I made that point before, and I can't manage old format so that "Load Old Format" is one of Debug items.
But if you feel troublesome, fix with your idea and send.
Code: Select all
case kMenu_LoadOldFormat:
TOGGLE_MASK_FIELD(cheatOptions, LoadOldFormat);
break;
case kMenu_Debug:
TOGGLE_MASK_FIELD(cheatOptions, Debug);
break;
I've also asked to the Team about the multiple source files and the "externalisation" of the cheat engine with "CHEAT = " line in the makefile ... We'll see if there is some feedback when I'm back from holidays ...
Now, I've noticed a trick which was needed in very old versions of MAME for games with a TMS34010 or a TMS34020, but which is IMO a complete non-sense now with the memory mapping rewrite : in function BuildCPUInfoList (last function of cheat.c), we use info->addressShift = 3 and this causes problems (see the memory ranges and the results) ... I know this would cause many cheats to be redone, but I think this must be done to be "accurate" ... Any comments are welcome ...


Shimapong, I don't know exactly what you changed, but there are now MANY bugs in the cheat engine
The most important thing is that the (classic ?) search function seems to be broken somewhere : I can't even not find lives for a game such as 'bonzeadv' as the result is always 0 when I "continue" search ! Isn't there a problem with the "backup" data ?
The "load old format" option doesn't seem to work correctly as the old cheats now seem to be always loaded ... It's a good news that old format is still supported, but the option should do something ...
Now that the memory mapping is accurate in the TMS340x0 games, we should get rid of the AddressShift hack (see the end of the file) as it isn't used when searching for something (look at the addresses in the cheat database and the ones proposed for CPU0 and you'll notice that they don't match) ... Of course, many cheats will have to be changed, but Pugsy is aware of this ...
Other thing which also relies on Pugsy : when you save the cheat.dat file to UTF8 format, the size of the file doubles (while it shouldn't according to MAME Devs) and then you can't load cheats anymore ... First, there shouldn't be semi-graphical chars (code > 0x7f) in the text file and/or we shall also convert the cheat line to true UTF8 ...
Once all this is fixed, I'll ask you to stop further development on this file (what else do you need anyway ?) as the cheat.c file needs special work and a huge rewrite, not to add new stuff, but to have a source file which is "compatible" with all the other ones in MAME ...
Steph from The Ultimate Patchers 

The most important thing is that the (classic ?) search function seems to be broken somewhere : I can't even not find lives for a game such as 'bonzeadv' as the result is always 0 when I "continue" search ! Isn't there a problem with the "backup" data ?
The "load old format" option doesn't seem to work correctly as the old cheats now seem to be always loaded ... It's a good news that old format is still supported, but the option should do something ...
Now that the memory mapping is accurate in the TMS340x0 games, we should get rid of the AddressShift hack (see the end of the file) as it isn't used when searching for something (look at the addresses in the cheat database and the ones proposed for CPU0 and you'll notice that they don't match) ... Of course, many cheats will have to be changed, but Pugsy is aware of this ...
Other thing which also relies on Pugsy : when you save the cheat.dat file to UTF8 format, the size of the file doubles (while it shouldn't according to MAME Devs) and then you can't load cheats anymore ... First, there shouldn't be semi-graphical chars (code > 0x7f) in the text file and/or we shall also convert the cheat line to true UTF8 ...
Once all this is fixed, I'll ask you to stop further development on this file (what else do you need anyway ?) as the cheat.c file needs special work and a huge rewrite, not to add new stuff, but to have a source file which is "compatible" with all the other ones in MAME ...


Don't believe Pugsy !
Because the search function works on my MAME 0.111u2.
Please more report.
Over and over again I say, I don't use and can't understand old format so that I don't know the cause.
I don't understand why you say, "search function seems to be broken".Stephh wrote:The most important thing is that the (classic ?) search function seems to be broken somewhere : I can't even not find lives for a game such as 'bonzeadv' as the result is always 0 when I "continue" search ! Isn't there a problem with the "backup" data ?
Because the search function works on my MAME 0.111u2.
Please more report.
Also I don't know why the cheat engine doesn't load old format.Stephh wrote:The "load old format" option doesn't seem to work correctly as the old cheats now seem to be always loaded ... It's a good news that old format is still supported, but the option should do something ...
Over and over again I say, I don't use and can't understand old format so that I don't know the cause.
...? Please more easy English.Stephh wrote:Once all this is fixed, I'll ask you to stop further development on this file (what else do you need anyway ?) as the cheat.c file needs special work and a huge rewrite, not to add new stuff, but to have a source file which is "compatible" with all the other ones in MAME ...
- Pugsy
- Posts: 3686
- Joined: Fri Aug 17, 2001 12:59 am
- Location: North Wales, UK.
- Has thanked: 1 time
- Been thanked: 19 times
- Contact:
I also get 0 results for advanced and classic mode in 0.111u2, I tried it on a few games including asterix. There's also no option to select which memory areas to search.ShimaPong wrote:I don't understand why you say, "search function seems to be broken".Stephh wrote:The most important thing is that the (classic ?) search function seems to be broken somewhere : I can't even not find lives for a game such as 'bonzeadv' as the result is always 0 when I "continue" search ! Isn't there a problem with the "backup" data ?
Because the search function works on my MAME 0.111u2.
Please more report.
Pugsy
Servicing your cheating needs since 1985
Grab the latest cheat collection:
MAME 0.264 XML cheat collection (3 APRIL 2024) from http://www.mamecheat.co.uk or direct from:-
https://mega.nz/file/SxsQUJoT#jBdz6GLm_ ... QzFGSMms2c (ZIP Archive 3.8 MB)
Servicing your cheating needs since 1985

Grab the latest cheat collection:
MAME 0.264 XML cheat collection (3 APRIL 2024) from http://www.mamecheat.co.uk or direct from:-
https://mega.nz/file/SxsQUJoT#jBdz6GLm_ ... QzFGSMms2c (ZIP Archive 3.8 MB)
I found the bug that affects the "classic" and "advanced" search ("minimum" was working correctly) : you ALWAYS initialised the search, thus the 0 results ...ShimaPong wrote:I don't understand why you say, "search function seems to be broken".Stephh wrote:The most important thing is that the (classic ?) search function seems to be broken somewhere : I can't even not find lives for a game such as 'bonzeadv' as the result is always 0 when I "continue" search ! Isn't there a problem with the "backup" data ?
Because the search function works on my MAME 0.111u2.
Please more report.
Here is a copy of the diff file (posted here : http://www.mameworld.info/ubbthreads/sh ... art=1&vc=1 ) :
Code: Select all
diff -Nru old/cheat.c src/cheat.c
--- old/cheat.c 2007-01-06 12:06:56.000000000 +0100
+++ src/cheat.c 2007-01-09 17:58:12.000000000 +0100
@@ -5668,8 +5668,9 @@
if(doSearch)
{
- /* ----- initialize search ----- */
- InitializeNewSearch(search);
+ if(!doneSaveMemory)
+ /* ----- initialize search ----- */
+ InitializeNewSearch(search);
if( (sel == kMenu_ValueEqual) || (sel == kMenu_ValueNearTo) || doneSaveMemory)
{
@@ -6117,8 +6118,9 @@
break;
case kMenu_DoSearch:
- /* ----- initialize search ----- */
- InitializeNewSearch(search);
+ if(!doneMemorySave)
+ /* ----- initialize search ----- */
+ InitializeNewSearch(search);
if((!kSearchOperandNeedsInit[search->lhs] && !kSearchOperandNeedsInit[search->rhs]) || doneMemorySave)
{
You don't get it : now the cheat engine ALWAYS loads the old format ... More investigation is needed before I submit anything ...Also I don't know why the cheat engine doesn't load old format.Stephh wrote:The "load old format" option doesn't seem to work correctly as the old cheats now seem to be always loaded ... It's a good news that old format is still supported, but the option should do something ...
Over and over again I say, I don't use and can't understand old format so that I don't know the cause.
The cheat.c file has to be rewritten to use the same "conventions" as the other files and move out of it what shoudn't really be there ... So I won't accept any new source file once MAME 0.111u3 is out ... This will give you time to work on the cheats and fix Pugsy's "mistakes" ......? Please more easy English.Stephh wrote:Once all this is fixed, I'll ask you to stop further development on this file (what else do you need anyway ?) as the cheat.c file needs special work and a huge rewrite, not to add new stuff, but to have a source file which is "compatible" with all the other ones in MAME ...


Don't believe Pugsy !
I have made the shift to "minimum" search mode completely so that I don't know other modes.
I can't understand it.
Anyway, I have started fourth update to re-check current difficult cheat source file.
OK and sorry.Stephh wrote: found the bug that affects the "classic" and "advanced" search ("minimum" was working correctly) : you ALWAYS initialised the search, thus the 0 results ...
I have made the shift to "minimum" search mode completely so that I don't know other modes.
"convention" ?Stephh wrote:The cheat.c file has to be rewritten to use the same "conventions" as the other files
I can't understand it.
Anyway, I have started fourth update to re-check current difficult cheat source file.