Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Support for SSX Tricky (NTSC v1.0) #205

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions source/modules/games/GSTE69-0.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
-- SSX Tricky (NTSC v1.0)

local core = require("games.core")

local game = core.newGame()

local controllers = {
[1] = 0x8072AEA5 + 0x80 * 0,
[2] = 0x8072AEA5 + 0x80 * 1,
}

local controller_struct = {
[0x00] = { type = "u8", name = "controller.%d.plugged" },
[0x03] = { type = "u32", name = "controller.%d.buttons.pressed" },
[0x07] = { type = "u32", name = "controller.%d.buttons.instant" },
[0x13] = { type = "float", name = "controller.%d.joystick.x" },
[0x17] = { type = "float", name = "controller.%d.joystick.y" },
[0x1B] = { type = "float", name = "controller.%d.cstick.x" },
[0x1F] = { type = "float", name = "controller.%d.cstick.y" },
[0x3D] = { type = "u8", name = "controller.%d.analog.byte.l" },
[0x3E] = { type = "u8", name = "controller.%d.analog.byte.r" },
}

for port, address in ipairs(controllers) do
for offset, info in pairs(controller_struct) do
game.memorymap[address + offset] = {
type = info.type,
debug = info.debug,
name = info.name:format(port),
}
end
end

game.translateJoyStick = function(x, y) return x, y end
game.translateCStick = function(x, y) return x, y end
game.translateTriggers = function(l, r) return l, r end

return game