fork/m-overlay

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

BkacjiosUpdated a bunch of joystick translations to match games x/y values between -1 and 17277dd1

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