openMSX cheat finder

Page 1/2
| 2

By Vampier

Prophet (2397)

Vampier's picture

21-03-2005, 09:26

Well after endless bitching moaning and complaining to the devers I I took up the challenge myself to start writing a cheat finder. It turned out to be easier then expected. Currently it only works on non mapped roms (if you are lucky it will work on mapped roms aswell)

Anyway the code

###########################################################
#  openMSX TCL cheat finder version 0.2
#
# (c) copyright 2005 Patrick van Arkel all rights reserved
#
# Credits 
# - Maarten ter Huurne  for giving me hints and tips
# - Wouter for giving me an initial script
#   (I took a different approach though :)
#
# Currently supported
# - searchval [value] search with value
#   init with memcomp [value]
#
# - comparision search 
#   Init with compcheat
#   * bigger
#   * smaller
#   * equal
#   * notequal
#
###########################################################

# set an array outside the procedures
# this will be used inside the procedures
set  memcomp(0) 0

# to init the whole process make a snapshot and look for a value
# if a value is not found at that address the value will be set to 999
# the number of 999 has been chosen because an 8-bit value can be 255 max
proc cheatstart { cheatval } {
	global memcomp
	for { set i 0 } { $i <= 65535 } { incr i } {
		set memcomp($i) [debug read memory $i]
		if {$memcomp($i) == $cheatval} {puts "addr $i : has value $memcomp($i)"}
		if {$memcomp($i) != $cheatval} {set memcomp($i) 999}

	}
return True
}

# the 2nd step of the search fucntion. This will use the inital snapshot
# to look for values. If a value isn't found the value is again set to 999
# repeat this function until a value is found.

proc searchval { cheatval } {
	global memcomp
	set temp memcomp
		for { set i 0 } { $i <= 65535 } { incr i } {
		if {$memcomp($i) != 999 } {
			if {[debug read memory $i] == $cheatval} {puts "addr $i : has value [debug read memory $i]"}
			if {[debug read memory $i] != $cheatval} {set memcomp($i) 999}
			}
		}		
}

# to use the cheat use this in the console
# debug write memory [address] [value]
#
# the address can be inputed hexdecimal like
# debug write memory 0x0256 0x99
#
# or decimal like
# debug write memory 21056 99
#
# or a combination of the above



# -----------------------------------------------
# Compare search bigger / smaller / equal
# -----------------------------------------------

# comparision init (snapshot)
proc compcheat {} {
	global memcomp
	for { set i 0 } { $i <= 65535 } { incr i } {
		set memcomp($i) [debug read memory $i]
	}
return True
}

#search bigger
proc bigger {} {
	global memcomp
		for { set i 0 } { $i <= 65535 } { incr i } {
		if {$memcomp($i) != 999 } {
			if {[debug read memory $i] > $memcomp($i)} {
				puts "addr $i : has value [debug read memory $i] was $memcomp($i)"
				set memcomp($i) [debug read memory $i]
				} else {
					set memcomp($i) 999
				}

			}
		}		
}

# search smaller
proc smaller {} {
	global memcomp
		for { set i 0 } { $i <= 65535 } { incr i } {
		if {$memcomp($i) != 999 } {
			if {[debug read memory $i] < $memcomp($i)} {
				puts "addr $i : has value [debug read memory $i] was $memcomp($i)"
				set memcomp($i) [debug read memory $i]
				} else {
					set memcomp($i) 999
				}

			}
		}		
}

# search equal
proc equal {} {
	global memcomp
		for { set i 0 } { $i <= 65535 } { incr i } {
		if {$memcomp($i) != 999 } {
			if {[debug read memory $i] == $memcomp($i)} {
				puts "addr $i : has value [debug read memory $i] was $memcomp($i)"
				set memcomp($i) [debug read memory $i]
				} else {
					set memcomp($i) 999
				}

			}
		}		
}

# search NOT equal
proc notequal {} {
	global memcomp
		for { set i 0 } { $i <= 65535 } { incr i } {
		if {$memcomp($i) != 999 } {
			if {[debug read memory $i] != $memcomp($i)} {
				puts "addr $i : has value [debug read memory $i] was $memcomp($i)"
				set memcomp($i) [debug read memory $i]
				} else {
					set memcomp($i) 999
				}

			}
		}		
}

