90 Commits

Author SHA1 Message Date
Stenzek
1952869cdc
Cheats: Author field should be exported 2025-01-15 21:02:56 +10:00
Stenzek
05b0b03fd6
Cheats: Order special characters before alpha characters 2025-01-11 12:51:33 +10:00
Stenzek
93a7e7cef5
Cheats: Add bounds check to 5107/5147 2025-01-11 12:40:46 +10:00
PugsyMAME
a26cac18e9
Cheats: Added register cheat types 5107 & 5147 (#3352)
This is new cheat type uses the general purpose cheat registers in a relative easy method to allow arrays of arrays cheats to be quickly created and will also cut down massively on cheats. For instance this method allows the following 15 cheats for Vandal Hearts II which would otherwise need 18886 separate cheats to replicate:

#Technique Slot Modifier\[MASTER] Select Slot Number for following cheats to act on (1 - 1349)
518500F1 001CF3C3
514500F2 0000000F
514500F3 0000????
514500F4 0000D0D0
OptionRange = 1:1349
#Technique Slot Modifier\Select Weapon
510700F1 000000??
OptionRange = 0x00:0xFF
#Technique Slot Modifier\Technique 1 Learned
510700F1 00020001
#Technique Slot Modifier\Select Technique 1
510700F1 000300??
OptionRange = 0x00:0xFF
#Technique Slot Modifier\Technique 2 Learned
510700F1 00040001
#Technique Slot Modifier\Select Technique 2
510700F1 000500??
OptionRange = 0x00:0xFF
#Technique Slot Modifier\Technique 3 Learned
510700F1 00060001
#Technique Slot Modifier\Select Technique 3
510700F1 000700??
OptionRange = 0x00:0xFF
#Technique Slot Modifier\Technique 4 Learned
510700F1 00080001
#Technique Slot Modifier\Select Technique 4
510700F1 000900??
OptionRange = 0x00:0xFF
#Technique Slot Modifier\Technique 5 Learned
510700F1 000A0001
#Technique Slot Modifier\Select Technique 5
510700F1 000B00??
OptionRange = 0x00:0xFF
#Technique Slot Modifier\Technique 6 Learned
510700F1 000C0001
#Technique Slot Modifier\Select Technique 6
510700F1 000D00??
OptionRange = 0x00:0xFF
#Technique Slot Modifier\100% (Max) Technique Learned
510700F1 000E0064
2025-01-11 12:37:03 +10:00
Stenzek
78ccbc710c
Cheats: Fix error while exporting 2025-01-04 12:52:26 +10:00
Stenzek
88cd086633
Cheats: Eliminate extra newlines during code editing 2025-01-03 13:36:58 +10:00
Stenzek
468c907fd6
Cheats: Compiler warning fix 2024-12-29 22:34:31 +10:00
Stenzek
e1bd5690ac
Misc: Slightly reduce include pollution from settings.h 2024-12-21 15:28:27 +10:00
Stenzek
cc567d9498
Cheats: Fix hash-suffixed files incorrectly loading 2024-12-10 20:19:26 +10:00
Stenzek
3a661a1c3d
Cheats: Move file clearing into core
Needed for Android.
2024-12-08 02:58:50 +10:00
Stenzek
eeee1e691a
Cheats: Support importing native format
Compared to only replacing the .cht file.
2024-11-29 13:10:59 +10:00
Stenzek
208e6c4b35
Cheats: Strip whitespace from code names 2024-11-29 12:49:51 +10:00
Stenzek
3f41dcc97d
Log: Add option coloured variants 2024-11-11 14:04:48 +10:00
PugsyMAME
5caadec34d
Cheat bugfix and new A8 cheat type (#3328)
* Bugfix for import and entering new cheats

Added needed g_emu_thread->reloadCheats calls after the reloadList() calls on entering a new code or importing new codes.

Without it I had to import new codes and then manually edit one of them for it to show up in the cheat counts and possibly even work

* Added Cheat Type A8

Added cheat type A8 which is the byte equivalent of the A7 cheat type as there will be a need of this type.

* Changed boolean parameters in last PR

Changed boolean parameters in last PR as per discord
2024-11-11 14:01:50 +10:00
Stenzek
0fc719c4cf
Cheats: Simplify code merging on import
The save file already does replacement.
2024-11-03 17:38:50 +10:00
Stenzek
a8bc364a2b
Cheats: Fix importing hash-formatted codes 2024-11-03 17:38:27 +10:00
Stenzek
6551358212
Log: Replace channel string search with bitset
Knocks off around ~20KB of code.
2024-10-31 14:41:33 +10:00
Stenzek
814f22f58b
Cheats: Only apply overclock when it is not already enabled 2024-10-30 15:19:10 +10:00
Stenzek
1d21ca61e7
Cheats: Allow hex literal in option ranges 2024-10-27 12:32:41 +10:00
Stenzek
218df625df
Cheats: Fix crash on parsing invalid cheat 2024-10-27 12:32:41 +10:00
Stenzek
a8d846ac8f
Cheats: Use libzip for reading archive 2024-10-22 21:25:27 +10:00
Stenzek
c11b250efe
Cheats: Search archives with disc set serials
That way the list is auto-populated for all discs.
2024-10-21 20:25:07 +10:00
Stenzek
6cc350a459
Cheats: Serialize access to zips
Prevents the UI thread from trashing the zip struct while the
emulation thread is also reading.
2024-10-20 12:43:11 +10:00
Stenzek
baa9065d2e
System: Add taints to save states
This informs the user they are loading a save state that at some point
had potentially-game-breaking options enabled, and a reset is necessary
to clear them.
2024-10-19 01:13:32 +10:00
Stenzek
4a57ccc3e8
Cheats: Strip leading * when importing old files 2024-10-14 12:44:23 +10:00
Stenzek
e0b6f6f1b2
Cheats: Rewrite cheat management system 2024-10-13 16:43:22 +10:00
PugsyMAME
88bc3a2278
Fixed typo in F4 Cheat Type code (#3300)
Typo in my code, this fix will make it work properly on multiple find & replaces.
2024-09-22 21:05:44 +10:00
Stenzek
3dca598063
Log: Switch to enum class
Need to change the channel to a bitset too.. the string lookups are
horribly slow, and conflict when one is a prefix of another.
2024-09-21 22:26:06 +10:00
Stenzek
e2a3fe14f0
Cheats: Prevent inlining of memory functions
Clang is way too eager here and inlines the whole thing hundreds of
times within CheatList::Apply().
2024-09-09 18:53:51 +10:00
Stenzek
1956575710
Cheats: Fix detection of ungrouped cheat import 2024-09-08 11:49:59 +10:00
Stenzek
7f4e5d55db
Misc: Update copyright headers 2024-09-01 22:08:31 +10:00
Stenzek
a2f98541b3
Misc: Slim down some header includes 2024-08-04 14:49:55 +10:00
Stenzek
3a83c4265c
Misc: Fix a bunch of code analysis warnings
Some of which were even actual errors.
2024-08-02 23:56:07 +10:00
Stenzek
6ce9e571ed
Misc: Purge remaining ByteStream references 2024-07-29 17:27:32 +10:00
Stenzek
4e922a34a7
Log: Simplify macros 2024-05-24 02:08:14 +10:00
Stenzek
b6d019db66
Misc: Replace log printf calls with fmt 2024-05-24 00:29:49 +10:00
Stenzek
73cee9f705
Settings: Add UserResources to EmuFolders
Allowing some resources, such as fonts/sounds to be overridden by the
user.
2024-01-10 22:46:57 +10:00
Stenzek
79c226efff
SmallString: fmt -> format, format -> sprintf 2023-12-13 21:06:15 +10:00
Stenzek
3dfc3bd2ba
CPU: Fix incorrect scratchpad masking 2023-11-06 18:09:27 +10:00
Stenzek
ac0601f408 Common: Drop String, add SmallString 2023-09-23 14:14:52 +10:00
Stenzek
1ec6aee5bf Host: Split translation macros dependent on return type 2023-08-20 12:40:47 +10:00
Connor McLaughlin
8c7a192128 Misc: Add copyright/license statement to applicable files
Should've did this in the beginning.
2022-12-04 21:03:49 +10:00
Connor McLaughlin
10f98106dd Misc: Normalize code vs serial usage 2022-10-05 18:29:44 +10:00
Connor McLaughlin
b42b5501f6 UI: Massive revamp, new features and improvements 2022-07-22 21:19:54 +10:00
Connor McLaughlin
b5bf3593c4 ByteStream: Move routines from FileSystem to ByteStream 2022-07-21 17:29:57 +10:00
Silent
506796a335
Add 5106, 5146, 5186 codes for indirect reads from a register code 2022-04-15 19:04:02 +02:00
Connor McLaughlin
e12474ac91 Cheats: Use safe memory access routines 2021-09-10 15:53:15 +10:00
PugsyMAME
0ebb791323
New F6 Cheat Type (IF,ELSE IF, ELSE structure)
Cheat Type F6 lets you perform cheats in IF / ELSE IF / ELSE constructs along 
with multiple conditions for each one.

It supports conditions  D0, D1, D2, D3, E0, E1, E2, E3, A0, A1, A2, A3, D7 and 
two new types that will only be available in the F6 conditions :- 
E4 & E5 which are bit comparisons on bytes (set and clear). 

Any of those types which are "block conditionals" like D7 will be treated as a 
single condition with the other conditions so you wont need to worry about 
extra 00000000 FFFFs just for them (infact you can drop them completely apart
from the last 00000000 FFFF, which you can also drop if you have no trailing
cheat lines after the end of the construct.


#IF / ELSE IF / ELSE Statement Example with Notes
80001000 00000001   Setup Test Condition 1
80001004 00000002   Setup Test Condition 2
80001008 00000003   Setup Test Condition 3
8000100C 00000004   Setup Test Condition 4

                    1F = IF, last two digits determine the number of conditions to check
                    F600000x  x = 0 All conditions must be true, x = 1 At least One condition must be true                  
F6000000 1F000004   Check the next 4 lines as the conditions for the IF loop to be taken

D0001000 00000001  )
D0001004 00000002  )Conditions
D0001008 00000003  )
D000100C 00000004  )

