fork/m-overlay

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

BkacjiosMerge pull request #55 from little512/masterec803b9

settings-overhaul
1.1 KiB43 linesraw
1-- Super Monkey Ball (NTSC-J v1.2)
2
3local core = require("games.core")
4
5local game = {
6	memorymap = {}
7}
8
9local addr = 0x801F10C0
10local offset = 0x3C
11
12local controllers = {
13	[1] = addr + offset * 0,
14	[2] = addr + offset * 1,
15	[3] = addr + offset * 2,
16	[4] = addr + offset * 3,
17}
18
19local controller_struct = {
20	[0x0] = { type = "short",	name = "controller.%d.buttons.pressed" },
21	[0x2] = { type = "sbyte",	name = "controller.%d.joystick.x" },
22	[0x3] = { type = "sbyte",	name = "controller.%d.joystick.y" },
23	[0x4] = { type = "sbyte",	name = "controller.%d.cstick.x" },
24	[0x5] = { type = "sbyte",	name = "controller.%d.cstick.y" },
25	[0x6] = { type = "byte",	name = "controller.%d.analog.l" },
26	[0x7] = { type = "byte",	name = "controller.%d.analog.r" },
27	[0xA] = { type = "byte",	name = "controller.%d.plugged" },
28}
29
30for port, address in ipairs(controllers) do
31	for offset, info in pairs(controller_struct) do
32		game.memorymap[address + offset] = {
33			type = info.type,
34			debug = info.debug,
35			name = info.name:format(port),
36		}
37	end
38end
39
40game.translateAxis = core.translateAxis
41game.translateTriggers = core.translateTriggers
42
43return game