mirror of
https://github.com/Retropex/dolphin.git
synced 2025-06-03 16:02:33 +02:00
Added Metroid Prime 1 New Play Control NTSC-J support
This commit is contained in:
parent
397fce56d0
commit
f27efd4537
@ -23,7 +23,11 @@ void HackManager::run_active_mods() {
|
||||
{
|
||||
case 0x38000018:
|
||||
active_game = Game::MENU;
|
||||
active_region = Region::NTSC;
|
||||
active_region = Region::NTSC_U;
|
||||
break;
|
||||
case 0x806ddaec:
|
||||
active_game = Game::MENU;
|
||||
active_region = Region::NTSC_J;
|
||||
break;
|
||||
case 0x7c0000d0:
|
||||
active_game = Game::MENU;
|
||||
@ -31,7 +35,11 @@ void HackManager::run_active_mods() {
|
||||
break;
|
||||
case 0x4e800020:
|
||||
active_game = Game::PRIME_1;
|
||||
active_region = Region::NTSC;
|
||||
active_region = Region::NTSC_U;
|
||||
break;
|
||||
case 0x53687566:
|
||||
active_game = Game::PRIME_1;
|
||||
active_region = Region::NTSC_J;
|
||||
break;
|
||||
case 0x7c962378:
|
||||
active_game = Game::PRIME_1;
|
||||
@ -39,7 +47,7 @@ void HackManager::run_active_mods() {
|
||||
break;
|
||||
case 0x4bff64e1:
|
||||
active_game = Game::PRIME_2;
|
||||
active_region = Region::NTSC;
|
||||
active_region = Region::NTSC_U;
|
||||
break;
|
||||
case 0x80830000:
|
||||
active_game = Game::PRIME_2;
|
||||
@ -48,7 +56,7 @@ void HackManager::run_active_mods() {
|
||||
case 0x80010070:
|
||||
if (PowerPC::HostRead_U32(0x80576ae8) == 0x7d415378) {
|
||||
active_game = Game::PRIME_3;
|
||||
active_region = Region::NTSC;
|
||||
active_region = Region::NTSC_U;
|
||||
}
|
||||
else {
|
||||
active_game = Game::INVALID_GAME;
|
||||
@ -69,7 +77,7 @@ void HackManager::run_active_mods() {
|
||||
u32 region_code = PowerPC::HostRead_U32(0x80000000);
|
||||
if (region_code == FOURCC('G', 'M', '8', 'E')) {
|
||||
active_game = Game::PRIME_1_GCN;
|
||||
active_region = Region::NTSC;
|
||||
active_region = Region::NTSC_U;
|
||||
}
|
||||
else if (region_code == FOURCC('G', 'M', '8', 'P')) {
|
||||
active_game = Game::PRIME_1_GCN;
|
||||
@ -77,7 +85,7 @@ void HackManager::run_active_mods() {
|
||||
}
|
||||
else if (region_code == FOURCC('G', '2', 'M', 'E')) {
|
||||
active_game = Game::PRIME_2_GCN;
|
||||
active_region = Region::NTSC;
|
||||
active_region = Region::NTSC_U;
|
||||
}
|
||||
else if (region_code == FOURCC('G', '2', 'M', 'P')) {
|
||||
active_game = Game::PRIME_2_GCN;
|
||||
@ -85,7 +93,7 @@ void HackManager::run_active_mods() {
|
||||
}
|
||||
else if (region_code == FOURCC('R', 'M', '3', 'E')) {
|
||||
active_game = Game::PRIME_3_WII;
|
||||
active_region = Region::NTSC;
|
||||
active_region = Region::NTSC_U;
|
||||
}
|
||||
else if (region_code == FOURCC('R', 'M', '3', 'P')) {
|
||||
active_game = Game::PRIME_3_WII;
|
||||
|
@ -23,7 +23,7 @@ void AutoEFB::run_mod(Game game, Region region) {
|
||||
should_use = read32(visor_base + 0x34) != 1u;
|
||||
}
|
||||
else if (game == Game::PRIME_3_WII) {
|
||||
if (region == Region::NTSC)
|
||||
if (region == Region::NTSC_U)
|
||||
{
|
||||
const u32 visor_base = read32(read32(read32(cplayer_ptr_address) + 0x2184) + 0x35a0);
|
||||
should_use = read32(visor_base + 0x34) != 1u;
|
||||
@ -46,7 +46,7 @@ void AutoEFB::run_mod(Game game, Region region) {
|
||||
void AutoEFB::init_mod(Game game, Region region) {
|
||||
switch (game) {
|
||||
case Game::PRIME_2:
|
||||
if (region == Region::NTSC) {
|
||||
if (region == Region::NTSC_U) {
|
||||
cplayer_ptr_address = 0x804e87dc;
|
||||
}
|
||||
else if (region == Region::PAL) {
|
||||
@ -54,7 +54,7 @@ void AutoEFB::init_mod(Game game, Region region) {
|
||||
}
|
||||
break;
|
||||
case Game::PRIME_2_GCN:
|
||||
if (region == Region::NTSC) {
|
||||
if (region == Region::NTSC_U) {
|
||||
cplayer_ptr_address = 0x803dcbdc;
|
||||
}
|
||||
else if (region == Region::PAL) {
|
||||
@ -62,7 +62,7 @@ void AutoEFB::init_mod(Game game, Region region) {
|
||||
}
|
||||
break;
|
||||
case Game::PRIME_3:
|
||||
if (region == Region::NTSC) {
|
||||
if (region == Region::NTSC_U) {
|
||||
cplayer_ptr_address = 0x805c6c6c;
|
||||
}
|
||||
else if (region == Region::PAL) {
|
||||
@ -70,7 +70,7 @@ void AutoEFB::init_mod(Game game, Region region) {
|
||||
}
|
||||
break;
|
||||
case Game::PRIME_3_WII:
|
||||
if (region == Region::NTSC)
|
||||
if (region == Region::NTSC_U)
|
||||
{
|
||||
cplayer_ptr_address = 0x805c4f98;
|
||||
}
|
||||
|
@ -11,17 +11,26 @@ void CutBeamFxMP1::init_mod(Game game, Region region) {
|
||||
u32 gunfx_offset;
|
||||
u32 transform_ctor_offset;
|
||||
u32 advance_particles_offset;
|
||||
if (region == Region::NTSC) {
|
||||
gunfx_offset = 0xfffffd68; // 0x8018c410 - 0x8018c6a8;
|
||||
transform_ctor_offset = 0xac; // 0x80348d2c - 0x80348c80;
|
||||
advance_particles_offset = 0xfffffeb0; // 0x80139870 - 0x801399c0;
|
||||
if (region == Region::NTSC_U)
|
||||
{
|
||||
gunfx_offset = 0xfffffd68; // 0x8018c410 - 0x8018c6a8;
|
||||
transform_ctor_offset = 0xac; // 0x80348d2c - 0x80348c80;
|
||||
advance_particles_offset = 0xfffffeb0; // 0x80139870 - 0x801399c0;
|
||||
}
|
||||
else if (region == Region::PAL) {
|
||||
else if (region == Region::NTSC_J)
|
||||
{
|
||||
gunfx_offset = 0x8e8; // 0x8018cf90 - 0x8018c6a8;
|
||||
transform_ctor_offset = 0xfffffb70; // 0x803487f0 - 0x80348c80;
|
||||
advance_particles_offset = 0x4b0; // 0x80139e70 - 0x801399c0;
|
||||
}
|
||||
else if (region == Region::PAL)
|
||||
{
|
||||
gunfx_offset = 0;
|
||||
transform_ctor_offset = 0;
|
||||
advance_particles_offset = 0;
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -11,15 +11,18 @@ public:
|
||||
void init_mod(Game game, Region region) override {
|
||||
switch (game) {
|
||||
case Game::PRIME_1:
|
||||
if (region == Region::NTSC) {
|
||||
if (region == Region::NTSC_U) {
|
||||
code_changes.emplace_back(0x80290edc, 0x4e800020);
|
||||
}
|
||||
else if (region == Region::PAL) {
|
||||
code_changes.emplace_back(0x80291258, 0x4e800020);
|
||||
}
|
||||
else { // region == Region::NTSC_J
|
||||
code_changes.emplace_back(0x802919bc, 0x4e800020);
|
||||
}
|
||||
break;
|
||||
case Game::PRIME_2:
|
||||
if (region == Region::NTSC) {
|
||||
if (region == Region::NTSC_U) {
|
||||
code_changes.emplace_back(0x80292204, 0x4e800020);
|
||||
}
|
||||
else if (region == Region::PAL) {
|
||||
@ -27,7 +30,7 @@ public:
|
||||
}
|
||||
break;
|
||||
case Game::PRIME_3:
|
||||
if (region == Region::NTSC) {
|
||||
if (region == Region::NTSC_U) {
|
||||
code_changes.emplace_back(0x804852cc, 0x4e800020);
|
||||
}
|
||||
else if (region == Region::PAL) {
|
||||
@ -35,7 +38,7 @@ public:
|
||||
}
|
||||
break;
|
||||
case Game::PRIME_3_WII:
|
||||
if (region == Region::NTSC)
|
||||
if (region == Region::NTSC_U)
|
||||
{
|
||||
code_changes.emplace_back(0x80486880, 0x4e800020);
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ namespace prime {
|
||||
run_mod_menu(region);
|
||||
break;
|
||||
case Game::PRIME_1:
|
||||
run_mod_mp1();
|
||||
run_mod_mp1(region);
|
||||
break;
|
||||
case Game::PRIME_2:
|
||||
run_mod_mp2(region);
|
||||
@ -139,16 +139,19 @@ namespace prime {
|
||||
}
|
||||
|
||||
void FpsControls::run_mod_menu(Region region) {
|
||||
if (region == Region::NTSC) {
|
||||
if (region == Region::NTSC_U) {
|
||||
handle_cursor(0x80913c9c, 0x80913d5c, 0.95f, 0.90f);
|
||||
}
|
||||
else if (region == Region::NTSC_J) {
|
||||
handle_cursor(0x805a7da8, 0x805a7dac, 0.95f, 0.90f);
|
||||
}
|
||||
else if (region == Region::PAL) {
|
||||
u32 cursor_address = PowerPC::HostRead_U32(0x80621ffc);
|
||||
handle_cursor(cursor_address + 0xdc, cursor_address + 0x19c, 0.95f, 0.90f);
|
||||
}
|
||||
}
|
||||
|
||||
void FpsControls::run_mod_mp1() {
|
||||
void FpsControls::run_mod_mp1(Region region) {
|
||||
handle_beam_visor_switch(prime_one_beams, prime_one_visors);
|
||||
|
||||
// Allows freelook in grapple, otherwise we are orbiting (locked on) to something
|
||||
@ -242,7 +245,7 @@ namespace prime {
|
||||
// right vector for this xf makes the gun not lag. Won't fix what ain't broken
|
||||
writef32(pitch, arm_cannon_model_matrix + 0x24);
|
||||
u32 tweak_player_address = 0;
|
||||
if (region == Region::NTSC) {
|
||||
if (region == Region::NTSC_U) {
|
||||
tweak_player_address = read32(read32(GPR(13) - 0x6410));
|
||||
}
|
||||
else if (region == Region::PAL) {
|
||||
@ -334,7 +337,7 @@ namespace prime {
|
||||
return;
|
||||
}
|
||||
|
||||
if (active_game == Game::PRIME_3_WII && active_region == Region::NTSC)
|
||||
if (active_game == Game::PRIME_3_WII && active_region == Region::NTSC_U)
|
||||
cplayer_address = read32(read32(mp3_static.cplayer_ptr_address) + 0x2184);
|
||||
else
|
||||
cplayer_address = read32(read32(read32(mp3_static.cplayer_ptr_address) + 0x04) + 0x2184);
|
||||
@ -353,7 +356,7 @@ namespace prime {
|
||||
bool lock_camera = false;
|
||||
|
||||
u32 obj_list_iterator = 0;
|
||||
if (active_game == Game::PRIME_3 && active_region == Region::NTSC)
|
||||
if (active_game == Game::PRIME_3 && active_region == Region::NTSC_U)
|
||||
obj_list_iterator = read32(read32(mp3_static.cplayer_ptr_address) + 0x1018) + 4;
|
||||
else
|
||||
obj_list_iterator = read32(read32(mp3_static.cplayer_ptr_address - 4) + 0x1018) + 4;
|
||||
@ -464,6 +467,9 @@ namespace prime {
|
||||
|
||||
void FpsControls::init_mod(Game game, Region region) {
|
||||
switch (game) {
|
||||
case Game::MENU:
|
||||
init_mod_menu(region);
|
||||
break;
|
||||
case Game::PRIME_1:
|
||||
init_mod_mp1(region);
|
||||
break;
|
||||
@ -528,7 +534,7 @@ namespace prime {
|
||||
|
||||
void FpsControls::add_control_state_hook_mp3(u32 start_point, Region region) {
|
||||
Game active_game = GetHackManager()->get_active_game();
|
||||
if (region == Region::NTSC)
|
||||
if (region == Region::NTSC_U)
|
||||
{
|
||||
if (active_game == Game::PRIME_3)
|
||||
{
|
||||
@ -560,14 +566,14 @@ namespace prime {
|
||||
}
|
||||
}
|
||||
code_changes.emplace_back(start_point + 0x08, 0x8063002c); // lwz r3, 0x2c(r3) ; deref player camera control base address into r3
|
||||
if (active_game == Game::PRIME_3_WII && region == Region::NTSC)
|
||||
if (active_game == Game::PRIME_3_WII && region == Region::NTSC_U)
|
||||
code_changes.emplace_back(start_point + 0x0c, 0x60000000); // nop ; doesn't apply with non trilogy mp3 ntsc
|
||||
else
|
||||
code_changes.emplace_back(start_point + 0x0c, 0x80630004); // lwz r3, 0x04(r3) ; the point at which the function which was hooked
|
||||
code_changes.emplace_back(start_point + 0x10, 0x80632184); // lwz r3, 0x2184(r3) ; should have r31 equal to the
|
||||
// ; object which is being modified
|
||||
code_changes.emplace_back(start_point + 0x14, 0x7c03f800); // cmpw r3, r31 ; if r31 is player camera control (in r3)
|
||||
if (active_game != Game::PRIME_3_WII && region != Region::NTSC)
|
||||
if (active_game != Game::PRIME_3_WII && region != Region::NTSC_U)
|
||||
code_changes.emplace_back(start_point + 0x18, 0x4d820020); // beqlr ; then DON'T store the value of
|
||||
// ; r6 into 0x78+(player camera control)
|
||||
else // can't jump to LR since the function is not called but jumped to instead
|
||||
@ -576,7 +582,7 @@ namespace prime {
|
||||
code_changes.emplace_back(start_point + 0x1c, 0x7fe3fb78); // mr r3, r31 ; otherwise do it
|
||||
code_changes.emplace_back(start_point + 0x20, 0x90c30078); // stw r6, 0x78(r3) ; this is the normal action
|
||||
// ; which was overwritten by a bl to this mini-function
|
||||
if (active_game != Game::PRIME_3_WII && region != Region::NTSC)
|
||||
if (active_game != Game::PRIME_3_WII && region != Region::NTSC_U)
|
||||
code_changes.emplace_back(start_point + 0x24, 0x4e800020); // blr ; LR wasn't changed, so we're
|
||||
// ; safe here (same case as beqlr)
|
||||
else // not sure why but it won't call this function and rather jump to it
|
||||
@ -1055,8 +1061,20 @@ namespace prime {
|
||||
code_changes.emplace_back(0x80471cfc, 0x41480000);
|
||||
}
|
||||
|
||||
void FpsControls::init_mod_menu(Region region)
|
||||
{
|
||||
if (region == Region::NTSC_J)
|
||||
{
|
||||
// prevent wiimote pointer feedback to move the cursor
|
||||
code_changes.emplace_back(0x80487160, 0x60000000);
|
||||
code_changes.emplace_back(0x80487164, 0x60000000);
|
||||
// Prevent recentering the cursor on Y axis
|
||||
code_changes.emplace_back(0x80487098, 0x60000000);
|
||||
}
|
||||
}
|
||||
|
||||
void FpsControls::init_mod_mp1(Region region) {
|
||||
if (region == Region::NTSC) {
|
||||
if (region == Region::NTSC_U) {
|
||||
// This instruction change is used in all 3 games, all 3 regions. It's an update to what I believe
|
||||
// to be interpolation for player camera pitch The change is from fmuls f0, f0, f1 (0xec000072) to
|
||||
// fmuls f0, f1, f1 (0xec010072), where f0 is the output. The higher f0 is, the faster the pitch
|
||||
@ -1113,8 +1131,31 @@ namespace prime {
|
||||
mp1_static.camera_uid_address = 0x804c8948;
|
||||
powerups_ptr_address = 0x804c3c14;
|
||||
}
|
||||
// If I add NTSC JP
|
||||
else {}
|
||||
else { // region == Region::NTSC-J
|
||||
// Same as NTSC but slightly offset
|
||||
code_changes.emplace_back(0x80099060, 0xec010072);
|
||||
code_changes.emplace_back(0x800992b4, 0x60000000);
|
||||
code_changes.emplace_back(0x8018460c, 0x60000000);
|
||||
code_changes.emplace_back(0x801835e4, 0x60000000);
|
||||
code_changes.emplace_back(0x80176ff0, 0x60000000);
|
||||
code_changes.emplace_back(0x802fb234, 0xd23f009c);
|
||||
code_changes.emplace_back(0x801a074c, 0x60000000);
|
||||
|
||||
code_changes.emplace_back(0x80075e50, 0x48000044);
|
||||
add_beam_change_code_mp1(0x8018f0c4);
|
||||
|
||||
mp1_static.yaw_vel_address = 0x804d3fb8;
|
||||
mp1_static.pitch_address = 0x804d427c;
|
||||
mp1_static.pitch_goal_address = 0x804c136c;
|
||||
mp1_static.angvel_limiter_address = 0x804d3ff4;
|
||||
mp1_static.orbit_state_address = 0x804d41a0;
|
||||
mp1_static.lockon_address = 0x804c0333;
|
||||
mp1_static.tweak_player_address = 0x804de278;
|
||||
mp1_static.cplayer_address = 0x804d3ea0;
|
||||
mp1_static.object_list_ptr_address = 0x804bfeb0;
|
||||
mp1_static.camera_uid_address = 0x804c4c88;
|
||||
powerups_ptr_address = 0x804bff54;
|
||||
}
|
||||
|
||||
active_visor_offset = 0x1c;
|
||||
powerups_size = 8;
|
||||
@ -1126,7 +1167,7 @@ namespace prime {
|
||||
}
|
||||
|
||||
void FpsControls::init_mod_mp1_gc(Region region) {
|
||||
if (region == Region::NTSC) {
|
||||
if (region == Region::NTSC_U) {
|
||||
code_changes.emplace_back(0x8000f63c, 0x48000048);
|
||||
code_changes.emplace_back(0x8000e538, 0x60000000);
|
||||
code_changes.emplace_back(0x80016ee4, 0x4e800020);
|
||||
@ -1166,7 +1207,7 @@ namespace prime {
|
||||
}
|
||||
|
||||
void FpsControls::init_mod_mp2(Region region) {
|
||||
if (region == Region::NTSC) {
|
||||
if (region == Region::NTSC_U) {
|
||||
code_changes.emplace_back(0x8008ccc8, 0xc0430184);
|
||||
code_changes.emplace_back(0x8008cd1c, 0x60000000);
|
||||
code_changes.emplace_back(0x80147f70, 0x60000000);
|
||||
@ -1218,7 +1259,7 @@ namespace prime {
|
||||
}
|
||||
|
||||
void FpsControls::init_mod_mp2_gc(Region region) {
|
||||
if (region == Region::NTSC) {
|
||||
if (region == Region::NTSC_U) {
|
||||
code_changes.emplace_back(0x801b00b4, 0x48000050);
|
||||
code_changes.emplace_back(0x801aef58, 0x60000000);
|
||||
code_changes.emplace_back(0x80015ed8, 0x4e800020);
|
||||
@ -1251,7 +1292,7 @@ namespace prime {
|
||||
|
||||
void FpsControls::init_mod_mp3(Region region)
|
||||
{
|
||||
if (region == Region::NTSC)
|
||||
if (region == Region::NTSC_U)
|
||||
{
|
||||
code_changes.emplace_back(0x80080ac0, 0xec010072);
|
||||
code_changes.emplace_back(0x8014e094, 0x60000000);
|
||||
@ -1265,7 +1306,7 @@ namespace prime {
|
||||
|
||||
// Remove visors menu
|
||||
code_changes.emplace_back(0x800614ec, 0x48000018);
|
||||
add_control_state_hook_mp3(0x80005880, Region::NTSC);
|
||||
add_control_state_hook_mp3(0x80005880, Region::NTSC_U);
|
||||
add_grapple_slide_code_mp3(0x8017f2a0);
|
||||
|
||||
mp3_static.cplayer_ptr_address = 0x805c6c6c;
|
||||
@ -1315,7 +1356,7 @@ namespace prime {
|
||||
|
||||
void FpsControls::init_mod_mp3_wii(Region region)
|
||||
{
|
||||
if (region == Region::NTSC)
|
||||
if (region == Region::NTSC_U)
|
||||
{
|
||||
code_changes.emplace_back(0x80080be8, 0xec010072);
|
||||
code_changes.emplace_back(0x801521f0, 0x60000000);
|
||||
@ -1329,7 +1370,7 @@ namespace prime {
|
||||
|
||||
// Remove visors menu
|
||||
code_changes.emplace_back(0x800617e4, 0x48000018);
|
||||
add_control_state_hook_mp3(0x80005880, Region::NTSC);
|
||||
add_control_state_hook_mp3(0x80005880, Region::NTSC_U);
|
||||
add_grapple_slide_code_mp3(0x80182c9c);
|
||||
|
||||
mp3_static.cplayer_ptr_address = 0x805c4f98;
|
||||
|
@ -30,7 +30,7 @@ namespace prime {
|
||||
void mp3_handle_cursor(bool lock);
|
||||
|
||||
void run_mod_menu(Region region);
|
||||
void run_mod_mp1();
|
||||
void run_mod_mp1(Region region);
|
||||
void run_mod_mp2(Region region);
|
||||
void run_mod_mp3();
|
||||
void run_mod_mp1_gc();
|
||||
@ -48,6 +48,7 @@ namespace prime {
|
||||
void add_strafe_code_mp1_ntsc();
|
||||
void add_strafe_code_mp1_pal();
|
||||
|
||||
void init_mod_menu(Region region);
|
||||
void init_mod_mp1(Region region);
|
||||
void init_mod_mp2(Region region);
|
||||
void init_mod_mp3(Region region);
|
||||
|
@ -10,7 +10,7 @@ public:
|
||||
void init_mod(Game game, Region region) override {
|
||||
switch (game) {
|
||||
case Game::PRIME_1:
|
||||
if (region == Region::NTSC) {
|
||||
if (region == Region::NTSC_U) {
|
||||
code_changes.emplace_back(0x80186408, 0x3863b6d8);
|
||||
code_changes.emplace_back(0x80186414, 0x3863b6d8);
|
||||
}
|
||||
@ -18,9 +18,13 @@ public:
|
||||
code_changes.emplace_back(0x801866a0, 0x3863f618);
|
||||
code_changes.emplace_back(0x801866ac, 0x3863f618);
|
||||
}
|
||||
else { // region == Region::NTSC-J
|
||||
code_changes.emplace_back(0x80186F88, 0x3863b958);
|
||||
code_changes.emplace_back(0x80186F94, 0x3863b958);
|
||||
}
|
||||
break;
|
||||
case Game::PRIME_1_GCN:
|
||||
if (region == Region::NTSC) {
|
||||
if (region == Region::NTSC_U) {
|
||||
code_changes.emplace_back(0x80011d3c, 0x3863d780);
|
||||
code_changes.emplace_back(0x80011d48, 0x3863d780);
|
||||
}
|
||||
@ -30,7 +34,7 @@ public:
|
||||
}
|
||||
break;
|
||||
case Game::PRIME_2:
|
||||
if (region == Region::NTSC) {
|
||||
if (region == Region::NTSC_U) {
|
||||
code_changes.emplace_back(0x8014baa4, 0x3c60804e);
|
||||
code_changes.emplace_back(0x8014baa8, 0x38633508);
|
||||
code_changes.emplace_back(0x8014baac, 0x4e800020);
|
||||
@ -42,7 +46,7 @@ public:
|
||||
}
|
||||
break;
|
||||
case Game::PRIME_2_GCN:
|
||||
if (region == Region::NTSC) {
|
||||
if (region == Region::NTSC_U) {
|
||||
code_changes.emplace_back(0x8000ec08, 0x3c60803d);
|
||||
code_changes.emplace_back(0x8000ec0c, 0x6063aa28);
|
||||
code_changes.emplace_back(0x8000ec10, 0x4e800020);
|
||||
|
@ -83,7 +83,7 @@ bool Noclip::has_control_mp3()
|
||||
Game game = GetHackManager()->get_active_game();
|
||||
Region region = GetHackManager()->get_active_region();
|
||||
u32 state_mgr_ptr_offset = 0x28;
|
||||
if (game == Game::PRIME_3_WII && region == Region::NTSC)
|
||||
if (game == Game::PRIME_3_WII && region == Region::NTSC_U)
|
||||
state_mgr_ptr_offset += 4;
|
||||
u32 state_mgr = read32(mp3_static.state_mgr_ptr_address + state_mgr_ptr_offset);
|
||||
if (!mem_check(state_mgr))
|
||||
@ -273,7 +273,7 @@ void Noclip::run_mod_mp3(bool has_control)
|
||||
Game game = GetHackManager()->get_active_game();
|
||||
Region region = GetHackManager()->get_active_region();
|
||||
u32 offset = 0x28;
|
||||
if (game == Game::PRIME_3_WII && region == Region::NTSC)
|
||||
if (game == Game::PRIME_3_WII && region == Region::NTSC_U)
|
||||
offset += 4;
|
||||
u32 cplayer_address = read32(read32(mp3_static.state_mgr_ptr_address + offset) + 0x2184);
|
||||
if (!mem_check(cplayer_address))
|
||||
@ -318,7 +318,7 @@ void Noclip::init_mod(Game game, Region region)
|
||||
switch (game)
|
||||
{
|
||||
case Game::PRIME_1:
|
||||
if (region == Region::NTSC)
|
||||
if (region == Region::NTSC_U)
|
||||
{
|
||||
noclip_code_mp1(0x804d3c20, 0x800053a4, 0x8000bb80);
|
||||
code_changes.emplace_back(0x80196ab4, 0x60000000);
|
||||
@ -334,6 +334,22 @@ void Noclip::init_mod(Game game, Region region)
|
||||
mp1_static.object_list_ptr_address = 0x804bfc30;
|
||||
mp1_static.camera_uid_address = 0x804c4a08;
|
||||
}
|
||||
else if (region == Region::NTSC_J)
|
||||
{
|
||||
noclip_code_mp1(0x804de278, 0x800053a4, 0x8000bb80);
|
||||
code_changes.emplace_back(0x80197634, 0x60000000);
|
||||
code_changes.emplace_back(0x8019763c, 0x60000000);
|
||||
code_changes.emplace_back(0x80197644, 0x60000000);
|
||||
code_changes.emplace_back(0x80197658, 0xd0410084);
|
||||
code_changes.emplace_back(0x8019765c, 0xd0210094);
|
||||
code_changes.emplace_back(0x80197660, 0xd00100a4);
|
||||
code_changes.emplace_back(0x80197664, 0x481b11c1);
|
||||
|
||||
mp1_static.control_flag_address = 0x805aecb8;
|
||||
mp1_static.cplayer_address = 0x804d3ea0;
|
||||
mp1_static.object_list_ptr_address = 0x804bfeb0;
|
||||
mp1_static.camera_uid_address = 0x804c4c88;
|
||||
}
|
||||
else if (region == Region::PAL)
|
||||
{
|
||||
noclip_code_mp1(0x804d7b60, 0x800053a4, 0x8000bb80);
|
||||
@ -355,7 +371,7 @@ void Noclip::init_mod(Game game, Region region)
|
||||
}
|
||||
break;
|
||||
case Game::PRIME_1_GCN:
|
||||
if (region == Region::NTSC)
|
||||
if (region == Region::NTSC_U)
|
||||
{
|
||||
noclip_code_mp1_gc(0x8046b97c, 0x805afd00, 0x80052e90);
|
||||
// For whatever reason CPlayer::Teleport calls SetTransform then SetTranslation
|
||||
@ -396,7 +412,7 @@ void Noclip::init_mod(Game game, Region region)
|
||||
}
|
||||
break;
|
||||
case Game::PRIME_2:
|
||||
if (region == Region::NTSC)
|
||||
if (region == Region::NTSC_U)
|
||||
{
|
||||
noclip_code_mp2(0x804e87dc, 0x800053a4, 0x8000d694);
|
||||
code_changes.emplace_back(0x80160d68, 0x60000000);
|
||||
@ -435,7 +451,7 @@ void Noclip::init_mod(Game game, Region region)
|
||||
}
|
||||
break;
|
||||
case Game::PRIME_2_GCN:
|
||||
if (region == Region::NTSC)
|
||||
if (region == Region::NTSC_U)
|
||||
{
|
||||
noclip_code_mp2_gc(0x803dcbdc, 0x80420000, 0x8004abc8);
|
||||
code_changes.emplace_back(0x801865d8, 0x60000000);
|
||||
@ -466,7 +482,7 @@ void Noclip::init_mod(Game game, Region region)
|
||||
}
|
||||
break;
|
||||
case Game::PRIME_3:
|
||||
if (region == Region::NTSC)
|
||||
if (region == Region::NTSC_U)
|
||||
{
|
||||
noclip_code_mp3(0x805c6c40, 0x80004380, 0x8000bbfc);
|
||||
code_changes.emplace_back(0x801784ac, 0x60000000);
|
||||
@ -499,7 +515,7 @@ void Noclip::init_mod(Game game, Region region)
|
||||
}
|
||||
break;
|
||||
case Game::PRIME_3_WII:
|
||||
if (region == Region::NTSC)
|
||||
if (region == Region::NTSC_U)
|
||||
{
|
||||
noclip_code_mp3(0x805c4f6c, 0x80004380, 0x8000bee8);
|
||||
code_changes.emplace_back(0x8017c054, 0x60000000);
|
||||
@ -658,7 +674,7 @@ void Noclip::on_state_change(ModState old_state)
|
||||
{
|
||||
switch (GetHackManager()->get_active_region())
|
||||
{
|
||||
case Region::NTSC:
|
||||
case Region::NTSC_U:
|
||||
{
|
||||
const u32 cplayer_address = read32(read32(mp3_static.state_mgr_ptr_address + 0x2c) + 0x2184);
|
||||
if (mem_check(cplayer_address))
|
||||
@ -727,7 +743,7 @@ void Noclip::on_state_change(ModState old_state)
|
||||
{
|
||||
switch (GetHackManager()->get_active_region())
|
||||
{
|
||||
case Region::NTSC:
|
||||
case Region::NTSC_U:
|
||||
{
|
||||
const u32 cplayer_address = read32(read32(mp3_static.state_mgr_ptr_address + 0x2c) + 0x2184);
|
||||
if (mem_check(cplayer_address))
|
||||
|
@ -5,22 +5,26 @@
|
||||
namespace prime {
|
||||
class SkipCutscene : public PrimeMod {
|
||||
public:
|
||||
void run_mod(Game game, Region region) override {}
|
||||
void run_mod(Game game, Region region) override { }
|
||||
void init_mod(Game game, Region region) override {
|
||||
switch (game)
|
||||
{
|
||||
case Game::PRIME_1:
|
||||
if (region == Region::NTSC)
|
||||
if (region == Region::NTSC_U)
|
||||
{
|
||||
add_return_one(0x800cf054);
|
||||
}
|
||||
else if (region == Region::NTSC_J)
|
||||
{
|
||||
add_return_one(0x800cf3e4);
|
||||
}
|
||||
else if (region == Region::PAL)
|
||||
{
|
||||
add_return_one(0x800cf174);
|
||||
}
|
||||
break;
|
||||
case Game::PRIME_1_GCN:
|
||||
if (region == Region::NTSC)
|
||||
if (region == Region::NTSC_U)
|
||||
{
|
||||
add_return_one(0x801d5528);
|
||||
}
|
||||
@ -30,7 +34,7 @@ public:
|
||||
}
|
||||
break;
|
||||
case Game::PRIME_2:
|
||||
if (region == Region::NTSC)
|
||||
if (region == Region::NTSC_U)
|
||||
{
|
||||
add_return_one(0x800bc4d0);
|
||||
}
|
||||
@ -40,7 +44,7 @@ public:
|
||||
}
|
||||
break;
|
||||
case Game::PRIME_2_GCN:
|
||||
if (region == Region::NTSC)
|
||||
if (region == Region::NTSC_U)
|
||||
{
|
||||
add_return_one(0x80142340);
|
||||
}
|
||||
@ -50,7 +54,7 @@ public:
|
||||
}
|
||||
break;
|
||||
case Game::PRIME_3:
|
||||
if (region == Region::NTSC)
|
||||
if (region == Region::NTSC_U)
|
||||
{
|
||||
add_return_one(0x800b9f30);
|
||||
}
|
||||
@ -60,7 +64,7 @@ public:
|
||||
}
|
||||
break;
|
||||
case Game::PRIME_3_WII:
|
||||
if (region == Region::NTSC)
|
||||
if (region == Region::NTSC_U)
|
||||
{
|
||||
add_return_one(0x800bb930);
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ void SpringballButton::run_mod(Game game, Region region) {
|
||||
case Game::PRIME_3_WII:
|
||||
switch (region)
|
||||
{
|
||||
case Region::NTSC:
|
||||
case Region::NTSC_U:
|
||||
actual_cplayer_address = read32(read32(cplayer_address) + 0x2184);
|
||||
springball_check(actual_cplayer_address + 0x358, actual_cplayer_address + 0x29c);
|
||||
DevInfo("CPlayer", "%08X", cplayer_address);
|
||||
@ -44,7 +44,7 @@ void SpringballButton::run_mod(Game game, Region region) {
|
||||
void SpringballButton::init_mod(Game game, Region region) {
|
||||
switch (game) {
|
||||
case Game::PRIME_1:
|
||||
if (region == Region::NTSC) {
|
||||
if (region == Region::NTSC_U) {
|
||||
cplayer_address = 0x804d3c20;
|
||||
springball_code(0x801476d0);
|
||||
}
|
||||
@ -52,9 +52,13 @@ void SpringballButton::init_mod(Game game, Region region) {
|
||||
cplayer_address = 0x804d7b60;
|
||||
springball_code(0x80147820);
|
||||
}
|
||||
else { // region == Region::NTSC_J
|
||||
cplayer_address = 0x804d3ea0;
|
||||
springball_code(0x80147cd0);
|
||||
}
|
||||
break;
|
||||
case Game::PRIME_2:
|
||||
if (region == Region::NTSC) {
|
||||
if (region == Region::NTSC_U) {
|
||||
cplayer_address = 0x804e87dc;
|
||||
springball_code(0x8010bd98);
|
||||
}
|
||||
@ -64,7 +68,7 @@ void SpringballButton::init_mod(Game game, Region region) {
|
||||
}
|
||||
break;
|
||||
case Game::PRIME_3:
|
||||
if (region == Region::NTSC) {
|
||||
if (region == Region::NTSC_U) {
|
||||
cplayer_address = 0x805c6c6c;
|
||||
springball_code(0x801077d4);
|
||||
}
|
||||
@ -74,7 +78,7 @@ void SpringballButton::init_mod(Game game, Region region) {
|
||||
}
|
||||
break;
|
||||
case Game::PRIME_3_WII:
|
||||
if (region == Region::NTSC) {
|
||||
if (region == Region::NTSC_U) {
|
||||
cplayer_address = 0x805c4f98;
|
||||
springball_code(0x8010c984);
|
||||
}
|
||||
@ -100,7 +104,7 @@ void SpringballButton::springball_code(u32 start_point) {
|
||||
|
||||
void SpringballButton::springball_check(u32 ball_address, u32 movement_address) {
|
||||
if (CheckSpringBallCtl())
|
||||
{
|
||||
{
|
||||
u32 ball_state = read32(ball_address);
|
||||
u32 movement_state = read32(movement_address);
|
||||
|
||||
|
@ -228,7 +228,7 @@ namespace prime {
|
||||
}
|
||||
|
||||
void ViewModifier::init_mod_mp1(Region region) {
|
||||
if (region == Region::NTSC) {
|
||||
if (region == Region::NTSC_U) {
|
||||
mp1_static.camera_ptr_address = 0x804bfc30;
|
||||
mp1_static.active_camera_offset_address = 0x804c4a08;
|
||||
mp1_static.global_fov1_address = 0x805c0e38;
|
||||
@ -244,12 +244,19 @@ namespace prime {
|
||||
mp1_static.gun_pos_address = 0x804e1a24;
|
||||
mp1_static.culling_address = 0x802c8024;
|
||||
}
|
||||
else {}
|
||||
else if (region == Region::NTSC_J) {
|
||||
mp1_static.camera_ptr_address = 0x804bfeb0;
|
||||
mp1_static.active_camera_offset_address = 0x804c4c88;
|
||||
mp1_static.global_fov1_address = 0x80641138;
|
||||
mp1_static.global_fov2_address = 0x8064113c;
|
||||
mp1_static.gun_pos_address = 0x804d398c;
|
||||
mp1_static.culling_address = 0x802c7a3c;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void ViewModifier::init_mod_mp1_gc(Region region) {
|
||||
if (region == Region::NTSC) {
|
||||
if (region == Region::NTSC_U) {
|
||||
mp1_gc_static.camera_mgr_address = 0x8045c5b4;
|
||||
mp1_gc_static.object_list_address = 0x8045a9b8;
|
||||
mp1_gc_static.global_fov1_table_off = -0x7ff0;
|
||||
@ -271,7 +278,7 @@ namespace prime {
|
||||
}
|
||||
|
||||
void ViewModifier::init_mod_mp2(Region region) {
|
||||
if (region == Region::NTSC) {
|
||||
if (region == Region::NTSC_U) {
|
||||
mp2_static.camera_ptr_address = 0x804e7af8;
|
||||
mp2_static.camera_offset_address = 0x804eb9ac;
|
||||
mp2_static.tweakgun_ptr_address = 0x805cb274;
|
||||
@ -289,7 +296,7 @@ namespace prime {
|
||||
}
|
||||
|
||||
void ViewModifier::init_mod_mp2_gc(Region region) {
|
||||
if (region == Region::NTSC) {
|
||||
if (region == Region::NTSC_U) {
|
||||
code_changes.emplace_back(0x801b0b38, 0x60000000);
|
||||
|
||||
mp2_gc_static.state_mgr_address = 0x803db6e0;
|
||||
@ -307,7 +314,7 @@ namespace prime {
|
||||
}
|
||||
|
||||
void ViewModifier::init_mod_mp3(Region region) {
|
||||
if (region == Region::NTSC) {
|
||||
if (region == Region::NTSC_U) {
|
||||
mp3_static.camera_ptr_address = 0x805c6c68;
|
||||
mp3_static.tweakgun_address = 0x8066f87c;
|
||||
mp3_static.culling_address = 0x8031490c;
|
||||
@ -321,7 +328,7 @@ namespace prime {
|
||||
}
|
||||
|
||||
void ViewModifier::init_mod_mp3_wii(Region region) {
|
||||
if (region == Region::NTSC) {
|
||||
if (region == Region::NTSC_U) {
|
||||
mp3_static.camera_ptr_address = 0x805c4f94;
|
||||
mp3_static.tweakgun_address = 0x8067d78c;
|
||||
mp3_static.culling_address = 0x80316a1c;
|
||||
|
@ -27,8 +27,9 @@ enum class Game : int {
|
||||
|
||||
enum class Region : int {
|
||||
INVALID_REGION = -1,
|
||||
NTSC = 0,
|
||||
PAL = 1,
|
||||
NTSC_U = 0,
|
||||
NTSC_J = 1,
|
||||
PAL = 2,
|
||||
MAX_VAL = PAL,
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user