80001010 00005555    Poke(s)
00000000 0000FFFF  End of IF Statement

F6000000 E15E1F02  E15E1F = ELSE IF (same format as IF) - Can have multiple ELSE IF Blocks or none at all
D0001008 00000003  )
D000100C 00000005  )Conditions
80001010 00008888     Poke(s)
00000000 0000FFFF  End of ELSE IF Statement 

F6000000 E15E0000  E15E = ELSE (no need for conditions - this will poke if the others dont)
80001010 0000AAAA    Poke(s)
00000000 0000FFFF End of ELSE Statement



#Multiple Test Using Joypad Left Thumb Directions, Look at Address 1100 in Debugger
F6000000 1F000001  
D7020002 00100000
90001100 50205055
90001104 53534552 
90001108 20204445
9000110C 20202020
F6000000 E15E1F01
D7020002 00400000
90001100 4E574F44
90001104 45525020
90001108 44455353
9000110C 20202020
F6000000 E15E1F01
D7020002 00800000
90001100 5446454C
90001104 45525020
90001108 44455353
9000110C 20202020
F6000000 E15E1F01
D7020002 00200000
90001100 48474952
90001104 52502054
90001108 45535345
9000110C 20202044
F6000000 E15E0000
90001100 20202020
90001104 20202020
90001108 20202020
9000110C 20202020
00000000 0000FFFF
2021-08-21 15:08:34 +01:00
Silent
ebe862561d
Fix A0, A1, A2, A3 cheats 2021-08-19 22:21:07 +02:00
PugsyMAME
106dc2951d
Fixed cheat type 52 only working with 1st subtype
Fixed typo in ExtCheatRegistersCompare, which made it so that only 52 type 5200 worked,
2021-07-31 11:14:15 +01:00