Skip to content

Commit

Permalink
SFR2049 Improvements
Browse files Browse the repository at this point in the history
- Add Velocity to OSD
- Add a button to unlock cheats
- Add a few addresses to RAM watches
  • Loading branch information
Isotarge committed Jan 3, 2017
1 parent f9773f9 commit fc40a1f
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 0 deletions.
@@ -1,4 +1,10 @@
SystemID N64
118E84 d h 1 RDRAM Cheats Enabled
118E88 d h 1 RDRAM Cheats Enabled
118E8C d h 1 RDRAM Cheats Enabled
118E90 d h 1 RDRAM Cheats Enabled
118E94 d h 1 RDRAM Cheats Enabled
118E98 d h 1 RDRAM Cheats Enabled
170D70 d f 1 RDRAM Velocity
170F54 d f 1 RDRAM X Position
170F58 d f 1 RDRAM Y Position
Expand Down
11 changes: 11 additions & 0 deletions Watch/San Francisco Rush 2049 (USA).wch
@@ -1,4 +1,14 @@
SystemID N64
11648C d h 1 RDRAM Cheats Unlocked
116490 d h 1 RDRAM Cheats Unlocked
116494 d h 1 RDRAM Cheats Unlocked
116498 d h 1 RDRAM Cheats Unlocked
11649C d h 1 RDRAM Cheats Unlocked
1164A0 w h 1 RDRAM Cheats Unlocked
13A0B4 d h 1 RDRAM Coin Collected Thingy
13A110 d h 1 RDRAM Coin Collected Thingy
13A350 d h 1 RDRAM Coin Collected Thingy
14978C b h 1 RDRAM Map Index?
14A298 d f 1 RDRAM Velocity
14A47C d f 1 RDRAM X Position
14A480 d f 1 RDRAM Y Position
Expand All @@ -12,4 +22,5 @@ SystemID N64
14A554 d f 1 RDRAM Rotation?
14A558 d f 1 RDRAM Rotation?
14A55C d f 1 RDRAM Rotation?
15201C d h 1 RDRAM Map Collision Data Pointer

30 changes: 30 additions & 0 deletions games/rush_2049.lua
Expand Up @@ -4,6 +4,8 @@ local Game = {
rot_speed = 100,
max_rot_units = 65535,
Memory = { -- Version order: N64 USA, N64 PAL
["cheat_base"] = {0x11648C, 0x118E84},
["number_of_cheats"] = {22, 24},
["velocity"] = {0x14A298, 0x170D70},
["x_position"] = {0x14A47C, 0x170F54},
["y_position"] = {0x14A480, 0x170F58},
Expand All @@ -27,6 +29,12 @@ function Game.detectVersion(romName, romHash)
return true;
end

function Game.unlockCheats()
for i = 1, Game.Memory.number_of_cheats[version] do
mainmemory.writebyte(Game.Memory.cheat_base[version] + i - 1, 0x01);
end
end

function Game.getXPosition()
return mainmemory.readfloat(Game.Memory.x_position[version], true);
end
Expand Down Expand Up @@ -59,4 +67,26 @@ function Game.setVelocity(value)
return mainmemory.writefloat(Game.Memory.velocity[version], value, true);
end

function Game.initUI()
ScriptHawk.UI.form_controls["Unlock Cheats Button"] = forms.button(ScriptHawk.UI.options_form, "Unlock Cheats", Game.unlockCheats, ScriptHawk.UI.col(10), ScriptHawk.UI.row(0), ScriptHawk.UI.col(4) + 10, ScriptHawk.UI.button_height);
end

Game.OSD = {
{"X", Game.getXPosition},
{"Y", Game.getYPosition},
{"Z", Game.getZPosition},
{"Separator", 1},
{"Velocity", Game.getVelocity},
{"dY"},
{"dXZ"},
{"Separator", 1},
{"Max dY"},
{"Max dXZ"},
{"Odometer"},
{"Separator", 1},
{"Rot. X", Game.getXRotation},
{"Facing", Game.getYRotation},
{"Rot. Z", Game.getZRotation},
};

return Game;

0 comments on commit fc40a1f

Please sign in to comment.