This isn’t scripted or anything, it’s just an approach to use the regex functionality of Notepad++ to convert cheats to a base format that needs less tweaking.
Caveats:
ePSXe format for each cheat heading (name) starts with #.
pcsxr encapsulates the heading in square brackets [ ] and can indicate an always enabled cheat with [*name]. You’ll probably want to search and replace the asterisk * with an empty space.
Windows format End Of Line (EOL) is CR/LF whille Mac uses CR and Linux uses LF. This affects the \v\v shown below. If you’re on Mac/Linux change it from two \v to just one.
For Grandia SCUS-94457 I’ll grab my first two cheats:
(ePSXe format)
#Inf Money
80010164 FFFF
#Time is 0:00:00
8003D684 0000
8003D686 0000
Search: ^#(.*)
Replace: [\1]
(to pcsxr format)
[Inf Money]
80010164 FFFF
[Time is 0:00:00]
8003D684 0000
8003D686 0000
Search: ([[:xdigit:]]{8}).([[:xdigit:]]{4})
Replace: \1+\2+
[Inf Money]
80010164+FFFF+
[Time is 0:00:00]
8003D684+0000+
8003D686+0000+
Search: \[(.*)\]\v\v
Replace: cheat0_desc = "\1"\n
cheat0_desc = "Inf Money"
80010164+FFFF+
cheat0_desc = "Time is 0:00:00"
8003D684+0000+
8003D686+0000+
Search: ([[:xdigit:]]{8}.[[:xdigit:]]{4}.*\+)\v\v
Replace: \1
cheat0_desc = "Inf Money"
80010164+FFFF+cheat0_desc = "Time is 0:00:00"
8003D684+0000+8003D686+0000+
Search: ([[:xdigit:]]{8}.[[:xdigit:]]{4}.*)\+
Replace: cheat0_code = "\1"\ncheat0_enable = false \n\n
cheat0_desc = "Inf Money"
cheat0_code = "80010164+FFFF"
cheat0_enable = false
cheat0_desc = "Time is 0:00:00"
cheat0_code = "8003D684+0000+8003D686+0000"
cheat0_enable = false
Add header of "cheats = 2 " and rename "cheat0" to
reflect 0 +1 sequentially to the last cheat where the
header total is the last numbered cheat +1 (since we
start at 0):
cheats = 2
cheat0_desc = "Inf Money"
cheat0_code = "80010164+FFFF"
cheat0_enable = false
cheat1_desc = "Time is 0:00:00"
cheat1_code = "8003D684+0000+8003D686+0000"
cheat1_enable = false