I will write a few scripts more for comparsion lookup (this is for values that are hard to guess like life bars and such)

The best part maybe (for the blueMSX team that is) is that it is compatible with that emulator Smile So Gaze has some help with finding cheats Smile

A few cheats:

Thexder 1
pos 62164 value 255 (255% life)
pos 62166 value 255 (255% max energy)

Golvelius 1
pos 57417 value 255 (gold 2550)
pos 57405 value 255 (life bar has 255 hits)

Galaga
pos 57358 value 99 (99 life)

Zanac 1
pos 57610 value 255 (254 life +1 on the screen itself)

Metal gear 1
pos 50485 value 0x99 (99 rations)
pos 50433 value 0xff (a lot of handgun ammo)

bubble bobble
pos 56054 value 255 (255 x life)
pos 63363 value stage (which stage to warp to next decr stage with 1 for the right stage)

Usas
pos 49753 value 255 (a load of money)

Aleste
pos 49168 value 98 (99 x life)

Ashguine 2
pos 49174 value 255 (255 life containers)
pos 49186 value 99  (99 keys)

Familice Parodic
pos 57347 value 0x99 (98x life)

Mon Mon Monster
pos 57400 value 99 (99 life containers)
pos 57388 value 0x99 (99 rocks)

Maze Of Galious
pos 0xE051 value 1 (max exp Aphrodite thanks BiFi)
pos 0xE055 value 1 (max exp Popolon thanks BiFi)
pos 57414 value 255 (arrows) 
pos 57416 value 255 (coins) 
pos 57418 value 255 (keys)
pos 57430 value 255 (max vit Popolon)
pos 57426 value 255 (max vit Aphrodite )

Vampire killer
pos 50197 value 32 (Simon has a full powerbar)

Super Laydock Mission Striker
Pos 58099 value 255 (255 life containers)

Girly block
pos 57392 value 255 (power bar full)

Anyway here are a few screenshots which I just made

forum.openmsx.org/images/cheats/golv.png

forum.openmsx.org/images/cheats/thex.png

forum.openmsx.org/images/cheats/bub.png

It needs some fine tuning and stuff, but the main stuff already works ;)

Login or register to post comments

By mars2000you

Enlighted (6252)

mars2000you's picture

21-03-2005, 16:43

Strange that the visitors on MRC don't seem to like your cheats (no reactions !)Sad

Vampier, excellent work ! Smile

By NYYRIKKI

Enlighted (5938)

NYYRIKKI's picture

21-03-2005, 17:08

It's allways nice to have new features to emulators, I hope that in future this will become a whole debuging environment! (Something like Super-X)

BTW MSX tR users should be able to use at least some of these cheats also in real hardware by using 2MSX & Enough lives. (Look Download / Utils / Misc)

By Vampier

Prophet (2397)

Vampier's picture

21-03-2005, 17:28

###########################################################
#  openMSX TCL cheat finder version 0.3
#
# (c) copyright 2005 Patrick van Arkel all rights reserved
#
# Credits 
#
# - Maarten ter Huurne  for giving me hints and tips
#
# - Wouter for giving me an initial script 
#   (I took a different approach though :)
# 
# - Johan van Leur for writing the bluemsx trainer
#   which inspired me to make this
#
#
#
# Currently supported
# - searchval [value] search with value
#   init with memcomp [value]
#
# - comparision search 
#   Init with compcheat
#   * bigger
#   * smaller
#   * equal
#   * notequal
#
###########################################################

# set an array outside the procedures
# this will be used inside the procedures
set  memcomp(0) 0

# to init the whole process make a snapshot and look for a value
# if a value is not found at that address the value will be set to 999
# the number of 999 has been chosen because an 8-bit value can be 255 max
proc cheatstart { cheatval } {
	global memcomp
	for { set i 0 } { $i <= 65535 } { incr i } {
		set memcomp($i) [debug read memory $i]
		if {$memcomp($i) == $cheatval} {puts "addr [format 0x%04X $i] : has value $memcomp($i)"} else {set memcomp($i) 999}

	}
return True
}

