fork/m-overlay

git clone https://git.julia.blue/fork/m-overlay

BkacjiosAdded support for Metal Gear Solid - The Twin Snakes (NTSC v1.0) (#90)3df8e17

settings-overhaul
591 B28 linesraw
1-- Metal Gear Solid - The Twin Snakes (NTSC v1.0)
2
3local core = require("games.core")
4
5local game = {
6	memorymap = {}
7}
8
9core.loadGenericControllerMap(0x801E9388, game)
10
11local abs = math.abs
12
13-- These functions seem to apply to many games
14
15function game.translateAxis(x, y)
16	x = x/100
17	y = y/100
18
19	local near = 1 - (abs(abs(x) - abs(y))) * 0.100
20
21	local angle = math.atan2(x, y)
22	local mag = math.sqrt(x*x + y*y)
23
24	-- Reduce the magnitute when x,y values are headed towards a diagonal
25	return x + math.sin(angle) * mag * near * 0.25, y + math.cos(angle) * mag * near * 0.25
26end
27
28return game