Skip to content

Commit

Permalink
vcs: slightly better clock-money text
Browse files Browse the repository at this point in the history
  • Loading branch information
ThirteenAG committed May 12, 2024
1 parent 32df988 commit 1c13d52
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
1 change: 0 additions & 1 deletion .github/docs/scdaps2.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
## Useful information

- Two versions of the game are compatible, **SLUS-21356** (crc: **C0498D24**) and **SLES-53827** (crc: **ABE2FDE9**).
- Main menu and online are unaffected by main elf plugin, but there's additional SkipIntro plugin that skips menu and loads singleplayer mode automatically.

![](https://i.imgur.com/swnrFGs.jpg)

Expand Down
4 changes: 3 additions & 1 deletion includes/pcsx2/injector.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,8 @@ void MakeLUIORI(uintptr_t at, RegisterID reg, float imm)
injector.WriteMemory32(functor + 0, lui(reg, HIWORD(imm)));
injector.WriteMemory32(functor + 4, ori(reg, reg, LOWORD(imm)));
injector.MakeJMP(functor + 8, at + 4); // should be +8 as well, but it won't work, e.g. two lui instructions in a row
injector.MakeNOP(functor + 12);
injector.WriteMemory32(functor + 12, injector.ReadMemory32(at + 4));
injector.MakeNOP(at + 4);
injector.MakeJMP(at, functor);
}

Expand Down Expand Up @@ -316,5 +317,6 @@ struct injector_t injector =
.MakeRangedNOP = MakeRangedNOP,
.MakeInline = MakeInline,
.MakeInlineLUIORI = MakeInlineLUIORI,
.MakeLUIORI = MakeLUIORI,
.MakeInlineLI = MakeInlineLI
};
1 change: 1 addition & 0 deletions includes/pcsx2/injector.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ struct injector_t {
void (*MakeRangedNOP)(uintptr_t at, uintptr_t until);
uintptr_t(*MakeInline)(size_t instrCount, uintptr_t at, ...);
void (*MakeInlineLUIORI)(uintptr_t at, float imm);
void (*MakeLUIORI)(uintptr_t at, RegisterID reg, float imm);
void (*MakeInlineLI)(uintptr_t at, int32_t imm);
};

Expand Down
16 changes: 9 additions & 7 deletions source/GTAVCS.PCSX2F.WidescreenFix/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ void init()

const float f1_25 = (((4.0f / 3.0f) / (16.0f / 9.0f)) * (10.0f / 6.0f));
float ARDiff = (16.0f / 9.0f) / (Screen.fAspectRatio);
float bar_left_edge_offset_from_right = 11.0f * ARDiff;
float bar_left_edge_offset_from_right = 10.0f * ARDiff;
const float f15 = 15.0f;
float fWeaponIconPos = (360.0f + f15 + 64.0f + (26.0f * ARDiff)); //465.0f
float fWeaponIconSize = 45.5f * ARDiff;
Expand Down Expand Up @@ -389,13 +389,11 @@ void init()
injector.MakeInlineLUIORI(0x31ec64, (fBarsPos + bar_left_edge_offset_from_right)); //money and time pos
injector.MakeInlineLUIORI(0x31ecbc, (fBarsPos + bar_left_edge_offset_from_right)); //money and time pos
injector.MakeInlineLUIORI(0x31eea0, (fBarsPos + bar_left_edge_offset_from_right)); //money and time pos
injector.MakeInlineLUIORI(0x31efe8, 9.0f * ARDiff); //money and time scale
injector.MakeInlineLUIORI(0x31f1d4, 2.0f * ARDiff); // money and time spacing, not adjusted by ws option originally
injector.MakeInlineLUIORI(0x31f5b4, fWeaponIconPos); //weapon icon pos
injector.MakeInlineLUIORI(0x31f648, fWeaponIconSize); // weapon icon size
injector.MakeInlineLUIORI(0x31FB3C, 438.0f - 4.0f); // ammo
injector.MakeInlineLUIORI(0x31FB5C, 444.0f - 4.0f); // ammo
//injector.MakeInlineLUIORI(0x31F8D8, 0.24f * ARDiff); // ammo font size
injector.MakeInlineLUIORI(0x31FB3C, (438.0f - 2.0f)); // ammo pos 1
injector.MakeInlineLUIORI(0x31FB5C, (438.0f - 2.0f) + (6.0f * 0.75f)); // ammo pos 2
injector.MakeInlineLUIORI(0x31F8D8, 0.24f * 0.90f); // ammo font size
injector.MakeInlineLUIORI(0x31ff94, 13.5f - 2.5f);
injector.MakeInlineLUIORI(0x320b40, (405.0f + 10.0f));
injector.MakeInlineLUIORI(0x31f2ac, (float)round_f((64.0f * Screen.fHudScale))); //radar scale
Expand Down Expand Up @@ -443,8 +441,12 @@ void init()
injector.MakeInlineLUIORI(0x3215E8, (4.0f * Screen.fHudScale));

// Clock Text Thingies
float timesc = 10.4375f;
if (Screen.fAspectRatio > (16.0f / 9.0f))
timesc = 10.0f;
injector.MakeLUIORI(0x31efe8, at, timesc * ARDiff); //money and time scale
injector.MakeInlineLUIORI(0x31F1D4, (2.0f * ARDiff));
//injector.MakeInlineLUIORI(0x31F1EC, (4.0f * ARDiff));
injector.MakeInlineLUIORI(0x31F1EC, (4.0f * ARDiff));
injector.MakeInlineLUIORI(0x31F10C, (3.0f * ARDiff));
}
}
Expand Down

0 comments on commit 1c13d52

Please sign in to comment.