Skip to content

Commit 63ef4ca

Browse files
committed
Added support for Super Mario Sunshine and Tiwlight Princess (Both GC/Wii versions)
1 parent 52b2cc8 commit 63ef4ca

File tree

3 files changed

+120
-0
lines changed

3 files changed

+120
-0
lines changed

source/modules/games/GMSE01-0.lua

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

source/modules/games/GZ2E01-0.lua

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
-- The Legend of Zelda - Twilight Princess (NTSC v1.0)
2+
3+
local core = require("games.core")
4+
5+
local game = {
6+
memorymap = {}
7+
}
8+
9+
local controllers = {
10+
[1] = 0x804343F0 + 0xC * 0,
11+
[2] = 0x804343F0 + 0xC * 1,
12+
[3] = 0x804343F0 + 0xC * 2,
13+
[4] = 0x804343F0 + 0xC * 3,
14+
}
15+
16+
local controller_struct = {
17+
[0x0] = { type = "short", name = "controller.%d.buttons.pressed" },
18+
[0x2] = { type = "sbyte", name = "controller.%d.joystick.x" },
19+
[0x3] = { type = "sbyte", name = "controller.%d.joystick.y" },
20+
[0x4] = { type = "sbyte", name = "controller.%d.cstick.x" },
21+
[0x5] = { type = "sbyte", name = "controller.%d.cstick.y" },
22+
[0x6] = { type = "byte", name = "controller.%d.analog.l" },
23+
[0x7] = { type = "byte", name = "controller.%d.analog.r" },
24+
[0xA] = { type = "byte", name = "controller.%d.plugged" },
25+
}
26+
27+
for port, address in ipairs(controllers) do
28+
for offset, info in pairs(controller_struct) do
29+
game.memorymap[address + offset] = {
30+
type = info.type,
31+
debug = info.debug,
32+
name = info.name:format(port),
33+
}
34+
end
35+
end
36+
37+
game.translateAxis = core.translateAxis
38+
game.translateTriggers = core.translateTriggers
39+
40+
return game

source/modules/games/RZDE01-0.lua

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
-- The Legend of Zelda - Twilight Princess Wii (NTSC v1.0)
2+
3+
local core = require("games.core")
4+
5+
local game = {
6+
memorymap = {}
7+
}
8+
9+
local controllers = {
10+
[1] = 0x804C2F08 + 0xC * 0,
11+
[2] = 0x804C2F08 + 0xC * 1,
12+
[3] = 0x804C2F08 + 0xC * 2,
13+
[4] = 0x804C2F08 + 0xC * 3,
14+
}
15+
16+
local controller_struct = {
17+
[0x0] = { type = "short", name = "controller.%d.buttons.pressed" },
18+
[0x2] = { type = "sbyte", name = "controller.%d.joystick.x" },
19+
[0x3] = { type = "sbyte", name = "controller.%d.joystick.y" },
20+
[0x4] = { type = "sbyte", name = "controller.%d.cstick.x" },
21+
[0x5] = { type = "sbyte", name = "controller.%d.cstick.y" },
22+
[0x6] = { type = "byte", name = "controller.%d.analog.l" },
23+
[0x7] = { type = "byte", name = "controller.%d.analog.r" },
24+
[0xA] = { type = "byte", name = "controller.%d.plugged" },
25+
}
26+
27+
for port, address in ipairs(controllers) do
28+
for offset, info in pairs(controller_struct) do
29+
game.memorymap[address + offset] = {
30+
type = info.type,
31+
debug = info.debug,
32+
name = info.name:format(port),
33+
}
34+
end
35+
end
36+
37+
game.translateAxis = core.translateAxis
38+
game.translateTriggers = core.translateTriggers
39+
40+
return game

0 commit comments

Comments
 (0)