# the 2nd step of the search fucntion. This will use the inital snapshot
# to look for values. If a value isn't found the value is again set to 999
# repeat this function until a value is found.

proc searchval { cheatval } {
	global memcomp
		for { set i 0 } { $i <= 65535 } { incr i } {
		if {$memcomp($i) != 999 } {
			if {[debug read memory $i] == $cheatval} {puts "addr [format 0x%04X $i] : has value [debug read memory $i]"} else {set memcomp($i) 999}
			}
		}		
}

# to use the cheat use this in the console
# debug write memory [address] [value]
#
# the address can be inputed hexdecimal like
# debug write memory 0x0256 0x99
#
# or decimal like
# debug write memory 21056 99
#
# or a combination of the above



# -----------------------------------------------
# Compare search bigger / smaller / equal
# -----------------------------------------------

# comparision init (snapshot)
proc compcheat {} {
	global memcomp
	for { set i 0 } { $i <= 65535 } { incr i } {
		set memcomp($i) [debug read memory $i]
	}
return True
}

#search bigger
proc bigger {} {
	global memcomp
		for { set i 0 } { $i <= 65535 } { incr i } {
		if {$memcomp($i) != 999 } {
			if {[debug read memory $i] > $memcomp($i)} {
				puts "addr [format 0x%04X $i] : has value [debug read memory $i] was $memcomp($i)"
				set memcomp($i) [debug read memory $i]
				} else {
					set memcomp($i) 999
				}

			}
		}		
}

# search smaller
proc smaller {} {
	global memcomp
		for { set i 0 } { $i <= 65535 } { incr i } {
		if {$memcomp($i) != 999 } {
			if {[debug read memory $i] < $memcomp($i)} {
				puts "addr [format 0x%04X $i] : has value [debug read memory $i] was $memcomp($i)"
				set memcomp($i) [debug read memory $i]
				} else {
					set memcomp($i) 999
				}

			}
		}		
}

# search equal
proc equal {} {
	global memcomp
		for { set i 0 } { $i <= 65535 } { incr i } {
		if {$memcomp($i) != 999 } {
			if {[debug read memory $i] == $memcomp($i)} {
				puts "addr [format 0x%04X $i] : has value [debug read memory $i] was $memcomp($i)"
				set memcomp($i) [debug read memory $i]
				} else {
					set memcomp($i) 999
				}

			}
		}		
}

# search NOT equal
proc notequal {} {
	global memcomp
		for { set i 0 } { $i <= 65535 } { incr i } {
		if {$memcomp($i) != 999 } {
			if {[debug read memory $i] != $memcomp($i)} {
				puts "addr [format 0x%04X $i]b : has value [debug read memory $i] was $memcomp($i)"
				set memcomp($i) [debug read memory $i]
				} else {
					set memcomp($i) 999
				}

			}
		}		
}

version 0.3 has been released... I have to ask the the DEVers of openMSX about naming convention. But this script is pretty much done this way Smile

By snout

Ascended (15187)

snout's picture

21-03-2005, 18:06

Personally, I'm not that much af a cheater (except for sound tests and other extras that can be found in games), but I think many people will like this script a lot Wink

By cax

Prophet (3738)

cax's picture

21-03-2005, 18:32

Well, about the lack of "WOW" in this topic.
I think that if someone already runs emulator that have save-state support, he maybe have no need to cheat...

By mars2000you

Enlighted (6252)

mars2000you's picture

21-03-2005, 18:37

Cax, there are all kind of gamers : some will use the save states feature, others will prefer the 'old" features like saving on SRAM, disk or even tape ....

It's the same with the cheats : some will try the game with a cheat and then will try the game without cheat ....

It's part of the fun ! Smile

By Vampier

Prophet (2397)

Vampier's picture

21-03-2005, 19:57

The Idea behind the cheat is to actually enjoy games a bit more which you played over and over again. Or sometimes you just want do do a quick game of metal gear (destroying metal gear in 10 minutes.. it can be done)

Cheats are not mandantory and do not change the game. Just do not overdo it getting addicted to cheating Smile

By Vampier

Prophet (2397)

Vampier's picture

23-03-2005, 09:05

Thexder 1 
pos 62164 value 255 (255% life) 
pos 62166 value 255 (255% max energy) 

Golvelius 1 
pos 57417 value 255 (gold 2550) 
pos 57405 value 255 (life bar has 255 hits) 

Galaga 
pos 57358 value 99 (99 life) 

Zanac 1 
pos 57610 value 255 (254 life +1 on the screen itself) 

Metal gear 1 
pos 50485 value 0x99 (99 rations) 
pos 50433 value 0xff (a lot of handgun ammo) 
pos 0XC131 value 48 (Full power bar) 

bubble bobble 
pos 56054 value 255 (255 x life) 
pos 63363 value stage (which stage to warp to next decr stage with 1 for the right stage) 

Usas 
pos 49753 value 255 (a load of money) 

Aleste 
pos 49168 value 98 (99 x life) 

Ashguine 2 
pos 49174 value 255 (255 life containers) 
pos 49186 value 99  (99 keys) 

familice Parodic 
pos 57347 value 0x99 (98x life) 
pos 0XE025 value 255 a lot of eggs 

Mon Mon Monster 
pos 57400 value 99 (99 life containers) 
pos 57388 value 0x99 (99 rocks) 

Maze Of Galious 
pos 0xE051 value 1 (max exp Aphrodite thanks BiFi) 
pos 0xE055 value 1 (max exp Popolon thanks BiFi) 
pos 57414 value 255 (arrows) 
pos 57416 value 255 (coins) 
pos 57418 value 255 (keys) 
pos 57430 value 255 (max vit Popolon) 
pos 57426 value 255 (max vit Aphrodite ) 

Vampire killer 
pos 50197 value 32 (Simon has a full powerbar) 

Super Laydock Mission Striker 
Pos 58099 value 255 (255 life containers) 

Girly block 
pos 57392 value 255 (power bar full) 

Combine these and get a complete power up when picking up a energy container 
pos 0xE032 value 255 
pos 0xE4A6 value 255 

Space Manbow 
pos 0xcb08 value 16 (full strength bar) 
pos 0xcb0f 0x99 (99 lives)

Fantasm Soldier 1
pos 0xf064 val 255 (a lot of life)

Aleste 2
pos 0xC840 val 99 (99 lives)

1942 MSX2 version
Pos 0xED2F val 255 (255 lives)

Gryzor
pos 0xE2C9 val 255 (255 power units)

Strategic Mars
pos 0xC33F val 255 (a load of money)
pos 0xC33F val 255 (a load of money)
pos 0xC1BC val (full power blue bar.. do not exceed 14!)

super laydock 2
pos 0x6817  val 255 (power bar filled with 255 units)

Metal Gear 2
0xCA53 snake life
0xD601 snake handgun ammo
0xD605 snake sub machine gun ammo
0xD619 amount of C4 explosives
0xDFEA garbage compacter x position on the screen

F1 Spirit
Pos 0xE331 val 1 (first place)

Feedback
0xD212 25 (move fast and move in and out of the screen)
0xD212 255 (255 missles)
0xD218 255 (255 life containers)

Undeadline
0xD2A8 255 (life bar full and beyond)
0xBAD5 8 (EXP points to give yourself... untested)

Crossblaim
0xEEBB 0x99 \
0xEEBC 0x99  |- (999999 gold BD BC BB)
0xEEBD 0x99 /

Hydelide
0xA7BE 100 (give you power up after killing one enemy)
0xA7BE 100 (full life bar)

Higemaru
0xE53A 0 (0 enemies on a ship left to kill for the gate to the boss to open up)

Update of the cheats... from now on I will put the cheats into a database Smile

By Vampier

Prophet (2397)

Vampier's picture

25-03-2005, 00:29

For those who are interrested in the new script (most has changed) it is in the openMSX CVS

By JonnyTanna

Supporter (9)

JonnyTanna's picture

07-02-2009, 06:47

Does this work with Fmsx?

I am trying to get it to work with PSPMSX: MSX Emulator for PSP v1.4.1 by ZX-81.

Please help, I just want some cheats for Metal Gear

Page 1/2
| 2